big work
This commit is contained in:
@@ -12,7 +12,7 @@ extends Control
|
||||
@onready var patient_color: Color
|
||||
@onready var computer = $LowerHalf/Computer
|
||||
@onready var middle_screen = $LowerHalf/MiddleScreen/MarginContainer/MiddleScreen
|
||||
@onready var console_screen = $LowerHalf/Console/Margin/ConsoleScreen
|
||||
@onready var console = $LowerHalf/Console
|
||||
@onready var room_assets = $RoomAssets
|
||||
|
||||
#DialogueAssets
|
||||
@@ -29,7 +29,7 @@ func _ready() -> void:
|
||||
main = get_parent()
|
||||
|
||||
#Connecting signals
|
||||
computer.next_patient_button.pressed.connect(self._on_call_next_patient_pressed)
|
||||
console.next_patient_button.pressed.connect(self._on_call_next_patient_pressed)
|
||||
red_button.decision_made.connect(self._on_decision_made)
|
||||
green_button.decision_made.connect(self._on_decision_made)
|
||||
journal.pressed.connect(journal_layer._on_journal_pressed)
|
||||
@@ -37,6 +37,7 @@ func _ready() -> void:
|
||||
Globals.decision_made.connect(self._on_decision_made)
|
||||
Globals.color_change.connect(self._on_color_change)
|
||||
Globals.next_event.connect(self.event_manager)
|
||||
Globals.add_objective.connect(journal_layer.add_objective)
|
||||
|
||||
room_assets.reset()
|
||||
hide() #Hiding ScreeningDesk
|
||||
@@ -50,8 +51,7 @@ func event_manager():
|
||||
"interfloor":
|
||||
supervisor.dialogue("interfloor_" + str(-Globals.floor_count-1))
|
||||
"next_patient":
|
||||
console_screen.display(Globals.directives)
|
||||
computer.next_patient_button.show()
|
||||
console.next_patient_button.show()
|
||||
"descend":
|
||||
descend_floor()
|
||||
"supervisor":
|
||||
@@ -62,7 +62,6 @@ func _on_call_next_patient_pressed(): #Brings in next patient and sets up the de
|
||||
|
||||
#Selecting next patient
|
||||
Patient.load_patient(Patient.next_patient())
|
||||
#Patient.load_patient({"id": "entity_01", "type": "entity"}) #Line for testing purposes
|
||||
|
||||
#Updating patient information
|
||||
computer.patient_file.text = Patient.file_text
|
||||
@@ -70,21 +69,18 @@ func _on_call_next_patient_pressed(): #Brings in next patient and sets up the de
|
||||
patient.texture = Patient.image
|
||||
|
||||
#Hiding the next_patient button
|
||||
var scenes_to_hide = [computer.next_patient_button, supervisor]
|
||||
var scenes_to_hide = [console.next_patient_button, supervisor]
|
||||
for scenes in scenes_to_hide:
|
||||
scenes.hide()
|
||||
|
||||
# Shows transition messages on computer and console
|
||||
var message : String
|
||||
message = Globals.colorize("COMPUTING CELL TRANSLATION...", "orange_red")
|
||||
computer.display(message)
|
||||
message = Globals.colorize("- BRINGING IN NEXT PATIENT -", "dark_orange")
|
||||
console_screen.display(message)
|
||||
message = Globals.colorize("COMPUTING CELL TRANSLATION...\n\n\n- BRINGING IN NEXT PATIENT -", "dark_orange")
|
||||
console.display(message)
|
||||
|
||||
#Shutters entry animation
|
||||
room_assets.cell_door.show()
|
||||
room_assets.cell_animation.play("incoming")
|
||||
room_assets.cell_top.show()
|
||||
room_assets.cell_bot.show()
|
||||
await room_assets.cell_animation.animation_finished
|
||||
|
||||
#Showing the Patient and the Backroom
|
||||
@@ -95,8 +91,7 @@ func _on_call_next_patient_pressed(): #Brings in next patient and sets up the de
|
||||
#Opening Shutters
|
||||
room_assets.cell_animation.play("open")
|
||||
await room_assets.cell_animation.animation_finished
|
||||
room_assets.cell_top.hide()
|
||||
room_assets.cell_bot.hide()
|
||||
room_assets.cell_door.hide()
|
||||
|
||||
#Activating Buttons
|
||||
green_button.set_disabled(false)
|
||||
@@ -107,24 +102,15 @@ func _on_call_next_patient_pressed(): #Brings in next patient and sets up the de
|
||||
terminate.text = Globals.colorize("TERMINATE", "dark_red")
|
||||
|
||||
#Starting Dialogue and hiding console screen
|
||||
computer.screen.hide()
|
||||
console_screen.hide()
|
||||
console.screen.hide()
|
||||
main.start_balloon("screening", "patient", Patient.dialogue_resource, Patient.dialogue_start)
|
||||
|
||||
#Showing Computer Tabs and showing Patient File Screen by default
|
||||
for tab in computer.tab_list:
|
||||
tab.show()
|
||||
tab.set_mouse_filter(Control.MOUSE_FILTER_STOP)
|
||||
computer.patient_file.show()
|
||||
computer.tab_switch(computer.tab_patient_file, computer.patient_file)
|
||||
|
||||
|
||||
#Starts release or termination protocols when the corresponding button is pressed
|
||||
func _on_decision_made(choice: String):
|
||||
|
||||
#Hiding computer tabs screen
|
||||
for node in computer.tab_list + computer.screen_list:
|
||||
node.hide()
|
||||
|
||||
#Setting up console and computer displays
|
||||
if choice == "release":
|
||||
release.text = Globals.colorize("RELEASE", "green") #Highlighting the decision
|
||||
@@ -132,8 +118,7 @@ func _on_decision_made(choice: String):
|
||||
elif choice == "terminate":
|
||||
terminate.text = Globals.colorize("TERMINATE", "red") #Highlighting the decision
|
||||
message_array = Globals.terminate_messages
|
||||
console_screen.display(message_array[0])
|
||||
computer.display(message_array[2])
|
||||
console.display(message_array[0])
|
||||
|
||||
#Disabling Buttons
|
||||
green_button.set_mouse_filter(Control.MOUSE_FILTER_IGNORE)
|
||||
@@ -153,19 +138,22 @@ func _on_clear_patient(choice:String):
|
||||
elif (Patient.abnormal == true and choice == "terminate") or (Patient.abnormal == false and choice == "release"):
|
||||
Globals.accurate_diagnoses += 1
|
||||
else:
|
||||
Globals.accurate_diagnoses = 0 # Resetting to 0 if the player makes a wrong diagnosis
|
||||
Globals.misdiagnoses += 1
|
||||
Globals.misdiagnoses_allowed -= 1 #Reducing remaining mistakes allowed if the player makes a wrong diagnosis
|
||||
middle_screen.update(Globals.floor_count, Globals.accurate_diagnoses, Globals.diagnoses_quota, Globals.misdiagnoses_allowed) #Updating middle screen info
|
||||
|
||||
|
||||
Patient.update_list() #Updating patient list
|
||||
Globals.patient_count += 1 #Updating patient_count
|
||||
|
||||
#Updating middle screen info
|
||||
middle_screen.update(Globals.floor_count, Globals.patient_count, Globals.patient_quota)
|
||||
#Updating statistics tab
|
||||
computer.update_statistics(Globals.accurate_diagnoses, Globals.misdiagnoses)
|
||||
|
||||
#Showing second console message
|
||||
console_screen.display(message_array[1])
|
||||
console.display(message_array[1])
|
||||
|
||||
#Closing Shutters
|
||||
room_assets.cell_top.show()
|
||||
room_assets.cell_bot.show()
|
||||
room_assets.cell_door.show()
|
||||
room_assets.cell_animation.play("close")
|
||||
await room_assets.cell_animation.animation_finished
|
||||
|
||||
@@ -180,12 +168,12 @@ func _on_clear_patient(choice:String):
|
||||
#Resetting the scene
|
||||
reset()
|
||||
|
||||
#GameOver is too many misdiagnoses
|
||||
if Globals.misdiagnoses_allowed == -1:
|
||||
#GameOver if too many misdiagnoses were made
|
||||
if Globals.misdiagnoses_allowed == -1 and Globals.misdiagnoses_game_over:
|
||||
UI.game_over.reveal("YOU MADE TOO MANY MISTAKES")
|
||||
|
||||
#Descending Floor if diagnoses_quota reached
|
||||
if Globals.accurate_diagnoses == Globals.diagnoses_quota:
|
||||
#Descending Floor if patient_quota is reached
|
||||
if Globals.patient_count == Globals.patient_quota:
|
||||
Globals.event_index = "descend"
|
||||
|
||||
event_manager()
|
||||
@@ -210,15 +198,16 @@ func descend_floor(): #Descends to next floor
|
||||
#Updating Global variables
|
||||
Globals.event_index = "interfloor"
|
||||
Globals.floor_count -= 1
|
||||
Globals.accurate_diagnoses = 0
|
||||
Globals.patient_count = 0
|
||||
|
||||
if Globals.floor_count >= -3: #Resetting misdiagnoses allowance for the first few floors
|
||||
Globals.misdiagnoses_allowed = 2
|
||||
|
||||
#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")
|
||||
computer.display(message)
|
||||
message = Globals.colorize("- DESCENT PROTOCOL INITIATED -\n\n- TRANSLATING TO NEXT FLOOR -", "dark_orange")
|
||||
console_screen.display(message)
|
||||
message = Globals.colorize("PATIENT QUOTA REACHED", "green_yellow") + "\n\n" + "SECURITY CLEARANCE UPDATED" + "\n\n" + Globals.colorize("ACCESS TO NEXT FLOOR AUTHORIZED", "green")
|
||||
message += Globals.colorize("\n\n\n\n- DESCENT PROTOCOL INITIATED -\n\n- TRANSLATING TO NEXT FLOOR -", "dark_orange")
|
||||
console.display(message)
|
||||
|
||||
#Descending animation
|
||||
room_assets.backwall_animation.play("going_down_1")
|
||||
@@ -226,7 +215,7 @@ func descend_floor(): #Descends to next floor
|
||||
room_assets.backwall_animation.play("going_down_2")
|
||||
await room_assets.backwall_animation.animation_finished
|
||||
|
||||
for node in [middle_screen, computer, console_screen, journal_layer]:
|
||||
for node in [middle_screen, computer, console, journal_layer]:
|
||||
node.reset() #Resetting the scene
|
||||
main.save_game(0) #Autosaving
|
||||
event_manager() #Selecting next event
|
||||
@@ -234,6 +223,6 @@ func descend_floor(): #Descends to next floor
|
||||
|
||||
#Resets to initial state
|
||||
func reset():
|
||||
for node in [patient, supervisor, Patient.spy, journal_layer, computer, console_screen, middle_screen, release, terminate,
|
||||
for node in [patient, supervisor, journal_layer, computer, console, middle_screen, release, terminate,
|
||||
green_button, red_button, room_assets]:
|
||||
node.reset()
|
||||
|
||||
Reference in New Issue
Block a user