Skip to content

Commit

Permalink
primal weather fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexOn1ine committed Dec 19, 2024
1 parent 99fef02 commit eb4427d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions include/constants/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,14 @@

// Battle Weather flags
#define B_WEATHER_NONE 0
#define B_WEATHER_RAIN (1 << 0)
#define B_WEATHER_RAIN_NORMAL (1 << 0)
#define B_WEATHER_RAIN_PRIMAL (1 << 1)
#define B_WEATHER_RAIN_DOWNPOUR (1 << 2) // unused
#define B_WEATHER_RAIN (B_WEATHER_RAIN_NORMAL | B_WEATHER_RAIN_PRIMAL | B_WEATHER_RAIN_DOWNPOUR)
#define B_WEATHER_SANDSTORM (1 << 3)
#define B_WEATHER_SUN (1 << 4)
#define B_WEATHER_SUN_NORMAL (1 << 4)
#define B_WEATHER_SUN_PRIMAL (1 << 5)
#define B_WEATHER_SUN (B_WEATHER_SUN_NORMAL | B_WEATHER_SUN_PRIMAL)
#define B_WEATHER_HAIL (1 << 6)
#define B_WEATHER_SNOW (1 << 7)
#define B_WEATHER_FOG (1 << 8)
Expand Down
8 changes: 4 additions & 4 deletions src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -3886,9 +3886,9 @@ bool32 HasNoMonsToSwitch(u32 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2

static const u16 sWeatherFlagsInfo[][2] =
{
[BATTLE_WEATHER_RAIN] = {B_WEATHER_RAIN, HOLD_EFFECT_DAMP_ROCK},
[BATTLE_WEATHER_RAIN] = {B_WEATHER_RAIN_NORMAL, HOLD_EFFECT_DAMP_ROCK},
[BATTLE_WEATHER_RAIN_PRIMAL] = {B_WEATHER_RAIN_PRIMAL, HOLD_EFFECT_DAMP_ROCK},
[BATTLE_WEATHER_SUN] = {B_WEATHER_SUN, HOLD_EFFECT_HEAT_ROCK},
[BATTLE_WEATHER_SUN] = {B_WEATHER_SUN_NORMAL, HOLD_EFFECT_HEAT_ROCK},
[BATTLE_WEATHER_SUN_PRIMAL] = {B_WEATHER_SUN_PRIMAL, HOLD_EFFECT_HEAT_ROCK},
[BATTLE_WEATHER_SANDSTORM] = {B_WEATHER_SANDSTORM, HOLD_EFFECT_SMOOTH_ROCK},
[BATTLE_WEATHER_HAIL] = {B_WEATHER_HAIL, HOLD_EFFECT_ICY_ROCK},
Expand Down Expand Up @@ -4398,7 +4398,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
case WEATHER_DOWNPOUR:
if (!(gBattleWeather & B_WEATHER_RAIN))
{
gBattleWeather = B_WEATHER_RAIN;
gBattleWeather = B_WEATHER_RAIN_NORMAL;
gBattleScripting.animArg1 = B_ANIM_RAIN_CONTINUES;
effect++;
}
Expand All @@ -4414,7 +4414,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
case WEATHER_DROUGHT:
if (!(gBattleWeather & B_WEATHER_SUN))
{
gBattleWeather = B_WEATHER_SUN;
gBattleWeather = B_WEATHER_SUN_NORMAL;
gBattleScripting.animArg1 = B_ANIM_SUN_CONTINUES;
effect++;
}
Expand Down

0 comments on commit eb4427d

Please sign in to comment.