Common and Entertainment Keys (#8541)

Standard Encryption Keys now come with both Common and Entertainment channels in-built.
This commit is contained in:
Geeves
2020-04-05 20:16:07 +02:00
committed by GitHub
parent 22b29ae2a9
commit 760595049a
7 changed files with 81 additions and 59 deletions

View File

@@ -0,0 +1,16 @@
#define CHANNEL_COMMON "Common"
#define CHANNEL_ENTERTAINMENT "Entertainment"
#define CHANNEL_COMMAND "Command"
#define CHANNEL_SCIENCE "Science"
#define CHANNEL_MEDICAL "Medical"
#define CHANNEL_ENGINEERING "Engineering"
#define CHANNEL_SECURITY "Security"
#define CHANNEL_SUPPLY "Supply"
#define CHANNEL_SERVICE "Service"
#define CHANNEL_AI_PRIVATE "AI Private"
#define CHANNEL_RESPONSE_TEAM "Response Team"
#define CHANNEL_RAIDER "Raider"
#define CHANNEL_MERCENARY "Mercenary"
#define CHANNEL_NINJA "Ninja"

View File

@@ -1,159 +1,147 @@
/obj/item/device/encryptionkey/
/obj/item/device/encryptionkey
name = "standard encryption key"
desc = "An encryption key for a radio headset. Contains cypherkeys."
icon = 'icons/obj/radio.dmi'
icon_state = "cypherkey"
item_state = ""
w_class = 1
w_class = ITEMSIZE_TINY
slot_flags = SLOT_EARS
var/translate_binary = 0
var/translate_hive = 0
var/translate_hivenet = 0
var/syndie = 0
var/list/channels = list()
var/translate_binary = FALSE
var/translate_hive = FALSE
var/translate_hivenet = FALSE
var/syndie = FALSE // Signifies that it de-crypts Syndicate transmissions
var/list/channels = list(CHANNEL_COMMON = TRUE, CHANNEL_ENTERTAINMENT = TRUE)
/obj/item/device/encryptionkey/attackby(obj/item/W as obj, mob/user as mob)
/obj/item/device/encryptionkey/attackby(obj/item/W, mob/user)
return
/obj/item/device/encryptionkey/syndicate
icon_state = "cypherkey"
channels = list("Mercenary" = 1)
channels = list(CHANNEL_COMMON = TRUE, CHANNEL_ENTERTAINMENT = TRUE, CHANNEL_MERCENARY = TRUE)
origin_tech = list(TECH_ILLEGAL = 3)
description_antag = "An encryption key that allows you to intercept comms and speak on private non-station channels. Use :t to access the private channel."
syndie = 1//Signifies that it de-crypts Syndicate transmissions
syndie = TRUE
/obj/item/device/encryptionkey/raider
icon_state = "cypherkey"
channels = list("Raider" = 1)
channels = list(CHANNEL_COMMON = TRUE, CHANNEL_ENTERTAINMENT = TRUE, CHANNEL_RAIDER = TRUE)
origin_tech = list(TECH_ILLEGAL = 2)
syndie = 1
syndie = TRUE
/obj/item/device/encryptionkey/ninja
icon_state = "cypherkey"
channels = list("Ninja" = 1)
channels = list(CHANNEL_COMMON = TRUE, CHANNEL_ENTERTAINMENT = TRUE, CHANNEL_NINJA = TRUE)
origin_tech = list(TECH_ILLEGAL = 3)
syndie = 1
syndie = TRUE
/obj/item/device/encryptionkey/binary
icon_state = "cypherkey"
translate_binary = 1
translate_binary = TRUE
origin_tech = list(TECH_ILLEGAL = 3)
/obj/item/device/encryptionkey/hivenet
name = "hivenet encryption chip"
desc = "It appears to be a Vaurca hivenet encryption chip, for localized broadcasts."
translate_hivenet = 1
translate_hivenet = TRUE
icon = 'icons/obj/stock_parts.dmi'
icon_state = "neuralchip"
/obj/item/device/encryptionkey/headset_sec
name = "security radio encryption key"
icon_state = "sec_cypherkey"
channels = list("Security" = 1)
channels = list(CHANNEL_SECURITY = TRUE)
/obj/item/device/encryptionkey/headset_eng
name = "engineering radio encryption key"
icon_state = "eng_cypherkey"
channels = list("Engineering" = 1)
channels = list(CHANNEL_ENGINEERING = TRUE)
/obj/item/device/encryptionkey/headset_rob
name = "robotics radio encryption key"
icon_state = "rob_cypherkey"
channels = list("Engineering" = 1, "Science" = 1)
channels = list(CHANNEL_ENGINEERING = TRUE, CHANNEL_SCIENCE = TRUE)
/obj/item/device/encryptionkey/headset_med
name = "medical radio encryption key"
icon_state = "med_cypherkey"
channels = list("Medical" = 1)
channels = list(CHANNEL_MEDICAL = TRUE)
/obj/item/device/encryptionkey/headset_sci
name = "science radio encryption key"
icon_state = "sci_cypherkey"
channels = list("Science" = 1)
channels = list(CHANNEL_SCIENCE = TRUE)
/obj/item/device/encryptionkey/headset_medsci
name = "medical research radio encryption key"
icon_state = "medsci_cypherkey"
channels = list("Medical" = 1, "Science" = 1)
channels = list(CHANNEL_MEDICAL = TRUE, CHANNEL_SCIENCE = TRUE)
/obj/item/device/encryptionkey/headset_com
name = "command radio encryption key"
icon_state = "com_cypherkey"
channels = list("Command" = 1)
channels = list(CHANNEL_COMMAND = TRUE)
/obj/item/device/encryptionkey/heads/captain
name = "captain's encryption key"
icon_state = "cap_cypherkey"
channels = list("Command" = 1, "Security" = 1, "Engineering" = 0, "Science" = 0, "Medical" = 0, "Supply" = 0, "Service" = 0)
channels = list(CHANNEL_COMMAND = TRUE, CHANNEL_SECURITY = TRUE, CHANNEL_ENGINEERING = FALSE, CHANNEL_SCIENCE = FALSE, CHANNEL_MEDICAL = FALSE, CHANNEL_SUPPLY = FALSE, CHANNEL_SERVICE = FALSE)
/obj/item/device/encryptionkey/heads/ai_integrated
name = "ai integrated encryption key"
desc = "Integrated encryption key"
icon_state = "cap_cypherkey"
channels = list("Command" = 1, "Security" = 1, "Engineering" = 1, "Science" = 1, "Medical" = 1, "Supply" = 1, "Service" = 1, "AI Private" = 1)
channels = list(CHANNEL_COMMAND = TRUE, CHANNEL_SECURITY = TRUE, CHANNEL_ENGINEERING = TRUE, CHANNEL_SCIENCE = TRUE, CHANNEL_MEDICAL = TRUE, CHANNEL_SUPPLY = TRUE, CHANNEL_SERVICE = TRUE, CHANNEL_AI_PRIVATE = TRUE)
/obj/item/device/encryptionkey/heads/rd
name = "research director's encryption key"
icon_state = "rd_cypherkey"
channels = list("Science" = 1, "Command" = 1)
channels = list(CHANNEL_SCIENCE = TRUE, CHANNEL_COMMAND = TRUE)
/obj/item/device/encryptionkey/heads/hos
name = "head of security's encryption key"
icon_state = "hos_cypherkey"
channels = list("Security" = 1, "Command" = 1)
channels = list(CHANNEL_SECURITY = TRUE, CHANNEL_COMMAND = TRUE)
/obj/item/device/encryptionkey/heads/ce
name = "chief engineer's encryption key"
icon_state = "ce_cypherkey"
channels = list("Engineering" = 1, "Command" = 1)
channels = list(CHANNEL_ENGINEERING = TRUE, CHANNEL_COMMAND = TRUE)
/obj/item/device/encryptionkey/heads/cmo
name = "chief medical officer's encryption key"
icon_state = "cmo_cypherkey"
channels = list("Medical" = 1, "Command" = 1)
channels = list(CHANNEL_MEDICAL = TRUE, CHANNEL_COMMAND = TRUE)
/obj/item/device/encryptionkey/heads/hop
name = "head of personnel's encryption key"
icon_state = "hop_cypherkey"
channels = list("Supply" = 1, "Service" = 1, "Command" = 1, "Security" = 0)
channels = list(CHANNEL_SUPPLY = TRUE, CHANNEL_SERVICE = TRUE, CHANNEL_COMMAND = TRUE, CHANNEL_SECURITY = FALSE)
/*
/obj/item/device/encryptionkey/headset_mine
name = "mining radio encryption key"
icon_state = "mine_cypherkey"
channels = list("Mining" = 1)
/obj/item/device/encryptionkey/heads/qm
name = "quartermaster's encryption key"
icon_state = "qm_cypherkey"
channels = list("Cargo" = 1, "Mining" = 1)
*/
/obj/item/device/encryptionkey/headset_cargo
name = "supply radio encryption key"
icon_state = "cargo_cypherkey"
channels = list("Supply" = 1)
channels = list(CHANNEL_SUPPLY = TRUE)
/obj/item/device/encryptionkey/headset_service
name = "service radio encryption key"
icon_state = "srv_cypherkey"
channels = list("Service" = 1)
channels = list(CHANNEL_SERVICE = TRUE)
/obj/item/device/encryptionkey/ert
name = "\improper ERT radio encryption key"
channels = list("Response Team" = 1, "Science" = 1, "Command" = 1, "Medical" = 1, "Engineering" = 1, "Security" = 1, "Supply" = 1, "Service" = 1)
channels = list(CHANNEL_RESPONSE_TEAM = TRUE, CHANNEL_SCIENCE = TRUE, CHANNEL_COMMAND = TRUE, CHANNEL_MEDICAL = TRUE, CHANNEL_ENGINEERING = TRUE, CHANNEL_SECURITY = TRUE, CHANNEL_SUPPLY = TRUE, CHANNEL_SERVICE = TRUE)
/obj/item/device/encryptionkey/onlyert
name = "\improper ERT radio encryption key"
channels = list("Response Team" = 1)
channels = list(CHANNEL_RESPONSE_TEAM = TRUE)
/obj/item/device/encryptionkey/entertainment
name = "entertainment radio key"
channels = list("Entertainment" = 1)
channels = list(CHANNEL_ENTERTAINMENT = TRUE)
/obj/item/device/encryptionkey/rev
name = "standard encryption key"
desc = "An encryption key for a radio headset. Contains cypherkeys."
channels = list("Raider" = 1)
channels = list(CHANNEL_COMMON = TRUE, CHANNEL_ENTERTAINMENT = TRUE, CHANNEL_RAIDER = TRUE)
origin_tech = list(TECH_ILLEGAL = 2)
description_antag = "An encryption key that allows you to speak on private non-station channels. Use :x to access the private channel."

View File

@@ -29,10 +29,8 @@
recalculateChannels(1)
/obj/item/device/radio/headset/Destroy()
qdel(keyslot1)
qdel(keyslot2)
keyslot1 = null
keyslot2 = null
QDEL_NULL(keyslot1)
QDEL_NULL(keyslot2)
return ..()
/obj/item/device/radio/headset/list_channels(var/mob/user)

View File

@@ -36,7 +36,7 @@ var/global/list/default_medbay_channels = list(
var/b_stat = 0
var/broadcasting = 0
var/listening = 1
var/list/channels = list() //see communications.dm for full list. First channel is a "default" for :h
var/list/channels = list() //see communications.dm for full list. First non-common, non-entertainment channel is a "default" for :h
var/subspace_transmission = 0
var/syndie = 0//Holder to see if it's a syndicate encrypted radio
flags = CONDUCT
@@ -231,8 +231,14 @@ var/global/list/default_medbay_channels = list(
/obj/item/device/radio/proc/autosay(var/message, var/from, var/channel) //BS12 EDIT
var/datum/radio_frequency/connection = null
if(channel && channels && channels.len > 0)
if (channel == "department")
channel = channels[1]
if(channel == "department")
for(var/freq in channels)
if(freq == "Common" || freq == "Entertainment")
continue
channel = freq
break
if(channel == "department") // didn't find one, use first one
channel = channels[1]
connection = secure_radio_connections[channel]
else
connection = radio_connection
@@ -259,9 +265,14 @@ var/global/list/default_medbay_channels = list(
// Otherwise, if a channel is specified, look for it.
if(channels && channels.len > 0)
if (message_mode == "department") // Department radio shortcut
message_mode = channels[1]
if(message_mode == "department") // Department radio shortcut
for(var/freq in channels)
if(freq == "Common" || freq == "Entertainment")
continue
message_mode = freq
break
if(message_mode == "department") // didn't find one, use first one
message_mode = channels[1]
if (channels[message_mode]) // only broadcast if the channel is set on
return secure_radio_connections[message_mode]

View File

@@ -4,6 +4,7 @@ var/list/department_radio_keys = list(
":i" = "intercom", ".i" = "intercom",
":h" = "department", ".h" = "department",
":+" = "special", ".+" = "special", //activate radio-specific special functions
":a" = "Common", ".a" = "Common",
":c" = "Command", ".c" = "Command",
":n" = "Science", ".n" = "Science",
":m" = "Medical", ".m" = "Medical",
@@ -21,6 +22,7 @@ var/list/department_radio_keys = list(
":L" = "left ear", ".L" = "left ear",
":I" = "intercom", ".I" = "intercom",
":H" = "department", ".H" = "department",
":A" = "Common", ".A" = "Common",
":C" = "Command", ".C" = "Command",
":N" = "Science", ".N" = "Science",
":M" = "Medical", ".M" = "Medical",