summaryrefslogtreecommitdiff
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
parent625ec0e794b44f4c8430d3ac0c66a753389ae910 (diff)
Add engine/events/squirtbottle.asm
-rwxr-xr-xengine/events/squirtbottle.asm45
-rw-r--r--main.asm3
2 files changed, 46 insertions, 2 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
diff --git a/main.asm b/main.asm
index ceee851e..7cf8ffde 100644
--- a/main.asm
+++ b/main.asm
@@ -361,9 +361,8 @@ INCLUDE "engine/pokemon/party_menu.asm"
INCLUDE "engine/events/fishing_gfx.asm"
INCLUDE "engine/events/poisonstep.asm"
INCLUDE "engine/events/sweet_scent.asm"
+INCLUDE "engine/events/squirtbottle.asm"
-_Squirtbottle::
- dr $50763, $507ac
_CardKey::
dr $507ac, $507e7
_BasementKey::