Barotrauma Client Doc
|
Used by various features to define different kinds of relations between items: for example, which item a character must have equipped to interact with some item in some way, which items can go inside a container, or which kind of item the target of a status effect must have for the effect to execute. More...
Public Types | |
enum class | RelationType { None , Contained , Equipped , Picked , Container , Invalid } |
Public Member Functions | |
bool | MatchesItem (Item item) |
bool | MatchesItem (ItemPrefab itemPrefab) |
RelatedItem (Identifier[] identifiers, Identifier[] excludedIdentifiers) | |
RelatedItem (ContentXElement element, string parentDebugName) | |
bool | CheckRequirements (Character character, Item parentItem) |
void | Save (XElement element) |
Static Public Member Functions | |
static RelatedItem | Load (ContentXElement element, bool returnEmpty, string parentDebugName) |
Public Attributes | |
List< StatusEffect > | StatusEffects = new List<StatusEffect>() |
LocalizedString | Msg |
Only valid for the RequiredItems of an ItemComponent. A message displayed if the required item isn't found (e.g. a notification about lack of ammo or fuel). More... | |
Identifier | MsgTag |
Only valid for the RequiredItems of an ItemComponent. The localization tag of a message displayed if the required item isn't found (e.g. a notification about lack of ammo or fuel). More... | |
int | TargetSlot = -1 |
Index of the slot the target must be in when targeting a Contained item More... | |
InvSlotType | CharacterInventorySlotType |
The slot type the target must be in when targeting an item contained inside a character's inventory More... | |
Vector2? | ItemPos |
Overrides the position defined in ItemContainer. Only valid when used in the Containable definitions of an ItemContainer. More... | |
bool | Hide |
Only valid when used in the Containable definitions of an ItemContainer. Only affects when ItemContainer.hideItems is false. Doesn't override the value. More... | |
float | Rotation |
Only valid when used in the Containable definitions of an ItemContainer. Can be used to override the rotation of specific items in the container. More... | |
bool | SetActive |
Only valid when used in the Containable definitions of an ItemContainer. Can be used to force specific items to stay active inside the container (such as flashlights attached to a gun). More... | |
Properties | |
bool | MatchOnEmpty [get, set] |
Should an empty inventory (or an empty inventory slot if TargetSlot is set) be considered valid? Can be used to, for example, make an item do something if there's a specific item, or nothing, inside it. More... | |
bool | RequireEmpty [get, set] |
Should only an empty inventory (or an empty inventory slot if TargetSlot is set) be considered valid? Can be used to, for example, make an item do something when there's nothing inside it. More... | |
bool | IgnoreInEditor [get, set] |
Only valid for the RequiredItems of an ItemComponent. Can be used to ignore the requirement in the submarine editor, making it easier to for example make rewire things that require some special tool to rewire. More... | |
ImmutableHashSet< Identifier > | ExcludedIdentifiers [get] |
Identifier(s) or tag(s) of the items that are NOT considered valid. Can be used to, for example, exclude some specific items when using tags that apply to multiple items. More... | |
bool | ExcludeBroken [get] |
Should broken (0 condition) items be excluded? More... | |
bool | ExcludeFullCondition [get] |
Should full condition (100%) items be excluded? More... | |
bool | AllowVariants = true [get] |
Are item variants considered valid? More... | |
RelationType | Type [get] |
bool | IsOptional [get, set] |
Only valid for the RequiredItems of an ItemComponent. Can be used to make the requirement optional, meaning that you don't need to have the item to interact with something, but having it may still affect what the interaction does (such as using a crowbar on a door). More... | |
string | JoinedIdentifiers [get, set] |
ImmutableHashSet< Identifier > | Identifiers [get] |
Identifier(s) or tag(s) of the items that are considered valid. More... | |
string | JoinedExcludedIdentifiers [get, set] |
Used by various features to define different kinds of relations between items: for example, which item a character must have equipped to interact with some item in some way, which items can go inside a container, or which kind of item the target of a status effect must have for the effect to execute.
Definition at line 16 of file RelatedItem.cs.
|
strong |
Definition at line 18 of file RelatedItem.cs.
Barotrauma.RelatedItem.RelatedItem | ( | Identifier[] | identifiers, |
Identifier[] | excludedIdentifiers | ||
) |
Definition at line 213 of file RelatedItem.cs.
Barotrauma.RelatedItem.RelatedItem | ( | ContentXElement | element, |
string | parentDebugName | ||
) |
Definition at line 219 of file RelatedItem.cs.
Definition at line 336 of file RelatedItem.cs.
|
static |
Definition at line 445 of file RelatedItem.cs.
bool Barotrauma.RelatedItem.MatchesItem | ( | Item | item | ) |
Definition at line 170 of file RelatedItem.cs.
bool Barotrauma.RelatedItem.MatchesItem | ( | ItemPrefab | itemPrefab | ) |
Definition at line 193 of file RelatedItem.cs.
void Barotrauma.RelatedItem.Save | ( | XElement | element | ) |
Definition at line 412 of file RelatedItem.cs.
InvSlotType Barotrauma.RelatedItem.CharacterInventorySlotType |
The slot type the target must be in when targeting an item contained inside a character's inventory
Definition at line 112 of file RelatedItem.cs.
bool Barotrauma.RelatedItem.Hide |
Only valid when used in the Containable definitions of an ItemContainer. Only affects when ItemContainer.hideItems is false. Doesn't override the value.
Definition at line 123 of file RelatedItem.cs.
Vector2? Barotrauma.RelatedItem.ItemPos |
Overrides the position defined in ItemContainer. Only valid when used in the Containable definitions of an ItemContainer.
Definition at line 117 of file RelatedItem.cs.
LocalizedString Barotrauma.RelatedItem.Msg |
Only valid for the RequiredItems of an ItemComponent. A message displayed if the required item isn't found (e.g. a notification about lack of ammo or fuel).
Definition at line 77 of file RelatedItem.cs.
Identifier Barotrauma.RelatedItem.MsgTag |
Only valid for the RequiredItems of an ItemComponent. The localization tag of a message displayed if the required item isn't found (e.g. a notification about lack of ammo or fuel).
Definition at line 82 of file RelatedItem.cs.
float Barotrauma.RelatedItem.Rotation |
Only valid when used in the Containable definitions of an ItemContainer. Can be used to override the rotation of specific items in the container.
Definition at line 129 of file RelatedItem.cs.
bool Barotrauma.RelatedItem.SetActive |
Only valid when used in the Containable definitions of an ItemContainer. Can be used to force specific items to stay active inside the container (such as flashlights attached to a gun).
Definition at line 135 of file RelatedItem.cs.
List<StatusEffect> Barotrauma.RelatedItem.StatusEffects = new List<StatusEffect>() |
Definition at line 72 of file RelatedItem.cs.
int Barotrauma.RelatedItem.TargetSlot = -1 |
Index of the slot the target must be in when targeting a Contained item
Definition at line 107 of file RelatedItem.cs.
|
get |
Are item variants considered valid?
Definition at line 97 of file RelatedItem.cs.
|
get |
Should broken (0 condition) items be excluded?
Definition at line 87 of file RelatedItem.cs.
|
get |
Identifier(s) or tag(s) of the items that are NOT considered valid. Can be used to, for example, exclude some specific items when using tags that apply to multiple items.
Definition at line 68 of file RelatedItem.cs.
|
get |
Should full condition (100%) items be excluded?
Definition at line 92 of file RelatedItem.cs.
|
get |
Identifier(s) or tag(s) of the items that are considered valid.
Definition at line 157 of file RelatedItem.cs.
|
getset |
Only valid for the RequiredItems of an ItemComponent. Can be used to ignore the requirement in the submarine editor, making it easier to for example make rewire things that require some special tool to rewire.
Definition at line 61 of file RelatedItem.cs.
|
getset |
Only valid for the RequiredItems of an ItemComponent. Can be used to make the requirement optional, meaning that you don't need to have the item to interact with something, but having it may still affect what the interaction does (such as using a crowbar on a door).
Definition at line 141 of file RelatedItem.cs.
|
getset |
Definition at line 159 of file RelatedItem.cs.
|
getset |
Definition at line 143 of file RelatedItem.cs.
|
getset |
Should an empty inventory (or an empty inventory slot if TargetSlot is set) be considered valid? Can be used to, for example, make an item do something if there's a specific item, or nothing, inside it.
Definition at line 48 of file RelatedItem.cs.
|
getset |
Should only an empty inventory (or an empty inventory slot if TargetSlot is set) be considered valid? Can be used to, for example, make an item do something when there's nothing inside it.
Definition at line 53 of file RelatedItem.cs.
|
get |
Definition at line 99 of file RelatedItem.cs.