Cleans up radio frequency numbers.

Replaces magic numbers across the code base with proper constants.
Prepares for the ability to have more than one antag channel in the future.
Corrects a lie.
This commit is contained in:
PsiOmega
2014-09-18 11:29:52 +02:00
parent a35ff3e4e7
commit fe126626ac
19 changed files with 140 additions and 196 deletions

View File

@@ -172,6 +172,7 @@
#include "code\defines\procs\command_alert.dm" #include "code\defines\procs\command_alert.dm"
#include "code\defines\procs\dbcore.dm" #include "code\defines\procs\dbcore.dm"
#include "code\defines\procs\hud.dm" #include "code\defines\procs\hud.dm"
#include "code\defines\procs\radio.dm"
#include "code\defines\procs\records.dm" #include "code\defines\procs\records.dm"
#include "code\defines\procs\sd_Alert.dm" #include "code\defines\procs\sd_Alert.dm"
#include "code\defines\procs\statistics.dm" #include "code\defines\procs\statistics.dm"

View File

@@ -64,7 +64,7 @@
desc = "Radio module for computers" desc = "Radio module for computers"
var/datum/radio_frequency/radio_connection = null var/datum/radio_frequency/radio_connection = null
var/frequency = 1459 var/frequency = PUB_FREQ
var/filter = null var/filter = null
var/range = null var/range = null
var/subspace = 0 var/subspace = 0

View File

@@ -72,7 +72,7 @@ Radio:
1355 - Medical 1355 - Medical
1357 - Engineering 1357 - Engineering
1359 - Security 1359 - Security
1441 - death squad 1341 - death squad
1443 - Confession Intercom 1443 - Confession Intercom
1347 - Cargo techs 1347 - Cargo techs
@@ -96,34 +96,42 @@ On the map:
1455 for AI access 1455 for AI access
*/ */
var/list/radiochannels = list( var/const/COMM_FREQ = 1353
"Common" = 1459,
"Science" = 1351,
"Command" = 1353,
"Medical" = 1355,
"Engineering" = 1357,
"Security" = 1359,
"Response Team" = 1345,
"Deathsquad" = 1341,
"Syndicate" = 1213,
"Supply" = 1347,
)
//depenging helpers
var/list/DEPT_FREQS = list(1351, 1355, 1357, 1359, 1213, 1345, 1341, 1347)
// central command channels, i.e deathsquid & response teams
var/list/CENT_FREQS = list(1345, 1341)
var/const/COMM_FREQ = 1353 //command, colored gold in chat window
var/const/SYND_FREQ = 1213 var/const/SYND_FREQ = 1213
var/const/ERT_FREQ = 1345
var/const/DTH_FREQ = 1341
var/const/AI_FREQ = 1447
// department channels // department channels
var/const/PUB_FREQ = 1459
var/const/SEC_FREQ = 1359 var/const/SEC_FREQ = 1359
var/const/ENG_FREQ = 1357 var/const/ENG_FREQ = 1357
var/const/SCI_FREQ = 1351 var/const/SCI_FREQ = 1351
var/const/MED_FREQ = 1355 var/const/MED_FREQ = 1355
var/const/SUP_FREQ = 1347 var/const/SUP_FREQ = 1347
var/list/radiochannels = list(
"Common" = PUB_FREQ,
"Science" = SCI_FREQ,
"Command" = COMM_FREQ,
"Medical" = MED_FREQ,
"Engineering" = ENG_FREQ,
"Security" = SEC_FREQ,
"Response Team" = ERT_FREQ,
"Special Ops" = DTH_FREQ,
"Syndicate" = SYND_FREQ,
"Supply" = SUP_FREQ
)
// central command channels, i.e deathsquid & response teams
var/list/CENT_FREQS = list(ERT_FREQ, DTH_FREQ)
// Antag channels, i.e. Syndicate
var/list/ANTAG_FREQS = list(SYND_FREQ)
//depenging helpers
var/list/DEPT_FREQS = list(SCI_FREQ, MED_FREQ, ENG_FREQ, SEC_FREQ, SUP_FREQ, ERT_FREQ, SYND_FREQ, DTH_FREQ)
#define TRANSMISSION_WIRE 0 #define TRANSMISSION_WIRE 0
#define TRANSMISSION_RADIO 1 #define TRANSMISSION_RADIO 1

View File

@@ -0,0 +1,18 @@
/proc/get_frequency_name(var/display_freq)
var/freq_text
// the name of the channel
if(display_freq in ANTAG_FREQS)
freq_text = "#unkn"
else
for(var/channel in radiochannels)
if(radiochannels[channel] == display_freq)
freq_text = channel
break
// --- If the frequency has not been assigned a name, just use the frequency as the name ---
if(!freq_text)
freq_text = format_frequency(display_freq)
return freq_text

