From b3aa562bc639afebb00f737269ab7a644e71c18d Mon Sep 17 00:00:00 2001 From: ImperialSympathizer Date: Fri, 5 Jul 2024 20:42:25 -0400 Subject: [PATCH] small fixes --- src/battle-scene.ts | 11 ++++++++--- src/data/mystery-encounter-flags.ts | 4 ++-- src/data/mystery-encounters/mystery-encounters.ts | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 609a3f9153d..e127bfeb31f 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -93,7 +93,7 @@ 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_MYSTYERY_ENCOUNTER_WEIGHT} from "./data/mystery-encounters/mystery-encounters"; +import {mysteryEncountersByBiome, allMysteryEncounters, BASE_MYSTERY_ENCOUNTER_WEIGHT} from "./data/mystery-encounters/mystery-encounters"; import {MysteryEncounterFlags} from "#app/data/mystery-encounter-flags"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; @@ -1098,11 +1098,16 @@ 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) { + // calculateMEAggregateStats(this, testStartingWeight); + // testStartingWeight += 2; + // } if (this.gameMode.hasMysteryEncounters && newBattleType === BattleType.WILD && !this.gameMode.isBoss(newWaveIndex) && newWaveIndex < 180 && newWaveIndex > 10) { const roll = Utils.randSeedInt(256); // Base spawn weight is 3/256, and increases by 1/256 for each missed attempt at spawning an encounter on a valid floor - const sessionEncounterRate = !isNullOrUndefined(this.mysteryEncounterFlags?.encounterSpawnChance) ? this.mysteryEncounterFlags.encounterSpawnChance : BASE_MYSTYERY_ENCOUNTER_WEIGHT; + const sessionEncounterRate = !isNullOrUndefined(this.mysteryEncounterFlags?.encounterSpawnChance) ? this.mysteryEncounterFlags.encounterSpawnChance : BASE_MYSTERY_ENCOUNTER_WEIGHT; // If total number of encounters is lower than expected for the run, slightly favor a new encounter spawn // Do the reverse as well @@ -1116,7 +1121,7 @@ export default class BattleScene extends SceneBase { if (roll < successRate) { newBattleType = BattleType.MYSTERY_ENCOUNTER; // Reset base spawn weight - this.mysteryEncounterFlags.encounterSpawnChance = BASE_MYSTYERY_ENCOUNTER_WEIGHT; + this.mysteryEncounterFlags.encounterSpawnChance = BASE_MYSTERY_ENCOUNTER_WEIGHT; } else { this.mysteryEncounterFlags.encounterSpawnChance = sessionEncounterRate + 1; } diff --git a/src/data/mystery-encounter-flags.ts b/src/data/mystery-encounter-flags.ts index 8e7bce7a291..33ef84e2d1d 100644 --- a/src/data/mystery-encounter-flags.ts +++ b/src/data/mystery-encounter-flags.ts @@ -1,11 +1,11 @@ import {MysteryEncounterTier} from "#app/data/mystery-encounter"; import {MysteryEncounterType} from "#enums/mystery-encounter-type"; -import {BASE_MYSTYERY_ENCOUNTER_WEIGHT} from "#app/data/mystery-encounters/mystery-encounters"; +import {BASE_MYSTERY_ENCOUNTER_WEIGHT} from "#app/data/mystery-encounters/mystery-encounters"; import {isNullOrUndefined} from "../utils"; export class MysteryEncounterFlags { encounteredEvents: [MysteryEncounterType, MysteryEncounterTier][] = []; - encounterSpawnChance: number = BASE_MYSTYERY_ENCOUNTER_WEIGHT; + encounterSpawnChance: number = BASE_MYSTERY_ENCOUNTER_WEIGHT; nextEncounterQueue: [MysteryEncounterType, integer][] = []; constructor(flags: MysteryEncounterFlags) { diff --git a/src/data/mystery-encounters/mystery-encounters.ts b/src/data/mystery-encounters/mystery-encounters.ts index 81d69c808d3..2f4f7828d46 100644 --- a/src/data/mystery-encounters/mystery-encounters.ts +++ b/src/data/mystery-encounters/mystery-encounters.ts @@ -8,7 +8,7 @@ import { Biome } from "#app/enums/biome"; import { SleepingSnorlaxEncounter } from "./sleeping-snorlax"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; -export const BASE_MYSTYERY_ENCOUNTER_WEIGHT = 3; +export const BASE_MYSTERY_ENCOUNTER_WEIGHT = 50; export const allMysteryEncounters : {[encounterType:string]: MysteryEncounter} = {};