[
  {
    "id": [ "TALK_FRIEND" ],
    "type": "talk_topic",
    "insert_before_standard_exits": true,
    "responses": [
      {
        "text": "Can you tell me how much do you like me?",
        "topic": "TALK_FRIEND_FOLLOWER_SACRIFICE_MISSION",
        "condition": {
          "and": [
            { "math": [ "n_npc_trust() >= 10" ] },
            { "math": [ "n_npc_value() >= 10" ] },
            { "u_has_mission": "KILL_YOUR_BEST_FRIEND" },
            { "not": { "u_has_mission": "mission_best_friend_bookhunt1" } },
            { "not": { "u_has_mission": "mission_best_friend_bookhunt2" } },
            { "not": { "u_has_mission": "mission_best_friend_bookhunt3" } },
            { "not": { "u_has_mission": "mission_best_friend_gamehunt1" } },
            { "not": { "u_has_mission": "mission_best_friend_gamehunt2" } },
            { "not": { "u_has_mission": "mission_best_friend_gamehunt3" } },
            { "not": { "compare_string": [ "yes", { "u_val": "best_friend" } ] } }
          ]
        },
        "effect": [ { "math": [ "npc_randomize_book_find_mission = rand(3)" ] } ]
      }
    ]
  },
  {
    "id": [ "TALK_FRIEND" ],
    "type": "talk_topic",
    "insert_before_standard_exits": true,
    "//": "Giving the mission before the dialogue might seem weird, but it allows to anticipate the NPC dying and the player needing another for the tier 4.",
    "responses": [
      {
        "text": "Can you tell me how much do you like me?",
        "topic": "TALK_FRIEND_FOLLOWER_SACRIFICE_MISSION_2",
        "condition": {
          "and": [
            {
              "or": [
                { "u_has_mission": "mission_best_friend_gamehunt1" },
                { "u_has_mission": "mission_best_friend_gamehunt2" },
                { "u_has_mission": "mission_best_friend_gamehunt3" }
              ]
            },
            { "math": [ "n_npc_trust() >= 10" ] },
            { "math": [ "n_npc_value() >= 10" ] },
            { "u_has_mission": "KILL_YOUR_BEST_FRIEND" },
            { "not": { "compare_string": [ "yes", { "u_val": "best_friend" } ] } }
          ]
        }
      }
    ]
  },
  {
    "id": [ "TALK_FRIEND" ],
    "type": "talk_topic",
    "insert_before_standard_exits": true,
    "responses": [
      {
        "text": "Can you tell me how much do you like me?",
        "topic": "TALK_FRIEND_FOLLOWER_SACRIFICE",
        "condition": {
          "and": [
            { "math": [ "n_npc_trust() >= 10" ] },
            { "math": [ "n_npc_value() >= 10" ] },
            { "u_has_mission": "KILL_YOUR_BEST_FRIEND" },
            { "compare_string": [ "yes", { "u_val": "best_friend" } ] },
            { "not": { "npc_has_trait": "VAMPIRE_SACRIFICE" } }
          ]
        }
      }
    ]
  },
  {
    "id": [ "TALK_FRIEND" ],
    "type": "talk_topic",
    "insert_before_standard_exits": true,
    "responses": [
      {
        "text": "Can you tell me how much do you like me?",
        "topic": "TALK_FRIEND_FOLLOWER_NOT_SACRIFICE",
        "condition": {
          "and": [
            { "math": [ "n_npc_trust() <= 9" ] },
            { "math": [ "n_npc_value() <= 9" ] },
            { "u_has_mission": "KILL_YOUR_BEST_FRIEND" }
          ]
        }
      }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_FRIEND_FOLLOWER_NOT_SACRIFICE",
    "dynamic_line": "You're a good friend.  I had better friends but I also had way worse.",
    "responses": [
      { "text": "Thanks for telling me. Can we talk about something else?", "topic": "TALK_FRIEND" },
      { "text": "Thanks for telling me. See you later.", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_FRIEND_FOLLOWER_SACRIFICE_MISSION",
    "dynamic_line": {
      "math": [ "npc_randomize_book_find_mission == 1" ],
      "yes": "I would love it if you could find my favorite book.  Could you help me find it?  It's an anthology of stories titled 'Apocalypse Now'.  I know it's weird to want to read a book about apocalypses during one, but it gives me hope we'll come out the other side of this one too.",
      "no": {
        "math": [ "npc_randomize_book_find_mission == 2" ],
        "yes": "I would love it if you could find my favorite book.  Could you help me find it?  It's Brave New World by Aldous Huxley.  It really spoke to me before the end and even more now.",
        "no": {
          "math": [ "npc_randomize_book_find_mission == 3" ],
          "yes": "I would love it if you could find my favorite book.  Could you help me find it?  It's All Things Weird, by Felicity Powell.  It gives a great sense of humor to the end of the world!",
          "no": {
            "math": [ "npc_randomize_book_find_mission > 3" ],
            "yes": "PLEASE REPORT THIS ON GITHUB.  A RNG OF 1-3 PICKED A HIGHER NUMBER.",
            "no": "ERROR: couldn't pick a mission for the book search."
          }
        }
      }
    },
    "responses": [
      {
        "text": "I will find that book for you.",
        "topic": "TALK_DONE",
        "condition": { "math": [ "npc_randomize_book_find_mission == 1" ] },
        "effect": { "assign_mission": "mission_best_friend_bookhunt1" },
        "switch": true
      },
      {
        "text": "I will find that book for you.",
        "topic": "TALK_DONE",
        "condition": { "math": [ "npc_randomize_book_find_mission == 2" ] },
        "effect": { "assign_mission": "mission_best_friend_bookhunt2" },
        "switch": true
      },
      {
        "text": "I will find that book for you.",
        "topic": "TALK_DONE",
        "condition": { "math": [ "npc_randomize_book_find_mission == 3" ] },
        "effect": { "assign_mission": "mission_best_friend_bookhunt3" },
        "switch": true
      },
      { "text": "It'll have to wait.  Maybe later.", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_FRIEND_FOLLOWER_SACRIFICE_MISSION_2",
    "dynamic_line": {
      "math": [ "npc_randomize_game_find_mission == 1" ],
      "yes": "I would love it if you could find my favorite game.  Could you help me find it?  It's a board game called Pathogen.  At least the diseases in this game can be beaten.",
      "no": {
        "math": [ "npc_randomize_game_find_mission == 2" ],
        "yes": "I would love it if you could find my favorite game.  Could you help me find it?  It's a board game called Steam Gears.  Alternate history is so much better than real history.",
        "no": {
          "math": [ "npc_randomize_game_find_mission == 3" ],
          "yes": "I would love it if you could find my favorite game.  Could you help me find it?  It's a board game called Terraforming Mercury.  I guess terraforming anywhere is a pipe dream now.",
          "no": {
            "math": [ "npc_randomize_game_find_mission > 3" ],
            "yes": "PLEASE REPORT THIS ON GITHUB.  A RNG OF 0-3 PICKED A HIGHER NUMBER.",
            "no": "ERROR: couldn't pick a mission for the game search."
          }
        }
      }
    },
    "responses": [ { "text": "I will find that game for you.", "topic": "TALK_DONE" } ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_FRIEND_FOLLOWER_SACRIFICE",
    "dynamic_line": {
      "compare_string": [ "yes", { "u_val": "best_friend" } ],
      "yes": "You're the best person in the world for me.  I wouldn't ever hesitate to trust you with my life.  I feel that no matter what happens, it'll be fine as you'll be there.",
      "no": "I mean you're ok, I guess."
    },
    "responses": [
      {
        "text": "Thanks for telling me.  Can we talk about something else?",
        "topic": "TALK_FRIEND",
        "effect": [ { "npc_add_trait": "VAMPIRE_SACRIFICE" } ]
      },
      {
        "text": "Thanks for telling me.  See you later.",
        "topic": "TALK_DONE",
        "effect": [ { "npc_add_trait": "VAMPIRE_SACRIFICE" } ]
      }
    ]
  },
  {
    "type": "mutation",
    "id": "VAMPIRE_SACRIFICE",
    "name": { "str": "sacrificial mark" },
    "points": 0,
    "player_display": false,
    "valid": false,
    "purifiable": false,
    "description": "You're not supposed to see this.  Tracks that you are killing your best friend ever",
    "enchantments": [ "sacrificial_marked" ]
  },
  {
    "type": "enchantment",
    "id": "sacrificial_marked",
    "name": { "str": "Absolute best friend" },
    "description": "This person considers you their absolute best friend, the best person in the entire world.",
    "condition": "ALWAYS",
    "hit_me_effect": [ { "id": "sacrificial_marked" } ]
  },
  {
    "type": "SPELL",
    "id": "sacrificial_marked",
    "name": "sacrificial marked",
    "description": "Shouldn't be visible.  Tracks that you are killing someone that considers you the best person in the world.",
    "valid_targets": [ "hostile" ],
    "min_range": 50,
    "max_range": 50,
    "min_duration": 500,
    "max_duration": 500,
    "difficulty": 5,
    "flags": [ "SILENT", "NO_SFX", "NO_LEGS", "NO_PROJECTILE" ],
    "shape": "blast",
    "effect": "attack",
    "effect_str": "about_to_kill_best_friend"
  },
  {
    "type": "effect_type",
    "id": "about_to_kill_best_friend",
    "max_duration": "5 s"
  },
  {
    "id": "mission_best_friend_bookhunt1",
    "type": "mission_definition",
    "name": { "str": "Help me find my favorite book.  Apocalypse Now" },
    "description": "Could you help me find my favorite book?  It's an anthology of stories titled 'Apocalypse Now'.  I know it's weird to want to read a book about apocalypses during one, but it gives me hope we'll come out the other side of this one too.",
    "goal": "MGOAL_FIND_ITEM",
    "difficulty": 2,
    "item": "book_anthology_an",
    "origins": [ "ORIGIN_SECONDARY" ],
    "value": 0,
    "dialogue": {
      "describe": "I would love it if you could find my favorite book.",
      "offer": "I know you are my friend and I don't want to push you but if you come across my favorite book I'd appreciate it if you brought it to me.",
      "accepted": "Thank you!",
      "rejected": "Let me know if you change your mind.",
      "advice": "Bookstores and libraries are the most likely places to find it or just wandering through houses.",
      "inquire": "Did you find it?",
      "success": "You've found it!",
      "success_lie": "This clearly isn't it.",
      "failure": "Well thanks anyway."
    },
    "end": {
      "effect": [
        {
          "u_add_morale": "morale_feeling_good",
          "bonus": 10,
          "max_bonus": 50,
          "duration": "60 minutes",
          "decay_start": "60 minutes"
        },
        { "run_eocs": "EOC_SACRIFICE_MISSION2" }
      ]
    }
  },
  {
    "id": "mission_best_friend_bookhunt2",
    "type": "mission_definition",
    "name": { "str": "Help me find my favorite book.  Brave New World." },
    "description": "Could you help me find my favorite book?  It's Brave New World by Aldous Huxley.  It really spoke to me before the end and even more now.",
    "goal": "MGOAL_FIND_ITEM",
    "difficulty": 2,
    "item": "book_fict_soft_scifi_brave",
    "origins": [ "ORIGIN_SECONDARY" ],
    "value": 0,
    "dialogue": {
      "describe": "I would love it if you could find my favorite book.",
      "offer": "I know you are my friend and I don't want to push you but if you come across my favorite book I'd appreciate it if you brought it to me.",
      "accepted": "Thank you!",
      "rejected": "Let me know if you change your mind.",
      "advice": "Bookstores and libraries are the most likely places to find it or just wandering through houses.",
      "inquire": "Did you find it?",
      "success": "You've found it!",
      "success_lie": "This clearly isn't it.",
      "failure": "Well thanks anyway."
    },
    "end": {
      "effect": [
        {
          "u_add_morale": "morale_feeling_good",
          "bonus": 10,
          "max_bonus": 50,
          "duration": "60 minutes",
          "decay_start": "60 minutes"
        },
        { "run_eocs": "EOC_SACRIFICE_MISSION2" }
      ]
    }
  },
  {
    "id": "mission_best_friend_bookhunt3",
    "type": "mission_definition",
    "name": { "str": "Help me find my favorite book.  Cat's Cradle." },
    "description": "Could you help me find my favorite book?  It's Cat's Cradle, by Kurt Vonnegut.  It's an interesting take on an alternate cataclysmic scenario.",
    "goal": "MGOAL_FIND_ITEM",
    "difficulty": 2,
    "item": "book_fict_soft_satire_cats",
    "origins": [ "ORIGIN_SECONDARY" ],
    "value": 0,
    "dialogue": {
      "describe": "I would love it if you could find my favorite book.",
      "offer": "I know you are my friend and I don't want to push you but if you come across my favorite book I'd appreciate it if you brought it to me.",
      "accepted": "Thank you!",
      "rejected": "Let me know if you change your mind.",
      "advice": "Bookstores and libraries are the most likely places to find it or just wandering through houses.",
      "inquire": "Did you find it?",
      "success": "You've found it!",
      "success_lie": "This clearly isn't it.",
      "failure": "Well thanks anyway."
    },
    "end": {
      "effect": [
        {
          "u_add_morale": "morale_feeling_good",
          "bonus": 10,
          "max_bonus": 50,
          "duration": "60 minutes",
          "decay_start": "60 minutes"
        },
        { "run_eocs": "EOC_SACRIFICE_MISSION2" }
      ]
    }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SACRIFICE_MISSION2",
    "effect": {
      "switch": { "math": [ "rng(1, 3)" ] },
      "cases": [
        {
          "case": 1,
          "effect": [ { "assign_mission": "mission_best_friend_gamehunt1" }, { "math": [ "npc_randomize_game_find_mission = 1" ] } ]
        },
        {
          "case": 2,
          "effect": [ { "assign_mission": "mission_best_friend_gamehunt2" }, { "math": [ "npc_randomize_game_find_mission = 2" ] } ]
        },
        {
          "case": 3,
          "effect": [ { "assign_mission": "mission_best_friend_gamehunt3" }, { "math": [ "npc_randomize_game_find_mission = 3" ] } ]
        }
      ]
    }
  },
  {
    "id": "mission_best_friend_gamehunt1",
    "type": "mission_definition",
    "name": { "str": "Help me find my favorite game.  Pathogen" },
    "description": "Could you help me find my favorite game?  It's a board game called Pathogen.  At least the diseases in this game can be beaten.",
    "goal": "MGOAL_FIND_ITEM",
    "difficulty": 2,
    "item": "pandemic",
    "origins": [ "ORIGIN_SECONDARY" ],
    "value": 0,
    "dialogue": {
      "describe": "I would love it if you could find my favorite game.",
      "offer": "I know you are my friend and I don't want to push you but if you come across my favorite game I'd appreciate it if you brought it to me.",
      "accepted": "Thank you!",
      "rejected": "Let me know if you change your mind.",
      "advice": "Bookstores and gameshops are the most likely places to find it or just wandering through houses.",
      "inquire": "Did you find it?",
      "success": "You've found it!",
      "success_lie": "This clearly isn't it.",
      "failure": "Well thanks anyway."
    },
    "end": {
      "effect": [
        {
          "u_add_morale": "morale_feeling_good",
          "bonus": 10,
          "max_bonus": 50,
          "duration": "60 minutes",
          "decay_start": "60 minutes"
        },
        { "u_add_var": "best_friend", "value": "yes" }
      ]
    }
  },
  {
    "id": "mission_best_friend_gamehunt2",
    "type": "mission_definition",
    "name": { "str": "Help me find my favorite game.  Steam Gears" },
    "description": "Could you help me find my favorite game?  It's a board game called Steam Gears.  Alternate history is so much better than real history.",
    "goal": "MGOAL_FIND_ITEM",
    "difficulty": 2,
    "item": "scythe_game",
    "origins": [ "ORIGIN_SECONDARY" ],
    "value": 0,
    "dialogue": {
      "describe": "I would love it if you could find my favorite game.",
      "offer": "I know you are my friend and I don't want to push you but if you come across my favorite game I'd appreciate it if you brought it to me.",
      "accepted": "Thank you!",
      "rejected": "Let me know if you change your mind.",
      "advice": "Bookstores and gameshops are the most likely places to find it or just wandering through houses.",
      "inquire": "Did you find it?",
      "success": "You've found it!",
      "success_lie": "This clearly isn't it.",
      "failure": "Well thanks anyway."
    },
    "end": {
      "effect": [
        {
          "u_add_morale": "morale_feeling_good",
          "bonus": 10,
          "max_bonus": 50,
          "duration": "60 minutes",
          "decay_start": "60 minutes"
        },
        { "u_add_var": "best_friend", "value": "yes" }
      ]
    }
  },
  {
    "id": "mission_best_friend_gamehunt3",
    "type": "mission_definition",
    "name": { "str": "Help me find my favorite game.  Terraforming Mercury" },
    "description": "Could you help me find my favorite game?  It's a board game called Terraforming Mercury.  I guess terraforming anywhere is a pipe dream now.",
    "goal": "MGOAL_FIND_ITEM",
    "difficulty": 2,
    "item": "terraforming_mercury",
    "origins": [ "ORIGIN_SECONDARY" ],
    "value": 0,
    "dialogue": {
      "describe": "I would love it if you could find my favorite game.",
      "offer": "I know you are my friend and I don't want to push you but if you come across my favorite game I'd appreciate it if you brought it to me.",
      "accepted": "Thank you!",
      "rejected": "Let me know if you change your mind.",
      "advice": "Bookstores and gameshops are the most likely places to find it or just wandering through houses.",
      "inquire": "Did you find it?",
      "success": "You've found it!",
      "success_lie": "This clearly isn't it.",
      "failure": "Well thanks anyway."
    },
    "end": {
      "effect": [
        {
          "u_add_morale": "morale_feeling_good",
          "bonus": 10,
          "max_bonus": 50,
          "duration": "60 minutes",
          "decay_start": "60 minutes"
        },
        { "u_add_var": "best_friend", "value": "yes" }
      ]
    }
  }
]
