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>
This commit is contained in:
matttheficus
2024-05-19 06:13:04 -04:00
committed by GitHub
parent 21d4261400
commit ac84655df6
3 changed files with 18 additions and 1 deletions
@@ -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)
@@ -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, "<span class='notice'>You <b>[broadcasting ? "enable" : "disable"]</b> [src]'s hotmic!</span>")
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)
. = ..()
. += "<span class='notice'><b>Alt-Click</b> to toggle [src]'s hotmic!</span>"
if(in_range(src, user) || loc == user)
if(b_stat)
. += "<span class='notice'>\the [src] can be attached and modified!</span>"