mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 07:22:19 +02:00
Untangle circular deps from modifiers
This commit is contained in:
parent
5c9697e36a
commit
6ad06526ed
@ -58,12 +58,12 @@ import {
|
|||||||
getEnemyModifierTypesForWave,
|
getEnemyModifierTypesForWave,
|
||||||
getLuckString,
|
getLuckString,
|
||||||
getLuckTextTint,
|
getLuckTextTint,
|
||||||
getModifierType,
|
|
||||||
getPartyLuckValue,
|
getPartyLuckValue,
|
||||||
modifierTypes,
|
|
||||||
PokemonHeldItemModifierType,
|
PokemonHeldItemModifierType,
|
||||||
} from "#app/modifier/modifier-type";
|
} from "#app/modifier/modifier-type";
|
||||||
import { getModifierPoolForType } from "./utils/modifier-pool-utils";
|
import { getModifierType } from "./utils/modifier-utils";
|
||||||
|
import { modifierTypes } from "./data/data-lists";
|
||||||
|
import { getModifierPoolForType } from "./utils/modifier-utils";
|
||||||
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
||||||
import AbilityBar from "#app/ui/ability-bar";
|
import AbilityBar from "#app/ui/ability-bar";
|
||||||
import { applyAbAttrs, applyPostBattleInitAbAttrs, applyPostItemLostAbAttrs } from "./data/abilities/apply-ab-attrs";
|
import { applyAbAttrs, applyPostBattleInitAbAttrs, applyPostItemLostAbAttrs } from "./data/abilities/apply-ab-attrs";
|
||||||
|
@ -13,7 +13,7 @@ import {
|
|||||||
import Trainer from "./field/trainer";
|
import Trainer from "./field/trainer";
|
||||||
import { TrainerVariant } from "#enums/trainer-variant";
|
import { TrainerVariant } from "#enums/trainer-variant";
|
||||||
import type { GameMode } from "./game-mode";
|
import type { GameMode } from "./game-mode";
|
||||||
import { MoneyMultiplierModifier, PokemonHeldItemModifier } from "./modifier/modifier";
|
import type { PokemonHeldItemModifier } from "./modifier/modifier";
|
||||||
import type { PokeballType } from "#enums/pokeball";
|
import type { PokeballType } from "#enums/pokeball";
|
||||||
import { trainerConfigs } from "#app/data/trainers/trainer-config";
|
import { trainerConfigs } from "#app/data/trainers/trainer-config";
|
||||||
import { SpeciesFormKey } from "#enums/species-form-key";
|
import { SpeciesFormKey } from "#enums/species-form-key";
|
||||||
@ -173,7 +173,7 @@ export default class Battle {
|
|||||||
this.postBattleLoot.push(
|
this.postBattleLoot.push(
|
||||||
...globalScene
|
...globalScene
|
||||||
.findModifiers(
|
.findModifiers(
|
||||||
m => m instanceof PokemonHeldItemModifier && m.pokemonId === enemyPokemon.id && m.isTransferable,
|
m => m.is("PokemonHeldItemModifier") && m.pokemonId === enemyPokemon.id && m.isTransferable,
|
||||||
false,
|
false,
|
||||||
)
|
)
|
||||||
.map(i => {
|
.map(i => {
|
||||||
|
@ -11,7 +11,6 @@ import { MoveId } from "#enums/move-id";
|
|||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
import { SpeciesFormKey } from "#enums/species-form-key";
|
import { SpeciesFormKey } from "#enums/species-form-key";
|
||||||
import { TimeOfDay } from "#enums/time-of-day";
|
import { TimeOfDay } from "#enums/time-of-day";
|
||||||
import { DamageMoneyRewardModifier, ExtraModifierModifier, MoneyMultiplierModifier, SpeciesStatBoosterModifier, TempExtraModifierModifier } from "#app/modifier/modifier";
|
|
||||||
import type { SpeciesStatBoosterModifierType } from "#app/modifier/modifier-type";
|
import type { SpeciesStatBoosterModifierType } from "#app/modifier/modifier-type";
|
||||||
import { speciesStarterCosts } from "./starters";
|
import { speciesStarterCosts } from "./starters";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
@ -275,9 +274,9 @@ class MoveTypeEvolutionCondition extends SpeciesEvolutionCondition {
|
|||||||
class TreasureEvolutionCondition extends SpeciesEvolutionCondition {
|
class TreasureEvolutionCondition extends SpeciesEvolutionCondition {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(p => p.evoCounter
|
super(p => p.evoCounter
|
||||||
+ p.getHeldItems().filter(m => m instanceof DamageMoneyRewardModifier).length
|
+ p.getHeldItems().filter(m => m.is("DamageMoneyRewardModifier")).length
|
||||||
+ globalScene.findModifiers(m => m instanceof MoneyMultiplierModifier
|
+ globalScene.findModifiers(m => m.is("MoneyMultiplierModifier")
|
||||||
|| m instanceof ExtraModifierModifier || m instanceof TempExtraModifierModifier).length > 9);
|
|| m.is("ExtraModifierModifier") || m.is("TempExtraModifierModifier")).length > 9);
|
||||||
this.description = i18next.t("pokemonEvolutions:treasure");
|
this.description = i18next.t("pokemonEvolutions:treasure");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1794,8 +1793,8 @@ export const pokemonEvolutions: PokemonEvolutions = {
|
|||||||
],
|
],
|
||||||
[SpeciesId.CLAMPERL]: [
|
[SpeciesId.CLAMPERL]: [
|
||||||
// TODO: Change the SpeciesEvolutionConditions here to use a bespoke HeldItemEvolutionCondition after the modifier rework
|
// TODO: Change the SpeciesEvolutionConditions here to use a bespoke HeldItemEvolutionCondition after the modifier rework
|
||||||
new SpeciesEvolution(SpeciesId.HUNTAIL, 1, EvolutionItem.LINKING_CORD, new SpeciesEvolutionCondition(p => p.getHeldItems().some(m => m instanceof SpeciesStatBoosterModifier && (m.type as SpeciesStatBoosterModifierType).key === "DEEP_SEA_TOOTH")), SpeciesWildEvolutionDelay.VERY_LONG),
|
new SpeciesEvolution(SpeciesId.HUNTAIL, 1, EvolutionItem.LINKING_CORD, new SpeciesEvolutionCondition(p => p.getHeldItems().some(m => m.is("SpeciesStatBoosterModifier") && (m.type as SpeciesStatBoosterModifierType).key === "DEEP_SEA_TOOTH")), SpeciesWildEvolutionDelay.VERY_LONG),
|
||||||
new SpeciesEvolution(SpeciesId.GOREBYSS, 1, EvolutionItem.LINKING_CORD, new SpeciesEvolutionCondition(p => p.getHeldItems().some(m => m instanceof SpeciesStatBoosterModifier && (m.type as SpeciesStatBoosterModifierType).key === "DEEP_SEA_SCALE")), SpeciesWildEvolutionDelay.VERY_LONG)
|
new SpeciesEvolution(SpeciesId.GOREBYSS, 1, EvolutionItem.LINKING_CORD, new SpeciesEvolutionCondition(p => p.getHeldItems().some(m => m.is("SpeciesStatBoosterModifier") && (m.type as SpeciesStatBoosterModifierType).key === "DEEP_SEA_SCALE")), SpeciesWildEvolutionDelay.VERY_LONG)
|
||||||
],
|
],
|
||||||
[SpeciesId.BOLDORE]: [
|
[SpeciesId.BOLDORE]: [
|
||||||
new SpeciesEvolution(SpeciesId.GIGALITH, 1, EvolutionItem.LINKING_CORD, null, SpeciesWildEvolutionDelay.VERY_LONG)
|
new SpeciesEvolution(SpeciesId.GIGALITH, 1, EvolutionItem.LINKING_CORD, null, SpeciesWildEvolutionDelay.VERY_LONG)
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
|
import type { ModifierTypes } from "#app/modifier/modifier-type";
|
||||||
import type { Ability } from "./abilities/ability";
|
import type { Ability } from "./abilities/ability";
|
||||||
import type Move from "./moves/move";
|
import type Move from "./moves/move";
|
||||||
|
|
||||||
export const allAbilities: Ability[] = [];
|
export const allAbilities: Ability[] = [];
|
||||||
export const allMoves: Move[] = [];
|
export const allMoves: Move[] = [];
|
||||||
|
|
||||||
|
// TODO: Figure out what this is used for and provide an appropriate tsdoc comment
|
||||||
|
export const modifierTypes = {} as ModifierTypes;
|
||||||
|
@ -20,7 +20,7 @@ import type { IEggOptions } from "#app/data/egg";
|
|||||||
import { EggSourceType } from "#enums/egg-source-types";
|
import { EggSourceType } from "#enums/egg-source-types";
|
||||||
import { EggTier } from "#enums/egg-type";
|
import { EggTier } from "#enums/egg-type";
|
||||||
import { ModifierTier } from "#enums/modifier-tier";
|
import { ModifierTier } from "#enums/modifier-tier";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
||||||
|
|
||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
|
@ -10,7 +10,7 @@ import type Pokemon from "#app/field/pokemon";
|
|||||||
import { EnemyPokemon } from "#app/field/pokemon";
|
import { EnemyPokemon } from "#app/field/pokemon";
|
||||||
import { PokemonMove } from "#app/data/moves/pokemon-move";
|
import { PokemonMove } from "#app/data/moves/pokemon-move";
|
||||||
import type { BerryModifierType, PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
import type { BerryModifierType, PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
|
@ -4,7 +4,7 @@ import {
|
|||||||
setEncounterExp,
|
setEncounterExp,
|
||||||
updatePlayerMoney,
|
updatePlayerMoney,
|
||||||
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
|
@ -12,7 +12,8 @@ import {
|
|||||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import type { BerryModifierType, ModifierTypeOption } from "#app/modifier/modifier-type";
|
import type { BerryModifierType, ModifierTypeOption } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes, regenerateModifierPoolThresholds } from "#app/modifier/modifier-type";
|
import { regenerateModifierPoolThresholds } from "#app/modifier/modifier-type";
|
||||||
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
||||||
import { randSeedInt } from "#app/utils/common";
|
import { randSeedInt } from "#app/utils/common";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
|
@ -38,7 +38,7 @@ import {
|
|||||||
} from "#app/data/mystery-encounters/mystery-encounter-requirements";
|
} from "#app/data/mystery-encounters/mystery-encounter-requirements";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import type { AttackTypeBoosterModifierType, ModifierTypeOption } from "#app/modifier/modifier-type";
|
import type { AttackTypeBoosterModifierType, ModifierTypeOption } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import type { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
import type { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||||
import {
|
import {
|
||||||
AttackTypeBoosterModifier,
|
AttackTypeBoosterModifier,
|
||||||
|
@ -13,7 +13,7 @@ import { TrainerPartyCompoundTemplate } from "#app/data/trainers/TrainerPartyTem
|
|||||||
import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate";
|
import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate";
|
||||||
import { ModifierTier } from "#enums/modifier-tier";
|
import { ModifierTier } from "#enums/modifier-tier";
|
||||||
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { PartyMemberStrength } from "#enums/party-member-strength";
|
import { PartyMemberStrength } from "#enums/party-member-strength";
|
||||||
|
@ -26,7 +26,7 @@ import type Pokemon from "#app/field/pokemon";
|
|||||||
import { EnemyPokemon } from "#app/field/pokemon";
|
import { EnemyPokemon } from "#app/field/pokemon";
|
||||||
import { PokemonMove } from "#app/data/moves/pokemon-move";
|
import { PokemonMove } from "#app/data/moves/pokemon-move";
|
||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import PokemonData from "#app/system/pokemon-data";
|
import PokemonData from "#app/system/pokemon-data";
|
||||||
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
|
@ -3,7 +3,7 @@ import { isNullOrUndefined, randSeedInt } from "#app/utils/common";
|
|||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||||
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter";
|
import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
|
@ -28,7 +28,7 @@ import {
|
|||||||
PreserveBerryModifier,
|
PreserveBerryModifier,
|
||||||
} from "#app/modifier/modifier";
|
} from "#app/modifier/modifier";
|
||||||
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import i18next from "#app/plugins/i18n";
|
import i18next from "#app/plugins/i18n";
|
||||||
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
||||||
import { randSeedItem } from "#app/utils/common";
|
import { randSeedItem } from "#app/utils/common";
|
||||||
|
@ -3,7 +3,7 @@ import {
|
|||||||
setEncounterRewards,
|
setEncounterRewards,
|
||||||
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import type { ModifierTypeFunc } from "#app/@types/modifier-types";
|
import type { ModifierTypeFunc } from "#app/@types/modifier-types";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { randSeedInt } from "#app/utils/common";
|
import { randSeedInt } from "#app/utils/common";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
|
@ -9,7 +9,7 @@ import {
|
|||||||
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||||
import type { PokemonMove } from "#app/data/moves/pokemon-move";
|
import type { PokemonMove } from "#app/data/moves/pokemon-move";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
|
@ -10,7 +10,7 @@ import {
|
|||||||
generateModifierType,
|
generateModifierType,
|
||||||
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import type { AttackTypeBoosterModifierType } from "#app/modifier/modifier-type";
|
import type { AttackTypeBoosterModifierType } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
|
@ -26,7 +26,7 @@ import { PlayerGender } from "#enums/player-gender";
|
|||||||
import { getPokeballAtlasKey, getPokeballTintColor } from "#app/data/pokeball";
|
import { getPokeballAtlasKey, getPokeballTintColor } from "#app/data/pokeball";
|
||||||
import { addPokeballOpenParticles } from "#app/field/anims";
|
import { addPokeballOpenParticles } from "#app/field/anims";
|
||||||
import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms/form-change-triggers";
|
import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms/form-change-triggers";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { Nature } from "#enums/nature";
|
import { Nature } from "#enums/nature";
|
||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
||||||
import { isPokemonValidForEncounterOptionSelection } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
import { isPokemonValidForEncounterOptionSelection } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
||||||
|
@ -8,7 +8,7 @@ import { trainerPartyTemplates } from "#app/data/trainers/TrainerPartyTemplate";
|
|||||||
import { TrainerPartyCompoundTemplate } from "#app/data/trainers/TrainerPartyTemplate";
|
import { TrainerPartyCompoundTemplate } from "#app/data/trainers/TrainerPartyTemplate";
|
||||||
import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate";
|
import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate";
|
||||||
import { ModifierTier } from "#enums/modifier-tier";
|
import { ModifierTier } from "#enums/modifier-tier";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { PartyMemberStrength } from "#enums/party-member-strength";
|
import { PartyMemberStrength } from "#enums/party-member-strength";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { randSeedInt } from "#app/utils/common";
|
import { randSeedInt } from "#app/utils/common";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { STEALING_MOVES } from "#app/data/mystery-encounters/requirements/requirement-groups";
|
import { STEALING_MOVES } from "#app/data/mystery-encounters/requirements/requirement-groups";
|
||||||
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
|
@ -23,7 +23,8 @@ import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode
|
|||||||
import { BiomeId } from "#enums/biome-id";
|
import { BiomeId } from "#enums/biome-id";
|
||||||
import { getBiomeKey } from "#app/field/arena";
|
import { getBiomeKey } from "#app/field/arena";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import { getPartyLuckValue, modifierTypes } from "#app/modifier/modifier-type";
|
import { getPartyLuckValue } from "#app/modifier/modifier-type";
|
||||||
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { TrainerSlot } from "#enums/trainer-slot";
|
import { TrainerSlot } from "#enums/trainer-slot";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { getPokemonNameWithAffix } from "#app/messages";
|
import { getPokemonNameWithAffix } from "#app/messages";
|
||||||
|
@ -26,7 +26,7 @@ import { EggSourceType } from "#enums/egg-source-types";
|
|||||||
import { EggTier } from "#enums/egg-type";
|
import { EggTier } from "#enums/egg-type";
|
||||||
import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option";
|
import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option";
|
||||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import { getPokeballTintColor } from "#app/data/pokeball";
|
import { getPokeballTintColor } from "#app/data/pokeball";
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
generateModifierType,
|
generateModifierType,
|
||||||
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
transitionMysteryEncounterIntroVisuals,
|
transitionMysteryEncounterIntroVisuals,
|
||||||
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
transitionMysteryEncounterIntroVisuals,
|
transitionMysteryEncounterIntroVisuals,
|
||||||
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
|
@ -25,7 +25,7 @@ import { HiddenAbilityRateBoosterModifier, PokemonFormChangeItemModifier } from
|
|||||||
import { achvs } from "#app/system/achv";
|
import { achvs } from "#app/system/achv";
|
||||||
import { showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
import { showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
||||||
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import i18next from "#app/plugins/i18n";
|
import i18next from "#app/plugins/i18n";
|
||||||
import {
|
import {
|
||||||
doPokemonTransformationSequence,
|
doPokemonTransformationSequence,
|
||||||
|
@ -19,9 +19,9 @@ import {
|
|||||||
getPartyLuckValue,
|
getPartyLuckValue,
|
||||||
ModifierTypeGenerator,
|
ModifierTypeGenerator,
|
||||||
ModifierTypeOption,
|
ModifierTypeOption,
|
||||||
modifierTypes,
|
|
||||||
regenerateModifierPoolThresholds,
|
regenerateModifierPoolThresholds,
|
||||||
} from "#app/modifier/modifier-type";
|
} from "#app/modifier/modifier-type";
|
||||||
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
||||||
import type PokemonData from "#app/system/pokemon-data";
|
import type PokemonData from "#app/system/pokemon-data";
|
||||||
import type { OptionSelectConfig, OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
import type { OptionSelectConfig, OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
||||||
|
@ -29,7 +29,7 @@ import {
|
|||||||
} from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
} from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
||||||
import { getPokemonNameWithAffix } from "#app/messages";
|
import { getPokemonNameWithAffix } from "#app/messages";
|
||||||
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { Gender } from "#app/data/gender";
|
import { Gender } from "#app/data/gender";
|
||||||
import type { PermanentStat } from "#enums/stat";
|
import type { PermanentStat } from "#enums/stat";
|
||||||
import { SummaryUiMode } from "#app/ui/summary-ui-handler";
|
import { SummaryUiMode } from "#app/ui/summary-ui-handler";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "../data-lists";
|
||||||
import { PokemonMove } from "../moves/pokemon-move";
|
import { PokemonMove } from "../moves/pokemon-move";
|
||||||
import { toReadableString, isNullOrUndefined, randSeedItem, randSeedInt, randSeedIntRange } from "#app/utils/common";
|
import { toReadableString, isNullOrUndefined, randSeedItem, randSeedInt, randSeedIntRange } from "#app/utils/common";
|
||||||
import { pokemonEvolutions, pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions";
|
import { pokemonEvolutions, pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions";
|
||||||
|
@ -7,16 +7,11 @@ import {
|
|||||||
wildModifierPool,
|
wildModifierPool,
|
||||||
} from "#app/modifier/modifier-pools";
|
} from "#app/modifier/modifier-pools";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import {
|
import { DoubleBattleChanceBoosterModifier, SpeciesCritBoosterModifier, TurnStatusEffectModifier } from "./modifier";
|
||||||
DoubleBattleChanceBoosterModifier,
|
|
||||||
ResetNegativeStatStageModifier,
|
|
||||||
SpeciesCritBoosterModifier,
|
|
||||||
TurnStatusEffectModifier,
|
|
||||||
} from "./modifier";
|
|
||||||
import { WeightedModifierType } from "./modifier-type";
|
import { WeightedModifierType } from "./modifier-type";
|
||||||
import { ModifierTier } from "../enums/modifier-tier";
|
import { ModifierTier } from "../enums/modifier-tier";
|
||||||
import type { WeightedModifierTypeWeightFunc } from "#app/@types/modifier-types";
|
import type { WeightedModifierTypeWeightFunc } from "#app/@types/modifier-types";
|
||||||
import { modifierTypes } from "./modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { PokeballType } from "#enums/pokeball";
|
import { PokeballType } from "#enums/pokeball";
|
||||||
import { BerryModifier } from "./modifier";
|
import { BerryModifier } from "./modifier";
|
||||||
import { BerryType } from "#enums/berry-type";
|
import { BerryType } from "#enums/berry-type";
|
||||||
|
@ -2,7 +2,7 @@ import { globalScene } from "#app/global-scene";
|
|||||||
import { EvolutionItem, pokemonEvolutions } from "#app/data/balance/pokemon-evolutions";
|
import { EvolutionItem, pokemonEvolutions } from "#app/data/balance/pokemon-evolutions";
|
||||||
import { tmPoolTiers, tmSpecies } from "#app/data/balance/tms";
|
import { tmPoolTiers, tmSpecies } from "#app/data/balance/tms";
|
||||||
import { getBerryEffectDescription, getBerryName } from "#app/data/berry";
|
import { getBerryEffectDescription, getBerryName } from "#app/data/berry";
|
||||||
import { allMoves } from "#app/data/data-lists";
|
import { allMoves, modifierTypes } from "#app/data/data-lists";
|
||||||
import { getNatureName, getNatureStatMultiplier } from "#app/data/nature";
|
import { getNatureName, getNatureStatMultiplier } from "#app/data/nature";
|
||||||
import { getPokeballCatchMultiplier, getPokeballName } from "#app/data/pokeball";
|
import { getPokeballCatchMultiplier, getPokeballName } from "#app/data/pokeball";
|
||||||
import { pokemonFormChanges, SpeciesFormChangeCondition } from "#app/data/pokemon-forms";
|
import { pokemonFormChanges, SpeciesFormChangeCondition } from "#app/data/pokemon-forms";
|
||||||
@ -127,10 +127,12 @@ import { timedEventManager } from "#app/global-event-manager";
|
|||||||
import { TYPE_BOOST_ITEM_BOOST_PERCENT } from "#app/constants";
|
import { TYPE_BOOST_ITEM_BOOST_PERCENT } from "#app/constants";
|
||||||
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
||||||
|
|
||||||
|
import { getModifierPoolForType, getModifierType } from "#app/utils/modifier-utils";
|
||||||
import { getModifierPoolForType } from "#app/utils/modifier-pool-utils";
|
|
||||||
import type { ModifierTypeFunc, WeightedModifierTypeWeightFunc } from "#app/@types/modifier-types";
|
import type { ModifierTypeFunc, WeightedModifierTypeWeightFunc } from "#app/@types/modifier-types";
|
||||||
|
|
||||||
|
// biome-ignore lint/correctness/noUnusedImports: This import is used in a
|
||||||
|
import type { initModifierPools } from "./init-modifier-pools";
|
||||||
|
|
||||||
const outputModifierData = false;
|
const outputModifierData = false;
|
||||||
const useMaxWeightForOutput = false;
|
const useMaxWeightForOutput = false;
|
||||||
|
|
||||||
@ -145,6 +147,19 @@ export class ModifierType {
|
|||||||
public tier: ModifierTier;
|
public tier: ModifierTier;
|
||||||
protected newModifierFunc: NewModifierFunc | null;
|
protected newModifierFunc: NewModifierFunc | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the modifier type is of a specific type
|
||||||
|
* @param modifierType - The type to check against
|
||||||
|
* @return Whether the modifier type is of the specified type
|
||||||
|
*/
|
||||||
|
public is<K extends ModifierTypeString>(modifierType: K): this is ModifierTypeInstanceMap[K] {
|
||||||
|
const targetType = ModifierTypeConstructorMap[modifierType];
|
||||||
|
if (!targetType) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return this instanceof targetType;
|
||||||
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
localeKey: string | null,
|
localeKey: string | null,
|
||||||
iconImage: string | null,
|
iconImage: string | null,
|
||||||
@ -213,7 +228,7 @@ export class ModifierType {
|
|||||||
* @param func
|
* @param func
|
||||||
*/
|
*/
|
||||||
withIdFromFunc(func: ModifierTypeFunc): ModifierType {
|
withIdFromFunc(func: ModifierTypeFunc): ModifierType {
|
||||||
this.id = Object.keys(modifierTypes).find(k => modifierTypes[k] === func)!; // TODO: is this bang correct?
|
this.id = Object.keys(modifierTypeInitObj).find(k => modifierTypeInitObj[k] === func)!; // TODO: is this bang correct?
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1626,7 +1641,7 @@ class EvolutionItemModifierTypeGenerator extends ModifierTypeGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class FormChangeItemModifierTypeGenerator extends ModifierTypeGenerator {
|
export class FormChangeItemModifierTypeGenerator extends ModifierTypeGenerator {
|
||||||
constructor(isRareFormChangeItem: boolean) {
|
constructor(isRareFormChangeItem: boolean) {
|
||||||
super((party: Pokemon[], pregenArgs?: any[]) => {
|
super((party: Pokemon[], pregenArgs?: any[]) => {
|
||||||
if (pregenArgs && pregenArgs.length === 1 && pregenArgs[0] in FormChangeItem) {
|
if (pregenArgs && pregenArgs.length === 1 && pregenArgs[0] in FormChangeItem) {
|
||||||
@ -1789,7 +1804,6 @@ export class EnemyEndureChanceModifierType extends ModifierType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export class WeightedModifierType {
|
export class WeightedModifierType {
|
||||||
public modifierType: ModifierType;
|
public modifierType: ModifierType;
|
||||||
public weight: number | WeightedModifierTypeWeightFunc;
|
public weight: number | WeightedModifierTypeWeightFunc;
|
||||||
@ -1801,7 +1815,7 @@ export class WeightedModifierType {
|
|||||||
maxWeight?: number | WeightedModifierTypeWeightFunc,
|
maxWeight?: number | WeightedModifierTypeWeightFunc,
|
||||||
) {
|
) {
|
||||||
this.modifierType = modifierTypeFunc();
|
this.modifierType = modifierTypeFunc();
|
||||||
this.modifierType.id = Object.keys(modifierTypes).find(k => modifierTypes[k] === modifierTypeFunc)!; // TODO: is this bang correct?
|
this.modifierType.id = Object.keys(modifierTypeInitObj).find(k => modifierTypeInitObj[k] === modifierTypeFunc)!; // TODO: is this bang correct?
|
||||||
this.weight = weight;
|
this.weight = weight;
|
||||||
this.maxWeight = maxWeight || (!(weight instanceof Function) ? weight : 0);
|
this.maxWeight = maxWeight || (!(weight instanceof Function) ? weight : 0);
|
||||||
}
|
}
|
||||||
@ -1811,7 +1825,6 @@ export class WeightedModifierType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type BaseModifierOverride = {
|
type BaseModifierOverride = {
|
||||||
name: Exclude<ModifierTypeKeys, GeneratorModifierOverride["name"]>;
|
name: Exclude<ModifierTypeKeys, GeneratorModifierOverride["name"]>;
|
||||||
count?: number;
|
count?: number;
|
||||||
@ -1822,39 +1835,39 @@ export type GeneratorModifierOverride = {
|
|||||||
count?: number;
|
count?: number;
|
||||||
} & (
|
} & (
|
||||||
| {
|
| {
|
||||||
name: keyof Pick<typeof modifierTypes, "SPECIES_STAT_BOOSTER" | "RARE_SPECIES_STAT_BOOSTER">;
|
name: keyof Pick<typeof modifierTypeInitObj, "SPECIES_STAT_BOOSTER" | "RARE_SPECIES_STAT_BOOSTER">;
|
||||||
type?: SpeciesStatBoosterItem;
|
type?: SpeciesStatBoosterItem;
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
name: keyof Pick<typeof modifierTypes, "TEMP_STAT_STAGE_BOOSTER">;
|
name: keyof Pick<typeof modifierTypeInitObj, "TEMP_STAT_STAGE_BOOSTER">;
|
||||||
type?: TempBattleStat;
|
type?: TempBattleStat;
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
name: keyof Pick<typeof modifierTypes, "BASE_STAT_BOOSTER">;
|
name: keyof Pick<typeof modifierTypeInitObj, "BASE_STAT_BOOSTER">;
|
||||||
type?: Stat;
|
type?: Stat;
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
name: keyof Pick<typeof modifierTypes, "MINT">;
|
name: keyof Pick<typeof modifierTypeInitObj, "MINT">;
|
||||||
type?: Nature;
|
type?: Nature;
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
name: keyof Pick<typeof modifierTypes, "ATTACK_TYPE_BOOSTER" | "TERA_SHARD">;
|
name: keyof Pick<typeof modifierTypeInitObj, "ATTACK_TYPE_BOOSTER" | "TERA_SHARD">;
|
||||||
type?: PokemonType;
|
type?: PokemonType;
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
name: keyof Pick<typeof modifierTypes, "BERRY">;
|
name: keyof Pick<typeof modifierTypeInitObj, "BERRY">;
|
||||||
type?: BerryType;
|
type?: BerryType;
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
name: keyof Pick<typeof modifierTypes, "EVOLUTION_ITEM" | "RARE_EVOLUTION_ITEM">;
|
name: keyof Pick<typeof modifierTypeInitObj, "EVOLUTION_ITEM" | "RARE_EVOLUTION_ITEM">;
|
||||||
type?: EvolutionItem;
|
type?: EvolutionItem;
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
name: keyof Pick<typeof modifierTypes, "FORM_CHANGE_ITEM" | "RARE_FORM_CHANGE_ITEM">;
|
name: keyof Pick<typeof modifierTypeInitObj, "FORM_CHANGE_ITEM" | "RARE_FORM_CHANGE_ITEM">;
|
||||||
type?: FormChangeItem;
|
type?: FormChangeItem;
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
name: keyof Pick<typeof modifierTypes, "TM_COMMON" | "TM_GREAT" | "TM_ULTRA">;
|
name: keyof Pick<typeof modifierTypeInitObj, "TM_COMMON" | "TM_GREAT" | "TM_ULTRA">;
|
||||||
type?: MoveId;
|
type?: MoveId;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -1862,9 +1875,9 @@ export type GeneratorModifierOverride = {
|
|||||||
/** Type used to construct modifiers and held items for overriding purposes. */
|
/** Type used to construct modifiers and held items for overriding purposes. */
|
||||||
export type ModifierOverride = GeneratorModifierOverride | BaseModifierOverride;
|
export type ModifierOverride = GeneratorModifierOverride | BaseModifierOverride;
|
||||||
|
|
||||||
export type ModifierTypeKeys = keyof typeof modifierTypes;
|
export type ModifierTypeKeys = keyof typeof modifierTypeInitObj;
|
||||||
|
|
||||||
export const modifierTypes = {
|
const modifierTypeInitObj = Object.freeze({
|
||||||
POKEBALL: () => new AddPokeballModifierType("pb", PokeballType.POKEBALL, 5),
|
POKEBALL: () => new AddPokeballModifierType("pb", PokeballType.POKEBALL, 5),
|
||||||
GREAT_BALL: () => new AddPokeballModifierType("gb", PokeballType.GREAT_BALL, 5),
|
GREAT_BALL: () => new AddPokeballModifierType("gb", PokeballType.GREAT_BALL, 5),
|
||||||
ULTRA_BALL: () => new AddPokeballModifierType("ub", PokeballType.ULTRA_BALL, 5),
|
ULTRA_BALL: () => new AddPokeballModifierType("ub", PokeballType.ULTRA_BALL, 5),
|
||||||
@ -2373,23 +2386,18 @@ export const modifierTypes = {
|
|||||||
"golden_net",
|
"golden_net",
|
||||||
(type, _args) => new BoostBugSpawnModifier(type),
|
(type, _args) => new BoostBugSpawnModifier(type),
|
||||||
),
|
),
|
||||||
};
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The initial set of modifier types, used to generate the modifier pool.
|
||||||
|
*/
|
||||||
|
export type ModifierTypes = typeof modifierTypeInitObj;
|
||||||
|
|
||||||
export interface ModifierPool {
|
export interface ModifierPool {
|
||||||
[tier: string]: WeightedModifierType[];
|
[tier: string]: WeightedModifierType[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const modifierPool: ModifierPool = {};
|
||||||
const modifierPool: ModifierPool = {
|
|
||||||
};
|
|
||||||
|
|
||||||
export function getModifierType(modifierTypeFunc: ModifierTypeFunc): ModifierType {
|
|
||||||
const modifierType = modifierTypeFunc();
|
|
||||||
if (!modifierType.id) {
|
|
||||||
modifierType.id = Object.keys(modifierTypes).find(k => modifierTypes[k] === modifierTypeFunc)!; // TODO: is this bang correct?
|
|
||||||
}
|
|
||||||
return modifierType;
|
|
||||||
}
|
|
||||||
|
|
||||||
let modifierPoolThresholds = {};
|
let modifierPoolThresholds = {};
|
||||||
let ignoredPoolIndexes = {};
|
let ignoredPoolIndexes = {};
|
||||||
@ -2519,7 +2527,7 @@ export interface CustomModifierSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getModifierTypeFuncById(id: string): ModifierTypeFunc {
|
export function getModifierTypeFuncById(id: string): ModifierTypeFunc {
|
||||||
return modifierTypes[id];
|
return modifierTypeInitObj[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2572,12 +2580,12 @@ export function getPlayerModifierTypeOptions(
|
|||||||
customModifierSettings.guaranteedModifierTypeFuncs.length > 0
|
customModifierSettings.guaranteedModifierTypeFuncs.length > 0
|
||||||
) {
|
) {
|
||||||
customModifierSettings.guaranteedModifierTypeFuncs!.forEach((mod, _i) => {
|
customModifierSettings.guaranteedModifierTypeFuncs!.forEach((mod, _i) => {
|
||||||
const modifierId = Object.keys(modifierTypes).find(k => modifierTypes[k] === mod) as string;
|
const modifierId = Object.keys(modifierTypeInitObj).find(k => modifierTypeInitObj[k] === mod) as string;
|
||||||
let guaranteedMod: ModifierType = modifierTypes[modifierId]?.();
|
let guaranteedMod: ModifierType = modifierTypeInitObj[modifierId]?.();
|
||||||
|
|
||||||
// Populates item id and tier
|
// Populates item id and tier
|
||||||
guaranteedMod = guaranteedMod
|
guaranteedMod = guaranteedMod
|
||||||
.withIdFromFunc(modifierTypes[modifierId])
|
.withIdFromFunc(modifierTypeInitObj[modifierId])
|
||||||
.withTierFromPool(ModifierPoolType.PLAYER, party);
|
.withTierFromPool(ModifierPoolType.PLAYER, party);
|
||||||
|
|
||||||
const modType =
|
const modType =
|
||||||
@ -2656,7 +2664,7 @@ export function overridePlayerModifierTypeOptions(options: ModifierTypeOption[],
|
|||||||
const minLength = Math.min(options.length, Overrides.ITEM_REWARD_OVERRIDE.length);
|
const minLength = Math.min(options.length, Overrides.ITEM_REWARD_OVERRIDE.length);
|
||||||
for (let i = 0; i < minLength; i++) {
|
for (let i = 0; i < minLength; i++) {
|
||||||
const override: ModifierOverride = Overrides.ITEM_REWARD_OVERRIDE[i];
|
const override: ModifierOverride = Overrides.ITEM_REWARD_OVERRIDE[i];
|
||||||
const modifierFunc = modifierTypes[override.name];
|
const modifierFunc = modifierTypeInitObj[override.name];
|
||||||
let modifierType: ModifierType | null = modifierFunc();
|
let modifierType: ModifierType | null = modifierFunc();
|
||||||
|
|
||||||
if (modifierType instanceof ModifierTypeGenerator) {
|
if (modifierType instanceof ModifierTypeGenerator) {
|
||||||
@ -2677,29 +2685,29 @@ export function getPlayerShopModifierTypeOptionsForWave(waveIndex: number, baseC
|
|||||||
|
|
||||||
const options = [
|
const options = [
|
||||||
[
|
[
|
||||||
new ModifierTypeOption(modifierTypes.POTION(), 0, baseCost * 0.2),
|
new ModifierTypeOption(modifierTypeInitObj.POTION(), 0, baseCost * 0.2),
|
||||||
new ModifierTypeOption(modifierTypes.ETHER(), 0, baseCost * 0.4),
|
new ModifierTypeOption(modifierTypeInitObj.ETHER(), 0, baseCost * 0.4),
|
||||||
new ModifierTypeOption(modifierTypes.REVIVE(), 0, baseCost * 2),
|
new ModifierTypeOption(modifierTypeInitObj.REVIVE(), 0, baseCost * 2),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
new ModifierTypeOption(modifierTypes.SUPER_POTION(), 0, baseCost * 0.45),
|
new ModifierTypeOption(modifierTypeInitObj.SUPER_POTION(), 0, baseCost * 0.45),
|
||||||
new ModifierTypeOption(modifierTypes.FULL_HEAL(), 0, baseCost),
|
new ModifierTypeOption(modifierTypeInitObj.FULL_HEAL(), 0, baseCost),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
new ModifierTypeOption(modifierTypes.ELIXIR(), 0, baseCost),
|
new ModifierTypeOption(modifierTypeInitObj.ELIXIR(), 0, baseCost),
|
||||||
new ModifierTypeOption(modifierTypes.MAX_ETHER(), 0, baseCost),
|
new ModifierTypeOption(modifierTypeInitObj.MAX_ETHER(), 0, baseCost),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
new ModifierTypeOption(modifierTypes.HYPER_POTION(), 0, baseCost * 0.8),
|
new ModifierTypeOption(modifierTypeInitObj.HYPER_POTION(), 0, baseCost * 0.8),
|
||||||
new ModifierTypeOption(modifierTypes.MAX_REVIVE(), 0, baseCost * 2.75),
|
new ModifierTypeOption(modifierTypeInitObj.MAX_REVIVE(), 0, baseCost * 2.75),
|
||||||
new ModifierTypeOption(modifierTypes.MEMORY_MUSHROOM(), 0, baseCost * 4),
|
new ModifierTypeOption(modifierTypeInitObj.MEMORY_MUSHROOM(), 0, baseCost * 4),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
new ModifierTypeOption(modifierTypes.MAX_POTION(), 0, baseCost * 1.5),
|
new ModifierTypeOption(modifierTypeInitObj.MAX_POTION(), 0, baseCost * 1.5),
|
||||||
new ModifierTypeOption(modifierTypes.MAX_ELIXIR(), 0, baseCost * 2.5),
|
new ModifierTypeOption(modifierTypeInitObj.MAX_ELIXIR(), 0, baseCost * 2.5),
|
||||||
],
|
],
|
||||||
[new ModifierTypeOption(modifierTypes.FULL_RESTORE(), 0, baseCost * 2.25)],
|
[new ModifierTypeOption(modifierTypeInitObj.FULL_RESTORE(), 0, baseCost * 2.25)],
|
||||||
[new ModifierTypeOption(modifierTypes.SACRED_ASH(), 0, baseCost * 10)],
|
[new ModifierTypeOption(modifierTypeInitObj.SACRED_ASH(), 0, baseCost * 10)],
|
||||||
];
|
];
|
||||||
return options.slice(0, Math.ceil(Math.max(waveIndex + 10, 0) / 30)).flat();
|
return options.slice(0, Math.ceil(Math.max(waveIndex + 10, 0) / 30)).flat();
|
||||||
}
|
}
|
||||||
@ -2754,7 +2762,7 @@ export function getEnemyModifierTypesForWave(
|
|||||||
?.type as PokemonHeldItemModifierType,
|
?.type as PokemonHeldItemModifierType,
|
||||||
);
|
);
|
||||||
if (!(waveIndex % 1000)) {
|
if (!(waveIndex % 1000)) {
|
||||||
ret.push(getModifierType(modifierTypes.MINI_BLACK_HOLE) as PokemonHeldItemModifierType);
|
ret.push(getModifierType(modifierTypeInitObj.MINI_BLACK_HOLE) as PokemonHeldItemModifierType);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -2984,3 +2992,34 @@ export function getLuckTextTint(luckValue: number): number {
|
|||||||
}
|
}
|
||||||
return getModifierTierTextTint(modifierTier);
|
return getModifierTierTextTint(modifierTier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the modifier types object with the initial set of modifier types.
|
||||||
|
* {@linkcode initModifierPools} MUST be called before this function.
|
||||||
|
*/
|
||||||
|
export function initModifierTypes() {
|
||||||
|
for (const [key, value] of Object.entries(modifierTypeInitObj)) {
|
||||||
|
modifierTypes[key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: If necessary, add the rest of the modifier types here.
|
||||||
|
// For now, doing the minimal work until the modifier rework lands.
|
||||||
|
const ModifierTypeConstructorMap = Object.freeze({
|
||||||
|
ModifierTypeGenerator,
|
||||||
|
PokemonHeldItemModifierType,
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map of of modifier type strings to their constructor type
|
||||||
|
*/
|
||||||
|
export type ModifierTypeConstructorMap = typeof ModifierTypeConstructorMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map of modifier type strings to their instance type
|
||||||
|
*/
|
||||||
|
export type ModifierTypeInstanceMap = {
|
||||||
|
[K in keyof ModifierTypeConstructorMap]: InstanceType<ModifierTypeConstructorMap[K]>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ModifierTypeString = keyof ModifierTypeConstructorMap;
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import type { AddPokeballModifierType, AllPokemonLevelIncrementModifierType, EvolutionItemModifierTypeGenerator, ModifierType, ModifierTypeGenerator, PokemonLevelIncrementModifierType } from "./modifier-type";
|
|
||||||
|
|
||||||
interface ModifierTypes {
|
|
||||||
POKEBALL: () => AddPokeballModifierType;
|
|
||||||
GREAT_BALL: () => AddPokeballModifierType;
|
|
||||||
ULTRA_BALL: () => AddPokeballModifierType;
|
|
||||||
ROGUE_BALL: () => AddPokeballModifierType;
|
|
||||||
MASTER_BALL: () => AddPokeballModifierType;
|
|
||||||
|
|
||||||
RARE_CANDY: () => PokemonLevelIncrementModifierType;
|
|
||||||
RARER_CANDY: () => AllPokemonLevelIncrementModifierType;
|
|
||||||
|
|
||||||
EVOLUTION_ITEM: () => EvolutionItemModifierTypeGenerator;
|
|
||||||
RARE_EVOLUTION_ITEM: () => EvolutionItemModifierTypeGenerator;
|
|
||||||
|
|
||||||
FORM_CHANGE_ITEM: () =>
|
|
||||||
|
|
||||||
}
|
|
@ -1,12 +1,13 @@
|
|||||||
import { FusionSpeciesFormEvolution, pokemonEvolutions } from "#app/data/balance/pokemon-evolutions";
|
import { FusionSpeciesFormEvolution, pokemonEvolutions } from "#app/data/balance/pokemon-evolutions";
|
||||||
import { getBerryEffectFunc, getBerryPredicate } from "#app/data/berry";
|
import { getBerryEffectFunc, getBerryPredicate } from "#app/data/berry";
|
||||||
import { getLevelTotalExp } from "#app/data/exp";
|
import { getLevelTotalExp } from "#app/data/exp";
|
||||||
import { allMoves } from "#app/data/data-lists";
|
import { allMoves, modifierTypes } from "#app/data/data-lists";
|
||||||
import { MAX_PER_TYPE_POKEBALLS } from "#app/data/pokeball";
|
import { MAX_PER_TYPE_POKEBALLS } from "#app/data/pokeball";
|
||||||
import { SpeciesFormChangeItemTrigger } from "#app/data/pokemon-forms/form-change-triggers";
|
import { SpeciesFormChangeItemTrigger } from "#app/data/pokemon-forms/form-change-triggers";
|
||||||
import type { FormChangeItem } from "#enums/form-change-item";
|
import type { FormChangeItem } from "#enums/form-change-item";
|
||||||
import { getStatusEffectHealText } from "#app/data/status-effect";
|
import { getStatusEffectHealText } from "#app/data/status-effect";
|
||||||
import Pokemon, { type PlayerPokemon } from "#app/field/pokemon";
|
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||||
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import { getPokemonNameWithAffix } from "#app/messages";
|
import { getPokemonNameWithAffix } from "#app/messages";
|
||||||
import Overrides from "#app/overrides";
|
import Overrides from "#app/overrides";
|
||||||
import { LearnMoveType } from "#enums/learn-move-type";
|
import { LearnMoveType } from "#enums/learn-move-type";
|
||||||
@ -24,29 +25,26 @@ import { type PermanentStat, type TempBattleStat, BATTLE_STATS, Stat, TEMP_BATTL
|
|||||||
import { StatusEffect } from "#enums/status-effect";
|
import { StatusEffect } from "#enums/status-effect";
|
||||||
import type { PokemonType } from "#enums/pokemon-type";
|
import type { PokemonType } from "#enums/pokemon-type";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import {
|
import type {
|
||||||
type DoubleBattleChanceBoosterModifierType,
|
DoubleBattleChanceBoosterModifierType,
|
||||||
type EvolutionItemModifierType,
|
EvolutionItemModifierType,
|
||||||
type FormChangeItemModifierType,
|
FormChangeItemModifierType,
|
||||||
type ModifierOverride,
|
ModifierOverride,
|
||||||
type ModifierType,
|
ModifierType,
|
||||||
type PokemonBaseStatTotalModifierType,
|
PokemonBaseStatTotalModifierType,
|
||||||
type PokemonExpBoosterModifierType,
|
PokemonExpBoosterModifierType,
|
||||||
type PokemonFriendshipBoosterModifierType,
|
PokemonFriendshipBoosterModifierType,
|
||||||
type PokemonMoveAccuracyBoosterModifierType,
|
PokemonMoveAccuracyBoosterModifierType,
|
||||||
type PokemonMultiHitModifierType,
|
PokemonMultiHitModifierType,
|
||||||
type TerastallizeModifierType,
|
TerastallizeModifierType,
|
||||||
type TmModifierType,
|
TmModifierType,
|
||||||
getModifierType,
|
|
||||||
ModifierTypeGenerator,
|
|
||||||
modifierTypes,
|
|
||||||
PokemonHeldItemModifierType,
|
|
||||||
} from "./modifier-type";
|
} from "./modifier-type";
|
||||||
|
import { getModifierType } from "#app/utils/modifier-utils";
|
||||||
import { Color, ShadowColor } from "#enums/color";
|
import { Color, ShadowColor } from "#enums/color";
|
||||||
import { FRIENDSHIP_GAIN_FROM_RARE_CANDY } from "#app/data/balance/starters";
|
import { FRIENDSHIP_GAIN_FROM_RARE_CANDY } from "#app/data/balance/starters";
|
||||||
import { applyAbAttrs, applyPostItemLostAbAttrs } from "#app/data/abilities/apply-ab-attrs";
|
import { applyAbAttrs, applyPostItemLostAbAttrs } from "#app/data/abilities/apply-ab-attrs";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { ModifierString } from "#app/@types/modifier-types";
|
import type { ModifierInstanceMap, ModifierString } from "#app/@types/modifier-types";
|
||||||
|
|
||||||
export type ModifierPredicate = (modifier: Modifier) => boolean;
|
export type ModifierPredicate = (modifier: Modifier) => boolean;
|
||||||
|
|
||||||
@ -161,7 +159,7 @@ export abstract class Modifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
public is<T extends ModifierString>(modifier: ModifierString): this is ModifierConstructorMap[T] {
|
public is<T extends ModifierString>(modifier: T): this is ModifierInstanceMap[T] {
|
||||||
const targetModifier = ModifierClassMap[modifier];
|
const targetModifier = ModifierClassMap[modifier];
|
||||||
if (!targetModifier) {
|
if (!targetModifier) {
|
||||||
return false;
|
return false;
|
||||||
@ -193,6 +191,9 @@ export abstract class PersistentModifier extends Modifier {
|
|||||||
public stackCount: number;
|
public stackCount: number;
|
||||||
public virtualStackCount: number;
|
public virtualStackCount: number;
|
||||||
|
|
||||||
|
/** */
|
||||||
|
private declare _: never;
|
||||||
|
|
||||||
constructor(type: ModifierType, stackCount = 1) {
|
constructor(type: ModifierType, stackCount = 1) {
|
||||||
super(type);
|
super(type);
|
||||||
this.stackCount = stackCount;
|
this.stackCount = stackCount;
|
||||||
@ -1598,7 +1599,7 @@ export class BypassSpeedChanceModifier extends PokemonHeldItemModifier {
|
|||||||
doBypassSpeed.value = true;
|
doBypassSpeed.value = true;
|
||||||
const isCommandFight =
|
const isCommandFight =
|
||||||
globalScene.currentBattle.turnCommands[pokemon.getBattlerIndex()]?.command === Command.FIGHT;
|
globalScene.currentBattle.turnCommands[pokemon.getBattlerIndex()]?.command === Command.FIGHT;
|
||||||
const hasQuickClaw = this.type instanceof PokemonHeldItemModifierType && this.type.id === "QUICK_CLAW";
|
const hasQuickClaw = this.type.is("PokemonHeldItemModifierType") && this.type.id === "QUICK_CLAW";
|
||||||
|
|
||||||
if (isCommandFight && hasQuickClaw) {
|
if (isCommandFight && hasQuickClaw) {
|
||||||
globalScene.phaseManager.queueMessage(
|
globalScene.phaseManager.queueMessage(
|
||||||
@ -3220,7 +3221,7 @@ export abstract class HeldItemTransferModifier extends PokemonHeldItemModifier {
|
|||||||
* @returns the opponents of the source {@linkcode Pokemon}
|
* @returns the opponents of the source {@linkcode Pokemon}
|
||||||
*/
|
*/
|
||||||
getTargets(pokemon?: Pokemon, ..._args: unknown[]): Pokemon[] {
|
getTargets(pokemon?: Pokemon, ..._args: unknown[]): Pokemon[] {
|
||||||
return pokemon instanceof Pokemon ? pokemon.getOpponents() : [];
|
return pokemon?.getOpponents?.() ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3792,7 +3793,7 @@ export function overrideModifiers(isPlayer = true): void {
|
|||||||
const modifierFunc = modifierTypes[item.name];
|
const modifierFunc = modifierTypes[item.name];
|
||||||
let modifierType: ModifierType | null = modifierFunc();
|
let modifierType: ModifierType | null = modifierFunc();
|
||||||
|
|
||||||
if (modifierType instanceof ModifierTypeGenerator) {
|
if (modifierType.is("ModifierTypeGenerator")) {
|
||||||
const pregenArgs = "type" in item && item.type !== null ? [item.type] : undefined;
|
const pregenArgs = "type" in item && item.type !== null ? [item.type] : undefined;
|
||||||
modifierType = modifierType.generateType([], pregenArgs);
|
modifierType = modifierType.generateType([], pregenArgs);
|
||||||
}
|
}
|
||||||
@ -3834,7 +3835,7 @@ export function overrideHeldItems(pokemon: Pokemon, isPlayer = true): void {
|
|||||||
let modifierType: ModifierType | null = modifierFunc();
|
let modifierType: ModifierType | null = modifierFunc();
|
||||||
const qty = item.count || 1;
|
const qty = item.count || 1;
|
||||||
|
|
||||||
if (modifierType instanceof ModifierTypeGenerator) {
|
if (modifierType.is("ModifierTypeGenerator")) {
|
||||||
const pregenArgs = "type" in item && item.type !== null ? [item.type] : undefined;
|
const pregenArgs = "type" in item && item.type !== null ? [item.type] : undefined;
|
||||||
modifierType = modifierType.generateType([], pregenArgs);
|
modifierType = modifierType.generateType([], pregenArgs);
|
||||||
}
|
}
|
||||||
@ -3853,10 +3854,9 @@ export function overrideHeldItems(pokemon: Pokemon, isPlayer = true): void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private map from modifier strings to their constructors.
|
* Private map from modifier strings to their constructors.
|
||||||
*
|
*
|
||||||
* @remarks
|
* @remarks
|
||||||
* Used for {@linkcode Modifier.is} to check if a modifier is of a certain type without
|
* Used for {@linkcode Modifier.is} to check if a modifier is of a certain type without
|
||||||
* requiring modifier types to be imported in every file.
|
* requiring modifier types to be imported in every file.
|
||||||
@ -3948,6 +3948,7 @@ const ModifierClassMap = Object.freeze({
|
|||||||
EnemyStatusEffectHealChanceModifier,
|
EnemyStatusEffectHealChanceModifier,
|
||||||
EnemyEndureChanceModifier,
|
EnemyEndureChanceModifier,
|
||||||
EnemyFusionChanceModifier,
|
EnemyFusionChanceModifier,
|
||||||
|
MoneyMultiplierModifier,
|
||||||
});
|
});
|
||||||
|
|
||||||
export type ModifierConstructorMap = typeof ModifierClassMap;
|
export type ModifierConstructorMap = typeof ModifierClassMap;
|
||||||
|
@ -7,7 +7,7 @@ import type PokemonSpecies from "#app/data/pokemon-species";
|
|||||||
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||||
import { trainerConfigs } from "#app/data/trainers/trainer-config";
|
import { trainerConfigs } from "#app/data/trainers/trainer-config";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { BattlePhase } from "#app/phases/battle-phase";
|
import { BattlePhase } from "#app/phases/battle-phase";
|
||||||
import type { EndCardPhase } from "#app/phases/end-card-phase";
|
import type { EndCardPhase } from "#app/phases/end-card-phase";
|
||||||
import { achvs, ChallengeAchv } from "#app/system/achv";
|
import { achvs, ChallengeAchv } from "#app/system/achv";
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { ModifierType } from "#app/modifier/modifier-type";
|
import type { ModifierType } from "#app/modifier/modifier-type";
|
||||||
import type { ModifierTypeFunc } from "#app/@types/modifier-types";
|
import type { ModifierTypeFunc } from "#app/@types/modifier-types";
|
||||||
import { getModifierType } from "#app/modifier/modifier-type";
|
import { getModifierType } from "#app/utils/modifier-utils";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { BattlePhase } from "./battle-phase";
|
import { BattlePhase } from "./battle-phase";
|
||||||
|
|
||||||
|
@ -6,11 +6,8 @@ import { getBiomeKey } from "#app/field/arena";
|
|||||||
import { GameMode, getGameMode } from "#app/game-mode";
|
import { GameMode, getGameMode } from "#app/game-mode";
|
||||||
import { GameModes } from "#enums/game-modes";
|
import { GameModes } from "#enums/game-modes";
|
||||||
import type { Modifier } from "#app/modifier/modifier";
|
import type { Modifier } from "#app/modifier/modifier";
|
||||||
import {
|
import { getDailyRunStarterModifiers, regenerateModifierPoolThresholds } from "#app/modifier/modifier-type";
|
||||||
getDailyRunStarterModifiers,
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
modifierTypes,
|
|
||||||
regenerateModifierPoolThresholds,
|
|
||||||
} from "#app/modifier/modifier-type";
|
|
||||||
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
import { ModifierPoolType } from "#enums/modifier-pool-type";
|
||||||
import { Phase } from "#app/phase";
|
import { Phase } from "#app/phase";
|
||||||
import type { SessionSaveData } from "#app/system/game-data";
|
import type { SessionSaveData } from "#app/system/game-data";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { getCharVariantFromDialogue } from "#app/data/dialogue";
|
import { getCharVariantFromDialogue } from "#app/data/dialogue";
|
||||||
import { TrainerType } from "#app/enums/trainer-type";
|
import { TrainerType } from "#app/enums/trainer-type";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { vouchers } from "#app/system/voucher";
|
import { vouchers } from "#app/system/voucher";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { randSeedItem } from "#app/utils/common";
|
import { randSeedItem } from "#app/utils/common";
|
||||||
|
@ -2,7 +2,7 @@ import type { BattlerIndex } from "#enums/battler-index";
|
|||||||
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||||
import { BattleType } from "#enums/battle-type";
|
import { BattleType } from "#enums/battle-type";
|
||||||
import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { PokemonPhase } from "./pokemon-phase";
|
import { PokemonPhase } from "./pokemon-phase";
|
||||||
import { handleMysteryEncounterVictory } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
import { handleMysteryEncounterVictory } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
|
@ -7,11 +7,7 @@ import { Command } from "#enums/command";
|
|||||||
import MessageUiHandler from "#app/ui/message-ui-handler";
|
import MessageUiHandler from "#app/ui/message-ui-handler";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import { BooleanHolder, toReadableString, randInt, getLocalizedSpriteKey } from "#app/utils/common";
|
import { BooleanHolder, toReadableString, randInt, getLocalizedSpriteKey } from "#app/utils/common";
|
||||||
import {
|
import type { PokemonFormChangeItemModifier, PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||||
PokemonFormChangeItemModifier,
|
|
||||||
PokemonHeldItemModifier,
|
|
||||||
SwitchEffectTransferModifier,
|
|
||||||
} from "#app/modifier/modifier";
|
|
||||||
import { allMoves } from "#app/data/data-lists";
|
import { allMoves } from "#app/data/data-lists";
|
||||||
import { Gender, getGenderColor, getGenderSymbol } from "#app/data/gender";
|
import { Gender, getGenderColor, getGenderSymbol } from "#app/data/gender";
|
||||||
import { StatusEffect } from "#enums/status-effect";
|
import { StatusEffect } from "#enums/status-effect";
|
||||||
@ -226,7 +222,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
public static FilterItemMaxStacks = (pokemon: PlayerPokemon, modifier: PokemonHeldItemModifier) => {
|
public static FilterItemMaxStacks = (pokemon: PlayerPokemon, modifier: PokemonHeldItemModifier) => {
|
||||||
const matchingModifier = globalScene.findModifier(
|
const matchingModifier = globalScene.findModifier(
|
||||||
m => m instanceof PokemonHeldItemModifier && m.pokemonId === pokemon.id && m.matchType(modifier),
|
m => m.is("PokemonHeldItemModifier") && m.pokemonId === pokemon.id && m.matchType(modifier),
|
||||||
) as PokemonHeldItemModifier;
|
) as PokemonHeldItemModifier;
|
||||||
if (matchingModifier && matchingModifier.stackCount === matchingModifier.getMaxStackCount()) {
|
if (matchingModifier && matchingModifier.stackCount === matchingModifier.getMaxStackCount()) {
|
||||||
return i18next.t("partyUiHandler:tooManyItems", { pokemonName: getPokemonNameWithAffix(pokemon, false) });
|
return i18next.t("partyUiHandler:tooManyItems", { pokemonName: getPokemonNameWithAffix(pokemon, false) });
|
||||||
@ -554,7 +550,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
|||||||
// this returns `undefined` if the new pokemon doesn't have the item at all, otherwise it returns the `pokemonHeldItemModifier` for that item
|
// this returns `undefined` if the new pokemon doesn't have the item at all, otherwise it returns the `pokemonHeldItemModifier` for that item
|
||||||
const matchingModifier = globalScene.findModifier(
|
const matchingModifier = globalScene.findModifier(
|
||||||
m =>
|
m =>
|
||||||
m instanceof PokemonHeldItemModifier &&
|
m.is("PokemonHeldItemModifier") &&
|
||||||
m.pokemonId === newPokemon.id &&
|
m.pokemonId === newPokemon.id &&
|
||||||
m.matchType(this.getTransferrableItemsFromPokemon(pokemon)[this.transferOptionCursor]),
|
m.matchType(this.getTransferrableItemsFromPokemon(pokemon)[this.transferOptionCursor]),
|
||||||
) as PokemonHeldItemModifier;
|
) as PokemonHeldItemModifier;
|
||||||
@ -687,7 +683,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
private getTransferrableItemsFromPokemon(pokemon: PlayerPokemon) {
|
private getTransferrableItemsFromPokemon(pokemon: PlayerPokemon) {
|
||||||
return globalScene.findModifiers(
|
return globalScene.findModifiers(
|
||||||
m => m instanceof PokemonHeldItemModifier && m.isTransferable && m.pokemonId === pokemon.id,
|
m => m.is("PokemonHeldItemModifier") && m.isTransferable && m.pokemonId === pokemon.id,
|
||||||
) as PokemonHeldItemModifier[];
|
) as PokemonHeldItemModifier[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -928,7 +924,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
|||||||
/** Initialize item quantities for the selected Pokemon */
|
/** Initialize item quantities for the selected Pokemon */
|
||||||
const itemModifiers = globalScene.findModifiers(
|
const itemModifiers = globalScene.findModifiers(
|
||||||
m =>
|
m =>
|
||||||
m instanceof PokemonHeldItemModifier &&
|
m.is("PokemonHeldItemModifier") &&
|
||||||
m.isTransferable &&
|
m.isTransferable &&
|
||||||
m.pokemonId === globalScene.getPlayerParty()[this.cursor].id,
|
m.pokemonId === globalScene.getPlayerParty()[this.cursor].id,
|
||||||
) as PokemonHeldItemModifier[];
|
) as PokemonHeldItemModifier[];
|
||||||
@ -1165,8 +1161,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
|||||||
return !!(
|
return !!(
|
||||||
this.partyUiMode !== PartyUiMode.FAINT_SWITCH &&
|
this.partyUiMode !== PartyUiMode.FAINT_SWITCH &&
|
||||||
globalScene.findModifier(
|
globalScene.findModifier(
|
||||||
m =>
|
m => m.is("SwitchEffectTransferModifier") && m.pokemonId === globalScene.getPlayerField()[this.fieldIndex].id,
|
||||||
m instanceof SwitchEffectTransferModifier && m.pokemonId === globalScene.getPlayerField()[this.fieldIndex].id,
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1185,7 +1180,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
|||||||
private getItemModifiers(pokemon: Pokemon): PokemonHeldItemModifier[] {
|
private getItemModifiers(pokemon: Pokemon): PokemonHeldItemModifier[] {
|
||||||
return (
|
return (
|
||||||
(globalScene.findModifiers(
|
(globalScene.findModifiers(
|
||||||
m => m instanceof PokemonHeldItemModifier && m.isTransferable && m.pokemonId === pokemon.id,
|
m => m.is("PokemonHeldItemModifier") && m.isTransferable && m.pokemonId === pokemon.id,
|
||||||
) as PokemonHeldItemModifier[]) ?? []
|
) as PokemonHeldItemModifier[]) ?? []
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1565,7 +1560,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
getFormChangeItemsModifiers(pokemon: Pokemon) {
|
getFormChangeItemsModifiers(pokemon: Pokemon) {
|
||||||
let formChangeItemModifiers = globalScene.findModifiers(
|
let formChangeItemModifiers = globalScene.findModifiers(
|
||||||
m => m instanceof PokemonFormChangeItemModifier && m.pokemonId === pokemon.id,
|
m => m.is("PokemonFormChangeItemModifier") && m.pokemonId === pokemon.id,
|
||||||
) as PokemonFormChangeItemModifier[];
|
) as PokemonFormChangeItemModifier[];
|
||||||
const ultraNecrozmaModifiers = formChangeItemModifiers.filter(
|
const ultraNecrozmaModifiers = formChangeItemModifiers.filter(
|
||||||
m => m.active && m.formChangeItem === FormChangeItem.ULTRANECROZIUM_Z,
|
m => m.active && m.formChangeItem === FormChangeItem.ULTRANECROZIUM_Z,
|
||||||
|
@ -6,7 +6,9 @@ import {
|
|||||||
trainerModifierPool,
|
trainerModifierPool,
|
||||||
wildModifierPool,
|
wildModifierPool,
|
||||||
} from "#app/modifier/modifier-pools";
|
} from "#app/modifier/modifier-pools";
|
||||||
import type { ModifierPool } from "#app/@types/modifier-types";
|
import type { ModifierPool, ModifierTypeFunc } from "#app/@types/modifier-types";
|
||||||
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
|
import type { ModifierType } from "#app/modifier/modifier-type";
|
||||||
|
|
||||||
export function getModifierPoolForType(poolType: ModifierPoolType): ModifierPool {
|
export function getModifierPoolForType(poolType: ModifierPoolType): ModifierPool {
|
||||||
switch (poolType) {
|
switch (poolType) {
|
||||||
@ -22,3 +24,12 @@ export function getModifierPoolForType(poolType: ModifierPoolType): ModifierPool
|
|||||||
return dailyStarterModifierPool;
|
return dailyStarterModifierPool;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: document this
|
||||||
|
export function getModifierType(modifierTypeFunc: ModifierTypeFunc): ModifierType {
|
||||||
|
const modifierType = modifierTypeFunc();
|
||||||
|
if (!modifierType.id) {
|
||||||
|
modifierType.id = Object.keys(modifierTypes).find(k => modifierTypes[k] === modifierTypeFunc)!; // TODO: is this bang correct?
|
||||||
|
}
|
||||||
|
return modifierType;
|
||||||
|
}
|
@ -8,6 +8,7 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi, type MockIn
|
|||||||
import { isNullOrUndefined } from "#app/utils/common";
|
import { isNullOrUndefined } from "#app/utils/common";
|
||||||
import { allAbilities } from "#app/data/data-lists";
|
import { allAbilities } from "#app/data/data-lists";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
|
import type { PostTurnResetStatusAbAttr } from "#app/@types/ability-types";
|
||||||
|
|
||||||
describe("Abilities - Healer", () => {
|
describe("Abilities - Healer", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { allMoves } from "#app/data/data-lists";
|
import { allMoves } from "#app/data/data-lists";
|
||||||
import type { EnemyPersistentModifier } from "#app/modifier/modifier";
|
import type { EnemyPersistentModifier } from "#app/modifier/modifier";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { AbilityId } from "#enums/ability-id";
|
import { AbilityId } from "#enums/ability-id";
|
||||||
import { ArenaTagType } from "#enums/arena-tag-type";
|
import { ArenaTagType } from "#enums/arena-tag-type";
|
||||||
import { MoveId } from "#enums/move-id";
|
import { MoveId } from "#enums/move-id";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Stat } from "#enums/stat";
|
import { Stat } from "#enums/stat";
|
||||||
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import i18next from "#app/plugins/i18n";
|
import i18next from "#app/plugins/i18n";
|
||||||
import { NumberHolder } from "#app/utils/common";
|
import { NumberHolder } from "#app/utils/common";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Stat } from "#enums/stat";
|
import { Stat } from "#enums/stat";
|
||||||
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import i18next from "#app/plugins/i18n";
|
import i18next from "#app/plugins/i18n";
|
||||||
import { NumberHolder } from "#app/utils/common";
|
import { NumberHolder } from "#app/utils/common";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Stat } from "#enums/stat";
|
import { Stat } from "#enums/stat";
|
||||||
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import i18next from "#app/plugins/i18n";
|
import i18next from "#app/plugins/i18n";
|
||||||
import { NumberHolder } from "#app/utils/common";
|
import { NumberHolder } from "#app/utils/common";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Stat } from "#enums/stat";
|
import { Stat } from "#enums/stat";
|
||||||
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import i18next from "#app/plugins/i18n";
|
import i18next from "#app/plugins/i18n";
|
||||||
import { NumberHolder, randInt } from "#app/utils/common";
|
import { NumberHolder, randInt } from "#app/utils/common";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
|
@ -29,7 +29,7 @@ import { Button } from "#enums/buttons";
|
|||||||
import type PartyUiHandler from "#app/ui/party-ui-handler";
|
import type PartyUiHandler from "#app/ui/party-ui-handler";
|
||||||
import type OptionSelectUiHandler from "#app/ui/settings/option-select-ui-handler";
|
import type OptionSelectUiHandler from "#app/ui/settings/option-select-ui-handler";
|
||||||
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { BerryType } from "#enums/berry-type";
|
import { BerryType } from "#enums/berry-type";
|
||||||
import type { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
import type { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
|
@ -26,7 +26,7 @@ import {
|
|||||||
} from "#app/modifier/modifier";
|
} from "#app/modifier/modifier";
|
||||||
import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases";
|
import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases";
|
||||||
import { generateModifierType } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
import { generateModifierType } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { BerryType } from "#enums/berry-type";
|
import { BerryType } from "#enums/berry-type";
|
||||||
|
|
||||||
const namespace = "mysteryEncounters/delibirdy";
|
const namespace = "mysteryEncounters/delibirdy";
|
||||||
|
@ -11,7 +11,7 @@ import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
|||||||
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
|
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
|
||||||
import { PokemonNatureWeightModifier } from "#app/modifier/modifier";
|
import { PokemonNatureWeightModifier } from "#app/modifier/modifier";
|
||||||
import { generateModifierType } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
import { generateModifierType } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { GlobalTradeSystemEncounter } from "#app/data/mystery-encounters/encounters/global-trade-system-encounter";
|
import { GlobalTradeSystemEncounter } from "#app/data/mystery-encounters/encounters/global-trade-system-encounter";
|
||||||
import { CIVILIZATION_ENCOUNTER_BIOMES } from "#app/data/mystery-encounters/mystery-encounters";
|
import { CIVILIZATION_ENCOUNTER_BIOMES } from "#app/data/mystery-encounters/mystery-encounters";
|
||||||
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
||||||
|
@ -15,7 +15,8 @@ import { SpeciesId } from "#enums/species-id";
|
|||||||
import { PokemonMove } from "#app/data/moves/pokemon-move";
|
import { PokemonMove } from "#app/data/moves/pokemon-move";
|
||||||
import { HealShopCostModifier, HitHealModifier, TurnHealModifier } from "#app/modifier/modifier";
|
import { HealShopCostModifier, HitHealModifier, TurnHealModifier } from "#app/modifier/modifier";
|
||||||
import { ModifierTier } from "#enums/modifier-tier";
|
import { ModifierTier } from "#enums/modifier-tier";
|
||||||
import { modifierTypes, type PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||||
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { CommandPhase } from "#app/phases/command-phase";
|
import { CommandPhase } from "#app/phases/command-phase";
|
||||||
import { MovePhase } from "#app/phases/move-phase";
|
import { MovePhase } from "#app/phases/move-phase";
|
||||||
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
||||||
|
@ -26,7 +26,7 @@ import { BerryType } from "#enums/berry-type";
|
|||||||
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
||||||
import { Stat } from "#enums/stat";
|
import { Stat } from "#enums/stat";
|
||||||
import type { BerryModifier } from "#app/modifier/modifier";
|
import type { BerryModifier } from "#app/modifier/modifier";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { AbilityId } from "#enums/ability-id";
|
import { AbilityId } from "#enums/ability-id";
|
||||||
|
|
||||||
const namespace = "mysteryEncounters/uncommonBreed";
|
const namespace = "mysteryEncounters/uncommonBreed";
|
||||||
|
@ -6,7 +6,7 @@ import Phaser from "phaser";
|
|||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import { generateModifierType } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
import { generateModifierType } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
|
|
||||||
describe("Form Change Phase", () => {
|
describe("Form Change Phase", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -3,7 +3,8 @@ import { getPokemonSpecies } from "#app/data/pokemon-species";
|
|||||||
import { PlayerPokemon } from "#app/field/pokemon";
|
import { PlayerPokemon } from "#app/field/pokemon";
|
||||||
import { ModifierTier } from "#enums/modifier-tier";
|
import { ModifierTier } from "#enums/modifier-tier";
|
||||||
import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
||||||
import { ModifierTypeOption, modifierTypes } from "#app/modifier/modifier-type";
|
import { ModifierTypeOption } from "#app/modifier/modifier-type";
|
||||||
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
|
@ -6,7 +6,8 @@ import Trainer from "#app/field/trainer";
|
|||||||
import { getGameMode } from "#app/game-mode";
|
import { getGameMode } from "#app/game-mode";
|
||||||
import { GameModes } from "#enums/game-modes";
|
import { GameModes } from "#enums/game-modes";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { ModifierTypeOption, modifierTypes } from "#app/modifier/modifier-type";
|
import { ModifierTypeOption } from "#app/modifier/modifier-type";
|
||||||
|
import { modifierTypes } from "#app/data/data-lists";
|
||||||
import overrides from "#app/overrides";
|
import overrides from "#app/overrides";
|
||||||
import { CheckSwitchPhase } from "#app/phases/check-switch-phase";
|
import { CheckSwitchPhase } from "#app/phases/check-switch-phase";
|
||||||
import { CommandPhase } from "#app/phases/command-phase";
|
import { CommandPhase } from "#app/phases/command-phase";
|
||||||
|
@ -5,6 +5,7 @@ import { initBiomes } from "#app/data/balance/biomes";
|
|||||||
import { initEggMoves } from "#app/data/balance/egg-moves";
|
import { initEggMoves } from "#app/data/balance/egg-moves";
|
||||||
import { initPokemonPrevolutions, initPokemonStarters } from "#app/data/balance/pokemon-evolutions";
|
import { initPokemonPrevolutions, initPokemonStarters } from "#app/data/balance/pokemon-evolutions";
|
||||||
import { initMoves } from "#app/data/moves/move";
|
import { initMoves } from "#app/data/moves/move";
|
||||||
|
import { initModifierPools } from "#app/modifier/init-modifier-pools";
|
||||||
import { initMysteryEncounters } from "#app/data/mystery-encounters/mystery-encounters";
|
import { initMysteryEncounters } from "#app/data/mystery-encounters/mystery-encounters";
|
||||||
import { initPokemonForms } from "#app/data/pokemon-forms";
|
import { initPokemonForms } from "#app/data/pokemon-forms";
|
||||||
import { initSpecies } from "#app/data/pokemon-species";
|
import { initSpecies } from "#app/data/pokemon-species";
|
||||||
@ -22,6 +23,7 @@ import InputText from "phaser3-rex-plugins/plugins/inputtext";
|
|||||||
import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext";
|
import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext";
|
||||||
import { manageListeners } from "./listenersManager";
|
import { manageListeners } from "./listenersManager";
|
||||||
import { initI18n } from "#app/plugins/i18n";
|
import { initI18n } from "#app/plugins/i18n";
|
||||||
|
import { initModifierTypes } from "#app/modifier/modifier-type";
|
||||||
|
|
||||||
let wasInitialized = false;
|
let wasInitialized = false;
|
||||||
/**
|
/**
|
||||||
@ -88,6 +90,8 @@ export function initTestFile() {
|
|||||||
if (!wasInitialized) {
|
if (!wasInitialized) {
|
||||||
wasInitialized = true;
|
wasInitialized = true;
|
||||||
initI18n();
|
initI18n();
|
||||||
|
initModifierTypes();
|
||||||
|
initModifierPools();
|
||||||
initVouchers();
|
initVouchers();
|
||||||
initAchievements();
|
initAchievements();
|
||||||
initStatsKeys();
|
initStatsKeys();
|
||||||
|
Loading…
Reference in New Issue
Block a user