{
  "version": "1.1",
  "name": "Optional Side Quest Gives Bonus Ending",
  "startRoom": "lesson_room",
  "author": "TAGMaker",
  "description": "Return a lost charm to its owner for an optional objective. Use the final gate for a good ending, or return the charm first for the best ending. Carrying or dropping the charm is not an accepted delivery.",
  "playerAppearance": {
    "version": 1,
    "layout": "modern",
    "font": "sans",
    "colorScheme": "light",
    "textSize": 18,
    "lineHeight": 1.6,
    "readingWidth": 80,
    "quietReading": false,
    "mapMode": "discovered",
    "panels": {
      "inventory": true,
      "map": true,
      "objectives": true,
      "status": true,
      "words": true
    },
    "picture": {
      "visible": true,
      "fit": "contain",
      "focalX": 50,
      "focalY": 50
    },
    "commands": {
      "visible": true,
      "standard": [
        "look",
        "search",
        "inventory",
        "help"
      ],
      "custom": []
    },
    "words": []
  },
  "created": "2026-11-01T00:00:00.000Z",
  "modified": "2026-11-01T00:00:00.000Z",
  "files": [
    {
      "path": "rooms/lesson_room.taml",
      "content": "room lesson_room\n  name: \"Homecoming Gate\"\n  description: \"The final gate ends the story. You may first take the lost charm and GIVE it TO the traveler for a better ending.\"\n  dark: false\nend"
    },
    {
      "path": "objects/lesson_charm.taml",
      "content": "object lesson_charm\n  name: \"lost charm\"\n  description: \"A charm belonging to the traveler.\"\n  location: lesson_room\n  takeable: true\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "npcs/lesson_owner.taml",
      "content": "npc lesson_owner\n  name: \"traveler\"\n  description: \"The traveler hopes to recover a lost charm.\"\n  location: lesson_room\n  mobile: false\n  follow: false\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\nend"
    },
    {
      "path": "objects/lesson_gate.taml",
      "content": "object lesson_gate\n  name: \"final gate\"\n  description: \"Use this when you are ready to finish.\"\n  location: lesson_room\n  droppable: false\n  use_give: true\n  weight: 0.1\nend"
    }
  ],
  "story": {
    "version": 1,
    "states": [
      {
        "id": "lesson_returned",
        "name": "returned",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_finished",
        "name": "finished",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      }
    ],
    "rules": [
      {
        "id": "lesson_best",
        "name": "best",
        "enabled": true,
        "trigger": {
          "kind": "object",
          "target": "lesson_gate",
          "event": "use"
        },
        "match": "all",
        "conditions": [
          {
            "kind": "state",
            "target": "lesson_returned",
            "operator": "==",
            "value": true
          }
        ],
        "actions": [
          {
            "kind": "ending",
            "target": "lesson_best"
          }
        ],
        "otherwise": "",
        "once": false
      },
      {
        "id": "lesson_good",
        "name": "good",
        "enabled": true,
        "trigger": {
          "kind": "object",
          "target": "lesson_gate",
          "event": "use"
        },
        "match": "all",
        "conditions": [
          {
            "kind": "state",
            "target": "lesson_returned",
            "operator": "==",
            "value": false
          }
        ],
        "actions": [
          {
            "kind": "ending",
            "target": "lesson_good"
          }
        ],
        "otherwise": "",
        "once": false
      }
    ],
    "features": {
      "version": 1,
      "npcProfiles": [
        {
          "version": 1,
          "id": "lesson_owner_profile",
          "name": "traveler abilities",
          "npcId": "lesson_owner",
          "enabled": true,
          "memory": [],
          "traits": {
            "loyalty": 50,
            "fear": 0,
            "suspicion": 0
          },
          "life": {
            "maxHealth": 100,
            "initial": "active",
            "essential": false,
            "defeat": "dead",
            "retreatAtHealth": 0
          },
          "inventory": {
            "objects": [],
            "equipped": [],
            "equipment": [],
            "money": 0,
            "dropOnDeath": false
          },
          "combat": {
            "assist": "off",
            "target": "first_enemy",
            "interceptPercent": 50,
            "interval": 1
          },
          "perception": {
            "enabled": false,
            "sightRange": 0,
            "hearingRange": 0,
            "suspicionPerSight": 10,
            "suspicionPerNoise": 10,
            "threshold": 50,
            "investigate": false,
            "returnHome": false,
            "allowedRoomIds": []
          },
          "abilities": []
        }
      ],
      "recipes": [
        {
          "id": "lesson_return",
          "name": "return",
          "enabled": true,
          "verbs": [
            "give"
          ],
          "unordered": true,
          "inputs": [
            {
              "objectId": "lesson_charm",
              "disposition": "transfer"
            }
          ],
          "tools": [],
          "match": "all",
          "conditions": [],
          "actions": [],
          "once": true,
          "success": "The traveler accepts the lost charm with thanks.",
          "failure": "Carry the lost charm before giving it to the traveler.",
          "repeat": "The charm has already been returned.",
          "target": {
            "kind": "npc",
            "id": "lesson_owner"
          }
        }
      ],
      "endings": [
        {
          "id": "lesson_best",
          "name": "Best Homecoming",
          "enabled": true,
          "automatic": false,
          "priority": 20,
          "conditions": [],
          "match": "all",
          "text": "You reach home with the traveler’s gratitude. The returned charm makes this the best homecoming.",
          "actions": [
            {
              "kind": "state",
              "target": "lesson_finished",
              "value": true
            }
          ]
        },
        {
          "id": "lesson_good",
          "name": "Good Homecoming",
          "enabled": true,
          "automatic": false,
          "priority": 10,
          "conditions": [],
          "match": "all",
          "text": "You reach home safely. The traveler continues searching for the lost charm.",
          "actions": [
            {
              "kind": "state",
              "target": "lesson_finished",
              "value": true
            }
          ]
        }
      ]
    }
  },
  "cookbookRecipes": [
    {
      "version": 1,
      "settings": {
        "instance": "lesson",
        "recipeId": "66-optional-side-quest-gives-bonus-ending",
        "choices": {
          "room": {
            "existing": "",
            "name": "Homecoming Gate",
            "description": "The final gate ends the story. You may first take the lost charm and GIVE it TO the traveler for a better ending."
          },
          "charm": {
            "existing": "",
            "name": "lost charm",
            "description": "A charm belonging to the traveler."
          },
          "owner": {
            "existing": "",
            "name": "traveler",
            "description": "The traveler hopes to recover a lost charm."
          },
          "gate": {
            "existing": "",
            "name": "final gate",
            "description": "Use this when you are ready to finish."
          }
        },
        "values": {
          "success": "The traveler accepts the lost charm with thanks.",
          "failure": "Carry the lost charm before giving it to the traveler.",
          "repeat": "The charm has already been returned.",
          "good": "You reach home safely. The traveler continues searching for the lost charm.",
          "best": "You reach home with the traveler’s gratitude. The returned charm makes this the best homecoming."
        },
        "reuseRoutes": {}
      },
      "owned": [
        {
          "path": "files",
          "key": "rooms/lesson_room.taml",
          "after": {
            "path": "rooms/lesson_room.taml",
            "name": "lesson_room.taml",
            "content": "room lesson_room\n  name: \"Homecoming Gate\"\n  description: \"The final gate ends the story. You may first take the lost charm and GIVE it TO the traveler for a better ending.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_charm.taml",
          "after": {
            "path": "objects/lesson_charm.taml",
            "name": "lesson_charm.taml",
            "content": "object lesson_charm\n  name: \"lost charm\"\n  description: \"A charm belonging to the traveler.\"\n  location: lesson_room\n  takeable: true\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "npcs/lesson_owner.taml",
          "after": {
            "path": "npcs/lesson_owner.taml",
            "name": "lesson_owner.taml",
            "content": "npc lesson_owner\n  name: \"traveler\"\n  description: \"The traveler hopes to recover a lost charm.\"\n  location: lesson_room\n  mobile: false\n  follow: false\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_gate.taml",
          "after": {
            "path": "objects/lesson_gate.taml",
            "name": "lesson_gate.taml",
            "content": "object lesson_gate\n  name: \"final gate\"\n  description: \"Use this when you are ready to finish.\"\n  location: lesson_room\n  droppable: false\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "objects",
          "key": "lesson_charm",
          "after": {
            "id": "lesson_charm",
            "name": "lost charm",
            "description": "A charm belonging to the traveler.",
            "article": "",
            "location": "lesson_room",
            "aliases": [],
            "visible": true,
            "takeable": true,
            "droppable": true,
            "useGive": true,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": []
          }
        },
        {
          "path": "objects",
          "key": "lesson_gate",
          "after": {
            "id": "lesson_gate",
            "name": "final gate",
            "description": "Use this when you are ready to finish.",
            "article": "",
            "location": "lesson_room",
            "aliases": [],
            "visible": true,
            "takeable": false,
            "droppable": false,
            "useGive": true,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": []
          }
        },
        {
          "path": "npcs",
          "key": "lesson_owner",
          "after": {
            "id": "lesson_owner",
            "name": "traveler",
            "description": "The traveler hopes to recover a lost charm.",
            "location": "lesson_room",
            "mobile": false,
            "aliases": [],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": []
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_room",
          "after": {
            "id": "lesson_room",
            "name": "Homecoming Gate",
            "description": "The final gate ends the story. You may first take the lost charm and GIVE it TO the traveler for a better ending.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "",
            "dark": false,
            "roomType": "regular",
            "x": 100,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000"
          }
        },
        {
          "path": "objectiveSets",
          "key": "lesson_sidequest",
          "after": {
            "id": "lesson_sidequest",
            "name": "Return the Lost Charm",
            "playerLabel": "Return the Lost Charm",
            "commands": "objectives",
            "showInExport": true,
            "goals": [
              {
                "id": "lesson_deliver",
                "label": "Give the lost charm to the traveler",
                "type": "flag",
                "flagName": "",
                "flagValue": "true",
                "roomId": "",
                "roomName": "",
                "scoreTarget": 100,
                "countFlags": "",
                "prereqGoalId": "",
                "hidden": false,
                "tracking": {
                  "category": "deliver",
                  "group": "main",
                  "description": "",
                  "criteria": [
                    {
                      "kind": "delivery",
                      "target": "lesson_charm",
                      "secondary": "lesson_owner"
                    }
                  ],
                  "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": ""
                }
              }
            ],
            "onCompleteBody": "",
            "settings": {
              "description": "",
              "pauseJournal": true,
              "notifications": true,
              "panelCollapsed": false,
              "completionConditions": [],
              "rewards": [
                {
                  "kind": "state",
                  "target": "lesson_returned",
                  "value": true
                }
              ],
              "failureConditions": [],
              "failureActions": [],
              "failureText": ""
            }
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_returned",
          "after": {
            "id": "lesson_returned",
            "name": "returned",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_finished",
          "after": {
            "id": "lesson_finished",
            "name": "finished",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_best",
          "after": {
            "id": "lesson_best",
            "name": "best",
            "enabled": true,
            "trigger": {
              "kind": "object",
              "target": "lesson_gate",
              "event": "use"
            },
            "match": "all",
            "conditions": [
              {
                "kind": "state",
                "target": "lesson_returned",
                "operator": "==",
                "value": true
              }
            ],
            "actions": [
              {
                "kind": "ending",
                "target": "lesson_best"
              }
            ],
            "otherwise": "",
            "once": false
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_good",
          "after": {
            "id": "lesson_good",
            "name": "good",
            "enabled": true,
            "trigger": {
              "kind": "object",
              "target": "lesson_gate",
              "event": "use"
            },
            "match": "all",
            "conditions": [
              {
                "kind": "state",
                "target": "lesson_returned",
                "operator": "==",
                "value": false
              }
            ],
            "actions": [
              {
                "kind": "ending",
                "target": "lesson_good"
              }
            ],
            "otherwise": "",
            "once": false
          }
        },
        {
          "path": "manifest.story.features.npcProfiles",
          "key": "lesson_owner_profile",
          "after": {
            "version": 1,
            "id": "lesson_owner_profile",
            "name": "traveler abilities",
            "npcId": "lesson_owner",
            "enabled": true,
            "memory": [],
            "traits": {
              "loyalty": 50,
              "fear": 0,
              "suspicion": 0
            },
            "life": {
              "maxHealth": 100,
              "initial": "active",
              "essential": false,
              "defeat": "dead",
              "retreatAtHealth": 0
            },
            "inventory": {
              "objects": [],
              "equipped": [],
              "equipment": [],
              "money": 0,
              "dropOnDeath": false
            },
            "combat": {
              "assist": "off",
              "target": "first_enemy",
              "interceptPercent": 50,
              "interval": 1
            },
            "perception": {
              "enabled": false,
              "sightRange": 0,
              "hearingRange": 0,
              "suspicionPerSight": 10,
              "suspicionPerNoise": 10,
              "threshold": 50,
              "investigate": false,
              "returnHome": false,
              "allowedRoomIds": []
            },
            "abilities": []
          }
        },
        {
          "path": "manifest.story.features.recipes",
          "key": "lesson_return",
          "after": {
            "id": "lesson_return",
            "name": "return",
            "enabled": true,
            "verbs": [
              "give"
            ],
            "unordered": true,
            "inputs": [
              {
                "objectId": "lesson_charm",
                "disposition": "transfer"
              }
            ],
            "tools": [],
            "match": "all",
            "conditions": [],
            "actions": [],
            "once": true,
            "success": "The traveler accepts the lost charm with thanks.",
            "failure": "Carry the lost charm before giving it to the traveler.",
            "repeat": "The charm has already been returned.",
            "target": {
              "kind": "npc",
              "id": "lesson_owner"
            }
          }
        },
        {
          "path": "manifest.story.features.endings",
          "key": "lesson_best",
          "after": {
            "id": "lesson_best",
            "name": "Best Homecoming",
            "enabled": true,
            "automatic": false,
            "priority": 20,
            "conditions": [],
            "match": "all",
            "text": "You reach home with the traveler’s gratitude. The returned charm makes this the best homecoming.",
            "actions": [
              {
                "kind": "state",
                "target": "lesson_finished",
                "value": true
              }
            ]
          }
        },
        {
          "path": "manifest.story.features.endings",
          "key": "lesson_good",
          "after": {
            "id": "lesson_good",
            "name": "Good Homecoming",
            "enabled": true,
            "automatic": false,
            "priority": 10,
            "conditions": [],
            "match": "all",
            "text": "You reach home safely. The traveler continues searching for the lost charm.",
            "actions": [
              {
                "kind": "state",
                "target": "lesson_finished",
                "value": true
              }
            ]
          }
        }
      ]
    }
  ],
  "creatorNotes": "Return a lost charm to its owner for an optional objective. Use the final gate for a good ending, or return the charm first for the best ending. Carrying or dropping the charm is not an accepted delivery. Open this recipe in Help to inspect its saved settings.",
  "mapRooms": [
    {
      "id": "lesson_room",
      "name": "Homecoming Gate",
      "description": "The final gate ends the story. You may first take the lost charm and GIVE it TO the traveler for a better ending.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "",
      "dark": false,
      "roomType": "regular",
      "x": 100,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000"
    }
  ],
  "mapExits": [],
  "objects": [
    {
      "id": "lesson_charm",
      "name": "lost charm",
      "description": "A charm belonging to the traveler.",
      "article": "",
      "location": "lesson_room",
      "aliases": [],
      "visible": true,
      "takeable": true,
      "droppable": true,
      "useGive": true,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": []
    },
    {
      "id": "lesson_gate",
      "name": "final gate",
      "description": "Use this when you are ready to finish.",
      "article": "",
      "location": "lesson_room",
      "aliases": [],
      "visible": true,
      "takeable": false,
      "droppable": false,
      "useGive": true,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": []
    }
  ],
  "npcs": [
    {
      "id": "lesson_owner",
      "name": "traveler",
      "description": "The traveler hopes to recover a lost charm.",
      "location": "lesson_room",
      "mobile": false,
      "aliases": [],
      "onEnter": "",
      "onExamine": "",
      "onTalk": "",
      "onAttack": "",
      "onDeath": "",
      "onFollow": "",
      "onAutoAttack": "",
      "onTrustChange": "",
      "onGive": "",
      "onBeforeTalk": "",
      "onAfterTalk": "",
      "onBeforeAttack": "",
      "onAfterAttack": "",
      "onDamage": "",
      "onHeal": "",
      "onMove": "",
      "onLeave": "",
      "followPlayer": false,
      "health": 100,
      "combatSide": "neutral",
      "autoFight": false,
      "attackPower": 10,
      "defense": 0,
      "trustLevel": 50,
      "conversationEnabled": false,
      "convGreeting": "",
      "convFarewell": "",
      "convTopics": [],
      "dialogues": []
    }
  ],
  "activeMechanics": [],
  "verbAliases": [],
  "scripts": [],
  "worldEvents": [],
  "customMechanicDefs": [],
  "savedMechanicTemplates": [],
  "objectiveSets": [
    {
      "id": "lesson_sidequest",
      "name": "Return the Lost Charm",
      "playerLabel": "Return the Lost Charm",
      "commands": "objectives",
      "showInExport": true,
      "goals": [
        {
          "id": "lesson_deliver",
          "label": "Give the lost charm to the traveler",
          "type": "flag",
          "flagName": "",
          "flagValue": "true",
          "roomId": "",
          "roomName": "",
          "scoreTarget": 100,
          "countFlags": "",
          "prereqGoalId": "",
          "hidden": false,
          "tracking": {
            "category": "deliver",
            "group": "main",
            "description": "",
            "criteria": [
              {
                "kind": "delivery",
                "target": "lesson_charm",
                "secondary": "lesson_owner"
              }
            ],
            "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": ""
          }
        }
      ],
      "onCompleteBody": "",
      "settings": {
        "description": "",
        "pauseJournal": true,
        "notifications": true,
        "panelCollapsed": false,
        "completionConditions": [],
        "rewards": [
          {
            "kind": "state",
            "target": "lesson_returned",
            "value": true
          }
        ],
        "failureConditions": [],
        "failureActions": [],
        "failureText": ""
      }
    }
  ],
  "gameOutliner": {},
  "customRoomTemplates": [],
  "customObjectTemplates": [],
  "customNpcTemplates": [],
  "customSavedScripts": [],
  "requiredCapabilities": [
    "npc-capabilities-v1",
    "story-rules-v1",
    "creator-features-v1",
    "objective-journal-v1"
  ]
}
