[gd_scene load_steps=22 format=3 uid="uid://ckwydalda0teo"]

[ext_resource type="Script" uid="uid://ckjbqjere1jpf" path="res://src/scripts/characters/rig.gd" id="1_n80wy"]
[ext_resource type="PackedScene" uid="uid://xivf38sp0l78" path="res://assets/models/character/character_rig.glb" id="2_ow4sk"]
[ext_resource type="PackedScene" uid="uid://bnkhiay2id2kl" path="res://assets/models/character/gear/longsword.glb" id="3_dka8l"]
[ext_resource type="PackedScene" uid="uid://c7ahf78h5s3kx" path="res://assets/models/character/gear/tall_shield.glb" id="4_i4vhj"]

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_isuva"]
animation = &"Dash"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_6b80y"]
animation = &"Defeat"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_eek7r"]
animation = &"Run"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_gxy77"]
animation = &"Idle"

[sub_resource type="AnimationNodeBlendSpace1D" id="AnimationNodeBlendSpace1D_djdpq"]
blend_point_0/node = SubResource("AnimationNodeAnimation_eek7r")
blend_point_0/pos = 1.0
blend_point_1/node = SubResource("AnimationNodeAnimation_gxy77")
blend_point_1/pos = -1.0

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_q073i"]
animation = &"Overhead"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_bd73k"]
animation = &"OverheadRecover"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_1br2m"]
animation = &"Slash"

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_gkl4x"]
advance_mode = 2

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_eek7r"]

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_gxy77"]
xfade_time = 0.1
switch_mode = 2
advance_mode = 2

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_isuva"]

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_8x2vi"]
switch_mode = 2
advance_mode = 2

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_eqygr"]
xfade_time = 0.1
switch_mode = 2
advance_mode = 2

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_yvrik"]

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_dnffl"]
xfade_time = 0.2
switch_mode = 2
advance_mode = 2

