mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-20 07:12:32 +02:00
Fix #5159: Harsh Sun, Heavy Rain, Delta Stream Messages Incorrect
The abilities Desolate Land, Primordial Sea and Delta Stream display the normal weather effect messages instead of special ones (e.g., "the sunlight got hot" instead of "The sunlight turned extremely harsh!"). Another issue is that if one of these special weathers is active and the opponent uses a move that is ineffective in this weather, it doesn't display a special message but the normal one (e.g., using a Water-type move in Harsh Sunlight). - Updated `weather.json` with the correct texts in: - `heavyRainStartMessage` - `harshSunStartMessage` - `strongWindsStartMessage` - Added new "effect" messages to fix the fail message bug: - `heavyRainEffectMessage` - `harshSunEffectMessage` - `defaultEffectMessage` - Added `getWeatherBlockMessage(WeatherType)` in `weather.ts` to return the correct message when a move fails due to Primordial Sea or Desolate Land. - Called `getWeatherBlockMessage()` in `useMove()` (line 385) to update `failedText` using `failedDueToWeather`. - Added `getWeatherType()` in `arena.ts` as a getter for `WeatherType`, since it wasn’t implemented yet.
This commit is contained in:
parent
7a9b1e5033
commit
16b58c19dc
@ -205,6 +205,16 @@ export function getWeatherClearMessage(weatherType: WeatherType): string | null
|
||||
return null;
|
||||
}
|
||||
|
||||
export function getWeatherBlockMessage(weatherType: WeatherType): string {
|
||||
switch (weatherType) {
|
||||
case WeatherType.HARSH_SUN:
|
||||
return i18next.t("weather:harshSunEffectMessage");
|
||||
case WeatherType.HEAVY_RAIN:
|
||||
return i18next.t("weather:heavyRainEffectMessage");
|
||||
}
|
||||
return i18next.t("weather:defaultEffectMessage");
|
||||
}
|
||||
|
||||
export function getTerrainStartMessage(terrainType: TerrainType): string | null {
|
||||
switch (terrainType) {
|
||||
case TerrainType.MISTY:
|
||||
|
@ -358,6 +358,10 @@ export class Arena {
|
||||
return !!this.terrain && this.terrain.isMoveTerrainCancelled(user, targets, move);
|
||||
}
|
||||
|
||||
public getWeatherType(): WeatherType {
|
||||
return this.weather?.weatherType ?? WeatherType.NONE;
|
||||
}
|
||||
|
||||
public getTerrainType(): TerrainType {
|
||||
return this.terrain?.terrainType ?? TerrainType.NONE;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ import {
|
||||
import { SpeciesFormChangePreMoveTrigger } from "#app/data/pokemon-forms";
|
||||
import { getStatusEffectActivationText, getStatusEffectHealText } from "#app/data/status-effect";
|
||||
import { Type } from "#enums/type";
|
||||
import { getTerrainBlockMessage } from "#app/data/weather";
|
||||
import { getTerrainBlockMessage, getWeatherBlockMessage } from "#app/data/weather";
|
||||
import { MoveUsedEvent } from "#app/events/battle-scene";
|
||||
import type { PokemonMove } from "#app/field/pokemon";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
@ -342,9 +342,10 @@ export class MovePhase extends BattlePhase {
|
||||
* TODO: is this sustainable?
|
||||
*/
|
||||
let failedDueToTerrain: boolean = false;
|
||||
let failedDueToWeather: boolean = false;
|
||||
if (success) {
|
||||
const passesConditions = move.applyConditions(this.pokemon, targets[0], move);
|
||||
const failedDueToWeather: boolean = globalScene.arena.isMoveWeatherCancelled(this.pokemon, move);
|
||||
failedDueToWeather = globalScene.arena.isMoveWeatherCancelled(this.pokemon, move);
|
||||
failedDueToTerrain = globalScene.arena.isMoveTerrainCancelled(this.pokemon, this.targets, move);
|
||||
success = passesConditions && !failedDueToWeather && !failedDueToTerrain;
|
||||
}
|
||||
@ -381,6 +382,8 @@ export class MovePhase extends BattlePhase {
|
||||
failedText = failureMessage;
|
||||
} else if (failedDueToTerrain) {
|
||||
failedText = getTerrainBlockMessage(targets[0], globalScene.arena.getTerrainType());
|
||||
} else if (failedDueToWeather) {
|
||||
failedText = getWeatherBlockMessage(globalScene.arena.getWeatherType());
|
||||
}
|
||||
|
||||
this.showFailedText(failedText);
|
||||
|
Loading…
Reference in New Issue
Block a user