Weighted Random Selection

This commit is contained in:
Maurane
2026-01-22 15:31:25 +01:00
parent b7c329bbde
commit e4a7d6beac
13 changed files with 365 additions and 204 deletions
+34 -3
View File
@@ -2,6 +2,8 @@ extends CanvasLayer
@onready var next = $UI/SkipContainer/NextButton
@onready var confirmation_mask = $ConfirmationMask
@onready var journal_layer = $JournalLayer
@onready var journal_symptoms = $JournalLayer/JournalOpen/JournalMargin/PageArea/RightPage/Symptoms
#Signals for progressing through slides
signal next_request
@@ -48,6 +50,26 @@ var resolution_list: Dictionary = {
7: Vector2i(1920,1080)
}
#Journal Settings
var symptoms_detailed: Array[Array] = [
["SUICIDAL IDEATIONS\nPersistent thoughts about ending one's own life",
"PERSECUTORY DELUSIONS\nFalse conviction of being targeted or harmed",
"MANIA\nExcessively elevated mood and increased energy",
"AUDITORY HALLUCINATIONS\nFalse perceptions of external sound"],
["MEGALOMANIAC DELUSIONS\nFalse exaggeration of self-importance or power",
"PANIC ATTACKS\nAcute episodes of severe anxiety"],
["MYSTICAL DELUSIONS\nFalse certainty of spiritual, divine connection",
"CENESTHETIC HALLUCINATIONS\nFalse internal bodily sensations"],
["HAPTIC HALLUCINATIONS\nFalse perceptions of touch",
"SELF-MUTILATION\nDeliberate injury to one's own body"],
["HETERO-AGRESSIVE BEHAVIOUR\nExcessive hostility, verbal agression, threats",
"VISUAL HALLUCINATIONS\nFalse perceptions of visual stimuli"]
]
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
@@ -83,7 +105,7 @@ func _ready() -> void:
$UI/Load/MarginContainer/VBoxContainer/LoadSlot3.pressed.connect(func(): _on_load_slot_pressed(3))
$UI/Load/MarginContainer/VBoxContainer/LoadSlot4.pressed.connect(func(): _on_load_slot_pressed(4))
#Text settings signals
#Text settings signals
text_slider.value_changed.connect(_on_text_value_changed)
auto_slider.value_changed.connect(_on_auto_value_changed)
autoplay.pressed.connect(_on_autoplay_pressed)
@@ -93,11 +115,11 @@ func _ready() -> void:
text_counter.text = "[center]" + str(snapped((text_speed * 1000), 1)) + " ms/letter[/center]"
auto_counter.text = "[center]" + str(snapped(auto_speed, 0.01)) + " s delay[/center]"
#Initializes the auto-advance to false
#Initializes the auto-advance to false
autoplay.button_pressed = false
auto_mask.visible = true
#Screen settings signals and initialization
#Screen settings signals and initialization
display_button.item_selected.connect(_on_display_selected)
resolution_button.item_selected.connect(_on_resolution_selected)
for index in resolution_list:
@@ -322,3 +344,12 @@ func _on_resolution_selected(index: int):
DisplayServer.window_set_size(resolution_size)
await get_tree().process_frame #Waits process_frame to avoid bugs
DisplayServer.window_set_position(top_left)
func update_journal(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