Makes warm donk pockets cooling after 7 minutes canon again.
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
AddComponent(component_type)
|
AddComponent(component_type)
|
||||||
|
|
||||||
/obj/item/storage/AllowDrop()
|
/obj/item/storage/AllowDrop()
|
||||||
return FALSE
|
return TRUE
|
||||||
|
|
||||||
/obj/item/storage/contents_explosion(severity, target)
|
/obj/item/storage/contents_explosion(severity, target)
|
||||||
for(var/atom/A in contents)
|
for(var/atom/A in contents)
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ All foods are distributed among various categories. Use common sense.
|
|||||||
S.create_reagents(S.volume, reagent_flags, reagent_value)
|
S.create_reagents(S.volume, reagent_flags, reagent_value)
|
||||||
if(reagents)
|
if(reagents)
|
||||||
reagents.trans_to(S, reagents.total_volume)
|
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)
|
for(var/r_id in S.bonus_reagents)
|
||||||
var/amount = S.bonus_reagents[r_id] * cooking_efficiency
|
var/amount = S.bonus_reagents[r_id] * cooking_efficiency
|
||||||
if(r_id == /datum/reagent/consumable/nutriment || r_id == /datum/reagent/consumable/nutriment/vitamin)
|
if(r_id == /datum/reagent/consumable/nutriment || r_id == /datum/reagent/consumable/nutriment/vitamin)
|
||||||
|
|||||||
@@ -440,6 +440,40 @@
|
|||||||
filling_color = "#CD853F"
|
filling_color = "#CD853F"
|
||||||
tastes = list("meat" = 2, "dough" = 2, "laziness" = 1)
|
tastes = list("meat" = 2, "dough" = 2, "laziness" = 1)
|
||||||
foodtype = GRAIN
|
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
|
/obj/item/reagent_containers/food/snacks/donkpocket/warm
|
||||||
name = "warm Donk-pocket"
|
name = "warm Donk-pocket"
|
||||||
|
|||||||
Reference in New Issue
Block a user