[
  {
    "id": [ "TALK_FRIEND" ],
    "type": "talk_topic",
    "insert_before_standard_exits": true,
    "responses": [
      {
        "text": "Can I drink some of your blood?  I really need some of it.",
        "topic": "TALK_FRIEND_FOLLOWER_BLOODFEED_YES",
        "condition": {
          "and": [
            { "not": { "npc_has_flag": "BLEED_IMMUNE" } },
            { "not": { "npc_has_trait": "ACIDBLOOD" } },
            { "not": { "npc_has_trait": "THRESH_CRUSTACEAN" } },
            { "not": { "npc_has_trait": "THRESH_INSECT" } },
            { "not": { "npc_has_trait": "THRESH_CEPHALOPOD" } },
            { "not": { "npc_has_trait": "THRESH_GASTROPOD" } },
            { "not": { "npc_has_trait": "BLOOD_OF_SAINTS" } },
            { "not": { "npc_has_trait": "VAMPIRE" } },
            { "math": [ "n_npc_trust() >= 10" ] },
            { "math": [ "n_npc_value() >= 10" ] },
            { "u_has_any_trait": [ "VAMPIRE", "DHAMPIR_FANGS" ] }
          ]
        }
      }
    ]
  },
  {
    "id": [ "TALK_FRIEND" ],
    "type": "talk_topic",
    "insert_before_standard_exits": true,
    "responses": [
      {
        "text": "Can I drink some of your blood?  I really need some of it.",
        "topic": "TALK_FRIEND_FOLLOWER_BLOODFEED_KINDA",
        "condition": {
          "and": [
            { "not": { "npc_has_flag": "BLEED_IMMUNE" } },
            { "not": { "npc_has_trait": "ACIDBLOOD" } },
            { "not": { "npc_has_trait": "THRESH_CRUSTACEAN" } },
            { "not": { "npc_has_trait": "THRESH_INSECT" } },
            { "not": { "npc_has_trait": "THRESH_CEPHALOPOD" } },
            { "not": { "npc_has_trait": "THRESH_GASTROPOD" } },
            { "not": { "npc_has_trait": "BLOOD_OF_SAINTS" } },
            { "not": { "npc_has_trait": "VAMPIRE" } },
            { "not": { "and": [ { "math": [ "n_npc_trust() >= 10" ] }, { "math": [ "n_npc_value() >= 10" ] } ] } },
            { "math": [ "n_npc_trust() > 0" ] },
            { "math": [ "n_npc_value() > 0" ] },
            { "u_has_any_trait": [ "VAMPIRE", "DHAMPIR_FANGS" ] }
          ]
        }
      }
    ]
  },
  {
    "id": [ "TALK_FRIEND" ],
    "type": "talk_topic",
    "insert_before_standard_exits": true,
    "responses": [
      {
        "text": "Can I drink some of your blood?  I really need some of it.",
        "topic": "TALK_FRIEND_FOLLOWER_BLOODFEED_IMPOSSIBLE",
        "condition": {
          "and": [
            { "u_has_any_trait": [ "VAMPIRE", "DHAMPIR_FANGS" ] },
            {
              "or": [
                { "npc_has_flag": "BLEED_IMMUNE" },
                { "npc_has_trait": "ACIDBLOOD" },
                { "npc_has_trait": "THRESH_CRUSTACEAN" },
                { "npc_has_trait": "THRESH_INSECT" },
                { "npc_has_trait": "THRESH_CEPHALOPOD" },
                { "npc_has_trait": "THRESH_GASTROPOD" },
                { "npc_has_trait": "BLOOD_OF_SAINTS" },
                { "npc_has_trait": "VAMPIRE" }
              ]
            }
          ]
        }
      }
    ]
  },
  {
    "id": [ "TALK_FRIEND" ],
    "type": "talk_topic",
    "insert_before_standard_exits": true,
    "responses": [
      {
        "text": "Can I drink some of your blood?  I really need some of it.",
        "topic": "TALK_FRIEND_FOLLOWER_BLOODFEED_NOPE",
        "condition": {
          "and": [
            { "or": [ { "math": [ "n_npc_trust() <= 0" ] }, { "math": [ "n_npc_value() <= 0" ] } ] },
            { "not": { "npc_has_flag": "BLEED_IMMUNE" } },
            { "not": { "npc_has_trait": "ACIDBLOOD" } },
            { "not": { "npc_has_trait": "THRESH_CRUSTACEAN" } },
            { "not": { "npc_has_trait": "THRESH_INSECT" } },
            { "not": { "npc_has_trait": "THRESH_CEPHALOPOD" } },
            { "not": { "npc_has_trait": "THRESH_GASTROPOD" } },
            { "not": { "npc_has_trait": "BLOOD_OF_SAINTS" } },
            { "not": { "npc_has_trait": "VAMPIRE" } },
            { "u_has_any_trait": [ "VAMPIRE", "DHAMPIR_FANGS" ] }
          ]
        }
      }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_FRIEND_FOLLOWER_BLOODFEED_YES",
    "dynamic_line": {
      "npc_has_effect": "feed_from_recently",
      "yes": "It'll have to wait, unfortunately.  If I let you do that too often it'll be very bad for my health.",
      "no": "Sure!  Anything to help you feel better."
    },
    "responses": [
      {
        "text": "[Drink from them] Thank you.  Can we talk about something else?",
        "topic": "TALK_FRIEND",
        "condition": { "not": { "npc_has_effect": "feed_from_recently" } },
        "effect": [ { "run_eocs": "EOC_VAMPIRE_DRINK_FROM_HUMAN" }, { "run_eocs": "EOC_NPC_GOT_DRANK_FROM_FRIEND" } ]
      },
      {
        "text": "[Drink from them] Thank you.  See you later.",
        "topic": "TALK_DONE",
        "condition": { "not": { "npc_has_effect": "feed_from_recently" } },
        "effect": [ { "run_eocs": "EOC_VAMPIRE_DRINK_FROM_HUMAN" }, { "run_eocs": "EOC_NPC_GOT_DRANK_FROM_FRIEND" } ]
      },
      {
        "text": "I changed my mind.  Keep your blood.",
        "topic": "TALK_DONE",
        "condition": { "not": { "npc_has_effect": "feed_from_recently" } }
      },
      {
        "text": "Got it.  Can we talk about something else?",
        "topic": "TALK_FRIEND",
        "condition": { "npc_has_effect": "feed_from_recently" }
      },
      {
        "text": "Got it.  See you later.",
        "topic": "TALK_DONE",
        "condition": { "npc_has_effect": "feed_from_recently" }
      }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_FRIEND_FOLLOWER_BLOODFEED_KINDA",
    "dynamic_line": {
      "npc_has_effect": "feed_from_recently",
      "yes": "I'm not letting you do that this soon after last time.  I need that blood too, you know?",
      "no": "If you really need to, then sure you can.  Don't make an habit out of it, however."
    },
    "responses": [
      {
        "text": "[Drink from them] Thank you.  Can we talk about something else?",
        "topic": "TALK_FRIEND",
        "condition": { "not": { "npc_has_effect": "feed_from_recently" } },
        "effect": [ { "run_eocs": "EOC_VAMPIRE_DRINK_FROM_HUMAN" }, { "run_eocs": "EOC_NPC_GOT_DRANK_FROM_ALLY" } ],
        "opinion": { "trust": -1, "value": -1 }
      },
      {
        "text": "[Drink from them] Thank you.  See you later.",
        "topic": "TALK_DONE",
        "condition": { "not": { "npc_has_effect": "feed_from_recently" } },
        "effect": [ { "run_eocs": "EOC_VAMPIRE_DRINK_FROM_HUMAN" }, { "run_eocs": "EOC_NPC_GOT_DRANK_FROM_ALLY" } ],
        "opinion": { "trust": -1, "value": -1 }
      },
      {
        "text": "I changed my mind.  Keep your blood.",
        "topic": "TALK_DONE",
        "condition": { "not": { "npc_has_effect": "feed_from_recently" } }
      },
      {
        "text": "Got it.  Can we talk about something else?",
        "topic": "TALK_FRIEND",
        "condition": { "npc_has_effect": "feed_from_recently" }
      },
      {
        "text": "Got it.  See you later.",
        "topic": "TALK_DONE",
        "condition": { "npc_has_effect": "feed_from_recently" }
      }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_FRIEND_FOLLOWER_BLOODFEED_NOPE",
    "dynamic_line": "Nope.  I'm not going to be your blood bag.  Find someone else for that.",
    "responses": [
      { "text": "Got it.  Can we talk about something else?", "topic": "TALK_FRIEND" },
      { "text": "Got it.  See you later.", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_FRIEND_FOLLOWER_BLOODFEED_IMPOSSIBLE",
    "dynamic_line": "(As you approach to ask about letting you drink their blood, your senses tell you that whatever blood they have in their veins wouldn't nourish you at all, so you decide to not ask your question)",
    "responses": [
      { "text": "(Ask them about something else)", "topic": "TALK_FRIEND" },
      { "text": "(Go do something else)", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "effect_type",
    "id": "feed_from_recently",
    "name": [ "Gave you blood" ],
    "desc": [ "This person won't accept to let you drink more of their blood for a while." ],
    "max_duration": "100 d"
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_DRINK_FROM_HUMAN",
    "effect": [
      {
        "if": "has_beta",
        "then": { "if": { "npc_has_trait": "FAE_CREATURE" }, "then": { "math": [ "u_vampire_just_drank_fae_blood = 1" ] } }
      },
      { "run_eocs": [ "EOC_VAMPIRE_GAIN_BLOOD_VITAMIN", "EOC_DHAMPIR_GAIN_CALORIES_FROM_NON_BAGGED_BLOOD" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_NPC_GOT_DRANK_FROM_FRIEND",
    "global": false,
    "effect": [
      { "npc_add_effect": "feed_from_recently", "duration": "5 d" },
      { "math": [ "n_vitamin('blood')", "-=", "400 + rand(100)" ] },
      { "math": [ "n_vitamin('redcells')", "-=", "400 + rand(100)" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_NPC_GOT_DRANK_FROM_ALLY",
    "global": false,
    "effect": [
      { "npc_add_effect": "feed_from_recently", "duration": "10 d" },
      { "math": [ "n_vitamin('blood')", "-=", "400 + rand(100)" ] },
      { "math": [ "n_vitamin('redcells')", "-=", "400 + rand(100)" ] }
    ]
  }
]
