From ac84655df6552731a7b8e2d4db6d06fe856cc126 Mon Sep 17 00:00:00 2001
From: matttheficus <57759731+matttheficus@users.noreply.github.com>
Date: Sun, 19 May 2024 06:13:04 -0400
Subject: [PATCH] Radio Hotmic Noise + Alt Click Toggle (#25239)
* radio check - lime charlie
* examine addition
* oops
Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com>
Signed-off-by: matttheficus <57759731+matttheficus@users.noreply.github.com>
* oops 2
Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com>
Signed-off-by: matttheficus <57759731+matttheficus@users.noreply.github.com>
* dgamerl review
* i didnt save lul
---------
Signed-off-by: matttheficus <57759731+matttheficus@users.noreply.github.com>
Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com>
---
code/__DEFINES/misc_defines.dm | 1 +
code/game/objects/items/devices/radio/intercom.dm | 7 ++++++-
.../game/objects/items/devices/radio/radio_objects.dm | 11 +++++++++++
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/code/__DEFINES/misc_defines.dm b/code/__DEFINES/misc_defines.dm
index e3fee8035c7..a837dc7a72b 100644
--- a/code/__DEFINES/misc_defines.dm
+++ b/code/__DEFINES/misc_defines.dm
@@ -400,6 +400,7 @@
#define INVESTIGATE_RENAME "renames"
#define INVESTIGATE_BOMB "bombs"
+#define INVESTIGATE_HOTMIC "hotmic"
// The SQL version required by this version of the code
#define SQL_VERSION 56
diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm
index d8ff1d46d74..f2eb9da5007 100644
--- a/code/game/objects/items/devices/radio/intercom.dm
+++ b/code/game/objects/items/devices/radio/intercom.dm
@@ -174,6 +174,11 @@
else
return ..()
+/obj/item/radio/intercom/AltClick(mob/user)
+ . = ..()
+ if(broadcasting)
+ investigate_log("had its hotmic toggled on via hotkey by [key_name(user)].", INVESTIGATE_HOTMIC) ///Allows us to track who spams all these on if they do.
+
/obj/item/radio/intercom/crowbar_act(mob/user, obj/item/I)
if(buildstage != 1)
return
@@ -245,7 +250,7 @@
underlays += emissive_appearance(icon, "intercom_lightmask")
/obj/item/radio/intercom/proc/update_operating_status(on = TRUE)
- if(!loc) // We init a few radios in nullspace to prevent them from needing power.
+ if(!loc) // We init a few radios in nullspace to prevent them from needing power.
return
var/area/current_area = get_area(src)
if(on)
diff --git a/code/game/objects/items/devices/radio/radio_objects.dm b/code/game/objects/items/devices/radio/radio_objects.dm
index a26c5a126fa..4b5ca92cf49 100644
--- a/code/game/objects/items/devices/radio/radio_objects.dm
+++ b/code/game/objects/items/devices/radio/radio_objects.dm
@@ -131,6 +131,14 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
return
ui_interact(user)
+/obj/item/radio/AltClick(mob/user)
+ if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user) || !istype(user))
+ return
+
+ ToggleBroadcast()
+ to_chat(user, "You [broadcasting ? "enable" : "disable"] [src]'s hotmic!")
+ add_fingerprint(user)
+
/obj/item/radio/ui_state(mob/user)
return GLOB.default_state
@@ -252,6 +260,8 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
/obj/item/radio/proc/ToggleBroadcast()
broadcasting = !broadcasting && !(wires.is_cut(WIRE_RADIO_TRANSMIT) || wires.is_cut(WIRE_RADIO_SIGNAL))
+ if(broadcasting)
+ playsound(src, 'sound/items/radio_common.ogg', rand(4, 16) * 5, SOUND_RANGE_SET(3))
/obj/item/radio/proc/ToggleReception()
listening = !listening && !(wires.is_cut(WIRE_RADIO_RECEIVER) || wires.is_cut(WIRE_RADIO_SIGNAL))
@@ -534,6 +544,7 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
/obj/item/radio/examine(mob/user)
. = ..()
+ . += "Alt-Click to toggle [src]'s hotmic!"
if(in_range(src, user) || loc == user)
if(b_stat)
. += "\the [src] can be attached and modified!"