From b96f5ea7efb1b3718eccf0867ffff05b8a7a8bec Mon Sep 17 00:00:00 2001 From: ComicIronic Date: Mon, 20 Apr 2015 14:44:52 -0700 Subject: [PATCH] OOP pipe-crawling procs You can now weld scrubbers, which stops their airflow and also crawling through them. There is now a proc for if a mob can ventcrawl through a pipe. --- code/ATMOSPHERICS/atmospherics.dm | 11 ++++-- .../components/unary/vent_pump.dm | 3 ++ .../components/unary/vent_scrubber.dm | 36 ++++++++++++++++-- code/modules/mob/living/carbon/carbon.dm | 13 ++++--- icons/atmos/vent_scrubber.dmi | Bin 1032 -> 3984 bytes 5 files changed, 50 insertions(+), 13 deletions(-) diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 2444031a8c2..84cfa9a8264 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -156,21 +156,24 @@ obj/machinery/atmospherics/proc/check_connect_types_construction(obj/machinery/a var/obj/machinery/atmospherics/target_move = findConnecting(direction) if(target_move) - if(is_type_in_list(target_move, ventcrawl_machinery)) + if(is_type_in_list(target_move, ventcrawl_machinery) && target_move.can_crawl_through()) user.remove_ventcrawl() user.forceMove(target_move.loc) //handles entering and so on user.visible_message("You hear something squeezing through the ducts.", "You climb out the ventilation system.") - else + else if(target_move.can_crawl_through()) user.loc = target_move user.client.eye = target_move //if we don't do this, Byond only updates the eye every tick - required for smooth movement if(world.time - user.last_played_vent > VENT_SOUND_DELAY) user.last_played_vent = world.time playsound(src, 'sound/machines/ventcrawl.ogg', 50, 1, -3) else - if((direction & initialize_directions) || is_type_in_list(src, ventcrawl_machinery)) //if we move in a way the pipe can connect, but doesn't - or we're in a vent + if((direction & initialize_directions) || is_type_in_list(src, ventcrawl_machinery) && target_move.can_crawl_through()) //if we move in a way the pipe can connect, but doesn't - or we're in a vent user.remove_ventcrawl() user.forceMove(src.loc) user.visible_message("You hear something squeezing through the pipes.", "You climb out the ventilation system.") user.canmove = 0 spawn(1) - user.canmove = 1 \ No newline at end of file + user.canmove = 1 + +/obj/machinery/atmospherics/proc/can_crawl_through() + return 1 \ 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 a96d5b1acd4..4c6a529e3bb 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -307,6 +307,9 @@ update_icon() return +/obj/machinery/atmospherics/unary/vent_pump/can_crawl_through() + return !welded + /obj/machinery/atmospherics/unary/vent_pump/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm index 05d60c80c96..23b1f7899de 100644 --- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm @@ -23,13 +23,14 @@ var/volume_rate = 120 var/panic = 0 //is this scrubber panicked? + var/welded = 0 var/area_uid var/radio_filter_out var/radio_filter_in connect_types = list(1,3) //connects to regular and scrubber pipes - + /obj/machinery/atmospherics/unary/vent_scrubber/New() icon = null @@ -50,7 +51,7 @@ return overlays.Cut() - + var/scrubber_icon = "scrubber" var/turf/T = get_turf(src) @@ -61,6 +62,8 @@ scrubber_icon += "off" else scrubber_icon += "[on ? "[scrubbing ? "on" : "in"]" : "off"]" + if(welded) + scrubber_icon = "scrubberweld" overlays += icon_manager.get_atmos_icon("device", , , scrubber_icon) @@ -127,6 +130,8 @@ return if (!node) on = 0 + if(welded) + return 0 //broadcast_status() if(!on) return 0 @@ -151,7 +156,7 @@ removed.oxygen = 0 if(scrub_N2) filtered_out.nitrogen = removed.nitrogen - removed.nitrogen = 0 + removed.nitrogen = 0 if(scrub_Toxins) filtered_out.toxins = removed.toxins removed.toxins = 0 @@ -229,7 +234,7 @@ scrubbing = text2num(signal.data["scrubbing"]) if(signal.data["toggle_scrubbing"]) scrubbing = !scrubbing - + if(signal.data["o2_scrub"] != null) scrub_O2 = text2num(signal.data["o2_scrub"]) if(signal.data["toggle_o2_scrub"]) @@ -276,7 +281,30 @@ if(old_stat != stat) update_icon() +/obj/machinery/atmospherics/unary/vent_scrubber/can_crawl_through() + return !welded + /obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) + if(istype(W, /obj/item/weapon/weldingtool)) + var/obj/item/weapon/weldingtool/WT = W + if (WT.remove_fuel(0,user)) + user << "Now welding the scrubber." + if(do_after(user, 20)) + if(!src || !WT.isOn()) return + playsound(get_turf(src), 'sound/items/Welder2.ogg', 50, 1) + if(!welded) + user.visible_message("[user] welds the scrubber shut.", "You weld the vent scrubber.", "You hear welding.") + welded = 1 + update_icon() + else + user.visible_message("[user] unwelds the scrubber.", "You unweld the scrubber.", "You hear welding.") + welded = 0 + update_icon() + else + user << "The welding tool needs to be on to start this task." + else + user << "You need more welding fuel to complete this task." + return 1 if (!istype(W, /obj/item/weapon/wrench)) return ..() if (!(stat & NOPOWER) && on) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 2a8f173eb2f..c99cf3e2b31 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -271,19 +271,22 @@ mob/living var/obj/machinery/atmospherics/unary/vent_found if(clicked_on && Adjacent(clicked_on)) - var/obj/machinery/atmospherics/unary/vent_pump/v = clicked_on - if(!istype(v) || !v.welded) - vent_found = clicked_on + vent_found = clicked_on + if(!istype(vent_found) || !vent_found.can_crawl_through()) + vent_found = null + if(!vent_found) for(var/obj/machinery/atmospherics/machine in range(1,src)) if(is_type_in_list(machine, ventcrawl_machinery)) vent_found = machine - var/obj/machinery/atmospherics/unary/vent_pump/v = machine - if(istype(v) && v.welded) + if(!vent_found.can_crawl_through()) vent_found = null + if(vent_found) + break + if(vent_found) if(vent_found.network && (vent_found.network.normal_members.len || vent_found.network.line_members.len)) diff --git a/icons/atmos/vent_scrubber.dmi b/icons/atmos/vent_scrubber.dmi index e8e7f91640877a551bf139d8191cca32502fca5d..f1d3c3cba6d194e05df8148c44b1c75db076be9a 100644 GIT binary patch literal 3984 zcmZ9Pc{o(<|Hsb^W*GaL$Wqy5D-S|u)L0+;GRit+?U9`*#*i&SNR~`gBzZ&>$}(dK zi73f37#@$M5N5;-!~D+keE;};f4}QG=iK*o&VAk2{dwQ7&*y%hJ9ai^ya)*d006ue z=4c17#s712!oX*bk@rWiDZA-(ISTC;c{L&^EGj581OQ^oQa=$9-J0U;Tjwc`CpJ{R z1WGlTXZZ$t89UI%Vf$wJf!iBWBKjO}zt7(YJOAmINy~EyYmMD5wR0ka3C2FrI(&9| z(&jwtKQA#K2w3|n`4+^v_Y5Q3auQ6t^<^sT@>e@b^iakjvEL7d2U1E{LPfHQLJ!Pn zX~{E(jdd95>p#46-qqRtR%*m}YVLhh`V$2JeDxM+W2e}%4G-(U(`I5vzV-00XtwL{ zepA)D<3qB(9{yPNz7+O&bH36n==q=TdFFcdUz9~4&iq;buDAH@`pI-u)E%z#=zHgt zpla*xhSukJ6b1y(Y2D>mlP))OKUDp`iiKV8jiLjM$RPO8UT;SWN(s6KWja%OYBl0gcwyR#JhY?bhEP zgaHzR!MLwh>M`Wby|uN_0}1o^zO&Hs``vW(eKSZ*;R}U=byf&5lp#q;WOdXZq!4%+ zOMdO`t(?O!-J|+v4x^tw8Ag&}_yQU`5;hsG7+PjkJr=wD7Y9(`P=gxN*8UM4d_A;@ z$cUFdI5+_CzkWqW=}Q49B87iAtpLM)BlEpoaM&7hYQB(66+^+~3M~GtuW#BYwB!IU z4Gs0M>dU;0U0;T0 zbX&KV$Ao?Dctwya)&*Ze8_CJtUZ-E4%%zyRuuaV$8++|7G}EkxFNBzm>KF+rBMy^S zFz-AJ=aYZDo)8{fjrr{8yl{;Z(ax*-LM6V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