[
  {
    "id": "psi_photokinetic_damage",
    "type": "damage_type",
    "physical": false,
    "magic_color": "yellow",
    "name": "focused light",
    "skill": "metaphysics",
    "derived_from": [ "heat", 0.8 ],
    "immune_flags": { "character": [ "PHOTOKIN_CHAR_IMMUNE" ], "monster": [ "PHOTOKIN_MONSTER_IMMUNE" ] },
    "ondamage_eocs": [ "EOC_PHOTOKINETIC_DAMAGE_BLIND_CHANCE", "EOC_PHOTOKINETIC_DAMAGE_EXTRA_BLIND_CHANCE" ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKINETIC_DAMAGE_BLIND_CHANCE",
    "condition": {
      "and": [
        { "x_in_y_chance": { "x": 2, "y": 5 } },
        { "math": [ "_damage_taken", ">", "0" ] },
        { "not": { "npc_has_trait": "PHOTOKINETIC" } },
        { "not": { "npc_has_flag": "PHOTOKIN_CHAR_IMMUNE" } },
        { "not": { "npc_has_flag": "PHOTOKIN_MONSTER_IMMUNE" } }
      ]
    },
    "effect": [ { "npc_add_effect": "blind", "duration": "3 s" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKINETIC_DAMAGE_EXTRA_BLIND_CHANCE",
    "condition": {
      "and": [
        { "x_in_y_chance": { "x": 1, "y": 20 } },
        { "math": [ "_damage_taken", ">", "0" ] },
        { "not": { "npc_has_trait": "PHOTOKINETIC" } },
        { "not": { "npc_has_flag": "PHOTOKIN_CHAR_IMMUNE" } },
        { "not": { "npc_has_flag": "PHOTOKIN_MONSTER_IMMUNE" } }
      ]
    },
    "effect": [ { "npc_add_effect": "blind", "duration": "10 s" } ]
  },
  {
    "id": "psi_photokinetic_damage",
    "type": "damage_info_order",
    "info_display": "detailed",
    "verb": "dazzling",
    "bionic_info": { "order": 999903, "show_type": false },
    "protection_info": { "order": 999903, "show_type": false },
    "pet_prot_info": { "order": 999903, "show_type": false },
    "melee_combat_info": { "order": 999903, "show_type": false },
    "ablative_info": { "order": 999903, "show_type": false }
  },
  {
    "id": "psi_telekinetic_damage",
    "type": "damage_type",
    "physical": false,
    "magic_color": "yellow",
    "name": "telekinetic",
    "skill": "metaphysics",
    "derived_from": [ "bash", 0.9 ],
    "immune_flags": { "character": [ "TELEKIN_SHIELD" ], "monster": [ "TELEKIN_IMMUNE" ] },
    "ondamage_eocs": [ "EOC_TELEKINETIC_DAMAGE_KNOCKDOWN_CHANCE", "EOC_TELEKINETIC_DAMAGE_STAGGER_CHANCE" ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEKINETIC_DAMAGE_STAGGER_CHANCE",
    "condition": { "and": [ { "x_in_y_chance": { "x": 2, "y": 5 } }, { "math": [ "_damage_taken", ">", "0" ] } ] },
    "effect": [ { "npc_add_effect": "staggered", "duration": "2 s" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEKINETIC_DAMAGE_KNOCKDOWN_CHANCE",
    "condition": { "and": [ { "x_in_y_chance": { "x": 1, "y": 5 } }, { "math": [ "_damage_taken", ">", "0" ] } ] },
    "effect": [ { "npc_add_effect": "downed", "duration": "1 s" } ]
  },
  {
    "id": "psi_telekinetic_damage",
    "type": "damage_info_order",
    "info_display": "detailed",
    "verb": "buffeting",
    "bionic_info": { "order": 999899, "show_type": false },
    "protection_info": { "order": 999899, "show_type": false },
    "pet_prot_info": { "order": 999899, "show_type": false },
    "melee_combat_info": { "order": 999899, "show_type": false },
    "ablative_info": { "order": 999899, "show_type": false }
  },
  {
    "id": "psi_telepathic_damage",
    "type": "damage_type",
    "physical": false,
    "magic_color": "white",
    "name": "telepathic",
    "skill": "metaphysics",
    "immune_flags": { "character": [ "TEEPSHIELD", "PSYSHIELD_PROTECT" ], "monster": [ "TEEP_IMMUNE" ] },
    "ondamage_eocs": [ "EOC_TELEPATHIC_DAMAGE_PSYSHIELD_CHECK", "EOC_TELEPATHIC_DAMAGE_STUN_HIVE_CHANCE" ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPATHIC_DAMAGE_PSYSHIELD_CHECK",
    "condition": {
      "and": [
        { "npc_has_worn_with_flag": "PSYSHIELD_PARTIAL" },
        { "math": [ "_damage_taken", ">", "-2" ] },
        { "npc_has_effect": "effect_psyshield_protection" },
        { "not": { "npc_has_flag": "HIVE_MIND" } },
        { "not": { "npc_has_flag": "TEEP_IMMUNE" } },
        { "not": { "npc_has_flag": "TEEPSHIELD" } }
      ]
    },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_TELEPATHIC_DAMAGE_PSYSHIELD_CHECK_2",
            "condition": { "x_in_y_chance": { "x": 1, "y": 2 } },
            "effect": [
              {
                "npc_message": "Your head prickles.  It feels like spiders crawling across the surface of your brain.",
                "type": "bad"
              },
              { "npc_lose_effect": "effect_psyshield_protection" }
            ],
            "false_effect": [
              { "npc_lose_effect": "effect_psyshield_protection" },
              { "npc_cast_spell": { "id": "telepathic_self_damage", "hit_self": true } },
              { "npc_message": "Your minds reels!", "type": "bad" }
            ]
          }
        ]
      }
    ],
    "false_effect": [
      {
        "run_eocs": [ "EOC_TELEPATHIC_DAMAGE_STUN_CHANCE", "EOC_TELEPATHIC_DAMAGE_DAZED_CHANCE", "EOC_TELEPATHIC_DAMAGE_KNOCKDOWN_CHANCE" ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPATHIC_DAMAGE_KNOCKDOWN_CHANCE",
    "condition": {
      "and": [
        { "x_in_y_chance": { "x": 1, "y": 20 } },
        { "math": [ "_damage_taken", ">", "0" ] },
        { "not": { "npc_has_flag": "HIVE_MIND" } },
        { "not": { "npc_has_flag": "TEEP_IMMUNE" } },
        { "not": { "npc_has_flag": "TEEPSHIELD" } }
      ]
    },
    "effect": [ { "npc_add_effect": "downed", "duration": "1 s" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPATHIC_DAMAGE_STUN_CHANCE",
    "condition": {
      "and": [
        { "x_in_y_chance": { "x": 1, "y": 3 } },
        { "math": [ "_damage_taken", ">", "0" ] },
        { "not": { "npc_has_flag": "HIVE_MIND" } },
        { "not": { "npc_has_flag": "TEEP_IMMUNE" } },
        { "not": { "npc_has_flag": "TEEPSHIELD" } }
      ]
    },
    "effect": [ { "npc_add_effect": "psi_stunned", "duration": "1 s" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPATHIC_DAMAGE_DAZED_CHANCE",
    "condition": {
      "and": [
        { "x_in_y_chance": { "x": 2, "y": 3 } },
        { "math": [ "_damage_taken", ">", "0" ] },
        { "not": { "npc_has_flag": "HIVE_MIND" } },
        { "not": { "npc_has_flag": "TEEP_IMMUNE" } },
        { "not": { "npc_has_flag": "TEEPSHIELD" } }
      ]
    },
    "effect": [ { "npc_add_effect": "psi_dazed", "duration": "2 s" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPATHIC_DAMAGE_STUN_HIVE_CHANCE",
    "condition": {
      "and": [ { "x_in_y_chance": { "x": 1, "y": 6 } }, { "math": [ "_damage_taken", ">", "0" ] }, { "npc_has_flag": "HIVE_MIND" } ]
    },
    "effect": [ { "npc_add_effect": "psi_stunned", "duration": "5 s" } ]
  },
  {
    "id": "psi_telepathic_damage",
    "type": "damage_info_order",
    "info_display": "detailed",
    "verb": "mindblasting",
    "bionic_info": { "order": 999900, "show_type": false },
    "protection_info": { "order": 999900, "show_type": false },
    "pet_prot_info": { "order": 999900, "show_type": false },
    "melee_combat_info": { "order": 999900, "show_type": false },
    "ablative_info": { "order": 999900, "show_type": false }
  },
  {
    "id": "psi_teleporter_teleporting_damage",
    "type": "damage_type",
    "physical": false,
    "magic_color": "blue",
    "name": "spacial realignment",
    "skill": "metaphysics",
    "immune_flags": { "character": [ "DIMENSIONAL_ANCHOR", "TELESTOP" ], "monster": [ "TELEPORT_IMMUNE" ] },
    "ondamage_eocs": [ "EOC_TELEPORTING_DAMAGE_TELEPORT" ]
  },
  {
    "id": "psi_teleporter_teleporting_damage",
    "type": "damage_info_order",
    "info_display": "detailed",
    "verb": "recalibrating",
    "bionic_info": { "order": 999901, "show_type": false },
    "protection_info": { "order": 999901, "show_type": false },
    "pet_prot_info": { "order": 999901, "show_type": false },
    "melee_combat_info": { "order": 999901, "show_type": false },
    "ablative_info": { "order": 999901, "show_type": false }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPORTING_DAMAGE_TELEPORT",
    "condition": {
      "and": [
        { "math": [ "_damage_taken", ">", "0" ] },
        { "not": { "npc_has_flag": "TELEPORT_IMMUNE" } },
        { "not": { "npc_has_flag": "DIMENSIONAL_ANCHOR" } },
        { "not": { "npc_has_flag": "TELESTOP" } }
      ]
    },
    "effect": [ { "npc_cast_spell": { "id": "teleport_blink", "min_level": 10 } } ]
  },
  {
    "id": "psi_enervation_damage",
    "type": "damage_type",
    "physical": false,
    "magic_color": "red_green",
    "name": "enervation",
    "skill": "metaphysics",
    "immune_flags": { "character": [ "LIFESHIELD" ], "monster": [ "ENERVATE_IMMUNE" ] },
    "ondamage_eocs": [ "EOC_ENERVATION_DRAIN" ]
  },
  {
    "id": "psi_enervation_damage",
    "type": "damage_info_order",
    "info_display": "detailed",
    "verb": "enervating",
    "bionic_info": { "order": 999902, "show_type": false },
    "protection_info": { "order": 999902, "show_type": false },
    "pet_prot_info": { "order": 999902, "show_type": false },
    "melee_combat_info": { "order": 999902, "show_type": false },
    "ablative_info": { "order": 999902, "show_type": false }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ENERVATION_DRAIN",
    "condition": {
      "and": [
        { "math": [ "_damage_taken", ">", "0" ] },
        { "not": { "npc_has_flag": "LIFESHIELD" } },
        { "not": { "npc_has_flag": "ENERVATE_IMMUNE" } }
      ]
    },
    "effect": [ { "run_eocs": "EOC_ENERVATION_DRAIN_2" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ENERVATION_DRAIN_2",
    "condition": { "math": [ "n_val('mana')", ">=", "150" ] },
    "effect": [
      { "math": [ "n_val('mana')", "-=", "rng( 100,200 )" ] },
      { "npc_message": "You feel a sudden sense of loss.", "type": "bad" }
    ],
    "false_effect": [ { "run_eocs": "EOC_ENERVATION_DRAIN_3" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ENERVATION_DRAIN_3",
    "condition": { "math": [ "n_val('stamina')", ">=", "200" ] },
    "effect": [
      { "math": [ "n_val('stamina')", "-=", "rng( 100,300 )" ] },
      { "npc_message": "For a moment, you feel exhausted.", "type": "bad" }
    ],
    "false_effect": [
      { "npc_cast_spell": { "id": "eater_drain_health" } },
      { "npc_message": "You feel your life draining away!.", "type": "bad" }
    ]
  }
]
