mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-03 23:12:20 +02:00
Removed unnecessary comments,removed arenta_tint test function and updated chooseBoss function in Creeping Fog Mystery Encounter
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:
parent
6a65c1e46b
commit
065b07c93f
@ -17,7 +17,7 @@ import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
|||||||
import { MoveId } from "#enums/move-id";
|
import { MoveId } from "#enums/move-id";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
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/utils/pokemon-utils";
|
||||||
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";
|
||||||
@ -165,7 +165,6 @@ export const CreepingFogEncounter: MysteryEncounter = MysteryEncounterBuilder.wi
|
|||||||
//Battle Fog Boss
|
//Battle Fog Boss
|
||||||
const encounter = globalScene.currentBattle.mysteryEncounter!;
|
const encounter = globalScene.currentBattle.mysteryEncounter!;
|
||||||
globalScene.arena.trySetWeather(WeatherType.HEAVY_FOG);
|
globalScene.arena.trySetWeather(WeatherType.HEAVY_FOG);
|
||||||
//TODO start fog and stuff
|
|
||||||
const config: EnemyPartyConfig = encounter.enemyPartyConfigs[0];
|
const config: EnemyPartyConfig = encounter.enemyPartyConfigs[0];
|
||||||
setEncounterRewards({
|
setEncounterRewards({
|
||||||
guaranteedModifierTiers: [ModifierTier.ROGUE, ModifierTier.ROGUE],
|
guaranteedModifierTiers: [ModifierTier.ROGUE, ModifierTier.ROGUE],
|
||||||
@ -293,7 +292,7 @@ export const CreepingFogEncounter: MysteryEncounter = MysteryEncounterBuilder.wi
|
|||||||
ease: "Sine.easeOut",
|
ease: "Sine.easeOut",
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
});
|
||||||
const pokemon = globalScene.getPlayerPokemon(); //Can we use this?
|
const pokemon = globalScene.getPlayerPokemon();
|
||||||
globalScene.arena.trySetWeather(WeatherType.FOG, pokemon);
|
globalScene.arena.trySetWeather(WeatherType.FOG, pokemon);
|
||||||
|
|
||||||
// Leave encounter with no rewards or exp
|
// Leave encounter with no rewards or exp
|
||||||
@ -303,10 +302,12 @@ export const CreepingFogEncounter: MysteryEncounter = MysteryEncounterBuilder.wi
|
|||||||
)
|
)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
type FogEncounterPokemonConfig = [SpeciesId, Nature, AbilityId | null, boolean, MoveId[], HeldModifierConfig[]][];
|
||||||
|
|
||||||
function chooseBoss() {
|
function chooseBoss() {
|
||||||
const biome = globalScene.arena.biomeType;
|
const biome = globalScene.arena.biomeType;
|
||||||
const wave = globalScene.currentBattle.waveIndex;
|
const wave = globalScene.currentBattle.waveIndex;
|
||||||
const allBiomePokemon = [
|
const allBiomePokemon: FogEncounterPokemonConfig = [
|
||||||
[
|
[
|
||||||
SpeciesId.MACHAMP,
|
SpeciesId.MACHAMP,
|
||||||
Nature.JOLLY,
|
Nature.JOLLY,
|
||||||
@ -418,31 +419,29 @@ function chooseBoss() {
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
let pool = allBiomePokemon as [SpeciesId, Nature, AbilityId, boolean, MoveId[], HeldModifierConfig[]][];
|
let pool: FogEncounterPokemonConfig = allBiomePokemon;
|
||||||
|
|
||||||
// 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 === BiomeId.FOREST || biome === BiomeId.TALL_GRASS) {
|
if (biome === BiomeId.FOREST || biome === BiomeId.TALL_GRASS) {
|
||||||
pool = pool.concat(
|
pool = pool.concat(ForestTallGrassPokemon as FogEncounterPokemonConfig);
|
||||||
ForestTallGrassPokemon as [SpeciesId, Nature, AbilityId, boolean, MoveId[], HeldModifierConfig[]][],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (biome === BiomeId.SWAMP || biome === BiomeId.LAKE) {
|
if (biome === BiomeId.SWAMP || biome === BiomeId.LAKE) {
|
||||||
pool = pool.concat(SwampLakePokemon as [SpeciesId, Nature, AbilityId, boolean, MoveId[], HeldModifierConfig[]][]);
|
pool = pool.concat(SwampLakePokemon as FogEncounterPokemonConfig);
|
||||||
}
|
}
|
||||||
if (biome === BiomeId.GRAVEYARD) {
|
if (biome === BiomeId.GRAVEYARD) {
|
||||||
pool = pool.concat(GraveyardPokemon as [SpeciesId, Nature, AbilityId, boolean, MoveId[], HeldModifierConfig[]][]);
|
pool = pool.concat(GraveyardPokemon as FogEncounterPokemonConfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Waves 110-140 content
|
// Waves 110-140
|
||||||
if (wave >= 110) {
|
if (wave >= 110) {
|
||||||
pool = pool.concat(wave110_140Pokemon as [SpeciesId, Nature, AbilityId, boolean, MoveId[], HeldModifierConfig[]][]);
|
pool = pool.concat(wave110_140Pokemon as FogEncounterPokemonConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wave 140+
|
// Wave 140+
|
||||||
if (wave >= 140) {
|
if (wave >= 140) {
|
||||||
pool = pool.concat(wave140PlusPokemon as [SpeciesId, Nature, AbilityId, boolean, MoveId[], HeldModifierConfig[]][]);
|
pool = pool.concat(wave140PlusPokemon as FogEncounterPokemonConfig);
|
||||||
}
|
}
|
||||||
// Randomly choose one
|
// Randomly choose one
|
||||||
return pool[randSeedInt(pool.length, 0)];
|
return pool[randSeedInt(pool.length, 0)];
|
||||||
|
@ -3,7 +3,6 @@ import { CreepingFogEncounter } from "#app/data/mystery-encounters/encounters/cr
|
|||||||
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 { BiomeId } from "#enums/biome-id";
|
import { BiomeId } from "#enums/biome-id";
|
||||||
import { TimeOfDay } from "#enums/time-of-day";
|
|
||||||
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
import { PokemonMove } from "#app/data/moves/pokemon-move";
|
import { PokemonMove } from "#app/data/moves/pokemon-move";
|
||||||
@ -86,7 +85,6 @@ describe("Creeping Fog - Mystery Encounter", () => {
|
|||||||
game.override.startingWave(defaultWave);
|
game.override.startingWave(defaultWave);
|
||||||
game.override.startingBiome(defaultBiome);
|
game.override.startingBiome(defaultBiome);
|
||||||
game.override.disableTrainerWaves();
|
game.override.disableTrainerWaves();
|
||||||
game.override.startingTimeOfDay(TimeOfDay.NIGHT);
|
|
||||||
|
|
||||||
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
|
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
|
||||||
new Map<BiomeId, MysteryEncounterType[]>([
|
new Map<BiomeId, MysteryEncounterType[]>([
|
||||||
@ -119,7 +117,6 @@ 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(BiomeId.SPACE);
|
game.override.startingBiome(BiomeId.SPACE);
|
||||||
game.override.startingTimeOfDay(TimeOfDay.NIGHT);
|
|
||||||
|
|
||||||
await game.runToMysteryEncounter();
|
await game.runToMysteryEncounter();
|
||||||
expect(game.scene.currentBattle.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.CREEPING_FOG);
|
expect(game.scene.currentBattle.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.CREEPING_FOG);
|
||||||
@ -127,7 +124,6 @@ describe("Creeping Fog - Mystery Encounter", () => {
|
|||||||
|
|
||||||
it("should not spawn outside of proper time of day", async () => {
|
it("should not spawn outside of proper time of day", async () => {
|
||||||
game.override.mysteryEncounterTier(MysteryEncounterTier.ULTRA);
|
game.override.mysteryEncounterTier(MysteryEncounterTier.ULTRA);
|
||||||
game.override.startingTimeOfDay(TimeOfDay.DAY);
|
|
||||||
|
|
||||||
await game.runToMysteryEncounter();
|
await game.runToMysteryEncounter();
|
||||||
expect(game.scene.currentBattle.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.CREEPING_FOG);
|
expect(game.scene.currentBattle.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.CREEPING_FOG);
|
||||||
|
Loading…
Reference in New Issue
Block a user