mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
A lot of new defines are now in inventory_sizes.dm, which contains; All the size identifiers (the thing that tells the game if something is bulky, or w/e). Storage costs for all the sizes, which are exponents of two, as previously. A few constants for inventory size. Also changes all storage item's capacity definitions by basing it off of how many 'normal slots' exist for it. This allows one to change the definition for all of the defines in the file, and everything will follow along without needing to change 500 files. In testing, I made all ITEMSIZE_COST_* defines doubled, and nothing had broke. The benefit of doing all of this is that it makes adding new weight classes in the future much simpler, and makes knowing how much space a container has easier, as seeing ITEMSIZE_COST_NORMAL * 7 means it can hold seven normal items.
86 lines
2.9 KiB
Plaintext
86 lines
2.9 KiB
Plaintext
/obj/item/weapon/forensics
|
|
icon = 'icons/obj/forensics.dmi'
|
|
w_class = ITEMSIZE_TINY
|
|
|
|
//This is the output of the stringpercent(print) proc, and means about 80% of
|
|
//the print must be there for it to be complete. (Prints are 32 digits)
|
|
var/const/FINGERPRINT_COMPLETE = 6
|
|
proc/is_complete_print(var/print)
|
|
return stringpercent(print) <= FINGERPRINT_COMPLETE
|
|
|
|
atom/var/list/suit_fibers
|
|
|
|
atom/proc/add_fibers(mob/living/carbon/human/M)
|
|
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves))
|
|
var/obj/item/clothing/gloves/G = M.gloves
|
|
if(G.transfer_blood) //bloodied gloves transfer blood to touched objects
|
|
if(add_blood(G.bloody_hands_mob)) //only reduces the bloodiness of our gloves if the item wasn't already bloody
|
|
G.transfer_blood--
|
|
else if(M.bloody_hands)
|
|
if(add_blood(M.bloody_hands_mob))
|
|
M.bloody_hands--
|
|
|
|
if(!suit_fibers) suit_fibers = list()
|
|
var/fibertext
|
|
var/item_multiplier = istype(src,/obj/item)?1.2:1
|
|
var/suit_coverage = 0
|
|
if(M.wear_suit)
|
|
fibertext = "Material from \a [M.wear_suit]."
|
|
if(prob(10*item_multiplier) && !(fibertext in suit_fibers))
|
|
suit_fibers += fibertext
|
|
suit_coverage = M.wear_suit.body_parts_covered
|
|
|
|
if(M.w_uniform && (M.w_uniform.body_parts_covered & ~suit_coverage))
|
|
fibertext = "Fibers from \a [M.w_uniform]."
|
|
if(prob(15*item_multiplier) && !(fibertext in suit_fibers))
|
|
suit_fibers += fibertext
|
|
|
|
if(M.gloves && (M.gloves.body_parts_covered & ~suit_coverage))
|
|
fibertext = "Material from a pair of [M.gloves.name]."
|
|
if(prob(20*item_multiplier) && !(fibertext in suit_fibers))
|
|
suit_fibers += "Material from a pair of [M.gloves.name]."
|
|
|
|
/datum/data/record/forensic
|
|
name = "forensic data"
|
|
var/uid
|
|
|
|
/datum/data/record/forensic/New(var/atom/A)
|
|
uid = "\ref [A]"
|
|
fields["name"] = sanitize(A.name)
|
|
fields["area"] = sanitize("[get_area(A)]")
|
|
fields["fprints"] = A.fingerprints ? A.fingerprints.Copy() : list()
|
|
fields["fibers"] = A.suit_fibers ? A.suit_fibers.Copy() : list()
|
|
fields["blood"] = A.blood_DNA ? A.blood_DNA.Copy() : list()
|
|
fields["time"] = world.time
|
|
|
|
/datum/data/record/forensic/proc/merge(var/datum/data/record/other)
|
|
var/list/prints = fields["fprints"]
|
|
var/list/o_prints = other.fields["fprints"]
|
|
for(var/print in o_prints)
|
|
if(!prints[print])
|
|
prints[print] = o_prints[print]
|
|
else
|
|
prints[print] = stringmerge(prints[print], o_prints[print])
|
|
fields["fprints"] = prints
|
|
|
|
var/list/fibers = fields["fibers"]
|
|
var/list/o_fibers = other.fields["fibers"]
|
|
fibers |= o_fibers
|
|
fields["fibers"] = fibers
|
|
|
|
var/list/blood = other.fields["blood"]
|
|
var/list/o_blood = other.fields["blood"]
|
|
blood |= o_blood
|
|
fields["blood"] = blood
|
|
|
|
fields["area"] = other.fields["area"]
|
|
fields["time"] = other.fields["time"]
|
|
|
|
/datum/data/record/forensic/proc/update_prints(var/list/o_prints)
|
|
var/list/prints = fields["fprints"]
|
|
for(var/print in o_prints)
|
|
if(prints[print])
|
|
prints[print] = stringmerge(prints[print], o_prints[print])
|
|
.=1
|
|
fields["fprints"] = prints
|