I wanted to wait until after the feature freeze to commit this but there have been problems with Telecomms recently and this update that I've been keeping fixes most of the issues. I've tried to remove most features from it but there were some things that I couldn't.

-TCommsat machines no longer use their Z level to check if they can receive the signal or not. Instead, they use listening_level. It defaults to 0 for machines that don't change the value. If it is 0 when the telecomms machine's New() is called it will set itself to it's Z level.

-This allows you to manually change the value to other Z levels. I call this an off-site relay. I've added an off-site relay on the satelitte for the station and removed the one in the communications room.

-Players can create an offsite relay with two receivers, two broadcasters and, if necessary, a relay. Why two receivers and broadcasters? Otherwise any player can go to the Ruskie/Mining relays and turn them into off-site relays for the station! It would harm the TCommsat's usefulness. Instead, you will have to setup another broadcaster and receiver if you want to do that. Though it may be pointless, if someone sabotages the Commsat they would have destroyed/depowered the other machines there too.

-About the option to have an offsite relay, there is only a single Z level that you can lock onto at the moment and that's the station. Gameplay wise, the TCommsat is orbiting the station and if we do get the away missions then it would not make sense for the TCommsat's broadcaster/receiver signal to be able to pickup there. More sense if the Receivers and Broadcasters from there
are sent here... maybe. I don't know, seems more fun this way.

-Fixed an issue that doesn't let the Engineer Borg (or Borgs with multitools) be able to link machines with their multitool module.

-All-In-Ones do not have a Z level restriction. They can pick up ALL signals and send ALL signals (to Z levels 1-10)

-Fixed an issue with the player being unable to remove frequencies from the filter.

-Added support for additional interaction options for certain machines. To use it, create a new Options_Menu() and Options_Topic(href, href_list) for your machine.

-Added EMP_ACT to Telecommunication Machines. I've also added an event called "telecommunications_blackout()", it will loop through all telecomm machines, in telecomms_list, and EMP_ACT them. The EMP will last 2 minutes. Currently only admins can use it.

-Fixed issue 831

-Changed the map. The station no longer has the station relay, it is now on the Satellite. There's an empty room now, it should be used for something after the feature freeze.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4522 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2012-08-23 16:27:21 +00:00
parent 4b2326388c
commit 42f3efc21a
10 changed files with 6226 additions and 6025 deletions

View File

@@ -204,7 +204,7 @@
// Try to find all the players who can hear the message // Try to find all the players who can hear the message
for(var/mob/M in player_list) for(var/mob/M in player_list)
var/turf/ear = get_turf(M) var/turf/ear = get_turf(M)
if(ear && (isnull(level) || level == ear.z)) if(ear && (level == 0 || level == ear.z))
if(ear in speaker_coverage) if(ear in speaker_coverage)
. += M . += M

View File

@@ -21,7 +21,7 @@
/proc/event() /proc/event()
event = 1 event = 1
var/eventNumbersToPickFrom = list(1,2,4,5,6,7,8,9,10,11,12,13,14) //so ninjas don't cause "empty" events. var/eventNumbersToPickFrom = list(1,2,4,5,6,7,8,9,10,11,12,13,14, 15) //so ninjas don't cause "empty" events.
if((world.time/10)>=3600 && toggle_space_ninja && !sent_ninja_to_station)//If an hour has passed, relatively speaking. Also, if ninjas are allowed to spawn and if there is not already a ninja for the round. if((world.time/10)>=3600 && toggle_space_ninja && !sent_ninja_to_station)//If an hour has passed, relatively speaking. Also, if ninjas are allowed to spawn and if there is not already a ninja for the round.
eventNumbersToPickFrom += 3 eventNumbersToPickFrom += 3
@@ -92,6 +92,16 @@
IonStorm() IonStorm()
if(14) if(14)
spacevine_infestation() spacevine_infestation()
// TODO: Uncomment this after feature freeze -Giacom
//if(15)
// communications_blackout()
/proc/communications_blackout()
//Uncomment below if you want communication blackouts to have a warning.
//command_alert("Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you-BZZT")
for(var/obj/machinery/telecomms/T in telecomms_list)
T.emp_act(1)
/proc/power_failure() /proc/power_failure()
command_alert("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", "Critical Power Failure") command_alert("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", "Critical Power Failure")

View File

