Rename Battle Weather flags
This commit is contained in:
@@ -1320,22 +1320,22 @@ u8 DoFieldEndTurnEffects(void)
|
||||
}
|
||||
break;
|
||||
case ENDTURN_RAIN:
|
||||
if (gBattleWeather & WEATHER_RAIN_ANY)
|
||||
if (gBattleWeather & B_WEATHER_RAIN)
|
||||
{
|
||||
if (!(gBattleWeather & WEATHER_RAIN_PERMANENT))
|
||||
if (!(gBattleWeather & B_WEATHER_RAIN_PERMANENT))
|
||||
{
|
||||
if (--gWishFutureKnock.weatherDuration == 0)
|
||||
{
|
||||
gBattleWeather &= ~WEATHER_RAIN_TEMPORARY;
|
||||
gBattleWeather &= ~WEATHER_RAIN_DOWNPOUR;
|
||||
gBattleWeather &= ~B_WEATHER_RAIN_TEMPORARY;
|
||||
gBattleWeather &= ~B_WEATHER_RAIN_DOWNPOUR;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_RAIN_STOPPED;
|
||||
}
|
||||
else if (gBattleWeather & WEATHER_RAIN_DOWNPOUR)
|
||||
else if (gBattleWeather & B_WEATHER_RAIN_DOWNPOUR)
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOWNPOUR_CONTINUES;
|
||||
else
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_RAIN_CONTINUES;
|
||||
}
|
||||
else if (gBattleWeather & WEATHER_RAIN_DOWNPOUR)
|
||||
else if (gBattleWeather & B_WEATHER_RAIN_DOWNPOUR)
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOWNPOUR_CONTINUES;
|
||||
}
|
||||
@@ -1350,11 +1350,11 @@ u8 DoFieldEndTurnEffects(void)
|
||||
gBattleStruct->turnCountersTracker++;
|
||||
break;
|
||||
case ENDTURN_SANDSTORM:
|
||||
if (gBattleWeather & WEATHER_SANDSTORM_ANY)
|
||||
if (gBattleWeather & B_WEATHER_SANDSTORM)
|
||||
{
|
||||
if (!(gBattleWeather & WEATHER_SANDSTORM_PERMANENT) && --gWishFutureKnock.weatherDuration == 0)
|
||||
if (!(gBattleWeather & B_WEATHER_SANDSTORM_PERMANENT) && --gWishFutureKnock.weatherDuration == 0)
|
||||
{
|
||||
gBattleWeather &= ~WEATHER_SANDSTORM_TEMPORARY;
|
||||
gBattleWeather &= ~B_WEATHER_SANDSTORM_TEMPORARY;
|
||||
gBattlescriptCurrInstr = BattleScript_SandStormHailEnds;
|
||||
}
|
||||
else
|
||||
@@ -1370,11 +1370,11 @@ u8 DoFieldEndTurnEffects(void)
|
||||
gBattleStruct->turnCountersTracker++;
|
||||
break;
|
||||
case ENDTURN_SUN:
|
||||
if (gBattleWeather & WEATHER_SUN_ANY)
|
||||
if (gBattleWeather & B_WEATHER_SUN)
|
||||
{
|
||||
if (!(gBattleWeather & WEATHER_SUN_PERMANENT) && --gWishFutureKnock.weatherDuration == 0)
|
||||
if (!(gBattleWeather & B_WEATHER_SUN_PERMANENT) && --gWishFutureKnock.weatherDuration == 0)
|
||||
{
|
||||
gBattleWeather &= ~WEATHER_SUN_TEMPORARY;
|
||||
gBattleWeather &= ~B_WEATHER_SUN_TEMPORARY;
|
||||
gBattlescriptCurrInstr = BattleScript_SunlightFaded;
|
||||
}
|
||||
else
|
||||
@@ -1388,11 +1388,11 @@ u8 DoFieldEndTurnEffects(void)
|
||||
gBattleStruct->turnCountersTracker++;
|
||||
break;
|
||||
case ENDTURN_HAIL:
|
||||
if (gBattleWeather & WEATHER_HAIL_ANY)
|
||||
if (gBattleWeather & B_WEATHER_HAIL)
|
||||
{
|
||||
if (--gWishFutureKnock.weatherDuration == 0)
|
||||
{
|
||||
gBattleWeather &= ~WEATHER_HAIL;
|
||||
gBattleWeather &= ~B_WEATHER_HAIL_TEMPORARY;
|
||||
gBattlescriptCurrInstr = BattleScript_SandStormHailEnds;
|
||||
}
|
||||
else
|
||||
@@ -2389,22 +2389,22 @@ u8 CastformDataTypeChange(u8 battler)
|
||||
}
|
||||
if (!WEATHER_HAS_EFFECT)
|
||||
return CASTFORM_NO_CHANGE;
|
||||
if (!(gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SUN_ANY | WEATHER_HAIL_ANY)) && !IS_BATTLER_OF_TYPE(battler, TYPE_NORMAL))
|
||||
if (!(gBattleWeather & (B_WEATHER_RAIN | B_WEATHER_SUN | B_WEATHER_HAIL)) && !IS_BATTLER_OF_TYPE(battler, TYPE_NORMAL))
|
||||
{
|
||||
SET_BATTLER_TYPE(battler, TYPE_NORMAL);
|
||||
formChange = CASTFORM_TO_NORMAL;
|
||||
}
|
||||
if (gBattleWeather & WEATHER_SUN_ANY && !IS_BATTLER_OF_TYPE(battler, TYPE_FIRE))
|
||||
if (gBattleWeather & B_WEATHER_SUN && !IS_BATTLER_OF_TYPE(battler, TYPE_FIRE))
|
||||
{
|
||||
SET_BATTLER_TYPE(battler, TYPE_FIRE);
|
||||
formChange = CASTFORM_TO_FIRE;
|
||||
}
|
||||
if (gBattleWeather & WEATHER_RAIN_ANY && !IS_BATTLER_OF_TYPE(battler, TYPE_WATER))
|
||||
if (gBattleWeather & B_WEATHER_RAIN && !IS_BATTLER_OF_TYPE(battler, TYPE_WATER))
|
||||
{
|
||||
SET_BATTLER_TYPE(battler, TYPE_WATER);
|
||||
formChange = CASTFORM_TO_WATER;
|
||||
}
|
||||
if (gBattleWeather & WEATHER_HAIL_ANY && !IS_BATTLER_OF_TYPE(battler, TYPE_ICE))
|
||||
if (gBattleWeather & B_WEATHER_HAIL && !IS_BATTLER_OF_TYPE(battler, TYPE_ICE))
|
||||
{
|
||||
SET_BATTLER_TYPE(battler, TYPE_ICE);
|
||||
formChange = CASTFORM_TO_ICE;
|
||||
@@ -2480,27 +2480,27 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
case WEATHER_RAIN:
|
||||
case WEATHER_RAIN_THUNDERSTORM:
|
||||
case WEATHER_DOWNPOUR:
|
||||
if (!(gBattleWeather & WEATHER_RAIN_ANY))
|
||||
if (!(gBattleWeather & B_WEATHER_RAIN))
|
||||
{
|
||||
gBattleWeather = (WEATHER_RAIN_TEMPORARY | WEATHER_RAIN_PERMANENT);
|
||||
gBattleWeather = (B_WEATHER_RAIN_TEMPORARY | B_WEATHER_RAIN_PERMANENT);
|
||||
gBattleScripting.animArg1 = B_ANIM_RAIN_CONTINUES;
|
||||
gBattleScripting.battler = battler;
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
case WEATHER_SANDSTORM:
|
||||
if (!(gBattleWeather & WEATHER_SANDSTORM_ANY))
|
||||
if (!(gBattleWeather & B_WEATHER_SANDSTORM))
|
||||
{
|
||||
gBattleWeather = WEATHER_SANDSTORM_ANY;
|
||||
gBattleWeather = B_WEATHER_SANDSTORM;
|
||||
gBattleScripting.animArg1 = B_ANIM_SANDSTORM_CONTINUES;
|
||||
gBattleScripting.battler = battler;
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
case WEATHER_DROUGHT:
|
||||
if (!(gBattleWeather & WEATHER_SUN_ANY))
|
||||
if (!(gBattleWeather & B_WEATHER_SUN))
|
||||
{
|
||||
gBattleWeather = WEATHER_SUN_ANY;
|
||||
gBattleWeather = B_WEATHER_SUN;
|
||||
gBattleScripting.animArg1 = B_ANIM_SUN_CONTINUES;
|
||||
gBattleScripting.battler = battler;
|
||||
effect++;
|
||||
@@ -2515,27 +2515,27 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
}
|
||||
break;
|
||||
case ABILITY_DRIZZLE:
|
||||
if (!(gBattleWeather & WEATHER_RAIN_PERMANENT))
|
||||
if (!(gBattleWeather & B_WEATHER_RAIN_PERMANENT))
|
||||
{
|
||||
gBattleWeather = (WEATHER_RAIN_PERMANENT | WEATHER_RAIN_TEMPORARY);
|
||||
gBattleWeather = (B_WEATHER_RAIN_PERMANENT | B_WEATHER_RAIN_TEMPORARY);
|
||||
BattleScriptPushCursorAndCallback(BattleScript_DrizzleActivates);
|
||||
gBattleScripting.battler = battler;
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
case ABILITY_SAND_STREAM:
|
||||
if (!(gBattleWeather & WEATHER_SANDSTORM_PERMANENT))
|
||||
if (!(gBattleWeather & B_WEATHER_SANDSTORM_PERMANENT))
|
||||
{
|
||||
gBattleWeather = WEATHER_SANDSTORM_ANY;
|
||||
gBattleWeather = B_WEATHER_SANDSTORM;
|
||||
BattleScriptPushCursorAndCallback(BattleScript_SandstreamActivates);
|
||||
gBattleScripting.battler = battler;
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
case ABILITY_DROUGHT:
|
||||
if (!(gBattleWeather & WEATHER_SUN_PERMANENT))
|
||||
if (!(gBattleWeather & B_WEATHER_SUN_PERMANENT))
|
||||
{
|
||||
gBattleWeather = WEATHER_SUN_ANY;
|
||||
gBattleWeather = B_WEATHER_SUN;
|
||||
BattleScriptPushCursorAndCallback(BattleScript_DroughtActivates);
|
||||
gBattleScripting.battler = battler;
|
||||
effect++;
|
||||
@@ -2590,7 +2590,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
switch (gLastUsedAbility)
|
||||
{
|
||||
case ABILITY_RAIN_DISH:
|
||||
if (WEATHER_HAS_EFFECT && (gBattleWeather & WEATHER_RAIN_ANY)
|
||||
if (WEATHER_HAS_EFFECT && (gBattleWeather & B_WEATHER_RAIN)
|
||||
&& gBattleMons[battler].maxHP > gBattleMons[battler].hp)
|
||||
{
|
||||
gLastUsedAbility = ABILITY_RAIN_DISH; // why
|
||||
|
||||
Reference in New Issue
Block a user