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

135 lines
5.2 KiB
Plaintext

/obj/item/reagent_containers/dropper
name = "dropper"
desc = "A dropper. It has a volume of 5 units."
icon = 'icons/obj/item/reagent_containers/dropper.dmi'
contained_sprite = TRUE
icon_state = "dropper"
item_state = "dropper"
filling_states = "10;25;50;75;100"
build_from_parts = TRUE
amount_per_transfer_from_this = 5
possible_transfer_amounts = list(1,2,3,4,5)
w_class = WEIGHT_CLASS_TINY
slot_flags = SLOT_EARS
volume = 5
drop_sound = 'sound/items/drop/glass_small.ogg'
pickup_sound = 'sound/items/pickup/glass_small.ogg'
/obj/item/reagent_containers/dropper/mechanics_hints(mob/user, distance, is_adjacent)
. += ..()
. += "ALT-Click or use this item to change transfer rate."
/obj/item/reagent_containers/dropper/feedback_hints(mob/user, distance, is_adjacent)
. += ..()
if(LAZYLEN(reagents.reagent_volumes))
. += "\The [src] is holding [reagents.total_volume] units out of [volume]. Current transfer is [amount_per_transfer_from_this] units."
else
. += "It is empty."
/obj/item/reagent_containers/dropper/afterattack(var/obj/target, var/mob/user, var/flag)
if(!target.reagents || !flag)
return
if(reagents.total_volume)
if(!REAGENTS_FREE_SPACE(target.reagents))
to_chat(user, SPAN_NOTICE("[target] is full."))
return
if(!target.is_open_container() && !ismob(target) && !istype(target, /obj/item/reagent_containers/food) && !istype(target, /obj/item/clothing/mask/smokable/cigarette)) //You can inject humans and food but you cant remove the shit.
to_chat(user, SPAN_NOTICE("You cannot directly fill this object."))
return
var/trans = 0
if(ismob(target))
var/time = 20 //2/3rds the time of a syringe
user.visible_message(SPAN_WARNING("[user] is trying to squirt something into [target]'s eyes!"))
if(!do_mob(user, target, time))
return
if(istype(target, /mob/living/carbon/human))
var/mob/living/carbon/human/victim = target
if(victim.isSynthetic())
return
var/obj/item/safe_thing = null
if(victim.wear_mask)
if (victim.wear_mask.body_parts_covered & EYES)
safe_thing = victim.wear_mask
if(victim.head)
if (victim.head.body_parts_covered & EYES)
safe_thing = victim.head
if(victim.glasses)
if (!safe_thing && (victim.glasses.body_parts_covered & EYES))
safe_thing = victim.glasses
if(safe_thing)
trans = reagents.trans_to_obj(safe_thing, amount_per_transfer_from_this)
user.visible_message(SPAN_WARNING("[user] tries to squirt something into [target]'s eyes, but fails!"), SPAN_WARNING("You try to squirt something into [target]'s eyes, but fail!"))
return
var/mob/living/M = target
var/contained = reagentlist()
trans = reagents.trans_to_mob(target, amount_per_transfer_from_this, CHEM_BLOOD)
admin_inject_log(user, M, src, contained, reagents.get_temperature(), trans)
user.visible_message(SPAN_WARNING("[user] squirts something into [target]'s eyes!"), SPAN_NOTICE("You transfer [trans] units of the solution. [reagents.total_volume] units remaining in \the [src]."))
return
else
trans = reagents.trans_to(target, amount_per_transfer_from_this) //sprinkling reagents on generic non-mobs
to_chat(user, SPAN_NOTICE("You transfer [trans] units of the solution."))
else // Taking from something
if(!target.is_open_container() && !istype(target,/obj/structure/reagent_dispensers))
to_chat(user, SPAN_NOTICE("You cannot directly remove reagents from [target]."))
return
if(!target.reagents || !target.reagents.total_volume)
to_chat(user, SPAN_NOTICE("[target] is empty."))
return
var/trans = target.reagents.trans_to_obj(src, amount_per_transfer_from_this)
to_chat(user, SPAN_NOTICE("You fill \the [src] with [trans] units of the solution."))
/obj/item/reagent_containers/dropper/attack_self(mob/user)
set_APTFT()
/obj/item/reagent_containers/dropper/AltClick(mob/user)
set_APTFT()
/obj/item/reagent_containers/dropper/on_reagent_change()
update_icon()
/obj/item/reagent_containers/dropper/update_icon()
ClearOverlays()
if(reagents.total_volume)
worn_overlay = "filling"
AddOverlays(overlay_image(icon, "dropper-[get_filling_state()]", color = reagents.get_color()))
worn_overlay_color = reagents.get_color() // handles inhands
else
worn_overlay = null
update_held_icon()
/obj/item/reagent_containers/dropper/electronic_pipette
name = "electronic pipette"
desc = "A laboratory standard electronic pipette, designed for a finer and more precise transfer rate of substances with a volume of 5 units."
icon_state = "electronic_pipette"
item_state = "electronic_pipette"
amount_per_transfer_from_this = 5
possible_transfer_amounts = list(0.1, 0.2, 0.5, 1, 2, 3, 4, 5)
/obj/item/reagent_containers/dropper/cyborg_pipette
name = "cyborg pipette"
desc = "A cyborg pipette which contains a larger internal volume of 10 units, while still capable of having finer transfer rates if required."
icon_state = "cyborg_pipette"
item_state = "cyborg_pipette"
amount_per_transfer_from_this = 10
possible_transfer_amounts = list(0.1, 0.2, 0.5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
volume = 10
////////////////////////////////////////////////////////////////////////////////
/// Droppers. END
////////////////////////////////////////////////////////////////////////////////