DIFF

class ItemBaseSource

ItemBase InventoryItem EntityAI Entity ObjectTyped Object IEntity Managed

Derived classes
View all 1,514 descendants

All members, including inherited

Constructors 2

Constants 1

protected const int ITEM_SOUNDS_MAX = 63

optimize network synch

Referenced by InitItemVariables()

Members 90

static ref map<typename, ref TInputActionMap> m_ItemTypeActionsMap = new map<typename, ref TInputActionMap>
Referenced by InitializeActions()
TInputActionMap m_InputActionMap
Referenced by AddAction(), GetActions(), InitializeActions()
Show 1 more, RemoveAction()
static ref map<typename, ref TActionAnimOverrideMap> m_ItemActionOverrides = new map<typename, ref TActionAnimOverrideMap>
bool m_ActionsInitialize
Referenced by AddAction(), GetActions(), and ItemBase()
static int m_DebugActionsMask
bool m_RecipesInitialized
float m_VarQuantityPrev

for client to know quantity changed during synchronization

int m_VarQuantityInit
int m_VarQuantityMin
float m_VarStackMax
float m_StoreLoadedQuantity = float.LOWEST
float m_VarWetPrev

for client to know wetness changed during synchronization

float m_VarWetInit
float m_VarWetMax
Referenced by GetWetMax(), InitItemVariables(), ProcessItemWetness()
Show 1 more, SetWetMax()
int m_CleannessInit
Referenced by InitItemVariables()
int m_CleannessMin
int m_CleannessMax
bool m_WantPlayImpactSound
bool m_CanPlayImpactSound = true
Referenced by EOnContact(), and OnInventoryEnter()
int m_ImpactSoundSurfaceHash
float m_HeatIsolation
float m_ItemAttachOffset

Offset length for when the item is attached e.g. to weapon

int m_LiquidContainerMask
int m_ItemBehaviour

-1 = not specified; 0 = heavy item; 1= onehanded item; 2 = twohanded item

int m_QuickBarBonus
Referenced by GetQuickBarBonus(), and ItemBase()
bool m_IsBeingPlaced
bool m_IsHologram
bool m_IsTakeable
bool m_ThrowItemOnDrop
bool m_ItemBeingDroppedPhys
bool m_CanBeMovedOverride
bool m_FixDamageSystemInit = false

can be changed on storage version check

bool m_CanThisBeSplit

Check if item can be split

bool m_CanShowQuantity
protected bool m_CanBeDigged
protected bool m_IsResultOfSplit
string m_SoundAttType

distinguish if item has been created as new or it came from splitting (server only flag)

int m_ColorComponentR
int m_ColorComponentG
int m_ColorComponentB
int m_ColorComponentA
ref TIntArray m_SingleUseActions
Referenced by ItemBase()
ref TIntArray m_ContinuousActions
Referenced by ItemBase()
ref TIntArray m_InteractActions
Referenced by ItemBase()
static ref map<int, ref array<ref WeaponParticlesOnFire>> m_OnFireEffect
static ref map<int, ref array<ref WeaponParticlesOnBulletCasingEject>> m_OnBulletCasingEjectEffect
static ref map<string, int> m_WeaponTypeToID
Referenced by GetMuzzleID()
static int m_LastRegisteredWeaponID = 0
Referenced by GetMuzzleID()
bool m_IsOverheatingEffectActive
ref Timer m_CheckOverheating
int m_ShotsToStartOverheating = 0

After these many shots, the overheating effect begins

int m_MaxOverheatingValue = 0

Limits the number of shots that will be tracked

float m_OverheatingDecayInterval = 1

Timer's interval for decrementing overheat effect's lifespan

protected ref TStringArray m_HeadHidingSelections
protected bool m_HideSelectionsBySlot
PluginAdminLog m_AdminLog
ref Timer m_PhysDropTimer
ref array<int> m_CompatibleLocks
protected int m_LockType
protected ref EffectSound m_LockingSound
Referenced by ~ItemBase(), and OnRPC()
protected string m_LockSoundSet
protected int m_SoundSyncPlay

id for sound to play

protected int m_SoundSyncStop

id for sound to stop

protected int m_SoundSyncSlotID = InventorySlots.INVALID

slot id for attach/detach sound based on slot

