[concept] Add framework for conditional boss ultra rares

pull/787/head
Temps Ray 2024-05-12 13:52:12 -04:00
parent 7d86634bbb
commit 71c131f9a0
2 changed files with 33 additions and 9 deletions

View File

@ -34,6 +34,15 @@ interface BiomeDepths {
[key: integer]: [integer, integer] [key: integer]: [integer, integer]
} }
interface BiomeConditions {
[key: integer]: (p: any) => boolean;
}
export const biomeConditions: BiomeConditions = {
[Biome.TOWN]: (p) => !!p.scene.getParty().find(p => p.species.speciesId === Species.MEWTWO),
[Biome.PLAINS]: () => {return false},
}
export const biomeLinks: BiomeLinks = { export const biomeLinks: BiomeLinks = {
[Biome.TOWN]: Biome.PLAINS, [Biome.TOWN]: Biome.PLAINS,
[Biome.PLAINS]: [ Biome.GRASS, Biome.METROPOLIS, Biome.LAKE ], [Biome.PLAINS]: [ Biome.GRASS, Biome.METROPOLIS, Biome.LAKE ],
@ -82,7 +91,8 @@ export enum BiomePoolTier {
BOSS, BOSS,
BOSS_RARE, BOSS_RARE,
BOSS_SUPER_RARE, BOSS_SUPER_RARE,
BOSS_ULTRA_RARE BOSS_ULTRA_RARE,
BOSS_CONDITIONAL_ULTRA_RARE
}; };
export const uncatchableSpecies: Species[] = []; export const uncatchableSpecies: Species[] = [];
@ -157,7 +167,8 @@ export const biomePokemonPools: BiomePokemonPools = {
[BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, [BiomePoolTier.BOSS]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] },
[BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, [BiomePoolTier.BOSS_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] },
[BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] }, [BiomePoolTier.BOSS_SUPER_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] },
[BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [] } [BiomePoolTier.BOSS_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [Species.ZEKROM] },
[BiomePoolTier.BOSS_CONDITIONAL_ULTRA_RARE]: { [TimeOfDay.DAWN]: [], [TimeOfDay.DAY]: [], [TimeOfDay.DUSK]: [], [TimeOfDay.NIGHT]: [], [TimeOfDay.ALL]: [Species.RESHIRAM]},
}, },
[Biome.PLAINS]: { [Biome.PLAINS]: {
[BiomePoolTier.COMMON]: { [BiomePoolTier.COMMON]: {
@ -5126,11 +5137,13 @@ export const biomeTrainerPools: BiomeTrainerPools = {
] ]
], ],
[ Species.RESHIRAM, Type.DRAGON, Type.FIRE, [ [ Species.RESHIRAM, Type.DRAGON, Type.FIRE, [
[ Biome.VOLCANO, BiomePoolTier.BOSS_ULTRA_RARE ] [ Biome.VOLCANO, BiomePoolTier.BOSS_ULTRA_RARE ],
[ Biome.TOWN, BiomePoolTier.BOSS_CONDITIONAL_ULTRA_RARE ]
] ]
], ],
[ Species.ZEKROM, Type.DRAGON, Type.ELECTRIC, [ [ Species.ZEKROM, Type.DRAGON, Type.ELECTRIC, [
[ Biome.POWER_PLANT, BiomePoolTier.BOSS_ULTRA_RARE ] [ Biome.POWER_PLANT, BiomePoolTier.BOSS_ULTRA_RARE ],
[ Biome.TOWN, BiomePoolTier.BOSS_ULTRA_RARE ]
] ]
], ],
[ Species.LANDORUS, Type.GROUND, Type.FLYING, [ [ Species.LANDORUS, Type.GROUND, Type.FLYING, [

View File

@ -1,5 +1,5 @@
import BattleScene from "../battle-scene"; import BattleScene from "../battle-scene";
import { BiomePoolTier, PokemonPools, BiomeTierTrainerPools, biomePokemonPools, biomeTrainerPools } from "../data/biomes"; import { BiomePoolTier, PokemonPools, BiomeTierTrainerPools, biomePokemonPools, biomeTrainerPools, biomeConditions } from "../data/biomes";
import { Biome } from "../data/enums/biome"; import { Biome } from "../data/enums/biome";
import * as Utils from "../utils"; import * as Utils from "../utils";
import PokemonSpecies, { getPokemonSpecies } from "../data/pokemon-species"; import PokemonSpecies, { getPokemonSpecies } from "../data/pokemon-species";
@ -68,13 +68,24 @@ export class Arena {
const overrideSpecies = this.scene.gameMode.getOverrideSpecies(waveIndex); const overrideSpecies = this.scene.gameMode.getOverrideSpecies(waveIndex);
if (overrideSpecies) if (overrideSpecies)
return overrideSpecies; return overrideSpecies;
const isBoss = !!this.scene.getEncounterBossSegments(waveIndex, level) && !!this.pokemonPool[BiomePoolTier.BOSS].length // const isBoss = !!this.scene.getEncounterBossSegments(waveIndex, level) && !!this.pokemonPool[BiomePoolTier.BOSS].length
&& (this.biomeType !== Biome.END || this.scene.gameMode.isClassic || this.scene.gameMode.isWaveFinal(waveIndex)); // && (this.biomeType !== Biome.END || this.scene.gameMode.isClassic || this.scene.gameMode.isWaveFinal(waveIndex));
const tierValue = Utils.randSeedInt(!isBoss ? 512 : 64); const isBoss = true; // OVERIDE
// const tierValue = Utils.randSeedInt(!isBoss ? 512 : 64);
// let tier = !isBoss
// ? tierValue >= 156 ? BiomePoolTier.COMMON : tierValue >= 32 ? BiomePoolTier.UNCOMMON : tierValue >= 6 ? BiomePoolTier.RARE : tierValue >= 1 ? BiomePoolTier.SUPER_RARE : BiomePoolTier.ULTRA_RARE
// : tierValue >= 20 ? BiomePoolTier.BOSS : tierValue >= 6 ? BiomePoolTier.BOSS_RARE : tierValue >= 1 ? BiomePoolTier.BOSS_SUPER_RARE : BiomePoolTier.BOSS_ULTRA_RARE;
const tierValue = 0; // Utils.randSeedInt(!isBoss ? 512 : 128); OVERRIDE
let tier = !isBoss let tier = !isBoss
? tierValue >= 156 ? BiomePoolTier.COMMON : tierValue >= 32 ? BiomePoolTier.UNCOMMON : tierValue >= 6 ? BiomePoolTier.RARE : tierValue >= 1 ? BiomePoolTier.SUPER_RARE : BiomePoolTier.ULTRA_RARE ? tierValue >= 156 ? BiomePoolTier.COMMON : tierValue >= 32 ? BiomePoolTier.UNCOMMON : tierValue >= 6 ? BiomePoolTier.RARE : tierValue >= 1 ? BiomePoolTier.SUPER_RARE : BiomePoolTier.ULTRA_RARE
: tierValue >= 20 ? BiomePoolTier.BOSS : tierValue >= 6 ? BiomePoolTier.BOSS_RARE : tierValue >= 1 ? BiomePoolTier.BOSS_SUPER_RARE : BiomePoolTier.BOSS_ULTRA_RARE; : tierValue >= 40 ? BiomePoolTier.BOSS : tierValue >= 12 ? BiomePoolTier.BOSS_RARE : tierValue >= 2 ? BiomePoolTier.BOSS_SUPER_RARE : tierValue >= 1 ? BiomePoolTier.BOSS_ULTRA_RARE :
biomeConditions[this.biomeType](this) ? BiomePoolTier.BOSS_CONDITIONAL_ULTRA_RARE : BiomePoolTier.BOSS_ULTRA_RARE;
console.log("this.scene: " + this.scene);
console.log("this.scene get party " + this.scene.getParty());
console.log("biome condition: " + biomeConditions[this.biomeType](this));
console.log(BiomePoolTier[tier]); console.log(BiomePoolTier[tier]);
console.log(this.pokemonPool);
console.log(this.pokemonPool[tier]);
while (!this.pokemonPool[tier].length) { while (!this.pokemonPool[tier].length) {
console.log(`Downgraded rarity tier from ${BiomePoolTier[tier]} to ${BiomePoolTier[tier - 1]}`); console.log(`Downgraded rarity tier from ${BiomePoolTier[tier]} to ${BiomePoolTier[tier - 1]}`);
tier--; tier--;