pokerogue/src/system/egg-data.ts
Flashfyre aa94e044ab Add egg gacha system and various minor changes
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
2023-12-19 23:51:48 -05:00

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);
}
}