Multiple changes 2
This commit is contained in:
+34
-34
@@ -568,22 +568,22 @@ u8 DoFieldEndTurnEffects(void)
|
||||
++gBattleStruct->turnCountersTracker;
|
||||
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] = 2;
|
||||
}
|
||||
else if (gBattleWeather & WEATHER_RAIN_DOWNPOUR)
|
||||
else if (gBattleWeather & B_WEATHER_RAIN_DOWNPOUR)
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 1;
|
||||
else
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
|
||||
}
|
||||
else if (gBattleWeather & WEATHER_RAIN_DOWNPOUR)
|
||||
else if (gBattleWeather & B_WEATHER_RAIN_DOWNPOUR)
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 1;
|
||||
}
|
||||
@@ -597,11 +597,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
|
||||
@@ -616,11 +616,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
|
||||
@@ -633,11 +633,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
|
||||
@@ -1093,7 +1093,7 @@ bool8 HandleFaintedMonActions(void)
|
||||
++gBattleStruct->faintedActionsState;
|
||||
for (i = 0; i < gBattlersCount; ++i)
|
||||
{
|
||||
if (gAbsentBattlerFlags & gBitTable[i] && !HasNoMonsToSwitch(i, 6, 6))
|
||||
if (gAbsentBattlerFlags & gBitTable[i] && !HasNoMonsToSwitch(i, PARTY_SIZE, PARTY_SIZE))
|
||||
gAbsentBattlerFlags &= ~(gBitTable[i]);
|
||||
}
|
||||
// fall through
|
||||
@@ -1552,22 +1552,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;
|
||||
@@ -1631,27 +1631,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_PERMANENT | WEATHER_SANDSTORM_TEMPORARY);
|
||||
gBattleWeather = (B_WEATHER_SANDSTORM_PERMANENT | B_WEATHER_SANDSTORM_TEMPORARY);
|
||||
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_PERMANENT | WEATHER_SUN_TEMPORARY);
|
||||
gBattleWeather = (B_WEATHER_SUN_PERMANENT | B_WEATHER_SUN_TEMPORARY);
|
||||
gBattleScripting.animArg1 = B_ANIM_SUN_CONTINUES;
|
||||
gBattleScripting.battler = battler;
|
||||
++effect;
|
||||
@@ -1665,27 +1665,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_PERMANENT | WEATHER_SANDSTORM_TEMPORARY);
|
||||
gBattleWeather = (B_WEATHER_SANDSTORM_PERMANENT | B_WEATHER_SANDSTORM_TEMPORARY);
|
||||
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_PERMANENT | WEATHER_SUN_TEMPORARY);
|
||||
gBattleWeather = (B_WEATHER_SUN_PERMANENT | B_WEATHER_SUN_TEMPORARY);
|
||||
BattleScriptPushCursorAndCallback(BattleScript_DroughtActivates);
|
||||
gBattleScripting.battler = battler;
|
||||
++effect;
|
||||
@@ -1739,7 +1739,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
|
||||
@@ -2971,7 +2971,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||
&& TARGET_TURN_DAMAGED
|
||||
&& (Random() % 100) < battlerHoldEffectParam
|
||||
&& gBattleMoves[gCurrentMove].flags & FLAG_KINGSROCK_AFFECTED
|
||||
&& gBattleMoves[gCurrentMove].flags & FLAG_KINGS_ROCK_AFFECTED
|
||||
&& gBattleMons[gBattlerTarget].hp)
|
||||
{
|
||||
gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_FLINCH;
|
||||
@@ -3016,7 +3016,7 @@ void ClearFuryCutterDestinyBondGrudge(u8 battlerId)
|
||||
|
||||
void HandleAction_RunBattleScript(void) // identical to RunBattleScriptCommands
|
||||
{
|
||||
if (!gBattleControllerExecFlags)
|
||||
if (gBattleControllerExecFlags == 0)
|
||||
gBattleScriptingCommandsTable[*gBattlescriptCurrInstr]();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user