mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-27 02:32:21 +02:00
Add MagicCoatTag to battler-tags.ts
This commit is contained in:
parent
0193d7e9ad
commit
52772304be
@ -2983,6 +2983,24 @@ export class PsychoShiftTag extends BattlerTag {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tag associated with the move Magic Coat.
|
||||
*/
|
||||
export class MagicCoatTag extends BattlerTag {
|
||||
constructor() {
|
||||
super(BattlerTagType.MAGIC_COAT, BattlerTagLapseType.TURN_END, 1, Moves.MAGIC_COAT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Queues the "[PokemonName] shrouded itself with Magic Coat" message when the tag is added.
|
||||
* @param pokemon - The target {@linkcode Pokemon}
|
||||
*/
|
||||
override onAdd(pokemon: Pokemon) {
|
||||
// "{pokemonNameWithAffix} shrouded itself with Magic Coat!"
|
||||
globalScene.queueMessage(i18next.t("battlerTags:magicCoatOnAdd", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) }));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a {@linkcode BattlerTag} based on the provided tag type, turn count, source move, and source ID.
|
||||
* @param sourceId - The ID of the pokemon adding the tag
|
||||
@ -3172,6 +3190,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source
|
||||
return new GrudgeTag();
|
||||
case BattlerTagType.PSYCHO_SHIFT:
|
||||
return new PsychoShiftTag();
|
||||
case BattlerTagType.MAGIC_COAT:
|
||||
return new MagicCoatTag();
|
||||
case BattlerTagType.NONE:
|
||||
default:
|
||||
return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId);
|
||||
|
Loading…
Reference in New Issue
Block a user