From c82e01eed377cacc5d3ffd2ef9caa27270e8a2dc Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Mon, 14 Apr 2025 10:31:26 -0500 Subject: [PATCH 01/13] [Refactor] Move many interfaces and enums to their own file (#5646) * Move LearnMoveSituation to its own file * Remove unused selfStatLowerMoves array * Move all-moves to its own file * Move TurnMove interface to its own file * move AiType to its own file * Move PokemonMove to its own file * Move DamageCalculationResult interface to its own file * Move fieldPosition to its own file * Move hit-result to its own file * Move DamageResult to its own file * Move SpeciesWildEvolutionDelay to its own file * move EvolutionItem to its own file --- src/@types/damage-result.ts | 10 + src/battle-scene.ts | 2 +- src/battle.ts | 3 +- src/data/ability.ts | 9 +- src/data/arena-tag.ts | 5 +- src/data/balance/egg-moves.ts | 2 +- src/data/balance/pokemon-evolutions.ts | 60 +---- src/data/battle-anims.ts | 3 +- src/data/battler-tags.ts | 5 +- src/data/berry.ts | 2 +- src/data/challenge.ts | 2 +- src/data/moves/all-moves.ts | 3 + src/data/moves/move.ts | 21 +- src/data/moves/pokemon-move.ts | 93 ++++++++ .../encounters/absolute-avarice-encounter.ts | 3 +- .../encounters/bug-type-superfan-encounter.ts | 4 +- .../encounters/clowning-around-encounter.ts | 2 +- .../encounters/dancing-lessons-encounter.ts | 3 +- .../encounters/field-trip-encounter.ts | 3 +- .../encounters/fiery-fallout-encounter.ts | 2 +- .../encounters/fun-and-games-encounter.ts | 2 +- .../global-trade-system-encounter.ts | 3 +- .../encounters/lost-at-sea-encounter.ts | 2 +- .../slumbering-snorlax-encounter.ts | 3 +- .../encounters/the-strong-stuff-encounter.ts | 2 +- .../encounters/trash-to-treasure-encounter.ts | 2 +- .../encounters/uncommon-breed-encounter.ts | 2 +- .../encounters/weird-dream-encounter.ts | 2 +- .../mystery-encounter-requirements.ts | 3 +- .../mystery-encounters/mystery-encounter.ts | 3 +- .../can-learn-move-requirement.ts | 2 +- .../utils/encounter-phase-utils.ts | 7 +- src/data/pokemon-forms.ts | 2 +- src/data/pokemon-species.ts | 7 +- src/data/trainers/trainer-config.ts | 2 +- src/enums/ai-type.ts | 5 + src/enums/evolution-item.ts | 48 ++++ src/enums/field-position.ts | 5 + src/enums/hit-result.ts | 15 ++ src/enums/learn-move-context.ts | 8 + src/enums/species-wild-evolution-delay.ts | 8 + src/field/damage-number-handler.ts | 4 +- src/field/pokemon.ts | 206 ++---------------- src/interfaces/attack-move-result.ts | 12 + src/interfaces/damage-calculation-result.ts | 11 + src/interfaces/turn-move.ts | 12 + src/modifier/modifier-type.ts | 9 +- src/modifier/modifier.ts | 2 +- src/overrides.ts | 2 +- src/phases/command-phase.ts | 5 +- src/phases/damage-anim-phase.ts | 3 +- src/phases/encounter-phase.ts | 2 +- src/phases/evolution-phase.ts | 10 +- src/phases/faint-phase.ts | 7 +- src/phases/learn-move-phase.ts | 2 +- src/phases/move-charge-phase.ts | 2 +- src/phases/move-effect-phase.ts | 5 +- src/phases/move-header-phase.ts | 2 +- src/phases/move-phase.ts | 4 +- src/phases/pokemon-heal-phase.ts | 2 +- src/phases/pokemon-transform-phase.ts | 2 +- src/phases/select-target-phase.ts | 2 +- src/phases/summon-phase.ts | 2 +- src/phases/switch-summon-phase.ts | 3 +- src/phases/toggle-double-position-phase.ts | 2 +- src/phases/turn-start-phase.ts | 5 +- src/phases/weather-effect-phase.ts | 2 +- src/system/game-data.ts | 2 +- src/system/pokemon-data.ts | 3 +- src/ui/fight-ui-handler.ts | 2 +- src/ui/modifier-select-ui-handler.ts | 2 +- src/ui/party-ui-handler.ts | 6 +- 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/pokemon-hatch-info-container.ts | 2 +- src/ui/starter-select-ui-handler.ts | 2 +- src/ui/summary-ui-handler.ts | 3 +- test/abilities/aura_break.test.ts | 2 +- test/abilities/battery.test.ts | 2 +- test/abilities/battle_bond.test.ts | 3 +- test/abilities/flower_veil.test.ts | 2 +- test/abilities/friend_guard.test.ts | 2 +- test/abilities/galvanize.test.ts | 4 +- test/abilities/hustle.test.ts | 2 +- test/abilities/infiltrator.test.ts | 2 +- test/abilities/libero.test.ts | 2 +- test/abilities/magic_bounce.test.ts | 2 +- test/abilities/power_spot.test.ts | 2 +- test/abilities/protean.test.ts | 2 +- test/abilities/sap_sipper.test.ts | 3 +- test/abilities/serene_grace.test.ts | 2 +- test/abilities/sheer_force.test.ts | 3 +- test/abilities/steely_spirit.test.ts | 2 +- test/abilities/supreme_overlord.test.ts | 2 +- test/abilities/tera_shell.test.ts | 2 +- test/abilities/unburden.test.ts | 3 +- test/abilities/wimp_out.test.ts | 9 +- test/abilities/wonder_skin.test.ts | 2 +- test/arena/arena_gravity.test.ts | 2 +- test/arena/grassy_terrain.test.ts | 2 +- test/arena/weather_fog.test.ts | 2 +- test/arena/weather_strong_winds.test.ts | 2 +- test/battle/damage_calculation.test.ts | 2 +- test/battlerTags/substitute.test.ts | 6 +- test/enemy_command.test.ts | 4 +- test/evolution.test.ts | 7 +- test/imports.test.ts | 2 +- test/items/reviver_seed.test.ts | 2 +- test/moves/astonish.test.ts | 2 +- test/moves/aurora_veil.test.ts | 3 +- test/moves/burning_jealousy.test.ts | 2 +- test/moves/ceaseless_edge.test.ts | 2 +- test/moves/copycat.test.ts | 3 +- test/moves/destiny_bond.test.ts | 2 +- test/moves/diamond_storm.test.ts | 2 +- test/moves/dig.test.ts | 2 +- test/moves/dragon_tail.test.ts | 2 +- test/moves/dynamax_cannon.test.ts | 2 +- test/moves/effectiveness.test.ts | 2 +- test/moves/fell_stinger.test.ts | 2 +- test/moves/fly.test.ts | 2 +- test/moves/freezy_frost.test.ts | 2 +- test/moves/fusion_flare_bolt.test.ts | 2 +- test/moves/glaive_rush.test.ts | 2 +- test/moves/hard_press.test.ts | 2 +- test/moves/hyper_beam.test.ts | 2 +- test/moves/lash_out.test.ts | 2 +- test/moves/last_respects.test.ts | 2 +- test/moves/light_screen.test.ts | 3 +- test/moves/magic_coat.test.ts | 2 +- test/moves/metronome.test.ts | 3 +- test/moves/moongeist_beam.test.ts | 3 +- test/moves/pledge_moves.test.ts | 3 +- test/moves/powder.test.ts | 3 +- test/moves/protect.test.ts | 2 +- test/moves/rage_fist.test.ts | 2 +- test/moves/reflect.test.ts | 3 +- test/moves/retaliate.test.ts | 2 +- test/moves/rollout.test.ts | 2 +- test/moves/round.test.ts | 2 +- test/moves/scale_shot.test.ts | 2 +- test/moves/secret_power.test.ts | 2 +- test/moves/shell_side_arm.test.ts | 3 +- test/moves/shell_trap.test.ts | 2 +- test/moves/sketch.test.ts | 6 +- test/moves/solar_beam.test.ts | 2 +- test/moves/sparkly_swirl.test.ts | 2 +- test/moves/spectral_thief.test.ts | 2 +- test/moves/spit_up.test.ts | 4 +- test/moves/steamroller.test.ts | 4 +- test/moves/stockpile.test.ts | 2 +- test/moves/substitute.test.ts | 3 +- test/moves/swallow.test.ts | 2 +- test/moves/telekinesis.test.ts | 2 +- test/moves/tera_blast.test.ts | 5 +- test/moves/toxic.test.ts | 2 +- test/moves/triple_arrows.test.ts | 3 +- ...an-offer-you-cant-refuse-encounter.test.ts | 3 +- .../bug-type-superfan-encounter.test.ts | 2 +- .../clowning-around-encounter.test.ts | 2 +- .../dancing-lessons-encounter.test.ts | 2 +- .../fight-or-flight-encounter.test.ts | 2 +- .../encounters/part-timer-encounter.test.ts | 2 +- .../the-strong-stuff-encounter.test.ts | 2 +- .../trash-to-treasure-encounter.test.ts | 2 +- .../uncommon-breed-encounter.test.ts | 2 +- test/testUtils/helpers/moveHelper.ts | 2 +- 168 files changed, 490 insertions(+), 455 deletions(-) create mode 100644 src/@types/damage-result.ts create mode 100644 src/data/moves/all-moves.ts create mode 100644 src/data/moves/pokemon-move.ts create mode 100644 src/enums/ai-type.ts create mode 100644 src/enums/evolution-item.ts create mode 100644 src/enums/field-position.ts create mode 100644 src/enums/hit-result.ts create mode 100644 src/enums/learn-move-context.ts create mode 100644 src/enums/species-wild-evolution-delay.ts create mode 100644 src/interfaces/attack-move-result.ts create mode 100644 src/interfaces/damage-calculation-result.ts create mode 100644 src/interfaces/turn-move.ts diff --git a/src/@types/damage-result.ts b/src/@types/damage-result.ts new file mode 100644 index 00000000000..7086d843cf4 --- /dev/null +++ b/src/@types/damage-result.ts @@ -0,0 +1,10 @@ +import type { HitResult } from "#enums/hit-result"; + +export type DamageResult = + | HitResult.EFFECTIVE + | HitResult.SUPER_EFFECTIVE + | HitResult.NOT_VERY_EFFECTIVE + | HitResult.ONE_HIT_KO + | HitResult.CONFUSION + | HitResult.INDIRECT_KO + | HitResult.INDIRECT; diff --git a/src/battle-scene.ts b/src/battle-scene.ts index dd983f2b397..12dbfca68e8 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -51,7 +51,7 @@ import { initGameSpeed } from "#app/system/game-speed"; import { Arena, ArenaBase } from "#app/field/arena"; import { GameData } from "#app/system/game-data"; import { addTextObject, getTextColor, TextStyle } from "#app/ui/text"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "./data/moves/all-moves"; import { MusicPreference } from "#app/system/settings/settings"; import { getDefaultModifierTypeForTier, diff --git a/src/battle.ts b/src/battle.ts index fb5af223b8f..1122db2679a 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -15,7 +15,8 @@ import { MoneyMultiplierModifier, PokemonHeldItemModifier } from "./modifier/mod import type { PokeballType } from "#enums/pokeball"; import { trainerConfigs } from "#app/data/trainers/trainer-config"; import { SpeciesFormKey } from "#enums/species-form-key"; -import type { EnemyPokemon, PlayerPokemon, TurnMove } from "#app/field/pokemon"; +import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; +import type { TurnMove } from "./interfaces/turn-move"; import type Pokemon from "#app/field/pokemon"; import { ArenaTagType } from "#enums/arena-tag-type"; import { BattleSpec } from "#enums/battle-spec"; diff --git a/src/data/ability.ts b/src/data/ability.ts index 3e32a624f9f..02cc12dd0f4 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -1,6 +1,8 @@ -import type { EnemyPokemon, PokemonMove } from "../field/pokemon"; +import type { EnemyPokemon } from "../field/pokemon"; +import type { PokemonMove } from "./moves/pokemon-move"; import type Pokemon from "../field/pokemon"; -import { HitResult, MoveResult, PlayerPokemon } from "../field/pokemon"; +import { MoveResult, PlayerPokemon } from "../field/pokemon"; +import { HitResult } from "#enums/hit-result"; import { PokemonType } from "#enums/pokemon-type"; import { BooleanHolder, NumberHolder, toDmgValue, isNullOrUndefined, randSeedItem, randSeedInt, type Constructor } from "#app/utils"; import { getPokemonNameWithAffix } from "../messages"; @@ -10,7 +12,8 @@ import { BattlerTagLapseType, GroundedTag } from "./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 { AttackMove, FlinchAttr, OneHitKOAttr, HitHealAttr, StatusMove, SelfStatusMove, VariablePowerAttr, applyMoveAttrs, VariableMoveTypeAttr, RandomMovesetMoveAttr, RandomMoveAttr, NaturePowerAttr, CopyMoveAttr, NeutralDamageAgainstFlyingTypeMultiplierAttr, FixedDamageAttr } from "./moves/move"; +import { allMoves } from "./moves/all-moves"; import { MoveFlags } from "#enums/MoveFlags"; import { MoveTarget } from "#enums/MoveTarget"; import { MoveCategory } from "#enums/MoveCategory"; diff --git a/src/data/arena-tag.ts b/src/data/arena-tag.ts index 871f622f70a..c6a1515685f 100644 --- a/src/data/arena-tag.ts +++ b/src/data/arena-tag.ts @@ -2,12 +2,13 @@ import { globalScene } from "#app/global-scene"; import type { Arena } from "#app/field/arena"; import { PokemonType } from "#enums/pokemon-type"; import { BooleanHolder, NumberHolder, toDmgValue } from "#app/utils"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "./moves/all-moves"; import { MoveTarget } from "#enums/MoveTarget"; import { MoveCategory } from "#enums/MoveCategory"; import { getPokemonNameWithAffix } from "#app/messages"; import type Pokemon from "#app/field/pokemon"; -import { HitResult, PokemonMove } from "#app/field/pokemon"; +import { HitResult } from "#enums/hit-result"; +import { PokemonMove } from "./moves/pokemon-move"; import { StatusEffect } from "#enums/status-effect"; import type { BattlerIndex } from "#app/battle"; import { diff --git a/src/data/balance/egg-moves.ts b/src/data/balance/egg-moves.ts index 74f6a2c1afb..98f3347764c 100644 --- a/src/data/balance/egg-moves.ts +++ b/src/data/balance/egg-moves.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { getEnumKeys, getEnumValues } from "#app/utils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/data/balance/pokemon-evolutions.ts b/src/data/balance/pokemon-evolutions.ts index 17f71f3c3c9..70b616be8e5 100644 --- a/src/data/balance/pokemon-evolutions.ts +++ b/src/data/balance/pokemon-evolutions.ts @@ -14,66 +14,10 @@ import { DamageMoneyRewardModifier, ExtraModifierModifier, MoneyMultiplierModifi import { SpeciesFormKey } from "#enums/species-form-key"; import { speciesStarterCosts } from "./starters"; import i18next from "i18next"; +import { SpeciesWildEvolutionDelay } from "#enums/species-wild-evolution-delay"; +import { EvolutionItem } from "#enums/evolution-item"; -export enum SpeciesWildEvolutionDelay { - NONE, - SHORT, - MEDIUM, - LONG, - VERY_LONG, - NEVER -} - -export enum EvolutionItem { - NONE, - - LINKING_CORD, - SUN_STONE, - MOON_STONE, - LEAF_STONE, - FIRE_STONE, - WATER_STONE, - THUNDER_STONE, - ICE_STONE, - DUSK_STONE, - DAWN_STONE, - SHINY_STONE, - CRACKED_POT, - SWEET_APPLE, - TART_APPLE, - STRAWBERRY_SWEET, - UNREMARKABLE_TEACUP, - UPGRADE, - DUBIOUS_DISC, - DRAGON_SCALE, - PRISM_SCALE, - RAZOR_CLAW, - RAZOR_FANG, - REAPER_CLOTH, - ELECTIRIZER, - MAGMARIZER, - PROTECTOR, - SACHET, - WHIPPED_DREAM, - SYRUPY_APPLE, - CHIPPED_POT, - GALARICA_CUFF, - GALARICA_WREATH, - AUSPICIOUS_ARMOR, - MALICIOUS_ARMOR, - MASTERPIECE_TEACUP, - SUN_FLUTE, - MOON_FLUTE, - - BLACK_AUGURITE = 51, - PEAT_BLOCK, - METAL_ALLOY, - SCROLL_OF_DARKNESS, - SCROLL_OF_WATERS, - LEADERS_CREST -} - /** * Pokemon Evolution tuple type consisting of: * @property 0 {@linkcode Species} The species of the Pokemon. diff --git a/src/data/battle-anims.ts b/src/data/battle-anims.ts index 511c80bee72..396cf71d984 100644 --- a/src/data/battle-anims.ts +++ b/src/data/battle-anims.ts @@ -1,5 +1,6 @@ import { globalScene } from "#app/global-scene"; -import { AttackMove, BeakBlastHeaderAttr, DelayedAttackAttr, SelfStatusMove, allMoves } from "./moves/move"; +import { AttackMove, BeakBlastHeaderAttr, DelayedAttackAttr, SelfStatusMove } from "./moves/move"; +import { allMoves } from "./moves/all-moves"; import { MoveFlags } from "#enums/MoveFlags"; import type Pokemon from "../field/pokemon"; import { type nil, getFrameMs, getEnumKeys, getEnumValues, animationFileName } from "../utils"; diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 76e91485460..c3dcfc49ef6 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -11,12 +11,12 @@ import { import { ChargeAnim, CommonAnim, CommonBattleAnim, MoveChargeAnim } from "#app/data/battle-anims"; import type Move from "#app/data/moves/move"; import { - allMoves, applyMoveAttrs, ConsecutiveUseDoublePowerAttr, HealOnAllyAttr, StatusCategoryOnAllyAttr, } from "#app/data/moves/move"; +import { allMoves } from "./moves/all-moves"; import { MoveFlags } from "#enums/MoveFlags"; import { MoveCategory } from "#enums/MoveCategory"; import { SpeciesFormChangeAbilityTrigger } from "#app/data/pokemon-forms"; @@ -24,7 +24,8 @@ import { getStatusEffectHealText } from "#app/data/status-effect"; import { TerrainType } from "#app/data/terrain"; import { PokemonType } from "#enums/pokemon-type"; import type Pokemon from "#app/field/pokemon"; -import { HitResult, MoveResult } from "#app/field/pokemon"; +import { MoveResult } from "#app/field/pokemon"; +import { HitResult } from "#enums/hit-result"; import { getPokemonNameWithAffix } from "#app/messages"; import { CommonAnimPhase } from "#app/phases/common-anim-phase"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; diff --git a/src/data/berry.ts b/src/data/berry.ts index 8a58d337aa4..aaa0dda6e7f 100644 --- a/src/data/berry.ts +++ b/src/data/berry.ts @@ -1,6 +1,6 @@ import { getPokemonNameWithAffix } from "../messages"; import type Pokemon from "../field/pokemon"; -import { HitResult } from "../field/pokemon"; +import { HitResult } from "#enums/hit-result"; import { getStatusEffectHealText } from "./status-effect"; import { NumberHolder, toDmgValue, randSeedInt } from "#app/utils"; import { diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 51616c3f00f..9a3c329a70b 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -6,7 +6,7 @@ import type PokemonSpecies from "#app/data/pokemon-species"; import { getPokemonSpecies, getPokemonSpeciesForm } from "#app/data/pokemon-species"; import { speciesStarterCosts } from "#app/data/balance/starters"; import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "./moves/pokemon-move"; import type { FixedBattleConfig } from "#app/battle"; import { ClassicFixedBossWaves, BattleType, getRandomTrainerFunc } from "#app/battle"; import Trainer, { TrainerVariant } from "#app/field/trainer"; diff --git a/src/data/moves/all-moves.ts b/src/data/moves/all-moves.ts new file mode 100644 index 00000000000..c7b6d11a08d --- /dev/null +++ b/src/data/moves/all-moves.ts @@ -0,0 +1,3 @@ +import type Move from "./move"; + +export const allMoves: Move[] = []; diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index 962a13bb840..591894f5f1e 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -12,16 +12,17 @@ import { TypeBoostTag, } from "../battler-tags"; import { getPokemonNameWithAffix } from "../../messages"; -import type { AttackMoveResult, TurnMove } from "../../field/pokemon"; +import type { AttackMoveResult } from "#app/interfaces/attack-move-result"; +import type { TurnMove } from "#app/interfaces/turn-move"; import type Pokemon from "../../field/pokemon"; import { EnemyPokemon, - FieldPosition, - HitResult, MoveResult, PlayerPokemon, - PokemonMove, } from "../../field/pokemon"; +import { HitResult } from "#enums/hit-result"; +import { FieldPosition } from "#enums/field-position"; +import { PokemonMove } from "./pokemon-move"; import { getNonVolatileStatusEffects, getStatusEffectHealText, @@ -121,6 +122,7 @@ import { MoveFlags } from "#enums/MoveFlags"; import { MoveEffectTrigger } from "#enums/MoveEffectTrigger"; import { MultiHitType } from "#enums/MultiHitType"; import { invalidAssistMoves, invalidCopycatMoves, invalidMetronomeMoves, invalidMirrorMoveMoves, invalidSleepTalkMoves } from "./invalid-moves"; +import { allMoves } from "./all-moves"; type MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => boolean; type UserMoveConditionFunc = (user: Pokemon, move: Move) => boolean; @@ -8257,11 +8259,7 @@ export function getMoveTargets(user: Pokemon, move: Moves, replaceTarget?: MoveT return { targets: set.filter(p => p?.isActive(true)).map(p => p.getBattlerIndex()).filter(t => t !== undefined), multiple }; } -export const allMoves: Move[] = [ - new SelfStatusMove(Moves.NONE, PokemonType.NORMAL, MoveCategory.STATUS, -1, -1, 0, 1), -]; - -export const selfStatLowerMoves: Moves[] = []; +allMoves.push(new SelfStatusMove(Moves.NONE, PokemonType.NORMAL, MoveCategory.STATUS, -1, -1, 0, 1)); export function initMoves() { allMoves.push( @@ -11250,9 +11248,4 @@ export function initMoves() { new AttackMove(Moves.MALIGNANT_CHAIN, PokemonType.POISON, MoveCategory.SPECIAL, 100, 100, 5, 50, 0, 9) .attr(StatusEffectAttr, StatusEffect.TOXIC) ); - allMoves.map(m => { - if (m.getAttrs(StatStageChangeAttr).some(a => a.selfTarget && a.stages < 0)) { - selfStatLowerMoves.push(m.id); - } - }); } diff --git a/src/data/moves/pokemon-move.ts b/src/data/moves/pokemon-move.ts new file mode 100644 index 00000000000..49ccaba698b --- /dev/null +++ b/src/data/moves/pokemon-move.ts @@ -0,0 +1,93 @@ +import * as Utils from "#app/utils"; +import { allMoves } from "./all-moves"; +import type { Moves } from "#enums/moves"; +import type Pokemon from "#app/field/pokemon"; +import type Move from "./move"; + +/** + * Wrapper class for the {@linkcode Move} class for Pokemon to interact with. + * These are the moves assigned to a {@linkcode Pokemon} object. + * It links to {@linkcode Move} class via the move ID. + * Compared to {@linkcode Move}, this class also tracks if a move has received. + * PP Ups, amount of PP used, and things like that. + * @see {@linkcode isUsable} - checks if move is restricted, out of PP, or not implemented. + * @see {@linkcode getMove} - returns {@linkcode Move} object by looking it up via ID. + * @see {@linkcode usePp} - removes a point of PP from the move. + * @see {@linkcode getMovePp} - returns amount of PP a move currently has. + * @see {@linkcode getPpRatio} - returns the current PP amount / max PP amount. + * @see {@linkcode getName} - returns name of {@linkcode Move}. + **/ +export class PokemonMove { + public moveId: Moves; + public ppUsed: number; + public ppUp: number; + public virtual: boolean; + + /** + * If defined and nonzero, overrides the maximum PP of the move (e.g., due to move being copied by Transform). + * This also nullifies all effects of `ppUp`. + */ + public maxPpOverride?: number; + + constructor(moveId: Moves, ppUsed = 0, ppUp = 0, virtual = false, maxPpOverride?: number) { + this.moveId = moveId; + this.ppUsed = ppUsed; + this.ppUp = ppUp; + this.virtual = virtual; + this.maxPpOverride = maxPpOverride; + } + + /** + * Checks whether the move can be selected or performed by a Pokemon, without consideration for the move's targets. + * The move is unusable if it is out of PP, restricted by an effect, or unimplemented. + * + * @param pokemon - {@linkcode Pokemon} that would be using this move + * @param ignorePp - If `true`, skips the PP check + * @param ignoreRestrictionTags - If `true`, skips the check for move restriction tags (see {@link MoveRestrictionBattlerTag}) + * @returns `true` if the move can be selected and used by the Pokemon, otherwise `false`. + */ + isUsable(pokemon: Pokemon, ignorePp = false, ignoreRestrictionTags = false): boolean { + if (this.moveId && !ignoreRestrictionTags && pokemon.isMoveRestricted(this.moveId, pokemon)) { + return false; + } + + if (this.getMove().name.endsWith(" (N)")) { + return false; + } + + return ignorePp || this.ppUsed < this.getMovePp() || this.getMove().pp === -1; + } + + getMove(): Move { + return allMoves[this.moveId]; + } + + /** + * Sets {@link ppUsed} for this move and ensures the value does not exceed {@link getMovePp} + * @param {number} count Amount of PP to use + */ + usePp(count = 1) { + this.ppUsed = Math.min(this.ppUsed + count, this.getMovePp()); + } + + getMovePp(): number { + return this.maxPpOverride || this.getMove().pp + this.ppUp * Utils.toDmgValue(this.getMove().pp / 5); + } + + getPpRatio(): number { + return 1 - this.ppUsed / this.getMovePp(); + } + + getName(): string { + return this.getMove().name; + } + + /** + * Copies an existing move or creates a valid PokemonMove object from json representing one + * @param source - The data for the move to copy + * @return A valid pokemonmove object + */ + static loadMove(source: PokemonMove | any): PokemonMove { + return new PokemonMove(source.moveId, source.ppUsed, source.ppUp, source.virtual, source.maxPpOverride); + } +} diff --git a/src/data/mystery-encounters/encounters/absolute-avarice-encounter.ts b/src/data/mystery-encounters/encounters/absolute-avarice-encounter.ts index 85f40a41e51..b781f14fad1 100644 --- a/src/data/mystery-encounters/encounters/absolute-avarice-encounter.ts +++ b/src/data/mystery-encounters/encounters/absolute-avarice-encounter.ts @@ -7,7 +7,8 @@ import { transitionMysteryEncounterIntroVisuals, } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; import type Pokemon from "#app/field/pokemon"; -import { EnemyPokemon, PokemonMove } from "#app/field/pokemon"; +import { EnemyPokemon } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import type { BerryModifierType, PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; import { modifierTypes } from "#app/modifier/modifier-type"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; diff --git a/src/data/mystery-encounters/encounters/bug-type-superfan-encounter.ts b/src/data/mystery-encounters/encounters/bug-type-superfan-encounter.ts index 1e4c9a3b957..c6971c42364 100644 --- a/src/data/mystery-encounters/encounters/bug-type-superfan-encounter.ts +++ b/src/data/mystery-encounters/encounters/bug-type-superfan-encounter.ts @@ -24,7 +24,7 @@ import { TrainerType } from "#enums/trainer-type"; import { Species } from "#enums/species"; import type { PlayerPokemon } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { getEncounterText, showEncounterDialogue } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; import { LearnMovePhase } from "#app/phases/learn-move-phase"; import { Moves } from "#enums/moves"; @@ -50,7 +50,7 @@ import { } from "#app/modifier/modifier"; import i18next from "i18next"; import MoveInfoOverlay from "#app/ui/move-info-overlay"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { ModifierTier } from "#app/modifier/modifier-tier"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode"; import { getSpriteKeysFromSpecies } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; diff --git a/src/data/mystery-encounters/encounters/clowning-around-encounter.ts b/src/data/mystery-encounters/encounters/clowning-around-encounter.ts index eca99fc0c13..15fad6dacbf 100644 --- a/src/data/mystery-encounters/encounters/clowning-around-encounter.ts +++ b/src/data/mystery-encounters/encounters/clowning-around-encounter.ts @@ -37,7 +37,7 @@ import { Mode } from "#app/ui/ui"; 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 { PokemonMove } from "#app/data/moves/pokemon-move"; import { Ability } from "#app/data/ability"; import { BerryModifier } from "#app/modifier/modifier"; import { BerryType } from "#enums/berry-type"; diff --git a/src/data/mystery-encounters/encounters/dancing-lessons-encounter.ts b/src/data/mystery-encounters/encounters/dancing-lessons-encounter.ts index 75527e1f8c1..90ea6a69c0d 100644 --- a/src/data/mystery-encounters/encounters/dancing-lessons-encounter.ts +++ b/src/data/mystery-encounters/encounters/dancing-lessons-encounter.ts @@ -23,7 +23,8 @@ import { getPokemonSpecies } from "#app/data/pokemon-species"; import { TrainerSlot } from "#enums/trainer-slot"; import type { PlayerPokemon } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; -import { EnemyPokemon, PokemonMove } from "#app/field/pokemon"; +import { EnemyPokemon } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode"; import { modifierTypes } from "#app/modifier/modifier-type"; import { LearnMovePhase } from "#app/phases/learn-move-phase"; diff --git a/src/data/mystery-encounters/encounters/field-trip-encounter.ts b/src/data/mystery-encounters/encounters/field-trip-encounter.ts index a1964aa5ab4..4e330fab3d9 100644 --- a/src/data/mystery-encounters/encounters/field-trip-encounter.ts +++ b/src/data/mystery-encounters/encounters/field-trip-encounter.ts @@ -7,7 +7,8 @@ import { setEncounterExp, setEncounterRewards, } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import type { PlayerPokemon, PokemonMove } from "#app/field/pokemon"; +import type { PlayerPokemon } from "#app/field/pokemon"; +import type { PokemonMove } from "#app/data/moves/pokemon-move"; import { modifierTypes } from "#app/modifier/modifier-type"; import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; diff --git a/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts b/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts index 6118fe3d0de..d868184a7fa 100644 --- a/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts +++ b/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts @@ -26,7 +26,7 @@ import { Gender } from "#app/data/gender"; import { PokemonType } from "#enums/pokemon-type"; import { BattlerIndex } from "#app/battle"; import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { Moves } from "#enums/moves"; import { EncounterBattleAnim } from "#app/data/battle-anims"; import { WeatherType } from "#enums/weather-type"; diff --git a/src/data/mystery-encounters/encounters/fun-and-games-encounter.ts b/src/data/mystery-encounters/encounters/fun-and-games-encounter.ts index 282c6c149ff..a9fc24c70b7 100644 --- a/src/data/mystery-encounters/encounters/fun-and-games-encounter.ts +++ b/src/data/mystery-encounters/encounters/fun-and-games-encounter.ts @@ -13,7 +13,7 @@ import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/myst import { TrainerSlot } from "#enums/trainer-slot"; import type { PlayerPokemon } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; -import { FieldPosition } from "#app/field/pokemon"; +import { FieldPosition } from "#enums/field-position"; import { getPokemonSpecies } from "#app/data/pokemon-species"; import { MoneyRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements"; import { queueEncounterMessage, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; diff --git a/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts b/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts index f80620647b0..fce496e5e17 100644 --- a/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts +++ b/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts @@ -26,7 +26,8 @@ import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode import { NumberHolder, isNullOrUndefined, randInt, randSeedInt, randSeedShuffle, randSeedItem } from "#app/utils"; import type { PlayerPokemon } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; -import { EnemyPokemon, PokemonMove } from "#app/field/pokemon"; +import { EnemyPokemon } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import type { PokemonHeldItemModifier } from "#app/modifier/modifier"; import { HiddenAbilityRateBoosterModifier, diff --git a/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts b/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts index 97fd5783ebb..030678b77b1 100644 --- a/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts +++ b/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts @@ -11,7 +11,7 @@ import { applyDamageToPokemon } from "#app/data/mystery-encounters/utils/encount import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; const OPTION_1_REQUIRED_MOVE = Moves.SURF; const OPTION_2_REQUIRED_MOVE = Moves.FLY; diff --git a/src/data/mystery-encounters/encounters/slumbering-snorlax-encounter.ts b/src/data/mystery-encounters/encounters/slumbering-snorlax-encounter.ts index bfa1204a8ba..97a17af43d0 100644 --- a/src/data/mystery-encounters/encounters/slumbering-snorlax-encounter.ts +++ b/src/data/mystery-encounters/encounters/slumbering-snorlax-encounter.ts @@ -21,7 +21,8 @@ import { import { queueEncounterMessage } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; import { Moves } from "#enums/moves"; import { BattlerIndex } from "#app/battle"; -import { AiType, PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { AiType } from "#enums/ai-type"; import { getPokemonSpecies } from "#app/data/pokemon-species"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; diff --git a/src/data/mystery-encounters/encounters/the-strong-stuff-encounter.ts b/src/data/mystery-encounters/encounters/the-strong-stuff-encounter.ts index c994c6e993f..af0363f37e3 100644 --- a/src/data/mystery-encounters/encounters/the-strong-stuff-encounter.ts +++ b/src/data/mystery-encounters/encounters/the-strong-stuff-encounter.ts @@ -17,7 +17,7 @@ import { getPokemonSpecies } from "#app/data/pokemon-species"; import { Species } from "#enums/species"; import { Nature } from "#enums/nature"; import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { queueEncounterMessage, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; import { modifyPlayerPokemonBST } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; import { Moves } from "#enums/moves"; diff --git a/src/data/mystery-encounters/encounters/trash-to-treasure-encounter.ts b/src/data/mystery-encounters/encounters/trash-to-treasure-encounter.ts index e60fe0ddc18..2203ac041f8 100644 --- a/src/data/mystery-encounters/encounters/trash-to-treasure-encounter.ts +++ b/src/data/mystery-encounters/encounters/trash-to-treasure-encounter.ts @@ -25,7 +25,7 @@ import { ModifierTier } from "#app/modifier/modifier-tier"; import { getPokemonSpecies } from "#app/data/pokemon-species"; import { Moves } from "#enums/moves"; import { BattlerIndex } from "#app/battle"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode"; import { randSeedInt } from "#app/utils"; diff --git a/src/data/mystery-encounters/encounters/uncommon-breed-encounter.ts b/src/data/mystery-encounters/encounters/uncommon-breed-encounter.ts index ed1866c7a1b..4e3c238aeba 100644 --- a/src/data/mystery-encounters/encounters/uncommon-breed-encounter.ts +++ b/src/data/mystery-encounters/encounters/uncommon-breed-encounter.ts @@ -10,7 +10,7 @@ import { import { CHARMING_MOVES } from "#app/data/mystery-encounters/requirements/requirement-groups"; import type Pokemon from "#app/field/pokemon"; import type { EnemyPokemon } from "#app/field/pokemon"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { globalScene } from "#app/global-scene"; import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; diff --git a/src/data/mystery-encounters/encounters/weird-dream-encounter.ts b/src/data/mystery-encounters/encounters/weird-dream-encounter.ts index 22ec52e976c..be0c0bdff54 100644 --- a/src/data/mystery-encounters/encounters/weird-dream-encounter.ts +++ b/src/data/mystery-encounters/encounters/weird-dream-encounter.ts @@ -16,7 +16,7 @@ import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import type { PlayerPokemon } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { NumberHolder, isNullOrUndefined, randSeedInt, randSeedShuffle } from "#app/utils"; import type PokemonSpecies from "#app/data/pokemon-species"; import { allSpecies, getPokemonSpecies } from "#app/data/pokemon-species"; diff --git a/src/data/mystery-encounters/mystery-encounter-requirements.ts b/src/data/mystery-encounters/mystery-encounter-requirements.ts index f9aedf2c1a7..0c146fe485d 100644 --- a/src/data/mystery-encounters/mystery-encounter-requirements.ts +++ b/src/data/mystery-encounters/mystery-encounter-requirements.ts @@ -1,6 +1,7 @@ import { globalScene } from "#app/global-scene"; import { allAbilities } from "#app/data/ability"; -import { EvolutionItem, pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; +import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; +import { EvolutionItem } from "#enums/evolution-item"; import { Nature } from "#enums/nature"; import { FormChangeItem, pokemonFormChanges, SpeciesFormChangeItemTrigger } from "#app/data/pokemon-forms"; import { StatusEffect } from "#enums/status-effect"; diff --git a/src/data/mystery-encounters/mystery-encounter.ts b/src/data/mystery-encounters/mystery-encounter.ts index ff098d4d7dd..8010983f9f3 100644 --- a/src/data/mystery-encounters/mystery-encounter.ts +++ b/src/data/mystery-encounters/mystery-encounter.ts @@ -1,5 +1,6 @@ import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import type { PlayerPokemon, PokemonMove } from "#app/field/pokemon"; +import type { PlayerPokemon } from "#app/field/pokemon"; +import type { PokemonMove } from "../moves/pokemon-move"; import type Pokemon from "#app/field/pokemon"; import { capitalizeFirstLetter, isNullOrUndefined } from "#app/utils"; import type { MysteryEncounterType } from "#enums/mystery-encounter-type"; diff --git a/src/data/mystery-encounters/requirements/can-learn-move-requirement.ts b/src/data/mystery-encounters/requirements/can-learn-move-requirement.ts index a7ffe3e26ca..598b0ffae70 100644 --- a/src/data/mystery-encounters/requirements/can-learn-move-requirement.ts +++ b/src/data/mystery-encounters/requirements/can-learn-move-requirement.ts @@ -1,6 +1,6 @@ import type { Moves } from "#app/enums/moves"; import type { PlayerPokemon } from "#app/field/pokemon"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { isNullOrUndefined } from "#app/utils"; import { EncounterPokemonRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements"; import { globalScene } from "#app/global-scene"; diff --git a/src/data/mystery-encounters/utils/encounter-phase-utils.ts b/src/data/mystery-encounters/utils/encounter-phase-utils.ts index a9f6b787878..6ab650d5f9b 100644 --- a/src/data/mystery-encounters/utils/encounter-phase-utils.ts +++ b/src/data/mystery-encounters/utils/encounter-phase-utils.ts @@ -7,9 +7,12 @@ import { WEIGHT_INCREMENT_ON_SPAWN_MISS, } from "#app/data/mystery-encounters/mystery-encounters"; import { showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import type { AiType, PlayerPokemon } from "#app/field/pokemon"; +import type { PlayerPokemon } from "#app/field/pokemon"; +import type { AiType } from "#enums/ai-type"; import type Pokemon from "#app/field/pokemon"; -import { EnemyPokemon, FieldPosition, PokemonMove, PokemonSummonData } from "#app/field/pokemon"; +import { EnemyPokemon, PokemonSummonData } from "#app/field/pokemon"; +import { FieldPosition } from "#enums/field-position"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import type { CustomModifierSettings, ModifierType } from "#app/modifier/modifier-type"; import { getPartyLuckValue, diff --git a/src/data/pokemon-forms.ts b/src/data/pokemon-forms.ts index 63e166c7fc4..6f36bfde74f 100644 --- a/src/data/pokemon-forms.ts +++ b/src/data/pokemon-forms.ts @@ -1,7 +1,7 @@ import { PokemonFormChangeItemModifier } from "../modifier/modifier"; import type Pokemon from "../field/pokemon"; import { StatusEffect } from "#enums/status-effect"; -import { allMoves } from "./moves/move"; +import { allMoves } from "./moves/all-moves"; import { MoveCategory } from "#enums/MoveCategory"; import type { Constructor, nil } from "#app/utils"; import { Abilities } from "#enums/abilities"; diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index a27c00121dc..ced828fbc6b 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -13,11 +13,8 @@ import { uncatchableSpecies } from "#app/data/balance/biomes"; import { speciesEggMoves } from "#app/data/balance/egg-moves"; import { GrowthRate } from "#app/data/exp"; import type { EvolutionLevel } from "#app/data/balance/pokemon-evolutions"; -import { - SpeciesWildEvolutionDelay, - pokemonEvolutions, - pokemonPrevolutions, -} from "#app/data/balance/pokemon-evolutions"; +import { pokemonEvolutions, pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions"; +import { SpeciesWildEvolutionDelay } from "#enums/species-wild-evolution-delay"; import { PokemonType } from "#enums/pokemon-type"; import type { LevelMoves } from "#app/data/balance/pokemon-level-moves"; import { diff --git a/src/data/trainers/trainer-config.ts b/src/data/trainers/trainer-config.ts index 0ab7119dab9..c87f72bd912 100644 --- a/src/data/trainers/trainer-config.ts +++ b/src/data/trainers/trainer-config.ts @@ -1,6 +1,6 @@ import { globalScene } from "#app/global-scene"; import { modifierTypes } from "#app/modifier/modifier-type"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { toReadableString, isNullOrUndefined, randSeedItem, randSeedInt } from "#app/utils"; import { pokemonEvolutions, pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions"; import { getPokemonSpecies } from "#app/data/pokemon-species"; diff --git a/src/enums/ai-type.ts b/src/enums/ai-type.ts new file mode 100644 index 00000000000..13931172a4a --- /dev/null +++ b/src/enums/ai-type.ts @@ -0,0 +1,5 @@ +export enum AiType { + RANDOM, + SMART_RANDOM, + SMART +} diff --git a/src/enums/evolution-item.ts b/src/enums/evolution-item.ts new file mode 100644 index 00000000000..3b5e493b378 --- /dev/null +++ b/src/enums/evolution-item.ts @@ -0,0 +1,48 @@ +export enum EvolutionItem { + NONE, + + LINKING_CORD, + SUN_STONE, + MOON_STONE, + LEAF_STONE, + FIRE_STONE, + WATER_STONE, + THUNDER_STONE, + ICE_STONE, + DUSK_STONE, + DAWN_STONE, + SHINY_STONE, + CRACKED_POT, + SWEET_APPLE, + TART_APPLE, + STRAWBERRY_SWEET, + UNREMARKABLE_TEACUP, + UPGRADE, + DUBIOUS_DISC, + DRAGON_SCALE, + PRISM_SCALE, + RAZOR_CLAW, + RAZOR_FANG, + REAPER_CLOTH, + ELECTIRIZER, + MAGMARIZER, + PROTECTOR, + SACHET, + WHIPPED_DREAM, + SYRUPY_APPLE, + CHIPPED_POT, + GALARICA_CUFF, + GALARICA_WREATH, + AUSPICIOUS_ARMOR, + MALICIOUS_ARMOR, + MASTERPIECE_TEACUP, + SUN_FLUTE, + MOON_FLUTE, + + BLACK_AUGURITE = 51, + PEAT_BLOCK, + METAL_ALLOY, + SCROLL_OF_DARKNESS, + SCROLL_OF_WATERS, + LEADERS_CREST +} diff --git a/src/enums/field-position.ts b/src/enums/field-position.ts new file mode 100644 index 00000000000..5b7f9c6c570 --- /dev/null +++ b/src/enums/field-position.ts @@ -0,0 +1,5 @@ +export enum FieldPosition { + CENTER, + LEFT, + RIGHT +} diff --git a/src/enums/hit-result.ts b/src/enums/hit-result.ts new file mode 100644 index 00000000000..3e62587dd6c --- /dev/null +++ b/src/enums/hit-result.ts @@ -0,0 +1,15 @@ +export enum HitResult { + EFFECTIVE = 1, + SUPER_EFFECTIVE, + NOT_VERY_EFFECTIVE, + ONE_HIT_KO, + NO_EFFECT, + STATUS, + HEAL, + FAIL, + MISS, + INDIRECT, + IMMUNE, + CONFUSION, + INDIRECT_KO +} diff --git a/src/enums/learn-move-context.ts b/src/enums/learn-move-context.ts new file mode 100644 index 00000000000..26001cbcce8 --- /dev/null +++ b/src/enums/learn-move-context.ts @@ -0,0 +1,8 @@ +export enum LearnMoveContext { + MISC, + LEVEL_UP, + RELEARN, + EVOLUTION, + EVOLUTION_FUSED, // If fusionSpecies has Evolved + EVOLUTION_FUSED_BASE, // If fusion's base species has Evolved +} diff --git a/src/enums/species-wild-evolution-delay.ts b/src/enums/species-wild-evolution-delay.ts new file mode 100644 index 00000000000..7555dc0e8f6 --- /dev/null +++ b/src/enums/species-wild-evolution-delay.ts @@ -0,0 +1,8 @@ +export enum SpeciesWildEvolutionDelay { + NONE, + SHORT, + MEDIUM, + LONG, + VERY_LONG, + NEVER +} diff --git a/src/field/damage-number-handler.ts b/src/field/damage-number-handler.ts index a527b148fff..3bb001bf005 100644 --- a/src/field/damage-number-handler.ts +++ b/src/field/damage-number-handler.ts @@ -1,7 +1,7 @@ import { TextStyle, addTextObject } from "../ui/text"; -import type { DamageResult } from "./pokemon"; +import type { DamageResult } from "#app/@types/damage-result"; import type Pokemon from "./pokemon"; -import { HitResult } from "./pokemon"; +import { HitResult } from "#enums/hit-result"; import { formatStat, fixedInt } from "#app/utils"; import type { BattlerIndex } from "../battle"; import { globalScene } from "#app/global-scene"; diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index b59b7ba01fe..162a5118f65 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -17,7 +17,6 @@ import { applyMoveAttrs, FixedDamageAttr, VariableAtkAttr, - allMoves, TypelessAttr, CritOnlyAttr, getMoveTargets, @@ -42,6 +41,7 @@ import { VariableMoveTypeChartAttr, HpSplitAttr, } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { MoveTarget } from "#enums/MoveTarget"; import { MoveCategory } from "#enums/MoveCategory"; import type { PokemonSpeciesForm } from "#app/data/pokemon-species"; @@ -214,7 +214,7 @@ import { SpeciesFormChangeActiveTrigger, SpeciesFormChangeLapseTeraTrigger, SpeciesFormChangeMoveLearnedTrigger, - SpeciesFormChangePostMoveTrigger + SpeciesFormChangePostMoveTrigger, } from "#app/data/pokemon-forms"; import { TerrainType } from "#app/data/terrain"; import type { TrainerSlot } from "#enums/trainer-slot"; @@ -259,21 +259,15 @@ import { MoveFlags } from "#enums/MoveFlags"; import { timedEventManager } from "#app/global-event-manager"; import { loadMoveAnimations } from "#app/sprites/pokemon-asset-loader"; import { ResetStatusPhase } from "#app/phases/reset-status-phase"; - -export enum LearnMoveSituation { - MISC, - LEVEL_UP, - RELEARN, - EVOLUTION, - EVOLUTION_FUSED, // If fusionSpecies has Evolved - EVOLUTION_FUSED_BASE, // If fusion's base species has Evolved -} - -export enum FieldPosition { - CENTER, - LEFT, - RIGHT, -} +import { LearnMoveContext } from "#enums/learn-move-context"; +import { TurnMove } from "#app/interfaces/turn-move"; +import { AiType } from "#enums/ai-type"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { DamageCalculationResult } from "#app/interfaces/damage-calculation-result"; +import { FieldPosition } from "#enums/field-position"; +import { AttackMoveResult } from "#app/interfaces/attack-move-result"; +import { HitResult } from "#enums/hit-result"; +import { DamageResult } from "#app/@types/damage-result"; export default abstract class Pokemon extends Phaser.GameObjects.Container { public id: number; @@ -2925,7 +2919,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { includeEvolutionMoves = false, simulateEvolutionChain = false, includeRelearnerMoves = false, - learnSituation: LearnMoveSituation = LearnMoveSituation.MISC, + learnSituation: LearnMoveContext = LearnMoveContext.MISC, ): LevelMoves { const ret: LevelMoves = []; let levelMoves: LevelMoves = []; @@ -2933,7 +2927,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { startingLevel = this.level; } if ( - learnSituation === LearnMoveSituation.EVOLUTION_FUSED && + learnSituation === LearnMoveContext.EVOLUTION_FUSED && this.fusionSpecies ) { // For fusion evolutions, get ONLY the moves of the component mon that evolved @@ -2985,7 +2979,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } if ( this.fusionSpecies && - learnSituation !== LearnMoveSituation.EVOLUTION_FUSED_BASE + learnSituation !== LearnMoveContext.EVOLUTION_FUSED_BASE ) { // For fusion evolutions, get ONLY the moves of the component mon that evolved if (simulateEvolutionChain) { @@ -7779,24 +7773,6 @@ interface IllusionData { level?: number } -export interface TurnMove { - move: Moves; - targets: BattlerIndex[]; - result?: MoveResult; - virtual?: boolean; - turn?: number; - ignorePP?: boolean; -} - -export interface AttackMoveResult { - move: Moves; - result: DamageResult; - damage: number; - critical: boolean; - sourceId: number; - sourceBattlerIndex: BattlerIndex; -} - export class PokemonSummonData { /** [Atk, Def, SpAtk, SpDef, Spd, Acc, Eva] */ public statStages: number[] = [0, 0, 0, 0, 0, 0, 0]; @@ -7869,12 +7845,6 @@ export class PokemonTurnData { public extraTurns = 0; } -export enum AiType { - RANDOM, - SMART_RANDOM, - SMART, -} - export enum MoveResult { PENDING, SUCCESS, @@ -7882,151 +7852,3 @@ export enum MoveResult { MISS, OTHER, } - -export enum HitResult { - EFFECTIVE = 1, - SUPER_EFFECTIVE, - NOT_VERY_EFFECTIVE, - ONE_HIT_KO, - NO_EFFECT, - STATUS, - HEAL, - FAIL, - MISS, - INDIRECT, - IMMUNE, - CONFUSION, - INDIRECT_KO, -} - -export type DamageResult = - | HitResult.EFFECTIVE - | HitResult.SUPER_EFFECTIVE - | HitResult.NOT_VERY_EFFECTIVE - | HitResult.ONE_HIT_KO - | HitResult.CONFUSION - | HitResult.INDIRECT_KO - | HitResult.INDIRECT; - -/** Interface containing the results of a damage calculation for a given move */ -export interface DamageCalculationResult { - /** `true` if the move was cancelled (thus suppressing "No Effect" messages) */ - cancelled: boolean; - /** The effectiveness of the move */ - result: HitResult; - /** The damage dealt by the move */ - damage: number; -} - -/** - * Wrapper class for the {@linkcode Move} class for Pokemon to interact with. - * These are the moves assigned to a {@linkcode Pokemon} object. - * It links to {@linkcode Move} class via the move ID. - * Compared to {@linkcode Move}, this class also tracks if a move has received. - * PP Ups, amount of PP used, and things like that. - * @see {@linkcode isUsable} - checks if move is restricted, out of PP, or not implemented. - * @see {@linkcode getMove} - returns {@linkcode Move} object by looking it up via ID. - * @see {@linkcode usePp} - removes a point of PP from the move. - * @see {@linkcode getMovePp} - returns amount of PP a move currently has. - * @see {@linkcode getPpRatio} - returns the current PP amount / max PP amount. - * @see {@linkcode getName} - returns name of {@linkcode Move}. - **/ -export class PokemonMove { - public moveId: Moves; - public ppUsed: number; - public ppUp: number; - public virtual: boolean; - - /** - * If defined and nonzero, overrides the maximum PP of the move (e.g., due to move being copied by Transform). - * This also nullifies all effects of `ppUp`. - */ - public maxPpOverride?: number; - - constructor( - moveId: Moves, - ppUsed = 0, - ppUp = 0, - virtual = false, - maxPpOverride?: number, - ) { - this.moveId = moveId; - this.ppUsed = ppUsed; - this.ppUp = ppUp; - this.virtual = virtual; - this.maxPpOverride = maxPpOverride; - } - - /** - * Checks whether the move can be selected or performed by a Pokemon, without consideration for the move's targets. - * The move is unusable if it is out of PP, restricted by an effect, or unimplemented. - * - * @param {Pokemon} pokemon {@linkcode Pokemon} that would be using this move - * @param {boolean} ignorePp If `true`, skips the PP check - * @param {boolean} ignoreRestrictionTags If `true`, skips the check for move restriction tags (see {@link MoveRestrictionBattlerTag}) - * @returns `true` if the move can be selected and used by the Pokemon, otherwise `false`. - */ - isUsable( - pokemon: Pokemon, - ignorePp = false, - ignoreRestrictionTags = false, - ): boolean { - if ( - this.moveId && - !ignoreRestrictionTags && - pokemon.isMoveRestricted(this.moveId, pokemon) - ) { - return false; - } - - if (this.getMove().name.endsWith(" (N)")) { - return false; - } - - return ( - ignorePp || this.ppUsed < this.getMovePp() || this.getMove().pp === -1 - ); - } - - getMove(): Move { - return allMoves[this.moveId]; - } - - /** - * Sets {@link ppUsed} for this move and ensures the value does not exceed {@link getMovePp} - * @param {number} count Amount of PP to use - */ - usePp(count = 1) { - this.ppUsed = Math.min(this.ppUsed + count, this.getMovePp()); - } - - getMovePp(): number { - return ( - this.maxPpOverride || - this.getMove().pp + this.ppUp * toDmgValue(this.getMove().pp / 5) - ); - } - - getPpRatio(): number { - return 1 - this.ppUsed / this.getMovePp(); - } - - getName(): string { - return this.getMove().name; - } - - /** - * Copies an existing move or creates a valid PokemonMove object from json representing one - * @param {PokemonMove | any} source The data for the move to copy - * @return {PokemonMove} A valid pokemonmove object - */ - static loadMove(source: PokemonMove | any): PokemonMove { - return new PokemonMove( - source.moveId, - source.ppUsed, - source.ppUp, - source.virtual, - source.maxPpOverride, - ); - } -} diff --git a/src/interfaces/attack-move-result.ts b/src/interfaces/attack-move-result.ts new file mode 100644 index 00000000000..f91d31a69ee --- /dev/null +++ b/src/interfaces/attack-move-result.ts @@ -0,0 +1,12 @@ +import type { BattlerIndex } from "#app/battle"; +import type { DamageResult } from "#app/@types/damage-result"; +import type { Moves } from "#enums/moves"; + +export interface AttackMoveResult { + move: Moves; + result: DamageResult; + damage: number; + critical: boolean; + sourceId: number; + sourceBattlerIndex: BattlerIndex; +} diff --git a/src/interfaces/damage-calculation-result.ts b/src/interfaces/damage-calculation-result.ts new file mode 100644 index 00000000000..1220ff7b57d --- /dev/null +++ b/src/interfaces/damage-calculation-result.ts @@ -0,0 +1,11 @@ +import type { HitResult } from "#enums/hit-result"; + +/** Interface containing the results of a damage calculation for a given move */ +export interface DamageCalculationResult { + /** `true` if the move was cancelled (thus suppressing "No Effect" messages) */ + cancelled: boolean; + /** The effectiveness of the move */ + result: HitResult; + /** The damage dealt by the move */ + damage: number; +} diff --git a/src/interfaces/turn-move.ts b/src/interfaces/turn-move.ts new file mode 100644 index 00000000000..639d309256e --- /dev/null +++ b/src/interfaces/turn-move.ts @@ -0,0 +1,12 @@ +import type { BattlerIndex } from "#app/battle"; +import type { MoveResult } from "#app/field/pokemon"; +import type { Moves } from "#enums/moves"; + +export interface TurnMove { + move: Moves; + targets: BattlerIndex[]; + result?: MoveResult; + virtual?: boolean; + turn?: number; + ignorePP?: boolean; +} diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 8feb60c7778..852593d922c 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -1,8 +1,10 @@ import { globalScene } from "#app/global-scene"; -import { EvolutionItem, pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; +import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; +import { EvolutionItem } from "#enums/evolution-item"; import { tmPoolTiers, tmSpecies } from "#app/data/balance/tms"; import { getBerryEffectDescription, getBerryName } from "#app/data/berry"; -import { allMoves, AttackMove } from "#app/data/moves/move"; +import { AttackMove } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { getNatureName, getNatureStatMultiplier } from "#app/data/nature"; import { getPokeballCatchMultiplier, getPokeballName, MAX_PER_TYPE_POKEBALLS } from "#app/data/pokeball"; import { @@ -13,7 +15,8 @@ import { } from "#app/data/pokemon-forms"; import { getStatusEffectDescriptor } from "#app/data/status-effect"; import { PokemonType } from "#enums/pokemon-type"; -import type { EnemyPokemon, PlayerPokemon, PokemonMove } from "#app/field/pokemon"; +import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; +import type { PokemonMove } from "#app/data/moves/pokemon-move"; import type Pokemon from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; import { diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 80f14ba22ce..7860d0f9296 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -1,7 +1,7 @@ import { FusionSpeciesFormEvolution, pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; import { getBerryEffectFunc, getBerryPredicate } from "#app/data/berry"; import { getLevelTotalExp } from "#app/data/exp"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { MAX_PER_TYPE_POKEBALLS } from "#app/data/pokeball"; import { type FormChangeItem, SpeciesFormChangeItemTrigger } from "#app/data/pokemon-forms"; import { getStatusEffectHealText } from "#app/data/status-effect"; diff --git a/src/overrides.ts b/src/overrides.ts index 21c72cd7b98..49efb5eed33 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -1,5 +1,5 @@ import { type PokeballCounts } from "#app/battle-scene"; -import { EvolutionItem } from "#app/data/balance/pokemon-evolutions"; +import { EvolutionItem } from "#enums/evolution-item"; import { Gender } from "#app/data/gender"; import { FormChangeItem } from "#app/data/pokemon-forms"; import { Variant } from "#app/sprites/variant"; diff --git a/src/phases/command-phase.ts b/src/phases/command-phase.ts index 8691ac453ca..c65f121d20e 100644 --- a/src/phases/command-phase.ts +++ b/src/phases/command-phase.ts @@ -11,8 +11,9 @@ import { BattlerTagType } from "#app/enums/battler-tag-type"; import { Biome } from "#app/enums/biome"; import { Moves } from "#app/enums/moves"; import { PokeballType } from "#enums/pokeball"; -import type { PlayerPokemon, TurnMove } from "#app/field/pokemon"; -import { FieldPosition } from "#app/field/pokemon"; +import type { PlayerPokemon } from "#app/field/pokemon"; +import type { TurnMove } from "#app/interfaces/turn-move"; +import { FieldPosition } from "#enums/field-position"; import { getPokemonNameWithAffix } from "#app/messages"; import { Command } from "#app/ui/command-ui-handler"; import { Mode } from "#app/ui/ui"; diff --git a/src/phases/damage-anim-phase.ts b/src/phases/damage-anim-phase.ts index 696a2e55b6f..91b21376515 100644 --- a/src/phases/damage-anim-phase.ts +++ b/src/phases/damage-anim-phase.ts @@ -1,7 +1,8 @@ import { globalScene } from "#app/global-scene"; import type { BattlerIndex } from "#app/battle"; import { BattleSpec } from "#enums/battle-spec"; -import { type DamageResult, HitResult } from "#app/field/pokemon"; +import type { DamageResult } from "#app/@types/damage-result"; +import { HitResult } from "#enums/hit-result"; import { fixedInt } from "#app/utils"; import { PokemonPhase } from "#app/phases/pokemon-phase"; diff --git a/src/phases/encounter-phase.ts b/src/phases/encounter-phase.ts index 15f3d102e41..9e28de32c4a 100644 --- a/src/phases/encounter-phase.ts +++ b/src/phases/encounter-phase.ts @@ -11,7 +11,7 @@ import { TrainerSlot } from "#enums/trainer-slot"; import { getRandomWeatherType } from "#app/data/weather"; import { EncounterPhaseEvent } from "#app/events/battle-scene"; import type Pokemon from "#app/field/pokemon"; -import { FieldPosition } from "#app/field/pokemon"; +import { FieldPosition } from "#enums/field-position"; import { getPokemonNameWithAffix } from "#app/messages"; import { BoostBugSpawnModifier, IvScannerModifier, TurnHeldItemTransferModifier } from "#app/modifier/modifier"; import { ModifierPoolType, regenerateModifierPoolThresholds } from "#app/modifier/modifier-type"; diff --git a/src/phases/evolution-phase.ts b/src/phases/evolution-phase.ts index 203c7542eff..076b7dec80d 100644 --- a/src/phases/evolution-phase.ts +++ b/src/phases/evolution-phase.ts @@ -10,7 +10,7 @@ import { Mode } from "#app/ui/ui"; import { cos, sin } from "#app/field/anims"; import type { PlayerPokemon } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; -import { LearnMoveSituation } from "#app/field/pokemon"; +import { LearnMoveContext } from "#enums/learn-move-context"; import { getTypeRgb } from "#app/data/type"; import i18next from "i18next"; import { getPokemonNameWithAffix } from "#app/messages"; @@ -343,11 +343,11 @@ export class EvolutionPhase extends Phase { this.evolutionHandler.canCancel = false; this.pokemon.evolve(this.evolution, this.pokemon.species).then(() => { - const learnSituation: LearnMoveSituation = this.fusionSpeciesEvolved - ? LearnMoveSituation.EVOLUTION_FUSED + const learnSituation: LearnMoveContext = this.fusionSpeciesEvolved + ? LearnMoveContext.EVOLUTION_FUSED : this.pokemon.fusionSpecies - ? LearnMoveSituation.EVOLUTION_FUSED_BASE - : LearnMoveSituation.EVOLUTION; + ? LearnMoveContext.EVOLUTION_FUSED_BASE + : LearnMoveContext.EVOLUTION; const levelMoves = this.pokemon .getLevelMoves(this.lastLevel + 1, true, false, false, learnSituation) .filter(lm => lm[0] === EVOLVE_MOVE); diff --git a/src/phases/faint-phase.ts b/src/phases/faint-phase.ts index 7e1ae4ec07b..4c418679047 100644 --- a/src/phases/faint-phase.ts +++ b/src/phases/faint-phase.ts @@ -12,13 +12,16 @@ import { import type { DestinyBondTag, GrudgeTag } from "#app/data/battler-tags"; import { BattlerTagLapseType } from "#app/data/battler-tags"; import { battleSpecDialogue } from "#app/data/dialogue"; -import { allMoves, PostVictoryStatStageChangeAttr } from "#app/data/moves/move"; +import { PostVictoryStatStageChangeAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms"; import { BattleSpec } from "#app/enums/battle-spec"; import { StatusEffect } from "#app/enums/status-effect"; import type { EnemyPokemon } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; -import { HitResult, PlayerPokemon, PokemonMove } from "#app/field/pokemon"; +import { PlayerPokemon } from "#app/field/pokemon"; +import { HitResult } from "#enums/hit-result"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { getPokemonNameWithAffix } from "#app/messages"; import { PokemonInstantReviveModifier } from "#app/modifier/modifier"; import { SwitchType } from "#enums/switch-type"; diff --git a/src/phases/learn-move-phase.ts b/src/phases/learn-move-phase.ts index 4107a9cf087..a939298f620 100644 --- a/src/phases/learn-move-phase.ts +++ b/src/phases/learn-move-phase.ts @@ -1,7 +1,7 @@ import { globalScene } from "#app/global-scene"; import { initMoveAnim, loadMoveAnimAssets } from "#app/data/battle-anims"; import type Move from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { SpeciesFormChangeMoveLearnedTrigger } from "#app/data/pokemon-forms"; import { Moves } from "#enums/moves"; import { getPokemonNameWithAffix } from "#app/messages"; diff --git a/src/phases/move-charge-phase.ts b/src/phases/move-charge-phase.ts index 26ad85bbe03..ccaf6d054b9 100644 --- a/src/phases/move-charge-phase.ts +++ b/src/phases/move-charge-phase.ts @@ -2,7 +2,7 @@ import { globalScene } from "#app/global-scene"; import type { BattlerIndex } from "#app/battle"; import { MoveChargeAnim } from "#app/data/battle-anims"; import { applyMoveChargeAttrs, MoveEffectAttr, InstantChargeAttr } from "#app/data/moves/move"; -import type { PokemonMove } from "#app/field/pokemon"; +import type { PokemonMove } from "#app/data/moves/pokemon-move"; import type Pokemon from "#app/field/pokemon"; import { MoveResult } from "#app/field/pokemon"; import { BooleanHolder } from "#app/utils"; diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index acc7ac0f63a..c13c411be68 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -49,9 +49,10 @@ import { MoveTarget } from "#enums/MoveTarget"; import { MoveCategory } from "#enums/MoveCategory"; import { SpeciesFormChangePostMoveTrigger } from "#app/data/pokemon-forms"; import { PokemonType } from "#enums/pokemon-type"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import type Pokemon from "#app/field/pokemon"; -import { HitResult, MoveResult } from "#app/field/pokemon"; +import { MoveResult } from "#app/field/pokemon"; +import { HitResult } from "#enums/hit-result"; import { getPokemonNameWithAffix } from "#app/messages"; import { ContactHeldItemTransferChanceModifier, diff --git a/src/phases/move-header-phase.ts b/src/phases/move-header-phase.ts index c320df462d1..c255b45190b 100644 --- a/src/phases/move-header-phase.ts +++ b/src/phases/move-header-phase.ts @@ -1,5 +1,5 @@ import { applyMoveAttrs, MoveHeaderAttr } from "#app/data/moves/move"; -import type { PokemonMove } from "#app/field/pokemon"; +import type { PokemonMove } from "#app/data/moves/pokemon-move"; import type Pokemon from "#app/field/pokemon"; import { BattlePhase } from "./battle-phase"; diff --git a/src/phases/move-phase.ts b/src/phases/move-phase.ts index 478229dcae8..032ac6d06ab 100644 --- a/src/phases/move-phase.ts +++ b/src/phases/move-phase.ts @@ -16,7 +16,6 @@ import { CommonAnim } from "#app/data/battle-anims"; import { BattlerTagLapseType, CenterOfAttentionTag } from "#app/data/battler-tags"; import { AddArenaTrapTagAttr, - allMoves, applyMoveAttrs, BypassRedirectAttr, BypassSleepAttr, @@ -27,13 +26,14 @@ import { PreMoveMessageAttr, PreUseInterruptAttr, } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { MoveFlags } from "#enums/MoveFlags"; import { SpeciesFormChangePreMoveTrigger } from "#app/data/pokemon-forms"; import { getStatusEffectActivationText, getStatusEffectHealText } from "#app/data/status-effect"; import { PokemonType } from "#enums/pokemon-type"; import { getTerrainBlockMessage, getWeatherBlockMessage } from "#app/data/weather"; import { MoveUsedEvent } from "#app/events/battle-scene"; -import type { PokemonMove } from "#app/field/pokemon"; +import type { PokemonMove } from "#app/data/moves/pokemon-move"; import type Pokemon from "#app/field/pokemon"; import { MoveResult } from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; diff --git a/src/phases/pokemon-heal-phase.ts b/src/phases/pokemon-heal-phase.ts index 651c625b23a..84dc8a5e116 100644 --- a/src/phases/pokemon-heal-phase.ts +++ b/src/phases/pokemon-heal-phase.ts @@ -3,7 +3,7 @@ import type { BattlerIndex } from "#app/battle"; import { CommonAnim } from "#app/data/battle-anims"; import { getStatusEffectHealText } from "#app/data/status-effect"; import { StatusEffect } from "#app/enums/status-effect"; -import { HitResult } from "#app/field/pokemon"; +import { HitResult } from "#enums/hit-result"; import { getPokemonNameWithAffix } from "#app/messages"; import { HealingBoosterModifier } from "#app/modifier/modifier"; import { HealAchv } from "#app/system/achv"; diff --git a/src/phases/pokemon-transform-phase.ts b/src/phases/pokemon-transform-phase.ts index b33689321b5..fb9a28a5a26 100644 --- a/src/phases/pokemon-transform-phase.ts +++ b/src/phases/pokemon-transform-phase.ts @@ -2,7 +2,7 @@ import type { BattlerIndex } from "#app/battle"; import { BattlerTagType } from "#enums/battler-tag-type"; import { Moves } from "#enums/moves"; import { EFFECTIVE_STATS, BATTLE_STATS } from "#enums/stat"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { globalScene } from "#app/global-scene"; import { PokemonPhase } from "./pokemon-phase"; import { getPokemonNameWithAffix } from "#app/messages"; diff --git a/src/phases/select-target-phase.ts b/src/phases/select-target-phase.ts index 035eaff41fa..edd56ba60ed 100644 --- a/src/phases/select-target-phase.ts +++ b/src/phases/select-target-phase.ts @@ -5,7 +5,7 @@ import { Mode } from "#app/ui/ui"; import { CommandPhase } from "./command-phase"; import { PokemonPhase } from "./pokemon-phase"; import i18next from "#app/plugins/i18n"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; export class SelectTargetPhase extends PokemonPhase { // biome-ignore lint/complexity/noUselessConstructor: This makes `fieldIndex` required diff --git a/src/phases/summon-phase.ts b/src/phases/summon-phase.ts index 7379d509e55..e053b18e4d7 100644 --- a/src/phases/summon-phase.ts +++ b/src/phases/summon-phase.ts @@ -5,7 +5,7 @@ import { TrainerSlot } from "#enums/trainer-slot"; import { PlayerGender } from "#app/enums/player-gender"; import { addPokeballOpenParticles } from "#app/field/anims"; import type Pokemon from "#app/field/pokemon"; -import { FieldPosition } from "#app/field/pokemon"; +import { FieldPosition } from "#enums/field-position"; import { getPokemonNameWithAffix } from "#app/messages"; import i18next from "i18next"; import { PartyMemberPokemonPhase } from "./party-member-pokemon-phase"; diff --git a/src/phases/switch-summon-phase.ts b/src/phases/switch-summon-phase.ts index d63cdb90f25..f39a3e62bb6 100644 --- a/src/phases/switch-summon-phase.ts +++ b/src/phases/switch-summon-phase.ts @@ -6,7 +6,8 @@ import { PreSummonAbAttr, PreSwitchOutAbAttr, } from "#app/data/ability"; -import { allMoves, ForceSwitchOutAttr } from "#app/data/moves/move"; +import { ForceSwitchOutAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { getPokeballTintColor } from "#app/data/pokeball"; import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms"; import { TrainerSlot } from "#enums/trainer-slot"; diff --git a/src/phases/toggle-double-position-phase.ts b/src/phases/toggle-double-position-phase.ts index 37f47d5cf95..c4766f888aa 100644 --- a/src/phases/toggle-double-position-phase.ts +++ b/src/phases/toggle-double-position-phase.ts @@ -1,5 +1,5 @@ import { globalScene } from "#app/global-scene"; -import { FieldPosition } from "#app/field/pokemon"; +import { FieldPosition } from "#enums/field-position"; import { BattlePhase } from "./battle-phase"; export class ToggleDoublePositionPhase extends BattlePhase { diff --git a/src/phases/turn-start-phase.ts b/src/phases/turn-start-phase.ts index d5b4160fe1b..5941e0af163 100644 --- a/src/phases/turn-start-phase.ts +++ b/src/phases/turn-start-phase.ts @@ -1,9 +1,10 @@ import { applyAbAttrs, BypassSpeedChanceAbAttr, PreventBypassSpeedChanceAbAttr } from "#app/data/ability"; -import { allMoves, MoveHeaderAttr } from "#app/data/moves/move"; +import { MoveHeaderAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#app/enums/abilities"; import { Stat } from "#app/enums/stat"; import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { BypassSpeedChanceModifier } from "#app/modifier/modifier"; import { Command } from "#app/ui/command-ui-handler"; import { randSeedShuffle, BooleanHolder } from "#app/utils"; diff --git a/src/phases/weather-effect-phase.ts b/src/phases/weather-effect-phase.ts index 5284c9fba85..256894457fc 100644 --- a/src/phases/weather-effect-phase.ts +++ b/src/phases/weather-effect-phase.ts @@ -14,7 +14,7 @@ import { getWeatherDamageMessage, getWeatherLapseMessage } from "#app/data/weath import { BattlerTagType } from "#app/enums/battler-tag-type"; import { WeatherType } from "#app/enums/weather-type"; import type Pokemon from "#app/field/pokemon"; -import { HitResult } from "#app/field/pokemon"; +import { HitResult } from "#enums/hit-result"; import { BooleanHolder, toDmgValue } from "#app/utils"; import { CommonAnimPhase } from "./common-anim-phase"; diff --git a/src/system/game-data.ts b/src/system/game-data.ts index 53146301666..e87c735f459 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -30,7 +30,7 @@ import { Nature } from "#enums/nature"; import { GameStats } from "#app/system/game-stats"; import { Tutorial } from "#app/tutorial"; import { speciesEggMoves } from "#app/data/balance/egg-moves"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { TrainerVariant } from "#app/field/trainer"; import type { Variant } from "#app/sprites/variant"; import { setSettingGamepad, SettingGamepad, settingGamepadDefaults } from "#app/system/settings/settings-gamepad"; diff --git a/src/system/pokemon-data.ts b/src/system/pokemon-data.ts index 97ce494a43a..7579fc3b78d 100644 --- a/src/system/pokemon-data.ts +++ b/src/system/pokemon-data.ts @@ -5,7 +5,8 @@ import type { Nature } from "#enums/nature"; import type { PokeballType } from "#enums/pokeball"; import { getPokemonSpecies, getPokemonSpeciesForm } from "../data/pokemon-species"; import { Status } from "../data/status-effect"; -import Pokemon, { EnemyPokemon, PokemonMove, PokemonSummonData } from "../field/pokemon"; +import Pokemon, { EnemyPokemon, PokemonSummonData } from "../field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { TrainerSlot } from "#enums/trainer-slot"; import type { Variant } from "#app/sprites/variant"; import { loadBattlerTag } from "../data/battler-tags"; diff --git a/src/ui/fight-ui-handler.ts b/src/ui/fight-ui-handler.ts index 27985629e3d..63c0703fa18 100644 --- a/src/ui/fight-ui-handler.ts +++ b/src/ui/fight-ui-handler.ts @@ -10,7 +10,7 @@ import { getLocalizedSpriteKey, fixedInt, padInt } from "#app/utils"; import { MoveCategory } from "#enums/MoveCategory"; import i18next from "i18next"; import { Button } from "#enums/buttons"; -import type { PokemonMove } from "#app/field/pokemon"; +import type { PokemonMove } from "#app/data/moves/pokemon-move"; import type Pokemon from "#app/field/pokemon"; import type { CommandPhase } from "#app/phases/command-phase"; import MoveInfoOverlay from "./move-info-overlay"; diff --git a/src/ui/modifier-select-ui-handler.ts b/src/ui/modifier-select-ui-handler.ts index 26351d4dbf1..f0ff351bb8a 100644 --- a/src/ui/modifier-select-ui-handler.ts +++ b/src/ui/modifier-select-ui-handler.ts @@ -9,7 +9,7 @@ import { LockModifierTiersModifier, PokemonHeldItemModifier, HealShopCostModifie import { handleTutorial, Tutorial } from "../tutorial"; import { Button } from "#enums/buttons"; import MoveInfoOverlay from "./move-info-overlay"; -import { allMoves } from "../data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { formatMoney, NumberHolder } from "#app/utils"; import Overrides from "#app/overrides"; import i18next from "i18next"; diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index ba90108c274..a42e0caadae 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -1,4 +1,5 @@ -import type { PlayerPokemon, PokemonMove } from "#app/field/pokemon"; +import type { PlayerPokemon } from "#app/field/pokemon"; +import type { PokemonMove } from "#app/data/moves/pokemon-move"; import type Pokemon from "#app/field/pokemon"; import { MoveResult } from "#app/field/pokemon"; import { addBBCodeTextObject, addTextObject, getTextColor, TextStyle } from "#app/ui/text"; @@ -11,7 +12,8 @@ import { PokemonHeldItemModifier, SwitchEffectTransferModifier, } from "#app/modifier/modifier"; -import { allMoves, ForceSwitchOutAttr } from "#app/data/moves/move"; +import { ForceSwitchOutAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Gender, getGenderColor, getGenderSymbol } from "#app/data/gender"; import { StatusEffect } from "#enums/status-effect"; import PokemonIconAnimHandler, { PokemonIconAnimMode } from "#app/ui/pokemon-icon-anim-handler"; diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index 407ebfcd843..1011fc89ae0 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -9,7 +9,7 @@ import { allAbilities } from "#app/data/ability"; import { speciesEggMoves } from "#app/data/balance/egg-moves"; import { GrowthRate, getGrowthRateColor } from "#app/data/exp"; import { Gender, getGenderColor, getGenderSymbol } from "#app/data/gender"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { getNatureName } from "#app/data/nature"; import type { SpeciesFormChange } from "#app/data/pokemon-forms"; import { pokemonFormChanges } from "#app/data/pokemon-forms"; diff --git a/src/ui/pokedex-scan-ui-handler.ts b/src/ui/pokedex-scan-ui-handler.ts index b34246b97d1..54c32fb34a1 100644 --- a/src/ui/pokedex-scan-ui-handler.ts +++ b/src/ui/pokedex-scan-ui-handler.ts @@ -7,7 +7,7 @@ import { isNullOrUndefined } from "#app/utils"; import { Mode } from "./ui"; import { FilterTextRow } from "./filter-text"; import { allAbilities } from "#app/data/ability"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; 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..22ce5b833af 100644 --- a/src/ui/pokedex-ui-handler.ts +++ b/src/ui/pokedex-ui-handler.ts @@ -38,7 +38,7 @@ import type { OptionSelectConfig } from "./abstact-option-select-ui-handler"; import { FilterText, FilterTextRow } from "./filter-text"; import { allAbilities } from "#app/data/ability"; import { starterPassiveAbilities } from "#app/data/balance/passives"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { speciesTmMoves } from "#app/data/balance/tms"; import { pokemonPrevolutions, pokemonStarters } from "#app/data/balance/pokemon-evolutions"; import { Biome } from "#enums/biome"; diff --git a/src/ui/pokemon-hatch-info-container.ts b/src/ui/pokemon-hatch-info-container.ts index 692f0f1d374..77f9f5090a0 100644 --- a/src/ui/pokemon-hatch-info-container.ts +++ b/src/ui/pokemon-hatch-info-container.ts @@ -4,7 +4,7 @@ import { PokemonType } from "#enums/pokemon-type"; import { rgbHexToRgba, padInt } from "#app/utils"; import { TextStyle, addTextObject } from "#app/ui/text"; import { speciesEggMoves } from "#app/data/balance/egg-moves"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Species } from "#enums/species"; import { getEggTierForSpecies } from "#app/data/egg"; import { starterColors } from "#app/battle-scene"; diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 3e2940f45b9..680f752096b 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -13,7 +13,7 @@ import { allAbilities } from "#app/data/ability"; import { speciesEggMoves } from "#app/data/balance/egg-moves"; import { GrowthRate, getGrowthRateColor } from "#app/data/exp"; import { Gender, getGenderColor, getGenderSymbol } from "#app/data/gender"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { getNatureName } from "#app/data/nature"; import { pokemonFormChanges } from "#app/data/pokemon-forms"; import type { LevelMoves } from "#app/data/balance/pokemon-level-moves"; diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index 04bcf71d7ae..d82082f0872 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -12,7 +12,8 @@ import { toReadableString, formatStat, } from "#app/utils"; -import type { PlayerPokemon, PokemonMove } from "#app/field/pokemon"; +import type { PlayerPokemon } from "#app/field/pokemon"; +import type { PokemonMove } from "#app/data/moves/pokemon-move"; import { getStarterValueFriendshipCap, speciesStarterCosts } from "#app/data/balance/starters"; import { argbFromRgba } from "@material/material-color-utilities"; import { getTypeRgb } from "#app/data/type"; diff --git a/test/abilities/aura_break.test.ts b/test/abilities/aura_break.test.ts index 86b6c69ec8b..30841fdbe0c 100644 --- a/test/abilities/aura_break.test.ts +++ b/test/abilities/aura_break.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/test/abilities/battery.test.ts b/test/abilities/battery.test.ts index cc7570c3d31..78db19e67ff 100644 --- a/test/abilities/battery.test.ts +++ b/test/abilities/battery.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#app/enums/abilities"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; diff --git a/test/abilities/battle_bond.test.ts b/test/abilities/battle_bond.test.ts index 6305d7dedc5..e615b5746c0 100644 --- a/test/abilities/battle_bond.test.ts +++ b/test/abilities/battle_bond.test.ts @@ -1,4 +1,5 @@ -import { allMoves, MultiHitAttr } from "#app/data/moves/move"; +import { MultiHitAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { MultiHitType } from "#enums/MultiHitType"; import { Status } from "#app/data/status-effect"; import { Abilities } from "#enums/abilities"; diff --git a/test/abilities/flower_veil.test.ts b/test/abilities/flower_veil.test.ts index c26a952acff..d91c92e8c9f 100644 --- a/test/abilities/flower_veil.test.ts +++ b/test/abilities/flower_veil.test.ts @@ -7,7 +7,7 @@ import { StatusEffect } from "#enums/status-effect"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { BattlerTagType } from "#enums/battler-tag-type"; import { allAbilities } from "#app/data/ability"; diff --git a/test/abilities/friend_guard.test.ts b/test/abilities/friend_guard.test.ts index 30175fe37e0..cee82ca2c69 100644 --- a/test/abilities/friend_guard.test.ts +++ b/test/abilities/friend_guard.test.ts @@ -6,7 +6,7 @@ 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 { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { MoveCategory } from "#enums/MoveCategory"; describe("Moves - Friend Guard", () => { diff --git a/test/abilities/galvanize.test.ts b/test/abilities/galvanize.test.ts index c1e02c6c8d8..4efb6bb068f 100644 --- a/test/abilities/galvanize.test.ts +++ b/test/abilities/galvanize.test.ts @@ -1,10 +1,10 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { PokemonType } from "#enums/pokemon-type"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; -import { HitResult } from "#app/field/pokemon"; +import { HitResult } from "#enums/hit-result"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/hustle.test.ts b/test/abilities/hustle.test.ts index 40197cf9e97..fbfa23e90d6 100644 --- a/test/abilities/hustle.test.ts +++ b/test/abilities/hustle.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#app/enums/abilities"; import { Stat } from "#app/enums/stat"; import { Moves } from "#enums/moves"; diff --git a/test/abilities/infiltrator.test.ts b/test/abilities/infiltrator.test.ts index 6278439651c..e9ecf366a37 100644 --- a/test/abilities/infiltrator.test.ts +++ b/test/abilities/infiltrator.test.ts @@ -1,5 +1,5 @@ import { ArenaTagSide } from "#app/data/arena-tag"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { ArenaTagType } from "#enums/arena-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type"; import { Stat } from "#enums/stat"; diff --git a/test/abilities/libero.test.ts b/test/abilities/libero.test.ts index 22abf1c248f..96a6b3c5d93 100644 --- a/test/abilities/libero.test.ts +++ b/test/abilities/libero.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { PokemonType } from "#enums/pokemon-type"; import { Weather } from "#app/data/weather"; import type { PlayerPokemon } from "#app/field/pokemon"; diff --git a/test/abilities/magic_bounce.test.ts b/test/abilities/magic_bounce.test.ts index f9a076776aa..c785827c910 100644 --- a/test/abilities/magic_bounce.test.ts +++ b/test/abilities/magic_bounce.test.ts @@ -1,7 +1,7 @@ import { BattlerIndex } from "#app/battle"; import { allAbilities } from "#app/data/ability"; import { ArenaTagSide } from "#app/data/arena-tag"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { ArenaTagType } from "#app/enums/arena-tag-type"; import { BattlerTagType } from "#app/enums/battler-tag-type"; import { Stat } from "#app/enums/stat"; diff --git a/test/abilities/power_spot.test.ts b/test/abilities/power_spot.test.ts index e29b5ecf775..68ace696d4a 100644 --- a/test/abilities/power_spot.test.ts +++ b/test/abilities/power_spot.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#app/enums/abilities"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; diff --git a/test/abilities/protean.test.ts b/test/abilities/protean.test.ts index 574033bb13f..ca5e67139e1 100644 --- a/test/abilities/protean.test.ts +++ b/test/abilities/protean.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { PokemonType } from "#enums/pokemon-type"; import { Weather } from "#app/data/weather"; import type { PlayerPokemon } from "#app/field/pokemon"; diff --git a/test/abilities/sap_sipper.test.ts b/test/abilities/sap_sipper.test.ts index f4f02844cbc..b27f97099b9 100644 --- a/test/abilities/sap_sipper.test.ts +++ b/test/abilities/sap_sipper.test.ts @@ -9,7 +9,8 @@ import { Species } from "#enums/species"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { allMoves, RandomMoveAttr } from "#app/data/moves/move"; +import { RandomMoveAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; // See also: TypeImmunityAbAttr describe("Abilities - Sap Sipper", () => { diff --git a/test/abilities/serene_grace.test.ts b/test/abilities/serene_grace.test.ts index 65ca96acbbc..30073f30b24 100644 --- a/test/abilities/serene_grace.test.ts +++ b/test/abilities/serene_grace.test.ts @@ -4,7 +4,7 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { FlinchAttr } from "#app/data/moves/move"; diff --git a/test/abilities/sheer_force.test.ts b/test/abilities/sheer_force.test.ts index 4a1c20cde5c..74c7b30a846 100644 --- a/test/abilities/sheer_force.test.ts +++ b/test/abilities/sheer_force.test.ts @@ -7,7 +7,8 @@ import { Stat } from "#enums/stat"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { allMoves, FlinchAttr } from "#app/data/moves/move"; +import { FlinchAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; describe("Abilities - Sheer Force", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/steely_spirit.test.ts b/test/abilities/steely_spirit.test.ts index b180ff8919e..6e8331ea51a 100644 --- a/test/abilities/steely_spirit.test.ts +++ b/test/abilities/steely_spirit.test.ts @@ -1,5 +1,5 @@ import { allAbilities } from "#app/data/ability"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/test/abilities/supreme_overlord.test.ts b/test/abilities/supreme_overlord.test.ts index a71bf0a9354..69ff4f393b6 100644 --- a/test/abilities/supreme_overlord.test.ts +++ b/test/abilities/supreme_overlord.test.ts @@ -7,7 +7,7 @@ import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; describe("Abilities - Supreme Overlord", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/tera_shell.test.ts b/test/abilities/tera_shell.test.ts index a99ecfd4ce1..bd88c21f52d 100644 --- a/test/abilities/tera_shell.test.ts +++ b/test/abilities/tera_shell.test.ts @@ -2,7 +2,7 @@ import { BattlerIndex } from "#app/battle"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; -import { HitResult } from "#app/field/pokemon"; +import { HitResult } from "#enums/hit-result"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/unburden.test.ts b/test/abilities/unburden.test.ts index 8f18604011c..7012c4cf065 100644 --- a/test/abilities/unburden.test.ts +++ b/test/abilities/unburden.test.ts @@ -1,6 +1,7 @@ import { BattlerIndex } from "#app/battle"; import { PostItemLostAbAttr } from "#app/data/ability"; -import { allMoves, StealHeldItemChanceAttr } from "#app/data/moves/move"; +import { StealHeldItemChanceAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import type Pokemon from "#app/field/pokemon"; import type { ContactHeldItemTransferChanceModifier } from "#app/modifier/modifier"; import { Abilities } from "#enums/abilities"; diff --git a/test/abilities/wimp_out.test.ts b/test/abilities/wimp_out.test.ts index 294025a10e7..c81fa2071c5 100644 --- a/test/abilities/wimp_out.test.ts +++ b/test/abilities/wimp_out.test.ts @@ -1,6 +1,6 @@ import { BattlerIndex } from "#app/battle"; import { ArenaTagSide } from "#app/data/arena-tag"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import GameManager from "#test/testUtils/gameManager"; import { toDmgValue } from "#app/utils"; import { Abilities } from "#enums/abilities"; @@ -534,12 +534,12 @@ describe("Abilities - Wimp Out", () => { .enemyAbility(Abilities.WIMP_OUT) .startingLevel(50) .enemyLevel(1) - .enemyMoveset([ Moves.SPLASH, Moves.ENDURE ]) + .enemyMoveset([Moves.SPLASH, Moves.ENDURE]) .battleType("double") - .moveset([ Moves.DRAGON_ENERGY, Moves.SPLASH ]) + .moveset([Moves.DRAGON_ENERGY, Moves.SPLASH]) .startingWave(wave); - await game.classicMode.startBattle([ Species.REGIDRAGO, Species.MAGIKARP ]); + await game.classicMode.startBattle([Species.REGIDRAGO, Species.MAGIKARP]); // turn 1 game.move.select(Moves.DRAGON_ENERGY, 0); @@ -549,6 +549,5 @@ describe("Abilities - Wimp Out", () => { await game.phaseInterceptor.to("SelectModifierPhase"); expect(game.scene.currentBattle.waveIndex).toBe(wave + 1); - }); }); diff --git a/test/abilities/wonder_skin.test.ts b/test/abilities/wonder_skin.test.ts index 18d5be36aef..fe24cdad5ec 100644 --- a/test/abilities/wonder_skin.test.ts +++ b/test/abilities/wonder_skin.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; diff --git a/test/arena/arena_gravity.test.ts b/test/arena/arena_gravity.test.ts index a5ce84667f0..7e72d14460a 100644 --- a/test/arena/arena_gravity.test.ts +++ b/test/arena/arena_gravity.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#enums/abilities"; import { ArenaTagType } from "#enums/arena-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type"; diff --git a/test/arena/grassy_terrain.test.ts b/test/arena/grassy_terrain.test.ts index d92fb24be5a..9ee9d2ef434 100644 --- a/test/arena/grassy_terrain.test.ts +++ b/test/arena/grassy_terrain.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/test/arena/weather_fog.test.ts b/test/arena/weather_fog.test.ts index 784c4886648..b240bfa7386 100644 --- a/test/arena/weather_fog.test.ts +++ b/test/arena/weather_fog.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#app/enums/abilities"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { Moves } from "#enums/moves"; diff --git a/test/arena/weather_strong_winds.test.ts b/test/arena/weather_strong_winds.test.ts index 3a9235d9eb9..50d25947612 100644 --- a/test/arena/weather_strong_winds.test.ts +++ b/test/arena/weather_strong_winds.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { StatusEffect } from "#app/enums/status-effect"; import { TurnStartPhase } from "#app/phases/turn-start-phase"; import { Abilities } from "#enums/abilities"; diff --git a/test/battle/damage_calculation.test.ts b/test/battle/damage_calculation.test.ts index dab1fc81caa..11bb8246ca1 100644 --- a/test/battle/damage_calculation.test.ts +++ b/test/battle/damage_calculation.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import type { EnemyPersistentModifier } from "#app/modifier/modifier"; import { modifierTypes } from "#app/modifier/modifier-type"; import { Abilities } from "#enums/abilities"; diff --git a/test/battlerTags/substitute.test.ts b/test/battlerTags/substitute.test.ts index fca3dc5ef7e..f2ee741bca2 100644 --- a/test/battlerTags/substitute.test.ts +++ b/test/battlerTags/substitute.test.ts @@ -1,5 +1,7 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import type { PokemonTurnData, TurnMove, PokemonMove } from "#app/field/pokemon"; +import type { PokemonTurnData } from "#app/field/pokemon"; +import type { PokemonMove } from "#app/data/moves/pokemon-move"; +import type { TurnMove } from "#app/interfaces/turn-move"; import type Pokemon from "#app/field/pokemon"; import { MoveResult } from "#app/field/pokemon"; import type BattleScene from "#app/battle-scene"; @@ -7,7 +9,7 @@ import { BattlerTagLapseType, BindTag, SubstituteTag } from "#app/data/battler-t import { Moves } from "#app/enums/moves"; import { PokemonAnimType } from "#app/enums/pokemon-anim-type"; import * as messages from "#app/messages"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import type { MoveEffectPhase } from "#app/phases/move-effect-phase"; import GameManager from "#test/testUtils/gameManager"; diff --git a/test/enemy_command.test.ts b/test/enemy_command.test.ts index 6d5cc2698a3..cfa141cf89e 100644 --- a/test/enemy_command.test.ts +++ b/test/enemy_command.test.ts @@ -1,11 +1,11 @@ import type BattleScene from "#app/battle-scene"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { MoveCategory } from "#enums/MoveCategory"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; import type { EnemyPokemon } from "#app/field/pokemon"; -import { AiType } from "#app/field/pokemon"; +import { AiType } from "#enums/ai-type"; import { randSeedInt } from "#app/utils"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; diff --git a/test/evolution.test.ts b/test/evolution.test.ts index dd6795bf161..62a06f868e8 100644 --- a/test/evolution.test.ts +++ b/test/evolution.test.ts @@ -1,8 +1,5 @@ -import { - pokemonEvolutions, - SpeciesFormEvolution, - SpeciesWildEvolutionDelay, -} from "#app/data/balance/pokemon-evolutions"; +import { pokemonEvolutions, SpeciesFormEvolution } from "#app/data/balance/pokemon-evolutions"; +import { SpeciesWildEvolutionDelay } from "#enums/species-wild-evolution-delay"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; diff --git a/test/imports.test.ts b/test/imports.test.ts index 128308dbd14..ada7eff0109 100644 --- a/test/imports.test.ts +++ b/test/imports.test.ts @@ -4,7 +4,7 @@ import { describe, expect, it } from "vitest"; async function importModule() { try { initStatsKeys(); - const { PokemonMove } = await import("#app/field/pokemon"); + const { PokemonMove } = await import("#app/data/moves/pokemon-move"); const { Species } = await import("#enums/species"); return { PokemonMove, diff --git a/test/items/reviver_seed.test.ts b/test/items/reviver_seed.test.ts index c06f354a94a..e1e7e0d554e 100644 --- a/test/items/reviver_seed.test.ts +++ b/test/items/reviver_seed.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { BattlerTagType } from "#app/enums/battler-tag-type"; import type { PokemonInstantReviveModifier } from "#app/modifier/modifier"; import { Abilities } from "#enums/abilities"; diff --git a/test/moves/astonish.test.ts b/test/moves/astonish.test.ts index 53922060ae6..69a312d4517 100644 --- a/test/moves/astonish.test.ts +++ b/test/moves/astonish.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { BattlerTagType } from "#app/enums/battler-tag-type"; import { BerryPhase } from "#app/phases/berry-phase"; import { CommandPhase } from "#app/phases/command-phase"; diff --git a/test/moves/aurora_veil.test.ts b/test/moves/aurora_veil.test.ts index 31f6497bae5..06637d0764e 100644 --- a/test/moves/aurora_veil.test.ts +++ b/test/moves/aurora_veil.test.ts @@ -1,7 +1,8 @@ import type BattleScene from "#app/battle-scene"; import { ArenaTagSide } from "#app/data/arena-tag"; import type Move from "#app/data/moves/move"; -import { allMoves, CritOnlyAttr } from "#app/data/moves/move"; +import { CritOnlyAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { ArenaTagType } from "#app/enums/arena-tag-type"; import type Pokemon from "#app/field/pokemon"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; diff --git a/test/moves/burning_jealousy.test.ts b/test/moves/burning_jealousy.test.ts index 60387df4226..c618b46e842 100644 --- a/test/moves/burning_jealousy.test.ts +++ b/test/moves/burning_jealousy.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#app/enums/abilities"; import { StatusEffect } from "#app/enums/status-effect"; import { Moves } from "#enums/moves"; diff --git a/test/moves/ceaseless_edge.test.ts b/test/moves/ceaseless_edge.test.ts index d54f1bd9f21..227645df360 100644 --- a/test/moves/ceaseless_edge.test.ts +++ b/test/moves/ceaseless_edge.test.ts @@ -1,5 +1,5 @@ import { ArenaTagSide, ArenaTrapTag } from "#app/data/arena-tag"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#app/enums/abilities"; import { ArenaTagType } from "#app/enums/arena-tag-type"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; diff --git a/test/moves/copycat.test.ts b/test/moves/copycat.test.ts index 0d9b0951f89..615206275d4 100644 --- a/test/moves/copycat.test.ts +++ b/test/moves/copycat.test.ts @@ -1,5 +1,6 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves, RandomMoveAttr } from "#app/data/moves/move"; +import { RandomMoveAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Stat } from "#app/enums/stat"; import { MoveResult } from "#app/field/pokemon"; import { Abilities } from "#enums/abilities"; diff --git a/test/moves/destiny_bond.test.ts b/test/moves/destiny_bond.test.ts index c39d40427ad..9873d678b8c 100644 --- a/test/moves/destiny_bond.test.ts +++ b/test/moves/destiny_bond.test.ts @@ -1,6 +1,6 @@ import type { ArenaTrapTag } from "#app/data/arena-tag"; import { ArenaTagSide } from "#app/data/arena-tag"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#enums/abilities"; import { ArenaTagType } from "#enums/arena-tag-type"; import { Moves } from "#enums/moves"; diff --git a/test/moves/diamond_storm.test.ts b/test/moves/diamond_storm.test.ts index 2363122f0d7..73a1aee3fd2 100644 --- a/test/moves/diamond_storm.test.ts +++ b/test/moves/diamond_storm.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/test/moves/dig.test.ts b/test/moves/dig.test.ts index 81339111656..14e7efee19b 100644 --- a/test/moves/dig.test.ts +++ b/test/moves/dig.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#enums/abilities"; import { BattlerTagType } from "#enums/battler-tag-type"; import { Moves } from "#enums/moves"; diff --git a/test/moves/dragon_tail.test.ts b/test/moves/dragon_tail.test.ts index 37e8aa2fe1b..a571312473d 100644 --- a/test/moves/dragon_tail.test.ts +++ b/test/moves/dragon_tail.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Status } from "#app/data/status-effect"; import { Challenges } from "#enums/challenges"; import { StatusEffect } from "#enums/status-effect"; diff --git a/test/moves/dynamax_cannon.test.ts b/test/moves/dynamax_cannon.test.ts index 9cf3106b9c1..b2590449e4e 100644 --- a/test/moves/dynamax_cannon.test.ts +++ b/test/moves/dynamax_cannon.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { Moves } from "#enums/moves"; diff --git a/test/moves/effectiveness.test.ts b/test/moves/effectiveness.test.ts index fb03f1c10a0..efcbc9c3293 100644 --- a/test/moves/effectiveness.test.ts +++ b/test/moves/effectiveness.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { getPokemonSpecies } from "#app/data/pokemon-species"; import { TrainerSlot } from "#enums/trainer-slot"; import { PokemonType } from "#enums/pokemon-type"; diff --git a/test/moves/fell_stinger.test.ts b/test/moves/fell_stinger.test.ts index 2ffa44c5a3a..766fedf68dc 100644 --- a/test/moves/fell_stinger.test.ts +++ b/test/moves/fell_stinger.test.ts @@ -7,7 +7,7 @@ import { Moves } from "#enums/moves"; import { Stat } from "#enums/stat"; import { StatusEffect } from "#app/enums/status-effect"; import { WeatherType } from "#app/enums/weather-type"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; describe("Moves - Fell Stinger", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/fly.test.ts b/test/moves/fly.test.ts index 0bd7d22b2a7..37fa42b608d 100644 --- a/test/moves/fly.test.ts +++ b/test/moves/fly.test.ts @@ -8,7 +8,7 @@ import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest"; import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; describe("Moves - Fly", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/freezy_frost.test.ts b/test/moves/freezy_frost.test.ts index c1ac4054e70..d764600bc78 100644 --- a/test/moves/freezy_frost.test.ts +++ b/test/moves/freezy_frost.test.ts @@ -5,7 +5,7 @@ import { Species } from "#enums/species"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { CommandPhase } from "#app/phases/command-phase"; describe("Moves - Freezy Frost", () => { diff --git a/test/moves/fusion_flare_bolt.test.ts b/test/moves/fusion_flare_bolt.test.ts index c340aeea63f..32df10b4c7c 100644 --- a/test/moves/fusion_flare_bolt.test.ts +++ b/test/moves/fusion_flare_bolt.test.ts @@ -1,6 +1,6 @@ import { Stat } from "#enums/stat"; import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import type Move from "#app/data/moves/move"; import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; diff --git a/test/moves/glaive_rush.test.ts b/test/moves/glaive_rush.test.ts index d3531b172e2..28d6328c095 100644 --- a/test/moves/glaive_rush.test.ts +++ b/test/moves/glaive_rush.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; diff --git a/test/moves/hard_press.test.ts b/test/moves/hard_press.test.ts index 8891f0bf0e2..425993fb1a9 100644 --- a/test/moves/hard_press.test.ts +++ b/test/moves/hard_press.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; diff --git a/test/moves/hyper_beam.test.ts b/test/moves/hyper_beam.test.ts index 5cd54e9b46a..b1a244f2ea4 100644 --- a/test/moves/hyper_beam.test.ts +++ b/test/moves/hyper_beam.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#app/enums/abilities"; import { BattlerTagType } from "#app/enums/battler-tag-type"; import { Moves } from "#app/enums/moves"; diff --git a/test/moves/lash_out.test.ts b/test/moves/lash_out.test.ts index 8395633f5c0..16632ec0065 100644 --- a/test/moves/lash_out.test.ts +++ b/test/moves/lash_out.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/test/moves/last_respects.test.ts b/test/moves/last_respects.test.ts index ccab8a43415..891b287dece 100644 --- a/test/moves/last_respects.test.ts +++ b/test/moves/last_respects.test.ts @@ -3,7 +3,7 @@ import { BattlerIndex } from "#app/battle"; import { Species } from "#enums/species"; import { Abilities } from "#enums/abilities"; import GameManager from "#test/testUtils/gameManager"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import type Move from "#app/data/moves/move"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import Phaser from "phaser"; diff --git a/test/moves/light_screen.test.ts b/test/moves/light_screen.test.ts index 9cc6944ed3e..b77bb1c790b 100644 --- a/test/moves/light_screen.test.ts +++ b/test/moves/light_screen.test.ts @@ -1,7 +1,8 @@ import type BattleScene from "#app/battle-scene"; import { ArenaTagSide } from "#app/data/arena-tag"; import type Move from "#app/data/moves/move"; -import { allMoves, CritOnlyAttr } from "#app/data/moves/move"; +import { CritOnlyAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#app/enums/abilities"; import { ArenaTagType } from "#app/enums/arena-tag-type"; import type Pokemon from "#app/field/pokemon"; diff --git a/test/moves/magic_coat.test.ts b/test/moves/magic_coat.test.ts index 2cc8dea8938..e96125a23ac 100644 --- a/test/moves/magic_coat.test.ts +++ b/test/moves/magic_coat.test.ts @@ -1,6 +1,6 @@ import { BattlerIndex } from "#app/battle"; import { ArenaTagSide } from "#app/data/arena-tag"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { ArenaTagType } from "#app/enums/arena-tag-type"; import { BattlerTagType } from "#app/enums/battler-tag-type"; import { Stat } from "#app/enums/stat"; diff --git a/test/moves/metronome.test.ts b/test/moves/metronome.test.ts index 80f32a3a6fb..bf045f5e9f9 100644 --- a/test/moves/metronome.test.ts +++ b/test/moves/metronome.test.ts @@ -1,5 +1,6 @@ import { RechargingTag, SemiInvulnerableTag } from "#app/data/battler-tags"; -import { allMoves, RandomMoveAttr } from "#app/data/moves/move"; +import { RandomMoveAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#app/enums/abilities"; import { Stat } from "#app/enums/stat"; import { CommandPhase } from "#app/phases/command-phase"; diff --git a/test/moves/moongeist_beam.test.ts b/test/moves/moongeist_beam.test.ts index 117fe513e17..94197683ea4 100644 --- a/test/moves/moongeist_beam.test.ts +++ b/test/moves/moongeist_beam.test.ts @@ -1,4 +1,5 @@ -import { allMoves, RandomMoveAttr } from "#app/data/moves/move"; +import { RandomMoveAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/test/moves/pledge_moves.test.ts b/test/moves/pledge_moves.test.ts index c866d15357c..d3b8e60ac62 100644 --- a/test/moves/pledge_moves.test.ts +++ b/test/moves/pledge_moves.test.ts @@ -1,7 +1,8 @@ import { BattlerIndex } from "#app/battle"; import { allAbilities } from "#app/data/ability"; import { ArenaTagSide } from "#app/data/arena-tag"; -import { allMoves, FlinchAttr } from "#app/data/moves/move"; +import { FlinchAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { PokemonType } from "#enums/pokemon-type"; import { ArenaTagType } from "#enums/arena-tag-type"; import { Stat } from "#enums/stat"; diff --git a/test/moves/powder.test.ts b/test/moves/powder.test.ts index 522b0b74ca7..510564e0f53 100644 --- a/test/moves/powder.test.ts +++ b/test/moves/powder.test.ts @@ -5,7 +5,8 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import { BerryPhase } from "#app/phases/berry-phase"; -import { MoveResult, PokemonMove } from "#app/field/pokemon"; +import { MoveResult } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { PokemonType } from "#enums/pokemon-type"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { StatusEffect } from "#enums/status-effect"; diff --git a/test/moves/protect.test.ts b/test/moves/protect.test.ts index d50c490f7d3..65de079982f 100644 --- a/test/moves/protect.test.ts +++ b/test/moves/protect.test.ts @@ -5,7 +5,7 @@ import { Species } from "#enums/species"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Stat } from "#enums/stat"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { ArenaTagSide, ArenaTrapTag } from "#app/data/arena-tag"; import { BattlerIndex } from "#app/battle"; import { MoveResult } from "#app/field/pokemon"; diff --git a/test/moves/rage_fist.test.ts b/test/moves/rage_fist.test.ts index f44901c5aba..73d83f4929c 100644 --- a/test/moves/rage_fist.test.ts +++ b/test/moves/rage_fist.test.ts @@ -2,7 +2,7 @@ import { BattlerIndex } from "#app/battle"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import type Move from "#app/data/moves/move"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; diff --git a/test/moves/reflect.test.ts b/test/moves/reflect.test.ts index ac879a7cc2b..272e5c2972c 100644 --- a/test/moves/reflect.test.ts +++ b/test/moves/reflect.test.ts @@ -1,7 +1,8 @@ import type BattleScene from "#app/battle-scene"; import { ArenaTagSide } from "#app/data/arena-tag"; import type Move from "#app/data/moves/move"; -import { allMoves, CritOnlyAttr } from "#app/data/moves/move"; +import { CritOnlyAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#app/enums/abilities"; import { ArenaTagType } from "#app/enums/arena-tag-type"; import type Pokemon from "#app/field/pokemon"; diff --git a/test/moves/retaliate.test.ts b/test/moves/retaliate.test.ts index e916c9ffeaa..57d29b4fdfc 100644 --- a/test/moves/retaliate.test.ts +++ b/test/moves/retaliate.test.ts @@ -3,7 +3,7 @@ import Phaser from "phaser"; import GameManager from "#test/testUtils/gameManager"; import { Species } from "#enums/species"; import { Moves } from "#enums/moves"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import type Move from "#app/data/moves/move"; describe("Moves - Retaliate", () => { diff --git a/test/moves/rollout.test.ts b/test/moves/rollout.test.ts index 89270c2dfc7..456f029cda1 100644 --- a/test/moves/rollout.test.ts +++ b/test/moves/rollout.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { CommandPhase } from "#app/phases/command-phase"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; diff --git a/test/moves/round.test.ts b/test/moves/round.test.ts index 82f080a25ea..ec9f3f69a5e 100644 --- a/test/moves/round.test.ts +++ b/test/moves/round.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import type { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; diff --git a/test/moves/scale_shot.test.ts b/test/moves/scale_shot.test.ts index 2be632adb54..ee759b8404a 100644 --- a/test/moves/scale_shot.test.ts +++ b/test/moves/scale_shot.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { MoveEndPhase } from "#app/phases/move-end-phase"; diff --git a/test/moves/secret_power.test.ts b/test/moves/secret_power.test.ts index 37f1664251b..40802dcc51f 100644 --- a/test/moves/secret_power.test.ts +++ b/test/moves/secret_power.test.ts @@ -2,7 +2,7 @@ import { Abilities } from "#enums/abilities"; import { Biome } from "#enums/biome"; import { Moves } from "#enums/moves"; import { Stat } from "#enums/stat"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Species } from "#enums/species"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; diff --git a/test/moves/shell_side_arm.test.ts b/test/moves/shell_side_arm.test.ts index a5b065b76cb..232182ffef0 100644 --- a/test/moves/shell_side_arm.test.ts +++ b/test/moves/shell_side_arm.test.ts @@ -1,5 +1,6 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves, ShellSideArmCategoryAttr } from "#app/data/moves/move"; +import { ShellSideArmCategoryAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import type Move from "#app/data/moves/move"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; diff --git a/test/moves/shell_trap.test.ts b/test/moves/shell_trap.test.ts index 2df94cdb828..d3ba67843ac 100644 --- a/test/moves/shell_trap.test.ts +++ b/test/moves/shell_trap.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; import { MoveResult } from "#app/field/pokemon"; diff --git a/test/moves/sketch.test.ts b/test/moves/sketch.test.ts index dfbf2eca713..94f37757a6a 100644 --- a/test/moves/sketch.test.ts +++ b/test/moves/sketch.test.ts @@ -1,13 +1,15 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import { MoveResult, PokemonMove } from "#app/field/pokemon"; +import { MoveResult } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { StatusEffect } from "#app/enums/status-effect"; import { BattlerIndex } from "#app/battle"; -import { allMoves, RandomMoveAttr } from "#app/data/moves/move"; +import { RandomMoveAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; describe("Moves - Sketch", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/solar_beam.test.ts b/test/moves/solar_beam.test.ts index dffd4f210e5..b8a28065b64 100644 --- a/test/moves/solar_beam.test.ts +++ b/test/moves/solar_beam.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { BattlerTagType } from "#enums/battler-tag-type"; import { WeatherType } from "#enums/weather-type"; import { MoveResult } from "#app/field/pokemon"; diff --git a/test/moves/sparkly_swirl.test.ts b/test/moves/sparkly_swirl.test.ts index 6cd357c7e0e..1908772598a 100644 --- a/test/moves/sparkly_swirl.test.ts +++ b/test/moves/sparkly_swirl.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { StatusEffect } from "#app/enums/status-effect"; import { CommandPhase } from "#app/phases/command-phase"; import { Abilities } from "#enums/abilities"; diff --git a/test/moves/spectral_thief.test.ts b/test/moves/spectral_thief.test.ts index 2e52b118a74..271cb03073a 100644 --- a/test/moves/spectral_thief.test.ts +++ b/test/moves/spectral_thief.test.ts @@ -1,7 +1,7 @@ import { Abilities } from "#enums/abilities"; import { BattlerIndex } from "#app/battle"; import { Stat } from "#enums/stat"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; diff --git a/test/moves/spit_up.test.ts b/test/moves/spit_up.test.ts index d71647bda52..7ef6e5e5b14 100644 --- a/test/moves/spit_up.test.ts +++ b/test/moves/spit_up.test.ts @@ -1,8 +1,8 @@ import { Stat } from "#enums/stat"; import { StockpilingTag } from "#app/data/battler-tags"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { BattlerTagType } from "#app/enums/battler-tag-type"; -import type { TurnMove } from "#app/field/pokemon"; +import type { TurnMove } from "#app/interfaces/turn-move"; import { MoveResult } from "#app/field/pokemon"; import GameManager from "#test/testUtils/gameManager"; import { Abilities } from "#enums/abilities"; diff --git a/test/moves/steamroller.test.ts b/test/moves/steamroller.test.ts index ba96928e01d..a0e4c29cce5 100644 --- a/test/moves/steamroller.test.ts +++ b/test/moves/steamroller.test.ts @@ -1,7 +1,7 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { BattlerTagType } from "#app/enums/battler-tag-type"; -import type { DamageCalculationResult } from "#app/field/pokemon"; +import type { DamageCalculationResult } from "#app/interfaces/damage-calculation-result"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/test/moves/stockpile.test.ts b/test/moves/stockpile.test.ts index 033f24d5229..f6e6a0087f6 100644 --- a/test/moves/stockpile.test.ts +++ b/test/moves/stockpile.test.ts @@ -1,6 +1,6 @@ import { Stat } from "#enums/stat"; import { StockpilingTag } from "#app/data/battler-tags"; -import type { TurnMove } from "#app/field/pokemon"; +import type { TurnMove } from "#app/interfaces/turn-move"; import { MoveResult } from "#app/field/pokemon"; import { CommandPhase } from "#app/phases/command-phase"; import { TurnInitPhase } from "#app/phases/turn-init-phase"; diff --git a/test/moves/substitute.test.ts b/test/moves/substitute.test.ts index 23f7f4af4b9..68b90bf7cf8 100644 --- a/test/moves/substitute.test.ts +++ b/test/moves/substitute.test.ts @@ -1,7 +1,8 @@ import { BattlerIndex } from "#app/battle"; import { ArenaTagSide } from "#app/data/arena-tag"; import { SubstituteTag, TrappedTag } from "#app/data/battler-tags"; -import { allMoves, StealHeldItemChanceAttr } from "#app/data/moves/move"; +import { StealHeldItemChanceAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { MoveResult } from "#app/field/pokemon"; import type { CommandPhase } from "#app/phases/command-phase"; import GameManager from "#test/testUtils/gameManager"; diff --git a/test/moves/swallow.test.ts b/test/moves/swallow.test.ts index baa03801079..86af584a174 100644 --- a/test/moves/swallow.test.ts +++ b/test/moves/swallow.test.ts @@ -1,7 +1,7 @@ import { Stat } from "#enums/stat"; import { StockpilingTag } from "#app/data/battler-tags"; import { BattlerTagType } from "#app/enums/battler-tag-type"; -import type { TurnMove } from "#app/field/pokemon"; +import type { TurnMove } from "#app/interfaces/turn-move"; import { MoveResult } from "#app/field/pokemon"; import { MovePhase } from "#app/phases/move-phase"; import { TurnInitPhase } from "#app/phases/turn-init-phase"; diff --git a/test/moves/telekinesis.test.ts b/test/moves/telekinesis.test.ts index 1355cb975f3..7537ba0168a 100644 --- a/test/moves/telekinesis.test.ts +++ b/test/moves/telekinesis.test.ts @@ -1,5 +1,5 @@ import { BattlerTagType } from "#enums/battler-tag-type"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/test/moves/tera_blast.test.ts b/test/moves/tera_blast.test.ts index c1a2b999fa0..9d17ea6a3cc 100644 --- a/test/moves/tera_blast.test.ts +++ b/test/moves/tera_blast.test.ts @@ -1,10 +1,11 @@ import { BattlerIndex } from "#app/battle"; import { Stat } from "#enums/stat"; -import { allMoves, TeraMoveCategoryAttr } from "#app/data/moves/move"; +import { TeraMoveCategoryAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import type Move from "#app/data/moves/move"; import { PokemonType } from "#enums/pokemon-type"; import { Abilities } from "#app/enums/abilities"; -import { HitResult } from "#app/field/pokemon"; +import { HitResult } from "#enums/hit-result"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/testUtils/gameManager"; diff --git a/test/moves/toxic.test.ts b/test/moves/toxic.test.ts index f2b1f82fe02..ab536364f6a 100644 --- a/test/moves/toxic.test.ts +++ b/test/moves/toxic.test.ts @@ -5,7 +5,7 @@ import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { StatusEffect } from "#enums/status-effect"; import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; describe("Moves - Toxic", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/triple_arrows.test.ts b/test/moves/triple_arrows.test.ts index eb434b25815..d1d14f7d3e6 100644 --- a/test/moves/triple_arrows.test.ts +++ b/test/moves/triple_arrows.test.ts @@ -1,4 +1,5 @@ -import { allMoves, FlinchAttr, StatStageChangeAttr } from "#app/data/moves/move"; +import { FlinchAttr, StatStageChangeAttr } from "#app/data/moves/move"; +import { allMoves } from "#app/data/moves/all-moves"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import type Move from "#app/data/moves/move"; diff --git a/test/mystery-encounter/encounters/an-offer-you-cant-refuse-encounter.test.ts b/test/mystery-encounter/encounters/an-offer-you-cant-refuse-encounter.test.ts index 3c7bda8febd..728129007e7 100644 --- a/test/mystery-encounter/encounters/an-offer-you-cant-refuse-encounter.test.ts +++ b/test/mystery-encounter/encounters/an-offer-you-cant-refuse-encounter.test.ts @@ -8,7 +8,8 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vite import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; import { runMysteryEncounterToEnd } from "#test/mystery-encounter/encounter-test-utils"; import type BattleScene from "#app/battle-scene"; -import { PlayerPokemon, PokemonMove } from "#app/field/pokemon"; +import { PlayerPokemon } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { AnOfferYouCantRefuseEncounter } from "#app/data/mystery-encounters/encounters/an-offer-you-cant-refuse-encounter"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; diff --git a/test/mystery-encounter/encounters/bug-type-superfan-encounter.test.ts b/test/mystery-encounter/encounters/bug-type-superfan-encounter.test.ts index 9befe77e688..c1e6a635f31 100644 --- a/test/mystery-encounter/encounters/bug-type-superfan-encounter.test.ts +++ b/test/mystery-encounter/encounters/bug-type-superfan-encounter.test.ts @@ -11,7 +11,7 @@ import { } from "#test/mystery-encounter/encounter-test-utils"; import { Moves } from "#enums/moves"; import type BattleScene from "#app/battle-scene"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { Mode } from "#app/ui/ui"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; diff --git a/test/mystery-encounter/encounters/clowning-around-encounter.test.ts b/test/mystery-encounter/encounters/clowning-around-encounter.test.ts index 4bbe76e5c72..7b3d87463bf 100644 --- a/test/mystery-encounter/encounters/clowning-around-encounter.test.ts +++ b/test/mystery-encounter/encounters/clowning-around-encounter.test.ts @@ -15,7 +15,7 @@ import { import { Moves } from "#enums/moves"; import type BattleScene from "#app/battle-scene"; import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { Mode } from "#app/ui/ui"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; diff --git a/test/mystery-encounter/encounters/dancing-lessons-encounter.test.ts b/test/mystery-encounter/encounters/dancing-lessons-encounter.test.ts index 77cd65e51b9..5ea836d8aa6 100644 --- a/test/mystery-encounter/encounters/dancing-lessons-encounter.test.ts +++ b/test/mystery-encounter/encounters/dancing-lessons-encounter.test.ts @@ -17,7 +17,7 @@ import { Moves } from "#enums/moves"; import { DancingLessonsEncounter } from "#app/data/mystery-encounters/encounters/dancing-lessons-encounter"; import { Mode } from "#app/ui/ui"; import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; import { CommandPhase } from "#app/phases/command-phase"; import { MovePhase } from "#app/phases/move-phase"; diff --git a/test/mystery-encounter/encounters/fight-or-flight-encounter.test.ts b/test/mystery-encounter/encounters/fight-or-flight-encounter.test.ts index d233e72932a..82d80bc3970 100644 --- a/test/mystery-encounter/encounters/fight-or-flight-encounter.test.ts +++ b/test/mystery-encounter/encounters/fight-or-flight-encounter.test.ts @@ -11,7 +11,7 @@ import { } from "#test/mystery-encounter/encounter-test-utils"; import { Moves } from "#enums/moves"; import type BattleScene from "#app/battle-scene"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { Mode } from "#app/ui/ui"; import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; diff --git a/test/mystery-encounter/encounters/part-timer-encounter.test.ts b/test/mystery-encounter/encounters/part-timer-encounter.test.ts index 639a2e140ff..308aa9839e9 100644 --- a/test/mystery-encounter/encounters/part-timer-encounter.test.ts +++ b/test/mystery-encounter/encounters/part-timer-encounter.test.ts @@ -14,7 +14,7 @@ import { CIVILIZATION_ENCOUNTER_BIOMES } from "#app/data/mystery-encounters/myst import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { PartTimerEncounter } from "#app/data/mystery-encounters/encounters/part-timer-encounter"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { Moves } from "#enums/moves"; import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; diff --git a/test/mystery-encounter/encounters/the-strong-stuff-encounter.test.ts b/test/mystery-encounter/encounters/the-strong-stuff-encounter.test.ts index a9e6a339d36..0d0298901d0 100644 --- a/test/mystery-encounter/encounters/the-strong-stuff-encounter.test.ts +++ b/test/mystery-encounter/encounters/the-strong-stuff-encounter.test.ts @@ -17,7 +17,7 @@ import { TheStrongStuffEncounter } from "#app/data/mystery-encounters/encounters import { Nature } from "#enums/nature"; import { BerryType } from "#enums/berry-type"; import { BattlerTagType } from "#enums/battler-tag-type"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { Mode } from "#app/ui/ui"; import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; import { BerryModifier, PokemonBaseStatTotalModifier } from "#app/modifier/modifier"; diff --git a/test/mystery-encounter/encounters/trash-to-treasure-encounter.test.ts b/test/mystery-encounter/encounters/trash-to-treasure-encounter.test.ts index df7bbb9f424..44c8e7a8915 100644 --- a/test/mystery-encounter/encounters/trash-to-treasure-encounter.test.ts +++ b/test/mystery-encounter/encounters/trash-to-treasure-encounter.test.ts @@ -12,7 +12,7 @@ import { getPokemonSpecies } from "#app/data/pokemon-species"; import { Biome } from "#app/enums/biome"; import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; import { Species } from "#app/enums/species"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { HealShopCostModifier, HitHealModifier, TurnHealModifier } from "#app/modifier/modifier"; import { ModifierTier } from "#app/modifier/modifier-tier"; import { modifierTypes, type PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; diff --git a/test/mystery-encounter/encounters/uncommon-breed-encounter.test.ts b/test/mystery-encounter/encounters/uncommon-breed-encounter.test.ts index 452dfcf3784..e4928406a18 100644 --- a/test/mystery-encounter/encounters/uncommon-breed-encounter.test.ts +++ b/test/mystery-encounter/encounters/uncommon-breed-encounter.test.ts @@ -10,7 +10,7 @@ import { } from "#test/mystery-encounter/encounter-test-utils"; import { Moves } from "#enums/moves"; import type BattleScene from "#app/battle-scene"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; diff --git a/test/testUtils/helpers/moveHelper.ts b/test/testUtils/helpers/moveHelper.ts index 543f46b2026..333f95f2014 100644 --- a/test/testUtils/helpers/moveHelper.ts +++ b/test/testUtils/helpers/moveHelper.ts @@ -1,7 +1,7 @@ import type { BattlerIndex } from "#app/battle"; import { Button } from "#app/enums/buttons"; import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/field/pokemon"; +import { PokemonMove } from "#app/data/moves/pokemon-move"; import Overrides from "#app/overrides"; import type { CommandPhase } from "#app/phases/command-phase"; import { LearnMovePhase } from "#app/phases/learn-move-phase"; From b41eee3c7f64be3b2c83ea30fb33210e87f73766 Mon Sep 17 00:00:00 2001 From: damocleas Date: Mon, 14 Apr 2025 12:28:36 -0400 Subject: [PATCH 02/13] Revert "[Refactor] Move many interfaces and enums to their own file" (#5661) Revert "[Refactor] Move many interfaces and enums to their own file (#5646)" This reverts commit c82e01eed377cacc5d3ffd2ef9caa27270e8a2dc. --- src/@types/damage-result.ts | 10 - src/battle-scene.ts | 2 +- src/battle.ts | 3 +- src/data/ability.ts | 9 +- src/data/arena-tag.ts | 5 +- src/data/balance/egg-moves.ts | 2 +- src/data/balance/pokemon-evolutions.ts | 60 ++++- src/data/battle-anims.ts | 3 +- src/data/battler-tags.ts | 5 +- src/data/berry.ts | 2 +- src/data/challenge.ts | 2 +- src/data/moves/all-moves.ts | 3 - src/data/moves/move.ts | 21 +- src/data/moves/pokemon-move.ts | 93 -------- .../encounters/absolute-avarice-encounter.ts | 3 +- .../encounters/bug-type-superfan-encounter.ts | 4 +- .../encounters/clowning-around-encounter.ts | 2 +- .../encounters/dancing-lessons-encounter.ts | 3 +- .../encounters/field-trip-encounter.ts | 3 +- .../encounters/fiery-fallout-encounter.ts | 2 +- .../encounters/fun-and-games-encounter.ts | 2 +- .../global-trade-system-encounter.ts | 3 +- .../encounters/lost-at-sea-encounter.ts | 2 +- .../slumbering-snorlax-encounter.ts | 3 +- .../encounters/the-strong-stuff-encounter.ts | 2 +- .../encounters/trash-to-treasure-encounter.ts | 2 +- .../encounters/uncommon-breed-encounter.ts | 2 +- .../encounters/weird-dream-encounter.ts | 2 +- .../mystery-encounter-requirements.ts | 3 +- .../mystery-encounters/mystery-encounter.ts | 3 +- .../can-learn-move-requirement.ts | 2 +- .../utils/encounter-phase-utils.ts | 7 +- src/data/pokemon-forms.ts | 2 +- src/data/pokemon-species.ts | 7 +- src/data/trainers/trainer-config.ts | 2 +- src/enums/ai-type.ts | 5 - src/enums/evolution-item.ts | 48 ---- src/enums/field-position.ts | 5 - src/enums/hit-result.ts | 15 -- src/enums/learn-move-context.ts | 8 - src/enums/species-wild-evolution-delay.ts | 8 - src/field/damage-number-handler.ts | 4 +- src/field/pokemon.ts | 206 ++++++++++++++++-- src/interfaces/attack-move-result.ts | 12 - src/interfaces/damage-calculation-result.ts | 11 - src/interfaces/turn-move.ts | 12 - src/modifier/modifier-type.ts | 9 +- src/modifier/modifier.ts | 2 +- src/overrides.ts | 2 +- src/phases/command-phase.ts | 5 +- src/phases/damage-anim-phase.ts | 3 +- src/phases/encounter-phase.ts | 2 +- src/phases/evolution-phase.ts | 10 +- src/phases/faint-phase.ts | 7 +- src/phases/learn-move-phase.ts | 2 +- src/phases/move-charge-phase.ts | 2 +- src/phases/move-effect-phase.ts | 5 +- src/phases/move-header-phase.ts | 2 +- src/phases/move-phase.ts | 4 +- src/phases/pokemon-heal-phase.ts | 2 +- src/phases/pokemon-transform-phase.ts | 2 +- src/phases/select-target-phase.ts | 2 +- src/phases/summon-phase.ts | 2 +- src/phases/switch-summon-phase.ts | 3 +- src/phases/toggle-double-position-phase.ts | 2 +- src/phases/turn-start-phase.ts | 5 +- src/phases/weather-effect-phase.ts | 2 +- src/system/game-data.ts | 2 +- src/system/pokemon-data.ts | 3 +- src/ui/fight-ui-handler.ts | 2 +- src/ui/modifier-select-ui-handler.ts | 2 +- src/ui/party-ui-handler.ts | 6 +- 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/pokemon-hatch-info-container.ts | 2 +- src/ui/starter-select-ui-handler.ts | 2 +- src/ui/summary-ui-handler.ts | 3 +- test/abilities/aura_break.test.ts | 2 +- test/abilities/battery.test.ts | 2 +- test/abilities/battle_bond.test.ts | 3 +- test/abilities/flower_veil.test.ts | 2 +- test/abilities/friend_guard.test.ts | 2 +- test/abilities/galvanize.test.ts | 4 +- test/abilities/hustle.test.ts | 2 +- test/abilities/infiltrator.test.ts | 2 +- test/abilities/libero.test.ts | 2 +- test/abilities/magic_bounce.test.ts | 2 +- test/abilities/power_spot.test.ts | 2 +- test/abilities/protean.test.ts | 2 +- test/abilities/sap_sipper.test.ts | 3 +- test/abilities/serene_grace.test.ts | 2 +- test/abilities/sheer_force.test.ts | 3 +- test/abilities/steely_spirit.test.ts | 2 +- test/abilities/supreme_overlord.test.ts | 2 +- test/abilities/tera_shell.test.ts | 2 +- test/abilities/unburden.test.ts | 3 +- test/abilities/wimp_out.test.ts | 9 +- test/abilities/wonder_skin.test.ts | 2 +- test/arena/arena_gravity.test.ts | 2 +- test/arena/grassy_terrain.test.ts | 2 +- test/arena/weather_fog.test.ts | 2 +- test/arena/weather_strong_winds.test.ts | 2 +- test/battle/damage_calculation.test.ts | 2 +- test/battlerTags/substitute.test.ts | 6 +- test/enemy_command.test.ts | 4 +- test/evolution.test.ts | 7 +- test/imports.test.ts | 2 +- test/items/reviver_seed.test.ts | 2 +- test/moves/astonish.test.ts | 2 +- test/moves/aurora_veil.test.ts | 3 +- test/moves/burning_jealousy.test.ts | 2 +- test/moves/ceaseless_edge.test.ts | 2 +- test/moves/copycat.test.ts | 3 +- test/moves/destiny_bond.test.ts | 2 +- test/moves/diamond_storm.test.ts | 2 +- test/moves/dig.test.ts | 2 +- test/moves/dragon_tail.test.ts | 2 +- test/moves/dynamax_cannon.test.ts | 2 +- test/moves/effectiveness.test.ts | 2 +- test/moves/fell_stinger.test.ts | 2 +- test/moves/fly.test.ts | 2 +- test/moves/freezy_frost.test.ts | 2 +- test/moves/fusion_flare_bolt.test.ts | 2 +- test/moves/glaive_rush.test.ts | 2 +- test/moves/hard_press.test.ts | 2 +- test/moves/hyper_beam.test.ts | 2 +- test/moves/lash_out.test.ts | 2 +- test/moves/last_respects.test.ts | 2 +- test/moves/light_screen.test.ts | 3 +- test/moves/magic_coat.test.ts | 2 +- test/moves/metronome.test.ts | 3 +- test/moves/moongeist_beam.test.ts | 3 +- test/moves/pledge_moves.test.ts | 3 +- test/moves/powder.test.ts | 3 +- test/moves/protect.test.ts | 2 +- test/moves/rage_fist.test.ts | 2 +- test/moves/reflect.test.ts | 3 +- test/moves/retaliate.test.ts | 2 +- test/moves/rollout.test.ts | 2 +- test/moves/round.test.ts | 2 +- test/moves/scale_shot.test.ts | 2 +- test/moves/secret_power.test.ts | 2 +- test/moves/shell_side_arm.test.ts | 3 +- test/moves/shell_trap.test.ts | 2 +- test/moves/sketch.test.ts | 6 +- test/moves/solar_beam.test.ts | 2 +- test/moves/sparkly_swirl.test.ts | 2 +- test/moves/spectral_thief.test.ts | 2 +- test/moves/spit_up.test.ts | 4 +- test/moves/steamroller.test.ts | 4 +- test/moves/stockpile.test.ts | 2 +- test/moves/substitute.test.ts | 3 +- test/moves/swallow.test.ts | 2 +- test/moves/telekinesis.test.ts | 2 +- test/moves/tera_blast.test.ts | 5 +- test/moves/toxic.test.ts | 2 +- test/moves/triple_arrows.test.ts | 3 +- ...an-offer-you-cant-refuse-encounter.test.ts | 3 +- .../bug-type-superfan-encounter.test.ts | 2 +- .../clowning-around-encounter.test.ts | 2 +- .../dancing-lessons-encounter.test.ts | 2 +- .../fight-or-flight-encounter.test.ts | 2 +- .../encounters/part-timer-encounter.test.ts | 2 +- .../the-strong-stuff-encounter.test.ts | 2 +- .../trash-to-treasure-encounter.test.ts | 2 +- .../uncommon-breed-encounter.test.ts | 2 +- test/testUtils/helpers/moveHelper.ts | 2 +- 168 files changed, 455 insertions(+), 490 deletions(-) delete mode 100644 src/@types/damage-result.ts delete mode 100644 src/data/moves/all-moves.ts delete mode 100644 src/data/moves/pokemon-move.ts delete mode 100644 src/enums/ai-type.ts delete mode 100644 src/enums/evolution-item.ts delete mode 100644 src/enums/field-position.ts delete mode 100644 src/enums/hit-result.ts delete mode 100644 src/enums/learn-move-context.ts delete mode 100644 src/enums/species-wild-evolution-delay.ts delete mode 100644 src/interfaces/attack-move-result.ts delete mode 100644 src/interfaces/damage-calculation-result.ts delete mode 100644 src/interfaces/turn-move.ts diff --git a/src/@types/damage-result.ts b/src/@types/damage-result.ts deleted file mode 100644 index 7086d843cf4..00000000000 --- a/src/@types/damage-result.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { HitResult } from "#enums/hit-result"; - -export type DamageResult = - | HitResult.EFFECTIVE - | HitResult.SUPER_EFFECTIVE - | HitResult.NOT_VERY_EFFECTIVE - | HitResult.ONE_HIT_KO - | HitResult.CONFUSION - | HitResult.INDIRECT_KO - | HitResult.INDIRECT; diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 12dbfca68e8..dd983f2b397 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -51,7 +51,7 @@ import { initGameSpeed } from "#app/system/game-speed"; import { Arena, ArenaBase } from "#app/field/arena"; import { GameData } from "#app/system/game-data"; import { addTextObject, getTextColor, TextStyle } from "#app/ui/text"; -import { allMoves } from "./data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { MusicPreference } from "#app/system/settings/settings"; import { getDefaultModifierTypeForTier, diff --git a/src/battle.ts b/src/battle.ts index 1122db2679a..fb5af223b8f 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -15,8 +15,7 @@ import { MoneyMultiplierModifier, PokemonHeldItemModifier } from "./modifier/mod import type { PokeballType } from "#enums/pokeball"; import { trainerConfigs } from "#app/data/trainers/trainer-config"; import { SpeciesFormKey } from "#enums/species-form-key"; -import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; -import type { TurnMove } from "./interfaces/turn-move"; +import type { EnemyPokemon, PlayerPokemon, TurnMove } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; import { ArenaTagType } from "#enums/arena-tag-type"; import { BattleSpec } from "#enums/battle-spec"; diff --git a/src/data/ability.ts b/src/data/ability.ts index 02cc12dd0f4..3e32a624f9f 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -1,8 +1,6 @@ -import type { EnemyPokemon } from "../field/pokemon"; -import type { PokemonMove } from "./moves/pokemon-move"; +import type { EnemyPokemon, PokemonMove } from "../field/pokemon"; import type Pokemon from "../field/pokemon"; -import { MoveResult, PlayerPokemon } from "../field/pokemon"; -import { HitResult } from "#enums/hit-result"; +import { HitResult, MoveResult, PlayerPokemon } from "../field/pokemon"; import { PokemonType } from "#enums/pokemon-type"; import { BooleanHolder, NumberHolder, toDmgValue, isNullOrUndefined, randSeedItem, randSeedInt, type Constructor } from "#app/utils"; import { getPokemonNameWithAffix } from "../messages"; @@ -12,8 +10,7 @@ import { BattlerTagLapseType, GroundedTag } from "./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, StatusMove, SelfStatusMove, VariablePowerAttr, applyMoveAttrs, VariableMoveTypeAttr, RandomMovesetMoveAttr, RandomMoveAttr, NaturePowerAttr, CopyMoveAttr, NeutralDamageAgainstFlyingTypeMultiplierAttr, FixedDamageAttr } from "./moves/move"; -import { allMoves } from "./moves/all-moves"; +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"; diff --git a/src/data/arena-tag.ts b/src/data/arena-tag.ts index c6a1515685f..871f622f70a 100644 --- a/src/data/arena-tag.ts +++ b/src/data/arena-tag.ts @@ -2,13 +2,12 @@ import { globalScene } from "#app/global-scene"; import type { Arena } from "#app/field/arena"; import { PokemonType } from "#enums/pokemon-type"; import { BooleanHolder, NumberHolder, toDmgValue } from "#app/utils"; -import { allMoves } from "./moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { MoveTarget } from "#enums/MoveTarget"; import { MoveCategory } from "#enums/MoveCategory"; import { getPokemonNameWithAffix } from "#app/messages"; import type Pokemon from "#app/field/pokemon"; -import { HitResult } from "#enums/hit-result"; -import { PokemonMove } from "./moves/pokemon-move"; +import { HitResult, PokemonMove } from "#app/field/pokemon"; import { StatusEffect } from "#enums/status-effect"; import type { BattlerIndex } from "#app/battle"; import { diff --git a/src/data/balance/egg-moves.ts b/src/data/balance/egg-moves.ts index 98f3347764c..74f6a2c1afb 100644 --- a/src/data/balance/egg-moves.ts +++ b/src/data/balance/egg-moves.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { getEnumKeys, getEnumValues } from "#app/utils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/data/balance/pokemon-evolutions.ts b/src/data/balance/pokemon-evolutions.ts index 70b616be8e5..17f71f3c3c9 100644 --- a/src/data/balance/pokemon-evolutions.ts +++ b/src/data/balance/pokemon-evolutions.ts @@ -14,10 +14,66 @@ import { DamageMoneyRewardModifier, ExtraModifierModifier, MoneyMultiplierModifi import { SpeciesFormKey } from "#enums/species-form-key"; import { speciesStarterCosts } from "./starters"; import i18next from "i18next"; -import { SpeciesWildEvolutionDelay } from "#enums/species-wild-evolution-delay"; -import { EvolutionItem } from "#enums/evolution-item"; +export enum SpeciesWildEvolutionDelay { + NONE, + SHORT, + MEDIUM, + LONG, + VERY_LONG, + NEVER +} + +export enum EvolutionItem { + NONE, + + LINKING_CORD, + SUN_STONE, + MOON_STONE, + LEAF_STONE, + FIRE_STONE, + WATER_STONE, + THUNDER_STONE, + ICE_STONE, + DUSK_STONE, + DAWN_STONE, + SHINY_STONE, + CRACKED_POT, + SWEET_APPLE, + TART_APPLE, + STRAWBERRY_SWEET, + UNREMARKABLE_TEACUP, + UPGRADE, + DUBIOUS_DISC, + DRAGON_SCALE, + PRISM_SCALE, + RAZOR_CLAW, + RAZOR_FANG, + REAPER_CLOTH, + ELECTIRIZER, + MAGMARIZER, + PROTECTOR, + SACHET, + WHIPPED_DREAM, + SYRUPY_APPLE, + CHIPPED_POT, + GALARICA_CUFF, + GALARICA_WREATH, + AUSPICIOUS_ARMOR, + MALICIOUS_ARMOR, + MASTERPIECE_TEACUP, + SUN_FLUTE, + MOON_FLUTE, + + BLACK_AUGURITE = 51, + PEAT_BLOCK, + METAL_ALLOY, + SCROLL_OF_DARKNESS, + SCROLL_OF_WATERS, + LEADERS_CREST +} + /** * Pokemon Evolution tuple type consisting of: * @property 0 {@linkcode Species} The species of the Pokemon. diff --git a/src/data/battle-anims.ts b/src/data/battle-anims.ts index 396cf71d984..511c80bee72 100644 --- a/src/data/battle-anims.ts +++ b/src/data/battle-anims.ts @@ -1,6 +1,5 @@ import { globalScene } from "#app/global-scene"; -import { AttackMove, BeakBlastHeaderAttr, DelayedAttackAttr, SelfStatusMove } from "./moves/move"; -import { allMoves } from "./moves/all-moves"; +import { AttackMove, BeakBlastHeaderAttr, DelayedAttackAttr, SelfStatusMove, allMoves } from "./moves/move"; import { MoveFlags } from "#enums/MoveFlags"; import type Pokemon from "../field/pokemon"; import { type nil, getFrameMs, getEnumKeys, getEnumValues, animationFileName } from "../utils"; diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index c3dcfc49ef6..76e91485460 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -11,12 +11,12 @@ import { import { ChargeAnim, CommonAnim, CommonBattleAnim, MoveChargeAnim } from "#app/data/battle-anims"; import type Move from "#app/data/moves/move"; import { + allMoves, applyMoveAttrs, ConsecutiveUseDoublePowerAttr, HealOnAllyAttr, StatusCategoryOnAllyAttr, } from "#app/data/moves/move"; -import { allMoves } from "./moves/all-moves"; import { MoveFlags } from "#enums/MoveFlags"; import { MoveCategory } from "#enums/MoveCategory"; import { SpeciesFormChangeAbilityTrigger } from "#app/data/pokemon-forms"; @@ -24,8 +24,7 @@ import { getStatusEffectHealText } from "#app/data/status-effect"; import { TerrainType } from "#app/data/terrain"; import { PokemonType } from "#enums/pokemon-type"; import type Pokemon from "#app/field/pokemon"; -import { MoveResult } from "#app/field/pokemon"; -import { HitResult } from "#enums/hit-result"; +import { HitResult, MoveResult } from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; import { CommonAnimPhase } from "#app/phases/common-anim-phase"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; diff --git a/src/data/berry.ts b/src/data/berry.ts index aaa0dda6e7f..8a58d337aa4 100644 --- a/src/data/berry.ts +++ b/src/data/berry.ts @@ -1,6 +1,6 @@ import { getPokemonNameWithAffix } from "../messages"; import type Pokemon from "../field/pokemon"; -import { HitResult } from "#enums/hit-result"; +import { HitResult } from "../field/pokemon"; import { getStatusEffectHealText } from "./status-effect"; import { NumberHolder, toDmgValue, randSeedInt } from "#app/utils"; import { diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 9a3c329a70b..51616c3f00f 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -6,7 +6,7 @@ import type PokemonSpecies from "#app/data/pokemon-species"; import { getPokemonSpecies, getPokemonSpeciesForm } from "#app/data/pokemon-species"; import { speciesStarterCosts } from "#app/data/balance/starters"; import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "./moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import type { FixedBattleConfig } from "#app/battle"; import { ClassicFixedBossWaves, BattleType, getRandomTrainerFunc } from "#app/battle"; import Trainer, { TrainerVariant } from "#app/field/trainer"; diff --git a/src/data/moves/all-moves.ts b/src/data/moves/all-moves.ts deleted file mode 100644 index c7b6d11a08d..00000000000 --- a/src/data/moves/all-moves.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type Move from "./move"; - -export const allMoves: Move[] = []; diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index 591894f5f1e..962a13bb840 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -12,17 +12,16 @@ import { TypeBoostTag, } from "../battler-tags"; import { getPokemonNameWithAffix } from "../../messages"; -import type { AttackMoveResult } from "#app/interfaces/attack-move-result"; -import type { TurnMove } from "#app/interfaces/turn-move"; +import type { AttackMoveResult, TurnMove } from "../../field/pokemon"; import type Pokemon from "../../field/pokemon"; import { EnemyPokemon, + FieldPosition, + HitResult, MoveResult, PlayerPokemon, + PokemonMove, } from "../../field/pokemon"; -import { HitResult } from "#enums/hit-result"; -import { FieldPosition } from "#enums/field-position"; -import { PokemonMove } from "./pokemon-move"; import { getNonVolatileStatusEffects, getStatusEffectHealText, @@ -122,7 +121,6 @@ import { MoveFlags } from "#enums/MoveFlags"; import { MoveEffectTrigger } from "#enums/MoveEffectTrigger"; import { MultiHitType } from "#enums/MultiHitType"; import { invalidAssistMoves, invalidCopycatMoves, invalidMetronomeMoves, invalidMirrorMoveMoves, invalidSleepTalkMoves } from "./invalid-moves"; -import { allMoves } from "./all-moves"; type MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => boolean; type UserMoveConditionFunc = (user: Pokemon, move: Move) => boolean; @@ -8259,7 +8257,11 @@ export function getMoveTargets(user: Pokemon, move: Moves, replaceTarget?: MoveT return { targets: set.filter(p => p?.isActive(true)).map(p => p.getBattlerIndex()).filter(t => t !== undefined), multiple }; } -allMoves.push(new SelfStatusMove(Moves.NONE, PokemonType.NORMAL, MoveCategory.STATUS, -1, -1, 0, 1)); +export const allMoves: Move[] = [ + new SelfStatusMove(Moves.NONE, PokemonType.NORMAL, MoveCategory.STATUS, -1, -1, 0, 1), +]; + +export const selfStatLowerMoves: Moves[] = []; export function initMoves() { allMoves.push( @@ -11248,4 +11250,9 @@ export function initMoves() { new AttackMove(Moves.MALIGNANT_CHAIN, PokemonType.POISON, MoveCategory.SPECIAL, 100, 100, 5, 50, 0, 9) .attr(StatusEffectAttr, StatusEffect.TOXIC) ); + allMoves.map(m => { + if (m.getAttrs(StatStageChangeAttr).some(a => a.selfTarget && a.stages < 0)) { + selfStatLowerMoves.push(m.id); + } + }); } diff --git a/src/data/moves/pokemon-move.ts b/src/data/moves/pokemon-move.ts deleted file mode 100644 index 49ccaba698b..00000000000 --- a/src/data/moves/pokemon-move.ts +++ /dev/null @@ -1,93 +0,0 @@ -import * as Utils from "#app/utils"; -import { allMoves } from "./all-moves"; -import type { Moves } from "#enums/moves"; -import type Pokemon from "#app/field/pokemon"; -import type Move from "./move"; - -/** - * Wrapper class for the {@linkcode Move} class for Pokemon to interact with. - * These are the moves assigned to a {@linkcode Pokemon} object. - * It links to {@linkcode Move} class via the move ID. - * Compared to {@linkcode Move}, this class also tracks if a move has received. - * PP Ups, amount of PP used, and things like that. - * @see {@linkcode isUsable} - checks if move is restricted, out of PP, or not implemented. - * @see {@linkcode getMove} - returns {@linkcode Move} object by looking it up via ID. - * @see {@linkcode usePp} - removes a point of PP from the move. - * @see {@linkcode getMovePp} - returns amount of PP a move currently has. - * @see {@linkcode getPpRatio} - returns the current PP amount / max PP amount. - * @see {@linkcode getName} - returns name of {@linkcode Move}. - **/ -export class PokemonMove { - public moveId: Moves; - public ppUsed: number; - public ppUp: number; - public virtual: boolean; - - /** - * If defined and nonzero, overrides the maximum PP of the move (e.g., due to move being copied by Transform). - * This also nullifies all effects of `ppUp`. - */ - public maxPpOverride?: number; - - constructor(moveId: Moves, ppUsed = 0, ppUp = 0, virtual = false, maxPpOverride?: number) { - this.moveId = moveId; - this.ppUsed = ppUsed; - this.ppUp = ppUp; - this.virtual = virtual; - this.maxPpOverride = maxPpOverride; - } - - /** - * Checks whether the move can be selected or performed by a Pokemon, without consideration for the move's targets. - * The move is unusable if it is out of PP, restricted by an effect, or unimplemented. - * - * @param pokemon - {@linkcode Pokemon} that would be using this move - * @param ignorePp - If `true`, skips the PP check - * @param ignoreRestrictionTags - If `true`, skips the check for move restriction tags (see {@link MoveRestrictionBattlerTag}) - * @returns `true` if the move can be selected and used by the Pokemon, otherwise `false`. - */ - isUsable(pokemon: Pokemon, ignorePp = false, ignoreRestrictionTags = false): boolean { - if (this.moveId && !ignoreRestrictionTags && pokemon.isMoveRestricted(this.moveId, pokemon)) { - return false; - } - - if (this.getMove().name.endsWith(" (N)")) { - return false; - } - - return ignorePp || this.ppUsed < this.getMovePp() || this.getMove().pp === -1; - } - - getMove(): Move { - return allMoves[this.moveId]; - } - - /** - * Sets {@link ppUsed} for this move and ensures the value does not exceed {@link getMovePp} - * @param {number} count Amount of PP to use - */ - usePp(count = 1) { - this.ppUsed = Math.min(this.ppUsed + count, this.getMovePp()); - } - - getMovePp(): number { - return this.maxPpOverride || this.getMove().pp + this.ppUp * Utils.toDmgValue(this.getMove().pp / 5); - } - - getPpRatio(): number { - return 1 - this.ppUsed / this.getMovePp(); - } - - getName(): string { - return this.getMove().name; - } - - /** - * Copies an existing move or creates a valid PokemonMove object from json representing one - * @param source - The data for the move to copy - * @return A valid pokemonmove object - */ - static loadMove(source: PokemonMove | any): PokemonMove { - return new PokemonMove(source.moveId, source.ppUsed, source.ppUp, source.virtual, source.maxPpOverride); - } -} diff --git a/src/data/mystery-encounters/encounters/absolute-avarice-encounter.ts b/src/data/mystery-encounters/encounters/absolute-avarice-encounter.ts index b781f14fad1..85f40a41e51 100644 --- a/src/data/mystery-encounters/encounters/absolute-avarice-encounter.ts +++ b/src/data/mystery-encounters/encounters/absolute-avarice-encounter.ts @@ -7,8 +7,7 @@ import { transitionMysteryEncounterIntroVisuals, } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; import type Pokemon from "#app/field/pokemon"; -import { EnemyPokemon } from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { EnemyPokemon, PokemonMove } from "#app/field/pokemon"; import type { BerryModifierType, PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; import { modifierTypes } from "#app/modifier/modifier-type"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; diff --git a/src/data/mystery-encounters/encounters/bug-type-superfan-encounter.ts b/src/data/mystery-encounters/encounters/bug-type-superfan-encounter.ts index c6971c42364..1e4c9a3b957 100644 --- a/src/data/mystery-encounters/encounters/bug-type-superfan-encounter.ts +++ b/src/data/mystery-encounters/encounters/bug-type-superfan-encounter.ts @@ -24,7 +24,7 @@ import { TrainerType } from "#enums/trainer-type"; import { Species } from "#enums/species"; import type { PlayerPokemon } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { getEncounterText, showEncounterDialogue } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; import { LearnMovePhase } from "#app/phases/learn-move-phase"; import { Moves } from "#enums/moves"; @@ -50,7 +50,7 @@ import { } from "#app/modifier/modifier"; import i18next from "i18next"; import MoveInfoOverlay from "#app/ui/move-info-overlay"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { ModifierTier } from "#app/modifier/modifier-tier"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode"; import { getSpriteKeysFromSpecies } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; diff --git a/src/data/mystery-encounters/encounters/clowning-around-encounter.ts b/src/data/mystery-encounters/encounters/clowning-around-encounter.ts index 15fad6dacbf..eca99fc0c13 100644 --- a/src/data/mystery-encounters/encounters/clowning-around-encounter.ts +++ b/src/data/mystery-encounters/encounters/clowning-around-encounter.ts @@ -37,7 +37,7 @@ import { Mode } from "#app/ui/ui"; 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/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { Ability } from "#app/data/ability"; import { BerryModifier } from "#app/modifier/modifier"; import { BerryType } from "#enums/berry-type"; diff --git a/src/data/mystery-encounters/encounters/dancing-lessons-encounter.ts b/src/data/mystery-encounters/encounters/dancing-lessons-encounter.ts index 90ea6a69c0d..75527e1f8c1 100644 --- a/src/data/mystery-encounters/encounters/dancing-lessons-encounter.ts +++ b/src/data/mystery-encounters/encounters/dancing-lessons-encounter.ts @@ -23,8 +23,7 @@ import { getPokemonSpecies } from "#app/data/pokemon-species"; import { TrainerSlot } from "#enums/trainer-slot"; import type { PlayerPokemon } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; -import { EnemyPokemon } from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { EnemyPokemon, PokemonMove } from "#app/field/pokemon"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode"; import { modifierTypes } from "#app/modifier/modifier-type"; import { LearnMovePhase } from "#app/phases/learn-move-phase"; diff --git a/src/data/mystery-encounters/encounters/field-trip-encounter.ts b/src/data/mystery-encounters/encounters/field-trip-encounter.ts index 4e330fab3d9..a1964aa5ab4 100644 --- a/src/data/mystery-encounters/encounters/field-trip-encounter.ts +++ b/src/data/mystery-encounters/encounters/field-trip-encounter.ts @@ -7,8 +7,7 @@ import { setEncounterExp, setEncounterRewards, } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type { PokemonMove } from "#app/data/moves/pokemon-move"; +import type { PlayerPokemon, PokemonMove } from "#app/field/pokemon"; import { modifierTypes } from "#app/modifier/modifier-type"; import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; diff --git a/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts b/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts index d868184a7fa..6118fe3d0de 100644 --- a/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts +++ b/src/data/mystery-encounters/encounters/fiery-fallout-encounter.ts @@ -26,7 +26,7 @@ import { Gender } from "#app/data/gender"; import { PokemonType } from "#enums/pokemon-type"; import { BattlerIndex } from "#app/battle"; import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { Moves } from "#enums/moves"; import { EncounterBattleAnim } from "#app/data/battle-anims"; import { WeatherType } from "#enums/weather-type"; diff --git a/src/data/mystery-encounters/encounters/fun-and-games-encounter.ts b/src/data/mystery-encounters/encounters/fun-and-games-encounter.ts index a9fc24c70b7..282c6c149ff 100644 --- a/src/data/mystery-encounters/encounters/fun-and-games-encounter.ts +++ b/src/data/mystery-encounters/encounters/fun-and-games-encounter.ts @@ -13,7 +13,7 @@ import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/myst import { TrainerSlot } from "#enums/trainer-slot"; import type { PlayerPokemon } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; -import { FieldPosition } from "#enums/field-position"; +import { FieldPosition } from "#app/field/pokemon"; import { getPokemonSpecies } from "#app/data/pokemon-species"; import { MoneyRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements"; import { queueEncounterMessage, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; diff --git a/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts b/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts index fce496e5e17..f80620647b0 100644 --- a/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts +++ b/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts @@ -26,8 +26,7 @@ import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode import { NumberHolder, isNullOrUndefined, randInt, randSeedInt, randSeedShuffle, randSeedItem } from "#app/utils"; import type { PlayerPokemon } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; -import { EnemyPokemon } from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { EnemyPokemon, PokemonMove } from "#app/field/pokemon"; import type { PokemonHeldItemModifier } from "#app/modifier/modifier"; import { HiddenAbilityRateBoosterModifier, diff --git a/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts b/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts index 030678b77b1..97fd5783ebb 100644 --- a/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts +++ b/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts @@ -11,7 +11,7 @@ import { applyDamageToPokemon } from "#app/data/mystery-encounters/utils/encount import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; const OPTION_1_REQUIRED_MOVE = Moves.SURF; const OPTION_2_REQUIRED_MOVE = Moves.FLY; diff --git a/src/data/mystery-encounters/encounters/slumbering-snorlax-encounter.ts b/src/data/mystery-encounters/encounters/slumbering-snorlax-encounter.ts index 97a17af43d0..bfa1204a8ba 100644 --- a/src/data/mystery-encounters/encounters/slumbering-snorlax-encounter.ts +++ b/src/data/mystery-encounters/encounters/slumbering-snorlax-encounter.ts @@ -21,8 +21,7 @@ import { import { queueEncounterMessage } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; import { Moves } from "#enums/moves"; import { BattlerIndex } from "#app/battle"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { AiType } from "#enums/ai-type"; +import { AiType, PokemonMove } from "#app/field/pokemon"; import { getPokemonSpecies } from "#app/data/pokemon-species"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; diff --git a/src/data/mystery-encounters/encounters/the-strong-stuff-encounter.ts b/src/data/mystery-encounters/encounters/the-strong-stuff-encounter.ts index af0363f37e3..c994c6e993f 100644 --- a/src/data/mystery-encounters/encounters/the-strong-stuff-encounter.ts +++ b/src/data/mystery-encounters/encounters/the-strong-stuff-encounter.ts @@ -17,7 +17,7 @@ import { getPokemonSpecies } from "#app/data/pokemon-species"; import { Species } from "#enums/species"; import { Nature } from "#enums/nature"; import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { queueEncounterMessage, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; import { modifyPlayerPokemonBST } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils"; import { Moves } from "#enums/moves"; diff --git a/src/data/mystery-encounters/encounters/trash-to-treasure-encounter.ts b/src/data/mystery-encounters/encounters/trash-to-treasure-encounter.ts index 2203ac041f8..e60fe0ddc18 100644 --- a/src/data/mystery-encounters/encounters/trash-to-treasure-encounter.ts +++ b/src/data/mystery-encounters/encounters/trash-to-treasure-encounter.ts @@ -25,7 +25,7 @@ import { ModifierTier } from "#app/modifier/modifier-tier"; import { getPokemonSpecies } from "#app/data/pokemon-species"; import { Moves } from "#enums/moves"; import { BattlerIndex } from "#app/battle"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode"; import { randSeedInt } from "#app/utils"; diff --git a/src/data/mystery-encounters/encounters/uncommon-breed-encounter.ts b/src/data/mystery-encounters/encounters/uncommon-breed-encounter.ts index 4e3c238aeba..ed1866c7a1b 100644 --- a/src/data/mystery-encounters/encounters/uncommon-breed-encounter.ts +++ b/src/data/mystery-encounters/encounters/uncommon-breed-encounter.ts @@ -10,7 +10,7 @@ import { import { CHARMING_MOVES } from "#app/data/mystery-encounters/requirements/requirement-groups"; import type Pokemon from "#app/field/pokemon"; import type { EnemyPokemon } from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { globalScene } from "#app/global-scene"; import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; diff --git a/src/data/mystery-encounters/encounters/weird-dream-encounter.ts b/src/data/mystery-encounters/encounters/weird-dream-encounter.ts index be0c0bdff54..22ec52e976c 100644 --- a/src/data/mystery-encounters/encounters/weird-dream-encounter.ts +++ b/src/data/mystery-encounters/encounters/weird-dream-encounter.ts @@ -16,7 +16,7 @@ import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import type { PlayerPokemon } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { NumberHolder, isNullOrUndefined, randSeedInt, randSeedShuffle } from "#app/utils"; import type PokemonSpecies from "#app/data/pokemon-species"; import { allSpecies, getPokemonSpecies } from "#app/data/pokemon-species"; diff --git a/src/data/mystery-encounters/mystery-encounter-requirements.ts b/src/data/mystery-encounters/mystery-encounter-requirements.ts index 0c146fe485d..f9aedf2c1a7 100644 --- a/src/data/mystery-encounters/mystery-encounter-requirements.ts +++ b/src/data/mystery-encounters/mystery-encounter-requirements.ts @@ -1,7 +1,6 @@ import { globalScene } from "#app/global-scene"; import { allAbilities } from "#app/data/ability"; -import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; -import { EvolutionItem } from "#enums/evolution-item"; +import { EvolutionItem, pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; import { Nature } from "#enums/nature"; import { FormChangeItem, pokemonFormChanges, SpeciesFormChangeItemTrigger } from "#app/data/pokemon-forms"; import { StatusEffect } from "#enums/status-effect"; diff --git a/src/data/mystery-encounters/mystery-encounter.ts b/src/data/mystery-encounters/mystery-encounter.ts index 8010983f9f3..ff098d4d7dd 100644 --- a/src/data/mystery-encounters/mystery-encounter.ts +++ b/src/data/mystery-encounters/mystery-encounter.ts @@ -1,6 +1,5 @@ import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type { PokemonMove } from "../moves/pokemon-move"; +import type { PlayerPokemon, PokemonMove } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; import { capitalizeFirstLetter, isNullOrUndefined } from "#app/utils"; import type { MysteryEncounterType } from "#enums/mystery-encounter-type"; diff --git a/src/data/mystery-encounters/requirements/can-learn-move-requirement.ts b/src/data/mystery-encounters/requirements/can-learn-move-requirement.ts index 598b0ffae70..a7ffe3e26ca 100644 --- a/src/data/mystery-encounters/requirements/can-learn-move-requirement.ts +++ b/src/data/mystery-encounters/requirements/can-learn-move-requirement.ts @@ -1,6 +1,6 @@ import type { Moves } from "#app/enums/moves"; import type { PlayerPokemon } from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { isNullOrUndefined } from "#app/utils"; import { EncounterPokemonRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements"; import { globalScene } from "#app/global-scene"; diff --git a/src/data/mystery-encounters/utils/encounter-phase-utils.ts b/src/data/mystery-encounters/utils/encounter-phase-utils.ts index 6ab650d5f9b..a9f6b787878 100644 --- a/src/data/mystery-encounters/utils/encounter-phase-utils.ts +++ b/src/data/mystery-encounters/utils/encounter-phase-utils.ts @@ -7,12 +7,9 @@ import { WEIGHT_INCREMENT_ON_SPAWN_MISS, } from "#app/data/mystery-encounters/mystery-encounters"; import { showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type { AiType } from "#enums/ai-type"; +import type { AiType, PlayerPokemon } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; -import { EnemyPokemon, PokemonSummonData } from "#app/field/pokemon"; -import { FieldPosition } from "#enums/field-position"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { EnemyPokemon, FieldPosition, PokemonMove, PokemonSummonData } from "#app/field/pokemon"; import type { CustomModifierSettings, ModifierType } from "#app/modifier/modifier-type"; import { getPartyLuckValue, diff --git a/src/data/pokemon-forms.ts b/src/data/pokemon-forms.ts index 6f36bfde74f..63e166c7fc4 100644 --- a/src/data/pokemon-forms.ts +++ b/src/data/pokemon-forms.ts @@ -1,7 +1,7 @@ import { PokemonFormChangeItemModifier } from "../modifier/modifier"; import type Pokemon from "../field/pokemon"; import { StatusEffect } from "#enums/status-effect"; -import { allMoves } from "./moves/all-moves"; +import { allMoves } from "./moves/move"; import { MoveCategory } from "#enums/MoveCategory"; import type { Constructor, nil } from "#app/utils"; import { Abilities } from "#enums/abilities"; diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index ced828fbc6b..a27c00121dc 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -13,8 +13,11 @@ import { uncatchableSpecies } from "#app/data/balance/biomes"; import { speciesEggMoves } from "#app/data/balance/egg-moves"; import { GrowthRate } from "#app/data/exp"; import type { EvolutionLevel } from "#app/data/balance/pokemon-evolutions"; -import { pokemonEvolutions, pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions"; -import { SpeciesWildEvolutionDelay } from "#enums/species-wild-evolution-delay"; +import { + SpeciesWildEvolutionDelay, + pokemonEvolutions, + pokemonPrevolutions, +} from "#app/data/balance/pokemon-evolutions"; import { PokemonType } from "#enums/pokemon-type"; import type { LevelMoves } from "#app/data/balance/pokemon-level-moves"; import { diff --git a/src/data/trainers/trainer-config.ts b/src/data/trainers/trainer-config.ts index c87f72bd912..0ab7119dab9 100644 --- a/src/data/trainers/trainer-config.ts +++ b/src/data/trainers/trainer-config.ts @@ -1,6 +1,6 @@ import { globalScene } from "#app/global-scene"; import { modifierTypes } from "#app/modifier/modifier-type"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { toReadableString, isNullOrUndefined, randSeedItem, randSeedInt } from "#app/utils"; import { pokemonEvolutions, pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions"; import { getPokemonSpecies } from "#app/data/pokemon-species"; diff --git a/src/enums/ai-type.ts b/src/enums/ai-type.ts deleted file mode 100644 index 13931172a4a..00000000000 --- a/src/enums/ai-type.ts +++ /dev/null @@ -1,5 +0,0 @@ -export enum AiType { - RANDOM, - SMART_RANDOM, - SMART -} diff --git a/src/enums/evolution-item.ts b/src/enums/evolution-item.ts deleted file mode 100644 index 3b5e493b378..00000000000 --- a/src/enums/evolution-item.ts +++ /dev/null @@ -1,48 +0,0 @@ -export enum EvolutionItem { - NONE, - - LINKING_CORD, - SUN_STONE, - MOON_STONE, - LEAF_STONE, - FIRE_STONE, - WATER_STONE, - THUNDER_STONE, - ICE_STONE, - DUSK_STONE, - DAWN_STONE, - SHINY_STONE, - CRACKED_POT, - SWEET_APPLE, - TART_APPLE, - STRAWBERRY_SWEET, - UNREMARKABLE_TEACUP, - UPGRADE, - DUBIOUS_DISC, - DRAGON_SCALE, - PRISM_SCALE, - RAZOR_CLAW, - RAZOR_FANG, - REAPER_CLOTH, - ELECTIRIZER, - MAGMARIZER, - PROTECTOR, - SACHET, - WHIPPED_DREAM, - SYRUPY_APPLE, - CHIPPED_POT, - GALARICA_CUFF, - GALARICA_WREATH, - AUSPICIOUS_ARMOR, - MALICIOUS_ARMOR, - MASTERPIECE_TEACUP, - SUN_FLUTE, - MOON_FLUTE, - - BLACK_AUGURITE = 51, - PEAT_BLOCK, - METAL_ALLOY, - SCROLL_OF_DARKNESS, - SCROLL_OF_WATERS, - LEADERS_CREST -} diff --git a/src/enums/field-position.ts b/src/enums/field-position.ts deleted file mode 100644 index 5b7f9c6c570..00000000000 --- a/src/enums/field-position.ts +++ /dev/null @@ -1,5 +0,0 @@ -export enum FieldPosition { - CENTER, - LEFT, - RIGHT -} diff --git a/src/enums/hit-result.ts b/src/enums/hit-result.ts deleted file mode 100644 index 3e62587dd6c..00000000000 --- a/src/enums/hit-result.ts +++ /dev/null @@ -1,15 +0,0 @@ -export enum HitResult { - EFFECTIVE = 1, - SUPER_EFFECTIVE, - NOT_VERY_EFFECTIVE, - ONE_HIT_KO, - NO_EFFECT, - STATUS, - HEAL, - FAIL, - MISS, - INDIRECT, - IMMUNE, - CONFUSION, - INDIRECT_KO -} diff --git a/src/enums/learn-move-context.ts b/src/enums/learn-move-context.ts deleted file mode 100644 index 26001cbcce8..00000000000 --- a/src/enums/learn-move-context.ts +++ /dev/null @@ -1,8 +0,0 @@ -export enum LearnMoveContext { - MISC, - LEVEL_UP, - RELEARN, - EVOLUTION, - EVOLUTION_FUSED, // If fusionSpecies has Evolved - EVOLUTION_FUSED_BASE, // If fusion's base species has Evolved -} diff --git a/src/enums/species-wild-evolution-delay.ts b/src/enums/species-wild-evolution-delay.ts deleted file mode 100644 index 7555dc0e8f6..00000000000 --- a/src/enums/species-wild-evolution-delay.ts +++ /dev/null @@ -1,8 +0,0 @@ -export enum SpeciesWildEvolutionDelay { - NONE, - SHORT, - MEDIUM, - LONG, - VERY_LONG, - NEVER -} diff --git a/src/field/damage-number-handler.ts b/src/field/damage-number-handler.ts index 3bb001bf005..a527b148fff 100644 --- a/src/field/damage-number-handler.ts +++ b/src/field/damage-number-handler.ts @@ -1,7 +1,7 @@ import { TextStyle, addTextObject } from "../ui/text"; -import type { DamageResult } from "#app/@types/damage-result"; +import type { DamageResult } from "./pokemon"; import type Pokemon from "./pokemon"; -import { HitResult } from "#enums/hit-result"; +import { HitResult } from "./pokemon"; import { formatStat, fixedInt } from "#app/utils"; import type { BattlerIndex } from "../battle"; import { globalScene } from "#app/global-scene"; diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 162a5118f65..b59b7ba01fe 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -17,6 +17,7 @@ import { applyMoveAttrs, FixedDamageAttr, VariableAtkAttr, + allMoves, TypelessAttr, CritOnlyAttr, getMoveTargets, @@ -41,7 +42,6 @@ import { VariableMoveTypeChartAttr, HpSplitAttr, } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; import { MoveTarget } from "#enums/MoveTarget"; import { MoveCategory } from "#enums/MoveCategory"; import type { PokemonSpeciesForm } from "#app/data/pokemon-species"; @@ -214,7 +214,7 @@ import { SpeciesFormChangeActiveTrigger, SpeciesFormChangeLapseTeraTrigger, SpeciesFormChangeMoveLearnedTrigger, - SpeciesFormChangePostMoveTrigger, + SpeciesFormChangePostMoveTrigger } from "#app/data/pokemon-forms"; import { TerrainType } from "#app/data/terrain"; import type { TrainerSlot } from "#enums/trainer-slot"; @@ -259,15 +259,21 @@ import { MoveFlags } from "#enums/MoveFlags"; import { timedEventManager } from "#app/global-event-manager"; import { loadMoveAnimations } from "#app/sprites/pokemon-asset-loader"; import { ResetStatusPhase } from "#app/phases/reset-status-phase"; -import { LearnMoveContext } from "#enums/learn-move-context"; -import { TurnMove } from "#app/interfaces/turn-move"; -import { AiType } from "#enums/ai-type"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; -import { DamageCalculationResult } from "#app/interfaces/damage-calculation-result"; -import { FieldPosition } from "#enums/field-position"; -import { AttackMoveResult } from "#app/interfaces/attack-move-result"; -import { HitResult } from "#enums/hit-result"; -import { DamageResult } from "#app/@types/damage-result"; + +export enum LearnMoveSituation { + MISC, + LEVEL_UP, + RELEARN, + EVOLUTION, + EVOLUTION_FUSED, // If fusionSpecies has Evolved + EVOLUTION_FUSED_BASE, // If fusion's base species has Evolved +} + +export enum FieldPosition { + CENTER, + LEFT, + RIGHT, +} export default abstract class Pokemon extends Phaser.GameObjects.Container { public id: number; @@ -2919,7 +2925,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { includeEvolutionMoves = false, simulateEvolutionChain = false, includeRelearnerMoves = false, - learnSituation: LearnMoveContext = LearnMoveContext.MISC, + learnSituation: LearnMoveSituation = LearnMoveSituation.MISC, ): LevelMoves { const ret: LevelMoves = []; let levelMoves: LevelMoves = []; @@ -2927,7 +2933,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { startingLevel = this.level; } if ( - learnSituation === LearnMoveContext.EVOLUTION_FUSED && + learnSituation === LearnMoveSituation.EVOLUTION_FUSED && this.fusionSpecies ) { // For fusion evolutions, get ONLY the moves of the component mon that evolved @@ -2979,7 +2985,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } if ( this.fusionSpecies && - learnSituation !== LearnMoveContext.EVOLUTION_FUSED_BASE + learnSituation !== LearnMoveSituation.EVOLUTION_FUSED_BASE ) { // For fusion evolutions, get ONLY the moves of the component mon that evolved if (simulateEvolutionChain) { @@ -7773,6 +7779,24 @@ interface IllusionData { level?: number } +export interface TurnMove { + move: Moves; + targets: BattlerIndex[]; + result?: MoveResult; + virtual?: boolean; + turn?: number; + ignorePP?: boolean; +} + +export interface AttackMoveResult { + move: Moves; + result: DamageResult; + damage: number; + critical: boolean; + sourceId: number; + sourceBattlerIndex: BattlerIndex; +} + export class PokemonSummonData { /** [Atk, Def, SpAtk, SpDef, Spd, Acc, Eva] */ public statStages: number[] = [0, 0, 0, 0, 0, 0, 0]; @@ -7845,6 +7869,12 @@ export class PokemonTurnData { public extraTurns = 0; } +export enum AiType { + RANDOM, + SMART_RANDOM, + SMART, +} + export enum MoveResult { PENDING, SUCCESS, @@ -7852,3 +7882,151 @@ export enum MoveResult { MISS, OTHER, } + +export enum HitResult { + EFFECTIVE = 1, + SUPER_EFFECTIVE, + NOT_VERY_EFFECTIVE, + ONE_HIT_KO, + NO_EFFECT, + STATUS, + HEAL, + FAIL, + MISS, + INDIRECT, + IMMUNE, + CONFUSION, + INDIRECT_KO, +} + +export type DamageResult = + | HitResult.EFFECTIVE + | HitResult.SUPER_EFFECTIVE + | HitResult.NOT_VERY_EFFECTIVE + | HitResult.ONE_HIT_KO + | HitResult.CONFUSION + | HitResult.INDIRECT_KO + | HitResult.INDIRECT; + +/** Interface containing the results of a damage calculation for a given move */ +export interface DamageCalculationResult { + /** `true` if the move was cancelled (thus suppressing "No Effect" messages) */ + cancelled: boolean; + /** The effectiveness of the move */ + result: HitResult; + /** The damage dealt by the move */ + damage: number; +} + +/** + * Wrapper class for the {@linkcode Move} class for Pokemon to interact with. + * These are the moves assigned to a {@linkcode Pokemon} object. + * It links to {@linkcode Move} class via the move ID. + * Compared to {@linkcode Move}, this class also tracks if a move has received. + * PP Ups, amount of PP used, and things like that. + * @see {@linkcode isUsable} - checks if move is restricted, out of PP, or not implemented. + * @see {@linkcode getMove} - returns {@linkcode Move} object by looking it up via ID. + * @see {@linkcode usePp} - removes a point of PP from the move. + * @see {@linkcode getMovePp} - returns amount of PP a move currently has. + * @see {@linkcode getPpRatio} - returns the current PP amount / max PP amount. + * @see {@linkcode getName} - returns name of {@linkcode Move}. + **/ +export class PokemonMove { + public moveId: Moves; + public ppUsed: number; + public ppUp: number; + public virtual: boolean; + + /** + * If defined and nonzero, overrides the maximum PP of the move (e.g., due to move being copied by Transform). + * This also nullifies all effects of `ppUp`. + */ + public maxPpOverride?: number; + + constructor( + moveId: Moves, + ppUsed = 0, + ppUp = 0, + virtual = false, + maxPpOverride?: number, + ) { + this.moveId = moveId; + this.ppUsed = ppUsed; + this.ppUp = ppUp; + this.virtual = virtual; + this.maxPpOverride = maxPpOverride; + } + + /** + * Checks whether the move can be selected or performed by a Pokemon, without consideration for the move's targets. + * The move is unusable if it is out of PP, restricted by an effect, or unimplemented. + * + * @param {Pokemon} pokemon {@linkcode Pokemon} that would be using this move + * @param {boolean} ignorePp If `true`, skips the PP check + * @param {boolean} ignoreRestrictionTags If `true`, skips the check for move restriction tags (see {@link MoveRestrictionBattlerTag}) + * @returns `true` if the move can be selected and used by the Pokemon, otherwise `false`. + */ + isUsable( + pokemon: Pokemon, + ignorePp = false, + ignoreRestrictionTags = false, + ): boolean { + if ( + this.moveId && + !ignoreRestrictionTags && + pokemon.isMoveRestricted(this.moveId, pokemon) + ) { + return false; + } + + if (this.getMove().name.endsWith(" (N)")) { + return false; + } + + return ( + ignorePp || this.ppUsed < this.getMovePp() || this.getMove().pp === -1 + ); + } + + getMove(): Move { + return allMoves[this.moveId]; + } + + /** + * Sets {@link ppUsed} for this move and ensures the value does not exceed {@link getMovePp} + * @param {number} count Amount of PP to use + */ + usePp(count = 1) { + this.ppUsed = Math.min(this.ppUsed + count, this.getMovePp()); + } + + getMovePp(): number { + return ( + this.maxPpOverride || + this.getMove().pp + this.ppUp * toDmgValue(this.getMove().pp / 5) + ); + } + + getPpRatio(): number { + return 1 - this.ppUsed / this.getMovePp(); + } + + getName(): string { + return this.getMove().name; + } + + /** + * Copies an existing move or creates a valid PokemonMove object from json representing one + * @param {PokemonMove | any} source The data for the move to copy + * @return {PokemonMove} A valid pokemonmove object + */ + static loadMove(source: PokemonMove | any): PokemonMove { + return new PokemonMove( + source.moveId, + source.ppUsed, + source.ppUp, + source.virtual, + source.maxPpOverride, + ); + } +} diff --git a/src/interfaces/attack-move-result.ts b/src/interfaces/attack-move-result.ts deleted file mode 100644 index f91d31a69ee..00000000000 --- a/src/interfaces/attack-move-result.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { BattlerIndex } from "#app/battle"; -import type { DamageResult } from "#app/@types/damage-result"; -import type { Moves } from "#enums/moves"; - -export interface AttackMoveResult { - move: Moves; - result: DamageResult; - damage: number; - critical: boolean; - sourceId: number; - sourceBattlerIndex: BattlerIndex; -} diff --git a/src/interfaces/damage-calculation-result.ts b/src/interfaces/damage-calculation-result.ts deleted file mode 100644 index 1220ff7b57d..00000000000 --- a/src/interfaces/damage-calculation-result.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { HitResult } from "#enums/hit-result"; - -/** Interface containing the results of a damage calculation for a given move */ -export interface DamageCalculationResult { - /** `true` if the move was cancelled (thus suppressing "No Effect" messages) */ - cancelled: boolean; - /** The effectiveness of the move */ - result: HitResult; - /** The damage dealt by the move */ - damage: number; -} diff --git a/src/interfaces/turn-move.ts b/src/interfaces/turn-move.ts deleted file mode 100644 index 639d309256e..00000000000 --- a/src/interfaces/turn-move.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { BattlerIndex } from "#app/battle"; -import type { MoveResult } from "#app/field/pokemon"; -import type { Moves } from "#enums/moves"; - -export interface TurnMove { - move: Moves; - targets: BattlerIndex[]; - result?: MoveResult; - virtual?: boolean; - turn?: number; - ignorePP?: boolean; -} diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 852593d922c..8feb60c7778 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -1,10 +1,8 @@ import { globalScene } from "#app/global-scene"; -import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; -import { EvolutionItem } from "#enums/evolution-item"; +import { EvolutionItem, pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; import { tmPoolTiers, tmSpecies } from "#app/data/balance/tms"; import { getBerryEffectDescription, getBerryName } from "#app/data/berry"; -import { AttackMove } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, AttackMove } from "#app/data/moves/move"; import { getNatureName, getNatureStatMultiplier } from "#app/data/nature"; import { getPokeballCatchMultiplier, getPokeballName, MAX_PER_TYPE_POKEBALLS } from "#app/data/pokeball"; import { @@ -15,8 +13,7 @@ import { } from "#app/data/pokemon-forms"; import { getStatusEffectDescriptor } from "#app/data/status-effect"; import { PokemonType } from "#enums/pokemon-type"; -import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; -import type { PokemonMove } from "#app/data/moves/pokemon-move"; +import type { EnemyPokemon, PlayerPokemon, PokemonMove } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; import { diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 7860d0f9296..80f14ba22ce 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -1,7 +1,7 @@ import { FusionSpeciesFormEvolution, pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; import { getBerryEffectFunc, getBerryPredicate } from "#app/data/berry"; import { getLevelTotalExp } from "#app/data/exp"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { MAX_PER_TYPE_POKEBALLS } from "#app/data/pokeball"; import { type FormChangeItem, SpeciesFormChangeItemTrigger } from "#app/data/pokemon-forms"; import { getStatusEffectHealText } from "#app/data/status-effect"; diff --git a/src/overrides.ts b/src/overrides.ts index 49efb5eed33..21c72cd7b98 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -1,5 +1,5 @@ import { type PokeballCounts } from "#app/battle-scene"; -import { EvolutionItem } from "#enums/evolution-item"; +import { EvolutionItem } from "#app/data/balance/pokemon-evolutions"; import { Gender } from "#app/data/gender"; import { FormChangeItem } from "#app/data/pokemon-forms"; import { Variant } from "#app/sprites/variant"; diff --git a/src/phases/command-phase.ts b/src/phases/command-phase.ts index c65f121d20e..8691ac453ca 100644 --- a/src/phases/command-phase.ts +++ b/src/phases/command-phase.ts @@ -11,9 +11,8 @@ import { BattlerTagType } from "#app/enums/battler-tag-type"; import { Biome } from "#app/enums/biome"; import { Moves } from "#app/enums/moves"; import { PokeballType } from "#enums/pokeball"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type { TurnMove } from "#app/interfaces/turn-move"; -import { FieldPosition } from "#enums/field-position"; +import type { PlayerPokemon, TurnMove } from "#app/field/pokemon"; +import { FieldPosition } from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; import { Command } from "#app/ui/command-ui-handler"; import { Mode } from "#app/ui/ui"; diff --git a/src/phases/damage-anim-phase.ts b/src/phases/damage-anim-phase.ts index 91b21376515..696a2e55b6f 100644 --- a/src/phases/damage-anim-phase.ts +++ b/src/phases/damage-anim-phase.ts @@ -1,8 +1,7 @@ import { globalScene } from "#app/global-scene"; import type { BattlerIndex } from "#app/battle"; import { BattleSpec } from "#enums/battle-spec"; -import type { DamageResult } from "#app/@types/damage-result"; -import { HitResult } from "#enums/hit-result"; +import { type DamageResult, HitResult } from "#app/field/pokemon"; import { fixedInt } from "#app/utils"; import { PokemonPhase } from "#app/phases/pokemon-phase"; diff --git a/src/phases/encounter-phase.ts b/src/phases/encounter-phase.ts index 9e28de32c4a..15f3d102e41 100644 --- a/src/phases/encounter-phase.ts +++ b/src/phases/encounter-phase.ts @@ -11,7 +11,7 @@ import { TrainerSlot } from "#enums/trainer-slot"; import { getRandomWeatherType } from "#app/data/weather"; import { EncounterPhaseEvent } from "#app/events/battle-scene"; import type Pokemon from "#app/field/pokemon"; -import { FieldPosition } from "#enums/field-position"; +import { FieldPosition } from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; import { BoostBugSpawnModifier, IvScannerModifier, TurnHeldItemTransferModifier } from "#app/modifier/modifier"; import { ModifierPoolType, regenerateModifierPoolThresholds } from "#app/modifier/modifier-type"; diff --git a/src/phases/evolution-phase.ts b/src/phases/evolution-phase.ts index 076b7dec80d..203c7542eff 100644 --- a/src/phases/evolution-phase.ts +++ b/src/phases/evolution-phase.ts @@ -10,7 +10,7 @@ import { Mode } from "#app/ui/ui"; import { cos, sin } from "#app/field/anims"; import type { PlayerPokemon } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; -import { LearnMoveContext } from "#enums/learn-move-context"; +import { LearnMoveSituation } from "#app/field/pokemon"; import { getTypeRgb } from "#app/data/type"; import i18next from "i18next"; import { getPokemonNameWithAffix } from "#app/messages"; @@ -343,11 +343,11 @@ export class EvolutionPhase extends Phase { this.evolutionHandler.canCancel = false; this.pokemon.evolve(this.evolution, this.pokemon.species).then(() => { - const learnSituation: LearnMoveContext = this.fusionSpeciesEvolved - ? LearnMoveContext.EVOLUTION_FUSED + const learnSituation: LearnMoveSituation = this.fusionSpeciesEvolved + ? LearnMoveSituation.EVOLUTION_FUSED : this.pokemon.fusionSpecies - ? LearnMoveContext.EVOLUTION_FUSED_BASE - : LearnMoveContext.EVOLUTION; + ? LearnMoveSituation.EVOLUTION_FUSED_BASE + : LearnMoveSituation.EVOLUTION; const levelMoves = this.pokemon .getLevelMoves(this.lastLevel + 1, true, false, false, learnSituation) .filter(lm => lm[0] === EVOLVE_MOVE); diff --git a/src/phases/faint-phase.ts b/src/phases/faint-phase.ts index 4c418679047..7e1ae4ec07b 100644 --- a/src/phases/faint-phase.ts +++ b/src/phases/faint-phase.ts @@ -12,16 +12,13 @@ import { import type { DestinyBondTag, GrudgeTag } from "#app/data/battler-tags"; import { BattlerTagLapseType } from "#app/data/battler-tags"; import { battleSpecDialogue } from "#app/data/dialogue"; -import { PostVictoryStatStageChangeAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, PostVictoryStatStageChangeAttr } from "#app/data/moves/move"; import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms"; import { BattleSpec } from "#app/enums/battle-spec"; import { StatusEffect } from "#app/enums/status-effect"; import type { EnemyPokemon } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; -import { PlayerPokemon } from "#app/field/pokemon"; -import { HitResult } from "#enums/hit-result"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { HitResult, PlayerPokemon, PokemonMove } from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; import { PokemonInstantReviveModifier } from "#app/modifier/modifier"; import { SwitchType } from "#enums/switch-type"; diff --git a/src/phases/learn-move-phase.ts b/src/phases/learn-move-phase.ts index a939298f620..4107a9cf087 100644 --- a/src/phases/learn-move-phase.ts +++ b/src/phases/learn-move-phase.ts @@ -1,7 +1,7 @@ import { globalScene } from "#app/global-scene"; import { initMoveAnim, loadMoveAnimAssets } from "#app/data/battle-anims"; import type Move from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { SpeciesFormChangeMoveLearnedTrigger } from "#app/data/pokemon-forms"; import { Moves } from "#enums/moves"; import { getPokemonNameWithAffix } from "#app/messages"; diff --git a/src/phases/move-charge-phase.ts b/src/phases/move-charge-phase.ts index ccaf6d054b9..26ad85bbe03 100644 --- a/src/phases/move-charge-phase.ts +++ b/src/phases/move-charge-phase.ts @@ -2,7 +2,7 @@ import { globalScene } from "#app/global-scene"; import type { BattlerIndex } from "#app/battle"; import { MoveChargeAnim } from "#app/data/battle-anims"; import { applyMoveChargeAttrs, MoveEffectAttr, InstantChargeAttr } from "#app/data/moves/move"; -import type { PokemonMove } from "#app/data/moves/pokemon-move"; +import type { PokemonMove } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; import { MoveResult } from "#app/field/pokemon"; import { BooleanHolder } from "#app/utils"; diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index c13c411be68..acc7ac0f63a 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -49,10 +49,9 @@ import { MoveTarget } from "#enums/MoveTarget"; import { MoveCategory } from "#enums/MoveCategory"; import { SpeciesFormChangePostMoveTrigger } from "#app/data/pokemon-forms"; import { PokemonType } from "#enums/pokemon-type"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; -import { MoveResult } from "#app/field/pokemon"; -import { HitResult } from "#enums/hit-result"; +import { HitResult, MoveResult } from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; import { ContactHeldItemTransferChanceModifier, diff --git a/src/phases/move-header-phase.ts b/src/phases/move-header-phase.ts index c255b45190b..c320df462d1 100644 --- a/src/phases/move-header-phase.ts +++ b/src/phases/move-header-phase.ts @@ -1,5 +1,5 @@ import { applyMoveAttrs, MoveHeaderAttr } from "#app/data/moves/move"; -import type { PokemonMove } from "#app/data/moves/pokemon-move"; +import type { PokemonMove } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; import { BattlePhase } from "./battle-phase"; diff --git a/src/phases/move-phase.ts b/src/phases/move-phase.ts index 032ac6d06ab..478229dcae8 100644 --- a/src/phases/move-phase.ts +++ b/src/phases/move-phase.ts @@ -16,6 +16,7 @@ import { CommonAnim } from "#app/data/battle-anims"; import { BattlerTagLapseType, CenterOfAttentionTag } from "#app/data/battler-tags"; import { AddArenaTrapTagAttr, + allMoves, applyMoveAttrs, BypassRedirectAttr, BypassSleepAttr, @@ -26,14 +27,13 @@ import { PreMoveMessageAttr, PreUseInterruptAttr, } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; import { MoveFlags } from "#enums/MoveFlags"; import { SpeciesFormChangePreMoveTrigger } from "#app/data/pokemon-forms"; import { getStatusEffectActivationText, getStatusEffectHealText } from "#app/data/status-effect"; import { PokemonType } from "#enums/pokemon-type"; import { getTerrainBlockMessage, getWeatherBlockMessage } from "#app/data/weather"; import { MoveUsedEvent } from "#app/events/battle-scene"; -import type { PokemonMove } from "#app/data/moves/pokemon-move"; +import type { PokemonMove } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; import { MoveResult } from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; diff --git a/src/phases/pokemon-heal-phase.ts b/src/phases/pokemon-heal-phase.ts index 84dc8a5e116..651c625b23a 100644 --- a/src/phases/pokemon-heal-phase.ts +++ b/src/phases/pokemon-heal-phase.ts @@ -3,7 +3,7 @@ import type { BattlerIndex } from "#app/battle"; import { CommonAnim } from "#app/data/battle-anims"; import { getStatusEffectHealText } from "#app/data/status-effect"; import { StatusEffect } from "#app/enums/status-effect"; -import { HitResult } from "#enums/hit-result"; +import { HitResult } from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; import { HealingBoosterModifier } from "#app/modifier/modifier"; import { HealAchv } from "#app/system/achv"; diff --git a/src/phases/pokemon-transform-phase.ts b/src/phases/pokemon-transform-phase.ts index fb9a28a5a26..b33689321b5 100644 --- a/src/phases/pokemon-transform-phase.ts +++ b/src/phases/pokemon-transform-phase.ts @@ -2,7 +2,7 @@ import type { BattlerIndex } from "#app/battle"; import { BattlerTagType } from "#enums/battler-tag-type"; import { Moves } from "#enums/moves"; import { EFFECTIVE_STATS, BATTLE_STATS } from "#enums/stat"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { globalScene } from "#app/global-scene"; import { PokemonPhase } from "./pokemon-phase"; import { getPokemonNameWithAffix } from "#app/messages"; diff --git a/src/phases/select-target-phase.ts b/src/phases/select-target-phase.ts index edd56ba60ed..035eaff41fa 100644 --- a/src/phases/select-target-phase.ts +++ b/src/phases/select-target-phase.ts @@ -5,7 +5,7 @@ import { Mode } from "#app/ui/ui"; import { CommandPhase } from "./command-phase"; import { PokemonPhase } from "./pokemon-phase"; import i18next from "#app/plugins/i18n"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; export class SelectTargetPhase extends PokemonPhase { // biome-ignore lint/complexity/noUselessConstructor: This makes `fieldIndex` required diff --git a/src/phases/summon-phase.ts b/src/phases/summon-phase.ts index e053b18e4d7..7379d509e55 100644 --- a/src/phases/summon-phase.ts +++ b/src/phases/summon-phase.ts @@ -5,7 +5,7 @@ import { TrainerSlot } from "#enums/trainer-slot"; import { PlayerGender } from "#app/enums/player-gender"; import { addPokeballOpenParticles } from "#app/field/anims"; import type Pokemon from "#app/field/pokemon"; -import { FieldPosition } from "#enums/field-position"; +import { FieldPosition } from "#app/field/pokemon"; import { getPokemonNameWithAffix } from "#app/messages"; import i18next from "i18next"; import { PartyMemberPokemonPhase } from "./party-member-pokemon-phase"; diff --git a/src/phases/switch-summon-phase.ts b/src/phases/switch-summon-phase.ts index f39a3e62bb6..d63cdb90f25 100644 --- a/src/phases/switch-summon-phase.ts +++ b/src/phases/switch-summon-phase.ts @@ -6,8 +6,7 @@ import { PreSummonAbAttr, PreSwitchOutAbAttr, } from "#app/data/ability"; -import { ForceSwitchOutAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, ForceSwitchOutAttr } from "#app/data/moves/move"; import { getPokeballTintColor } from "#app/data/pokeball"; import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms"; import { TrainerSlot } from "#enums/trainer-slot"; diff --git a/src/phases/toggle-double-position-phase.ts b/src/phases/toggle-double-position-phase.ts index c4766f888aa..37f47d5cf95 100644 --- a/src/phases/toggle-double-position-phase.ts +++ b/src/phases/toggle-double-position-phase.ts @@ -1,5 +1,5 @@ import { globalScene } from "#app/global-scene"; -import { FieldPosition } from "#enums/field-position"; +import { FieldPosition } from "#app/field/pokemon"; import { BattlePhase } from "./battle-phase"; export class ToggleDoublePositionPhase extends BattlePhase { diff --git a/src/phases/turn-start-phase.ts b/src/phases/turn-start-phase.ts index 5941e0af163..d5b4160fe1b 100644 --- a/src/phases/turn-start-phase.ts +++ b/src/phases/turn-start-phase.ts @@ -1,10 +1,9 @@ import { applyAbAttrs, BypassSpeedChanceAbAttr, PreventBypassSpeedChanceAbAttr } from "#app/data/ability"; -import { MoveHeaderAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, MoveHeaderAttr } from "#app/data/moves/move"; import { Abilities } from "#app/enums/abilities"; import { Stat } from "#app/enums/stat"; import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { BypassSpeedChanceModifier } from "#app/modifier/modifier"; import { Command } from "#app/ui/command-ui-handler"; import { randSeedShuffle, BooleanHolder } from "#app/utils"; diff --git a/src/phases/weather-effect-phase.ts b/src/phases/weather-effect-phase.ts index 256894457fc..5284c9fba85 100644 --- a/src/phases/weather-effect-phase.ts +++ b/src/phases/weather-effect-phase.ts @@ -14,7 +14,7 @@ import { getWeatherDamageMessage, getWeatherLapseMessage } from "#app/data/weath import { BattlerTagType } from "#app/enums/battler-tag-type"; import { WeatherType } from "#app/enums/weather-type"; import type Pokemon from "#app/field/pokemon"; -import { HitResult } from "#enums/hit-result"; +import { HitResult } from "#app/field/pokemon"; import { BooleanHolder, toDmgValue } from "#app/utils"; import { CommonAnimPhase } from "./common-anim-phase"; diff --git a/src/system/game-data.ts b/src/system/game-data.ts index e87c735f459..53146301666 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -30,7 +30,7 @@ import { Nature } from "#enums/nature"; import { GameStats } from "#app/system/game-stats"; import { Tutorial } from "#app/tutorial"; import { speciesEggMoves } from "#app/data/balance/egg-moves"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { TrainerVariant } from "#app/field/trainer"; import type { Variant } from "#app/sprites/variant"; import { setSettingGamepad, SettingGamepad, settingGamepadDefaults } from "#app/system/settings/settings-gamepad"; diff --git a/src/system/pokemon-data.ts b/src/system/pokemon-data.ts index 7579fc3b78d..97ce494a43a 100644 --- a/src/system/pokemon-data.ts +++ b/src/system/pokemon-data.ts @@ -5,8 +5,7 @@ import type { Nature } from "#enums/nature"; import type { PokeballType } from "#enums/pokeball"; import { getPokemonSpecies, getPokemonSpeciesForm } from "../data/pokemon-species"; import { Status } from "../data/status-effect"; -import Pokemon, { EnemyPokemon, PokemonSummonData } from "../field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import Pokemon, { EnemyPokemon, PokemonMove, PokemonSummonData } from "../field/pokemon"; import { TrainerSlot } from "#enums/trainer-slot"; import type { Variant } from "#app/sprites/variant"; import { loadBattlerTag } from "../data/battler-tags"; diff --git a/src/ui/fight-ui-handler.ts b/src/ui/fight-ui-handler.ts index 63c0703fa18..27985629e3d 100644 --- a/src/ui/fight-ui-handler.ts +++ b/src/ui/fight-ui-handler.ts @@ -10,7 +10,7 @@ import { getLocalizedSpriteKey, fixedInt, padInt } from "#app/utils"; import { MoveCategory } from "#enums/MoveCategory"; import i18next from "i18next"; import { Button } from "#enums/buttons"; -import type { PokemonMove } from "#app/data/moves/pokemon-move"; +import type { PokemonMove } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; import type { CommandPhase } from "#app/phases/command-phase"; import MoveInfoOverlay from "./move-info-overlay"; diff --git a/src/ui/modifier-select-ui-handler.ts b/src/ui/modifier-select-ui-handler.ts index f0ff351bb8a..26351d4dbf1 100644 --- a/src/ui/modifier-select-ui-handler.ts +++ b/src/ui/modifier-select-ui-handler.ts @@ -9,7 +9,7 @@ import { LockModifierTiersModifier, PokemonHeldItemModifier, HealShopCostModifie import { handleTutorial, Tutorial } from "../tutorial"; import { Button } from "#enums/buttons"; import MoveInfoOverlay from "./move-info-overlay"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "../data/moves/move"; import { formatMoney, NumberHolder } from "#app/utils"; import Overrides from "#app/overrides"; import i18next from "i18next"; diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index a42e0caadae..ba90108c274 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -1,5 +1,4 @@ -import type { PlayerPokemon } from "#app/field/pokemon"; -import type { PokemonMove } from "#app/data/moves/pokemon-move"; +import type { PlayerPokemon, PokemonMove } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; import { MoveResult } from "#app/field/pokemon"; import { addBBCodeTextObject, addTextObject, getTextColor, TextStyle } from "#app/ui/text"; @@ -12,8 +11,7 @@ import { PokemonHeldItemModifier, SwitchEffectTransferModifier, } from "#app/modifier/modifier"; -import { ForceSwitchOutAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, ForceSwitchOutAttr } from "#app/data/moves/move"; import { Gender, getGenderColor, getGenderSymbol } from "#app/data/gender"; import { StatusEffect } from "#enums/status-effect"; import PokemonIconAnimHandler, { PokemonIconAnimMode } from "#app/ui/pokemon-icon-anim-handler"; diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index 1011fc89ae0..407ebfcd843 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -9,7 +9,7 @@ import { allAbilities } from "#app/data/ability"; import { speciesEggMoves } from "#app/data/balance/egg-moves"; import { GrowthRate, getGrowthRateColor } from "#app/data/exp"; import { Gender, getGenderColor, getGenderSymbol } from "#app/data/gender"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { getNatureName } from "#app/data/nature"; import type { SpeciesFormChange } from "#app/data/pokemon-forms"; import { pokemonFormChanges } from "#app/data/pokemon-forms"; diff --git a/src/ui/pokedex-scan-ui-handler.ts b/src/ui/pokedex-scan-ui-handler.ts index 54c32fb34a1..b34246b97d1 100644 --- a/src/ui/pokedex-scan-ui-handler.ts +++ b/src/ui/pokedex-scan-ui-handler.ts @@ -7,7 +7,7 @@ import { isNullOrUndefined } from "#app/utils"; import { Mode } from "./ui"; import { FilterTextRow } from "./filter-text"; import { allAbilities } from "#app/data/ability"; -import { allMoves } from "#app/data/moves/all-moves"; +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 22ce5b833af..59b06d476a2 100644 --- a/src/ui/pokedex-ui-handler.ts +++ b/src/ui/pokedex-ui-handler.ts @@ -38,7 +38,7 @@ import type { OptionSelectConfig } from "./abstact-option-select-ui-handler"; import { FilterText, FilterTextRow } from "./filter-text"; import { allAbilities } from "#app/data/ability"; import { starterPassiveAbilities } from "#app/data/balance/passives"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { speciesTmMoves } from "#app/data/balance/tms"; import { pokemonPrevolutions, pokemonStarters } from "#app/data/balance/pokemon-evolutions"; import { Biome } from "#enums/biome"; diff --git a/src/ui/pokemon-hatch-info-container.ts b/src/ui/pokemon-hatch-info-container.ts index 77f9f5090a0..692f0f1d374 100644 --- a/src/ui/pokemon-hatch-info-container.ts +++ b/src/ui/pokemon-hatch-info-container.ts @@ -4,7 +4,7 @@ import { PokemonType } from "#enums/pokemon-type"; import { rgbHexToRgba, padInt } from "#app/utils"; import { TextStyle, addTextObject } from "#app/ui/text"; import { speciesEggMoves } from "#app/data/balance/egg-moves"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Species } from "#enums/species"; import { getEggTierForSpecies } from "#app/data/egg"; import { starterColors } from "#app/battle-scene"; diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 680f752096b..3e2940f45b9 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -13,7 +13,7 @@ import { allAbilities } from "#app/data/ability"; import { speciesEggMoves } from "#app/data/balance/egg-moves"; import { GrowthRate, getGrowthRateColor } from "#app/data/exp"; import { Gender, getGenderColor, getGenderSymbol } from "#app/data/gender"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { getNatureName } from "#app/data/nature"; import { pokemonFormChanges } from "#app/data/pokemon-forms"; import type { LevelMoves } from "#app/data/balance/pokemon-level-moves"; diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index d82082f0872..04bcf71d7ae 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -12,8 +12,7 @@ import { toReadableString, formatStat, } from "#app/utils"; -import type { PlayerPokemon } from "#app/field/pokemon"; -import type { PokemonMove } from "#app/data/moves/pokemon-move"; +import type { PlayerPokemon, PokemonMove } from "#app/field/pokemon"; import { getStarterValueFriendshipCap, speciesStarterCosts } from "#app/data/balance/starters"; import { argbFromRgba } from "@material/material-color-utilities"; import { getTypeRgb } from "#app/data/type"; diff --git a/test/abilities/aura_break.test.ts b/test/abilities/aura_break.test.ts index 30841fdbe0c..86b6c69ec8b 100644 --- a/test/abilities/aura_break.test.ts +++ b/test/abilities/aura_break.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/test/abilities/battery.test.ts b/test/abilities/battery.test.ts index 78db19e67ff..cc7570c3d31 100644 --- a/test/abilities/battery.test.ts +++ b/test/abilities/battery.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#app/enums/abilities"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; diff --git a/test/abilities/battle_bond.test.ts b/test/abilities/battle_bond.test.ts index e615b5746c0..6305d7dedc5 100644 --- a/test/abilities/battle_bond.test.ts +++ b/test/abilities/battle_bond.test.ts @@ -1,5 +1,4 @@ -import { MultiHitAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, MultiHitAttr } from "#app/data/moves/move"; import { MultiHitType } from "#enums/MultiHitType"; import { Status } from "#app/data/status-effect"; import { Abilities } from "#enums/abilities"; diff --git a/test/abilities/flower_veil.test.ts b/test/abilities/flower_veil.test.ts index d91c92e8c9f..c26a952acff 100644 --- a/test/abilities/flower_veil.test.ts +++ b/test/abilities/flower_veil.test.ts @@ -7,7 +7,7 @@ import { StatusEffect } from "#enums/status-effect"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { BattlerTagType } from "#enums/battler-tag-type"; import { allAbilities } from "#app/data/ability"; diff --git a/test/abilities/friend_guard.test.ts b/test/abilities/friend_guard.test.ts index cee82ca2c69..30175fe37e0 100644 --- a/test/abilities/friend_guard.test.ts +++ b/test/abilities/friend_guard.test.ts @@ -6,7 +6,7 @@ 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 { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { MoveCategory } from "#enums/MoveCategory"; describe("Moves - Friend Guard", () => { diff --git a/test/abilities/galvanize.test.ts b/test/abilities/galvanize.test.ts index 4efb6bb068f..c1e02c6c8d8 100644 --- a/test/abilities/galvanize.test.ts +++ b/test/abilities/galvanize.test.ts @@ -1,10 +1,10 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { PokemonType } from "#enums/pokemon-type"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; -import { HitResult } from "#enums/hit-result"; +import { HitResult } from "#app/field/pokemon"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/hustle.test.ts b/test/abilities/hustle.test.ts index fbfa23e90d6..40197cf9e97 100644 --- a/test/abilities/hustle.test.ts +++ b/test/abilities/hustle.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#app/enums/abilities"; import { Stat } from "#app/enums/stat"; import { Moves } from "#enums/moves"; diff --git a/test/abilities/infiltrator.test.ts b/test/abilities/infiltrator.test.ts index e9ecf366a37..6278439651c 100644 --- a/test/abilities/infiltrator.test.ts +++ b/test/abilities/infiltrator.test.ts @@ -1,5 +1,5 @@ import { ArenaTagSide } from "#app/data/arena-tag"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { ArenaTagType } from "#enums/arena-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type"; import { Stat } from "#enums/stat"; diff --git a/test/abilities/libero.test.ts b/test/abilities/libero.test.ts index 96a6b3c5d93..22abf1c248f 100644 --- a/test/abilities/libero.test.ts +++ b/test/abilities/libero.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { PokemonType } from "#enums/pokemon-type"; import { Weather } from "#app/data/weather"; import type { PlayerPokemon } from "#app/field/pokemon"; diff --git a/test/abilities/magic_bounce.test.ts b/test/abilities/magic_bounce.test.ts index c785827c910..f9a076776aa 100644 --- a/test/abilities/magic_bounce.test.ts +++ b/test/abilities/magic_bounce.test.ts @@ -1,7 +1,7 @@ import { BattlerIndex } from "#app/battle"; import { allAbilities } from "#app/data/ability"; import { ArenaTagSide } from "#app/data/arena-tag"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { ArenaTagType } from "#app/enums/arena-tag-type"; import { BattlerTagType } from "#app/enums/battler-tag-type"; import { Stat } from "#app/enums/stat"; diff --git a/test/abilities/power_spot.test.ts b/test/abilities/power_spot.test.ts index 68ace696d4a..e29b5ecf775 100644 --- a/test/abilities/power_spot.test.ts +++ b/test/abilities/power_spot.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#app/enums/abilities"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; diff --git a/test/abilities/protean.test.ts b/test/abilities/protean.test.ts index ca5e67139e1..574033bb13f 100644 --- a/test/abilities/protean.test.ts +++ b/test/abilities/protean.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { PokemonType } from "#enums/pokemon-type"; import { Weather } from "#app/data/weather"; import type { PlayerPokemon } from "#app/field/pokemon"; diff --git a/test/abilities/sap_sipper.test.ts b/test/abilities/sap_sipper.test.ts index b27f97099b9..f4f02844cbc 100644 --- a/test/abilities/sap_sipper.test.ts +++ b/test/abilities/sap_sipper.test.ts @@ -9,8 +9,7 @@ import { Species } from "#enums/species"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { RandomMoveAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, RandomMoveAttr } from "#app/data/moves/move"; // See also: TypeImmunityAbAttr describe("Abilities - Sap Sipper", () => { diff --git a/test/abilities/serene_grace.test.ts b/test/abilities/serene_grace.test.ts index 30073f30b24..65ca96acbbc 100644 --- a/test/abilities/serene_grace.test.ts +++ b/test/abilities/serene_grace.test.ts @@ -4,7 +4,7 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { FlinchAttr } from "#app/data/moves/move"; diff --git a/test/abilities/sheer_force.test.ts b/test/abilities/sheer_force.test.ts index 74c7b30a846..4a1c20cde5c 100644 --- a/test/abilities/sheer_force.test.ts +++ b/test/abilities/sheer_force.test.ts @@ -7,8 +7,7 @@ import { Stat } from "#enums/stat"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { FlinchAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, FlinchAttr } from "#app/data/moves/move"; describe("Abilities - Sheer Force", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/steely_spirit.test.ts b/test/abilities/steely_spirit.test.ts index 6e8331ea51a..b180ff8919e 100644 --- a/test/abilities/steely_spirit.test.ts +++ b/test/abilities/steely_spirit.test.ts @@ -1,5 +1,5 @@ import { allAbilities } from "#app/data/ability"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/test/abilities/supreme_overlord.test.ts b/test/abilities/supreme_overlord.test.ts index 69ff4f393b6..a71bf0a9354 100644 --- a/test/abilities/supreme_overlord.test.ts +++ b/test/abilities/supreme_overlord.test.ts @@ -7,7 +7,7 @@ import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; describe("Abilities - Supreme Overlord", () => { let phaserGame: Phaser.Game; diff --git a/test/abilities/tera_shell.test.ts b/test/abilities/tera_shell.test.ts index bd88c21f52d..a99ecfd4ce1 100644 --- a/test/abilities/tera_shell.test.ts +++ b/test/abilities/tera_shell.test.ts @@ -2,7 +2,7 @@ import { BattlerIndex } from "#app/battle"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; -import { HitResult } from "#enums/hit-result"; +import { HitResult } from "#app/field/pokemon"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/test/abilities/unburden.test.ts b/test/abilities/unburden.test.ts index 7012c4cf065..8f18604011c 100644 --- a/test/abilities/unburden.test.ts +++ b/test/abilities/unburden.test.ts @@ -1,7 +1,6 @@ import { BattlerIndex } from "#app/battle"; import { PostItemLostAbAttr } from "#app/data/ability"; -import { StealHeldItemChanceAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, StealHeldItemChanceAttr } from "#app/data/moves/move"; import type Pokemon from "#app/field/pokemon"; import type { ContactHeldItemTransferChanceModifier } from "#app/modifier/modifier"; import { Abilities } from "#enums/abilities"; diff --git a/test/abilities/wimp_out.test.ts b/test/abilities/wimp_out.test.ts index c81fa2071c5..294025a10e7 100644 --- a/test/abilities/wimp_out.test.ts +++ b/test/abilities/wimp_out.test.ts @@ -1,6 +1,6 @@ import { BattlerIndex } from "#app/battle"; import { ArenaTagSide } from "#app/data/arena-tag"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import GameManager from "#test/testUtils/gameManager"; import { toDmgValue } from "#app/utils"; import { Abilities } from "#enums/abilities"; @@ -534,12 +534,12 @@ describe("Abilities - Wimp Out", () => { .enemyAbility(Abilities.WIMP_OUT) .startingLevel(50) .enemyLevel(1) - .enemyMoveset([Moves.SPLASH, Moves.ENDURE]) + .enemyMoveset([ Moves.SPLASH, Moves.ENDURE ]) .battleType("double") - .moveset([Moves.DRAGON_ENERGY, Moves.SPLASH]) + .moveset([ Moves.DRAGON_ENERGY, Moves.SPLASH ]) .startingWave(wave); - await game.classicMode.startBattle([Species.REGIDRAGO, Species.MAGIKARP]); + await game.classicMode.startBattle([ Species.REGIDRAGO, Species.MAGIKARP ]); // turn 1 game.move.select(Moves.DRAGON_ENERGY, 0); @@ -549,5 +549,6 @@ describe("Abilities - Wimp Out", () => { await game.phaseInterceptor.to("SelectModifierPhase"); expect(game.scene.currentBattle.waveIndex).toBe(wave + 1); + }); }); diff --git a/test/abilities/wonder_skin.test.ts b/test/abilities/wonder_skin.test.ts index fe24cdad5ec..18d5be36aef 100644 --- a/test/abilities/wonder_skin.test.ts +++ b/test/abilities/wonder_skin.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; diff --git a/test/arena/arena_gravity.test.ts b/test/arena/arena_gravity.test.ts index 7e72d14460a..a5ce84667f0 100644 --- a/test/arena/arena_gravity.test.ts +++ b/test/arena/arena_gravity.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#enums/abilities"; import { ArenaTagType } from "#enums/arena-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type"; diff --git a/test/arena/grassy_terrain.test.ts b/test/arena/grassy_terrain.test.ts index 9ee9d2ef434..d92fb24be5a 100644 --- a/test/arena/grassy_terrain.test.ts +++ b/test/arena/grassy_terrain.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/test/arena/weather_fog.test.ts b/test/arena/weather_fog.test.ts index b240bfa7386..784c4886648 100644 --- a/test/arena/weather_fog.test.ts +++ b/test/arena/weather_fog.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#app/enums/abilities"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { Moves } from "#enums/moves"; diff --git a/test/arena/weather_strong_winds.test.ts b/test/arena/weather_strong_winds.test.ts index 50d25947612..3a9235d9eb9 100644 --- a/test/arena/weather_strong_winds.test.ts +++ b/test/arena/weather_strong_winds.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { StatusEffect } from "#app/enums/status-effect"; import { TurnStartPhase } from "#app/phases/turn-start-phase"; import { Abilities } from "#enums/abilities"; diff --git a/test/battle/damage_calculation.test.ts b/test/battle/damage_calculation.test.ts index 11bb8246ca1..dab1fc81caa 100644 --- a/test/battle/damage_calculation.test.ts +++ b/test/battle/damage_calculation.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import type { EnemyPersistentModifier } from "#app/modifier/modifier"; import { modifierTypes } from "#app/modifier/modifier-type"; import { Abilities } from "#enums/abilities"; diff --git a/test/battlerTags/substitute.test.ts b/test/battlerTags/substitute.test.ts index f2ee741bca2..fca3dc5ef7e 100644 --- a/test/battlerTags/substitute.test.ts +++ b/test/battlerTags/substitute.test.ts @@ -1,7 +1,5 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import type { PokemonTurnData } from "#app/field/pokemon"; -import type { PokemonMove } from "#app/data/moves/pokemon-move"; -import type { TurnMove } from "#app/interfaces/turn-move"; +import type { PokemonTurnData, TurnMove, PokemonMove } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; import { MoveResult } from "#app/field/pokemon"; import type BattleScene from "#app/battle-scene"; @@ -9,7 +7,7 @@ import { BattlerTagLapseType, BindTag, SubstituteTag } from "#app/data/battler-t import { Moves } from "#app/enums/moves"; import { PokemonAnimType } from "#app/enums/pokemon-anim-type"; import * as messages from "#app/messages"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import type { MoveEffectPhase } from "#app/phases/move-effect-phase"; import GameManager from "#test/testUtils/gameManager"; diff --git a/test/enemy_command.test.ts b/test/enemy_command.test.ts index cfa141cf89e..6d5cc2698a3 100644 --- a/test/enemy_command.test.ts +++ b/test/enemy_command.test.ts @@ -1,11 +1,11 @@ import type BattleScene from "#app/battle-scene"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { MoveCategory } from "#enums/MoveCategory"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; import type { EnemyPokemon } from "#app/field/pokemon"; -import { AiType } from "#enums/ai-type"; +import { AiType } from "#app/field/pokemon"; import { randSeedInt } from "#app/utils"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; diff --git a/test/evolution.test.ts b/test/evolution.test.ts index 62a06f868e8..dd6795bf161 100644 --- a/test/evolution.test.ts +++ b/test/evolution.test.ts @@ -1,5 +1,8 @@ -import { pokemonEvolutions, SpeciesFormEvolution } from "#app/data/balance/pokemon-evolutions"; -import { SpeciesWildEvolutionDelay } from "#enums/species-wild-evolution-delay"; +import { + pokemonEvolutions, + SpeciesFormEvolution, + SpeciesWildEvolutionDelay, +} from "#app/data/balance/pokemon-evolutions"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; diff --git a/test/imports.test.ts b/test/imports.test.ts index ada7eff0109..128308dbd14 100644 --- a/test/imports.test.ts +++ b/test/imports.test.ts @@ -4,7 +4,7 @@ import { describe, expect, it } from "vitest"; async function importModule() { try { initStatsKeys(); - const { PokemonMove } = await import("#app/data/moves/pokemon-move"); + const { PokemonMove } = await import("#app/field/pokemon"); const { Species } = await import("#enums/species"); return { PokemonMove, diff --git a/test/items/reviver_seed.test.ts b/test/items/reviver_seed.test.ts index e1e7e0d554e..c06f354a94a 100644 --- a/test/items/reviver_seed.test.ts +++ b/test/items/reviver_seed.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { BattlerTagType } from "#app/enums/battler-tag-type"; import type { PokemonInstantReviveModifier } from "#app/modifier/modifier"; import { Abilities } from "#enums/abilities"; diff --git a/test/moves/astonish.test.ts b/test/moves/astonish.test.ts index 69a312d4517..53922060ae6 100644 --- a/test/moves/astonish.test.ts +++ b/test/moves/astonish.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { BattlerTagType } from "#app/enums/battler-tag-type"; import { BerryPhase } from "#app/phases/berry-phase"; import { CommandPhase } from "#app/phases/command-phase"; diff --git a/test/moves/aurora_veil.test.ts b/test/moves/aurora_veil.test.ts index 06637d0764e..31f6497bae5 100644 --- a/test/moves/aurora_veil.test.ts +++ b/test/moves/aurora_veil.test.ts @@ -1,8 +1,7 @@ import type BattleScene from "#app/battle-scene"; import { ArenaTagSide } from "#app/data/arena-tag"; import type Move from "#app/data/moves/move"; -import { CritOnlyAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, CritOnlyAttr } from "#app/data/moves/move"; import { ArenaTagType } from "#app/enums/arena-tag-type"; import type Pokemon from "#app/field/pokemon"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; diff --git a/test/moves/burning_jealousy.test.ts b/test/moves/burning_jealousy.test.ts index c618b46e842..60387df4226 100644 --- a/test/moves/burning_jealousy.test.ts +++ b/test/moves/burning_jealousy.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#app/enums/abilities"; import { StatusEffect } from "#app/enums/status-effect"; import { Moves } from "#enums/moves"; diff --git a/test/moves/ceaseless_edge.test.ts b/test/moves/ceaseless_edge.test.ts index 227645df360..d54f1bd9f21 100644 --- a/test/moves/ceaseless_edge.test.ts +++ b/test/moves/ceaseless_edge.test.ts @@ -1,5 +1,5 @@ import { ArenaTagSide, ArenaTrapTag } from "#app/data/arena-tag"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#app/enums/abilities"; import { ArenaTagType } from "#app/enums/arena-tag-type"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; diff --git a/test/moves/copycat.test.ts b/test/moves/copycat.test.ts index 615206275d4..0d9b0951f89 100644 --- a/test/moves/copycat.test.ts +++ b/test/moves/copycat.test.ts @@ -1,6 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { RandomMoveAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, RandomMoveAttr } from "#app/data/moves/move"; import { Stat } from "#app/enums/stat"; import { MoveResult } from "#app/field/pokemon"; import { Abilities } from "#enums/abilities"; diff --git a/test/moves/destiny_bond.test.ts b/test/moves/destiny_bond.test.ts index 9873d678b8c..c39d40427ad 100644 --- a/test/moves/destiny_bond.test.ts +++ b/test/moves/destiny_bond.test.ts @@ -1,6 +1,6 @@ import type { ArenaTrapTag } from "#app/data/arena-tag"; import { ArenaTagSide } from "#app/data/arena-tag"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#enums/abilities"; import { ArenaTagType } from "#enums/arena-tag-type"; import { Moves } from "#enums/moves"; diff --git a/test/moves/diamond_storm.test.ts b/test/moves/diamond_storm.test.ts index 73a1aee3fd2..2363122f0d7 100644 --- a/test/moves/diamond_storm.test.ts +++ b/test/moves/diamond_storm.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/test/moves/dig.test.ts b/test/moves/dig.test.ts index 14e7efee19b..81339111656 100644 --- a/test/moves/dig.test.ts +++ b/test/moves/dig.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#enums/abilities"; import { BattlerTagType } from "#enums/battler-tag-type"; import { Moves } from "#enums/moves"; diff --git a/test/moves/dragon_tail.test.ts b/test/moves/dragon_tail.test.ts index a571312473d..37e8aa2fe1b 100644 --- a/test/moves/dragon_tail.test.ts +++ b/test/moves/dragon_tail.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Status } from "#app/data/status-effect"; import { Challenges } from "#enums/challenges"; import { StatusEffect } from "#enums/status-effect"; diff --git a/test/moves/dynamax_cannon.test.ts b/test/moves/dynamax_cannon.test.ts index b2590449e4e..9cf3106b9c1 100644 --- a/test/moves/dynamax_cannon.test.ts +++ b/test/moves/dynamax_cannon.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { Moves } from "#enums/moves"; diff --git a/test/moves/effectiveness.test.ts b/test/moves/effectiveness.test.ts index efcbc9c3293..fb03f1c10a0 100644 --- a/test/moves/effectiveness.test.ts +++ b/test/moves/effectiveness.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { getPokemonSpecies } from "#app/data/pokemon-species"; import { TrainerSlot } from "#enums/trainer-slot"; import { PokemonType } from "#enums/pokemon-type"; diff --git a/test/moves/fell_stinger.test.ts b/test/moves/fell_stinger.test.ts index 766fedf68dc..2ffa44c5a3a 100644 --- a/test/moves/fell_stinger.test.ts +++ b/test/moves/fell_stinger.test.ts @@ -7,7 +7,7 @@ import { Moves } from "#enums/moves"; import { Stat } from "#enums/stat"; import { StatusEffect } from "#app/enums/status-effect"; import { WeatherType } from "#app/enums/weather-type"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; describe("Moves - Fell Stinger", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/fly.test.ts b/test/moves/fly.test.ts index 37fa42b608d..0bd7d22b2a7 100644 --- a/test/moves/fly.test.ts +++ b/test/moves/fly.test.ts @@ -8,7 +8,7 @@ import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest"; import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; describe("Moves - Fly", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/freezy_frost.test.ts b/test/moves/freezy_frost.test.ts index d764600bc78..c1ac4054e70 100644 --- a/test/moves/freezy_frost.test.ts +++ b/test/moves/freezy_frost.test.ts @@ -5,7 +5,7 @@ import { Species } from "#enums/species"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { CommandPhase } from "#app/phases/command-phase"; describe("Moves - Freezy Frost", () => { diff --git a/test/moves/fusion_flare_bolt.test.ts b/test/moves/fusion_flare_bolt.test.ts index 32df10b4c7c..c340aeea63f 100644 --- a/test/moves/fusion_flare_bolt.test.ts +++ b/test/moves/fusion_flare_bolt.test.ts @@ -1,6 +1,6 @@ import { Stat } from "#enums/stat"; import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import type Move from "#app/data/moves/move"; import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; diff --git a/test/moves/glaive_rush.test.ts b/test/moves/glaive_rush.test.ts index 28d6328c095..d3531b172e2 100644 --- a/test/moves/glaive_rush.test.ts +++ b/test/moves/glaive_rush.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; diff --git a/test/moves/hard_press.test.ts b/test/moves/hard_press.test.ts index 425993fb1a9..8891f0bf0e2 100644 --- a/test/moves/hard_press.test.ts +++ b/test/moves/hard_press.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; diff --git a/test/moves/hyper_beam.test.ts b/test/moves/hyper_beam.test.ts index b1a244f2ea4..5cd54e9b46a 100644 --- a/test/moves/hyper_beam.test.ts +++ b/test/moves/hyper_beam.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#app/enums/abilities"; import { BattlerTagType } from "#app/enums/battler-tag-type"; import { Moves } from "#app/enums/moves"; diff --git a/test/moves/lash_out.test.ts b/test/moves/lash_out.test.ts index 16632ec0065..8395633f5c0 100644 --- a/test/moves/lash_out.test.ts +++ b/test/moves/lash_out.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#app/enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/test/moves/last_respects.test.ts b/test/moves/last_respects.test.ts index 891b287dece..ccab8a43415 100644 --- a/test/moves/last_respects.test.ts +++ b/test/moves/last_respects.test.ts @@ -3,7 +3,7 @@ import { BattlerIndex } from "#app/battle"; import { Species } from "#enums/species"; import { Abilities } from "#enums/abilities"; import GameManager from "#test/testUtils/gameManager"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import type Move from "#app/data/moves/move"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import Phaser from "phaser"; diff --git a/test/moves/light_screen.test.ts b/test/moves/light_screen.test.ts index b77bb1c790b..9cc6944ed3e 100644 --- a/test/moves/light_screen.test.ts +++ b/test/moves/light_screen.test.ts @@ -1,8 +1,7 @@ import type BattleScene from "#app/battle-scene"; import { ArenaTagSide } from "#app/data/arena-tag"; import type Move from "#app/data/moves/move"; -import { CritOnlyAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, CritOnlyAttr } from "#app/data/moves/move"; import { Abilities } from "#app/enums/abilities"; import { ArenaTagType } from "#app/enums/arena-tag-type"; import type Pokemon from "#app/field/pokemon"; diff --git a/test/moves/magic_coat.test.ts b/test/moves/magic_coat.test.ts index e96125a23ac..2cc8dea8938 100644 --- a/test/moves/magic_coat.test.ts +++ b/test/moves/magic_coat.test.ts @@ -1,6 +1,6 @@ import { BattlerIndex } from "#app/battle"; import { ArenaTagSide } from "#app/data/arena-tag"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { ArenaTagType } from "#app/enums/arena-tag-type"; import { BattlerTagType } from "#app/enums/battler-tag-type"; import { Stat } from "#app/enums/stat"; diff --git a/test/moves/metronome.test.ts b/test/moves/metronome.test.ts index bf045f5e9f9..80f32a3a6fb 100644 --- a/test/moves/metronome.test.ts +++ b/test/moves/metronome.test.ts @@ -1,6 +1,5 @@ import { RechargingTag, SemiInvulnerableTag } from "#app/data/battler-tags"; -import { RandomMoveAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, RandomMoveAttr } from "#app/data/moves/move"; import { Abilities } from "#app/enums/abilities"; import { Stat } from "#app/enums/stat"; import { CommandPhase } from "#app/phases/command-phase"; diff --git a/test/moves/moongeist_beam.test.ts b/test/moves/moongeist_beam.test.ts index 94197683ea4..117fe513e17 100644 --- a/test/moves/moongeist_beam.test.ts +++ b/test/moves/moongeist_beam.test.ts @@ -1,5 +1,4 @@ -import { RandomMoveAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, RandomMoveAttr } from "#app/data/moves/move"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/test/moves/pledge_moves.test.ts b/test/moves/pledge_moves.test.ts index d3b8e60ac62..c866d15357c 100644 --- a/test/moves/pledge_moves.test.ts +++ b/test/moves/pledge_moves.test.ts @@ -1,8 +1,7 @@ import { BattlerIndex } from "#app/battle"; import { allAbilities } from "#app/data/ability"; import { ArenaTagSide } from "#app/data/arena-tag"; -import { FlinchAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, FlinchAttr } from "#app/data/moves/move"; import { PokemonType } from "#enums/pokemon-type"; import { ArenaTagType } from "#enums/arena-tag-type"; import { Stat } from "#enums/stat"; diff --git a/test/moves/powder.test.ts b/test/moves/powder.test.ts index 510564e0f53..522b0b74ca7 100644 --- a/test/moves/powder.test.ts +++ b/test/moves/powder.test.ts @@ -5,8 +5,7 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import { BerryPhase } from "#app/phases/berry-phase"; -import { MoveResult } from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { MoveResult, PokemonMove } from "#app/field/pokemon"; import { PokemonType } from "#enums/pokemon-type"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { StatusEffect } from "#enums/status-effect"; diff --git a/test/moves/protect.test.ts b/test/moves/protect.test.ts index 65de079982f..d50c490f7d3 100644 --- a/test/moves/protect.test.ts +++ b/test/moves/protect.test.ts @@ -5,7 +5,7 @@ import { Species } from "#enums/species"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Stat } from "#enums/stat"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { ArenaTagSide, ArenaTrapTag } from "#app/data/arena-tag"; import { BattlerIndex } from "#app/battle"; import { MoveResult } from "#app/field/pokemon"; diff --git a/test/moves/rage_fist.test.ts b/test/moves/rage_fist.test.ts index 73d83f4929c..f44901c5aba 100644 --- a/test/moves/rage_fist.test.ts +++ b/test/moves/rage_fist.test.ts @@ -2,7 +2,7 @@ import { BattlerIndex } from "#app/battle"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import type Move from "#app/data/moves/move"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; diff --git a/test/moves/reflect.test.ts b/test/moves/reflect.test.ts index 272e5c2972c..ac879a7cc2b 100644 --- a/test/moves/reflect.test.ts +++ b/test/moves/reflect.test.ts @@ -1,8 +1,7 @@ import type BattleScene from "#app/battle-scene"; import { ArenaTagSide } from "#app/data/arena-tag"; import type Move from "#app/data/moves/move"; -import { CritOnlyAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, CritOnlyAttr } from "#app/data/moves/move"; import { Abilities } from "#app/enums/abilities"; import { ArenaTagType } from "#app/enums/arena-tag-type"; import type Pokemon from "#app/field/pokemon"; diff --git a/test/moves/retaliate.test.ts b/test/moves/retaliate.test.ts index 57d29b4fdfc..e916c9ffeaa 100644 --- a/test/moves/retaliate.test.ts +++ b/test/moves/retaliate.test.ts @@ -3,7 +3,7 @@ import Phaser from "phaser"; import GameManager from "#test/testUtils/gameManager"; import { Species } from "#enums/species"; import { Moves } from "#enums/moves"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import type Move from "#app/data/moves/move"; describe("Moves - Retaliate", () => { diff --git a/test/moves/rollout.test.ts b/test/moves/rollout.test.ts index 456f029cda1..89270c2dfc7 100644 --- a/test/moves/rollout.test.ts +++ b/test/moves/rollout.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { CommandPhase } from "#app/phases/command-phase"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; diff --git a/test/moves/round.test.ts b/test/moves/round.test.ts index ec9f3f69a5e..82f080a25ea 100644 --- a/test/moves/round.test.ts +++ b/test/moves/round.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import type { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; diff --git a/test/moves/scale_shot.test.ts b/test/moves/scale_shot.test.ts index ee759b8404a..2be632adb54 100644 --- a/test/moves/scale_shot.test.ts +++ b/test/moves/scale_shot.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; import { MoveEffectPhase } from "#app/phases/move-effect-phase"; import { MoveEndPhase } from "#app/phases/move-end-phase"; diff --git a/test/moves/secret_power.test.ts b/test/moves/secret_power.test.ts index 40802dcc51f..37f1664251b 100644 --- a/test/moves/secret_power.test.ts +++ b/test/moves/secret_power.test.ts @@ -2,7 +2,7 @@ import { Abilities } from "#enums/abilities"; import { Biome } from "#enums/biome"; import { Moves } from "#enums/moves"; import { Stat } from "#enums/stat"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Species } from "#enums/species"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; diff --git a/test/moves/shell_side_arm.test.ts b/test/moves/shell_side_arm.test.ts index 232182ffef0..a5b065b76cb 100644 --- a/test/moves/shell_side_arm.test.ts +++ b/test/moves/shell_side_arm.test.ts @@ -1,6 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { ShellSideArmCategoryAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, ShellSideArmCategoryAttr } from "#app/data/moves/move"; import type Move from "#app/data/moves/move"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; diff --git a/test/moves/shell_trap.test.ts b/test/moves/shell_trap.test.ts index d3ba67843ac..2df94cdb828 100644 --- a/test/moves/shell_trap.test.ts +++ b/test/moves/shell_trap.test.ts @@ -1,5 +1,5 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Moves } from "#app/enums/moves"; import { Species } from "#app/enums/species"; import { MoveResult } from "#app/field/pokemon"; diff --git a/test/moves/sketch.test.ts b/test/moves/sketch.test.ts index 94f37757a6a..dfbf2eca713 100644 --- a/test/moves/sketch.test.ts +++ b/test/moves/sketch.test.ts @@ -1,15 +1,13 @@ import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; -import { MoveResult } from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { MoveResult, PokemonMove } from "#app/field/pokemon"; import GameManager from "#test/testUtils/gameManager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { StatusEffect } from "#app/enums/status-effect"; import { BattlerIndex } from "#app/battle"; -import { RandomMoveAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, RandomMoveAttr } from "#app/data/moves/move"; describe("Moves - Sketch", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/solar_beam.test.ts b/test/moves/solar_beam.test.ts index b8a28065b64..dffd4f210e5 100644 --- a/test/moves/solar_beam.test.ts +++ b/test/moves/solar_beam.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { BattlerTagType } from "#enums/battler-tag-type"; import { WeatherType } from "#enums/weather-type"; import { MoveResult } from "#app/field/pokemon"; diff --git a/test/moves/sparkly_swirl.test.ts b/test/moves/sparkly_swirl.test.ts index 1908772598a..6cd357c7e0e 100644 --- a/test/moves/sparkly_swirl.test.ts +++ b/test/moves/sparkly_swirl.test.ts @@ -1,4 +1,4 @@ -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { StatusEffect } from "#app/enums/status-effect"; import { CommandPhase } from "#app/phases/command-phase"; import { Abilities } from "#enums/abilities"; diff --git a/test/moves/spectral_thief.test.ts b/test/moves/spectral_thief.test.ts index 271cb03073a..2e52b118a74 100644 --- a/test/moves/spectral_thief.test.ts +++ b/test/moves/spectral_thief.test.ts @@ -1,7 +1,7 @@ import { Abilities } from "#enums/abilities"; import { BattlerIndex } from "#app/battle"; import { Stat } from "#enums/stat"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import { TurnEndPhase } from "#app/phases/turn-end-phase"; diff --git a/test/moves/spit_up.test.ts b/test/moves/spit_up.test.ts index 7ef6e5e5b14..d71647bda52 100644 --- a/test/moves/spit_up.test.ts +++ b/test/moves/spit_up.test.ts @@ -1,8 +1,8 @@ import { Stat } from "#enums/stat"; import { StockpilingTag } from "#app/data/battler-tags"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { BattlerTagType } from "#app/enums/battler-tag-type"; -import type { TurnMove } from "#app/interfaces/turn-move"; +import type { TurnMove } from "#app/field/pokemon"; import { MoveResult } from "#app/field/pokemon"; import GameManager from "#test/testUtils/gameManager"; import { Abilities } from "#enums/abilities"; diff --git a/test/moves/steamroller.test.ts b/test/moves/steamroller.test.ts index a0e4c29cce5..ba96928e01d 100644 --- a/test/moves/steamroller.test.ts +++ b/test/moves/steamroller.test.ts @@ -1,7 +1,7 @@ import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { BattlerTagType } from "#app/enums/battler-tag-type"; -import type { DamageCalculationResult } from "#app/interfaces/damage-calculation-result"; +import type { DamageCalculationResult } from "#app/field/pokemon"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/test/moves/stockpile.test.ts b/test/moves/stockpile.test.ts index f6e6a0087f6..033f24d5229 100644 --- a/test/moves/stockpile.test.ts +++ b/test/moves/stockpile.test.ts @@ -1,6 +1,6 @@ import { Stat } from "#enums/stat"; import { StockpilingTag } from "#app/data/battler-tags"; -import type { TurnMove } from "#app/interfaces/turn-move"; +import type { TurnMove } from "#app/field/pokemon"; import { MoveResult } from "#app/field/pokemon"; import { CommandPhase } from "#app/phases/command-phase"; import { TurnInitPhase } from "#app/phases/turn-init-phase"; diff --git a/test/moves/substitute.test.ts b/test/moves/substitute.test.ts index 68b90bf7cf8..23f7f4af4b9 100644 --- a/test/moves/substitute.test.ts +++ b/test/moves/substitute.test.ts @@ -1,8 +1,7 @@ import { BattlerIndex } from "#app/battle"; import { ArenaTagSide } from "#app/data/arena-tag"; import { SubstituteTag, TrappedTag } from "#app/data/battler-tags"; -import { StealHeldItemChanceAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, StealHeldItemChanceAttr } from "#app/data/moves/move"; import { MoveResult } from "#app/field/pokemon"; import type { CommandPhase } from "#app/phases/command-phase"; import GameManager from "#test/testUtils/gameManager"; diff --git a/test/moves/swallow.test.ts b/test/moves/swallow.test.ts index 86af584a174..baa03801079 100644 --- a/test/moves/swallow.test.ts +++ b/test/moves/swallow.test.ts @@ -1,7 +1,7 @@ import { Stat } from "#enums/stat"; import { StockpilingTag } from "#app/data/battler-tags"; import { BattlerTagType } from "#app/enums/battler-tag-type"; -import type { TurnMove } from "#app/interfaces/turn-move"; +import type { TurnMove } from "#app/field/pokemon"; import { MoveResult } from "#app/field/pokemon"; import { MovePhase } from "#app/phases/move-phase"; import { TurnInitPhase } from "#app/phases/turn-init-phase"; diff --git a/test/moves/telekinesis.test.ts b/test/moves/telekinesis.test.ts index 7537ba0168a..1355cb975f3 100644 --- a/test/moves/telekinesis.test.ts +++ b/test/moves/telekinesis.test.ts @@ -1,5 +1,5 @@ import { BattlerTagType } from "#enums/battler-tag-type"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/test/moves/tera_blast.test.ts b/test/moves/tera_blast.test.ts index 9d17ea6a3cc..c1a2b999fa0 100644 --- a/test/moves/tera_blast.test.ts +++ b/test/moves/tera_blast.test.ts @@ -1,11 +1,10 @@ import { BattlerIndex } from "#app/battle"; import { Stat } from "#enums/stat"; -import { TeraMoveCategoryAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, TeraMoveCategoryAttr } from "#app/data/moves/move"; import type Move from "#app/data/moves/move"; import { PokemonType } from "#enums/pokemon-type"; import { Abilities } from "#app/enums/abilities"; -import { HitResult } from "#enums/hit-result"; +import { HitResult } from "#app/field/pokemon"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import GameManager from "#test/testUtils/gameManager"; diff --git a/test/moves/toxic.test.ts b/test/moves/toxic.test.ts index ab536364f6a..f2b1f82fe02 100644 --- a/test/moves/toxic.test.ts +++ b/test/moves/toxic.test.ts @@ -5,7 +5,7 @@ import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { StatusEffect } from "#enums/status-effect"; import { BattlerIndex } from "#app/battle"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves } from "#app/data/moves/move"; describe("Moves - Toxic", () => { let phaserGame: Phaser.Game; diff --git a/test/moves/triple_arrows.test.ts b/test/moves/triple_arrows.test.ts index d1d14f7d3e6..eb434b25815 100644 --- a/test/moves/triple_arrows.test.ts +++ b/test/moves/triple_arrows.test.ts @@ -1,5 +1,4 @@ -import { FlinchAttr, StatStageChangeAttr } from "#app/data/moves/move"; -import { allMoves } from "#app/data/moves/all-moves"; +import { allMoves, FlinchAttr, StatStageChangeAttr } from "#app/data/moves/move"; import { Abilities } from "#enums/abilities"; import { Moves } from "#enums/moves"; import type Move from "#app/data/moves/move"; diff --git a/test/mystery-encounter/encounters/an-offer-you-cant-refuse-encounter.test.ts b/test/mystery-encounter/encounters/an-offer-you-cant-refuse-encounter.test.ts index 728129007e7..3c7bda8febd 100644 --- a/test/mystery-encounter/encounters/an-offer-you-cant-refuse-encounter.test.ts +++ b/test/mystery-encounter/encounters/an-offer-you-cant-refuse-encounter.test.ts @@ -8,8 +8,7 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vite import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; import { runMysteryEncounterToEnd } from "#test/mystery-encounter/encounter-test-utils"; import type BattleScene from "#app/battle-scene"; -import { PlayerPokemon } from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PlayerPokemon, PokemonMove } from "#app/field/pokemon"; import { AnOfferYouCantRefuseEncounter } from "#app/data/mystery-encounters/encounters/an-offer-you-cant-refuse-encounter"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; diff --git a/test/mystery-encounter/encounters/bug-type-superfan-encounter.test.ts b/test/mystery-encounter/encounters/bug-type-superfan-encounter.test.ts index c1e6a635f31..9befe77e688 100644 --- a/test/mystery-encounter/encounters/bug-type-superfan-encounter.test.ts +++ b/test/mystery-encounter/encounters/bug-type-superfan-encounter.test.ts @@ -11,7 +11,7 @@ import { } from "#test/mystery-encounter/encounter-test-utils"; import { Moves } from "#enums/moves"; import type BattleScene from "#app/battle-scene"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { Mode } from "#app/ui/ui"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; diff --git a/test/mystery-encounter/encounters/clowning-around-encounter.test.ts b/test/mystery-encounter/encounters/clowning-around-encounter.test.ts index 7b3d87463bf..4bbe76e5c72 100644 --- a/test/mystery-encounter/encounters/clowning-around-encounter.test.ts +++ b/test/mystery-encounter/encounters/clowning-around-encounter.test.ts @@ -15,7 +15,7 @@ import { import { Moves } from "#enums/moves"; import type BattleScene from "#app/battle-scene"; import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { Mode } from "#app/ui/ui"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; diff --git a/test/mystery-encounter/encounters/dancing-lessons-encounter.test.ts b/test/mystery-encounter/encounters/dancing-lessons-encounter.test.ts index 5ea836d8aa6..77cd65e51b9 100644 --- a/test/mystery-encounter/encounters/dancing-lessons-encounter.test.ts +++ b/test/mystery-encounter/encounters/dancing-lessons-encounter.test.ts @@ -17,7 +17,7 @@ import { Moves } from "#enums/moves"; import { DancingLessonsEncounter } from "#app/data/mystery-encounters/encounters/dancing-lessons-encounter"; import { Mode } from "#app/ui/ui"; import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; import { CommandPhase } from "#app/phases/command-phase"; import { MovePhase } from "#app/phases/move-phase"; diff --git a/test/mystery-encounter/encounters/fight-or-flight-encounter.test.ts b/test/mystery-encounter/encounters/fight-or-flight-encounter.test.ts index 82d80bc3970..d233e72932a 100644 --- a/test/mystery-encounter/encounters/fight-or-flight-encounter.test.ts +++ b/test/mystery-encounter/encounters/fight-or-flight-encounter.test.ts @@ -11,7 +11,7 @@ import { } from "#test/mystery-encounter/encounter-test-utils"; import { Moves } from "#enums/moves"; import type BattleScene from "#app/battle-scene"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { Mode } from "#app/ui/ui"; import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; diff --git a/test/mystery-encounter/encounters/part-timer-encounter.test.ts b/test/mystery-encounter/encounters/part-timer-encounter.test.ts index 308aa9839e9..639a2e140ff 100644 --- a/test/mystery-encounter/encounters/part-timer-encounter.test.ts +++ b/test/mystery-encounter/encounters/part-timer-encounter.test.ts @@ -14,7 +14,7 @@ import { CIVILIZATION_ENCOUNTER_BIOMES } from "#app/data/mystery-encounters/myst import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { PartTimerEncounter } from "#app/data/mystery-encounters/encounters/part-timer-encounter"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { Moves } from "#enums/moves"; import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; diff --git a/test/mystery-encounter/encounters/the-strong-stuff-encounter.test.ts b/test/mystery-encounter/encounters/the-strong-stuff-encounter.test.ts index 0d0298901d0..a9e6a339d36 100644 --- a/test/mystery-encounter/encounters/the-strong-stuff-encounter.test.ts +++ b/test/mystery-encounter/encounters/the-strong-stuff-encounter.test.ts @@ -17,7 +17,7 @@ import { TheStrongStuffEncounter } from "#app/data/mystery-encounters/encounters import { Nature } from "#enums/nature"; import { BerryType } from "#enums/berry-type"; import { BattlerTagType } from "#enums/battler-tag-type"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { Mode } from "#app/ui/ui"; import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; import { BerryModifier, PokemonBaseStatTotalModifier } from "#app/modifier/modifier"; diff --git a/test/mystery-encounter/encounters/trash-to-treasure-encounter.test.ts b/test/mystery-encounter/encounters/trash-to-treasure-encounter.test.ts index 44c8e7a8915..df7bbb9f424 100644 --- a/test/mystery-encounter/encounters/trash-to-treasure-encounter.test.ts +++ b/test/mystery-encounter/encounters/trash-to-treasure-encounter.test.ts @@ -12,7 +12,7 @@ import { getPokemonSpecies } from "#app/data/pokemon-species"; import { Biome } from "#app/enums/biome"; import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; import { Species } from "#app/enums/species"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { HealShopCostModifier, HitHealModifier, TurnHealModifier } from "#app/modifier/modifier"; import { ModifierTier } from "#app/modifier/modifier-tier"; import { modifierTypes, type PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; diff --git a/test/mystery-encounter/encounters/uncommon-breed-encounter.test.ts b/test/mystery-encounter/encounters/uncommon-breed-encounter.test.ts index e4928406a18..452dfcf3784 100644 --- a/test/mystery-encounter/encounters/uncommon-breed-encounter.test.ts +++ b/test/mystery-encounter/encounters/uncommon-breed-encounter.test.ts @@ -10,7 +10,7 @@ import { } from "#test/mystery-encounter/encounter-test-utils"; import { Moves } from "#enums/moves"; import type BattleScene from "#app/battle-scene"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils"; diff --git a/test/testUtils/helpers/moveHelper.ts b/test/testUtils/helpers/moveHelper.ts index 333f95f2014..543f46b2026 100644 --- a/test/testUtils/helpers/moveHelper.ts +++ b/test/testUtils/helpers/moveHelper.ts @@ -1,7 +1,7 @@ import type { BattlerIndex } from "#app/battle"; import { Button } from "#app/enums/buttons"; import type Pokemon from "#app/field/pokemon"; -import { PokemonMove } from "#app/data/moves/pokemon-move"; +import { PokemonMove } from "#app/field/pokemon"; import Overrides from "#app/overrides"; import type { CommandPhase } from "#app/phases/command-phase"; import { LearnMovePhase } from "#app/phases/learn-move-phase"; From 8216a379bf37efaed799261ac757df485af0914f Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Mon, 14 Apr 2025 12:37:26 -0500 Subject: [PATCH 03/13] [Dev][GitHub] Update to node 22 (#5586) * Update node and workflows to use version 22.14 * Update @types/node package * Update engines field in package.json * Hardcode node version in github pages workflow * Update to checkout@v4 in github pages workflow --- .github/workflows/deploy-beta.yml | 2 +- .github/workflows/deploy.yml | 2 +- .github/workflows/github-pages.yml | 10 +++++----- .github/workflows/quality.yml | 1 + .github/workflows/test-shard-template.yml | 5 +++-- .nvmrc | 2 +- README.md | 2 +- package-lock.json | 17 +++++++++-------- package.json | 4 ++-- 9 files changed, 24 insertions(+), 21 deletions(-) diff --git a/.github/workflows/deploy-beta.yml b/.github/workflows/deploy-beta.yml index d8d8126193d..8b0e33a18c4 100644 --- a/.github/workflows/deploy-beta.yml +++ b/.github/workflows/deploy-beta.yml @@ -15,7 +15,7 @@ jobs: submodules: 'recursive' - uses: actions/setup-node@v4 with: - node-version: "20" + node-version-file: '.nvmrc' - name: Install dependencies run: npm ci - name: Build diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e40b18eb69b..00190e477d5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -18,7 +18,7 @@ jobs: submodules: 'recursive' - uses: actions/setup-node@v4 with: - node-version: "20" + node-version-file: '.nvmrc' - name: Install dependencies run: npm ci - name: Build diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 58067ac81ac..b7d5fb95c1e 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout repository for Typedoc - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' path: pokerogue_docs @@ -34,14 +34,14 @@ jobs: sudo apt update sudo apt install -y git openssh-client - - name: Setup Node 20.13.1 - uses: actions/setup-node@v1 + - name: Setup Node 22.14.1 + uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 - name: Checkout repository for Github Pages if: github.event_name == 'push' - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: pokerogue_gh ref: gh-pages diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 7e33a77a73a..d9592662998 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -29,6 +29,7 @@ jobs: uses: actions/setup-node@v4 # Use the setup-node action version 4 with: node-version-file: '.nvmrc' + cache: 'npm' - name: Install Node.js dependencies # Step to install Node.js dependencies run: npm ci # Use 'npm ci' to install dependencies diff --git a/.github/workflows/test-shard-template.yml b/.github/workflows/test-shard-template.yml index 9fc41d1b965..cee452f3a59 100644 --- a/.github/workflows/test-shard-template.yml +++ b/.github/workflows/test-shard-template.yml @@ -19,13 +19,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out Git repository - uses: actions/checkout@v4 + uses: actions/checkout@v4.2.2 with: submodules: 'recursive' - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: 20 + node-version-file: '.nvmrc' + cache: 'npm' - name: Install Node.js dependencies run: npm ci - name: Run tests diff --git a/.nvmrc b/.nvmrc index 9bcccb9439d..517f38666b4 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v20.13.1 +v22.14.0 diff --git a/README.md b/README.md index 5bb3ecfd26f..56392808b3c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you have the motivation and experience with Typescript/Javascript (or are wil #### Prerequisites -- node: 20.13.1 +- node: 22.14.0 - npm: [how to install](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) #### Running Locally diff --git a/package-lock.json b/package-lock.json index 6b880370f0b..622eac908de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "@hpcc-js/wasm": "^2.22.4", "@stylistic/eslint-plugin-ts": "^4.1.0", "@types/jsdom": "^21.1.7", - "@types/node": "^20.12.13", + "@types/node": "^22.13.14", "@typescript-eslint/eslint-plugin": "^8.28.0", "@typescript-eslint/parser": "^8.28.0", "@vitest/coverage-istanbul": "^3.0.9", @@ -2582,12 +2582,13 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.14.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.11.tgz", - "integrity": "sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA==", + "version": "22.13.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.14.tgz", + "integrity": "sha512-Zs/Ollc1SJ8nKUAgc7ivOEdIBM8JAKgrqqUYi2J997JuKO7/tpQC+WCetQ1sypiKCQWHdvdg9wBNpUPEWZae7w==", "dev": true, + "license": "MIT", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.20.0" } }, "node_modules/@types/statuses": { @@ -7312,9 +7313,9 @@ "dev": true }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "dev": true, "license": "MIT" }, diff --git a/package.json b/package.json index c84e926fc35..ffe4c06bea0 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@hpcc-js/wasm": "^2.22.4", "@stylistic/eslint-plugin-ts": "^4.1.0", "@types/jsdom": "^21.1.7", - "@types/node": "^20.12.13", + "@types/node": "^22.13.14", "@typescript-eslint/eslint-plugin": "^8.28.0", "@typescript-eslint/parser": "^8.28.0", "@vitest/coverage-istanbul": "^3.0.9", @@ -67,6 +67,6 @@ "phaser3-rex-plugins": "^1.80.14" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } } From 3ec8f236f92b022e370eedcc6b695c057c6d7ac2 Mon Sep 17 00:00:00 2001 From: AJ Fontaine <36677462+Fontbane@users.noreply.github.com> Date: Mon, 14 Apr 2025 20:13:05 -0400 Subject: [PATCH 04/13] [Refactor] Change how rival event rewards are generated (#5638) * Change how rival event rewards are generated * Simplify to switch case Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/data/trainers/trainer-config.ts | 13 ------------- src/phases/trainer-victory-phase.ts | 6 ------ src/phases/victory-phase.ts | 21 +++++++++++++++------ 3 files changed, 15 insertions(+), 25 deletions(-) diff --git a/src/data/trainers/trainer-config.ts b/src/data/trainers/trainer-config.ts index 0ab7119dab9..4efe294f7d0 100644 --- a/src/data/trainers/trainer-config.ts +++ b/src/data/trainers/trainer-config.ts @@ -116,7 +116,6 @@ export class TrainerConfig { public modifierRewardFuncs: ModifierTypeFunc[] = []; public partyTemplates: TrainerPartyTemplate[]; public partyTemplateFunc: PartyTemplateFunc; - public eventRewardFuncs: ModifierTypeFunc[] = []; public partyMemberFuncs: PartyMemberFuncs = {}; public speciesPools: TrainerTierPools; public speciesFilter: PokemonSpeciesFilter; @@ -517,16 +516,6 @@ export class TrainerConfig { // return ret; // } - /** - * Sets eventRewardFuncs to the active event rewards for the specified wave - * @param wave Associated with {@linkcode getFixedBattleEventRewards} - * @returns this - */ - setEventModifierRewardFuncs(wave: number): TrainerConfig { - this.eventRewardFuncs = timedEventManager.getFixedBattleEventRewards(wave).map(r => modifierTypes[r]); - return this; - } - setModifierRewardFuncs(...modifierTypeFuncs: (() => ModifierTypeFunc)[]): TrainerConfig { this.modifierRewardFuncs = modifierTypeFuncs.map(func => () => { const modifierTypeFunc = func(); @@ -3692,7 +3681,6 @@ export const trainerConfigs: TrainerConfigs = { () => modifierTypes.SUPER_EXP_CHARM, () => modifierTypes.EXP_SHARE, ) - .setEventModifierRewardFuncs(8) .setPartyMemberFunc( 0, getRandomPartyMemberFunc( @@ -3760,7 +3748,6 @@ export const trainerConfigs: TrainerConfigs = { .setMixedBattleBgm("battle_rival") .setPartyTemplates(trainerPartyTemplates.RIVAL_2) .setModifierRewardFuncs(() => modifierTypes.EXP_SHARE) - .setEventModifierRewardFuncs(25) .setPartyMemberFunc( 0, getRandomPartyMemberFunc( diff --git a/src/phases/trainer-victory-phase.ts b/src/phases/trainer-victory-phase.ts index 637ddea8b56..f17071f118e 100644 --- a/src/phases/trainer-victory-phase.ts +++ b/src/phases/trainer-victory-phase.ts @@ -26,12 +26,6 @@ export class TrainerVictoryPhase extends BattlePhase { globalScene.unshiftPhase(new ModifierRewardPhase(modifierRewardFunc)); } - if (timedEventManager.isEventActive()) { - for (const rewardFunc of globalScene.currentBattle.trainer?.config.eventRewardFuncs!) { - globalScene.unshiftPhase(new ModifierRewardPhase(rewardFunc)); - } - } - const trainerType = globalScene.currentBattle.trainer?.config.trainerType!; // TODO: is this bang correct? // Validate Voucher for boss trainers if (vouchers.hasOwnProperty(TrainerType[trainerType])) { diff --git a/src/phases/victory-phase.ts b/src/phases/victory-phase.ts index 78bf72195e8..9f4412fe270 100644 --- a/src/phases/victory-phase.ts +++ b/src/phases/victory-phase.ts @@ -13,6 +13,7 @@ import { SelectModifierPhase } from "./select-modifier-phase"; import { TrainerVictoryPhase } from "./trainer-victory-phase"; import { handleMysteryEncounterVictory } from "#app/data/mystery-encounters/utils/encounter-phase-utils"; import { globalScene } from "#app/global-scene"; +import { timedEventManager } from "#app/global-event-manager"; export class VictoryPhase extends PokemonPhase { /** If true, indicates that the phase is intended for EXP purposes only, and not to continue a battle to next phase */ @@ -53,12 +54,20 @@ export class VictoryPhase extends PokemonPhase { } if (globalScene.gameMode.isEndless || !globalScene.gameMode.isWaveFinal(globalScene.currentBattle.waveIndex)) { globalScene.pushPhase(new EggLapsePhase()); - if ( - globalScene.gameMode.isClassic && - globalScene.currentBattle.waveIndex === ClassicFixedBossWaves.EVIL_BOSS_2 - ) { - // Should get Lock Capsule on 165 before shop phase so it can be used in the rewards shop - globalScene.pushPhase(new ModifierRewardPhase(modifierTypes.LOCK_CAPSULE)); + if (globalScene.gameMode.isClassic) { + switch (globalScene.currentBattle.waveIndex) { + case ClassicFixedBossWaves.RIVAL_1: + case ClassicFixedBossWaves.RIVAL_2: + // Get event modifiers for this wave + timedEventManager + .getFixedBattleEventRewards(globalScene.currentBattle.waveIndex) + .map(r => globalScene.pushPhase(new ModifierRewardPhase(modifierTypes[r]))); + break; + case ClassicFixedBossWaves.EVIL_BOSS_2: + // Should get Lock Capsule on 165 before shop phase so it can be used in the rewards shop + globalScene.pushPhase(new ModifierRewardPhase(modifierTypes.LOCK_CAPSULE)); + break; + } } if (globalScene.currentBattle.waveIndex % 10) { globalScene.pushPhase(new SelectModifierPhase(undefined, undefined, this.getFixedBattleCustomModifiers())); From 4740b593a02dfdc0b45e5515d56bf30a0d7cf4f8 Mon Sep 17 00:00:00 2001 From: Madmadness65 <59298170+Madmadness65@users.noreply.github.com> Date: Tue, 15 Apr 2025 00:27:14 -0500 Subject: [PATCH 05/13] =?UTF-8?q?[Balance]=20Fix=20Depot=20Agent=20trainer?= =?UTF-8?q?=20type=20lacking=20Pok=C3=A9mon=20(#5623)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix Depot Agent trainer type lacking Pokémon Also removes a stray duplicate Barboach from the Fisherman. --- src/data/trainers/trainer-config.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/data/trainers/trainer-config.ts b/src/data/trainers/trainer-config.ts index 4efe294f7d0..d9922ecc097 100644 --- a/src/data/trainers/trainer-config.ts +++ b/src/data/trainers/trainer-config.ts @@ -1318,7 +1318,16 @@ export const trainerConfigs: TrainerConfigs = { [TrainerPoolTier.RARE]: [Species.BELLOSSOM, Species.HITMONTOP, Species.MIME_JR, Species.ORICORIO], [TrainerPoolTier.SUPER_RARE]: [Species.QUAXLY, Species.JANGMO_O], }), - [TrainerType.DEPOT_AGENT]: new TrainerConfig(++t).setMoneyMultiplier(1.45).setEncounterBgm(TrainerType.CLERK), + [TrainerType.DEPOT_AGENT]: new TrainerConfig(++t) + .setMoneyMultiplier(1.45) + .setEncounterBgm(TrainerType.CLERK) + .setPartyTemplates( + trainerPartyTemplates.TWO_AVG, + trainerPartyTemplates.THREE_WEAK, + trainerPartyTemplates.THREE_AVG, + trainerPartyTemplates.FOUR_WEAK, + ) + .setSpeciesFilter(s => s.isOfType(PokemonType.GROUND)), [TrainerType.DOCTOR]: new TrainerConfig(++t) .setHasGenders("Nurse", "lass") .setHasDouble("Medical Team") @@ -1369,7 +1378,6 @@ export const trainerConfigs: TrainerConfigs = { Species.CHINCHOU, Species.CORSOLA, Species.WAILMER, - Species.BARBOACH, Species.CLAMPERL, Species.LUVDISC, Species.MANTYKE, 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 06/13] [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"; From 18c4dddcf06d51ce9119c1189aef1846ce6c06ee Mon Sep 17 00:00:00 2001 From: Stephen Kelman <64545785+stephenrzkelman@users.noreply.github.com> Date: Tue, 15 Apr 2025 07:19:19 -0700 Subject: [PATCH 07/13] [Bug] Fixing Tera Starstorm for first turn of terastallization (#5658) * Updating tera starstorm targeting condition so that it is a spread move on the turn that terastallization happens * added new unit tests to verify behavior of tera starstorm under non-tera conditions as well as on terastallization turns --- src/data/moves/move.ts | 2 +- test/moves/tera_starstorm.test.ts | 34 ++++++++++++++++++++++++++++ test/testUtils/helpers/moveHelper.ts | 27 ++++++++++++++++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index b68dd0d3e1d..9546a6a40e5 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -11205,7 +11205,7 @@ export function initMoves() { new AttackMove(Moves.TERA_STARSTORM, PokemonType.NORMAL, MoveCategory.SPECIAL, 120, 100, 5, -1, 0, 9) .attr(TeraMoveCategoryAttr) .attr(TeraStarstormTypeAttr) - .attr(VariableTargetAttr, (user, target, move) => user.hasSpecies(Species.TERAPAGOS) && user.isTerastallized ? MoveTarget.ALL_NEAR_ENEMIES : MoveTarget.NEAR_OTHER) + .attr(VariableTargetAttr, (user, target, move) => user.hasSpecies(Species.TERAPAGOS) && (user.isTerastallized || globalScene.currentBattle.preTurnCommands[user.getFieldIndex()]?.command === Command.TERA) ? MoveTarget.ALL_NEAR_ENEMIES : MoveTarget.NEAR_OTHER) .partial(), /** Does not ignore abilities that affect stats, relevant in determining the move's category {@see TeraMoveCategoryAttr} */ new AttackMove(Moves.FICKLE_BEAM, PokemonType.DRAGON, MoveCategory.SPECIAL, 80, 100, 5, 30, 0, 9) .attr(PreMoveMessageAttr, doublePowerChanceMessageFunc) diff --git a/test/moves/tera_starstorm.test.ts b/test/moves/tera_starstorm.test.ts index 19fe58f4057..9f97b2a51aa 100644 --- a/test/moves/tera_starstorm.test.ts +++ b/test/moves/tera_starstorm.test.ts @@ -69,6 +69,40 @@ describe("Moves - Tera Starstorm", () => { expect(enemyField.every(pokemon => pokemon.isFullHp())).toBe(false); }); + it("targets both opponents in a double battle when used by Terapagos immediately after terastallizing", async () => { + await game.classicMode.startBattle([Species.TERAPAGOS]); + + const terapagos = game.scene.getPlayerParty()[0]; + terapagos.isTerastallized = false; + + game.move.selectWithTera(Moves.TERA_STARSTORM, 0); + + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2]); + + const enemyField = game.scene.getEnemyField(); + + // Terapagos in Stellar Form should hit both targets + await game.phaseInterceptor.to("MoveEndPhase"); + expect(enemyField.some(pokemon => pokemon.isFullHp())).toBe(false); + }); + + it("targets only one opponent in a double battle when used by Terapagos without terastallizing", async () => { + await game.classicMode.startBattle([Species.TERAPAGOS]); + + const terapagos = game.scene.getPlayerParty()[0]; + terapagos.isTerastallized = false; + + game.move.select(Moves.TERA_STARSTORM, 0, BattlerIndex.ENEMY); + + await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2]); + + const enemyField = game.scene.getEnemyField(); + + // Terapagos in Stellar Form should hit both targets + await game.phaseInterceptor.to("MoveEndPhase"); + expect(enemyField.some(pokemon => pokemon.isFullHp())).toBe(true); + }); + it("applies the effects when Terapagos in Stellar Form is fused with another Pokemon", async () => { await game.classicMode.startBattle([Species.TERAPAGOS, Species.CHARMANDER, Species.MAGIKARP]); diff --git a/test/testUtils/helpers/moveHelper.ts b/test/testUtils/helpers/moveHelper.ts index 543f46b2026..a54028ebca0 100644 --- a/test/testUtils/helpers/moveHelper.ts +++ b/test/testUtils/helpers/moveHelper.ts @@ -65,6 +65,33 @@ export class MoveHelper extends GameManagerHelper { } } + /** + * Select the move to be used by the given Pokemon(-index), **which will also terastallize on this turn**. + * Triggers during the next {@linkcode CommandPhase} + * @param move - the move to use + * @param pkmIndex - the pokemon index. Relevant for double-battles only (defaults to 0) + * @param targetIndex - The {@linkcode BattlerIndex} of the Pokemon to target for single-target moves, or `null` if a manual call to `selectTarget()` is required + */ + public selectWithTera(move: Moves, pkmIndex: 0 | 1 = 0, targetIndex?: BattlerIndex | null) { + const movePosition = getMovePosition(this.game.scene, pkmIndex, move); + this.game.scene.getPlayerParty()[pkmIndex].isTerastallized = false; + + this.game.onNextPrompt("CommandPhase", Mode.COMMAND, () => { + this.game.scene.ui.setMode( + Mode.FIGHT, + (this.game.scene.getCurrentPhase() as CommandPhase).getFieldIndex(), + Command.TERA, + ); + }); + this.game.onNextPrompt("CommandPhase", Mode.FIGHT, () => { + (this.game.scene.getCurrentPhase() as CommandPhase).handleCommand(Command.TERA, movePosition, false); + }); + + if (targetIndex !== null) { + this.game.selectTarget(movePosition, targetIndex); + } + } + /** * Forces the Paralysis or Freeze status to activate on the next move by temporarily mocking {@linkcode Overrides.STATUS_ACTIVATION_OVERRIDE}, * advancing to the next `MovePhase`, and then resetting the override to `null` From efad0d1324368ca31cb0c799f97dc475bf375330 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Tue, 15 Apr 2025 20:55:29 -0700 Subject: [PATCH 08/13] [GitHub] Use `.nvmrc` for pages workflow (#5666) --- .github/workflows/github-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index b7d5fb95c1e..ce7c17e2db9 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -37,7 +37,7 @@ jobs: - name: Setup Node 22.14.1 uses: actions/setup-node@v4 with: - node-version: 22 + node-version-file: "pokerogue_docs/.nvmrc" - name: Checkout repository for Github Pages if: github.event_name == 'push' From ae588ebff907f17e38d2850ddc5bd07d8bce656a Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Wed, 16 Apr 2025 16:05:40 -0500 Subject: [PATCH 09/13] [Bug][Move] Struggle no longer gets STAB (#5643) * Struggle no longer gets STAB * Apply kev's suggestions from code review Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/field/pokemon.ts | 133 ++++++++++++++++++++---------------- test/moves/struggle.test.ts | 65 ++++++++++++++++++ 2 files changed, 139 insertions(+), 59 deletions(-) create mode 100644 test/moves/struggle.test.ts diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 22ede4260c3..cdd48f7d940 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -4151,6 +4151,62 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return baseDamage; } + + /** Determine the STAB multiplier for a move used against this pokemon. + * + * @param source - The attacking {@linkcode Pokemon} + * @param move - The {@linkcode Move} used in the attack + * @param ignoreSourceAbility - If `true`, ignores the attacking Pokemon's ability effects + * @param simulated - If `true`, suppresses changes to game state during the calculation + * + * @returns The STAB multiplier for the move used against this Pokemon + */ + calculateStabMultiplier(source: Pokemon, move: Move, ignoreSourceAbility: boolean, simulated: boolean): number { + // If the move has the Typeless attribute, it doesn't get STAB (e.g. struggle) + if (move.hasAttr(TypelessAttr)) { + return 1; + } + const sourceTypes = source.getTypes(); + const sourceTeraType = source.getTeraType(); + const moveType = source.getMoveType(move); + const matchesSourceType = sourceTypes.includes(source.getMoveType(move)); + const stabMultiplier = new NumberHolder(1); + if (matchesSourceType && moveType !== PokemonType.STELLAR) { + stabMultiplier.value += 0.5; + } + + applyMoveAttrs( + CombinedPledgeStabBoostAttr, + source, + this, + move, + stabMultiplier, + ); + + if (!ignoreSourceAbility) { + applyAbAttrs(StabBoostAbAttr, source, null, simulated, stabMultiplier); + } + + if ( + source.isTerastallized && + sourceTeraType === moveType && + moveType !== PokemonType.STELLAR + ) { + stabMultiplier.value += 0.5; + } + + if ( + source.isTerastallized && + source.getTeraType() === PokemonType.STELLAR && + (!source.stellarTypesBoosted.includes(moveType) || + source.hasSpecies(Species.TERAPAGOS)) + ) { + stabMultiplier.value += matchesSourceType ? 0.5 : 0.2; + } + + return Math.min(stabMultiplier.value, 2.25); + } + /** * Calculates the damage of an attack made by another Pokemon against this Pokemon * @param source {@linkcode Pokemon} the attacking Pokemon @@ -4333,70 +4389,29 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { ? 1 : this.randSeedIntRange(85, 100) / 100; - const sourceTypes = source.getTypes(); - const sourceTeraType = source.getTeraType(); - const matchesSourceType = sourceTypes.includes(moveType); + /** A damage multiplier for when the attack is of the attacker's type and/or Tera type. */ - const stabMultiplier = new NumberHolder(1); - if (matchesSourceType && moveType !== PokemonType.STELLAR) { - stabMultiplier.value += 0.5; - } - - if (!ignoreSourceAbility) { - applyAbAttrs(StabBoostAbAttr, source, null, simulated, stabMultiplier); - } - - applyMoveAttrs( - CombinedPledgeStabBoostAttr, - source, - this, - move, - stabMultiplier, - ); - - if ( - source.isTerastallized && - sourceTeraType === moveType && - moveType !== PokemonType.STELLAR - ) { - stabMultiplier.value += 0.5; - } - - if ( - source.isTerastallized && - source.getTeraType() === PokemonType.STELLAR && - (!source.stellarTypesBoosted.includes(moveType) || - source.hasSpecies(Species.TERAPAGOS)) - ) { - if (matchesSourceType) { - stabMultiplier.value += 0.5; - } else { - stabMultiplier.value += 0.2; - } - } - - stabMultiplier.value = Math.min(stabMultiplier.value, 2.25); + const stabMultiplier = this.calculateStabMultiplier(source, move, ignoreSourceAbility, simulated); /** Halves damage if the attacker is using a physical attack while burned */ - const burnMultiplier = new NumberHolder(1); + let burnMultiplier = 1; if ( isPhysical && source.status && - source.status.effect === StatusEffect.BURN + source.status.effect === StatusEffect.BURN && + !move.hasAttr(BypassBurnDamageReductionAttr) ) { - if (!move.hasAttr(BypassBurnDamageReductionAttr)) { - const burnDamageReductionCancelled = new BooleanHolder(false); - if (!ignoreSourceAbility) { - applyAbAttrs( - BypassBurnDamageReductionAbAttr, - source, - burnDamageReductionCancelled, - simulated, - ); - } - if (!burnDamageReductionCancelled.value) { - burnMultiplier.value = 0.5; - } + const burnDamageReductionCancelled = new BooleanHolder(false); + if (!ignoreSourceAbility) { + applyAbAttrs( + BypassBurnDamageReductionAbAttr, + source, + burnDamageReductionCancelled, + simulated, + ); + } + if (!burnDamageReductionCancelled.value) { + burnMultiplier = 0.5; } } @@ -4447,9 +4462,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { glaiveRushMultiplier.value * criticalMultiplier.value * randomMultiplier * - stabMultiplier.value * + stabMultiplier * typeMultiplier * - burnMultiplier.value * + burnMultiplier * screenMultiplier.value * hitsTagMultiplier.value * mistyTerrainMultiplier, diff --git a/test/moves/struggle.test.ts b/test/moves/struggle.test.ts new file mode 100644 index 00000000000..6b566df9d54 --- /dev/null +++ b/test/moves/struggle.test.ts @@ -0,0 +1,65 @@ +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import GameManager from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; + +describe("Moves - Struggle", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .moveset([Moves.SPLASH]) + .ability(Abilities.BALL_FETCH) + .battleType("single") + .disableCrits() + .enemySpecies(Species.MAGIKARP) + .enemyAbility(Abilities.BALL_FETCH) + .enemyMoveset(Moves.SPLASH); + }); + + it("should not have its power boosted by adaptability or stab", async () => { + game.override.moveset([Moves.STRUGGLE]).ability(Abilities.ADAPTABILITY); + await game.classicMode.startBattle([Species.RATTATA]); + + const enemy = game.scene.getEnemyPokemon()!; + game.move.select(Moves.STRUGGLE); + + const stabSpy = vi.spyOn(enemy, "calculateStabMultiplier"); + + await game.phaseInterceptor.to("BerryPhase"); + + expect(stabSpy).toHaveReturnedWith(1); + + stabSpy.mockRestore(); + }); + + it("should ignore type effectiveness", async () => { + game.override.moveset([Moves.STRUGGLE]); + await game.classicMode.startBattle([Species.GASTLY]); + + const enemy = game.scene.getEnemyPokemon()!; + game.move.select(Moves.STRUGGLE); + + const moveEffectivenessSpy = vi.spyOn(enemy, "getMoveEffectiveness"); + + await game.phaseInterceptor.to("BerryPhase"); + + expect(moveEffectivenessSpy).toHaveReturnedWith(1); + + moveEffectivenessSpy.mockRestore(); + }); +}); From 8d311e65cf5dc65d807827a874f140c0f7b33ce4 Mon Sep 17 00:00:00 2001 From: damocleas Date: Wed, 16 Apr 2025 22:31:53 -0400 Subject: [PATCH 10/13] [Bug] [Ability] Fixed wrong Sheer Force interactions and multiplier from ~1.33 -> 1.3 (#5515) * sheer force #, sheer force and burning jealousy test fix, and move chance fixes * removed order up sheer force interaction mention and test - updated comments * remove electro shot from changes --- src/data/abilities/ability.ts | 4 ++-- src/data/moves/move.ts | 24 ++++++++++++------------ test/abilities/sheer_force.test.ts | 2 +- test/moves/burning_jealousy.test.ts | 2 +- test/moves/order_up.test.ts | 19 ------------------- 5 files changed, 16 insertions(+), 35 deletions(-) diff --git a/src/data/abilities/ability.ts b/src/data/abilities/ability.ts index 17a8eddf47f..43a6cd5901b 100644 --- a/src/data/abilities/ability.ts +++ b/src/data/abilities/ability.ts @@ -6702,8 +6702,8 @@ export function initAbilities() { .attr(PostDefendStealHeldItemAbAttr, (target, user, move) => move.hasFlag(MoveFlags.MAKES_CONTACT)) .condition(getSheerForceHitDisableAbCondition()), new Ability(Abilities.SHEER_FORCE, 5) - .attr(MovePowerBoostAbAttr, (user, target, move) => move.chance >= 1, 5461 / 4096) - .attr(MoveEffectChanceMultiplierAbAttr, 0), // Should disable life orb, eject button, red card, kee/maranga berry if they get implemented + .attr(MovePowerBoostAbAttr, (user, target, move) => move.chance >= 1, 1.3) + .attr(MoveEffectChanceMultiplierAbAttr, 0), // This attribute does not seem to function - Should disable life orb, eject button, red card, kee/maranga berry if they get implemented new Ability(Abilities.CONTRARY, 5) .attr(StatStageChangeMultiplierAbAttr, -1) .ignorable(), diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index 9546a6a40e5..c2dd0ec31ca 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -3466,8 +3466,7 @@ export class CutHpStatStageBoostAttr extends StatStageChangeAttr { /** * Attribute implementing the stat boosting effect of {@link https://bulbapedia.bulbagarden.net/wiki/Order_Up_(move) | Order Up}. * If the user has a Pokemon with {@link https://bulbapedia.bulbagarden.net/wiki/Commander_(Ability) | Commander} in their mouth, - * one of the user's stats are increased by 1 stage, depending on the "commanding" Pokemon's form. This effect does not respect - * effect chance, but Order Up itself may be boosted by Sheer Force. + * one of the user's stats are increased by 1 stage, depending on the "commanding" Pokemon's form. */ export class OrderUpStatBoostAttr extends MoveEffectAttr { constructor() { @@ -9726,7 +9725,7 @@ export function initMoves() { .ignoresProtect() .target(MoveTarget.BOTH_SIDES) .unimplemented(), - new AttackMove(Moves.SMACK_DOWN, PokemonType.ROCK, MoveCategory.PHYSICAL, 50, 100, 15, 100, 0, 5) + new AttackMove(Moves.SMACK_DOWN, PokemonType.ROCK, MoveCategory.PHYSICAL, 50, 100, 15, -1, 0, 5) .attr(FallDownAttr) .attr(AddBattlerTagAttr, BattlerTagType.INTERRUPTED) .attr(RemoveBattlerTagAttr, [ BattlerTagType.FLYING, BattlerTagType.FLOATING, BattlerTagType.TELEKINESIS ]) @@ -9893,7 +9892,7 @@ export function initMoves() { .attr(MovePowerMultiplierAttr, (user, target, move) => globalScene.arena.getTerrainType() === TerrainType.GRASSY && target.isGrounded() ? 0.5 : 1) .makesContact(false) .target(MoveTarget.ALL_NEAR_OTHERS), - new AttackMove(Moves.FROST_BREATH, PokemonType.ICE, MoveCategory.SPECIAL, 60, 90, 10, 100, 0, 5) + new AttackMove(Moves.FROST_BREATH, PokemonType.ICE, MoveCategory.SPECIAL, 60, 90, 10, -1, 0, 5) .attr(CritOnlyAttr), new AttackMove(Moves.DRAGON_TAIL, PokemonType.DRAGON, MoveCategory.PHYSICAL, 60, 90, 10, -1, -6, 5) .attr(ForceSwitchOutAttr, false, SwitchType.FORCE_SWITCH) @@ -10535,7 +10534,7 @@ export function initMoves() { .attr(AddArenaTagAttr, ArenaTagType.LIGHT_SCREEN, 5, false, true), new AttackMove(Moves.BADDY_BAD, PokemonType.DARK, MoveCategory.SPECIAL, 80, 95, 15, -1, 0, 7) .attr(AddArenaTagAttr, ArenaTagType.REFLECT, 5, false, true), - new AttackMove(Moves.SAPPY_SEED, PokemonType.GRASS, MoveCategory.PHYSICAL, 100, 90, 10, 100, 0, 7) + new AttackMove(Moves.SAPPY_SEED, PokemonType.GRASS, MoveCategory.PHYSICAL, 100, 90, 10, -1, 0, 7) .attr(LeechSeedAttr) .makesContact(false), new AttackMove(Moves.FREEZY_FROST, PokemonType.ICE, MoveCategory.SPECIAL, 100, 90, 10, -1, 0, 7) @@ -10863,7 +10862,7 @@ export function initMoves() { .attr(StatStageChangeAttr, [ Stat.SPD ], 1, true), new AttackMove(Moves.BITTER_MALICE, PokemonType.GHOST, MoveCategory.SPECIAL, 75, 100, 10, 100, 0, 8) .attr(StatStageChangeAttr, [ Stat.ATK ], -1), - new SelfStatusMove(Moves.SHELTER, PokemonType.STEEL, -1, 10, 100, 0, 8) + new SelfStatusMove(Moves.SHELTER, PokemonType.STEEL, -1, 10, -1, 0, 8) .attr(StatStageChangeAttr, [ Stat.DEF ], 2, true), new AttackMove(Moves.TRIPLE_ARROWS, PokemonType.FIGHTING, MoveCategory.PHYSICAL, 90, 100, 10, 30, 0, 8) .makesContact(false) @@ -11018,7 +11017,7 @@ export function initMoves() { .makesContact(false), new AttackMove(Moves.LUMINA_CRASH, PokemonType.PSYCHIC, MoveCategory.SPECIAL, 80, 100, 10, 100, 0, 9) .attr(StatStageChangeAttr, [ Stat.SPDEF ], -2), - new AttackMove(Moves.ORDER_UP, PokemonType.DRAGON, MoveCategory.PHYSICAL, 80, 100, 10, 100, 0, 9) + new AttackMove(Moves.ORDER_UP, PokemonType.DRAGON, MoveCategory.PHYSICAL, 80, 100, 10, -1, 0, 9) .attr(OrderUpStatBoostAttr) .makesContact(false), new AttackMove(Moves.JET_PUNCH, PokemonType.WATER, MoveCategory.PHYSICAL, 60, 100, 15, -1, 1, 9) @@ -11072,7 +11071,7 @@ export function initMoves() { .attr(CutHpStatStageBoostAttr, [ Stat.ATK, Stat.SPATK, Stat.SPD ], 2, 2), new AttackMove(Moves.KOWTOW_CLEAVE, PokemonType.DARK, MoveCategory.PHYSICAL, 85, -1, 10, -1, 0, 9) .slicingMove(), - new AttackMove(Moves.FLOWER_TRICK, PokemonType.GRASS, MoveCategory.PHYSICAL, 70, -1, 10, 100, 0, 9) + new AttackMove(Moves.FLOWER_TRICK, PokemonType.GRASS, MoveCategory.PHYSICAL, 70, -1, 10, -1, 0, 9) .attr(CritOnlyAttr) .makesContact(false), new AttackMove(Moves.TORCH_SONG, PokemonType.FIRE, MoveCategory.SPECIAL, 80, 100, 10, 100, 0, 9) @@ -11191,7 +11190,7 @@ export function initMoves() { .attr(StatusEffectAttr, StatusEffect.BURN) .target(MoveTarget.ALL_NEAR_ENEMIES) .triageMove(), - new AttackMove(Moves.SYRUP_BOMB, PokemonType.GRASS, MoveCategory.SPECIAL, 60, 85, 10, -1, 0, 9) + new AttackMove(Moves.SYRUP_BOMB, PokemonType.GRASS, MoveCategory.SPECIAL, 60, 85, 10, 100, 0, 9) .attr(AddBattlerTagAttr, BattlerTagType.SYRUP_BOMB, false, false, 3) .ballBombMove(), new AttackMove(Moves.IVY_CUDGEL, PokemonType.GRASS, MoveCategory.PHYSICAL, 100, 100, 10, -1, 0, 9) @@ -11209,7 +11208,8 @@ export function initMoves() { .partial(), /** Does not ignore abilities that affect stats, relevant in determining the move's category {@see TeraMoveCategoryAttr} */ new AttackMove(Moves.FICKLE_BEAM, PokemonType.DRAGON, MoveCategory.SPECIAL, 80, 100, 5, 30, 0, 9) .attr(PreMoveMessageAttr, doublePowerChanceMessageFunc) - .attr(DoublePowerChanceAttr), + .attr(DoublePowerChanceAttr) + .edgeCase(), // Should not interact with Sheer Force new SelfStatusMove(Moves.BURNING_BULWARK, PokemonType.FIRE, -1, 10, -1, 4, 9) .attr(ProtectAttr, BattlerTagType.BURNING_BULWARK) .condition(failIfLastCondition), @@ -11232,7 +11232,7 @@ export function initMoves() { new StatusMove(Moves.DRAGON_CHEER, PokemonType.DRAGON, -1, 15, -1, 0, 9) .attr(AddBattlerTagAttr, BattlerTagType.DRAGON_CHEER, false, true) .target(MoveTarget.NEAR_ALLY), - new AttackMove(Moves.ALLURING_VOICE, PokemonType.FAIRY, MoveCategory.SPECIAL, 80, 100, 10, -1, 0, 9) + new AttackMove(Moves.ALLURING_VOICE, PokemonType.FAIRY, MoveCategory.SPECIAL, 80, 100, 10, 100, 0, 9) .attr(AddBattlerTagIfBoostedAttr, BattlerTagType.CONFUSED) .soundBased(), new AttackMove(Moves.TEMPER_FLARE, PokemonType.FIRE, MoveCategory.PHYSICAL, 75, 100, 10, -1, 0, 9) @@ -11241,7 +11241,7 @@ export function initMoves() { .attr(MissEffectAttr, crashDamageFunc) .attr(NoEffectAttr, crashDamageFunc) .recklessMove(), - new AttackMove(Moves.PSYCHIC_NOISE, PokemonType.PSYCHIC, MoveCategory.SPECIAL, 75, 100, 10, -1, 0, 9) + new AttackMove(Moves.PSYCHIC_NOISE, PokemonType.PSYCHIC, MoveCategory.SPECIAL, 75, 100, 10, 100, 0, 9) .soundBased() .attr(AddBattlerTagAttr, BattlerTagType.HEAL_BLOCK, false, false, 2), new AttackMove(Moves.UPPER_HAND, PokemonType.FIGHTING, MoveCategory.PHYSICAL, 65, 100, 15, 100, 3, 9) diff --git a/test/abilities/sheer_force.test.ts b/test/abilities/sheer_force.test.ts index 4a1c20cde5c..fae089958a5 100644 --- a/test/abilities/sheer_force.test.ts +++ b/test/abilities/sheer_force.test.ts @@ -34,7 +34,7 @@ describe("Abilities - Sheer Force", () => { .disableCrits(); }); - const SHEER_FORCE_MULT = 5461 / 4096; + const SHEER_FORCE_MULT = 1.3; it("Sheer Force should boost the power of the move but disable secondary effects", async () => { game.override.moveset([Moves.AIR_SLASH]); diff --git a/test/moves/burning_jealousy.test.ts b/test/moves/burning_jealousy.test.ts index 60387df4226..04966b24206 100644 --- a/test/moves/burning_jealousy.test.ts +++ b/test/moves/burning_jealousy.test.ts @@ -89,7 +89,7 @@ describe("Moves - Burning Jealousy", () => { await game.phaseInterceptor.to("BerryPhase"); expect(allMoves[Moves.BURNING_JEALOUSY].calculateBattlePower).toHaveReturnedWith( - (allMoves[Moves.BURNING_JEALOUSY].power * 5461) / 4096, + allMoves[Moves.BURNING_JEALOUSY].power * 1.3, ); }); }); diff --git a/test/moves/order_up.test.ts b/test/moves/order_up.test.ts index 516f7f625a3..f25114c12de 100644 --- a/test/moves/order_up.test.ts +++ b/test/moves/order_up.test.ts @@ -65,23 +65,4 @@ describe("Moves - Order Up", () => { affectedStats.forEach(st => expect(dondozo.getStatStage(st)).toBe(st === stat ? 3 : 2)); }, ); - - it("should be boosted by Sheer Force while still applying a stat boost", async () => { - game.override.passiveAbility(Abilities.SHEER_FORCE).starterForms({ [Species.TATSUGIRI]: 0 }); - - await game.classicMode.startBattle([Species.TATSUGIRI, Species.DONDOZO]); - - const [tatsugiri, dondozo] = game.scene.getPlayerField(); - - expect(game.scene.triggerPokemonBattleAnim).toHaveBeenLastCalledWith(tatsugiri, PokemonAnimType.COMMANDER_APPLY); - expect(dondozo.getTag(BattlerTagType.COMMANDED)).toBeDefined(); - - game.move.select(Moves.ORDER_UP, 1, BattlerIndex.ENEMY); - expect(game.scene.currentBattle.turnCommands[0]?.skip).toBeTruthy(); - - await game.phaseInterceptor.to("BerryPhase", false); - - expect(dondozo.battleData.abilitiesApplied.includes(Abilities.SHEER_FORCE)).toBeTruthy(); - expect(dondozo.getStatStage(Stat.ATK)).toBe(3); - }); }); From b2bab46e1cd7b12363c9220835dcfc9b5f839b98 Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Wed, 16 Apr 2025 23:47:49 -0500 Subject: [PATCH 11/13] [Bug][Ability] Fix healer queueing its message when its ally is fainted (#5642) * Add check against faint status effect * Add tests for healer * Remove redundant portions of the tests * Fix broken test --- src/data/abilities/ability.ts | 4 +- test/abilities/healer.test.ts | 97 +++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 test/abilities/healer.test.ts diff --git a/src/data/abilities/ability.ts b/src/data/abilities/ability.ts index 43a6cd5901b..ab07d406868 100644 --- a/src/data/abilities/ability.ts +++ b/src/data/abilities/ability.ts @@ -4033,7 +4033,9 @@ export class PostTurnResetStatusAbAttr extends PostTurnAbAttr { } else { this.target = pokemon; } - return !isNullOrUndefined(this.target?.status); + + const effect = this.target?.status?.effect; + return !!effect && effect !== StatusEffect.FAINT; } override applyPostTurn(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): void { diff --git a/test/abilities/healer.test.ts b/test/abilities/healer.test.ts new file mode 100644 index 00000000000..35aa74209b4 --- /dev/null +++ b/test/abilities/healer.test.ts @@ -0,0 +1,97 @@ +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import { StatusEffect } from "#enums/status-effect"; +import GameManager from "#test/testUtils/gameManager"; +import Phaser from "phaser"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi, type MockInstance } from "vitest"; +import { isNullOrUndefined } from "#app/utils"; +import { PostTurnResetStatusAbAttr } from "#app/data/abilities/ability"; +import { allAbilities } from "#app/data/data-lists"; +import type Pokemon from "#app/field/pokemon"; + +describe("Abilities - Healer", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + let healerAttrSpy: MockInstance; + let healerAttr: PostTurnResetStatusAbAttr; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + healerAttrSpy.mockRestore(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override + .moveset([Moves.SPLASH]) + .ability(Abilities.BALL_FETCH) + .battleType("double") + .disableCrits() + .enemySpecies(Species.MAGIKARP) + .enemyAbility(Abilities.BALL_FETCH) + .enemyMoveset(Moves.SPLASH); + + healerAttr = allAbilities[Abilities.HEALER].getAttrs(PostTurnResetStatusAbAttr)[0]; + healerAttrSpy = vi + .spyOn(healerAttr, "getCondition") + .mockReturnValue((pokemon: Pokemon) => !isNullOrUndefined(pokemon.getAlly())); + }); + + it("should not queue a message phase for healing if the ally has fainted", async () => { + game.override.moveset([Moves.SPLASH, Moves.LUNAR_DANCE]); + await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]); + const user = game.scene.getPlayerPokemon()!; + // Only want one magikarp to have the ability. + vi.spyOn(user, "getAbility").mockReturnValue(allAbilities[Abilities.HEALER]); + game.move.select(Moves.SPLASH); + // faint the ally + game.move.select(Moves.LUNAR_DANCE, 1); + const abSpy = vi.spyOn(healerAttr, "canApplyPostTurn"); + await game.phaseInterceptor.to("TurnEndPhase"); + + // It's not enough to just test that the ally still has its status. + // We need to ensure that the ability failed to meet its condition + expect(abSpy).toHaveReturnedWith(false); + + // Explicitly restore the mock to ensure pollution doesn't happen + abSpy.mockRestore(); + }); + + it("should heal the status of an ally if the ally has a status", async () => { + await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]); + const [user, ally] = game.scene.getPlayerField(); + // Only want one magikarp to have the ability. + vi.spyOn(user, "getAbility").mockReturnValue(allAbilities[Abilities.HEALER]); + expect(ally.trySetStatus(StatusEffect.BURN)).toBe(true); + game.move.select(Moves.SPLASH); + game.move.select(Moves.SPLASH, 1); + + await game.phaseInterceptor.to("TurnEndPhase"); + await game.toNextTurn(); + + expect(ally.status?.effect, "status effect was not healed").toBeFalsy(); + }); + + // TODO: Healer is currently checked before the + it.todo("should heal a burn before its end of turn damage", async () => { + await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]); + const [user, ally] = game.scene.getPlayerField(); + // Only want one magikarp to have the ability. + vi.spyOn(user, "getAbility").mockReturnValue(allAbilities[Abilities.HEALER]); + expect(ally.trySetStatus(StatusEffect.BURN)).toBe(true); + game.move.select(Moves.SPLASH); + game.move.select(Moves.SPLASH, 1); + await game.phaseInterceptor.to("TurnEndPhase"); + await game.toNextTurn(); + + expect(ally.status?.effect, "status effect was not healed").toBeFalsy(); + expect(ally.hp).toBe(ally.getMaxHp()); + }); +}); From 45a2f426024e8221f4756f524f6bda93b5cc6a5f Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Thu, 17 Apr 2025 10:44:50 -0500 Subject: [PATCH 12/13] [Bug] Prevent game from hanging when loading in a new battle (#5676) --- src/field/pokemon.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index cdd48f7d940..ce36a40697b 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -840,12 +840,17 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { await Promise.allSettled(loadPromises); - // Wait for the assets we queued to load to finish loading, then... + // This must be initiated before we queue loading, otherwise the load could have finished before + // we reach the line of code that adds the listener, causing a deadlock. + const waitOnLoadPromise = new Promise(resolve => globalScene.load.once(Phaser.Loader.Events.COMPLETE, resolve)); + if (!globalScene.load.isLoading()) { globalScene.load.start(); } + + // Wait for the assets we queued to load to finish loading, then... // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#creating_a_promise_around_an_old_callback_api - await new Promise(resolve => globalScene.load.once(Phaser.Loader.Events.COMPLETE, resolve)); + await waitOnLoadPromise; // With the sprites loaded, generate the animation frame information if (this.isPlayer()) { From eef8367caf028e84213924fa0673a9e58927991f Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Thu, 17 Apr 2025 11:57:30 -0500 Subject: [PATCH 13/13] [Bug] Fix experimental sprites not loading in starter select (#5664) [Bug][Sprite] Fix experimental variant sprites not being loaded in starter select screen --- src/data/pokemon-species.ts | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index a27c00121dc..75ea07edd40 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -27,11 +27,12 @@ import { } from "#app/data/balance/pokemon-level-moves"; import type { Stat } from "#enums/stat"; import type { Variant, VariantSet } from "#app/sprites/variant"; -import { variantData } from "#app/sprites/variant"; +import { populateVariantColorCache, variantData } from "#app/sprites/variant"; import { speciesStarterCosts, POKERUS_STARTER_COUNT } from "#app/data/balance/starters"; import { SpeciesFormKey } from "#enums/species-form-key"; import { starterPassiveAbilities } from "#app/data/balance/passives"; import { loadPokemonVariantAssets } from "#app/sprites/pokemon-sprite"; +import { hasExpSprite } from "#app/sprites/sprite-utils"; export enum Region { NORMAL, @@ -388,8 +389,7 @@ export abstract class PokemonSpeciesForm { return `${/_[1-3]$/.test(spriteId) ? "variant/" : ""}${spriteId}`; } - /** Compute the sprite ID of the pokemon form. */ - getSpriteId(female: boolean, formIndex?: number, shiny?: boolean, variant = 0, back?: boolean): string { + getBaseSpriteKey(female: boolean, formIndex?: number): string { if (formIndex === undefined || this instanceof PokemonForm) { formIndex = this.formIndex; } @@ -400,7 +400,12 @@ export abstract class PokemonSpeciesForm { female && ![SpeciesFormKey.MEGA, SpeciesFormKey.GIGANTAMAX].includes(formSpriteKey as SpeciesFormKey); - const baseSpriteKey = `${showGenderDiffs ? "female__" : ""}${this.speciesId}${formSpriteKey ? `-${formSpriteKey}` : ""}`; + return `${showGenderDiffs ? "female__" : ""}${this.speciesId}${formSpriteKey ? `-${formSpriteKey}` : ""}`; + } + + /** Compute the sprite ID of the pokemon form. */ + getSpriteId(female: boolean, formIndex?: number, shiny?: boolean, variant = 0, back?: boolean): string { + const baseSpriteKey = this.getBaseSpriteKey(female, formIndex); let config = variantData; `${back ? "back__" : ""}${baseSpriteKey}`.split("__").map(p => (config ? (config = config[p]) : null)); @@ -597,10 +602,19 @@ export abstract class PokemonSpeciesForm { startLoad = false, back = false, ): Promise { + // We need to populate the color cache for this species' variant const spriteKey = this.getSpriteKey(female, formIndex, shiny, variant, back); globalScene.loadPokemonAtlas(spriteKey, this.getSpriteAtlasPath(female, formIndex, shiny, variant, back)); globalScene.load.audio(this.getCryKey(formIndex), `audio/${this.getCryKey(formIndex)}.m4a`); + const baseSpriteKey = this.getBaseSpriteKey(female, formIndex); + + // Force the variant color cache to be loaded for the form + await populateVariantColorCache( + "pkmn__" + baseSpriteKey, + globalScene.experimentalSprites && hasExpSprite(spriteKey), + baseSpriteKey, + ); return new Promise(resolve => { globalScene.load.once(Phaser.Loader.Events.COMPLETE, () => { const originalWarn = console.warn;