[Bug] Fix Biome selection RNG (#5645)
This commit is contained in:
parent
787feceb14
commit
1a7442511c
|
@ -33,23 +33,19 @@ export class SelectBiomePhase extends BattlePhase {
|
|||
} else if (globalScene.gameMode.hasRandomBiomes) {
|
||||
setNextBiome(this.generateNextBiome());
|
||||
} else if (Array.isArray(biomeLinks[currentBiome])) {
|
||||
let biomes: Biome[] = [];
|
||||
globalScene.executeWithSeedOffset(() => {
|
||||
biomes = (biomeLinks[currentBiome] as (Biome | [Biome, number])[])
|
||||
.filter(b => !Array.isArray(b) || !randSeedInt(b[1]))
|
||||
.map(b => (!Array.isArray(b) ? b : b[0]));
|
||||
}, globalScene.currentBattle.waveIndex);
|
||||
const biomes: Biome[] = (biomeLinks[currentBiome] as (Biome | [Biome, number])[])
|
||||
.filter(b => !Array.isArray(b) || !randSeedInt(b[1]))
|
||||
.map(b => (!Array.isArray(b) ? b : b[0]));
|
||||
|
||||
if (biomes.length > 1 && globalScene.findModifier(m => m instanceof MapModifier)) {
|
||||
let biomeChoices: Biome[] = [];
|
||||
globalScene.executeWithSeedOffset(() => {
|
||||
biomeChoices = (
|
||||
!Array.isArray(biomeLinks[currentBiome])
|
||||
? [biomeLinks[currentBiome] as Biome]
|
||||
: (biomeLinks[currentBiome] as (Biome | [Biome, number])[])
|
||||
)
|
||||
.filter(b => !Array.isArray(b) || !randSeedInt(b[1]))
|
||||
.map(b => (Array.isArray(b) ? b[0] : b));
|
||||
}, globalScene.currentBattle.waveIndex);
|
||||
const biomeChoices: Biome[] = (
|
||||
!Array.isArray(biomeLinks[currentBiome])
|
||||
? [biomeLinks[currentBiome] as Biome]
|
||||
: (biomeLinks[currentBiome] as (Biome | [Biome, number])[])
|
||||
)
|
||||
.filter(b => !Array.isArray(b) || !randSeedInt(b[1]))
|
||||
.map(b => (Array.isArray(b) ? b[0] : b));
|
||||
|
||||
const biomeSelectItems = biomeChoices.map(b => {
|
||||
const ret: OptionSelectItem = {
|
||||
label: getBiomeName(b),
|
||||
|
|
Loading…
Reference in New Issue