Rename Biome to BiomeId

This commit is contained in:
NightKev 2025-06-04 13:53:05 -07:00
parent 76bc3bd42f
commit 4c5829b08e
63 changed files with 2942 additions and 2920 deletions

View File

@ -129,7 +129,7 @@ import { ArenaFlyout } from "#app/ui/arena-flyout";
import { EaseType } from "#enums/ease-type";
import { BattleSpec } from "#enums/battle-spec";
import { BattleStyle } from "#enums/battle-style";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import type { ExpNotification } from "#enums/exp-notification";
import { MoneyFormat } from "#enums/money-format";
import { MoveId } from "#enums/move-id";
@ -1225,7 +1225,7 @@ export default class BattleScene extends SceneBase {
[this.luckLabelText, this.luckText].map(t => t.setVisible(false));
this.newArena(Overrides.STARTING_BIOME_OVERRIDE || Biome.TOWN);
this.newArena(Overrides.STARTING_BIOME_OVERRIDE || BiomeId.TOWN);
this.field.setVisible(true);
@ -1532,8 +1532,8 @@ export default class BattleScene extends SceneBase {
return this.currentBattle;
}
newArena(biome: Biome, playerFaints?: number): Arena {
this.arena = new Arena(biome, Biome[biome].toLowerCase(), playerFaints);
newArena(biome: BiomeId, playerFaints?: number): Arena {
this.arena = new Arena(biome, BiomeId[biome].toLowerCase(), playerFaints);
this.eventTarget.dispatchEvent(new NewArenaEvent());
this.arenaBg.pipelineData = {
@ -2172,10 +2172,10 @@ export default class BattleScene extends SceneBase {
return filteredSpecies[randSeedInt(filteredSpecies.length)];
}
generateRandomBiome(waveIndex: number): Biome {
generateRandomBiome(waveIndex: number): BiomeId {
const relWave = waveIndex % 250;
const biomes = getEnumValues(Biome).filter(b => b !== Biome.TOWN && b !== Biome.END);
const maxDepth = biomeDepths[Biome.END][0] - 2;
const biomes = getEnumValues(BiomeId).filter(b => b !== BiomeId.TOWN && b !== BiomeId.END);
const maxDepth = biomeDepths[BiomeId.END][0] - 2;
const depthWeights = new Array(maxDepth + 1)
.fill(null)
.map((_, i: number) => ((1 - Math.min(Math.abs(i / (maxDepth - 1) - relWave / 250) + 0.25, 1)) / 0.75) * 250);

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ import { PokemonType } from "#enums/pokemon-type";
import { randSeedInt } from "#app/utils/common";
import { WeatherType } from "#enums/weather-type";
import { Nature } from "#enums/nature";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id";
import { SpeciesFormKey } from "#enums/species-form-key";
@ -324,8 +324,8 @@ class MoveTimeOfDayEvolutionCondition extends SpeciesEvolutionCondition {
}
class BiomeEvolutionCondition extends SpeciesEvolutionCondition {
public biomes: Biome[];
constructor(biomes: Biome[]) {
public biomes: BiomeId[];
constructor(biomes: BiomeId[]) {
super(() => biomes.filter(b => b === globalScene.arena.biomeType).length > 0);
this.biomes = biomes;
this.description = i18next.t("pokemonEvolutions:biome");
@ -1680,31 +1680,31 @@ export const pokemonEvolutions: PokemonEvolutions = {
],
[SpeciesId.MILCERY]: [
new SpeciesFormEvolution(SpeciesId.ALCREMIE, "", "vanilla-cream", 1, EvolutionItem.STRAWBERRY_SWEET,
new BiomeEvolutionCondition([ Biome.TOWN, Biome.PLAINS, Biome.GRASS, Biome.TALL_GRASS, Biome.METROPOLIS ]),
new BiomeEvolutionCondition([ BiomeId.TOWN, BiomeId.PLAINS, BiomeId.GRASS, BiomeId.TALL_GRASS, BiomeId.METROPOLIS ]),
SpeciesWildEvolutionDelay.LONG),
new SpeciesFormEvolution(SpeciesId.ALCREMIE, "", "ruby-cream", 1, EvolutionItem.STRAWBERRY_SWEET,
new BiomeEvolutionCondition([ Biome.BADLANDS, Biome.VOLCANO, Biome.GRAVEYARD, Biome.FACTORY, Biome.SLUM ]),
new BiomeEvolutionCondition([ BiomeId.BADLANDS, BiomeId.VOLCANO, BiomeId.GRAVEYARD, BiomeId.FACTORY, BiomeId.SLUM ]),
SpeciesWildEvolutionDelay.LONG),
new SpeciesFormEvolution(SpeciesId.ALCREMIE, "", "matcha-cream", 1, EvolutionItem.STRAWBERRY_SWEET,
new BiomeEvolutionCondition([ Biome.FOREST, Biome.SWAMP, Biome.MEADOW, Biome.JUNGLE ]),
new BiomeEvolutionCondition([ BiomeId.FOREST, BiomeId.SWAMP, BiomeId.MEADOW, BiomeId.JUNGLE ]),
SpeciesWildEvolutionDelay.LONG),
new SpeciesFormEvolution(SpeciesId.ALCREMIE, "", "mint-cream", 1, EvolutionItem.STRAWBERRY_SWEET,
new BiomeEvolutionCondition([ Biome.SEA, Biome.BEACH, Biome.LAKE, Biome.SEABED ]),
new BiomeEvolutionCondition([ BiomeId.SEA, BiomeId.BEACH, BiomeId.LAKE, BiomeId.SEABED ]),
SpeciesWildEvolutionDelay.LONG),
new SpeciesFormEvolution(SpeciesId.ALCREMIE, "", "lemon-cream", 1, EvolutionItem.STRAWBERRY_SWEET,
new BiomeEvolutionCondition([ Biome.DESERT, Biome.POWER_PLANT, Biome.DOJO, Biome.RUINS, Biome.CONSTRUCTION_SITE ]),
new BiomeEvolutionCondition([ BiomeId.DESERT, BiomeId.POWER_PLANT, BiomeId.DOJO, BiomeId.RUINS, BiomeId.CONSTRUCTION_SITE ]),
SpeciesWildEvolutionDelay.LONG),
new SpeciesFormEvolution(SpeciesId.ALCREMIE, "", "salted-cream", 1, EvolutionItem.STRAWBERRY_SWEET,
new BiomeEvolutionCondition([ Biome.MOUNTAIN, Biome.CAVE, Biome.ICE_CAVE, Biome.FAIRY_CAVE, Biome.SNOWY_FOREST ]),
new BiomeEvolutionCondition([ BiomeId.MOUNTAIN, BiomeId.CAVE, BiomeId.ICE_CAVE, BiomeId.FAIRY_CAVE, BiomeId.SNOWY_FOREST ]),
SpeciesWildEvolutionDelay.LONG),
new SpeciesFormEvolution(SpeciesId.ALCREMIE, "", "ruby-swirl", 1, EvolutionItem.STRAWBERRY_SWEET,
new BiomeEvolutionCondition([ Biome.WASTELAND, Biome.LABORATORY ]),
new BiomeEvolutionCondition([ BiomeId.WASTELAND, BiomeId.LABORATORY ]),
SpeciesWildEvolutionDelay.LONG),
new SpeciesFormEvolution(SpeciesId.ALCREMIE, "", "caramel-swirl", 1, EvolutionItem.STRAWBERRY_SWEET,
new BiomeEvolutionCondition([ Biome.TEMPLE, Biome.ISLAND ]),
new BiomeEvolutionCondition([ BiomeId.TEMPLE, BiomeId.ISLAND ]),
SpeciesWildEvolutionDelay.LONG),
new SpeciesFormEvolution(SpeciesId.ALCREMIE, "", "rainbow-swirl", 1, EvolutionItem.STRAWBERRY_SWEET,
new BiomeEvolutionCondition([ Biome.ABYSS, Biome.SPACE, Biome.END ]),
new BiomeEvolutionCondition([ BiomeId.ABYSS, BiomeId.SPACE, BiomeId.END ]),
SpeciesWildEvolutionDelay.LONG)
],
[SpeciesId.DURALUDON]: [

View File

@ -8,7 +8,7 @@ import type { PokemonSpeciesForm } from "#app/data/pokemon-species";
import PokemonSpecies, { getPokemonSpecies, getPokemonSpeciesForm } from "#app/data/pokemon-species";
import { speciesStarterCosts } from "#app/data/balance/starters";
import { pokerogueApi } from "#app/plugins/api/pokerogue-api";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
export interface DailyRunConfig {
seed: number;
@ -102,48 +102,48 @@ interface BiomeWeights {
// Town and End are set to 0 however
// And some other biomes were balanced +1/-1 based on average size of the total daily.
const dailyBiomeWeights: BiomeWeights = {
[Biome.CAVE]: 3,
[Biome.LAKE]: 3,
[Biome.PLAINS]: 3,
[Biome.SNOWY_FOREST]: 3,
[Biome.SWAMP]: 3, // 2 -> 3
[Biome.TALL_GRASS]: 3, // 2 -> 3
[BiomeId.CAVE]: 3,
[BiomeId.LAKE]: 3,
[BiomeId.PLAINS]: 3,
[BiomeId.SNOWY_FOREST]: 3,
[BiomeId.SWAMP]: 3, // 2 -> 3
[BiomeId.TALL_GRASS]: 3, // 2 -> 3
[Biome.ABYSS]: 2, // 3 -> 2
[Biome.RUINS]: 2,
[Biome.BADLANDS]: 2,
[Biome.BEACH]: 2,
[Biome.CONSTRUCTION_SITE]: 2,
[Biome.DESERT]: 2,
[Biome.DOJO]: 2, // 3 -> 2
[Biome.FACTORY]: 2,
[Biome.FAIRY_CAVE]: 2,
[Biome.FOREST]: 2,
[Biome.GRASS]: 2, // 1 -> 2
[Biome.MEADOW]: 2,
[Biome.MOUNTAIN]: 2, // 3 -> 2
[Biome.SEA]: 2,
[Biome.SEABED]: 2,
[Biome.SLUM]: 2,
[Biome.TEMPLE]: 2, // 3 -> 2
[Biome.VOLCANO]: 2,
[BiomeId.ABYSS]: 2, // 3 -> 2
[BiomeId.RUINS]: 2,
[BiomeId.BADLANDS]: 2,
[BiomeId.BEACH]: 2,
[BiomeId.CONSTRUCTION_SITE]: 2,
[BiomeId.DESERT]: 2,
[BiomeId.DOJO]: 2, // 3 -> 2
[BiomeId.FACTORY]: 2,
[BiomeId.FAIRY_CAVE]: 2,
[BiomeId.FOREST]: 2,
[BiomeId.GRASS]: 2, // 1 -> 2
[BiomeId.MEADOW]: 2,
[BiomeId.MOUNTAIN]: 2, // 3 -> 2
[BiomeId.SEA]: 2,
[BiomeId.SEABED]: 2,
[BiomeId.SLUM]: 2,
[BiomeId.TEMPLE]: 2, // 3 -> 2
[BiomeId.VOLCANO]: 2,
[Biome.GRAVEYARD]: 1,
[Biome.ICE_CAVE]: 1,
[Biome.ISLAND]: 1,
[Biome.JUNGLE]: 1,
[Biome.LABORATORY]: 1,
[Biome.METROPOLIS]: 1,
[Biome.POWER_PLANT]: 1,
[Biome.SPACE]: 1,
[Biome.WASTELAND]: 1,
[BiomeId.GRAVEYARD]: 1,
[BiomeId.ICE_CAVE]: 1,
[BiomeId.ISLAND]: 1,
[BiomeId.JUNGLE]: 1,
[BiomeId.LABORATORY]: 1,
[BiomeId.METROPOLIS]: 1,
[BiomeId.POWER_PLANT]: 1,
[BiomeId.SPACE]: 1,
[BiomeId.WASTELAND]: 1,
[Biome.TOWN]: 0,
[Biome.END]: 0,
[BiomeId.TOWN]: 0,
[BiomeId.END]: 0,
};
export function getDailyStartingBiome(): Biome {
const biomes = getEnumValues(Biome).filter(b => b !== Biome.TOWN && b !== Biome.END);
export function getDailyStartingBiome(): BiomeId {
const biomes = getEnumValues(BiomeId).filter(b => b !== BiomeId.TOWN && b !== BiomeId.END);
let totalWeight = 0;
const biomeThresholds: number[] = [];

View File

@ -86,7 +86,7 @@ import { getBerryEffectFunc } from "../berry";
import { AbilityId } from "#enums/ability-id";
import { ArenaTagType } from "#enums/arena-tag-type";
import { BattlerTagType } from "#enums/battler-tag-type";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id";
import { MoveUsedEvent } from "#app/events/battle-scene";
@ -3334,65 +3334,65 @@ export class SecretPowerAttr extends MoveEffectAttr {
* Cave, Wasteland, Graveyard, Abyss, Space | Flinch
* End | Def -1
* ```
* @param biome - The current {@linkcode Biome} the battle is set in
* @param biome - The current {@linkcode BiomeId} the battle is set in
* @returns the chosen secondary effect {@linkcode MoveEffectAttr}
*/
private determineBiomeEffect(biome: Biome): MoveEffectAttr {
private determineBiomeEffect(biome: BiomeId): MoveEffectAttr {
let secondaryEffect: MoveEffectAttr;
switch (biome) {
case Biome.PLAINS:
case Biome.GRASS:
case Biome.TALL_GRASS:
case Biome.FOREST:
case Biome.JUNGLE:
case Biome.MEADOW:
case BiomeId.PLAINS:
case BiomeId.GRASS:
case BiomeId.TALL_GRASS:
case BiomeId.FOREST:
case BiomeId.JUNGLE:
case BiomeId.MEADOW:
secondaryEffect = new StatusEffectAttr(StatusEffect.SLEEP, false);
break;
case Biome.SWAMP:
case Biome.MOUNTAIN:
case Biome.TEMPLE:
case Biome.RUINS:
case BiomeId.SWAMP:
case BiomeId.MOUNTAIN:
case BiomeId.TEMPLE:
case BiomeId.RUINS:
secondaryEffect = new StatStageChangeAttr([ Stat.SPD ], -1, false);
break;
case Biome.ICE_CAVE:
case Biome.SNOWY_FOREST:
case BiomeId.ICE_CAVE:
case BiomeId.SNOWY_FOREST:
secondaryEffect = new StatusEffectAttr(StatusEffect.FREEZE, false);
break;
case Biome.VOLCANO:
case BiomeId.VOLCANO:
secondaryEffect = new StatusEffectAttr(StatusEffect.BURN, false);
break;
case Biome.FAIRY_CAVE:
case BiomeId.FAIRY_CAVE:
secondaryEffect = new StatStageChangeAttr([ Stat.SPATK ], -1, false);
break;
case Biome.DESERT:
case Biome.CONSTRUCTION_SITE:
case Biome.BEACH:
case Biome.ISLAND:
case Biome.BADLANDS:
case BiomeId.DESERT:
case BiomeId.CONSTRUCTION_SITE:
case BiomeId.BEACH:
case BiomeId.ISLAND:
case BiomeId.BADLANDS:
secondaryEffect = new StatStageChangeAttr([ Stat.ACC ], -1, false);
break;
case Biome.SEA:
case Biome.LAKE:
case Biome.SEABED:
case BiomeId.SEA:
case BiomeId.LAKE:
case BiomeId.SEABED:
secondaryEffect = new StatStageChangeAttr([ Stat.ATK ], -1, false);
break;
case Biome.CAVE:
case Biome.WASTELAND:
case Biome.GRAVEYARD:
case Biome.ABYSS:
case Biome.SPACE:
case BiomeId.CAVE:
case BiomeId.WASTELAND:
case BiomeId.GRAVEYARD:
case BiomeId.ABYSS:
case BiomeId.SPACE:
secondaryEffect = new AddBattlerTagAttr(BattlerTagType.FLINCHED, false, true);
break;
case Biome.END:
case BiomeId.END:
secondaryEffect = new StatStageChangeAttr([ Stat.DEF ], -1, false);
break;
case Biome.TOWN:
case Biome.METROPOLIS:
case Biome.SLUM:
case Biome.DOJO:
case Biome.FACTORY:
case Biome.LABORATORY:
case Biome.POWER_PLANT:
case BiomeId.TOWN:
case BiomeId.METROPOLIS:
case BiomeId.SLUM:
case BiomeId.DOJO:
case BiomeId.FACTORY:
case BiomeId.LABORATORY:
case BiomeId.POWER_PLANT:
default:
secondaryEffect = new StatusEffectAttr(StatusEffect.PARALYSIS, false);
break;
@ -6593,63 +6593,63 @@ export class CopyBiomeTypeAttr extends MoveEffectAttr {
/**
* Retrieves a type from the current biome
* @param biomeType {@linkcode Biome}
* @param biomeType {@linkcode BiomeId}
* @returns {@linkcode Type}
*/
private getTypeForBiome(biomeType: Biome): PokemonType {
private getTypeForBiome(biomeType: BiomeId): PokemonType {
switch (biomeType) {
case Biome.TOWN:
case Biome.PLAINS:
case Biome.METROPOLIS:
case BiomeId.TOWN:
case BiomeId.PLAINS:
case BiomeId.METROPOLIS:
return PokemonType.NORMAL;
case Biome.GRASS:
case Biome.TALL_GRASS:
case BiomeId.GRASS:
case BiomeId.TALL_GRASS:
return PokemonType.GRASS;
case Biome.FOREST:
case Biome.JUNGLE:
case BiomeId.FOREST:
case BiomeId.JUNGLE:
return PokemonType.BUG;
case Biome.SLUM:
case Biome.SWAMP:
case BiomeId.SLUM:
case BiomeId.SWAMP:
return PokemonType.POISON;
case Biome.SEA:
case Biome.BEACH:
case Biome.LAKE:
case Biome.SEABED:
case BiomeId.SEA:
case BiomeId.BEACH:
case BiomeId.LAKE:
case BiomeId.SEABED:
return PokemonType.WATER;
case Biome.MOUNTAIN:
case BiomeId.MOUNTAIN:
return PokemonType.FLYING;
case Biome.BADLANDS:
case BiomeId.BADLANDS:
return PokemonType.GROUND;
case Biome.CAVE:
case Biome.DESERT:
case BiomeId.CAVE:
case BiomeId.DESERT:
return PokemonType.ROCK;
case Biome.ICE_CAVE:
case Biome.SNOWY_FOREST:
case BiomeId.ICE_CAVE:
case BiomeId.SNOWY_FOREST:
return PokemonType.ICE;
case Biome.MEADOW:
case Biome.FAIRY_CAVE:
case Biome.ISLAND:
case BiomeId.MEADOW:
case BiomeId.FAIRY_CAVE:
case BiomeId.ISLAND:
return PokemonType.FAIRY;
case Biome.POWER_PLANT:
case BiomeId.POWER_PLANT:
return PokemonType.ELECTRIC;
case Biome.VOLCANO:
case BiomeId.VOLCANO:
return PokemonType.FIRE;
case Biome.GRAVEYARD:
case Biome.TEMPLE:
case BiomeId.GRAVEYARD:
case BiomeId.TEMPLE:
return PokemonType.GHOST;
case Biome.DOJO:
case Biome.CONSTRUCTION_SITE:
case BiomeId.DOJO:
case BiomeId.CONSTRUCTION_SITE:
return PokemonType.FIGHTING;
case Biome.FACTORY:
case Biome.LABORATORY:
case BiomeId.FACTORY:
case BiomeId.LABORATORY:
return PokemonType.STEEL;
case Biome.RUINS:
case Biome.SPACE:
case BiomeId.RUINS:
case BiomeId.SPACE:
return PokemonType.PSYCHIC;
case Biome.WASTELAND:
case Biome.END:
case BiomeId.WASTELAND:
case BiomeId.END:
return PokemonType.DRAGON;
case Biome.ABYSS:
case BiomeId.ABYSS:
return PokemonType.DARK;
default:
return PokemonType.UNKNOWN;
@ -6845,109 +6845,109 @@ export class NaturePowerAttr extends OverrideMoveEffectAttr {
// this allows terrains to 'override' the biome move
case TerrainType.NONE:
switch (globalScene.arena.biomeType) {
case Biome.TOWN:
case BiomeId.TOWN:
moveId = MoveId.ROUND;
break;
case Biome.METROPOLIS:
case BiomeId.METROPOLIS:
moveId = MoveId.TRI_ATTACK;
break;
case Biome.SLUM:
case BiomeId.SLUM:
moveId = MoveId.SLUDGE_BOMB;
break;
case Biome.PLAINS:
case BiomeId.PLAINS:
moveId = MoveId.SILVER_WIND;
break;
case Biome.GRASS:
case BiomeId.GRASS:
moveId = MoveId.GRASS_KNOT;
break;
case Biome.TALL_GRASS:
case BiomeId.TALL_GRASS:
moveId = MoveId.POLLEN_PUFF;
break;
case Biome.MEADOW:
case BiomeId.MEADOW:
moveId = MoveId.GIGA_DRAIN;
break;
case Biome.FOREST:
case BiomeId.FOREST:
moveId = MoveId.BUG_BUZZ;
break;
case Biome.JUNGLE:
case BiomeId.JUNGLE:
moveId = MoveId.LEAF_STORM;
break;
case Biome.SEA:
case BiomeId.SEA:
moveId = MoveId.HYDRO_PUMP;
break;
case Biome.SWAMP:
case BiomeId.SWAMP:
moveId = MoveId.MUD_BOMB;
break;
case Biome.BEACH:
case BiomeId.BEACH:
moveId = MoveId.SCALD;
break;
case Biome.LAKE:
case BiomeId.LAKE:
moveId = MoveId.BUBBLE_BEAM;
break;
case Biome.SEABED:
case BiomeId.SEABED:
moveId = MoveId.BRINE;
break;
case Biome.ISLAND:
case BiomeId.ISLAND:
moveId = MoveId.LEAF_TORNADO;
break;
case Biome.MOUNTAIN:
case BiomeId.MOUNTAIN:
moveId = MoveId.AIR_SLASH;
break;
case Biome.BADLANDS:
case BiomeId.BADLANDS:
moveId = MoveId.EARTH_POWER;
break;
case Biome.DESERT:
case BiomeId.DESERT:
moveId = MoveId.SCORCHING_SANDS;
break;
case Biome.WASTELAND:
case BiomeId.WASTELAND:
moveId = MoveId.DRAGON_PULSE;
break;
case Biome.CONSTRUCTION_SITE:
case BiomeId.CONSTRUCTION_SITE:
moveId = MoveId.STEEL_BEAM;
break;
case Biome.CAVE:
case BiomeId.CAVE:
moveId = MoveId.POWER_GEM;
break;
case Biome.ICE_CAVE:
case BiomeId.ICE_CAVE:
moveId = MoveId.ICE_BEAM;
break;
case Biome.SNOWY_FOREST:
case BiomeId.SNOWY_FOREST:
moveId = MoveId.FROST_BREATH;
break;
case Biome.VOLCANO:
case BiomeId.VOLCANO:
moveId = MoveId.LAVA_PLUME;
break;
case Biome.GRAVEYARD:
case BiomeId.GRAVEYARD:
moveId = MoveId.SHADOW_BALL;
break;
case Biome.RUINS:
case BiomeId.RUINS:
moveId = MoveId.ANCIENT_POWER;
break;
case Biome.TEMPLE:
case BiomeId.TEMPLE:
moveId = MoveId.EXTRASENSORY;
break;
case Biome.DOJO:
case BiomeId.DOJO:
moveId = MoveId.FOCUS_BLAST;
break;
case Biome.FAIRY_CAVE:
case BiomeId.FAIRY_CAVE:
moveId = MoveId.ALLURING_VOICE;
break;
case Biome.ABYSS:
case BiomeId.ABYSS:
moveId = MoveId.OMINOUS_WIND;
break;
case Biome.SPACE:
case BiomeId.SPACE:
moveId = MoveId.DRACO_METEOR;
break;
case Biome.FACTORY:
case BiomeId.FACTORY:
moveId = MoveId.FLASH_CANNON;
break;
case Biome.LABORATORY:
case BiomeId.LABORATORY:
moveId = MoveId.ZAP_CANNON;
break;
case Biome.POWER_PLANT:
case BiomeId.POWER_PLANT:
moveId = MoveId.CHARGE_BEAM;
break;
case Biome.END:
case BiomeId.END:
moveId = MoveId.ETERNABEAM;
break;
}

View File

@ -31,7 +31,7 @@ import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
import PokemonData from "#app/system/pokemon-data";
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
import { BattlerTagType } from "#enums/battler-tag-type";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { EncounterAnim } from "#enums/encounter-anims";
import { MoveId } from "#enums/move-id";
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
@ -47,46 +47,46 @@ const namespace = "mysteryEncounters/dancingLessons";
// Fire form
const BAILE_STYLE_BIOMES = [
Biome.VOLCANO,
Biome.BEACH,
Biome.ISLAND,
Biome.WASTELAND,
Biome.MOUNTAIN,
Biome.BADLANDS,
Biome.DESERT,
BiomeId.VOLCANO,
BiomeId.BEACH,
BiomeId.ISLAND,
BiomeId.WASTELAND,
BiomeId.MOUNTAIN,
BiomeId.BADLANDS,
BiomeId.DESERT,
];
// Electric form
const POM_POM_STYLE_BIOMES = [
Biome.CONSTRUCTION_SITE,
Biome.POWER_PLANT,
Biome.FACTORY,
Biome.LABORATORY,
Biome.SLUM,
Biome.METROPOLIS,
Biome.DOJO,
BiomeId.CONSTRUCTION_SITE,
BiomeId.POWER_PLANT,
BiomeId.FACTORY,
BiomeId.LABORATORY,
BiomeId.SLUM,
BiomeId.METROPOLIS,
BiomeId.DOJO,
];
// Psychic form
const PAU_STYLE_BIOMES = [
Biome.JUNGLE,
Biome.FAIRY_CAVE,
Biome.MEADOW,
Biome.PLAINS,
Biome.GRASS,
Biome.TALL_GRASS,
Biome.FOREST,
BiomeId.JUNGLE,
BiomeId.FAIRY_CAVE,
BiomeId.MEADOW,
BiomeId.PLAINS,
BiomeId.GRASS,
BiomeId.TALL_GRASS,
BiomeId.FOREST,
];
// Ghost form
const SENSU_STYLE_BIOMES = [
Biome.RUINS,
Biome.SWAMP,
Biome.CAVE,
Biome.ABYSS,
Biome.GRAVEYARD,
Biome.LAKE,
Biome.TEMPLE,
BiomeId.RUINS,
BiomeId.SWAMP,
BiomeId.CAVE,
BiomeId.ABYSS,
BiomeId.GRAVEYARD,
BiomeId.LAKE,
BiomeId.TEMPLE,
];
/**

View File

@ -20,7 +20,7 @@ import { queueEncounterMessage, showEncounterText } from "#app/data/mystery-enco
import PokemonData from "#app/system/pokemon-data";
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { getBiomeKey } from "#app/field/arena";
import { PokemonType } from "#enums/pokemon-type";
import { getPartyLuckValue, modifierTypes } from "#app/modifier/modifier-type";
@ -39,7 +39,14 @@ import {
const namespace = "mysteryEncounters/teleportingHijinks";
const MONEY_COST_MULTIPLIER = 1.75;
const BIOME_CANDIDATES = [Biome.SPACE, Biome.FAIRY_CAVE, Biome.LABORATORY, Biome.ISLAND, Biome.WASTELAND, Biome.DOJO];
const BIOME_CANDIDATES = [
BiomeId.SPACE,
BiomeId.FAIRY_CAVE,
BiomeId.LABORATORY,
BiomeId.ISLAND,
BiomeId.WASTELAND,
BiomeId.DOJO,
];
const MACHINE_INTERFACING_TYPES = [PokemonType.ELECTRIC, PokemonType.STEEL];
/**
@ -229,7 +236,7 @@ async function doBiomeTransitionDialogueAndBattleInit() {
return config;
}
async function animateBiomeChange(nextBiome: Biome) {
async function animateBiomeChange(nextBiome: BiomeId) {
return new Promise<void>(resolve => {
globalScene.tweens.add({
targets: [globalScene.arenaEnemy, globalScene.lastEnemyTrainer],

View File

@ -11,7 +11,7 @@ import { randSeedShuffle } from "#app/utils/common";
import type MysteryEncounter from "../mystery-encounter";
import { MysteryEncounterBuilder } from "../mystery-encounter";
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { TrainerType } from "#enums/trainer-type";
import i18next from "i18next";
import { SpeciesId } from "#enums/species-id";
@ -489,7 +489,7 @@ function getPartyConfig(): EnemyPartyConfig {
],
};
if (globalScene.arena.biomeType === Biome.SPACE) {
if (globalScene.arena.biomeType === BiomeId.SPACE) {
// All 3 members always Cleffa line, but different configs
baseConfig.pokemonConfigs!.push(
{

View File

@ -1,4 +1,4 @@
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
import { DarkDealEncounter } from "./encounters/dark-deal-encounter";
import { DepartmentStoreSaleEncounter } from "./encounters/department-store-sale-encounter";
@ -71,44 +71,44 @@ export const AVERAGE_ENCOUNTERS_PER_RUN_TARGET = 12;
export const ANTI_VARIANCE_WEIGHT_MODIFIER = 15;
export const EXTREME_ENCOUNTER_BIOMES = [
Biome.SEA,
Biome.SEABED,
Biome.BADLANDS,
Biome.DESERT,
Biome.ICE_CAVE,
Biome.VOLCANO,
Biome.WASTELAND,
Biome.ABYSS,
Biome.SPACE,
Biome.END,
BiomeId.SEA,
BiomeId.SEABED,
BiomeId.BADLANDS,
BiomeId.DESERT,
BiomeId.ICE_CAVE,
BiomeId.VOLCANO,
BiomeId.WASTELAND,
BiomeId.ABYSS,
BiomeId.SPACE,
BiomeId.END,
];
export const NON_EXTREME_ENCOUNTER_BIOMES = [
Biome.TOWN,
Biome.PLAINS,
Biome.GRASS,
Biome.TALL_GRASS,
Biome.METROPOLIS,
Biome.FOREST,
Biome.SWAMP,
Biome.BEACH,
Biome.LAKE,
Biome.MOUNTAIN,
Biome.CAVE,
Biome.MEADOW,
Biome.POWER_PLANT,
Biome.GRAVEYARD,
Biome.DOJO,
Biome.FACTORY,
Biome.RUINS,
Biome.CONSTRUCTION_SITE,
Biome.JUNGLE,
Biome.FAIRY_CAVE,
Biome.TEMPLE,
Biome.SLUM,
Biome.SNOWY_FOREST,
Biome.ISLAND,
Biome.LABORATORY,
BiomeId.TOWN,
BiomeId.PLAINS,
BiomeId.GRASS,
BiomeId.TALL_GRASS,
BiomeId.METROPOLIS,
BiomeId.FOREST,
BiomeId.SWAMP,
BiomeId.BEACH,
BiomeId.LAKE,
BiomeId.MOUNTAIN,
BiomeId.CAVE,
BiomeId.MEADOW,
BiomeId.POWER_PLANT,
BiomeId.GRAVEYARD,
BiomeId.DOJO,
BiomeId.FACTORY,
BiomeId.RUINS,
BiomeId.CONSTRUCTION_SITE,
BiomeId.JUNGLE,
BiomeId.FAIRY_CAVE,
BiomeId.TEMPLE,
BiomeId.SLUM,
BiomeId.SNOWY_FOREST,
BiomeId.ISLAND,
BiomeId.LABORATORY,
];
/**
@ -120,55 +120,55 @@ export const NON_EXTREME_ENCOUNTER_BIOMES = [
* + ICE_CAVE
*/
export const HUMAN_TRANSITABLE_BIOMES = [
Biome.TOWN,
Biome.PLAINS,
Biome.GRASS,
Biome.TALL_GRASS,
Biome.METROPOLIS,
Biome.FOREST,
Biome.SWAMP,
Biome.BEACH,
Biome.LAKE,
Biome.MOUNTAIN,
Biome.BADLANDS,
Biome.CAVE,
Biome.DESERT,
Biome.ICE_CAVE,
Biome.MEADOW,
Biome.POWER_PLANT,
Biome.GRAVEYARD,
Biome.DOJO,
Biome.FACTORY,
Biome.RUINS,
Biome.CONSTRUCTION_SITE,
Biome.JUNGLE,
Biome.FAIRY_CAVE,
Biome.TEMPLE,
Biome.SLUM,
Biome.SNOWY_FOREST,
Biome.ISLAND,
Biome.LABORATORY,
BiomeId.TOWN,
BiomeId.PLAINS,
BiomeId.GRASS,
BiomeId.TALL_GRASS,
BiomeId.METROPOLIS,
BiomeId.FOREST,
BiomeId.SWAMP,
BiomeId.BEACH,
BiomeId.LAKE,
BiomeId.MOUNTAIN,
BiomeId.BADLANDS,
BiomeId.CAVE,
BiomeId.DESERT,
BiomeId.ICE_CAVE,
BiomeId.MEADOW,
BiomeId.POWER_PLANT,
BiomeId.GRAVEYARD,
BiomeId.DOJO,
BiomeId.FACTORY,
BiomeId.RUINS,
BiomeId.CONSTRUCTION_SITE,
BiomeId.JUNGLE,
BiomeId.FAIRY_CAVE,
BiomeId.TEMPLE,
BiomeId.SLUM,
BiomeId.SNOWY_FOREST,
BiomeId.ISLAND,
BiomeId.LABORATORY,
];
/**
* Places where you could expect a town or city, some form of large civilization
*/
export const CIVILIZATION_ENCOUNTER_BIOMES = [
Biome.TOWN,
Biome.PLAINS,
Biome.GRASS,
Biome.TALL_GRASS,
Biome.METROPOLIS,
Biome.BEACH,
Biome.LAKE,
Biome.MEADOW,
Biome.POWER_PLANT,
Biome.GRAVEYARD,
Biome.DOJO,
Biome.FACTORY,
Biome.CONSTRUCTION_SITE,
Biome.SLUM,
Biome.ISLAND,
BiomeId.TOWN,
BiomeId.PLAINS,
BiomeId.GRASS,
BiomeId.TALL_GRASS,
BiomeId.METROPOLIS,
BiomeId.BEACH,
BiomeId.LAKE,
BiomeId.MEADOW,
BiomeId.POWER_PLANT,
BiomeId.GRAVEYARD,
BiomeId.DOJO,
BiomeId.FACTORY,
BiomeId.CONSTRUCTION_SITE,
BiomeId.SLUM,
BiomeId.ISLAND,
];
export const allMysteryEncounters: {
@ -224,41 +224,41 @@ const anyBiomeEncounters: MysteryEncounterType[] = [
* Adding specific Encounters to the mysteryEncountersByBiome map is for specific cases and special circumstances
* that biome groups do not cover
*/
export const mysteryEncountersByBiome = new Map<Biome, MysteryEncounterType[]>([
[Biome.TOWN, []],
[Biome.PLAINS, [MysteryEncounterType.SLUMBERING_SNORLAX]],
[Biome.GRASS, [MysteryEncounterType.SLUMBERING_SNORLAX, MysteryEncounterType.ABSOLUTE_AVARICE]],
[Biome.TALL_GRASS, [MysteryEncounterType.SLUMBERING_SNORLAX, MysteryEncounterType.ABSOLUTE_AVARICE]],
[Biome.METROPOLIS, []],
[Biome.FOREST, [MysteryEncounterType.SAFARI_ZONE, MysteryEncounterType.ABSOLUTE_AVARICE]],
[Biome.SEA, [MysteryEncounterType.LOST_AT_SEA]],
[Biome.SWAMP, [MysteryEncounterType.SAFARI_ZONE]],
[Biome.BEACH, []],
[Biome.LAKE, []],
[Biome.SEABED, []],
[Biome.MOUNTAIN, []],
[Biome.BADLANDS, [MysteryEncounterType.DANCING_LESSONS]],
[Biome.CAVE, [MysteryEncounterType.THE_STRONG_STUFF]],
[Biome.DESERT, [MysteryEncounterType.DANCING_LESSONS]],
[Biome.ICE_CAVE, []],
[Biome.MEADOW, []],
[Biome.POWER_PLANT, []],
[Biome.VOLCANO, [MysteryEncounterType.FIERY_FALLOUT, MysteryEncounterType.DANCING_LESSONS]],
[Biome.GRAVEYARD, []],
[Biome.DOJO, []],
[Biome.FACTORY, []],
[Biome.RUINS, []],
[Biome.WASTELAND, [MysteryEncounterType.DANCING_LESSONS]],
[Biome.ABYSS, [MysteryEncounterType.DANCING_LESSONS]],
[Biome.SPACE, [MysteryEncounterType.THE_EXPERT_POKEMON_BREEDER]],
[Biome.CONSTRUCTION_SITE, []],
[Biome.JUNGLE, [MysteryEncounterType.SAFARI_ZONE]],
[Biome.FAIRY_CAVE, []],
[Biome.TEMPLE, []],
[Biome.SLUM, []],
[Biome.SNOWY_FOREST, []],
[Biome.ISLAND, []],
[Biome.LABORATORY, []],
export const mysteryEncountersByBiome = new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.TOWN, []],
[BiomeId.PLAINS, [MysteryEncounterType.SLUMBERING_SNORLAX]],
[BiomeId.GRASS, [MysteryEncounterType.SLUMBERING_SNORLAX, MysteryEncounterType.ABSOLUTE_AVARICE]],
[BiomeId.TALL_GRASS, [MysteryEncounterType.SLUMBERING_SNORLAX, MysteryEncounterType.ABSOLUTE_AVARICE]],
[BiomeId.METROPOLIS, []],
[BiomeId.FOREST, [MysteryEncounterType.SAFARI_ZONE, MysteryEncounterType.ABSOLUTE_AVARICE]],
[BiomeId.SEA, [MysteryEncounterType.LOST_AT_SEA]],
[BiomeId.SWAMP, [MysteryEncounterType.SAFARI_ZONE]],
[BiomeId.BEACH, []],
[BiomeId.LAKE, []],
[BiomeId.SEABED, []],
[BiomeId.MOUNTAIN, []],
[BiomeId.BADLANDS, [MysteryEncounterType.DANCING_LESSONS]],
[BiomeId.CAVE, [MysteryEncounterType.THE_STRONG_STUFF]],
[BiomeId.DESERT, [MysteryEncounterType.DANCING_LESSONS]],
[BiomeId.ICE_CAVE, []],
[BiomeId.MEADOW, []],
[BiomeId.POWER_PLANT, []],
[BiomeId.VOLCANO, [MysteryEncounterType.FIERY_FALLOUT, MysteryEncounterType.DANCING_LESSONS]],
[BiomeId.GRAVEYARD, []],
[BiomeId.DOJO, []],
[BiomeId.FACTORY, []],
[BiomeId.RUINS, []],
[BiomeId.WASTELAND, [MysteryEncounterType.DANCING_LESSONS]],
[BiomeId.ABYSS, [MysteryEncounterType.DANCING_LESSONS]],
[BiomeId.SPACE, [MysteryEncounterType.THE_EXPERT_POKEMON_BREEDER]],
[BiomeId.CONSTRUCTION_SITE, []],
[BiomeId.JUNGLE, [MysteryEncounterType.SAFARI_ZONE]],
[BiomeId.FAIRY_CAVE, []],
[BiomeId.TEMPLE, []],
[BiomeId.SLUM, []],
[BiomeId.SNOWY_FOREST, []],
[BiomeId.ISLAND, []],
[BiomeId.LABORATORY, []],
]);
export function initMysteryEncounters() {

View File

@ -33,7 +33,7 @@ import { PartyUiMode } from "#app/ui/party-ui-handler";
import { UiMode } from "#enums/ui-mode";
import { isNullOrUndefined, randSeedInt, randomString, randSeedItem } from "#app/utils/common";
import type { BattlerTagType } from "#enums/battler-tag-type";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import type { TrainerType } from "#enums/trainer-type";
import i18next from "i18next";
import Trainer, { TrainerVariant } from "#app/field/trainer";
@ -1088,16 +1088,16 @@ export function getRandomEncounterSpecies(level: number, isBoss = false, rerollH
export function calculateMEAggregateStats(baseSpawnWeight: number) {
const numRuns = 1000;
let run = 0;
const biomes = Object.keys(Biome).filter(key => Number.isNaN(Number(key)));
const biomes = Object.keys(BiomeId).filter(key => Number.isNaN(Number(key)));
const alwaysPickTheseBiomes = [
Biome.ISLAND,
Biome.ABYSS,
Biome.WASTELAND,
Biome.FAIRY_CAVE,
Biome.TEMPLE,
Biome.LABORATORY,
Biome.SPACE,
Biome.WASTELAND,
BiomeId.ISLAND,
BiomeId.ABYSS,
BiomeId.WASTELAND,
BiomeId.FAIRY_CAVE,
BiomeId.TEMPLE,
BiomeId.LABORATORY,
BiomeId.SPACE,
BiomeId.WASTELAND,
];
const calculateNumEncounters = (): any[] => {
@ -1106,7 +1106,7 @@ export function calculateMEAggregateStats(baseSpawnWeight: number) {
let mostRecentEncounterWave = 0;
const encountersByBiome = new Map<string, number>(biomes.map(b => [b, 0]));
const validMEfloorsByBiome = new Map<string, number>(biomes.map(b => [b, 0]));
let currentBiome = Biome.TOWN;
let currentBiome = BiomeId.TOWN;
let currentArena = globalScene.newArena(currentBiome);
globalScene.setSeed(randomString(24));
globalScene.resetSeed();
@ -1119,9 +1119,9 @@ export function calculateMEAggregateStats(baseSpawnWeight: number) {
// New biome
if (i % 10 === 1) {
if (Array.isArray(biomeLinks[currentBiome])) {
let biomes: Biome[];
let biomes: BiomeId[];
globalScene.executeWithSeedOffset(() => {
biomes = (biomeLinks[currentBiome] as (Biome | [Biome, number])[])
biomes = (biomeLinks[currentBiome] as (BiomeId | [BiomeId, number])[])
.filter(b => {
return !Array.isArray(b) || !randSeedInt(b[1]);
})
@ -1136,10 +1136,10 @@ export function calculateMEAggregateStats(baseSpawnWeight: number) {
}
}
} else if (biomeLinks.hasOwnProperty(currentBiome)) {
currentBiome = biomeLinks[currentBiome] as Biome;
currentBiome = biomeLinks[currentBiome] as BiomeId;
} else {
if (!(i % 50)) {
currentBiome = Biome.END;
currentBiome = BiomeId.END;
} else {
currentBiome = globalScene.generateRandomBiome(i);
}
@ -1161,7 +1161,7 @@ export function calculateMEAggregateStats(baseSpawnWeight: number) {
// Otherwise, roll encounter
const roll = randSeedInt(256);
validMEfloorsByBiome.set(Biome[currentBiome], (validMEfloorsByBiome.get(Biome[currentBiome]) ?? 0) + 1);
validMEfloorsByBiome.set(BiomeId[currentBiome], (validMEfloorsByBiome.get(BiomeId[currentBiome]) ?? 0) + 1);
// If total number of encounters is lower than expected for the run, slightly favor a new encounter
// Do the reverse as well
@ -1197,7 +1197,7 @@ export function calculateMEAggregateStats(baseSpawnWeight: number) {
: tierValue > rareThreshold
? ++numEncounters[2]
: ++numEncounters[3];
encountersByBiome.set(Biome[currentBiome], (encountersByBiome.get(Biome[currentBiome]) ?? 0) + 1);
encountersByBiome.set(BiomeId[currentBiome], (encountersByBiome.get(BiomeId[currentBiome]) ?? 0) + 1);
} else {
encounterRate += WEIGHT_INCREMENT_ON_SPAWN_MISS;
}

View File

@ -1,4 +1,4 @@
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { WeatherType } from "#enums/weather-type";
import { getPokemonNameWithAffix } from "../messages";
import type Pokemon from "../field/pokemon";
@ -289,13 +289,13 @@ export function getRandomWeatherType(arena: Arena): WeatherType {
let weatherPool: WeatherPoolEntry[] = [];
const hasSun = arena.getTimeOfDay() < 2;
switch (arena.biomeType) {
case Biome.GRASS:
case BiomeId.GRASS:
weatherPool = [{ weatherType: WeatherType.NONE, weight: 7 }];
if (hasSun) {
weatherPool.push({ weatherType: WeatherType.SUNNY, weight: 3 });
}
break;
case Biome.TALL_GRASS:
case BiomeId.TALL_GRASS:
weatherPool = [
{ weatherType: WeatherType.NONE, weight: 8 },
{ weatherType: WeatherType.RAIN, weight: 5 },
@ -304,26 +304,26 @@ export function getRandomWeatherType(arena: Arena): WeatherType {
weatherPool.push({ weatherType: WeatherType.SUNNY, weight: 8 });
}
break;
case Biome.FOREST:
case BiomeId.FOREST:
weatherPool = [
{ weatherType: WeatherType.NONE, weight: 8 },
{ weatherType: WeatherType.RAIN, weight: 5 },
];
break;
case Biome.SEA:
case BiomeId.SEA:
weatherPool = [
{ weatherType: WeatherType.NONE, weight: 3 },
{ weatherType: WeatherType.RAIN, weight: 12 },
];
break;
case Biome.SWAMP:
case BiomeId.SWAMP:
weatherPool = [
{ weatherType: WeatherType.NONE, weight: 3 },
{ weatherType: WeatherType.RAIN, weight: 4 },
{ weatherType: WeatherType.FOG, weight: 1 },
];
break;
case Biome.BEACH:
case BiomeId.BEACH:
weatherPool = [
{ weatherType: WeatherType.NONE, weight: 8 },
{ weatherType: WeatherType.RAIN, weight: 3 },
@ -332,17 +332,17 @@ export function getRandomWeatherType(arena: Arena): WeatherType {
weatherPool.push({ weatherType: WeatherType.SUNNY, weight: 5 });
}
break;
case Biome.LAKE:
case BiomeId.LAKE:
weatherPool = [
{ weatherType: WeatherType.NONE, weight: 10 },
{ weatherType: WeatherType.RAIN, weight: 5 },
{ weatherType: WeatherType.FOG, weight: 1 },
];
break;
case Biome.SEABED:
case BiomeId.SEABED:
weatherPool = [{ weatherType: WeatherType.RAIN, weight: 1 }];
break;
case Biome.BADLANDS:
case BiomeId.BADLANDS:
weatherPool = [
{ weatherType: WeatherType.NONE, weight: 8 },
{ weatherType: WeatherType.SANDSTORM, weight: 2 },
@ -351,26 +351,26 @@ export function getRandomWeatherType(arena: Arena): WeatherType {
weatherPool.push({ weatherType: WeatherType.SUNNY, weight: 5 });
}
break;
case Biome.DESERT:
case BiomeId.DESERT:
weatherPool = [{ weatherType: WeatherType.SANDSTORM, weight: 2 }];
if (hasSun) {
weatherPool.push({ weatherType: WeatherType.SUNNY, weight: 2 });
}
break;
case Biome.ICE_CAVE:
case BiomeId.ICE_CAVE:
weatherPool = [
{ weatherType: WeatherType.NONE, weight: 3 },
{ weatherType: WeatherType.SNOW, weight: 4 },
{ weatherType: WeatherType.HAIL, weight: 1 },
];
break;
case Biome.MEADOW:
case BiomeId.MEADOW:
weatherPool = [{ weatherType: WeatherType.NONE, weight: 2 }];
if (hasSun) {
weatherPool.push({ weatherType: WeatherType.SUNNY, weight: 2 });
}
break;
case Biome.VOLCANO:
case BiomeId.VOLCANO:
weatherPool = [
{
weatherType: hasSun ? WeatherType.SUNNY : WeatherType.NONE,
@ -378,25 +378,25 @@ export function getRandomWeatherType(arena: Arena): WeatherType {
},
];
break;
case Biome.GRAVEYARD:
case BiomeId.GRAVEYARD:
weatherPool = [
{ weatherType: WeatherType.NONE, weight: 3 },
{ weatherType: WeatherType.FOG, weight: 1 },
];
break;
case Biome.JUNGLE:
case BiomeId.JUNGLE:
weatherPool = [
{ weatherType: WeatherType.NONE, weight: 8 },
{ weatherType: WeatherType.RAIN, weight: 2 },
];
break;
case Biome.SNOWY_FOREST:
case BiomeId.SNOWY_FOREST:
weatherPool = [
{ weatherType: WeatherType.SNOW, weight: 7 },
{ weatherType: WeatherType.HAIL, weight: 1 },
];
break;
case Biome.ISLAND:
case BiomeId.ISLAND:
weatherPool = [
{ weatherType: WeatherType.NONE, weight: 5 },
{ weatherType: WeatherType.RAIN, weight: 1 },
@ -407,7 +407,7 @@ export function getRandomWeatherType(arena: Arena): WeatherType {
break;
}
if (arena.biomeType === Biome.TOWN && timedEventManager.isEventActive()) {
if (arena.biomeType === BiomeId.TOWN && timedEventManager.isEventActive()) {
timedEventManager.getWeather()?.map(w => weatherPool.push(w));
}

View File

@ -1,4 +1,4 @@
export enum Biome {
export enum BiomeId {
// TODO: Should -1 be part of the enum signature (for "unknown place")
TOWN,
PLAINS,

View File

@ -31,7 +31,7 @@ import type Pokemon from "#app/field/pokemon";
import Overrides from "#app/overrides";
import { TagAddedEvent, TagRemovedEvent, TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena";
import type { ArenaTagType } from "#enums/arena-tag-type";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import type { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id";
import { TimeOfDay } from "#enums/time-of-day";
@ -43,7 +43,7 @@ import { WeatherType } from "#enums/weather-type";
import { FieldEffectModifier } from "#app/modifier/modifier";
export class Arena {
public biomeType: Biome;
public biomeType: BiomeId;
public weather: Weather | null;
public terrain: Terrain | null;
public tags: ArenaTag[];
@ -64,7 +64,7 @@ export class Arena {
public readonly eventTarget: EventTarget = new EventTarget();
constructor(biome: Biome, bgm: string, playerFaints = 0) {
constructor(biome: BiomeId, bgm: string, playerFaints = 0) {
this.biomeType = biome;
this.tags = [];
this.bgm = bgm;
@ -116,7 +116,7 @@ export class Arena {
const isBossSpecies =
!!globalScene.getEncounterBossSegments(waveIndex, level) &&
!!this.pokemonPool[BiomePoolTier.BOSS].length &&
(this.biomeType !== Biome.END || globalScene.gameMode.isClassic || globalScene.gameMode.isWaveFinal(waveIndex));
(this.biomeType !== BiomeId.END || globalScene.gameMode.isClassic || globalScene.gameMode.isWaveFinal(waveIndex));
const randVal = isBossSpecies ? 64 : 512;
// luck influences encounter rarity
let luckModifier = 0;
@ -242,23 +242,23 @@ export class Arena {
case SpeciesId.BURMY:
case SpeciesId.WORMADAM:
switch (this.biomeType) {
case Biome.BEACH:
case BiomeId.BEACH:
return 1;
case Biome.SLUM:
case BiomeId.SLUM:
return 2;
}
break;
case SpeciesId.ROTOM:
switch (this.biomeType) {
case Biome.VOLCANO:
case BiomeId.VOLCANO:
return 1;
case Biome.SEA:
case BiomeId.SEA:
return 2;
case Biome.ICE_CAVE:
case BiomeId.ICE_CAVE:
return 3;
case Biome.MOUNTAIN:
case BiomeId.MOUNTAIN:
return 4;
case Biome.TALL_GRASS:
case BiomeId.TALL_GRASS:
return 5;
}
break;
@ -281,9 +281,9 @@ export class Arena {
getBgTerrainColorRatioForBiome(): number {
switch (this.biomeType) {
case Biome.SPACE:
case BiomeId.SPACE:
return 1;
case Biome.END:
case BiomeId.END:
return 0;
}
@ -488,42 +488,42 @@ export class Arena {
*/
getTrainerChance(): number {
switch (this.biomeType) {
case Biome.METROPOLIS:
case BiomeId.METROPOLIS:
return 2;
case Biome.SLUM:
case Biome.BEACH:
case Biome.DOJO:
case Biome.CONSTRUCTION_SITE:
case BiomeId.SLUM:
case BiomeId.BEACH:
case BiomeId.DOJO:
case BiomeId.CONSTRUCTION_SITE:
return 4;
case Biome.PLAINS:
case Biome.GRASS:
case Biome.LAKE:
case Biome.CAVE:
case BiomeId.PLAINS:
case BiomeId.GRASS:
case BiomeId.LAKE:
case BiomeId.CAVE:
return 6;
case Biome.TALL_GRASS:
case Biome.FOREST:
case Biome.SEA:
case Biome.SWAMP:
case Biome.MOUNTAIN:
case Biome.BADLANDS:
case Biome.DESERT:
case Biome.MEADOW:
case Biome.POWER_PLANT:
case Biome.GRAVEYARD:
case Biome.FACTORY:
case Biome.SNOWY_FOREST:
case BiomeId.TALL_GRASS:
case BiomeId.FOREST:
case BiomeId.SEA:
case BiomeId.SWAMP:
case BiomeId.MOUNTAIN:
case BiomeId.BADLANDS:
case BiomeId.DESERT:
case BiomeId.MEADOW:
case BiomeId.POWER_PLANT:
case BiomeId.GRAVEYARD:
case BiomeId.FACTORY:
case BiomeId.SNOWY_FOREST:
return 8;
case Biome.ICE_CAVE:
case Biome.VOLCANO:
case Biome.RUINS:
case Biome.WASTELAND:
case Biome.JUNGLE:
case Biome.FAIRY_CAVE:
case BiomeId.ICE_CAVE:
case BiomeId.VOLCANO:
case BiomeId.RUINS:
case BiomeId.WASTELAND:
case BiomeId.JUNGLE:
case BiomeId.FAIRY_CAVE:
return 12;
case Biome.SEABED:
case Biome.ABYSS:
case Biome.SPACE:
case Biome.TEMPLE:
case BiomeId.SEABED:
case BiomeId.ABYSS:
case BiomeId.SPACE:
case BiomeId.TEMPLE:
return 16;
default:
return 0;
@ -532,7 +532,7 @@ export class Arena {
getTimeOfDay(): TimeOfDay {
switch (this.biomeType) {
case Biome.ABYSS:
case BiomeId.ABYSS:
return TimeOfDay.NIGHT;
}
@ -555,16 +555,16 @@ export class Arena {
isOutside(): boolean {
switch (this.biomeType) {
case Biome.SEABED:
case Biome.CAVE:
case Biome.ICE_CAVE:
case Biome.POWER_PLANT:
case Biome.DOJO:
case Biome.FACTORY:
case Biome.ABYSS:
case Biome.FAIRY_CAVE:
case Biome.TEMPLE:
case Biome.LABORATORY:
case BiomeId.SEABED:
case BiomeId.CAVE:
case BiomeId.ICE_CAVE:
case BiomeId.POWER_PLANT:
case BiomeId.DOJO:
case BiomeId.FACTORY:
case BiomeId.ABYSS:
case BiomeId.FAIRY_CAVE:
case BiomeId.TEMPLE:
case BiomeId.LABORATORY:
return false;
default:
return true;
@ -589,7 +589,7 @@ export class Arena {
return this.overrideTint();
}
switch (this.biomeType) {
case Biome.ABYSS:
case BiomeId.ABYSS:
return [64, 64, 64];
default:
return [128, 128, 128];
@ -615,9 +615,9 @@ export class Arena {
return this.overrideTint();
}
switch (this.biomeType) {
case Biome.ABYSS:
case Biome.SPACE:
case Biome.END:
case BiomeId.ABYSS:
case BiomeId.SPACE:
case BiomeId.END:
return this.getDayTint();
}
@ -835,78 +835,78 @@ export class Arena {
/** The loop point of any given biome track, read as seconds and milliseconds. */
getBgmLoopPoint(): number {
switch (this.biomeType) {
case Biome.TOWN:
case BiomeId.TOWN:
return 7.288;
case Biome.PLAINS:
case BiomeId.PLAINS:
return 17.485;
case Biome.GRASS:
case BiomeId.GRASS:
return 1.995;
case Biome.TALL_GRASS:
case BiomeId.TALL_GRASS:
return 9.608;
case Biome.METROPOLIS:
case BiomeId.METROPOLIS:
return 141.47;
case Biome.FOREST:
case BiomeId.FOREST:
return 0.341;
case Biome.SEA:
case BiomeId.SEA:
return 0.024;
case Biome.SWAMP:
case BiomeId.SWAMP:
return 4.461;
case Biome.BEACH:
case BiomeId.BEACH:
return 3.462;
case Biome.LAKE:
case BiomeId.LAKE:
return 7.215;
case Biome.SEABED:
case BiomeId.SEABED:
return 2.6;
case Biome.MOUNTAIN:
case BiomeId.MOUNTAIN:
return 4.018;
case Biome.BADLANDS:
case BiomeId.BADLANDS:
return 17.79;
case Biome.CAVE:
case BiomeId.CAVE:
return 14.24;
case Biome.DESERT:
case BiomeId.DESERT:
return 1.143;
case Biome.ICE_CAVE:
case BiomeId.ICE_CAVE:
return 0.0;
case Biome.MEADOW:
case BiomeId.MEADOW:
return 3.891;
case Biome.POWER_PLANT:
case BiomeId.POWER_PLANT:
return 9.447;
case Biome.VOLCANO:
case BiomeId.VOLCANO:
return 17.637;
case Biome.GRAVEYARD:
case BiomeId.GRAVEYARD:
return 13.711;
case Biome.DOJO:
case BiomeId.DOJO:
return 6.205;
case Biome.FACTORY:
case BiomeId.FACTORY:
return 4.985;
case Biome.RUINS:
case BiomeId.RUINS:
return 0.0;
case Biome.WASTELAND:
case BiomeId.WASTELAND:
return 6.336;
case Biome.ABYSS:
case BiomeId.ABYSS:
return 5.13;
case Biome.SPACE:
case BiomeId.SPACE:
return 20.036;
case Biome.CONSTRUCTION_SITE:
case BiomeId.CONSTRUCTION_SITE:
return 1.222;
case Biome.JUNGLE:
case BiomeId.JUNGLE:
return 0.0;
case Biome.FAIRY_CAVE:
case BiomeId.FAIRY_CAVE:
return 4.542;
case Biome.TEMPLE:
case BiomeId.TEMPLE:
return 2.547;
case Biome.ISLAND:
case BiomeId.ISLAND:
return 2.751;
case Biome.LABORATORY:
case BiomeId.LABORATORY:
return 114.862;
case Biome.SLUM:
case BiomeId.SLUM:
return 0.0;
case Biome.SNOWY_FOREST:
case BiomeId.SNOWY_FOREST:
return 3.047;
case Biome.END:
case BiomeId.END:
return 17.153;
default:
console.warn(`missing bgm loop-point for biome "${Biome[this.biomeType]}" (=${this.biomeType})`);
console.warn(`missing bgm loop-point for biome "${BiomeId[this.biomeType]}" (=${this.biomeType})`);
return 0;
}
}
@ -916,37 +916,37 @@ export class Arena {
}
}
export function getBiomeKey(biome: Biome): string {
return Biome[biome].toLowerCase();
export function getBiomeKey(biome: BiomeId): string {
return BiomeId[biome].toLowerCase();
}
export function getBiomeHasProps(biomeType: Biome): boolean {
export function getBiomeHasProps(biomeType: BiomeId): boolean {
switch (biomeType) {
case Biome.METROPOLIS:
case Biome.BEACH:
case Biome.LAKE:
case Biome.SEABED:
case Biome.MOUNTAIN:
case Biome.BADLANDS:
case Biome.CAVE:
case Biome.DESERT:
case Biome.ICE_CAVE:
case Biome.MEADOW:
case Biome.POWER_PLANT:
case Biome.VOLCANO:
case Biome.GRAVEYARD:
case Biome.FACTORY:
case Biome.RUINS:
case Biome.WASTELAND:
case Biome.ABYSS:
case Biome.CONSTRUCTION_SITE:
case Biome.JUNGLE:
case Biome.FAIRY_CAVE:
case Biome.TEMPLE:
case Biome.SNOWY_FOREST:
case Biome.ISLAND:
case Biome.LABORATORY:
case Biome.END:
case BiomeId.METROPOLIS:
case BiomeId.BEACH:
case BiomeId.LAKE:
case BiomeId.SEABED:
case BiomeId.MOUNTAIN:
case BiomeId.BADLANDS:
case BiomeId.CAVE:
case BiomeId.DESERT:
case BiomeId.ICE_CAVE:
case BiomeId.MEADOW:
case BiomeId.POWER_PLANT:
case BiomeId.VOLCANO:
case BiomeId.GRAVEYARD:
case BiomeId.FACTORY:
case BiomeId.RUINS:
case BiomeId.WASTELAND:
case BiomeId.ABYSS:
case BiomeId.CONSTRUCTION_SITE:
case BiomeId.JUNGLE:
case BiomeId.FAIRY_CAVE:
case BiomeId.TEMPLE:
case BiomeId.SNOWY_FOREST:
case BiomeId.ISLAND:
case BiomeId.LABORATORY:
case BiomeId.END:
return true;
}
@ -955,7 +955,7 @@ export function getBiomeHasProps(biomeType: Biome): boolean {
export class ArenaBase extends Phaser.GameObjects.Container {
public player: boolean;
public biome: Biome;
public biome: BiomeId;
public propValue: number;
public base: Phaser.GameObjects.Sprite;
public props: Phaser.GameObjects.Sprite[];
@ -978,7 +978,7 @@ export class ArenaBase extends Phaser.GameObjects.Container {
: [];
}
setBiome(biome: Biome, propValue?: number): void {
setBiome(biome: BiomeId, propValue?: number): void {
const hasProps = getBiomeHasProps(biome);
const biomeKey = getBiomeKey(biome);
const baseKey = `${biomeKey}_${this.player ? "a" : "b"}`;

View File

@ -225,7 +225,7 @@ import { ArenaTagType } from "#enums/arena-tag-type";
import { BattleSpec } from "#enums/battle-spec";
import { BattlerTagType } from "#enums/battler-tag-type";
import type { BerryType } from "#enums/berry-type";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id";
import { getPokemonNameWithAffix } from "#app/messages";
@ -333,7 +333,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
public status: Status | null;
public friendship: number;
public metLevel: number;
public metBiome: Biome | -1;
public metBiome: BiomeId | -1;
public metSpecies: SpeciesId;
public metWave: number;
public luck: number;
@ -2822,7 +2822,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
*/
trySetShiny(thresholdOverride?: number): boolean {
// Shiny Pokemon should not spawn in the end biome in endless
if (globalScene.gameMode.isEndless && globalScene.arena.biomeType === Biome.END) {
if (globalScene.gameMode.isEndless && globalScene.arena.biomeType === BiomeId.END) {
return false;
}

View File

@ -8,7 +8,7 @@ import { allSpecies } from "./data/pokemon-species";
import type { Arena } from "./field/arena";
import Overrides from "#app/overrides";
import { isNullOrUndefined, randSeedInt, randSeedItem } from "#app/utils/common";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { SpeciesId } from "#enums/species-id";
import { Challenges } from "./enums/challenges";
import { globalScene } from "#app/global-scene";
@ -128,7 +128,7 @@ export class GameMode implements GameModeConfig {
* - random biome for Daily mode
* - Town
*/
getStartingBiome(): Biome {
getStartingBiome(): BiomeId {
if (!isNullOrUndefined(Overrides.STARTING_BIOME_OVERRIDE)) {
return Overrides.STARTING_BIOME_OVERRIDE;
}
@ -137,7 +137,7 @@ export class GameMode implements GameModeConfig {
case GameModes.DAILY:
return getDailyStartingBiome();
default:
return Biome.TOWN;
return BiomeId.TOWN;
}
}
@ -202,14 +202,14 @@ export class GameMode implements GameModeConfig {
return false;
}
isTrainerBoss(waveIndex: number, biomeType: Biome, offsetGym: boolean): boolean {
isTrainerBoss(waveIndex: number, biomeType: BiomeId, offsetGym: boolean): boolean {
switch (this.modeId) {
case GameModes.DAILY:
return waveIndex > 10 && waveIndex < 50 && !(waveIndex % 10);
default:
return (
waveIndex % 30 === (offsetGym ? 0 : 20) &&
(biomeType !== Biome.END || this.isClassic || this.isWaveFinal(waveIndex))
(biomeType !== BiomeId.END || this.isClassic || this.isWaveFinal(waveIndex))
);
}
}

View File

@ -18,7 +18,7 @@ import { initChallenges } from "#app/data/challenge";
import i18next from "i18next";
import { initStatsKeys } from "#app/ui/game-stats-ui-handler";
import { initVouchers } from "#app/system/voucher";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { initMysteryEncounters } from "#app/data/mystery-encounters/mystery-encounters";
import { timedEventManager } from "./global-event-manager";
@ -177,8 +177,8 @@ export class LoadingScene extends SceneBase {
this.loadImage("default_bg", "arenas");
// Load arena images
getEnumValues(Biome).map(bt => {
const btKey = Biome[bt].toLowerCase();
getEnumValues(BiomeId).map(bt => {
const btKey = BiomeId[bt].toLowerCase();
const isBaseAnimated = btKey === "end";
const baseAKey = `${btKey}_a`;
const baseBKey = `${btKey}_b`;

View File

@ -8,7 +8,7 @@ import { Unlockables } from "#app/system/unlockables";
import { AbilityId } from "#enums/ability-id";
import { BattleType } from "#enums/battle-type";
import { BerryType } from "#enums/berry-type";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { EggTier } from "#enums/egg-type";
import { MoveId } from "#enums/move-id";
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
@ -73,7 +73,7 @@ class DefaultOverrides {
*/
readonly BATTLE_STYLE_OVERRIDE: BattleStyle | null = null;
readonly STARTING_WAVE_OVERRIDE: number = 0;
readonly STARTING_BIOME_OVERRIDE: Biome | null = null;
readonly STARTING_BIOME_OVERRIDE: BiomeId | null = null;
readonly ARENA_TINT_OVERRIDE: TimeOfDay | null = null;
/** Multiplies XP gained by this value including 0. Set to null to ignore the override. */
readonly XP_MULTIPLIER_OVERRIDE: number | null = null;

View File

@ -8,7 +8,7 @@ import { getMoveTargets } from "#app/data/moves/move";
import { speciesStarterCosts } from "#app/data/balance/starters";
import { AbilityId } from "#enums/ability-id";
import { BattlerTagType } from "#app/enums/battler-tag-type";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MoveId } from "#enums/move-id";
import { PokeballType } from "#enums/pokeball";
import type { PlayerPokemon, TurnMove } from "#app/field/pokemon";
@ -44,7 +44,7 @@ export class CommandPhase extends FieldPhase {
const cursorResetEvent =
globalScene.currentBattle.battleType === BattleType.MYSTERY_ENCOUNTER ||
globalScene.currentBattle.battleType === BattleType.TRAINER ||
globalScene.arena.biomeType === Biome.END;
globalScene.arena.biomeType === BiomeId.END;
if (commandUiHandler) {
if (
@ -241,7 +241,7 @@ export class CommandPhase extends FieldPhase {
.some(p => !globalScene.gameData.dexData[p.species.speciesId].caughtAttr) &&
globalScene.gameData.getStarterCount(d => !!d.caughtAttr) < Object.keys(speciesStarterCosts).length - 1;
if (
globalScene.arena.biomeType === Biome.END &&
globalScene.arena.biomeType === BiomeId.END &&
(!globalScene.gameMode.isClassic || globalScene.gameMode.isFreshStartChallenge() || notInDex)
) {
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
@ -344,7 +344,7 @@ export class CommandPhase extends FieldPhase {
const mysteryEncounterFleeAllowed = currentBattle.mysteryEncounter?.fleeAllowed;
if (
!isSwitch &&
(arena.biomeType === Biome.END ||
(arena.biomeType === BiomeId.END ||
(!isNullOrUndefined(mysteryEncounterFleeAllowed) && !mysteryEncounterFleeAllowed))
) {
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);

View File

@ -37,7 +37,7 @@ import { handleTutorial, Tutorial } from "#app/tutorial";
import { UiMode } from "#enums/ui-mode";
import { randSeedInt, randSeedItem } from "#app/utils/common";
import { BattleSpec } from "#enums/battle-spec";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
import { PlayerGender } from "#enums/player-gender";
import { SpeciesId } from "#enums/species-id";
@ -120,7 +120,7 @@ export class EncounterPhase extends BattlePhase {
if (
globalScene.findModifier(m => m instanceof BoostBugSpawnModifier) &&
!globalScene.gameMode.isBoss(battle.waveIndex) &&
globalScene.arena.biomeType !== Biome.END &&
globalScene.arena.biomeType !== BiomeId.END &&
randSeedInt(10) === 0
) {
enemySpecies = getGoldenBugNetSpecies(level);

View File

@ -1,6 +1,6 @@
import { globalScene } from "#app/global-scene";
import { biomeLinks, getBiomeName } from "#app/data/balance/biomes";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MoneyInterestModifier, MapModifier } from "#app/modifier/modifier";
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
import { UiMode } from "#enums/ui-mode";
@ -18,7 +18,7 @@ export class SelectBiomePhase extends BattlePhase {
const currentBiome = globalScene.arena.biomeType;
const nextWaveIndex = globalScene.currentBattle.waveIndex + 1;
const setNextBiome = (nextBiome: Biome) => {
const setNextBiome = (nextBiome: BiomeId) => {
if (nextWaveIndex % 10 === 1) {
globalScene.applyModifiers(MoneyInterestModifier, true);
globalScene.unshiftPhase(new PartyHealPhase(false));
@ -32,11 +32,11 @@ export class SelectBiomePhase extends BattlePhase {
(globalScene.gameMode.isDaily && globalScene.gameMode.isWaveFinal(nextWaveIndex)) ||
(globalScene.gameMode.hasShortBiomes && !(nextWaveIndex % 50))
) {
setNextBiome(Biome.END);
setNextBiome(BiomeId.END);
} else if (globalScene.gameMode.hasRandomBiomes) {
setNextBiome(this.generateNextBiome(nextWaveIndex));
} else if (Array.isArray(biomeLinks[currentBiome])) {
const biomes: Biome[] = (biomeLinks[currentBiome] as (Biome | [Biome, number])[])
const biomes: BiomeId[] = (biomeLinks[currentBiome] as (BiomeId | [BiomeId, number])[])
.filter(b => !Array.isArray(b) || !randSeedInt(b[1]))
.map(b => (!Array.isArray(b) ? b : b[0]));
@ -60,15 +60,15 @@ export class SelectBiomePhase extends BattlePhase {
setNextBiome(biomes[randSeedInt(biomes.length)]);
}
} else if (biomeLinks.hasOwnProperty(currentBiome)) {
setNextBiome(biomeLinks[currentBiome] as Biome);
setNextBiome(biomeLinks[currentBiome] as BiomeId);
} else {
setNextBiome(this.generateNextBiome(nextWaveIndex));
}
}
generateNextBiome(waveIndex: number): Biome {
generateNextBiome(waveIndex: number): BiomeId {
if (!(waveIndex % 50)) {
return Biome.END;
return BiomeId.END;
}
return globalScene.generateRandomBiome(waveIndex);
}

View File

@ -1,12 +1,12 @@
import { globalScene } from "#app/global-scene";
import type { Biome } from "#app/enums/biome";
import type { BiomeId } from "#app/enums/biome";
import { getBiomeKey } from "#app/field/arena";
import { BattlePhase } from "./battle-phase";
export class SwitchBiomePhase extends BattlePhase {
private nextBiome: Biome;
private nextBiome: BiomeId;
constructor(nextBiome: Biome) {
constructor(nextBiome: BiomeId) {
super();
this.nextBiome = nextBiome;

View File

@ -9,7 +9,7 @@ import { ModifierRewardPhase } from "./modifier-reward-phase";
import { MoneyRewardPhase } from "./money-reward-phase";
import { TrainerSlot } from "#enums/trainer-slot";
import { globalScene } from "#app/global-scene";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { achvs } from "#app/system/achv";
import { timedEventManager } from "#app/global-event-manager";
@ -57,7 +57,7 @@ export class TrainerVictoryPhase extends BattlePhase {
}
// Breeders in Space achievement
if (
globalScene.arena.biomeType === Biome.SPACE &&
globalScene.arena.biomeType === BiomeId.SPACE &&
(trainerType === TrainerType.BREEDER || trainerType === TrainerType.EXPERT_POKEMON_BREEDER)
) {
globalScene.validateAchv(achvs.BREEDERS_IN_SPACE);

View File

@ -1,12 +1,12 @@
import { Arena } from "../field/arena";
import type { ArenaTag } from "../data/arena-tag";
import { loadArenaTag } from "../data/arena-tag";
import type { Biome } from "#enums/biome";
import type { BiomeId } from "#enums/biome";
import { Weather } from "../data/weather";
import { Terrain } from "#app/data/terrain";
export default class ArenaData {
public biome: Biome;
public biome: BiomeId;
public weather: Weather | null;
public terrain: Terrain | null;
public tags: ArenaTag[];

View File

@ -8,7 +8,7 @@ import { Status } from "../data/status-effect";
import Pokemon, { EnemyPokemon, PokemonBattleData, PokemonMove, PokemonSummonData } from "../field/pokemon";
import { TrainerSlot } from "#enums/trainer-slot";
import type { Variant } from "#app/sprites/variant";
import type { Biome } from "#enums/biome";
import type { BiomeId } from "#enums/biome";
import type { MoveId } from "#enums/move-id";
import type { SpeciesId } from "#enums/species-id";
import { CustomPokemonData } from "#app/data/custom-pokemon-data";
@ -37,7 +37,7 @@ export default class PokemonData {
public status: Status | null;
public friendship: number;
public metLevel: number;
public metBiome: Biome | -1; // -1 for starters
public metBiome: BiomeId | -1; // -1 for starters
public metSpecies: SpeciesId;
public metWave: number; // 0 for unknown (previous saves), -1 for starters
public luck: number;

View File

@ -58,7 +58,7 @@ import { getEnumKeys } from "#app/utils/common";
import { speciesTmMoves } from "#app/data/balance/tms";
import type { BiomeTierTod } from "#app/data/balance/biomes";
import { BiomePoolTier, catchableSpecies } from "#app/data/balance/biomes";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { TimeOfDay } from "#app/enums/time-of-day";
import type { AbilityId } from "#enums/ability-id";
import { BaseStatsOverlay } from "#app/ui/base-stats-overlay";
@ -824,7 +824,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
const allBiomes = catchableSpecies[species.speciesId] ?? [];
this.preBiomes = this.sanitizeBiomes(
(catchableSpecies[this.starterId] ?? []).filter(
b => !allBiomes.some(bm => b.biome === bm.biome && b.tier === bm.tier) && !(b.biome === Biome.TOWN),
b => !allBiomes.some(bm => b.biome === bm.biome && b.tier === bm.tier) && !(b.biome === BiomeId.TOWN),
),
this.starterId,
);
@ -867,9 +867,9 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
return biomes.filter(b => {
const formIndex = (() => {
switch (b.biome) {
case Biome.BEACH:
case BiomeId.BEACH:
return 1;
case Biome.SLUM:
case BiomeId.SLUM:
return 2;
default:
return 0;
@ -882,15 +882,15 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
return biomes.filter(b => {
const formIndex = (() => {
switch (b.biome) {
case Biome.VOLCANO:
case BiomeId.VOLCANO:
return 1;
case Biome.SEA:
case BiomeId.SEA:
return 2;
case Biome.ICE_CAVE:
case BiomeId.ICE_CAVE:
return 3;
case Biome.MOUNTAIN:
case BiomeId.MOUNTAIN:
return 4;
case Biome.TALL_GRASS:
case BiomeId.TALL_GRASS:
return 5;
default:
return 0;
@ -1477,7 +1477,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
this.biomes.map(b => {
options.push({
label:
i18next.t(`biome:${Biome[b.biome].toUpperCase()}`) +
i18next.t(`biome:${BiomeId[b.biome].toUpperCase()}`) +
" - " +
i18next.t(`biome:${BiomePoolTier[b.tier].toUpperCase()}`) +
(b.tod.length === 1 && b.tod[0] === -1
@ -1498,7 +1498,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
this.preBiomes.map(b => {
options.push({
label:
i18next.t(`biome:${Biome[b.biome].toUpperCase()}`) +
i18next.t(`biome:${BiomeId[b.biome].toUpperCase()}`) +
" - " +
i18next.t(`biome:${BiomePoolTier[b.tier].toUpperCase()}`) +
(b.tod.length === 1 && b.tod[0] === -1

View File

@ -41,7 +41,7 @@ import { allAbilities } from "#app/data/data-lists";
import { allMoves } from "#app/data/data-lists";
import { speciesTmMoves } from "#app/data/balance/tms";
import { pokemonStarters } from "#app/data/balance/pokemon-evolutions";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { globalScene } from "#app/global-scene";
interface LanguageSetting {
@ -314,11 +314,11 @@ export default class PokedexUiHandler extends MessageUiHandler {
);
// biome filter, making an entry in the dropdown for each biome
const biomeOptions = Object.values(Biome)
const biomeOptions = Object.values(BiomeId)
.filter(value => typeof value === "number") // Filter numeric values from the enum
.map(
(biomeValue, index) =>
new DropDownOption(index, new DropDownLabel(i18next.t(`biome:${Biome[biomeValue].toUpperCase()}`))),
new DropDownOption(index, new DropDownLabel(i18next.t(`biome:${BiomeId[biomeValue].toUpperCase()}`))),
);
biomeOptions.push(new DropDownOption(biomeOptions.length, new DropDownLabel(i18next.t("filterBar:uncatchable"))));
const biomeDropDown: DropDown = new DropDown(0, 0, biomeOptions, this.updateStarters, DropDownType.HYBRID);
@ -1459,7 +1459,7 @@ export default class PokedexUiHandler extends MessageUiHandler {
// Biome filter
const indexToBiome = new Map(
Object.values(Biome)
Object.values(BiomeId)
.map((value, index) => (typeof value === "string" ? [index, value] : undefined))
.filter((entry): entry is [number, string] => entry !== undefined),
);
@ -1467,7 +1467,7 @@ export default class PokedexUiHandler extends MessageUiHandler {
// We get biomes for both the mon and its starters to ensure that evolutions get the correct filters.
// TODO: We might also need to do it the other way around.
const biomes = catchableSpecies[species.speciesId].concat(catchableSpecies[starterId]).map(b => Biome[b.biome]);
const biomes = catchableSpecies[species.speciesId].concat(catchableSpecies[starterId]).map(b => BiomeId[b.biome]);
if (biomes.length === 0) {
biomes.push("Uncatchable");
}

View File

@ -5,7 +5,7 @@ import type { PlayerPokemon } from "#app/field/pokemon";
import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { AbilityId } from "#enums/ability-id";
import { BattlerTagType } from "#enums/battler-tag-type";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id";
import { WeatherType } from "#enums/weather-type";
@ -134,7 +134,7 @@ describe("Abilities - Libero", () => {
const leadPokemon = game.scene.getPlayerPokemon()!;
expect(leadPokemon).not.toBe(undefined);
game.scene.arena.biomeType = Biome.MOUNTAIN;
game.scene.arena.biomeType = BiomeId.MOUNTAIN;
game.move.select(MoveId.NATURE_POWER);
await game.phaseInterceptor.to(TurnEndPhase);

View File

@ -5,7 +5,7 @@ import type { PlayerPokemon } from "#app/field/pokemon";
import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { AbilityId } from "#enums/ability-id";
import { BattlerTagType } from "#enums/battler-tag-type";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id";
import { WeatherType } from "#enums/weather-type";
@ -134,7 +134,7 @@ describe("Abilities - Protean", () => {
const leadPokemon = game.scene.getPlayerPokemon()!;
expect(leadPokemon).not.toBe(undefined);
game.scene.arena.biomeType = Biome.MOUNTAIN;
game.scene.arena.biomeType = BiomeId.MOUNTAIN;
game.move.select(MoveId.NATURE_POWER);
await game.phaseInterceptor.to(TurnEndPhase);

View File

@ -25,7 +25,7 @@ import { PlayerGender } from "#enums/player-gender";
import { SpeciesId } from "#enums/species-id";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
describe("Test Battle Phase", () => {
let phaserGame: Phaser.Game;
@ -292,7 +292,7 @@ describe("Test Battle Phase", () => {
.ability(AbilityId.ZEN_MODE)
.startingLevel(2000)
.startingWave(3)
.startingBiome(Biome.LAKE)
.startingBiome(BiomeId.LAKE)
.moveset([moveToUse]);
game.override.enemyMoveset([MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE]);
await game.classicMode.startBattle();

View File

@ -1,4 +1,4 @@
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MoveId } from "#enums/move-id";
import { MapModifier } from "#app/modifier/modifier";
import { pokerogueApi } from "#app/plugins/api/pokerogue-api";
@ -56,7 +56,7 @@ describe("Shop modifications", async () => {
game.override
.startingWave(9)
.startingBiome(Biome.ICE_CAVE)
.startingBiome(BiomeId.ICE_CAVE)
.battleStyle("single")
.startingLevel(100) // Avoid levelling up
.disableTrainerWaves()

View File

@ -1,4 +1,4 @@
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { SpeciesId } from "#enums/species-id";
import { GameModes } from "#app/game-mode";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
@ -21,7 +21,7 @@ describe("Endless Boss", () => {
beforeEach(() => {
game = new GameManager(phaserGame);
game.override.startingBiome(Biome.END).disableCrits();
game.override.startingBiome(BiomeId.END).disableCrits();
});
afterEach(() => {
@ -33,7 +33,7 @@ describe("Endless Boss", () => {
await game.runToFinalBossEncounter([SpeciesId.BIDOOF], GameModes.ENDLESS);
expect(game.scene.currentBattle.waveIndex).toBe(EndlessBossWave.Minor);
expect(game.scene.arena.biomeType).toBe(Biome.END);
expect(game.scene.arena.biomeType).toBe(BiomeId.END);
const eternatus = game.scene.getEnemyPokemon();
expect(eternatus?.species.speciesId).toBe(SpeciesId.ETERNATUS);
expect(eternatus?.hasPassive()).toBe(false);
@ -45,7 +45,7 @@ describe("Endless Boss", () => {
await game.runToFinalBossEncounter([SpeciesId.BIDOOF], GameModes.ENDLESS);
expect(game.scene.currentBattle.waveIndex).toBe(EndlessBossWave.Major);
expect(game.scene.arena.biomeType).toBe(Biome.END);
expect(game.scene.arena.biomeType).toBe(BiomeId.END);
const eternatus = game.scene.getEnemyPokemon();
expect(eternatus?.species.speciesId).toBe(SpeciesId.ETERNATUS);
expect(eternatus?.hasPassive()).toBe(false);
@ -57,7 +57,7 @@ describe("Endless Boss", () => {
await game.runToFinalBossEncounter([SpeciesId.BIDOOF], GameModes.SPLICED_ENDLESS);
expect(game.scene.currentBattle.waveIndex).toBe(EndlessBossWave.Minor);
expect(game.scene.arena.biomeType).toBe(Biome.END);
expect(game.scene.arena.biomeType).toBe(BiomeId.END);
const eternatus = game.scene.getEnemyPokemon();
expect(eternatus?.species.speciesId).toBe(SpeciesId.ETERNATUS);
expect(eternatus?.hasPassive()).toBe(false);
@ -69,7 +69,7 @@ describe("Endless Boss", () => {
await game.runToFinalBossEncounter([SpeciesId.BIDOOF], GameModes.SPLICED_ENDLESS);
expect(game.scene.currentBattle.waveIndex).toBe(EndlessBossWave.Major);
expect(game.scene.arena.biomeType).toBe(Biome.END);
expect(game.scene.arena.biomeType).toBe(BiomeId.END);
const eternatus = game.scene.getEnemyPokemon();
expect(eternatus?.species.speciesId).toBe(SpeciesId.ETERNATUS);
expect(eternatus?.hasPassive()).toBe(false);

View File

@ -1,7 +1,7 @@
import { GameModes } from "#app/game-mode";
import { TurnHeldItemTransferModifier } from "#app/modifier/modifier";
import { AbilityId } from "#enums/ability-id";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id";
import { StatusEffect } from "#enums/status-effect";
@ -26,7 +26,7 @@ describe("Final Boss", () => {
game = new GameManager(phaserGame);
game.override
.startingWave(FinalWave.Classic)
.startingBiome(Biome.END)
.startingBiome(BiomeId.END)
.disableCrits()
.enemyMoveset(MoveId.SPLASH)
.moveset([MoveId.SPLASH, MoveId.WILL_O_WISP, MoveId.DRAGON_PULSE])
@ -41,7 +41,7 @@ describe("Final Boss", () => {
await game.runToFinalBossEncounter([SpeciesId.BIDOOF], GameModes.CLASSIC);
expect(game.scene.currentBattle.waveIndex).toBe(FinalWave.Classic);
expect(game.scene.arena.biomeType).toBe(Biome.END);
expect(game.scene.arena.biomeType).toBe(BiomeId.END);
expect(game.scene.getEnemyPokemon()!.species.speciesId).toBe(SpeciesId.ETERNATUS);
});
@ -50,16 +50,16 @@ describe("Final Boss", () => {
await game.runToFinalBossEncounter([SpeciesId.BIDOOF], GameModes.CLASSIC);
expect(game.scene.currentBattle.waveIndex).not.toBe(FinalWave.Classic);
expect(game.scene.arena.biomeType).toBe(Biome.END);
expect(game.scene.arena.biomeType).toBe(BiomeId.END);
expect(game.scene.getEnemyPokemon()!.species.speciesId).not.toBe(SpeciesId.ETERNATUS);
});
it("should NOT spawn Eternatus outside of END biome", async () => {
game.override.startingBiome(Biome.FOREST);
game.override.startingBiome(BiomeId.FOREST);
await game.runToFinalBossEncounter([SpeciesId.BIDOOF], GameModes.CLASSIC);
expect(game.scene.currentBattle.waveIndex).toBe(FinalWave.Classic);
expect(game.scene.arena.biomeType).not.toBe(Biome.END);
expect(game.scene.arena.biomeType).not.toBe(BiomeId.END);
expect(game.scene.getEnemyPokemon()!.species.speciesId).not.toBe(SpeciesId.ETERNATUS);
});

View File

@ -1,7 +1,7 @@
import { Stat } from "#enums/stat";
import { SemiInvulnerableTag } from "#app/data/battler-tags";
import { PokemonType } from "#enums/pokemon-type";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { AbilityId } from "#enums/ability-id";
import { MoveId } from "#enums/move-id";
@ -51,7 +51,7 @@ describe("Moves - Flower Shield", () => {
});
it("raises DEF stat stage by 1 for all Grass-type Pokemon on the field by one stage - double battle", async () => {
game.override.enemySpecies(SpeciesId.MAGIKARP).startingBiome(Biome.GRASS).battleStyle("double");
game.override.enemySpecies(SpeciesId.MAGIKARP).startingBiome(BiomeId.GRASS).battleStyle("double");
await game.classicMode.startBattle([SpeciesId.CHERRIM, SpeciesId.MAGIKARP]);
const field = game.scene.getField(true);

View File

@ -1,5 +1,5 @@
import { AbilityId } from "#enums/ability-id";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { MoveId } from "#enums/move-id";
import { Stat } from "#enums/stat";
import { allMoves } from "#app/data/data-lists";
@ -41,7 +41,7 @@ describe("Moves - Secret Power", () => {
});
it("Secret Power checks for an active terrain first then looks at the biome for its secondary effect", async () => {
game.override.startingBiome(Biome.VOLCANO).enemyMoveset([MoveId.SPLASH, MoveId.MISTY_TERRAIN]);
game.override.startingBiome(BiomeId.VOLCANO).enemyMoveset([MoveId.SPLASH, MoveId.MISTY_TERRAIN]);
vi.spyOn(allMoves[MoveId.SECRET_POWER], "chance", "get").mockReturnValue(100);
await game.classicMode.startBattle([SpeciesId.FEEBAS]);

View File

@ -1,6 +1,6 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { HUMAN_TRANSITABLE_BIOMES } from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -23,7 +23,7 @@ import i18next from "i18next";
const namespace = "mysteryEncounters/aTrainersTest";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
describe("A Trainer's Test - Mystery Encounter", () => {
@ -43,8 +43,8 @@ describe("A Trainer's Test - Mystery Encounter", () => {
game.override.startingBiome(defaultBiome);
game.override.disableTrainerWaves();
const biomeMap = new Map<Biome, MysteryEncounterType[]>([
[Biome.VOLCANO, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
const biomeMap = new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.VOLCANO, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
]);
HUMAN_TRANSITABLE_BIOMES.forEach(biome => {
biomeMap.set(biome, [MysteryEncounterType.A_TRAINERS_TEST]);

View File

@ -1,4 +1,4 @@
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -23,7 +23,7 @@ import i18next from "i18next";
const namespace = "mysteryEncounters/absoluteAvarice";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.TALL_GRASS;
const defaultBiome = BiomeId.TALL_GRASS;
const defaultWave = 45;
describe("Absolute Avarice - Mystery Encounter", () => {
@ -44,9 +44,9 @@ describe("Absolute Avarice - Mystery Encounter", () => {
game.override.disableTrainerWaves();
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<Biome, MysteryEncounterType[]>([
[Biome.TALL_GRASS, [MysteryEncounterType.ABSOLUTE_AVARICE]],
[Biome.VOLCANO, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.TALL_GRASS, [MysteryEncounterType.ABSOLUTE_AVARICE]],
[BiomeId.VOLCANO, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
]),
);
});
@ -72,7 +72,7 @@ describe("Absolute Avarice - Mystery Encounter", () => {
it("should not spawn outside of proper biomes", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT);
game.override.startingBiome(Biome.VOLCANO);
game.override.startingBiome(BiomeId.VOLCANO);
await game.runToMysteryEncounter();
expect(game.scene.currentBattle.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.ABSOLUTE_AVARICE);

View File

@ -1,6 +1,6 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { HUMAN_TRANSITABLE_BIOMES } from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -23,7 +23,7 @@ import { AbilityId } from "#enums/ability-id";
const namespace = "mysteryEncounters/anOfferYouCantRefuse";
/** Gyarados for Indimidate */
const defaultParty = [SpeciesId.GYARADOS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
describe("An Offer You Can't Refuse - Mystery Encounter", () => {
@ -45,8 +45,8 @@ describe("An Offer You Can't Refuse - Mystery Encounter", () => {
.disableTrainerWaves()
.ability(AbilityId.INTIMIDATE); // Extortion ability
const biomeMap = new Map<Biome, MysteryEncounterType[]>([
[Biome.VOLCANO, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
const biomeMap = new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.VOLCANO, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
]);
HUMAN_TRANSITABLE_BIOMES.forEach(biome => {
biomeMap.set(biome, [MysteryEncounterType.AN_OFFER_YOU_CANT_REFUSE]);
@ -80,7 +80,7 @@ describe("An Offer You Can't Refuse - Mystery Encounter", () => {
it("should not spawn outside of HUMAN_TRANSITABLE_BIOMES", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT);
game.override.startingBiome(Biome.VOLCANO);
game.override.startingBiome(BiomeId.VOLCANO);
await game.runToMysteryEncounter();
expect(scene.currentBattle?.mysteryEncounter?.encounterType).not.toBe(

View File

@ -1,5 +1,5 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -24,7 +24,7 @@ import { AbilityId } from "#enums/ability-id";
const namespace = "mysteryEncounters/berriesAbound";
const defaultParty = [SpeciesId.PYUKUMUKU, SpeciesId.MAGIKARP, SpeciesId.PIKACHU];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
describe("Berries Abound - Mystery Encounter", () => {
@ -51,7 +51,7 @@ describe("Berries Abound - Mystery Encounter", () => {
.enemyPassiveAbility(AbilityId.BALL_FETCH);
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<Biome, MysteryEncounterType[]>([[Biome.CAVE, [MysteryEncounterType.BERRIES_ABOUND]]]),
new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.BERRIES_ABOUND]]]),
);
});

View File

@ -1,5 +1,5 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -27,7 +27,7 @@ import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
const namespace = "mysteryEncounters/bugTypeSuperfan";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.WEEDLE];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 24;
const POOL_1_POKEMON = [
@ -160,7 +160,7 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
game.override.disableTrainerWaves();
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<Biome, MysteryEncounterType[]>([[Biome.CAVE, [MysteryEncounterType.BUG_TYPE_SUPERFAN]]]),
new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.BUG_TYPE_SUPERFAN]]]),
);
});

View File

@ -1,5 +1,5 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -40,7 +40,7 @@ import { NewBattlePhase } from "#app/phases/new-battle-phase";
const namespace = "mysteryEncounters/clowningAround";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
describe("Clowning Around - Mystery Encounter", () => {
@ -61,7 +61,7 @@ describe("Clowning Around - Mystery Encounter", () => {
game.override.disableTrainerWaves();
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<Biome, MysteryEncounterType[]>([[Biome.CAVE, [MysteryEncounterType.CLOWNING_AROUND]]]),
new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.CLOWNING_AROUND]]]),
);
});

View File

@ -1,4 +1,4 @@
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -26,7 +26,7 @@ import { LearnMovePhase } from "#app/phases/learn-move-phase";
const namespace = "mysteryEncounters/dancingLessons";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.PLAINS;
const defaultBiome = BiomeId.PLAINS;
const defaultWave = 45;
describe("Dancing Lessons - Mystery Encounter", () => {
@ -47,9 +47,9 @@ describe("Dancing Lessons - Mystery Encounter", () => {
game.override.disableTrainerWaves();
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<Biome, MysteryEncounterType[]>([
[Biome.PLAINS, [MysteryEncounterType.DANCING_LESSONS]],
[Biome.SPACE, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.PLAINS, [MysteryEncounterType.DANCING_LESSONS]],
[BiomeId.SPACE, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
]),
);
});
@ -75,7 +75,7 @@ describe("Dancing Lessons - Mystery Encounter", () => {
it("should not spawn outside of proper biomes", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT);
game.override.startingBiome(Biome.SPACE);
game.override.startingBiome(BiomeId.SPACE);
await game.runToMysteryEncounter();
expect(game.scene.currentBattle.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.DANCING_LESSONS);

View File

@ -1,4 +1,4 @@
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -31,7 +31,7 @@ import { BerryType } from "#enums/berry-type";
const namespace = "mysteryEncounters/delibirdy";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
describe("Delibird-y - Mystery Encounter", () => {
@ -52,7 +52,7 @@ describe("Delibird-y - Mystery Encounter", () => {
game.override.disableTrainerWaves();
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<Biome, MysteryEncounterType[]>([[Biome.CAVE, [MysteryEncounterType.DELIBIRDY]]]),
new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.DELIBIRDY]]]),
);
});

View File

@ -1,5 +1,5 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -17,7 +17,7 @@ import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
const namespace = "mysteryEncounters/departmentStoreSale";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.PLAINS;
const defaultBiome = BiomeId.PLAINS;
const defaultWave = 37;
describe("Department Store Sale - Mystery Encounter", () => {
@ -37,8 +37,8 @@ describe("Department Store Sale - Mystery Encounter", () => {
game.override.startingBiome(defaultBiome);
game.override.disableTrainerWaves();
const biomeMap = new Map<Biome, MysteryEncounterType[]>([
[Biome.VOLCANO, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
const biomeMap = new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.VOLCANO, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
]);
CIVILIZATION_ENCOUNTER_BIOMES.forEach(biome => {
biomeMap.set(biome, [MysteryEncounterType.DEPARTMENT_STORE_SALE]);
@ -75,7 +75,7 @@ describe("Department Store Sale - Mystery Encounter", () => {
it("should not spawn outside of CIVILIZATION_ENCOUNTER_BIOMES", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.COMMON);
game.override.startingBiome(Biome.VOLCANO);
game.override.startingBiome(BiomeId.VOLCANO);
await game.runToMysteryEncounter();
expect(scene.currentBattle?.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.DEPARTMENT_STORE_SALE);

View File

@ -1,4 +1,4 @@
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -18,7 +18,7 @@ import i18next from "i18next";
const namespace = "mysteryEncounters/fieldTrip";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
describe("Field Trip - Mystery Encounter", () => {
@ -40,7 +40,7 @@ describe("Field Trip - Mystery Encounter", () => {
game.override.moveset([MoveId.TACKLE, MoveId.UPROAR, MoveId.SWORDS_DANCE]);
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<Biome, MysteryEncounterType[]>([[Biome.CAVE, [MysteryEncounterType.FIELD_TRIP]]]),
new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.FIELD_TRIP]]]),
);
});

View File

@ -1,5 +1,5 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -34,7 +34,7 @@ import { StatusEffect } from "#enums/status-effect";
const namespace = "mysteryEncounters/fieryFallout";
/** Arcanine and Ninetails for 2 Fire types. Lapras, Gengar, Abra for burnable mon. */
const defaultParty = [SpeciesId.ARCANINE, SpeciesId.NINETALES, SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.VOLCANO;
const defaultBiome = BiomeId.VOLCANO;
const defaultWave = 56;
describe("Fiery Fallout - Mystery Encounter", () => {
@ -57,9 +57,9 @@ describe("Fiery Fallout - Mystery Encounter", () => {
.moveset([MoveId.PAYBACK, MoveId.THUNDERBOLT]); // Required for attack type booster item generation
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<Biome, MysteryEncounterType[]>([
[Biome.VOLCANO, [MysteryEncounterType.FIERY_FALLOUT]],
[Biome.MOUNTAIN, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.VOLCANO, [MysteryEncounterType.FIERY_FALLOUT]],
[BiomeId.MOUNTAIN, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
]),
);
});
@ -84,7 +84,7 @@ describe("Fiery Fallout - Mystery Encounter", () => {
});
it("should not spawn outside of volcano biome", async () => {
game.override.startingBiome(Biome.MOUNTAIN);
game.override.startingBiome(BiomeId.MOUNTAIN);
await game.runToMysteryEncounter();
expect(scene.currentBattle?.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.FIERY_FALLOUT);

View File

@ -1,5 +1,5 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -25,7 +25,7 @@ import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
const namespace = "mysteryEncounters/fightOrFlight";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
describe("Fight or Flight - Mystery Encounter", () => {
@ -46,7 +46,7 @@ describe("Fight or Flight - Mystery Encounter", () => {
game.override.disableTrainerWaves();
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<Biome, MysteryEncounterType[]>([[Biome.CAVE, [MysteryEncounterType.FIGHT_OR_FLIGHT]]]),
new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.FIGHT_OR_FLIGHT]]]),
);
});

View File

@ -1,6 +1,6 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { HUMAN_TRANSITABLE_BIOMES } from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -27,7 +27,7 @@ import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encount
const namespace = "mysteryEncounters/funAndGames";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
describe("Fun And Games! - Mystery Encounter", () => {
@ -47,7 +47,9 @@ describe("Fun And Games! - Mystery Encounter", () => {
game.override.startingBiome(defaultBiome);
game.override.disableTrainerWaves();
const biomeMap = new Map<Biome, MysteryEncounterType[]>([[Biome.VOLCANO, [MysteryEncounterType.FIGHT_OR_FLIGHT]]]);
const biomeMap = new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.VOLCANO, [MysteryEncounterType.FIGHT_OR_FLIGHT]],
]);
HUMAN_TRANSITABLE_BIOMES.forEach(biome => {
biomeMap.set(biome, [MysteryEncounterType.FUN_AND_GAMES]);
});
@ -80,7 +82,7 @@ describe("Fun And Games! - Mystery Encounter", () => {
it("should not spawn outside of CIVILIZATIONN biomes", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT);
game.override.startingBiome(Biome.VOLCANO);
game.override.startingBiome(BiomeId.VOLCANO);
await game.runToMysteryEncounter();
expect(scene.currentBattle?.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.FUN_AND_GAMES);

View File

@ -1,4 +1,4 @@
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -22,7 +22,7 @@ import * as Utils from "#app/utils/common";
const namespace = "mysteryEncounters/globalTradeSystem";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
describe("Global Trade System - Mystery Encounter", () => {
@ -42,8 +42,8 @@ describe("Global Trade System - Mystery Encounter", () => {
game.override.startingBiome(defaultBiome);
game.override.disableTrainerWaves();
const biomeMap = new Map<Biome, MysteryEncounterType[]>([
[Biome.VOLCANO, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
const biomeMap = new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.VOLCANO, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
]);
CIVILIZATION_ENCOUNTER_BIOMES.forEach(biome => {
biomeMap.set(biome, [MysteryEncounterType.GLOBAL_TRADE_SYSTEM]);
@ -86,7 +86,7 @@ describe("Global Trade System - Mystery Encounter", () => {
it("should not spawn outside of CIVILIZATION_ENCOUNTER_BIOMES", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.COMMON);
game.override.startingBiome(Biome.VOLCANO);
game.override.startingBiome(BiomeId.VOLCANO);
await game.runToMysteryEncounter();
expect(scene.currentBattle?.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.GLOBAL_TRADE_SYSTEM);

View File

@ -2,7 +2,7 @@ import { LostAtSeaEncounter } from "#app/data/mystery-encounters/encounters/lost
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils";
import { getPokemonSpecies } from "#app/data/pokemon-species";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -19,7 +19,7 @@ import i18next from "i18next";
const namespace = "mysteryEncounters/lostAtSea";
/** Blastoise for surf. Pidgeot for fly. Abra for none. */
const defaultParty = [SpeciesId.BLASTOISE, SpeciesId.PIDGEOT, SpeciesId.ABRA];
const defaultBiome = Biome.SEA;
const defaultBiome = BiomeId.SEA;
const defaultWave = 33;
describe("Lost at Sea - Mystery Encounter", () => {
@ -40,9 +40,9 @@ describe("Lost at Sea - Mystery Encounter", () => {
game.override.disableTrainerWaves();
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<Biome, MysteryEncounterType[]>([
[Biome.SEA, [MysteryEncounterType.LOST_AT_SEA]],
[Biome.MOUNTAIN, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.SEA, [MysteryEncounterType.LOST_AT_SEA]],
[BiomeId.MOUNTAIN, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
]),
);
});
@ -68,7 +68,7 @@ describe("Lost at Sea - Mystery Encounter", () => {
it("should not spawn outside of sea biome", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.COMMON);
game.override.startingBiome(Biome.MOUNTAIN);
game.override.startingBiome(BiomeId.MOUNTAIN);
await game.runToMysteryEncounter();
expect(game.scene.currentBattle.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.LOST_AT_SEA);

View File

@ -1,6 +1,6 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { HUMAN_TRANSITABLE_BIOMES } from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -28,7 +28,7 @@ import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
const namespace = "mysteryEncounters/mysteriousChallengers";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
describe("Mysterious Challengers - Mystery Encounter", () => {
@ -48,7 +48,9 @@ describe("Mysterious Challengers - Mystery Encounter", () => {
game.override.startingBiome(defaultBiome);
game.override.disableTrainerWaves();
const biomeMap = new Map<Biome, MysteryEncounterType[]>([[Biome.VOLCANO, [MysteryEncounterType.FIGHT_OR_FLIGHT]]]);
const biomeMap = new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.VOLCANO, [MysteryEncounterType.FIGHT_OR_FLIGHT]],
]);
HUMAN_TRANSITABLE_BIOMES.forEach(biome => {
biomeMap.set(biome, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]);
});
@ -78,7 +80,7 @@ describe("Mysterious Challengers - Mystery Encounter", () => {
it("should not spawn outside of HUMAN_TRANSITABLE_BIOMES", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT);
game.override.startingBiome(Biome.VOLCANO);
game.override.startingBiome(BiomeId.VOLCANO);
await game.runToMysteryEncounter();
expect(scene.currentBattle?.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.MYSTERIOUS_CHALLENGERS);

View File

@ -1,5 +1,5 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -21,7 +21,7 @@ import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases";
const namespace = "mysteryEncounters/partTimer";
// Pyukumuku for lowest speed, Regieleki for highest speed, Feebas for lowest "bulk", Melmetal for highest "bulk"
const defaultParty = [SpeciesId.PYUKUMUKU, SpeciesId.REGIELEKI, SpeciesId.FEEBAS, SpeciesId.MELMETAL];
const defaultBiome = Biome.PLAINS;
const defaultBiome = BiomeId.PLAINS;
const defaultWave = 37;
describe("Part-Timer - Mystery Encounter", () => {
@ -41,8 +41,8 @@ describe("Part-Timer - Mystery Encounter", () => {
game.override.startingBiome(defaultBiome);
game.override.disableTrainerWaves();
const biomeMap = new Map<Biome, MysteryEncounterType[]>([
[Biome.VOLCANO, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
const biomeMap = new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.VOLCANO, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
]);
CIVILIZATION_ENCOUNTER_BIOMES.forEach(biome => {
biomeMap.set(biome, [MysteryEncounterType.PART_TIMER]);
@ -77,7 +77,7 @@ describe("Part-Timer - Mystery Encounter", () => {
it("should not spawn outside of CIVILIZATION_ENCOUNTER_BIOMES", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.COMMON);
game.override.startingBiome(Biome.VOLCANO);
game.override.startingBiome(BiomeId.VOLCANO);
await game.runToMysteryEncounter();
expect(scene.currentBattle?.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.PART_TIMER);

View File

@ -1,5 +1,5 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -23,7 +23,7 @@ import { NON_LEGEND_PARADOX_POKEMON } from "#app/data/balance/special-species-gr
const namespace = "mysteryEncounters/safariZone";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.SWAMP;
const defaultBiome = BiomeId.SWAMP;
const defaultWave = 45;
describe("Safari Zone - Mystery Encounter", () => {
@ -43,11 +43,11 @@ describe("Safari Zone - Mystery Encounter", () => {
game.override.startingBiome(defaultBiome);
game.override.disableTrainerWaves();
const biomeMap = new Map<Biome, MysteryEncounterType[]>([
[Biome.VOLCANO, [MysteryEncounterType.FIGHT_OR_FLIGHT]],
[Biome.FOREST, [MysteryEncounterType.SAFARI_ZONE]],
[Biome.SWAMP, [MysteryEncounterType.SAFARI_ZONE]],
[Biome.JUNGLE, [MysteryEncounterType.SAFARI_ZONE]],
const biomeMap = new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.VOLCANO, [MysteryEncounterType.FIGHT_OR_FLIGHT]],
[BiomeId.FOREST, [MysteryEncounterType.SAFARI_ZONE]],
[BiomeId.SWAMP, [MysteryEncounterType.SAFARI_ZONE]],
[BiomeId.JUNGLE, [MysteryEncounterType.SAFARI_ZONE]],
]);
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(biomeMap);
});
@ -73,7 +73,7 @@ describe("Safari Zone - Mystery Encounter", () => {
it("should not spawn outside of the forest, swamp, or jungle biomes", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT);
game.override.startingBiome(Biome.VOLCANO);
game.override.startingBiome(BiomeId.VOLCANO);
await game.runToMysteryEncounter();
expect(scene.currentBattle?.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.SAFARI_ZONE);

View File

@ -2,7 +2,7 @@ import type BattleScene from "#app/battle-scene";
import { TeleportingHijinksEncounter } from "#app/data/mystery-encounters/encounters/teleporting-hijinks-encounter";
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { AbilityId } from "#enums/ability-id";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import { CommandPhase } from "#app/phases/command-phase";
@ -24,10 +24,17 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vite
const namespace = "mysteryEncounters/teleportingHijinks";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
const TRANSPORT_BIOMES = [Biome.SPACE, Biome.ISLAND, Biome.LABORATORY, Biome.FAIRY_CAVE, Biome.WASTELAND, Biome.DOJO];
const TRANSPORT_BIOMES = [
BiomeId.SPACE,
BiomeId.ISLAND,
BiomeId.LABORATORY,
BiomeId.FAIRY_CAVE,
BiomeId.WASTELAND,
BiomeId.DOJO,
];
describe("Teleporting Hijinks - Mystery Encounter", () => {
let phaserGame: Phaser.Game;
@ -51,7 +58,7 @@ describe("Teleporting Hijinks - Mystery Encounter", () => {
.enemyPassiveAbility(AbilityId.BALL_FETCH);
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<Biome, MysteryEncounterType[]>([[Biome.CAVE, [MysteryEncounterType.TELEPORTING_HIJINKS]]]),
new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.TELEPORTING_HIJINKS]]]),
);
});

View File

@ -1,6 +1,6 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { HUMAN_TRANSITABLE_BIOMES } from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -25,7 +25,7 @@ import { FRIENDSHIP_GAIN_FROM_BATTLE } from "#app/data/balance/starters";
const namespace = "mysteryEncounters/theExpertPokemonBreeder";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
describe("The Expert Pokémon Breeder - Mystery Encounter", () => {
@ -45,7 +45,9 @@ describe("The Expert Pokémon Breeder - Mystery Encounter", () => {
game.override.startingBiome(defaultBiome);
game.override.disableTrainerWaves();
const biomeMap = new Map<Biome, MysteryEncounterType[]>([[Biome.VOLCANO, [MysteryEncounterType.FIGHT_OR_FLIGHT]]]);
const biomeMap = new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.VOLCANO, [MysteryEncounterType.FIGHT_OR_FLIGHT]],
]);
HUMAN_TRANSITABLE_BIOMES.forEach(biome => {
biomeMap.set(biome, [MysteryEncounterType.THE_EXPERT_POKEMON_BREEDER]);
});
@ -83,7 +85,7 @@ describe("The Expert Pokémon Breeder - Mystery Encounter", () => {
it("should not spawn outside of HUMAN_TRANSITABLE_BIOMES", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT);
game.override.startingBiome(Biome.VOLCANO);
game.override.startingBiome(BiomeId.VOLCANO);
await game.runToMysteryEncounter();
expect(scene.currentBattle?.mysteryEncounter?.encounterType).not.toBe(

View File

@ -1,5 +1,5 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -24,7 +24,7 @@ import { NON_LEGEND_PARADOX_POKEMON } from "#app/data/balance/special-species-gr
const namespace = "mysteryEncounters/thePokemonSalesman";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
describe("The Pokemon Salesman - Mystery Encounter", () => {
@ -44,8 +44,8 @@ describe("The Pokemon Salesman - Mystery Encounter", () => {
game.override.startingBiome(defaultBiome);
game.override.disableTrainerWaves();
const biomeMap = new Map<Biome, MysteryEncounterType[]>([
[Biome.VOLCANO, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
const biomeMap = new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.VOLCANO, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
]);
HUMAN_TRANSITABLE_BIOMES.forEach(biome => {
biomeMap.set(biome, [MysteryEncounterType.THE_POKEMON_SALESMAN]);
@ -80,7 +80,7 @@ describe("The Pokemon Salesman - Mystery Encounter", () => {
it("should not spawn outside of HUMAN_TRANSITABLE_BIOMES", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.ULTRA);
game.override.startingBiome(Biome.VOLCANO);
game.override.startingBiome(BiomeId.VOLCANO);
await game.runToMysteryEncounter();
expect(scene.currentBattle?.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.THE_POKEMON_SALESMAN);

View File

@ -1,5 +1,5 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -32,7 +32,7 @@ import { AbilityId } from "#enums/ability-id";
const namespace = "mysteryEncounters/theStrongStuff";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
describe("The Strong Stuff - Mystery Encounter", () => {
@ -56,9 +56,9 @@ describe("The Strong Stuff - Mystery Encounter", () => {
.enemyPassiveAbility(AbilityId.BALL_FETCH);
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<Biome, MysteryEncounterType[]>([
[Biome.CAVE, [MysteryEncounterType.THE_STRONG_STUFF]],
[Biome.MOUNTAIN, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.CAVE, [MysteryEncounterType.THE_STRONG_STUFF]],
[BiomeId.MOUNTAIN, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
]),
);
});
@ -84,7 +84,7 @@ describe("The Strong Stuff - Mystery Encounter", () => {
it("should not spawn outside of CAVE biome", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.COMMON);
game.override.startingBiome(Biome.MOUNTAIN);
game.override.startingBiome(BiomeId.MOUNTAIN);
await game.runToMysteryEncounter();
expect(scene.currentBattle?.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.THE_STRONG_STUFF);

View File

@ -1,6 +1,6 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { HUMAN_TRANSITABLE_BIOMES } from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -29,7 +29,7 @@ import { StatusEffect } from "#enums/status-effect";
const namespace = "mysteryEncounters/theWinstrateChallenge";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
describe("The Winstrate Challenge - Mystery Encounter", () => {
@ -49,7 +49,9 @@ describe("The Winstrate Challenge - Mystery Encounter", () => {
game.override.startingBiome(defaultBiome);
game.override.disableTrainerWaves();
const biomeMap = new Map<Biome, MysteryEncounterType[]>([[Biome.VOLCANO, [MysteryEncounterType.FIGHT_OR_FLIGHT]]]);
const biomeMap = new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.VOLCANO, [MysteryEncounterType.FIGHT_OR_FLIGHT]],
]);
HUMAN_TRANSITABLE_BIOMES.forEach(biome => {
biomeMap.set(biome, [MysteryEncounterType.THE_WINSTRATE_CHALLENGE]);
});
@ -85,7 +87,7 @@ describe("The Winstrate Challenge - Mystery Encounter", () => {
it("should not spawn outside of HUMAN_TRANSITABLE_BIOMES", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT);
game.override.startingBiome(Biome.VOLCANO);
game.override.startingBiome(BiomeId.VOLCANO);
await game.runToMysteryEncounter();
expect(scene.currentBattle?.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.THE_WINSTRATE_CHALLENGE);

View File

@ -9,7 +9,7 @@ import {
generateModifierType,
} from "#app/data/mystery-encounters/utils/encounter-phase-utils";
import { getPokemonSpecies } from "#app/data/pokemon-species";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import { PokemonMove } from "#app/field/pokemon";
@ -35,7 +35,7 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vite
const namespace = "mysteryEncounters/trashToTreasure";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
describe("Trash to Treasure - Mystery Encounter", () => {
@ -56,7 +56,7 @@ describe("Trash to Treasure - Mystery Encounter", () => {
game.override.disableTrainerWaves();
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<Biome, MysteryEncounterType[]>([[Biome.CAVE, [MysteryEncounterType.TRASH_TO_TREASURE]]]),
new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.TRASH_TO_TREASURE]]]),
);
});

View File

@ -1,5 +1,5 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -31,7 +31,7 @@ import { AbilityId } from "#enums/ability-id";
const namespace = "mysteryEncounters/uncommonBreed";
const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
describe("Uncommon Breed - Mystery Encounter", () => {
@ -56,7 +56,7 @@ describe("Uncommon Breed - Mystery Encounter", () => {
.enemyPassiveAbility(AbilityId.BALL_FETCH);
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<Biome, MysteryEncounterType[]>([[Biome.CAVE, [MysteryEncounterType.UNCOMMON_BREED]]]),
new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.UNCOMMON_BREED]]]),
);
});

View File

@ -1,5 +1,5 @@
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import { Biome } from "#app/enums/biome";
import { BiomeId } from "#app/enums/biome";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
@ -23,7 +23,7 @@ import { ModifierTier } from "#app/modifier/modifier-tier";
const namespace = "mysteryEncounters/weirdDream";
const defaultParty = [SpeciesId.MAGBY, SpeciesId.HAUNTER, SpeciesId.ABRA];
const defaultBiome = Biome.CAVE;
const defaultBiome = BiomeId.CAVE;
const defaultWave = 45;
describe("Weird Dream - Mystery Encounter", () => {
@ -47,7 +47,7 @@ describe("Weird Dream - Mystery Encounter", () => {
);
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<Biome, MysteryEncounterType[]>([[Biome.CAVE, [MysteryEncounterType.WEIRD_DREAM]]]),
new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.WEIRD_DREAM]]]),
);
});

View File

@ -1,4 +1,4 @@
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { AbilityId } from "#enums/ability-id";
import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id";
@ -32,7 +32,7 @@ describe("Game Over Phase", () => {
.enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(MoveId.SPLASH)
.startingWave(200)
.startingBiome(Biome.END)
.startingBiome(BiomeId.END)
.startingLevel(10000);
});

View File

@ -2,7 +2,7 @@ import { GameModes } from "#app/game-mode";
import { pokerogueApi } from "#app/plugins/api/pokerogue-api";
import type OptionSelectUiHandler from "#app/ui/settings/option-select-ui-handler";
import { UiMode } from "#enums/ui-mode";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { Button } from "#enums/buttons";
import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id";
@ -80,7 +80,7 @@ describe("Reload", () => {
it("should not have weather inconsistencies after a biome switch", async () => {
game.override
.startingWave(10)
.startingBiome(Biome.ICE_CAVE) // Will lead to Snowy Forest with randomly generated weather
.startingBiome(BiomeId.ICE_CAVE) // Will lead to Snowy Forest with randomly generated weather
.battleStyle("single")
.startingLevel(100) // Avoid levelling up
.disableTrainerWaves()

View File

@ -5,7 +5,7 @@ import type { ModifierOverride } from "#app/modifier/modifier-type";
import type { BattleStyle } from "#app/overrides";
import Overrides, { defaultOverrides } from "#app/overrides";
import type { Unlockables } from "#app/system/unlockables";
import { Biome } from "#enums/biome";
import { BiomeId } from "#enums/biome";
import { MoveId } from "#enums/move-id";
import type { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
@ -32,9 +32,9 @@ export class OverridesHelper extends GameManagerHelper {
* @warning Any event listeners that are attached to [NewArenaEvent](events\battle-scene.ts) may need to be handled down the line
* @param biome - The biome to set
*/
public startingBiome(biome: Biome): this {
public startingBiome(biome: BiomeId): this {
this.game.scene.newArena(biome);
this.log(`Starting biome set to ${Biome[biome]} (=${biome})!`);
this.log(`Starting biome set to ${BiomeId[biome]} (=${biome})!`);
return this;
}