mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-03 23:12:20 +02:00
Move constants in MEs to their own files
This commit is contained in:
parent
609be022b8
commit
e13437acc3
@ -137,14 +137,13 @@ import { LoadingScene } from "#app/loading-scene";
|
||||
import type { MovePhase } from "#app/phases/move-phase";
|
||||
import { ShopCursorTarget } from "#app/enums/shop-cursor-target";
|
||||
import MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||
import { allMysteryEncounters, mysteryEncountersByBiome } from "#app/data/mystery-encounters/mystery-encounters";
|
||||
import {
|
||||
allMysteryEncounters,
|
||||
ANTI_VARIANCE_WEIGHT_MODIFIER,
|
||||
AVERAGE_ENCOUNTERS_PER_RUN_TARGET,
|
||||
BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT,
|
||||
MYSTERY_ENCOUNTER_SPAWN_MAX_WEIGHT,
|
||||
mysteryEncountersByBiome,
|
||||
} from "#app/data/mystery-encounters/mystery-encounters";
|
||||
} from "./constants";
|
||||
import { MysteryEncounterSaveData } from "#app/data/mystery-encounters/mystery-encounter-save-data";
|
||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||
|
@ -54,3 +54,43 @@ export const defaultStarterSpecies: SpeciesId[] = [
|
||||
];
|
||||
|
||||
export const saveKey = "x0i2O7WRiANTqPmZ"; // Temporary; secure encryption is not yet necessary
|
||||
|
||||
/**
|
||||
* Spawn chance: (BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT + WIGHT_INCREMENT_ON_SPAWN_MISS * <number of missed spawns>) / MYSTERY_ENCOUNTER_SPAWN_MAX_WEIGHT
|
||||
*/
|
||||
export const BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT = 3;
|
||||
|
||||
/**
|
||||
* The divisor for determining ME spawns, defines the "maximum" weight required for a spawn
|
||||
* If spawn_weight === MYSTERY_ENCOUNTER_SPAWN_MAX_WEIGHT, 100% chance to spawn a ME
|
||||
*/
|
||||
export const MYSTERY_ENCOUNTER_SPAWN_MAX_WEIGHT = 256;
|
||||
|
||||
/**
|
||||
* When an ME spawn roll fails, WEIGHT_INCREMENT_ON_SPAWN_MISS is added to future rolls for ME spawn checks.
|
||||
* These values are cleared whenever the next ME spawns, and spawn weight returns to BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT
|
||||
*/
|
||||
export const WEIGHT_INCREMENT_ON_SPAWN_MISS = 3;
|
||||
|
||||
/**
|
||||
* Specifies the target average for total ME spawns in a single Classic run.
|
||||
* Used by anti-variance mechanic to check whether a run is above or below the target on a given wave.
|
||||
*/
|
||||
export const AVERAGE_ENCOUNTERS_PER_RUN_TARGET = 12;
|
||||
|
||||
/**
|
||||
* Will increase/decrease the chance of spawning a ME based on the current run's total MEs encountered vs AVERAGE_ENCOUNTERS_PER_RUN_TARGET
|
||||
* Example:
|
||||
* AVERAGE_ENCOUNTERS_PER_RUN_TARGET = 17 (expects avg 1 ME every 10 floors)
|
||||
* ANTI_VARIANCE_WEIGHT_MODIFIER = 15
|
||||
*
|
||||
* On wave 20, if 1 ME has been encountered, the difference from expected average is 0 MEs.
|
||||
* So anti-variance adds 0/256 to the spawn weight check for ME spawn.
|
||||
*
|
||||
* On wave 20, if 0 MEs have been encountered, the difference from expected average is 1 ME.
|
||||
* So anti-variance adds 15/256 to the spawn weight check for ME spawn.
|
||||
*
|
||||
* On wave 20, if 2 MEs have been encountered, the difference from expected average is -1 ME.
|
||||
* So anti-variance adds -15/256 to the spawn weight check for ME spawn.
|
||||
*/
|
||||
export const ANTI_VARIANCE_WEIGHT_MODIFIER = 15;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||
import { BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT } from "#app/data/mystery-encounters/mystery-encounters";
|
||||
import { BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT } from "#app/constants";
|
||||
import { isNullOrUndefined } from "#app/utils/common";
|
||||
import type { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||
|
||||
|
@ -34,42 +34,6 @@ import { GlobalTradeSystemEncounter } from "#app/data/mystery-encounters/encount
|
||||
import { TheExpertPokemonBreederEncounter } from "#app/data/mystery-encounters/encounters/the-expert-pokemon-breeder-encounter";
|
||||
import { getBiomeName } from "#app/data/balance/biomes";
|
||||
|
||||
/**
|
||||
* Spawn chance: (BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT + WIGHT_INCREMENT_ON_SPAWN_MISS * <number of missed spawns>) / MYSTERY_ENCOUNTER_SPAWN_MAX_WEIGHT
|
||||
*/
|
||||
export const BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT = 3;
|
||||
/**
|
||||
* The divisor for determining ME spawns, defines the "maximum" weight required for a spawn
|
||||
* If spawn_weight === MYSTERY_ENCOUNTER_SPAWN_MAX_WEIGHT, 100% chance to spawn a ME
|
||||
*/
|
||||
export const MYSTERY_ENCOUNTER_SPAWN_MAX_WEIGHT = 256;
|
||||
/**
|
||||
* When an ME spawn roll fails, WEIGHT_INCREMENT_ON_SPAWN_MISS is added to future rolls for ME spawn checks.
|
||||
* These values are cleared whenever the next ME spawns, and spawn weight returns to BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT
|
||||
*/
|
||||
export const WEIGHT_INCREMENT_ON_SPAWN_MISS = 3;
|
||||
/**
|
||||
* Specifies the target average for total ME spawns in a single Classic run.
|
||||
* Used by anti-variance mechanic to check whether a run is above or below the target on a given wave.
|
||||
*/
|
||||
export const AVERAGE_ENCOUNTERS_PER_RUN_TARGET = 12;
|
||||
/**
|
||||
* Will increase/decrease the chance of spawning a ME based on the current run's total MEs encountered vs AVERAGE_ENCOUNTERS_PER_RUN_TARGET
|
||||
* Example:
|
||||
* AVERAGE_ENCOUNTERS_PER_RUN_TARGET = 17 (expects avg 1 ME every 10 floors)
|
||||
* ANTI_VARIANCE_WEIGHT_MODIFIER = 15
|
||||
*
|
||||
* On wave 20, if 1 ME has been encountered, the difference from expected average is 0 MEs.
|
||||
* So anti-variance adds 0/256 to the spawn weight check for ME spawn.
|
||||
*
|
||||
* On wave 20, if 0 MEs have been encountered, the difference from expected average is 1 ME.
|
||||
* So anti-variance adds 15/256 to the spawn weight check for ME spawn.
|
||||
*
|
||||
* On wave 20, if 2 MEs have been encountered, the difference from expected average is -1 ME.
|
||||
* So anti-variance adds -15/256 to the spawn weight check for ME spawn.
|
||||
*/
|
||||
export const ANTI_VARIANCE_WEIGHT_MODIFIER = 15;
|
||||
|
||||
export const EXTREME_ENCOUNTER_BIOMES = [
|
||||
BiomeId.SEA,
|
||||
BiomeId.SEABED,
|
||||
|
@ -3,10 +3,7 @@ import { BattlerIndex } from "#enums/battler-index";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { biomeLinks, BiomePoolTier } from "#app/data/balance/biomes";
|
||||
import type MysteryEncounterOption from "#app/data/mystery-encounters/mystery-encounter-option";
|
||||
import {
|
||||
AVERAGE_ENCOUNTERS_PER_RUN_TARGET,
|
||||
WEIGHT_INCREMENT_ON_SPAWN_MISS,
|
||||
} from "#app/data/mystery-encounters/mystery-encounters";
|
||||
import { AVERAGE_ENCOUNTERS_PER_RUN_TARGET, WEIGHT_INCREMENT_ON_SPAWN_MISS } from "#app/constants";
|
||||
import { showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||
import type { AiType } from "#enums/ai-type";
|
||||
|
@ -30,7 +30,7 @@ import { PlayerGender } from "#enums/player-gender";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
import { overrideHeldItems, overrideModifiers } from "#app/modifier/modifier";
|
||||
import i18next from "i18next";
|
||||
import { WEIGHT_INCREMENT_ON_SPAWN_MISS } from "#app/data/mystery-encounters/mystery-encounters";
|
||||
import { WEIGHT_INCREMENT_ON_SPAWN_MISS } from "#app/constants";
|
||||
import { getNatureName } from "#app/data/nature";
|
||||
|
||||
export class EncounterPhase extends BattlePhase {
|
||||
|
Loading…
Reference in New Issue
Block a user