From 8b1cf5bfceec745208d8e259695470be173f2501 Mon Sep 17 00:00:00 2001 From: Tacolizard Date: Wed, 28 Mar 2018 11:43:07 -0700 Subject: [PATCH 1/2] Fixes phobia word recognition (#36457) * fix * Update phobia.json * add plural detection --- code/datums/brain_damage/phobia.dm | 8 +++++--- strings/phobia.json | 24 +++++++++++++++--------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/code/datums/brain_damage/phobia.dm b/code/datums/brain_damage/phobia.dm index a548af4e88..75c2f27631 100644 --- a/code/datums/brain_damage/phobia.dm +++ b/code/datums/brain_damage/phobia.dm @@ -71,14 +71,16 @@ if(!owner.can_hear() || world.time < next_scare) //words can't trigger you if you can't hear them *taps head* return message for(var/word in trigger_words) - if(findtext(raw_message, word)) + var/reg = regex(@"[^\l][REGEX_QUOTE(word)]*s[^\l]") + if(findtext(raw_message, reg)) addtimer(CALLBACK(src, .proc/freak_out, null, word), 10) //to react AFTER the chat message break return message /datum/brain_trauma/mild/phobia/on_say(message) for(var/word in trigger_words) - if(findtext(message, word)) + var/reg = regex(@"[^\l][REGEX_QUOTE(word)]*s[^\l]") + if(findtext(message, reg)) to_chat(owner, "You can't bring yourself to say the word \"[word]\"!") return "" return message @@ -114,4 +116,4 @@ owner.dizziness += 10 owner.confused += 10 owner.Jitter(10) - owner.stuttering += 10 \ No newline at end of file + owner.stuttering += 10 diff --git a/strings/phobia.json b/strings/phobia.json index d21e89aeb9..10fdbd9a0c 100644 --- a/strings/phobia.json +++ b/strings/phobia.json @@ -15,7 +15,7 @@ ], "security": [ - " sec ", + "sec", "security", "shitcurity", "baton", @@ -32,22 +32,22 @@ "chain of command", "heads of staff", "head of security", - " hos ", + "hos", "head of personnel", - " hop ", + "hop", "head of research", - " rd ", + "rd", "chief medical officer", - " cmo ", + "cmo", "chief engineer", - " ce ", + "ce", "captain", "deathsquad", "death squad", "alien", "xeno", "abductor", - " ayy", + "ayy", "gray", "grey", "ufo", @@ -66,7 +66,9 @@ "clown", "honk", "banana", - "slip" + "slip", + "slipped", + "slipping" ], "greytide": [ @@ -84,7 +86,11 @@ "lizard", "ligger", "hiss", - "wag" + "hissed", + "hissing", + "wag", + "wagged", + "wagging" ], "skeletons": [