Makes warm donk pockets cooling after 7 minutes canon again.

This commit is contained in:
Ghommie
2020-04-18 15:40:18 +02:00
parent 19328b8710
commit 8d4a67fedc
3 changed files with 36 additions and 2 deletions

View File

@@ -16,7 +16,7 @@
AddComponent(component_type)
/obj/item/storage/AllowDrop()
return FALSE
return TRUE
/obj/item/storage/contents_explosion(severity, target)
for(var/atom/A in contents)

View File

@@ -283,7 +283,7 @@ All foods are distributed among various categories. Use common sense.
S.create_reagents(S.volume, reagent_flags, reagent_value)
if(reagents)
reagents.trans_to(S, reagents.total_volume)
if(S.bonus_reagents && S.bonus_reagents.len)
if(cooking_efficiency && length(S.bonus_reagents))
for(var/r_id in S.bonus_reagents)
var/amount = S.bonus_reagents[r_id] * cooking_efficiency
if(r_id == /datum/reagent/consumable/nutriment || r_id == /datum/reagent/consumable/nutriment/vitamin)

View File

@@ -440,6 +440,40 @@
filling_color = "#CD853F"
tastes = list("meat" = 2, "dough" = 2, "laziness" = 1)
foodtype = GRAIN
var/list/cached_reagents_amount
var/previous_typepath
/obj/item/reagent_containers/food/snacks/donkpocket/Initialize(mapload)
. = ..()
if(!cooked_type) //maploaded cooked donk pockets won't cool down anyway.
desc += " This one will stay warm for a long time, great."
/obj/item/reagent_containers/food/snacks/donkpocket/initialize_cooked_food(obj/item/reagent_containers/food/snacks/donkpocket/S, cooking_efficiency = 1)
. = ..()
if(istype(S))
desc = initial(desc) //reset the desc since will now cool down.
for(var/R in S.bonus_reagents)
LAZYSET(S.cached_reagents_amount, R, S.reagents.get_reagent_amount(R))
S.previous_typepath = type
addtimer(CALLBACK(S, .proc/cool_down), 7 MINUTES) //canonically they reverted back to normal after 7 minutes.
/obj/item/reagent_containers/food/snacks/donkpocket/proc/cool_down()
if(!previous_typepath) //This shouldn't happen.
qdel(src)
return
var/spoiled = FALSE
for(var/R in cached_reagents_amount)
var/amount = cached_reagents_amount[R]
if(reagents.get_reagent_amount(R) < amount)
spoiled = TRUE
reagents.remove_reagent(R, amount) //no reagent duping please.
var/obj/item/reagent_containers/food/snacks/donkpocket/D = new previous_typepath(drop_location())
D.create_reagents(D.volume, reagent_flags, reagent_value)
reagents.trans_to(D, reagents.total_volume)
if(spoiled)
D.cooked_type = null
D.desc += " This one has gone cold and mushy, pretty unsuitable for cooking."
qdel(src)
/obj/item/reagent_containers/food/snacks/donkpocket/warm
name = "warm Donk-pocket"