mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-09 08:59:29 +02:00
Update documentation on arena-tag.ts
This commit is contained in:
parent
99dfc1d973
commit
8b808868a2
@ -917,7 +917,7 @@ export class DelayedAttackTag extends ArenaTag {
|
||||
super(ArenaTagType.DELAYED_ATTACK, 0);
|
||||
}
|
||||
|
||||
loadTag(source: ArenaTag | any): void {
|
||||
override loadTag(source: ArenaTag | any): void {
|
||||
super.loadTag(source);
|
||||
this.delayedAttacks = source.delayedAttacks;
|
||||
}
|
||||
@ -962,21 +962,7 @@ export class DelayedAttackTag extends ArenaTag {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Queue attack message and then unshift a new MoveEffectPhase for this move's attack phase.
|
||||
globalScene.phaseManager.queueMessage(
|
||||
i18next.t("moveTriggers:tookMoveAttack", {
|
||||
pokemonName: getPokemonNameWithAffix(target),
|
||||
moveName: allMoves[attack.move].name,
|
||||
}),
|
||||
);
|
||||
|
||||
globalScene.phaseManager.unshiftNew(
|
||||
"MoveEffectPhase",
|
||||
attack.sourceId,
|
||||
[attack.targetIndex],
|
||||
allMoves[attack.move],
|
||||
MoveUseMode.TRANSPARENT,
|
||||
);
|
||||
this.triggerAttack(attack);
|
||||
}
|
||||
|
||||
return this.removeDoneAttacks();
|
||||
@ -986,11 +972,31 @@ export class DelayedAttackTag extends ArenaTag {
|
||||
* Remove all finished attacks from the current queue.
|
||||
* @returns Whether at least 1 attack has not finished triggering.
|
||||
*/
|
||||
removeDoneAttacks(): boolean {
|
||||
private removeDoneAttacks(): boolean {
|
||||
this.delayedAttacks = this.delayedAttacks.filter(a => a.turnCount > 0);
|
||||
return this.delayedAttacks.length > 0;
|
||||
}
|
||||
|
||||
/** Trigger a delayed attack. */
|
||||
protected triggerAttack(attack: DelayedAttack): void {
|
||||
const target = globalScene.getField()[attack.targetIndex];
|
||||
// Queue attack message and then unshift a new MoveEffectPhase for this move's attack phase.
|
||||
globalScene.phaseManager.queueMessage(
|
||||
i18next.t("moveTriggers:tookMoveAttack", {
|
||||
pokemonName: getPokemonNameWithAffix(target),
|
||||
moveName: allMoves[attack.move].name,
|
||||
}),
|
||||
);
|
||||
|
||||
globalScene.phaseManager.unshiftNew(
|
||||
"MoveEffectPhase",
|
||||
attack.sourceId,
|
||||
[attack.targetIndex],
|
||||
allMoves[attack.move],
|
||||
MoveUseMode.TRANSPARENT,
|
||||
);
|
||||
}
|
||||
|
||||
/** Override on remove func to do nothing. */
|
||||
override onRemove(_arena: Arena): void {}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user