From 1d0109a386458ed1ade0194f237792bb9659d349 Mon Sep 17 00:00:00 2001 From: ImperialSympathizer Date: Fri, 5 Jul 2024 21:03:18 -0400 Subject: [PATCH] small fixes --- src/battle-scene.ts | 13 +++++++++---- src/data/mystery-encounter.ts | 12 ++++++------ .../mystery-encounters/mystery-encounter-utils.ts | 3 ++- src/data/mystery-encounters/mystery-encounters.ts | 3 ++- src/locales/en/mystery-encounter.ts | 2 +- src/phases.ts | 8 -------- 6 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index e127bfeb31f..3fe0d6765db 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -93,7 +93,12 @@ import { UiTheme } from "#enums/ui-theme"; import { TimedEventManager } from "#app/timed-event-manager.js"; import i18next from "i18next"; import MysteryEncounter, { MysteryEncounterTier, MysteryEncounterVariant } from "./data/mystery-encounter"; -import {mysteryEncountersByBiome, allMysteryEncounters, BASE_MYSTERY_ENCOUNTER_WEIGHT} from "./data/mystery-encounters/mystery-encounters"; +import { + mysteryEncountersByBiome, + allMysteryEncounters, + BASE_MYSTERY_ENCOUNTER_WEIGHT, + AVERAGE_ENCOUNTERS_PER_RUN_TARGET +} from "./data/mystery-encounters/mystery-encounters"; import {MysteryEncounterFlags} from "#app/data/mystery-encounter-flags"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; @@ -1098,8 +1103,8 @@ export default class BattleScene extends SceneBase { // Check for mystery encounter // Can only occur in place of a standard wild battle, waves 10-180 - // let testStartingWeight = 40; - // while (testStartingWeight < 60) { + // let testStartingWeight = 10; + // while (testStartingWeight < 30) { // calculateMEAggregateStats(this, testStartingWeight); // testStartingWeight += 2; // } @@ -1112,7 +1117,7 @@ export default class BattleScene extends SceneBase { // If total number of encounters is lower than expected for the run, slightly favor a new encounter spawn // Do the reverse as well // Reduces occurrence of runs with very few (<6) and a ton (>10) of encounters - const expectedEncountersByFloor = 8 / (180 - 10) * newWaveIndex; + const expectedEncountersByFloor = AVERAGE_ENCOUNTERS_PER_RUN_TARGET / (180 - 10) * newWaveIndex; const currentRunDiffFromAvg = expectedEncountersByFloor - (this.mysteryEncounterFlags?.encounteredEvents?.length || 0); const favoredEncounterRate = sessionEncounterRate + currentRunDiffFromAvg * 5; diff --git a/src/data/mystery-encounter.ts b/src/data/mystery-encounter.ts index c85c44a3973..6a81e473724 100644 --- a/src/data/mystery-encounter.ts +++ b/src/data/mystery-encounter.ts @@ -157,12 +157,12 @@ export default class MysteryEncounter implements MysteryEncounter { const secReqs = this.meetsSecondaryRequirementAndSecondaryPokemonSelected(scene); // secondary is checked first to handle cases of primary overlapping with secondary const priReqs = this.meetsPrimaryRequirementAndPrimaryPokemonSelected(scene); - console.log("-------" + MysteryEncounterType[this.encounterType] + " Encounter Check -------"); - console.log(this); - console.log( "sceneCheck: " + sceneReq); - console.log( "primaryCheck: " + priReqs); - console.log( "secondaryCheck: " + secReqs); - console.log(MysteryEncounterTier[this.encounterTier]); + // console.log("-------" + MysteryEncounterType[this.encounterType] + " Encounter Check -------"); + // console.log(this); + // console.log( "sceneCheck: " + sceneReq); + // console.log( "primaryCheck: " + priReqs); + // console.log( "secondaryCheck: " + secReqs); + // console.log(MysteryEncounterTier[this.encounterTier]); return sceneReq && secReqs && priReqs; } diff --git a/src/data/mystery-encounters/mystery-encounter-utils.ts b/src/data/mystery-encounters/mystery-encounter-utils.ts index 9cdb6607752..3c9ee48c9ba 100644 --- a/src/data/mystery-encounters/mystery-encounter-utils.ts +++ b/src/data/mystery-encounters/mystery-encounter-utils.ts @@ -595,6 +595,7 @@ export function handleMysteryEncounterVictory(scene: BattleScene, addHealPhase: export function calculateMEAggregateStats(scene: BattleScene, baseSpawnWeight: number) { const numRuns = 1000; let run = 0; + const targetEncountersPerRun = 15; const calculateNumEncounters = (): number[] => { let encounterRate = baseSpawnWeight; @@ -646,7 +647,7 @@ export function calculateMEAggregateStats(scene: BattleScene, baseSpawnWeight: n // If total number of encounters is lower than expected for the run, slightly favor a new encounter // Do the reverse as well - const expectedEncountersByFloor = 8 / (180 - 10) * i; + const expectedEncountersByFloor = targetEncountersPerRun / (180 - 10) * i; const currentRunDiffFromAvg = expectedEncountersByFloor - numEncounters.reduce((a, b) => a + b); const favoredEncounterRate = encounterRate + currentRunDiffFromAvg * 5; diff --git a/src/data/mystery-encounters/mystery-encounters.ts b/src/data/mystery-encounters/mystery-encounters.ts index 2f4f7828d46..1a0f6f2a1ce 100644 --- a/src/data/mystery-encounters/mystery-encounters.ts +++ b/src/data/mystery-encounters/mystery-encounters.ts @@ -8,7 +8,8 @@ import { Biome } from "#app/enums/biome"; import { SleepingSnorlaxEncounter } from "./sleeping-snorlax"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -export const BASE_MYSTERY_ENCOUNTER_WEIGHT = 50; +export const BASE_MYSTERY_ENCOUNTER_WEIGHT = 19; +export const AVERAGE_ENCOUNTERS_PER_RUN_TARGET = 15; export const allMysteryEncounters : {[encounterType:string]: MysteryEncounter} = {}; diff --git a/src/locales/en/mystery-encounter.ts b/src/locales/en/mystery-encounter.ts index 9d5fe50aece..849782256e7 100644 --- a/src/locales/en/mystery-encounter.ts +++ b/src/locales/en/mystery-encounter.ts @@ -55,7 +55,7 @@ export const mysteryEncounter: SimpleTranslationEntries = { "mysterious_challengers_outro_win": "The mysterious challenger was defeated!", // Mysterious Encounters -- Rare Tier - "training_session_intro_message": "You've come across a some\ntraining tools and supplies.", + "training_session_intro_message": "You've come across some\ntraining tools and supplies.", "training_session_title": "Training Session", "training_session_description": "These supplies look like they could be used to train a member of your party! There are a few ways you could train your Pokémon, by battling against it with the rest of your team.", "training_session_query": "How should you train?", diff --git a/src/phases.ts b/src/phases.ts index b05ab41edc5..db060d8fe2d 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -296,14 +296,6 @@ export class TitlePhase extends Phase { }, keepOpen: true }, - { - label: i18next.t("menu:settings"), - handler: () => { - this.scene.ui.setOverlayMode(Mode.SETTINGS); - return true; - }, - keepOpen: true - }, { label: i18next.t("menu:settings"), handler: () => {