Main part works. but we still got a long way to go

This commit is contained in:
AffectedArc07
2020-05-14 22:46:26 +01:00
parent f93146f6f5
commit 64dc83846e
35 changed files with 607 additions and 2828 deletions
+25 -16
View File
@@ -151,24 +151,33 @@
useMS = MS
break
var/datum/signal/signal = pda.telecomms_process()
var/turf/sender_pos = get_turf(U)
var/turf/recipient_pos = get_turf(P)
var/useTC = 0
if(signal)
if(signal.data["done"])
useTC = 1
var/turf/pos = get_turf(P)
// TODO: Make the radio system cooperate with the space manager
if(pos.z in signal.data["level"])
useTC = 2
//Let's make this barely readable
if(signal.data["compression"] > 0)
t = Gibberish(t, signal.data["compression"] + 50)
// Can the message be sent
var/sendable = FALSE
// Can the message be received?
var/receivable = FALSE
for(var/obj/machinery/tcomms/core/C in GLOB.tcomms_machines)
if(C.zlevel_reachable(sender_pos.z))
sendable = TRUE
if(C.zlevel_reachable(recipient_pos.z))
receivable = TRUE
// Once both are done, exit the loop
if(sendable && receivable)
break
if(!sendable) // Are we in the range of a reciever?
to_chat(U, "<span class='warning'>ERROR: No connection to server.</span>")
return
if(!receivable) // Is our recipient in the range of a reciever?
to_chat(U, "<span class='warning'>ERROR: No connection to recipient.</span>")
return
if(useMS && sendable && receivable) // only send the message if its going to work
if(useMS && useTC) // only send the message if it's stable
if(useTC != 2) // Does our recipient have a broadcaster on their level?
to_chat(U, "ERROR: Cannot reach recipient.")
return
useMS.send_pda_message("[P.owner]","[pda.owner]","[t]")
tnote.Add(list(list("sent" = 1, "owner" = "[P.owner]", "job" = "[P.ownjob]", "message" = "[t]", "target" = "\ref[P]")))