From 725a8046e15d85b96c8ea7c5041a56847f85c051 Mon Sep 17 00:00:00 2001 From: Poojawa Date: Sat, 17 Aug 2019 04:50:24 -0500 Subject: [PATCH] just need items to actually have their overlays, ree --- code/datums/components/decals/blood.dm | 3 +- code/game/atoms.dm | 15 ++++++--- code/game/objects/effects/decals/cleanable.dm | 5 +-- .../effects/decals/cleanable/humans.dm | 31 +------------------ code/game/objects/items.dm | 2 +- code/modules/clothing/clothing.dm | 7 +++-- code/modules/clothing/shoes/_shoes.dm | 1 - tgstation.dme | 1 - 8 files changed, 20 insertions(+), 45 deletions(-) diff --git a/code/datums/components/decals/blood.dm b/code/datums/components/decals/blood.dm index 18e362db5d..c8be6251b5 100644 --- a/code/datums/components/decals/blood.dm +++ b/code/datums/components/decals/blood.dm @@ -9,6 +9,5 @@ /datum/component/decal/blood/proc/get_examine_name(datum/source, mob/user, list/override) var/atom/A = parent - override[EXAMINE_POSITION_ARTICLE] = A.gender == PLURAL? "some" : "a" - override[EXAMINE_POSITION_BEFORE] = " blood-stained " + return COMPONENT_EXNAME_CHANGED diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 6c068e7d5e..1b47f34351 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -255,6 +255,8 @@ if(article) . = "[article] [src]" override[EXAMINE_POSITION_ARTICLE] = article + if(blood_DNA) + override[EXAMINE_POSITION_BEFORE] = " blood-stained " if(SEND_SIGNAL(src, COMSIG_ATOM_GET_EXAMINE_NAME, user, override) & COMPONENT_EXNAME_CHANGED) . = override.Join("") @@ -373,6 +375,7 @@ //to add blood from a mob onto something, and transfer their dna info /atom/proc/add_mob_blood(mob/living/M) + LAZYINITLIST(blood_DNA) var/list/blood_dna = M.get_blood_dna_list() if(!blood_dna) return FALSE @@ -383,16 +386,17 @@ return FALSE /obj/add_blood_DNA(list/blood_dna, list/datum/disease/diseases) + LAZYINITLIST(blood_DNA) return transfer_blood_dna(blood_dna) /obj/item/add_blood_DNA(list/blood_dna, list/datum/disease/diseases) - . = ..() - if(!.) - return + if(!..()) + return FALSE add_blood_overlay() + return TRUE //we applied blood to the item /obj/item/proc/add_blood_overlay() - if(!length(blood_DNA)) + if(!blood_DNA.len) return if(initial(icon) && initial(icon_state)) blood_splatter_icon = icon(initial(icon), initial(icon_state), , 1) //we only want to apply blood-splatters to the initial icon_state for each object @@ -400,7 +404,7 @@ blood_splatter_icon.Blend(icon('icons/effects/blood.dmi', "itemblood"), ICON_MULTIPLY) //adds blood and the remaining white areas become transparant blood_overlay = image(blood_splatter_icon) - blood_overlay.color = blood_DNA_to_color() + blood_overlay.color = BLOOD_COLOR_SYNTHETIC add_overlay(blood_overlay) /obj/item/clothing/gloves/add_blood_DNA(list/blood_dna, list/datum/disease/diseases) @@ -482,6 +486,7 @@ if(.) if(blood_splatter_icon) cut_overlay(blood_splatter_icon) + cut_overlay(blood_overlay) /atom/proc/wash_cream() return TRUE diff --git a/code/game/objects/effects/decals/cleanable.dm b/code/game/objects/effects/decals/cleanable.dm index c03e8a2473..1d57b3437e 100644 --- a/code/game/objects/effects/decals/cleanable.dm +++ b/code/game/objects/effects/decals/cleanable.dm @@ -8,6 +8,7 @@ /obj/effect/decal/cleanable/Initialize(mapload, list/datum/disease/diseases) . = ..() + LAZYINITLIST(blood_DNA) //Kinda needed if (random_icon_states && (icon_state == initial(icon_state)) && length(random_icon_states) > 0) icon_state = pick(random_icon_states) create_reagents(300) @@ -27,7 +28,7 @@ /obj/effect/decal/cleanable/proc/replace_decal(obj/effect/decal/cleanable/C) // Returns true if we should give up in favor of the pre-existing decal if(mergeable_decal) - return TRUE + qdel(C) /obj/effect/decal/cleanable/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/reagent_containers/glass) || istype(W, /obj/item/reagent_containers/food/drinks)) @@ -81,7 +82,7 @@ add_blood = bloodiness bloodiness -= add_blood S.bloody_shoes[blood_state] = min(MAX_SHOE_BLOODINESS,S.bloody_shoes[blood_state]+add_blood) - if(blood_DNA && blood_DNA.len) + if(length(blood_DNA)) S.add_blood_DNA(blood_DNA) S.blood_state = blood_state update_icon() diff --git a/code/game/objects/effects/decals/cleanable/humans.dm b/code/game/objects/effects/decals/cleanable/humans.dm index c0ae223751..c9d2c8c59a 100644 --- a/code/game/objects/effects/decals/cleanable/humans.dm +++ b/code/game/objects/effects/decals/cleanable/humans.dm @@ -9,7 +9,7 @@ color = BLOOD_COLOR_HUMAN //default so we don't have white splotches everywhere. /obj/effect/decal/cleanable/blood/replace_decal(obj/effect/decal/cleanable/blood/C) - if (C.blood_DNA) + if(length(C.blood_DNA)) blood_DNA |= C.blood_DNA.Copy() if (bloodiness) if (C.bloodiness < MAX_SHOE_BLOODINESS) @@ -52,7 +52,6 @@ desc = "Your instincts say you shouldn't be following these." random_icon_states = null var/list/existing_dirs = list() - var/list/Blood_DNA = list() /obj/effect/decal/cleanable/trail_holder/update_icon() color = blood_DNA_to_color() @@ -83,7 +82,6 @@ var/exited_dirs = 0 blood_state = BLOOD_STATE_BLOOD //the icon state to load images from var/list/shoe_types = list() - var/list/shoe_printer = list() /obj/effect/decal/cleanable/blood/footprints/Crossed(atom/movable/O) if(ishuman(O)) @@ -114,10 +112,6 @@ /obj/effect/decal/cleanable/blood/footprints/update_icon() ..() cut_overlays() - - if(shoe_printer) - color = shoeblood_DNA_to_color(shoe_printer) - for(var/Ddir in GLOB.cardinals) if(entered_dirs & Ddir) var/image/bloodstep_overlay = GLOB.bloody_footprints_cache["entered-[blood_state]-[Ddir]"] @@ -155,29 +149,6 @@ return TRUE return FALSE -/obj/effect/decal/cleanable/blood/footprints/proc/shoeblood_DNA_to_color(list/blood_dna) //handles RGB colorings of bloody shoes - var/list/colors = list()//first we make a list of all bloodtypes present - for(var/bloop in shoe_printer) - if(colors[shoe_printer[bloop]]) - colors[shoe_printer[bloop]]++ - else - colors[shoe_printer[bloop]] = 1 - - var/final_rgb = BLOOD_COLOR_HUMAN - - if(colors.len) - var/sum = 0 //this is all shitcode, but it works; trust me - final_rgb = bloodtype_to_color(colors[1]) - sum = colors[colors[1]] - if(colors.len > 1) - var/i = 2 - while(i <= colors.len) - var/tmp = colors[colors[i]] - final_rgb = BlendRGB(final_rgb, bloodtype_to_color(colors[i]), tmp/(tmp+sum)) - sum += tmp - i++ - - return final_rgb /* Eventually TODO: make snowflake trails like baycode's /obj/effect/decal/cleanable/blood/footprints/tracks/shoe name = "footprints" diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index f4c4756ef8..97c770c6d1 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -112,7 +112,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) //Blood overlay things var/blood_color - var/image/blood_overlay = null //this saves our blood splatter overlay, which will be processed not to go over the edges of the sprite + var/image/blood_overlay //this saves our blood splatter overlay, which will be processed not to go over the edges of the sprite /obj/item/Initialize() diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 9cdbdcf03f..84f2b9824d 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -345,6 +345,7 @@ BLIND // can't see anything ..() /obj/item/clothing/transfer_blood_dna(list/blood_dna, list/datum/disease/diseases) - if(length(blood_DNA)) - last_bloodtype = blood_DNA[blood_DNA[blood_DNA.len]]//trust me this works - last_blood_DNA = blood_DNA[blood_DNA.len] + ..() + if(length(blood_dna)) + last_bloodtype = blood_dna[blood_dna[blood_dna.len]]//trust me this works + last_blood_DNA = blood_dna[blood_dna.len] diff --git a/code/modules/clothing/shoes/_shoes.dm b/code/modules/clothing/shoes/_shoes.dm index df7415eace..8c99401b4d 100644 --- a/code/modules/clothing/shoes/_shoes.dm +++ b/code/modules/clothing/shoes/_shoes.dm @@ -95,7 +95,6 @@ /obj/item/clothing/shoes/clean_blood(datum/source, strength) . = ..() - bloody_shoes = list(BLOOD_STATE_BLOOD = 0, BLOOD_STATE_OIL = 0, BLOOD_STATE_NOT_BLOODY = 0) blood_state = BLOOD_STATE_NOT_BLOODY if(ismob(loc)) diff --git a/tgstation.dme b/tgstation.dme index af166504da..a7031883dc 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -378,7 +378,6 @@ #include "code\datums\components\uplink.dm" #include "code\datums\components\wearertargeting.dm" #include "code\datums\components\wet_floor.dm" -#include "code\datums\components\decals\blood.dm" #include "code\datums\components\storage\storage.dm" #include "code\datums\components\storage\concrete\_concrete.dm" #include "code\datums\components\storage\concrete\bag_of_holding.dm"