This commit is contained in:
Mikhail-Shueb 2025-03-05 20:25:53 +00:00
parent 6181afc6d2
commit 85c3a10d0f
3 changed files with 20 additions and 2 deletions

@ -1 +1 @@
Subproject commit 0e5c6096ba26f6b87aed1aab3fe9b0b23f6cbb7b
Subproject commit 841250a37b649e9ddbb004f2ebab4b6327e00a21

View File

@ -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:

View File

@ -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?