mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-05 09:28:21 +01:00
28 lines
975 B
TypeScript
28 lines
975 B
TypeScript
import type { Abilities } from "#enums/abilities";
|
|
import type { PokemonType } from "#enums/pokemon-type";
|
|
import type { Nature } from "#enums/nature";
|
|
|
|
/**
|
|
* Data that can customize a Pokemon in non-standard ways from its Species.
|
|
* Includes abilities, nature, changed types, etc.
|
|
*/
|
|
export class CustomPokemonData {
|
|
public spriteScale = 1;
|
|
public ability: Abilities | -1;
|
|
public passive: Abilities | -1;
|
|
public nature: Nature | -1;
|
|
public types: PokemonType[];
|
|
/** Deprecated but needed for session save migration */
|
|
// TODO: Remove this once pre-session migration is implemented
|
|
public hitsRecCount: number | null = null;
|
|
|
|
constructor(data?: CustomPokemonData | Partial<CustomPokemonData>) {
|
|
this.spriteScale = data?.spriteScale ?? 1;
|
|
this.ability = data?.ability ?? -1;
|
|
this.passive = data?.passive ?? -1;
|
|
this.nature = data?.nature ?? -1;
|
|
this.types = data?.types ?? [];
|
|
this.hitsRecCount = data?.hitsRecCount ?? null;
|
|
}
|
|
}
|