From 65ec7bedf8ed8e281ee487dd067cf3076732d894 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 4 Aug 2021 16:10:35 +0200 Subject: [PATCH] [MIRROR] Uncomments holymelon "check liked" code, makes it work with the edible component (#7384) * Uncomments holymelon "check liked" code, makes it work with the edible component (#60697) * Uncomments holymelon "check liked" code, makes it work with the edible component Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> --- .../mood_events/generic_positive_events.dm | 2 +- code/modules/hydroponics/grown/melon.dm | 34 +++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/code/datums/mood_events/generic_positive_events.dm b/code/datums/mood_events/generic_positive_events.dm index ef8db10eefa..01cfea5ea85 100644 --- a/code/datums/mood_events/generic_positive_events.dm +++ b/code/datums/mood_events/generic_positive_events.dm @@ -200,7 +200,7 @@ /datum/mood_event/holy_consumption description = "Truly, that was the food of the Divine!\n" - mood_change = 5 + mood_change = 1 // 1 + 5 from it being liked food makes it as good as jolly timeout = 3 MINUTES /datum/mood_event/high_five diff --git a/code/modules/hydroponics/grown/melon.dm b/code/modules/hydroponics/grown/melon.dm index a9a6771cf00..862d4b8211a 100644 --- a/code/modules/hydroponics/grown/melon.dm +++ b/code/modules/hydroponics/grown/melon.dm @@ -65,22 +65,34 @@ /obj/item/food/grown/holymelon/make_dryable() return //No drying +/obj/item/food/grown/holymelon/MakeEdible() + AddComponent(/datum/component/edible, \ + initial_reagents = food_reagents, \ + food_flags = food_flags, \ + foodtypes = foodtypes, \ + volume = max_volume, \ + eat_time = eat_time, \ + tastes = tastes, \ + eatverbs = eatverbs,\ + bite_consumption = bite_consumption, \ + microwaved_type = microwaved_type, \ + junkiness = junkiness, \ + check_liked = CALLBACK(src, .proc/check_holyness)) + /* -/obj/item/food/grown/holymelon/checkLiked(fraction, mob/M) //chaplains sure love holymelons - if(!ishuman(M)) + * Callback to be used with the edible component. + * Checks whether or not the person eating the holymelon + * is a holy_role (chaplain), as chaplains love holymelons. + */ +/obj/item/food/grown/holymelon/proc/check_holyness(fraction, mob/mob_eating) + if(!ishuman(mob_eating)) return - if(last_check_time + 5 SECONDS >= world.time) - return - var/mob/living/carbon/human/holy_person = M + var/mob/living/carbon/human/holy_person = mob_eating if(!holy_person.mind?.holy_role || HAS_TRAIT(holy_person, TRAIT_AGEUSIA)) return - to_chat(holy_person,span_notice("Truly, a piece of heaven!")) - M.adjust_disgust(-5 + -2.5 * fraction) + to_chat(holy_person, span_notice("Truly, a piece of heaven!")) SEND_SIGNAL(holy_person, COMSIG_ADD_MOOD_EVENT, "Divine_chew", /datum/mood_event/holy_consumption) - last_check_time = world.time - - -*/ + return FOOD_LIKED /// Barrel melon Seeds /obj/item/seeds/watermelon/barrel