From 6802e164a2bc29f36e7f1a1ec14c4326e126b530 Mon Sep 17 00:00:00 2001 From: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> Date: Mon, 23 Mar 2026 05:41:22 +0000 Subject: [PATCH] Update soap.dm (#31718) --- code/game/objects/items/soap.dm | 105 +++++++++++++++++++------------- 1 file changed, 61 insertions(+), 44 deletions(-) diff --git a/code/game/objects/items/soap.dm b/code/game/objects/items/soap.dm index 987c138d90e..39df88cc3b0 100644 --- a/code/game/objects/items/soap.dm +++ b/code/game/objects/items/soap.dm @@ -10,25 +10,49 @@ throw_speed = 4 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 + new_attack_chain = TRUE + /// Time taken to clean something. + var/cleanspeed = 5 SECONDS + /// How many times a Drask has chewed on this bar of soap. + var/times_eaten = 0 + /// The maximum amount of bites before the soap is depleted. + var/max_bites = 30 /obj/item/soap/Initialize(mapload) . = ..() AddComponent(/datum/component/slippery, src, 8 SECONDS, 100, 0, FALSE) -/obj/item/soap/afterattack__legacy__attackchain(atom/target, mob/user, proximity) - if(!proximity) - return - if(user.zone_selected == "mouth" && ishuman(target)) // cleaning out someone's mouth is a different act - return - if(target == user && user.a_intent == INTENT_GRAB && ishuman(target)) - var/mob/living/carbon/human/muncher = user - if(muncher && isdrask(muncher)) - eat_soap(muncher) - return +/obj/item/soap/interact_with_atom(atom/target, mob/living/user, list/modifiers) + if(!ismob(target)) + target.cleaning_act(user, src, cleanspeed) + return ITEM_INTERACT_COMPLETE + + if(!ishuman(target) || user.zone_selected != BODY_ZONE_PRECISE_MOUTH) + return ..() // Cleaning mobs is done on attack() so they get visibly bonked by the soap. + + // Mmm, delicious soap! + if(isdrask(target) && user == target && user.a_intent == INTENT_GRAB) + var/mob/living/carbon/human/muncher = target + eat_soap(muncher) + user.changeNext_move(CLICK_CD_MELEE) + return ITEM_INTERACT_COMPLETE + + user.visible_message( + SPAN_WARNING("[user] starts washing [target == user ? "[target.p_their()] own" : "[target]'s"] mouth out with [src]!"), + SPAN_NOTICE("You start washing [target == user ? "your own" : "[target]'s"] mouth out with [src]!") + ) + if(do_after(user, cleanspeed, target = target)) + user.visible_message( + SPAN_WARNING("[user] washes [target == user ? "[target.p_their()] own" : "[target]'s"] mouth out with [src]!"), + SPAN_WARNING("You wash [target == user ? "your own" : "[target]'s"] mouth out with [src]!") + ) + target.reagents.add_reagent("soapreagent", 6) + return ITEM_INTERACT_COMPLETE + +/obj/item/soap/attack(mob/living/target, mob/living/user, params) + ..() target.cleaning_act(user, src, cleanspeed) + return FINISH_ATTACK /obj/item/soap/add_blood(list/blood_dna, b_color) return @@ -57,15 +81,6 @@ else . += SPAN_NOTICE("[src] has been eaten down to a sliver!") -/obj/item/soap/attack__legacy__attackchain(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(SPAN_WARNING("[user] starts washing [target]'s mouth out with [name]!")) - if(do_after(user, cleanspeed, target = target)) - user.visible_message(SPAN_WARNING("[user] washes [target]'s mouth out with [name]!")) - target.reagents.add_reagent("soapreagent", 6) - return - ..() - /obj/item/soap/can_clean() return TRUE @@ -76,37 +91,39 @@ /obj/item/soap/homemade desc = "A homemade bar of soap. Smells of... well...." icon_state = "soaphome" - cleanspeed = 45 // a little faster to reward chemists for going to the effort + cleanspeed = 4.5 SECONDS // A little faster to reward chemists for going to the effort. /obj/item/soap/ducttape desc = "A homemade bar of soap. It seems to be gibs and tape..Will this clean anything?" icon_state = "soapgibs" -/obj/item/soap/ducttape/afterattack__legacy__attackchain(atom/target, mob/user as mob, proximity) - if(!proximity) return - +/obj/item/soap/ducttape/interact_with_atom(atom/target, mob/living/user, list/modifiers) if(user.client && (target in user.client.screen)) - to_chat(user, SPAN_NOTICE("You need to take that [target.name] off before 'cleaning' it.")) - else - user.visible_message(SPAN_WARNING("[user] begins to smear [src] on \the [target.name].")) - if(do_after(user, cleanspeed, target = target)) - to_chat(user, SPAN_NOTICE("You 'clean' \the [target.name].")) - if(issimulatedturf(target)) - new /obj/effect/decal/cleanable/blood/gibs/cleangibs(target) - else if(iscarbon(target)) - for(var/obj/item/carried_item in target.contents) - if(!istype(carried_item, /obj/item/bio_chip))//If it's not an implant. - carried_item.add_mob_blood(target)//Oh yes, there will be blood... - var/mob/living/carbon/human/H = target - H.make_bloody_hands(H.get_blood_dna_list(), H.get_blood_color(), 0) - H.bloody_body(target) + to_chat(user, SPAN_NOTICE("You need to take [target] off before 'cleaning' it.")) + return ITEM_INTERACT_COMPLETE - return + user.visible_message(SPAN_WARNING("[user] begins to smear [src] on [target].")) + if(!do_after(user, cleanspeed, target = target)) + return ITEM_INTERACT_COMPLETE + + to_chat(user, SPAN_NOTICE("You 'clean' [target].")) + if(issimulatedturf(target)) + new /obj/effect/decal/cleanable/blood/gibs/cleangibs(target) + return ITEM_INTERACT_COMPLETE + + if(iscarbon(target)) + for(var/obj/item/carried_item in target.contents) + if(!istype(carried_item, /obj/item/bio_chip)) // If it's not an implant. + carried_item.add_mob_blood(target) // Oh yes, there will be blood... + var/mob/living/carbon/human/H = target + H.make_bloody_hands(H.get_blood_dna_list(), H.get_blood_color(), 0) + H.bloody_body(target) + return ITEM_INTERACT_COMPLETE /obj/item/soap/deluxe desc = "A luxury bar of soap. Smells of honey." icon_state = "soapdeluxe" - cleanspeed = 40 //slightly better because deluxe -- captain gets one of these + cleanspeed = 4 SECONDS // Slightly better because deluxe -- captain gets one of these. /obj/item/soap/deluxe/laundry name = "laundry soap" @@ -116,10 +133,10 @@ /obj/item/soap/syndie desc = "An untrustworthy bar of soap made of strong chemical agents that dissolve blood faster." icon_state = "soapsyndie" - cleanspeed = 10 //much faster than mop so it is useful for traitors who want to clean crime scenes + cleanspeed = 1 SECONDS // Much faster than mop so it is useful for traitors who want to clean crime scenes /obj/item/soap/ds desc = "A very intimidating, jet-black bar of soap with a skull embossed on the top. Whatever this thing is made of, it can clean any mess in the blink of an eye." icon_state = "soapds" - cleanspeed = 5 + cleanspeed = 0.5 SECONDS