Skip to content

Commit

Permalink
prevent MEs incorrectly spawning on existing session saves (#4494)
Browse files Browse the repository at this point in the history
Co-authored-by: ImperialSympathizer <[email protected]>
  • Loading branch information
ben-lear and ImperialSympathizer authored Sep 28, 2024
1 parent 3a5f3c3 commit d872345
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/battle-scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3091,11 +3091,6 @@ export default class BattleScene extends SceneBase {
private isWaveMysteryEncounter(newBattleType: BattleType, waveIndex: number, sessionDataEncounterType?: MysteryEncounterType): boolean {
const [lowestMysteryEncounterWave, highestMysteryEncounterWave] = this.gameMode.getMysteryEncounterLegalWaves();
if (this.gameMode.hasMysteryEncounters && newBattleType === BattleType.WILD && !this.gameMode.isBoss(waveIndex) && waveIndex < highestMysteryEncounterWave && waveIndex > lowestMysteryEncounterWave) {
// If ME type is already defined in session data, no need to roll RNG check
if (!isNullOrUndefined(sessionDataEncounterType)) {
return true;
}

// Base spawn weight is BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT/256, and increases by WEIGHT_INCREMENT_ON_SPAWN_MISS/256 for each missed attempt at spawning an encounter on a valid floor
const sessionEncounterRate = this.mysteryEncounterSaveData.encounterSpawnChance;
const encounteredEvents = this.mysteryEncounterSaveData.encounteredEvents;
Expand Down

0 comments on commit d872345

Please sign in to comment.