Gas injectors are now buildable
This commit is contained in:
@@ -16,6 +16,7 @@ Construction breaks otherwise
|
||||
#define PIPE_CONNECTOR /obj/machinery/atmospherics/components/unary/portables_connector
|
||||
#define PIPE_UVENT /obj/machinery/atmospherics/components/unary/vent_pump
|
||||
#define PIPE_SCRUBBER /obj/machinery/atmospherics/components/unary/vent_scrubber
|
||||
#define PIPE_INJECTOR /obj/machinery/atmospherics/components/unary/outlet_injector
|
||||
#define PIPE_HEAT_EXCHANGE /obj/machinery/atmospherics/components/unary/heat_exchanger
|
||||
//Binary
|
||||
#define PIPE_PUMP /obj/machinery/atmospherics/components/binary/pump
|
||||
|
||||
@@ -34,6 +34,7 @@ Buildable meters
|
||||
PIPE_CONNECTOR, \
|
||||
PIPE_UVENT, \
|
||||
PIPE_SCRUBBER, \
|
||||
PIPE_INJECTOR, \
|
||||
PIPE_HEAT_EXCHANGE, \
|
||||
\
|
||||
PIPE_PUMP, \
|
||||
@@ -93,6 +94,7 @@ GLOBAL_LIST_INIT(pipeID2State, list(
|
||||
"[PIPE_CONNECTOR]" = "connector", \
|
||||
"[PIPE_UVENT]" = "uvent", \
|
||||
"[PIPE_SCRUBBER]" = "scrubber", \
|
||||
"[PIPE_INJECTOR]" = "injector", \
|
||||
"[PIPE_HEAT_EXCHANGE]" = "heunary", \
|
||||
\
|
||||
"[PIPE_PUMP]" = "pump", \
|
||||
@@ -120,6 +122,7 @@ GLOBAL_LIST_INIT(pipeID2State, list(
|
||||
"[PIPE_CONNECTOR]" = "connector", \
|
||||
"[PIPE_UVENT]" = "vent", \
|
||||
"[PIPE_SCRUBBER]" = "scrubber", \
|
||||
"[PIPE_INJECTOR]" = "injector", \
|
||||
"[PIPE_HEAT_EXCHANGE]" = "heat exchanger", \
|
||||
\
|
||||
"[PIPE_PUMP]" = "pump", \
|
||||
|
||||
@@ -94,10 +94,10 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
"Passive Gate" = new /datum/pipe_info(PIPE_PASSIVE_GATE, 1, PIPE_UNARY),
|
||||
"Volume Pump" = new /datum/pipe_info(PIPE_VOLUME_PUMP, 1, PIPE_UNARY),
|
||||
"Scrubber" = new /datum/pipe_info(PIPE_SCRUBBER, 1, PIPE_UNARY),
|
||||
"Injector" = new /datum/pipe_info(PIPE_INJECTOR, 1, PIPE_UNARY),
|
||||
"Meter" = new /datum/pipe_info/meter(),
|
||||
"Gas Filter" = new /datum/pipe_info(PIPE_GAS_FILTER, 1, PIPE_TRIN_M),
|
||||
"Gas Mixer" = new /datum/pipe_info(PIPE_GAS_MIXER, 1, PIPE_TRIN_M),
|
||||
// "Injector" = new /datum/pipe_info(PIPE_INJECTOR, 1, PIPE_UNARY),
|
||||
),
|
||||
"Heat Exchange" = list(
|
||||
"Pipe" = new /datum/pipe_info(PIPE_HE, 1, PIPE_BENDABLE),
|
||||
|
||||
@@ -169,7 +169,7 @@ Passive gate is similar to the regular pump except:
|
||||
/obj/machinery/atmospherics/components/binary/passive_gate/can_unwrench(mob/user)
|
||||
if(..())
|
||||
if(on)
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench this [src], turn it off first!</span>")
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench [src], turn it off first!</span>")
|
||||
else
|
||||
return 1
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
diff a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm (rejected hunks)
|
||||
@@ -176,7 +176,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
/obj/machinery/atmospherics/components/binary/pump/can_unwrench(mob/user)
|
||||
if(..())
|
||||
if(!(stat & NOPOWER) && on)
|
||||
- to_chat(user, "<span class='warning'>You cannot unwrench this [src], turn it off first!</span>")
|
||||
+ to_chat(user, "<span class='warning'>You cannot unwrench [src], turn it off first!</span>")
|
||||
else
|
||||
return 1
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
diff a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm (rejected hunks)
|
||||
@@ -172,7 +172,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
/obj/machinery/atmospherics/components/binary/volume_pump/can_unwrench(mob/user)
|
||||
if(..())
|
||||
if(!(stat & NOPOWER) && on)
|
||||
- to_chat(user, "<span class='warning'>You cannot unwrench this [src], turn it off first!</span>")
|
||||
+ to_chat(user, "<span class='warning'>You cannot unwrench [src], turn it off first!</span>")
|
||||
else
|
||||
return 1
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/obj/machinery/atmospherics/components/unary/outlet_injector
|
||||
icon_state = "inje_map"
|
||||
use_power = 1
|
||||
|
||||
name = "air injector"
|
||||
desc = "Has a valve and pump attached to it"
|
||||
icon_state = "inje_map"
|
||||
use_power = 1
|
||||
can_unwrench = TRUE
|
||||
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF //really helpful in building gas chambers for xenomorphs
|
||||
|
||||
var/on = 0
|
||||
var/injecting = 0
|
||||
@@ -22,9 +23,13 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/outlet_injector/on
|
||||
on = 1
|
||||
on = TRUE
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/outlet_injector/update_icon_nopipes()
|
||||
cut_overlays()
|
||||
if(showpipe)
|
||||
add_overlay(getpipeimage(icon, "inje_cap", initialize_directions))
|
||||
|
||||
if(!NODE1 || !on || stat & (NOPOWER|BROKEN))
|
||||
icon_state = "inje_off"
|
||||
return
|
||||
@@ -42,7 +47,7 @@
|
||||
..()
|
||||
injecting = 0
|
||||
|
||||
if(!on || stat & NOPOWER)
|
||||
if(!on || stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
@@ -60,7 +65,7 @@
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/outlet_injector/proc/inject()
|
||||
if(on || injecting)
|
||||
if(on || injecting || stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
@@ -139,3 +144,53 @@
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/outlet_injector/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "atmos_pump", name, 310, 115, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/outlet_injector/ui_data()
|
||||
var/data = list()
|
||||
data["on"] = on
|
||||
data["rate"] = round(volume_rate)
|
||||
data["max_rate"] = round(MAX_TRANSFER_RATE)
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/outlet_injector/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
switch(action)
|
||||
if("power")
|
||||
on = !on
|
||||
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos")
|
||||
. = TRUE
|
||||
if("rate")
|
||||
var/rate = params["rate"]
|
||||
if(rate == "max")
|
||||
rate = MAX_TRANSFER_RATE
|
||||
. = TRUE
|
||||
else if(rate == "input")
|
||||
rate = input("New transfer rate (0-[MAX_TRANSFER_RATE] L/s):", name, volume_rate) as num|null
|
||||
if(!isnull(rate) && !..())
|
||||
. = TRUE
|
||||
else if(text2num(rate) != null)
|
||||
rate = text2num(rate)
|
||||
. = TRUE
|
||||
if(.)
|
||||
volume_rate = Clamp(rate, 0, MAX_TRANSFER_RATE)
|
||||
investigate_log("was set to [volume_rate] L/s by [key_name(usr)]", "atmos")
|
||||
update_icon()
|
||||
broadcast_status()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/outlet_injector/can_unwrench(mob/user)
|
||||
if(..())
|
||||
if (!(stat & NOPOWER|BROKEN) && on)
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench [src], turn it off first!</span>")
|
||||
else
|
||||
return 1
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
/obj/machinery/atmospherics/components/unary/portables_connector/can_unwrench(mob/user)
|
||||
if(..())
|
||||
if(connected_device)
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench this [src], detach [connected_device] first!</span>")
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench [src], detach [connected_device] first!</span>")
|
||||
else
|
||||
return 1
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
/*
|
||||
Iconnery
|
||||
*/
|
||||
/obj/machinery/atmospherics/components/unary/on_construction()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/hide(intact)
|
||||
update_icon()
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
/obj/machinery/atmospherics/components/unary/vent_pump/update_icon_nopipes()
|
||||
cut_overlays()
|
||||
if(showpipe)
|
||||
add_overlay(getpipeimage('icons/obj/atmospherics/components/unary_devices.dmi', "vent_cap", initialize_directions))
|
||||
add_overlay(getpipeimage(icon, "vent_cap", initialize_directions))
|
||||
|
||||
if(welded)
|
||||
icon_state = "vent_welded"
|
||||
@@ -268,7 +268,7 @@
|
||||
/obj/machinery/atmospherics/components/unary/vent_pump/can_unwrench(mob/user)
|
||||
if(..())
|
||||
if(!(stat & NOPOWER) && on)
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench this [src], turn it off first!</span>")
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench [src], turn it off first!</span>")
|
||||
else
|
||||
return 1
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
/obj/machinery/atmospherics/components/unary/vent_scrubber/update_icon_nopipes()
|
||||
cut_overlays()
|
||||
if(showpipe)
|
||||
add_overlay(getpipeimage('icons/obj/atmospherics/components/unary_devices.dmi', "scrub_cap", initialize_directions))
|
||||
add_overlay(getpipeimage(icon, "scrub_cap", initialize_directions))
|
||||
|
||||
if(welded)
|
||||
icon_state = "scrub_welded"
|
||||
@@ -361,7 +361,7 @@
|
||||
/obj/machinery/atmospherics/components/unary/vent_scrubber/can_unwrench(mob/user)
|
||||
if(..())
|
||||
if (!(stat & NOPOWER) && on)
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench this [src], turn it off first!</span>")
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench [src], turn it off first!</span>")
|
||||
else
|
||||
return 1
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 31 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 19 KiB |
File diff suppressed because one or more lines are too long
@@ -6,7 +6,7 @@
|
||||
{{#if data.max_rate}}
|
||||
<ui-section label='Transfer Rate'>
|
||||
<ui-button icon='pencil' action='rate' params='{"rate": "input"}'>Set</ui-button>
|
||||
<ui-button icon='plus' state='{{data.rate == data.max_rate ? "disabled" : null}}' action='transfer' params='{"rate": "max"}'>Max</ui-button>
|
||||
<ui-button icon='plus' state='{{data.rate == data.max_rate ? "disabled" : null}}' action='rate' params='{"rate": "max"}'>Max</ui-button>
|
||||
<span>{{Math.round(adata.rate)}} L/s</span>
|
||||
</ui-section>
|
||||
{{else}}
|
||||
|
||||
Reference in New Issue
Block a user