From 927ccceeab68b83c53dec617e646b321ce96366a Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 25 Aug 2022 00:30:51 +0200 Subject: [PATCH] [MIRROR] Upgrade mortar, so it gives user an option to either grind or juice. [MDB IGNORE] (#15735) * Upgrade mortar, so it gives user an option to either grind or juice. (#69186) So this idea came to me, when I tried to grind Korta nut into Korta Flour in mortar. I failed and my dissapointment was immeasurable. Someone thought this was very smart to JUICE first, and if it's not juiceable, only then grind it. The solution is presented on the images below. Now you can choose to either grind or juice with the Stylish radial menu. Mortar now gives you an option. Do you want to grind or juice your thing? * Upgrade mortar, so it gives user an option to either grind or juice. Co-authored-by: Microvolnovka19 <59139863+Microvolnovka19@users.noreply.github.com> --- .../reagents/reagent_containers/glass.dm | 59 +++++++++++++------ 1 file changed, 42 insertions(+), 17 deletions(-) diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 04f48b1cae9..f0854441bd3 100755 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -350,7 +350,7 @@ /obj/item/reagent_containers/glass/mortar name = "mortar" - desc = "A specially formed bowl of ancient design. It is possible to crush or juice items placed in it using a pestle; however the process, unlike modern methods, is slow and physically exhausting. Alt click to eject the item." + desc = "A specially formed bowl of ancient design. It is possible to crush or juice items placed in it using a pestle; however the process, unlike modern methods, is slow and physically exhausting. Alt click to eject the item." icon_state = "mortar" amount_per_transfer_from_this = 10 possible_transfer_amounts = list(5, 10, 15, 20, 25, 30, 50, 100) @@ -373,22 +373,47 @@ if(user.getStaminaLoss() > 50) to_chat(user, span_warning("You are too tired to work!")) return - to_chat(user, span_notice("You start grinding...")) - if((do_after(user, 25, target = src)) && grinded) - user.adjustStaminaLoss(40) - if(grinded.juice_results) //prioritize juicing - grinded.on_juice() - reagents.add_reagent_list(grinded.juice_results) - to_chat(user, span_notice("You juice [grinded] into a fine liquid.")) - QDEL_NULL(grinded) - return - grinded.on_grind() - reagents.add_reagent_list(grinded.grind_results) - if(grinded.reagents) //food and pills - grinded.reagents.trans_to(src, grinded.reagents.total_volume, transfered_by = user) - to_chat(user, span_notice("You break [grinded] into powder.")) - QDEL_NULL(grinded) - return + var/list/choose_options = list( + "Grind" = image(icon = 'icons/hud/radial.dmi', icon_state = "radial_grind"), + "Juice" = image(icon = 'icons/hud/radial.dmi', icon_state = "radial_juice") + ) + var/picked_option = show_radial_menu(user, src, choose_options, radius = 38, require_near = TRUE) + if(grinded && in_range(src, user) && user.is_holding(I) && picked_option) + to_chat(user, span_notice("You start grinding...")) + if(do_after(user, 25, target = src)) + user.adjustStaminaLoss(40) + switch(picked_option) + if("Juice") //prioritize juicing + if(grinded.juice_results) + grinded.on_juice() + reagents.add_reagent_list(grinded.juice_results) + to_chat(user, span_notice("You juice [grinded] into a fine liquid.")) + QDEL_NULL(grinded) + return + else + grinded.on_grind() + reagents.add_reagent_list(grinded.grind_results) + grinded.reagents.trans_to(src, grinded.reagents.total_volume, transfered_by = user) + to_chat(user, span_notice("You try to juice [grinded] but there is no liquids in it. Instead you get nice powder.")) + QDEL_NULL(grinded) + return + if("Grind") + if(grinded.grind_results) + grinded.on_grind() + reagents.add_reagent_list(grinded.grind_results) + grinded.reagents.trans_to(src, grinded.reagents.total_volume, transfered_by = user) + to_chat(user, span_notice("You break [grinded] into powder.")) + QDEL_NULL(grinded) + return + else + grinded.on_juice() + reagents.add_reagent_list(grinded.juice_results) + to_chat(user, span_notice("You try to grind [grinded] but it almost instantly turns into a fine liquid.")) + QDEL_NULL(grinded) + return + else + to_chat(user, span_notice("You try to grind the mortar itself instead of [grinded]. You failed.")) + return return else to_chat(user, span_warning("There is nothing to grind!"))