mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-10 01:22:41 +00:00
* Standardizes cleaning item functionality into "cleaning_act" proc * Culling commented-out code * Damp rag now checks for humans before cleaning * Change proc scoping, moved mop reagent check out of cleaning.dm * Adds can_clean and post_clean procs to handle mopping, removes ismop parameter * Adds can_clean() to cleaning objects/mobs * cleaning_act() now carries message strings as params * Refactored cleaning_act() for earlier returns and less redundancy * cleaning_act now runs on the target atom, instead of the cleaning object * Changed turf checks to overrides, rescoped clean_turf, lots of tidying * Removed cleaner param from post_clean, since it'll always be src * Code review tidying * Tidying.......... * Removed clean_turf and put its functionality in turf/simulated/cleaning_act(), added new param to keep track of original targeted object * Moved cleaning.dm from datums to code/game/objects * Added early return, defined cleanspeed in seconds
84 lines
3.1 KiB
Plaintext
84 lines
3.1 KiB
Plaintext
/obj/item/soap
|
|
name = "soap"
|
|
desc = "A cheap bar of soap. Doesn't smell."
|
|
gender = PLURAL
|
|
icon = 'icons/obj/items.dmi'
|
|
icon_state = "soap"
|
|
lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi'
|
|
w_class = WEIGHT_CLASS_TINY
|
|
throwforce = 0
|
|
throw_speed = 4
|
|
throw_range = 20
|
|
discrete = 1
|
|
var/cleanspeed = 50 //slower than mop
|
|
|
|
/obj/item/soap/Initialize(mapload)
|
|
. = ..()
|
|
AddComponent(/datum/component/slippery, src, 8 SECONDS, 100, 0, FALSE)
|
|
|
|
/obj/item/soap/afterattack(atom/target, mob/user, proximity)
|
|
if(!proximity)
|
|
return
|
|
if(target == user && user.a_intent == INTENT_GRAB && ishuman(target))
|
|
var/mob/living/carbon/human/muncher = user
|
|
if(muncher && isdrask(muncher))
|
|
to_chat(user, "<span class='notice'>You take a bite of [src]. Delicious!</span>")
|
|
playsound(user.loc, 'sound/items/eatfood.ogg', 50, 0)
|
|
user.adjust_nutrition(2)
|
|
return
|
|
target.cleaning_act(user, src, cleanspeed)
|
|
|
|
/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("<span class='warning'>\the [user] washes \the [target]'s mouth out with [name]!</span>")
|
|
return
|
|
..()
|
|
|
|
/obj/item/soap/can_clean()
|
|
return TRUE
|
|
|
|
/obj/item/soap/nanotrasen
|
|
desc = "A Nanotrasen brand bar of soap. Smells of plasma."
|
|
icon_state = "soapnt"
|
|
|
|
/obj/item/soap/homemade
|
|
desc = "A homemade bar of soap. Smells of... well...."
|
|
icon_state = "soapgibs"
|
|
cleanspeed = 45 // 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(atom/target, mob/user as mob, proximity)
|
|
if(!proximity) return
|
|
|
|
if(user.client && (target in user.client.screen))
|
|
to_chat(user, "<span class='notice'>You need to take that [target.name] off before 'cleaning' it.</span>")
|
|
else
|
|
user.visible_message("<span class='warning'>[user] begins to smear [src] on \the [target.name].</span>")
|
|
if(do_after(user, cleanspeed, target = target))
|
|
to_chat(user, "<span class='notice'>You 'clean' \the [target.name].</span>")
|
|
if(istype(target, /turf/simulated))
|
|
new /obj/effect/decal/cleanable/blood/gibs/cleangibs(target)
|
|
else if(istype(target,/mob/living/carbon))
|
|
for(var/obj/item/carried_item in target.contents)
|
|
if(!istype(carried_item, /obj/item/implant))//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.bloody_hands(target,0)
|
|
H.bloody_body(target)
|
|
|
|
return
|
|
|
|
/obj/item/soap/deluxe
|
|
desc = "A deluxe Waffle Co. brand bar of soap. Smells of comdoms."
|
|
icon_state = "soapdeluxe"
|
|
cleanspeed = 40 //slightly better because deluxe -- captain gets one of these
|
|
|
|
/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
|