Replaces radio channel names and keys with defines

This commit is contained in:
ShizCalev
2018-11-16 09:28:40 -05:00
committed by Nich
parent aa2c71bd41
commit 4e2d1576d0
26 changed files with 206 additions and 153 deletions

View File

@@ -1,5 +1,62 @@
// Radios use a large variety of predefined frequencies. // Radios use a large variety of predefined frequencies.
#define RADIO_CHANNEL_COMMON "Common"
#define RADIO_KEY_COMMON ";"
#define RADIO_TOKEN_COMMON ";"
#define RADIO_CHANNEL_DEPARTMENT "department"
#define RADIO_KEY_DEPARTMENT "h"
#define RADIO_TOKEN_DEPARTMENT ":h"
#define RADIO_CHANNEL_SECURITY "Security"
#define RADIO_KEY_SECURITY "s"
#define RADIO_TOKEN_SECURITY ":s"
#define RADIO_CHANNEL_ENGINEERING "Engineering"
#define RADIO_KEY_ENGINEERING "e"
#define RADIO_TOKEN_ENGINEERING ":e"
#define RADIO_CHANNEL_COMMAND "Command"
#define RADIO_KEY_COMMAND "c"
#define RADIO_TOKEN_COMMAND ":c"
#define RADIO_CHANNEL_SCIENCE "Science"
#define RADIO_KEY_SCIENCE "n"
#define RADIO_TOKEN_SCIENCE ":n"
#define RADIO_CHANNEL_MEDICAL "Medical"
#define RADIO_KEY_MEDICAL "m"
#define RADIO_TOKEN_MEDICAL ":m"
#define RADIO_CHANNEL_SUPPLY "Supply"
#define RADIO_KEY_SUPPLY "u"
#define RADIO_TOKEN_SUPPLY ":u"
#define RADIO_CHANNEL_SERVICE "Service"
#define RADIO_KEY_SERVICE "v"
#define RADIO_TOKEN_SERVICE ":v"
#define RADIO_CHANNEL_BINARY "Binary"
#define RADIO_KEY_BINARY "b"
#define RADIO_TOKEN_BINARY ":b"
#define RADIO_CHANNEL_AI_PRIVATE "AI Private"
#define RADIO_KEY_AI_PRIVATE "o"
#define RADIO_TOKEN_AI_PRIVATE ":o"
#define RADIO_CHANNEL_SYNDICATE "Syndicate"
#define RADIO_KEY_SYNDICATE "t"
#define RADIO_TOKEN_SYNDICATE ":t"
#define RADIO_CHANNEL_CENTCOM "CentCom"
#define RADIO_KEY_CENTCOM "y"
#define RADIO_TOKEN_CENTCOM ":y"
#define RADIO_CHANNEL_CTF_RED "Red Team"
#define RADIO_CHANNEL_CTF_BLUE "Blue Team"
#define MIN_FREE_FREQ 1201 // ------------------------------------------------- #define MIN_FREE_FREQ 1201 // -------------------------------------------------
// Frequencies are always odd numbers and range from 1201 to 1599. // Frequencies are always odd numbers and range from 1201 to 1599.

View File

@@ -91,35 +91,35 @@ GLOBAL_LIST_EMPTY(all_radios)
// use in maps, such as in intercoms. // use in maps, such as in intercoms.
GLOBAL_LIST_INIT(radiochannels, list( GLOBAL_LIST_INIT(radiochannels, list(
"Common" = FREQ_COMMON, RADIO_CHANNEL_COMMON = FREQ_COMMON,
"Science" = FREQ_SCIENCE, RADIO_CHANNEL_SCIENCE = FREQ_SCIENCE,
"Command" = FREQ_COMMAND, RADIO_CHANNEL_COMMAND = FREQ_COMMAND,
"Medical" = FREQ_MEDICAL, RADIO_CHANNEL_MEDICAL = FREQ_MEDICAL,
"Engineering" = FREQ_ENGINEERING, RADIO_CHANNEL_ENGINEERING = FREQ_ENGINEERING,
"Security" = FREQ_SECURITY, RADIO_CHANNEL_SECURITY = FREQ_SECURITY,
"CentCom" = FREQ_CENTCOM, RADIO_CHANNEL_CENTCOM = FREQ_CENTCOM,
"Syndicate" = FREQ_SYNDICATE, RADIO_CHANNEL_SYNDICATE = FREQ_SYNDICATE,
"Supply" = FREQ_SUPPLY, RADIO_CHANNEL_SUPPLY = FREQ_SUPPLY,
"Service" = FREQ_SERVICE, RADIO_CHANNEL_SERVICE = FREQ_SERVICE,
"AI Private" = FREQ_AI_PRIVATE, RADIO_CHANNEL_AI_PRIVATE = FREQ_AI_PRIVATE,
"Red Team" = FREQ_CTF_RED, RADIO_CHANNEL_CTF_RED = FREQ_CTF_RED,
"Blue Team" = FREQ_CTF_BLUE RADIO_CHANNEL_CTF_BLUE = FREQ_CTF_BLUE
)) ))
GLOBAL_LIST_INIT(reverseradiochannels, list( GLOBAL_LIST_INIT(reverseradiochannels, list(
"[FREQ_COMMON]" = "Common", "[FREQ_COMMON]" = RADIO_CHANNEL_COMMON,
"[FREQ_SCIENCE]" = "Science", "[FREQ_SCIENCE]" = RADIO_CHANNEL_SCIENCE,
"[FREQ_COMMAND]" = "Command", "[FREQ_COMMAND]" = RADIO_CHANNEL_COMMAND,
"[FREQ_MEDICAL]" = "Medical", "[FREQ_MEDICAL]" = RADIO_CHANNEL_MEDICAL,
"[FREQ_ENGINEERING]" = "Engineering", "[FREQ_ENGINEERING]" = RADIO_CHANNEL_ENGINEERING,
"[FREQ_SECURITY]" = "Security", "[FREQ_SECURITY]" = RADIO_CHANNEL_SECURITY,
"[FREQ_CENTCOM]" = "CentCom", "[FREQ_CENTCOM]" = RADIO_CHANNEL_CENTCOM,
"[FREQ_SYNDICATE]" = "Syndicate", "[FREQ_SYNDICATE]" = RADIO_CHANNEL_SYNDICATE,
"[FREQ_SUPPLY]" = "Supply", "[FREQ_SUPPLY]" = RADIO_CHANNEL_SUPPLY,
"[FREQ_SERVICE]" = "Service", "[FREQ_SERVICE]" = RADIO_CHANNEL_SERVICE,
"[FREQ_AI_PRIVATE]" = "AI Private", "[FREQ_AI_PRIVATE]" = RADIO_CHANNEL_AI_PRIVATE,
"[FREQ_CTF_RED]" = "Red Team", "[FREQ_CTF_RED]" = RADIO_CHANNEL_CTF_RED,
"[FREQ_CTF_BLUE]" = "Blue Team" "[FREQ_CTF_BLUE]" = RADIO_CHANNEL_CTF_BLUE
)) ))
/datum/radio_frequency /datum/radio_frequency

