mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-25 13:09:11 +01:00
Merge pull request #14844 from ReoDaProtovali/PickUpThatCan
Allows you to deconstruct canisters
This commit is contained in:
@@ -239,6 +239,22 @@ update_flag
|
||||
..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/weldingtool)) //Vorestart: Deconstructable Canisters
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(!WT.remove_fuel(0, user))
|
||||
to_chat(user, "The welding tool must be on to complete this task.")
|
||||
return
|
||||
if(air_contents.return_pressure() > 1 && !destroyed) // Empty or broken cans are able to be deconstructed
|
||||
to_chat(user, "<span class ='warning'>\The [src]'s internal pressure is too high! Empty the canister before attempting to weld it apart.</span>")
|
||||
return
|
||||
playsound(src, WT.usesound, 50, 1)
|
||||
if(do_after(user, 20 * WT.toolspeed))
|
||||
if(!src || !WT.isOn()) return
|
||||
to_chat(user, "<span class='notice'>You deconstruct the [src].</span>")
|
||||
new /obj/item/stack/material/steel( src.loc, 10)
|
||||
qdel(src)
|
||||
return
|
||||
//Voreend
|
||||
if(!W.is_wrench() && !istype(W, /obj/item/weapon/tank) && !istype(W, /obj/item/device/analyzer) && !istype(W, /obj/item/device/pda))
|
||||
visible_message("<span class='warning'>\The [user] hits \the [src] with \a [W]!</span>")
|
||||
src.health -= W.force
|
||||
@@ -332,7 +348,7 @@ update_flag
|
||||
pressure = 10*ONE_ATMOSPHERE
|
||||
. = TRUE
|
||||
else if(pressure == "input")
|
||||
pressure = tgui_input_number(usr, "New release pressure ([ONE_ATMOSPHERE/10]-[10*ONE_ATMOSPHERE] kPa):", name, release_pressure, 10*ONE_ATMOSPHERE, ONE_ATMOSPHERE/10)
|
||||
pressure = tgui_input_number(usr, "New release pressure ([ONE_ATMOSPHERE/10]-[10*ONE_ATMOSPHERE] kPa):", name, release_pressure, 10*ONE_ATMOSPHERE, ONE_ATMOSPHERE/10)
|
||||
if(!isnull(pressure) && !..())
|
||||
. = TRUE
|
||||
else if(text2num(pressure) != null)
|
||||
@@ -452,4 +468,4 @@ update_flag
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/take_damage(var/damage)
|
||||
src.health -= damage
|
||||
healthcheck()
|
||||
healthcheck()
|
||||
|
||||
Reference in New Issue
Block a user