Barotrauma Client Doc
Barotrauma.Item Class Reference
Inheritance diagram for Barotrauma.Item:
Barotrauma.Networking.IClientSerializable Barotrauma.Networking.IServerSerializable Barotrauma.ISerializableEntity Barotrauma.IDamageable Barotrauma.MapEntity Barotrauma.Networking.IClientSerializable Barotrauma.Networking.IServerPositionSync Barotrauma.ISerializableEntity Barotrauma.IIgnorable Barotrauma.IDamageable Barotrauma.MapEntity

Classes

struct  ApplyStatusEffectEventData
 
struct  ChangePropertyEventData
 
struct  ComponentStateEventData
 
interface  IEventData
 
struct  InventoryStateEventData
 
struct  SetItemStatEventData
 

Public Types

enum class  EventType {
  ComponentState = 0 , InventoryState = 1 , Treatment = 2 , ChangeProperty = 3 ,
  Combine = 4 , Status = 5 , AssignCampaignInteraction = 6 , ApplyStatusEffect = 7 ,
  Upgrade = 8 , ItemStat = 9 , DroppedStack = 10 , SetHighlight = 11 ,
  MinValue = 0 , MaxValue = 11
}
 

Public Member Functions

void AssignCampaignInteractionType (CampaignMode.InteractionType interactionType, IEnumerable< Client > targetClients=null)
 
void ResetWaterDragCoefficient ()
 Removes the override value -> falls back to using the original value defined in the xml. More...
 
bool IsInteractable (Character character)
 Returns interactibility based on whether the character is on a player team More...
 
override string ToString ()
 
bool IgnoreByAI (Character character)
 
 Item (ItemPrefab itemPrefab, Vector2 position, Submarine submarine, ushort id=Entity.NullEntityID, bool callOnItemLoaded=true)
 
 Item (Rectangle newRect, ItemPrefab itemPrefab, Submarine submarine, bool callOnItemLoaded=true, ushort id=Entity.NullEntityID)
 Creates a new item More...
 
bool IsContainerPreferred (ItemContainer container, out bool isPreferencesDefined, out bool isSecondary, bool requireConditionRestriction=false)
 
override MapEntity Clone ()
 
void AddComponent (ItemComponent component)
 
void EnableDrawableComponent (IDrawableComponent drawable)
 
void DisableDrawableComponent (IDrawableComponent drawable)
 
int GetComponentIndex (ItemComponent component)
 
GetComponent< T > ()
 
IEnumerable< T > GetComponents< T > ()
 
float GetQualityModifier (Quality.StatType statType)
 
void RemoveContained (Item contained)
 
void SetTransform (Vector2 simPosition, float rotation, bool findNewHull=true, bool setPrevTransform=true)
 
bool AllowDroppingOnSwapWith (Item otherItem)
 Is dropping the item allowed when trying to swap it with the other item More...
 
void SetActiveSprite ()
 
void CheckCleanable ()
 Recheck if the item needs to be included in the list of cleanable items More...
 
override void Move (Vector2 amount, bool ignoreContacts=true)
 
Rectangle TransformTrigger (Rectangle trigger, bool world=false)
 
override Quad2D GetTransformedQuad ()
 
Hull FindHull ()
 
bool HasAccess (Character character)
 Used by the AI to check whether they can (in principle) and are allowed (in practice) to interact with an object or not. Unlike CanInteractWith(), this method doesn't check the distance, the triggers, or anything like that. More...
 
bool IsOwnedBy (Entity entity)
 
Entity GetRootInventoryOwner ()
 
Inventory FindParentInventory (Func< Inventory, bool > predicate)
 
void SetContainedItemPositions ()
 
void AddTag (string tag)
 
void AddTag (Identifier tag)
 
bool HasTag (Identifier tag)
 
bool HasIdentifierOrTags (IEnumerable< Identifier > identifiersOrTags)
 
void ReplaceTag (string tag, string newTag)
 
void ReplaceTag (Identifier tag, Identifier newTag)
 
IReadOnlyCollection< IdentifierGetTags ()
 
bool HasTag (IEnumerable< Identifier > allowedTags)
 
bool ConditionalMatches (PropertyConditional conditional)
 
void ApplyStatusEffects (ActionType type, float deltaTime, Character character=null, Limb limb=null, Entity useTarget=null, bool isNetworkEvent=false, Vector2? worldPosition=null)
 
void ApplyStatusEffect (StatusEffect effect, ActionType type, float deltaTime, Character character=null, Limb limb=null, Entity useTarget=null, bool isNetworkEvent=false, bool checkCondition=true, Vector2? worldPosition=null)
 
AttackResult AddDamage (Character attacker, Vector2 worldPosition, Attack attack, Vector2 impulseDirection, float deltaTime, bool playSound=true)
 
void RecalculateConditionValues ()
 Recalculates the item's maximum condition, condition percentage and whether it's in full condition. You generally never need to call this manually - done automatically when any of the factors that affect the values change. More...
 
void SendPendingNetworkUpdates ()
 
void CreateStatusEvent (bool loadingRound)
 
override void Update (float deltaTime, Camera cam)
 
void UpdateTransform ()
 
override void FlipX (bool relativeToSub)
 Flip the entity horizontally More...
 
override void FlipY (bool relativeToSub)
 Flip the entity vertically More...
 
List< T > GetConnectedComponents< T > (bool recursive=false, bool allowTraversingBackwards=true, Func< Connection, bool > connectionFilter=null)
 Note: This function generates garbage and might be a bit too heavy to be used once per frame. More...
 
List< T > GetConnectedComponentsRecursive< T > (Connection c, bool ignoreInactiveRelays=false, bool allowTraversingBackwards=true)
 Note: This function generates garbage and might be a bit too heavy to be used once per frame. More...
 
Controller FindController (ImmutableArray< Identifier >? tags=null)
 
bool TryFindController (out Controller controller, ImmutableArray< Identifier >? tags=null)
 
void SendSignal (string signal, string connectionName)
 
void SendSignal (Signal signal, string connectionName)
 
void SendSignal (Signal signal, Connection connection)
 
bool IsInsideTrigger (Vector2 worldPosition)
 
bool IsInsideTrigger (Vector2 worldPosition, out Rectangle transformedTrigger)
 
bool CanClientAccess (Client c)
 
bool TryInteract (Character user, bool ignoreRequiredItems=false, bool forceSelectKey=false, bool forceUseKey=false)
 
float GetContainedItemConditionPercentage ()
 
void Use (float deltaTime, Character user=null, Limb targetLimb=null, Entity useTarget=null, Character userForOnUsedEvent=null)
 
void SecondaryUse (float deltaTime, Character character=null)
 
void ApplyTreatment (Character user, Character character, Limb targetLimb)
 
bool Combine (Item item, Character user)
 
void Drop (Character dropper, bool createNetworkEvent=true, bool setTransform=true)
 
void CreateDroppedStack (IEnumerable< Item > items, bool allowClientExecute)
 "Merges" the set of items so they behave as one physical object and can be picked up by clicking once. The items need to be instances of the same prefab and have a physics body. More...
 
void Equip (Character character)
 
void Unequip (Character character)
 
List<(object obj, SerializableProperty property)> GetProperties< T > ()
 
override XElement Save (XElement parentElement)
 
virtual void Reset ()
 
override void OnMapLoaded ()
 
override void ShallowRemove ()
 Remove the item so that it doesn't appear to exist in the game world (stop sounds, remove bodies etc) but don't reset anything that's required for cloning the item More...
 
override void Remove ()
 
object GetComponentString (string component)
 
float GetDrawDepth ()
 
Color GetSpriteColor (Color? defaultColor=null, bool withHighlight=false)
 
Color GetInventoryIconColor ()
 
void InitSpriteStates ()
 
void ResetCachedVisibleSize ()
 
override bool IsVisible (Rectangle worldView)
 