private ref ItemSoundHandler m_ItemSoundHandler
private float m_TemperaturePerQuantityWeight
protected EffectSound m_SoundDeployFinish
protected EffectSound m_SoundPlace
protected EffectSound m_DeployLoopSoundEx
protected EffectSound m_SoundDeploy
bool m_IsPlaceSound
Referenced by IsPlaceSound()
bool m_IsDeploySound
Referenced by IsDeploySound()
bool m_IsSoundSynchRemote
Referenced by IsSoundSynchRemote()

Methods 316

override void InitItemVariables()
override int GetQuickBarBonus()
References m_QuickBarBonus
void InitializeActions()
Referenced by GetActions()
void SetActionAnimOverrides()

Override action animation for specific item

Referenced by ItemBase()
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
Referenced by Weapon_Base.EEFired()
void CheckOverheating(ItemBase weapon = null, string ammoType = "", ItemBase muzzle_owner = null, ItemBase suppressor = null, string config_to_search = "")
bool IsOverheatingEffectActive()
Referenced by CheckOverheating()
void StartOverheating(ItemBase weapon = null, string ammoType = "", ItemBase muzzle_owner = null, ItemBase suppressor = null, string config_to_search = "")
Referenced by CheckOverheating()
void UpdateOverheating(ItemBase weapon = null, string ammoType = "", ItemBase muzzle_owner = null, ItemBase suppressor = null, string config_to_search = "")
Referenced by CheckOverheating()
void StopOverheating(ItemBase weapon = null, string ammoType = "", ItemBase muzzle_owner = null, ItemBase suppressor = null, string config_to_search = "")
Referenced by CheckOverheating()
float GetInfectionChance(int system = 0, Param param = null)

Infection chance while/after using this item, originally used for wound infection after bandaging, params 'system' and 'param' can allow usage by other systems as well

float GetFilterDamageRatio()
bool HasMuzzle()

Returns true if this item has a muzzle (weapons, suppressors)

Referenced by ItemBase()
int GetMuzzleID()

Returns global muzzle ID. If not found, then it gets automatically registered.

int GetDamageSystemVersionChange()

Re-sets DamageSystem changes

Returns: storage version on which the config changes occured (default -1, to be overriden!)

NoteSignificant changes to DamageSystem in item configs have to be re-set by increasing the storage version and overriding this method. Default return is -1 (does nothing).
Referenced by OnStoreLoad()
static bool HasDebugActionsMask(int mask)
static void AddDebugActionsMask(int mask)
static void RemoveDebugActionsMask(int mask)
static void ToggleDebugActionsMask(int mask)
int GetLiquidContainerMask()
bool IsBloodContainer()
bool IsExplosive()

explosive ------------

string GetExplosiveTriggerSlotName()
bool IsFacingPlayer(PlayerBase player, string selection)
bool IsPlayerInside(PlayerBase player, string selection)
Referenced by CanObstruct()
override bool CanObstruct()
void OnEndPlacement()
Referenced by SetIsBeingPlaced()
int GetOnDigWormsAmount()
bool CanMakeGardenplot()
void SetIsHologram(bool is_hologram)
Referenced by Hologram.Hologram()
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
References PluginInventoryRepair.Add(), Class.Cast(), Class.Cast()
Show 52 more, Class.Cast(), HumanInventory.ClearUserReservedLocationAtIndex(), HumanInventory.ClearUserReservedLocationAtIndex(), InventoryLocation.Copy(), EntityAI.EEItemLocationChanged(), HumanInventory.FindCollidingUserReservedLocationIndex(), HumanInventory.FindUserReservedLocationIndex(), HumanInventory.FindUserReservedLocationIndex(), DayZPlayer.ForceStandUpForHeavyItems(), CGame.GetAnalyticsClient(), EntityAI.GetHierarchyRootPlayer(), EntityAI.GetHierarchyRootPlayer(), Man.GetHumanInventory(), Man.GetHumanInventory(), EntityAI.GetInventory(), InventoryLocation.GetItem(), InventoryLocation.GetItem(), InventoryLocation.GetItem(), EntityAI.GetOnAttachmentReleaseLock(), EntityAI.GetOnAttachmentReleaseLock(), EntityAI.GetOnAttachmentSetLock(), EntityAI.GetOnReleaseLock(), EntityAI.GetOnReleaseLock(), EntityAI.GetOnSetLock(), InventoryLocation.GetParent(), InventoryLocation.GetParent(), InventoryLocation.GetParent(), InventoryLocation.GetParent(), GetPlugin(), InventoryLocation.GetSlot(), InventoryLocation.GetSlot(), InventoryLocation.GetSlot(), InventoryLocation.GetType(), InventoryLocation.GetType(), InventoryLocation.GetType(), InventoryLocation.GetType(), HumanInventory.GetUserReservedLocation(), HumanInventory.GetUserReservedLocation(), ScriptInvoker.Invoke(), ScriptInvoker.Invoke(), ScriptInvoker.Invoke(), ScriptInvoker.Invoke(), ScriptInvoker.Invoke(), ScriptInvoker.Invoke(), GameInventory.LocationGetEntity(), AnalyticsManagerClient.OnItemAttachedAtPlayer(), PluginInventoryRepair.Remove(), InventoryLocation.Reset(), HumanInventory.SetUserReservedLocation(), GameInventory.TestAddEntityInCargoExLoc(), EntityAI.m_OldLocation, and m_ThrowItemOnDrop
override void OnCreatePhysics()
References RefreshPhysics()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
void ExplodeAmmo()
Referenced by DoAmmoExplosion(), and EEKilled()
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
void OnQuantityChanged(float delta)

Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first when overriding this event.

