Files
Batrachophreno 387cee9243 Object Examine Text Overhaul (#20923)
Extends and reworks how various extended information text (desc_info,
desc_build, desc_upgrades) are handled to make object interactions and
mechanics A.) much more clearly documented in-game and B.) much easier
to support from the back-end.

Almost certainly a candidate for test merge.

Assembly/Disassembly instructions are noticeably sporadic, largely due
to our current lack of a unified framework. That's a future thing I'd
like to attack so that it can be handled programmatically, but for now I
only targeted the biggest culprits as I came across them.

---------

Signed-off-by: Batrachophreno <Batrochophreno@gmail.com>
2025-07-21 15:35:14 +00:00

62 lines
2.2 KiB
Plaintext

/obj/item/forensics/slide
name = "microscope slide"
desc = "A pair of thin glass panes used in the examination of samples beneath a microscope."
icon_state = "slide"
var/obj/item/forensics/swab/has_swab
var/obj/item/sample/fibers/has_sample
/obj/item/forensics/slide/mechanics_hints(mob/user, distance, is_adjacent)
. += ..()
. += "Used with fibers and GSR swab tests to examine the samples in the microscope."
. += "To empty them, use in hand."
/obj/item/forensics/slide/Initialize(mapload, ...)
. = ..()
create_reagents(5)
/obj/item/forensics/slide/attackby(obj/item/attacking_item, mob/user)
if(has_swab || has_sample || reagents.total_volume)
to_chat(user, SPAN_WARNING("There is already a sample in the slide."))
return
if(istype (attacking_item, /obj/item/forensics/swab))
has_swab = attacking_item
else if(istype(attacking_item, /obj/item/sample/fibers))
has_sample = attacking_item
else if(istype(attacking_item, /obj/item/reagent_containers) && REAGENT_VOLUME(attacking_item.reagents, /singleton/reagent/biological_tissue))
attacking_item.reagents.trans_type_to(reagents, /singleton/reagent/biological_tissue, 5)
else
to_chat(user, SPAN_WARNING("You don't think this will fit."))
return
to_chat(user, SPAN_NOTICE("You insert the sample into the slide."))
user.unEquip(attacking_item)
attacking_item.forceMove(src)
update_icon()
/obj/item/forensics/slide/attack_self(var/mob/user)
if(has_swab || has_sample)
to_chat(user, SPAN_NOTICE("You remove \the sample from \the [src]."))
if(has_swab)
user.put_in_hands(has_swab)
has_swab = null
if(has_sample)
user.put_in_hands(has_sample)
has_sample = null
update_icon()
return
/obj/item/forensics/slide/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
. = ..()
if(istype(target, /obj/item/reagent_containers) && reagents.total_volume)
reagents.trans_to_holder(target.reagents, 5)
to_chat(user, SPAN_NOTICE("You remove the sample from \the [src]."))
/obj/item/forensics/slide/update_icon()
if(!has_swab && !has_sample)
icon_state = "slide"
else if(has_swab)
icon_state = "slideswab"
else if(has_sample)
icon_state = "slidefiber"
else if(reagents.total_volume)
icon_state = "slidecells"