[
  {
    "type": "effect_on_condition",
    "id": "EOC_RESET_TELEPATHIC_STEALING_TIMER",
    "recurrence": [ "20 hours", "28 hours" ],
    "condition": { "math": [ "telepathically_stole_recently >= 1" ] },
    "deactivate_condition": { "not": { "u_has_trait": "TELEPATH" } },
    "effect": [ { "math": [ "telepathically_stole_recently = 0" ] } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PSIONICS_METAPHYSICS_SKILL_EXP_SUCCESS",
    "eoc_type": "EVENT",
    "required_event": "spellcasting_finish",
    "condition": {
      "and": [ { "test_eoc": "EOC_CONDITION_SPELLCASTING_FINISH_TRAIT_AND_SCHOOL_LIST" }, { "math": [ "_success != false" ] } ]
    },
    "effect": [ { "math": [ "u_skill_exp('metaphysics', 'format': 'raw')", "+=", "(100 * _difficulty)" ] } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PSIONICS_METAPHYSICS_SKILL_EXP_FAILURE",
    "eoc_type": "EVENT",
    "required_event": "spellcasting_finish",
    "condition": {
      "and": [ { "test_eoc": "EOC_CONDITION_SPELLCASTING_FINISH_TRAIT_AND_SCHOOL_LIST" }, { "math": [ "_success == false" ] } ]
    },
    "effect": [ { "math": [ "u_skill_exp('metaphysics', 'format': 'raw')", "+=", "(25 * _difficulty)" ] } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PSIONICS_PSI_NEUTRALIZED_ENDS_ALL_POWERS",
    "eoc_type": "EVENT",
    "required_event": "character_gains_effect",
    "condition": {
      "or": [
        { "compare_string": [ "effect_psi_neutralized", { "context_val": "effect" } ] },
        { "compare_string": [ "effect_psi_turn_off_powers", { "context_val": "effect" } ] }
      ]
    },
    "effect": [ { "run_eocs": [ "EOC_END_PSI_POWERS" ] } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PSIONICS_BROKEN_LIMB_ENDS_POWERS",
    "eoc_type": "EVENT",
    "required_event": "broken_bone",
    "effect": [ { "run_eocs": [ "EOC_END_PSI_POWERS_MAINTAINED" ] } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PSIONICS_SLEEP_ENDS_POWERS",
    "eoc_type": "EVENT",
    "required_event": "character_gains_effect",
    "condition": {
      "or": [
        { "compare_string": [ "sleep", { "context_val": "effect" } ] },
        { "compare_string": [ "lying_down", { "context_val": "effect" } ] }
      ]
    },
    "effect": [ { "run_eocs": [ "EOC_END_PSI_POWERS_MAINTAINED" ] } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PSIONICS_STUNNED_ENDS_POWERS",
    "eoc_type": "EVENT",
    "required_event": "character_gains_effect",
    "condition": {
      "and": [
        {
          "or": [
            { "compare_string": [ "stunned", { "context_val": "effect" } ] },
            { "compare_string": [ "psi_stunned", { "context_val": "effect" } ] }
          ]
        },
        { "math": [ "u_vitamin('vitamin_maintained_powers') >= 1" ] }
      ]
    },
    "effect": [
      { "u_message": "As your head rings and your mind reels, you lose control of your powers!", "type": "bad" },
      { "run_eocs": [ "EOC_END_PSI_POWERS_MAINTAINED" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PSIONICS_WEARINESS_ENDS_POWERS",
    "eoc_type": "EVENT",
    "required_event": "character_gains_effect",
    "condition": {
      "and": [
        {
          "or": [
            { "compare_string": [ "weary_7", { "context_val": "effect" } ] },
            { "compare_string": [ "weary_8", { "context_val": "effect" } ] }
          ]
        },
        { "not": { "u_has_proficiency": "prof_concentration_master" } }
      ]
    },
    "effect": [
      { "u_message": "You are almost too tired to think, and can't concentrate on maintaining your powers", "type": "bad" },
      { "run_eocs": [ "EOC_END_PSI_POWERS_MAINTAINED" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PSIONICS_MIND_PROBLEMS_ENDS_POWERS",
    "eoc_type": "EVENT",
    "required_event": "character_gains_effect",
    "condition": {
      "or": [
        { "compare_string": [ "brainworms", { "context_val": "effect" } ] },
        { "compare_string": [ "pd_int_bad", { "context_val": "effect" } ] }
      ]
    },
    "effect": [ { "run_eocs": [ "EOC_END_PSI_POWERS_MAINTAINED" ] } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PSIONICS_CONCENTRATION_EFFECT_GAIN_CHECK",
    "//": "When you gain an effect that changes how many powers you can concentrate on, or would otherwise interrupt concentration, check concentration",
    "eoc_type": "EVENT",
    "required_event": "character_gains_effect",
    "condition": {
      "and": [
        {
          "or": [
            { "compare_string": [ "winded", { "context_val": "effect" } ] },
            { "compare_string": [ "nausea", { "context_val": "effect" } ] },
            { "compare_string": [ "asthma", { "context_val": "effect" } ] },
            { "compare_string": [ "datura", { "context_val": "effect" } ] },
            { "compare_string": [ "onfire", { "context_val": "effect" } ] },
            { "compare_string": [ "staggered_character", { "context_val": "effect" } ] },
            { "compare_string": [ "venom_dmg", { "context_val": "effect" } ] },
            { "compare_string": [ "venom_pain", { "context_val": "effect" } ] },
            { "compare_string": [ "boomered", { "context_val": "effect" } ] },
            { "compare_string": [ "taint", { "context_val": "effect" } ] },
            { "compare_string": [ "visuals", { "context_val": "effect" } ] },
            { "compare_string": [ "hallu", { "context_val": "effect" } ] },
            { "compare_string": [ "formication", { "context_val": "effect" } ] },
            { "compare_string": [ "meth", { "context_val": "effect" } ] },
            { "compare_string": [ "weed_high", { "context_val": "effect" } ] },
            { "compare_string": [ "high", { "context_val": "effect" } ] },
            { "compare_string": [ "drunk", { "context_val": "effect" } ] },
            { "compare_string": [ "zapped", { "context_val": "effect" } ] },
            { "compare_string": [ "effect_psi_reduced_breathing", { "context_val": "effect" } ] },
            { "compare_string": [ "effect_psi_null", { "context_val": "effect" } ] },
            { "compare_string": [ "effect_psi_null_unbound", { "context_val": "effect" } ] },
            { "compare_string": [ "dazed", { "context_val": "effect" } ] },
            { "compare_string": [ "psi_dazed", { "context_val": "effect" } ] },
            { "compare_string": [ "psi_dazed_zap", { "context_val": "effect" } ] },
            { "compare_string": [ "downed", { "context_val": "effect" } ] },
            {
              "and": [
                { "compare_string": [ "effect_disease_psionic_drain", { "context_val": "effect" } ] },
                { "math": [ "_intensity == 5" ] }
              ]
            },
            {
              "and": [
                { "compare_string": [ "effect_disease_psionic_drain", { "context_val": "effect" } ] },
                { "math": [ "_intensity == 11" ] }
              ]
            }
          ]
        },
        { "math": [ "u_vitamin('vitamin_maintained_powers') >= 1" ] }
      ]
    },
    "effect": [ { "run_eocs": [ "EOC_POWER_MAINTENANCE_CONCENTRATION_CHECK" ] } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_MINDOVERMATTER_PRE_COLD_TO_COLD",
    "//": "duration is one day to 14 days",
    "condition": { "u_has_effect": "pre_cold" },
    "effect": [ { "u_lose_effect": "pre_cold" }, { "u_add_effect": "cold", "duration": { "math": [ "rng(86400,1209600)" ] } } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_MINDOVERMATTER_PRE_FLU_TO_FLU",
    "//": "duration is 3 days to 10 days",
    "condition": { "u_has_effect": "pre_flu" },
    "effect": [ { "u_lose_effect": "pre_flu" }, { "u_add_effect": "flu", "duration": { "math": [ "rng(259200,864000)" ] } } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_MINDOVERMATTER_PRE_CONJUNCTIVITIS_VIRAL_TO_CONJUNCTIVITIS_VIRAL",
    "condition": { "u_has_effect": "pre_conjunctivitis_viral" },
    "effect": [
      { "u_lose_effect": [ "pre_conjunctivitis_viral", "pre_conjunctivitis_bacterial" ] },
      {
        "u_add_effect": "conjunctivitis_viral",
        "duration": { "math": [ "rand(259200) + 432000" ] },
        "target_part": "eyes"
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_MINDOVERMATTER_PRE_CONJUNCTIVITIS_BACTERIAL_TO_CONJUNCTIVITIS_BACTERIAL",
    "condition": { "u_has_effect": "pre_conjunctivitis_bacterial" },
    "effect": [
      { "u_lose_effect": [ "pre_conjunctivitis_viral", "pre_conjunctivitis_bacterial" ] },
      {
        "u_add_effect": "conjunctivitis_bacterial",
        "duration": { "math": [ "rand(259200) + 432000" ] },
        "target_part": "eyes"
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_FEAR_PARALYZE",
    "condition": { "not": { "u_has_effect": "fearparalyze" } },
    "effect": { "run_eocs": [ "EOC_FEAR_PARALYZE1" ] }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_FEAR_PARALYZE1",
    "condition": { "not": { "u_has_effect": "effect_telepathic_psi_armor" } },
    "effect": { "run_eocs": [ "EOC_FEAR_PARALYZE2" ] },
    "false_effect": {
      "u_message": "Some <npc_name> tries to intrude into your thoughts, but your telepathic shield reflects it!",
      "type": "warning"
    }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_STARE",
    "condition": { "or": [ { "u_has_worn_with_flag": "DIMENSIONAL_ANCHOR" }, { "npc_has_flag": "DIMENSIONAL_ANCHOR" } ] },
    "effect": { "u_message": "You feel a strange reverberation across your body.", "type": "warning" },
    "false_effect": { "run_eocs": [ "EOC_STARE1" ] }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_STARE1",
    "condition": { "or": [ { "u_has_effect": "effect_telepathic_psi_armor" }, { "u_has_flag": "TEEPSHIELD" } ] },
    "effect": { "u_message": "You sense <npc_name> trying to enter your mind, but you repel it!", "type": "warning" },
    "false_effect": { "run_eocs": [ "EOC_STARE2" ] }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ALIEN_MEADOW_BUSH_2_BERRIES",
    "//": "This sets up a delayed reaction to eating the berries",
    "effect": [ { "run_eocs": "EOC_ALIEN_MEADOW_BUSH_2_BERRIES_2", "time_in_future": [ "5 minutes", "20 minutes" ] } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ALIEN_MEADOW_BUSH_2_BERRIES_2",
    "effect": [
      { "u_message": "Your stomach is seized with cramps!", "type": "bad" },
      { "u_add_effect": "alienfoodpoison", "duration": { "math": [ "3600 + rand(16200)" ] } }
    ]
  }
]
