Skip to content

Commit

Permalink
Suit autodocs now check storage contents before injecting. Health ana…
Browse files Browse the repository at this point in the history
…lyzer now properly makes overdosed reagents in stomach red. (#227)

* Update suit_autodoc.dm

* Update scanners.dm
  • Loading branch information
Helg2 authored Sep 6, 2024
1 parent 6ddd3e1 commit 2c27fb2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions code/datums/components/suit_autodoc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,14 @@

for(var/chem in chems)
var/datum/reagent/R = chem
var/stomach_reagents = 0
var/datum/internal_organ/stomach/belly = H.get_organ_slot(ORGAN_SLOT_STOMACH)
if(belly)
stomach_reagents = belly.reagents.get_reagent_amount(R)
var/amount_to_administer = clamp(\
initial(R.overdose_threshold) - H.reagents.get_reagent_amount(R),\
0,\
initial(R.overdose_threshold) * overdose_threshold_mod)
initial(R.overdose_threshold) - (H.reagents.get_reagent_amount(R) + stomach_reagents),\
0,\
initial(R.overdose_threshold) * overdose_threshold_mod)
if(amount_to_administer)
H.reagents.add_reagent(R, amount_to_administer)
drugs += " [initial(R.name)]: [amount_to_administer]U"
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/items/scanners.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ REAGENT SCANNER
stomach_chemicals_lists["[reagent.name]"] = list(
"name" = reagent.name,
"amount" = round(reagent.volume, 0.1),
"od" = reagent_overdosed
"od" = reagent_overdosed,
"dangerous" = reagent_overdosed || istype(reagent, /datum/reagent/toxin)
)
data["stomach_chemicals_lists"] = stomach_chemicals_lists

Expand Down

0 comments on commit 2c27fb2

Please sign in to comment.