From 50d5e18ef6ce7e02fb406b7d66dbc7dedb006e35 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Fri, 21 Jul 2017 15:20:23 -0700 Subject: [PATCH] Moves soap into a single file --- code/game/objects/items/weapons/soap.dm | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/code/game/objects/items/weapons/soap.dm b/code/game/objects/items/weapons/soap.dm index ee22b843db3..eeb417d3bd2 100644 --- a/code/game/objects/items/weapons/soap.dm +++ b/code/game/objects/items/weapons/soap.dm @@ -18,6 +18,42 @@ var/cleanspeed = 50 //slower than mop + + +/obj/item/weapon/soap/afterattack(atom/target, mob/user, proximity) + if(!proximity) return + //I couldn't feasibly fix the overlay bugs caused by cleaning items we are wearing. + //So this is a workaround. This also makes more sense from an IC standpoint. ~Carn + if(user.client && (target in user.client.screen)) + to_chat(user, "You need to take that [target.name] off before cleaning it.") + else if(target == user && user.a_intent == INTENT_GRAB && ishuman(target)) + var/mob/living/carbon/human/muncher = user + if(muncher && muncher.get_species() == "Drask") + to_chat(user, "You take a bite of the [src.name]. Delicious!") + playsound(user.loc, 'sound/items/eatfood.ogg', 50, 0) + user.nutrition += 2 + else if(istype(target,/obj/effect/decal/cleanable)) + user.visible_message("[user] begins to scrub \the [target.name] out with [src].") + if(do_after(user, src.cleanspeed, target = target) && target) + to_chat(user, "You scrub \the [target.name] out.") + qdel(target) + else + user.visible_message("[user] begins to clean \the [target.name] with [src].") + if(do_after(user, src.cleanspeed, target = target)) + to_chat(user, "You clean \the [target.name].") + var/obj/effect/decal/cleanable/C = locate() in target + qdel(C) + target.clean_blood() + if(istype(target, /turf/simulated)) + var/turf/simulated/T = target + T.dirt = 0 + +/obj/item/weapon/soap/attack(mob/target as mob, mob/user as mob) + if(target && user && ishuman(target) && ishuman(user) && !target.stat && !user.stat && user.zone_sel &&user.zone_sel.selecting == "mouth" ) + user.visible_message("\the [user] washes \the [target]'s mouth out with [src.name]!") + return + ..() + /obj/item/weapon/soap/nanotrasen desc = "A Nanotrasen brand bar of soap. Smells of plasma." icon_state = "soapnt"