pokecrystal-board/engine/events/squirtbottle.asm
mid-kid 940256569b text_jump → text_far
The previous name for this was rather misleading. It isn't an actual
jump like you'd expect the `jp` instruction to behave as. Instead, it
behaves more like a `farcall`.
This also makes it consistent with its current command ID name of
`TX_FAR`.
2018-11-05 22:26:18 +01:00

47 lines
724 B
NASM

_Squirtbottle:
ld hl, .SquirtbottleScript
call QueueScript
ld a, $1
ld [wItemEffectSucceeded], a
ret
.SquirtbottleScript:
reloadmappart
special UpdateTimePals
callasm .CheckCanUseSquirtbottle
iffalse .NothingHappenedScript
farjump WateredWeirdTreeScript
.NothingHappenedScript:
jumptext .NothingHappenedText
.NothingHappenedText:
; sprinkled water. But nothing happened…
text_far UnknownText_0x1c0b3b
db "@"
.CheckCanUseSquirtbottle:
ld a, [wMapGroup]
cp GROUP_ROUTE_36
jr nz, .nope
ld a, [wMapNumber]
cp MAP_ROUTE_36
jr nz, .nope
farcall GetFacingObject
jr c, .nope
ld a, d
cp SPRITEMOVEDATA_SUDOWOODO
jr nz, .nope
ld a, 1
ld [wScriptVar], a
ret
.nope
xor a
ld [wScriptVar], a
ret