[gd_scene load_steps=18 format=3 uid="uid://dfat0erkvb513"]

[ext_resource type="Script" uid="uid://c2mo5hc1qb6kf" path="res://Scripts/Components/Actors/Actor.cs" id="1_p2pib"]
[ext_resource type="Resource" uid="uid://cocl3qontm3be" path="res://Resources/Enemies/Base_Fairy.tres" id="2_oync8"]
[ext_resource type="SpriteFrames" uid="uid://bcc5mlwwnkvri" path="res://Resources/Sprites/Fairy.tres" id="2_ycldt"]
[ext_resource type="Script" uid="uid://pfxrvd1fofnj" path="res://Scripts/Components/Actors/FourWayAnimationHandler.cs" id="5_6u5xg"]
[ext_resource type="Script" uid="uid://ghq0lmohdvqf" path="res://Scripts/Components/Actors/ActorAi.cs" id="6_3slbl"]
[ext_resource type="Script" uid="uid://dsu7k7ds0cnba" path="res://Scripts/Components/Actors/EnemyNavigationMovement.cs" id="7_vtg4i"]
[ext_resource type="Script" uid="uid://c4qmuxjhheahr" path="res://Scripts/Components/ProximityPlayerDetection.cs" id="8_j0gdf"]
[ext_resource type="Script" uid="uid://cqwvssstkrdmw" path="res://Scripts/Components/Actors/ActorResourceProvider.cs" id="9_4h871"]
[ext_resource type="PackedScene" uid="uid://cj63k0dmk7tl1" path="res://Scenes/Weapons/enemy_weapon_base.tscn" id="10_nc74c"]
[ext_resource type="Resource" uid="uid://csdlihliv4cr8" path="res://Resources/Weapons/EnemyWeapon_simple.tres" id="11_y6dmo"]
[ext_resource type="Script" uid="uid://2cijskgyt2xb" path="res://Scripts/Components/Actors/DamageReceiverActorModule.cs" id="12_ubjf1"]
[ext_resource type="Script" uid="uid://m0ag88kn0c40" path="res://Scripts/Components/Actors/DeathAnimationHandler.cs" id="13_pc4bh"]
[ext_resource type="Resource" uid="uid://dk2rbf88a5irh" path="res://Resources/Bullets/Explosion_Harmless.tres" id="14_bjjn4"]
[ext_resource type="Script" uid="uid://7g3luecewcp5" path="res://Scripts/Components/Actors/ActorDefeatScriptHandler.cs" id="15_t4y0s"]

[sub_resource type="CircleShape2D" id="CircleShape2D_2b36v"]
radius = 5.0

[sub_resource type="CircleShape2D" id="CircleShape2D_sthwe"]
radius = 85.0529

[sub_resource type="CircleShape2D" id="CircleShape2D_0tkae"]
radius = 5.09902

[node name="Fairy" type="CharacterBody2D"]
collision_layer = 16
collision_mask = 113
script = ExtResource("1_p2pib")
EnemyData = ExtResource("2_oync8")

[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = ExtResource("2_ycldt")
animation = &"down"

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_2b36v")

[node name="AnimationHandler" type="Node2D" parent="." node_paths=PackedStringArray("_animatedSprite")]
script = ExtResource("5_6u5xg")
_animatedSprite = NodePath("../AnimatedSprite2D")

[node name="ActorAi" type="Node2D" parent="."]
script = ExtResource("6_3slbl")
Ai = 0

[node name="NavigationMovementProvider" type="Node2D" parent="." node_paths=PackedStringArray("EquippedWeapon", "_playerDetection")]
script = ExtResource("7_vtg4i")
_navigationEnabled = true
CollisionMask = 81
EquippedWeapon = NodePath("../EnemyWeapon")
_playerDetection = NodePath("../PlayerDetection")

[node name="PlayerDetection" type="Area2D" parent="."]
visible = false
collision_layer = 0
collision_mask = 2
script = ExtResource("8_j0gdf")

[node name="PlayerDetectionArea" type="CollisionShape2D" parent="PlayerDetection"]
shape = SubResource("CircleShape2D_sthwe")

[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."]
target_desired_distance = 64.0
path_max_distance = 800.0
path_postprocessing = 1
avoidance_enabled = true
debug_path_custom_color = Color(1, 0, 0, 1)

[node name="HealthProvider" type="Node2D" parent="."]
script = ExtResource("9_4h871")
ResourceName = "Health"
_maxResource = 2.0

[node name="EnemyWeapon" parent="." instance=ExtResource("10_nc74c")]
WeaponData = ExtResource("11_y6dmo")

[node name="DamageReceiver" type="Node2D" parent="." node_paths=PackedStringArray("HealthProvider")]
script = ExtResource("12_ubjf1")
HealthProvider = NodePath("../HealthProvider")
BulletGroup = 2

[node name="Area2D" type="Area2D" parent="DamageReceiver"]
collision_layer = 16
collision_mask = 8

[node name="CollisionShape2D" type="CollisionShape2D" parent="DamageReceiver/Area2D"]
shape = SubResource("CircleShape2D_0tkae")

[node name="DeathAnimation" type="Node2D" parent="."]
script = ExtResource("13_pc4bh")
ExplosionData = ExtResource("14_bjjn4")

[node name="DefeatScriptHandler" type="Node2D" parent="."]
script = ExtResource("15_t4y0s")

[connection signal="area_entered" from="PlayerDetection" to="PlayerDetection" method="_on_area_entered"]
[connection signal="area_exited" from="PlayerDetection" to="PlayerDetection" method="_on_area_exited"]
[connection signal="velocity_computed" from="NavigationAgent2D" to="NavigationMovementProvider" method="_on_navigation_agent_2d_velocity_computed"]
[connection signal="area_entered" from="DamageReceiver/Area2D" to="DamageReceiver" method="_on_damage_hitbox_area_entered"]
