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...
|
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).
|
|
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).
|
|
int | TargetSlot = -1 |
| Index of the slot the target must be in when targeting a Contained item.
|
|
InvSlotType | CharacterInventorySlotType |
| The slot type the target must be in when targeting an item contained inside a character's inventory.
|
|
Vector2? | ItemPos |
| Overrides the position defined in ItemContainer. Only valid when used in the Containable definitions of an ItemContainer.
|
|
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.
|
|
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.
|
|
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).
|
|
bool | BlameEquipperForDeath |
| Only valid when used in the Containable definitions of an ItemContainer. Should the character who equipped the item be blamed if the wearer / character who's inventory the item is in dies?
|
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
bool | ExcludeBroken [get] |
| Should broken (0 condition) items be excluded?
|
|
bool | ExcludeFullCondition [get] |
| Should full condition (100%) items be excluded?
|
|
bool | AllowVariants = true [get] |
| Are item variants considered valid?
|
|
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).
|
|
string | JoinedIdentifiers [get, set] |
|
ImmutableHashSet< Identifier > | Identifiers [get] |
| Identifier(s) or tag(s) of the items that are considered valid.
|
|
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.
◆ RelationType
Enumerator |
---|
None | |
Contained | The item must be contained inside the item this relation is defined in. Can for example by used to make an item usable only when there's a specific kind of item inside it.
|
Equipped | The user must have equipped the item (i.e. held or worn).
|
Picked | The user must have picked up the item (i.e. the item needs to be in the user's inventory).
|
Container | The item this relation is defined in must be inside a specific kind of container. Can for example by used to make an item do something when it's inside some other type of item.
|
Invalid | Signifies an error (type could not be parsed)
|
◆ RelatedItem() [1/2]
Barotrauma.RelatedItem.RelatedItem |
( |
Identifier[] | identifiers, |
|
|
Identifier[] | excludedIdentifiers ) |
◆ RelatedItem() [2/2]
Barotrauma.RelatedItem.RelatedItem |
( |
ContentXElement | element, |
|
|
string | parentDebugName ) |
◆ CheckRequirements()
bool Barotrauma.RelatedItem.CheckRequirements |
( |
Character | character, |
|
|
Item | parentItem ) |
◆ Load()
◆ MatchesItem() [1/2]
bool Barotrauma.RelatedItem.MatchesItem |
( |
Item | item | ) |
|
◆ MatchesItem() [2/2]
bool Barotrauma.RelatedItem.MatchesItem |
( |
ItemPrefab | itemPrefab | ) |
|
◆ Save()
void Barotrauma.RelatedItem.Save |
( |
XElement | element | ) |
|
◆ BlameEquipperForDeath
bool Barotrauma.RelatedItem.BlameEquipperForDeath |
Only valid when used in the Containable definitions of an ItemContainer. Should the character who equipped the item be blamed if the wearer / character who's inventory the item is in dies?
◆ CharacterInventorySlotType
InvSlotType Barotrauma.RelatedItem.CharacterInventorySlotType |
The slot type the target must be in when targeting an item contained inside a character's inventory.
◆ Hide
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.
◆ ItemPos
Vector2? Barotrauma.RelatedItem.ItemPos |
Overrides the position defined in ItemContainer. Only valid when used in the Containable definitions of an ItemContainer.
◆ 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).
◆ MsgTag
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).
◆ Rotation
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.
◆ SetActive
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).
◆ StatusEffects
◆ TargetSlot
int Barotrauma.RelatedItem.TargetSlot = -1 |
Index of the slot the target must be in when targeting a Contained item.
◆ AllowVariants
bool Barotrauma.RelatedItem.AllowVariants = true |
|
get |
Are item variants considered valid?
◆ ExcludeBroken
bool Barotrauma.RelatedItem.ExcludeBroken |
|
get |
Should broken (0 condition) items be excluded?
◆ ExcludedIdentifiers
ImmutableHashSet<Identifier> Barotrauma.RelatedItem.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.
◆ ExcludeFullCondition
bool Barotrauma.RelatedItem.ExcludeFullCondition |
|
get |
Should full condition (100%) items be excluded?
◆ Identifiers
ImmutableHashSet<Identifier> Barotrauma.RelatedItem.Identifiers |
|
get |
Identifier(s) or tag(s) of the items that are considered valid.
◆ IgnoreInEditor
bool Barotrauma.RelatedItem.IgnoreInEditor |
|
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.
◆ IsOptional
bool Barotrauma.RelatedItem.IsOptional |
|
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).
◆ JoinedExcludedIdentifiers
string Barotrauma.RelatedItem.JoinedExcludedIdentifiers |
|
getset |
◆ JoinedIdentifiers
string Barotrauma.RelatedItem.JoinedIdentifiers |
|
getset |
◆ MatchOnEmpty
bool Barotrauma.RelatedItem.MatchOnEmpty |
|
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.
◆ RequireEmpty
bool Barotrauma.RelatedItem.RequireEmpty |
|
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.
◆ Type
The documentation for this class was generated from the following file:
- /home/runner/work/Luatrauma.Docs/Luatrauma.Docs/libs/LuaCsForBarotrauma/Barotrauma/BarotraumaShared/SharedSource/Items/RelatedItem.cs