Fixed infinite loop
This commit is contained in:
parent
b520fe5d89
commit
2b32581c14
3 changed files with 49 additions and 18 deletions
|
@ -4171,6 +4171,20 @@ BattleScript_MysteriousAirCurrentBlowsOnRet:
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
return
|
return
|
||||||
|
|
||||||
|
BattleScript_BlockedByPrimalWeatherEnd3::
|
||||||
|
call BattleScript_AbilityPopUp
|
||||||
|
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessenedEnd3
|
||||||
|
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRainEnd3
|
||||||
|
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOnEnd3
|
||||||
|
end3
|
||||||
|
|
||||||
|
BattleScript_BlockedByPrimalWeatherRet::
|
||||||
|
call BattleScript_AbilityPopUp
|
||||||
|
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessenedRet
|
||||||
|
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRainRet
|
||||||
|
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOnRet
|
||||||
|
return
|
||||||
|
|
||||||
BattleScript_EffectDefenseUpHit::
|
BattleScript_EffectDefenseUpHit::
|
||||||
setmoveeffect MOVE_EFFECT_DEF_PLUS_1 | MOVE_EFFECT_AFFECTS_USER
|
setmoveeffect MOVE_EFFECT_DEF_PLUS_1 | MOVE_EFFECT_AFFECTS_USER
|
||||||
goto BattleScript_EffectHit
|
goto BattleScript_EffectHit
|
||||||
|
@ -7019,9 +7033,6 @@ BattleScript_ItemSteal::
|
||||||
BattleScript_DrizzleActivates::
|
BattleScript_DrizzleActivates::
|
||||||
pause B_WAIT_TIME_SHORT
|
pause B_WAIT_TIME_SHORT
|
||||||
call BattleScript_AbilityPopUp
|
call BattleScript_AbilityPopUp
|
||||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessenedEnd3
|
|
||||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRainEnd3
|
|
||||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOnEnd3
|
|
||||||
printstring STRINGID_PKMNMADEITRAIN
|
printstring STRINGID_PKMNMADEITRAIN
|
||||||
waitstate
|
waitstate
|
||||||
playanimation BS_BATTLER_0, B_ANIM_RAIN_CONTINUES, NULL
|
playanimation BS_BATTLER_0, B_ANIM_RAIN_CONTINUES, NULL
|
||||||
|
@ -7180,9 +7191,6 @@ BattleScript_HealerActivates::
|
||||||
BattleScript_SandstreamActivates::
|
BattleScript_SandstreamActivates::
|
||||||
pause B_WAIT_TIME_SHORT
|
pause B_WAIT_TIME_SHORT
|
||||||
call BattleScript_AbilityPopUp
|
call BattleScript_AbilityPopUp
|
||||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessenedEnd3
|
|
||||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRainEnd3
|
|
||||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOnEnd3
|
|
||||||
printstring STRINGID_PKMNSXWHIPPEDUPSANDSTORM
|
printstring STRINGID_PKMNSXWHIPPEDUPSANDSTORM
|
||||||
waitstate
|
waitstate
|
||||||
playanimation BS_BATTLER_0, B_ANIM_SANDSTORM_CONTINUES, NULL
|
playanimation BS_BATTLER_0, B_ANIM_SANDSTORM_CONTINUES, NULL
|
||||||
|
@ -7192,9 +7200,6 @@ BattleScript_SandstreamActivates::
|
||||||
BattleScript_SandSpitActivates::
|
BattleScript_SandSpitActivates::
|
||||||
pause B_WAIT_TIME_SHORT
|
pause B_WAIT_TIME_SHORT
|
||||||
call BattleScript_AbilityPopUp
|
call BattleScript_AbilityPopUp
|
||||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessenedRet
|
|
||||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRainRet
|
|
||||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOnRet
|
|
||||||
printstring STRINGID_ASANDSTORMKICKEDUP
|
printstring STRINGID_ASANDSTORMKICKEDUP
|
||||||
waitstate
|
waitstate
|
||||||
playanimation BS_BATTLER_0, B_ANIM_SANDSTORM_CONTINUES, NULL
|
playanimation BS_BATTLER_0, B_ANIM_SANDSTORM_CONTINUES, NULL
|
||||||
|
@ -7292,9 +7297,6 @@ BattleScript_IntimidatePrevented:
|
||||||
BattleScript_DroughtActivates::
|
BattleScript_DroughtActivates::
|
||||||
pause B_WAIT_TIME_SHORT
|
pause B_WAIT_TIME_SHORT
|
||||||
call BattleScript_AbilityPopUp
|
call BattleScript_AbilityPopUp
|
||||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessenedEnd3
|
|
||||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRainEnd3
|
|
||||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOnEnd3
|
|
||||||
printstring STRINGID_PKMNSXINTENSIFIEDSUN
|
printstring STRINGID_PKMNSXINTENSIFIEDSUN
|
||||||
waitstate
|
waitstate
|
||||||
playanimation BS_BATTLER_0, B_ANIM_SUN_CONTINUES, NULL
|
playanimation BS_BATTLER_0, B_ANIM_SUN_CONTINUES, NULL
|
||||||
|
@ -7354,9 +7356,6 @@ BattleScript_AttackWeakenedByStrongWinds::
|
||||||
BattleScript_SnowWarningActivates::
|
BattleScript_SnowWarningActivates::
|
||||||
pause B_WAIT_TIME_SHORT
|
pause B_WAIT_TIME_SHORT
|
||||||
call BattleScript_AbilityPopUp
|
call BattleScript_AbilityPopUp
|
||||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessenedEnd3
|
|
||||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRainEnd3
|
|
||||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOnEnd3
|
|
||||||
printstring STRINGID_SNOWWARNINGHAIL
|
printstring STRINGID_SNOWWARNINGHAIL
|
||||||
waitstate
|
waitstate
|
||||||
playanimation BS_BATTLER_0, B_ANIM_HAIL_CONTINUES, NULL
|
playanimation BS_BATTLER_0, B_ANIM_HAIL_CONTINUES, NULL
|
||||||
|
|
|
@ -396,5 +396,7 @@ extern const u8 BattleScript_PrimordialSeaFizzlesOutFireTypeMoves[];
|
||||||
extern const u8 BattleScript_DeltaStreamActivates[];
|
extern const u8 BattleScript_DeltaStreamActivates[];
|
||||||
extern const u8 BattleScript_MysteriousAirCurrentBlowsOn[];
|
extern const u8 BattleScript_MysteriousAirCurrentBlowsOn[];
|
||||||
extern const u8 BattleScript_AttackWeakenedByStrongWinds[];
|
extern const u8 BattleScript_AttackWeakenedByStrongWinds[];
|
||||||
|
extern const u8 BattleScript_BlockedByPrimalWeatherEnd3[];
|
||||||
|
extern const u8 BattleScript_BlockedByPrimalWeatherRet[];
|
||||||
|
|
||||||
#endif // GUARD_BATTLE_SCRIPTS_H
|
#endif // GUARD_BATTLE_SCRIPTS_H
|
||||||
|
|
|
@ -3694,8 +3694,7 @@ bool32 TryChangeBattleWeather(u8 battler, u32 weatherEnumId, bool32 viaAbility)
|
||||||
&& GetBattlerAbility(battler) != ABILITY_PRIMORDIAL_SEA
|
&& GetBattlerAbility(battler) != ABILITY_PRIMORDIAL_SEA
|
||||||
&& GetBattlerAbility(battler) != ABILITY_DELTA_STREAM)
|
&& GetBattlerAbility(battler) != ABILITY_DELTA_STREAM)
|
||||||
{
|
{
|
||||||
weatherEnumId = 0;
|
return FALSE;
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
else if (!(gBattleWeather & (sWeatherFlagsInfo[weatherEnumId][0] | sWeatherFlagsInfo[weatherEnumId][1])))
|
else if (!(gBattleWeather & (sWeatherFlagsInfo[weatherEnumId][0] | sWeatherFlagsInfo[weatherEnumId][1])))
|
||||||
{
|
{
|
||||||
|
@ -4167,6 +4166,12 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_DrizzleActivates);
|
BattleScriptPushCursorAndCallback(BattleScript_DrizzleActivates);
|
||||||
effect++;
|
effect++;
|
||||||
}
|
}
|
||||||
|
else if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY && !gSpecialStatuses[battler].switchInAbilityDone)
|
||||||
|
{
|
||||||
|
gSpecialStatuses[battler].switchInAbilityDone = 1;
|
||||||
|
BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3);
|
||||||
|
effect++;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITY_SAND_STREAM:
|
case ABILITY_SAND_STREAM:
|
||||||
if (TryChangeBattleWeather(battler, ENUM_WEATHER_SANDSTORM, TRUE))
|
if (TryChangeBattleWeather(battler, ENUM_WEATHER_SANDSTORM, TRUE))
|
||||||
|
@ -4174,6 +4179,12 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_SandstreamActivates);
|
BattleScriptPushCursorAndCallback(BattleScript_SandstreamActivates);
|
||||||
effect++;
|
effect++;
|
||||||
}
|
}
|
||||||
|
else if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY && !gSpecialStatuses[battler].switchInAbilityDone)
|
||||||
|
{
|
||||||
|
gSpecialStatuses[battler].switchInAbilityDone = 1;
|
||||||
|
BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3);
|
||||||
|
effect++;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITY_DROUGHT:
|
case ABILITY_DROUGHT:
|
||||||
if (TryChangeBattleWeather(battler, ENUM_WEATHER_SUN, TRUE))
|
if (TryChangeBattleWeather(battler, ENUM_WEATHER_SUN, TRUE))
|
||||||
|
@ -4181,6 +4192,12 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_DroughtActivates);
|
BattleScriptPushCursorAndCallback(BattleScript_DroughtActivates);
|
||||||
effect++;
|
effect++;
|
||||||
}
|
}
|
||||||
|
else if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY && !gSpecialStatuses[battler].switchInAbilityDone)
|
||||||
|
{
|
||||||
|
gSpecialStatuses[battler].switchInAbilityDone = 1;
|
||||||
|
BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3);
|
||||||
|
effect++;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITY_SNOW_WARNING:
|
case ABILITY_SNOW_WARNING:
|
||||||
if (TryChangeBattleWeather(battler, ENUM_WEATHER_HAIL, TRUE))
|
if (TryChangeBattleWeather(battler, ENUM_WEATHER_HAIL, TRUE))
|
||||||
|
@ -4188,6 +4205,12 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_SnowWarningActivates);
|
BattleScriptPushCursorAndCallback(BattleScript_SnowWarningActivates);
|
||||||
effect++;
|
effect++;
|
||||||
}
|
}
|
||||||
|
else if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY && !gSpecialStatuses[battler].switchInAbilityDone)
|
||||||
|
{
|
||||||
|
gSpecialStatuses[battler].switchInAbilityDone = 1;
|
||||||
|
BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3);
|
||||||
|
effect++;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITY_ELECTRIC_SURGE:
|
case ABILITY_ELECTRIC_SURGE:
|
||||||
if (TryChangeBattleTerrain(battler, STATUS_FIELD_ELECTRIC_TERRAIN, &gFieldTimers.electricTerrainTimer))
|
if (TryChangeBattleTerrain(battler, STATUS_FIELD_ELECTRIC_TERRAIN, &gFieldTimers.electricTerrainTimer))
|
||||||
|
@ -4989,13 +5012,20 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
||||||
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
|
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
|
||||||
&& TARGET_TURN_DAMAGED
|
&& TARGET_TURN_DAMAGED
|
||||||
&& !(WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SANDSTORM_ANY)
|
&& !(WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SANDSTORM_ANY)
|
||||||
&& TryChangeBattleWeather(battler, ENUM_WEATHER_SANDSTORM, TRUE))
|
&& TryChangeBattleWeather(battler, ENUM_WEATHER_SANDSTORM, TRUE)
|
||||||
|
&& !(WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY))
|
||||||
{
|
{
|
||||||
gBattleScripting.battler = gActiveBattler = battler;
|
gBattleScripting.battler = gActiveBattler = battler;
|
||||||
BattleScriptPushCursor();
|
BattleScriptPushCursor();
|
||||||
gBattlescriptCurrInstr = BattleScript_SandSpitActivates;
|
gBattlescriptCurrInstr = BattleScript_SandSpitActivates;
|
||||||
effect++;
|
effect++;
|
||||||
}
|
}
|
||||||
|
else if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY)
|
||||||
|
{
|
||||||
|
BattleScriptPushCursor();
|
||||||
|
gBattlescriptCurrInstr = BattleScript_BlockedByPrimalWeatherRet;
|
||||||
|
effect++;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITY_PERISH_BODY:
|
case ABILITY_PERISH_BODY:
|
||||||
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||||
|
|
Loading…
Reference in a new issue