{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.regular_staff.ct": {
      "states": {
        "default": {
          "transitions": [
            {
              "ready": "q.is_alive"
            }
            ]
        },
        "ready": {
          "transitions": [
            {
              "armed": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon:regular_staff')"
            }
            ],
          "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:regular_staff",
            "/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') == 1 && 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": [
              {
                "regular_staff.cycle": "q.scoreboard('stun') == 0"
              }
              ],
            "on_entry": [
              "/scoreboard players set @s ba_attacking 1",
              "/tag @s add basicAttack",
              "/scoreboard players set @s ba_reset 90000",
              "/playanimation @s animation.regular_staff.cycle"
              ],
            "on_exit": [
              "/scoreboard players set @s ba_attacking 0",
              "/tellraw @s[scores={basic_attack=0..1}] {\"rawtext\":[{\"text\":\"§lMAGIC SPHERE\"}]}",
              "/tellraw @s[scores={basic_attack=2}] {\"rawtext\":[{\"text\":\"§lBURST SHOT\"}]}",
              "/tellraw @s[scores={basic_attack=3}] {\"rawtext\":[{\"text\":\"§lBLUE SKULL COMPANIONS\"}]}",
              "/tellraw @s[scores={basic_attack=4}] {\"rawtext\":[{\"text\":\"§lPURPLE SKULL\"}]}",
              "/tag @s remove basicAttack",
              "/scoreboard players set @s[scores={basic_attack=4..}] ba_cd 1"
              ]
        }
      }
    },
    "controller.animation.regular_staff.powerup": {
      "states": {
        "default": {
          "transitions": [
            {
              "ready": "q.is_alive"
            }
            ]
        },
        "ready": {
          "transitions": [
            {
              "armed": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon:regular_staff')"
            }
            ],
          "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:regular_staff",
            "/event entity @s weapon_name:remove1"
            ]
        },
        "armed": {
          "transitions": [
            {
              "attack": "q.property('weapon:name2') == 1 && v.attack_time == 0 && !q.is_using_item && 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:regular_staff') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
             ]
        },
        "attack": {
          "animations": [
            "regular_staff.powerup"
            ],
          "transitions": [
            {
              "attack2": "q.property('weapon:name2') == 1 && v.attack_time == 0 && !q.is_using_item && q.scoreboard('stun') == 0 && !q.is_jumping && q.is_sneaking && q.scoreboard('has_skill') == 0 && q.scoreboard('ba_attacking') == 0"
            },
            {
              "armed": "!q.is_sneaking || q.scoreboard('stun') > 0"
            }
            ],
            "on_entry": [
              "/tag @s add mana:regen",
              "@s movement:stop",
              "/playanimation @s animation.regular_staff.powerup"
              ],
            "on_exit": [
              "/tag @s remove mana:regen",
              "@s[scores={stun=0}] movement:walk"
              ]
        },
        "attack2": {
          "animations": [
            "regular_staff.powerup"
            ],
          "transitions": [
            {
              "attack": "q.property('weapon:name2') == 1 && v.attack_time == 0 && !q.is_using_item && q.scoreboard('stun') == 0 && !q.is_jumping && q.is_sneaking && q.scoreboard('has_skill') == 0 && q.scoreboard('ba_attacking') == 0"
            },
            {
              "armed": "!q.is_sneaking || q.scoreboard('stun') > 0"
            },
            {
              "ready": "q.all_animations_finished && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:regular_staff') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
            ],
            "on_entry": [
              "/tag @s add mana:regen",
              "@s movement:stop",
              "/playanimation @s animation.regular_staff.powerup"
              ],
            "on_exit": [
              "/tag @s remove mana:regen",
              "@s movement:walk"
              ]
        }
      }
    },
    "controller.animation.regular_staff.cast": {
      "states": {
        "default": {
          "transitions": [
            {
              "ready": "q.is_alive"
            }
            ]
        },
        "ready": {
          "transitions": [
            {
              "armed": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon:regular_staff')"
            }
            ],
          "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:regular_staff",
            "/event entity @s weapon_name:remove1"
            ]
        },
        "armed": {
          "transitions": [
            {
              "casting": "q.property('weapon:name2') == 1 && q.is_using_item && 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:regular_staff') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
             ]
        },
        "casting": {
          "animations": [
            "regular_staff.cast"
            ],
          "transitions": [
            {
              "cast_held": "q.any_animation_finished && q.property('weapon:name2') == 1 && q.is_using_item && q.scoreboard('stun') == 0 && !q.is_jumping && !q.is_sneaking && q.scoreboard('has_skill') == 0 && q.scoreboard('ba_attacking') == 0 && q.scoreboard('magicule') > 24"
            },
            {
              "armed": "!q.is_using_item || q.scoreboard('stun') > 0 || q.scoreboard('magicule') < 25"
            },
            {
              "ready": "q.all_animations_finished && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:regular_staff') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
            ],
            "on_entry": [
              "@s movement:walk",
              "/playanimation @s animation.regular_staff.cast"
              ]
        },
        "cast_held": {
          "animations": [
            "regular_staff.cast_held"
            ],
          "transitions": [
            {
              "cast_held2": "q.any_animation_finished && q.property('weapon:name2') == 1 && q.is_using_item && q.scoreboard('stun') == 0 && !q.is_jumping && !q.is_sneaking && q.scoreboard('has_skill') == 0 && q.scoreboard('ba_attacking') == 0 && q.scoreboard('magicule') > 24"
            },
            {
              "armed": "!q.is_using_item && q.any_animation_finished || q.scoreboard('stun') > 0 || q.scoreboard('magicule') < 25"
            }
            ],
            "on_entry": [
              "@s movement:walk",
              "/playanimation @s animation.regular_staff.cast_held"
              ],
            "on_exit": [
              "/scoreboard players remove @s[scores={basic_attack=1}] magicule 25",
              "/scoreboard players remove @s[scores={basic_attack=2}] magicule 150",
              "/scoreboard players remove @s[scores={basic_attack=3}] magicule 250",
              "/scoreboard players remove @s[scores={basic_attack=0}] magicule 150"
              ]
        },
        "cast_held2": {
          "animations": [
            "regular_staff.cast_held"
            ],
          "transitions": [
            {
              "cast_held": "q.any_animation_finished && q.property('weapon:name2') == 1 && q.is_using_item  && q.scoreboard('stun') == 0 && !q.is_jumping && !q.is_sneaking && q.scoreboard('has_skill') == 0 && q.scoreboard('ba_attacking') == 0 && q.scoreboard('magicule') > 24"
            },
            {
              "armed": "!q.is_using_item && q.any_animation_finished || q.scoreboard('stun') > 0 || q.scoreboard('magicule') < 25"
            }
            ],
            "on_entry": [
              "@s movement:walk",
              "/playanimation @s animation.regular_staff.cast_held"
              ],
            "on_exit": [
              "/scoreboard players remove @s[scores={basic_attack=0..1}] magicule 25",
              "/scoreboard players remove @s[scores={basic_attack=2}] magicule 150",
              "/scoreboard players remove @s[scores={basic_attack=3}] magicule 250",
              "/scoreboard players remove @s[scores={basic_attack=0}] magicule 150"
              ]
        }
      }
    }
  }
}