From e1d608f45b57ec242efe8b34afaf4271c9665ed9 Mon Sep 17 00:00:00 2001
From: FloFluoro <3611705+FloFluoro@users.noreply.github.com>
Date: Thu, 24 Nov 2022 17:17:58 -0500
Subject: [PATCH] Drask can no longer eat soap for infinite nutrition (#19664)
* Drask can no longer eat soap for infinite nutrition
* Added max_bites var
* Fix redundant return, syntax
* Splits soapeating behavior into own proc, design team requests
* overeat_limit is now a define
* Reduced weaken time, feedback
* Removed overeat penalty
---
code/game/objects/items/weapons/soap.dm | 31 +++++++++++++++++++++----
1 file changed, 27 insertions(+), 4 deletions(-)
diff --git a/code/game/objects/items/weapons/soap.dm b/code/game/objects/items/weapons/soap.dm
index 84249f3e11b..cfaef04d9ca 100644
--- a/code/game/objects/items/weapons/soap.dm
+++ b/code/game/objects/items/weapons/soap.dm
@@ -12,6 +12,8 @@
throw_range = 20
discrete = 1
var/cleanspeed = 50 //slower than mop
+ var/times_eaten = 0 //How many times a Drask has chewed on this bar of soap
+ var/max_bites = 30 //The maximum amount of bites before the soap is depleted
/obj/item/soap/Initialize(mapload)
. = ..()
@@ -23,12 +25,33 @@
if(target == user && user.a_intent == INTENT_GRAB && ishuman(target))
var/mob/living/carbon/human/muncher = user
if(muncher && isdrask(muncher))
- to_chat(user, "You take a bite of [src]. Delicious!")
- playsound(user.loc, 'sound/items/eatfood.ogg', 50, 0)
- user.adjust_nutrition(2)
- return
+ eat_soap(muncher)
+ return
target.cleaning_act(user, src, cleanspeed)
+/obj/item/soap/proc/eat_soap(mob/living/carbon/human/drask/user)
+ times_eaten++
+ playsound(user.loc, 'sound/items/eatfood.ogg', 50, 0)
+ user.adjust_nutrition(5)
+ if(times_eaten < max_bites)
+ to_chat(user, "You take a bite of [src]. Delicious!")
+ else
+ to_chat(user, "You finish eating [src].")
+ qdel(src)
+
+/obj/item/soap/examine(mob/user)
+ . = ..()
+ if(!user.Adjacent(src) || !times_eaten)
+ return
+ if(times_eaten < (max_bites * 0.3))
+ . += "[src] has bite marks on it!"
+ else if(times_eaten < (max_bites * 0.6))
+ . += "Big chunks of [src] have been chewed off!"
+ else if(times_eaten < (max_bites * 0.9))
+ . += "Most of [src] has been gnawed away!"
+ else
+ . += "[src] has been eaten down to a sliver!"
+
/obj/item/soap/attack(mob/target as mob, mob/user as mob)
if(target && user && ishuman(target) && ishuman(user) && !target.stat && !user.stat && user.zone_selected == "mouth" )
user.visible_message("\the [user] washes \the [target]'s mouth out with [name]!")