View File

@@ -170,6 +170,7 @@ var/global/list/turf/synd_spawn = list()
if (nuke_code) if (nuke_code)
synd_mind.store_memory("<B>Syndicate Nuclear Bomb Code</B>: [nuke_code]", 0, 0) synd_mind.store_memory("<B>Syndicate Nuclear Bomb Code</B>: [nuke_code]", 0, 0)
synd_mind.current << "The nuclear authorization code is: <B>[nuke_code]</B>" synd_mind.current << "The nuclear authorization code is: <B>[nuke_code]</B>"
synd_mind.current << "To speak on the strike team's private channel use :t"
var/obj/item/weapon/paper/P = new var/obj/item/weapon/paper/P = new
P.info = "The nuclear authorization code is: <b>[nuke_code]</b>" P.info = "The nuclear authorization code is: <b>[nuke_code]</b>"
P.name = "nuclear bomb code" P.name = "nuclear bomb code"
@@ -205,10 +206,8 @@ var/global/list/turf/synd_spawn = list()
/datum/game_mode/proc/equip_syndicate(mob/living/carbon/human/synd_mob) /datum/game_mode/proc/equip_syndicate(mob/living/carbon/human/synd_mob)
var/radio_freq = SYND_FREQ
var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate(synd_mob) var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate(synd_mob)
R.set_frequency(radio_freq) R.set_frequency(SYND_FREQ)
synd_mob.equip_to_slot_or_del(R, slot_l_ear) synd_mob.equip_to_slot_or_del(R, slot_l_ear)
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate(synd_mob), slot_w_uniform) synd_mob.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate(synd_mob), slot_w_uniform)

View File

@@ -274,7 +274,7 @@
var/freq = 1441 var/freq = 1441
var/list/freqlist = list() var/list/freqlist = list()
while (freq <= 1489) while (freq <= 1489)
if (freq < 1451 || freq > 1459) if (freq < 1451 || freq > PUB_FREQ)
freqlist += freq freqlist += freq
freq += 2 freq += 2
if ((freq % 2) == 0) if ((freq % 2) == 0)

View File

@@ -19,7 +19,7 @@
brute_dam_coeff = 0.5 brute_dam_coeff = 0.5
var/atom/movable/load = null // the loaded crate (usually) var/atom/movable/load = null // the loaded crate (usually)
var/beacon_freq = 1400 var/beacon_freq = 1400
var/control_freq = 1447 var/control_freq = AI_FREQ
suffix = "" suffix = ""

View File

@@ -43,7 +43,7 @@
var/auto_patrol = 0 // set to make bot automatically patrol var/auto_patrol = 0 // set to make bot automatically patrol
var/beacon_freq = 1445 // navigation beacon frequency var/beacon_freq = 1445 // navigation beacon frequency
var/control_freq = 1447 // bot control frequency var/control_freq = AI_FREQ // bot control frequency
var/turf/patrol_target // this is turf to navigate to (location of beacon) var/turf/patrol_target // this is turf to navigate to (location of beacon)

View File

