{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.shiprig.torpedo.ct": {
      "states": {
        "default": {
          "transitions": [
            {
              "loaded": "q.property('ship:state') != 'dismounted' && q.equipped_item_any_tag('slot.weapon.mainhand',0,'turret:torpedo') && q.equipped_item_any_tag('slot.armor.head',0,'armor:shiprig')"
            }
            ],
          "on_entry": [
            
            ],
          "on_exit": [
            "/function scoreboardShip"
            ]
        },
        "cooldown": {
          "transitions": [
            {
              "loaded": "q.scoreboard('torpedo_cd') == 0"
            }
            ],
          "on_exit": [
            "/scoreboard players set @s torpedobattery 0"
            ]
        },
        "loaded": {
          "transitions": [
            {
              "cooldown": "q.scoreboard('torpedo_cd') > 0"
            },
            {
              "fire": "q.is_using_item && q.scoreboard('torpedo_cd') == 0"
            },
            {
              "default": "q.property('ship:state')=='dismounted' || !q.equipped_item_any_tag('slot.weapon.mainhand',0,'turret:torpedo') || !q.equipped_item_any_tag('slot.armor.head',0,'torpedo:true')"
            }
            ]
        },
        "fire": {
          "animations": [
            {
              "destroyer_a1.torpedo": "q.is_item_name_any('slot.armor.head',0,'destroyer:a1')"
            }
            ],
          "transitions": [
            {
              "cooldown": "q.scoreboard('torpedo_cd') > 0"
            },
            {
              "loaded": "q.any_animation_finished && q.scoreboard('torpedobattery') < 3"
            }
            ],
          "on_entry": [
            "/scoreboard players add @s torpedobattery 1",
            "/playanimation @s[scores={torpedobattery=1}] animation.destroyer_a1.torpedo1",
            "/playanimation @s[scores={torpedobattery=2}] animation.destroyer_a1.torpedo2"
            ],
          "on_exit": [
            "/scoreboard players set @s[scores={torpedobattery=2..}] torpedo_cd 40"
            ]
        }
      }
    },
    "controller.animation.shiprig.primary.ct": {
      "states": {
        "default": {
          "transitions": [
            {
              "loaded": "q.property('ship:state') != 'dismounted' && q.equipped_item_any_tag('slot.weapon.mainhand',0,'turret:primary') && q.equipped_item_any_tag('slot.armor.head',0,'armor:shiprig')"
            }
            ],
          "on_entry": [
            
            ],
          "on_exit": [
            "/function scoreboardShip"
            ]
        },
        "cooldown": {
          "transitions": [
            {
              "loaded": "q.scoreboard('primary_cd') == 0"
            }
            ],
          "on_exit": [
            "/scoreboard players set @s primarybattery 0"
            ]
        },
        "loaded": {
          "transitions": [
            {
              "cooldown": "q.scoreboard('primary_cd') > 0"
            },
            {
              "fire": "q.is_using_item && q.scoreboard('primary_cd') == 0"
            },
            {
              "default": "q.property('ship:state')=='dismounted' || !q.equipped_item_any_tag('slot.weapon.mainhand',0,'turret:primary') || !q.equipped_item_any_tag('slot.armor.head',0,'primary:true')"
            }
            ]
        },
        "fire": {
          "animations": [
            {
              "destroyer_a1.primary": "q.is_item_name_any('slot.armor.head',0,'destroyer:a1')"
            }
            ],
          "transitions": [
            {
              "cooldown": "q.scoreboard('primary_cd') > 0"
            },
            {
              "loaded": "q.any_animation_finished && q.scoreboard('primarybattery') < 3"
            }
            ],
          "on_entry": [
            "/scoreboard players add @s primarybattery 1",
            "/playanimation @s[scores={primarybattery=1}] animation.destroyer_a1.turret1.fire",
            "/playanimation @s[scores={primarybattery=2}] animation.destroyer_a1.turret2.fire"
            ],
          "on_exit": [
            "/scoreboard players set @s[scores={primarybattery=2..}] primary_cd 30"
            ]
        }
      }
    },
    "controller.animation.shiprig.ct": {
      "states": {
        "default": {
          "transitions": [
            {
              "mount": "q.is_in_contact_with_water && !q.is_jumping"
            }
            ],
          "on_entry": [
            "/tag @s remove stunImmune",
            "/event entity @e[c=1,r=2,type=ship:mount] despawn",
            "/event entity @s ship_state:dismounted"
            ]
        },
        "mount": {
          "transitions": [
            {
              "default": "!q.is_riding"
            }
            ],
          "on_entry": [
            "/tag @s remove throttle:lock",
            "/event entity @s ship_state:idle",
            "/summon ship:mount ~~~ ~~ minecraft:entity_spawned",
            "/tag @s add stunImmune"
            ],
          "on_exit": [
            "/scoreboard players set @s kbHori 5",
            "/scoreboard players set @s kbVerti 5",
            "/scriptevent dash:front"
            ]
        }
      }
    }
  }
}