Latest TG radio update. Nuke agents can now hear all radio, which is intercepted to their frequency. Remapped some stuff making the Comm Sat actually accessible by people with access.

This commit is contained in:
SkyMarshal
2012-01-18 11:14:20 -07:00
parent ded268cab9
commit bd97d9cdfd
7 changed files with 3081 additions and 2984 deletions
+11 -4
View File
@@ -113,7 +113,7 @@ var/list/radiochannels = list(
var/list/DEPT_FREQS = list(1351,1355,1357,1359,1213,1441,1349,1347)
var/const/COMM_FREQ = 1353 //command, colored gold in chat window
var/const/SYND_FREQ = 1213
var/NUKE_FREQ = 1199 //Never accessable except on nuke rounds, randomised on nuke rounds.
var/NUKE_FREQ = 1200 //Randomised on nuke rounds.
#define TRANSMISSION_WIRE 0
#define TRANSMISSION_RADIO 1
@@ -159,9 +159,16 @@ datum/controller/radio
return 1
proc/return_frequency(var/frequency as num)
var/f_text = num2text(frequency)
return frequencies[f_text]
proc/return_frequency(var/new_frequency as num)
var/f_text = num2text(new_frequency)
var/datum/radio_frequency/frequency = frequencies[f_text]
if(!frequency)
frequency = new
frequency.frequency = new_frequency
frequencies[f_text] = frequency
return frequency
datum/radio_frequency
var/frequency as num
+2 -2
View File
@@ -207,15 +207,15 @@
/datum/game_mode/proc/random_radio_frequency(var/tempfreq = 1459)
tempfreq = rand(1400,1600)
tempfreq = rand(1200,1600)
if(tempfreq in radiochannels || (tempfreq > 1441 && tempfreq < 1489))
random_radio_frequency(tempfreq)
return tempfreq
/datum/game_mode/proc/equip_syndicate(mob/living/carbon/human/synd_mob,radio_freq)
var/obj/item/device/radio/R = new /obj/item/device/radio/headset(synd_mob)
R.set_frequency(radio_freq)
R.freerange = 1
R.listening = 0
R.config(list("Nuclear" = 1))
synd_mob.equip_if_possible(R, synd_mob.slot_ears)
synd_mob.equip_if_possible(new /obj/item/clothing/under/syndicate(synd_mob), synd_mob.slot_w_uniform)
+83 -5
View File
@@ -44,6 +44,65 @@
/* --- Do a snazzy animation! --- */
flick("broadcaster_send", src)
/*
Basically just an empty shell for receiving and broadcasting radio messages. Not
very flexible, but it gets the job done.
*/
/obj/machinery/telecomms/allinone
name = "Telecommunications Mainframe"
icon = 'stationobjs.dmi'
icon_state = "comm_server"
desc = "A compact machine used for portable subspace telecommuniations processing."
density = 1
anchored = 1
use_power = 0
idle_power_usage = 0
machinetype = 6
heatgen = 0
var/intercept = 0 // if nonzero, broadcasts all messages to syndicate channel
receive_signal(datum/signal/signal)
if(!on) // has to be on to receive messages
return
if(signal.transmission_method == 2)
if(is_freq_listening(signal)) // detect subspace signals
signal.data["done"] = 1 // mark the signal as being broadcasted
signal.data["compression"] = 0
// Search for the original signal and mark it as done as well
var/datum/signal/original = signal.data["original"]
if(original)
original.data["done"] = 1
if(signal.data["slow"] > 0)
sleep(signal.data["slow"]) // simulate the network lag if necessary
/* ###### Broadcast a message using signal.data ###### */
var/datum/radio_frequency/connection = signal.data["connection"]
if(connection.frequency == NUKE_FREQ) // if syndicate broadcast, just
Broadcast_Message(signal.data["connection"], signal.data["mob"],
signal.data["vmask"], signal.data["vmessage"],
signal.data["radio"], signal.data["message"],
signal.data["name"], signal.data["job"],
signal.data["realname"], signal.data["vname"],, signal.data["compression"])
else
if(intercept)
Broadcast_Message(signal.data["connection"], signal.data["mob"],
signal.data["vmask"], signal.data["vmessage"],
signal.data["radio"], signal.data["message"],
signal.data["name"], signal.data["job"],
signal.data["realname"], signal.data["vname"], 3, signal.data["compression"])
/**
Here is the big, bad function that broadcasts a message given the appropriate
@@ -82,10 +141,11 @@
@param vname:
If specified, will use this name when mob M is not understood. signal.data["vname"]
@param filtertype:
@param data:
If specified:
1 -- Will only broadcast to intercoms
2 -- Will only broadcast to intercoms and station-bounced radios
3 -- Broadcast to syndicate frequency
@param compression:
If 0, the signal is audible
@@ -96,7 +156,7 @@
/proc/Broadcast_Message(var/datum/radio_frequency/connection, var/mob/M,
var/vmask, var/vmessage, var/obj/item/device/radio/radio,
var/message, var/name, var/job, var/realname, var/vname,
var/filtertype, var/compression)
var/data, var/compression)
/* ###### Prepare the radio connection ###### */
@@ -108,7 +168,7 @@
// --- Broadcast only to intercom devices ---
if(filtertype == 1)
if(data == 1)
for (var/obj/item/device/radio/intercom/R in connection.devices["[RADIO_CHAT]"])
receive |= R.send_hear(display_freq)
@@ -116,7 +176,7 @@
// --- Broadcast only to intercoms and station-bounced radios ---
else if(filtertype == 2)
else if(data == 2)
for (var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"])
if(istype(R, /obj/item/device/radio/headset))
@@ -125,6 +185,16 @@
receive |= R.send_hear(display_freq)
// --- Broadcast to syndicate radio! ---
else if(data == 3)
var/datum/radio_frequency/syndicateconnection = radio_controller.return_frequency(NUKE_FREQ)
for (var/obj/item/device/radio/R in syndicateconnection.devices["[RADIO_CHAT]"])
receive |= R.send_hear(NUKE_FREQ)
// --- Broadcast to ALL radio devices ---
else
@@ -207,6 +277,9 @@
freq_text = "Mining"
if(1347)
freq_text = "Cargo"
if(connection.frequency == NUKE_FREQ)
freq_text = "Agent"
//There's probably a way to use the list var of channels in code\game\communications.dm to make the dept channels non-hardcoded, but I wasn't in an experimentive mood. --NEO
@@ -217,11 +290,16 @@
// --- Some more pre-message formatting ---
var/part_b = "</span><b> \icon[radio]\[[freq_text]\]</b> <span class='message'>" // Tweaked for security headsets -- TLE
var/part_b_extra = ""
if(data == 3) // intercepted radio message
part_b_extra = " <i>(Intercepted)</i>"
var/part_b = "</span><b> \icon[radio]\[[freq_text]\][part_b_extra]</b> <span class='message'>" // Tweaked for security headsets -- TLE
var/part_c = "</span></span>"
if (display_freq==SYND_FREQ)
part_a = "<span class='syndradio'><span class='name'>"
else if (display_freq==NUKE_FREQ)
part_a = "<span class='nukeradio'><span class='name'>"
else if (display_freq==COMM_FREQ)
part_a = "<span class='comradio'><span class='name'>"
else if (display_freq in DEPT_FREQS)
@@ -114,7 +114,7 @@
dat += "<br>Prefabrication: [autolinkers.len ? "TRUE" : "FALSE"]"
dat += "<br>Linked Network Entities: <ol>"
for(var/obj/machinery/telecomms/T in links)
dat += "<li>\ref[T] [T.name] ([T.id])</li>"
dat += "<li>\ref[T] [T.name] ([T.id]) (<a href='?src=\ref[src];remove=[T.id]'>X</a>)</li>"
dat += "</ol>"
dat += "<br>Filtering Frequencies: "
@@ -222,6 +222,13 @@
temp = "<font color = #666633>-% Buffer successfully flushed. %-</font color>"
P.buffer = null
if(href_list["remove"])
temp = "<font color = #666633>-% Link successfully removed. %-</font color>"
for(var/obj/machinery/telecomms/T in links)
if(T.id == href_list["remove"])
src.links.Remove(T)
break
usr.machine = src
src.add_fingerprint(usr)
@@ -189,6 +189,9 @@
delay = initial(delay)
proc/produce_heat(heat_amt)
if(heatgen == 0)
return
if(!(stat & (NOPOWER|BROKEN))) //Blatently stolen from space heater.
var/turf/simulated/L = loc
if(istype(L))
@@ -472,7 +475,7 @@
/obj/machinery/telecomms/processor/preset_three
id = "Processor 3"
network = "Communications Satellite"
network = "tcommsat"
autolinkers = list("processor3")
/obj/machinery/telecomms/processor/preset_four
+9 -8
View File
@@ -254,9 +254,10 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
// --- Modifications to the mob's identity ---
// The mob is disguising their identity:
if (istype(M.wear_mask, /obj/item/clothing/mask/gas/voice)&&M.wear_mask:vchange)
displayname = M.wear_mask:voice
jobname = "Unknown"
if (istype(M.wear_mask, /obj/item/clothing/mask/gas/voice))
if(M.wear_mask:vchange)
displayname = M.wear_mask:voice
jobname = "Unknown"
voicemask = 1
@@ -299,7 +300,11 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
for(var/obj/machinery/telecomms/receiver/R in world)
R.receive_signal(signal)
// Receiving code can be located in _____.dm
// Allinone can act as receivers.
for(var/obj/machinery/telecomms/allinone/R in world)
R.receive_signal(signal)
// Receiving code can be located in Telecommunications.dm
return
@@ -441,8 +446,6 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
freq_text = "Mining"
if(1347)
freq_text = "Cargo"
if(connection.frequency == NUKE_FREQ)
freq_text = "Agent"
//There's probably a way to use the list var of channels in code\game\communications.dm to make the dept channels non-hardcoded, but I wasn't in an experimentive mood. --NEO
if(!freq_text)
@@ -453,8 +456,6 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
if (display_freq==SYND_FREQ)
part_a = "<span class='syndradio'><span class='name'>"
else if (display_freq==NUKE_FREQ)
part_a = "<span class='nukeradio'><span class='name'>"
else if (display_freq==COMM_FREQ)
part_a = "<span class='comradio'><span class='name'>"
else if (display_freq in DEPT_FREQS)