Sorting patient by floor

This commit is contained in:
Maurane
2026-01-21 17:40:32 +01:00
parent 15666ba7af
commit b7c329bbde
55 changed files with 234 additions and 152 deletions
+57 -53
View File
@@ -27,8 +27,6 @@ extends Control
@onready var shutter_bot = $RoomAssets/ShutterBot
@onready var shutters_animation = $RoomAssets/ShuttersAnimation
@onready var backroom = $RoomAssets/Backroom
@onready var red_backroom = $RoomAssets/RedBackroom
@onready var green_backroom = $RoomAssets/GreenBackroom
@onready var backwall_animation = $RoomAssets/Backwall/BackwallAnimation
#DialogueAssets
@@ -36,6 +34,7 @@ extends Control
@onready var end_of_day_dialogue_resource = load("res://Dialogues/end_of_day.dialogue")
@onready var balloon: Node
@onready var patient_emotions : Dictionary
@onready var message_array: Array[String]
var main: Node
var accurate_diagnoses = 0
@@ -56,9 +55,11 @@ func _ready() -> void:
tab_recording.pressed.connect(self._on_tab_recording_pressed)
Globals.console_message.connect(self.console_display)
Globals.response_chosen.connect(self._on_response_chosen)
Globals.clear_patient.connect(self._on_clear_patient)
Globals.color_change.connect(self._on_color_change)
#Hiding RoomAssets
for room_asset in [shutter_top, shutter_bot, backroom, red_backroom, green_backroom]:
for room_asset in [shutter_top, shutter_bot, backroom]:
room_asset.hide()
#Hiding ComputerScreen, DialogueText and JournalOpen
@@ -77,6 +78,8 @@ func _ready() -> void:
patient.hide() #Hiding Patient
self.hide() #Hiding ScreeningDesk
message_array.resize(3) #Setting up message array
func new_patient():
@@ -212,24 +215,36 @@ func _change_emotion(dialogue_line) -> void: #Change emotions following dialogue
func _on_green_button_pressed(): #Releases the patient
release.text = Globals.colorize("RELEASE", "green") #Highlighting the decision
#Greening the vibe
green_backroom.show()
patient.modulate = Color(0.5,1,0.5,1)
clear_patient("release") #Clearing the patient
decision_made("release")
func _on_red_button_pressed(): #Terminates the patient
terminate.text = Globals.colorize("TERMINATE", "red") #Highlighting the decision
decision_made("terminate")
func decision_made(choice: String):
#Redding the vibe
red_backroom.show()
patient.modulate = Color(1,0.1,0.1,1)
#Hiding computer tabs screen
for node in [tab_patient_file, tab_rules, tab_recording] + computer_tabs.get_children():
node.hide()
clear_patient("terminate") #Clearing the patient
#Setting up console and computer displays
if choice == "release":
release.text = Globals.colorize("RELEASE", "green") #Highlighting the decision
message_array = Globals.release_messages
elif choice == "terminate":
terminate.text = Globals.colorize("TERMINATE", "red") #Highlighting the decision
message_array = Globals.terminate_messages
console_display(message_array[0])
computer_display(message_array[2])
#Disabling Buttons
green_button.set_mouse_filter(Control.MOUSE_FILTER_IGNORE)
red_button.set_mouse_filter(Control.MOUSE_FILTER_IGNORE)
#Final Patient Dialogue
main.start_balloon("screening", Patient.dialogue_resource, choice)
func _on_journal_pressed(): #Shows the journal
@@ -240,34 +255,7 @@ func _on_close_manual_pressed(): #Hides the journal
journal_layer.hide()
func clear_patient(choice:String): #Clears patient and transitions towards next patient or end of day
#Hiding computer tabs screen and console screen
for node in [tab_patient_file, tab_rules, tab_recording, console_screen] + computer_tabs.get_children():
node.hide()
#Disabling Buttons
green_button.set_mouse_filter(Control.MOUSE_FILTER_IGNORE)
red_button.set_mouse_filter(Control.MOUSE_FILTER_IGNORE)
#Setting up computer and console messages
var message: Array[String]
message.resize(3)
if choice == "release":
message[0] = Globals.colorize("- ASSESSMENT MADE -\n\n- LOADING RELEASE PROTOCOL... -", "green_yellow")
message[1] = Globals.colorize("- RELEASING SUBJECT -", "green_yellow")
message[2] = "EVALUATION RECORDED" + "\n\nPATIENT STATUS: " + Globals.colorize("HUMAN", "green") + "\n\nUPDATING DATABASE...\n\n" + Globals.colorize("INITIATING RELEASE SEQUENCE", "green_yellow")
elif choice == "terminate":
message[0] = Globals.colorize("- ASSESSMENT MADE -\n\n- LOADING TERMINATION PROTOCOL... -", "orange_red")
message[1] = Globals.colorize("- TERMINATING SUBJECT -", "orange_red")
message[2] = "EVALUATION RECORDED" + "\n\nPATIENT STATUS: " + Globals.colorize("ABNORMAL", "red") + "\n\nUPDATING DATABASE...\n\n" + Globals.colorize("INITIATING TERMINATION SEQUENCE", "orange_red")
console_display(message[0])
computer_display(message[2])
#Final Patient Dialogue
main.start_balloon("screening", Patient.dialogue_resource, choice)
await DialogueManager.dialogue_ended
func _on_clear_patient(choice:String): #Clears patient and transitions towards next patient or end of day
# Updating middle screen info and accurate_diagnoses value
if (Patient.abnormal == true and choice == "terminate") or (Patient.abnormal == false and choice == "release"):
@@ -277,16 +265,17 @@ func clear_patient(choice:String): #Clears patient and transitions towards next
update_middle_screen(Globals.day_count, Globals.floor_count, accurate_diagnoses, Globals.diagnoses_quota)
#Showing second console message
console_display(message[1])
console_display(message_array[1])
#Closing Shutters
shutters_animation.play("close")
await shutters_animation.animation_finished
#Hiding the cell and restoring the patient's original color
for scene in [patient, backroom, red_backroom, green_backroom]:
#Hiding the cell and restoring the backroom and patient's original colors
for scene in [patient, backroom]:
scene.hide()
patient.modulate = Patient.original_color
backroom.modulate = Patient.original_color
#Hiding Computer screen and resetting Console screen once the animation is done
shutters_animation.play(choice)
@@ -294,13 +283,6 @@ func clear_patient(choice:String): #Clears patient and transitions towards next
computer_screen.hide()
console_screen.hide()
#Descending Floor if diagnoses_quota reached
if accurate_diagnoses == Globals.diagnoses_quota:
descend_floor()
else:
new_patient()
#Reenabling mouse filter and resetting buttons
for button in [green_button, red_button]:
button.set_mouse_filter(Control.MOUSE_FILTER_STOP)
@@ -310,7 +292,27 @@ func clear_patient(choice:String): #Clears patient and transitions towards next
#Resetting decision screen
release.text = Globals.colorize("RELEASE", "web_gray")
terminate.text = Globals.colorize("TERMINATE", "web_gray")
#Descending Floor if diagnoses_quota reached
if accurate_diagnoses == Globals.diagnoses_quota:
descend_floor()
else:
new_patient()
func _on_color_change(color: String): #Modulating backroom and patient colors
var new_color: Color
match color:
"red":
new_color = Color(1,0.1,0.1,1)
"green":
new_color = Color(0.5,1,0.5,1)
patient.modulate = new_color
backroom.modulate = new_color
print("Color changed to: " + str(new_color))
func console_display(message): #Displays a message on the console screen
var text = message
@@ -325,6 +327,7 @@ func computer_display(message): #Displays a message on the computer screen
computer_screen.text = text
computer_screen.show()
func update_middle_screen(day_count, floor_count, diagnoses_count, diagnoses_quota): #Updates Middle Screen Info
var day = Globals.colorize(str(day_count), "dark_orange")
var floor = Globals.colorize(str(floor_count), "dark_orange")
@@ -334,6 +337,7 @@ func update_middle_screen(day_count, floor_count, diagnoses_count, diagnoses_quo
middle_screen.text = text
func descend_floor(): #Descends to next floor
#Displaying information on screens