mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-20 15:22:19 +02:00
Fixes #5378
This commit is contained in:
parent
6181afc6d2
commit
85c3a10d0f
@ -1 +1 @@
|
||||
Subproject commit 0e5c6096ba26f6b87aed1aab3fe9b0b23f6cbb7b
|
||||
Subproject commit 841250a37b649e9ddbb004f2ebab4b6327e00a21
|
@ -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 getTerrainStartMessage(terrainType: TerrainType): string | null {
|
||||
switch (terrainType) {
|
||||
case TerrainType.MISTY:
|
||||
|
@ -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()) {
|
||||
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
Block a user