Skip to content

Consumables Groups

Vadim Gromov edited this page Jan 9, 2021 · 8 revisions

Consumables groups are used to aggregate certain types of consumable inventory items. For example, some particular kind of food can have the same effect as the antibiotic pill when consumed -- so this food item type and antibiotic pills can be grouped to form the Antibiotic consumables group. Or maybe game just have two different vendors of aspirin that produce basically the same thing but in two different forms :)

Where are they used?

These groups are used in a disease treatment, so, for example, any food from the Antibiotics group consumed will be treated by the disease treatment node just like the antibiotic pill.
Also, Medical Agents are using consumables groups to track the active substances in the blood.

Where to look?

Consumables groups are described in a MedicalConsumablesGroup class.
MedicalConsumablesGroup constructor receives a list of inventory items names that should be grouped in this manner. One item can be a part of any number of groups, and disease treatment will handle this case correctly, but GetRelevantMedicalGroup method will return in this case only the first group it finds.

This class has a number of methods to help with finding groups and performing checks:

Static GetRelevantMedicalGroup method will check if the given consumable inventory item belongs to any group, and return this group. It will return null otherwise.
IsApplicableToGroup will check if a given inventory item belongs to this consumable group and return boolean.

You can also merge two group together using the + operator, like
var newGroup = MedicalConsumablesGroup.SedativeGroup + MedicalConsumablesGroup.AspirinGroup;

By default, Zara has these consumables groups:

EpinephrineGroup
AntiVenomGroup
AtropineGroup
MorphineGroup
DoripenemGroup
AntibioticGroup
AspirinGroup
AcetaminophenGroup
LoperamideGroup
OseltamivirGroup
SedativeGroup

There is also similar MedicalAppliancesGroup class that is used for injury treatment. It combines in a similar way items that can be applied to the wound.

Clone this wiki locally