mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
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:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user