{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.silverlabs_nat.whale": {
      "initial_state": "idle",
      "states": {
        "idle": {
          "animations": ["idle"],
          "transitions": [
            { "flop_wait": "!q.is_in_water && q.is_on_ground" },
            { "swim": "q.is_in_water && q.modified_move_speed > 0.1" }
          ],

          "blend_transition": 0.5
        },

        "swim": {
          "animations": ["swim"],
          "transitions": [
            { "flop_wait": "!q.is_in_water && q.is_on_ground" },
            { "idle": "!q.is_in_water || q.modified_move_speed <= 0.1" }
          ],

          "blend_transition": 0.5
        },

        "flop_wait": {
          "on_entry": ["v.wait_time = q.life_time;"],
          "transitions": [
            { "idle": "q.is_in_water" },
            {
              "flop": "q.life_time >= (v.wait_time + 0.05) && q.is_on_ground"
            }
          ]
        },

        "flop": {
          "animations": ["flop"],
          "transitions": [
            { "idle": "q.is_in_water && q.modified_move_speed <= 0.1" },
            { "swim": "q.is_in_water && q.modified_move_speed > 0.1" }
          ],

          "blend_transition": 0.2
        }
      }
    },

    "controller.animation.silverlabs_nat.whale.idle_event": {
      "initial_state": "default",
      "states": {
        "default": {
          "on_entry": [
            "v.delay = Math.random_integer(10, 28);",
            "v.current_delay = q.life_time;"
          ],

          "transitions": [
            {
              "idle_event": "(q.life_time - (v.current_delay ?? 0) >= (v.delay ?? 0)) && q.modified_move_speed <= 0.1 && q.is_in_water"
            }
          ],

          "blend_transition": 0.2
        },

        "idle_event": {
          "animations": ["idle_event"],
          "transitions": [
            {
              "default": "q.all_animations_finished || q.modified_move_speed > 0.1 || !q.is_in_water"
            }
          ],

          "blend_transition": 0.2
        }
      }
    },
    "controller.animation.silverlabs_nat.whale.particle": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "blowhole": "q.property('silverlabs_nat:can_particle') && (Math.random_integer(0, 200) == 0)"
            }
          ]
        },

        "blowhole": {
          "animations": ["particle"],
          "transitions": [
            { "default": "q.all_animations_finished" }
          ]
        }
      }
    },
    "controller.animation.silverlabs_nat.whale.baby": {
      "initial_state": "water_idle",
      "states": {
        "water_idle": {
          "animations": ["baby_swim_idle", "baby_tilt"],
          "transitions": [
            { "flop_wait": "!q.is_in_water && q.is_on_ground" },
            { "water_swim": "q.is_in_water && q.modified_move_speed > 0.1" }
          ],
          "blend_transition": 0.5
        },
        "water_swim": {
          "animations": ["baby_swim", "baby_tilt"],
          "transitions": [
            { "flop_wait": "!q.is_in_water && q.is_on_ground" },
            { "water_idle": "!q.is_in_water || q.modified_move_speed <= 0.1" }
          ],
          "blend_transition": 0.5
        },
        "flop_wait": {
          "on_entry": ["v.wait_time = q.life_time;"],
          "transitions": [
            { "water_idle": "q.is_in_water" },
            { "flop": "q.life_time >= (v.wait_time + 0.05) && q.is_on_ground" }
          ]
        },
        "flop": {
          "animations": ["baby_flop"],
          "transitions": [
            { "water_idle": "q.is_in_water" }
          ],
          "blend_transition": 0.2
        }
      }
    }
  }
}