override void Draw (SpriteBatch spriteBatch, bool editing, bool back=true)
 
void Draw (SpriteBatch spriteBatch, bool editing, bool back=true, Color? overrideColor=null)
 
void DrawDecorativeSprites (SpriteBatch spriteBatch, Vector2 drawPos, bool flipX, bool flipY, float rotation, float depth)
 
void CheckNeedsSoundUpdate (ItemComponent ic)
 
void UpdateSpriteStates (float deltaTime)
 
override void UpdateEditing (Camera cam, float deltaTime)
 
override bool IsMouseOn (Vector2 position)
 
GUIComponent CreateEditingHUD (bool inGame=false)
 
override bool AddUpgrade (Upgrade upgrade, bool createNetworkEvent=false)
 Adds a new upgrade to the item More...
 
void UpdateHUD (Camera cam, Character character, float deltaTime)
 
void DrawHUD (SpriteBatch spriteBatch, Camera cam, Character character)
 
List< ColoredTextGetHUDTexts (Character character, bool recreateHudTexts=true)
 
void ForceHUDLayoutUpdate (bool ignoreLocking=false)
 
override void AddToGUIUpdateList (int order=0)
 
void ClientEventRead (IReadMessage msg, float sendingTime)
 
void ClientEventWrite (IWriteMessage msg, NetEntityEvent.IData extraData=null)
 
void ClientReadPosition (IReadMessage msg, float sendingTime)
 
void CreateClientEvent< T > (T ic)
 
void CreateClientEvent< T > (T ic, ItemComponent.IEventData extraData)
 
void OnPlayerSkillsChanged ()
 
- Public Member Functions inherited from Barotrauma.MapEntity
void AddLinked (MapEntity entity)
 
 MapEntity (MapEntityPrefab prefab, Submarine submarine, ushort id)
 
void ResolveLinks (IdRemap childRemap)
 
bool HasUpgrade (Identifier identifier)
 
Upgrade GetUpgrade (Identifier identifier)
 
List< Upgrade > GetUpgrades ()
 
void SetUpgrade (Upgrade upgrade, bool createNetworkEvent=false)
 
override void Remove ()
 
void RemoveLinked (MapEntity e)
 
HashSet< T > GetLinkedEntities< T > (HashSet< T > list=null, int? maxDepth=null, Func< T, bool > filter=null)
 Gets all linked entities of specific type. More...
 
float GetDrawDepth (float baseDepth, Sprite sprite)
 A method that modifies the draw depth to prevent z-fighting between entities with the same sprite depth More...
 
MapEntity GetReplacementOrThis ()
 
virtual void DrawEditing (SpriteBatch spriteBatch, Camera cam)
 
- Public Member Functions inherited from Barotrauma.Entity
 Entity (Submarine submarine, ushort id)
 
void FreeID ()
 Removes the entity from the entity dictionary and frees up the ID it was using. More...
 

Static Public Member Functions

static void UpdateHulls ()
 goes through every item and re-checks which hull they are in More...
 
static void UpdatePendingConditionUpdates (float deltaTime)
 
static Item Load (ContentXElement element, Submarine submarine, IdRemap idRemap)
 
static Item Load (ContentXElement element, Submarine submarine, bool createNetworkEvent, IdRemap idRemap)
 Instantiate a new item and load its data from the XML element. More...
 
static void RemoveByPrefab (ItemPrefab prefab)
 
static Item ReadSpawnData (IReadMessage msg, bool spawn=true)
 
- Static Public Member Functions inherited from Barotrauma.MapEntity
static void ClearHighlightedEntities ()
 
static List< MapEntityClone (List< MapEntity > entitiesToClone)
 
static void UpdateAll (float deltaTime, Camera cam)
 Call Update() on every object in Entity.list More...
 
static List< MapEntityLoadAll (Submarine submarine, XElement parentElement, string filePath, int idOffset)
 
static void MapLoaded (List< MapEntity > entities, bool updateHulls)
 
static void InitializeLoadedLinks (IEnumerable< MapEntity > entities)
 
static void UpdateSelecting (Camera cam)
 Update the selection logic in submarine editor More...
 
static void StopSelection ()
 
static Vector2 GetNudgeAmount (bool doHold=true)
 
static Item GetPotentialContainer (Vector2 position, HashSet< MapEntity > entities=null)
 
static void UpdateHighlighting (List< MapEntity > highlightedEntities, bool wiringMode=false)
 Updates the logic that runs the highlight box when the mouse is sitting still. More...
 
static void AddSelection (MapEntity entity)
 
static void RemoveSelection (MapEntity entity)
 
static void DrawSelecting (SpriteBatch spriteBatch, Camera cam)
 Draw the "selection rectangle" and outlines of entities that are being dragged (if any) More...
 
static void DrawSelectionRect (SpriteBatch spriteBatch, Vector2 pos, Vector2 size, Color color)
 
static void UpdateEditor (Camera cam, float deltaTime)
 
static void DrawEditor (SpriteBatch spriteBatch, Camera cam)
 
static void DeselectAll ()
 
static void SelectEntity (MapEntity entity)
 
static void Copy (List< MapEntity > entities)
 Copy the selected entities to the "clipboard" (copiedList) More...
 
static void Cut (List< MapEntity > entities)
 
static void Paste (Vector2 position)
 
static List< MapEntityCopyEntities (List< MapEntity > entities)
 copies a list of entities to the "clipboard" (copiedList) More...
 
static HashSet< MapEntityFindSelectedEntities (Vector2 pos, Vector2 size)
 Find entities whose rect intersects with the "selection rect" More...
 
- Static Public Member Functions inherited from Barotrauma.Entity
static IReadOnlyCollection< EntityGetEntities ()
 
static int FindFreeIdBlock (int minBlockSize)
 Finds a contiguous block of free IDs of at least the given size More...
 
static Entity FindEntityByID (ushort ID)
 Find an entity based on the ID More...
 
static void RemoveAll ()
 
static void DumpIds (int count, string filename)
 

Public Attributes

bool Visible = true
 
SpriteEffects SpriteEffects = SpriteEffects.None
 
PhysicsBody body
 
readonly XElement StaticBodyConfig
 
List< Fixture > StaticFixtures = new List<Fixture>()
 
Action OnInteract
 
ColorHighlightColor
 
bool StolenDuringRound
 
bool IsSalvageMissionItem
 
readonly ImmutableArray< ItemInventoryOwnInventories = ImmutableArray<ItemInventory>.Empty
 
readonly HashSet< ItemPrefabAvailableSwaps = new HashSet<ItemPrefab>()
 
Action< CharacterOnDeselect
 
float LastImpactSoundTime
 
float DrawDepthOffset
 
- Public Attributes inherited from Barotrauma.MapEntity
readonly MapEntityPrefab Prefab
 
List< ushort > unresolvedLinkedToID
 
readonly HashSet< IdentifierDisallowedUpgradeSet = new HashSet<Identifier>()
 
readonly List< MapEntitylinkedTo = new List<MapEntity>()
 
bool ShouldBeSaved = true
 
int OriginalModuleIndex = -1
 The index of the outpost module this entity originally spawned in (-1 if not an outpost item) More...
 
int OriginalContainerIndex = -1
 
MapEntity ReplacedBy
 Used for undo/redo to determine what this item has been replaced with More...
 
- Public Attributes inherited from Barotrauma.Entity
readonly ushort ID
 Unique, but non-persistent identifier. Stays the same if the entities are created in the exactly same order, but doesn't persist e.g. between the rounds. More...
 
readonly string CreationStackTrace
 
readonly UInt64 CreationIndex
 

Static Public Attributes

static readonly List< ItemItemList = new List<Item>()
 
static bool ShowLinks = true
 
static readonly ImmutableArray<(Identifier Input, Identifier Output)> connectionPairs
 
static bool ShowItems = true
 
