mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 14:39:58 +01:00
* limit atmos/fire alerts to the current z_level
* atmos/fire alerts are now linked to an object and not its area, as intended * simplified and full pathed the radio frequency datum * made radio objects properly clean on del/qdel, instead of letting the radio controller remove nulls at each post_signal()
This commit is contained in:
@@ -25,6 +25,11 @@
|
||||
//2: Do not pass input_pressure_min
|
||||
//4: Do not pass output_pressure_max
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/high_volume
|
||||
name = "large dual-port air vent"
|
||||
|
||||
|
||||
@@ -22,6 +22,11 @@ Passive gate is similar to the regular pump except:
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/update_icon_nopipes()
|
||||
overlays.Cut()
|
||||
if(on & !(stat & NOPOWER))
|
||||
|
||||
@@ -26,6 +26,11 @@ Thus, the two variables affect pump operation are set in New():
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/on
|
||||
on = 1
|
||||
|
||||
|
||||
@@ -26,6 +26,11 @@ Thus, the two variables affect pump operation are set in New():
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/on
|
||||
on = 1
|
||||
|
||||
|
||||
@@ -42,6 +42,11 @@ Filter types:
|
||||
if(radio_controller)
|
||||
initialize()
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/update_icon_nopipes()
|
||||
if(!(stat & NOPOWER) && on && node1 && node2 && node3)
|
||||
icon_state = "filter_on[flipped?"_f":""]"
|
||||
|
||||
@@ -16,6 +16,11 @@
|
||||
|
||||
level = 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/on
|
||||
on = 1
|
||||
|
||||
|
||||
@@ -55,6 +55,11 @@
|
||||
src.initialize()
|
||||
src.broadcast_status()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/high_volume
|
||||
name = "large air vent"
|
||||
power_channel = EQUIP
|
||||
|
||||
@@ -40,6 +40,11 @@
|
||||
src.initialize()
|
||||
src.broadcast_status()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/update_icon_nopipes()
|
||||
overlays.Cut()
|
||||
if(showpipe)
|
||||
|
||||
@@ -83,3 +83,9 @@
|
||||
overlays += getpipeimage('icons/obj/atmospherics/binary_devices.dmi', "dvalve_[open][!open]")
|
||||
else if(open)
|
||||
overlays += getpipeimage('icons/obj/atmospherics/binary_devices.dmi', "dvalve_on")
|
||||
|
||||
//Radio remote control
|
||||
/obj/machinery/atmospherics/binary/valve/digital/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
..()
|
||||
@@ -46,7 +46,7 @@ var/const/AALARM_WIRE_AALARM = 16
|
||||
//world << "Syphon Wire Cut"
|
||||
|
||||
if(AALARM_WIRE_AALARM)
|
||||
if (A.alarm_area.atmosalert(2))
|
||||
if (A.alarm_area.atmosalert(2,holder))
|
||||
A.post_alert(2)
|
||||
A.update_icon()
|
||||
|
||||
@@ -88,6 +88,6 @@ var/const/AALARM_WIRE_AALARM = 16
|
||||
|
||||
if(AALARM_WIRE_AALARM)
|
||||
// world << "Aalarm wire pulsed"
|
||||
if (A.alarm_area.atmosalert(0))
|
||||
if (A.alarm_area.atmosalert(0,holder))
|
||||
A.post_alert(0)
|
||||
A.update_icon()
|
||||
|
||||
+38
-42
@@ -57,55 +57,52 @@
|
||||
for (var/obj/machinery/camera/C in src)
|
||||
cameras += C
|
||||
for (var/mob/living/silicon/aiPlayer in player_list)
|
||||
if(aiPlayer.z == source.z)
|
||||
if (state == 1)
|
||||
aiPlayer.cancelAlarm("Power", src, source)
|
||||
else
|
||||
aiPlayer.triggerAlarm("Power", src, cameras, source)
|
||||
if (state == 1)
|
||||
aiPlayer.cancelAlarm("Power", src, source)
|
||||
else
|
||||
aiPlayer.triggerAlarm("Power", src, cameras, source)
|
||||
|
||||
for(var/obj/machinery/computer/station_alert/a in machines)
|
||||
if(a.z == source.z)
|
||||
if(state == 1)
|
||||
a.cancelAlarm("Power", src, source)
|
||||
else
|
||||
a.triggerAlarm("Power", src, cameras, source)
|
||||
if(state == 1)
|
||||
a.cancelAlarm("Power", src, source)
|
||||
else
|
||||
a.triggerAlarm("Power", src, cameras, source)
|
||||
|
||||
for(var/mob/living/simple_animal/drone/D in mob_list)
|
||||
if(D.z == source.z)
|
||||
if(state == 1)
|
||||
D.cancelAlarm("Power", src, source)
|
||||
else
|
||||
D.triggerAlarm("Power", src, cameras, source)
|
||||
if(state == 1)
|
||||
D.cancelAlarm("Power", src, source)
|
||||
else
|
||||
D.triggerAlarm("Power", src, cameras, source)
|
||||
return
|
||||
|
||||
/area/proc/atmosalert(danger_level)
|
||||
// if(src.type==/area) //No atmos alarms in space
|
||||
// return 0 //redudant
|
||||
if(danger_level != src.atmosalm)
|
||||
//src.updateicon()
|
||||
//src.mouse_opacity = 0
|
||||
/area/proc/atmosalert(var/danger_level, var/obj/source as obj)
|
||||
if(danger_level != atmosalm)
|
||||
if (danger_level==2)
|
||||
var/list/cameras = list()
|
||||
for(var/area/RA in src.related)
|
||||
//src.updateicon()
|
||||
for(var/area/RA in related)
|
||||
for(var/obj/machinery/camera/C in RA)
|
||||
cameras += C
|
||||
|
||||
for(var/mob/living/silicon/aiPlayer in player_list)
|
||||
aiPlayer.triggerAlarm("Atmosphere", src, cameras, src)
|
||||
aiPlayer.triggerAlarm("Atmosphere", src, cameras, source)
|
||||
for(var/obj/machinery/computer/station_alert/a in machines)
|
||||
a.triggerAlarm("Atmosphere", src, cameras, src)
|
||||
a.triggerAlarm("Atmosphere", src, cameras, source)
|
||||
for(var/mob/living/simple_animal/drone/D in mob_list)
|
||||
D.triggerAlarm("Atmosphere", src, cameras, src)
|
||||
D.triggerAlarm("Atmosphere", src, cameras, source)
|
||||
|
||||
else if (src.atmosalm == 2)
|
||||
for(var/mob/living/silicon/aiPlayer in player_list)
|
||||
aiPlayer.cancelAlarm("Atmosphere", src, src)
|
||||
aiPlayer.cancelAlarm("Atmosphere", src, source)
|
||||
for(var/obj/machinery/computer/station_alert/a in machines)
|
||||
a.cancelAlarm("Atmosphere", src, src)
|
||||
a.cancelAlarm("Atmosphere", src, source)
|
||||
for(var/mob/living/simple_animal/drone/D in mob_list)
|
||||
D.cancelAlarm("Atmosphere", src, src)
|
||||
D.cancelAlarm("Atmosphere", src, source)
|
||||
|
||||
src.atmosalm = danger_level
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/area/proc/firealert()
|
||||
/area/proc/firealert(var/obj/source as obj)
|
||||
if(always_unpowered == 1) //no fire alarms in space/asteroid
|
||||
return
|
||||
|
||||
@@ -127,14 +124,14 @@
|
||||
cameras += C
|
||||
|
||||
for (var/obj/machinery/computer/station_alert/a in machines)
|
||||
a.triggerAlarm("Fire", src, cameras, src)
|
||||
a.triggerAlarm("Fire", src, cameras, source)
|
||||
for (var/mob/living/silicon/aiPlayer in player_list)
|
||||
aiPlayer.triggerAlarm("Fire", src, cameras, src)
|
||||
aiPlayer.triggerAlarm("Fire", src, cameras, source)
|
||||
for (var/mob/living/simple_animal/drone/D in mob_list)
|
||||
D.triggerAlarm("Fire", src, cameras, src)
|
||||
D.triggerAlarm("Fire", src, cameras, source)
|
||||
return
|
||||
|
||||
/area/proc/firereset()
|
||||
/area/proc/firereset(var/obj/source as obj)
|
||||
for(var/area/RA in related)
|
||||
if (RA.fire)
|
||||
RA.fire = 0
|
||||
@@ -151,11 +148,11 @@
|
||||
F.update_icon()
|
||||
|
||||
for (var/mob/living/silicon/aiPlayer in player_list)
|
||||
aiPlayer.cancelAlarm("Fire", src, src)
|
||||
aiPlayer.cancelAlarm("Fire", src, source)
|
||||
for (var/obj/machinery/computer/station_alert/a in machines)
|
||||
a.cancelAlarm("Fire", src, src)
|
||||
a.cancelAlarm("Fire", src, source)
|
||||
for (var/mob/living/simple_animal/drone/D in mob_list)
|
||||
D.cancelAlarm("Fire", src, src)
|
||||
D.cancelAlarm("Fire", src, source)
|
||||
return
|
||||
|
||||
/area/proc/burglaralert(var/obj/trigger)
|
||||
@@ -178,11 +175,10 @@
|
||||
cameras += C
|
||||
|
||||
for (var/mob/living/silicon/SILICON in player_list)
|
||||
SILICON.triggerAlarm("Burglar", src, cameras, trigger)
|
||||
//Cancel silicon alert after 1 minute
|
||||
spawn(600)
|
||||
for (var/mob/living/silicon/SILICON in player_list)
|
||||
SILICON.cancelAlarm("Burglar", src, trigger)
|
||||
if(SILICON.triggerAlarm("Burglar", src, cameras, trigger))
|
||||
//Cancel silicon alert after 1 minute
|
||||
spawn(600)
|
||||
SILICON.cancelAlarm("Burglar", src, trigger)
|
||||
|
||||
/area/proc/set_fire_alarm_effect()
|
||||
fire = 1
|
||||
|
||||
+73
-103
@@ -64,13 +64,14 @@
|
||||
so i made radios not use the radio controller.
|
||||
*/
|
||||
var/list/all_radios = list()
|
||||
|
||||
/proc/add_radio(var/obj/item/radio, freq)
|
||||
if(!freq || !radio)
|
||||
return
|
||||
if(!all_radios["[freq]"])
|
||||
all_radios["[freq]"] = list(radio)
|
||||
return freq
|
||||
|
||||
|
||||
all_radios["[freq]"] |= radio
|
||||
return freq
|
||||
|
||||
@@ -185,127 +186,96 @@ var/global/datum/controller/radio/radio_controller
|
||||
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]
|
||||
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
|
||||
if(!frequency)
|
||||
frequency = new
|
||||
frequency.frequency = new_frequency
|
||||
frequencies[f_text] = frequency
|
||||
|
||||
frequency.add_listener(device, filter)
|
||||
return 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]
|
||||
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)
|
||||
frequency.remove_listener(device)
|
||||
|
||||
if(frequency.devices.len == 0)
|
||||
del(frequency)
|
||||
frequencies -= f_text
|
||||
if(frequency.devices.len == 0)
|
||||
frequencies -= f_text
|
||||
del(frequency)
|
||||
|
||||
return 1
|
||||
return 1
|
||||
|
||||
proc/return_frequency(var/new_frequency as num)
|
||||
var/f_text = num2text(new_frequency)
|
||||
var/datum/radio_frequency/frequency = frequencies[f_text]
|
||||
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
|
||||
if(!frequency)
|
||||
frequency = new
|
||||
frequency.frequency = new_frequency
|
||||
frequencies[f_text] = frequency
|
||||
|
||||
return 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 > 0, only post to devices on the same z_level and within range
|
||||
//Use range = -1, to restrain to the same z_level without limiting range
|
||||
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)
|
||||
|
||||
//Apply filter to the signal. If none supply, broadcast to every devices
|
||||
//_default channel is always checked
|
||||
var/list/filter_list
|
||||
|
||||
if(filter)
|
||||
filter_list = list(filter,"_default")
|
||||
else
|
||||
filter_list = devices
|
||||
|
||||
//If checking range, find the source turf
|
||||
var/turf/start_point
|
||||
if(range)
|
||||
start_point = get_turf(source)
|
||||
if(!start_point)
|
||||
return 0
|
||||
|
||||
//Send the data
|
||||
for(var/current_filter in filter_list)
|
||||
for(var/obj/device in devices[current_filter])
|
||||
if(device == source)
|
||||
continue
|
||||
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++
|
||||
var/turf/end_point = get_turf(device)
|
||||
if(!end_point)
|
||||
continue
|
||||
if(start_point.z != end_point.z || (range > 0 && get_dist(start_point, end_point) > range))
|
||||
continue
|
||||
device.receive_signal(signal, TRANSMISSION_RADIO, frequency)
|
||||
|
||||
// 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]")
|
||||
datum/radio_frequency/proc/add_listener(obj/device as obj, var/filter as text|null)
|
||||
if (!filter)
|
||||
filter = "_default"
|
||||
|
||||
if(!devices[filter])
|
||||
devices[filter] = list()
|
||||
devices[filter] += device
|
||||
|
||||
|
||||
// del(signal)
|
||||
datum/radio_frequency/proc/remove_listener(obj/device)
|
||||
for(var/devices_filter in devices)
|
||||
var/list/devices_line = devices[devices_filter]
|
||||
devices_line -= device
|
||||
|
||||
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)
|
||||
if (devices_line.len==0)
|
||||
devices -= devices_filter
|
||||
del(devices_line)
|
||||
|
||||
|
||||
var/list/pointers = list()
|
||||
|
||||
@@ -250,8 +250,7 @@ var/list/sec_departments = list("engineering", "supply", "medical", "science")
|
||||
wires = new(src)
|
||||
secure_radio_connections = new
|
||||
|
||||
if(radio_controller)
|
||||
initialize()
|
||||
initialize()
|
||||
recalculateChannels()
|
||||
|
||||
/obj/item/device/radio/headset/headset_sec/department/engi
|
||||
|
||||
@@ -93,8 +93,10 @@ obj/machinery/door/airlock/New()
|
||||
if(radio_controller)
|
||||
set_frequency(frequency)
|
||||
|
||||
|
||||
|
||||
obj/machinery/door/airlock/Destroy()
|
||||
if(frequency && radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
..()
|
||||
|
||||
obj/machinery/airlock_sensor
|
||||
icon = 'icons/obj/airlock_machines.dmi'
|
||||
@@ -164,7 +166,10 @@ obj/machinery/airlock_sensor/New()
|
||||
if(radio_controller)
|
||||
set_frequency(frequency)
|
||||
|
||||
|
||||
obj/machinery/airlock_sensor/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
..()
|
||||
|
||||
|
||||
obj/machinery/access_button
|
||||
@@ -220,4 +225,9 @@ obj/machinery/access_button/New()
|
||||
..()
|
||||
|
||||
if(radio_controller)
|
||||
set_frequency(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
obj/machinery/access_button/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
..()
|
||||
|
||||
@@ -144,6 +144,11 @@
|
||||
if(ticker && ticker.current_state == 3)//if the game is running
|
||||
src.initialize()
|
||||
|
||||
/obj/machinery/alarm/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
..()
|
||||
|
||||
/obj/machinery/alarm/initialize()
|
||||
set_frequency(frequency)
|
||||
if (!master_is_operating())
|
||||
@@ -582,13 +587,13 @@ table tr:first-child th:first-child { border: none;}
|
||||
|
||||
|
||||
if(href_list["atmos_alarm"])
|
||||
if (alarm_area.atmosalert(2))
|
||||
if (alarm_area.atmosalert(2,src))
|
||||
post_alert(2)
|
||||
spawn(1)
|
||||
src.updateUsrDialog()
|
||||
update_icon()
|
||||
if(href_list["atmos_reset"])
|
||||
if (alarm_area.atmosalert(0))
|
||||
if (alarm_area.atmosalert(0,src))
|
||||
post_alert(0)
|
||||
spawn(1)
|
||||
src.updateUsrDialog()
|
||||
@@ -754,7 +759,7 @@ table tr:first-child th:first-child { border: none;}
|
||||
else if (alert_level==0)
|
||||
alert_signal.data["alert"] = "clear"
|
||||
|
||||
frequency.post_signal(src, alert_signal)
|
||||
frequency.post_signal(src, alert_signal,null,-1)
|
||||
|
||||
/obj/machinery/alarm/proc/apply_danger_level()
|
||||
var/new_area_danger_level = 0
|
||||
@@ -762,7 +767,7 @@ table tr:first-child th:first-child { border: none;}
|
||||
for (var/obj/machinery/alarm/AA in A)
|
||||
if (!(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted)
|
||||
new_area_danger_level = max(new_area_danger_level,AA.danger_level)
|
||||
if (alarm_area.atmosalert(new_area_danger_level)) //if area was in normal state or if area was in alert state
|
||||
if (alarm_area.atmosalert(new_area_danger_level,src)) //if area was in normal state or if area was in alert state
|
||||
post_alert(new_area_danger_level)
|
||||
update_icon()
|
||||
|
||||
@@ -1167,14 +1172,14 @@ FIRE ALARM
|
||||
if (stat & (NOPOWER|BROKEN)) // can't reset alarm if it's unpowered or broken.
|
||||
return
|
||||
var/area/A = get_area(src)
|
||||
A.firereset()
|
||||
A.firereset(src)
|
||||
return
|
||||
|
||||
/obj/machinery/firealarm/proc/alarm()
|
||||
if (stat & (NOPOWER|BROKEN)) // can't activate alarm if it's unpowered or broken.
|
||||
return
|
||||
var/area/A = get_area(src)
|
||||
A.firealert()
|
||||
A.firealert(src)
|
||||
//playsound(src.loc, 'sound/ambience/signal.ogg', 75, 0)
|
||||
return
|
||||
|
||||
|
||||
@@ -77,14 +77,15 @@ obj/machinery/air_sensor/New()
|
||||
if(radio_controller)
|
||||
set_frequency(frequency)
|
||||
|
||||
obj/machinery/air_sensor/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
..()
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
// GENERAL AIR CONTROL (a.k.a atmos computer)
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
obj/machinery/computer/general_air_control/Destroy()
|
||||
radio_controller.remove_object(src, frequency)
|
||||
..()
|
||||
|
||||
obj/machinery/computer/general_air_control
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "tank"
|
||||
@@ -177,7 +178,8 @@ obj/machinery/computer/general_air_control/proc/return_text()
|
||||
return output
|
||||
|
||||
obj/machinery/computer/general_air_control/Destroy()
|
||||
radio_controller.remove_object(src, frequency)
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
..()
|
||||
|
||||
obj/machinery/computer/general_air_control/proc/set_frequency(new_frequency)
|
||||
|
||||
@@ -103,6 +103,12 @@
|
||||
Radio = new /obj/item/device/radio(src)
|
||||
Radio.listening = 0 //Makes bot radios transmit only so no one hears things while adjacent to one.
|
||||
|
||||
/obj/machinery/bot/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,beacon_freq)
|
||||
if(bot_filter)
|
||||
radio_controller.remove_object(src,control_freq)
|
||||
..()
|
||||
|
||||
/obj/machinery/bot/proc/add_to_beacons(bot_filter) //Master filter control for bots. Must be placed in the bot's local New() to support map spawned bots.
|
||||
if(radio_controller)
|
||||
@@ -110,6 +116,7 @@
|
||||
if(bot_filter)
|
||||
radio_controller.add_object(src, control_freq, filter = bot_filter)
|
||||
|
||||
|
||||
/obj/machinery/bot/proc/explode()
|
||||
aibots -= src
|
||||
qdel(src)
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
set_frequency(receive_frequency)
|
||||
|
||||
/obj/machinery/computer/atmos_alert/Destroy()
|
||||
radio_controller.remove_object(src, receive_frequency)
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src, receive_frequency)
|
||||
..()
|
||||
|
||||
/obj/machinery/computer/atmos_alert/receive_signal(datum/signal/signal)
|
||||
|
||||
@@ -51,7 +51,9 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/station_alert/proc/triggerAlarm(var/class, area/A, var/O, var/alarmsource)
|
||||
/obj/machinery/computer/station_alert/proc/triggerAlarm(var/class, area/A, var/O, var/obj/alarmsource)
|
||||
if(alarmsource.z != z)
|
||||
return
|
||||
if(stat & (BROKEN))
|
||||
return
|
||||
var/list/L = src.alarms[class]
|
||||
@@ -70,7 +72,7 @@
|
||||
C = CL[1]
|
||||
else if (O && istype(O, /obj/machinery/camera))
|
||||
C = O
|
||||
L[A.name] = list(A, (C) ? C : O, list(alarmsource))
|
||||
L[A.name] = list(A, (C ? C : O), list(alarmsource))
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
@@ -14,13 +14,17 @@
|
||||
..()
|
||||
air_connection = new
|
||||
|
||||
/obj/machinery/door/airlock/alarmlock/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,air_frequency)
|
||||
..()
|
||||
|
||||
/obj/machinery/door/airlock/alarmlock/initialize()
|
||||
..()
|
||||
radio_controller.remove_object(src, air_frequency)
|
||||
air_connection = radio_controller.add_object(src, air_frequency, RADIO_TO_AIRALARM)
|
||||
open()
|
||||
|
||||
|
||||
/obj/machinery/door/airlock/alarmlock/receive_signal(datum/signal/signal)
|
||||
..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
|
||||
@@ -74,15 +74,20 @@ obj/machinery/embedded_controller/radio
|
||||
var/frequency
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
initialize()
|
||||
set_frequency(frequency)
|
||||
obj/machinery/embedded_controller/radio/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
..()
|
||||
|
||||
post_signal(datum/signal/signal)
|
||||
signal.transmission_method = TRANSMISSION_RADIO
|
||||
if(radio_connection)
|
||||
return radio_connection.post_signal(src, signal)
|
||||
else
|
||||
signal = null
|
||||
obj/machinery/embedded_controller/radio/initialize()
|
||||
set_frequency(frequency)
|
||||
|
||||
obj/machinery/embedded_controller/radio/post_signal(datum/signal/signal)
|
||||
signal.transmission_method = TRANSMISSION_RADIO
|
||||
if(radio_connection)
|
||||
return radio_connection.post_signal(src, signal)
|
||||
else
|
||||
signal = null
|
||||
|
||||
obj/machinery/embedded_controller/radio/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
|
||||
@@ -42,6 +42,11 @@
|
||||
spawn()
|
||||
magnetic_process()
|
||||
|
||||
/obj/machinery/magnetic_module/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src, freq)
|
||||
..()
|
||||
|
||||
// update the invisibility and icon
|
||||
/obj/machinery/magnetic_module/hide(var/intact)
|
||||
invisibility = intact ? 101 : 0
|
||||
@@ -235,6 +240,10 @@
|
||||
if(path) // check for default path
|
||||
filter_path() // renders rpath
|
||||
|
||||
/obj/machinery/magnetic_controller/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
..()
|
||||
|
||||
/obj/machinery/magnetic_controller/process()
|
||||
if(magnets.len == 0 && autolink)
|
||||
|
||||
@@ -32,7 +32,12 @@
|
||||
if(radio_controller)
|
||||
radio_controller.add_object(src, freq, RADIO_NAVBEACONS)
|
||||
|
||||
// set the transponder codes assoc list from codes_txt
|
||||
/obj/machinery/navbeacon/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src, freq)
|
||||
..()
|
||||
|
||||
// set the transponder codes assoc list from codes_txt
|
||||
/obj/machinery/navbeacon/proc/set_codes()
|
||||
if(!codes_txt)
|
||||
return
|
||||
|
||||
@@ -41,12 +41,17 @@
|
||||
|
||||
// new display
|
||||
// register for radio system
|
||||
|
||||
/obj/machinery/status_display/New()
|
||||
..()
|
||||
spawn(5) // must wait for map loading to finish
|
||||
if(radio_controller)
|
||||
radio_controller.add_object(src, frequency)
|
||||
|
||||
/obj/machinery/status_display/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
..()
|
||||
|
||||
// timed process
|
||||
|
||||
|
||||
@@ -23,6 +23,11 @@
|
||||
spawn(5)
|
||||
add_to_radio(bot_filter)
|
||||
|
||||
/obj/item/radio/integrated/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src, control_freq)
|
||||
..()
|
||||
|
||||
/obj/item/radio/integrated/proc/post_signal(var/freq, var/key, var/value, var/key2, var/value2, var/key3, var/value3,var/key4, var/value4, s_filter)
|
||||
|
||||
//world << "Post: [freq]: [key]=[value], [key2]=[value2]"
|
||||
@@ -55,10 +60,6 @@
|
||||
|
||||
return
|
||||
|
||||
/obj/item/radio/integrated/proc/generate_menu()
|
||||
|
||||
|
||||
|
||||
/obj/item/radio/integrated/receive_signal(datum/signal/signal)
|
||||
/*var/obj/item/device/pda/P = src.loc
|
||||
|
||||
@@ -145,6 +146,11 @@
|
||||
spawn(10)
|
||||
post_signal(beacon_freq, "findbeacon", "delivery", s_filter = RADIO_NAVBEACONS)
|
||||
|
||||
/obj/item/radio/integrated/mule/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,beacon_freq)
|
||||
..()
|
||||
|
||||
// receive radio signals
|
||||
// can detect bot status signals
|
||||
// and beacon locations
|
||||
@@ -239,6 +245,11 @@
|
||||
if(radio_controller)
|
||||
initialize()
|
||||
|
||||
/obj/item/radio/integrated/signal/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
..()
|
||||
|
||||
/obj/item/radio/integrated/signal/initialize()
|
||||
if (src.frequency < 1441 || src.frequency > 1489)
|
||||
src.frequency = sanitize_frequency(src.frequency)
|
||||
|
||||
@@ -15,12 +15,14 @@
|
||||
var/shock_cooldown = 0
|
||||
|
||||
/obj/item/device/electropack/initialize()
|
||||
radio_controller.add_object(src, frequency, RADIO_CHAT)
|
||||
|
||||
/obj/item/device/electropack/New()
|
||||
if(radio_controller)
|
||||
radio_controller.add_object(src, frequency, RADIO_CHAT)
|
||||
|
||||
/obj/item/device/electropack/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
..()
|
||||
|
||||
/obj/item/device/electropack/attack_hand(mob/user)
|
||||
if(iscarbon(user))
|
||||
var/mob/living/carbon/C = user
|
||||
|
||||
@@ -22,6 +22,10 @@
|
||||
set_frequency(frequency)
|
||||
return
|
||||
|
||||
/obj/item/device/assembly/signaler/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
..()
|
||||
|
||||
/obj/item/device/assembly/signaler/activate()
|
||||
if(cooldown > 0) return 0
|
||||
|
||||
@@ -492,7 +492,9 @@ var/list/ai_list = list()
|
||||
|
||||
Bot.call_bot(src, waypoint)
|
||||
|
||||
/mob/living/silicon/ai/triggerAlarm(var/class, area/A, var/O, var/alarmsource)
|
||||
/mob/living/silicon/ai/triggerAlarm(var/class, area/A, var/O, var/obj/alarmsource)
|
||||
if(alarmsource.z != z)
|
||||
return
|
||||
if (stat == 2)
|
||||
return 1
|
||||
var/list/L = alarms[class]
|
||||
|
||||
@@ -349,7 +349,9 @@
|
||||
if(prob(75) && Proj.damage > 0) spark_system.start()
|
||||
return 2
|
||||
|
||||
/mob/living/silicon/robot/triggerAlarm(var/class, area/A, var/O, var/alarmsource)
|
||||
/mob/living/silicon/robot/triggerAlarm(var/class, area/A, var/O, var/obj/alarmsource)
|
||||
if(alarmsource.z != z)
|
||||
return
|
||||
if (stat == 2)
|
||||
return 1
|
||||
var/list/L = alarms[class]
|
||||
|
||||
@@ -361,7 +361,9 @@
|
||||
src << "<span class='userdanger'>HeAV% DA%^MMA+G TO I/O CIR!%UUT!</span>"
|
||||
|
||||
|
||||
/mob/living/simple_animal/drone/proc/triggerAlarm(var/class, area/A, var/O, var/alarmsource)
|
||||
/mob/living/simple_animal/drone/proc/triggerAlarm(var/class, area/A, var/O, var/obj/alarmsource)
|
||||
if(alarmsource.z != z)
|
||||
return
|
||||
if(stat != DEAD)
|
||||
var/list/L = src.alarms[class]
|
||||
for (var/I in L)
|
||||
|
||||
@@ -51,6 +51,11 @@
|
||||
if(radio_controller)
|
||||
initialize()
|
||||
|
||||
Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
..()
|
||||
|
||||
initialize()
|
||||
set_frequency(frequency)
|
||||
|
||||
|
||||
@@ -91,6 +91,11 @@
|
||||
// if(src.owner)
|
||||
// processing_items.Add(src)
|
||||
|
||||
/obj/item/device/pda2/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
..()
|
||||
|
||||
/obj/item/device/pda2/attack_self(mob/user as mob)
|
||||
user.machine = src
|
||||
|
||||
|
||||
Reference in New Issue
Block a user