@@ -145,7 +145,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
var/datum/radio_frequency/connection = signal.data["connection"] var/datum/radio_frequency/connection = signal.data["connection"]
if(connection.frequency == SYND_FREQ) // if syndicate broadcast, just if(connection.frequency in ANTAG_FREQS) // if antag broadcast, just
Broadcast_Message(signal.data["connection"], signal.data["mob"], Broadcast_Message(signal.data["connection"], signal.data["mob"],
signal.data["vmask"], signal.data["vmessage"], signal.data["vmask"], signal.data["vmessage"],
signal.data["radio"], signal.data["message"], signal.data["radio"], signal.data["message"],
@@ -252,15 +252,13 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
if(R.receive_range(display_freq, level) > -1) if(R.receive_range(display_freq, level) > -1)
radios += R radios += R
// --- Broadcast to syndicate radio! --- // --- Broadcast to antag radios! ---
else if(data == 3) else if(data == 3)
for(var/antag_freq in ANTAG_FREQS)
var/datum/radio_frequency/syndicateconnection = radio_controller.return_frequency(SYND_FREQ) var/datum/radio_frequency/antag_connection = radio_controller.return_frequency(antag_freq)
for (var/obj/item/device/radio/R in antag_connection.devices["[RADIO_CHAT]"])
for (var/obj/item/device/radio/R in syndicateconnection.devices["[RADIO_CHAT]"]) if(R.receive_range(antag_freq, level) > -1)
if(R.receive_range(SYND_FREQ, level) > -1)
radios += R radios += R
// --- Broadcast to ALL radio devices --- // --- Broadcast to ALL radio devices ---
@@ -333,38 +331,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
/* --- Some miscellaneous variables to format the string output --- */ /* --- Some miscellaneous variables to format the string output --- */
var/part_a = "<span class='radio'><span class='name'>" // goes in the actual output var/part_a = "<span class='radio'><span class='name'>" // goes in the actual output
var/freq_text // the name of the channel var/freq_text = get_frequency_name(display_freq)
// --- Set the name of the channel ---
switch(display_freq)
if(SYND_FREQ)
freq_text = "#unkn"
if(COMM_FREQ)
freq_text = "Command"
if(SCI_FREQ)
freq_text = "Science"
if(MED_FREQ)
freq_text = "Medical"
if(ENG_FREQ)
freq_text = "Engineering"
if(SEC_FREQ)
freq_text = "Security"
if(SUP_FREQ)
freq_text = "Supply"
if(1341)
freq_text = "Special Ops"
if(1345)
freq_text = "Response Team"
if(1447)
freq_text = "AI Private"
//There's probably a way to use the list var of channels in code\game\communications.dm to make the dept channels non-hardcoded, but I wasn't in an experimentive mood. --NEO
// --- If the frequency has not been assigned a name, just use the frequency as the name ---
if(!freq_text)
freq_text = format_frequency(display_freq)
// --- Some more pre-message formatting --- // --- Some more pre-message formatting ---
@@ -374,8 +341,8 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
var/part_b = "</span><b> \icon[radio]\[[freq_text]\][part_b_extra]</b> <span class='message'>" // Tweaked for security headsets -- TLE var/part_b = "</span><b> \icon[radio]\[[freq_text]\][part_b_extra]</b> <span class='message'>" // Tweaked for security headsets -- TLE
var/part_c = "</span></span>" var/part_c = "</span></span>"
// syndies! // Antags!
if (display_freq == SYND_FREQ) if (display_freq in ANTAG_FREQS)
part_a = "<span class='syndradio'><span class='name'>" part_a = "<span class='syndradio'><span class='name'>"
// centcomm channels (deathsquid and ert) // centcomm channels (deathsquid and ert)
else if (display_freq in CENT_FREQS) else if (display_freq in CENT_FREQS)
@@ -386,7 +353,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
part_a = "<span class='comradio'><span class='name'>" part_a = "<span class='comradio'><span class='name'>"
// AI private channel // AI private channel
else if (display_freq == 1447) else if (display_freq == AI_FREQ)
part_a = "<span class='airadio'><span class='name'>" part_a = "<span class='airadio'><span class='name'>"
// department radio formatting (poorly optimized, ugh) // department radio formatting (poorly optimized, ugh)
@@ -427,23 +394,23 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
//BR.messages_admin += blackbox_admin_msg //BR.messages_admin += blackbox_admin_msg
if(istype(blackbox)) if(istype(blackbox))
switch(display_freq) switch(display_freq)
if(1459) if(PUB_FREQ)
blackbox.msg_common += blackbox_msg blackbox.msg_common += blackbox_msg
if(1351) if(SCI_FREQ)
blackbox.msg_science += blackbox_msg blackbox.msg_science += blackbox_msg
if(1353) if(COMM_FREQ)
blackbox.msg_command += blackbox_msg blackbox.msg_command += blackbox_msg
if(1355) if(MED_FREQ)
blackbox.msg_medical += blackbox_msg blackbox.msg_medical += blackbox_msg
if(1357) if(ENG_FREQ)
blackbox.msg_engineering += blackbox_msg blackbox.msg_engineering += blackbox_msg
if(1359) if(SEC_FREQ)
blackbox.msg_security += blackbox_msg blackbox.msg_security += blackbox_msg
if(1441) if(DTH_FREQ)
blackbox.msg_deathsquad += blackbox_msg blackbox.msg_deathsquad += blackbox_msg
if(1213) if(SYND_FREQ)
blackbox.msg_syndicate += blackbox_msg blackbox.msg_syndicate += blackbox_msg
if(1347) if(SUP_FREQ)
blackbox.msg_cargo += blackbox_msg blackbox.msg_cargo += blackbox_msg
else else
blackbox.messages += blackbox_msg blackbox.messages += blackbox_msg
@@ -522,15 +489,15 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
receive |= R.send_hear(display_freq) receive |= R.send_hear(display_freq)
// --- Broadcast to syndicate radio! --- // --- Broadcast to antag radios! ---
else if(data == 3) else if(data == 3)
var/datum/radio_frequency/syndicateconnection = radio_controller.return_frequency(SYND_FREQ) for(var/freq in ANTAG_FREQS)
var/datum/radio_frequency/antag_connection = radio_controller.return_frequency(freq)
for (var/obj/item/device/radio/R in syndicateconnection.devices["[RADIO_CHAT]"]) for (var/obj/item/device/radio/R in antag_connection.devices["[RADIO_CHAT]"])
var/turf/position = get_turf(R) var/turf/position = get_turf(R)
if(position && position.z == level) if(position && position.z == level)
receive |= R.send_hear(SYND_FREQ) receive |= R.send_hear(freq)
// --- Broadcast to ALL radio devices --- // --- Broadcast to ALL radio devices ---
@@ -584,32 +551,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
/* --- Some miscellaneous variables to format the string output --- */ /* --- Some miscellaneous variables to format the string output --- */
var/part_a = "<span class='radio'><span class='name'>" // goes in the actual output var/part_a = "<span class='radio'><span class='name'>" // goes in the actual output
var/freq_text // the name of the channel var/freq_text = get_frequency_name(display_freq)
// --- Set the name of the channel ---
switch(display_freq)
if(SYND_FREQ)
freq_text = "#unkn"
if(COMM_FREQ)
freq_text = "Command"
if(1351)
freq_text = "Science"
if(1355)
freq_text = "Medical"
if(1357)
freq_text = "Engineering"
if(1359)
freq_text = "Security"
if(1347)
freq_text = "Supply"
//There's probably a way to use the list var of channels in code\game\communications.dm to make the dept channels non-hardcoded, but I wasn't in an experimentive mood. --NEO
// --- If the frequency has not been assigned a name, just use the frequency as the name ---
if(!freq_text)
freq_text = format_frequency(display_freq)
// --- Some more pre-message formatting --- // --- Some more pre-message formatting ---
@@ -623,7 +565,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
var/part_b = "</span><b> \icon[radio]\[[freq_text]\][part_b_extra]</b> <span class='message'>" // Tweaked for security headsets -- TLE var/part_b = "</span><b> \icon[radio]\[[freq_text]\][part_b_extra]</b> <span class='message'>" // Tweaked for security headsets -- TLE
var/part_c = "</span></span>" var/part_c = "</span></span>"
if (display_freq==SYND_FREQ) if (display_freq in ANTAG_FREQS)
part_a = "<span class='syndradio'><span class='name'>" part_a = "<span class='syndradio'><span class='name'>"
else if (display_freq==COMM_FREQ) else if (display_freq==COMM_FREQ)
part_a = "<span class='comradio'><span class='name'>" part_a = "<span class='comradio'><span class='name'>"
@@ -639,23 +581,23 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
//BR.messages_admin += blackbox_admin_msg //BR.messages_admin += blackbox_admin_msg
if(istype(blackbox)) if(istype(blackbox))
switch(display_freq) switch(display_freq)
if(1459) if(PUB_FREQ)
blackbox.msg_common += blackbox_msg blackbox.msg_common += blackbox_msg
if(1351) if(SCI_FREQ)
blackbox.msg_science += blackbox_msg blackbox.msg_science += blackbox_msg
if(1353) if(COMM_FREQ)
blackbox.msg_command += blackbox_msg blackbox.msg_command += blackbox_msg
if(1355) if(MED_FREQ)
blackbox.msg_medical += blackbox_msg blackbox.msg_medical += blackbox_msg
if(1357) if(ENG_FREQ)
blackbox.msg_engineering += blackbox_msg blackbox.msg_engineering += blackbox_msg
if(1359) if(SEC_FREQ)
blackbox.msg_security += blackbox_msg blackbox.msg_security += blackbox_msg
if(1441) if(DTH_FREQ)
blackbox.msg_deathsquad += blackbox_msg blackbox.msg_deathsquad += blackbox_msg
if(1213) if(SYND_FREQ)
blackbox.msg_syndicate += blackbox_msg blackbox.msg_syndicate += blackbox_msg
if(1347) if(SUP_FREQ)
blackbox.msg_cargo += blackbox_msg blackbox.msg_cargo += blackbox_msg
else else
blackbox.messages += blackbox_msg blackbox.messages += blackbox_msg
@@ -717,7 +659,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
"done" = 0, "done" = 0,
"level" = pos.z // The level it is being broadcasted at. "level" = pos.z // The level it is being broadcasted at.
) )
signal.frequency = 1459// Common channel signal.frequency = PUB_FREQ// Common channel
//#### Sending the signal to all subspace receivers ####// //#### Sending the signal to all subspace receivers ####//
for(var/obj/machinery/telecomms/receiver/R in telecomms_list) for(var/obj/machinery/telecomms/receiver/R in telecomms_list)

