Fixes Chilly Reception displaying its message when called by another move (#8795)

This commit is contained in:
PhallenTree 2026-01-04 15:50:43 +00:00 committed by GitHub
parent 5ee69235ef
commit bda2064ecf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 79 additions and 11 deletions

View File

@ -3504,18 +3504,22 @@ BattleScript_EffectShoreUp::
BattleScript_EffectWeather::
attackcanceler
BattleScript_EffectWeatherSetWeather:
setfieldweather
attackanimation
waitanimation
call BattleScript_MoveWeatherChangeRet
goto BattleScript_MoveEnd
BattleScript_EffectWeatherAndSwitch::
BattleScript_ChillyReceptionMessage::
printstring STRINGID_PKMNTELLCHILLINGRECEPTIONJOKE
waitmessage B_WAIT_TIME_LONG
jumpifbattletype BATTLE_TYPE_ARENA, BattleScript_EffectWeather
jumpifcantswitch SWITCH_IGNORE_ESCAPE_PREVENTION | BS_ATTACKER, BattleScript_EffectWeather
return
BattleScript_EffectWeatherAndSwitch::
attackcanceler
jumpifbattletype BATTLE_TYPE_ARENA, BattleScript_EffectWeatherSetWeather
jumpifcantswitch SWITCH_IGNORE_ESCAPE_PREVENTION | BS_ATTACKER, BattleScript_EffectWeatherSetWeather
setfieldweather
clearmoveresultflags MOVE_RESULT_NO_EFFECT
attackanimation

View File

@ -789,6 +789,7 @@ extern const u8 BattleScript_EffectRevivalBlessing[];
extern const u8 BattleScript_EffectTakeHeart[];
extern const u8 BattleScript_EffectCorrosiveGas[];
extern const u8 BattleScript_MoveEffectSaltCure[];
extern const u8 BattleScript_ChillyReceptionMessage[];
extern const u8 BattleScript_EffectWeatherAndSwitch[];
extern const u8 BattleScript_EffectMaxMove[];
extern const u8 BattleScript_EffectBrickBreak[];

View File

@ -105,6 +105,7 @@ enum MoveSuccessOrder
CANCELER_CLEAR_FLAGS,
CANCELER_SKY_DROP,
CANCELER_RECHARGE,
CANCELER_CHILLY_RECEPTION,
CANCELER_ASLEEP_OR_FROZEN,
CANCELER_POWER_POINTS,
CANCELER_OBEDIENCE,

View File

@ -1987,6 +1987,13 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, enum Move move, s32 s
ADJUST_SCORE(-10);
}
break;
case EFFECT_WEATHER_AND_SWITCH:
if (CountUsablePartyMons(battlerAtk) == 0)
{
ADJUST_SCORE(-10);
break;
}
// fallthrough
case EFFECT_WEATHER:
switch (GetMoveWeatherType(move))
{
@ -2043,13 +2050,6 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, enum Move move, s32 s
break;
case EFFECT_HIT_ESCAPE:
break;
case EFFECT_WEATHER_AND_SWITCH:
if (CountUsablePartyMons(battlerAtk) == 0)
ADJUST_SCORE(-10);
else if (weather & (B_WEATHER_ICY_ANY | B_WEATHER_PRIMAL_ANY)
|| (HasPartner(battlerAtk) && AreMovesEquivalent(battlerAtk, BATTLE_PARTNER(battlerAtk), move, aiData->partnerMove)))
ADJUST_SCORE(-8);
break;
case EFFECT_BELLY_DRUM:
case EFFECT_FILLET_AWAY:
if (AI_IsAbilityOnSide(battlerDef, ABILITY_UNAWARE))

View File

@ -2091,6 +2091,16 @@ static enum MoveCanceler CancelerRecharge(struct BattleContext *ctx)
return MOVE_STEP_SUCCESS;
}
static enum MoveCanceler CancelerChillyReception(struct BattleContext *ctx)
{
if (GetMoveEffect(ctx->move) == EFFECT_WEATHER_AND_SWITCH)
{
BattleScriptCall(BattleScript_ChillyReceptionMessage);
return MOVE_STEP_BREAK;
}
return MOVE_STEP_SUCCESS;
}
static enum MoveCanceler CancelerAsleepOrFrozen(struct BattleContext *ctx)
{
enum MoveCanceler effect = MOVE_STEP_BREAK;
@ -3111,6 +3121,7 @@ static enum MoveCanceler (*const sMoveSuccessOrderCancelers[])(struct BattleCont
[CANCELER_STANCE_CHANGE_1] = CancelerStanceChangeOne,
[CANCELER_SKY_DROP] = CancelerSkyDrop,
[CANCELER_RECHARGE] = CancelerRecharge,
[CANCELER_CHILLY_RECEPTION] = CancelerChillyReception,
[CANCELER_ASLEEP_OR_FROZEN] = CancelerAsleepOrFrozen,
[CANCELER_OBEDIENCE] = CancelerObedience,
[CANCELER_POWER_POINTS] = CancelerPowerPoints,

View File

@ -105,4 +105,55 @@ SINGLE_BATTLE_TEST("Chilly Reception changes the weather, even if the user canno
}
}
TO_DO_BATTLE_TEST("Chilly Reception doesn't announce its move if it's called by a different move");
SINGLE_BATTLE_TEST("Chilly Reception switches the user out even if it can't change the weather")
{
GIVEN {
PLAYER(SPECIES_SLOWKING_GALAR);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_NINETALES_ALOLA) { Ability(ABILITY_SNOW_WARNING); }
} WHEN {
TURN { MOVE(player, MOVE_CHILLY_RECEPTION); SEND_OUT(player, 1); }
} SCENE {
MESSAGE("Slowking is preparing to tell a chillingly bad joke!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_CHILLY_RECEPTION, player);
MESSAGE("But it failed!"); // According to jpwiki, this is the correct message
MESSAGE("Slowking went back to 1!");
SEND_IN_MESSAGE("Wobbuffet");
}
}
SINGLE_BATTLE_TEST("Chilly Reception fails if it can't switch the user out or change the weather")
{
GIVEN {
PLAYER(SPECIES_SLOWKING_GALAR);
OPPONENT(SPECIES_NINETALES_ALOLA) { Ability(ABILITY_SNOW_WARNING); }
} WHEN {
TURN { MOVE(player, MOVE_CHILLY_RECEPTION); }
} SCENE {
MESSAGE("Slowking is preparing to tell a chillingly bad joke!");
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_CHILLY_RECEPTION, player);
MESSAGE("But it failed!");
}
}
SINGLE_BATTLE_TEST("Chilly Reception doesn't announce its move if it's called by a different move")
{
GIVEN {
ASSUME(GetMoveEffect(MOVE_SLEEP_TALK) == EFFECT_SLEEP_TALK);
PLAYER(SPECIES_SLOWKING_GALAR) { Status1(STATUS1_SLEEP); Moves(MOVE_SLEEP_TALK, MOVE_CHILLY_RECEPTION); }
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_SLEEP_TALK); SEND_OUT(player, 1); }
} SCENE {
NOT MESSAGE("Slowking is preparing to tell a chillingly bad joke!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_CHILLY_RECEPTION, player);
#if B_PREFERRED_ICE_WEATHER == B_ICE_WEATHER_HAIL
MESSAGE("It started to hail!");
#else
MESSAGE("It started to snow!");
#endif
MESSAGE("Slowking went back to 1!");
SEND_IN_MESSAGE("Wobbuffet");
}
}