From f8e7a685ef93cafcede480682ee8bc75762b779c Mon Sep 17 00:00:00 2001 From: Reldnahc Date: Sun, 5 May 2024 13:57:39 -0500 Subject: [PATCH] remove stall attribute. --- src/data/ability.ts | 14 +------------- src/phases.ts | 8 +++----- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 97e060052..b33d27da7 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2472,17 +2472,6 @@ export class NoFusionAbilityAbAttr extends AbAttr { } } -export class StallAbAttr extends AbAttr { - constructor() { - super(false); - } - - apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { - args[0].value = true; - return true; - } -} - function applyAbAttrsInternal(attrType: { new(...args: any[]): TAttr }, pokemon: Pokemon, applyFunc: AbAttrApplyFunc, args: any[], isAsync: boolean = false, showAbilityInstant: boolean = false, quiet: boolean = false, passive: boolean = false): Promise { return new Promise(resolve => { @@ -2957,8 +2946,7 @@ export function initAbilities() { new Ability(Abilities.NO_GUARD, 4) .attr(AlwaysHitAbAttr) .attr(DoubleBattleChanceAbAttr), - new Ability(Abilities.STALL, 4) - .attr(StallAbAttr), + new Ability(Abilities.STALL, 4), new Ability(Abilities.TECHNICIAN, 4) .attr(MovePowerBoostAbAttr, (user, target, move) => move.power <= 60, 1.5), new Ability(Abilities.LEAF_GUARD, 4) diff --git a/src/phases.ts b/src/phases.ts index e393041f3..26ef52b64 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -591,12 +591,10 @@ export abstract class FieldPhase extends BattlePhase { orderedTargets = orderedTargets.reverse(); orderedTargets.sort((a: Pokemon, b: Pokemon) => { - const aStall = new Utils.BooleanHolder(false); - applyAbAttrs(StallAbAttr, a, null, aStall); - const bStall = new Utils.BooleanHolder(false); - applyAbAttrs(StallAbAttr, b, null, bStall); + const aStall = a.hasAbility(Abilities.STALL); + const bStall = b.hasAbility(Abilities.STALL); - return aStall.value === bStall.value ? 0 : aStall.value ? 1 : -1; + return aStall === bStall ? 0 : aStall ? 1 : -1; }); return orderedTargets.map(t => t.getFieldIndex() + (!t.isPlayer() ? BattlerIndex.ENEMY : 0));