refactored snow into damaging weather

this is necessary for ice body to properly work.
doesnt actually do any damage
This commit is contained in:
CallmeEchoo 2023-05-05 01:38:12 +02:00
parent 74f074f5f3
commit eb5b81684c
7 changed files with 34 additions and 36 deletions

View file

@ -6851,7 +6851,7 @@ BattleScript_RainContinuesOrEndsEnd::
end2 end2
BattleScript_DamagingWeatherContinues:: BattleScript_DamagingWeatherContinues::
printfromtable gSandStormHailContinuesStringIds printfromtable gSandStormHailSnowContinuesStringIds
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
playanimation_var BS_ATTACKER, sB_ANIM_ARG1 playanimation_var BS_ATTACKER, sB_ANIM_ARG1
setbyte gBattleCommunication, 0 setbyte gBattleCommunication, 0
@ -6883,16 +6883,8 @@ BattleScript_DamagingWeatherContinuesEnd::
bicword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE bicword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
end2 end2
BattleScript_SnowContinuesOrEnds:: BattleScript_SandStormHailSnowEnds::
printfromtable gSnowContinuesStringIds printfromtable gSandStormHailSnowEndStringIds
waitmessage B_WAIT_TIME_LONG
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_SNOW_STOPPED, BattleScript_SnowContinuesOrEndsEnd
playanimation BS_ATTACKER, B_ANIM_SNOW_CONTINUES
BattleScript_SnowContinuesOrEndsEnd::
end2
BattleScript_SandStormHailEnds::
printfromtable gSandStormHailEndStringIds
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
end2 end2

View file

@ -45,7 +45,7 @@ extern const u8 BattleScript_LevelUp[];
extern const u8 BattleScript_RainContinuesOrEnds[]; extern const u8 BattleScript_RainContinuesOrEnds[];
extern const u8 BattleScript_SnowContinuesOrEnds[]; extern const u8 BattleScript_SnowContinuesOrEnds[];
extern const u8 BattleScript_DamagingWeatherContinues[]; extern const u8 BattleScript_DamagingWeatherContinues[];
extern const u8 BattleScript_SandStormHailEnds[]; extern const u8 BattleScript_SandStormHailSnowEnds[];
extern const u8 BattleScript_SunlightContinues[]; extern const u8 BattleScript_SunlightContinues[];
extern const u8 BattleScript_SunlightFaded[]; extern const u8 BattleScript_SunlightFaded[];
extern const u8 BattleScript_OverworldWeatherStarts[]; extern const u8 BattleScript_OverworldWeatherStarts[];

View file

@ -737,13 +737,10 @@
#define B_MSG_DOWNPOUR_CONTINUES 1 #define B_MSG_DOWNPOUR_CONTINUES 1
#define B_MSG_RAIN_STOPPED 2 #define B_MSG_RAIN_STOPPED 2
// gSnowContinuesStringIds // gSandStormHailSnowContinuesStringIds / gSandStormHailDmgStringIds/ gSandStormHailSnowEndStringIds
#define B_MSG_SNOW_CONTINUES 0
#define B_MSG_SNOW_STOPPED 1
// gSandStormHailContinuesStringIds / gSandStormHailDmgStringIds/ gSandStormHailEndStringIds
#define B_MSG_SANDSTORM 0 #define B_MSG_SANDSTORM 0
#define B_MSG_HAIL 1 #define B_MSG_HAIL 1
#define B_MSG_SNOW 2
// gReflectLightScreenSafeguardStringIds // gReflectLightScreenSafeguardStringIds
#define B_MSG_SIDE_STATUS_FAILED 0 #define B_MSG_SIDE_STATUS_FAILED 0

View file

@ -1568,10 +1568,11 @@ const u16 gMoveWeatherChangeStringIds[] =
[B_MSG_STARTED_SNOW] = STRINGID_STARTEDSNOW, [B_MSG_STARTED_SNOW] = STRINGID_STARTEDSNOW,
}; };
const u16 gSandStormHailContinuesStringIds[] = const u16 gSandStormHailSnowContinuesStringIds[] =
{ {
[B_MSG_SANDSTORM] = STRINGID_SANDSTORMRAGES, [B_MSG_SANDSTORM] = STRINGID_SANDSTORMRAGES,
[B_MSG_HAIL] = STRINGID_HAILCONTINUES, [B_MSG_HAIL] = STRINGID_HAILCONTINUES,
[B_MSG_SNOW] = STRINGID_SNOWCONTINUES,
}; };
const u16 gSandStormHailDmgStringIds[] = const u16 gSandStormHailDmgStringIds[] =
@ -1580,10 +1581,11 @@ const u16 gSandStormHailDmgStringIds[] =
[B_MSG_HAIL] = STRINGID_PKMNPELTEDBYHAIL [B_MSG_HAIL] = STRINGID_PKMNPELTEDBYHAIL
}; };
const u16 gSandStormHailEndStringIds[] = const u16 gSandStormHailSnowEndStringIds[] =
{ {
[B_MSG_SANDSTORM] = STRINGID_SANDSTORMSUBSIDED, [B_MSG_SANDSTORM] = STRINGID_SANDSTORMSUBSIDED,
[B_MSG_HAIL] = STRINGID_HAILSTOPPED, [B_MSG_HAIL] = STRINGID_HAILSTOPPED,
[B_MSG_SNOW] = STRINGID_SNOWSTOPPED,
}; };
const u16 gRainContinuesStringIds[] = const u16 gRainContinuesStringIds[] =
@ -1593,12 +1595,6 @@ const u16 gRainContinuesStringIds[] =
[B_MSG_RAIN_STOPPED] = STRINGID_RAINSTOPPED [B_MSG_RAIN_STOPPED] = STRINGID_RAINSTOPPED
}; };
const u16 gSnowContinuesStringIds[] =
{
[B_MSG_SNOW_CONTINUES] = STRINGID_SNOWCONTINUES,
[B_MSG_SNOW_STOPPED] = STRINGID_SNOWSTOPPED,
};
const u16 gProtectLikeUsedStringIds[] = const u16 gProtectLikeUsedStringIds[] =
{ {
[B_MSG_PROTECTED_ITSELF] = STRINGID_PKMNPROTECTEDITSELF2, [B_MSG_PROTECTED_ITSELF] = STRINGID_PKMNPROTECTEDITSELF2,

View file

@ -12769,6 +12769,20 @@ static void Cmd_weatherdamage(void)
gBattleMoveDamage = 1; gBattleMoveDamage = 1;
} }
} }
if (gBattleWeather & B_WEATHER_SNOW)
{
if (ability == ABILITY_ICE_BODY
&& !(gStatuses3[gBattlerAttacker] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER))
&& !BATTLER_MAX_HP(gBattlerAttacker)
&& !(gStatuses3[gBattlerAttacker] & STATUS3_HEAL_BLOCK))
{
gBattlerAbility = gBattlerAttacker;
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 16;
if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1;
gBattleMoveDamage *= -1;
}
}
} }
gBattlescriptCurrInstr = cmd->nextInstr; gBattlescriptCurrInstr = cmd->nextInstr;

