Clean up battlescript calls with func BattleScriptCall (#6873)
This commit is contained in:
parent
21499cbee1
commit
eb81820ae3
@ -222,6 +222,7 @@ void OpponentSwitchInResetSentPokesToOpponentValue(u32 battler);
|
|||||||
void UpdateSentPokesToOpponentValue(u32 battler);
|
void UpdateSentPokesToOpponentValue(u32 battler);
|
||||||
void BattleScriptPush(const u8 *bsPtr);
|
void BattleScriptPush(const u8 *bsPtr);
|
||||||
void BattleScriptPushCursor(void);
|
void BattleScriptPushCursor(void);
|
||||||
|
void BattleScriptCall(const u8 *bsPtr);
|
||||||
void BattleScriptPop(void);
|
void BattleScriptPop(void);
|
||||||
u32 TrySetCantSelectMoveBattleScript(u32 battler);
|
u32 TrySetCantSelectMoveBattleScript(u32 battler);
|
||||||
u8 CheckMoveLimitations(u32 battler, u8 unusableMoves, u16 check);
|
u8 CheckMoveLimitations(u32 battler, u8 unusableMoves, u16 check);
|
||||||
|
|||||||
@ -502,10 +502,9 @@ void BS_UndoDynamax(void)
|
|||||||
|
|
||||||
if (GetActiveGimmick(battler) == GIMMICK_DYNAMAX)
|
if (GetActiveGimmick(battler) == GIMMICK_DYNAMAX)
|
||||||
{
|
{
|
||||||
BattleScriptPushCursor();
|
|
||||||
UndoDynamax(battler);
|
UndoDynamax(battler);
|
||||||
gBattleScripting.battler = battler;
|
gBattleScripting.battler = battler;
|
||||||
gBattlescriptCurrInstr = BattleScript_DynamaxEnds_Ret;
|
BattleScriptCall(BattleScript_DynamaxEnds_Ret);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1341,8 +1341,7 @@ static void Cmd_attackcanceler(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_MagicCoat);
|
||||||
gBattlescriptCurrInstr = BattleScript_MagicCoat;
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1367,8 +1366,7 @@ static void Cmd_attackcanceler(void)
|
|||||||
{
|
{
|
||||||
ClearDamageCalcResults();
|
ClearDamageCalcResults();
|
||||||
SetAtkCancellerForCalledMove(); // Edge case for bouncing a powder move against a grass type pokemon.
|
SetAtkCancellerForCalledMove(); // Edge case for bouncing a powder move against a grass type pokemon.
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_MagicBounce);
|
||||||
gBattlescriptCurrInstr = BattleScript_MagicBounce;
|
|
||||||
gBattlerAbility = battler;
|
gBattlerAbility = battler;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1391,8 +1389,7 @@ static void Cmd_attackcanceler(void)
|
|||||||
gProtectStructs[gBattlerByTurnOrder[i]].stealMove = FALSE;
|
gProtectStructs[gBattlerByTurnOrder[i]].stealMove = FALSE;
|
||||||
gBattleStruct->snatchedMoveIsUsed = TRUE;
|
gBattleStruct->snatchedMoveIsUsed = TRUE;
|
||||||
gBattleScripting.battler = gBattlerByTurnOrder[i];
|
gBattleScripting.battler = gBattlerByTurnOrder[i];
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_SnatchedMove);
|
||||||
gBattlescriptCurrInstr = BattleScript_SnatchedMove;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1401,16 +1398,14 @@ static void Cmd_attackcanceler(void)
|
|||||||
{
|
{
|
||||||
gSpecialStatuses[gBattlerTarget].lightningRodRedirected = FALSE;
|
gSpecialStatuses[gBattlerTarget].lightningRodRedirected = FALSE;
|
||||||
gLastUsedAbility = ABILITY_LIGHTNING_ROD;
|
gLastUsedAbility = ABILITY_LIGHTNING_ROD;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_TookAttack);
|
||||||
gBattlescriptCurrInstr = BattleScript_TookAttack;
|
|
||||||
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
|
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
|
||||||
}
|
}
|
||||||
else if (gSpecialStatuses[gBattlerTarget].stormDrainRedirected)
|
else if (gSpecialStatuses[gBattlerTarget].stormDrainRedirected)
|
||||||
{
|
{
|
||||||
gSpecialStatuses[gBattlerTarget].stormDrainRedirected = FALSE;
|
gSpecialStatuses[gBattlerTarget].stormDrainRedirected = FALSE;
|
||||||
gLastUsedAbility = ABILITY_STORM_DRAIN;
|
gLastUsedAbility = ABILITY_STORM_DRAIN;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_TookAttack);
|
||||||
gBattlescriptCurrInstr = BattleScript_TookAttack;
|
|
||||||
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
|
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
|
||||||
}
|
}
|
||||||
else if (IsBattlerProtected(gBattlerAttacker, gBattlerTarget, gCurrentMove)
|
else if (IsBattlerProtected(gBattlerAttacker, gBattlerTarget, gCurrentMove)
|
||||||
@ -2282,8 +2277,7 @@ static void Cmd_adjustdamage(void)
|
|||||||
&& !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE)
|
&& !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE)
|
||||||
&& gBattleMons[gBattlerAttacker].item)
|
&& gBattleMons[gBattlerAttacker].item)
|
||||||
{
|
{
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_GemActivates);
|
||||||
gBattlescriptCurrInstr = BattleScript_GemActivates;
|
|
||||||
gLastUsedItem = gBattleMons[gBattlerAttacker].item;
|
gLastUsedItem = gBattleMons[gBattlerAttacker].item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2301,8 +2295,7 @@ static void Cmd_multihitresultmessage(void)
|
|||||||
if (gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_STURDIED)
|
if (gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_STURDIED)
|
||||||
{
|
{
|
||||||
gBattleStruct->moveResultFlags[gBattlerTarget] &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_HUNG_ON);
|
gBattleStruct->moveResultFlags[gBattlerTarget] &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_HUNG_ON);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_SturdiedMsg);
|
||||||
gBattlescriptCurrInstr = BattleScript_SturdiedMsg;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_FOE_HUNG_ON)
|
else if (gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_FOE_HUNG_ON)
|
||||||
@ -2310,8 +2303,7 @@ static void Cmd_multihitresultmessage(void)
|
|||||||
gLastUsedItem = gBattleMons[gBattlerTarget].item;
|
gLastUsedItem = gBattleMons[gBattlerTarget].item;
|
||||||
gPotentialItemEffectBattler = gBattlerTarget;
|
gPotentialItemEffectBattler = gBattlerTarget;
|
||||||
gBattleStruct->moveResultFlags[gBattlerTarget] &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_HUNG_ON);
|
gBattleStruct->moveResultFlags[gBattlerTarget] &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_HUNG_ON);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_HangedOnMsg);
|
||||||
gBattlescriptCurrInstr = BattleScript_HangedOnMsg;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2377,8 +2369,7 @@ static inline bool32 TryStrongWindsWeakenAttack(u32 battlerDef, u32 moveType)
|
|||||||
&& !gBattleStruct->printedStrongWindsWeakenedAttack)
|
&& !gBattleStruct->printedStrongWindsWeakenedAttack)
|
||||||
{
|
{
|
||||||
gBattleStruct->printedStrongWindsWeakenedAttack = TRUE;
|
gBattleStruct->printedStrongWindsWeakenedAttack = TRUE;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_AttackWeakenedByStrongWinds);
|
||||||
gBattlescriptCurrInstr = BattleScript_AttackWeakenedByStrongWinds;
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2392,8 +2383,7 @@ static inline bool32 TryTeraShellDistortTypeMatchups(u32 battlerDef)
|
|||||||
{
|
{
|
||||||
gSpecialStatuses[battlerDef].teraShellAbilityDone = FALSE;
|
gSpecialStatuses[battlerDef].teraShellAbilityDone = FALSE;
|
||||||
gBattleScripting.battler = battlerDef;
|
gBattleScripting.battler = battlerDef;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_TeraShellDistortingTypeMatchups);
|
||||||
gBattlescriptCurrInstr = BattleScript_TeraShellDistortingTypeMatchups;
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -2408,8 +2398,7 @@ static inline bool32 TryActivateWeakenessBerry(u32 battlerDef)
|
|||||||
gBattleScripting.battler = battlerDef;
|
gBattleScripting.battler = battlerDef;
|
||||||
gLastUsedItem = gBattleMons[battlerDef].item;
|
gLastUsedItem = gBattleMons[battlerDef].item;
|
||||||
gBattleStruct->partyState[GetBattlerSide(battlerDef)][gBattlerPartyIndexes[battlerDef]].ateBerry = TRUE;
|
gBattleStruct->partyState[GetBattlerSide(battlerDef)][gBattlerPartyIndexes[battlerDef]].ateBerry = TRUE;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_BerryReduceDmg);
|
||||||
gBattlescriptCurrInstr = BattleScript_BerryReduceDmg;
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2653,8 +2642,7 @@ static void Cmd_datahpupdate(void)
|
|||||||
if (gDisableStructs[battler].substituteHP == 0)
|
if (gDisableStructs[battler].substituteHP == 0)
|
||||||
{
|
{
|
||||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_SubstituteFade);
|
||||||
gBattlescriptCurrInstr = BattleScript_SubstituteFade;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2871,8 +2859,7 @@ static void Cmd_resultmessage(void)
|
|||||||
gBattleStruct->changedSpecies[side][gBattlerPartyIndexes[gBattlerTarget]] = gBattleMons[gBattlerTarget].species;
|
gBattleStruct->changedSpecies[side][gBattlerPartyIndexes[gBattlerTarget]] = gBattleMons[gBattlerTarget].species;
|
||||||
gBattleMons[gBattlerTarget].species = SPECIES_EISCUE_NOICE;
|
gBattleMons[gBattlerTarget].species = SPECIES_EISCUE_NOICE;
|
||||||
gBattleScripting.battler = gBattlerTarget; // For STRINGID_PKMNTRANSFORMED
|
gBattleScripting.battler = gBattlerTarget; // For STRINGID_PKMNTRANSFORMED
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_IceFaceNullsDamage);
|
||||||
gBattlescriptCurrInstr = BattleScript_IceFaceNullsDamage;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2883,8 +2870,7 @@ static void Cmd_resultmessage(void)
|
|||||||
{
|
{
|
||||||
gMultiHitCounter = 0;
|
gMultiHitCounter = 0;
|
||||||
*moveResultFlags &= ~MOVE_RESULT_MISSED;
|
*moveResultFlags &= ~MOVE_RESULT_MISSED;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_MultiHitPrintStrings);
|
||||||
gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2962,8 +2948,7 @@ static void Cmd_resultmessage(void)
|
|||||||
gLastUsedItem = gBattleMons[gBattlerTarget].item;
|
gLastUsedItem = gBattleMons[gBattlerTarget].item;
|
||||||
gPotentialItemEffectBattler = gBattlerTarget;
|
gPotentialItemEffectBattler = gBattlerTarget;
|
||||||
*moveResultFlags &= ~(MOVE_RESULT_FOE_ENDURED | MOVE_RESULT_FOE_HUNG_ON);
|
*moveResultFlags &= ~(MOVE_RESULT_FOE_ENDURED | MOVE_RESULT_FOE_HUNG_ON);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_HangedOnMsg);
|
||||||
gBattlescriptCurrInstr = BattleScript_HangedOnMsg;
|
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
if (*moveResultFlags & MOVE_RESULT_ONE_HIT_KO)
|
if (*moveResultFlags & MOVE_RESULT_ONE_HIT_KO)
|
||||||
@ -2971,22 +2956,19 @@ static void Cmd_resultmessage(void)
|
|||||||
*moveResultFlags &= ~MOVE_RESULT_ONE_HIT_KO;
|
*moveResultFlags &= ~MOVE_RESULT_ONE_HIT_KO;
|
||||||
*moveResultFlags &= ~MOVE_RESULT_SUPER_EFFECTIVE;
|
*moveResultFlags &= ~MOVE_RESULT_SUPER_EFFECTIVE;
|
||||||
*moveResultFlags &= ~MOVE_RESULT_NOT_VERY_EFFECTIVE;
|
*moveResultFlags &= ~MOVE_RESULT_NOT_VERY_EFFECTIVE;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_OneHitKOMsg);
|
||||||
gBattlescriptCurrInstr = BattleScript_OneHitKOMsg;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (*moveResultFlags & MOVE_RESULT_STURDIED)
|
else if (*moveResultFlags & MOVE_RESULT_STURDIED)
|
||||||
{
|
{
|
||||||
*moveResultFlags &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_ENDURED | MOVE_RESULT_FOE_HUNG_ON);
|
*moveResultFlags &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_ENDURED | MOVE_RESULT_FOE_HUNG_ON);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_SturdiedMsg);
|
||||||
gBattlescriptCurrInstr = BattleScript_SturdiedMsg;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (*moveResultFlags & MOVE_RESULT_FOE_ENDURED)
|
else if (*moveResultFlags & MOVE_RESULT_FOE_ENDURED)
|
||||||
{
|
{
|
||||||
*moveResultFlags &= ~(MOVE_RESULT_FOE_ENDURED | MOVE_RESULT_FOE_HUNG_ON);
|
*moveResultFlags &= ~(MOVE_RESULT_FOE_ENDURED | MOVE_RESULT_FOE_HUNG_ON);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_EnduredMsg);
|
||||||
gBattlescriptCurrInstr = BattleScript_EnduredMsg;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (*moveResultFlags & MOVE_RESULT_FOE_HUNG_ON)
|
else if (*moveResultFlags & MOVE_RESULT_FOE_HUNG_ON)
|
||||||
@ -2994,8 +2976,7 @@ static void Cmd_resultmessage(void)
|
|||||||
gLastUsedItem = gBattleMons[gBattlerTarget].item;
|
gLastUsedItem = gBattleMons[gBattlerTarget].item;
|
||||||
gPotentialItemEffectBattler = gBattlerTarget;
|
gPotentialItemEffectBattler = gBattlerTarget;
|
||||||
*moveResultFlags &= ~(MOVE_RESULT_FOE_ENDURED | MOVE_RESULT_FOE_HUNG_ON);
|
*moveResultFlags &= ~(MOVE_RESULT_FOE_ENDURED | MOVE_RESULT_FOE_HUNG_ON);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_HangedOnMsg);
|
||||||
gBattlescriptCurrInstr = BattleScript_HangedOnMsg;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (*moveResultFlags & MOVE_RESULT_FAILED)
|
else if (*moveResultFlags & MOVE_RESULT_FAILED)
|
||||||
@ -3005,8 +2986,7 @@ static void Cmd_resultmessage(void)
|
|||||||
else if (B_AFFECTION_MECHANICS == TRUE && (*moveResultFlags & MOVE_RESULT_FOE_ENDURED_AFFECTION))
|
else if (B_AFFECTION_MECHANICS == TRUE && (*moveResultFlags & MOVE_RESULT_FOE_ENDURED_AFFECTION))
|
||||||
{
|
{
|
||||||
*moveResultFlags &= ~MOVE_RESULT_FOE_ENDURED_AFFECTION;
|
*moveResultFlags &= ~MOVE_RESULT_FOE_ENDURED_AFFECTION;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_AffectionBasedEndurance);
|
||||||
gBattlescriptCurrInstr = BattleScript_AffectionBasedEndurance;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4704,10 +4684,9 @@ static void Cmd_dofaintanimation(void)
|
|||||||
|
|
||||||
if (GetActiveGimmick(battler) == GIMMICK_DYNAMAX)
|
if (GetActiveGimmick(battler) == GIMMICK_DYNAMAX)
|
||||||
{
|
{
|
||||||
BattleScriptPushCursor();
|
|
||||||
UndoDynamax(battler);
|
UndoDynamax(battler);
|
||||||
gBattleScripting.battler = battler;
|
gBattleScripting.battler = battler;
|
||||||
gBattlescriptCurrInstr = BattleScript_DynamaxEnds_Ret;
|
BattleScriptCall(BattleScript_DynamaxEnds_Ret);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5179,9 +5158,8 @@ static void Cmd_getexp(void)
|
|||||||
PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, expBattler, *expMonId);
|
PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, expBattler, *expMonId);
|
||||||
PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff2, 3, GetMonData(&gPlayerParty[*expMonId], MON_DATA_LEVEL));
|
PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff2, 3, GetMonData(&gPlayerParty[*expMonId], MON_DATA_LEVEL));
|
||||||
|
|
||||||
BattleScriptPushCursor();
|
|
||||||
gLeveledUpInBattle |= 1 << *expMonId;
|
gLeveledUpInBattle |= 1 << *expMonId;
|
||||||
gBattlescriptCurrInstr = BattleScript_LevelUp;
|
BattleScriptCall(BattleScript_LevelUp);
|
||||||
gBattleStruct->battlerExpReward = T1_READ_32(&gBattleResources->bufferB[expBattler][2]);
|
gBattleStruct->battlerExpReward = T1_READ_32(&gBattleResources->bufferB[expBattler][2]);
|
||||||
AdjustFriendship(&gPlayerParty[*expMonId], FRIENDSHIP_EVENT_GROW_LEVEL);
|
AdjustFriendship(&gPlayerParty[*expMonId], FRIENDSHIP_EVENT_GROW_LEVEL);
|
||||||
|
|
||||||
@ -6087,8 +6065,7 @@ static bool32 TryKnockOffBattleScript(u32 battlerDef)
|
|||||||
if (GetBattlerAbility(battlerDef) == ABILITY_STICKY_HOLD && IsBattlerAlive(battlerDef))
|
if (GetBattlerAbility(battlerDef) == ABILITY_STICKY_HOLD && IsBattlerAlive(battlerDef))
|
||||||
{
|
{
|
||||||
gBattlerAbility = battlerDef;
|
gBattlerAbility = battlerDef;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_StickyHoldActivates);
|
||||||
gBattlescriptCurrInstr = BattleScript_StickyHoldActivates;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -6111,8 +6088,7 @@ static bool32 TryKnockOffBattleScript(u32 battlerDef)
|
|||||||
gWishFutureKnock.knockedOffMons[side] |= 1u << gBattlerPartyIndexes[battlerDef];
|
gWishFutureKnock.knockedOffMons[side] |= 1u << gBattlerPartyIndexes[battlerDef];
|
||||||
}
|
}
|
||||||
|
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_KnockedOff);
|
||||||
gBattlescriptCurrInstr = BattleScript_KnockedOff;
|
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -6225,8 +6201,7 @@ static bool32 HandleMoveEndAbilityBlock(u32 battlerAtk, u32 battlerDef, u32 move
|
|||||||
StealTargetItem(battlerAtk, battlerDef);
|
StealTargetItem(battlerAtk, battlerDef);
|
||||||
gBattleScripting.battler = gBattlerAbility = battlerAtk;
|
gBattleScripting.battler = gBattlerAbility = battlerAtk;
|
||||||
gEffectBattler = battlerDef;
|
gEffectBattler = battlerDef;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_MagicianActivates);
|
||||||
gBattlescriptCurrInstr = BattleScript_MagicianActivates;
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -6259,8 +6234,7 @@ static bool32 HandleMoveEndAbilityBlock(u32 battlerAtk, u32 battlerDef, u32 move
|
|||||||
SET_STATCHANGER(stat, numMonsFainted, FALSE);
|
SET_STATCHANGER(stat, numMonsFainted, FALSE);
|
||||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, stat);
|
PREPARE_STAT_BUFFER(gBattleTextBuff1, stat);
|
||||||
gBattleScripting.animArg1 = GET_STAT_BUFF_ID(stat) + (numMonsFainted > 1 ? STAT_ANIM_PLUS2 : STAT_ANIM_PLUS1);
|
gBattleScripting.animArg1 = GET_STAT_BUFF_ID(stat) + (numMonsFainted > 1 ? STAT_ANIM_PLUS2 : STAT_ANIM_PLUS1);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_RaiseStatOnFaintingTarget);
|
||||||
gBattlescriptCurrInstr = BattleScript_RaiseStatOnFaintingTarget;
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6285,8 +6259,7 @@ static bool32 HandleMoveEndAbilityBlock(u32 battlerAtk, u32 battlerDef, u32 move
|
|||||||
PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[battlerAtk].species);
|
PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[battlerAtk].species);
|
||||||
gBattleStruct->changedSpecies[side][gBattlerPartyIndexes[battlerAtk]] = gBattleMons[battlerAtk].species;
|
gBattleStruct->changedSpecies[side][gBattlerPartyIndexes[battlerAtk]] = gBattleMons[battlerAtk].species;
|
||||||
gBattleMons[battlerAtk].species = SPECIES_GRENINJA_ASH;
|
gBattleMons[battlerAtk].species = SPECIES_GRENINJA_ASH;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_BattleBondActivatesOnMoveEndAttacker);
|
||||||
gBattlescriptCurrInstr = BattleScript_BattleBondActivatesOnMoveEndAttacker;
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -6316,8 +6289,7 @@ static bool32 HandleMoveEndAbilityBlock(u32 battlerAtk, u32 battlerDef, u32 move
|
|||||||
gLastUsedAbility = abilityAtk;
|
gLastUsedAbility = abilityAtk;
|
||||||
gBattlerAbility = battlerAtk;
|
gBattlerAbility = battlerAtk;
|
||||||
gBattleStruct->partyState[side][gBattlerPartyIndexes[battlerAtk]].battleBondBoost = TRUE;
|
gBattleStruct->partyState[side][gBattlerPartyIndexes[battlerAtk]].battleBondBoost = TRUE;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_EffectBattleBondStatIncrease);
|
||||||
gBattlescriptCurrInstr = BattleScript_EffectBattleBondStatIncrease;
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6376,8 +6348,7 @@ static void Cmd_moveend(void)
|
|||||||
if (gBattleStruct->moveDamage[gBattlerAttacker] == 0)
|
if (gBattleStruct->moveDamage[gBattlerAttacker] == 0)
|
||||||
gBattleStruct->moveDamage[gBattlerAttacker] = 1;
|
gBattleStruct->moveDamage[gBattlerAttacker] = 1;
|
||||||
PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_SPIKY_SHIELD);
|
PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_SPIKY_SHIELD);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_SpikyShieldEffect);
|
||||||
gBattlescriptCurrInstr = BattleScript_SpikyShieldEffect;
|
|
||||||
effect = 1;
|
effect = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -6392,8 +6363,7 @@ static void Cmd_moveend(void)
|
|||||||
gBattleScripting.moveEffect = MOVE_EFFECT_ATK_MINUS_1;
|
gBattleScripting.moveEffect = MOVE_EFFECT_ATK_MINUS_1;
|
||||||
else
|
else
|
||||||
gBattleScripting.moveEffect = MOVE_EFFECT_ATK_MINUS_2;
|
gBattleScripting.moveEffect = MOVE_EFFECT_ATK_MINUS_2;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_KingsShieldEffect);
|
||||||
gBattlescriptCurrInstr = BattleScript_KingsShieldEffect;
|
|
||||||
effect = 1;
|
effect = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -6403,8 +6373,7 @@ static void Cmd_moveend(void)
|
|||||||
gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE;
|
gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE;
|
||||||
gBattleScripting.moveEffect = MOVE_EFFECT_POISON | MOVE_EFFECT_AFFECTS_USER;
|
gBattleScripting.moveEffect = MOVE_EFFECT_POISON | MOVE_EFFECT_AFFECTS_USER;
|
||||||
PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_BANEFUL_BUNKER);
|
PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_BANEFUL_BUNKER);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_BanefulBunkerEffect);
|
||||||
gBattlescriptCurrInstr = BattleScript_BanefulBunkerEffect;
|
|
||||||
effect = 1;
|
effect = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -6414,8 +6383,7 @@ static void Cmd_moveend(void)
|
|||||||
gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE;
|
gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE;
|
||||||
gBattleScripting.moveEffect = MOVE_EFFECT_BURN | MOVE_EFFECT_AFFECTS_USER;
|
gBattleScripting.moveEffect = MOVE_EFFECT_BURN | MOVE_EFFECT_AFFECTS_USER;
|
||||||
PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_BURNING_BULWARK);
|
PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_BURNING_BULWARK);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_BanefulBunkerEffect);
|
||||||
gBattlescriptCurrInstr = BattleScript_BanefulBunkerEffect;
|
|
||||||
effect = 1;
|
effect = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -6429,8 +6397,7 @@ static void Cmd_moveend(void)
|
|||||||
gBattlerAttacker = gBattlerTarget;
|
gBattlerAttacker = gBattlerTarget;
|
||||||
gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable
|
gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable
|
||||||
gBattleScripting.moveEffect = MOVE_EFFECT_DEF_MINUS_2;
|
gBattleScripting.moveEffect = MOVE_EFFECT_DEF_MINUS_2;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_KingsShieldEffect);
|
||||||
gBattlescriptCurrInstr = BattleScript_KingsShieldEffect;
|
|
||||||
effect = 1;
|
effect = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -6442,8 +6409,7 @@ static void Cmd_moveend(void)
|
|||||||
gBattlerAttacker = gBattlerTarget;
|
gBattlerAttacker = gBattlerTarget;
|
||||||
gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable
|
gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable
|
||||||
gBattleScripting.moveEffect = MOVE_EFFECT_SPD_MINUS_1;
|
gBattleScripting.moveEffect = MOVE_EFFECT_SPD_MINUS_1;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_KingsShieldEffect);
|
||||||
gBattlescriptCurrInstr = BattleScript_KingsShieldEffect;
|
|
||||||
effect = 1;
|
effect = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -6460,8 +6426,7 @@ static void Cmd_moveend(void)
|
|||||||
gBattleMons[gBattlerAttacker].status1 = STATUS1_BURN;
|
gBattleMons[gBattlerAttacker].status1 = STATUS1_BURN;
|
||||||
BtlController_EmitSetMonData(gBattlerAttacker, B_COMM_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gBattlerAttacker].status1), &gBattleMons[gBattlerAttacker].status1);
|
BtlController_EmitSetMonData(gBattlerAttacker, B_COMM_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gBattlerAttacker].status1), &gBattleMons[gBattlerAttacker].status1);
|
||||||
MarkBattlerForControllerExec(gBattlerAttacker);
|
MarkBattlerForControllerExec(gBattlerAttacker);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_BeakBlastBurn);
|
||||||
gBattlescriptCurrInstr = BattleScript_BeakBlastBurn;
|
|
||||||
effect = 1;
|
effect = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6483,14 +6448,12 @@ static void Cmd_moveend(void)
|
|||||||
gBattleStruct->moveDamage[gBattlerAttacker] *= -1;
|
gBattleStruct->moveDamage[gBattlerAttacker] *= -1;
|
||||||
gHitMarker |= HITMARKER_PASSIVE_DAMAGE;
|
gHitMarker |= HITMARKER_PASSIVE_DAMAGE;
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABSORB_OOZE;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABSORB_OOZE;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_EffectAbsorbLiquidOoze);
|
||||||
gBattlescriptCurrInstr = BattleScript_EffectAbsorbLiquidOoze;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABSORB;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABSORB;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_EffectAbsorb);
|
||||||
gBattlescriptCurrInstr = BattleScript_EffectAbsorb;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gBattleScripting.moveendState++;
|
gBattleScripting.moveendState++;
|
||||||
@ -6506,8 +6469,7 @@ static void Cmd_moveend(void)
|
|||||||
&& CompareStat(gBattlerTarget, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN))
|
&& CompareStat(gBattlerTarget, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN))
|
||||||
{
|
{
|
||||||
SET_STATCHANGER(STAT_ATK, 1, FALSE);
|
SET_STATCHANGER(STAT_ATK, 1, FALSE);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_RageIsBuilding);
|
||||||
gBattlescriptCurrInstr = BattleScript_RageIsBuilding;
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
}
|
}
|
||||||
gBattleScripting.moveendState++;
|
gBattleScripting.moveendState++;
|
||||||
@ -6603,23 +6565,22 @@ static void Cmd_moveend(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
BattleScriptPushCursor();
|
|
||||||
if (targetAbility == ABILITY_SUCTION_CUPS)
|
if (targetAbility == ABILITY_SUCTION_CUPS)
|
||||||
{
|
{
|
||||||
gBattlescriptCurrInstr = BattleScript_AbilityPreventsPhasingOutRet;
|
BattleScriptCall(BattleScript_AbilityPreventsPhasingOutRet);
|
||||||
}
|
}
|
||||||
else if (gStatuses3[gBattlerTarget] & STATUS3_ROOTED)
|
else if (gStatuses3[gBattlerTarget] & STATUS3_ROOTED)
|
||||||
{
|
{
|
||||||
gBattlescriptCurrInstr = BattleScript_PrintMonIsRootedRet;
|
BattleScriptCall(BattleScript_PrintMonIsRootedRet);
|
||||||
}
|
}
|
||||||
else if (GetActiveGimmick(gBattlerTarget) == GIMMICK_DYNAMAX)
|
else if (GetActiveGimmick(gBattlerTarget) == GIMMICK_DYNAMAX)
|
||||||
{
|
{
|
||||||
gBattlescriptCurrInstr = BattleScript_HitSwitchTargetDynamaxed;
|
BattleScriptCall(BattleScript_HitSwitchTargetDynamaxed);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gBattleScripting.switchCase = B_SWITCH_HIT;
|
gBattleScripting.switchCase = B_SWITCH_HIT;
|
||||||
gBattlescriptCurrInstr = BattleScript_TryHitSwitchTarget;
|
BattleScriptCall(BattleScript_TryHitSwitchTarget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -6899,11 +6860,10 @@ static void Cmd_moveend(void)
|
|||||||
gBattleScripting.multihitString[4]++;
|
gBattleScripting.multihitString[4]++;
|
||||||
if (gMultiHitCounter == 0)
|
if (gMultiHitCounter == 0)
|
||||||
{
|
{
|
||||||
BattleScriptPushCursor();
|
|
||||||
if (GetMoveEffectArg_MoveProperty(gCurrentMove) == MOVE_EFFECT_SCALE_SHOT && !NoAliveMonsForEitherParty())
|
if (GetMoveEffectArg_MoveProperty(gCurrentMove) == MOVE_EFFECT_SCALE_SHOT && !NoAliveMonsForEitherParty())
|
||||||
gBattlescriptCurrInstr = BattleScript_ScaleShot;
|
BattleScriptCall(BattleScript_ScaleShot);
|
||||||
else
|
else
|
||||||
gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings;
|
BattleScriptCall(BattleScript_MultiHitPrintStrings);
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -6936,8 +6896,7 @@ static void Cmd_moveend(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_MultiHitPrintStrings);
|
||||||
gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings;
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6959,8 +6918,7 @@ static void Cmd_moveend(void)
|
|||||||
gBattleMons[gBattlerTarget].status1 &= ~STATUS1_FREEZE;
|
gBattleMons[gBattlerTarget].status1 &= ~STATUS1_FREEZE;
|
||||||
BtlController_EmitSetMonData(gBattlerTarget, B_COMM_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].status1), &gBattleMons[gBattlerTarget].status1);
|
BtlController_EmitSetMonData(gBattlerTarget, B_COMM_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].status1), &gBattleMons[gBattlerTarget].status1);
|
||||||
MarkBattlerForControllerExec(gBattlerTarget);
|
MarkBattlerForControllerExec(gBattlerTarget);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_DefrostedViaFireMove);
|
||||||
gBattlescriptCurrInstr = BattleScript_DefrostedViaFireMove;
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
}
|
}
|
||||||
if (gBattleMons[gBattlerTarget].status1 & STATUS1_FROSTBITE
|
if (gBattleMons[gBattlerTarget].status1 & STATUS1_FROSTBITE
|
||||||
@ -6972,8 +6930,7 @@ static void Cmd_moveend(void)
|
|||||||
gBattleMons[gBattlerTarget].status1 &= ~STATUS1_FROSTBITE;
|
gBattleMons[gBattlerTarget].status1 &= ~STATUS1_FROSTBITE;
|
||||||
BtlController_EmitSetMonData(gBattlerTarget, B_COMM_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].status1), &gBattleMons[gBattlerTarget].status1);
|
BtlController_EmitSetMonData(gBattlerTarget, B_COMM_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].status1), &gBattleMons[gBattlerTarget].status1);
|
||||||
MarkBattlerForControllerExec(gBattlerTarget);
|
MarkBattlerForControllerExec(gBattlerTarget);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_FrostbiteHealedViaFireMove);
|
||||||
gBattlescriptCurrInstr = BattleScript_FrostbiteHealedViaFireMove;
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
}
|
}
|
||||||
gBattleScripting.moveendState++;
|
gBattleScripting.moveendState++;
|
||||||
@ -7002,8 +6959,7 @@ static void Cmd_moveend(void)
|
|||||||
if (gBattleStruct->moveDamage[gBattlerAttacker] == 0)
|
if (gBattleStruct->moveDamage[gBattlerAttacker] == 0)
|
||||||
gBattleStruct->moveDamage[gBattlerAttacker] = 1;
|
gBattleStruct->moveDamage[gBattlerAttacker] = 1;
|
||||||
|
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_RecoilIfMiss);
|
||||||
gBattlescriptCurrInstr = BattleScript_RecoilIfMiss;
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -7011,8 +6967,7 @@ static void Cmd_moveend(void)
|
|||||||
if (IsBattlerTurnDamaged(gBattlerTarget) && IsBattlerAlive(gBattlerAttacker))
|
if (IsBattlerTurnDamaged(gBattlerTarget) && IsBattlerAlive(gBattlerAttacker))
|
||||||
{
|
{
|
||||||
gBattleStruct->moveDamage[gBattlerAttacker] = max(1, gBattleStruct->moveDamage[gBattlerTarget] * max(1, GetMoveRecoil(gCurrentMove)) / 100);
|
gBattleStruct->moveDamage[gBattlerAttacker] = max(1, gBattleStruct->moveDamage[gBattlerTarget] * max(1, GetMoveRecoil(gCurrentMove)) / 100);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_MoveEffectRecoil);
|
||||||
gBattlescriptCurrInstr = BattleScript_MoveEffectRecoil;
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -7020,8 +6975,7 @@ static void Cmd_moveend(void)
|
|||||||
if (!IsAbilityOnField(ABILITY_DAMP))
|
if (!IsAbilityOnField(ABILITY_DAMP))
|
||||||
{
|
{
|
||||||
gBattleStruct->moveDamage[gBattlerAttacker] = 0;
|
gBattleStruct->moveDamage[gBattlerAttacker] = 0;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_FaintAttackerForExplosion);
|
||||||
gBattlescriptCurrInstr = BattleScript_FaintAttackerForExplosion;
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -7032,16 +6986,14 @@ static void Cmd_moveend(void)
|
|||||||
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)
|
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)
|
||||||
{
|
{
|
||||||
gBattleStruct->moveDamage[gBattlerAttacker] = (GetNonDynamaxMaxHP(gBattlerAttacker) + 1) / 2; // Half of Max HP Rounded UP
|
gBattleStruct->moveDamage[gBattlerAttacker] = (GetNonDynamaxMaxHP(gBattlerAttacker) + 1) / 2; // Half of Max HP Rounded UP
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_MaxHp50Recoil);
|
||||||
gBattlescriptCurrInstr = BattleScript_MaxHp50Recoil;
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EFFECT_RAPID_SPIN:
|
case EFFECT_RAPID_SPIN:
|
||||||
if (IsBattlerTurnDamaged(gBattlerTarget))
|
if (IsBattlerTurnDamaged(gBattlerTarget))
|
||||||
{
|
{
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_RapidSpinAway);
|
||||||
gBattlescriptCurrInstr = BattleScript_RapidSpinAway;
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -7054,8 +7006,7 @@ static void Cmd_moveend(void)
|
|||||||
{
|
{
|
||||||
SET_STATCHANGER(STAT_ATK, GetGenConfig(GEN_CONFIG_FELL_STINGER_STAT_RAISE) >= GEN_7 ? 3 : 2, FALSE);
|
SET_STATCHANGER(STAT_ATK, GetGenConfig(GEN_CONFIG_FELL_STINGER_STAT_RAISE) >= GEN_7 ? 3 : 2, FALSE);
|
||||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_ATK);
|
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_ATK);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_FellStingerRaisesStat);
|
||||||
gBattlescriptCurrInstr = BattleScript_FellStingerRaisesStat;
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -7115,8 +7066,7 @@ static void Cmd_moveend(void)
|
|||||||
gLastUsedItem = gBattleMons[battler].item;
|
gLastUsedItem = gBattleMons[battler].item;
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
gBattleStruct->battlerState[battler].usedEjectItem = TRUE;
|
gBattleStruct->battlerState[battler].usedEjectItem = TRUE;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_EjectButtonActivates);
|
||||||
gBattlescriptCurrInstr = BattleScript_EjectButtonActivates;
|
|
||||||
gAiLogicData->ejectButtonSwitch = TRUE;
|
gAiLogicData->ejectButtonSwitch = TRUE;
|
||||||
break; // Only the fastest Eject Button activates
|
break; // Only the fastest Eject Button activates
|
||||||
}
|
}
|
||||||
@ -7169,8 +7119,7 @@ static void Cmd_moveend(void)
|
|||||||
gLastUsedItem = gBattleMons[battler].item;
|
gLastUsedItem = gBattleMons[battler].item;
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
gBattleStruct->battlerState[battler].usedEjectItem = TRUE;
|
gBattleStruct->battlerState[battler].usedEjectItem = TRUE;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_EjectPackActivates);
|
||||||
gBattlescriptCurrInstr = BattleScript_EjectPackActivates;
|
|
||||||
gAiLogicData->ejectPackSwitch = TRUE;
|
gAiLogicData->ejectPackSwitch = TRUE;
|
||||||
break; // Only the fastest Eject item activates
|
break; // Only the fastest Eject item activates
|
||||||
}
|
}
|
||||||
@ -7189,8 +7138,7 @@ static void Cmd_moveend(void)
|
|||||||
if (GetBattlerHoldEffect(i, TRUE) == HOLD_EFFECT_WHITE_HERB
|
if (GetBattlerHoldEffect(i, TRUE) == HOLD_EFFECT_WHITE_HERB
|
||||||
&& RestoreWhiteHerbStats(i))
|
&& RestoreWhiteHerbStats(i))
|
||||||
{
|
{
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_WhiteHerbRet);
|
||||||
gBattlescriptCurrInstr = BattleScript_WhiteHerbRet;
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -7232,13 +7180,12 @@ static void Cmd_moveend(void)
|
|||||||
SaveBattlerAttacker(gBattlerAttacker);
|
SaveBattlerAttacker(gBattlerAttacker);
|
||||||
gBattleScripting.battler = battler;
|
gBattleScripting.battler = battler;
|
||||||
gEffectBattler = gBattlerAttacker;
|
gEffectBattler = gBattlerAttacker;
|
||||||
BattleScriptPushCursor();
|
|
||||||
if (gBattleStruct->commanderActive[gBattlerAttacker] != SPECIES_NONE
|
if (gBattleStruct->commanderActive[gBattlerAttacker] != SPECIES_NONE
|
||||||
|| GetBattlerAbility(gBattlerAttacker) == ABILITY_GUARD_DOG
|
|| GetBattlerAbility(gBattlerAttacker) == ABILITY_GUARD_DOG
|
||||||
|| GetActiveGimmick(gBattlerAttacker) == GIMMICK_DYNAMAX)
|
|| GetActiveGimmick(gBattlerAttacker) == GIMMICK_DYNAMAX)
|
||||||
gBattlescriptCurrInstr = BattleScript_RedCardActivationNoSwitch;
|
BattleScriptCall(BattleScript_RedCardActivationNoSwitch);
|
||||||
else
|
else
|
||||||
gBattlescriptCurrInstr = BattleScript_RedCardActivates;
|
BattleScriptCall(BattleScript_RedCardActivates);
|
||||||
break; // Only fastest red card activates
|
break; // Only fastest red card activates
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7281,8 +7228,7 @@ static void Cmd_moveend(void)
|
|||||||
StealTargetItem(gBattlerTarget, gBattlerAttacker); // Target takes attacker's item
|
StealTargetItem(gBattlerTarget, gBattlerAttacker); // Target takes attacker's item
|
||||||
|
|
||||||
gEffectBattler = gBattlerAttacker;
|
gEffectBattler = gBattlerAttacker;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_Pickpocket); // Includes sticky hold check to print separate string
|
||||||
gBattlescriptCurrInstr = BattleScript_Pickpocket; // Includes sticky hold check to print separate string
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
break; // Pickpocket activates on fastest mon, so exit loop.
|
break; // Pickpocket activates on fastest mon, so exit loop.
|
||||||
}
|
}
|
||||||
@ -7325,12 +7271,11 @@ static void Cmd_moveend(void)
|
|||||||
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
gBattleScripting.battler = battler;
|
gBattleScripting.battler = battler;
|
||||||
BattleScriptPushCursor();
|
|
||||||
|
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER || IsOnPlayerSide(battler))
|
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER || IsOnPlayerSide(battler))
|
||||||
gBattlescriptCurrInstr = BattleScript_EmergencyExit;
|
BattleScriptCall(BattleScript_EmergencyExit);
|
||||||
else
|
else
|
||||||
gBattlescriptCurrInstr = BattleScript_EmergencyExitWild;
|
BattleScriptCall(BattleScript_EmergencyExitWild);
|
||||||
|
|
||||||
break; // Only the fastest Emergency Exit / Wimp Out activates
|
break; // Only the fastest Emergency Exit / Wimp Out activates
|
||||||
}
|
}
|
||||||
@ -7348,8 +7293,7 @@ static void Cmd_moveend(void)
|
|||||||
&& !NoAliveMonsForBattlerSide(gBattlerTarget))
|
&& !NoAliveMonsForBattlerSide(gBattlerTarget))
|
||||||
{
|
{
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_EffectHitEscape);
|
||||||
gBattlescriptCurrInstr = BattleScript_EffectHitEscape;
|
|
||||||
}
|
}
|
||||||
gBattleScripting.moveendState++;
|
gBattleScripting.moveendState++;
|
||||||
break;
|
break;
|
||||||
@ -7370,8 +7314,7 @@ static void Cmd_moveend(void)
|
|||||||
gLastUsedAbility = gBattleMons[BATTLE_PARTNER(i)].ability;
|
gLastUsedAbility = gBattleMons[BATTLE_PARTNER(i)].ability;
|
||||||
gBattleScripting.battler = gBattlerAbility = BATTLE_PARTNER(i);
|
gBattleScripting.battler = gBattlerAbility = BATTLE_PARTNER(i);
|
||||||
gBattlerAttacker = i;
|
gBattlerAttacker = i;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_SymbiosisActivates);
|
||||||
gBattlescriptCurrInstr = BattleScript_SymbiosisActivates;
|
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8168,15 +8111,14 @@ static void SetDmgHazardsBattlescript(u8 battler, u8 multistringId)
|
|||||||
gBattleScripting.battler = battler;
|
gBattleScripting.battler = battler;
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = multistringId;
|
gBattleCommunication[MULTISTRING_CHOOSER] = multistringId;
|
||||||
|
|
||||||
BattleScriptPushCursor();
|
|
||||||
if (gBattlescriptCurrInstr[1] == BS_TARGET)
|
if (gBattlescriptCurrInstr[1] == BS_TARGET)
|
||||||
gBattlescriptCurrInstr = BattleScript_DmgHazardsOnTarget;
|
BattleScriptCall(BattleScript_DmgHazardsOnTarget);
|
||||||
else if (gBattlescriptCurrInstr[1] == BS_ATTACKER)
|
else if (gBattlescriptCurrInstr[1] == BS_ATTACKER)
|
||||||
gBattlescriptCurrInstr = BattleScript_DmgHazardsOnAttacker;
|
BattleScriptCall(BattleScript_DmgHazardsOnAttacker);
|
||||||
else if (gBattlescriptCurrInstr[1] == BS_SCRIPTING)
|
else if (gBattlescriptCurrInstr[1] == BS_SCRIPTING)
|
||||||
gBattlescriptCurrInstr = BattleScript_DmgHazardsOnBattlerScripting;
|
BattleScriptCall(BattleScript_DmgHazardsOnBattlerScripting);
|
||||||
else
|
else
|
||||||
gBattlescriptCurrInstr = BattleScript_DmgHazardsOnFaintedBattler;
|
BattleScriptCall(BattleScript_DmgHazardsOnFaintedBattler);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool32 DoSwitchInAbilities(u32 battler)
|
bool32 DoSwitchInAbilities(u32 battler)
|
||||||
@ -8208,8 +8150,7 @@ static bool32 DoSwitchInEffectsForBattler(u32 battler)
|
|||||||
gSpecialStatuses[battler].announceNeutralizingGas = TRUE;
|
gSpecialStatuses[battler].announceNeutralizingGas = TRUE;
|
||||||
gDisableStructs[battler].neutralizingGas = TRUE;
|
gDisableStructs[battler].neutralizingGas = TRUE;
|
||||||
gBattlerAbility = battler;
|
gBattlerAbility = battler;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_SwitchInAbilityMsgRet);
|
||||||
gBattlescriptCurrInstr = BattleScript_SwitchInAbilityMsgRet;
|
|
||||||
}
|
}
|
||||||
// Healing Wish activates before hazards.
|
// Healing Wish activates before hazards.
|
||||||
// Starting from Gen8 - it heals only pokemon which can be healed. In gens 5,6,7 the effect activates anyways.
|
// Starting from Gen8 - it heals only pokemon which can be healed. In gens 5,6,7 the effect activates anyways.
|
||||||
@ -8219,14 +8160,12 @@ static bool32 DoSwitchInEffectsForBattler(u32 battler)
|
|||||||
gBattlerAttacker = battler;
|
gBattlerAttacker = battler;
|
||||||
if (gBattleStruct->battlerState[battler].storedHealingWish)
|
if (gBattleStruct->battlerState[battler].storedHealingWish)
|
||||||
{
|
{
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_HealingWishActivates);
|
||||||
gBattlescriptCurrInstr = BattleScript_HealingWishActivates;
|
|
||||||
gBattleStruct->battlerState[battler].storedHealingWish = FALSE;
|
gBattleStruct->battlerState[battler].storedHealingWish = FALSE;
|
||||||
}
|
}
|
||||||
else // Lunar Dance
|
else // Lunar Dance
|
||||||
{
|
{
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_LunarDanceActivates);
|
||||||
gBattlescriptCurrInstr = BattleScript_LunarDanceActivates;
|
|
||||||
gBattleStruct->battlerState[battler].storedLunarDance = FALSE;
|
gBattleStruct->battlerState[battler].storedLunarDance = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8265,8 +8204,7 @@ static bool32 DoSwitchInEffectsForBattler(u32 battler)
|
|||||||
gSideStatuses[GetBattlerSide(battler)] &= ~SIDE_STATUS_TOXIC_SPIKES;
|
gSideStatuses[GetBattlerSide(battler)] &= ~SIDE_STATUS_TOXIC_SPIKES;
|
||||||
gSideTimers[GetBattlerSide(battler)].toxicSpikesAmount = 0;
|
gSideTimers[GetBattlerSide(battler)].toxicSpikesAmount = 0;
|
||||||
gBattleScripting.battler = battler;
|
gBattleScripting.battler = battler;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_ToxicSpikesAbsorbed);
|
||||||
gBattlescriptCurrInstr = BattleScript_ToxicSpikesAbsorbed;
|
|
||||||
}
|
}
|
||||||
else if (IsBattlerAffectedByHazards(battler, TRUE))
|
else if (IsBattlerAffectedByHazards(battler, TRUE))
|
||||||
{
|
{
|
||||||
@ -8283,11 +8221,10 @@ static bool32 DoSwitchInEffectsForBattler(u32 battler)
|
|||||||
BtlController_EmitSetMonData(battler, B_COMM_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[battler].status1), &gBattleMons[battler].status1);
|
BtlController_EmitSetMonData(battler, B_COMM_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[battler].status1), &gBattleMons[battler].status1);
|
||||||
MarkBattlerForControllerExec(battler);
|
MarkBattlerForControllerExec(battler);
|
||||||
gBattleScripting.battler = battler;
|
gBattleScripting.battler = battler;
|
||||||
BattleScriptPushCursor();
|
|
||||||
if (tspikes == 0)
|
if (tspikes == 0)
|
||||||
gBattlescriptCurrInstr = BattleScript_ToxicSpikesPoisoned;
|
BattleScriptCall(BattleScript_ToxicSpikesPoisoned);
|
||||||
else
|
else
|
||||||
gBattlescriptCurrInstr = BattleScript_ToxicSpikesBadlyPoisoned;
|
BattleScriptCall(BattleScript_ToxicSpikesBadlyPoisoned);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8299,8 +8236,7 @@ static bool32 DoSwitchInEffectsForBattler(u32 battler)
|
|||||||
gDisableStructs[battler].stickyWebDone = TRUE;
|
gDisableStructs[battler].stickyWebDone = TRUE;
|
||||||
gBattleScripting.battler = battler;
|
gBattleScripting.battler = battler;
|
||||||
SET_STATCHANGER(STAT_SPEED, 1, TRUE);
|
SET_STATCHANGER(STAT_SPEED, 1, TRUE);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_StickyWebOnSwitchIn);
|
||||||
gBattlescriptCurrInstr = BattleScript_StickyWebOnSwitchIn;
|
|
||||||
}
|
}
|
||||||
else if (!(gDisableStructs[battler].steelSurgeDone)
|
else if (!(gDisableStructs[battler].steelSurgeDone)
|
||||||
&& (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_STEELSURGE)
|
&& (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_STEELSURGE)
|
||||||
@ -8318,9 +8254,8 @@ static bool32 DoSwitchInEffectsForBattler(u32 battler)
|
|||||||
gBattleStruct->zmove.healReplacement = FALSE;
|
gBattleStruct->zmove.healReplacement = FALSE;
|
||||||
gBattleStruct->moveDamage[battler] = -1 * (gBattleMons[battler].maxHP);
|
gBattleStruct->moveDamage[battler] = -1 * (gBattleMons[battler].maxHP);
|
||||||
gBattleScripting.battler = battler;
|
gBattleScripting.battler = battler;
|
||||||
BattleScriptPushCursor();
|
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_Z_HP_TRAP;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_Z_HP_TRAP;
|
||||||
gBattlescriptCurrInstr = BattleScript_HealReplacementZMove;
|
BattleScriptCall(BattleScript_HealReplacementZMove);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -9699,8 +9634,7 @@ static void RemoveAllTerrains(void)
|
|||||||
PREPARE_MOVE_BUFFER(gBattleTextBuff1, move);\
|
PREPARE_MOVE_BUFFER(gBattleTextBuff1, move);\
|
||||||
*sideStatuses &= ~status; \
|
*sideStatuses &= ~status; \
|
||||||
sideTimer->structField = 0; \
|
sideTimer->structField = 0; \
|
||||||
BattleScriptPushCursor(); \
|
BattleScriptCall(battlescript); \
|
||||||
gBattlescriptCurrInstr = battlescript; \
|
|
||||||
} \
|
} \
|
||||||
else \
|
else \
|
||||||
{ \
|
{ \
|
||||||
@ -9741,15 +9675,13 @@ static bool32 TryDefogClear(u32 battlerAtk, bool32 clear)
|
|||||||
if (gBattleWeather & B_WEATHER_FOG)
|
if (gBattleWeather & B_WEATHER_FOG)
|
||||||
{
|
{
|
||||||
gBattleWeather &= ~B_WEATHER_FOG;
|
gBattleWeather &= ~B_WEATHER_FOG;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_FogEnded_Ret);
|
||||||
gBattlescriptCurrInstr = BattleScript_FogEnded_Ret;
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
if (B_DEFOG_EFFECT_CLEARING >= GEN_8 && (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY))
|
if (B_DEFOG_EFFECT_CLEARING >= GEN_8 && (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY))
|
||||||
{
|
{
|
||||||
RemoveAllTerrains();
|
RemoveAllTerrains();
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_TerrainEnds_Ret);
|
||||||
gBattlescriptCurrInstr = BattleScript_TerrainEnds_Ret;
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9785,8 +9717,7 @@ static bool32 TryTidyUpClear(u32 battlerAtk, bool32 clear)
|
|||||||
gBattlerTarget = i;
|
gBattlerTarget = i;
|
||||||
gDisableStructs[i].substituteHP = 0;
|
gDisableStructs[i].substituteHP = 0;
|
||||||
gBattleMons[i].status2 &= ~STATUS2_SUBSTITUTE;
|
gBattleMons[i].status2 &= ~STATUS2_SUBSTITUTE;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_SubstituteFade);
|
||||||
gBattlescriptCurrInstr = BattleScript_SubstituteFade;
|
|
||||||
}
|
}
|
||||||
gBattlerAttacker = saveBattler;
|
gBattlerAttacker = saveBattler;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -10174,16 +10105,15 @@ static void Cmd_various(void)
|
|||||||
{
|
{
|
||||||
gLastUsedItem = gBattleMons[gBattlerTarget].item;
|
gLastUsedItem = gBattleMons[gBattlerTarget].item;
|
||||||
RecordItemEffectBattle(gBattlerTarget, GetBattlerHoldEffect(gBattlerTarget, FALSE));
|
RecordItemEffectBattle(gBattlerTarget, GetBattlerHoldEffect(gBattlerTarget, FALSE));
|
||||||
BattleScriptPushCursor();
|
|
||||||
// If Frisk identifies two mons' items, show the pop-up only once.
|
// If Frisk identifies two mons' items, show the pop-up only once.
|
||||||
if (gBattleStruct->friskedAbility)
|
if (gBattleStruct->friskedAbility)
|
||||||
{
|
{
|
||||||
gBattlescriptCurrInstr = BattleScript_FriskMsg;
|
BattleScriptCall(BattleScript_FriskMsg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gBattleStruct->friskedAbility = TRUE;
|
gBattleStruct->friskedAbility = TRUE;
|
||||||
gBattlescriptCurrInstr = BattleScript_FriskMsgWithPopup;
|
BattleScriptCall(BattleScript_FriskMsgWithPopup);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -10624,8 +10554,7 @@ static void Cmd_various(void)
|
|||||||
{
|
{
|
||||||
SET_STATCHANGER(STAT_SPATK, 1, FALSE);
|
SET_STATCHANGER(STAT_SPATK, 1, FALSE);
|
||||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_SPATK);
|
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_SPATK);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_ScriptingAbilityStatRaise);
|
||||||
gBattlescriptCurrInstr = BattleScript_ScriptingAbilityStatRaise;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -11172,8 +11101,7 @@ static void Cmd_various(void)
|
|||||||
VARIOUS_ARGS(const u8 *failInstr);
|
VARIOUS_ARGS(const u8 *failInstr);
|
||||||
if (GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_ROOM_SERVICE && TryRoomService(battler))
|
if (GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_ROOM_SERVICE && TryRoomService(battler))
|
||||||
{
|
{
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_ConsumableStatRaiseRet);
|
||||||
gBattlescriptCurrInstr = BattleScript_ConsumableStatRaiseRet;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -14351,50 +14279,43 @@ static void Cmd_rapidspinfree(void)
|
|||||||
gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_WRAPPED;
|
gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_WRAPPED;
|
||||||
gBattlerTarget = gBattleStruct->wrappedBy[gBattlerAttacker];
|
gBattlerTarget = gBattleStruct->wrappedBy[gBattlerAttacker];
|
||||||
PREPARE_MOVE_BUFFER(gBattleTextBuff1, gBattleStruct->wrappedMove[gBattlerAttacker]);
|
PREPARE_MOVE_BUFFER(gBattleTextBuff1, gBattleStruct->wrappedMove[gBattlerAttacker]);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_WrapFree);
|
||||||
gBattlescriptCurrInstr = BattleScript_WrapFree;
|
|
||||||
}
|
}
|
||||||
else if (gStatuses3[gBattlerAttacker] & STATUS3_LEECHSEED)
|
else if (gStatuses3[gBattlerAttacker] & STATUS3_LEECHSEED)
|
||||||
{
|
{
|
||||||
gStatuses3[gBattlerAttacker] &= ~STATUS3_LEECHSEED;
|
gStatuses3[gBattlerAttacker] &= ~STATUS3_LEECHSEED;
|
||||||
gStatuses3[gBattlerAttacker] &= ~STATUS3_LEECHSEED_BATTLER;
|
gStatuses3[gBattlerAttacker] &= ~STATUS3_LEECHSEED_BATTLER;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_LeechSeedFree);
|
||||||
gBattlescriptCurrInstr = BattleScript_LeechSeedFree;
|
|
||||||
}
|
}
|
||||||
else if (gSideStatuses[atkSide] & SIDE_STATUS_SPIKES)
|
else if (gSideStatuses[atkSide] & SIDE_STATUS_SPIKES)
|
||||||
{
|
{
|
||||||
gSideStatuses[atkSide] &= ~SIDE_STATUS_SPIKES;
|
gSideStatuses[atkSide] &= ~SIDE_STATUS_SPIKES;
|
||||||
gSideTimers[atkSide].spikesAmount = 0;
|
gSideTimers[atkSide].spikesAmount = 0;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_SpikesFree);
|
||||||
gBattlescriptCurrInstr = BattleScript_SpikesFree;
|
|
||||||
}
|
}
|
||||||
else if (gSideStatuses[atkSide] & SIDE_STATUS_TOXIC_SPIKES)
|
else if (gSideStatuses[atkSide] & SIDE_STATUS_TOXIC_SPIKES)
|
||||||
{
|
{
|
||||||
gSideStatuses[atkSide] &= ~SIDE_STATUS_TOXIC_SPIKES;
|
gSideStatuses[atkSide] &= ~SIDE_STATUS_TOXIC_SPIKES;
|
||||||
gSideTimers[atkSide].toxicSpikesAmount = 0;
|
gSideTimers[atkSide].toxicSpikesAmount = 0;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_ToxicSpikesFree);
|
||||||
gBattlescriptCurrInstr = BattleScript_ToxicSpikesFree;
|
|
||||||
}
|
}
|
||||||
else if (gSideStatuses[atkSide] & SIDE_STATUS_STICKY_WEB)
|
else if (gSideStatuses[atkSide] & SIDE_STATUS_STICKY_WEB)
|
||||||
{
|
{
|
||||||
gSideStatuses[atkSide] &= ~SIDE_STATUS_STICKY_WEB;
|
gSideStatuses[atkSide] &= ~SIDE_STATUS_STICKY_WEB;
|
||||||
gSideTimers[atkSide].stickyWebAmount = 0;
|
gSideTimers[atkSide].stickyWebAmount = 0;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_StickyWebFree);
|
||||||
gBattlescriptCurrInstr = BattleScript_StickyWebFree;
|
|
||||||
}
|
}
|
||||||
else if (gSideStatuses[atkSide] & SIDE_STATUS_STEALTH_ROCK)
|
else if (gSideStatuses[atkSide] & SIDE_STATUS_STEALTH_ROCK)
|
||||||
{
|
{
|
||||||
gSideStatuses[atkSide] &= ~SIDE_STATUS_STEALTH_ROCK;
|
gSideStatuses[atkSide] &= ~SIDE_STATUS_STEALTH_ROCK;
|
||||||
gSideTimers[atkSide].stealthRockAmount = 0;
|
gSideTimers[atkSide].stealthRockAmount = 0;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_StealthRockFree);
|
||||||
gBattlescriptCurrInstr = BattleScript_StealthRockFree;
|
|
||||||
}
|
}
|
||||||
else if (gSideStatuses[atkSide] & SIDE_STATUS_STEELSURGE)
|
else if (gSideStatuses[atkSide] & SIDE_STATUS_STEELSURGE)
|
||||||
{
|
{
|
||||||
gSideStatuses[atkSide] &= ~SIDE_STATUS_STEELSURGE;
|
gSideStatuses[atkSide] &= ~SIDE_STATUS_STEELSURGE;
|
||||||
gSideTimers[atkSide].steelsurgeAmount = 0;
|
gSideTimers[atkSide].steelsurgeAmount = 0;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_SteelsurgeFree);
|
||||||
gBattlescriptCurrInstr = BattleScript_SteelsurgeFree;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -16686,15 +16607,13 @@ void BS_DoStockpileStatChangesWearOff(void)
|
|||||||
{
|
{
|
||||||
SET_STATCHANGER(STAT_DEF, abs(gDisableStructs[battler].stockpileDef), TRUE);
|
SET_STATCHANGER(STAT_DEF, abs(gDisableStructs[battler].stockpileDef), TRUE);
|
||||||
gDisableStructs[battler].stockpileDef = 0;
|
gDisableStructs[battler].stockpileDef = 0;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(cmd->statChangeInstr);
|
||||||
gBattlescriptCurrInstr = cmd->statChangeInstr;
|
|
||||||
}
|
}
|
||||||
else if (gDisableStructs[battler].stockpileSpDef)
|
else if (gDisableStructs[battler].stockpileSpDef)
|
||||||
{
|
{
|
||||||
SET_STATCHANGER(STAT_SPDEF, abs(gDisableStructs[battler].stockpileSpDef), TRUE);
|
SET_STATCHANGER(STAT_SPDEF, abs(gDisableStructs[battler].stockpileSpDef), TRUE);
|
||||||
gDisableStructs[battler].stockpileSpDef = 0;
|
gDisableStructs[battler].stockpileSpDef = 0;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(cmd->statChangeInstr);
|
||||||
gBattlescriptCurrInstr = cmd->statChangeInstr;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -16857,8 +16776,7 @@ void BS_TrySymbiosis(void)
|
|||||||
gLastUsedAbility = gBattleMons[partner].ability;
|
gLastUsedAbility = gBattleMons[partner].ability;
|
||||||
gBattleScripting.battler = gBattlerAbility = partner;
|
gBattleScripting.battler = gBattlerAbility = partner;
|
||||||
gEffectBattler = battler;
|
gEffectBattler = battler;
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_SymbiosisActivates);
|
||||||
gBattlescriptCurrInstr = BattleScript_SymbiosisActivates;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17841,14 +17759,12 @@ void BS_TryActivateGulpMissile(void)
|
|||||||
switch(gBattleMons[gBattlerTarget].species)
|
switch(gBattleMons[gBattlerTarget].species)
|
||||||
{
|
{
|
||||||
case SPECIES_CRAMORANT_GORGING:
|
case SPECIES_CRAMORANT_GORGING:
|
||||||
BattleScriptPushCursor();
|
|
||||||
TryBattleFormChange(gBattlerTarget, FORM_CHANGE_HIT_BY_MOVE);
|
TryBattleFormChange(gBattlerTarget, FORM_CHANGE_HIT_BY_MOVE);
|
||||||
gBattlescriptCurrInstr = BattleScript_GulpMissileGorging;
|
BattleScriptCall(BattleScript_GulpMissileGorging);
|
||||||
return;
|
return;
|
||||||
case SPECIES_CRAMORANT_GULPING:
|
case SPECIES_CRAMORANT_GULPING:
|
||||||
BattleScriptPushCursor();
|
|
||||||
TryBattleFormChange(gBattlerTarget, FORM_CHANGE_HIT_BY_MOVE);
|
TryBattleFormChange(gBattlerTarget, FORM_CHANGE_HIT_BY_MOVE);
|
||||||
gBattlescriptCurrInstr = BattleScript_GulpMissileGulping;
|
BattleScriptCall(BattleScript_GulpMissileGulping);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -18306,8 +18222,7 @@ void BS_SpectralThiefPrintStats(void)
|
|||||||
stat,
|
stat,
|
||||||
MOVE_EFFECT_CERTAIN | MOVE_EFFECT_AFFECTS_USER, NULL) == STAT_CHANGE_WORKED)
|
MOVE_EFFECT_CERTAIN | MOVE_EFFECT_AFFECTS_USER, NULL) == STAT_CHANGE_WORKED)
|
||||||
{
|
{
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_StatUpMsg);
|
||||||
gBattlescriptCurrInstr = BattleScript_StatUpMsg;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -18688,8 +18603,7 @@ void BS_TryIntimidatEjectpack(void)
|
|||||||
gBattleScripting.battler = affectedBattler;
|
gBattleScripting.battler = affectedBattler;
|
||||||
gLastUsedItem = gBattleMons[affectedBattler].item;
|
gLastUsedItem = gBattleMons[affectedBattler].item;
|
||||||
RecordItemEffectBattle(affectedBattler, HOLD_EFFECT_EJECT_PACK);
|
RecordItemEffectBattle(affectedBattler, HOLD_EFFECT_EJECT_PACK);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_EjectPackActivate_Ret);
|
||||||
gBattlescriptCurrInstr = BattleScript_EjectPackActivate_Ret;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -141,9 +141,8 @@ u32 BattlePalace_TryEscapeStatus(u8 battler)
|
|||||||
// Wake up from Uproar
|
// Wake up from Uproar
|
||||||
gBattleMons[battler].status1 &= ~(STATUS1_SLEEP);
|
gBattleMons[battler].status1 &= ~(STATUS1_SLEEP);
|
||||||
gBattleMons[battler].status2 &= ~(STATUS2_NIGHTMARE);
|
gBattleMons[battler].status2 &= ~(STATUS2_NIGHTMARE);
|
||||||
BattleScriptPushCursor();
|
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP_UPROAR;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP_UPROAR;
|
||||||
gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp;
|
BattleScriptCall(BattleScript_MoveUsedWokeUp);
|
||||||
effect = 2;
|
effect = 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -171,9 +170,8 @@ u32 BattlePalace_TryEscapeStatus(u8 battler)
|
|||||||
{
|
{
|
||||||
// Wake up
|
// Wake up
|
||||||
gBattleMons[battler].status2 &= ~(STATUS2_NIGHTMARE);
|
gBattleMons[battler].status2 &= ~(STATUS2_NIGHTMARE);
|
||||||
BattleScriptPushCursor();
|
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP;
|
||||||
gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp;
|
BattleScriptCall(BattleScript_MoveUsedWokeUp);
|
||||||
effect = 2;
|
effect = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -192,8 +190,7 @@ u32 BattlePalace_TryEscapeStatus(u8 battler)
|
|||||||
{
|
{
|
||||||
// Unfreeze
|
// Unfreeze
|
||||||
gBattleMons[battler].status1 &= ~(STATUS1_FREEZE);
|
gBattleMons[battler].status1 &= ~(STATUS1_FREEZE);
|
||||||
BattleScriptPushCursor();
|
BattleScriptCall(BattleScript_MoveUsedUnfroze);
|
||||||
gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze;
|
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DEFROSTED;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DEFROSTED;
|
||||||
}
|
}
|
||||||
effect = 2;
|
effect = 2;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user