{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.npc.card.twirling_pierce.ct": {
      "states": {
        "default": {
          "transitions": [
            {
              "attack": "q.property('attack:card') == 'twirlingpierce' && q.scoreboard('stun') == 0 && q.scoreboard('has_skill') == 0"
            }
             ],
          "on_entry": [
            "@s ridedisable",
            "/tag @s remove grab:entityA",
            "/tag @s remove regsword:grab",
            "/event entity @s[scores={stun=0}] cooldownAttack"
            ]
        },
        "attack": {
          "transitions": [
            {
              "default": "q.scoreboard('stun') > 0 || q.scoreboard('grab_sensor') == 0 && q.any_animation_finished"
            },
            {
              "hit": "q.scoreboard('grab_sensor') == 1 && q.any_animation_finished && q.scoreboard('stun') == 0"
            }
            ],
            "animations": [
              "card.twirling_pierce"
              ],
            "on_entry": [
              "/tag @s add grab:entityA",
              "/scoreboard players set @s combatTag -1",
              "@s movement:stop",
              "@s attack_card:twirlingpierce",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s animation.regular_sword.card.twirling_pierce"
              ],
            "on_exit": [
              "/tag @s add regsword:grab",
              "/execute as @s[scores={stun=0}] at @s run playanimation @e[tag=grab:entityB,c=1] animation.regular_sword.card.twirling_pierce.hit.victim",
              "/tag @s add grab:entityA",
              "/scoreboard players set @s has_skill 0",
              "/tag @s remove hasSkill",
	            "/execute as @s[scores={grab_sensor=1}] at @s run playanimation @e[tag=grab:entityB,c=1] animation.regular_sword.card.twirling_pierce.hit.victim"
              ]
        },
        "hit": {
          "transitions": [
            {
              "default": "q.any_animation_finished || q.scoreboard('stun') > 0"
            }
            ],
          "animations": [
            "card.twirling_pierce.hit"
            ],
            "on_entry": [
              "/tag @s add grab:entityA",
              "/tag @s add iframes",
              "/event entity @s movement:stop",
	            "/playanimation @e[tag=grab:entityB,c=1] animation.regular_sword.card.twirling_pierce.hit.victim",
              "@s movement:stop",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s animation.regular_sword.card.twirling_pierce.hit"
              ],
            "on_exit": [
              "@s ridedisable",
              "/tag @s remove iframes",
              "/tag @s remove grab:entityA",
              "/tag @e[c=1,tag=grab:entityB] remove grab:entityB",
            "/scoreboard players random @s grabID -10000 10000",
              "/event entity @s body_rotation:enabled",
              "/event entity @s[scores={stun=0}] movement:walk",
              "/tag @s remove holder",
              "/tag @e[c=1,tag=grab] remove grab",
              "/scoreboard players set @s grab_sensor 0",
              "/tag @e remove grab",
              "/tag @s remove hasSkill",
              "/scoreboard players set @s has_skill 0"
              ]
        }
      }
    },
    "controller.animation.npc.card.slash.ct": {
      "states": {
        "default": {
          "transitions": [
            {
              "attack": "q.property('attack:card') == 'slash' && q.scoreboard('stun') == 0 && q.scoreboard('has_skill') == 0"
            }
             ],
          "on_entry": [
            "/event entity @s[scores={stun=0}] cooldownAttack"
            ]
        },
        "attack": {
          "transitions": [
            {
              "default": "q.scoreboard('stun') > 0 || q.any_animation_finished"
            }
            ],
            "animations": [
              "card.slash"
              ],
            "on_entry": [
              "@s movement:stop",
              "/event entity @s attack_card:slash",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s animation.regular_sword.card.slash"
              ],
            "on_exit": [
              "/event entity @s attack_card:idle",
              "/event entity @s[scores={stun=0}] movement:walk",
              "/scoreboard players set @s has_skill 0",
              "/tag @s remove hasSkill"
              ]
        }
      }
    }
  }
}