{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.rumiaex.darkgrapple": {
      "initial_state": "cooldown",
      "states": {
        "cooldown": {
          "transitions": [
            {
              "armed": "q.scoreboard('darkgrapple_cd') == 0"
            }
            ]
        },
        "armed": {
          "transitions": [
            {
              "cooldown": "q.scoreboard('darkgrapple_cd') > 0"
            },
            {
              "attack": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon:rumiaex') && q.scoreboard('stun') == 0 && q.is_using_item && q.is_sneaking && !q.is_jumping && q.scoreboard('darkgrapple_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",
              "/tp @s @s",
              "/tag @s add grab:entityA",
              "/tag @s add darkgrapple:grab",
              "@s movement:stop",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s animation.rumiaex.darkgrapple",
              "/tp @s @s"
              ],
            "on_exit": [
              "/tag @s remove darkgrapple:grab",
              "/tag @s remove hasSkill",
              "@s movement:walk",
              "/scoreboard players set @s has_skill 0",
              "/scoreboard players set @s[tag=trait:shortcd] darkgrapple_cd 400",
              "/scoreboard players set @s[tag=!trait:shortcd,tag=!trait:longcd] darkgrapple_cd 460",
              "/scoreboard players set @s[tag=tag=trait:longcd] darkgrapple_cd 500"
              ],
             "animations": [
               "rumiaex.darkgrapple"
               ]
        },
        "hit": {
          "transitions": [
            {
              "armed": "q.any_animation_finished || q.scoreboard('stun') > 0"
            }
            ],
          "animations": [
            "rumiaex.darkgrapple.hit"
            ],
            "on_entry": [
              "/camera @s set minecraft:free pos ^5^1^3.5 facing ^^1^3.5",
              "/tag @s add grab:entityA",
              "/inputpermission set @s lateral_movement disabled",
	            "/playanimation @e[tag=grab:entityB,c=1] animation.rumiaex.darkgrapple.hit.victim",
              "/inputpermission set @s camera disabled",
              "@s movement:stop",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s animation.rumiaex.darkgrapple.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] darkgrapple_cd 400",
              "/scoreboard players set @s[tag=!trait:shortcd,tag=!trait:longcd] darkgrapple_cd 460",
              "/scoreboard players set @s[tag=tag=trait:longcd] darkgrapple_cd 500"
              ]
        }
      }
    },
    "controller.animation.rumiaex.ultima": {
      "states": {
        "default": {
          "transitions": [
            {
              "idle": "q.scoreboard('ultima_dur') == 0"
            },
            {
              "manifested": "q.scoreboard('ultima_dur') > 0"
            }
            ]
        },
        "idle": {
          "transitions": [
            {
              "manifesting_pre": "q.equipped_item_any_tag('slot.weapon.mainhand','misc:ultima_slot') && q.scoreboard('ba_attacking') == 0 && q.scoreboard('has_skill') == 0 && q.scoreboard('stun') == 0 && q.scoreboard('headrot') == -5 && q.is_using_item && q.scoreboard('ultima_cd') == 0"
            }
            ],
          "on_entry": [
            "/tag @s[scores={ultima_dur=0}] remove ultima:active",
            "/replaceitem entity @s slot.hotbar 8 misc:ultima_slot 1 0 {\"minecraft:keep_on_death\":{},\"minecraft:item_lock\":{\"mode\":\"lock_in_slot\"}}",
            "/inputpermission set @s lateral_movement enabled",
            "/inputpermission set @s jump enabled",
            "/event entity @s ultima_state:none",
            "/event entity @s weapon_equip:unarmed",
            "/event entity @s weapon_name:none"
            ],
          "on_exit": [
            "/event entity @s ultima_state:rumiaex"
            ]
        },
        "manifesting_pre": {
          "animations": [
            "rumiaex.manifest_pre"
            ],
          "transitions": [
            {
              "manifesting": "q.any_animation_finished"
            }
            ],
          "on_entry": [
            "/scoreboard players remove @s emotionP 15",
            "/inputpermission set @s lateral_movement disabled",
            "/inputpermission set @s jump disabled"
            ]
        },
        "manifesting": {
          "animations": [
            "rumiaex.manifest"
            ],
          "transitions": [
            {
              "manifested": "q.any_animation_finished"
            }
            ],
          "on_entry": [
            "/replaceitem entity @s slot.hotbar 8 weapon:rumiaex 1 0 {\"minecraft:keep_on_death\":{},\"minecraft:item_lock\":{\"mode\":\"lock_in_slot\"}}",
            "/playanimation @s animation.rumiaex.manifest",
            "/inputpermission set @s lateral_movement disabled",
            "/inputpermission set @s jump disabled",
            "/tag @s add iframes"
            ],
          "on_exit": [
            "/inputpermission set @s lateral_movement enabled",
            "/inputpermission set @s jump enabled",
            "/tag @s remove iframes"
            ]
        },
        "manifested": {
          "transitions": [
            {
              "idle": "!q.is_alive || q.scoreboard('ultima_dur') == 0"
            }
            ],
          "on_entry": [
            "/camera @s clear",
            "/inputpermission set @s camera enabled",
            "/event entity @s weapon_equip:armed","/event entity @s weapon_name:remove2",
            "/event entity @s weapon_name:rumiaex",
            "/scoreboard players set @s[tag=!ultima:active,tag=!trait:undyingwill] ultima_dur 12000",
            "/scoreboard players set @s[tag=!ultima:active,tag=trait:undyingwill] ultima_dur 18000",
            "/tag @s add ultima:active"
            ],
          "on_exit": [
            "/tag @s remove ultima:active",
            "/scoreboard players set @s ultima_cd 6000",
            "/scoreboard players remove @s[tag=soul:integrity] stamina 200",
            "/scoreboard players set @s[tag=soul:integrity] emotionP -45"
            ]
        }
      }
    },
    "controller.animation.rumiaex.ct": {
      "states": {
        "default": {
          "transitions": [
            {
              "ready": "q.is_alive"
            }
            ]
        },
        "ready": {
          "transitions": [
            {
              "armed": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon:rumiaex')"
            }
            ],
          "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_name:rumiaex"
            ]
        },
        "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:name')=='rumiaex' && 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": [
              {
                "rumiaex.basic1": "q.scoreboard('basic_attack') <= 1"
              },
              {
                "rumiaex.basic2": "q.scoreboard('basic_attack') == 2"
              },
              {
                "rumiaex.basic3": "q.scoreboard('basic_attack') == 3"
              },
              {
                "rumiaex.basic4": "q.scoreboard('basic_attack') == 4"
              }
              ],
            "on_entry": [
              "/scoreboard players set @s ba_attacking 1",
              "/tag @s add basicAttack",
              "/scoreboard players set @s ba_reset 40",
              "/playanimation @s[scores={basic_attack=1}] animation.rumiaex.basic1",
              "/playanimation @s[scores={basic_attack=2}] animation.rumiaex.basic2",
              "/playanimation @s[scores={basic_attack=3}] animation.rumiaex.basic3",
              "/playanimation @s[scores={basic_attack=4}] animation.rumiaex.basic4"
              ],
            "on_exit": [
              "/scoreboard players set @s ba_attacking 0",
              "/tag @s remove basicAttack",
              "/scoreboard players set @s[scores={basic_attack=4..}] ba_cd 20"
              ]
        }
      }
    },
    "controller.animation.rumiaex.charged_attack": {
      "states": {
        "default": {
          "transitions": [
            {
              "ready": "q.is_alive"
            }
            ]
        },
        "ready": {
          "transitions": [
            {
              "armed": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon:rumiaex')"
            }
            ],
          "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_name:rumiaex"
            ]
        },
        "cooldown": {
          "transitions": [
            {
              "armed": "q.scoreboard('chargedatk_cd') == 0"
            },
            {
              "ready": "q.all_animations_finished && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:rumiaex') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
            ]
        },
        "armed": {
          "transitions": [
            {
              "cooldown": "q.scoreboard('chargedatk_cd') > 0"
            },
            {
              "attack": "q.property('weapon:name')=='rumiaex' && v.attack_time && 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:rumiaex') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
             ]
        },
        "attack": {
          "transitions": [
            {
              "cooldown": "q.scoreboard('chargedatk_cd') > 0"
            },
            {
              "armed": "q.any_animation_finished && q.scoreboard('chargedatk_cd') == 0 || q.scoreboard('stun') > 0 || q.scoreboard('clashing') > 0"
            }
            ],
            "animations": [
              "rumiaex.charged_attack"
              ],
            "on_entry": [
              "/inputpermission set @s camera disabled",
              "@s movement:stop",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s animation.rumiaex.charged_attack"
              ],
            "on_exit": [
              "/inputpermission set @s camera enabled",
              "/tag @s remove hasSkill",
              "@s movement:walk",
              "/scoreboard players set @s has_skill 0",
              "/scoreboard players set @s[tag=trait:shortcd] chargedatk_cd 140",
              "/scoreboard players set @s[tag=!trait:shortcd,tag=!trait:longcd] chargedatk_cd 200",
              "/scoreboard players set @s[tag=trait:longcd] chargedatk_cd 240"
              ]
        }
      }
    },
    "controller.animation.rumiaex.skill_attack": {
      "states": {
        "default": {
          "transitions": [
            {
              "ready": "q.is_alive"
            }
            ]
        },
        "ready": {
          "transitions": [
            {
              "armed": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon:rumiaex')"
            }
            ],
          "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_name:rumiaex"
            ]
        },
        "cooldown": {
          "transitions": [
            {
              "armed": "q.scoreboard('domainex_cd') == 0"
            },
            {
              "ready": "q.all_animations_finished && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:rumiaex') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
            ]
        },
        "armed": {
          "transitions": [
            {
              "cooldown": "q.scoreboard('domainex_cd') > 0"
            },
            {
              "checkdomain": "q.property('weapon:name')=='rumiaex' && q.is_using_item && q.scoreboard('stun') == 0 && !q.is_jumping && !q.is_sneaking && !q.is_sprinting && q.scoreboard('has_skill') == 0 && q.scoreboard('ba_attacking') == 0"
            },
            {
              "ready": "q.all_animations_finished && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:rumiaex') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
             ],
            "on_entry": [
              "/inputpermission set @s lateral_movement enabled",
              "/tag @s remove domain:clash",
              "/tag @s remove hasDomain",
              "/tag @s remove hitboxIframe",
              "/tag @s remove domainActive",
              "/scoreboard players add @e[r=15,scores={domainclash=1..}] emotionP 25",
              "/scoreboard players set @s domainclash 0",
              "/tag @s remove hasSkill",
              "@s movement:walk",
              "/scoreboard players set @s has_skill 0"
              ]
        },
        "checkdomain": {
          "transitions": [
            {
              "armed": "q.scoreboard('domainclash') == -100"
            },
            {
              "opendomain": "q.scoreboard('domainclash') == -101"
            },
            {
              "clashdomain": "q.scoreboard('domainclash') == 1"
            }
            ],
          "on_entry": [
            "/function domain/checkNearbyDomain"
            ],
          "on_exit":[
            ]
        },
        "opendomain": {
          "transitions": [
            {
              "clashdomain": "q.scoreboard('domainclash') == 1"
            },
            {
              "releasedomain": "q.scoreboard('domainclash') == 0 && q.any_animation_finished"
            },
            {
              "armed": "q.scoreboard('stun') > 0"
            }
            ],
            "animations": [
              "rumiaex.skill_attack"
              ],
            "on_entry": [
              "/tag @s remove domain:clashing",
              "/tag @s add domain:open",
              "/scoreboard players set @s domainclash 0",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/tag @s add hasDomain",
              "/tag @s add hitboxIframes"
              ]
        },
        "clashdomain": {
          "animations": [
            "rumiaex.skill_attack.clash"
            ],
          "transitions": [
            {
              "armed": "q.scoreboard('domainclash') == -1"
            },
            {
              "releasedomain": "q.scoreboard('domainclash') == 2"
            }
            ],
            "on_entry": [
              "/inputpermission set @s lateral_movement disabled",
              "/scoreboard players set @s domainclash 1",
              "/tag @s remove domain:open",
              "/scoreboard players set @e[r=15,tag=domain:open] domainclash 1",
              "/tag @s add domain:clashing"
              ],
            "on_exit":[
              "/tag @s remove domain:clashing",
              "/scoreboard players set @s[tag=trait:shortcd] domainex_cd 140",
              "/scoreboard players set @s[tag=!trait:shortcd,tag=!trait:longcd] domainex_cd 200",
              "/scoreboard players set @s[tag=trait:longcd] domainex_cd 240"
              ]
        },
        "releasedomain": {
          "animations": [
            "rumiaex.skill_attack.release"
            ],
          "transitions": [
            {
              "armed": "q.any_animation_finished || q.scoreboard('stun') > 0"
            }
            ],
          "on_entry": [
              "/inputpermission set @s lateral_movement disabled",
            "/tag @s remove rumiaAdd",
            "/tag @s add domain:active",
            "/tag @s remove domain:open",
            "/function domain/rumiaOpen"
            ],
          "on_exit": [
            "/time set night",
            "/particle rumia:vfx7",
            "/tag @s remove rumiaPull",
	          "/inputpermission set @s camera enabled",
	          "/camera @s clear",
            "/function domain/rumiaClose",
            "/tag @s remove domain:active",
            "/tag @s add domainActive",
              "/tag @s remove hasSkill",
              "@s movement:walk",
              "/scoreboard players set @s has_skill 0",
              "/scoreboard players set @s[tag=trait:shortcd] domainex_cd 5800",
              "/scoreboard players set @s[tag=!trait:shortcd,tag=!trait:longcd] domainex_cd 5900",
              "/scoreboard players set @s[tag=trait:longcd] domainex_cd 6000"
              ]
        }
      }
    }
  }
}