Skip to content

Instantly share code, notes, and snippets.

@optimumtact
Created April 10, 2018 02:50
Show Gist options
  • Save optimumtact/1cafc750be67f526696ac277f7a9a0ed to your computer and use it in GitHub Desktop.
Save optimumtact/1cafc750be67f526696ac277f7a9a0ed to your computer and use it in GitHub Desktop.
//Get a list of toxin datum types
var/list/toxin_types = typesof(/datum/reagent/toxin)
//Filter the list of reagents in the mob reagent holder by the toxin types
var/list/toxin_reagents = typecache_filter_list(C.reagents.reagent_list, toxin_types)
//for each present reagent toxin, calculate a total
for(/datum/reagent/toxin/some_tox in toxin_reagents)
tox_amount = some_tox.volume
//if the amount is below our tolerance and non zero
if(tox_amount <= toxTolerance && tox_amount > 0)
//for each present tox reagent
for(/datum/reagent/toxin/some_tox in toxin_reagents)
//remove 1u vol of each toxin
C.reagents.remove_reagent(some_tox.id, 1)
else if(toxamount > toxtolerance)
.. do some shit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment