phase 9: biome expansion — 3 biomes, 40 elements, 119 reactions, 9 species

Expand beyond vertical slice with two new biomes and massive chemistry expansion:

Chemistry: +20 real elements (Li→U), +39 compounds (acids/salts/oxides/organics),
+85 reactions (Haber process, thermite variants, smelting, fermentation, etc.)

Biomes: Kinetic Mountains (physics/mechanics themed) and Verdant Forests
(biology/ecology themed), each with 8 tile types and unique generation rules.

Creatures: 6 new species — Pendulums/Mechanoids/Resonators (mountains),
Symbiotes/Mimics/Spore-bearers (forests). Species filtered by biome.

Infrastructure: CradleScene biome selector UI, generic world generator
(tile lookup by property instead of hardcoded names), actinide element category.

487 tests passing (32 new).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Денис Шкабатур
2026-02-12 17:27:15 +03:00
parent 3c24205e72
commit 6ba0746bb9
16 changed files with 2176 additions and 39 deletions

View File

@@ -132,7 +132,10 @@ export class GameScene extends Phaser.Scene {
// Purchased bonuses from Cradle shop
private purchasedEffects: import('../mycelium/types').BonusEffect[] = [];
init(data: { meta: MetaState; schoolId: string; runId: number; purchasedEffects?: import('../mycelium/types').BonusEffect[] }): void {
// Biome selection
private biomeId = 'catalytic-wastes';
init(data: { meta: MetaState; schoolId: string; runId: number; purchasedEffects?: import('../mycelium/types').BonusEffect[]; biomeId?: string }): void {
this.meta = data.meta;
this.runState = createRunState(data.runId, data.schoolId);
this.crisisState = null;
@@ -141,6 +144,7 @@ export class GameScene extends Phaser.Scene {
this.hasDepositedThisRun = false;
this.memoryFlashTimer = 0;
this.purchasedEffects = data.purchasedEffects ?? [];
this.biomeId = data.biomeId ?? 'catalytic-wastes';
}
create(): void {
@@ -149,8 +153,8 @@ export class GameScene extends Phaser.Scene {
this.bridge = new PhaserBridge(this);
this.projectileData = new Map();
// 2. Generate world
const biome = biomeDataArray[0] as BiomeData;
// 2. Generate world — use selected biome
const biome = (biomeDataArray as BiomeData[]).find(b => b.id === this.biomeId) ?? biomeDataArray[0] as BiomeData;
this.worldSeed = Date.now() % 1000000;
const worldData = generateWorld(biome, this.worldSeed);
@@ -172,17 +176,18 @@ export class GameScene extends Phaser.Scene {
this.gameWorld.world, worldData.grid, biome, this.worldSeed,
);
// 6. Initialize creature systems
// 6. Initialize creature systems — filter by biome
const allSpecies = speciesDataArray as SpeciesData[];
this.speciesRegistry = new SpeciesRegistry(allSpecies);
const biomeSpecies = allSpecies.filter(s => s.biome === biome.id);
this.speciesRegistry = new SpeciesRegistry(biomeSpecies);
this.speciesLookup = new Map<number, SpeciesData>();
for (const s of allSpecies) {
for (const s of biomeSpecies) {
this.speciesLookup.set(s.speciesId, s);
}
// 7. Spawn creatures across the map
this.creatureData = spawnInitialCreatures(
this.gameWorld.world, worldData.grid, biome, this.worldSeed, allSpecies,
this.gameWorld.world, worldData.grid, biome, this.worldSeed, biomeSpecies,
);
// 8. Create player at spawn position + inventory with starting kit