Files
VOREStation/code/datums/elements/cleaning.dm
Guti 9eb876de72 Soap & clean proc refactor (#17744)
* Automatic changelog compile [ci skip]

* soap

* Washy wash

* Big wash

* washy

* Update soap.dm

* washiest

* .

* .

* Washes the linter

* scrubs the linter

* washes indentation

* .

* updaet

---------

Co-authored-by: vorestation-ci[bot] <199609141+vorestation-ci[bot]@users.noreply.github.com>
Co-authored-by: ShadowLarkens <shadowlarkens@gmail.com>
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
2025-05-31 10:31:15 -07:00

38 lines
1.0 KiB
Plaintext

/datum/element/cleaning
/datum/element/cleaning/Attach(datum/target)
. = ..()
if(!ismovable(target))
return ELEMENT_INCOMPATIBLE
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(clean))
/datum/element/cleaning/Detach(datum/target)
. = ..()
UnregisterSignal(target, COMSIG_MOVABLE_MOVED)
/datum/element/cleaning/proc/clean(datum/source)
SIGNAL_HANDLER
var/atom/movable/AM = source
var/turf/tile = AM.loc
if(!isturf(tile))
return
tile.wash(CLEAN_WASH)
for(var/atom/cleaned as anything in tile)
if(isitem(cleaned))
var/obj/item/cleaned_item = cleaned
if(cleaned_item.w_class <= ITEMSIZE_SMALL)
cleaned_item.wash(CLEAN_SCRUB)
continue
if(istype(cleaned, /obj/effect/decal/cleanable))
var/obj/effect/decal/cleanable/cleaned_decal = cleaned
cleaned_decal.wash(CLEAN_SCRUB)
if(!ishuman(cleaned))
continue
var/mob/living/carbon/human/cleaned_human = cleaned
if(cleaned_human.lying)
cleaned_human.wash(CLEAN_SCRUB)
to_chat(cleaned_human, span_danger("[AM] washes your face!"))