summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorlibjet <libj3t@gmail.com>2020-05-21 15:32:13 +0100
committerlibjet <libj3t@gmail.com>2020-05-21 15:32:13 +0100
commit562c8da5cbdc931428b36f7503386babd7ce7fc8 (patch)
treeaab9e40c736ef4a33630706c60b5929159d6d1f6 /engine
parent625ec0e794b44f4c8430d3ac0c66a753389ae910 (diff)
Add engine/events/squirtbottle.asm
Diffstat (limited to 'engine')
-rwxr-xr-xengine/events/squirtbottle.asm45
1 files changed, 45 insertions, 0 deletions
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