Fixed Conflicts With creeping fog ME

Signed-off-by: Fuad Ali <fuad.ali@tecnico.ulisboa.pt>
Co-authored-by: Matilde Simões <matilde.simoes@tecnico.ulisboa.pt>
This commit is contained in:
Fuad Ali 2025-06-12 22:59:13 +01:00
parent 27ccd250c2
commit 266eed4d98
3 changed files with 112 additions and 107 deletions

View File

@ -10,25 +10,25 @@ import {
import { BerryType } from "#enums/berry-type"; import { BerryType } from "#enums/berry-type";
import { randSeedInt } from "#app/utils/common"; import { randSeedInt } from "#app/utils/common";
import { globalScene } from "#app/global-scene"; import { globalScene } from "#app/global-scene";
import { modifierTypes } from "#app/modifier/modifier-type"; import { modifierTypes } from "#app/data/data-lists";
import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { MysteryEncounterType } from "#enums/mystery-encounter-type";
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
import { Moves } from "#enums/moves"; import { MoveId } from "#enums/move-id";
import { Species } from "#enums/species"; import { SpeciesId } from "#enums/species-id";
import { Nature } from "#enums/nature"; import { Nature } from "#enums/nature";
import { getPokemonSpecies } from "#app/data/pokemon-species"; import { getPokemonSpecies } from "#app/data/pokemon-species";
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type"; import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
import { TimeOfDayRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements"; import { TimeOfDayRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements";
import { TimeOfDay } from "#enums/time-of-day"; import { TimeOfDay } from "#enums/time-of-day";
import type { Abilities } from "#enums/abilities"; import type { AbilityId } from "#enums/ability-id";
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import type HeldModifierConfig from "#app/interfaces/held-modifier-config"; import type HeldModifierConfig from "#app/@types/held-modifier-config";
import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter"; import { MysteryEncounterBuilder } from "#app/data/mystery-encounters/mystery-encounter";
import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option"; import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option";
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
import { CustomPokemonData } from "#app/data/custom-pokemon-data"; import { CustomPokemonData } from "#app/data/custom-pokemon-data";
import { ModifierTier } from "#app/modifier/modifier-tier"; import { ModifierTier } from "#enums/modifier-tier";
import { import {
MoveRequirement, MoveRequirement,
AbilityRequirement, AbilityRequirement,
@ -40,7 +40,7 @@ import {
LIGHT_ABILITIES, LIGHT_ABILITIES,
LIGHT_MOVES, LIGHT_MOVES,
} from "#app/data/mystery-encounters/requirements/requirement-groups"; } from "#app/data/mystery-encounters/requirements/requirement-groups";
import { Biome } from "#enums/biome"; import { BiomeId } from "#enums/biome-id";
import { WeatherType } from "#enums/weather-type"; import { WeatherType } from "#enums/weather-type";
import FogOverlay from "#app/ui/fog-overlay"; import FogOverlay from "#app/ui/fog-overlay";
@ -72,17 +72,17 @@ export const CreepingFogEncounter: MysteryEncounter = MysteryEncounterBuilder.wi
const waveIndex = globalScene.currentBattle.waveIndex; const waveIndex = globalScene.currentBattle.waveIndex;
const encounter = globalScene.currentBattle.mysteryEncounter!; const encounter = globalScene.currentBattle.mysteryEncounter!;
const chosenPokemonAttributes = chooseBoss(); const chosenPokemonAttributes = chooseBoss();
const chosenPokemon = chosenPokemonAttributes[0] as Species; const chosenPokemon = chosenPokemonAttributes[0] as SpeciesId;
const naturePokemon = chosenPokemonAttributes[1] as Nature; const naturePokemon = chosenPokemonAttributes[1] as Nature;
const abilityPokemon = chosenPokemonAttributes[2] as Abilities; const abilityPokemon = chosenPokemonAttributes[2] as AbilityId;
const passivePokemon = chosenPokemon[3] as boolean; const passivePokemon = chosenPokemon[3] as boolean;
const movesPokemon = chosenPokemonAttributes[4] as Moves[]; const movesPokemon = chosenPokemonAttributes[4] as MoveId[];
const modifPokemon = chosenPokemonAttributes[5] as HeldModifierConfig[]; const modifPokemon = chosenPokemonAttributes[5] as HeldModifierConfig[];
const segments = waveIndex < 80 ? 2 : waveIndex < 140 ? 3 : 4; const segments = waveIndex < 80 ? 2 : waveIndex < 140 ? 3 : 4;
const pokemonConfig: EnemyPokemonConfig = { const pokemonConfig: EnemyPokemonConfig = {
species: getPokemonSpecies(chosenPokemon), species: getPokemonSpecies(chosenPokemon),
formIndex: [Species.LYCANROC, Species.PIDGEOT].includes(chosenPokemon) ? 1 : 0, formIndex: [SpeciesId.LYCANROC, SpeciesId.PIDGEOT].includes(chosenPokemon) ? 1 : 0,
isBoss: true, isBoss: true,
shiny: false, shiny: false,
customPokemonData: new CustomPokemonData({ spriteScale: 1 + segments * 0.05 }), customPokemonData: new CustomPokemonData({ spriteScale: 1 + segments * 0.05 }),
@ -308,47 +308,47 @@ function chooseBoss() {
const wave = globalScene.currentBattle.waveIndex; const wave = globalScene.currentBattle.waveIndex;
const allBiomePokemon = [ const allBiomePokemon = [
[ [
Species.MACHAMP, SpeciesId.MACHAMP,
Nature.JOLLY, Nature.JOLLY,
1, 1,
false, false,
[Moves.DYNAMIC_PUNCH, Moves.STONE_EDGE, Moves.DUAL_CHOP, Moves.FISSURE], [MoveId.DYNAMIC_PUNCH, MoveId.STONE_EDGE, MoveId.DUAL_CHOP, MoveId.FISSURE],
[], [],
], ],
[ [
Species.GRIMMSNARL, SpeciesId.GRIMMSNARL,
Nature.ADAMANT, Nature.ADAMANT,
null, null,
false, false,
[Moves.STONE_EDGE, Moves.CLOSE_COMBAT, Moves.IRON_TAIL, Moves.PLAY_ROUGH], [MoveId.STONE_EDGE, MoveId.CLOSE_COMBAT, MoveId.IRON_TAIL, MoveId.PLAY_ROUGH],
[{ modifier: generateModifierType(modifierTypes.MICLE_BERRY) as PokemonHeldItemModifierType }], [{ modifier: generateModifierType(modifierTypes.MICLE_BERRY) as PokemonHeldItemModifierType }],
], ],
]; ];
const ForestTallGrassPokemon = [ const ForestTallGrassPokemon = [
[ [
Species.LYCANROC, SpeciesId.LYCANROC,
Nature.JOLLY, Nature.JOLLY,
2, 2,
false, false,
[Moves.STONE_EDGE, Moves.CLOSE_COMBAT, Moves.IRON_TAIL, Moves.PLAY_ROUGH], [MoveId.STONE_EDGE, MoveId.CLOSE_COMBAT, MoveId.IRON_TAIL, MoveId.PLAY_ROUGH],
[], [],
], ],
[ [
Species.ALOLA_RATICATE, SpeciesId.ALOLA_RATICATE,
Nature.ADAMANT, Nature.ADAMANT,
1, 1,
false, false,
[Moves.FALSE_SURRENDER, Moves.SUCKER_PUNCH, Moves.PLAY_ROUGH, Moves.POPULATION_BOMB], [MoveId.FALSE_SURRENDER, MoveId.SUCKER_PUNCH, MoveId.PLAY_ROUGH, MoveId.POPULATION_BOMB],
[{ modifier: generateModifierType(modifierTypes.REVIVER_SEED) as PokemonHeldItemModifierType }], [{ modifier: generateModifierType(modifierTypes.REVIVER_SEED) as PokemonHeldItemModifierType }],
], ],
]; ];
const SwampLakePokemon = [ const SwampLakePokemon = [
[ [
Species.POLIWRATH, SpeciesId.POLIWRATH,
Nature.NAIVE, Nature.NAIVE,
null, null,
true, true,
[Moves.DYNAMIC_PUNCH, Moves.HYDRO_PUMP, Moves.DUAL_CHOP, Moves.HYPNOSIS], [MoveId.DYNAMIC_PUNCH, MoveId.HYDRO_PUMP, MoveId.DUAL_CHOP, MoveId.HYPNOSIS],
[ [
{ modifier: generateModifierType(modifierTypes.BERRY, [BerryType.SITRUS]) as PokemonHeldItemModifierType }, { modifier: generateModifierType(modifierTypes.BERRY, [BerryType.SITRUS]) as PokemonHeldItemModifierType },
{ modifier: generateModifierType(modifierTypes.BASE_STAT_BOOSTER, [Stat.HP]) as PokemonHeldItemModifierType }, { modifier: generateModifierType(modifierTypes.BASE_STAT_BOOSTER, [Stat.HP]) as PokemonHeldItemModifierType },
@ -357,92 +357,92 @@ function chooseBoss() {
]; ];
const GraveyardPokemon = [ const GraveyardPokemon = [
[ [
Species.GOLURK, SpeciesId.GOLURK,
Nature.ADAMANT, Nature.ADAMANT,
2, 2,
false, false,
[Moves.EARTHQUAKE, Moves.POLTERGEIST, Moves.DYNAMIC_PUNCH, Moves.STONE_EDGE], [MoveId.EARTHQUAKE, MoveId.POLTERGEIST, MoveId.DYNAMIC_PUNCH, MoveId.STONE_EDGE],
[], [],
], ],
[ [
Species.HONEDGE, SpeciesId.HONEDGE,
Nature.CAREFUL, Nature.CAREFUL,
0, 0,
false, false,
[Moves.IRON_HEAD, Moves.POLTERGEIST, Moves.SACRED_SWORD, Moves.SHADOW_SNEAK], [MoveId.IRON_HEAD, MoveId.POLTERGEIST, MoveId.SACRED_SWORD, MoveId.SHADOW_SNEAK],
[], [],
], ],
[ [
Species.ZWEILOUS, SpeciesId.ZWEILOUS,
Nature.BRAVE, Nature.BRAVE,
null, null,
true, true,
[Moves.DRAGON_RUSH, Moves.CRUNCH, Moves.GUNK_SHOT, Moves.SCREECH], [MoveId.DRAGON_RUSH, MoveId.CRUNCH, MoveId.GUNK_SHOT, MoveId.SCREECH],
[{ modifier: generateModifierType(modifierTypes.QUICK_CLAW) as PokemonHeldItemModifierType, stackCount: 2 }], [{ modifier: generateModifierType(modifierTypes.QUICK_CLAW) as PokemonHeldItemModifierType, stackCount: 2 }],
], ],
]; ];
const wave110_140Pokemon = [ const wave110_140Pokemon = [
[ [
Species.SCOLIPEDE, SpeciesId.SCOLIPEDE,
Nature.ADAMANT, Nature.ADAMANT,
2, 2,
false, false,
[Moves.MEGAHORN, Moves.NOXIOUS_TORQUE, Moves.ROLLOUT, Moves.BANEFUL_BUNKER], [MoveId.MEGAHORN, MoveId.NOXIOUS_TORQUE, MoveId.ROLLOUT, MoveId.BANEFUL_BUNKER],
[{ modifier: generateModifierType(modifierTypes.MICLE_BERRY) as PokemonHeldItemModifierType }], [{ modifier: generateModifierType(modifierTypes.MICLE_BERRY) as PokemonHeldItemModifierType }],
], ],
[ [
Species.MIENSHAO, SpeciesId.MIENSHAO,
Nature.JOLLY, Nature.JOLLY,
null, null,
true, true,
[Moves.HIGH_JUMP_KICK, Moves.STONE_EDGE, Moves.BLAZE_KICK, Moves.GUNK_SHOT], [MoveId.HIGH_JUMP_KICK, MoveId.STONE_EDGE, MoveId.BLAZE_KICK, MoveId.GUNK_SHOT],
[], [],
], ],
[ [
Species.DRACOZOLT, SpeciesId.DRACOZOLT,
Nature.JOLLY, Nature.JOLLY,
null, null,
true, true,
[Moves.BOLT_BEAK, Moves.DRAGON_RUSH, Moves.EARTHQUAKE, Moves.STONE_EDGE], [MoveId.BOLT_BEAK, MoveId.DRAGON_RUSH, MoveId.EARTHQUAKE, MoveId.STONE_EDGE],
[], [],
], ],
]; ];
const wave140PlusPokemon = [ const wave140PlusPokemon = [
[ [
Species.PIDGEOT, SpeciesId.PIDGEOT,
Nature.HASTY, Nature.HASTY,
0, 0,
false, false,
[Moves.HURRICANE, Moves.HEAT_WAVE, Moves.FOCUS_BLAST, Moves.WILDBOLT_STORM], [MoveId.HURRICANE, MoveId.HEAT_WAVE, MoveId.FOCUS_BLAST, MoveId.WILDBOLT_STORM],
[], [],
], ],
]; ];
let pool = allBiomePokemon as [Species, Nature, Abilities, boolean, Moves[], HeldModifierConfig[]][]; let pool = allBiomePokemon as [SpeciesId, Nature, AbilityId, boolean, MoveId[], HeldModifierConfig[]][];
// Include biome-specific Pokémon if within wave 50-80 // Include biome-specific Pokémon if within wave 50-80
if (wave >= 50) { if (wave >= 50) {
if (biome === Biome.FOREST || biome === Biome.TALL_GRASS) { if (biome === BiomeId.FOREST || biome === BiomeId.TALL_GRASS) {
pool = pool.concat( pool = pool.concat(
ForestTallGrassPokemon as [Species, Nature, Abilities, boolean, Moves[], HeldModifierConfig[]][], ForestTallGrassPokemon as [SpeciesId, Nature, AbilityId, boolean, MoveId[], HeldModifierConfig[]][],
); );
} }
if (biome === Biome.SWAMP || biome === Biome.LAKE) { if (biome === BiomeId.SWAMP || biome === BiomeId.LAKE) {
pool = pool.concat(SwampLakePokemon as [Species, Nature, Abilities, boolean, Moves[], HeldModifierConfig[]][]); pool = pool.concat(SwampLakePokemon as [SpeciesId, Nature, AbilityId, boolean, MoveId[], HeldModifierConfig[]][]);
} }
if (biome === Biome.GRAVEYARD) { if (biome === BiomeId.GRAVEYARD) {
pool = pool.concat(GraveyardPokemon as [Species, Nature, Abilities, boolean, Moves[], HeldModifierConfig[]][]); pool = pool.concat(GraveyardPokemon as [SpeciesId, Nature, AbilityId, boolean, MoveId[], HeldModifierConfig[]][]);
} }
} }
// Waves 110-140 content // Waves 110-140 content
if (wave >= 110) { if (wave >= 110) {
pool = pool.concat(wave110_140Pokemon as [Species, Nature, Abilities, boolean, Moves[], HeldModifierConfig[]][]); pool = pool.concat(wave110_140Pokemon as [SpeciesId, Nature, AbilityId, boolean, MoveId[], HeldModifierConfig[]][]);
} }
// Wave 140+ // Wave 140+
if (wave >= 140) { if (wave >= 140) {
pool = pool.concat(wave140PlusPokemon as [Species, Nature, Abilities, boolean, Moves[], HeldModifierConfig[]][]); pool = pool.concat(wave140PlusPokemon as [SpeciesId, Nature, AbilityId, boolean, MoveId[], HeldModifierConfig[]][]);
} }
// Randomly choose one // Randomly choose one
return pool[randSeedInt(pool.length, 0)]; return pool[randSeedInt(pool.length, 0)];

View File

@ -111,12 +111,12 @@ export const EXTORTION_MOVES = [
/** /**
* Moves that can clear a foggy weather * Moves that can clear a foggy weather
*/ */
export const DEFOG_MOVES = [Moves.DEFOG, Moves.RAPID_SPIN, Moves.GUST]; export const DEFOG_MOVES = [MoveId.DEFOG, MoveId.RAPID_SPIN, MoveId.GUST];
/** /**
* Moves that can help navigate through foggy weather * Moves that can help navigate through foggy weather
*/ */
export const LIGHT_MOVES = [Moves.FLASH, Moves.FORESIGHT]; export const LIGHT_MOVES = [MoveId.FLASH, MoveId.FORESIGHT];
/** /**
* Abilities that (loosely) can be used to trap/rob someone * Abilities that (loosely) can be used to trap/rob someone
@ -149,14 +149,14 @@ export const FIRE_RESISTANT_ABILITIES = [
/** /**
* Abilities that can clear foggy weather * Abilities that can clear foggy weather
*/ */
export const DEFOG_ABILITIES = [Abilities.AIR_LOCK, Abilities.CLOUD_NINE]; export const DEFOG_ABILITIES = [AbilityId.AIR_LOCK, AbilityId.CLOUD_NINE];
/** /**
* Abilities that can help navigate through foggy weather * Abilities that can help navigate through foggy weather
*/ */
export const LIGHT_ABILITIES = [ export const LIGHT_ABILITIES = [
Abilities.KEEN_EYE, AbilityId.KEEN_EYE,
Abilities.ILLUMINATE, AbilityId.ILLUMINATE,
Abilities.COMPOUND_EYES, AbilityId.COMPOUND_EYES,
Abilities.VICTORY_STAR, AbilityId.VICTORY_STAR,
]; ];

View File

@ -2,17 +2,17 @@ import type BattleScene from "#app/battle-scene";
import { CreepingFogEncounter } from "#app/data/mystery-encounters/encounters/creeping-fog-encounter"; import { CreepingFogEncounter } from "#app/data/mystery-encounters/encounters/creeping-fog-encounter";
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters"; import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils"; import * as EncounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils";
import { Biome } from "#app/enums/biome"; import { BiomeId } from "#enums/biome-id";
import { TimeOfDay } from "#enums/time-of-day"; import { TimeOfDay } from "#enums/time-of-day";
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type"; import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
import { Species } from "#app/enums/species"; import { SpeciesId } from "#enums/species-id";
import { PokemonMove } from "#app/field/pokemon"; import { PokemonMove } from "#app/data/moves/pokemon-move";
import { ModifierTier } from "#app/modifier/modifier-tier"; import { ModifierTier } from "#enums/modifier-tier";
import { CommandPhase } from "#app/phases/command-phase"; import { CommandPhase } from "#app/phases/command-phase";
import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
import { UiMode } from "#enums/ui-mode"; import { UiMode } from "#enums/ui-mode";
import { Moves } from "#enums/moves"; import { MoveId } from "#enums/move-id";
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode"; import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier"; import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
import { import {
@ -26,43 +26,48 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vite
import { WeatherType } from "#enums/weather-type"; import { WeatherType } from "#enums/weather-type";
const namespace = "mysteryEncounters/creepingFog"; const namespace = "mysteryEncounters/creepingFog";
const defaultParty = [Species.LAPRAS, Species.GENGAR, Species.ABRA]; const defaultParty = [SpeciesId.LAPRAS, SpeciesId.GENGAR, SpeciesId.ABRA];
const defaultBiome = Biome.FOREST; const defaultBiome = BiomeId.FOREST;
const defaultWave = 51; const defaultWave = 51;
const enemyPokemonForest50_110 = [Species.MACHAMP, Species.GRIMMSNARL, Species.LYCANROC, Species.ALOLA_RATICATE]; const enemyPokemonForest50_110 = [
SpeciesId.MACHAMP,
SpeciesId.GRIMMSNARL,
SpeciesId.LYCANROC,
SpeciesId.ALOLA_RATICATE,
];
const enemyPokemonSwamp110_140 = [ const enemyPokemonSwamp110_140 = [
Species.MACHAMP, SpeciesId.MACHAMP,
Species.GRIMMSNARL, SpeciesId.GRIMMSNARL,
Species.POLIWRATH, SpeciesId.POLIWRATH,
Species.SCOLIPEDE, SpeciesId.SCOLIPEDE,
Species.MIENSHAO, SpeciesId.MIENSHAO,
Species.DRACOZOLT, SpeciesId.DRACOZOLT,
]; ];
const enemyPokemonGraveyard140_Plus = [ const enemyPokemonGraveyard140_Plus = [
Species.MACHAMP, SpeciesId.MACHAMP,
Species.GRIMMSNARL, SpeciesId.GRIMMSNARL,
Species.GOLURK, SpeciesId.GOLURK,
Species.HONEDGE, SpeciesId.HONEDGE,
Species.ZWEILOUS, SpeciesId.ZWEILOUS,
Species.SCOLIPEDE, SpeciesId.SCOLIPEDE,
Species.MIENSHAO, SpeciesId.MIENSHAO,
Species.DRACOZOLT, SpeciesId.DRACOZOLT,
Species.PIDGEOT, SpeciesId.PIDGEOT,
]; ];
const enemyMoveset = { const enemyMoveset = {
[Species.MACHAMP]: [Moves.DYNAMIC_PUNCH, Moves.STONE_EDGE, Moves.DUAL_CHOP, Moves.FISSURE], [SpeciesId.MACHAMP]: [MoveId.DYNAMIC_PUNCH, MoveId.STONE_EDGE, MoveId.DUAL_CHOP, MoveId.FISSURE],
[Species.GRIMMSNARL]: [Moves.STONE_EDGE, Moves.CLOSE_COMBAT, Moves.IRON_TAIL, Moves.PLAY_ROUGH], [SpeciesId.GRIMMSNARL]: [MoveId.STONE_EDGE, MoveId.CLOSE_COMBAT, MoveId.IRON_TAIL, MoveId.PLAY_ROUGH],
[Species.LYCANROC]: [Moves.STONE_EDGE, Moves.CLOSE_COMBAT, Moves.IRON_TAIL, Moves.PLAY_ROUGH], [SpeciesId.LYCANROC]: [MoveId.STONE_EDGE, MoveId.CLOSE_COMBAT, MoveId.IRON_TAIL, MoveId.PLAY_ROUGH],
[Species.ALOLA_RATICATE]: [Moves.FALSE_SURRENDER, Moves.SUCKER_PUNCH, Moves.PLAY_ROUGH, Moves.POPULATION_BOMB], [SpeciesId.ALOLA_RATICATE]: [MoveId.FALSE_SURRENDER, MoveId.SUCKER_PUNCH, MoveId.PLAY_ROUGH, MoveId.POPULATION_BOMB],
[Species.POLIWRATH]: [Moves.DYNAMIC_PUNCH, Moves.HYDRO_PUMP, Moves.DUAL_CHOP, Moves.HYPNOSIS], [SpeciesId.POLIWRATH]: [MoveId.DYNAMIC_PUNCH, MoveId.HYDRO_PUMP, MoveId.DUAL_CHOP, MoveId.HYPNOSIS],
[Species.GOLURK]: [Moves.EARTHQUAKE, Moves.POLTERGEIST, Moves.DYNAMIC_PUNCH, Moves.STONE_EDGE], [SpeciesId.GOLURK]: [MoveId.EARTHQUAKE, MoveId.POLTERGEIST, MoveId.DYNAMIC_PUNCH, MoveId.STONE_EDGE],
[Species.HONEDGE]: [Moves.IRON_HEAD, Moves.POLTERGEIST, Moves.SACRED_SWORD, Moves.SHADOW_SNEAK], [SpeciesId.HONEDGE]: [MoveId.IRON_HEAD, MoveId.POLTERGEIST, MoveId.SACRED_SWORD, MoveId.SHADOW_SNEAK],
[Species.ZWEILOUS]: [Moves.DRAGON_RUSH, Moves.CRUNCH, Moves.GUNK_SHOT, Moves.SCREECH], [SpeciesId.ZWEILOUS]: [MoveId.DRAGON_RUSH, MoveId.CRUNCH, MoveId.GUNK_SHOT, MoveId.SCREECH],
[Species.SCOLIPEDE]: [Moves.MEGAHORN, Moves.NOXIOUS_TORQUE, Moves.ROLLOUT, Moves.BANEFUL_BUNKER], [SpeciesId.SCOLIPEDE]: [MoveId.MEGAHORN, MoveId.NOXIOUS_TORQUE, MoveId.ROLLOUT, MoveId.BANEFUL_BUNKER],
[Species.MIENSHAO]: [Moves.HIGH_JUMP_KICK, Moves.STONE_EDGE, Moves.BLAZE_KICK, Moves.GUNK_SHOT], [SpeciesId.MIENSHAO]: [MoveId.HIGH_JUMP_KICK, MoveId.STONE_EDGE, MoveId.BLAZE_KICK, MoveId.GUNK_SHOT],
[Species.DRACOZOLT]: [Moves.BOLT_BEAK, Moves.DRAGON_RUSH, Moves.EARTHQUAKE, Moves.STONE_EDGE], [SpeciesId.DRACOZOLT]: [MoveId.BOLT_BEAK, MoveId.DRAGON_RUSH, MoveId.EARTHQUAKE, MoveId.STONE_EDGE],
[Species.PIDGEOT]: [Moves.HURRICANE, Moves.HEAT_WAVE, Moves.FOCUS_BLAST, Moves.WILDBOLT_STORM], [SpeciesId.PIDGEOT]: [MoveId.HURRICANE, MoveId.HEAT_WAVE, MoveId.FOCUS_BLAST, MoveId.WILDBOLT_STORM],
}; };
describe("Creeping Fog - Mystery Encounter", () => { describe("Creeping Fog - Mystery Encounter", () => {
@ -84,10 +89,10 @@ describe("Creeping Fog - Mystery Encounter", () => {
game.override.startingTimeOfDay(TimeOfDay.NIGHT); game.override.startingTimeOfDay(TimeOfDay.NIGHT);
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue( vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<Biome, MysteryEncounterType[]>([ new Map<BiomeId, MysteryEncounterType[]>([
[Biome.FOREST, [MysteryEncounterType.CREEPING_FOG]], [BiomeId.FOREST, [MysteryEncounterType.CREEPING_FOG]],
[Biome.FOREST, [MysteryEncounterType.SAFARI_ZONE]], [BiomeId.FOREST, [MysteryEncounterType.SAFARI_ZONE]],
[Biome.SPACE, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]], [BiomeId.SPACE, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],
]), ]),
); );
}); });
@ -113,7 +118,7 @@ describe("Creeping Fog - Mystery Encounter", () => {
it("should not spawn outside of proper biomes", async () => { it("should not spawn outside of proper biomes", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.ULTRA); game.override.mysteryEncounterTier(MysteryEncounterTier.ULTRA);
game.override.startingBiome(Biome.SPACE); game.override.startingBiome(BiomeId.SPACE);
game.override.startingTimeOfDay(TimeOfDay.NIGHT); game.override.startingTimeOfDay(TimeOfDay.NIGHT);
await game.runToMysteryEncounter(); await game.runToMysteryEncounter();
@ -153,7 +158,7 @@ describe("Creeping Fog - Mystery Encounter", () => {
//Expect that the weather is set to heavy fog //Expect that the weather is set to heavy fog
expect(scene.arena.weather?.weatherType).toBe(WeatherType.HEAVY_FOG); expect(scene.arena.weather?.weatherType).toBe(WeatherType.HEAVY_FOG);
const enemyField = scene.getEnemyField(); const enemyField = scene.getEnemyField();
expect(scene.getCurrentPhase()?.constructor.name).toBe(CommandPhase.name); expect(scene.phaseManager.getCurrentPhase()?.constructor.name).toBe(CommandPhase.name);
expect(enemyField.length).toBe(1); expect(enemyField.length).toBe(1);
expect(enemyPokemonForest50_110).toContain(enemyField[0].species.speciesId); expect(enemyPokemonForest50_110).toContain(enemyField[0].species.speciesId);
const moveset = enemyField[0].moveset.map(m => m.moveId); const moveset = enemyField[0].moveset.map(m => m.moveId);
@ -162,7 +167,7 @@ describe("Creeping Fog - Mystery Encounter", () => {
it("should start battle against shadowy Pokemon from the Swamp Mid Level Pool", async () => { it("should start battle against shadowy Pokemon from the Swamp Mid Level Pool", async () => {
game.override.startingWave(113); game.override.startingWave(113);
game.override.startingBiome(Biome.SWAMP); game.override.startingBiome(BiomeId.SWAMP);
await game.runToMysteryEncounter(MysteryEncounterType.CREEPING_FOG, defaultParty); await game.runToMysteryEncounter(MysteryEncounterType.CREEPING_FOG, defaultParty);
// Make party lead's level arbitrarily high to not get KOed by move // Make party lead's level arbitrarily high to not get KOed by move
const partyLead = scene.getPlayerParty()[0]; const partyLead = scene.getPlayerParty()[0];
@ -172,7 +177,7 @@ describe("Creeping Fog - Mystery Encounter", () => {
//Expect that the weather is set to heavy fog //Expect that the weather is set to heavy fog
expect(scene.arena.weather?.weatherType).toBe(WeatherType.HEAVY_FOG); expect(scene.arena.weather?.weatherType).toBe(WeatherType.HEAVY_FOG);
const enemyField = scene.getEnemyField(); const enemyField = scene.getEnemyField();
expect(scene.getCurrentPhase()?.constructor.name).toBe(CommandPhase.name); expect(scene.phaseManager.getCurrentPhase()?.constructor.name).toBe(CommandPhase.name);
expect(enemyField.length).toBe(1); expect(enemyField.length).toBe(1);
expect(enemyPokemonSwamp110_140).toContain(enemyField[0].species.speciesId); expect(enemyPokemonSwamp110_140).toContain(enemyField[0].species.speciesId);
const moveset = enemyField[0].moveset.map(m => m.moveId); const moveset = enemyField[0].moveset.map(m => m.moveId);
@ -181,7 +186,7 @@ describe("Creeping Fog - Mystery Encounter", () => {
it("should start battle against shadowy Pokemon from the Graveyard High Level Pool", async () => { it("should start battle against shadowy Pokemon from the Graveyard High Level Pool", async () => {
game.override.startingWave(143); game.override.startingWave(143);
game.override.startingBiome(Biome.GRAVEYARD); game.override.startingBiome(BiomeId.GRAVEYARD);
await game.runToMysteryEncounter(MysteryEncounterType.CREEPING_FOG, defaultParty); await game.runToMysteryEncounter(MysteryEncounterType.CREEPING_FOG, defaultParty);
// Make party lead's level arbitrarily high to not get KOed by move // Make party lead's level arbitrarily high to not get KOed by move
const partyLead = scene.getPlayerParty()[0]; const partyLead = scene.getPlayerParty()[0];
@ -191,7 +196,7 @@ describe("Creeping Fog - Mystery Encounter", () => {
//Expect that the weather is set to heavy fog //Expect that the weather is set to heavy fog
expect(scene.arena.weather?.weatherType).toBe(WeatherType.HEAVY_FOG); expect(scene.arena.weather?.weatherType).toBe(WeatherType.HEAVY_FOG);
const enemyField = scene.getEnemyField(); const enemyField = scene.getEnemyField();
expect(scene.getCurrentPhase()?.constructor.name).toBe(CommandPhase.name); expect(scene.phaseManager.getCurrentPhase()?.constructor.name).toBe(CommandPhase.name);
expect(enemyField.length).toBe(1); expect(enemyField.length).toBe(1);
expect(enemyPokemonGraveyard140_Plus).toContain(enemyField[0].species.speciesId); expect(enemyPokemonGraveyard140_Plus).toContain(enemyField[0].species.speciesId);
const moveset = enemyField[0].moveset.map(m => m.moveId); const moveset = enemyField[0].moveset.map(m => m.moveId);
@ -203,7 +208,7 @@ describe("Creeping Fog - Mystery Encounter", () => {
await runMysteryEncounterToEnd(game, 1, undefined, true); await runMysteryEncounterToEnd(game, 1, undefined, true);
await skipBattleRunMysteryEncounterRewardsPhase(game); await skipBattleRunMysteryEncounterRewardsPhase(game);
await game.phaseInterceptor.to(SelectModifierPhase, false); await game.phaseInterceptor.to(SelectModifierPhase, false);
expect(scene.getCurrentPhase()?.constructor.name).toBe(SelectModifierPhase.name); expect(scene.phaseManager.getCurrentPhase()?.constructor.name).toBe(SelectModifierPhase.name);
await game.phaseInterceptor.run(SelectModifierPhase); await game.phaseInterceptor.run(SelectModifierPhase);
expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT); expect(scene.ui.getMode()).to.equal(UiMode.MODIFIER_SELECT);
@ -240,22 +245,22 @@ describe("Creeping Fog - Mystery Encounter", () => {
it("should skip battle with Pokemon if wave level under 140", async () => { it("should skip battle with Pokemon if wave level under 140", async () => {
const leaveEncounterWithoutBattleSpy = vi.spyOn(EncounterPhaseUtils, "leaveEncounterWithoutBattle"); const leaveEncounterWithoutBattleSpy = vi.spyOn(EncounterPhaseUtils, "leaveEncounterWithoutBattle");
await game.runToMysteryEncounter(MysteryEncounterType.CREEPING_FOG, defaultParty); await game.runToMysteryEncounter(MysteryEncounterType.CREEPING_FOG, defaultParty);
scene.getPlayerParty()[1].moveset = [new PokemonMove(Moves.DEFOG)]; scene.getPlayerParty()[1].moveset = [new PokemonMove(MoveId.DEFOG)];
await runMysteryEncounterToEnd(game, 2); await runMysteryEncounterToEnd(game, 2);
expect(leaveEncounterWithoutBattleSpy).toBeCalled(); expect(leaveEncounterWithoutBattleSpy).toBeCalled();
}); });
it("should not skip battle with Pokemon", async () => { it("should not skip battle with Pokemon", async () => {
game.override.startingWave(143); game.override.startingWave(143);
game.override.startingBiome(Biome.GRAVEYARD); game.override.startingBiome(BiomeId.GRAVEYARD);
await game.runToMysteryEncounter(MysteryEncounterType.CREEPING_FOG, defaultParty); await game.runToMysteryEncounter(MysteryEncounterType.CREEPING_FOG, defaultParty);
scene.getPlayerParty()[1].moveset = [new PokemonMove(Moves.DEFOG)]; scene.getPlayerParty()[1].moveset = [new PokemonMove(MoveId.DEFOG)];
const partyLead = scene.getPlayerParty()[0]; const partyLead = scene.getPlayerParty()[0];
partyLead.level = 1000; partyLead.level = 1000;
partyLead.calculateStats(); partyLead.calculateStats();
await runMysteryEncounterToEnd(game, 2, undefined, true); await runMysteryEncounterToEnd(game, 2, undefined, true);
const enemyField = scene.getEnemyField(); const enemyField = scene.getEnemyField();
expect(scene.getCurrentPhase()?.constructor.name).toBe(CommandPhase.name); expect(scene.phaseManager.getCurrentPhase()?.constructor.name).toBe(CommandPhase.name);
expect(enemyField.length).toBe(1); expect(enemyField.length).toBe(1);
expect(enemyPokemonGraveyard140_Plus).toContain(enemyField[0].species.speciesId); expect(enemyPokemonGraveyard140_Plus).toContain(enemyField[0].species.speciesId);
const moveset = enemyField[0].moveset.map(m => m.moveId); const moveset = enemyField[0].moveset.map(m => m.moveId);
@ -266,7 +271,7 @@ describe("Creeping Fog - Mystery Encounter", () => {
await game.runToMysteryEncounter(MysteryEncounterType.CREEPING_FOG, defaultParty); await game.runToMysteryEncounter(MysteryEncounterType.CREEPING_FOG, defaultParty);
scene.getPlayerParty().forEach(p => (p.moveset = [])); scene.getPlayerParty().forEach(p => (p.moveset = []));
await game.phaseInterceptor.to(MysteryEncounterPhase, false); await game.phaseInterceptor.to(MysteryEncounterPhase, false);
const encounterPhase = scene.getCurrentPhase(); const encounterPhase = scene.phaseManager.getCurrentPhase();
expect(encounterPhase?.constructor.name).toBe(MysteryEncounterPhase.name); expect(encounterPhase?.constructor.name).toBe(MysteryEncounterPhase.name);
const mysteryEncounterPhase = encounterPhase as MysteryEncounterPhase; const mysteryEncounterPhase = encounterPhase as MysteryEncounterPhase;
vi.spyOn(mysteryEncounterPhase, "continueEncounter"); vi.spyOn(mysteryEncounterPhase, "continueEncounter");
@ -297,16 +302,16 @@ describe("Creeping Fog - Mystery Encounter", () => {
game.override.startingWave(63); game.override.startingWave(63);
const leaveEncounterWithoutBattleSpy = vi.spyOn(EncounterPhaseUtils, "leaveEncounterWithoutBattle"); const leaveEncounterWithoutBattleSpy = vi.spyOn(EncounterPhaseUtils, "leaveEncounterWithoutBattle");
await game.runToMysteryEncounter(MysteryEncounterType.CREEPING_FOG, defaultParty); await game.runToMysteryEncounter(MysteryEncounterType.CREEPING_FOG, defaultParty);
scene.getPlayerParty()[1].moveset = [new PokemonMove(Moves.FORESIGHT)]; scene.getPlayerParty()[1].moveset = [new PokemonMove(MoveId.FORESIGHT)];
await runMysteryEncounterToEnd(game, 3); await runMysteryEncounterToEnd(game, 3);
expect(leaveEncounterWithoutBattleSpy).toBeCalled(); expect(leaveEncounterWithoutBattleSpy).toBeCalled();
}); });
it("should not skip battle with Pokemon", async () => { it("should not skip battle with Pokemon", async () => {
game.override.startingWave(143); game.override.startingWave(143);
game.override.startingBiome(Biome.GRAVEYARD); game.override.startingBiome(BiomeId.GRAVEYARD);
await game.runToMysteryEncounter(MysteryEncounterType.CREEPING_FOG, defaultParty); await game.runToMysteryEncounter(MysteryEncounterType.CREEPING_FOG, defaultParty);
scene.getPlayerParty()[1].moveset = [new PokemonMove(Moves.FORESIGHT)]; scene.getPlayerParty()[1].moveset = [new PokemonMove(MoveId.FORESIGHT)];
const partyLead = scene.getPlayerParty()[0]; const partyLead = scene.getPlayerParty()[0];
partyLead.level = 1000; partyLead.level = 1000;
partyLead.calculateStats(); partyLead.calculateStats();
@ -314,7 +319,7 @@ describe("Creeping Fog - Mystery Encounter", () => {
//Expect that the weather is set to heavy fog //Expect that the weather is set to heavy fog
expect(scene.arena.weather?.weatherType).toBe(WeatherType.HEAVY_FOG); expect(scene.arena.weather?.weatherType).toBe(WeatherType.HEAVY_FOG);
const enemyField = scene.getEnemyField(); const enemyField = scene.getEnemyField();
expect(scene.getCurrentPhase()?.constructor.name).toBe(CommandPhase.name); expect(scene.phaseManager.getCurrentPhase()?.constructor.name).toBe(CommandPhase.name);
expect(enemyField.length).toBe(1); expect(enemyField.length).toBe(1);
expect(enemyPokemonGraveyard140_Plus).toContain(enemyField[0].species.speciesId); expect(enemyPokemonGraveyard140_Plus).toContain(enemyField[0].species.speciesId);
const moveset = enemyField[0].moveset.map(m => m.moveId); const moveset = enemyField[0].moveset.map(m => m.moveId);
@ -326,7 +331,7 @@ describe("Creeping Fog - Mystery Encounter", () => {
scene.getPlayerParty().forEach(p => (p.moveset = [])); scene.getPlayerParty().forEach(p => (p.moveset = []));
await game.phaseInterceptor.to(MysteryEncounterPhase, false); await game.phaseInterceptor.to(MysteryEncounterPhase, false);
const encounterPhase = scene.getCurrentPhase(); const encounterPhase = scene.phaseManager.getCurrentPhase();
expect(encounterPhase?.constructor.name).toBe(MysteryEncounterPhase.name); expect(encounterPhase?.constructor.name).toBe(MysteryEncounterPhase.name);
const mysteryEncounterPhase = encounterPhase as MysteryEncounterPhase; const mysteryEncounterPhase = encounterPhase as MysteryEncounterPhase;
vi.spyOn(mysteryEncounterPhase, "continueEncounter"); vi.spyOn(mysteryEncounterPhase, "continueEncounter");