prevent phobias being triggered by words you don't understand (#55580)

This commit is contained in:
dragomagol
2020-12-17 20:12:34 -08:00
committed by GitHub
parent 7713a70f4e
commit 5083cb6fcf
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -289,7 +289,7 @@
#define COMSIG_MOVABLE_HEAR "movable_hear"
#define HEARING_MESSAGE 1
#define HEARING_SPEAKER 2
// #define HEARING_LANGUAGE 3
#define HEARING_LANGUAGE 3
#define HEARING_RAW_MESSAGE 4
/* #define HEARING_RADIO_FREQ 5
#define HEARING_SPANS 6
+2
View File
@@ -78,6 +78,8 @@
return
if(HAS_TRAIT(owner, TRAIT_FEARLESS))
return
if(!owner.has_language(hearing_args[HEARING_LANGUAGE])) //can't be triggered if you don't know the language
return
if(trigger_regex.Find(hearing_args[HEARING_RAW_MESSAGE]) != 0)
addtimer(CALLBACK(src, .proc/freak_out, null, trigger_regex.group[2]), 10) //to react AFTER the chat message
hearing_args[HEARING_RAW_MESSAGE] = trigger_regex.Replace(hearing_args[HEARING_RAW_MESSAGE], "<span class='phobia'>$2</span>$3")