View File

@@ -58,7 +58,7 @@
id = "Receiver A" id = "Receiver A"
network = "tcommsat" network = "tcommsat"
autolinkers = list("receiverA") // link to relay autolinkers = list("receiverA") // link to relay
freq_listening = list(1351, 1355, 1347) // science, medical, supply freq_listening = list(SCI_FREQ, MED_FREQ, SUP_FREQ) // science, medical, supply
//--PRESET RIGHT--// //--PRESET RIGHT--//
@@ -67,7 +67,7 @@
id = "Receiver B" id = "Receiver B"
network = "tcommsat" network = "tcommsat"
autolinkers = list("receiverB") // link to relay autolinkers = list("receiverB") // link to relay
freq_listening = list(1353, 1357, 1359) //command, engineering, security freq_listening = list(COMM_FREQ, ENG_FREQ, SEC_FREQ) //command, engineering, security
//Common and other radio frequencies for people to freely use //Common and other radio frequencies for people to freely use
New() New()
@@ -80,7 +80,7 @@
network = "tcommsat" network = "tcommsat"
produces_heat = 0 produces_heat = 0
autolinkers = list("receiverCent") autolinkers = list("receiverCent")
freq_listening = list(1345, 1341) freq_listening = list(ERT_FREQ, DTH_FREQ)
//Buses //Buses
@@ -88,25 +88,25 @@
/obj/machinery/telecomms/bus/preset_one /obj/machinery/telecomms/bus/preset_one
id = "Bus 1" id = "Bus 1"
network = "tcommsat" network = "tcommsat"
freq_listening = list(1351, 1355) freq_listening = list(SCI_FREQ, MED_FREQ)
autolinkers = list("processor1", "science", "medical") autolinkers = list("processor1", "science", "medical")
/obj/machinery/telecomms/bus/preset_two /obj/machinery/telecomms/bus/preset_two
id = "Bus 2" id = "Bus 2"
network = "tcommsat" network = "tcommsat"
freq_listening = list(1347) freq_listening = list(SUP_FREQ)
autolinkers = list("processor2", "supply") autolinkers = list("processor2", "supply")
/obj/machinery/telecomms/bus/preset_three /obj/machinery/telecomms/bus/preset_three
id = "Bus 3" id = "Bus 3"
network = "tcommsat" network = "tcommsat"
freq_listening = list(1359, 1353) freq_listening = list(SEC_FREQ, COMM_FREQ)
autolinkers = list("processor3", "security", "command") autolinkers = list("processor3", "security", "command")
/obj/machinery/telecomms/bus/preset_four /obj/machinery/telecomms/bus/preset_four
id = "Bus 4" id = "Bus 4"
network = "tcommsat" network = "tcommsat"
freq_listening = list(1357) freq_listening = list(ENG_FREQ)
autolinkers = list("processor4", "engineering", "common") autolinkers = list("processor4", "engineering", "common")
/obj/machinery/telecomms/bus/preset_four/New() /obj/machinery/telecomms/bus/preset_four/New()
@@ -117,7 +117,7 @@
/obj/machinery/telecomms/bus/preset_cent /obj/machinery/telecomms/bus/preset_cent
id = "CentComm Bus" id = "CentComm Bus"
network = "tcommsat" network = "tcommsat"
freq_listening = list(1345, 1341) freq_listening = list(ERT_FREQ, DTH_FREQ)
produces_heat = 0 produces_heat = 0
autolinkers = list("processorCent", "centcomm") autolinkers = list("processorCent", "centcomm")
@@ -157,17 +157,17 @@
/obj/machinery/telecomms/server/presets/science /obj/machinery/telecomms/server/presets/science
id = "Science Server" id = "Science Server"
freq_listening = list(1351) freq_listening = list(SCI_FREQ)
autolinkers = list("science") autolinkers = list("science")
/obj/machinery/telecomms/server/presets/medical /obj/machinery/telecomms/server/presets/medical
id = "Medical Server" id = "Medical Server"
freq_listening = list(1355) freq_listening = list(MED_FREQ)
autolinkers = list("medical") autolinkers = list("medical")
/obj/machinery/telecomms/server/presets/supply /obj/machinery/telecomms/server/presets/supply
id = "Supply Server" id = "Supply Server"
freq_listening = list(1347) freq_listening = list(SUP_FREQ)
autolinkers = list("supply") autolinkers = list("supply")
/obj/machinery/telecomms/server/presets/common /obj/machinery/telecomms/server/presets/common
@@ -184,22 +184,22 @@
/obj/machinery/telecomms/server/presets/command /obj/machinery/telecomms/server/presets/command
id = "Command Server" id = "Command Server"
freq_listening = list(1353) freq_listening = list(COMM_FREQ)
autolinkers = list("command") autolinkers = list("command")
/obj/machinery/telecomms/server/presets/engineering /obj/machinery/telecomms/server/presets/engineering
id = "Engineering Server" id = "Engineering Server"
freq_listening = list(1357) freq_listening = list(ENG_FREQ)
autolinkers = list("engineering") autolinkers = list("engineering")
/obj/machinery/telecomms/server/presets/security /obj/machinery/telecomms/server/presets/security
id = "Security Server" id = "Security Server"
freq_listening = list(1359) freq_listening = list(SEC_FREQ)
autolinkers = list("security") autolinkers = list("security")
/obj/machinery/telecomms/server/presets/centcomm /obj/machinery/telecomms/server/presets/centcomm
id = "CentComm Server" id = "CentComm Server"
freq_listening = list(1345, 1341) freq_listening = list(ERT_FREQ, DTH_FREQ)
produces_heat = 0 produces_heat = 0
autolinkers = list("centcomm") autolinkers = list("centcomm")

