Trace Chemicals and Mass Spectrometers (#11993)

This commit is contained in:
Geeves
2021-07-22 12:35:44 +02:00
committed by GitHub
parent 2fb1148c71
commit 720af36667
8 changed files with 84 additions and 24 deletions
@@ -14,6 +14,7 @@
var/overdose = 0 // Volume of a chemical required in the blood to meet overdose criteria.
var/od_minimum_dose = 5 // Metabolised dose of a chemical required to meet overdose criteria.
var/scannable = 0 // Shows up on health analyzers.
var/spectro_hidden = FALSE // doesn't show up on basic mass spectrometers, only shows on the advanced variant
var/affects_dead = 0
var/glass_icon_state = null
var/glass_name = null
@@ -43,6 +44,12 @@
/decl/reagent/proc/remove_self(var/amount, var/datum/reagents/holder) // Shortcut
holder.remove_reagent(type, amount) // Don't typecheck this, fix anywhere this is called with a null holder.
if(ishuman(holder.my_atom))
var/mob/living/carbon/human/H = holder.my_atom
if(H.vessel.reagent_data[/decl/reagent/blood]["trace_chem"][type])
H.vessel.reagent_data[/decl/reagent/blood]["trace_chem"][type] += amount
else
H.vessel.reagent_data[/decl/reagent/blood]["trace_chem"][type] = amount
// This doesn't apply to skin contact - this is for, e.g. extinguishers and sprays. The difference is that reagent is not directly on the mob's skin - it might just be on their clothing.
/decl/reagent/proc/touch_mob(var/mob/living/M, var/amount, var/datum/reagents/holder)
@@ -12,13 +12,27 @@
fallback_specific_heat = 3.617
/decl/reagent/blood/initialize_data(newdata, datum/reagents/holder)
. = ..()
if(.)
LAZYINITLIST(.["trace_chem"])
/decl/reagent/blood/proc/handle_trace_chems(var/datum/reagents/holder)
var/list/trace_chems = holder.reagent_data[type]["trace_chem"]
for(var/chem in trace_chems)
var/decl/reagent/R = decls_repository.get_decl(chem)
trace_chems[chem] = trace_chems[chem] - (R.metabolism / 10) // work your way out of the body but at 10th the speed
if(trace_chems[chem] < 0)
trace_chems -= chem
holder.reagent_data[type]["trace_chem"] = trace_chems
/decl/reagent/blood/mix_data(var/list/newdata, var/newamount, var/datum/reagents/holder)
var/list/data = ..()
if(LAZYACCESS(newdata, "trace_chem"))
var/list/other_chems = LAZYACCESS(newdata, "trace_chem")
if(!data)
data = newdata.Copy()
else if(!data["trace_chem"])
else if(!length(data["trace_chem"]))
data["trace_chem"] = other_chems.Copy()
else
var/list/my_chems = data["trace_chem"]
@@ -254,6 +254,7 @@
description = "A strong neurotoxin that puts the subject into a death-like state."
reagent_state = SOLID
color = "#669900"
spectro_hidden = TRUE
metabolism = REM
strength = 3
taste_description = "death"
@@ -769,6 +770,7 @@
description = "A complicated to make and highly illegal drug that cause paralysis mostly focused on the limbs."
reagent_state = LIQUID
color = "#002067"
spectro_hidden = TRUE
metabolism = REM * 0.2
strength = 0
taste_description = "danger"