[gd_scene load_steps=10 format=3 uid="uid://c0cf6jkxasplk"]

[ext_resource type="PackedScene" uid="uid://cyrwuqefk3efr" path="res://assets/mann.glb" id="2_4ra3w"]
[ext_resource type="Script" uid="uid://d4anpy5efe22d" path="res://src/health.gd" id="2_md0e3"]

[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_md0e3"]

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_md0e3"]
animation = &"HeadHit"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_4ra3w"]
animation = &"DyingBackwards"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_5uy6h"]
animation = &"T-Pose (No Animation)"

[sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_c4w8v"]

[sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_xwavj"]
input_0/name = "idle"
input_0/auto_advance = false
input_0/break_loop_at_end = false
input_0/reset = true
input_1/name = "dead"
input_1/auto_advance = false
input_1/break_loop_at_end = false
input_1/reset = true

[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_nenq2"]
graph_offset = Vector2(-685.25, 50.2044)
nodes/Animation/node = SubResource("AnimationNodeAnimation_5uy6h")
nodes/Animation/position = Vector2(-220, 120)
"nodes/Animation 2/node" = SubResource("AnimationNodeAnimation_md0e3")
"nodes/Animation 2/position" = Vector2(-140, 320)
"nodes/Animation 3/node" = SubResource("AnimationNodeAnimation_4ra3w")
"nodes/Animation 3/position" = Vector2(60, 420)
nodes/Hit/node = SubResource("AnimationNodeOneShot_c4w8v")
nodes/Hit/position = Vector2(60, 120)
nodes/Transition/node = SubResource("AnimationNodeTransition_xwavj")
nodes/Transition/position = Vector2(260, 120)
nodes/output/position = Vector2(440, 120)
node_connections = [&"Hit", 0, &"Animation", &"Hit", 1, &"Animation 2", &"Transition", 0, &"Hit", &"Transition", 1, &"Animation 3", &"output", 0, &"Transition"]

[node name="Enemy" type="CharacterBody3D"]
transform = Transform3D(1.75, 0, 0, 0, 1.75, 0, 0, 0, 1.75, 0, 0, 0)

[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
shape = SubResource("CapsuleShape3D_md0e3")

[node name="Health" type="Node" parent="."]
script = ExtResource("2_md0e3")
max_health = 5
metadata/_custom_type_script = "uid://d4anpy5efe22d"

[node name="AnimationTree" type="AnimationTree" parent="."]
root_node = NodePath("../AuxScene")
tree_root = SubResource("AnimationNodeBlendTree_nenq2")
anim_player = NodePath("../AuxScene/AnimationPlayer")
parameters/Hit/active = false
parameters/Hit/internal_active = false
parameters/Hit/request = 0
parameters/Transition/current_state = "idle"
parameters/Transition/transition_request = ""
parameters/Transition/current_index = 0

[node name="AuxScene" parent="." instance=ExtResource("2_4ra3w")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.708055, 0)

[node name="Skeleton3D" parent="AuxScene/Node" index="0"]
bones/14/rotation = Quaternion(-0.049153, -0.00278018, 0.056403, 0.997194)
bones/30/rotation = Quaternion(-0.00214526, -6.9426e-18, 1.71983e-18, 0.999998)
bones/33/rotation = Quaternion(0.0397321, 6.93342e-18, -2.75697e-19, 0.99921)
bones/39/rotation = Quaternion(0.0548733, -0.109425, -0.0279963, 0.992084)
bones/45/rotation = Quaternion(0.0420007, -5.82877e-19, -1.38655e-17, 0.999118)
bones/46/rotation = Quaternion(-0.00160061, -2.22129e-20, 1.38778e-17, 0.999999)
bones/50/rotation = Quaternion(-0.027251, 0, 0, 0.999629)
bones/52/rotation = Quaternion(0.0706924, 0.00317808, 0.0447985, 0.996487)
bones/56/rotation = Quaternion(0.0852392, 0.00496034, 0.0578828, 0.994665)
bones/61/rotation = Quaternion(-0.00265969, 1.04465e-05, -0.0039276, 0.999989)

[connection signal="damaged" from="Health" to="AnimationTree" method="set" binds= ["parameters/Hit/request", 1]]
[connection signal="died" from="Health" to="AnimationTree" method="set" binds= ["parameters/Transition/transition_request", "dead"]]

[editable path="AuxScene"]
