Skip to content

Commit

Permalink
Dosage Estimator (vlggms#2222)
Browse files Browse the repository at this point in the history
A tool for measuring how long the dosage of a substance will last in the human body.
The margin of error between the calculated time and the actual time it took to metabolize the reagent is mostly unnoticable.

Formula:
(volume / metabolization_rate) * 2 = seconds
(seconds/2) * metabolization_rate = volume

add: dosage_estimator tool
  • Loading branch information
InsightfulParasite authored Jun 20, 2024
1 parent 2429153 commit 5da7980
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
33 changes: 33 additions & 0 deletions ModularTegustation/tegu_items/gadgets/unpowered.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,39 @@
else
walk_to(SA, 0)

//Dosage Estimator
/obj/item/dosage_est
name = "Dosage Estimator"
desc = "A modified reagent scanner that estimates how long a reagent will last in a regular human body. \
Its uncommon to see one of these outside of well funded laboratory. Use this on a container."
icon = 'ModularTegustation/Teguicons/teguitems.dmi'
icon_state = "gadget3"

/obj/item/dosage_est/afterattack(atom/target, mob/user, proximity_flag)
. = ..()
if(istype(target, /obj/item/reagent_containers))
var/obj/item/reagent_containers/C = target
var/datum/reagents/reagent_container = C.reagents
var/list/chemical_list = reagent_container.reagent_list
var/datum/reagent/gloop
if(chemical_list.len)
var/render_list = "Chemicals Detected:"
for(var/r in chemical_list)
gloop = r
/*
* These calculations are sort of correct. In testing
* the time tended to be 1-2 seconds less than predicted.
* Inverting this equation would be
* volume = (seconds/2) * metabolization_rate
* -IP
*/
var/reagent_vol = round(gloop.volume, 0.001)
var/reagent_cycle = reagent_vol / gloop.metabolization_rate
render_list += "<br>[reagent_vol] units of [gloop.name] will metabolize [reagent_cycle] cycles for a total of [reagent_cycle*2] seconds."
to_chat(user, render_list)
else
to_chat(user, span_notice("No reagents detected."))

//abnos spawn slower, for maps that suck lol
/obj/item/lc13_abnospawn
name = "Lobotomy Corporation Radio"
Expand Down
4 changes: 3 additions & 1 deletion code/modules/clothing/outfits/standard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,9 @@
/obj/item/gun/magic/wand/death/debug=1,\
/obj/item/debug/human_spawner=1,\
/obj/item/debug/omnitool=1,\
/obj/item/storage/box/stabilized=1
/obj/item/storage/box/stabilized=1,\
/obj/item/dosage_est=1,\
/obj/item/storage/box/lc_debugtools=1\
)

/datum/outfit/admin/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
Expand Down

0 comments on commit 5da7980

Please sign in to comment.