View File

@@ -6,7 +6,7 @@
var/siphoning = FALSE var/siphoning = FALSE
var/next_warning = 0 var/next_warning = 0
var/obj/item/radio/radio var/obj/item/radio/radio
var/radio_channel = "Common" var/radio_channel = RADIO_CHANNEL_COMMON
var/minimum_time_between_warnings = 400 var/minimum_time_between_warnings = 400
var/syphoning_credits = 0 var/syphoning_credits = 0

View File

@@ -31,7 +31,7 @@
var/internal_radio = TRUE var/internal_radio = TRUE
var/obj/item/radio/radio var/obj/item/radio/radio
var/radio_key = /obj/item/encryptionkey/headset_med var/radio_key = /obj/item/encryptionkey/headset_med
var/radio_channel = "Medical" var/radio_channel = RADIO_CHANNEL_MEDICAL
var/obj/effect/countdown/clonepod/countdown var/obj/effect/countdown/clonepod/countdown

View File

@@ -314,13 +314,13 @@ GLOBAL_LIST_EMPTY(allConsoles)
switch(text2num(href_list["emergency"])) switch(text2num(href_list["emergency"]))
if(1) //Security if(1) //Security
radio_freq = FREQ_SECURITY radio_freq = FREQ_SECURITY
emergency = "Security" emergency = RADIO_CHANNEL_SECURITY
if(2) //Engineering if(2) //Engineering
radio_freq = FREQ_ENGINEERING radio_freq = FREQ_ENGINEERING
emergency = "Engineering" emergency = RADIO_CHANNEL_ENGINEERING
if(3) //Medical if(3) //Medical
radio_freq = FREQ_MEDICAL radio_freq = FREQ_MEDICAL
emergency = "Medical" emergency = RADIO_CHANNEL_MEDICAL
if(radio_freq) if(radio_freq)
Radio.set_frequency(radio_freq) Radio.set_frequency(radio_freq)
Radio.talk_into(src,"[emergency] emergency in [department]!!",radio_freq,get_spans(),get_default_language()) Radio.talk_into(src,"[emergency] emergency in [department]!!",radio_freq,get_spans(),get_default_language())

View File

