From 562c8da5cbdc931428b36f7503386babd7ce7fc8 Mon Sep 17 00:00:00 2001 From: libjet Date: Thu, 21 May 2020 15:32:13 +0100 Subject: Add engine/events/squirtbottle.asm --- engine/events/squirtbottle.asm | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 engine/events/squirtbottle.asm (limited to 'engine') diff --git a/engine/events/squirtbottle.asm b/engine/events/squirtbottle.asm new file mode 100755 index 00000000..411b5c2e --- /dev/null +++ b/engine/events/squirtbottle.asm @@ -0,0 +1,45 @@ +_Squirtbottle: + ld hl, .SquirtbottleScript + call QueueScript + ld a, $1 + ld [wItemEffectSucceeded], a + ret + +.SquirtbottleScript: + reloadmappart + special UpdateTimePals + callasm .CheckCanUseSquirtbottle + iffalse .SquirtbottleNothingScript + farsjump WateredWeirdTreeScript + +.SquirtbottleNothingScript: + jumptext .SquirtbottleNothingText + +.SquirtbottleNothingText: + text_far _SquirtbottleNothingText + text_end + +.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 -- cgit v1.2.3