summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIIMarckus <iimarckus@gmail.com>2018-08-18 02:17:06 -0600
committerIIMarckus <iimarckus@gmail.com>2018-08-18 02:18:22 -0600
commit82c53b95659279440ba0a50baf98a9a6564cf19e (patch)
tree18ced7f4c543a0c95ee0580efb43ee1a677d415d
parent629162817ce5e50eacde1ffa4fe9595aa453c44b (diff)
Sync with pokecrystal.
-rwxr-xr-xengine/events/haircut.asm6
-rwxr-xr-xengine/events/shuckle.asm8
-rw-r--r--macros/rst.asm6
3 files changed, 13 insertions, 7 deletions
diff --git a/engine/events/haircut.asm b/engine/events/haircut.asm
index b67e2b2d..55718beb 100755
--- a/engine/events/haircut.asm
+++ b/engine/events/haircut.asm
@@ -1,5 +1,5 @@
BillsGrandfather:
- callba SelectMonFromParty
+ farcall SelectMonFromParty
jr c, .cancel
ld a, [wCurPartySpecies]
ld [wScriptVar], a
@@ -26,7 +26,7 @@ DaisysGrooming:
HaircutOrGrooming:
push hl
- callba SelectMonFromParty
+ farcall SelectMonFromParty
pop hl
jr c, .nope
ld a, [wCurPartySpecies]
@@ -37,7 +37,6 @@ HaircutOrGrooming:
call CopyPokemonName_Buffer1_Buffer3
pop hl
call Random
-.loop
; Bug: Subtracting $ff from $ff fails to set c.
; This can result in overflow into the next data array.
; In the case of getting a grooming from Daisy, we bleed
@@ -45,6 +44,7 @@ HaircutOrGrooming:
; $d0 to ChangeHappiness and returns $73 to the script.
; The end result is that there is a 0.4% chance your
; Pokemon's happiness will not change at all.
+.loop
sub [hl]
jr c, .ok
inc hl
diff --git a/engine/events/shuckle.asm b/engine/events/shuckle.asm
index 37f80db4..b2d81954 100755
--- a/engine/events/shuckle.asm
+++ b/engine/events/shuckle.asm
@@ -34,7 +34,7 @@ GiveShuckle:
ld [hl], LOW(MANIA_OT_ID)
; Nickname.
- ld a, [wPokemonData]
+ ld a, [wPartyCount]
dec a
ld hl, wPartyMonNicknames
call SkipNames
@@ -66,7 +66,7 @@ SpecialShuckleNick:
db "SHUCKIE@"
ReturnShuckle:
- callba SelectMonFromParty
+ farcall SelectMonFromParty
jr c, .refused
ld a, [wCurPartySpecies]
@@ -102,7 +102,7 @@ ReturnShuckle:
jr .CheckOT
.done
- callba CheckCurPartyMonFainted
+ farcall CheckCurPartyMonFainted
jr c, .fainted
ld a, [wCurPartyMon]
ld hl, wPartyMon1Happiness
@@ -114,7 +114,7 @@ ReturnShuckle:
jr nc, .HappyToStayWithYou
xor a ; REMOVE_PARTY
ld [wPokemonWithdrawDepositParameter], a
- callab RemoveMonFromPartyOrBox
+ callfar RemoveMonFromPartyOrBox
ld a, SHUCKIE_RETURNED
.HappyToStayWithYou:
ld [wScriptVar], a
diff --git a/macros/rst.asm b/macros/rst.asm
index 50259c96..23c821d9 100644
--- a/macros/rst.asm
+++ b/macros/rst.asm
@@ -8,6 +8,12 @@ farcall: MACRO ; bank, address
rst FarCall
ENDM
+callfar: MACRO ; address, bank
+ ld hl, \1
+ ld a, BANK(\1)
+ rst FarCall
+ENDM
+
callba EQUS "farcall"
callab: MACRO ; address, bank