Migrate radios to the new attack chain. (#32270)

* Migrate radios to the new attack chain.

* Apply suggestion from CRUNCH review.

Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
Signed-off-by: Alan <alfalfascout@users.noreply.github.com>

* Make code reachable.

* Migrate uplinks themselves too.

---------

Signed-off-by: Alan <alfalfascout@users.noreply.github.com>
Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
This commit is contained in:
Alan
2026-07-24 19:39:28 +00:00
committed by GitHub
co-authored by CRUNCH
parent 43a254b002
commit d93c05a145
5 changed files with 79 additions and 66 deletions
@@ -399,26 +399,27 @@
return FALSE
return ..()
/obj/item/radio/headset/attackby__legacy__attackchain(obj/item/key, mob/user)
if(istype(key, /obj/item/encryptionkey/))
/obj/item/radio/headset/item_interaction(mob/user, obj/item/used, list/modifiers)
if(!istype(used, /obj/item/encryptionkey))
return NONE
if(keyslot1 && keyslot2)
to_chat(user, "The headset can't hold another key!")
return
if(keyslot1 && keyslot2)
to_chat(user, SPAN_WARNING("[src] can't hold another key!"))
return ITEM_INTERACT_COMPLETE
if(!user.transfer_item_to(key, src, FALSE, FALSE))
to_chat(user, SPAN_WARNING("[key] is stuck to your hand, you can't insert it in [src]."))
return
if(!user.transfer_item_to(used, src, FALSE, FALSE))
to_chat(user, SPAN_WARNING("[used] is stuck to your hand, you can't insert it in [src]!"))
return ITEM_INTERACT_COMPLETE
if(!keyslot1)
keyslot1 = key
else
keyslot2 = key
if(!keyslot1)
keyslot1 = used
else
keyslot2 = used
recalculateChannels()
return
return ..()
to_chat(user, SPAN_NOTICE("You insert [used] into [src]."))
add_fingerprint(user)
recalculateChannels()
return ITEM_INTERACT_COMPLETE
/obj/item/radio/headset/screwdriver_act(mob/user, obj/item/I)
. = TRUE
@@ -434,19 +435,19 @@
if(keyslot1)
var/turf/T = get_turf(user)
if(T)
keyslot1.loc = T
keyslot1.forceMove(T)
keyslot1 = null
if(keyslot2)
var/turf/T = get_turf(user)
if(T)
keyslot2.loc = T
keyslot2.forceMove(T)
keyslot2 = null
recalculateChannels()
to_chat(user, "You pop out the encryption keys in the headset!")
to_chat(user, SPAN_NOTICE("You pop out the encryption keys in the headset!"))
I.play_tool_sound(user, I.tool_volume)
else
to_chat(user, "This headset doesn't have any encryption keys! How useless...")
to_chat(user, SPAN_NOTICE("This headset doesn't have any encryption keys! How useless..."))
/obj/item/radio/headset/recalculateChannels(setDescription = FALSE)
channels = list()
@@ -115,11 +115,11 @@
/obj/item/radio/intercom/attack_ai(mob/user)
add_hiddenprint(user)
add_fingerprint(user)
attack_self__legacy__attackchain(user)
activate_self(user)
/obj/item/radio/intercom/attack_hand(mob/user)
add_fingerprint(user)
attack_self__legacy__attackchain(user)
activate_self(user)
/obj/item/radio/intercom/receive_range(freq, level)
if(!is_listening())
@@ -131,7 +131,7 @@
return -1
if(freq in SSradio.ANTAG_FREQS)
if(!(syndiekey))
return -1//Prevents broadcast of messages over devices lacking the encryption
return -1 // Prevents broadcast of messages over devices lacking the encryption.
return canhear_range
@@ -145,33 +145,37 @@
if(2)
. += SPAN_NOTICE("The intercom is <b>wired</b>, and the maintenance panel is <i>unscrewed</i>.")
/obj/item/radio/intercom/attackby__legacy__attackchain(obj/item/W, mob/user)
if(istype(W, /obj/item/stack/tape_roll)) //eww
return
else if(iscoil(W) && buildstage == 1)
var/obj/item/stack/cable_coil/coil = W
/obj/item/radio/intercom/item_interaction(mob/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/stack/tape_roll)) // Eww.
return ITEM_INTERACT_COMPLETE
if(iscoil(used) && buildstage == 1)
var/obj/item/stack/cable_coil/coil = used
if(coil.get_amount() < 5)
to_chat(user, SPAN_WARNING("You need more cable for this!"))
return
return ITEM_INTERACT_COMPLETE
if(do_after(user, 10 * coil.toolspeed, target = src) && buildstage == 1)
coil.use(5)
to_chat(user, SPAN_NOTICE("You wire \the [src]!"))
to_chat(user, SPAN_NOTICE("You wire [src]!"))
buildstage = 2
return 1
else if(istype(W,/obj/item/intercom_electronics) && buildstage == 0)
playsound(get_turf(src), W.usesound, 50, 1)
if(do_after(user, 10 * W.toolspeed, target = src) && buildstage == 0)
qdel(W)
to_chat(user, SPAN_NOTICE("You insert \the [W] into \the [src]!"))
add_fingerprint(user)
return ITEM_INTERACT_COMPLETE
if(istype(used, /obj/item/intercom_electronics) && buildstage == 0)
playsound(get_turf(src), used.usesound, 50, 1)
if(do_after(user, 10 * used.toolspeed, target = src) && buildstage == 0)
qdel(used)
to_chat(user, SPAN_NOTICE("You insert [used] into [src]!"))
buildstage = 1
return 1
else
return ..()
add_fingerprint(user)
return ITEM_INTERACT_COMPLETE
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.
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)
@@ -84,6 +84,7 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
/// A timer that, when going off, will turn this radio on again
var/radio_enable_timer
new_attack_chain = TRUE
/obj/item/radio/proc/set_frequency(new_frequency)
SSradio.remove_object(src, frequency)
@@ -118,12 +119,16 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
/obj/item/radio/attack_ghost(mob/user)
return interact(user)
/obj/item/radio/attack_self__legacy__attackchain(mob/user)
/obj/item/radio/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
interact(user)
add_fingerprint(user)
return ITEM_INTERACT_COMPLETE
/obj/item/radio/interact(mob/user)
if(!user)
return 0
return FALSE
if(b_stat)
wires.Interact(user)
return
@@ -672,22 +677,20 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
/obj/item/radio/borg/ert/specops
keyslot = new /obj/item/encryptionkey/centcom
/obj/item/radio/borg/attackby__legacy__attackchain(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/encryptionkey/))
/obj/item/radio/borg/item_interaction(mob/user, obj/item/used, list/modifiers)
if(!istype(used, /obj/item/encryptionkey))
return NONE
if(keyslot)
to_chat(user, "The radio can't hold another key!")
return
if(keyslot)
to_chat(user, SPAN_WARNING("The radio can't hold another key!"))
return ITEM_INTERACT_COMPLETE
if(!keyslot)
user.drop_item()
W.loc = src
keyslot = W
user.drop_item()
used.forceMove(src)
keyslot = used
recalculateChannels()
return
return ..()
recalculateChannels()
return ITEM_INTERACT_COMPLETE
/obj/item/radio/borg/screwdriver_act(mob/user, obj/item/I)
. = TRUE
@@ -699,19 +702,17 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
SSradio.remove_object(src, SSradio.radiochannels[ch_name])
secure_radio_connections[ch_name] = null
if(keyslot)
var/turf/T = get_turf(user)
if(T)
keyslot.loc = T
keyslot = null
var/turf/T = get_turf(user)
if(T)
keyslot.forceMove(T)
keyslot = null
recalculateChannels()
to_chat(user, "You pop out the encryption key in the radio!")
to_chat(user, SPAN_NOTICE("You pop out the encryption key in the radio!"))
I.play_tool_sound(user, I.tool_volume)
else
to_chat(user, "This radio doesn't have any encryption keys!")
to_chat(user, SPAN_WARNING("This radio doesn't have any encryption keys!"))
/obj/item/radio/borg/recalculateChannels()
channels = list()
+5 -1
View File
@@ -30,6 +30,7 @@ GLOBAL_LIST_EMPTY(world_uplinks)
var/items_generated = FALSE
var/datum/data/record/selected_record
new_attack_chain = TRUE
/obj/item/uplink/ui_host()
return loc
@@ -445,9 +446,12 @@ GLOBAL_LIST_EMPTY(world_uplinks)
/obj/item/radio/uplink/show_examine_hotkeys()
return list()
/obj/item/radio/uplink/attack_self__legacy__attackchain(mob/user as mob)
/obj/item/radio/uplink/activate_self(mob/user)
if(!user)
return ..()
if(hidden_uplink)
hidden_uplink.trigger(user)
return ITEM_INTERACT_COMPLETE
/obj/item/radio/uplink/nuclear/Initialize(mapload)
. = ..()