const float ImpactSoundInterval = 0.2f
 
- Static Public Attributes inherited from Barotrauma.MapEntity
static readonly List< MapEntityMapEntityList = new List<MapEntity>()
 
static int MapEntityUpdateInterval = 1
 
static int PoweredUpdateInterval = 1
 
static bool SelectionChanged
 
static List< MapEntityCopiedList = new List<MapEntity>()
 
- Static Public Attributes inherited from Barotrauma.Entity
const ushort NullEntityID = 0
 
const ushort EntitySpawnerID = ushort.MaxValue
 
const ushort RespawnManagerID = ushort.MaxValue - 1
 
const ushort DummyID = ushort.MaxValue - 2
 
const ushort ReservedIDStart = ushort.MaxValue - 3
 
const ushort MaxEntityCount = ushort.MaxValue - 4
 
static EntitySpawner Spawner
 

Protected Member Functions

override void CheckIsHighlighted ()
 
- Protected Member Functions inherited from Barotrauma.MapEntity
void ParseLinks (XElement element, IdRemap idRemap)
 
void InsertToList ()
 
Vector2 GetCollapseEffectOffset ()
 
- Protected Member Functions inherited from Barotrauma.Entity
virtual ushort DetermineID (ushort id, Submarine submarine)
 

Protected Attributes

Color spriteColor
 
- Protected Attributes inherited from Barotrauma.MapEntity
List< ushort > linkedToID
 
readonly List< Upgrade > Upgrades = new List<Upgrade>()
 List of upgrades this item has More...
 
bool flippedX
 
Rectangle rect
 
- Protected Attributes inherited from Barotrauma.Entity
AITarget aiTarget
 

Properties

static IReadOnlyCollection< ItemDangerousItems [get]
 
static IReadOnlyCollection< ItemRepairableItems [get]
 Items that have one more more Repairable component More...
 
static IReadOnlyCollection< ItemCleanableItems [get]
 Items that may potentially need to be cleaned up (pickable, not attached to a wall, and not inside a valid container) More...
 
static IReadOnlyCollection< ItemSonarVisibleItems [get]
 Items whose ItemPrefab.SonarSize is larger than 0 More...
 
new ItemPrefab Prefab [get]
 
Hull CurrentHull [get, set]
 
float??? HullOxygenPercentage [get]
 
CampaignMode.InteractionType CampaignInteractionType [get]
 
bool FullyInitialized [get]
 Has everything in the item been loaded/instantiated/initialized (basically, can be used to check if the whole constructor/Load method has run). Most commonly used to avoid creating network events when some value changes if the item is being initialized. More...
 
float?? WaterDragCoefficient [get, set]
 
BodyType??? BodyType [get, set]
 Can be used by StatusEffects to set the type of the body (if the item has one) More...
 
Rectangle DefaultRect [get, set]
 Unscaled rect More...
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get, protected set]
 
bool EditableWhenEquipped = false [get, set]
 
Inventory ParentInventory [get, set]
 
Item RootContainer [get]
 
Item Container [get]
 
override string Name [get]
 
string?? Description [get, set]
 
string? DescriptionTag [get, set]
 Can be used to set a localized description via StatusEffects More...
 
bool NonInteractable [get, set]
 
bool NonPlayerTeamInteractable [get, set]
 Use IsPlayerInteractable to also check NonInteractable More...
 
bool AllowSwapping [get, set]
 
bool PurchasedNewSwap [get, set]
 
bool IsPlayerTeamInteractable [get]
 Checks both NonInteractable and NonPlayerTeamInteractable More...
 
float RotationRad [get]
 
float Rotation [get, set]
 
float ImpactTolerance [get]
 
float InteractDistance [get]
 
float InteractPriority [get]
 
override Vector2? Position [get]
 
override Vector2? SimPosition [get]
 
Rectangle InteractionRect [get]
 
override float?? Scale [get, set]
 
float PositionUpdateInterval = float.PositiveInfinity [get, set]
 
Color SpriteColor [get, set]
 
Color InventoryIconColor [get, protected set]
 
Color ContainerColor [get, protected set]
 
Identifier??????? ContainerIdentifier [get]
 Can be used by status effects or conditionals to check what item this item is contained inside More...
 
bool IsContained [get]
 Can be used by status effects or conditionals to check whether the item is contained inside something More...
 
float? Speed [get]
 Can be used by status effects or conditionals to the speed of the item More...
 
string????? SonarLabel [get, set]
 Can be used to modify the AITarget's label using status effects More...
 
bool PhysicsBodyActive [get]
 Can be used by status effects or conditionals to check if the physics body of the item is active More...
 
new float? SoundRange [get, set]
 Can be used by status effects or conditionals to modify the sound range More...
 
new float? SightRange [get, set]
 Can be used by status effects or conditionals to modify the sight range More...
 
bool IsShootable [get, set]
 Should the item's Use method be called with the "Use" or with the "Shoot" key? More...
 
bool RequireAimToUse [get, set]
 If true, the user has to hold the "aim" key before use is registered. False by default. More...
 
bool RequireAimToSecondaryUse [get, set]
 If true, the user has to hold the "aim" key before secondary use is registered. True by default. More...
 
Color Color [get]
 
bool IsFullCondition [get]
 
float MaxCondition [get]
 
float ConditionPercentage [get]
 
float OffsetOnSelectedMultiplier [get, set]
 
float HealthMultiplier [get, set]
 
float MaxRepairConditionMultiplier [get, set]
 
float Condition [get, set]
 
bool ConditionIncreasedRecently [get]
 Return true if the condition of this item increased within the last second. More...
 
float Health [get]
 
bool?? Indestructible [get, set]
 Per-instance value - if not set, the value of the prefab is used. More...
 
bool AllowDeconstruct [get, set]
 
bool InvulnerableToDamage [get, set]
 
bool?? SpawnedInCurrentOutpost [get, set]
 
bool AllowStealing [get, set]
 
string???? OriginalOutpost [get, set]
 
string Tags [get, set]
 
bool FireProof [get]
 
bool WaterProof [get]
 
bool UseInHealthInterface [get]
 
int??? Quality [get, set]
 
bool InWater [get]
 
List< ConnectionLastSentSignalRecipients = new List<Connection>(20) [get]
 A list of connections the last signal sent by this item went through More...
 
ContentPath ConfigFilePath [get]
 
IEnumerable< InvSlotTypeAllowedSlots [get]
 
List< ConnectionConnections [get]
 
IEnumerable< ItemContainedItems [get]
 
ItemInventory OwnInventory [get]
 
bool DisplaySideBySideWhenLinked [get, set]
 
List< RepairableRepairables [get]
 
List< ItemComponentComponents [get]
 
override bool Linkable [get]
 
float WorldPositionX [get]
 
float WorldPositionY [get]
 
float PositionX [get]
 Can be used to move the item from XML (e.g. to correct the positions of items whose sprite origin has been changed) More...
 
float PositionY [get]
 Can be used to move the item from XML (e.g. to correct the positions of items whose sprite origin has been changed) More...
 
BallastFloraBranch Infector [get, set]
 
ItemPrefab PendingItemSwap [get, set]
 
IReadOnlyList< ISerializableEntityAllPropertyObjects [get]
 
bool OrderedToBeIgnored [get, set]
 
bool? HasBallastFloraInHull [get]
 
bool? IsClaimedByBallastFlora [get]
 
bool InPlayerSubmarine [get]
 
bool InBeaconStation [get]
 
bool IsLadder [get]
 
bool IsSecondaryItem [get]
 
ItemStatManager StatManager [get]
 
float LastEatenTime [get, set]
 Timing.TotalTimeUnpaused when some character was last eating the item More...
 
IEnumerable< ItemDroppedStack [get]
 
GUIComponentStyle IconStyle [get]
 
IEnumerable< ItemComponentActiveHUDs [get]
 
