mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Implemented Desolate Land, Primordial Sea and Delta Stream
This commit is contained in:
parent
b6d0996467
commit
9e4f33d09e
@ -1769,6 +1769,10 @@
|
||||
various \battler, VARIOUS_TRY_ACTIVATE_GRIM_NEIGH
|
||||
.endm
|
||||
|
||||
.macro trytoclearprimalweather
|
||||
various BS_ATTACKER, VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER
|
||||
.endm
|
||||
|
||||
@ helpful macros
|
||||
.macro setstatchanger stat:req, stages:req, down:req
|
||||
setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7
|
||||
|
@ -3664,6 +3664,9 @@ BattleScript_EffectSandstorm::
|
||||
attackcanceler
|
||||
attackstring
|
||||
ppreduce
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessened
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRain
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOn
|
||||
setsandstorm
|
||||
goto BattleScript_MoveWeatherChange
|
||||
|
||||
@ -3866,6 +3869,9 @@ BattleScript_EffectRainDance::
|
||||
attackcanceler
|
||||
attackstring
|
||||
ppreduce
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessened
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRain
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOn
|
||||
setrain
|
||||
BattleScript_MoveWeatherChange::
|
||||
attackanimation
|
||||
@ -3879,9 +3885,30 @@ BattleScript_EffectSunnyDay::
|
||||
attackcanceler
|
||||
attackstring
|
||||
ppreduce
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessened
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRain
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOn
|
||||
setsunny
|
||||
goto BattleScript_MoveWeatherChange
|
||||
|
||||
BattleScript_ExtremelyHarshSunlightWasNotLessened:
|
||||
pause B_WAIT_TIME_SHORT
|
||||
printstring STRINGID_EXTREMELYHARSHSUNLIGHTWASNOTLESSENED
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_NoReliefFromHeavyRain:
|
||||
pause B_WAIT_TIME_SHORT
|
||||
printstring STRINGID_NORELIEFROMHEAVYRAIN
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_MysteriousAirCurrentBlowsOn:
|
||||
pause B_WAIT_TIME_SHORT
|
||||
printstring STRINGID_MYSTERIOUSAIRCURRENTBLOWSON
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectDefenseUpHit::
|
||||
setmoveeffect MOVE_EFFECT_DEF_PLUS_1 | MOVE_EFFECT_AFFECTS_USER
|
||||
goto BattleScript_EffectHit
|
||||
@ -4239,6 +4266,9 @@ BattleScript_EffectHail::
|
||||
attackcanceler
|
||||
attackstring
|
||||
ppreduce
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessened
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRain
|
||||
jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOn
|
||||
sethail
|
||||
goto BattleScript_MoveWeatherChange
|
||||
|
||||
@ -5240,6 +5270,9 @@ BattleScript_DoSwitchOut::
|
||||
getswitchedmondata BS_ATTACKER
|
||||
switchindataupdate BS_ATTACKER
|
||||
hpthresholds BS_ATTACKER
|
||||
trytoclearprimalweather
|
||||
printstring STRINGID_EMPTYSTRING3
|
||||
waitmessage 1
|
||||
printstring STRINGID_SWITCHINMON
|
||||
hidepartystatussummary BS_ATTACKER
|
||||
switchinanim BS_ATTACKER, FALSE
|
||||
@ -6860,6 +6893,58 @@ BattleScript_DroughtActivates::
|
||||
call BattleScript_WeatherFormChanges
|
||||
end3
|
||||
|
||||
BattleScript_DesolateLandActivates::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
call BattleScript_AbilityPopUp
|
||||
printstring STRINGID_EXTREMELYHARSHSUNLIGHT
|
||||
waitstate
|
||||
playanimation BS_BATTLER_0, B_ANIM_SUN_CONTINUES, NULL
|
||||
call BattleScript_WeatherFormChanges
|
||||
end3
|
||||
|
||||
BattleScript_DesolateLandEvaporatesWaterTypeMoves::
|
||||
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
||||
attackstring
|
||||
pause B_WAIT_TIME_SHORT
|
||||
ppreduce
|
||||
printstring STRINGID_MOVEEVAPORATEDINTHEHARSHSUNLIGHT
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_PrimordialSeaActivates::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
call BattleScript_AbilityPopUp
|
||||
printstring STRINGID_HEAVYRAIN
|
||||
waitstate
|
||||
playanimation BS_BATTLER_0, B_ANIM_SUN_CONTINUES, NULL
|
||||
call BattleScript_WeatherFormChanges
|
||||
end3
|
||||
|
||||
BattleScript_PrimordialSeaFizzlesOutFireTypeMoves::
|
||||
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
||||
attackstring
|
||||
pause B_WAIT_TIME_SHORT
|
||||
ppreduce
|
||||
printstring STRINGID_MOVEFIZZLEDOUTINTHEHEAVYRAIN
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_DeltaStreamActivates::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
call BattleScript_AbilityPopUp
|
||||
printstring STRINGID_MYSTERIOUSAIRCURRENT
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
end3
|
||||
|
||||
BattleScript_AttackWeakenedByStrongWinds::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
call BattleScript_AbilityPopUp
|
||||
printstring STRINGID_ATTACKWEAKENEDBSTRONGWINDS
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
printstring STRINGID_EMPTYSTRING3
|
||||
waitmessage 1
|
||||
goto BattleScript_HitFromAtkAnimation
|
||||
|
||||
BattleScript_SnowWarningActivates::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
call BattleScript_AbilityPopUp
|
||||
|
@ -369,5 +369,12 @@ extern const u8 BattleScript_JabocaRowapBerryActivates[];
|
||||
extern const u8 BattleScript_NotAffectedAbilityPopUp[];
|
||||
extern const u8 BattleScript_BattlerShookOffTaunt[];
|
||||
extern const u8 BattleScript_BattlerGotOverItsInfatuation[];
|
||||
extern const u8 BattleScript_DesolateLandActivates[];
|
||||
extern const u8 BattleScript_DesolateLandEvaporatesWaterTypeMoves[];
|
||||
extern const u8 BattleScript_PrimordialSeaActivates[];
|
||||
extern const u8 BattleScript_PrimordialSeaFizzlesOutFireTypeMoves[];
|
||||
extern const u8 BattleScript_DeltaStreamActivates[];
|
||||
extern const u8 BattleScript_MysteriousAirCurrentBlowsOn[];
|
||||
extern const u8 BattleScript_AttackWeakenedByStrongWinds[];
|
||||
|
||||
#endif // GUARD_BATTLE_SCRIPTS_H
|
||||
|
@ -256,24 +256,31 @@
|
||||
#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_RAIN_PRIMAL (1 << 3)
|
||||
#define WEATHER_RAIN_ANY (WEATHER_RAIN_TEMPORARY | WEATHER_RAIN_DOWNPOUR | WEATHER_RAIN_PERMANENT | WEATHER_RAIN_PRIMAL)
|
||||
#define WEATHER_SANDSTORM_TEMPORARY (1 << 4)
|
||||
#define WEATHER_SANDSTORM_PERMANENT (1 << 5)
|
||||
#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_TEMPORARY (1 << 7)
|
||||
#define WEATHER_HAIL_PERMANENT (1 << 8)
|
||||
#define WEATHER_SUN_TEMPORARY (1 << 6)
|
||||
#define WEATHER_SUN_PERMANENT (1 << 7)
|
||||
#define WEATHER_SUN_PRIMAL (1 << 8)
|
||||
#define WEATHER_SUN_ANY (WEATHER_SUN_TEMPORARY | WEATHER_SUN_PERMANENT | WEATHER_SUN_PRIMAL)
|
||||
#define WEATHER_HAIL_TEMPORARY (1 << 9)
|
||||
#define WEATHER_HAIL_PERMANENT (1 << 10)
|
||||
#define WEATHER_HAIL_ANY (WEATHER_HAIL_TEMPORARY | WEATHER_HAIL_PERMANENT)
|
||||
#define WEATHER_ANY (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_SUN_ANY | WEATHER_HAIL_ANY)
|
||||
#define WEATHER_STRONG_WINDS (1 << 11)
|
||||
#define WEATHER_ANY (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_SUN_ANY | WEATHER_HAIL_ANY | WEATHER_STRONG_WINDS)
|
||||
#define WEATHER_PRIMAL_ANY (WEATHER_RAIN_PRIMAL | WEATHER_SUN_PRIMAL | WEATHER_STRONG_WINDS)
|
||||
|
||||
// Battle Weather as enum
|
||||
#define ENUM_WEATHER_NONE 0
|
||||
#define ENUM_WEATHER_RAIN 1
|
||||
#define ENUM_WEATHER_SUN 2
|
||||
#define ENUM_WEATHER_SANDSTORM 3
|
||||
#define ENUM_WEATHER_HAIL 4
|
||||
#define ENUM_WEATHER_NONE 0
|
||||
#define ENUM_WEATHER_RAIN 1
|
||||
#define ENUM_WEATHER_SUN 2
|
||||
#define ENUM_WEATHER_SANDSTORM 3
|
||||
#define ENUM_WEATHER_HAIL 4
|
||||
#define ENUM_WEATHER_SUN_PRIMAL 5
|
||||
#define ENUM_WEATHER_RAIN_PRIMAL 6
|
||||
#define ENUM_WEATHER_STRONG_WINDS 7
|
||||
|
||||
// Move Effects
|
||||
#define MOVE_EFFECT_SLEEP 0x1
|
||||
|
@ -173,6 +173,7 @@
|
||||
#define VARIOUS_DESTROY_ABILITY_POPUP 102
|
||||
#define VARIOUS_TOTEM_BOOST 103
|
||||
#define VARIOUS_TRY_ACTIVATE_GRIM_NEIGH 104
|
||||
#define VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER 105
|
||||
|
||||
// Cmd_manipulatedamage
|
||||
#define DMG_CHANGE_SIGN 0
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -696,9 +696,33 @@ static const u8 sText_CanActFaster[] = _("{B_ATK_NAME_WITH_PREFIX} can act faste
|
||||
static const u8 sText_MicleBerryActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted the accuracy of its\nnext move using {B_LAST_ITEM}!");
|
||||
static const u8 sText_PkmnShookOffTheTaunt[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} shook off\nthe taunt!");
|
||||
static const u8 sText_PkmnGotOverItsInfatuation[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} got over\nits infatuation!");
|
||||
static const u8 sText_ExtremelyHarshSunlight[] = _("The sunlight turned\nextremely harsh!");
|
||||
static const u8 sText_ExtremeSunlightFaded[] = _("The extreme sunlight faded.{PAUSE 64}");
|
||||
static const u8 sText_MoveEvaporatedInTheHarshSunlight[] = _("The Water-type attack evaporated\nin the harsh sunlight!");
|
||||
static const u8 sText_ExtremelyHarshSunlightWasNotLessened[] = _("The extremely harsh sunlight\nwas not lessened at all!");
|
||||
static const u8 sText_HeavyRain[] = _("A heavy rain began to fall!");
|
||||
static const u8 sText_HeavyRainLifted[] = _("The heavy rain has lifted!{PAUSE 64}");
|
||||
static const u8 sText_MoveFizzledOutInTheHeavyRain[] = _("The Fire-type attack fizzled out\nin the heavy rain!");
|
||||
static const u8 sText_NoReliefFromHeavyRain[] = _("There is no relief from\nthis heavy rain!");
|
||||
static const u8 sText_MysteriousAirCurrent[] = _("A mysterious air current is\nprotecting Flying-type Pokémon!");
|
||||
static const u8 sText_StrongWindsDissipated[] = _("The mysterious strong winds\nhave dissipated!{PAUSE 64}");
|
||||
static const u8 sText_MysteriousAirCurrentBlowsOn[] = _("The mysterious air current\nblows on regardless!");
|
||||
static const u8 sText_AttackWeakenedByStrongWinds[] = _("The mysterious strong winds\nweakened the attack!");
|
||||
|
||||
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
||||
{
|
||||
[STRINGID_ATTACKWEAKENEDBSTRONGWINDS - 12] = sText_AttackWeakenedByStrongWinds,
|
||||
[STRINGID_MYSTERIOUSAIRCURRENTBLOWSON - 12] = sText_MysteriousAirCurrentBlowsOn,
|
||||
[STRINGID_STRONGWINDSDISSIPATED - 12] = sText_StrongWindsDissipated,
|
||||
[STRINGID_MYSTERIOUSAIRCURRENT - 12] = sText_MysteriousAirCurrent,
|
||||
[STRINGID_NORELIEFROMHEAVYRAIN - 12] = sText_NoReliefFromHeavyRain,
|
||||
[STRINGID_MOVEFIZZLEDOUTINTHEHEAVYRAIN - 12] = sText_MoveFizzledOutInTheHeavyRain,
|
||||
[STRINGID_HEAVYRAINLIFTED - 12] = sText_HeavyRainLifted,
|
||||
[STRINGID_HEAVYRAIN - 12] = sText_HeavyRain,
|
||||
[STRINGID_EXTREMELYHARSHSUNLIGHTWASNOTLESSENED - 12] = sText_ExtremelyHarshSunlightWasNotLessened,
|
||||
[STRINGID_MOVEEVAPORATEDINTHEHARSHSUNLIGHT - 12] = sText_MoveEvaporatedInTheHarshSunlight,
|
||||
[STRINGID_EXTREMESUNLIGHTFADED - 12] = sText_ExtremeSunlightFaded,
|
||||
[STRINGID_EXTREMELYHARSHSUNLIGHT - 12] = sText_ExtremelyHarshSunlight,
|
||||
[STRINGID_PKMNGOTOVERITSINFATUATION - 12] = sText_PkmnGotOverItsInfatuation,
|
||||
[STRINGID_PKMNSHOOKOFFTHETAUNT - 12] = sText_PkmnShookOffTheTaunt,
|
||||
[STRINGID_MICLEBERRYACTIVATES - 12] = sText_MicleBerryActivates,
|
||||
|
@ -1323,6 +1323,30 @@ static void Cmd_attackcanceler(void)
|
||||
{
|
||||
s32 i, moveType;
|
||||
|
||||
GET_MOVE_TYPE(gCurrentMove, moveType);
|
||||
if (moveType == TYPE_FIRE
|
||||
&& (gBattleWeather & WEATHER_RAIN_PRIMAL)
|
||||
&& !IsAbilityOnField(ABILITY_AIR_LOCK)
|
||||
&& !IsAbilityOnField(ABILITY_CLOUD_NINE)
|
||||
&& gBattleMoves[gCurrentMove].power >= 1)
|
||||
{
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_PrimordialSeaFizzlesOutFireTypeMoves;
|
||||
return;
|
||||
}
|
||||
|
||||
GET_MOVE_TYPE(gCurrentMove, moveType);
|
||||
if (moveType == TYPE_WATER
|
||||
&& (gBattleWeather & WEATHER_SUN_PRIMAL)
|
||||
&& !IsAbilityOnField(ABILITY_AIR_LOCK)
|
||||
&& !IsAbilityOnField(ABILITY_CLOUD_NINE)
|
||||
&& gBattleMoves[gCurrentMove].power >= 1)
|
||||
{
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_DesolateLandEvaporatesWaterTypeMoves;
|
||||
return;
|
||||
}
|
||||
|
||||
if (gBattleOutcome != 0)
|
||||
{
|
||||
gCurrentActionFuncId = B_ACTION_FINISHED;
|
||||
@ -8422,6 +8446,26 @@ static void Cmd_various(void)
|
||||
gBattlescriptCurrInstr += 7; // exit if loop failed (failsafe)
|
||||
}
|
||||
return;
|
||||
case VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER:
|
||||
if (gBattleWeather & WEATHER_SUN_PRIMAL)
|
||||
{
|
||||
gBattleWeather &= ~WEATHER_SUN_PRIMAL;
|
||||
PrepareStringBattle(STRINGID_EXTREMESUNLIGHTFADED, gActiveBattler);
|
||||
gBattleCommunication[MSG_DISPLAY] = 1;
|
||||
}
|
||||
else if (gBattleWeather & WEATHER_RAIN_PRIMAL)
|
||||
{
|
||||
gBattleWeather &= ~WEATHER_RAIN_PRIMAL;
|
||||
PrepareStringBattle(STRINGID_HEAVYRAINLIFTED, gActiveBattler);
|
||||
gBattleCommunication[MSG_DISPLAY] = 1;
|
||||
}
|
||||
else if (gBattleWeather & WEATHER_STRONG_WINDS)
|
||||
{
|
||||
gBattleWeather &= ~WEATHER_STRONG_WINDS;
|
||||
PrepareStringBattle(STRINGID_STRONGWINDSDISSIPATED, gActiveBattler);
|
||||
gBattleCommunication[MSG_DISPLAY] = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
gBattlescriptCurrInstr += 3;
|
||||
|
@ -2098,9 +2098,10 @@ u8 DoFieldEndTurnEffects(void)
|
||||
}
|
||||
break;
|
||||
case ENDTURN_RAIN:
|
||||
if (gBattleWeather & WEATHER_RAIN_ANY)
|
||||
if (gBattleWeather & WEATHER_RAIN_ANY || gBattleWeather & WEATHER_RAIN_PRIMAL)
|
||||
{
|
||||
if (!(gBattleWeather & WEATHER_RAIN_PERMANENT))
|
||||
if (!(gBattleWeather & WEATHER_RAIN_PERMANENT)
|
||||
&& !(gBattleWeather & WEATHER_RAIN_PRIMAL))
|
||||
{
|
||||
if (--gWishFutureKnock.weatherDuration == 0)
|
||||
{
|
||||
@ -2148,9 +2149,11 @@ u8 DoFieldEndTurnEffects(void)
|
||||
gBattleStruct->turnCountersTracker++;
|
||||
break;
|
||||
case ENDTURN_SUN:
|
||||
if (gBattleWeather & WEATHER_SUN_ANY)
|
||||
if (gBattleWeather & WEATHER_SUN_ANY || gBattleWeather & WEATHER_SUN_PRIMAL)
|
||||
{
|
||||
if (!(gBattleWeather & WEATHER_SUN_PERMANENT) && --gWishFutureKnock.weatherDuration == 0)
|
||||
if (!(gBattleWeather & WEATHER_SUN_PERMANENT)
|
||||
&& !(gBattleWeather & WEATHER_SUN_PRIMAL)
|
||||
&& --gWishFutureKnock.weatherDuration == 0)
|
||||
{
|
||||
gBattleWeather &= ~WEATHER_SUN_TEMPORARY;
|
||||
gBattlescriptCurrInstr = BattleScript_SunlightFaded;
|
||||
@ -3643,9 +3646,12 @@ u8 TryWeatherFormChange(u8 battler)
|
||||
static const u16 sWeatherFlagsInfo[][3] =
|
||||
{
|
||||
[ENUM_WEATHER_RAIN] = {WEATHER_RAIN_TEMPORARY, WEATHER_RAIN_PERMANENT, HOLD_EFFECT_DAMP_ROCK},
|
||||
[ENUM_WEATHER_RAIN_PRIMAL] = {WEATHER_RAIN_PRIMAL, WEATHER_RAIN_PRIMAL, HOLD_EFFECT_DAMP_ROCK},
|
||||
[ENUM_WEATHER_SUN] = {WEATHER_SUN_TEMPORARY, WEATHER_SUN_PERMANENT, HOLD_EFFECT_HEAT_ROCK},
|
||||
[ENUM_WEATHER_SUN_PRIMAL] = {WEATHER_SUN_PRIMAL, WEATHER_SUN_PRIMAL, HOLD_EFFECT_HEAT_ROCK},
|
||||
[ENUM_WEATHER_SANDSTORM] = {WEATHER_SANDSTORM_TEMPORARY, WEATHER_SANDSTORM_PERMANENT, HOLD_EFFECT_SMOOTH_ROCK},
|
||||
[ENUM_WEATHER_HAIL] = {WEATHER_HAIL_TEMPORARY, WEATHER_HAIL_PERMANENT, HOLD_EFFECT_ICY_ROCK},
|
||||
[ENUM_WEATHER_STRONG_WINDS] = {WEATHER_STRONG_WINDS, WEATHER_STRONG_WINDS, HOLD_EFFECT_NONE},
|
||||
};
|
||||
|
||||
bool32 TryChangeBattleWeather(u8 battler, u32 weatherEnumId, bool32 viaAbility)
|
||||
@ -3656,6 +3662,13 @@ bool32 TryChangeBattleWeather(u8 battler, u32 weatherEnumId, bool32 viaAbility)
|
||||
gBattleWeather = (sWeatherFlagsInfo[weatherEnumId][0] | sWeatherFlagsInfo[weatherEnumId][1]);
|
||||
return TRUE;
|
||||
}
|
||||
else if (gBattleWeather & WEATHER_PRIMAL_ANY
|
||||
&& GetBattlerAbility(battler) != ABILITY_DESOLATE_LAND
|
||||
&& GetBattlerAbility(battler) != ABILITY_PRIMORDIAL_SEA
|
||||
&& GetBattlerAbility(battler) != ABILITY_DELTA_STREAM)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else if (!(gBattleWeather & (sWeatherFlagsInfo[weatherEnumId][0] | sWeatherFlagsInfo[weatherEnumId][1])))
|
||||
{
|
||||
gBattleWeather = (sWeatherFlagsInfo[weatherEnumId][0]);
|
||||
@ -4233,6 +4246,27 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
case ABILITY_DESOLATE_LAND:
|
||||
if (TryChangeBattleWeather(battler, ENUM_WEATHER_SUN_PRIMAL, TRUE))
|
||||
{
|
||||
BattleScriptPushCursorAndCallback(BattleScript_DesolateLandActivates);
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
case ABILITY_PRIMORDIAL_SEA:
|
||||
if (TryChangeBattleWeather(battler, ENUM_WEATHER_RAIN_PRIMAL, TRUE))
|
||||
{
|
||||
BattleScriptPushCursorAndCallback(BattleScript_PrimordialSeaActivates);
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
case ABILITY_DELTA_STREAM:
|
||||
if (TryChangeBattleWeather(battler, ENUM_WEATHER_STRONG_WINDS, TRUE))
|
||||
{
|
||||
BattleScriptPushCursorAndCallback(BattleScript_DeltaStreamActivates);
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ABILITYEFFECT_ENDTURN: // 1
|
||||
@ -8105,6 +8139,18 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat
|
||||
modifier = UQ_4_12(1.0);
|
||||
}
|
||||
|
||||
// WEATHER_STRONG_WINDS weakens super effective moves against flying type mons
|
||||
if (gBattleWeather & WEATHER_STRONG_WINDS
|
||||
&& modifier == UQ_4_12(2.0)
|
||||
&& (IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING))
|
||||
&& !IsAbilityOnField(ABILITY_AIR_LOCK)
|
||||
&& !IsAbilityOnField(ABILITY_CLOUD_NINE))
|
||||
{
|
||||
modifier = UQ_4_12(1.0);
|
||||
gBattlescriptCurrInstr = BattleScript_AttackWeakenedByStrongWinds;
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
|
||||
if (GetBattlerAbility(battlerDef) == ABILITY_WONDER_GUARD && modifier <= UQ_4_12(1.0) && gBattleMoves[move].power)
|
||||
{
|
||||
modifier = UQ_4_12(0.0);
|
||||
|
Loading…
Reference in New Issue
Block a user