Merge pull request #9543 from VOREStation/upstream-merge-7802

[MIRROR] Space cleaner cleans mobs
This commit is contained in:
Verkister
2021-02-09 20:17:04 +02:00
committed by Chompstation Bot
parent 26d1ac519a
commit 3e2d6f6f76
6 changed files with 100 additions and 87 deletions
+13 -5
View File
@@ -38,7 +38,7 @@
// Aurora forensics port.
/obj/item/clothing/clean_blood()
..()
. = ..()
gunshot_residue = null
@@ -55,6 +55,12 @@
verbs |= /obj/item/clothing/proc/change_color
//VOREStation edit start
/obj/item/clothing/update_icon()
overlays.Cut() //This removes all the overlays on the sprite and then goes down a checklist adding them as required.
if(blood_DNA)
add_blood()
. = ..()
/obj/item/clothing/equipped(var/mob/user,var/slot)
..()
if(enables_planes)
@@ -366,6 +372,11 @@
return
*/
/obj/item/clothing/gloves/clean_blood()
. = ..()
transfer_blood = 0
update_icon()
/obj/item/clothing/gloves/mob_can_equip(mob/user, slot, disable_warning = FALSE)
var/mob/living/carbon/human/H = user
@@ -685,9 +696,7 @@
update_icon()
/obj/item/clothing/shoes/update_icon()
overlays.Cut() //This removes all the overlays on the sprite and then goes down a checklist adding them as required.
if(blood_DNA)
add_blood()
. = ..()
if(holding)
overlays += image(icon, "[icon_state]_knife")
if(contaminated)
@@ -698,7 +707,6 @@
if(ismob(usr))
var/mob/M = usr
M.update_inv_shoes()
return ..()
/obj/item/clothing/shoes/clean_blood()
update_icon()
+79
View File
@@ -465,3 +465,82 @@
clear_alert("handcuffed")
update_action_buttons() //some of our action buttons might be unusable when we're handcuffed.
update_inv_handcuffed()
// Clears blood overlays
/mob/living/carbon/clean_blood()
. = ..()
if(src.r_hand)
src.r_hand.clean_blood()
if(src.l_hand)
src.l_hand.clean_blood()
if(src.back)
if(src.back.clean_blood())
src.update_inv_back(0)
if(ishuman(src))
var/mob/living/carbon/human/H = src
var/washgloves = 1
var/washshoes = 1
var/washmask = 1
var/washears = 1
var/washglasses = 1
if(H.wear_suit)
washgloves = !(H.wear_suit.flags_inv & HIDEGLOVES)
washshoes = !(H.wear_suit.flags_inv & HIDESHOES)
if(H.head)
washmask = !(H.head.flags_inv & HIDEMASK)
washglasses = !(H.head.flags_inv & HIDEEYES)
washears = !(H.head.flags_inv & HIDEEARS)
if(H.wear_mask)
if (washears)
washears = !(H.wear_mask.flags_inv & HIDEEARS)
if (washglasses)
washglasses = !(H.wear_mask.flags_inv & HIDEEYES)
if(H.head)
if(H.head.clean_blood())
H.update_inv_head()
if(H.wear_suit)
if(H.wear_suit.clean_blood())
H.update_inv_wear_suit()
else if(H.w_uniform)
if(H.w_uniform.clean_blood())
H.update_inv_w_uniform()
if(H.gloves && washgloves)
if(H.gloves.clean_blood())
H.update_inv_gloves(0)
if(H.shoes && washshoes)
if(H.shoes.clean_blood())
H.update_inv_shoes(0)
if(H.wear_mask && washmask)
if(H.wear_mask.clean_blood())
H.update_inv_wear_mask(0)
if(H.glasses && washglasses)
if(H.glasses.clean_blood())
H.update_inv_glasses(0)
if(H.l_ear && washears)
if(H.l_ear.clean_blood())
H.update_inv_ears(0)
if(H.r_ear && washears)
if(H.r_ear.clean_blood())
H.update_inv_ears(0)
if(H.belt)
if(H.belt.clean_blood())
H.update_inv_belt(0)
else
if(src.wear_mask) //if the mob is not human, it cleans the mask without asking for bitflags
if(src.wear_mask.clean_blood())
src.update_inv_wear_mask(0)
@@ -215,7 +215,6 @@ This saves us from having to call add_fingerprint() any time something is put in
if(slot_back)
src.back = W
W.equipped(src, slot)
worn_clothing += back
update_inv_back()
if(slot_wear_mask)
src.wear_mask = W
@@ -223,7 +222,6 @@ This saves us from having to call add_fingerprint() any time something is put in
update_hair() //rebuild hair
update_inv_ears()
W.equipped(src, slot)
worn_clothing += wear_mask
update_inv_wear_mask()
if(slot_handcuffed)
src.handcuffed = W
@@ -243,7 +241,6 @@ This saves us from having to call add_fingerprint() any time something is put in
if(slot_belt)
src.belt = W
W.equipped(src, slot)
worn_clothing += belt
update_inv_belt()
if(slot_wear_id)
src.wear_id = W
@@ -276,7 +273,6 @@ This saves us from having to call add_fingerprint() any time something is put in
if(slot_gloves)
src.gloves = W
W.equipped(src, slot)
worn_clothing += glasses
update_inv_gloves()
if(slot_head)
src.head = W
@@ -287,22 +283,18 @@ This saves us from having to call add_fingerprint() any time something is put in
if(istype(W,/obj/item/clothing/head/kitty))
W.update_icon(src)
W.equipped(src, slot)
worn_clothing += head
update_inv_head()
if(slot_shoes)
src.shoes = W
W.equipped(src, slot)
worn_clothing += shoes
update_inv_shoes()
if(slot_wear_suit)
src.wear_suit = W
W.equipped(src, slot)
worn_clothing += wear_suit
update_inv_wear_suit()
if(slot_w_uniform)
src.w_uniform = W
W.equipped(src, slot)
worn_clothing += w_uniform
update_inv_w_uniform()
if(slot_l_store)
src.l_store = W
@@ -373,6 +373,11 @@
color = "#A5F0EE"
touch_met = 50
/datum/reagent/space_cleaner/touch_mob(var/mob/M)
if(iscarbon(M))
var/mob/living/carbon/C = M
C.clean_blood()
/datum/reagent/space_cleaner/touch_obj(var/obj/O)
O.clean_blood()