Standardize cleaning object behavior into "cleaning_act" proc (#19001)

* 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
This commit is contained in:
FloFluoro
2022-10-03 20:25:00 +01:00
committed by GitHub
parent dfad5f2004
commit 6a876e1994
10 changed files with 123 additions and 88 deletions
@@ -151,14 +151,16 @@
icon_state = "maid"
icon_living = "maid"
icon_dead = "maid_dead"
var/cleanspeed = 15
/mob/living/simple_animal/hostile/alien/maid/AttackingTarget()
if(ismovable(target))
if(istype(target, /obj/effect/decal/cleanable))
visible_message("<span class='notice'>\The [src] cleans up \the [target].</span>")
qdel(target)
return TRUE
var/atom/movable/M = target
M.clean_blood()
if(ishuman(target))
var/atom/movable/H = target
H.clean_blood()
visible_message("<span class='notice'>\The [src] polishes \the [target].</span>")
return TRUE
target.cleaning_act(src, src, cleanspeed, text_description = ".") //LXM is both the user and the cleaning implement itself. Wow!
/mob/living/simple_animal/hostile/alien/maid/can_clean()
return TRUE