bool FakeBroken [get, set]
 
override Sprite Sprite [get]
 
override Rectangle Rect [get, set]
 
override bool DrawBelowWater [get]
 
override bool DrawOverWater [get]
 
override bool SelectableInEditor [get]
 
- Properties inherited from Barotrauma.MapEntity
string DisallowedUpgrades [get, set]
 
bool FlippedX [get]
 
bool FlippedY [get]
 
static IEnumerable< MapEntityHighlightedEntities [get]
 
bool ExternalHighlight [get, set]
 
bool IsHighlighted [get, set]
 
virtual Rectangle Rect [get, set]
 
Rectangle? WorldRect [get]
 
virtual Sprite Sprite [get]
 
virtual bool DrawBelowWater [get]
 
virtual bool DrawOverWater [get]
 
virtual bool Linkable [get]
 
IEnumerable< IdentifierAllowedLinks [get]
 
bool ResizeHorizontal [get]
 
bool ResizeVertical [get]
 
int RectWidth [get, set]
 
int RectHeight [get, set]
 
bool SpriteDepthOverrideIsSet [get]
 
float SpriteOverrideDepth [get]
 
float? SpriteDepth [get, set]
 
virtual float Scale = 1 [get, set]
 
bool HiddenInGame [get, set]
 
override Vector2 Position [get]
 
override Vector2 SimPosition [get]
 
float SoundRange [get, set]
 
float SightRange [get, set]
 
bool RemoveIfLinkedOutpostDoorInUse = true [get, protected set]
 
string Layer [get, set]
 
virtual string Name [get]
 
static Vector2 StartMovingPos [get]
 
static Vector2 SelectionPos [get]
 
static bool Resizing [get]
 
static HashSet< MapEntitySelectedList = new HashSet<MapEntity>() [get]
 
static GUIListBox HighlightedListBox [get]
 
static GUIComponent EditingHUD [get]
 
static bool DisableSelect [get, set]
 
virtual bool SelectableInEditor [get]
 
static bool SelectedAny [get]
 
bool IsSelected [get]
 
bool IsIncludedInSelection [get, set]
 
static List< MapEntityFilteredSelectedList = new List<MapEntity>() [get]
 
- Properties inherited from Barotrauma.Entity
static int EntityCount [get]
 
bool Removed [get]
 
bool IdFreed [get]
 
virtual Vector2 SimPosition [get]
 
virtual Vector2 Position [get]
 
virtual Vector2 WorldPosition [get]
 
virtual Vector2 DrawPosition [get]
 
Submarine Submarine [get, set]
 
AITarget AiTarget [get]
 
bool InDetectable [get, set]
 
double SpawnTime [get]
 
string ErrorLine [get]
 
- Properties inherited from Barotrauma.ISpatialEntity
Vector2 Position [get]
 
Vector2 WorldPosition [get]
 
Vector2 SimPosition [get]
 
Submarine Submarine [get]
 
- Properties inherited from Barotrauma.IDamageable
Vector2 SimPosition [get]
 
Vector2 WorldPosition [get]
 
float Health [get]
 
- Properties inherited from Barotrauma.IIgnorable
bool OrderedToBeIgnored [get, set]
 
- Properties inherited from Barotrauma.ISerializableEntity
string Name [get]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get]
 

Additional Inherited Members

- Static Protected Member Functions inherited from Barotrauma.MapEntity
static void ColorFlipButton (GUIButton btn, bool flip)
 
static void PositionEditingHUD ()
 
- Static Protected Attributes inherited from Barotrauma.MapEntity
static readonly HashSet< MapEntityhighlightedEntities = new HashSet<MapEntity>()
 
static Vector2 selectionPos = Vector2.Zero
 
static Vector2 selectionSize = Vector2.Zero
 
static GUIComponent editingHUD
 
- Events inherited from Barotrauma.MapEntity
Action< Rectangle > Resized
 

Detailed Description

Definition at line 25 of file BarotraumaShared/SharedSource/Items/Item.cs.

Member Enumeration Documentation

◆ EventType

Enumerator
ComponentState 
InventoryState 
Treatment 
ChangeProperty 
Combine 
Status 
AssignCampaignInteraction 
ApplyStatusEffect 
Upgrade 
ItemStat 
DroppedStack 
SetHighlight 
MinValue 
MaxValue 

Definition at line 13 of file BarotraumaShared/SharedSource/Items/ItemEventData.cs.

Constructor & Destructor Documentation

◆ Item() [1/2]

Barotrauma.Item.Item ( ItemPrefab  itemPrefab,
Vector2  position,
Submarine  submarine,
ushort  id = Entity.NullEntityID,
bool  callOnItemLoaded = true 
)

◆ Item() [2/2]

Barotrauma.Item.Item ( Rectangle  newRect,
ItemPrefab  itemPrefab,
Submarine  submarine,
bool  callOnItemLoaded = true,
ushort  id = Entity.NullEntityID 
)

Creates a new item

Parameters
callOnItemLoadedShould the OnItemLoaded methods of the ItemComponents be called. Use false if the item needs additional initialization before it can be considered fully loaded (e.g. when loading an item from a sub file or cloning an item).

Definition at line 1031 of file BarotraumaShared/SharedSource/Items/Item.cs.

Member Function Documentation

◆ AddComponent()

void Barotrauma.Item.AddComponent ( ItemComponent  component)

◆ AddDamage()

AttackResult Barotrauma.Item.AddDamage ( Character  attacker,
Vector2  worldPosition,
Attack  attack,
Vector2  impulseDirection,
float  deltaTime,
bool  playSound = true 
)

◆ AddTag() [1/2]

void Barotrauma.Item.AddTag ( Identifier  tag)

◆ AddTag() [2/2]

void Barotrauma.Item.AddTag ( string  tag)

◆ AddToGUIUpdateList()

override void Barotrauma.Item.AddToGUIUpdateList ( int  order = 0)
virtual

Reimplemented from Barotrauma.MapEntity.

Definition at line 1406 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ AddUpgrade()

override bool Barotrauma.Item.AddUpgrade ( Upgrade  upgrade,
bool  createNetworkEvent = false 
)
virtual

Adds a new upgrade to the item

Reimplemented from Barotrauma.MapEntity.

Definition at line 1071 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ AllowDroppingOnSwapWith()

bool Barotrauma.Item.AllowDroppingOnSwapWith ( Item  otherItem)

Is dropping the item allowed when trying to swap it with the other item

Definition at line 1551 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ ApplyStatusEffect()

void Barotrauma.Item.ApplyStatusEffect ( StatusEffect  effect,
ActionType  type,
float  deltaTime,
Character  character = null,
Limb  limb = null,
Entity  useTarget = null,
bool  isNetworkEvent = false,
bool  checkCondition = true,
Vector2?  worldPosition = null 
)

◆ ApplyStatusEffects()

void Barotrauma.Item.ApplyStatusEffects ( ActionType  type,
float  deltaTime,
Character  character = null,
Limb  limb = null,
Entity  useTarget = null,
bool  isNetworkEvent = false,
Vector2?  worldPosition = null 
)

◆ ApplyTreatment()

void Barotrauma.Item.ApplyTreatment ( Character  user,
Character  character,
Limb  targetLimb 
)

◆ AssignCampaignInteractionType()

void Barotrauma.Item.AssignCampaignInteractionType ( CampaignMode.InteractionType  interactionType,
IEnumerable< Client targetClients = null 
)

Definition at line 83 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ CanClientAccess()

bool Barotrauma.Item.CanClientAccess ( Client  c)

◆ CheckCleanable()

void Barotrauma.Item.CheckCleanable ( )

Recheck if the item needs to be included in the list of cleanable items

Definition at line 1579 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ CheckIsHighlighted()

override void Barotrauma.Item.CheckIsHighlighted ( )
protectedvirtual

Reimplemented from Barotrauma.MapEntity.

