entity 01 WIP

This commit is contained in:
Maurane
2026-03-06 17:38:16 +01:00
parent fddd10f5ff
commit 257c8d0ecc
393 changed files with 1820 additions and 1438 deletions
+12
View File
@@ -0,0 +1,12 @@
shader_type canvas_item;
uniform sampler2D noise_tex;
uniform float progress : hint_range(0.0, 1.0) = 0.0;
uniform float softness : hint_range(0.001, 0.2) = 0.05;
void fragment() {
vec4 img = texture(TEXTURE, UV);
float noise = texture(noise_tex, UV).r;
float alpha = 1.0 - smoothstep(progress - softness, progress + softness, noise);
COLOR = vec4(img.rgb, img.a * alpha);
}
+1
View File
@@ -0,0 +1 @@
uid://dulfbro84cj4k
+63
View File
@@ -0,0 +1,63 @@
extends TextureRect
@onready var mat := material as ShaderMaterial
signal reveal_done
signal hide_done
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
#Hiding
hide()
#Setting up shader
randomize()
#Noise setup
var noise := FastNoiseLite.new()
noise.noise_type = FastNoiseLite.TYPE_SIMPLEX
noise.frequency = 20.0
noise.seed = randi()
var noise_tex := NoiseTexture2D.new()
noise_tex.noise = noise
noise_tex.width = 1920
noise_tex.height = 1080
noise_tex.seamless = true
mat.set_shader_parameter("noise_tex", noise_tex)
#Revealing game over in a noise spray
func reveal_spray():
show()
mat.set_shader_parameter("progress", 0.0)
var tween = create_tween()
tween.tween_method(set_progress, 0.0, 1.0, 3.0) \
.set_trans(Tween.TRANS_SINE) \
.set_ease(Tween.EASE_OUT)
await tween.finished
reveal_done.emit()
#hiding game over in a hiding spray
func hide_spray():
mat.set_shader_parameter("progress", 1.0)
var tween = create_tween()
tween.tween_method(set_progress, 1.0, 0.0, 3.0) \
.set_trans(Tween.TRANS_SINE) \
.set_ease(Tween.EASE_OUT)
await tween.finished
hide()
hide_done.emit()
#Progressing the reveal/hide
func set_progress(value: float):
mat.set_shader_parameter("progress", value)
@@ -0,0 +1 @@
uid://bclpgx10sb5ug
+34
View File
@@ -0,0 +1,34 @@
extends Control
@onready var background = $Background
@onready var back_to_menu = $UI/HBoxContainer/BackToMainMenu
@onready var reload_checkpoint = $UI/HBoxContainer/ReloadCheckpoint
@onready var message = $UI/Message
@onready var animation_player = $AnimationPlayer
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
#Resets to initial state
reset()
#Reveals the game over screen
func reveal():
#Reveals the background image first
show()
background.show()
background.reveal_spray()
await background.reveal_done
#Reveals the text and buttons afterwards
for node in [message, back_to_menu, reload_checkpoint]:
node.modulate.a = 0.0
node.show()
animation_player.play("fade_in")
#Resets to initial state
func reset():
for node in [background, back_to_menu, reload_checkpoint, message]:
node.hide()
hide()
@@ -0,0 +1 @@
uid://bo4d1ev60val6
+1
View File
@@ -7,6 +7,7 @@ extends CanvasLayer
#GameOver Scenes
@onready var its_game_over = $ITSGameOverControl
@onready var entity_game_over = $EntityGameOverControl
#Preloading Confirmation dialog
var confirmation_dialog = preload("res://Scenes/UI/confirmation_dialog.tscn")
+73 -3
View File
@@ -1,11 +1,10 @@
[gd_scene load_steps=33 format=3 uid="uid://dy40jygog8t3k"]
[gd_scene load_steps=35 format=3 uid="uid://dy40jygog8t3k"]
[ext_resource type="Script" uid="uid://c0q67t6m1i4dl" path="res://Scenes/UI/ui.gd" id="1_mg12k"]
[ext_resource type="FontFile" uid="uid://dv8ppra5tgn1t" path="res://Art/Fonts/PixelatedEleganceRegular-ovyAA.ttf" id="2_vb7na"]
[ext_resource type="Texture2D" uid="uid://l7786mlmvet8" path="res://Art/UI/menu_gear.png" id="3_ibj64"]
[ext_resource type="Script" uid="uid://bru53a1mvu0t2" path="res://Scenes/UI/its_game_over_control.gd" id="4_duuxe"]
[ext_resource type="Script" uid="uid://dxyi7st0g4hdf" path="res://Scenes/UI/pause_menu.gd" id="4_s3gqk"]
[ext_resource type="Shader" uid="uid://n2f3kv6b7k2o" path="res://Scenes/UI/its_game_over.gdshader" id="5_duuxe"]
[ext_resource type="Script" uid="uid://cvcuwg4hha1vr" path="res://Scenes/UI/submenu.gd" id="5_pmm6b"]
[ext_resource type="Texture2D" uid="uid://qodbgs7d5mqs" path="res://Art/UI/its_game_over.png" id="6_duuxe"]
[ext_resource type="Script" uid="uid://cjft0c0ui8yhs" path="res://Scenes/UI/its_game_over_background.gd" id="6_jfwrg"]
@@ -14,6 +13,9 @@
[ext_resource type="Script" uid="uid://be2ypveoa0hf5" path="res://Scenes/UI/masks.gd" id="8_mbl0m"]
[ext_resource type="Script" uid="uid://c7r7iaoghw8lh" path="res://Scenes/UI/settings.gd" id="9_h6tq4"]
[ext_resource type="Script" uid="uid://dbjei4d2lfwnb" path="res://Scenes/UI/fading_mask.gd" id="9_s3gqk"]
[ext_resource type="Shader" uid="uid://dulfbro84cj4k" path="res://Scenes/UI/entity_game_over.gdshader" id="12_56q1t"]
[ext_resource type="Script" uid="uid://bo4d1ev60val6" path="res://Scenes/UI/entity_game_over_control.gd" id="15_fevae"]
[ext_resource type="Script" uid="uid://bclpgx10sb5ug" path="res://Scenes/UI/entity_game_over_background.gd" id="16_ny3ap"]
[sub_resource type="Animation" id="Animation_n85x3"]
length = 0.001
@@ -211,7 +213,7 @@ _data = {
}
[sub_resource type="ShaderMaterial" id="ShaderMaterial_duuxe"]
shader = ExtResource("5_duuxe")
shader = ExtResource("12_56q1t")
shader_parameter/progress = 0.0
shader_parameter/softness = 0.05
@@ -976,3 +978,71 @@ text = "RELOAD LATEST CHECKPOINT"
custom_minimum_size = Vector2(600, 100)
layout_mode = 2
text = "BACK TO MAIN MENU"
[node name="EntityGameOverControl" type="Control" parent="."]
visible = false
z_index = 12
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme = SubResource("Theme_mbl0m")
script = ExtResource("15_fevae")
[node name="AnimationPlayer" type="AnimationPlayer" parent="EntityGameOverControl"]
root_node = NodePath("../UI")
libraries = {
&"": SubResource("AnimationLibrary_mbl0m")
}
[node name="Background" type="TextureRect" parent="EntityGameOverControl"]
material = SubResource("ShaderMaterial_duuxe")
layout_mode = 0
offset_right = 1920.0
offset_bottom = 1080.0
texture = ExtResource("6_duuxe")
script = ExtResource("16_ny3ap")
[node name="UI" type="VBoxContainer" parent="EntityGameOverControl"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -625.0
offset_top = -175.0
offset_right = 625.0
offset_bottom = 175.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 100
alignment = 1
[node name="Message" type="RichTextLabel" parent="EntityGameOverControl/UI"]
modulate = Color(1, 1, 1, 0)
custom_minimum_size = Vector2(200, 150)
layout_mode = 2
theme_override_font_sizes/normal_font_size = 100
bbcode_enabled = true
text = "[color=dark_red]YOUR MIND HAS DISSOLVED.[/color]"
horizontal_alignment = 1
vertical_alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="EntityGameOverControl/UI"]
layout_mode = 2
theme_override_constants/separation = 50
alignment = 1
[node name="ReloadCheckpoint" type="Button" parent="EntityGameOverControl/UI/HBoxContainer"]
custom_minimum_size = Vector2(600, 100)
layout_mode = 2
text = "RELOAD LATEST CHECKPOINT"
[node name="BackToMainMenu" type="Button" parent="EntityGameOverControl/UI/HBoxContainer"]
custom_minimum_size = Vector2(600, 100)
layout_mode = 2
text = "BACK TO MAIN MENU"
+7 -5
View File
@@ -8,10 +8,7 @@ var its_patient_count : int = 0
var accurate_diagnoses : int = 0
var diagnoses_quota : int = 1
var daily_patient_limit : int = 3
var patient_list = ["42", "43", "44", "45", "46", "47", "48", "49", "50", "51"]
var patients_seen = []
var its_seen = []
var it_seen = []
var patient_list = []
var event_index = 0
#Variables for UI
@@ -54,7 +51,12 @@ func _ready() -> void:
terminate_messages[1] = Globals.colorize("- TERMINATING SUBJECT -", "orange_red")
terminate_messages[2] = "EVALUATION RECORDED" + "\n\nPATIENT STATUS: " + Globals.colorize("ABNORMAL", "red") + "\n\nUPDATING DATABASE...\n\n" + Globals.colorize("INITIATING TERMINATION SEQUENCE", "orange_red")
pass
#Generating patient list
Globals.patient_list.clear()
var patient_id : String
for i in range(42,52):
patient_id = "patient_" + str(i)
Globals.patient_list.append(patient_id)
#Gets the current time and day of the year
+19 -10
View File
@@ -38,6 +38,8 @@ func _ready() -> void:
UI.its_game_over.back_to_menu.pressed.connect(self._on_main_menu_pressed)
UI.its_game_over.reload_checkpoint.pressed.connect(self.load_game.bind(0))
UI.entity_game_over.back_to_menu.pressed.connect(self._on_main_menu_pressed)
UI.entity_game_over.reload_checkpoint.pressed.connect(self.load_game.bind(0))
Globals.character_label_color_change.connect(self._on_character_label_color_change)
Globals.start_balloon.connect(self.start_balloon)
@@ -59,7 +61,13 @@ func _on_new_game_pressed():
Globals.accurate_diagnoses = 0
Globals.diagnoses_quota = 1
Globals.daily_patient_limit = 6
Globals.patients_seen.clear()
for i in range(len(Patient.patient_list)):
Patient.patient_list[i] = Patient.og_patient_list[i]
Patient.its_list = Patient.og_its_list
Patient.entities_list = Patient.og_entities_list
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
@@ -120,10 +128,10 @@ func save_game(save_slot_number:int):
"daily_patient_limit": Globals.daily_patient_limit,
"patient_list": Patient.patient_list,
"its_list": Patient.its_list,
"it_list": Patient.it_list,
"entities_list": Patient.entities_list,
"patients_seen": Patient.patients_seen,
"its_seen": Patient.its_seen,
"it_seen": Patient.it_seen,
"entities_seen": Patient.entities_seen,
"save_date": Globals.get_save_date()
}
#Creating save file
@@ -141,7 +149,7 @@ func save_game(save_slot_number:int):
var save_slot = UI.pause_menu.save.save_slot[save_slot_number]
var load_slot = UI.pause_menu.load.load_slot[save_slot_number]
save_slot.text = "FLOOR " + str(save_data["floor_count"]) + "\nSAVE DATE : " + str(save_data["save_date"])
save_slot.text = "FLOOR " + str(int(save_data["floor_count"])) + "\nSAVE DATE : " + str(save_data["save_date"])
load_slot.text = save_slot.text
@@ -163,7 +171,7 @@ func load_game(load_slot_number:int):
file.close()
var load_data = JSON.parse_string(json_string)
if typeof(load_data) == 27: #Checks if loaded data is a Dictionary
if load_data is Dictionary: #Checks if loaded data is a Dictionary
print("Loaded save: " + str(load_data))
Globals.day_count = load_data["day_count"]
Globals.floor_count = load_data["floor_count"]
@@ -172,13 +180,14 @@ func load_game(load_slot_number:int):
Globals.accurate_diagnoses = load_data["accurate_diagnoses"]
Globals.diagnoses_quota = load_data["diagnoses_quota"]
Globals.daily_patient_limit = load_data["daily_patient_limit"]
Patient.patient_list = load_data["patient_list"]
Patient.patient_list.clear()
Patient.patient_list.append_array(load_data["patient_list"])
print (Patient.patient_list)
Patient.its_list = load_data["its_list"]
Patient.it_list = load_data["it_list"]
Patient.entities_list = load_data["entities_list"]
Patient.patients_seen = load_data["patients_seen"]
Patient.its_seen = load_data["its_seen"]
Patient.it_seen = load_data["it_seen"]
Patient.update_patient_list()
Patient.entities_seen = load_data["entities_seen"]
else:
print("Failed to parse Loading Data.")
@@ -228,7 +237,7 @@ func update_slots():
if typeof(load_data) == 27: #Checks if loaded data is a Dictionary
#Updates save and load slots texts
print("Initializing save slot #" + str(save_number) + " : " + str(load_data))
save_slot.text = "FLOOR " + str(load_data["floor_count"]) + "\nSAVE DATE : " + str(load_data["save_date"])
save_slot.text = "FLOOR " + str(int(load_data["floor_count"])) + "\nSAVE DATE : " + str(load_data["save_date"])
load_slot.text = save_slot.text
else:
print("Failed to parse Loading Data.")
+78 -99
View File
@@ -12,6 +12,7 @@ var original_color: Color
var emotions : Dictionary
var abnormal: bool
var id : String
var type: String
#Patient file
var file_text : String
@@ -29,8 +30,11 @@ var og_patient_list : Array[Dictionary]
var patient_list: Array[Dictionary]
var og_its_list = ["its_01"]
var its_list = []
var og_it_list = ["itl"]
var it_list = []
var og_entities_list = ["entity_01"]
var entities_list = []
var patients_seen = []
var its_seen = []
var entities_seen = []
#Supervisor file path
@@ -47,7 +51,7 @@ func _ready() -> void:
og_patient_list.resize(len(symptoms_arrays))
patient_list.resize(len(symptoms_arrays))
its_list = og_its_list
it_list = og_it_list
entities_list = og_entities_list
original_color = texture.modulate #Saving original modulation color to reset it after modification
@@ -64,32 +68,37 @@ func build_dialog_tree(tree_model: Array[int]) -> Dictionary: #Builds the dialog
return tree
func load_patient(patient_id):
func load_patient(patient_info: Dictionary): #Loads new patient
#Storing patient info
id = patient_info["id"]
type = patient_info["type"]
#Loading Subject resources
var file_path: String
id = patient_id
#Loading Patient Files
var config := ConfigFile.new()
file_path = "res://Dialogues/Patients/patient_" + patient_id + "_file.cfg"
config.load(file_path)
match type: #Setting right file path depending on subject type
"patient":
file_path = "Patients/"
"its":
file_path = "ITS/"
"entity":
file_path = "Entities/"
"supervisor":
file_path = "Supervisors/"
config.load("res://Dialogues/" + file_path + id + "_file.cfg") #Loading Subject file
dialogue_resource = load("res://Dialogues/" + file_path + id + ".dialogue") #Loading Dialogue Resource
load_emotions(config, "res://Art/Subjects/" + file_path + id + "/" + id + "_") #Loading Subject emotions
#Setting up Patient File
var patient_name = config.get_value("", "name")
var 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]"
file_path = "res://Art/Patients/patient_" + patient_id + "/patient_" + patient_id + "_"
load_emotions(config, file_path)
#Loading Dialogue Resource
file_path = "res://Dialogues/Patients/patient_" + patient_id + ".dialogue"
dialogue_resource = load(file_path)
#Randomizing abnormal status if required
var status = config.get_value("", "status")
match status:
@@ -143,7 +152,7 @@ func sort_patients():
#Loads symptoms for each patient
patient_symptoms.clear()
file_path = "res://Dialogues/Patients/patient_" + patient_id + "_file.cfg"
file_path = "res://Dialogues/Patients/" + patient_id + "_file.cfg"
config.load(file_path)
symptom_list = config.get_value("", "psychiatric_assessment").split("\n", false)
patient_symptoms = symptom_list
@@ -176,7 +185,7 @@ func sort_patients():
func weighted_random(patients: Dictionary):
#Calculating total weight
var total_weight : int
var total_weight : int = 0
for weight in patients.values():
total_weight += weight
print("Total weight: " + str(total_weight))
@@ -184,7 +193,7 @@ func weighted_random(patients: Dictionary):
var r = randf() * total_weight
print("r :" + str(r))
var weight_sum : int
var weight_sum : int = 0
for patient_id in patients:
weight_sum += patients[patient_id]
if weight_sum >= r:
@@ -193,74 +202,44 @@ func weighted_random(patients: Dictionary):
return null
func random_patient_id() -> String: #Generates a patient ID
#Generating patient_id
var floor_index = -Globals.floor_count -1
print("Floor Index: " + str(floor_index))
var patient_id = weighted_random(patient_list[floor_index]) #Picks a random patient depending on floor, with weighted odds
#Removes picked patient from patients list
for i in range(len(patient_list)):
if len(patient_list[i]) > 1:
patient_list[i].erase(patient_id)
print("Updated Floor " + str(i) + " patient_list: " + str(patient_list[i]))
return patient_id
func random_its_id() -> String: #Generates an ITS patient ID
#Generating ITS patient ID
var its_id = its_list.pick_random()
print("ITS selected: " + str(its_id))
#Remove picked ITS patient from ITS patient list
if len(its_list) > 1:
its_list.erase(its_id)
print("Updated ITS Patient list: " + str(its_list))
return its_id
func random_it_id():
#Generating it_patient_id
var floor_index = -Globals.floor_count -1
print("Floor Index: " + str(floor_index))
var it_id = it_list[floor_index].pick_random() #Picks a random patient depending on floor, with weighted odds
#Removes picked patient from patients list
for i in range(len(it_list)):
if len(it_list[i]) > 1:
it_list[i].erase(it_id)
print("Updated Floor " + str(i) + " it_list: " + str(it_list[i]))
return it_id
func generate_next_id(patient_type: String):
var floor_index = -Globals.floor_count -1
print("Floor Index: " + str(floor_index))
var next_id : String = ""
match patient_type:
"patient":
return random_patient_id()
next_id = weighted_random(patient_list[floor_index]) #Picks a random patient depending on floor, with weighted odds
print("Patient selected : " + str(next_id))
"its":
return random_its_id()
"it":
return random_it_id()
next_id = its_list.pick_random()
print("ITS selected: " + str(next_id))
"entity":
next_id = entities_list[floor_index].pick_random()
print("Entity selected: " + str(next_id))
return next_id
func next_patient() -> String: #Decides next patient ID
func next_patient() -> Dictionary: #Decides next patient ID
var next_patient_id: String
var next_id: String
var next_type: String
match Globals.floor_count:
-2:
if Globals.patient_count == 0:
next_patient_id = "its_00"
next_id = "its_00"
next_type = "its"
else:
next_patient_id = generate_next_id(next_patient_type())
next_type = next_patient_type()
next_id = generate_next_id(next_type)
_:
next_patient_id = generate_next_id(next_patient_type())
next_type = next_patient_type()
next_id = generate_next_id(next_patient_type())
return next_patient_id
return {"id": next_id, "type": next_type}
#Randomizes next patient type (human, it, its)
@@ -279,32 +258,32 @@ func next_patient_type():
_:
for i in range(int(floor(Globals.diagnoses_quota/4))):
type_list.append("its")
type_list.append("it")
type_list.append("entity")
for i in range(int(floor(Globals.diagnoses_quota/2))):
type_list.append("patient")
return type_list.pick_random()
func update_patient_list():
#Erasing patients already seen from patient lists
for patient_id in Globals.patients_seen:
for i in range(len(patient_list)):
if len(patient_list[i]) > 1:
patient_list[i].erase(patient_id)
#Erasing ITS patients already seen from ITS patient list
for its_id in Globals.its_seen:
if len(its_list) > 1:
its_list.erase(its_id)
#Erasing IT patients already seen from IT lists
for it_id in Globals.it_seen:
for i in range(len(it_list)):
if len(it_list[i]) > 1:
it_list[i].erase(it_id)
for j in range(len(patient_list)):
print("Loaded Floor " + str(j) + " list: " + str(patient_list[j]))
print("Loaded ITS list: " + str(its_list))
#Erases current patient ID from the corresponding patient list, so it can't be seen twice
func update_list():
print("Patient type: " + str(Patient.type))
match type:
"patient":
patients_seen.append(id)
for i in range(len(patient_list)):
if len(patient_list[i])>1:
patient_list[i].erase(id)
for j in range(len(patient_list)):
print("Updated Floor " + str(j) + " patient list: " + str(patient_list[j]))
"its":
its_seen.append(id)
if len(its_list)>1:
its_list.erase(id)
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]))
+1 -2
View File
@@ -151,8 +151,7 @@ func _on_clear_patient(choice:String):
Globals.accurate_diagnoses = 0 # Resetting to 0 if the player makes a wrong diagnosis
middle_screen.update(Globals.day_count, Globals.floor_count, Globals.accurate_diagnoses, Globals.diagnoses_quota)
Globals.patients_seen.append(Patient.id) #Updating Patient seens list
print("Updated patients seen list: " + str(Globals.patients_seen))
Patient.update_list() #Updating patient list
Globals.patient_count += 1 #Updating patient_count
#Showing second console message
+3 -3
View File
@@ -67,10 +67,10 @@ func dialogue(dialogue_start):
#Loading supervisor data
var config := ConfigFile.new()
var file_path = "res://Dialogues/Patients/prime_supervisor_" + Patient.supervisor_name + "_file.cfg"
var file_path = "res://Dialogues/Supervisors/supervisor_" + Patient.supervisor_name + "_file.cfg"
config.load(file_path)
file_path = "res://Art/Patients/prime_supervisor_" + Patient.supervisor_name + "/prime_supervisor_" + Patient.supervisor_name + "_"
file_path = "res://Art/Subjects/Supervisors/supervisor_" + Patient.supervisor_name + "/supervisor_" + Patient.supervisor_name + "_"
Patient.load_emotions(config, file_path)
#Showing the supervisor
@@ -80,7 +80,7 @@ func dialogue(dialogue_start):
await reveal_done
#Dialogue
var dialogue_resource = load("res://Dialogues/Patients/prime_supervisor_" + Patient.supervisor_name + ".dialogue")
var dialogue_resource = load("res://Dialogues/Supervisors/supervisor_" + Patient.supervisor_name + ".dialogue")
Globals.start_balloon.emit("screening", "supervisor", dialogue_resource, dialogue_start)
await DialogueManager.dialogue_ended