summaryrefslogtreecommitdiff
path: root/engine/battle/move_effects/fury_cutter.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/battle/move_effects/fury_cutter.asm')
-rw-r--r--engine/battle/move_effects/fury_cutter.asm61
1 files changed, 61 insertions, 0 deletions
diff --git a/engine/battle/move_effects/fury_cutter.asm b/engine/battle/move_effects/fury_cutter.asm
new file mode 100644
index 000000000..91679368f
--- /dev/null
+++ b/engine/battle/move_effects/fury_cutter.asm
@@ -0,0 +1,61 @@
+BattleCommand_FuryCutter: ; 37792
+; furycutter
+
+ ld hl, wPlayerFuryCutterCount
+ ld a, [hBattleTurn]
+ and a
+ jr z, .go
+ ld hl, wEnemyFuryCutterCount
+
+.go
+ ld a, [wAttackMissed]
+ and a
+ jp nz, ResetFuryCutterCount
+
+ inc [hl]
+
+; Damage capped at 5 turns' worth (16x).
+ ld a, [hl]
+ ld b, a
+ cp 6
+ jr c, .checkdouble
+ ld b, 5
+
+.checkdouble
+ dec b
+ ret z
+
+; Double the damage
+ ld hl, wCurDamage + 1
+ sla [hl]
+ dec hl
+ rl [hl]
+ jr nc, .checkdouble
+
+; No overflow
+ ld a, $ff
+ ld [hli], a
+ ld [hl], a
+ ret
+
+; 377be
+
+
+ResetFuryCutterCount: ; 377be
+
+ push hl
+
+ ld hl, wPlayerFuryCutterCount
+ ld a, [hBattleTurn]
+ and a
+ jr z, .reset
+ ld hl, wEnemyFuryCutterCount
+
+.reset
+ xor a
+ ld [hl], a
+
+ pop hl
+ ret
+
+; 377ce