about summary refs log blame commit diff stats
path: root/html/story-teller/js/scenes.js
blob: 7b8db35eb67cce90ecf1fb49286110086eda8fab (plain) (tree)




































                                                                                                                          
export const scenes = {
    start: {
      description: "You are standing in a dark cave. There's a faint glimmer in the distance, and a torch on the ground.",
      choices: [
        { text: "Explore further", nextScene: "deepCave" },
        { text: "Pick up the torch", action: (state) => state.inventory.add("torch") },
        { 
          text: "Use a torch to illuminate the cave", 
          nextScene: "litCave", 
          condition: (state) => state.inventory.has("torch"), 
          consume: ["torch"] 
        },
      ],
    },
    deepCave: {
      description: "The darkness becomes overwhelming. You can't proceed further.",
      choices: [
        { text: "Go back", nextScene: "start" },
      ],
    },
    litCave: {
      description: "With the torchlight, you see glittering gemstones embedded in the walls.",
      choices: [
        { text: "Pick up the key", action: (state) => state.inventory.add("key") },
        { text: "Collect a gemstone", action: (state) => state.inventory.add("gemstone") },
        { text: "Go back", nextScene: "start" },
        { text: "Go deeper into the cave", nextScene: "treasureRoom", condition: (state) => state.inventory.has("key") },
      ],
    },
    treasureRoom: {
      description: "You find a room filled with treasure. You are rich beyond your wildest dreams.",
      choices: [
        { text: "Swim in the treasure", nextScene: "treasureRoom" },
      ],
    },
  };