[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 <the@san7890.com>
This commit is contained in:
SkyratBot
2022-09-24 15:35:27 -04:00
committed by GitHub
co-authored by san7890
parent 9607e0e726
commit 413d862693
3 changed files with 15 additions and 5 deletions
+7 -3
View File
@@ -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)
@@ -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)]<br>[admin_attachment_message]<br>[admin_bomber_message]<br>[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)
+2 -1
View File
@@ -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",