code rework for entities current floor

This commit is contained in:
Maurane
2026-03-13 12:24:02 +01:00
parent 3fa18e2b74
commit a02c48657f
3 changed files with 16 additions and 9 deletions
+2 -2
View File
@@ -56,10 +56,10 @@ func _on_new_game_pressed():
#Setting/Resetting game parameters #Setting/Resetting game parameters
Globals.day_count = 1 Globals.day_count = 1
Globals.floor_count = -1 Globals.floor_count = -4
Globals.patient_count = 0 Globals.patient_count = 0
Globals.accurate_diagnoses = 0 Globals.accurate_diagnoses = 0
Globals.diagnoses_quota = 1 Globals.diagnoses_quota = 4
Globals.daily_patient_limit = 6 Globals.daily_patient_limit = 6
for i in range(len(Patient.patient_list)): for i in range(len(Patient.patient_list)):
Patient.patient_list[i] = Patient.og_patient_list[i] Patient.patient_list[i] = Patient.og_patient_list[i]
+1 -1
View File
@@ -71,7 +71,7 @@ func update_entities():
entity_name = config.get_value("", "entity_name") entity_name = config.get_value("", "entity_name")
entity_characteristics = config.get_value("", "entity_characteristics") entity_characteristics = config.get_value("", "entity_characteristics")
entity_course_of_action = config.get_value("", "entity_course_of_action") 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 entity_text = Globals.colorize(entity_name, "dark_red") + "\n\nCHARACTERISTICS" + "PLACEHOLDER\n" + entity_characteristics + "\nRECOMMENDED COURSE OF ACTION" + entity_course_of_action
journal.entities_page.text += "\n\n" + entity_text journal.entities_page.text += "\n\n" + entity_text
+12 -5
View File
@@ -238,14 +238,15 @@ func next_patient() -> Dictionary: #Decides next patient ID
next_id = generate_next_id(next_type) next_id = generate_next_id(next_type)
_: _:
next_type = next_patient_type() next_type = next_patient_type()
next_id = generate_next_id(next_patient_type()) next_id = generate_next_id(next_type)
print("NEXT SUBJECT CHARACTERISTICS - id: " + next_id, "type: " + next_type)
return {"id": next_id, "type": next_type} return {"id": next_id, "type": next_type}
#Randomizes next patient type (human, it, its) #Randomizes next patient type (human, it, its)
func next_patient_type(): func next_patient_type():
var type_list = [] var type_list = []
var next_type: String
match Globals.floor_count: match Globals.floor_count:
-1: -1:
return "patient" return "patient"
@@ -255,7 +256,9 @@ func next_patient_type():
type_list.append("its") type_list.append("its")
for i in range(Globals.diagnoses_quota - 1): for i in range(Globals.diagnoses_quota - 1):
type_list.append("patient") type_list.append("patient")
return type_list.pick_random() next_type = type_list.pick_random()
print("Next subject type picked: " + str(next_type))
return next_type
_: _:
for i in range(int(floor(Globals.diagnoses_quota/4))): for i in range(int(floor(Globals.diagnoses_quota/4))):
type_list.append("its") type_list.append("its")
@@ -263,7 +266,9 @@ func next_patient_type():
type_list.append("entity") type_list.append("entity")
for i in range(int(floor(Globals.diagnoses_quota/2))): for i in range(int(floor(Globals.diagnoses_quota/2))):
type_list.append("patient") type_list.append("patient")
return type_list.pick_random() next_type = type_list.pick_random()
print("Next subject type picked: " + str(next_type))
return next_type
#Erases current patient ID from the corresponding patient list, so it can't be seen twice #Erases current patient ID from the corresponding patient list, so it can't be seen twice
@@ -284,9 +289,10 @@ func update_list():
print("Updated ITS list: " + str(its_list)) print("Updated ITS list: " + str(its_list))
"entity": "entity":
entities_seen.append(id) entities_seen.append(id)
if len(entities_list)>1:
entities_list.erase(id) entities_list.erase(id)
entities_current_floor.erase(id)
print("Updated Entities list: " + str(entities_list)) print("Updated Entities list: " + str(entities_list))
print("Updated Entities current floor list: " + str(entities_current_floor))
#Randomly picks which entities will be present on the current floor #Randomly picks which entities will be present on the current floor
@@ -298,3 +304,4 @@ func pick_floor_entities():
if len(entities_list) > 0: if len(entities_list) > 0:
entity = entities_list.pick_random() entity = entities_list.pick_random()
entities_current_floor.append(entity) entities_current_floor.append(entity)
print("Picked Entities current floor list: " + str(entities_current_floor))