summaryrefslogtreecommitdiff
path: root/engine/battle/effect_commands/perish_song.asm
diff options
context:
space:
mode:
authorRemy Oukaour <remy.oukaour@gmail.com>2017-12-26 17:47:05 -0500
committerRemy Oukaour <remy.oukaour@gmail.com>2017-12-26 17:47:05 -0500
commitb5417fafec7dd37cb4be391f3bd3d4541a2a381e (patch)
treea4e7d08afb2e862186a138e82c8ef4785d82786d /engine/battle/effect_commands/perish_song.asm
parent2f98c2032fd47ada3484bfc37d590992f286d3d4 (diff)
Split battle/ into data/ and engine/ components
Diffstat (limited to 'engine/battle/effect_commands/perish_song.asm')
-rw-r--r--engine/battle/effect_commands/perish_song.asm40
1 files changed, 40 insertions, 0 deletions
diff --git a/engine/battle/effect_commands/perish_song.asm b/engine/battle/effect_commands/perish_song.asm
new file mode 100644
index 000000000..ac491ef6b
--- /dev/null
+++ b/engine/battle/effect_commands/perish_song.asm
@@ -0,0 +1,40 @@
+BattleCommand_PerishSong: ; 376c2
+; perishsong
+
+
+ ld hl, PlayerSubStatus1
+ ld de, EnemySubStatus1
+ bit SUBSTATUS_PERISH, [hl]
+ jr z, .ok
+
+ ld a, [de]
+ bit SUBSTATUS_PERISH, a
+ jr nz, .failed
+
+.ok
+ bit SUBSTATUS_PERISH, [hl]
+ jr nz, .enemy
+
+ set SUBSTATUS_PERISH, [hl]
+ ld a, 4
+ ld [PlayerPerishCount], a
+
+.enemy
+ ld a, [de]
+ bit SUBSTATUS_PERISH, a
+ jr nz, .done
+
+ set SUBSTATUS_PERISH, a
+ ld [de], a
+ ld a, 4
+ ld [EnemyPerishCount], a
+
+.done
+ call AnimateCurrentMove
+ ld hl, StartPerishText
+ jp StdBattleTextBox
+
+.failed
+ call AnimateFailedMove
+ jp PrintButItFailed
+; 376f8