Implement StatusEffect[] change suggested by @happinyz
parent
66fcc00e1f
commit
77dd1262d9
|
@ -2400,17 +2400,15 @@ export class ReduceStatusEffectDurationAbAttr extends AbAttr {
|
|||
|
||||
export class HealFromStatusAbAttr extends AbAttr {
|
||||
private healRatio: integer
|
||||
private statusEffect: StatusEffect;
|
||||
private statusEffect2: StatusEffect;
|
||||
constructor(healRatio: integer,statusEffect: StatusEffect,statusEffect2: StatusEffect) {
|
||||
private statusEffects: StatusEffect[];
|
||||
constructor(healRatio: integer,statusEffects: StatusEffect[]) {
|
||||
super();
|
||||
this.healRatio = healRatio;
|
||||
this.statusEffect = statusEffect;
|
||||
this.statusEffect2 = statusEffect2;
|
||||
this.statusEffects = statusEffects;
|
||||
}
|
||||
|
||||
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean | Promise<boolean> {
|
||||
if (pokemon.status.effect === this.statusEffect || pokemon.status.effect === this.statusEffect2) {
|
||||
if (this.statusEffects.includes(pokemon.status.effect)) {
|
||||
let healAmount: integer = Math.floor(pokemon.getMaxHp()*(this.healRatio/8));
|
||||
pokemon.heal(healAmount);
|
||||
pokemon.status.incrementTurn();
|
||||
|
@ -3037,7 +3035,7 @@ export function initAbilities() {
|
|||
new Ability(Abilities.IRON_FIST, 4)
|
||||
.attr(MovePowerBoostAbAttr, (user, target, move) => move.hasFlag(MoveFlags.PUNCHING_MOVE), 1.2),
|
||||
new Ability(Abilities.POISON_HEAL, 4)
|
||||
.attr(HealFromStatusAbAttr,1,StatusEffect.POISON,StatusEffect.TOXIC),
|
||||
.attr(HealFromStatusAbAttr,1,[StatusEffect.POISON,StatusEffect.TOXIC]),
|
||||
new Ability(Abilities.ADAPTABILITY, 4)
|
||||
.attr(StabBoostAbAttr),
|
||||
new Ability(Abilities.SKILL_LINK, 4)
|
||||
|
|
Loading…
Reference in New Issue