shithub: pokecrystal

Download patch

ref: cf37abd3ecb69a9bb6f4bbf1e5ae4d77d37a4c68
parent: 49bbc993b76ef05d63ce6fa508a1ac2ee81f8241
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Sat Aug 29 16:35:49 EDT 2020

Remove wKickCounter and wPresentPower aliases for wBattleAnimParam

--- a/docs/battle_anim_commands.md
+++ b/docs/battle_anim_commands.md
@@ -221,7 +221,7 @@
 
 ## `$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>
--- a/engine/battle/effect_commands.asm
+++ b/engine/battle/effect_commands.asm
@@ -122,7 +122,7 @@
 	xor a
 	ld [wAttackMissed], a
 	ld [wEffectFailed], a
-	ld [wKickCounter], a
+	ld [wBattleAnimParam], a
 	ld [wAlreadyDisobeyed], a
 	ld [wAlreadyFailed], a
 	ld [wSomeoneIsRampaging], a
@@ -1933,7 +1933,7 @@
 	ld [wNumHits], a
 	ld [wFXAnimID + 1], a
 	inc a
-	ld [wKickCounter], a
+	ld [wBattleAnimParam], a
 	ld a, SUBSTITUTE
 	jp LoadAnim
 
@@ -1994,7 +1994,7 @@
 	cp EFFECT_TRIPLE_KICK
 	jr z, .triplekick
 	xor a
-	ld [wKickCounter], a
+	ld [wBattleAnimParam], a
 
 .triplekick
 	ld a, BATTLE_VARS_MOVE_ANIM
@@ -2013,10 +2013,10 @@
 	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
@@ -2054,7 +2054,7 @@
 BattleCommand_StatUpDownAnim:
 	ld [wNumHits], a
 	xor a
-	ld [wKickCounter], a
+	ld [wBattleAnimParam], a
 	ld a, BATTLE_VARS_MOVE_ANIM
 	call GetBattleVar
 	ld e, a
@@ -2084,7 +2084,7 @@
 	ld [wNumHits], a
 	ld [wFXAnimID + 1], a
 	ld a, $2
-	ld [wKickCounter], a
+	ld [wBattleAnimParam], a
 	ld a, SUBSTITUTE
 	jp LoadAnim
 
@@ -2272,7 +2272,7 @@
 	ld hl, CrashedText
 	call StdBattleTextbox
 	ld a, $1
-	ld [wKickCounter], a
+	ld [wBattleAnimParam], a
 	call LoadMoveAnim
 	ld c, TRUE
 	ldh a, [hBattleTurn]
@@ -2429,7 +2429,7 @@
 	ld [wNumHits], a
 	ld [wFXAnimID + 1], a
 	inc a
-	ld [wKickCounter], a
+	ld [wBattleAnimParam], a
 	ld a, DESTINY_BOND
 	call LoadAnim
 	call BattleCommand_SwitchTurn
@@ -5112,7 +5112,7 @@
 	jr z, .switch_fail
 	call UpdateEnemyMonInParty
 	ld a, $1
-	ld [wKickCounter], a
+	ld [wBattleAnimParam], a
 	call AnimateCurrentMove
 	ld c, $14
 	call DelayFrames
@@ -5207,7 +5207,7 @@
 
 	call UpdateBattleMonInParty
 	ld a, $1
-	ld [wKickCounter], a
+	ld [wBattleAnimParam], a
 	call AnimateCurrentMove
 	ld c, 20
 	call DelayFrames
@@ -5260,7 +5260,7 @@
 	push af
 	call SetBattleDraw
 	ld a, $1
-	ld [wKickCounter], a
+	ld [wBattleAnimParam], a
 	call AnimateCurrentMove
 	ld c, 20
 	call DelayFrames
@@ -5607,7 +5607,7 @@
 	xor a
 	ld [wNumHits], a
 	inc a
-	ld [wKickCounter], a
+	ld [wBattleAnimParam], a
 	call LoadMoveAnim
 	ld a, BATTLE_VARS_MOVE_ANIM
 	call GetBattleVar
@@ -6739,11 +6739,11 @@
 	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
@@ -6755,11 +6755,11 @@
 	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
