From 9c01ad5534a06fcd45f79f7ca7035d38c367db7d Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 13 Jan 2022 05:34:15 +0100 Subject: [PATCH] [MIRROR] Fortune cookies now give you your fortune [MDB IGNORE] (#10650) * Fortune cookies now give you your fortune (#63993) I have no idea when fortune cookies stopped doing this, but I am 100% certain they used to. * Fortune cookies now give you your fortune Co-authored-by: Ron --- code/game/objects/items/food/pastries.dm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/code/game/objects/items/food/pastries.dm b/code/game/objects/items/food/pastries.dm index f00de543041..78d857835e0 100644 --- a/code/game/objects/items/food/pastries.dm +++ b/code/game/objects/items/food/pastries.dm @@ -585,12 +585,29 @@ name = "fortune cookie" desc = "A true prophecy in each cookie!" icon_state = "fortune_cookie" + trash_type = /obj/item/paper food_reagents = list(/datum/reagent/consumable/nutriment = 5) tastes = list("cookie" = 1) foodtypes = GRAIN | SUGAR food_flags = FOOD_FINGER_FOOD w_class = WEIGHT_CLASS_SMALL +/obj/item/food/fortunecookie/proc/get_fortune() + var/atom/drop_location = drop_location() + + var/obj/item/paper/fortune = locate(/obj/item/paper) in src + // If a fortune exists, use that. + if (fortune) + fortune.forceMove(drop_location) + return fortune + // Otherwise, make a blank page. + var/out_paper = new trash_type(drop_location) + return out_paper + +/obj/item/food/fortunecookie/MakeLeaveTrash() + if(trash_type) + AddElement(/datum/element/food_trash, trash_type, food_flags, /obj/item/food/fortunecookie/proc/get_fortune) + /obj/item/food/poppypretzel name = "poppy pretzel" desc = "It's all twisted up!"