[gd_scene format=3 uid="uid://s4s66oaexava"]

[ext_resource type="Script" uid="uid://d07cjelbqbiug" path="res://molecular/predator/hammerhead_predator.gd" id="1_xp037"]
[ext_resource type="Texture2D" uid="uid://ch5rddsumyyhm" path="res://molecular/assets/predator/predator-healthy.png" id="2_34kwa"]
[ext_resource type="Texture2D" uid="uid://30uwkdbnuu3h" path="res://molecular/assets/predator/hammerheadRibozyme-hunting.png" id="3_0ts4d"]
[ext_resource type="Script" uid="uid://cygrmt03sx0k1" path="res://molecular/predator/state_machine.gd" id="3_xp037"]
[ext_resource type="Script" uid="uid://xbiqj7ubmj7d" path="res://molecular/prey/state_idle.gd" id="4_8a23j"]
[ext_resource type="Texture2D" uid="uid://jyuf4lgjo64" path="res://molecular/assets/predator/hammerheadRibozyme-hurt.png" id="4_shhro"]
[ext_resource type="Script" uid="uid://ubcu8fdfxxj1" path="res://molecular/prey/state_random_movement.gd" id="5_6rsu5"]
[ext_resource type="Script" uid="uid://bc7apl71t0q04" path="res://molecular/predator/state_hunting.gd" id="8_7qt2q"]
[ext_resource type="Script" uid="uid://bvbc0n0pslq7p" path="res://shared/wrapping_manager.gd" id="9_shhro"]

[sub_resource type="AtlasTexture" id="AtlasTexture_8a23j"]
atlas = ExtResource("2_34kwa")
region = Rect2(0, 0, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_6rsu5"]
atlas = ExtResource("2_34kwa")
region = Rect2(64, 0, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_0ts4d"]
atlas = ExtResource("2_34kwa")
region = Rect2(128, 0, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_nu6jw"]
atlas = ExtResource("3_0ts4d")
region = Rect2(0, 0, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_8inuv"]
atlas = ExtResource("3_0ts4d")
region = Rect2(64, 0, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_orf3n"]
atlas = ExtResource("3_0ts4d")
region = Rect2(128, 0, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_vkkje"]
atlas = ExtResource("4_shhro")
region = Rect2(0, 0, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_jfmyn"]
atlas = ExtResource("4_shhro")
region = Rect2(64, 0, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_f26lq"]
atlas = ExtResource("4_shhro")
region = Rect2(128, 0, 64, 64)

[sub_resource type="SpriteFrames" id="SpriteFrames_shhro"]
animations = [{
"frames": [{
"duration": 3.0,
"texture": SubResource("AtlasTexture_8a23j")
}, {
"duration": 2.0,
"texture": SubResource("AtlasTexture_6rsu5")
}, {
"duration": 4.0,
"texture": SubResource("AtlasTexture_0ts4d")
}],
"loop": true,
"name": &"Healthy",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_nu6jw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8inuv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_orf3n")
}],
"loop": true,
"name": &"Hunting",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_vkkje")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jfmyn")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_f26lq")
}],
"loop": true,
"name": &"Hurt",
"speed": 5.0
}]

[node name="HammerheadPredator" type="CharacterBody2D" unique_id=678504815 groups=["predator"]]
scale = Vector2(0.3, 0.3)
collision_layer = 4
collision_mask = 3
motion_mode = 1
script = ExtResource("1_xp037")
maxHealth = 50
metadata/_custom_type_script = "uid://dgfimmq53whll"

[node name="WrappingManager" type="Node" parent="." unique_id=826586678 node_paths=PackedStringArray("sprite")]
script = ExtResource("9_shhro")
sprite = NodePath("../AnimatedSprite2D")
metadata/_custom_type_script = "uid://bvbc0n0pslq7p"

[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=410999609]
rotation = 4.712389
sprite_frames = SubResource("SpriteFrames_shhro")
animation = &"Hunting"

[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="." unique_id=1596156928]
light_mask = 4
visibility_layer = 4
position = Vector2(0.11167908, 1.1167793)
rotation = -1.5707964
polygon = PackedVector2Array(-22.184862, -27.994831, 23.481365, -27.21198, 13.82622, 25.891317, -6.005971, 25.891317)

[node name="StateMachine" type="Node" parent="." unique_id=1857729810 node_paths=PackedStringArray("initial_state")]
script = ExtResource("3_xp037")
initial_state = NodePath("RandomMovement")
metadata/_custom_type_script = "uid://ck7k8ht54snsy"

[node name="Idle" type="Node" parent="StateMachine" unique_id=265876039]
script = ExtResource("4_8a23j")

[node name="Timer" type="Timer" parent="StateMachine/Idle" unique_id=1870665609]
one_shot = true

[node name="RandomMovement" type="Node" parent="StateMachine" unique_id=105315122]
script = ExtResource("5_6rsu5")

[node name="Timer" type="Timer" parent="StateMachine/RandomMovement" unique_id=447822526]
one_shot = true

[node name="Hunting" type="Node" parent="StateMachine" unique_id=1569866955]
script = ExtResource("8_7qt2q")

[node name="Sight" type="Area2D" parent="." unique_id=1608385873]
collision_layer = 0
collision_mask = 7

[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Sight" unique_id=1707240701]
light_mask = 4
visibility_layer = 4
position = Vector2(-1.0900421, 1.6350927)
rotation = -1.5707964
polygon = PackedVector2Array(-27.769547, -29.426758, 31.88504, -29.184647, 12.700996, 28.7294, 56.058624, 148.93633, 22.979004, 163.77974, -19.854843, 161.65926, -53.782654, 143.84715, -8.333115, 30.157196)

[node name="AttackCooldownTimer" type="Timer" parent="." unique_id=435253442]
wait_time = 0.5
one_shot = true

[connection signal="timeout" from="StateMachine/Idle/Timer" to="StateMachine/Idle" method="_on_timer_timeout"]
[connection signal="timeout" from="StateMachine/RandomMovement/Timer" to="StateMachine/RandomMovement" method="_on_timer_timeout"]
[connection signal="body_entered" from="Sight" to="." method="_on_sight_body_entered"]
[connection signal="timeout" from="AttackCooldownTimer" to="." method="_on_attack_cooldown_timer_timeout"]
