Skip to content

Commit

Permalink
Remove wKickCounter and wPresentPower aliases for wBattleAnimParam
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Aug 30, 2020
1 parent 49bbc99 commit cf37abd
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 40 deletions.
2 changes: 1 addition & 1 deletion docs/battle_anim_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ Does nothing. Unused.

## `$F8`: <code>anim_if_param_equal <i>value</i>, <i>address</i></code>

Jumps to another script if `wBattleAnimParam` (aka `wKickCounter` or `wPresentPower`) is equal to *value*.
Jumps to another script if `wBattleAnimParam` is equal to *value*.


## `$F9`: <code>anim_setvar <i>value</i></code>
Expand Down
34 changes: 17 additions & 17 deletions engine/battle/effect_commands.asm
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ BattleCommand_CheckTurn:
xor a
ld [wAttackMissed], a
ld [wEffectFailed], a
ld [wKickCounter], a
ld [wBattleAnimParam], a
ld [wAlreadyDisobeyed], a
ld [wAlreadyFailed], a
ld [wSomeoneIsRampaging], a
Expand Down Expand Up @@ -1933,7 +1933,7 @@ BattleCommand_LowerSub:
ld [wNumHits], a
ld [wFXAnimID + 1], a
inc a
ld [wKickCounter], a
ld [wBattleAnimParam], a
ld a, SUBSTITUTE
jp LoadAnim

Expand Down Expand Up @@ -1994,7 +1994,7 @@ BattleCommand_MoveAnimNoSub:
cp EFFECT_TRIPLE_KICK
jr z, .triplekick
xor a
ld [wKickCounter], a
ld [wBattleAnimParam], a

.triplekick
ld a, BATTLE_VARS_MOVE_ANIM
Expand All @@ -2013,10 +2013,10 @@ BattleCommand_MoveAnimNoSub:
jp AppearUserLowerSub

.alternate_anim
ld a, [wKickCounter]
ld a, [wBattleAnimParam]
and 1
xor 1
ld [wKickCounter], a
ld [wBattleAnimParam], a
ld a, [de]
cp 1
push af
Expand Down Expand Up @@ -2054,7 +2054,7 @@ BattleCommand_StatDownAnim:
BattleCommand_StatUpDownAnim:
ld [wNumHits], a
xor a
ld [wKickCounter], a
ld [wBattleAnimParam], a
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar
ld e, a
Expand Down Expand Up @@ -2084,7 +2084,7 @@ BattleCommand_RaiseSub:
ld [wNumHits], a
ld [wFXAnimID + 1], a
ld a, $2
ld [wKickCounter], a
ld [wBattleAnimParam], a
ld a, SUBSTITUTE
jp LoadAnim

Expand Down Expand Up @@ -2272,7 +2272,7 @@ endr
ld hl, CrashedText
call StdBattleTextbox
ld a, $1
ld [wKickCounter], a
ld [wBattleAnimParam], a
call LoadMoveAnim
ld c, TRUE
ldh a, [hBattleTurn]
Expand Down Expand Up @@ -2429,7 +2429,7 @@ BattleCommand_CheckFaint:
ld [wNumHits], a
ld [wFXAnimID + 1], a
inc a
ld [wKickCounter], a
ld [wBattleAnimParam], a
ld a, DESTINY_BOND
call LoadAnim
call BattleCommand_SwitchTurn
Expand Down Expand Up @@ -5112,7 +5112,7 @@ BattleCommand_ForceSwitch:
jr z, .switch_fail
call UpdateEnemyMonInParty
ld a, $1
ld [wKickCounter], a
ld [wBattleAnimParam], a
call AnimateCurrentMove
ld c, $14
call DelayFrames
Expand Down Expand Up @@ -5207,7 +5207,7 @@ BattleCommand_ForceSwitch:

call UpdateBattleMonInParty
ld a, $1
ld [wKickCounter], a
ld [wBattleAnimParam], a
call AnimateCurrentMove
ld c, 20
call DelayFrames
Expand Down Expand Up @@ -5260,7 +5260,7 @@ BattleCommand_ForceSwitch:
push af
call SetBattleDraw
ld a, $1
ld [wKickCounter], a
ld [wBattleAnimParam], a
call AnimateCurrentMove
ld c, 20
call DelayFrames
Expand Down Expand Up @@ -5607,7 +5607,7 @@ BattleCommand_Charge:
xor a
ld [wNumHits], a
inc a
ld [wKickCounter], a
ld [wBattleAnimParam], a
call LoadMoveAnim
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar
Expand Down Expand Up @@ -6739,11 +6739,11 @@ AnimateCurrentMoveEitherSide:
push hl
push de
push bc
ld a, [wKickCounter]
ld a, [wBattleAnimParam]
push af
call BattleCommand_LowerSub
pop af
ld [wKickCounter], a
ld [wBattleAnimParam], a
call PlayDamageAnim
call BattleCommand_RaiseSub
pop bc
Expand All @@ -6755,11 +6755,11 @@ AnimateCurrentMove:
push hl
push de
push bc
ld a, [wKickCounter]
ld a, [wBattleAnimParam]
push af
call BattleCommand_LowerSub
pop af
ld [wKickCounter], a
ld [wBattleAnimParam], a
call LoadMoveAnim
call BattleCommand_RaiseSub
pop bc
Expand Down
2 changes: 1 addition & 1 deletion engine/battle/move_effects/bide.asm
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ BattleCommand_UnleashEnergy:
inc a
ld [bc], a
ld a, 1
ld [wKickCounter], a
ld [wBattleAnimParam], a
call AnimateCurrentMove
jp EndMoveEffect
2 changes: 1 addition & 1 deletion engine/battle/move_effects/curse.asm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ BattleCommand_Curse:
; Raise Attack and Defense, and lower Speed.

