[gd_scene load_steps=31 format=3 uid="uid://bsv3h2lpv7h77"]

[ext_resource type="Script" uid="uid://bwhxwf77egesx" path="res://virus.gd" id="1_5nuwd"]
[ext_resource type="Texture2D" uid="uid://mbey3bjcno10" path="res://assets/animations/Enemy_1_MERGED/Grow 1.png" id="2_2g5hr"]
[ext_resource type="AudioStream" uid="uid://veasx54o1t5m" path="res://assets/sfx/hit_enemy.wav" id="2_lk7jo"]
[ext_resource type="Texture2D" uid="uid://vjktyvv2qjr5" path="res://assets/animations/Enemy_1_MERGED/Grow 2.png" id="3_8stpa"]
[ext_resource type="Texture2D" uid="uid://cfqb26he3sx4v" path="res://assets/animations/Enemy_1_MERGED/Idle 1.png" id="4_7ae1t"]
[ext_resource type="Texture2D" uid="uid://cjl3c06iybish" path="res://assets/animations/Enemy_1_MERGED/Idle 2.png" id="5_lk7jo"]
[ext_resource type="Texture2D" uid="uid://dxe6fxpe2inih" path="res://assets/animations/Enemy_1_MERGED/Idle 3.png" id="6_ob56v"]
[ext_resource type="Texture2D" uid="uid://ck70wlmlqhiky" path="res://assets/animations/Enemy_1_MERGED/Idle 4.png" id="7_vvfls"]
[ext_resource type="Texture2D" uid="uid://bvr7wbue0jgjn" path="res://assets/animations/Enemy_1_MERGED/Idle 5.png" id="8_t8qsc"]
[ext_resource type="Texture2D" uid="uid://bf10p0wvs6khl" path="res://assets/animations/Enemy_1_MERGED/Processing 1.png" id="9_7ae1t"]
[ext_resource type="Texture2D" uid="uid://xj67msthi65b" path="res://assets/animations/Enemy_1_MERGED/Spawn 1.png" id="9_ku2y3"]
[ext_resource type="Texture2D" uid="uid://f8vha6371gkh" path="res://assets/animations/Enemy_1_MERGED/Spawn 2.png" id="10_lgldr"]
[ext_resource type="Texture2D" uid="uid://bag32nbg15y1y" path="res://assets/animations/Enemy_1_MERGED/Processing 2.png" id="10_lk7jo"]
[ext_resource type="Texture2D" uid="uid://dv807t1pnq2sq" path="res://assets/animations/Enemy_1_MERGED/Spawn 3.png" id="11_6n17y"]
[ext_resource type="Texture2D" uid="uid://cv5si8ahe2ata" path="res://assets/animations/Enemy_1_MERGED/Spawn 4.png" id="12_w17xr"]
[ext_resource type="Texture2D" uid="uid://dw5x58lgbmpid" path="res://assets/animations/Enemy_1_MERGED/Spawn 5.png" id="13_6dvfq"]

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_lk7jo"]
animation = &"virus_spawning"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ob56v"]
animation = &"virus_idle"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_7ae1t"]
animation = &"virus_processing"

[sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_7ae1t"]
input_0/name = "processing"
input_0/auto_advance = true
input_0/break_loop_at_end = true
input_0/reset = true
input_1/name = "spawning"
input_1/auto_advance = true
input_1/break_loop_at_end = true
input_1/reset = true
input_2/name = "idle"
input_2/auto_advance = false
input_2/break_loop_at_end = false
input_2/reset = true

[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_lk7jo"]
nodes/output/position = Vector2(580, 300)
nodes/Animation/node = SubResource("AnimationNodeAnimation_7ae1t")
nodes/Animation/position = Vector2(80, 140)
"nodes/Animation 3/node" = SubResource("AnimationNodeAnimation_ob56v")
"nodes/Animation 3/position" = Vector2(80, 580)
nodes/transition/node = SubResource("AnimationNodeTransition_7ae1t")
nodes/transition/position = Vector2(360, 300)
"nodes/Animation 2/node" = SubResource("AnimationNodeAnimation_lk7jo")
"nodes/Animation 2/position" = Vector2(80, 360)
node_connections = [&"output", 0, &"transition", &"transition", 0, &"Animation", &"transition", 1, &"Animation 2", &"transition", 2, &"Animation 3"]

[sub_resource type="Animation" id="Animation_ob56v"]
resource_name = "virus_idle"
loop_mode = 1
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("../AnimatedSprite2D")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [&"idle", 1.0, false],
"method": &"play"
}]
}
tracks/1/type = "method"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("..")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"set_spawned"
}]
}

