[gd_scene load_steps=9 format=3 uid="uid://cwvrti8hmxj0k"]

[ext_resource type="Script" uid="uid://p38hhb8jwgor" path="res://src/scripts/characters/enemy.gd" id="1_jr6vw"]
[ext_resource type="PackedScene" uid="uid://c7ahf78h5s3kx" path="res://assets/models/character/gear/tall_shield.glb" id="2_fwei0"]
[ext_resource type="PackedScene" uid="uid://ckwydalda0teo" path="res://src/scenes/characters/rig.tscn" id="2_saeby"]
[ext_resource type="PackedScene" uid="uid://csdumqcs3kutf" path="res://assets/models/character/gear/short_shield.glb" id="3_aygwl"]
[ext_resource type="PackedScene" uid="uid://bo62qyfwylypa" path="res://src/scenes/characters/area_attack.tscn" id="3_ljmr7"]
[ext_resource type="PackedScene" uid="uid://dw8f5oy13cdtx" path="res://src/scenes/characters/health_component.tscn" id="3_r8u7w"]

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

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

[node name="Enemy" type="CharacterBody3D"]
collision_layer = 9
script = ExtResource("1_jr6vw")
off_hand_items = Array[PackedScene]([ExtResource("2_fwei0"), ExtResource("3_aygwl")])

[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
avoidance_enabled = true

[node name="HealthComponent" parent="." node_paths=PackedStringArray("body") instance=ExtResource("3_r8u7w")]
body = NodePath("..")

[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("CapsuleShape3D_r8u7w")

[node name="Rig" parent="." instance=ExtResource("2_saeby")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)

[node name="Skeleton3D" parent="Rig/CharacterRig/GameRig" index="0"]
bones/0/position = Vector3(1.41799e-14, 0.903864, -0.0481735)
bones/2/rotation = Quaternion(0.00254114, -0.000345045, 0.00321307, 0.999992)
bones/3/rotation = Quaternion(-0.0925045, -0.000328237, 0.00852257, 0.995676)
bones/4/rotation = Quaternion(0.273484, 1.50227e-08, 9.09987e-08, 0.961876)
bones/6/rotation = Quaternion(-0.16068, -1.17104e-07, -2.25642e-08, 0.987007)
bones/7/position = Vector3(-5.39946e-08, 0.903864, -0.0481735)
bones/8/position = Vector3(-5.91031e-08, 0.903864, -0.0481735)
bones/9/position = Vector3(0.131144, 0.970068, -0.0351291)
bones/9/rotation = Quaternion(0.993638, 0.0205636, -0.0310958, 0.106269)
bones/11/rotation = Quaternion(0.408196, -0.000698645, 0.000312532, 0.912894)
bones/13/rotation = Quaternion(-0.746414, 0.0118664, 0.0243817, 0.664929)
bones/15/position = Vector3(-0.131144, 0.970068, -0.0351291)
bones/15/rotation = Quaternion(0.974478, -0.00553855, 0.0274913, 0.222725)
bones/17/rotation = Quaternion(0.433159, 0.003226, -0.00155051, 0.901311)
bones/19/rotation = Quaternion(-0.683342, -0.0281668, -0.00108009, 0.729554)
bones/21/position = Vector3(0.0251286, 1.43374, 0.0448904)
bones/21/rotation = Quaternion(-0.481322, -0.262926, -0.408801, 0.729439)
bones/22/position = Vector3(0.19009, 1.47171, -0.0166302)
bones/22/rotation = Quaternion(0.035007, -0.161958, 0.975088, -0.14747)
bones/23/rotation = Quaternion(1.24303e-07, -0.0280484, 3.1793e-08, 0.999607)
bones/24/rotation = Quaternion(0.326585, -0.0280544, -0.0203048, 0.944533)
bones/46/position = Vector3(-0.0113635, 1.43374, 0.0448904)
bones/46/rotation = Quaternion(-0.490609, 0.243241, 0.395651, 0.73729)
bones/47/position = Vector3(-0.172762, 1.47222, -0.0251737)
bones/47/rotation = Quaternion(-0.0422729, -0.142474, 0.975197, 0.164026)
bones/48/rotation = Quaternion(-7.05598e-09, 0.0359437, -8.97213e-08, 0.999354)
bones/49/rotation = Quaternion(0.363577, 0.0359443, 0.0288099, 0.930425)
bones/71/position = Vector3(0.127191, 1.35349, -0.0253768)
bones/71/rotation = Quaternion(1.98289e-08, 0.605451, 0.795883, -4.61308e-08)
bones/72/position = Vector3(-0.113426, 1.35349, -0.0253769)
bones/72/rotation = Quaternion(1.98278e-08, 0.605468, 0.79587, -4.61313e-08)

[node name="Knight_02" parent="Rig/CharacterRig/GameRig/Skeleton3D" index="1"]
visible = false

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

[node name="RightHandBone" parent="Rig" index="2"]
transform = Transform3D(-0.962343, -0.270803, -0.0237131, 0.231269, -0.861444, 0.452138, -0.142868, 0.429628, 0.891632, -0.346578, 0.997949, 0.00158512)

[node name="LeftHandBone" parent="Rig" index="3"]
transform = Transform3D(-0.970513, 0.239109, 0.0305225, -0.215283, -0.916755, 0.336472, 0.108435, 0.31998, 0.941198, 0.346901, 0.98305, -0.026914)

[node name="PlayerDetector" type="ShapeCast3D" parent="Rig"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1)
shape = SubResource("CapsuleShape3D_ljmr7")
target_position = Vector3(0, 0, 0)
collision_mask = 4

[node name="AreaAttack" parent="Rig" instance=ExtResource("3_ljmr7")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1)
collision_mask = 4

[connection signal="velocity_computed" from="NavigationAgent3D" to="." method="_on_navigation_agent_3d_velocity_computed"]
[connection signal="defeat" from="HealthComponent" to="." method="_on_health_component_defeat"]
[connection signal="heavy_attack" from="Rig" to="." method="_on_rig_heavy_attack"]

[editable path="Rig"]
[editable path="Rig/CharacterRig"]
