[Balance] Randomized Biome after End Biome (#3888)

* Biome.END goes somewhere random

* this way island is included too

* no towns or plains

* Enums are dumb

---------

Co-authored-by: frutescens <info@laptop>
This commit is contained in:
Mumble 2024-08-29 14:10:38 -07:00 committed by GitHub
parent db9434ac11
commit 9833b1da7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -7663,6 +7663,12 @@ export function initBiomes() {
biomeDepths[Biome.TOWN] = [ 0, 1 ];
const traverseBiome = (biome: Biome, depth: integer) => {
if (biome === Biome.END) {
const biomeList = Object.keys(Biome).filter(key => !isNaN(Number(key)));
biomeList.pop(); // Removes Biome.END from the list
const randIndex = Utils.randInt(biomeList.length, 2); // Will never be Biome.TOWN or Biome.PLAINS
biome = Biome[biomeList[randIndex]];
}
const linkedBiomes: (Biome | [ Biome, integer ])[] = Array.isArray(biomeLinks[biome])
? biomeLinks[biome] as (Biome | [ Biome, integer ])[]
: [ biomeLinks[biome] as Biome ];