Referenced by SetQuantity()
void OnAttachmentQuantityChanged(ItemBase item)

Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChanged(item); first when overriding this event.

void OnAttachmentQuantityChangedEx(ItemBase item, float delta)

Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChanged(item); first when overriding this event.

protected void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
Referenced by OnRightClick()
override bool CanBeCombined(EntityAI other_item, bool reservation_check = true, bool stack_max_limit = false)
bool IsCombineAll(ItemBase other_item, bool use_stack_max = false)
Referenced by CombineItemsClient()
bool IsResultOfSplit()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max = true)
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max = true)
override void CombineItemsEx(EntityAI entity2, bool use_stack_max = true)
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
void OnActivatedByTripWire()

DEPRECATED use OnActivatedByItem below Called when this item is activated from a trip wire that was stepped on.

void OnActivatedByItem(notnull ItemBase item)

Called when this item is activated by other

bool CanExplodeInFire()
Referenced by EEKilled()
bool CanEat()
override bool IsIgnoredByConstruction()
FoodStage GetFoodStage()

overridden on Edible_Base; so we don't have to parse configs all the time

bool CanBeCooked()
bool CanBeCookedOnStick()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)

cooking-related effect methods

bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
int GetItemSize()
bool CanBeMovedOverride()
void MessageToOwnerStatus(string text)

Send message to owner player in grey color

Returns: void

item_stone.MessageToOwnerStatus("Some Status Message");
void MessageToOwnerAction(string text)

Send message to owner player in yellow color

Returns: void

item_stone.MessageToOwnerAction("Some Action Message");
void MessageToOwnerFriendly(string text)

Send message to owner player in green color

Returns: void

item_stone.MessageToOwnerFriendly("Some Friendly Message");
void MessageToOwnerImportant(string text)

Send message to owner player in red color

Returns: void

item_stone.MessageToOwnerImportant("Some Important Message");
int NameToID(string name)
void OnSyncVariables(ParamsReadContext ctx)

DEPRECATED (most likely)

bool CanBeDisinfected()
Referenced by DisinfectItem.CanDo()
override void OnVariablesSynchronized()
override bool SetQuantity(float value, bool destroy_config = true, bool destroy_forced = false, bool allow_client = false, bool clamp_to_stack_max = true)

Set item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity reaches varQuantityMin or lower and the item config contains the varQuantityDestroyOnMin = true entry, the item gets destroyed. destroy_forced = true means item gets destroyed when quantity reaches varQuantityMin or lower regardless of config setting, returns true if the item gets deleted

bool AddQuantity(float value, bool destroy_config = true, bool destroy_forced = false)

add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity reaches varQuantityMin or lower and the item config contains the varQuantityDestroyOnMin = true entry, the item gets destroyed. destroy_forced = true means item gets destroyed when quantity reaches varQuantityMin or lower regardless of config setting, returns true if the item gets deleted

