[gd_scene load_steps=22 format=3 uid="uid://dolphin_main"]

[ext_resource type="Script" path="res://scripts/dolphin/DolphinController.gd" id="1_controller"]
[ext_resource type="Script" path="res://scripts/dolphin/HUD.gd" id="2_hud"]
[ext_resource type="Script" path="res://scripts/dolphin/EcholocationPulse.gd" id="3_echo"]

[sub_resource type="CapsuleShape3D" id="1_colshape"]
radius = 0.4
height = 2.0

[sub_resource type="CapsuleMesh" id="2_body_mesh"]
radius = 0.4
height = 2.0

[sub_resource type="StandardMaterial3D" id="3_body_mat"]
albedo_color = Color(0.29, 0.478, 0.584, 1)

[sub_resource type="CapsuleMesh" id="4_belly_mesh"]
radius = 0.35
height = 1.6

[sub_resource type="StandardMaterial3D" id="5_belly_mat"]
albedo_color = Color(0.91, 0.933, 0.949, 1)

[sub_resource type="CapsuleMesh" id="6_tail_mesh"]
radius = 0.2
height = 0.9

[sub_resource type="StandardMaterial3D" id="7_tail_mat"]
albedo_color = Color(0.29, 0.478, 0.584, 1)

[sub_resource type="PrismMesh" id="8_fin_mesh"]
size = Vector3(0.15, 0.4, 0.08)

[sub_resource type="StandardMaterial3D" id="9_fin_mat"]
albedo_color = Color(0.29, 0.478, 0.584, 1)

[sub_resource type="CapsuleMesh" id="10_pec_mesh"]
radius = 0.1
height = 0.5

[sub_resource type="StandardMaterial3D" id="11_pec_mat"]
albedo_color = Color(0.29, 0.478, 0.584, 1)

[sub_resource type="StyleBoxFlat" id="12_panel_style"]
bg_color = Color(0.05, 0.05, 0.05, 0.7)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_left = 10
corner_radius_bottom_right = 10

[node name="Dolphin" type="CharacterBody3D"]
script = ExtResource("1_controller")

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

[node name="DolphinBody" type="Node3D" parent="."]
rotation = Vector3(0, 0, 0)

[node name="Body" type="MeshInstance3D" parent="DolphinBody"]
rotation = Vector3(1.5708, 0, 0)
mesh = SubResource("2_body_mesh")
surface_material_override/0 = SubResource("3_body_mat")

[node name="Belly" type="MeshInstance3D" parent="DolphinBody"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.05, 0.15)
rotation = Vector3(1.5708, 0, 0)
mesh = SubResource("4_belly_mesh")
surface_material_override/0 = SubResource("5_belly_mat")

[node name="Tail" type="MeshInstance3D" parent="DolphinBody"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1.1)
rotation = Vector3(1.5708, 0, 0)
mesh = SubResource("6_tail_mesh")
surface_material_override/0 = SubResource("7_tail_mat")

[node name="DorsalFin" type="MeshInstance3D" parent="DolphinBody"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.45, -0.1)
mesh = SubResource("8_fin_mesh")
surface_material_override/0 = SubResource("9_fin_mat")

[node name="PecFinLeft" type="MeshInstance3D" parent="DolphinBody"]
transform = Transform3D(1, 0, 0, 0, 0.866, -0.5, 0, 0.5, 0.866, -0.45, 0.0, 0.1)
mesh = SubResource("10_pec_mesh")
surface_material_override/0 = SubResource("11_pec_mat")

[node name="PecFinRight" type="MeshInstance3D" parent="DolphinBody"]
transform = Transform3D(1, 0, 0, 0, 0.866, 0.5, 0, -0.5, 0.866, 0.45, 0.0, 0.1)
mesh = SubResource("10_pec_mesh")
surface_material_override/0 = SubResource("11_pec_mat")

[node name="CameraPivot" type="Node3D" parent="."]

[node name="SpringArm" type="SpringArm3D" parent="CameraPivot"]
spring_length = 3.5
rotation = Vector3(0, 3.14159, 0)

[node name="Camera" type="Camera3D" parent="CameraPivot/SpringArm"]

[node name="EcholocationPulse" type="Node3D" parent="."]
script = ExtResource("3_echo")

[node name="HUD" type="CanvasLayer" parent="."]
script = ExtResource("2_hud")

[node name="Panel" type="PanelContainer" parent="HUD"]
anchors_preset = 0
anchor_left = 0.0
anchor_top = 1.0
anchor_right = 0.0
anchor_bottom = 1.0
offset_left = 16.0
offset_top = -160.0
offset_right = 220.0
offset_bottom = -16.0
theme_override_styles/panel = SubResource("12_panel_style")

[node name="VBox" type="VBoxContainer" parent="HUD/Panel"]
layout_mode = 2
theme_override_constants/separation = 8
offset_left = 10.0
offset_top = 10.0
offset_right = -10.0
offset_bottom = -10.0

[node name="OxygenRow" type="HBoxContainer" parent="HUD/Panel/VBox"]
layout_mode = 2

[node name="OxygenLabel" type="Label" parent="HUD/Panel/VBox/OxygenRow"]
layout_mode = 2
text = "O2:"
custom_minimum_size = Vector2(36, 0)

[node name="OxygenBar" type="ProgressBar" parent="HUD/Panel/VBox/OxygenRow"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
custom_minimum_size = Vector2(130, 18)
max_value = 100.0
value = 100.0
show_percentage = false

[node name="HealthRow" type="HBoxContainer" parent="HUD/Panel/VBox"]
layout_mode = 2

[node name="HealthLabel" type="Label" parent="HUD/Panel/VBox/HealthRow"]
layout_mode = 2
text = "HP:"
custom_minimum_size = Vector2(36, 0)

[node name="HealthBar" type="ProgressBar" parent="HUD/Panel/VBox/HealthRow"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
custom_minimum_size = Vector2(130, 18)
max_value = 100.0
value = 100.0
show_percentage = false

[node name="HungerRow" type="HBoxContainer" parent="HUD/Panel/VBox"]
layout_mode = 2

[node name="HungerLabel" type="Label" parent="HUD/Panel/VBox/HungerRow"]
layout_mode = 2
text = "Food:"
custom_minimum_size = Vector2(36, 0)

[node name="HungerBar" type="ProgressBar" parent="HUD/Panel/VBox/HungerRow"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
custom_minimum_size = Vector2(130, 18)
max_value = 100.0
value = 100.0
show_percentage = false
