end_of_day_dialogue started

This commit is contained in:
Maurane
2025-06-12 16:41:09 +02:00
parent d5dc174535
commit 0730c6d40a
11 changed files with 181 additions and 90 deletions
+2 -2
View File
@@ -2,7 +2,7 @@
[ext_resource type="Script" path="res://bedroom.gd" id="1_di4oy"]
[ext_resource type="Texture2D" uid="uid://c3je4gir1qlot" path="res://Art/BlackScreen.png" id="2_trxfw"]
[ext_resource type="Texture2D" uid="uid://cppnad2sauulq" path="res://Art/Office.png" id="3_y3nfl"]
[ext_resource type="Texture2D" uid="uid://c7vyp0s2ci7qf" path="res://Art/PatientRoom.jpg" id="3_k53lf"]
[node name="Corridor" type="Control"]
layout_mode = 3
@@ -32,7 +32,7 @@ expand_mode = 1
layout_mode = 2
size_flags_vertical = 3
size_flags_stretch_ratio = 1.5
texture = ExtResource("3_y3nfl")
texture = ExtResource("3_k53lf")
expand_mode = 1
[node name="LowerBorder" type="TextureRect" parent="Background"]
+5
View File
@@ -0,0 +1,5 @@
~ end_of_day_1
As the door closes on the last patient and the adrenaline subsides, you suddenly feel a day's worth of exhaustion crashing down on you. It is time to retire for the day.
=> END
+15
View File
@@ -0,0 +1,15 @@
[remap]
importer="dialogue_manager_compiler_13"
type="Resource"
uid="uid://cm41wgqrrdll3"
path="res://.godot/imported/end_of_day.dialogue-3a121551061715fe455edffe9c7f3524.tres"
[deps]
source_file="res://Dialogues/end_of_day.dialogue"
dest_files=["res://.godot/imported/end_of_day.dialogue-3a121551061715fe455edffe9c7f3524.tres"]
[params]
defaults=true
+1 -1
View File
@@ -3,7 +3,7 @@
[ext_resource type="Script" path="res://main_hub.gd" id="1_rvfpd"]
[ext_resource type="PackedScene" uid="uid://cahspuhi43bx7" path="res://title_screen.tscn" id="2_3wmv1"]
[ext_resource type="PackedScene" uid="uid://chytk2cctjk3x" path="res://screening_desk.tscn" id="3_whctb"]
[ext_resource type="PackedScene" uid="uid://dcjhx2g4d056v" path="res://Bedroom.tscn" id="4_4fm57"]
[ext_resource type="PackedScene" uid="uid://dcjhx2g4d056v" path="res://bedroom.tscn" id="4_4fm57"]
[ext_resource type="PackedScene" uid="uid://igkl2384rxt1" path="res://text_screens.tscn" id="5_85o5j"]
[ext_resource type="PackedScene" uid="uid://dixsxwodxuf0b" path="res://dialogue_screens.tscn" id="6_60wm2"]
+2
View File
@@ -1,6 +1,8 @@
extends Node
var is_transitioning = false
var day_count = 1
var daily_patient_limit = 2
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
+33 -15
View File
@@ -10,7 +10,6 @@ extends Control
var dialogue_intro = load("res://Dialogues/intro.dialogue")
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
@@ -38,7 +37,8 @@ func _ready() -> void:
title_screen.show()
#Connecting Signals
title_screen.connect("new_game_pressed", _on_new_game_pressed)
title_screen.connect("new_game_pressed", self._on_new_game_pressed)
screening_desk.connect("recovery_pressed", self._on_recovery_pressed)
pass
@@ -61,18 +61,16 @@ func _on_new_game_pressed():
TransitionScreen.mask.visible = true
#Skips the introduction
func skip_intro():
#Disconnecting the other Signal from the Confirmation Dialogue
UI.confirmation_no.disconnect("pressed", play_intro)
#Transitioning to Screening Desk
TransitionScreen.transition("big", [$TitleScreen], [$ScreeningDesk, UI, UI.get_node("UI/UpperContainer")])
await TransitionScreen.transition_finished
#Starting Day Loop
start_day_loop()
#Launching the gameplay loop
$ScreeningDesk.gameplay_loop("564")
#Plays the entire introduction
@@ -81,28 +79,48 @@ func play_intro():
#Disconnecting the other Signal from the Confirmation Dialogue
UI.confirmation_yes.disconnect("pressed", skip_intro)
#Introduction First slides
#Playing the Intro
#Text Slides
var text_container = $TextScreens/MarginContainer/IntroBoxContainer/TextContainer
TransitionScreen.transition("big", [$TitleScreen], [$TextScreens, text_container.get_child(0), UI, UI.get_node("UI/SkipContainer")])
TransitionScreen.transition("big", [$TitleScreen], [$TextScreens, $MarginContainer/IntroBoxContainer/Header, text_container.get_child(0), UI, UI.get_node("UI/SkipContainer")])
await UI.next_slide
for i in 4:
TransitionScreen.transition("small", [text_container.get_child(i)], [text_container.get_child(i+1)])
await UI.next_slide
#Dialogue in the Meeting Room
TransitionScreen.transition("big", [$TextScreens, text_container.get_child(4), UI, UI.get_node("UI/SkipContainer")], [$DialogueScreens])
#Meeting Room Dialogue
TransitionScreen.transition("big", [$TextScreens, $TextScreens/MarginContainer, text_container.get_child(4), UI, UI.get_node("UI/SkipContainer")], [$DialogueScreens])
await TransitionScreen.transition_finished
DialogueManager.show_dialogue_balloon(dialogue_intro, "start")
await DialogueManager.dialogue_ended
#Starting Day Loop
start_day_loop()
#Starts the Day Loop
func start_day_loop():
#Transitioning to Day Screen
$TextScreens/Day.text = "[center]DAY " + str(Globals.day_count) + "[/center]"
TransitionScreen.transition("big", [$DialogueScreens, $TitleScreen], [$TextScreens, $TextScreens/Day])
await TransitionScreen.transition_finished
await get_tree().create_timer(3.0).timeout
#Transitioning to the Screening Desk
TransitionScreen.transition("big", [$DialogueScreens], [$ScreeningDesk, UI, UI.get_node("UI/UpperContainer")])
TransitionScreen.transition("big", [$TextScreens, $TextScreens/Day], [$ScreeningDesk, $ScreeningDesk.alone_controls, UI, UI.get_node("UI/UpperContainer")])
await TransitionScreen.transition_finished
#Launching the gameplay loop
$ScreeningDesk.gameplay_loop("564")
#Finally starting the Game Loop
$ScreeningDesk.game_loop("564")
func _on_recovery_pressed():
var scenes_to_hide = [$ScreeningDesk.end_of_day_controls, $ScreeningDesk]
var scenes_to_show:Array[Node] = [$Bedroom]
TransitionScreen.transition("big", scenes_to_hide, scenes_to_show)
+1 -1
View File
@@ -55,4 +55,4 @@ ui_select={
[internationalization]
locale/translations_pot_files=PackedStringArray("res://Dialogues/intro.dialogue", "res://Dialogues/mr_orleg.dialogue", "res://Dialogues/intro_stash.dialogue", "res://Dialogues/Patients/patient_1.dialogue", "res://Dialogues/Patients/patient_564.dialogue")
locale/translations_pot_files=PackedStringArray("res://Dialogues/intro.dialogue", "res://Dialogues/mr_orleg.dialogue", "res://Dialogues/intro_stash.dialogue", "res://Dialogues/Patients/patient_1.dialogue", "res://Dialogues/Patients/patient_564.dialogue", "res://Dialogues/end_of_day.dialogue")
+87 -67
View File
@@ -9,48 +9,60 @@ extends Control
@onready var face_zoom = $Background/HBoxContainer/MarginContainer/VBoxContainer/FaceMarginContainer/FaceZoom
@onready var alone_controls = $Background/HBoxContainer/MarginContainer/VBoxContainer/ControlsMarginContainer/Alone
@onready var patient_controls = $Background/HBoxContainer/MarginContainer/VBoxContainer/ControlsMarginContainer/Patient
@onready var end_of_day_controls = $Background/HBoxContainer/MarginContainer/VBoxContainer/ControlsMarginContainer/EndOfDay
@onready var patient_texture = $Background/HBoxContainer/Desk/PatientTextureRect
@onready var dialogue_resource: Resource
@onready var patient_dialogue_resource: Resource
@onready var end_of_day_dialogue_resource = load("res://Dialogues/end_of_day.dialogue")
@onready var balloon: Node
@onready var patient_emotions : Dictionary
var patient_count = 0
signal recovery_pressed
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
#Connecting signals
alone_controls.get_node("PatientFile").pressed.connect(self._patient_file)
alone_controls.get_node("Guidebook").pressed.connect(self._guidebook)
alone_controls.get_node("CallNextPatient").pressed.connect(self._call_next_patient)
alone_controls.get_node("PatientFile").pressed.connect(self._on_patient_file_pressed)
alone_controls.get_node("Guidebook").pressed.connect(self._on_guidebook_pressed)
alone_controls.get_node("CallNextPatient").pressed.connect(self._on_call_next_patient_pressed)
patient_controls.get_node("PatientFile").pressed.connect(self._patient_file)
patient_controls.get_node("Guidebook").pressed.connect(self._guidebook)
patient_controls.get_node("PatientRecording").pressed.connect(self._patient_recording)
patient_controls.get_node("Examine").pressed.connect(self._examine)
patient_controls.get_node("PatientFile").pressed.connect(self._on_patient_file_pressed)
patient_controls.get_node("Guidebook").pressed.connect(self._on_guidebook_pressed)
patient_controls.get_node("PatientRecording").pressed.connect(self._on_patient_recording_pressed)
patient_controls.get_node("Examine").pressed.connect(self._on_examine_pressed)
patient_controls.get_node("Containment").pressed.connect(self._on_containment_pressed)
patient_controls.get_node("PsychWard").pressed.connect(self._on_psych_ward_pressed)
end_of_day_controls.get_node("Recovery").pressed.connect(self._on_recovery_pressed)
#Hiding everything
self.hide()
#Hiding Top Right Panel
panel_container.hide()
for node in margin_container.get_children():
node.hide()
panel_container.hide()
face_zoom.hide()
#Hiding Bottom Right Panel
alone_controls.hide()
patient_controls.hide()
end_of_day_controls.hide()
#Hiding Patient
patient_texture.hide()
func gameplay_loop(patient_id):
#Game Loop
func game_loop(patient_id):
new_patient(patient_id)
#Sets Up New Patient
func new_patient(patient_id):
#Connecting Signals
patient_controls.get_node("Containment").pressed.connect(self._on_containment_pressed)
patient_controls.get_node("PsychWard").pressed.connect(self._on_psych_ward_pressed)
#Loading Patient Files
var file_path: String = "res://Dialogues/Patients/patient_" + patient_id + "_file.txt"
var file = FileAccess.open(file_path, FileAccess.READ)
@@ -84,11 +96,11 @@ func new_patient(patient_id):
#Loading Dialogue Resource
var dialogue_resource_path = "res://Dialogues/Patients/patient_" + patient_id + ".dialogue"
dialogue_resource = load(dialogue_resource_path)
patient_dialogue_resource = load(dialogue_resource_path)
func _patient_file():
func _on_patient_file_pressed():
for node in margin_container.get_children():
node.hide()
@@ -98,7 +110,7 @@ func _patient_file():
func _guidebook():
func _on_guidebook_pressed():
for node in margin_container.get_children():
node.hide()
@@ -108,7 +120,7 @@ func _guidebook():
func _call_next_patient():
func _on_call_next_patient_pressed():
#Hiding and Showing appropriate scenes
var scenes_to_hide = [alone_controls, panel_container] + margin_container.get_children()
@@ -117,11 +129,11 @@ func _call_next_patient():
await TransitionScreen.transition_finished
#Starting Dialogue
start_balloon("start")
start_balloon(patient_dialogue_resource, "start")
func _patient_recording():
func _on_patient_recording_pressed():
for node in margin_container.get_children():
node.hide()
@@ -151,7 +163,7 @@ func _recording_text(dialogue_line):
func _examine():
func _on_examine_pressed():
for node in margin_container.get_children():
node.hide()
@@ -174,9 +186,10 @@ func _change_emotion(dialogue_line) -> void:
func _on_containment_pressed():
#Asking for Confirmation
var lambda = func(): clear_patient("containment")
UI.confirmation_text.text = "[center]Do you really want to send this patient to [color=darkred]Containment[/color] ?[/center]"
UI.confirmation_yes.pressed.connect(send_to_containment, CONNECT_ONE_SHOT)
UI.confirmation_no.pressed.connect(func(): UI.confirmation_yes.disconnect("pressed", send_to_containment))
UI.confirmation_yes.pressed.connect(lambda, CONNECT_ONE_SHOT)
UI.confirmation_no.pressed.connect(func(): UI.confirmation_yes.disconnect("pressed", lambda))
UI.confirmation_dialog.show()
TransitionScreen.mask.visible = true
@@ -184,54 +197,19 @@ func _on_containment_pressed():
func _on_psych_ward_pressed():
#Asking for Confirmation
var lambda = func(): clear_patient("psych_ward")
UI.confirmation_text.text = "[center]Do you really want to send this patient to the [color=darkgreen]Psych Ward[/color] ?[/center]"
UI.confirmation_yes.pressed.connect(send_to_psych_ward, CONNECT_ONE_SHOT)
UI.confirmation_no.pressed.connect(func(): UI.confirmation_yes.disconnect("pressed", send_to_psych_ward))
UI.confirmation_yes.pressed.connect(lambda, CONNECT_ONE_SHOT)
UI.confirmation_no.pressed.connect(func(): UI.confirmation_yes.disconnect("pressed", lambda))
UI.confirmation_dialog.show()
TransitionScreen.mask.visible = true
func send_to_containment():
#Disconnecting signals
var containment_node = patient_controls.get_node("Containment")
var psych_ward_node = patient_controls.get_node("PsychWard")
if containment_node.is_connected("pressed", _on_containment_pressed):
containment_node.disconnect("pressed", _on_containment_pressed)
if psych_ward_node.is_connected("pressed", _on_psych_ward_pressed):
psych_ward_node.disconnect("pressed", _on_psych_ward_pressed)
start_balloon("containment")
await DialogueManager.dialogue_ended
clear_patient()
func send_to_psych_ward():
#Disconnecting signals to prevent changing choice
var containment_node = patient_controls.get_node("Containment")
var psych_ward_node = patient_controls.get_node("PsychWard")
if containment_node.is_connected("pressed", _on_containment_pressed):
containment_node.disconnect("pressed", _on_containment_pressed)
if psych_ward_node.is_connected("pressed", _on_psych_ward_pressed):
psych_ward_node.disconnect("pressed", _on_psych_ward_pressed)
start_balloon("psych_ward")
await DialogueManager.dialogue_ended
clear_patient()
func start_balloon(start_title: String):
func start_balloon(dialogue_resource: Resource, start_title: String):
#Freeing Previous Balloon and Disconnecting DialogueManager signals
if is_instance_valid(balloon):
balloon.queue_free()
if DialogueManager.is_connected("got_dialogue", _change_emotion):
DialogueManager.disconnect("got_dialogue", _change_emotion)
if DialogueManager.is_connected("got_dialogue", _recording_text):
DialogueManager.disconnect("got_dialogue", _recording_text)
clean_balloon()
#Instantiating a custom balloon
var Balloon: Resource = load("res://Dialogues/balloon_small.tscn")
@@ -245,17 +223,59 @@ func start_balloon(start_title: String):
func clear_patient():
func clear_patient(choice:String):
#Hiding Patient Controls and showing Patient Face
patient_controls.hide()
_on_examine_pressed()
#Final Patient Dialogue
start_balloon(patient_dialogue_resource, choice)
await DialogueManager.dialogue_ended
#Transitioning
var scenes_to_hide = [patient_controls, patient_texture, face_zoom, panel_container] + margin_container.get_children()
var scenes_to_show:Array[Node]
patient_count += 1
if patient_count < Globals.daily_patient_limit:
scenes_to_show.append(alone_controls)
else:
scenes_to_show.append(end_of_day_controls)
#Hiding and Showing appropriate scenes
var scenes_to_hide = [patient_controls, patient_texture, face_zoom] + margin_container.get_children()
var scenes_to_show = [alone_controls, panel_container]
TransitionScreen.transition("big", scenes_to_hide, scenes_to_show)
await TransitionScreen.transition_finished
if patient_count < Globals.daily_patient_limit:
#Setting Up Next Patient
new_patient("564")
else:
patient_count = 0
#Starting End of Day Dialogue
var start_title = "end_of_day_" + str(Globals.day_count)
start_balloon(end_of_day_dialogue_resource, start_title)
func _on_recovery_pressed():
clean_balloon()
recovery_pressed.emit()
func clean_balloon():
#Freeing Previous Balloon and Disconnecting DialogueManager signals
if is_instance_valid(balloon):
balloon.queue_free()
if DialogueManager.is_connected("got_dialogue", _change_emotion):
DialogueManager.disconnect("got_dialogue", _change_emotion)
if DialogueManager.is_connected("got_dialogue", _recording_text):
DialogueManager.disconnect("got_dialogue", _recording_text)
# Called every frame. 'delta' is the elapsed time since the previous frame.
+13 -1
View File
@@ -213,7 +213,7 @@ size_flags_vertical = 3
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 0
theme_override_constants/margin_bottom = 10
[node name="Alone" type="GridContainer" parent="Background/HBoxContainer/MarginContainer/VBoxContainer/ControlsMarginContainer"]
layout_mode = 2
@@ -243,6 +243,18 @@ theme_override_fonts/font = ExtResource("4_uvrsh")
theme_override_font_sizes/font_size = 25
text = "CALL NEXT PATIENT"
[node name="EndOfDay" type="GridContainer" parent="Background/HBoxContainer/MarginContainer/VBoxContainer/ControlsMarginContainer"]
layout_mode = 2
columns = 2
[node name="Recovery" type="Button" parent="Background/HBoxContainer/MarginContainer/VBoxContainer/ControlsMarginContainer/EndOfDay"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_fonts/font = ExtResource("4_uvrsh")
theme_override_font_sizes/font_size = 25
text = "GO TO RECOVERY ROOM"
[node name="Patient" type="GridContainer" parent="Background/HBoxContainer/MarginContainer/VBoxContainer/ControlsMarginContainer"]
layout_mode = 2
columns = 2
+3
View File
@@ -9,6 +9,9 @@ func _ready() -> void:
self.hide()
for node in intro_text_container.get_children():
node.hide()
$MarginContainer/IntroBoxContainer/Header.hide()
$Day.hide()
# Called every frame. 'delta' is the elapsed time since the previous frame.
+16
View File
@@ -190,3 +190,19 @@ And yet I have to try.
For in these times of strife, I finally get to [i]matter[/i]."
tab_size = 8
[node name="Day" type="RichTextLabel" parent="."]
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -164.5
offset_top = -65.0
offset_right = 164.5
offset_bottom = 65.0
grow_horizontal = 2
grow_vertical = 2
theme_override_fonts/normal_font = ExtResource("2_i0l2q")
theme_override_font_sizes/normal_font_size = 100
bbcode_enabled = true