new abnormal special WIP
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user