Merge pull request #574 from Citadel-Station-13/upstream-merge-26474
[MIRROR] Gas injectors are now buildable
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
var/turf/T = get_turf(src)
|
||||
var/area/A = get_area(src)
|
||||
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
|
||||
investigate_log("Pump, [src.name], was unwrenched by [key_name(usr)] at [x], [y], [z], [A]", "atmos")
|
||||
message_admins("Pump, [src.name], was unwrenched by [ADMIN_LOOKUPFLW(user)] at [ADMIN_COORDJMP(T)]")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -181,7 +181,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
var/turf/T = get_turf(src)
|
||||
//var/area/A = get_area(src)
|
||||
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
|
||||
investigate_log("Volume Pump, [src.name], was unwrenched by [key_name(usr)] at [x], [y], [z], [loc.loc]", "atmos")
|
||||
message_admins("Volume Pump, [src.name], was unwrenched by [ADMIN_LOOKUPFLW(usr)] at [ADMIN_COORDJMP(T)]")
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user