[sub_resource type="Animation" id="Animation_7ae1t"]
resource_name = "virus_processing"
length = 3.7875
loop_mode = 1
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("../AnimatedSprite2D")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [&"processing", 1.0, false],
"method": &"play"
}]
}
tracks/1/type = "method"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("..")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"set_spawning"
}]
}

[sub_resource type="Animation" id="Animation_lk7jo"]
resource_name = "virus_spawning"
length = 0.16667001
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("../AnimatedSprite2D")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [&"spawn", 1.0, false],
"method": &"play"
}]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_lk7jo"]
_data = {
&"virus_idle": SubResource("Animation_ob56v"),
&"virus_processing": SubResource("Animation_7ae1t"),
&"virus_spawning": SubResource("Animation_lk7jo")
}

[sub_resource type="Shader" id="Shader_8v58v"]
code = "shader_type canvas_item;

void vertex() {
	// Called for every vertex the material is visible on.
}

void fragment() {
	COLOR.r = 1.0;
}

//void light() {
//	// Called for every pixel for every light affecting the CanvasItem.
//	// Uncomment to replace the default light processing function with this one.
//}
"

[sub_resource type="ShaderMaterial" id="ShaderMaterial_8fg0l"]
shader = SubResource("Shader_8v58v")

[sub_resource type="SpriteFrames" id="SpriteFrames_1xnis"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("2_2g5hr")
}, {
"duration": 1.0,
"texture": ExtResource("3_8stpa")
}],
"loop": false,
"name": &"grow",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("4_7ae1t")
}, {
"duration": 1.0,
"texture": ExtResource("5_lk7jo")
}, {
"duration": 1.0,
"texture": ExtResource("6_ob56v")
}, {
"duration": 1.0,
"texture": ExtResource("7_vvfls")
}, {
"duration": 1.0,
"texture": ExtResource("8_t8qsc")
}],
"loop": true,
"name": &"idle",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("9_7ae1t")
}, {
"duration": 1.0,
"texture": ExtResource("10_lk7jo")
}],
"loop": true,
"name": &"processing",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("9_ku2y3")
}, {
"duration": 1.0,
"texture": ExtResource("10_lgldr")
}, {
"duration": 1.0,
"texture": ExtResource("11_6n17y")
}, {
"duration": 1.0,
"texture": ExtResource("12_w17xr")
}, {
"duration": 1.0,
"texture": ExtResource("13_6dvfq")
}],
"loop": false,
"name": &"spawn",
"speed": 5.0
}]

[sub_resource type="CircleShape2D" id="CircleShape2D_ob56v"]
radius = 85.0

[sub_resource type="CircleShape2D" id="CircleShape2D_lk7jo"]
radius = 120.0

[node name="Virus" type="Node2D"]
script = ExtResource("1_5nuwd")

[node name="HitSFX" type="AudioStreamPlayer" parent="."]
stream = ExtResource("2_lk7jo")

[node name="AnimationTree" type="AnimationTree" parent="."]
root_node = NodePath(".")
tree_root = SubResource("AnimationNodeBlendTree_lk7jo")
anim_player = NodePath("AnimationPlayer")
parameters/transition/current_state = "idle"
parameters/transition/transition_request = ""
parameters/transition/current_index = 2

[node name="AnimationPlayer" type="AnimationPlayer" parent="AnimationTree"]
libraries = {
&"": SubResource("AnimationLibrary_lk7jo")
}

[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
material = SubResource("ShaderMaterial_8fg0l")
sprite_frames = SubResource("SpriteFrames_1xnis")
animation = &"spawn"
autoplay = "grow"

[node name="Area2D" type="Area2D" parent="."]
collision_layer = 31
collision_mask = 31

[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
shape = SubResource("CircleShape2D_ob56v")

[node name="Hurtbox" type="Area2D" parent="."]

[node name="CollisionShape2D" type="CollisionShape2D" parent="Hurtbox"]
shape = SubResource("CircleShape2D_lk7jo")

[connection signal="body_entered" from="Area2D" to="." method="_on_body_entered"]
