adds plumbing machine that can grind/juice items (#47881)

cl
add: plumbing machine to grind/juice objects and put it on duct net
/cl
!! it doesnt move shit you need to add belts to feed it!!

sprite by arcanemagician
This commit is contained in:
Tlaltecuhtli
2019-12-05 09:56:35 +13:00
committed by oranges
parent 2c78072651
commit e63ebb94d9
4 changed files with 70 additions and 1 deletions
@@ -26,7 +26,10 @@
. = ..()
anchored = bolt
create_reagents(buffer, reagent_flags)
AddComponent(/datum/component/simple_rotation, ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS )
AddComponent(/datum/component/simple_rotation, ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS, null, CALLBACK(src, .proc/can_be_rotated))
/obj/machinery/plumbing/proc/can_be_rotated(mob/user,rotation_type)
return TRUE
/obj/machinery/plumbing/examine(mob/user)
. = ..()
@@ -0,0 +1,65 @@
/obj/machinery/plumbing/grinder_chemical
name = "chemical grinder"
desc = "chemical grinder."
icon_state = "grinder_chemical"
layer = ABOVE_ALL_MOB_LAYER
reagent_flags = TRANSPARENT | DRAINABLE
rcd_cost = 30
rcd_delay = 30
buffer = 400
var/eat_dir = NORTH
/obj/machinery/plumbing/grinder_chemical/Initialize(mapload, bolt)
. = ..()
AddComponent(/datum/component/plumbing/simple_supply, bolt)
/obj/machinery/plumbing/grinder_chemical/can_be_rotated(mob/user,rotation_type)
if(anchored)
to_chat(user, "<span class='warning'>It is fastened to the floor!</span>")
return FALSE
switch(eat_dir)
if(WEST)
eat_dir = NORTH
return TRUE
if(EAST)
eat_dir = SOUTH
return TRUE
if(NORTH)
eat_dir = EAST
return TRUE
if(SOUTH)
eat_dir = WEST
return TRUE
/obj/machinery/plumbing/grinder_chemical/CanPass(atom/movable/AM)
. = ..()
if(!anchored)
return
var/move_dir = get_dir(loc, AM.loc)
if(move_dir == eat_dir)
return TRUE
/obj/machinery/plumbing/grinder_chemical/Crossed(atom/movable/AM)
. = ..()
grind(AM)
/obj/machinery/plumbing/grinder_chemical/proc/grind(atom/AM)
if(stat & NOPOWER)
return
if(reagents.holder_full())
return
if(!isitem(AM))
return
var/obj/item/I = AM
if(I.juice_results || I.grind_results)
if(I.juice_results)
I.on_juice()
reagents.add_reagent_list(I.juice_results)
if(I.reagents)
I.reagents.trans_to(src, I.reagents.total_volume, transfered_by = src)
qdel(I)
return
I.on_grind()
reagents.add_reagent_list(I.grind_results)
qdel(I)