[
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPATH_CONCENTRATION_INITIATE",
    "condition": { "not": { "u_has_effect": "effect_telepathic_learning_bonus" } },
    "effect": [
      { "u_message": "Your vision narrows to what is directly in front of you as you concentrate.", "type": "good" },
      { "run_eocs": "EOC_POWER_MAINTENANCE_PLUS_ONE" },
      { "u_add_effect": "effect_telepathic_learning_bonus", "duration": "PERMANENT" },
      { "u_cast_spell": { "id": "psionic_drained_difficulty_one", "hit_self": true } },
      {
        "queue_eocs": "EOC_TELEPATH_CONCENTRATION_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('telepathic_concentration') * 132) + 560) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('telepathic_concentration') * 605) + 1033) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [ { "run_eocs": "EOC_TELEPATH_REMOVE_TELEPATHIC_CONCENTRATION" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPATH_REMOVE_TELEPATHIC_CONCENTRATION",
    "condition": { "u_has_effect": "effect_telepathic_learning_bonus" },
    "effect": [ { "run_eocs": "EOC_POWER_MAINTENANCE_MINUS_ONE" }, { "u_lose_effect": "effect_telepathic_learning_bonus" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPATH_CONCENTRATION_DRAIN",
    "condition": { "u_has_effect": "effect_telepathic_learning_bonus" },
    "effect": [
      { "u_cast_spell": { "id": "psionic_maintenance_drained_difficulty_one", "hit_self": true } },
      { "math": [ "u_val('stored_kcal')", "-=", "psionics_kcal_cost(1)" ] },
      { "math": [ "u_spell_exp('telepathic_concentration')", "+=", "(maintenance_exp_factor(u_val('focus')))" ] },
      { "run_eocs": "EOC_POWER_MAINTENANCE_CONCENTRATION_CHECK" },
      {
        "queue_eocs": "EOC_TELEPATH_CONCENTRATION_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('telepathic_concentration') * 132) + 560) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('telepathic_concentration') * 605) + 1033) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [  ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPATH_SHIELD_INITIATE",
    "condition": { "not": { "u_has_effect": "effect_telepathic_psi_armor" } },
    "effect": [
      { "u_message": "You begin shielding your thoughts.", "type": "good" },
      { "run_eocs": "EOC_POWER_MAINTENANCE_PLUS_ONE" },
      { "u_add_effect": "effect_telepathic_psi_armor", "duration": "PERMANENT" },
      { "u_spawn_item": "telepath_mind_shield_item", "suppress_message": true, "force_equip": true },
      { "u_cast_spell": { "id": "psionic_drained_difficulty_two", "hit_self": true } },
      {
        "queue_eocs": "EOC_TELEPATH_SHIELD_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('telepathic_shield') * 15) + 180) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('telepathic_shield') * 36) + 720) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [ { "run_eocs": "EOC_TELEPATH_REMOVE_TELEPATHIC_SHIELD" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPATH_REMOVE_TELEPATHIC_SHIELD",
    "condition": { "u_has_effect": "effect_telepathic_psi_armor" },
    "effect": [
      { "run_eocs": "EOC_POWER_MAINTENANCE_MINUS_ONE" },
      { "u_lose_effect": "effect_telepathic_psi_armor" },
      { "u_remove_item_with": "telepath_mind_shield_item" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPATH_SHIELD_DRAIN",
    "condition": { "u_has_effect": "effect_telepathic_psi_armor" },
    "effect": [
      { "u_cast_spell": { "id": "psionic_maintenance_drained_difficulty_two", "hit_self": true } },
      { "math": [ "u_val('stored_kcal')", "-=", "psionics_kcal_cost(2)" ] },
      { "math": [ "u_spell_exp('telepathic_shield')", "+=", "(maintenance_exp_factor(u_val('focus')))" ] },
      { "run_eocs": "EOC_POWER_MAINTENANCE_CONCENTRATION_CHECK" },
      {
        "queue_eocs": "EOC_TELEPATH_SHIELD_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('telepathic_shield') * 15) + 180) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('telepathic_shield') * 36) + 720) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [  ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPATH_SENSE_MINDS_INITIATE",
    "condition": { "not": { "u_has_effect": "effect_telepath_sense_minds" } },
    "effect": [
      { "u_message": "You reach out with your powers, looking for nearby minds.", "type": "good" },
      { "run_eocs": "EOC_POWER_MAINTENANCE_PLUS_ONE" },
      { "u_add_effect": "effect_telepath_sense_minds", "duration": "PERMANENT" },
      { "u_cast_spell": { "id": "psionic_drained_difficulty_two", "hit_self": true } },
      {
        "queue_eocs": "EOC_TELEPATH_SENSE_MINDS_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('telepathic_mind_sense') * 26) + 90) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('telepathic_mind_sense') * 131) + 600) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [ { "run_eocs": "EOC_TELEPATH_REMOVE_SENSE_MINDS" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPATH_REMOVE_SENSE_MINDS",
    "condition": { "u_has_effect": "effect_telepath_sense_minds" },
    "effect": [ { "run_eocs": "EOC_POWER_MAINTENANCE_MINUS_ONE" }, { "u_lose_effect": "effect_telepath_sense_minds" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPATH_SENSE_MINDS_DRAIN",
    "condition": { "u_has_effect": "effect_telepath_sense_minds" },
    "effect": [
      { "u_cast_spell": { "id": "psionic_maintenance_drained_difficulty_three", "hit_self": true } },
      { "math": [ "u_val('stored_kcal')", "-=", "psionics_kcal_cost(2)" ] },
      { "math": [ "u_spell_exp('telepathic_mind_sense')", "+=", "(maintenance_exp_factor(u_val('focus')))" ] },
      { "run_eocs": "EOC_POWER_MAINTENANCE_CONCENTRATION_CHECK" },
      {
        "queue_eocs": "EOC_TELEPATH_SENSE_MINDS_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('telepathic_mind_sense') * 26) + 90) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('telepathic_mind_sense') * 131) + 600) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [  ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPATH_MORALE_INITIATE",
    "condition": { "not": { "u_has_effect": "effect_telepathic_morale" } },
    "effect": [
      { "u_message": "You begin to edit out your discouraging thoughts.", "type": "good" },
      { "run_eocs": "EOC_POWER_MAINTENANCE_PLUS_ONE" },
      { "u_add_effect": "effect_telepathic_morale", "duration": "PERMANENT" },
      {
        "u_add_morale": "morale_telepathy",
        "bonus": 10,
        "max_bonus": 25,
        "duration": "2 hours",
        "decay_start": "1 hours"
      },
      { "u_cast_spell": { "id": "psionic_drained_difficulty_three", "hit_self": true } },
      {
        "queue_eocs": "EOC_TELEPATH_MORALE_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('telepathic_morale') * 381) + 981) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('telepathic_morale') * 899) + 2520) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [ { "run_eocs": "EOC_TELEPATH_REMOVE_TELEPATHIC_MORALE" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPATH_REMOVE_TELEPATHIC_MORALE",
    "condition": { "u_has_effect": "effect_telepathic_morale" },
    "effect": [ { "run_eocs": "EOC_POWER_MAINTENANCE_MINUS_ONE" }, { "u_lose_effect": "effect_telepathic_morale" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_TELEPATH_MORALE_DRAIN",
    "condition": { "u_has_effect": "effect_telepathic_morale" },
    "effect": [
      { "u_cast_spell": { "id": "psionic_maintenance_drained_difficulty_three", "hit_self": true } },
      { "run_eocs": "EOC_POWER_MAINTENANCE_CONCENTRATION_CHECK" },
      { "math": [ "u_val('stored_kcal')", "-=", "psionics_kcal_cost(3)" ] },
      { "math": [ "u_spell_exp('telepathic_morale')", "+=", "(maintenance_exp_factor(u_val('focus')))" ] },
      {
        "u_add_morale": "morale_telepathy",
        "bonus": 10,
        "max_bonus": 25,
        "duration": "2 hours",
        "decay_start": "1 hours"
      },
      {
        "queue_eocs": "EOC_TELEPATH_MORALE_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('telepathic_morale') * 381) + 981) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('telepathic_morale') * 899) + 2520) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [  ]
  }
]
