Barotrauma Client Doc
|
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 class | ConditionType { PropertyValueOrAffliction , SkillRequirement , Name , SpeciesName , SpeciesGroup , HasTag , HasStatusTag , HasSpecifierTag , EntityType , LimbType } |
Category of properties to check against More... | |
enum class | LogicalOperatorType { And , Or } |
enum class | 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 | GetComparisonOperatorType (string op) |
static bool | CompareFloat (float val1, float val2, ComparisonOperatorType op) |
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. More... | |
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. More... | |
readonly bool | TargetContainer |
If set to true, the conditionals defined by this element check against the entity containing the target. More... | |
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. More... | |
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. More... | |
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.
Definition at line 18 of file PropertyConditional.cs.
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.
Definition at line 115 of file PropertyConditional.cs.
|
strong |
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. |
Definition at line 25 of file PropertyConditional.cs.
Enumerator | |
---|---|
And | |
Or |
Definition at line 105 of file PropertyConditional.cs.
|
static |
Definition at line 606 of file PropertyConditional.cs.
|
static |
Definition at line 199 of file PropertyConditional.cs.
|
static |
Definition at line 307 of file PropertyConditional.cs.
bool Barotrauma.PropertyConditional.Matches | ( | ISerializableEntity? | target | ) |
Definition at line 345 of file PropertyConditional.cs.
bool Barotrauma.PropertyConditional.TargetTagMatchesTagCondition | ( | Identifier | targetTag | ) |
Definition at line 529 of file PropertyConditional.cs.
readonly Identifier Barotrauma.PropertyConditional.AttributeName |
Definition at line 166 of file PropertyConditional.cs.
readonly string Barotrauma.PropertyConditional.AttributeValue |
Definition at line 167 of file PropertyConditional.cs.
readonly ImmutableArray<Identifier> Barotrauma.PropertyConditional.AttributeValueAsTags |
Definition at line 168 of file PropertyConditional.cs.
readonly ComparisonOperatorType Barotrauma.PropertyConditional.ComparisonOperator |
Definition at line 165 of file PropertyConditional.cs.
|
static |
Definition at line 292 of file PropertyConditional.cs.
readonly? float Barotrauma.PropertyConditional.FloatValue |
Definition at line 169 of file PropertyConditional.cs.
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.
Definition at line 197 of file PropertyConditional.cs.
readonly bool Barotrauma.PropertyConditional.TargetContainer |
If set to true, the conditionals defined by this element check against the entity containing the target.
Definition at line 186 of file PropertyConditional.cs.
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.
Definition at line 192 of file PropertyConditional.cs.
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.
Definition at line 175 of file PropertyConditional.cs.
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.
Definition at line 181 of file PropertyConditional.cs.
readonly ConditionType Barotrauma.PropertyConditional.Type |
Definition at line 164 of file PropertyConditional.cs.