handle simple beam, gastro acid

This commit is contained in:
ghoulslash 2021-11-01 13:50:57 -04:00
parent a2b8f3f169
commit a1e64fce4f
6 changed files with 25 additions and 2 deletions

View File

@ -1864,6 +1864,10 @@
.4byte \ptr
.endm
.macro tryendneutralizinggas battler:req
various \battler, VARIOUS_TRY_END_NEUTRALIZING_GAS
.endm
@ helpful macros
.macro setstatchanger stat:req, stages:req, down:req
setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7

View File

@ -1993,6 +1993,7 @@ BattleScript_EffectSimpleBeam:
printstring STRINGID_PKMNACQUIREDSIMPLE
waitmessage B_WAIT_TIME_LONG
trytoclearprimalweather
tryendneutralizinggas BS_TARGET
printstring STRINGID_EMPTYSTRING3
waitmessage 1
goto BattleScript_MoveEnd
@ -2215,6 +2216,7 @@ BattleScript_EffectGastroAcid:
printstring STRINGID_PKMNSABILITYSUPPRESSED
waitmessage B_WAIT_TIME_LONG
trytoclearprimalweather
tryendneutralizinggas BS_TARGET
printstring STRINGID_EMPTYSTRING3
waitmessage 1
goto BattleScript_MoveEnd

View File

@ -182,7 +182,8 @@ struct SpecialStatus
u8 damagedMons:4; // Mons that have been damaged directly by using a move, includes substitute.
u8 dancerUsedMove:1;
u8 dancerOriginalTarget:3;
u8 announceNeutralizingGas:1;
u8 announceNeutralizingGas:1; // See Cmd_switchineffects
u8 neutralizingGasRemoved:1; // See VARIOUS_TRY_END_NEUTRALIZING_GAS
s32 dmg;
s32 physicalDmg;
s32 specialDmg;

View File

@ -194,6 +194,7 @@
#define VARIOUS_HANDLE_PRIMAL_REVERSION 121
#define VARIOUS_APPLY_PLASMA_FISTS 122
#define VARIOUS_JUMP_IF_SPECIES 123
#define VARIOUS_TRY_END_NEUTRALIZING_GAS 124
// Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0

View File

@ -8002,6 +8002,9 @@ static void Cmd_various(void)
}
else
{
if (gBattleMons[gBattlerTarget].ability == ABILITY_NEUTRALIZING_GAS)
gSpecialStatuses[gBattlerTarget].neutralizingGasRemoved = TRUE;
gBattleMons[gBattlerTarget].ability = ABILITY_SIMPLE;
gBattlescriptCurrInstr += 7;
}
@ -8899,6 +8902,15 @@ static void Cmd_various(void)
}
break;
}
case VARIOUS_TRY_END_NEUTRALIZING_GAS:
if (gSpecialStatuses[gActiveBattler].neutralizingGasRemoved)
{
gSpecialStatuses[gActiveBattler].neutralizingGasRemoved = FALSE;
BattleScriptPush(gBattlescriptCurrInstr + 3);
gBattlescriptCurrInstr = BattleScript_NeutralizingGasExits;
return;
}
break;
case VARIOUS_GET_ROTOTILLER_TARGETS:
// Gets the battlers to be affected by rototiller. If there are none, print 'But it failed!'
{
@ -12011,6 +12023,9 @@ static void Cmd_setgastroacid(void)
}
else
{
if (gBattleMons[gBattlerTarget].ability == ABILITY_NEUTRALIZING_GAS)
gSpecialStatuses[gBattlerTarget].neutralizingGasRemoved = TRUE;
gStatuses3[gBattlerTarget] |= STATUS3_GASTRO_ACID;
gBattlescriptCurrInstr += 5;
}

View File

@ -5489,7 +5489,7 @@ bool32 IsNeutralizingGasOnField(void)
for (i = 0; i < gBattlersCount; i++)
{
if (IsBattlerAlive(i) && gBattleMons[i].ability == ABILITY_NEUTRALIZING_GAS)
if (IsBattlerAlive(i) && gBattleMons[i].ability == ABILITY_NEUTRALIZING_GAS && !(gStatuses3[i] & STATUS3_GASTRO_ACID))
return TRUE;
}