@@ -1,6 +1,6 @@
/obj/item/encryptionkey /obj/item/encryptionkey
name = "standard encryption key" name = "standard encryption key"
desc = "An encryption key for a radio headset. Has no special codes in it. WHY DOES IT EXIST? ASK NANOTRASEN." desc = "An encryption key for a radio headset."
icon = 'icons/obj/radio.dmi' icon = 'icons/obj/radio.dmi'
icon_state = "cypherkey" icon_state = "cypherkey"
w_class = WEIGHT_CLASS_TINY w_class = WEIGHT_CLASS_TINY
@@ -9,124 +9,119 @@
var/independent = FALSE var/independent = FALSE
var/list/channels = list() var/list/channels = list()
/obj/item/encryptionkey/Initialize()
. = ..()
if(!channels.len)
desc = "An encryption key for a radio headset. Has no special codes in it. You should probably tell a coder!"
/obj/item/encryptionkey/examine(mob/user)
. = ..()
if(LAZYLEN(channels))
var/list/examine_text_list = list()
for(var/i in channels)
examine_text_list += "[GLOB.channel_tokens[i]] - [lowertext(i)]"
to_chat(user, "<span class='notice'>It can access the following channels; [jointext(examine_text_list, ", ")].</span>")
/obj/item/encryptionkey/syndicate /obj/item/encryptionkey/syndicate
name = "syndicate encryption key" name = "syndicate encryption key"
desc = "An encryption key for a radio headset. To access the syndicate channel, use :t."
icon_state = "syn_cypherkey" icon_state = "syn_cypherkey"
channels = list("Syndicate" = 1) channels = list(RADIO_CHANNEL_SYNDICATE = 1)
syndie = 1//Signifies that it de-crypts Syndicate transmissions syndie = TRUE//Signifies that it de-crypts Syndicate transmissions
/obj/item/encryptionkey/binary /obj/item/encryptionkey/binary
name = "binary translator key" name = "binary translator key"
desc = "An encryption key for a radio headset. To access the binary channel, use :b."
icon_state = "bin_cypherkey" icon_state = "bin_cypherkey"
translate_binary = TRUE translate_binary = TRUE
/obj/item/encryptionkey/headset_sec /obj/item/encryptionkey/headset_sec
name = "security radio encryption key" name = "security radio encryption key"
desc = "An encryption key for a radio headset. To access the security channel, use :s."
icon_state = "sec_cypherkey" icon_state = "sec_cypherkey"
channels = list("Security" = 1) channels = list(RADIO_CHANNEL_SECURITY = 1)
/obj/item/encryptionkey/headset_eng /obj/item/encryptionkey/headset_eng
name = "engineering radio encryption key" name = "engineering radio encryption key"
desc = "An encryption key for a radio headset. To access the engineering channel, use :e."
icon_state = "eng_cypherkey" icon_state = "eng_cypherkey"
channels = list("Engineering" = 1) channels = list(RADIO_CHANNEL_ENGINEERING = 1)
/obj/item/encryptionkey/headset_rob /obj/item/encryptionkey/headset_rob
name = "robotics radio encryption key" name = "robotics radio encryption key"
desc = "An encryption key for a radio headset. To access the engineering channel, use :e. For research, use :n."
icon_state = "rob_cypherkey" icon_state = "rob_cypherkey"
channels = list("Science" = 1, "Engineering" = 1) channels = list(RADIO_CHANNEL_SCIENCE = 1, RADIO_CHANNEL_ENGINEERING = 1)
/obj/item/encryptionkey/headset_med /obj/item/encryptionkey/headset_med
name = "medical radio encryption key" name = "medical radio encryption key"
desc = "An encryption key for a radio headset. To access the medical channel, use :m."
icon_state = "med_cypherkey" icon_state = "med_cypherkey"
channels = list("Medical" = 1) channels = list(RADIO_CHANNEL_MEDICAL = 1)
/obj/item/encryptionkey/headset_sci /obj/item/encryptionkey/headset_sci
name = "science radio encryption key" name = "science radio encryption key"
desc = "An encryption key for a radio headset. To access the science channel, use :n."
icon_state = "sci_cypherkey" icon_state = "sci_cypherkey"
channels = list("Science" = 1) channels = list(RADIO_CHANNEL_SCIENCE = 1)
/obj/item/encryptionkey/headset_medsci /obj/item/encryptionkey/headset_medsci
name = "medical research radio encryption key" name = "medical research radio encryption key"
desc = "An encryption key for a radio headset. To access the medical channel, use :m. For science, use :n."
icon_state = "medsci_cypherkey" icon_state = "medsci_cypherkey"
channels = list("Science" = 1, "Medical" = 1) channels = list(RADIO_CHANNEL_SCIENCE = 1, RADIO_CHANNEL_MEDICAL = 1)
/obj/item/encryptionkey/headset_com /obj/item/encryptionkey/headset_com
name = "command radio encryption key" name = "command radio encryption key"
desc = "An encryption key for a radio headset. To access the command channel, use :c."
icon_state = "com_cypherkey" icon_state = "com_cypherkey"
channels = list("Command" = 1) channels = list(RADIO_CHANNEL_COMMAND = 1)
/obj/item/encryptionkey/heads/captain /obj/item/encryptionkey/heads/captain
name = "\proper the captain's encryption key" name = "\proper the captain's encryption key"
desc = "An encryption key for a radio headset. Channels are as follows: :c - command, :s - security, :e - engineering, :u - supply, :v - service, :m - medical, :n - science."
icon_state = "cap_cypherkey" icon_state = "cap_cypherkey"
channels = list("Command" = 1, "Security" = 1, "Engineering" = 0, "Science" = 0, "Medical" = 0, "Supply" = 0, "Service" = 0) channels = list(RADIO_CHANNEL_COMMAND = 1, RADIO_CHANNEL_SECURITY = 1, RADIO_CHANNEL_ENGINEERING = 0, RADIO_CHANNEL_SCIENCE = 0, RADIO_CHANNEL_MEDICAL = 0, RADIO_CHANNEL_SUPPLY = 0, RADIO_CHANNEL_SERVICE = 0)
/obj/item/encryptionkey/heads/rd /obj/item/encryptionkey/heads/rd
name = "\proper the research director's encryption key" name = "\proper the research director's encryption key"
desc = "An encryption key for a radio headset. To access the science channel, use :n. For command, use :c."
icon_state = "rd_cypherkey" icon_state = "rd_cypherkey"
channels = list("Science" = 1, "Command" = 1) channels = list(RADIO_CHANNEL_SCIENCE = 1, RADIO_CHANNEL_COMMAND = 1)
/obj/item/encryptionkey/heads/hos /obj/item/encryptionkey/heads/hos
name = "\proper the head of security's encryption key" name = "\proper the head of security's encryption key"
desc = "An encryption key for a radio headset. To access the security channel, use :s. For command, use :c."
icon_state = "hos_cypherkey" icon_state = "hos_cypherkey"
channels = list("Security" = 1, "Command" = 1) channels = list(RADIO_CHANNEL_SECURITY = 1, RADIO_CHANNEL_COMMAND = 1)
/obj/item/encryptionkey/heads/ce /obj/item/encryptionkey/heads/ce
name = "\proper the chief engineer's encryption key" name = "\proper the chief engineer's encryption key"
desc = "An encryption key for a radio headset. To access the engineering channel, use :e. For command, use :c."
icon_state = "ce_cypherkey" icon_state = "ce_cypherkey"
channels = list("Engineering" = 1, "Command" = 1) channels = list(RADIO_CHANNEL_ENGINEERING = 1, RADIO_CHANNEL_COMMAND = 1)
/obj/item/encryptionkey/heads/cmo /obj/item/encryptionkey/heads/cmo
name = "\proper the chief medical officer's encryption key" name = "\proper the chief medical officer's encryption key"
desc = "An encryption key for a radio headset. To access the medical channel, use :m. For command, use :c."
icon_state = "cmo_cypherkey" icon_state = "cmo_cypherkey"
channels = list("Medical" = 1, "Command" = 1) channels = list(RADIO_CHANNEL_MEDICAL = 1, RADIO_CHANNEL_COMMAND = 1)
/obj/item/encryptionkey/heads/hop /obj/item/encryptionkey/heads/hop
name = "\proper the head of personnel's encryption key" name = "\proper the head of personnel's encryption key"
desc = "An encryption key for a radio headset. Channels are as follows: :u - supply, :v - service, :c - command."
icon_state = "hop_cypherkey" icon_state = "hop_cypherkey"
channels = list("Supply" = 1, "Service" = 1, "Command" = 1) channels = list(RADIO_CHANNEL_SUPPLY = 1, RADIO_CHANNEL_SERVICE = 1, RADIO_CHANNEL_COMMAND = 1)
/obj/item/encryptionkey/headset_cargo /obj/item/encryptionkey/headset_cargo
name = "supply radio encryption key" name = "supply radio encryption key"
desc = "An encryption key for a radio headset. To access the supply channel, use :u."
icon_state = "cargo_cypherkey" icon_state = "cargo_cypherkey"
channels = list("Supply" = 1) channels = list(RADIO_CHANNEL_SUPPLY = 1)
/obj/item/encryptionkey/headset_mining /obj/item/encryptionkey/headset_mining
name = "mining radio encryption key" name = "mining radio encryption key"
desc = "An encryption key for a radio headset. To access the supply channel, use :u. For science, use :n."
icon_state = "cargo_cypherkey" icon_state = "cargo_cypherkey"
channels = list("Supply" = 1, "Science" = 1) channels = list(RADIO_CHANNEL_SUPPLY = 1, RADIO_CHANNEL_SCIENCE = 1)
/obj/item/encryptionkey/headset_service /obj/item/encryptionkey/headset_service
name = "service radio encryption key" name = "service radio encryption key"
desc = "An encryption key for a radio headset. To access the service channel, use :v."
icon_state = "srv_cypherkey" icon_state = "srv_cypherkey"
channels = list("Service" = 1) channels = list(RADIO_CHANNEL_SERVICE = 1)
/obj/item/encryptionkey/headset_cent /obj/item/encryptionkey/headset_cent
name = "\improper CentCom radio encryption key" name = "\improper CentCom radio encryption key"
desc = "An encryption key for a radio headset. To access the CentCom channel, use :y."
icon_state = "cent_cypherkey" icon_state = "cent_cypherkey"
independent = TRUE independent = TRUE
channels = list("CentCom" = 1) channels = list(RADIO_CHANNEL_CENTCOM = 1)
/obj/item/encryptionkey/ai //ported from NT, this goes 'inside' the AI. /obj/item/encryptionkey/ai //ported from NT, this goes 'inside' the AI.
channels = list("Command" = 1, "Security" = 1, "Engineering" = 1, "Science" = 1, "Medical" = 1, "Supply" = 1, "Service" = 1, "AI Private" = 1) channels = list(RADIO_CHANNEL_COMMAND = 1, RADIO_CHANNEL_SECURITY = 1, RADIO_CHANNEL_ENGINEERING = 1, RADIO_CHANNEL_SCIENCE = 1, RADIO_CHANNEL_MEDICAL = 1, RADIO_CHANNEL_SUPPLY = 1, RADIO_CHANNEL_SERVICE = 1, RADIO_CHANNEL_AI_PRIVATE = 1)
/obj/item/encryptionkey/secbot /obj/item/encryptionkey/secbot
channels = list("AI Private"=1,"Security"=1) channels = list(RADIO_CHANNEL_AI_PRIVATE = 1, RADIO_CHANNEL_SECURITY = 1)

