/tg/ Station 13 - Modules - TypesVar Details - Proc Details

reagents

////////////////////////////Main reagents code///////////////////////////////////////////// Holder for a bunch of /datum/reagent

Vars

chem_tempCurrent temp of the holder volume
failed_but_capable_reactionsIf a reaction fails due to temperature or pH, this tracks the required temperature or pH for it to be enabled.
flagsvarious flags, see code__DEFINES\reagents.dm
is_reactingHard check to see if the reagents is presently reacting
maximum_volumeMax volume of this holder
my_atomThe atom this holder is attached to
phpH of the whole system
previous_reagent_listcached list of reagents typepaths (not object references), this is a lazylist for optimisation
reaction_listlist of reactions currently on going, this is a lazylist for optimisation
reagent_listThe reagents being held
total_volumeCurrent volume of all the reagents
ui_beaker_syncIf we're syncing with the beaker - so return reactions that are actively happening
ui_reaction_idUI lookup stuff Keeps the id of the reaction displayed in the ui
ui_reaction_indexWhat index we're at if we have multiple reactions for a reagent product
ui_reagent_idKeeps the id of the reagent displayed in the ui
ui_tags_selectedThe bitflag of the currently selected tags in the ui

Procs

add_reagentAdds a reagent to this holder
add_reagent_listLike add_reagent but you can enter a list. Arguments
adjust_thermal_energy
clear_reagentsRemoves all reagents
convert_reagentTurn one reagent into another, preserving volume, temp, purity, ph Arguments
copy_dataShallow copies (deep copy of viruses) data from the provided reagent into our copy of that reagent Arguments current_reagent - the reagent(not typepath) to copy data from
copy_toCopies the reagents to the target object Arguments
del_reagentRemoves an specific reagent from this holder Arguments
determine_reaction_thermicsReturns a string descriptor of a reactions themic_constant
end_metabolizationSignals that metabolization has stopped, triggering the end of trait-based effects Arguments
exposeApplies the relevant expose_ proc for every reagent in this holder
expose_temperatureApplies heat to this holder Arguments
generate_taste_messageReturns what this holder's reagents taste like
generate_thermodynamic_profileGenerates a (rough) rate vs temperature graph profile
get_average_purityGet the average purity of all reagents (or all subtypes of provided typepath) Arguments
get_external_reagent_log_stringOutputs a log-friendly list of reagents based on an external reagent list.
get_master_reagentGet a reference to the reagent there is the most of in this holder
get_reagent_amountGet the amount of this reagent or the sum of all its subtypes if specified Arguments
get_reagent_log_stringOutputs a log-friendly list of reagents based on the internal reagent_list.
get_reagent_purityGet the purity of this reagent Arguments
handle_reactionsHandle any reactions possible in this holder Also UPDATES the reaction list High potential for infinite loopsa if you're editing this.
handle_stasis_chemsProcesses any chems that have the REAGENT_IGNORE_STASIS bitflag ONLY Arguments
has_changed_stateChecks to see if the reagents has a difference in reagents_list and previous_reagent_list (I.e. if there's a difference between the previous call and the last) Also checks to see if the saved reactions in failed_but_capable_reactions can start as a result of temp/pH change
has_reagentReturns a reagent from this holder if it matches all the specified arguments Arguments
heat_capacityReturns the total heat capacity for all of the reagents currently in this holder.
holder_fullIs this holder full or not
instant_reactOld reaction mechanics, edited to work on one only This is changed from the old - purity of the reagents will affect yield
metabolizeTriggers metabolizing for all the reagents in this holder
multiply_reagentsMultiplies the reagents inside this holder by a specific amount Arguments
process_mob_reagent_purityProcesses the reagents in the holder and converts them, only called in a mob/living/carbon on addition
remove_allRemoves all reagents either proportionally(amount is the direct volume to remove) when proportional the total volume of all reagents removed will equal to amount or relatively(amount is a percentile between 0->1) when relative amount is the % of each reagent to be removed
remove_reagentRemoves a specific reagent. can supress reactions if needed Arguments
set_all_reagents_purityDirectly set the purity of all contained reagents to a new value Arguments
set_temperature
trans_toTransfer some stuff from this holder to a target object
update_totalUpdates /datum/reagents/var/total_volume

Var Details

chem_temp

Current temp of the holder volume

failed_but_capable_reactions

If a reaction fails due to temperature or pH, this tracks the required temperature or pH for it to be enabled.

flags

various flags, see code__DEFINES\reagents.dm

is_reacting

Hard check to see if the reagents is presently reacting

maximum_volume

Max volume of this holder

my_atom

The atom this holder is attached to

ph

pH of the whole system

previous_reagent_list

cached list of reagents typepaths (not object references), this is a lazylist for optimisation

reaction_list

list of reactions currently on going, this is a lazylist for optimisation

reagent_list

The reagents being held

total_volume

Current volume of all the reagents

ui_beaker_sync

If we're syncing with the beaker - so return reactions that are actively happening

ui_reaction_id

UI lookup stuff Keeps the id of the reaction displayed in the ui

ui_reaction_index

What index we're at if we have multiple reactions for a reagent product

ui_reagent_id

Keeps the id of the reagent displayed in the ui

ui_tags_selected

The bitflag of the currently selected tags in the ui

Proc Details

add_reagent

Adds a reagent to this holder

Arguments:

add_reagent_list

Like add_reagent but you can enter a list. Arguments

adjust_thermal_energy

clear_reagents

Removes all reagents

convert_reagent

Turn one reagent into another, preserving volume, temp, purity, ph Arguments

copy_data

Shallow copies (deep copy of viruses) data from the provided reagent into our copy of that reagent Arguments current_reagent - the reagent(not typepath) to copy data from

copy_to

Copies the reagents to the target object Arguments

del_reagent

Removes an specific reagent from this holder Arguments

determine_reaction_thermics

Returns a string descriptor of a reactions themic_constant

end_metabolization

Signals that metabolization has stopped, triggering the end of trait-based effects Arguments

expose

Applies the relevant expose_ proc for every reagent in this holder

Arguments

expose_temperature

Applies heat to this holder Arguments

generate_taste_message

Returns what this holder's reagents taste like

Arguments:

generate_thermodynamic_profile

Generates a (rough) rate vs temperature graph profile

get_average_purity

Get the average purity of all reagents (or all subtypes of provided typepath) Arguments

get_external_reagent_log_string

Outputs a log-friendly list of reagents based on an external reagent list.

Arguments:

get_master_reagent

Get a reference to the reagent there is the most of in this holder

get_reagent_amount

Get the amount of this reagent or the sum of all its subtypes if specified Arguments

get_reagent_log_string

Outputs a log-friendly list of reagents based on the internal reagent_list.

get_reagent_purity

Get the purity of this reagent Arguments

handle_reactions

Handle any reactions possible in this holder Also UPDATES the reaction list High potential for infinite loopsa if you're editing this.

handle_stasis_chems

Processes any chems that have the REAGENT_IGNORE_STASIS bitflag ONLY Arguments

has_changed_state

Checks to see if the reagents has a difference in reagents_list and previous_reagent_list (I.e. if there's a difference between the previous call and the last) Also checks to see if the saved reactions in failed_but_capable_reactions can start as a result of temp/pH change

has_reagent

Returns a reagent from this holder if it matches all the specified arguments Arguments

heat_capacity

Returns the total heat capacity for all of the reagents currently in this holder.

holder_full

Is this holder full or not

instant_react

Old reaction mechanics, edited to work on one only This is changed from the old - purity of the reagents will affect yield

Arguments

metabolize

Triggers metabolizing for all the reagents in this holder

Arguments:

multiply_reagents

Multiplies the reagents inside this holder by a specific amount Arguments

process_mob_reagent_purity

Processes the reagents in the holder and converts them, only called in a mob/living/carbon on addition

Arguments:

remove_all

Removes all reagents either proportionally(amount is the direct volume to remove) when proportional the total volume of all reagents removed will equal to amount or relatively(amount is a percentile between 0->1) when relative amount is the % of each reagent to be removed

Arguments

remove_reagent

Removes a specific reagent. can supress reactions if needed Arguments

set_all_reagents_purity

Directly set the purity of all contained reagents to a new value Arguments

set_temperature

trans_to

Transfer some stuff from this holder to a target object

Arguments:

update_total

Updates /datum/reagents/var/total_volume