diff --git a/code/__HELPERS/_cit_helpers.dm b/code/__HELPERS/_cit_helpers.dm index f6d82ed93a..429e6d39fe 100644 --- a/code/__HELPERS/_cit_helpers.dm +++ b/code/__HELPERS/_cit_helpers.dm @@ -112,6 +112,15 @@ GLOBAL_LIST_INIT(paw_taurs, list( "Tiger" )) +GLOBAL_LIST_INIT(blood_id_types, list( + "blood" = /datum/reagent/blood/human, + "syntheticblood" = /datum/reagent/blood/synthetics, + "xenoblood" = /datum/reagent/blood/xenomorph, + "oilblood" = /datum/reagent/blood/oil, + "jellyblood" = /datum/reagent/blood/jellyblood + )) + + //Crew objective and miscreants stuff GLOBAL_VAR_INIT(miscreants_allowed, FALSE) diff --git a/code/datums/components/decals/blood.dm b/code/datums/components/decals/blood.dm index ff69c1ea54..b615b05280 100644 --- a/code/datums/components/decals/blood.dm +++ b/code/datums/components/decals/blood.dm @@ -28,8 +28,8 @@ var/icon/blood_splatter_icon = icon(initial(I.icon), initial(I.icon_state), , 1) //we only want to apply blood-splatters to the initial icon_state for each object blood_splatter_icon.Blend("#fff", ICON_ADD) //fills the icon_state with white (except where it's transparent) blood_splatter_icon.Blend(icon(_icon, _icon_state), ICON_MULTIPLY) //adds blood and the remaining white areas become transparant - blood_splatter_icon.Blend(I.blood_DNA_to_color(), ICON_MULTIPLY) //Color the blood with our dna stuff - pic = mutable_appearance(blood_splatter_icon, initial(I.icon_state)) + GET_COMPONENT(D, /datum/component/forensics) + blood_splatter_icon.Blend(D.blood_DNA_to_color(), ICON_MULTIPLY) blood_splatter_appearances[index] = pic return TRUE diff --git a/code/datums/components/forensics.dm b/code/datums/components/forensics.dm index c7a1f7eba5..c93981f0df 100644 --- a/code/datums/components/forensics.dm +++ b/code/datums/components/forensics.dm @@ -11,6 +11,7 @@ blood_DNA = blood_DNA | F.blood_DNA fibers = fibers | F.fibers check_blood() + blood_DNA_to_color() return ..() /datum/component/forensics/Initialize(new_fingerprints, new_hiddenprints, new_blood_DNA, new_fibers) @@ -21,6 +22,7 @@ blood_DNA = new_blood_DNA fibers = new_fibers check_blood() + blood_DNA_to_color() RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, .proc/clean_act) /datum/component/forensics/proc/wipe_fingerprints() @@ -32,8 +34,6 @@ /datum/component/forensics/proc/wipe_blood_DNA() blood_DNA = null - if(isitem(parent)) - qdel(parent.GetComponent(/datum/component/decal/blood)) return TRUE /datum/component/forensics/proc/wipe_fibers() @@ -149,6 +149,7 @@ for(var/i in dna) blood_DNA[i] = dna[i] check_blood() + blood_DNA_to_color() return TRUE /datum/component/forensics/proc/check_blood() @@ -156,4 +157,27 @@ return if(!length(blood_DNA)) return - parent.LoadComponent(/datum/component/decal/blood) + +/datum/component/forensics/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]]++ + else + colors[blood_DNA[bloop]] = 1 + + var/final_rgb = "#940000" + + 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 diff --git a/code/game/atoms.dm b/code/game/atoms.dm index b547482127..9060e7622e 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -35,7 +35,7 @@ var/rad_flags = NONE // Will move to flags_1 when i can be arsed to var/rad_insulation = RAD_NO_INSULATION - var/list/blood_DNA //reee dirty hack till Kevin tells me how to inherit this shit + var/icon/blood_splatter_icon /atom/New(loc, ...) //atom creation method that preloads variables at creation @@ -319,22 +319,24 @@ //returns the mob's dna info as a list, to be inserted in an object's blood_DNA list /mob/living/proc/get_blood_dna_list() - if(get_blood_id() != "blood") - return - return list("donor"= "ANIMAL","bloodcolor" = BLOOD_COLOR_HUMAN, "blood_type"="Y-") + for(var/bluhduh in GLOB.blood_types) + if(get_blood_id() != bluhduh) + return + return list("ANIMAL DNA" = "Y-") /mob/living/carbon/get_blood_dna_list() - if(get_blood_id() != "blood") - return - var/list/blood_dna = list() - if(dna) - blood_dna[dna.unique_enzymes] = dna.blood_type - else - blood_dna["UNKNOWN DNA"] = "X*" - return blood_dna + for(var/bluhduh in GLOB.blood_types) + if(get_blood_id() != bluhduh) + return + var/list/blood_dna = list() + if(dna) + blood_dna = get_blood_data(bluhduh) + else + blood_dna["UNKNOWN DNA"] = "X*" + return blood_dna /mob/living/carbon/alien/get_blood_dna_list() - return list("donor"= "UNKNOWN DNA","bloodcolor" = BLOOD_COLOR_XENO, "blood_type"= "X*") + return list("UNKNOWN DNA" = "X*") //to add a mob's dna info into an object's blood_DNA list. /atom/proc/transfer_mob_blood_dna(mob/living/L) @@ -348,15 +350,6 @@ return FALSE return TRUE -//to add blood dna info to the object's blood_DNA list -/atom/proc/transfer_blood_dna(list/blood_dna) - if(!blood_DNA) - blood_DNA = list() - var/old_length = blood_DNA_length() - blood_DNA |= blood_dna - if(blood_DNA_length() > old_length) - return TRUE//some new blood DNA was added - //to add blood from a mob onto something, and transfer their dna info /atom/proc/add_mob_blood(mob/living/M) var/list/blood_dna = M.get_blood_dna_list() @@ -364,15 +357,37 @@ return FALSE return add_blood_DNA(blood_dna) +//to add blood onto something, with blood dna info to include. +/atom/proc/add_blood(list/blood_dna) + return FALSE + +/obj/item/add_blood(list/blood_dna) + if(!..()) + return FALSE + add_blood_overlay() + return TRUE //we applied blood to the item + +/obj/item/proc/add_blood_overlay() + GET_COMPONENT(D, /datum/component/forensics) + if(!D.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 + blood_splatter_icon.Blend("#fff", ICON_ADD) //fills the icon_state with white (except where it's transparent) + blood_splatter_icon.Blend(icon('icons/effects/blood.dmi', "itemblood"), ICON_MULTIPLY) //adds blood and the remaining white areas become transparant + blood_splatter_icon.Blend(blood_DNA_to_color(), ICON_MULTIPLY) + add_overlay(blood_splatter_icon) + /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]]++ + GET_COMPONENT(D, /datum/component/forensics) + for(var/bloop in D.blood_DNA) + if(colors[D.blood_DNA[bloop]]) + colors[D.blood_DNA[bloop]]++ else - colors[blood_DNA[bloop]] = 1 + colors[D.blood_DNA[bloop]] = 1 - var/final_rgb = color + var/final_rgb = "#940000" if(colors.len) var/sum = 0 //this is all shitcode, but it works; trust me diff --git a/code/game/objects/effects/decals/cleanable.dm b/code/game/objects/effects/decals/cleanable.dm index 07152b0310..0c767dd1ae 100644 --- a/code/game/objects/effects/decals/cleanable.dm +++ b/code/game/objects/effects/decals/cleanable.dm @@ -74,6 +74,14 @@ var/mob/living/carbon/human/H = O if(H.shoes && blood_state && bloodiness && !H.has_trait(TRAIT_LIGHT_STEP)) var/obj/item/clothing/shoes/S = H.shoes + for(var/datum/reagent/R in reagents.reagent_list) + // Get blood data from the blood reagent. + if(istype(R, /datum/reagent/blood)) + if(R.data) + var/blood_type_meme = R.data["blood_type"] + color = bloodtype_to_color(blood_type_meme) //Color the blood with our dna stuff + if(blood_type_meme) + S.last_bloodtype = blood_type_meme var/add_blood = 0 if(bloodiness >= BLOOD_GAIN_PER_STEP) add_blood = BLOOD_GAIN_PER_STEP @@ -86,6 +94,26 @@ update_icon() H.update_inv_shoes() + else if(H && blood_state && bloodiness && !H.has_trait(TRAIT_LIGHT_STEP)) + for(var/datum/reagent/R in reagents.reagent_list) + // Get blood data from the blood reagent. + if(istype(R, /datum/reagent/blood)) + if(R.data["blood_type"]) + var/blood_type_meme = R.data["blood_type"] + color = bloodtype_to_color(blood_type_meme) //Color the blood with our dna stuff + if(blood_type_meme) + H.last_bloodtype = blood_type_meme + var/add_blood = 0 + if(bloodiness >= BLOOD_GAIN_PER_STEP) + add_blood = BLOOD_GAIN_PER_STEP + else + add_blood = bloodiness + bloodiness -= add_blood + H.blood_smear[blood_state] = min(MAX_SHOE_BLOODINESS,H.blood_smear[blood_state]+add_blood) + H.add_blood_DNA(return_blood_DNA()) + H.blood_state = blood_state + update_icon() + /obj/effect/decal/cleanable/proc/can_bloodcrawl_in() if((blood_state != BLOOD_STATE_OIL) && (blood_state != BLOOD_STATE_NOT_BLOODY)) return bloodiness diff --git a/code/game/objects/effects/decals/cleanable/aliens.dm b/code/game/objects/effects/decals/cleanable/aliens.dm index bbb50def0f..c42671509f 100644 --- a/code/game/objects/effects/decals/cleanable/aliens.dm +++ b/code/game/objects/effects/decals/cleanable/aliens.dm @@ -9,7 +9,6 @@ bloodiness = BLOOD_AMOUNT_PER_DECAL blood_state = BLOOD_STATE_BLOOD color = BLOOD_COLOR_XENO - blood_DNA = list() /obj/effect/decal/cleanable/blood/xenoblood/Initialize() . = ..() diff --git a/code/game/objects/effects/decals/cleanable/humans.dm b/code/game/objects/effects/decals/cleanable/humans.dm index cc41886b76..cc98d882f8 100644 --- a/code/game/objects/effects/decals/cleanable/humans.dm +++ b/code/game/objects/effects/decals/cleanable/humans.dm @@ -6,12 +6,14 @@ random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7") blood_state = BLOOD_STATE_BLOOD color = BLOOD_COLOR_HUMAN - blood_DNA = list() bloodiness = BLOOD_AMOUNT_PER_DECAL +/obj/effect/decal/cleanable/blood/Initialize(mapload) + . = ..() + AddComponent(/datum/component/forensics) + update_icon() + /obj/effect/decal/cleanable/blood/replace_decal(obj/effect/decal/cleanable/blood/C) - if (C.blood_DNA) - blood_DNA |= C.blood_DNA.Copy() update_icon() ..() @@ -23,7 +25,11 @@ update_icon() /obj/effect/decal/cleanable/blood/update_icon() - color = blood_DNA_to_color() + for(var/datum/reagent/R in reagents.reagent_list) + // Get blood data from the blood reagent. + if(istype(R, /datum/reagent/blood)) + if(R.data["blood_type"]) + color = bloodtype_to_color(R.data["blood_type"]) //Color the blood with our dna stuff /obj/effect/decal/cleanable/blood/old name = "dried blood" @@ -34,7 +40,7 @@ /obj/effect/decal/cleanable/blood/old/Initialize(mapload, list/datum/disease/diseases) . = ..() icon_state += "-old" //This IS necessary because the parent /blood type uses icon randomization. - add_blood_DNA(list("donor"= "Non-human DNA", "blood_type"= "A+", "bloodcolor" = color)) + add_blood_DNA(list("blood_type"= "A+", "bloodcolor" = color)) /obj/effect/decal/cleanable/blood/splatter random_icon_states = list("gibbl1", "gibbl2", "gibbl3", "gibbl4", "gibbl5") @@ -50,13 +56,17 @@ desc = "Your instincts say you shouldn't be following these." random_icon_states = null var/list/existing_dirs = list() - blood_DNA = list() /obj/effect/decal/cleanable/trail_holder/update_icon() - color = blood_DNA_to_color() + for(var/datum/reagent/R in reagents.reagent_list) + // Get blood data from the blood reagent. + if(istype(R, /datum/reagent/blood)) + if(R.data["blood_type"]) + color = bloodtype_to_color(R.data["blood_type"]) //Color the blood with our dna stuff /obj/effect/cleanable/trail_holder/Initialize() . = ..() + AddComponent(/datum/component/forensics) update_icon() /obj/effect/decal/cleanable/trail_holder/can_bloodcrawl_in() @@ -103,8 +113,11 @@ for(var/i = 0, i < pick(1, 200; 2, 150; 3, 50), i++) sleep(2) if(i > 0) - var/obj/effect/decal/cleanable/blood/splatter/splat = new(loc) - splat.transfer_blood_dna(blood_DNA) + var/list/datum/disease/diseases + GET_COMPONENT(infective, /datum/component/infective) + if(infective) + diseases = infective.diseases + new /obj/effect/decal/cleanable/blood/splatter(loc, diseases) if(!step_to(src, get_step(src, direction), 0)) break @@ -172,24 +185,44 @@ if(ishuman(O)) var/mob/living/carbon/human/H = O var/obj/item/clothing/shoes/S = H.shoes + if(S) + color = bloodtype_to_color(S.last_bloodtype) + else + color = bloodtype_to_color(H.last_bloodtype) + if(S && S.bloody_shoes[blood_state]) S.bloody_shoes[blood_state] = max(S.bloody_shoes[blood_state] - BLOOD_LOSS_PER_STEP, 0) shoe_types |= S.type if (!(entered_dirs & H.dir)) entered_dirs |= H.dir update_icon() + else + H.blood_smear[blood_state] = max(H.blood_smear[blood_state] - BLOOD_LOSS_PER_STEP, 0) + if (!(entered_dirs & H.dir)) + entered_dirs |= H.dir + update_icon() /obj/effect/decal/cleanable/blood/footprints/tracks/Uncrossed(atom/movable/O) ..() if(ishuman(O)) var/mob/living/carbon/human/H = O var/obj/item/clothing/shoes/S = H.shoes + if(S) + color = bloodtype_to_color(S.last_bloodtype) + else + color = bloodtype_to_color(H.last_bloodtype) + if(S && S.bloody_shoes[blood_state]) S.bloody_shoes[blood_state] = max(S.bloody_shoes[blood_state] - BLOOD_LOSS_PER_STEP, 0) shoe_types |= S.type if (!(exited_dirs & H.dir)) exited_dirs |= H.dir update_icon() + else + H.blood_smear[blood_state] = max(H.blood_smear[blood_state] - BLOOD_LOSS_PER_STEP, 0) + if (!(exited_dirs & H.dir)) + exited_dirs |= H.dir + update_icon() /obj/effect/decal/cleanable/blood/footprints/tracks/update_icon() diff --git a/code/game/objects/effects/spawners/gibspawner.dm b/code/game/objects/effects/spawners/gibspawner.dm index 0e6fcaf367..04130bc40b 100644 --- a/code/game/objects/effects/spawners/gibspawner.dm +++ b/code/game/objects/effects/spawners/gibspawner.dm @@ -11,6 +11,7 @@ /obj/effect/gibspawner/Initialize(mapload, mob/living/source_mob, list/datum/disease/diseases) . = ..() + AddComponent(/datum/component/forensics) if(gibtypes.len != gibamounts.len) stack_trace("Gib list amount length mismatch!") diff --git a/code/modules/clothing/gloves/_gloves.dm b/code/modules/clothing/gloves/_gloves.dm index 7146ad1313..5833190d4a 100644 --- a/code/modules/clothing/gloves/_gloves.dm +++ b/code/modules/clothing/gloves/_gloves.dm @@ -30,7 +30,8 @@ if(damaged_clothes) . += mutable_appearance('icons/effects/item_damage.dmi', "damagedgloves") IF_HAS_BLOOD_DNA(src) - . += mutable_appearance('icons/effects/blood.dmi', "bloodyhands", color = blood_DNA_to_color()) + GET_COMPONENT(D, /datum/component/forensics) + . += mutable_appearance('icons/effects/blood.dmi', "bloodyhands", color = D.blood_DNA_to_color()) /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 98bb3aec13..591b6c1d3b 100644 --- a/code/modules/clothing/head/_head.dm +++ b/code/modules/clothing/head/_head.dm @@ -47,7 +47,8 @@ if(damaged_clothes) . += mutable_appearance('icons/effects/item_damage.dmi', "damagedhelmet") IF_HAS_BLOOD_DNA(src) - . += mutable_appearance('icons/effects/blood.dmi', "helmetblood", color = blood_DNA_to_color()) + GET_COMPONENT(D, /datum/component/forensics) + . += mutable_appearance('icons/effects/blood.dmi', "helmetblood", color = D.blood_DNA_to_color()) /obj/item/clothing/head/update_clothes_damaged_state(damaging = TRUE) ..() diff --git a/code/modules/clothing/masks/_masks.dm b/code/modules/clothing/masks/_masks.dm index 2b820ecfc4..d4e54de0c7 100644 --- a/code/modules/clothing/masks/_masks.dm +++ b/code/modules/clothing/masks/_masks.dm @@ -18,7 +18,8 @@ if(damaged_clothes) . += mutable_appearance('icons/effects/item_damage.dmi', "damagedmask") IF_HAS_BLOOD_DNA(src) - . += mutable_appearance('icons/effects/blood.dmi', "maskblood", color = blood_DNA_to_color()) + GET_COMPONENT(D, /datum/component/forensics) + . += mutable_appearance('icons/effects/blood.dmi', "maskblood", color = D.blood_DNA_to_color()) /obj/item/clothing/mask/equipped(mob/user, slot) ..() diff --git a/code/modules/clothing/shoes/_shoes.dm b/code/modules/clothing/shoes/_shoes.dm index e52722b077..c0227b8765 100644 --- a/code/modules/clothing/shoes/_shoes.dm +++ b/code/modules/clothing/shoes/_shoes.dm @@ -44,12 +44,6 @@ playsound(user, 'sound/weapons/genhit2.ogg', 50, 1) return(BRUTELOSS) -/obj/item/clothing/shoes/transfer_mob_blood_dna(list/blood_dna) - ..() - 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] - /obj/item/clothing/shoes/worn_overlays(isinhands = FALSE) . = list() if(!isinhands) @@ -63,9 +57,9 @@ . += mutable_appearance('icons/effects/item_damage.dmi', "damagedshoe") if(bloody) if(adjusted == NORMAL_STYLE) - . += mutable_appearance('icons/effects/blood.dmi', "shoeblood", color = blood_DNA_to_color()) + . += mutable_appearance('icons/effects/blood.dmi', "shoeblood", color = bloodtype_to_color(last_bloodtype)) else - . += mutable_appearance('modular_citadel/icons/mob/digishoes.dmi', "shoeblood", color = blood_DNA_to_color()) + . += mutable_appearance('modular_citadel/icons/mob/digishoes.dmi', "shoeblood", color = bloodtype_to_color(last_bloodtype)) /obj/item/clothing/shoes/equipped(mob/user, slot) . = ..() diff --git a/code/modules/clothing/suits/_suits.dm b/code/modules/clothing/suits/_suits.dm index f4fe92e86b..1f67f93119 100644 --- a/code/modules/clothing/suits/_suits.dm +++ b/code/modules/clothing/suits/_suits.dm @@ -61,10 +61,11 @@ if(damaged_clothes) . += mutable_appearance('icons/effects/item_damage.dmi', "damaged[blood_overlay_type]") IF_HAS_BLOOD_DNA(src) + GET_COMPONENT(D, /datum/component/forensics) if(taurmode >= SNEK_TAURIC) - . += mutable_appearance('modular_citadel/icons/mob/64x32_effects.dmi', "[blood_overlay_type]blood", color = blood_DNA_to_color()) + . += mutable_appearance('modular_citadel/icons/mob/64x32_effects.dmi', "[blood_overlay_type]blood", color = D.blood_DNA_to_color()) else - . += mutable_appearance('icons/effects/blood.dmi', "[blood_overlay_type]blood", color = blood_DNA_to_color()) + . += mutable_appearance('icons/effects/blood.dmi', "[blood_overlay_type]blood", color = D.blood_DNA_to_color()) var/mob/living/carbon/human/M = loc if(ishuman(M) && M.w_uniform) var/obj/item/clothing/under/U = M.w_uniform diff --git a/code/modules/clothing/under/_under.dm b/code/modules/clothing/under/_under.dm index 5f123cd745..99c1642f43 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -23,7 +23,8 @@ if(damaged_clothes) . += mutable_appearance('icons/effects/item_damage.dmi', "damageduniform") IF_HAS_BLOOD_DNA(src) - . += mutable_appearance('icons/effects/blood.dmi', "uniformblood", color = blood_DNA_to_color()) + GET_COMPONENT(D, /datum/component/forensics) + . += mutable_appearance('icons/effects/blood.dmi', "uniformblood", color = D.blood_DNA_to_color()) if(accessory_overlay) . += accessory_overlay diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index e4b0923df6..8062fef935 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -138,7 +138,7 @@ if(iscarbon(AM)) var/mob/living/carbon/C = AM - for(var/bluhduh in GLOB.blood_types[blood_id]) + for(var/datum/reagent/blood/bluhduh in GLOB.blood_types[blood_id]) if(blood_id == C.get_blood_id())//both mobs have the same blood substance if(bluhduh) //actual blood reagent if(blood_data["viruses"]) @@ -171,7 +171,7 @@ return /mob/living/carbon/get_blood_data(blood_id) - for(var/bluhduh in GLOB.blood_types[blood_id]) + for(var/datum/reagent/blood/bluhduh in GLOB.blood_types[blood_id]) if(bluhduh) //actual blood reagent var/blood_data = list() //set the blood data @@ -183,6 +183,7 @@ blood_data["viruses"] += D.Copy() blood_data["blood_DNA"] = copytext(dna.unique_enzymes,1,0) + blood_data["bloodcolor"] = bloodtype_to_color(dna.blood_type) if(disease_resistances && disease_resistances.len) blood_data["resistances"] = disease_resistances.Copy() var/list/temp_chem = list() @@ -201,7 +202,6 @@ if(!suiciding) blood_data["cloneable"] = 1 blood_data["blood_type"] = copytext(dna.blood_type,1,0) - blood_data["bloodcolor"] = bloodtype_to_color(dna.blood_type) blood_data["gender"] = gender blood_data["real_name"] = real_name blood_data["features"] = dna.features @@ -234,7 +234,8 @@ return dna.species.exotic_blood else if((NOBLOOD in dna.species.species_traits) || (has_trait(TRAIT_NOCLONE))) return null - return "blood" + else + return "blood" // This is has more potential uses, and is probably faster than the old proc. /proc/get_safe_blood(bloodtype) diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 3731a98a49..b51d464ff7 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -45,6 +45,8 @@ var/blood_state = BLOOD_STATE_NOT_BLOODY var/list/blood_smear = list(BLOOD_STATE_BLOOD = 0, BLOOD_STATE_OIL = 0, BLOOD_STATE_NOT_BLOODY = 0) + var/last_bloodtype = ""//used to track the last bloodtype to have graced this smelly person. for smears on the floor + var/last_blood_DNA = ""//same as last one var/name_override //For temporary visible name changes diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index c777cfd14d..53d45d7666 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -66,10 +66,7 @@ FP.blood_state = S.blood_state FP.entered_dirs |= dir FP.bloodiness = S.bloody_shoes[S.blood_state] - FP.color = blood_DNA_to_color() //Color the blood with our dna stuff - if(S.last_blood_DNA && S.last_bloodtype) - FP.blood_DNA += list(S.last_blood_DNA = S.last_bloodtype) - //hacky as heck; we need to move the LAST entry to there, otherwise we mix all the blood + FP.color = bloodtype_to_color(S.last_bloodtype) FP.update_icon() update_inv_shoes() //End bloody footprints @@ -112,8 +109,7 @@ FP.blood_state = blood_state FP.entered_dirs |= dir FP.bloodiness = blood_smear - BLOOD_LOSS_IN_SPREAD - FP.transfer_blood_dna(blood_DNA) - FP.color = blood_DNA_to_color() //Color the blood with our dna stuff + FP.color = bloodtype_to_color(last_bloodtype) FP.update_icon() else //we're on the floor, smear some stuff around @@ -133,8 +129,7 @@ FP.blood_state = blood_state FP.entered_dirs |= dir FP.bloodiness = blood_smear - BLOOD_LOSS_IN_SPREAD - FP.transfer_blood_dna(blood_DNA) - FP.color = blood_DNA_to_color() //Color the blood with our dna stuff + FP.color = bloodtype_to_color(last_bloodtype) FP.update_icon() diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 6269057d01..6f5cdbfc6c 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -26,26 +26,34 @@ if(iscarbon(L)) var/mob/living/carbon/C = L - if(C.get_blood_id() == "blood" && (method == INJECT || (method == INGEST && C.dna && C.dna.species && (DRINKSBLOOD in C.dna.species.species_traits)))) - if(!data || !(data["blood_type"] in get_safe_blood(C.dna.blood_type))) - C.reagents.add_reagent("toxin", reac_volume * 0.5) - if(data && (data["blood_type"] == "GEL") && (C.dna.species.exotic_blood != "jellyblood")) - C.reagents.add_reagent("toxin", reac_volume * 1.5) //filthy xenos bloooood - if(data && (data["blood_type"] == "HF") && (C.dna.species.exotic_blood != "oilblood")) - C.reagents.add_reagent("toxin", reac_volume * 1) //don't fucking put oil in people - if(data && (data["blood_type"] == "X*") && (C.dna.species.exotic_blood != "xenoblood")) - C.reagents.add_reagent("toxin", reac_volume * 1.5) //acid blooood - else - C.blood_volume = min(C.blood_volume + round(reac_volume, 0.1), BLOOD_VOLUME_MAXIMUM) + for(var/bluhduh in GLOB.blood_types) + if(C.get_blood_id() == bluhduh) + if(method == INJECT || (method == INGEST && C.dna && C.dna.species && (DRINKSBLOOD in C.dna.species.species_traits))) + if(!data || !(data["blood_type"] in get_safe_blood(C.dna.blood_type))) + C.reagents.add_reagent("toxin", reac_volume * 0.5) + if(data && (data["blood_type"] == "GEL") && (C.dna.species.exotic_blood != "jellyblood")) + C.reagents.add_reagent("toxin", reac_volume * 1.5) //filthy xenos bloooood + if(data && (data["blood_type"] == "HF") && (C.dna.species.exotic_blood != "oilblood")) + C.reagents.add_reagent("toxin", reac_volume * 1) //don't fucking put oil in people + if(data && (data["blood_type"] == "X*") && (C.dna.species.exotic_blood != "xenoblood")) + C.reagents.add_reagent("toxin", reac_volume * 1.5) //acid blooood + else + C.blood_volume = min(C.blood_volume + round(reac_volume, 0.1), BLOOD_VOLUME_MAXIMUM) if(reac_volume >= 10 && istype(L)) L.add_blood_DNA(list(data["blood_DNA"] = data["blood_type"])) + L.color = bloodtype_to_color(data["blood_type"]) /datum/reagent/blood/reaction_obj(obj/O, volume) if(volume >= 3 && istype(O)) O.add_blood_DNA(list(data["blood_DNA"] = data["blood_type"])) + O.color = bloodtype_to_color(data["blood_type"]) /datum/reagent/blood/on_new(list/data) + if(iscarbon(src)) + var/mob/living/carbon/C = src + var/blood_id = C.get_blood_id() + data = C.get_blood_data(blood_id) if(istype(data)) SetViruses(src, data) color = bloodtype_to_color(data["blood_type"]) @@ -92,10 +100,12 @@ var/obj/effect/decal/cleanable/blood/B = locate() in T //find some blood here if(!B) B = new(T) - if(data["blood_DNA"]) + if(data) B.add_blood_DNA(list(data["blood_DNA"] = data["blood_type"])) B.color = data["bloodcolor"] +/datum/reagent/blood/human + /datum/reagent/blood/synthetics data = list("donor"=null,"viruses"=null,"blood_DNA"=null, "bloodcolor" = BLOOD_COLOR_SYNTHETIC, "blood_type"="SY","resistances"=null,"trace_chem"=null,"mind"=null,"ckey"=null,"gender"=null,"real_name"=null,"cloneable"=null,"factions"=null) name = "Synthetic Blood" diff --git a/tgstation.dme b/tgstation.dme index 9e9c6fe593..fdb11dea5e 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -375,7 +375,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"