entities WIP
This commit is contained in:
+4
-5
@@ -65,10 +65,10 @@ func _on_new_game_pressed():
|
||||
Patient.patient_list[i] = Patient.og_patient_list[i]
|
||||
Patient.its_list = Patient.og_its_list
|
||||
Patient.entities_list = Patient.og_entities_list
|
||||
Patient.entities_current_floor.clear()
|
||||
Patient.patients_seen.clear()
|
||||
Patient.its_seen.clear()
|
||||
Patient.entities_seen.clear()
|
||||
$ScreeningDesk.journal_layer.update_journal(-1)
|
||||
# DISABLED FOR NOW SINCE THERE'S NO INTRO ANYMORE
|
||||
#Offering to skip the introduction
|
||||
#var choice_text = "Do you wish to skip the introduction ?"
|
||||
@@ -99,11 +99,8 @@ func start_day():
|
||||
await get_tree().create_timer(1.0).timeout
|
||||
|
||||
#Setting up new patient
|
||||
$ScreeningDesk.middle_screen.update(Globals.day_count, Globals.floor_count, Globals.accurate_diagnoses, Globals.diagnoses_quota)
|
||||
|
||||
for scene in [$ScreeningDesk, UI.its_game_over]: #Resetting scenes
|
||||
for scene in [$ScreeningDesk, UI.its_game_over, UI.entity_game_over]: #Resetting scenes
|
||||
scene.reset()
|
||||
$ScreeningDesk.journal_layer.update_journal(Globals.floor_count) #Updating Journal
|
||||
|
||||
#Transitioning to the screening desk
|
||||
scenes_to_hide = scenes_to_show
|
||||
@@ -132,6 +129,7 @@ func save_game(save_slot_number:int):
|
||||
"patients_seen": Patient.patients_seen,
|
||||
"its_seen": Patient.its_seen,
|
||||
"entities_seen": Patient.entities_seen,
|
||||
"entities_current_floor": Patient.entities_current_floor,
|
||||
"save_date": Globals.get_save_date()
|
||||
}
|
||||
#Creating save file
|
||||
@@ -188,6 +186,7 @@ func load_game(load_slot_number:int):
|
||||
Patient.patients_seen = load_data["patients_seen"]
|
||||
Patient.its_seen = load_data["its_seen"]
|
||||
Patient.entities_seen = load_data["entities_seen"]
|
||||
Patient.entities_current_floor = load_data["entities_current_floor"]
|
||||
else:
|
||||
print("Failed to parse Loading Data.")
|
||||
|
||||
|
||||
@@ -45,18 +45,46 @@ func _on_journal_pressed():
|
||||
show()
|
||||
|
||||
|
||||
func update_journal(floor_count:int):
|
||||
func update_symptoms(floor_count:int):
|
||||
|
||||
var symptoms_page : String = ""
|
||||
for i in range(-floor_count):
|
||||
for symptom in symptoms_detailed[i]:
|
||||
symptoms_page += "\n\n" + symptom
|
||||
journal_symptoms.text = symptoms_page
|
||||
journal.symptoms_page.text = symptoms_page
|
||||
|
||||
|
||||
func update_entities():
|
||||
|
||||
journal.entities_page.clear()
|
||||
if Patient.entities_current_floor.is_empty():
|
||||
Patient.pick_floor_entities() #Picking floor entities unless a save was just loaded
|
||||
|
||||
var config := ConfigFile.new()
|
||||
var entity_name: String = ""
|
||||
var entity_characteristics: String = ""
|
||||
var entity_course_of_action: String = ""
|
||||
var entity_text: String = ""
|
||||
|
||||
for entity in Patient.entities_current_floor:
|
||||
config.load("res://Dialogues/Entities/" + entity + "_file.cfg") #Loading Entity file
|
||||
entity_name = config.get_value("", "entity_name")
|
||||
entity_characteristics = config.get_value("", "entity_characteristics")
|
||||
entity_course_of_action = config.get_value("", "entity_course_of_action")
|
||||
entity_text = Globals.colorize(entity_name, "dark_red") + "\n\nCHARACTERISTICS" + entity_characteristics + "\nRECOMMENDED COURSE OF ACTION" + entity_course_of_action
|
||||
journal.entities_page.text += "\n\n" + entity_text
|
||||
|
||||
|
||||
#Resets to initial state
|
||||
func reset():
|
||||
hide()
|
||||
update_symptoms(Globals.floor_count)
|
||||
if Globals.floor_count <= -4:
|
||||
update_entities()
|
||||
if Globals.floor_count <= -4:
|
||||
bookmarks.entities.show()
|
||||
else:
|
||||
bookmarks.entities.hide()
|
||||
|
||||
|
||||
#Shows the rules tab
|
||||
|
||||
@@ -13,3 +13,7 @@ func update(day_count, floor_count, diagnoses_count, diagnoses_quota):
|
||||
var diagnoses = Globals.colorize(str(diagnoses_count) + "/" + str(diagnoses_quota), "dark_orange")
|
||||
|
||||
text = "DAY: " + day + "\n\nFLOOR: " + floor + "\n\nACCURATE DIAGNOSES: " + diagnoses
|
||||
|
||||
|
||||
func reset():
|
||||
update(Globals.day_count, Globals.floor_count, Globals.accurate_diagnoses, Globals.diagnoses_quota)
|
||||
|
||||
@@ -30,8 +30,9 @@ var og_patient_list : Array[Dictionary]
|
||||
var patient_list: Array[Dictionary]
|
||||
var og_its_list = ["its_01"]
|
||||
var its_list = []
|
||||
var og_entities_list = [["entity_01"]]
|
||||
var entities_list = [[]]
|
||||
var og_entities_list = ["entity_01"]
|
||||
var entities_list = []
|
||||
var entities_current_floor = []
|
||||
var patients_seen = []
|
||||
var its_seen = []
|
||||
var entities_seen = []
|
||||
@@ -216,7 +217,7 @@ func generate_next_id(patient_type: String):
|
||||
next_id = its_list.pick_random()
|
||||
print("ITS selected: " + str(next_id))
|
||||
"entity":
|
||||
next_id = entities_list[floor_index].pick_random()
|
||||
next_id = entities_current_floor.pick_random()
|
||||
print("Entity selected: " + str(next_id))
|
||||
|
||||
return next_id
|
||||
@@ -258,7 +259,8 @@ func next_patient_type():
|
||||
_:
|
||||
for i in range(int(floor(Globals.diagnoses_quota/4))):
|
||||
type_list.append("its")
|
||||
type_list.append("entity")
|
||||
if len(entities_current_floor) > 0:
|
||||
type_list.append("entity")
|
||||
for i in range(int(floor(Globals.diagnoses_quota/2))):
|
||||
type_list.append("patient")
|
||||
return type_list.pick_random()
|
||||
@@ -282,8 +284,17 @@ func update_list():
|
||||
print("Updated ITS list: " + str(its_list))
|
||||
"entity":
|
||||
entities_seen.append(id)
|
||||
for i in range(len(entities_list)):
|
||||
if len(entities_list[i]) > 1:
|
||||
entities_list[i].erase(id)
|
||||
for j in range(len(entities_list)):
|
||||
print("Updated Floor " + str(j) + " Entity list: " + str(entities_list[j]))
|
||||
if len(entities_list)>1:
|
||||
entities_list.erase(id)
|
||||
print("Updated Entities list: " + str(entities_list))
|
||||
|
||||
|
||||
#Randomly picks which entities will be present on the current floor
|
||||
func pick_floor_entities():
|
||||
|
||||
var entity
|
||||
|
||||
for i in range(int(floor(Globals.diagnoses_quota/4))):
|
||||
if len(entities_list) > 0:
|
||||
entity = entities_list.pick_random()
|
||||
entities_current_floor.append(entity)
|
||||
|
||||
@@ -217,15 +217,11 @@ func descend_floor(): #Descends to next floor
|
||||
room_assets.backwall_animation.play("going_down_2")
|
||||
await room_assets.backwall_animation.animation_finished
|
||||
|
||||
#Updating middle screen info
|
||||
middle_screen.update(Globals.day_count, Globals.floor_count, Globals.accurate_diagnoses, Globals.diagnoses_quota)
|
||||
Patient.entities_current_floor.clear() #Rerandomizing entities list at every floor
|
||||
|
||||
#Updating journal symptoms
|
||||
journal_layer.update_journal(Globals.floor_count)
|
||||
for node in [middle_screen, computer, console_screen, journal_layer]:
|
||||
node.reset() #Resetting the scene
|
||||
|
||||
#Hiding screen messages
|
||||
computer.screen.hide()
|
||||
console_screen.hide()
|
||||
|
||||
#Autosaving
|
||||
main.save_game(0)
|
||||
@@ -236,6 +232,6 @@ func descend_floor(): #Descends to next floor
|
||||
|
||||
#Resets to initial state
|
||||
func reset():
|
||||
for node in [patient, supervisor, journal_layer, computer, console_screen, release, terminate,
|
||||
for node in [patient, supervisor, journal_layer, computer, console_screen, middle_screen, release, terminate,
|
||||
green_button, red_button, room_assets]:
|
||||
node.reset()
|
||||
|
||||
@@ -343,6 +343,7 @@ script = ExtResource("1_1s7k3")
|
||||
|
||||
[node name="JournalLayer" type="CanvasLayer" parent="."]
|
||||
layer = 110
|
||||
visible = false
|
||||
script = ExtResource("3_8gteb")
|
||||
|
||||
[node name="Mask" type="TextureRect" parent="JournalLayer"]
|
||||
@@ -752,11 +753,11 @@ text = "- BEINGS OF [color=red]INHUMAN NATURE[/color] HAVE BEEN DETECTED HIDING
|
||||
|
||||
- ALTHOUGH THEIR MOTIVES ARE UNKNOWN, SOME BEHAVIOUR [color=orange_red]PATTERNS[/color] HAVE BEEN IDENTIFIED.
|
||||
|
||||
- [color=red]TERMINATE[/color] THEM AS SOON AS POSSIBLE.
|
||||
|
||||
- FOLLOWING THE RECOMMENDED COURSE OF ACTION IS [color=forest_green]HIGHLY RECOMMENDED[/color] IN ORDER TO PRESERVE YOUR WELL-BEING.
|
||||
|
||||
- THE REPUBLIC [color=blue]WITHSTANDS[/color]."
|
||||
- [color=red]TERMINATE[/color] THEM AS SOON AS POSSIBLE.
|
||||
|
||||
- ALL ENTITIES [color=orange_red]DETECTED ON YOUR CURRENT FLOOR[/color] ARE LISTED ON THE RIGHT."
|
||||
|
||||
[node name="Slogan" type="RichTextLabel" parent="JournalLayer/Boundaries/VBoxContainer/Journal/MarginContainer/Entities/LeftPage"]
|
||||
custom_minimum_size = Vector2(0, 100)
|
||||
|
||||
Reference in New Issue
Block a user