Barotrauma Client
|
Classes | |
struct | ApplyStatusEffectEventData |
struct | ChangePropertyEventData |
struct | ComponentStateEventData |
interface | IEventData |
struct | InventoryStateEventData |
struct | SetItemStatEventData |
Public Types | |
enum | 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. | |
bool | IsInteractable (Character character) |
Returns interactibility based on whether the character is on a player team. | |
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. | |
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) |
T | 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. | |
void | SetActiveSprite () |
void | CheckCleanable () |
Recheck if the item needs to be included in the list of cleanable items. | |
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. | |
bool | IsOwnedBy (Entity entity) |
Entity | GetRootInventoryOwner () |
Inventory | FindParentInventory (Func< Inventory, bool > predicate) |
void | SetContainedItemPositions () |
void | AddTag (string tag) |
void | AddTag (Identifier tag) |
void | RemoveTag (Identifier tag) |
bool | HasTag (Identifier tag) |
bool | HasIdentifierOrTags (IEnumerable< Identifier > identifiersOrTags) |
void | ReplaceTag (string tag, string newTag) |
void | ReplaceTag (Identifier tag, Identifier newTag) |
IReadOnlyCollection< Identifier > | GetTags () |
bool | HasTag (IEnumerable< Identifier > allowedTags) |
bool | ConditionalMatches (PropertyConditional conditional) |
bool | ConditionalMatches (PropertyConditional conditional, bool checkContainer) |
void | ApplyStatusEffects (ActionType type, float deltaTime, Character character=null, Limb limb=null, Entity useTarget=null, bool isNetworkEvent=false, Vector2? worldPosition=null) |
Executes all StatusEffects of the specified type. Note that condition checks are ignored here: that should be handled by the code calling the method. | |
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. | |
void | SendPendingNetworkUpdates () |
void | CreateStatusEvent (bool loadingRound) |
override void | Update (float deltaTime, Camera cam) |
void | UpdateTransform () |
override void | FlipX (bool relativeToSub) |
Flip the entity horizontally. | |
override void | FlipY (bool relativeToSub) |
Flip the entity vertically. | |
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. | |
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. | |
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. | |
IEnumerable< Item > | GetStackedItems () |
Returns this item and all the other items in the stack (either in the same inventory slot, or the same dropped stack). | |
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. | |
override void | Remove () |
object | GetComponentString (string component) |
![]() | |
void | AddLinked (MapEntity entity) |
MapEntity (MapEntityPrefab prefab, Submarine submarine, ushort id) | |
void | ResolveLinks (IdRemap childRemap) |
virtual bool | IsMouseOn (Vector2 position) |
bool | HasUpgrade (Identifier identifier) |
Upgrade | GetUpgrade (Identifier identifier) |
List< Upgrade > | GetUpgrades () |
void | SetUpgrade (Upgrade upgrade, bool createNetworkEvent=false) |
virtual bool | AddUpgrade (Upgrade upgrade, bool createNetworkEvent=false) |
Adds a new upgrade to the item. | |
MapEntity | Clone () |
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. | |
![]() | |
Entity (Submarine submarine, ushort id) | |
void | FreeID () |
Removes the entity from the entity dictionary and frees up the ID it was using. | |
![]() | |
![]() |
Static Public Member Functions | |
static void | UpdateHulls () |
goes through every item and re-checks which hull they are in | |
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. | |
static void | RemoveByPrefab (ItemPrefab prefab) |
![]() | |
static void | ClearHighlightedEntities () |
static List< MapEntity > | Clone (List< MapEntity > entitiesToClone) |
static void | UpdateAll (float deltaTime, Camera cam) |
Call Update() on every object in Entity.list. | |
static List< MapEntity > | LoadAll (Submarine submarine, XElement parentElement, string filePath, int idOffset) |
static void | MapLoaded (List< MapEntity > entities, bool updateHulls) |
static void | InitializeLoadedLinks (IEnumerable< MapEntity > entities) |
![]() | |
static IReadOnlyCollection< Entity > | GetEntities () |
static int | FindFreeIdBlock (int minBlockSize) |
Finds a contiguous block of free IDs of at least the given size. | |
static Entity | FindEntityByID (ushort ID) |
Find an entity based on the ID. | |
static void | RemoveAll () |
static void | DumpIds (int count, string filename) |
Public Attributes | |
bool | Visible = true |
PhysicsBody | body |
readonly XElement | StaticBodyConfig |
List< Fixture > | StaticFixtures = new List<Fixture>() |
Action | OnInteract |
Character | Equipper |
Which character equipped this item? May not be the same character as the one who it's equipped on (you can e.g. equip diving masks on another character). | |
Color? | HighlightColor |
bool | StolenDuringRound |
Was the item stolen during the current round. Note that it's possible for the items to be found in the player's inventory even though they weren't actually stolen. For example, a guard can place handcuffs there. So use Illegitimate for checking if the item is illegitimately held. | |
bool | IsSalvageMissionItem |
readonly ImmutableArray< ItemInventory > | OwnInventories = ImmutableArray<ItemInventory>.Empty |
readonly HashSet< ItemPrefab > | AvailableSwaps = new HashSet<ItemPrefab>() |
Action< Character > | OnDeselect |
![]() | |
readonly MapEntityPrefab | Prefab |
List< ushort > | unresolvedLinkedToID |
readonly HashSet< Identifier > | DisallowedUpgradeSet = new HashSet<Identifier>() |
readonly List< MapEntity > | linkedTo = 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) | |
int | OriginalContainerIndex = -1 |
![]() | |
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. | |
readonly string | CreationStackTrace |
readonly UInt64 | CreationIndex |
Static Public Attributes | |
static readonly List< Item > | ItemList = new List<Item>() |
static bool | ShowLinks = true |
static readonly ImmutableArray<(Identifier Input, Identifier Output)> | connectionPairs |
![]() | |
static readonly List< MapEntity > | MapEntityList = new List<MapEntity>() |
static int | MapEntityUpdateInterval = 1 |
static int | PoweredUpdateInterval = 1 |
![]() | |
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 Attributes | |
Color | spriteColor |
![]() | |
List< ushort > | linkedToID |
readonly List< Upgrade > | Upgrades = new List<Upgrade>() |
List of upgrades this item has. | |
bool | flippedX |
bool | flippedY |
Rectangle | rect |
![]() | |
AITarget | aiTarget |
Properties | |
static IReadOnlyCollection< Item > | DangerousItems [get] |
static IReadOnlyCollection< Item > | RepairableItems [get] |
Items that have one more more Repairable component. | |
static IReadOnlyCollection< Item > | CleanableItems [get] |
Items that may potentially need to be cleaned up (pickable, not attached to a wall, and not inside a valid container) | |
static HashSet< Item > | DeconstructItems [get] |
Items that have been marked for deconstruction. | |
static IReadOnlyCollection< Item > | SonarVisibleItems [get] |
Items whose ItemPrefab.SonarSize is larger than 0. | |
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. | |
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) | |
Rectangle | DefaultRect [get, set] |
Unscaled rect. | |
Dictionary< Identifier, SerializableProperty > | SerializableProperties [get, protected set] |
bool | EditableWhenEquipped = false [get, set] |
Inventory | ParentInventory [get, set] |
Item | RootContainer [get] |
Item | Container [get] |
override string | Name [get] |
Note that this is not a LocalizedString instance, just the current name of the item as a string. If you e.g. set this as the text in a textbox, it will not update automatically when the language is changed. If you want that to happen, use Prefab.Name instead. | |
string | Description [get, set] |
string | DescriptionTag [get, set] |
Can be used to set a localized description via StatusEffects. | |
bool | NonInteractable [get, set] |
bool | NonPlayerTeamInteractable [get, set] |
Use IsPlayerInteractable to also check NonInteractable | |
bool | AllowSwapping [get, set] |
bool | PurchasedNewSwap [get, set] |
bool | IsPlayerTeamInteractable [get] |
Checks both NonInteractable and NonPlayerTeamInteractable | |
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. | |
bool | IsContained [get] |
Can be used by status effects or conditionals to check whether the item is contained inside something. | |
float | Speed [get] |
Can be used by status effects or conditionals to the speed of the item. | |
string | SonarLabel [get, set] |
Can be used to modify the AITarget's label using status effects. | |
bool | PhysicsBodyActive [get] |
Can be used by status effects or conditionals to check if the physics body of the item is active. | |
new float | SoundRange [get, set] |
Can be used by status effects or conditionals to modify the sound range. | |
new float | SightRange [get, set] |
Can be used by status effects or conditionals to modify the sight range. | |
bool | IsShootable [get, set] |
Should the item's Use method be called with the "Use" or with the "Shoot" key? | |
bool | RequireAimToUse [get, set] |
If true, the user has to hold the "aim" key before use is registered. False by default. | |
bool | RequireAimToSecondaryUse [get, set] |
If true, the user has to hold the "aim" key before secondary use is registered. True by default. | |
bool | DontCleanUp [get, set] |
Can be set by status effects to prevent bots from cleaning up the item. | |
Color | Color [get] |
bool | IsFullCondition [get] |
float | MaxCondition [get] |
float | ConditionPercentage [get] |
float | ConditionPercentageRelativeToDefaultMaxCondition [get] |
Condition percentage disregarding MaxRepairConditionMultiplier (i.e. this can go above 100% if the item is repaired beyond the normal maximum) | |
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. | |
float | Health [get] |
bool | Indestructible [get, set] |
Per-instance value - if not set, the value of the prefab is used. | |
bool | AllowDeconstruct [get, set] |
bool | InvulnerableToDamage [get, set] |
bool | Illegitimate [get] |
Item shouldn't be in the player's inventory. If the guards find it, they will consider it as a theft. | |
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< Connection > | LastSentSignalRecipients = new List<Connection>(20) [get] |
A list of connections the last signal sent by this item went through. | |
ContentPath | ConfigFilePath [get] |
IEnumerable< InvSlotType > | AllowedSlots [get] |
List< Connection > | Connections [get] |
IEnumerable< Item > | ContainedItems [get] |
ItemInventory | OwnInventory [get] |
bool | DisplaySideBySideWhenLinked [get, set] |
List< Repairable > | Repairables [get] |
List< ItemComponent > | Components [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) | |
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) | |
BallastFloraBranch | Infector [get, set] |
ItemPrefab | PendingItemSwap [get, set] |
IReadOnlyList< ISerializableEntity > | AllPropertyObjects [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. | |
IEnumerable< Item > | DroppedStack [get] |
![]() | |
string | DisallowedUpgrades [get, set] |
bool | FlippedX [get] |
bool | FlippedY [get] |
static IEnumerable< MapEntity > | HighlightedEntities [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< Identifier > | AllowedLinks [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] |
bool | IsLayerHidden [get, set] |
Is the layer this entity is in currently hidden? If it is, the entity is not updated and should do nothing. | |
bool | IsHidden [get] |
Is the entity hidden due to HiddenInGame being enabled or the layer the entity is in being hidden? | |
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 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] |
Indetectable characters can't be spotted by AIs and aren't visible on the sonar or health scanner. | |
double | SpawnTime [get] |
string | ErrorLine [get] |
![]() | |
![]() | |
Vector2 | WorldPosition [get] |
![]() | |
![]() |
Additional Inherited Members | |
![]() | |
void | ParseLinks (XElement element, IdRemap idRemap) |
virtual void | CheckIsHighlighted () |
void | InsertToList () |
![]() | |
virtual ushort | DetermineID (ushort id, Submarine submarine) |
![]() | |
static readonly HashSet< MapEntity > | highlightedEntities = new HashSet<MapEntity>() |
Barotrauma.Item.Item | ( | ItemPrefab | itemPrefab, |
Vector2 | position, | ||
Submarine | submarine, | ||
ushort | id = Entity::NullEntityID, | ||
bool | callOnItemLoaded = true ) |
Barotrauma.Item.Item | ( | Rectangle | newRect, |
ItemPrefab | itemPrefab, | ||
Submarine | submarine, | ||
bool | callOnItemLoaded = true, | ||
ushort | id = Entity::NullEntityID ) |
Creates a new item.
callOnItemLoaded | Should 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). |
void Barotrauma.Item.AddComponent | ( | ItemComponent | component | ) |
AttackResult Barotrauma.Item.AddDamage | ( | Character | attacker, |
Vector2 | worldPosition, | ||
Attack | attack, | ||
Vector2 | impulseDirection, | ||
float | deltaTime, | ||
bool | playSound = true ) |
Implements Barotrauma.IDamageable.
void Barotrauma.Item.AddTag | ( | Identifier | tag | ) |
void Barotrauma.Item.AddTag | ( | string | tag | ) |
bool Barotrauma.Item.AllowDroppingOnSwapWith | ( | Item | otherItem | ) |
Is dropping the item allowed when trying to swap it with the other item.
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 ) |
void Barotrauma.Item.ApplyStatusEffects | ( | ActionType | type, |
float | deltaTime, | ||
Character | character = null, | ||
Limb | limb = null, | ||
Entity | useTarget = null, | ||
bool | isNetworkEvent = false, | ||
Vector2? | worldPosition = null ) |
Executes all StatusEffects of the specified type. Note that condition checks are ignored here: that should be handled by the code calling the method.
void Barotrauma.Item.AssignCampaignInteractionType | ( | CampaignMode.InteractionType | interactionType, |
IEnumerable< Client > | targetClients = null ) |
bool Barotrauma.Item.CanClientAccess | ( | Client | c | ) |
void Barotrauma.Item.CheckCleanable | ( | ) |
Recheck if the item needs to be included in the list of cleanable items.
override MapEntity Barotrauma.Item.Clone | ( | ) |
bool Barotrauma.Item.ConditionalMatches | ( | PropertyConditional | conditional | ) |
bool Barotrauma.Item.ConditionalMatches | ( | PropertyConditional | conditional, |
bool | checkContainer ) |
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.
void Barotrauma.Item.CreateStatusEvent | ( | bool | loadingRound | ) |
void Barotrauma.Item.DisableDrawableComponent | ( | IDrawableComponent | drawable | ) |
void Barotrauma.Item.Drop | ( | Character | dropper, |
bool | createNetworkEvent = true, | ||
bool | setTransform = true ) |
dropper | Character who dropped the item |
createNetworkEvent | Should clients be notified of the item being dropped |
setTransform | Should 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! |
void Barotrauma.Item.EnableDrawableComponent | ( | IDrawableComponent | drawable | ) |
void Barotrauma.Item.Equip | ( | Character | character | ) |
Controller Barotrauma.Item.FindController | ( | ImmutableArray< Identifier >? | tags = null | ) |
Hull Barotrauma.Item.FindHull | ( | ) |
|
virtual |
Flip the entity horizontally.
relativeToSub | Should the entity be flipped across the y-axis of the sub it's inside |
Reimplemented from Barotrauma.MapEntity.
|
virtual |
Flip the entity vertically.
relativeToSub | Should the entity be flipped across the x-axis of the sub it's inside |
Reimplemented from Barotrauma.MapEntity.
T Barotrauma.Item.GetComponent< T > | ( | ) |
T | : | ItemComponent |
int Barotrauma.Item.GetComponentIndex | ( | ItemComponent | component | ) |
IEnumerable< T > Barotrauma.Item.GetComponents< T > | ( | ) |
object Barotrauma.Item.GetComponentString | ( | string | component | ) |
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.
T | : | ItemComponent |
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.
T | : | ItemComponent |
float Barotrauma.Item.GetContainedItemConditionPercentage | ( | ) |
List<(object obj, SerializableProperty property)> Barotrauma.Item.GetProperties< T > | ( | ) |
float Barotrauma.Item.GetQualityModifier | ( | Quality.StatType | statType | ) |
Entity Barotrauma.Item.GetRootInventoryOwner | ( | ) |
IEnumerable< Item > Barotrauma.Item.GetStackedItems | ( | ) |
Returns this item and all the other items in the stack (either in the same inventory slot, or the same dropped stack).
IReadOnlyCollection< Identifier > Barotrauma.Item.GetTags | ( | ) |
|
virtual |
Reimplemented from Barotrauma.MapEntity.
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.
bool Barotrauma.Item.HasIdentifierOrTags | ( | IEnumerable< Identifier > | identifiersOrTags | ) |
bool Barotrauma.Item.HasTag | ( | Identifier | tag | ) |
bool Barotrauma.Item.HasTag | ( | IEnumerable< Identifier > | allowedTags | ) |
bool Barotrauma.Item.IgnoreByAI | ( | Character | character | ) |
Implements Barotrauma.IIgnorable.
bool Barotrauma.Item.IsContainerPreferred | ( | ItemContainer | container, |
out bool | isPreferencesDefined, | ||
out bool | isSecondary, | ||
bool | requireConditionRestriction = false ) |
bool Barotrauma.Item.IsInsideTrigger | ( | Vector2 | worldPosition | ) |
bool Barotrauma.Item.IsInsideTrigger | ( | Vector2 | worldPosition, |
out Rectangle | transformedTrigger ) |
bool Barotrauma.Item.IsInteractable | ( | Character | character | ) |
Returns interactibility based on whether the character is on a player team.
bool Barotrauma.Item.IsOwnedBy | ( | Entity | entity | ) |
|
static |
Instantiate a new item and load its data from the XML element.
element | The element containing the data of the item |
submarine | The submarine to spawn the item in (can be null) |
createNetworkEvent | Should an EntitySpawner event be created to notify clients about the item being created. |
|
static |
|
virtual |
Reimplemented from Barotrauma.MapEntity.
|
virtual |
Reimplemented from Barotrauma.MapEntity.
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.
|
virtual |
Reimplemented from Barotrauma.Entity.
|
static |
void Barotrauma.Item.RemoveContained | ( | Item | contained | ) |
void Barotrauma.Item.RemoveTag | ( | Identifier | tag | ) |
void Barotrauma.Item.ReplaceTag | ( | Identifier | tag, |
Identifier | newTag ) |
void Barotrauma.Item.ReplaceTag | ( | string | tag, |
string | newTag ) |
|
virtual |
void Barotrauma.Item.ResetWaterDragCoefficient | ( | ) |
Removes the override value -> falls back to using the original value defined in the xml.
|
virtual |
Reimplemented from Barotrauma.MapEntity.
void Barotrauma.Item.SecondaryUse | ( | float | deltaTime, |
Character | character = null ) |
void Barotrauma.Item.SendPendingNetworkUpdates | ( | ) |
void Barotrauma.Item.SendSignal | ( | Signal | signal, |
Connection | connection ) |
void Barotrauma.Item.SendSignal | ( | Signal | signal, |
string | connectionName ) |
void Barotrauma.Item.SendSignal | ( | string | signal, |
string | connectionName ) |
void Barotrauma.Item.SetActiveSprite | ( | ) |
void Barotrauma.Item.SetContainedItemPositions | ( | ) |
void Barotrauma.Item.SetTransform | ( | Vector2 | simPosition, |
float | rotation, | ||
bool | findNewHull = true, | ||
bool | setPrevTransform = true ) |
|
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.
override string Barotrauma.Item.ToString | ( | ) |
Rectangle Barotrauma.Item.TransformTrigger | ( | Rectangle | trigger, |
bool | world = false ) |
bool Barotrauma.Item.TryFindController | ( | out Controller | controller, |
ImmutableArray< Identifier >? | tags = null ) |
bool Barotrauma.Item.TryInteract | ( | Character | user, |
bool | ignoreRequiredItems = false, | ||
bool | forceSelectKey = false, | ||
bool | forceUseKey = false ) |
void Barotrauma.Item.Unequip | ( | Character | character | ) |
|
virtual |
Reimplemented from Barotrauma.MapEntity.
|
static |
goes through every item and re-checks which hull they are in
|
static |
void Barotrauma.Item.UpdateTransform | ( | ) |
void Barotrauma.Item.Use | ( | float | deltaTime, |
Character | user = null, | ||
Limb | targetLimb = null, | ||
Entity | useTarget = null, | ||
Character | userForOnUsedEvent = null ) |
userForOnUsedEvent | User 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. |
readonly HashSet<ItemPrefab> Barotrauma.Item.AvailableSwaps = new HashSet<ItemPrefab>() |
PhysicsBody Barotrauma.Item.body |
|
static |
Character Barotrauma.Item.Equipper |
Which character equipped this item? May not be the same character as the one who it's equipped on (you can e.g. equip diving masks on another character).
Color? Barotrauma.Item.HighlightColor |
bool Barotrauma.Item.IsSalvageMissionItem |
Action<Character> Barotrauma.Item.OnDeselect |
Action Barotrauma.Item.OnInteract |
readonly ImmutableArray<ItemInventory> Barotrauma.Item.OwnInventories = ImmutableArray<ItemInventory>.Empty |
|
static |
|
protected |
readonly XElement Barotrauma.Item.StaticBodyConfig |
List<Fixture> Barotrauma.Item.StaticFixtures = new List<Fixture>() |
bool Barotrauma.Item.StolenDuringRound |
Was the item stolen during the current round. Note that it's possible for the items to be found in the player's inventory even though they weren't actually stolen. For example, a guard can place handcuffs there. So use Illegitimate for checking if the item is illegitimately held.
bool Barotrauma.Item.Visible = true |
|
getset |
|
get |
|
getset |
|
getset |
|
get |
|
getset |
Can be used by StatusEffects to set the type of the body (if the item has one)
|
get |
|
staticget |
Items that may potentially need to be cleaned up (pickable, not attached to a wall, and not inside a valid container)
|
get |
|
get |
|
getset |
|
get |
Return true if the condition of this item increased within the last second.
|
get |
|
get |
Condition percentage disregarding MaxRepairConditionMultiplier (i.e. this can go above 100% if the item is repaired beyond the normal maximum)
|
get |
|
get |
|
get |
|
get |
|
getprotected set |
|
get |
Can be used by status effects or conditionals to check what item this item is contained inside.
|
getset |
|
staticget |
|
staticget |
Items that have been marked for deconstruction.
|
getset |
Unscaled rect.
|
getset |
|
getset |
Can be used to set a localized description via StatusEffects.
|
getset |
|
getset |
Can be set by status effects to prevent bots from cleaning up the item.
|
get |
|
getset |
|
get |
|
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.
|
get |
|
get |
Implements Barotrauma.IDamageable.
|
getset |
|
get |
|
get |
Item shouldn't be in the player's inventory. If the guards find it, they will consider it as a theft.
|
get |
|
get |
|
getset |
Per-instance value - if not set, the value of the prefab is used.
|
getset |
|
get |
|
get |
|
get |
|
get |
|
getprotected set |
|
getset |
|
get |
|
get |
|
get |
Can be used by status effects or conditionals to check whether the item is contained inside something.
|
get |
|
get |
|
get |
Checks both NonInteractable and NonPlayerTeamInteractable
|
get |
|
getset |
Should the item's Use method be called with the "Use" or with the "Shoot" key?
|
getset |
Timing.TotalTimeUnpaused when some character was last eating the item.
|
get |
A list of connections the last signal sent by this item went through.
|
get |
|
get |
|
getset |
|
get |
Note that this is not a LocalizedString instance, just the current name of the item as a string. If you e.g. set this as the text in a textbox, it will not update automatically when the language is changed. If you want that to happen, use Prefab.Name instead.
Implements Barotrauma.ISerializableEntity.
|
getset |
|
getset |
Use IsPlayerInteractable to also check NonInteractable
|
getset |
|
getset |
Implements Barotrauma.IIgnorable.
|
getset |
|
get |
|
getset |
|
getset |
|
get |
Can be used by status effects or conditionals to check if the physics body of the item is active.
|
get |
Implements Barotrauma.ISpatialEntity.
|
getset |
|
get |
Can be used to move the item from XML (e.g. to correct the positions of items whose sprite origin has been changed)
|
get |
Can be used to move the item from XML (e.g. to correct the positions of items whose sprite origin has been changed)
|
get |
|
getset |
|
getset |
|
staticget |
Items that have one more more Repairable component.
|
get |
|
getset |
If true, the user has to hold the "aim" key before secondary use is registered. True by default.
|
getset |
If true, the user has to hold the "aim" key before use is registered. False by default.
|
get |
|
getset |
|
get |
|
getset |
|
getprotected set |
Implements Barotrauma.ISerializableEntity.
|
getset |
Can be used by status effects or conditionals to modify the sight range.
|
get |
Implements Barotrauma.ISpatialEntity.
|
getset |
Can be used to modify the AITarget's label using status effects.
|
staticget |
Items whose ItemPrefab.SonarSize is larger than 0.
|
getset |
Can be used by status effects or conditionals to modify the sound range.
|
getset |
|
get |
Can be used by status effects or conditionals to the speed of the item.
|
getset |
|
get |
|
getset |
|
get |
|
getset |
|
get |
|
get |
|
get |