Shortened Code
Shortened code to better match Flower Veil implementationpull/753/head
parent
662da02042
commit
bd44d1ab4c
|
@ -1675,28 +1675,7 @@ export class StatusEffectImmunityAbAttr extends PreSetStatusAbAttr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class AllyStatusEffectImmunityAbAttr extends PreSetStatusAbAttr {
|
export class AllyStatusEffectImmunityAbAttr extends StatusEffectImmunityAbAttr { }
|
||||||
private immuneEffects: StatusEffect[];
|
|
||||||
|
|
||||||
constructor(...immuneEffects: StatusEffect[]) {
|
|
||||||
super();
|
|
||||||
|
|
||||||
this.immuneEffects = immuneEffects;
|
|
||||||
}
|
|
||||||
|
|
||||||
applyPreSetStatus(pokemon: Pokemon, passive: boolean, effect: StatusEffect, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
|
||||||
if (!this.immuneEffects.length || this.immuneEffects.indexOf(effect) > -1) {
|
|
||||||
cancelled.value = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string {
|
|
||||||
return getPokemonMessage(pokemon, `'s ${abilityName}\nprevents ${this.immuneEffects.length ? getStatusEffectDescriptor(args[0] as StatusEffect) : 'status problems'}!`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class PreApplyBattlerTagAbAttr extends AbAttr {
|
export class PreApplyBattlerTagAbAttr extends AbAttr {
|
||||||
applyPreApplyBattlerTag(pokemon: Pokemon, passive: boolean, tag: BattlerTag, cancelled: Utils.BooleanHolder, args: any[]): boolean | Promise<boolean> {
|
applyPreApplyBattlerTag(pokemon: Pokemon, passive: boolean, tag: BattlerTag, cancelled: Utils.BooleanHolder, args: any[]): boolean | Promise<boolean> {
|
||||||
|
@ -1727,28 +1706,7 @@ export class BattlerTagImmunityAbAttr extends PreApplyBattlerTagAbAttr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class AllyBattlerTagImmunityAbAttr extends PreApplyBattlerTagAbAttr {
|
export class AllyBattlerTagImmunityAbAttr extends BattlerTagImmunityAbAttr { }
|
||||||
private immuneTagType: BattlerTagType;
|
|
||||||
|
|
||||||
constructor(immuneTagType: BattlerTagType) {
|
|
||||||
super();
|
|
||||||
|
|
||||||
this.immuneTagType = immuneTagType;
|
|
||||||
}
|
|
||||||
|
|
||||||
applyPreApplyBattlerTag(pokemon: Pokemon, passive: boolean, tag: BattlerTag, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
|
||||||
if (tag.tagType === this.immuneTagType) {
|
|
||||||
cancelled.value = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string {
|
|
||||||
return getPokemonMessage(pokemon, `'s ${abilityName}\nprevents ${(args[0] as BattlerTag).getDescriptor()}!`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class BlockCritAbAttr extends AbAttr {
|
export class BlockCritAbAttr extends AbAttr {
|
||||||
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
||||||
|
|
Loading…
Reference in New Issue