Semi-automatically generated modding documentation for Barotrauma

Conditionals

Conditionals are used by some in-game mechanics to require one or more conditions to be met for those mechanics to be active. For example, some StatusEffects use Conditionals to only trigger if the affected character is alive.

Classes that use Conditionals: AttackShared, ConditionalSpriteShared, StatusEffectShared, CheckConditionalActionShared, CheckItemActionShared, ItemComponentShared, AbilityConditionCharacterShared, DecorativeSpriteClient, LightSourceClient

Attributes

Attribute name Description
Property or affliction identifier Depending on what’s available, check against either one of the target object’s properties or the strength of an affliction.

The target object’s available properties depend on how that object is defined in the source code.

This is not applicable if the element contains the attribute SkillRequirement="true".
Skill identifier Check against the target character’s skill with the same name as the attribute.

This is only applicable if the element contains the attribute SkillRequirement="true".
Name Check against the name of the target.
SpeciesName Check against the species identifier of the target. Only works on characters.
SpeciesGroup Check against the species group of the target. Only works on characters.
HasTag Check against the target’s tags. Only works on items.

Several tags can be checked against by using a comma-separated list.
HasStatusTag Check against the tags of the target’s active status effects.

Several tags can be checked against by using a comma-separated list.
HasSpecifierTag Check against the target’s specifier tags. In the vanilla game, these are the head index and gender. See human.xml for more details.

Several tags can be checked against by using a comma-separated list.
EntityType Check against the target’s entity type.

The currently supported values are “character”, “limb”, “item”, “structure” and “null”.
LimbType Check against the target’s limb type. See Barotrauma.LimbType.
TargetItemComponent If set to the name of one of the target’s ItemComponents, the conditionals defined by this element check against the properties of that component. Only works on items.
TargetContainer If set to true, the conditionals defined by this element check against the entity containing the target.
TargetSelf If set to true, the conditionals defined by this element check against the attacking character instead of the attacked character
TargetGrandParent If this and TargetContainer are set to true, the conditionals defined by this element check against the entity containing the target’s container.
TargetContainedItem If set to true, the conditionals defined by this element check against the items contained by the target. Only works with items.

Comparison operators

There are several ways to compare properties to values. The comparison operator to use can be specified by placing one of the following before the value to compare against.

Operator Description
“e”, “eq”, “equals” Require that the property being checked equals the given value.

This is the default operator used if none is specified.
“ne”, “neq”, “notequals”, “!”, “!e”, “!eq”, “!equals” Require that the property being checked doesn’t equal the given value.
“lt”, “lessthan” Require that the property being checked is less than the given value.

This can only be used to compare with numeric object properties, affliction strengths and skill levels.
“lte”, “lteq”, “lessthanequals” Require that the property being checked is less than or equal to the given value.

This can only be used to compare with numeric object properties, affliction strengths and skill levels.
“gt”, “greaterthan” Require that the property being checked is greater than the given value.

This can only be used to compare with numeric object properties, affliction strengths and skill levels.
“gte”, “gteq”, “greaterthanequals” Require that the property being checked is greater than or equal to the given value.

This can only be used to compare with numeric object properties, affliction strengths and skill levels.