From 881331e2320653539d35939c9af65c3ad024ef71 Mon Sep 17 00:00:00 2001 From: Noka Date: Mon, 23 Apr 2018 09:06:55 -0500 Subject: [PATCH 1/2] test (#37263) --- code/datums/brain_damage/phobia.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/datums/brain_damage/phobia.dm b/code/datums/brain_damage/phobia.dm index 5e988d0b1c..76f759294b 100644 --- a/code/datums/brain_damage/phobia.dm +++ b/code/datums/brain_damage/phobia.dm @@ -71,7 +71,8 @@ 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) - var/reg = regex("\[^\\l\][REGEX_QUOTE(word)]*s\[^\\l\]") + var/reg = regex("(\\b|\\A)[REGEX_QUOTE(word)]'?s*(\\b|\\Z)", "i") + if(findtext(raw_message, reg)) addtimer(CALLBACK(src, .proc/freak_out, null, word), 10) //to react AFTER the chat message break @@ -79,7 +80,8 @@ /datum/brain_trauma/mild/phobia/on_say(message) for(var/word in trigger_words) - var/reg = regex("\[^\\l\][REGEX_QUOTE(word)]*s\[^\\l\]") + var/reg = regex("(\\b|\\A)[REGEX_QUOTE(word)]'?s*(\\b|\\Z)", "i") + if(findtext(message, reg)) to_chat(owner, "You can't bring yourself to say the word \"[word]\"!") return ""