2018-06-24 07:09:41 -07:00
|
|
|
BattleCommand_CheckFutureSight:
|
2018-01-26 08:36:00 -08:00
|
|
|
; checkfuturesight
|
|
|
|
|
|
|
|
ld hl, wPlayerFutureSightCount
|
|
|
|
ld de, wPlayerFutureSightDamage
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hBattleTurn]
|
2018-01-26 08:36:00 -08:00
|
|
|
and a
|
|
|
|
jr z, .ok
|
|
|
|
ld hl, wEnemyFutureSightCount
|
|
|
|
ld de, wEnemyFutureSightDamage
|
|
|
|
.ok
|
|
|
|
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
cp 1
|
|
|
|
ret nz
|
|
|
|
|
|
|
|
ld [hl], 0
|
|
|
|
ld a, [de]
|
|
|
|
inc de
|
2018-02-03 15:21:53 -08:00
|
|
|
ld [wCurDamage], a
|
2018-01-26 08:36:00 -08:00
|
|
|
ld a, [de]
|
2018-02-03 15:21:53 -08:00
|
|
|
ld [wCurDamage + 1], a
|
2018-01-26 08:36:00 -08:00
|
|
|
ld b, futuresight_command
|
|
|
|
jp SkipToBattleCommand
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
BattleCommand_FutureSight:
|
2018-01-26 08:36:00 -08:00
|
|
|
; futuresight
|
|
|
|
|
|
|
|
call CheckUserIsCharging
|
|
|
|
jr nz, .AlreadyChargingFutureSight
|
|
|
|
ld a, BATTLE_VARS_MOVE_ANIM
|
|
|
|
call GetBattleVar
|
|
|
|
ld b, a
|
|
|
|
ld a, BATTLE_VARS_LAST_COUNTER_MOVE
|
|
|
|
call GetBattleVarAddr
|
|
|
|
ld [hl], b
|
|
|
|
ld a, BATTLE_VARS_LAST_MOVE
|
|
|
|
call GetBattleVarAddr
|
|
|
|
ld [hl], b
|
|
|
|
.AlreadyChargingFutureSight:
|
|
|
|
ld hl, wPlayerFutureSightCount
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hBattleTurn]
|
2018-01-26 08:36:00 -08:00
|
|
|
and a
|
|
|
|
jr z, .GotFutureSightCount
|
|
|
|
ld hl, wEnemyFutureSightCount
|
|
|
|
.GotFutureSightCount:
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr nz, .failed
|
|
|
|
ld a, 4
|
|
|
|
ld [hl], a
|
|
|
|
call BattleCommand_LowerSub
|
|
|
|
call BattleCommand_MoveDelay
|
|
|
|
ld hl, ForesawAttackText
|
2019-04-08 05:15:10 -07:00
|
|
|
call StdBattleTextbox
|
2018-01-26 08:36:00 -08:00
|
|
|
call BattleCommand_RaiseSub
|
|
|
|
ld de, wPlayerFutureSightDamage
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hBattleTurn]
|
2018-01-26 08:36:00 -08:00
|
|
|
and a
|
|
|
|
jr z, .StoreDamage
|
|
|
|
ld de, wEnemyFutureSightDamage
|
|
|
|
.StoreDamage:
|
2018-02-03 15:21:53 -08:00
|
|
|
ld hl, wCurDamage
|
2018-01-26 08:36:00 -08:00
|
|
|
ld a, [hl]
|
|
|
|
ld [de], a
|
|
|
|
ld [hl], 0
|
|
|
|
inc hl
|
|
|
|
inc de
|
|
|
|
ld a, [hl]
|
|
|
|
ld [de], a
|
|
|
|
ld [hl], 0
|
|
|
|
jp EndMoveEffect
|
|
|
|
|
|
|
|
.failed
|
|
|
|
pop bc
|
|
|
|
call ResetDamage
|
|
|
|
call AnimateFailedMove
|
|
|
|
call PrintButItFailed
|
|
|
|
jp EndMoveEffect
|