Ports "Replaces radio channel names and keys with defines"

This commit is contained in:
Ghommie
2019-07-17 00:52:41 +02:00
parent 8c1b7c4f22
commit ee32e1680f
36 changed files with 291 additions and 189 deletions
+3 -3
View File
@@ -4,14 +4,14 @@
return
var/message_mode = get_message_mode(message)
if(client && (message_mode == "admin" || message_mode == "deadmin"))
if(client && (message_mode == MODE_ADMIN || message_mode == MODE_DEADMIN))
message = copytext(message, 3)
if(findtext(message, " ", 1, 2))
message = copytext(message, 2)
if(message_mode == "admin")
if(message_mode == MODE_ADMIN)
client.cmd_admin_say(message)
else if(message_mode == "deadmin")
else if(message_mode == MODE_DEADMIN)
client.dsay(message)
return
+4 -4
View File
@@ -53,14 +53,14 @@
if(ears)
var/obj/item/radio/headset/dongle = ears
if(!istype(dongle))
return 0
return FALSE
if(dongle.translate_binary)
return 1
return TRUE
/mob/living/carbon/human/radio(message, message_mode, list/spans, language)
. = ..()
if(. != 0)
return .
if(.)
return
switch(message_mode)
if(MODE_HEADSET)
+36 -36
View File
@@ -2,61 +2,61 @@ GLOBAL_LIST_INIT(department_radio_prefixes, list(":", "."))
GLOBAL_LIST_INIT(department_radio_keys, list(
// Location
"r" = "right hand",
"l" = "left hand",
"i" = "intercom",
MODE_KEY_R_HAND = MODE_R_HAND,
MODE_KEY_L_HAND = MODE_L_HAND,
MODE_KEY_INTERCOM = MODE_INTERCOM,
// Department
"h" = "department",
"c" = "Command",
"n" = "Science",
"m" = "Medical",
"e" = "Engineering",
"s" = "Security",
"u" = "Supply",
"v" = "Service",
MODE_KEY_DEPARTMENT = MODE_DEPARTMENT,
RADIO_KEY_COMMAND = RADIO_CHANNEL_COMMAND,
RADIO_KEY_SCIENCE = RADIO_CHANNEL_SCIENCE,
RADIO_KEY_MEDICAL = RADIO_CHANNEL_MEDICAL,
RADIO_KEY_ENGINEERING = RADIO_CHANNEL_ENGINEERING,
RADIO_KEY_SECURITY = RADIO_CHANNEL_SECURITY,
RADIO_KEY_SUPPLY = RADIO_CHANNEL_SUPPLY,
RADIO_KEY_SERVICE = RADIO_CHANNEL_SERVICE,
// Faction
"t" = "Syndicate",
"y" = "CentCom",
RADIO_KEY_SYNDICATE = RADIO_CHANNEL_SYNDICATE,
RADIO_KEY_CENTCOM = RADIO_CHANNEL_CENTCOM,
// Admin
"p" = "admin",
"d" = "deadmin",
MODE_KEY_ADMIN = MODE_ADMIN,
MODE_KEY_DEADMIN = MODE_DEADMIN,
// Misc
"o" = "AI Private", // AI Upload channel
"x" = "cords", // vocal cords, used by Voice of God
RADIO_KEY_AI_PRIVATE = RADIO_CHANNEL_AI_PRIVATE, // AI Upload channel
MODE_KEY_VOCALCORDS = MODE_VOCALCORDS, // vocal cords, used by Voice of God
//kinda localization -- rastaf0
//same keys as above, but on russian keyboard layout. This file uses cp1251 as encoding.
// Location
"ê" = "right hand",
"ä" = "left hand",
"ø" = "intercom",
"ê" = MODE_R_HAND,
"ä" = MODE_L_HAND,
"ø" = MODE_INTERCOM,
// Department
"ð" = "department",
"ñ" = "Command",
"ò" = "Science",
"ü" = "Medical",
"ó" = "Engineering",
"û" = "Security",
"ã" = "Supply",
"ì" = "Service",
"ð" = MODE_DEPARTMENT,
"ñ" = RADIO_CHANNEL_COMMAND,
"ò" = RADIO_CHANNEL_SCIENCE,
"ü" = RADIO_CHANNEL_MEDICAL,
"ó" = RADIO_CHANNEL_ENGINEERING,
"û" = RADIO_CHANNEL_SECURITY,
"ã" = RADIO_CHANNEL_SUPPLY,
"ì" = RADIO_CHANNEL_SERVICE,
// Faction
"å" = "Syndicate",
"í" = "CentCom",
"å" = RADIO_CHANNEL_SYNDICATE,
"í" = RADIO_CHANNEL_CENTCOM,
// Admin
"ç" = "admin",
"â" = "deadmin",
"ç" = MODE_ADMIN,
"â" = MODE_ADMIN,
// Misc
"ù" = "AI Private",
"÷" = "cords"
"ù" = RADIO_CHANNEL_AI_PRIVATE,
"÷" = MODE_VOCALCORDS
))
/mob/living/proc/Ellipsis(original_msg, chance = 50, keep_words)
@@ -105,12 +105,12 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
if(findtext(message, " ", 1, 2))
message = copytext(message, 2)
if(message_mode == "admin")
if(message_mode == MODE_ADMIN)
if(client)
client.cmd_admin_say(message)
return
if(message_mode == "deadmin")
if(message_mode == MODE_DEADMIN)
if(client)
client.dsay(message)
return
@@ -61,7 +61,7 @@
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/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/turf/patrol_target // this is turf to navigate to (location of beacon)
var/turf/summon_target // The turf of a user summoning a bot.
@@ -9,7 +9,7 @@
health = 25
maxHealth = 25
radio_key = /obj/item/encryptionkey/headset_service
radio_channel = "Service" //Service
radio_channel = RADIO_CHANNEL_SERVICE //Service
bot_type = CLEAN_BOT
model = "Cleanbot"
bot_core_type = /obj/machinery/bot_core/cleanbot
@@ -155,7 +155,7 @@
else
shuffle = TRUE //Shuffle the list the next time we scan so we dont both go the same way.
path = list()
if(!path || path.len == 0) //No path, need a new one
//Try to produce a path to the target, and ignore airlocks to which it has access.
path = get_path_to(src, target.loc, /turf/proc/Distance_cardinal, 0, 30, id=access_card)
@@ -13,7 +13,7 @@
mob_size = MOB_SIZE_LARGE
radio_key = /obj/item/encryptionkey/headset_sec
radio_channel = "Security"
radio_channel = RADIO_CHANNEL_SECURITY
bot_type = SEC_BOT
model = "ED-209"
bot_core = /obj/machinery/bot_core/secbot
@@ -16,7 +16,7 @@
spacewalk = TRUE
radio_key = /obj/item/encryptionkey/headset_eng
radio_channel = "Engineering"
radio_channel = RADIO_CHANNEL_ENGINEERING
bot_type = FIRE_BOT
model = "Firebot"
bot_core = /obj/machinery/bot_core/firebot
@@ -11,7 +11,7 @@
spacewalk = TRUE
radio_key = /obj/item/encryptionkey/headset_eng
radio_channel = "Engineering"
radio_channel = RADIO_CHANNEL_ENGINEERING
bot_type = FLOOR_BOT
model = "Floorbot"
bot_core = /obj/machinery/bot_core/floorbot
@@ -11,7 +11,6 @@
pass_flags = PASSMOB
radio_key = /obj/item/encryptionkey/headset_service //doesn't have security key
radio_channel = "Service" //Doesn't even use the radio anyway.
bot_type = HONK_BOT
model = "Honkbot"
bot_core_type = /obj/machinery/bot_core/honkbot
@@ -17,7 +17,7 @@
status_flags = (CANPUSH | CANSTUN)
radio_key = /obj/item/encryptionkey/headset_med
radio_channel = "Medical"
radio_channel = RADIO_CHANNEL_MEDICAL
bot_type = MED_BOT
model = "Medibot"
@@ -23,7 +23,7 @@
mob_size = MOB_SIZE_LARGE
radio_key = /obj/item/encryptionkey/headset_cargo
radio_channel = "Supply"
radio_channel = RADIO_CHANNEL_SUPPLY
bot_type = MULE_BOT
model = "MULE"
@@ -11,7 +11,7 @@
pass_flags = PASSMOB
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
model = "Securitron"
bot_core_type = /obj/machinery/bot_core/secbot
@@ -61,7 +61,7 @@
/mob/living/simple_animal/bot/secbot/pingsky
name = "Officer Pingsky"
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()
. = ..()
+15 -15
View File
@@ -241,23 +241,23 @@
clearlist(available_channels)
for(var/ch in headset_to_add.channels)
switch(ch)
if("Engineering")
available_channels.Add(":e")
if("Command")
available_channels.Add(":c")
if("Security")
available_channels.Add(":s")
if("Science")
available_channels.Add(":n")
if("Medical")
available_channels.Add(":m")
if("Supply")
available_channels.Add(":u")
if("Service")
available_channels.Add(":v")
if(RADIO_CHANNEL_ENGINEERING)
available_channels.Add(RADIO_TOKEN_ENGINEERING)
if(RADIO_CHANNEL_COMMAND)
available_channels.Add(RADIO_TOKEN_COMMAND)
if(RADIO_CHANNEL_SECURITY)
available_channels.Add(RADIO_TOKEN_SECURITY)
if(RADIO_CHANNEL_SCIENCE)
available_channels.Add(RADIO_TOKEN_SCIENCE)
if(RADIO_CHANNEL_MEDICAL)
available_channels.Add(RADIO_TOKEN_MEDICAL)
if(RADIO_CHANNEL_SUPPLY)
available_channels.Add(RADIO_TOKEN_SUPPLY)
if(RADIO_CHANNEL_SERVICE)
available_channels.Add(RADIO_TOKEN_SERVICE)
if(headset_to_add.translate_binary)
available_channels.Add(":b")
available_channels.Add(MODE_TOKEN_BINARY)
else
return ..()