View File

@@ -40,7 +40,7 @@
var/obj/machinery/bot/secbot/active // the active bot; if null, show bot list var/obj/machinery/bot/secbot/active // the active bot; if null, show bot list
var/list/botstatus // the status signal sent by the bot var/list/botstatus // the status signal sent by the bot
var/control_freq = 1447 var/control_freq = AI_FREQ
// create a new QM cartridge, and register to receive bot control & beacon message // create a new QM cartridge, and register to receive bot control & beacon message
New() New()
@@ -106,7 +106,7 @@
var/list/beacons var/list/beacons
var/beacon_freq = 1400 var/beacon_freq = 1400
var/control_freq = 1447 var/control_freq = AI_FREQ
// create a new QM cartridge, and register to receive bot control & beacon message // create a new QM cartridge, and register to receive bot control & beacon message
New() New()

View File

@@ -44,7 +44,7 @@
return -1 return -1
if (!src.listening) if (!src.listening)
return -1 return -1
if(freq == SYND_FREQ) if(freq in ANTAG_FREQS)
if(!(src.syndie)) if(!(src.syndie))
return -1//Prevents broadcast of messages over devices lacking the encryption return -1//Prevents broadcast of messages over devices lacking the encryption

View File

@@ -11,7 +11,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
item_state = "walkietalkie" item_state = "walkietalkie"
var/on = 1 // 0 for off var/on = 1 // 0 for off
var/last_transmission var/last_transmission
var/frequency = 1459 //common chat var/frequency = PUB_FREQ //common chat
var/traitor_frequency = 0 //tune to frequency to unlock traitor supplies var/traitor_frequency = 0 //tune to frequency to unlock traitor supplies
var/canhear_range = 3 // the range which mobs can hear this radio from var/canhear_range = 3 // the range which mobs can hear this radio from
var/obj/item/device/radio/patch_link = null var/obj/item/device/radio/patch_link = null
@@ -215,7 +215,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
Broadcast_Message(connection, A, Broadcast_Message(connection, A,
0, "*garbled automated announcement*", src, 0, "*garbled automated announcement*", src,
message, from, "Automated Announcement", from, "synthesized voice", message, from, "Automated Announcement", from, "synthesized voice",
4, 0, list(1), 1459) 4, 0, list(1), PUB_FREQ)
del(A) del(A)
return return
@@ -495,31 +495,12 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
if (length(heard_masked) || length(heard_normal) || length(heard_voice) || length(heard_garbled)) if (length(heard_masked) || length(heard_normal) || length(heard_voice) || length(heard_garbled))
var/part_a = "<span class='radio'><span class='name'>" var/part_a = "<span class='radio'><span class='name'>"
//var/part_b = "</span><b> \icon[src]\[[format_frequency(frequency)]\]</b> <span class='message'>" //var/part_b = "</span><b> \icon[src]\[[format_frequency(frequency)]\]</b> <span class='message'>"
var/freq_text var/freq_text= get_frequency_name(display_freq)
switch(display_freq)
if(SYND_FREQ)
freq_text = "#unkn"
if(COMM_FREQ)
freq_text = "Command"
if(1351)
freq_text = "Science"
if(1355)
freq_text = "Medical"
if(1357)
freq_text = "Engineering"
if(1359)
freq_text = "Security"
if(1347)
freq_text = "Supply"
//There's probably a way to use the list var of channels in code\game\communications.dm to make the dept channels non-hardcoded, but I wasn't in an experimentive mood. --NEO
if(!freq_text)
freq_text = format_frequency(display_freq)
var/part_b = "</span><b> \icon[src]\[[freq_text]\]</b> <span class='message'>" // Tweaked for security headsets -- TLE var/part_b = "</span><b> \icon[src]\[[freq_text]\]</b> <span class='message'>" // Tweaked for security headsets -- TLE
var/part_c = "</span></span>" var/part_c = "</span></span>"
if (display_freq==SYND_FREQ) if (display_freq in ANTAG_FREQS)
part_a = "<span class='syndradio'><span class='name'>" part_a = "<span class='syndradio'><span class='name'>"
else if (display_freq==COMM_FREQ) else if (display_freq==COMM_FREQ)
part_a = "<span class='comradio'><span class='name'>" part_a = "<span class='comradio'><span class='name'>"
@@ -536,25 +517,23 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
if(istype(blackbox)) if(istype(blackbox))
//BR.messages_admin += blackbox_admin_msg //BR.messages_admin += blackbox_admin_msg
switch(display_freq) switch(display_freq)
if(1459) if(PUB_FREQ)
blackbox.msg_common += blackbox_msg blackbox.msg_common += blackbox_msg
if(1351) if(SCI_FREQ)
blackbox.msg_science += blackbox_msg blackbox.msg_science += blackbox_msg
if(1353) if(COMM_FREQ)
blackbox.msg_command += blackbox_msg blackbox.msg_command += blackbox_msg
if(1355) if(MED_FREQ)
blackbox.msg_medical += blackbox_msg blackbox.msg_medical += blackbox_msg
if(1357) if(ENG_FREQ)
blackbox.msg_engineering += blackbox_msg blackbox.msg_engineering += blackbox_msg
if(1359) if(SEC_FREQ)
blackbox.msg_security += blackbox_msg blackbox.msg_security += blackbox_msg
if(1441) if(DTH_FREQ)
blackbox.msg_deathsquad += blackbox_msg blackbox.msg_deathsquad += blackbox_msg
if(1213) if(SYND_FREQ)
blackbox.msg_syndicate += blackbox_msg blackbox.msg_syndicate += blackbox_msg
if(1349) if(SUP_FREQ)
blackbox.msg_mining += blackbox_msg
if(1347)
blackbox.msg_cargo += blackbox_msg blackbox.msg_cargo += blackbox_msg
else else
blackbox.messages += blackbox_msg blackbox.messages += blackbox_msg
@@ -635,7 +614,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
var/turf/position = get_turf(src) var/turf/position = get_turf(src)
if(!position || !(position.z in level)) if(!position || !(position.z in level))
return -1 return -1
if(freq == SYND_FREQ) if(freq in ANTAG_FREQS)
if(!(src.syndie))//Checks to see if it's allowed on that frequency, based on the encryption keys if(!(src.syndie))//Checks to see if it's allowed on that frequency, based on the encryption keys
return -1 return -1
if (!on) if (!on)

