mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Activity logging for pumps.
relative pathing to absolute pathing
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
obj/machinery/atmospherics/binary
|
||||
/obj/machinery/atmospherics/binary
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH
|
||||
use_power = 1
|
||||
@@ -11,8 +11,9 @@ obj/machinery/atmospherics/binary
|
||||
|
||||
var/datum/pipe_network/network1
|
||||
var/datum/pipe_network/network2
|
||||
var/list/activity_log = list()
|
||||
|
||||
New()
|
||||
/obj/machinery/atmospherics/binary/New()
|
||||
..()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
@@ -29,7 +30,7 @@ obj/machinery/atmospherics/binary
|
||||
air1.volume = 200
|
||||
air2.volume = 200
|
||||
|
||||
buildFrom(var/mob/usr,var/obj/item/pipe/pipe)
|
||||
/obj/machinery/atmospherics/binary/buildFrom(var/mob/usr,var/obj/item/pipe/pipe)
|
||||
dir = pipe.dir
|
||||
initialize_directions = pipe.get_pipe_dir()
|
||||
if (pipe.pipename)
|
||||
@@ -47,7 +48,7 @@ obj/machinery/atmospherics/binary
|
||||
return 1
|
||||
|
||||
// Housekeeping and pipe network stuff below
|
||||
network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
/obj/machinery/atmospherics/binary/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
if(reference == node1)
|
||||
network1 = new_network
|
||||
|
||||
@@ -61,7 +62,7 @@ obj/machinery/atmospherics/binary
|
||||
|
||||
return null
|
||||
|
||||
Destroy()
|
||||
/obj/machinery/atmospherics/binary/Destroy()
|
||||
if(node1)
|
||||
node1.disconnect(src)
|
||||
del(network1)
|
||||
@@ -74,7 +75,7 @@ obj/machinery/atmospherics/binary
|
||||
|
||||
..()
|
||||
|
||||
initialize()
|
||||
/obj/machinery/atmospherics/binary/initialize()
|
||||
if(node1 && node2) return
|
||||
|
||||
node1 = findConnecting(turn(dir, 180))
|
||||
@@ -82,7 +83,7 @@ obj/machinery/atmospherics/binary
|
||||
|
||||
update_icon()
|
||||
|
||||
build_network()
|
||||
/obj/machinery/atmospherics/binary/build_network()
|
||||
if(!network1 && node1)
|
||||
network1 = new /datum/pipe_network()
|
||||
network1.normal_members += src
|
||||
@@ -94,7 +95,7 @@ obj/machinery/atmospherics/binary
|
||||
network2.build_network(node2, src)
|
||||
|
||||
|
||||
return_network(obj/machinery/atmospherics/reference)
|
||||
/obj/machinery/atmospherics/binary/return_network(obj/machinery/atmospherics/reference)
|
||||
build_network()
|
||||
|
||||
if(reference==node1)
|
||||
@@ -105,7 +106,7 @@ obj/machinery/atmospherics/binary
|
||||
|
||||
return null
|
||||
|
||||
reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
|
||||
/obj/machinery/atmospherics/binary/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
|
||||
if(network1 == old_network)
|
||||
network1 = new_network
|
||||
if(network2 == old_network)
|
||||
@@ -113,7 +114,7 @@ obj/machinery/atmospherics/binary
|
||||
|
||||
return 1
|
||||
|
||||
return_network_air(datum/pipe_network/reference)
|
||||
/obj/machinery/atmospherics/binary/return_network_air(datum/pipe_network/reference)
|
||||
var/list/results = list()
|
||||
|
||||
if(network1 == reference)
|
||||
@@ -123,7 +124,7 @@ obj/machinery/atmospherics/binary
|
||||
|
||||
return results
|
||||
|
||||
disconnect(obj/machinery/atmospherics/reference)
|
||||
/obj/machinery/atmospherics/binary/disconnect(obj/machinery/atmospherics/reference)
|
||||
if(reference==node1)
|
||||
del(network1)
|
||||
node1 = null
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
obj/machinery/atmospherics/binary/passive_gate
|
||||
/obj/machinery/atmospherics/binary/passive_gate
|
||||
//Tries to achieve target pressure at output (like a normal pump) except
|
||||
// Uses no power but can not transfer gases from a low pressure area to a high pressure area
|
||||
icon = 'icons/obj/atmospherics/passive_gate.dmi'
|
||||
@@ -14,7 +14,7 @@ obj/machinery/atmospherics/binary/passive_gate
|
||||
var/id_tag = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
update_icon()
|
||||
/obj/machinery/atmospherics/binary/passive_gate/update_icon()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intact_off"
|
||||
else if(node1 && node2)
|
||||
@@ -28,7 +28,7 @@ obj/machinery/atmospherics/binary/passive_gate
|
||||
icon_state = "exposed_3_off"
|
||||
return
|
||||
|
||||
process()
|
||||
/obj/machinery/atmospherics/binary/passive_gate/process()
|
||||
..()
|
||||
if(!on)
|
||||
return 0
|
||||
@@ -59,16 +59,16 @@ obj/machinery/atmospherics/binary/passive_gate
|
||||
network2.update = 1
|
||||
|
||||
|
||||
//Radio remote control
|
||||
//Radio remote control
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency, filter = RADIO_ATMOSIA)
|
||||
|
||||
broadcast_status()
|
||||
/obj/machinery/atmospherics/binary/passive_gate/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
@@ -88,7 +88,7 @@ obj/machinery/atmospherics/binary/passive_gate
|
||||
|
||||
return 1
|
||||
|
||||
interact(mob/user as mob)
|
||||
/obj/machinery/atmospherics/binary/passive_gate/interact(mob/user as mob)
|
||||
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output pressure: </b>
|
||||
[round(target_pressure,0.1)]kPa | <a href='?src=\ref[src];set_press=1'>Change</a>
|
||||
@@ -97,12 +97,12 @@ obj/machinery/atmospherics/binary/passive_gate
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT>", "window=atmo_pump")
|
||||
onclose(user, "atmo_pump")
|
||||
|
||||
initialize()
|
||||
/obj/machinery/atmospherics/binary/passive_gate/initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
/obj/machinery/atmospherics/binary/passive_gate/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
@@ -127,11 +127,12 @@ obj/machinery/atmospherics/binary/passive_gate
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
activity_log += text("\[[time_stamp()]\] Remote signal powered us [on ? "on" : "off"]")
|
||||
return
|
||||
|
||||
|
||||
|
||||
attack_hand(user as mob)
|
||||
/obj/machinery/atmospherics/binary/passive_gate/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
@@ -142,10 +143,11 @@ obj/machinery/atmospherics/binary/passive_gate
|
||||
interact(user)
|
||||
return
|
||||
|
||||
Topic(href,href_list)
|
||||
/obj/machinery/atmospherics/binary/passive_gate/Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
activity_log += text("\[[time_stamp()]\] Real name: [], Key: [] - turned [] \the [].",usr.real_name, usr.key,(on ? "on" : "off"),src)
|
||||
if(href_list["set_press"])
|
||||
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",src.target_pressure) as num
|
||||
src.target_pressure = max(0, min(4500, new_pressure))
|
||||
@@ -154,13 +156,13 @@ obj/machinery/atmospherics/binary/passive_gate
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
power_change()
|
||||
/obj/machinery/atmospherics/binary/passive_gate/power_change()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
/obj/machinery/atmospherics/binary/passive_gate/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (on)
|
||||
|
||||
@@ -12,7 +12,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
but overall network volume is also increased as this increases...
|
||||
*/
|
||||
|
||||
obj/machinery/atmospherics/binary/pump
|
||||
/obj/machinery/atmospherics/binary/pump
|
||||
icon = 'icons/obj/atmospherics/pump.dmi'
|
||||
icon_state = "intact_off"
|
||||
|
||||
@@ -26,17 +26,17 @@ obj/machinery/atmospherics/binary/pump
|
||||
var/id_tag = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
highcap
|
||||
/obj/machinery/atmospherics/binary/pump/highcap
|
||||
name = "High capacity gas pump"
|
||||
desc = "A high capacity pump"
|
||||
|
||||
target_pressure = 15000000
|
||||
|
||||
on
|
||||
/obj/machinery/atmospherics/binary/pump/on
|
||||
on = 1
|
||||
icon_state = "intact_on"
|
||||
|
||||
update_icon()
|
||||
/obj/machinery/atmospherics/binary/pump/update_icon()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intact_off"
|
||||
else if(node1 && node2)
|
||||
@@ -50,7 +50,7 @@ obj/machinery/atmospherics/binary/pump
|
||||
icon_state = "exposed_3_off"
|
||||
return
|
||||
|
||||
process()
|
||||
/obj/machinery/atmospherics/binary/pump/process()
|
||||
// ..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
@@ -80,16 +80,16 @@ obj/machinery/atmospherics/binary/pump
|
||||
|
||||
return 1
|
||||
|
||||
//Radio remote control
|
||||
//Radio remote control
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency, filter = RADIO_ATMOSIA)
|
||||
|
||||
broadcast_status()
|
||||
/obj/machinery/atmospherics/binary/pump/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
@@ -109,7 +109,7 @@ obj/machinery/atmospherics/binary/pump
|
||||
|
||||
return 1
|
||||
|
||||
interact(mob/user as mob)
|
||||
/obj/machinery/atmospherics/binary/pump/interact(mob/user as mob)
|
||||
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output pressure: </b>
|
||||
[round(target_pressure,0.1)]kPa | <a href='?src=\ref[src];set_press=1'>Change</a>
|
||||
@@ -118,12 +118,12 @@ obj/machinery/atmospherics/binary/pump
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT>", "window=atmo_pump")
|
||||
onclose(user, "atmo_pump")
|
||||
|
||||
initialize()
|
||||
/obj/machinery/atmospherics/binary/pump/initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
/obj/machinery/atmospherics/binary/pump/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
@@ -148,10 +148,11 @@ obj/machinery/atmospherics/binary/pump
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
activity_log += text("\[[time_stamp()]\] Remote signal toggled us [on ? "on" : "off"]")
|
||||
return
|
||||
|
||||
|
||||
attack_hand(user as mob)
|
||||
/obj/machinery/atmospherics/binary/pump/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
@@ -162,10 +163,11 @@ obj/machinery/atmospherics/binary/pump
|
||||
interact(user)
|
||||
return
|
||||
|
||||
Topic(href,href_list)
|
||||
/obj/machinery/atmospherics/binary/pump/Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
activity_log += text("\[[time_stamp()]\] Real name: [], Key: [] - turned [] \the [].",usr.real_name, usr.key,(on ? "on" : "off"),src)
|
||||
if(href_list["set_press"])
|
||||
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",src.target_pressure) as num
|
||||
src.target_pressure = max(0, min(4500, new_pressure))
|
||||
@@ -174,11 +176,11 @@ obj/machinery/atmospherics/binary/pump
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
power_change()
|
||||
/obj/machinery/atmospherics/binary/pump/power_change()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
/obj/machinery/atmospherics/binary/pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
|
||||
@@ -12,7 +12,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
but overall network volume is also increased as this increases...
|
||||
*/
|
||||
|
||||
obj/machinery/atmospherics/binary/volume_pump
|
||||
/obj/machinery/atmospherics/binary/volume_pump
|
||||
icon = 'icons/obj/atmospherics/volume_pump.dmi'
|
||||
icon_state = "intact_off"
|
||||
|
||||
@@ -26,11 +26,11 @@ obj/machinery/atmospherics/binary/volume_pump
|
||||
var/id_tag = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
on
|
||||
/obj/machinery/atmospherics/binary/volume_pump/on
|
||||
on = 1
|
||||
icon_state = "intact_on"
|
||||
|
||||
update_icon()
|
||||
/obj/machinery/atmospherics/binary/volume_pump/update_icon()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intact_off"
|
||||
else if(node1 && node2)
|
||||
@@ -44,7 +44,7 @@ obj/machinery/atmospherics/binary/volume_pump
|
||||
icon_state = "exposed_3_off"
|
||||
return
|
||||
|
||||
process()
|
||||
/obj/machinery/atmospherics/binary/volume_pump/process()
|
||||
// ..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
@@ -73,14 +73,13 @@ obj/machinery/atmospherics/binary/volume_pump
|
||||
|
||||
return 1
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
/obj/machinery/atmospherics/binary/volume_pump/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency)
|
||||
|
||||
broadcast_status()
|
||||
/obj/machinery/atmospherics/binary/volume_pump/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
@@ -99,7 +98,7 @@ obj/machinery/atmospherics/binary/volume_pump
|
||||
|
||||
return 1
|
||||
|
||||
interact(mob/user as mob)
|
||||
/obj/machinery/atmospherics/binary/volume_pump/interact(mob/user as mob)
|
||||
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output flow: </b>
|
||||
[round(transfer_rate,1)]l/s | <a href='?src=\ref[src];set_transfer_rate=1'>Change</a>
|
||||
@@ -110,12 +109,12 @@ obj/machinery/atmospherics/binary/volume_pump
|
||||
|
||||
|
||||
|
||||
initialize()
|
||||
/obj/machinery/atmospherics/binary/volume_pump/initialize()
|
||||
..()
|
||||
|
||||
set_frequency(frequency)
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
/obj/machinery/atmospherics/binary/volume_pump/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
@@ -140,9 +139,10 @@ obj/machinery/atmospherics/binary/volume_pump
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
activity_log += text("\[[time_stamp()]\] Remote signal toggled us [on ? "on" : "off"]")
|
||||
|
||||
|
||||
attack_hand(user as mob)
|
||||
/obj/machinery/atmospherics/binary/volume_pump/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
@@ -153,10 +153,11 @@ obj/machinery/atmospherics/binary/volume_pump
|
||||
interact(user)
|
||||
return
|
||||
|
||||
Topic(href,href_list)
|
||||
/obj/machinery/atmospherics/binary/volume_pump/Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
activity_log += text("\[[time_stamp()]\] Real name: [], Key: [] - turned [] \the [].",usr.real_name, usr.key,(on ? "on" : "off"),src)
|
||||
if(href_list["set_transfer_rate"])
|
||||
var/new_transfer_rate = input(usr,"Enter new output volume (0-200l/s)","Flow control",src.transfer_rate) as num
|
||||
src.transfer_rate = max(0, min(200, new_transfer_rate))
|
||||
@@ -165,13 +166,13 @@ obj/machinery/atmospherics/binary/volume_pump
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
power_change()
|
||||
/obj/machinery/atmospherics/binary/volume_pump/power_change()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
/obj/machinery/atmospherics/binary/volume_pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
|
||||
Reference in New Issue
Block a user