View File

@@ -1,16 +1,17 @@
// Used for translating channels to tokens on examination // Used for translating channels to tokens on examination
GLOBAL_LIST_INIT(channel_tokens, list( GLOBAL_LIST_INIT(channel_tokens, list(
"Common" = ";", RADIO_CHANNEL_COMMON = RADIO_TOKEN_COMMON,
"Science" = ":n", RADIO_CHANNEL_SCIENCE = RADIO_TOKEN_SCIENCE,
"Command" = ":c", RADIO_CHANNEL_COMMAND = RADIO_TOKEN_COMMAND,
"Medical" = ":m", RADIO_CHANNEL_MEDICAL = RADIO_TOKEN_MEDICAL,
"Engineering" = ":e", RADIO_CHANNEL_ENGINEERING = RADIO_TOKEN_ENGINEERING,
"Security" = ":s", RADIO_CHANNEL_SECURITY = RADIO_TOKEN_SECURITY,
"CentCom" = ":y", RADIO_CHANNEL_CENTCOM = RADIO_TOKEN_CENTCOM,
"Syndicate" = ":t", RADIO_CHANNEL_SYNDICATE = RADIO_TOKEN_SYNDICATE,
"Supply" = ":u", RADIO_CHANNEL_SUPPLY = RADIO_TOKEN_SUPPLY,
"Service" = ":v", RADIO_CHANNEL_SERVICE = RADIO_TOKEN_SERVICE,
"Binary" = ":b" RADIO_CHANNEL_BINARY = RADIO_TOKEN_BINARY,
RADIO_CHANNEL_AI_PRIVATE = RADIO_TOKEN_AI_PRIVATE
)) ))
/obj/item/radio/headset /obj/item/radio/headset
@@ -35,19 +36,19 @@ GLOBAL_LIST_INIT(channel_tokens, list(
if(item_flags & IN_INVENTORY && loc == user) if(item_flags & IN_INVENTORY && loc == user)
// construction of frequency description // construction of frequency description
var/list/avail_chans = list("Use ; for the currently tuned frequency") var/list/avail_chans = list("Use [RADIO_KEY_COMMON] for the currently tuned frequency")
if(translate_binary) if(translate_binary)
avail_chans += "use :b for Binary" avail_chans += "use [RADIO_TOKEN_BINARY] for [RADIO_CHANNEL_BINARY]"
if(length(channels)) if(length(channels))
for(var/i in 1 to length(channels)) for(var/i in 1 to length(channels))
if(i == 1) if(i == 1)
avail_chans += "use :h or [GLOB.channel_tokens[channels[i]]] for [lowertext(channels[i])]" avail_chans += "use [RADIO_TOKEN_DEPARTMENT] or [GLOB.channel_tokens[channels[i]]] for [lowertext(channels[i])]"
else else
avail_chans += "use [GLOB.channel_tokens[channels[i]]] for [lowertext(channels[i])]" avail_chans += "use [GLOB.channel_tokens[channels[i]]] for [lowertext(channels[i])]"
to_chat(user, "<span class='notice'>A small screen on the headset displays the following available frequencies:\n[english_list(avail_chans)].") to_chat(user, "<span class='notice'>A small screen on the headset displays the following available frequencies:\n[english_list(avail_chans)].")
if(command) if(command)
to_chat(user, "<span class='notice'>Alt-click to toggle the high-volume mode.</span>") to_chat(user, "<span class='info'>Alt-click to toggle the high-volume mode.</span>")
else else
to_chat(user, "<span class='notice'>A small screen on the headset flashes, it's too small to read without holding or wearing the headset.</span>") to_chat(user, "<span class='notice'>A small screen on the headset flashes, it's too small to read without holding or wearing the headset.</span>")

View File

@@ -221,7 +221,7 @@
// From the channel, determine the frequency and get a reference to it. // From the channel, determine the frequency and get a reference to it.
var/freq var/freq
if(channel && channels && channels.len > 0) if(channel && channels && channels.len > 0)
if(channel == "department") if(channel == RADIO_CHANNEL_DEPARTMENT)
channel = channels[1] channel = channels[1]
freq = secure_radio_connections[channel] freq = secure_radio_connections[channel]
if (!channels[channel]) // if the channel is turned off, don't broadcast if (!channels[channel]) // if the channel is turned off, don't broadcast

View File

@@ -1920,14 +1920,14 @@
return return
var/mob/M = locate(href_list["CentComReply"]) var/mob/M = locate(href_list["CentComReply"])
usr.client.admin_headset_message(M, "CentCom") usr.client.admin_headset_message(M, RADIO_CHANNEL_CENTCOM)
else if(href_list["SyndicateReply"]) else if(href_list["SyndicateReply"])
if(!check_rights(R_ADMIN)) if(!check_rights(R_ADMIN))
return return
var/mob/M = locate(href_list["SyndicateReply"]) var/mob/M = locate(href_list["SyndicateReply"])
usr.client.admin_headset_message(M, "Syndicate") usr.client.admin_headset_message(M, RADIO_CHANNEL_SYNDICATE)
else if(href_list["HeadsetMessage"]) else if(href_list["HeadsetMessage"])
if(!check_rights(R_ADMIN)) if(!check_rights(R_ADMIN))

View File

@@ -62,7 +62,7 @@
.["laws"] = borg.laws ? borg.laws.get_law_list(include_zeroth = TRUE) : list() .["laws"] = borg.laws ? borg.laws.get_law_list(include_zeroth = TRUE) : list()
.["channels"] = list() .["channels"] = list()
for (var/k in GLOB.radiochannels) for (var/k in GLOB.radiochannels)
if (k == "Common") if (k == RADIO_CHANNEL_COMMON)
continue continue
.["channels"] += list(list("name" = k, "installed" = (k in borg.radio.channels))) .["channels"] += list(list("name" = k, "installed" = (k in borg.radio.channels)))
.["cell"] = borg.cell ? list("missing" = FALSE, "maxcharge" = borg.cell.maxcharge, "charge" = borg.cell.charge) : list("missing" = TRUE, "maxcharge" = 1, "charge" = 0) .["cell"] = borg.cell ? list("missing" = FALSE, "maxcharge" = borg.cell.maxcharge, "charge" = borg.cell.charge) : list("missing" = TRUE, "maxcharge" = 1, "charge" = 0)
@@ -164,13 +164,13 @@
if (channel in borg.radio.channels) // We're removing a channel if (channel in borg.radio.channels) // We're removing a channel
if (!borg.radio.keyslot) // There's no encryption key. This shouldn't happen but we can cope if (!borg.radio.keyslot) // There's no encryption key. This shouldn't happen but we can cope
borg.radio.channels -= channel borg.radio.channels -= channel
if (channel == "Syndicate") if (channel == RADIO_CHANNEL_SYNDICATE)
borg.radio.syndie = FALSE borg.radio.syndie = FALSE
else if (channel == "CentCom") else if (channel == "CentCom")
borg.radio.independent = FALSE borg.radio.independent = FALSE
else else
borg.radio.keyslot.channels -= channel borg.radio.keyslot.channels -= channel
if (channel == "Syndicate") if (channel == RADIO_CHANNEL_SYNDICATE)
borg.radio.keyslot.syndie = FALSE borg.radio.keyslot.syndie = FALSE
else if (channel == "CentCom") else if (channel == "CentCom")
borg.radio.keyslot.independent = FALSE borg.radio.keyslot.independent = FALSE
@@ -180,7 +180,7 @@
if (!borg.radio.keyslot) // Assert that an encryption key exists if (!borg.radio.keyslot) // Assert that an encryption key exists
borg.radio.keyslot = new (borg.radio) borg.radio.keyslot = new (borg.radio)
borg.radio.keyslot.channels[channel] = 1 borg.radio.keyslot.channels[channel] = 1
if (channel == "Syndicate") if (channel == RADIO_CHANNEL_SYNDICATE)
borg.radio.keyslot.syndie = TRUE borg.radio.keyslot.syndie = TRUE
else if (channel == "CentCom") else if (channel == "CentCom")
borg.radio.keyslot.independent = TRUE borg.radio.keyslot.independent = TRUE

View File

@@ -65,7 +65,7 @@
return return
if (!sender) if (!sender)
sender = input("Who is the message from?", "Sender") as null|anything in list("CentCom","Syndicate") sender = input("Who is the message from?", "Sender") as null|anything in list(RADIO_CHANNEL_CENTCOM,RADIO_CHANNEL_SYNDICATE)
if(!sender) if(!sender)
return return

View File

@@ -27,7 +27,7 @@
var/obj/item/radio/radio var/obj/item/radio/radio
var/radio_key = /obj/item/encryptionkey/headset_med var/radio_key = /obj/item/encryptionkey/headset_med
var/radio_channel = "Medical" var/radio_channel = RADIO_CHANNEL_MEDICAL
var/running_anim = FALSE var/running_anim = FALSE

View File

@@ -69,7 +69,7 @@ Head of Personnel
flag = HOP flag = HOP
department_head = list("Captain") department_head = list("Captain")
department_flag = CIVILIAN department_flag = CIVILIAN
head_announce = list("Supply", "Service") head_announce = list(RADIO_CHANNEL_SUPPLY, RADIO_CHANNEL_SERVICE)
faction = "Station" faction = "Station"
total_positions = 1 total_positions = 1
spawn_positions = 1 spawn_positions = 1

View File

@@ -6,7 +6,7 @@ Chief Medical Officer
flag = CMO_JF flag = CMO_JF
department_head = list("Captain") department_head = list("Captain")
department_flag = MEDSCI department_flag = MEDSCI
head_announce = list("Medical") head_announce = list(RADIO_CHANNEL_MEDICAL)
faction = "Station" faction = "Station"
total_positions = 1 total_positions = 1
spawn_positions = 1 spawn_positions = 1

View File

@@ -12,7 +12,7 @@ Head of Security
flag = HOS flag = HOS
department_head = list("Captain") department_head = list("Captain")
department_flag = ENGSEC department_flag = ENGSEC
head_announce = list("Security") head_announce = list(RADIO_CHANNEL_SECURITY)
faction = "Station" faction = "Station"
total_positions = 1 total_positions = 1
spawn_positions = 1 spawn_positions = 1

View File

@@ -71,9 +71,9 @@
if(ears) if(ears)
var/obj/item/radio/headset/dongle = ears var/obj/item/radio/headset/dongle = ears
if(!istype(dongle)) if(!istype(dongle))
return 0 return FALSE
if(dongle.translate_binary) if(dongle.translate_binary)
return 1 return TRUE
/mob/living/carbon/human/radio(message, message_mode, list/spans, language) /mob/living/carbon/human/radio(message, message_mode, list/spans, language)
. = ..() . = ..()

View File

@@ -7,25 +7,25 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
"i" = "intercom", "i" = "intercom",
// Department // Department
"h" = "department", RADIO_KEY_DEPARTMENT = RADIO_CHANNEL_DEPARTMENT,
"c" = "Command", RADIO_KEY_COMMAND = RADIO_CHANNEL_COMMAND,
"n" = "Science", RADIO_KEY_SCIENCE = RADIO_CHANNEL_SCIENCE,
"m" = "Medical", RADIO_KEY_MEDICAL = RADIO_CHANNEL_MEDICAL,
"e" = "Engineering", RADIO_KEY_ENGINEERING = RADIO_CHANNEL_ENGINEERING,
"s" = "Security", RADIO_KEY_SECURITY = RADIO_CHANNEL_SECURITY,
"u" = "Supply", RADIO_KEY_SUPPLY = RADIO_CHANNEL_SUPPLY,
"v" = "Service", RADIO_KEY_SERVICE = RADIO_CHANNEL_SERVICE,
// Faction // Faction
"t" = "Syndicate", RADIO_KEY_SYNDICATE = RADIO_CHANNEL_SYNDICATE,
"y" = "CentCom", RADIO_KEY_CENTCOM = RADIO_CHANNEL_CENTCOM,
// Admin // Admin
"p" = "admin", "p" = "admin",
"d" = "deadmin", "d" = "deadmin",
// Misc // Misc
"o" = "AI Private", // AI Upload channel RADIO_KEY_AI_PRIVATE = RADIO_CHANNEL_AI_PRIVATE, // AI Upload channel
"x" = "cords", // vocal cords, used by Voice of God "x" = "cords", // vocal cords, used by Voice of God
@@ -37,25 +37,25 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
"ø" = "intercom", "ø" = "intercom",
// Department // Department
"ð" = "department", "ð" = RADIO_CHANNEL_DEPARTMENT,
"ñ" = "Command", "ñ" = RADIO_CHANNEL_COMMAND,
"ò" = "Science", "ò" = RADIO_CHANNEL_SCIENCE,
"ü" = "Medical", "ü" = RADIO_CHANNEL_MEDICAL,
"ó" = "Engineering", "ó" = RADIO_CHANNEL_ENGINEERING,
"û" = "Security", "û" = RADIO_CHANNEL_SECURITY,
"ã" = "Supply", "ã" = RADIO_CHANNEL_SUPPLY,
"ì" = "Service", "ì" = RADIO_CHANNEL_SERVICE,
// Faction // Faction
"å" = "Syndicate", "å" = RADIO_CHANNEL_SYNDICATE,
"í" = "CentCom", "í" = RADIO_CHANNEL_CENTCOM,
// Admin // Admin
"ç" = "admin", "ç" = "admin",
"â" = "deadmin", "â" = "deadmin",
// Misc // Misc
"ù" = "AI Private", "ù" = RADIO_CHANNEL_AI_PRIVATE,
"÷" = "cords" "÷" = "cords"
)) ))

