Barotrauma Client
|
The base class for components holding the different functionalities of the item. More...
Classes | |
interface | IEventData |
Public Member Functions | |
readonly record struct | ItemUseInfo (Item Item, Character User) |
ItemComponent (Item item, ContentXElement element) | |
void | SetRequiredItems (ContentXElement element, bool allowEmpty=false) |
virtual void | Move (Vector2 amount, bool ignoreContacts=false) |
virtual bool | Pick (Character picker) |
a Character has picked the item | |
virtual bool | Select (Character character) |
virtual void | Drop (Character dropper, bool setTransform=true) |
a Character has dropped the item | |
virtual bool | CrewAIOperate (float deltaTime, Character character, AIObjectiveOperateItem objective) |
| |
virtual void | Update (float deltaTime, Camera cam) |
virtual void | UpdateBroken (float deltaTime, Camera cam) |
virtual bool | Use (float deltaTime, Character character=null) |
virtual bool | SecondaryUse (float deltaTime, Character character=null) |
virtual void | Equip (Character character) |
virtual void | Unequip (Character character) |
virtual void | ReceiveSignal (Signal signal, Connection connection) |
virtual bool | Combine (Item item, Character user) |
void | Remove () |
void | ShallowRemove () |
Remove the component 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. | |
bool | HasRequiredSkills (Character character) |
bool | HasRequiredSkills (Character character, out Skill insufficientSkill) |
virtual float | GetSkillMultiplier () |
float | DegreeOfSuccess (Character character) |
Returns 0.0f-1.0f based on how well the Character can use the itemcomponent. | |
float | DegreeOfSuccess (Character character, List< Skill > requiredSkills) |
Returns 0.0f-1.0f based on how well the Character can use the itemcomponent. | |
virtual void | FlipX (bool relativeToSub) |
virtual void | FlipY (bool relativeToSub) |
bool | IsEmpty (Character user) |
Returns true if the item is lacking required contained items, or if there's nothing with a non-zero condition inside. | |
bool | HasRequiredContainedItems (Character user, bool addMessage, LocalizedString msg=null) |
virtual bool | HasAccess (Character character) |
Only checks if any of the Picked requirements are matched (used for checking id card(s)). Much simpler and a bit different than HasRequiredItems. | |
virtual bool | HasRequiredItems (Character character, bool addMessage, LocalizedString msg=null) |
void | ApplyStatusEffects (ActionType type, float deltaTime, Character character=null, Limb targetLimb=null, Entity useTarget=null, Character user=null, Vector2? worldPosition=null, float afflictionMultiplier=1.0f) |
virtual void | Load (ContentXElement componentElement, bool usePrefabValues, IdRemap idRemap, bool isItemSwap) |
virtual void | OnMapLoaded () |
Called when all items have been loaded. Use to initialize connections between items. | |
virtual void | OnItemLoaded () |
Called when all the components of the item have been loaded. Use to initialize connections between components and such. | |
virtual void | OnScaleChanged () |
virtual void | OnInventoryChanged () |
Called when the item has an ItemContainer and the contents inside of it changed. | |
virtual XElement | Save (XElement parentElement) |
virtual void | Reset () |
virtual void | ParseMsg () |
virtual bool | ValidateEventData (NetEntityEvent.IData data) |
Static Public Member Functions | |
static ItemComponent | Load (ContentXElement element, Item item, bool errorMessages=true) |
Public Attributes | |
bool | WasUsed |
bool | WasSecondaryUsed |
readonly Dictionary< ActionType, List< StatusEffect > > | statusEffectLists |
Dictionary< RelatedItem.RelationType, List< RelatedItem > > | RequiredItems |
readonly List< RelatedItem > | DisabledRequiredItems = new List<RelatedItem>() |
readonly List< Skill > | RequiredSkills = new List<Skill>() |
readonly ContentXElement | originalElement |
Action< bool > | OnActiveStateChanged |
List< PropertyConditional > | IsActiveConditionals |
readonly NamedEvent< ItemUseInfo > | OnUsed = new() |
readonly bool | InheritStatusEffects |
Protected Member Functions | |
virtual void | ShallowRemoveComponentSpecific () |
virtual void | RemoveComponentSpecific () |
string | GetTextureDirectory (ContentXElement subElement) |
T | ExtractEventData< T > (NetEntityEvent.IData data) |
bool | TryExtractEventData< T > (NetEntityEvent.IData data, out T componentData) |
AIObjectiveContainItem | AIContainItems< T > (ItemContainer container, Character character, AIObjective currentObjective, int itemCount, bool equip, bool removeEmpty, bool spawnItemIfNotFound=false, bool dropItemOnDeselected=false) |
Protected Attributes | |
Item | item |
string | name |
bool | characterUsable |
bool | canBePicked |
bool | canBeSelected |
bool | canBeCombined |
bool | removeOnCombined |
CoroutineHandle | delayedCorrectionCoroutine |
float | aiUpdateTimer |
Static Protected Attributes | |
const float | CorrectionDelay = 1.0f |
const float | AIUpdateInterval = 0.2f |
Properties | |
ItemComponent | Parent [get, set] |
bool | InheritParentIsActive [get, set] |
virtual bool | DontTransferInventoryBetweenSubs [get] |
If enabled, the contents of the item are not transferred when the player transfers items between subs. Use this if this component uses item containers in a way where removing the item from the container via external means would cause problems. | |
virtual bool | DisallowSellingItemsFromContainer [get] |
If enabled, the items inside any of the item containers on this item cannot be sold at an outpost. Use in similar cases as DontTransferInventoryBetweenSubs. | |
float | PickingTime [get, set] |
string | PickingMsg [get, set] |
Dictionary< Identifier, SerializableProperty > | SerializableProperties [get, protected set] |
virtual bool | IsActive [get, set] |
PropertyConditional.LogicalOperatorType | IsActiveConditionalComparison [get, set] |
bool | Drawable [get, set] |
bool | CanBePicked [get, set] |
bool | DrawHudWhenEquipped [get, protected set] |
bool | LockGuiFramePosition [get, set] |
Point | GuiFrameOffset [get, set] |
bool | CanBeSelected [get, set] |
bool | CanBeCombined [get, set] |
bool | RemoveOnCombined [get, set] |
bool | CharacterUsable [get, set] |
bool | AllowInGameEditing [get, set] |
InputType | PickKey [get, protected set] |
InputType | SelectKey [get, protected set] |
bool | DeleteOnUse [get, set] |
Item | Item [get] |
string | Name [get] |
string | Msg [get, set] |
LocalizedString | DisplayMsg [get, set] |
float | CombatPriority [get] |
int | ManuallySelectedSound [get] |
Which sound should be played when manual sound selection type is selected? Not [Editable] because we don't want this visible in the editor for every component. | |
float | Speed [get] |
Can be used by status effects or conditionals to the speed of the item. | |
virtual bool | UpdateWhenInactive [get] |
![]() |
The base class for components holding the different functionalities of the item.
Barotrauma.Items.Components.ItemComponent.ItemComponent | ( | Item | item, |
ContentXElement | element ) |
|
protected |
T | : | ItemComponent |
void Barotrauma.Items.Components.ItemComponent.ApplyStatusEffects | ( | ActionType | type, |
float | deltaTime, | ||
Character | character = null, | ||
Limb | targetLimb = null, | ||
Entity | useTarget = null, | ||
Character | user = null, | ||
Vector2? | worldPosition = null, | ||
float | afflictionMultiplier = 1::0f ) |
|
virtual |
Reimplemented in Barotrauma.Items.Components.ItemContainer.
|
virtual |
Reimplemented in Barotrauma.Items.Components.PowerContainer, Barotrauma.Items.Components.Pump, Barotrauma.Items.Components.Reactor, Barotrauma.Items.Components.RepairTool, Barotrauma.Items.Components.Sonar, Barotrauma.Items.Components.Steering, and Barotrauma.Items.Components.Turret.
float Barotrauma.Items.Components.ItemComponent.DegreeOfSuccess | ( | Character | character | ) |
Returns 0.0f-1.0f based on how well the Character can use the itemcomponent.
float Barotrauma.Items.Components.ItemComponent.DegreeOfSuccess | ( | Character | character, |
List< Skill > | requiredSkills ) |
Returns 0.0f-1.0f based on how well the Character can use the itemcomponent.
|
virtual |
a Character has dropped the item
Reimplemented in Barotrauma.Items.Components.Holdable, Barotrauma.Items.Components.ItemContainer, Barotrauma.Items.Components.LightComponent, Barotrauma.Items.Components.MeleeWeapon, Barotrauma.Items.Components.Pickable, Barotrauma.Items.Components.Projectile, Barotrauma.Items.Components.Throwable, Barotrauma.Items.Components.Wearable, and Barotrauma.Items.Components.Wire.
|
virtual |
Reimplemented in Barotrauma.Items.Components.GeneticMaterial, Barotrauma.Items.Components.Holdable, Barotrauma.Items.Components.IdCard, Barotrauma.Items.Components.ItemContainer, Barotrauma.Items.Components.MeleeWeapon, Barotrauma.Items.Components.RangedWeapon, Barotrauma.Items.Components.RemoteController, Barotrauma.Items.Components.Wearable, and Barotrauma.Items.Components.Wire.
|
protected |
T | : | IEventData |
|
virtual |
|
virtual |
|
virtual |
Reimplemented in Barotrauma.Items.Components.Fabricator, and Barotrauma.Items.Components.Repairable.
|
protected |
|
virtual |
Only checks if any of the Picked requirements are matched (used for checking id card(s)). Much simpler and a bit different than HasRequiredItems.
Reimplemented in Barotrauma.Items.Components.Controller, and Barotrauma.Items.Components.Door.
bool Barotrauma.Items.Components.ItemComponent.HasRequiredContainedItems | ( | Character | user, |
bool | addMessage, | ||
LocalizedString | msg = null ) |
|
virtual |
Reimplemented in Barotrauma.Items.Components.Door, and Barotrauma.Items.Components.ItemContainer.
bool Barotrauma.Items.Components.ItemComponent.HasRequiredSkills | ( | Character | character | ) |
bool Barotrauma.Items.Components.ItemComponent.HasRequiredSkills | ( | Character | character, |
out Skill | insufficientSkill ) |
bool Barotrauma.Items.Components.ItemComponent.IsEmpty | ( | Character | user | ) |
Returns true if the item is lacking required contained items, or if there's nothing with a non-zero condition inside.
readonly record struct Barotrauma.Items.Components.ItemComponent.ItemUseInfo | ( | Item | Item, |
Character | User ) |
|
virtual |
Reimplemented in Barotrauma.Items.Components.ConnectionPanel, Barotrauma.Items.Components.Controller, Barotrauma.Items.Components.Fabricator, Barotrauma.Items.Components.Holdable, Barotrauma.Items.Components.ItemContainer, Barotrauma.Items.Components.MotionSensor, Barotrauma.Items.Components.Terminal, Barotrauma.Items.Components.Turret, Barotrauma.Items.Components.Wearable, Barotrauma.Items.Components.WifiComponent, and Barotrauma.Items.Components.Wire.
|
static |
|
virtual |
|
virtual |
Called when the item has an ItemContainer and the contents inside of it changed.
|
virtual |
Called when all the components of the item have been loaded. Use to initialize connections between components and such.
Reimplemented in Barotrauma.Items.Components.ButtonTerminal, Barotrauma.Items.Components.ConnectionPanel, Barotrauma.Items.Components.Controller, Barotrauma.Items.Components.CustomInterface, Barotrauma.Items.Components.Deconstructor, Barotrauma.Items.Components.Door, Barotrauma.Items.Components.Fabricator, Barotrauma.Items.Components.Holdable, Barotrauma.Items.Components.IdCard, Barotrauma.Items.Components.ItemContainer, Barotrauma.Items.Components.LevelResource, Barotrauma.Items.Components.LightComponent, Barotrauma.Items.Components.Powered, Barotrauma.Items.Components.PowerTransfer, Barotrauma.Items.Components.Projectile, Barotrauma.Items.Components.RelayComponent, Barotrauma.Items.Components.Repairable, Barotrauma.Items.Components.Scanner, Barotrauma.Items.Components.Sprayer, Barotrauma.Items.Components.Steering, Barotrauma.Items.Components.Terminal, Barotrauma.Items.Components.TriggerComponent, Barotrauma.Items.Components.Turret, Barotrauma.Items.Components.Wearable, and Barotrauma.Items.Components.WifiComponent.
|
virtual |
Called when all items have been loaded. Use to initialize connections between items.
Reimplemented in Barotrauma.Items.Components.ConnectionPanel, Barotrauma.Items.Components.DockingPort, Barotrauma.Items.Components.Door, Barotrauma.Items.Components.Fabricator, Barotrauma.Items.Components.Holdable, Barotrauma.Items.Components.ItemContainer, Barotrauma.Items.Components.LightComponent, Barotrauma.Items.Components.Reactor, Barotrauma.Items.Components.TriggerComponent, and Barotrauma.Items.Components.Turret.
|
virtual |
Reimplemented in Barotrauma.Items.Components.Door.
|
virtual |
Reimplemented in Barotrauma.Items.Components.Holdable.
|
virtual |
a Character has picked the item
Reimplemented in Barotrauma.Items.Components.Controller, Barotrauma.Items.Components.Door, Barotrauma.Items.Components.Fabricator, Barotrauma.Items.Components.Holdable, Barotrauma.Items.Components.ItemContainer, Barotrauma.Items.Components.MiniMap, Barotrauma.Items.Components.Pickable, Barotrauma.Items.Components.PowerContainer, Barotrauma.Items.Components.PowerTransfer, Barotrauma.Items.Components.Reactor, and Barotrauma.Items.Components.Wire.
|
virtual |
Reimplemented in Barotrauma.Items.Components.ArithmeticComponent, Barotrauma.Items.Components.BooleanOperatorComponent, Barotrauma.Items.Components.ColorComponent, Barotrauma.Items.Components.ConnectionPanel, Barotrauma.Items.Components.DelayComponent, Barotrauma.Items.Components.DockingPort, Barotrauma.Items.Components.Door, Barotrauma.Items.Components.ElectricalDischarger, Barotrauma.Items.Components.Engine, Barotrauma.Items.Components.EqualsComponent, Barotrauma.Items.Components.ExponentiationComponent, Barotrauma.Items.Components.FunctionComponent, Barotrauma.Items.Components.GreaterComponent, Barotrauma.Items.Components.Holdable, Barotrauma.Items.Components.ItemContainer, Barotrauma.Items.Components.ItemLabel, Barotrauma.Items.Components.LightComponent, Barotrauma.Items.Components.MemoryComponent, Barotrauma.Items.Components.ModuloComponent, Barotrauma.Items.Components.NotComponent, Barotrauma.Items.Components.OscillatorComponent, Barotrauma.Items.Components.PowerContainer, Barotrauma.Items.Components.PowerTransfer, Barotrauma.Items.Components.Pump, Barotrauma.Items.Components.Reactor, Barotrauma.Items.Components.RegExFindComponent, Barotrauma.Items.Components.RelayComponent, Barotrauma.Items.Components.Repairable, Barotrauma.Items.Components.SignalCheckComponent, Barotrauma.Items.Components.Sonar, Barotrauma.Items.Components.Steering, Barotrauma.Items.Components.StringComponent, Barotrauma.Items.Components.Terminal, Barotrauma.Items.Components.TriggerComponent, Barotrauma.Items.Components.TrigonometricFunctionComponent, Barotrauma.Items.Components.Turret, and Barotrauma.Items.Components.WifiComponent.
void Barotrauma.Items.Components.ItemComponent.Remove | ( | ) |
|
protectedvirtual |
Reimplemented in Barotrauma.Items.Components.ConnectionPanel, Barotrauma.Items.Components.DockingPort, Barotrauma.Items.Components.Door, Barotrauma.Items.Components.ElectricalDischarger, Barotrauma.Items.Components.Fabricator, Barotrauma.Items.Components.Holdable, Barotrauma.Items.Components.ItemContainer, Barotrauma.Items.Components.Ladder, Barotrauma.Items.Components.LevelResource, Barotrauma.Items.Components.Powered, Barotrauma.Items.Components.PowerTransfer, Barotrauma.Items.Components.Projectile, Barotrauma.Items.Components.TriggerComponent, Barotrauma.Items.Components.Turret, Barotrauma.Items.Components.Wearable, Barotrauma.Items.Components.WifiComponent, and Barotrauma.Items.Components.Wire.
|
virtual |
Reimplemented in Barotrauma.Items.Components.Controller.
|
virtual |
Reimplemented in Barotrauma.Items.Components.ConnectionPanel, Barotrauma.Items.Components.Controller, Barotrauma.Items.Components.CustomInterface, Barotrauma.Items.Components.Engine, Barotrauma.Items.Components.Fabricator, Barotrauma.Items.Components.Holdable, Barotrauma.Items.Components.ItemContainer, Barotrauma.Items.Components.MotionSensor, Barotrauma.Items.Components.Terminal, Barotrauma.Items.Components.Wearable, Barotrauma.Items.Components.WifiComponent, and Barotrauma.Items.Components.Wire.
|
virtual |
|
virtual |
Reimplemented in Barotrauma.Items.Components.ConnectionPanel, Barotrauma.Items.Components.Controller, Barotrauma.Items.Components.Door, Barotrauma.Items.Components.Fabricator, Barotrauma.Items.Components.ItemContainer, Barotrauma.Items.Components.Ladder, Barotrauma.Items.Components.RemoteController, and Barotrauma.Items.Components.Steering.
void Barotrauma.Items.Components.ItemComponent.SetRequiredItems | ( | ContentXElement | element, |
bool | allowEmpty = false ) |
void Barotrauma.Items.Components.ItemComponent.ShallowRemove | ( | ) |
Remove the component 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.
|
protectedvirtual |
|
protected |
|
virtual |
|
virtual |
Reimplemented in Barotrauma.Items.Components.ArithmeticComponent, Barotrauma.Items.Components.BooleanOperatorComponent, Barotrauma.Items.Components.ColorComponent, Barotrauma.Items.Components.ConnectionPanel, Barotrauma.Items.Components.Controller, Barotrauma.Items.Components.CustomInterface, Barotrauma.Items.Components.Deconstructor, Barotrauma.Items.Components.DelayComponent, Barotrauma.Items.Components.DockingPort, Barotrauma.Items.Components.Door, Barotrauma.Items.Components.ElectricalDischarger, Barotrauma.Items.Components.Engine, Barotrauma.Items.Components.EqualsComponent, Barotrauma.Items.Components.Fabricator, Barotrauma.Items.Components.GeneticMaterial, Barotrauma.Items.Components.GreaterComponent, Barotrauma.Items.Components.Holdable, Barotrauma.Items.Components.ItemContainer, Barotrauma.Items.Components.LevelResource, Barotrauma.Items.Components.LightComponent, Barotrauma.Items.Components.MeleeWeapon, Barotrauma.Items.Components.MemoryComponent, Barotrauma.Items.Components.MiniMap, Barotrauma.Items.Components.MotionSensor, Barotrauma.Items.Components.NotComponent, Barotrauma.Items.Components.OscillatorComponent, Barotrauma.Items.Components.OxygenDetector, Barotrauma.Items.Components.OxygenGenerator, Barotrauma.Items.Components.PowerContainer, Barotrauma.Items.Components.Powered, Barotrauma.Items.Components.PowerTransfer, Barotrauma.Items.Components.Projectile, Barotrauma.Items.Components.Propulsion, Barotrauma.Items.Components.Pump, Barotrauma.Items.Components.RangedWeapon, Barotrauma.Items.Components.Reactor, Barotrauma.Items.Components.RegExFindComponent, Barotrauma.Items.Components.RelayComponent, Barotrauma.Items.Components.RemoteController, Barotrauma.Items.Components.Repairable, Barotrauma.Items.Components.RepairTool, Barotrauma.Items.Components.Rope, Barotrauma.Items.Components.Scanner, Barotrauma.Items.Components.SmokeDetector, Barotrauma.Items.Components.Sonar, Barotrauma.Items.Components.SonarTransducer, Barotrauma.Items.Components.Steering, Barotrauma.Items.Components.StringComponent, Barotrauma.Items.Components.Throwable, Barotrauma.Items.Components.TriggerComponent, Barotrauma.Items.Components.TrigonometricFunctionComponent, Barotrauma.Items.Components.Turret, Barotrauma.Items.Components.Vent, Barotrauma.Items.Components.WaterDetector, Barotrauma.Items.Components.Wearable, Barotrauma.Items.Components.WifiComponent, and Barotrauma.Items.Components.Wire.
|
virtual |
Reimplemented in Barotrauma.Items.Components.ConnectionPanel, Barotrauma.Items.Components.Door, Barotrauma.Items.Components.ElectricalDischarger, Barotrauma.Items.Components.Engine, Barotrauma.Items.Components.Holdable, Barotrauma.Items.Components.ItemContainer, Barotrauma.Items.Components.LightComponent, Barotrauma.Items.Components.MeleeWeapon, Barotrauma.Items.Components.OxygenGenerator, Barotrauma.Items.Components.PowerTransfer, Barotrauma.Items.Components.Reactor, Barotrauma.Items.Components.Repairable, Barotrauma.Items.Components.Rope, Barotrauma.Items.Components.Throwable, and Barotrauma.Items.Components.Wearable.
|
virtual |
Reimplemented in Barotrauma.Items.Components.ConnectionPanel, Barotrauma.Items.Components.Controller, Barotrauma.Items.Components.ElectricalDischarger, Barotrauma.Items.Components.Holdable, Barotrauma.Items.Components.LightComponent, Barotrauma.Items.Components.MeleeWeapon, Barotrauma.Items.Components.Projectile, Barotrauma.Items.Components.Propulsion, Barotrauma.Items.Components.RangedWeapon, Barotrauma.Items.Components.RepairTool, Barotrauma.Items.Components.Sonar, Barotrauma.Items.Components.Throwable, Barotrauma.Items.Components.Turret, and Barotrauma.Items.Components.Wire.
|
virtual |
Reimplemented in Barotrauma.Items.Components.ButtonTerminal.
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
readonly List<RelatedItem> Barotrauma.Items.Components.ItemComponent.DisabledRequiredItems = new List<RelatedItem>() |
readonly bool Barotrauma.Items.Components.ItemComponent.InheritStatusEffects |
List<PropertyConditional> Barotrauma.Items.Components.ItemComponent.IsActiveConditionals |
|
protected |
|
protected |
Action<bool> Barotrauma.Items.Components.ItemComponent.OnActiveStateChanged |
readonly NamedEvent<ItemUseInfo> Barotrauma.Items.Components.ItemComponent.OnUsed = new() |
readonly ContentXElement Barotrauma.Items.Components.ItemComponent.originalElement |
|
protected |
Dictionary<RelatedItem.RelationType, List<RelatedItem> > Barotrauma.Items.Components.ItemComponent.RequiredItems |
readonly Dictionary<ActionType, List<StatusEffect> > Barotrauma.Items.Components.ItemComponent.statusEffectLists |
bool Barotrauma.Items.Components.ItemComponent.WasSecondaryUsed |
bool Barotrauma.Items.Components.ItemComponent.WasUsed |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
get |
|
getset |
|
get |
If enabled, the items inside any of the item containers on this item cannot be sold at an outpost. Use in similar cases as DontTransferInventoryBetweenSubs.
|
getset |
|
get |
If enabled, the contents of the item are not transferred when the player transfers items between subs. Use this if this component uses item containers in a way where removing the item from the container via external means would cause problems.
|
getset |
|
getprotected set |
|
getset |
|
getset |
|
getset |
|
getset |
|
get |
|
getset |
|
get |
Which sound should be played when manual sound selection type is selected? Not [Editable] because we don't want this visible in the editor for every component.
|
getset |
|
get |
Implements Barotrauma.ISerializableEntity.
|
getset |
|
getset |
|
getset |
|
getprotected set |
|
getset |
|
getprotected set |
|
getprotected set |
Implements Barotrauma.ISerializableEntity.
|
get |
Can be used by status effects or conditionals to the speed of the item.
|
get |