@@ -26,22 +26,21 @@ var/list/recentmessages = list() // global list of recent messages broadcasted :
/obj/machinery/telecomms/broadcaster/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from) /obj/machinery/telecomms/broadcaster/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from)
// Don't broadcast rejected signals // Don't broadcast rejected signals
var/turf/position = get_turf(src)
if(signal.data["reject"]) if(signal.data["reject"])
return return
//Is it a test signal? //Is it a test signal?
if(signal.data["type"] == 4) if(signal.data["type"] == 4)
signal.data["done"] = 1 signal.data["done"] = 1
signal.data["level"] += position.z signal.data["level"] += listening_level
return return
if(signal.data["message"]) if(signal.data["message"])
// Prevents massive radio spam // Prevents massive radio spam
if("[signal.data["message"]]:[signal.data["realname"]]:[position.z]" in recentmessages) if("[signal.data["message"]]:[signal.data["realname"]]:[listening_level]" in recentmessages)
return return
recentmessages.Add("[signal.data["message"]]:[signal.data["realname"]]:[position.z]") recentmessages.Add("[signal.data["message"]]:[signal.data["realname"]]:[listening_level]")
signal.data["done"] = 1 // mark the signal as being broadcasted signal.data["done"] = 1 // mark the signal as being broadcasted
@@ -62,7 +61,7 @@ var/list/recentmessages = list() // global list of recent messages broadcasted :
signal.data["vmask"], signal.data["vmessage"], signal.data["vmask"], signal.data["vmessage"],
signal.data["radio"], signal.data["message"], signal.data["radio"], signal.data["message"],
signal.data["name"], signal.data["job"], signal.data["name"], signal.data["job"],
signal.data["realname"], signal.data["vname"],, signal.data["compression"], position.z) signal.data["realname"], signal.data["vname"],, signal.data["compression"], listening_level)
/** #### - Simple Broadcast - #### **/ /** #### - Simple Broadcast - #### **/
@@ -72,7 +71,7 @@ var/list/recentmessages = list() // global list of recent messages broadcasted :
/* ###### Broadcast a message using signal.data ###### */ /* ###### Broadcast a message using signal.data ###### */
Broadcast_SimpleMessage(signal.data["name"], signal.frequency, Broadcast_SimpleMessage(signal.data["name"], signal.frequency,
signal.data["message"],null, null, signal.data["message"],null, null,
signal.data["compression"], position.z) signal.data["compression"], listening_level)
/** #### - Artificial Broadcast - #### **/ /** #### - Artificial Broadcast - #### **/
@@ -87,7 +86,7 @@ var/list/recentmessages = list() // global list of recent messages broadcasted :
signal.data["vmask"], signal.data["vmessage"], signal.data["vmask"], signal.data["vmessage"],
signal.data["radio"], signal.data["message"], signal.data["radio"], signal.data["message"],
signal.data["name"], signal.data["job"], signal.data["name"], signal.data["job"],
signal.data["realname"], signal.data["vname"], 4, signal.data["compression"], position.z) signal.data["realname"], signal.data["vname"], 4, signal.data["compression"], listening_level)
spawn(5) spawn(5)
recentmessages = list() recentmessages = list()
@@ -136,21 +135,20 @@ var/list/recentmessages = list() // global list of recent messages broadcasted :
/* ###### Broadcast a message using signal.data ###### */ /* ###### Broadcast a message using signal.data ###### */
var/datum/radio_frequency/connection = signal.data["connection"] var/datum/radio_frequency/connection = signal.data["connection"]
var/turf/position = get_turf(src)
if(connection.frequency == SYND_FREQ) // if syndicate broadcast, just if(connection.frequency == SYND_FREQ) // if syndicate broadcast, just
Broadcast_Message(signal.data["connection"], signal.data["mob"], Broadcast_Message(signal.data["connection"], signal.data["mob"],
signal.data["vmask"], signal.data["vmessage"], signal.data["vmask"], signal.data["vmessage"],
signal.data["radio"], signal.data["message"], signal.data["radio"], signal.data["message"],
signal.data["name"], signal.data["job"], signal.data["name"], signal.data["job"],
signal.data["realname"], signal.data["vname"],, signal.data["compression"], position.z) signal.data["realname"], signal.data["vname"],, signal.data["compression"], 0)
else else
if(intercept) if(intercept)
Broadcast_Message(signal.data["connection"], signal.data["mob"], Broadcast_Message(signal.data["connection"], signal.data["mob"],
signal.data["vmask"], signal.data["vmessage"], signal.data["vmask"], signal.data["vmessage"],
signal.data["radio"], signal.data["message"], signal.data["radio"], signal.data["message"],
signal.data["name"], signal.data["job"], signal.data["name"], signal.data["job"],
signal.data["realname"], signal.data["vname"], 3, signal.data["compression"], position.z) signal.data["realname"], signal.data["vname"], 3, signal.data["compression"], 0)
@@ -204,7 +202,7 @@ var/list/recentmessages = list() // global list of recent messages broadcasted :
If nonzero, the signal may be partially inaudible or just complete gibberish. If nonzero, the signal may be partially inaudible or just complete gibberish.
@param level: @param level:
The Z level that the sending radio is on. The Z level that the sending radio is on. 0 = Broadcast on all levels
**/ **/

View File

