fix z stat-boosts

This commit is contained in:
ghoulslash 2022-07-17 12:17:54 -04:00
parent 5fd468f507
commit 9b5aee3b93
2 changed files with 14 additions and 32 deletions

View File

@ -9214,9 +9214,12 @@ BattleScript_ZMoveActivateDamaging::
return
BattleScript_ZMoveActivateStatus::
savetarget
printstring STRINGID_ZPOWERSURROUNDS
playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL
setzeffect
restoretarget
copybyte sSTATCHANGER, sSAVED_STAT_CHANGER
return
BattleScript_ZEffectPrintString::
@ -9232,9 +9235,10 @@ BattleScript_RecoverHPZMove::
return
BattleScript_StatUpZMove::
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_StatUpZMoveEnd
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_StatUpZMoveEnd
playanimation BS_SCRIPTING, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_StatUpZMoveEnd
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_StatUpZMoveEnd
setgraphicalstatchangevalues
playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
printstring STRINGID_ZMOVESTATUP
waitmessage 0x40
printfromtable gStatUpStringIds

View File

@ -582,7 +582,9 @@ void SetZEffect(void)
gBattleStruct->zmove.effect = Z_EFFECT_ATK_UP_1;
}
gBattleScripting.savedStatChanger = gBattleScripting.statChanger; // save used move's stat changer (e.g. for Z-Growl)
gBattleScripting.battler = gBattlerAttacker;
switch (gBattleStruct->zmove.effect)
{
case Z_EFFECT_RESET_STATS:
@ -639,42 +641,18 @@ void SetZEffect(void)
gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_HP_TRAP;
gBattlescriptCurrInstr = BattleScript_ZEffectPrintString;
break;
case Z_EFFECT_ATK_UP_1:
case Z_EFFECT_DEF_UP_1:
case Z_EFFECT_SPD_UP_1:
case Z_EFFECT_SPATK_UP_1:
case Z_EFFECT_SPDEF_UP_1:
case Z_EFFECT_ACC_UP_1:
case Z_EFFECT_EVSN_UP_1:
case Z_EFFECT_ATK_UP_1 ... Z_EFFECT_EVSN_UP_1:
SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_1 + 1, 1, FALSE);
gBattleScripting.animArg1 = 0xE + (gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_1 + 1);
gBattleScripting.animArg2 = 0;
BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH);
gBattlescriptCurrInstr = BattleScript_StatUpZMove;
break;
case Z_EFFECT_ATK_UP_2:
case Z_EFFECT_DEF_UP_2:
case Z_EFFECT_SPD_UP_2:
case Z_EFFECT_SPATK_UP_2:
case Z_EFFECT_SPDEF_UP_2:
case Z_EFFECT_ACC_UP_2:
case Z_EFFECT_EVSN_UP_2:
case Z_EFFECT_ATK_UP_2 ... Z_EFFECT_EVSN_UP_2:
SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_2 + 1, 2, FALSE);
gBattleScripting.animArg1 = 0xE + (gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_2 + 1);
gBattleScripting.animArg2 = 0;
BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH);
gBattlescriptCurrInstr = BattleScript_StatUpZMove;
break;
case Z_EFFECT_ATK_UP_3:
case Z_EFFECT_DEF_UP_3:
case Z_EFFECT_SPD_UP_3:
case Z_EFFECT_SPATK_UP_3:
case Z_EFFECT_SPDEF_UP_3:
case Z_EFFECT_ACC_UP_3:
case Z_EFFECT_EVSN_UP_3:
case Z_EFFECT_ATK_UP_3 ... Z_EFFECT_EVSN_UP_3:
SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_3 + 1, 3, FALSE);
gBattleScripting.animArg1 = 0xE + (gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_3 + 1);
gBattleScripting.animArg2 = 0;
BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH);
gBattlescriptCurrInstr = BattleScript_StatUpZMove;
break;