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 2a3152003b.

* Changed message variable name
pull/841/head^2
Douglas Marchione de Souza 2024-05-13 22:09:46 -03:00 committed by GitHub
parent 7943633481
commit de3ca08704
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 19 additions and 1 deletions

View File

@ -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 { export class PostSummonAddBattlerTagAbAttr extends PostSummonAbAttr {
private tagType: BattlerTagType; private tagType: BattlerTagType;
private turnCount: integer; private turnCount: integer;
@ -3061,7 +3078,8 @@ export function initAbilities() {
.attr(BlockCritAbAttr) .attr(BlockCritAbAttr)
.ignorable(), .ignorable(),
new Ability(Abilities.AIR_LOCK, 3) 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) new Ability(Abilities.TANGLED_FEET, 4)
.conditionalAttr(pokemon => !!pokemon.getTag(BattlerTagType.CONFUSED), BattleStatMultiplierAbAttr, BattleStat.EVA, 2) .conditionalAttr(pokemon => !!pokemon.getTag(BattlerTagType.CONFUSED), BattleStatMultiplierAbAttr, BattleStat.EVA, 2)
.ignorable(), .ignorable(),