Merge pull request #5775 from Citadel-Station-13/upstream-merge-36066
[MIRROR] Allows you to easily replace tanks in canisters & pumps
This commit is contained in:
@@ -315,6 +315,16 @@
|
||||
holding.forceMove(T)
|
||||
holding = null
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/replace_tank(mob/living/user, close_valve)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(close_valve)
|
||||
valve_open = FALSE
|
||||
update_icon()
|
||||
investigate_log("Valve was <b>closed</b> by [key_name(user)].<br>", INVESTIGATE_ATMOS)
|
||||
else if(valve_open && holding)
|
||||
investigate_log("[key_name(user)] started a transfer into [holding].<br>", INVESTIGATE_ATMOS)
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/process_atmos()
|
||||
..()
|
||||
if(stat & BROKEN)
|
||||
@@ -435,7 +445,7 @@
|
||||
message_admins(msg)
|
||||
else
|
||||
logmsg = "Valve was <b>closed</b> by [key_name(usr)], stopping the transfer into \the [holding || "air"].<br>"
|
||||
investigate_log(logmsg, "atmos")
|
||||
investigate_log(logmsg, INVESTIGATE_ATMOS)
|
||||
release_log += logmsg
|
||||
. = TRUE
|
||||
if("timer")
|
||||
|
||||
@@ -80,13 +80,38 @@
|
||||
/obj/machinery/portable_atmospherics/portableConnectorReturnAir()
|
||||
return air_contents
|
||||
|
||||
/obj/machinery/portable_atmospherics/AltClick(mob/living/user)
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, !ismonkey(user)))
|
||||
return
|
||||
if(holding)
|
||||
to_chat(user, "<span class='notice'>You remove [holding] from [src].</span>")
|
||||
replace_tank(user, TRUE)
|
||||
|
||||
/obj/machinery/portable_atmospherics/examine(mob/user)
|
||||
..()
|
||||
if(holding)
|
||||
to_chat(user, "<span class='notice'>\The [src] contains [holding]. Alt-click [src] to remove it.</span>")
|
||||
|
||||
/obj/machinery/portable_atmospherics/proc/replace_tank(mob/living/user, close_valve, obj/item/tank/new_tank)
|
||||
if(holding)
|
||||
holding.forceMove(drop_location())
|
||||
if(Adjacent(user) && !issilicon(user))
|
||||
user.put_in_hands(holding)
|
||||
if(new_tank)
|
||||
holding = new_tank
|
||||
else
|
||||
holding = null
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/tank))
|
||||
if(!(stat & BROKEN))
|
||||
var/obj/item/tank/T = W
|
||||
if(holding || !user.transferItemToLoc(T, src))
|
||||
if(!user.transferItemToLoc(T, src))
|
||||
return
|
||||
holding = T
|
||||
to_chat(user, "<span class='notice'>[holding ? "In one smooth motion you pop [holding] out of [src]'s connector and replace it with [T]" : "You insert [T] into [src]"].</span>")
|
||||
replace_tank(user, FALSE, T)
|
||||
update_icon()
|
||||
else if(istype(W, /obj/item/wrench))
|
||||
if(!(stat & BROKEN))
|
||||
|
||||
@@ -67,6 +67,16 @@
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/replace_tank(mob/living/user, close_valve)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(close_valve)
|
||||
if(on)
|
||||
on = FALSE
|
||||
update_icon()
|
||||
else if(on && holding && direction == PUMP_OUT)
|
||||
investigate_log("[key_name(user)] started a transfer into [holding].<br>", INVESTIGATE_ATMOS)
|
||||
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
@@ -105,11 +115,15 @@
|
||||
var/area/A = get_area(src)
|
||||
message_admins("[ADMIN_LOOKUPFLW(usr)] turned on a pump that contains [n2o ? "N2O" : ""][n2o && plasma ? " & " : ""][plasma ? "Plasma" : ""] at [A][ADMIN_JMP(src)]")
|
||||
log_admin("[key_name(usr)] turned on a pump that contains [n2o ? "N2O" : ""][n2o && plasma ? " & " : ""][plasma ? "Plasma" : ""] at [A][COORD(src)]")
|
||||
else if(on && direction == PUMP_OUT)
|
||||
investigate_log("[key_name(usr)] started a transfer into [holding].<br>", INVESTIGATE_ATMOS)
|
||||
. = TRUE
|
||||
if("direction")
|
||||
if(direction == PUMP_OUT)
|
||||
direction = PUMP_IN
|
||||
else
|
||||
if(on && holding)
|
||||
investigate_log("[key_name(usr)] started a transfer into [holding].<br>", INVESTIGATE_ATMOS)
|
||||
direction = PUMP_OUT
|
||||
. = TRUE
|
||||
if("pressure")
|
||||
|
||||
Reference in New Issue
Block a user