{
  "version": "1.1",
  "name": "Quest, Scene & Hint Workshop",
  "startRoom": "lesson_workshop",
  "author": "TAGMaker",
  "description": "Restore power, unlock a cage and escort a living prisoner to the yard. Choose a permanent approach, follow a three-step hint ladder, and watch an alarm scene start and stop. An optional clue changes the ending; an abort switch demonstrates failure.",
  "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_workshop.taml",
      "content": "room lesson_workshop\n  exit east: lesson_cage_room\n  name: \"Rescue Workshop\"\n  description: \"Take the brass key and use the lever. HINT gives increasingly direct advice. The cage room is east. Read the record for an optional clue. The abort switch abandons the mission.\"\n  dark: false\nend"
    },
    {
      "path": "rooms/lesson_cage_room.taml",
      "content": "room lesson_cage_room\n  blocked east: \"Choose the tunnel approach first.\"\n  exit east: lesson_yard when: lesson_tunnel_open\n  blocked north: \"Choose the ridge approach first.\"\n  exit north: lesson_yard when: lesson_ridge_open\n  exit west: lesson_workshop\n  name: \"Cage Room\"\n  description: \"Use the route console to choose ridge or tunnel. Carry the key and restore power, then USE CAGE. TALK PRISONER to escort them. The ridge leads north; the tunnel leads east. The workshop is west.\"\n  dark: false\nend"
    },
    {
      "path": "rooms/lesson_yard.taml",
      "content": "room lesson_yard\n  name: \"Safe Yard\"\n  description: \"The rescue ends here when the living prisoner arrives.\"\n  dark: false\nend"
    },
    {
      "path": "objects/lesson_key.taml",
      "content": "object lesson_key\n  name: \"brass key\"\n  description: \"A key for the cage.\"\n  location: lesson_workshop\n  takeable: true\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_lever.taml",
      "content": "object lesson_lever\n  name: \"lever\"\n  description: \"Use to restore power and start the alarm.\"\n  location: lesson_workshop\n  droppable: false\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_record.taml",
      "content": "object lesson_record\n  name: \"record\"\n  description: \"Read for an optional safety clue.\"\n  location: lesson_workshop\n  droppable: false\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_abort.taml",
      "content": "object lesson_abort\n  name: \"abort switch\"\n  description: \"Use to abandon the mission.\"\n  location: lesson_workshop\n  droppable: false\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_cage.taml",
      "content": "object lesson_cage\n  name: \"cage\"\n  description: \"Needs the carried key and restored power.\"\n  location: lesson_cage_room\n  droppable: false\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_console.taml",
      "content": "object lesson_console\n  name: \"route console\"\n  description: \"Choose one permanent approach.\"\n  location: lesson_cage_room\n  droppable: false\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "npcs/lesson_prisoner.taml",
      "content": "npc lesson_prisoner\n  name: \"prisoner\"\n  description: \"Free them, then talk to begin the escort.\"\n  location: lesson_cage_room\n  mobile: true\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"
    }
  ],
  "story": {
    "version": 1,
    "states": [
      {
        "id": "lesson_power",
        "name": "power",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_freed",
        "name": "freed",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_clue",
        "name": "clue",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_abort",
        "name": "abort",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_done",
        "name": "done",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_alarm",
        "name": "alarm",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_scene_cleaned",
        "name": "scene cleaned",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_ridge_open",
        "name": "ridge open",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_tunnel_open",
        "name": "tunnel open",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_approach",
        "name": "approach",
        "description": "Progress remembered by this recipe.",
        "type": "string",
        "initial": ""
      }
    ],
    "rules": [
      {
        "id": "lesson_power",
        "name": "power",
        "enabled": true,
        "trigger": {
          "kind": "object",
          "target": "lesson_lever",
          "event": "use"
        },
        "match": "all",
        "conditions": [],
        "actions": [
          {
            "kind": "state",
            "target": "lesson_power",
            "value": true
          },
          {
            "kind": "message",
            "value": "The power returns. The rescue alarm begins."
          }
        ],
        "otherwise": "",
        "once": true,
        "repeatText": "The power is already restored."
      },
      {
        "id": "lesson_read",
        "name": "read",
        "enabled": true,
        "trigger": {
          "kind": "object",
          "target": "lesson_record",
          "event": "custom:read"
        },
        "match": "all",
        "conditions": [],
        "actions": [
          {
            "kind": "state",
            "target": "lesson_clue",
            "value": true
          },
          {
            "kind": "message",
            "value": "The record shows the safest handover procedure."
          }
        ],
        "otherwise": "",
        "once": true
      },
      {
        "id": "lesson_abort",
        "name": "abort",
        "enabled": true,
        "trigger": {
          "kind": "object",
          "target": "lesson_abort",
          "event": "use"
        },
        "match": "all",
        "conditions": [],
        "actions": [
          {
            "kind": "state",
            "target": "lesson_abort",
            "value": true
          }
        ],
        "otherwise": "",
        "once": false
      },
      {
        "id": "lesson_open_cage",
        "name": "open cage",
        "enabled": true,
        "trigger": {
          "kind": "object",
          "target": "lesson_cage",
          "event": "use"
        },
        "match": "all",
        "conditions": [
          {
            "kind": "state",
            "target": "lesson_power",
            "operator": "==",
            "value": true
          },
          {
            "kind": "inventory",
            "target": "lesson_key",
            "operator": "==",
            "value": true
          }
        ],
        "actions": [
          {
            "kind": "state",
            "target": "lesson_freed",
            "value": true
          },
          {
            "kind": "message",
            "value": "The cage opens. Talk to the prisoner to lead them to safety."
          }
        ],
        "otherwise": "Restore power and carry the brass key first.",
        "once": true,
        "repeatText": "The cage is already open."
      },
      {
        "id": "lesson_escort",
        "name": "escort",
        "enabled": true,
        "trigger": {
          "kind": "npc",
          "target": "lesson_prisoner",
          "event": "talk"
        },
        "match": "all",
        "conditions": [
          {
            "kind": "state",
            "target": "lesson_freed",
            "operator": "==",
            "value": true
          }
        ],
        "actions": [
          {
            "kind": "npc_control",
            "target": "lesson_prisoner",
            "operation": "recruit"
          },
          {
            "kind": "message",
            "value": "The prisoner follows you. Take your chosen route to the safe yard."
          }
        ],
        "otherwise": "Open the cage before beginning the escort.",
        "once": false
      },
      {
        "id": "lesson_choose",
        "name": "choose",
        "enabled": true,
        "trigger": {
          "kind": "object",
          "target": "lesson_console",
          "event": "use"
        },
        "match": "all",
        "conditions": [
          {
            "kind": "state",
            "target": "lesson_approach",
            "operator": "==",
            "value": ""
          }
        ],
        "actions": [
          {
            "kind": "prompt",
            "target": "lesson_approach_prompt"
          }
        ],
        "otherwise": "Your approach is already chosen.",
        "once": false
      }
    ],
    "features": {
      "version": 1,
      "npcProfiles": [
        {
          "version": 1,
          "id": "lesson_prisoner_profile",
          "name": "prisoner abilities",
          "npcId": "lesson_prisoner",
          "enabled": true,
          "memory": [],
          "traits": {
            "loyalty": 50,
            "fear": 0,
            "suspicion": 0
          },
          "life": {
            "maxHealth": 100,
            "initial": "active",
            "essential": false,
            "defeat": "dead",
            "retreatAtHealth": 0
          },
          "inventory": {
            "objects": [],
            "equipped": [],
            "equipment": [],
            "money": 0,
            "dropOnDeath": false
          },
          "combat": {
            "assist": "off",
            "target": "first_enemy",
            "interceptPercent": 50,
            "interval": 1
          },
          "perception": {
            "enabled": false,
            "sightRange": 0,
            "hearingRange": 0,
            "suspicionPerSight": 10,
            "suspicionPerNoise": 10,
            "threshold": 50,
            "investigate": false,
            "returnHome": false,
            "allowedRoomIds": []
          },
          "abilities": []
        }
      ],
      "prompts": [
        {
          "id": "lesson_approach_prompt",
          "name": "Which approach will you use?",
          "enabled": true,
          "text": "Which approach will you use?",
          "cancelLabel": "Leave the choice for later",
          "cancelable": true,
          "owner": {
            "kind": "object",
            "id": "lesson_console"
          },
          "options": [
            {
              "id": "ridge",
              "label": "Ridge",
              "match": "all",
              "conditions": [],
              "actions": [
                {
                  "kind": "state",
                  "target": "lesson_approach",
                  "value": "ridge"
                },
                {
                  "kind": "state",
                  "target": "lesson_ridge_open",
                  "value": true
                }
              ],
              "once": false,
              "unavailable": "disable"
            },
            {
              "id": "tunnel",
              "label": "Tunnel",
              "match": "all",
              "conditions": [],
              "actions": [
                {
                  "kind": "state",
                  "target": "lesson_approach",
                  "value": "tunnel"
                },
                {
                  "kind": "state",
                  "target": "lesson_tunnel_open",
                  "value": true
                }
              ],
              "once": false,
              "unavailable": "disable"
            }
          ]
        }
      ],
      "quests": [
        {
          "id": "lesson_rescue",
          "name": "Rescue the prisoner",
          "enabled": true,
          "description": "Carry the key, restore power, select a route and escort the living prisoner.",
          "stages": [
            {
              "id": "lesson_key_stage",
              "name": "Carry the brass key",
              "description": "Carry the brass key",
              "prerequisites": [],
              "optional": false,
              "automatic": true,
              "conditions": [
                {
                  "kind": "inventory",
                  "target": "lesson_key",
                  "operator": "==",
                  "value": true
                }
              ],
              "match": "all",
              "completionText": "Carry the brass key completed.",
              "actions": []
            },
            {
              "id": "lesson_power_stage",
              "name": "Restore power",
              "description": "Restore power",
              "prerequisites": [
                "lesson_key_stage"
              ],
              "optional": false,
              "automatic": true,
              "conditions": [
                {
                  "kind": "state",
                  "target": "lesson_power",
                  "operator": "==",
                  "value": true
                }
              ],
              "match": "all",
              "completionText": "Restore power completed.",
              "actions": []
            },
            {
              "id": "lesson_ridge",
              "name": "Choose the ridge",
              "description": "Choose the ridge",
              "prerequisites": [
                "lesson_power_stage"
              ],
              "optional": false,
              "automatic": true,
              "conditions": [
                {
                  "kind": "state",
                  "target": "lesson_approach",
                  "operator": "==",
                  "value": "ridge"
                }
              ],
              "match": "all",
              "completionText": "Choose the ridge completed.",
              "actions": [],
              "exclusiveGroup": "lesson_approach_group"
            },
            {
              "id": "lesson_tunnel",
              "name": "Choose the tunnel",
              "description": "Choose the tunnel",
              "prerequisites": [
                "lesson_power_stage"
              ],
              "optional": false,
              "automatic": true,
              "conditions": [
                {
                  "kind": "state",
                  "target": "lesson_approach",
                  "operator": "==",
                  "value": "tunnel"
                }
              ],
              "match": "all",
              "completionText": "Choose the tunnel completed.",
              "actions": [],
              "exclusiveGroup": "lesson_approach_group"
            },
            {
              "id": "lesson_clue_stage",
              "name": "Read the optional record",
              "description": "Read the optional record",
              "prerequisites": [],
              "optional": true,
              "automatic": true,
              "conditions": [
                {
                  "kind": "state",
                  "target": "lesson_clue",
                  "operator": "==",
                  "value": true
                }
              ],
              "match": "all",
              "completionText": "Read the optional record completed.",
              "actions": []
            },
            {
              "id": "lesson_safe",
              "name": "Escort the living prisoner",
              "description": "Escort the living prisoner",
              "prerequisites": [
                "lesson_power_stage"
              ],
              "optional": false,
              "automatic": true,
              "conditions": [
                {
                  "kind": "state",
                  "target": "lesson_freed",
                  "operator": "==",
                  "value": true
                },
                {
                  "kind": "room",
                  "target": "lesson_yard",
                  "operator": "==",
                  "value": true
                },
                {
                  "kind": "npc_available",
                  "target": "lesson_prisoner",
                  "operator": "==",
                  "value": true
                },
                {
                  "kind": "npc_health",
                  "target": "lesson_prisoner",
                  "operator": ">",
                  "value": 0
                }
              ],
              "match": "all",
              "completionText": "Escort the living prisoner completed.",
              "actions": []
            }
          ],
          "completionText": "The rescue is complete.",
          "completionActions": [
            {
              "kind": "score",
              "value": 100
            }
          ],
          "failureConditions": [
            {
              "kind": "state",
              "target": "lesson_abort",
              "operator": "==",
              "value": true
            }
          ],
          "failureMatch": "all",
          "failureText": "The rescue has been abandoned.",
          "failureActions": []
        }
      ],
      "scenes": [
        {
          "id": "lesson_alarm_scene",
          "name": "Rescue alarm",
          "enabled": true,
          "automatic": true,
          "priority": 1,
          "recurring": false,
          "roomIds": [
            "lesson_workshop",
            "lesson_cage_room",
            "lesson_yard"
          ],
          "startConditions": [
            {
              "kind": "state",
              "target": "lesson_power",
              "operator": "==",
              "value": true
            },
            {
              "kind": "state",
              "target": "lesson_freed",
              "operator": "==",
              "value": false
            }
          ],
          "startMatch": "all",
          "endConditions": [
            {
              "kind": "room",
              "target": "lesson_yard",
              "operator": "==",
              "value": true
            },
            {
              "kind": "npc_available",
              "target": "lesson_prisoner",
              "operator": "==",
              "value": true
            },
            {
              "kind": "npc_health",
              "target": "lesson_prisoner",
              "operator": ">",
              "value": 0
            }
          ],
          "endMatch": "all",
          "entryActions": [
            {
              "kind": "state",
              "target": "lesson_alarm",
              "value": true
            },
            {
              "kind": "message",
              "value": "The red rescue alarm lights up."
            }
          ],
          "activeActions": [
            {
              "kind": "message",
              "value": "The alarm hums while the rescue is underway."
            }
          ],
          "exitActions": [
            {
              "kind": "state",
              "target": "lesson_alarm",
              "value": false
            },
            {
              "kind": "state",
              "target": "lesson_scene_cleaned",
              "value": true
            },
            {
              "kind": "message",
              "value": "The alarm goes silent. The prisoner is safe."
            }
          ]
        }
      ],
      "hints": [
        {
          "id": "lesson_rescue_hint",
          "name": "Rescue help",
          "enabled": true,
          "scope": {
            "kind": "puzzle",
            "target": "lesson_rescue_puzzle"
          },
          "priority": 1,
          "conditions": [],
          "match": "all",
          "completedConditions": [
            {
              "kind": "quest_status",
              "target": "lesson_rescue",
              "operator": "==",
              "value": "completed"
            }
          ],
          "completedMatch": "all",
          "completedText": "The prisoner has reached safety.",
          "progressStateId": "lesson_power",
          "levels": [
            {
              "level": "gentle",
              "text": "The cage needs both a key and power.",
              "conditions": [],
              "match": "all"
            },
            {
              "level": "strong",
              "text": "The workshop has the key and the power lever.",
              "conditions": [],
              "match": "all"
            },
            {
              "level": "solution",
              "text": "TAKE BRASS KEY, USE LEVER, EAST, USE ROUTE CONSOLE, choose 1 or 2, USE CAGE, TALK PRISONER, then NORTH for ridge or EAST for tunnel.",
              "conditions": [],
              "match": "all"
            }
          ]
        }
      ],
      "endings": [
        {
          "id": "lesson_failure",
          "name": "Abandoned rescue",
          "enabled": true,
          "automatic": true,
          "priority": 100,
          "conditions": [
            {
              "kind": "state",
              "target": "lesson_abort",
              "operator": "==",
              "value": true
            }
          ],
          "match": "all",
          "text": "You leave the rescue unfinished.",
          "actions": []
        },
        {
          "id": "lesson_best",
          "name": "Prepared rescue",
          "enabled": true,
          "automatic": true,
          "priority": 80,
          "conditions": [
            {
              "kind": "quest_status",
              "target": "lesson_rescue",
              "operator": "==",
              "value": "completed"
            },
            {
              "kind": "state",
              "target": "lesson_clue",
              "operator": "==",
              "value": true
            },
            {
              "kind": "state",
              "target": "lesson_scene_cleaned",
              "operator": "==",
              "value": true
            },
            {
              "kind": "room",
              "target": "lesson_yard",
              "operator": "==",
              "value": true
            }
          ],
          "match": "all",
          "text": "The prepared rescue brings everyone safely home.",
          "actions": [
            {
              "kind": "state",
              "target": "lesson_done",
              "value": true
            }
          ]
        },
        {
          "id": "lesson_ordinary",
          "name": "Safe rescue",
          "enabled": true,
          "automatic": true,
          "priority": 40,
          "conditions": [
            {
              "kind": "quest_status",
              "target": "lesson_rescue",
              "operator": "==",
              "value": "completed"
            },
            {
              "kind": "state",
              "target": "lesson_scene_cleaned",
              "operator": "==",
              "value": true
            },
            {
              "kind": "room",
              "target": "lesson_yard",
              "operator": "==",
              "value": true
            }
          ],
          "match": "all",
          "text": "The prisoner is safe. The rescue is complete.",
          "actions": [
            {
              "kind": "state",
              "target": "lesson_done",
              "value": true
            }
          ]
        }
      ]
    }
  },
  "cookbookRecipes": [
    {
      "version": 1,
      "settings": {
        "instance": "lesson",
        "recipeId": "quest-scene-hints",
        "choices": {
          "workshop": {
            "existing": "",
            "name": "Rescue Workshop",
            "description": "Take the brass key and use the lever. HINT gives increasingly direct advice. The cage room is east. Read the record for an optional clue. The abort switch abandons the mission."
          },
          "cage_room": {
            "existing": "",
            "name": "Cage Room",
            "description": "Use the route console to choose ridge or tunnel. Carry the key and restore power, then USE CAGE. TALK PRISONER to escort them. The ridge leads north; the tunnel leads east. The workshop is west."
          },
          "yard": {
            "existing": "",
            "name": "Safe Yard",
            "description": "The rescue ends here when the living prisoner arrives."
          },
          "key": {
            "existing": "",
            "name": "brass key",
            "description": "A key for the cage."
          },
          "lever": {
            "existing": "",
            "name": "lever",
            "description": "Use to restore power and start the alarm."
          },
          "record": {
            "existing": "",
            "name": "record",
            "description": "Read for an optional safety clue."
          },
          "abort": {
            "existing": "",
            "name": "abort switch",
            "description": "Use to abandon the mission."
          },
          "cage": {
            "existing": "",
            "name": "cage",
            "description": "Needs the carried key and restored power."
          },
          "console": {
            "existing": "",
            "name": "route console",
            "description": "Choose one permanent approach."
          },
          "prisoner": {
            "existing": "",
            "name": "prisoner",
            "description": "Free them, then talk to begin the escort."
          }
        },
        "values": {
          "power": "The power returns. The rescue alarm begins.",
          "release": "The cage opens. Talk to the prisoner to lead them to safety.",
          "entry": "The red rescue alarm lights up.",
          "turn": "The alarm hums while the rescue is underway.",
          "cleanup": "The alarm goes silent. The prisoner is safe."
        },
        "reuseRoutes": {}
      },
      "owned": [
        {
          "path": "files",
          "key": "rooms/lesson_workshop.taml",
          "after": {
            "path": "rooms/lesson_workshop.taml",
            "name": "lesson_workshop.taml",
            "content": "room lesson_workshop\n  exit east: lesson_cage_room\n  name: \"Rescue Workshop\"\n  description: \"Take the brass key and use the lever. HINT gives increasingly direct advice. The cage room is east. Read the record for an optional clue. The abort switch abandons the mission.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "rooms/lesson_cage_room.taml",
          "after": {
            "path": "rooms/lesson_cage_room.taml",
            "name": "lesson_cage_room.taml",
            "content": "room lesson_cage_room\n  blocked east: \"Choose the tunnel approach first.\"\n  exit east: lesson_yard when: lesson_tunnel_open\n  blocked north: \"Choose the ridge approach first.\"\n  exit north: lesson_yard when: lesson_ridge_open\n  exit west: lesson_workshop\n  name: \"Cage Room\"\n  description: \"Use the route console to choose ridge or tunnel. Carry the key and restore power, then USE CAGE. TALK PRISONER to escort them. The ridge leads north; the tunnel leads east. The workshop is west.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "rooms/lesson_yard.taml",
          "after": {
            "path": "rooms/lesson_yard.taml",
            "name": "lesson_yard.taml",
            "content": "room lesson_yard\n  name: \"Safe Yard\"\n  description: \"The rescue ends here when the living prisoner arrives.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_key.taml",
          "after": {
            "path": "objects/lesson_key.taml",
            "name": "lesson_key.taml",
            "content": "object lesson_key\n  name: \"brass key\"\n  description: \"A key for the cage.\"\n  location: lesson_workshop\n  takeable: true\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_lever.taml",
          "after": {
            "path": "objects/lesson_lever.taml",
            "name": "lesson_lever.taml",
            "content": "object lesson_lever\n  name: \"lever\"\n  description: \"Use to restore power and start the alarm.\"\n  location: lesson_workshop\n  droppable: false\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_record.taml",
          "after": {
            "path": "objects/lesson_record.taml",
            "name": "lesson_record.taml",
            "content": "object lesson_record\n  name: \"record\"\n  description: \"Read for an optional safety clue.\"\n  location: lesson_workshop\n  droppable: false\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_abort.taml",
          "after": {
            "path": "objects/lesson_abort.taml",
            "name": "lesson_abort.taml",
            "content": "object lesson_abort\n  name: \"abort switch\"\n  description: \"Use to abandon the mission.\"\n  location: lesson_workshop\n  droppable: false\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_cage.taml",
          "after": {
            "path": "objects/lesson_cage.taml",
            "name": "lesson_cage.taml",
            "content": "object lesson_cage\n  name: \"cage\"\n  description: \"Needs the carried key and restored power.\"\n  location: lesson_cage_room\n  droppable: false\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_console.taml",
          "after": {
            "path": "objects/lesson_console.taml",
            "name": "lesson_console.taml",
            "content": "object lesson_console\n  name: \"route console\"\n  description: \"Choose one permanent approach.\"\n  location: lesson_cage_room\n  droppable: false\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "npcs/lesson_prisoner.taml",
          "after": {
            "path": "npcs/lesson_prisoner.taml",
            "name": "lesson_prisoner.taml",
            "content": "npc lesson_prisoner\n  name: \"prisoner\"\n  description: \"Free them, then talk to begin the escort.\"\n  location: lesson_cage_room\n  mobile: true\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_key",
          "after": {
            "id": "lesson_key",
            "name": "brass key",
            "description": "A key for the cage.",
            "article": "",
            "location": "lesson_workshop",
            "aliases": [],
            "visible": true,
            "takeable": true,
            "droppable": true,
            "useGive": true,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": []
          }
        },
        {
          "path": "objects",
          "key": "lesson_lever",
          "after": {
            "id": "lesson_lever",
            "name": "lever",
            "description": "Use to restore power and start the alarm.",
            "article": "",
            "location": "lesson_workshop",
            "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": []
          }
        },
        {
          "path": "objects",
          "key": "lesson_record",
          "after": {
            "id": "lesson_record",
            "name": "record",
            "description": "Read for an optional safety clue.",
            "article": "",
            "location": "lesson_workshop",
            "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": []
          }
        },
        {
          "path": "objects",
          "key": "lesson_abort",
          "after": {
            "id": "lesson_abort",
            "name": "abort switch",
            "description": "Use to abandon the mission.",
            "article": "",
            "location": "lesson_workshop",
            "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": []
          }
        },
        {
          "path": "objects",
          "key": "lesson_cage",
          "after": {
            "id": "lesson_cage",
            "name": "cage",
            "description": "Needs the carried key and restored power.",
            "article": "",
            "location": "lesson_cage_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": []
          }
        },
        {
          "path": "objects",
          "key": "lesson_console",
          "after": {
            "id": "lesson_console",
            "name": "route console",
            "description": "Choose one permanent approach.",
            "article": "",
            "location": "lesson_cage_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": []
          }
        },
        {
          "path": "npcs",
          "key": "lesson_prisoner",
          "after": {
            "id": "lesson_prisoner",
            "name": "prisoner",
            "description": "Free them, then talk to begin the escort.",
            "location": "lesson_cage_room",
            "mobile": true,
            "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_workshop",
          "after": {
            "id": "lesson_workshop",
            "name": "Rescue Workshop",
            "description": "Take the brass key and use the lever. HINT gives increasingly direct advice. The cage room is east. Read the record for an optional clue. The abort switch abandons the mission.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "",
            "dark": false,
            "roomType": "regular",
            "x": 100,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_cage_room",
          "after": {
            "id": "lesson_cage_room",
            "name": "Cage Room",
            "description": "Use the route console to choose ridge or tunnel. Carry the key and restore power, then USE CAGE. TALK PRISONER to escort them. The ridge leads north; the tunnel leads east. The workshop is west.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "",
            "dark": false,
            "roomType": "regular",
            "x": 320,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {
              "north": "Choose the ridge approach first.",
              "east": "Choose the tunnel approach first."
            }
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_yard",
          "after": {
            "id": "lesson_yard",
            "name": "Safe Yard",
            "description": "The rescue ends here when the living prisoner arrives.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "",
            "dark": false,
            "roomType": "regular",
            "x": 540,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000"
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_east",
          "after": {
            "id": "lesson_route_east",
            "fromRoom": "lesson_workshop",
            "toRoom": "lesson_cage_room",
            "direction": "east",
            "locked": false
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_west",
          "after": {
            "id": "lesson_route_west",
            "fromRoom": "lesson_cage_room",
            "toRoom": "lesson_workshop",
            "direction": "west",
            "locked": false
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_ridge",
          "after": {
            "id": "lesson_route_ridge",
            "fromRoom": "lesson_cage_room",
            "toRoom": "lesson_yard",
            "direction": "north",
            "locked": false,
            "when": "lesson_ridge_open"
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_tunnel",
          "after": {
            "id": "lesson_route_tunnel",
            "fromRoom": "lesson_cage_room",
            "toRoom": "lesson_yard",
            "direction": "east",
            "locked": false,
            "when": "lesson_tunnel_open"
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_power",
          "after": {
            "id": "lesson_power",
            "name": "power",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_freed",
          "after": {
            "id": "lesson_freed",
            "name": "freed",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_clue",
          "after": {
            "id": "lesson_clue",
            "name": "clue",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_abort",
          "after": {
            "id": "lesson_abort",
            "name": "abort",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_done",
          "after": {
            "id": "lesson_done",
            "name": "done",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_alarm",
          "after": {
            "id": "lesson_alarm",
            "name": "alarm",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_scene_cleaned",
          "after": {
            "id": "lesson_scene_cleaned",
            "name": "scene cleaned",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_ridge_open",
          "after": {
            "id": "lesson_ridge_open",
            "name": "ridge open",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_tunnel_open",
          "after": {
            "id": "lesson_tunnel_open",
            "name": "tunnel open",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_approach",
          "after": {
            "id": "lesson_approach",
            "name": "approach",
            "description": "Progress remembered by this recipe.",
            "type": "string",
            "initial": ""
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_power",
          "after": {
            "id": "lesson_power",
            "name": "power",
            "enabled": true,
            "trigger": {
              "kind": "object",
              "target": "lesson_lever",
              "event": "use"
            },
            "match": "all",
            "conditions": [],
            "actions": [
              {
                "kind": "state",
                "target": "lesson_power",
                "value": true
              },
              {
                "kind": "message",
                "value": "The power returns. The rescue alarm begins."
              }
            ],
            "otherwise": "",
            "once": true,
            "repeatText": "The power is already restored."
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_read",
          "after": {
            "id": "lesson_read",
            "name": "read",
            "enabled": true,
            "trigger": {
              "kind": "object",
              "target": "lesson_record",
              "event": "custom:read"
            },
            "match": "all",
            "conditions": [],
            "actions": [
              {
                "kind": "state",
                "target": "lesson_clue",
                "value": true
              },
              {
                "kind": "message",
                "value": "The record shows the safest handover procedure."
              }
            ],
            "otherwise": "",
            "once": true
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_abort",
          "after": {
            "id": "lesson_abort",
            "name": "abort",
            "enabled": true,
            "trigger": {
              "kind": "object",
              "target": "lesson_abort",
              "event": "use"
            },
            "match": "all",
            "conditions": [],
            "actions": [
              {
                "kind": "state",
                "target": "lesson_abort",
                "value": true
              }
            ],
            "otherwise": "",
            "once": false
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_open_cage",
          "after": {
            "id": "lesson_open_cage",
            "name": "open cage",
            "enabled": true,
            "trigger": {
              "kind": "object",
              "target": "lesson_cage",
              "event": "use"
            },
            "match": "all",
            "conditions": [
              {
                "kind": "state",
                "target": "lesson_power",
                "operator": "==",
                "value": true
              },
              {
                "kind": "inventory",
                "target": "lesson_key",
                "operator": "==",
                "value": true
              }
            ],
            "actions": [
              {
                "kind": "state",
                "target": "lesson_freed",
                "value": true
              },
              {
                "kind": "message",
                "value": "The cage opens. Talk to the prisoner to lead them to safety."
              }
            ],
            "otherwise": "Restore power and carry the brass key first.",
            "once": true,
            "repeatText": "The cage is already open."
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_escort",
          "after": {
            "id": "lesson_escort",
            "name": "escort",
            "enabled": true,
            "trigger": {
              "kind": "npc",
              "target": "lesson_prisoner",
              "event": "talk"
            },
            "match": "all",
            "conditions": [
              {
                "kind": "state",
                "target": "lesson_freed",
                "operator": "==",
                "value": true
              }
            ],
            "actions": [
              {
                "kind": "npc_control",
                "target": "lesson_prisoner",
                "operation": "recruit"
              },
              {
                "kind": "message",
                "value": "The prisoner follows you. Take your chosen route to the safe yard."
              }
            ],
            "otherwise": "Open the cage before beginning the escort.",
            "once": false
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_choose",
          "after": {
            "id": "lesson_choose",
            "name": "choose",
            "enabled": true,
            "trigger": {
              "kind": "object",
              "target": "lesson_console",
              "event": "use"
            },
            "match": "all",
            "conditions": [
              {
                "kind": "state",
                "target": "lesson_approach",
                "operator": "==",
                "value": ""
              }
            ],
            "actions": [
              {
                "kind": "prompt",
                "target": "lesson_approach_prompt"
              }
            ],
            "otherwise": "Your approach is already chosen.",
            "once": false
          }
        },
        {
          "path": "manifest.story.features.npcProfiles",
          "key": "lesson_prisoner_profile",
          "after": {
            "version": 1,
            "id": "lesson_prisoner_profile",
            "name": "prisoner abilities",
            "npcId": "lesson_prisoner",
            "enabled": true,
            "memory": [],
            "traits": {
              "loyalty": 50,
              "fear": 0,
              "suspicion": 0
            },
            "life": {
              "maxHealth": 100,
              "initial": "active",
              "essential": false,
              "defeat": "dead",
              "retreatAtHealth": 0
            },
            "inventory": {
              "objects": [],
              "equipped": [],
              "equipment": [],
              "money": 0,
              "dropOnDeath": false
            },
            "combat": {
              "assist": "off",
              "target": "first_enemy",
              "interceptPercent": 50,
              "interval": 1
            },
            "perception": {
              "enabled": false,
              "sightRange": 0,
              "hearingRange": 0,
              "suspicionPerSight": 10,
              "suspicionPerNoise": 10,
              "threshold": 50,
              "investigate": false,
              "returnHome": false,
              "allowedRoomIds": []
            },
            "abilities": []
          }
        },
        {
          "path": "manifest.story.features.prompts",
          "key": "lesson_approach_prompt",
          "after": {
            "id": "lesson_approach_prompt",
            "name": "Which approach will you use?",
            "enabled": true,
            "text": "Which approach will you use?",
            "cancelLabel": "Leave the choice for later",
            "cancelable": true,
            "owner": {
              "kind": "object",
              "id": "lesson_console"
            },
            "options": [
              {
                "id": "ridge",
                "label": "Ridge",
                "match": "all",
                "conditions": [],
                "actions": [
                  {
                    "kind": "state",
                    "target": "lesson_approach",
                    "value": "ridge"
                  },
                  {
                    "kind": "state",
                    "target": "lesson_ridge_open",
                    "value": true
                  }
                ],
                "once": false,
                "unavailable": "disable"
              },
              {
                "id": "tunnel",
                "label": "Tunnel",
                "match": "all",
                "conditions": [],
                "actions": [
                  {
                    "kind": "state",
                    "target": "lesson_approach",
                    "value": "tunnel"
                  },
                  {
                    "kind": "state",
                    "target": "lesson_tunnel_open",
                    "value": true
                  }
                ],
                "once": false,
                "unavailable": "disable"
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.quests",
          "key": "lesson_rescue",
          "after": {
            "id": "lesson_rescue",
            "name": "Rescue the prisoner",
            "enabled": true,
            "description": "Carry the key, restore power, select a route and escort the living prisoner.",
            "stages": [
              {
                "id": "lesson_key_stage",
                "name": "Carry the brass key",
                "description": "Carry the brass key",
                "prerequisites": [],
                "optional": false,
                "automatic": true,
                "conditions": [
                  {
                    "kind": "inventory",
                    "target": "lesson_key",
                    "operator": "==",
                    "value": true
                  }
                ],
                "match": "all",
                "completionText": "Carry the brass key completed.",
                "actions": []
              },
              {
                "id": "lesson_power_stage",
                "name": "Restore power",
                "description": "Restore power",
                "prerequisites": [
                  "lesson_key_stage"
                ],
                "optional": false,
                "automatic": true,
                "conditions": [
                  {
                    "kind": "state",
                    "target": "lesson_power",
                    "operator": "==",
                    "value": true
                  }
                ],
                "match": "all",
                "completionText": "Restore power completed.",
                "actions": []
              },
              {
                "id": "lesson_ridge",
                "name": "Choose the ridge",
                "description": "Choose the ridge",
                "prerequisites": [
                  "lesson_power_stage"
                ],
                "optional": false,
                "automatic": true,
                "conditions": [
                  {
                    "kind": "state",
                    "target": "lesson_approach",
                    "operator": "==",
                    "value": "ridge"
                  }
                ],
                "match": "all",
                "completionText": "Choose the ridge completed.",
                "actions": [],
                "exclusiveGroup": "lesson_approach_group"
              },
              {
                "id": "lesson_tunnel",
                "name": "Choose the tunnel",
                "description": "Choose the tunnel",
                "prerequisites": [
                  "lesson_power_stage"
                ],
                "optional": false,
                "automatic": true,
                "conditions": [
                  {
                    "kind": "state",
                    "target": "lesson_approach",
                    "operator": "==",
                    "value": "tunnel"
                  }
                ],
                "match": "all",
                "completionText": "Choose the tunnel completed.",
                "actions": [],
                "exclusiveGroup": "lesson_approach_group"
              },
              {
                "id": "lesson_clue_stage",
                "name": "Read the optional record",
                "description": "Read the optional record",
                "prerequisites": [],
                "optional": true,
                "automatic": true,
                "conditions": [
                  {
                    "kind": "state",
                    "target": "lesson_clue",
                    "operator": "==",
                    "value": true
                  }
                ],
                "match": "all",
                "completionText": "Read the optional record completed.",
                "actions": []
              },
              {
                "id": "lesson_safe",
                "name": "Escort the living prisoner",
                "description": "Escort the living prisoner",
                "prerequisites": [
                  "lesson_power_stage"
                ],
                "optional": false,
                "automatic": true,
                "conditions": [
                  {
                    "kind": "state",
                    "target": "lesson_freed",
                    "operator": "==",
                    "value": true
                  },
                  {
                    "kind": "room",
                    "target": "lesson_yard",
                    "operator": "==",
                    "value": true
                  },
                  {
                    "kind": "npc_available",
                    "target": "lesson_prisoner",
                    "operator": "==",
                    "value": true
                  },
                  {
                    "kind": "npc_health",
                    "target": "lesson_prisoner",
                    "operator": ">",
                    "value": 0
                  }
                ],
                "match": "all",
                "completionText": "Escort the living prisoner completed.",
                "actions": []
              }
            ],
            "completionText": "The rescue is complete.",
            "completionActions": [
              {
                "kind": "score",
                "value": 100
              }
            ],
            "failureConditions": [
              {
                "kind": "state",
                "target": "lesson_abort",
                "operator": "==",
                "value": true
              }
            ],
            "failureMatch": "all",
            "failureText": "The rescue has been abandoned.",
            "failureActions": []
          }
        },
        {
          "path": "manifest.story.features.scenes",
          "key": "lesson_alarm_scene",
          "after": {
            "id": "lesson_alarm_scene",
            "name": "Rescue alarm",
            "enabled": true,
            "automatic": true,
            "priority": 1,
            "recurring": false,
            "roomIds": [
              "lesson_workshop",
              "lesson_cage_room",
              "lesson_yard"
            ],
            "startConditions": [
              {
                "kind": "state",
                "target": "lesson_power",
                "operator": "==",
                "value": true
              },
              {
                "kind": "state",
                "target": "lesson_freed",
                "operator": "==",
                "value": false
              }
            ],
            "startMatch": "all",
            "endConditions": [
              {
                "kind": "room",
                "target": "lesson_yard",
                "operator": "==",
                "value": true
              },
              {
                "kind": "npc_available",
                "target": "lesson_prisoner",
                "operator": "==",
                "value": true
              },
              {
                "kind": "npc_health",
                "target": "lesson_prisoner",
                "operator": ">",
                "value": 0
              }
            ],
            "endMatch": "all",
            "entryActions": [
              {
                "kind": "state",
                "target": "lesson_alarm",
                "value": true
              },
              {
                "kind": "message",
                "value": "The red rescue alarm lights up."
              }
            ],
            "activeActions": [
              {
                "kind": "message",
                "value": "The alarm hums while the rescue is underway."
              }
            ],
            "exitActions": [
              {
                "kind": "state",
                "target": "lesson_alarm",
                "value": false
              },
              {
                "kind": "state",
                "target": "lesson_scene_cleaned",
                "value": true
              },
              {
                "kind": "message",
                "value": "The alarm goes silent. The prisoner is safe."
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.hints",
          "key": "lesson_rescue_hint",
          "after": {
            "id": "lesson_rescue_hint",
            "name": "Rescue help",
            "enabled": true,
            "scope": {
              "kind": "puzzle",
              "target": "lesson_rescue_puzzle"
            },
            "priority": 1,
            "conditions": [],
            "match": "all",
            "completedConditions": [
              {
                "kind": "quest_status",
                "target": "lesson_rescue",
                "operator": "==",
                "value": "completed"
              }
            ],
            "completedMatch": "all",
            "completedText": "The prisoner has reached safety.",
            "progressStateId": "lesson_power",
            "levels": [
              {
                "level": "gentle",
                "text": "The cage needs both a key and power.",
                "conditions": [],
                "match": "all"
              },
              {
                "level": "strong",
                "text": "The workshop has the key and the power lever.",
                "conditions": [],
                "match": "all"
              },
              {
                "level": "solution",
                "text": "TAKE BRASS KEY, USE LEVER, EAST, USE ROUTE CONSOLE, choose 1 or 2, USE CAGE, TALK PRISONER, then NORTH for ridge or EAST for tunnel.",
                "conditions": [],
                "match": "all"
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.endings",
          "key": "lesson_failure",
          "after": {
            "id": "lesson_failure",
            "name": "Abandoned rescue",
            "enabled": true,
            "automatic": true,
            "priority": 100,
            "conditions": [
              {
                "kind": "state",
                "target": "lesson_abort",
                "operator": "==",
                "value": true
              }
            ],
            "match": "all",
            "text": "You leave the rescue unfinished.",
            "actions": []
          }
        },
        {
          "path": "manifest.story.features.endings",
          "key": "lesson_best",
          "after": {
            "id": "lesson_best",
            "name": "Prepared rescue",
            "enabled": true,
            "automatic": true,
            "priority": 80,
            "conditions": [
              {
                "kind": "quest_status",
                "target": "lesson_rescue",
                "operator": "==",
                "value": "completed"
              },
              {
                "kind": "state",
                "target": "lesson_clue",
                "operator": "==",
                "value": true
              },
              {
                "kind": "state",
                "target": "lesson_scene_cleaned",
                "operator": "==",
                "value": true
              },
              {
                "kind": "room",
                "target": "lesson_yard",
                "operator": "==",
                "value": true
              }
            ],
            "match": "all",
            "text": "The prepared rescue brings everyone safely home.",
            "actions": [
              {
                "kind": "state",
                "target": "lesson_done",
                "value": true
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.endings",
          "key": "lesson_ordinary",
          "after": {
            "id": "lesson_ordinary",
            "name": "Safe rescue",
            "enabled": true,
            "automatic": true,
            "priority": 40,
            "conditions": [
              {
                "kind": "quest_status",
                "target": "lesson_rescue",
                "operator": "==",
                "value": "completed"
              },
              {
                "kind": "state",
                "target": "lesson_scene_cleaned",
                "operator": "==",
                "value": true
              },
              {
                "kind": "room",
                "target": "lesson_yard",
                "operator": "==",
                "value": true
              }
            ],
            "match": "all",
            "text": "The prisoner is safe. The rescue is complete.",
            "actions": [
              {
                "kind": "state",
                "target": "lesson_done",
                "value": true
              }
            ]
          }
        }
      ]
    }
  ],
  "creatorNotes": "Restore power, unlock a cage and escort a living prisoner to the yard. Choose a permanent approach, follow a three-step hint ladder, and watch an alarm scene start and stop. An optional clue changes the ending; an abort switch demonstrates failure. Open this recipe in Help to inspect its saved settings.",
  "mapRooms": [
    {
      "id": "lesson_workshop",
      "name": "Rescue Workshop",
      "description": "Take the brass key and use the lever. HINT gives increasingly direct advice. The cage room is east. Read the record for an optional clue. The abort switch abandons the mission.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "",
      "dark": false,
      "roomType": "regular",
      "x": 100,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    },
    {
      "id": "lesson_cage_room",
      "name": "Cage Room",
      "description": "Use the route console to choose ridge or tunnel. Carry the key and restore power, then USE CAGE. TALK PRISONER to escort them. The ridge leads north; the tunnel leads east. The workshop is west.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "",
      "dark": false,
      "roomType": "regular",
      "x": 320,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {
        "north": "Choose the ridge approach first.",
        "east": "Choose the tunnel approach first."
      }
    },
    {
      "id": "lesson_yard",
      "name": "Safe Yard",
      "description": "The rescue ends here when the living prisoner arrives.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "",
      "dark": false,
      "roomType": "regular",
      "x": 540,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000"
    }
  ],
  "mapExits": [
    {
      "id": "lesson_route_east",
      "fromRoom": "lesson_workshop",
      "toRoom": "lesson_cage_room",
      "direction": "east",
      "locked": false
    },
    {
      "id": "lesson_route_west",
      "fromRoom": "lesson_cage_room",
      "toRoom": "lesson_workshop",
      "direction": "west",
      "locked": false
    },
    {
      "id": "lesson_route_ridge",
      "fromRoom": "lesson_cage_room",
      "toRoom": "lesson_yard",
      "direction": "north",
      "locked": false,
      "when": "lesson_ridge_open"
    },
    {
      "id": "lesson_route_tunnel",
      "fromRoom": "lesson_cage_room",
      "toRoom": "lesson_yard",
      "direction": "east",
      "locked": false,
      "when": "lesson_tunnel_open"
    }
  ],
  "objects": [
    {
      "id": "lesson_key",
      "name": "brass key",
      "description": "A key for the cage.",
      "article": "",
      "location": "lesson_workshop",
      "aliases": [],
      "visible": true,
      "takeable": true,
      "droppable": true,
      "useGive": true,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": []
    },
    {
      "id": "lesson_lever",
      "name": "lever",
      "description": "Use to restore power and start the alarm.",
      "article": "",
      "location": "lesson_workshop",
      "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": []
    },
    {
      "id": "lesson_record",
      "name": "record",
      "description": "Read for an optional safety clue.",
      "article": "",
      "location": "lesson_workshop",
      "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": []
    },
    {
      "id": "lesson_abort",
      "name": "abort switch",
      "description": "Use to abandon the mission.",
      "article": "",
      "location": "lesson_workshop",
      "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": []
    },
    {
      "id": "lesson_cage",
      "name": "cage",
      "description": "Needs the carried key and restored power.",
      "article": "",
      "location": "lesson_cage_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": []
    },
    {
      "id": "lesson_console",
      "name": "route console",
      "description": "Choose one permanent approach.",
      "article": "",
      "location": "lesson_cage_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": []
    }
  ],
  "npcs": [
    {
      "id": "lesson_prisoner",
      "name": "prisoner",
      "description": "Free them, then talk to begin the escort.",
      "location": "lesson_cage_room",
      "mobile": true,
      "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": [
    "npc-capabilities-v1",
    "story-rules-v1",
    "creator-features-v1"
  ]
}
