diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index 582f5f2367..8457a0cc11 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -119,6 +119,9 @@ Junction
Y-Junction
Trunk
+Bin
+Outlet
+Chute
"} user << browse("[src][dat]", "window=pipedispenser") @@ -150,6 +153,15 @@ C.ptype = 4 if(4) C.ptype = 5 + if(5) + C.ptype = 6 + C.density = 1 + if(6) + C.ptype = 7 + C.density = 1 + if(7) + C.ptype = 8 + C.density = 1 C.update() wait = 1 diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm index a78088d984..718bb71bc1 100644 --- a/code/modules/recycling/disposal-construction.dm +++ b/code/modules/recycling/disposal-construction.dm @@ -1,4 +1,5 @@ // Disposal pipe construction +// This is the pipe that you drag around, not the attached ones. /obj/structure/disposalconstruct @@ -12,7 +13,7 @@ m_amt = 1850 level = 2 var/ptype = 0 - // 0=straight, 1=bent, 2=junction-j1, 3=junction-j2, 4=junction-y, 5=trunk + // 0=straight, 1=bent, 2=junction-j1, 3=junction-j2, 4=junction-y, 5=trunk, 6=disposal bin, 7=outlet, 8=inlet var/dpdir = 0 // directions as disposalpipe var/base_state = "pipe-s" @@ -42,9 +43,26 @@ if(5) base_state = "pipe-t" dpdir = dir + // disposal bin has only one dir, thus we don't need to care about setting it + if(6) + if(anchored) + base_state = "disposal" + else + base_state = "condisposal" + + if(7) + base_state = "outlet" + dpdir = dir + + if(8) + base_state = "intake" + dpdir = dir - icon_state = "con[base_state]" + if(ptype<6) + icon_state = "con[base_state]" + else + icon_state = base_state if(invisibility) // if invisible, fade icon icon -= rgb(0,0,0,128) @@ -93,6 +111,12 @@ return /obj/structure/disposalpipe/junction if(5) return /obj/structure/disposalpipe/trunk + if(6) + return /obj/machinery/disposal + if(7) + return /obj/structure/disposaloutlet + if(8) + return /obj/machinery/disposal/deliveryChute return @@ -102,48 +126,98 @@ // weldingtool: convert to real pipe attackby(var/obj/item/I, var/mob/user) + var/nicetype = "pipe" + var/ispipe = 0 // Indicates if we should change the level of this pipe + switch(ptype) + if(6) + nicetype = "disposal bin" + if(7) + nicetype = "disposal outlet" + if(8) + nicetype = "delivery chute" + else + nicetype = "pipe" + ispipe = 1 + var/turf/T = src.loc if(T.intact) - user << "You can only attach the pipe if the floor plating is removed." + user << "You can only attach the [nicetype] if the floor plating is removed." return var/obj/structure/disposalpipe/CP = locate() in T - if(CP) - update() - var/pdir = CP.dpdir - if(istype(CP, /obj/structure/disposalpipe/broken)) - pdir = CP.dir - if(pdir & dpdir) - user << "There is already a pipe at that location." + if(ptype>=6) // Disposal or outlet + if(CP) // There's something there + if(!istype(CP,/obj/structure/disposalpipe/trunk)) + user << "The [nicetype] requires a trunk underneath it in order to work." + return + else // Nothing under, fuck. + user << "The [nicetype] requires a trunk underneath it in order to work." return + else + if(CP) + update() + var/pdir = CP.dpdir + if(istype(CP, /obj/structure/disposalpipe/broken)) + pdir = CP.dir + if(pdir & dpdir) + user << "There is already a [nicetype] at that location." + return + + var/obj/structure/disposalpipe/trunk/Trunk = CP if(istype(I, /obj/item/weapon/wrench)) if(anchored) anchored = 0 - level = 2 - density = 1 - user << "You detach the pipe from the underfloor." + if(ispipe) + level = 2 + density = 0 + else + density = 1 + user << "You detach the [nicetype] from the underfloor." else anchored = 1 - level = 1 - density = 0 - user << "You attach the pipe to the underfloor." + if(ispipe) + level = 1 // We don't want disposal bins to disappear under the floors + density = 0 + else + density = 1 // We don't want disposal bins or outlets to go density 0 + user << "You attach the [nicetype] to the underfloor." playsound(src.loc, 'Ratchet.ogg', 100, 1) + update() else if(istype(I, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/W = I if(W.remove_fuel(0,user)) playsound(src.loc, 'Welder2.ogg', 100, 1) - user << "Welding the pipe in place." + user << "Welding the [nicetype] in place." W:welding = 2 if(do_after(user, 20)) - update() - var/pipetype = dpipetype() - var/obj/structure/disposalpipe/P = new pipetype(src.loc) - P.base_icon_state = base_state - P.dir = dir - P.dpdir = dpdir - P.updateicon() + user << "The [nicetype] has been welded in place!" + update() // TODO: Make this neat + if(ispipe) // Pipe + + var/pipetype = dpipetype() + var/obj/structure/disposalpipe/P = new pipetype(src.loc) + P.base_icon_state = base_state + P.dir = dir + P.dpdir = dpdir + P.updateicon() + + else if(ptype==6) // Disposal bin + var/obj/machinery/disposal/P = new /obj/machinery/disposal(src.loc) + P.mode = 0 // start with pump off + + else if(ptype==7) // Disposal outlet + + var/obj/structure/disposaloutlet/P = new /obj/structure/disposaloutlet(src.loc) + P.dir = dir + Trunk.linked = P + + else if(ptype==8) // Disposal outlet + + var/obj/machinery/disposal/deliveryChute/P = new /obj/machinery/disposal/deliveryChute(src.loc) + P.dir = dir + del(src) return W:welding = 1 diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index c72f19b81f..4e5133e21e 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -46,6 +46,37 @@ if(isrobot(user) && !istype(I, /obj/item/weapon/trashbag)) return + if(mode<=0) // It's off + if(istype(I, /obj/item/weapon/screwdriver)) + if(mode==0) // It's off but still not unscrewed + mode=-1 // Set it to doubleoff l0l + playsound(src.loc, 'Screwdriver.ogg', 50, 1) + user << "You remove the screws around the power connection." + return + else if(mode==-1) + mode=0 + playsound(src.loc, 'Screwdriver.ogg', 50, 1) + user << "You attach the screws around the power connection." + return + else if(istype(I,/obj/item/weapon/weldingtool) && mode==-1) + var/obj/item/weapon/weldingtool/W = I + if(W.remove_fuel(0,user)) + playsound(src.loc, 'Welder2.ogg', 100, 1) + user << "You start slicing the floorweld off the disposal unit." + W:welding = 2 + if(do_after(user,20)) + user << "You sliced the floorweld off the disposal unit." + var/obj/structure/disposalconstruct/C = new (src.loc) + C.ptype = 6 // 6 = disposal unit + C.anchored = 1 + C.density = 1 + C.update() + del(src) + W:welding = 1 + return + else + user << "You need more welding fuel to complete this task." + return if(istype(I, /obj/item/weapon/melee/energy/blade)) user << "You can't place that item inside the disposal unit." @@ -167,6 +198,11 @@ if(user && user.loc == src) usr << "\red You cannot reach the controls from inside." return + /* + if(mode==-1) + usr << "\red The disposal units power is disabled." + return + */ interact(user, 0) // user interaction @@ -187,7 +223,7 @@ dat += "