View file

@ -2341,7 +2341,7 @@ u8 DoFieldEndTurnEffects(void)
if (!(gBattleWeather & B_WEATHER_SANDSTORM_PERMANENT) && --gWishFutureKnock.weatherDuration == 0) if (!(gBattleWeather & B_WEATHER_SANDSTORM_PERMANENT) && --gWishFutureKnock.weatherDuration == 0)
{ {
gBattleWeather &= ~B_WEATHER_SANDSTORM_TEMPORARY; gBattleWeather &= ~B_WEATHER_SANDSTORM_TEMPORARY;
gBattlescriptCurrInstr = BattleScript_SandStormHailEnds; gBattlescriptCurrInstr = BattleScript_SandStormHailSnowEnds;
} }
else else
{ {
@ -2381,7 +2381,7 @@ u8 DoFieldEndTurnEffects(void)
if (!(gBattleWeather & B_WEATHER_HAIL_PERMANENT) && --gWishFutureKnock.weatherDuration == 0) if (!(gBattleWeather & B_WEATHER_HAIL_PERMANENT) && --gWishFutureKnock.weatherDuration == 0)
{ {
gBattleWeather &= ~B_WEATHER_HAIL_TEMPORARY; gBattleWeather &= ~B_WEATHER_HAIL_TEMPORARY;
gBattlescriptCurrInstr = BattleScript_SandStormHailEnds; gBattlescriptCurrInstr = BattleScript_SandStormHailSnowEnds;
} }
else else
{ {
@ -2398,20 +2398,19 @@ u8 DoFieldEndTurnEffects(void)
case ENDTURN_SNOW: case ENDTURN_SNOW:
if (gBattleWeather & B_WEATHER_SNOW) if (gBattleWeather & B_WEATHER_SNOW)
{ {
if (!(gBattleWeather & B_WEATHER_SNOW_PERMANENT)) if (!(gBattleWeather & B_WEATHER_SNOW_PERMANENT) && --gWishFutureKnock.weatherDuration == 0)
{
if (--gWishFutureKnock.weatherDuration == 0)
{ {
gBattleWeather &= ~B_WEATHER_SNOW_TEMPORARY; gBattleWeather &= ~B_WEATHER_SNOW_TEMPORARY;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SNOW_STOPPED; gBattlescriptCurrInstr = BattleScript_SandStormHailSnowEnds;
}
} }
else else
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SNOW_CONTINUES; gBattlescriptCurrInstr = BattleScript_DamagingWeatherContinues;
} }
BattleScriptExecute(BattleScript_SnowContinuesOrEnds); gBattleScripting.animArg1 = B_ANIM_SNOW_CONTINUES;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SNOW;
BattleScriptExecute(gBattlescriptCurrInstr);
effect++; effect++;
} }
gBattleStruct->turnCountersTracker++; gBattleStruct->turnCountersTracker++;

View file

@ -113,7 +113,7 @@ static const u8 sFilterDescription[] = _("Weakens “supereffective”.");
static const u8 sSlowStartDescription[] = _("Takes a while to get going."); static const u8 sSlowStartDescription[] = _("Takes a while to get going.");
static const u8 sScrappyDescription[] = _("Hits Ghost-type Pokémon."); static const u8 sScrappyDescription[] = _("Hits Ghost-type Pokémon.");
static const u8 sStormDrainDescription[] = _("Draws in Water moves."); static const u8 sStormDrainDescription[] = _("Draws in Water moves.");
static const u8 sIceBodyDescription[] = _("Slight HP recovery in Hail."); static const u8 sIceBodyDescription[] = _("HP recovery in Hail or Snow.");
static const u8 sSnowWarningDescription[] = _("Summons a hailstorm."); static const u8 sSnowWarningDescription[] = _("Summons a hailstorm.");
static const u8 sHoneyGatherDescription[] = _("May gather Honey."); static const u8 sHoneyGatherDescription[] = _("May gather Honey.");
static const u8 sFriskDescription[] = _("Checks a foe's item."); static const u8 sFriskDescription[] = _("Checks a foe's item.");