diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-01-26 11:36:00 -0500 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-01-26 11:36:00 -0500 |
commit | 0cf4eb68955952659b0e94fbeae0a75fe36255ae (patch) | |
tree | f38113626f149a5f71b01212a6440c0f8926b662 /engine/battle/move_effects/future_sight.asm | |
parent | a0cc4a33929f6aeb08a733c4a985c3bbb24ef55f (diff) |
Move-unique effect commands consistently go in engine/battle/move_effects/
Diffstat (limited to 'engine/battle/move_effects/future_sight.asm')
-rw-r--r-- | engine/battle/move_effects/future_sight.asm | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/engine/battle/move_effects/future_sight.asm b/engine/battle/move_effects/future_sight.asm new file mode 100644 index 000000000..cd01db838 --- /dev/null +++ b/engine/battle/move_effects/future_sight.asm @@ -0,0 +1,85 @@ +BattleCommand_CheckFutureSight: ; 37d0d +; checkfuturesight + + ld hl, wPlayerFutureSightCount + ld de, wPlayerFutureSightDamage + ld a, [hBattleTurn] + 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 + ld [CurDamage], a + ld a, [de] + ld [CurDamage + 1], a + ld b, futuresight_command + jp SkipToBattleCommand + +; 37d34 + +BattleCommand_FutureSight: ; 37d34 +; 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 + ld a, [hBattleTurn] + 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 + call StdBattleTextBox + call BattleCommand_RaiseSub + ld de, wPlayerFutureSightDamage + ld a, [hBattleTurn] + and a + jr z, .StoreDamage + ld de, wEnemyFutureSightDamage +.StoreDamage: + ld hl, CurDamage + 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 + +; 37d94 |