pokecrystal-board/engine/battle/move_effects/safeguard.asm
2018-06-25 12:07:35 -04:00

24 lines
406 B
NASM

BattleCommand_Safeguard:
; safeguard
ld hl, wPlayerScreens
ld de, wPlayerSafeguardCount
ld 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