More Neutralizing Gas cleanup (#8335)

This commit is contained in:
PhallenTree 2025-11-23 16:29:50 +00:00 committed by GitHub
parent 7fd0745766
commit 10ef7f7839
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 8 additions and 19 deletions

View File

@ -8112,12 +8112,6 @@ BattleScript_SwitchInAbilityMsg::
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
end3 end3
BattleScript_SwitchInAbilityMsgRet::
call BattleScript_AbilityPopUp
printfromtable gSwitchInAbilityStringIds
waitmessage B_WAIT_TIME_LONG
return
BattleScript_ActivateAsOne:: BattleScript_ActivateAsOne::
call BattleScript_AbilityPopUp call BattleScript_AbilityPopUp
printfromtable gSwitchInAbilityStringIds printfromtable gSwitchInAbilityStringIds

View File

@ -197,8 +197,8 @@ struct SpecialStatus
u8 switchInItemDone:1; u8 switchInItemDone:1;
u8 instructedChosenTarget:3; u8 instructedChosenTarget:3;
u8 berryReduced:1; u8 berryReduced:1;
u8 announceNeutralizingGas:1; // See Cmd_switchineffects
u8 neutralizingGasRemoved:1; // See VARIOUS_TRY_END_NEUTRALIZING_GAS u8 neutralizingGasRemoved:1; // See VARIOUS_TRY_END_NEUTRALIZING_GAS
u8 padding:1;
// End of byte // End of byte
u8 gemParam; u8 gemParam;
// End of byte // End of byte

View File

@ -287,7 +287,6 @@ extern const u8 BattleScript_AttackerAbilityStatRaiseEnd3[];
extern const u8 BattleScript_PoisonHealActivates[]; extern const u8 BattleScript_PoisonHealActivates[];
extern const u8 BattleScript_BadDreamsActivates[]; extern const u8 BattleScript_BadDreamsActivates[];
extern const u8 BattleScript_SwitchInAbilityMsg[]; extern const u8 BattleScript_SwitchInAbilityMsg[];
extern const u8 BattleScript_SwitchInAbilityMsgRet[];
extern const u8 BattleScript_ToxicSpikesPoisoned[]; extern const u8 BattleScript_ToxicSpikesPoisoned[];
extern const u8 BattleScript_ToxicSpikesBadlyPoisoned[]; extern const u8 BattleScript_ToxicSpikesBadlyPoisoned[];
extern const u8 BattleScript_ToxicSpikesAbsorbed[]; extern const u8 BattleScript_ToxicSpikesAbsorbed[];

View File

@ -7873,13 +7873,9 @@ static bool32 DoSwitchInEffectsForBattler(u32 battler)
u32 i = 0; u32 i = 0;
u32 side = GetBattlerSide(battler); u32 side = GetBattlerSide(battler);
// Neutralizing Gas announces itself before hazards // Neutralizing Gas announces itself before hazards
if (gBattleMons[battler].ability == ABILITY_NEUTRALIZING_GAS && gSpecialStatuses[battler].announceNeutralizingGas == 0) if (AbilityBattleEffects(ABILITYEFFECT_NEUTRALIZINGGAS, battler, 0, 0, 0))
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_NEUTRALIZING_GAS; return TRUE;
gSpecialStatuses[battler].announceNeutralizingGas = TRUE;
gDisableStructs[battler].neutralizingGas = TRUE;
gBattlerAbility = battler;
BattleScriptCall(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.
@ -13103,7 +13099,7 @@ static void Cmd_setgastroacid(void)
} }
else else
{ {
if (gBattleMons[gBattlerTarget].ability == ABILITY_NEUTRALIZING_GAS) if (gDisableStructs[gBattlerTarget].neutralizingGas)
gSpecialStatuses[gBattlerTarget].neutralizingGasRemoved = TRUE; gSpecialStatuses[gBattlerTarget].neutralizingGasRemoved = TRUE;
gBattleMons[gBattlerTarget].volatiles.gastroAcid = TRUE; gBattleMons[gBattlerTarget].volatiles.gastroAcid = TRUE;
@ -14681,7 +14677,7 @@ static void Cmd_tryworryseed(void)
} }
else else
{ {
if (gBattleMons[gBattlerTarget].ability == ABILITY_NEUTRALIZING_GAS) if (gDisableStructs[gBattlerTarget].neutralizingGas)
gSpecialStatuses[gBattlerTarget].neutralizingGasRemoved = TRUE; gSpecialStatuses[gBattlerTarget].neutralizingGasRemoved = TRUE;
gBattleScripting.abilityPopupOverwrite = gBattleMons[gBattlerTarget].ability; gBattleScripting.abilityPopupOverwrite = gBattleMons[gBattlerTarget].ability;
@ -17522,7 +17518,7 @@ void BS_SetSimpleBeam(void)
} }
else else
{ {
if (gBattleMons[gBattlerTarget].ability == ABILITY_NEUTRALIZING_GAS) if (gDisableStructs[gBattlerTarget].neutralizingGas)
gSpecialStatuses[gBattlerTarget].neutralizingGasRemoved = TRUE; gSpecialStatuses[gBattlerTarget].neutralizingGasRemoved = TRUE;
gBattleScripting.abilityPopupOverwrite = gBattleMons[gBattlerTarget].ability; gBattleScripting.abilityPopupOverwrite = gBattleMons[gBattlerTarget].ability;

View File

@ -5185,7 +5185,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
case ABILITYEFFECT_NEUTRALIZINGGAS: case ABILITYEFFECT_NEUTRALIZINGGAS:
// Prints message only. separate from ABILITYEFFECT_ON_SWITCHIN bc activates before entry hazards // Prints message only. separate from ABILITYEFFECT_ON_SWITCHIN bc activates before entry hazards
if (gBattleMons[battler].ability == ABILITY_NEUTRALIZING_GAS && !gDisableStructs[battler].neutralizingGas) if (gLastUsedAbility == ABILITY_NEUTRALIZING_GAS && !gDisableStructs[battler].neutralizingGas)
{ {
gDisableStructs[battler].neutralizingGas = TRUE; gDisableStructs[battler].neutralizingGas = TRUE;
gBattlerAbility = battler; gBattlerAbility = battler;
@ -5386,7 +5386,7 @@ u32 GetBattlerAbilityInternal(u32 battler, u32 ignoreMoldBreaker, u32 noAbilityS
if (!hasAbilityShield if (!hasAbilityShield
&& IsNeutralizingGasOnField() && IsNeutralizingGasOnField()
&& !gDisableStructs[battler].neutralizingGas) && (gBattleMons[battler].ability != ABILITY_NEUTRALIZING_GAS || gBattleMons[battler].volatiles.gastroAcid))
return ABILITY_NONE; return ABILITY_NONE;
if (CanBreakThroughAbility(gBattlerAttacker, battler, gBattleMons[gBattlerAttacker].ability, hasAbilityShield, ignoreMoldBreaker)) if (CanBreakThroughAbility(gBattlerAttacker, battler, gBattleMons[gBattlerAttacker].ability, hasAbilityShield, ignoreMoldBreaker))