Improves syndicate + DS radio

This commit is contained in:
AffectedArc07
2020-05-17 10:52:22 +01:00
parent 4314925efc
commit af131aa92a
6 changed files with 19 additions and 26 deletions
-1
View File
@@ -63,6 +63,5 @@
#define SIGNALTYPE_NORMAL 0
#define SIGNALTYPE_INTERCOM 1 // Will only broadcast to intercoms
#define SIGNALTYPE_INTERCOM_SBR 2 // Will only broadcast to intercoms and station-bounced radios
#define SIGNALTYPE_ANTAG 3 // Broadcast to syndicate frequency
#define SIGNALTYPE_AINOTRACK 4 // AI can't track down this person. Useful for imitation broadcasts where you can't find the actual mob
+8 -16
View File
@@ -252,15 +252,6 @@ GLOBAL_LIST_EMPTY(tcomms_machines)
if(R.receive_range(display_freq, tcm.zlevels) > -1)
radios += R
// --- Broadcast to antag radios! ---
else if(tcm.data == SIGNALTYPE_ANTAG)
for(var/antag_freq in SSradio.ANTAG_FREQS)
var/datum/radio_frequency/antag_connection = SSradio.return_frequency(antag_freq)
for(var/obj/item/radio/R in antag_connection.devices["[RADIO_CHAT]"])
if(R.receive_range(antag_freq, tcm.zlevels) > -1)
radios += R
// --- Broadcast to ALL radio devices ---
else if(!bad_connection)
@@ -269,6 +260,14 @@ GLOBAL_LIST_EMPTY(tcomms_machines)
if(R.receive_range(display_freq, tcm.zlevels) > -1)
radios += R
// Add syndie radios for intercepts if its a regular department frequency
for(var/antag_freq in SSradio.ANTAG_FREQS)
var/datum/radio_frequency/antag_connection = SSradio.return_frequency(antag_freq)
for(var/obj/item/radio/R in antag_connection.devices["[RADIO_CHAT]"])
if(R.receive_range(antag_freq, tcm.zlevels) > -1)
// Only add if it wasnt there already
radios |= R
// Get a list of mobs who can hear from the radios we collected.
var/list/receive = get_mobs_in_radio_ranges(radios)
@@ -293,11 +292,6 @@ GLOBAL_LIST_EMPTY(tcomms_machines)
if(istype(R, /mob/new_player)) // we don't want new players to hear messages. rare but generates runtimes.
continue
// Ghosts hearing all radio chat don't want to hear syndicate intercepts, they're duplicates
if(tcm.data == SIGNALTYPE_ANTAG && istype(R, /mob/dead/observer) && R.get_preference(CHAT_GHOSTRADIO))
continue
// --- Can understand the speech ---
if(!tcm.sender || R.say_understands(tcm.sender))
@@ -323,8 +317,6 @@ GLOBAL_LIST_EMPTY(tcomms_machines)
var/freq_text = get_frequency_name(display_freq)
var/part_b_extra = ""
if(tcm.data == SIGNALTYPE_ANTAG) // intercepted radio message
part_b_extra = " <i>(Intercepted)</i>"
var/part_a = "<span class='[SSradio.frequency_span_class(display_freq)]'><b>\[[freq_text]\][part_b_extra]</b> <span class='name'>" // goes in the actual output
// --- Some more pre-message formatting ---
-7
View File
@@ -85,13 +85,6 @@
// Now check if they actually have pieces, if so, broadcast
if(tcm.message_pieces)
// This needs two broadcasts to make it work for syndicate radios. I hate it.
// Someone please make this better
// Although oddly enough, this is how it worked pre-rework
// The only reason regular traitors could intercept is because of the tcomms machine on the nukies shuttle
// Why. FUCKING WHY!!!!!!!!!!
broadcast_message(tcm)
tcm.data = SIGNALTYPE_ANTAG
broadcast_message(tcm)
return TRUE
@@ -89,6 +89,8 @@
/obj/item/radio/headset/syndicate
origin_tech = "syndicate=3"
ks1type = /obj/item/encryptionkey/syndicate/nukeops
requires_tcomms = FALSE
instant = TRUE // Work instantly if there are no comms
/obj/item/radio/headset/syndicate/alt //undisguised bowman with flash protection
name = "syndicate headset"
@@ -59,6 +59,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
var/list/datum/radio_frequency/secure_radio_connections = new
var/requires_tcomms = FALSE // Does this device require tcomms to work.If TRUE it wont function at all without tcomms. If FALSE, it will work without tcomms, just slowly
var/instant = FALSE // Should this device instantly communicate if there isnt tcomms
/obj/item/radio/proc/set_frequency(new_frequency)
@@ -426,8 +427,12 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
// If we dont need tcomms and we have no connection
if(!requires_tcomms && !handled)
tcm.zlevels = list(position.z)
// Simulate two seconds of lag
addtimer(CALLBACK(GLOBAL_PROC, .proc/broadcast_message, tcm), 20)
if(!instant)
// Simulate two seconds of lag
addtimer(CALLBACK(GLOBAL_PROC, .proc/broadcast_message, tcm), 20)
else
// Nukeops + Deathsquad headsets are instant and should work the same, whether there is comms or not
broadcast_message(tcm)
return TRUE
// If we didnt get here, oh fuck
+2
View File
@@ -158,6 +158,8 @@ GLOBAL_VAR_INIT(sent_strike_team, 0)
var/obj/item/radio/R = new /obj/item/radio/headset/alt(src)
R.set_frequency(DTH_FREQ)
R.requires_tcomms = FALSE
R.instant = TRUE
equip_to_slot_or_del(R, slot_l_ear)
if(is_leader)
equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(src), slot_w_uniform)