Refactors the forensics component into a datum (#66809)

About The Pull Request

This was doing things component really shouldn't be doing, and now all
of its behaviour is contained onto a datum, as it should've been the
whole time
Why It's Good For The CODEBASE

some things just really shouldn't be components, this was made back when DCS was first implemented and just thrown in because it was the new hot thing i guess, but datumized forensics makes far more sense, AND doesn't use GetComponent

TODO:

    More thorough testing to make sure nothing broke

Changelog

🆑
refactor: Turned the forensics component into a datum.
/🆑
This commit is contained in:
Seth Scherer
2022-05-16 16:33:59 +12:00
committed by GitHub
parent bea9387458
commit a3add37618
28 changed files with 407 additions and 338 deletions
+1 -1
View File
@@ -326,7 +326,7 @@
drop.transfer_mob_blood_dna(src)
return
else
temp_blood_DNA = drop.return_blood_DNA() //we transfer the dna from the drip to the splatter
temp_blood_DNA = GET_ATOM_BLOOD_DNA(drop) //we transfer the dna from the drip to the splatter
qdel(drop)//the drip is replaced by a bigger splatter
else
drop = new(T, get_static_viruses())
+1 -1
View File
@@ -1398,7 +1398,7 @@
if(!isturf(loc))
return
var/obj/effect/decal/cleanable/blood/hitsplatter/our_splatter = new(loc)
our_splatter.add_blood_DNA(return_blood_DNA())
our_splatter.add_blood_DNA(GET_ATOM_BLOOD_DNA(src))
our_splatter.blood_dna_info = get_blood_dna_list()
var/turf/targ = get_ranged_target_turf(src, splatter_direction, splatter_strength)
our_splatter.fly_towards(targ, splatter_strength)
@@ -46,11 +46,10 @@
if(!(I.item_flags & ABSTRACT) && !(I.item_flags & EXAMINE_SKIP))
. += "[t_He] [t_is] holding [I.get_examine_string(user)] in [t_his] [get_held_index_name(get_held_index_of_item(I))]."
var/datum/component/forensics/FR = GetComponent(/datum/component/forensics)
//gloves
if(gloves && !(obscured & ITEM_SLOT_GLOVES) && !(gloves.item_flags & EXAMINE_SKIP))
. += "[t_He] [t_has] [gloves.get_examine_string(user)] on [t_his] hands."
else if(FR && length(FR.blood_DNA))
else if(GET_ATOM_BLOOD_DNA_LENGTH(src))
if(num_hands)
. += span_warning("[t_He] [t_has] [num_hands > 1 ? "" : "a"] blood-stained hand[num_hands > 1 ? "s" : ""]!")
@@ -211,7 +211,7 @@
for(var/X in list(ITEM_SLOT_HEAD, ITEM_SLOT_MASK, ITEM_SLOT_ICLOTHING, ITEM_SLOT_OCLOTHING, ITEM_SLOT_FEET))
var/obj/item/I = L.get_item_by_slot(X)
if(I && HAS_BLOOD_DNA(I))
if(I && GET_ATOM_BLOOD_DNA_LENGTH(I))
return FALSE
return TRUE
@@ -487,7 +487,7 @@
if(!last_move || isspaceturf(oldLoc)) //if we didn't sucessfully move, or if our old location was a spaceturf.
return
var/obj/effect/decal/cleanable/blood/tracks/B = new(oldLoc)
B.add_blood_DNA(return_blood_DNA())
B.add_blood_DNA(GET_ATOM_BLOOD_DNA(src))
B.setDir(direct)
bloodiness--