[Bug] Chilly Reception no longer replaces Legendary Weather (Primordial Sea, Desolate Land, Delta Stream) (#5484)
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
parent
da68cf15c6
commit
e73dbe9861
|
@ -205,6 +205,18 @@ export function getWeatherClearMessage(weatherType: WeatherType): string | null
|
|||
return null;
|
||||
}
|
||||
|
||||
export function getLegendaryWeatherContinuesMessage(weatherType: WeatherType): string | null {
|
||||
switch (weatherType) {
|
||||
case WeatherType.HARSH_SUN:
|
||||
return i18next.t("weather:harshSunContinueMessage");
|
||||
case WeatherType.HEAVY_RAIN:
|
||||
return i18next.t("weather:heavyRainContinueMessage");
|
||||
case WeatherType.STRONG_WINDS:
|
||||
return i18next.t("weather:strongWindsContinueMessage");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export function getWeatherBlockMessage(weatherType: WeatherType): string {
|
||||
switch (weatherType) {
|
||||
case WeatherType.HARSH_SUN:
|
||||
|
|
|
@ -5,7 +5,7 @@ import type { Constructor } from "#app/utils";
|
|||
import * as Utils from "#app/utils";
|
||||
import type PokemonSpecies from "#app/data/pokemon-species";
|
||||
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||
import { getTerrainClearMessage, getTerrainStartMessage, getWeatherClearMessage, getWeatherStartMessage, Weather } from "#app/data/weather";
|
||||
import { getTerrainClearMessage, getTerrainStartMessage, getWeatherClearMessage, getWeatherStartMessage, getLegendaryWeatherContinuesMessage, Weather } from "#app/data/weather";
|
||||
import { CommonAnim } from "#app/data/battle-anims";
|
||||
import type { Type } from "#enums/type";
|
||||
import type Move from "#app/data/move";
|
||||
|
@ -274,6 +274,12 @@ export class Arena {
|
|||
|
||||
const oldWeatherType = this.weather?.weatherType || WeatherType.NONE;
|
||||
|
||||
if (this.weather?.isImmutable() && ![ WeatherType.HARSH_SUN, WeatherType.HEAVY_RAIN, WeatherType.STRONG_WINDS, WeatherType.NONE ].includes(weather)) {
|
||||
globalScene.unshiftPhase(new CommonAnimPhase(undefined, undefined, CommonAnim.SUNNY + (oldWeatherType - 1), true));
|
||||
globalScene.queueMessage(getLegendaryWeatherContinuesMessage(oldWeatherType)!);
|
||||
return false;
|
||||
}
|
||||
|
||||
this.weather = weather ? new Weather(weather, hasPokemonSource ? 5 : 0) : null;
|
||||
this.eventTarget.dispatchEvent(new WeatherChangedEvent(oldWeatherType, this.weather?.weatherType!, this.weather?.turnsLeft!)); // TODO: is this bang correct?
|
||||
|
||||
|
|
Loading…
Reference in New Issue