Move direct statStage boosts to use statbuffchange (#3000)

* fix double counting stat boosts for download, moxie beast boost etc

* speed boost use statbuffchange

* BattleScript_MoveStatDrain use statbuffchange

* statbuffchange for rage

---------

Co-authored-by: ghoulslash <pokevoyager0@gmail.com>
This commit is contained in:
ghoulslash 2023-05-17 11:22:23 -04:00 committed by GitHub
parent 7a9756953f
commit 487415e56b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View File

@ -7173,8 +7173,10 @@ BattleScript_MistProtected::
return
BattleScript_RageIsBuilding::
statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_RageIsBuildingEnd
printstring STRINGID_PKMNRAGEBUILDING
waitmessage B_WAIT_TIME_LONG
BattleScript_RageIsBuildingEnd:
return
BattleScript_MoveUsedIsDisabled::
@ -8507,10 +8509,12 @@ BattleScript_AbilityPopUp:
return
BattleScript_SpeedBoostActivates::
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_SpeedBoostActivatesEnd
call BattleScript_AbilityPopUp
playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
printstring STRINGID_PKMNRAISEDSPEED
waitmessage B_WAIT_TIME_LONG
BattleScript_SpeedBoostActivatesEnd:
end3
@ Can't compare directly to a value, have to compare to value at pointer
@ -9022,8 +9026,8 @@ BattleScript_MoveStatDrain::
setgraphicalstatchangevalues
playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
waitanimation
.if B_ABSORBING_ABILITY_STRING >= GEN_5
statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_MoveStatDrain_Cont
.if B_ABSORBING_ABILITY_STRING >= GEN_5
printfromtable gStatUpStringIds
waitmessage B_WAIT_TIME_LONG
.else
@ -9303,6 +9307,7 @@ BattleScript_WeakArmorActivatesEnd:
return
BattleScript_RaiseStatOnFaintingTarget::
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_RaiseStatOnFaintingTarget_End
copybyte gBattlerAbility, gBattlerAttacker
call BattleScript_AbilityPopUp
setgraphicalstatchangevalues
@ -9310,9 +9315,11 @@ BattleScript_RaiseStatOnFaintingTarget::
waitanimation
printstring STRINGID_LASTABILITYRAISEDSTAT
waitmessage B_WAIT_TIME_LONG
BattleScript_RaiseStatOnFaintingTarget_End:
return
BattleScript_AttackerAbilityStatRaise::
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_AttackerAbilityStatRaise_End
copybyte gBattlerAbility, gBattlerAttacker
call BattleScript_AbilityPopUp
setgraphicalstatchangevalues
@ -9320,6 +9327,7 @@ BattleScript_AttackerAbilityStatRaise::
waitanimation
printstring STRINGID_ATTACKERABILITYSTATRAISE
waitmessage B_WAIT_TIME_LONG
BattleScript_AttackerAbilityStatRaise_End:
return
BattleScript_FellStingerRaisesStat::

View File

@ -5582,7 +5582,7 @@ static void Cmd_moveend(void)
&& gBattleMoves[gCurrentMove].power != 0
&& CompareStat(gBattlerTarget, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN))
{
gBattleMons[gBattlerTarget].statStages[STAT_ATK]++;
SET_STATCHANGER(STAT_ATK, 1, FALSE);
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_RageIsBuilding;
effect = TRUE;
@ -9494,7 +9494,6 @@ static void Cmd_various(void)
&& !NoAliveMonsForEitherParty()
&& CompareStat(gBattlerAttacker, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN))
{
gBattleMons[gBattlerAttacker].statStages[STAT_ATK]++;
SET_STATCHANGER(STAT_ATK, 1, FALSE);
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_ATK);
BattleScriptPush(cmd->nextInstr);
@ -9518,7 +9517,6 @@ static void Cmd_various(void)
&& !NoAliveMonsForEitherParty()
&& CompareStat(gBattlerAttacker, STAT_SPATK, MAX_STAT_STAGE, CMP_LESS_THAN))
{
gBattleMons[gBattlerAttacker].statStages[STAT_SPATK]++;
SET_STATCHANGER(STAT_SPATK, 1, FALSE);
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_SPATK);
BattleScriptPush(cmd->nextInstr);
@ -9570,7 +9568,6 @@ static void Cmd_various(void)
&& !NoAliveMonsForEitherParty()
&& CompareStat(gBattlerAttacker, i, MAX_STAT_STAGE, CMP_LESS_THAN))
{
gBattleMons[gBattlerAttacker].statStages[i]++;
SET_STATCHANGER(i, 1, FALSE);
PREPARE_STAT_BUFFER(gBattleTextBuff1, i);
BattleScriptPush(cmd->nextInstr);
@ -9590,7 +9587,6 @@ static void Cmd_various(void)
&& !NoAliveMonsForEitherParty()
&& CompareStat(gBattleScripting.battler, STAT_SPATK, MAX_STAT_STAGE, CMP_LESS_THAN))
{
gBattleMons[gBattleScripting.battler].statStages[STAT_SPATK]++;
SET_STATCHANGER(STAT_SPATK, 1, FALSE);
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_SPATK);
BattleScriptPushCursor();

View File

@ -4552,7 +4552,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (CompareStat(battler, statId, MAX_STAT_STAGE, CMP_LESS_THAN))
{
gBattleMons[battler].statStages[statId]++;
SET_STATCHANGER(statId, 1, FALSE);
gBattlerAttacker = battler;
PREPARE_STAT_BUFFER(gBattleTextBuff1, statId);
@ -4925,9 +4924,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
case ABILITY_SPEED_BOOST:
if (CompareStat(battler, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN) && gDisableStructs[battler].isFirstTurn != 2)
{
gBattleMons[battler].statStages[STAT_SPEED]++;
gBattleScripting.animArg1 = 14 + STAT_SPEED;
gBattleScripting.animArg2 = 0;
SET_STATCHANGER(STAT_SPEED, 1, FALSE);
BattleScriptPushCursorAndCallback(BattleScript_SpeedBoostActivates);
gBattleScripting.battler = battler;
effect++;
@ -5222,7 +5219,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
SET_STATCHANGER(statId, statAmount, FALSE);
#if B_ABSORBING_ABILITY_STRING < GEN_5
gBattleMons[battler].statStages[statId]++;
PREPARE_STAT_BUFFER(gBattleTextBuff1, statId);
#endif
}