[
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKIN_LIGHT_LOCAL_INITIATE",
    "condition": { "not": { "u_has_effect": "effect_photokin_light_local" } },
    "effect": [
      { "u_add_effect": "effect_photokin_light_local", "duration": "PERMANENT" },
      { "run_eocs": "EOC_POWER_MAINTENANCE_PLUS_ONE" },
      { "u_cast_spell": { "id": "psionic_drained_difficulty_one", "hit_self": true } },
      {
        "queue_eocs": "EOC_PHOTOKIN_LIGHT_LOCAL_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('photokinetic_light_local') * 260) + 1560) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('photokinetic_light_local') * 870) + 3420) * (scaling_factor(u_val('intelligence') ) )  *u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [ { "run_eocs": "EOC_PHOTOKIN_REMOVE_LIGHT_LOCAL" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKIN_REMOVE_LIGHT_LOCAL",
    "condition": { "u_has_effect": "effect_photokin_light_local" },
    "effect": [ { "run_eocs": "EOC_POWER_MAINTENANCE_MINUS_ONE" }, { "u_lose_effect": "effect_photokin_light_local" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKIN_LIGHT_LOCAL_DRAIN",
    "condition": { "u_has_effect": "effect_photokin_light_local" },
    "effect": [
      { "u_cast_spell": { "id": "psionic_drained_difficulty_one", "hit_self": true } },
      { "math": [ "u_val('stored_kcal')", "-=", "psionics_kcal_cost(1)" ] },
      { "math": [ "u_spell_exp('photokinetic_light_local')", "+=", "(maintenance_exp_factor(u_val('focus')))" ] },
      { "run_eocs": "EOC_POWER_MAINTENANCE_CONCENTRATION_CHECK" },
      {
        "queue_eocs": "EOC_PHOTOKIN_LIGHT_LOCAL_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('photokinetic_light_local') * 260) + 1560) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('photokinetic_light_local') * 870) + 3420) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [  ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKIN_RAD_IMMUNITY_INITIATE",
    "condition": {
      "and": [ { "not": { "u_has_item": "photokinetic_rad_aura" } }, { "not": { "u_has_effect": "effect_photokin_light_barrier" } } ]
    },
    "effect": [
      { "u_message": "The air around you shimmers as an invisible barrier of light forms around you.", "type": "good" },
      { "run_eocs": "EOC_POWER_MAINTENANCE_PLUS_ONE" },
      { "u_add_effect": "effect_photokin_light_barrier", "duration": "PERMANENT" },
      { "u_cast_spell": { "id": "psionic_drained_difficulty_three", "hit_self": true } },
      {
        "queue_eocs": "EOC_PHOTOKIN_RAD_IMMUNITY_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('photokinetic_rad_immunity') * 18) + 370) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('photokinetic_rad_immunity') * 182) + 810) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [ { "run_eocs": "EOC_PHOTOKIN_REMOVE_RAD_IMMUNITY" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKIN_REMOVE_RAD_IMMUNITY",
    "condition": { "u_has_effect": "effect_photokin_light_barrier" },
    "effect": [
      { "u_remove_item_with": "photokinetic_rad_aura" },
      { "u_lose_effect": "effect_photokin_light_barrier" },
      { "run_eocs": "EOC_POWER_MAINTENANCE_MINUS_ONE" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKIN_RAD_IMMUNITY_DRAIN",
    "condition": { "or": [ { "u_has_item": "photokinetic_rad_aura" }, { "u_has_effect": "effect_photokin_light_barrier" } ] },
    "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('photokinetic_rad_immunity')", "+=", "(maintenance_exp_factor(u_val('focus')))" ] },
      { "run_eocs": "EOC_POWER_MAINTENANCE_CONCENTRATION_CHECK" },
      {
        "queue_eocs": "EOC_PHOTOKIN_RAD_IMMUNITY_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('photokinetic_rad_immunity') * 18) + 370) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('photokinetic_rad_immunity') * 182) + 810) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [  ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKIN_CAMOUFLAGE_INITIATE",
    "condition": { "not": { "u_has_effect": "effect_photokin_camouflage" } },
    "effect": [
      { "u_message": "You twist nearby light to help conceal you from distant observers.", "type": "good" },
      { "u_add_effect": "effect_photokin_camouflage", "duration": "PERMANENT" },
      { "run_eocs": [ "EOC_POWER_MAINTENANCE_PLUS_ONE", "EOC_PHOTOKIN_CAMOUFLAGE_SWITCHER" ] },
      { "u_cast_spell": { "id": "psionic_drained_difficulty_three", "hit_self": true } },
      {
        "queue_eocs": "EOC_PHOTOKIN_CAMOUFLAGE_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('photokinetic_camouflage') * 48) + 690) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('photokinetic_camouflage') * 113) + 1430) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [ { "run_eocs": "EOC_PHOTOKIN_REMOVE_CAMOUFLAGE" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKIN_CAMOUFLAGE_SWITCHER",
    "effect": [
      {
        "switch": { "math": [ "u_spell_level('photokinetic_camouflage')" ] },
        "cases": [
          { "case": 0, "effect": { "u_add_trait": "PHOTOKINETIC_CAMOUFLAGE_1" } },
          { "case": 4, "effect": { "u_add_trait": "PHOTOKINETIC_CAMOUFLAGE_2" } },
          { "case": 8, "effect": { "u_add_trait": "PHOTOKINETIC_CAMOUFLAGE_3" } },
          { "case": 12, "effect": { "u_add_trait": "PHOTOKINETIC_CAMOUFLAGE_4" } },
          { "case": 16, "effect": { "u_add_trait": "PHOTOKINETIC_CAMOUFLAGE_5" } },
          { "case": 20, "effect": { "u_add_trait": "PHOTOKINETIC_CAMOUFLAGE_6" } }
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKIN_REMOVE_CAMOUFLAGE",
    "condition": { "u_has_effect": "effect_photokin_camouflage" },
    "effect": [
      { "u_lose_effect": "effect_photokin_camouflage" },
      { "u_lose_trait": "PHOTOKINETIC_CAMOUFLAGE_1" },
      { "u_lose_trait": "PHOTOKINETIC_CAMOUFLAGE_2" },
      { "u_lose_trait": "PHOTOKINETIC_CAMOUFLAGE_3" },
      { "u_lose_trait": "PHOTOKINETIC_CAMOUFLAGE_4" },
      { "u_lose_trait": "PHOTOKINETIC_CAMOUFLAGE_5" },
      { "u_lose_trait": "PHOTOKINETIC_CAMOUFLAGE_6" },
      { "run_eocs": "EOC_POWER_MAINTENANCE_MINUS_ONE" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKIN_CAMOUFLAGE_DRAIN",
    "condition": { "u_has_effect": "effect_photokin_camouflage" },
    "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('photokinetic_camouflage')", "+=", "(maintenance_exp_factor(u_val('focus')))" ] },
      { "run_eocs": "EOC_POWER_MAINTENANCE_CONCENTRATION_CHECK" },
      {
        "queue_eocs": "EOC_PHOTOKIN_CAMOUFLAGE_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('photokinetic_camouflage') * 48) + 690) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('photokinetic_camouflage') * 113) + 1430) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [  ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKIN_HIDE_UGLY_INITIATE",
    "condition": { "not": { "u_has_effect": "effect_photokin_hide_ugly" } },
    "effect": [
      { "u_message": "You shroud your true form behind unassuming illusions.", "type": "good" },
      {
        "run_eocs": [ "EOC_POWER_MAINTENANCE_PLUS_ONE", "EOC_PHOTOKIN_HIDE_UGLY_SWITCHER", "EOC_PHOTOKIN_HIDE_UGLY_REMOVE_GODCO_VARS" ]
      },
      { "u_add_effect": "effect_photokin_hide_ugly", "duration": "PERMANENT" },
      { "u_cast_spell": { "id": "psionic_drained_difficulty_four", "hit_self": true } },
      {
        "queue_eocs": "EOC_PHOTOKIN_HIDE_UGLY_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('photokinetic_hide_ugly') * 22) + 450) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('photokinetic_hide_ugly') * 55) + 890) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [ { "run_eocs": "EOC_PHOTOKIN_REMOVE_HIDE_UGLY" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKIN_HIDE_UGLY_SWITCHER",
    "effect": {
      "switch": { "math": [ "u_spell_level('photokinetic_hide_ugly')" ] },
      "cases": [
        { "case": 0, "effect": { "u_add_trait": "PHOTOKIN_HIDE_UGLY_01" } },
        { "case": 4, "effect": { "u_add_trait": "PHOTOKIN_HIDE_UGLY_02" } },
        { "case": 8, "effect": { "u_add_trait": "PHOTOKIN_HIDE_UGLY_03" } },
        { "case": 12, "effect": { "u_add_trait": "PHOTOKIN_HIDE_UGLY_04" } },
        { "case": 16, "effect": { "u_add_trait": "PHOTOKIN_HIDE_UGLY_05" } },
        { "case": 20, "effect": { "u_add_trait": "PHOTOKIN_HIDE_UGLY_06" } }
      ]
    }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKIN_REMOVE_HIDE_UGLY",
    "condition": { "u_has_effect": "effect_photokin_hide_ugly" },
    "effect": [
      { "run_eocs": "EOC_POWER_MAINTENANCE_MINUS_ONE" },
      { "u_lose_effect": "effect_photokin_hide_ugly" },
      { "u_lose_trait": "PHOTOKIN_HIDE_UGLY_01" },
      { "u_lose_trait": "PHOTOKIN_HIDE_UGLY_02" },
      { "u_lose_trait": "PHOTOKIN_HIDE_UGLY_03" },
      { "u_lose_trait": "PHOTOKIN_HIDE_UGLY_04" },
      { "u_lose_trait": "PHOTOKIN_HIDE_UGLY_05" },
      { "u_lose_trait": "PHOTOKIN_HIDE_UGLY_06" },
      { "run_eocs": "EOC_PHOTOKIN_HIDE_UGLY_GRANT_GODCO_VARS" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKIN_HIDE_UGLY_DRAIN",
    "condition": { "u_has_effect": "effect_photokin_hide_ugly" },
    "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('photokinetic_hide_ugly')", "+=", "(maintenance_exp_factor(u_val('focus')))" ] },
      { "run_eocs": "EOC_POWER_MAINTENANCE_CONCENTRATION_CHECK" },
      {
        "queue_eocs": "EOC_PHOTOKIN_HIDE_UGLY_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('photokinetic_hide_ugly') * 22) + 450) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('photokinetic_hide_ugly') * 55) + 890) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [  ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKIN_RADIO_INITIATE",
    "condition": { "not": { "u_has_effect": "effect_photokinetic_radio" } },
    "effect": [
      { "u_message": "You attune your senses to passing radio waves.", "type": "good" },
      { "u_add_effect": "effect_photokinetic_radio", "duration": "PERMANENT" },
      { "run_eocs": "EOC_POWER_MAINTENANCE_PLUS_ONE" },
      { "u_spawn_item": "item_photokinetic_radio_on", "suppress_message": true, "force_equip": true },
      { "u_cast_spell": { "id": "psionic_drained_difficulty_five", "hit_self": true } },
      {
        "queue_eocs": "EOC_PHOTOKIN_RADIO_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('photokinetic_radio') * 126) + 1456) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('photokinetic_radio') * 772) + 5220) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [ { "run_eocs": "EOC_PHOTOKIN_REMOVE_RADIO" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKIN_REMOVE_RADIO",
    "condition": { "u_has_effect": "effect_photokinetic_radio" },
    "effect": [
      { "run_eocs": "EOC_POWER_MAINTENANCE_MINUS_ONE" },
      { "u_remove_item_with": "item_photokinetic_radio" },
      { "u_remove_item_with": "item_photokinetic_radio_on" },
      { "u_lose_effect": "effect_photokinetic_radio" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PHOTOKIN_RADIO_DRAIN",
    "condition": { "u_has_effect": "effect_photokinetic_radio" },
    "effect": [
      { "u_cast_spell": { "id": "psionic_maintenance_drained_difficulty_five", "hit_self": true } },
      { "math": [ "u_val('stored_kcal')", "-=", "psionics_kcal_cost(5)" ] },
      { "math": [ "u_spell_exp('photokinetic_radio')", "+=", "(maintenance_exp_factor(u_val('focus')))" ] },
      { "run_eocs": "EOC_POWER_MAINTENANCE_CONCENTRATION_CHECK" },
      {
        "queue_eocs": "EOC_PHOTOKIN_RADIO_DRAIN",
        "time_in_future": [
          {
            "math": [
              "( (u_spell_level('photokinetic_radio') * 126) + 1456) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          },
          {
            "math": [
              "( (u_spell_level('photokinetic_radio') * 772) + 5220) * (scaling_factor(u_val('intelligence') ) ) * u_nether_attunement_power_scaling"
            ]
          }
        ]
      }
    ],
    "false_effect": [  ]
  }
]
