[gd_scene load_steps=27 format=3 uid="uid://bbqug1s083mdi"]

[ext_resource type="PackedScene" uid="uid://ci2uamlnv8swy" path="res://assets/maps/levelpool.blend" id="1_cpckw"]
[ext_resource type="PackedScene" uid="uid://cy86jyiy6skvk" path="res://scenes/player.tscn" id="2_eggmh"]
[ext_resource type="PackedScene" uid="uid://3s4o76uxcabo" path="res://components/door_component.tscn" id="3_clecd"]
[ext_resource type="Texture2D" uid="uid://bj7g1cro2pvlp" path="res://assets/textures/dev/tiles01_black.png" id="4_ngwgs"]
[ext_resource type="AudioStream" uid="uid://cieprqff0h2nm" path="res://assets/sounds/door.wav" id="5_yad6d"]
[ext_resource type="PackedScene" uid="uid://dnq81gfo5y4oy" path="res://components/group_trigger_component.tscn" id="6_f2del"]
[ext_resource type="Script" path="res://scripts/win_box.gd" id="7_oxf41"]
[ext_resource type="Script" path="res://scripts/failure.gd" id="8_pee3c"]
[ext_resource type="Script" path="res://scenes/kreb.gd" id="9_wgbkn"]
[ext_resource type="AudioStream" uid="uid://4ju4ca5wak7v" path="res://assets/sounds/dialog/kerbygreet.wav" id="10_ee2e2"]
[ext_resource type="AudioStream" uid="uid://cojpnupcedga" path="res://assets/sounds/dialog/kerbywhatare.wav" id="11_nnjei"]
[ext_resource type="AudioStream" uid="uid://w7jbmkwjvtvx" path="res://assets/sounds/disappoint.wav" id="11_yx3n7"]
[ext_resource type="PackedScene" uid="uid://duuedavsf44c7" path="res://assets/models/general/monitor01.blend" id="12_nw67b"]

[sub_resource type="BoxShape3D" id="BoxShape3D_yaaik"]
size = Vector3(4, 4, 0.6)

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_gs8og"]
albedo_texture = ExtResource("4_ngwgs")

[sub_resource type="BoxMesh" id="BoxMesh_ytxur"]
size = Vector3(4, 4, 0.6)

[sub_resource type="Animation" id="Animation_lexij"]
resource_name = "open"
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CollisionShape3D:position:x")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0, 0),
"points": PackedFloat32Array(0, -0.25, 0, 0.5, 0, 3.9, -0.5, 0, 0.25, 0),
"times": PackedFloat32Array(0, 1)
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_prvv0"]
_data = {
"open": SubResource("Animation_lexij")
}

[sub_resource type="BoxShape3D" id="BoxShape3D_dsbsn"]
size = Vector3(2, 2, 2)

[sub_resource type="BoxShape3D" id="BoxShape3D_0a1av"]
size = Vector3(2, 0.147827, 2)

[sub_resource type="BoxShape3D" id="BoxShape3D_vryv4"]
size = Vector3(4, 4, 1)

[sub_resource type="QuadMesh" id="QuadMesh_vjrho"]
size = Vector2(1, 2)

[sub_resource type="ViewportTexture" id="ViewportTexture_ma705"]
viewport_path = NodePath("Kreb/CSGMesh3D/Sprite3D/SubViewport")

[sub_resource type="LabelSettings" id="LabelSettings_7t61y"]
font_size = 20
font_color = Color(0.396889, 0.396889, 0.396889, 1)

[sub_resource type="ConvexPolygonShape3D" id="ConvexPolygonShape3D_aa4aa"]
points = PackedVector3Array(-0.3, -0.208738, -0.27433, -0.275039, -0.358724, -0.27433, -0.3, -0.208738, -0.174369, -0.3, 0.391276, -0.27433, 0.27498, -0.358724, -0.27433, -0.275039, -0.358724, 0.32567, -0.3, 0.391276, -0.174369, 0.3, 0.391276, -0.27433, 0.27498, -0.358724, 0.32567, 0.3, -0.208738, -0.27433, -0.275039, -0.283768, 0.32567, -0.200039, 0.291213, 0.32567, 0.3, 0.391276, -0.174369, 0.3, -0.208738, -0.174369, 0.27498, -0.283768, 0.32567, 0.19998, 0.291213, 0.32567)

[sub_resource type="Environment" id="Environment_alnls"]
background_mode = 1

[node name="LevelPool" type="Node3D"]

