mirror of
https://github.com/pret/pokeruby.git
synced 2026-04-26 08:17:48 -05:00
Weather
This commit is contained in:
parent
5f5a0a1b05
commit
227fc9a7cc
|
|
@ -195,19 +195,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 0x1
|
||||
|
|
|
|||
|
|
@ -1331,13 +1331,13 @@ static void BattleAICmd_if_status_not_in_party(void)
|
|||
|
||||
static void BattleAICmd_get_weather(void)
|
||||
{
|
||||
if (gBattleWeather & WEATHER_RAIN_ANY)
|
||||
if (gBattleWeather & B_WEATHER_RAIN)
|
||||
AI_THINKING_STRUCT->funcResult = WEATHER_TYPE_RAIN;
|
||||
if (gBattleWeather & WEATHER_SANDSTORM_ANY)
|
||||
if (gBattleWeather & B_WEATHER_SANDSTORM)
|
||||
AI_THINKING_STRUCT->funcResult = WEATHER_TYPE_SANDSTORM;
|
||||
if (gBattleWeather & WEATHER_SUN_ANY)
|
||||
if (gBattleWeather & B_WEATHER_SUN)
|
||||
AI_THINKING_STRUCT->funcResult = WEATHER_TYPE_SUN;
|
||||
if (gBattleWeather & WEATHER_HAIL)
|
||||
if (gBattleWeather & B_WEATHER_HAIL_TEMPORARY)
|
||||
AI_THINKING_STRUCT->funcResult = WEATHER_TYPE_HAIL;
|
||||
|
||||
gAIScriptPtr += 1;
|
||||
|
|
|
|||
|
|
@ -6007,13 +6007,13 @@ static void AnimRecycleStep(struct Sprite *sprite)
|
|||
void AnimTask_GetWeather(u8 taskId)
|
||||
{
|
||||
gBattleAnimArgs[7] = ANIM_WEATHER_NONE;
|
||||
if (gWeatherMoveAnim & WEATHER_SUN_ANY)
|
||||
if (gWeatherMoveAnim & B_WEATHER_SUN)
|
||||
gBattleAnimArgs[7] = ANIM_WEATHER_SUN;
|
||||
else if (gWeatherMoveAnim & WEATHER_RAIN_ANY)
|
||||
else if (gWeatherMoveAnim & B_WEATHER_RAIN)
|
||||
gBattleAnimArgs[7] = ANIM_WEATHER_RAIN;
|
||||
else if (gWeatherMoveAnim & WEATHER_SANDSTORM_ANY)
|
||||
else if (gWeatherMoveAnim & B_WEATHER_SANDSTORM)
|
||||
gBattleAnimArgs[7] = ANIM_WEATHER_SANDSTORM;
|
||||
else if (gWeatherMoveAnim & WEATHER_HAIL_ANY)
|
||||
else if (gWeatherMoveAnim & B_WEATHER_HAIL)
|
||||
gBattleAnimArgs[7] = ANIM_WEATHER_HAIL;
|
||||
|
||||
DestroyAnimVisualTask(taskId);
|
||||
|
|
|
|||
|
|
@ -4594,14 +4594,14 @@ u8 GetWhoStrikesFirst(u8 bank1, u8 bank2, bool8 ignoreMovePriorities)
|
|||
// Check for abilities that boost speed in weather.
|
||||
if (WEATHER_HAS_EFFECT)
|
||||
{
|
||||
if ((gBattleMons[bank1].ability == ABILITY_SWIFT_SWIM && (gBattleWeather & WEATHER_RAIN_ANY))
|
||||
|| (gBattleMons[bank1].ability == ABILITY_CHLOROPHYLL && (gBattleWeather & WEATHER_SUN_ANY)))
|
||||
if ((gBattleMons[bank1].ability == ABILITY_SWIFT_SWIM && (gBattleWeather & B_WEATHER_RAIN))
|
||||
|| (gBattleMons[bank1].ability == ABILITY_CHLOROPHYLL && (gBattleWeather & B_WEATHER_SUN)))
|
||||
bank1SpeedMultiplier = 2;
|
||||
else
|
||||
bank1SpeedMultiplier = 1;
|
||||
|
||||
if ((gBattleMons[bank2].ability == ABILITY_SWIFT_SWIM && (gBattleWeather & WEATHER_RAIN_ANY))
|
||||
|| (gBattleMons[bank2].ability == ABILITY_CHLOROPHYLL && (gBattleWeather & WEATHER_SUN_ANY)))
|
||||
if ((gBattleMons[bank2].ability == ABILITY_SWIFT_SWIM && (gBattleWeather & B_WEATHER_RAIN))
|
||||
|| (gBattleMons[bank2].ability == ABILITY_CHLOROPHYLL && (gBattleWeather & B_WEATHER_SUN)))
|
||||
bank2SpeedMultiplier = 2;
|
||||
else
|
||||
bank2SpeedMultiplier = 1;
|
||||
|
|
|
|||
|
|
@ -1209,7 +1209,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);
|
||||
|
|
@ -1266,7 +1266,7 @@ static void atk01_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 = gAccuracyStageRatios[buff].dividend * moveAcc;
|
||||
|
|
@ -1274,7 +1274,7 @@ static void atk01_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 && type < 9)
|
||||
calc = (calc * 80) / 100; // 1.2 hustle loss;
|
||||
|
|
@ -2459,7 +2459,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;
|
||||
|
|
@ -6253,14 +6253,14 @@ static void atk7C_trymirrormove(void)
|
|||
|
||||
static void atk7D_setrain(void)
|
||||
{
|
||||
if (gBattleWeather & WEATHER_RAIN_ANY)
|
||||
if (gBattleWeather & B_WEATHER_RAIN)
|
||||
{
|
||||
gMoveResultFlags |= MOVE_RESULT_MISSED;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleWeather = WEATHER_RAIN_TEMPORARY;
|
||||
gBattleWeather = B_WEATHER_RAIN_TEMPORARY;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
|
||||
gWishFutureKnock.weatherDuration = 5;
|
||||
}
|
||||
|
|
@ -7338,14 +7338,14 @@ static void atk94_damagetohalftargethp(void) //super fang
|
|||
|
||||
static void atk95_setsandstorm(void)
|
||||
{
|
||||
if (gBattleWeather & WEATHER_SANDSTORM_ANY)
|
||||
if (gBattleWeather & B_WEATHER_SANDSTORM)
|
||||
{
|
||||
gMoveResultFlags |= MOVE_RESULT_MISSED;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleWeather = WEATHER_SANDSTORM_TEMPORARY;
|
||||
gBattleWeather = B_WEATHER_SANDSTORM_TEMPORARY;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 3;
|
||||
gWishFutureKnock.weatherDuration = 5;
|
||||
}
|
||||
|
|
@ -7356,7 +7356,7 @@ static void atk96_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 && gBattleMons[gBattlerAttacker].type1 != TYPE_GROUND
|
||||
&& gBattleMons[gBattlerAttacker].type2 != TYPE_ROCK && gBattleMons[gBattlerAttacker].type2 != TYPE_STEEL && gBattleMons[gBattlerAttacker].type2 != TYPE_GROUND
|
||||
|
|
@ -7371,7 +7371,7 @@ static void atk96_weatherdamage(void)
|
|||
gBattleMoveDamage = 0;
|
||||
}
|
||||
}
|
||||
if (gBattleWeather & WEATHER_HAIL)
|
||||
if (gBattleWeather & B_WEATHER_HAIL_TEMPORARY)
|
||||
{
|
||||
if (gBattleMons[gBattlerAttacker].type1 != TYPE_ICE && gBattleMons[gBattlerAttacker].type2 != TYPE_ICE && !(gStatuses3[gBattlerAttacker] & STATUS3_UNDERGROUND) && !(gStatuses3[gBattlerAttacker] & STATUS3_UNDERWATER))
|
||||
{
|
||||
|
|
@ -7950,7 +7950,7 @@ static u8 AttacksThisTurn(u8 bank, u16 move) //Note: returns 1 if it's a chargin
|
|||
{
|
||||
//first argument is unused
|
||||
u8 effect;
|
||||
if (gBattleMoves[move].effect == EFFECT_SOLARBEAM && (gBattleWeather & WEATHER_SUN_ANY))
|
||||
if (gBattleMoves[move].effect == EFFECT_SOLARBEAM && (gBattleWeather & B_WEATHER_SUN))
|
||||
return 2;
|
||||
effect = gBattleMoves[move].effect;
|
||||
if (effect == EFFECT_SKULL_BASH || effect == EFFECT_RAZOR_WIND || effect == EFFECT_SKY_ATTACK || effect == EFFECT_SOLARBEAM || effect == EFFECT_FLY || effect == EFFECT_BIDE)
|
||||
|
|
@ -8414,14 +8414,14 @@ static void atkBA_jumpifnopursuitswitchdmg(void)
|
|||
|
||||
static void atkBB_setsunny(void)
|
||||
{
|
||||
if (gBattleWeather & WEATHER_SUN_ANY)
|
||||
if (gBattleWeather & B_WEATHER_SUN)
|
||||
{
|
||||
gMoveResultFlags |= MOVE_RESULT_MISSED;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleWeather = WEATHER_SUN_TEMPORARY;
|
||||
gBattleWeather = B_WEATHER_SUN_TEMPORARY;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 4;
|
||||
gWishFutureKnock.weatherDuration = 5;
|
||||
}
|
||||
|
|
@ -8503,7 +8503,7 @@ static void atkC0_recoverbasedonsunlight(void)
|
|||
{
|
||||
if (!gBattleWeather || !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;
|
||||
|
|
@ -8677,14 +8677,14 @@ static void atkC7_setminimize(void)
|
|||
|
||||
static void atkC8_sethail(void)
|
||||
{
|
||||
if (gBattleWeather & WEATHER_HAIL)
|
||||
if (gBattleWeather & B_WEATHER_HAIL_TEMPORARY)
|
||||
{
|
||||
gMoveResultFlags |= MOVE_RESULT_MISSED;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleWeather = WEATHER_HAIL;
|
||||
gBattleWeather = B_WEATHER_HAIL_TEMPORARY;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 5;
|
||||
gWishFutureKnock.weatherDuration = 5;
|
||||
}
|
||||
|
|
@ -9280,13 +9280,13 @@ static void atkE9_setweatherballtype(void)
|
|||
{
|
||||
if ((u8)(gBattleWeather))
|
||||
gBattleStruct->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)
|
||||
else if (gBattleWeather & B_WEATHER_HAIL_TEMPORARY)
|
||||
gBattleStruct->dynamicMoveType = TYPE_ICE | 0x80;
|
||||
else
|
||||
gBattleStruct->dynamicMoveType = TYPE_NORMAL | 0x80;
|
||||
|
|
|
|||
|
|
@ -769,22 +769,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] = 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;
|
||||
}
|
||||
|
|
@ -799,11 +799,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
|
||||
|
|
@ -819,11 +819,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
|
||||
|
|
@ -837,11 +837,11 @@ u8 DoFieldEndTurnEffects(void)
|
|||
gBattleStruct->turnCountersTracker++;
|
||||
break;
|
||||
case ENDTURN_HAIL:
|
||||
if (gBattleWeather & WEATHER_HAIL)
|
||||
if (gBattleWeather & B_WEATHER_HAIL_TEMPORARY)
|
||||
{
|
||||
if (--gWishFutureKnock.weatherDuration == 0)
|
||||
{
|
||||
gBattleWeather &= ~WEATHER_HAIL;
|
||||
gBattleWeather &= ~B_WEATHER_HAIL_TEMPORARY;
|
||||
gBattlescriptCurrInstr = BattleScript_SandStormHailEnds;
|
||||
}
|
||||
else
|
||||
|
|
@ -1704,25 +1704,25 @@ u8 CastformDataTypeChange(u8 bank)
|
|||
}
|
||||
if (!WEATHER_HAS_EFFECT)
|
||||
return CASTFORM_NO_CHANGE;
|
||||
if (!(gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SUN_ANY | WEATHER_HAIL)) && gBattleMons[bank].type1 != TYPE_NORMAL && gBattleMons[bank].type2 != TYPE_NORMAL)
|
||||
if (!(gBattleWeather & (B_WEATHER_RAIN | B_WEATHER_SUN | B_WEATHER_HAIL_TEMPORARY)) && gBattleMons[bank].type1 != TYPE_NORMAL && gBattleMons[bank].type2 != TYPE_NORMAL)
|
||||
{
|
||||
gBattleMons[bank].type1 = TYPE_NORMAL;
|
||||
gBattleMons[bank].type2 = TYPE_NORMAL;
|
||||
formChange = CASTFORM_TO_NORMAL;
|
||||
}
|
||||
if (gBattleWeather & WEATHER_SUN_ANY && gBattleMons[bank].type1 != TYPE_FIRE && gBattleMons[bank].type2 != TYPE_FIRE)
|
||||
if (gBattleWeather & B_WEATHER_SUN && gBattleMons[bank].type1 != TYPE_FIRE && gBattleMons[bank].type2 != TYPE_FIRE)
|
||||
{
|
||||
gBattleMons[bank].type1 = TYPE_FIRE;
|
||||
gBattleMons[bank].type2 = TYPE_FIRE;
|
||||
formChange = CASTFORM_TO_FIRE;
|
||||
}
|
||||
if (gBattleWeather & WEATHER_RAIN_ANY && gBattleMons[bank].type1 != TYPE_WATER && gBattleMons[bank].type2 != TYPE_WATER)
|
||||
if (gBattleWeather & B_WEATHER_RAIN && gBattleMons[bank].type1 != TYPE_WATER && gBattleMons[bank].type2 != TYPE_WATER)
|
||||
{
|
||||
gBattleMons[bank].type1 = TYPE_WATER;
|
||||
gBattleMons[bank].type2 = TYPE_WATER;
|
||||
formChange = CASTFORM_TO_WATER;
|
||||
}
|
||||
if (gBattleWeather & WEATHER_HAIL && gBattleMons[bank].type1 != TYPE_ICE && gBattleMons[bank].type2 != TYPE_ICE)
|
||||
if (gBattleWeather & B_WEATHER_HAIL_TEMPORARY && gBattleMons[bank].type1 != TYPE_ICE && gBattleMons[bank].type2 != TYPE_ICE)
|
||||
{
|
||||
gBattleMons[bank].type1 = TYPE_ICE;
|
||||
gBattleMons[bank].type2 = TYPE_ICE;
|
||||
|
|
@ -1797,27 +1797,27 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
|
|||
case WEATHER_RAIN_LIGHT:
|
||||
case WEATHER_RAIN_MED:
|
||||
case WEATHER_RAIN_HEAVY:
|
||||
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);
|
||||
gBattleStruct->animArg1 = B_ANIM_RAIN_CONTINUES;
|
||||
gBattleStruct->scriptingActive = bank;
|
||||
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);
|
||||
gBattleStruct->animArg1 = B_ANIM_SANDSTORM_CONTINUES;
|
||||
gBattleStruct->scriptingActive = bank;
|
||||
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);
|
||||
gBattleStruct->animArg1 = B_ANIM_SUN_CONTINUES;
|
||||
gBattleStruct->scriptingActive = bank;
|
||||
effect++;
|
||||
|
|
@ -1831,27 +1831,27 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
|
|||
}
|
||||
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);
|
||||
gBattleStruct->scriptingActive = bank;
|
||||
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);
|
||||
gBattleStruct->scriptingActive = bank;
|
||||
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);
|
||||
gBattleStruct->scriptingActive = bank;
|
||||
effect++;
|
||||
|
|
@ -1906,7 +1906,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
|
|||
switch (gLastUsedAbility)
|
||||
{
|
||||
case ABILITY_RAIN_DISH:
|
||||
if (WEATHER_HAS_EFFECT && (gBattleWeather & WEATHER_RAIN_ANY)
|
||||
if (WEATHER_HAS_EFFECT && (gBattleWeather & B_WEATHER_RAIN)
|
||||
&& gBattleMons[bank].maxHP > gBattleMons[bank].hp)
|
||||
{
|
||||
gLastUsedAbility = ABILITY_RAIN_DISH; // why
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
|
|||
if (!AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, ABILITY_CLOUD_NINE, 0, 0)
|
||||
&& !AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, ABILITY_AIR_LOCK, 0, 0))
|
||||
{
|
||||
if (gBattleWeather & WEATHER_RAIN_TEMPORARY)
|
||||
if (gBattleWeather & B_WEATHER_RAIN_TEMPORARY)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
|
|
@ -311,11 +311,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)) && gCurrentMove == MOVE_SOLAR_BEAM)
|
||||
if ((gBattleWeather & (B_WEATHER_RAIN | B_WEATHER_SANDSTORM | B_WEATHER_HAIL_TEMPORARY)) && gCurrentMove == MOVE_SOLAR_BEAM)
|
||||
damage /= 2;
|
||||
|
||||
// sunny
|
||||
if (gBattleWeather & WEATHER_SUN_ANY)
|
||||
if (gBattleWeather & B_WEATHER_SUN)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user