mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 15:17:01 +01:00
Ports Beestation's radio uplink (#71210)
## About The Pull Request A port of https://github.com/BeeStation/BeeStation-Hornet/pull/7363 The radio uplink is now reworked to require saying a codeword over the secret .d channel. This means that you can do it hands free, but people around you can hear you whispering the codeword ## Why It's Good For The Game Current radio uplink is dumb, it has a lot of drawbacks (losing common radio, fiddling with the tgui slider, having to reset the frequency after) that its almost unusable. This new uplink has a more unique trigger method with its own ups and downs ## Changelog 🆑 add: New radio uplink! Simply speak your codeword into the :d channel to unlock it code: new COMSIG_RADIO_NEW_MESSAGE signal /🆑 Co-authored-by: Candycaneannihalator <candycane@thisisnotarealaddr.com> Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com> Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
This commit is contained in:
co-authored by
Candycaneannihalator
Zephyr
Mothblocks
parent
8e086ebe3b
commit
d9998c8167
@@ -265,6 +265,8 @@
|
||||
|
||||
///called from base of /obj/item/radio/proc/set_frequency(): (list/args)
|
||||
#define COMSIG_RADIO_NEW_FREQUENCY "radio_new_frequency"
|
||||
///called from base of /obj/item/radio/proc/talk_into(): (atom/movable/M, message, channel)
|
||||
#define COMSIG_RADIO_NEW_MESSAGE "radio_new_message"
|
||||
|
||||
// /obj/item/pen signals
|
||||
|
||||
|
||||
@@ -46,6 +46,10 @@
|
||||
#define RADIO_KEY_CENTCOM "y"
|
||||
#define RADIO_TOKEN_CENTCOM ":y"
|
||||
|
||||
#define RADIO_CHANNEL_UPLINK "Uplink"
|
||||
#define RADIO_KEY_UPLINK "d"
|
||||
#define RADIO_TOKEN_UPLINK ":d"
|
||||
|
||||
#define RADIO_CHANNEL_CTF_RED "Red Team"
|
||||
#define RADIO_CHANNEL_CTF_BLUE "Blue Team"
|
||||
#define RADIO_CHANNEL_CTF_GREEN "Green Team"
|
||||
@@ -55,6 +59,7 @@
|
||||
#define MIN_FREE_FREQ 1201 // -------------------------------------------------
|
||||
// Frequencies are always odd numbers and range from 1201 to 1599.
|
||||
|
||||
#define FREQ_UPLINK 1211 // Dummy loopback frequency, used for radio uplink. Not seen in game.
|
||||
#define FREQ_SYNDICATE 1213 // Nuke op comms frequency, dark brown
|
||||
#define FREQ_CTF_RED 1215 // CTF red team comms frequency, red
|
||||
#define FREQ_CTF_BLUE 1217 // CTF blue team comms frequency, blue
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
RegisterSignal(parent, COMSIG_TABLET_CHANGE_ID, PROC_REF(new_ringtone))
|
||||
RegisterSignal(parent, COMSIG_TABLET_CHECK_DETONATE, PROC_REF(check_detonate))
|
||||
else if(istype(parent, /obj/item/radio))
|
||||
RegisterSignal(parent, COMSIG_RADIO_NEW_FREQUENCY, PROC_REF(new_frequency))
|
||||
RegisterSignal(parent, COMSIG_RADIO_NEW_MESSAGE, PROC_REF(new_message))
|
||||
else if(istype(parent, /obj/item/pen))
|
||||
RegisterSignal(parent, COMSIG_PEN_ROTATED, PROC_REF(pen_rotation))
|
||||
|
||||
@@ -359,6 +359,21 @@
|
||||
if(ismob(master.loc))
|
||||
interact(null, master.loc)
|
||||
|
||||
/datum/component/uplink/proc/new_message(datum/source, user, message, channel)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(channel != RADIO_CHANNEL_UPLINK)
|
||||
return
|
||||
|
||||
if(!findtext(lowertext(message), lowertext(unlock_code)))
|
||||
if(failsafe_code && findtext(lowertext(message), lowertext(failsafe_code)))
|
||||
failsafe() // no point returning cannot radio, youre probably ded
|
||||
return
|
||||
locked = FALSE
|
||||
interact(null, user)
|
||||
to_chat(user, "As you whisper the code into your headset, a soft chime fills your ears.")
|
||||
return COMPONENT_CANNOT_USE_RADIO
|
||||
|
||||
// Pen signal responses
|
||||
|
||||
/datum/component/uplink/proc/pen_rotation(datum/source, degrees, mob/living/carbon/user)
|
||||
@@ -385,7 +400,7 @@
|
||||
if(istype(parent,/obj/item/modular_computer/tablet))
|
||||
unlock_note = "<B>Uplink Passcode:</B> [unlock_code] ([P.name])."
|
||||
else if(istype(parent,/obj/item/radio))
|
||||
unlock_note = "<B>Radio Frequency:</B> [format_frequency(unlock_code)] ([P.name])."
|
||||
unlock_note = "<B>Radio Passcode:</B> [unlock_code] ([P.name], :d channel)."
|
||||
else if(istype(parent,/obj/item/pen))
|
||||
unlock_note = "<B>Uplink Degrees:</B> [english_list(unlock_code)] ([P.name])."
|
||||
|
||||
@@ -393,7 +408,7 @@
|
||||
if(istype(parent,/obj/item/modular_computer/tablet))
|
||||
return "[rand(100,999)] [pick(GLOB.phonetic_alphabet)]"
|
||||
else if(istype(parent,/obj/item/radio))
|
||||
return return_unused_frequency()
|
||||
return pick(GLOB.phonetic_alphabet)
|
||||
else if(istype(parent,/obj/item/pen))
|
||||
var/list/L = list()
|
||||
for(var/i in 1 to PEN_ROTATIONS)
|
||||
|
||||
@@ -126,6 +126,11 @@
|
||||
var/implant = FALSE
|
||||
|
||||
var/uplink_spawn_location = traitor_mob.client?.prefs?.read_preference(/datum/preference/choiced/uplink_location)
|
||||
var/cant_speak = (HAS_TRAIT(traitor_mob, TRAIT_MUTE) || traitor_mob.mind?.assigned_role.title == JOB_MIME)
|
||||
if(uplink_spawn_location == UPLINK_RADIO && cant_speak)
|
||||
if(!silent)
|
||||
to_chat(traitor_mob, span_warning("You have been deemed ineligible for a radio uplink. Supplying standard uplink instead."))
|
||||
uplink_spawn_location = UPLINK_PDA
|
||||
switch (uplink_spawn_location)
|
||||
if(UPLINK_PDA)
|
||||
uplink_loc = PDA
|
||||
@@ -164,7 +169,7 @@
|
||||
new_uplink.uplink_handler.assigned_role = traitor_mob.mind.assigned_role.title
|
||||
new_uplink.uplink_handler.assigned_species = traitor_mob.dna.species.id
|
||||
if(uplink_loc == R)
|
||||
unlock_text = "Your Uplink is cunningly disguised as your [R.name]. Simply dial the frequency [format_frequency(new_uplink.unlock_code)] to unlock its hidden features."
|
||||
unlock_text = "Your Uplink is cunningly disguised as your [R.name]. Simply speak \"[new_uplink.unlock_code]\" into frequency :d to unlock its hidden features."
|
||||
else if(uplink_loc == PDA)
|
||||
unlock_text = "Your Uplink is cunningly disguised as your [PDA.name]. Simply enter the code \"[new_uplink.unlock_code]\" into the ring tone selection to unlock its hidden features."
|
||||
else if(uplink_loc == P)
|
||||
|
||||
@@ -100,6 +100,7 @@ GLOBAL_LIST_INIT(radiochannels, list(
|
||||
RADIO_CHANNEL_SECURITY = FREQ_SECURITY,
|
||||
RADIO_CHANNEL_CENTCOM = FREQ_CENTCOM,
|
||||
RADIO_CHANNEL_SYNDICATE = FREQ_SYNDICATE,
|
||||
RADIO_CHANNEL_UPLINK = FREQ_UPLINK,
|
||||
RADIO_CHANNEL_SUPPLY = FREQ_SUPPLY,
|
||||
RADIO_CHANNEL_SERVICE = FREQ_SERVICE,
|
||||
RADIO_CHANNEL_AI_PRIVATE = FREQ_AI_PRIVATE,
|
||||
@@ -118,6 +119,7 @@ GLOBAL_LIST_INIT(reverseradiochannels, list(
|
||||
"[FREQ_SECURITY]" = RADIO_CHANNEL_SECURITY,
|
||||
"[FREQ_CENTCOM]" = RADIO_CHANNEL_CENTCOM,
|
||||
"[FREQ_SYNDICATE]" = RADIO_CHANNEL_SYNDICATE,
|
||||
"[FREQ_UPLINK]" = RADIO_CHANNEL_UPLINK,
|
||||
"[FREQ_SUPPLY]" = RADIO_CHANNEL_SUPPLY,
|
||||
"[FREQ_SERVICE]" = RADIO_CHANNEL_SERVICE,
|
||||
"[FREQ_AI_PRIVATE]" = RADIO_CHANNEL_AI_PRIVATE,
|
||||
|
||||
@@ -224,6 +224,8 @@
|
||||
/obj/item/radio/talk_into(atom/movable/talking_movable, message, channel, list/spans, datum/language/language, list/message_mods)
|
||||
if(SEND_SIGNAL(talking_movable, COMSIG_MOVABLE_USING_RADIO, src) & COMPONENT_CANNOT_USE_RADIO)
|
||||
return
|
||||
if(SEND_SIGNAL(src, COMSIG_RADIO_NEW_MESSAGE, talking_movable, message, channel) & COMPONENT_CANNOT_USE_RADIO)
|
||||
return
|
||||
|
||||
if(!spans)
|
||||
spans = list(talking_movable.speech_span)
|
||||
|
||||
@@ -13,6 +13,7 @@ GLOBAL_LIST_INIT(freqtospan, list(
|
||||
"[FREQ_COMMAND]" = "comradio",
|
||||
"[FREQ_AI_PRIVATE]" = "aiprivradio",
|
||||
"[FREQ_SYNDICATE]" = "syndradio",
|
||||
"[FREQ_UPLINK]" = "syndradio", // this probably shouldnt appear ingame
|
||||
"[FREQ_CENTCOM]" = "centcomradio",
|
||||
"[FREQ_CTF_RED]" = "redteamradio",
|
||||
"[FREQ_CTF_BLUE]" = "blueteamradio",
|
||||
|
||||
@@ -18,6 +18,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
|
||||
|
||||
// Faction
|
||||
RADIO_KEY_SYNDICATE = RADIO_CHANNEL_SYNDICATE,
|
||||
RADIO_KEY_UPLINK = RADIO_CHANNEL_UPLINK,
|
||||
RADIO_KEY_CENTCOM = RADIO_CHANNEL_CENTCOM,
|
||||
|
||||
// Admin
|
||||
|
||||
Reference in New Issue
Block a user