Definition at line 160 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ CheckNeedsSoundUpdate()

void Barotrauma.Item.CheckNeedsSoundUpdate ( ItemComponent  ic)

Definition at line 692 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ ClientEventRead()

void Barotrauma.Item.ClientEventRead ( IReadMessage  msg,
float  sendingTime 
)

◆ ClientEventWrite()

void Barotrauma.Item.ClientEventWrite ( IWriteMessage  msg,
NetEntityEvent.IData  extraData = null 
)

◆ ClientReadPosition()

void Barotrauma.Item.ClientReadPosition ( IReadMessage  msg,
float  sendingTime 
)

◆ Clone()

override MapEntity Barotrauma.Item.Clone ( )
virtual

◆ Combine()

bool Barotrauma.Item.Combine ( Item  item,
Character  user 
)

◆ ConditionalMatches()

bool Barotrauma.Item.ConditionalMatches ( PropertyConditional  conditional)

◆ CreateClientEvent< T >() [1/2]

void Barotrauma.Item.CreateClientEvent< T > ( ic)
Type Constraints
T :ItemComponent 
T :IClientSerializable 
T :CreateClientEvent 
T :ic 
T :null 

◆ CreateClientEvent< T >() [2/2]

void Barotrauma.Item.CreateClientEvent< T > ( ic,
ItemComponent.IEventData  extraData 
)
Type Constraints
T :ItemComponent 
T :IClientSerializable 

Definition at line 1775 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ CreateDroppedStack()

void Barotrauma.Item.CreateDroppedStack ( IEnumerable< Item items,
bool  allowClientExecute 
)

"Merges" the set of items so they behave as one physical object and can be picked up by clicking once. The items need to be instances of the same prefab and have a physics body.

Definition at line 3282 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ CreateEditingHUD()

GUIComponent Barotrauma.Item.CreateEditingHUD ( bool  inGame = false)

Definition at line 835 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ CreateStatusEvent()

void Barotrauma.Item.CreateStatusEvent ( bool  loadingRound)

◆ DisableDrawableComponent()

void Barotrauma.Item.DisableDrawableComponent ( IDrawableComponent  drawable)

◆ Draw() [1/2]

override void Barotrauma.Item.Draw ( SpriteBatch  spriteBatch,
bool  editing,
bool  back = true 
)
virtual

Reimplemented from Barotrauma.MapEntity.

Definition at line 319 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ Draw() [2/2]

void Barotrauma.Item.Draw ( SpriteBatch  spriteBatch,
bool  editing,
bool  back = true,
Color overrideColor = null 
)

Definition at line 324 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ DrawDecorativeSprites()

void Barotrauma.Item.DrawDecorativeSprites ( SpriteBatch  spriteBatch,
Vector2  drawPos,
bool  flipX,
bool  flipY,
float  rotation,
float  depth 
)

Definition at line 598 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ DrawHUD()

void Barotrauma.Item.DrawHUD ( SpriteBatch  spriteBatch,
Camera  cam,
Character  character 
)

◆ Drop()

void Barotrauma.Item.Drop ( Character  dropper,
bool  createNetworkEvent = true,
bool  setTransform = true 
)

Parameters
dropperCharacter who dropped the item
createNetworkEventShould clients be notified of the item being dropped
setTransformShould the transform of the physics body be updated. Only disable this if you're moving the item somewhere else / calling SetTransform manually immediately after dropping!

Definition at line 3214 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ EnableDrawableComponent()

void Barotrauma.Item.EnableDrawableComponent ( IDrawableComponent  drawable)

◆ Equip()

void Barotrauma.Item.Equip ( Character  character)

◆ FindController()

Controller Barotrauma.Item.FindController ( ImmutableArray< Identifier >?  tags = null)

◆ FindHull()

Hull Barotrauma.Item.FindHull ( )

◆ FindParentInventory()

Inventory Barotrauma.Item.FindParentInventory ( Func< Inventory, bool >  predicate)

◆ FlipX()

override void Barotrauma.Item.FlipX ( bool  relativeToSub)
virtual

Flip the entity horizontally

Parameters
relativeToSubShould the entity be flipped across the y-axis of the sub it's inside

Reimplemented from Barotrauma.MapEntity.

Definition at line 2515 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ FlipY()

override void Barotrauma.Item.FlipY ( bool  relativeToSub)
virtual

Flip the entity vertically

Parameters
relativeToSubShould the entity be flipped across the x-axis of the sub it's inside

Reimplemented from Barotrauma.MapEntity.

Definition at line 2544 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ ForceHUDLayoutUpdate()

void Barotrauma.Item.ForceHUDLayoutUpdate ( bool  ignoreLocking = false)

◆ GetComponent< T >()

T Barotrauma.Item.GetComponent< T > ( )
Type Constraints
T :ItemComponent 

Definition at line 1467 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ GetComponentIndex()

int Barotrauma.Item.GetComponentIndex ( ItemComponent  component)

◆ GetComponents< T >()

IEnumerable<T> Barotrauma.Item.GetComponents< T > ( )

◆ GetComponentString()

object Barotrauma.Item.GetComponentString ( string  component)

Definition at line 60 of file LuaBarotraumaAdditions.cs.

◆ GetConnectedComponents< T >()

List<T> Barotrauma.Item.GetConnectedComponents< T > ( bool  recursive = false,
bool  allowTraversingBackwards = true,
Func< Connection, bool >  connectionFilter = null 
)

Note: This function generates garbage and might be a bit too heavy to be used once per frame.

Type Constraints
T :ItemComponent 

Definition at line 2576 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ GetConnectedComponentsRecursive< T >()

List<T> Barotrauma.Item.GetConnectedComponentsRecursive< T > ( Connection  c,
bool  ignoreInactiveRelays = false,
bool  allowTraversingBackwards = true 
)

Note: This function generates garbage and might be a bit too heavy to be used once per frame.

Type Constraints
T :ItemComponent 

Definition at line 2622 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ GetContainedItemConditionPercentage()

float Barotrauma.Item.GetContainedItemConditionPercentage ( )

◆ GetDrawDepth()

float Barotrauma.Item.GetDrawDepth ( )

Definition at line 130 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ GetHUDTexts()

List<ColoredText> Barotrauma.Item.GetHUDTexts ( Character  character,
bool  recreateHudTexts = true 
)

◆ GetInventoryIconColor()

Color Barotrauma.Item.GetInventoryIconColor ( )

Definition at line 172 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ GetProperties< T >()

List<(object obj, SerializableProperty property)> Barotrauma.Item.GetProperties< T > ( )

◆ GetQualityModifier()

float Barotrauma.Item.GetQualityModifier ( Quality.StatType  statType)

◆ GetRootInventoryOwner()

Entity Barotrauma.Item.GetRootInventoryOwner ( )

◆ GetSpriteColor()

Color Barotrauma.Item.GetSpriteColor ( Color defaultColor = null,
bool  withHighlight = false 
)

Definition at line 135 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ GetTags()

IReadOnlyCollection<Identifier> Barotrauma.Item.GetTags ( )

◆ GetTransformedQuad()

override Quad2D Barotrauma.Item.GetTransformedQuad ( )
virtual

Reimplemented from Barotrauma.MapEntity.

◆ HasAccess()

bool Barotrauma.Item.HasAccess ( Character  character)

Used by the AI to check whether they can (in principle) and are allowed (in practice) to interact with an object or not. Unlike CanInteractWith(), this method doesn't check the distance, the triggers, or anything like that.

Definition at line 1743 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ HasIdentifierOrTags()

bool Barotrauma.Item.HasIdentifierOrTags ( IEnumerable< Identifier identifiersOrTags)

◆ HasTag() [1/2]

bool Barotrauma.Item.HasTag ( Identifier  tag)

◆ HasTag() [2/2]

bool Barotrauma.Item.HasTag ( IEnumerable< Identifier allowedTags)

