pokecrystal-board/engine/battle/move_effects/pursuit.asm
Rangi eb1e3636bb Use labels instead of constants for HRAM
Use explicit ldh instruction to access HRAM locations, don't rely on optimizing ld
2018-08-25 14:28:22 -04:00

25 lines
304 B
NASM

BattleCommand_Pursuit:
; pursuit
; Double damage if the opponent is switching.
ld hl, wEnemyIsSwitching
ldh a, [hBattleTurn]
and a
jr z, .ok
ld hl, wPlayerIsSwitching
.ok
ld a, [hl]
and a
ret z
ld hl, wCurDamage + 1
sla [hl]
dec hl
rl [hl]
ret nc
ld a, $ff
ld [hli], a
ld [hl], a
ret