mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-26 21:49:11 +01:00
Merge remote-tracking branch 'upstream/dev' into Map
This commit is contained in:
+1
-1
@@ -84,6 +84,7 @@
|
||||
#include "code\ATMOSPHERICS\components\unary\vent_scrubber.dm"
|
||||
#include "code\controllers\_DynamicAreaLighting_TG.dm"
|
||||
#include "code\controllers\autotransfer.dm"
|
||||
#include "code\controllers\communications.dm"
|
||||
#include "code\controllers\configuration.dm"
|
||||
#include "code\controllers\emergency_shuttle_controller.dm"
|
||||
#include "code\controllers\failsafe.dm"
|
||||
@@ -175,7 +176,6 @@
|
||||
#include "code\game\asteroid.dm"
|
||||
#include "code\game\atoms.dm"
|
||||
#include "code\game\atoms_movable.dm"
|
||||
#include "code\game\communications.dm"
|
||||
#include "code\game\response_team.dm"
|
||||
#include "code\game\shuttle_engines.dm"
|
||||
#include "code\game\skincmd.dm"
|
||||
|
||||
@@ -1,307 +1,294 @@
|
||||
/*
|
||||
HOW IT WORKS
|
||||
|
||||
The radio_controller is a global object maintaining all radio transmissions, think about it as about "ether".
|
||||
Note that walkie-talkie, intercoms and headsets handle transmission using nonstandard way.
|
||||
procs:
|
||||
|
||||
add_object(obj/device as obj, var/new_frequency as num, var/filter as text|null = null)
|
||||
Adds listening object.
|
||||
parameters:
|
||||
device - device receiving signals, must have proc receive_signal (see description below).
|
||||
one device may listen several frequencies, but not same frequency twice.
|
||||
new_frequency - see possibly frequencies below;
|
||||
filter - thing for optimization. Optional, but recommended.
|
||||
All filters should be consolidated in this file, see defines later.
|
||||
Device without listening filter will receive all signals (on specified frequency).
|
||||
Device with filter will receive any signals sent without filter.
|
||||
Device with filter will not receive any signals sent with different filter.
|
||||
returns:
|
||||
Reference to frequency object.
|
||||
|
||||
remove_object (obj/device, old_frequency)
|
||||
Obliviously, after calling this proc, device will not receive any signals on old_frequency.
|
||||
Other frequencies will left unaffected.
|
||||
|
||||
return_frequency(var/frequency as num)
|
||||
returns:
|
||||
Reference to frequency object. Use it if you need to send and do not need to listen.
|
||||
|
||||
radio_frequency is a global object maintaining list of devices that listening specific frequency.
|
||||
procs:
|
||||
|
||||
post_signal(obj/source as obj|null, datum/signal/signal, var/filter as text|null = null, var/range as num|null = null)
|
||||
Sends signal to all devices that wants such signal.
|
||||
parameters:
|
||||
source - object, emitted signal. Usually, devices will not receive their own signals.
|
||||
signal - see description below.
|
||||
filter - described above.
|
||||
range - radius of regular byond's square circle on that z-level. null means everywhere, on all z-levels.
|
||||
|
||||
obj/proc/receive_signal(datum/signal/signal, var/receive_method as num, var/receive_param)
|
||||
Handler from received signals. By default does nothing. Define your own for your object.
|
||||
Avoid of sending signals directly from this proc, use spawn(-1). Do not use sleep() here please.
|
||||
parameters:
|
||||
signal - see description below. Extract all needed data from the signal before doing sleep(), spawn() or return!
|
||||
receive_method - may be TRANSMISSION_WIRE or TRANSMISSION_RADIO.
|
||||
TRANSMISSION_WIRE is currently unused.
|
||||
receive_param - for TRANSMISSION_RADIO here comes frequency.
|
||||
|
||||
datum/signal
|
||||
vars:
|
||||
source
|
||||
an object that emitted signal. Used for debug and bearing.
|
||||
data
|
||||
list with transmitting data. Usual use pattern:
|
||||
data["msg"] = "hello world"
|
||||
encryption
|
||||
Some number symbolizing "encryption key".
|
||||
Note that game actually do not use any cryptography here.
|
||||
If receiving object don't know right key, it must ignore encrypted signal in its receive_signal.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
Frequency range: 1200 to 1600
|
||||
Radiochat range: 1441 to 1489 (most devices refuse to be tune to other frequency, even during mapmaking)
|
||||
|
||||
Radio:
|
||||
1459 - standard radio chat
|
||||
1351 - Science
|
||||
1353 - Command
|
||||
1355 - Medical
|
||||
1357 - Engineering
|
||||
1359 - Security
|
||||
1441 - death squad
|
||||
1443 - Confession Intercom
|
||||
1347 - Cargo techs
|
||||
|
||||
Devices:
|
||||
1451 - tracking implant
|
||||
1457 - RSD default
|
||||
|
||||
On the map:
|
||||
1311 for prison shuttle console (in fact, it is not used)
|
||||
1435 for status displays
|
||||
1437 for atmospherics/fire alerts
|
||||
1439 for engine components
|
||||
1439 for air pumps, air scrubbers, atmo control
|
||||
1441 for atmospherics - supply tanks
|
||||
1443 for atmospherics - distribution loop/mixed air tank
|
||||
1445 for bot nav beacons
|
||||
1447 for mulebot, secbot and ed209 control
|
||||
1449 for airlock controls, electropack, magnets
|
||||
1451 for toxin lab access
|
||||
1453 for engineering access
|
||||
1455 for AI access
|
||||
*/
|
||||
|
||||
var/list/radiochannels = list(
|
||||
"Common" = 1459,
|
||||
"Science" = 1351,
|
||||
"Command" = 1353,
|
||||
"Medical" = 1355,
|
||||
"Engineering" = 1357,
|
||||
"Security" = 1359,
|
||||
"Response Team" = 1345,
|
||||
"Deathsquad" = 1341,
|
||||
"Syndicate" = 1213,
|
||||
"Supply" = 1347,
|
||||
)
|
||||
//depenging helpers
|
||||
var/list/DEPT_FREQS = list(1351, 1355, 1357, 1359, 1213, 1345, 1341, 1347)
|
||||
|
||||
// central command channels, i.e deathsquid & response teams
|
||||
var/list/CENT_FREQS = list(1345, 1341)
|
||||
|
||||
var/const/COMM_FREQ = 1353 //command, colored gold in chat window
|
||||
var/const/SYND_FREQ = 1213
|
||||
|
||||
// department channels
|
||||
var/const/SEC_FREQ = 1359
|
||||
var/const/ENG_FREQ = 1357
|
||||
var/const/SCI_FREQ = 1351
|
||||
var/const/MED_FREQ = 1355
|
||||
var/const/SUP_FREQ = 1347
|
||||
|
||||
#define TRANSMISSION_WIRE 0
|
||||
#define TRANSMISSION_RADIO 1
|
||||
|
||||
/* filters */
|
||||
var/const/RADIO_TO_AIRALARM = "1"
|
||||
var/const/RADIO_FROM_AIRALARM = "2"
|
||||
var/const/RADIO_CHAT = "3"
|
||||
var/const/RADIO_ATMOSIA = "4"
|
||||
var/const/RADIO_NAVBEACONS = "5"
|
||||
var/const/RADIO_AIRLOCK = "6"
|
||||
var/const/RADIO_SECBOT = "7"
|
||||
var/const/RADIO_MULEBOT = "8"
|
||||
var/const/RADIO_MAGNETS = "9"
|
||||
|
||||
var/global/datum/controller/radio/radio_controller
|
||||
|
||||
/hook/startup/proc/createRadioController()
|
||||
radio_controller = new /datum/controller/radio()
|
||||
return 1
|
||||
|
||||
datum/controller/radio
|
||||
var/list/datum/radio_frequency/frequencies = list()
|
||||
|
||||
proc/add_object(obj/device as obj, var/new_frequency as num, var/filter = null as text|null)
|
||||
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
|
||||
|
||||
frequency.add_listener(device, filter)
|
||||
return frequency
|
||||
|
||||
proc/remove_object(obj/device, old_frequency)
|
||||
var/f_text = num2text(old_frequency)
|
||||
var/datum/radio_frequency/frequency = frequencies[f_text]
|
||||
|
||||
if(frequency)
|
||||
frequency.remove_listener(device)
|
||||
|
||||
if(frequency.devices.len == 0)
|
||||
del(frequency)
|
||||
frequencies -= f_text
|
||||
|
||||
return 1
|
||||
|
||||
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
|
||||
var/list/list/obj/devices = list()
|
||||
|
||||
proc
|
||||
post_signal(obj/source as obj|null, datum/signal/signal, var/filter = null as text|null, var/range = null as num|null)
|
||||
//log_admin("DEBUG \[[world.timeofday]\]: post_signal {source=\"[source]\", [signal.debug_print()], filter=[filter]}")
|
||||
// var/N_f=0
|
||||
// var/N_nf=0
|
||||
// var/Nt=0
|
||||
var/turf/start_point
|
||||
if(range)
|
||||
start_point = get_turf(source)
|
||||
if(!start_point)
|
||||
del(signal)
|
||||
return 0
|
||||
if (filter) //here goes some copypasta. It is for optimisation. -rastaf0
|
||||
for(var/obj/device in devices[filter])
|
||||
if(device == source)
|
||||
continue
|
||||
if(range)
|
||||
var/turf/end_point = get_turf(device)
|
||||
if(!end_point)
|
||||
continue
|
||||
//if(max(abs(start_point.x-end_point.x), abs(start_point.y-end_point.y)) <= range)
|
||||
if(start_point.z!=end_point.z || get_dist(start_point, end_point) > range)
|
||||
continue
|
||||
device.receive_signal(signal, TRANSMISSION_RADIO, frequency)
|
||||
for(var/obj/device in devices["_default"])
|
||||
if(device == source)
|
||||
continue
|
||||
if(range)
|
||||
var/turf/end_point = get_turf(device)
|
||||
if(!end_point)
|
||||
continue
|
||||
//if(max(abs(start_point.x-end_point.x), abs(start_point.y-end_point.y)) <= range)
|
||||
if(start_point.z!=end_point.z || get_dist(start_point, end_point) > range)
|
||||
continue
|
||||
device.receive_signal(signal, TRANSMISSION_RADIO, frequency)
|
||||
// N_f++
|
||||
else
|
||||
for (var/next_filter in devices)
|
||||
// var/list/obj/DDD = devices[next_filter]
|
||||
// Nt+=DDD.len
|
||||
for(var/obj/device in devices[next_filter])
|
||||
if(device == source)
|
||||
continue
|
||||
if(range)
|
||||
var/turf/end_point = get_turf(device)
|
||||
if(!end_point)
|
||||
continue
|
||||
//if(max(abs(start_point.x-end_point.x), abs(start_point.y-end_point.y)) <= range)
|
||||
if(start_point.z!=end_point.z || get_dist(start_point, end_point) > range)
|
||||
continue
|
||||
device.receive_signal(signal, TRANSMISSION_RADIO, frequency)
|
||||
// N_nf++
|
||||
|
||||
// log_admin("DEBUG: post_signal(source=[source] ([source.x], [source.y], [source.z]),filter=[filter]) frequency=[frequency], N_f=[N_f], N_nf=[N_nf]")
|
||||
|
||||
|
||||
// del(signal)
|
||||
|
||||
add_listener(obj/device as obj, var/filter as text|null)
|
||||
if (!filter)
|
||||
filter = "_default"
|
||||
//log_admin("add_listener(device=[device],filter=[filter]) frequency=[frequency]")
|
||||
var/list/obj/devices_line = devices[filter]
|
||||
if (!devices_line)
|
||||
devices_line = new
|
||||
devices[filter] = devices_line
|
||||
devices_line+=device
|
||||
// var/list/obj/devices_line___ = devices[filter_str]
|
||||
// var/l = devices_line___.len
|
||||
//log_admin("DEBUG: devices_line.len=[devices_line.len]")
|
||||
//log_admin("DEBUG: devices(filter_str).len=[l]")
|
||||
|
||||
remove_listener(obj/device)
|
||||
for (var/devices_filter in devices)
|
||||
var/list/devices_line = devices[devices_filter]
|
||||
devices_line-=device
|
||||
while (null in devices_line)
|
||||
devices_line -= null
|
||||
if (devices_line.len==0)
|
||||
devices -= devices_filter
|
||||
del(devices_line)
|
||||
|
||||
|
||||
obj/proc
|
||||
receive_signal(datum/signal/signal, receive_method, receive_param)
|
||||
return null
|
||||
|
||||
datum/signal
|
||||
var/obj/source
|
||||
|
||||
var/transmission_method = 0
|
||||
//0 = wire
|
||||
//1 = radio transmission
|
||||
//2 = subspace transmission
|
||||
|
||||
var/data = list()
|
||||
var/encryption
|
||||
|
||||
var/frequency = 0
|
||||
|
||||
proc/copy_from(datum/signal/model)
|
||||
source = model.source
|
||||
transmission_method = model.transmission_method
|
||||
data = model.data
|
||||
encryption = model.encryption
|
||||
frequency = model.frequency
|
||||
|
||||
proc/debug_print()
|
||||
if (source)
|
||||
. = "signal = {source = '[source]' ([source:x],[source:y],[source:z])\n"
|
||||
else
|
||||
. = "signal = {source = '[source]' ()\n"
|
||||
for (var/i in data)
|
||||
. += "data\[\"[i]\"\] = \"[data[i]]\"\n"
|
||||
if(islist(data[i]))
|
||||
var/list/L = data[i]
|
||||
for(var/t in L)
|
||||
. += "data\[\"[i]\"\] list has: [t]"
|
||||
/*
|
||||
HOW IT WORKS
|
||||
|
||||
The radio_controller is a global object maintaining all radio transmissions, think about it as about "ether".
|
||||
Note that walkie-talkie, intercoms and headsets handle transmission using nonstandard way.
|
||||
procs:
|
||||
|
||||
add_object(obj/device as obj, var/new_frequency as num, var/filter as text|null = null)
|
||||
Adds listening object.
|
||||
parameters:
|
||||
device - device receiving signals, must have proc receive_signal (see description below).
|
||||
one device may listen several frequencies, but not same frequency twice.
|
||||
new_frequency - see possibly frequencies below;
|
||||
filter - thing for optimization. Optional, but recommended.
|
||||
All filters should be consolidated in this file, see defines later.
|
||||
Device without listening filter will receive all signals (on specified frequency).
|
||||
Device with filter will receive any signals sent without filter.
|
||||
Device with filter will not receive any signals sent with different filter.
|
||||
returns:
|
||||
Reference to frequency object.
|
||||
|
||||
remove_object (obj/device, old_frequency)
|
||||
Obliviously, after calling this proc, device will not receive any signals on old_frequency.
|
||||
Other frequencies will left unaffected.
|
||||
|
||||
return_frequency(var/frequency as num)
|
||||
returns:
|
||||
Reference to frequency object. Use it if you need to send and do not need to listen.
|
||||
|
||||
radio_frequency is a global object maintaining list of devices that listening specific frequency.
|
||||
procs:
|
||||
|
||||
post_signal(obj/source as obj|null, datum/signal/signal, var/filter as text|null = null, var/range as num|null = null)
|
||||
Sends signal to all devices that wants such signal.
|
||||
parameters:
|
||||
source - object, emitted signal. Usually, devices will not receive their own signals.
|
||||
signal - see description below.
|
||||
filter - described above.
|
||||
range - radius of regular byond's square circle on that z-level. null means everywhere, on all z-levels.
|
||||
|
||||
obj/proc/receive_signal(datum/signal/signal, var/receive_method as num, var/receive_param)
|
||||
Handler from received signals. By default does nothing. Define your own for your object.
|
||||
Avoid of sending signals directly from this proc, use spawn(-1). Do not use sleep() here please.
|
||||
parameters:
|
||||
signal - see description below. Extract all needed data from the signal before doing sleep(), spawn() or return!
|
||||
receive_method - may be TRANSMISSION_WIRE or TRANSMISSION_RADIO.
|
||||
TRANSMISSION_WIRE is currently unused.
|
||||
receive_param - for TRANSMISSION_RADIO here comes frequency.
|
||||
|
||||
datum/signal
|
||||
vars:
|
||||
source
|
||||
an object that emitted signal. Used for debug and bearing.
|
||||
data
|
||||
list with transmitting data. Usual use pattern:
|
||||
data["msg"] = "hello world"
|
||||
encryption
|
||||
Some number symbolizing "encryption key".
|
||||
Note that game actually do not use any cryptography here.
|
||||
If receiving object don't know right key, it must ignore encrypted signal in its receive_signal.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
Frequency range: 1200 to 1600
|
||||
Radiochat range: 1441 to 1489 (most devices refuse to be tune to other frequency, even during mapmaking)
|
||||
|
||||
Radio:
|
||||
1459 - standard radio chat
|
||||
1351 - Science
|
||||
1353 - Command
|
||||
1355 - Medical
|
||||
1357 - Engineering
|
||||
1359 - Security
|
||||
1441 - death squad
|
||||
1443 - Confession Intercom
|
||||
1347 - Cargo techs
|
||||
|
||||
Devices:
|
||||
1451 - tracking implant
|
||||
1457 - RSD default
|
||||
|
||||
On the map:
|
||||
1311 for prison shuttle console (in fact, it is not used)
|
||||
1435 for status displays
|
||||
1437 for atmospherics/fire alerts
|
||||
1439 for engine components
|
||||
1439 for air pumps, air scrubbers, atmo control
|
||||
1441 for atmospherics - supply tanks
|
||||
1443 for atmospherics - distribution loop/mixed air tank
|
||||
1445 for bot nav beacons
|
||||
1447 for mulebot, secbot and ed209 control
|
||||
1449 for airlock controls, electropack, magnets
|
||||
1451 for toxin lab access
|
||||
1453 for engineering access
|
||||
1455 for AI access
|
||||
*/
|
||||
|
||||
var/list/radiochannels = list(
|
||||
"Common" = 1459,
|
||||
"Science" = 1351,
|
||||
"Command" = 1353,
|
||||
"Medical" = 1355,
|
||||
"Engineering" = 1357,
|
||||
"Security" = 1359,
|
||||
"Response Team" = 1345,
|
||||
"Deathsquad" = 1341,
|
||||
"Syndicate" = 1213,
|
||||
"Supply" = 1347,
|
||||
)
|
||||
//depenging helpers
|
||||
var/list/DEPT_FREQS = list(1351, 1355, 1357, 1359, 1213, 1345, 1341, 1347)
|
||||
|
||||
// central command channels, i.e deathsquid & response teams
|
||||
var/list/CENT_FREQS = list(1345, 1341)
|
||||
|
||||
var/const/COMM_FREQ = 1353 //command, colored gold in chat window
|
||||
var/const/SYND_FREQ = 1213
|
||||
|
||||
// department channels
|
||||
var/const/SEC_FREQ = 1359
|
||||
var/const/ENG_FREQ = 1357
|
||||
var/const/SCI_FREQ = 1351
|
||||
var/const/MED_FREQ = 1355
|
||||
var/const/SUP_FREQ = 1347
|
||||
|
||||
#define TRANSMISSION_WIRE 0
|
||||
#define TRANSMISSION_RADIO 1
|
||||
|
||||
/* filters */
|
||||
//When devices register with the radio controller, they might register under a certain filter.
|
||||
//Other devices can then choose to send signals to only those devices that belong to a particular filter.
|
||||
//This is done for performance, so we don't send signals to lots of machines unnecessarily.
|
||||
|
||||
//This filter is special because devices belonging to default also recieve signals sent to any other filter.
|
||||
var/const/RADIO_DEFAULT = "radio_default"
|
||||
|
||||
var/const/RADIO_TO_AIRALARM = "radio_airalarm" //air alarms
|
||||
var/const/RADIO_FROM_AIRALARM = "radio_airalarm_rcvr" //devices interested in recieving signals from air alarms
|
||||
var/const/RADIO_CHAT = "radio_telecoms"
|
||||
var/const/RADIO_ATMOSIA = "radio_atmos"
|
||||
var/const/RADIO_NAVBEACONS = "radio_navbeacon"
|
||||
var/const/RADIO_AIRLOCK = "radio_airlock"
|
||||
var/const/RADIO_SECBOT = "radio_secbot"
|
||||
var/const/RADIO_MULEBOT = "radio_mulebot"
|
||||
var/const/RADIO_MAGNETS = "radio_magnet"
|
||||
|
||||
var/global/datum/controller/radio/radio_controller
|
||||
|
||||
/hook/startup/proc/createRadioController()
|
||||
radio_controller = new /datum/controller/radio()
|
||||
return 1
|
||||
|
||||
//callback used by objects to react to incoming radio signals
|
||||
/obj/proc/receive_signal(datum/signal/signal, receive_method, receive_param)
|
||||
return null
|
||||
|
||||
//The global radio controller
|
||||
/datum/controller/radio
|
||||
var/list/datum/radio_frequency/frequencies = list()
|
||||
|
||||
/datum/controller/radio/proc/add_object(obj/device as obj, var/new_frequency as num, var/filter = null as text|null)
|
||||
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
|
||||
|
||||
frequency.add_listener(device, filter)
|
||||
return frequency
|
||||
|
||||
/datum/controller/radio/proc/remove_object(obj/device, old_frequency)
|
||||
var/f_text = num2text(old_frequency)
|
||||
var/datum/radio_frequency/frequency = frequencies[f_text]
|
||||
|
||||
if(frequency)
|
||||
frequency.remove_listener(device)
|
||||
|
||||
if(frequency.devices.len == 0)
|
||||
del(frequency)
|
||||
frequencies -= f_text
|
||||
|
||||
return 1
|
||||
|
||||
/datum/controller/radio/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
|
||||
var/list/list/obj/devices = list()
|
||||
|
||||
/datum/radio_frequency/proc/post_signal(obj/source as obj|null, datum/signal/signal, var/filter = null as text|null, var/range = null as num|null)
|
||||
var/turf/start_point
|
||||
if(range)
|
||||
start_point = get_turf(source)
|
||||
if(!start_point)
|
||||
del(signal)
|
||||
return 0
|
||||
if (filter)
|
||||
send_to_filter(source, signal, filter, start_point, range)
|
||||
send_to_filter(source, signal, RADIO_DEFAULT, start_point, range)
|
||||
else
|
||||
//Broadcast the signal to everyone!
|
||||
for (var/next_filter in devices)
|
||||
send_to_filter(source, signal, next_filter, start_point, range)
|
||||
|
||||
//Sends a signal to all machines belonging to a given filter. Should be called by post_signal()
|
||||
/datum/radio_frequency/proc/send_to_filter(obj/source, datum/signal/signal, var/filter, var/turf/start_point = null, var/range = null)
|
||||
if (range && !start_point)
|
||||
return
|
||||
|
||||
for(var/obj/device in devices[filter])
|
||||
if(device == source)
|
||||
continue
|
||||
if(range)
|
||||
var/turf/end_point = get_turf(device)
|
||||
if(!end_point)
|
||||
continue
|
||||
if(start_point.z!=end_point.z || get_dist(start_point, end_point) > range)
|
||||
continue
|
||||
|
||||
//allow sequential signals before round start, so that every air alarm sounding off at once doesn't cause trouble.
|
||||
if(!ticker || ticker.current_state < 3)
|
||||
device.receive_signal(signal, TRANSMISSION_RADIO, frequency)
|
||||
else
|
||||
spawn(0)
|
||||
if(device) //in case the device got destroyed somehow
|
||||
device.receive_signal(signal, TRANSMISSION_RADIO, frequency)
|
||||
|
||||
/datum/radio_frequency/proc/add_listener(obj/device as obj, var/filter as text|null)
|
||||
if (!filter)
|
||||
filter = RADIO_DEFAULT
|
||||
//log_admin("add_listener(device=[device],filter=[filter]) frequency=[frequency]")
|
||||
var/list/obj/devices_line = devices[filter]
|
||||
if (!devices_line)
|
||||
devices_line = new
|
||||
devices[filter] = devices_line
|
||||
devices_line+=device
|
||||
// var/list/obj/devices_line___ = devices[filter_str]
|
||||
// var/l = devices_line___.len
|
||||
//log_admin("DEBUG: devices_line.len=[devices_line.len]")
|
||||
//log_admin("DEBUG: devices(filter_str).len=[l]")
|
||||
|
||||
/datum/radio_frequency/proc/remove_listener(obj/device)
|
||||
for (var/devices_filter in devices)
|
||||
var/list/devices_line = devices[devices_filter]
|
||||
devices_line-=device
|
||||
while (null in devices_line)
|
||||
devices_line -= null
|
||||
if (devices_line.len==0)
|
||||
devices -= devices_filter
|
||||
del(devices_line)
|
||||
|
||||
/datum/signal
|
||||
var/obj/source
|
||||
|
||||
var/transmission_method = 0 //unused at the moment
|
||||
//0 = wire
|
||||
//1 = radio transmission
|
||||
//2 = subspace transmission
|
||||
|
||||
var/data = list()
|
||||
var/encryption
|
||||
|
||||
var/frequency = 0
|
||||
|
||||
/datum/signal/proc/copy_from(datum/signal/model)
|
||||
source = model.source
|
||||
transmission_method = model.transmission_method
|
||||
data = model.data
|
||||
encryption = model.encryption
|
||||
frequency = model.frequency
|
||||
|
||||
/datum/signal/proc/debug_print()
|
||||
if (source)
|
||||
. = "signal = {source = '[source]' ([source:x],[source:y],[source:z])\n"
|
||||
else
|
||||
. = "signal = {source = '[source]' ()\n"
|
||||
for (var/i in data)
|
||||
. += "data\[\"[i]\"\] = \"[data[i]]\"\n"
|
||||
if(islist(data[i]))
|
||||
var/list/L = data[i]
|
||||
for(var/t in L)
|
||||
. += "data\[\"[i]\"\] list has: [t]"
|
||||
@@ -22,7 +22,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
|
||||
var/poweralm = 1
|
||||
var/party = null
|
||||
level = null
|
||||
name = "Space"
|
||||
name = "Unknown"
|
||||
icon = 'icons/turf/areas.dmi'
|
||||
icon_state = "unknown"
|
||||
layer = 10
|
||||
@@ -55,6 +55,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
|
||||
// var/list/lights // list of all lights on this area
|
||||
var/list/all_doors = list() //Added by Strumpetplaya - Alarm Change - Contains a list of doors adjacent to this area
|
||||
var/air_doors_activated = 0
|
||||
var/list/ambience = list('sound/ambience/ambigen1.ogg','sound/ambience/ambigen3.ogg','sound/ambience/ambigen4.ogg','sound/ambience/ambigen5.ogg','sound/ambience/ambigen6.ogg','sound/ambience/ambigen7.ogg','sound/ambience/ambigen8.ogg','sound/ambience/ambigen9.ogg','sound/ambience/ambigen10.ogg','sound/ambience/ambigen11.ogg','sound/ambience/ambigen12.ogg','sound/ambience/ambigen14.ogg')
|
||||
|
||||
/*Adding a wizard area teleport list because motherfucking lag -- Urist*/
|
||||
/*I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game*/
|
||||
@@ -91,9 +92,26 @@ var/list/ghostteleportlocs = list()
|
||||
return 1
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
/area/space
|
||||
name = "\improper Space"
|
||||
requires_power = 1
|
||||
always_unpowered = 1
|
||||
lighting_use_dynamic = 1
|
||||
power_light = 0
|
||||
power_equip = 0
|
||||
power_environ = 0
|
||||
ambience = list('sound/ambience/ambispace.ogg','sound/music/title2.ogg','sound/music/space.ogg','sound/music/main.ogg','sound/music/traitor.ogg')
|
||||
|
||||
/area/space/firealert()
|
||||
return
|
||||
|
||||
/area/space/readyalert()
|
||||
return
|
||||
|
||||
/area/space/partyalert()
|
||||
return
|
||||
/area/engine/
|
||||
|
||||
ambience = list('sound/ambience/ambisin1.ogg','sound/ambience/ambisin2.ogg','sound/ambience/ambisin3.ogg','sound/ambience/ambisin4.ogg')
|
||||
/area/turret_protected/
|
||||
|
||||
/area/arrival
|
||||
@@ -869,6 +887,7 @@ var/list/ghostteleportlocs = list()
|
||||
/area/chapel/main
|
||||
name = "\improper Chapel"
|
||||
icon_state = "chapel"
|
||||
ambience = list('sound/ambience/ambicha1.ogg','sound/ambience/ambicha2.ogg','sound/ambience/ambicha3.ogg','sound/ambience/ambicha4.ogg','sound/music/traitor.ogg')
|
||||
|
||||
/area/chapel/office
|
||||
name = "\improper Chapel Office"
|
||||
@@ -1109,6 +1128,7 @@ var/list/ghostteleportlocs = list()
|
||||
name = "\improper AI Satellite Teleporter Room"
|
||||
icon_state = "teleporter"
|
||||
music = "signal"
|
||||
ambience = list('sound/ambience/ambimalf.ogg')
|
||||
|
||||
//MedBay
|
||||
|
||||
@@ -1195,6 +1215,7 @@ var/list/ghostteleportlocs = list()
|
||||
/area/medical/morgue
|
||||
name = "\improper Morgue"
|
||||
icon_state = "morgue"
|
||||
ambience = list('sound/ambience/ambimo1.ogg','sound/ambience/ambimo2.ogg','sound/music/main.ogg')
|
||||
|
||||
/area/medical/chemistry
|
||||
name = "\improper Chemistry"
|
||||
@@ -1694,10 +1715,12 @@ var/list/ghostteleportlocs = list()
|
||||
/area/turret_protected/ai_upload
|
||||
name = "\improper AI Upload Chamber"
|
||||
icon_state = "ai_upload"
|
||||
ambience = list('sound/ambience/ambimalf.ogg')
|
||||
|
||||
/area/turret_protected/ai_upload_foyer
|
||||
name = "AI Upload Access"
|
||||
icon_state = "ai_foyer"
|
||||
ambience = list('sound/ambience/ambimalf.ogg')
|
||||
|
||||
/area/turret_protected/ai_server_room
|
||||
name = "AI Server Room"
|
||||
@@ -1706,6 +1729,7 @@ var/list/ghostteleportlocs = list()
|
||||
/area/turret_protected/ai
|
||||
name = "\improper AI Chamber"
|
||||
icon_state = "ai_chamber"
|
||||
ambience = list('sound/ambience/ambimalf.ogg')
|
||||
|
||||
/area/turret_protected/ai_cyborg_station
|
||||
name = "\improper Cyborg Station"
|
||||
@@ -1776,6 +1800,8 @@ var/list/ghostteleportlocs = list()
|
||||
|
||||
|
||||
// Telecommunications Satellite
|
||||
/area/tcommsat/
|
||||
ambience = list('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg')
|
||||
|
||||
/area/tcommsat/entrance
|
||||
name = "\improper Telecoms Teleporter"
|
||||
@@ -1788,18 +1814,22 @@ var/list/ghostteleportlocs = list()
|
||||
/area/turret_protected/tcomsat
|
||||
name = "\improper Telecoms Satellite"
|
||||
icon_state = "tcomsatlob"
|
||||
ambience = list('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg')
|
||||
|
||||
/area/turret_protected/tcomfoyer
|
||||
name = "\improper Telecoms Foyer"
|
||||
icon_state = "tcomsatentrance"
|
||||
ambience = list('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg')
|
||||
|
||||
/area/turret_protected/tcomwest
|
||||
name = "\improper Telecommunications Satellite West Wing"
|
||||
icon_state = "tcomsatwest"
|
||||
ambience = list('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg')
|
||||
|
||||
/area/turret_protected/tcomeast
|
||||
name = "\improper Telecommunications Satellite East Wing"
|
||||
icon_state = "tcomsateast"
|
||||
ambience = list('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg')
|
||||
|
||||
/area/tcommsat/computer
|
||||
name = "\improper Telecoms Control Room"
|
||||
|
||||
+10
-44
@@ -16,16 +16,6 @@
|
||||
active_areas += src
|
||||
all_areas += src
|
||||
|
||||
if(type == /area) // override defaults for space. TODO: make space areas of type /area/space rather than /area
|
||||
requires_power = 1
|
||||
always_unpowered = 1
|
||||
lighting_use_dynamic = 1
|
||||
power_light = 0
|
||||
power_equip = 0
|
||||
power_environ = 0
|
||||
// lighting_state = 4
|
||||
//has_gravity = 0 // Space has gravity. Because.. because.
|
||||
|
||||
if(requires_power)
|
||||
luminosity = 0
|
||||
else
|
||||
@@ -71,18 +61,18 @@
|
||||
/area/proc/atmosalert(danger_level)
|
||||
// if(type==/area) //No atmos alarms in space
|
||||
// return 0 //redudant
|
||||
|
||||
|
||||
//Check all the alarms before lowering atmosalm. Raising is perfectly fine.
|
||||
for (var/area/RA in related)
|
||||
for (var/obj/machinery/alarm/AA in RA)
|
||||
if ( !(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted)
|
||||
danger_level = max(danger_level, AA.danger_level)
|
||||
|
||||
|
||||
if(danger_level != atmosalm)
|
||||
if (danger_level < 1 && atmosalm >= 1)
|
||||
//closing the doors on red and opening on green provides a bit of hysteresis that will hopefully prevent fire doors from opening and closing repeatedly due to noise
|
||||
air_doors_open()
|
||||
|
||||
|
||||
if (danger_level < 2 && atmosalm >= 2)
|
||||
for(var/area/RA in related)
|
||||
for(var/obj/machinery/camera/C in RA)
|
||||
@@ -91,7 +81,7 @@
|
||||
aiPlayer.cancelAlarm("Atmosphere", src, src)
|
||||
for(var/obj/machinery/computer/station_alert/a in machines)
|
||||
a.cancelAlarm("Atmosphere", src, src)
|
||||
|
||||
|
||||
if (danger_level >= 2 && atmosalm < 2)
|
||||
var/list/cameras = list()
|
||||
for(var/area/RA in related)
|
||||
@@ -104,12 +94,12 @@
|
||||
for(var/obj/machinery/computer/station_alert/a in machines)
|
||||
a.triggerAlarm("Atmosphere", src, cameras, src)
|
||||
air_doors_close()
|
||||
|
||||
|
||||
atmosalm = danger_level
|
||||
for(var/area/RA in related)
|
||||
for (var/obj/machinery/alarm/AA in RA)
|
||||
AA.update_icon()
|
||||
|
||||
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -183,8 +173,6 @@
|
||||
a.cancelAlarm("Fire", src, src)
|
||||
|
||||
/area/proc/readyalert()
|
||||
if(name == "Space")
|
||||
return
|
||||
if(!eject)
|
||||
eject = 1
|
||||
updateicon()
|
||||
@@ -197,8 +185,6 @@
|
||||
return
|
||||
|
||||
/area/proc/partyalert()
|
||||
if(name == "Space") //no parties in space!!!
|
||||
return
|
||||
if (!( party ))
|
||||
party = 1
|
||||
updateicon()
|
||||
@@ -323,32 +309,12 @@
|
||||
L.client.ambience_playing = 1
|
||||
L << sound('sound/ambience/shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = 2)
|
||||
|
||||
if(prob(35))
|
||||
if(src.ambience.len && prob(35))
|
||||
sound = pick(ambience)
|
||||
|
||||
if(istype(src, /area/chapel))
|
||||
sound = pick('sound/ambience/ambicha1.ogg','sound/ambience/ambicha2.ogg','sound/ambience/ambicha3.ogg','sound/ambience/ambicha4.ogg','sound/music/traitor.ogg')
|
||||
else if(istype(src, /area/medical/morgue))
|
||||
sound = pick('sound/ambience/ambimo1.ogg','sound/ambience/ambimo2.ogg','sound/music/main.ogg')
|
||||
else if(type == /area)
|
||||
sound = pick('sound/ambience/ambispace.ogg','sound/music/title2.ogg','sound/music/space.ogg','sound/music/main.ogg','sound/music/traitor.ogg')
|
||||
else if(istype(src, /area/engine))
|
||||
sound = pick('sound/ambience/ambisin1.ogg','sound/ambience/ambisin2.ogg','sound/ambience/ambisin3.ogg','sound/ambience/ambisin4.ogg')
|
||||
else if(istype(src, /area/AIsattele) || istype(src, /area/turret_protected/ai) || istype(src, /area/turret_protected/ai_upload) || istype(src, /area/turret_protected/ai_upload_foyer))
|
||||
sound = pick('sound/ambience/ambimalf.ogg')
|
||||
else if(istype(src, /area/mine/explored) || istype(src, /area/mine/unexplored))
|
||||
sound = pick('sound/ambience/ambimine.ogg', 'sound/ambience/song_game.ogg')
|
||||
musVolume = 25
|
||||
else if(istype(src, /area/tcommsat) || istype(src, /area/turret_protected/tcomwest) || istype(src, /area/turret_protected/tcomeast) || istype(src, /area/turret_protected/tcomfoyer) || istype(src, /area/turret_protected/tcomsat))
|
||||
sound = pick('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg')
|
||||
else
|
||||
sound = pick('sound/ambience/ambigen1.ogg','sound/ambience/ambigen3.ogg','sound/ambience/ambigen4.ogg','sound/ambience/ambigen5.ogg','sound/ambience/ambigen6.ogg','sound/ambience/ambigen7.ogg','sound/ambience/ambigen8.ogg','sound/ambience/ambigen9.ogg','sound/ambience/ambigen10.ogg','sound/ambience/ambigen11.ogg','sound/ambience/ambigen12.ogg','sound/ambience/ambigen14.ogg')
|
||||
|
||||
if(!L.client.played)
|
||||
if(world.time > L.client.played + 600)
|
||||
L << sound(sound, repeat = 0, wait = 0, volume = musVolume, channel = 1)
|
||||
L.client.played = 1
|
||||
spawn(600) //ewww - this is very very bad
|
||||
if(L.&& L.client)
|
||||
L.client.played = 0
|
||||
L.client.played = world.time
|
||||
|
||||
/area/proc/gravitychange(var/gravitystate = 0, var/area/A)
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ obj/machinery/door/airlock/proc/command_completed(var/command)
|
||||
|
||||
return 1 //Unknown command. Just assume it's completed.
|
||||
|
||||
obj/machinery/door/airlock/proc/send_status()
|
||||
obj/machinery/door/airlock/proc/send_status(var/bumped = 0)
|
||||
if(radio_connection)
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
@@ -97,6 +97,9 @@ obj/machinery/door/airlock/proc/send_status()
|
||||
|
||||
signal.data["door_status"] = density?("closed"):("open")
|
||||
signal.data["lock_status"] = locked?("locked"):("unlocked")
|
||||
|
||||
if (bumped)
|
||||
signal.data["bumped_with_access"] = 1
|
||||
|
||||
radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK)
|
||||
|
||||
@@ -116,17 +119,7 @@ obj/machinery/door/airlock/Bumped(atom/AM)
|
||||
if(istype(AM, /obj/mecha))
|
||||
var/obj/mecha/mecha = AM
|
||||
if(density && radio_connection && mecha.occupant && (src.allowed(mecha.occupant) || src.check_access_list(mecha.operation_req_access)))
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.data["tag"] = id_tag
|
||||
signal.data["timestamp"] = world.time
|
||||
|
||||
signal.data["door_status"] = density?("closed"):("open")
|
||||
signal.data["lock_status"] = locked?("locked"):("unlocked")
|
||||
|
||||
signal.data["bumped_with_access"] = 1
|
||||
|
||||
radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK)
|
||||
send_status(1)
|
||||
return
|
||||
|
||||
obj/machinery/door/airlock/proc/set_frequency(new_frequency)
|
||||
@@ -252,6 +245,12 @@ obj/machinery/access_button/update_icon()
|
||||
else
|
||||
icon_state = "access_button_off"
|
||||
|
||||
obj/machinery/access_button/attackby(obj/item/I as obj, mob/user as mob)
|
||||
//Swiping ID on the access button
|
||||
if (istype(I, /obj/item/weapon/card/id) || istype(I, /obj/item/device/pda))
|
||||
attack_hand(user)
|
||||
return
|
||||
..()
|
||||
|
||||
obj/machinery/access_button/attack_hand(mob/user)
|
||||
add_fingerprint(usr)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//base type for controllers of two-door systems
|
||||
/obj/machinery/embedded_controller/radio/airlock
|
||||
// Setup parameters only
|
||||
radio_filter = RADIO_AIRLOCK
|
||||
var/tag_exterior_door
|
||||
var/tag_interior_door
|
||||
var/tag_airpump
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
//Handles the control of airlocks
|
||||
|
||||
#define STATE_WAIT 0
|
||||
#define STATE_DEPRESSURIZE 1
|
||||
#define STATE_PRESSURIZE 2
|
||||
#define STATE_IDLE 0
|
||||
#define STATE_PREPARE 1
|
||||
#define STATE_DEPRESSURIZE 2
|
||||
#define STATE_PRESSURIZE 3
|
||||
|
||||
#define TARGET_NONE 0
|
||||
#define TARGET_INOPEN -1
|
||||
@@ -18,7 +19,7 @@
|
||||
var/tag_interior_sensor
|
||||
var/tag_mech_sensor
|
||||
|
||||
var/state = STATE_WAIT
|
||||
var/state = STATE_IDLE
|
||||
var/target_state = TARGET_NONE
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/New(var/obj/machinery/embedded_controller/M)
|
||||
@@ -157,7 +158,7 @@
|
||||
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/process()
|
||||
if(!state)
|
||||
if(!state) //Idle
|
||||
if(target_state)
|
||||
switch(target_state)
|
||||
if(TARGET_INOPEN)
|
||||
@@ -168,38 +169,45 @@
|
||||
//lock down the airlock before activating pumps
|
||||
close_doors()
|
||||
|
||||
var/chamber_pressure = memory["chamber_sensor_pressure"]
|
||||
var/target_pressure = memory["target_pressure"]
|
||||
|
||||
if(memory["purge"])
|
||||
target_pressure = 0
|
||||
|
||||
if(chamber_pressure <= target_pressure)
|
||||
state = STATE_PRESSURIZE
|
||||
signalPump(tag_airpump, 1, 1, target_pressure) //send a signal to start pressurizing
|
||||
|
||||
else if(chamber_pressure > target_pressure)
|
||||
state = STATE_DEPRESSURIZE
|
||||
signalPump(tag_airpump, 1, 0, target_pressure) //send a signal to start depressurizing
|
||||
|
||||
//Check for vacuum - this is set after the pumps so the pumps are aiming for 0
|
||||
if(!memory["target_pressure"])
|
||||
memory["target_pressure"] = ONE_ATMOSPHERE * 0.05
|
||||
state = STATE_PREPARE
|
||||
else
|
||||
//make sure to return to a sane idle state
|
||||
if(memory["pump_status"] != "off") //send a signal to stop pumping
|
||||
signalPump(tag_airpump, 0)
|
||||
|
||||
//the airlock will not allow itself to continue to cycle when any of the doors are forced open.
|
||||
if (state && !check_doors_secured())
|
||||
if ((state == STATE_PRESSURIZE || state == STATE_DEPRESSURIZE) && !check_doors_secured())
|
||||
//the airlock will not allow itself to continue to cycle when any of the doors are forced open.
|
||||
stop_cycling()
|
||||
|
||||
switch(state)
|
||||
if(STATE_PREPARE)
|
||||
if (check_doors_secured())
|
||||
var/chamber_pressure = memory["chamber_sensor_pressure"]
|
||||
var/target_pressure = memory["target_pressure"]
|
||||
|
||||
if(memory["purge"])
|
||||
target_pressure = 0
|
||||
|
||||
if(memory["purge"])
|
||||
target_pressure = 0
|
||||
|
||||
if(chamber_pressure <= target_pressure)
|
||||
state = STATE_PRESSURIZE
|
||||
signalPump(tag_airpump, 1, 1, target_pressure) //send a signal to start pressurizing
|
||||
|
||||
else if(chamber_pressure > target_pressure)
|
||||
state = STATE_DEPRESSURIZE
|
||||
signalPump(tag_airpump, 1, 0, target_pressure) //send a signal to start depressurizing
|
||||
|
||||
//Check for vacuum - this is set after the pumps so the pumps are aiming for 0
|
||||
if(!memory["target_pressure"])
|
||||
memory["target_pressure"] = ONE_ATMOSPHERE * 0.05
|
||||
|
||||
if(STATE_PRESSURIZE)
|
||||
if(memory["chamber_sensor_pressure"] >= memory["target_pressure"] * 0.95)
|
||||
cycleDoors(target_state)
|
||||
|
||||
state = STATE_WAIT
|
||||
state = STATE_IDLE
|
||||
target_state = TARGET_NONE
|
||||
|
||||
if(memory["pump_status"] != "off")
|
||||
@@ -216,7 +224,7 @@
|
||||
else if(memory["chamber_sensor_pressure"] <= memory["target_pressure"] * 1.05)
|
||||
cycleDoors(target_state)
|
||||
|
||||
state = STATE_WAIT
|
||||
state = STATE_IDLE
|
||||
target_state = TARGET_NONE
|
||||
|
||||
//send a signal to stop pumping
|
||||
@@ -231,11 +239,11 @@
|
||||
//these are here so that other types don't have to make so many assuptions about our implementation
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/begin_cycle_in()
|
||||
state = STATE_WAIT
|
||||
state = STATE_IDLE
|
||||
target_state = TARGET_INOPEN
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/begin_cycle_out()
|
||||
state = STATE_WAIT
|
||||
state = STATE_IDLE
|
||||
target_state = TARGET_OUTOPEN
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/close_doors()
|
||||
@@ -243,11 +251,11 @@
|
||||
toggleDoor(memory["exterior_status"], tag_exterior_door, 1, "close")
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/stop_cycling()
|
||||
state = STATE_WAIT
|
||||
state = STATE_IDLE
|
||||
target_state = TARGET_NONE
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/done_cycling()
|
||||
return (state == STATE_WAIT && target_state == TARGET_NONE)
|
||||
return (state == STATE_IDLE && target_state == TARGET_NONE)
|
||||
|
||||
//are the doors closed and locked?
|
||||
/datum/computer/file/embedded_program/airlock/proc/check_exterior_door_secured()
|
||||
@@ -265,7 +273,7 @@
|
||||
var/datum/signal/signal = new
|
||||
signal.data["tag"] = tag
|
||||
signal.data["command"] = command
|
||||
post_signal(signal)
|
||||
post_signal(signal, RADIO_AIRLOCK)
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/signalPump(var/tag, var/power, var/direction, var/pressure)
|
||||
var/datum/signal/signal = new
|
||||
@@ -355,7 +363,7 @@ send an additional command to open the door again.
|
||||
signalDoor(doorTag, doorCommand)
|
||||
|
||||
|
||||
#undef STATE_WAIT
|
||||
#undef STATE_IDLE
|
||||
#undef STATE_DEPRESSURIZE
|
||||
#undef STATE_PRESSURIZE
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
//var/radio_power_use = 50 //power used to xmit signals
|
||||
|
||||
var/frequency = 1379
|
||||
var/radio_filter = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
unacidable = 1
|
||||
|
||||
@@ -64,15 +65,15 @@
|
||||
else
|
||||
icon_state = "airlock_control_off"
|
||||
|
||||
/obj/machinery/embedded_controller/radio/post_signal(datum/signal/signal)
|
||||
/obj/machinery/embedded_controller/radio/post_signal(datum/signal/signal, var/filter = null)
|
||||
signal.transmission_method = TRANSMISSION_RADIO
|
||||
if(radio_connection)
|
||||
//use_power(radio_power_use) //neat idea, but causes way too much lag.
|
||||
return radio_connection.post_signal(src, signal)
|
||||
return radio_connection.post_signal(src, signal, filter)
|
||||
else
|
||||
del(signal)
|
||||
|
||||
/obj/machinery/embedded_controller/radio/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency, radio_filter)
|
||||
@@ -76,17 +76,6 @@
|
||||
set category = "Debug"
|
||||
set name = "Radio report"
|
||||
|
||||
var/filters = list(
|
||||
"1" = "RADIO_TO_AIRALARM",
|
||||
"2" = "RADIO_FROM_AIRALARM",
|
||||
"3" = "RADIO_CHAT",
|
||||
"4" = "RADIO_ATMOSIA",
|
||||
"5" = "RADIO_NAVBEACONS",
|
||||
"6" = "RADIO_AIRLOCK",
|
||||
"7" = "RADIO_SECBOT",
|
||||
"8" = "RADIO_MULEBOT",
|
||||
"_default" = "NO_FILTER"
|
||||
)
|
||||
var/output = "<b>Radio Report</b><hr>"
|
||||
for (var/fq in radio_controller.frequencies)
|
||||
output += "<b>Freq: [fq]</b><br>"
|
||||
@@ -97,9 +86,9 @@
|
||||
for (var/filter in fqs.devices)
|
||||
var/list/f = fqs.devices[filter]
|
||||
if (!f)
|
||||
output += " [filters[filter]]: ERROR<br>"
|
||||
output += " [filter]: ERROR<br>"
|
||||
continue
|
||||
output += " [filters[filter]]: [f.len]<br>"
|
||||
output += " [filter]: [f.len]<br>"
|
||||
for (var/device in f)
|
||||
if (isobj(device))
|
||||
output += " [device] ([device:x],[device:y],[device:z] in area [get_area(device:loc)])<br>"
|
||||
|
||||
@@ -7,10 +7,12 @@
|
||||
/area/mine/explored
|
||||
name = "Mine"
|
||||
icon_state = "explored"
|
||||
ambience = list('sound/ambience/ambimine.ogg', 'sound/ambience/song_game.ogg')
|
||||
|
||||
/area/mine/unexplored
|
||||
name = "Mine"
|
||||
icon_state = "unexplored"
|
||||
ambience = list('sound/ambience/ambimine.ogg', 'sound/ambience/song_game.ogg')
|
||||
|
||||
/area/mine/lobby
|
||||
name = "Mining station"
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#define COLD_GAS_DAMAGE_LEVEL_2 1.5 //Amount of damage applied when the current breath's temperature passes the 200K point
|
||||
#define COLD_GAS_DAMAGE_LEVEL_3 3 //Amount of damage applied when the current breath's temperature passes the 120K point
|
||||
|
||||
#define RADIATION_SPEED_COEFFICIENT 0.1
|
||||
|
||||
/mob/living/carbon/human
|
||||
var/oxygen_alert = 0
|
||||
var/phoron_alert = 0
|
||||
@@ -258,63 +260,54 @@
|
||||
speech_problem_flag = 1
|
||||
gene.OnMobLife(src)
|
||||
|
||||
radiation = Clamp(radiation,0,100)
|
||||
|
||||
if (radiation)
|
||||
if (radiation > 100)
|
||||
radiation = 100
|
||||
if(!(species.flags & RAD_ABSORB))
|
||||
Weaken(10)
|
||||
if(species.flags & RAD_ABSORB)
|
||||
var/rads = radiation/25
|
||||
radiation -= rads
|
||||
nutrition += rads
|
||||
adjustBruteLoss(-(rads))
|
||||
adjustOxyLoss(-(rads))
|
||||
adjustToxLoss(-(rads))
|
||||
updatehealth()
|
||||
return
|
||||
|
||||
var/damage = 0
|
||||
radiation -= 1 * RADIATION_SPEED_COEFFICIENT
|
||||
if(prob(25))
|
||||
damage = 1
|
||||
|
||||
if (radiation > 50)
|
||||
damage = 1
|
||||
radiation -= 1 * RADIATION_SPEED_COEFFICIENT
|
||||
if(prob(5) && prob(100 * RADIATION_SPEED_COEFFICIENT))
|
||||
radiation -= 5 * RADIATION_SPEED_COEFFICIENT
|
||||
src << "<span class='warning'>You feel weak.</span>"
|
||||
Weaken(3)
|
||||
if(!lying)
|
||||
src << "\red You feel weak."
|
||||
emote("collapse")
|
||||
if(prob(5) && prob(100 * RADIATION_SPEED_COEFFICIENT) && species.name == "Human") //apes go bald
|
||||
if((h_style != "Bald" || f_style != "Shaved" ))
|
||||
src << "<span class='warning'>Your hair falls out.</span>"
|
||||
h_style = "Bald"
|
||||
f_style = "Shaved"
|
||||
update_hair()
|
||||
|
||||
if (radiation < 0)
|
||||
radiation = 0
|
||||
if (radiation > 75)
|
||||
radiation -= 1 * RADIATION_SPEED_COEFFICIENT
|
||||
damage = 3
|
||||
if(prob(5))
|
||||
take_overall_damage(0, 5 * RADIATION_SPEED_COEFFICIENT, used_weapon = "Radiation Burns")
|
||||
if(prob(1))
|
||||
src << "<span class='warning'>You feel strange!</span>"
|
||||
adjustCloneLoss(5 * RADIATION_SPEED_COEFFICIENT)
|
||||
emote("gasp")
|
||||
|
||||
else
|
||||
|
||||
if(species.flags & RAD_ABSORB)
|
||||
var/rads = radiation/25
|
||||
radiation -= rads
|
||||
nutrition += rads
|
||||
adjustBruteLoss(-(rads))
|
||||
adjustOxyLoss(-(rads))
|
||||
adjustToxLoss(-(rads))
|
||||
updatehealth()
|
||||
return
|
||||
|
||||
var/damage = 0
|
||||
switch(radiation)
|
||||
if(1 to 49)
|
||||
radiation--
|
||||
if(prob(25))
|
||||
adjustToxLoss(1)
|
||||
damage = 1
|
||||
updatehealth()
|
||||
|
||||
if(50 to 74)
|
||||
radiation -= 2
|
||||
damage = 1
|
||||
adjustToxLoss(1)
|
||||
if(prob(5))
|
||||
radiation -= 5
|
||||
Weaken(3)
|
||||
if(!lying)
|
||||
src << "\red You feel weak."
|
||||
emote("collapse")
|
||||
updatehealth()
|
||||
|
||||
if(75 to 100)
|
||||
radiation -= 3
|
||||
adjustToxLoss(3)
|
||||
damage = 1
|
||||
if(prob(1))
|
||||
src << "\red You mutate!"
|
||||
randmutb(src)
|
||||
domutcheck(src,null)
|
||||
emote("gasp")
|
||||
updatehealth()
|
||||
|
||||
if(damage && organs.len)
|
||||
if(damage)
|
||||
adjustToxLoss(damage * RADIATION_SPEED_COEFFICIENT)
|
||||
updatehealth()
|
||||
if(organs.len)
|
||||
var/datum/organ/external/O = pick(organs)
|
||||
if(istype(O)) O.add_autopsy_data("Radiation Poisoning", damage)
|
||||
|
||||
|
||||
@@ -972,7 +972,7 @@ mob/proc/yank_out_object()
|
||||
affected.take_damage((selection.w_class * 3), 0, 0, 1, "Embedded object extraction")
|
||||
|
||||
if(prob(selection.w_class * 5)) //I'M SO ANEMIC I COULD JUST -DIE-.
|
||||
var/datum/wound/internal_bleeding/I = new (15)
|
||||
var/datum/wound/internal_bleeding/I = new (min(selection.w_class * 5, 15))
|
||||
affected.wounds += I
|
||||
H.custom_pain("Something tears wetly in your [affected] as [selection] is pulled free!", 1)
|
||||
|
||||
|
||||
@@ -127,12 +127,12 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
if(!(temp.status & ORGAN_BLEEDING) || temp.status & ORGAN_ROBOT)
|
||||
continue
|
||||
for(var/datum/wound/W in temp.wounds) if(W.bleeding())
|
||||
blood_max += W.damage / 4
|
||||
blood_max += W.damage / 40
|
||||
if (temp.open)
|
||||
blood_max += 2 //Yer stomach is cut open
|
||||
drip(blood_max)
|
||||
|
||||
//Makes a blood drop, leaking certain amount of blood from the mob
|
||||
//Makes a blood drop, leaking amt units of blood from the mob
|
||||
/mob/living/carbon/human/proc/drip(var/amt as num)
|
||||
|
||||
if(species && species.flags & NO_BLOOD) //TODO: Make drips come from the reagents instead.
|
||||
@@ -141,12 +141,11 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
if(!amt)
|
||||
return
|
||||
|
||||
var/amm = 0.1 * amt
|
||||
var/turf/T = get_turf(src)
|
||||
var/list/obj/effect/decal/cleanable/blood/drip/nums = list()
|
||||
var/list/iconL = list("1","2","3","4","5")
|
||||
|
||||
vessel.remove_reagent("blood",amm)
|
||||
vessel.remove_reagent("blood",amt)
|
||||
|
||||
for(var/obj/effect/decal/cleanable/blood/drip/G in T)
|
||||
nums += G
|
||||
|
||||
@@ -223,11 +223,11 @@ This function completely restores a damaged organ to perfect condition.
|
||||
/datum/organ/external/proc/createwound(var/type = CUT, var/damage)
|
||||
if(damage == 0) return
|
||||
|
||||
//moved this before the open_wound check so that having many small wounds for example doesn't somehow protect you from taking internal damage
|
||||
//moved this before the open_wound check so that having many small wounds for example doesn't somehow protect you from taking internal damage (because of the return)
|
||||
//Possibly trigger an internal wound, too.
|
||||
var/local_damage = brute_dam + burn_dam + damage
|
||||
if(damage > 15 && type != BURN && local_damage > 30 && prob(damage) && !(status & ORGAN_ROBOT))
|
||||
var/datum/wound/internal_bleeding/I = new (15)
|
||||
var/datum/wound/internal_bleeding/I = new (min(damage - 15, 15))
|
||||
wounds += I
|
||||
owner.custom_pain("You feel something rip in your [display_name]!", 1)
|
||||
|
||||
@@ -463,16 +463,15 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
// let the GC handle the deletion of the wound
|
||||
|
||||
// Internal wounds get worse over time. Low temperatures (cryo) stop them.
|
||||
if(W.internal && !W.can_autoheal() && owner.bodytemperature >= 170)
|
||||
if(W.internal && owner.bodytemperature >= 170)
|
||||
var/bicardose = owner.reagents.get_reagent_amount("bicaridine")
|
||||
var/inaprovaline = owner.reagents.get_reagent_amount("inaprovaline")
|
||||
if(!bicardose || !inaprovaline) //bicaridine and inaprovaline stop internal wounds from growing bigger with time, and also stop bleeding
|
||||
if(!(W.can_autoheal() || (bicardose && inaprovaline))) //bicaridine and inaprovaline stop internal wounds from growing bigger with time, unless it is so small that it is already healing
|
||||
W.open_wound(0.1 * wound_update_accuracy)
|
||||
owner.vessel.remove_reagent("blood",0.05 * W.damage * wound_update_accuracy)
|
||||
if(bicardose >= 30) //overdose of bicaridine begins healing IB
|
||||
W.damage = max(0, W.damage - 0.2)
|
||||
|
||||
owner.vessel.remove_reagent("blood",0.02 * W.damage * wound_update_accuracy)
|
||||
owner.vessel.remove_reagent("blood", wound_update_accuracy * W.damage/40) //line should possibly be moved to handle_blood, so all the bleeding stuff is in one place.
|
||||
if(prob(1 * wound_update_accuracy))
|
||||
owner.custom_pain("You feel a stabbing pain in your [display_name]!",1)
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ datum/wound/cut/massive
|
||||
|
||||
/datum/wound/internal_bleeding
|
||||
internal = 1
|
||||
stages = list("severed vein" = 30, "cut vein" = 20, "damaged vein" = 10, "bruised vein" = 5)
|
||||
stages = list("severed artery" = 30, "cut artery" = 20, "damaged artery" = 10, "bruised artery" = 5)
|
||||
autoheal_cutoff = 5
|
||||
max_bleeding_stage = 0 //all stages bleed. It's called internal bleeding after all.
|
||||
|
||||
|
||||
@@ -16,12 +16,13 @@
|
||||
clumsy_check = 0
|
||||
|
||||
obj/item/weapon/gun/energy/laser/retro
|
||||
name ="retro laser"
|
||||
name = "retro laser"
|
||||
icon_state = "retro"
|
||||
desc = "An older model of the basic lasergun, no longer used by Nanotrasen's security or military forces. Nevertheless, it is still quite deadly and easy to maintain, making it a favorite amongst pirates and other outlaws."
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/captain
|
||||
name = "antique laser gun"
|
||||
icon_state = "caplaser"
|
||||
desc = "This is an antique laser gun. All craftsmanship is of the highest quality. It is decorated with assistant leather and chrome. The object menaces with spikes of energy. On the item is an image of Space Station 13. The station is exploding."
|
||||
force = 10
|
||||
|
||||
@@ -93,7 +93,7 @@ var/list/beam_master = list()
|
||||
/obj/item/projectile/beam/heavylaser
|
||||
name = "heavy laser"
|
||||
icon_state = "heavylaser"
|
||||
damage = 40
|
||||
damage = 60
|
||||
|
||||
/obj/item/projectile/beam/xray
|
||||
name = "xray beam"
|
||||
@@ -106,11 +106,6 @@ var/list/beam_master = list()
|
||||
damage = 50
|
||||
|
||||
|
||||
/obj/item/projectile/beam/deathlaser
|
||||
name = "death laser"
|
||||
icon_state = "heavylaser"
|
||||
damage = 60
|
||||
|
||||
/obj/item/projectile/beam/emitter
|
||||
name = "emitter beam"
|
||||
icon_state = "emitter"
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
"\blue You put \the [tool] inside [target]'s [get_cavity(affected)] cavity." )
|
||||
if (tool.w_class > get_max_wclass(affected)/2 && prob(50))
|
||||
user << "\red You tear some blood vessels trying to fit such a big object in this cavity."
|
||||
var/datum/wound/internal_bleeding/I = new (15)
|
||||
var/datum/wound/internal_bleeding/I = new (10)
|
||||
affected.wounds += I
|
||||
affected.owner.custom_pain("You feel something rip in your [affected.display_name]!", 1)
|
||||
user.drop_item()
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/world
|
||||
mob = /mob/new_player
|
||||
turf = /turf/space
|
||||
area = /area
|
||||
area = /area/space
|
||||
view = "15x15"
|
||||
cache_lifespan = 0 //stops player uploaded stuff from being kept in the rsc past the current session
|
||||
|
||||
|
||||
+1035
-1035
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user