diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 5a153561583..8831de9fc7b 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -716,10 +716,6 @@ var/turf/target - if(T.density) // dense ouput turf, so stop holder - H.active = 0 - H.loc = src - return if(istype(T,/turf/simulated/floor)) //intact floor, pop the tile var/turf/simulated/floor/F = T //F.health = 100 @@ -742,8 +738,6 @@ spawn(1) if(AM) AM.throw_at(target, 100, 1) - H.vent_gas(T) - del(H) else // no specified direction, so throw in random direction @@ -757,10 +751,8 @@ spawn(1) if(AM) AM.throw_at(target, 5, 1) - - H.vent_gas(T) // all gas vent to turf - del(H) - + H.vent_gas(T) + del(H) return // call to break the pipe diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 949f1536ccd..1b4e584a9ec 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -219,105 +219,107 @@ var/start_flush = 0 var/c_mode = 0 - New() - ..() - spawn(5) - trunk = locate() in loc - if(trunk) - trunk.linked = src // link the pipe trunk to self +/obj/machinery/disposal/deliveryChute/New() + ..() + spawn(5) + trunk = locate() in loc + if(trunk) + trunk.linked = src // link the pipe trunk to self - interact() - return +/obj/machinery/disposal/deliveryChute/interact() + return - update() - return +/obj/machinery/disposal/deliveryChute/update() + return - Bumped(var/atom/movable/AM) //Go straight into the chute - if(istype(AM, /obj/item/projectile)) return - switch(dir) - if(NORTH) - if(AM.loc.y != loc.y+1) return - if(EAST) - if(AM.loc.x != loc.x+1) return - if(SOUTH) - if(AM.loc.y != loc.y-1) return - if(WEST) - if(AM.loc.x != loc.x-1) return - - if(istype(AM, /obj)) - var/obj/O = AM - O.loc = src - else if(istype(AM, /mob)) - var/mob/M = AM - M.loc = src - flush() +/obj/machinery/disposal/deliveryChute/Bumped(var/atom/movable/AM) //Go straight into the chute + if(istype(AM, /obj/item/projectile)) return + switch(dir) + if(NORTH) + if(AM.loc.y != loc.y+1) return + if(EAST) + if(AM.loc.x != loc.x+1) return + if(SOUTH) + if(AM.loc.y != loc.y-1) return + if(WEST) + if(AM.loc.x != loc.x-1) return + if(istype(AM, /obj)) + var/obj/O = AM + O.loc = src + else if(istype(AM, /mob)) + var/mob/M = AM + M.loc = src flush() - flushing = 1 - flick("intake-closing", src) - var/deliveryCheck = 0 - var/obj/structure/disposalholder/H = new() // virtual holder object which actually - // travels through the pipes. + +/obj/machinery/disposal/deliveryChute/flush() + flushing = 1 + flick("intake-closing", src) + var/deliveryCheck = 0 + var/obj/structure/disposalholder/H = new() // virtual holder object which actually + // travels through the pipes. /* for(var/obj/structure/bigDelivery/O in src) - deliveryCheck = 1 - if(O.sortTag == 0) //This auto-sorts package wrapped objects to disposals - O.sortTag = 1 //Cargo techs can do this themselves with their taggers - for(var/obj/item/smallDelivery/O in src) //With this disabled packages will loop back round and come out the mail chute - deliveryCheck = 1 - if(O.sortTag == 0) - O.sortTag = 1 */ - if(deliveryCheck == 0) - H.destinationTag = 1 + deliveryCheck = 1 + if(O.sortTag == 0) //This auto-sorts package wrapped objects to disposals + O.sortTag = 1 //Cargo techs can do this themselves with their taggers + for(var/obj/item/smallDelivery/O in src) //With this disabled packages will loop back round and come out the mail chute + deliveryCheck = 1 + if(O.sortTag == 0) + O.sortTag = 1 */ + if(deliveryCheck == 0) + H.destinationTag = 1 - air_contents = new() // new empty gas resv. + sleep(10) + if((start_flush + 15) < world.time) + start_flush = world.time + playsound(src, 'sound/machines/disposalflush.ogg', 50, 0, 0) + sleep(5) // wait for animation to finish - sleep(10) - if((start_flush + 15) < world.time) - start_flush = world.time - playsound(src, 'sound/machines/disposalflush.ogg', 50, 0, 0) - sleep(5) // wait for animation to finish + H.init(src) // copy the contents of disposer to holder + air_contents = new() // new empty gas resv. - H.init(src) // copy the contents of disposer to holder + H.start(src) // start the holder processing movement + flushing = 0 + // now reset disposal state + flush = 0 + if(mode == 2) // if was ready, + mode = 1 // switch to charging + update() + return - H.start(src) // start the holder processing movement - flushing = 0 - // now reset disposal state - flush = 0 - if(mode == 2) // if was ready, - mode = 1 // switch to charging - update() +/obj/machinery/disposal/deliveryChute/attackby(var/obj/item/I, var/mob/user) + if(!I || !user) return - attackby(var/obj/item/I, var/mob/user) - if(!I || !user) + if(istype(I, /obj/item/weapon/screwdriver)) + if(c_mode==0) + c_mode=1 + playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) + user << "You remove the screws around the power connection." + return + else if(c_mode==1) + c_mode=0 + playsound(loc, 'sound/items/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(loc, 'sound/items/Welder2.ogg', 100, 1) + user << "You start slicing the floorweld off the delivery chute." + if(do_after(user,20)) + if(!src || !W.isOn()) return + user << "You sliced the floorweld off the delivery chute." + var/obj/structure/disposalconstruct/C = new (loc) + C.ptype = 8 // 8 = Delivery chute + C.update() + C.anchored = 1 + C.density = 1 + del(src) + return + else + user << "You need more welding fuel to complete this task." return - if(istype(I, /obj/item/weapon/screwdriver)) - if(c_mode==0) - c_mode=1 - playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1) - user << "You remove the screws around the power connection." - return - else if(c_mode==1) - c_mode=0 - playsound(loc, 'sound/items/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(loc, 'sound/items/Welder2.ogg', 100, 1) - user << "You start slicing the floorweld off the delivery chute." - if(do_after(user,20)) - if(!src || !W.isOn()) return - user << "You sliced the floorweld off the delivery chute." - var/obj/structure/disposalconstruct/C = new (loc) - C.ptype = 8 // 8 = Delivery chute - C.update() - C.anchored = 1 - C.density = 1 - del(src) - return - else - user << "You need more welding fuel to complete this task." - return +/obj/machinery/disposal/deliveryChute/process() + return PROCESS_KILL \ No newline at end of file