mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-05-04 15:34:16 +01:00
[Bug] Fix message for StatusEffectImmunityAbAttr
(#5701)
Use class var for getTriggerMessage
This commit is contained in:
parent
423bab1057
commit
ab7d010a17
@ -3172,6 +3172,7 @@ export class PreSetStatusAbAttr extends AbAttr {
|
|||||||
*/
|
*/
|
||||||
export class PreSetStatusEffectImmunityAbAttr extends PreSetStatusAbAttr {
|
export class PreSetStatusEffectImmunityAbAttr extends PreSetStatusAbAttr {
|
||||||
protected immuneEffects: StatusEffect[];
|
protected immuneEffects: StatusEffect[];
|
||||||
|
private lastEffect: StatusEffect;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param immuneEffects - The status effects to which the Pokémon is immune.
|
* @param immuneEffects - The status effects to which the Pokémon is immune.
|
||||||
@ -3197,6 +3198,7 @@ export class PreSetStatusEffectImmunityAbAttr extends PreSetStatusAbAttr {
|
|||||||
*/
|
*/
|
||||||
override applyPreSetStatus(pokemon: Pokemon, passive: boolean, simulated: boolean, effect: StatusEffect, cancelled: BooleanHolder, args: any[]): void {
|
override applyPreSetStatus(pokemon: Pokemon, passive: boolean, simulated: boolean, effect: StatusEffect, cancelled: BooleanHolder, args: any[]): void {
|
||||||
cancelled.value = true;
|
cancelled.value = true;
|
||||||
|
this.lastEffect = effect;
|
||||||
}
|
}
|
||||||
|
|
||||||
getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string {
|
getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string {
|
||||||
@ -3204,7 +3206,7 @@ export class PreSetStatusEffectImmunityAbAttr extends PreSetStatusAbAttr {
|
|||||||
i18next.t("abilityTriggers:statusEffectImmunityWithName", {
|
i18next.t("abilityTriggers:statusEffectImmunityWithName", {
|
||||||
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon),
|
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon),
|
||||||
abilityName,
|
abilityName,
|
||||||
statusEffectName: getStatusEffectDescriptor(args[0] as StatusEffect)
|
statusEffectName: getStatusEffectDescriptor(this.lastEffect)
|
||||||
}) :
|
}) :
|
||||||
i18next.t("abilityTriggers:statusEffectImmunity", {
|
i18next.t("abilityTriggers:statusEffectImmunity", {
|
||||||
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon),
|
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user