brought to you by neilcic - Floor Corn
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// like a recycler, but for plants only ig
|
||||
/obj/machinery/autoloom
|
||||
name = "autoloom"
|
||||
desc = "A large processing machine used to process raw biological matter, like cotton or logs. There are lights on the side."
|
||||
desc = "A large processing machine used to process raw biological matter, like cotton or logs. It also looks like a recycler. There's a display on the side."
|
||||
icon = 'icons/obj/recycling.dmi'
|
||||
icon_state = "grinder-o0"
|
||||
layer = ABOVE_ALL_MOB_LAYER // Overhead
|
||||
@@ -9,11 +9,21 @@
|
||||
circuit = /obj/item/circuitboard/machine/autoloom
|
||||
var/icon_name = "grinder-o"
|
||||
var/eat_dir = WEST
|
||||
var/process_efficiency = 0
|
||||
var/static/list/can_process = typecacheof(list(
|
||||
/obj/item/stack/sheet/cotton,
|
||||
/obj/item/grown/log
|
||||
/obj/item/grown/log,
|
||||
/obj/item/grown/cotton
|
||||
))
|
||||
|
||||
/obj/machinery/autoloom/RefreshParts()
|
||||
for(var/obj/item/stock_parts/manipulator/M in component_parts)
|
||||
process_efficiency = M.rating
|
||||
|
||||
/obj/machinery/recycler/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Biomatter processing efficiency at <b>[amount_produced*100]%</b>.</span>"
|
||||
|
||||
/obj/machinery/autoloom/power_change()
|
||||
..()
|
||||
update_icon()
|
||||
@@ -45,14 +55,20 @@
|
||||
if(move_dir == eat_dir)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/autoloom/Crossed(atom/movable/AM)
|
||||
eat(AM)
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/autoloom/proc/eat(atom/movable/AM0, sound=TRUE)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
if(!isturf(AM0.loc))
|
||||
return //I don't know how you called Crossed() but stop it.
|
||||
|
||||
/obj/machinery/autoloom/proc/recycle_item(obj/item/I)
|
||||
if(is_type_in_list(AM0, can_process))
|
||||
process_item(AM0)
|
||||
|
||||
/obj/machinery/autoloom/proc/process_item(obj/item/I)
|
||||
. = list()
|
||||
for(var/A in I)
|
||||
var/atom/movable/AM = A
|
||||
@@ -61,11 +77,26 @@
|
||||
. += AM
|
||||
|
||||
I.forceMove(loc)
|
||||
var/obj/item/grown/log/L = I
|
||||
if(istype(L))
|
||||
if(istype(I, /obj/item/grown/log))
|
||||
var/obj/item/grown/log/L = I
|
||||
var/seed_modifier = 0
|
||||
if(L.seed)
|
||||
seed_modifier = round(L.seed.potency / 25)
|
||||
new L.plank_type(src.loc, 1 + seed_modifier)
|
||||
new L.plank_type(src.loc, process_efficiency + seed_modifier)
|
||||
qdel(L)
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/stack/sheet/cotton))
|
||||
var/obj/item/stack/sheet/cotton/RS = I
|
||||
var/tomake = round((RS.amount / 4) * process_efficiency)
|
||||
new RS.loom_result(src.loc, tomake)
|
||||
qdel(RS)
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/grown/cotton))
|
||||
var/obj/item/grown/cotton/RC = I
|
||||
var/cottonAmt = 1 + round(RC.seed.potency / 25)
|
||||
var/newRaw = new RC.cotton_type(src.loc, cottonAmt)
|
||||
qdel(RC)
|
||||
process_item(newRaw)
|
||||
return
|
||||
|
||||
@@ -1295,6 +1295,15 @@
|
||||
/obj/item/stock_parts/manipulator = 1)
|
||||
needs_anchored = FALSE
|
||||
|
||||
/obj/item/circuitboard/machine/autoloom
|
||||
name = "Autoloom (Machine Board)"
|
||||
icon_state = "service"
|
||||
build_path = /obj/machinery/autoloom
|
||||
req_components = list(
|
||||
/obj/item/stock_parts/matter_bin = 1,
|
||||
/obj/item/stock_parts/manipulator = 1)
|
||||
needs_anchored = FALSE
|
||||
|
||||
/obj/item/circuitboard/machine/seed_extractor
|
||||
name = "Seed Extractor (Machine Board)"
|
||||
icon_state = "service"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
Reference in New Issue
Block a user