View File

@@ -58,7 +58,7 @@
var/mob/living/silicon/ai/calling_ai //Links a bot to the AI calling it. var/mob/living/silicon/ai/calling_ai //Links a bot to the AI calling it.
var/obj/item/radio/Radio //The bot's radio, for speaking to people. var/obj/item/radio/Radio //The bot's radio, for speaking to people.
var/radio_key = null //which channels can the bot listen to var/radio_key = null //which channels can the bot listen to
var/radio_channel = "Common" //The bot's default radio channel var/radio_channel = RADIO_CHANNEL_COMMON //The bot's default radio channel
var/auto_patrol = 0// set to make bot automatically patrol var/auto_patrol = 0// set to make bot automatically patrol
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)
var/turf/summon_target // The turf of a user summoning a bot. var/turf/summon_target // The turf of a user summoning a bot.

View File

@@ -9,7 +9,7 @@
health = 25 health = 25
maxHealth = 25 maxHealth = 25
radio_key = /obj/item/encryptionkey/headset_service radio_key = /obj/item/encryptionkey/headset_service
radio_channel = "Service" //Service radio_channel = RADIO_CHANNEL_SERVICE //Service
bot_type = CLEAN_BOT bot_type = CLEAN_BOT
model = "Cleanbot" model = "Cleanbot"
bot_core_type = /obj/machinery/bot_core/cleanbot bot_core_type = /obj/machinery/bot_core/cleanbot

