{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.silverlabs_nat.piranha.attack": {
      "initial_state": "default",
      "states": {
        "default": {
          "on_entry": [
            "v.attack_start = 0.0;"
          ],
          "transitions": [
            { "attack": "q.is_delayed_attacking" }
          ]
        },
        "attack": {
          "on_entry": [
            "v.attack_start = q.life_time;"
          ],
          "transitions": [
            { "apply_damage": "q.life_time >= v.attack_start + 0.3" }
          ]
        },
        "apply_damage": {
          "on_entry": [
            "/damage @e[family=!silverlabs_nat:piranha, r=2, c=1] 1 none",
            "v.despawn_time = q.life_time;"
          ],
          "transitions": [
            { "despawn": "q.life_time >= v.despawn_time + 0.25" }
          ]
        },
        "despawn": {
          "on_entry": [
            "@s silverlabs_nat:despawn"
          ],
          "transitions": [
            { "default": "1" }
          ]
        }
      }
    }
  }
}