View File

@@ -124,7 +124,7 @@ var/global/sent_strike_team = 0
/mob/living/carbon/human/proc/equip_death_commando(leader_selected = 0) /mob/living/carbon/human/proc/equip_death_commando(leader_selected = 0)
var/obj/item/device/radio/R = new /obj/item/device/radio/headset(src) var/obj/item/device/radio/R = new /obj/item/device/radio/headset(src)
R.set_frequency(1341) R.set_frequency(DTH_FREQ)
equip_to_slot_or_del(R, slot_l_ear) equip_to_slot_or_del(R, slot_l_ear)
if (leader_selected == 0) if (leader_selected == 0)
equip_to_slot_or_del(new /obj/item/clothing/under/color/green(src), slot_w_uniform) equip_to_slot_or_del(new /obj/item/clothing/under/color/green(src), slot_w_uniform)

View File

@@ -3,7 +3,7 @@ var/global/vox_tick = 1
/mob/living/carbon/human/proc/equip_vox_raider() /mob/living/carbon/human/proc/equip_vox_raider()
var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate(src) var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate(src)
R.set_frequency(SYND_FREQ) //Same frequency as the syndicate team in Nuke mode. R.set_frequency(SYND_FREQ)
equip_to_slot_or_del(R, slot_l_ear) equip_to_slot_or_del(R, slot_l_ear)
equip_to_slot_or_del(new /obj/item/clothing/under/vox/vox_robes(src), slot_w_uniform) equip_to_slot_or_del(new /obj/item/clothing/under/vox/vox_robes(src), slot_w_uniform)

