Cleanable cleanup (#52477)

* Don't initialize the atom_colours list on atoms until it's actually needed

* Moved bloody_hands var to mob/living/carbon/human instead

* Added COMSIG_COMPONENT_CLEAN_RADIATION signal to reduce moms spaghetti

The shower and suit storage unit now calls this signal instead of either doing it manually or doing it via the washed proc

* Cleaned up carbon washing, renamed washed to wash

* The wash proc now doesn't take the washer as first arg because that wasn't used anywhere
* The wash strength is no longer optional
* Carbons now overrides the wash proc instead of using the signal
* Properly check for obscuredness before washing any equipped items
* Properly wash all items and bloody hands etc
* Added clean_lips proc for humans for cleaning any lipstick

* Cleaned up washing. Washy stuff now calls wash instead of calling the clean signal directly

* Renamed is_cleanable to ismopable, gives this category a more fitting purpose. Many things beyond floor decals are cleanable. It is now also determined using the atom layer instead to make it more generic.
* Properly utilize the is_cleanable define
* Added wash override for turfs where they also wash any mopables on the same tile
* Space cleaner and cleaning element etc now simply washes the mob instead of doing its own manual cleaning on ~some~ equipped items

* Non-component washables now simply override wash instead of registering for the clean signal

* Fixed some left over clean signal registers not returning true

* Added clean_strength var to space cleaner

* Moved human wash proc next to the other washing procs

* Also wash glasses and mask if not obscured when washing face

* Fixed attempting to "scoop up" cleanable decals using a rag

* Fixed plasmaman spacehelm icon not updating when washed

Also removed a duplicated worn_overlays proc

* Fixed head icon not updating when washing lipstick

* Moved radioactive clean signal register to where it should be

* Added atom radiate VV verb for debugging

* Redesigned the CLEAN constants into a more sensible flags setup

This makes it more dynamic, cleaning apparatuses can clean more specific than just a cleaning strength.

* CLEAN_TYPE_* flags indicate a specific cleanable, such as blood, fingerprints or disease
* CLEAN_* consts consist of a combination of cleaning types to make cleaning apparatuses have a consistent behaviour on what they clean

* Fixed broken rad removal logic in showers

* Apply suggestions from code review

Co-authored-by: Rohesie <rohesie@gmail.com>

* Removed unneccesary bool from sink code

* Fixed wrongly named variable in turf wash

* Renamed bloody_hands to blood_in_hands

Co-authored-by: Rohesie <rohesie@gmail.com>
This commit is contained in:
Daniel Hultgren
2020-07-29 08:32:30 -04:00
committed by SkyratBot
co-authored by Rohesie
parent 69c2e250eb
commit bae9371da5
41 changed files with 303 additions and 248 deletions
+7 -3
View File
@@ -98,7 +98,9 @@
wash_atom(AM)
/obj/machinery/shower/proc/wash_atom(atom/A)
A.washed(src)
A.wash(CLEAN_RAD | CLEAN_TYPE_WEAK) // Clean radiation non-instantly
A.wash(CLEAN_WASH)
SEND_SIGNAL(A, COMSIG_ADD_MOOD_EVENT, "shower", /datum/mood_event/nice_shower)
reagents.expose(A, TOUCH, reaction_volume)
if(isliving(A))
@@ -107,8 +109,10 @@
/obj/machinery/shower/process()
if(on)
wash_atom(loc)
for(var/AM in loc)
wash_atom(AM)
for(var/am in loc)
var/atom/movable/movable_content = am
if(!ismopable(movable_content)) // Mopables will be cleaned anyways by the turf wash above
wash_atom(movable_content)
else
return PROCESS_KILL
+12 -13
View File
@@ -279,21 +279,20 @@
busy = FALSE
if(washing_face)
SEND_SIGNAL(user, COMSIG_COMPONENT_CLEAN_FACE_ACT, CLEAN_WASH)
user.drowsyness = max(user.drowsyness - rand(2,3), 0) //Washing your face wakes you up if you're falling asleep
else if(ishuman(user))
var/mob/living/carbon/human/human_user = user
if(!human_user.wash_hands(CLEAN_WASH))
to_chat(user, "<span class='warning'>Your hands are covered by something!</span>")
return
else
user.wash(CLEAN_WASH)
user.visible_message("<span class='notice'>[user] washes [user.p_their()] [washing_face ? "face" : "hands"] using [src].</span>", \
"<span class='notice'>You wash your [washing_face ? "face" : "hands"] using [src].</span>")
if(washing_face)
SEND_SIGNAL(user, COMSIG_COMPONENT_CLEAN_FACE_ACT, CLEAN_STRENGTH_BLOOD)
if(ishuman(user))
var/mob/living/carbon/human/H = user
H.lip_style = null //Washes off lipstick
H.lip_color = initial(H.lip_color)
H.regenerate_icons()
user.drowsyness = max(user.drowsyness - rand(2,3), 0) //Washing your face wakes you up if you're falling asleep
else
user.washed(src)
/obj/structure/sink/attackby(obj/item/O, mob/living/user, params)
if(busy)
to_chat(user, "<span class='warning'>Someone's already washing here!</span>")
@@ -357,7 +356,7 @@
busy = FALSE
return 1
busy = FALSE
O.washed(src)
O.wash(CLEAN_WASH)
O.acid_level = 0
create_reagents(5)
reagents.add_reagent(dispensedreagent, 5)