KISS principal

This commit is contained in:
Poojawa
2019-06-06 21:35:50 -05:00
parent 2e42656b6d
commit c2cf8b28df
9 changed files with 86 additions and 76 deletions
@@ -43,8 +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)
@@ -52,25 +52,27 @@
if(!has_gravity(loc))
return
var/obj/item/clothing/shoes/S = shoes
var/step_print = dna.species.get_move_trail(src)
//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()
var/obj/effect/decal/cleanable/blood/footprints/oldFP = locate(step_print) in T
if(S.bloody_shoes && S.bloody_shoes[S.blood_state])
for(oldFP)
if(oldFP && (oldFP.blood_state == S.blood_state && oldFP.color == bloodtype_to_color(last_bloodtype)))
return
//No oldFP or they're all a different kind of blood
S.bloody_shoes[S.blood_state] = max(0, S.bloody_shoes[S.blood_state] - BLOOD_LOSS_PER_STEP)
if (S.bloody_shoes[S.blood_state] > BLOOD_LOSS_IN_SPREAD)
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.bloody_shoes[S.blood_state] - BLOOD_LOSS_IN_SPREAD
if(S.last_blood_DNA && S.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
S.step_action()
else if(!shoes)
@@ -78,25 +80,27 @@
if(loc == NewLoc)
if(!has_gravity(loc))
return
var/step_print = dna.species.get_move_trail(src)
var/mob/living/carbon/human/H = src
//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
var/obj/effect/decal/cleanable/blood/footprints/oldFP = locate(step_print) in T
if(H.blood_smear && H.blood_smear[H.blood_state])
for(oldFP)
if(oldFP && (oldFP.blood_state == H.blood_state && oldFP.color == bloodtype_to_color(last_bloodtype)))
return
//No oldFP or they're all a different kind of blood
H.blood_smear[H.blood_state] = max(0, H.blood_smear[H.blood_state] - BLOOD_LOSS_PER_STEP)
if (H.blood_smear[H.blood_state] > BLOOD_LOSS_IN_SPREAD)
var/obj/effect/decal/cleanable/blood/footprints/tracks/FP = new step_print(T)
FP.blood_state = H.blood_state
FP.entered_dirs |= dir
FP.bloodiness = H.blood_smear[H.blood_state] - BLOOD_LOSS_IN_SPREAD
if(H.last_blood_DNA && H.last_bloodtype)
FP.blood_DNA += list(H.last_blood_DNA = H.last_bloodtype)
//hacky as heck; we need to move the LAST entry to there, otherwise we mix all the blood
FP.update_icon()
H.update_inv_shoes()
/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))