Food decomposition can mold stuff into different items, and not just moldy messes. (#61233)

Originally the component only allowed food to decompose into the generic moldy mess. This PR changes the component so that what item the component decomposes something into can be changed per attached object. I've added a few examples; bread types > moldy bread, pizza slice types > moldy pizza slices, dead mice > moldy dead mice (they need a sprite still, I'll get to that later. Kinda catbrained rn.)

edit:
Makes sure that none of this moldy food touches cytology unnecessarily.

Rotten eggs have been added (decomposed eggs), along with rotten boiled eggs. The only way to determine if an egg is good or not requires using a container of water on the egg. If it floats, it's rotten! They also do not produce ants when they decompose, so chickens no longer get eaten alive by swarms of ants for producing all these eggs.

fixes #61188
This commit is contained in:
necromanceranne
2021-09-18 09:40:16 +01:00
committed by GitHub
parent 85455b205c
commit 25cfbef9cd
10 changed files with 86 additions and 11 deletions
+1 -1
View File
@@ -44962,7 +44962,7 @@
"nWN" = (
/obj/effect/decal/cleanable/dirt/dust,
/obj/structure/bed/roller,
/obj/item/food/pizzaslice/moldy,
/obj/item/food/pizzaslice/moldy/bacteria,
/turf/open/floor/iron/white,
/area/medical/abandoned)
"nXg" = (
+11 -3
View File
@@ -20,16 +20,23 @@
var/time_remaining = DECOMPOSITION_TIME
/// Used to give raw/gross food lower timers
var/decomp_flags
/// Use for determining what kind of item the food decomposes into.
var/decomp_result
/// Does our food attract ants?
var/produce_ants = TRUE
/// Used for examining
var/examine_type = DECOMP_EXAM_NORMAL
/datum/component/decomposition/Initialize(mapload, decomp_req_handle, decomp_flags = NONE)
/datum/component/decomposition/Initialize(mapload, decomp_req_handle, decomp_flags = NONE, decomp_result, ant_attracting = TRUE)
if(!isobj(parent))
return COMPONENT_INCOMPATIBLE
src.decomp_flags = decomp_flags
src.decomp_result = decomp_result
if(mapload || decomp_req_handle)
handled = FALSE
if(!ant_attracting)
produce_ants = FALSE
RegisterSignal(parent, COMSIG_MOVABLE_MOVED, .proc/handle_movement)
RegisterSignal(parent, list(
@@ -104,8 +111,9 @@
/datum/component/decomposition/proc/decompose()
var/obj/decomp = parent //Lets us spawn things at decomp
new /obj/effect/decal/cleanable/ants(decomp.loc)
new /obj/item/food/badrecipe/moldy(decomp.loc)
if(produce_ants)
new /obj/effect/decal/cleanable/ants(decomp.loc)
new decomp_result(decomp.loc)
decomp.visible_message("<span class='notice'>[decomp] gets overtaken by mold and ants! Gross!</span>")
qdel(decomp)
return
+6 -1
View File
@@ -40,6 +40,10 @@
var/venue_value
///Food that's immune to decomposition.
var/preserved_food = FALSE
///Does our food normally attract ants?
var/ant_attracting = TRUE
///What our food decomposes into.
var/decomp_type = /obj/item/food/badrecipe/moldy
///Food that needs to be picked up in order to decompose.
var/decomp_req_handle = FALSE
@@ -102,4 +106,5 @@
///Set decomp_req_handle to TRUE to only make it decompose when someone picks it up.
/obj/item/food/proc/MakeDecompose(mapload)
if(!preserved_food)
AddComponent(/datum/component/decomposition, mapload, decomp_req_handle, decomp_flags = foodtypes)
AddComponent(/datum/component/decomposition, mapload, decomp_req_handle, decomp_flags = foodtypes, decomp_result = decomp_type, ant_attracting = ant_attracting)
+8 -2
View File
@@ -48,20 +48,26 @@
foodtypes = GRAIN
food_reagents = list(/datum/reagent/consumable/nutriment = 2)
venue_value = FOOD_PRICE_TRASH
decomp_type = /obj/item/food/breadslice/moldy
/obj/item/food/breadslice/plain/Initialize()
. = ..()
AddComponent(/datum/component/customizable_reagent_holder, null, CUSTOM_INGREDIENT_ICON_STACK)
/obj/item/food/breadslice/moldy
name = "moldy bread slice"
name = "moldy 'bread' slice"
desc = "Entire stations have been ripped apart over arguing whether this is still good to eat."
icon_state = "moldybreadslice"
food_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/mold = 10)
tastes = list("decaying fungus" = 1)
foodtypes = GROSS
preserved_food = TRUE
/obj/item/food/breadslice/moldy/Initialize()
/obj/item/food/breadslice/moldy/bacteria
name = "bacteria rich moldy 'bread' slice"
desc = "Something (possibly necroyeast) has caused this bread to rise in a macabre state of unlife. It lurchs about when unattended. You might want to locate a priest if you see this. Or maybe a flamethrower."
/obj/item/food/breadslice/moldy/bacteria/Initialize()
. = ..()
AddElement(/datum/element/swabable, CELL_LINE_TABLE_MOLD, CELL_VIRUS_TABLE_GENERIC, rand(2,4), 25)
+27
View File
@@ -19,8 +19,17 @@
microwaved_type = /obj/item/food/boiledegg
foodtypes = MEAT
w_class = WEIGHT_CLASS_TINY
ant_attracting = FALSE
decomp_type = /obj/item/food/egg/rotten
decomp_req_handle = TRUE //so laid eggs can actually become chickens
var/static/chick_count = 0 //I copied this from the chicken_count (note the "en" in there) variable from chicken code.
/obj/item/food/egg/rotten
food_reagents = list(/datum/reagent/consumable/eggrot = 10, /datum/reagent/consumable/mold = 10)
microwaved_type = /obj/item/food/boiledegg/rotten
foodtypes = GROSS
preserved_food = TRUE
/obj/item/food/egg/gland
desc = "An egg! It looks weird..."
@@ -53,11 +62,21 @@
to_chat(usr, span_notice("You colour [src] with [W]."))
icon_state = "egg-[clr]"
else if(istype(W, /obj/item/stamp/clown))
var/clowntype = pick("grock", "grimaldi", "rainbow", "chaos", "joker", "sexy", "standard", "bobble", "krusty", "bozo", "pennywise", "ronald", "jacobs", "kelly", "popov", "cluwne")
icon_state = "egg-clown-[clowntype]"
desc = "An egg that has been decorated with the grotesque, robustable likeness of a clown's face. "
to_chat(usr, span_notice("You stamp [src] with [W], creating an artistic and not remotely horrifying likeness of clown makeup."))
else if(is_reagent_container(W))
var/obj/item/reagent_containers/dunk_test_container = W
if(dunk_test_container.is_drainable() && dunk_test_container.reagents.has_reagent(/datum/reagent/water))
to_chat(user, span_notice("You check if [src] is rotten."))
if(istype(src, /obj/item/food/egg/rotten))
to_chat(user, span_warning("[src] floats in the [dunk_test_container]!"))
else
to_chat(user, span_notice("[src] sinks into the [dunk_test_container]!"))
else
..()
@@ -104,6 +123,14 @@
foodtypes = MEAT | BREAKFAST
food_flags = FOOD_FINGER_FOOD
w_class = WEIGHT_CLASS_SMALL
ant_attracting = FALSE
decomp_type = /obj/item/food/boiledegg/rotten
/obj/item/food/boiledegg/rotten
food_reagents = list(/datum/reagent/consumable/eggrot = 10)
tastes = list("rotten egg" = 1)
foodtypes = GROSS
preserved_food = TRUE
/obj/item/food/omelette //FUCK THIS
name = "omelette du fromage"
+5 -1
View File
@@ -201,7 +201,11 @@
desc = "A rancid, disgusting culture of mold and ants. Somewhere under there, at <i>some point,</i> there was food."
food_reagents = list(/datum/reagent/consumable/mold = 30)
/obj/item/food/badrecipe/moldy/Initialize()
/obj/item/food/badrecipe/moldy/bacteria
name = "bacteria rich moldy mess"
desc = "Not only is this rancid lump of disgusting bile crawling with insect life, but it is also teeming with various microscopic cultures. <i>It moves when you're not looking.</i>"
/obj/item/food/badrecipe/moldy/bacteria/Initialize()
. = ..()
AddElement(/datum/element/swabable, CELL_LINE_TABLE_MOLD, CELL_VIRUS_TABLE_GENERIC, rand(2,4), 25)
+8 -2
View File
@@ -33,8 +33,9 @@
food_reagents = list(/datum/reagent/consumable/nutriment = 5)
foodtypes = GRAIN | DAIRY | VEGETABLES
w_class = WEIGHT_CLASS_SMALL
decomp_type = /obj/item/food/pizzaslice/moldy
/obj/item/food/pizzaslice/MakeProcessable()
/obj/item/food/pizzaslice/bacteria/MakeProcessable()
AddElement(/datum/element/processable, TOOL_ROLLINGPIN, /obj/item/stack/sheet/pizza, 1, 10)
@@ -277,8 +278,13 @@
food_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/peptides = 3, /datum/reagent/consumable/tomatojuice = 1, /datum/reagent/toxin/amatoxin = 2)
tastes = list("stale crust" = 1, "rancid cheese" = 2, "mushroom" = 1)
foodtypes = GRAIN | VEGETABLES | DAIRY | GROSS
preserved_food = TRUE
/obj/item/food/pizzaslice/moldy/Initialize()
/obj/item/food/pizzaslice/moldy/bacteria
name = "bacteria rich moldy pizza slice"
desc = "Not only is this once delicious pizza encrusted with a layer of spore-spewing fungus, it also seems to shift and slide when unattended, teeming with new life."
/obj/item/food/pizzaslice/moldy/bacteria/Initialize()
. = ..()
AddElement(/datum/element/swabable, CELL_LINE_TABLE_MOLD, CELL_VIRUS_TABLE_GENERIC, rand(2,4), 25)
@@ -125,6 +125,9 @@
if(prob(50))
new /obj/effect/spawner/lootdrop/refreshing_beverage(src)
if(prob(40))
new /obj/item/food/pizzaslice/moldy(src)
if(prob(50))
new /obj/item/food/pizzaslice/moldy/bacteria(src)
else
new /obj/item/food/breadslice/moldy/bacteria(src)
else if(prob(30))
new /obj/item/food/syndicake(src)
@@ -203,6 +203,7 @@
foodtypes = GROSS | MEAT | RAW
grind_results = list(/datum/reagent/blood = 20, /datum/reagent/liquidgibs = 5)
decomp_req_handle = TRUE
decomp_type = /obj/item/food/deadmouse/moldy
/obj/item/food/deadmouse/Initialize()
. = ..()
@@ -240,3 +241,11 @@
/obj/item/food/deadmouse/on_grind()
. = ..()
reagents.clear_reagents()
/obj/item/food/deadmouse/moldy
name = "moldy dead mouse"
desc = "A dead rodent, consumed by mold and rot. There is a slim chance that a lizard might still eat it."
icon_state = "mouse_gray_dead"
food_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 2, /datum/reagent/consumable/mold = 10)
grind_results = list(/datum/reagent/blood = 20, /datum/reagent/liquidgibs = 5, /datum/reagent/consumable/mold = 10)
preserved_food = TRUE
@@ -656,6 +656,13 @@
taste_description = "rancid fungus"
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/consumable/eggrot
name = "Rotten Eggyolk"
description = "It smells absolutely dreadful."
color ="#708a88"
taste_description = "rotten eggs"
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/consumable/tearjuice
name = "Tear Juice"
description = "A blinding substance extracted from certain onions."