[node name="OmniLight3D" type="OmniLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 10, 0)
light_energy = 9.0
shadow_enabled = true
shadow_blur = 1.695
omni_range = 162.191

[node name="levelpool" parent="." instance=ExtResource("1_cpckw")]

[node name="player" parent="levelpool" index="1"]
visible = false

[node name="Text" parent="levelpool" index="7"]
visible = false

[node name="Plane" parent="levelpool" index="8"]
visible = false

[node name="Player" parent="." instance=ExtResource("2_eggmh")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.012538, 19)

[node name="EntranceDoor" parent="." instance=ExtResource("3_clecd")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 11.5)
open_sound = ExtResource("5_yad6d")
close_sound = ExtResource("5_yad6d")

[node name="CollisionShape3D" type="CollisionShape3D" parent="EntranceDoor"]
shape = SubResource("BoxShape3D_yaaik")

[node name="CSGMesh3D" type="CSGMesh3D" parent="EntranceDoor/CollisionShape3D"]
material_override = SubResource("StandardMaterial3D_gs8og")
mesh = SubResource("BoxMesh_ytxur")

[node name="AnimationPlayer" type="AnimationPlayer" parent="EntranceDoor"]
libraries = {
"": SubResource("AnimationLibrary_prvv0")
}

[node name="ExitDoor" parent="." instance=ExtResource("3_clecd")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, -11.5)
interactable = false
open_sound = ExtResource("5_yad6d")
close_sound = ExtResource("5_yad6d")

[node name="CollisionShape3D" type="CollisionShape3D" parent="ExitDoor"]
shape = SubResource("BoxShape3D_yaaik")

[node name="CSGMesh3D" type="CSGMesh3D" parent="ExitDoor/CollisionShape3D"]
material_override = SubResource("StandardMaterial3D_gs8og")
mesh = SubResource("BoxMesh_ytxur")

[node name="AnimationPlayer" type="AnimationPlayer" parent="ExitDoor"]
libraries = {
"": SubResource("AnimationLibrary_prvv0")
}

[node name="WinBox" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5, -1, -5)
script = ExtResource("7_oxf41")

[node name="FloatPoint" type="Node3D" parent="WinBox"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)

[node name="CollisionShape3D" type="CollisionShape3D" parent="WinBox"]
shape = SubResource("BoxShape3D_dsbsn")

[node name="Failure" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5, -1, -5)
script = ExtResource("8_pee3c")

[node name="Dest" type="Node3D" parent="Failure"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.6415, 2.84072, 0)

[node name="CollisionShape3D" type="CollisionShape3D" parent="Failure"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.926086, 0)
shape = SubResource("BoxShape3D_0a1av")

[node name="DialogTrigger" parent="." instance=ExtResource("6_f2del")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 10.5)
group = "players"

[node name="CollisionShape3D" type="CollisionShape3D" parent="DialogTrigger"]
shape = SubResource("BoxShape3D_vryv4")

[node name="Kreb" type="Node3D" parent="."]
transform = Transform3D(0.797584, 0, 0.603208, 0, 1, 0, -0.603208, 0, 0.797584, -2.70194, 1.2497, 6.87629)
script = ExtResource("9_wgbkn")

[node name="StartDialog" type="AudioStreamPlayer3D" parent="Kreb"]
stream = ExtResource("10_ee2e2")
volume_db = -15.0

[node name="WinDialog" type="AudioStreamPlayer3D" parent="Kreb"]
stream = ExtResource("11_nnjei")
volume_db = -15.0

[node name="Disappoint" type="AudioStreamPlayer3D" parent="Kreb"]
stream = ExtResource("11_yx3n7")
max_db = 6.0

[node name="CSGMesh3D" type="CSGMesh3D" parent="Kreb"]
transform = Transform3D(1, 0, 0, 0, 0.965926, 0.258819, 0, -0.258819, 0.965926, 0, 0, 0)
use_collision = true
mesh = SubResource("QuadMesh_vjrho")

[node name="Sprite3D" type="Sprite3D" parent="Kreb/CSGMesh3D"]
transform = Transform3D(1, 1.52078e-08, -2.76867e-08, 7.45058e-09, 0.958839, -0.283948, 0, 0.283948, 0.95884, 0.0420668, 1.4184, 0.120258)
texture = SubResource("ViewportTexture_ma705")

[node name="SubViewport" type="SubViewport" parent="Kreb/CSGMesh3D/Sprite3D"]
transparent_bg = true
handle_input_locally = false
size = Vector2i(117, 67)

[node name="Label" type="Label" parent="Kreb/CSGMesh3D/Sprite3D/SubViewport"]
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -40.5
offset_top = -11.5
offset_right = 40.5
offset_bottom = 11.5
grow_horizontal = 2
grow_vertical = 2
text = "Krebathan"
label_settings = SubResource("LabelSettings_7t61y")

[node name="RigidBody3D" type="RigidBody3D" parent="." groups=["can_hold", "monitors"]]
transform = Transform3D(-0.609108, 0, -0.793087, 0, 1, 0, 0.793087, 0, -0.609108, -4.50229, 0.379934, -3.88399)

[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.000276208, -0.0256701)
shape = SubResource("ConvexPolygonShape3D_aa4aa")

[node name="monitor01" parent="RigidBody3D/CollisionShape3D" instance=ExtResource("12_nw67b")]
transform = Transform3D(1, 0, 2.98023e-08, 0, 1, 0, -2.98023e-08, 0, 1, 0, -0.358724, 0.0256701)

[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_alnls")

[connection signal="body_entered" from="WinBox" to="WinBox" method="_on_body_entered"]
[connection signal="body_entered" from="Failure" to="Failure" method="_on_body_entered"]
[connection signal="activated_once" from="DialogTrigger" to="Kreb/StartDialog" method="play" binds= [0]]
[connection signal="finished" from="Kreb/WinDialog" to="ExitDoor" method="open"]

[editable path="levelpool"]
