{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.rumble.armament": {
      "states": {
        "default": {
          "transitions": [
            {
              "ready": "q.is_alive"
            }
            ]
        },
        "ready": {
          "transitions": [
            {
              "armed": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon:rumble')"
            }
            ],
          "on_entry": [
            "/scoreboard players set @s has_skill 0",
            "/event entity @s[tag=!combat:enabled] weapon_equip:unarmed",
            "/event entity @s[tag=!combat:enabled] weapon_name:none"
            ],
          "on_exit": [
            "/event entity @s weapon_equip:armed","/event entity @s weapon_name:remove2",
            "/event entity @s weapon_name:rumble"
            ]
        },
        "meleeMode": {
          "transitions": [
            {
              "default": "q.is_alive"
            }
            ],
          "on_entry": [
            "/event entity @s weapon_name:rumblev2",
            "/replaceitem entity @s slot.weapon.mainhand 0 weapon:rumblev2 1 0"
            ]
        },
        "cooldown": {
          "transitions": [
            {
              "meleeMode": "v.attack_time > 0 && q.scoreboard('stun') == 0 && q.is_sneaking && q.scoreboard('headrot') > -5 && !q.is_sprinting"
            },
            {
              "armed": "q.scoreboard('magicule') > 0"
            },
            {
              "default": "!q.equipped_item_any_tag('slot.weapon.mainhand','weapon:rumble') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
            ],
          "on_entry": [
            "/playanimation @s[scores={cycleMode=0}] animation.rumble.exhaust",
            "/playanimation @s[scores={cycleMode=1}] animation.rumble.exhaust2",
              "/tag @s remove hasSkill",
              "@s movement:walk"
            ]
        },
        "armed": {
          "transitions": [
            {
              "cooldown": "q.scoreboard('magicule') == 0"
            },
            {
              "cycle": "q.scoreboard('stun') == 0 && v.attack_time > 0 && !q.is_sneaking"
            },
            {
              "shoot": "q.is_using_item && q.scoreboard('stun') == 0 && !q.is_sneaking && q.scoreboard('headrot') > -5 && q.scoreboard('magicule') > 0 && !q.is_sprinting"
            },
            {
              "meleeMode": "v.attack_time > 0 && q.scoreboard('stun') == 0 && q.is_sneaking && q.scoreboard('headrot') > -5 && !q.is_sprinting"
            },
            {
              "default": "!q.equipped_item_any_tag('slot.weapon.mainhand','weapon:rumble') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
             ],
             "on_entry": [
            "/playanimation @s[scores={cycleMode=0}] animation.rumble.exhaust",
            "/playanimation @s[scores={cycleMode=1}] animation.rumble.exhaust2",
            "/inputpermission set @s[scores={stun=0}] lateral_movement enabled"
            ]
        },
        "cycle": {
          "transitions": [
            {
              "armed": "v.attack_time == 0"
            },
            {
              "default": "!q.equipped_item_any_tag('slot.weapon.mainhand','weapon:rumble') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
            ],
           "on_entry": [
             "/scoreboard players add @s cycleMode 1",
             "/scoreboard players set @s[scores={cycleMode=2..}] cycleMode 0"
             ],
           "on_exit": [
             "/tellraw @s[scores={cycleMode=0}] {\"rawtext\":[{\"text\":\"Rapid Mode\"}]}",
             "/tellraw @s[scores={cycleMode=1}] {\"rawtext\":[{\"text\":\"H.E. Mode\"}]}"
             ]
        },
        "shoot": {
          "transitions": [
            {
              "meleeMode": "v.attack_time > 0 && q.scoreboard('stun') == 0 && q.is_sneaking && q.scoreboard('headrot') > -5 && !q.is_sprinting"
            },
            {
              "cycle": "q.scoreboard('stun') == 0 && v.attack_time > 0 && !q.is_sneaking"
            },
            {
              "cooldown": "q.scoreboard('stun') > 0 || q.scoreboard('magicule') == 0 || q.is_sneaking && q.any_animation_finished || !q.is_using_item && q.any_animation_finished"
            },
            {
              "shoot_b": "q.is_using_item && q.scoreboard('stun') == 0 && !q.is_sneaking && q.scoreboard('headrot') > -5 && q.scoreboard('magicule') > 0 && q.any_animation_finished"
            },
            {
              "default": "!q.equipped_item_any_tag('slot.weapon.mainhand','weapon:rumble') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
            ],
            "animations": [
              {
                "rumble.shoot": "q.scoreboard('cycleMode') == 0 && !q.is_sprinting"
              },
              {
                "rumble.shoot2": "q.scoreboard('cycleMode') == 1 && q.scoreboard('magicule') > 49 && q.is_using_item && !q.is_sprinting"
              }
              ],
            "on_entry": [
              "@s movement:walk",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s[scores={cycleMode=0,magicule=1..}] animation.rumble.shoot",
              "/playanimation @s[scores={cycleMode=1,magicule=50..}] animation.rumble.shoot2",
              "/scoreboard players remove @s[scores={cycleMode=0,magicule=1..}] magicule 1",
              "/scoreboard players remove @s[scores={cycleMode=1,magicule=50..}] magicule 50"
              ],
            "on_exit": [
              "/scoreboard players set @s has_skill 1"
              ]
        },
        "shoot_b": {
          "transitions": [
            {
              "meleeMode": "v.attack_time > 0 && q.scoreboard('stun') == 0 && q.is_sneaking && q.scoreboard('headrot') > -5 && !q.is_sprinting"
            },
            {
              "cycle": "q.scoreboard('stun') == 0 && v.attack_time > 0 && !q.is_sneaking"
            },
            {
              "cooldown": "q.scoreboard('stun') > 0 || q.scoreboard('magicule') == 0 || q.is_sneaking && q.any_animation_finished || !q.is_using_item && q.any_animation_finished"
            },
            {
              "shoot": "q.is_using_item && q.scoreboard('stun') == 0 && !q.is_sneaking && q.scoreboard('headrot') > -5 && q.scoreboard('magicule') > 0 && q.any_animation_finished"
            },
            {
              "default": "!q.equipped_item_any_tag('slot.weapon.mainhand','weapon:rumble') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
            ],
            "animations": [
              {
                "rumble.shoot": "q.scoreboard('cycleMode') == 0 && !q.is_sprinting"
              },
              {
                "rumble.shoot2": "q.scoreboard('cycleMode') == 1 && q.scoreboard('magicule') > 49 && q.is_using_item && !q.is_sprinting"
              }
              ],
            "on_entry": [
              "@s movement:walk",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s[scores={cycleMode=0,magicule=1..}] animation.rumble.shoot",
              "/playanimation @s[scores={cycleMode=1,magicule=50..}] animation.rumble.shoot2",
              "/scoreboard players remove @s[scores={cycleMode=0,magicule=1..}] magicule 1",
              "/scoreboard players remove @s[scores={cycleMode=1,magicule=50..}] magicule 50"
              ],
            "on_exit": [
              "/scoreboard players set @s has_skill 1"
              ]
        }
      }
    }
  }
}