diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 8e299dd8e06..5ae656a4ba0 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -25,7 +25,7 @@ import { trainerConfigs, TrainerSlot } from "./data/trainer-config"; import Trainer, { TrainerVariant } from "./field/trainer"; import TrainerData from "./system/trainer-data"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; -import { pokemonPrevolutions } from "./data/pokemon-evolutions"; +import { pokemonPrevolutions } from "./data/balance/pokemon-evolutions"; import PokeballTray from "./ui/pokeball-tray"; import InvertPostFX from "./pipelines/invert"; import { Achv, achvs, ModifierAchv, MoneyAchv } from "./system/achv"; diff --git a/src/data/egg-moves.ts b/src/data/balance/egg-moves.ts similarity index 99% rename from src/data/egg-moves.ts rename to src/data/balance/egg-moves.ts index 741b707af2f..3a12d3ae6f8 100644 --- a/src/data/egg-moves.ts +++ b/src/data/balance/egg-moves.ts @@ -1,5 +1,5 @@ -import { allMoves } from "./move"; -import * as Utils from "../utils"; +import { allMoves } from "../move"; +import * as Utils from "../../utils"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/data/pokemon-evolutions.ts b/src/data/balance/pokemon-evolutions.ts similarity index 99% rename from src/data/pokemon-evolutions.ts rename to src/data/balance/pokemon-evolutions.ts index 698bbb8e9c9..4e1d12c1a47 100644 --- a/src/data/pokemon-evolutions.ts +++ b/src/data/balance/pokemon-evolutions.ts @@ -1,12 +1,12 @@ -import { Gender } from "./gender"; -import { PokeballType } from "./pokeball"; -import Pokemon from "../field/pokemon"; +import { Gender } from "../gender"; +import { PokeballType } from "../pokeball"; +import Pokemon from "../../field/pokemon"; import { Stat } from "#enums/stat"; -import { Type } from "./type"; -import * as Utils from "../utils"; -import { SpeciesFormKey } from "./pokemon-species"; -import { WeatherType } from "./weather"; -import { Nature } from "./nature"; +import { Type } from "../type"; +import * as Utils from "../../utils"; +import { SpeciesFormKey } from "../pokemon-species"; +import { WeatherType } from "../weather"; +import { Nature } from "../nature"; import { Biome } from "#enums/biome"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/data/pokemon-level-moves.ts b/src/data/balance/pokemon-level-moves.ts similarity index 100% rename from src/data/pokemon-level-moves.ts rename to src/data/balance/pokemon-level-moves.ts diff --git a/src/data/balance/rates.ts b/src/data/balance/rates.ts new file mode 100644 index 00000000000..e1590be39ca --- /dev/null +++ b/src/data/balance/rates.ts @@ -0,0 +1,26 @@ +/** + * Rates for shinies and other random properties are defined in this file. + * CHANCE is defined as x/65536 + * RATE is defined as 1/x + */ + +/** Encounterable properties */ +/** `64/65536 -> 1/1024` */ +export const BASE_SHINY_CHANCE = 64; + +/** `256/65536 -> 1/256` */ +export const BASE_HIDDEN_ABILITY_CHANCE = 256; + +/** Egg properties */ +// Rates for specific random properties in 1/x +export const GACHA_DEFAULT_SHINY_RATE = 128; +export const GACHA_SHINY_UP_SHINY_RATE = 64; +export const SAME_SPECIES_EGG_SHINY_RATE = 12; +export const SAME_SPECIES_EGG_HA_RATE = 8; +export const MANAPHY_EGG_MANAPHY_RATE = 8; +export const GACHA_EGG_HA_RATE = 192; + +// 1/x for legendary eggs, 1/x*2 for epic eggs, 1/x*4 for rare eggs, and 1/x*8 for common eggs +export const GACHA_DEFAULT_RARE_EGGMOVE_RATE = 6; +export const SAME_SPECIES_EGG_RARE_EGGMOVE_RATE = 3; +export const GACHA_MOVE_UP_RARE_EGGMOVE_RATE = 3; diff --git a/src/data/balance/starter-candy.ts b/src/data/balance/starter-candy.ts new file mode 100644 index 00000000000..df5181ec1c8 --- /dev/null +++ b/src/data/balance/starter-candy.ts @@ -0,0 +1,21 @@ +const starterCandyCosts: { passive: integer; costReduction: [integer, integer]; egg: integer; }[] = [ + { passive: 40, costReduction: [25, 60], egg: 30 }, // 1 Cost + { passive: 40, costReduction: [25, 60], egg: 30 }, // 2 Cost + { passive: 35, costReduction: [20, 50], egg: 25 }, // 3 Cost + { passive: 30, costReduction: [15, 40], egg: 20 }, // 4 Cost + { passive: 25, costReduction: [12, 35], egg: 18 }, // 5 Cost + { passive: 20, costReduction: [10, 30], egg: 15 }, // 6 Cost + { passive: 15, costReduction: [8, 20], egg: 12 }, // 7 Cost + { passive: 10, costReduction: [5, 15], egg: 10 }, // 8 Cost + { passive: 10, costReduction: [5, 15], egg: 10 }, // 9 Cost + { passive: 10, costReduction: [5, 15], egg: 10 }, // 10 Cost +]; +export function getPassiveCandyCount(baseValue: integer): integer { + return starterCandyCosts[baseValue - 1].passive; +} +export function getValueReductionCandyCounts(baseValue: integer): [integer, integer] { + return starterCandyCosts[baseValue - 1].costReduction; +} +export function getSameSpeciesEggCandyCounts(baseValue: integer): integer { + return starterCandyCosts[baseValue - 1].egg; +} diff --git a/src/data/tms.ts b/src/data/balance/tms.ts similarity index 99% rename from src/data/tms.ts rename to src/data/balance/tms.ts index 9dea6d74a86..1222626ac44 100644 --- a/src/data/tms.ts +++ b/src/data/balance/tms.ts @@ -1,4 +1,4 @@ -import { ModifierTier } from "../modifier/modifier-tier"; +import { ModifierTier } from "../../modifier/modifier-tier"; import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 4cdaef7b1b3..17e95abcd0a 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -13,7 +13,7 @@ import { TrainerType } from "#enums/trainer-type"; import { Nature } from "./nature"; import { Moves } from "#app/enums/moves"; import { TypeColor, TypeShadow } from "#app/enums/color"; -import { pokemonEvolutions } from "./pokemon-evolutions"; +import { pokemonEvolutions } from "./balance/pokemon-evolutions"; import { pokemonFormChanges } from "./pokemon-forms"; /** A constant for the default max cost of the starting party before a run */ diff --git a/src/data/egg.ts b/src/data/egg.ts index b37240a2028..192120d3514 100644 --- a/src/data/egg.ts +++ b/src/data/egg.ts @@ -3,28 +3,16 @@ import PokemonSpecies, { getPokemonSpecies, speciesStarters } from "./pokemon-sp import { VariantTier } from "../enums/variant-tier"; import * as Utils from "../utils"; import Overrides from "#app/overrides"; -import { pokemonPrevolutions } from "./pokemon-evolutions"; +import { pokemonPrevolutions } from "./balance/pokemon-evolutions"; import { PlayerPokemon } from "#app/field/pokemon"; import i18next from "i18next"; import { EggTier } from "#enums/egg-type"; import { Species } from "#enums/species"; import { EggSourceType } from "#app/enums/egg-source-types"; +import { MANAPHY_EGG_MANAPHY_RATE, SAME_SPECIES_EGG_HA_RATE, GACHA_EGG_HA_RATE, GACHA_DEFAULT_RARE_EGGMOVE_RATE, SAME_SPECIES_EGG_RARE_EGGMOVE_RATE, GACHA_MOVE_UP_RARE_EGGMOVE_RATE, GACHA_DEFAULT_SHINY_RATE, GACHA_SHINY_UP_SHINY_RATE, SAME_SPECIES_EGG_SHINY_RATE } from "./balance/rates"; export const EGG_SEED = 1073741824; -// Rates for specific random properties in 1/x -const DEFAULT_SHINY_RATE = 128; -const GACHA_SHINY_UP_SHINY_RATE = 64; -const SAME_SPECIES_EGG_SHINY_RATE = 12; -const SAME_SPECIES_EGG_HA_RATE = 8; -const MANAPHY_EGG_MANAPHY_RATE = 8; -const GACHA_EGG_HA_RATE = 192; - -// 1/x for legendary eggs, 1/x*2 for epic eggs, 1/x*4 for rare eggs, and 1/x*8 for common eggs -const DEFAULT_RARE_EGGMOVE_RATE = 6; -const SAME_SPECIES_EGG_RARE_EGGMOVE_RATE = 3; -const GACHA_MOVE_UP_RARE_EGGMOVE_RATE = 3; - /** Egg options to override egg properties */ export interface IEggOptions { /** Id. Used to check if egg type will be manaphy (id % 204 === 0) */ @@ -323,7 +311,7 @@ export class Egg { //// private rollEggMoveIndex() { - let baseChance = DEFAULT_RARE_EGGMOVE_RATE; + let baseChance = GACHA_DEFAULT_RARE_EGGMOVE_RATE; switch (this._sourceType) { case EggSourceType.SAME_SPECIES_EGG: baseChance = SAME_SPECIES_EGG_RARE_EGGMOVE_RATE; @@ -475,7 +463,7 @@ export class Egg { * @returns True if the egg is shiny **/ private rollShiny(): boolean { - let shinyChance = DEFAULT_SHINY_RATE; + let shinyChance = GACHA_DEFAULT_SHINY_RATE; switch (this._sourceType) { case EggSourceType.GACHA_SHINY: shinyChance = GACHA_SHINY_UP_SHINY_RATE; diff --git a/src/data/mystery-encounters/mystery-encounter-requirements.ts b/src/data/mystery-encounters/mystery-encounter-requirements.ts index 1b14aa91847..7720d257e35 100644 --- a/src/data/mystery-encounters/mystery-encounter-requirements.ts +++ b/src/data/mystery-encounters/mystery-encounter-requirements.ts @@ -6,7 +6,7 @@ import { Moves } from "#enums/moves"; import { Species } from "#enums/species"; import { TimeOfDay } from "#enums/time-of-day"; import { Nature } from "../nature"; -import { EvolutionItem, pokemonEvolutions } from "../pokemon-evolutions"; +import { EvolutionItem, pokemonEvolutions } from "../balance/pokemon-evolutions"; import { FormChangeItem, pokemonFormChanges, SpeciesFormChangeItemTrigger } from "../pokemon-forms"; import { SpeciesFormKey } from "../pokemon-species"; import { StatusEffect } from "../status-effect"; diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 94dbba958b5..9bcf80f49f6 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -9,11 +9,11 @@ import { GameMode } from "../game-mode"; import { StarterMoveset } from "../system/game-data"; import * as Utils from "../utils"; import { uncatchableSpecies } from "./biomes"; -import { speciesEggMoves } from "./egg-moves"; +import { speciesEggMoves } from "./balance/egg-moves"; import { GrowthRate } from "./exp"; -import { EvolutionLevel, SpeciesWildEvolutionDelay, pokemonEvolutions, pokemonPrevolutions } from "./pokemon-evolutions"; +import { EvolutionLevel, SpeciesWildEvolutionDelay, pokemonEvolutions, pokemonPrevolutions } from "./balance/pokemon-evolutions"; import { Type } from "./type"; -import { LevelMoves, pokemonFormLevelMoves, pokemonFormLevelMoves as pokemonSpeciesFormLevelMoves, pokemonSpeciesLevelMoves } from "./pokemon-level-moves"; +import { LevelMoves, pokemonFormLevelMoves, pokemonFormLevelMoves as pokemonSpeciesFormLevelMoves, pokemonSpeciesLevelMoves } from "./balance/pokemon-level-moves"; import { Stat } from "#enums/stat"; import { Variant, VariantSet, variantColorCache, variantData } from "./variant"; diff --git a/src/data/trainer-config.ts b/src/data/trainer-config.ts index 75a849574ea..800d37d67ec 100644 --- a/src/data/trainer-config.ts +++ b/src/data/trainer-config.ts @@ -3,9 +3,9 @@ import { ModifierTypeFunc, modifierTypes } from "../modifier/modifier-type"; import { EnemyPokemon, PokemonMove } from "../field/pokemon"; import * as Utils from "../utils"; import { PokeballType } from "./pokeball"; -import { pokemonEvolutions, pokemonPrevolutions } from "./pokemon-evolutions"; +import { pokemonEvolutions, pokemonPrevolutions } from "./balance/pokemon-evolutions"; import PokemonSpecies, { getPokemonSpecies, PokemonSpeciesFilter } from "./pokemon-species"; -import { tmSpecies } from "./tms"; +import { tmSpecies } from "./balance/tms"; import { Type } from "./type"; import { doubleBattleDialogue } from "./dialogue"; import { PersistentModifier } from "../modifier/modifier"; diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 07525e92157..cded9d2b22a 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -15,8 +15,8 @@ import { PokeballType } from "../data/pokeball"; import { Gender } from "../data/gender"; import { initMoveAnim, loadMoveAnimAssets } from "../data/battle-anims"; import { Status, StatusEffect, getRandomStatus } from "../data/status-effect"; -import { pokemonEvolutions, pokemonPrevolutions, SpeciesFormEvolution, SpeciesEvolutionCondition, FusionSpeciesFormEvolution } from "../data/pokemon-evolutions"; -import { reverseCompatibleTms, tmSpecies, tmPoolTiers } from "../data/tms"; +import { pokemonEvolutions, pokemonPrevolutions, SpeciesFormEvolution, SpeciesEvolutionCondition, FusionSpeciesFormEvolution } from "../data/balance/pokemon-evolutions"; +import { reverseCompatibleTms, tmSpecies, tmPoolTiers } from "../data/balance/tms"; import { BattlerTag, BattlerTagLapseType, EncoreTag, GroundedTag, HighestStatBoostTag, SubstituteTag, TypeImmuneTag, getBattlerTag, SemiInvulnerableTag, TypeBoostTag, MoveRestrictionBattlerTag, ExposedTag, DragonCheerTag, CritBoostTag, TrappedTag, TarShotTag, AutotomizedTag } from "../data/battler-tags"; import { WeatherType } from "../data/weather"; import { ArenaTagSide, NoCritTag, WeakenMoveScreenTag } from "../data/arena-tag"; @@ -26,7 +26,7 @@ import { BattlerIndex } from "../battle"; import { Mode } from "../ui/ui"; import PartyUiHandler, { PartyOption, PartyUiMode } from "../ui/party-ui-handler"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; -import { LevelMoves } from "../data/pokemon-level-moves"; +import { LevelMoves } from "../data/balance/pokemon-level-moves"; import { DamageAchv, achvs } from "../system/achv"; import { DexAttr, StarterDataEntry, StarterMoveset } from "../system/game-data"; import { QuantizerCelebi, argbFromRgba, rgbaFromArgb } from "@material/material-color-utilities"; @@ -36,7 +36,7 @@ import { TerrainType } from "../data/terrain"; import { TrainerSlot } from "../data/trainer-config"; import Overrides from "#app/overrides"; import i18next from "i18next"; -import { speciesEggMoves } from "../data/egg-moves"; +import { speciesEggMoves } from "../data/balance/egg-moves"; import { ModifierTier } from "../modifier/modifier-tier"; import { applyChallenges, ChallengeType } from "#app/data/challenge"; import { Abilities } from "#enums/abilities"; @@ -62,6 +62,7 @@ import { PokemonAnimType } from "#app/enums/pokemon-anim-type"; import { PLAYER_PARTY_MAX_SIZE } from "#app/constants"; import { MysteryEncounterPokemonData } from "#app/data/mystery-encounters/mystery-encounter-pokemon-data"; import { SwitchType } from "#enums/switch-type"; +import { BASE_HIDDEN_ABILITY_CHANCE, BASE_SHINY_CHANCE } from "#app/data/balance/rates"; export enum FieldPosition { CENTER, @@ -139,7 +140,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { throw `Cannot create a player Pokemon for species '${species.getName(formIndex)}'`; } - const hiddenAbilityChance = new Utils.IntegerHolder(256); + const hiddenAbilityChance = new Utils.IntegerHolder(BASE_HIDDEN_ABILITY_CHANCE); if (!this.hasTrainer()) { this.scene.applyModifiers(HiddenAbilityRateBoosterModifier, true, hiddenAbilityChance); } @@ -1822,7 +1823,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { * The exact mechanic is that it calculates E as the XOR of the player's trainer ID and secret ID. * F is calculated as the XOR of the first 16 bits of the Pokemon's ID with the last 16 bits. * The XOR of E and F are then compared to the {@linkcode shinyThreshold} (or {@linkcode thresholdOverride} if set) to see whether or not to generate a shiny. - * The base shiny odds are {@linkcode baseShinyChance} / 65536 + * The base shiny odds are {@linkcode BASE_SHINY_CHANCE} / 65536 * @param thresholdOverride number that is divided by 2^16 (65536) to get the shiny chance, overrides {@linkcode shinyThreshold} if set (bypassing shiny rate modifiers such as Shiny Charm) * @returns true if the Pokemon has been set as a shiny, false otherwise */ @@ -1838,9 +1839,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { const E = this.scene.gameData.trainerId ^ this.scene.gameData.secretId; const F = rand1 ^ rand2; - /** `64/65536 -> 1/1024` */ - const baseShinyChance = 64; - const shinyThreshold = new Utils.IntegerHolder(baseShinyChance); + const shinyThreshold = new Utils.IntegerHolder(BASE_SHINY_CHANCE); if (thresholdOverride === undefined) { if (this.scene.eventManager.isEventActive()) { shinyThreshold.value *= this.scene.eventManager.getShinyMultiplier(); @@ -1865,15 +1864,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { * Function that tries to set a Pokemon shiny based on seed. * For manual use only, usually to roll a Pokemon's shiny chance a second time. * - * The base shiny odds are {@linkcode baseShinyChance} / 65536 + * The base shiny odds are {@linkcode BASE_SHINY_CHANCE} / 65536 * @param thresholdOverride number that is divided by 2^16 (65536) to get the shiny chance, overrides {@linkcode shinyThreshold} if set (bypassing shiny rate modifiers such as Shiny Charm) * @param applyModifiersToOverride If {@linkcode thresholdOverride} is set and this is true, will apply Shiny Charm and event modifiers to {@linkcode thresholdOverride} * @returns true if the Pokemon has been set as a shiny, false otherwise */ trySetShinySeed(thresholdOverride?: integer, applyModifiersToOverride?: boolean): boolean { - /** `64/65536 -> 1/1024` */ - const baseShinyChance = 64; - const shinyThreshold = new Utils.IntegerHolder(baseShinyChance); + const shinyThreshold = new Utils.IntegerHolder(BASE_SHINY_CHANCE); if (thresholdOverride === undefined || applyModifiersToOverride) { if (thresholdOverride !== undefined && applyModifiersToOverride) { shinyThreshold.value = thresholdOverride; @@ -1931,7 +1928,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } generateFusionSpecies(forStarter?: boolean): void { - const hiddenAbilityChance = new Utils.IntegerHolder(256); + const hiddenAbilityChance = new Utils.IntegerHolder(BASE_HIDDEN_ABILITY_CHANCE); if (!this.hasTrainer()) { this.scene.applyModifiers(HiddenAbilityRateBoosterModifier, true, hiddenAbilityChance); } diff --git a/src/field/trainer.ts b/src/field/trainer.ts index b1d0263f604..e5cdd5e6d9d 100644 --- a/src/field/trainer.ts +++ b/src/field/trainer.ts @@ -1,5 +1,5 @@ import BattleScene from "../battle-scene"; -import {pokemonPrevolutions} from "../data/pokemon-evolutions"; +import {pokemonPrevolutions} from "../data/balance/pokemon-evolutions"; import PokemonSpecies, {getPokemonSpecies} from "../data/pokemon-species"; import { TrainerConfig, diff --git a/src/loading-scene.ts b/src/loading-scene.ts index b577ba542bd..56d38bbc13c 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -6,9 +6,9 @@ import { WindowVariant, getWindowVariantSuffix } from "./ui/ui-theme"; import { isMobile } from "./touch-controls"; import * as Utils from "./utils"; import { initI18n } from "./plugins/i18n"; -import { initPokemonPrevolutions } from "#app/data/pokemon-evolutions"; +import { initPokemonPrevolutions } from "#app/data/balance/pokemon-evolutions"; import { initBiomes } from "#app/data/biomes"; -import { initEggMoves } from "#app/data/egg-moves"; +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/move"; diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index fb69a96448a..d631b5d512c 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -3,8 +3,8 @@ import { MoneyMultiplierModifier } from "./modifier"; import { allMoves, AttackMove, selfStatLowerMoves } from "../data/move"; import { getPokeballCatchMultiplier, getPokeballName, MAX_PER_TYPE_POKEBALLS, PokeballType } from "../data/pokeball"; import Pokemon, { EnemyPokemon, PlayerPokemon, PokemonMove } from "../field/pokemon"; -import { EvolutionItem, pokemonEvolutions } from "../data/pokemon-evolutions"; -import { tmPoolTiers, tmSpecies } from "../data/tms"; +import { EvolutionItem, pokemonEvolutions } from "../data/balance/pokemon-evolutions"; +import { tmPoolTiers, tmSpecies } from "../data/balance/tms"; import { Type } from "../data/type"; import PartyUiHandler, { PokemonMoveSelectFilter, PokemonSelectFilter } from "../ui/party-ui-handler"; import * as Utils from "../utils"; diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 537e2327a21..feeb1228123 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -7,7 +7,7 @@ import Pokemon, { PlayerPokemon } from "../field/pokemon"; import { addTextObject, TextStyle } from "../ui/text"; import { Type } from "../data/type"; import { EvolutionPhase } from "../phases/evolution-phase"; -import { FusionSpeciesFormEvolution, pokemonEvolutions, pokemonPrevolutions } from "../data/pokemon-evolutions"; +import { FusionSpeciesFormEvolution, pokemonEvolutions, pokemonPrevolutions } from "../data/balance/pokemon-evolutions"; import { getPokemonNameWithAffix } from "../messages"; import * as Utils from "../utils"; import { getBerryEffectFunc, getBerryPredicate } from "../data/berry"; diff --git a/src/phases/evolution-phase.ts b/src/phases/evolution-phase.ts index 0c3c2fa5bcf..e9fcc741637 100644 --- a/src/phases/evolution-phase.ts +++ b/src/phases/evolution-phase.ts @@ -1,7 +1,7 @@ import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; import { Phase } from "../phase"; import BattleScene from "../battle-scene"; -import { SpeciesFormEvolution } from "../data/pokemon-evolutions"; +import { SpeciesFormEvolution } from "../data/balance/pokemon-evolutions"; import EvolutionSceneHandler from "../ui/evolution-scene-handler"; import * as Utils from "../utils"; import { Mode } from "../ui/ui"; diff --git a/src/phases/game-over-phase.ts b/src/phases/game-over-phase.ts index 8ecf1478b99..8b4943e35dd 100644 --- a/src/phases/game-over-phase.ts +++ b/src/phases/game-over-phase.ts @@ -2,7 +2,7 @@ import { clientSessionId } from "#app/account"; import BattleScene from "#app/battle-scene"; import { BattleType } from "#app/battle"; import { getCharVariantFromDialogue } from "#app/data/dialogue"; -import { pokemonEvolutions } from "#app/data/pokemon-evolutions"; +import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; import PokemonSpecies, { getPokemonSpecies } from "#app/data/pokemon-species"; import { trainerConfigs } from "#app/data/trainer-config"; import { PlayerGender } from "#app/enums/player-gender"; diff --git a/src/system/achv.ts b/src/system/achv.ts index 09ec74de50c..a355a027093 100644 --- a/src/system/achv.ts +++ b/src/system/achv.ts @@ -1,7 +1,7 @@ import { Modifier } from "typescript"; import BattleScene from "../battle-scene"; import { TurnHeldItemTransferModifier } from "../modifier/modifier"; -import { pokemonEvolutions } from "#app/data/pokemon-evolutions"; +import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions"; import i18next from "i18next"; import * as Utils from "../utils"; import { PlayerGender } from "#enums/player-gender"; diff --git a/src/system/game-data.ts b/src/system/game-data.ts index af5e717c17b..d81ba0f4a22 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -1,7 +1,7 @@ import i18next from "i18next"; import BattleScene, { bypassLogin, PokeballCounts } from "../battle-scene"; import Pokemon, { EnemyPokemon, PlayerPokemon } from "../field/pokemon"; -import { pokemonPrevolutions } from "../data/pokemon-evolutions"; +import { pokemonPrevolutions } from "../data/balance/pokemon-evolutions"; import PokemonSpecies, { allSpecies, getPokemonSpecies, noStarterFormKeys, speciesStarters } from "../data/pokemon-species"; import * as Utils from "../utils"; import Overrides from "#app/overrides"; @@ -24,7 +24,7 @@ import { clientSessionId, loggedInUser, updateUserInfo } from "../account"; import { Nature } from "../data/nature"; import { GameStats } from "./game-stats"; import { Tutorial } from "../tutorial"; -import { speciesEggMoves } from "../data/egg-moves"; +import { speciesEggMoves } from "../data/balance/egg-moves"; import { allMoves } from "../data/move"; import { TrainerVariant } from "../field/trainer"; import { Variant } from "#app/data/variant"; diff --git a/src/test/evolution.test.ts b/src/test/evolution.test.ts index 07865d7e64a..1a5a2be996f 100644 --- a/src/test/evolution.test.ts +++ b/src/test/evolution.test.ts @@ -1,4 +1,4 @@ -import { pokemonEvolutions, SpeciesFormEvolution, SpeciesWildEvolutionDelay } from "#app/data/pokemon-evolutions"; +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/src/test/mystery-encounter/encounters/uncommon-breed-encounter.test.ts b/src/test/mystery-encounter/encounters/uncommon-breed-encounter.test.ts index 3943063d7c0..27794d1b9de 100644 --- a/src/test/mystery-encounter/encounters/uncommon-breed-encounter.test.ts +++ b/src/test/mystery-encounter/encounters/uncommon-breed-encounter.test.ts @@ -17,7 +17,7 @@ import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases"; import { CommandPhase } from "#app/phases/command-phase"; import { UncommonBreedEncounter } from "#app/data/mystery-encounters/encounters/uncommon-breed-encounter"; import { MovePhase } from "#app/phases/move-phase"; -import { speciesEggMoves } from "#app/data/egg-moves"; +import { speciesEggMoves } from "#app/data/balance/egg-moves"; import { getPokemonSpecies } from "#app/data/pokemon-species"; import { BerryType } from "#enums/berry-type"; import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; diff --git a/src/test/vitest.setup.ts b/src/test/vitest.setup.ts index 74129f20d26..8b3b7f683e8 100644 --- a/src/test/vitest.setup.ts +++ b/src/test/vitest.setup.ts @@ -3,9 +3,9 @@ import "vitest-canvas-mock"; import { initLoggedInUser } from "#app/account"; import { initAbilities } from "#app/data/ability"; import { initBiomes } from "#app/data/biomes"; -import { initEggMoves } from "#app/data/egg-moves"; +import { initEggMoves } from "#app/data/balance/egg-moves"; import { initMoves } from "#app/data/move"; -import { initPokemonPrevolutions } from "#app/data/pokemon-evolutions"; +import { initPokemonPrevolutions } from "#app/data/balance/pokemon-evolutions"; import { initPokemonForms } from "#app/data/pokemon-forms"; import { initSpecies } from "#app/data/pokemon-species"; import { initAchievements } from "#app/system/achv"; diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index 6b6ce2aa789..f6bcd2855ef 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -10,7 +10,7 @@ import { allMoves, ForceSwitchOutAttr } from "../data/move"; import { getGenderColor, getGenderSymbol } from "../data/gender"; import { StatusEffect } from "../data/status-effect"; import PokemonIconAnimHandler, { PokemonIconAnimMode } from "./pokemon-icon-anim-handler"; -import { pokemonEvolutions } from "../data/pokemon-evolutions"; +import { pokemonEvolutions } from "../data/balance/pokemon-evolutions"; import { addWindow } from "./ui-theme"; import { SpeciesFormChangeItemTrigger, FormChangeItem } from "../data/pokemon-forms"; import { getVariantTint } from "#app/data/variant"; diff --git a/src/ui/pokemon-hatch-info-container.ts b/src/ui/pokemon-hatch-info-container.ts index f8a9adced36..9e68eae92a9 100644 --- a/src/ui/pokemon-hatch-info-container.ts +++ b/src/ui/pokemon-hatch-info-container.ts @@ -4,7 +4,7 @@ import { Gender } from "../data/gender"; import { Type } from "../data/type"; import * as Utils from "../utils"; import { TextStyle, addTextObject } from "./text"; -import { speciesEggMoves } from "#app/data/egg-moves"; +import { speciesEggMoves } from "#app/data/balance/egg-moves"; import { allMoves } from "#app/data/move"; import { Species } from "#app/enums/species"; import { getEggTierForSpecies } from "#app/data/egg"; diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 03defdbdb5c..799f204288a 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -1,18 +1,18 @@ import { BattleSceneEventType, CandyUpgradeNotificationChangedEvent } from "../events/battle-scene"; -import { pokemonPrevolutions } from "#app/data/pokemon-evolutions"; +import { pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions"; import { Variant, getVariantTint, getVariantIcon } from "#app/data/variant"; import { argbFromRgba } from "@material/material-color-utilities"; import i18next from "i18next"; import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; import BattleScene, { starterColors } from "../battle-scene"; import { allAbilities } from "../data/ability"; -import { speciesEggMoves } from "../data/egg-moves"; +import { speciesEggMoves } from "../data/balance/egg-moves"; import { GrowthRate, getGrowthRateColor } from "../data/exp"; import { Gender, getGenderColor, getGenderSymbol } from "../data/gender"; import { allMoves } from "../data/move"; import { Nature, getNatureName } from "../data/nature"; import { pokemonFormChanges } from "../data/pokemon-forms"; -import { LevelMoves, pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "../data/pokemon-level-moves"; +import { LevelMoves, pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "../data/balance/pokemon-level-moves"; import PokemonSpecies, { allSpecies, getPokemonSpeciesForm, getStarterValueFriendshipCap, speciesStarters, starterPassiveAbilities, POKERUS_STARTER_COUNT, getPokerusStarters } from "../data/pokemon-species"; import { Type } from "../data/type"; import { GameModes } from "../game-mode"; @@ -46,6 +46,7 @@ import { ScrollBar } from "./scroll-bar"; import { SelectChallengePhase } from "#app/phases/select-challenge-phase"; import { TitlePhase } from "#app/phases/title-phase"; import { Abilities } from "#app/enums/abilities"; +import { getPassiveCandyCount, getValueReductionCandyCounts, getSameSpeciesEggCandyCounts } from "../data/balance/starter-candy"; export type StarterSelectCallback = (starters: Starter[]) => void; @@ -119,19 +120,6 @@ const languageSettings: { [key: string]: LanguageSetting } = { }, }; -const starterCandyCosts: { passive: integer, costReduction: [integer, integer], egg: integer }[] = [ - { passive: 40, costReduction: [25, 60], egg: 30 }, // 1 Cost - { passive: 40, costReduction: [25, 60], egg: 30 }, // 2 Cost - { passive: 35, costReduction: [20, 50], egg: 25 }, // 3 Cost - { passive: 30, costReduction: [15, 40], egg: 20 }, // 4 Cost - { passive: 25, costReduction: [12, 35], egg: 18 }, // 5 Cost - { passive: 20, costReduction: [10, 30], egg: 15 }, // 6 Cost - { passive: 15, costReduction: [8, 20], egg: 12 }, // 7 Cost - { passive: 10, costReduction: [5, 15], egg: 10 }, // 8 Cost - { passive: 10, costReduction: [5, 15], egg: 10 }, // 9 Cost - { passive: 10, costReduction: [5, 15], egg: 10 }, // 10 Cost -]; - const valueReductionMax = 2; // Position of UI elements @@ -142,18 +130,6 @@ const teamWindowY = 18; const teamWindowWidth = 34; const teamWindowHeight = 132; -function getPassiveCandyCount(baseValue: integer): integer { - return starterCandyCosts[baseValue - 1].passive; -} - -function getValueReductionCandyCounts(baseValue: integer): [integer, integer] { - return starterCandyCosts[baseValue - 1].costReduction; -} - -function getSameSpeciesEggCandyCounts(baseValue: integer): integer { - return starterCandyCosts[baseValue - 1].egg; -} - /** * Calculates the starter position for a Pokemon of a given UI index * @param index UI index to calculate the starter position of