@@ -7,12 +7,13 @@
*/ */
#define STATION_Z 1
/obj/machinery/telecomms /obj/machinery/telecomms
var/temp = "" // output message var/temp = "" // output message
var/construct_op = 0 var/construct_op = 0
/obj/machinery/telecomms/attackby(obj/item/P as obj, mob/user as mob) /obj/machinery/telecomms/attackby(obj/item/P as obj, mob/user as mob)
// Using a multitool lets you access the receiver's interface // Using a multitool lets you access the receiver's interface
@@ -98,31 +99,37 @@
// You need a multitool to use this, or be silicon // You need a multitool to use this, or be silicon
if(!issilicon(user)) if(!issilicon(user))
if(user.get_active_hand()) // istype returns false if the value is null
if(!istype(user.get_active_hand(), /obj/item/device/multitool)) if(!istype(user.get_active_hand(), /obj/item/device/multitool))
return
else
return return
if(stat & (BROKEN|NOPOWER)) if(stat & (BROKEN|NOPOWER))
return return
var/obj/item/device/multitool/P = null var/obj/item/device/multitool/P = get_multitool(user)
if(!issilicon(user))
P = user.get_active_hand()
user.machine = src user.machine = src
var/dat var/dat
dat = "<font face = \"Courier\"><HEAD><TITLE>[src.name]</TITLE></HEAD><center><H3>[src.name] Access</H3></center>" dat = "<font face = \"Courier\"><HEAD><TITLE>[src.name]</TITLE></HEAD><center><H3>[src.name] Access</H3></center>"
dat += "<br>[temp]<br>" dat += "<br>[temp]<br>"
dat += "<br>Power Status: <a href='?src=\ref[src];input=toggle'>[src.toggled ? "On" : "Off"]</a>" dat += "<br>Power Status: <a href='?src=\ref[src];input=toggle'>[src.toggled ? "On" : "Off"]</a>"
if(on) if(on && toggled)
if(id != "" && id) if(id != "" && id)
dat += "<br>Identification String: <a href='?src=\ref[src];input=id'>[id]</a>" dat += "<br>Identification String: <a href='?src=\ref[src];input=id'>[id]</a>"
else else
dat += "<br>Identification String: <a href='?src=\ref[src];input=id'>NULL</a>" dat += "<br>Identification String: <a href='?src=\ref[src];input=id'>NULL</a>"
dat += "<br>Network: <a href='?src=\ref[src];input=network'>[network]</a>" dat += "<br>Network: <a href='?src=\ref[src];input=network'>[network]</a>"
dat += "<br>Prefabrication: [autolinkers.len ? "TRUE" : "FALSE"]" dat += "<br>Prefabrication: [autolinkers.len ? "TRUE" : "FALSE"]"
if(hide) dat += "<br>Shadow Link: ACTIVE</a>"
if(check_links())
dat += "<br>Signal Locked to Station: <A href='?src=\ref[src];input=level'>[listening_level == STATION_Z ? "TRUE" : "FALSE"]</a>"
else
dat += "<br>Signal Locked to Station: FALSE"
//Show additional options for certain machines.
dat += Options_Menu()
dat += "<br>Linked Network Entities: <ol>" dat += "<br>Linked Network Entities: <ol>"
var/i = 0 var/i = 0
@@ -140,9 +147,9 @@
for(var/x in freq_listening) for(var/x in freq_listening)
i++ i++
if(i < length(freq_listening)) if(i < length(freq_listening))
dat += "[format_frequency(x)] GHz<a href='?src=\ref[src];delete=[i]'>\[X\]</a>; " dat += "[format_frequency(x)] GHz<a href='?src=\ref[src];delete=[x]'>\[X\]</a>; "
else else
dat += "[format_frequency(x)] GHz<a href='?src=\ref[src];delete=[i]'>\[X\]</a>" dat += "[format_frequency(x)] GHz<a href='?src=\ref[src];delete=[x]'>\[X\]</a>"
else else
dat += "NONE" dat += "NONE"
@@ -160,28 +167,150 @@
user << browse(dat, "window=tcommachine;size=520x500;can_resize=0") user << browse(dat, "window=tcommachine;size=520x500;can_resize=0")
onclose(user, "dormitory") onclose(user, "dormitory")
// Off-Site Relays
//
// You are able to send/receive signals from the station's z level (changeable in the STATION_Z #define) if you have two or more broadcasters/receivers linked to the relay.
// Meaning, if you want to setup a relay for the station OUTSIDE of it's z level, you will have to setup the following:
//
// 2 Broadcasters (any frequency), 2 Receivers (any frequency), 1 Relay.
// Link the broadcasters and receivers to the Relay.
// Now, use a multi-tool to set their "Locked to station" to TRUE. (The FALSE link should be clickable, if not, check your previous steps)
//
// The machines will now check if there is enough broadcasters/receivers to send/receive signals from the station.
//
// Why 2 receivers/broadcasters? I didn't want ANYONE to be able to setup a backup relay with already pre-existing relays.
// The mining relay and the ruskie relay all have 1 broadcaster and 1 receiver. If I didn't have this check then anyone could
// click on the button and turn it into an instant off-site relay.
//
// After clicking the button, and if successful, the machine's "listening_level" will change to the station's Z level.
//
// Only broadcasters/receivers can lock their signal onto the station.
/obj/machinery/telecomms/proc/check_links()
return 0
// I am sorry for the copy+paste below, please let me know if I could do this without having to copy+paste it. -Giacom
// The connected relay needs to be linked to at least 2 receivers to receive signals from the station.
/obj/machinery/telecomms/receiver/check_links()
var/count = 0
for(var/obj/machinery/telecomms/relay/R in links)
for(var/obj/machinery/telecomms/receiver/L in R.links)
count += 1
return (count >= 2)
// The connected relay needs to be linked to at least 2 broadcasters to send signals to the station.
/obj/machinery/telecomms/broadcaster/check_links()
var/count = 0
for(var/obj/machinery/telecomms/relay/R in links)
for(var/obj/machinery/telecomms/broadcaster/L in R.links)
count += 1
return (count >= 2)
// Will update all telecomms machines and check that they can still send signals to off-site levels.
// Called when a machine is unlinked.
/proc/update_all_machines()
for(var/obj/machinery/telecomms/M in telecomms_list)
M.update_level()
/obj/machinery/telecomms/proc/update_level()
// If the broadcaster/receiver cannot lock onto the station and it is set to...
// ..update it to not lock onto the station.
if(src.listening_level == STATION_Z)
if(!check_links())
var/turf/position = get_turf(src)
src.listening_level = position.z
// Toggles the broadcaster/receiver to lock onto the station's level or onto it's own.
// It will need the connected relay to have at least two broadcasters and receivers for it to work.
// Returns true if it sucessfully changes, false otherwise.
/obj/machinery/telecomms/proc/toggle_level()
// Toggle on/off getting signals from the station or the current Z level
if(src.listening_level == STATION_Z) // equals the station
var/turf/position = get_turf(src) // set the level to our z level
src.listening_level = position.z
return 1
else if(check_links())
src.listening_level = STATION_Z
return 1
return 0
// Returns a multitool from a user depending on their mobtype.
/obj/machinery/telecomms/proc/get_multitool(mob/user as mob)
var/obj/item/device/multitool/P = null
// Let's double check
if(!issilicon(user) && istype(user.get_active_hand(), /obj/item/device/multitool))
P = user.get_active_hand()
else if(isAI(user))
var/mob/living/silicon/ai/U = user
P = U.aiMulti
else if(isrobot(user) && in_range(user, src))
if(istype(user.get_active_hand(), /obj/item/device/multitool))
P = user.get_active_hand()
return P
// Additional Options for certain machines. Use this when you want to add an option to a specific machine.
// Example of how to use below.
/obj/machinery/telecomms/proc/Options_Menu()
return ""
/*
// Add an option to the processor to switch processing mode. (COMPRESS -> UNCOMPRESS or UNCOMPRESS -> COMPRESS)
/obj/machinery/telecomms/processor/Options_Menu()
var/dat = "<br>Processing Mode: <A href='?src=\ref[src];process=1'>[process_mode ? "UNCOMPRESS" : "COMPRESS"]</a>"
return dat
*/
// The topic for Additional Options. Use this for checking href links for your specific option.
// Example of how to use below.
/obj/machinery/telecomms/proc/Options_Topic(href, href_list)
return
/*
/obj/machinery/telecomms/processor/Options_Topic(href, href_list)
if(href_list["process"])
temp = "<font color = #666633>-% Processing mode changed. %-</font color>"
src.process_mode = !src.process_mode
*/
/obj/machinery/telecomms/Topic(href, href_list) /obj/machinery/telecomms/Topic(href, href_list)
if(!issilicon(usr)) if(!issilicon(usr))
if(usr.get_active_hand()) if(!istype(usr.get_active_hand(), /obj/item/device/multitool))
if(!istype(usr.get_active_hand(), /obj/item/device/multitool))
return
else
return return
if(stat & (BROKEN|NOPOWER)) if(stat & (BROKEN|NOPOWER))
return return
var/obj/item/device/multitool/P = null var/obj/item/device/multitool/P = get_multitool(usr)
if(!issilicon(usr))
P = usr.get_active_hand()
if(href_list["input"]) if(href_list["input"])
switch(href_list["input"]) switch(href_list["input"])
if("toggle") if("toggle")
src.toggled = !src.toggled src.toggled = !src.toggled
temp = "<font color = #666633>-% [src] has been [src.toggled ? "activated" : "deactivated"].</font color>" temp = "<font color = #666633>-% [src] has been [src.toggled ? "activated" : "deactivated"].</font color>"
update_power()
/*
if("hide")
src.hide = !hide
temp = "<font color = #666633>-% Shadow Link has been [src.hide ? "activated" : "deactivated"].</font color>"
*/
if("level")
//Lock to the station OR lock to the current position!
//You need at least two receivers and two broadcasters for this to work, this includes the machine.
var/result = toggle_level()
if(result)
temp = "<font color = #666633>-% [src]'s signal has been successfully changed.</font color>"
else
temp = "<font color = #666633>-% [src] could not lock it's signal onto the station. Two broadcasters or receivers required.</font color>"
if("id") if("id")
var/newid = copytext(reject_bad_text(input(usr, "Specify the new ID for this machine", src, id) as null|text),1,MAX_MESSAGE_LEN) var/newid = copytext(reject_bad_text(input(usr, "Specify the new ID for this machine", src, id) as null|text),1,MAX_MESSAGE_LEN)
@@ -208,11 +337,9 @@
if("freq") if("freq")
var/newfreq = input(usr, "Specify a new frequency to filter (GHz). Decimals assigned automatically.", src, network) as null|num var/newfreq = input(usr, "Specify a new frequency to filter (GHz). Decimals assigned automatically.", src, network) as null|num
if(newfreq && usr in range(1, src)) if(newfreq && usr in range(1, src))
if(!(newfreq in freq_listening)) if(findtext(num2text(newfreq), "."))
newfreq *= 10 // shift the decimal one place
if(findtext(num2text(newfreq), ".")) if(!(newfreq in freq_listening) && newfreq < 10000)
newfreq *= 10 // shift the decimal one place
freq_listening.Add(newfreq) freq_listening.Add(newfreq)
temp = "<font color = #666633>-% New frequency filter assigned: \"[newfreq] GHz\" %-</font color>" temp = "<font color = #666633>-% New frequency filter assigned: \"[newfreq] GHz\" %-</font color>"
@@ -220,13 +347,9 @@
// changed the layout about to workaround a pesky runtime -- Doohl // changed the layout about to workaround a pesky runtime -- Doohl
var/freq_remove = text2num(href_list["delete"]) var/x = text2num(href_list["delete"])
for(var/x in freq_listening) temp = "<font color = #666633>-% Removed frequency filter [x] %-</font color>"
if(x == freq_remove) freq_listening.Remove(x)
temp = "<font color = #666633>-% Removed frequency filter [x] %-</font color>"
freq_listening.Remove(x)
break
if(href_list["unlink"]) if(href_list["unlink"])
@@ -235,10 +358,14 @@
temp = "<font color = #666633>-% Removed \ref[T] [T.name] from linked entities. %-</font color>" temp = "<font color = #666633>-% Removed \ref[T] [T.name] from linked entities. %-</font color>"
// Remove link entries from both T and src. // Remove link entries from both T and src.
if(src in T.links) if(src in T.links)
T.links.Remove(src) T.links.Remove(src)
links.Remove(T) links.Remove(T)
// Make sure every telecomms machine is not locked to the station when it shouldn't be.
update_all_machines()
if(href_list["link"]) if(href_list["link"])
if(P) if(P)
@@ -266,10 +393,11 @@
temp = "<font color = #666633>-% Buffer successfully flushed. %-</font color>" temp = "<font color = #666633>-% Buffer successfully flushed. %-</font color>"
P.buffer = null P.buffer = null
src.Options_Topic(href, href_list)
usr.machine = src usr.machine = src
src.add_fingerprint(usr) src.add_fingerprint(usr)
updateUsrDialog() updateUsrDialog()
#undef STATION_Z