ld a, $1
ld [wKickCounter], a
ld [wBattleAnimParam], a
call AnimateCurrentMove
ld a, SPEED
call LowerStat
Expand Down
4 changes: 2 additions & 2 deletions engine/battle/move_effects/metronome.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ BattleCommand_Metronome:
call CheckUserIsCharging
jr nz, .asm_3742b

ld a, [wKickCounter]
ld a, [wBattleAnimParam]
push af
call BattleCommand_LowerSub
pop af
ld [wKickCounter], a
ld [wBattleAnimParam], a

.asm_3742b
call LoadMoveAnim
Expand Down
4 changes: 2 additions & 2 deletions engine/battle/move_effects/mirror_move.asm
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ BattleCommand_MirrorMove:
call CheckUserIsCharging
jr nz, .done

ld a, [wKickCounter]
ld a, [wBattleAnimParam]
push af
call BattleCommand_LowerSub
pop af
ld [wKickCounter], a
ld [wBattleAnimParam], a

.done
call BattleCommand_MoveDelay
Expand Down
6 changes: 3 additions & 3 deletions engine/battle/move_effects/present.asm
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ BattleCommand_Present:

.got_power
ld a, c
ld [wPresentPower], a
ld [wBattleAnimParam], a
call AnimateCurrentMoveEitherSide
ld d, [hl]
pop bc
ret

.heal_effect
pop bc
ld a, 3
ld [wPresentPower], a
ld a, $3 ; heal animation
ld [wBattleAnimParam], a
call AnimateCurrentMove
call BattleCommand_SwitchTurn
ld hl, AICheckPlayerMaxHP
Expand Down
2 changes: 1 addition & 1 deletion engine/battle/move_effects/selfdestruct.asm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BattleCommand_Selfdestruct:
ld [hli], a
ld [hl], a
ld a, $1
ld [wKickCounter], a
ld [wBattleAnimParam], a
call BattleCommand_LowerSub
call LoadMoveAnim
ld a, BATTLE_VARS_SUBSTATUS4
Expand Down
4 changes: 2 additions & 2 deletions engine/battle/move_effects/sleep_talk.asm
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ BattleCommand_SleepTalk:
ld [hl], a
call CheckUserIsCharging
jr nz, .charging
ld a, [wKickCounter]
ld a, [wBattleAnimParam]
push af
call BattleCommand_LowerSub
pop af
ld [wKickCounter], a
ld [wBattleAnimParam], a
.charging
call LoadMoveAnim
call UpdateMoveData
Expand Down
2 changes: 1 addition & 1 deletion engine/battle/move_effects/substitute.asm
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ BattleCommand_Substitute:
xor a
ld [wNumHits], a
ld [wFXAnimID + 1], a
ld [wKickCounter], a
ld [wBattleAnimParam], a
ld a, SUBSTITUTE
call LoadAnim
jr .finish
Expand Down
2 changes: 1 addition & 1 deletion engine/battle/move_effects/teleport.asm
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ BattleCommand_Teleport:
ld [wNumHits], a
inc a
ld [wForcedSwitch], a
ld [wKickCounter], a
ld [wBattleAnimParam], a
call SetBattleDraw
call BattleCommand_LowerSub
call LoadMoveAnim
Expand Down
4 changes: 2 additions & 2 deletions engine/battle/move_effects/transform.asm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BattleCommand_Transform:
ld [wNumHits], a
ld [wFXAnimID + 1], a
ld a, $1
ld [wKickCounter], a
ld [wBattleAnimParam], a
ld a, BATTLE_VARS_SUBSTATUS4
call GetBattleVarAddr
bit SUBSTATUS_SUBSTITUTE, [hl]
Expand Down Expand Up @@ -130,7 +130,7 @@ BattleCommand_Transform:
ld [wNumHits], a
ld [wFXAnimID + 1], a
ld a, $2
ld [wKickCounter], a
ld [wBattleAnimParam], a
pop af
ld a, SUBSTITUTE
call nz, LoadAnim
Expand Down
4 changes: 2 additions & 2 deletions engine/battle/move_effects/triple_kick.asm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BattleCommand_TripleKick:
; triplekick

ld a, [wKickCounter]
ld a, [wBattleAnimParam]
ld b, a
inc b
ld hl, wCurDamage + 1
Expand Down Expand Up @@ -29,6 +29,6 @@ BattleCommand_TripleKick:
BattleCommand_KickCounter:
; kickcounter

ld hl, wKickCounter
ld hl, wBattleAnimParam
inc [hl]
ret
7 changes: 3 additions & 4 deletions wram.asm
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,9 @@ wPlayerDamageTaken:: dw
wEnemyDamageTaken:: dw

wBattleReward:: ds 3
wBattleAnimParam::
wKickCounter::
wPresentPower::
db

wBattleAnimParam:: db

wBattleScriptBuffer:: ds 40

wBattleScriptBufferAddress:: dw
Expand Down

0 comments on commit cf37abd

Please sign in to comment.