2018-06-24 07:09:41 -07:00
|
|
|
BattleCommand_FuryCutter:
|
2018-01-26 08:36:00 -08:00
|
|
|
; furycutter
|
|
|
|
|
2018-02-03 15:21:53 -08:00
|
|
|
ld hl, wPlayerFuryCutterCount
|
2018-01-26 08:36:00 -08:00
|
|
|
ld a, [hBattleTurn]
|
|
|
|
and a
|
|
|
|
jr z, .go
|
2018-02-03 15:21:53 -08:00
|
|
|
ld hl, wEnemyFuryCutterCount
|
2018-01-26 08:36:00 -08:00
|
|
|
|
|
|
|
.go
|
2018-02-03 15:21:53 -08:00
|
|
|
ld a, [wAttackMissed]
|
2018-01-26 08:36:00 -08:00
|
|
|
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
|
2018-02-03 15:21:53 -08:00
|
|
|
ld hl, wCurDamage + 1
|
2018-01-26 08:36:00 -08:00
|
|
|
sla [hl]
|
|
|
|
dec hl
|
|
|
|
rl [hl]
|
|
|
|
jr nc, .checkdouble
|
|
|
|
|
|
|
|
; No overflow
|
|
|
|
ld a, $ff
|
|
|
|
ld [hli], a
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
ResetFuryCutterCount:
|
2018-01-26 08:36:00 -08:00
|
|
|
|
|
|
|
push hl
|
|
|
|
|
2018-02-03 15:21:53 -08:00
|
|
|
ld hl, wPlayerFuryCutterCount
|
2018-01-26 08:36:00 -08:00
|
|
|
ld a, [hBattleTurn]
|
|
|
|
and a
|
|
|
|
jr z, .reset
|
2018-02-03 15:21:53 -08:00
|
|
|
ld hl, wEnemyFuryCutterCount
|
2018-01-26 08:36:00 -08:00
|
|
|
|
|
|
|
.reset
|
|
|
|
xor a
|
|
|
|
ld [hl], a
|
|
|
|
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|