From 3fa18e2b7428f99f2e418ef2c75f80af53888e71 Mon Sep 17 00:00:00 2001 From: Maurane Date: Thu, 12 Mar 2026 20:43:25 +0100 Subject: [PATCH] entities WIP --- Dialogues/Entities/entity_01_file.cfg | 7 +++-- Saves/save_0.json | 2 +- Scenes/main/main.gd | 9 +++---- Scenes/screening_desk/journal_layer.gd | 32 +++++++++++++++++++++-- Scenes/screening_desk/middle_screen.gd | 4 +++ Scenes/screening_desk/patient_global.gd | 29 +++++++++++++------- Scenes/screening_desk/screening_desk.gd | 12 +++------ Scenes/screening_desk/screening_desk.tscn | 7 ++--- 8 files changed, 70 insertions(+), 32 deletions(-) diff --git a/Dialogues/Entities/entity_01_file.cfg b/Dialogues/Entities/entity_01_file.cfg index 2d8b2cd..ae5c650 100644 --- a/Dialogues/Entities/entity_01_file.cfg +++ b/Dialogues/Entities/entity_01_file.cfg @@ -6,13 +6,12 @@ psychiatric_assessment="??????????????" abnormal_symptoms="?????????????" status="abnormal" type="entity" -file_name="ENTITY #01" -file_characteristics=" +entity_name="ENTITY #01" +entity_characteristics=" - Appears as an old naked man. - Anatomical anomalies may be observed. " -file_course_of_action=" -RECOMMENDED COURSE OF ACTION +entity_course_of_action=" - Answer its questions in a [color=orange]straightforward[/color] manner. - [color=red]DO NOT LIE.[/color] " diff --git a/Saves/save_0.json b/Saves/save_0.json index dc40db0..e5f7484 100644 --- a/Saves/save_0.json +++ b/Saves/save_0.json @@ -1 +1 @@ -{"accurate_diagnoses":0,"daily_patient_limit":6,"day_count":1,"diagnoses_quota":3,"entities_list":[["entity_01"]],"entities_seen":[],"event_index":0,"floor_count":-3,"its_list":["its_01"],"its_seen":["its_00"],"patient_count":0,"patient_list":[{"patient_43":1},{"patient_42":2,"patient_43":1,"patient_44":2,"patient_48":2,"patient_51":2},{"patient_42":2,"patient_43":1,"patient_44":2,"patient_47":3,"patient_48":2,"patient_49":3,"patient_51":2},{"patient_42":2,"patient_43":1,"patient_44":2,"patient_45":4,"patient_47":3,"patient_48":2,"patient_49":3,"patient_51":2},{"patient_42":2,"patient_43":1,"patient_44":2,"patient_45":4,"patient_47":3,"patient_48":2,"patient_49":3,"patient_51":2}],"patients_seen":["patient_46","patient_50"],"save_date":"03/06/2026, 23:50"} \ No newline at end of file +{"accurate_diagnoses":0,"daily_patient_limit":6,"day_count":1,"diagnoses_quota":2,"entities_list":[["entity_01"]],"entities_seen":[],"event_index":0,"floor_count":-2,"its_list":["its_01"],"its_seen":[],"patient_count":0,"patient_list":[{"patient_43":1},{"patient_42":2,"patient_43":1,"patient_44":2,"patient_48":2,"patient_50":2,"patient_51":2},{"patient_42":2,"patient_43":1,"patient_44":2,"patient_47":3,"patient_48":2,"patient_49":3,"patient_50":2,"patient_51":2},{"patient_42":2,"patient_43":1,"patient_44":2,"patient_45":4,"patient_47":3,"patient_48":2,"patient_49":3,"patient_50":2,"patient_51":2},{"patient_42":2,"patient_43":1,"patient_44":2,"patient_45":4,"patient_47":3,"patient_48":2,"patient_49":3,"patient_50":2,"patient_51":2}],"patients_seen":["patient_46"],"save_date":"03/12/2026, 10:36"} \ No newline at end of file diff --git a/Scenes/main/main.gd b/Scenes/main/main.gd index 906243f..85381ad 100644 --- a/Scenes/main/main.gd +++ b/Scenes/main/main.gd @@ -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.") diff --git a/Scenes/screening_desk/journal_layer.gd b/Scenes/screening_desk/journal_layer.gd index 03d8e83..b8c43a6 100644 --- a/Scenes/screening_desk/journal_layer.gd +++ b/Scenes/screening_desk/journal_layer.gd @@ -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 diff --git a/Scenes/screening_desk/middle_screen.gd b/Scenes/screening_desk/middle_screen.gd index 4bba6ef..73e50fd 100644 --- a/Scenes/screening_desk/middle_screen.gd +++ b/Scenes/screening_desk/middle_screen.gd @@ -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) diff --git a/Scenes/screening_desk/patient_global.gd b/Scenes/screening_desk/patient_global.gd index 9c3c7ec..4768e9b 100644 --- a/Scenes/screening_desk/patient_global.gd +++ b/Scenes/screening_desk/patient_global.gd @@ -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) diff --git a/Scenes/screening_desk/screening_desk.gd b/Scenes/screening_desk/screening_desk.gd index f6c814b..37b325f 100644 --- a/Scenes/screening_desk/screening_desk.gd +++ b/Scenes/screening_desk/screening_desk.gd @@ -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() diff --git a/Scenes/screening_desk/screening_desk.tscn b/Scenes/screening_desk/screening_desk.tscn index baaa3db..f189500 100644 --- a/Scenes/screening_desk/screening_desk.tscn +++ b/Scenes/screening_desk/screening_desk.tscn @@ -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)