diff --git a/code/game/objects/items_drying.dm b/code/game/objects/items_drying.dm index 940b66f4d50..e8696ba11af 100644 --- a/code/game/objects/items_drying.dm +++ b/code/game/objects/items_drying.dm @@ -1,26 +1,64 @@ // Stubs/vars for use with the drying rack. /obj/item - var/drying_threshold_temperature = 500 // Kelvin, checked in fire_act() - var/dried_type // If set to a type, drying this item will convert it to that type. + // Reduced when exposed to high temperatures or put on a drying rack. When hitting zero, the item transitions to a dried state. + var/drying_wetness + // Temperature threshold for fire_act() to dry the object, in degrees Kelvin. + var/drying_threshold_temperature = 500 + // If set to a type, drying this item will convert it to that type. + var/dried_type /obj/item/proc/is_dryable() - return !isnull(dried_type) + return drying_wetness > 0 + +/obj/item/proc/get_dried_product() + return new dried_type(loc) + +/obj/item/stack/get_dried_product() + if(ispath(dried_type, /obj/item/stack)) + return new dried_type(loc, amount) + return ..() // Returns null for no change, or an instance for a successful drying. -/obj/item/proc/dry_out(var/obj/rack, var/drying_power = 1) - if(dried_type) - . = new dried_type(loc) +/obj/item/proc/dry_out(var/obj/rack, var/drying_power = 1, var/fire_exposed = FALSE, var/silent = FALSE) + if(!dried_type) + return + if(drying_wetness > 0) + drying_wetness -= drying_power + if(drying_wetness > 0) + return + var/obj/item/thing = get_dried_product() + if(color) + thing.color = color + if(!silent && rack) + rack.visible_message(SPAN_NOTICE("The [src] is dry!")) + if(thing != src) qdel(src) + return thing // Returns a string used in drying rack examine(). /obj/item/proc/get_dryness_text(var/obj/rack) + if(drying_wetness > 20) + return "wet" + if(drying_wetness > 10) + return "damp" + if(drying_wetness) + return "almost dry" return "dry" // Returns an icon_state used by drying rack update_icon(). +/obj/item/proc/get_drying_overlay(var/obj/rack) + var/drying_state = get_drying_state(rack) + if(!drying_state || !color) + return drying_state + var/image/drying_overlay = image('icons/obj/drying_rack.dmi', drying_state) + drying_overlay.color = color + drying_overlay.appearance_flags |= KEEP_APART | RESET_COLOR + return drying_overlay + /obj/item/proc/get_drying_state(var/obj/rack) return /obj/item/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) ..() if(exposed_temperature >= drying_threshold_temperature) - dry_out() + dry_out(drying_power = rand(2, 4), fire_exposed = TRUE, silent = TRUE) diff --git a/code/game/objects/structures/bonfire.dm b/code/game/objects/structures/bonfire.dm index 8dffed474b6..217eeeaa241 100644 --- a/code/game/objects/structures/bonfire.dm +++ b/code/game/objects/structures/bonfire.dm @@ -237,10 +237,8 @@ extinguish() return if(grill) - for(var/obj/item/reagent_containers/food/snacks/snack in loc) - snack.grill(src) for(var/obj/item/thing in view(2, src)) - thing.dry_out(src, rand(1,4)) + thing.dry_out(src, 3 - get_dist(thing, src), (thing.loc == loc), silent = TRUE) else burn() diff --git a/code/modules/food/food/jerky.dm b/code/modules/food/food/jerky.dm new file mode 100644 index 00000000000..036be9944a0 --- /dev/null +++ b/code/modules/food/food/jerky.dm @@ -0,0 +1,21 @@ +// TODO +/obj/item/reagent_containers/food/snacks/fishjerky + name = "dried fish" + +/obj/item/reagent_containers/food/snacks/fishjerky/get_drying_state() + return "fish_dried" + +/obj/item/reagent_containers/food/snacks/meatjerky + name = "dried meat" + +/obj/item/reagent_containers/food/snacks/meatjerky/get_drying_state() + return "meat_dried" + +/obj/item/reagent_containers/food/snacks/meatjerky/cutlet/get_drying_state() + return "meat_dried_small" + +/obj/item/reagent_containers/food/snacks/spiderjerky + name = "dried spider meat" + +/obj/item/reagent_containers/food/snacks/spiderjerky/get_drying_state() + return "meat_dried" diff --git a/code/modules/food/food/snacks.dm b/code/modules/food/food/snacks.dm index 302cc7c2f60..95e511a5d8b 100644 --- a/code/modules/food/food/snacks.dm +++ b/code/modules/food/food/snacks.dm @@ -47,7 +47,13 @@ /obj/item/reagent_containers/food/snacks/is_dryable() return !dry -/obj/item/reagent_containers/food/snacks/dry_out(var/obj/rack, var/drying_power = 1) +/obj/item/reagent_containers/food/snacks/dry_out(var/obj/rack, var/drying_power = 1, var/fire_exposed = FALSE) + + // If it's a direct fire, cook the food instead. + if(fire_exposed) + return grill(rack) + + // Otherwise, try to dry it out. if(!dried_type || dry) return null if(dried_type == type) @@ -56,6 +62,7 @@ color = "#aaaaaa" rack?.visible_message(SPAN_NOTICE("\The [src] is dry!")) return src + return ..() /obj/item/reagent_containers/food/snacks @@ -76,7 +83,7 @@ /obj/item/reagent_containers/food/snacks/proc/grill(var/atom/heat_source) if(!backyard_grilling_product || !backyard_grilling_threshold) - return + return null backyard_grilling_progress++ if(backyard_grilling_progress >= backyard_grilling_threshold) backyard_grilling_progress = 0 @@ -88,6 +95,7 @@ else food.visible_message("\The [src] [backyard_grilling_announcement]") qdel(src) + return food //Placeholder for effect that trigger on eating that aren't tied to reagents. /obj/item/reagent_containers/food/snacks/proc/On_Consume(var/mob/M) @@ -897,10 +905,13 @@ filling_color = "#FFDEFE" center_of_mass = list("x"=17, "y"=13) bitesize = 6 - + dried_type = /obj/item/reagent_containers/food/snacks/fishjerky var/toxin_type = "carpotoxin" var/toxin_amount = 3 +/obj/item/reagent_containers/food/snacks/carpmeat/get_drying_state() + return "fish" + /obj/item/reagent_containers/food/snacks/carpmeat/Initialize() . = ..() reagents.add_reagent("seafood", 3) @@ -987,6 +998,9 @@ center_of_mass = list("x"=16, "y"=10) bitesize = 6 +/obj/item/reagent_containers/food/snacks/xenomeat/get_drying_state() + return "spidermeat" + /obj/item/reagent_containers/food/snacks/xenomeat/proc/add_venom() reagents.add_reagent("pacid",6) @@ -1004,6 +1018,7 @@ bitesize = 6 backyard_grilling_product = /obj/item/reagent_containers/food/snacks/xenomeat/spidermeat/charred backyard_grilling_announcement = "smokes as the poison burns away." + dried_type = /obj/item/reagent_containers/food/snacks/spiderjerky /obj/item/reagent_containers/food/snacks/xenomeat/spidermeat/add_venom() ..() @@ -1013,6 +1028,7 @@ name = "charred spider meat" desc = "A slab of green meat with char lines. The poison has been burned out of it." color = COLOR_LIGHT_RED + dried_type = null backyard_grilling_product = /obj/item/reagent_containers/food/snacks/badrecipe /obj/item/reagent_containers/food/snacks/xenomeat/spidermeat/charred/add_venom() @@ -1070,11 +1086,12 @@ whoops.dropInto(loc) visible_message(SPAN_DANGER("\The [src] chars and blackens!")) qdel(src) - return + return whoops // Otherwise we just warm up. heat() visible_message(SPAN_NOTICE("\The [src] steams gently!")) + return src /obj/item/reagent_containers/food/snacks/donkpocket/proc/heat() warm = 1 @@ -3833,20 +3850,6 @@ . = ..() reagents.add_reagent("protein", 3) -/obj/item/reagent_containers/food/snacks/rawcutlet - name = "raw cutlet" - desc = "A thin piece of raw meat." - icon = 'icons/obj/food_ingredients.dmi' - icon_state = "rawcutlet" - bitesize = 1 - center_of_mass = list("x"=17, "y"=20) - backyard_grilling_product = /obj/item/reagent_containers/food/snacks/cutlet - backyard_grilling_announcement = "sizzles as it is grilled through." - -/obj/item/reagent_containers/food/snacks/rawcutlet/Initialize() - . = ..() - reagents.add_reagent("protein", 1) - /obj/item/reagent_containers/food/snacks/cutlet name = "cutlet" desc = "A tasty meat slice." diff --git a/code/modules/food/food/snacks/meat.dm b/code/modules/food/food/snacks/meat.dm index 05fc067611b..42811ddbaa0 100644 --- a/code/modules/food/food/snacks/meat.dm +++ b/code/modules/food/food/snacks/meat.dm @@ -5,6 +5,10 @@ health = 180 filling_color = "#FF1C1C" center_of_mass = list("x"=16, "y"=14) + dried_type = /obj/item/reagent_containers/food/snacks/meatjerky + +/obj/item/reagent_containers/food/snacks/meat/get_drying_state() + return "meat" /obj/item/reagent_containers/food/snacks/meat/Initialize() . = ..() @@ -32,6 +36,21 @@ else ..() +/obj/item/reagent_containers/food/snacks/rawcutlet + name = "raw cutlet" + desc = "A thin piece of raw meat." + icon = 'icons/obj/food_ingredients.dmi' + icon_state = "rawcutlet" + bitesize = 1 + center_of_mass = list("x"=17, "y"=20) + backyard_grilling_product = /obj/item/reagent_containers/food/snacks/cutlet + backyard_grilling_announcement = "sizzles as it is grilled through." + dried_type = /obj/item/reagent_containers/food/snacks/meatjerky/cutlet + +/obj/item/reagent_containers/food/snacks/rawcutlet/Initialize() + . = ..() + reagents.add_reagent("protein", 1) + /obj/item/reagent_containers/food/snacks/meat/syntiflesh name = "synthetic meat" desc = "A synthetic slab of flesh." diff --git a/code/modules/food/kitchen/smartfridge/drying_rack.dm b/code/modules/food/kitchen/smartfridge/drying_rack.dm index 7089e4ef2dc..60002e0c553 100644 --- a/code/modules/food/kitchen/smartfridge/drying_rack.dm +++ b/code/modules/food/kitchen/smartfridge/drying_rack.dm @@ -14,7 +14,7 @@ return var/do_update = FALSE for(var/obj/item/thing in contents) - var/obj/item/product = thing.dry_out(src) + var/obj/item/product = thing.dry_out(src, silent = TRUE) if(product) product.dropInto(loc) do_update = TRUE diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index eee7b4eb21b..49508c437ee 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -64,6 +64,9 @@ if(seed.get_trait(TRAIT_STINGS)) force = 1 +/obj/item/reagent_containers/food/snacks/grown/get_drying_state(var/obj/rack) + return seed?.drying_state || "grown" + /obj/item/reagent_containers/food/snacks/grown/proc/update_desc() if(!seed) diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index d391bf5da3e..f626e350868 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -32,6 +32,9 @@ var/backyard_grilling_product = /obj/item/reagent_containers/food/snacks/badrecipe var/backyard_grilling_announcement = "smokes and chars!" + // Used to show an icon when drying in a rack. + var/drying_state = "grown" + // Making the assumption anything in HYDRO-ponics is capable of processing water, and nutrients commonly associated with it, leaving us with the below to be tweaked. var/list/beneficial_reagents // Reagents considered uniquely 'beneficial' by a plant. var/list/mutagenic_reagents // Reagents considered uniquely 'mutagenic' by a plant. diff --git a/code/modules/materials/sheets/organic/tanning/leather_wet.dm b/code/modules/materials/sheets/organic/tanning/leather_wet.dm index 6a67362cfbe..421ec67ac45 100644 --- a/code/modules/materials/sheets/organic/tanning/leather_wet.dm +++ b/code/modules/materials/sheets/organic/tanning/leather_wet.dm @@ -11,42 +11,20 @@ no_variants = FALSE max_amount = 20 stacktype = "wetleather" - var/wetness = 30 //Reduced when exposed to high temperautres - -/obj/item/stack/wetleather/is_dryable() - return wetness > 0 + drying_wetness = 30 + dried_type = /obj/item/stack/material/leather /obj/item/stack/wetleather/get_drying_state(var/obj/rack) - if(wetness) - return "leather_wet" - return "leather_dry" + return (drying_wetness > 0 ? "leather_wet" : "leather_dry") /obj/item/stack/wetleather/examine(var/mob/user) . = ..() . += description_info . += "\The [src] is [get_dryness_text()]." -/obj/item/stack/wetleather/get_dryness_text(var/obj/rack) - if(wetness > 20) - return "wet" - if(wetness > 10) - return "damp" - if(wetness) - return "almost dry" - return ..() - /obj/item/stack/wetleather/transfer_to(obj/item/stack/S, var/tamount=null, var/type_verified) . = ..() if(.) // If it transfers any, do a weighted average of the wetness var/obj/item/stack/wetleather/W = S var/oldamt = W.amount - . - W.wetness = round(((oldamt * W.wetness) + (. * wetness)) / W.amount) - -/obj/item/stack/wetleather/dry_out(var/obj/rack, var/drying_power = 1) - if(wetness <= 0) - return null - wetness -= drying_power - if(wetness <= 0) - . = new /obj/item/stack/material/leather(loc, amount) - rack?.visible_message(SPAN_NOTICE("The [src] is dry!")) - qdel(src) + W.drying_wetness = round(((oldamt * W.drying_wetness) + (. * drying_wetness)) / W.amount) diff --git a/code/modules/materials/sheets/organic/tanning/tanning_rack.dm b/code/modules/materials/sheets/organic/tanning/tanning_rack.dm index 305c7ec9630..2997277443c 100644 --- a/code/modules/materials/sheets/organic/tanning/tanning_rack.dm +++ b/code/modules/materials/sheets/organic/tanning/tanning_rack.dm @@ -1,8 +1,8 @@ /obj/structure/drying_rack name = "drying rack" desc = "A rack used to stretch leather out and hold it taut during the tanning process." - icon = 'icons/obj/kitchen.dmi' - icon_state = "spike" + icon = 'icons/obj/drying_rack.dmi' + icon_state = "rack" var/obj/item/drying /obj/structure/drying_rack/Initialize() @@ -32,7 +32,7 @@ /obj/structure/drying_rack/update_icon() cut_overlays() - var/drying_state = drying?.get_drying_state(src) + var/drying_state = drying?.get_drying_overlay(src) if(drying_state) add_overlay(drying_state) diff --git a/code/modules/reagents/reagents/toxins.dm b/code/modules/reagents/reagents/toxins.dm index 4f630422b33..b24effd26de 100644 --- a/code/modules/reagents/reagents/toxins.dm +++ b/code/modules/reagents/reagents/toxins.dm @@ -396,7 +396,7 @@ var/obj/item/stack/wetleather/wethide = new(O.loc, round(volume)) dryhide.use(round(volume)) if(!QDELETED(wethide) && wethide.get_amount()) - wethide.dry_out(null, INFINITY) // dry it immediately + wethide.dry_out(drying_power = INFINITY, silent = TRUE) // dry it immediately ..() /datum/reagent/toxin/plantbgone diff --git a/icons/obj/drying_rack.dmi b/icons/obj/drying_rack.dmi new file mode 100644 index 00000000000..950ada402ed Binary files /dev/null and b/icons/obj/drying_rack.dmi differ diff --git a/icons/obj/kitchen.dmi b/icons/obj/kitchen.dmi index 7215f2f6fe7..d49a8a2ecde 100644 Binary files a/icons/obj/kitchen.dmi and b/icons/obj/kitchen.dmi differ diff --git a/polaris.dme b/polaris.dme index dca57ae313d..0cf8774497c 100644 --- a/polaris.dme +++ b/polaris.dme @@ -1907,6 +1907,7 @@ #include "code\modules\food\food\cans.dm" #include "code\modules\food\food\condiment.dm" #include "code\modules\food\food\drinks.dm" +#include "code\modules\food\food\jerky.dm" #include "code\modules\food\food\lunch.dm" #include "code\modules\food\food\sandwich.dm" #include "code\modules\food\food\snacks.dm"