Grind up some more stuff! (#4423)

*More types of sheets can be ground up in a grinder
This commit is contained in:
mistyLuminescence
2017-12-17 21:43:10 +00:00
committed by Atermonera
parent 595dee475a
commit 9a86b05471

View File

@@ -288,14 +288,20 @@
var/obj/item/weapon/reagent_containers/beaker = null
var/limit = 10
var/list/holdingitems = list()
var/list/sheet_reagents = list(
/obj/item/stack/material/iron = "iron",
/obj/item/stack/material/uranium = "uranium",
/obj/item/stack/material/phoron = "phoron",
/obj/item/stack/material/gold = "gold",
/obj/item/stack/material/silver = "silver",
/obj/item/stack/material/platinum = "platinum",
/obj/item/stack/material/mhydrogen = "hydrogen"
var/list/sheet_reagents = list( //have a number of reageents divisible by REAGENTS_PER_SHEET (default 20) unless you like decimals,
/obj/item/stack/material/iron = list("iron"),
/obj/item/stack/material/uranium = list("uranium"),
/obj/item/stack/material/phoron = list("phoron"),
/obj/item/stack/material/gold = list("gold"),
/obj/item/stack/material/silver = list("silver"),
/obj/item/stack/material/platinum = list("platinum"),
/obj/item/stack/material/mhydrogen = list("hydrogen"),
/obj/item/stack/material/steel = list("iron", "carbon"),
/obj/item/stack/material/plasteel = list("iron", "iron", "carbon", "carbon", "platinum"), //8 iron, 8 carbon, 4 platinum,
/obj/item/stack/material/snow = list("water"),
/obj/item/stack/material/sandstone = list("silicon", "oxygen"),
/obj/item/stack/material/glass = list("silicon"),
/obj/item/stack/material/glass/phoronglass = list("platinum", "silicon", "silicon", "silicon"), //5 platinum, 15 silicon,
)
/obj/machinery/reagentgrinder/New()
@@ -497,12 +503,18 @@
if(sheet_reagents[O.type])
var/obj/item/stack/stack = O
if(istype(stack))
var/list/sheet_components = sheet_reagents[stack.type]
var/amount_to_take = max(0,min(stack.amount,round(remaining_volume/REAGENTS_PER_SHEET)))
if(amount_to_take)
stack.use(amount_to_take)
if(QDELETED(stack))
holdingitems -= stack
beaker.reagents.add_reagent(sheet_reagents[stack.type], (amount_to_take*REAGENTS_PER_SHEET))
if(islist(sheet_components))
amount_to_take = (amount_to_take/(sheet_components.len))
for(var/i in sheet_components)
beaker.reagents.add_reagent(i, (amount_to_take*REAGENTS_PER_SHEET))
else
beaker.reagents.add_reagent(sheet_components, (amount_to_take*REAGENTS_PER_SHEET))
continue
if(O.reagents)