mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Removes pipe pressure check copypaste. Fixes pipe caps to always be removable.
This commit is contained in:
@@ -124,4 +124,11 @@ obj/machinery/atmospherics/proc/check_connect_types(obj/machinery/atmospherics/a
|
|||||||
/obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference)
|
/obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference)
|
||||||
|
|
||||||
/obj/machinery/atmospherics/update_icon()
|
/obj/machinery/atmospherics/update_icon()
|
||||||
return null
|
return null
|
||||||
|
|
||||||
|
/obj/machinery/atmospherics/proc/can_unwrench()
|
||||||
|
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)
|
||||||
|
return 0
|
||||||
|
return 1
|
||||||
@@ -242,10 +242,8 @@
|
|||||||
if (unlocked)
|
if (unlocked)
|
||||||
user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>"
|
user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>"
|
||||||
return 1
|
return 1
|
||||||
var/datum/gas_mixture/int_air = return_air()
|
if(!can_unwrench())
|
||||||
var/datum/gas_mixture/env_air = loc.return_air()
|
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>")
|
||||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
|
||||||
user << "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>"
|
|
||||||
add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
return 1
|
return 1
|
||||||
playsound(src, W.usesound, 50, 1)
|
playsound(src, W.usesound, 50, 1)
|
||||||
|
|||||||
@@ -221,10 +221,8 @@ Thus, the two variables affect pump operation are set in New():
|
|||||||
if (!(stat & NOPOWER) && use_power)
|
if (!(stat & NOPOWER) && use_power)
|
||||||
user << "<span class='warning'>You cannot unwrench this [src], turn it off first.</span>"
|
user << "<span class='warning'>You cannot unwrench this [src], turn it off first.</span>"
|
||||||
return 1
|
return 1
|
||||||
var/datum/gas_mixture/int_air = return_air()
|
if(!can_unwrench())
|
||||||
var/datum/gas_mixture/env_air = loc.return_air()
|
to_chat(user, "<span class='warning'>You cannot unwrench this [src], it too exerted due to internal pressure.</span>")
|
||||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
|
||||||
user << "<span class='warning'>You cannot unwrench this [src], it too exerted due to internal pressure.</span>"
|
|
||||||
add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
return 1
|
return 1
|
||||||
playsound(src, W.usesound, 50, 1)
|
playsound(src, W.usesound, 50, 1)
|
||||||
|
|||||||
@@ -82,12 +82,8 @@
|
|||||||
if(!istype(W, /obj/item/weapon/wrench))
|
if(!istype(W, /obj/item/weapon/wrench))
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
var/int_pressure = 0
|
if(!can_unwrench())
|
||||||
for(var/datum/omni_port/P in ports)
|
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>")
|
||||||
int_pressure += P.air.return_pressure()
|
|
||||||
var/datum/gas_mixture/env_air = loc.return_air()
|
|
||||||
if ((int_pressure - env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
|
||||||
user << "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>"
|
|
||||||
add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
return 1
|
return 1
|
||||||
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
|
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
|
||||||
@@ -100,6 +96,15 @@
|
|||||||
new /obj/item/pipe(loc, make_from=src)
|
new /obj/item/pipe(loc, make_from=src)
|
||||||
qdel(src)
|
qdel(src)
|
||||||
|
|
||||||
|
/obj/machinery/atmospherics/omni/can_unwrench()
|
||||||
|
var/int_pressure = 0
|
||||||
|
for(var/datum/omni_port/P in ports)
|
||||||
|
int_pressure += P.air.return_pressure()
|
||||||
|
var/datum/gas_mixture/env_air = loc.return_air()
|
||||||
|
if((int_pressure - env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||||
|
return 0
|
||||||
|
return 1
|
||||||
|
|
||||||
/obj/machinery/atmospherics/omni/attack_hand(user as mob)
|
/obj/machinery/atmospherics/omni/attack_hand(user as mob)
|
||||||
if(..())
|
if(..())
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -136,10 +136,8 @@
|
|||||||
return 1
|
return 1
|
||||||
if (locate(/obj/machinery/portable_atmospherics, src.loc))
|
if (locate(/obj/machinery/portable_atmospherics, src.loc))
|
||||||
return 1
|
return 1
|
||||||
var/datum/gas_mixture/int_air = return_air()
|
if(!can_unwrench())
|
||||||
var/datum/gas_mixture/env_air = loc.return_air()
|
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>")
|
||||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
|
||||||
user << "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>"
|
|
||||||
add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
return 1
|
return 1
|
||||||
playsound(src, W.usesound, 50, 1)
|
playsound(src, W.usesound, 50, 1)
|
||||||
|
|||||||
@@ -131,10 +131,8 @@
|
|||||||
/obj/machinery/atmospherics/trinary/filter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
/obj/machinery/atmospherics/trinary/filter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||||
if (!istype(W, /obj/item/weapon/wrench))
|
if (!istype(W, /obj/item/weapon/wrench))
|
||||||
return ..()
|
return ..()
|
||||||
var/datum/gas_mixture/int_air = return_air()
|
if(!can_unwrench())
|
||||||
var/datum/gas_mixture/env_air = loc.return_air()
|
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>")
|
||||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
|
||||||
user << "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>"
|
|
||||||
add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
return 1
|
return 1
|
||||||
playsound(src, W.usesound, 50, 1)
|
playsound(src, W.usesound, 50, 1)
|
||||||
|
|||||||
@@ -106,10 +106,8 @@
|
|||||||
/obj/machinery/atmospherics/trinary/mixer/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
/obj/machinery/atmospherics/trinary/mixer/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||||
if (!istype(W, /obj/item/weapon/wrench))
|
if (!istype(W, /obj/item/weapon/wrench))
|
||||||
return ..()
|
return ..()
|
||||||
var/datum/gas_mixture/int_air = return_air()
|
if(!can_unwrench())
|
||||||
var/datum/gas_mixture/env_air = loc.return_air()
|
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>")
|
||||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
|
||||||
user << "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>"
|
|
||||||
add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
return 1
|
return 1
|
||||||
playsound(src, W.usesound, 50, 1)
|
playsound(src, W.usesound, 50, 1)
|
||||||
|
|||||||
@@ -348,10 +348,8 @@
|
|||||||
if (istype(src, /obj/machinery/atmospherics/tvalve/digital))
|
if (istype(src, /obj/machinery/atmospherics/tvalve/digital))
|
||||||
user << "<span class='warning'>You cannot unwrench \the [src], it's too complicated.</span>"
|
user << "<span class='warning'>You cannot unwrench \the [src], it's too complicated.</span>"
|
||||||
return 1
|
return 1
|
||||||
var/datum/gas_mixture/int_air = return_air()
|
if(!can_unwrench())
|
||||||
var/datum/gas_mixture/env_air = loc.return_air()
|
to_chat(user, "<span class='warnng'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>")
|
||||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
|
||||||
user << "<span class='warnng'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>"
|
|
||||||
add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
return 1
|
return 1
|
||||||
playsound(src, W.usesound, 50, 1)
|
playsound(src, W.usesound, 50, 1)
|
||||||
|
|||||||
@@ -72,9 +72,7 @@
|
|||||||
if (level==1 && isturf(T) && !T.is_plating())
|
if (level==1 && isturf(T) && !T.is_plating())
|
||||||
user << "<span class='warning'>You must remove the plating first.</span>"
|
user << "<span class='warning'>You must remove the plating first.</span>"
|
||||||
return 1
|
return 1
|
||||||
var/datum/gas_mixture/int_air = return_air()
|
if (!can_unwrench())
|
||||||
var/datum/gas_mixture/env_air = loc.return_air()
|
|
||||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
|
||||||
user << "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>"
|
user << "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>"
|
||||||
add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
@@ -401,10 +401,8 @@
|
|||||||
if (node && node.level==1 && isturf(T) && !T.is_plating())
|
if (node && node.level==1 && isturf(T) && !T.is_plating())
|
||||||
user << "<span class='warning'>You must remove the plating first.</span>"
|
user << "<span class='warning'>You must remove the plating first.</span>"
|
||||||
return 1
|
return 1
|
||||||
var/datum/gas_mixture/int_air = return_air()
|
if(!can_unwrench())
|
||||||
var/datum/gas_mixture/env_air = loc.return_air()
|
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>")
|
||||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
|
||||||
user << "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>"
|
|
||||||
add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
return 1
|
return 1
|
||||||
playsound(src, W.usesound, 50, 1)
|
playsound(src, W.usesound, 50, 1)
|
||||||
|
|||||||
@@ -272,10 +272,8 @@
|
|||||||
if (node && node.level==1 && isturf(T) && !T.is_plating())
|
if (node && node.level==1 && isturf(T) && !T.is_plating())
|
||||||
user << "<span class='warning'>You must remove the plating first.</span>"
|
user << "<span class='warning'>You must remove the plating first.</span>"
|
||||||
return 1
|
return 1
|
||||||
var/datum/gas_mixture/int_air = return_air()
|
if(!can_unwrench())
|
||||||
var/datum/gas_mixture/env_air = loc.return_air()
|
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>")
|
||||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
|
||||||
user << "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>"
|
|
||||||
add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
return 1
|
return 1
|
||||||
playsound(src, W.usesound, 50, 1)
|
playsound(src, W.usesound, 50, 1)
|
||||||
|
|||||||
@@ -292,10 +292,8 @@
|
|||||||
if (istype(src, /obj/machinery/atmospherics/valve/digital) && !src.allowed(user))
|
if (istype(src, /obj/machinery/atmospherics/valve/digital) && !src.allowed(user))
|
||||||
user << "<span class='warning'>Access denied.</span>"
|
user << "<span class='warning'>Access denied.</span>"
|
||||||
return 1
|
return 1
|
||||||
var/datum/gas_mixture/int_air = return_air()
|
if(!can_unwrench())
|
||||||
var/datum/gas_mixture/env_air = loc.return_air()
|
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>")
|
||||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
|
||||||
user << "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>"
|
|
||||||
add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
return 1
|
return 1
|
||||||
playsound(src, W.usesound, 50, 1)
|
playsound(src, W.usesound, 50, 1)
|
||||||
|
|||||||
@@ -82,10 +82,8 @@
|
|||||||
if (level==1 && isturf(T) && !T.is_plating())
|
if (level==1 && isturf(T) && !T.is_plating())
|
||||||
user << "<span class='warning'>You must remove the plating first.</span>"
|
user << "<span class='warning'>You must remove the plating first.</span>"
|
||||||
return 1
|
return 1
|
||||||
var/datum/gas_mixture/int_air = return_air()
|
if(!can_unwrench())
|
||||||
var/datum/gas_mixture/env_air = loc.return_air()
|
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>")
|
||||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
|
||||||
user << "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>"
|
|
||||||
add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
return 1
|
return 1
|
||||||
playsound(src, W.usesound, 50, 1)
|
playsound(src, W.usesound, 50, 1)
|
||||||
@@ -1014,6 +1012,9 @@
|
|||||||
if(level == 1 && !T.is_plating()) hide(1)
|
if(level == 1 && !T.is_plating()) hide(1)
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
|
/obj/machinery/atmospherics/pipe/cap/can_unwrench()
|
||||||
|
return 1
|
||||||
|
|
||||||
/obj/machinery/atmospherics/pipe/cap/visible
|
/obj/machinery/atmospherics/pipe/cap/visible
|
||||||
level = 2
|
level = 2
|
||||||
icon_state = "cap"
|
icon_state = "cap"
|
||||||
|
|||||||
Reference in New Issue
Block a user