Phobia trigger words are highlighted in pulsing red/black (#40885)

* Phobia trigger words are highlighted in pulsing red/black

* .

* !

* >:(

* fixes

* fixes 2
This commit is contained in:
XDTM
2018-10-23 14:49:05 +02:00
committed by AnturK
parent 362fee880f
commit 89fe484b6d
3 changed files with 25 additions and 8 deletions
+5 -4
View File
@@ -71,19 +71,20 @@
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("(\\b|\\A)[REGEX_QUOTE(word)]'?s*(\\b|\\Z)", "i")
var/regex/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
message = reg.Replace(message, "<span class='phobia'>$1</span>")
break
return message
/datum/brain_trauma/mild/phobia/on_say(message)
for(var/word in trigger_words)
var/reg = regex("(\\b|\\A)[REGEX_QUOTE(word)]'?s*(\\b|\\Z)", "i")
var/regex/reg = regex("(\\b|\\A)[REGEX_QUOTE(word)]'?s*(\\b|\\Z)", "i")
if(findtext(message, reg))
to_chat(owner, "<span class='warning'>You can't bring yourself to say the word \"[word]\"!</span>")
to_chat(owner, "<span class='warning'>You can't bring yourself to say the word \"<span class='phobia'>[word]</span>\"!</span>")
return ""
return message
@@ -396,10 +396,18 @@ h1.alert, h2.alert {color: #000000;}
.his_grace {color: #15D512; font-family: "Courier New", cursive, sans-serif; font-style: italic;}
.hypnophrase {color: #0d0d0d; font-weight: bold; animation: hypnocolor 1500ms infinite;}
@keyframes hypnocolor {
0% { color: #0d0d0d; }
25% { color: #410194; }
50% { color: #7f17d8; }
75% { color: #410194; }
0% { color: #0d0d0d; }
25% { color: #410194; }
50% { color: #7f17d8; }
75% { color: #410194; }
100% { color: #3bb5d3; }
}
.phobia {color: #dd0000; font-weight: bold; animation: phobia 750ms infinite;}
@keyframes phobia {
0% { color: #0d0d0d; }
50% { color: #dd0000; }
100% { color: #0d0d0d; }
}
.icon {height: 1em; width: auto;}
+8
View File
@@ -160,6 +160,14 @@ h1.alert, h2.alert {color: #000000;}
25% { color: #410194; }
50% { color: #7f17d8; }
75% { color: #410194; }
100% { color: #3bb5d3; }
}
.phobia {color: #dd0000; font-weight: bold; animation: phobia 750ms infinite;}
@keyframes phobia {
0% { color: #0d0d0d; }
50% { color: #dd0000; }
100% { color: #0d0d0d; }
}
.icon {height: 1em; width: auto;}