diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index f4dd741695..d4fd9c710a 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -117,7 +117,13 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
var/trigger_guard = TRIGGER_GUARD_NONE
+<<<<<<< HEAD
var/icon_override = null
+=======
+ //Grinder vars
+ var/list/grind_results //A reagent list containing the reagents this item produces when ground up in a grinder - this can be an empty list to allow for reagent transferring only
+ var/list/juice_results //A reagent list containing blah blah... but when JUICED in a grinder!
+>>>>>>> d447acd... All-In-One grinder results are now defined by type, not by huge lists (#33181)
/obj/item/Initialize()
if (!materials)
@@ -678,6 +684,15 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
/obj/item/proc/on_mob_death(mob/living/L, gibbed)
+/obj/item/proc/grind_requirements(obj/machinery/reagentgrinder/R) //Used to check for extra requirements for grinding an object
+ return TRUE
+
+ //Called BEFORE the object is ground up - use this to change grind results based on conditions
+ //Use "return -1" to prevent the grinding from occurring
+/obj/item/proc/on_grind()
+
+/obj/item/proc/on_juice()
+
/obj/item/proc/set_force_string()
switch(force)
if(0 to 4)
diff --git a/code/game/objects/items/apc_frame.dm b/code/game/objects/items/apc_frame.dm
index 4c8d342c16..5048f6ed2d 100644
--- a/code/game/objects/items/apc_frame.dm
+++ b/code/game/objects/items/apc_frame.dm
@@ -120,4 +120,5 @@
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
flags_1 = CONDUCT_1
w_class = WEIGHT_CLASS_SMALL
- materials = list(MAT_METAL=50, MAT_GLASS=50)
\ No newline at end of file
+ materials = list(MAT_METAL=50, MAT_GLASS=50)
+ grind_results = list("iron" = 10, "silicon" = 10)
diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm
index 491feb91ce..9c7c34510c 100644
--- a/code/game/objects/items/cigs_lighters.dm
+++ b/code/game/objects/items/cigs_lighters.dm
@@ -25,6 +25,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
var/smoketime = 5
w_class = WEIGHT_CLASS_TINY
heat = 1000
+ grind_results = list("phosphorus" = 2)
/obj/item/match/process()
smoketime--
@@ -104,6 +105,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
container_type = INJECTABLE_1
w_class = WEIGHT_CLASS_TINY
body_parts_covered = null
+ grind_results = list()
var/lit = FALSE
var/starts_lit = FALSE
var/icon_on = "cigon" //Note - these are in masks.dmi not in cigarette.dmi
@@ -363,6 +365,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
icon_state = "cigbutt"
w_class = WEIGHT_CLASS_TINY
throwforce = 0
+ grind_results = list("carbon" = 2)
/obj/item/cigbutt/cigarbutt
name = "cigar butt"
@@ -484,6 +487,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
heat = 1500
resistance_flags = FIRE_PROOF
light_color = LIGHT_COLOR_FIRE
+ grind_results = list("iron" = 1, "welding_fuel" = 5, "oil" = 5)
/obj/item/lighter/update_icon()
if(lit)
diff --git a/code/game/objects/items/circuitboards/circuitboard.dm b/code/game/objects/items/circuitboards/circuitboard.dm
index 82350e37f9..12b54a3751 100644
--- a/code/game/objects/items/circuitboards/circuitboard.dm
+++ b/code/game/objects/items/circuitboards/circuitboard.dm
@@ -12,6 +12,7 @@
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
materials = list(MAT_GLASS=1000)
w_class = WEIGHT_CLASS_SMALL
+ grind_results = list("silicon" = 20, "sacid" = 0.5) //Retrieving acid this way is extremely inefficient
var/build_path = null
/obj/item/circuitboard/proc/apply_default_parts(obj/machinery/M)
diff --git a/code/game/objects/items/clown_items.dm b/code/game/objects/items/clown_items.dm
index c96ec4167a..f2a804e9e9 100644
--- a/code/game/objects/items/clown_items.dm
+++ b/code/game/objects/items/clown_items.dm
@@ -21,6 +21,7 @@
throwforce = 0
throw_speed = 3
throw_range = 7
+ grind_results = list("lye" = 10)
var/cleanspeed = 50 //slower than mop
force_string = "robust... against germs"
diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm
index 7b2d730daf..56bad47963 100644
--- a/code/game/objects/items/crayons.dm
+++ b/code/game/objects/items/crayons.dm
@@ -26,6 +26,7 @@
item_color = "red"
w_class = WEIGHT_CLASS_TINY
attack_verb = list("attacked", "coloured")
+ grind_results = list()
var/paint_color = "#FF0000" //RGB
var/drawtype
diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm
index 08c570a786..f656d55afd 100644
--- a/code/game/objects/items/devices/flashlight.dm
+++ b/code/game/objects/items/devices/flashlight.dm
@@ -256,6 +256,7 @@
var/produce_heat = 1500
heat = 1000
light_color = LIGHT_COLOR_FLARE
+ grind_results = list("sulfur" = 15)
/obj/item/device/flashlight/flare/New()
fuel = rand(800, 1000) // Sorry for changing this so much but I keep under-estimating how long X number of ticks last in seconds.
@@ -404,6 +405,7 @@
color = LIGHT_COLOR_GREEN
icon_state = "glowstick"
item_state = "glowstick"
+ grind_results = list("phenol" = 15, "hydrogen" = 10, "oxygen" = 5) //Meth-in-a-stick
var/fuel = 0
/obj/item/device/flashlight/glowstick/Initialize()
diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm
index 3f17485550..9a60bb0edb 100644
--- a/code/game/objects/items/devices/scanners.dm
+++ b/code/game/objects/items/devices/scanners.dm
@@ -335,6 +335,7 @@ GAS ANALYZER
throw_speed = 3
throw_range = 7
materials = list(MAT_METAL=30, MAT_GLASS=20)
+ grind_results = list("mercury" = 5, "iron" = 5, "silicon" = 5)
/obj/item/device/analyzer/attack_self(mob/user)
diff --git a/code/game/objects/items/stacks/bscrystal.dm b/code/game/objects/items/stacks/bscrystal.dm
index 5276050b03..978966706e 100644
--- a/code/game/objects/items/stacks/bscrystal.dm
+++ b/code/game/objects/items/stacks/bscrystal.dm
@@ -9,6 +9,7 @@
points = 50
var/blink_range = 8 // The teleport range when crushed/thrown at someone.
refined_type = /obj/item/stack/sheet/bluespace_crystal
+ grind_results = list("bluespace" = 2)
/obj/item/ore/bluespace_crystal/refined
name = "refined bluespace crystal"
@@ -48,6 +49,7 @@
blink_range = 4 // Not as good as the organic stuff!
points = 0 //nice try
refined_type = null
+ grind_results = list("bluespace" = 1, "silicon" = 2)
//Polycrystals, aka stacks
/obj/item/stack/sheet/bluespace_crystal
@@ -58,6 +60,7 @@
materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT)
attack_verb = list("bluespace polybashed", "bluespace polybattered", "bluespace polybludgeoned", "bluespace polythrashed", "bluespace polysmashed")
novariants = TRUE
+ grind_results = list("bluespace" = 2)
var/crystal_type = /obj/item/ore/bluespace_crystal/refined
/obj/item/stack/sheet/bluespace_crystal/attack_self(mob/user)// to prevent the construction menu from ever happening
diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm
index 560182d9c7..7a0f85a8f2 100644
--- a/code/game/objects/items/stacks/medical.dm
+++ b/code/game/objects/items/stacks/medical.dm
@@ -111,6 +111,7 @@
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
heal_brute = 40
self_delay = 20
+ grind_results = list("styptic_powder" = 1)
/obj/item/stack/medical/bruise_pack/suicide_act(mob/user)
user.visible_message("[user] is bludgeoning [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!")
@@ -147,3 +148,4 @@
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
heal_burn = 40
self_delay = 20
+ grind_results = list("silver_sulfadiazine" = 1)
diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm
index 0544598246..8cc6a60efa 100644
--- a/code/game/objects/items/stacks/sheets/glass.dm
+++ b/code/game/objects/items/stacks/sheets/glass.dm
@@ -22,6 +22,7 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/glass
+ grind_results = list("silicon" = 1)
/obj/item/stack/sheet/glass/cyborg
materials = list()
@@ -79,6 +80,7 @@ GLOBAL_LIST_INIT(pglass_recipes, list ( \
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 75, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/plasmaglass
+ grind_results = list("silicon" = 1, "plasma" = 1)
/obj/item/stack/sheet/plasmaglass/fifty
amount = 50
@@ -128,6 +130,7 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 70, acid = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/rglass
+ grind_results = list("silicon" = 1, "iron" = 1)
/obj/item/stack/sheet/rglass/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
@@ -168,6 +171,7 @@ GLOBAL_LIST_INIT(prglass_recipes, list ( \
armor = list("melee" = 20, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/plasmarglass
+ grind_results = list("silicon" = 1, "plasma" = 1, "iron" = 1)
/obj/item/stack/sheet/plasmarglass/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.prglass_recipes
diff --git a/code/game/objects/items/stacks/sheets/light.dm b/code/game/objects/items/stacks/sheets/light.dm
index a02d182f1c..e0dcfa3184 100644
--- a/code/game/objects/items/stacks/sheets/light.dm
+++ b/code/game/objects/items/stacks/sheets/light.dm
@@ -10,10 +10,18 @@
throw_speed = 3
throw_range = 7
flags_1 = CONDUCT_1
+<<<<<<< HEAD
max_amount = 60
/obj/item/stack/light_w/attackby(obj/item/O, mob/user, params)
+=======
+ max_amount = 60
+ grind_results = list("silicon" = 1, "copper" = 1)
+
+/obj/item/stack/light_w/attackby(obj/item/O, mob/user, params)
+
+>>>>>>> d447acd... All-In-One grinder results are now defined by type, not by huge lists (#33181)
if(istype(O, /obj/item/wirecutters))
var/obj/item/stack/cable_coil/CC = new (user.loc)
CC.amount = 5
diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm
index e2ae00d06c..e44366daec 100644
--- a/code/game/objects/items/stacks/sheets/mineral.dm
+++ b/code/game/objects/items/stacks/sheets/mineral.dm
@@ -126,6 +126,7 @@ GLOBAL_LIST_INIT(diamond_recipes, list ( \
sheettype = "uranium"
materials = list(MAT_URANIUM=MINERAL_MATERIAL_AMOUNT)
novariants = TRUE
+ grind_results = list("uranium" = 20)
GLOBAL_LIST_INIT(uranium_recipes, list ( \
new/datum/stack_recipe("uranium door", /obj/structure/mineral_door/uranium, 10, one_per_turf = 1, on_floor = 1), \
@@ -149,6 +150,7 @@ GLOBAL_LIST_INIT(uranium_recipes, list ( \
resistance_flags = FLAMMABLE
max_integrity = 100
materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT)
+ grind_results = list("plasma" = 20)
GLOBAL_LIST_INIT(plasma_recipes, list ( \
new/datum/stack_recipe("plasma door", /obj/structure/mineral_door/transparent/plasma, 10, one_per_turf = 1, on_floor = 1), \
@@ -182,6 +184,7 @@ GLOBAL_LIST_INIT(plasma_recipes, list ( \
singular_name = "gold bar"
sheettype = "gold"
materials = list(MAT_GOLD=MINERAL_MATERIAL_AMOUNT)
+ grind_results = list("gold" = 20)
GLOBAL_LIST_INIT(gold_recipes, list ( \
new/datum/stack_recipe("golden door", /obj/structure/mineral_door/gold, 10, one_per_turf = 1, on_floor = 1), \
@@ -207,6 +210,7 @@ GLOBAL_LIST_INIT(gold_recipes, list ( \
singular_name = "silver bar"
sheettype = "silver"
materials = list(MAT_SILVER=MINERAL_MATERIAL_AMOUNT)
+ grind_results = list("silver" = 20)
GLOBAL_LIST_INIT(silver_recipes, list ( \
new/datum/stack_recipe("silver door", /obj/structure/mineral_door/silver, 10, one_per_turf = 1, on_floor = 1), \
@@ -232,6 +236,7 @@ GLOBAL_LIST_INIT(silver_recipes, list ( \
sheettype = "clown"
materials = list(MAT_BANANIUM=MINERAL_MATERIAL_AMOUNT)
novariants = TRUE
+ grind_results = list("banana" = 20)
GLOBAL_LIST_INIT(clown_recipes, list ( \
new/datum/stack_recipe("bananium tile", /obj/item/stack/tile/mineral/bananium, 1, 4, 20), \
@@ -302,6 +307,7 @@ GLOBAL_LIST_INIT(plastitanium_recipes, list ( \
singular_name = "snow block"
force = 1
throwforce = 2
+ grind_results = list("ice" = 20)
GLOBAL_LIST_INIT(snow_recipes, list ( \
new/datum/stack_recipe("Snow Wall", /turf/closed/wall/mineral/snow, 5, one_per_turf = 1, on_floor = 1), \
diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm
index d8019d98a3..36b9cf210a 100644
--- a/code/game/objects/items/stacks/sheets/sheet_types.dm
+++ b/code/game/objects/items/stacks/sheets/sheet_types.dm
@@ -99,6 +99,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
flags_1 = CONDUCT_1
resistance_flags = FIRE_PROOF
merge_type = /obj/item/stack/sheet/metal
+ grind_results = list("iron" = 20)
/obj/item/stack/sheet/metal/ratvar_act()
new /obj/item/stack/tile/brass(loc, amount)
@@ -151,6 +152,7 @@ GLOBAL_LIST_INIT(plasteel_recipes, list ( \
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 80)
resistance_flags = FIRE_PROOF
merge_type = /obj/item/stack/sheet/plasteel
+ grind_results = list("iron" = 20, "plasma" = 20)
/obj/item/stack/sheet/plasteel/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.plasteel_recipes
@@ -202,6 +204,7 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \
resistance_flags = FLAMMABLE
merge_type = /obj/item/stack/sheet/mineral/wood
novariants = TRUE
+ grind_results = list("carbon" = 20)
/obj/item/stack/sheet/mineral/wood/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.wood_recipes
@@ -322,6 +325,7 @@ GLOBAL_LIST_INIT(runed_metal_recipes, list ( \
sheettype = "runed"
merge_type = /obj/item/stack/sheet/runed_metal
novariants = TRUE
+ grind_results = list("iron" = 0.5, "blood" = 1.5)
/obj/item/stack/sheet/runed_metal/ratvar_act()
new /obj/item/stack/tile/brass(loc, amount)
@@ -385,6 +389,7 @@ GLOBAL_LIST_INIT(brass_recipes, list ( \
throw_range = 3
turf_type = /turf/open/floor/clockwork
novariants = FALSE
+ grind_results = list("iron" = 0.5, "teslium" = 1.5)
/obj/item/stack/tile/brass/narsie_act()
new /obj/item/stack/sheet/runed_metal(loc, amount)
@@ -435,6 +440,7 @@ GLOBAL_LIST_INIT(brass_recipes, list ( \
w_class = WEIGHT_CLASS_NORMAL
throw_speed = 1
throw_range = 3
+ grind_results = list("carbon" = 1)
GLOBAL_LIST_INIT(plastic_recipes, list(
new /datum/stack_recipe("plastic flaps", /obj/structure/plasticflaps, 5, one_per_turf = TRUE, on_floor = TRUE, time = 40), \
diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm
index 1faad3462b..d50239f79d 100644
--- a/code/game/objects/items/stacks/stack.dm
+++ b/code/game/objects/items/stacks/stack.dm
@@ -21,6 +21,17 @@
var/merge_type = null // This path and its children should merge with this stack, defaults to src.type
var/full_w_class = WEIGHT_CLASS_NORMAL //The weight class the stack should have at amount > 2/3rds max_amount
var/novariants = TRUE //Determines whether the item should update it's sprites based on amount.
+ //NOTE: When adding grind_results, the amounts should be for an INDIVIDUAL ITEM - these amounts will be multiplied by the stack size in on_grind()
+
+/obj/item/stack/on_grind()
+ for(var/i in 1 to grind_results.len) //This should only call if it's ground, so no need to check if grind_results exists
+ grind_results[grind_results[i]] *= amount //Gets the key at position i, then the reagent amount of that key, then multiplies it by stack size
+
+/obj/item/stack/grind_requirements()
+ if(is_cyborg)
+ to_chat(usr, "[src] is electronically synthesized in your chassis and can't be ground up!")
+ return
+ return TRUE
/obj/item/stack/Initialize(mapload, new_amount=null , merge = TRUE)
. = ..()
diff --git a/code/game/objects/items/trash.dm b/code/game/objects/items/trash.dm
index c9552a3d39..b1313ef84f 100644
--- a/code/game/objects/items/trash.dm
+++ b/code/game/objects/items/trash.dm
@@ -66,6 +66,7 @@
name = "crushed can"
icon_state = "cola"
resistance_flags = NONE
+ grind_results = list("aluminum" = 10)
/obj/item/trash/attack(mob/M, mob/living/user)
return
@@ -75,6 +76,7 @@
icon = 'icons/obj/mining.dmi'
icon_state = "slag"
desc = "Someone's gotten on the naughty list."
+ grind_results = list("carbon" = 20)
/obj/item/trash/coal/burn()
visible_message("[src] fuses into a diamond! Someone wasn't so naughty after all...")
diff --git a/code/modules/food_and_drinks/drinks/drinks.dm b/code/modules/food_and_drinks/drinks/drinks.dm
index 7217fe0b28..6fb712ea41 100644
--- a/code/modules/food_and_drinks/drinks/drinks.dm
+++ b/code/modules/food_and_drinks/drinks/drinks.dm
@@ -393,6 +393,7 @@
container_type = NONE
spillable = FALSE
isGlass = FALSE
+ grind_results = list("aluminum" = 10)
/obj/item/reagent_containers/food/drinks/soda_cans/attack(mob/M, mob/user)
if(M == user && !src.reagents.total_volume && user.a_intent == INTENT_HARM && user.zone_selected == "head")
diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm
index 49f85a882d..7f574e0313 100644
--- a/code/modules/food_and_drinks/food/snacks.dm
+++ b/code/modules/food_and_drinks/food/snacks.dm
@@ -6,6 +6,7 @@
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
unique_rename = 1
+ grind_results = list() //To let them be ground up to transfer their reagents
var/bitesize = 2
var/bitecount = 0
var/trash = null
diff --git a/code/modules/food_and_drinks/food/snacks_egg.dm b/code/modules/food_and_drinks/food/snacks_egg.dm
index bfe181b419..10039f7a8b 100644
--- a/code/modules/food_and_drinks/food/snacks_egg.dm
+++ b/code/modules/food_and_drinks/food/snacks_egg.dm
@@ -20,6 +20,7 @@
filling_color = "#F0E68C"
tastes = list("egg" = 1)
foodtype = MEAT
+ grind_results = list("eggyolk" = 5)
/obj/item/reagent_containers/food/snacks/egg/throw_impact(atom/hit_atom)
if(!..()) //was it caught by a mob?
diff --git a/code/modules/food_and_drinks/food/snacks_other.dm b/code/modules/food_and_drinks/food/snacks_other.dm
index c32ebfb765..c7681fe807 100644
--- a/code/modules/food_and_drinks/food/snacks_other.dm
+++ b/code/modules/food_and_drinks/food/snacks_other.dm
@@ -28,6 +28,7 @@
filling_color = "#FF1493"
tastes = list("watermelon" = 1)
foodtype = FRUIT
+ juice_results = list("watermelonjuice" = 5)
/obj/item/reagent_containers/food/snacks/candy_corn
name = "candy corn"
diff --git a/code/modules/hydroponics/beekeeping/honeycomb.dm b/code/modules/hydroponics/beekeeping/honeycomb.dm
index 737736efc5..8b9d641eac 100644
--- a/code/modules/hydroponics/beekeeping/honeycomb.dm
+++ b/code/modules/hydroponics/beekeeping/honeycomb.dm
@@ -10,6 +10,7 @@
volume = 10
amount_per_transfer_from_this = 0
list_reagents = list("honey" = 5)
+ grind_results = list()
var/honey_color = ""
/obj/item/reagent_containers/honeycomb/New()
diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm
index d003f40d4a..643ac056e4 100644
--- a/code/modules/hydroponics/grown.dm
+++ b/code/modules/hydroponics/grown.dm
@@ -15,6 +15,7 @@
// Saves us from having to define each stupid grown's dried_type as itself.
// If you don't want a plant to be driable (watermelons) set this to null in the time definition.
resistance_flags = FLAMMABLE
+ var/dry_grind = FALSE //If TRUE, this object needs to be dry to be ground up
/obj/item/reagent_containers/food/snacks/grown/Initialize(mapload, obj/item/seeds/new_seed)
. = ..()
@@ -137,6 +138,28 @@
return
return ..()
+/obj/item/reagent_containers/food/snacks/grown/grind_requirements()
+ if(dry_grind && !dry)
+ to_chat(usr, "[src] needs to be dry before it can be ground up!")
+ return
+ return TRUE
+
+/obj/item/reagent_containers/food/snacks/grown/on_grind()
+ var/nutriment = reagents.get_reagent_amount("nutriment")
+ if(grind_results.len)
+ for(var/i in 1 to grind_results.len)
+ grind_results[grind_results[i]] = nutriment
+ reagents.del_reagent("nutriment")
+ reagents.del_reagent("vitamin")
+
+/obj/item/reagent_containers/food/snacks/grown/on_juice()
+ var/nutriment = reagents.get_reagent_amount("nutriment")
+ if(juice_results.len)
+ for(var/i in 1 to juice_results.len)
+ juice_results[juice_results[i]] = nutriment
+ reagents.del_reagent("nutriment")
+ reagents.del_reagent("vitamin")
+
// For item-containing growns such as eggy or gatfruit
/obj/item/reagent_containers/food/snacks/grown/shell/attack_self(mob/user)
var/obj/item/T
diff --git a/code/modules/hydroponics/grown/apple.dm b/code/modules/hydroponics/grown/apple.dm
index 7ec9a730ed..8b35fee872 100644
--- a/code/modules/hydroponics/grown/apple.dm
+++ b/code/modules/hydroponics/grown/apple.dm
@@ -15,6 +15,7 @@
genes = list(/datum/plant_gene/trait/repeated_harvest)
mutatelist = list(/obj/item/seeds/apple/gold)
reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
+ juice_results = list("applejuice" = 0)
/obj/item/reagent_containers/food/snacks/grown/apple
seed = /obj/item/seeds/apple
diff --git a/code/modules/hydroponics/grown/banana.dm b/code/modules/hydroponics/grown/banana.dm
index bf71856323..72517e87bc 100644
--- a/code/modules/hydroponics/grown/banana.dm
+++ b/code/modules/hydroponics/grown/banana.dm
@@ -13,6 +13,7 @@
genes = list(/datum/plant_gene/trait/slip, /datum/plant_gene/trait/repeated_harvest)
mutatelist = list(/obj/item/seeds/banana/mime, /obj/item/seeds/banana/bluespace)
reagents_add = list("banana" = 0.1, "potassium" = 0.1, "vitamin" = 0.04, "nutriment" = 0.02)
+ juice_results = list("banana" = 0)
/obj/item/reagent_containers/food/snacks/grown/banana
seed = /obj/item/seeds/banana
diff --git a/code/modules/hydroponics/grown/beans.dm b/code/modules/hydroponics/grown/beans.dm
index 8ca2a5961a..46a7e7979f 100644
--- a/code/modules/hydroponics/grown/beans.dm
+++ b/code/modules/hydroponics/grown/beans.dm
@@ -26,6 +26,7 @@
filling_color = "#F0E68C"
bitesize_mod = 2
foodtype = VEGETABLES
+ grind_results = list("soymilk" = 0)
// Koibean
/obj/item/seeds/soya/koi
diff --git a/code/modules/hydroponics/grown/berries.dm b/code/modules/hydroponics/grown/berries.dm
index 0d8c5d5a9a..541fb1b2a5 100644
--- a/code/modules/hydroponics/grown/berries.dm
+++ b/code/modules/hydroponics/grown/berries.dm
@@ -26,6 +26,7 @@
filling_color = "#FF00FF"
bitesize_mod = 2
foodtype = FRUIT
+ juice_results = list("berryjuice" = 0)
// Poison Berries
/obj/item/seeds/berry/poison
@@ -46,6 +47,7 @@
icon_state = "poisonberrypile"
filling_color = "#C71585"
foodtype = FRUIT | TOXIC
+ juice_results = list("poisonberryjuice" = 0)
// Death Berries
/obj/item/seeds/berry/death
@@ -121,6 +123,7 @@
filling_color = "#FF0000"
bitesize_mod = 2
foodtype = FRUIT
+ grind_results = list("cherryjelly" = 0)
// Blue Cherries
/obj/item/seeds/cherry/blue
@@ -142,6 +145,7 @@
filling_color = "#6495ED"
bitesize_mod = 2
foodtype = FRUIT
+ grind_results = list("bluecherryjelly" = 0)
// Grapes
/obj/item/seeds/grape
@@ -173,6 +177,7 @@
filling_color = "#FF1493"
bitesize_mod = 2
foodtype = FRUIT
+ juice_results = list("grapejuice" = 0)
// Green Grapes
/obj/item/seeds/grape/green
diff --git a/code/modules/hydroponics/grown/cereals.dm b/code/modules/hydroponics/grown/cereals.dm
index 7834ed15e8..d9b724d052 100644
--- a/code/modules/hydroponics/grown/cereals.dm
+++ b/code/modules/hydroponics/grown/cereals.dm
@@ -22,6 +22,7 @@
filling_color = "#F0E68C"
bitesize_mod = 2
foodtype = GRAIN
+ grind_results = list("flour" = 0)
// Oat
/obj/item/seeds/wheat/oat
@@ -42,6 +43,7 @@
filling_color = "#556B2F"
bitesize_mod = 2
foodtype = GRAIN
+ grind_results = list("flour" = 0)
// Rice
/obj/item/seeds/wheat/rice
@@ -63,6 +65,7 @@
filling_color = "#FAFAD2"
bitesize_mod = 2
foodtype = GRAIN
+ grind_results = list("rice" = 0)
//Meatwheat - grows into synthetic meat
/obj/item/seeds/wheat/meat
@@ -83,6 +86,7 @@
bitesize_mod = 2
seed = /obj/item/seeds/wheat/meat
foodtype = MEAT | GRAIN
+ grind_results = list("flour" = 0, "blood" = 0)
/obj/item/reagent_containers/food/snacks/grown/meatwheat/attack_self(mob/living/user)
user.visible_message("[user] crushes [src] into meat.", "You crush [src] into something that resembles meat.")
diff --git a/code/modules/hydroponics/grown/citrus.dm b/code/modules/hydroponics/grown/citrus.dm
index 1b0cdc00d2..38f8a40ec3 100644
--- a/code/modules/hydroponics/grown/citrus.dm
+++ b/code/modules/hydroponics/grown/citrus.dm
@@ -30,6 +30,7 @@
desc = "It's so sour, your face will twist."
icon_state = "lime"
filling_color = "#00FF00"
+ juice_results = list("limejuice" = 0)
// Orange
/obj/item/seeds/orange
@@ -56,6 +57,7 @@
desc = "It's a tangy fruit."
icon_state = "orange"
filling_color = "#FFA500"
+ juice_results = list("orangejuice" = 0)
// Lemon
/obj/item/seeds/lemon
@@ -81,6 +83,7 @@
desc = "When life gives you lemons, make lemonade."
icon_state = "lemon"
filling_color = "#FFD700"
+ juice_results = list("lemonjuice" = 0)
// Combustible lemon
/obj/item/seeds/firelemon //combustible lemon is too long so firelemon
diff --git a/code/modules/hydroponics/grown/corn.dm b/code/modules/hydroponics/grown/corn.dm
index 827deaea47..4454c3c52a 100644
--- a/code/modules/hydroponics/grown/corn.dm
+++ b/code/modules/hydroponics/grown/corn.dm
@@ -25,6 +25,7 @@
trash = /obj/item/grown/corncob
bitesize_mod = 2
foodtype = VEGETABLES
+ juice_results = list("corn_starch" = 0)
/obj/item/grown/corncob
name = "corn cob"
diff --git a/code/modules/hydroponics/grown/flowers.dm b/code/modules/hydroponics/grown/flowers.dm
index e0845ffb2a..18eae2f4fd 100644
--- a/code/modules/hydroponics/grown/flowers.dm
+++ b/code/modules/hydroponics/grown/flowers.dm
@@ -182,6 +182,7 @@
throw_speed = 1
throw_range = 3
attack_verb = list("roasted", "scorched", "burned")
+ grind_results = list("capsaicin" = 0, "condensedcapsaicin" = 0)
/obj/item/grown/novaflower/add_juice()
..()
diff --git a/code/modules/hydroponics/grown/melon.dm b/code/modules/hydroponics/grown/melon.dm
index 5e64d716ec..a64fc4b156 100644
--- a/code/modules/hydroponics/grown/melon.dm
+++ b/code/modules/hydroponics/grown/melon.dm
@@ -33,6 +33,7 @@
filling_color = "#008000"
bitesize_mod = 3
foodtype = FRUIT
+ juice_results = list("watermelonjuice" = 0)
// Holymelon
/obj/item/seeds/watermelon/holy
diff --git a/code/modules/hydroponics/grown/nettle.dm b/code/modules/hydroponics/grown/nettle.dm
index 284f962e45..9ec936c1f2 100644
--- a/code/modules/hydroponics/grown/nettle.dm
+++ b/code/modules/hydroponics/grown/nettle.dm
@@ -43,6 +43,7 @@
throw_speed = 1
throw_range = 3
attack_verb = list("stung")
+ grind_results = list("sacid" = 0)
/obj/item/grown/nettle/suicide_act(mob/user)
user.visible_message("[user] is eating some of [src]! It looks like [user.p_theyre()] trying to commit suicide!")
@@ -91,6 +92,7 @@
icon_state = "deathnettle"
force = 30
throwforce = 15
+ grind_results = list("facid" = 1, "sacid" = 1)
/obj/item/grown/nettle/death/add_juice()
..()
diff --git a/code/modules/hydroponics/grown/potato.dm b/code/modules/hydroponics/grown/potato.dm
index 0a3cbc060c..e127b166ea 100644
--- a/code/modules/hydroponics/grown/potato.dm
+++ b/code/modules/hydroponics/grown/potato.dm
@@ -17,6 +17,7 @@
genes = list(/datum/plant_gene/trait/battery)
mutatelist = list(/obj/item/seeds/potato/sweet)
reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
+ juice_results = list("potato" = 0)
/obj/item/reagent_containers/food/snacks/grown/potato
seed = /obj/item/seeds/potato
diff --git a/code/modules/hydroponics/grown/pumpkin.dm b/code/modules/hydroponics/grown/pumpkin.dm
index d5257aeee7..7113a8feab 100644
--- a/code/modules/hydroponics/grown/pumpkin.dm
+++ b/code/modules/hydroponics/grown/pumpkin.dm
@@ -24,6 +24,7 @@
filling_color = "#FFA500"
bitesize_mod = 2
foodtype = VEGETABLES
+ juice_results = list("pumpkinjuice" = 0)
/obj/item/reagent_containers/food/snacks/grown/pumpkin/attackby(obj/item/W as obj, mob/user as mob, params)
if(W.is_sharp())
@@ -53,4 +54,5 @@
icon_state = "blumpkin"
filling_color = "#87CEFA"
bitesize_mod = 2
- foodtype = VEGETABLES
\ No newline at end of file
+ foodtype = VEGETABLES
+ juice_results = list("blumpkinjuice" = 0)
diff --git a/code/modules/hydroponics/grown/root.dm b/code/modules/hydroponics/grown/root.dm
index 8666db45a8..fd78fa6ffa 100644
--- a/code/modules/hydroponics/grown/root.dm
+++ b/code/modules/hydroponics/grown/root.dm
@@ -22,6 +22,7 @@
filling_color = "#FFA500"
bitesize_mod = 2
foodtype = VEGETABLES
+ juice_results = list("carrotjuice" = 0)
/obj/item/reagent_containers/food/snacks/grown/carrot/attackby(obj/item/I, mob/user, params)
if(I.is_sharp())
diff --git a/code/modules/hydroponics/grown/tea_coffee.dm b/code/modules/hydroponics/grown/tea_coffee.dm
index bd3b182c13..fc2ed221c5 100644
--- a/code/modules/hydroponics/grown/tea_coffee.dm
+++ b/code/modules/hydroponics/grown/tea_coffee.dm
@@ -14,7 +14,6 @@
icon_dead = "tea-dead"
genes = list(/datum/plant_gene/trait/repeated_harvest)
mutatelist = list(/obj/item/seeds/tea/astra)
- reagents_add = list("vitamin" = 0.04, "teapowder" = 0.1)
/obj/item/reagent_containers/food/snacks/grown/tea
seed = /obj/item/seeds/tea
@@ -22,6 +21,8 @@
desc = "These aromatic tips of the tea plant can be dried to make tea."
icon_state = "tea_aspera_leaves"
filling_color = "#008000"
+ grind_results = list("teapowder" = 0)
+ dry_grind = TRUE
// Tea Astra
/obj/item/seeds/tea/astra
@@ -39,6 +40,7 @@
name = "Tea Astra tips"
icon_state = "tea_astra_leaves"
filling_color = "#4582B4"
+ grind_results = list("teapowder" = 0, "salglu_solution" = 0)
// Coffee
@@ -67,6 +69,8 @@
icon_state = "coffee_arabica"
filling_color = "#DC143C"
bitesize_mod = 2
+ dry_grind = TRUE
+ grind_results = list("coffeepowder" = 0)
// Coffee Robusta
/obj/item/seeds/coffee/robusta
@@ -84,4 +88,5 @@
seed = /obj/item/seeds/coffee/robusta
name = "coffee robusta beans"
desc = "Increases robustness by 37 percent!"
- icon_state = "coffee_robusta"
\ No newline at end of file
+ icon_state = "coffee_robusta"
+ grind_results = list("coffeepowder" = 0, "morphine" = 0)
diff --git a/code/modules/hydroponics/grown/tomato.dm b/code/modules/hydroponics/grown/tomato.dm
index 1bc42b45c0..4d066e769e 100644
--- a/code/modules/hydroponics/grown/tomato.dm
+++ b/code/modules/hydroponics/grown/tomato.dm
@@ -23,6 +23,8 @@
filling_color = "#FF6347"
bitesize_mod = 2
foodtype = VEGETABLES
+ grind_results = list("ketchup" = 0)
+ juice_results = list("tomatojuice" = 0)
// Blood Tomato
/obj/item/seeds/tomato/blood
@@ -44,6 +46,7 @@
splat_type = /obj/effect/gibspawner/generic
filling_color = "#FF0000"
foodtype = VEGETABLES | GROSS
+ grind_results = list("ketchup" = 0, "blood" = 0)
// Blue Tomato
diff --git a/code/modules/hydroponics/growninedible.dm b/code/modules/hydroponics/growninedible.dm
index a77808f006..3b80fae6c0 100644
--- a/code/modules/hydroponics/growninedible.dm
+++ b/code/modules/hydroponics/growninedible.dm
@@ -62,3 +62,7 @@
/obj/item/grown/microwave_act(obj/machine/microwave/M)
return
+
+/obj/item/grown/on_grind()
+ for(var/i in 1 to grind_results.len)
+ grind_results[grind_results[i]] = round(seed.potency)
diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm
index 85ec19bfb9..809681ed6b 100644
--- a/code/modules/mob/living/simple_animal/friendly/mouse.dm
+++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm
@@ -110,3 +110,7 @@
eatverb = "devours"
list_reagents = list("nutriment" = 3, "vitamin" = 2)
foodtype = GROSS | MEAT | RAW
+ grind_results = list("blood" = 20, "liquidgibs" = 5)
+
+/obj/item/reagent_containers/food/snacks/deadmouse/on_grind()
+ reagents.clear_reagents()
diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm
index 0826a49c7c..1cd6b889c8 100644
--- a/code/modules/paperwork/pen.dm
+++ b/code/modules/paperwork/pen.dm
@@ -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
@@ -174,7 +175,12 @@
reagents.trans_to(M, reagents.total_volume)
+<<<<<<< HEAD
/obj/item/pen/sleepy/New()
+=======
+/obj/item/pen/sleepy/Initialize()
+ . = ..()
+>>>>>>> d447acd... All-In-One grinder results are now defined by type, not by huge lists (#33181)
create_reagents(45)
reagents.add_reagent("chloralhydrate2", 20)
reagents.add_reagent("mutetoxin", 15)
diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm
index 20038f5745..65babd7e00 100644
--- a/code/modules/paperwork/photocopier.dm
+++ b/code/modules/paperwork/photocopier.dm
@@ -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
diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm
index 48b045f680..6e908c0f6a 100644
--- a/code/modules/paperwork/photography.dm
+++ b/code/modules/paperwork/photography.dm
@@ -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?
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index 9e4e29ceb5..c1a4181666 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -472,6 +472,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restrai
attack_verb = list("whipped", "lashed", "disciplined", "flogged")
singular_name = "cable piece"
full_w_class = WEIGHT_CLASS_SMALL
+ grind_results = list("copper" = 2) //2 copper per cable in the coil
/obj/item/stack/cable_coil/cyborg
is_cyborg = 1
diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm
index 1e1407e852..8258d7ce0d 100644
--- a/code/modules/power/cell.dm
+++ b/code/modules/power/cell.dm
@@ -14,6 +14,7 @@
var/charge = 0 // note %age conveted to actual charge in New
var/maxcharge = 1000
materials = list(MAT_METAL=700, MAT_GLASS=50)
+ grind_results = list("lithium" = 15, "iron" = 5, "silicon" = 5)
var/rigged = 0 // true if rigged to explode
var/chargerate = 100 //how much power is given every tick in a recharger
var/self_recharge = 0 //does it self recharge, over time, or not?
@@ -107,6 +108,7 @@
to_chat(user, "You inject the solution into the power cell.")
if(S.reagents.has_reagent("plasma", 5))
rigged = 1
+ grind_results["plasma"] = 5
S.reagents.clear_reagents()
diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm
index 3acac6cee5..749dcb463e 100644
--- a/code/modules/power/lighting.dm
+++ b/code/modules/power/lighting.dm
@@ -680,6 +680,7 @@
var/base_state
var/switchcount = 0 // number of times switched
materials = list(MAT_GLASS=100)
+ grind_results = list("silicon" = 5, "nitrogen" = 10) //Nitrogen is used as a cheaper alternative to argon in incandescent lighbulbs
var/rigged = 0 // true if rigged to explode
var/brightness = 2 //how much light it gives off
diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
index 77fcd50306..223259f6f3 100644
--- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
+++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
@@ -2,7 +2,7 @@
#define MILK_TO_BUTTER_COEFF 15
/obj/machinery/reagentgrinder
- name = "All-In-One Grinder"
+ name = "\improper All-In-One Grinder"
desc = "From BlenderTech. Will It Blend? Let's test it out!"
icon = 'icons/obj/kitchen.dmi'
icon_state = "juicer1"
@@ -16,97 +16,6 @@
var/operating = FALSE
var/obj/item/reagent_containers/beaker = null
var/limit = 10
-
- var/static/list/blend_items = list(
- //Sheets
- /obj/item/stack/sheet/mineral/plasma = list("plasma" = 20),
- /obj/item/stack/sheet/metal = list("iron" = 20),
- /obj/item/stack/sheet/plasteel = list("iron" = 20, "plasma" = 20),
- /obj/item/stack/sheet/mineral/wood = list("carbon" = 20),
- /obj/item/stack/sheet/glass = list("silicon" = 20),
- /obj/item/stack/sheet/rglass = list("silicon" = 20, "iron" = 20),
- /obj/item/stack/sheet/mineral/uranium = list("uranium" = 20),
- /obj/item/stack/sheet/mineral/bananium = list("banana" = 20),
- /obj/item/stack/sheet/mineral/silver = list("silver" = 20),
- /obj/item/stack/sheet/mineral/gold = list("gold" = 20),
- /obj/item/stack/sheet/bluespace_crystal = list("bluespace" = 20),
- /obj/item/stack/cable_coil = list ("copper" = 5),
- /obj/item/ore/bluespace_crystal = list("bluespace" = 20),
- /obj/item/grown/nettle/basic = list("sacid" = 0),
- /obj/item/grown/nettle/death = list("facid" = 0, "sacid" = 0),
- /obj/item/grown/novaflower = list("capsaicin" = 0, "condensedcapsaicin" = 0),
- //Blender Stuff
- /obj/item/reagent_containers/food/snacks/donkpocket/warm = list("omnizine" = 3),
- /obj/item/reagent_containers/food/snacks/grown/soybeans = list("soymilk" = 0),
- /obj/item/reagent_containers/food/snacks/grown/tomato = list("ketchup" = 0),
- /obj/item/reagent_containers/food/snacks/grown/wheat = list("flour" = -5),
- /obj/item/reagent_containers/food/snacks/grown/oat = list("flour" = -5),
- /obj/item/reagent_containers/food/snacks/grown/rice = list("rice" = -5),
- /obj/item/reagent_containers/food/snacks/donut = list("sprinkles" = -2, "sugar" = 1),
- /obj/item/reagent_containers/food/snacks/grown/cherries = list("cherryjelly" = 0),
- /obj/item/reagent_containers/food/snacks/grown/bluecherries = list("bluecherryjelly" = 0),
- /obj/item/reagent_containers/food/snacks/egg = list("eggyolk" = -5),
- /obj/item/reagent_containers/food/snacks/deadmouse = list ("blood" = 20, "gibs" = 5), // You monster
- //Grinder stuff, but only if dry
- /obj/item/reagent_containers/food/snacks/grown/coffee/robusta = list("coffeepowder" = 0, "morphine" = 0),
- /obj/item/reagent_containers/food/snacks/grown/coffee = list("coffeepowder" = 0),
- /obj/item/reagent_containers/food/snacks/grown/tea/astra = list("teapowder" = 0, "salglu_solution" = 0),
- /obj/item/reagent_containers/food/snacks/grown/tea = list("teapowder" = 0),
- //Stuff that doesn't quite fit in the other categories
- /obj/item/electronics = list ("iron" = 10, "silicon" = 10),
- /obj/item/circuitboard = list ("silicon" = 20, "sacid" = 0.5), // Retrieving acid this way is extremely inefficient
- /obj/item/match = list ("phosphorus" = 2),
- /obj/item/device/toner = list ("iodine" = 40, "iron" = 10),
- /obj/item/photo = list ("iodine" = 4),
- /obj/item/pen = list ("iodine" = 2, "iron" = 1),
- /obj/item/reagent_containers/food/drinks/soda_cans = list ("aluminium" = 10),
- /obj/item/trash/can = list ("aluminium" = 10),
- /obj/item/device/flashlight/flare = list ("sulfur" = 15),
- /obj/item/device/flashlight/glowstick = list ("phenol" = 15, "hydrodgen" = 10, "oxygen" = 5),
- /obj/item/stock_parts/cell = list ("lithium" = 15, "iron" = 5, "silicon" = 5),
- /obj/item/soap = list ("lye" = 10),
- /obj/item/device/analyzer = list ("mercury" = 5, "iron" = 5, "silicon" = 5),
- /obj/item/lighter = list ("iron" = 1, "weldingfuel" = 5, "oil" = 5),
- /obj/item/light = list ("silicon" = 5, "nitrogen" = 10), //Nitrogen is used as a cheaper alternative to argon in incandescent lighbulbs
- /obj/item/cigbutt/ = list ("carbon" = 2),
- /obj/item/trash/coal = list ("carbon" = 20),
- /obj/item/stack/medical/bruise_pack = list ("styptic_powder" = 5),
- /obj/item/stack/medical/ointment = list ("silver_sulfadiazine" = 5),
- //All types that you can put into the grinder to transfer the reagents to the beaker. !Put all recipes above this.!
- /obj/item/slime_extract = list(),
- /obj/item/reagent_containers/pill = list(),
- /obj/item/reagent_containers/food = list(),
- /obj/item/reagent_containers/honeycomb = list(),
- /obj/item/toy/crayon = list(),
- /obj/item/clothing/mask/cigarette = list())
-
- var/static/list/juice_items = list(
- //Juicer Stuff
- /obj/item/reagent_containers/food/snacks/grown/corn = list("corn_starch" = 0),
- /obj/item/reagent_containers/food/snacks/grown/tomato = list("tomatojuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/carrot = list("carrotjuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/berries = list("berryjuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/banana = list("banana" = 0),
- /obj/item/reagent_containers/food/snacks/grown/potato = list("potato" = 0),
- /obj/item/reagent_containers/food/snacks/grown/citrus/lemon = list("lemonjuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/citrus/orange = list("orangejuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/citrus/lime = list("limejuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/watermelon = list("watermelonjuice" = 0),
- /obj/item/reagent_containers/food/snacks/watermelonslice = list("watermelonjuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/berries/poison = list("poisonberryjuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/pumpkin = list("pumpkinjuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/blumpkin = list("blumpkinjuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/apple = list("applejuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/grapes = list("grapejuice" = 0),
- /obj/item/reagent_containers/food/snacks/grown/grapes/green = list("grapejuice" = 0))
-
- var/static/list/dried_items = list(
- //Grinder stuff, but only if dry,
- /obj/item/reagent_containers/food/snacks/grown/coffee/robusta = list("coffeepowder" = 0, "morphine" = 0),
- /obj/item/reagent_containers/food/snacks/grown/coffee = list("coffeepowder" = 0),
- /obj/item/reagent_containers/food/snacks/grown/tea/astra = list("teapowder" = 0, "salglu_solution" = 0),
- /obj/item/reagent_containers/food/snacks/grown/tea = list("teapowder" = 0))
-
var/list/holdingitems
/obj/machinery/reagentgrinder/Initialize()
@@ -158,6 +67,7 @@
if(!user.transferItemToLoc(I, src))
to_chat(user, "[I] is stuck to your hand!")
return TRUE
+ to_chat(user, "You slide [I] into [src].")
beaker = I
update_icon()
updateUsrDialog()
@@ -165,15 +75,8 @@
to_chat(user, "There's already a container inside [src].")
return TRUE //no afterattack
- if(is_type_in_list(I, dried_items))
- if(istype(I, /obj/item/reagent_containers/food/snacks/grown))
- var/obj/item/reagent_containers/food/snacks/grown/G = I
- if(!G.dry)
- to_chat(user, "You must dry [G] first!")
- return TRUE
-
- if(length(holdingitems) >= limit)
- to_chat(user, "The machine cannot hold anymore items.")
+ if(holdingitems.len >= limit)
+ to_chat(user, "[src] is filled to capacity!")
return TRUE
//Fill machine with a bag!
@@ -192,14 +95,18 @@
updateUsrDialog()
return TRUE
- if (!is_type_in_list(I, blend_items) && !is_type_in_list(I, juice_items))
+ if(!I.grind_results && !I.juice_results)
if(user.a_intent == INTENT_HARM)
return ..()
else
- to_chat(user, "Cannot refine into a reagent!")
+ to_chat(user, "You cannot grind [I] into reagents!")
return TRUE
+ if(!I.grind_requirements(src)) //Error messages should be in the objects' definitions
+ return
+
if(user.transferItemToLoc(I, src))
+ to_chat(user, "You add [I] to [src].")
holdingitems[I] = TRUE
updateUsrDialog()
return FALSE
@@ -214,7 +121,7 @@
user.set_machine(src)
interact(user)
-/obj/machinery/reagentgrinder/interact(mob/user) // The microwave Menu
+/obj/machinery/reagentgrinder/interact(mob/user) // The microwave Menu //I am reasonably certain that this is not a microwave
var/is_chamber_empty = FALSE
var/is_beaker_ready = FALSE
var/processing_chamber = ""
@@ -307,60 +214,10 @@
holdingitems -= O
updateUsrDialog()
-/obj/machinery/reagentgrinder/proc/get_allowed_by_obj(obj/item/O)
- for (var/i in blend_items)
- if (istype(O, i))
- return blend_items[i]
-
-/obj/machinery/reagentgrinder/proc/get_allowed_juice_by_obj(obj/item/reagent_containers/food/snacks/O)
- for(var/i in juice_items)
- if(istype(O, i))
- return juice_items[i]
-
-/obj/machinery/reagentgrinder/proc/get_grownweapon_amount(obj/item/grown/O)
- if (!istype(O) || !O.seed)
- return 5
- else if (O.seed.potency == -1)
- return 5
- else
- return round(O.seed.potency)
-
-/obj/machinery/reagentgrinder/proc/get_juice_amount(obj/item/reagent_containers/food/snacks/grown/O)
- if (!istype(O) || !O.seed)
- return 5
- else if (O.seed.potency == -1)
- return 5
- else
- return round(5*sqrt(O.seed.potency))
-
/obj/machinery/reagentgrinder/proc/remove_object(obj/item/O)
holdingitems -= O
qdel(O)
-/obj/machinery/reagentgrinder/proc/juice()
- power_change()
- if(!beaker || (beaker && (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)))
- return
- operate_for(50, juicing = TRUE)
-
- //Snacks
- for(var/obj/item/i in holdingitems)
- var/obj/item/I = i
- if(istype(I, /obj/item/reagent_containers/food/snacks))
- var/obj/item/reagent_containers/food/snacks/O = I
- if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
- break
- var/list/allowed = get_allowed_juice_by_obj(O)
- if(isnull(allowed))
- break
- for(var/r_id in allowed)
- var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
- var/amount = get_juice_amount(O)
- beaker.reagents.add_reagent(r_id, min(amount, space))
- if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
- break
- remove_object(O)
-
/obj/machinery/reagentgrinder/proc/shake_for(duration)
var/offset = prob(50) ? -2 : 2
var/old_pixel_x = pixel_x
@@ -386,8 +243,26 @@
operating = FALSE
updateUsrDialog()
-/obj/machinery/reagentgrinder/proc/grind()
+/obj/machinery/reagentgrinder/proc/juice()
+ power_change()
+ if(!beaker || (beaker && (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)))
+ return
+ operate_for(50, juicing = TRUE)
+ for(var/obj/item/i in holdingitems)
+ if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
+ break
+ var/obj/item/I = i
+ if(I.juice_results)
+ juice_item(I)
+/obj/machinery/reagentgrinder/proc/juice_item(obj/item/I) //Juicing results can be found in respective object definitions
+ if(I.on_juice(src) == -1)
+ to_chat(usr, "[src] shorts out as it tries to juice up [I], and transfers it back to storage.")
+ return
+ beaker.reagents.add_reagent_list(I.juice_results)
+ remove_object(I)
+
+/obj/machinery/reagentgrinder/proc/grind()
power_change()
if(!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume))
return
@@ -396,82 +271,17 @@
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
break
var/obj/item/I = i
- //Snacks
- if(istype(I, /obj/item/reagent_containers/food/snacks))
- var/obj/item/reagent_containers/food/snacks/O = I
- var/list/allowed = get_allowed_by_obj(O)
- if(isnull(allowed))
- continue
- for(var/r_id in allowed)
- var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
- var/amount = allowed[r_id]
- if(amount <= 0)
- if(amount == 0)
- if (O.reagents != null && O.reagents.has_reagent("nutriment"))
- beaker.reagents.add_reagent(r_id, min(O.reagents.get_reagent_amount("nutriment"), space))
- O.reagents.remove_reagent("nutriment", min(O.reagents.get_reagent_amount("nutriment"), space))
- else
- if (O.reagents != null && O.reagents.has_reagent("nutriment"))
- beaker.reagents.add_reagent(r_id, min(round(O.reagents.get_reagent_amount("nutriment")*abs(amount)), space))
- O.reagents.remove_reagent("nutriment", min(O.reagents.get_reagent_amount("nutriment"), space))
- else
- O.reagents.trans_id_to(beaker, r_id, min(amount, space))
- if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
- break
- if(O.reagents.reagent_list.len == 0)
- remove_object(O)
- //Sheets
- else if(istype(I, /obj/item/stack/sheet))
- var/obj/item/stack/sheet/O = I
- var/list/allowed = get_allowed_by_obj(O)
- for(var/t in 1 to round(O.amount, 1))
- for(var/r_id in allowed)
- var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
- var/amount = allowed[r_id]
- beaker.reagents.add_reagent(r_id,min(amount, space))
- if (space < amount)
- break
- if(t == round(O.amount, 1))
- remove_object(O)
- break
- //Plants
- else if(istype(I, /obj/item/grown))
- var/obj/item/grown/O = I
- var/list/allowed = get_allowed_by_obj(O)
- for (var/r_id in allowed)
- var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
- var/amount = allowed[r_id]
- if (amount == 0)
- if (O.reagents != null && O.reagents.has_reagent(r_id))
- beaker.reagents.add_reagent(r_id,min(O.reagents.get_reagent_amount(r_id), space))
- else
- beaker.reagents.add_reagent(r_id,min(amount, space))
- if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
- break
- remove_object(O)
- else if(istype(I, /obj/item/slime_extract))
- var/obj/item/slime_extract/O = I
- var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
- if (O.reagents != null)
- var/amount = O.reagents.total_volume
- O.reagents.trans_to(beaker, min(amount, space))
- if (O.Uses > 0)
- beaker.reagents.add_reagent("slimejelly",min(20, space))
- remove_object(O)
- if(istype(I, /obj/item/reagent_containers))
- var/obj/item/reagent_containers/O = I
- var/amount = O.reagents.total_volume
- O.reagents.trans_to(beaker, amount)
- if(!O.reagents.total_volume)
- remove_object(O)
- else if(istype(I, /obj/item/toy/crayon))
- var/obj/item/toy/crayon/O = I
- for (var/r_id in O.reagent_contents)
- var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
- if(!space)
- break
- beaker.reagents.add_reagent(r_id, min(O.reagent_contents[r_id], space))
- remove_object(O)
+ if(I.grind_results)
+ grind_item(i)
+
+/obj/machinery/reagentgrinder/proc/grind_item(obj/item/I) //Grind results can be found in respective object definitions
+ if(I.on_grind(src) == -1) //Call on_grind() to change amount as needed, and stop grinding the item if it returns -1
+ to_chat(usr, "[src] shorts out as it tries to grind up [I], and transfers it back to storage.")
+ return
+ beaker.reagents.add_reagent_list(I.grind_results)
+ if(I.reagents)
+ I.reagents.trans_to(beaker, I.reagents.total_volume)
+ remove_object(I)
/obj/machinery/reagentgrinder/proc/mix(mob/user)
//For butter and other things that would change upon shaking or mixing
diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm
index 324623edbd..b1a126ba62 100644
--- a/code/modules/reagents/reagent_containers/pill.dm
+++ b/code/modules/reagents/reagent_containers/pill.dm
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
/obj/item/reagent_containers/pill
name = "pill"
desc = "A tablet or capsule."
@@ -152,3 +153,160 @@
icon_state = "pill9"
color = "#454545"
list_reagents = list("shadowmutationtoxin" = 1)
+=======
+/obj/item/reagent_containers/pill
+ name = "pill"
+ desc = "A tablet or capsule."
+ icon = 'icons/obj/chemical.dmi'
+ icon_state = "pill"
+ item_state = "pill"
+ lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
+ righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
+ possible_transfer_amounts = list()
+ volume = 50
+ grind_results = list()
+ var/apply_type = INGEST
+ var/apply_method = "swallow"
+ var/roundstart = 0
+ var/self_delay = 0 //pills are instant, this is because patches inheret their aplication from pills
+
+/obj/item/reagent_containers/pill/Initialize()
+ . = ..()
+ if(!icon_state)
+ icon_state = "pill[rand(1,20)]"
+ if(reagents.total_volume && roundstart)
+ name += " ([reagents.total_volume]u)"
+
+
+/obj/item/reagent_containers/pill/attack_self(mob/user)
+ return
+
+
+/obj/item/reagent_containers/pill/attack(mob/M, mob/user, def_zone)
+ if(!canconsume(M, user))
+ return 0
+
+ if(M == user)
+ M.visible_message("[user] attempts to [apply_method] [src].")
+ if(self_delay)
+ if(!do_mob(user, M, self_delay))
+ return 0
+ to_chat(M, "You [apply_method] [src].")
+
+ else
+ M.visible_message("[user] attempts to force [M] to [apply_method] [src].", \
+ "[user] attempts to force [M] to [apply_method] [src].")
+ if(!do_mob(user, M))
+ return 0
+ M.visible_message("[user] forces [M] to [apply_method] [src].", \
+ "[user] forces [M] to [apply_method] [src].")
+
+
+ add_logs(user, M, "fed", reagentlist(src))
+ if(reagents.total_volume)
+ reagents.reaction(M, apply_type)
+ reagents.trans_to(M, reagents.total_volume)
+ qdel(src)
+ return 1
+
+
+/obj/item/reagent_containers/pill/afterattack(obj/target, mob/user , proximity)
+ if(!proximity)
+ return
+ if(target.is_open_container() != 0 && target.reagents)
+ if(!target.reagents.total_volume)
+ to_chat(user, "[target] is empty! There's nothing to dissolve [src] in.")
+ return
+ to_chat(user, "You dissolve [src] in [target].")
+ for(var/mob/O in viewers(2, user)) //viewers is necessary here because of the small radius
+ to_chat(O, "[user] slips something into [target]!")
+ reagents.trans_to(target, reagents.total_volume)
+ qdel(src)
+
+/obj/item/reagent_containers/pill/tox
+ name = "toxins pill"
+ desc = "Highly toxic."
+ icon_state = "pill5"
+ list_reagents = list("toxin" = 50)
+ roundstart = 1
+/obj/item/reagent_containers/pill/cyanide
+ name = "cyanide pill"
+ desc = "Don't swallow this."
+ icon_state = "pill5"
+ list_reagents = list("cyanide" = 50)
+ roundstart = 1
+/obj/item/reagent_containers/pill/adminordrazine
+ name = "adminordrazine pill"
+ desc = "It's magic. We don't have to explain it."
+ icon_state = "pill16"
+ list_reagents = list("adminordrazine" = 50)
+ roundstart = 1
+/obj/item/reagent_containers/pill/morphine
+ name = "morphine pill"
+ desc = "Commonly used to treat insomnia."
+ icon_state = "pill8"
+ list_reagents = list("morphine" = 30)
+ roundstart = 1
+/obj/item/reagent_containers/pill/stimulant
+ name = "stimulant pill"
+ desc = "Often taken by overworked employees, athletes, and the inebriated. You'll snap to attention immediately!"
+ icon_state = "pill19"
+ list_reagents = list("ephedrine" = 10, "antihol" = 10, "coffee" = 30)
+ roundstart = 1
+/obj/item/reagent_containers/pill/salbutamol
+ name = "salbutamol pill"
+ desc = "Used to treat oxygen deprivation."
+ icon_state = "pill16"
+ list_reagents = list("salbutamol" = 30)
+ roundstart = 1
+/obj/item/reagent_containers/pill/charcoal
+ name = "charcoal pill"
+ desc = "Neutralizes many common toxins."
+ icon_state = "pill17"
+ list_reagents = list("charcoal" = 10)
+ roundstart = 1
+/obj/item/reagent_containers/pill/epinephrine
+ name = "epinephrine pill"
+ desc = "Used to stabilize patients."
+ icon_state = "pill5"
+ list_reagents = list("epinephrine" = 15)
+ roundstart = 1
+/obj/item/reagent_containers/pill/mannitol
+ name = "mannitol pill"
+ desc = "Used to treat brain damage."
+ icon_state = "pill17"
+ list_reagents = list("mannitol" = 50)
+ roundstart = 1
+/obj/item/reagent_containers/pill/mutadone
+ name = "mutadone pill"
+ desc = "Used to treat genetic damage."
+ icon_state = "pill20"
+ list_reagents = list("mutadone" = 50)
+ roundstart = 1
+/obj/item/reagent_containers/pill/salicyclic
+ name = "salicylic acid pill"
+ desc = "Used to dull pain."
+ icon_state = "pill9"
+ list_reagents = list("sal_acid" = 24)
+ roundstart = 1
+/obj/item/reagent_containers/pill/oxandrolone
+ name = "oxandrolone pill"
+ desc = "Used to stimulate burn healing."
+ icon_state = "pill11"
+ list_reagents = list("oxandrolone" = 24)
+ roundstart = 1
+
+/obj/item/reagent_containers/pill/insulin
+ name = "insulin pill"
+ desc = "Handles hyperglycaemic coma."
+ icon_state = "pill18"
+ list_reagents = list("insulin" = 50)
+ roundstart = 1
+
+/obj/item/reagent_containers/pill/shadowtoxin
+ name = "black pill"
+ desc = "I wouldn't eat this if I were you."
+ icon_state = "pill9"
+ color = "#454545"
+ list_reagents = list("shadowmutationtoxin" = 1)
+>>>>>>> d447acd... All-In-One grinder results are now defined by type, not by huge lists (#33181)
diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm
index cf250f50f1..7d8ff00e91 100644
--- a/code/modules/research/xenobiology/xenobiology.dm
+++ b/code/modules/research/xenobiology/xenobiology.dm
@@ -12,6 +12,7 @@
throw_speed = 3
throw_range = 6
container_type = INJECTABLE_1
+ grind_results = list()
var/Uses = 1 // uses before it goes inert
var/qdel_timer = null // deletion timer, for delayed reactions
@@ -29,6 +30,10 @@
. = ..()
create_reagents(100)
+/obj/item/slime_extract/on_grind()
+ if(Uses)
+ grind_results["slimejelly"] = 20
+
/obj/item/slime_extract/grey
name = "grey slime extract"
icon_state = "grey slime extract"