View File

@@ -32,9 +32,10 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
var/heatgen = 20 // how much heat to transfer to the environment var/heatgen = 20 // how much heat to transfer to the environment
var/delay = 10 // how many process() ticks to delay per heat var/delay = 10 // how many process() ticks to delay per heat
var/heating_power = 40000 var/heating_power = 40000
var/long_range_link = 0 var/long_range_link = 0 // Can you link it across Z levels or on the otherside of the map? (Relay & Hub)
var/circuitboard = null // string pointing to a circuitboard type var/circuitboard = null // string pointing to a circuitboard type
var/hide = 0 // Is it a hidden machine? var/hide = 0 // Is it a hidden machine?
var/listening_level = 0 // 0 = auto set in New() - this is the z level that the machine is listening to.
/obj/machinery/telecomms/proc/relay_information(datum/signal/signal, filter, copysig, amount) /obj/machinery/telecomms/proc/relay_information(datum/signal/signal, filter, copysig, amount)
@@ -60,7 +61,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
continue continue
if(amount && send_count >= amount) if(amount && send_count >= amount)
break break
if(machine.loc.z != src.loc.z) if(machine.loc.z != listening_level)
if(long_range_link == 0 && machine.long_range_link == 0) if(long_range_link == 0 && machine.long_range_link == 0)
continue continue
//Is this a test signal? //Is this a test signal?
@@ -96,7 +97,8 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
"traffic" = signal.data["traffic"], "traffic" = signal.data["traffic"],
"type" = signal.data["type"], "type" = signal.data["type"],
"server" = signal.data["server"], "server" = signal.data["server"],
"reject" = signal.data["reject"] "reject" = signal.data["reject"],
"level" = signal.data["level"]
) )
// Keep the "original" signal constant // Keep the "original" signal constant
@@ -142,11 +144,18 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
/obj/machinery/telecomms/New() /obj/machinery/telecomms/New()
telecomms_list += src telecomms_list += src
..() ..()
//Set the listening_level if there's none.
if(!listening_level)
//Defaults to our Z level!
var/turf/position = get_turf(src)
listening_level = position.z
if(autolinkers.len) if(autolinkers.len)
spawn(15) spawn(15)
// Links nearby machines // Links nearby machines
if(!long_range_link) if(!long_range_link)
for(var/obj/machinery/telecomms/T in orange(15, src)) for(var/obj/machinery/telecomms/T in orange(20, src))
add_link(T) add_link(T)
else else
for(var/obj/machinery/telecomms/T in telecomms_list) for(var/obj/machinery/telecomms/T in telecomms_list)
@@ -162,7 +171,9 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
..() ..()
/obj/machinery/telecomms/proc/add_link(var/obj/machinery/telecomms/T) /obj/machinery/telecomms/proc/add_link(var/obj/machinery/telecomms/T)
if((src.loc.z && T.loc.z) || (src.long_range_link && T.long_range_link)) var/turf/position = get_turf(src)
var/turf/T_position = get_turf(T)
if((position.z == T_position.z) || (src.long_range_link && T.long_range_link))
for(var/x in autolinkers) for(var/x in autolinkers)
if(T.autolinkers.Find(x)) if(T.autolinkers.Find(x))
if(!(T in links) && machinetype != T.machinetype) if(!(T in links) && machinetype != T.machinetype)
@@ -174,16 +185,18 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
else else
icon_state = "[initial(icon_state)]_off" icon_state = "[initial(icon_state)]_off"
/obj/machinery/telecomms/proc/update_power()
/obj/machinery/telecomms/process()
if(toggled) if(toggled)
if(stat & (BROKEN|NOPOWER) || integrity <= 0) // if powered, on. if not powered, off. if too damaged, off if(stat & (BROKEN|NOPOWER|EMPED) || integrity <= 0) // if powered, on. if not powered, off. if too damaged, off
on = 0 on = 0
else else
on = 1 on = 1
else else
on = 0 on = 0
/obj/machinery/telecomms/process()
update_power()
// Check heat and generate some // Check heat and generate some
checkheat() checkheat()
@@ -193,6 +206,14 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
if(traffic > 0) if(traffic > 0)
traffic -= netspeed traffic -= netspeed
/obj/machinery/telecomms/emp_act(severity)
if(prob(100/severity))
if(!(stat & EMPED))
stat |= EMPED
spawn(1200/severity)
stat &= ~EMPED
..()
/obj/machinery/telecomms/proc/checkheat() /obj/machinery/telecomms/proc/checkheat()
// Checks heat from the environment and applies any integrity damage // Checks heat from the environment and applies any integrity damage
var/datum/gas_mixture/environment = loc.return_air() var/datum/gas_mixture/environment = loc.return_air()
@@ -234,7 +255,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
/* /*
The receiver idles and receives messages from subspace-compatible radio equipment; The receiver idles and receives messages from subspace-compatible radio equipment;
primarily headsets. They then just relay this information to all linked devices, primarily headsets. They then just relay this information to all linked devices,
which can would probably be network buses. which can would probably be network hubs.
Link to Processor Units in case receiver can't send to bus units. Link to Processor Units in case receiver can't send to bus units.
*/ */
@@ -256,7 +277,8 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
if(!on) // has to be on to receive messages if(!on) // has to be on to receive messages
return return
if(!signal || signal.data["level"] != listening_level)
return
if(signal.transmission_method == 2) if(signal.transmission_method == 2)
if(is_freq_listening(signal)) // detect subspace signals if(is_freq_listening(signal)) // detect subspace signals
@@ -363,7 +385,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
/obj/machinery/telecomms/bus/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from) /obj/machinery/telecomms/bus/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from)
if(is_freq_listening(signal)) if(is_freq_listening(signal))
if(signal.data["compression"]) // if signal is still compressed from subspace transmission if(!istype(machine_from, /obj/machinery/telecomms/processor)) // Signal must be ready (stupid assuming machine), let's send it
// send to one linked processor unit // send to one linked processor unit
var/send_to_processor = relay_information(signal, "/obj/machinery/telecomms/processor", 1) var/send_to_processor = relay_information(signal, "/obj/machinery/telecomms/processor", 1)
@@ -404,11 +426,17 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
heatgen = 100 heatgen = 100
delay = 5 delay = 5
circuitboard = "/obj/item/weapon/circuitboard/telecomms/processor" circuitboard = "/obj/item/weapon/circuitboard/telecomms/processor"
var/process_mode = 1 // 1 = Uncompress Signals, 0 = Compress Signals
receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from) receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from)
if(is_freq_listening(signal)) if(is_freq_listening(signal))
signal.data["compression"] = 0 // uncompress subspace signal
if(process_mode)
signal.data["compression"] = 0 // uncompress subspace signal
else
signal.data["compression"] = 100 // even more compressed signal
if(istype(machine_from, /obj/machinery/telecomms/bus)) if(istype(machine_from, /obj/machinery/telecomms/bus))
relay_direct_information(signal, machine_from) // send the signal back to the machine relay_direct_information(signal, machine_from) // send the signal back to the machine
else // no bus detected - send the signal to servers instead else // no bus detected - send the signal to servers instead
@@ -564,7 +592,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
/obj/machinery/telecomms/relay/preset/station /obj/machinery/telecomms/relay/preset/station
id = "Station Relay" id = "Station Relay"
autolinkers = list("s_relay", "s_receiverB", "s_broadcasterB") autolinkers = list("s_relay", "s_receiverA", "s_broadcasterA", "s_receiverB", "s_broadcasterB")
/obj/machinery/telecomms/relay/preset/telecomms /obj/machinery/telecomms/relay/preset/telecomms
id = "Telecomms Relay" id = "Telecomms Relay"
@@ -590,12 +618,21 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
//Receivers //Receivers
//--PRESET LEFT--//
/obj/machinery/telecomms/receiver/preset_left /obj/machinery/telecomms/receiver/preset_left
id = "Receiver A" id = "Receiver A"
network = "tcommsat" network = "tcommsat"
autolinkers = list("receiverA") // link to relay autolinkers = list("receiverA") // link to relay
freq_listening = list(1351, 1355, 1347, 1349) // science, medical, cargo, mining freq_listening = list(1351, 1355, 1347, 1349) // science, medical, cargo, mining
/obj/machinery/telecomms/receiver/preset_left/station
id = "Station Receiver A"
autolinkers = list("s_receiverA") // link to relay
listening_level = 1
//--PRESET RIGHT--//
/obj/machinery/telecomms/receiver/preset_right /obj/machinery/telecomms/receiver/preset_right
id = "Receiver B" id = "Receiver B"
network = "tcommsat" network = "tcommsat"
@@ -611,7 +648,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
/obj/machinery/telecomms/receiver/preset_right/station /obj/machinery/telecomms/receiver/preset_right/station
id = "Station Receiver B" id = "Station Receiver B"
autolinkers = list("s_receiverB") autolinkers = list("s_receiverB")
freq_listening = list(1351, 1355, 1347, 1349, 1353, 1357, 1359) // science, medical, cargo, mining, command, engineering, security listening_level = 1 // Listen to the station remotely
/obj/machinery/telecomms/receiver/preset_right/mining /obj/machinery/telecomms/receiver/preset_right/mining
id = "Mining Receiver B" id = "Mining Receiver B"
@@ -727,11 +764,20 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
//Broadcasters //Broadcasters
//--PRESET LEFT--//
/obj/machinery/telecomms/broadcaster/preset_left /obj/machinery/telecomms/broadcaster/preset_left
id = "Broadcaster A" id = "Broadcaster A"
network = "tcommsat" network = "tcommsat"
autolinkers = list("broadcasterA") autolinkers = list("broadcasterA")
/obj/machinery/telecomms/broadcaster/preset_left/station
id = "Station Broadcaster A"
autolinkers = list("s_broadcasterA")
listening_level = 1 // Station
//--PRESET RIGHT--//
/obj/machinery/telecomms/broadcaster/preset_right /obj/machinery/telecomms/broadcaster/preset_right
id = "Broadcaster B" id = "Broadcaster B"
network = "tcommsat" network = "tcommsat"
@@ -741,7 +787,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
/obj/machinery/telecomms/broadcaster/preset_right/station /obj/machinery/telecomms/broadcaster/preset_right/station
id = "Station Broadcaster B" id = "Station Broadcaster B"
autolinkers = list("s_broadcasterB") autolinkers = list("s_broadcasterB")
listening_level = 1 // Station
/obj/machinery/telecomms/broadcaster/preset_right/mining /obj/machinery/telecomms/broadcaster/preset_right/mining
id = "Mining Broadcaster B" id = "Mining Broadcaster B"

