initial commit - game folder + maps + dme
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>"
|
||||
@@ -511,8 +511,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
U << browse(null, "window=pda")
|
||||
return
|
||||
if("Message")
|
||||
var/obj/item/device/pda/P = locate(href_list["target"])
|
||||
src.create_message(U, P)
|
||||
src.create_message(U, locate(href_list["target"]))
|
||||
|
||||
if("MessageAll")
|
||||
src.send_to_all(U)
|
||||
@@ -594,49 +593,57 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
t = Gibberish(t, 100)
|
||||
return t
|
||||
|
||||
/obj/item/device/pda/proc/send_message(mob/living/user = usr,list/obj/item/device/pda/targets)
|
||||
/obj/item/device/pda/proc/send_message(mob/living/user, list/obj/item/device/pda/targets)
|
||||
var/message = msg_input(user)
|
||||
|
||||
if(!message || !targets.len)
|
||||
return
|
||||
|
||||
if(last_text && world.time < last_text + 5)
|
||||
return
|
||||
|
||||
var/multiple = targets.len > 1
|
||||
// Send the signal
|
||||
var/list/string_targets = list()
|
||||
for (var/obj/item/device/pda/P in targets)
|
||||
if (P.owner && P.ownjob) // != src is checked by the UI
|
||||
string_targets += "[P.owner] ([P.ownjob])"
|
||||
for (var/obj/machinery/computer/message_monitor/M in targets)
|
||||
// In case of "Reply" to a message from a console, this will make the
|
||||
// message be logged successfully. If the console is impersonating
|
||||
// someone by matching their name and job, the reply will reach the
|
||||
// impersonated PDA.
|
||||
string_targets += "[M.customsender] ([M.customjob])"
|
||||
if (!string_targets.len)
|
||||
return
|
||||
|
||||
var/datum/data_pda_msg/last_sucessful_msg
|
||||
for(var/obj/item/device/pda/P in targets)
|
||||
if(P == src)
|
||||
continue
|
||||
var/obj/machinery/message_server/MS = null
|
||||
MS = can_send(P)
|
||||
if(MS)
|
||||
var/datum/data_pda_msg/msg = MS.send_pda_message("[P.owner]","[owner]","[message]",photo)
|
||||
if(msg)
|
||||
last_sucessful_msg = msg
|
||||
if(!multiple)
|
||||
show_to_sender(msg)
|
||||
P.show_recieved_message(msg,src)
|
||||
if(!multiple)
|
||||
show_to_ghosts(user,msg)
|
||||
log_talk(user,"[key_name(user)] (PDA: [initial(name)]) sent \"[message]\" to [P.name]",LOGPDA)
|
||||
else
|
||||
if(!multiple)
|
||||
to_chat(user, "<span class='notice'>ERROR: Server isn't responding.</span>")
|
||||
return
|
||||
var/datum/signal/subspace/pda/signal = new(src, list(
|
||||
"name" = "[owner]",
|
||||
"job" = "[ownjob]",
|
||||
"message" = message,
|
||||
"targets" = string_targets
|
||||
))
|
||||
if (photo)
|
||||
signal.data["photo"] = photo
|
||||
signal.send_to_receivers()
|
||||
|
||||
// If it didn't reach, note that fact
|
||||
if (!signal.data["done"])
|
||||
to_chat(user, "<span class='notice'>ERROR: Server isn't responding.</span>")
|
||||
return
|
||||
|
||||
var/target_text = signal.format_target()
|
||||
// Log it in our logs
|
||||
tnote += "<i><b>→ To [target_text]:</b></i><br>[signal.format_message()]<br>"
|
||||
// Show it to ghosts
|
||||
var/ghost_message = "<span class='name'>[owner] </span><span class='game say'>PDA Message</span> --> <span class='name'>[target_text]</span>: <span class='message'>[signal.format_message()]</span>"
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(isobserver(M) && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTPDA))
|
||||
to_chat(M, "[FOLLOW_LINK(M, user)] [ghost_message]")
|
||||
// Log in the talk log
|
||||
log_talk(user, "[key_name(user)] (PDA: [initial(name)]) sent \"[message]\" to [target_text]", LOGPDA)
|
||||
// Reset the photo
|
||||
photo = null
|
||||
|
||||
if(multiple)
|
||||
show_to_sender(last_sucessful_msg,1)
|
||||
show_to_ghosts(user,last_sucessful_msg,1)
|
||||
log_talk(user,"[user] (PDA: [initial(name)]) sent \"[message]\" to Everyone",LOGPDA)
|
||||
|
||||
/obj/item/device/pda/proc/show_to_sender(datum/data_pda_msg/msg,multiple = 0)
|
||||
tnote += "<i><b>→ To [multiple ? "Everyone" : msg.recipient]:</b></i><br>[msg.message][msg.get_photo_ref()]<br>"
|
||||
|
||||
/obj/item/device/pda/proc/show_recieved_message(datum/data_pda_msg/msg,obj/item/device/pda/source)
|
||||
tnote += "<i><b>← From <a href='byond://?src=[REF(src)];choice=Message;target=[REF(source)]'>[source.owner]</a> ([source.ownjob]):</b></i><br>[msg.message][msg.get_photo_ref()]<br>"
|
||||
/obj/item/device/pda/proc/receive_message(datum/signal/subspace/pda/signal)
|
||||
tnote += "<i><b>← From <a href='byond://?src=[REF(src)];choice=Message;target=[REF(signal.source)]'>[signal.data["name"]]</a> ([signal.data["job"]]):</b></i><br>[signal.format_message()]<br>"
|
||||
|
||||
if (!silent)
|
||||
playsound(loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
@@ -650,59 +657,21 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
L = get(src, /mob/living/silicon)
|
||||
|
||||
if(L && L.stat != UNCONSCIOUS)
|
||||
|
||||
var/hrefstart
|
||||
var/hrefend
|
||||
if (isAI(L))
|
||||
hrefstart = "<a href='?src=[REF(L)];track=[html_encode(source.owner)]'>"
|
||||
hrefstart = "<a href='?src=[REF(L)];track=[html_encode(signal.data["name"])]'>"
|
||||
hrefend = "</a>"
|
||||
|
||||
to_chat(L, "[icon2html(src)] <b>Message from [hrefstart][source.owner] ([source.ownjob])[hrefend], </b>\"[msg.message]\"[msg.get_photo_ref()] (<a href='byond://?src=[REF(src)];choice=Message;skiprefresh=1;target=[REF(source)]'>Reply</a>)")
|
||||
to_chat(L, "[icon2html(src)] <b>Message from [hrefstart][signal.data["name"]] ([signal.data["job"]])[hrefend], </b>[signal.format_message()] (<a href='byond://?src=[REF(src)];choice=Message;skiprefresh=1;target=[REF(signal.source)]'>Reply</a>)")
|
||||
|
||||
update_icon()
|
||||
add_overlay(icon_alert)
|
||||
|
||||
/obj/item/device/pda/proc/show_to_ghosts(mob/living/user, datum/data_pda_msg/msg,multiple = 0)
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(isobserver(M) && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTPDA))
|
||||
var/link = FOLLOW_LINK(M, user)
|
||||
to_chat(M, "[link] <span class='name'>[msg.sender] </span><span class='game say'>PDA Message</span> --> <span class='name'>[multiple ? "Everyone" : msg.recipient]</span>: <span class='message'>[msg.message][msg.get_photo_ref()]</span></span>")
|
||||
|
||||
/obj/item/device/pda/proc/can_send(obj/item/device/pda/P)
|
||||
if(!P || QDELETED(P) || P.toff)
|
||||
return null
|
||||
|
||||
var/obj/machinery/message_server/useMS = null
|
||||
if(GLOB.message_servers)
|
||||
for (var/obj/machinery/message_server/MS in GLOB.message_servers)
|
||||
//PDAs are now dependant on the Message Server.
|
||||
if(MS.active)
|
||||
useMS = MS
|
||||
break
|
||||
|
||||
var/datum/signal/signal = src.telecomms_process()
|
||||
|
||||
if(!P || QDELETED(P) || P.toff) //in case the PDA or mob gets destroyed during telecomms_process()
|
||||
return null
|
||||
|
||||
var/useTC = 0
|
||||
if(signal)
|
||||
if(signal.data["done"])
|
||||
useTC = 1
|
||||
var/turf/pos = get_turf(P)
|
||||
if(pos.z in signal.data["level"])
|
||||
useTC = 2
|
||||
|
||||
if(useTC == 2)
|
||||
return useMS
|
||||
else
|
||||
return null
|
||||
|
||||
|
||||
/obj/item/device/pda/proc/send_to_all(mob/living/U = usr)
|
||||
/obj/item/device/pda/proc/send_to_all(mob/living/U)
|
||||
send_message(U,get_viewable_pdas())
|
||||
|
||||
/obj/item/device/pda/proc/create_message(mob/living/U = usr, obj/item/device/pda/P)
|
||||
/obj/item/device/pda/proc/create_message(mob/living/U, obj/item/device/pda/P)
|
||||
send_message(U,list(P))
|
||||
|
||||
/obj/item/device/pda/AltClick()
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
icon_state = "pda-clown"
|
||||
desc = "A portable microcomputer by Thinktronic Systems, LTD. The surface is coated with polytetrafluoroethylene and banana drippings."
|
||||
ttone = "honk"
|
||||
var/slipvictims = list()
|
||||
var/slipvictims = list() //CIT CHANGE - makes clown PDAs track unique people slipped
|
||||
|
||||
/obj/item/device/pda/clown/Initialize()
|
||||
. = ..()
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
/obj/item/device/pda/clown/proc/AfterSlip(mob/living/carbon/human/M)
|
||||
if (istype(M) && (M.real_name != owner))
|
||||
slipvictims |=M
|
||||
slipvictims |= M //CIT CHANGE - makes clown PDAs track unique people slipped
|
||||
var/obj/item/cartridge/virus/clown/cart = cartridge
|
||||
if(istype(cart) && cart.charges < 5)
|
||||
cart.charges++
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,80 +144,3 @@ 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.."
|
||||
icon = 'icons/obj/clothing/neck.dmi'
|
||||
icon_state = "shockcollar"
|
||||
item_state = "shockcollar"
|
||||
body_parts_covered = NECK
|
||||
slot_flags = SLOT_NECK
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
strip_delay = 60
|
||||
equip_delay_other = 60
|
||||
materials = list(MAT_METAL=5000, MAT_GLASS=2000)
|
||||
var/tagname = null
|
||||
|
||||
/obj/item/device/electropack/shockcollar/attack_hand(mob/user)
|
||||
if(loc == user)
|
||||
if(slot_flags == SLOT_NECK)
|
||||
if(user.get_item_by_slot(slot_neck))
|
||||
to_chat(user, "<span class='warning'>The collar is fastened tight! You'll need help taking this off!</span>")
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/device/electropack/shockcollar/receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption != code)
|
||||
return
|
||||
|
||||
if(isliving(loc) && on)
|
||||
if(shock_cooldown != 0)
|
||||
return
|
||||
shock_cooldown = 1
|
||||
spawn(100)
|
||||
shock_cooldown = 0
|
||||
var/mob/living/L = loc
|
||||
step(L, pick(GLOB.cardinals))
|
||||
|
||||
to_chat(L, "<span class='danger'>You feel a sharp shock from the collar!</span>")
|
||||
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
|
||||
s.set_up(3, 1, L)
|
||||
s.start()
|
||||
|
||||
L.Knockdown(100)
|
||||
|
||||
if(master)
|
||||
master.receive_signal()
|
||||
return
|
||||
|
||||
/obj/item/device/electropack/shockcollar/attack_self(mob/user) //Turns out can't fully source this from the parent item, spritepath gets confused if power toggled. Will come back to this when I know how to code better and readd powertoggle..
|
||||
var/option = "Change Name"
|
||||
option = input(user, "What do you want to do?", "[src]", option) as null|anything in list("Change Name", "Change Frequency")
|
||||
switch(option)
|
||||
if("Change Name")
|
||||
var/t = input(user, "Would you like to change the name on the tag?", "Name your new pet", tagname ? tagname : "Spot") as null|text
|
||||
if(t)
|
||||
tagname = copytext(sanitize(t), 1, MAX_NAME_LEN)
|
||||
name = "[initial(name)] - [tagname]"
|
||||
if("Change Frequency")
|
||||
if(!ishuman(user))
|
||||
return
|
||||
user.set_machine(src)
|
||||
var/dat = {"<SK><BR>
|
||||
<B>Frequency/Code</B> for shock collar:<BR>
|
||||
Frequency:
|
||||
<A href='byond://?src=\ref[src];freq=-10'>-</A>
|
||||
<A href='byond://?src=\ref[src];freq=-2'>-</A> [format_frequency(frequency)]
|
||||
<A href='byond://?src=\ref[src];freq=2'>+</A>
|
||||
<A href='byond://?src=\ref[src];freq=10'>+</A><BR>
|
||||
Code:
|
||||
<A href='byond://?src=\ref[src];code=-5'>-</A>
|
||||
<A href='byond://?src=\ref[src];code=-1'>-</A> [code]
|
||||
<A href='byond://?src=\ref[src];code=1'>+</A>
|
||||
<A href='byond://?src=\ref[src];code=5'>+</A><BR>
|
||||
</SK>"}
|
||||
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
|
||||
@@ -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,32 +206,24 @@
|
||||
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)
|
||||
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)
|
||||
if(keyslot2)
|
||||
keyslot2.forceMove(T)
|
||||
keyslot2 = null
|
||||
|
||||
@@ -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,25 +101,27 @@
|
||||
..()
|
||||
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)
|
||||
if (message_mode == MODE_INTERCOM)
|
||||
return // Avoid hearing the same thing twice
|
||||
if(!anyai && !(speaker in ai))
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -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)
|
||||
@@ -192,41 +187,33 @@
|
||||
spans = M.get_spans()
|
||||
if(!language)
|
||||
language = M.get_default_language()
|
||||
INVOKE_ASYNC(src, .proc/talk_into_impl, M, message, channel, spans, language)
|
||||
INVOKE_ASYNC(src, .proc/talk_into_impl, M, message, channel, spans.Copy(), language)
|
||||
return ITALICS | REDUCE_RANGE
|
||||
|
||||
/obj/item/device/radio/proc/talk_into_impl(atom/movable/M, message, channel, list/spans, datum/language/language)
|
||||
if(!on)
|
||||
return // the device has to be on
|
||||
// Fix for permacell radios, but kinda eh about actually fixing them.
|
||||
if(!M || !message)
|
||||
return
|
||||
|
||||
if(wires.is_cut(WIRE_TX))
|
||||
if(wires.is_cut(WIRE_TX)) // Permacell and otherwise tampered-with radios
|
||||
return
|
||||
|
||||
if(!M.IsVocal())
|
||||
return
|
||||
|
||||
if(use_command)
|
||||
spans |= SPAN_COMMAND
|
||||
|
||||
/* 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/reciever elsewhere in space,
|
||||
the signal gets processed and logged, and an audible transmission gets sent
|
||||
to each individual headset.
|
||||
*/
|
||||
|
||||
/*
|
||||
be prepared to disregard any comments in all of tcomms code. i tried my best to keep them somewhat up-to-date, but eh
|
||||
Roughly speaking, radios attempt to make a subspace transmittion (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.
|
||||
*/
|
||||
|
||||
//get the frequency you buttface. radios no longer use the SSradio. confusing for future generations, convenient for me.
|
||||
// From the channel, determine the frequency and get a reference to it.
|
||||
var/freq
|
||||
if(channel && channels && channels.len > 0)
|
||||
if(channel == "department")
|
||||
@@ -238,271 +225,95 @@
|
||||
freq = frequency
|
||||
channel = null
|
||||
|
||||
var/freqnum = text2num(freq) //Why should we call text2num three times when we can just do it here?
|
||||
// Nearby active jammers severely gibberish the message
|
||||
var/turf/position = get_turf(src)
|
||||
|
||||
var/jammed = FALSE
|
||||
for(var/obj/item/device/jammer/jammer in GLOB.active_jammers)
|
||||
if(get_dist(position,get_turf(jammer)) < jammer.range)
|
||||
jammed = TRUE
|
||||
message = Gibberish(message,100)
|
||||
break
|
||||
|
||||
//#### Tagging the signal with all appropriate identity values ####//
|
||||
// Determine the identity information which will be attached to the signal.
|
||||
var/atom/movable/virtualspeaker/speaker = new(null, M, src)
|
||||
|
||||
// ||-- The mob's name identity --||
|
||||
var/real_name = M.name // mob's real name
|
||||
var/mobkey = "none" // player key associated with mob
|
||||
var/voicemask = 0 // the speaker is wearing a voice mask
|
||||
var/voice = M.GetVoice() // Why reinvent the wheel when there is a proc that does nice things already
|
||||
if(ismob(M))
|
||||
var/mob/speaker = M
|
||||
real_name = speaker.real_name
|
||||
if(speaker.client)
|
||||
mobkey = speaker.key // assign the mob's key
|
||||
// Construct the signal
|
||||
var/datum/signal/subspace/vocal/signal = new(src, freq, speaker, language, message, spans)
|
||||
|
||||
|
||||
var/jobname // the mob's "job"
|
||||
|
||||
if(jammed)
|
||||
message = Gibberish(message,100)
|
||||
|
||||
// --- Human: use their job as seen on the crew manifest - makes it unneeded to carry an ID for an AI to see their job
|
||||
if(ishuman(M))
|
||||
var/datum/data/record/findjob = find_record("name", voice, GLOB.data_core.general)
|
||||
|
||||
if(voice != real_name)
|
||||
voicemask = 1
|
||||
if(findjob)
|
||||
jobname = findjob.fields["rank"]
|
||||
else
|
||||
jobname = "Unknown"
|
||||
|
||||
// --- Carbon Nonhuman ---
|
||||
else if(iscarbon(M)) // Nonhuman carbon mob
|
||||
jobname = "No id"
|
||||
|
||||
// --- AI ---
|
||||
else if(isAI(M))
|
||||
jobname = "AI"
|
||||
|
||||
// --- Cyborg ---
|
||||
else if(iscyborg(M))
|
||||
var/mob/living/silicon/robot/B = M
|
||||
jobname = "[B.designation] Cyborg"
|
||||
|
||||
// --- Personal AI (pAI) ---
|
||||
else if(istype(M, /mob/living/silicon/pai))
|
||||
jobname = "Personal AI"
|
||||
|
||||
// --- Cold, emotionless machines. ---
|
||||
else if(isobj(M))
|
||||
jobname = "Machine"
|
||||
|
||||
// --- Unidentifiable mob ---
|
||||
else
|
||||
jobname = "Unknown"
|
||||
|
||||
/* ###### `independent` radios bypass all comms relays. ###### */
|
||||
|
||||
if(independent)
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 2
|
||||
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" = voice, // the mob's voice name
|
||||
"job" = jobname, // the mob's job
|
||||
"key" = mobkey, // the mob's key
|
||||
"vmask" = voicemask, // 1 if the mob is using a voice gas mas
|
||||
|
||||
"compression" = 0, // uncompressed radio signal
|
||||
"message" = message, // the actual sent message
|
||||
"radio" = src, // stores the radio used for transmission
|
||||
"slow" = 0,
|
||||
"traffic" = 0,
|
||||
"type" = 0,
|
||||
"server" = null,
|
||||
"reject" = 0,
|
||||
"level" = 0,
|
||||
"language" = language,
|
||||
"spans" = spans,
|
||||
"verb_say" = M.verb_say,
|
||||
"verb_ask" = M.verb_ask,
|
||||
"verb_exclaim" = M.verb_exclaim,
|
||||
"verb_yell" = M.verb_yell,
|
||||
)
|
||||
signal.frequency = freqnum // Quick frequency set
|
||||
Broadcast_Message(M, voicemask,
|
||||
src, message, voice, jobname, real_name,
|
||||
5, signal.data["compression"], list(position.z, 0), freq, spans,
|
||||
verb_say, verb_ask, verb_exclaim, verb_yell, language)
|
||||
// Independent radios, on the CentCom frequency, reach all independent radios
|
||||
if (independent && (freq == FREQ_CENTCOM || freq == FREQ_CTF_RED || freq == FREQ_CTF_BLUE))
|
||||
signal.data["compression"] = 0
|
||||
signal.transmission_method = TRANSMISSION_SUPERSPACE
|
||||
signal.levels = list(0) // reaches all Z-levels
|
||||
signal.broadcast()
|
||||
return
|
||||
|
||||
/* ###### Radio headsets can only broadcast through subspace ###### */
|
||||
// All radios make an attempt to use the subspace system first
|
||||
signal.send_to_receivers()
|
||||
|
||||
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.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" = voice, // the mob's voice name
|
||||
"job" = jobname, // the mob's job
|
||||
"key" = mobkey, // the mob's key
|
||||
"vmask" = voicemask, // 1 if the mob is using a voice gas mask
|
||||
|
||||
// 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(35,65), // compressed radio signal
|
||||
"message" = message, // the actual sent message
|
||||
"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" = language,
|
||||
"spans" = spans, //the span classes of this message.
|
||||
"verb_say" = M.verb_say, //the verb used when talking normally
|
||||
"verb_ask" = M.verb_ask, //the verb used when asking
|
||||
"verb_exclaim" = M.verb_exclaim, //the verb used when exclaiming
|
||||
"verb_yell" = M.verb_yell //the verb used when yelling
|
||||
)
|
||||
signal.frequency = freq
|
||||
|
||||
//#### Sending the signal to all subspace receivers ####//
|
||||
|
||||
for(var/obj/machinery/telecomms/receiver/R in GLOB.telecomms_list)
|
||||
R.receive_signal(signal)
|
||||
|
||||
// Allinone can act as receivers.
|
||||
for(var/obj/machinery/telecomms/allinone/R in GLOB.telecomms_list)
|
||||
R.receive_signal(signal)
|
||||
|
||||
// Receiving code can be located in Telecommunications.dm
|
||||
// If the radio is subspace-only, that's all it can do
|
||||
if (subspace_transmission)
|
||||
return
|
||||
|
||||
// Non-subspace radios will check in a couple of seconds, and if the signal
|
||||
// was never received, send a mundane broadcast (no headsets).
|
||||
addtimer(CALLBACK(src, .proc/backup_transmission, signal), 20)
|
||||
|
||||
/* ###### Intercoms and station-bounced radios ###### */
|
||||
/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
|
||||
|
||||
var/filter_type = 2
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 2
|
||||
|
||||
|
||||
/* --- 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" = voice, // the mob's voice name
|
||||
"job" = jobname, // the mob's job
|
||||
"key" = mobkey, // the mob's key
|
||||
"vmask" = voicemask, // 1 if the mob is using a voice gas mas
|
||||
|
||||
"compression" = 0, // uncompressed radio signal
|
||||
"message" = message, // the actual sent message
|
||||
"radio" = src, // stores the radio used for transmission
|
||||
"slow" = 0,
|
||||
"traffic" = 0,
|
||||
"type" = 0,
|
||||
"server" = null,
|
||||
"reject" = 0,
|
||||
"level" = position.z,
|
||||
"language" = language,
|
||||
"spans" = spans,
|
||||
"verb_say" = M.verb_say,
|
||||
"verb_ask" = M.verb_ask,
|
||||
"verb_exclaim" = M.verb_exclaim,
|
||||
"verb_yell" = M.verb_yell
|
||||
)
|
||||
signal.frequency = freqnum // Quick frequency set
|
||||
for(var/obj/machinery/telecomms/receiver/R in GLOB.telecomms_list)
|
||||
R.receive_signal(signal)
|
||||
|
||||
// Allinone can act as receivers. (Unless of course whoever coded this last time forgot to put it in somewhere!)
|
||||
for(var/obj/machinery/telecomms/allinone/R in GLOB.telecomms_list)
|
||||
R.receive_signal(signal)
|
||||
|
||||
spawn(20) // wait a little...
|
||||
|
||||
if(signal.data["done"] && position.z in signal.data["level"])
|
||||
// we're done here.
|
||||
return
|
||||
|
||||
// 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:
|
||||
Broadcast_Message(M, voicemask,
|
||||
src, message, voice, jobname, real_name,
|
||||
filter_type, signal.data["compression"], list(position.z), freq, spans,
|
||||
verb_say, verb_ask, verb_exclaim, verb_yell, language)
|
||||
// Okay, the signal was never processed, send a mundane broadcast.
|
||||
signal.data["compression"] = 0
|
||||
signal.transmission_method = TRANSMISSION_RADIO
|
||||
signal.levels = list(T.z)
|
||||
signal.broadcast()
|
||||
|
||||
/obj/item/device/radio/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode)
|
||||
if(radio_freq)
|
||||
if(radio_freq || !broadcasting || get_dist(src, speaker) > canhear_range)
|
||||
return
|
||||
if(broadcasting)
|
||||
if(get_dist(src, speaker) <= canhear_range)
|
||||
if(message_mode == MODE_WHISPER || message_mode == MODE_WHISPER_CRIT)
|
||||
raw_message = stars(raw_message)
|
||||
talk_into(speaker, raw_message, , spans, language=message_language)
|
||||
|
||||
/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(message_mode == MODE_WHISPER || message_mode == MODE_WHISPER_CRIT)
|
||||
// radios don't pick up whispers very well
|
||||
raw_message = stars(raw_message)
|
||||
else if(message_mode == MODE_L_HAND || message_mode == MODE_R_HAND)
|
||||
// try to avoid being heard double
|
||||
if (loc == speaker && ismob(speaker))
|
||||
var/mob/M = speaker
|
||||
var/idx = M.get_held_index_of_item(src)
|
||||
// left hands are odd slots
|
||||
if (idx && (idx % 2) == (message_mode == MODE_L_HAND))
|
||||
return
|
||||
|
||||
if (wires.is_cut(WIRE_RX))
|
||||
return -1
|
||||
if(!listening)
|
||||
return -1
|
||||
if(!(0 in level))
|
||||
talk_into(speaker, raw_message, , spans, language=message_language)
|
||||
|
||||
// Checks if this radio can receive on the given frequency.
|
||||
/obj/item/device/radio/proc/can_receive(freq, level)
|
||||
// deny checks
|
||||
if (!on || !listening || wires.is_cut(WIRE_RX))
|
||||
return FALSE
|
||||
if (freq == FREQ_SYNDICATE && !syndie)
|
||||
return FALSE
|
||||
if (freq == FREQ_CENTCOM)
|
||||
return independent // hard-ignores the z-level check
|
||||
if (!(0 in level))
|
||||
var/turf/position = get_turf(src)
|
||||
if(!position || !(position.z in level))
|
||||
return -1
|
||||
if(freq == GLOB.SYND_FREQ)
|
||||
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)
|
||||
if(!independent)
|
||||
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)
|
||||
if(channels[ch_name] & FREQ_LISTENING)
|
||||
if(GLOB.radiochannels[ch_name] == text2num(freq) || syndie) //the GLOB.radiochannels list is located in communications.dm
|
||||
accept = 1
|
||||
break
|
||||
if (!accept)
|
||||
return -1
|
||||
return canhear_range
|
||||
return FALSE
|
||||
|
||||
/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)
|
||||
// allow checks: are we listening on that frequency?
|
||||
if (freq == frequency)
|
||||
return TRUE
|
||||
for(var/ch_name in channels)
|
||||
if(channels[ch_name] & FREQ_LISTENING)
|
||||
//the GLOB.radiochannels list is located in communications.dm
|
||||
if(GLOB.radiochannels[ch_name] == text2num(freq) || syndie)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
/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 +321,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 +334,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 +353,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 +366,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)
|
||||
|
||||
|
||||
@@ -126,11 +126,6 @@ GAS ANALYZER
|
||||
if(H.undergoing_liver_failure() && H.stat != DEAD)
|
||||
to_chat(user, "<span class='danger'>Subject suffering from liver failure: apply corazone and begin a liver transplant immediately!</span>")
|
||||
|
||||
if(iscarbon(M))
|
||||
var/mob/living/carbon/C = M
|
||||
if(C.has_brain_worms())
|
||||
to_chat(user, "<span class='danger'>Foreign organism detected in subject's cranium. Recommended treatment: Dosage of sucrose solution and removal of object via surgery.</span>")
|
||||
|
||||
to_chat(user, "<span class='info'>Analyzing results for [M]:\n\tOverall status: [mob_status]</span>")
|
||||
|
||||
// Damage descriptions
|
||||
@@ -399,6 +394,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