From 82f9931e47153d9fb613161d87ded826ed7e4dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bastos=20Dias?= Date: Tue, 7 Jan 2025 10:35:31 +0000 Subject: [PATCH] Refactor single-use abilities --- data/abilities.ts | 12 ++++++------ sim/pokemon.ts | 3 --- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/data/abilities.ts b/data/abilities.ts index 8048f5204e6c..07961e07fd5d 100644 --- a/data/abilities.ts +++ b/data/abilities.ts @@ -852,8 +852,8 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { }, dauntlessshield: { onStart(pokemon) { - if (pokemon.shieldBoost) return; - pokemon.shieldBoost = true; + if (pokemon.abilityState.shieldBoost) return; + pokemon.abilityState.shieldBoost = true; this.boost({def: 1}, pokemon); }, flags: {}, @@ -2170,8 +2170,8 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { }, intrepidsword: { onStart(pokemon) { - if (pokemon.swordBoost) return; - pokemon.swordBoost = true; + if (pokemon.abilityState.swordBoost) return; + pokemon.abilityState.swordBoost = true; this.boost({atk: 1}, pokemon); }, flags: {}, @@ -4623,8 +4623,8 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { }, supersweetsyrup: { onStart(pokemon) { - if (pokemon.syrupTriggered) return; - pokemon.syrupTriggered = true; + if (pokemon.abilityState.syrupTriggered) return; + pokemon.abilityState.syrupTriggered = true; this.add('-ability', pokemon, 'Supersweet Syrup'); for (const target of pokemon.adjacentFoes()) { if (target.volatiles['substitute']) { diff --git a/sim/pokemon.ts b/sim/pokemon.ts index bb954c86b7d5..da44345f73ea 100644 --- a/sim/pokemon.ts +++ b/sim/pokemon.ts @@ -239,9 +239,6 @@ export class Pokemon { previouslySwitchedIn: number; truantTurn: boolean; // Gen 9 only - swordBoost: boolean; - shieldBoost: boolean; - syrupTriggered: boolean; stellarBoostedTypes: string[]; /** Have this pokemon's Start events run yet? (Start events run every switch-in) */