{
  "format_version": "1.21.0",
  "animation_controllers": {
    "controller.animation.combat.npc.basic": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "idle": "q.is_alive"
            }
            ],
          "on_exit": [
            "/execute as @s at @s run function fixScores",
            "/function setScoreboardObjectives"
            ]
        },
        "idle": {
          "transitions": [
            {
              "stun": "q.scoreboard('stun') > 0"
            },
            {
              "block": "q.property('attack:state') == 'block' && q.scoreboard('stun') == 0 && q.scoreboard('ba_attacking') == 0 && q.scoreboard('has_skill') == 0"
            },
            {
              "dash": "q.property('attack:state') == 'dash' && q.scoreboard('stun') == 0"
            }
            ],
          "on_entry": [
            "@s movement:walk",
            "/scoreboard players set @s[scores={emotionP=..-50}] stamina -100"
            ]
        },
        "stun": {
          "transitions": [
            {
              "idle": "q.scoreboard('stun') == 0"
            },
            {
              "burst": "q.scoreboard('burst_cd') == 0 && q.scoreboard('stun') > 60 && q.scoreboard('inGrab') == 0 && q.scoreboard('stamina') > 0"
            }
            ],
          "on_entry": [
            "/scoreboard players set @s block 0",
            "/tag @s add stun",
            "/scoreboard players set @s combatTag -1",
            "@s attack_state:stun",
            "@s movement:stop",
            "@s body_rotation:blocked"
            ],
          "on_exit": [
            "/tag @s remove stun",
            "/event entity @s[tag=hasTarget] cooldownAttack",
            "@s body_rotation:enabled",
            "/scoreboard players set @s[scores={emotionP=..-50}] stamina -200",
            "/scoreboard players set @s[scores={emotionP=..-50}] emotionP 25"
            ]
        },
        "dash": {
          "animations": [
            "playerCombat.dash"
            ],
          "transitions": [
            {
              "idle": "q.all_animations_finished && q.scoreboard('stun') == 0"
            },
            {
              "stun": "q.scoreboard('stun') > 0"
            }
            ],
            "on_entry": [
              "/scoreboard players set @s kbHori -30",
              "/scoreboard players set @s kbVerti -3",
              "@s invincibility:on",
              "/event entity @s[tag=!superarmor] no_kb:resistance",
              "/tag @s add dashing",
              "/scoreboard players remove @s[tag=!DStrait] stamina 17",
              "/scoreboard players remove @s[tag=DStrait] stamina 27",
              "/scoreboard players set @s dashing 1",
              "/scoreboard players set @s block 15",
              "/scoreboard players remove @s[scores={stamina=25.}] stamina 25"
              ],
            "on_exit": [
              "/scoreboard players set @s kbHori 0",
              "/scoreboard players set @s kbVerti 0",
              "@s invincibility:off",
              "/event entity @s[tag=superarmor] kb:resistance",
              "/tag @s remove iframes",
              "/tag @s remove dashing",
              "/scoreboard players set @s dashing 0",
              "/scoreboard players set @s block 0"
              ]
        },
        "block": {
          "transitions": [
            {
              "stun": "q.scoreboard('stun') > 0"
            },
            {
              "idle": "q.scoreboard('ba_attacking') == 1 && q.scoreboard('stun') == 0 || q.scoreboard('has_skill') == 1 && q.scoreboard('stun') == 0 || q.property('attack:state') == 'idle' && q.scoreboard('stun') == 0"
            }
            ],
          "on_entry": [
            "@s invincibility:on",
            "/tag @s add blocking",
            "/scoreboard players set @s[tag=longParry] parry 10",
            "/scoreboard players set @s[tag=!longParry] parry 5",
            "/scoreboard players set @s block 1"
            ],
          "on_exit": [
            "@s invincibility:off",
            "/tag @s remove blocking",
            "/scoreboard players set @s block 0"
            ]
        },
        "burst": {
          "transitions": [
            {
              "idle": "q.is_alive"
            }
            ],
          "on_entry": [
            "/tag @s add applyKB",
            "/scoreboard players set @s hitboxRange 35",
            "/scoreboard players set @s damageOutput 5",
            "/scoreboard players set @s stunTime 5",
            "/scoreboard players set @s burst_cd 100",
            "/summon combat:burst",
            "/scoreboard players set @s stun 0",
            "/scoreboard players remove @s stamina 50",
            "/scoreboard players remove @s emotionP 20"
            ],
          "on_exit": [
            "/tag @s remove hitboxIframes",
            "/function attacks/radius",
            "@s roar4"
            ]
        }
      }
    },
    "controller.animation.hasTarget.npc": {
      "states": {
        "default": {
          "transitions": [
            {
              "hasTarget": "q.has_target"
            }
            ],
          "on_entry": [
            "/scoreboard players set @s combatTag -1"
            ]
        },
        "hasTarget": {
          "on_entry": [
            "/tag @s add hasTarget"
            ],
          "transitions": [
            {
              "default": "!q.has_target"
            }
            ],
          "on_exit": [
            "/tag @s remove hasTarget"
            ]
        }
      }
    }
  }
}