summaryrefslogtreecommitdiff
path: root/engine/battle/move_effects/safeguard.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/battle/move_effects/safeguard.asm')
-rw-r--r--engine/battle/move_effects/safeguard.asm25
1 files changed, 25 insertions, 0 deletions
diff --git a/engine/battle/move_effects/safeguard.asm b/engine/battle/move_effects/safeguard.asm
new file mode 100644
index 000000000..1dc233eab
--- /dev/null
+++ b/engine/battle/move_effects/safeguard.asm
@@ -0,0 +1,25 @@
+BattleCommand_Safeguard: ; 37939
+; 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
+
+; 37962