View File

@@ -13,7 +13,7 @@
mob_size = MOB_SIZE_LARGE mob_size = MOB_SIZE_LARGE
radio_key = /obj/item/encryptionkey/headset_sec radio_key = /obj/item/encryptionkey/headset_sec
radio_channel = "Security" radio_channel = RADIO_CHANNEL_SECURITY
bot_type = SEC_BOT bot_type = SEC_BOT
model = "ED-209" model = "ED-209"
bot_core = /obj/machinery/bot_core/secbot bot_core = /obj/machinery/bot_core/secbot

View File

@@ -11,7 +11,7 @@
spacewalk = TRUE spacewalk = TRUE
radio_key = /obj/item/encryptionkey/headset_eng radio_key = /obj/item/encryptionkey/headset_eng
radio_channel = "Engineering" radio_channel = RADIO_CHANNEL_ENGINEERING
bot_type = FLOOR_BOT bot_type = FLOOR_BOT
model = "Floorbot" model = "Floorbot"
bot_core = /obj/machinery/bot_core/floorbot bot_core = /obj/machinery/bot_core/floorbot

View File

@@ -11,7 +11,7 @@
pass_flags = PASSMOB pass_flags = PASSMOB
radio_key = /obj/item/encryptionkey/headset_service //doesn't have security key radio_key = /obj/item/encryptionkey/headset_service //doesn't have security key
radio_channel = "Service" //Doesn't even use the radio anyway. radio_channel = RADIO_CHANNEL_SERVICE //Doesn't even use the radio anyway.
bot_type = HONK_BOT bot_type = HONK_BOT
model = "Honkbot" model = "Honkbot"
bot_core_type = /obj/machinery/bot_core/honkbot bot_core_type = /obj/machinery/bot_core/honkbot

