Skip to content

Commit

Permalink
Unwrenching atmos devices ignores pressure (VestaOfOrion#348)
Browse files Browse the repository at this point in the history
* Unwrenching atmos devices ignores pressure

* Das changelog (and code fixes)
  • Loading branch information
EvenInDeathIStillServe authored Feb 21, 2021
1 parent c6a2800 commit 535e905
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,13 @@
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
var/wrench_time = 40
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
to_chat(user, "<span class='warning'>\The [src] seems highly pressurized!</span>")
wrench_time = 80
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
if (do_after(user, 40, src))
if (do_after(user, wrench_time, src))
user.visible_message( \
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
Expand Down
6 changes: 1 addition & 5 deletions code/modules/atmospherics/components/binary_devices/pump.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Thus, the two variables affect pump operation are set in New():
)
public_methods = list(
/decl/public_access/public_method/toggle_power,
/decl/public_access/public_method/refresh
/decl/public_access/public_method/refresh
)
stock_part_presets = list(
/decl/stock_part_preset/radio/receiver/pump = 1,
Expand Down Expand Up @@ -176,10 +176,6 @@ Thus, the two variables affect pump operation are set in New():
if(state_path == /decl/machine_construction/default/deconstructed)
if (!(stat & NOPOWER) && use_power)
return SPAN_WARNING("You cannot take this [src] apart, turn it off first.")
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 SPAN_WARNING("You cannot take this [src] apart, it too exerted due to internal pressure.")
return ..()

/decl/public_access/public_variable/pump_target_output
Expand Down
10 changes: 5 additions & 5 deletions code/modules/atmospherics/components/omni_devices/omni_base.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
initialize_directions = 0
level = 1
layer = ABOVE_CATWALK_LAYER

var/configuring = 0

var/tag_north = ATM_NONE
Expand Down Expand Up @@ -84,13 +84,13 @@
for(var/datum/omni_port/P in ports)
int_pressure += P.air.return_pressure()
var/datum/gas_mixture/env_air = loc.return_air()
var/wrench_time = 40
if ((int_pressure - env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
to_chat(user, "<span class='warning'>\The [src] seems highly pressurized!</span>")
wrench_time = 80
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 40, src))
if(do_after(user, wrench_time, src))
user.visible_message( \
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
Expand Down
8 changes: 4 additions & 4 deletions code/modules/atmospherics/components/portables_connector.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
var/wrench_time = 40
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
to_chat(user, "<span class='warning'>\The [src] seems highly pressurized!</span>")
wrench_time = 80
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
if (do_after(user, 40, src))
if (do_after(user, wrench_time, src))
user.visible_message( \
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
Expand Down
14 changes: 7 additions & 7 deletions code/modules/atmospherics/components/tvalve.dm
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,13 @@
return ..()
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
var/wrench_time = 40
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
to_chat(user, "<span class='warnng'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
to_chat(user, "<span class='warning'>\The [src] seems highly pressurized!</span>")
wrench_time = 80
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
if (do_after(user, 40, src))
if (do_after(user, wrench_time, src))
user.visible_message( \
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
Expand Down Expand Up @@ -317,10 +317,10 @@
"valve_toggle" = /decl/public_access/public_method/tvalve_toggle
)

//Mirrored editions
//Mirrored editions
/obj/machinery/atmospherics/tvalve/mirrored
icon_state = "map_tvalvem0"

connect_dir_type = SOUTH | EAST | NORTH
build_icon_state = "map_tvalvem0"

Expand Down Expand Up @@ -349,7 +349,7 @@
desc = "A digitally controlled valve."
icon = 'icons/atmos/digital_tvalve.dmi'
icon_state = "map_tvalve0"

build_icon = 'icons/atmos/digital_tvalve.dmi'
build_icon_state = "map_tvalve0"

Expand Down
8 changes: 4 additions & 4 deletions code/modules/atmospherics/components/unary/heat_exchanger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
var/wrench_time = 40
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
to_chat(user, "<span class='warning'>\The [src] seems highly pressurized!</span>")
wrench_time = 80
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
if (do_after(user, 40, src))
if (do_after(user, wrench_time, src))
user.visible_message( \
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
Expand Down
8 changes: 4 additions & 4 deletions code/modules/atmospherics/components/unary/vent_pump.dm
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,13 @@
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
var/wrench_time = 40
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
to_chat(user, "<span class='warning'>\The [src] seems highly pressurized!</span>")
wrench_time = 80
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
if (do_after(user, 40, src))
if (do_after(user, wrench_time, src))
user.visible_message( \
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
Expand Down
4 changes: 0 additions & 4 deletions code/modules/atmospherics/components/unary/vent_scrubber.dm
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,6 @@
var/turf/T = get_turf(src)
if (node && node.level==1 && isturf(T) && !T.is_plating())
return SPAN_WARNING("You must remove the plating first.")
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 SPAN_WARNING("You cannot take this [src] apart, it too exerted due to internal pressure.")
return ..()

/obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
Expand Down
10 changes: 5 additions & 5 deletions code/modules/atmospherics/components/valve.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
dir = SOUTH
initialize_directions = SOUTH|NORTH
layer = ABOVE_CATWALK_LAYER

var/open = 0
var/openDuringInit = 0

Expand Down Expand Up @@ -214,13 +214,13 @@
return ..()
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
var/wrench_time = 40
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
to_chat(user, "<span class='warning'>\The [src] seems highly pressurized!</span>")
wrench_time = 80
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
if (do_after(user, 40, src))
if (do_after(user, wrench_time, src))
user.visible_message( \
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
Expand Down
5 changes: 5 additions & 0 deletions html/changelogs/evenindeathistillserve-PR-348.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
author: EvenInDeathIStillServe

delete-after: True
changes:
- tweak: "Unwrenching atmos devices is possible in high pressure, but takes longer."

0 comments on commit 535e905

Please sign in to comment.