mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-29 03:21:30 +00:00
Merge branch 'master' of git://github.com/Baystation12/Baystation12
This commit is contained in:
@@ -650,7 +650,9 @@
|
||||
var/atom/movable/overlay/overl = null
|
||||
var/on = 0.0
|
||||
var/obj/item/assembly/shock_kit/part1 = null
|
||||
var/last_time = 1.0
|
||||
var/isshocking
|
||||
var/datum/effect/effect/system/spark_spread/spark = new /datum/effect/effect/system/spark_spread
|
||||
var/list/mob/living/affected = list()
|
||||
|
||||
/obj/structure/table
|
||||
name = "table"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -162,6 +162,9 @@
|
||||
|
||||
proc/Life()
|
||||
update()
|
||||
// only do special stuff if there' air
|
||||
if(!consume_air())
|
||||
return
|
||||
if(check_mutations())
|
||||
return 1
|
||||
if(special_action())
|
||||
@@ -169,6 +172,13 @@
|
||||
|
||||
return 0
|
||||
|
||||
proc/consume_air()
|
||||
if(!istype(src.loc,/turf/simulated)) return 0
|
||||
var/turf/simulated/S = src.loc
|
||||
if(!S.air) return 1 // this means it's a wall, so do process
|
||||
if(S.air.oxygen < 1 || S.air.toxins > 1) return 0
|
||||
return 1
|
||||
|
||||
temperature_expose(datum/gas_mixture/air, temperature, volume)
|
||||
if(temperature > T0C+200)
|
||||
health -= 0.01 * temperature
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -143,14 +143,13 @@
|
||||
return 1
|
||||
if(!I || !istype(I, /obj/item/weapon/card/id) || !I.access) //not ID or no access
|
||||
return 0
|
||||
for(var/req in src.req_access)
|
||||
if(!(req in I.access)) //doesn't have this access
|
||||
return 0
|
||||
if(src.req_one_access && src.req_one_access.len)
|
||||
for(var/req in src.req_one_access)
|
||||
if(req in I.access) //has an access from the single access list
|
||||
return 1
|
||||
return 0
|
||||
for(var/req in src.req_access)
|
||||
if(!(req in I.access)) //doesn't have this access
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
@@ -160,14 +159,13 @@
|
||||
if(!src.req_access.len && (!src.req_one_access || !src.req_one_access.len)) return 1
|
||||
if(!L) return 0
|
||||
if(!istype(L, /list)) return 0
|
||||
for(var/req in src.req_access)
|
||||
if(!(req in L)) //doesn't have this access
|
||||
return 0
|
||||
if(src.req_one_access && src.req_one_access.len)
|
||||
for(var/req in src.req_one_access)
|
||||
if(req in L) //has an access from the single access list
|
||||
return 1
|
||||
return 0
|
||||
for(var/req in src.req_access)
|
||||
if(!(req in L)) //doesn't have this access
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -38,7 +38,6 @@ SYNDICATE UPLINK
|
||||
dat += "<BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];buy_item=revolver'>Revolver</A> (6)<BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];buy_item=revolver_ammo'>Ammo-357</A> for use with Revolver (2)<BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];buy_item=suffocation_revolver_ammo'>Ammo-418</A> for use with Revolver (3)<BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];buy_item=xbow'>Energy Crossbow</A> (5)<BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];buy_item=sword'>Energy Sword</A> (4)<BR>"
|
||||
dat += "<BR>"
|
||||
@@ -99,10 +98,6 @@ SYNDICATE UPLINK
|
||||
if (src.uses >= 2)
|
||||
src.uses -= 2
|
||||
new /obj/item/ammo_magazine/a357(get_turf(src))
|
||||
if("suffocation_revolver_ammo")
|
||||
if (src.uses >= 3)
|
||||
src.uses -= 3
|
||||
new /obj/item/ammo_magazine/a418(get_turf(src))
|
||||
if("xbow")
|
||||
if (src.uses >= 5)
|
||||
src.uses -= 5
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -135,6 +135,7 @@
|
||||
src.overl.layer = 5
|
||||
src.overl.name = "electrified chair"
|
||||
src.overl.master = src
|
||||
spark.set_up(12, 1, src)
|
||||
return
|
||||
|
||||
/obj/structure/stool/chair/e_chair/Del()
|
||||
@@ -156,6 +157,14 @@
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(istype(W, /obj/item/device/assembly/signaler))
|
||||
var/obj/item/assembly/shock_kit/kit = src.part1
|
||||
var/obj/item/device/radio/electropack/target = kit.part2
|
||||
var/obj/item/device/assembly/signaler/S = W
|
||||
target.set_frequency(S.frequency)
|
||||
target.code = S.code
|
||||
for(var/mob/M in viewers(src, null))
|
||||
M.show_message("\red [user] has set the electric chair using the [W].")
|
||||
return
|
||||
|
||||
/obj/structure/stool/chair/e_chair/verb/toggle_power()
|
||||
@@ -165,6 +174,8 @@
|
||||
|
||||
if ((usr.stat || usr.restrained() || !( usr.canmove ) || usr.lying))
|
||||
return
|
||||
if(isshocking && on)
|
||||
shock()
|
||||
src.on = !( src.on )
|
||||
src.icon_state = text("e_chair[]", src.on)
|
||||
src.overl.icon_state = text("e_chairo[]", src.on)
|
||||
@@ -173,37 +184,39 @@
|
||||
/obj/structure/stool/chair/e_chair/proc/shock()
|
||||
if (!( src.on ))
|
||||
return
|
||||
if ( (src.last_time + 50) > world.time)
|
||||
if(isshocking)
|
||||
processing_objects.Remove(src)
|
||||
src.icon_state = text("e_chair[]", src.on)
|
||||
src.overl.icon_state = text("e_chairo[]", src.on)
|
||||
for(var/mob/living/M in affected)
|
||||
M.jitteriness = 0
|
||||
M.is_jittery = 0
|
||||
M.anchored = 0
|
||||
affected.Remove(M)
|
||||
isshocking = 0
|
||||
return
|
||||
else
|
||||
src.icon_state = "e_chairs"
|
||||
src.overl.icon_state = "e_chairos"
|
||||
spark.start()
|
||||
for(var/mob/M in hearers(src, null))
|
||||
M.show_message("\red The electric chair went off!.", 3, "\red You hear a deep sharp shock.", 2)
|
||||
processing_objects.Add(src)
|
||||
isshocking = 1
|
||||
return
|
||||
src.last_time = world.time
|
||||
|
||||
/obj/structure/stool/chair/e_chair/process()
|
||||
// special power handling
|
||||
var/area/A = get_area(src)
|
||||
if(!isarea(A))
|
||||
return
|
||||
if(!A.powered(EQUIP))
|
||||
return
|
||||
A.use_power(EQUIP, 5000)
|
||||
var/light = A.power_light
|
||||
A.updateicon()
|
||||
|
||||
flick("e_chairs", src)
|
||||
flick("e_chairos", src.overl)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(12, 1, src)
|
||||
s.start()
|
||||
if(isarea(A) && A.powered(EQUIP))
|
||||
A.use_power(EQUIP, 5000)
|
||||
for(var/mob/living/M in src.loc)
|
||||
M.burn_skin(85)
|
||||
M << "\red <B>You feel a deep shock course through your body!</B>"
|
||||
sleep(1)
|
||||
M.burn_skin(85)
|
||||
affected.Add(M)
|
||||
M.make_jittery(1000)
|
||||
M.anchored = 1
|
||||
M.Stun(600)
|
||||
for(var/mob/M in hearers(src, null))
|
||||
M.show_message("\red The electric chair went off!.", 3, "\red You hear a deep sharp shock.", 2)
|
||||
|
||||
A.power_light = light
|
||||
A.updateicon()
|
||||
return
|
||||
M.burn_skin(10)
|
||||
spark.start()
|
||||
|
||||
/obj/structure/stool/chair/ex_act(severity)
|
||||
unbuckle_all()
|
||||
|
||||
@@ -115,8 +115,25 @@
|
||||
if(1)
|
||||
usr << "\red [src.name] appears to have bitten [t_his] tongue off!"
|
||||
|
||||
var/distance = get_dist(usr,src)
|
||||
if(istype(usr, /mob/dead/observer) || usr.stat == 2) // ghosts can see anything
|
||||
distance = 1
|
||||
|
||||
if (src.stat == 1 || stat == 2)
|
||||
usr << "\red [name] doesn't seem to be responding to anything around [t_him], [t_his] eyes closed as though asleep."
|
||||
if((health < 0 || stat == 1) && distance <= 3)
|
||||
usr << "\red [name] does not appear to be breathing."
|
||||
if(istype(usr, /mob/living/carbon/human) && usr.stat == 0 && src.stat == 1 && distance <= 1)
|
||||
for(var/mob/O in viewers(usr.loc, null))
|
||||
O.show_message("[usr] checks [src]'s pulse.", 1)
|
||||
usr << "\blue [name] has a pulse!"
|
||||
|
||||
if (src.stat == 2 || (changeling && changeling.changeling_fakedeath == 1))
|
||||
usr << "\red [src] is limp and unresponsive, a dull lifeless look in [t_his] eyes."
|
||||
if(distance <= 1)
|
||||
if(istype(usr, /mob/living/carbon/human) && usr.stat == 0)
|
||||
for(var/mob/O in viewers(usr.loc, null))
|
||||
O.show_message("[usr] checks [src]'s pulse.", 1)
|
||||
usr << "\red [name] has no pulse!"
|
||||
else
|
||||
if (src.getBruteLoss())
|
||||
if (src.getBruteLoss() < 30)
|
||||
@@ -144,8 +161,6 @@
|
||||
else
|
||||
usr << "\blue [src.name] looks quite chubby."
|
||||
|
||||
if (src.stat == 1)
|
||||
usr << "\red [src.name] doesn't seem to be responding to anything around [t_him], [t_his] eyes closed as though asleep."
|
||||
else if (src.brainloss >= 60)
|
||||
usr << "\red [src.name] has a stupid expression on [t_his] face."
|
||||
if (!src.client)
|
||||
|
||||
@@ -65,6 +65,8 @@
|
||||
if(!special_check(user)) return
|
||||
if(!load_into_chamber())
|
||||
user << "\red *click*";
|
||||
for(var/mob/M in orange(4,src.loc))
|
||||
M.show_message("*click, click*")
|
||||
return
|
||||
|
||||
if(!in_chamber) return
|
||||
|
||||
Reference in New Issue
Block a user