[gd_scene load_steps=10 format=4 uid="uid://d0j20q65wnqsr"]

[ext_resource type="Script" uid="uid://d2k75cyykkk0s" path="res://src/world/mechanics/heart/gunk_heart.gd" id="1_ftym0"]
[ext_resource type="Script" uid="uid://bukihqt1lybnx" path="res://src/util/frame_skipper.gd" id="2_xgyvt"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xgyvt"]
albedo_color = Color(0, 0.0313726, 0.101961, 1)
emission_enabled = true
emission = Color(0.25098, 0.878431, 1, 1)
emission_energy_multiplier = 0.0

[sub_resource type="ArrayMesh" id="ArrayMesh_eu6st"]
_surfaces = [{
"aabb": AABB(-0.894425, -1, -0.85064, 1.78885, 2, 1.70128),
"format": 34896613377,
"index_count": 60,
"index_data": PackedByteArray("AAABAAIAAgABAAMAAQAAAAQAAwABAAUABQABAAQABAAAAAYABQAEAAcABwAEAAYAAwAFAAgACAAFAAcAAgADAAkACQADAAgAAAACAAoACgACAAkABgAAAAoACAAHAAsABwAGAAsACQAIAAsABgAKAAsACgAJAAsA"),
"name": "Icosphere",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 12,
"vertex_data": PackedByteArray("jOfBRhrPAAD/fwAA/38AAHJYwUb//wAAAADBRv9/AACM58FG5DAAAHJYwUYAAAAA//89uf9/AACMpz25AAAAAHIYPbnkMAAAchg9uRrPAACMpz25//8AAP9/////fwAA")
}]
blend_shape_mode = 0

[sub_resource type="ArrayMesh" id="ArrayMesh_v3ru4"]
_surfaces = [{
"aabb": AABB(-0.894425, -1, -0.85064, 1.78885, 2, 1.70128),
"attribute_data": PackedByteArray("0UWv14su//9FF6/XFl3//9FFr9dcdK/X//+v17no//9z0a/Xc9Gv1y26///ooq/X6KKv16KL//9cdK/XXHSv19FFr9cWXWCv0UWv10UXr9eLLmCv//+v13PRr9e56GCvc9Gv1+iir9ctumCv6KKv11x0r9eii2CvFl1gr9FFr9eLLmCviy5gr0UXr9cAAGCvuehgr3PRr9ctumCvLbpgr+iir9eii2Cvootgr1x0r9cWXWCvFl1gr4suYK/RRRGHiy5grwAAYK9FFxGHuehgry26YK9z0RGHLbpgr6KLYK/oohGHootgrxZdYK9cdBGH"),
"format": 34896613399,
"index_count": 60,
"index_data": PackedByteArray("AAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATABQAFQAWABcAGAAZABoAGwAcAB0AHgAfACAAIQAiACMAJAAlACYAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgAOQA6ADsA"),
"material": SubResource("StandardMaterial3D_xgyvt"),
"name": "Icosphere",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 60,
"vertex_data": PackedByteArray("jOfBRhrPZaf/fwAA/39lp3JYwUb//2Wn/38AAP9/DciM58FGGs8NyIznwUbkMA3IcljBRv//nLT/fwAA/3+ctAAAwUb/f5y0AADBRv9/2N3/fwAA/3/Y3XJYwUYAANjdcljBRgAAiPT/fwAA/3+I9IznwUbkMIj0jOfBRuQwW8CM58FGGs9bwP//Pbn/f1vAjOfBRhrP6Y5yWMFG///pjoynPbn//+mOcljBRv//GacAAMFG/38Zp3IYPbkazxmnAADBRv9/yNlyWMFGAADI2XIYPbnkMMjZcljBRgAAQfOM58FG5DBB84ynPbkAAEHz//89uf9/GaeM58FGGs8Zp4ynPbn//xmnjKc9uf//6Y5yWMFG///pjnIYPbkaz+mOchg9uRrPW8AAAMFG/39bwHIYPbnkMFvAchg9ueQwQfNyWMFGAABB84ynPbkAAEHzjKc9uQAAyNmM58FG5DDI2f//Pbn/f8jZ//89uf9/nLSMpz25//+ctP9/////f5y0jKc9uf//ZadyGD25Gs9lp/9/////f2Wnchg9uRrPDchyGD255DANyP9/////fw3Ichg9ueQwiPSMpz25AACI9P9/////f4j0jKc9uQAA2N3//z25/3/Y3f9/////f9jdbylFZG8pRWRvKUVkLWCkPy1gpD8tYKQ/7DOZzewzmc3sM5nNSkmH7UpJh+1KSYftn3mdLp95nS6feZ0uz3VfFM91XxTPdV8UzFJcNMxSXDTMUlw092Nt7fdjbe33Y23t/2+Y+v9vmPr/b5j6RH6lDER+pQxEfqUMB5yREgeckRIHnJESMq2iyzKtossyraLLL4qf6y+Kn+svip/ruoFZ87qBWfO6gVnz/49mBf+PZgX/j2YFEsxlMhLMZTISzGUyj9a5m4/WuZuP1rmb0Z9awNGfWsDRn1rAX4Zh0V+GYdFfhmHRtLZ3ErS2dxK0tncS")
}]
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_eu6st")

[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_ftym0"]
data = PackedVector3Array(0.7236, -0.4472, 0.5257, 0, -1, 0, -0.2764, -0.4472, 0.8506, 0, -1, 0, 0.7236, -0.4472, 0.5257, 0.7236, -0.4472, -0.5257, -0.2764, -0.4472, 0.8506, 0, -1, 0, -0.8944, -0.4472, 0, -0.8944, -0.4472, 0, 0, -1, 0, -0.2764, -0.4472, -0.8506, -0.2764, -0.4472, -0.8506, 0, -1, 0, 0.7236, -0.4472, -0.5257, 0.7236, -0.4472, -0.5257, 0.7236, -0.4472, 0.5257, 0.8944, 0.4472, 0, 0.7236, -0.4472, 0.5257, -0.2764, -0.4472, 0.8506, 0.2764, 0.4472, 0.8506, -0.2764, -0.4472, 0.8506, -0.8944, -0.4472, 0, -0.7236, 0.4472, 0.5257, -0.8944, -0.4472, 0, -0.2764, -0.4472, -0.8506, -0.7236, 0.4472, -0.5257, -0.2764, -0.4472, -0.8506, 0.7236, -0.4472, -0.5257, 0.2764, 0.4472, -0.8506, 0.8944, 0.4472, 0, 0.7236, -0.4472, 0.5257, 0.2764, 0.4472, 0.8506, 0.2764, 0.4472, 0.8506, -0.2764, -0.4472, 0.8506, -0.7236, 0.4472, 0.5257, -0.7236, 0.4472, 0.5257, -0.8944, -0.4472, 0, -0.7236, 0.4472, -0.5257, -0.7236, 0.4472, -0.5257, -0.2764, -0.4472, -0.8506, 0.2764, 0.4472, -0.8506, 0.2764, 0.4472, -0.8506, 0.7236, -0.4472, -0.5257, 0.8944, 0.4472, 0, 0.8944, 0.4472, 0, 0.2764, 0.4472, 0.8506, 0, 1, 0, 0.2764, 0.4472, 0.8506, -0.7236, 0.4472, 0.5257, 0, 1, 0, -0.7236, 0.4472, 0.5257, -0.7236, 0.4472, -0.5257, 0, 1, 0, -0.7236, 0.4472, -0.5257, 0.2764, 0.4472, -0.8506, 0, 1, 0, 0.2764, 0.4472, -0.8506, 0.8944, 0.4472, 0, 0, 1, 0)

[sub_resource type="Animation" id="Animation_v3ru4"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("MeshInstance3D:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(1, 1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("MeshInstance3D:mesh:surface_0/material:emission_energy_multiplier")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}

[sub_resource type="Animation" id="Animation_eu6st"]
resource_name = "pulse"
step = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("MeshInstance3D:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1),
"update": 0,
"values": [Vector3(1, 1, 1), Vector3(1.05, 1.05, 1.05), Vector3(0.95, 0.95, 0.95), Vector3(1.15, 1.15, 1.15), Vector3(0.9, 0.9, 0.9), Vector3(1.025, 1.025, 1.025), Vector3(1, 1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("MeshInstance3D:mesh:surface_0/material:emission_energy_multiplier")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.3, 1),
"transitions": PackedFloat32Array(1.618, 1.618, 1),
"update": 0,
"values": [0.0, 2.0, 0.0]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_kv3oi"]
_data = {
&"RESET": SubResource("Animation_v3ru4"),
&"pulse": SubResource("Animation_eu6st")
}

[node name="GunkHeart" type="StaticBody3D"]
collision_layer = 5
collision_mask = 0
script = ExtResource("1_ftym0")
durability = 3.0
value = 4000.0
metadata/_custom_type_script = "uid://bypgxi0gy56yk"

[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
mesh = SubResource("ArrayMesh_v3ru4")

[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("ConcavePolygonShape3D_ftym0")

[node name="PulseTimer" type="Timer" parent="."]
unique_name_in_owner = true

[node name="FrameSkipper" type="Node" parent="."]
script = ExtResource("2_xgyvt")
frame_skip = 3
metadata/_custom_type_script = "uid://bukihqt1lybnx"

[node name="AnimationPlayer" type="AnimationPlayer" parent="FrameSkipper"]
unique_name_in_owner = true
root_node = NodePath("../..")
libraries = {
&"": SubResource("AnimationLibrary_kv3oi")
}
speed_scale = 4.0

[connection signal="timeout" from="PulseTimer" to="." method="pulse"]
