[
  {
    "type": "effect_on_condition",
    "id": "EOC_DRUID_SHIFTER_BEAR_FORM_activated",
    "condition": {
      "not": {
        "u_has_any_trait": [ "DRUID_SHIFTER_COUGAR_FORM_TRAITS", "DRUID_SHIFTER_DEER_FORM_TRAITS", "DRUID_SHIFTER_RAVEN_FORM_TRAITS" ]
      }
    },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_DRUID_SHIFTER_BEAR_FORM_activated_2",
            "condition": { "not": { "u_has_trait": "DRUID_SHIFTER_BEAR_FORM_TRAITS" } },
            "effect": [
              {
                "run_eocs": [
                  {
                    "id": "EOC_DRUID_SHIFTER_BEAR_FORM_activated_3",
                    "condition": { "math": [ "u_val('mana') >= 50" ] },
                    "effect": [
                      { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 2.5 },
                      { "math": [ "u_transformed_mana = u_val('mana') - 50" ] },
                      { "math": [ "u_preshift_size = u_val('size')" ] },
                      {
                        "switch": { "math": [ "u_preshift_size" ] },
                        "cases": [
                          { "case": 1, "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "*=", "12" ] } ] },
                          {
                            "case": 2,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "*=", "6" ] } ]
                          },
                          {
                            "case": 3,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "*=", "2" ] } ]
                          },
                          {
                            "case": 4,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "*=", "1.5" ] } ]
                          },
                          { "case": 5, "effect": [  ] }
                        ]
                      },
                      { "u_add_trait": "DRUID_SHIFTER_BEAR_FORM_TRAITS" },
                      { "u_add_trait": "DRUID_SHIFTER_MANA_REDUCER" },
                      {
                        "u_message": "Your body shifts and expands as fur sprouts from your skin and your mouth and teeth lengthen.",
                        "type": "good"
                      }
                    ],
                    "false_effect": [
                      { "u_message": "You don't have enough mana to transform into a bear.", "type": "bad" },
                      { "run_eocs": "EOC_DRUID_SHIFTER_BEAR_FORM_deactivate_future", "time_in_future": 0 }
                    ]
                  }
                ]
              }
            ],
            "false_effect": [
              {
                "run_eocs": [
                  {
                    "id": "EOC_DRUID_SHIFTER_BEAR_FORM_deactivated",
                    "condition": { "u_has_trait": "DRUID_SHIFTER_BEAR_FORM_TRAITS" },
                    "effect": [
                      { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 2.5 },
                      {
                        "u_message": "Your body shifts and contracts and you return to your humanoid form.",
                        "type": "neutral"
                      },
                      { "u_lose_trait": "DRUID_SHIFTER_BEAR_FORM_TRAITS" },
                      { "u_lose_trait": "DRUID_SHIFTER_MANA_REDUCER" },
                      { "math": [ "u_val('mana') = u_transformed_mana" ] },
                      {
                        "switch": { "math": [ "u_preshift_size" ] },
                        "cases": [
                          { "case": 1, "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "/=", "12" ] } ] },
                          {
                            "case": 2,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "/=", "6" ] } ]
                          },
                          {
                            "case": 3,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "/=", "2" ] } ]
                          },
                          {
                            "case": 4,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "/=", "1.5" ] } ]
                          },
                          { "case": 5, "effect": [  ] }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ],
    "false_effect": [
      { "u_message": "You cannot transform into a bear if you are already in an animal form.", "type": "mixed" },
      { "run_eocs": "EOC_DRUID_SHIFTER_BEAR_FORM_deactivate_future", "time_in_future": 0 }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_DRUID_SHIFTER_BEAR_FORM_deactivate_future",
    "//": "This is necessary because calling u_deactivate_trait from within the trait EoC does not work",
    "effect": { "u_deactivate_trait": "DRUID_SHIFTER_BEAR_FORM" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_DRUID_SHIFTER_COUGAR_FORM_activated",
    "condition": {
      "not": {
        "u_has_any_trait": [ "DRUID_SHIFTER_BEAR_FORM_TRAITS", "DRUID_SHIFTER_DEER_FORM_TRAITS", "DRUID_SHIFTER_RAVEN_FORM_TRAITS" ]
      }
    },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_DRUID_SHIFTER_COUGAR_FORM_activated_2",
            "condition": { "not": { "u_has_trait": "DRUID_SHIFTER_COUGAR_FORM_TRAITS" } },
            "effect": [
              {
                "run_eocs": [
                  {
                    "id": "EOC_DRUID_SHIFTER_COUGAR_FORM_activated_3",
                    "condition": { "math": [ "u_val('mana') >= 50" ] },
                    "effect": [
                      { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 2.5 },
                      { "math": [ "u_transformed_mana = u_val('mana') - 50" ] },
                      { "math": [ "u_preshift_size = u_val('size')" ] },
                      {
                        "switch": { "math": [ "u_preshift_size" ] },
                        "cases": [
                          { "case": 1, "effect": [ { "math": [ "u_calories()", "/=", "4" ] } ] },
                          { "case": 2, "effect": [ { "math": [ "u_calories()", "/=", "2" ] } ] },
                          { "case": 3, "effect": [  ] },
                          { "case": 4, "effect": [ { "math": [ "u_calories()", "*=", "1.5" ] } ] },
                          { "case": 5, "effect": [ { "math": [ "u_calories()", "*=", "3" ] } ] }
                        ]
                      },
                      { "u_add_trait": "DRUID_SHIFTER_COUGAR_FORM_TRAITS" },
                      { "u_add_trait": "DRUID_SHIFTER_MANA_REDUCER" },
                      { "if": { "not": { "u_has_trait": "FELINE_LEAP" } }, "then": { "u_add_trait": "FELINE_LEAP" } },
                      {
                        "u_message": "Your body shifts and warps as fur sprouts from your skin, whiskers from your nose, and claws and fangs from your fingers and mouth.",
                        "type": "good"
                      }
                    ],
                    "false_effect": [
                      { "u_message": "You don't have enough mana to transform into a cougar.", "type": "bad" },
                      { "run_eocs": "EOC_DRUID_SHIFTER_COUGAR_FORM_deactivate_future", "time_in_future": 0 }
                    ]
                  }
                ]
              }
            ],
            "false_effect": [
              {
                "run_eocs": [
                  {
                    "id": "EOC_DRUID_SHIFTER_COUGAR_FORM_deactivated",
                    "condition": { "u_has_trait": "DRUID_SHIFTER_COUGAR_FORM_TRAITS" },
                    "effect": [
                      { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 2.5 },
                      {
                        "u_message": "Your body shifts and your fur disappears as you return to your humanoid form.",
                        "type": "neutral"
                      },
                      { "u_lose_trait": "DRUID_SHIFTER_COUGAR_FORM_TRAITS" },
                      { "u_lose_trait": "DRUID_SHIFTER_MANA_REDUCER" },
                      {
                        "if": { "not": { "u_has_trait": "THRESH_FELINE" } },
                        "then": { "u_lose_trait": "FELINE_LEAP" }
                      },
                      { "math": [ "u_val('mana') = u_transformed_mana" ] },
                      {
                        "switch": { "math": [ "u_preshift_size" ] },
                        "cases": [
                          { "case": 1, "effect": [ { "math": [ "u_calories()", "*=", "4" ] } ] },
                          { "case": 2, "effect": [ { "math": [ "u_calories()", "*=", "2" ] } ] },
                          { "case": 3, "effect": [  ] },
                          { "case": 4, "effect": [ { "math": [ "u_calories()", "/=", "1.5" ] } ] },
                          { "case": 5, "effect": [ { "math": [ "u_calories()", "/=", "3" ] } ] }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ],
    "false_effect": [
      { "u_message": "You cannot transform into a cougar if you are already in an animal form.", "type": "mixed" },
      { "run_eocs": "EOC_DRUID_SHIFTER_COUGAR_FORM_deactivate_future", "time_in_future": 0 }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_DRUID_SHIFTER_COUGAR_FORM_deactivate_future",
    "//": "This is necessary because calling u_deactivate_trait from within the trait EoC does not work",
    "effect": { "u_deactivate_trait": "DRUID_SHIFTER_COUGAR_FORM" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_DRUID_SHIFTER_DEER_FORM_activated",
    "condition": {
      "not": {
        "u_has_any_trait": [ "DRUID_SHIFTER_BEAR_FORM_TRAITS", "DRUID_SHIFTER_COUGAR_FORM_TRAITS", "DRUID_SHIFTER_RAVEN_FORM_TRAITS" ]
      }
    },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_DRUID_SHIFTER_DEER_FORM_activated_2",
            "condition": { "not": { "u_has_trait": "DRUID_SHIFTER_DEER_FORM_TRAITS" } },
            "effect": [
              {
                "run_eocs": [
                  {
                    "id": "EOC_DRUID_SHIFTER_DEER_FORM_activated_3",
                    "condition": { "math": [ "u_val('mana') >= 50" ] },
                    "effect": [
                      { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 2.5 },
                      { "math": [ "u_transformed_mana = u_val('mana') - 50" ] },
                      { "math": [ "u_preshift_size = u_val('size')" ] },
                      {
                        "switch": { "math": [ "u_preshift_size" ] },
                        "cases": [
                          { "case": 1, "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "/=", "4" ] } ] },
                          {
                            "case": 2,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "/=", "2" ] } ]
                          },
                          { "case": 3, "effect": [  ] },
                          {
                            "case": 4,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "*=", "1.5" ] } ]
                          },
                          {
                            "case": 5,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "*=", "3" ] } ]
                          }
                        ]
                      },
                      { "u_add_trait": "DRUID_SHIFTER_DEER_FORM_TRAITS" },
                      { "u_add_trait": "DRUID_SHIFTER_MANA_REDUCER" },
                      {
                        "u_message": "Your body shifts and warps as your fingers and feet fuse into hooves and majestic antlers sprout from your head.",
                        "type": "good"
                      }
                    ],
                    "false_effect": [
                      { "u_message": "You don't have enough mana to transform into a deer.", "type": "bad" },
                      { "run_eocs": "EOC_DRUID_SHIFTER_DEER_FORM_deactivate_future", "time_in_future": 0 }
                    ]
                  }
                ]
              }
            ],
            "false_effect": [
              {
                "run_eocs": [
                  {
                    "id": "EOC_DRUID_SHIFTER_DEER_FORM_deactivated",
                    "condition": { "u_has_trait": "DRUID_SHIFTER_DEER_FORM_TRAITS" },
                    "effect": [
                      { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 2.5 },
                      {
                        "u_message": "Your body shifts and your fingers separate as you return to your humanoid form.",
                        "type": "neutral"
                      },
                      { "u_lose_trait": "DRUID_SHIFTER_DEER_FORM_TRAITS" },
                      { "u_lose_trait": "DRUID_SHIFTER_MANA_REDUCER" },
                      { "math": [ "u_val('mana') = u_transformed_mana" ] },
                      {
                        "switch": { "math": [ "u_preshift_size" ] },
                        "cases": [
                          { "case": 1, "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "*=", "4" ] } ] },
                          {
                            "case": 2,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "*=", "2" ] } ]
                          },
                          { "case": 3, "effect": [  ] },
                          {
                            "case": 4,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "/=", "1.5" ] } ]
                          },
                          {
                            "case": 5,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "/=", "3" ] } ]
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ],
    "false_effect": [
      { "u_message": "You cannot transform into a deer if you are already in an animal form.", "type": "mixed" },
      { "run_eocs": "EOC_DRUID_SHIFTER_DEER_FORM_deactivate_future", "time_in_future": 0 }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_DRUID_SHIFTER_DEER_FORM_deactivate_future",
    "//": "This is necessary because calling u_deactivate_trait from within the trait EoC does not work",
    "effect": { "u_deactivate_trait": "DRUID_SHIFTER_DEER_FORM" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_DRUID_SHIFTER_RAVEN_FORM_activated",
    "condition": {
      "not": {
        "u_has_any_trait": [ "DRUID_SHIFTER_BEAR_FORM_TRAITS", "DRUID_SHIFTER_COUGAR_FORM_TRAITS", "DRUID_SHIFTER_DEER_FORM_TRAITS" ]
      }
    },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "EOC_DRUID_SHIFTER_RAVEN_FORM_activated_2",
            "condition": { "not": { "u_has_trait": "DRUID_SHIFTER_RAVEN_FORM_TRAITS" } },
            "effect": [
              {
                "run_eocs": [
                  {
                    "id": "EOC_DRUID_SHIFTER_RAVEN_FORM_activated_3",
                    "condition": { "math": [ "u_val('mana') >= 50" ] },
                    "effect": [
                      { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 2.5 },
                      { "math": [ "u_val('mana')", "-=", "50" ] },
                      { "math": [ "u_transformed_mana = u_val('mana') - 50" ] },
                      { "math": [ "u_preshift_size = u_val('size')" ] },
                      {
                        "switch": { "math": [ "u_preshift_size" ] },
                        "cases": [
                          { "case": 1, "effect": [  ] },
                          {
                            "case": 2,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "/=", "2" ] } ]
                          },
                          {
                            "case": 3,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "/=", "4" ] } ]
                          },
                          {
                            "case": 4,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "/=", "6" ] } ]
                          },
                          {
                            "case": 5,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "/=", "10" ] } ]
                          }
                        ]
                      },
                      { "u_add_trait": "DRUID_SHIFTER_RAVEN_FORM_TRAITS" },
                      { "u_add_trait": "DRUID_SHIFTER_MANA_REDUCER" },
                      {
                        "u_message": "Your body shifts and changes as you concentrate and you take wing as a raven.",
                        "type": "good"
                      }
                    ],
                    "false_effect": [
                      { "u_message": "You don't have enough mana to transform into a raven.", "type": "bad" },
                      { "run_eocs": "EOC_DRUID_SHIFTER_RAVEN_FORM_deactivate_future", "time_in_future": 0 }
                    ]
                  }
                ]
              }
            ],
            "false_effect": [
              {
                "run_eocs": [
                  {
                    "id": "EOC_DRUID_SHIFTER_RAVEN_FORM_deactivated",
                    "condition": { "u_has_trait": "DRUID_SHIFTER_RAVEN_FORM_TRAITS" },
                    "effect": [
                      { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 2.5 },
                      {
                        "u_message": "Your body shifts and changes and you return to your humanoid form.",
                        "type": "neutral"
                      },
                      { "u_lose_trait": "DRUID_SHIFTER_RAVEN_FORM_TRAITS" },
                      { "u_lose_trait": "DRUID_SHIFTER_MANA_REDUCER" },
                      { "math": [ "u_spell_level('druid_raven_form_fly_upward') = -1" ] },
                      { "math": [ "u_val('mana') = u_transformed_mana" ] },
                      {
                        "switch": { "math": [ "u_preshift_size" ] },
                        "cases": [
                          { "case": 1, "effect": [  ] },
                          {
                            "case": 2,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "*=", "2" ] } ]
                          },
                          {
                            "case": 3,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "*=", "4" ] } ]
                          },
                          {
                            "case": 4,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "*=", "6" ] } ]
                          },
                          {
                            "case": 5,
                            "effect": [ { "math": [ "u_calories('dont_affect_weariness': true)", "*=", "10" ] } ]
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ],
    "false_effect": [
      { "u_message": "You cannot transform into a raven if you are already in an animal form.", "type": "mixed" },
      { "run_eocs": "EOC_DRUID_SHIFTER_RAVEN_FORM_deactivate_future", "time_in_future": 0 }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_DRUID_SHIFTER_RAVEN_FORM_deactivate_future",
    "//": "This is necessary because calling u_deactivate_trait from within the trait EoC does not work",
    "effect": { "u_deactivate_trait": "DRUID_SHIFTER_RAVEN_FORM" }
  }
]
