mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-13 23:23:43 +01:00
prevent stat-raising damage effects if battle will end
This commit is contained in:
parent
961710ddd9
commit
31bbc4ddde
@ -1089,20 +1089,20 @@ BattleScript_VCreateStatAnim:
|
||||
playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_SPDEF | BIT_SPEED, STAT_CHANGE_NEGATIVE | STAT_CHANGE_CANT_PREVENT
|
||||
setstatchanger STAT_DEF, 1, TRUE
|
||||
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN, BattleScript_VCreateTrySpDef
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_VCreateTrySpDef
|
||||
printfromtable gStatUpStringIds
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_VCreateTrySpDef
|
||||
printfromtable gStatDownStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_VCreateTrySpDef:
|
||||
setstatchanger STAT_SPDEF, 1, TRUE
|
||||
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN, BattleScript_VCreateTrySpeed
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_VCreateTrySpeed
|
||||
printfromtable gStatUpStringIds
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_VCreateTrySpeed
|
||||
printfromtable gStatDownStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_VCreateTrySpeed:
|
||||
setstatchanger STAT_SPEED, 1, TRUE
|
||||
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN, BattleScript_VCreateStatLossRet
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_VCreateStatLossRet
|
||||
printfromtable gStatUpStringIds
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_VCreateStatLossRet
|
||||
printfromtable gStatDownStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_VCreateStatLossRet:
|
||||
return
|
||||
|
@ -3205,11 +3205,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
gBattlescriptCurrInstr++;
|
||||
break;
|
||||
case MOVE_EFFECT_ALL_STATS_UP:
|
||||
if (NoAliveMonsForEitherParty())
|
||||
{
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
else
|
||||
if (!NoAliveMonsForEitherParty())
|
||||
{
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = BattleScript_AllStatsUp;
|
||||
@ -3248,12 +3244,18 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
}
|
||||
break;
|
||||
case MOVE_EFFECT_ATK_DEF_DOWN: // SuperPower
|
||||
if (!NoAliveMonsForEitherParty())
|
||||
{
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = BattleScript_AtkDefDown;
|
||||
}
|
||||
break;
|
||||
case MOVE_EFFECT_DEF_SPDEF_DOWN: // Close Combat
|
||||
if (!NoAliveMonsForEitherParty())
|
||||
{
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = BattleScript_DefSpDefDown;
|
||||
}
|
||||
break;
|
||||
case MOVE_EFFECT_RECOIL_25: // Take Down, 25% recoil
|
||||
gBattleMoveDamage = (gHpDealt) / 4;
|
||||
@ -3308,8 +3310,11 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
}
|
||||
break;
|
||||
case MOVE_EFFECT_SP_ATK_TWO_DOWN: // Overheat
|
||||
if (!NoAliveMonsForEitherParty())
|
||||
{
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = BattleScript_SAtkDown2;
|
||||
}
|
||||
break;
|
||||
case MOVE_EFFECT_CLEAR_SMOG:
|
||||
for (i = 0; i < NUM_BATTLE_STATS; i++)
|
||||
@ -3369,6 +3374,8 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
}
|
||||
break;
|
||||
case MOVE_EFFECT_SPECTRAL_THIEF:
|
||||
if (!NoAliveMonsForEitherParty())
|
||||
{
|
||||
gBattleStruct->stolenStats[0] = 0; // Stats to steal.
|
||||
gBattleScripting.animArg1 = 0;
|
||||
for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++)
|
||||
@ -3407,13 +3414,18 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = BattleScript_SpectralThiefSteal;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MOVE_EFFECT_V_CREATE:
|
||||
if (!NoAliveMonsForEitherParty())
|
||||
{
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = BattleScript_VCreateStatLoss;
|
||||
}
|
||||
break;
|
||||
case MOVE_EFFECT_CORE_ENFORCER:
|
||||
if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget))
|
||||
if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)
|
||||
&& !NoAliveMonsForEitherParty())
|
||||
{
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = BattleScript_MoveEffectCoreEnforcer;
|
||||
|
Loading…
x
Reference in New Issue
Block a user