◆ IgnoreByAI()

bool Barotrauma.Item.IgnoreByAI ( Character  character)

Implements Barotrauma.IIgnorable.

◆ InitSpriteStates()

void Barotrauma.Item.InitSpriteStates ( )

Definition at line 232 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ IsContainerPreferred()

bool Barotrauma.Item.IsContainerPreferred ( ItemContainer  container,
out bool  isPreferencesDefined,
out bool  isSecondary,
bool  requireConditionRestriction = false 
)

◆ IsInsideTrigger() [1/2]

bool Barotrauma.Item.IsInsideTrigger ( Vector2  worldPosition)

◆ IsInsideTrigger() [2/2]

bool Barotrauma.Item.IsInsideTrigger ( Vector2  worldPosition,
out Rectangle  transformedTrigger 
)

◆ IsInteractable()

bool Barotrauma.Item.IsInteractable ( Character  character)

Returns interactibility based on whether the character is on a player team

Definition at line 366 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ IsMouseOn()

override bool Barotrauma.Item.IsMouseOn ( Vector2  position)
virtual

Reimplemented from Barotrauma.MapEntity.

Definition at line 822 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ IsOwnedBy()

bool Barotrauma.Item.IsOwnedBy ( Entity  entity)

◆ IsVisible()

override bool Barotrauma.Item.IsVisible ( Rectangle  worldView)
virtual

Reimplemented from Barotrauma.MapEntity.

Definition at line 261 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ Load() [1/2]

static Item Barotrauma.Item.Load ( ContentXElement  element,
Submarine  submarine,
bool  createNetworkEvent,
IdRemap  idRemap 
)
static

Instantiate a new item and load its data from the XML element.

Parameters
elementThe element containing the data of the item
submarineThe submarine to spawn the item in (can be null)
createNetworkEventShould an EntitySpawner event be created to notify clients about the item being created.
Returns

Definition at line 3730 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Load() [2/2]

static Item Barotrauma.Item.Load ( ContentXElement  element,
Submarine  submarine,
IdRemap  idRemap 
)
static

◆ Move()

override void Barotrauma.Item.Move ( Vector2  amount,
bool  ignoreContacts = true 
)
virtual

Reimplemented from Barotrauma.MapEntity.

Definition at line 1597 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ OnMapLoaded()

override void Barotrauma.Item.OnMapLoaded ( )
virtual

Reimplemented from Barotrauma.MapEntity.

Definition at line 4079 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ OnPlayerSkillsChanged()

void Barotrauma.Item.OnPlayerSkillsChanged ( )

◆ ReadSpawnData()

static Item Barotrauma.Item.ReadSpawnData ( IReadMessage  msg,
bool  spawn = true 
)
static

◆ RecalculateConditionValues()

void Barotrauma.Item.RecalculateConditionValues ( )

Recalculates the item's maximum condition, condition percentage and whether it's in full condition. You generally never need to call this manually - done automatically when any of the factors that affect the values change.

Definition at line 2103 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Remove()

override void Barotrauma.Item.Remove ( )
virtual

Reimplemented from Barotrauma.Entity.

Definition at line 4112 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ RemoveByPrefab()

static void Barotrauma.Item.RemoveByPrefab ( ItemPrefab  prefab)
static

◆ RemoveContained()

void Barotrauma.Item.RemoveContained ( Item  contained)

◆ ReplaceTag() [1/2]

void Barotrauma.Item.ReplaceTag ( Identifier  tag,
Identifier  newTag 
)

◆ ReplaceTag() [2/2]

void Barotrauma.Item.ReplaceTag ( string  tag,
string  newTag 
)

◆ Reset()

virtual void Barotrauma.Item.Reset ( )
virtual

◆ ResetCachedVisibleSize()

void Barotrauma.Item.ResetCachedVisibleSize ( )

Definition at line 256 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ ResetWaterDragCoefficient()

void Barotrauma.Item.ResetWaterDragCoefficient ( )

Removes the override value -> falls back to using the original value defined in the xml.

◆ Save()

override XElement Barotrauma.Item.Save ( XElement  parentElement)
virtual

Reimplemented from Barotrauma.MapEntity.

Definition at line 3990 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ SecondaryUse()

void Barotrauma.Item.SecondaryUse ( float  deltaTime,
Character  character = null 
)

◆ SendPendingNetworkUpdates()

void Barotrauma.Item.SendPendingNetworkUpdates ( )

◆ SendSignal() [1/3]

void Barotrauma.Item.SendSignal ( Signal  signal,
Connection  connection 
)

◆ SendSignal() [2/3]

void Barotrauma.Item.SendSignal ( Signal  signal,
string  connectionName 
)

◆ SendSignal() [3/3]

void Barotrauma.Item.SendSignal ( string  signal,
string  connectionName 
)

◆ SetActiveSprite()

void Barotrauma.Item.SetActiveSprite ( )

◆ SetContainedItemPositions()

void Barotrauma.Item.SetContainedItemPositions ( )

◆ SetTransform()

void Barotrauma.Item.SetTransform ( Vector2  simPosition,
float  rotation,
bool  findNewHull = true,
bool  setPrevTransform = true 
)

◆ ShallowRemove()

override void Barotrauma.Item.ShallowRemove ( )
virtual

Remove the item so that it doesn't appear to exist in the game world (stop sounds, remove bodies etc) but don't reset anything that's required for cloning the item

Reimplemented from Barotrauma.MapEntity.

Definition at line 4093 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ ToString()

override string Barotrauma.Item.ToString ( )

Definition at line 961 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ TransformTrigger()

Rectangle Barotrauma.Item.TransformTrigger ( Rectangle  trigger,
bool  world = false 
)

◆ TryFindController()

bool Barotrauma.Item.TryFindController ( out Controller  controller,
ImmutableArray< Identifier >?  tags = null 
)

◆ TryInteract()

bool Barotrauma.Item.TryInteract ( Character  user,
bool  ignoreRequiredItems = false,
bool  forceSelectKey = false,
bool  forceUseKey = false 
)

◆ Unequip()

void Barotrauma.Item.Unequip ( Character  character)

◆ Update()

override void Barotrauma.Item.Update ( float  deltaTime,
Camera  cam 
)
virtual

Reimplemented from Barotrauma.MapEntity.

Definition at line 2162 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ UpdateEditing()

override void Barotrauma.Item.UpdateEditing ( Camera  cam,
float  deltaTime 
)
virtual

Reimplemented from Barotrauma.MapEntity.

Definition at line 758 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ UpdateHUD()

void Barotrauma.Item.UpdateHUD ( Camera  cam,
Character  character,
float  deltaTime 
)

◆ UpdateHulls()

static void Barotrauma.Item.UpdateHulls ( )
static

goes through every item and re-checks which hull they are in

Definition at line 1655 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ UpdatePendingConditionUpdates()

static void Barotrauma.Item.UpdatePendingConditionUpdates ( float  deltaTime)
static

◆ UpdateSpriteStates()

void Barotrauma.Item.UpdateSpriteStates ( float  deltaTime)

Definition at line 704 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ UpdateTransform()

void Barotrauma.Item.UpdateTransform ( )

◆ Use()

void Barotrauma.Item.Use ( float  deltaTime,
Character  user = null,
Limb  targetLimb = null,
Entity  useTarget = null,
Character  userForOnUsedEvent = null 
)
Parameters
userForOnUsedEventUser to pass to the OnUsed event. May need to be different than the user in cases like loaders using ammo boxes: the box is technically being used by the loader, and doesn't allow a character to use it, but we may still need to know which character caused the box to be used.

Definition at line 3062 of file BarotraumaShared/SharedSource/Items/Item.cs.

Member Data Documentation

◆ AvailableSwaps

readonly HashSet<ItemPrefab> Barotrauma.Item.AvailableSwaps = new HashSet<ItemPrefab>()

