mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-12-02 03:36:16 +00:00
aa94e044ab
Add egg gacha system; remove certain mythical Pokemon from the wild pool as egg exclusive; add egg vouchers with UI; rework Shiny Charm odds; fix trainer Pokemon shiny odds not properly ignoring Shiny Charm modifier
20 lines
673 B
TypeScript
20 lines
673 B
TypeScript
import { Egg, GachaType } from "../data/egg";
|
|
|
|
export default class EggData {
|
|
public id: integer;
|
|
public gachaType: GachaType;
|
|
public hatchWaves: integer;
|
|
public timestamp: integer;
|
|
|
|
constructor(source: Egg | any) {
|
|
const sourceEgg = source instanceof Egg ? source as Egg : null;
|
|
this.id = sourceEgg ? sourceEgg.id : source.id;
|
|
this.gachaType = sourceEgg ? sourceEgg.gachaType : source.gachaType;
|
|
this.hatchWaves = sourceEgg ? sourceEgg.hatchWaves : source.hatchWaves;
|
|
this.timestamp = sourceEgg ? sourceEgg.timestamp : source.timestamp;
|
|
}
|
|
|
|
toEgg(): Egg {
|
|
return new Egg(this.id, this.gachaType, this.hatchWaves, this.timestamp);
|
|
}
|
|
} |