Add Psychic Terrain priority block effect and terrain messages

This commit is contained in:
Flashfyre committed 2024-03-18 18:03:13 -04:00
1 parent 47a51c9958
commit aa1e1a480f
4 files changed
+49 -10

No files matched your search

+10
View File
@@ -1,3 +1,4 @@
import Move from "./move";
import { Type } from "./type";
export enum TerrainType {
@@ -42,6 +43,15 @@ export class Terrain {
return 1;
}
isMoveTerrainCancelled(move: Move): boolean {
switch (this.terrainType) {
case TerrainType.PSYCHIC:
return move.priority > 0;
}
return false;
}
}
export function getTerrainColor(terrainType: TerrainType): [ integer, integer, integer ] {
+26 -6
View File
@@ -194,15 +194,35 @@ export function getWeatherClearMessage(weatherType: WeatherType): string {
}
export function getTerrainStartMessage(terrainType: TerrainType): string {
return terrainType
? `The terrain became ${Utils.toReadableString(TerrainType[terrainType])}!`
: null;
switch (terrainType) {
case TerrainType.MISTY:
return 'Mist swirled around the battlefield!';
case TerrainType.ELECTRIC:
return 'An electric current ran across the battlefield!';
case TerrainType.GRASSY:
return 'Grass grew to cover the battlefield!';
case TerrainType.PSYCHIC:
return 'The battlefield got weird!';
}
}
export function getTerrainClearMessage(terrainType: TerrainType): string {
return terrainType
? `The ${Utils.toReadableString(TerrainType[terrainType])} terrain faded.`
: null;
switch (terrainType) {
case TerrainType.MISTY:
return 'The mist disappeared from the battlefield.';
case TerrainType.ELECTRIC:
return 'The electricity disappeared from the battlefield.';
case TerrainType.GRASSY:
return 'The grass disappeared from the battlefield.';
case TerrainType.PSYCHIC:
return 'The weirdness disappeared from the battlefield!';
}
}
export function getTerrainBlockMessage(pokemon: Pokemon, terrainType: TerrainType): string {
if (terrainType === TerrainType.MISTY)
return getPokemonMessage(pokemon, ` surrounds itself with a protective mist!`);
return getPokemonMessage(pokemon, ` is protected by the ${Utils.toReadableString(TerrainType[terrainType])} Terrain!`);
}
interface WeatherPoolEntry {