Definition at line 959 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ body

PhysicsBody Barotrauma.Item.body

Definition at line 115 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ connectionPairs

readonly ImmutableArray<(Identifier Input, Identifier Output)> Barotrauma.Item.connectionPairs
static
Initial value:
= new (Identifier, Identifier)[]
{
("power_in".ToIdentifier(), "power_out".ToIdentifier()),
("signal_in1".ToIdentifier(), "signal_out1".ToIdentifier()),
("signal_in2".ToIdentifier(), "signal_out2".ToIdentifier()),
("signal_in3".ToIdentifier(), "signal_out3".ToIdentifier()),
("signal_in4".ToIdentifier(), "signal_out4".ToIdentifier()),
("signal_in".ToIdentifier(), "signal_out".ToIdentifier()),
("signal_in1".ToIdentifier(), "signal_out".ToIdentifier()),
("signal_in2".ToIdentifier(), "signal_out".ToIdentifier())
}.ToImmutableArray()

Definition at line 2631 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ DrawDepthOffset

float Barotrauma.Item.DrawDepthOffset

Definition at line 64 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ HighlightColor

Color? Barotrauma.Item.HighlightColor

Definition at line 559 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ ImpactSoundInterval

const float Barotrauma.Item.ImpactSoundInterval = 0.2f
static

Definition at line 56 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ IsSalvageMissionItem

bool Barotrauma.Item.IsSalvageMissionItem

Definition at line 749 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ ItemList

readonly List<Item> Barotrauma.Item.ItemList = new List<Item>()
static

Definition at line 27 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ LastImpactSoundTime

float Barotrauma.Item.LastImpactSoundTime

Definition at line 55 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ OnDeselect

Action<Character> Barotrauma.Item.OnDeselect

◆ OnInteract

Action Barotrauma.Item.OnInteract

Definition at line 187 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ OwnInventories

readonly ImmutableArray<ItemInventory> Barotrauma.Item.OwnInventories = ImmutableArray<ItemInventory>.Empty

Definition at line 907 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ ShowItems

bool Barotrauma.Item.ShowItems = true
static

Definition at line 18 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ ShowLinks

bool Barotrauma.Item.ShowLinks = true
static

Definition at line 56 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ spriteColor

Color Barotrauma.Item.spriteColor
protected

Definition at line 488 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ SpriteEffects

SpriteEffects Barotrauma.Item.SpriteEffects = SpriteEffects.None

Definition at line 96 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ StaticBodyConfig

readonly XElement Barotrauma.Item.StaticBodyConfig

Definition at line 144 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ StaticFixtures

List<Fixture> Barotrauma.Item.StaticFixtures = new List<Fixture>()

Definition at line 146 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ StolenDuringRound

bool Barotrauma.Item.StolenDuringRound

Definition at line 724 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Visible

bool Barotrauma.Item.Visible = true

Definition at line 93 of file BarotraumaShared/SharedSource/Items/Item.cs.

Property Documentation

◆ ActiveHUDs

IEnumerable<ItemComponent> Barotrauma.Item.ActiveHUDs
get

Definition at line 53 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ AllowDeconstruct

bool Barotrauma.Item.AllowDeconstruct
getset

Definition at line 715 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ AllowedSlots

IEnumerable<InvSlotType> Barotrauma.Item.AllowedSlots
get

Definition at line 858 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ AllowStealing

bool Barotrauma.Item.AllowStealing
getset

Definition at line 743 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ AllowSwapping

bool Barotrauma.Item.AllowSwapping
getset

Definition at line 339 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ AllPropertyObjects

IReadOnlyList<ISerializableEntity> Barotrauma.Item.AllPropertyObjects
get

Definition at line 967 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ BodyType

BodyType??? Barotrauma.Item.BodyType
getset

Can be used by StatusEffects to set the type of the body (if the item has one)

Definition at line 127 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ CampaignInteractionType

CampaignMode.InteractionType Barotrauma.Item.CampaignInteractionType
get

Definition at line 78 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ CleanableItems

IReadOnlyCollection<Item> Barotrauma.Item.CleanableItems
staticget

Items that may potentially need to be cleaned up (pickable, not attached to a wall, and not inside a valid container)

Definition at line 45 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Color

Color Barotrauma.Item.Color
get

Definition at line 634 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Components

List<ItemComponent> Barotrauma.Item.Components
get

Definition at line 919 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Condition

float Barotrauma.Item.Condition
getset

Definition at line 684 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ ConditionIncreasedRecently

bool Barotrauma.Item.ConditionIncreasedRecently
get

Return true if the condition of this item increased within the last second.

Definition at line 698 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ ConditionPercentage

float Barotrauma.Item.ConditionPercentage
get

Definition at line 641 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ ConfigFilePath

ContentPath Barotrauma.Item.ConfigFilePath
get

Definition at line 854 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Connections

List<Connection> Barotrauma.Item.Connections
get

Definition at line 866 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ ContainedItems

IEnumerable<Item> Barotrauma.Item.ContainedItems
get

Definition at line 876 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Container

Item Barotrauma.Item.Container
get

Definition at line 263 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ ContainerColor

Color Barotrauma.Item.ContainerColor
getprotected set

Definition at line 505 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ ContainerIdentifier

Identifier??????? Barotrauma.Item.ContainerIdentifier
get

Can be used by status effects or conditionals to check what item this item is contained inside

Definition at line 514 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ CurrentHull

Hull Barotrauma.Item.CurrentHull
getset

Definition at line 63 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ DangerousItems

IReadOnlyCollection<Item> Barotrauma.Item.DangerousItems
staticget

Definition at line 31 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ DefaultRect

Rectangle Barotrauma.Item.DefaultRect
getset

Unscaled rect

Definition at line 169 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Description

string?? Barotrauma.Item.Description
getset

Definition at line 284 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ DescriptionTag

string? Barotrauma.Item.DescriptionTag
getset

Can be used to set a localized description via StatusEffects

Definition at line 296 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ DisplaySideBySideWhenLinked

bool Barotrauma.Item.DisplaySideBySideWhenLinked
getset

Definition at line 912 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ DrawBelowWater

override bool Barotrauma.Item.DrawBelowWater
get

Definition at line 96 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ DrawOverWater

override bool Barotrauma.Item.DrawOverWater
get

Definition at line 98 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ DroppedStack

IEnumerable<Item> Barotrauma.Item.DroppedStack
get

◆ EditableWhenEquipped

bool Barotrauma.Item.EditableWhenEquipped = false
getset

Definition at line 221 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ FakeBroken

bool Barotrauma.Item.FakeBroken
getset

Definition at line 67 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ FireProof

bool Barotrauma.Item.FireProof
get

Definition at line 791 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ FullyInitialized

bool Barotrauma.Item.FullyInitialized
get

Has everything in the item been loaded/instantiated/initialized (basically, can be used to check if the whole constructor/Load method has run). Most commonly used to avoid creating network events when some value changes if the item is being initialized.

Definition at line 113 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ HasBallastFloraInHull

bool? Barotrauma.Item.HasBallastFloraInHull
get

Definition at line 975 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Health

float Barotrauma.Item.Health
get

Definition at line 700 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ HealthMultiplier

float Barotrauma.Item.HealthMultiplier
getset

Definition at line 655 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ HullOxygenPercentage

float??? Barotrauma.Item.HullOxygenPercentage
get

Definition at line 72 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ IconStyle

GUIComponentStyle Barotrauma.Item.IconStyle
get

Definition at line 28 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ ImpactTolerance

float Barotrauma.Item.ImpactTolerance
get

Definition at line 415 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ InBeaconStation

bool Barotrauma.Item.InBeaconStation
get

Definition at line 993 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Indestructible

bool?? Barotrauma.Item.Indestructible
getset

Per-instance value - if not set, the value of the prefab is used.

