From de3ca08704da84d78fc314064276cc2892f9f553 Mon Sep 17 00:00:00 2001 From: Douglas Marchione de Souza <42784723+Tiduzz@users.noreply.github.com> Date: Mon, 13 May 2024 22:09:46 -0300 Subject: [PATCH] Fix Air_Lock ability to express when it is switched in (#765) * Airlock ability now properly announces when it is in field when the pokemon with it is switched in * Set message as in the original games, also created a new attribute for in switch messages to not have the pokemon name required to be on it. * Committing language changes (i18n function) * Revert "Committing language changes (i18n function)" This reverts commit 2a3152003b676d54d21c5b675796fd2220b55b1d. * Changed message variable name --- src/data/ability.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 5ef07c39f7b..22867ee131f 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -1407,6 +1407,23 @@ export class PostSummonMessageAbAttr extends PostSummonAbAttr { } } +export class PostSummonUnnamedMessageAbAttr extends PostSummonAbAttr { + //Attr doesn't force pokemon name on the message + private message: string; + + constructor(message: string) { + super(true); + + this.message = message; + } + + applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean { + pokemon.scene.queueMessage(this.message); + + return true; + } +} + export class PostSummonAddBattlerTagAbAttr extends PostSummonAbAttr { private tagType: BattlerTagType; private turnCount: integer; @@ -3061,7 +3078,8 @@ export function initAbilities() { .attr(BlockCritAbAttr) .ignorable(), new Ability(Abilities.AIR_LOCK, 3) - .attr(SuppressWeatherEffectAbAttr, true), + .attr(SuppressWeatherEffectAbAttr, true) + .attr(PostSummonUnnamedMessageAbAttr, "The effects of the weather disappeared."), new Ability(Abilities.TANGLED_FEET, 4) .conditionalAttr(pokemon => !!pokemon.getTag(BattlerTagType.CONFUSED), BattleStatMultiplierAbAttr, BattleStat.EVA, 2) .ignorable(),