mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 11:44:17 +01:00
handle simple beam, gastro acid
This commit is contained in:
parent
a2b8f3f169
commit
a1e64fce4f
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user