{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.odachi.ct": {
      "states": {
        "default": {
          "transitions": [
            {
              "ready": "q.is_alive"
            }
            ]
        },
        "ready": {
          "transitions": [
            {
              "armed": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon:odachi')"
            }
            ],
          "on_entry": [
            "/scoreboard players set @s ba_attacking 0",
            "/tag @s remove basicAttack",
            "/scoreboard players set @s has_skill 0",
            "/event entity @s[scores={weaponTimer=0}] weapon_equip:unarmed",
            "/event entity @s[scores={weaponTimer=0}] weapon_name:none"
            ],
          "on_exit": [
            "/event entity @s weapon_equip:armed",
            "/event entity @s weapon_name2:odachi",
            "/event entity @s weapon_name:remove1"
            ]
        },
        "cooldown": {
          "transitions": [
            {
              "armed": "q.scoreboard('ba_cd') == 0"
            },
            {
              "ready": "q.all_animations_finished && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:anim') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
            ],
          "on_entry": [
            "/scoreboard players set @s basic_attack 0"
            ]
        },
        "armed": {
          "transitions": [
            {
              "cooldown": "q.scoreboard('ba_cd') > 0"
            },
            {
              "attack": "q.property('weapon:name2')==8 && v.attack_time && q.scoreboard('stun') == 0 && !q.is_jumping && !q.is_sneaking && q.scoreboard('block') == 0 && q.scoreboard('has_skill') == 0"
            },
            {
              "ready": "q.all_animations_finished && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:anim') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
             ],
          "on_entry": [
            "/scoreboard players set @s[scores={basic_attack=4..}] basic_attack 0"
            ],
            "on_exit": [
              "/scoreboard players add @s basic_attack 1"
              ]
        },
        "attack": {
          "transitions": [
            {
              "cooldown": "q.scoreboard('ba_cd') > 0"
            },
            {
              "armed": "q.any_animation_finished && q.scoreboard('ba_cd') == 0 || q.scoreboard('stun') > 0"
            }
            ],
            "animations": [
              {
                "odachi.basic1": "q.scoreboard('basic_attack') <= 1"
              },
              {
                "odachi.basic2": "q.scoreboard('basic_attack') == 2"
              },
              {
                "odachi.basic3": "q.scoreboard('basic_attack') == 3"
              },
              {
                "odachi.basic4": "q.scoreboard('basic_attack') == 4"
              }
              ],
            "on_entry": [
              "/scoreboard players set @s ba_attacking 1",
              "/tag @s add basicAttack",
              "/scoreboard players set @s ba_reset 30",
              "/playanimation @s[scores={basic_attack=1}] animation.odachi.basic1",
              "/playanimation @s[scores={basic_attack=2}] animation.odachi.basic2",
              "/playanimation @s[scores={basic_attack=3}] animation.odachi.basic3",
              "/playanimation @s[scores={basic_attack=4}] animation.odachi.basic4"
              ],
            "on_exit": [
              "/scoreboard players set @s ba_attacking 0",
              "/tag @s remove basicAttack",
              "/scoreboard players set @s[scores={basic_attack=4..}] ba_cd 60"
              ]
        }
      }
    },
    "controller.animation.odachi.charged_attack": {
      "states": {
        "default": {
          "transitions": [
            {
              "ready": "q.is_alive"
            }
            ]
        },
        "ready": {
          "transitions": [
            {
              "armed": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon:odachi')"
            }
            ],
          "on_entry": [
            "/scoreboard players set @s ba_attacking 0",
            "/tag @s remove basicAttack",
            "/scoreboard players set @s has_skill 0",
            "/event entity @s[scores={weaponTimer=0}] weapon_equip:unarmed",
            "/event entity @s[scores={weaponTimer=0}] weapon_name:none"
            ],
          "on_exit": [
            "/event entity @s weapon_equip:armed",
            "/event entity @s weapon_name2:odachi",
            "/event entity @s weapon_name:remove1"
            ]
        },
        "cooldown": {
          "transitions": [
            {
              "armed": "q.scoreboard('chargedatk_cd') == 0"
            },
            {
              "ready": "q.all_animations_finished && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:odachi') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
            ]
        },
        "armed": {
          "transitions": [
            {
              "cooldown": "q.scoreboard('chargedatk_cd') > 0"
            },
            {
              "attack": "q.property('weapon:name2')==8 && v.attack_time && q.scoreboard('stun') == 0 && !q.is_jumping && q.is_sneaking && q.scoreboard('has_skill') == 0 && q.scoreboard('ba_attacking') == 0"
            },
            {
              "ready": "q.all_animations_finished && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:odachi') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
             ]
        },
        "attack": {
          "transitions": [
            {
              "cooldown": "q.scoreboard('chargedatk_cd') > 0"
            },
            {
              "armed": "q.any_animation_finished && q.scoreboard('chargedatk_cd') == 0 || q.scoreboard('stun') > 0 || q.scoreboard('clashing') > 0"
            }
            ],
            "animations": [
              "odachi.charged_attack"
              ],
            "on_entry": [
              "@s movement:stop",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s animation.odachi.charged_attack"
              ],
            "on_exit": [
              "/tag @s remove hasSkill",
              "@s movement:walk",
              "/scoreboard players set @s has_skill 0",
              "/scoreboard players set @s[tag=trait:shortcd] chargedatk_cd 300",
              "/scoreboard players set @s[tag=!trait:shortcd,tag=!trait:longcd] chargedatk_cd 400",
              "/scoreboard players set @s[tag=trait:longcd] chargedatk_cd 500"
              ]
        }
      }
    },
    "controller.animation.odachi.skill_attack": {
      "states": {
        "default": {
          "transitions": [
            {
              "ready": "q.is_alive"
            }
            ]
        },
        "ready": {
          "transitions": [
            {
              "armed": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon:odachi')"
            }
            ],
          "on_entry": [
            "/scoreboard players set @s ba_attacking 0",
            "/tag @s remove basicAttack",
            "/scoreboard players set @s has_skill 0",
            "/event entity @s[scores={weaponTimer=0}] weapon_equip:unarmed",
            "/event entity @s[scores={weaponTimer=0}] weapon_name:none"
            ],
          "on_exit": [
            "/event entity @s weapon_equip:armed",
            "/event entity @s weapon_name2:odachi",
            "/event entity @s weapon_name:remove1"
            ]
        },
        "cooldown": {
          "transitions": [
            {
              "armed": "q.scoreboard('skillatk_cd') == 0"
            },
            {
              "ready": "q.all_animations_finished && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:odachi') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
            ]
        },
        "armed": {
          "transitions": [
            {
              "cooldown": "q.scoreboard('skillatk_cd') > 0"
            },
            {
              "attack": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon:odachi') && q.property('weapon:name2')==8 && q.is_using_item && q.scoreboard('stun') == 0 && !q.is_jumping && !q.is_sneaking && !q.is_sprinting && q.scoreboard('has_skill') == 0 && q.scoreboard('ba_attacking') == 0 && q.scoreboard('headrot') > -5"
            },
            {
              "ready": "q.all_animations_finished && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:odachi') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
             ]
        },
        "attack": {
          "transitions": [
            {
              "attack2": "q.is_using_item && q.any_animation_finished && q.scoreboard('stamina') > 5"
            },
            {
              "armed": "!q.is_using_item && q.any_animation_finished || q.scoreboard('stun') > 0"
            }
            ],
            "animations": [
              "odachi.skill_attack"
              ],
            "on_entry": [
              "@s movement:stop",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s animation.odachi.skill_attack"
              ],
            "on_exit": [
              "/tag @s remove stunImmune",
              "/tag @s remove hasSkill",
              "/scoreboard players set @s has_skill 0",
              "/event entity @s movement:walk",
              "/scoreboard players set @s[tag=trait:shortcd] skillatk_cd 400",
              "/scoreboard players set @s[tag=!trait:shortcd,tag=!trait:longcd] skillatk_cd 500",
              "/scoreboard players set @s[tag=trait:longcd] skillatk_cd 600"
              ]
        },
        "attack2": {
          "transitions": [
            {
              "attack": "q.is_using_item && q.any_animation_finished && q.scoreboard('stamina') > 5"
            },
            {
              "armed": "!q.is_using_item && q.any_animation_finished || q.scoreboard('stun') > 0"
            }
            ],
            "animations": [
              "odachi.skill_attack"
              ],
            "on_entry": [
              "@s movement:stop",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s animation.odachi.skill_attack",
              "/scoreboard players remove @s stamina 5"
              ],
            "on_exit": [
              "/tag @s remove stunImmune",
              "/tag @s remove hasSkill",
              "/scoreboard players set @s has_skill 0",
              "/event entity @s movement:walk",
              "/scoreboard players set @s[tag=trait:shortcd] skillatk_cd 300",
              "/scoreboard players set @s[tag=!trait:shortcd,tag=!trait:longcd] skillatk_cd 400",
              "/scoreboard players set @s[tag=trait:longcd] skillatk_cd 500"
              ]
        }
      }
    }
  }
}