Begin moving balance files, rates.ts starter-candy.ts

This commit is contained in:
AJ Fontaine 2024-09-29 18:45:01 -04:00
parent 3976d115d8
commit a7a7a2d08f
27 changed files with 102 additions and 94 deletions

View File

@ -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";

View File

@ -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";

View File

@ -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";

26
src/data/balance/rates.ts Normal file
View File

@ -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;

View File

@ -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;
}

View File

@ -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";

View File

@ -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 */

View File

@ -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;

View File

@ -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";

View File

@ -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";

View File

@ -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";

View File

@ -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);
}

View File

@ -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,

View File

@ -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";

View File

@ -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";

View File

@ -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";

View File

@ -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";

View File

@ -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";

View File

@ -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";

View File

@ -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";

View File

@ -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";

View File

@ -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";

View File

@ -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";

View File

@ -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";

View File

@ -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";

View File

@ -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