diff --git a/code/__DEFINES/forensics.dm b/code/__DEFINES/forensics.dm index bb512edcde6..f6121482dab 100644 --- a/code/__DEFINES/forensics.dm +++ b/code/__DEFINES/forensics.dm @@ -1,2 +1 @@ -#define IF_HAS_BLOOD_DNA(__thing) GET_COMPONENT_FROM(__FR##__thing, /datum/component/forensics, __thing); if(__FR##__thing && length(__FR##__thing.blood_DNA)) -#define IF_HAS_BLOOD_DNA_AND(__thing, __conditions...) GET_COMPONENT_FROM(__FR##__thing, /datum/component/forensics, __thing); if(__FR##__thing && length(__FR##__thing.blood_DNA) && (##__conditions)) +#define HAS_BLOOD_DNA(thing) (length(thing.GetComponent(/datum/component/forensics)?.blood_DNA)) diff --git a/code/modules/clothing/gloves/_gloves.dm b/code/modules/clothing/gloves/_gloves.dm index d2860219b70..1b3263fb047 100644 --- a/code/modules/clothing/gloves/_gloves.dm +++ b/code/modules/clothing/gloves/_gloves.dm @@ -29,7 +29,7 @@ if(!isinhands) if(damaged_clothes) . += mutable_appearance('icons/effects/item_damage.dmi', "damagedgloves") - IF_HAS_BLOOD_DNA(src) + if(HAS_BLOOD_DNA(src)) . += mutable_appearance('icons/effects/blood.dmi', "bloodyhands") /obj/item/clothing/gloves/update_clothes_damaged_state(damaging = TRUE) diff --git a/code/modules/clothing/head/_head.dm b/code/modules/clothing/head/_head.dm index 6a3082b5583..efea5e35d64 100644 --- a/code/modules/clothing/head/_head.dm +++ b/code/modules/clothing/head/_head.dm @@ -20,11 +20,11 @@ if(!isinhands) if(damaged_clothes) . += mutable_appearance('icons/effects/item_damage.dmi', "damagedhelmet") - IF_HAS_BLOOD_DNA(src) + if(HAS_BLOOD_DNA(src)) . += mutable_appearance('icons/effects/blood.dmi', "helmetblood") /obj/item/clothing/head/update_clothes_damaged_state(damaging = TRUE) ..() if(ismob(loc)) var/mob/M = loc - M.update_inv_head() \ No newline at end of file + M.update_inv_head() diff --git a/code/modules/clothing/masks/_masks.dm b/code/modules/clothing/masks/_masks.dm index f8c3ea92fdf..6cf979e9ae6 100644 --- a/code/modules/clothing/masks/_masks.dm +++ b/code/modules/clothing/masks/_masks.dm @@ -20,7 +20,7 @@ if(body_parts_covered & HEAD) if(damaged_clothes) . += mutable_appearance('icons/effects/item_damage.dmi', "damagedmask") - IF_HAS_BLOOD_DNA(src) + if(HAS_BLOOD_DNA(src)) . += mutable_appearance('icons/effects/blood.dmi', "maskblood") /obj/item/clothing/mask/update_clothes_damaged_state(damaging = TRUE) diff --git a/code/modules/clothing/neck/_neck.dm b/code/modules/clothing/neck/_neck.dm index d55fd677d7c..1806a4d20df 100644 --- a/code/modules/clothing/neck/_neck.dm +++ b/code/modules/clothing/neck/_neck.dm @@ -12,7 +12,7 @@ if(body_parts_covered & HEAD) if(damaged_clothes) . += mutable_appearance('icons/effects/item_damage.dmi', "damagedmask") - IF_HAS_BLOOD_DNA(src) + if(HAS_BLOOD_DNA(src)) . += mutable_appearance('icons/effects/blood.dmi', "maskblood") /obj/item/clothing/neck/tie diff --git a/code/modules/clothing/shoes/_shoes.dm b/code/modules/clothing/shoes/_shoes.dm index 876838b4f22..cf098eaa167 100644 --- a/code/modules/clothing/shoes/_shoes.dm +++ b/code/modules/clothing/shoes/_shoes.dm @@ -43,7 +43,7 @@ . = list() if(!isinhands) var/bloody = FALSE - IF_HAS_BLOOD_DNA(src) + if(HAS_BLOOD_DNA(src)) bloody = TRUE else bloody = bloody_shoes[BLOOD_STATE_HUMAN] @@ -87,4 +87,4 @@ M.update_inv_shoes() /obj/item/proc/negates_gravity() - return FALSE \ No newline at end of file + return FALSE diff --git a/code/modules/clothing/suits/_suits.dm b/code/modules/clothing/suits/_suits.dm index 6aabee0c81f..8917907910c 100644 --- a/code/modules/clothing/suits/_suits.dm +++ b/code/modules/clothing/suits/_suits.dm @@ -15,7 +15,7 @@ if(!isinhands) if(damaged_clothes) . += mutable_appearance('icons/effects/item_damage.dmi', "damaged[blood_overlay_type]") - IF_HAS_BLOOD_DNA(src) + if(HAS_BLOOD_DNA(src)) . += mutable_appearance('icons/effects/blood.dmi', "[blood_overlay_type]blood") var/mob/living/carbon/human/M = loc if(ishuman(M) && M.w_uniform) diff --git a/code/modules/clothing/under/_under.dm b/code/modules/clothing/under/_under.dm index 0268e31b153..61be54af4f3 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -23,7 +23,7 @@ if(!isinhands) if(damaged_clothes) . += mutable_appearance('icons/effects/item_damage.dmi', "damageduniform") - IF_HAS_BLOOD_DNA(src) + if(HAS_BLOOD_DNA(src)) . += mutable_appearance('icons/effects/blood.dmi', "uniformblood") if(accessory_overlay) . += accessory_overlay diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 761c01d9977..99100292210 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -333,29 +333,24 @@ //If you're covered in blood, you'll start smelling like shit faster. var/obj/item/head = get_item_by_slot(SLOT_HEAD) - if(head) - IF_HAS_BLOOD_DNA(head) - hygiene_loss -= 1 * HYGIENE_FACTOR + if(head && HAS_BLOOD_DNA(head)) + hygiene_loss -= 1 * HYGIENE_FACTOR var/obj/item/mask = get_item_by_slot(SLOT_HEAD) - if(mask) - IF_HAS_BLOOD_DNA(mask) - hygiene_loss -= 1 * HYGIENE_FACTOR + if(mask && HAS_BLOOD_DNA(mask)) + hygiene_loss -= 1 * HYGIENE_FACTOR var/obj/item/uniform = get_item_by_slot(SLOT_W_UNIFORM) - if(uniform) - IF_HAS_BLOOD_DNA(uniform) - hygiene_loss -= 4 * HYGIENE_FACTOR + if(uniform && HAS_BLOOD_DNA(uniform)) + hygiene_loss -= 4 * HYGIENE_FACTOR var/obj/item/suit = get_item_by_slot(SLOT_WEAR_SUIT) - if(suit) - IF_HAS_BLOOD_DNA(suit) - hygiene_loss -= 3 * HYGIENE_FACTOR + if(suit && HAS_BLOOD_DNA(suit)) + hygiene_loss -= 3 * HYGIENE_FACTOR var/obj/item/feet = get_item_by_slot(SLOT_SHOES) - if(feet) - IF_HAS_BLOOD_DNA(feet) - hygiene_loss -= 0.5 * HYGIENE_FACTOR + if(feet && HAS_BLOOD_DNA(feet)) + hygiene_loss -= 0.5 * HYGIENE_FACTOR adjust_hygiene(hygiene_loss)