summaryrefslogtreecommitdiff
path: root/engine/overworld/npc_movement_2.asm
blob: 06ee93196b71105cff3bfff9f479b83f92006f4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FreezeEnemyTrainerSprite:
	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:
	db OPP_SONY1
	db OPP_SONY2
	db OPP_SONY3
	db $ff