View File

@@ -33,9 +33,10 @@
return 0 return 0
if (!(src.wires & WIRE_RECEIVE)) if (!(src.wires & WIRE_RECEIVE))
return 0 return 0
var/turf/position = get_turf(src) if(level != 0)
if(isnull(position) || position.z != level) var/turf/position = get_turf(src)
return 0 if(isnull(position) || position.z != level)
return 0
if (!src.listening) if (!src.listening)
return 0 return 0
if(freq == SYND_FREQ) if(freq == SYND_FREQ)

View File

@@ -598,9 +598,12 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
if (!(wires & WIRE_RECEIVE)) if (!(wires & WIRE_RECEIVE))
return 0 return 0
var/turf/position = get_turf(src) if(!listening)
if(isnull(position) || position.z != level)
return 0 return 0
if(level != 0)
var/turf/position = get_turf(src)
if(isnull(position) || position.z != level)
return 0
if(freq == SYND_FREQ) if(freq == SYND_FREQ)
if(!(src.syndie))//Checks to see if it's allowed on that frequency, based on the encryption keys if(!(src.syndie))//Checks to see if it's allowed on that frequency, based on the encryption keys
return 0 return 0

View File

@@ -1961,6 +1961,11 @@ var/global/BSACooldown = 0
if(aliens_allowed) if(aliens_allowed)
alien_infestation() alien_infestation()
message_admins("[key_name_admin(usr)] has spawned aliens", 1) message_admins("[key_name_admin(usr)] has spawned aliens", 1)
if("comms_blackout")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","CB")
communications_blackout()
message_admins("[key_name_admin(usr)] triggered a communications blackout.", 1)
if("spaceninja") if("spaceninja")
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","SN") feedback_add_details("admin_secrets_fun_used","SN")
@@ -1989,7 +1994,7 @@ var/global/BSACooldown = 0
feedback_add_details("admin_secrets_fun_used","PB") feedback_add_details("admin_secrets_fun_used","PB")
message_admins("[key_name_admin(usr)] has allowed a prison break", 1) message_admins("[key_name_admin(usr)] has allowed a prison break", 1)
prison_break() prison_break()
if("lightsout") if("lightout")
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","LO") feedback_add_details("admin_secrets_fun_used","LO")
message_admins("[key_name_admin(usr)] has broke a lot of lights", 1) message_admins("[key_name_admin(usr)] has broke a lot of lights", 1)
@@ -1999,6 +2004,12 @@ var/global/BSACooldown = 0
feedback_add_details("admin_secrets_fun_used","BO") feedback_add_details("admin_secrets_fun_used","BO")
message_admins("[key_name_admin(usr)] broke all lights", 1) message_admins("[key_name_admin(usr)] broke all lights", 1)
lightsout(0,0) lightsout(0,0)
if("whiteout")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","WO")
for(var/obj/machinery/light/L in world)
L.fix()
message_admins("[key_name_admin(usr)] fixed all lights", 1)
if("virus") if("virus")
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","V") feedback_add_details("admin_secrets_fun_used","V")
@@ -2459,6 +2470,7 @@ var/global/BSACooldown = 0
<A href='?src=\ref[src];secretsfun=lightsout'>Toggle a "lights out" event</A><BR> <A href='?src=\ref[src];secretsfun=lightsout'>Toggle a "lights out" event</A><BR>
<A href='?src=\ref[src];secretsfun=ionstorm'>Spawn an Ion Storm</A><BR> <A href='?src=\ref[src];secretsfun=ionstorm'>Spawn an Ion Storm</A><BR>
<A href='?src=\ref[src];secretsfun=spacevines'>Spawn Space-Vines</A><BR> <A href='?src=\ref[src];secretsfun=spacevines'>Spawn Space-Vines</A><BR>
<A href='?src=\ref[src];secretsfun=comms_blackout'>Trigger a communication blackout</A><BR>
<BR> <BR>
<B>Fun Secrets</B><BR> <B>Fun Secrets</B><BR>
<BR> <BR>
@@ -2483,7 +2495,8 @@ var/global/BSACooldown = 0
<A href='?src=\ref[src];secretsfun=moveferry'>Move Ferry</A><BR> <A href='?src=\ref[src];secretsfun=moveferry'>Move Ferry</A><BR>
<A href='?src=\ref[src];secretsfun=movealienship'>Move Alien Dinghy</A><BR> <A href='?src=\ref[src];secretsfun=movealienship'>Move Alien Dinghy</A><BR>
<A href='?src=\ref[src];secretsfun=moveminingshuttle'>Move Mining Shuttle</A><BR> <A href='?src=\ref[src];secretsfun=moveminingshuttle'>Move Mining Shuttle</A><BR>
<A href='?src=\ref[src];secretsfun=blackout'>Break all lights</A><BR>"} <A href='?src=\ref[src];secretsfun=blackout'>Break all lights</A><BR>
<A href='?src=\ref[src];secretsfun=whiteout'>Fix all lights</A><BR>"}
//<A href='?src=\ref[src];secretsfun=shockwave'>Station Shockwave</A><BR> //<A href='?src=\ref[src];secretsfun=shockwave'>Station Shockwave</A><BR>
if(lvl >= 6) if(lvl >= 6)

View File

@@ -543,6 +543,14 @@
status = LIGHT_BROKEN status = LIGHT_BROKEN
update() update()
/obj/machinery/light/proc/fix()
if(status == LIGHT_OK)
return
status = LIGHT_OK
brightness = initial(brightness)
on = 1
update()
// explosion effect // explosion effect
// destroy the whole light fixture or just shatter it // destroy the whole light fixture or just shatter it
@@ -599,16 +607,6 @@
sleep(1) sleep(1)
del(src) del(src)
// the light item // the light item
// can be tube or bulb subtypes // can be tube or bulb subtypes
// will fit into empty /obj/machinery/light of the corresponding type // will fit into empty /obj/machinery/light of the corresponding type

File diff suppressed because it is too large Load Diff