fix sand spit + primal weather

This commit is contained in:
ghoulslash 2021-10-11 21:29:08 -04:00
parent e66820e646
commit 791a899eed

View File

@ -5028,20 +5028,21 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
&& TARGET_TURN_DAMAGED
&& !(WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SANDSTORM_ANY)
&& TryChangeBattleWeather(battler, ENUM_WEATHER_SANDSTORM, TRUE)
&& !(WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY))
&& !(WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SANDSTORM_ANY))
{
gBattleScripting.battler = gActiveBattler = battler;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_SandSpitActivates;
effect++;
}
else if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY)
{
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_BlockedByPrimalWeatherRet;
effect++;
if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY)
{
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_BlockedByPrimalWeatherRet;
effect++;
}
else if (TryChangeBattleWeather(battler, ENUM_WEATHER_SANDSTORM, TRUE))
{
gBattleScripting.battler = gActiveBattler = battler;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_SandSpitActivates;
effect++;
}
}
break;
case ABILITY_PERISH_BODY: