pokerogue/src/system/arena-data.ts
Dmitriy K 819fe9b4a1
[Ability] Implement Protean and Libero abilities (#1309)
* 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
2024-06-13 10:54:23 -04:00

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 : [];
}
}