View File

@@ -17,7 +17,7 @@
status_flags = (CANPUSH | CANSTUN) status_flags = (CANPUSH | CANSTUN)
radio_key = /obj/item/encryptionkey/headset_med radio_key = /obj/item/encryptionkey/headset_med
radio_channel = "Medical" radio_channel = RADIO_CHANNEL_MEDICAL
bot_type = MED_BOT bot_type = MED_BOT
model = "Medibot" model = "Medibot"

View File

@@ -23,7 +23,7 @@
mob_size = MOB_SIZE_LARGE mob_size = MOB_SIZE_LARGE
radio_key = /obj/item/encryptionkey/headset_cargo radio_key = /obj/item/encryptionkey/headset_cargo
radio_channel = "Supply" radio_channel = RADIO_CHANNEL_SUPPLY
bot_type = MULE_BOT bot_type = MULE_BOT
model = "MULE" model = "MULE"
@@ -580,7 +580,7 @@
// called when bot reaches current target // called when bot reaches current target
/mob/living/simple_animal/bot/mulebot/proc/at_target() /mob/living/simple_animal/bot/mulebot/proc/at_target()
if(!reached_target) if(!reached_target)
radio_channel = "Supply" //Supply channel radio_channel = RADIO_CHANNEL_SUPPLY //Supply channel
audible_message("[src] makes a chiming sound!", "<span class='italics'>You hear a chime.</span>") audible_message("[src] makes a chiming sound!", "<span class='italics'>You hear a chime.</span>")
playsound(loc, 'sound/machines/chime.ogg', 50, 0) playsound(loc, 'sound/machines/chime.ogg', 50, 0)
reached_target = 1 reached_target = 1
@@ -591,7 +591,7 @@
to_chat(calling_ai, "<span class='notice'>[icon2html(src, calling_ai)] [src] wirelessly plays a chiming sound!</span>") to_chat(calling_ai, "<span class='notice'>[icon2html(src, calling_ai)] [src] wirelessly plays a chiming sound!</span>")
playsound(calling_ai, 'sound/machines/chime.ogg',40, 0) playsound(calling_ai, 'sound/machines/chime.ogg',40, 0)
calling_ai = null calling_ai = null
radio_channel = "AI Private" //Report on AI Private instead if the AI is controlling us. radio_channel = RADIO_CHANNEL_AI_PRIVATE //Report on AI Private instead if the AI is controlling us.
if(load) // if loaded, unload at target if(load) // if loaded, unload at target
if(report_delivery) if(report_delivery)

