From f1b05174a1f936c562fe608847832060c31e7827 Mon Sep 17 00:00:00 2001 From: Tiduzz Date: Sun, 12 May 2024 18:22:17 -0300 Subject: [PATCH] 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. --- src/data/ability.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index a6f75487b7a..0d9fe53bf90 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -1368,6 +1368,23 @@ export class PostSummonMessageAbAttr extends PostSummonAbAttr { } } +export class PostSummonUnnamedMessageAbAttr extends PostSummonAbAttr { + //Attr doesn't force pokemon name on the message + private messageFunc: string; + + constructor(messageFunc: string) { + super(true); + + this.messageFunc = messageFunc; + } + + applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean { + pokemon.scene.queueMessage(this.messageFunc); + + return true; + } +} + export class PostSummonAddBattlerTagAbAttr extends PostSummonAbAttr { private tagType: BattlerTagType; private turnCount: integer; @@ -2975,7 +2992,7 @@ export function initAbilities() { .ignorable(), new Ability(Abilities.AIR_LOCK, 3) .attr(SuppressWeatherEffectAbAttr, true) - .attr(PostSummonMessageAbAttr, (pokemon: Pokemon) => getPokemonMessage(pokemon, ' is suppressing the weather effects!')), + .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(),