mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-01-15 13:31:40 +00:00
00f7fd47df
* Remove unnecessary re-exports * Move `Type` enum to `src/enums/type.ts` * Remove import style change from `modifier-type.ts`
29 lines
846 B
TypeScript
29 lines
846 B
TypeScript
import { Abilities } from "#enums/abilities";
|
|
import { Type } from "#enums/type";
|
|
import { isNullOrUndefined } from "#app/utils";
|
|
import { Nature } from "#enums/nature";
|
|
|
|
/**
|
|
* Data that can customize a Pokemon in non-standard ways from its Species
|
|
* Currently only used by Mystery Encounters and Mints.
|
|
*/
|
|
export class CustomPokemonData {
|
|
public spriteScale: number;
|
|
public ability: Abilities | -1;
|
|
public passive: Abilities | -1;
|
|
public nature: Nature | -1;
|
|
public types: Type[];
|
|
|
|
constructor(data?: CustomPokemonData | Partial<CustomPokemonData>) {
|
|
if (!isNullOrUndefined(data)) {
|
|
Object.assign(this, data);
|
|
}
|
|
|
|
this.spriteScale = this.spriteScale ?? -1;
|
|
this.ability = this.ability ?? -1;
|
|
this.passive = this.passive ?? -1;
|
|
this.nature = this.nature ?? -1;
|
|
this.types = this.types ?? [];
|
|
}
|
|
}
|