mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-10-08 22:27:16 +02:00
* Add generic to util holders to reduce manual type casting
* implement protean and libero abilities
* remove use only once per turn trigger
* Revert Attack Attribute Conditions back to requiring unused vars
* Remove conditional before invoking type change ability
* update protean to properly trigger and skip certain moves
* remove some dangerous typecasts
* revert autoformatting changes
* not all autoformatting changes were reverted
* Revert "Add generic to util holders to reduce manual type casting"
This reverts commit 3ee7f1d5ff
.
* change some variable names
* remove incorrect comment
* update abilities so they use gen 9 logic
* fix typescript error from missing Terrain type
* update gameManager switchPokemon to match other menu utilities
* add test cases for protean and libero
21 lines
902 B
TypeScript
21 lines
902 B
TypeScript
import { Arena } from "../field/arena";
|
|
import { ArenaTag } from "../data/arena-tag";
|
|
import { Biome } from "../data/enums/biome";
|
|
import { Weather } from "../data/weather";
|
|
import { Terrain } from "#app/data/terrain.js";
|
|
|
|
export default class ArenaData {
|
|
public biome: Biome;
|
|
public weather: Weather;
|
|
public terrain: Terrain;
|
|
public tags: ArenaTag[];
|
|
|
|
constructor(source: Arena | any) {
|
|
const sourceArena = source instanceof Arena ? source as Arena : null;
|
|
this.biome = sourceArena ? sourceArena.biomeType : source.biome;
|
|
this.weather = sourceArena ? sourceArena.weather : source.weather ? new Weather(source.weather.weatherType, source.weather.turnsLeft) : undefined;
|
|
this.terrain = sourceArena ? sourceArena.terrain : source.terrain ? new Terrain(source.terrain.terrainType, source.terrain.turnsLeft) : undefined;
|
|
this.tags = sourceArena ? sourceArena.tags : [];
|
|
}
|
|
}
|