[gd_scene load_steps=11 format=3 uid="uid://eh3y4s4qad8m"]

[ext_resource type="PackedScene" uid="uid://bhhphcagggc1" path="res://template/scenes/credits/scrolling_credits.tscn" id="1_o8vp5"]
[ext_resource type="Script" uid="uid://bwr3tliac4mo2" path="res://scenes/text_wrappers/text_wrapper.gd" id="2_fg6t0"]
[ext_resource type="PackedScene" uid="uid://bkcsjsk2ciff" path="res://addons/maaacks_menus_template/base/scenes/music_players/background_music_player.tscn" id="3_fs5lg"]
[ext_resource type="Script" uid="uid://1nf36h0gms3q" path="res://addons/maaacks_menus_template/base/scripts/capture_focus.gd" id="5_0ltfy"]
[ext_resource type="AudioStream" uid="uid://dv6al62a1smma" path="res://assets/Audio/VO_LVL1_EVENT_Mauvais batiment_01.ogg" id="5_ytsd5"]
[ext_resource type="AudioStream" uid="uid://bm42ap2bg5u8a" path="res://assets/Audio/VO_LVL1_EVENT_Mauvais batiment_02.ogg" id="6_0ltfy"]
[ext_resource type="AudioStream" uid="uid://q22nbj5dhw0e" path="res://assets/Audio/VO_LVL1_EVENT_Mauvais batiment_03.ogg" id="7_8gnxm"]
[ext_resource type="AudioStream" uid="uid://dnwu24a0uqccm" path="res://assets/Audio/VO_LVL1_EVENT_Mauvais batiment_04.ogg" id="8_m6anb"]

[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_ytsd5"]
streams_count = 4
stream_0/stream = ExtResource("5_ytsd5")
stream_1/stream = ExtResource("6_0ltfy")
stream_2/stream = ExtResource("7_8gnxm")
stream_3/stream = ExtResource("8_m6anb")

[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_0ltfy"]

[node name="WrongBuilding" instance=ExtResource("1_o8vp5")]
script = ExtResource("2_fg6t0")
scene_to_trigger = "uid://s1cx1gvt4bed"

[node name="FailedAudio" type="AudioStreamPlayer2D" parent="." index="0"]
stream = SubResource("AudioStreamRandomizer_ytsd5")
bus = &"VoiceOver"

[node name="BackgroundMusicPlayer" parent="." index="1" instance=ExtResource("3_fs5lg")]
bus = &"Cinematique"

[node name="BackgroundColor" type="ColorRect" parent="." index="2"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)

[node name="BackgroundTextureRect" type="TextureRect" parent="." index="3"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
expand_mode = 1
stretch_mode = 5

[node name="ScrollContainer" parent="." index="4"]
visible = false
scroll_vertical = 0

[node name="CenterContainer" type="CenterContainer" parent="." index="5"]
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
mouse_filter = 2

[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer" index="0"]
custom_minimum_size = Vector2(600, 0)
layout_mode = 2

[node name="Message" type="Label" parent="CenterContainer/VBoxContainer" index="0"]
unique_name_in_owner = true
custom_minimum_size = Vector2(360, 0)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
text = "__CALL IN PROGRESS__
---
__HANDSHAKE OVER__
__FINGERPRINT: NO-MECANIC__
/!\\ CONNEXION SECURE /!\\ 
---
DINO SÉRIEUX TU AS TROP FAIT LE RIGOLO, TU T'ES TROMPÉ DE BATIMENT!
"
vertical_alignment = 1
autowrap_mode = 3

[node name="CenterContainer" type="CenterContainer" parent="CenterContainer/VBoxContainer" index="1"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3

[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer/CenterContainer" index="0"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 16
script = ExtResource("5_0ltfy")

[node name="AcceptButton1" type="Button" parent="CenterContainer/VBoxContainer/CenterContainer/HBoxContainer" index="0"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
text = "GAME OVER"

[node name="AcceptButton2" type="Button" parent="CenterContainer/VBoxContainer/CenterContainer/HBoxContainer" index="1"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
text = "TRY AGAIN"

[node name="EndMessagePanel" type="Panel" parent="CenterContainer" index="1"]
unique_name_in_owner = true
visible = false
custom_minimum_size = Vector2(360, 120)
layout_mode = 2

[node name="StartConnexion" type="Timer" parent="." index="6"]
wait_time = 0.5
one_shot = true
autostart = true

[node name="FurtherConnexion" type="Timer" parent="." index="7"]
wait_time = 0.5
one_shot = true

[node name="TextStart" type="Timer" parent="." index="8"]
one_shot = true

[node name="TimeBetweenWords" type="Timer" parent="." index="9"]
wait_time = 0.15

[node name="TimeBeforeShowButtons" type="Timer" parent="." index="10"]
wait_time = 2.0
one_shot = true

[node name="AHAAudio" type="AudioStreamPlayer2D" parent="." index="11"]
stream = SubResource("AudioStreamRandomizer_0ltfy")
autoplay = true
bus = &"VoiceOver"

[connection signal="pressed" from="CenterContainer/VBoxContainer/CenterContainer/HBoxContainer/AcceptButton1" to="." method="start_mission"]
[connection signal="pressed" from="CenterContainer/VBoxContainer/CenterContainer/HBoxContainer/AcceptButton2" to="." method="start_mission"]
[connection signal="timeout" from="StartConnexion" to="." method="_on_start_connexion_timeout"]
[connection signal="timeout" from="FurtherConnexion" to="." method="_on_further_connexion_timeout"]
[connection signal="timeout" from="TextStart" to="." method="_on_text_start_timeout"]
[connection signal="timeout" from="TimeBetweenWords" to="." method="_on_time_between_words_timeout"]
[connection signal="timeout" from="TimeBeforeShowButtons" to="." method="_on_time_before_show_buttons_timeout"]
