dont trigger x_up_hit effect if battle is over

This commit is contained in:
ghoulslash 2021-11-04 15:45:03 -04:00
parent a30573f317
commit 24cb5f6654

View file

@ -2992,7 +2992,8 @@ void SetMoveEffect(bool32 primary, u32 certain)
case MOVE_EFFECT_SP_DEF_PLUS_1:
case MOVE_EFFECT_ACC_PLUS_1:
case MOVE_EFFECT_EVS_PLUS_1:
if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(1),
if (NoAliveMonsForEitherParty()
|| ChangeStatBuffs(SET_STAT_BUFF_VALUE(1),
gBattleScripting.moveEffect - MOVE_EFFECT_ATK_PLUS_1 + 1,
affectsUser, 0))
{
@ -3153,8 +3154,15 @@ void SetMoveEffect(bool32 primary, u32 certain)
gBattlescriptCurrInstr++;
break;
case MOVE_EFFECT_ALL_STATS_UP:
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_AllStatsUp;
if (NoAliveMonsForEitherParty())
{
gBattlescriptCurrInstr++;
}
else
{
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_AllStatsUp;
}
break;
case MOVE_EFFECT_RAPIDSPIN:
BattleScriptPush(gBattlescriptCurrInstr + 1);