Definition at line 709 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Infector

BallastFloraBranch Barotrauma.Item.Infector
getset

Definition at line 955 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ InPlayerSubmarine

bool Barotrauma.Item.InPlayerSubmarine
get

Definition at line 992 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ InteractDistance

float Barotrauma.Item.InteractDistance
get

Definition at line 420 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ InteractionRect

Rectangle Barotrauma.Item.InteractionRect
get

Definition at line 446 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ InteractPriority

float Barotrauma.Item.InteractPriority
get

Definition at line 425 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ InventoryIconColor

Color Barotrauma.Item.InventoryIconColor
getprotected set

Definition at line 497 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ InvulnerableToDamage

bool Barotrauma.Item.InvulnerableToDamage
getset

Definition at line 722 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ InWater

bool Barotrauma.Item.InWater
get

Definition at line 832 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ IsClaimedByBallastFlora

bool? Barotrauma.Item.IsClaimedByBallastFlora
get

Definition at line 983 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ IsContained

bool Barotrauma.Item.IsContained
get

Can be used by status effects or conditionals to check whether the item is contained inside something

Definition at line 528 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ IsFullCondition

bool Barotrauma.Item.IsFullCondition
get

Definition at line 639 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ IsLadder

bool Barotrauma.Item.IsLadder
get

Definition at line 995 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ IsPlayerTeamInteractable

bool Barotrauma.Item.IsPlayerTeamInteractable
get

◆ IsSecondaryItem

bool Barotrauma.Item.IsSecondaryItem
get

Definition at line 997 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ IsShootable

bool Barotrauma.Item.IsShootable
getset

Should the item's Use method be called with the "Use" or with the "Shoot" key?

Definition at line 614 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ LastEatenTime

float Barotrauma.Item.LastEatenTime
getset

Timing.TotalTimeUnpaused when some character was last eating the item

Definition at line 1012 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ LastSentSignalRecipients

List<Connection> Barotrauma.Item.LastSentSignalRecipients = new List<Connection>(20)
get

A list of connections the last signal sent by this item went through

Definition at line 848 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Linkable

override bool Barotrauma.Item.Linkable
get

Definition at line 924 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ MaxCondition

float Barotrauma.Item.MaxCondition
get

Definition at line 640 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ MaxRepairConditionMultiplier

float Barotrauma.Item.MaxRepairConditionMultiplier
getset

Definition at line 671 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Name

override string Barotrauma.Item.Name
get

Definition at line 278 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ NonInteractable

bool Barotrauma.Item.NonInteractable
getset

Definition at line 322 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ NonPlayerTeamInteractable

bool Barotrauma.Item.NonPlayerTeamInteractable
getset

Use IsPlayerInteractable to also check NonInteractable

Definition at line 332 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ OffsetOnSelectedMultiplier

float Barotrauma.Item.OffsetOnSelectedMultiplier
getset

Definition at line 646 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ OrderedToBeIgnored

bool Barotrauma.Item.OrderedToBeIgnored
getset

Definition at line 973 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ OriginalOutpost

string???? Barotrauma.Item.OriginalOutpost
getset

Definition at line 753 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ OwnInventory

ItemInventory Barotrauma.Item.OwnInventory
get

Definition at line 902 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ ParentInventory

Inventory Barotrauma.Item.ParentInventory
getset

Definition at line 224 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ PendingItemSwap

ItemPrefab Barotrauma.Item.PendingItemSwap
getset

Definition at line 957 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ PhysicsBodyActive

bool Barotrauma.Item.PhysicsBodyActive
get

Can be used by status effects or conditionals to check if the physics body of the item is active

Definition at line 582 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Position

override Vector2? Barotrauma.Item.Position
get

Definition at line 430 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ PositionUpdateInterval

float Barotrauma.Item.PositionUpdateInterval = float.PositiveInfinity
getset

Definition at line 482 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ PositionX

float Barotrauma.Item.PositionX
get

Can be used to move the item from XML (e.g. to correct the positions of items whose sprite origin has been changed)

Definition at line 935 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ PositionY

float Barotrauma.Item.PositionY
get

Can be used to move the item from XML (e.g. to correct the positions of items whose sprite origin has been changed)

Definition at line 946 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Prefab

new ItemPrefab Barotrauma.Item.Prefab
get

Definition at line 54 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ PurchasedNewSwap

bool Barotrauma.Item.PurchasedNewSwap
getset

Definition at line 346 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Quality

int??? Barotrauma.Item.Quality
getset

Definition at line 817 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Rect

override Rectangle Barotrauma.Item.Rect
getset

Definition at line 86 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ RepairableItems

IReadOnlyCollection<Item> Barotrauma.Item.RepairableItems
staticget

Items that have one more more Repairable component

Definition at line 38 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Repairables

List<Repairable> Barotrauma.Item.Repairables
get

Definition at line 914 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ RequireAimToSecondaryUse

bool Barotrauma.Item.RequireAimToSecondaryUse
getset

If true, the user has to hold the "aim" key before secondary use is registered. True by default.

Definition at line 629 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ RequireAimToUse

bool Barotrauma.Item.RequireAimToUse
getset

If true, the user has to hold the "aim" key before use is registered. False by default.

Definition at line 620 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ RootContainer

Item Barotrauma.Item.RootContainer
get

Definition at line 245 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Rotation

float Barotrauma.Item.Rotation
getset

Definition at line 388 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ RotationRad

float Barotrauma.Item.RotationRad
get

Definition at line 385 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Scale

override float?? Barotrauma.Item.Scale
getset

Definition at line 455 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ SelectableInEditor

override bool Barotrauma.Item.SelectableInEditor
get

Definition at line 115 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ SerializableProperties

Dictionary<Identifier, SerializableProperty> Barotrauma.Item.SerializableProperties
getprotected set

Definition at line 189 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ SightRange

new float? Barotrauma.Item.SightRange
getset

Can be used by status effects or conditionals to modify the sight range

Definition at line 604 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ SimPosition

override Vector2? Barotrauma.Item.SimPosition
get

Definition at line 438 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ SonarLabel

string????? Barotrauma.Item.SonarLabel
getset

Can be used to modify the AITarget's label using status effects

Definition at line 566 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ SonarVisibleItems

IReadOnlyCollection<Item> Barotrauma.Item.SonarVisibleItems
staticget

Items whose ItemPrefab.SonarSize is larger than 0

Definition at line 52 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ SoundRange

new float? Barotrauma.Item.SoundRange
getset

Can be used by status effects or conditionals to modify the sound range

Definition at line 594 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ SpawnedInCurrentOutpost

bool?? Barotrauma.Item.SpawnedInCurrentOutpost
getset

Definition at line 727 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Speed

float? Barotrauma.Item.Speed
get

Can be used by status effects or conditionals to the speed of the item

Definition at line 539 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ Sprite

override Sprite Barotrauma.Item.Sprite
get

Definition at line 81 of file BarotraumaClient/ClientSource/Items/Item.cs.

◆ SpriteColor

Color Barotrauma.Item.SpriteColor
getset

Definition at line 490 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ StatManager

ItemStatManager Barotrauma.Item.StatManager
get

◆ Tags

string Barotrauma.Item.Tags
getset

Definition at line 769 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ UseInHealthInterface

bool Barotrauma.Item.UseInHealthInterface
get

Definition at line 812 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ WaterDragCoefficient

float?? Barotrauma.Item.WaterDragCoefficient
getset

Definition at line 118 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ WaterProof

bool Barotrauma.Item.WaterProof
get

Definition at line 798 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ WorldPositionX

float Barotrauma.Item.WorldPositionX
get

Definition at line 929 of file BarotraumaShared/SharedSource/Items/Item.cs.

◆ WorldPositionY

float Barotrauma.Item.WorldPositionY
get

Definition at line 930 of file BarotraumaShared/SharedSource/Items/Item.cs.