Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ports new body cameras & Jammers #4661

Merged
merged 6 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions code/game/objects/items/devices/radio/headset.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ GLOBAL_LIST_INIT(channel_tokens, list(
if(ispath(keyslot2))
keyslot2 = new keyslot2()
set_listening(TRUE)
set_broadcasting(TRUE)
recalculateChannels()
possibly_deactivate_in_loc()

Expand Down Expand Up @@ -114,6 +115,22 @@ GLOBAL_LIST_INIT(channel_tokens, list(
for(var/language in language_list)
user.remove_language(language, understood = TRUE, spoken = FALSE, source = LANGUAGE_RADIOKEY)

// Headsets do not become hearing sensitive as broadcasting instead controls their talk_into capabilities
/obj/item/radio/headset/set_broadcasting(new_broadcasting, actual_setting = TRUE)
broadcasting = new_broadcasting
if(actual_setting)
should_be_broadcasting = broadcasting

if (perform_update_icon && !isnull(overlay_mic_idle))
update_icon()
else if (!perform_update_icon)
should_update_icon = TRUE

/obj/item/radio/headset/talk_into_impl(atom/movable/talking_movable, message, channel, list/spans, datum/language/language, list/message_mods)
if (!broadcasting)
return
return ..()

/obj/item/radio/headset/syndicate //disguised to look like a normal headset for stealth ops

/obj/item/radio/headset/syndicate/Initialize(mapload)
Expand Down
53 changes: 48 additions & 5 deletions code/game/objects/items/devices/traitordevices.dm
Original file line number Diff line number Diff line change
Expand Up @@ -283,27 +283,70 @@ effective or pretty fucking useless.

/obj/item/jammer
name = "radio jammer"
desc = "Device used to disrupt nearby radio communication."
desc = "Device used to disrupt nearby radio communication. Alternate function creates a powerful distruptor wave which disables all nearby listening devices."
icon = 'icons/obj/device.dmi'
icon_state = "jammer"
var/active = FALSE
var/range = 12
var/jam_cooldown_duration = 15 SECONDS
COOLDOWN_DECLARE(jam_cooldown)

/obj/item/jammer/attack_self(mob/user)
to_chat(user,span_notice("You [active ? "deactivate" : "activate"] [src]."))
/obj/item/jammer/Initialize(mapload)
. = ..()
register_context()

/obj/item/jammer/add_context(atom/source, list/context, obj/item/held_item, mob/user)
context[SCREENTIP_CONTEXT_LMB] = "Release distruptor wave"
context[SCREENTIP_CONTEXT_RMB] = "Toggle"
return CONTEXTUAL_SCREENTIP_SET

/obj/item/jammer/attack_self(mob/user, modifiers)
. = ..()
if (!COOLDOWN_FINISHED(src, jam_cooldown))
user.balloon_alert(user, "on cooldown!")
return ..()

user.balloon_alert(user, "distruptor wave released!")
to_chat(user, span_notice("You release a distruptor wave, disabling all nearby radio devices."))
for (var/atom/potential_owner in view(7, user))
disable_radios_on(potential_owner)
COOLDOWN_START(src, jam_cooldown, jam_cooldown_duration)

/obj/item/jammer/attack_self_secondary(mob/user, modifiers)
. = ..()
to_chat(user, span_notice("You [active ? "deactivate" : "activate"] [src]."))
user.balloon_alert(user, "[active ? "deactivated" : "activated"] the jammer")
active = !active
if(active)
GLOB.active_jammers |= src

else
GLOB.active_jammers -= src

update_appearance()

/obj/item/jammer/Destroy()
GLOB.active_jammers -= src
return ..()

/obj/item/jammer/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
. = ..()
if(.)
return

if (!(target in view(7, user)))
user.balloon_alert(user, "out of reach!")
return

target.balloon_alert(user, "radio distrupted!")
to_chat(user, span_notice("You release a directed distruptor wave, disabling all radio devices on [target]."))
disable_radios_on(target)

/obj/item/jammer/proc/disable_radios_on(atom/target)
for (var/obj/item/radio/radio in target.get_all_contents() + target)
radio.set_broadcasting(FALSE)
// MONKESTATION EDIT: Radio jammers turn body cameras off too.
for(var/obj/item/bodycam_upgrade/bodycamera in target.get_all_contents() + target)
bodycamera.turn_off()

/obj/item/storage/toolbox/emergency/turret
desc = "You feel a strange urge to hit this with a wrench."

Expand Down
Loading
Loading