{
  "version": "1.1",
  "name": "Dynamic World State After Major Event",
  "startRoom": "lesson_room",
  "author": "TAGMaker",
  "description": "Restoring power changes room text, machine text, the caretaker’s response and access to the lift. All of these read the same remembered event, and the switch cannot repeat the repair.",
  "playerAppearance": {
    "version": 1,
    "layout": "modern",
    "font": "sans",
    "colorScheme": "light",
    "textSize": 18,
    "lineHeight": 1.6,
    "readingWidth": 80,
    "quietReading": false,
    "mapMode": "discovered",
    "panels": {
      "inventory": true,
      "map": true,
      "objectives": true,
      "status": true,
      "words": true
    },
    "picture": {
      "visible": true,
      "fit": "contain",
      "focalX": 50,
      "focalY": 50
    },
    "commands": {
      "visible": true,
      "standard": [
        "look",
        "search",
        "inventory",
        "help"
      ],
      "custom": []
    },
    "words": []
  },
  "created": "2026-11-01T00:00:00.000Z",
  "modified": "2026-11-01T00:00:00.000Z",
  "files": [
    {
      "path": "rooms/lesson_room.taml",
      "content": "room lesson_room\n  blocked north: \"The lift needs power.\"\n  exit north: lesson_lift when: lesson_powered\n  name: \"Power Station\"\n  description: \"Use the main generator to restore power. The lift is north.\"\n  smart_description: \"{\\\"version\\\":1,\\\"parts\\\":[{\\\"type\\\":\\\"conditional\\\",\\\"id\\\":\\\"lesson_station_prose\\\",\\\"when\\\":{\\\"kind\\\":\\\"flag_equals\\\",\\\"flag\\\":\\\"lesson_powered\\\",\\\"value\\\":true},\\\"then\\\":\\\"Bright consoles glow throughout the humming station.\\\",\\\"otherwise\\\":\\\"Dark consoles line the silent station.\\\"}]}\"\n  dark: false\nend"
    },
    {
      "path": "rooms/lesson_lift.taml",
      "content": "room lesson_lift\n  exit south: lesson_room\n  name: \"Working Lift\"\n  description: \"The station is south.\"\n  dark: false\nend"
    },
    {
      "path": "objects/lesson_generator.taml",
      "content": "object lesson_generator\n  name: \"main generator\"\n  description: \"Use the main generator to restore station power.\"\n  smart_description: \"{\\\"version\\\":1,\\\"parts\\\":[{\\\"type\\\":\\\"conditional\\\",\\\"id\\\":\\\"lesson_generator_prose\\\",\\\"when\\\":{\\\"kind\\\":\\\"flag_equals\\\",\\\"flag\\\":\\\"lesson_powered\\\",\\\"value\\\":true},\\\"then\\\":\\\"The generator runs steadily.\\\",\\\"otherwise\\\":\\\"The generator is stopped.\\\"}]}\"\n  location: lesson_room\n  droppable: false\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "npcs/lesson_keeper.taml",
      "content": "npc lesson_keeper\n  name: \"caretaker\"\n  description: \"The caretaker watches the power station.\"\n  location: lesson_room\n  mobile: false\n  follow: false\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\nend"
    },
    {
      "path": "objects/sample_field_journal.taml",
      "content": "object sample_field_journal\n  name: \"field journal\"\n  description: \"Use this journal when you have completed the recipe to record your success. You can also keep exploring before you finish.\"\n  location: inventory\n  aliases: [\"journal\"]\n  takeable: true\n  droppable: false\n  use_give: true\n  weight: 0.1\nend"
    }
  ],
  "story": {
    "version": 1,
    "states": [
      {
        "id": "lesson_powered",
        "name": "powered",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      }
    ],
    "rules": [
      {
        "id": "lesson_power",
        "name": "power",
        "enabled": true,
        "trigger": {
          "kind": "object",
          "target": "lesson_generator",
          "event": "use"
        },
        "match": "all",
        "conditions": [],
        "actions": [
          {
            "kind": "state",
            "target": "lesson_powered",
            "value": true
          },
          {
            "kind": "message",
            "value": "The main generator starts. Lights and lift return together."
          }
        ],
        "otherwise": "",
        "once": true,
        "repeatText": "The generator is already running."
      },
      {
        "id": "lesson_before",
        "name": "before",
        "enabled": true,
        "trigger": {
          "kind": "npc",
          "target": "lesson_keeper",
          "event": "talk"
        },
        "match": "all",
        "conditions": [
          {
            "kind": "state",
            "target": "lesson_powered",
            "operator": "==",
            "value": false
          }
        ],
        "actions": [
          {
            "kind": "message",
            "value": "Restore the generator before using the lift."
          }
        ],
        "otherwise": "",
        "once": false
      },
      {
        "id": "lesson_after",
        "name": "after",
        "enabled": true,
        "trigger": {
          "kind": "npc",
          "target": "lesson_keeper",
          "event": "talk"
        },
        "match": "all",
        "conditions": [
          {
            "kind": "state",
            "target": "lesson_powered",
            "operator": "==",
            "value": true
          }
        ],
        "actions": [
          {
            "kind": "message",
            "value": "Power is restored. The lift is ready."
          }
        ],
        "otherwise": "",
        "once": false
      },
      {
        "id": "sample_finish",
        "name": "Record the completed expedition",
        "enabled": true,
        "trigger": {
          "kind": "object",
          "target": "sample_field_journal",
          "event": "use"
        },
        "match": "all",
        "conditions": [
          {
            "kind": "state",
            "target": "lesson_powered",
            "operator": "==",
            "value": true
          }
        ],
        "actions": [
          {
            "kind": "message",
            "value": "The shared power state changed the whole station. You record the result in your field journal. Your expedition is complete."
          },
          {
            "kind": "score",
            "value": 100
          },
          {
            "kind": "end",
            "value": "Your expedition is complete."
          }
        ],
        "otherwise": "Your expedition is not complete yet. Follow the room clues, then use the field journal to record your success.",
        "once": true
      }
    ]
  },
  "cookbookRecipes": [
    {
      "version": 1,
      "settings": {
        "instance": "lesson",
        "recipeId": "a3-dynamic-world-state-after-major-event",
        "choices": {
          "room": {
            "existing": "",
            "name": "Power Station",
            "description": "Use the main generator to restore power. The lift is north."
          },
          "lift": {
            "existing": "",
            "name": "Working Lift",
            "description": "The station is south."
          },
          "generator": {
            "existing": "",
            "name": "main generator",
            "description": "Use the main generator to restore station power."
          },
          "keeper": {
            "existing": "",
            "name": "caretaker",
            "description": "The caretaker watches the power station."
          }
        },
        "values": {
          "before": "Dark consoles line the silent station.",
          "after": "Bright consoles glow throughout the humming station.",
          "machineBefore": "The generator is stopped.",
          "machineAfter": "The generator runs steadily.",
          "talkBefore": "Restore the generator before using the lift.",
          "talkAfter": "Power is restored. The lift is ready.",
          "success": "The main generator starts. Lights and lift return together.",
          "repeat": "The generator is already running."
        },
        "reuseRoutes": {}
      },
      "owned": [
        {
          "path": "files",
          "key": "rooms/lesson_room.taml",
          "after": {
            "path": "rooms/lesson_room.taml",
            "name": "lesson_room.taml",
            "content": "room lesson_room\n  blocked north: \"The lift needs power.\"\n  exit north: lesson_lift when: lesson_powered\n  name: \"Power Station\"\n  description: \"Use the main generator to restore power. The lift is north.\"\n  smart_description: \"{\\\"version\\\":1,\\\"parts\\\":[{\\\"type\\\":\\\"conditional\\\",\\\"id\\\":\\\"lesson_station_prose\\\",\\\"when\\\":{\\\"kind\\\":\\\"flag_equals\\\",\\\"flag\\\":\\\"lesson_powered\\\",\\\"value\\\":true},\\\"then\\\":\\\"Bright consoles glow throughout the humming station.\\\",\\\"otherwise\\\":\\\"Dark consoles line the silent station.\\\"}]}\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "rooms/lesson_lift.taml",
          "after": {
            "path": "rooms/lesson_lift.taml",
            "name": "lesson_lift.taml",
            "content": "room lesson_lift\n  exit south: lesson_room\n  name: \"Working Lift\"\n  description: \"The station is south.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_generator.taml",
          "after": {
            "path": "objects/lesson_generator.taml",
            "name": "lesson_generator.taml",
            "content": "object lesson_generator\n  name: \"main generator\"\n  description: \"Use the main generator to restore station power.\"\n  smart_description: \"{\\\"version\\\":1,\\\"parts\\\":[{\\\"type\\\":\\\"conditional\\\",\\\"id\\\":\\\"lesson_generator_prose\\\",\\\"when\\\":{\\\"kind\\\":\\\"flag_equals\\\",\\\"flag\\\":\\\"lesson_powered\\\",\\\"value\\\":true},\\\"then\\\":\\\"The generator runs steadily.\\\",\\\"otherwise\\\":\\\"The generator is stopped.\\\"}]}\"\n  location: lesson_room\n  droppable: false\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "npcs/lesson_keeper.taml",
          "after": {
            "path": "npcs/lesson_keeper.taml",
            "name": "lesson_keeper.taml",
            "content": "npc lesson_keeper\n  name: \"caretaker\"\n  description: \"The caretaker watches the power station.\"\n  location: lesson_room\n  mobile: false\n  follow: false\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\nend",
            "isDirty": true
          }
        },
        {
          "path": "objects",
          "key": "lesson_generator",
          "after": {
            "id": "lesson_generator",
            "name": "main generator",
            "description": "Use the main generator to restore station power.",
            "article": "",
            "location": "lesson_room",
            "aliases": [],
            "visible": true,
            "takeable": false,
            "droppable": false,
            "useGive": true,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": [],
            "smartProse": {
              "description": {
                "version": 1,
                "parts": [
                  {
                    "type": "conditional",
                    "id": "lesson_generator_prose",
                    "when": {
                      "kind": "flag_equals",
                      "flag": "lesson_powered",
                      "value": true
                    },
                    "then": "The generator runs steadily.",
                    "otherwise": "The generator is stopped."
                  }
                ]
              }
            }
          }
        },
        {
          "path": "npcs",
          "key": "lesson_keeper",
          "after": {
            "id": "lesson_keeper",
            "name": "caretaker",
            "description": "The caretaker watches the power station.",
            "location": "lesson_room",
            "mobile": false,
            "aliases": [],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": []
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_room",
          "after": {
            "id": "lesson_room",
            "name": "Power Station",
            "description": "Use the main generator to restore power. The lift is north.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "",
            "dark": false,
            "roomType": "regular",
            "x": 100,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "smartProse": {
              "description": {
                "version": 1,
                "parts": [
                  {
                    "type": "conditional",
                    "id": "lesson_station_prose",
                    "when": {
                      "kind": "flag_equals",
                      "flag": "lesson_powered",
                      "value": true
                    },
                    "then": "Bright consoles glow throughout the humming station.",
                    "otherwise": "Dark consoles line the silent station."
                  }
                ]
              }
            },
            "blockedDescriptions": {
              "north": "The lift needs power."
            }
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_lift",
          "after": {
            "id": "lesson_lift",
            "name": "Working Lift",
            "description": "The station is south.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "",
            "dark": false,
            "roomType": "regular",
            "x": 320,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_lift",
          "after": {
            "id": "lesson_route_lift",
            "fromRoom": "lesson_room",
            "toRoom": "lesson_lift",
            "direction": "north",
            "locked": false,
            "when": "lesson_powered"
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_back",
          "after": {
            "id": "lesson_route_back",
            "fromRoom": "lesson_lift",
            "toRoom": "lesson_room",
            "direction": "south",
            "locked": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_powered",
          "after": {
            "id": "lesson_powered",
            "name": "powered",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_power",
          "after": {
            "id": "lesson_power",
            "name": "power",
            "enabled": true,
            "trigger": {
              "kind": "object",
              "target": "lesson_generator",
              "event": "use"
            },
            "match": "all",
            "conditions": [],
            "actions": [
              {
                "kind": "state",
                "target": "lesson_powered",
                "value": true
              },
              {
                "kind": "message",
                "value": "The main generator starts. Lights and lift return together."
              }
            ],
            "otherwise": "",
            "once": true,
            "repeatText": "The generator is already running."
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_before",
          "after": {
            "id": "lesson_before",
            "name": "before",
            "enabled": true,
            "trigger": {
              "kind": "npc",
              "target": "lesson_keeper",
              "event": "talk"
            },
            "match": "all",
            "conditions": [
              {
                "kind": "state",
                "target": "lesson_powered",
                "operator": "==",
                "value": false
              }
            ],
            "actions": [
              {
                "kind": "message",
                "value": "Restore the generator before using the lift."
              }
            ],
            "otherwise": "",
            "once": false
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_after",
          "after": {
            "id": "lesson_after",
            "name": "after",
            "enabled": true,
            "trigger": {
              "kind": "npc",
              "target": "lesson_keeper",
              "event": "talk"
            },
            "match": "all",
            "conditions": [
              {
                "kind": "state",
                "target": "lesson_powered",
                "operator": "==",
                "value": true
              }
            ],
            "actions": [
              {
                "kind": "message",
                "value": "Power is restored. The lift is ready."
              }
            ],
            "otherwise": "",
            "once": false
          }
        }
      ]
    }
  ],
  "creatorNotes": "Restoring power changes room text, machine text, the caretaker’s response and access to the lift. All of these read the same remembered event, and the switch cannot repeat the repair.\nOpen Help → Cookbook → Dynamic World State After Major Event → Start this recipe to inspect its saved settings. The field journal and 100-point ending belong only to the sample game.\nCommands: look; examine main generator; talk caretaker; north; use main generator; look; examine main generator; talk caretaker; north; south; use main generator; use field journal",
  "mapRooms": [
    {
      "id": "lesson_room",
      "name": "Power Station",
      "description": "Use the main generator to restore power. The lift is north.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "",
      "dark": false,
      "roomType": "regular",
      "x": 100,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "smartProse": {
        "description": {
          "version": 1,
          "parts": [
            {
              "type": "conditional",
              "id": "lesson_station_prose",
              "when": {
                "kind": "flag_equals",
                "flag": "lesson_powered",
                "value": true
              },
              "then": "Bright consoles glow throughout the humming station.",
              "otherwise": "Dark consoles line the silent station."
            }
          ]
        }
      },
      "blockedDescriptions": {
        "north": "The lift needs power."
      }
    },
    {
      "id": "lesson_lift",
      "name": "Working Lift",
      "description": "The station is south.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "",
      "dark": false,
      "roomType": "regular",
      "x": 320,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    }
  ],
  "mapExits": [
    {
      "id": "lesson_route_lift",
      "fromRoom": "lesson_room",
      "toRoom": "lesson_lift",
      "direction": "north",
      "locked": false,
      "when": "lesson_powered"
    },
    {
      "id": "lesson_route_back",
      "fromRoom": "lesson_lift",
      "toRoom": "lesson_room",
      "direction": "south",
      "locked": false
    }
  ],
  "objects": [
    {
      "id": "lesson_generator",
      "name": "main generator",
      "description": "Use the main generator to restore station power.",
      "article": "",
      "location": "lesson_room",
      "aliases": [],
      "visible": true,
      "takeable": false,
      "droppable": false,
      "useGive": true,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": [],
      "smartProse": {
        "description": {
          "version": 1,
          "parts": [
            {
              "type": "conditional",
              "id": "lesson_generator_prose",
              "when": {
                "kind": "flag_equals",
                "flag": "lesson_powered",
                "value": true
              },
              "then": "The generator runs steadily.",
              "otherwise": "The generator is stopped."
            }
          ]
        }
      }
    },
    {
      "id": "sample_field_journal",
      "name": "field journal",
      "description": "Use this journal when you have completed the recipe to record your success. You can also keep exploring before you finish.",
      "article": "",
      "location": "inventory",
      "aliases": [
        "journal"
      ],
      "visible": true,
      "takeable": true,
      "droppable": false,
      "useGive": true,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": []
    }
  ],
  "npcs": [
    {
      "id": "lesson_keeper",
      "name": "caretaker",
      "description": "The caretaker watches the power station.",
      "location": "lesson_room",
      "mobile": false,
      "aliases": [],
      "onEnter": "",
      "onExamine": "",
      "onTalk": "",
      "onAttack": "",
      "onDeath": "",
      "onFollow": "",
      "onAutoAttack": "",
      "onTrustChange": "",
      "onGive": "",
      "onBeforeTalk": "",
      "onAfterTalk": "",
      "onBeforeAttack": "",
      "onAfterAttack": "",
      "onDamage": "",
      "onHeal": "",
      "onMove": "",
      "onLeave": "",
      "followPlayer": false,
      "health": 100,
      "combatSide": "neutral",
      "autoFight": false,
      "attackPower": 10,
      "defense": 0,
      "trustLevel": 50,
      "conversationEnabled": false,
      "convGreeting": "",
      "convFarewell": "",
      "convTopics": [],
      "dialogues": []
    }
  ],
  "activeMechanics": [],
  "verbAliases": [],
  "scripts": [],
  "worldEvents": [],
  "customMechanicDefs": [],
  "savedMechanicTemplates": [],
  "objectiveSets": [],
  "gameOutliner": {},
  "customRoomTemplates": [],
  "customObjectTemplates": [],
  "customNpcTemplates": [],
  "customSavedScripts": [],
  "requiredCapabilities": [
    "smart-prose-v1",
    "story-rules-v1"
  ]
}