override void SetQuantityToMinimum()
override void SetQuantityNormalized(float value, bool destroy_config = true, bool destroy_forced = false)

Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config(for Min 0 and Max 5000, setting 0.5 will result in value 2500)

override float GetQuantityNormalized()

Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config(for Min 0 and Max 5000, value 2500 will result in 0.5)

float GetQuantityNormalizedScripted()
override int GetTargetQuantityMax(int attSlotID = -1)
Referenced by ActionAttachOnSelection.OnExecuteClient(), ActionAttachToConstruction.OnExecuteImpl(), ActionDetachFromTarget.Process()
Show 42 more, ActionRemoveSeed.OnExecuteClient(), ActionTakeArrow.OnExecute(), ActionTakeArrowToHands.OnExecute(), ActionTakeHybridAttachment.OnExecute(), ActionTakeHybridAttachmentToHands.OnExecuteImpl(), ActionTakeItem.OnExecute(), ActionTakeItemToHands.OnExecute(), ActionTakeMaterialToHands.OnExecuteImpl(), AttachmentCategoriesRow.DoubleClick(), AttachmentCategoriesRow.MouseClick(), AttachmentCategoriesRow.OnDropReceivedFromHeader(), AttachmentCategoriesRow.TransferItemToVicinity(), Attachments.TransferItemToVicinity(), CargoContainer.TransferItemToVicinity(), Construction.DropNonUsableMaterialsServer(), ContainerWithCargo.TakeIntoHands(), ContainerWithCargoAndAttachments.MouseClick2(), HandsArea.OnHandsPanelDropReceived(), HandsContainer.MouseClick2(), HandsContainer.TakeAsAttachment(), HandsContainer.TransferItemToVicinity(), HandsPreview.Select(), Icon.MouseClick(), GetQuantityMax(), SplitIntoStackMax(), SplitIntoStackMaxCargo(), SplitIntoStackMaxEx(), SplitIntoStackMaxHands(), SplitIntoStackMaxToInventoryLocationEx(), MiscGameplayFunctions.ThrowEntityFromInventory(), PlayerContainer.DoubleClick(), PlayerContainer.MouseClick(), PlayerContainer.OnDropReceivedFromGhostArea(), PlayerContainer.TransferItemToVicinity(), SplitItemUtils.TakeOrSplitToInventory(), SplitItemUtils.TakeOrSplitToInventoryLocation(), VicinityContainer.OnDropReceivedFromHeader(), VicinitySlotsContainer.OnDropReceivedFromHeader(), VicinitySlotsContainer.Select(), ZombieContainer.DoubleClick(), ZombieContainer.MouseClick(), and ZombieContainer.TransferItemToVicinity()
int GetQuantityInit()
Referenced by SpawnItemOnLocation()
float GetSingleInventoryItemWeight()
float GetUnitWeight(bool include_wetness = true)

Obsolete, use GetWeightEx instead

float GetHeatIsolationInit()
Referenced by InitItemVariables()
override float GetWetInit()
References m_VarWetInit
override void OnWetChanged(float newVal, float oldVal)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
Referenced by OnWetChanged()
override EWetnessLevel GetWetLevel()
override void SetStoreLoad(bool value)
References m_IsStoreLoad
override bool IsStoreLoad()
References m_IsStoreLoad
Referenced by ReadVarsFromCTX()
override void SetStoreLoadedQuantity(float value)
override float GetStoreLoadedQuantity()
Referenced by AfterStoreLoad(), and SetQuantity()
float GetItemModelLength()
Referenced by InitItemVariables()
float GetItemAttachOffset()
Referenced by InitItemVariables()
override int GetCleanness()
References m_Cleanness
Referenced by WriteVarsToCTX()
bool AllowFoodConsumption()
int GetLockType()
References m_LockType
override void GetColor(out int r, out int g, out int b, out int a)

gets item's color variable as components

bool IsColorSet()
string GetColorString()

Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,0.15,0.15,1.0,CO)"

protected void OnLiquidTypeChanged(int oldType, int newType)
Referenced by SetLiquidType()
void UpdateQuickbarShortcutVisibility(PlayerBase player)

To be called on moving item within character's inventory; 'player' should never be null

bool ContainsAgent(int agent_id)
References m_AttachedAgents
Referenced by RemoveAgent()
override void RemoveAgent(int agent_id)
Referenced by OnAction()
override void RemoveAllAgents()
References m_AttachedAgents
Referenced by ChelateWater.Do(), and SetQuantity()
void TransferAgents(int agents)

