[
  {
    "type": "effect_on_condition",
    "id": "EOC_ELECTROKIN_SEE_ELECTRICITY_INITIATE",
    "condition": { "not": { "u_has_effect": "effect_electrokin_see_electricity" } },
    "effect": [
      { "u_message": "You open your senses to the flow of current.", "type": "good" },
      { "run_eocs": "EOC_POWER_MAINTENANCE_PLUS_ONE" },
      { "u_add_effect": "effect_electrokin_see_electricity", "duration": "PERMANENT" },
      { "u_cast_spell": { "id": "psionic_drained_difficulty_one", "hit_self": true } },
      {
        "queue_eocs": "EOC_ELECTROKIN_SEE_ELECTRICITY_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('electrokinetic_see_electric') * 150) + 900) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('electrokinetic_see_electric') * 300) + 1800) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [ { "run_eocs": "EOC_ELECTROKIN_REMOVE_SEE_ELECTRICITY" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ELECTROKIN_REMOVE_SEE_ELECTRICITY",
    "condition": { "u_has_effect": "effect_electrokin_see_electricity" },
    "effect": [ { "run_eocs": "EOC_POWER_MAINTENANCE_MINUS_ONE" }, { "u_lose_effect": "effect_electrokin_see_electricity" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ELECTROKIN_SEE_ELECTRICITY_DRAIN",
    "condition": { "u_has_effect": "effect_electrokin_see_electricity" },
    "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('electrokinetic_see_electric')", "+=", "(maintenance_exp_factor(u_val('focus')))" ] },
      { "run_eocs": "EOC_POWER_MAINTENANCE_CONCENTRATION_CHECK" },
      {
        "queue_eocs": "EOC_ELECTROKIN_SEE_ELECTRICITY_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('electrokinetic_see_electric') * 150) + 900) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('electrokinetic_see_electric') * 300) + 1800) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [  ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ELECTROKIN_PERSONAL_BATTERY_INITIATE",
    "condition": { "not": { "u_has_effect": "effect_electrokin_personal_battery" } },
    "effect": [
      { "u_message": "The hair on your body stands up on end.", "type": "good" },
      { "run_eocs": [ "EOC_POWER_MAINTENANCE_PLUS_ONE", "EOC_ELECTROKIN_PERSONAL_BATTERY_SWITCHER" ] },
      { "u_add_effect": "effect_electrokin_personal_battery", "duration": "PERMANENT" },
      { "u_cast_spell": { "id": "psionic_drained_difficulty_three", "hit_self": true } },
      {
        "queue_eocs": "EOC_ELECTROKIN_PERSONAL_BATTERY_DRAIN",
        "time_in_future": [
          {
            "math": [
              "min( (( ( (u_spell_level('electrokinetic_personal_battery') * 45 ) + 600) * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling), 14400)"
            ]
          },
          {
            "math": [
              "min( (( ( (u_spell_level('electrokinetic_personal_battery') * 90 ) + 1800) * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling), 14400)"
            ]
          }
        ]
      }
    ],
    "false_effect": [ { "run_eocs": "EOC_ELECTROKIN_REMOVE_PERSONAL_BATTERY" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ELECTROKIN_REMOVE_PERSONAL_BATTERY",
    "condition": { "u_has_effect": "effect_electrokin_personal_battery" },
    "effect": [
      { "u_remove_item_with": "electrokinetic_ups_1" },
      { "u_remove_item_with": "electrokinetic_ups_2" },
      { "u_remove_item_with": "electrokinetic_ups_3" },
      { "u_remove_item_with": "electrokinetic_ups_4" },
      { "u_remove_item_with": "electrokinetic_ups_5" },
      { "u_remove_item_with": "electrokinetic_ups_6" },
      { "u_lose_effect": "effect_electrokin_personal_battery" },
      { "run_eocs": "EOC_POWER_MAINTENANCE_MINUS_ONE" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ELECTROKIN_PERSONAL_BATTERY_SWITCHER",
    "effect": {
      "switch": { "math": [ "u_spell_level('electrokinetic_personal_battery')" ] },
      "cases": [
        { "case": 0, "effect": [ { "u_spawn_item": "electrokinetic_ups_1", "suppress_message": true, "force_equip": true } ] },
        {
          "case": 4,
          "effect": [ { "u_spawn_item": "electrokinetic_ups_2", "suppress_message": true, "force_equip": true } ]
        },
        {
          "case": 8,
          "effect": [ { "u_spawn_item": "electrokinetic_ups_3", "suppress_message": true, "force_equip": true } ]
        },
        {
          "case": 12,
          "effect": [ { "u_spawn_item": "electrokinetic_ups_4", "suppress_message": true, "force_equip": true } ]
        },
        {
          "case": 16,
          "effect": [ { "u_spawn_item": "electrokinetic_ups_5", "suppress_message": true, "force_equip": true } ]
        },
        {
          "case": 20,
          "effect": [ { "u_spawn_item": "electrokinetic_ups_6", "suppress_message": true, "force_equip": true } ]
        }
      ]
    }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ELECTROKIN_PERSONAL_BATTERY_DRAIN",
    "condition": { "u_has_effect": "effect_electrokin_personal_battery" },
    "effect": [
      { "u_cast_spell": { "id": "psionic_maintenance_drained_difficulty_three", "hit_self": true } },
      { "math": [ "u_val('stored_kcal')", "-=", "psionics_kcal_cost(3)" ] },
      {
        "math": [ "u_spell_exp('electrokinetic_personal_battery')", "+=", "(maintenance_exp_factor(u_val('focus')))" ]
      },
      { "run_eocs": "EOC_POWER_MAINTENANCE_CONCENTRATION_CHECK" },
      {
        "queue_eocs": "EOC_ELECTROKIN_PERSONAL_BATTERY_DRAIN",
        "time_in_future": [
          {
            "math": [
              "min( (( ( (u_spell_level('electrokinetic_personal_battery') * 45 ) + 600) * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling), 14400)"
            ]
          },
          {
            "math": [
              "min( (( ( (u_spell_level('electrokinetic_personal_battery') * 90 ) + 1800) * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling), 14400)"
            ]
          }
        ]
      }
    ],
    "false_effect": [  ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ELECTROKIN_REDUCE_PAIN_INITIATE",
    "condition": { "not": { "u_has_effect": "effect_electrokin_reduce_pain" } },
    "effect": [
      { "u_message": "The aches and pains of post-Cataclysmic life fade, just a little.", "type": "good" },
      { "run_eocs": "EOC_POWER_MAINTENANCE_PLUS_ONE" },
      { "u_add_effect": "effect_electrokin_reduce_pain", "duration": "PERMANENT" },
      { "u_cast_spell": { "id": "psionic_drained_difficulty_four", "hit_self": true } },
      {
        "queue_eocs": "EOC_ELECTROKIN_REDUCE_PAIN_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('electrokinetic_reduce_pain') * 120) + 600) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('electrokinetic_reduce_pain') * 280) + 1500) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [ { "run_eocs": "EOC_ELECTROKIN_REMOVE_REDUCE_PAIN" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ELECTROKIN_REMOVE_REDUCE_PAIN",
    "condition": { "u_has_effect": "effect_electrokin_reduce_pain" },
    "effect": [ { "run_eocs": "EOC_POWER_MAINTENANCE_MINUS_ONE" }, { "u_lose_effect": "effect_electrokin_reduce_pain" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_ELECTROKIN_REDUCE_PAIN_DRAIN",
    "condition": { "u_has_effect": "effect_electrokin_reduce_pain" },
    "effect": [
      { "u_cast_spell": { "id": "psionic_maintenance_drained_difficulty_four", "hit_self": true } },
      { "math": [ "u_val('stored_kcal')", "-=", "psionics_kcal_cost(4)" ] },
      { "math": [ "u_spell_exp('electrokinetic_reduce_pain')", "+=", "(maintenance_exp_factor(u_val('focus')))" ] },
      { "run_eocs": "EOC_POWER_MAINTENANCE_CONCENTRATION_CHECK" },
      {
        "queue_eocs": "EOC_ELECTROKIN_REDUCE_PAIN_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('electrokinetic_reduce_pain') * 120) + 600) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('electrokinetic_reduce_pain') * 280) + 1500) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [  ]
  }
]
