From 3a89d01ea0d57ee03db441eb784e9565d97f478c Mon Sep 17 00:00:00 2001 From: Bedshaped Date: Wed, 21 Dec 2016 19:46:13 +0000 Subject: [PATCH] Bayport - welded scrubbers (#1160) Port is credit to Zuhayr changes: rscadd: "Bayport: Scrubbers are now weldable." bugfix: "Fixed incorrect messages when welding vents." --- .../components/unary/unary_base.dm | 12 ++- .../components/unary/vent_pump.dm | 15 ++- .../components/unary/vent_scrubber.dm | 86 ++++++++++++------ code/modules/ventcrawl/ventcrawl.dm | 4 +- .../ventcrawl/ventcrawl_atmospherics.dm | 2 +- html/changelogs/Bedshaped-PR-1160.yml | 7 ++ icons/atmos/vent_scrubber.dmi | Bin 1221 -> 1241 bytes 7 files changed, 86 insertions(+), 40 deletions(-) create mode 100644 html/changelogs/Bedshaped-PR-1160.yml diff --git a/code/ATMOSPHERICS/components/unary/unary_base.dm b/code/ATMOSPHERICS/components/unary/unary_base.dm index eea2dba1abf..d828ef0c8cb 100644 --- a/code/ATMOSPHERICS/components/unary/unary_base.dm +++ b/code/ATMOSPHERICS/components/unary/unary_base.dm @@ -90,4 +90,14 @@ update_icon() update_underlays() - return null \ No newline at end of file + return null + +/obj/machinery/atmospherics/unary/vent_pump/proc/is_welded() // TODO: refactor welding into unary + if (welded > 0) + return 1 + return 0 + +/obj/machinery/atmospherics/unary/vent_scrubber/proc/is_welded() + if (welded > 0) + return 1 + return 0 \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index 8c653004b14..b4165b91796 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -351,32 +351,29 @@ /obj/machinery/atmospherics/unary/vent_pump/attackby(obj/item/W, mob/user) if(istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W - if (WT.remove_fuel(0,user)) + if (!WT.welding) + user << "\The [WT] must be turned on!" + else if (WT.remove_fuel(0,user)) user << "Now welding the vent." if(do_after(user, 20)) if(!src || !WT.isOn()) return playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) if(!welded) - user.visible_message("\The [user] welds the vent shut.", "You weld the vent shut.", "You hear welding.") + user.visible_message("\The [user] welds \the [src] shut.", "You weld \the [src] shut.", "You hear welding.") welded = 1 update_icon() else - user.visible_message("[user] unwelds the vent.", "You unweld the vent.", "You hear welding.") + user.visible_message("[user] unwelds \the [src].", "You unweld \the [src].", "You hear welding.") welded = 0 update_icon() else - user << "The welding tool needs to be on to start this task." + user << "You fail to complete the welding." else user << "You need more welding fuel to complete this task." return 1 else ..() -/obj/machinery/atmospherics/unary/vent_pump/proc/is_welded() - if (welded > 0) - return 1 - return 0 - /obj/machinery/atmospherics/unary/vent_pump/examine(mob/user) if(..(user, 1)) user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W" diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm index 028d2dac5d5..6e445bed48a 100644 --- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm @@ -27,6 +27,8 @@ var/radio_filter_out var/radio_filter_in + var/welded = 0 + /obj/machinery/atmospherics/unary/vent_scrubber/on use_power = 1 icon_state = "map_scrubber_on" @@ -53,16 +55,18 @@ overlays.Cut() - var/scrubber_icon = "scrubber" - var/turf/T = get_turf(src) if(!istype(T)) return - if(!powered()) - scrubber_icon += "off" + var/scrubber_icon = "scrubber" + if(welded) + scrubber_icon += "weld" else - scrubber_icon += "[use_power ? "[scrubbing ? "on" : "in"]" : "off"]" + if(!powered()) + scrubber_icon += "off" + else + scrubber_icon += "[use_power ? "[scrubbing ? "on" : "in"]" : "off"]" overlays += icon_manager.get_atmos_icon("device", , , scrubber_icon) @@ -135,6 +139,8 @@ //broadcast_status() if(!use_power || (stat & (NOPOWER|BROKEN))) return 0 + if(welded) + return 0 var/datum/gas_mixture/environment = loc.return_air() @@ -253,36 +259,62 @@ update_icon() /obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if (!istype(W, /obj/item/weapon/wrench)) - return ..() - if (!(stat & NOPOWER) && use_power) - user << "You cannot unwrench \the [src], turn it off first." + if (istype(W, /obj/item/weapon/wrench)) + if (!(stat & NOPOWER) && use_power) + user << "You cannot unwrench \the [src], turn it off first." + return 1 + var/turf/T = src.loc + if (node && node.level==1 && isturf(T) && !T.is_plating()) + user << "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 << "You cannot unwrench \the [src], it is too exerted due to internal pressure." + add_fingerprint(user) + return 1 + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) + user << "You begin to unfasten \the [src]..." + if (do_after(user, 40)) + user.visible_message( \ + "\The [user] unfastens \the [src].", \ + "You have unfastened \the [src].", \ + "You hear a ratchet.") + new /obj/item/pipe(loc, make_from=src) + qdel(src) return 1 - var/turf/T = src.loc - if (node && node.level==1 && isturf(T) && !T.is_plating()) - user << "You must remove the plating first." + + if(istype(W, /obj/item/weapon/weldingtool)) + var/obj/item/weapon/weldingtool/WT = W + if (!WT.welding) + user << "\The [WT] must be turned on!" + else if (WT.remove_fuel(0,user)) + user << "Now welding \the [src]." + if(do_after(user, 20)) + if(!src || !WT.isOn()) return + playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) + if(!welded) + user.visible_message("\The [user] welds \the [src] shut.", "You weld \the [src] shut.", "You hear welding.") + welded = 1 + update_icon() + else + user.visible_message("[user] unwelds \the [src].", "You unweld \the [src].", "You hear welding.") + welded = 0 + update_icon() + else + user << "You fail to complete the welding." + else + user << "You need more welding fuel to complete this task." 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 << "You cannot unwrench \the [src], it is too exerted due to internal pressure." - add_fingerprint(user) - return 1 - playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) - user << "You begin to unfasten \the [src]..." - if (do_after(user, 40)) - user.visible_message( \ - "\The [user] unfastens \the [src].", \ - "You have unfastened \the [src].", \ - "You hear a ratchet.") - new /obj/item/pipe(loc, make_from=src) - qdel(src) + return ..() /obj/machinery/atmospherics/unary/vent_scrubber/examine(mob/user) if(..(user, 1)) user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W" else user << "You are too far away to read the gauge." + if(welded) + user << "It seems welded shut." /obj/machinery/atmospherics/unary/vent_scrubber/Destroy() if(initial_loc) diff --git a/code/modules/ventcrawl/ventcrawl.dm b/code/modules/ventcrawl/ventcrawl.dm index ae6650d2572..6bc2058eb55 100644 --- a/code/modules/ventcrawl/ventcrawl.dm +++ b/code/modules/ventcrawl/ventcrawl.dm @@ -4,7 +4,7 @@ var/list/ventcrawl_machinery = list( ) // Vent crawling whitelisted items, whoo -/mob/living/var/list/can_enter_vent_with = list( +var/global/list/can_enter_vent_with = list( /obj/item/device/mmi, /obj/item/weapon/implant, /obj/item/device/radio/borg, @@ -154,7 +154,7 @@ var/list/ventcrawl_machinery = list( if(vent_found) break - if(istype(vent_found, /obj/machinery/atmospherics/unary/vent_pump/) && vent_found:is_welded()) // welded check + if(vent_found:is_welded()) // welded check src << "You can't crawl into a welded vent!" return diff --git a/code/modules/ventcrawl/ventcrawl_atmospherics.dm b/code/modules/ventcrawl/ventcrawl_atmospherics.dm index 32f32452381..8fbe09de014 100644 --- a/code/modules/ventcrawl/ventcrawl_atmospherics.dm +++ b/code/modules/ventcrawl/ventcrawl_atmospherics.dm @@ -31,7 +31,7 @@ /obj/machinery/atmospherics/proc/ventcrawl_to(var/mob/living/user, var/obj/machinery/atmospherics/target_move, var/direction) if(target_move) if(is_type_in_list(target_move, ventcrawl_machinery) && target_move.can_crawl_through()) - if(istype(target_move, /obj/machinery/atmospherics/unary/vent_pump/) && target_move:is_welded()) + if(target_move:is_welded()) user.visible_message("You hear something banging on \the [target_move.name]!", "You can't escape from a welded vent.") else user.remove_ventcrawl() diff --git a/html/changelogs/Bedshaped-PR-1160.yml b/html/changelogs/Bedshaped-PR-1160.yml new file mode 100644 index 00000000000..9303efb3a64 --- /dev/null +++ b/html/changelogs/Bedshaped-PR-1160.yml @@ -0,0 +1,7 @@ +author: Bedshaped + +delete-after: True + +changes: + - rscadd: "Bayport: Scrubbers are now weldable." + - bugfix: "Fixed incorrect messages when welding vents." diff --git a/icons/atmos/vent_scrubber.dmi b/icons/atmos/vent_scrubber.dmi index 5a40660157810e387599fa020da0994e7d88e83b..ca93817aa2a3544e56f77742c455d321b6fd05f4 100644 GIT binary patch delta 1009 zcmVBh0Aw3j%B#YUh5!Hqlu1NERCt{2TZ?joAP|gs5X_?yBZ>U~kM=+sMS;^2 zbDb&IF&(?NasdT)oo+TuqS)^C#UjR=g0gKP zM4$@$=Q@z^;@1ej_9s+-_j^-SoC)~hRn^?@frQ$h(DUmkpF;!Omrw!B8Ec@xhQTG8 z=>=?p5Wa*T7ce$zBkNchxO7+)Zskjmdw29^?VDNVv;jH3yue82&I zKnVQ-37!i;g6LwJ(D8fNQ$V}{U7r-s=hGZgSGbubJODI@9DRj<$^(1&kp^^qLmVm` zU!ZYX&|g7MTScMgF7y2ycv1k;0Cb!j;1bT=3)DKHZ$aw$puArBe$TJhQa}F=4Cf<$ zU7H4^Z2->Q0+<=R$D`E41i{7yFgw6y_Y2Oe@^(4ycE`&N3ShMZ!}(@W16YBt9+1Nx zIG@>e%g*Ov4@iH14`5yVyL;g4bSR3$>FW*m0R2-yJ`a%3gyd@hvRJ)mHH<8`*mC`@ z{Xk^H5#O-9ZATQ|a(yHy+qM-DZ@cM*2f6ej7oX(v8w>IR$%lyiCMADNsVAyGuuR~q zVMyPn@@MV`LJ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