From 0377dba670e33d34ba8b5f068e7fcb6495ebf89b Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 31 Jan 2021 23:09:07 +0100 Subject: [PATCH] [MIRROR] Mirror logging for brainwashing and hypnosis in the player panel and attack logs. (#2988) * Mirror logging for brainwashing and hypnosis in the player panel and attack logs. (#56515) Hypnosis and brainwashing now have entries in the Player Panel logging under attack and entries in the attack logs. Mirrors some logging that would otherwise just be in the game logs. From an admin-perspective, issues where you'd want to check brainwashing/hypnosis tend to go hand-in-hand with issues relating to attack logs as opposed to game logs. * Mirror logging for brainwashing and hypnosis in the player panel and attack logs. Co-authored-by: Timberpoes --- code/datums/brain_damage/hypnosis.dm | 1 + code/datums/status_effects/debuffs.dm | 6 +++++- code/game/objects/items/implants/implantchair.dm | 2 ++ code/modules/antagonists/brainwashing/brainwashing.dm | 4 ++++ code/modules/research/nanites/nanite_programs/weapon.dm | 1 + code/modules/surgery/advanced/brainwashing.dm | 2 ++ 6 files changed, 15 insertions(+), 1 deletion(-) diff --git a/code/datums/brain_damage/hypnosis.dm b/code/datums/brain_damage/hypnosis.dm index a72428b1534..c0dbbb99d4c 100644 --- a/code/datums/brain_damage/hypnosis.dm +++ b/code/datums/brain_damage/hypnosis.dm @@ -37,6 +37,7 @@ /datum/brain_trauma/hypnosis/on_lose() message_admins("[ADMIN_LOOKUPFLW(owner)] is no longer hypnotized with the phrase '[hypnotic_phrase]'.") + owner.log_message("is no longer hypnotized with the phrase '[hypnotic_phrase]'.", LOG_ATTACK) log_game("[key_name(owner)] is no longer hypnotized with the phrase '[hypnotic_phrase]'.") to_chat(owner, "You suddenly snap out of your hypnosis. The phrase '[hypnotic_phrase]' no longer feels important to you.") owner.clear_alert("hypnosis") diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 401c792c811..9107becd670 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -692,10 +692,14 @@ if(!owner.can_hear()) return - if(hearing_args[HEARING_SPEAKER] == owner) + var/mob/hearing_speaker = hearing_args[HEARING_SPEAKER] + if(hearing_speaker == owner) return var/mob/living/carbon/C = owner C.cure_trauma_type(/datum/brain_trauma/hypnosis, TRAUMA_RESILIENCE_SURGERY) //clear previous hypnosis + // The brain trauma itself does its own set of logging, but this is the only place the source of the hypnosis phrase can be found. + C.log_message("has been hypnotised by the phrase '[hearing_args[HEARING_RAW_MESSAGE]]' spoken by [key_name(hearing_speaker)]", LOG_ATTACK) + hearing_speaker.log_message("has hypnotised [key_name(C)] with the phrase '[hearing_args[HEARING_RAW_MESSAGE]]'", LOG_ATTACK, log_globally = FALSE) addtimer(CALLBACK(C, /mob/living/carbon.proc/gain_trauma, /datum/brain_trauma/hypnosis, TRAUMA_RESILIENCE_SURGERY, hearing_args[HEARING_RAW_MESSAGE]), 10) addtimer(CALLBACK(C, /mob/living.proc/Stun, 60, TRUE, TRUE), 15) //Take some time to think about it qdel(src) diff --git a/code/game/objects/items/implants/implantchair.dm b/code/game/objects/items/implants/implantchair.dm index f5824858e65..5f0a3db6bbd 100644 --- a/code/game/objects/items/implants/implantchair.dm +++ b/code/game/objects/items/implants/implantchair.dm @@ -199,5 +199,7 @@ return FALSE brainwash(C, objective) message_admins("[ADMIN_LOOKUPFLW(user)] brainwashed [key_name_admin(C)] with objective '[objective]'.") + C.log_message("has been brainwashed with the objective '[objective]' by [key_name(user)] using \the [src]", LOG_ATTACK) + user.log_message("has brainwashed [key_name(C)] with the objective '[objective]' using \the [src]", LOG_ATTACK, log_globally = FALSE) log_game("[key_name(user)] brainwashed [key_name(C)] with objective '[objective]'.") return TRUE diff --git a/code/modules/antagonists/brainwashing/brainwashing.dm b/code/modules/antagonists/brainwashing/brainwashing.dm index c81ba816ec5..d7389b5324e 100644 --- a/code/modules/antagonists/brainwashing/brainwashing.dm +++ b/code/modules/antagonists/brainwashing/brainwashing.dm @@ -45,6 +45,9 @@ /datum/antagonist/brainwashed/farewell() to_chat(owner, "Your mind suddenly clears...") to_chat(owner, "You feel the weight of the Directives disappear! You no longer have to obey them.") + if(owner.current) + var/mob/living/owner_mob = owner.current + owner_mob.log_message("is no longer brainwashed with the objectives: [english_list(objectives)].", LOG_ATTACK) owner.announce_objectives() /datum/antagonist/brainwashed/admin_add(datum/mind/new_owner,mob/admin) @@ -71,6 +74,7 @@ brainwash(C, objectives) var/obj_list = english_list(objectives) message_admins("[key_name_admin(admin)] has brainwashed [key_name_admin(C)] with the following objectives: [obj_list].") + C.log_message("has been force-brainwashed with the objective '[obj_list]' by admin [key_name(admin)]", LOG_ATTACK, log_globally = FALSE) log_admin("[key_name(admin)] has brainwashed [key_name(C)] with the following objectives: [obj_list].") /datum/objective/brainwashing diff --git a/code/modules/research/nanites/nanite_programs/weapon.dm b/code/modules/research/nanites/nanite_programs/weapon.dm index 259b85a4875..a8d276919ec 100644 --- a/code/modules/research/nanites/nanite_programs/weapon.dm +++ b/code/modules/research/nanites/nanite_programs/weapon.dm @@ -172,6 +172,7 @@ sent_directive = ES.get_value() brainwash(host_mob, sent_directive) log_game("A mind control nanite program brainwashed [key_name(host_mob)] with the objective '[sent_directive]'.") + host_mob.log_message("has been brainwashed with the objective '[sent_directive]' triggered by a mind control nanite program.", LOG_ATTACK) addtimer(CALLBACK(src, .proc/end_brainwashing), 600) /datum/nanite_program/comm/mind_control/proc/end_brainwashing() diff --git a/code/modules/surgery/advanced/brainwashing.dm b/code/modules/surgery/advanced/brainwashing.dm index befcd3ec707..a93e8f439f8 100644 --- a/code/modules/surgery/advanced/brainwashing.dm +++ b/code/modules/surgery/advanced/brainwashing.dm @@ -52,6 +52,8 @@ to_chat(target, "A new compulsion fills your mind... you feel forced to obey it!") brainwash(target, objective) message_admins("[ADMIN_LOOKUPFLW(user)] surgically brainwashed [ADMIN_LOOKUPFLW(target)] with the objective '[objective]'.") + target.log_message("has been brainwashed with the objective '[objective]' by [key_name(user)] using brainwashing surgery.", LOG_ATTACK) + user.log_message("has brainwashed [key_name(target)] with the objective '[objective]' using brainwashing surgery.", LOG_ATTACK, log_globally = FALSE) log_game("[key_name(user)] surgically brainwashed [key_name(target)] with the objective '[objective]'.") return ..()