small fixes
This commit is contained in:
parent
666ec135ba
commit
b3aa562bc6
|
@ -93,7 +93,7 @@ import { UiTheme } from "#enums/ui-theme";
|
||||||
import { TimedEventManager } from "#app/timed-event-manager.js";
|
import { TimedEventManager } from "#app/timed-event-manager.js";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import MysteryEncounter, { MysteryEncounterTier, MysteryEncounterVariant } from "./data/mystery-encounter";
|
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 {MysteryEncounterFlags} from "#app/data/mystery-encounter-flags";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
|
|
||||||
|
@ -1098,11 +1098,16 @@ export default class BattleScene extends SceneBase {
|
||||||
|
|
||||||
// Check for mystery encounter
|
// Check for mystery encounter
|
||||||
// Can only occur in place of a standard wild battle, waves 10-180
|
// 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) {
|
if (this.gameMode.hasMysteryEncounters && newBattleType === BattleType.WILD && !this.gameMode.isBoss(newWaveIndex) && newWaveIndex < 180 && newWaveIndex > 10) {
|
||||||
const roll = Utils.randSeedInt(256);
|
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
|
// 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
|
// If total number of encounters is lower than expected for the run, slightly favor a new encounter spawn
|
||||||
// Do the reverse as well
|
// Do the reverse as well
|
||||||
|
@ -1116,7 +1121,7 @@ export default class BattleScene extends SceneBase {
|
||||||
if (roll < successRate) {
|
if (roll < successRate) {
|
||||||
newBattleType = BattleType.MYSTERY_ENCOUNTER;
|
newBattleType = BattleType.MYSTERY_ENCOUNTER;
|
||||||
// Reset base spawn weight
|
// Reset base spawn weight
|
||||||
this.mysteryEncounterFlags.encounterSpawnChance = BASE_MYSTYERY_ENCOUNTER_WEIGHT;
|
this.mysteryEncounterFlags.encounterSpawnChance = BASE_MYSTERY_ENCOUNTER_WEIGHT;
|
||||||
} else {
|
} else {
|
||||||
this.mysteryEncounterFlags.encounterSpawnChance = sessionEncounterRate + 1;
|
this.mysteryEncounterFlags.encounterSpawnChance = sessionEncounterRate + 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import {MysteryEncounterTier} from "#app/data/mystery-encounter";
|
import {MysteryEncounterTier} from "#app/data/mystery-encounter";
|
||||||
import {MysteryEncounterType} from "#enums/mystery-encounter-type";
|
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";
|
import {isNullOrUndefined} from "../utils";
|
||||||
|
|
||||||
export class MysteryEncounterFlags {
|
export class MysteryEncounterFlags {
|
||||||
encounteredEvents: [MysteryEncounterType, MysteryEncounterTier][] = [];
|
encounteredEvents: [MysteryEncounterType, MysteryEncounterTier][] = [];
|
||||||
encounterSpawnChance: number = BASE_MYSTYERY_ENCOUNTER_WEIGHT;
|
encounterSpawnChance: number = BASE_MYSTERY_ENCOUNTER_WEIGHT;
|
||||||
nextEncounterQueue: [MysteryEncounterType, integer][] = [];
|
nextEncounterQueue: [MysteryEncounterType, integer][] = [];
|
||||||
|
|
||||||
constructor(flags: MysteryEncounterFlags) {
|
constructor(flags: MysteryEncounterFlags) {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { Biome } from "#app/enums/biome";
|
||||||
import { SleepingSnorlaxEncounter } from "./sleeping-snorlax";
|
import { SleepingSnorlaxEncounter } from "./sleeping-snorlax";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
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} = {};
|
export const allMysteryEncounters : {[encounterType:string]: MysteryEncounter} = {};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue