[
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_GAIN_BLOOD_VITAMIN",
    "effect": [
      {
        "if": { "or": [ { "u_has_trait": "VAMPIRE" }, { "u_has_effect": "vampire_virus" } ] },
        "then": [
          { "math": [ "u_vitamin('human_blood_vitamin')", "+=", "400 + rand(100)" ] },
          {
            "u_add_effect": "effect_drank_blood_recently",
            "intensity": 1,
            "duration": { "math": [ "600 + rand(600)" ] }
          },
          { "u_lose_morale": "morale_vw_no_fun" },
          {
            "if": { "u_has_trait": "BLOOD_FUN" },
            "then": [
              {
                "if": { "u_has_trait": "BLOOD_FUN_UPGRADE" },
                "then": [ { "u_add_morale": "morale_drank_blood", "bonus": 90, "max_bonus": 180, "duration": "60 m", "decay_start": "30 m" } ],
                "else": { "u_add_morale": "morale_drank_blood", "bonus": 30, "max_bonus": 60, "duration": "20 m", "decay_start": "10 m" }
              }
            ]
          }
        ],
        "else": [ { "math": [ "u_vitamin('human_blood_vitamin')", "+=", "250 + rand(100)" ] } ]
      },
      {
        "if": { "u_has_trait": "DHAMPIR_WEAKNESS_BLOODTHIRST" },
        "then": [
          { "u_lose_morale": "morale_craving_human_blood" },
          { "u_lose_effect": "effect_dhampir_bloodlust_cravings" },
          {
            "u_add_morale": "morale_drank_blood",
            "bonus": 30,
            "max_bonus": 60,
            "duration": "20 m",
            "decay_start": "10 m"
          }
        ]
      },
      {
        "if": { "u_has_trait": "VAMPIRE_BLOOD_TEMPORARY_BOOST" },
        "then": [ { "u_add_effect": "effect_vampire_drank_blood_power_boost", "duration": 3600 } ]
      },
      {
        "if": { "math": [ "u_vampire_just_drank_fae_blood == 1" ] },
        "then": [ { "math": [ "u_vitamin('drank_fae_blood')", "+=", "5" ] }, { "math": [ "u_vampire_just_drank_fae_blood = 0" ] } ]
      },
      {
        "if": { "and": [ { "math": [ "u_dhampir_have_ever_drunk_blood == 0" ] }, { "u_has_trait": "DHAMPIR_TRAIT" } ] },
        "then": [
          { "math": [ "u_dhampir_have_ever_drunk_blood += 1" ] },
          {
            "u_message": "The blood hits your tongue with a wash of warmth and for a moment the world goes white.  The taste is indescribable.  It's better than nectar, better than ambrosia, better than anything you've ever tasted in your life.  You know at this moment that you have crossed a river and there will never be any going back.",
            "type": "mixed"
          },
          {
            "u_add_morale": "morale_drank_blood",
            "bonus": 45,
            "max_bonus": 45,
            "duration": "60 m",
            "decay_start": "30 m"
          }
        ]
      },
      {
        "if": { "and": [ { "math": [ "u_dhampir_have_ever_drunk_blood > 0" ] }, { "u_has_trait": "DHAMPIR_TRAIT" } ] },
        "then": [
          { "math": [ "u_dhampir_have_ever_drunk_blood += 1" ] },
          {
            "if": { "math": [ "dhampir_total_weaknesses() < 4" ] },
            "then": [
              {
                "if": { "x_in_y_chance": { "x": { "math": [ "u_dhampir_have_ever_drunk_blood" ] }, "y": { "math": [ "rng(500,10000)" ] } } },
                "then": [
                  { "run_eocs": "EOC_DHAMPIR_GAIN_WEAKNESSES" },
                  { "u_message": "As the blood hits your tongue, something inside you shifts.", "type": "bad" },
                  { "math": [ "u_dhampir_have_ever_drunk_blood = 1" ] }
                ]
              }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_DHAMPIR_GAIN_CALORIES_FROM_NON_BAGGED_BLOOD",
    "condition": { "u_has_trait": "DHAMPIR_TRAIT" },
    "effect": [
      { "math": [ "_temp_val = 300 + rand(150)" ] },
      { "math": [ "u_calories('dont_affect_weariness': true)", "+=", "_temp_val" ] },
      {
        "if": { "u_has_trait": "DHAMPIR_WEAKNESS_LOWER_KCAL_FROM_FOOD" },
        "then": [ { "math": [ "u_calories('dont_affect_weariness': true)", "+=", "(_temp_val) / 2" ] } ]
      },
      { "u_message": "You are gaining <context_val:temp_val> calories from the blood you drank.", "type": "debug" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_BLOOD_DRINKING_DIRECTLY",
    "eoc_type": "EVENT",
    "required_event": "character_eats_item",
    "condition": {
      "and": [
        {
          "or": [
            { "compare_string": [ "blood", { "context_val": "itype" } ] },
            { "compare_string": [ "demihuman_blood", { "context_val": "itype" } ] },
            { "compare_string": [ "mutant_human_blood", { "context_val": "itype" } ] },
            { "compare_string": [ "fae_blood", { "context_val": "itype" } ] }
          ]
        },
        { "or": [ { "u_has_any_trait": [ "DHAMPIR_TRAIT", "VAMPIRE" ] }, { "u_has_effect": "vampire_virus" } ] }
      ]
    },
    "effect": [
      {
        "if": { "u_has_trait": "DHAMPIR_WEAKNESS_LOWER_KCAL_FROM_FOOD" },
        "then": [ { "math": [ "u_calories('dont_affect_weariness': true)", "+=", "350 + rand(150)" ] } ]
      },
      {
        "if": { "compare_string": [ "fae_blood", { "context_val": "itype" } ] },
        "then": { "math": [ "u_vampire_just_drank_fae_blood = 1" ] }
      },
      { "u_lose_morale": "morale_vw_no_fun" },
      { "run_eocs": "EOC_VAMPIRE_GAIN_BLOOD_VITAMIN" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_BLOOD_DRINKING_INEDIBLE",
    "eoc_type": "EVENT",
    "required_event": "character_eats_item",
    "condition": {
      "and": [
        {
          "or": [
            { "compare_string": [ "animal_blood", { "context_val": "itype" } ] },
            { "compare_string": [ "blood_tainted", { "context_val": "itype" } ] }
          ]
        },
        { "or": [ { "u_has_trait": "VAMPIRE" }, { "u_has_effect": "vampire_virus" } ] }
      ]
    },
    "effect": [ { "u_message": "You still feel as hungry as before.  This blood cannot sustain you.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_CONSUME_VAMPIRE_BLOOD",
    "eoc_type": "EVENT",
    "required_event": "character_eats_item",
    "condition": {
      "and": [
        { "compare_string": [ "vampire_blood", { "context_val": "itype" } ] },
        { "or": [ { "u_has_trait": "VAMPIRE" }, { "u_has_effect": "vampire_virus" } ] }
      ]
    },
    "effect": [
      {
        "if": { "u_has_trait": "VAMPIRE_ANATHEMA" },
        "then": [
          {
            "if": { "u_has_trait": "VAMPIRE_DRINK_VAMPIRE_BLOOD" },
            "then": [
              { "math": [ "u_vitamin('human_blood_vitamin')", "+=", "400 + rand(100)" ] },
              { "math": [ "u_vitamin('vampire_blood_vitamin')", "+=", "30 + rand(20)" ] },
              { "u_message": "This blood is the best you could drink.  You want more.", "type": "good" },
              {
                "if": { "u_has_trait": "BLOOD_FUN" },
                "then": [
                  {
                    "if": { "u_has_trait": "BLOOD_FUN_UPGRADE" },
                    "then": [ { "u_add_morale": "morale_drank_blood", "bonus": 90, "max_bonus": 180, "duration": "60 m", "decay_start": "30 m" } ],
                    "else": [ { "u_add_morale": "morale_drank_blood", "bonus": 30, "max_bonus": 60, "duration": "20 m", "decay_start": "10 m" } ]
                  }
                ]
              },
              {
                "if": { "u_has_trait": "ANATHEMA_WEAKNESS_MIND_CHAOS" },
                "then": [ { "run_eocs": "EOC_ANATHEMA_MIND_CHAOS" } ]
              },
              {
                "if": { "u_has_trait": "ANATHEMA_WEAKNESS_NEED_VAMPIRE_BLOOD" },
                "then": [
                  { "u_add_effect": "effect_recent_vampire_drink", "duration": "4 days" },
                  { "u_lose_effect": "effect_anathema_need_vampire_blood" }
                ]
              }
            ],
            "else": [
              { "math": [ "u_vitamin('vampire_blood_vitamin')", "+=", "30 + rand(20)" ] },
              { "u_message": "Though it cannot sustain you, this blood can empower you.", "type": "mixed" },
              {
                "if": { "u_has_trait": "ANATHEMA_WEAKNESS_MIND_CHAOS" },
                "then": [ { "run_eocs": "EOC_ANATHEMA_MIND_CHAOS" } ]
              },
              {
                "if": { "u_has_trait": "ANATHEMA_WEAKNESS_NEED_VAMPIRE_BLOOD" },
                "then": [
                  { "u_add_effect": "effect_recent_vampire_drink", "duration": "4 days" },
                  { "u_lose_effect": "effect_anathema_need_vampire_blood" }
                ]
              }
            ]
          }
        ],
        "else": { "u_message": "You need the blood of the living, not the blood of the dead.", "type": "bad" }
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_CONSUME_VAMPIRE_BLOOD_NON_VAMPIRE",
    "eoc_type": "EVENT",
    "required_event": "character_eats_item",
    "condition": {
      "and": [
        { "compare_string": [ "vampire_blood", { "context_val": "itype" } ] },
        { "not": { "u_has_effect": "vampire_virus" } }
      ]
    },
    "effect": [
      { "u_message": "As you drink, some of the vampire blood enters your gums.", "type": "mixed" },
      { "u_add_effect": "vampire_virus", "intensity": 1, "duration": "PERMANENT" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_DRINK_BLOOD_WITH_FANGS_activated",
    "condition": {
      "or": [
        {
          "u_has_any_effect": [ "stunned", "dazed", "sleep", "effect_vampire_hypnotism", "effect_vampire_blood_drinking_target" ]
        },
        { "test_eoc": "EOC_CONDITIONS_VAMPIRE_DRINK_BLOOD_WITH_FANGS_MOM" }
      ]
    },
    "effect": [
      {
        "if": { "and": [ "u_is_npc", { "not": { "u_has_trait": "FAE_CREATURE" } } ] },
        "then": [
          { "run_eocs": "EOC_VAMPIRE_DRINK_FROM_HUMAN_IN_COMBAT", "alpha_talker": "npc", "time_in_future": 2 },
          { "math": [ "u_vitamin('blood')", "-=", "750  + rand(450)" ] },
          { "math": [ "u_vitamin('redcells')", "-=", "750 + rand(450)" ] },
          { "u_add_effect": "effect_vampire_blood_drinking_target", "duration": { "math": [ "rng(3,4)" ] } },
          { "u_add_effect": "dazed", "duration": { "math": [ "rng(3,4)" ] } },
          { "npc_add_effect": "effect_vampire_blood_drinking", "duration": 4 },
          { "npc_assign_activity": "ACT_VAMPIRE_DRINKING_BLOOD", "duration": "3 seconds" },
          { "message": "You are drinking from an NPC.", "type": "debug" }
        ],
        "else": [
          {
            "if": {
              "or": [
                { "and": [ { "u_has_species": "HUMAN" }, { "not": { "u_has_species": "ZOMBIE" } } ] },
                { "u_has_species": "FERAL" },
                { "u_has_species": "RENFIELD" },
                { "and": [ { "u_has_species": "CHANGELING" }, { "not": { "u_has_species": "ZOMBIE" } } ] },
                { "u_has_species": "HOMULLUS" },
                { "u_has_trait": "FAE_CREATURE" }
              ]
            },
            "then": [
              {
                "if": { "or": [ { "u_has_species": "CHANGELING" }, { "u_has_species": "HOMULLUS" }, { "u_has_trait": "FAE_CREATURE" } ] },
                "then": [ { "math": [ "n_vampire_just_drank_fae_blood = 1" ] } ]
              },
              { "run_eocs": "EOC_VAMPIRE_DRINK_FROM_HUMAN_IN_COMBAT", "alpha_talker": "npc", "time_in_future": 2 },
              { "u_add_effect": "effect_vampire_drunk_from_in_combat", "duration": "48 hours" },
              { "u_add_effect": "effect_vampire_blood_drinking_target", "duration": { "math": [ "rng(3,4)" ] } },
              { "u_add_effect": "dazed", "duration": { "math": [ "rng(3,4)" ] } },
              { "npc_add_effect": "effect_vampire_blood_drinking", "duration": 4 },
              { "npc_assign_activity": "ACT_VAMPIRE_DRINKING_BLOOD", "duration": "3 seconds" },
              { "message": "You are drinking from a human-type monster.", "type": "debug" }
            ],
            "else": [
              {
                "if": {
                  "and": [
                    { "not": "u_is_npc" },
                    {
                      "or": [ { "not": { "u_has_species": "HUMAN" } }, { "u_has_species": "ZOMBIE" }, { "u_has_species": "VAMPIRE" } ]
                    },
                    { "not": { "u_has_species": "FERAL" } },
                    { "not": { "u_has_species": "CHANGELING" } },
                    { "not": { "u_has_species": "RENFIELD" } },
                    { "not": { "u_has_species": "HOMULLUS" } },
                    { "not": { "u_has_trait": "FAE_CREATURE" } }
                  ]
                },
                "then": [
                  {
                    "if": { "u_has_species": "VAMPIRE" },
                    "then": {
                      "npc_message": "The vampire's blood refuses to leave its veins, no matter how hard you try to drain it.",
                      "type": "bad"
                    },
                    "else": { "npc_message": "You get a taste of blood but stop drinking when you realize it cannot sustain you.", "type": "bad" }
                  },
                  { "message": "You are drinking from an inhuman monster.", "type": "debug" },
                  {
                    "if": {
                      "or": [
                        { "u_has_species": "MIGO" },
                        { "u_has_species": "ZOMBIE" },
                        { "u_has_species": "HORROR" },
                        { "u_has_species": "INSECT" },
                        { "u_has_species": "INSECT_FLYING" },
                        { "u_has_species": "CENTIPEDE" },
                        { "u_has_species": "SPIDER" },
                        { "u_has_species": "MOLLUSK" },
                        { "u_has_species": "WORM" }
                      ]
                    },
                    "then": [
                      { "npc_message": "…and it tastes absolutely disgusting!", "type": "bad" },
                      { "math": [ "n_vitamin('bad_food')", "+=", "rng(10,15)" ] }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ],
    "false_effect": [ { "npc_message": "You can only drink blood from an incapacitated or sleeping target.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_DRINK_FROM_HUMAN_IN_COMBAT",
    "condition": { "u_has_effect": "effect_vampire_blood_drinking" },
    "effect": [ { "run_eocs": [ "EOC_VAMPIRE_GAIN_BLOOD_VITAMIN", "EOC_DHAMPIR_GAIN_CALORIES_FROM_NON_BAGGED_BLOOD" ] } ]
  },
  {
    "id": "EOC_VAMPIRE_DRINK_BLOOD_INTERRUPTED_CHECK",
    "type": "effect_on_condition",
    "eoc_type": "EVENT",
    "required_event": "character_finished_activity",
    "condition": {
      "and": [
        { "compare_string": [ "ACT_VAMPIRE_DRINKING_BLOOD", { "context_val": "activity" } ] },
        { "math": [ "_canceled == true" ] }
      ]
    },
    "effect": [
      { "u_message": "You cancelled drinking blood and thus get no blood.", "type": "debug" },
      { "u_lose_effect": "effect_vampire_blood_drinking" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_WEAKNESS_NEED_HUMAN_BLOOD_HALVING",
    "eoc_type": "EVENT",
    "required_event": "character_eats_item",
    "condition": {
      "and": [
        {
          "or": [
            { "compare_string": [ "fae_blood", { "context_val": "itype" } ] },
            { "compare_string": [ "demihuman_blood", { "context_val": "itype" } ] },
            { "compare_string": [ "mutant_human_blood", { "context_val": "itype" } ] }
          ]
        },
        { "u_has_trait": "VAMPIRE_WEAKNESS_NEED_HUMAN_BLOOD" }
      ]
    },
    "effect": [ { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "200 + rand(50)" ] } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_BLOOD_NUMBER_UI",
    "//": "Until the day UI widgets can directly access vitamin levels, this will have to be.",
    "recurrence": 1,
    "condition": { "or": [ { "u_has_any_trait": [ "DHAMPIR_TRAIT", "VAMPIRE" ] }, { "u_has_effect": "vampire_virus" } ] },
    "deactivate_condition": {
      "and": [ { "not": { "u_has_any_trait": [ "DHAMPIR_TRAIT", "VAMPIRE" ] } }, { "not": { "u_has_effect": "vampire_virus" } } ]
    },
    "effect": [
      { "math": [ "u_blood_amount_for_graph = u_vitamin('human_blood_vitamin')" ] },
      {
        "math": [
          "u_max_blood_amount_for_graph",
          "=",
          "5400 + (u_has_trait('VAMPIRE_STORE_MORE_BLOOD') * 9000) + (u_has_trait('VAMPIRE_STORE_MORE_BLOOD_UPGRADE') * 18000)"
        ]
      },
      { "run_eocs": "EOC_VAMPIRE_BLOOD_MAX_LIMIT" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_BLOOD_MAX_LIMIT",
    "condition": {
      "math": [
        "u_vitamin('human_blood_vitamin')",
        ">=",
        "5600 + (u_has_trait('VAMPIRE_STORE_MORE_BLOOD') * 9000) + (u_has_trait('VAMPIRE_STORE_MORE_BLOOD_UPGRADE') * 18000)"
      ]
    },
    "effect": [
      {
        "if": { "u_has_trait": "VAMPIRE_STORE_MORE_BLOOD_UPGRADE" },
        "then": { "math": [ "u_vitamin('human_blood_vitamin') = 32600" ] },
        "else": {
          "if": { "u_has_trait": "VAMPIRE_STORE_MORE_BLOOD" },
          "then": { "math": [ "u_vitamin('human_blood_vitamin') = 14600" ] },
          "else": { "math": [ "u_vitamin('human_blood_vitamin') = 5600" ] }
        }
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_ADD_WEAKNESSES",
    "//": "This EOC checks how many weaknesses the player should gain when reshuffling.  Gaining the traits run the weakness-giving EOC directly.",
    "//2": "Tier 3 grants one weakness, Tier 4 grants one more, Tier 5 grants two more, becoming an Anathema gives two more, reaching the Anathema threshold gives three more.",
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_ADD_WEAKNESSES_TIER_3",
            "condition": { "u_has_trait": "VAMPIRE3" },
            "effect": [ { "run_eocs": [ "EOC_VAMPIRE_ADD_ONE_WEAKNESS" ] } ]
          },
          {
            "id": "EOC_VAMPIRE_ADD_WEAKNESSES_TIER_4",
            "condition": { "u_has_trait": "VAMPIRE4" },
            "effect": [ { "run_eocs": [ "EOC_VAMPIRE_ADD_ONE_WEAKNESS" ] } ]
          },
          {
            "id": "EOC_VAMPIRE_ADD_WEAKNESSES_TIER_5",
            "condition": { "u_has_trait": "BLOOD_DRINKER" },
            "effect": [ { "run_eocs": [ "EOC_VAMPIRE_ADD_ONE_WEAKNESS" ] }, { "run_eocs": [ "EOC_VAMPIRE_ADD_ONE_WEAKNESS" ] } ]
          },
          {
            "id": "EOC_VAMPIRE_ADD_WEAKNESSES_ANATHEMA",
            "condition": { "u_has_trait": "VAMPIRE_ANATHEMA" },
            "effect": [ { "run_eocs": [ "EOC_VAMPIRE_ADD_ONE_WEAKNESS" ] }, { "run_eocs": [ "EOC_VAMPIRE_ADD_ONE_WEAKNESS" ] } ]
          },
          {
            "id": "EOC_VAMPIRE_ADD_WEAKNESSES_ANATHEMA_THRESH",
            "condition": { "u_has_trait": "THRESH_VAMPIRE_ANATHEMA" },
            "effect": [
              { "run_eocs": [ "EOC_VAMPIRE_ADD_ONE_WEAKNESS" ] },
              { "run_eocs": [ "EOC_VAMPIRE_ADD_ONE_WEAKNESS" ] },
              { "run_eocs": [ "EOC_VAMPIRE_ADD_ONE_WEAKNESS" ] }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_ADD_ONE_WEAKNESS",
    "//": "This EOC adds a single vampiric weakness when ran.",
    "//2": "This EOC is intended to be ran multiple times, to properly assign the intended amount of weaknesses to the player.",
    "//3": "When adding new weaknesses, make sure to also add them to the roll_remainder below so the player can obtain them.",
    "effect": [
      {
        "u_roll_remainder": [
          "VAMPIRE_WEAKNESS_MORE_BLOOD",
          "VAMPIRE_WEAKNESS_GROTESQUE",
          "VAMPIRE_WEAKNESS_EARTH_SLEEP",
          "VAMPIRE_WEAKNESS_HOLY_BURN",
          "VAMPIRE_WEAKNESS_VAST_WATER_BURN",
          "VAMPIRE_WEAKNESS_ANIMAL_HATE",
          "VAMPIRE_WEAKNESS_FIRE_VULNERABLE",
          "VAMPIRE_WEAKNESS_COLD_BLOODED",
          "VAMPIRE_WEAKNESS_NEED_LIVING_BLOOD",
          "VAMPIRE_WEAKNESS_NEED_HUMAN_BLOOD",
          "VAMPIRE_WEAKNESS_BLOOD_CRAVING",
          "VAMPIRE_WEAKNESS_NO_FUN"
        ],
        "type": "mutation",
        "true_eocs": [ "EOC_VAMPIRE_ADD_ONE_WEAKNESS_SUCCESS" ],
        "false_eocs": [ "EOC_VAMPIRE_ADD_ONE_WEAKNESS_FAIL" ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_ADD_ONE_WEAKNESS_SUCCESS",
    "//": "Workaround to the below not working due to the roll_remainder used.  When this will be fixed, remove this EOC as the others give a message informing the player of the new weakness.",
    "effect": [ { "u_message": "You gain a new vampiric weakness.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_ADD_ONE_WEAKNESS_FAIL",
    "effect": [ { "u_message": "The EOC failed to give you a weakness.  Please report this on Github.", "popup": true } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VW_MORE_BLOOD_MESSAGE",
    "eoc_type": "EVENT",
    "required_event": "gains_mutation",
    "condition": { "compare_string": [ "VAMPIRE_WEAKNESS_MORE_BLOOD", { "context_val": "trait" } ] },
    "effect": [ { "u_message": "Your thirst for blood intensifies.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VW_EARTH_SLEEP_MESSAGE",
    "eoc_type": "EVENT",
    "required_event": "gains_mutation",
    "condition": { "compare_string": [ "VAMPIRE_WEAKNESS_EARTH_SLEEP", { "context_val": "trait" } ] },
    "effect": [ { "u_message": "You long for a good day of sleep surrounded by the earth.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VW_HOLY_BURN_MESSAGE",
    "eoc_type": "EVENT",
    "required_event": "gains_mutation",
    "condition": { "compare_string": [ "VAMPIRE_WEAKNESS_HOLY_BURN", { "context_val": "trait" } ] },
    "effect": [ { "u_message": "You feel unholy, as if your presence wouldn't be tolerated by holy ground.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VW_VAST_WATER_BURN_MESSAGE",
    "eoc_type": "EVENT",
    "required_event": "gains_mutation",
    "condition": { "compare_string": [ "VAMPIRE_WEAKNESS_VAST_WATER_BURN", { "context_val": "trait" } ] },
    "effect": [ { "u_message": "You think about crossing a river, but visions of your flesh melting disturb you.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VW_ANIMAL_HATE_MESSAGE",
    "eoc_type": "EVENT",
    "required_event": "gains_mutation",
    "condition": { "compare_string": [ "VAMPIRE_WEAKNESS_ANIMAL_HATE", { "context_val": "trait" } ] },
    "effect": [ { "u_message": "Nearby animals start looking at you with eyes filled with hate.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VW_FIRE_VULNERABLE_MESSAGE",
    "eoc_type": "EVENT",
    "required_event": "gains_mutation",
    "condition": { "compare_string": [ "VAMPIRE_WEAKNESS_FIRE_VULNERABLE", { "context_val": "trait" } ] },
    "effect": [ { "u_message": "Your body feels much more vulnerable to fire.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VW_COLD_BLOODED_MESSAGE",
    "eoc_type": "EVENT",
    "required_event": "gains_mutation",
    "condition": { "compare_string": [ "VAMPIRE_WEAKNESS_COLD_BLOODED", { "context_val": "trait" } ] },
    "effect": [ { "u_message": "Your body grows cold.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VW_NEED_LIVING_BLOOD_MESSAGE",
    "eoc_type": "EVENT",
    "required_event": "gains_mutation",
    "condition": { "compare_string": [ "VAMPIRE_WEAKNESS_NEED_LIVING_BLOOD", { "context_val": "trait" } ] },
    "effect": [ { "u_message": "You daydream of drinking blood directly from the veins of the living for a moment.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VW_NEED_HUMAN_BLOOD_MESSAGE",
    "eoc_type": "EVENT",
    "required_event": "gains_mutation",
    "condition": { "compare_string": [ "VAMPIRE_WEAKNESS_NEED_HUMAN_BLOOD", { "context_val": "trait" } ] },
    "effect": [ { "u_message": "All bloods, except the blood of regular humans, suddenly feel far less appealing.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VW_BLOOD_CRAVING_MESSAGE",
    "eoc_type": "EVENT",
    "required_event": "gains_mutation",
    "condition": { "compare_string": [ "VAMPIRE_WEAKNESS_BLOOD_CRAVING", { "context_val": "trait" } ] },
    "effect": [ { "u_message": "You feel a painful craving for blood for a second, then it passes.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VW_NO_FUN_MESSAGE",
    "eoc_type": "EVENT",
    "required_event": "gains_mutation",
    "condition": { "compare_string": [ "VAMPIRE_WEAKNESS_NO_FUN", { "context_val": "trait" } ] },
    "effect": [
      {
        "u_message": "Everything grows dull and boring.  Your only memories still making you happy are those about drinking blood.",
        "type": "bad"
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_AW_SUN_BURN_MESSAGE",
    "eoc_type": "EVENT",
    "required_event": "gains_mutation",
    "condition": { "compare_string": [ "ANATHEMA_WEAKNESS_SUN_BURN", { "context_val": "trait" } ] },
    "effect": [ { "u_message": "You know with certainty that standing under the sun is now a lethal threat.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_AW_MIND_CHAOS_MESSAGE",
    "eoc_type": "EVENT",
    "required_event": "gains_mutation",
    "condition": { "compare_string": [ "ANATHEMA_WEAKNESS_MIND_CHAOS", { "context_val": "trait" } ] },
    "effect": [ { "u_message": "Your mind reels at the thought of drinking more vampire blood.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_AW_NEED_VAMPIRE_BLOOD_MESSAGE",
    "eoc_type": "EVENT",
    "required_event": "gains_mutation",
    "condition": { "compare_string": [ "ANATHEMA_WEAKNESS_NEED_VAMPIRE_BLOOD", { "context_val": "trait" } ] },
    "effect": [ { "u_message": "You feel a growing thirst for the blood of vampires.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SET_VAMPIRE_TRAIT_NUMBERS_FOR_NPC_USE",
    "//": "This is necessary for powers whose effect on NPCs is variable, since the jmath equations return the avatar's traits",
    "eoc_type": "EVENT",
    "required_event": "opens_spellbook",
    "condition": { "or": [ { "u_has_trait": "VAMPIRE" }, { "u_has_trait": "VAMPIRE2" }, { "u_has_trait": "VAMPIRE3" } ] },
    "effect": [
      { "math": [ "u_vampire_total_tier_one_traits = vampire_total_tier_one_traits_plus_potency()" ] },
      { "math": [ "u_vampire_total_tier_two_traits = vampire_total_tier_two_traits()" ] },
      { "math": [ "u_vampire_total_tier_three_traits = vampire_total_tier_three_traits()" ] },
      { "math": [ "u_vampire_total_tier_four_traits = vampire_total_tier_four_traits_plus_potence()" ] },
      { "math": [ "u_vampire_total_tier_five_traits = vampire_total_tier_five_traits_plus_cauldron()" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_GAIN_BLOOD_BECOME_A_VAMPIRE",
    "eoc_type": "EVENT",
    "required_event": "character_gains_effect",
    "condition": { "compare_string": [ "vampire_virus", { "context_val": "effect" } ] },
    "//": "Adds blood on becoming a vampire so you don't instantly start withering",
    "effect": [ { "math": [ "u_vitamin('human_blood_vitamin') += 1200" ] } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EYEGLEAM_activated",
    "condition": { "not": { "u_has_effect": "eyegleam" } },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_EYEGLEAM_activated_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 0.25 },
              { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "100" ] },
              { "u_add_effect": "eyegleam", "duration": "PERMANENT" },
              { "u_message": "Your eyes gleam red momentarily as they drink in all available light.", "type": "good" },
              {
                "run_eocs": [ "EOC_EYEGLEAM_maintenance" ],
                "time_in_future": {
                  "math": [
                    "rng(0.75,1.25) * (1000 + (vampire_total_tier_one_traits_plus_potency() * 100) + (vampire_total_tier_two_traits() * 225) + (vampire_total_tier_three_traits() * 350) + (vampire_total_tier_four_traits_plus_potence() * 500) + (vampire_total_tier_five_traits_plus_cauldron() * 750))"
                  ]
                }
              },
              {
                "run_eocs": [
                  {
                    "id": "EOC_EYEGLEAM_activated_3",
                    "condition": {
                      "or": [
                        {
                          "and": [
                            { "u_has_effect": "vampire_virus_ascendant", "intensity": 1 },
                            { "math": [ "u_effect_intensity('vampire_virus_ascendant') == 1" ] }
                          ]
                        },
                        {
                          "and": [
                            { "u_has_effect": "vampire_virus_post_mortal", "intensity": 1 },
                            { "math": [ "u_effect_intensity('vampire_virus_post_mortal') == 1" ] }
                          ]
                        }
                      ]
                    },
                    "effect": [ { "u_add_effect": "eyegleam_craft_in_darkness", "duration": "PERMANENT" } ]
                  }
                ]
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to activate your gleaming eyes.", "type": "bad" },
              { "run_eocs": "EOC_EYEGLEAM_deactivate_future", "time_in_future": 0 }
            ]
          }
        ]
      }
    ],
    "false_effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_EYEGLEAM_deactivated",
            "condition": { "u_has_effect": "eyegleam" },
            "effect": [
              { "u_message": "Your eyes lose their reddish glint as the darkness rolls back in.", "type": "neutral" },
              { "u_lose_effect": [ "eyegleam", "eyegleam_craft_in_darkness" ] }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EYEGLEAM_deactivate_future",
    "//": "This is necessary because calling u_deactivate_trait from within the trait EoC does not work",
    "effect": { "u_deactivate_trait": "EYEGLEAM" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EYEGLEAM_maintenance",
    "condition": { "and": [ { "u_has_effect": "eyegleam" }, { "not": { "u_has_trait": "EYEGLEAM_UPGRADE" } } ] },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_EYEGLEAM_maintenance_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "50" ] },
              {
                "u_message": "You feel a momentary warmth as you channel stolen blood into your eyes.",
                "type": "mixed"
              },
              {
                "run_eocs": [ "EOC_EYEGLEAM_maintenance" ],
                "time_in_future": {
                  "math": [
                    "rng(0.75,1.25) * (1000 + (vampire_total_tier_one_traits_plus_potency() * 100) + (vampire_total_tier_two_traits() * 225) + (vampire_total_tier_three_traits() * 350) + (vampire_total_tier_four_traits_plus_potence() * 500) + (vampire_total_tier_five_traits_plus_cauldron() * 750))"
                  ]
                }
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to maintain your gleaming eyes.", "type": "bad" },
              { "u_lose_effect": [ "eyegleam", "eyegleam_craft_in_darkness" ] },
              { "u_deactivate_trait": "EYEGLEAM" }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRIC_STRENGTH_activated",
    "condition": { "not": { "u_has_effect": "effect_vampiric_strength" } },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRIC_STRENGTH_activated_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 0.25 },
              { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "150" ] },
              { "u_add_effect": "effect_vampiric_strength", "duration": "PERMANENT" },
              {
                "run_eocs": [ "EOC_VAMPIRIC_STRENGTH_maintenance" ],
                "time_in_future": {
                  "math": [
                    "rng(0.75,1.25) * (750 + (vampire_total_tier_one_traits_plus_potency() * 100) + (vampire_total_tier_two_traits() * 200) + (vampire_total_tier_three_traits() * 300) + (vampire_total_tier_four_traits_plus_potence() * 400) + (vampire_total_tier_five_traits_plus_cauldron() * 500))"
                  ]
                }
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to activate vigor mortis.", "type": "bad" },
              { "run_eocs": "EOC_VAMPIRIC_STRENGTH_deactivate_future", "time_in_future": 0 }
            ]
          }
        ]
      }
    ],
    "false_effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRIC_STRENGTH_deactivated",
            "condition": { "u_has_effect": "effect_vampiric_strength" },
            "effect": [
              { "u_message": "Your muscles weaken as the stolen blood leaves them.", "type": "neutral" },
              { "u_lose_effect": "effect_vampiric_strength" }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRIC_STRENGTH_deactivate_future",
    "//": "This is necessary because calling u_deactivate_trait from within the trait EoC does not work",
    "effect": { "u_deactivate_trait": "VAMPIRIC_STRENGTH" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRIC_STRENGTH_maintenance",
    "condition": { "u_has_effect": "effect_vampiric_strength" },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRIC_STRENGTH_maintenance_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "75" ] },
              {
                "u_message": "You feel a momentary warmth as you channel stolen blood into your muscles.",
                "type": "mixed"
              },
              {
                "run_eocs": [ "EOC_VAMPIRIC_STRENGTH_maintenance" ],
                "time_in_future": {
                  "math": [
                    "rng(0.75,1.25) * (750 + (vampire_total_tier_one_traits_plus_potency() * 100) + (vampire_total_tier_two_traits() * 200) + (vampire_total_tier_three_traits() * 300) + (vampire_total_tier_four_traits_plus_potence() * 400) + (vampire_total_tier_five_traits_plus_cauldron() * 500))"
                  ]
                }
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to maintain your vigor mortis.", "type": "bad" },
              { "u_lose_effect": "effect_vampiric_strength" },
              { "u_deactivate_trait": "VAMPIRIC_STRENGTH" }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRIC_RESILIENCE_activated",
    "condition": { "not": { "u_has_effect": "effect_vampiric_resilience" } },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRIC_RESILIENCE_activated_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 0.25 },
              { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "150" ] },
              { "u_add_effect": "effect_vampiric_resilience", "duration": "PERMANENT" },
              { "u_message": "You feel a surge of power as blood fortifies your flesh.", "type": "good" },
              {
                "run_eocs": [ "EOC_VAMPIRIC_RESILIENCE_maintenance" ],
                "time_in_future": {
                  "math": [
                    "rng(0.75,1.25) * (750 + (vampire_total_tier_one_traits_plus_potency() * 100) + (vampire_total_tier_two_traits() * 200) + (vampire_total_tier_three_traits() * 300) + (vampire_total_tier_four_traits_plus_potence() * 400) + (vampire_total_tier_five_traits_plus_cauldron() * 500))"
                  ]
                }
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to activate sanguine resilience.", "type": "bad" },
              { "run_eocs": "EOC_VAMPIRIC_RESILIENCE_deactivate_future", "time_in_future": 0 }
            ]
          }
        ]
      }
    ],
    "false_effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRIC_RESILIENCE_deactivated",
            "condition": { "u_has_effect": "effect_vampiric_resilience" },
            "effect": [
              { "u_message": "Your muscles weaken as the stolen blood leaves them.", "type": "neutral" },
              { "u_lose_effect": "effect_vampiric_resilience" }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRIC_RESILIENCE_deactivate_future",
    "//": "This is necessary because calling u_deactivate_trait from within the trait EoC does not work",
    "effect": { "u_deactivate_trait": "VAMPIRIC_RESILIENCE" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRIC_RESILIENCE_maintenance",
    "condition": { "u_has_effect": "effect_vampiric_resilience" },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRIC_RESILIENCE_maintenance_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "75" ] },
              {
                "u_message": "You feel a momentary warmth as you channel stolen blood into your flesh.",
                "type": "mixed"
              },
              {
                "run_eocs": [ "EOC_VAMPIRIC_RESILIENCE_maintenance" ],
                "time_in_future": {
                  "math": [
                    "rng(0.75,1.25) * (750 + (vampire_total_tier_one_traits_plus_potency() * 100) + (vampire_total_tier_two_traits() * 200) + (vampire_total_tier_three_traits() * 300) + (vampire_total_tier_four_traits_plus_potence() * 400) + (vampire_total_tier_five_traits_plus_cauldron() * 500))"
                  ]
                }
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to maintain your sanguine resilience.", "type": "bad" },
              { "u_lose_effect": "effect_vampiric_resilience" },
              { "u_deactivate_trait": "VAMPIRIC_RESILIENCE" }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_SCENT_BLOOD_activated",
    "condition": {
      "math": [
        "(u_characters_nearby('radius': 30, 'attitude': 'any') + u_monsters_nearby('mon_feral_cop', 'mon_feral_human_pipe', 'mon_feral_human_crowbar', 'mon_feral_jackboot', 'mon_feral_marine_bayonet', 'mon_feral_soldier', 'mon_feral_prepper_knife', 'mon_feral_sailor_axe', 'mon_feral_maid_knife', 'mon_feral_maid_candlestick', 'mon_feral_officer', 'mon_feral_sailor_lug_wrench', 'mon_feral_sailor_mop', 'mon_feral_maid_broom', 'mon_feral_sailor_wrench', 'mon_feral_swimmer_kickboard', 'mon_feral_armored_battleaxe', 'mon_feral_sapien_spear', 'mon_feral_armored_mace', 'mon_feral_human_tool', 'mon_feral_militia', 'mon_feral_fancy_rapier_fake', 'mon_feral_fancy_rapier', 'mon_feral_human_axe', 'mon_feral_labsecurity_flashlight', 'mon_feral_labsecurity_9mm',  'mon_feral_survivalist', 'mon_feral_scientist_scalpel', 'mon_feral_zebra_agent', 'mon_renfield', 'mon_renfield_9mm', 'mon_renfield_shotgun', 'mon_renfield_flamethrower', 'radius': 30, 'attitude': 'both'))",
        ">=",
        "1"
      ]
    },
    "effect": [ { "u_message": "The scent of fresh blood fills your nostrils.  There is a human nearby.", "type": "good" } ],
    "false_effect": [ { "u_message": "You do not smell any nearby human blood.", "type": "neutral" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_STAMINAFORBLOOD_activated",
    "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
    "effect": [
      { "u_assign_activity": "ACT_GENERIC_EOC", "duration": "1 seconds" },
      { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "100" ] },
      {
        "u_message": "Your veins pulse as your body pushes some of your blood reserves to exhaustion and early dissolution.",
        "type": "good"
      },
      {
        "math": [
          "u_val('stamina')",
          "+=",
          "min((1500 + (vampire_total_tier_one_traits_plus_potency() * 200) + (vampire_total_tier_two_traits() * 450) + (vampire_total_tier_three_traits() * 900) + (vampire_total_tier_four_traits_plus_potence() * 1500) + (vampire_total_tier_five_traits_plus_cauldron() * 2000)), 15000)"
        ]
      }
    ],
    "false_effect": [ { "u_message": "You don't have enough blood to recover any stamina.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_COMMUNE_NIGHT_MAP",
    "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
    "effect": [
      {
        "if": { "and": [ { "math": [ "u_val('pos_z') >= 0" ] }, { "not": "is_day" }, "u_is_outside" ] },
        "then": [
          { "u_cast_spell": { "id": "vampire_map_real" } },
          { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "100" ] },
          { "u_message": "The children of the night tell you what features of the map are nearby." }
        ],
        "else": [ { "u_message": "Without the ability to howl into the wilds of the night, there is no response." } ]
      }
    ],
    "false_effect": [ { "u_message": "You don't have enough blood to summon the creatures of the night.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_COAGULANTWEAVE_activated",
    "condition": { "not": { "u_has_effect": "blood_weave" } },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_COAGULANTWEAVE_activated_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 0.75 },
              { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "500" ] },
              { "u_add_effect": "blood_weave", "duration": "PERMANENT" },
              { "u_lose_effect": "bleed", "target_part": "ALL" },
              {
                "run_eocs": [ "EOC_COAGULANTWEAVE_maintenance" ],
                "time_in_future": {
                  "math": [
                    "rng(0.75,1.25) * (300 + (vampire_total_tier_one_traits_plus_potency() * 33) + (vampire_total_tier_two_traits() * 75) + (vampire_total_tier_three_traits() * 125) + (vampire_total_tier_four_traits_plus_potence() * 200) + (vampire_total_tier_five_traits_plus_cauldron() * 275))"
                  ]
                }
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to activate coagulant weave.", "type": "bad" },
              { "run_eocs": "EOC_COAGULANTWEAVE_deactivate_future", "time_in_future": 0 }
            ]
          }
        ]
      }
    ],
    "false_effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_COAGULANTWEAVE_deactivated",
            "condition": { "u_has_effect": "blood_weave" },
            "effect": [
              { "u_message": "Your blood flows more freely as your grip on it relaxes.", "type": "neutral" },
              { "u_lose_effect": "blood_weave" }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_COAGULANTWEAVE_deactivate_future",
    "//": "This is necessary because calling u_deactivate_trait from within the trait EoC does not work",
    "effect": { "u_deactivate_trait": "COAGULANTWEAVE" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_COAGULANTWEAVE_maintenance",
    "condition": { "u_has_effect": "blood_weave" },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_COAGULANTWEAVE_maintenance_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "250" ] },
              {
                "u_message": "You feel a momentary warmth as you maintain your grip on your stolen blood.",
                "type": "mixed"
              },
              {
                "run_eocs": [ "EOC_COAGULANTWEAVE_maintenance" ],
                "time_in_future": {
                  "math": [
                    "rng(0.75,1.25) * (300 + (vampire_total_tier_one_traits_plus_potency() * 33) + (vampire_total_tier_two_traits() * 75) + (vampire_total_tier_three_traits() * 125) + (vampire_total_tier_four_traits_plus_potence() * 200) + (vampire_total_tier_five_traits_plus_cauldron() * 275))"
                  ]
                }
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to maintain your coagulant weave.", "type": "bad" },
              { "u_lose_effect": "blood_weave" },
              { "u_deactivate_trait": "COAGULANTWEAVE" }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_BLOODHEAL_activated",
    "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
    "effect": [
      { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "750" ] },
      { "u_message": "Blood suffuses your flesh, repairing any damage it comes across.", "type": "good" },
      {
        "if": { "and": [ { "u_has_trait": "DHAMPIR_TRAIT" }, { "u_has_effect": "disabled", "bodypart": "arm_l" } ] },
        "then": { "u_message": "But your left arm is too damaged.  Only time can heal it.", "type": "bad" },
        "else": {
          "math": [
            "u_hp('arm_l')",
            "+=",
            "min((5 + (vampire_total_tier_one_traits() * 0.75) + (vampire_total_tier_two_traits() * 1) + (vampire_total_tier_three_traits() * 1.25) + (vampire_total_tier_four_traits_plus_potence() * 2.5) + (vampire_total_tier_five_traits() * 3.5)), 25)"
          ]
        }
      },
      {
        "if": { "and": [ { "u_has_trait": "DHAMPIR_TRAIT" }, { "u_has_effect": "disabled", "bodypart": "arm_r" } ] },
        "then": { "u_message": "But your right arm is too damaged.  Only time can heal it.", "type": "bad" },
        "else": {
          "math": [
            "u_hp('arm_r')",
            "+=",
            "min((5 + (vampire_total_tier_one_traits() * 0.75) + (vampire_total_tier_two_traits() * 1) + (vampire_total_tier_three_traits() * 1.25) + (vampire_total_tier_four_traits_plus_potence() * 2.5) + (vampire_total_tier_five_traits() * 3.5)), 25)"
          ]
        }
      },
      {
        "if": { "and": [ { "u_has_trait": "DHAMPIR_TRAIT" }, { "u_has_effect": "disabled", "bodypart": "leg_l" } ] },
        "then": { "u_message": "But your left leg is too damaged.  Only time can heal it.", "type": "bad" },
        "else": {
          "math": [
            "u_hp('leg_l')",
            "+=",
            "min((5 + (vampire_total_tier_one_traits() * 0.75) + (vampire_total_tier_two_traits() * 1) + (vampire_total_tier_three_traits() * 1.25) + (vampire_total_tier_four_traits_plus_potence() * 2.5) + (vampire_total_tier_five_traits() * 3.5)), 25)"
          ]
        }
      },
      {
        "if": { "and": [ { "u_has_trait": "DHAMPIR_TRAIT" }, { "u_has_effect": "disabled", "bodypart": "leg_l" } ] },
        "then": { "u_message": "But your right leg is too damaged.  Only time can heal it.", "type": "bad" },
        "else": {
          "math": [
            "u_hp('leg_r')",
            "+=",
            "min((5 + (vampire_total_tier_one_traits() * 0.75) + (vampire_total_tier_two_traits() * 1) + (vampire_total_tier_three_traits() * 1.25) + (vampire_total_tier_four_traits_plus_potence() * 2.5) + (vampire_total_tier_five_traits() * 3.5)), 25)"
          ]
        }
      },
      {
        "math": [
          "u_hp('torso')",
          "+=",
          "min((5 + (vampire_total_tier_one_traits_plus_potency() * 0.75) + (vampire_total_tier_two_traits() * 1) + (vampire_total_tier_three_traits() * 1.25) + (vampire_total_tier_four_traits_plus_potence() * 2.5) + (vampire_total_tier_five_traits_plus_cauldron() * 3.5)), 25)"
        ]
      },
      {
        "math": [
          "u_hp('head')",
          "+=",
          "min((5 + (vampire_total_tier_one_traits_plus_potency() * 0.75) + (vampire_total_tier_two_traits() * 1) + (vampire_total_tier_three_traits() * 1.25) + (vampire_total_tier_four_traits_plus_potence() * 2.5) + (vampire_total_tier_five_traits_plus_cauldron() * 3.5)), 25)"
        ]
      }
    ],
    "false_effect": [ { "u_message": "You don't have enough blood to heal your wounds.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRIC_DODGE_activated",
    "condition": { "not": { "u_has_effect": "effect_vampiric_dodge" } },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRIC_DODGE_activated_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 0.75 },
              { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "250" ] },
              { "u_add_effect": "effect_vampiric_dodge", "duration": "PERMANENT" },
              {
                "run_eocs": [ "EOC_VAMPIRIC_DODGE_maintenance" ],
                "time_in_future": {
                  "math": [
                    "rng(0.75,1.25) * (60 + (vampire_total_tier_one_traits_plus_potency() * 5) + (vampire_total_tier_two_traits() * 12) + (vampire_total_tier_three_traits() * 20) + (vampire_total_tier_four_traits_plus_potence() * 30) + (vampire_total_tier_five_traits_plus_cauldron() * 40))"
                  ]
                }
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to activate flow like blood.", "type": "bad" },
              { "run_eocs": "EOC_VAMPIRIC_DODGE_deactivate_future", "time_in_future": 0 }
            ]
          }
        ]
      }
    ],
    "false_effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRIC_DODGE_deactivate",
            "condition": { "u_has_effect": "effect_vampiric_dodge" },
            "effect": [
              { "u_message": "Your movements slow as your lose your preternatural avoidance.", "type": "neutral" },
              { "u_lose_effect": "effect_vampiric_dodge" }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRIC_DODGE_deactivate_future",
    "//": "This is necessary because calling u_deactivate_trait from within the trait EoC does not work",
    "effect": { "u_deactivate_trait": "VAMPIRIC_DODGE" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRIC_DODGE_maintenance",
    "condition": { "u_has_effect": "effect_vampiric_dodge" },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRIC_DODGE_maintenance_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "125" ] },
              {
                "u_message": "You feel a momentary warmth as you maintain your preternatural dodging.",
                "type": "mixed"
              },
              {
                "run_eocs": [ "EOC_VAMPIRIC_DODGE_maintenance" ],
                "time_in_future": {
                  "math": [
                    "rng(0.75,1.25) * (60 + (vampire_total_tier_one_traits_plus_potency() * 5) + (vampire_total_tier_two_traits() * 12) + (vampire_total_tier_three_traits() * 20) + (vampire_total_tier_four_traits_plus_potence() * 30) + (vampire_total_tier_five_traits_plus_cauldron() * 40))"
                  ]
                }
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to maintain your flow like blood.", "type": "bad" },
              { "u_lose_effect": "effect_vampiric_dodge" },
              { "u_deactivate_trait": "VAMPIRIC_DODGE" }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRIC_STEALTH_BONUS_activated",
    "condition": { "not": { "u_has_effect": "effect_vampiric_stealth_bonus" } },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRIC_STEALTH_BONUS_activated_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 0.75 },
              { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "100" ] },
              { "u_add_effect": "effect_vampiric_stealth_bonus", "duration": "PERMANENT" },
              {
                "run_eocs": [ "EOC_VAMPIRIC_STEALTH_BONUS_maintenance" ],
                "time_in_future": {
                  "math": [
                    "rng(0.75,1.25) * (300 + (vampire_total_tier_one_traits_plus_potency() * 15) + (vampire_total_tier_two_traits() * 20) + (vampire_total_tier_three_traits() * 35) + (vampire_total_tier_four_traits_plus_potence() * 55) + (vampire_total_tier_five_traits_plus_cauldron() * 80))"
                  ]
                }
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to activate cloak of shadows.", "type": "bad" },
              { "run_eocs": "EOC_VAMPIRIC_STEALTH_BONUS_deactivate_future", "time_in_future": 0 }
            ]
          }
        ]
      }
    ],
    "false_effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRIC_STEALTH_BONUS_deactivate",
            "condition": { "u_has_effect": "effect_vampiric_stealth_bonus" },
            "effect": [
              { "u_message": "As your cloak of shadows fades, your presence becomes more obvious.", "type": "neutral" },
              { "u_lose_effect": "effect_vampiric_stealth_bonus" }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRIC_STEALTH_BONUS_deactivate_future",
    "//": "This is necessary because calling u_deactivate_trait from within the trait EoC does not work",
    "effect": { "u_deactivate_trait": "VAMPIRIC_STEALTH_BONUS" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRIC_STEALTH_BONUS_maintenance",
    "condition": { "u_has_effect": "effect_vampiric_stealth_bonus" },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRIC_STEALTH_BONUS_maintenance_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "50" ] },
              { "u_message": "You feel a momentary warmth as you maintain your cloak of shadows.", "type": "mixed" },
              {
                "run_eocs": [ "EOC_VAMPIRIC_STEALTH_BONUS_maintenance" ],
                "time_in_future": {
                  "math": [
                    "rng(0.75,1.25) * (300 + (vampire_total_tier_one_traits_plus_potency() * 15) + (vampire_total_tier_two_traits() * 20) + (vampire_total_tier_three_traits() * 35) + (vampire_total_tier_four_traits_plus_potence() * 55) + (vampire_total_tier_five_traits_plus_cauldron() * 80))"
                  ]
                }
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to maintain your cloak of shadows.", "type": "bad" },
              { "u_lose_effect": "effect_vampiric_stealth_bonus" },
              { "u_deactivate_trait": "VAMPIRIC_STEALTH_BONUS" }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_FEAR_GAZE_activated",
    "condition": { "math": [ "n_vitamin('human_blood_vitamin') >= -500" ] },
    "effect": [
      {
        "math": [
          "u_vampire_fear_gaze_power_level",
          "=",
          "(n_vampire_total_tier_one_traits_plus_potency * 0.5) + (n_vampire_total_tier_two_traits * 0.75) + (n_vampire_total_tier_three_traits * 1) + (n_vampire_total_tier_four_traits * 2) + (n_vampire_total_tier_five_traits_plus_cauldron * 3)"
        ]
      },
      { "math": [ "n_vitamin('human_blood_vitamin')", "-=", "150" ] },
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_FEAR_GAZE_activated_2",
            "condition": { "not": { "u_has_effect": "effect_vampire_fear_gazed" } },
            "effect": [
              {
                "run_eocs": [
                  {
                    "id": "EOC_VAMPIRE_FEAR_GAZE_activated_3",
                    "condition": "u_is_npc",
                    "effect": [
                      { "math": [ "u_npc_fear()", "+=", "u_vampire_fear_gaze_power_level / 2" ] },
                      { "npc_message": "You bare your fangs and hiss at your target." },
                      { "u_add_effect": "effect_vampire_fear_gazed", "duration": "5 minutes" }
                    ],
                    "false_effect": [
                      { "math": [ "u_val('morale')", "-=", "u_vampire_fear_gaze_power_level * 5" ] },
                      { "npc_message": "You bare your fangs and hiss at your target." },
                      { "u_add_effect": "effect_vampire_fear_gazed", "duration": "5 minutes" }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ],
    "false_effect": [ { "npc_message": "You don't have enough blood to activate your predator's mien.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_FEIGN_DEATH_deactivate",
    "effect": [
      {
        "u_run_monster_eocs": [ { "id": "EOC_VAMPIRE_FEIGN_DEATH_SIGHT_CHECK_MONSTER", "effect": { "math": [ "global_you_are_seen = 1" ] } } ],
        "monster_range": 45,
        "monster_must_see": true
      },
      {
        "u_run_npc_eocs": [ { "id": "EOC_VAMPIRE_FEIGN_DEATH_SIGHT_CHECK_NPC", "effect": { "math": [ "global_you_are_seen = 1" ] } } ],
        "npc_range": 45,
        "npc_must_see": true
      },
      {
        "if": { "math": [ "global_you_are_seen == 1" ] },
        "then": { "u_add_effect": "effect_vampire_feign_death_ended", "duration": { "math": [ "rng(180,360)" ] } }
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_BEAST_CLAWS_activated",
    "condition": { "not": { "u_has_trait": "VAMPIRE_BEAST_CLAWS_active" } },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_BEAST_CLAWS_activated_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 0.75 },
              { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "125" ] },
              { "u_add_trait": "VAMPIRE_BEAST_CLAWS_active" },
              {
                "run_eocs": [ "EOC_VAMPIRE_BEAST_CLAWS_maintenance" ],
                "time_in_future": {
                  "math": [
                    "rng(0.75,1.25) * (800 + (vampire_total_tier_one_traits_plus_potency() * 60) + (vampire_total_tier_two_traits() * 100) + (vampire_total_tier_three_traits() * 150) + (vampire_total_tier_four_traits_plus_potence() * 225) + (vampire_total_tier_five_traits_plus_cauldron() * 300))"
                  ]
                }
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to activate your claws of the beast.", "type": "bad" },
              { "run_eocs": "EOC_VAMPIRE_BEAST_CLAWS_deactivate_future", "time_in_future": 0 }
            ]
          }
        ]
      }
    ],
    "false_effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_BEAST_CLAWS_deactivate",
            "condition": { "u_has_trait": "VAMPIRE_BEAST_CLAWS_active" },
            "effect": [
              { "u_message": "Your fingers warp and twist as your claws vanish.", "type": "neutral" },
              { "u_lose_trait": "VAMPIRE_BEAST_CLAWS_active" }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_BEAST_CLAWS_deactivate_future",
    "//": "This is necessary because calling u_deactivate_trait from within the trait EoC does not work",
    "effect": { "u_deactivate_trait": "VAMPIRE_BEAST_CLAWS" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_BEAST_CLAWS_maintenance",
    "condition": { "u_has_trait": "VAMPIRE_BEAST_CLAWS_active" },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_BEAST_CLAWS_maintenance_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "62" ] },
              { "u_message": "You feel a momentary warmth as you maintain your sharp claws.", "type": "mixed" },
              {
                "run_eocs": [ "EOC_VAMPIRE_BEAST_CLAWS_maintenance" ],
                "time_in_future": {
                  "math": [
                    "rng(0.75,1.25) * (800 + (vampire_total_tier_one_traits_plus_potency() * 60) + (vampire_total_tier_two_traits() * 100) + (vampire_total_tier_three_traits() * 150) + (vampire_total_tier_four_traits_plus_potence() * 225) + (vampire_total_tier_five_traits_plus_cauldron() * 300))"
                  ]
                }
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to maintain your claws of the beast.", "type": "bad" },
              { "u_lose_trait": "VAMPIRE_BEAST_CLAWS_active" },
              { "u_deactivate_trait": "VAMPIRE_BEAST_CLAWS" }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_MAGICFORBLOOD_activated",
    "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
    "effect": [
      { "u_assign_activity": "ACT_GENERIC_EOC", "duration": "1 seconds" },
      { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "200" ] },
      {
        "u_message": "Your veins pulse as your body pushes some of your blood reserves to exhaustion and early dissolution.",
        "type": "good"
      },
      {
        "math": [
          "u_val('mana')",
          "+=",
          "min((150 + (vampire_total_tier_one_traits_plus_potency() * 20) + (vampire_total_tier_two_traits() * 45) + (vampire_total_tier_three_traits() * 90) + (vampire_total_tier_four_traits_plus_potence() * 150) + (vampire_total_tier_five_traits_plus_cauldron() * 200)), 1500)"
        ]
      }
    ],
    "false_effect": [ { "u_message": "You don't have enough blood to recover any mana.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_HYPNOTIC_GAZE_activated",
    "condition": { "math": [ "n_vitamin('human_blood_vitamin') >= -500" ] },
    "effect": [
      {
        "math": [
          "u_vampire_hypnotic_gaze_power_level",
          "=",
          "2 + (n_vampire_total_tier_one_traits_plus_potency * 0.5) + (n_vampire_total_tier_two_traits * 0.75) + (n_vampire_total_tier_three_traits * 1.2) + (n_vampire_total_tier_four_traits * 2.5) + (n_vampire_total_tier_five_traits_plus_cauldron * 3.5)"
        ]
      },
      { "math": [ "n_vitamin('human_blood_vitamin')", "-=", "150" ] },
      {
        "run_eocs": [
          {
            "id": "EOC_HYPNOTIC_GAZE_activated_2",
            "effect": [
              {
                "if": { "and": [ { "not": { "u_has_effect": "blind" } }, { "not": { "u_has_flag": "BLIND" } } ] },
                "then": [
                  { "u_add_effect": "effect_vampire_hypnotism", "duration": { "math": [ "u_vampire_hypnotic_gaze_power_level" ] } },
                  { "u_add_effect": "dazed", "duration": { "math": [ "u_vampire_hypnotic_gaze_power_level" ] } }
                ],
                "else": [ { "npc_message": "Your target is unaffected by your gaze!", "type": "bad" } ]
              }
            ]
          }
        ]
      }
    ],
    "false_effect": [ { "npc_message": "You don't have enough blood to activate your hypnotic gaze.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_BLOODHASTE_activated",
    "condition": { "not": { "u_has_effect": "haste_vampire" } },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_BLOODHASTE_activated_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 2 },
              { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "750" ] },
              { "u_add_effect": "haste_vampire", "duration": "PERMANENT" },
              {
                "run_eocs": [ "EOC_BLOODHASTE_maintenance" ],
                "time_in_future": {
                  "math": [
                    "rng(0.75,1.25) * (60 + (vampire_total_tier_one_traits_plus_potency() * 5) + (vampire_total_tier_two_traits() * 12) + (vampire_total_tier_three_traits() * 20)  + (vampire_total_tier_four_traits_plus_potence() * 30) + (vampire_total_tier_five_traits_plus_cauldron() * 40))"
                  ]
                }
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to activate blood-driven speed.", "type": "bad" },
              { "run_eocs": "EOC_BLOODHASTE_deactivate_future", "time_in_future": 0 }
            ]
          }
        ]
      }
    ],
    "false_effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_BLOODHASTE_deactivated",
            "condition": { "u_has_effect": "haste_vampire" },
            "effect": [ { "u_lose_effect": "haste" }, { "u_lose_effect": "haste_vampire" } ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_BLOODHASTE_deactivate_future",
    "//": "This is necessary because calling u_deactivate_trait from within the trait EoC does not work",
    "effect": { "u_deactivate_trait": "BLOODHASTE" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_BLOODHASTE_maintenance",
    "condition": { "u_has_effect": "haste_vampire" },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_BLOODHASTE_maintenance_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "375" ] },
              { "u_message": "You feel a momentary warmth as you maintain your superhuman speed.", "type": "mixed" },
              {
                "run_eocs": [ "EOC_BLOODHASTE_maintenance" ],
                "time_in_future": {
                  "math": [
                    "rng(0.75,1.25) * (60 + (vampire_total_tier_one_traits_plus_potency() * 5) + (vampire_total_tier_two_traits() * 12) + (vampire_total_tier_three_traits() * 20)  + (vampire_total_tier_four_traits_plus_potence() * 30) + (vampire_total_tier_five_traits_plus_cauldron() * 40))"
                  ]
                }
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to maintain your blood-driven speed.", "type": "bad" },
              { "u_lose_effect": "haste_vampire" },
              { "u_lose_effect": "haste" },
              { "u_deactivate_trait": "BLOODHASTE" }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_COMMAND_BEAST_activated",
    "condition": { "math": [ "n_vitamin('human_blood_vitamin') >= -500" ] },
    "effect": [
      { "math": [ "n_vitamin('human_blood_vitamin')", "-=", "500" ] },
      { "u_location_variable": { "context_val": "loc" } },
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_COMMAND_BEAST_activated_2",
            "effect": [
              { "npc_cast_spell": { "id": "vampire_command_beast_spell_real", "min_level": 1 }, "loc": { "context_val": "loc" } },
              { "npc_message": "You exert your predatory will on your target.", "type": "good" }
            ]
          }
        ]
      }
    ],
    "false_effect": [ { "npc_message": "You don't have enough blood to attempt to cow the beast.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_EARTH_SLUMBER_activated",
    "condition": {
      "or": [
        { "u_is_on_terrain_with_flag": "DIGGABLE" },
        { "u_is_on_terrain": "t_soil" },
        { "u_is_on_terrain": "t_rock" },
        { "u_is_on_terrain": "t_dirt_underground" }
      ]
    },
    "effect": [ { "run_eocs": "EOC_VAMPIRE_EARTH_SLUMBER_activated_2" } ],
    "false_effect": [ { "u_message": "You must be on diggable soil to sink into it.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_EARTH_SLUMBER_activated_2",
    "condition": { "not": { "math": [ "u_val('pos_z') == -9" ] } },
    "effect": [
      {
        "run_eocs": {
          "id": "EOC_VAMPIRE_EARTH_SLUMBER_activated_3",
          "effect": [
            { "u_location_variable": { "u_val": "VAMPIRE_sleep_in_earth_starting_point" }, "min_radius": 0, "max_radius": 0 },
            {
              "u_location_variable": { "u_val": "VAMPIRE_sleep_in_earth_destination" },
              "min_radius": 0,
              "max_radius": 0,
              "z_adjust": -9,
              "z_override": true
            },
            { "u_message": "The earth parts beneath you and you sink down into the soil.", "type": "good" },
            { "u_teleport": { "u_val": "VAMPIRE_sleep_in_earth_destination" }, "force": true }
          ]
        }
      }
    ],
    "false_effect": [
      { "u_teleport": { "u_val": "VAMPIRE_sleep_in_earth_starting_point" } },
      { "u_message": "You feel yourself rising until you stand in the clear air once again.", "type": "good" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_TORPOR_activated",
    "effect": [
      { "u_assign_activity": "ACT_VAMPIRE_TORPOR", "duration": "8 hours" },
      { "u_add_effect": "effect_vampire_torpor", "duration": "8 hours" }
    ]
  },
  {
    "id": "ACT_VAMPIRE_TORPOR",
    "type": "activity_type",
    "activity_level": "NO_EXERCISE",
    "verb": "slumbering",
    "based_on": "time",
    "can_resume": false,
    "interruptable": false,
    "interruptable_with_kb": false,
    "rooted": true,
    "do_turn_eoc": "EOC_VAMPIRE_TORPOR_RECOVER",
    "completion_eoc": "EOC_EARTH_SLEEP_CHECK_REAL"
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_TORPOR_RECOVER",
    "effect": [ { "math": [ "u_val('sleepiness') = 0" ] }, { "math": [ "u_val('sleep_deprivation') = 0" ] } ]
  },
  {
    "type": "effect_type",
    "id": "effect_vampire_torpor",
    "name": [ "Torpor" ],
    "desc": [ "Thanks to your torpor you are healing and recovering quickly" ],
    "rating": "good",
    "vitamins": [ { "vitamin": "human_blood_vitamin", "rate": [ [ 1, 1 ] ], "tick": [ "8 m" ] } ],
    "flags": [ "DEAF", "BLIND" ],
    "enchantments": [
      {
        "values": [
          {
            "value": "REGEN_HP",
            "multiply": {
              "math": [
                "(u_vampire_total_tier_one_traits_plus_potency * 0.05) + (u_vampire_total_tier_two_traits * 0.075) + (u_vampire_total_tier_three_traits * 0.1) + (vampire_total_tier_four_traits_plus_potence() * 0.2) + (u_vampire_total_tier_five_traits_plus_cauldron * 0.3)"
              ]
            }
          },
          {
            "value": "MENDING_MODIFIER",
            "multiply": {
              "math": [
                "(u_vampire_total_tier_one_traits_plus_potency * 0.05) + (u_vampire_total_tier_two_traits * 0.075) + (u_vampire_total_tier_three_traits * 0.1) + (vampire_total_tier_four_traits_plus_potence() * 0.2) + (u_vampire_total_tier_five_traits_plus_cauldron * 0.3)"
              ]
            }
          },
          { "value": "REGEN_HP_AWAKE", "multiply": 1 }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_DOMINATE_activated",
    "condition": { "math": [ "n_vitamin('human_blood_vitamin') >= -500" ] },
    "effect": [
      { "math": [ "n_vitamin('human_blood_vitamin')", "-=", "700" ] },
      { "u_location_variable": { "context_val": "loc" } },
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_DOMINATE_activated2",
            "effect": [
              { "npc_cast_spell": { "id": "vampire_dominate_real", "min_level": 1 }, "loc": { "context_val": "loc" } },
              {
                "npc_message": "You focus your gaze on your target's mind, attempting to take control of it.",
                "type": "good"
              }
            ]
          }
        ]
      }
    ],
    "false_effect": [ { "npc_message": "You don't have enough blood to activate your dominating gaze.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_BAT_FORM_activated",
    "condition": { "not": { "u_has_trait": "VAMPIRE_BAT_FORM_TRAITS" } },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_BAT_FORM_activated_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "run_eocs": "EOC_VAMPIRE_CANCEL_WOLF_FORM" },
              { "run_eocs": "EOC_VAMPIRE_CANCEL_MIST_FORM" },
              { "run_eocs": "EOC_VAMPIRE_CANCEL_SHADOW_FORM" },
              { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 1.5 },
              {
                "if": { "u_has_trait": "VAMPIRE_FORM_UPGRADE" },
                "then": { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "300" ] },
                "else": { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "600" ] }
              },
              { "u_add_trait": "VAMPIRE_BAT_FORM_TRAITS" },
              { "u_add_trait": "ECHOLOCATION" },
              { "math": [ "u_calories('dont_affect_weariness': true)", "/=", "4" ] },
              {
                "u_message": "Your fingers lengthen as flaps of skin grow between them and as your legs shorten, you take to the air.",
                "type": "good"
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to transform into a bat.", "type": "bad" },
              { "run_eocs": "EOC_VAMPIRE_BAT_FORM_deactivate_future", "time_in_future": 0 }
            ]
          }
        ]
      }
    ],
    "false_effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_BAT_FORM_deactivated",
            "condition": { "u_has_trait": "VAMPIRE_BAT_FORM_TRAITS" },
            "effect": [
              { "run_eocs": "EOC_VAMPIRE_SHADOW_FORM_deactivated" },
              { "run_eocs": "EOC_VAMPIRE_SHADOW_FORM_deactivate_future", "time_in_future": 0 },
              { "u_message": "Your wings recede and you land on now-humanoid legs.", "type": "neutral" },
              { "u_lose_trait": "VAMPIRE_BAT_FORM_TRAITS" },
              { "u_lose_trait": "ECHOLOCATION" },
              { "math": [ "u_calories('dont_affect_weariness': true)", "*=", "4" ] },
              { "math": [ "u_spell_level('vampire_bat_form_fly_upward') = -1" ] }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_BAT_FORM_deactivate_future",
    "//": "This is necessary because calling u_deactivate_trait from within the trait EoC does not work",
    "effect": { "u_deactivate_trait": "VAMPIRE_BAT_FORM" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_WOLF_FORM_activated",
    "condition": { "not": { "u_has_trait": "VAMPIRE_WOLF_FORM_TRAITS" } },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_WOLF_FORM_activated_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "run_eocs": "EOC_VAMPIRE_CANCEL_BAT_FORM" },
              { "run_eocs": "EOC_VAMPIRE_CANCEL_MIST_FORM" },
              { "run_eocs": "EOC_VAMPIRE_CANCEL_SHADOW_FORM" },
              { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 1.5 },
              {
                "if": { "u_has_trait": "VAMPIRE_FORM_UPGRADE" },
                "then": { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "300" ] },
                "else": { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "600" ] }
              },
              { "u_add_trait": "VAMPIRE_WOLF_FORM_TRAITS" },
              {
                "u_message": "Your nose pushes out into a muzzle as you fall forward on all fours and let out a snarl.",
                "type": "good"
              }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to transform into a wolf.", "type": "bad" },
              { "run_eocs": "EOC_VAMPIRE_WOLF_FORM_deactivate_future", "time_in_future": 0 }
            ]
          }
        ]
      }
    ],
    "false_effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_WOLF_FORM_deactivated",
            "condition": { "u_has_trait": "VAMPIRE_WOLF_FORM_TRAITS" },
            "effect": [
              { "u_message": "Your fur disappears and you walk once again on two legs.", "type": "neutral" },
              { "u_lose_trait": "VAMPIRE_WOLF_FORM_TRAITS" }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_WOLF_FORM_deactivate_future",
    "//": "This is necessary because calling u_deactivate_trait from within the trait EoC does not work",
    "effect": { "u_deactivate_trait": "VAMPIRE_WOLF_FORM" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_MIST_FORM_activated",
    "condition": { "not": { "u_has_trait": "VAMPIRE_MIST_FORM_TRAITS" } },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_MIST_FORM_activated_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": [
              { "run_eocs": "EOC_VAMPIRE_CANCEL_BAT_FORM" },
              { "run_eocs": "EOC_VAMPIRE_CANCEL_WOLF_FORM" },
              { "run_eocs": "EOC_VAMPIRE_CANCEL_SHADOW_FORM" },
              { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 1.5 },
              {
                "if": { "u_has_trait": "VAMPIRE_FORM_UPGRADE" },
                "then": { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "300" ] },
                "else": { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "600" ] }
              },
              { "u_add_trait": "VAMPIRE_MIST_FORM_TRAITS" },
              { "u_add_effect": "effect_vampire_mist_form", "duration": "PERMANENT" },
              { "u_add_effect": "incorporeal", "duration": "PERMANENT" },
              { "math": [ "u_spell_level('vampire_mist_form_pass_through_doors_and_windows') = 0" ] },
              { "u_message": "Your body falls apart into billowing mist.", "type": "good" }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to transform into mist.", "type": "bad" },
              { "run_eocs": "EOC_VAMPIRE_MIST_FORM_deactivate_future", "time_in_future": 0 }
            ]
          }
        ]
      }
    ],
    "false_effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_MIST_FORM_deactivated",
            "condition": { "u_has_trait": "VAMPIRE_MIST_FORM_TRAITS" },
            "effect": [
              { "u_message": "You reconstitute yourself from the billowing mists.", "type": "neutral" },
              { "u_lose_effect": [ "effect_vampire_mist_form", "incorporeal" ] },
              { "u_lose_trait": "VAMPIRE_MIST_FORM_TRAITS" },
              { "math": [ "u_spell_level('vampire_mist_form_pass_through_doors_and_windows') = -1" ] }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_MIST_FORM_deactivate_future",
    "//": "This is necessary because calling u_deactivate_trait from within the trait EoC does not work",
    "effect": { "u_deactivate_trait": "VAMPIRE_MIST_FORM" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_MIST_FORM_BLOOD_COST",
    "eoc_type": "EVENT",
    "required_event": "avatar_moves",
    "condition": { "u_has_trait": "VAMPIRE_MIST_FORM_TRAITS" },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_MIST_FORM_BLOOD_COST_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "2" ] },
            "false_effect": [
              { "u_message": "You don't have enough blood to maintain your mist form.", "type": "bad" },
              { "run_eocs": "EOC_VAMPIRE_MIST_FORM_deactivated" },
              { "run_eocs": "EOC_VAMPIRE_MIST_FORM_deactivate_future", "time_in_future": 0 }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_MIST_FORM_SEEP_THROUGH_DOOR_WINDOW",
    "effect": [
      {
        "u_choose_adjacent_highlight": { "context_val": "vampire_mist_door_or_window_seep" },
        "condition": {
          "or": [
            { "map_terrain_with_flag": "DOOR", "loc": { "context_val": "loc" } },
            { "map_terrain_with_flag": "WINDOW", "loc": { "context_val": "loc" } }
          ]
        },
        "message": "Select door or window."
      },
      {
        "if": { "math": [ "has_var(_vampire_mist_door_or_window_seep)" ] },
        "then": [
          {
            "u_choose_adjacent_highlight": { "context_val": "place_to_teleport" },
            "target_var": { "context_val": "vampire_mist_door_or_window_seep" },
            "condition": {
              "and": [
                { "not": { "is_outside": { "context_val": "loc" } } },
                { "not": { "map_terrain_with_flag": "WALL", "loc": { "context_val": "loc" } } },
                { "not": { "map_terrain_with_flag": "DOOR", "loc": { "context_val": "loc" } } },
                { "not": { "map_terrain_with_flag": "WINDOW", "loc": { "context_val": "loc" } } }
              ]
            },
            "message": "Select where to appear."
          },
          {
            "u_teleport": { "context_val": "place_to_teleport" },
            "success_message": "In a second, you were always inside."
          }
        ],
        "else": { "u_message": "You must be near a door or window to seep through." }
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "eoc_vampire_blood_to_kcal",
    "//": "Check if the vampire is underweight or lower for their size category.  If yes, consume some blood to increase their calories.  Conversion rate of 1 blood vitamin to 5 calories, in 500 calories chunks.",
    "//2": "95000 Kcal is within the normal range for a medium-sized character for both short and tall.  This value is then multiplied or divided to account for the player's size category.  The following EOCs are listed according to the code's check order.",
    "recurrence": [ "50 m", "70 m" ],
    "condition": { "u_has_trait": "BLOOD_DRINKER" },
    "deactivate_condition": { "not": { "u_has_trait": "BLOOD_DRINKER" } },
    "effect": [
      { "math": [ "u_calories_needed = 95000" ] },
      {
        "run_eocs": [
          {
            "id": "eoc_vampire_blood_to_kcal_check_size_tiny",
            "condition": { "u_has_flag": "TINY" },
            "effect": [ { "math": [ "u_calories_needed", "/=", "8" ] }, { "run_eocs": "eoc_vampire_blood_to_kcal_convert" } ],
            "false_effect": [ { "run_eocs": [ "eoc_vampire_blood_to_kcal_check_size_small" ] } ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "eoc_vampire_blood_to_kcal_check_size_small",
    "condition": { "u_has_flag": "SMALL" },
    "effect": [ { "math": [ "u_calories_needed", "/=", "3" ] }, { "run_eocs": "eoc_vampire_blood_to_kcal_convert" } ],
    "false_effect": [ { "run_eocs": [ "eoc_vampire_blood_to_kcal_check_size_large" ] } ]
  },
  {
    "type": "effect_on_condition",
    "id": "eoc_vampire_blood_to_kcal_check_size_large",
    "condition": { "u_has_flag": "LARGE" },
    "effect": [ { "math": [ "u_calories_needed", "*=", "1.5" ] }, { "run_eocs": "eoc_vampire_blood_to_kcal_convert" } ],
    "false_effect": [ { "run_eocs": [ "eoc_vampire_blood_to_kcal_check_size_huge" ] } ]
  },
  {
    "type": "effect_on_condition",
    "id": "eoc_vampire_blood_to_kcal_check_size_huge",
    "condition": { "u_has_flag": "HUGE" },
    "effect": [ { "math": [ "u_calories_needed", "*=", "2" ] }, { "run_eocs": "eoc_vampire_blood_to_kcal_convert" } ],
    "false_effect": [ { "run_eocs": [ "eoc_vampire_blood_to_kcal_convert" ] } ]
  },
  {
    "type": "effect_on_condition",
    "id": "eoc_vampire_blood_to_kcal_convert",
    "condition": {
      "and": [
        { "math": [ "u_vitamin('human_blood_vitamin') > 500" ] },
        { "math": [ "u_calories('dont_affect_weariness': true) < u_calories_needed" ] }
      ]
    },
    "effect": [
      { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "100" ] },
      { "math": [ "u_calories('dont_affect_weariness': true)", "+=", "500" ] },
      {
        "u_message": "Some of your stolen blood is consumed by your body, making it a little less gaunt.",
        "type": "good"
      }
    ]
  },
  {
    "type": "enchantment",
    "id": "ench_vampire_no_gorge_issues",
    "has": "HELD",
    "condition": "ALWAYS",
    "ench_effects": [ { "effect": "effect_vampire_no_gorge_issues", "intensity": 1 } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_SHADOW_FORM_activated",
    "condition": { "not": { "u_has_trait": "VAMPIRE_SHADOW_FORM_TRAITS" } },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_SHADOW_FORM_activated_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= 500" ] },
            "effect": [
              { "run_eocs": "EOC_VAMPIRE_CANCEL_BAT_FORM" },
              { "run_eocs": "EOC_VAMPIRE_CANCEL_WOLF_FORM" },
              { "run_eocs": "EOC_VAMPIRE_CANCEL_MIST_FORM" },
              { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 1.5 },
              {
                "if": { "u_has_trait": "VAMPIRE_FORM_UPGRADE" },
                "then": { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "400" ] },
                "else": { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "800" ] }
              },
              { "u_add_trait": "VAMPIRE_SHADOW_FORM_TRAITS" },
              { "u_message": "Shadows surround you until only your now-glowing eyes remain visible.", "type": "good" }
            ],
            "false_effect": [
              { "u_message": "You don't have enough blood to shroud yourself in shadow.", "type": "bad" },
              { "run_eocs": "EOC_VAMPIRE_SHADOW_FORM_deactivate_future", "time_in_future": 0 }
            ]
          }
        ]
      }
    ],
    "false_effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_SHADOW_FORM_deactivated",
            "condition": { "u_has_trait": "VAMPIRE_SHADOW_FORM_TRAITS" },
            "effect": [
              { "u_message": "Your eyes stop glowing and the shadows surrounding you dissipate.", "type": "neutral" },
              { "u_lose_trait": "VAMPIRE_SHADOW_FORM_TRAITS" }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_SHADOW_FORM_deactivate_future",
    "//": "This is necessary because calling u_deactivate_trait from within the trait EoC does not work",
    "effect": { "u_deactivate_trait": "VAMPIRE_SHADOW_FORM" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_SHADOW_FORM_BLOOD_COST",
    "recurrence": [ "1 s", "1 s" ],
    "condition": { "u_has_trait": "VAMPIRE_SHADOW_FORM_TRAITS" },
    "deactivate_condition": { "not": { "u_has_trait": "VAMPIRE_SHADOW_FORM_TRAITS" } },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_SHADOW_FORM_BLOOD_COST_2",
            "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
            "effect": { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "5" ] },
            "false_effect": [
              { "u_message": "You don't have enough blood to maintain the shadows surrounding you.", "type": "bad" },
              { "run_eocs": "EOC_VAMPIRE_SHADOW_FORM_deactivated" },
              { "run_eocs": "EOC_VAMPIRE_SHADOW_FORM_deactivate_future", "time_in_future": 0 }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_CANCEL_BAT_FORM",
    "//": "This checks for that shape, and toggle it off if found.",
    "condition": { "u_has_trait": "VAMPIRE_BAT_FORM_TRAITS" },
    "effect": { "u_deactivate_trait": "VAMPIRE_BAT_FORM" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_CANCEL_WOLF_FORM",
    "//": "This checks for that shape, and toggle it off if found.",
    "condition": { "u_has_trait": "VAMPIRE_WOLF_FORM_TRAITS" },
    "effect": { "u_deactivate_trait": "VAMPIRE_WOLF_FORM" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_CANCEL_MIST_FORM",
    "//": "This checks for that shape, and toggle it off if found.",
    "condition": { "u_has_trait": "VAMPIRE_MIST_FORM_TRAITS" },
    "effect": { "u_deactivate_trait": "VAMPIRE_MIST_FORM" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_CANCEL_SHADOW_FORM",
    "//": "This checks for that shape, and toggle it off if found.",
    "condition": { "u_has_trait": "VAMPIRE_SHADOW_FORM_TRAITS" },
    "effect": { "u_deactivate_trait": "VAMPIRE_SHADOW_FORM" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_last_breath_mist",
    "//": "This EOC is called when the player dies.  If the player has enough blood and this ability isn't in cooldown, it'll save their life and execute multiple effects.  If it can't trigger, the player dies as usual.",
    "eoc_type": "PREVENT_DEATH",
    "condition": {
      "and": [
        { "u_has_trait": "VAMPIRE_LAST_BREATH_MIST" },
        { "not": { "u_has_effect": "last_breath_mist_cooldown" } },
        { "math": [ "u_vitamin('human_blood_vitamin') >= 1800" ] }
      ]
    },
    "effect": [
      "u_prevent_death",
      { "run_eocs": [ "EOC_VAMPIRE_MIST_FORM_TRAIT_activated" ] },
      { "math": [ "u_hp('torso') = max( u_hp('torso'), 30)" ] },
      { "math": [ "u_hp('head') = max( u_hp('head'), 30)" ] },
      { "math": [ "u_hp('arm_l') = max( u_hp('arm_l'), 30)" ] },
      { "math": [ "u_hp('arm_r') = max( u_hp('arm_r'), 30)" ] },
      { "math": [ "u_hp('leg_l') = max( u_hp('leg_l'), 30)" ] },
      { "math": [ "u_hp('leg_r') = max( u_hp('leg_r'), 30)" ] },
      {
        "u_lose_effect": [
          "downed",
          "stunned",
          "corroding",
          "onfire",
          "dazed",
          "venom_blind",
          "formication",
          "blisters",
          "frostbite",
          "frostbite_recovery",
          "wet",
          "slimed",
          "migo_atmosphere",
          "fetid_goop",
          "sap",
          "nausea",
          "bleed"
        ]
      },
      { "math": [ "u_pain() = 0" ] },
      { "math": [ "u_vitamin('redcells') = 0" ] },
      { "math": [ "u_vitamin('blood') = 0" ] },
      { "math": [ "u_pain() = 0" ] },
      { "math": [ "u_val('rad') = 0" ] },
      { "u_location_variable": { "global_val": "last_breath_new_pos" }, "min_radius": 25, "max_radius": 30 },
      { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "2400" ] },
      {
        "if": { "u_has_trait": "VAMPIRE_LAST_BREATH_MIST_UPGRADE" },
        "then": [ { "u_add_effect": "last_breath_mist_cooldown", "duration": "84 hours" } ],
        "else": [ { "u_add_effect": "last_breath_mist_cooldown", "duration": "168 hours" } ]
      },
      { "u_teleport": { "global_val": "last_breath_new_pos" }, "force": true },
      {
        "u_message": "As you are about to die, your body instinctively turns to mist before reappearing nearby with some of its wounds closed.",
        "popup": true
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_MIST_FORM_TRAIT_activated",
    "//": "Ensure the trait properly activates when the ability triggers",
    "effect": { "u_activate_trait": "VAMPIRE_MIST_FORM" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_MIST_FORM_BEFORE_LAST_BREATH",
    "//": "Makes gaining last breath's mist without knowing mist form grants mist form instead.",
    "condition": { "and": [ { "u_has_trait": "VAMPIRE_LAST_BREATH_MIST" }, { "not": { "u_has_trait": "VAMPIRE_MIST_FORM" } } ] },
    "effect": [ { "u_lose_trait": "VAMPIRE_LAST_BREATH_MIST" }, { "u_add_trait": "VAMPIRE_MIST_FORM" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_BLIND_THE_SUN",
    "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= 2000" ] },
    "effect": {
      "run_eocs": [
        {
          "id": "EOC_BLIND_THE_SUN_CHECK_FOR_STORM",
          "condition": { "or": [ { "is_weather": "portal_storm" }, { "is_weather": "early_portal_storm" } ] },
          "effect": [
            {
              "u_message": "You feel that the anomalous energies of the storm would do quick work of any darkness you could summon, so you decide to not attempt to blot out the sun for now.",
              "type": "bad"
            }
          ],
          "false_effect": [
            { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "3000" ] },
            {
              "math": [
                "sunless_time",
                "=",
                "rng(0.75,1.25) * (300 + (vampire_total_tier_one_traits_plus_potency() * 33) + (vampire_total_tier_two_traits() * 75) + (vampire_total_tier_three_traits() * 125) + (vampire_total_tier_four_traits_plus_potence() * 200) + (vampire_total_tier_five_traits_plus_cauldron() * 270))"
              ]
            },
            { "run_eocs": [ "EOC_BLOT_THE_SUN" ] },
            { "run_eocs": "EOC_UNBLOT_THE_SUN", "time_in_future": { "math": [ "sunless_time" ] } },
            {
              "u_message": "Using your mastery over the Shadowed Path, you blot out the sun, covering the region around you in darkness for a short period of time.",
              "type": "good"
            }
          ]
        }
      ]
    },
    "false_effect": [ { "u_message": "You don't have enough blood to blot out the sun.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_BLOT_THE_SUN",
    "effect": [ { "math": [ "blotted_sun = 1" ] }, "next_weather" ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_UNBLOT_THE_SUN",
    "effect": [
      { "math": [ "blotted_sun = 0" ] },
      "next_weather",
      { "u_message": "The darkness you summoned fades away, clearing the sky.", "type": "bad" }
    ]
  },
  {
    "id": "EOC_NEED_LIVING_BLOOD_GIVE_EFFECT",
    "type": "effect_on_condition",
    "condition": { "u_has_trait": "VAMPIRE_WEAKNESS_NEED_LIVING_BLOOD" },
    "deactivate_condition": { "not": { "u_has_trait": "VAMPIRE_WEAKNESS_NEED_LIVING_BLOOD" } },
    "recurrence": [ "2 days", "3 days" ],
    "effect": [
      {
        "u_add_effect": "vampire_need_living_blood",
        "intensity": { "math": [ "u_effect_intensity('vampire_need_living_blood') + 1" ] },
        "duration": "PERMANENT"
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTH_SLEEP_CHECK",
    "//": "This allows the torpor EOC to run the check without needing an extra copy of the EOC.",
    "eoc_type": "EVENT",
    "required_event": "character_wakes_up",
    "effect": [ { "run_eocs": "EOC_EARTH_SLEEP_CHECK_REAL" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTH_SLEEP_CHECK_REAL",
    "condition": {
      "or": [
        { "math": [ "u_val('pos_z') <= -1" ] },
        {
          "and": [
            {
              "or": [
                { "u_is_on_terrain_with_flag": "DIGGABLE" },
                { "u_is_on_terrain": "t_rock_floor" },
                { "u_is_on_terrain": "t_rock_floor_no_roof" }
              ]
            },
            { "not": { "u_is_on_terrain": "t_vitrified_sand" } },
            { "not": { "u_is_on_terrain": "t_pit_corpsed" } },
            { "not": { "u_is_on_terrain": "t_fungus" } },
            { "not": { "u_is_on_terrain": "t_glassed_sand" } },
            { "not": { "u_is_on_terrain": "t_rubber_mulch" } },
            { "not": { "u_is_on_terrain": "t_swater_surf" } },
            { "not": { "u_is_on_terrain": "t_woodchips" } }
          ]
        }
      ]
    },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_EARTH_SLEEP_CHECK_SATISFIED",
            "condition": { "u_has_trait": "VAMPIRE_WEAKNESS_EARTH_SLEEP" },
            "effect": [ { "u_message": "Your sleep has been restful, thanks to the proximity of the earth.", "type": "info" } ]
          }
        ]
      }
    ],
    "false_effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_EARTH_SLEEP_CHECK_PENALTY",
            "condition": { "u_has_trait": "VAMPIRE_WEAKNESS_EARTH_SLEEP" },
            "effect": [
              { "u_add_effect": "effect_earth_sleeper_penalty", "duration": "24 hours", "intensity": 1 },
              { "math": [ "u_val('sleepiness')", "+=", "550" ] },
              {
                "u_message": "You struggle to awaken, feeling tired and weakened.  Having slept away from the earth, your sleep wasn't as restful as it should've been.",
                "type": "bad"
              }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_HOLY_BURN_CHECK",
    "eoc_type": "EVENT",
    "required_event": "avatar_enters_omt",
    "condition": { "u_has_trait": "VAMPIRE_WEAKNESS_HOLY_BURN" },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_HOLY_BURN_CHECK_2",
            "condition": {
              "or": [
                { "u_near_om_location": "church_1", "range": 1 },
                { "u_near_om_location": "church_2ndfloor_1", "range": 1 },
                { "u_near_om_location": "church_3rdfloor_1", "range": 1 },
                { "u_near_om_location": "church_roof_1", "range": 1 },
                { "u_near_om_location": "rural_church_parking", "range": 1 },
                { "u_near_om_location": "rural_church", "range": 1 },
                { "u_near_om_location": "rural_church_basement", "range": 1 },
                { "u_near_om_location": "rural_church_steeple", "range": 1 },
                { "u_near_om_location": "rural_church_steeple_roof", "range": 1 },
                { "u_near_om_location": "cathedral_7_NW", "range": 1 },
                { "u_near_om_location": "cathedral_7_NE", "range": 1 },
                { "u_near_om_location": "cathedral_6_NW", "range": 1 },
                { "u_near_om_location": "cathedral_6_NE", "range": 1 },
                { "u_near_om_location": "cathedral_5_NW", "range": 1 },
                { "u_near_om_location": "cathedral_5_NE", "range": 1 },
                { "u_near_om_location": "cathedral_4_NW", "range": 1 },
                { "u_near_om_location": "cathedral_4_NE", "range": 1 },
                { "u_near_om_location": "cathedral_7_NW", "range": 1 },
                { "u_near_om_location": "cathedral_7_NE", "range": 1 },
                { "u_near_om_location": "cathedral_6_NW", "range": 1 },
                { "u_near_om_location": "cathedral_6_NE", "range": 1 },
                { "u_near_om_location": "cathedral_5_NW", "range": 1 },
                { "u_near_om_location": "cathedral_5_NE", "range": 1 },
                { "u_near_om_location": "cathedral_4_NW", "range": 1 },
                { "u_near_om_location": "cathedral_4_NE", "range": 1 },
                { "u_near_om_location": "cathedral_3_NW", "range": 1 },
                { "u_near_om_location": "cathedral_3_NE", "range": 1 },
                { "u_near_om_location": "cathedral_3_SW", "range": 1 },
                { "u_near_om_location": "cathedral_3_SE", "range": 1 },
                { "u_near_om_location": "cathedral_2_NW", "range": 1 },
                { "u_near_om_location": "cathedral_2_NE", "range": 1 },
                { "u_near_om_location": "cathedral_2_SW", "range": 1 },
                { "u_near_om_location": "cathedral_2_SE", "range": 1 },
                { "u_near_om_location": "cathedral_1_NW", "range": 1 },
                { "u_near_om_location": "cathedral_1_NE", "range": 1 },
                { "u_near_om_location": "cathedral_1_SW", "range": 1 },
                { "u_near_om_location": "cathedral_1_SE", "range": 1 },
                { "u_near_om_location": "cathedral_b_NW", "range": 1 },
                { "u_near_om_location": "cathedral_b_NE", "range": 1 },
                { "u_near_om_location": "cathedral_b_SW", "range": 1 },
                { "u_near_om_location": "cathedral_b_SE", "range": 1 },
                { "u_near_om_location": "synagogue", "range": 1 },
                { "u_near_om_location": "synagogue_roof", "range": 1 },
                { "u_near_om_location": "synagogue_upper_roof", "range": 1 }
              ]
            },
            "effect": [
              { "u_add_effect": "effect_holy_place_burn", "duration": 100, "target_part": "arm_l" },
              { "u_add_effect": "effect_holy_place_burn", "duration": 100, "target_part": "arm_r" },
              { "u_add_effect": "effect_holy_place_burn", "duration": 100, "target_part": "leg_l" },
              { "u_add_effect": "effect_holy_place_burn", "duration": 100, "target_part": "leg_r" },
              { "u_add_effect": "effect_holy_place_burn", "duration": 100, "target_part": "torso" },
              { "u_add_effect": "effect_holy_place_burn", "duration": 100, "target_part": "head" },
              {
                "u_message": "You are too close to a holy place!  You must flee its proximity immediately or you will die!",
                "type": "bad"
              }
            ],
            "false_effect": [
              {
                "run_eocs": [
                  {
                    "id": "EOC_HOLY_BURN_CHECK_REMOVE",
                    "condition": {
                      "or": [
                        { "math": [ "u_effect_intensity('effect_holy_place_burn', 'bodypart': 'arm_l') >= 1" ] },
                        { "math": [ "u_effect_intensity('effect_holy_place_burn', 'bodypart': 'arm_r') >= 1" ] },
                        { "math": [ "u_effect_intensity('effect_holy_place_burn', 'bodypart': 'leg_l') >= 1" ] },
                        { "math": [ "u_effect_intensity('effect_holy_place_burn', 'bodypart': 'leg_r') >= 1" ] },
                        { "math": [ "u_effect_intensity('effect_holy_place_burn', 'bodypart': 'torso') >= 1" ] },
                        { "math": [ "u_effect_intensity('effect_holy_place_burn', 'bodypart': 'head') >= 1" ] }
                      ]
                    },
                    "effect": [
                      { "u_lose_effect": "effect_holy_place_burn", "target_part": "arm_l" },
                      { "u_lose_effect": "effect_holy_place_burn", "target_part": "arm_r" },
                      { "u_lose_effect": "effect_holy_place_burn", "target_part": "leg_l" },
                      { "u_lose_effect": "effect_holy_place_burn", "target_part": "leg_r" },
                      { "u_lose_effect": "effect_holy_place_burn", "target_part": "torso" },
                      { "u_lose_effect": "effect_holy_place_burn", "target_part": "head" },
                      {
                        "u_message": "You are now far enough from the holy place.  You no longer feel like you're burning up.",
                        "type": "good"
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAST_WATER_BURN_CHECK",
    "eoc_type": "EVENT",
    "required_event": "avatar_enters_omt",
    "condition": { "u_has_trait": "VAMPIRE_WEAKNESS_VAST_WATER_BURN" },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAST_WATER_BURN_CHECK_2",
            "condition": {
              "or": [
                { "u_near_om_location": "generic_river_bank", "range": 1 },
                { "u_near_om_location": "generic_river", "range": 1 },
                { "u_near_om_location": "river_center", "range": 1 },
                { "u_near_om_location": "river", "range": 1 },
                { "u_near_om_location": "river_c_not_ne", "range": 1 },
                { "u_near_om_location": "river_c_not_nw", "range": 1 },
                { "u_near_om_location": "river_c_not_se", "range": 1 },
                { "u_near_om_location": "river_c_not_sw", "range": 1 },
                { "u_near_om_location": "lake_shore", "range": 1 },
                { "u_near_om_location": "lake_surface", "range": 1 },
                { "u_near_om_location": "ocean", "range": 1 },
                { "u_near_om_location": "ocean_shore", "range": 1 },
                { "u_near_om_location": "ocean_surface", "range": 1 },
                { "u_near_om_location": "ocean_bed", "range": 1 },
                { "u_near_om_location": "ocean_water_cube", "range": 1 },
                { "u_near_om_location": "ocean_surface", "range": 1 }
              ]
            },
            "effect": [
              { "u_add_effect": "effect_vast_water_burn", "duration": 100, "target_part": "arm_l" },
              { "u_add_effect": "effect_vast_water_burn", "duration": 100, "target_part": "arm_r" },
              { "u_add_effect": "effect_vast_water_burn", "duration": 100, "target_part": "leg_l" },
              { "u_add_effect": "effect_vast_water_burn", "duration": 100, "target_part": "leg_r" },
              { "u_add_effect": "effect_vast_water_burn", "duration": 100, "target_part": "torso" },
              { "u_add_effect": "effect_vast_water_burn", "duration": 100, "target_part": "head" },
              {
                "u_message": "You are too close to a vast body of water!  You must flee its proximity immediately or you will die!",
                "type": "bad"
              }
            ],
            "false_effect": [
              {
                "run_eocs": [
                  {
                    "id": "EOC_VAST_WATER_CHECK_REMOVE",
                    "condition": {
                      "or": [
                        { "math": [ "u_effect_intensity('effect_vast_water_burn', 'bodypart': 'arm_l') >= 1" ] },
                        { "math": [ "u_effect_intensity('effect_vast_water_burn', 'bodypart': 'arm_r') >= 1" ] },
                        { "math": [ "u_effect_intensity('effect_vast_water_burn', 'bodypart': 'leg_l') >= 1" ] },
                        { "math": [ "u_effect_intensity('effect_vast_water_burn', 'bodypart': 'leg_r') >= 1" ] },
                        { "math": [ "u_effect_intensity('effect_vast_water_burn', 'bodypart': 'torso') >= 1" ] },
                        { "math": [ "u_effect_intensity('effect_vast_water_burn', 'bodypart': 'head') >= 1" ] }
                      ]
                    },
                    "effect": [
                      { "u_lose_effect": "effect_vast_water_burn", "target_part": "arm_l" },
                      { "u_lose_effect": "effect_vast_water_burn", "target_part": "arm_r" },
                      { "u_lose_effect": "effect_vast_water_burn", "target_part": "leg_l" },
                      { "u_lose_effect": "effect_vast_water_burn", "target_part": "leg_r" },
                      { "u_lose_effect": "effect_vast_water_burn", "target_part": "torso" },
                      { "u_lose_effect": "effect_vast_water_burn", "target_part": "head" },
                      {
                        "u_message": "You are now far enough from the vast water.  You no longer feel like you're melting.",
                        "type": "good"
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_BLOOD_CRAVING_START",
    "recurrence": [ "10 hours", "16 hours" ],
    "condition": {
      "and": [ { "u_has_trait": "VAMPIRE_WEAKNESS_BLOOD_CRAVING" }, { "not": { "u_has_effect": "effect_drank_blood_recently" } } ]
    },
    "deactivate_condition": { "not": { "u_has_trait": "VAMPIRE_WEAKNESS_BLOOD_CRAVING" } },
    "effect": [
      { "run_eocs": "EOC_BLOOD_CRAVING_CAUSE", "time_in_future": [ "3 minutes", "6 minutes" ] },
      {
        "u_message": "You feel a growing craving for blood.  If you do not drink blood soon, the craving will grow unbearable for a short time.",
        "type": "bad"
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_BLOOD_CRAVING_CAUSE",
    "condition": {
      "and": [ { "u_has_trait": "VAMPIRE_WEAKNESS_BLOOD_CRAVING" }, { "not": { "u_has_effect": "effect_drank_blood_recently" } } ]
    },
    "effect": [ { "u_add_effect": "blood_craving", "intensity": 1, "duration": { "math": [ "400 + rand(600)" ] } } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_NO_FUN_CHECK",
    "recurrence": [ "2 s", "4 s" ],
    "//": "It is intended to take an instant before the mood is neutralized.  Like Tantalus can try to grasp the fruits he cannot reach, the vampire can try to feel joy as they want but won't ever truly succeed without blood.",
    "//2": "It stops them from feeling joy, but it also makes them unhappier when unhappy.",
    "condition": {
      "and": [ { "u_has_trait": "VAMPIRE_WEAKNESS_NO_FUN" }, { "not": { "u_has_effect": "effect_drank_blood_recently" } } ]
    },
    "deactivate_condition": { "not": { "u_has_trait": "VAMPIRE_WEAKNESS_NO_FUN" } },
    "effect": [
      { "u_lose_morale": "morale_vw_no_fun" },
      { "math": [ "u_morale_vw_no_fun = 15 + (u_val('morale'))" ] },
      {
        "u_add_morale": "morale_vw_no_fun",
        "bonus": { "math": [ "u_morale_vw_no_fun * -1" ] },
        "max_bonus": { "math": [ "u_morale_vw_no_fun * -1" ] },
        "duration": "1 hour",
        "decay_start": "1 hour"
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_INVISIBLE_IN_DARK",
    "condition": { "math": [ "u_vitamin('human_blood_vitamin') >= -500" ] },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_VAMPIRE_INVISIBLE_IN_DARK_2",
            "condition": { "not": { "and": [ "is_day", "u_is_outside", { "not": { "is_weather": "blotted_sun" } } ] } },
            "effect": [
              { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 0.25 },
              { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "300" ] },
              {
                "u_add_effect": "effect_vampire_invisible_in_dark",
                "duration": {
                  "math": [
                    "rng(0.75,1.25) * (200 + (vampire_total_tier_one_traits_plus_potency() * 20) + (vampire_total_tier_two_traits() * 45) + (vampire_total_tier_three_traits() * 70) + (vampire_total_tier_four_traits_plus_potence() * 100) + (vampire_total_tier_five_traits_plus_cauldron() * 150))"
                  ]
                }
              }
            ],
            "false_effect": [ { "u_message": "You cannot use this power under the sun's rays.", "type": "bad" } ]
          }
        ]
      }
    ],
    "false_effect": [ { "u_message": "You don't have enough blood to shroud yourself in shadows.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_VAMPIRE_HEAL_IN_DARK",
    "//": "Heals and reduces bleeding and pain every minute while away from the sun if the player has the trait.",
    "recurrence": 60,
    "condition": {
      "and": [
        { "u_has_trait": "VAMPIRE_HEAL_IN_DARK" },
        { "not": { "and": [ "is_day", "u_is_outside", { "not": { "is_weather": "blotted_sun" } } ] } }
      ]
    },
    "deactivate_condition": { "not": { "u_has_trait": "VAMPIRE_HEAL_IN_DARK" } },
    "effect": [
      { "if": { "math": [ "u_pain() >= 1" ] }, "then": { "math": [ "u_pain() -= 3" ] } },
      { "if": { "math": [ "u_hp('arm_l') < u_hp_max('arm_l')" ] }, "then": { "math": [ "u_hp('arm_l') += 1" ] } },
      { "if": { "math": [ "u_hp('arm_r') < u_hp_max('arm_r')" ] }, "then": { "math": [ "u_hp('arm_r') += 1" ] } },
      { "if": { "math": [ "u_hp('leg_l') < u_hp_max('leg_l')" ] }, "then": { "math": [ "u_hp('leg_l') += 1" ] } },
      { "if": { "math": [ "u_hp('leg_r') < u_hp_max('leg_r')" ] }, "then": { "math": [ "u_hp('leg_r') += 1" ] } },
      { "if": { "math": [ "u_hp('torso') < u_hp_max('torso')" ] }, "then": { "math": [ "u_hp('torso') += 1" ] } },
      { "if": { "math": [ "u_hp('head') < u_hp_max('head')" ] }, "then": { "math": [ "u_hp('head') += 1" ] } },
      {
        "if": { "math": [ "u_effect_intensity('bleed', 'bodypart': 'arm_l') >= 1" ] },
        "then": { "u_add_effect": "bleed", "target_part": "arm_l", "duration": 0, "intensity": -1 }
      },
      {
        "if": { "math": [ "u_effect_intensity('bleed', 'bodypart': 'arm_r') >= 1" ] },
        "then": { "u_add_effect": "bleed", "target_part": "arm_r", "duration": 0, "intensity": -1 }
      },
      {
        "if": { "math": [ "u_effect_intensity('bleed', 'bodypart': 'leg_l') >= 1" ] },
        "then": { "u_add_effect": "bleed", "target_part": "leg_l", "duration": 0, "intensity": -1 }
      },
      {
        "if": { "math": [ "u_effect_intensity('bleed', 'bodypart': 'leg_r') >= 1" ] },
        "then": { "u_add_effect": "bleed", "target_part": "leg_r", "duration": 0, "intensity": -1 }
      },
      {
        "if": { "math": [ "u_effect_intensity('bleed', 'bodypart': 'torso') >= 1" ] },
        "then": { "u_add_effect": "bleed", "target_part": "torso", "duration": 0, "intensity": -1 }
      },
      {
        "if": { "math": [ "u_effect_intensity('bleed', 'bodypart': 'head') >= 1" ] },
        "then": { "u_add_effect": "bleed", "target_part": "head", "duration": 0, "intensity": -1 }
      }
    ]
  },
  {
    "id": "EOC_VAMPIRE_GAIN_BLOOD_GIFTS",
    "type": "effect_on_condition",
    "//": "Every week, picks a random vampire trait that can be obtained by researching blood gifts and give it to the player if they have the mutation.",
    "condition": { "u_has_trait": "VAMPIRE_GAIN_BLOOD_GIFTS" },
    "deactivate_condition": { "not": { "u_has_trait": "VAMPIRE_GAIN_BLOOD_GIFTS" } },
    "recurrence": [ "7 days", "7 days" ],
    "effect": [
      {
        "u_roll_remainder": [
          "EYEGLEAM",
          "BLOOD_FUN",
          "STAMINAFORBLOOD",
          "COMMUNE_NIGHT",
          "VAMPIRIC_STRENGTH",
          "VAMPIRIC_RESILIENCE",
          "VAMPIRE_HEIGHTENED_SENSES",
          "VAMPIRE_SILENT_MOVE",
          "VAMPIRE_HEALTH_BONUS",
          "VAMPIRE_SENSE_CHILDREN_OF_THE_NIGHT",
          "BLOODHEAL",
          "COAGULANTWEAVE",
          "VAMPIRIC_DODGE",
          "VAMPIRE_FEAR_GAZE",
          "VAMPIRE_WALK_ON_WALLS",
          "VAMPIRE_BEAST_CLAWS",
          "VAMPIRE_SEE_HEAT",
          "VAMPIRIC_STEALTH_BONUS",
          "VAMPIRE_FEIGN_DEATH",
          "VAMPIRE_BLOOD_TEMPORARY_BOOST",
          "BLOODHASTE",
          "MAGICFORBLOOD",
          "HYPNOTIC_GAZE",
          "BLOODBANK",
          "VAMPIRE_COMMAND_BEAST",
          "VAMPIRE_EARTH_SLUMBER",
          "VAMPIRE_CARDIO_BONUS",
          "VAMPIRE_MOTION_ALARM",
          "VAMPIRE_BONUS_HP",
          "TRUE_VAMPIRE_POWER",
          "VAMPIRE_TORPOR",
          "VAMPIRE_DOMINATE",
          "VAMPIRE_NO_BREATHE",
          "VAMPIRE_NO_ILLNESS",
          "VAMPIRE_BAT_FORM",
          "VAMPIRE_WOLF_FORM",
          "VAMPIRE_MIST_FORM",
          "VAMPIRE_MASTER_MORTAL_MIND",
          "VAMPIRE_DISTILLATE_INNER_BLOOD",
          "VAMPIRE_SHADOW_FORM",
          "VAMPIRE_LAST_BREATH_MIST",
          "VAMPIRE_IRON_MIND",
          "VAMPIRE_BLIND_THE_SUN"
        ],
        "type": "mutation",
        "true_eocs": [ "EOC_XE_VAMPIRE_BLOOD_RESEARCH_SUCCESS" ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SUN_BURN_CHECK",
    "//": "Until the day a single effect can damage all bodyparts at once, Slain by the Sun will need this EOC to work.",
    "recurrence": 1,
    "condition": {
      "and": [
        { "u_has_trait": "ANATHEMA_WEAKNESS_SUN_BURN" },
        "is_day",
        "u_is_outside",
        { "not": { "is_weather": "blotted_sun" } },
        { "not": { "u_has_effect": "effect_sun_burn_grace_period" } }
      ]
    },
    "deactivate_condition": { "not": { "u_has_trait": "ANATHEMA_WEAKNESS_SUN_BURN" } },
    "effect": [
      { "u_add_effect": "effect_slain_by_the_sun", "duration": 100, "target_part": "arm_l" },
      { "u_add_effect": "effect_slain_by_the_sun", "duration": 100, "target_part": "arm_r" },
      { "u_add_effect": "effect_slain_by_the_sun", "duration": 100, "target_part": "leg_l" },
      { "u_add_effect": "effect_slain_by_the_sun", "duration": 100, "target_part": "leg_r" },
      { "u_add_effect": "effect_slain_by_the_sun", "duration": 100, "target_part": "torso" },
      { "u_add_effect": "effect_slain_by_the_sun", "duration": 100, "target_part": "head" },
      { "u_message": "You are under the sun!  You must find shelter from its rays or you will die!", "type": "bad" }
    ],
    "false_effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_SUN_BURN_CHECK_REMOVE",
            "condition": {
              "or": [
                { "math": [ "u_effect_intensity('effect_slain_by_the_sun', 'bodypart': 'arm_l') >= 1" ] },
                { "math": [ "u_effect_intensity('effect_slain_by_the_sun', 'bodypart': 'arm_r') >= 1" ] },
                { "math": [ "u_effect_intensity('effect_slain_by_the_sun', 'bodypart': 'leg_l') >= 1" ] },
                { "math": [ "u_effect_intensity('effect_slain_by_the_sun', 'bodypart': 'leg_r') >= 1" ] },
                { "math": [ "u_effect_intensity('effect_slain_by_the_sun', 'bodypart': 'torso') >= 1" ] },
                { "math": [ "u_effect_intensity('effect_slain_by_the_sun', 'bodypart': 'head') >= 1" ] }
              ]
            },
            "effect": [
              { "u_lose_effect": "effect_slain_by_the_sun", "target_part": "arm_l" },
              { "u_lose_effect": "effect_slain_by_the_sun", "target_part": "arm_r" },
              { "u_lose_effect": "effect_slain_by_the_sun", "target_part": "leg_l" },
              { "u_lose_effect": "effect_slain_by_the_sun", "target_part": "leg_r" },
              { "u_lose_effect": "effect_slain_by_the_sun", "target_part": "torso" },
              { "u_lose_effect": "effect_slain_by_the_sun", "target_part": "head" },
              {
                "u_message": "The sun's rays cannot reach you anymore.  You no longer feel like you're burning alive.",
                "type": "good"
              }
            ]
          }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ANATHEMA_MIND_CHAOS",
    "//": "Checks the variable every time the player drinks vampire blood with the weakness.  If the effect triggers, it gives a random mental negative.  If if cannot give one, it gives a negative effect for a while.  If the effect doesn't trigger, it increments the variable.",
    "//2": "It doesn't give nyctophobia and pyromania for obvious reasons.",
    "condition": { "x_in_y_chance": { "x": { "math": [ "u_counter_anathema_mind_chaos" ] }, "y": 100 } },
    "effect": [
      {
        "u_roll_remainder": [
          "BADTEMPER",
          "CHEMIMBALANCE",
          "SHOUT3",
          "JITTERY",
          "SEASONAL_AFFECTIVE",
          "SCHIZOPHRENIC",
          "MOODSWINGS",
          "INSOMNIA",
          "JEKYLL",
          "NOMAD2",
          "HATES_BOOKS",
          "INATTENTIVE",
          "PACIFIST",
          "SAVANT",
          "SLOWLEARNER",
          "UNOBSERVANT",
          "SQUEAMISH",
          "SLOWREADER",
          "TABLEMANNERS"
        ],
        "type": "mutation",
        "true_eocs": [ "EOC_ANATHEMA_MIND_CHAOS_ROLL_SUCCESS" ],
        "false_eocs": [ "EOC_ANATHEMA_MIND_CHAOS_ROLL_FAIL" ]
      },
      { "math": [ "u_counter_anathema_mind_chaos", "=", "0" ] }
    ],
    "false_effect": [ { "math": [ "u_counter_anathema_mind_chaos++" ] } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ANATHEMA_MIND_CHAOS_ROLL_SUCCESS",
    "effect": [ { "u_message": "The chaos within your head coalesces and destabilizes your mind.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ANATHEMA_MIND_CHAOS_ROLL_FAIL",
    "effect": [
      {
        "u_message": "The chaos within your head coalesces but it cannot latch on your mind, so it will remain there until it decoheres.",
        "type": "bad"
      },
      {
        "u_add_effect": "effect_anathema_mind_chaos",
        "intensity": { "math": [ "u_effect_intensity('effect_anathema_mind_chaos') + 1" ] },
        "duration": { "math": [ "rand(259200) + 86400" ] }
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ANATHEMA_WEAKNESS_NEED_VAMPIRE_BLOOD",
    "//": "If the player hasn't consumed vampire blood recently, increment an effect potency every day and increase the blood drain accordingly until the player drinks vampire blood.",
    "recurrence": [ "1 day", "1 day" ],
    "condition": {
      "and": [
        { "u_has_trait": "ANATHEMA_WEAKNESS_NEED_VAMPIRE_BLOOD" },
        { "not": { "u_has_effect": "effect_recent_vampire_drink" } }
      ]
    },
    "deactivate_condition": { "not": { "u_has_trait": "ANATHEMA_WEAKNESS_NEED_VAMPIRE_BLOOD" } },
    "effect": [
      {
        "u_add_effect": "effect_anathema_need_vampire_blood",
        "intensity": { "math": [ "u_effect_intensity('effect_anathema_need_vampire_blood') + 1" ] },
        "duration": "PERMANENT"
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ANATHEMA_WEAKNESS_NEED_VAMPIRE_BLOOD_DRAIN",
    "//": "If the player hasn't consumed vampire blood recently, increase the blood drain based on how long it has been since the last drink until the player drinks vampire blood.",
    "recurrence": 1,
    "condition": {
      "and": [
        { "u_has_trait": "ANATHEMA_WEAKNESS_NEED_VAMPIRE_BLOOD" },
        { "not": { "u_has_effect": "effect_recent_vampire_drink" } }
      ]
    },
    "deactivate_condition": { "not": { "u_has_effect": "effect_anathema_need_vampire_blood" } },
    "effect": [
      {
        "math": [ "u_counter_anathema_need_vampire_blood", "+=", "u_effect_intensity('effect_anathema_need_vampire_blood')" ]
      },
      {
        "if": { "x_in_y_chance": { "x": { "math": [ "u_counter_anathema_need_vampire_blood" ] }, "y": 100 } },
        "then": [
          { "math": [ "u_vitamin('human_blood_vitamin')", "-=", "1 + rand(1)" ] },
          { "math": [ "u_counter_anathema_need_vampire_blood", "=", "0" ] }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_MENTOR_VANISH",
    "condition": { "u_has_trait": "MENTOR_PEACE" },
    "effect": [
      { "u_die": { "remove_corpse": true, "supress_message": true, "remove_from_creature_tracker": true } },
      { "npc_message": "%1$s's vanishes in a fine mist." }
    ],
    "false_effect": [
      {
        "u_message": "You're not a mentor, so you're not supposed to see this.  Please open a Github bug report.",
        "type": "popup"
      }
    ]
  }
]