View File

@@ -11,7 +11,7 @@
pass_flags = PASSMOB pass_flags = PASSMOB
radio_key = /obj/item/encryptionkey/secbot //AI Priv + Security radio_key = /obj/item/encryptionkey/secbot //AI Priv + Security
radio_channel = "Security" //Security channel radio_channel = RADIO_CHANNEL_SECURITY //Security channel
bot_type = SEC_BOT bot_type = SEC_BOT
model = "Securitron" model = "Securitron"
bot_core_type = /obj/machinery/bot_core/secbot bot_core_type = /obj/machinery/bot_core/secbot
@@ -61,7 +61,7 @@
/mob/living/simple_animal/bot/secbot/pingsky /mob/living/simple_animal/bot/secbot/pingsky
name = "Officer Pingsky" name = "Officer Pingsky"
desc = "It's Officer Pingsky! Delegated to satellite guard duty for harbouring anti-human sentiment." desc = "It's Officer Pingsky! Delegated to satellite guard duty for harbouring anti-human sentiment."
radio_channel = "AI Private" radio_channel = RADIO_CHANNEL_AI_PRIVATE
/mob/living/simple_animal/bot/secbot/Initialize() /mob/living/simple_animal/bot/secbot/Initialize()
. = ..() . = ..()

View File

@@ -250,23 +250,23 @@
clearlist(available_channels) clearlist(available_channels)
for(var/ch in headset_to_add.channels) for(var/ch in headset_to_add.channels)
switch(ch) switch(ch)
if("Engineering") if(RADIO_CHANNEL_ENGINEERING)
available_channels.Add(":e") available_channels.Add(RADIO_TOKEN_ENGINEERING)
if("Command") if(RADIO_CHANNEL_COMMAND)
available_channels.Add(":c") available_channels.Add(RADIO_TOKEN_COMMAND)
if("Security") if(RADIO_CHANNEL_SECURITY)
available_channels.Add(":s") available_channels.Add(RADIO_TOKEN_SECURITY)
if("Science") if(RADIO_CHANNEL_SCIENCE)
available_channels.Add(":n") available_channels.Add(RADIO_TOKEN_SCIENCE)
if("Medical") if(RADIO_CHANNEL_MEDICAL)
available_channels.Add(":m") available_channels.Add(RADIO_TOKEN_MEDICAL)
if("Supply") if(RADIO_CHANNEL_SUPPLY)
available_channels.Add(":u") available_channels.Add(RADIO_TOKEN_SUPPLY)
if("Service") if(RADIO_CHANNEL_SERVICE)
available_channels.Add(":v") available_channels.Add(RADIO_TOKEN_SERVICE)
if(headset_to_add.translate_binary) if(headset_to_add.translate_binary)
available_channels.Add(":b") available_channels.Add(RADIO_TOKEN_BINARY)
else else
..() ..()