Commit Graph

20 Commits

Author SHA1 Message Date
Денис Шкабатур
7d52d749a3 phase 8: Ouroboros boss fight — pattern puzzle with 3 victory paths
First Archon encounter: a cyclical pattern-recognition puzzle.

Boss AI: 4-phase cycle (Coil → Spray → Lash → Digest) with
escalating difficulty (10% faster per cycle, caps at 5 cycles).

Victory paths (all based on real chemistry):
- Chemical: NaOH during Spray phase (acid-base neutralization, 3x dmg)
- Direct: any projectile during Digest vulnerability window
- Catalytic: Hg poison stacks (mercury poisons catalytic sites, reduces
  regen+armor permanently)

New files: src/boss/ (types, ai, victory, arena, factory, reward),
src/data/bosses.json, src/scenes/BossArenaScene.ts, tests/boss.test.ts

Extended: ECS Boss component, CodexEntry 'boss' type, GameScene
triggers arena on Resolution phase completion.

70 new tests (455 total), all passing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:12:34 +03:00
Денис Шкабатур
0d35cdcc73 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>
2026-02-12 15:47:03 +03:00
Денис Шкабатур
493748f2b0 phase 6: escalation effects + enhanced crisis system
- Add escalation effects module: creature speed/aggro/damage multipliers,
  reaction instability, environmental damage — all scale 0→1
- Add getCrisisPlayerDamage/getCrisisTint to crisis module
- Integrate escalation effects into GameScene (env damage at high entropy)
- Dynamic crisis overlay tint that intensifies with progress
- Phase indicator shows entropy %, aggression multiplier, crisis status
- 14 new tests for escalation + crisis damage/tint (349 total)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:24:48 +03:00
Денис Шкабатур
3d4f710cb0 fix texture reuse on run cycle restart + expose debug kill
- Remove existing tilemap/minimap textures before recreating (prevents
  "Texture key already in use" error on second run)
- Expose __game and __debugKill for dev console testing

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:22:49 +03:00
Денис Шкабатур
56c96798e3 phase 6: scene flow — Cradle, Death, Fractal scenes + run integration
- Add CradleScene (Spore Cradle): school selection UI with spore particles
- Add DeathScene: body decomposes into real elements with labels
- Add FractalScene: WebGL Mandelbrot/Julia shader + canvas fallback
- Integrate RunState into GameScene: phase management, escalation, crisis
- Give starting kit from chosen school on run start
- Player death triggers DeathScene → FractalScene → CradleScene loop
- Track element/creature discoveries during gameplay
- Chemical Plague crisis: tinted overlay, player damage, neutralization
- BootScene loads meta from IndexedDB, goes to CradleScene
- Update version to v0.6.0

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:15:17 +03:00
Денис Шкабатур
5b7dbb4df3 phase 6: school data, run state, meta-progression, crisis system
- Add school data (Alchemist: H, O, C, Na, S, Fe starting kit)
- Add run cycle types: phases, escalation, crisis, body composition
- Implement run state management (create, advance phase, discoveries, spores)
- Implement meta-progression (codex, spore accumulation, run history)
- Implement crisis system (Chemical Plague with neutralization)
- Add IndexedDB persistence for meta state
- 42 new tests (335 total)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:10:05 +03:00
Денис Шкабатур
22e6c6bcee chore: complete Phase 5 — update version, progress, and plan
- BootScene version bumped to v0.5.0
- PROGRESS.md updated with Phase 5 completion details
- IMPLEMENTATION-PLAN.md Phase 5 marked 
- Ready for Phase 6: Run Cycle

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 14:21:35 +03:00
Денис Шкабатур
9521b7951c feat(creatures): add interaction system and GameScene integration
- Projectile-creature collision with armor-based damage reduction
- Creature observation system (health/energy/stage when near player)
- Creature-to-player melee attacks with cooldown
- Full GameScene integration: AI, metabolism, lifecycle, reproduction, interaction
- Debug overlay shows creature count
- 16 new interaction tests (288 total)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 14:15:58 +03:00
Денис Шкабатур
324be5e643 feat(creatures): add creature types, data, ECS components, and core systems
Phase 5.1-5.5: Creatures & Ecology foundation
- 3 species data (Crystallid, Acidophile, Reagent) with real chemistry
- ECS components: Creature, AI, Metabolism, LifeCycle
- AI FSM system: idle → wander → feed → flee → attack
- Metabolism: energy drain, feeding from resources, starvation damage
- Life cycle: egg → youth → mature → aging → natural death
- Population dynamics: counting, reproduction, initial spawning
- Species registry with numeric/string ID lookup
- 51 tests passing (272 total)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 14:13:26 +03:00
Денис Шкабатур
7e46d1ed1d feat: HUD overlay via UIScene — health bar, quick slots, inventory info (Phase 4.7)
UIScene renders as overlay on top of GameScene:
- Health bar (top-left) with color transitions green→yellow→red
- 4 quick slots (bottom-center) with active highlight, item symbols and counts
- Inventory weight/slots info (bottom-right)
- Controls hint (top-right)

