All-In-One grinder results are now defined by type, not by huge lists (#33181)

I had some time free, and noticed how awful the reagent grinder code was - it used huge static lists containing types and their associated reagents from grinding.

This is now split into two new vars on /obj/item - var/list/grind_results and var/list/juice_results, as well as two new helper procs, on_grind() and on_juice() to allow those to change based on conditions like plant potency. Such checks and the like have been moved to that. If any of these procs return -1, the operation is canceled.

I also fixed some of the recipes that didn't work. The reagent IDs for them didn't exist, leading me to believe that they weren't tested. I corrected that! (I've tested every single recipe in this PR, with the exception of a few juicing-related ones.)
This commit is contained in:
Ashe Higgs
2017-12-15 10:48:25 +13:00
committed by oranges
parent 59abcb8dc3
commit d447acdc6e
48 changed files with 186 additions and 236 deletions
+2 -1
View File
@@ -23,6 +23,7 @@
throw_range = 7
materials = list(MAT_METAL=10)
pressure_resistance = 2
grind_results = list("iron" = 2, "iodine" = 1)
var/colour = "black" //what colour the ink is!
var/traitor_unlock_degrees = 0
var/degrees = 0
@@ -175,7 +176,7 @@
/obj/item/pen/sleepy/Initialize()
. = ..()
. = ..()
create_reagents(45)
reagents.add_reagent("chloralhydrate2", 20)
reagents.add_reagent("mutetoxin", 15)
+1
View File
@@ -391,5 +391,6 @@
/obj/item/device/toner
name = "toner cartridge"
icon_state = "tonercartridge"
grind_results = list("iodine" = 40, "iron" = 10)
var/charges = 5
var/max_charges = 5
+1
View File
@@ -33,6 +33,7 @@
w_class = WEIGHT_CLASS_TINY
resistance_flags = FLAMMABLE
max_integrity = 50
grind_results = list("iodine" = 4)
var/icon/img //Big photo image
var/scribble //Scribble on the back.
var/blueprints = 0 //Does it include the blueprints?