Barotrauma Server
|
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. More...
Public Types | |
enum | ConditionType { PropertyValueOrAffliction , SkillRequirement , Name , SpeciesName , SpeciesGroup , HasTag , HasStatusTag , HasSpecifierTag , EntityType , LimbType , WorldHostility } |
Category of properties to check against. More... | |
enum | LogicalOperatorType { And , Or } |
enum | ComparisonOperatorType { None , Equals , NotEquals , LessThan , LessThanEquals , GreaterThan , GreaterThanEquals } |
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. More... | |
Public Member Functions | |
bool | Matches (ISerializableEntity? target) |
bool | TargetTagMatchesTagCondition (Identifier targetTag) |
Static Public Member Functions | |
static IEnumerable< PropertyConditional > | FromXElement (ContentXElement element, Predicate< XAttribute >? predicate=null) |
static ComparisonOperatorType string ConditionStr | ExtractComparisonOperatorFromConditionString (string str) |
static ComparisonOperatorType | GetComparisonOperatorType (string op) |
static bool | CompareFloat (float val1, float val2, ComparisonOperatorType op) |
static bool | Compare< T > (T leftValue, T rightValue, ComparisonOperatorType comparisonOperator) |
Public Attributes | |
readonly ConditionType | Type |
readonly ComparisonOperatorType | ComparisonOperator |
readonly Identifier | AttributeName |
readonly string | AttributeValue |
readonly ImmutableArray< Identifier > | AttributeValueAsTags |
readonly? float | FloatValue |
readonly string | 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. | |
readonly bool | TargetSelf |
If set to true, the conditionals defined by this element check against the attacking character instead of the attacked character. Only applies to a character's attacks and targeting parameters. | |
readonly bool | TargetContainer |
If set to true, the conditionals defined by this element check against the entity containing the target. | |
readonly bool | TargetGrandParent |
If this and TargetContainer are set to true, the conditionals defined by this element check against the entity containing the target's container. For example, diving suits have a status effect that targets contained oxygen tanks, with a conditional that only passes if the locker containing the suit is powered. | |
readonly bool | TargetContainedItem |
If set to true, the conditionals defined by this element check against the items contained by the target. Only works with items. | |
Static Public Attributes | |
static ComparisonOperatorType | ComparisonOperator |
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.
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.
Category of properties to check against.
Enumerator | |
---|---|
PropertyValueOrAffliction | If there exists an affliction with an identifier that matches the given key, check against the strength of that affliction. Otherwise, check against the value of one of the target's properties. 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 <AutoDocEntryName value="Property or affliction identifier" > <Conditional WatchersGaze="gt 0" > <Conditional IsDead="true" > |
SkillRequirement | Check against the target character's skill with the same name as the attribute. This is only applicable if the element contains the attribute <AutoDocEntryName value="Skill identifier" > <Conditional SkillRequirement="true" weapons="lt 50" > |
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. |
WorldHostility | Check against the current World Hostility setting (previously known as "Difficulty"). |
|
static |
T | : | IComparable |
|
static |
|
static |
|
static |
|
static |
bool Barotrauma.PropertyConditional.Matches | ( | ISerializableEntity? | target | ) |
bool Barotrauma.PropertyConditional.TargetTagMatchesTagCondition | ( | Identifier | targetTag | ) |
readonly Identifier Barotrauma.PropertyConditional.AttributeName |
readonly string Barotrauma.PropertyConditional.AttributeValue |
readonly ImmutableArray<Identifier> Barotrauma.PropertyConditional.AttributeValueAsTags |
readonly ComparisonOperatorType Barotrauma.PropertyConditional.ComparisonOperator |
|
static |
readonly? float Barotrauma.PropertyConditional.FloatValue |
readonly bool Barotrauma.PropertyConditional.TargetContainedItem |
If set to true, the conditionals defined by this element check against the items contained by the target. Only works with items.
readonly bool Barotrauma.PropertyConditional.TargetContainer |
If set to true, the conditionals defined by this element check against the entity containing the target.
readonly bool Barotrauma.PropertyConditional.TargetGrandParent |
If this and TargetContainer are set to true, the conditionals defined by this element check against the entity containing the target's container. For example, diving suits have a status effect that targets contained oxygen tanks, with a conditional that only passes if the locker containing the suit is powered.
readonly string Barotrauma.PropertyConditional.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.
readonly bool Barotrauma.PropertyConditional.TargetSelf |
If set to true, the conditionals defined by this element check against the attacking character instead of the attacked character. Only applies to a character's attacks and targeting parameters.
readonly ConditionType Barotrauma.PropertyConditional.Type |