GameScene pushes state to Phaser registry each frame.
Phase 4 (Player Systems) complete — 222 tests passing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 13:36:42 +03:00
Денис Шкабатур
d173ada466 feat: quick slots with 1-4 hotkeys (Phase 4.6)
4 quick slots bound to keys 1-4. Active slot determines what F key
throws. Auto-assigns new items on collection. Clears slot when item
depleted. 15 new tests (213 total).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 13:31:12 +03:00
Денис Шкабатур
0396170303 feat: projectile system for throwing elements (Phase 4.5)
F key launches first inventory item toward mouse cursor as projectile.
Projectiles travel at 350px/s, expire after 2s, destroyed on hitting
non-walkable tiles. Color matches element's periodic table color.
13 new tests (198 total).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 13:29:38 +03:00
Денис Шкабатур
b097ce738f feat: crafting system with chemistry engine integration (Phase 4.4)
craftFromInventory checks reagent availability, runs ReactionEngine,
consumes reagents on success, adds products. Failed attempts return
educational reasons (noble gas inertness, missing conditions, etc.).
11 new tests (185 total).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 13:27:22 +03:00
Денис Шкабатур
e77b9df6e4 feat: resource collection with E-key interaction (Phase 4.3)
Mineral veins yield metals (Fe, Cu, Zn, Au, Sn), geysers yield S/H.
Resources spawn as ECS entities with gold/orange dot sprites on tiles.
E-key collects nearest resource in range into inventory. Resources
deplete after collection. Visual feedback text. 12 new tests (174 total).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 13:25:35 +03:00
Денис Шкабатур
cf36c0adce feat: weight-based inventory with element stacking (Phase 4.2)
Inventory uses real atomic/molecular masses (AMU). Same items auto-stack.
Respects weight limits and slot limits. Supports elements and compounds
via chemistry registries. 28 new tests (162 total).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 13:11:20 +03:00
Денис Шкабатур
0c0635c93b feat: player entity with WASD movement, tile collision, camera follow (Phase 4.1)
Player spawns at walkable tile near map center. WASD controls movement
(150px/s, normalized diagonal). Tile collision with wall-sliding prevents
walking through acid pools, crystals, geysers. Camera follows player with
smooth lerp. 39 new tests (134 total).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 13:09:01 +03:00
Денис Шкабатур
bc472d0f77 Phase 3: World generation — procedural tilemap for Catalytic Wastes
- simplex-noise with seeded PRNG (mulberry32) for deterministic generation
- Biome data: 8 tile types (scorched earth, cracked ground, ash sand,
  acid pools, acid shallow, crystals, geysers, mineral veins)
- Elevation noise → base terrain; detail noise → geyser/mineral overlays
- Canvas-based tileset with per-pixel brightness variation
- Phaser tilemap with collision on non-walkable tiles
- Camera: WASD movement, mouse wheel zoom (0.5x–3x), world bounds
- Minimap: 160x160 canvas overview with viewport indicator
- 21 world generation tests passing (95 total)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 12:47:21 +03:00
Денис Шкабатур
ddbca12740 Phase 2: ECS foundation — world, components, systems, bridge
- bitECS world with time tracking (delta, elapsed, tick)
- 5 components: Position, Velocity, SpriteRef, Health, ChemicalComposition
- Movement system (velocity * delta) + bounce system (boundary reflection)
- Health system with damage, healing, death detection
- Entity factory (createGameEntity/removeGameEntity)
- Phaser bridge: polling sync creates/destroys/updates circle sprites
- GameScene: 20 colored circles bouncing at 60fps
- BootScene: click-to-start transition, version bump to v0.2.0
- 39 ECS unit tests passing (74 total)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 12:34:06 +03:00
Денис Шкабатур
7aabb8b4fc Phase 1: Chemistry engine — elements, compounds, reactions
- 20 real elements from periodic table (H through Hg) with accurate data
- 25 compounds with game effects (NaCl, H₂O, gunpowder, thermite, etc.)
- 34 reactions: synthesis, combustion, acid-base, redox, decomposition
- Reaction engine with O(1) lookup by sorted reactant key
- Educational failure reasons (noble gas, missing heat/catalyst, wrong proportions)
- Condition system: temperature, catalyst, energy requirements
- 35 unit tests passing, TypeScript strict, zero errors

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 12:16:08 +03:00
Денис Шкабатур
10bd67c951 Phase 0: Project setup for agent-driven development
- Phaser 3 + bitECS 0.4 + TypeScript + Vite stack
- BootScene with title screen
- 6 cursor rules (project context, agent workflow, ECS, chemistry, Phaser, data)
- Vitest configured with happy-dom
- GDD, engine analysis, implementation plan, progress tracking

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 11:59:41 +03:00