mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-10 09:29:25 +02:00
Update tag for serialization
This commit is contained in:
parent
8f9fca50a1
commit
d55cfbcf38
@ -10,6 +10,7 @@ import { allMoves } from "#data/data-lists";
|
|||||||
import { AbilityId } from "#enums/ability-id";
|
import { AbilityId } from "#enums/ability-id";
|
||||||
import { ArenaTagSide } from "#enums/arena-tag-side";
|
import { ArenaTagSide } from "#enums/arena-tag-side";
|
||||||
import { ArenaTagType } from "#enums/arena-tag-type";
|
import { ArenaTagType } from "#enums/arena-tag-type";
|
||||||
|
import type { BattlerIndex } from "#enums/battler-index";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { HitResult } from "#enums/hit-result";
|
import { HitResult } from "#enums/hit-result";
|
||||||
import { CommonAnim } from "#enums/move-anims-common";
|
import { CommonAnim } from "#enums/move-anims-common";
|
||||||
@ -1608,12 +1609,13 @@ interface PendingHealEffect {
|
|||||||
* If the effect is from Lunar Dance, their PP is also restored.
|
* If the effect is from Lunar Dance, their PP is also restored.
|
||||||
* @extends ArenaTag
|
* @extends ArenaTag
|
||||||
*/
|
*/
|
||||||
export class PendingHealTag extends ArenaTag {
|
export class PendingHealTag extends SerializableArenaTag {
|
||||||
|
public readonly tagType = ArenaTagType.PENDING_HEAL;
|
||||||
/** All pending healing effects, organized by {@linkcode BattlerIndex} */
|
/** All pending healing effects, organized by {@linkcode BattlerIndex} */
|
||||||
private pendingHeals: Partial<Record<BattlerIndex, PendingHealEffect[]>> = {};
|
public readonly pendingHeals: Partial<Record<BattlerIndex, PendingHealEffect[]>> = {};
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super(ArenaTagType.PENDING_HEAL, 0);
|
super(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1709,9 +1711,9 @@ export class PendingHealTag extends ArenaTag {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
override loadTag(source: ArenaTag | any): void {
|
override loadTag(source: BaseArenaTag & Pick<PendingHealTag, "tagType" | "pendingHeals">): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
this.pendingHeals = source.pendingHeals;
|
(this as Mutable<this>).pendingHeals = source.pendingHeals;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1828,5 +1830,6 @@ export type ArenaTagTypeMap = {
|
|||||||
[ArenaTagType.GRASS_WATER_PLEDGE]: GrassWaterPledgeTag;
|
[ArenaTagType.GRASS_WATER_PLEDGE]: GrassWaterPledgeTag;
|
||||||
[ArenaTagType.FAIRY_LOCK]: FairyLockTag;
|
[ArenaTagType.FAIRY_LOCK]: FairyLockTag;
|
||||||
[ArenaTagType.NEUTRALIZING_GAS]: SuppressAbilitiesTag;
|
[ArenaTagType.NEUTRALIZING_GAS]: SuppressAbilitiesTag;
|
||||||
|
[ArenaTagType.PENDING_HEAL]: PendingHealTag;
|
||||||
[ArenaTagType.NONE]: NoneTag;
|
[ArenaTagType.NONE]: NoneTag;
|
||||||
};
|
};
|
||||||
|
@ -2101,7 +2101,7 @@ export class SacrificialFullRestoreAttr extends SacrificialAttr {
|
|||||||
sourceId: user.id,
|
sourceId: user.id,
|
||||||
moveId: move.id,
|
moveId: move.id,
|
||||||
restorePP: this.restorePP,
|
restorePP: this.restorePP,
|
||||||
healMessageKey: i18next.t(this.moveMessage, { pokemonName: getPokemonNameWithAffix(user) }),
|
healMessage: i18next.t(this.moveMessage, { pokemonName: getPokemonNameWithAffix(user) }),
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user