[gd_scene load_steps=29 format=3 uid="uid://bjskkeb3ppcs8"]

[ext_resource type="Script" uid="uid://c2mo5hc1qb6kf" path="res://Scripts/Components/Actors/Actor.cs" id="1_g7c56"]
[ext_resource type="Texture2D" uid="uid://c2seclmhd5yt3" path="res://Sprites/Actors/Cannon3D.png" id="2_m663r"]
[ext_resource type="Resource" uid="uid://ysd6wl2gmdhn" path="res://Resources/Enemies/Turret360.tres" id="2_x4kwn"]
[ext_resource type="Script" uid="uid://tk6ytw246ubg" path="res://Scripts/Components/Actors/EnemyPossessionMovement.cs" id="3_kuwnw"]
[ext_resource type="Script" uid="uid://dq338w2lw5phl" path="res://Scripts/Components/Actors/KeyboardInputProvider.cs" id="4_m663r"]
[ext_resource type="Script" uid="uid://daoxbq4sxy0br" path="res://Scripts/Components/Actors/TurretAnimationModule.cs" id="5_g7c56"]
[ext_resource type="Script" uid="uid://ghq0lmohdvqf" path="res://Scripts/Components/Actors/ActorAi.cs" id="6_5eesc"]
[ext_resource type="Script" uid="uid://c4qmuxjhheahr" path="res://Scripts/Components/ProximityPlayerDetection.cs" id="8_ktwe0"]
[ext_resource type="Script" uid="uid://cqwvssstkrdmw" path="res://Scripts/Components/Actors/ActorResourceProvider.cs" id="9_pyymf"]
[ext_resource type="PackedScene" uid="uid://cj63k0dmk7tl1" path="res://Scenes/Weapons/enemy_weapon_base.tscn" id="10_k6dxy"]
[ext_resource type="Resource" uid="uid://dyaxm3st70sh6" path="res://Resources/Weapons/Enemy/TurretWeapon.tres" id="11_kuwnw"]
[ext_resource type="Script" uid="uid://2cijskgyt2xb" path="res://Scripts/Components/Actors/DamageReceiverActorModule.cs" id="12_04r4v"]
[ext_resource type="Script" uid="uid://m0ag88kn0c40" path="res://Scripts/Components/Actors/DeathAnimationHandler.cs" id="13_ufa2c"]
[ext_resource type="Resource" uid="uid://dk2rbf88a5irh" path="res://Resources/Bullets/Explosion_Harmless.tres" id="14_jal4w"]
[ext_resource type="Script" uid="uid://b0qcrs74bdqhf" path="res://Scripts/Components/Actors/EnemyTurretRotationMovement.cs" id="15_g7c56"]
[ext_resource type="Script" uid="uid://7g3luecewcp5" path="res://Scripts/Components/Actors/ActorDefeatScriptHandler.cs" id="15_n6k45"]

[sub_resource type="AtlasTexture" id="AtlasTexture_84800"]
atlas = ExtResource("2_m663r")
region = Rect2(64, 0, 16, 16)

[sub_resource type="AtlasTexture" id="AtlasTexture_5eesc"]
atlas = ExtResource("2_m663r")
region = Rect2(80, 0, 16, 16)

[sub_resource type="AtlasTexture" id="AtlasTexture_hjdpo"]
atlas = ExtResource("2_m663r")
region = Rect2(96, 0, 16, 16)

[sub_resource type="AtlasTexture" id="AtlasTexture_ktwe0"]
atlas = ExtResource("2_m663r")
region = Rect2(112, 0, 16, 16)

[sub_resource type="AtlasTexture" id="AtlasTexture_pyymf"]
atlas = ExtResource("2_m663r")
region = Rect2(0, 0, 16, 16)

[sub_resource type="AtlasTexture" id="AtlasTexture_k6dxy"]
atlas = ExtResource("2_m663r")
region = Rect2(16, 0, 16, 16)

[sub_resource type="AtlasTexture" id="AtlasTexture_7jc33"]
atlas = ExtResource("2_m663r")
region = Rect2(32, 0, 16, 16)

[sub_resource type="AtlasTexture" id="AtlasTexture_04r4v"]
atlas = ExtResource("2_m663r")
region = Rect2(48, 0, 16, 16)

[sub_resource type="SpriteFrames" id="SpriteFrames_k6dxy"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_84800")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_5eesc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_hjdpo")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ktwe0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_pyymf")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_k6dxy")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_7jc33")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_04r4v")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]

[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="Turret360" type="CharacterBody2D"]
collision_layer = 16
collision_mask = 113
script = ExtResource("1_g7c56")
EnemyData = ExtResource("2_x4kwn")

[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_k6dxy")
frame = 2
frame_progress = 0.33307

[node name="MovementProvider" type="Node2D" parent="." node_paths=PackedStringArray("DamageReceiver", "EquippedWeapon")]
script = ExtResource("3_kuwnw")
DamageReceiver = NodePath("../DamageReceiver")
EquippedWeapon = NodePath("../EnemyWeapon")

[node name="InputProvider" type="Node2D" parent="MovementProvider"]
script = ExtResource("4_m663r")

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

[node name="AnimationHandler" type="Node2D" parent="." node_paths=PackedStringArray("TurretSprite")]
script = ExtResource("5_g7c56")
TurretSprite = NodePath("../AnimatedSprite2D")
RotationOffset = -90.0
InvertRotation = true

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

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

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

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

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

[node name="DamageReceiver" type="Node2D" parent="." node_paths=PackedStringArray("HealthProvider")]
script = ExtResource("12_04r4v")
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_ufa2c")
ExplosionData = ExtResource("14_jal4w")

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

[node name="TurretRotationHandler" type="Node2D" parent="." node_paths=PackedStringArray("EquippedWeapon", "_playerDetection")]
script = ExtResource("15_g7c56")
CollisionMask = 81
EquippedWeapon = NodePath("../EnemyWeapon")
_playerDetection = NodePath("../PlayerDetection")

[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="area_entered" from="DamageReceiver/Area2D" to="DamageReceiver" method="_on_damage_hitbox_area_entered"]
