Cleanup of pipe unwrenching code.

Fixes #1509

Signed-off-by: Mloc-Argent <colmohici@gmail.com>
This commit is contained in:
Mloc-Argent
2013-10-12 17:24:54 +01:00
parent bc087e7bdd
commit a3867b46a6
12 changed files with 70 additions and 239 deletions

View File

@@ -7,6 +7,8 @@ obj/machinery/atmospherics/binary/passive_gate
name = "Passive gate"
desc = "A one-way air valve that does not require power"
can_unwrench = 1
var/on = 0
var/target_pressure = ONE_ATMOSPHERE
@@ -166,23 +168,4 @@ obj/machinery/atmospherics/binary/passive_gate
if (on)
user << "\red You cannot unwrench this [src], turn it off first."
return 1
var/turf/T = src.loc
if (level==1 && isturf(T) && T.intact)
user << "\red You must remove the plating first."
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
add_fingerprint(user)
return 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to unfasten \the [src]..."
if (do_after(user, 40))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
del(src)
return ..()