From ff44cbfa97b834bfbb9172ceef5abce1d9cec13d Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Tue, 15 Apr 2025 09:08:35 -0500 Subject: [PATCH] [Refactor] Refactor ability file part 1 (#5589) * Move ability.ts to subfolder * Extract types out of ability.ts * Update imports in ability.ts and friends * Cleanup imports in ability.ts * Re-add imports lost during sort * Update imports forgotten during rebase * Re-import proper type from enums * Update biome.jsonc Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Add commit to force tests to rerun --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- biome.jsonc | 2 +- src/@types/ability-types.ts | 11 + src/battle-scene.ts | 4 +- src/data/abilities/ab-attrs/ab-attr.ts | 54 ++++ src/data/abilities/ability-class.ts | 137 +++++++++ src/data/{ => abilities}/ability.ts | 266 ++++-------------- src/data/arena-tag.ts | 2 +- src/data/battler-tags.ts | 4 +- src/data/berry.ts | 2 +- src/data/data-lists.ts | 3 + src/data/moves/move.ts | 4 +- .../encounters/clowning-around-encounter.ts | 2 +- .../encounters/fiery-fallout-encounter.ts | 2 +- .../the-winstrate-challenge-encounter.ts | 2 +- .../encounters/training-session-encounter.ts | 4 +- .../mystery-encounter-requirements.ts | 2 +- src/data/weather.ts | 2 +- src/field/arena.ts | 2 +- src/field/pokemon.ts | 7 +- src/loading-scene.ts | 2 +- src/modifier/modifier.ts | 2 +- src/phases/attempt-run-phase.ts | 7 +- src/phases/battle-end-phase.ts | 2 +- src/phases/berry-phase.ts | 2 +- src/phases/encounter-phase.ts | 2 +- src/phases/faint-phase.ts | 2 +- src/phases/move-effect-phase.ts | 2 +- src/phases/move-end-phase.ts | 2 +- src/phases/move-phase.ts | 2 +- src/phases/new-biome-encounter-phase.ts | 2 +- src/phases/obtain-status-effect-phase.ts | 2 +- src/phases/post-summon-phase.ts | 2 +- src/phases/post-turn-status-effect-phase.ts | 2 +- src/phases/quiet-form-change-phase.ts | 2 +- src/phases/stat-stage-change-phase.ts | 2 +- src/phases/summon-phase.ts | 2 +- src/phases/switch-summon-phase.ts | 2 +- src/phases/turn-end-phase.ts | 2 +- src/phases/turn-start-phase.ts | 2 +- src/phases/weather-effect-phase.ts | 2 +- src/ui/pokedex-page-ui-handler.ts | 2 +- src/ui/pokedex-scan-ui-handler.ts | 2 +- src/ui/pokedex-ui-handler.ts | 2 +- src/ui/starter-select-ui-handler.ts | 4 +- src/ui/summary-ui-handler.ts | 2 +- test/abilities/arena_trap.test.ts | 2 +- test/abilities/flower_gift.test.ts | 2 +- test/abilities/flower_veil.test.ts | 2 +- test/abilities/forecast.test.ts | 2 +- test/abilities/friend_guard.test.ts | 2 +- test/abilities/good_as_gold.test.ts | 2 +- test/abilities/magic_bounce.test.ts | 2 +- test/abilities/neutralizing_gas.test.ts | 2 +- test/abilities/quick_draw.test.ts | 3 +- test/abilities/sand_veil.test.ts | 3 +- test/abilities/shield_dust.test.ts | 2 +- test/abilities/steely_spirit.test.ts | 2 +- test/abilities/unburden.test.ts | 2 +- test/battle/ability_swap.test.ts | 2 +- test/moves/flame_burst.test.ts | 2 +- test/moves/pledge_moves.test.ts | 2 +- test/moves/safeguard.test.ts | 3 +- test/moves/secret_power.test.ts | 3 +- test/testUtils/testFileInitialization.ts | 2 +- 64 files changed, 337 insertions(+), 276 deletions(-) create mode 100644 src/@types/ability-types.ts create mode 100644 src/data/abilities/ab-attrs/ab-attr.ts create mode 100644 src/data/abilities/ability-class.ts rename src/data/{ => abilities}/ability.ts (97%) create mode 100644 src/data/data-lists.ts diff --git a/biome.jsonc b/biome.jsonc index da80d8ee127..9d0e6a9b5ff 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -31,7 +31,7 @@ "src/overrides.ts", // TODO: these files are too big and complex, ignore them until their respective refactors "src/data/moves/move.ts", - "src/data/ability.ts", + "src/data/abilities/ability.ts", "src/field/pokemon.ts", // this file is just too big: diff --git a/src/@types/ability-types.ts b/src/@types/ability-types.ts new file mode 100644 index 00000000000..5d21aaaa844 --- /dev/null +++ b/src/@types/ability-types.ts @@ -0,0 +1,11 @@ +import type { AbAttr } from "#app/data/abilities/ab-attrs/ab-attr"; +import type Move from "#app/data/moves/move"; +import type Pokemon from "#app/field/pokemon"; +import type { BattleStat } from "#enums/stat"; + +export type AbAttrApplyFunc = (attr: TAttr, passive: boolean) => void; +export type AbAttrSuccessFunc = (attr: TAttr, passive: boolean) => boolean; +export type AbAttrCondition = (pokemon: Pokemon) => boolean; +export type PokemonAttackCondition = (user: Pokemon | null, target: Pokemon | null, move: Move) => boolean; +export type PokemonDefendCondition = (target: Pokemon, user: Pokemon, move: Move) => boolean; +export type PokemonStatStageChangeCondition = (target: Pokemon, statsChanged: BattleStat[], stages: number) => boolean; diff --git a/src/battle-scene.ts b/src/battle-scene.ts index dd983f2b397..90f53d6a95e 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -67,7 +67,6 @@ import { } from "#app/modifier/modifier-type"; import AbilityBar from "#app/ui/ability-bar"; import { - allAbilities, applyAbAttrs, applyPostBattleInitAbAttrs, applyPostItemLostAbAttrs, @@ -75,7 +74,8 @@ import { DoubleBattleChanceAbAttr, PostBattleInitAbAttr, PostItemLostAbAttr, -} from "#app/data/ability"; +} from "#app/data/abilities/ability"; +import { allAbilities } from "./data/data-lists"; import type { FixedBattleConfig } from "#app/battle"; import Battle, { BattleType } from "#app/battle"; import type { GameMode } from "#app/game-mode"; diff --git a/src/data/abilities/ab-attrs/ab-attr.ts b/src/data/abilities/ab-attrs/ab-attr.ts new file mode 100644 index 00000000000..c8ead691b25 --- /dev/null +++ b/src/data/abilities/ab-attrs/ab-attr.ts @@ -0,0 +1,54 @@ +import type { AbAttrCondition } from "#app/@types/ability-types"; +import type Pokemon from "#app/field/pokemon"; +import type * as Utils from "#app/utils"; + +export abstract class AbAttr { + public showAbility: boolean; + private extraCondition: AbAttrCondition; + + constructor(showAbility = true) { + this.showAbility = showAbility; + } + + /** + * Applies ability effects without checking conditions + * @param _pokemon - The pokemon to apply this ability to + * @param _passive - Whether or not the ability is a passive + * @param _simulated - Whether the call is simulated + * @param _args - Extra args passed to the function. Handled by child classes. + * @see {@linkcode canApply} + */ + apply( + _pokemon: Pokemon, + _passive: boolean, + _simulated: boolean, + _cancelled: Utils.BooleanHolder | null, + _args: any[], + ): void {} + + getTriggerMessage(_pokemon: Pokemon, _abilityName: string, ..._args: any[]): string | null { + return null; + } + + getCondition(): AbAttrCondition | null { + return this.extraCondition || null; + } + + addCondition(condition: AbAttrCondition): AbAttr { + this.extraCondition = condition; + return this; + } + + /** + * Returns a boolean describing whether the ability can be applied under current conditions + * @param _pokemon - The pokemon to apply this ability to + * @param _passive - Whether or not the ability is a passive + * @param _simulated - Whether the call is simulated + * @param _args - Extra args passed to the function. Handled by child classes. + * @returns `true` if the ability can be applied, `false` otherwise + * @see {@linkcode apply} + */ + canApply(_pokemon: Pokemon, _passive: boolean, _simulated: boolean, _args: any[]): boolean { + return true; + } +} diff --git a/src/data/abilities/ability-class.ts b/src/data/abilities/ability-class.ts new file mode 100644 index 00000000000..b4cda2482d4 --- /dev/null +++ b/src/data/abilities/ability-class.ts @@ -0,0 +1,137 @@ +import { Abilities } from "#enums/abilities"; +import type { AbAttrCondition } from "#app/@types/ability-types"; +import type { AbAttr } from "#app/data/abilities/ab-attrs/ab-attr"; +import i18next from "i18next"; +import type { Localizable } from "#app/interfaces/locales"; +import type { Constructor } from "#app/utils"; + +export class Ability implements Localizable { + public id: Abilities; + + private nameAppend: string; + public name: string; + public description: string; + public generation: number; + public isBypassFaint: boolean; + public isIgnorable: boolean; + public isSuppressable = true; + public isCopiable = true; + public isReplaceable = true; + public attrs: AbAttr[]; + public conditions: AbAttrCondition[]; + + constructor(id: Abilities, generation: number) { + this.id = id; + + this.nameAppend = ""; + this.generation = generation; + this.attrs = []; + this.conditions = []; + + this.isSuppressable = true; + this.isCopiable = true; + this.isReplaceable = true; + + this.localize(); + } + + public get isSwappable(): boolean { + return this.isCopiable && this.isReplaceable; + } + localize(): void { + const i18nKey = Abilities[this.id] + .split("_") + .filter(f => f) + .map((f, i) => (i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase())) + .join("") as string; + + this.name = this.id ? `${i18next.t(`ability:${i18nKey}.name`) as string}${this.nameAppend}` : ""; + this.description = this.id ? (i18next.t(`ability:${i18nKey}.description`) as string) : ""; + } + + /** + * Get all ability attributes that match `attrType` + * @param attrType any attribute that extends {@linkcode AbAttr} + * @returns Array of attributes that match `attrType`, Empty Array if none match. + */ + getAttrs(attrType: Constructor): T[] { + return this.attrs.filter((a): a is T => a instanceof attrType); + } + + /** + * Check if an ability has an attribute that matches `attrType` + * @param attrType any attribute that extends {@linkcode AbAttr} + * @returns true if the ability has attribute `attrType` + */ + hasAttr(attrType: Constructor): boolean { + return this.attrs.some(attr => attr instanceof attrType); + } + + attr>(AttrType: T, ...args: ConstructorParameters): Ability { + const attr = new AttrType(...args); + this.attrs.push(attr); + + return this; + } + + conditionalAttr>( + condition: AbAttrCondition, + AttrType: T, + ...args: ConstructorParameters + ): Ability { + const attr = new AttrType(...args); + attr.addCondition(condition); + this.attrs.push(attr); + + return this; + } + + bypassFaint(): Ability { + this.isBypassFaint = true; + return this; + } + + ignorable(): Ability { + this.isIgnorable = true; + return this; + } + + unsuppressable(): Ability { + this.isSuppressable = false; + return this; + } + + uncopiable(): Ability { + this.isCopiable = false; + return this; + } + + unreplaceable(): Ability { + this.isReplaceable = false; + return this; + } + + condition(condition: AbAttrCondition): Ability { + this.conditions.push(condition); + + return this; + } + + partial(): this { + this.nameAppend += " (P)"; + return this; + } + + unimplemented(): this { + this.nameAppend += " (N)"; + return this; + } + + /** + * Internal flag used for developers to document edge cases. When using this, please be sure to document the edge case. + * @returns the ability + */ + edgeCase(): this { + return this; + } +} diff --git a/src/data/ability.ts b/src/data/abilities/ability.ts similarity index 97% rename from src/data/ability.ts rename to src/data/abilities/ability.ts index 3e32a624f9f..17a8eddf47f 100644 --- a/src/data/ability.ts +++ b/src/data/abilities/ability.ts @@ -1,228 +1,75 @@ -import type { EnemyPokemon, PokemonMove } from "../field/pokemon"; -import type Pokemon from "../field/pokemon"; -import { HitResult, MoveResult, PlayerPokemon } from "../field/pokemon"; -import { PokemonType } from "#enums/pokemon-type"; +import { HitResult, MoveResult, PlayerPokemon } from "#app/field/pokemon"; import { BooleanHolder, NumberHolder, toDmgValue, isNullOrUndefined, randSeedItem, randSeedInt, type Constructor } from "#app/utils"; -import { getPokemonNameWithAffix } from "../messages"; -import type { Weather } from "#app/data/weather"; -import type { BattlerTag } from "./battler-tags"; -import { BattlerTagLapseType, GroundedTag } from "./battler-tags"; +import { getPokemonNameWithAffix } from "#app/messages"; +import { BattlerTagLapseType, GroundedTag } from "#app/data/battler-tags"; import { getNonVolatileStatusEffects, getStatusEffectDescriptor, getStatusEffectHealText } from "#app/data/status-effect"; -import { Gender } from "./gender"; -import type Move from "./moves/move"; -import { AttackMove, FlinchAttr, OneHitKOAttr, HitHealAttr, allMoves, StatusMove, SelfStatusMove, VariablePowerAttr, applyMoveAttrs, VariableMoveTypeAttr, RandomMovesetMoveAttr, RandomMoveAttr, NaturePowerAttr, CopyMoveAttr, NeutralDamageAgainstFlyingTypeMultiplierAttr, FixedDamageAttr } from "./moves/move"; -import { MoveFlags } from "#enums/MoveFlags"; -import { MoveTarget } from "#enums/MoveTarget"; -import { MoveCategory } from "#enums/MoveCategory"; -import type { ArenaTrapTag, SuppressAbilitiesTag } from "./arena-tag"; -import { ArenaTagSide } from "./arena-tag"; -import { BerryModifier, HitHealModifier, PokemonHeldItemModifier } from "../modifier/modifier"; -import { TerrainType } from "./terrain"; -import { SpeciesFormChangeAbilityTrigger, SpeciesFormChangeRevertWeatherFormTrigger, SpeciesFormChangeWeatherTrigger } from "./pokemon-forms"; +import { Gender } from "#app/data/gender"; +import { + AttackMove, + FlinchAttr, + OneHitKOAttr, + HitHealAttr, + allMoves, + StatusMove, + SelfStatusMove, + VariablePowerAttr, + applyMoveAttrs, + VariableMoveTypeAttr, + RandomMovesetMoveAttr, + RandomMoveAttr, + NaturePowerAttr, + CopyMoveAttr, + NeutralDamageAgainstFlyingTypeMultiplierAttr, + FixedDamageAttr, +} from "#app/data/moves/move"; +import { ArenaTagSide } from "#app/data/arena-tag"; +import { BerryModifier, HitHealModifier, PokemonHeldItemModifier } from "#app/modifier/modifier"; +import { TerrainType } from "#app/data/terrain"; +import { SpeciesFormChangeAbilityTrigger, SpeciesFormChangeRevertWeatherFormTrigger, SpeciesFormChangeWeatherTrigger } from "#app/data/pokemon-forms"; import i18next from "i18next"; -import type { Localizable } from "#app/interfaces/locales"; -import { Command } from "../ui/command-ui-handler"; +import { Command } from "#app/ui/command-ui-handler"; import { BerryModifierType } from "#app/modifier/modifier-type"; -import { getPokeballName } from "./pokeball"; -import type { BattlerIndex } from "#app/battle"; +import { getPokeballName } from "#app/data/pokeball"; import { BattleType } from "#app/battle"; -import { Abilities } from "#enums/abilities"; -import { ArenaTagType } from "#enums/arena-tag-type"; -import { BattlerTagType } from "#enums/battler-tag-type"; -import { Moves } from "#enums/moves"; -import { Species } from "#enums/species"; -import { Stat, type BattleStat, type EffectiveStat, BATTLE_STATS, EFFECTIVE_STATS, getStatKey } from "#app/enums/stat"; import { MovePhase } from "#app/phases/move-phase"; import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase"; import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; import { globalScene } from "#app/global-scene"; -import { SwitchType } from "#app/enums/switch-type"; import { SwitchPhase } from "#app/phases/switch-phase"; import { SwitchSummonPhase } from "#app/phases/switch-summon-phase"; import { BattleEndPhase } from "#app/phases/battle-end-phase"; import { NewBattlePhase } from "#app/phases/new-battle-phase"; import { MoveEndPhase } from "#app/phases/move-end-phase"; +import { PokemonTransformPhase } from "#app/phases/pokemon-transform-phase"; +import { allAbilities } from "#app/data/data-lists"; +import { AbAttr } from "#app/data/abilities/ab-attrs/ab-attr"; +import { Ability } from "#app/data/abilities/ability-class"; + +// Enum imports +import { Stat, type BattleStat , BATTLE_STATS, EFFECTIVE_STATS, getStatKey, type EffectiveStat } from "#enums/stat"; +import { PokemonType } from "#enums/pokemon-type"; import { PokemonAnimType } from "#enums/pokemon-anim-type"; import { StatusEffect } from "#enums/status-effect"; import { WeatherType } from "#enums/weather-type"; -import { PokemonTransformPhase } from "#app/phases/pokemon-transform-phase"; +import { Abilities } from "#enums/abilities"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import { SwitchType } from "#enums/switch-type"; +import { MoveFlags } from "#enums/MoveFlags"; +import { MoveTarget } from "#enums/MoveTarget"; +import { MoveCategory } from "#enums/MoveCategory"; -export class Ability implements Localizable { - public id: Abilities; - - private nameAppend: string; - public name: string; - public description: string; - public generation: number; - public isBypassFaint: boolean; - public isIgnorable: boolean; - public isSuppressable = true; - public isCopiable = true; - public isReplaceable = true; - public attrs: AbAttr[]; - public conditions: AbAttrCondition[]; - - constructor(id: Abilities, generation: number) { - this.id = id; - - this.nameAppend = ""; - this.generation = generation; - this.attrs = []; - this.conditions = []; - - this.isSuppressable = true; - this.isCopiable = true; - this.isReplaceable = true; - - this.localize(); - } - - public get isSwappable(): boolean { - return this.isCopiable && this.isReplaceable; - } - localize(): void { - const i18nKey = Abilities[this.id].split("_").filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join("") as string; - - this.name = this.id ? `${i18next.t(`ability:${i18nKey}.name`) as string}${this.nameAppend}` : ""; - this.description = this.id ? i18next.t(`ability:${i18nKey}.description`) as string : ""; - } - - /** - * Get all ability attributes that match `attrType` - * @param attrType any attribute that extends {@linkcode AbAttr} - * @returns Array of attributes that match `attrType`, Empty Array if none match. - */ - getAttrs(attrType: Constructor ): T[] { - return this.attrs.filter((a): a is T => a instanceof attrType); - } - - /** - * Check if an ability has an attribute that matches `attrType` - * @param attrType any attribute that extends {@linkcode AbAttr} - * @returns true if the ability has attribute `attrType` - */ - hasAttr(attrType: Constructor): boolean { - return this.attrs.some((attr) => attr instanceof attrType); - } - - attr>(AttrType: T, ...args: ConstructorParameters): Ability { - const attr = new AttrType(...args); - this.attrs.push(attr); - - return this; - } - - conditionalAttr>(condition: AbAttrCondition, AttrType: T, ...args: ConstructorParameters): Ability { - const attr = new AttrType(...args); - attr.addCondition(condition); - this.attrs.push(attr); - - return this; - } - - bypassFaint(): Ability { - this.isBypassFaint = true; - return this; - } - - ignorable(): Ability { - this.isIgnorable = true; - return this; - } - - unsuppressable(): Ability { - this.isSuppressable = false; - return this; - } - - uncopiable(): Ability { - this.isCopiable = false; - return this; - } - - unreplaceable(): Ability { - this.isReplaceable = false; - return this; - } - - condition(condition: AbAttrCondition): Ability { - this.conditions.push(condition); - - return this; - } - - partial(): this { - this.nameAppend += " (P)"; - return this; - } - - unimplemented(): this { - this.nameAppend += " (N)"; - return this; - } - - /** - * Internal flag used for developers to document edge cases. When using this, please be sure to document the edge case. - * @returns the ability - */ - edgeCase(): this { - return this; - } -} - -type AbAttrApplyFunc = (attr: TAttr, passive: boolean) => void; -type AbAttrSuccessFunc = (attr: TAttr, passive: boolean) => boolean; -type AbAttrCondition = (pokemon: Pokemon) => boolean; - -// TODO: Can this be improved? -type PokemonAttackCondition = (user: Pokemon | null, target: Pokemon | null, move: Move) => boolean; -type PokemonDefendCondition = (target: Pokemon, user: Pokemon, move: Move) => boolean; -type PokemonStatStageChangeCondition = (target: Pokemon, statsChanged: BattleStat[], stages: number) => boolean; - -export abstract class AbAttr { - public showAbility: boolean; - private extraCondition: AbAttrCondition; - - constructor(showAbility = true) { - this.showAbility = showAbility; - } - - /** - * Applies ability effects without checking conditions - * @param pokemon - The pokemon to apply this ability to - * @param passive - Whether or not the ability is a passive - * @param simulated - Whether the call is simulated - * @param args - Extra args passed to the function. Handled by child classes. - * @see {@linkcode canApply} - */ - apply(pokemon: Pokemon, passive: boolean, simulated: boolean, cancelled: BooleanHolder | null, args: any[]): void {} - - getTriggerMessage(_pokemon: Pokemon, _abilityName: string, ..._args: any[]): string | null { - return null; - } - - getCondition(): AbAttrCondition | null { - return this.extraCondition || null; - } - - addCondition(condition: AbAttrCondition): AbAttr { - this.extraCondition = condition; - return this; - } - - /** - * Returns a boolean describing whether the ability can be applied under current conditions - * @param pokemon - The pokemon to apply this ability to - * @param passive - Whether or not the ability is a passive - * @param simulated - Whether the call is simulated - * @param args - Extra args passed to the function. Handled by child classes. - * @returns `true` if the ability can be applied, `false` otherwise - * @see {@linkcode apply} - */ - canApply(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean { - return true; - } -} +// Type imports +import type { EnemyPokemon, PokemonMove } from "#app/field/pokemon"; +import type Pokemon from "#app/field/pokemon"; +import type { Weather } from "#app/data/weather"; +import type { BattlerTag } from "#app/data/battler-tags"; +import type { AbAttrCondition, PokemonDefendCondition, PokemonStatStageChangeCondition, PokemonAttackCondition, AbAttrApplyFunc, AbAttrSuccessFunc } from "#app/@types/ability-types"; +import type { BattlerIndex } from "#app/battle"; +import type Move from "#app/data/moves/move"; +import type { ArenaTrapTag, SuppressAbilitiesTag } from "#app/data/arena-tag"; export class BlockRecoilDamageAttr extends AbAttr { constructor() { @@ -233,7 +80,7 @@ export class BlockRecoilDamageAttr extends AbAttr { cancelled.value = true; } - getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]) { + getTriggerMessage(pokemon: Pokemon, abilityName: string, ..._args: any[]) { return i18next.t("abilityTriggers:blockRecoilDamage", { pokemonName: getPokemonNameWithAffix(pokemon), abilityName: abilityName }); } } @@ -6453,10 +6300,9 @@ function getPokemonWithWeatherBasedForms() { ); } -export const allAbilities = [ new Ability(Abilities.NONE, 3) ]; - export function initAbilities() { allAbilities.push( + new Ability(Abilities.NONE, 3), new Ability(Abilities.STENCH, 3) .attr(PostAttackApplyBattlerTagAbAttr, false, (user, target, move) => !move.hasAttr(FlinchAttr) && !move.hitsSubstitute(user, target) ? 10 : 0, BattlerTagType.FLINCHED), new Ability(Abilities.DRIZZLE, 3) diff --git a/src/data/arena-tag.ts b/src/data/arena-tag.ts index 871f622f70a..1fe1eca4bba 100644 --- a/src/data/arena-tag.ts +++ b/src/data/arena-tag.ts @@ -18,7 +18,7 @@ import { applyAbAttrs, applyOnGainAbAttrs, applyOnLoseAbAttrs, -} from "#app/data/ability"; +} from "#app/data/abilities/ability"; import { Stat } from "#enums/stat"; import { CommonAnim, CommonBattleAnim } from "#app/data/battle-anims"; import i18next from "i18next"; diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 76e91485460..401fd9903d1 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -1,13 +1,13 @@ import { globalScene } from "#app/global-scene"; import { - allAbilities, applyAbAttrs, BlockNonDirectDamageAbAttr, FlinchEffectAbAttr, ProtectStatAbAttr, ConditionalUserFieldProtectStatAbAttr, ReverseDrainAbAttr, -} from "#app/data/ability"; +} from "#app/data/abilities/ability"; +import { allAbilities } from "./data-lists"; import { ChargeAnim, CommonAnim, CommonBattleAnim, MoveChargeAnim } from "#app/data/battle-anims"; import type Move from "#app/data/moves/move"; import { diff --git a/src/data/berry.ts b/src/data/berry.ts index 8a58d337aa4..e118b45711c 100644 --- a/src/data/berry.ts +++ b/src/data/berry.ts @@ -9,7 +9,7 @@ import { ReduceBerryUseThresholdAbAttr, applyAbAttrs, applyPostItemLostAbAttrs, -} from "./ability"; +} from "./abilities/ability"; import i18next from "i18next"; import { BattlerTagType } from "#enums/battler-tag-type"; import { BerryType } from "#enums/berry-type"; diff --git a/src/data/data-lists.ts b/src/data/data-lists.ts new file mode 100644 index 00000000000..d3c31abc851 --- /dev/null +++ b/src/data/data-lists.ts @@ -0,0 +1,3 @@ +import type { Ability } from "./abilities/ability-class"; + +export const allAbilities: Ability[] = []; diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index 962a13bb840..b68dd0d3e1d 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -34,7 +34,6 @@ import { WeatherType } from "#enums/weather-type"; import type { ArenaTrapTag } from "../arena-tag"; import { ArenaTagSide, WeakenMoveTypeTag } from "../arena-tag"; import { - allAbilities, AllyMoveCategoryPowerBoostAbAttr, applyAbAttrs, applyPostAttackAbAttrs, @@ -65,7 +64,8 @@ import { UserFieldMoveTypePowerBoostAbAttr, VariableMovePowerAbAttr, WonderSkinAbAttr, -} from "../ability"; +} from "../abilities/ability"; +import { allAbilities } from "../data-lists"; import { AttackTypeBoosterModifier, BerryModifier, diff --git a/src/data/mystery-encounters/encounters/clowning-around-encounter.ts b/src/data/mystery-encounters/encounters/clowning-around-encounter.ts index eca99fc0c13..5edc2e6bbc5 100644 --- a/src/data/mystery-encounters/encounters/clowning-around-encounter.ts +++ b/src/data/mystery-encounters/encounters/clowning-around-encounter.ts @@ -38,7 +38,7 @@ import i18next from "i18next"; import type { OptionSelectConfig } from "#app/ui/abstact-option-select-ui-handler"; import type { PlayerPokemon } from "#app/field/pokemon"; import { PokemonMove } from "#app/field/pokemon"; -import { Ability } from "#app/data/ability"; +import { Ability } from "#app/data/abilities/ability-class"; import { BerryModifier } from "#app/modifier/modifier"; import { BerryType } from "#enums/berry-type"; import { BattlerIndex } from "#app/battle"; diff --git a/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts b/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts index 6118fe3d0de..f0b7a05a21c 100644 --- a/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts +++ b/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts @@ -46,7 +46,7 @@ import { Abilities } from "#enums/abilities"; import { BattlerTagType } from "#enums/battler-tag-type"; import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; import { Stat } from "#enums/stat"; -import { Ability } from "#app/data/ability"; +import { Ability } from "#app/data/abilities/ability-class"; import { FIRE_RESISTANT_ABILITIES } from "#app/data/mystery-encounters/requirements/requirement-groups"; /** the i18n namespace for the encounter */ diff --git a/src/data/mystery-encounters/encounters/the-winstrate-challenge-encounter.ts b/src/data/mystery-encounters/encounters/the-winstrate-challenge-encounter.ts index aca04ad50ed..41bf87351f4 100644 --- a/src/data/mystery-encounters/encounters/the-winstrate-challenge-encounter.ts +++ b/src/data/mystery-encounters/encounters/the-winstrate-challenge-encounter.ts @@ -24,7 +24,7 @@ import { PokemonType } from "#enums/pokemon-type"; import { BerryType } from "#enums/berry-type"; import { Stat } from "#enums/stat"; import { SpeciesFormChangeAbilityTrigger } from "#app/data/pokemon-forms"; -import { applyPostBattleInitAbAttrs, PostBattleInitAbAttr } from "#app/data/ability"; +import { applyPostBattleInitAbAttrs, PostBattleInitAbAttr } from "#app/data/abilities/ability"; import { showEncounterDialogue, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; import { PartyHealPhase } from "#app/phases/party-heal-phase"; diff --git a/src/data/mystery-encounters/encounters/training-session-encounter.ts b/src/data/mystery-encounters/encounters/training-session-encounter.ts index cc56f3efa42..e8711be172d 100644 --- a/src/data/mystery-encounters/encounters/training-session-encounter.ts +++ b/src/data/mystery-encounters/encounters/training-session-encounter.ts @@ -1,5 +1,5 @@ -import type { Ability } from "#app/data/ability"; -import { allAbilities } from "#app/data/ability"; +import type { Ability } from "#app/data/abilities/ability-class"; +import { allAbilities } from "#app/data/data-lists"; import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; import { initBattleWithEnemyConfig, diff --git a/src/data/mystery-encounters/mystery-encounter-requirements.ts b/src/data/mystery-encounters/mystery-encounter-requirements.ts index f9aedf2c1a7..948e3e96ef0 100644 --- a/src/data/mystery-encounters/mystery-encounter-requirements.ts +++ b/src/data/mystery-encounters/mystery-encounter-requirements.ts @@ -1,5 +1,5 @@ import { globalScene } from "#app/global-scene"; -import { allAbilities } from "#app/data/ability"; +import { allAbilities } from "../data-lists"; import { EvolutionItem, pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; import { Nature } from "#enums/nature"; import { FormChangeItem, pokemonFormChanges, SpeciesFormChangeItemTrigger } from "#app/data/pokemon-forms"; diff --git a/src/data/weather.ts b/src/data/weather.ts index a8dd0a66492..31b460bbddb 100644 --- a/src/data/weather.ts +++ b/src/data/weather.ts @@ -6,7 +6,7 @@ import { PokemonType } from "#enums/pokemon-type"; import type Move from "./moves/move"; import { AttackMove } from "./moves/move"; import { randSeedInt } from "#app/utils"; -import { SuppressWeatherEffectAbAttr } from "./ability"; +import { SuppressWeatherEffectAbAttr } from "./abilities/ability"; import { TerrainType, getTerrainName } from "./terrain"; import i18next from "i18next"; import { globalScene } from "#app/global-scene"; diff --git a/src/field/arena.ts b/src/field/arena.ts index adc3123ce81..1bc465c7dbb 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -26,7 +26,7 @@ import { PostTerrainChangeAbAttr, PostWeatherChangeAbAttr, TerrainEventTypeChangeAbAttr, -} from "#app/data/ability"; +} from "#app/data/abilities/ability"; import type Pokemon from "#app/field/pokemon"; import Overrides from "#app/overrides"; import { TagAddedEvent, TagRemovedEvent, TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena"; diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index b59b7ba01fe..22ede4260c3 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -136,7 +136,8 @@ import { WeakenMoveScreenTag, } from "#app/data/arena-tag"; import type { SuppressAbilitiesTag } from "#app/data/arena-tag"; -import type { Ability, AbAttr } from "#app/data/ability"; +import type { Ability } from "#app/data/abilities/ability-class"; +import type { AbAttr } from "#app/data/abilities/ab-attrs/ab-attr"; import { StatMultiplierAbAttr, BlockCritAbAttr, @@ -151,7 +152,6 @@ import { StatusEffectImmunityAbAttr, TypeImmunityAbAttr, WeightMultiplierAbAttr, - allAbilities, applyAbAttrs, applyStatMultiplierAbAttrs, applyPreApplyBattlerTagAbAttrs, @@ -188,7 +188,8 @@ import { applyAllyStatMultiplierAbAttrs, AllyStatMultiplierAbAttr, MoveAbilityBypassAbAttr -} from "#app/data/ability"; +} from "#app/data/abilities/ability"; +import { allAbilities } from "#app/data/data-lists"; import type PokemonData from "#app/system/pokemon-data"; import { BattlerIndex } from "#app/battle"; import { Mode } from "#app/ui/ui"; diff --git a/src/loading-scene.ts b/src/loading-scene.ts index b45cf64ff56..4ec2fdf1bb2 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -11,7 +11,7 @@ import { initEggMoves } from "#app/data/balance/egg-moves"; import { initPokemonForms } from "#app/data/pokemon-forms"; import { initSpecies } from "#app/data/pokemon-species"; import { initMoves } from "#app/data/moves/move"; -import { initAbilities } from "#app/data/ability"; +import { initAbilities } from "#app/data/abilities/ability"; import { initAchievements } from "#app/system/achv"; import { initTrainerTypeDialogue } from "#app/data/dialogue"; import { initChallenges } from "#app/data/challenge"; diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 80f14ba22ce..851fa33cedc 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -47,7 +47,7 @@ import { } from "./modifier-type"; import { Color, ShadowColor } from "#enums/color"; import { FRIENDSHIP_GAIN_FROM_RARE_CANDY } from "#app/data/balance/starters"; -import { applyAbAttrs, CommanderAbAttr } from "#app/data/ability"; +import { applyAbAttrs, CommanderAbAttr } from "#app/data/abilities/ability"; import { globalScene } from "#app/global-scene"; export type ModifierPredicate = (modifier: Modifier) => boolean; diff --git a/src/phases/attempt-run-phase.ts b/src/phases/attempt-run-phase.ts index e5691f5fb8e..5c51e5c589d 100644 --- a/src/phases/attempt-run-phase.ts +++ b/src/phases/attempt-run-phase.ts @@ -1,4 +1,9 @@ -import { applyAbAttrs, applyPreLeaveFieldAbAttrs, PreLeaveFieldAbAttr, RunSuccessAbAttr } from "#app/data/ability"; +import { + applyAbAttrs, + applyPreLeaveFieldAbAttrs, + PreLeaveFieldAbAttr, + RunSuccessAbAttr, +} from "#app/data/abilities/ability"; import { Stat } from "#enums/stat"; import { StatusEffect } from "#enums/status-effect"; import type { PlayerPokemon, EnemyPokemon } from "#app/field/pokemon"; diff --git a/src/phases/battle-end-phase.ts b/src/phases/battle-end-phase.ts index 0d831c65b52..275a9017dfa 100644 --- a/src/phases/battle-end-phase.ts +++ b/src/phases/battle-end-phase.ts @@ -1,5 +1,5 @@ import { globalScene } from "#app/global-scene"; -import { applyPostBattleAbAttrs, PostBattleAbAttr } from "#app/data/ability"; +import { applyPostBattleAbAttrs, PostBattleAbAttr } from "#app/data/abilities/ability"; import { LapsingPersistentModifier, LapsingPokemonHeldItemModifier } from "#app/modifier/modifier"; import { BattlePhase } from "./battle-phase"; import { GameOverPhase } from "./game-over-phase"; diff --git a/src/phases/berry-phase.ts b/src/phases/berry-phase.ts index e5614739903..ae593f66f34 100644 --- a/src/phases/berry-phase.ts +++ b/src/phases/berry-phase.ts @@ -1,4 +1,4 @@ -import { applyAbAttrs, PreventBerryUseAbAttr, HealFromBerryUseAbAttr } from "#app/data/ability"; +import { applyAbAttrs, PreventBerryUseAbAttr, HealFromBerryUseAbAttr } from "#app/data/abilities/ability"; import { CommonAnim } from "#app/data/battle-anims"; import { BerryUsedEvent } from "#app/events/battle-scene"; import { getPokemonNameWithAffix } from "#app/messages"; diff --git a/src/phases/encounter-phase.ts b/src/phases/encounter-phase.ts index 15f3d102e41..67236c1c041 100644 --- a/src/phases/encounter-phase.ts +++ b/src/phases/encounter-phase.ts @@ -1,7 +1,7 @@ import { BattlerIndex, BattleType } from "#app/battle"; import { globalScene } from "#app/global-scene"; import { PLAYER_PARTY_MAX_SIZE } from "#app/constants"; -import { applyAbAttrs, SyncEncounterNatureAbAttr, applyPreSummonAbAttrs, PreSummonAbAttr } from "#app/data/ability"; +import { applyAbAttrs, SyncEncounterNatureAbAttr, applyPreSummonAbAttrs, PreSummonAbAttr } from "#app/data/abilities/ability"; import { initEncounterAnims, loadEncounterAnimAssets } from "#app/data/battle-anims"; import { getCharVariantFromDialogue } from "#app/data/dialogue"; import { getEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; diff --git a/src/phases/faint-phase.ts b/src/phases/faint-phase.ts index 7e1ae4ec07b..01a556115a6 100644 --- a/src/phases/faint-phase.ts +++ b/src/phases/faint-phase.ts @@ -8,7 +8,7 @@ import { PostFaintAbAttr, PostKnockOutAbAttr, PostVictoryAbAttr, -} from "#app/data/ability"; +} from "#app/data/abilities/ability"; import type { DestinyBondTag, GrudgeTag } from "#app/data/battler-tags"; import { BattlerTagLapseType } from "#app/data/battler-tags"; import { battleSpecDialogue } from "#app/data/dialogue"; diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index acc7ac0f63a..af9f685eebe 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -14,7 +14,7 @@ import { PostDefendAbAttr, ReflectStatusMoveAbAttr, TypeImmunityAbAttr, -} from "#app/data/ability"; +} from "#app/data/abilities/ability"; import { ArenaTagSide, ConditionalProtectTag } from "#app/data/arena-tag"; import { MoveAnim } from "#app/data/battle-anims"; import { diff --git a/src/phases/move-end-phase.ts b/src/phases/move-end-phase.ts index 176abee5e98..037596dca59 100644 --- a/src/phases/move-end-phase.ts +++ b/src/phases/move-end-phase.ts @@ -2,7 +2,7 @@ import { globalScene } from "#app/global-scene"; import { BattlerTagLapseType } from "#app/data/battler-tags"; import { PokemonPhase } from "./pokemon-phase"; import type { BattlerIndex } from "#app/battle"; -import { applyPostSummonAbAttrs, PostSummonRemoveEffectAbAttr } from "#app/data/ability"; +import { applyPostSummonAbAttrs, PostSummonRemoveEffectAbAttr } from "#app/data/abilities/ability"; import type Pokemon from "#app/field/pokemon"; export class MoveEndPhase extends PokemonPhase { diff --git a/src/phases/move-phase.ts b/src/phases/move-phase.ts index 478229dcae8..dc394b8a134 100644 --- a/src/phases/move-phase.ts +++ b/src/phases/move-phase.ts @@ -10,7 +10,7 @@ import { PostMoveUsedAbAttr, RedirectMoveAbAttr, ReduceStatusEffectDurationAbAttr, -} from "#app/data/ability"; +} from "#app/data/abilities/ability"; import type { DelayedAttackTag } from "#app/data/arena-tag"; import { CommonAnim } from "#app/data/battle-anims"; import { BattlerTagLapseType, CenterOfAttentionTag } from "#app/data/battler-tags"; diff --git a/src/phases/new-biome-encounter-phase.ts b/src/phases/new-biome-encounter-phase.ts index 3449a562c4a..6a7afcb8da8 100644 --- a/src/phases/new-biome-encounter-phase.ts +++ b/src/phases/new-biome-encounter-phase.ts @@ -1,5 +1,5 @@ import { globalScene } from "#app/global-scene"; -import { applyAbAttrs, PostBiomeChangeAbAttr } from "#app/data/ability"; +import { applyAbAttrs, PostBiomeChangeAbAttr } from "#app/data/abilities/ability"; import { getRandomWeatherType } from "#app/data/weather"; import { NextEncounterPhase } from "./next-encounter-phase"; diff --git a/src/phases/obtain-status-effect-phase.ts b/src/phases/obtain-status-effect-phase.ts index cba9399b996..10ae195b02f 100644 --- a/src/phases/obtain-status-effect-phase.ts +++ b/src/phases/obtain-status-effect-phase.ts @@ -7,7 +7,7 @@ import type Pokemon from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; import { PokemonPhase } from "./pokemon-phase"; import { SpeciesFormChangeStatusEffectTrigger } from "#app/data/pokemon-forms"; -import { applyPostSetStatusAbAttrs, PostSetStatusAbAttr } from "#app/data/ability"; +import { applyPostSetStatusAbAttrs, PostSetStatusAbAttr } from "#app/data/abilities/ability"; import { isNullOrUndefined } from "#app/utils"; export class ObtainStatusEffectPhase extends PokemonPhase { diff --git a/src/phases/post-summon-phase.ts b/src/phases/post-summon-phase.ts index 45b0a0f65ce..446d45bb2fa 100644 --- a/src/phases/post-summon-phase.ts +++ b/src/phases/post-summon-phase.ts @@ -1,5 +1,5 @@ import { globalScene } from "#app/global-scene"; -import { applyAbAttrs, applyPostSummonAbAttrs, CommanderAbAttr, PostSummonAbAttr } from "#app/data/ability"; +import { applyAbAttrs, applyPostSummonAbAttrs, CommanderAbAttr, PostSummonAbAttr } from "#app/data/abilities/ability"; import { ArenaTrapTag } from "#app/data/arena-tag"; import { StatusEffect } from "#app/enums/status-effect"; import { PokemonPhase } from "./pokemon-phase"; diff --git a/src/phases/post-turn-status-effect-phase.ts b/src/phases/post-turn-status-effect-phase.ts index 619ef22d01e..af9a9ac1c29 100644 --- a/src/phases/post-turn-status-effect-phase.ts +++ b/src/phases/post-turn-status-effect-phase.ts @@ -7,7 +7,7 @@ import { BlockStatusDamageAbAttr, PostDamageAbAttr, ReduceBurnDamageAbAttr, -} from "#app/data/ability"; +} from "#app/data/abilities/ability"; import { CommonBattleAnim, CommonAnim } from "#app/data/battle-anims"; import { getStatusEffectActivationText } from "#app/data/status-effect"; import { BattleSpec } from "#app/enums/battle-spec"; diff --git a/src/phases/quiet-form-change-phase.ts b/src/phases/quiet-form-change-phase.ts index 1512609abf9..f476919a628 100644 --- a/src/phases/quiet-form-change-phase.ts +++ b/src/phases/quiet-form-change-phase.ts @@ -16,7 +16,7 @@ import { ClearTerrainAbAttr, ClearWeatherAbAttr, PostTeraFormChangeStatChangeAbAttr, -} from "#app/data/ability"; +} from "#app/data/abilities/ability"; export class QuietFormChangePhase extends BattlePhase { protected pokemon: Pokemon; diff --git a/src/phases/stat-stage-change-phase.ts b/src/phases/stat-stage-change-phase.ts index 4c82661a3bb..f52e4fb06a0 100644 --- a/src/phases/stat-stage-change-phase.ts +++ b/src/phases/stat-stage-change-phase.ts @@ -10,7 +10,7 @@ import { ReflectStatStageChangeAbAttr, StatStageChangeCopyAbAttr, StatStageChangeMultiplierAbAttr, -} from "#app/data/ability"; +} from "#app/data/abilities/ability"; import { ArenaTagSide, MistTag } from "#app/data/arena-tag"; import type { ArenaTag } from "#app/data/arena-tag"; import type Pokemon from "#app/field/pokemon"; diff --git a/src/phases/summon-phase.ts b/src/phases/summon-phase.ts index 7379d509e55..60d45f19c0c 100644 --- a/src/phases/summon-phase.ts +++ b/src/phases/summon-phase.ts @@ -13,7 +13,7 @@ import { PostSummonPhase } from "./post-summon-phase"; import { GameOverPhase } from "./game-over-phase"; import { ShinySparklePhase } from "./shiny-sparkle-phase"; import { MysteryEncounterMode } from "#enums/mystery-encounter-mode"; -import { applyPreSummonAbAttrs, PreSummonAbAttr } from "#app/data/ability"; +import { applyPreSummonAbAttrs, PreSummonAbAttr } from "#app/data/abilities/ability"; import { globalScene } from "#app/global-scene"; export class SummonPhase extends PartyMemberPokemonPhase { diff --git a/src/phases/switch-summon-phase.ts b/src/phases/switch-summon-phase.ts index d63cdb90f25..f8728f3f9b9 100644 --- a/src/phases/switch-summon-phase.ts +++ b/src/phases/switch-summon-phase.ts @@ -5,7 +5,7 @@ import { PostDamageForceSwitchAbAttr, PreSummonAbAttr, PreSwitchOutAbAttr, -} from "#app/data/ability"; +} from "#app/data/abilities/ability"; import { allMoves, ForceSwitchOutAttr } from "#app/data/moves/move"; import { getPokeballTintColor } from "#app/data/pokeball"; import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms"; diff --git a/src/phases/turn-end-phase.ts b/src/phases/turn-end-phase.ts index 9b84ea05e58..fe16a4a864e 100644 --- a/src/phases/turn-end-phase.ts +++ b/src/phases/turn-end-phase.ts @@ -1,4 +1,4 @@ -import { applyPostTurnAbAttrs, PostTurnAbAttr } from "#app/data/ability"; +import { applyPostTurnAbAttrs, PostTurnAbAttr } from "#app/data/abilities/ability"; import { BattlerTagLapseType } from "#app/data/battler-tags"; import { TerrainType } from "#app/data/terrain"; import { WeatherType } from "#app/enums/weather-type"; diff --git a/src/phases/turn-start-phase.ts b/src/phases/turn-start-phase.ts index d5b4160fe1b..ba6ace2d188 100644 --- a/src/phases/turn-start-phase.ts +++ b/src/phases/turn-start-phase.ts @@ -1,4 +1,4 @@ -import { applyAbAttrs, BypassSpeedChanceAbAttr, PreventBypassSpeedChanceAbAttr } from "#app/data/ability"; +import { applyAbAttrs, BypassSpeedChanceAbAttr, PreventBypassSpeedChanceAbAttr } from "#app/data/abilities/ability"; import { allMoves, MoveHeaderAttr } from "#app/data/moves/move"; import { Abilities } from "#app/enums/abilities"; import { Stat } from "#app/enums/stat"; diff --git a/src/phases/weather-effect-phase.ts b/src/phases/weather-effect-phase.ts index 5284c9fba85..b83eab43b65 100644 --- a/src/phases/weather-effect-phase.ts +++ b/src/phases/weather-effect-phase.ts @@ -7,7 +7,7 @@ import { BlockNonDirectDamageAbAttr, applyPostWeatherLapseAbAttrs, PostWeatherLapseAbAttr, -} from "#app/data/ability"; +} from "#app/data/abilities/ability"; import { CommonAnim } from "#app/data/battle-anims"; import type { Weather } from "#app/data/weather"; import { getWeatherDamageMessage, getWeatherLapseMessage } from "#app/data/weather"; diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index 407ebfcd843..3f8959c6219 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -5,7 +5,7 @@ import { getVariantTint, getVariantIcon } from "#app/sprites/variant"; import { argbFromRgba } from "@material/material-color-utilities"; import i18next from "i18next"; import { starterColors } from "#app/battle-scene"; -import { allAbilities } from "#app/data/ability"; +import { allAbilities } from "#app/data/data-lists"; import { speciesEggMoves } from "#app/data/balance/egg-moves"; import { GrowthRate, getGrowthRateColor } from "#app/data/exp"; import { Gender, getGenderColor, getGenderSymbol } from "#app/data/gender"; diff --git a/src/ui/pokedex-scan-ui-handler.ts b/src/ui/pokedex-scan-ui-handler.ts index b34246b97d1..171040f6f12 100644 --- a/src/ui/pokedex-scan-ui-handler.ts +++ b/src/ui/pokedex-scan-ui-handler.ts @@ -6,7 +6,7 @@ import type { OptionSelectItem } from "./abstact-option-select-ui-handler"; import { isNullOrUndefined } from "#app/utils"; import { Mode } from "./ui"; import { FilterTextRow } from "./filter-text"; -import { allAbilities } from "#app/data/ability"; +import { allAbilities } from "#app/data/data-lists"; import { allMoves } from "#app/data/moves/move"; import { allSpecies } from "#app/data/pokemon-species"; import i18next from "i18next"; diff --git a/src/ui/pokedex-ui-handler.ts b/src/ui/pokedex-ui-handler.ts index 59b06d476a2..5fd3ca3e379 100644 --- a/src/ui/pokedex-ui-handler.ts +++ b/src/ui/pokedex-ui-handler.ts @@ -36,7 +36,7 @@ import type { Nature } from "#enums/nature"; import { addWindow } from "./ui-theme"; import type { OptionSelectConfig } from "./abstact-option-select-ui-handler"; import { FilterText, FilterTextRow } from "./filter-text"; -import { allAbilities } from "#app/data/ability"; +import { allAbilities } from "#app/data/data-lists"; import { starterPassiveAbilities } from "#app/data/balance/passives"; import { allMoves } from "#app/data/moves/move"; import { speciesTmMoves } from "#app/data/balance/tms"; diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 3e2940f45b9..9b0009d666e 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -8,8 +8,8 @@ import i18next from "i18next"; import type BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; import { starterColors } from "#app/battle-scene"; import { globalScene } from "#app/global-scene"; -import type { Ability } from "#app/data/ability"; -import { allAbilities } from "#app/data/ability"; +import type { Ability } from "#app/data/abilities/ability-class"; +import { allAbilities } from "#app/data/data-lists"; import { speciesEggMoves } from "#app/data/balance/egg-moves"; import { GrowthRate, getGrowthRateColor } from "#app/data/exp"; import { Gender, getGenderColor, getGenderSymbol } from "#app/data/gender"; diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index 04bcf71d7ae..5ff4a02793d 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -31,7 +31,7 @@ import { loggedInUser } from "#app/account"; import type { Variant } from "#app/sprites/variant"; import { getVariantTint } from "#app/sprites/variant"; import { Button } from "#enums/buttons"; -import type { Ability } from "#app/data/ability"; +import type { Ability } from "#app/data/abilities/ability-class"; import i18next from "i18next"; import { modifierSortFunc } from "#app/modifier/modifier"; import { PlayerGender } from "#enums/player-gender"; diff --git a/test/abilities/arena_trap.test.ts b/test/abilities/arena_trap.test.ts index e0d093a91aa..3a5bad9c34b 100644 --- a/test/abilities/arena_trap.test.ts +++ b/test/abilities/arena_trap.test.ts @@ -1,4 +1,4 @@ -import { allAbilities } from "#app/data/ability"; +import { allAbilities } from "#app/data/data-lists"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/test/abilities/flower_gift.test.ts b/test/abilities/flower_gift.test.ts index 5da796539e5..8c7b32e7e33 100644 --- a/test/abilities/flower_gift.test.ts +++ b/test/abilities/flower_gift.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allAbilities } from "#app/data/ability"; +import { allAbilities } from "#app/data/data-lists"; import { Abilities } from "#app/enums/abilities"; import { Stat } from "#app/enums/stat"; import { WeatherType } from "#app/enums/weather-type"; diff --git a/test/abilities/flower_veil.test.ts b/test/abilities/flower_veil.test.ts index c26a952acff..68242be3886 100644 --- a/test/abilities/flower_veil.test.ts +++ b/test/abilities/flower_veil.test.ts @@ -9,7 +9,7 @@ import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { allMoves } from "#app/data/moves/move"; import { BattlerTagType } from "#enums/battler-tag-type"; -import { allAbilities } from "#app/data/ability"; +import { allAbilities } from "#app/data/data-lists"; describe("Abilities - Flower Veil", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/forecast.test.ts b/test/abilities/forecast.test.ts index a25af32537d..675b9a8b59c 100644 --- a/test/abilities/forecast.test.ts +++ b/test/abilities/forecast.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allAbilities } from "#app/data/ability"; +import { allAbilities } from "#app/data/data-lists"; import { Abilities } from "#app/enums/abilities"; import { WeatherType } from "#app/enums/weather-type"; import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; diff --git a/test/abilities/friend_guard.test.ts b/test/abilities/friend_guard.test.ts index 30175fe37e0..474c89adaf1 100644 --- a/test/abilities/friend_guard.test.ts +++ b/test/abilities/friend_guard.test.ts @@ -5,7 +5,7 @@ import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { BattlerIndex } from "#app/battle"; -import { allAbilities } from "#app/data/ability"; +import { allAbilities } from "#app/data/data-lists"; import { allMoves } from "#app/data/moves/move"; import { MoveCategory } from "#enums/MoveCategory"; diff --git a/test/abilities/good_as_gold.test.ts b/test/abilities/good_as_gold.test.ts index 7cc543c4a0d..4c4741a331f 100644 --- a/test/abilities/good_as_gold.test.ts +++ b/test/abilities/good_as_gold.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allAbilities } from "#app/data/ability"; +import { allAbilities } from "#app/data/data-lists"; import { ArenaTagSide } from "#app/data/arena-tag"; import { ArenaTagType } from "#app/enums/arena-tag-type"; import { BattlerTagType } from "#app/enums/battler-tag-type"; diff --git a/test/abilities/magic_bounce.test.ts b/test/abilities/magic_bounce.test.ts index f9a076776aa..7886ac5fd5c 100644 --- a/test/abilities/magic_bounce.test.ts +++ b/test/abilities/magic_bounce.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allAbilities } from "#app/data/ability"; +import { allAbilities } from "#app/data/data-lists"; import { ArenaTagSide } from "#app/data/arena-tag"; import { allMoves } from "#app/data/moves/move"; import { ArenaTagType } from "#app/enums/arena-tag-type"; diff --git a/test/abilities/neutralizing_gas.test.ts b/test/abilities/neutralizing_gas.test.ts index a10a246d855..56a663db403 100644 --- a/test/abilities/neutralizing_gas.test.ts +++ b/test/abilities/neutralizing_gas.test.ts @@ -1,7 +1,7 @@ import { BattlerIndex } from "#app/battle"; import type { CommandPhase } from "#app/phases/command-phase"; import { Command } from "#app/ui/command-ui-handler"; -import { PostSummonWeatherChangeAbAttr } from "#app/data/ability"; +import { PostSummonWeatherChangeAbAttr } from "#app/data/abilities/ability"; import { Abilities } from "#enums/abilities"; import { ArenaTagType } from "#enums/arena-tag-type"; import { Moves } from "#enums/moves"; diff --git a/test/abilities/quick_draw.test.ts b/test/abilities/quick_draw.test.ts index 9969dc2aa75..1277fd5d3cb 100644 --- a/test/abilities/quick_draw.test.ts +++ b/test/abilities/quick_draw.test.ts @@ -1,4 +1,5 @@ -import { allAbilities, BypassSpeedChanceAbAttr } from "#app/data/ability"; +import { BypassSpeedChanceAbAttr } from "#app/data/abilities/ability"; +import { allAbilities } from "#app/data/data-lists"; import { FaintPhase } from "#app/phases/faint-phase"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; diff --git a/test/abilities/sand_veil.test.ts b/test/abilities/sand_veil.test.ts index 5e0a3f567dd..c7b12a11c0e 100644 --- a/test/abilities/sand_veil.test.ts +++ b/test/abilities/sand_veil.test.ts @@ -1,4 +1,5 @@ -import { StatMultiplierAbAttr, allAbilities } from "#app/data/ability"; +import { StatMultiplierAbAttr } from "#app/data/abilities/ability"; +import { allAbilities } from "#app/data/data-lists"; import { CommandPhase } from "#app/phases/command-phase"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { MoveEndPhase } from "#app/phases/move-end-phase"; diff --git a/test/abilities/shield_dust.test.ts b/test/abilities/shield_dust.test.ts index 8e02b5a7713..257ebe885df 100644 --- a/test/abilities/shield_dust.test.ts +++ b/test/abilities/shield_dust.test.ts @@ -4,7 +4,7 @@ import { applyPreDefendAbAttrs, IgnoreMoveEffectsAbAttr, MoveEffectChanceMultiplierAbAttr, -} from "#app/data/ability"; +} from "#app/data/abilities/ability"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { NumberHolder } from "#app/utils"; import { Abilities } from "#enums/abilities"; diff --git a/test/abilities/steely_spirit.test.ts b/test/abilities/steely_spirit.test.ts index b180ff8919e..eb5e7aac601 100644 --- a/test/abilities/steely_spirit.test.ts +++ b/test/abilities/steely_spirit.test.ts @@ -1,4 +1,4 @@ -import { allAbilities } from "#app/data/ability"; +import { allAbilities } from "#app/data/data-lists"; import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#enums/moves"; diff --git a/test/abilities/unburden.test.ts b/test/abilities/unburden.test.ts index 8f18604011c..769e078faf8 100644 --- a/test/abilities/unburden.test.ts +++ b/test/abilities/unburden.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { PostItemLostAbAttr } from "#app/data/ability"; +import { PostItemLostAbAttr } from "#app/data/abilities/ability"; import { allMoves, StealHeldItemChanceAttr } from "#app/data/moves/move"; import type Pokemon from "#app/field/pokemon"; import type { ContactHeldItemTransferChanceModifier } from "#app/modifier/modifier"; diff --git a/test/battle/ability_swap.test.ts b/test/battle/ability_swap.test.ts index 72991dba6b0..215321f26c2 100644 --- a/test/battle/ability_swap.test.ts +++ b/test/battle/ability_swap.test.ts @@ -1,4 +1,4 @@ -import { allAbilities } from "#app/data/ability"; +import { allAbilities } from "#app/data/data-lists"; import { Stat } from "#app/enums/stat"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; diff --git a/test/moves/flame_burst.test.ts b/test/moves/flame_burst.test.ts index b6a425e7bb5..a39c27d37b3 100644 --- a/test/moves/flame_burst.test.ts +++ b/test/moves/flame_burst.test.ts @@ -1,4 +1,4 @@ -import { allAbilities } from "#app/data/ability"; +import { allAbilities } from "#app/data/data-lists"; import { Abilities } from "#app/enums/abilities"; import type Pokemon from "#app/field/pokemon"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; diff --git a/test/moves/pledge_moves.test.ts b/test/moves/pledge_moves.test.ts index c866d15357c..ee9e0b8b154 100644 --- a/test/moves/pledge_moves.test.ts +++ b/test/moves/pledge_moves.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allAbilities } from "#app/data/ability"; +import { allAbilities } from "#app/data/data-lists"; import { ArenaTagSide } from "#app/data/arena-tag"; import { allMoves, FlinchAttr } from "#app/data/moves/move"; import { PokemonType } from "#enums/pokemon-type"; diff --git a/test/moves/safeguard.test.ts b/test/moves/safeguard.test.ts index 2235b59e1af..675c74f28d0 100644 --- a/test/moves/safeguard.test.ts +++ b/test/moves/safeguard.test.ts @@ -1,5 +1,6 @@ import { BattlerIndex } from "#app/battle"; -import { allAbilities, PostDefendContactApplyStatusEffectAbAttr } from "#app/data/ability"; +import { PostDefendContactApplyStatusEffectAbAttr } from "#app/data/abilities/ability"; +import { allAbilities } from "#app/data/data-lists"; import { Abilities } from "#app/enums/abilities"; import { StatusEffect } from "#app/enums/status-effect"; import GameManager from "#test/testUtils/gameManager"; diff --git a/test/moves/secret_power.test.ts b/test/moves/secret_power.test.ts index 37f1664251b..d769b112b70 100644 --- a/test/moves/secret_power.test.ts +++ b/test/moves/secret_power.test.ts @@ -11,7 +11,8 @@ import { StatusEffect } from "#enums/status-effect"; import { BattlerIndex } from "#app/battle"; import { ArenaTagType } from "#enums/arena-tag-type"; import { ArenaTagSide } from "#app/data/arena-tag"; -import { allAbilities, MoveEffectChanceMultiplierAbAttr } from "#app/data/ability"; +import { MoveEffectChanceMultiplierAbAttr } from "#app/data/abilities/ability"; +import { allAbilities } from "#app/data/data-lists"; describe("Moves - Secret Power", () => { let phaserGame: Phaser.Game; diff --git a/test/testUtils/testFileInitialization.ts b/test/testUtils/testFileInitialization.ts index 2b41f3aa29a..cb2cd57044d 100644 --- a/test/testUtils/testFileInitialization.ts +++ b/test/testUtils/testFileInitialization.ts @@ -1,6 +1,6 @@ import { SESSION_ID_COOKIE_NAME } from "#app/constants"; import { initLoggedInUser } from "#app/account"; -import { initAbilities } from "#app/data/ability"; +import { initAbilities } from "#app/data/abilities/ability"; import { initBiomes } from "#app/data/balance/biomes"; import { initEggMoves } from "#app/data/balance/egg-moves"; import { initPokemonPrevolutions } from "#app/data/balance/pokemon-evolutions";