Adds the shower bot, makes sure you don't become too bloody (#49083)

* Epicgamers

* woops

* Update code/modules/mob/living/simple_animal/bot/construction.dm

Co-Authored-By: TheChosenEvilOne <34602646+TheChosenEvilOne@users.noreply.github.com>

* slip

* fix

* epic

* emag functionality

* Update code/modules/mob/living/simple_animal/bot/hygienebot.dm

* Update code/modules/mob/living/simple_animal/bot/hygienebot.dm

* step 1

* woops

* fixes

* fixes

* fixes++

* fixes a broken thing

* lol ok

* fixes

* oopsie

* oneliner

* lmao webedits

* small brain

Co-authored-by: TheChosenEvilOne <34602646+TheChosenEvilOne@users.noreply.github.com>
This commit is contained in:
Qustinnus
2020-02-20 22:31:22 +01:00
committed by GitHub
parent 4de1c3845d
commit 72fb1458a7
15 changed files with 378 additions and 96 deletions
+2 -92
View File
@@ -98,102 +98,12 @@
wash_atom(AM)
/obj/machinery/shower/proc/wash_atom(atom/A)
SEND_SIGNAL(A, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK)
A.washed(src)
reagents.reaction(A, TOUCH, reaction_volume)
if(isobj(A))
wash_obj(A)
else if(isturf(A))
wash_turf(A)
else if(isliving(A))
wash_mob(A)
if(isliving(A))
check_heat(A)
contamination_cleanse(A)
/obj/machinery/shower/proc/wash_obj(obj/O)
. = SEND_SIGNAL(O, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK)
O.remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
/obj/machinery/shower/proc/wash_turf(turf/tile)
SEND_SIGNAL(tile, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK)
tile.remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
for(var/obj/effect/E in tile)
if(is_cleanable(E))
qdel(E)
/obj/machinery/shower/proc/wash_mob(mob/living/L)
SEND_SIGNAL(L, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK)
L.remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
SEND_SIGNAL(L, COMSIG_ADD_MOOD_EVENT, "shower", /datum/mood_event/nice_shower)
if(iscarbon(L))
var/mob/living/carbon/M = L
. = TRUE
for(var/obj/item/I in M.held_items)
wash_obj(I)
if(M.back && wash_obj(M.back))
M.update_inv_back(0)
var/list/obscured = M.check_obscured_slots()
if(M.head && wash_obj(M.head))
M.update_inv_head()
if(M.glasses && !(ITEM_SLOT_EYES in obscured) && wash_obj(M.glasses))
M.update_inv_glasses()
if(M.wear_mask && !(ITEM_SLOT_MASK in obscured) && wash_obj(M.wear_mask))
M.update_inv_wear_mask()
if(M.ears && !(HIDEEARS in obscured) && wash_obj(M.ears))
M.update_inv_ears()
if(M.wear_neck && !(ITEM_SLOT_NECK in obscured) && wash_obj(M.wear_neck))
M.update_inv_neck()
if(M.shoes && !(HIDESHOES in obscured) && wash_obj(M.shoes))
M.update_inv_shoes()
var/washgloves = FALSE
if(M.gloves && !(HIDEGLOVES in obscured))
washgloves = TRUE
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.wear_suit && wash_obj(H.wear_suit))
H.update_inv_wear_suit()
else if(H.w_uniform && wash_obj(H.w_uniform))
H.update_inv_w_uniform()
if(washgloves)
SEND_SIGNAL(H, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
if(!H.is_mouth_covered())
H.lip_style = null
H.update_body()
if(H.belt && wash_obj(H.belt))
H.update_inv_belt()
else
SEND_SIGNAL(M, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
else
SEND_SIGNAL(L, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
/obj/machinery/shower/proc/contamination_cleanse(atom/thing)
var/datum/component/radioactive/healthy_green_glow = thing.GetComponent(/datum/component/radioactive)
if(!healthy_green_glow || QDELETED(healthy_green_glow))
return
var/strength = healthy_green_glow.strength
if(strength <= RAD_BACKGROUND_RADIATION)
qdel(healthy_green_glow)
return
healthy_green_glow.strength -= max(0, (healthy_green_glow.strength - (RAD_BACKGROUND_RADIATION * 2)) * 0.2)
/obj/machinery/shower/process()
if(on)
wash_atom(loc)