View File

@@ -216,7 +216,6 @@ var/obj/machinery/blackbox_recorder/blackbox
var/list/msg_security = list() var/list/msg_security = list()
var/list/msg_deathsquad = list() var/list/msg_deathsquad = list()
var/list/msg_syndicate = list() var/list/msg_syndicate = list()
var/list/msg_mining = list()
var/list/msg_cargo = list() var/list/msg_cargo = list()
var/list/datum/feedback_variable/feedback = new() var/list/datum/feedback_variable/feedback = new()
@@ -241,7 +240,6 @@ var/obj/machinery/blackbox_recorder/blackbox
BR.msg_security = msg_security BR.msg_security = msg_security
BR.msg_deathsquad = msg_deathsquad BR.msg_deathsquad = msg_deathsquad
BR.msg_syndicate = msg_syndicate BR.msg_syndicate = msg_syndicate
BR.msg_mining = msg_mining
BR.msg_cargo = msg_cargo BR.msg_cargo = msg_cargo
BR.feedback = feedback BR.feedback = feedback
BR.messages = messages BR.messages = messages
@@ -282,7 +280,6 @@ var/obj/machinery/blackbox_recorder/blackbox
feedback_add_details("radio_usage","SEC-[msg_security.len]") feedback_add_details("radio_usage","SEC-[msg_security.len]")
feedback_add_details("radio_usage","DTH-[msg_deathsquad.len]") feedback_add_details("radio_usage","DTH-[msg_deathsquad.len]")
feedback_add_details("radio_usage","SYN-[msg_syndicate.len]") feedback_add_details("radio_usage","SYN-[msg_syndicate.len]")
feedback_add_details("radio_usage","MIN-[msg_mining.len]")
feedback_add_details("radio_usage","CAR-[msg_cargo.len]") feedback_add_details("radio_usage","CAR-[msg_cargo.len]")
feedback_add_details("radio_usage","OTH-[messages.len]") feedback_add_details("radio_usage","OTH-[messages.len]")
feedback_add_details("radio_usage","PDA-[pda_msg_amt]") feedback_add_details("radio_usage","PDA-[pda_msg_amt]")

