progress, just need to fiddle with footprints again
This commit is contained in:
+42
-27
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
. = ..()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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!")
|
||||
|
||||
Reference in New Issue
Block a user