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