--- a/engine/battle/move_effects/bide.asm
+++ b/engine/battle/move_effects/bide.asm
@@ -95,6 +95,6 @@
 	inc a
 	ld [bc], a
 	ld a, 1
-	ld [wKickCounter], a
+	ld [wBattleAnimParam], a
 	call AnimateCurrentMove
 	jp EndMoveEffect
--- a/engine/battle/move_effects/curse.asm
+++ b/engine/battle/move_effects/curse.asm
@@ -39,7 +39,7 @@
 ; Raise Attack and Defense, and lower Speed.
 
 	ld a, $1
-	ld [wKickCounter], a
+	ld [wBattleAnimParam], a
 	call AnimateCurrentMove
 	ld a, SPEED
 	call LowerStat
--- a/engine/battle/move_effects/metronome.asm
+++ b/engine/battle/move_effects/metronome.asm
@@ -5,11 +5,11 @@
 	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
--- a/engine/battle/move_effects/mirror_move.asm
+++ b/engine/battle/move_effects/mirror_move.asm
@@ -40,11 +40,11 @@
 	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
--- a/engine/battle/move_effects/present.asm
+++ b/engine/battle/move_effects/present.asm
@@ -41,7 +41,7 @@
 
 .got_power
 	ld a, c
-	ld [wPresentPower], a
+	ld [wBattleAnimParam], a
 	call AnimateCurrentMoveEitherSide
 	ld d, [hl]
 	pop bc
@@ -49,8 +49,8 @@
 
 .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
--- a/engine/battle/move_effects/selfdestruct.asm
+++ b/engine/battle/move_effects/selfdestruct.asm
@@ -12,7 +12,7 @@
 	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
--- a/engine/battle/move_effects/sleep_talk.asm
+++ b/engine/battle/move_effects/sleep_talk.asm
@@ -52,11 +52,11 @@
 	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
--- a/engine/battle/move_effects/substitute.asm
+++ b/engine/battle/move_effects/substitute.asm
@@ -62,7 +62,7 @@
 	xor a
 	ld [wNumHits], a
 	ld [wFXAnimID + 1], a
-	ld [wKickCounter], a
+	ld [wBattleAnimParam], a
 	ld a, SUBSTITUTE
 	call LoadAnim
 	jr .finish
--- a/engine/battle/move_effects/teleport.asm
+++ b/engine/battle/move_effects/teleport.asm
@@ -75,7 +75,7 @@
 	ld [wNumHits], a
 	inc a
 	ld [wForcedSwitch], a
-	ld [wKickCounter], a
+	ld [wBattleAnimParam], a
 	call SetBattleDraw
 	call BattleCommand_LowerSub
 	call LoadMoveAnim
--- a/engine/battle/move_effects/transform.asm
+++ b/engine/battle/move_effects/transform.asm
@@ -12,7 +12,7 @@
 	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]
@@ -130,7 +130,7 @@
 	ld [wNumHits], a
 	ld [wFXAnimID + 1], a
 	ld a, $2
-	ld [wKickCounter], a
+	ld [wBattleAnimParam], a
 	pop af
 	ld a, SUBSTITUTE
 	call nz, LoadAnim
--- a/engine/battle/move_effects/triple_kick.asm
+++ b/engine/battle/move_effects/triple_kick.asm
@@ -1,7 +1,7 @@
 BattleCommand_TripleKick:
 ; triplekick
 
-	ld a, [wKickCounter]
+	ld a, [wBattleAnimParam]
 	ld b, a
 	inc b
 	ld hl, wCurDamage + 1
@@ -29,6 +29,6 @@
 BattleCommand_KickCounter:
 ; kickcounter
 
-	ld hl, wKickCounter
+	ld hl, wBattleAnimParam
 	inc [hl]
 	ret
--- a/wram.asm
+++ b/wram.asm
@@ -531,10 +531,9 @@
 wEnemyDamageTaken:: dw
 
 wBattleReward:: ds 3
-wBattleAnimParam::
-wKickCounter::
-wPresentPower::
-	db
+
+wBattleAnimParam:: db
+
 wBattleScriptBuffer:: ds 40
 
 wBattleScriptBufferAddress:: dw