mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 06:00:16 +01:00
Squashed up
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/obj/machinery/atmospherics/binary
|
||||
icon = 'icons/obj/atmospherics/binary_devices.dmi'
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH
|
||||
use_power = 1
|
||||
@@ -12,6 +13,8 @@
|
||||
var/datum/pipe_network/network1
|
||||
var/datum/pipe_network/network2
|
||||
|
||||
var/showpipe = 0
|
||||
|
||||
/obj/machinery/atmospherics/binary/New()
|
||||
..()
|
||||
switch(dir)
|
||||
@@ -29,6 +32,33 @@
|
||||
air1.volume = 200
|
||||
air2.volume = 200
|
||||
|
||||
//Separate this because we don't need to update pipe icons if we just are going to change the state
|
||||
/obj/machinery/atmospherics/binary/proc/update_icon_nopipes()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/update_icon()
|
||||
update_icon_nopipes()
|
||||
|
||||
underlays.Cut()
|
||||
if(showpipe)
|
||||
var/connected = 0
|
||||
|
||||
//Add intact pieces
|
||||
if(node1)
|
||||
connected = icon_addintact(node1, connected)
|
||||
|
||||
if(node2)
|
||||
connected = icon_addintact(node2, connected)
|
||||
|
||||
//Add broken pieces
|
||||
icon_addbroken(connected)
|
||||
|
||||
/obj/machinery/atmospherics/binary/hide(var/intact)
|
||||
showpipe = !intact
|
||||
update_icon()
|
||||
|
||||
..(intact)
|
||||
|
||||
// Housekeeping and pipe network stuff below
|
||||
/obj/machinery/atmospherics/binary/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
if(reference == node1)
|
||||
@@ -75,6 +105,9 @@
|
||||
node2 = target
|
||||
break
|
||||
|
||||
if(level == 2)
|
||||
showpipe = 1
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/binary/build_network()
|
||||
@@ -122,11 +155,12 @@
|
||||
if(reference==node1)
|
||||
del(network1)
|
||||
node1 = null
|
||||
|
||||
else if(reference==node2)
|
||||
del(network2)
|
||||
node2 = null
|
||||
|
||||
update_icon()
|
||||
|
||||
return null
|
||||
|
||||
/obj/machinery/atmospherics/binary/nullifyPipenetwork()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump
|
||||
icon = 'icons/obj/atmospherics/dp_vent_pump.dmi'
|
||||
icon_state = "off"
|
||||
icon = 'icons/obj/atmospherics/unary_devices.dmi' //We reuse the normal vent icons!
|
||||
icon_state = "dpvent_map"
|
||||
|
||||
//node2 is output port
|
||||
//node1 is input port
|
||||
@@ -13,6 +13,18 @@
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
var/on = 0
|
||||
var/pump_direction = 1 //0 = siphoning, 1 = releasing
|
||||
|
||||
var/external_pressure_bound = ONE_ATMOSPHERE
|
||||
var/input_pressure_min = 0
|
||||
var/output_pressure_max = 0
|
||||
|
||||
var/pressure_checks = 1
|
||||
//1: Do not pass external_pressure_bound
|
||||
//2: Do not pass input_pressure_min
|
||||
//4: Do not pass output_pressure_max
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/high_volume
|
||||
name = "large dual-port air vent"
|
||||
|
||||
@@ -22,40 +34,19 @@
|
||||
air1.volume = 1000
|
||||
air2.volume = 1000
|
||||
|
||||
var/on = 0
|
||||
var/pump_direction = 1 //0 = siphoning, 1 = releasing
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/update_icon_nopipes()
|
||||
overlays.Cut()
|
||||
if(showpipe)
|
||||
overlays += getpipeimage('icons/obj/atmospherics/unary_devices.dmi', "dpvent_cap")
|
||||
|
||||
var/external_pressure_bound = ONE_ATMOSPHERE
|
||||
var/input_pressure_min = 0
|
||||
var/output_pressure_max = 0
|
||||
if(!on || stat & (NOPOWER|BROKEN))
|
||||
icon_state = "vent_off"
|
||||
return
|
||||
|
||||
var/pressure_checks = 1
|
||||
//1: Do not pass external_pressure_bound
|
||||
//2: Do not pass input_pressure_min
|
||||
//4: Do not pass output_pressure_max
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/update_icon()
|
||||
if(on)
|
||||
if(pump_direction)
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]out"
|
||||
else
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]in"
|
||||
if(pump_direction)
|
||||
icon_state = "vent_out"
|
||||
else
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
on = 0
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
if(on)
|
||||
if(pump_direction)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]out"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]in"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
on = 0
|
||||
return
|
||||
icon_state = "vent_in"
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/process()
|
||||
..()
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
|
||||
/*
|
||||
|
||||
Passive gate is similar to the regular pump except:
|
||||
* It doesn't require power
|
||||
* Can not transfer low pressure to higher pressure (so it's more like a valve where you can control the flow)
|
||||
|
||||
*/
|
||||
|
||||
/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'
|
||||
icon_state = "intact_off"
|
||||
icon_state = "passgate_map"
|
||||
|
||||
name = "passive gate"
|
||||
desc = "A one-way air valve that does not require power"
|
||||
@@ -16,19 +22,10 @@
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/update_icon()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intact_off"
|
||||
else if(node1 && node2)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
else
|
||||
if(node1)
|
||||
icon_state = "exposed_1_off"
|
||||
else if(node2)
|
||||
icon_state = "exposed_2_off"
|
||||
else
|
||||
icon_state = "exposed_3_off"
|
||||
return
|
||||
/obj/machinery/atmospherics/binary/passive_gate/update_icon_nopipes()
|
||||
overlays.Cut()
|
||||
if(on & !(stat & NOPOWER))
|
||||
overlays += getpipeimage('icons/obj/atmospherics/binary_devices.dmi', "passgate_on")
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/process()
|
||||
..()
|
||||
|
||||
@@ -13,9 +13,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump
|
||||
icon = 'icons/obj/atmospherics/pump.dmi'
|
||||
icon_state = "intact_off"
|
||||
|
||||
icon_state = "pump_map"
|
||||
name = "gas pump"
|
||||
desc = "A pump"
|
||||
|
||||
@@ -30,21 +28,13 @@ Thus, the two variables affect pump operation are set in New():
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/on
|
||||
on = 1
|
||||
icon_state = "intact_on"
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/update_icon()
|
||||
/obj/machinery/atmospherics/binary/pump/update_icon_nopipes()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intact_off"
|
||||
else if(node1 && node2)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
else
|
||||
if(node1)
|
||||
icon_state = "exposed_1_off"
|
||||
else if(node2)
|
||||
icon_state = "exposed_2_off"
|
||||
else
|
||||
icon_state = "exposed_3_off"
|
||||
return
|
||||
icon_state = "pump_off"
|
||||
return
|
||||
|
||||
icon_state = "pump_[on?"on":"off"]"
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/process()
|
||||
// ..()
|
||||
|
||||
@@ -13,9 +13,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump
|
||||
icon = 'icons/obj/atmospherics/volume_pump.dmi'
|
||||
icon_state = "intact_off"
|
||||
|
||||
icon_state = "volpump_map"
|
||||
name = "volumetric gas pump"
|
||||
desc = "A volumetric pump"
|
||||
|
||||
@@ -30,21 +28,13 @@ Thus, the two variables affect pump operation are set in New():
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/on
|
||||
on = 1
|
||||
icon_state = "intact_on"
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/update_icon()
|
||||
/obj/machinery/atmospherics/binary/volume_pump/update_icon_nopipes()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intact_off"
|
||||
else if(node1 && node2)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
else
|
||||
if(node1)
|
||||
icon_state = "exposed_1_off"
|
||||
else if(node2)
|
||||
icon_state = "exposed_2_off"
|
||||
else
|
||||
icon_state = "exposed_3_off"
|
||||
return
|
||||
icon_state = "volpump_off"
|
||||
return
|
||||
|
||||
icon_state = "volpump_[on?"on":"off"]"
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/process()
|
||||
// ..()
|
||||
|
||||
Reference in New Issue
Block a user