From d2d613294a9502ad381fcb292cd179e60de84b25 Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Fri, 15 May 2026 13:13:36 -0400 Subject: [PATCH] Fixed Read Mind Runtimes (#22390) Fixes a runtime error with Read Mind that was caused by byond having a different order of operations for ternary operators than I normally expect. Seriously it's kinda dumb. --- code/modules/psionics/abilities/read_mind.dm | 31 +++++++++++-------- .../hellfirejag-read-mind-tweaks.yml | 4 +++ 2 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 html/changelogs/hellfirejag-read-mind-tweaks.yml diff --git a/code/modules/psionics/abilities/read_mind.dm b/code/modules/psionics/abilities/read_mind.dm index 0db11f9d014..4d5dcf1c19b 100644 --- a/code/modules/psionics/abilities/read_mind.dm +++ b/code/modules/psionics/abilities/read_mind.dm @@ -47,27 +47,32 @@ if(!safe_mode) question = tgui_input_text(user, "Ask your question.", "Read Mind", timeout = 1 MINUTE) if((!safe_mode && !question) || user.incapacitated()) + to_chat(user, SPAN_WARNING("Your focus slips, and the mental connection dissolves.")) + user.visible_message(SPAN_WARNING("[user] falters, their concentration broken.")) return TRUE to_chat(user, SPAN_NOTICE(\ - target_sensitivity >= PSI_RANK_SENSITIVE \ - ? "Your consciousness mingles with [target]'s thoughts, imploring them to share an answer: [question]"\ - : "You dip your mentality into the surface layer of \the [target]'s mind, seeking an answer: [question]")) + safe_mode \ + ? (target_sensitivity >= PSI_RANK_SENSITIVE \ + ? "You slip into [target]'s mind, brushing the surface of their thoughts."\ + : "You dip your mentality into the surface layer of \the [target]'s mind, seeking whatever thoughts drift to the top.")\ + : (target_sensitivity >= PSI_RANK_SENSITIVE \ + ? "Your consciousness mingles with [target]'s thoughts, imploring them to share an answer: [question]"\ + : "You dip your mentality into the surface layer of \the [target]'s mind, seeking an answer: [question]"))) to_chat(target, SPAN_NOTICE("Your mind is compelled to answer." \ - + safe_mode \ + + (safe_mode \ /* If the target wins the psi-sensitivity check, they're prompted to say whatever they want.*/\ ? "What are you thinking about, currently?" \ /* And if the caster wins, the target is forced to answer a specific question.*/\ : "You cannot avoid the following question, and must answer truthfully: " \ - + "[question]")) + + "[question]"))) // Attempt to get an answer from the target. var/answer = tgui_input_text(\ target,\ - "[question]\n"\ - + safe_mode \ - ? "You must answer with what you are currently thinking about.\n" \ - : "You must answer truthfully.\n"\ + (safe_mode \ + ? "You must answer with what you are currently thinking about.\n" \ + : "[question]\nYou must answer truthfully.\n")\ + "You have one minute to type a response.", \ "Read Mind", \ timeout = 1 MINUTE) @@ -91,13 +96,13 @@ to_chat(target, SPAN_NOTICE("You are compelled to answer [user] with: [answer]")) msg_admin_attack("[key_name(user)] read mind of [key_name(target)] " \ - + safe_mode \ + + (safe_mode \ ? "skimming their surface thoughts " \ - : "forcing them to answer truthfully with question: \"[question]\" " \ + : "forcing them to answer truthfully with question: \"[question]\" ") \ + "and " \ - + answer \ + + (answer \ ? "got answer: \"[answer]\"." \ - : "got no answer.") + : "got no answer.")) // We take the logistic curve of the psi_sensitivity in order to create a double asymptote that confines the effects without requiring truncating to 0, or setting a maximum. // Maximums occur at +/- infinity. While normal values roughly around 0.5x occur very close to +/- 1. diff --git a/html/changelogs/hellfirejag-read-mind-tweaks.yml b/html/changelogs/hellfirejag-read-mind-tweaks.yml new file mode 100644 index 00000000000..9ab145cae67 --- /dev/null +++ b/html/changelogs/hellfirejag-read-mind-tweaks.yml @@ -0,0 +1,4 @@ +author: Hellfirejag +delete-after: True +changes: + - bugfix: "Fixed runtime errors preventing Read Mind from working."