spy mechanics WIP
This commit is contained in:
@@ -65,6 +65,8 @@ func _on_new_game_pressed():
|
||||
Patient.its_list = Patient.og_its_list
|
||||
Patient.patients_seen.clear()
|
||||
Patient.its_seen.clear()
|
||||
Patient.spy.order = false
|
||||
Patient.spy.count = 0
|
||||
# DISABLED FOR NOW SINCE THERE'S NO INTRO ANYMORE
|
||||
#Offering to skip the introduction
|
||||
#var choice_text = "Do you wish to skip the introduction ?"
|
||||
@@ -126,6 +128,8 @@ func save_game(save_slot_number:int):
|
||||
"patients_seen": Patient.patients_seen,
|
||||
"its_seen": Patient.its_seen,
|
||||
"ite_seen": Patient.ite_seen,
|
||||
"spy_order": Patient.spy.order,
|
||||
"spy_count": Patient.spy.count,
|
||||
"journal_entities": $ScreeningDesk.journal_layer.journal.entities_page.text,
|
||||
"save_date": Globals.get_save_date()
|
||||
}
|
||||
@@ -184,6 +188,8 @@ func load_game(load_slot_number:int):
|
||||
Patient.patients_seen = load_data["patients_seen"]
|
||||
Patient.its_seen = load_data["its_seen"]
|
||||
Patient.ite_seen = load_data["ite_seen"]
|
||||
Patient.spy.order = load_data["spy_order"]
|
||||
Patient.spy.count = load_data["spy_count"]
|
||||
$ScreeningDesk.journal_layer.journal.entities_page.text = load_data["journal_entities"]
|
||||
else:
|
||||
print("Failed to parse Loading Data.")
|
||||
|
||||
@@ -9,19 +9,23 @@ var symptoms_detailed: Array[Array] = [
|
||||
["SUICIDAL IDEATIONS\nPersistent thoughts about ending one's own life",
|
||||
"PERSECUTORY DELUSIONS\nFalse conviction of being targeted or harmed",
|
||||
"UNNATURAL BEHAVIOUR\nSigns or marks of non-human nature",
|
||||
"AUDITORY HALLUCINATIONS\nFalse perceptions of external sound"],
|
||||
"INSOMNIA\nUnrestorative sleep due to difficulties falling or staying asleep"],
|
||||
|
||||
["MEGALOMANIAC DELUSIONS\nFalse exaggeration of self-importance or power",
|
||||
"SOMATIC HALLUCINATIONS\nFalse sensations, from inside the body or on the skin"],
|
||||
["AUDITORY HALLUCINATIONS\nFalse perceptions of external sound"],
|
||||
|
||||
["MYSTICAL DELUSIONS\nFalse certainty of spiritual, divine connection",
|
||||
"THOUGHT INSERTION\nFalse conviction of having alien thoughts implanted in one's brain"],
|
||||
["SOMATIC HALLUCINATIONS\nFalse sensations from inside the body or on the skin"],
|
||||
|
||||
["CHEMOSENSORY HALLUCINATIONS\nFalse perceptions of smell or taste",
|
||||
"DISORGANIZED SPEECH\nIncoherent sentences, words and speech"],
|
||||
["MYSTICAL DELUSIONS\nFalse certainty of spiritual, divine connection"],
|
||||
|
||||
["HETERO-AGRESSIVE BEHAVIOUR\nExcessive hostility, verbal agression, threats",
|
||||
"DISSOCIATIVE IDENTITY\nPresence of two or more alternate personalities"]
|
||||
["MEGALOMANIAC DELUSIONS\nFalse exaggeration of self-importance or power"],
|
||||
|
||||
["THOUGHT INSERTION\nFalse belief of having thoughts implanted by an external source"],
|
||||
|
||||
["CHEMOSENSORY HALLUCINATIONS\nFalse perceptions of smell or taste"],
|
||||
|
||||
["SELF-MUTILATION\nDeliberate self-harming behaviour"],
|
||||
|
||||
["VISUAL HALLUCINATIONS\nFalse perceptions of visual stimuli"],
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ extends Node
|
||||
var dialog_tree: Dictionary
|
||||
var marker: Array[int]
|
||||
var dialogue_resource: Resource
|
||||
var dialogue_start: String
|
||||
|
||||
#Patient attributes
|
||||
var texture := TextureRect.new()
|
||||
@@ -13,6 +14,8 @@ var emotions : Dictionary
|
||||
var abnormal: bool
|
||||
var id : String
|
||||
var type: String
|
||||
var age: String
|
||||
var symptoms: Array
|
||||
|
||||
#Patient file
|
||||
var file_text : String
|
||||
@@ -41,10 +44,12 @@ var patients_seen = []
|
||||
var its_seen = []
|
||||
var ite_seen = []
|
||||
|
||||
|
||||
#Supervisor file path
|
||||
var supervisor_name = "siveyan"
|
||||
|
||||
#Spy
|
||||
var spy: Node
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
|
||||
@@ -56,10 +61,14 @@ func _ready() -> void:
|
||||
og_patient_list.resize(len(symptoms_arrays))
|
||||
patient_list.resize(len(symptoms_arrays))
|
||||
its_list = og_its_list
|
||||
ite_list = og_ite_list
|
||||
ite_list = og_ite_list
|
||||
|
||||
original_color = texture.modulate #Saving original modulation color to reset it after modification
|
||||
|
||||
#Adding the spy
|
||||
spy = Spy.new()
|
||||
add_child(spy)
|
||||
|
||||
|
||||
func build_dialog_tree(tree_model: Array[int]) -> Dictionary: #Builds the dialog tree for each dialogue
|
||||
|
||||
@@ -101,11 +110,15 @@ func load_patient(patient_info: Dictionary): #Loads new patient
|
||||
|
||||
#Setting up Patient File
|
||||
var patient_name = config.get_value("", "name")
|
||||
var age = config.get_value("", "age")
|
||||
age = config.get_value("", "age")
|
||||
var profession = config.get_value("", "profession")
|
||||
var psychiatric_assessment = config.get_value("", "psychiatric_assessment")
|
||||
file_text = "NAME: " + patient_name + "\nAGE: " + age + "\n\nPROFESSION: " + profession + "\n\nPRE-SCREENING PSYCHIATRIC ASSESSMENT:\n\n" + "[color=orange_red]" + psychiatric_assessment + "[/color]"
|
||||
|
||||
var symptom_list = config.get_value("", "psychiatric_assessment").split("\n", false)
|
||||
symptoms = symptom_list
|
||||
symptom_list = config.get_value("", "abnormal_symptoms").split("\n", false)
|
||||
symptoms.append_array(symptom_list)
|
||||
#Randomizing abnormal status if required
|
||||
var status = config.get_value("", "status")
|
||||
match status:
|
||||
@@ -234,6 +247,7 @@ func next_patient() -> Dictionary: #Decides next patient ID
|
||||
var next_id: String
|
||||
var next_type: String
|
||||
|
||||
dialogue_start = "start"
|
||||
match Globals.floor_count:
|
||||
-2:
|
||||
if Globals.patient_count == 0:
|
||||
@@ -254,8 +268,9 @@ func next_patient() -> Dictionary: #Decides next patient ID
|
||||
next_id = generate_next_id(next_type)
|
||||
-5:
|
||||
if Globals.patient_count == 0:
|
||||
next_id = "patient_51"
|
||||
next_id = "patient_spy"
|
||||
next_type = "patient"
|
||||
dialogue_start = "encounter_1"
|
||||
else:
|
||||
next_type = next_patient_type()
|
||||
next_id = generate_next_id(next_type)
|
||||
|
||||
@@ -23,7 +23,6 @@ extends Control
|
||||
|
||||
var main: Node
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
|
||||
#Referencing main node
|
||||
@@ -110,7 +109,7 @@ func _on_call_next_patient_pressed(): #Brings in next patient and sets up the de
|
||||
#Starting Dialogue and hiding console screen
|
||||
computer.screen.hide()
|
||||
console_screen.hide()
|
||||
main.start_balloon("screening", "patient", Patient.dialogue_resource, "start")
|
||||
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:
|
||||
@@ -148,7 +147,10 @@ func _on_decision_made(choice: String):
|
||||
func _on_clear_patient(choice:String):
|
||||
|
||||
# Updating middle screen info and accurate_diagnoses value
|
||||
if (Patient.abnormal == true and choice == "terminate") or (Patient.abnormal == false and choice == "release"):
|
||||
if Patient.spy.order and Patient.spy.spy_check():
|
||||
Globals.accurate_diagnoses += 1
|
||||
Patient.spy.count += 1
|
||||
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
|
||||
@@ -192,7 +194,7 @@ func _on_clear_patient(choice:String):
|
||||
func _on_color_change(color: String): #Modulating backroom and patient colors
|
||||
|
||||
var new_color: Color
|
||||
|
||||
|
||||
match color:
|
||||
"red":
|
||||
new_color = Color(1,0.1,0.1,1)
|
||||
@@ -227,17 +229,12 @@ func descend_floor(): #Descends to next floor
|
||||
|
||||
for node in [middle_screen, computer, console_screen, journal_layer]:
|
||||
node.reset() #Resetting the scene
|
||||
|
||||
|
||||
#Autosaving
|
||||
main.save_game(0)
|
||||
|
||||
#Selecting next event
|
||||
event_manager()
|
||||
main.save_game(0) #Autosaving
|
||||
event_manager() #Selecting next event
|
||||
|
||||
|
||||
#Resets to initial state
|
||||
func reset():
|
||||
for node in [patient, supervisor, journal_layer, computer, console_screen, middle_screen, release, terminate,
|
||||
for node in [patient, supervisor, Patient.spy, journal_layer, computer, console_screen, middle_screen, release, terminate,
|
||||
green_button, red_button, room_assets]:
|
||||
node.reset()
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
extends Node
|
||||
|
||||
class_name Spy
|
||||
|
||||
var threshold: String #Spy order's age threshold
|
||||
var symptoms: Array #Spy order's symptoms
|
||||
var order: bool #Checks if there is an ongoing spy order
|
||||
var count: int #Keeps count of the spy successful orders
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
#Randomization of the spy's directives
|
||||
func spy_rand():
|
||||
|
||||
threshold = ["BELOW", "ABOVE"].pick_random()
|
||||
|
||||
var floor_index = -Globals.floor_count -1
|
||||
var available_symptoms : Array
|
||||
|
||||
for i in range(floor_index+1): #Takes into account only the known symptoms
|
||||
available_symptoms.append_array(Patient.symptoms_arrays[i])
|
||||
print("SPY Symptoms list: " + str(available_symptoms))
|
||||
|
||||
available_symptoms.shuffle()
|
||||
print("SPY Symptoms list shuffled: " + str(available_symptoms))
|
||||
|
||||
symptoms = available_symptoms.slice(0,2) #Returns 2 random symptoms
|
||||
print("SPY Threshold selected: " + threshold)
|
||||
print("SPY Symptoms selected: " + str(symptoms))
|
||||
|
||||
|
||||
#Checks if a patient meets the spy order's requirements and returns true or false
|
||||
func spy_check():
|
||||
|
||||
var requirements_passed = true
|
||||
|
||||
match threshold: #Check the age requirement
|
||||
"BELOW":
|
||||
if int(Patient.age) > 40:
|
||||
requirements_passed = false
|
||||
"ABOVE":
|
||||
if int(Patient.age) < 40:
|
||||
requirements_passed = false
|
||||
|
||||
for symptom in symptoms: #Check the symptoms requirement
|
||||
if Patient.symptoms.has(symptom) == false:
|
||||
requirements_passed = false
|
||||
print("Symptom not present in Patient: " + str(symptom))
|
||||
|
||||
print("Requirements_passed: " + str(requirements_passed))
|
||||
return requirements_passed
|
||||
|
||||
|
||||
#Resets to initial state
|
||||
func reset():
|
||||
threshold = ""
|
||||
symptoms.clear()
|
||||
order = false
|
||||
@@ -0,0 +1 @@
|
||||
uid://dyjxgv18p3e03
|
||||
Reference in New Issue
Block a user