summaryrefslogtreecommitdiff
path: root/engine/overworld
diff options
context:
space:
mode:
Diffstat (limited to 'engine/overworld')
-rwxr-xr-xengine/overworld/npc_movement_2.asm24
1 files changed, 24 insertions, 0 deletions
diff --git a/engine/overworld/npc_movement_2.asm b/engine/overworld/npc_movement_2.asm
new file mode 100755
index 00000000..c5e11aa0
--- /dev/null
+++ b/engine/overworld/npc_movement_2.asm
@@ -0,0 +1,24 @@
+FreezeEnemyTrainerSprite: ; eaa02 (3a:6a02)
+ ld a, [wCurMap]
+ cp POKEMONTOWER_7
+ ret z ; the Rockets on Pokemon Tower 7F leave after battling, so don't freeze them
+ ld hl, RivalIDs
+ ld a, [wEngagedTrainerClass]
+ ld b, a
+.loop
+ ld a, [hli]
+ cp $ff
+ jr z, .notRival
+ cp b
+ ret z ; the rival leaves after battling, so don't freeze him
+ jr .loop
+.notRival
+ ld a, [wSpriteIndex]
+ ld [H_SPRITEINDEX], a
+ jp SetSpriteMovementBytesToFF
+
+RivalIDs: ; eaa20 (3a:6a20)
+ db OPP_SONY1
+ db OPP_SONY2
+ db OPP_SONY3
+ db $ff