From 413d862693de9ef9fa252a6417e7d51ca69172cf Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sat, 24 Sep 2022 21:35:27 +0200 Subject: [PATCH] [MIRROR] Adds the installed message phrase for voice analyzers to logging (bonus runtime fix) [MDB IGNORE] (#16382) * Adds the installed message phrase for voice analyzers to logging (bonus runtime fix) (#70066) * Adds the installed message phrase for voice analyzers to logging Hey there, Sometimes, it's CBT to figure out what exactly made a bomb go off, especially when a voice analyzer is involved. Now, when a voice analyzer is involved in TTV Bomb/Grenade explosions (already logged), it will also output the recorded phrase when present. To do this, I just span up a quick `isvoice()` macro define to ensure that we would get the variable, and it would just append the message that we were already spitting out into logs. I rewrote how grenade logs currently operate a bit, let me know if I accidentally omitted something critical. * Adds the installed message phrase for voice analyzers to logging (bonus runtime fix) Co-authored-by: san7890 --- code/datums/wires/explosive.dm | 10 +++++++--- code/game/objects/items/devices/transfer_valve.dm | 7 ++++++- code/modules/assembly/voice.dm | 3 ++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/code/datums/wires/explosive.dm b/code/datums/wires/explosive.dm index 674326a1a92..757b1bde306 100644 --- a/code/datums/wires/explosive.dm +++ b/code/datums/wires/explosive.dm @@ -61,10 +61,14 @@ /datum/wires/explosive/chem_grenade/explode() var/obj/item/grenade/chem_grenade/grenade = holder - var/obj/item/assembly/assembly = get_attached(get_wire(1)) + var/obj/item/assembly/pulser = get_attached(get_wire(1)) + var/message = "\An [pulser] has pulsed [grenade] ([grenade.type]), which was installed by [fingerprint]" + if(istype(pulser, /obj/item/assembly/voice)) + var/obj/item/assembly/voice/spoken_trigger = pulser + message += " with the following activation message: \"[spoken_trigger.recorded]\"" if(!grenade.dud_flags) - message_admins("\An [assembly] has pulsed [grenade] ([grenade.type]), which was installed by [fingerprint].") - log_game("\An [assembly] has pulsed [grenade] ([grenade.type]), which was installed by [fingerprint].") + message_admins(message) + log_game(message) var/mob/M = get_mob_by_ckey(fingerprint) grenade.log_grenade(M) //Used in arm_grenade() too but this one conveys where the mob who triggered the bomb is if(grenade.landminemode) diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index d6d1ed1042a..a188b07f764 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -194,12 +194,17 @@ if(bomber) admin_bomber_message = "The bomb's most recent set of fingerprints indicate it was last touched by [ADMIN_LOOKUPFLW(bomber)]" bomber_message = " - Last touched by: [key_name_admin(bomber)]" + bomber.log_message("opened bomb valve", LOG_GAME, log_globally = FALSE) + + if(istype(attachment, /obj/item/assembly/voice)) + var/obj/item/assembly/voice/spoken_trigger = attachment + attachment_message += " with the following activation message: \"[spoken_trigger.recorded]\"" + admin_attachment_message += " with the following activation message: \"[spoken_trigger.recorded]\"" var/admin_bomb_message = "Bomb valve opened in [ADMIN_VERBOSEJMP(bombturf)]
[admin_attachment_message]
[admin_bomber_message]
[attachment_signal_log]" GLOB.bombers += admin_bomb_message message_admins(admin_bomb_message) log_game("Bomb valve opened in [AREACOORD(bombturf)][attachment_message][bomber_message]") - bomber.log_message("opened bomb valve", LOG_GAME, log_globally = FALSE) valve_open = merge_gases(target, change_volume) diff --git a/code/modules/assembly/voice.dm b/code/modules/assembly/voice.dm index 62df5b79ca0..35961a97733 100644 --- a/code/modules/assembly/voice.dm +++ b/code/modules/assembly/voice.dm @@ -13,7 +13,8 @@ verb_ask = "beeps" verb_exclaim = "beeps" var/listening = FALSE - var/recorded = "" //the activation message + /// The activation message is tracked using this var. + var/recorded = "" var/mode = INCLUSIVE_MODE var/static/list/modes = list( "inclusive",