[
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_LIGHTNING_MELEE_ATTACKS_ON",
    "effect": [
      { "u_add_trait": "SYLPH_LIGHTNING_MELEE_ATTACKS_ACTIVE" },
      { "u_message": "Lightning sparks from you hands.", "type": "good" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_LIGHTNING_MELEE_ATTACKS_PER_TURN",
    "condition": { "math": [ "u_val('mana') >= 10" ] },
    "effect": [  ],
    "false_effect": [
      { "u_message": "You do not have enough mana to maintain your fulgurating strikes!", "type": "bad" },
      { "u_lose_trait": "SYLPH_LIGHTNING_MELEE_ATTACKS_ACTIVE" },
      { "run_eocs": "EOC_SYLPH_LIGHTNING_MELEE_ATTACKS_deactivate_future", "time_in_future": 0 }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_LIGHTNING_MELEE_ATTACKS_OFF",
    "effect": [ { "u_lose_trait": "SYLPH_LIGHTNING_MELEE_ATTACKS_ACTIVE" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_LIGHTNING_MELEE_ATTACKS_deactivate_future",
    "effect": { "u_deactivate_trait": "SYLPH_LIGHTNING_MELEE_ATTACKS" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_LIGHTNING_MELEE_ATTACKS_MELEE_MONSTER",
    "eoc_type": "EVENT",
    "required_event": "character_melee_attacks_monster",
    "condition": { "u_has_trait": "SYLPH_LIGHTNING_MELEE_ATTACKS_ACTIVE" },
    "effect": [ { "math": [ "u_val('mana')", "-=", "3" ] } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_LIGHTNING_MELEE_ATTACKS_MELEE_CHARACTER",
    "eoc_type": "EVENT",
    "required_event": "character_melee_attacks_character",
    "condition": { "u_has_trait": "SYLPH_LIGHTNING_MELEE_ATTACKS_ACTIVE" },
    "effect": [ { "math": [ "u_val('mana')", "-=", "3" ] } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_REVEAL_OVERMAP",
    "condition": "u_is_outside",
    "effect": [ { "u_cast_spell": { "id": "sylph_reveal_overmap_spell_real" } } ],
    "false_effect": [ { "u_message": "You must be outdoors to cast Like a Bird on the Wing.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_JUMP_HIGH_ON",
    "effect": [
      {
        "run_eoc_selector": [
          "EOC_SYLPH_JUMP_HIGH_SELECTOR_TWO",
          "EOC_SYLPH_JUMP_HIGH_SELECTOR_FOUR",
          "EOC_SYLPH_JUMP_HIGH_SELECTOR_SIX",
          "EOC_NONE"
        ],
        "names": [ "Leap two stories up", "Leap four stories up", "Leap six stories up", "Cancel" ],
        "keys": [ "1", "2", "3", "4" ],
        "descriptions": [ "Leap straight up two stories.", "Leap straight up four stories.", "Leap straight up six stories.", "Do nothing." ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_JUMP_HIGH_SELECTOR_TWO",
    "condition": "u_is_outside",
    "effect": [
      { "u_add_effect": "effect_sylph_levitation", "duration": 5 },
      { "u_location_variable": { "u_val": "sylph_jump_high_jump_location" }, "z_adjust": 2, "outdoor_only": true },
      { "u_message": "With a burst of wind, you leap into the air.", "type": "good" },
      { "u_teleport": { "u_val": "sylph_jump_high_jump_location" } }
    ],
    "false_effect": [ { "u_message": "You cannot jump with a ceiling above you!", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_JUMP_HIGH_SELECTOR_FOUR",
    "condition": "u_is_outside",
    "effect": [
      { "u_add_effect": "effect_sylph_levitation", "duration": 5 },
      { "u_location_variable": { "u_val": "sylph_jump_high_jump_location" }, "z_adjust": 4, "outdoor_only": true },
      { "u_message": "With a burst of wind, you leap into the air.", "type": "good" },
      { "u_teleport": { "u_val": "sylph_jump_high_jump_location" } }
    ],
    "false_effect": [ { "u_message": "You cannot jump with a ceiling above you!", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_JUMP_HIGH_SELECTOR_SIX",
    "condition": { "and": [ "u_is_outside", { "u_has_trait": "THRESH_SYLPH" } ] },
    "effect": [
      { "u_add_effect": "effect_sylph_levitation", "duration": 5 },
      { "u_location_variable": { "u_val": "sylph_jump_high_jump_location" }, "z_adjust": 6, "outdoor_only": true },
      { "u_message": "With a burst of wind, you leap into the air.", "type": "good" },
      { "u_teleport": { "u_val": "sylph_jump_high_jump_location" } }
    ],
    "false_effect": [ { "u_message": "You cannot jump with a ceiling above you!", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_FLY_AT_WILL",
    "condition": { "math": [ "u_val('mana') >= 3" ] },
    "effect": [
      { "math": [ "u_val('mana')", "-=", "3" ] },
      { "u_add_effect": "effect_sylph_levitation", "duration": "2 s" },
      { "u_add_effect": "effect_sylph_climb_flying", "duration": "2 s" }
    ],
    "false_effect": [
      { "u_message": "You do not have enough mana to fly!", "type": "bad" },
      { "u_lose_effect": [ "effect_sylph_levitation", "effect_sylph_climb_flying" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_CLOUD_FORM_ON",
    "effect": [
      { "u_add_effect": "effect_sylph_cloud_body", "duration": "PERMANENT" },
      { "u_add_effect": "incorporeal", "duration": "PERMANENT" },
      { "u_add_trait": "SYLPH_CLOUD_FORM_APPEARANCE" },
      { "u_message": "Your body falls apart into billowing clouds.", "type": "good" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_CLOUD_FORM_PER_TURN",
    "condition": { "math": [ "u_val('mana') >= 10" ] },
    "effect": [ { "math": [ "u_val('mana')", "-=", "10" ] } ],
    "false_effect": [
      { "u_message": "You do not have enough mana to maintain your cloud body!", "type": "bad" },
      { "u_lose_effect": [ "incorporeal", "effect_sylph_cloud_body" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_CLOUD_FORM_OFF",
    "effect": [ { "u_lose_effect": [ "effect_sylph_cloud_body", "incorporeal" ] }, { "u_lose_trait": "SYLPH_CLOUD_FORM_APPEARANCE" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_MASSIVE_LIGHTNING_BOLT",
    "condition": "u_is_outside",
    "effect": [ { "u_cast_spell": { "id": "sylph_massive_lightning_bolt_spell_real" }, "targeted": true } ],
    "false_effect": [ { "u_message": "You must be outdoors to cast Fist of Heaven's Fury.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_WIND_TRANSLOCATE_CHECK",
    "condition": {
      "and": [ "u_is_outside", { "or": [ { "math": [ "u_val('pos_z') >= 3" ] }, { "math": [ "weather('windpower') >= 20" ] } ] } ]
    },
    "effect": [ { "u_cast_spell": { "id": "paraclesian_translocate" } } ],
    "false_effect": [
      { "u_message": "You must be outdoors and in a strong wind or high above the earth to translocate.", "type": "mixed" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_WIND_ATTUNEMENT_CHECK",
    "condition": { "and": [ "u_is_outside", { "math": [ "u_val('pos_z') >= 3" ] } ] },
    "effect": [ { "u_cast_spell": { "id": "sylph_wind_translocation_attune_real" }, "targeted": true } ],
    "false_effect": [ { "u_message": "You must be outdoors and high above the earth to cast this spell.", "type": "mixed" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_SYLPH_GOBLIN_FRUIT",
    "condition": {
      "or": [
        { "and": [ "u_is_outside", { "math": [ "weather('windpower') >= 15" ] } ] },
        { "and": [ "u_is_outside", { "math": [ "u_val('pos_z') >= 1" ] } ] }
      ]
    },
    "effect": { "u_spawn_item": "spell_spawned_goblin_fruit_sylph", "use_item_group": true, "suppress_message": true },
    "false_effect": [
      {
        "u_message": "You must have a strong enough wind or be above ground level to call forth a goblin fruit.",
        "type": "bad"
      }
    ]
  }
]
