summaryrefslogtreecommitdiff
path: root/events/std_collision.asm
diff options
context:
space:
mode:
authorRemy Oukaour <remy.oukaour@gmail.com>2017-12-26 21:55:57 -0500
committerRemy Oukaour <remy.oukaour@gmail.com>2017-12-26 21:55:57 -0500
commitdae16acd6f4e2e2c177e3776be6ed549af070c4f (patch)
tree2577502f3ccc185e772ef121ba52fa3fddfd95c2 /events/std_collision.asm
parent2a565f747ccb8099f4057548a6d598d538e6b991 (diff)
event/ → events/, and move some appropriate engine/ files there
Diffstat (limited to 'events/std_collision.asm')
-rw-r--r--events/std_collision.asm29
1 files changed, 29 insertions, 0 deletions
diff --git a/events/std_collision.asm b/events/std_collision.asm
new file mode 100644
index 000000000..79dbc71f1
--- /dev/null
+++ b/events/std_collision.asm
@@ -0,0 +1,29 @@
+CheckFacingTileForStdScript:: ; 1365b
+; Checks to see if the tile you're facing has a std script associated with it. If so, executes the script and returns carry.
+ ld a, c
+ ld de, 3
+ ld hl, TileCollisionStdScripts
+ call IsInArray
+ jr nc, .notintable
+
+ ld a, jumpstd_command
+ ld [wJumpStdScriptBuffer], a
+ inc hl
+ ld a, [hli]
+ ld [wJumpStdScriptBuffer + 1], a
+ ld a, [hli]
+ ld [wJumpStdScriptBuffer + 2], a
+ ld a, BANK(Script_JumpStdFromRAM)
+ ld hl, Script_JumpStdFromRAM
+ call CallScript
+ scf
+ ret
+
+.notintable
+ xor a
+ ret
+
+INCLUDE "data/collision_stdscripts.asm"
+
+Script_JumpStdFromRAM: ; 0x1369a
+ jump wJumpStdScriptBuffer