summaryrefslogtreecommitdiff
path: root/Automatically-reuse-Repel.md
diff options
context:
space:
mode:
Diffstat (limited to 'Automatically-reuse-Repel.md')
-rw-r--r--Automatically-reuse-Repel.md21
1 files changed, 8 insertions, 13 deletions
diff --git a/Automatically-reuse-Repel.md b/Automatically-reuse-Repel.md
index 3ac6972..ccc5b8a 100644
--- a/Automatically-reuse-Repel.md
+++ b/Automatically-reuse-Repel.md
@@ -40,21 +40,18 @@ We need to add a `wRepelType` byte that works the same way. It's just one byte s
The file that defines item effects is, predictably, [engine/items/item_effects.asm](../blob/master/engine/items/item_effects.asm). It turns out that Repel, Super Repel, and Max Repel all use the same code, so we don't have to write anything three times.
```diff
- SuperRepelEffect: ; f462
+ SuperRepelEffect:
ld b, 200
jr UseRepel
- ; f466
- MaxRepelEffect: ; f466
+ MaxRepelEffect:
ld b, 250
jr UseRepel
- ; f466
- RepelEffect: ; f46a
+ RepelEffect:
ld b, 100
- ; f46c
- UseRepel: ; f46c
+ UseRepel:
ld a, [wRepelEffect]
and a
ld hl, TextJump_RepelUsedEarlierIsStillInEffect
@@ -67,11 +64,10 @@ The file that defines item effects is, predictably, [engine/items/item_effects.a
jp UseItemText
- TextJump_RepelUsedEarlierIsStillInEffect: ; 0xf47d
+ TextJump_RepelUsedEarlierIsStillInEffect:
; The REPEL used earlier is still in effect.
text_jump Text_RepelUsedEarlierIsStillInEffect
db "@"
- ; 0xf482
```
@@ -80,7 +76,7 @@ The file that defines item effects is, predictably, [engine/items/item_effects.a
Edit [engine/overworld/events.asm](../blob/master/engine/overworld/events.asm):
```diff
- DoRepelStep: ; 96bd7
+ DoRepelStep:
ld a, [wRepelEffect]
and a
ret z
@@ -102,7 +98,6 @@ Edit [engine/overworld/events.asm](../blob/master/engine/overworld/events.asm):
call CallScript
scf
ret
- ; 96beb
```
Note that `UseAnotherRepelScript` hasn't been defined yet, so we'll do that next.
@@ -113,14 +108,14 @@ Note that `UseAnotherRepelScript` hasn't been defined yet, so we'll do that next
Edit [engine/events/misc_scripts_2.asm](../blob/master/engine/events/misc_scripts_2.asm):
```diff
- RepelWoreOffScript:: ; 0x13619
+ RepelWoreOffScript::
opentext
writetext .text
waitbutton
closetext
end
- .text ; 0x13620
+ .text
; REPEL's effect wore off.
text_jump UnknownText_0x1bd308
db "@"