Files
VOREStation/code/modules/detectivework/tools/sample_kits.dm
T
Cameron Lennox d5849910e5 Begin clickcode attack_self fix (#18797)
* Begin clickcode attack_self fix

Begins the work to make everything call back to parent for attack_self so that signals are sacred.

* Makes MORE things call the attack_self() parent

Yes, I could make special_handling a var on obj/item HOWEVER i want it to be specific so it can be tracked down later and ONLY the objects that use it can be refactored instead of sitting there literally forever and it just becoming 'a thing'.

* Finishes making the rest of attack_self call parent.

As mentioned, things such as 'specialty_goggles' 'special_handling' and the such are only there to help with attack_self until the attack_self is recoded for those items.

* begone foul demon

* some more cleanup

* These

* GOD this was annoying

* yeh

* Fix this

* fLARES

* Thesee too

* toys!

* Even more!

* More fixes

* Even more

* rest of em

* these too

* Update syndie.dm

* hardref clear

* Update code/game/gamemodes/nuclear/pinpointer.dm

* Update code/game/objects/effects/mines.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/contraband_vr.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/weapons/gift_wrappaper.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* these too

* Update maintpanel_stack.dm

* angry warning

* Fixes packaged snacks.

Fixes improper var default.

* Special handling for these

* proper poly types

* Fixes magclaws

Makes the 'features' it had just part  of base magboots that can be adjusted via varswap.

* Fixes jackets

Fixes https://github.com/VOREStation/VOREStation/issues/18941

* Small bugfix

Makes p_Theyre properly capitialize
Makes examine show proper wording

* Update gift_wrappaper.dm
2025-12-29 13:21:10 -05:00

165 lines
5.0 KiB
Plaintext

/obj/item/sample
name = "forensic sample"
icon = 'icons/obj/forensics.dmi'
w_class = ITEMSIZE_TINY
var/list/evidence = list()
/obj/item/sample/Initialize(mapload, var/atom/supplied)
. = ..()
if(supplied && supplied.forensic_data)
copy_evidence(supplied)
name = "[initial(name)] (\the [supplied])"
/obj/item/sample/print/Initialize(mapload, supplied)
. = ..()
if(evidence && evidence.len)
icon_state = "fingerprint1"
/obj/item/sample/proc/copy_evidence(var/atom/supplied)
var/list/fibre_data = supplied.forensic_data.get_fibres()
if(fibre_data && fibre_data.len)
evidence = fibre_data.Copy()
supplied.forensic_data.clear_fibres()
/obj/item/sample/proc/merge_evidence(var/obj/item/sample/supplied, var/mob/user)
if(!supplied.evidence || !supplied.evidence.len)
return 0
evidence |= supplied.evidence
name = "[initial(name)] (combined)"
to_chat(user, span_notice("You transfer the contents of \the [supplied] into \the [src]."))
return 1
/obj/item/sample/print/merge_evidence(var/obj/item/sample/supplied, var/mob/user)
if(!supplied.evidence || !supplied.evidence.len)
return 0
for(var/print in supplied.evidence)
if(evidence[print])
evidence[print] = stringmerge(evidence[print],supplied.evidence[print])
else
evidence[print] = supplied.evidence[print]
name = "[initial(name)] (combined)"
to_chat(user, span_notice("You overlay \the [src] and \the [supplied], combining the print records."))
return 1
/obj/item/sample/attackby(var/obj/O, var/mob/user)
if(O.type == src.type)
user.unEquip(O)
if(merge_evidence(O, user))
qdel(O)
return 1
return ..()
/obj/item/sample/fibers
name = "fiber bag"
desc = "Used to hold fiber evidence for the detective."
icon_state = "fiberbag"
/obj/item/sample/print
name = "fingerprint card"
desc = "Records a set of fingerprints."
icon = 'icons/obj/card.dmi'
icon_state = "fingerprint0"
item_state = "paper"
/obj/item/sample/print/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(evidence && evidence.len)
return
if(!ishuman(user))
return
var/mob/living/carbon/human/H = user
if(H.gloves)
to_chat(user, span_warning("Take \the [H.gloves] off first."))
return
to_chat(user, span_notice("You firmly press your fingertips onto the card."))
var/fullprint = H.get_full_print()
evidence[fullprint] = fullprint
name = "[initial(name)] (\the [H])"
icon_state = "fingerprint1"
/obj/item/sample/print/attack(var/mob/living/M, var/mob/user)
if(!ishuman(M))
return ..()
if(evidence && evidence.len)
return 0
var/mob/living/carbon/human/H = M
if(H.gloves)
to_chat(user, span_warning("\The [H] is wearing gloves."))
return 1
if(user != H && H.a_intent != I_HELP && !H.lying)
user.visible_message(span_danger("\The [user] tries to take prints from \the [H], but they move away."))
return 1
if(user.zone_sel.selecting == BP_R_HAND || user.zone_sel.selecting == BP_L_HAND)
var/has_hand
var/obj/item/organ/external/O = H.organs_by_name[BP_R_HAND]
if(istype(O) && !O.is_stump())
has_hand = 1
else
O = H.organs_by_name[BP_L_HAND]
if(istype(O) && !O.is_stump())
has_hand = 1
if(!has_hand)
to_chat(user, span_warning("They don't have any hands."))
return 1
user.visible_message("[user] takes a copy of \the [H]'s fingerprints.")
var/fullprint = H.get_full_print()
evidence[fullprint] = fullprint
copy_evidence(src)
name = "[initial(name)] (\the [H])"
icon_state = "fingerprint1"
return 1
return 0
/obj/item/sample/print/copy_evidence(var/atom/supplied)
var/list/print_data = supplied.forensic_data.get_prints()
if(print_data && print_data.len)
for(var/print in print_data)
evidence[print] = print_data[print]
supplied.forensic_data.clear_prints()
/obj/item/forensics/sample_kit
name = "fiber collection kit"
desc = "A magnifying glass and tweezers. Used to lift suit fibers."
icon_state = "m_glass"
w_class = ITEMSIZE_SMALL
var/evidence_type = "fiber"
var/evidence_path = /obj/item/sample/fibers
/obj/item/forensics/sample_kit/proc/can_take_sample(var/mob/user, var/atom/supplied)
return supplied.forensic_data?.has_fibres()
/obj/item/forensics/sample_kit/proc/take_sample(var/mob/user, var/atom/supplied)
var/obj/item/sample/S = new evidence_path(get_turf(user), supplied)
to_chat(user, span_notice("You transfer [S.evidence.len] [S.evidence.len > 1 ? "[evidence_type]s" : "[evidence_type]"] to \the [S]."))
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_FORENSICS_COLLECTED, supplied, user)
/obj/item/forensics/sample_kit/afterattack(var/atom/A, var/mob/user, var/proximity)
if(!proximity)
return
add_fingerprint(user)
if(can_take_sample(user, A))
take_sample(user,A)
return 1
else
to_chat(user, span_warning("You are unable to locate any [evidence_type]s on \the [A]."))
return ..()
/obj/item/forensics/sample_kit/powder
name = "fingerprint powder"
desc = "A jar containing aluminum powder and a specialized brush."
icon_state = "dust"
evidence_type = "fingerprint"
evidence_path = /obj/item/sample/print
/obj/item/forensics/sample_kit/powder/can_take_sample(var/mob/user, var/atom/supplied)
return supplied.forensic_data?.has_prints()