Eject contents
" - if(mode == 0) + if(mode <= 0) dat += "Pump: Off On
" else if(mode == 1) dat += "Pump: Off On (pressurizing)
" @@ -209,6 +245,10 @@ if(usr.loc == src) usr << "\red You cannot reach the controls from inside." return + + if(mode==-1 && !href_list["eject"]) // only allow ejecting if mode is -1 + usr << "\red The disposal units power is disabled." + return ..() src.add_fingerprint(usr) if(stat & BROKEN) @@ -264,7 +304,7 @@ overlays += image('disposal.dmi', "dispover-handle") // only handle is shown if no power - if(stat & NOPOWER) + if(stat & NOPOWER || mode == -1) return // check for items in disposal - occupied light @@ -283,6 +323,9 @@ if(stat & BROKEN) // nothing can happen if broken return + if(!air_contents) // Potentially causes a runtime otherwise (if this is really shitty, blame pete //Donkie) + return + flush_count++ if( flush_count >= flush_every_ticks ) if( contents.len ) @@ -803,6 +846,8 @@ C.ptype = 5 C.dir = dir + C.density = 0 + C.anchored = 1 C.update() del(src) @@ -1030,6 +1075,37 @@ update() return + // Override attackby so we disallow trunkremoval when somethings ontop + attackby(var/obj/item/I, var/mob/user) + + if(linked != null) + return + + var/turf/T = src.loc + if(T.intact) + return // prevent interaction with T-scanner revealed pipes + + if(istype(I, /obj/item/weapon/weldingtool)) + var/obj/item/weapon/weldingtool/W = I + + if(W.welding) + if(W.remove_fuel(0,user)) + W:welding = 2 + playsound(src.loc, 'Welder2.ogg', 100, 1) + // check if anything changed over 2 seconds + var/turf/uloc = user.loc + var/atom/wloc = W.loc + user << "Slicing the disposal pipe." + sleep(30) + if(user.loc == uloc && wloc == W.loc) + welded() + else + user << "You must stay still while welding the pipe." + W:welding = 1 + else + user << "You need more welding fuel to cut the pipe." + return + // would transfer to next pipe segment, but we are in a trunk // if not entering from disposal bin, // transfer to linked object (outlet or bin) @@ -1091,6 +1167,7 @@ anchored = 1 var/active = 0 var/turf/target // this will be where the output objects are 'thrown' to. + var/mode = 0 New() ..() @@ -1111,13 +1188,47 @@ for(var/atom/movable/AM in H) AM.loc = src.loc AM.pipe_eject(dir) - spawn(1) + spawn(5) AM.throw_at(target, 3, 1) H.vent_gas(src.loc) del(H) return + attackby(var/obj/item/I, var/mob/user) + if(!I || !user) + return + + if(istype(I, /obj/item/weapon/screwdriver)) + if(mode==0) + mode=1 + playsound(src.loc, 'Screwdriver.ogg', 50, 1) + user << "You remove the screws around the power connection." + return + else if(mode==1) + mode=0 + playsound(src.loc, 'Screwdriver.ogg', 50, 1) + user << "You attach the screws around the power connection." + return + else if(istype(I,/obj/item/weapon/weldingtool) && mode==1) + var/obj/item/weapon/weldingtool/W = I + if(W.remove_fuel(0,user)) + playsound(src.loc, 'Welder2.ogg', 100, 1) + user << "You start slicing the floorweld off the disposal outlet." + W:welding = 2 + if(do_after(user,20)) + user << "You sliced the floorweld off the disposal outlet." + var/obj/structure/disposalconstruct/C = new (src.loc) + C.ptype = 7 // 7 = outlet + C.update() + C.anchored = 1 + C.density = 1 + del(src) + W:welding = 1 + return + else + user << "You need more welding fuel to complete this task." + return diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index d61f5bac94..9f6bdfcac2 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -208,9 +208,13 @@ density = 0 icon_state = "intake" + var/c_mode = 0 interact() return + update() + return + HasEntered(AM as mob|obj) //Go straight into the chute if (istype(AM, /obj)) var/obj/O = AM @@ -254,4 +258,39 @@ if(mode == 2) // if was ready, mode = 1 // switch to charging update() - return \ No newline at end of file + return + + attackby(var/obj/item/I, var/mob/user) + if(!I || !user) + return + + if(istype(I, /obj/item/weapon/screwdriver)) + if(c_mode==0) + c_mode=1 + playsound(src.loc, 'Screwdriver.ogg', 50, 1) + user << "You remove the screws around the power connection." + return + else if(c_mode==1) + c_mode=0 + playsound(src.loc, 'Screwdriver.ogg', 50, 1) + user << "You attach the screws around the power connection." + return + else if(istype(I,/obj/item/weapon/weldingtool) && c_mode==1) + var/obj/item/weapon/weldingtool/W = I + if(W.remove_fuel(0,user)) + playsound(src.loc, 'Welder2.ogg', 100, 1) + user << "You start slicing the floorweld off the delivery chute." + W:welding = 2 + if(do_after(user,20)) + user << "You sliced the floorweld off the delivery chute." + var/obj/structure/disposalconstruct/C = new (src.loc) + C.ptype = 8 // 8 = Delivery chute + C.update() + C.anchored = 1 + C.density = 1 + del(src) + W:welding = 1 + return + else + user << "You need more welding fuel to complete this task." + return \ No newline at end of file diff --git a/html/changelog.html b/html/changelog.html index 7a967f8f0d..dcee76c85b 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -46,6 +46,14 @@ Stuff which is in development and not yet visible to players or just code relate should be listed in the changelog upon commit tho. Thanks. --> +
+

Monday, May 28th

+

Donkie updated:

+ +
+

Saturday, May 26th

Icarus updated:

diff --git a/icons/obj/pipes/disposal.dmi b/icons/obj/pipes/disposal.dmi index a55add0998..5901d48162 100644 Binary files a/icons/obj/pipes/disposal.dmi and b/icons/obj/pipes/disposal.dmi differ