diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 7a65573e6..951558234 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1901,7 +1901,7 @@ BattleScript_EffectStomp:: BattleScript_EffectSolarbeam:: jumpifabilitypresent ABILITY_CLOUD_NINE, BattleScript_SolarbeamDecideTurn jumpifabilitypresent ABILITY_AIR_LOCK, BattleScript_SolarbeamDecideTurn - jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_ANY, BattleScript_SolarbeamOnFirstTurn + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_SUN, BattleScript_SolarbeamOnFirstTurn BattleScript_SolarbeamDecideTurn:: jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn diff --git a/include/constants/battle.h b/include/constants/battle.h index a848146eb..f1ce757e7 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -210,19 +210,19 @@ #define MOVE_RESULT_NO_EFFECT (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE | MOVE_RESULT_FAILED) // Battle Weather flags -#define WEATHER_RAIN_TEMPORARY (1 << 0) -#define WEATHER_RAIN_DOWNPOUR (1 << 1) // unused -#define WEATHER_RAIN_PERMANENT (1 << 2) -#define WEATHER_RAIN_ANY (WEATHER_RAIN_TEMPORARY | WEATHER_RAIN_DOWNPOUR | WEATHER_RAIN_PERMANENT) -#define WEATHER_SANDSTORM_TEMPORARY (1 << 3) -#define WEATHER_SANDSTORM_PERMANENT (1 << 4) -#define WEATHER_SANDSTORM_ANY (WEATHER_SANDSTORM_TEMPORARY | WEATHER_SANDSTORM_PERMANENT) -#define WEATHER_SUN_TEMPORARY (1 << 5) -#define WEATHER_SUN_PERMANENT (1 << 6) -#define WEATHER_SUN_ANY (WEATHER_SUN_TEMPORARY | WEATHER_SUN_PERMANENT) -#define WEATHER_HAIL (1 << 7) -#define WEATHER_HAIL_ANY (WEATHER_HAIL) -#define WEATHER_ANY (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_SUN_ANY | WEATHER_HAIL_ANY) +#define B_WEATHER_RAIN_TEMPORARY (1 << 0) +#define B_WEATHER_RAIN_DOWNPOUR (1 << 1) // unused +#define B_WEATHER_RAIN_PERMANENT (1 << 2) +#define B_WEATHER_RAIN (B_WEATHER_RAIN_TEMPORARY | B_WEATHER_RAIN_DOWNPOUR | B_WEATHER_RAIN_PERMANENT) +#define B_WEATHER_SANDSTORM_TEMPORARY (1 << 3) +#define B_WEATHER_SANDSTORM_PERMANENT (1 << 4) +#define B_WEATHER_SANDSTORM (B_WEATHER_SANDSTORM_TEMPORARY | B_WEATHER_SANDSTORM_PERMANENT) +#define B_WEATHER_SUN_TEMPORARY (1 << 5) +#define B_WEATHER_SUN_PERMANENT (1 << 6) +#define B_WEATHER_SUN (B_WEATHER_SUN_TEMPORARY | B_WEATHER_SUN_PERMANENT) +#define B_WEATHER_HAIL_TEMPORARY (1 << 7) +#define B_WEATHER_HAIL (B_WEATHER_HAIL_TEMPORARY) +#define B_WEATHER_ANY (B_WEATHER_RAIN | B_WEATHER_SANDSTORM | B_WEATHER_SUN | B_WEATHER_HAIL) // Move Effects #define MOVE_EFFECT_SLEEP 1 diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index bb615e497..b1b62fd5b 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -1632,13 +1632,13 @@ static void Cmd_if_status_not_in_party(void) static void Cmd_get_weather(void) { - if (gBattleWeather & WEATHER_RAIN_ANY) + if (gBattleWeather & B_WEATHER_RAIN) AI_THINKING_STRUCT->funcResult = AI_WEATHER_RAIN; - if (gBattleWeather & WEATHER_SANDSTORM_ANY) + if (gBattleWeather & B_WEATHER_SANDSTORM) AI_THINKING_STRUCT->funcResult = AI_WEATHER_SANDSTORM; - if (gBattleWeather & WEATHER_SUN_ANY) + if (gBattleWeather & B_WEATHER_SUN) AI_THINKING_STRUCT->funcResult = AI_WEATHER_SUN; - if (gBattleWeather & WEATHER_HAIL_ANY) + if (gBattleWeather & B_WEATHER_HAIL) AI_THINKING_STRUCT->funcResult = AI_WEATHER_HAIL; gAIScriptPtr += 1; diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index f5c2c7ee6..c827aaaa6 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -5421,13 +5421,13 @@ static void AnimRecycle_Step(struct Sprite *sprite) void AnimTask_GetWeather(u8 taskId) { gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_NONE; - if (gWeatherMoveAnim & WEATHER_SUN_ANY) + if (gWeatherMoveAnim & B_WEATHER_SUN) gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_SUN; - else if (gWeatherMoveAnim & WEATHER_RAIN_ANY) + else if (gWeatherMoveAnim & B_WEATHER_RAIN) gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_RAIN; - else if (gWeatherMoveAnim & WEATHER_SANDSTORM_ANY) + else if (gWeatherMoveAnim & B_WEATHER_SANDSTORM) gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_SANDSTORM; - else if (gWeatherMoveAnim & WEATHER_HAIL_ANY) + else if (gWeatherMoveAnim & B_WEATHER_HAIL) gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_HAIL; DestroyAnimVisualTask(taskId); diff --git a/src/battle_main.c b/src/battle_main.c index f4e1c4d3d..9fda5acbc 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4525,14 +4525,14 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves) if (WEATHER_HAS_EFFECT) { - if ((gBattleMons[battler1].ability == ABILITY_SWIFT_SWIM && gBattleWeather & WEATHER_RAIN_ANY) - || (gBattleMons[battler1].ability == ABILITY_CHLOROPHYLL && gBattleWeather & WEATHER_SUN_ANY)) + if ((gBattleMons[battler1].ability == ABILITY_SWIFT_SWIM && gBattleWeather & B_WEATHER_RAIN) + || (gBattleMons[battler1].ability == ABILITY_CHLOROPHYLL && gBattleWeather & B_WEATHER_SUN)) speedMultiplierBattler1 = 2; else speedMultiplierBattler1 = 1; - if ((gBattleMons[battler2].ability == ABILITY_SWIFT_SWIM && gBattleWeather & WEATHER_RAIN_ANY) - || (gBattleMons[battler2].ability == ABILITY_CHLOROPHYLL && gBattleWeather & WEATHER_SUN_ANY)) + if ((gBattleMons[battler2].ability == ABILITY_SWIFT_SWIM && gBattleWeather & B_WEATHER_RAIN) + || (gBattleMons[battler2].ability == ABILITY_CHLOROPHYLL && gBattleWeather & B_WEATHER_SUN)) speedMultiplierBattler2 = 2; else speedMultiplierBattler2 = 1; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index e33e31796..e7520b1ee 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1079,7 +1079,7 @@ static bool8 AccuracyCalcHelper(u16 move) gHitMarker &= ~HITMARKER_IGNORE_UNDERWATER; - if ((WEATHER_HAS_EFFECT && (gBattleWeather & WEATHER_RAIN_ANY) && gBattleMoves[move].effect == EFFECT_THUNDER) + if ((WEATHER_HAS_EFFECT && (gBattleWeather & B_WEATHER_RAIN) && gBattleMoves[move].effect == EFFECT_THUNDER) || (gBattleMoves[move].effect == EFFECT_ALWAYS_HIT || gBattleMoves[move].effect == EFFECT_VITAL_THROW)) { JumpIfMoveFailed(7, move); @@ -1136,7 +1136,7 @@ static void Cmd_accuracycheck(void) moveAcc = gBattleMoves[move].accuracy; // check Thunder on sunny weather - if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY && gBattleMoves[move].effect == EFFECT_THUNDER) + if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_SUN && gBattleMoves[move].effect == EFFECT_THUNDER) moveAcc = 50; calc = sAccuracyStageRatios[buff].dividend * moveAcc; @@ -1144,7 +1144,7 @@ static void Cmd_accuracycheck(void) if (gBattleMons[gBattlerAttacker].ability == ABILITY_COMPOUND_EYES) calc = (calc * 130) / 100; // 1.3 compound eyes boost - if (WEATHER_HAS_EFFECT && gBattleMons[gBattlerTarget].ability == ABILITY_SAND_VEIL && gBattleWeather & WEATHER_SANDSTORM_ANY) + if (WEATHER_HAS_EFFECT && gBattleMons[gBattlerTarget].ability == ABILITY_SAND_VEIL && gBattleWeather & B_WEATHER_SANDSTORM) calc = (calc * 80) / 100; // 1.2 sand veil loss if (gBattleMons[gBattlerAttacker].ability == ABILITY_HUSTLE && IS_TYPE_PHYSICAL(type)) calc = (calc * 80) / 100; // 1.2 hustle loss @@ -2342,7 +2342,7 @@ void SetMoveEffect(bool8 primary, u8 certain) statusChanged = TRUE; break; case STATUS1_FREEZE: - if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) + if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_SUN) noSunCanFreeze = FALSE; if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_ICE)) break; @@ -6617,14 +6617,14 @@ static void Cmd_trymirrormove(void) static void Cmd_setrain(void) { - if (gBattleWeather & WEATHER_RAIN_ANY) + if (gBattleWeather & B_WEATHER_RAIN) { gMoveResultFlags |= MOVE_RESULT_MISSED; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED; } else { - gBattleWeather = WEATHER_RAIN_TEMPORARY; + gBattleWeather = B_WEATHER_RAIN_TEMPORARY; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_RAIN; gWishFutureKnock.weatherDuration = 5; } @@ -7481,14 +7481,14 @@ static void Cmd_damagetohalftargethp(void) // super fang static void Cmd_setsandstorm(void) { - if (gBattleWeather & WEATHER_SANDSTORM_ANY) + if (gBattleWeather & B_WEATHER_SANDSTORM) { gMoveResultFlags |= MOVE_RESULT_MISSED; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED; } else { - gBattleWeather = WEATHER_SANDSTORM_TEMPORARY; + gBattleWeather = B_WEATHER_SANDSTORM_TEMPORARY; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_SANDSTORM; gWishFutureKnock.weatherDuration = 5; } @@ -7499,7 +7499,7 @@ static void Cmd_weatherdamage(void) { if (WEATHER_HAS_EFFECT) { - if (gBattleWeather & WEATHER_SANDSTORM_ANY) + if (gBattleWeather & B_WEATHER_SANDSTORM) { if (gBattleMons[gBattlerAttacker].type1 != TYPE_ROCK && gBattleMons[gBattlerAttacker].type1 != TYPE_STEEL @@ -7520,7 +7520,7 @@ static void Cmd_weatherdamage(void) gBattleMoveDamage = 0; } } - if (gBattleWeather & WEATHER_HAIL_ANY) + if (gBattleWeather & B_WEATHER_HAIL) { if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE) && !(gStatuses3[gBattlerAttacker] & STATUS3_UNDERGROUND) @@ -8104,7 +8104,7 @@ static u8 AttacksThisTurn(u8 battlerId, u16 move) // Note: returns 1 if it's a c { // first argument is unused if (gBattleMoves[move].effect == EFFECT_SOLARBEAM - && (gBattleWeather & WEATHER_SUN_ANY)) + && (gBattleWeather & B_WEATHER_SUN)) return 2; if (gBattleMoves[move].effect == EFFECT_SKULL_BASH @@ -8638,14 +8638,14 @@ static void Cmd_jumpifnopursuitswitchdmg(void) static void Cmd_setsunny(void) { - if (gBattleWeather & WEATHER_SUN_ANY) + if (gBattleWeather & B_WEATHER_SUN) { gMoveResultFlags |= MOVE_RESULT_MISSED; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED; } else { - gBattleWeather = WEATHER_SUN_TEMPORARY; + gBattleWeather = B_WEATHER_SUN_TEMPORARY; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_SUNLIGHT; gWishFutureKnock.weatherDuration = 5; } @@ -8739,7 +8739,7 @@ static void Cmd_recoverbasedonsunlight(void) { if (gBattleWeather == 0 || !WEATHER_HAS_EFFECT) gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; - else if (gBattleWeather & WEATHER_SUN_ANY) + else if (gBattleWeather & B_WEATHER_SUN) gBattleMoveDamage = 20 * gBattleMons[gBattlerAttacker].maxHP / 30; else // not sunny weather gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; @@ -8920,14 +8920,14 @@ static void Cmd_setminimize(void) static void Cmd_sethail(void) { - if (gBattleWeather & WEATHER_HAIL_ANY) + if (gBattleWeather & B_WEATHER_HAIL) { gMoveResultFlags |= MOVE_RESULT_MISSED; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED; } else { - gBattleWeather = WEATHER_HAIL; + gBattleWeather = B_WEATHER_HAIL_TEMPORARY; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_HAIL; gWishFutureKnock.weatherDuration = 5; } @@ -9640,15 +9640,15 @@ static void Cmd_setweatherballtype(void) { if (WEATHER_HAS_EFFECT) { - if (gBattleWeather & WEATHER_ANY) + if (gBattleWeather & B_WEATHER_ANY) gBattleScripting.dmgMultiplier = 2; - if (gBattleWeather & WEATHER_RAIN_ANY) + if (gBattleWeather & B_WEATHER_RAIN) *(&gBattleStruct->dynamicMoveType) = TYPE_WATER | 0x80; - else if (gBattleWeather & WEATHER_SANDSTORM_ANY) + else if (gBattleWeather & B_WEATHER_SANDSTORM) *(&gBattleStruct->dynamicMoveType) = TYPE_ROCK | 0x80; - else if (gBattleWeather & WEATHER_SUN_ANY) + else if (gBattleWeather & B_WEATHER_SUN) *(&gBattleStruct->dynamicMoveType) = TYPE_FIRE | 0x80; - else if (gBattleWeather & WEATHER_HAIL_ANY) + else if (gBattleWeather & B_WEATHER_HAIL) *(&gBattleStruct->dynamicMoveType) = TYPE_ICE | 0x80; else *(&gBattleStruct->dynamicMoveType) = TYPE_NORMAL | 0x80; diff --git a/src/battle_tv.c b/src/battle_tv.c index 2c6c1b0a3..ffdadb697 100644 --- a/src/battle_tv.c +++ b/src/battle_tv.c @@ -1593,12 +1593,12 @@ u8 GetBattlerMoveSlotId(u8 battlerId, u16 moveId) static void AddPointsBasedOnWeather(u16 weatherFlags, u16 moveId, u8 moveSlot) { - if (weatherFlags & WEATHER_RAIN_ANY) + if (weatherFlags & B_WEATHER_RAIN) AddMovePoints(PTS_RAIN, moveId, moveSlot, 0); - else if (weatherFlags & WEATHER_SUN_ANY) + else if (weatherFlags & B_WEATHER_SUN) AddMovePoints(PTS_SUN, moveId, moveSlot, 0); - else if (weatherFlags & WEATHER_SANDSTORM_ANY) + else if (weatherFlags & B_WEATHER_SANDSTORM) AddMovePoints(PTS_SANDSTORM, moveId, moveSlot, 0); - else if (weatherFlags & WEATHER_HAIL_ANY) + else if (weatherFlags & B_WEATHER_HAIL) AddMovePoints(PTS_HAIL, moveId, moveSlot, 0); } diff --git a/src/battle_util.c b/src/battle_util.c index fa85151b3..8617134dc 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -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 diff --git a/src/pokemon.c b/src/pokemon.c index 9e1e84aee..aca68d53c 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -3268,7 +3268,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de // are effects of weather negated with cloud nine or air lock if (WEATHER_HAS_EFFECT2) { - if (gBattleWeather & WEATHER_RAIN_TEMPORARY) + if (gBattleWeather & B_WEATHER_RAIN_TEMPORARY) { switch (type) { @@ -3282,11 +3282,11 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de } // any weather except sun weakens solar beam - if ((gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_HAIL_ANY)) && gCurrentMove == MOVE_SOLAR_BEAM) + if ((gBattleWeather & (B_WEATHER_RAIN | B_WEATHER_SANDSTORM | B_WEATHER_HAIL)) && gCurrentMove == MOVE_SOLAR_BEAM) damage /= 2; // sunny - if (gBattleWeather & WEATHER_SUN_ANY) + if (gBattleWeather & B_WEATHER_SUN) { switch (type) {