From 6e318bfb0924863a68a6f4facb123f852921f515 Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Tue, 3 Dec 2019 06:31:35 +0100
Subject: [PATCH 1/3] Fixes traitor codewords highlight and some other hear
signal hoonks.
---
code/datums/brain_damage/hypnosis.dm | 2 +-
code/datums/brain_damage/mild.dm | 2 +-
code/datums/brain_damage/phobia.dm | 2 +-
.../antagonists/traitor/datum_traitor.dm | 18 ++++++++++--------
4 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/code/datums/brain_damage/hypnosis.dm b/code/datums/brain_damage/hypnosis.dm
index f937c19658..37aee6df7e 100644
--- a/code/datums/brain_damage/hypnosis.dm
+++ b/code/datums/brain_damage/hypnosis.dm
@@ -68,4 +68,4 @@
new /datum/hallucination/chat(owner, TRUE, FALSE, "[hypnotic_phrase]")
/datum/brain_trauma/hypnosis/handle_hearing(datum/source, list/hearing_args)
- hearing_args[HEARING_MESSAGE] = target_phrase.Replace(hearing_args[HEARING_MESSAGE], "$1")
+ hearing_args[HEARING_RAW_MESSAGE] = target_phrase.Replace(hearing_args[HEARING_RAW_MESSAGE], "$1")
diff --git a/code/datums/brain_damage/mild.dm b/code/datums/brain_damage/mild.dm
index 012f771a29..235417d62c 100644
--- a/code/datums/brain_damage/mild.dm
+++ b/code/datums/brain_damage/mild.dm
@@ -241,7 +241,7 @@
if(prob(25))
var/deja_vu = pick_n_take(hear_dejavu)
var/static/regex/quoted_spoken_message = regex("\".+\"", "gi")
- hearing_args[HEARING_MESSAGE] = quoted_spoken_message.Replace(hearing_args[HEARING_MESSAGE], "\"[deja_vu]\"") //Quotes included to avoid cases where someone says part of their name
+ hearing_args[HEARING_RAW_MESSAGE] = quoted_spoken_message.Replace(hearing_args[HEARING_RAW_MESSAGE], "\"[deja_vu]\"") //Quotes included to avoid cases where someone says part of their name
return
if(hear_dejavu.len >= 15)
if(prob(50))
diff --git a/code/datums/brain_damage/phobia.dm b/code/datums/brain_damage/phobia.dm
index 034f2baaaf..80a1bd2470 100644
--- a/code/datums/brain_damage/phobia.dm
+++ b/code/datums/brain_damage/phobia.dm
@@ -88,7 +88,7 @@
if(findtext(hearing_args[HEARING_RAW_MESSAGE], reg))
addtimer(CALLBACK(src, .proc/freak_out, null, word), 10) //to react AFTER the chat message
- hearing_args[HEARING_MESSAGE] = reg.Replace(hearing_args[HEARING_MESSAGE], "$1")
+ hearing_args[HEARING_RAW_MESSAGE] = reg.Replace(hearing_args[HEARING_RAW_MESSAGE], "$1")
break
/datum/brain_trauma/mild/phobia/handle_speech(datum/source, list/speech_args)
diff --git a/code/modules/antagonists/traitor/datum_traitor.dm b/code/modules/antagonists/traitor/datum_traitor.dm
index c1f8d6d349..94b91bb35d 100644
--- a/code/modules/antagonists/traitor/datum_traitor.dm
+++ b/code/modules/antagonists/traitor/datum_traitor.dm
@@ -23,7 +23,6 @@
owner.special_role = special_role
if(give_objectives)
forge_traitor_objectives()
- RegisterSignal(owner.current, COMSIG_MOVABLE_HEAR, .proc/handle_hearing)
finalize_traitor()
..()
@@ -49,17 +48,16 @@
A.verbs -= /mob/living/silicon/ai/proc/choose_modules
A.malf_picker.remove_malf_verbs(A)
qdel(A.malf_picker)
- UnregisterSignal(owner.current, COMSIG_MOVABLE_HEAR, .proc/handle_hearing)
SSticker.mode.traitors -= owner
if(!silent && owner.current)
to_chat(owner.current," You are no longer the [special_role]! ")
owner.special_role = null
/datum/antagonist/traitor/proc/handle_hearing(datum/source, list/hearing_args)
- var/message = hearing_args[HEARING_MESSAGE]
+ var/message = hearing_args[HEARING_RAW_MESSAGE]
message = GLOB.syndicate_code_phrase_regex.Replace(message, "$1")
message = GLOB.syndicate_code_response_regex.Replace(message, "$1")
- hearing_args[HEARING_MESSAGE] = message
+ hearing_args[HEARING_RAW_MESSAGE] = message
/datum/antagonist/traitor/proc/add_objective(datum/objective/O)
objectives += O
@@ -261,16 +259,20 @@
/datum/antagonist/traitor/apply_innate_effects(mob/living/mob_override)
. = ..()
update_traitor_icons_added()
- var/mob/living/silicon/ai/A = mob_override || owner.current
- if(istype(A) && traitor_kind == TRAITOR_AI)
+ var/mob/M = mob_override || owner.current
+ if(isAI(M) && traitor_kind == TRAITOR_AI)
+ var/mob/living/silicon/ai/A = M
A.hack_software = TRUE
+ RegisterSignal(M, COMSIG_MOVABLE_HEAR, .proc/handle_hearing)
/datum/antagonist/traitor/remove_innate_effects(mob/living/mob_override)
. = ..()
update_traitor_icons_removed()
- var/mob/living/silicon/ai/A = mob_override || owner.current
- if(istype(A) && traitor_kind == TRAITOR_AI)
+ var/mob/M = mob_override || owner.current
+ if(iaAI(M) && traitor_kind == TRAITOR_AI)
+ var/mob/living/silicon/ai/A = M
A.hack_software = FALSE
+ UnregisterSignal(M, COMSIG_MOVABLE_HEAR)
/datum/antagonist/traitor/proc/give_codewords()
if(!owner.current)
From fa270c8a79e1cb9eee30ddc0525d7ccfcf948b0d Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Tue, 3 Dec 2019 06:48:25 +0100
Subject: [PATCH 2/3] leftovers.
---
code/datums/brain_damage/split_personality.dm | 4 ++--
code/modules/antagonists/traitor/datum_traitor.dm | 2 +-
code/modules/mob/living/say.dm | 3 ---
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/code/datums/brain_damage/split_personality.dm b/code/datums/brain_damage/split_personality.dm
index dfe63ce141..a1284319f1 100644
--- a/code/datums/brain_damage/split_personality.dm
+++ b/code/datums/brain_damage/split_personality.dm
@@ -198,9 +198,9 @@
/datum/brain_trauma/severe/split_personality/brainwashing/handle_hearing(datum/source, list/hearing_args)
if(HAS_TRAIT(owner, TRAIT_DEAF) || owner == hearing_args[HEARING_SPEAKER])
return
- var/message = hearing_args[HEARING_MESSAGE]
+ var/message = hearing_args[HEARING_RAW_MESSAGE]
if(findtext(message, codeword))
- hearing_args[HEARING_MESSAGE] = replacetext(message, codeword, "[codeword]")
+ hearing_args[HEARING_RAW_MESSAGE] = replacetext(message, codeword, "[codeword]")
addtimer(CALLBACK(src, /datum/brain_trauma/severe/split_personality.proc/switch_personalities), 10)
/datum/brain_trauma/severe/split_personality/brainwashing/handle_speech(datum/source, list/speech_args)
diff --git a/code/modules/antagonists/traitor/datum_traitor.dm b/code/modules/antagonists/traitor/datum_traitor.dm
index 94b91bb35d..ee9bc81850 100644
--- a/code/modules/antagonists/traitor/datum_traitor.dm
+++ b/code/modules/antagonists/traitor/datum_traitor.dm
@@ -269,7 +269,7 @@
. = ..()
update_traitor_icons_removed()
var/mob/M = mob_override || owner.current
- if(iaAI(M) && traitor_kind == TRAITOR_AI)
+ if(isAI(M) && traitor_kind == TRAITOR_AI)
var/mob/living/silicon/ai/A = M
A.hack_software = FALSE
UnregisterSignal(M, COMSIG_MOVABLE_HEAR)
diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm
index 174fd5c394..536f5c6cb2 100644
--- a/code/modules/mob/living/say.dm
+++ b/code/modules/mob/living/say.dm
@@ -237,9 +237,6 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
show_message(message, 2, deaf_message, deaf_type)
return message
-/mob/living/proc/hear_intercept(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode)
- return message
-
/mob/living/send_speech(message, message_range = 6, obj/source = src, bubble_type = bubble_icon, list/spans, datum/language/message_language=null, message_mode)
var/static/list/eavesdropping_modes = list(MODE_WHISPER = TRUE, MODE_WHISPER_CRIT = TRUE)
var/eavesdrop_range = 0
From 428234c0d64de77c5086684160bc1ed241331b5f Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Tue, 3 Dec 2019 06:53:46 +0100
Subject: [PATCH 3/3] Dilemma.
---
code/modules/mob/living/say.dm | 1 -
1 file changed, 1 deletion(-)
diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm
index 536f5c6cb2..f0c8de7e76 100644
--- a/code/modules/mob/living/say.dm
+++ b/code/modules/mob/living/say.dm
@@ -232,7 +232,6 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
// Recompose message for AI hrefs, language incomprehension.
message = compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode)
- message = hear_intercept(message, speaker, message_language, raw_message, radio_freq, spans, message_mode)
show_message(message, 2, deaf_message, deaf_type)
return message