Files
GhomandGitHub 6eb2d1674a Implementing materials checks for techweb designs. (#96257)
## About The Pull Request
In similar fashion to what was done with crafting recipes last year,
this year it's time for techweb designs and printed items to be audited.
This is mostly just about consistency, we've a lot of items that can be
printed by protolathes, autolathes, circuit printers and techfab etc.
However they almost all (except most stacks, mainly) have custom
materials that do not match in one way or another with the materials
used by the design, which is what this PR is for.

"But items printed from lathes etc. already get the mats used to make
them." Yes, they do, however that isn't the case for items of the same
type that were spawned in some other way (cargo shuttle, space/maints
loot, mapped, admins), this create a subtle discrepancy. It isn't a huge
deal (in spite of the size of this PR, ton of designs), but given that I
have done something similar with crafting recipes before, I may as well
give it a second arc of some sort and bring things to completion. And
fix a few possible oversights.

TL;DR consistency and stuff

## Why It's Good For The Game
Consistency, unit test checks to make it harder not to be consistent in
the future. Still has a few TODOs like:

- [x] Fixed newly printed, fully charged RCDs costing less than the RCD
cartridges required to fully charge one. EDIT: I had to tweak the newly
added RDD as well because it suffered from the same fundamental issue.
- [x] Fixed plates being made of iron and yet shattering like ceramic
ones. A new subtype for metallic ones has been made.

## Changelog

🆑
refactor: Refactored a few things with techweb designs (the ones for
autolathes, protolathes, circuit printers, mechfabs etc.) to make sure
that the materials of items that can be made from these designs more
closely match the materials used to make them.
fix: Lizard fries no longer need a plate to be made, like all other
treats that used to require plates in a distant past.
balance: Tweaked the materials cost of RCD, RDD and RCD cartridges.
image: Oven trays now have a more metallic hue.
balance: Plates printed printed from lathes won't shatter like ceramic
ones, in virtue of them being made out of iron instead.
/🆑
2026-07-06 00:13:02 -07:00

96 lines
5.6 KiB
Plaintext

///Pricks people with a big needle and gives the user a bunch of info about bloodtype, tox damage, other such stuff. if you fuck up it stabs the guy a bit.
/obj/item/blood_scanner
name = "hemoanalytic scanner"
icon = 'icons/obj/devices/scanner.dmi'
icon_state = "bloodscanner"
inhand_icon_state = "healthanalyzer"
worn_icon_state = "healthanalyzer"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
desc = "This Me-Lo Tech branded medical device can detect abnormalities in blood flow or composition. There is a button on the side which scans the patient's blood for common medicines."
obj_flags = CONDUCTS_ELECTRICITY
item_flags = NOBLUDGEON
slot_flags = ITEM_SLOT_BELT
throwforce = 3
w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 7
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 2, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.5)
/obj/item/blood_scanner/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
if(!usable_check(person_scanning = user, scanee = interacting_with))
return NONE
var/mob/living/carbon/poked_guy = interacting_with
var/obj/item/bodypart/poked_bit = poked_guy.get_bodypart(check_zone(user.zone_selected))
if(!poked_bit)
return
user.visible_message(span_notice("[user] pricks [poked_guy] with [src]."), span_notice("You begin scanning [poked_guy] with [src]."), ignored_mobs = poked_guy)
to_chat(poked_guy, span_notice("[user] slides the needle of [src] into your [poked_bit] and begins pressing buttons."))
var/success = do_after(user, 2 SECONDS, poked_guy)
if(success)
scan_blood(scanner = user, scanned_person = poked_guy)
else
if(prob(25))
regret(stabber = user, stabbed = poked_guy, to_stab = poked_bit)
return
return ITEM_INTERACT_SUCCESS
/obj/item/blood_scanner/interact_with_atom_secondary(atom/interacting_with, mob/living/user, list/modifiers)
if(!usable_check(person_scanning = user, scanee = interacting_with))
return NONE
var/mob/living/carbon/poked_guy = interacting_with
var/obj/item/bodypart/poked_bit = poked_guy.get_bodypart(check_zone(user.zone_selected))
user.visible_message(span_notice("[user] pricks [poked_guy] with [src]."), span_notice("You begin scanning [poked_guy] with [src]."), ignored_mobs = poked_guy)
to_chat(poked_guy, span_notice("[user] slides the needle of [src] into your [poked_bit] and begins pressing buttons."))
var/success = do_after(user, 2 SECONDS, poked_guy)
if(success)
chemscan(user, poked_guy, reagent_types_to_check = /datum/reagent/medicine)
else
if(prob(25))
regret(stabber = user, stabbed = poked_guy, to_stab = poked_bit)
return
return ITEM_INTERACT_SUCCESS
/obj/item/blood_scanner/proc/scan_blood(mob/living/scanner, mob/living/carbon/scanned_person)
var/render_list = list()
var/oxy_loss = scanned_person.get_oxy_loss()
var/tox_loss = scanned_person.get_tox_loss()
render_list += span_info("You read the [src]'s screen:\n")
render_list += "<span class='notice ml-1'>Blood Type: [scanned_person?.dna?.blood_type]</span>\n"
if(oxy_loss > 50)//if they have knockout levels of suffocation damage
render_list += "<span class='danger ml-1'>Warning: Hypoxic blood oxygen levels.</span>\n"
if(scanned_person.get_blood_volume(apply_modifiers = TRUE) <= BLOOD_VOLUME_SAFE)
render_list += "<span class='danger ml-1'>Warning: Dangerously low blood flow.</span>\n"
if(tox_loss > 10)
render_list += "<span class='danger ml-1'>Warning: Toxic buildup detected in bloodstream.</span>\n"
if(scanned_person.has_status_effect(/datum/status_effect/eigenstasium))
render_list += "<span class='danger ml-1'>Warning: Dimensional instability detected. Administer stabilizers.</span>\n"
if(scanned_person.has_reagent(/datum/reagent/gold/cursed) || scanned_person.has_status_effect(/datum/status_effect/midas_blight))
render_list += "<span class='danger ml-1'>Warning: Hemo-aurificating hexes present.</span>\n" //can it detect normal things? barely. But ancient greed-cursed magicks? Spot on.
if(HAS_TRAIT_FROM(scanned_person, TRAIT_NODEATH, /datum/reagent/inverse/penthrite))
render_list += "<span class='danger ml-1'>Warning: Frankensteinian revivification in progress.</span>\n" //patient is currently an immortal drug-zombie
if(scanned_person.has_status_effect(/datum/status_effect/high_blood_pressure))
render_list += "<span class='danger ml-1'>Warning: Dangerously high blood pressure.</span>\n"
if(HAS_TRAIT(scanned_person, TRAIT_IMMUNODEFICIENCY))
render_list += "<span class='danger ml-1'>Warning: Low immune cell concentration.</span>\n" //it doe
to_chat(scanner, boxed_message(jointext(render_list, "")), type = MESSAGE_TYPE_INFO)
/obj/item/blood_scanner/proc/regret(mob/living/stabber, mob/living/stabbed, obj/item/bodypart/to_stab)
to_stab?.force_wound_upwards(/datum/wound/pierce/bleed/moderate/needle_fail, wound_source = "idiot moved with a needle in them")
stabber.visible_message(span_warning("[src]'s needle is ripped out, tearing a hole in [stabbed]'s [to_stab]!"), span_warning("Damnit! The needle is torn out, making a tiny hole in [stabbed.p_their()] [to_stab]."), ignored_mobs = stabbed)
to_chat(stabbed, span_userdanger("<b>OWWW!</b> The needle of [src] is ripped out, tearing a small hole in your [to_stab]!"))
/obj/item/blood_scanner/proc/usable_check(mob/living/person_scanning, atom/scanee)
if(!isliving(scanee))
return FALSE
if(!istype(scanee, /mob/living/carbon))
to_chat(person_scanning, span_warning("[src] is incompatible."))
return FALSE
if(!person_scanning.can_read(src) || person_scanning.is_blind())
to_chat(person_scanning, span_warning("You are unable to read [src]'s screen!"))
return FALSE
return TRUE