new abnormal special WIP

This commit is contained in:
Maurane
2026-03-05 18:13:49 +01:00
parent 6b39f60feb
commit f9ea0e6a56
19 changed files with 150 additions and 239 deletions
+5 -8
View File
@@ -11,6 +11,7 @@ var image : Texture2D
var original_color: Color
var emotions : Dictionary
var abnormal: bool
var id : String
#Patient file
var file_text : String
@@ -59,14 +60,11 @@ func build_dialog_tree(tree_model: Array[int]) -> Dictionary: #Builds the dialog
return tree
func new_patient(patient_id):
func load_patient(patient_id):
var file_path: String
#Updating Global variables
Globals.patient_id = patient_id
Globals.patients_seen.append(patient_id)
print("Patients seen list: " + str(Globals.patients_seen))
id = patient_id
#Loading Patient Files
var config := ConfigFile.new()
@@ -236,7 +234,6 @@ func next_patient() -> String: #Decides next patient ID
_:
next_patient_id = generate_patient_id()
return next_patient_id
@@ -248,7 +245,7 @@ func update_patient_list():
if len(patient_list[i]) > 1:
patient_list[i].erase(patient_id)
#Erasing its patients already seen from its patient list
#Erasing ITS patients already seen from ITS patient list
for its_patient_id in Globals.its_patients_seen:
if len(its_patient_list) > 1:
its_patient_list.erase(its_patient_id)
+42 -39
View File
@@ -22,7 +22,6 @@ extends Control
@onready var message_array: Array[String]
var main: Node
var accurate_diagnoses = 0
func _ready() -> void:
@@ -37,6 +36,7 @@ func _ready() -> void:
journal.pressed.connect(journal_layer._on_journal_pressed)
Globals.clear_patient.connect(self._on_clear_patient)
Globals.color_change.connect(self._on_color_change)
Globals.next_event.connect(self.event_manager)
room_assets.reset()
hide() #Hiding ScreeningDesk
@@ -44,23 +44,28 @@ func _ready() -> void:
message_array.resize(3) #Setting up message array
#Selecting next patient
func new_patient():
var new_id = Patient.next_patient()
#Patient.new_patient("49") #Line for testing purposes
Patient.new_patient(new_id) #Line for generating new patient
computer.patient_file.text = Patient.file_text
computer.recording.text = ""
patient.texture = Patient.image
#Manages what event should happen next
func event_manager(event_index):
match event_index:
0:
supervisor.dialogue("interfloor_" + str(-Globals.floor_count-1))
1:
console_screen.display(Globals.directives)
computer.next_patient_button.show()
2:
descend_floor()
func _on_call_next_patient_pressed(): #Brings in next patient and sets up the desk controls
#Selecting next_patient
new_patient()
#Selecting next patient
Patient.load_patient(Patient.next_patient())
#Patient.load_patient("49") #Line for testing purposes
#Updating patient information
computer.patient_file.text = Patient.file_text
computer.recording.text = ""
patient.texture = Patient.image
#Hiding the next_patient button
var scenes_to_hide = [computer.next_patient_button, supervisor]
@@ -109,9 +114,6 @@ func _on_call_next_patient_pressed(): #Brings in next patient and sets up the de
tab.show()
tab.set_mouse_filter(Control.MOUSE_FILTER_STOP)
computer.patient_file.show()
#Updating patient_count
Globals.patient_count += 1
#Starts release or termination protocols when the corresponding button is pressed
@@ -144,10 +146,14 @@ func _on_clear_patient(choice:String):
# Updating middle screen info and accurate_diagnoses value
if (Patient.abnormal == true and choice == "terminate") or (Patient.abnormal == false and choice == "release"):
accurate_diagnoses += 1
Globals.accurate_diagnoses += 1
else:
accurate_diagnoses = 0 # Resetting to 0 if the player makes a wrong diagnosis
middle_screen.update(Globals.day_count, Globals.floor_count, accurate_diagnoses, Globals.diagnoses_quota)
Globals.accurate_diagnoses = 0 # Resetting to 0 if the player makes a wrong diagnosis
middle_screen.update(Globals.day_count, Globals.floor_count, Globals.accurate_diagnoses, Globals.diagnoses_quota)
Globals.patients_seen.append(Patient.id) #Updating Patient seens list
print("Updated patients seen list: " + str(Globals.patients_seen))
Globals.patient_count += 1 #Updating patient_count
#Showing second console message
console_screen.display(message_array[1])
@@ -170,12 +176,10 @@ func _on_clear_patient(choice:String):
reset()
#Descending Floor if diagnoses_quota reached
if accurate_diagnoses == Globals.diagnoses_quota:
descend_floor()
else:
#Setting up UI
computer.next_patient_button.show()
console_screen.display(Globals.directives)
if Globals.accurate_diagnoses == Globals.diagnoses_quota:
Globals.event_index = 2
event_manager(Globals.event_index)
func _on_color_change(color: String): #Modulating backroom and patient colors
@@ -194,6 +198,13 @@ func _on_color_change(color: String): #Modulating backroom and patient colors
func descend_floor(): #Descends to next floor
#Updating Global variables
Globals.event_index = 0
Globals.floor_count -= 1
Globals.accurate_diagnoses = 0
Globals.diagnoses_quota += 1
Globals.patient_count = 0
#Displaying information on screens
var message : String
message = Globals.colorize("DIAGNOSES QUOTA REACHED", "green_yellow") + "\n\n" + "SECURITY CLEARANCE UPDATED" + "\n\n" + Globals.colorize("ACCESS TO NEXT FLOOR AUTHORIZED", "green")
@@ -208,28 +219,20 @@ func descend_floor(): #Descends to next floor
await room_assets.backwall_animation.animation_finished
#Updating middle screen info
Globals.floor_count -= 1
accurate_diagnoses = 0
Globals.diagnoses_quota += 1
middle_screen.update(Globals.day_count, Globals.floor_count, accurate_diagnoses, Globals.diagnoses_quota)
middle_screen.update(Globals.day_count, Globals.floor_count, Globals.accurate_diagnoses, Globals.diagnoses_quota)
#Resetting patient_count
Globals.patient_count = 0
#Updating journal symptoms
journal_layer.update_journal(Globals.floor_count)
journal_layer.update_journal(Globals.floor_count)
#Hiding screen messages
computer.screen.hide()
console_screen.hide()
#Interfloor dialogue
supervisor.dialogue("interfloor_" + str(-Globals.floor_count-1))
await supervisor.dialogue_finished
#Autosaving
main.save_game(0)
#Setting up UI
computer.next_patient_button.show()
console_screen.display(Globals.directives)
#Selecting next event
event_manager(Globals.event_index)
#Resets to initial state