mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 15:17:01 +01:00
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:
@@ -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;}
|
||||
|
||||
@@ -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;}
|
||||
|
||||
Reference in New Issue
Block a user