Cell reworked

This commit is contained in:
Maurane
2026-02-03 17:32:59 +01:00
parent 025153f3fd
commit e13c2a52b2
21 changed files with 73 additions and 61 deletions
+23 -21
View File
@@ -24,10 +24,10 @@ extends Control
@onready var console_screen = $LowerHalf/ConsoleScreen/Margin/ConsoleText
#RoomAssets
@onready var shutter_top = $RoomAssets/ShutterTop
@onready var shutter_bot = $RoomAssets/ShutterBot
@onready var shutters_animation = $RoomAssets/ShuttersAnimation
@onready var backroom = $RoomAssets/Backroom
@onready var cell_top = $RoomAssets/CellTop
@onready var cell_bot = $RoomAssets/CellBot
@onready var cell_animation = $RoomAssets/CellAnimation
@onready var cell_wall = $RoomAssets/CellWall
@onready var backwall_animation = $RoomAssets/Backwall/BackwallAnimation
#DialogueAssets
@@ -59,10 +59,12 @@ func _ready() -> void:
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]:
#Hiding and showing appropriate RoomAssets
for room_asset in [cell_top, cell_bot, cell_wall]:
room_asset.hide()
for room_asset in [$RoomAssets/Glass, $RoomAssets/Room, $RoomAssets/Backwall]:
room_asset.show()
#Hiding ComputerScreen, DialogueText and JournalOpen
var nodes_to_hide = [next_patient, end_day, computer_screen, console_screen, journal_layer] + computer_tabs.get_children()
for node in nodes_to_hide:
@@ -108,19 +110,19 @@ func _on_call_next_patient_pressed(): #Brings in next patient and sets up the de
console_display(message)
#ShuttersIncoming
shutters_animation.play("incoming")
shutter_top.show()
shutter_bot.show()
await shutters_animation.animation_finished
cell_animation.play("incoming")
cell_top.show()
cell_bot.show()
await cell_animation.animation_finished
#Showing the Patient and the Backroom
var scenes_to_show = [patient, backroom]
var scenes_to_show = [patient, cell_wall]
for scene in scenes_to_show:
scene.show()
#Opening Shutters
shutters_animation.play("open")
await shutters_animation.animation_finished
cell_animation.play("open")
await cell_animation.animation_finished
#Activating Buttons
green_button.set_disabled(false)
@@ -255,18 +257,18 @@ func _on_clear_patient(choice:String): #Clears patient and transitions towards n
console_display(message_array[1])
#Closing Shutters
shutters_animation.play("close")
await shutters_animation.animation_finished
cell_animation.play("close")
await cell_animation.animation_finished
#Hiding the cell and restoring the backroom and patient's original colors
for scene in [patient, backroom]:
for scene in [patient, cell_wall]:
scene.hide()
patient.modulate = Patient.original_color
backroom.modulate = Patient.original_color
cell_wall.modulate = Patient.original_color
#Hiding Computer screen and resetting Console screen once the animation is done
shutters_animation.play(choice)
await shutters_animation.animation_finished
cell_animation.play(choice)
await cell_animation.animation_finished
computer_screen.hide()
console_screen.hide()
@@ -297,7 +299,7 @@ func _on_color_change(color: String): #Modulating backroom and patient colors
"green":
new_color = Color(0.5,1,0.5,1)
patient.modulate = new_color
backroom.modulate = new_color
cell_wall.modulate = new_color
print("Color changed to: " + str(new_color))