[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_mq48a"]
states/Dash/node = SubResource("AnimationNodeAnimation_isuva")
states/Dash/position = Vector2(434, -58)
states/Defeat/node = SubResource("AnimationNodeAnimation_6b80y")
states/Defeat/position = Vector2(584, -69)
states/MoveSpace/node = SubResource("AnimationNodeBlendSpace1D_djdpq")
states/MoveSpace/position = Vector2(434, 28)
states/Overhead/node = SubResource("AnimationNodeAnimation_q073i")
states/Overhead/position = Vector2(652, 28)
states/OverheadRecover/node = SubResource("AnimationNodeAnimation_bd73k")
states/OverheadRecover/position = Vector2(652, 123)
states/Slash/node = SubResource("AnimationNodeAnimation_1br2m")
states/Slash/position = Vector2(434, 243)
states/Start/position = Vector2(239, 28)
transitions = ["Start", "MoveSpace", SubResource("AnimationNodeStateMachineTransition_gkl4x"), "MoveSpace", "Slash", SubResource("AnimationNodeStateMachineTransition_eek7r"), "Slash", "MoveSpace", SubResource("AnimationNodeStateMachineTransition_gxy77"), "MoveSpace", "Overhead", SubResource("AnimationNodeStateMachineTransition_isuva"), "Overhead", "OverheadRecover", SubResource("AnimationNodeStateMachineTransition_8x2vi"), "OverheadRecover", "MoveSpace", SubResource("AnimationNodeStateMachineTransition_eqygr"), "MoveSpace", "Dash", SubResource("AnimationNodeStateMachineTransition_yvrik"), "Dash", "MoveSpace", SubResource("AnimationNodeStateMachineTransition_dnffl")]
graph_offset = Vector2(-166, -157)

[node name="Rig" type="Node3D"]
script = ExtResource("1_n80wy")

[node name="CharacterRig" parent="." instance=ExtResource("2_ow4sk")]

[node name="Skeleton3D" parent="CharacterRig/GameRig" index="0"]
bones/0/position = Vector3(4.44089e-15, 0.911233, -0.0481736)
bones/0/rotation = Quaternion(0.12582, 1.18262e-07, 1.49989e-08, 0.992053)
bones/1/rotation = Quaternion(-0.0566577, -0.00072973, -0.0117082, 0.998325)
bones/2/position = Vector3(3.20474e-09, 0.146689, -1.95578e-08)
bones/2/rotation = Quaternion(0.00731323, -0.000267702, 0.00321092, 0.999968)
bones/3/position = Vector3(-2.01263e-09, 0.202058, -2.51457e-08)
bones/3/rotation = Quaternion(-0.0881702, -0.000271837, 0.00852504, 0.996069)
bones/4/position = Vector3(3.02934e-10, 0.0925562, 3.91155e-08)
bones/4/rotation = Quaternion(0.269551, 1.43871e-08, 9.15867e-08, 0.962986)
bones/5/rotation = Quaternion(-0.0948564, -2.80691e-14, -2.26155e-08, 0.995491)
bones/6/rotation = Quaternion(-0.165611, -1.17563e-07, -1.97424e-08, 0.986191)
bones/7/position = Vector3(-4.38519e-08, 0.911233, -0.0481734)
bones/7/rotation = Quaternion(-0.0863677, -0.751104, -0.383052, 0.530711)
bones/8/position = Vector3(-3.68681e-08, 0.911233, -0.0481735)
bones/8/rotation = Quaternion(-0.0863677, 0.751104, 0.383052, 0.530711)
bones/9/position = Vector3(0.131144, 0.977437, -0.0351291)
bones/9/rotation = Quaternion(0.994353, 0.0201915, -0.0312755, 0.0993843)
bones/10/position = Vector3(-2.36129e-08, 0.26601, -2.14789e-08)
bones/10/rotation = Quaternion(-3.13921e-08, -0.000695086, 1.20449e-08, 1)
bones/11/position = Vector3(-4.6306e-08, 0.26601, 2.42145e-08)
bones/11/rotation = Quaternion(0.392666, -0.000694321, 0.000296553, 0.919681)
bones/12/position = Vector3(3.05151e-08, 0.22603, 5.03768e-08)
bones/12/rotation = Quaternion(-8.19226e-09, -0.00710644, 4.16102e-08, 0.999975)
bones/13/position = Vector3(-2.95495e-08, 0.22603, 2.68392e-09)
bones/13/rotation = Quaternion(-0.739767, 0.0118418, 0.0243569, 0.672317)
bones/14/position = Vector3(-3.05481e-08, 0.139877, 1.64787e-08)
bones/14/rotation = Quaternion(-9.66743e-05, 0.967474, -0.252972, -0.000383447)
bones/15/position = Vector3(-0.131144, 0.977437, -0.0351291)
bones/15/rotation = Quaternion(0.976047, -0.00523272, 0.0277032, 0.215728)
bones/16/position = Vector3(-1.10042e-08, 0.265705, -3.31989e-08)
bones/16/rotation = Quaternion(-3.43227e-08, 0.00314323, 8.33075e-10, 0.999995)
bones/17/position = Vector3(1.83545e-08, 0.265705, 6.98543e-10)
bones/17/rotation = Quaternion(0.419096, 0.00314277, -0.00145078, 0.907936)
bones/18/position = Vector3(1.2807e-08, 0.225719, -8.28774e-09)
bones/18/rotation = Quaternion(-2.29017e-08, -0.00785732, 3.30149e-08, 0.999969)
bones/19/position = Vector3(-1.27748e-08, 0.225719, 1.12004e-08)
bones/19/rotation = Quaternion(-0.677213, -0.0281333, -0.00151136, 0.735248)
bones/20/position = Vector3(-1.30142e-08, 0.139877, -2.77457e-09)
bones/20/rotation = Quaternion(-9.96472e-05, 0.967461, -0.253021, -0.000383039)
bones/21/position = Vector3(0.0251286, 1.44069, 0.0475399)
bones/21/rotation = Quaternion(-0.468898, -0.267874, -0.417939, 0.730551)
bones/22/position = Vector3(0.191644, 1.47967, -0.00897597)
bones/22/rotation = Quaternion(0.0192294, -0.164322, 0.975527, -0.144831)
bones/23/position = Vector3(-5.41331e-09, 0.143946, -2.98023e-08)
bones/23/rotation = Quaternion(6.45653e-08, -0.0407757, -6.74542e-08, 0.999168)
bones/24/position = Vector3(-6.33301e-08, 0.143946, 4.3873e-08)
bones/24/rotation = Quaternion(0.355288, -0.0407963, -0.0221793, 0.933603)
bones/25/position = Vector3(1.30385e-08, 0.127601, 6.51926e-09)
bones/25/rotation = Quaternion(1.49943e-07, -1.20606e-07, 9.91859e-08, 1)
bones/26/position = Vector3(2.06034e-08, 0.127601, 2.42761e-08)
bones/26/rotation = Quaternion(-0.00824883, -0.00027077, -0.0328667, 0.999426)
bones/28/rotation = Quaternion(0.702583, -0.000939743, -0.00133552, 0.7116)
bones/29/rotation = Quaternion(0.741121, 0.00218291, 0.00265381, 0.671363)
bones/30/rotation = Quaternion(0.32527, 0.890055, 0.295977, -0.119997)
bones/31/rotation = Quaternion(0.514882, -0.114149, 0.114482, 0.841879)
bones/32/rotation = Quaternion(0.592003, -0.0381348, -0.090699, 0.799907)
bones/34/position = Vector3(-0.00316938, 0.0987206, 0.0147918)
bones/34/rotation = Quaternion(-0.0674699, 0.718446, 0.0663966, 0.689112)
bones/35/rotation = Quaternion(0.580803, -0.000892135, -0.0014975, 0.814042)
bones/36/rotation = Quaternion(0.682777, 0.00174509, 0.00256596, 0.73062)
bones/37/rotation = Quaternion(-0.00426514, 0.736714, 0.0394785, 0.675038)
bones/38/position = Vector3(-0.00622951, 0.0926415, -0.0236344)
bones/38/rotation = Quaternion(-0.109873, 0.743351, 0.0333507, 0.658973)
bones/39/rotation = Quaternion(0.630039, 0.00151959, 0.00237944, 0.776559)
bones/40/rotation = Quaternion(0.652643, -0.00308142, -0.00421108, 0.757648)
bones/41/rotation = Quaternion(-0.0684174, 0.72411, 0.0332337, 0.685478)
bones/42/position = Vector3(-0.00715362, 0.0679857, -0.0481983)
bones/42/rotation = Quaternion(-0.120913, 0.799109, 0.0358921, 0.587807)
bones/43/rotation = Quaternion(0.498693, -0.0202705, -0.0256953, 0.866161)
bones/44/rotation = Quaternion(0.715385, 0.035306, 0.0573145, 0.695481)
bones/45/rotation = Quaternion(-0.129059, 0.728936, -0.0250259, 0.67184)
bones/46/position = Vector3(-0.0113635, 1.44069, 0.0475399)
bones/46/rotation = Quaternion(-0.468138, 0.267383, 0.418196, 0.731071)
bones/47/position = Vector3(-0.177868, 1.47979, -0.00892575)
bones/47/rotation = Quaternion(-0.00637871, -0.14841, 0.976092, 0.158675)
bones/48/position = Vector3(1.88476e-07, 0.143946, 1.02445e-08)
bones/48/rotation = Quaternion(-1.95822e-07, 0.059992, -1.87386e-07, 0.998199)
bones/49/position = Vector3(6.5191e-09, 0.143946, -1.95094e-08)
bones/49/rotation = Quaternion(0.396474, 0.06003, 0.0277139, 0.915662)
bones/50/position = Vector3(-1.48779e-07, 0.1276, 5.9139e-08)
bones/50/rotation = Quaternion(-8.73115e-08, 2.7474e-08, -1.28057e-07, 1)
bones/51/position = Vector3(1.9461e-07, 0.127601, 6.06248e-08)
bones/51/rotation = Quaternion(-0.00824876, 0.000270832, 0.032867, 0.999426)
bones/52/rotation = Quaternion(-0.2563, 0.855859, 0.0299184, -0.448241)
bones/53/rotation = Quaternion(0.694912, 0.107145, -0.103549, 0.703488)
bones/54/rotation = Quaternion(0.74112, -0.00218237, -0.00265409, 0.671363)
bones/55/rotation = Quaternion(-0.325269, 0.890055, 0.295977, 0.119998)
bones/56/rotation = Quaternion(0.514882, 0.11415, -0.114483, 0.841879)
bones/57/rotation = Quaternion(0.592004, 0.0381346, 0.0906992, 0.799907)
bones/59/position = Vector3(0.00316943, 0.0987207, 0.0147917)
bones/59/rotation = Quaternion(0.138771, -0.704916, 0.15571, 0.677932)
bones/60/rotation = Quaternion(0.579984, 0.0462615, -0.0308755, 0.812727)
bones/61/rotation = Quaternion(0.682777, -0.00174718, -0.00256448, 0.73062)
bones/62/rotation = Quaternion(-0.00426532, -0.736714, -0.0394788, 0.675038)
bones/63/position = Vector3(0.00622955, 0.0926417, -0.0236344)
bones/63/rotation = Quaternion(0.104095, -0.719607, 0.186262, 0.660784)
bones/64/rotation = Quaternion(0.670693, 0.0163391, -0.0185663, 0.741323)
bones/65/rotation = Quaternion(0.692499, 0.00330364, 0.00403917, 0.7214)
bones/66/rotation = Quaternion(-0.0684178, -0.72411, -0.0332339, 0.685477)
bones/67/position = Vector3(0.00715371, 0.0679859, -0.0481984)
bones/67/rotation = Quaternion(0.108364, -0.768224, 0.166291, 0.608635)
bones/68/rotation = Quaternion(0.629954, 0.0295149, 0.0177509, 0.775869)
bones/69/rotation = Quaternion(0.816678, -0.0439534, -0.0509861, 0.573155)
bones/70/rotation = Quaternion(-0.12906, -0.728937, 0.0250258, 0.67184)
bones/71/position = Vector3(0.127191, 1.36188, -0.0243187)
bones/71/rotation = Quaternion(2.03741e-08, 0.597458, 0.8019, -4.58164e-08)
bones/72/position = Vector3(-0.113426, 1.36188, -0.0243187)
bones/72/rotation = Quaternion(2.03742e-08, 0.597458, 0.8019, -4.58163e-08)

[node name="Knight_01" parent="CharacterRig/GameRig/Skeleton3D" index="0"]
visible = false

[node name="Villager_01" parent="CharacterRig/GameRig/Skeleton3D" index="2"]
visible = false

[node name="Villager_02" parent="CharacterRig/GameRig/Skeleton3D" index="3"]
visible = false

[node name="AnimationTree" type="AnimationTree" parent="."]
root_node = NodePath("../CharacterRig")
tree_root = SubResource("AnimationNodeStateMachine_mq48a")
anim_player = NodePath("../CharacterRig/AnimationPlayer")
parameters/MoveSpace/blend_position = -1.0

[node name="RightHandBone" type="BoneAttachment3D" parent="."]
transform = Transform3D(-0.96236, -0.270746, -0.0236708, 0.219803, -0.826584, 0.518118, -0.159844, 0.493413, 0.854981, -0.35167, 1.01449, 0.0336347)
bone_name = "DEF-hand.R"
bone_idx = 51
use_external_skeleton = true
external_skeleton = NodePath("../CharacterRig/GameRig/Skeleton3D")

[node name="WeaponSlot" type="Node3D" parent="RightHandBone"]
transform = Transform3D(0.16656, 0.0770401, -0.983017, -0.982939, 0.0918653, -0.159347, 0.078029, 0.992787, 0.0910268, -0.0211409, 0.0798348, 0.00721136)

[node name="longsword" parent="RightHandBone/WeaponSlot" instance=ExtResource("3_dka8l")]

[node name="LeftHandBone" type="BoneAttachment3D" parent="."]
transform = Transform3D(-0.970521, 0.239082, 0.0304942, -0.207845, -0.894272, 0.396332, 0.122026, 0.37831, 0.917601, 0.348448, 0.99686, -0.00473515)
bone_name = "DEF-hand.L"
bone_idx = 26
use_external_skeleton = true
external_skeleton = NodePath("../CharacterRig/GameRig/Skeleton3D")

[node name="OffHandSlot" type="Node3D" parent="LeftHandBone"]
unique_name_in_owner = true
transform = Transform3D(0.10564, 0.417333, -0.902592, -0.99124, 0.116542, -0.0621291, 0.0792616, 0.90125, 0.425989, -0.084208, -0.04557, -0.025934)

[node name="tall_shield" parent="LeftHandBone/OffHandSlot" instance=ExtResource("4_i4vhj")]

[connection signal="animation_finished" from="AnimationTree" to="." method="_on_animation_tree_animation_finished"]

[editable path="CharacterRig"]