transfer agents from another item

References m_AttachedAgents
bool LoadAgents(ParamsReadContext ctx, int version)
Referenced by OnStoreLoad()
void SaveAgents(ParamsWriteContext ctx)
Referenced by OnStoreSave()
override void CheckForRoofLimited(float timeTresholdMS = 3000)

Roof check for entity, limited by time (anti-spam solution)

override void EEOnCECreate()

Called when entity is being created as new by CE/ Debug

void Open()

Implementations only

void Close()
override bool CanDisplayCargo()
References IsOpen()
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
Referenced by Weapon_Base.EEFired()
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
Referenced by StartOverheating()
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
Referenced by UpdateOverheating()
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
Referenced by StopOverheating()
override bool IsOneHandedBehaviour()
References m_ItemBehaviour
override bool IsTwoHandedBehaviour()
References m_ItemBehaviour
float GetDeployTime()

how long it takes to deploy this item in seconds

bool IsActionTargetVisible()
protected void PreLoadSoundAttachmentType()

Attachment Sound Type getting from config file

Referenced by ItemBase()
override string GetAttachmentSoundType()
References m_SoundAttType
string GetPlaceSoundset()

played when deploy starts

string GetDeploySoundset()

played when deploy sucessfully finishes

string GetLoopFoldSoundset()

played when fold starts and stopped when it finishes

string GetFoldSoundset()

played when fold sucessfully finishes

protected void ClearStartItemSoundServer()
protected void ClearStopItemSoundServer()
References m_SoundSyncStop
array<string> GetHeadHidingSelection()
bool HidesSelectionBySlot()
void StopItemDynamicPhysics()
void PerformDamageSystemReinit()
Referenced by AfterStoreLoad()
void SetZoneDamageCEInit()

Sets zone damages to match randomized global health set by CE (CE spawn only)

Referenced by EEOnCECreate()
bool IsCoverFaceForShave(string slot_name)

DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere

void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
Referenced by ProcessVariables()
protected void ProcessDecay(float delta, bool hasRootAsPlayer)
Referenced by ProcessVariables()
bool CanDecay()
Referenced by ProcessVariables()
protected bool CanProcessDecay()
Referenced by ProcessVariables()
protected bool CanHaveWetness()
Referenced by ProcessVariables()
bool CanBeConsumed(ConsumeConditionData data = null)

Items cannot be consumed if frozen by default. Override for exceptions.

float GetTemperaturePerQuantityWeight()

Used in heat comfort calculations only!

override float GetTemperatureFreezeThreshold()
override float GetTemperatureThawThreshold()
override float GetItemOverheatThreshold()
void AffectLiquidContainerOnFill(int liquid_type, float amount)

from enviro source

void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)

from other liquid container source

void CopyScriptPropertiesFrom(EntityAI oldItem)
void AddLightSourceItem(ItemBase lightsource)

Adds a light source child

void RemoveLightSourceItem()
ItemBase GetLightSourceItem()
array<int> GetValidFinishers()

returns an array of possible finishers

bool GetActionWidgetOverride(out typename name)

If we need a different (handheld)item action widget displayed, the logic goes in here

float GetBaitEffectivity()

generic effectivity as a bait for animal catching

override void SetDebugItem()DEVELOPER
bool CanBeUsedForSuicide()
override void NotifyPlayerLoadChanged(EntityAI owner)
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
string GetDeployFinishSoundset()
void PlayDeploySound()
void PlayDeployFinishSound()
void PlayPlaceSound()
void PlayDeployLoopSoundEx()
void StopDeployLoopSoundEx()
void SoundSynchRemoteReset()
void SoundSynchRemote()
bool UsesGlobalDeploy()
bool CanPlayDeployLoopSound()
bool IsSoundSynchRemote()
bool IsPlaceSound()
References m_IsPlaceSound
bool IsDeploySound()
References m_IsDeploySound
void SetIsPlaceSound(bool is_place_sound)
void SetIsDeploySound(bool is_deploy_sound)
void PlayAttachSound(string slot_type)

Plays sound on item attach. Be advised, the config structure may slightly change in 1.11 update to allow for more complex use.

void PlayDetachSound(string slot_type)