feat(content): demo the state engine (generator unlocks/lights the cellar)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-31 22:01:57 +02:00
parent 00bad46661
commit a0b80f2a4b
4 changed files with 37 additions and 2 deletions

View File

@@ -78,6 +78,14 @@ Farb-Rollen: Items / NPCs / Exits / Heading / Gefahr.
### 5. Quest-System (NPC-Ausbau)
> ✅ Fundament umgesetzt (Branch `feature/quest-foundation`): World-Flags +
> Condition/Effect-Engine, verschlossene Exits, zustandsabhängige Beschreibungen,
> bedingte Dialoge, Reaktionen mit requires/effects, Schalter-Effekte. Demo:
> Generator schaltet Strom → Keller-Tür öffnet + Raum wird beleuchtet. Quest-
> Objekte/Log (#3.2) und Enden (#3.3) sowie Licht/Dunkelheit & Item-Kombination
> stehen noch aus.
- Aktuelles NPC-System: Begrüßung + Geschenk-Reaktion (Item → Item).
- Ausbau Richtung: mehrstufige Quests, Bedingungen, NPC-"Memory" (Zustand),
Quest-Log, evtl. Win-Condition daran gekoppelt.

View File

@@ -22,3 +22,15 @@
id: key
name: Brass Key
description: A small brass key, polished from use.
- type: switchable
id: generator
name: Generator
description: A rusty generator with a heavy lever.
initialState: false
onText: |
You heave the lever. Somewhere deep in the manor, the lights flicker on.
offText: |
You pull the lever back; the manor falls dark again.
effects:
- { setFlag: power_on }

View File

@@ -10,3 +10,8 @@
"Thank you! Here, take this key."
gives: key
consumes: lamp
dialogue:
- when: [{ flag: power_on }]
text: |
"You got the power running! The whole house feels less...
watchful now."

View File

@@ -9,6 +9,11 @@
south: dungeon
items: [letter, lamp]
npcs: [old_man]
exitLocks:
- direction: east
requires: [{ flag: power_on }]
blocked: |
The cellar door is held shut by a magnetic lock — dead without power.
- id: hallway
name: Dark Hallway
@@ -40,12 +45,17 @@
west: kitchen
items: []
npcs: []
descriptionStates:
- when: [{ flag: power_on }]
text: |
With the power back, a bare bulb buzzes overhead, revealing
shelves of dusty jars along the far wall.
- id: dungeon
name: Dungeon
description: |
A dark, damp room.
A dark, damp room. A rusty generator squats in the corner.
exits:
north: kitchen
items: []
items: [generator]
npcs: []