[gd_scene load_steps=13 format=3 uid="uid://xtm08af0e82g"]

[ext_resource type="Shader" uid="uid://dndm4jfifooyk" path="res://Shaders/TunnelVision.gdshader" id="1_jjgbg"]
[ext_resource type="DayConfig" uid="uid://d30pwvrr7m72j" path="res://Resources/Day_Day1.tres" id="2_8gbba"]
[ext_resource type="SoundBank" uid="uid://b8ouri8tqw8vp" path="res://Resources/SoundBank.tres" id="2_21xkr"]
[ext_resource type="HazardDef" uid="uid://pgmnp6ev1ark" path="res://Resources/Hazard_GymBro.tres" id="3_kry3j"]
[ext_resource type="PackedScene" uid="uid://bg4uaukekjbx" path="res://Scenes/main_menu.tscn" id="4_6bp64"]
[ext_resource type="PackedScene" uid="uid://bqxc62tofqger" path="res://Objects/hazard_animated.tscn" id="4_21xkr"]
[ext_resource type="DayConfig" uid="uid://b0j1f8h6tioaf" path="res://Resources/Day_Day2.tres" id="4_344ge"]
[ext_resource type="HazardDef" uid="uid://xsxsa2m5ryjr" path="res://Resources/Hazard_Phone.tres" id="6_344ge"]
[ext_resource type="Texture2D" uid="uid://fulcxnac5453" path="res://Sprites/gym_bg.png" id="9_ynf5e"]

[sub_resource type="ShaderMaterial" id="ShaderMaterial_bo1nx"]
shader = ExtResource("1_jjgbg")
shader_parameter/vignette_intensity = 0.0
shader_parameter/vignette_color = Color(0, 0, 0, 1)

[sub_resource type="Curve" id="Curve_bo1nx"]
_data = [Vector2(0, 0), 0.0, 1.4, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
point_count = 2

[sub_resource type="TunnelConfig" id="TunnelConfig_8gbba"]
max_tunnel_intensity = 0.7
vision_curve = SubResource("Curve_bo1nx")

[node name="Main" type="Node"]

[node name="CanvasLayer" type="CanvasLayer" parent="."]
layer = -10

[node name="BG" type="TextureRect" parent="CanvasLayer"]
z_index = -8
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("9_ynf5e")

[node name="Ui" type="CanvasLayer" parent="."]

[node name="Vignette" type="ColorRect" parent="Ui"]
material = SubResource("ShaderMaterial_bo1nx")
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 1

[node name="LiftProgressBar" type="LiftProgressBar" parent="Ui"]
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -27.0
grow_horizontal = 2
grow_vertical = 0

[node name="Win" type="ColorRect" parent="Ui"]
visible = false
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 1, 0, 1)

[node name="MarginContainer" type="MarginContainer" parent="Ui/Win"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 32
theme_override_constants/margin_top = 32
theme_override_constants/margin_right = 32
theme_override_constants/margin_bottom = 32

[node name="VBoxContainer" type="VBoxContainer" parent="Ui/Win/MarginContainer"]
layout_mode = 2
alignment = 1

[node name="Label" type="Label" parent="Ui/Win/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 72
text = "Light Weight"
horizontal_alignment = 1
vertical_alignment = 1
uppercase = true

[node name="Next day" type="Button" parent="Ui/Win/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "Next day"

[node name="Lose" type="ColorRect" parent="Ui"]
visible = false
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(1, 0, 0, 1)

[node name="MarginContainer" type="MarginContainer" parent="Ui/Lose"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 32
theme_override_constants/margin_top = 32
theme_override_constants/margin_right = 32
theme_override_constants/margin_bottom = 32

[node name="VBoxContainer" type="VBoxContainer" parent="Ui/Lose/MarginContainer"]
layout_mode = 2
alignment = 1

[node name="Label" type="Label" parent="Ui/Lose/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 72
text = "Failure"
horizontal_alignment = 1
vertical_alignment = 1
uppercase = true

[node name="Restart" type="Button" parent="Ui/Lose/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "Restart"

[node name="Menu" type="Button" parent="Ui/Lose/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "Go to menu"

[node name="Systems" type="Node" parent="."]

[node name="PlayerInputSystem" type="PlayerInputSystem" parent="Systems"]

[node name="TunnelSystem" type="TunnelSystem" parent="Systems" node_paths=PackedStringArray("vignette_overlay")]
config = SubResource("TunnelConfig_8gbba")
vignette_overlay = NodePath("../../Ui/Vignette")

[node name="SoundManager" type="SoundManager" parent="Systems"]
bank = ExtResource("2_21xkr")

[node name="GameManager" type="GameManager" parent="Systems" node_paths=PackedStringArray("hazard_system", "minigame_container", "win_screen", "lose_screen")]
days = Array[DayConfig]([ExtResource("2_8gbba"), ExtResource("4_344ge")])
hazard_system = NodePath("../HazardSystem")
minigame_container = NodePath("../../GameContainer")
win_screen = NodePath("../../Ui/Win")
lose_screen = NodePath("../../Ui/Lose")
main_menu_scene = ExtResource("4_6bp64")

[node name="CameraShakeSystem" type="CameraShakeSystem" parent="Systems" node_paths=PackedStringArray("camera")]
camera = NodePath("../../Camera2D")
min_focus_for_shake = 0.7

[node name="HazardSystem" type="HazardSystem" parent="Systems" node_paths=PackedStringArray("spawn_locations")]
possible_hazards = Array[HazardDef]([ExtResource("3_kry3j"), ExtResource("6_344ge")])
spawn_locations = [NodePath("../../HazardSpots/Right"), NodePath("../../HazardSpots/Left"), NodePath("../../HazardSpots/Top"), NodePath("../../HazardSpots/Down")]
hazard_prefab = ExtResource("4_21xkr")

[node name="GameContainer" type="Node" parent="."]

[node name="HazardSpots" type="Node2D" parent="."]

[node name="Right" type="Marker2D" parent="HazardSpots"]
position = Vector2(502, 0)

[node name="Top" type="Marker2D" parent="HazardSpots"]
position = Vector2(0, -228)

[node name="Down" type="Marker2D" parent="HazardSpots"]
position = Vector2(0, 212)

[node name="Left" type="Marker2D" parent="HazardSpots"]
position = Vector2(-500, 0)

[node name="Camera2D" type="Camera2D" parent="."]

[connection signal="pressed" from="Ui/Win/MarginContainer/VBoxContainer/Next day" to="Systems/GameManager" method="on_next_day_pressed"]
[connection signal="pressed" from="Ui/Lose/MarginContainer/VBoxContainer/Restart" to="Systems/GameManager" method="on_retry_pressed"]
[connection signal="pressed" from="Ui/Lose/MarginContainer/VBoxContainer/Menu" to="Systems/GameManager" method="on_menu_pressed"]
