phase 7: Mycelium — persistent knowledge network connecting runs

- Mycelium graph: nodes/edges/strength, deposit discoveries, weighted extraction
- Fungal nodes: ECS entities on world map with bioluminescent glow animation
- Knowledge system: deposit at nodes (+ auto on death), memory flash retrieval
- Mycosis: visual tint overlay on prolonged node contact, reveal threshold
- Spore shop: 5 Cradle bonuses (health, elements, knowledge boost)
- MetaState extended with MyceliumGraphData, IndexedDB persistence updated
- GameScene: node spawning, glow rendering, E-key interaction, mycosis overlay
- CradleScene: spore shop UI, Mycelium stats, purchased effects forwarding
- 36 new tests (385 total)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Денис Шкабатур
2026-02-12 15:47:03 +03:00
parent 35f8905921
commit 0d35cdcc73
17 changed files with 1866 additions and 22 deletions

View File

@@ -130,6 +130,44 @@ export interface MetaState {
bestRunDiscoveries: number;
/** Run history summaries */
runHistory: RunSummary[];
/** Mycelium knowledge graph (persistent between runs) */
mycelium: MyceliumGraphData;
}
/** Serializable Mycelium graph data (stored in MetaState) */
export interface MyceliumGraphData {
/** Knowledge nodes */
nodes: MyceliumNodeData[];
/** Connections between nodes */
edges: MyceliumEdgeData[];
/** Total deposits across all runs */
totalDeposits: number;
/** Total extractions across all runs */
totalExtractions: number;
}
/** A knowledge node in the persistent Mycelium graph */
export interface MyceliumNodeData {
/** Unique node ID (format: "type:id", e.g. "element:Na") */
id: string;
/** Knowledge category */
type: 'element' | 'reaction' | 'compound' | 'creature';
/** Reference to the specific knowledge item */
knowledgeId: string;
/** Run on which this was first deposited */
depositedOnRun: number;
/** Knowledge strength 01 (increases with repeated deposits) */
strength: number;
}
/** An edge connecting two knowledge nodes in the Mycelium */
export interface MyceliumEdgeData {
/** Source node ID */
from: string;
/** Target node ID */
to: string;
/** Connection strength 01 */
weight: number;
}
export interface RunSummary {