Merge pull request #6163 from Citadel-Station-13/upstream-merge-36457

[MIRROR] Fixes phobia word recognition
This commit is contained in:
LetterJay
2018-03-31 06:20:33 -05:00
committed by GitHub
2 changed files with 20 additions and 12 deletions
+5 -3
View File
@@ -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, "<span class='warning'>You can't bring yourself to say the word \"[word]\"!</span>")
return ""
return message
@@ -114,4 +116,4 @@
owner.dizziness += 10
owner.confused += 10
owner.Jitter(10)
owner.stuttering += 10
owner.stuttering += 10