{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.card.divide.ct": {
      "initial_state": "cooldown",
      "states": {
        "cooldown": {
          "transitions": [
            {
              "armed": "q.scoreboard('divide_cd') == 0"
            }
            ]
        },
        "armed": {
          "transitions": [
            {
              "cooldown": "q.scoreboard('divide_cd') > 0"
            },
            {
              "attack": "q.equipped_item_any_tag('slot.weapon.mainhand','card:divide') && q.scoreboard('stun') == 0 && q.is_using_item && !q.is_sneaking && !q.is_jumping && q.scoreboard('divide_cd') == 0 && q.scoreboard('has_skill') == 0 && q.scoreboard('headrot') > -5"
            }
            ],
          "on_entry": [
            "/camera @s clear",
            "/tag @s remove grab:entityA",
            "/inputpermission set @s[scores={stun=0}] lateral_movement enabled"
            ]
        },
        "attack": {
          "transitions": [
            {
              "armed": "q.any_animation_finished && q.scoreboard('grab_sensor') == 0 || q.scoreboard('stun') > 0"
            },
            {
              "hit": "q.scoreboard('grab_sensor') == 1"
            }
            ],
            "on_entry": [
              "/tag @s add grabAnim",
              "/tag @s add grab:entityA",
              "/tag @s add divide:grab",
              "@s movement:stop",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s animation.abyssfiend_blade.card.divide",
              "/tp @s @s"
              ],
            "on_exit": [
              "/tag @s remove divide:grab",
              "/tag @s remove hasSkill",
              "@s movement:walk",
              "/scoreboard players set @s has_skill 0",
              "/scoreboard players set @s[tag=trait:shortcd] divide_cd 400",
              "/scoreboard players set @s[tag=!trait:shortcd,tag=!trait:longcd] divide_cd 460",
              "/scoreboard players set @s[tag=tag=trait:longcd] divide_cd 500"
              ],
             "animations": [
               "card.divide"
               ]
        },
        "hit": {
          "transitions": [
            {
              "armed": "q.any_animation_finished || q.scoreboard('stun') > 0"
            }
            ],
          "animations": [
            "card.divide.hit"
            ],
            "on_entry": [
              "/tag @s add grab:entityA",
              "/inputpermission set @s lateral_movement disabled",
	            "/playanimation @e[tag=grab:entityB,c=1] animation.abyssfiend_blade.card.divide.hit.victim",
              "/inputpermission set @s camera disabled",
              "@s movement:stop",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s animation.abyssfiend_blade.card.divide.hit"
              ],
            "on_exit": [
              "/scoreboard players set @s inGrab 0",
              "@s ridedisable",
              "/tag @e[c=1,tag=grab:entityB] remove grab:entityB",
            "/scoreboard players random @s grabID -10000 10000",
              "/inputpermission set @s camera enabled",
              "/tag @s remove grab:entityA",
              "/scoreboard players set @s grab_sensor 0",
              "/tag @s remove hasSkill",
              "@s movement:walk",
              "/scoreboard players set @s has_skill 0",
              "/scoreboard players set @s[tag=trait:shortcd] divide_cd 400",
              "/scoreboard players set @s[tag=!trait:shortcd,tag=!trait:longcd] divide_cd 460",
              "/scoreboard players set @s[tag=tag=trait:longcd] divide_cd 500"
              ]
        }
      }
    },
    "controller.animation.card.repel.ct": {
      "initial_state": "cooldown",
      "states": {
        "cooldown": {
          "transitions": [
            {
              "armed": "q.scoreboard('repel_cd') == 0"
            }
            ]
        },
        "armed": {
          "transitions": [
            {
              "cooldown": "q.scoreboard('repel_cd') > 0"
            },
            {
              "attack": "q.equipped_item_any_tag('slot.weapon.mainhand','card:repel') && q.scoreboard('stun') == 0 && q.is_using_item && !q.is_sneaking && !q.is_jumping && q.scoreboard('repel_cd') == 0 && q.scoreboard('has_skill') == 0 && q.scoreboard('headrot') > -5"
            }
            ],
          "on_entry": [
            "/inputpermission set @s[scores={stun=0}] lateral_movement enabled"
            ]
        },
        "attack": {
          "transitions": [
            {
              "armed": "q.any_animation_finished && q.scoreboard('grab_sensor') == 0 || q.scoreboard('stun') > 0"
            }
            ],
            "on_entry": [
              "@s movement:stop",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s animation.abyssfiend_blade.moveset.repel"
              ],
            "on_exit": [
              "/tag @s remove hasSkill",
              "@s movement:walk",
              "/scoreboard players set @s has_skill 0",
              "/scoreboard players set @s[tag=trait:shortcd] repel_cd 100",
              "/scoreboard players set @s[tag=!trait:shortcd,tag=!trait:longcd] repel_cd 160",
              "/scoreboard players set @s[tag=trait:longcd] repel_cd 200"
              
              ],
             "animations": [
               "card.repel"
               ]
        }
      }
    }
  }
}