pokecrystal-board/engine/battle/move_effects/safeguard.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

24 lines
407 B
NASM

BattleCommand_Safeguard:
; safeguard
ld hl, wPlayerScreens
ld de, wPlayerSafeguardCount
ldh a, [hBattleTurn]
and a
jr z, .ok
ld hl, wEnemyScreens
ld de, wEnemySafeguardCount
.ok
bit SCREENS_SAFEGUARD, [hl]
jr nz, .failed
set SCREENS_SAFEGUARD, [hl]
ld a, 5
ld [de], a
call AnimateCurrentMove
ld hl, CoveredByVeilText
jp StdBattleTextBox
.failed
call AnimateFailedMove
jp PrintButItFailed