mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2026-02-06 14:19:56 +00:00
49 lines
1.8 KiB
Plaintext
49 lines
1.8 KiB
Plaintext
/datum/element/cleaning/Attach(datum/target)
|
|
. = ..()
|
|
if(!ismovableatom(target))
|
|
return ELEMENT_INCOMPATIBLE
|
|
RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/Clean)
|
|
|
|
/datum/element/cleaning/Detach(datum/target)
|
|
. = ..()
|
|
UnregisterSignal(target, COMSIG_MOVABLE_MOVED)
|
|
|
|
/datum/element/cleaning/proc/Clean(datum/source)
|
|
var/atom/movable/AM = source
|
|
var/turf/T = AM.loc
|
|
SEND_SIGNAL(T, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK)
|
|
for(var/A in T)
|
|
if(is_cleanable(A))
|
|
qdel(A)
|
|
else if(isitem(A))
|
|
var/obj/item/cleaned_item = A
|
|
SEND_SIGNAL(cleaned_item, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK)
|
|
cleaned_item.clean_blood()
|
|
if(ismob(cleaned_item.loc))
|
|
var/mob/M = cleaned_item.loc
|
|
M.regenerate_icons()
|
|
else if(ishuman(A))
|
|
var/mob/living/carbon/human/cleaned_human = A
|
|
if(cleaned_human.lying)
|
|
if(cleaned_human.head)
|
|
SEND_SIGNAL(cleaned_human.head, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK)
|
|
cleaned_human.head.clean_blood()
|
|
cleaned_human.update_inv_head()
|
|
if(cleaned_human.wear_suit)
|
|
SEND_SIGNAL(cleaned_human.wear_suit, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK)
|
|
cleaned_human.wear_suit.clean_blood()
|
|
cleaned_human.update_inv_wear_suit()
|
|
else if(cleaned_human.w_uniform)
|
|
SEND_SIGNAL(cleaned_human.w_uniform, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK)
|
|
cleaned_human.w_uniform.clean_blood()
|
|
cleaned_human.update_inv_w_uniform()
|
|
if(cleaned_human.shoes)
|
|
SEND_SIGNAL(cleaned_human.shoes, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK)
|
|
cleaned_human.shoes.clean_blood()
|
|
cleaned_human.update_inv_shoes()
|
|
SEND_SIGNAL(cleaned_human, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK)
|
|
cleaned_human.clean_blood()
|
|
cleaned_human.wash_cream()
|
|
cleaned_human.regenerate_icons()
|
|
to_chat(cleaned_human, "<span class='danger'>[AM] cleans your face!</span>")
|