{
  "version": "1.1",
  "name": "Layered Survival Hazard: Gas, Mask, Antidote, Collapse",
  "startRoom": "lesson_airlock",
  "author": "TAGMaker",
  "description": "Wear a mask against laboratory gas, collect a toxic sample, drink an antidote for contact poison, then escape before the five-turn collapse. The medic outside treats any remaining poison after a successful escape.",
  "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_airlock.taml",
      "content": "room lesson_airlock\n  exit north: lesson_lab\n  name: \"Laboratory Airlock\"\n  description: \"Take and wear the gas mask. Take the antidote. The laboratory is north.\"\n  dark: false\nend"
    },
    {
      "path": "rooms/lesson_lab.taml",
      "content": "room lesson_lab\n  exit east: lesson_outside\n  exit south: lesson_airlock\n  name: \"Unstable Laboratory\"\n  description: \"Take the toxic sample, drink the antidote, then escape east. Collecting the sample starts a five-turn collapse; the collection turn counts.\"\n  dark: false\nend"
    },
    {
      "path": "rooms/lesson_outside.taml",
      "content": "room lesson_outside\n  exit west: lesson_lab\n  name: \"Medical Exit\"\n  description: \"A medic treats you after you bring the toxic sample out. The laboratory is west.\"\n  dark: false\nend"
    },
    {
      "path": "objects/lesson_mask.taml",
      "content": "object lesson_mask\n  name: \"gas mask\"\n  description: \"Wear this mask to block the laboratory gas.\"\n  location: lesson_airlock\n  takeable: true\n  wearable: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_antidote.taml",
      "content": "object lesson_antidote\n  name: \"antidote\"\n  description: \"Drink this carried antidote after collecting the toxic sample.\"\n  location: lesson_airlock\n  takeable: true\n  drinkable: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_sample.taml",
      "content": "object lesson_sample\n  name: \"toxic sample\"\n  description: \"Taking this sample exposes you to contact poison and starts the collapse.\"\n  location: lesson_lab\n  takeable: true\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/sample_field_journal.taml",
      "content": "object sample_field_journal\n  name: \"field journal\"\n  description: \"Use this journal when you have completed the recipe to record your success. You can also keep exploring before you finish.\"\n  location: inventory\n  aliases: [\"journal\"]\n  takeable: true\n  droppable: false\n  use_give: true\n  weight: 0.1\nend"
    }
  ],
  "playerConfig": {
    "healthEnabled": true,
    "startingHealth": 100
  },
  "story": {
    "version": 1,
    "states": [
      {
        "id": "lesson_poisoned",
        "name": "poisoned",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_escaped",
        "name": "escaped",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_collapsed",
        "name": "collapsed",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      }
    ],
    "rules": [
      {
        "id": "lesson_poison_sample",
        "name": "poison sample",
        "enabled": true,
        "trigger": {
          "kind": "object",
          "target": "lesson_sample",
          "event": "take"
        },
        "match": "all",
        "conditions": [],
        "actions": [
          {
            "kind": "state",
            "target": "lesson_poisoned",
            "value": true
          }
        ],
        "otherwise": "",
        "once": true
      },
      {
        "id": "lesson_drink",
        "name": "drink",
        "enabled": true,
        "trigger": {
          "kind": "object",
          "target": "lesson_antidote",
          "event": "drink"
        },
        "match": "all",
        "conditions": [
          {
            "kind": "inventory",
            "target": "lesson_antidote",
            "operator": "==",
            "value": true
          }
        ],
        "actions": [
          {
            "kind": "consume",
            "target": "lesson_antidote"
          },
          {
            "kind": "state",
            "target": "lesson_poisoned",
            "value": false
          },
          {
            "kind": "message",
            "value": "You drink the antidote. The contact poison clears."
          }
        ],
        "otherwise": "Take the antidote first.",
        "once": true
      },
      {
        "id": "lesson_escape",
        "name": "escape",
        "enabled": true,
        "trigger": {
          "kind": "room",
          "target": "lesson_outside",
          "event": "enter"
        },
        "match": "all",
        "conditions": [
          {
            "kind": "inventory",
            "target": "lesson_sample",
            "operator": "==",
            "value": true
          }
        ],
        "actions": [
          {
            "kind": "state",
            "target": "lesson_escaped",
            "value": true
          },
          {
            "kind": "state",
            "target": "lesson_poisoned",
            "value": false
          },
          {
            "kind": "message",
            "value": "You escape with the sample. The medic treats any remaining poison."
          }
        ],
        "otherwise": "Bring the toxic sample out before the rescue can be recorded.",
        "once": true,
        "repeatText": "The sample is safe, and the escape is complete."
      },
      {
        "id": "sample_finish",
        "name": "Record the completed expedition",
        "enabled": true,
        "trigger": {
          "kind": "object",
          "target": "sample_field_journal",
          "event": "use"
        },
        "match": "all",
        "conditions": [
          {
            "kind": "state",
            "target": "lesson_escaped",
            "operator": "==",
            "value": true
          }
        ],
        "actions": [
          {
            "kind": "message",
            "value": "You managed gas, contact poison and the collapse deadline to bring the sample out. You record the result in your field journal. Your expedition is complete."
          },
          {
            "kind": "score",
            "value": 100
          },
          {
            "kind": "end",
            "value": "Your expedition is complete."
          }
        ],
        "otherwise": "Your expedition is not complete yet. Follow the room clues, then use the field journal to record your success.",
        "once": true
      }
    ],
    "features": {
      "version": 1,
      "mechanics": [
        {
          "version": 1,
          "id": "lesson_hazards",
          "name": "Gas and contact poison",
          "description": "Gas and contact poison",
          "category": "Creator Cookbook",
          "enabled": true,
          "autoStart": true,
          "inputs": [],
          "variables": [],
          "scope": {
            "kind": "global",
            "rooms": []
          },
          "initialPhase": "",
          "phases": [],
          "rules": [
            {
              "id": "gas",
              "name": "gas",
              "enabled": true,
              "trigger": {
                "kind": "turn",
                "target": "",
                "event": ""
              },
              "conditions": {
                "match": "all",
                "conditions": [
                  {
                    "kind": "rule",
                    "condition": {
                      "kind": "room",
                      "target": "lesson_lab",
                      "operator": "==",
                      "value": true
                    }
                  },
                  {
                    "kind": "rule",
                    "condition": {
                      "kind": "object_state",
                      "target": "lesson_mask",
                      "key": "worn",
                      "operator": "==",
                      "value": false
                    }
                  }
                ]
              },
              "actions": [
                {
                  "kind": "health",
                  "operation": "add",
                  "value": -8
                },
                {
                  "kind": "message",
                  "value": "The laboratory gas burns your lungs."
                }
              ],
              "otherwise": [],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 0,
              "probability": 1,
              "priority": 30
            },
            {
              "id": "poison",
              "name": "poison",
              "enabled": true,
              "trigger": {
                "kind": "turn",
                "target": "",
                "event": ""
              },
              "conditions": {
                "match": "all",
                "conditions": [
                  {
                    "kind": "rule",
                    "condition": {
                      "kind": "state",
                      "target": "lesson_poisoned",
                      "operator": "==",
                      "value": true
                    }
                  },
                  {
                    "kind": "rule",
                    "condition": {
                      "kind": "state",
                      "target": "lesson_escaped",
                      "operator": "==",
                      "value": false
                    }
                  }
                ]
              },
              "actions": [
                {
                  "kind": "health",
                  "operation": "add",
                  "value": -3
                },
                {
                  "kind": "message",
                  "value": "The sample’s poison costs you 3 Health."
                }
              ],
              "otherwise": [],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 0,
              "probability": 1,
              "priority": 20
            }
          ]
        },
        {
          "version": 1,
          "id": "lesson_collapse",
          "name": "Countdown",
          "description": "Countdown",
          "category": "Creator Cookbook",
          "enabled": true,
          "autoStart": true,
          "inputs": [],
          "variables": [
            {
              "id": "remaining",
              "name": "Turns remaining",
              "type": "number",
              "initial": 5,
              "min": 0,
              "max": 10000,
              "showInPlayer": true,
              "suffix": "turns"
            }
          ],
          "scope": {
            "kind": "global",
            "rooms": []
          },
          "initialPhase": "waiting",
          "phases": [
            {
              "id": "waiting",
              "name": "waiting",
              "onEnter": [],
              "onExit": []
            },
            {
              "id": "active",
              "name": "active",
              "onEnter": [],
              "onExit": []
            },
            {
              "id": "finished",
              "name": "finished",
              "onEnter": [],
              "onExit": []
            },
            {
              "id": "cancelled",
              "name": "cancelled",
              "onEnter": [],
              "onExit": []
            }
          ],
          "rules": [
            {
              "id": "start",
              "name": "start",
              "enabled": true,
              "trigger": {
                "kind": "object",
                "target": "lesson_sample",
                "event": "take"
              },
              "conditions": {
                "match": "all",
                "conditions": []
              },
              "actions": [
                {
                  "kind": "phase",
                  "target": "active"
                },
                {
                  "kind": "message",
                  "value": "The sample is yours, but its seal leaks. The laboratory begins to collapse."
                }
              ],
              "otherwise": [],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 1,
              "probability": 1,
              "priority": 0,
              "phase": "waiting"
            },
            {
              "id": "cancel",
              "name": "cancel",
              "enabled": true,
              "trigger": {
                "kind": "turn",
                "target": "",
                "event": ""
              },
              "conditions": {
                "match": "all",
                "conditions": [
                  {
                    "kind": "rule",
                    "condition": {
                      "kind": "state",
                      "target": "lesson_escaped",
                      "operator": "==",
                      "value": true
                    }
                  }
                ]
              },
              "actions": [
                {
                  "kind": "phase",
                  "target": "cancelled"
                },
                {
                  "kind": "mechanic",
                  "target": "self",
                  "operation": "complete"
                }
              ],
              "otherwise": [],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 0,
              "probability": 1,
              "priority": 100,
              "phase": "active"
            },
            {
              "id": "tick",
              "name": "tick",
              "enabled": true,
              "trigger": {
                "kind": "turn",
                "target": "",
                "event": ""
              },
              "conditions": {
                "match": "all",
                "conditions": []
              },
              "actions": [
                {
                  "kind": "local",
                  "target": "remaining",
                  "operation": "subtract",
                  "value": 1
                }
              ],
              "otherwise": [],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 0,
              "probability": 1,
              "priority": 30,
              "phase": "active"
            },
            {
              "id": "warning",
              "name": "warning",
              "enabled": true,
              "trigger": {
                "kind": "turn",
                "target": "",
                "event": ""
              },
              "conditions": {
                "match": "all",
                "conditions": [
                  {
                    "kind": "local",
                    "target": "remaining",
                    "operator": "<=",
                    "value": 2
                  },
                  {
                    "kind": "local",
                    "target": "remaining",
                    "operator": ">",
                    "value": 0
                  }
                ]
              },
              "actions": [
                {
                  "kind": "message",
                  "value": "The ceiling cracks. Escape east now."
                }
              ],
              "otherwise": [],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 1,
              "probability": 1,
              "priority": 20,
              "phase": "active"
            },
            {
              "id": "finish",
              "name": "finish",
              "enabled": true,
              "trigger": {
                "kind": "turn",
                "target": "",
                "event": ""
              },
              "conditions": {
                "match": "all",
                "conditions": [
                  {
                    "kind": "local",
                    "target": "remaining",
                    "operator": "<=",
                    "value": 0
                  }
                ]
              },
              "actions": [
                {
                  "kind": "state",
                  "target": "lesson_collapsed",
                  "value": true
                },
                {
                  "kind": "message",
                  "value": "The laboratory collapses before you can escape."
                },
                {
                  "kind": "health",
                  "operation": "set",
                  "value": 0
                },
                {
                  "kind": "phase",
                  "target": "finished"
                },
                {
                  "kind": "mechanic",
                  "target": "self",
                  "operation": "complete"
                }
              ],
              "otherwise": [],
              "initialDelay": 0,
              "interval": 1,
              "cooldown": 0,
              "maxUses": 1,
              "probability": 1,
              "priority": 10,
              "phase": "active"
            }
          ]
        }
      ]
    }
  },
  "cookbookRecipes": [
    {
      "version": 1,
      "settings": {
        "instance": "lesson",
        "recipeId": "layered-survival-hazard",
        "choices": {
          "airlock": {
            "existing": "",
            "name": "Laboratory Airlock",
            "description": "Take and wear the gas mask. Take the antidote. The laboratory is north."
          },
          "lab": {
            "existing": "",
            "name": "Unstable Laboratory",
            "description": "Take the toxic sample, drink the antidote, then escape east. Collecting the sample starts a five-turn collapse; the collection turn counts."
          },
          "outside": {
            "existing": "",
            "name": "Medical Exit",
            "description": "A medic treats you after you bring the toxic sample out. The laboratory is west."
          },
          "mask": {
            "existing": "",
            "name": "gas mask",
            "description": "Wear this mask to block the laboratory gas."
          },
          "antidote": {
            "existing": "",
            "name": "antidote",
            "description": "Drink this carried antidote after collecting the toxic sample."
          },
          "sample": {
            "existing": "",
            "name": "toxic sample",
            "description": "Taking this sample exposes you to contact poison and starts the collapse."
          }
        },
        "values": {
          "gas": "The laboratory gas burns your lungs.",
          "poison": "The sample’s poison costs you 3 Health.",
          "drink": "You drink the antidote. The contact poison clears.",
          "start": "The sample is yours, but its seal leaks. The laboratory begins to collapse.",
          "warning": "The ceiling cracks. Escape east now.",
          "failure": "The laboratory collapses before you can escape.",
          "escape": "You escape with the sample. The medic treats any remaining poison.",
          "enableHealth": true
        },
        "reuseRoutes": {}
      },
      "owned": [
        {
          "path": "files",
          "key": "rooms/lesson_airlock.taml",
          "after": {
            "path": "rooms/lesson_airlock.taml",
            "name": "lesson_airlock.taml",
            "content": "room lesson_airlock\n  exit north: lesson_lab\n  name: \"Laboratory Airlock\"\n  description: \"Take and wear the gas mask. Take the antidote. The laboratory is north.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "rooms/lesson_lab.taml",
          "after": {
            "path": "rooms/lesson_lab.taml",
            "name": "lesson_lab.taml",
            "content": "room lesson_lab\n  exit east: lesson_outside\n  exit south: lesson_airlock\n  name: \"Unstable Laboratory\"\n  description: \"Take the toxic sample, drink the antidote, then escape east. Collecting the sample starts a five-turn collapse; the collection turn counts.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "rooms/lesson_outside.taml",
          "after": {
            "path": "rooms/lesson_outside.taml",
            "name": "lesson_outside.taml",
            "content": "room lesson_outside\n  exit west: lesson_lab\n  name: \"Medical Exit\"\n  description: \"A medic treats you after you bring the toxic sample out. The laboratory is west.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_mask.taml",
          "after": {
            "path": "objects/lesson_mask.taml",
            "name": "lesson_mask.taml",
            "content": "object lesson_mask\n  name: \"gas mask\"\n  description: \"Wear this mask to block the laboratory gas.\"\n  location: lesson_airlock\n  takeable: true\n  wearable: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_antidote.taml",
          "after": {
            "path": "objects/lesson_antidote.taml",
            "name": "lesson_antidote.taml",
            "content": "object lesson_antidote\n  name: \"antidote\"\n  description: \"Drink this carried antidote after collecting the toxic sample.\"\n  location: lesson_airlock\n  takeable: true\n  drinkable: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_sample.taml",
          "after": {
            "path": "objects/lesson_sample.taml",
            "name": "lesson_sample.taml",
            "content": "object lesson_sample\n  name: \"toxic sample\"\n  description: \"Taking this sample exposes you to contact poison and starts the collapse.\"\n  location: lesson_lab\n  takeable: true\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "objects",
          "key": "lesson_mask",
          "after": {
            "id": "lesson_mask",
            "name": "gas mask",
            "description": "Wear this mask to block the laboratory gas.",
            "article": "",
            "location": "lesson_airlock",
            "aliases": [],
            "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_antidote",
          "after": {
            "id": "lesson_antidote",
            "name": "antidote",
            "description": "Drink this carried antidote after collecting the toxic sample.",
            "article": "",
            "location": "lesson_airlock",
            "aliases": [],
            "visible": true,
            "takeable": true,
            "droppable": true,
            "useGive": false,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": true,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": []
          }
        },
        {
          "path": "objects",
          "key": "lesson_sample",
          "after": {
            "id": "lesson_sample",
            "name": "toxic sample",
            "description": "Taking this sample exposes you to contact poison and starts the collapse.",
            "article": "",
            "location": "lesson_lab",
            "aliases": [],
            "visible": true,
            "takeable": true,
            "droppable": true,
            "useGive": true,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": []
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_airlock",
          "after": {
            "id": "lesson_airlock",
            "name": "Laboratory Airlock",
            "description": "Take and wear the gas mask. Take the antidote. The laboratory is north.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "",
            "dark": false,
            "roomType": "regular",
            "x": 100,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_lab",
          "after": {
            "id": "lesson_lab",
            "name": "Unstable Laboratory",
            "description": "Take the toxic sample, drink the antidote, then escape east. Collecting the sample starts a five-turn collapse; the collection turn counts.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "",
            "dark": false,
            "roomType": "regular",
            "x": 320,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_outside",
          "after": {
            "id": "lesson_outside",
            "name": "Medical Exit",
            "description": "A medic treats you after you bring the toxic sample out. The laboratory is west.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "",
            "dark": false,
            "roomType": "regular",
            "x": 540,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_lab",
          "after": {
            "id": "lesson_route_lab",
            "fromRoom": "lesson_airlock",
            "toRoom": "lesson_lab",
            "direction": "north",
            "locked": false
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_back",
          "after": {
            "id": "lesson_route_back",
            "fromRoom": "lesson_lab",
            "toRoom": "lesson_airlock",
            "direction": "south",
            "locked": false
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_exit",
          "after": {
            "id": "lesson_route_exit",
            "fromRoom": "lesson_lab",
            "toRoom": "lesson_outside",
            "direction": "east",
            "locked": false
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_return",
          "after": {
            "id": "lesson_route_return",
            "fromRoom": "lesson_outside",
            "toRoom": "lesson_lab",
            "direction": "west",
            "locked": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_poisoned",
          "after": {
            "id": "lesson_poisoned",
            "name": "poisoned",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_escaped",
          "after": {
            "id": "lesson_escaped",
            "name": "escaped",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_collapsed",
          "after": {
            "id": "lesson_collapsed",
            "name": "collapsed",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_poison_sample",
          "after": {
            "id": "lesson_poison_sample",
            "name": "poison sample",
            "enabled": true,
            "trigger": {
              "kind": "object",
              "target": "lesson_sample",
              "event": "take"
            },
            "match": "all",
            "conditions": [],
            "actions": [
              {
                "kind": "state",
                "target": "lesson_poisoned",
                "value": true
              }
            ],
            "otherwise": "",
            "once": true
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_drink",
          "after": {
            "id": "lesson_drink",
            "name": "drink",
            "enabled": true,
            "trigger": {
              "kind": "object",
              "target": "lesson_antidote",
              "event": "drink"
            },
            "match": "all",
            "conditions": [
              {
                "kind": "inventory",
                "target": "lesson_antidote",
                "operator": "==",
                "value": true
              }
            ],
            "actions": [
              {
                "kind": "consume",
                "target": "lesson_antidote"
              },
              {
                "kind": "state",
                "target": "lesson_poisoned",
                "value": false
              },
              {
                "kind": "message",
                "value": "You drink the antidote. The contact poison clears."
              }
            ],
            "otherwise": "Take the antidote first.",
            "once": true
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_escape",
          "after": {
            "id": "lesson_escape",
            "name": "escape",
            "enabled": true,
            "trigger": {
              "kind": "room",
              "target": "lesson_outside",
              "event": "enter"
            },
            "match": "all",
            "conditions": [
              {
                "kind": "inventory",
                "target": "lesson_sample",
                "operator": "==",
                "value": true
              }
            ],
            "actions": [
              {
                "kind": "state",
                "target": "lesson_escaped",
                "value": true
              },
              {
                "kind": "state",
                "target": "lesson_poisoned",
                "value": false
              },
              {
                "kind": "message",
                "value": "You escape with the sample. The medic treats any remaining poison."
              }
            ],
            "otherwise": "Bring the toxic sample out before the rescue can be recorded.",
            "once": true,
            "repeatText": "The sample is safe, and the escape is complete."
          }
        },
        {
          "path": "manifest.story.features.mechanics",
          "key": "lesson_hazards",
          "after": {
            "version": 1,
            "id": "lesson_hazards",
            "name": "Gas and contact poison",
            "description": "Gas and contact poison",
            "category": "Creator Cookbook",
            "enabled": true,
            "autoStart": true,
            "inputs": [],
            "variables": [],
            "scope": {
              "kind": "global",
              "rooms": []
            },
            "initialPhase": "",
            "phases": [],
            "rules": [
              {
                "id": "gas",
                "name": "gas",
                "enabled": true,
                "trigger": {
                  "kind": "turn",
                  "target": "",
                  "event": ""
                },
                "conditions": {
                  "match": "all",
                  "conditions": [
                    {
                      "kind": "rule",
                      "condition": {
                        "kind": "room",
                        "target": "lesson_lab",
                        "operator": "==",
                        "value": true
                      }
                    },
                    {
                      "kind": "rule",
                      "condition": {
                        "kind": "object_state",
                        "target": "lesson_mask",
                        "key": "worn",
                        "operator": "==",
                        "value": false
                      }
                    }
                  ]
                },
                "actions": [
                  {
                    "kind": "health",
                    "operation": "add",
                    "value": -8
                  },
                  {
                    "kind": "message",
                    "value": "The laboratory gas burns your lungs."
                  }
                ],
                "otherwise": [],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 0,
                "probability": 1,
                "priority": 30
              },
              {
                "id": "poison",
                "name": "poison",
                "enabled": true,
                "trigger": {
                  "kind": "turn",
                  "target": "",
                  "event": ""
                },
                "conditions": {
                  "match": "all",
                  "conditions": [
                    {
                      "kind": "rule",
                      "condition": {
                        "kind": "state",
                        "target": "lesson_poisoned",
                        "operator": "==",
                        "value": true
                      }
                    },
                    {
                      "kind": "rule",
                      "condition": {
                        "kind": "state",
                        "target": "lesson_escaped",
                        "operator": "==",
                        "value": false
                      }
                    }
                  ]
                },
                "actions": [
                  {
                    "kind": "health",
                    "operation": "add",
                    "value": -3
                  },
                  {
                    "kind": "message",
                    "value": "The sample’s poison costs you 3 Health."
                  }
                ],
                "otherwise": [],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 0,
                "probability": 1,
                "priority": 20
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.mechanics",
          "key": "lesson_collapse",
          "after": {
            "version": 1,
            "id": "lesson_collapse",
            "name": "Countdown",
            "description": "Countdown",
            "category": "Creator Cookbook",
            "enabled": true,
            "autoStart": true,
            "inputs": [],
            "variables": [
              {
                "id": "remaining",
                "name": "Turns remaining",
                "type": "number",
                "initial": 5,
                "min": 0,
                "max": 10000,
                "showInPlayer": true,
                "suffix": "turns"
              }
            ],
            "scope": {
              "kind": "global",
              "rooms": []
            },
            "initialPhase": "waiting",
            "phases": [
              {
                "id": "waiting",
                "name": "waiting",
                "onEnter": [],
                "onExit": []
              },
              {
                "id": "active",
                "name": "active",
                "onEnter": [],
                "onExit": []
              },
              {
                "id": "finished",
                "name": "finished",
                "onEnter": [],
                "onExit": []
              },
              {
                "id": "cancelled",
                "name": "cancelled",
                "onEnter": [],
                "onExit": []
              }
            ],
            "rules": [
              {
                "id": "start",
                "name": "start",
                "enabled": true,
                "trigger": {
                  "kind": "object",
                  "target": "lesson_sample",
                  "event": "take"
                },
                "conditions": {
                  "match": "all",
                  "conditions": []
                },
                "actions": [
                  {
                    "kind": "phase",
                    "target": "active"
                  },
                  {
                    "kind": "message",
                    "value": "The sample is yours, but its seal leaks. The laboratory begins to collapse."
                  }
                ],
                "otherwise": [],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 1,
                "probability": 1,
                "priority": 0,
                "phase": "waiting"
              },
              {
                "id": "cancel",
                "name": "cancel",
                "enabled": true,
                "trigger": {
                  "kind": "turn",
                  "target": "",
                  "event": ""
                },
                "conditions": {
                  "match": "all",
                  "conditions": [
                    {
                      "kind": "rule",
                      "condition": {
                        "kind": "state",
                        "target": "lesson_escaped",
                        "operator": "==",
                        "value": true
                      }
                    }
                  ]
                },
                "actions": [
                  {
                    "kind": "phase",
                    "target": "cancelled"
                  },
                  {
                    "kind": "mechanic",
                    "target": "self",
                    "operation": "complete"
                  }
                ],
                "otherwise": [],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 0,
                "probability": 1,
                "priority": 100,
                "phase": "active"
              },
              {
                "id": "tick",
                "name": "tick",
                "enabled": true,
                "trigger": {
                  "kind": "turn",
                  "target": "",
                  "event": ""
                },
                "conditions": {
                  "match": "all",
                  "conditions": []
                },
                "actions": [
                  {
                    "kind": "local",
                    "target": "remaining",
                    "operation": "subtract",
                    "value": 1
                  }
                ],
                "otherwise": [],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 0,
                "probability": 1,
                "priority": 30,
                "phase": "active"
              },
              {
                "id": "warning",
                "name": "warning",
                "enabled": true,
                "trigger": {
                  "kind": "turn",
                  "target": "",
                  "event": ""
                },
                "conditions": {
                  "match": "all",
                  "conditions": [
                    {
                      "kind": "local",
                      "target": "remaining",
                      "operator": "<=",
                      "value": 2
                    },
                    {
                      "kind": "local",
                      "target": "remaining",
                      "operator": ">",
                      "value": 0
                    }
                  ]
                },
                "actions": [
                  {
                    "kind": "message",
                    "value": "The ceiling cracks. Escape east now."
                  }
                ],
                "otherwise": [],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 1,
                "probability": 1,
                "priority": 20,
                "phase": "active"
              },
              {
                "id": "finish",
                "name": "finish",
                "enabled": true,
                "trigger": {
                  "kind": "turn",
                  "target": "",
                  "event": ""
                },
                "conditions": {
                  "match": "all",
                  "conditions": [
                    {
                      "kind": "local",
                      "target": "remaining",
                      "operator": "<=",
                      "value": 0
                    }
                  ]
                },
                "actions": [
                  {
                    "kind": "state",
                    "target": "lesson_collapsed",
                    "value": true
                  },
                  {
                    "kind": "message",
                    "value": "The laboratory collapses before you can escape."
                  },
                  {
                    "kind": "health",
                    "operation": "set",
                    "value": 0
                  },
                  {
                    "kind": "phase",
                    "target": "finished"
                  },
                  {
                    "kind": "mechanic",
                    "target": "self",
                    "operation": "complete"
                  }
                ],
                "otherwise": [],
                "initialDelay": 0,
                "interval": 1,
                "cooldown": 0,
                "maxUses": 1,
                "probability": 1,
                "priority": 10,
                "phase": "active"
              }
            ]
          }
        },
        {
          "path": "manifest.playerConfig.healthEnabled",
          "key": "$value",
          "after": true
        },
        {
          "path": "manifest.playerConfig.startingHealth",
          "key": "$value",
          "after": 100
        }
      ]
    }
  ],
  "creatorNotes": "Wear a mask against laboratory gas, collect a toxic sample, drink an antidote for contact poison, then escape before the five-turn collapse. The medic outside treats any remaining poison after a successful escape.\nOpen Help → Cookbook → Layered Survival Hazard: Gas, Mask, Antidote, Collapse → Start this recipe to inspect its saved settings. The field journal and 100-point ending belong only to the sample game.\nCommands: take gas mask; wear gas mask; take antidote; north; take toxic sample; drink antidote; east; wait; use field journal",
  "mapRooms": [
    {
      "id": "lesson_airlock",
      "name": "Laboratory Airlock",
      "description": "Take and wear the gas mask. Take the antidote. The laboratory is north.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "",
      "dark": false,
      "roomType": "regular",
      "x": 100,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    },
    {
      "id": "lesson_lab",
      "name": "Unstable Laboratory",
      "description": "Take the toxic sample, drink the antidote, then escape east. Collecting the sample starts a five-turn collapse; the collection turn counts.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "",
      "dark": false,
      "roomType": "regular",
      "x": 320,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    },
    {
      "id": "lesson_outside",
      "name": "Medical Exit",
      "description": "A medic treats you after you bring the toxic sample out. The laboratory is west.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "",
      "dark": false,
      "roomType": "regular",
      "x": 540,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    }
  ],
  "mapExits": [
    {
      "id": "lesson_route_lab",
      "fromRoom": "lesson_airlock",
      "toRoom": "lesson_lab",
      "direction": "north",
      "locked": false
    },
    {
      "id": "lesson_route_back",
      "fromRoom": "lesson_lab",
      "toRoom": "lesson_airlock",
      "direction": "south",
      "locked": false
    },
    {
      "id": "lesson_route_exit",
      "fromRoom": "lesson_lab",
      "toRoom": "lesson_outside",
      "direction": "east",
      "locked": false
    },
    {
      "id": "lesson_route_return",
      "fromRoom": "lesson_outside",
      "toRoom": "lesson_lab",
      "direction": "west",
      "locked": false
    }
  ],
  "objects": [
    {
      "id": "lesson_mask",
      "name": "gas mask",
      "description": "Wear this mask to block the laboratory gas.",
      "article": "",
      "location": "lesson_airlock",
      "aliases": [],
      "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_antidote",
      "name": "antidote",
      "description": "Drink this carried antidote after collecting the toxic sample.",
      "article": "",
      "location": "lesson_airlock",
      "aliases": [],
      "visible": true,
      "takeable": true,
      "droppable": true,
      "useGive": false,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": true,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": []
    },
    {
      "id": "lesson_sample",
      "name": "toxic sample",
      "description": "Taking this sample exposes you to contact poison and starts the collapse.",
      "article": "",
      "location": "lesson_lab",
      "aliases": [],
      "visible": true,
      "takeable": true,
      "droppable": true,
      "useGive": true,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": []
    },
    {
      "id": "sample_field_journal",
      "name": "field journal",
      "description": "Use this journal when you have completed the recipe to record your success. You can also keep exploring before you finish.",
      "article": "",
      "location": "inventory",
      "aliases": [
        "journal"
      ],
      "visible": true,
      "takeable": true,
      "droppable": false,
      "useGive": true,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": []
    }
  ],
  "npcs": [],
  "activeMechanics": [],
  "verbAliases": [],
  "scripts": [],
  "worldEvents": [],
  "customMechanicDefs": [],
  "savedMechanicTemplates": [],
  "objectiveSets": [],
  "gameOutliner": {},
  "customRoomTemplates": [],
  "customObjectTemplates": [],
  "customNpcTemplates": [],
  "customSavedScripts": [],
  "requiredCapabilities": [
    "story-rules-v1",
    "creator-features-v1",
    "mechanics-builder-v1"
  ]
}
