TG Sync 12/15/17
s s
This commit is contained in:
@@ -245,7 +245,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
dat += "<li><a href='byond://?src=[REF(src)];choice=54'><img src=pda_medbot.png>Bots Access</a></li>"
|
||||
if (cartridge.access & CART_JANITOR)
|
||||
dat += "<li><a href='byond://?src=[REF(src)];choice=49'><img src=pda_bucket.png>Custodial Locator</a></li>"
|
||||
if (istype(cartridge.radio, /obj/item/radio/integrated/signal))
|
||||
if (istype(cartridge.radio))
|
||||
dat += "<li><a href='byond://?src=[REF(src)];choice=40'><img src=pda_signaler.png>Signaler System</a></li>"
|
||||
if (cartridge.access & CART_NEWSCASTER)
|
||||
dat += "<li><a href='byond://?src=[REF(src)];choice=53'><img src=pda_notes.png>Newscaster Access </a></li>"
|
||||
@@ -543,7 +543,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
if("2") // Eject pAI device
|
||||
var/turf/T = get_turf(src.loc)
|
||||
if(T)
|
||||
pai.loc = T
|
||||
pai.forceMove(T)
|
||||
|
||||
//LINK FUNCTIONS===================================
|
||||
|
||||
@@ -578,7 +578,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
M.put_in_hands(id)
|
||||
to_chat(usr, "<span class='notice'>You remove the ID from the [name].</span>")
|
||||
else
|
||||
id.loc = get_turf(src)
|
||||
id.forceMove(drop_location())
|
||||
id = null
|
||||
update_icon()
|
||||
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
|
||||
var/obj/item/radio/integrated/radio = null
|
||||
var/obj/item/integrated_signaler/radio = null
|
||||
|
||||
var/access = 0 //Bit flags_1 for cartridge access
|
||||
var/access = 0 //Bit flags for cartridge access
|
||||
|
||||
var/remote_door_id = ""
|
||||
|
||||
var/bot_access_flags = 0 //Bit flags_1. Selection: SEC_BOT | MULE_BOT | FLOOR_BOT | CLEAN_BOT | MED_BOT
|
||||
var/bot_access_flags = 0 //Bit flags. Selection: SEC_BOT | MULE_BOT | FLOOR_BOT | CLEAN_BOT | MED_BOT
|
||||
var/spam_enabled = 0 //Enables "Send to All" Option
|
||||
|
||||
var/obj/item/device/pda/host_pda = null
|
||||
@@ -127,7 +127,7 @@
|
||||
|
||||
/obj/item/cartridge/signal/Initialize()
|
||||
. = ..()
|
||||
radio = new /obj/item/radio/integrated/signal(src)
|
||||
radio = new(src)
|
||||
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
|
||||
/obj/item/cartridge/rd/Initialize()
|
||||
. = ..()
|
||||
radio = new /obj/item/radio/integrated/signal(src)
|
||||
radio = new(src)
|
||||
|
||||
/obj/item/cartridge/captain
|
||||
name = "\improper Value-PAK cartridge"
|
||||
@@ -188,20 +188,16 @@
|
||||
|
||||
/obj/item/cartridge/captain/New()
|
||||
..()
|
||||
radio = new /obj/item/radio/integrated/signal(src)
|
||||
radio = new(src)
|
||||
|
||||
/obj/item/cartridge/proc/post_status(command, data1, data2)
|
||||
|
||||
var/datum/radio_frequency/frequency = SSradio.return_frequency(1435)
|
||||
var/datum/radio_frequency/frequency = SSradio.return_frequency(FREQ_STATUS_DISPLAYS)
|
||||
|
||||
if(!frequency)
|
||||
return
|
||||
|
||||
var/datum/signal/status_signal = new
|
||||
status_signal.source = src
|
||||
status_signal.transmission_method = 1
|
||||
status_signal.data["command"] = command
|
||||
|
||||
var/datum/signal/status_signal = new(list("command" = command))
|
||||
switch(command)
|
||||
if("message")
|
||||
status_signal.data["msg1"] = data1
|
||||
@@ -217,7 +213,6 @@
|
||||
return
|
||||
switch(host_pda.mode)
|
||||
if(40) //signaller
|
||||
var/obj/item/radio/integrated/signal/S = radio
|
||||
menu = "<h4><img src=pda_signaler.png> Remote Signaling System</h4>"
|
||||
|
||||
menu += {"
|
||||
@@ -225,14 +220,14 @@
|
||||
Frequency:
|
||||
<a href='byond://?src=[REF(src)];choice=Signal Frequency;sfreq=-10'>-</a>
|
||||
<a href='byond://?src=[REF(src)];choice=Signal Frequency;sfreq=-2'>-</a>
|
||||
[format_frequency(S.frequency)]
|
||||
[format_frequency(radio.frequency)]
|
||||
<a href='byond://?src=[REF(src)];choice=Signal Frequency;sfreq=2'>+</a>
|
||||
<a href='byond://?src=[REF(src)];choice=Signal Frequency;sfreq=10'>+</a><br>
|
||||
<br>
|
||||
Code:
|
||||
<a href='byond://?src=[REF(src)];choice=Signal Code;scode=-5'>-</a>
|
||||
<a href='byond://?src=[REF(src)];choice=Signal Code;scode=-1'>-</a>
|
||||
[S.code]
|
||||
[radio.code]
|
||||
<a href='byond://?src=[REF(src)];choice=Signal Code;scode=1'>+</a>
|
||||
<a href='byond://?src=[REF(src)];choice=Signal Code;scode=5'>+</a><br>"}
|
||||
if (41) //crew manifest
|
||||
@@ -571,22 +566,17 @@ Code:
|
||||
active1 = null
|
||||
|
||||
if("Send Signal")
|
||||
spawn( 0 )
|
||||
var/obj/item/radio/integrated/signal/S = radio
|
||||
S.send_signal("ACTIVATE")
|
||||
return
|
||||
INVOKE_ASYNC(radio, /obj/item/integrated_signaler.proc/send_activation)
|
||||
|
||||
if("Signal Frequency")
|
||||
var/obj/item/radio/integrated/signal/S = radio
|
||||
var/new_frequency = sanitize_frequency(S.frequency + text2num(href_list["sfreq"]))
|
||||
S.set_frequency(new_frequency)
|
||||
var/new_frequency = sanitize_frequency(radio.frequency + text2num(href_list["sfreq"]))
|
||||
radio.set_frequency(new_frequency)
|
||||
|
||||
if("Signal Code")
|
||||
var/obj/item/radio/integrated/signal/S = radio
|
||||
S.code += text2num(href_list["scode"])
|
||||
S.code = round(S.code)
|
||||
S.code = min(100, S.code)
|
||||
S.code = max(1, S.code)
|
||||
radio.code += text2num(href_list["scode"])
|
||||
radio.code = round(radio.code)
|
||||
radio.code = min(100, radio.code)
|
||||
radio.code = max(1, radio.code)
|
||||
|
||||
if("Status")
|
||||
switch(href_list["statdisp"])
|
||||
|
||||
@@ -1,48 +1,31 @@
|
||||
/obj/item/radio/integrated
|
||||
// Radio Cartridge, essentially a remote signaler with limited spectrum.
|
||||
/obj/item/integrated_signaler
|
||||
name = "\improper PDA radio module"
|
||||
desc = "An electronic radio system of nanotrasen origin."
|
||||
desc = "An electronic radio system of Nanotrasen origin."
|
||||
icon = 'icons/obj/module.dmi'
|
||||
icon_state = "power_mod"
|
||||
|
||||
var/on = FALSE //Are we currently active??
|
||||
var/menu_message = ""
|
||||
|
||||
/obj/item/radio/integrated/Initialize()
|
||||
. = ..()
|
||||
|
||||
/obj/item/radio/integrated/Destroy()
|
||||
return ..()
|
||||
|
||||
/*
|
||||
* Radio Cartridge, essentially a signaler.
|
||||
*/
|
||||
|
||||
|
||||
/obj/item/radio/integrated/signal
|
||||
var/frequency = 1457
|
||||
var/code = 30
|
||||
/obj/item/integrated_signaler
|
||||
var/frequency = FREQ_SIGNALER
|
||||
var/code = DEFAULT_SIGNALER_CODE
|
||||
var/last_transmission
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/obj/item/radio/integrated/signal/Destroy()
|
||||
SSradio.remove_object(src, frequency)
|
||||
/obj/item/integrated_signaler/Destroy()
|
||||
radio_connection = null
|
||||
return ..()
|
||||
|
||||
/obj/item/radio/integrated/signal/Initialize()
|
||||
/obj/item/integrated_signaler/Initialize()
|
||||
. = ..()
|
||||
if (src.frequency < 1200 || src.frequency > 1600)
|
||||
src.frequency = sanitize_frequency(src.frequency)
|
||||
|
||||
if (frequency < MIN_FREE_FREQ || frequency > MAX_FREE_FREQ)
|
||||
frequency = sanitize_frequency(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/item/radio/integrated/signal/proc/set_frequency(new_frequency)
|
||||
SSradio.remove_object(src, frequency)
|
||||
/obj/item/integrated_signaler/proc/set_frequency(new_frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = SSradio.add_object(src, frequency)
|
||||
|
||||
/obj/item/radio/integrated/signal/proc/send_signal(message="ACTIVATE")
|
||||
radio_connection = SSradio.return_frequency(frequency)
|
||||
|
||||
/obj/item/integrated_signaler/proc/send_activation()
|
||||
if(last_transmission && world.time < (last_transmission + 5))
|
||||
return
|
||||
last_transmission = world.time
|
||||
@@ -51,11 +34,5 @@
|
||||
var/turf/T = get_turf(src)
|
||||
GLOB.lastsignalers.Add("[time] <B>:</B> [usr.key] used [src] @ location ([T.x],[T.y],[T.z]) <B>:</B> [format_frequency(frequency)]/[code]")
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.source = src
|
||||
signal.encryption = code
|
||||
signal.data["message"] = message
|
||||
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
return
|
||||
var/datum/signal/signal = new(list("code" = code))
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_SIGNALER)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
#define BUGMODE_LIST 0
|
||||
#define BUGMODE_MONITOR 1
|
||||
#define BUGMODE_TRACK 2
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
/obj/item/device/chameleon/proc/eject_all()
|
||||
for(var/atom/movable/A in active_dummy)
|
||||
A.loc = active_dummy.loc
|
||||
A.forceMove(active_dummy.loc)
|
||||
if(ismob(A))
|
||||
var/mob/M = A
|
||||
M.reset_perspective(null)
|
||||
@@ -106,7 +106,7 @@
|
||||
VRD.force_dismount(M)
|
||||
else
|
||||
V.unbuckle_mob(M, force = TRUE)
|
||||
M.loc = src
|
||||
M.forceMove(src)
|
||||
master = C
|
||||
master.active_dummy = src
|
||||
|
||||
|
||||
@@ -256,6 +256,7 @@
|
||||
var/produce_heat = 1500
|
||||
heat = 1000
|
||||
light_color = LIGHT_COLOR_FLARE
|
||||
grind_results = list("sulfur" = 15)
|
||||
|
||||
/obj/item/device/flashlight/flare/New()
|
||||
fuel = rand(800, 1000) // Sorry for changing this so much but I keep under-estimating how long X number of ticks last in seconds.
|
||||
@@ -404,6 +405,7 @@
|
||||
color = LIGHT_COLOR_GREEN
|
||||
icon_state = "glowstick"
|
||||
item_state = "glowstick"
|
||||
grind_results = list("phenol" = 15, "hydrogen" = 10, "oxygen" = 5) //Meth-in-a-stick
|
||||
var/fuel = 0
|
||||
|
||||
/obj/item/device/flashlight/glowstick/Initialize()
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
else if(istype(W, /obj/item/screwdriver))
|
||||
if(diode)
|
||||
to_chat(user, "<span class='notice'>You remove the [diode.name] from \the [src].</span>")
|
||||
diode.loc = get_turf(src.loc)
|
||||
diode.forceMove(drop_location())
|
||||
diode = null
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -158,4 +158,4 @@
|
||||
desc = "An omni-technological interface."
|
||||
icon = 'icons/obj/abductor.dmi'
|
||||
icon_state = "multitool"
|
||||
toolspeed = 0.1
|
||||
toolspeed = 0.1
|
||||
@@ -11,7 +11,7 @@
|
||||
var/sound/trigger_sound = 'sound/effects/pressureplate.ogg'
|
||||
var/obj/item/device/assembly/signaler/sigdev = null
|
||||
var/roundstart_signaller = FALSE
|
||||
var/roundstart_signaller_freq = 1447
|
||||
var/roundstart_signaller_freq = FREQ_PRESSURE_PLATE
|
||||
var/roundstart_signaller_code = 30
|
||||
var/roundstart_hide = FALSE
|
||||
var/removable_signaller = TRUE
|
||||
|
||||
@@ -19,10 +19,6 @@
|
||||
/obj/item/device/radio/beacon/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans, message_mode)
|
||||
return
|
||||
|
||||
/obj/item/device/radio/beacon/send_hear()
|
||||
return null
|
||||
|
||||
|
||||
/obj/item/device/radio/beacon/verb/alter_signal(t as text)
|
||||
set name = "Alter Beacon's Signal"
|
||||
set category = "Object"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
materials = list(MAT_METAL=10000, MAT_GLASS=2500)
|
||||
var/on = TRUE
|
||||
var/code = 2
|
||||
var/frequency = 1449
|
||||
var/frequency = FREQ_ELECTROPACK
|
||||
var/shock_cooldown = 0
|
||||
|
||||
/obj/item/device/electropack/suicide_act(mob/user)
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
/obj/item/device/electropack/Initialize()
|
||||
. = ..()
|
||||
SSradio.add_object(src, frequency, GLOB.RADIO_CHAT)
|
||||
SSradio.add_object(src, frequency, RADIO_SIGNALER)
|
||||
|
||||
/obj/item/device/electropack/Destroy()
|
||||
SSradio.remove_object(src, frequency)
|
||||
@@ -67,7 +67,7 @@
|
||||
if(href_list["freq"])
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = sanitize_frequency(frequency + text2num(href_list["freq"]))
|
||||
SSradio.add_object(src, frequency, GLOB.RADIO_CHAT)
|
||||
SSradio.add_object(src, frequency, RADIO_SIGNALER)
|
||||
else
|
||||
if(href_list["code"])
|
||||
code += text2num(href_list["code"])
|
||||
@@ -98,7 +98,7 @@
|
||||
return
|
||||
|
||||
/obj/item/device/electropack/receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption != code)
|
||||
if(!signal || signal.data["code"] != code)
|
||||
return
|
||||
|
||||
if(isliving(loc) && on)
|
||||
@@ -144,7 +144,7 @@ Code:
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/electropack/shockcollar
|
||||
name = "shock collar"
|
||||
desc = "A reinforced metal collar. It seems to have some form of wiring near the front. Strange.."
|
||||
@@ -168,7 +168,7 @@ Code:
|
||||
..()
|
||||
|
||||
/obj/item/device/electropack/shockcollar/receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption != code)
|
||||
if(!signal || signal.data["code"] != code)
|
||||
return
|
||||
|
||||
if(isliving(loc) && on)
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
icon = 'icons/obj/radio.dmi'
|
||||
icon_state = "cypherkey"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
var/translate_binary = 0
|
||||
var/syndie = 0
|
||||
var/translate_binary = FALSE
|
||||
var/syndie = FALSE
|
||||
var/independent = FALSE
|
||||
var/list/channels = list()
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
name = "binary translator key"
|
||||
desc = "An encryption key for a radio headset. To access the binary channel, use :b."
|
||||
icon_state = "bin_cypherkey"
|
||||
translate_binary = 1
|
||||
translate_binary = TRUE
|
||||
|
||||
/obj/item/device/encryptionkey/headset_sec
|
||||
name = "security radio encryption key"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
icon_state = "headset"
|
||||
item_state = "headset"
|
||||
materials = list(MAT_METAL=75)
|
||||
subspace_transmission = 1
|
||||
subspace_transmission = TRUE
|
||||
canhear_range = 0 // can't hear headsets from very far away
|
||||
|
||||
slot_flags = SLOT_EARS
|
||||
@@ -22,10 +22,7 @@
|
||||
recalculateChannels()
|
||||
|
||||
/obj/item/device/radio/headset/Destroy()
|
||||
qdel(keyslot)
|
||||
qdel(keyslot2)
|
||||
keyslot = null
|
||||
keyslot2 = null
|
||||
QDEL_NULL(keyslot2)
|
||||
return ..()
|
||||
|
||||
/obj/item/device/radio/headset/talk_into(mob/living/M, message, channel, list/spans,datum/language/language)
|
||||
@@ -33,14 +30,14 @@
|
||||
return ITALICS | REDUCE_RANGE
|
||||
return ..()
|
||||
|
||||
/obj/item/device/radio/headset/receive_range(freq, level, AIuser)
|
||||
/obj/item/device/radio/headset/can_receive(freq, level, AIuser)
|
||||
if(ishuman(src.loc))
|
||||
var/mob/living/carbon/human/H = src.loc
|
||||
if(H.ears == src)
|
||||
return ..(freq, level)
|
||||
else if(AIuser)
|
||||
return ..(freq, level)
|
||||
return -1
|
||||
return FALSE
|
||||
|
||||
/obj/item/device/radio/headset/syndicate //disguised to look like a normal headset for stealth ops
|
||||
|
||||
@@ -209,33 +206,25 @@
|
||||
keyslot2 = new /obj/item/device/encryptionkey/ai
|
||||
command = TRUE
|
||||
|
||||
/obj/item/device/radio/headset/ai/receive_range(freq, level)
|
||||
return ..(freq, level, 1)
|
||||
/obj/item/device/radio/headset/ai/can_receive(freq, level)
|
||||
return ..(freq, level, TRUE)
|
||||
|
||||
/obj/item/device/radio/headset/attackby(obj/item/W, mob/user, params)
|
||||
user.set_machine(src)
|
||||
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
if(keyslot || keyslot2)
|
||||
|
||||
|
||||
for(var/ch_name in channels)
|
||||
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
|
||||
secure_radio_connections[ch_name] = null
|
||||
|
||||
|
||||
if(keyslot)
|
||||
var/turf/T = get_turf(user)
|
||||
if(T)
|
||||
keyslot.loc = T
|
||||
var/turf/T = user.drop_location()
|
||||
if(T)
|
||||
if(keyslot)
|
||||
keyslot.forceMove(T)
|
||||
keyslot = null
|
||||
|
||||
|
||||
|
||||
if(keyslot2)
|
||||
var/turf/T = get_turf(user)
|
||||
if(T)
|
||||
keyslot2.loc = T
|
||||
if(keyslot2)
|
||||
keyslot2.forceMove(T)
|
||||
keyslot2 = null
|
||||
|
||||
recalculateChannels()
|
||||
@@ -244,7 +233,7 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>This headset doesn't have any unique encryption keys! How useless...</span>")
|
||||
|
||||
else if(istype(W, /obj/item/device/encryptionkey/))
|
||||
else if(istype(W, /obj/item/device/encryptionkey))
|
||||
if(keyslot && keyslot2)
|
||||
to_chat(user, "<span class='warning'>The headset can't hold another key!</span>")
|
||||
return
|
||||
@@ -269,26 +258,19 @@
|
||||
..()
|
||||
if(keyslot2)
|
||||
for(var/ch_name in keyslot2.channels)
|
||||
if(ch_name in src.channels)
|
||||
continue
|
||||
src.channels += ch_name
|
||||
src.channels[ch_name] = keyslot2.channels[ch_name]
|
||||
if(!(ch_name in src.channels))
|
||||
channels[ch_name] = keyslot2.channels[ch_name]
|
||||
|
||||
if(keyslot2.translate_binary)
|
||||
src.translate_binary = 1
|
||||
|
||||
translate_binary = TRUE
|
||||
if(keyslot2.syndie)
|
||||
src.syndie = 1
|
||||
|
||||
syndie = TRUE
|
||||
if (keyslot2.independent)
|
||||
independent = TRUE
|
||||
|
||||
|
||||
for(var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
|
||||
|
||||
return
|
||||
|
||||
/obj/item/device/radio/headset/AltClick(mob/living/user)
|
||||
if(!istype(user) || !Adjacent(user) || user.incapacitated())
|
||||
return
|
||||
|
||||
@@ -101,22 +101,22 @@
|
||||
..()
|
||||
ui_interact(user, state = GLOB.default_state)
|
||||
|
||||
/obj/item/device/radio/intercom/receive_range(freq, level)
|
||||
/obj/item/device/radio/intercom/can_receive(freq, level)
|
||||
if(!on)
|
||||
return -1
|
||||
return FALSE
|
||||
if(wires.is_cut(WIRE_RX))
|
||||
return -1
|
||||
return FALSE
|
||||
if(!(0 in level))
|
||||
var/turf/position = get_turf(src)
|
||||
if(isnull(position) || !(position.z in level))
|
||||
return -1
|
||||
return FALSE
|
||||
if(!src.listening)
|
||||
return -1
|
||||
if(freq == GLOB.SYND_FREQ)
|
||||
return FALSE
|
||||
if(freq == FREQ_SYNDICATE)
|
||||
if(!(src.syndie))
|
||||
return -1//Prevents broadcast of messages over devices lacking the encryption
|
||||
return FALSE//Prevents broadcast of messages over devices lacking the encryption
|
||||
|
||||
return canhear_range
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/item/device/radio/intercom/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans, message_mode)
|
||||
|
||||
@@ -1,32 +1,11 @@
|
||||
/obj/item/device/radio
|
||||
icon = 'icons/obj/radio.dmi'
|
||||
name = "station bounced radio"
|
||||
suffix = "\[3\]"
|
||||
icon_state = "walkietalkie"
|
||||
item_state = "walkietalkie"
|
||||
desc = "A basic handheld radio that communicates with local telecommunication networks."
|
||||
dog_fashion = /datum/dog_fashion/back
|
||||
var/on = TRUE // 0 for off
|
||||
var/last_transmission
|
||||
var/frequency = 1459 //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/list/secure_radio_connections
|
||||
var/prison_radio = 0
|
||||
var/b_stat = 0
|
||||
var/broadcasting = 0
|
||||
var/listening = 1
|
||||
var/translate_binary = 0
|
||||
var/freerange = 0 // 0 - Sanitize frequencies, 1 - Full range
|
||||
var/list/channels = list() //see communications.dm for full list. First channes is a "default" for :h
|
||||
var/obj/item/device/encryptionkey/keyslot //To allow the radio to accept encryption keys.
|
||||
var/subspace_switchable = 0
|
||||
var/subspace_transmission = 0
|
||||
var/syndie = 0//Holder to see if it's a syndicate encrpyed radio
|
||||
var/independent = FALSE // If true, bypasses any tcomms machinery.
|
||||
var/freqlock = 0 //Frequency lock to stop the user from untuning specialist radios.
|
||||
var/emped = 0 //Highjacked to track the number of consecutive EMPs on the radio, allowing consecutive EMP's to stack properly.
|
||||
// "Example" = FREQ_LISTENING|FREQ_BROADCASTING
|
||||
|
||||
flags_1 = CONDUCT_1 | HEAR_1
|
||||
flags_2 = NO_EMP_WIRES_2
|
||||
slot_flags = SLOT_BELT
|
||||
@@ -35,12 +14,33 @@
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
materials = list(MAT_METAL=75, MAT_GLASS=25)
|
||||
|
||||
var/const/TRANSMISSION_DELAY = 5 // only 2/second/radio
|
||||
var/const/FREQ_LISTENING = 1
|
||||
//FREQ_BROADCASTING = 2
|
||||
var/on = TRUE
|
||||
var/frequency = FREQ_COMMON
|
||||
var/traitor_frequency = 0 // If tuned to this frequency, uplink will be unlocked.
|
||||
var/canhear_range = 3 // The range around the radio in which mobs can hear what it receives.
|
||||
var/emped = 0 // Tracks the number of EMPs currently stacked.
|
||||
|
||||
var/command = FALSE //If we are speaking into a command headset, our text can be BOLD
|
||||
var/use_command = FALSE
|
||||
var/broadcasting = FALSE // Whether the radio will transmit dialogue it hears nearby.
|
||||
var/listening = TRUE // Whether the radio is currently receiving.
|
||||
var/prison_radio = FALSE // If true, the transmit wire starts cut.
|
||||
var/unscrewed = FALSE // Whether wires are accessible. Toggleable by screwdrivering.
|
||||
var/freerange = FALSE // If true, the radio has access to the full spectrum.
|
||||
var/subspace_transmission = FALSE // If true, the radio transmits and receives on subspace exclusively.
|
||||
var/subspace_switchable = FALSE // If true, subspace_transmission can be toggled at will.
|
||||
var/freqlock = FALSE // Frequency lock to stop the user from untuning specialist radios.
|
||||
var/use_command = FALSE // If true, broadcasts will be large and BOLD.
|
||||
var/command = FALSE // If true, use_command can be toggled at will.
|
||||
|
||||
// Encryption key handling
|
||||
var/obj/item/device/encryptionkey/keyslot
|
||||
var/translate_binary = FALSE // If true, can hear the special binary channel.
|
||||
var/independent = FALSE // If true, can say/hear on the special CentCom channel.
|
||||
var/syndie = FALSE // If true, hears all well-known channels automatically, and can say/hear on the Syndicate channel.
|
||||
var/list/channels = list() // Map from name (see communications.dm) to on/off. First entry is current department (:h).
|
||||
var/list/secure_radio_connections
|
||||
|
||||
var/const/FREQ_LISTENING = 1
|
||||
//FREQ_BROADCASTING = 2
|
||||
|
||||
/obj/item/device/radio/proc/set_frequency(new_frequency)
|
||||
remove_radio(src, frequency)
|
||||
@@ -48,23 +48,19 @@
|
||||
|
||||
/obj/item/device/radio/proc/recalculateChannels()
|
||||
channels = list()
|
||||
translate_binary = 0
|
||||
syndie = 0
|
||||
translate_binary = FALSE
|
||||
syndie = FALSE
|
||||
independent = FALSE
|
||||
|
||||
if(keyslot)
|
||||
for(var/ch_name in keyslot.channels)
|
||||
if(ch_name in src.channels)
|
||||
continue
|
||||
channels += ch_name
|
||||
channels[ch_name] = keyslot.channels[ch_name]
|
||||
if(!(ch_name in channels))
|
||||
channels[ch_name] = keyslot.channels[ch_name]
|
||||
|
||||
if(keyslot.translate_binary)
|
||||
translate_binary = 1
|
||||
|
||||
translate_binary = TRUE
|
||||
if(keyslot.syndie)
|
||||
syndie = 1
|
||||
|
||||
syndie = TRUE
|
||||
if(keyslot.independent)
|
||||
independent = TRUE
|
||||
|
||||
@@ -78,10 +74,9 @@
|
||||
recalculateChannels()
|
||||
|
||||
/obj/item/device/radio/Destroy()
|
||||
qdel(wires)
|
||||
wires = null
|
||||
remove_radio_all(src) //Just to be sure
|
||||
keyslot = null
|
||||
QDEL_NULL(wires)
|
||||
QDEL_NULL(keyslot)
|
||||
return ..()
|
||||
|
||||
/obj/item/device/radio/Initialize()
|
||||
@@ -99,7 +94,7 @@
|
||||
/obj/item/device/radio/interact(mob/user)
|
||||
if (..())
|
||||
return
|
||||
if(b_stat && !isAI(user))
|
||||
if(unscrewed && !isAI(user))
|
||||
wires.interact(user)
|
||||
else
|
||||
ui_interact(user)
|
||||
@@ -306,7 +301,7 @@
|
||||
|
||||
if(independent)
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 2
|
||||
signal.transmission_method = TRANSMISSION_SUBSPACE
|
||||
signal.data = list(
|
||||
"mob" = M, // store a reference to the mob
|
||||
"mobtype" = M.type, // the mob's type
|
||||
@@ -344,9 +339,8 @@
|
||||
if(subspace_transmission)
|
||||
// First, we want to generate a new radio signal
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 2 // 2 would be a subspace transmission.
|
||||
// transmission_method could probably be enumerated through #define. Would be neater.
|
||||
// --- Finally, tag the actual signal with the appropriate values ---
|
||||
signal.transmission_method = TRANSMISSION_SUBSPACE
|
||||
// --- Finally, tag the actual signal with the appropriate values ---
|
||||
signal.data = list(
|
||||
// Identity-associated tags:
|
||||
"mob" = M, // store a reference to the mob
|
||||
@@ -397,7 +391,7 @@
|
||||
var/filter_type = 2
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 2
|
||||
signal.transmission_method = TRANSMISSION_SUBSPACE
|
||||
|
||||
|
||||
/* --- Try to send a normal subspace broadcast first */
|
||||
@@ -457,30 +451,30 @@
|
||||
raw_message = stars(raw_message)
|
||||
talk_into(speaker, raw_message, , spans, language=message_language)
|
||||
|
||||
/obj/item/device/radio/proc/receive_range(freq, level)
|
||||
/obj/item/device/radio/proc/can_receive(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.is_cut(WIRE_RX))
|
||||
return -1
|
||||
return FALSE
|
||||
if(!listening)
|
||||
return -1
|
||||
return FALSE
|
||||
if(!(0 in level))
|
||||
var/turf/position = get_turf(src)
|
||||
if(!position || !(position.z in level))
|
||||
return -1
|
||||
if(freq == GLOB.SYND_FREQ)
|
||||
return FALSE
|
||||
if(freq == FREQ_SYNDICATE)
|
||||
if(!(src.syndie)) //Checks to see if it's allowed on that frequency, based on the encryption keys
|
||||
return -1
|
||||
if(freq == GLOB.CENTCOM_FREQ)
|
||||
return FALSE
|
||||
if(freq == FREQ_CENTCOM)
|
||||
if(!independent)
|
||||
return -1
|
||||
return FALSE
|
||||
if (!on)
|
||||
return -1
|
||||
return FALSE
|
||||
if (!freq) //received on main frequency
|
||||
if (!listening)
|
||||
return -1
|
||||
return FALSE
|
||||
else
|
||||
var/accept = (freq==frequency && listening)
|
||||
if (!accept)
|
||||
@@ -490,19 +484,13 @@
|
||||
accept = 1
|
||||
break
|
||||
if (!accept)
|
||||
return -1
|
||||
return canhear_range
|
||||
|
||||
/obj/item/device/radio/proc/send_hear(freq, level)
|
||||
|
||||
var/range = receive_range(freq, level)
|
||||
if(range > -1)
|
||||
return get_hearers_in_view(canhear_range, src)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/item/device/radio/examine(mob/user)
|
||||
..()
|
||||
if (b_stat)
|
||||
if (unscrewed)
|
||||
to_chat(user, "<span class='notice'>It can be attached and modified.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>It cannot be modified or attached.</span>")
|
||||
@@ -510,8 +498,8 @@
|
||||
/obj/item/device/radio/attackby(obj/item/W, mob/user, params)
|
||||
add_fingerprint(user)
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
b_stat = !b_stat
|
||||
if(b_stat)
|
||||
unscrewed = !unscrewed
|
||||
if(unscrewed)
|
||||
to_chat(user, "<span class='notice'>The radio can now be attached and modified!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>The radio can no longer be modified or attached!</span>")
|
||||
@@ -523,8 +511,8 @@
|
||||
var/curremp = emped //Remember which EMP this was
|
||||
if (listening && ismob(loc)) // if the radio is turned on and on someone's person they notice
|
||||
to_chat(loc, "<span class='warning'>\The [src] overloads.</span>")
|
||||
broadcasting = 0
|
||||
listening = 0
|
||||
broadcasting = FALSE
|
||||
listening = FALSE
|
||||
for (var/ch_name in channels)
|
||||
channels[ch_name] = 0
|
||||
on = FALSE
|
||||
@@ -542,7 +530,7 @@
|
||||
|
||||
/obj/item/device/radio/borg
|
||||
name = "cyborg radio"
|
||||
subspace_switchable = 1
|
||||
subspace_switchable = TRUE
|
||||
dog_fashion = null
|
||||
flags_2 = NO_EMP_WIRES_2
|
||||
|
||||
@@ -555,7 +543,7 @@
|
||||
|
||||
/obj/item/device/radio/borg/syndicate/Initialize()
|
||||
. = ..()
|
||||
set_frequency(GLOB.SYND_FREQ)
|
||||
set_frequency(FREQ_SYNDICATE)
|
||||
|
||||
/obj/item/device/radio/borg/attackby(obj/item/W, mob/user, params)
|
||||
|
||||
@@ -569,7 +557,7 @@
|
||||
if(keyslot)
|
||||
var/turf/T = get_turf(user)
|
||||
if(T)
|
||||
keyslot.loc = T
|
||||
keyslot.forceMove(T)
|
||||
keyslot = null
|
||||
|
||||
recalculateChannels()
|
||||
|
||||
@@ -335,6 +335,7 @@ GAS ANALYZER
|
||||
throw_speed = 3
|
||||
throw_range = 7
|
||||
materials = list(MAT_METAL=30, MAT_GLASS=20)
|
||||
grind_results = list("mercury" = 5, "iron" = 5, "silicon" = 5)
|
||||
|
||||
/obj/item/device/analyzer/attack_self(mob/user)
|
||||
|
||||
@@ -395,6 +396,7 @@ GAS ANALYZER
|
||||
to_chat(user, "<span class='alert'>[env_gases[id][GAS_META][META_GAS_NAME]]: [round(gas_concentration*100, 0.01)] %</span>")
|
||||
to_chat(user, "<span class='info'>Temperature: [round(environment.temperature-T0C)] °C</span>")
|
||||
|
||||
|
||||
/obj/item/device/slime_scanner
|
||||
name = "slime scanner"
|
||||
desc = "A device that analyzes a slime's internal composition and measures its stats."
|
||||
|
||||
Reference in New Issue
Block a user