{
  "version": "1.1",
  "name": "Mechanics: Repair, Fuel & Power",
  "startRoom": "lesson_quay",
  "author": "TAGMaker",
  "description": "Repair and fuel a generator, turn it on and use the powered lift to collect a lens. Return safely and deliver the lens to the keeper. Fuel runs down only while the machine is on; the return lever always works.",
  "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_quay.taml",
      "content": "room lesson_quay\n  exit north: lesson_powerhouse\n  name: \"Lighthouse Quay\"\n  narrative: \"The keeper needs a signal lens from the lighthouse gallery. A safe workshop waits NORTH. TAKE WORKER JACKET and WEAR WORKER JACKET if you want the harmless watchman to ignore you. Repair and fuel the generator, use the powered lift, then bring the lens back here. OBJECTIVES and HINT explain the route. This workshop has no hostile enemies.\"\n  description: \"A worker jacket hangs beside the keeper. The powerhouse is north.\"\n  hint: \"TAKE WORKER JACKET, WEAR WORKER JACKET, then go NORTH and READ BRIEFING.\"\n  dark: false\nend"
    },
    {
      "path": "rooms/lesson_powerhouse.taml",
      "content": "room lesson_powerhouse\n  exit up: lesson_gallery when: mp_lesson_lighthouse_generator_powered\n  exit south: lesson_quay\n  name: \"Lighthouse Powerhouse\"\n  description: \"The generator, safety gate and lift control share one circuit. A brass fuse, fuel can, windup toy and briefing are within reach. The quay is south.\"\n  hint: \"TAKE BRASS FUSE and TAKE FUEL CAN. USE BRASS FUSE WITH GENERATOR, then USE FUEL CAN WITH GENERATOR. USE GENERATOR starts it. USE LIFT CONTROL goes upstairs while power lasts.\"\n  dark: false\nend"
    },
    {
      "path": "rooms/lesson_gallery.taml",
      "content": "room lesson_gallery\n  exit down: lesson_powerhouse\n  name: \"Upper Signal Gallery\"\n  description: \"The spare signal lens rests beside an emergency return lever. The return is mechanical and always works.\"\n  hint: \"TAKE SIGNAL LENS, then USE RETURN LEVER. You can also go DOWN. Switch off the generator to save fuel, go SOUTH, and GIVE SIGNAL LENS TO KEEPER.\"\n  dark: false\nend"
    },
    {
      "path": "objects/lesson_worker_jacket.taml",
      "content": "object lesson_worker_jacket\n  name: \"worker jacket\"\n  description: \"A lighthouse worker jacket. WEAR WORKER JACKET to keep the harmless watchman from identifying you as an unfamiliar visitor.\"\n  location: lesson_quay\n  aliases: [\"jacket\", \"coat\", \"worker jacket\"]\n  takeable: true\n  wearable: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_brass_fuse.taml",
      "content": "object lesson_brass_fuse\n  name: \"brass fuse\"\n  description: \"A replacement brass fuse. Carry it, then USE BRASS FUSE WITH GENERATOR.\"\n  location: lesson_powerhouse\n  aliases: [\"fuse\", \"brass fuse\"]\n  takeable: true\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_fuel_can.taml",
      "content": "object lesson_fuel_can\n  name: \"fuel can\"\n  description: \"One measured can of fuel provides eight operating turns. Carry it, then USE FUEL CAN WITH GENERATOR after repairing the generator.\"\n  location: lesson_powerhouse\n  aliases: [\"fuel\", \"can\", \"fuel can\"]\n  takeable: true\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_generator.taml",
      "content": "object lesson_generator\n  name: \"generator\"\n  description: \"A compact backup generator with an empty fuse holder and fuel tank. Repair it, refuel it, and USE GENERATOR to switch it on or off.\"\n  location: lesson_powerhouse\n  aliases: [\"machine\", \"generator\"]\n  droppable: false\n  use_give: true\n  switchable: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_safety_gate.taml",
      "content": "object lesson_safety_gate\n  name: \"safety gate\"\n  description: \"An electrical latch unlocks while the generator is powered. The lift control uses the same power state.\"\n  location: lesson_powerhouse\n  aliases: [\"gate\", \"safety gate\"]\n  droppable: false\n  locked: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_lift_control.taml",
      "content": "object lesson_lift_control\n  name: \"lift control\"\n  description: \"USE LIFT CONTROL to reach the upper gallery while the generator is powered.\"\n  location: lesson_powerhouse\n  aliases: [\"lift\", \"elevator\", \"lift control\"]\n  droppable: false\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_return_lever.taml",
      "content": "object lesson_return_lever\n  name: \"return lever\"\n  description: \"An emergency mechanical return. USE RETURN LEVER to return to the powerhouse even if generator power has failed.\"\n  location: lesson_gallery\n  aliases: [\"lever\", \"return control\", \"return lever\"]\n  droppable: false\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_signal_lens.taml",
      "content": "object lesson_signal_lens\n  name: \"signal lens\"\n  description: \"The spare signal lens requested by the keeper. Bring it back to the quay and give it to the keeper.\"\n  location: lesson_gallery\n  aliases: [\"lens\", \"signal lens\"]\n  takeable: true\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_windup_toy.taml",
      "content": "object lesson_windup_toy\n  name: \"windup toy\"\n  description: \"A harmless windup distraction. Carry it and USE WINDUP TOY at the powerhouse to reduce suspicion. The toy is consumed when used.\"\n  location: lesson_powerhouse\n  aliases: [\"toy\", \"distraction\", \"windup toy\"]\n  takeable: true\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_briefing.taml",
      "content": "object lesson_briefing\n  name: \"briefing\"\n  description: \"LIGHTHOUSE POWER WORKSHOP: Take and wear the worker jacket at the quay if you want the watchman to ignore you. At the powerhouse TAKE BRASS FUSE and TAKE FUEL CAN. USE BRASS FUSE WITH GENERATOR repairs it. USE FUEL CAN WITH GENERATOR adds eight operating turns of fuel. USE GENERATOR switches it on; USE LIFT CONTROL takes you upstairs while power is on. TAKE SIGNAL LENS, USE RETURN LEVER, and USE GENERATOR to switch the generator off and save fuel. Go SOUTH and GIVE SIGNAL LENS TO KEEPER. The machine consumes fuel only while running and automatically stops at zero. The emergency return lever always works, so power loss cannot trap you upstairs. OBJECTIVES, HINT and the Mechanics status panel explain progress. This is a safe workshop: the watchman raises an alarm state but never attacks.\"\n  location: lesson_powerhouse\n  aliases: [\"instructions\", \"note\", \"briefing\"]\n  droppable: false\n  weight: 0.1\n  on read:\n    print \"LIGHTHOUSE POWER WORKSHOP: Take and wear the worker jacket at the quay if you want the watchman to ignore you. At the powerhouse TAKE BRASS FUSE and TAKE FUEL CAN. USE BRASS FUSE WITH GENERATOR repairs it. USE FUEL CAN WITH GENERATOR adds eight operating turns of fuel. USE GENERATOR switches it on; USE LIFT CONTROL takes you upstairs while power is on. TAKE SIGNAL LENS, USE RETURN LEVER, and USE GENERATOR to switch the generator off and save fuel. Go SOUTH and GIVE SIGNAL LENS TO KEEPER. The machine consumes fuel only while running and automatically stops at zero. The emergency return lever always works, so power loss cannot trap you upstairs. OBJECTIVES, HINT and the Mechanics status panel explain progress. This is a safe workshop: the watchman raises an alarm state but never attacks.\"\n  end\nend"
    },
    {
      "path": "npcs/lesson_keeper.taml",
      "content": "npc lesson_keeper\n  name: \"keeper\"\n  description: \"The lighthouse keeper needs the signal lens from the upper gallery.\"\n  location: lesson_quay\n  mobile: false\n  follow: false\n  aliases: [\"lighthouse keeper\", \"keeper\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  dialogue default:\n    print \"keeper looks at you in silence.\"\n  end\n  on talk:\n    print \"Please repair and fuel the generator, retrieve the signal lens upstairs, then bring it back to me. The emergency return always works.\"\n  end\nend"
    },
    {
      "path": "npcs/lesson_watchman.taml",
      "content": "npc lesson_watchman\n  name: \"watchman\"\n  description: \"A harmless watchman notices unfamiliar visitors when the generator makes noise. The worker jacket is a recognizable disguise.\"\n  location: lesson_powerhouse\n  mobile: false\n  follow: false\n  aliases: [\"guard\", \"watchman\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  dialogue default:\n    print \"watchman looks at you in silence.\"\n  end\n  on talk:\n    print \"Wear your worker jacket around operating equipment. I only raise an alarm; this workshop has no combat.\"\n  end\nend"
    }
  ],
  "playerConfig": {
    "moneyEnabled": true,
    "startingMoney": 0
  },
  "story": {
    "version": 1,
    "states": [
      {
        "id": "mp_lesson_lighthouse_generator_repaired",
        "name": "Lighthouse backup generator (lesson_lighthouse_generator) — Repaired",
        "description": "Owned native dependency of this editable mechanic.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "mp_lesson_lighthouse_generator_powered",
        "name": "Lighthouse backup generator (lesson_lighthouse_generator) — Powered",
        "description": "Owned native dependency of this editable mechanic.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "mp_lesson_lighthouse_noise_alerted",
        "name": "Generator noise and harmless watchman (lesson_lighthouse_noise) — Alarm active",
        "description": "Owned native dependency of this editable mechanic.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_workshop_complete",
        "name": "Workshop complete",
        "description": "The workshop reached its completion.",
        "type": "boolean",
        "initial": false
      }
    ],
    "rules": [],
    "features": {
      "version": 1,
      "commandContext": true,
      "recipes": [
        {
          "id": "lesson_deliver_signal_lens",
          "name": "Accepted signal-lens delivery",
          "enabled": true,
          "verbs": [
            "give"
          ],
          "unordered": false,
          "inputs": [
            {
              "objectId": "lesson_signal_lens",
              "disposition": "transfer"
            }
          ],
          "tools": [],
          "target": {
            "kind": "npc",
            "id": "lesson_keeper"
          },
          "roomId": "lesson_quay",
          "match": "all",
          "conditions": [],
          "actions": [],
          "once": true,
          "success": "The keeper accepts the signal lens and records the completed service.",
          "failure": "Carry the signal lens back to the quay and give it to the keeper.",
          "repeat": "The keeper has already accepted the lens."
        },
        {
          "id": "mp_lesson_lighthouse_generator_repair",
          "name": "Lighthouse backup generator — Install the repair fuse",
          "enabled": true,
          "mechanicId": "lesson_lighthouse_generator",
          "verbs": [
            "use"
          ],
          "unordered": false,
          "inputs": [
            {
              "objectId": "lesson_brass_fuse",
              "disposition": "consume"
            }
          ],
          "tools": [],
          "target": {
            "kind": "object",
            "id": "lesson_generator"
          },
          "match": "all",
          "conditions": [],
          "actions": [
            {
              "kind": "state",
              "target": "mp_lesson_lighthouse_generator_repaired",
              "value": true
            }
          ],
          "once": true,
          "success": "The fuse seats with a firm click. The machine is repaired.",
          "failure": "Carry the required item and tools, and use them with the selected target.",
          "repeat": "That interaction is already complete."
        },
        {
          "id": "mp_lesson_lighthouse_generator_refuel",
          "name": "Lighthouse backup generator — Refuel the machine",
          "enabled": true,
          "mechanicId": "lesson_lighthouse_generator",
          "verbs": [
            "use"
          ],
          "unordered": false,
          "inputs": [
            {
              "objectId": "lesson_fuel_can",
              "disposition": "consume"
            }
          ],
          "tools": [],
          "target": {
            "kind": "object",
            "id": "lesson_generator"
          },
          "match": "all",
          "conditions": [
            {
              "kind": "state",
              "target": "mp_lesson_lighthouse_generator_repaired",
              "operator": "==",
              "value": true
            }
          ],
          "actions": [],
          "once": false,
          "success": "You pour the fuel into the repaired machine.",
          "failure": "Carry the required item and tools, and use them with the selected target.",
          "repeat": "That interaction is already complete."
        }
      ],
      "mechanics": [
        {
          "version": 1,
          "id": "lesson_lighthouse_generator",
          "name": "Lighthouse backup generator",
          "description": "Repair a machine with a real fuse, refuel it through a native Recipe, switch it on, consume operating fuel, and power a connected gate.",
          "category": "Devices",
          "enabled": true,
          "autoStart": true,
          "inputs": [
            {
              "id": "machine",
              "name": "Machine control",
              "kind": "object",
              "required": true,
              "value": "lesson_generator"
            },
            {
              "id": "fuse",
              "name": "Repair fuse / material",
              "kind": "object",
              "required": true,
              "value": "lesson_brass_fuse"
            },
            {
              "id": "fuel",
              "name": "Fuel item",
              "kind": "object",
              "required": true,
              "value": "lesson_fuel_can"
            },
            {
              "id": "gate",
              "name": "Powered gate",
              "kind": "object",
              "required": true,
              "value": "lesson_safety_gate"
            },
            {
              "id": "fuelUnits",
              "name": "Operating turns per fuel item",
              "kind": "number",
              "required": true,
              "value": 8,
              "min": 1,
              "max": 1000
            }
          ],
          "variables": [
            {
              "id": "fuel",
              "name": "Fuel",
              "type": "number",
              "initial": 0,
              "min": 0,
              "max": 1000,
              "showInPlayer": true,
              "suffix": "turns"
            }
          ],
          "scope": {
            "kind": "global",
            "rooms": []
          },
          "initialPhase": "broken",
          "phases": [
            {
              "id": "broken",
              "name": "Broken",
              "onEnter": [
                {
                  "kind": "state",
                  "target": "mp_lesson_lighthouse_generator_powered",
                  "value": false
                }
              ],
              "onExit": []
            },
            {
              "id": "off",
              "name": "Off",
              "onEnter": [
                {
                  "kind": "state",
                  "target": "mp_lesson_lighthouse_generator_powered",
                  "value": false
                },
                {
                  "kind": "object_state",
                  "target": "$gate",
                  "property": "locked",
                  "value": true
                }
              ],
              "onExit": []
            },
            {
              "id": "running",
              "name": "Running",
              "onEnter": [
                {
                  "kind": "state",
                  "target": "mp_lesson_lighthouse_generator_powered",
                  "value": true
                },
                {
                  "kind": "object_state",
                  "target": "$gate",
                  "property": "locked",
                  "value": false
                },
                {
                  "kind": "message",
                  "value": "The machine starts. Its connected gate is powered."
                }
              ],
              "onExit": [
                {
                  "kind": "state",
                  "target": "mp_lesson_lighthouse_generator_powered",
                  "value": false
                },
                {
                  "kind": "object_state",
                  "target": "$gate",
                  "property": "locked",
                  "value": true
                }
              ]
            }
          ],
          "rules": [
            {
              "id": "already_repaired",
              "name": "Remember the actual world repair after a counter reset",
              "enabled": true,
              "trigger": {
                "kind": "start",
                "target": "",
                "event": ""
              },
              "conditions": {
                "match": "all",
                "conditions": [
                  {
                    "kind": "flag",
                    "target": "mp_lesson_lighthouse_generator_repaired",
                    "operator": "==",
                    "value": true
                  }
                ]
              },
              "actions": [
                {
                  "kind": "phase",
                  "target": "off"
                }
              ],
              "otherwise": [],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 0,
              "probability": 1,
              "priority": 0,
              "phase": "broken"
            },
            {
              "id": "repair",
              "name": "Observe the accepted repair Recipe",
              "enabled": true,
              "trigger": {
                "kind": "fact",
                "target": "mp_lesson_lighthouse_generator_repair",
                "event": "recipe"
              },
              "conditions": {
                "match": "all",
                "conditions": []
              },
              "actions": [
                {
                  "kind": "phase",
                  "target": "off"
                },
                {
                  "kind": "message",
                  "value": "The machine is repaired. Add fuel, then USE the machine."
                }
              ],
              "otherwise": [],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 0,
              "probability": 1,
              "priority": 0,
              "phase": "broken"
            },
            {
              "id": "refuel",
              "name": "Accept fuel consumed by the native Recipe",
              "enabled": true,
              "trigger": {
                "kind": "fact",
                "target": "mp_lesson_lighthouse_generator_refuel",
                "event": "recipe"
              },
              "conditions": {
                "match": "all",
                "conditions": []
              },
              "actions": [
                {
                  "kind": "local",
                  "target": "fuel",
                  "operation": "add",
                  "value": {
                    "input": "fuelUnits"
                  }
                },
                {
                  "kind": "message",
                  "value": "Fuel is added. Remaining fuel: {{variable:fuel}} operating turns."
                }
              ],
              "otherwise": [],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 0,
              "probability": 1,
              "priority": 0
            },
            {
              "id": "start",
              "name": "Start the repaired machine",
              "enabled": true,
              "trigger": {
                "kind": "object",
                "target": "$machine",
                "event": "use"
              },
              "conditions": {
                "match": "all",
                "conditions": [
                  {
                    "kind": "event",
                    "field": "secondary",
                    "operator": "==",
                    "value": ""
                  },
                  {
                    "match": "all",
                    "conditions": [
                      {
                        "kind": "local",
                        "target": "fuel",
                        "operator": ">",
                        "value": 0
                      }
                    ]
                  }
                ]
              },
              "actions": [
                {
                  "kind": "phase",
                  "target": "running"
                }
              ],
              "otherwise": [
                {
                  "kind": "message",
                  "value": "The machine needs fuel. Carry the fuel item and USE it WITH the machine."
                }
              ],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 0,
              "probability": 1,
              "priority": 0,
              "phase": "off"
            },
            {
              "id": "stop",
              "name": "Switch off a running machine",
              "enabled": true,
              "trigger": {
                "kind": "object",
                "target": "$machine",
                "event": "use"
              },
              "conditions": {
                "match": "all",
                "conditions": [
                  {
                    "kind": "event",
                    "field": "secondary",
                    "operator": "==",
                    "value": ""
                  },
                  {
                    "match": "all",
                    "conditions": []
                  }
                ]
              },
              "actions": [
                {
                  "kind": "phase",
                  "target": "off"
                },
                {
                  "kind": "message",
                  "value": "You switch the machine off."
                }
              ],
              "otherwise": [],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 0,
              "probability": 1,
              "priority": 0,
              "phase": "running"
            },
            {
              "id": "broken",
              "name": "Explain the missing repair",
              "enabled": true,
              "trigger": {
                "kind": "object",
                "target": "$machine",
                "event": "use"
              },
              "conditions": {
                "match": "all",
                "conditions": [
                  {
                    "kind": "event",
                    "field": "secondary",
                    "operator": "==",
                    "value": ""
                  },
                  {
                    "match": "all",
                    "conditions": []
                  }
                ]
              },
              "actions": [
                {
                  "kind": "message",
                  "value": "The machine needs its fuse / repair material. Carry it and USE it WITH the machine."
                }
              ],
              "otherwise": [],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 0,
              "probability": 1,
              "priority": 0,
              "phase": "broken"
            },
            {
              "id": "burn",
              "name": "Consume fuel on each operating turn",
              "enabled": true,
              "trigger": {
                "kind": "turn",
                "target": "",
                "event": ""
              },
              "conditions": {
                "match": "all",
                "conditions": []
              },
              "actions": [
                {
                  "kind": "local",
                  "target": "fuel",
                  "operation": "subtract",
                  "value": 1
                }
              ],
              "otherwise": [],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 0,
              "probability": 1,
              "priority": 10,
              "phase": "running"
            },
            {
              "id": "exhausted",
              "name": "Stop when fuel is exhausted",
              "enabled": true,
              "trigger": {
                "kind": "turn",
                "target": "",
                "event": ""
              },
              "conditions": {
                "match": "all",
                "conditions": [
                  {
                    "kind": "local",
                    "target": "fuel",
                    "operator": "<=",
                    "value": 0
                  }
                ]
              },
              "actions": [
                {
                  "kind": "phase",
                  "target": "off"
                },
                {
                  "kind": "message",
                  "value": "The fuel runs out. The machine stops and its gate loses power."
                }
              ],
              "otherwise": [],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 0,
              "probability": 1,
              "priority": 0,
              "phase": "running"
            }
          ],
          "sourcePreset": "powered_machine",
          "notes": "A machine, fuse, fuel item, and controlled gate.\nCarry the fuse or fuel; USE FUSE WITH MACHINE / USE FUEL WITH MACHINE.\nPause freezes the operating clock while retaining current power; terminal controls stop power and lock its gate. Reset changes local clocks/resources without recreating consumed world items. This package adds native repair/refuel Recipes and two named story states. Link exits or Objectives to mp_lighthouse_generator_powered. Active turns include the command that starts the machine.",
          "onControl": {
            "disable": [
              {
                "kind": "state",
                "target": "mp_lesson_lighthouse_generator_powered",
                "value": false
              },
              {
                "kind": "object_state",
                "target": "$gate",
                "property": "locked",
                "value": true
              },
              {
                "kind": "phase",
                "target": "off"
              }
            ],
            "complete": [
              {
                "kind": "state",
                "target": "mp_lesson_lighthouse_generator_powered",
                "value": false
              },
              {
                "kind": "object_state",
                "target": "$gate",
                "property": "locked",
                "value": true
              },
              {
                "kind": "phase",
                "target": "off"
              }
            ],
            "fail": [
              {
                "kind": "state",
                "target": "mp_lesson_lighthouse_generator_powered",
                "value": false
              },
              {
                "kind": "object_state",
                "target": "$gate",
                "property": "locked",
                "value": true
              },
              {
                "kind": "phase",
                "target": "off"
              }
            ],
            "reset": [
              {
                "kind": "state",
                "target": "mp_lesson_lighthouse_generator_powered",
                "value": false
              },
              {
                "kind": "object_state",
                "target": "$gate",
                "property": "locked",
                "value": true
              },
              {
                "kind": "phase",
                "target": "broken"
              }
            ]
          }
        },
        {
          "version": 1,
          "id": "lesson_lighthouse_lift",
          "name": "Powered lift and emergency return",
          "description": "Two controls connect origin and destination, with a guarded optional fare in both directions. Insufficient funds leave the player in place.",
          "category": "Travel",
          "enabled": true,
          "autoStart": true,
          "inputs": [
            {
              "id": "origin",
              "name": "Origin room",
              "kind": "room",
              "required": true,
              "value": "lesson_powerhouse"
            },
            {
              "id": "destination",
              "name": "Destination room",
              "kind": "room",
              "required": true,
              "value": "lesson_gallery"
            },
            {
              "id": "outbound",
              "name": "Outbound control",
              "kind": "object",
              "required": true,
              "value": "lesson_lift_control"
            },
            {
              "id": "inbound",
              "name": "Return control",
              "kind": "object",
              "required": true,
              "value": "lesson_return_lever"
            },
            {
              "id": "fare",
              "name": "Fare per trip",
              "kind": "number",
              "required": true,
              "value": 0,
              "min": 0,
              "max": 1000000
            }
          ],
          "variables": [
            {
              "id": "fare",
              "name": "Configured fare",
              "type": "number",
              "initial": "$fare",
              "min": 0,
              "max": 1000000
            }
          ],
          "scope": {
            "kind": "global",
            "rooms": []
          },
          "initialPhase": "",
          "phases": [],
          "rules": [
            {
              "id": "outbound",
              "name": "Travel from origin",
              "enabled": true,
              "trigger": {
                "kind": "object",
                "target": "$outbound",
                "event": "use"
              },
              "conditions": {
                "match": "all",
                "conditions": [
                  {
                    "kind": "event",
                    "field": "secondary",
                    "operator": "==",
                    "value": ""
                  },
                  {
                    "match": "all",
                    "conditions": [
                      {
                        "kind": "objective",
                        "criterion": {
                          "kind": "room_current",
                          "target": "$origin",
                          "targetKind": "room"
                        }
                      },
                      {
                        "match": "any",
                        "conditions": [
                          {
                            "kind": "local",
                            "target": "fare",
                            "operator": "==",
                            "value": 0
                          },
                          {
                            "kind": "flag",
                            "target": "money",
                            "operator": ">=",
                            "value": "$fare"
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "kind": "flag",
                    "target": "mp_lesson_lighthouse_generator_powered",
                    "operator": "==",
                    "value": true
                  }
                ]
              },
              "actions": [
                {
                  "kind": "currency",
                  "operation": "subtract",
                  "value": {
                    "input": "fare"
                  }
                },
                {
                  "kind": "goto",
                  "target": "$destination"
                },
                {
                  "kind": "message",
                  "value": "You arrive at the destination."
                }
              ],
              "otherwise": [
                {
                  "kind": "message",
                  "value": "The lift has no power. Repair and fuel the generator, then USE GENERATOR."
                }
              ],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 0,
              "probability": 1,
              "priority": 0
            },
            {
              "id": "inbound",
              "name": "Return to the origin",
              "enabled": true,
              "trigger": {
                "kind": "object",
                "target": "$inbound",
                "event": "use"
              },
              "conditions": {
                "match": "all",
                "conditions": [
                  {
                    "kind": "event",
                    "field": "secondary",
                    "operator": "==",
                    "value": ""
                  },
                  {
                    "match": "all",
                    "conditions": [
                      {
                        "kind": "objective",
                        "criterion": {
                          "kind": "room_current",
                          "target": "$destination",
                          "targetKind": "room"
                        }
                      },
                      {
                        "match": "any",
                        "conditions": [
                          {
                            "kind": "local",
                            "target": "fare",
                            "operator": "==",
                            "value": 0
                          },
                          {
                            "kind": "flag",
                            "target": "money",
                            "operator": ">=",
                            "value": "$fare"
                          }
                        ]
                      }
                    ]
                  }
                ]
              },
              "actions": [
                {
                  "kind": "currency",
                  "operation": "subtract",
                  "value": {
                    "input": "fare"
                  }
                },
                {
                  "kind": "goto",
                  "target": "$origin"
                },
                {
                  "kind": "message",
                  "value": "You return to the origin."
                }
              ],
              "otherwise": [
                {
                  "kind": "message",
                  "value": "The return route is unavailable here, or you cannot afford its fare."
                }
              ],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 0,
              "probability": 1,
              "priority": 0
            }
          ],
          "sourcePreset": "transport",
          "notes": "Origin and destination rooms, each with its own usable control.\nSet fare to zero for free travel. A positive fare requires player currency."
        },
        {
          "version": 1,
          "id": "lesson_lighthouse_noise",
          "name": "Generator noise and harmless watchman",
          "description": "Suspicion rises in a selected guarded room. A worn disguise prevents detection; a real distraction item reduces suspicion. Detection uses saved seeded chance.",
          "category": "NPC & Stealth",
          "enabled": true,
          "autoStart": true,
          "inputs": [
            {
              "id": "zone",
              "name": "Guarded room",
              "kind": "room",
              "required": true,
              "value": "lesson_powerhouse"
            },
            {
              "id": "guard",
              "name": "Guard NPC",
              "kind": "npc",
              "required": true,
              "value": "lesson_watchman"
            },
            {
              "id": "disguise",
              "name": "Protective disguise",
              "kind": "object",
              "required": true,
              "value": "lesson_worker_jacket"
            },
            {
              "id": "distraction",
              "name": "Consumable distraction",
              "kind": "object",
              "required": true,
              "value": "lesson_windup_toy"
            },
            {
              "id": "threshold",
              "name": "Suspicion threshold",
              "kind": "number",
              "required": true,
              "value": 2,
              "min": 1,
              "max": 100
            }
          ],
          "variables": [
            {
              "id": "noise",
              "name": "Suspicion",
              "type": "number",
              "initial": 0,
              "min": 0,
              "max": 100,
              "showInPlayer": true
            },
            {
              "id": "threshold",
              "name": "Detection threshold",
              "type": "number",
              "initial": "$threshold",
              "min": 1,
              "max": 100
            }
          ],
          "scope": {
            "kind": "rooms",
            "rooms": [
              "$zone"
            ]
          },
          "initialPhase": "hidden",
          "phases": [
            {
              "id": "hidden",
              "name": "Hidden",
              "onEnter": [],
              "onExit": []
            },
            {
              "id": "alerted",
              "name": "Alerted",
              "onEnter": [
                {
                  "kind": "state",
                  "target": "mp_lesson_lighthouse_noise_alerted",
                  "value": true
                },
                {
                  "kind": "message",
                  "value": "The guard detects you. The alarm state is now active."
                }
              ],
              "onExit": []
            }
          ],
          "rules": [
            {
              "id": "noise",
              "name": "Movement and activity raise suspicion",
              "enabled": true,
              "trigger": {
                "kind": "turn",
                "target": "",
                "event": ""
              },
              "conditions": {
                "match": "all",
                "conditions": [
                  {
                    "kind": "flag",
                    "target": "mp_lesson_lighthouse_generator_powered",
                    "operator": "==",
                    "value": true
                  }
                ]
              },
              "actions": [
                {
                  "kind": "local",
                  "target": "noise",
                  "operation": "add",
                  "value": 1
                }
              ],
              "otherwise": [],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 0,
              "probability": 1,
              "priority": 20
            },
            {
              "id": "detect",
              "name": "A nearby living guard may detect you",
              "enabled": true,
              "trigger": {
                "kind": "turn",
                "target": "",
                "event": ""
              },
              "conditions": {
                "match": "all",
                "conditions": [
                  {
                    "kind": "local",
                    "target": "noise",
                    "operator": ">=",
                    "value": "@threshold"
                  },
                  {
                    "kind": "objective",
                    "criterion": {
                      "kind": "npc_at",
                      "target": "$guard",
                      "secondary": "$zone",
                      "targetKind": "npc"
                    }
                  },
                  {
                    "match": "not",
                    "conditions": [
                      {
                        "kind": "objective",
                        "criterion": {
                          "kind": "object_worn",
                          "target": "$disguise",
                          "targetKind": "object"
                        }
                      }
                    ]
                  },
                  {
                    "kind": "flag",
                    "target": "mp_lesson_lighthouse_generator_powered",
                    "operator": "==",
                    "value": true
                  }
                ]
              },
              "actions": [
                {
                  "kind": "phase",
                  "target": "alerted"
                }
              ],
              "otherwise": [],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 2,
              "maxUses": 0,
              "probability": 0.35,
              "priority": 0,
              "phase": "hidden"
            },
            {
              "id": "distract",
              "name": "Use a real distraction item",
              "enabled": true,
              "trigger": {
                "kind": "object",
                "target": "$distraction",
                "event": "use"
              },
              "conditions": {
                "match": "all",
                "conditions": [
                  {
                    "kind": "event",
                    "field": "secondary",
                    "operator": "==",
                    "value": ""
                  },
                  {
                    "match": "all",
                    "conditions": [
                      {
                        "kind": "objective",
                        "criterion": {
                          "kind": "object_possessed",
                          "target": "$distraction",
                          "targetKind": "object"
                        }
                      }
                    ]
                  }
                ]
              },
              "actions": [
                {
                  "kind": "consume",
                  "target": "$distraction"
                },
                {
                  "kind": "local",
                  "target": "noise",
                  "operation": "set",
                  "value": 0
                },
                {
                  "kind": "state",
                  "target": "mp_lesson_lighthouse_noise_alerted",
                  "value": false
                },
                {
                  "kind": "phase",
                  "target": "hidden"
                },
                {
                  "kind": "message",
                  "value": "The distraction draws attention away. Suspicion returns to zero."
                }
              ],
              "otherwise": [
                {
                  "kind": "message",
                  "value": "Carry the distraction item before using it."
                }
              ],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 0,
              "probability": 1,
              "priority": 0
            }
          ],
          "sourcePreset": "stealth_noise",
          "notes": "One guarded room, a living guard there, a wearable disguise, and a usable distraction item.\nThe shared alarm state mp_lighthouse_noise_alerted can trigger an existing Security World Event. NPC movement stays with native routines; this preset never teleports the guard."
        }
      ],
      "randomTables": [],
      "routines": []
    }
  },
  "cookbookRecipes": [
    {
      "version": 1,
      "settings": {
        "instance": "lesson",
        "recipeId": "mechanics-workshop",
        "choices": {
          "quay": {
            "existing": "",
            "name": "Lighthouse Quay",
            "description": "A worker jacket hangs beside the keeper. The powerhouse is north."
          },
          "powerhouse": {
            "existing": "",
            "name": "Lighthouse Powerhouse",
            "description": "The generator, safety gate and lift control share one circuit. A brass fuse, fuel can, windup toy and briefing are within reach. The quay is south."
          },
          "gallery": {
            "existing": "",
            "name": "Upper Signal Gallery",
            "description": "The spare signal lens rests beside an emergency return lever. The return is mechanical and always works."
          },
          "worker_jacket": {
            "existing": "",
            "name": "worker jacket",
            "description": "A lighthouse worker jacket. WEAR WORKER JACKET to keep the harmless watchman from identifying you as an unfamiliar visitor."
          },
          "brass_fuse": {
            "existing": "",
            "name": "brass fuse",
            "description": "A replacement brass fuse. Carry it, then USE BRASS FUSE WITH GENERATOR."
          },
          "fuel_can": {
            "existing": "",
            "name": "fuel can",
            "description": "One measured can of fuel provides eight operating turns. Carry it, then USE FUEL CAN WITH GENERATOR after repairing the generator."
          },
          "generator": {
            "existing": "",
            "name": "generator",
            "description": "A compact backup generator with an empty fuse holder and fuel tank. Repair it, refuel it, and USE GENERATOR to switch it on or off."
          },
          "safety_gate": {
            "existing": "",
            "name": "safety gate",
            "description": "An electrical latch unlocks while the generator is powered. The lift control uses the same power state."
          },
          "lift_control": {
            "existing": "",
            "name": "lift control",
            "description": "USE LIFT CONTROL to reach the upper gallery while the generator is powered."
          },
          "return_lever": {
            "existing": "",
            "name": "return lever",
            "description": "An emergency mechanical return. USE RETURN LEVER to return to the powerhouse even if generator power has failed."
          },
          "signal_lens": {
            "existing": "",
            "name": "signal lens",
            "description": "The spare signal lens requested by the keeper. Bring it back to the quay and give it to the keeper."
          },
          "windup_toy": {
            "existing": "",
            "name": "windup toy",
            "description": "A harmless windup distraction. Carry it and USE WINDUP TOY at the powerhouse to reduce suspicion. The toy is consumed when used."
          },
          "briefing": {
            "existing": "",
            "name": "briefing",
            "description": "LIGHTHOUSE POWER WORKSHOP: Take and wear the worker jacket at the quay if you want the watchman to ignore you. At the powerhouse TAKE BRASS FUSE and TAKE FUEL CAN. USE BRASS FUSE WITH GENERATOR repairs it. USE FUEL CAN WITH GENERATOR adds eight operating turns of fuel. USE GENERATOR switches it on; USE LIFT CONTROL takes you upstairs while power is on. TAKE SIGNAL LENS, USE RETURN LEVER, and USE GENERATOR to switch the generator off and save fuel. Go SOUTH and GIVE SIGNAL LENS TO KEEPER. The machine consumes fuel only while running and automatically stops at zero. The emergency return lever always works, so power loss cannot trap you upstairs. OBJECTIVES, HINT and the Mechanics status panel explain progress. This is a safe workshop: the watchman raises an alarm state but never attacks."
          },
          "keeper": {
            "existing": "",
            "name": "keeper",
            "description": "The lighthouse keeper needs the signal lens from the upper gallery."
          },
          "watchman": {
            "existing": "",
            "name": "watchman",
            "description": "A harmless watchman notices unfamiliar visitors when the generator makes noise. The worker jacket is a recognizable disguise."
          }
        },
        "values": {
          "introduction": "The keeper needs a signal lens from the lighthouse gallery. A safe workshop waits NORTH. TAKE WORKER JACKET and WEAR WORKER JACKET if you want the harmless watchman to ignore you. Repair and fuel the generator, use the powered lift, then bring the lens back here. OBJECTIVES and HINT explain the route. This workshop has no hostile enemies.",
          "enableMoney": true
        },
        "reuseRoutes": {}
      },
      "owned": [
        {
          "path": "files",
          "key": "rooms/lesson_quay.taml",
          "after": {
            "path": "rooms/lesson_quay.taml",
            "name": "lesson_quay.taml",
            "content": "room lesson_quay\n  exit north: lesson_powerhouse\n  name: \"Lighthouse Quay\"\n  narrative: \"The keeper needs a signal lens from the lighthouse gallery. A safe workshop waits NORTH. TAKE WORKER JACKET and WEAR WORKER JACKET if you want the harmless watchman to ignore you. Repair and fuel the generator, use the powered lift, then bring the lens back here. OBJECTIVES and HINT explain the route. This workshop has no hostile enemies.\"\n  description: \"A worker jacket hangs beside the keeper. The powerhouse is north.\"\n  hint: \"TAKE WORKER JACKET, WEAR WORKER JACKET, then go NORTH and READ BRIEFING.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "rooms/lesson_powerhouse.taml",
          "after": {
            "path": "rooms/lesson_powerhouse.taml",
            "name": "lesson_powerhouse.taml",
            "content": "room lesson_powerhouse\n  exit up: lesson_gallery when: mp_lesson_lighthouse_generator_powered\n  exit south: lesson_quay\n  name: \"Lighthouse Powerhouse\"\n  description: \"The generator, safety gate and lift control share one circuit. A brass fuse, fuel can, windup toy and briefing are within reach. The quay is south.\"\n  hint: \"TAKE BRASS FUSE and TAKE FUEL CAN. USE BRASS FUSE WITH GENERATOR, then USE FUEL CAN WITH GENERATOR. USE GENERATOR starts it. USE LIFT CONTROL goes upstairs while power lasts.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "rooms/lesson_gallery.taml",
          "after": {
            "path": "rooms/lesson_gallery.taml",
            "name": "lesson_gallery.taml",
            "content": "room lesson_gallery\n  exit down: lesson_powerhouse\n  name: \"Upper Signal Gallery\"\n  description: \"The spare signal lens rests beside an emergency return lever. The return is mechanical and always works.\"\n  hint: \"TAKE SIGNAL LENS, then USE RETURN LEVER. You can also go DOWN. Switch off the generator to save fuel, go SOUTH, and GIVE SIGNAL LENS TO KEEPER.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_worker_jacket.taml",
          "after": {
            "path": "objects/lesson_worker_jacket.taml",
            "name": "lesson_worker_jacket.taml",
            "content": "object lesson_worker_jacket\n  name: \"worker jacket\"\n  description: \"A lighthouse worker jacket. WEAR WORKER JACKET to keep the harmless watchman from identifying you as an unfamiliar visitor.\"\n  location: lesson_quay\n  aliases: [\"jacket\", \"coat\", \"worker jacket\"]\n  takeable: true\n  wearable: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_brass_fuse.taml",
          "after": {
            "path": "objects/lesson_brass_fuse.taml",
            "name": "lesson_brass_fuse.taml",
            "content": "object lesson_brass_fuse\n  name: \"brass fuse\"\n  description: \"A replacement brass fuse. Carry it, then USE BRASS FUSE WITH GENERATOR.\"\n  location: lesson_powerhouse\n  aliases: [\"fuse\", \"brass fuse\"]\n  takeable: true\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_fuel_can.taml",
          "after": {
            "path": "objects/lesson_fuel_can.taml",
            "name": "lesson_fuel_can.taml",
            "content": "object lesson_fuel_can\n  name: \"fuel can\"\n  description: \"One measured can of fuel provides eight operating turns. Carry it, then USE FUEL CAN WITH GENERATOR after repairing the generator.\"\n  location: lesson_powerhouse\n  aliases: [\"fuel\", \"can\", \"fuel can\"]\n  takeable: true\n  use_give: true\n  weight: 0.1\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: \"generator\"\n  description: \"A compact backup generator with an empty fuse holder and fuel tank. Repair it, refuel it, and USE GENERATOR to switch it on or off.\"\n  location: lesson_powerhouse\n  aliases: [\"machine\", \"generator\"]\n  droppable: false\n  use_give: true\n  switchable: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_safety_gate.taml",
          "after": {
            "path": "objects/lesson_safety_gate.taml",
            "name": "lesson_safety_gate.taml",
            "content": "object lesson_safety_gate\n  name: \"safety gate\"\n  description: \"An electrical latch unlocks while the generator is powered. The lift control uses the same power state.\"\n  location: lesson_powerhouse\n  aliases: [\"gate\", \"safety gate\"]\n  droppable: false\n  locked: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_lift_control.taml",
          "after": {
            "path": "objects/lesson_lift_control.taml",
            "name": "lesson_lift_control.taml",
            "content": "object lesson_lift_control\n  name: \"lift control\"\n  description: \"USE LIFT CONTROL to reach the upper gallery while the generator is powered.\"\n  location: lesson_powerhouse\n  aliases: [\"lift\", \"elevator\", \"lift control\"]\n  droppable: false\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_return_lever.taml",
          "after": {
            "path": "objects/lesson_return_lever.taml",
            "name": "lesson_return_lever.taml",
            "content": "object lesson_return_lever\n  name: \"return lever\"\n  description: \"An emergency mechanical return. USE RETURN LEVER to return to the powerhouse even if generator power has failed.\"\n  location: lesson_gallery\n  aliases: [\"lever\", \"return control\", \"return lever\"]\n  droppable: false\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_signal_lens.taml",
          "after": {
            "path": "objects/lesson_signal_lens.taml",
            "name": "lesson_signal_lens.taml",
            "content": "object lesson_signal_lens\n  name: \"signal lens\"\n  description: \"The spare signal lens requested by the keeper. Bring it back to the quay and give it to the keeper.\"\n  location: lesson_gallery\n  aliases: [\"lens\", \"signal lens\"]\n  takeable: true\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_windup_toy.taml",
          "after": {
            "path": "objects/lesson_windup_toy.taml",
            "name": "lesson_windup_toy.taml",
            "content": "object lesson_windup_toy\n  name: \"windup toy\"\n  description: \"A harmless windup distraction. Carry it and USE WINDUP TOY at the powerhouse to reduce suspicion. The toy is consumed when used.\"\n  location: lesson_powerhouse\n  aliases: [\"toy\", \"distraction\", \"windup toy\"]\n  takeable: true\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_briefing.taml",
          "after": {
            "path": "objects/lesson_briefing.taml",
            "name": "lesson_briefing.taml",
            "content": "object lesson_briefing\n  name: \"briefing\"\n  description: \"LIGHTHOUSE POWER WORKSHOP: Take and wear the worker jacket at the quay if you want the watchman to ignore you. At the powerhouse TAKE BRASS FUSE and TAKE FUEL CAN. USE BRASS FUSE WITH GENERATOR repairs it. USE FUEL CAN WITH GENERATOR adds eight operating turns of fuel. USE GENERATOR switches it on; USE LIFT CONTROL takes you upstairs while power is on. TAKE SIGNAL LENS, USE RETURN LEVER, and USE GENERATOR to switch the generator off and save fuel. Go SOUTH and GIVE SIGNAL LENS TO KEEPER. The machine consumes fuel only while running and automatically stops at zero. The emergency return lever always works, so power loss cannot trap you upstairs. OBJECTIVES, HINT and the Mechanics status panel explain progress. This is a safe workshop: the watchman raises an alarm state but never attacks.\"\n  location: lesson_powerhouse\n  aliases: [\"instructions\", \"note\", \"briefing\"]\n  droppable: false\n  weight: 0.1\n  on read:\n    print \"LIGHTHOUSE POWER WORKSHOP: Take and wear the worker jacket at the quay if you want the watchman to ignore you. At the powerhouse TAKE BRASS FUSE and TAKE FUEL CAN. USE BRASS FUSE WITH GENERATOR repairs it. USE FUEL CAN WITH GENERATOR adds eight operating turns of fuel. USE GENERATOR switches it on; USE LIFT CONTROL takes you upstairs while power is on. TAKE SIGNAL LENS, USE RETURN LEVER, and USE GENERATOR to switch the generator off and save fuel. Go SOUTH and GIVE SIGNAL LENS TO KEEPER. The machine consumes fuel only while running and automatically stops at zero. The emergency return lever always works, so power loss cannot trap you upstairs. OBJECTIVES, HINT and the Mechanics status panel explain progress. This is a safe workshop: the watchman raises an alarm state but never attacks.\"\n  end\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: \"keeper\"\n  description: \"The lighthouse keeper needs the signal lens from the upper gallery.\"\n  location: lesson_quay\n  mobile: false\n  follow: false\n  aliases: [\"lighthouse keeper\", \"keeper\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  dialogue default:\n    print \"keeper looks at you in silence.\"\n  end\n  on talk:\n    print \"Please repair and fuel the generator, retrieve the signal lens upstairs, then bring it back to me. The emergency return always works.\"\n  end\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "npcs/lesson_watchman.taml",
          "after": {
            "path": "npcs/lesson_watchman.taml",
            "name": "lesson_watchman.taml",
            "content": "npc lesson_watchman\n  name: \"watchman\"\n  description: \"A harmless watchman notices unfamiliar visitors when the generator makes noise. The worker jacket is a recognizable disguise.\"\n  location: lesson_powerhouse\n  mobile: false\n  follow: false\n  aliases: [\"guard\", \"watchman\"]\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  dialogue default:\n    print \"watchman looks at you in silence.\"\n  end\n  on talk:\n    print \"Wear your worker jacket around operating equipment. I only raise an alarm; this workshop has no combat.\"\n  end\nend",
            "isDirty": true
          }
        },
        {
          "path": "objects",
          "key": "lesson_worker_jacket",
          "after": {
            "id": "lesson_worker_jacket",
            "name": "worker jacket",
            "description": "A lighthouse worker jacket. WEAR WORKER JACKET to keep the harmless watchman from identifying you as an unfamiliar visitor.",
            "article": "",
            "location": "lesson_quay",
            "aliases": [
              "jacket",
              "coat",
              "worker jacket"
            ],
            "visible": true,
            "takeable": true,
            "droppable": true,
            "useGive": false,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": true,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": []
          }
        },
        {
          "path": "objects",
          "key": "lesson_brass_fuse",
          "after": {
            "id": "lesson_brass_fuse",
            "name": "brass fuse",
            "description": "A replacement brass fuse. Carry it, then USE BRASS FUSE WITH GENERATOR.",
            "article": "",
            "location": "lesson_powerhouse",
            "aliases": [
              "fuse",
              "brass fuse"
            ],
            "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_fuel_can",
          "after": {
            "id": "lesson_fuel_can",
            "name": "fuel can",
            "description": "One measured can of fuel provides eight operating turns. Carry it, then USE FUEL CAN WITH GENERATOR after repairing the generator.",
            "article": "",
            "location": "lesson_powerhouse",
            "aliases": [
              "fuel",
              "can",
              "fuel can"
            ],
            "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_generator",
          "after": {
            "id": "lesson_generator",
            "name": "generator",
            "description": "A compact backup generator with an empty fuse holder and fuel tank. Repair it, refuel it, and USE GENERATOR to switch it on or off.",
            "article": "",
            "location": "lesson_powerhouse",
            "aliases": [
              "machine",
              "generator"
            ],
            "visible": true,
            "takeable": false,
            "droppable": false,
            "useGive": true,
            "container": false,
            "switchable": true,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": []
          }
        },
        {
          "path": "objects",
          "key": "lesson_safety_gate",
          "after": {
            "id": "lesson_safety_gate",
            "name": "safety gate",
            "description": "An electrical latch unlocks while the generator is powered. The lift control uses the same power state.",
            "article": "",
            "location": "lesson_powerhouse",
            "aliases": [
              "gate",
              "safety gate"
            ],
            "visible": true,
            "takeable": false,
            "droppable": false,
            "useGive": false,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": true,
            "lockKey": "",
            "events": []
          }
        },
        {
          "path": "objects",
          "key": "lesson_lift_control",
          "after": {
            "id": "lesson_lift_control",
            "name": "lift control",
            "description": "USE LIFT CONTROL to reach the upper gallery while the generator is powered.",
            "article": "",
            "location": "lesson_powerhouse",
            "aliases": [
              "lift",
              "elevator",
              "lift control"
            ],
            "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_return_lever",
          "after": {
            "id": "lesson_return_lever",
            "name": "return lever",
            "description": "An emergency mechanical return. USE RETURN LEVER to return to the powerhouse even if generator power has failed.",
            "article": "",
            "location": "lesson_gallery",
            "aliases": [
              "lever",
              "return control",
              "return lever"
            ],
            "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_signal_lens",
          "after": {
            "id": "lesson_signal_lens",
            "name": "signal lens",
            "description": "The spare signal lens requested by the keeper. Bring it back to the quay and give it to the keeper.",
            "article": "",
            "location": "lesson_gallery",
            "aliases": [
              "lens",
              "signal lens"
            ],
            "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_windup_toy",
          "after": {
            "id": "lesson_windup_toy",
            "name": "windup toy",
            "description": "A harmless windup distraction. Carry it and USE WINDUP TOY at the powerhouse to reduce suspicion. The toy is consumed when used.",
            "article": "",
            "location": "lesson_powerhouse",
            "aliases": [
              "toy",
              "distraction",
              "windup toy"
            ],
            "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_briefing",
          "after": {
            "id": "lesson_briefing",
            "name": "briefing",
            "description": "LIGHTHOUSE POWER WORKSHOP: Take and wear the worker jacket at the quay if you want the watchman to ignore you. At the powerhouse TAKE BRASS FUSE and TAKE FUEL CAN. USE BRASS FUSE WITH GENERATOR repairs it. USE FUEL CAN WITH GENERATOR adds eight operating turns of fuel. USE GENERATOR switches it on; USE LIFT CONTROL takes you upstairs while power is on. TAKE SIGNAL LENS, USE RETURN LEVER, and USE GENERATOR to switch the generator off and save fuel. Go SOUTH and GIVE SIGNAL LENS TO KEEPER. The machine consumes fuel only while running and automatically stops at zero. The emergency return lever always works, so power loss cannot trap you upstairs. OBJECTIVES, HINT and the Mechanics status panel explain progress. This is a safe workshop: the watchman raises an alarm state but never attacks.",
            "article": "",
            "location": "lesson_powerhouse",
            "aliases": [
              "instructions",
              "note",
              "briefing"
            ],
            "visible": true,
            "takeable": false,
            "droppable": false,
            "useGive": false,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": [
              {
                "id": "read",
                "event": "read",
                "withTarget": "",
                "body": "print \"LIGHTHOUSE POWER WORKSHOP: Take and wear the worker jacket at the quay if you want the watchman to ignore you. At the powerhouse TAKE BRASS FUSE and TAKE FUEL CAN. USE BRASS FUSE WITH GENERATOR repairs it. USE FUEL CAN WITH GENERATOR adds eight operating turns of fuel. USE GENERATOR switches it on; USE LIFT CONTROL takes you upstairs while power is on. TAKE SIGNAL LENS, USE RETURN LEVER, and USE GENERATOR to switch the generator off and save fuel. Go SOUTH and GIVE SIGNAL LENS TO KEEPER. The machine consumes fuel only while running and automatically stops at zero. The emergency return lever always works, so power loss cannot trap you upstairs. OBJECTIVES, HINT and the Mechanics status panel explain progress. This is a safe workshop: the watchman raises an alarm state but never attacks.\""
              }
            ]
          }
        },
        {
          "path": "npcs",
          "key": "lesson_keeper",
          "after": {
            "id": "lesson_keeper",
            "name": "keeper",
            "description": "The lighthouse keeper needs the signal lens from the upper gallery.",
            "location": "lesson_quay",
            "mobile": false,
            "aliases": [
              "lighthouse keeper",
              "keeper"
            ],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"Please repair and fuel the generator, retrieve the signal lens upstairs, then bring it back to me. The emergency return always works.\"",
            "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": [
              {
                "id": "default",
                "trigger": "default",
                "body": "print \"keeper looks at you in silence.\""
              }
            ]
          }
        },
        {
          "path": "npcs",
          "key": "lesson_watchman",
          "after": {
            "id": "lesson_watchman",
            "name": "watchman",
            "description": "A harmless watchman notices unfamiliar visitors when the generator makes noise. The worker jacket is a recognizable disguise.",
            "location": "lesson_powerhouse",
            "mobile": false,
            "aliases": [
              "guard",
              "watchman"
            ],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "print \"Wear your worker jacket around operating equipment. I only raise an alarm; this workshop has no combat.\"",
            "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": [
              {
                "id": "default",
                "trigger": "default",
                "body": "print \"watchman looks at you in silence.\""
              }
            ]
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_quay",
          "after": {
            "id": "lesson_quay",
            "name": "Lighthouse Quay",
            "narrative": "The keeper needs a signal lens from the lighthouse gallery. A safe workshop waits NORTH. TAKE WORKER JACKET and WEAR WORKER JACKET if you want the harmless watchman to ignore you. Repair and fuel the generator, use the powered lift, then bring the lens back here. OBJECTIVES and HINT explain the route. This workshop has no hostile enemies.",
            "description": "A worker jacket hangs beside the keeper. The powerhouse is north.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "TAKE WORKER JACKET, WEAR WORKER JACKET, then go NORTH and READ BRIEFING.",
            "dark": false,
            "roomType": "regular",
            "x": 100,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_powerhouse",
          "after": {
            "id": "lesson_powerhouse",
            "name": "Lighthouse Powerhouse",
            "description": "The generator, safety gate and lift control share one circuit. A brass fuse, fuel can, windup toy and briefing are within reach. The quay is south.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "TAKE BRASS FUSE and TAKE FUEL CAN. USE BRASS FUSE WITH GENERATOR, then USE FUEL CAN WITH GENERATOR. USE GENERATOR starts it. USE LIFT CONTROL goes upstairs while power lasts.",
            "dark": false,
            "roomType": "regular",
            "x": 320,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_gallery",
          "after": {
            "id": "lesson_gallery",
            "name": "Upper Signal Gallery",
            "description": "The spare signal lens rests beside an emergency return lever. The return is mechanical and always works.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "TAKE SIGNAL LENS, then USE RETURN LEVER. You can also go DOWN. Switch off the generator to save fuel, go SOUTH, and GIVE SIGNAL LENS TO KEEPER.",
            "dark": false,
            "roomType": "regular",
            "x": 540,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_connection_0",
          "after": {
            "id": "lesson_route_connection_0",
            "fromRoom": "lesson_quay",
            "toRoom": "lesson_powerhouse",
            "direction": "north",
            "locked": false
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_connection_1",
          "after": {
            "id": "lesson_route_connection_1",
            "fromRoom": "lesson_powerhouse",
            "toRoom": "lesson_quay",
            "direction": "south",
            "locked": false
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_connection_2",
          "after": {
            "id": "lesson_route_connection_2",
            "fromRoom": "lesson_powerhouse",
            "toRoom": "lesson_gallery",
            "direction": "up",
            "locked": false,
            "when": "mp_lesson_lighthouse_generator_powered"
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_connection_3",
          "after": {
            "id": "lesson_route_connection_3",
            "fromRoom": "lesson_gallery",
            "toRoom": "lesson_powerhouse",
            "direction": "down",
            "locked": false
          }
        },
        {
          "path": "objectiveSets",
          "key": "lesson_lighthouse_service",
          "after": {
            "id": "lesson_lighthouse_service",
            "name": "Lighthouse service",
            "playerLabel": "Restore the lighthouse service",
            "commands": "objectives journal logbook",
            "showInExport": true,
            "goals": [
              {
                "id": "repair",
                "label": "Repair the generator with its fuse",
                "type": "flag",
                "flagName": "",
                "flagValue": "true",
                "roomId": "",
                "roomName": "",
                "scoreTarget": 100,
                "countFlags": "",
                "prereqGoalId": "",
                "hidden": false,
                "tracking": {
                  "category": "build",
                  "group": "main",
                  "description": "",
                  "criteria": [
                    {
                      "kind": "recipe",
                      "target": "mp_lesson_lighthouse_generator_repair"
                    }
                  ],
                  "match": "all",
                  "requiredCount": 1,
                  "prerequisites": [],
                  "optional": false,
                  "exclusiveGroup": "",
                  "availabilityConditions": [],
                  "revealConditions": [],
                  "mode": "achievement",
                  "retroactive": true,
                  "targetTurns": 5,
                  "interruption": "reset",
                  "deadlineTurns": 0,
                  "failureConditions": [],
                  "rewards": [],
                  "failureActions": [],
                  "completionText": "",
                  "failureText": "",
                  "linkedQuestId": "",
                  "linkedStageId": "",
                  "hintId": ""
                }
              },
              {
                "id": "refuel",
                "label": "Refuel the repaired generator",
                "type": "flag",
                "flagName": "",
                "flagValue": "true",
                "roomId": "",
                "roomName": "",
                "scoreTarget": 100,
                "countFlags": "",
                "prereqGoalId": "",
                "hidden": false,
                "tracking": {
                  "category": "build",
                  "group": "main",
                  "description": "",
                  "criteria": [
                    {
                      "kind": "recipe",
                      "target": "mp_lesson_lighthouse_generator_refuel"
                    }
                  ],
                  "match": "all",
                  "requiredCount": 1,
                  "prerequisites": [
                    "repair"
                  ],
                  "optional": false,
                  "exclusiveGroup": "",
                  "availabilityConditions": [],
                  "revealConditions": [],
                  "mode": "achievement",
                  "retroactive": true,
                  "targetTurns": 5,
                  "interruption": "reset",
                  "deadlineTurns": 0,
                  "failureConditions": [],
                  "rewards": [],
                  "failureActions": [],
                  "completionText": "",
                  "failureText": "",
                  "linkedQuestId": "",
                  "linkedStageId": "",
                  "hintId": ""
                }
              },
              {
                "id": "operate",
                "label": "Operate the generator and power the gate",
                "type": "flag",
                "flagName": "",
                "flagValue": "true",
                "roomId": "",
                "roomName": "",
                "scoreTarget": 100,
                "countFlags": "",
                "prereqGoalId": "",
                "hidden": false,
                "tracking": {
                  "category": "build",
                  "group": "main",
                  "description": "This remembers actual operation, so you may switch the generator off after returning.",
                  "criteria": [
                    {
                      "kind": "flag",
                      "target": "mp_lesson_lighthouse_generator_powered",
                      "value": true
                    }
                  ],
                  "match": "all",
                  "requiredCount": 1,
                  "prerequisites": [
                    "refuel"
                  ],
                  "optional": false,
                  "exclusiveGroup": "",
                  "availabilityConditions": [],
                  "revealConditions": [],
                  "mode": "achievement",
                  "retroactive": true,
                  "targetTurns": 5,
                  "interruption": "reset",
                  "deadlineTurns": 0,
                  "failureConditions": [],
                  "rewards": [],
                  "failureActions": [],
                  "completionText": "",
                  "failureText": "",
                  "linkedQuestId": "",
                  "linkedStageId": "",
                  "hintId": ""
                }
              },
              {
                "id": "lens",
                "label": "Recover the signal lens upstairs",
                "type": "flag",
                "flagName": "",
                "flagValue": "true",
                "roomId": "",
                "roomName": "",
                "scoreTarget": 100,
                "countFlags": "",
                "prereqGoalId": "",
                "hidden": false,
                "tracking": {
                  "category": "collect",
                  "group": "main",
                  "description": "",
                  "criteria": [
                    {
                      "kind": "object_found",
                      "target": "lesson_signal_lens",
                      "targetKind": "object"
                    }
                  ],
                  "match": "all",
                  "requiredCount": 1,
                  "prerequisites": [
                    "operate"
                  ],
                  "optional": false,
                  "exclusiveGroup": "",
                  "availabilityConditions": [],
                  "revealConditions": [],
                  "mode": "achievement",
                  "retroactive": true,
                  "targetTurns": 5,
                  "interruption": "reset",
                  "deadlineTurns": 0,
                  "failureConditions": [],
                  "rewards": [],
                  "failureActions": [],
                  "completionText": "",
                  "failureText": "",
                  "linkedQuestId": "",
                  "linkedStageId": "",
                  "hintId": ""
                }
              },
              {
                "id": "delivery",
                "label": "Hand the lens to the keeper",
                "type": "flag",
                "flagName": "",
                "flagValue": "true",
                "roomId": "",
                "roomName": "",
                "scoreTarget": 100,
                "countFlags": "",
                "prereqGoalId": "",
                "hidden": false,
                "tracking": {
                  "category": "deliver",
                  "group": "main",
                  "description": "",
                  "criteria": [
                    {
                      "kind": "delivery",
                      "target": "lesson_signal_lens",
                      "secondary": "lesson_keeper",
                      "targetKind": "object"
                    }
                  ],
                  "match": "all",
                  "requiredCount": 1,
                  "prerequisites": [
                    "lens"
                  ],
                  "optional": false,
                  "exclusiveGroup": "",
                  "availabilityConditions": [],
                  "revealConditions": [],
                  "mode": "achievement",
                  "retroactive": true,
                  "targetTurns": 5,
                  "interruption": "reset",
                  "deadlineTurns": 0,
                  "failureConditions": [],
                  "rewards": [],
                  "failureActions": [],
                  "completionText": "",
                  "failureText": "",
                  "linkedQuestId": "",
                  "linkedStageId": "",
                  "hintId": ""
                }
              },
              {
                "id": "briefing",
                "label": "Read the workshop briefing",
                "type": "flag",
                "flagName": "",
                "flagValue": "true",
                "roomId": "",
                "roomName": "",
                "scoreTarget": 100,
                "countFlags": "",
                "prereqGoalId": "",
                "hidden": false,
                "tracking": {
                  "category": "investigate",
                  "group": "bonus",
                  "description": "",
                  "criteria": [
                    {
                      "kind": "fact",
                      "target": "lesson_briefing",
                      "event": "read",
                      "targetKind": "object"
                    }
                  ],
                  "match": "all",
                  "requiredCount": 1,
                  "prerequisites": [],
                  "optional": true,
                  "exclusiveGroup": "",
                  "availabilityConditions": [],
                  "revealConditions": [],
                  "mode": "achievement",
                  "retroactive": true,
                  "targetTurns": 5,
                  "interruption": "reset",
                  "deadlineTurns": 0,
                  "failureConditions": [],
                  "rewards": [],
                  "failureActions": [],
                  "completionText": "",
                  "failureText": "",
                  "linkedQuestId": "",
                  "linkedStageId": "",
                  "hintId": ""
                }
              }
            ],
            "onCompleteBody": "set lesson_workshop_complete = true\nprint \"Lighthouse service complete! Your real repair, fuel use, power connection and accepted lens delivery agree with the mission journal. You earn 100 points and 10 harbor coins. Restart to try running out of fuel, switching off early, or saving and loading.\"\nend_game",
            "settings": {
              "description": "Repair and operate the real generator, recover the signal lens, and make an accepted delivery to the keeper.",
              "pauseJournal": true,
              "notifications": true,
              "panelCollapsed": false,
              "completionConditions": [
                {
                  "kind": "room",
                  "target": "lesson_quay",
                  "operator": "==",
                  "value": true
                }
              ],
              "rewards": [
                {
                  "kind": "score",
                  "value": 100
                },
                {
                  "kind": "money",
                  "value": 10
                }
              ],
              "failureConditions": [],
              "failureActions": [],
              "failureText": ""
            }
          }
        },
        {
          "path": "manifest.story.states",
          "key": "mp_lesson_lighthouse_generator_repaired",
          "after": {
            "id": "mp_lesson_lighthouse_generator_repaired",
            "name": "Lighthouse backup generator (lesson_lighthouse_generator) — Repaired",
            "description": "Owned native dependency of this editable mechanic.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "mp_lesson_lighthouse_generator_powered",
          "after": {
            "id": "mp_lesson_lighthouse_generator_powered",
            "name": "Lighthouse backup generator (lesson_lighthouse_generator) — Powered",
            "description": "Owned native dependency of this editable mechanic.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "mp_lesson_lighthouse_noise_alerted",
          "after": {
            "id": "mp_lesson_lighthouse_noise_alerted",
            "name": "Generator noise and harmless watchman (lesson_lighthouse_noise) — Alarm active",
            "description": "Owned native dependency of this editable mechanic.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_workshop_complete",
          "after": {
            "id": "lesson_workshop_complete",
            "name": "Workshop complete",
            "description": "The workshop reached its completion.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.features.recipes",
          "key": "lesson_deliver_signal_lens",
          "after": {
            "id": "lesson_deliver_signal_lens",
            "name": "Accepted signal-lens delivery",
            "enabled": true,
            "verbs": [
              "give"
            ],
            "unordered": false,
            "inputs": [
              {
                "objectId": "lesson_signal_lens",
                "disposition": "transfer"
              }
            ],
            "tools": [],
            "target": {
              "kind": "npc",
              "id": "lesson_keeper"
            },
            "roomId": "lesson_quay",
            "match": "all",
            "conditions": [],
            "actions": [],
            "once": true,
            "success": "The keeper accepts the signal lens and records the completed service.",
            "failure": "Carry the signal lens back to the quay and give it to the keeper.",
            "repeat": "The keeper has already accepted the lens."
          }
        },
        {
          "path": "manifest.story.features.recipes",
          "key": "mp_lesson_lighthouse_generator_repair",
          "after": {
            "id": "mp_lesson_lighthouse_generator_repair",
            "name": "Lighthouse backup generator — Install the repair fuse",
            "enabled": true,
            "mechanicId": "lesson_lighthouse_generator",
            "verbs": [
              "use"
            ],
            "unordered": false,
            "inputs": [
              {
                "objectId": "lesson_brass_fuse",
                "disposition": "consume"
              }
            ],
            "tools": [],
            "target": {
              "kind": "object",
              "id": "lesson_generator"
            },
            "match": "all",
            "conditions": [],
            "actions": [
              {
                "kind": "state",
                "target": "mp_lesson_lighthouse_generator_repaired",
                "value": true
              }
            ],
            "once": true,
            "success": "The fuse seats with a firm click. The machine is repaired.",
            "failure": "Carry the required item and tools, and use them with the selected target.",
            "repeat": "That interaction is already complete."
          }
        },
        {
          "path": "manifest.story.features.recipes",
          "key": "mp_lesson_lighthouse_generator_refuel",
          "after": {
            "id": "mp_lesson_lighthouse_generator_refuel",
            "name": "Lighthouse backup generator — Refuel the machine",
            "enabled": true,
            "mechanicId": "lesson_lighthouse_generator",
            "verbs": [
              "use"
            ],
            "unordered": false,
            "inputs": [
              {
                "objectId": "lesson_fuel_can",
                "disposition": "consume"
              }
            ],
            "tools": [],
            "target": {
              "kind": "object",
              "id": "lesson_generator"
            },
            "match": "all",
            "conditions": [
              {
                "kind": "state",
                "target": "mp_lesson_lighthouse_generator_repaired",
                "operator": "==",
                "value": true
              }
            ],
            "actions": [],
            "once": false,
            "success": "You pour the fuel into the repaired machine.",
            "failure": "Carry the required item and tools, and use them with the selected target.",
            "repeat": "That interaction is already complete."
          }
        },
        {
          "path": "manifest.story.features.mechanics",
          "key": "lesson_lighthouse_generator",
          "after": {
            "version": 1,
            "id": "lesson_lighthouse_generator",
            "name": "Lighthouse backup generator",
            "description": "Repair a machine with a real fuse, refuel it through a native Recipe, switch it on, consume operating fuel, and power a connected gate.",
            "category": "Devices",
            "enabled": true,
            "autoStart": true,
            "inputs": [
              {
                "id": "machine",
                "name": "Machine control",
                "kind": "object",
                "required": true,
                "value": "lesson_generator"
              },
              {
                "id": "fuse",
                "name": "Repair fuse / material",
                "kind": "object",
                "required": true,
                "value": "lesson_brass_fuse"
              },
              {
                "id": "fuel",
                "name": "Fuel item",
                "kind": "object",
                "required": true,
                "value": "lesson_fuel_can"
              },
              {
                "id": "gate",
                "name": "Powered gate",
                "kind": "object",
                "required": true,
                "value": "lesson_safety_gate"
              },
              {
                "id": "fuelUnits",
                "name": "Operating turns per fuel item",
                "kind": "number",
                "required": true,
                "value": 8,
                "min": 1,
                "max": 1000
              }
            ],
            "variables": [
              {
                "id": "fuel",
                "name": "Fuel",
                "type": "number",
                "initial": 0,
                "min": 0,
                "max": 1000,
                "showInPlayer": true,
                "suffix": "turns"
              }
            ],
            "scope": {
              "kind": "global",
              "rooms": []
            },
            "initialPhase": "broken",
            "phases": [
              {
                "id": "broken",
                "name": "Broken",
                "onEnter": [
                  {
                    "kind": "state",
                    "target": "mp_lesson_lighthouse_generator_powered",
                    "value": false
                  }
                ],
                "onExit": []
              },
              {
                "id": "off",
                "name": "Off",
                "onEnter": [
                  {
                    "kind": "state",
                    "target": "mp_lesson_lighthouse_generator_powered",
                    "value": false
                  },
                  {
                    "kind": "object_state",
                    "target": "$gate",
                    "property": "locked",
                    "value": true
                  }
                ],
                "onExit": []
              },
              {
                "id": "running",
                "name": "Running",
                "onEnter": [
                  {
                    "kind": "state",
                    "target": "mp_lesson_lighthouse_generator_powered",
                    "value": true
                  },
                  {
                    "kind": "object_state",
                    "target": "$gate",
                    "property": "locked",
                    "value": false
                  },
                  {
                    "kind": "message",
                    "value": "The machine starts. Its connected gate is powered."
                  }
                ],
                "onExit": [
                  {
                    "kind": "state",
                    "target": "mp_lesson_lighthouse_generator_powered",
                    "value": false
                  },
                  {
                    "kind": "object_state",
                    "target": "$gate",
                    "property": "locked",
                    "value": true
                  }
                ]
              }
            ],
            "rules": [
              {
                "id": "already_repaired",
                "name": "Remember the actual world repair after a counter reset",
                "enabled": true,
                "trigger": {
                  "kind": "start",
                  "target": "",
                  "event": ""
                },
                "conditions": {
                  "match": "all",
                  "conditions": [
                    {
                      "kind": "flag",
                      "target": "mp_lesson_lighthouse_generator_repaired",
                      "operator": "==",
                      "value": true
                    }
                  ]
                },
                "actions": [
                  {
                    "kind": "phase",
                    "target": "off"
                  }
                ],
                "otherwise": [],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 0,
                "probability": 1,
                "priority": 0,
                "phase": "broken"
              },
              {
                "id": "repair",
                "name": "Observe the accepted repair Recipe",
                "enabled": true,
                "trigger": {
                  "kind": "fact",
                  "target": "mp_lesson_lighthouse_generator_repair",
                  "event": "recipe"
                },
                "conditions": {
                  "match": "all",
                  "conditions": []
                },
                "actions": [
                  {
                    "kind": "phase",
                    "target": "off"
                  },
                  {
                    "kind": "message",
                    "value": "The machine is repaired. Add fuel, then USE the machine."
                  }
                ],
                "otherwise": [],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 0,
                "probability": 1,
                "priority": 0,
                "phase": "broken"
              },
              {
                "id": "refuel",
                "name": "Accept fuel consumed by the native Recipe",
                "enabled": true,
                "trigger": {
                  "kind": "fact",
                  "target": "mp_lesson_lighthouse_generator_refuel",
                  "event": "recipe"
                },
                "conditions": {
                  "match": "all",
                  "conditions": []
                },
                "actions": [
                  {
                    "kind": "local",
                    "target": "fuel",
                    "operation": "add",
                    "value": {
                      "input": "fuelUnits"
                    }
                  },
                  {
                    "kind": "message",
                    "value": "Fuel is added. Remaining fuel: {{variable:fuel}} operating turns."
                  }
                ],
                "otherwise": [],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 0,
                "probability": 1,
                "priority": 0
              },
              {
                "id": "start",
                "name": "Start the repaired machine",
                "enabled": true,
                "trigger": {
                  "kind": "object",
                  "target": "$machine",
                  "event": "use"
                },
                "conditions": {
                  "match": "all",
                  "conditions": [
                    {
                      "kind": "event",
                      "field": "secondary",
                      "operator": "==",
                      "value": ""
                    },
                    {
                      "match": "all",
                      "conditions": [
                        {
                          "kind": "local",
                          "target": "fuel",
                          "operator": ">",
                          "value": 0
                        }
                      ]
                    }
                  ]
                },
                "actions": [
                  {
                    "kind": "phase",
                    "target": "running"
                  }
                ],
                "otherwise": [
                  {
                    "kind": "message",
                    "value": "The machine needs fuel. Carry the fuel item and USE it WITH the machine."
                  }
                ],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 0,
                "probability": 1,
                "priority": 0,
                "phase": "off"
              },
              {
                "id": "stop",
                "name": "Switch off a running machine",
                "enabled": true,
                "trigger": {
                  "kind": "object",
                  "target": "$machine",
                  "event": "use"
                },
                "conditions": {
                  "match": "all",
                  "conditions": [
                    {
                      "kind": "event",
                      "field": "secondary",
                      "operator": "==",
                      "value": ""
                    },
                    {
                      "match": "all",
                      "conditions": []
                    }
                  ]
                },
                "actions": [
                  {
                    "kind": "phase",
                    "target": "off"
                  },
                  {
                    "kind": "message",
                    "value": "You switch the machine off."
                  }
                ],
                "otherwise": [],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 0,
                "probability": 1,
                "priority": 0,
                "phase": "running"
              },
              {
                "id": "broken",
                "name": "Explain the missing repair",
                "enabled": true,
                "trigger": {
                  "kind": "object",
                  "target": "$machine",
                  "event": "use"
                },
                "conditions": {
                  "match": "all",
                  "conditions": [
                    {
                      "kind": "event",
                      "field": "secondary",
                      "operator": "==",
                      "value": ""
                    },
                    {
                      "match": "all",
                      "conditions": []
                    }
                  ]
                },
                "actions": [
                  {
                    "kind": "message",
                    "value": "The machine needs its fuse / repair material. Carry it and USE it WITH the machine."
                  }
                ],
                "otherwise": [],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 0,
                "probability": 1,
                "priority": 0,
                "phase": "broken"
              },
              {
                "id": "burn",
                "name": "Consume fuel on each operating turn",
                "enabled": true,
                "trigger": {
                  "kind": "turn",
                  "target": "",
                  "event": ""
                },
                "conditions": {
                  "match": "all",
                  "conditions": []
                },
                "actions": [
                  {
                    "kind": "local",
                    "target": "fuel",
                    "operation": "subtract",
                    "value": 1
                  }
                ],
                "otherwise": [],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 0,
                "probability": 1,
                "priority": 10,
                "phase": "running"
              },
              {
                "id": "exhausted",
                "name": "Stop when fuel is exhausted",
                "enabled": true,
                "trigger": {
                  "kind": "turn",
                  "target": "",
                  "event": ""
                },
                "conditions": {
                  "match": "all",
                  "conditions": [
                    {
                      "kind": "local",
                      "target": "fuel",
                      "operator": "<=",
                      "value": 0
                    }
                  ]
                },
                "actions": [
                  {
                    "kind": "phase",
                    "target": "off"
                  },
                  {
                    "kind": "message",
                    "value": "The fuel runs out. The machine stops and its gate loses power."
                  }
                ],
                "otherwise": [],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 0,
                "probability": 1,
                "priority": 0,
                "phase": "running"
              }
            ],
            "sourcePreset": "powered_machine",
            "notes": "A machine, fuse, fuel item, and controlled gate.\nCarry the fuse or fuel; USE FUSE WITH MACHINE / USE FUEL WITH MACHINE.\nPause freezes the operating clock while retaining current power; terminal controls stop power and lock its gate. Reset changes local clocks/resources without recreating consumed world items. This package adds native repair/refuel Recipes and two named story states. Link exits or Objectives to mp_lighthouse_generator_powered. Active turns include the command that starts the machine.",
            "onControl": {
              "disable": [
                {
                  "kind": "state",
                  "target": "mp_lesson_lighthouse_generator_powered",
                  "value": false
                },
                {
                  "kind": "object_state",
                  "target": "$gate",
                  "property": "locked",
                  "value": true
                },
                {
                  "kind": "phase",
                  "target": "off"
                }
              ],
              "complete": [
                {
                  "kind": "state",
                  "target": "mp_lesson_lighthouse_generator_powered",
                  "value": false
                },
                {
                  "kind": "object_state",
                  "target": "$gate",
                  "property": "locked",
                  "value": true
                },
                {
                  "kind": "phase",
                  "target": "off"
                }
              ],
              "fail": [
                {
                  "kind": "state",
                  "target": "mp_lesson_lighthouse_generator_powered",
                  "value": false
                },
                {
                  "kind": "object_state",
                  "target": "$gate",
                  "property": "locked",
                  "value": true
                },
                {
                  "kind": "phase",
                  "target": "off"
                }
              ],
              "reset": [
                {
                  "kind": "state",
                  "target": "mp_lesson_lighthouse_generator_powered",
                  "value": false
                },
                {
                  "kind": "object_state",
                  "target": "$gate",
                  "property": "locked",
                  "value": true
                },
                {
                  "kind": "phase",
                  "target": "broken"
                }
              ]
            }
          }
        },
        {
          "path": "manifest.story.features.mechanics",
          "key": "lesson_lighthouse_lift",
          "after": {
            "version": 1,
            "id": "lesson_lighthouse_lift",
            "name": "Powered lift and emergency return",
            "description": "Two controls connect origin and destination, with a guarded optional fare in both directions. Insufficient funds leave the player in place.",
            "category": "Travel",
            "enabled": true,
            "autoStart": true,
            "inputs": [
              {
                "id": "origin",
                "name": "Origin room",
                "kind": "room",
                "required": true,
                "value": "lesson_powerhouse"
              },
              {
                "id": "destination",
                "name": "Destination room",
                "kind": "room",
                "required": true,
                "value": "lesson_gallery"
              },
              {
                "id": "outbound",
                "name": "Outbound control",
                "kind": "object",
                "required": true,
                "value": "lesson_lift_control"
              },
              {
                "id": "inbound",
                "name": "Return control",
                "kind": "object",
                "required": true,
                "value": "lesson_return_lever"
              },
              {
                "id": "fare",
                "name": "Fare per trip",
                "kind": "number",
                "required": true,
                "value": 0,
                "min": 0,
                "max": 1000000
              }
            ],
            "variables": [
              {
                "id": "fare",
                "name": "Configured fare",
                "type": "number",
                "initial": "$fare",
                "min": 0,
                "max": 1000000
              }
            ],
            "scope": {
              "kind": "global",
              "rooms": []
            },
            "initialPhase": "",
            "phases": [],
            "rules": [
              {
                "id": "outbound",
                "name": "Travel from origin",
                "enabled": true,
                "trigger": {
                  "kind": "object",
                  "target": "$outbound",
                  "event": "use"
                },
                "conditions": {
                  "match": "all",
                  "conditions": [
                    {
                      "kind": "event",
                      "field": "secondary",
                      "operator": "==",
                      "value": ""
                    },
                    {
                      "match": "all",
                      "conditions": [
                        {
                          "kind": "objective",
                          "criterion": {
                            "kind": "room_current",
                            "target": "$origin",
                            "targetKind": "room"
                          }
                        },
                        {
                          "match": "any",
                          "conditions": [
                            {
                              "kind": "local",
                              "target": "fare",
                              "operator": "==",
                              "value": 0
                            },
                            {
                              "kind": "flag",
                              "target": "money",
                              "operator": ">=",
                              "value": "$fare"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "kind": "flag",
                      "target": "mp_lesson_lighthouse_generator_powered",
                      "operator": "==",
                      "value": true
                    }
                  ]
                },
                "actions": [
                  {
                    "kind": "currency",
                    "operation": "subtract",
                    "value": {
                      "input": "fare"
                    }
                  },
                  {
                    "kind": "goto",
                    "target": "$destination"
                  },
                  {
                    "kind": "message",
                    "value": "You arrive at the destination."
                  }
                ],
                "otherwise": [
                  {
                    "kind": "message",
                    "value": "The lift has no power. Repair and fuel the generator, then USE GENERATOR."
                  }
                ],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 0,
                "probability": 1,
                "priority": 0
              },
              {
                "id": "inbound",
                "name": "Return to the origin",
                "enabled": true,
                "trigger": {
                  "kind": "object",
                  "target": "$inbound",
                  "event": "use"
                },
                "conditions": {
                  "match": "all",
                  "conditions": [
                    {
                      "kind": "event",
                      "field": "secondary",
                      "operator": "==",
                      "value": ""
                    },
                    {
                      "match": "all",
                      "conditions": [
                        {
                          "kind": "objective",
                          "criterion": {
                            "kind": "room_current",
                            "target": "$destination",
                            "targetKind": "room"
                          }
                        },
                        {
                          "match": "any",
                          "conditions": [
                            {
                              "kind": "local",
                              "target": "fare",
                              "operator": "==",
                              "value": 0
                            },
                            {
                              "kind": "flag",
                              "target": "money",
                              "operator": ">=",
                              "value": "$fare"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                "actions": [
                  {
                    "kind": "currency",
                    "operation": "subtract",
                    "value": {
                      "input": "fare"
                    }
                  },
                  {
                    "kind": "goto",
                    "target": "$origin"
                  },
                  {
                    "kind": "message",
                    "value": "You return to the origin."
                  }
                ],
                "otherwise": [
                  {
                    "kind": "message",
                    "value": "The return route is unavailable here, or you cannot afford its fare."
                  }
                ],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 0,
                "probability": 1,
                "priority": 0
              }
            ],
            "sourcePreset": "transport",
            "notes": "Origin and destination rooms, each with its own usable control.\nSet fare to zero for free travel. A positive fare requires player currency."
          }
        },
        {
          "path": "manifest.story.features.mechanics",
          "key": "lesson_lighthouse_noise",
          "after": {
            "version": 1,
            "id": "lesson_lighthouse_noise",
            "name": "Generator noise and harmless watchman",
            "description": "Suspicion rises in a selected guarded room. A worn disguise prevents detection; a real distraction item reduces suspicion. Detection uses saved seeded chance.",
            "category": "NPC & Stealth",
            "enabled": true,
            "autoStart": true,
            "inputs": [
              {
                "id": "zone",
                "name": "Guarded room",
                "kind": "room",
                "required": true,
                "value": "lesson_powerhouse"
              },
              {
                "id": "guard",
                "name": "Guard NPC",
                "kind": "npc",
                "required": true,
                "value": "lesson_watchman"
              },
              {
                "id": "disguise",
                "name": "Protective disguise",
                "kind": "object",
                "required": true,
                "value": "lesson_worker_jacket"
              },
              {
                "id": "distraction",
                "name": "Consumable distraction",
                "kind": "object",
                "required": true,
                "value": "lesson_windup_toy"
              },
              {
                "id": "threshold",
                "name": "Suspicion threshold",
                "kind": "number",
                "required": true,
                "value": 2,
                "min": 1,
                "max": 100
              }
            ],
            "variables": [
              {
                "id": "noise",
                "name": "Suspicion",
                "type": "number",
                "initial": 0,
                "min": 0,
                "max": 100,
                "showInPlayer": true
              },
              {
                "id": "threshold",
                "name": "Detection threshold",
                "type": "number",
                "initial": "$threshold",
                "min": 1,
                "max": 100
              }
            ],
            "scope": {
              "kind": "rooms",
              "rooms": [
                "$zone"
              ]
            },
            "initialPhase": "hidden",
            "phases": [
              {
                "id": "hidden",
                "name": "Hidden",
                "onEnter": [],
                "onExit": []
              },
              {
                "id": "alerted",
                "name": "Alerted",
                "onEnter": [
                  {
                    "kind": "state",
                    "target": "mp_lesson_lighthouse_noise_alerted",
                    "value": true
                  },
                  {
                    "kind": "message",
                    "value": "The guard detects you. The alarm state is now active."
                  }
                ],
                "onExit": []
              }
            ],
            "rules": [
              {
                "id": "noise",
                "name": "Movement and activity raise suspicion",
                "enabled": true,
                "trigger": {
                  "kind": "turn",
                  "target": "",
                  "event": ""
                },
                "conditions": {
                  "match": "all",
                  "conditions": [
                    {
                      "kind": "flag",
                      "target": "mp_lesson_lighthouse_generator_powered",
                      "operator": "==",
                      "value": true
                    }
                  ]
                },
                "actions": [
                  {
                    "kind": "local",
                    "target": "noise",
                    "operation": "add",
                    "value": 1
                  }
                ],
                "otherwise": [],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 0,
                "probability": 1,
                "priority": 20
              },
              {
                "id": "detect",
                "name": "A nearby living guard may detect you",
                "enabled": true,
                "trigger": {
                  "kind": "turn",
                  "target": "",
                  "event": ""
                },
                "conditions": {
                  "match": "all",
                  "conditions": [
                    {
                      "kind": "local",
                      "target": "noise",
                      "operator": ">=",
                      "value": "@threshold"
                    },
                    {
                      "kind": "objective",
                      "criterion": {
                        "kind": "npc_at",
                        "target": "$guard",
                        "secondary": "$zone",
                        "targetKind": "npc"
                      }
                    },
                    {
                      "match": "not",
                      "conditions": [
                        {
                          "kind": "objective",
                          "criterion": {
                            "kind": "object_worn",
                            "target": "$disguise",
                            "targetKind": "object"
                          }
                        }
                      ]
                    },
                    {
                      "kind": "flag",
                      "target": "mp_lesson_lighthouse_generator_powered",
                      "operator": "==",
                      "value": true
                    }
                  ]
                },
                "actions": [
                  {
                    "kind": "phase",
                    "target": "alerted"
                  }
                ],
                "otherwise": [],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 2,
                "maxUses": 0,
                "probability": 0.35,
                "priority": 0,
                "phase": "hidden"
              },
              {
                "id": "distract",
                "name": "Use a real distraction item",
                "enabled": true,
                "trigger": {
                  "kind": "object",
                  "target": "$distraction",
                  "event": "use"
                },
                "conditions": {
                  "match": "all",
                  "conditions": [
                    {
                      "kind": "event",
                      "field": "secondary",
                      "operator": "==",
                      "value": ""
                    },
                    {
                      "match": "all",
                      "conditions": [
                        {
                          "kind": "objective",
                          "criterion": {
                            "kind": "object_possessed",
                            "target": "$distraction",
                            "targetKind": "object"
                          }
                        }
                      ]
                    }
                  ]
                },
                "actions": [
                  {
                    "kind": "consume",
                    "target": "$distraction"
                  },
                  {
                    "kind": "local",
                    "target": "noise",
                    "operation": "set",
                    "value": 0
                  },
                  {
                    "kind": "state",
                    "target": "mp_lesson_lighthouse_noise_alerted",
                    "value": false
                  },
                  {
                    "kind": "phase",
                    "target": "hidden"
                  },
                  {
                    "kind": "message",
                    "value": "The distraction draws attention away. Suspicion returns to zero."
                  }
                ],
                "otherwise": [
                  {
                    "kind": "message",
                    "value": "Carry the distraction item before using it."
                  }
                ],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 0,
                "probability": 1,
                "priority": 0
              }
            ],
            "sourcePreset": "stealth_noise",
            "notes": "One guarded room, a living guard there, a wearable disguise, and a usable distraction item.\nThe shared alarm state mp_lighthouse_noise_alerted can trigger an existing Security World Event. NPC movement stays with native routines; this preset never teleports the guard."
          }
        },
        {
          "path": "manifest.playerConfig.moneyEnabled",
          "key": "$value",
          "after": true
        },
        {
          "path": "manifest.playerConfig.startingMoney",
          "key": "$value",
          "after": 0
        },
        {
          "path": "manifest.story.features.commandContext",
          "key": "$value",
          "after": true
        }
      ]
    }
  ],
  "creatorNotes": "Repair and fuel a generator, turn it on and use the powered lift to collect a lens. Return safely and deliver the lens to the keeper. Fuel runs down only while the machine is on; the return lever always works. Open this recipe in Help to inspect its saved settings.",
  "mapRooms": [
    {
      "id": "lesson_quay",
      "name": "Lighthouse Quay",
      "narrative": "The keeper needs a signal lens from the lighthouse gallery. A safe workshop waits NORTH. TAKE WORKER JACKET and WEAR WORKER JACKET if you want the harmless watchman to ignore you. Repair and fuel the generator, use the powered lift, then bring the lens back here. OBJECTIVES and HINT explain the route. This workshop has no hostile enemies.",
      "description": "A worker jacket hangs beside the keeper. The powerhouse is north.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "TAKE WORKER JACKET, WEAR WORKER JACKET, then go NORTH and READ BRIEFING.",
      "dark": false,
      "roomType": "regular",
      "x": 100,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    },
    {
      "id": "lesson_powerhouse",
      "name": "Lighthouse Powerhouse",
      "description": "The generator, safety gate and lift control share one circuit. A brass fuse, fuel can, windup toy and briefing are within reach. The quay is south.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "TAKE BRASS FUSE and TAKE FUEL CAN. USE BRASS FUSE WITH GENERATOR, then USE FUEL CAN WITH GENERATOR. USE GENERATOR starts it. USE LIFT CONTROL goes upstairs while power lasts.",
      "dark": false,
      "roomType": "regular",
      "x": 320,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    },
    {
      "id": "lesson_gallery",
      "name": "Upper Signal Gallery",
      "description": "The spare signal lens rests beside an emergency return lever. The return is mechanical and always works.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "TAKE SIGNAL LENS, then USE RETURN LEVER. You can also go DOWN. Switch off the generator to save fuel, go SOUTH, and GIVE SIGNAL LENS TO KEEPER.",
      "dark": false,
      "roomType": "regular",
      "x": 540,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    }
  ],
  "mapExits": [
    {
      "id": "lesson_route_connection_0",
      "fromRoom": "lesson_quay",
      "toRoom": "lesson_powerhouse",
      "direction": "north",
      "locked": false
    },
    {
      "id": "lesson_route_connection_1",
      "fromRoom": "lesson_powerhouse",
      "toRoom": "lesson_quay",
      "direction": "south",
      "locked": false
    },
    {
      "id": "lesson_route_connection_2",
      "fromRoom": "lesson_powerhouse",
      "toRoom": "lesson_gallery",
      "direction": "up",
      "locked": false,
      "when": "mp_lesson_lighthouse_generator_powered"
    },
    {
      "id": "lesson_route_connection_3",
      "fromRoom": "lesson_gallery",
      "toRoom": "lesson_powerhouse",
      "direction": "down",
      "locked": false
    }
  ],
  "objects": [
    {
      "id": "lesson_worker_jacket",
      "name": "worker jacket",
      "description": "A lighthouse worker jacket. WEAR WORKER JACKET to keep the harmless watchman from identifying you as an unfamiliar visitor.",
      "article": "",
      "location": "lesson_quay",
      "aliases": [
        "jacket",
        "coat",
        "worker jacket"
      ],
      "visible": true,
      "takeable": true,
      "droppable": true,
      "useGive": false,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": true,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": []
    },
    {
      "id": "lesson_brass_fuse",
      "name": "brass fuse",
      "description": "A replacement brass fuse. Carry it, then USE BRASS FUSE WITH GENERATOR.",
      "article": "",
      "location": "lesson_powerhouse",
      "aliases": [
        "fuse",
        "brass fuse"
      ],
      "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_fuel_can",
      "name": "fuel can",
      "description": "One measured can of fuel provides eight operating turns. Carry it, then USE FUEL CAN WITH GENERATOR after repairing the generator.",
      "article": "",
      "location": "lesson_powerhouse",
      "aliases": [
        "fuel",
        "can",
        "fuel can"
      ],
      "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_generator",
      "name": "generator",
      "description": "A compact backup generator with an empty fuse holder and fuel tank. Repair it, refuel it, and USE GENERATOR to switch it on or off.",
      "article": "",
      "location": "lesson_powerhouse",
      "aliases": [
        "machine",
        "generator"
      ],
      "visible": true,
      "takeable": false,
      "droppable": false,
      "useGive": true,
      "container": false,
      "switchable": true,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": []
    },
    {
      "id": "lesson_safety_gate",
      "name": "safety gate",
      "description": "An electrical latch unlocks while the generator is powered. The lift control uses the same power state.",
      "article": "",
      "location": "lesson_powerhouse",
      "aliases": [
        "gate",
        "safety gate"
      ],
      "visible": true,
      "takeable": false,
      "droppable": false,
      "useGive": false,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": true,
      "lockKey": "",
      "events": []
    },
    {
      "id": "lesson_lift_control",
      "name": "lift control",
      "description": "USE LIFT CONTROL to reach the upper gallery while the generator is powered.",
      "article": "",
      "location": "lesson_powerhouse",
      "aliases": [
        "lift",
        "elevator",
        "lift control"
      ],
      "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_return_lever",
      "name": "return lever",
      "description": "An emergency mechanical return. USE RETURN LEVER to return to the powerhouse even if generator power has failed.",
      "article": "",
      "location": "lesson_gallery",
      "aliases": [
        "lever",
        "return control",
        "return lever"
      ],
      "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_signal_lens",
      "name": "signal lens",
      "description": "The spare signal lens requested by the keeper. Bring it back to the quay and give it to the keeper.",
      "article": "",
      "location": "lesson_gallery",
      "aliases": [
        "lens",
        "signal lens"
      ],
      "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_windup_toy",
      "name": "windup toy",
      "description": "A harmless windup distraction. Carry it and USE WINDUP TOY at the powerhouse to reduce suspicion. The toy is consumed when used.",
      "article": "",
      "location": "lesson_powerhouse",
      "aliases": [
        "toy",
        "distraction",
        "windup toy"
      ],
      "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_briefing",
      "name": "briefing",
      "description": "LIGHTHOUSE POWER WORKSHOP: Take and wear the worker jacket at the quay if you want the watchman to ignore you. At the powerhouse TAKE BRASS FUSE and TAKE FUEL CAN. USE BRASS FUSE WITH GENERATOR repairs it. USE FUEL CAN WITH GENERATOR adds eight operating turns of fuel. USE GENERATOR switches it on; USE LIFT CONTROL takes you upstairs while power is on. TAKE SIGNAL LENS, USE RETURN LEVER, and USE GENERATOR to switch the generator off and save fuel. Go SOUTH and GIVE SIGNAL LENS TO KEEPER. The machine consumes fuel only while running and automatically stops at zero. The emergency return lever always works, so power loss cannot trap you upstairs. OBJECTIVES, HINT and the Mechanics status panel explain progress. This is a safe workshop: the watchman raises an alarm state but never attacks.",
      "article": "",
      "location": "lesson_powerhouse",
      "aliases": [
        "instructions",
        "note",
        "briefing"
      ],
      "visible": true,
      "takeable": false,
      "droppable": false,
      "useGive": false,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": [
        {
          "id": "read",
          "event": "read",
          "withTarget": "",
          "body": "print \"LIGHTHOUSE POWER WORKSHOP: Take and wear the worker jacket at the quay if you want the watchman to ignore you. At the powerhouse TAKE BRASS FUSE and TAKE FUEL CAN. USE BRASS FUSE WITH GENERATOR repairs it. USE FUEL CAN WITH GENERATOR adds eight operating turns of fuel. USE GENERATOR switches it on; USE LIFT CONTROL takes you upstairs while power is on. TAKE SIGNAL LENS, USE RETURN LEVER, and USE GENERATOR to switch the generator off and save fuel. Go SOUTH and GIVE SIGNAL LENS TO KEEPER. The machine consumes fuel only while running and automatically stops at zero. The emergency return lever always works, so power loss cannot trap you upstairs. OBJECTIVES, HINT and the Mechanics status panel explain progress. This is a safe workshop: the watchman raises an alarm state but never attacks.\""
        }
      ]
    }
  ],
  "npcs": [
    {
      "id": "lesson_keeper",
      "name": "keeper",
      "description": "The lighthouse keeper needs the signal lens from the upper gallery.",
      "location": "lesson_quay",
      "mobile": false,
      "aliases": [
        "lighthouse keeper",
        "keeper"
      ],
      "onEnter": "",
      "onExamine": "",
      "onTalk": "print \"Please repair and fuel the generator, retrieve the signal lens upstairs, then bring it back to me. The emergency return always works.\"",
      "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": [
        {
          "id": "default",
          "trigger": "default",
          "body": "print \"keeper looks at you in silence.\""
        }
      ]
    },
    {
      "id": "lesson_watchman",
      "name": "watchman",
      "description": "A harmless watchman notices unfamiliar visitors when the generator makes noise. The worker jacket is a recognizable disguise.",
      "location": "lesson_powerhouse",
      "mobile": false,
      "aliases": [
        "guard",
        "watchman"
      ],
      "onEnter": "",
      "onExamine": "",
      "onTalk": "print \"Wear your worker jacket around operating equipment. I only raise an alarm; this workshop has no combat.\"",
      "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": [
        {
          "id": "default",
          "trigger": "default",
          "body": "print \"watchman looks at you in silence.\""
        }
      ]
    }
  ],
  "activeMechanics": [],
  "verbAliases": [],
  "scripts": [],
  "worldEvents": [],
  "customMechanicDefs": [],
  "savedMechanicTemplates": [],
  "objectiveSets": [
    {
      "id": "lesson_lighthouse_service",
      "name": "Lighthouse service",
      "playerLabel": "Restore the lighthouse service",
      "commands": "objectives journal logbook",
      "showInExport": true,
      "goals": [
        {
          "id": "repair",
          "label": "Repair the generator with its fuse",
          "type": "flag",
          "flagName": "",
          "flagValue": "true",
          "roomId": "",
          "roomName": "",
          "scoreTarget": 100,
          "countFlags": "",
          "prereqGoalId": "",
          "hidden": false,
          "tracking": {
            "category": "build",
            "group": "main",
            "description": "",
            "criteria": [
              {
                "kind": "recipe",
                "target": "mp_lesson_lighthouse_generator_repair"
              }
            ],
            "match": "all",
            "requiredCount": 1,
            "prerequisites": [],
            "optional": false,
            "exclusiveGroup": "",
            "availabilityConditions": [],
            "revealConditions": [],
            "mode": "achievement",
            "retroactive": true,
            "targetTurns": 5,
            "interruption": "reset",
            "deadlineTurns": 0,
            "failureConditions": [],
            "rewards": [],
            "failureActions": [],
            "completionText": "",
            "failureText": "",
            "linkedQuestId": "",
            "linkedStageId": "",
            "hintId": ""
          }
        },
        {
          "id": "refuel",
          "label": "Refuel the repaired generator",
          "type": "flag",
          "flagName": "",
          "flagValue": "true",
          "roomId": "",
          "roomName": "",
          "scoreTarget": 100,
          "countFlags": "",
          "prereqGoalId": "",
          "hidden": false,
          "tracking": {
            "category": "build",
            "group": "main",
            "description": "",
            "criteria": [
              {
                "kind": "recipe",
                "target": "mp_lesson_lighthouse_generator_refuel"
              }
            ],
            "match": "all",
            "requiredCount": 1,
            "prerequisites": [
              "repair"
            ],
            "optional": false,
            "exclusiveGroup": "",
            "availabilityConditions": [],
            "revealConditions": [],
            "mode": "achievement",
            "retroactive": true,
            "targetTurns": 5,
            "interruption": "reset",
            "deadlineTurns": 0,
            "failureConditions": [],
            "rewards": [],
            "failureActions": [],
            "completionText": "",
            "failureText": "",
            "linkedQuestId": "",
            "linkedStageId": "",
            "hintId": ""
          }
        },
        {
          "id": "operate",
          "label": "Operate the generator and power the gate",
          "type": "flag",
          "flagName": "",
          "flagValue": "true",
          "roomId": "",
          "roomName": "",
          "scoreTarget": 100,
          "countFlags": "",
          "prereqGoalId": "",
          "hidden": false,
          "tracking": {
            "category": "build",
            "group": "main",
            "description": "This remembers actual operation, so you may switch the generator off after returning.",
            "criteria": [
              {
                "kind": "flag",
                "target": "mp_lesson_lighthouse_generator_powered",
                "value": true
              }
            ],
            "match": "all",
            "requiredCount": 1,
            "prerequisites": [
              "refuel"
            ],
            "optional": false,
            "exclusiveGroup": "",
            "availabilityConditions": [],
            "revealConditions": [],
            "mode": "achievement",
            "retroactive": true,
            "targetTurns": 5,
            "interruption": "reset",
            "deadlineTurns": 0,
            "failureConditions": [],
            "rewards": [],
            "failureActions": [],
            "completionText": "",
            "failureText": "",
            "linkedQuestId": "",
            "linkedStageId": "",
            "hintId": ""
          }
        },
        {
          "id": "lens",
          "label": "Recover the signal lens upstairs",
          "type": "flag",
          "flagName": "",
          "flagValue": "true",
          "roomId": "",
          "roomName": "",
          "scoreTarget": 100,
          "countFlags": "",
          "prereqGoalId": "",
          "hidden": false,
          "tracking": {
            "category": "collect",
            "group": "main",
            "description": "",
            "criteria": [
              {
                "kind": "object_found",
                "target": "lesson_signal_lens",
                "targetKind": "object"
              }
            ],
            "match": "all",
            "requiredCount": 1,
            "prerequisites": [
              "operate"
            ],
            "optional": false,
            "exclusiveGroup": "",
            "availabilityConditions": [],
            "revealConditions": [],
            "mode": "achievement",
            "retroactive": true,
            "targetTurns": 5,
            "interruption": "reset",
            "deadlineTurns": 0,
            "failureConditions": [],
            "rewards": [],
            "failureActions": [],
            "completionText": "",
            "failureText": "",
            "linkedQuestId": "",
            "linkedStageId": "",
            "hintId": ""
          }
        },
        {
          "id": "delivery",
          "label": "Hand the lens to the keeper",
          "type": "flag",
          "flagName": "",
          "flagValue": "true",
          "roomId": "",
          "roomName": "",
          "scoreTarget": 100,
          "countFlags": "",
          "prereqGoalId": "",
          "hidden": false,
          "tracking": {
            "category": "deliver",
            "group": "main",
            "description": "",
            "criteria": [
              {
                "kind": "delivery",
                "target": "lesson_signal_lens",
                "secondary": "lesson_keeper",
                "targetKind": "object"
              }
            ],
            "match": "all",
            "requiredCount": 1,
            "prerequisites": [
              "lens"
            ],
            "optional": false,
            "exclusiveGroup": "",
            "availabilityConditions": [],
            "revealConditions": [],
            "mode": "achievement",
            "retroactive": true,
            "targetTurns": 5,
            "interruption": "reset",
            "deadlineTurns": 0,
            "failureConditions": [],
            "rewards": [],
            "failureActions": [],
            "completionText": "",
            "failureText": "",
            "linkedQuestId": "",
            "linkedStageId": "",
            "hintId": ""
          }
        },
        {
          "id": "briefing",
          "label": "Read the workshop briefing",
          "type": "flag",
          "flagName": "",
          "flagValue": "true",
          "roomId": "",
          "roomName": "",
          "scoreTarget": 100,
          "countFlags": "",
          "prereqGoalId": "",
          "hidden": false,
          "tracking": {
            "category": "investigate",
            "group": "bonus",
            "description": "",
            "criteria": [
              {
                "kind": "fact",
                "target": "lesson_briefing",
                "event": "read",
                "targetKind": "object"
              }
            ],
            "match": "all",
            "requiredCount": 1,
            "prerequisites": [],
            "optional": true,
            "exclusiveGroup": "",
            "availabilityConditions": [],
            "revealConditions": [],
            "mode": "achievement",
            "retroactive": true,
            "targetTurns": 5,
            "interruption": "reset",
            "deadlineTurns": 0,
            "failureConditions": [],
            "rewards": [],
            "failureActions": [],
            "completionText": "",
            "failureText": "",
            "linkedQuestId": "",
            "linkedStageId": "",
            "hintId": ""
          }
        }
      ],
      "onCompleteBody": "set lesson_workshop_complete = true\nprint \"Lighthouse service complete! Your real repair, fuel use, power connection and accepted lens delivery agree with the mission journal. You earn 100 points and 10 harbor coins. Restart to try running out of fuel, switching off early, or saving and loading.\"\nend_game",
      "settings": {
        "description": "Repair and operate the real generator, recover the signal lens, and make an accepted delivery to the keeper.",
        "pauseJournal": true,
        "notifications": true,
        "panelCollapsed": false,
        "completionConditions": [
          {
            "kind": "room",
            "target": "lesson_quay",
            "operator": "==",
            "value": true
          }
        ],
        "rewards": [
          {
            "kind": "score",
            "value": 100
          },
          {
            "kind": "money",
            "value": 10
          }
        ],
        "failureConditions": [],
        "failureActions": [],
        "failureText": ""
      }
    }
  ],
  "gameOutliner": {},
  "customRoomTemplates": [],
  "customObjectTemplates": [],
  "customNpcTemplates": [],
  "customSavedScripts": [],
  "requiredCapabilities": [
    "story-rules-v1",
    "creator-features-v1",
    "objective-journal-v1",
    "mechanics-builder-v1"
  ]
}
