diff --git a/code/game/atoms.dm b/code/game/atoms.dm index e3f4829d3d..a828d6c30d 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -446,8 +446,10 @@ return var/list/blood_dna = list() if(dna) + blood_dna["color"] = list(dna.species.exotic_blood_color) //so when combined, the list grows with the number of colors blood_dna[dna.unique_enzymes] = dna.blood_type else + blood_dna["color"] = list(BLOOD_COLOR_HUMAN) blood_dna["UNKNOWN DNA"] = "X*" return blood_dna @@ -461,8 +463,10 @@ if(!new_blood_dna) return FALSE LAZYINITLIST(blood_DNA) //if our list of DNA doesn't exist yet, initialise it. + LAZYINITLIST(blood_DNA["color"]) var/old_length = blood_DNA.len blood_DNA |= new_blood_dna + blood_DNA["color"] += new_blood_dna["bloodcolor"] if(blood_DNA.len == old_length) return FALSE return TRUE @@ -470,8 +474,11 @@ //to add blood dna info to the object's blood_DNA list /atom/proc/transfer_blood_dna(list/blood_dna, list/datum/disease/diseases) LAZYINITLIST(blood_DNA) + LAZYINITLIST(blood_dna["color"]) + var/old_length = blood_DNA.len blood_DNA |= blood_dna + blood_DNA["color"] += blood_dna["bloodcolor"] if(blood_DNA.len > old_length) return TRUE //some new blood DNA was added @@ -544,23 +551,22 @@ /atom/proc/blood_DNA_to_color() var/list/colors = list()//first we make a list of all bloodtypes present - for(var/bloop in blood_DNA) - if(colors[blood_DNA[bloop]]) - colors[blood_DNA[bloop]]++ + for(var/blood_color in blood_DNA["color"]) + if(colors[blood_color]) + colors[blood_color]++ else - colors[blood_DNA[bloop]] = 1 + colors[blood_color] = 1 var/final_rgb = BLOOD_COLOR_HUMAN //a default so we don't have white blood graphics if something messed up - if(colors.len) var/sum = 0 //this is all shitcode, but it works; trust me - final_rgb = bloodtype_to_color(colors[1]) + final_rgb = 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)) + final_rgb = BlendRGB(final_rgb, colors[i], tmp/(tmp+sum)) sum += tmp i++ diff --git a/code/game/objects/effects/decals/cleanable/humans.dm b/code/game/objects/effects/decals/cleanable/humans.dm index a5acc7d394..fa16a95faf 100644 --- a/code/game/objects/effects/decals/cleanable/humans.dm +++ b/code/game/objects/effects/decals/cleanable/humans.dm @@ -91,7 +91,7 @@ var/mob/living/carbon/human/H = O var/obj/item/clothing/shoes/S = H.shoes if(S && S.bloody_shoes[blood_state]) - if(color != bloodtype_to_color(S.last_bloodtype)) + if(color != S.last_blood_color) return S.bloody_shoes[blood_state] = max(S.bloody_shoes[blood_state] - BLOOD_LOSS_PER_STEP, 0) shoe_types |= S.type @@ -104,7 +104,7 @@ var/mob/living/carbon/human/H = O var/obj/item/clothing/shoes/S = H.shoes if(S && S.bloody_shoes[blood_state]) - if(color != bloodtype_to_color(S.last_bloodtype))//last entry - we check its color + if(color != S.last_blood_color)//last entry - we check its color return S.bloody_shoes[blood_state] = max(S.bloody_shoes[blood_state] - BLOOD_LOSS_PER_STEP, 0) shoe_types |= S.type diff --git a/code/modules/clothing/shoes/_shoes.dm b/code/modules/clothing/shoes/_shoes.dm index 802dd7265e..447a531717 100644 --- a/code/modules/clothing/shoes/_shoes.dm +++ b/code/modules/clothing/shoes/_shoes.dm @@ -18,6 +18,7 @@ mutantrace_variation = STYLE_DIGITIGRADE var/last_bloodtype = "" //used to track the last bloodtype to have graced these shoes; makes for better performing footprint shenanigans var/last_blood_DNA = "" //same as last one + var/last_blood_color = "" /obj/item/clothing/shoes/ComponentInitialize() . = ..() @@ -48,6 +49,7 @@ if(blood_dna.len) last_bloodtype = blood_dna[blood_dna[blood_dna.len]]//trust me this works last_blood_DNA = blood_dna[blood_dna.len] + last_blood_color = blood_dna["color"] /obj/item/clothing/shoes/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE) . = ..() diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index 612358e802..8ca4e6a0e4 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -188,7 +188,7 @@ blood_data["viruses"] += D.Copy() blood_data["blood_DNA"] = dna.unique_enzymes - blood_data["bloodcolor"] = bloodtype_to_color(dna.blood_type) + blood_data["bloodcolor"] = dna.species.exotic_blood_color if(disease_resistances && disease_resistances.len) blood_data["resistances"] = disease_resistances.Copy() var/list/temp_chem = list() diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 63ca3f372e..52027e7494 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -77,7 +77,7 @@ var/turf/T = get_turf(src) if(S.bloody_shoes && S.bloody_shoes[S.blood_state]) var/obj/effect/decal/cleanable/blood/footprints/oldFP = locate(/obj/effect/decal/cleanable/blood/footprints) in T - if(oldFP && (oldFP.blood_state == S.blood_state && oldFP.color == bloodtype_to_color(S.last_bloodtype))) + if(oldFP && (oldFP.blood_state == S.blood_state && oldFP.color == S.last_blood_color)) return S.bloody_shoes[S.blood_state] = max(0, S.bloody_shoes[S.blood_state] - BLOOD_LOSS_PER_STEP) var/obj/effect/decal/cleanable/blood/footprints/FP = new /obj/effect/decal/cleanable/blood/footprints(T) @@ -86,6 +86,7 @@ FP.bloodiness = S.bloody_shoes[S.blood_state] if(S.last_bloodtype) FP.blood_DNA += list(S.last_blood_DNA = S.last_bloodtype) + FP.blood_DNA["colors"] += S.last_blood_color FP.update_icon() update_inv_shoes() //End bloody footprints diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index f256345c68..f7ba185800 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -39,6 +39,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) var/use_skintones = NO_SKINTONES // does it use skintones or not? (spoiler alert this is only used by humans) var/exotic_blood = "" // If your race wants to bleed something other than bog standard blood, change this to reagent id. var/exotic_bloodtype = "" //If your race uses a non standard bloodtype (A+, O-, AB-, etc) + var/exotic_blood_color = BLOOD_COLOR_HUMAN //assume human as the default blood colour, override this default by species subtypes var/meat = /obj/item/reagent_containers/food/snacks/meat/slab/human //What the species drops on gibbing var/list/gib_types = list(/obj/effect/gibspawner/human, /obj/effect/gibspawner/human/bodypartless) var/skinned_type diff --git a/code/modules/mob/living/carbon/human/species_types/bugmen.dm b/code/modules/mob/living/carbon/human/species_types/bugmen.dm index 595a83de9b..a79f9e2392 100644 --- a/code/modules/mob/living/carbon/human/species_types/bugmen.dm +++ b/code/modules/mob/living/carbon/human/species_types/bugmen.dm @@ -15,6 +15,7 @@ disliked_food = TOXIC icon_limbs = DEFAULT_BODYPART_ICON_CITADEL exotic_bloodtype = "BUG" + exotic_blood_color = BLOOD_COLOR_BUG /datum/species/insect/spec_death(gibbed, mob/living/carbon/human/H) if(H) diff --git a/code/modules/mob/living/carbon/human/species_types/flypeople.dm b/code/modules/mob/living/carbon/human/species_types/flypeople.dm index ee4ef83a44..dbf097196d 100644 --- a/code/modules/mob/living/carbon/human/species_types/flypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/flypeople.dm @@ -11,6 +11,7 @@ disliked_food = null liked_food = GROSS exotic_bloodtype = "BUG" + exotic_blood_color = BLOOD_COLOR_BUG /datum/species/fly/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) if(istype(chem, /datum/reagent/toxin/pestkiller)) diff --git a/code/modules/mob/living/carbon/human/species_types/ipc.dm b/code/modules/mob/living/carbon/human/species_types/ipc.dm index 94d5456c3d..96efaebd74 100644 --- a/code/modules/mob/living/carbon/human/species_types/ipc.dm +++ b/code/modules/mob/living/carbon/human/species_types/ipc.dm @@ -20,6 +20,7 @@ mutanteyes = /obj/item/organ/eyes/ipc exotic_bloodtype = "HF" + exotic_blood_color = BLOOD_COLOR_OIL var/datum/action/innate/monitor_change/screen diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index 5bdc0bbb39..934bbddfe1 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -13,6 +13,7 @@ gib_types = list(/obj/effect/gibspawner/slime, /obj/effect/gibspawner/slime/bodypartless) exotic_blood = /datum/reagent/blood/jellyblood exotic_bloodtype = "GEL" + exotic_blood_color = "BLOOD_COLOR_SLIME" damage_overlay_type = "" var/datum/action/innate/regenerate_limbs/regenerate_limbs var/datum/action/innate/slime_change/slime_change //CIT CHANGE @@ -41,6 +42,10 @@ slime_change.Grant(C) //CIT CHANGE C.faction |= "slime" +/datum/species/jelly/handle_mutant_bodyparts(mob/living/carbon/human/H) + //update blood color to body color + H.dna.species.exotic_blood_color = "#" + H.dna.features["mcolor"] + /datum/species/jelly/spec_life(mob/living/carbon/human/H) if(H.stat == DEAD || HAS_TRAIT(H, TRAIT_NOMARROW)) //can't farm slime jelly from a dead slime/jelly person indefinitely, and no regeneration for blooduskers return diff --git a/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm b/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm index 196073773b..c42e0bf175 100644 --- a/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm @@ -21,6 +21,7 @@ gib_types = list(/obj/effect/gibspawner/lizard, /obj/effect/gibspawner/lizard/bodypartless) skinned_type = /obj/item/stack/sheet/animalhide/lizard exotic_bloodtype = "L" + exotic_blood_color = BLOOD_COLOR_LIZARD disliked_food = GRAIN | DAIRY liked_food = GROSS | MEAT inert_mutation = FIREBREATH diff --git a/code/modules/mob/living/carbon/human/species_types/synthliz.dm b/code/modules/mob/living/carbon/human/species_types/synthliz.dm index 408d264546..af2e83ee0f 100644 --- a/code/modules/mob/living/carbon/human/species_types/synthliz.dm +++ b/code/modules/mob/living/carbon/human/species_types/synthliz.dm @@ -18,7 +18,7 @@ mutanteyes = /obj/item/organ/eyes/ipc exotic_bloodtype = "S" - + exotic_blood_color = BLOOD_COLOR_OIL /datum/species/synthliz/qualifies_for_rank(rank, list/features) return TRUE diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm index 4899067d7b..1a796fb2bc 100644 --- a/code/modules/mob/living/carbon/update_icons.dm +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -68,7 +68,7 @@ var/dam_colors = "#E62525" if(ishuman(src)) var/mob/living/carbon/human/H = src - dam_colors = bloodtype_to_color(H.dna.blood_type) + dam_colors = H.dna.species.exotic_blood_color var/mutable_appearance/damage_overlay = mutable_appearance('icons/mob/dam_mob.dmi', "blank", -DAMAGE_LAYER, color = dam_colors) overlays_standing[DAMAGE_LAYER] = damage_overlay diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index f279047356..7c988ca730 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -239,7 +239,7 @@ else if(ishuman(target)) var/mob/living/carbon/human/H = target - new /obj/effect/temp_visual/dir_setting/bloodsplatter(target_loca, splatter_dir, bloodtype_to_color(H.dna.blood_type)) + new /obj/effect/temp_visual/dir_setting/bloodsplatter(target_loca, splatter_dir, H.dna.species.exotic_blood_color) else new /obj/effect/temp_visual/dir_setting/bloodsplatter(target_loca, splatter_dir, bloodtype_to_color()) diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 117748afc0..93842a16c2 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -70,6 +70,8 @@ B = new(T) if(data["blood_DNA"]) B.blood_DNA[data["blood_DNA"]] = data["blood_type"] + if(!B.blood_DNA["color"]) + B.blood_DNA["color"] = list(data["bloodcolor"]) if(B.reagents) B.reagents.add_reagent(type, reac_volume) B.update_icon() @@ -77,7 +79,7 @@ /datum/reagent/blood/on_new(list/data) if(istype(data)) SetViruses(src, data) - color = bloodtype_to_color(data["blood_type"]) + color = data["bloodcolor"] if(data["blood_type"] == "SY") name = "Synthetic Blood" taste_description = "oil"