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
@@ -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,10 +81,12 @@
else
add_blood = bloodiness
bloodiness -= add_blood
S.blood_smear[blood_state] = min(MAX_SHOE_BLOODINESS,S.blood_smear[blood_state]+add_blood)
S.bloody_shoes[blood_state] = min(MAX_SHOE_BLOODINESS,S.bloody_shoes[blood_state]+add_blood)
if(blood_DNA && blood_DNA.len)
S.add_blood(blood_DNA)
S.blood_smear = blood_state
if(S.last_blood_DNA != blood_DNA)
S.last_blood_DNA += blood_DNA
S.blood_state = blood_state
update_icon()
H.update_inv_shoes()
@@ -96,10 +99,11 @@
bloodiness -= add_blood
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)
H.blood_smear = blood_state
if(H.last_blood_DNA != blood_DNA)
H.last_blood_DNA += blood_DNA
H.blood_state = blood_state
update_icon()
H.update_inv_shoes()
//H.update_inv_shoes()
/obj/effect/decal/cleanable/proc/can_bloodcrawl_in()
if((blood_state != BLOOD_STATE_OIL) && (blood_state != BLOOD_STATE_NOT_BLOODY))
@@ -6,9 +6,8 @@
random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7")
blood_DNA = list()
blood_state = BLOOD_STATE_BLOOD
bloodiness = MAX_SHOE_BLOODINESS
color = BLOOD_COLOR_HUMAN //default so we don't have white splotches everywhere.
bloodiness = BLOOD_AMOUNT_PER_DECAL
/obj/effect/decal/cleanable/blood/replace_decal(obj/effect/decal/cleanable/blood/C)
if (C.blood_DNA)
@@ -35,7 +34,6 @@
name = "dried blood"
desc = "Looks like it's been here a while. Eew."
bloodiness = 0
color = "#3a0505"
/obj/effect/decal/cleanable/blood/old/Initialize(mapload, list/datum/disease/diseases)
..()
@@ -45,14 +43,14 @@
/obj/effect/decal/cleanable/blood/splatter
random_icon_states = list("gibbl1", "gibbl2", "gibbl3", "gibbl4", "gibbl5")
/obj/effect/decal/cleanable/trail_holder //not a child of blood on purpose so that it shows up even on regular splatters
/obj/effect/decal/cleanable/trail_holder //not a child of blood on purpose
name = "blood"
icon_state = "ltrails_1"
desc = "Your instincts say you shouldn't be following these."
random_icon_states = null
var/list/existing_dirs = list()
blood_DNA = list()
color = BLOOD_COLOR_HUMAN
bloodiness = BLOOD_AMOUNT_PER_DECAL
/obj/effect/decal/cleanable/trail_holder/update_icon()
color = blood_DNA_to_color()
@@ -89,10 +87,10 @@
if(ishuman(O))
var/mob/living/carbon/human/H = O
var/obj/item/clothing/shoes/S = H.shoes
if(S && S.blood_smear[blood_state])
if(S && S.bloody_shoes[blood_state])
if(color != bloodtype_to_color(S.last_bloodtype))
return
S.blood_smear[blood_state] = max(S.blood_smear[blood_state] - BLOOD_LOSS_PER_STEP, 0)
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
@@ -110,10 +108,10 @@
if(ishuman(O))
var/mob/living/carbon/human/H = O
var/obj/item/clothing/shoes/S = H.shoes
if(S && S.blood_smear[blood_state])
if(S && S.bloody_shoes[blood_state])
if(color != bloodtype_to_color(S.last_bloodtype))//last entry - we check its color
return
S.blood_smear[blood_state] = max(S.blood_smear[blood_state] - BLOOD_LOSS_PER_STEP, 0)
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
@@ -159,6 +157,8 @@
/obj/effect/decal/cleanable/blood/footprints/tracks/replace_decal(obj/effect/decal/cleanable/blood/footprints/tracks/C)
if(print_state != C.print_state) //We only replace footprints of the same type as us
return
if(blood_state != C.blood_state)
return
if(color != C.color)
return
..()
+3 -3
View File
@@ -739,9 +739,9 @@
for(var/obj/effect/decal/cleanable/trail_holder/TH in view(T, 2))
qdel(TH)
var/obj/item/clothing/shoes/shoecheck = user.shoes
if(shoecheck && shoecheck.blood_smear["blood"])
temp += shoecheck.blood_smear["blood"]/20
shoecheck.blood_smear["blood"] = 0
if(shoecheck && shoecheck.bloody_shoes["blood"])
temp += shoecheck.bloody_shoes["blood"]/20
shoecheck.bloody_shoes["blood"] = 0
if(temp)
user.Beam(T,icon_state="drainbeam",time=15)
new /obj/effect/temp_visual/cult/sparks(get_turf(user))
+1 -10
View File
@@ -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))
@@ -159,11 +154,7 @@
damaged_clothes = 0
cut_overlay(damaged_clothes_icons[index], TRUE)
/obj/item/clothing/transfer_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]
/*
SEE_SELF // can see self, no matter what
+14 -3
View File
@@ -13,6 +13,11 @@
var/offset = 0
var/equipped_before_drop = FALSE
var/blood_state = BLOOD_STATE_NOT_BLOODY
var/list/bloody_shoes = 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
//CITADEL EDIT Enables digitigrade shoe styles
var/adjusted = NORMAL_STYLE
mutantrace_variation = MUTANTRACE_VARIATION
@@ -45,7 +50,7 @@
if(blood_DNA)
bloody = TRUE
else
bloody = blood_smear[BLOOD_STATE_BLOOD]
bloody = bloody_shoes[BLOOD_STATE_BLOOD]
if(damaged_clothes)
. += mutable_appearance('icons/effects/item_damage.dmi', "damagedshoe")
@@ -91,7 +96,7 @@
/obj/item/clothing/shoes/clean_blood()
..()
blood_smear = list(BLOOD_STATE_BLOOD = 0, BLOOD_STATE_OIL = 0, BLOOD_STATE_NOT_BLOODY = 0)
bloody_shoes = list(BLOOD_STATE_BLOOD = 0, BLOOD_STATE_OIL = 0, BLOOD_STATE_NOT_BLOODY = 0)
blood_state = BLOOD_STATE_NOT_BLOODY
blood_color = null
if(ismob(loc))
@@ -99,4 +104,10 @@
M.update_inv_shoes()
/obj/item/proc/negates_gravity()
return FALSE
return FALSE
/obj/item/clothing/shoes/transfer_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]
@@ -2,6 +2,8 @@
/mob
var/bloody_hands = 0
var/bloody_feet = 0
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
@@ -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))
+12 -12
View File
@@ -2503,22 +2503,10 @@
#include "code\modules\research\designs\AI_module_designs.dm"
#include "code\modules\research\designs\biogenerator_designs.dm"
#include "code\modules\research\designs\bluespace_designs.dm"
#include "code\modules\research\designs\comp_board_designs\comp_board_designs_all_misc.dm"
#include "code\modules\research\designs\comp_board_designs\comp_board_designs_cargo .dm"
#include "code\modules\research\designs\comp_board_designs\comp_board_designs_engi.dm"
#include "code\modules\research\designs\comp_board_designs\comp_board_designs_medical.dm"
#include "code\modules\research\designs\comp_board_designs\comp_board_designs_sci.dm"
#include "code\modules\research\designs\comp_board_designs\comp_board_designs_sec.dm"
#include "code\modules\research\designs\computer_part_designs.dm"
#include "code\modules\research\designs\electronics_designs.dm"
#include "code\modules\research\designs\equipment_designs.dm"
#include "code\modules\research\designs\limbgrower_designs.dm"
#include "code\modules\research\designs\machine_desings\machine_designs_all_misc.dm"
#include "code\modules\research\designs\machine_desings\machine_designs_cargo.dm"
#include "code\modules\research\designs\machine_desings\machine_designs_engi.dm"
#include "code\modules\research\designs\machine_desings\machine_designs_medical.dm"
#include "code\modules\research\designs\machine_desings\machine_designs_sci.dm"
#include "code\modules\research\designs\machine_desings\machine_designs_service.dm"
#include "code\modules\research\designs\mecha_designs.dm"
#include "code\modules\research\designs\mechfabricator_designs.dm"
#include "code\modules\research\designs\medical_designs.dm"
@@ -2536,6 +2524,18 @@
#include "code\modules\research\designs\autolathe_desings\autolathe_designs_sec_and_hacked.dm"
#include "code\modules\research\designs\autolathe_desings\autolathe_designs_tcomms_and_misc.dm"
#include "code\modules\research\designs\autolathe_desings\autolathe_designs_tools.dm"
#include "code\modules\research\designs\comp_board_designs\comp_board_designs_all_misc.dm"
#include "code\modules\research\designs\comp_board_designs\comp_board_designs_cargo .dm"
#include "code\modules\research\designs\comp_board_designs\comp_board_designs_engi.dm"
#include "code\modules\research\designs\comp_board_designs\comp_board_designs_medical.dm"
#include "code\modules\research\designs\comp_board_designs\comp_board_designs_sci.dm"
#include "code\modules\research\designs\comp_board_designs\comp_board_designs_sec.dm"
#include "code\modules\research\designs\machine_desings\machine_designs_all_misc.dm"
#include "code\modules\research\designs\machine_desings\machine_designs_cargo.dm"
#include "code\modules\research\designs\machine_desings\machine_designs_engi.dm"
#include "code\modules\research\designs\machine_desings\machine_designs_medical.dm"
#include "code\modules\research\designs\machine_desings\machine_designs_sci.dm"
#include "code\modules\research\designs\machine_desings\machine_designs_service.dm"
#include "code\modules\research\machinery\_production.dm"
#include "code\modules\research\machinery\circuit_imprinter.dm"
#include "code\modules\research\machinery\departmental_circuit_imprinter.dm"