mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-06 08:22:16 +02:00
Fuxed constructor
This commit is contained in:
parent
811f617f5a
commit
0da02a60b5
@ -5665,12 +5665,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
this.summonData = new PokemonSummonData();
|
this.summonData = new PokemonSummonData();
|
||||||
this.tempSummonData = new PokemonTempSummonData();
|
this.tempSummonData = new PokemonTempSummonData();
|
||||||
|
|
||||||
this.setSwitchOutStatus(false);
|
this.setSwitchOutStatus(false);
|
||||||
// TODO: Why do we tick down leech seed on switch
|
|
||||||
if (this.getTag(BattlerTagType.SEEDED)) {
|
|
||||||
this.lapseTag(BattlerTagType.SEEDED);
|
|
||||||
}
|
|
||||||
if (globalScene) {
|
if (globalScene) {
|
||||||
globalScene.triggerPokemonFormChange(
|
globalScene.triggerPokemonFormChange(
|
||||||
this,
|
this,
|
||||||
@ -7792,9 +7787,22 @@ export class PokemonSummonData {
|
|||||||
public moveHistory: TurnMove[] = [];
|
public moveHistory: TurnMove[] = [];
|
||||||
|
|
||||||
constructor(source?: PokemonSummonData | Partial<PokemonSummonData>) {
|
constructor(source?: PokemonSummonData | Partial<PokemonSummonData>) {
|
||||||
if (!isNullOrUndefined(source)) {
|
if (isNullOrUndefined(source)) {
|
||||||
Object.assign(this, source)
|
return;
|
||||||
this.tags &&= this.tags.map(t => loadBattlerTag(t))
|
}
|
||||||
|
|
||||||
|
// TODO: Rework this into an actual generic function for use elsewhere
|
||||||
|
for (const [key, value] of Object.entries(source)) {
|
||||||
|
if (isNullOrUndefined(value) && this.hasOwnProperty(key)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key === "tags") {
|
||||||
|
// load battler tags
|
||||||
|
this.tags = value.map((t: BattlerTag) => loadBattlerTag(t));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
this[key] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user