startNodeId: start

nodes:
  - id: start
    speaker: npc
    text: "Ah, traveler. I sense you seek passage through my gates."
    nextNodeId: sword_path

  - id: sword_path
    speaker: npc
    text: "I see you carry a blade. Warriors are always welcome here."
    nextNodeId: no_sword_path
    conditions:
      - hasSword

  - id: no_sword_path
    speaker: npc
    text: "You come unarmed? Brave, or perhaps foolish. You may still pass."
    nextNodeId: end
    conditions:
      - ~hasSword

  - id: end
    speaker: npc
    text: "Safe travels."
    choices:
      - text: "Farewell."
        nextNodeId: dead_choice

  # reachable, but all choices point to guard_fight which requires hasSword — eliminated when hasSword=false
  - id: dead_choice
    speaker: npc
    text: "One last thing — do you wish to duel my guard?"
    choices:
      - text: "Challenge the guard."
        nextNodeId: guard_fight
      - text: "Slip past."
        nextNodeId: guard_fight

  - id: guard_fight
    speaker: npc
    text: "The guard steps forward."
    conditions:
      - hasSword
    nextNodeId: vault_gate

  # vault_gate is shown only when level >= 42, but vault requires level < 40 — mutually exclusive
  - id: vault_gate
    speaker: npc
    text: "Beyond lies an ancient vault. Only the truly powerful may enter."
    conditions:
      - level >= 42
    choices:
      - text: "Enter the vault."
        nextNodeId: vault
      - text: "Turn back."
        nextNodeId: start

  - id: vault
    speaker: npc
    text: "You enter the vault."
    conditions:
      - level < 40

  # orphan — nothing points here
  - id: orphan
    speaker: npc
    text: "You should never see this."