View File

@@ -8,7 +8,7 @@
icon = 'icons/obj/device.dmi' icon = 'icons/obj/device.dmi'
icon_state = "pinoff" //pinonfar, pinonmedium, pinonclose, pinondirect, pinonnull icon_state = "pinoff" //pinonfar, pinonmedium, pinonclose, pinondirect, pinonnull
item_state = "electronic" item_state = "electronic"
var/frequency = 1459 var/frequency = PUB_FREQ
var/scan_ticks = 0 var/scan_ticks = 0
var/obj/item/device/radio/target_radio var/obj/item/device/radio/target_radio

View File

@@ -122,7 +122,7 @@ client/verb/tcsrun()
if(Server.freq_listening.len > 0) if(Server.freq_listening.len > 0)
signal.frequency = Server.freq_listening[1] signal.frequency = Server.freq_listening[1]
else else
signal.frequency = 1459 signal.frequency = PUB_FREQ
signal.data["name"] = "" signal.data["name"] = ""
signal.data["job"] = "" signal.data["job"] = ""
signal.data["reject"] = 0 signal.data["reject"] = 0

View File

@@ -62,13 +62,13 @@
interpreter.SetVar("WEST" , WEST) // WEST (8) interpreter.SetVar("WEST" , WEST) // WEST (8)
// Channel macros // Channel macros
interpreter.SetVar("$common", 1459) interpreter.SetVar("$common", PUB_FREQ)
interpreter.SetVar("$science", 1351) interpreter.SetVar("$science", SCI_FREQ)
interpreter.SetVar("$command", 1353) interpreter.SetVar("$command", COMM_FREQ)
interpreter.SetVar("$medical", 1355) interpreter.SetVar("$medical", MED_FREQ)
interpreter.SetVar("$engineering",1357) interpreter.SetVar("$engineering",ENG_FREQ)
interpreter.SetVar("$security", 1359) interpreter.SetVar("$security", SEC_FREQ)
interpreter.SetVar("$supply", 1347) interpreter.SetVar("$supply", SUP_FREQ)
// Signal data // Signal data
@@ -236,7 +236,7 @@ datum/signal
source = "[html_encode(uppertext(S.id))]" source = "[html_encode(uppertext(S.id))]"
hradio = new // sets the hradio as a radio intercom hradio = new // sets the hradio as a radio intercom
if(!freq) if(!freq)
freq = 1459 freq = PUB_FREQ
if(findtext(num2text(freq), ".")) // if the frequency has been set as a decimal if(findtext(num2text(freq), ".")) // if the frequency has been set as a decimal
freq *= 10 // shift the decimal one place freq *= 10 // shift the decimal one place