Ports /tg/ spatial grid system, refactors telecomms, destroys lag (#15140)

This commit is contained in:
Wildkins
2022-12-09 12:35:33 +01:00
committed by GitHub
parent d3f8f12fea
commit 2fcfa8adb7
158 changed files with 4068 additions and 3263 deletions
+4 -4
View File
@@ -280,13 +280,13 @@
<table class="request">
<tr>
<td class="radio">Transmit:</td>
<td><a href='byond://?src=\ref[src];wires=4'>[radio.broadcasting ? "<font color=#55FF55>En" : "<font color=#FF5555>Dis" ]abled</font></a>
<td><a href='byond://?src=\ref[src];wires=4'>[radio.get_broadcasting() ? "<font color=#55FF55>En" : "<font color=#FF5555>Dis" ]abled</font></a>
</td>
</tr>
<tr>
<td class="radio">Receive:</td>
<td><a href='byond://?src=\ref[src];wires=2'>[radio.listening ? "<font color=#55FF55>En" : "<font color=#FF5555>Dis" ]abled</font></a>
<td><a href='byond://?src=\ref[src];wires=2'>[radio.get_listening() ? "<font color=#55FF55>En" : "<font color=#FF5555>Dis" ]abled</font></a>
</td>
</tr>
@@ -371,9 +371,9 @@
var/t1 = text2num(href_list["wires"])
switch(t1)
if(4)
radio.ToggleBroadcast()
radio.set_broadcasting(!radio.get_broadcasting())
if(2)
radio.ToggleReception()
radio.set_listening(!radio.get_listening())
if(href_list["setlaws"])
var/newlaws = sanitize(input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message)
if(newlaws)
@@ -1,5 +1,6 @@
#define CHANNEL_COMMON "Common"
#define CHANNEL_ENTERTAINMENT "Entertainment"
#define CHANNEL_HAILING "Hailing"
#define CHANNEL_COMMAND "Command"
#define CHANNEL_SCIENCE "Science"
#define CHANNEL_MEDICAL "Medical"
@@ -17,11 +18,11 @@
#define CHANNEL_NINJA "Ninja"
#define CHANNEL_BLUESPACE "Bluespace"
#define CHANNEL_BURGLAR "Burglar"
#define CHANNEL_SHIP "Ship"
var/global/list/ALL_RADIO_CHANNELS = list(
CHANNEL_COMMON = TRUE,
CHANNEL_ENTERTAINMENT = TRUE,
CHANNEL_HAILING = TRUE,
CHANNEL_COMMAND = TRUE,
CHANNEL_SCIENCE = TRUE,
CHANNEL_MEDICAL = TRUE,
@@ -36,6 +37,5 @@ var/global/list/ALL_RADIO_CHANNELS = list(
CHANNEL_MERCENARY = TRUE,
CHANNEL_NINJA = TRUE,
CHANNEL_BLUESPACE = TRUE,
CHANNEL_BURGLAR = TRUE,
CHANNEL_SHIP = TRUE
)
CHANNEL_BURGLAR = TRUE
)
@@ -3,7 +3,6 @@
desc = "Dance my monkeys! DANCE!!!"
icon_state = "electropack0"
item_state = "electropack"
frequency = 1449
flags = CONDUCT
slot_flags = SLOT_BACK
w_class = ITEMSIZE_HUGE
@@ -12,6 +11,10 @@
var/code = 2
/obj/item/device/radio/electropack/Initialize()
. = ..()
set_frequency(1449)
/obj/item/device/radio/electropack/attack_hand(mob/user as mob)
if(src == user.back)
to_chat(user, "<span class='notice'>You need help taking this off!</span>")
@@ -9,34 +9,60 @@
var/translate_binary = FALSE
var/translate_hivenet = FALSE
var/syndie = FALSE // Signifies that it de-crypts Syndicate transmissions
var/independent = FALSE // Signifies that it lets you talk on the spicy channel
var/list/channels = list(CHANNEL_COMMON = TRUE, CHANNEL_ENTERTAINMENT = TRUE)
var/list/additional_channels = list()
/obj/item/device/encryptionkey/attackby(obj/item/W, mob/user)
return
/obj/item/device/encryptionkey/ship
var/use_common = FALSE
channels = list()
/obj/item/device/encryptionkey/ship/Initialize()
if(!current_map.use_overmap)
return ..()
var/turf/T = get_turf(src)
var/obj/effect/overmap/visitable/V = map_sectors["[T.z]"]
if(istype(V) && V.comms_support)
if(V.comms_name)
name = "[V.comms_name] encryption key"
channels += list(
"[V.name]" = TRUE,
CHANNEL_HAILING = TRUE
)
if(use_common)
channels += list(CHANNEL_COMMON, TRUE)
/obj/item/device/encryptionkey/ship/common
use_common = TRUE
/obj/item/device/encryptionkey/syndicate
icon_state = "cypherkey"
additional_channels = list(CHANNEL_MERCENARY = TRUE)
additional_channels = list(CHANNEL_MERCENARY = TRUE, CHANNEL_HAILING = TRUE)
origin_tech = list(TECH_ILLEGAL = 3)
desc_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 = TRUE
/obj/item/device/encryptionkey/raider
icon_state = "cypherkey"
additional_channels = list(CHANNEL_RAIDER = TRUE)
additional_channels = list(CHANNEL_RAIDER = TRUE, CHANNEL_HAILING = TRUE)
origin_tech = list(TECH_ILLEGAL = 2)
syndie = TRUE
/obj/item/device/encryptionkey/burglar
icon_state = "cypherkey"
additional_channels = list(CHANNEL_BURGLAR = TRUE)
additional_channels = list(CHANNEL_BURGLAR = TRUE, CHANNEL_HAILING = TRUE)
origin_tech = list(TECH_ILLEGAL = 2)
syndie = TRUE
/obj/item/device/encryptionkey/ninja
icon_state = "cypherkey"
additional_channels = list(CHANNEL_NINJA = TRUE)
additional_channels = list(CHANNEL_NINJA = TRUE, CHANNEL_HAILING = TRUE)
origin_tech = list(TECH_ILLEGAL = 3)
syndie = TRUE
@@ -48,10 +74,6 @@
origin_tech = list(TECH_BLUESPACE = 3)
syndie = TRUE
/obj/item/device/encryptionkey/ship
icon_state = "cypherkey"
additional_channels = list(CHANNEL_SHIP = TRUE)
/obj/item/device/encryptionkey/binary
icon_state = "cypherkey"
translate_binary = TRUE
@@ -107,43 +129,43 @@
/obj/item/device/encryptionkey/headset_com
name = "command radio encryption key"
icon_state = "com_cypherkey"
channels = list(CHANNEL_COMMAND = TRUE)
channels = list(CHANNEL_COMMAND = TRUE, CHANNEL_HAILING = TRUE)
/obj/item/device/encryptionkey/heads/captain
name = "captain's encryption key"
icon_state = "cap_cypherkey"
channels = list(CHANNEL_COMMAND = TRUE, CHANNEL_SECURITY = TRUE, CHANNEL_PENAL = TRUE, CHANNEL_ENGINEERING = TRUE, CHANNEL_SCIENCE = TRUE, CHANNEL_MEDICAL = TRUE, CHANNEL_SUPPLY = TRUE, CHANNEL_SERVICE = TRUE)
channels = list(CHANNEL_COMMAND = TRUE, CHANNEL_SECURITY = TRUE, CHANNEL_PENAL = TRUE, CHANNEL_ENGINEERING = TRUE, CHANNEL_SCIENCE = TRUE, CHANNEL_MEDICAL = TRUE, CHANNEL_SUPPLY = TRUE, CHANNEL_SERVICE = TRUE, CHANNEL_HAILING = TRUE)
/obj/item/device/encryptionkey/heads/ai_integrated
name = "ai integrated encryption key"
desc = "Integrated encryption key"
icon_state = "cap_cypherkey"
channels = list(CHANNEL_COMMAND = TRUE, CHANNEL_SECURITY = TRUE, CHANNEL_PENAL = TRUE, CHANNEL_ENGINEERING = TRUE, CHANNEL_SCIENCE = TRUE, CHANNEL_MEDICAL = TRUE, CHANNEL_SUPPLY = TRUE, CHANNEL_SERVICE = TRUE, CHANNEL_AI_PRIVATE = TRUE)
channels = list(CHANNEL_COMMAND = TRUE, CHANNEL_SECURITY = TRUE, CHANNEL_PENAL = TRUE, CHANNEL_ENGINEERING = TRUE, CHANNEL_SCIENCE = TRUE, CHANNEL_MEDICAL = TRUE, CHANNEL_SUPPLY = TRUE, CHANNEL_SERVICE = TRUE, CHANNEL_AI_PRIVATE = TRUE, CHANNEL_HAILING = TRUE)
/obj/item/device/encryptionkey/heads/rd
name = "research director's encryption key"
icon_state = "rd_cypherkey"
channels = list(CHANNEL_SCIENCE = TRUE, CHANNEL_COMMAND = TRUE)
channels = list(CHANNEL_SCIENCE = TRUE, CHANNEL_COMMAND = TRUE, CHANNEL_HAILING = TRUE)
/obj/item/device/encryptionkey/heads/hos
name = "head of security's encryption key"
icon_state = "hos_cypherkey"
channels = list(CHANNEL_SECURITY = TRUE, CHANNEL_COMMAND = TRUE, CHANNEL_PENAL = TRUE)
channels = list(CHANNEL_SECURITY = TRUE, CHANNEL_COMMAND = TRUE, CHANNEL_PENAL = TRUE, CHANNEL_HAILING = TRUE)
/obj/item/device/encryptionkey/heads/ce
name = "chief engineer's encryption key"
icon_state = "ce_cypherkey"
channels = list(CHANNEL_ENGINEERING = TRUE, CHANNEL_COMMAND = TRUE)
channels = list(CHANNEL_ENGINEERING = TRUE, CHANNEL_COMMAND = TRUE, CHANNEL_HAILING = TRUE)
/obj/item/device/encryptionkey/heads/cmo
name = "chief medical officer's encryption key"
icon_state = "cmo_cypherkey"
channels = list(CHANNEL_MEDICAL = TRUE, CHANNEL_COMMAND = TRUE)
channels = list(CHANNEL_MEDICAL = TRUE, CHANNEL_COMMAND = TRUE, CHANNEL_HAILING = TRUE)
/obj/item/device/encryptionkey/heads/xo
name = "executive officer's encryption key"
icon_state = "hop_cypherkey"
channels = list(CHANNEL_SERVICE = TRUE, CHANNEL_COMMAND = TRUE, CHANNEL_SECURITY = TRUE, CHANNEL_PENAL = TRUE)
channels = list(CHANNEL_SERVICE = TRUE, CHANNEL_COMMAND = TRUE, CHANNEL_SECURITY = TRUE, CHANNEL_PENAL = TRUE, CHANNEL_HAILING = TRUE)
/obj/item/device/encryptionkey/headset_cargo
name = "operations radio encryption key"
@@ -153,7 +175,7 @@
/obj/item/device/encryptionkey/headset_operations_manager
name = "operations managaer radio encryption key"
icon_state = "cargo_cypherkey"
channels = list(CHANNEL_COMMAND = TRUE, CHANNEL_SUPPLY = TRUE)
channels = list(CHANNEL_COMMAND = TRUE, CHANNEL_SUPPLY = TRUE, CHANNEL_HAILING = TRUE)
/obj/item/device/encryptionkey/headset_service
name = "service radio encryption key"
@@ -162,7 +184,7 @@
/obj/item/device/encryptionkey/ert
name = "\improper ERT radio encryption key"
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)
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, CHANNEL_HAILING = TRUE)
/obj/item/device/encryptionkey/onlyert
name = "\improper ERT radio encryption key"
@@ -29,13 +29,27 @@
keyslot1 = new ks1type(src)
if(ks2type)
keyslot2 = new ks2type(src)
set_listening(TRUE)
recalculateChannels(TRUE)
possibly_deactivate_in_loc()
moved_event.register(src, src, /obj/item/device/radio/headset/proc/possibly_deactivate_in_loc)
/obj/item/device/radio/headset/proc/possibly_deactivate_in_loc()
if(ismob(loc))
set_listening(should_be_listening)
else
set_listening(FALSE, actual_setting = FALSE)
/obj/item/device/radio/headset/Destroy()
QDEL_NULL(keyslot1)
QDEL_NULL(keyslot2)
return ..()
/obj/item/device/radio/headset/set_listening(new_listening, actual_setting = TRUE)
. = ..()
if(listening && on)
recalculateChannels()
/obj/item/device/radio/headset/list_channels(var/mob/user)
return list_secure_channels()
@@ -64,16 +78,16 @@
return ..()
/obj/item/device/radio/headset/receive_range(freq, level, aiOverride = 0)
/obj/item/device/radio/headset/can_receive(input_frequency, level, aiOverride = FALSE)
if (aiOverride)
return ..(freq, level)
return ..(input_frequency, level)
if(ishuman(src.loc))
var/mob/living/carbon/human/H = src.loc
if(H.l_ear == src || H.r_ear == src)
return ..(freq, level)
return ..(input_frequency, level)
if(!EarSound)
return ..(freq, level)
return -1
return ..(input_frequency, level)
return FALSE
/obj/item/device/radio/headset/attack_hand(mob/user)
if(ishuman(user))
@@ -127,10 +141,12 @@
/obj/item/device/radio/headset/proc/recalculateChannels(var/setDescription = FALSE)
src.channels = list()
src.translate_binary = FALSE
src.translate_hivenet = FALSE
src.syndie = FALSE
channels = list()
translate_binary = FALSE
translate_hivenet = FALSE
syndie = FALSE
SSradio.remove_object_all(src)
for(var/keyslot in list(keyslot1, keyslot2))
if(!keyslot)
@@ -138,31 +154,28 @@
var/obj/item/device/encryptionkey/K = keyslot
for(var/ch_name in K.channels)
if(ch_name in src.channels)
if(ch_name in channels)
continue
src.channels[ch_name] = K.channels[ch_name]
LAZYSET(channels, ch_name, K.channels[ch_name])
for(var/ch_name in K.additional_channels)
if(ch_name in src.channels)
if(ch_name in channels)
continue
src.channels[ch_name] = K.additional_channels[ch_name]
LAZYSET(channels, ch_name, K.additional_channels[ch_name])
if(K.translate_binary)
src.translate_binary = TRUE
translate_binary = TRUE
if(K.translate_hivenet)
src.translate_hivenet = TRUE
translate_hivenet = TRUE
if(K.syndie)
src.syndie = TRUE
syndie = TRUE
if(K.independent)
independent = TRUE
for (var/ch_name in channels)
if(!SSradio)
sleep(30) // Waiting for the SSradio to be created.
if(!SSradio)
src.name = "broken radio headset"
return
secure_radio_connections[ch_name] = SSradio.add_object(src, radiochannels[ch_name], RADIO_CHAT)
if(setDescription)
@@ -638,7 +651,7 @@
name = "military headset"
icon_state = "syn_headset"
origin_tech = list(TECH_ILLEGAL = 3)
syndie = 1
syndie = TRUE
ks1type = /obj/item/device/encryptionkey/syndicate
/obj/item/device/radio/headset/syndicate/alt
@@ -662,6 +675,7 @@
icon_state = "syn_headset"
origin_tech = list(TECH_ILLEGAL = 3)
syndie = TRUE
independent = TRUE
ks1type = /obj/item/device/encryptionkey/ninja
/obj/item/device/radio/headset/bluespace
@@ -670,12 +684,34 @@
icon_state = "bs_headset"
item_state = "com_headset" // laziness or genius, you decide
syndie = TRUE
independent = TRUE
ks1type = /obj/item/device/encryptionkey/bluespace
//Ghostrole headset
/obj/item/device/radio/headset/ship
icon_state = "syn_headset"
ks1type = /obj/item/device/encryptionkey/ship
var/use_common = FALSE
/obj/item/device/radio/headset/ship/Initialize()
if(!current_map.use_overmap)
return ..()
var/turf/T = get_turf(src)
var/obj/effect/overmap/visitable/V = map_sectors["[T.z]"]
if(istype(V) && V.comms_support)
default_frequency = assign_away_freq(V.name)
if(V.comms_name)
name = "[V.comms_name] radio headset"
. = ..()
if (use_common)
set_frequency(PUB_FREQ)
/obj/item/device/radio/headset/ship/common
use_common = TRUE
ks1type = /obj/item/device/encryptionkey/ship/common
/obj/item/device/radio/headset/binary
origin_tech = list(TECH_ILLEGAL = 3)
@@ -724,10 +760,8 @@
var/myAi = null // Atlantis: Reference back to the AI which has this radio.
var/disabledAi = 0 // Atlantis: Used to manually disable AI's integrated radio via intellicard menu.
/obj/item/device/radio/headset/heads/ai_integrated/receive_range(freq, level)
if (disabledAi)
return -1 //Transciever Disabled.
return ..(freq, level, 1)
/obj/item/device/radio/headset/heads/ai_integrated/can_receive(input_frequency, level)
return ..(input_frequency, level, !disabledAi)
/obj/item/device/radio/headset/heads/ai_integrated/Destroy()
myAi = null
+107 -60
View File
@@ -16,45 +16,112 @@
var/radio_sound = null
clickvol = 40
/obj/item/device/radio/intercom/ship
channels = list()
var/default_hailing = FALSE
/obj/item/device/radio/intercom/ship/Initialize()
if(!current_map.use_overmap)
return ..()
var/turf/T = get_turf(src)
var/obj/effect/overmap/visitable/V = map_sectors["[T.z]"]
if(istype(V) && V.comms_support)
if(V.comms_name)
name = "intercom ([V.comms_name])"
default_frequency = assign_away_freq(V.name)
channels += list(
V.name = TRUE,
CHANNEL_HAILING = TRUE
)
. = ..()
if (default_hailing)
set_frequency(HAIL_FREQ)
/obj/item/device/radio/intercom/ship/hailing
default_hailing = TRUE
/obj/item/device/radio/intercom/custom
name = "intercom (custom)"
broadcasting = FALSE
listening = FALSE
/obj/item/device/radio/intercom/custom/Initialize()
. = ..()
set_broadcasting(FALSE)
set_listening(FALSE)
/obj/item/device/radio/intercom/hailing
name = "intercom (hailing)"
/obj/item/device/radio/intercom/hailing/Initialize()
. = ..()
set_frequency(HAIL_FREQ)
/obj/item/device/radio/intercom/interrogation
name = "intercom (interrogation)"
frequency = 1449
/obj/item/device/radio/intercom/interrogation/broadcasting // The detainee's side.
broadcasting = TRUE
listening = FALSE
/obj/item/device/radio/intercom/interrogation/Initialize()
. = ..()
set_frequency(1449)
/obj/item/device/radio/intercom/interrogation/broadcasting/Initialize() // The detainee's side.
set_broadcasting(TRUE)
set_listening(FALSE)
/obj/item/device/radio/intercom/private
name = "intercom (private)"
frequency = AI_FREQ
/obj/item/device/radio/intercom/private/Initialize()
. = ..()
set_frequency(AI_FREQ)
/obj/item/device/radio/intercom/specops
name = "intercom (spec ops)"
frequency = ERT_FREQ
/obj/item/device/radio/intercom/specops/Initialize()
. = ..()
set_frequency(ERT_FREQ)
/obj/item/device/radio/intercom/department
canhear_range = 5
broadcasting = FALSE
listening = TRUE
/obj/item/device/radio/intercom/department/Initialize()
. = ..()
set_broadcasting(FALSE)
set_listening(TRUE)
/obj/item/device/radio/intercom/department/medbay
name = "intercom (medical)"
frequency = MED_I_FREQ
/obj/item/device/radio/intercom/department/medbay/Initialize()
. = ..()
set_frequency(MED_I_FREQ)
internal_channels = default_medbay_channels.Copy()
/obj/item/device/radio/intercom/department/security
name = "intercom (security)"
frequency = SEC_I_FREQ
/obj/item/device/radio/intercom/department/security/Initialize()
. = ..()
set_frequency(SEC_I_FREQ)
internal_channels = list(
num2text(PUB_FREQ) = list(),
num2text(SEC_I_FREQ) = list(access_security)
)
/obj/item/device/radio/intercom/entertainment
name = "intercom (entertainment)"
frequency = ENT_FREQ
canhear_range = 4
/obj/item/device/radio/intercom/entertainment/Initialize()
. = ..()
set_frequency(ENT_FREQ)
internal_channels = list(
num2text(PUB_FREQ) = list(),
num2text(ENT_FREQ) = list()
)
/obj/item/device/radio/intercom/Initialize()
. = ..()
power_interface = new(loc, src)
@@ -70,44 +137,26 @@
screen_overlays["intercom_b"] = make_screen_overlay(icon, "intercom_b")
screen_overlays["intercom_l"] = make_screen_overlay(icon, "intercom_l")
/obj/item/device/radio/intercom/department/medbay/Initialize()
. = ..()
internal_channels = default_medbay_channels.Copy()
/obj/item/device/radio/intercom/department/security/Initialize()
. = ..()
internal_channels = list(
num2text(PUB_FREQ) = list(),
num2text(SEC_I_FREQ) = list(access_security)
)
/obj/item/device/radio/intercom/entertainment/Initialize()
. = ..()
internal_channels = list(
num2text(PUB_FREQ) = list(),
num2text(ENT_FREQ) = list()
)
/obj/item/device/radio/intercom/syndicate
name = "illegally modified intercom"
desc = "Talk through this. Evilly."
frequency = SYND_FREQ
subspace_transmission = 1
syndie = 1
subspace_transmission = TRUE
syndie = TRUE
/obj/item/device/radio/intercom/syndicate/Initialize()
. = ..()
set_frequency(SYND_FREQ)
internal_channels[num2text(SYND_FREQ)] = list(access_syndicate)
/obj/item/device/radio/intercom/raider
name = "illegally modified intercom"
desc = "Pirate radio, but not in the usual sense of the word."
frequency = RAID_FREQ
subspace_transmission = 1
syndie = 1
subspace_transmission = TRUE
syndie = TRUE
/obj/item/device/radio/intercom/syndicate/Initialize()
. = ..()
set_frequency(RAID_FREQ)
internal_channels[num2text(RAID_FREQ)] = list(access_syndicate)
/obj/item/device/radio/intercom/Destroy()
@@ -124,27 +173,19 @@
src.add_fingerprint(user)
INVOKE_ASYNC(src, /obj/item/.proc/attack_self, user)
/obj/item/device/radio/intercom/receive_range(freq, level)
if (!on)
return -1
if(!(0 in level))
/obj/item/device/radio/intercom/can_receive(input_frequency, list/levels)
if(levels != RADIO_NO_Z_LEVEL_RESTRICTION)
var/turf/position = get_turf(src)
if(isnull(position) || !(position.z in level))
return -1
if (!src.listening)
return -1
if(freq in ANTAG_FREQS)
if(!(src.syndie))
return -1//Prevents broadcast of messages over devices lacking the encryption
if(!istype(position) || !(position.z in levels))
return FALSE
return canhear_range
if(input_frequency in ANTAG_FREQS && !syndie)
return FALSE//Prevents broadcast of messages over devices lacking the encryption
return TRUE
/obj/item/device/radio/intercom/proc/power_change(has_power)
if (!src.loc)
on = 0
else
on = has_power
set_on(has_power) // has_power is given by our listener machinery
update_icon()
/obj/item/device/radio/intercom/forceMove(atom/dest)
@@ -166,8 +207,8 @@
if(listening)
add_overlay(screen_overlays["intercom_l"])
/obj/item/device/radio/intercom/broadcasting
broadcasting = TRUE
/obj/item/device/radio/intercom/broadcasting/Initialize()
set_broadcasting(TRUE)
/obj/item/device/radio/intercom/locked
var/locked_frequency
@@ -181,10 +222,16 @@
/obj/item/device/radio/intercom/locked/ai_private
name = "intercom (AI private)"
frequency = AI_FREQ
broadcasting = TRUE
listening = TRUE
/obj/item/device/radio/intercom/locked/ai_private/Initialize()
. = ..()
set_frequency(AI_FREQ)
set_broadcasting(TRUE)
set_listening(TRUE)
/obj/item/device/radio/intercom/locked/confessional
name = "intercom (confessional)"
frequency = 1480
/obj/item/device/radio/intercom/locked/confessional/Initialize()
. = ..()
set_frequency(1480)
+243 -313
View File
@@ -34,19 +34,6 @@ var/global/list/default_medbay_channels = list(
suffix = "\[3\]"
icon_state = "walkietalkie"
item_state = "radio"
var/on = 1 // 0 for off
var/last_transmission
var/frequency = PUB_FREQ //common chat
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/mob/living/announcer/announcer = null // used in autosay, held by the radio for re-use
var/datum/wires/radio/wires = null
var/b_stat = 0
var/broadcasting = FALSE
var/listening = TRUE
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
slot_flags = SLOT_BELT
throw_speed = 2
@@ -61,39 +48,131 @@ var/global/list/default_medbay_channels = list(
var/obj/item/cell/cell = /obj/item/cell/device
var/last_radio_sound = -INFINITY
/obj/item/device/radio
// If FALSE, broadcasting and listening don't matter and this radio does nothing
VAR_PRIVATE/on = TRUE
VAR_PRIVATE/frequency = PUB_FREQ // Current frequency the radio is set to
var/default_frequency = PUB_FREQ // frequency the radio defaults to on reset / startup
// Whether the radio transmits dialogue it hears nearby onto its radio channel
VAR_PRIVATE/broadcasting = FALSE
// Whether the radio is currently receiving radio messages from its frequencies
VAR_PRIVATE/listening = TRUE
//the below vars are used to track listening and broadcasting should they be forced off for whatever reason but "supposed" to be active
//eg player sets the radio to listening, but an emp or whatever turns it off, its still supposed to be activated but was forced off,
//when it wears off it sets listening to should_be_listening
///used for tracking what broadcasting should be in the absence of things forcing it off, eg its set to broadcast but gets emp'd temporarily
var/should_be_broadcasting = FALSE
///used for tracking what listening should be in the absence of things forcing it off, eg its set to listen but gets emp'd temporarily
var/should_be_listening = TRUE
/// Both the range around the radio in which mobs can hear what it receives and the range the radio can hear
var/canhear_range = 3
var/last_transmission
var/traitor_frequency = 0 //tune to frequency to unlock traitor supplies
var/mob/living/announcer/announcer = null // used in autosay, held by the radio for re-use
var/datum/wires/radio/wires = null
var/b_stat = 0
var/list/channels = list() //see communications.dm for full list. First non-common, non-entertainment channel is a "default" for :h
var/subspace_transmission = FALSE
var/syndie = FALSE //Holder to see if it's a syndicate encrypted radio
var/independent = FALSE // if TRUE, can say/hear on the Special Channel!!! (TBD)
var/datum/radio_frequency/radio_connection
var/list/datum/radio_frequency/secure_radio_connections = new
var/list/datum/radio_frequency/secure_radio_connections = list()
proc/set_frequency(new_frequency)
SSradio.remove_object(src, frequency)
frequency = new_frequency
radio_connection = SSradio.add_object(src, frequency, RADIO_CHAT)
/obj/item/device/radio/Destroy()
listening_objects -= src
QDEL_NULL(announcer)
QDEL_NULL(wires)
if(SSradio)
SSradio.remove_object(src, frequency)
for (var/ch_name in channels)
SSradio.remove_object(src, radiochannels[ch_name])
return ..()
/obj/item/device/radio/proc/set_frequency(new_frequency)
SSradio.remove_object(src, frequency)
frequency = new_frequency
radio_connection = SSradio.add_object(src, frequency, RADIO_CHAT)
/obj/item/device/radio/Initialize()
. = ..()
wires = new(src)
internal_channels = default_internal_channels.Copy()
listening_objects += src
become_hearing_sensitive(ROUNDSTART_TRAIT)
if(frequency < RADIO_LOW_FREQ || frequency > RADIO_HIGH_FREQ)
frequency = sanitize_frequency(frequency, RADIO_LOW_FREQ, RADIO_HIGH_FREQ)
set_frequency(frequency)
for (var/ch_name in channels)
secure_radio_connections[ch_name] = SSradio.add_object(src, radiochannels[ch_name], RADIO_CHAT)
set_listening(listening)
set_broadcasting(broadcasting)
set_frequency(default_frequency)
set_on(on)
/obj/item/device/radio/Destroy()
SSradio.remove_object_all(src)
QDEL_NULL(announcer)
QDEL_NULL(wires)
return ..()
/obj/item/device/radio/proc/is_on()
return on
/obj/item/device/radio/proc/get_frequency()
return frequency
/obj/item/device/radio/proc/get_broadcasting()
return broadcasting
/obj/item/device/radio/proc/get_listening()
return listening
/**
* setter for the listener var, adds or removes this radio from the global radio list if we are also on
*
* * new_listening - the new value we want to set listening to
* * actual_setting - whether or not the radio is supposed to be listening, sets should_be_listening to the new listening value if true, otherwise just changes listening
*/
/obj/item/device/radio/proc/set_listening(new_listening, actual_setting = TRUE)
listening = new_listening
if(actual_setting)
should_be_listening = listening
if(listening && on)
SSradio.add_object(src, frequency, RADIO_CHAT)
else if(!listening)
SSradio.remove_object_all(src)
/**
* setter for broadcasting that makes us not hearing sensitive if not broadcasting and hearing sensitive if broadcasting
* hearing sensitive in this case only matters for the purposes of listening for words said in nearby tiles, talking into us directly bypasses hearing
*
* * new_broadcasting- the new value we want to set broadcasting to
* * actual_setting - whether or not the radio is supposed to be broadcasting, sets should_be_broadcasting to the new value if true, otherwise just changes broadcasting
*/
/obj/item/device/radio/proc/set_broadcasting(new_broadcasting, actual_setting = TRUE)
broadcasting = new_broadcasting
if(actual_setting)
should_be_broadcasting = broadcasting
if(broadcasting && on) //we dont need hearing sensitivity if we arent broadcasting, because talk_into doesnt care about hearing
become_hearing_sensitive(INNATE_TRAIT)
else if(!broadcasting)
lose_hearing_sensitivity(INNATE_TRAIT)
///setter for the on var that sets both broadcasting and listening to off or whatever they were supposed to be
/obj/item/device/radio/proc/set_on(new_on)
on = new_on
if(on)
set_broadcasting(should_be_broadcasting)//set them to whatever theyre supposed to be
set_listening(should_be_listening)
else
set_broadcasting(FALSE, actual_setting = FALSE)//fake set them to off
set_listening(FALSE, actual_setting = FALSE)
/obj/item/device/radio/attack_self(mob/user as mob)
user.set_machine(src)
interact(user)
@@ -113,6 +192,7 @@ var/global/list/default_medbay_channels = list(
data["mic_status"] = broadcasting
data["speaker"] = listening
data["freq"] = format_frequency(frequency)
data["default_freq"] = format_frequency(default_frequency)
data["rawfreq"] = num2text(frequency)
data["mic_cut"] = (wires.IsIndexCut(WIRE_TRANSMIT) || wires.IsIndexCut(WIRE_SIGNAL))
@@ -134,9 +214,15 @@ var/global/list/default_medbay_channels = list(
/obj/item/device/radio/proc/setupRadioDescription(var/additional_radio_desc)
var/radio_text = ""
var/found_first_department = FALSE
for(var/i = 1 to channels.len)
var/channel = channels[i]
var/key = get_radio_key_from_channel(channel)
if(!length(key) && !found_first_department && channel != CHANNEL_COMMON && channel != CHANNEL_ENTERTAINMENT)
// if we don't have a key and it's the 'shortcut' channel, put the department key instead
key = get_radio_key_from_channel("department")
found_first_department = TRUE
radio_text += "[key] - [channel]"
if(i != channels.len)
radio_text += ", "
@@ -196,12 +282,6 @@ var/global/list/default_medbay_channels = list(
Speaker: <A href='byond://?src=\ref[src];ch_name=[chan_name];listen=[!list]'>[list ? "Engaged" : "Disengaged"]</A><BR>
"}
/obj/item/device/radio/proc/ToggleBroadcast()
broadcasting = !broadcasting && !(wires.IsIndexCut(WIRE_TRANSMIT) || wires.IsIndexCut(WIRE_SIGNAL))
/obj/item/device/radio/proc/ToggleReception()
listening = !listening && !(wires.IsIndexCut(WIRE_RECEIVE) || wires.IsIndexCut(WIRE_SIGNAL))
/obj/item/device/radio/CanUseTopic()
if(!on)
return STATUS_CLOSE
@@ -214,7 +294,7 @@ var/global/list/default_medbay_channels = list(
/obj/item/device/radio/Topic(href, href_list)
if(..())
return 1
return TRUE
usr.set_machine(src)
if (href_list["track"])
@@ -222,7 +302,7 @@ var/global/list/default_medbay_channels = list(
var/mob/living/silicon/ai/A = locate(href_list["track2"])
if(A && target)
A.ai_actual_track(target)
. = 1
. = TRUE
else if (href_list["freq"])
var/new_frequency = (frequency + text2num(href_list["freq"]))
@@ -232,27 +312,32 @@ var/global/list/default_medbay_channels = list(
if(hidden_uplink)
if(hidden_uplink.check_trigger(usr, frequency, traitor_frequency))
usr << browse(null, "window=radio")
. = 1
. = TRUE
else if (href_list["talk"])
ToggleBroadcast()
. = 1
set_broadcasting(!broadcasting)
. = TRUE
else if (href_list["listen"])
var/chan_name = href_list["ch_name"]
if (!chan_name)
ToggleReception()
set_listening(!listening)
else
if (channels[chan_name] & FREQ_LISTENING)
channels[chan_name] &= ~FREQ_LISTENING
else
channels[chan_name] |= FREQ_LISTENING
. = 1
. = TRUE
else if(href_list["spec_freq"])
var freq = href_list["spec_freq"]
if(has_channel_access(usr, freq))
set_frequency(text2num(freq))
. = 1
. = TRUE
else if(href_list["reset_freq"])
if(default_frequency)
set_frequency(default_frequency)
. = TRUE
if(href_list["nowindow"]) // here for pAIs, maybe others will want it, idk
return 1
return TRUE
if(.)
SSnanoui.update_uis(src)
@@ -277,16 +362,13 @@ var/global/list/default_medbay_channels = list(
if (!istype(connection))
return
if (!connection)
return
if(!istype(announcer))
announcer = new()
announcer.PrepareBroadcast(from)
Broadcast_Message(connection, announcer,
FALSE, "*garbled automated announcement*", src,
message, from, "Automated Announcement", from, announcer.voice_name,
4, 0, list(0), connection.frequency, "states", announcer.default_language)
var/datum/weakref/speaker_weakref = WEAKREF(announcer)
var/datum/signal/subspace/vocal/signal = new(src, frequency, speaker_weakref, announcer.default_language, message, "states")
signal.send_to_receivers()
announcer.ResetAfterBroadcast()
// Interprets the message mode when talking into a radio, possibly returning a connection datum
@@ -311,12 +393,13 @@ var/global/list/default_medbay_channels = list(
// If we were to send to a channel we don't have, drop it.
return null
/obj/item/device/radio/talk_into(mob/living/M, message, channel, var/verb = "says", var/datum/language/speaking = null, var/ignore_restrained)
/obj/item/device/radio/talk_into(mob/living/M, message, channel, var/say_verb = "says", var/datum/language/speaking = null, var/ignore_restrained)
if(!on)
return 0 // the device has to be on
// Fix for permacell radios, but kinda eh about actually fixing them.
return FALSE
if(!M || !message)
return 0
return FALSE
if(wires.IsIndexCut(WIRE_TRANSMIT)) // The device has to have all its wires and shit intact
return FALSE
if (iscarbon(M))
var/mob/living/carbon/C = M
@@ -333,268 +416,85 @@ var/global/list/default_medbay_channels = list(
return FALSE
M.trigger_aiming(TARGET_CAN_RADIO)
// Uncommenting this. To the above comment:
// The permacell radios aren't suppose to be able to transmit, this isn't a bug and this "fix" is just making radio wires useless. -Giacom
if(wires.IsIndexCut(WIRE_TRANSMIT)) // The device has to have all its wires and shit intact
return 0
if(!radio_connection)
set_frequency(frequency)
if(loc == M)
playsound(loc, 'sound/effects/walkietalkie.ogg', 5, 0, -1, required_asfx_toggles = ASFX_RADIO)
/* Quick introduction:
This new radio system uses a very robust FTL signaling technology unoriginally
dubbed "subspace" which is somewhat similar to 'blue-space' but can't
actually transmit large mass. Headsets are the only radio devices capable
of sending subspace transmissions to the Communications Satellite.
A headset sends a signal to a subspace listener/receiver elsewhere in space,
the signal gets processed and logged, and an audible transmission gets sent
to each individual headset.
/*
Roughly speaking, radios attempt to make a subspace transmission (which
is received, processed, and rebroadcast by the telecomms satellite) and
if that fails, they send a mundane radio transmission.
Headsets cannot send/receive mundane transmissions, only subspace.
Syndicate radios can hear transmissions on all well-known frequencies.
CentCom radios can hear the CentCom frequency no matter what.
*/
//#### Grab the connection datum ####//
// Get the frequency
var/datum/radio_frequency/connection = handle_message_mode(M, message, channel)
if (!istype(connection))
return 0
if (!connection)
return 0
return FALSE
var/turf/position = get_turf(src)
// Determine the identify information attached to the signal
var/datum/weakref/speaker_weakref = WEAKREF(M)
var/datum/signal/subspace/vocal/signal = new(src, connection.frequency, speaker_weakref, speaking, message, say_verb)
var/obj/effect/overmap/visitable/sector
if(current_map.use_overmap)
var/my_sector = map_sectors["[position.z]"]
if(istype(my_sector, /obj/effect/overmap/visitable))
sector = my_sector
//#### Tagging the signal with all appropriate identity values ####//
// ||-- The mob's name identity --||
var/displayname = M.name // grab the display name (name you get when you hover over someone's icon)
var/real_name = M.real_name // mob's real name
var/mobkey = "none" // player key associated with mob
var/voicemask = 0 // the speaker is wearing a voice mask
if(M.client)
mobkey = M.key // assign the mob's key
var/jobname // the mob's "job"
// --- Human: use their actual job ---
if (ishuman(M))
var/mob/living/carbon/human/H = M
jobname = H.get_assignment()
// --- Carbon Nonhuman ---
else if (iscarbon(M)) // Nonhuman carbon mob
jobname = "No id"
// --- AI ---
else if (isAI(M))
jobname = "AI"
// --- Cyborg ---
else if (isrobot(M))
jobname = "Cyborg"
// --- Personal AI (pAI) ---
else if (istype(M, /mob/living/silicon/pai))
jobname = "Personal AI"
// --- Unidentifiable mob ---
else
jobname = "Unknown"
// --- Modifications to the mob's identity ---
// The mob is disguising their identity:
if (ishuman(M) && M.GetVoice() != real_name)
displayname = M.GetVoice()
jobname = "Unknown"
voicemask = 1
/* ###### Radio headsets can only broadcast through subspace ###### */
// All radios attempt to use the subspace system
signal.send_to_receivers()
// If it's subspace only, that's all we can do
if(subspace_transmission)
// Check for jamming.
if (within_jamming_range(src))
return
// First, we want to generate a new radio signal
var/datum/signal/signal = new
signal.transmission_method = TRANSMISSION_SUBSPACE
return
// --- Finally, tag the actual signal with the appropriate values ---
signal.data = list(
// Identity-associated tags:
"mob" = M, // store a reference to the mob
"mobtype" = M.type, // the mob's type
"realname" = real_name, // the mob's real name
"name" = displayname, // the mob's display name
"job" = jobname, // the mob's job
"key" = mobkey, // the mob's key
"vmessage" = pick(M.speak_emote), // the message to display if the voice wasn't understood
"vname" = M.voice_name, // the name to display if the voice wasn't understood
"vmask" = voicemask, // 1 if the mob is using a voice gas mask
// Non-subspace radios will check in a couple of seconds, and if the signal was never received, we send a mundane broadcast
addtimer(CALLBACK(src, .proc/backup_transmission, signal), 2 SECONDS)
// We store things that would otherwise be kept in the actual mob
// so that they can be logged even AFTER the mob is deleted or something
// Other tags:
"compression" = rand(45,50), // compressed radio signal
"message" = message, // the actual sent message
"connection" = connection, // the radio connection to use
"radio" = src, // stores the radio used for transmission
"slow" = 0, // how much to sleep() before broadcasting - simulates net lag
"traffic" = 0, // dictates the total traffic sum that the signal went through
"type" = 0, // determines what type of radio input it is: normal broadcast
"server" = null, // the last server to log this signal
"reject" = 0, // if nonzero, the signal will not be accepted by any broadcasting machinery
"level" = position.z, // The source's z level
"language" = speaking,
"verb" = verb,
"sector" = sector
)
signal.frequency = connection.frequency // Quick frequency set
//#### Sending the signal to all subspace receivers ####//
for(var/obj/machinery/telecomms/receiver/R in telecomms_list)
INVOKE_ASYNC(R, /obj/proc/receive_signal, signal)
// Allinone can act as receivers.
for(var/obj/machinery/telecomms/allinone/R in telecomms_list)
INVOKE_ASYNC(R, /obj/proc/receive_signal, signal)
// Receiving code can be located in Telecommunications.dm
var/position_z_in_level = FALSE // this particular band-aid is required to make antag radios say "talks into" and not "tries to talk into" when using a radio, due to how their signals are made
if(islist(signal.data["level"]))
if(position.z in signal.data["level"])
position_z_in_level = TRUE
else
if(position.z == signal.data["level"])
position_z_in_level = TRUE
return signal.data["done"] && position_z_in_level
/* ###### Intercoms and station-bounced radios ###### */
var/filter_type = 2
/* --- Intercoms can only broadcast to other intercoms, but bounced radios can broadcast to bounced radios and intercoms --- */
if(istype(src, /obj/item/device/radio/intercom))
filter_type = 1
var/datum/signal/signal = new
signal.transmission_method = TRANSMISSION_SUBSPACE
/* --- Try to send a normal subspace broadcast first */
signal.data = list(
"mob" = M, // store a reference to the mob
"mobtype" = M.type, // the mob's type
"realname" = real_name, // the mob's real name
"name" = displayname, // the mob's display name
"job" = jobname, // the mob's job
"key" = mobkey, // the mob's key
"vmessage" = pick(M.speak_emote), // the message to display if the voice wasn't understood
"vname" = M.voice_name, // the name to display if the voice wasn't understood
"vmask" = voicemask, // 1 if the mob is using a voice gas mas
"compression" = 0, // uncompressed radio signal
"message" = message, // the actual sent message
"connection" = connection, // the radio connection to use
"radio" = src, // stores the radio used for transmission
"slow" = 0,
"traffic" = 0,
"type" = 0,
"server" = null,
"reject" = 0,
"level" = position.z,
"language" = speaking,
"verb" = verb,
"sector" = sector
)
signal.frequency = connection.frequency // Quick frequency set
for(var/obj/machinery/telecomms/receiver/R in telecomms_list)
INVOKE_ASYNC(R, /obj/proc/receive_signal, signal)
sleep(rand(10,25)) // wait a little...
if(signal.data["done"] && (position.z in signal.data["level"]))
// we're done here.
return 1
// Oh my god; the comms are down or something because the signal hasn't been broadcasted yet in our level.
// Send a mundane broadcast with limited targets:
//THIS IS TEMPORARY. YEAH RIGHT
if(!connection) return 0 //~Carn
return Broadcast_Message(connection, M, voicemask, pick(M.speak_emote),
src, message, displayname, jobname, real_name, M.voice_name,
filter_type, signal.data["compression"], list(position.z), connection.frequency,verb,speaking)
/obj/item/device/radio/proc/backup_transmission(datum/signal/subspace/vocal/signal)
var/turf/T = get_turf(src)
if (signal.data["done"] && (T.z in signal.levels))
return
// If we're here, the signal was never processed. Proceed with mundane broadcast:
signal.data["compression"] = 0
signal.transmission_method = TRANSMISSION_RADIO
signal.levels = list(T.z)
signal.broadcast()
/obj/item/device/radio/hear_talk(mob/M as mob, msg, var/verb = "says", var/datum/language/speaking = null)
if (!broadcasting || get_dist(src, M) > canhear_range)
return
if (broadcasting)
if(get_dist(src, M) <= canhear_range)
talk_into(M, msg,null,verb,speaking, ignore_restrained = TRUE)
talk_into(M, msg, null, verb, speaking, ignore_restrained = TRUE)
/obj/item/device/radio/proc/receive_range(freq, level)
// check if this radio can receive on the given frequency, and if so,
// what the range is in which mobs will hear the radio
// returns: -1 if can't receive, range otherwise
if (wires.IsIndexCut(WIRE_RECEIVE))
return -1
if(!listening)
return -1
if (within_jamming_range(src))
return -1
if(!(0 in level))
/obj/item/device/radio/proc/can_receive(input_frequency, list/levels)
// check if the radio can receive on the given frequency
if (levels != RADIO_NO_Z_LEVEL_RESTRICTION)
var/turf/position = get_turf(src)
if(!position || !(position.z in level))
return -1
if(freq in ANTAG_FREQS)
if(!(src.syndie))//Checks to see if it's allowed on that frequency, based on the encryption keys
return -1
if (!on)
return -1
if (!freq) //received on main frequency
if (!listening)
return -1
else
var/accept = (freq==frequency && listening)
if (!accept)
for (var/ch_name in channels)
var/datum/radio_frequency/RF = secure_radio_connections[ch_name]
if (RF.frequency==freq && (channels[ch_name]&FREQ_LISTENING))
accept = 1
break
if (!accept)
return -1
return canhear_range
if (!position || !(position.z in levels))
return FALSE
if (within_jamming_range(src))
return FALSE
if ((input_frequency in ANTAG_FREQS) && !syndie) //Checks to see if it's allowed on that frequency, based on the encryption keys
return FALSE
if (input_frequency == frequency)
return TRUE
for (var/ch_name in channels)
var/datum/radio_frequency/RF = secure_radio_connections[ch_name]
if (RF.frequency == input_frequency && (channels[ch_name] & FREQ_LISTENING))
return TRUE
return FALSE
/obj/item/device/radio/proc/send_hear(freq, level)
if(!can_receive(freq, level))
return
var/range = receive_range(freq, level)
if(range > -1)
var/list/mobs = list()
var/list/objs = list()
get_mobs_or_objs_in_view(get_turf(src), canhear_range, mobs, objs)
return mobs
return get_hearers_in_view(canhear_range, src)
/obj/item/device/radio/examine(mob/user)
@@ -624,8 +524,8 @@ var/global/list/default_medbay_channels = list(
else return
/obj/item/device/radio/emp_act(severity)
broadcasting = FALSE
listening = FALSE
set_broadcasting(FALSE)
set_listening(FALSE)
for (var/ch_name in channels)
channels[ch_name] = 0
..()
@@ -719,6 +619,9 @@ var/global/list/default_medbay_channels = list(
if(keyslot.syndie)
syndie = TRUE
if(keyslot.independent)
independent = TRUE
for(var/ch_name in src.channels)
if(!SSradio)
sleep(30) // Waiting for the SSradio to be created.
@@ -774,6 +677,7 @@ var/global/list/default_medbay_channels = list(
data["mic_status"] = broadcasting
data["speaker"] = listening
data["freq"] = format_frequency(frequency)
data["default_freq"] = format_frequency(default_frequency)
data["rawfreq"] = num2text(frequency)
var/list/chanlist = list_channels(user)
@@ -799,7 +703,7 @@ var/global/list/default_medbay_channels = list(
if(SSradio)
for (var/ch_name in channels)
SSradio.remove_object(src, radiochannels[ch_name])
secure_radio_connections = new
secure_radio_connections = list()
channels = op
if(SSradio)
for (var/ch_name in op)
@@ -810,60 +714,86 @@ var/global/list/default_medbay_channels = list(
// Radio Variants
//
/obj/item/device/radio/map_preset
channels = list()
/obj/item/device/radio/map_preset/Initialize()
if(!current_map.use_overmap)
return ..()
var/turf/T = get_turf(src)
var/obj/effect/overmap/visitable/V = map_sectors["[T.z]"]
if(istype(V) && V.comms_support)
frequency = assign_away_freq(V.name)
channels += list(
V.name = TRUE,
CHANNEL_HAILING = TRUE
)
if(V.comms_name)
name = "[V.comms_name] shortwave radio"
return ..()
// Radio (Off)
/obj/item/device/radio/off
listening = FALSE
/obj/item/device/radio/off/Initialize()
. = ..()
set_listening(FALSE)
// Medical
/obj/item/device/radio/med
icon_state = "walkietalkie-med"
// Medical (Off)
/obj/item/device/radio/med/off
listening = FALSE
/obj/item/device/radio/med/off/Initialize()
. = ..()
set_listening(FALSE)
// Security
/obj/item/device/radio/sec
icon_state = "walkietalkie-sec"
// Security (Off)
/obj/item/device/radio/sec/off
listening = FALSE
/obj/item/device/radio/sec/off/Initialize()
. = ..()
set_listening(FALSE)
// Engineering
/obj/item/device/radio/eng
icon_state = "walkietalkie-eng"
// Engineering (Off)
/obj/item/device/radio/eng/off
listening = FALSE
/obj/item/device/radio/eng/off/Initialize()
. = ..()
set_listening(FALSE)
// Science
/obj/item/device/radio/sci
icon_state = "walkietalkie-sci"
// Science (Off)
/obj/item/device/radio/sci/off
listening = FALSE
/obj/item/device/radio/sci/off/Initialize()
. = ..()
set_listening(FALSE)
// Phone
/obj/item/device/radio/phone
broadcasting = FALSE
icon = 'icons/obj/radio.dmi'
icon_state = "red_phone"
listening = TRUE
name = "phone"
var/radio_sound = null
// Medical Phone
/obj/item/device/radio/phone/medbay
frequency = MED_I_FREQ
/obj/item/device/radio/phone/Initialize()
. = ..()
set_broadcasting(FALSE)
set_listening(TRUE)
// Medical Phone
/obj/item/device/radio/phone/medbay/Initialize()
. = ..()
set_frequency(MED_I_FREQ)
internal_channels = default_medbay_channels.Copy()
// All-channel Radio
/obj/item/device/radio/all_channels/Initialize()
channels = ALL_RADIO_CHANNELS.Copy()
. = ..()
. = ..()
+10 -15
View File
@@ -23,11 +23,7 @@
..()
radio = new(src)
camera = new(src)
listening_objects += src
/obj/item/device/spy_bug/Destroy()
listening_objects -= src
return ..()
become_hearing_sensitive(ROUNDSTART_TRAIT)
/obj/item/device/spy_bug/examine(mob/user)
. = ..(user, 0)
@@ -36,8 +32,8 @@
to_chat(user, "Needs to be both configured and brought in contact with monitor device to be fully functional.")
/obj/item/device/spy_bug/attack_self(mob/user)
radio.broadcasting = !radio.broadcasting
to_chat(user, "\The [src]'s radio is [radio.broadcasting ? "broadcasting" : "not broadcasting"] now. The current frequency is [radio.frequency].")
radio.set_broadcasting(!radio.get_broadcasting())
to_chat(user, "\The [src]'s radio is [radio.get_broadcasting() ? "broadcasting" : "not broadcasting"] now. The current frequency is [radio.get_frequency()].")
radio.attack_self(user)
/obj/item/device/spy_bug/attackby(obj/W as obj, mob/living/user as mob)
@@ -70,11 +66,7 @@
/obj/item/device/spy_monitor/New()
radio = new(src)
listening_objects += src
/obj/item/device/spy_monitor/Destroy()
listening_objects -= src
return ..()
become_hearing_sensitive(ROUNDSTART_TRAIT)
/obj/item/device/spy_monitor/examine(mob/user)
. = ..(user, 1)
@@ -161,9 +153,12 @@
return 0
/obj/item/device/radio/spy
listening = FALSE
frequency = 1473
broadcasting = FALSE
canhear_range = 7
name = "spy device"
icon_state = "syn_cypherkey"
/obj/item/device/radio/spy/Initialize()
. = ..()
set_broadcasting(FALSE)
set_listening(FALSE)
set_frequency(1473)
@@ -23,7 +23,7 @@
/obj/item/device/taperecorder/Initialize()
. = ..()
listening_objects += src
become_hearing_sensitive(ROUNDSTART_TRAIT)
portable_drive = new /obj/item/computer_hardware/hard_drive/portable(src)
/obj/item/device/taperecorder/Destroy()
@@ -316,4 +316,4 @@
user.drop_from_inventory(W, src)
portable_drive = W
else
..()
..()
@@ -24,15 +24,6 @@
"/obj/item/stack/cable_coil" = 2,
"/obj/item/stock_parts/subspace/filter" = 2)
/obj/item/circuitboard/telecomms/relay
name = T_BOARD("relay mainframe")
build_path = /obj/machinery/telecomms/relay
origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 4, TECH_BLUESPACE = 3)
req_components = list(
"/obj/item/stock_parts/manipulator" = 2,
"/obj/item/stack/cable_coil" = 2,
"/obj/item/stock_parts/subspace/filter" = 2)
/obj/item/circuitboard/telecomms/bus
name = T_BOARD("bus mainframe")
build_path = /obj/machinery/telecomms/bus
@@ -7,15 +7,15 @@
/obj/item/grenade/flashbang/prime()
..()
for(var/obj/structure/closet/L in hear(7, get_turf(src)))
for(var/obj/structure/closet/L in get_hear(7, get_turf(src)))
if(locate(/mob/living/carbon/, L))
for(var/mob/living/carbon/M in L)
bang(get_turf(src), M)
for(var/mob/living/carbon/M in hear(7, get_turf(src)))
for(var/mob/living/carbon/M in get_hear(7, get_turf(src)))
bang(get_turf(src), M)
for(var/obj/effect/blob/B in hear(8,get_turf(src))) //Blob damage here
for(var/obj/effect/blob/B in get_hear(8,get_turf(src))) //Blob damage here
var/damage = round(30/(get_dist(B,get_turf(src))+1))
B.health -= damage
B.update_icon()
@@ -289,10 +289,9 @@ Implant Specifics:<BR>"}
/obj/item/implant/explosive/New()
..()
listening_objects += src
become_hearing_sensitive(ROUNDSTART_TRAIT)
/obj/item/implant/explosive/Destroy()
listening_objects -= src
return ..()
/obj/item/implant/explosive/full
@@ -77,7 +77,7 @@ Frequency:
src.temp += "<B>Located Beacons:</B><BR>"
for(var/obj/item/device/radio/beacon/W in teleportbeacons)
if (W.frequency == src.frequency)
if (W.get_frequency() == src.frequency)
var/turf/tr = get_turf(W)
if (tr.z == sr.z && tr)
var/direct = max(abs(tr.x - sr.x), abs(tr.y - sr.y))