2018-06-24 14:09:41 +00:00
|
|
|
BattleCommand_FalseSwipe:
|
2018-01-26 16:36:00 +00:00
|
|
|
; falseswipe
|
|
|
|
|
2018-04-04 21:27:40 +00:00
|
|
|
; Makes sure wCurDamage < MonHP
|
|
|
|
|
2018-02-03 23:21:53 +00:00
|
|
|
ld hl, wEnemyMonHP
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hBattleTurn]
|
2018-01-26 16:36:00 +00:00
|
|
|
and a
|
|
|
|
jr z, .got_hp
|
2018-02-03 23:21:53 +00:00
|
|
|
ld hl, wBattleMonHP
|
2018-01-26 16:36:00 +00:00
|
|
|
.got_hp
|
2018-02-03 23:21:53 +00:00
|
|
|
ld de, wCurDamage
|
2018-01-26 16:36:00 +00:00
|
|
|
ld c, 2
|
|
|
|
push hl
|
|
|
|
push de
|
2018-07-23 04:25:53 +00:00
|
|
|
call CompareBytes
|
2018-01-26 16:36:00 +00:00
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
jr c, .done
|
2018-04-04 21:27:40 +00:00
|
|
|
|
2018-01-26 16:36:00 +00:00
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
ld a, [hl]
|
|
|
|
dec a
|
|
|
|
ld [de], a
|
2018-04-04 21:27:40 +00:00
|
|
|
|
2018-01-26 16:36:00 +00:00
|
|
|
inc a
|
|
|
|
jr nz, .okay
|
|
|
|
dec de
|
|
|
|
ld a, [de]
|
|
|
|
dec a
|
|
|
|
ld [de], a
|
|
|
|
.okay
|
2018-04-04 21:27:40 +00:00
|
|
|
|
2018-02-03 23:21:53 +00:00
|
|
|
ld a, [wCriticalHit]
|
2018-01-26 16:36:00 +00:00
|
|
|
cp 2
|
|
|
|
jr nz, .carry
|
|
|
|
xor a
|
2018-02-03 23:21:53 +00:00
|
|
|
ld [wCriticalHit], a
|
2018-04-04 21:27:40 +00:00
|
|
|
|
2018-01-26 16:36:00 +00:00
|
|
|
.carry
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.done
|
|
|
|
and a
|
|
|
|
ret
|