From 9e01a078ec5f8d96e1cb7d9b2c882f1e46ce03a1 Mon Sep 17 00:00:00 2001 From: Poojawa Date: Mon, 3 Jun 2019 20:06:25 -0500 Subject: [PATCH] lel --- code/game/objects/effects/decals/cleanable.dm | 3 ++ .../effects/decals/cleanable/humans.dm | 2 +- code/game/turfs/turf.dm | 35 +++++++++++++ code/modules/clothing/clothing.dm | 5 -- .../detectivework/footprints_and_rag.dm | 7 ++- .../mob/living/carbon/human/human_defines.dm | 5 -- .../mob/living/carbon/human/human_movement.dm | 52 ------------------- 7 files changed, 44 insertions(+), 65 deletions(-) diff --git a/code/game/objects/effects/decals/cleanable.dm b/code/game/objects/effects/decals/cleanable.dm index 317a105b2d..babc012719 100644 --- a/code/game/objects/effects/decals/cleanable.dm +++ b/code/game/objects/effects/decals/cleanable.dm @@ -70,6 +70,7 @@ //Add "bloodiness" of this blood's type, to the human's shoes //This is on /cleanable because fuck this ancient mess /obj/effect/decal/cleanable/Crossed(atom/movable/O) + ..() if(ishuman(O)) var/mob/living/carbon/human/H = O if(H.shoes && blood_state && bloodiness && (!H.has_trait(TRAIT_LIGHT_STEP) || !H.mind.assigned_role == "Detective")) @@ -80,6 +81,7 @@ else add_blood = bloodiness bloodiness -= add_blood + to_chat(world, "S.blood_state is [S.blood_state], & blood smear state is [S.blood_smear[S.blood_state]]") S.blood_smear[blood_state] = min(MAX_SHOE_BLOODINESS,S.blood_smear[blood_state]+add_blood) if(blood_DNA && blood_DNA.len) S.add_blood(blood_DNA) @@ -94,6 +96,7 @@ else add_blood = bloodiness bloodiness -= add_blood + to_chat(world, "blood_state is [blood_state], & blood smear state is [H.blood_smear[blood_state]]") H.blood_smear[blood_state] = min(MAX_SHOE_BLOODINESS,H.blood_smear[blood_state]+add_blood) if(blood_DNA && blood_DNA.len) H.add_blood(blood_DNA) diff --git a/code/game/objects/effects/decals/cleanable/humans.dm b/code/game/objects/effects/decals/cleanable/humans.dm index ec1f7578b5..711e792752 100644 --- a/code/game/objects/effects/decals/cleanable/humans.dm +++ b/code/game/objects/effects/decals/cleanable/humans.dm @@ -130,7 +130,7 @@ /obj/effect/decal/cleanable/blood/footprints/tracks/update_icon() ..() cut_overlays() - + to_chat(world, "[src] called update_icon with [print_state]") for(var/Ddir in GLOB.cardinals) if(entered_dirs & Ddir) var/image/bloodstep_overlay = GLOB.bloody_footprints_cache["entered-[print_state]-[Ddir]"] diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index afe275f9b9..13ea59cb52 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -194,9 +194,44 @@ if(O.obj_flags & FROZEN) O.make_unfrozen() + if(isliving(A)) + var/mob/living/M = A + if(ishuman(M)) + var/mob/living/carbon/human/H = M + // Tracking blood + var/list/bloodDNA = null + var/bloodcolor="" + if(H.shoes) + var/obj/item/clothing/shoes/S = H.shoes + if(istype(S)) + S.step_action() + if(S.track_blood && S.blood_DNA) + bloodDNA = S.blood_DNA + bloodcolor = S.blood_color + S.track_blood-- + else + if(H.track_blood && H.feet_blood_DNA) + bloodDNA = H.feet_blood_DNA + bloodcolor = H.feet_blood_color + H.track_blood-- + + if (bloodDNA && H.species.get_move_trail(H)) + src.AddTracks(H.species.get_move_trail(H),bloodDNA,H.dir,0,bloodcolor) // Coming + var/turf/simulated/from = get_step(H,reverse_direction(H.dir)) + if(istype(from) && from) + from.AddTracks(H.species.get_move_trail(H),bloodDNA,0,H.dir,bloodcolor) // Going + + bloodDNA = null + /turf/proc/is_plasteel_floor() return FALSE +/turf/open/proc/AddTracks(var/typepath,var/bloodDNA,var/comingdir,var/goingdir,var/bloodcolor=COLOR_BLOOD_HUMAN) + var/obj/effect/decal/cleanable/blood/tracks/tracks = locate(typepath) in src + if(!tracks) + tracks = new typepath(src) + tracks.AddTracks(bloodDNA,comingdir,goingdir,bloodcolor) + // A proc in case it needs to be recreated or badmins want to change the baseturfs /turf/proc/assemble_baseturfs(turf/fake_baseturf_type) var/static/list/created_baseturf_lists = list() diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index caf12d4b86..a24a6eff95 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -41,11 +41,6 @@ var/dynamic_hair_suffix = ""//head > mask for head hair var/dynamic_fhair_suffix = ""//mask > head for facial hair - 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 these shoes; makes for better performing footprint shenanigans - var/last_blood_DNA = ""//same as last one - /obj/item/clothing/Initialize() . = ..() if(ispath(pocket_storage_component_path)) diff --git a/code/modules/detectivework/footprints_and_rag.dm b/code/modules/detectivework/footprints_and_rag.dm index 611001ecf9..1f4def8905 100644 --- a/code/modules/detectivework/footprints_and_rag.dm +++ b/code/modules/detectivework/footprints_and_rag.dm @@ -1,13 +1,16 @@ /mob var/bloody_hands = 0 - var/bloody_feet = 0 + var/track_blood = 0 + var/feet_blood_color + var/last_bloodtype = ""//used to track the last bloodtype to have graced this filthy spaceman; makes for better performing footprint shenanigans + var/last_blood_DNA = ""//same as last one /obj/item/clothing/gloves var/transfer_blood = 0 /obj/item/clothing/shoes - var/transfer_blood = 0 + var/track_blood = 0 /obj/item/reagent_containers/glass/rag diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 7819eb8356..d1ec7f3e4b 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -43,11 +43,6 @@ var/bleed_rate = 0 //how much are we bleeding var/bleedsuppress = 0 //for stopping bloodloss, eventually this will be limb-based like bleeding - var/last_bloodtype = ""//used to track the last bloodtype to have graced this filthy spaceman; makes for better performing footprint shenanigans - var/last_blood_DNA = ""//same as last one - 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/name_override //For temporary visible name changes var/nameless = FALSE //For drones of both the insectoid and robotic kind. And other types of nameless critters. diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 01e81832ef..4ee48f2d09 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -46,58 +46,6 @@ for(var/datum/mutation/human/HM in dna.mutations) HM.on_move(src, NewLoc) - if(shoes) - if(!lying && !buckled) - if(loc == NewLoc) - if(!has_gravity(loc)) - return - var/obj/item/clothing/shoes/S = shoes - //Bloody footprints - var/turf/T = get_turf(src) - var/step_print = dna.species.get_move_trail(src) - if(S.blood_smear && S.blood_smear[S.blood_state]) - var/obj/effect/decal/cleanable/blood/footprints/oldFP = locate(step_print) in T - if(oldFP && (oldFP.blood_state == S.blood_state && oldFP.color == bloodtype_to_color(S.last_bloodtype))) - return - S.blood_smear[S.blood_state] = max(0, S.blood_smear[S.blood_state]-BLOOD_LOSS_PER_STEP) - var/obj/effect/decal/cleanable/blood/footprints/tracks/FP = new step_print(T) - FP.blood_state = S.blood_state - FP.entered_dirs |= dir - FP.bloodiness = S.blood_smear[S.blood_state] - 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.update_icon() - update_inv_shoes() - //End bloody footprints - - S.step_action() - - else if(!shoes) - if(!buckled) - if(loc == NewLoc) - if(!has_gravity(loc)) - return - //Bloody footprints without shoes - var/turf/T = get_turf(src) - var/step_print = dna.species.get_move_trail(src) - if(blood_smear && blood_smear[blood_state]) - var/obj/effect/decal/cleanable/blood/footprints/oldFP = locate(step_print) in T - if(oldFP && (oldFP.blood_state == blood_state && oldFP.color == bloodtype_to_color(last_bloodtype))) - return - blood_smear[blood_state] = max(0, blood_smear[blood_state]-BLOOD_LOSS_PER_STEP) - var/obj/effect/decal/cleanable/blood/footprints/tracks/FP = new step_print(T) - FP.blood_state = blood_state - FP.entered_dirs |= dir - FP.bloodiness = blood_smear[blood_state] - if(last_blood_DNA && last_bloodtype) - FP.blood_DNA += list(last_blood_DNA = last_bloodtype) - //hacky as heck; we need to move the LAST entry to there, otherwise we mix all the blood - FP.update_icon() - update_inv_shoes() - //End bloody footprints - - /mob/living/carbon/human/Process_Spacemove(movement_dir = 0) //Temporary laziness thing. Will change to handles by species reee. if(dna.species.space_move(src)) return TRUE