[gd_scene load_steps=11 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"]
[ext_resource type="PackedScene" uid="uid://dh2cs460xvwjp" path="res://assets/models/character/gear/broken_sword.glb" id="6_aygwl"]

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

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

[sub_resource type="CylinderShape3D" id="CylinderShape3D_fwei0"]
radius = 10.0

[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="Timer" type="Timer" parent="."]
one_shot = 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(4.02237e-15, 0.906557, -0.0481736)
bones/2/rotation = Quaternion(0.00427687, -0.000316915, 0.00321231, 0.999986)
bones/3/rotation = Quaternion(-0.0909296, -0.000307747, 0.00852351, 0.995821)
bones/4/rotation = Quaternion(0.27205, 1.50414e-08, 9.03284e-08, 0.962283)
bones/6/rotation = Quaternion(-0.16249, -1.17426e-07, -2.0583e-08, 0.98671)
bones/7/position = Vector3(-2.62133e-08, 0.906557, -0.0481735)
bones/8/position = Vector3(-2.28571e-08, 0.906557, -0.0481735)
bones/9/position = Vector3(0.131144, 0.972761, -0.0351291)
bones/9/rotation = Quaternion(0.9939, 0.0204295, -0.0311604, 0.103801)
bones/11/rotation = Quaternion(0.402591, -0.000697316, 0.000306836, 0.91538)
bones/13/rotation = Quaternion(-0.744008, 0.0118574, 0.0243724, 0.667621)
bones/15/position = Vector3(-0.131144, 0.972761, -0.0351291)
bones/15/rotation = Quaternion(0.975057, -0.00542666, 0.0275689, 0.220171)
bones/17/rotation = Quaternion(0.428066, 0.00319591, -0.00151385, 0.903741)
bones/19/rotation = Quaternion(-0.681122, -0.0281548, -0.00123699, 0.731628)
bones/21/position = Vector3(0.0251286, 1.43629, 0.045864)
bones/21/rotation = Quaternion(-0.476775, -0.264756, -0.412138, 0.729885)
bones/22/position = Vector3(0.190673, 1.47466, -0.0138298)
bones/22/rotation = Quaternion(0.0292472, -0.162826, 0.975278, -0.146511)
bones/23/rotation = Quaternion(1.76026e-08, -0.0327145, 3.89572e-08, 0.999465)
bones/24/rotation = Quaternion(0.337126, -0.0327154, -0.0210206, 0.940656)
bones/46/position = Vector3(-0.0113635, 1.43629, 0.045864)
bones/46/rotation = Quaternion(-0.482401, 0.25213, 0.40392, 0.735233)
bones/47/position = Vector3(-0.174745, 1.47507, -0.0192641)
bones/47/rotation = Quaternion(-0.0291667, -0.144664, 0.975677, 0.162097)
bones/48/rotation = Quaternion(-9.65957e-08, 0.0447727, -1.43539e-07, 0.998997)
bones/49/rotation = Quaternion(0.375675, 0.0447733, 0.0285221, 0.92523)
bones/71/position = Vector3(0.127191, 1.35657, -0.0249918)
bones/71/rotation = Quaternion(2.00287e-08, 0.602526, 0.798099, -4.60171e-08)
bones/72/position = Vector3(-0.113426, 1.35657, -0.0249918)
bones/72/rotation = Quaternion(2.00287e-08, 0.602526, 0.798099, -4.6017e-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.0237119, 0.227232, -0.849239, 0.476611, -0.149205, 0.453275, 0.878794, -0.348562, 1.00394, 0.0133554)

[node name="broken_sword" parent="Rig/RightHandBone/WeaponSlot" index="0" instance=ExtResource("6_aygwl")]

[node name="LeftHandBone" parent="Rig" index="3"]
transform = Transform3D(-0.970513, 0.239108, 0.0305209, -0.212668, -0.908962, 0.358553, 0.113475, 0.34149, 0.93301, 0.347484, 0.98803, -0.0187558)

[node name="PlayerDetectorAttack" 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="PlayerDetectorPursue" type="ShapeCast3D" parent="Rig"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1)
shape = SubResource("CylinderShape3D_fwei0")
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"]
