just need items to actually have their overlays, ree

This commit is contained in:
Poojawa
2019-08-17 04:50:24 -05:00
parent 088bc484e3
commit 725a8046e1
8 changed files with 20 additions and 45 deletions
@@ -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()
@@ -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"
+1 -1
View File
@@ -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()