DayZ 1.24
Loading...
Searching...
No Matches
InventoryItem Class Reference
Collaboration diagram for InventoryItem:
[legend]

Protected Member Functions

void ItemBase ()
 
void InitItemVariables ()
 
bool UsesGlobalDeploy ()
 
override int GetQuickBarBonus ()
 
void InitializeActions ()
 
override void GetActions (typename action_input_type, out array< ActionBase_Basic > actions)
 
void SetActions ()
 
void AddAction (typename actionName)
 
void RemoveAction (typename actionName)
 
void OnItemInHandsPlayerSwimStart (PlayerBase player)
 
ScriptedLightBase GetLight ()
 
void LoadParticleConfigOnFire (int id)
 
void LoadParticleConfigOnOverheating (int id)
 
float GetOverheatingValue ()
 
void IncreaseOverheating (ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
 
void CheckOverheating (ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
 
bool IsOverheatingEffectActive ()
 
void OnOverheatingDecay ()
 
void StartOverheating (ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
 
void UpdateOverheating (ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
 
void StopOverheating (ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
 
void RegisterOverheatingParticle (Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
 
float GetOverheatingCoef ()
 
void UpdateAllOverheatingParticles ()
 
void KillAllOverheatingParticles ()
 
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 GetDisinfectQuantity (int system=0, Param param1=null)
 
float GetFilterDamageRatio ()
 
bool HasMuzzle ()
 Returns true if this item has a muzzle (weapons, suppressors)
 
int GetMuzzleID ()
 Returns global muzzle ID. If not found, then it gets automatically registered.
 
int GetDamageSystemVersionChange ()
 Re-sets DamageSystem changes.
 
void ~ItemBase ()
 
void SetCEBasedQuantity ()
 
void LockToParent ()
 Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible in inventory over this item.
 
void UnlockFromParent ()
 Unlocks this item from its attachment slot of its parent.
 
override void CombineItemsClient (EntityAI entity2, bool use_stack_max=true)
 
bool IsLiquidPresent ()
 
bool IsLiquidContainer ()
 
bool IsBloodContainer ()
 
bool IsNVG ()
 
bool IsExplosive ()
 
string GetExplosiveTriggerSlotName ()
 
bool IsLightSource ()
 
bool CanBeRepairedByCrafting ()
 
bool IsFacingPlayer (PlayerBase player, string selection)
 
bool IsPlayerInside (PlayerBase player, string selection)
 
override bool CanObstruct ()
 
override bool IsBeingPlaced ()
 
void SetIsBeingPlaced (bool is_being_placed)
 
void OnEndPlacement ()
 
override bool IsHologram ()
 
bool CanBeDigged ()
 
bool CanMakeGardenplot ()
 
void SetIsHologram (bool is_hologram)
 
override void OnMovedInsideCargo (EntityAI container)
 
override void EEItemLocationChanged (notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
 
override void EOnContact (IEntity other, Contact extra)
 
void RefreshPhysics ()
 
override void OnCreatePhysics ()
 
override void OnItemAttachmentSlotChanged (notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
 
override void OnItemLocationChanged (EntityAI old_owner, EntityAI new_owner)
 
override void EEDelete (EntityAI parent)
 
override void EEKilled (Object killer)
 
override void OnWasAttached (EntityAI parent, int slot_id)
 
override void OnWasDetached (EntityAI parent, int slot_id)
 
override string ChangeIntoOnAttach (string slot)
 
override string ChangeIntoOnDetach ()
 
void ExplodeAmmo ()
 
void DoAmmoExplosion ()
 
override void EEHitBy (TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
 
bool DamageItemInCargo (float damage)
 
bool DamageItemAttachments (float damage)
 
override bool CanBeSplit ()
 
void SplitIntoStackMaxClient (EntityAI destination_entity, int slot_id)
 
void SplitIntoStackMax (EntityAI destination_entity, int slot_id, PlayerBase player)
 
void SplitIntoStackMaxToInventoryLocationClient (notnull InventoryLocation dst)
 
void SplitIntoStackMaxCargoClient (EntityAI destination_entity, int idx, int row, int col)
 
void SplitIntoStackMaxToInventoryLocation (notnull InventoryLocation dst)
 
ItemBase SplitIntoStackMaxToInventoryLocationEx (notnull InventoryLocation dst)
 
void SplitIntoStackMaxCargo (EntityAI destination_entity, int idx, int row, int col)
 
void SplitIntoStackMaxHandsClient (PlayerBase player)
 
void SplitIntoStackMaxHands (PlayerBase player)
 
void SplitItemToInventoryLocation (notnull InventoryLocation dst)
 
void SplitItem (PlayerBase player)
 
void OnQuantityChanged (float delta)
 Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first when overriding this event.
 
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.
 
override void EEHealthLevelChanged (int oldLevel, int newLevel, string zone)
 
override void 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)
 
bool IsResultOfSplit ()
 
void SetResultOfSplit (bool value)
 
int ComputeQuantityUsed (ItemBase other_item, bool use_stack_max=true)
 
float ComputeQuantityUsedEx (ItemBase other_item, bool use_stack_max=true)
 
void CombineItems (ItemBase other_item, bool use_stack_max=true)
 
void OnCombine (ItemBase other_item)
 
void GetRecipesActions (Man player, out TSelectableActionInfoArray outputList)
 
override void GetDebugActions (out TSelectableActionInfoArrayEx outputList)
 
override bool OnAction (int action_id, Man player, ParamsReadContext ctx)
 
void OnActivatedByTripWire ()
 
void OnActivatedByItem (notnull ItemBase item)
 Called when this item is activated by other.
 
bool CanExplodeInFire ()
 
bool CanEat ()
 
override bool IsIgnoredByConstruction ()
 
bool HasFoodStage ()
 
bool CanBeCooked ()
 
bool CanBeCookedOnStick ()
 
bool CanRepair (ItemBase item_repair_kit)
 
bool Repair (PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
 
int GetItemSize ()
 
bool CanBeMovedOverride ()
 
void SetCanBeMovedOverride (bool setting)
 
void MessageToOwnerStatus (string text)
 Send message to owner player in grey color.
 
void MessageToOwnerAction (string text)
 Send message to owner player in yellow color.
 
void MessageToOwnerFriendly (string text)
 Send message to owner player in green color.
 
void MessageToOwnerImportant (string text)
 Send message to owner player in red color.
 
override bool IsItemBase ()
 
override bool KindOf (string tag)
 
override void OnRPC (PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
 
void TransferVariablesFloat (array< float > float_vars)
 
array< floatGetVariablesFloat ()
 
int NameToID (string name)
 
string IDToName (int id)
 
void OnSyncVariables (ParamsReadContext ctx)
 
void SerializeNumericalVars (array< float > floats_out)
 
void DeSerializeNumericalVars (array< float > floats)
 
void WriteVarsToCTX (ParamsWriteContext ctx)
 
bool ReadVarsFromCTX (ParamsReadContext ctx, int version=-1)
 
void SaveVariables (ParamsWriteContext ctx)
 
bool LoadVariables (ParamsReadContext ctx, int version=-1)
 
override bool OnStoreLoad (ParamsReadContext ctx, int version)
 
override void OnStoreSave (ParamsWriteContext ctx)
 
override void AfterStoreLoad ()
 
override void EEOnAfterLoad ()
 
bool CanBeDisinfected ()
 
override void OnVariablesSynchronized ()
 
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
 
void SetQuantityMax ()
 
override void SetQuantityToMinimum ()
 
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)
 
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)
 
override int GetQuantityMax ()
 
override int GetTargetQuantityMax (int attSlotID=-1)
 
int GetQuantityMin ()
 
int GetQuantityInit ()
 
bool HasQuantity ()
 
override float GetQuantity ()
 
bool IsFullQuantity ()
 
override float GetSingleInventoryItemWeightEx ()
 
float GetSingleInventoryItemWeight ()
 
float GetWeightSpecialized (bool forceRecalc=false)
 
int GetNumberOfItems ()
 Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
 
float GetUnitWeight (bool include_wetness=true)
 Obsolete, use GetWeightEx instead.
 
void SetVariableMask (int variable)
 
void RemoveItemVariable (int variable)
 Removes variable from variable mask, making it appear as though the variable has never been changed from default.
 
bool IsVariableSet (int variable)
 'true' if this variable has ever been changed from default
 
override void ClearInventory ()
 
float GetEnergy ()
 
override void OnEnergyConsumed ()
 
override void OnEnergyAdded ()
 
void ConvertEnergyToQuantity ()
 
override void SetTemperature (float value, bool allow_client=false)
 
override void AddTemperature (float value)
 
override void SetTemperatureMax ()
 
override float GetTemperature ()
 
override float GetTemperatureInit ()
 
override float GetTemperatureMin ()
 
override float GetTemperatureMax ()
 
float GetHeatIsolationInit ()
 
float GetHeatIsolation ()
 
float GetDryingIncrement (string pIncrementName)
 
float GetSoakingIncrement (string pIncrementName)
 
override void SetWet (float value, bool allow_client=false)
 
override void AddWet (float value)
 
override void SetWetMax ()
 
override float GetWet ()
 
override float GetWetMax ()
 
override float GetWetMin ()
 
override float GetWetInit ()
 
override void OnWetChanged (float newVal, float oldVal)
 
override void OnWetLevelChanged (EWetnessLevel newLevel, EWetnessLevel oldLevel)
 
override EWetnessLevel GetWetLevel ()
 
bool IsServerCheck (bool allow_client)
 
float GetItemModelLength ()
 
float GetItemAttachOffset ()
 
void SetCleanness (int value, bool allow_client=false)
 
bool AllowFoodConsumption ()
 
int GetLockType ()
 
string GetLockSoundSet ()
 
void SetColor (int r, int g, int b, int a)
 
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)".
 
void SetLiquidType (int value, bool allow_client=false)
 
int GetLiquidTypeInit ()
 
int GetLiquidType ()
 
void OnInventoryEnter (Man player)
 Event called on item when it is placed in the player(Man) inventory, passes the owner as a parameter.
 
void OnInventoryExit (Man player)
 Event called on item when it is removed from the player(Man) inventory, passes the old owner as a parameter.
 
override void OnPlacementStarted (Man player)
 
override void OnPlacementComplete (Man player, vector position="0 0 0", vector orientation="0 0 0")
 
bool ContainsAgent (int agent_id)
 
override void RemoveAgent (int agent_id)
 
override void RemoveAllAgents ()
 
override void RemoveAllAgentsExcept (int agents_to_keep_mask)
 
override void InsertAgent (int agent, float count=1)
 
void TransferAgents (int agents)
 transfer agents from another item
 
override int GetAgents ()
 
bool LoadAgents (ParamsReadContext ctx, int version)
 
void SaveAgents (ParamsWriteContext ctx)
 
float GetProtectionLevel (int type, bool consider_filter=false, int system=0)
 
override void EEOnCECreate ()
 Called when entity is being created as new by CE/ Debug.
 
void Open ()
 Implementations only.
 
void Close ()
 
bool IsOpen ()
 
override bool CanDisplayCargo ()
 
override bool CanPutInCargo (EntityAI parent)
 
override bool CanPutAsAttachment (EntityAI parent)
 
override bool CanReceiveItemIntoCargo (EntityAI item)
 
override bool CanReceiveAttachment (EntityAI attachment, int slotId)
 
override bool IsHeavyBehaviour ()
 
override bool IsOneHandedBehaviour ()
 
override bool IsTwoHandedBehaviour ()
 
bool IsDeployable ()
 
float GetDeployTime ()
 how long it takes to deploy this item in seconds
 
override void SetTakeable (bool pState)
 
override bool IsTakeable ()
 
void PreLoadSoundAttachmentType ()
 Attachment Sound Type getting from config file.
 
override string GetAttachmentSoundType ()
 
void SoundSynchRemoteReset ()
 
void SoundSynchRemote ()
 
bool IsSoundSynchRemote ()
 
string GetDeploySoundset ()
 
string GetPlaceSoundset ()
 
string GetLoopDeploySoundset ()
 
string GetDeployFinishSoundset ()
 
void SetIsPlaceSound (bool is_place_sound)
 
bool IsPlaceSound ()
 
void SetIsDeploySound (bool is_deploy_sound)
 
bool IsDeploySound ()
 
void PlayDeployLoopSoundEx ()
 
void StopDeployLoopSoundEx ()
 
void PlayDeploySound ()
 
void PlayDeployFinishSound ()
 
void PlayPlaceSound ()
 
bool CanPlayDeployLoopSound ()
 
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)
 
void OnApply (PlayerBase player)
 
float GetBandagingEffectivity ()
 
array< stringGetHeadHidingSelection ()
 
bool HidesSelectionBySlot ()
 
WrittenNoteData GetWrittenNoteData ()
 
void StopItemDynamicPhysics ()
 
void PerformDamageSystemReinit ()
 
void SetZoneDamageCEInit ()
 Sets zone damages to match randomized global health set by CE (CE spawn only)
 
bool IsCoverFaceForShave (string slot_name)
 DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
 
void ProcessItemWetness (float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
 
void ProcessItemTemperature (float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
 
void ProcessItemWetnessAndTemperature (float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
 
void HierarchyCheck (out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
 
void ProcessDecay (float delta, bool hasRootAsPlayer)
 
bool CanDecay ()
 
bool CanProcessDecay ()
 
bool CanHaveWetness ()
 
bool CanHaveTemperature ()
 
override void OnCEUpdate ()
 
bool IsCargoException4x3 (EntityAI item)
 
void CopyScriptPropertiesFrom (EntityAI oldItem)
 
void AddLightSourceItem (ItemBase lightsource)
 Adds a light source child.
 
void RemoveLightSourceItem ()
 
ItemBase GetLightSourceItem ()
 
array< intGetValidFinishers ()
 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.
 
bool PairWithDevice (notnull ItemBase otherDevice)
 
bool CanBeUsedForSuicide ()
 

Static Protected Member Functions

static int GetDebugActionsMask ()
 
static bool HasDebugActionsMask (int mask)
 
static void SetDebugActionsMask (int mask)
 
static void AddDebugActionsMask (int mask)
 
static void RemoveDebugActionsMask (int mask)
 
static void ToggleDebugActionsMask (int mask)
 
static void PlayFireParticles (ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
 
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)
 
static void UpdateOverheatingParticles (ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
 
static void StopOverheatingParticles (ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
 

Protected Attributes

bool m_CanBeDigged
 
EffectSound m_DeployLoopSoundEx
 distinguish if item has been created as new or it came from splitting (server only flag)
 
string m_SoundAttType
 
int m_ColorComponentR
 
int m_ColorComponentG
 
int m_ColorComponentB
 
int m_ColorComponentA
 
ItemBase m_LightSourceItem
 
ref TIntArray m_SingleUseActions
 
ref TIntArray m_ContinuousActions
 
ref TIntArray m_InteractActions
 
ref TStringArray m_HeadHidingSelections
 
bool m_HideSelectionsBySlot
 
PluginAdminLog m_AdminLog
 
ref Timer m_PhysDropTimer
 
ref array< intm_CompatibleLocks = new array<int>
 
int m_LockType
 
ref EffectSound m_LockingSound
 
string m_LockSoundSet = ""
 
EffectSound m_SoundPlace
 
EffectSound m_SoundDeploy
 
EffectSound m_SoundDeployFinish
 

Private Member Functions

void TransferModifiers (PlayerBase reciever)
 appears to be deprecated, legacy code
 

Private Attributes

TInputActionMap m_InputActionMap
 
bool m_ActionsInitialize
 
bool m_RecipesInitialized
 
int m_VariablesMask
 
float m_VarQuantity
 
float m_VarQuantityPrev
 
int m_VarQuantityInit
 
int m_VarQuantityMin
 
int m_VarQuantityMax
 
int m_Count
 
float m_VarStackMax
 
float m_StoreLoadedQuantity = float.LOWEST
 
float m_VarTemperature
 
float m_VarTemperatureInit
 
float m_VarTemperatureMin
 
float m_VarTemperatureMax
 
float m_VarWet
 
float m_VarWetPrev
 
float m_VarWetInit
 
float m_VarWetMin
 
float m_VarWetMax
 
int m_Cleanness
 
int m_CleannessInit
 
int m_CleannessMin
 
int m_CleannessMax
 
bool m_WantPlayImpactSound
 
bool m_CanPlayImpactSound = true
 
float m_ImpactSpeed
 
int m_ImpactSoundSurfaceHash
 
float m_HeatIsolation
 
float m_ItemModelLength
 
float m_ItemAttachOffset
 
int m_VarLiquidType
 
int m_ItemBehaviour = -1
 
int m_QuickBarBonus = 0
 
bool m_IsBeingPlaced
 
bool m_IsHologram
 
bool m_IsPlaceSound
 
bool m_IsDeploySound
 
bool m_IsTakeable
 
bool m_IsSoundSynchRemote
 
bool m_ThrowItemOnDrop
 
bool m_ItemBeingDroppedPhys
 
bool m_CanBeMovedOverride
 
bool m_FixDamageSystemInit = false
 
bool can_this_be_combined = false
 
bool m_CanThisBeSplit = false
 
bool m_IsStoreLoad = false
 
bool m_CanShowQuantity
 
bool m_HasQuantityBar
 
int m_AttachedAgents
 
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
 
bool m_IsOverheatingEffectActive
 
float m_OverheatingShots
 
ref Timer m_CheckOverheating
 
int m_ShotsToStartOverheating = 0
 
int m_MaxOverheatingValue = 0
 
float m_OverheatingDecayInterval = 1
 
ref array< ref OverheatingParticlem_OverheatingParticles
 

Static Private Attributes

static ref map< typename, ref TInputActionMapm_ItemTypeActionsMap = new map<typename, ref TInputActionMap>
 
static int m_DebugActionsMask
 
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
 
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
 
static ref map< string, intm_WeaponTypeToID
 
static int m_LastRegisteredWeaponID = 0
 

Detailed Description

Definition at line 13 of file ItemBase.c.

Constructor & Destructor Documentation

◆ ~ItemBase()

void InventoryItem::~ItemBase ( )
inlineprotected

Definition at line 726 of file ItemBase.c.

727 {
728 #ifndef SERVER
731 #endif
732
733 if (GetGame() && GetGame().GetPlayer() && (!GetGame().IsDedicatedServer()))
734 {
736 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
737
738 if (r_index >= 0)
739 {
741 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
742
743 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
744 int r_type = r_il.GetType();
745 if (r_type == InventoryLocationType.CARGO || r_type == InventoryLocationType.PROXYCARGO)
746 {
747 r_il.GetParent().GetOnReleaseLock().Invoke(this);
748 }
749 else if (r_type == InventoryLocationType.ATTACHMENT)
750 {
751 r_il.GetParent().GetOnAttachmentReleaseLock().Invoke(this, r_il.GetSlot());
752 }
753
754 }
755
756 player.GetHumanInventory().ClearUserReservedLocation(this);
757 }
758
760 }
InventoryLocationType
types of Inventory Location
PlayerBase GetPlayer()
void SoundStop()
Stops sound.
ref EffectSound m_LockingSound
Definition ItemBase.c:136
EffectSound m_DeployLoopSoundEx
distinguish if item has been created as new or it came from splitting (server only flag)
Definition ItemBase.c:83
InventoryLocation.
Manager class for managing Effect (EffectParticle, EffectSound)
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
proto native CGame GetGame()

References SEffectManager::DestroyEffect(), GetGame(), GetPlayer(), m_DeployLoopSoundEx, m_LockingSound, and EffectSound::SoundStop().

Member Function Documentation

◆ AddAction()

void InventoryItem::AddAction ( typename actionName )
inlineprotected

Definition at line 324 of file ItemBase.c.

325 {
326 ActionBase action = ActionManagerBase.GetAction(actionName);
327
328 if (!action)
329 {
330 Debug.LogError("Action " + actionName + " dosn't exist!");
331 return;
332 }
333
334 typename ai = action.GetInputType();
335 if (!ai)
336 {
337 m_ActionsInitialize = false;
338 return;
339 }
340
342 if (!action_array)
343 {
346 }
348 {
349 Debug.ActionLog(action.ToString() + " -> " + ai, this.ToString() , "n/a", "Add action");
350 }
351
352 if (action_array.Find(action) != -1)
353 {
354 Debug.Log("Action " + action.Type() + " already added to " + this + ", skipping!");
355 }
356 else
357 {
358 action_array.Insert(action);
359 }
360 }
Definition Debug.c:14
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
Definition Debug.c:341
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:133
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:143
bool m_ActionsInitialize
Definition ItemBase.c:17
TInputActionMap m_InputActionMap
Definition ItemBase.c:16
static bool IsActionLogEnable()
Definition Debug.c:719

References Debug::ActionLog(), LogManager::IsActionLogEnable(), Debug::Log(), Debug::LogError(), m_ActionsInitialize, and m_InputActionMap.

◆ AddDebugActionsMask()

static void InventoryItem::AddDebugActionsMask ( int mask)
inlinestaticprotected

Definition at line 780 of file ItemBase.c.

781 {
782 ItemBase.m_DebugActionsMask |= mask;
783 }

◆ AddLightSourceItem()

void InventoryItem::AddLightSourceItem ( ItemBase lightsource)
inlineprotected

Adds a light source child.

Definition at line 4615 of file ItemBase.c.

4616 {
4618 }
ItemBase m_LightSourceItem
Definition ItemBase.c:94

References m_LightSourceItem.

◆ AddQuantity()

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

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

Definition at line 3234 of file ItemBase.c.

3235 {
3237 }
override float GetQuantity()
Definition ItemBase.c:3329
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 re...
Definition ItemBase.c:3172

References GetQuantity(), and SetQuantity().

◆ AddTemperature()

override void InventoryItem::AddTemperature ( float value)
inlineprotected

Definition at line 3528 of file ItemBase.c.

3529 {
3531 }
override void SetTemperature(float value, bool allow_client=false)
Definition ItemBase.c:3512
override float GetTemperature()
Definition ItemBase.c:3538

References GetTemperature(), and SetTemperature().

◆ AddWet()

override void InventoryItem::AddWet ( float value)
inlineprotected

Definition at line 3605 of file ItemBase.c.

3606 {
3607 SetWet(GetWet() + value);
3608 }
override void SetWet(float value, bool allow_client=false)
Definition ItemBase.c:3586
override float GetWet()
Definition ItemBase.c:3615

References GetWet(), and SetWet().

◆ AfterStoreLoad()

override void InventoryItem::AfterStoreLoad ( )
inlineprotected

Definition at line 3081 of file ItemBase.c.

3082 {
3083 super.AfterStoreLoad();
3084
3086 {
3088 }
3089
3090 if (m_StoreLoadedQuantity != float.LOWEST)
3091 {
3093 m_StoreLoadedQuantity = float.LOWEST;//IMPORTANT to do this !! we use 'm_StoreLoadedQuantity' inside SetQuantity to distinguish between initial quantity setting and the consequent(normal gameplay) calls
3094 }
3095 }
@ LOWEST
void PerformDamageSystemReinit()
Definition ItemBase.c:4445
bool m_FixDamageSystemInit
Definition ItemBase.c:74
float m_StoreLoadedQuantity
Definition ItemBase.c:36
const float LOWEST
Definition EnConvert.c:100

References float::LOWEST, LOWEST, m_FixDamageSystemInit, m_StoreLoadedQuantity, PerformDamageSystemReinit(), and SetQuantity().

◆ AllowFoodConsumption()

bool InventoryItem::AllowFoodConsumption ( )
inlineprotected

Definition at line 3705 of file ItemBase.c.

3706 {
3707 return true;
3708 }

◆ CanBeCombined()

override bool InventoryItem::CanBeCombined ( EntityAI other_item,
bool reservation_check = true,
bool stack_max_limit = false )
inlineprotected

Definition at line 1969 of file ItemBase.c.

1970 {
1971 //Print("CanBeCombined - " + this + ": " + GetQuantity() + " + " + other_item + ": " + other_item.GetQuantity());
1972 //TODO: delete check zero quantity check after fix double posts hands fsm events
1973 if (!other_item || GetType() != other_item.GetType() || (IsFullQuantity() && other_item.GetQuantity() > 0) || other_item == this)
1974 return false;
1975
1976 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
1977 return false;
1978
1979 //can_this_be_combined = ConfigGetBool("canBeSplit");
1981 return false;
1982
1983
1984 Magazine mag = Magazine.Cast(this);
1985 if (mag)
1986 {
1987 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
1988 return false;
1989
1990 if (stack_max_limit)
1991 {
1993 if (other_item)
1994 {
1995 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
1996 return false;
1997 }
1998
1999 }
2000 }
2001 else
2002 {
2003 //TODO: delete check zero quantity check after fix double posts hands fsm events
2004 if (GetQuantity() >= GetQuantityMax() && other_item.GetQuantity() > 0 )
2005 return false;
2006
2007 if (stack_max_limit && (GetQuantity() + other_item.GetQuantity() > GetQuantityMax()))
2008 return false;
2009 }
2010
2012 if (CastTo(player, GetHierarchyRootPlayer())) //false when attached to player's attachment slot
2013 {
2014 if (player.GetInventory().HasAttachment(this))
2015 return false;
2016
2017 if (player.IsItemsToDelete())
2018 return false;
2019 }
2020
2021 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
2022 return false;
2023
2024 int slotID;
2025 string slotName;
2026 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
2027 return false;
2028
2029 return true;
2030 }
eBleedingSourceType GetType()
PlayerSpawnPreset slotName
override int GetQuantityMax()
Definition ItemBase.c:3275
bool can_this_be_combined
Definition ItemBase.c:75
bool IsFullQuantity()
Definition ItemBase.c:3334
const int STATE_RUINED
Definition constants.c:757

References can_this_be_combined, GetQuantity(), GetQuantityMax(), GetType(), IsFullQuantity(), slotName, and GameConstants::STATE_RUINED.

◆ CanBeCooked()

bool InventoryItem::CanBeCooked ( )
inlineprotected

Definition at line 2378 of file ItemBase.c.

2379 {
2380 return false;
2381 }

◆ CanBeCookedOnStick()

bool InventoryItem::CanBeCookedOnStick ( )
inlineprotected

Definition at line 2383 of file ItemBase.c.

2384 {
2385 return false;
2386 }

◆ CanBeDigged()

bool InventoryItem::CanBeDigged ( )
inlineprotected

Definition at line 980 of file ItemBase.c.

981 {
982 return m_CanBeDigged;
983 }
bool m_CanBeDigged
Definition ItemBase.c:80

References m_CanBeDigged.

◆ CanBeDisinfected()

bool InventoryItem::CanBeDisinfected ( )
inlineprotected

Definition at line 3110 of file ItemBase.c.

3111 {
3112 return false;
3113 }

◆ CanBeMovedOverride()

bool InventoryItem::CanBeMovedOverride ( )
inlineprotected

Definition at line 2418 of file ItemBase.c.

2419 {
2420 return m_CanBeMovedOverride;
2421 }
bool m_CanBeMovedOverride
Definition ItemBase.c:73

References m_CanBeMovedOverride.

◆ CanBeRepairedByCrafting()

bool InventoryItem::CanBeRepairedByCrafting ( )
inlineprotected

Definition at line 936 of file ItemBase.c.

937 {
938 return true;
939 }

◆ CanBeSplit()

override bool InventoryItem::CanBeSplit ( )
inlineprotected

Definition at line 1514 of file ItemBase.c.

1515 {
1516 if (m_CanThisBeSplit)
1517 return (GetQuantity() > 1);
1518
1519 return false;
1520 }
bool m_CanThisBeSplit
Definition ItemBase.c:76

References GetQuantity(), and m_CanThisBeSplit.

◆ CanBeUsedForSuicide()

bool InventoryItem::CanBeUsedForSuicide ( )
inlineprotected

Definition at line 4674 of file ItemBase.c.

4675 {
4676 return true;
4677 }

◆ CanDecay()

bool InventoryItem::CanDecay ( )
inlineprotected

Definition at line 4547 of file ItemBase.c.

4548 {
4549 // return true used on selected food clases so they can decay
4550 return false;
4551 }

◆ CanDisplayCargo()

override bool InventoryItem::CanDisplayCargo ( )
inlineprotected

Definition at line 4011 of file ItemBase.c.

4012 {
4013 return IsOpen();
4014 }
bool IsOpen()
Definition ItemBase.c:4006

References IsOpen().

◆ CanEat()

bool InventoryItem::CanEat ( )
inlineprotected

Definition at line 2359 of file ItemBase.c.

2360 {
2361 return true;
2362 }

◆ CanExplodeInFire()

bool InventoryItem::CanExplodeInFire ( )
inlineprotected

Definition at line 2353 of file ItemBase.c.

2354 {
2355 return false;
2356 }

◆ CanHaveTemperature()

bool InventoryItem::CanHaveTemperature ( )
inlineprotected

Definition at line 4566 of file ItemBase.c.

4567 {
4568 // return true used on selected items that have a temperature effect
4569 return false;
4570 }

◆ CanHaveWetness()

bool InventoryItem::CanHaveWetness ( )
inlineprotected

Definition at line 4560 of file ItemBase.c.

4561 {
4562 // return true used on selected items that have a wetness effect
4563 return false;
4564 }

◆ CanMakeGardenplot()

bool InventoryItem::CanMakeGardenplot ( )
inlineprotected

Definition at line 985 of file ItemBase.c.

986 {
987 return false;
988 }

◆ CanObstruct()

override bool InventoryItem::CanObstruct ( )
inlineprotected

Definition at line 953 of file ItemBase.c.

954 {
955 PlayerBase player = PlayerBase.Cast(g_Game.GetPlayer());
956 return !player || !IsPlayerInside(player, "");
957 }
DayZGame g_Game
Definition DayZGame.c:3528
bool IsPlayerInside(PlayerBase player, string selection)
Definition ItemBase.c:948

References g_Game, and ItemBase::IsPlayerInside().

◆ CanPlayDeployLoopSound()

bool InventoryItem::CanPlayDeployLoopSound ( )
inlineprotected

Definition at line 4373 of file ItemBase.c.

4374 {
4375 return IsBeingPlaced() && IsSoundSynchRemote();
4376 }
bool IsSoundSynchRemote()
Definition ItemBase.c:4286
override bool IsBeingPlaced()
Definition ItemBase.c:959

References IsBeingPlaced(), and IsSoundSynchRemote().

◆ CanProcessDecay()

bool InventoryItem::CanProcessDecay ( )
inlineprotected

Definition at line 4553 of file ItemBase.c.

4554 {
4555 // this is stub, implemented on Edible_Base class
4556 // used to determine whether it is still necessary for the food to decay
4557 return false;
4558 }

◆ CanPutAsAttachment()

override bool InventoryItem::CanPutAsAttachment ( EntityAI parent)
inlineprotected

Definition at line 4034 of file ItemBase.c.

4035 {
4036 if (!super.CanPutAsAttachment(parent))
4037 {
4038 return false;
4039 }
4040
4041 if (!IsRuined() && !parent.IsRuined())
4042 {
4043 return true;
4044 }
4045
4046 return false;
4047 }

◆ CanPutInCargo()

override bool InventoryItem::CanPutInCargo ( EntityAI parent)
inlineprotected

Definition at line 4020 of file ItemBase.c.

4021 {
4022 if (parent)
4023 {
4024 if (parent.IsInherited(DayZInfected))
4025 return true;
4026
4027 if (!parent.IsRuined())
4028 return true;
4029 }
4030
4031 return true;
4032 }

◆ CanReceiveAttachment()

override bool InventoryItem::CanReceiveAttachment ( EntityAI attachment,
int slotId )
inlineprotected

Definition at line 4058 of file ItemBase.c.

4059 {
4060 //removed 15.06. coz of loading from storage -> after load items in cargo was lost -> waiting for proper solution
4061 //if (GetHealthLevel() == GameConstants.STATE_RUINED)
4062 // return false;
4063
4064 GameInventory attachmentInv = attachment.GetInventory();
4065 if (attachmentInv && attachmentInv.GetCargo() && attachmentInv.GetCargo().GetItemCount() > 0)
4066 {
4067 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
4068 return false;
4069 }
4070
4071 return super.CanReceiveAttachment(attachment, slotId);
4072 }
script counterpart to engine's class Inventory
Definition Inventory.c:79

◆ CanReceiveItemIntoCargo()

override bool InventoryItem::CanReceiveItemIntoCargo ( EntityAI item)
inlineprotected

Definition at line 4049 of file ItemBase.c.

4050 {
4051 //removed 15.06. coz of loading from storage -> after load items in cargo was lost -> waiting for proper solution
4052 //if (GetHealthLevel() == GameConstants.STATE_RUINED)
4053 // return false;
4054
4055 return super.CanReceiveItemIntoCargo(item);
4056 }

◆ CanRepair()

bool InventoryItem::CanRepair ( ItemBase item_repair_kit)
inlineprotected

Definition at line 2389 of file ItemBase.c.

2390 {
2392 return module_repairing.CanRepair(this, item_repair_kit);
2393 }
PluginBase GetPlugin(typename plugin_type)

References GetPlugin().

◆ ChangeIntoOnAttach()

override string InventoryItem::ChangeIntoOnAttach ( string slot)
inlineprotected

Definition at line 1337 of file ItemBase.c.

1338 {
1339 int idx;
1342
1343 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
1344 if (inventory_slots.Count() < 1) //is string
1345 {
1346 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
1347 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
1348 }
1349 else //is array
1350 {
1351 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
1352 }
1353
1354 idx = inventory_slots.Find(slot);
1355 if (idx < 0)
1356 return "";
1357
1358 return attach_types.Get(idx);
1359 }
array< string > TStringArray
Definition EnScript.c:666

◆ ChangeIntoOnDetach()

override string InventoryItem::ChangeIntoOnDetach ( )
inlineprotected

Definition at line 1361 of file ItemBase.c.

1362 {
1363 int idx = -1;
1364 string slot;
1365
1368
1369 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
1370 if (inventory_slots.Count() < 1) //is string
1371 {
1372 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
1373 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
1374 }
1375 else //is array
1376 {
1377 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
1378 if (detach_types.Count() < 1)
1379 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
1380 }
1381
1382 for (int i = 0; i < inventory_slots.Count(); i++)
1383 {
1384 slot = inventory_slots.Get(i);
1385 }
1386
1387 if (slot != "")
1388 {
1389 if (detach_types.Count() == 1)
1390 idx = 0;
1391 else
1392 idx = inventory_slots.Find(slot);
1393 }
1394 if (idx < 0)
1395 return "";
1396
1397 return detach_types.Get(idx);
1398 }

◆ CheckOverheating()

void InventoryItem::CheckOverheating ( ItemBase weapon = null,
string ammoType = "",
ItemBase muzzle_owner = null,
ItemBase suppressor = null,
string config_to_search = "" )
inlineprotected

Definition at line 526 of file ItemBase.c.

527 {
530
533
536
538 {
540 }
541 }
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
Definition ItemBase.c:578
int m_MaxOverheatingValue
Definition ItemBase.c:120
int m_ShotsToStartOverheating
Definition ItemBase.c:119
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
Definition ItemBase.c:585
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
Definition ItemBase.c:572
bool IsOverheatingEffectActive()
Definition ItemBase.c:543
float m_OverheatingShots
Definition ItemBase.c:117

References IsOverheatingEffectActive(), m_MaxOverheatingValue, m_OverheatingShots, m_ShotsToStartOverheating, StartOverheating(), StopOverheating(), and UpdateOverheating().

◆ ClearInventory()

override void InventoryItem::ClearInventory ( )
inlineprotected

Definition at line 3453 of file ItemBase.c.

3454 {
3455 if ((GetGame().IsServer() || !GetGame().IsMultiplayer()) && GetInventory())
3456 {
3457 GameInventory inv = GetInventory();
3459 inv.EnumerateInventory(InventoryTraversalType.INORDER, items);
3460 for (int i = 0; i < items.Count(); i++)
3461 {
3462 ItemBase item = ItemBase.Cast(items.Get(i));
3463 if (item)
3464 {
3465 GetGame().ObjectDelete(item);
3466 }
3467 }
3468 }
3469 }
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
Definition gameplay.c:6

References GetGame().

◆ Close()

void InventoryItem::Close ( )
protected

◆ CombineItems()

void InventoryItem::CombineItems ( ItemBase other_item,
bool use_stack_max = true )
inlineprotected

Definition at line 2071 of file ItemBase.c.

2072 {
2073 if (!CanBeCombined(other_item, false))
2074 return;
2075
2076 if (!IsMagazine() && other_item)
2077 {
2079 if (quantity_used != 0)
2080 {
2081 float hp1 = GetHealth01("","");
2082 float hp2 = other_item.GetHealth01("","");
2083 float hpResult = ((hp1*GetQuantity()) + (hp2*quantity_used));
2085
2086 hpResult *= GetMaxHealth();
2088 SetHealth("", "Health", hpResult);
2089
2091 other_item.AddQuantity(-quantity_used);
2092 }
2093 }
2095 }
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
Definition ItemBase.c:2052
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 re...
Definition ItemBase.c:3234
void OnCombine(ItemBase other_item)
Definition ItemBase.c:2097
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
Definition ItemBase.c:1969
Definition EnMath.c:7
static proto float Round(float f)
Returns mathematical round of value.

References AddQuantity(), ItemBase::CanBeCombined(), ComputeQuantityUsedEx(), GetQuantity(), ItemBase::OnCombine(), and Math::Round().

◆ CombineItemsClient()

override void InventoryItem::CombineItemsClient ( EntityAI entity2,
bool use_stack_max = true )
inlineprotected

Definition at line 862 of file ItemBase.c.

863 {
864 /*
865 ref Param1<EntityAI> item = new Param1<EntityAI>(entity2);
866 RPCSingleParam(ERPCs.RPC_ITEM_COMBINE, item, GetGame().GetPlayer());
867 */
869
870 if (GetGame().IsClient())
871 {
873 {
876 ctx.Write(-1);
877 ItemBase i1 = this; // @NOTE: workaround for correct serialization
878 ctx.Write(i1);
879 ctx.Write(item2);
880 ctx.Write(use_stack_max);
881 ctx.Write(-1);
882 ctx.Send();
883
885 {
886 GetGame().GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
887 }
888 }
889 }
890 else if (!GetGame().IsMultiplayer())
891 {
893 }
894 }
const int INPUT_UDT_ITEM_MANIPULATION
Definition _constants.c:8
const int c_InventoryReservationTimeoutShortMS
Definition Inventory.c:688
void CombineItems(ItemBase other_item, bool use_stack_max=true)
Definition ItemBase.c:2071
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
Definition ItemBase.c:2032
proto static native bool CanStoreInputUserData()

References GameInventory::c_InventoryReservationTimeoutShortMS, ScriptInputUserData::CanStoreInputUserData(), CombineItems(), GetGame(), INPUT_UDT_ITEM_MANIPULATION, and IsCombineAll().

◆ ComputeQuantityUsed()

int InventoryItem::ComputeQuantityUsed ( ItemBase other_item,
bool use_stack_max = true )
inlineprotected

Definition at line 2047 of file ItemBase.c.

2048 {
2050 }

References ComputeQuantityUsedEx().

◆ ComputeQuantityUsedEx()

float InventoryItem::ComputeQuantityUsedEx ( ItemBase other_item,
bool use_stack_max = true )
inlineprotected

Definition at line 2052 of file ItemBase.c.

2053 {
2054 float other_item_quantity = other_item.GetQuantity();
2055 float this_free_space;
2056
2057 float stack_max = GetQuantityMax();
2058
2060
2062 {
2063 return this_free_space;
2064 }
2065 else
2066 {
2067 return other_item_quantity;
2068 }
2069 }

References GetQuantity(), and GetQuantityMax().

◆ ContainsAgent()

bool InventoryItem::ContainsAgent ( int agent_id)
inlineprotected

Definition at line 3841 of file ItemBase.c.

3842 {
3844 {
3845 return true;
3846 }
3847 else
3848 {
3849 return false;
3850 }
3851 }
int m_AttachedAgents
Definition ItemBase.c:102

References m_AttachedAgents.

◆ ConvertEnergyToQuantity()

void InventoryItem::ConvertEnergyToQuantity ( )
inlineprotected

Definition at line 3500 of file ItemBase.c.

3501 {
3502 if (GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
3503 {
3504 if (HasQuantity())
3505 {
3506 float energy_0to1 = GetCompEM().GetEnergy0To1();
3508 }
3509 }
3510 }
bool HasQuantity()
Definition ItemBase.c:3324
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...
Definition ItemBase.c:3252

References GetGame(), HasQuantity(), and SetQuantityNormalized().

◆ CopyScriptPropertiesFrom()

void InventoryItem::CopyScriptPropertiesFrom ( EntityAI oldItem)
inlineprotected

Definition at line 4609 of file ItemBase.c.

4610 {
4611 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
4612 }

◆ DamageItemAttachments()

bool InventoryItem::DamageItemAttachments ( float damage)
inlineprotected

Definition at line 1497 of file ItemBase.c.

1498 {
1499 int attachment_count = GetInventory().AttachmentCount();
1500 if (attachment_count > 0)
1501 {
1503 ItemBase attachment = ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
1504 if (!attachment.IsExplosive())
1505 {
1506 attachment.AddHealth("","",damage);
1507 return true;
1508 }
1509 }
1510 return false;
1511 }
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].

References Math::RandomInt().

◆ DamageItemInCargo()

bool InventoryItem::DamageItemInCargo ( float damage)
inlineprotected

Definition at line 1478 of file ItemBase.c.

1479 {
1480 if (GetInventory().GetCargo())
1481 {
1482 int item_count = GetInventory().GetCargo().GetItemCount();
1483 if (item_count > 0)
1484 {
1486 ItemBase item = ItemBase.Cast(GetInventory().GetCargo().GetItem(random_pick));
1487 if (!item.IsExplosive())
1488 {
1489 item.AddHealth("","",damage);
1490 return true;
1491 }
1492 }
1493 }
1494 return false;
1495 }
EntityAI GetItem()

References GetItem(), and Math::RandomInt().

◆ DeSerializeNumericalVars()

void InventoryItem::DeSerializeNumericalVars ( array< float > floats)
inlineprotected

Definition at line 2671 of file ItemBase.c.

2672 {
2673 // the order of serialization must be the same as the order of de-serialization
2674 int index = 0;
2675 int mask = Math.Round(floats.Get(index));
2676
2677 index++;
2678 //--------------------------------------------
2679 if (mask & VARIABLE_QUANTITY)
2680 {
2681 if (m_IsStoreLoad)
2682 {
2684 }
2685 else
2686 {
2687 float quantity = floats.Get(index);
2688 SetQuantity(quantity, true, false, false, false);
2689 }
2690 index++;
2691 }
2692 //--------------------------------------------
2694 {
2695 float temperature = floats.Get(index);
2697 index++;
2698 }
2699 //--------------------------------------------
2700 if (mask & VARIABLE_WET)
2701 {
2702 float wet = floats.Get(index);
2703 SetWet(wet);
2704 index++;
2705 }
2706 //--------------------------------------------
2708 {
2709 int liquidtype = Math.Round(floats.Get(index));
2711 index++;
2712 }
2713 //--------------------------------------------
2714 if (mask & VARIABLE_COLOR)
2715 {
2717 index++;
2719 index++;
2721 index++;
2723 index++;
2724 }
2726 {
2727 int cleanness = Math.Round(floats.Get(index));
2729 index++;
2730 }
2731 //--------------------------------------------
2732 }
bool m_IsStoreLoad
Definition ItemBase.c:77
int m_ColorComponentB
Definition ItemBase.c:89
void SetLiquidType(int value, bool allow_client=false)
Definition ItemBase.c:3762
int m_ColorComponentA
Definition ItemBase.c:90
int m_ColorComponentG
Definition ItemBase.c:88
int m_ColorComponentR
Definition ItemBase.c:87
void SetCleanness(int value, bool allow_client=false)
Definition ItemBase.c:3691
const int VARIABLE_LIQUIDTYPE
Definition constants.c:583
const int VARIABLE_CLEANNESS
Definition constants.c:586
const int VARIABLE_COLOR
Definition constants.c:585
const int VARIABLE_TEMPERATURE
Definition constants.c:581
const int VARIABLE_QUANTITY
Definition constants.c:579
const int VARIABLE_WET
Definition constants.c:582

References m_ColorComponentA, m_ColorComponentB, m_ColorComponentG, m_ColorComponentR, m_IsStoreLoad, m_StoreLoadedQuantity, Math::Round(), SetCleanness(), SetLiquidType(), SetQuantity(), SetTemperature(), SetWet(), VARIABLE_CLEANNESS, VARIABLE_COLOR, VARIABLE_LIQUIDTYPE, VARIABLE_QUANTITY, VARIABLE_TEMPERATURE, and VARIABLE_WET.

◆ DoAmmoExplosion()

void InventoryItem::DoAmmoExplosion ( )
inlineprotected

Definition at line 1413 of file ItemBase.c.

1414 {
1415 Magazine magazine = Magazine.Cast(this);
1416 int pop_sounds_count = 6;
1417 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
1418
1419 //play sound
1421 string sound_name = pop_sounds[ sound_idx ];
1422 GetGame().CreateSoundOnObject(this, sound_name, 20, false);
1423
1424 //remove ammo count
1425 magazine.ServerAddAmmoCount(-1);
1426
1427 //if condition then repeat -> ExplodeAmmo
1428 float min_temp_to_explode = 100; //min temperature for item to explode
1429
1430 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode) //TODO ? add check for parent -> fireplace
1431 {
1432 ExplodeAmmo();
1433 }
1434 }
void ExplodeAmmo()
Definition ItemBase.c:1400

References ExplodeAmmo(), GetGame(), GetTemperature(), and Math::RandomInt().

◆ EEDelete()

override void InventoryItem::EEDelete ( EntityAI parent)
inlineprotected

Definition at line 1259 of file ItemBase.c.

1260 {
1261 super.EEDelete(parent);
1262 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
1263 if (player)
1264 {
1266
1267 if (player.IsAlive())
1268 {
1269 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
1270 if (r_index >= 0)
1271 {
1273 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
1274
1275 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
1276 int r_type = r_il.GetType();
1277 if (r_type == InventoryLocationType.CARGO || r_type == InventoryLocationType.PROXYCARGO)
1278 {
1279 r_il.GetParent().GetOnReleaseLock().Invoke(this);
1280 }
1281 else if (r_type == InventoryLocationType.ATTACHMENT)
1282 {
1283 r_il.GetParent().GetOnAttachmentReleaseLock().Invoke(this, r_il.GetSlot());
1284 }
1285
1286 }
1287
1288 player.RemoveQuickBarEntityShortcut(this);
1289 }
1290 }
1291 }
void OnInventoryExit(Man player)
Event called on item when it is removed from the player(Man) inventory, passes the old owner as a par...
Definition ItemBase.c:3796

References ItemBase::OnInventoryExit().

◆ EEHealthLevelChanged()

override void InventoryItem::EEHealthLevelChanged ( int oldLevel,
int newLevel,
string zone )
inlineprotected

drops content of container when ruined in fireplace

Definition at line 1869 of file ItemBase.c.

1870 {
1871 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
1872
1873 if (GetGame().IsServer())
1874 {
1876 {
1878 EntityAI parent = GetHierarchyParent();
1879 if (parent && parent.IsFireplace())
1880 {
1881 CargoBase cargo = GetInventory().GetCargo();
1882 if (cargo)
1883 {
1884 for (int i = 0; i < cargo.GetItemCount(); ++i)
1885 {
1886 parent.GetInventory().TakeEntityToInventory(InventoryMode.SERVER, FindInventoryLocationType.CARGO, cargo.GetItem(i));
1887 }
1888 }
1889 }
1890 }
1891
1892 if (IsResultOfSplit())
1893 {
1894 // reset the splitting result flag, return to normal item behavior
1895 SetResultOfSplit(false);
1896 return;
1897 }
1898
1899 if (m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
1900 {
1901 SetCleanness(0);//unclean the item upon damage dealt
1902 }
1903 }
1904 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Definition Inventory.c:22
FindInventoryLocationType
flags for searching locations in inventory
represents base for cargo storage for entities
Definition Cargo.c:7
bool IsResultOfSplit()
Definition ItemBase.c:2037
int m_Cleanness
Definition ItemBase.c:49
void SetResultOfSplit(bool value)
Definition ItemBase.c:2042

References GetGame(), IsResultOfSplit(), m_Cleanness, SetCleanness(), SetResultOfSplit(), and GameConstants::STATE_RUINED.

◆ EEHitBy()

override void InventoryItem::EEHitBy ( TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo,
vector modelPos,
float speedCoef )
inlineprotected

Definition at line 1437 of file ItemBase.c.

1438 {
1440
1441 const int CHANCE_DAMAGE_CARGO = 4;
1442 const int CHANCE_DAMAGE_ATTACHMENT = 1;
1443 const int CHANCE_DAMAGE_NOTHING = 2;
1444
1445 if (IsClothing() || IsContainer() || IsItemTent())
1446 {
1447 float dmg = damageResult.GetDamage("","Health") * -0.5;
1448 int chances;
1449 int rnd;
1450
1451 if (GetInventory().GetCargo())
1452 {
1455
1457 {
1459 }
1460 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
1461 {
1463 }
1464 }
1465 else
1466 {
1469
1471 {
1473 }
1474 }
1475 }
1476 }
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemAttachments(float damage)
Definition ItemBase.c:1497
bool DamageItemInCargo(float damage)
Definition ItemBase.c:1478

References component, DamageItemAttachments(), DamageItemInCargo(), ItemBase::IsClothing(), ItemBase::IsItemTent(), and Math::RandomInt().

◆ EEItemLocationChanged()

override void InventoryItem::EEItemLocationChanged ( notnull InventoryLocation oldLoc,
notnull InventoryLocation newLoc )
inlineprotected

Definition at line 1037 of file ItemBase.c.

1038 {
1039 super.EEItemLocationChanged(oldLoc,newLoc);
1040
1043
1044 if (newLoc.GetParent())
1045 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
1046
1047 if (oldLoc.GetParent())
1048 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
1049
1050 if (old_player && oldLoc.GetType() == InventoryLocationType.HANDS)
1051 {
1052 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
1053
1054 if (r_index >= 0)
1055 {
1057 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
1058
1059 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
1060 int r_type = r_il.GetType();
1061 if (r_type == InventoryLocationType.CARGO || r_type == InventoryLocationType.PROXYCARGO)
1062 {
1063 r_il.GetParent().GetOnReleaseLock().Invoke(this);
1064 }
1065 else if (r_type == InventoryLocationType.ATTACHMENT)
1066 {
1067 r_il.GetParent().GetOnAttachmentReleaseLock().Invoke(this, r_il.GetSlot());
1068 }
1069
1070 }
1071 }
1072
1073 if (newLoc.GetType() == InventoryLocationType.HANDS)
1074 {
1075 if (new_player)
1076 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
1077
1078 if (new_player == old_player)
1079 {
1080
1081 if (oldLoc.GetParent() && !(oldLoc.GetParent() != new_player && oldLoc.GetType() == InventoryLocationType.ATTACHMENT) && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
1082 {
1083 if (oldLoc.GetType() == InventoryLocationType.CARGO)
1084 {
1085 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
1086 {
1087 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
1088 }
1089 }
1090 else
1091 {
1092 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
1093 }
1094 }
1095
1096 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
1097 {
1098 int type = oldLoc.GetType();
1099 if (type == InventoryLocationType.CARGO || type == InventoryLocationType.PROXYCARGO)
1100 {
1101 oldLoc.GetParent().GetOnSetLock().Invoke(this);
1102 }
1103 else if (type == InventoryLocationType.ATTACHMENT)
1104 {
1105 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
1106 }
1107 }
1108 if (!m_OldLocation)
1109 {
1110 m_OldLocation = new InventoryLocation;
1111 }
1112 m_OldLocation.Copy(oldLoc);
1113 }
1114 else
1115 {
1116 if (m_OldLocation)
1117 {
1118 m_OldLocation.Reset();
1119 }
1120 }
1121
1122 GetGame().GetAnalyticsClient().OnItemAttachedAtPlayer(this,"Hands");
1123 }
1124 else
1125 {
1126 if (new_player)
1127 {
1128 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
1129 if (res_index >= 0)
1130 {
1132 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
1133 ItemBase it = ItemBase.Cast(il.GetItem());
1134 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
1135 int rel_type = il.GetType();
1136 if (rel_type == InventoryLocationType.CARGO || rel_type == InventoryLocationType.PROXYCARGO)
1137 {
1138 il.GetParent().GetOnReleaseLock().Invoke(it);
1139 }
1140 else if (rel_type == InventoryLocationType.ATTACHMENT)
1141 {
1142 il.GetParent().GetOnAttachmentReleaseLock().Invoke(it, il.GetSlot());
1143 }
1144 //it.GetOnReleaseLock().Invoke(it);
1145 }
1146 }
1147 else if (old_player && newLoc.GetType() == InventoryLocationType.GROUND && m_ThrowItemOnDrop)
1148 {
1149 //Print("---ThrowPhysically---");
1150 //ThrowPhysically(old_player, vector.Zero);
1151 m_ThrowItemOnDrop = false;
1152 }
1153
1154 if (m_OldLocation)
1155 {
1156 m_OldLocation.Reset();
1157 }
1158 }
1159 }
bool m_ThrowItemOnDrop
Definition ItemBase.c:71
proto native InventoryLocation Copy(notnull InventoryLocation rhs)
copies location data to another location

References InventoryLocation::Copy(), GetGame(), and m_ThrowItemOnDrop.

◆ EEKilled()

override void InventoryItem::EEKilled ( Object killer)
inlineprotected

item is able to explode in fire

Definition at line 1293 of file ItemBase.c.

1294 {
1295 super.EEKilled(killer);
1296
1298 if (killer && killer.IsFireplace() && CanExplodeInFire())
1299 {
1301 {
1302 if (IsMagazine())
1303 {
1304 if (Magazine.Cast(this).GetAmmoCount() > 0)
1305 {
1306 ExplodeAmmo();
1307 }
1308 }
1309 else
1310 {
1311 Explode(DamageType.EXPLOSION);
1312 }
1313 }
1314 }
1315 }
DamageType
exposed from C++ (do not change)
override void Explode(int damageType, string ammoType="")
bool CanExplodeInFire()
Definition ItemBase.c:2353
const float ITEM_TEMPERATURE_TO_EXPLODE_MIN
misc
Definition constants.c:870

References ItemBase::CanExplodeInFire(), Explode(), ExplodeAmmo(), GetTemperature(), and GameConstants::ITEM_TEMPERATURE_TO_EXPLODE_MIN.

◆ EEOnAfterLoad()

override void InventoryItem::EEOnAfterLoad ( )
inlineprotected

Definition at line 3097 of file ItemBase.c.

3098 {
3099 super.EEOnAfterLoad();
3100
3102 {
3103 m_FixDamageSystemInit = false;
3104 }
3105
3107 GetRemotelyActivatedItemBehaviour().OnAfterLoad();
3108 }
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()

References GetRemotelyActivatedItemBehaviour(), and m_FixDamageSystemInit.

◆ EEOnCECreate()

override void InventoryItem::EEOnCECreate ( )
inlineprotected

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

Definition at line 3990 of file ItemBase.c.

3991 {
3992 //Print("EEOnCECreate");
3993 if (!IsMagazine())
3995
3997 }
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
Definition ItemBase.c:4457
void SetCEBasedQuantity()
Definition ItemBase.c:803

References SetCEBasedQuantity(), and SetZoneDamageCEInit().

◆ EOnContact()

override void InventoryItem::EOnContact ( IEntity other,
Contact extra )
inlineprotected

Definition at line 1161 of file ItemBase.c.

1162 {
1164 {
1165 int liquidType = -1;
1166 float impactSpeed = ProcessImpactSoundEx(other, extra, m_ConfigWeight, m_ImpactSoundSurfaceHash, liquidType);
1167 if (impactSpeed > 0.0)
1168 {
1170 #ifndef SERVER
1171 PlayImpactSound(m_ConfigWeight, m_ImpactSpeed, m_ImpactSoundSurfaceHash);
1172 #else
1173 m_WantPlayImpactSound = true;
1174 SetSynchDirty();
1175 #endif
1176 m_CanPlayImpactSound = (liquidType == -1);// prevents further playing of the sound when the surface is a liquid type
1177 }
1178 }
1179
1180 #ifdef SERVER
1181 if (GetCompEM() && GetCompEM().IsPlugged())
1182 {
1183 if (GetCompEM().GetCordLength() < vector.Distance(GetPosition(), GetCompEM().GetEnergySource().GetPosition()))
1184 GetCompEM().UnplugThis();
1185 }
1186 #endif
1187 }
class JsonUndergroundAreaTriggerData GetPosition
float m_ImpactSpeed
Definition ItemBase.c:56
int m_ImpactSoundSurfaceHash
Definition ItemBase.c:57
bool m_WantPlayImpactSound
Definition ItemBase.c:54
bool m_CanPlayImpactSound
Definition ItemBase.c:55
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.

References vector::Distance(), GetPosition, m_CanPlayImpactSound, m_ImpactSoundSurfaceHash, m_ImpactSpeed, and m_WantPlayImpactSound.

◆ ExplodeAmmo()

void InventoryItem::ExplodeAmmo ( )
inlineprotected

Definition at line 1400 of file ItemBase.c.

1401 {
1402 //timer
1404
1405 //min/max time
1406 float min_time = 1;
1407 float max_time = 3;
1409
1410 explode_timer.Run(delay, this, "DoAmmoExplosion");
1411 }
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8

References CALL_CATEGORY_SYSTEM, and Math::RandomFloat().

◆ GetActions()

override void InventoryItem::GetActions ( typename action_input_type ,
out array< ActionBase_Basic > actions )
inlineprotected

Definition at line 304 of file ItemBase.c.

305 {
307 {
308 m_ActionsInitialize = true;
310 }
311
313 }
void InitializeActions()
Definition ItemBase.c:292

References InitializeActions(), m_ActionsInitialize, and m_InputActionMap.

◆ GetActionWidgetOverride()

bool InventoryItem::GetActionWidgetOverride ( out typename name)
inlineprotected

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

Definition at line 4637 of file ItemBase.c.

4638 {
4639 return false;
4640 }

◆ GetAgents()

override int InventoryItem::GetAgents ( )
inlineprotected

Definition at line 3888 of file ItemBase.c.

3889 {
3890 return m_AttachedAgents;
3891 }

References m_AttachedAgents.

◆ GetAttachmentSoundType()

override string InventoryItem::GetAttachmentSoundType ( )
inlineprotected

Definition at line 4263 of file ItemBase.c.

4264 {
4265 return m_SoundAttType;
4266 }
string m_SoundAttType
Definition ItemBase.c:85

References m_SoundAttType.

◆ GetBandagingEffectivity()

float InventoryItem::GetBandagingEffectivity ( )
inlineprotected

Definition at line 4422 of file ItemBase.c.

4423 {
4424 return 1.0;
4425 };

◆ GetColor()

void InventoryItem::GetColor ( out int r,
out int g,
out int b,
out int a )
inlineprotected

gets item's color variable as components

Definition at line 3735 of file ItemBase.c.

3736 {
3741 }

References m_ColorComponentA, m_ColorComponentB, m_ColorComponentG, and m_ColorComponentR.

◆ GetColorString()

string InventoryItem::GetColorString ( )
inlineprotected

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

Definition at line 3749 of file ItemBase.c.

3750 {
3751 int r,g,b,a;
3752 GetColor(r,g,b,a);
3753 r = r/255;
3754 g = g/255;
3755 b = b/255;
3756 a = a/255;
3757 return MiscGameplayFunctions.GetColorString(r, g, b, a);
3758 }
proto native int GetColor()

References GetColor().

◆ GetDamageSystemVersionChange()

int InventoryItem::GetDamageSystemVersionChange ( )
inlineprotected

Re-sets DamageSystem changes.

Returns
storage version on which the config changes occured (default -1, to be overriden!)
Note
Significant 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).

Definition at line 718 of file ItemBase.c.

719 {
720 return -1;
721 }

◆ GetDebugActions()

override void InventoryItem::GetDebugActions ( out TSelectableActionInfoArrayEx outputList)
inlineprotected

Definition at line 2126 of file ItemBase.c.

2127 {
2128 super.GetDebugActions(outputList);
2129
2130 //quantity
2131 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.ADD_QUANTITY, "Quantity +20%", FadeColors.LIGHT_GREY));
2132 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.REMOVE_QUANTITY, "Quantity -20%", FadeColors.LIGHT_GREY));
2133 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SET_QUANTITY_0, "Set Quantity 0", FadeColors.LIGHT_GREY));
2134 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SET_MAX_QUANTITY, "Set Quantity Max", FadeColors.LIGHT_GREY));
2135
2136 //health
2137 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.ADD_HEALTH, "Health +20%", FadeColors.LIGHT_GREY));
2138 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.REMOVE_HEALTH, "Health -20%", FadeColors.LIGHT_GREY));
2139 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.DESTROY_HEALTH, "Health 0", FadeColors.LIGHT_GREY));
2140 //temperature
2141 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.ADD_TEMPERATURE, "Temperature +20", FadeColors.LIGHT_GREY));
2142 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.REMOVE_TEMPERATURE, "Temperature -20", FadeColors.LIGHT_GREY));
2143
2144 //wet
2145 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.ADD_WETNESS, "Wetness +20", FadeColors.LIGHT_GREY));
2146 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.REMOVE_WETNESS, "Wetness -20", FadeColors.LIGHT_GREY));
2147
2148 //liquidtype
2149 if (IsLiquidContainer())
2150 {
2151 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.LIQUIDTYPE_UP, "LiquidType Next", FadeColors.LIGHT_GREY));
2152 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.LIQUIDTYPE_DOWN, "LiquidType Previous", FadeColors.LIGHT_GREY));
2153 }
2154
2155 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.MAKE_SPECIAL, "Make Special", FadeColors.LIGHT_GREY));
2156 // watch
2157 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.WATCH_ITEM, "Watch (CTRL-Z)", FadeColors.LIGHT_GREY));
2158 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.WATCH_PLAYER, "Watch Player", FadeColors.LIGHT_GREY));
2159
2163 }
Param4< int, int, string, int > TSelectableActionInfoWithColor
Definition EntityAI.c:97
EActions
Definition EActions.c:2
bool IsLiquidContainer()
Definition ItemBase.c:902
const int SAT_DEBUG_ACTION
Definition constants.c:424

References IsLiquidContainer(), and SAT_DEBUG_ACTION.

◆ GetDebugActionsMask()

static int InventoryItem::GetDebugActionsMask ( )
inlinestaticprotected

Definition at line 765 of file ItemBase.c.

766 {
767 return ItemBase.m_DebugActionsMask;
768 }

◆ GetDeployFinishSoundset()

string InventoryItem::GetDeployFinishSoundset ( )
protected

◆ GetDeploySoundset()

string InventoryItem::GetDeploySoundset ( )
protected

◆ GetDeployTime()

float InventoryItem::GetDeployTime ( )
inlineprotected

how long it takes to deploy this item in seconds

Definition at line 4231 of file ItemBase.c.

4232 {
4234 }
const float DEFAULT_DEPLOY

References UATimeSpent::DEFAULT_DEPLOY.

◆ GetDisinfectQuantity()

float InventoryItem::GetDisinfectQuantity ( int system = 0,
Param param1 = null )
inlineprotected

Definition at line 675 of file ItemBase.c.

676 {
677 return 250;//default value
678 }

◆ GetDryingIncrement()

float InventoryItem::GetDryingIncrement ( string pIncrementName)
inlineprotected

Definition at line 3568 of file ItemBase.c.

3569 {
3570 string paramPath = string.Format("CfgVehicles %1 EnvironmentWetnessIncrements Drying %2", GetType(), pIncrementName);
3571 if (GetGame().ConfigIsExisting(paramPath))
3572 return GetGame().ConfigGetFloat(paramPath);
3573
3574 return 0.0;
3575 }

References GetGame(), and GetType().

◆ GetEnergy()

float InventoryItem::GetEnergy ( )
inlineprotected

Definition at line 3474 of file ItemBase.c.

3475 {
3476 float energy = 0;
3477 if (HasEnergyManager())
3478 {
3479 energy = GetCompEM().GetEnergy();
3480 }
3481 return energy;
3482 }

◆ GetExplosiveTriggerSlotName()

string InventoryItem::GetExplosiveTriggerSlotName ( )
inlineprotected

Definition at line 924 of file ItemBase.c.

925 {
926 return "";
927 }

◆ GetFilterDamageRatio()

float InventoryItem::GetFilterDamageRatio ( )
inlineprotected

Definition at line 680 of file ItemBase.c.

681 {
682 return 0;
683 }

◆ GetHeadHidingSelection()

array< string > InventoryItem::GetHeadHidingSelection ( )
inlineprotected

Definition at line 4427 of file ItemBase.c.

4428 {
4430 }
ref TStringArray m_HeadHidingSelections
Definition ItemBase.c:124

References m_HeadHidingSelections.

◆ GetHeatIsolation()

float InventoryItem::GetHeatIsolation ( )
inlineprotected

Definition at line 3563 of file ItemBase.c.

3564 {
3565 return m_HeatIsolation;
3566 }
float m_HeatIsolation
Definition ItemBase.c:59

References m_HeatIsolation.

◆ GetHeatIsolationInit()

float InventoryItem::GetHeatIsolationInit ( )
inlineprotected

Definition at line 3558 of file ItemBase.c.

3559 {
3560 return ConfigGetFloat("heatIsolation");
3561 }

◆ GetInfectionChance()

float InventoryItem::GetInfectionChance ( int system = 0,
Param param = null )
inlineprotected

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.

Definition at line 669 of file ItemBase.c.

670 {
671 return 0.0;
672 }

◆ GetItemAttachOffset()

float InventoryItem::GetItemAttachOffset ( )
inlineprotected

Definition at line 3682 of file ItemBase.c.

3683 {
3684 if (ConfigIsExisting("itemAttachOffset"))
3685 {
3686 return ConfigGetFloat("itemAttachOffset");
3687 }
3688 return 0;
3689 }

◆ GetItemModelLength()

float InventoryItem::GetItemModelLength ( )
inlineprotected

Definition at line 3673 of file ItemBase.c.

3674 {
3675 if (ConfigIsExisting("itemModelLength"))
3676 {
3677 return ConfigGetFloat("itemModelLength");
3678 }
3679 return 0;
3680 }

◆ GetItemSize()

int InventoryItem::GetItemSize ( )
inlineprotected

Definition at line 2403 of file ItemBase.c.

2404 {
2405 /*
2406 vector v_size = this.ConfigGetVector("itemSize");
2407 int v_size_x = v_size[0];
2408 int v_size_y = v_size[1];
2409 int size = v_size_x * v_size_y;
2410 return size;
2411 */
2412
2413 return 1;
2414 }

◆ GetLight()

ScriptedLightBase InventoryItem::GetLight ( )
protected

◆ GetLightSourceItem()

ItemBase InventoryItem::GetLightSourceItem ( )
inlineprotected

Definition at line 4625 of file ItemBase.c.

4626 {
4627 return m_LightSourceItem;
4628 }

References m_LightSourceItem.

◆ GetLiquidType()

int InventoryItem::GetLiquidType ( )
inlineprotected

Definition at line 3776 of file ItemBase.c.

3777 {
3778 return m_VarLiquidType;
3779 }
int m_VarLiquidType
Definition ItemBase.c:62

References m_VarLiquidType.

◆ GetLiquidTypeInit()

int InventoryItem::GetLiquidTypeInit ( )
inlineprotected

Definition at line 3771 of file ItemBase.c.

3772 {
3773 return ConfigGetInt("varLiquidTypeInit");
3774 }

◆ GetLockSoundSet()

string InventoryItem::GetLockSoundSet ( )
inlineprotected

Definition at line 3718 of file ItemBase.c.

3719 {
3720 return m_LockSoundSet;
3721 }
string m_LockSoundSet
Definition ItemBase.c:137

References m_LockSoundSet.

◆ GetLockType()

int InventoryItem::GetLockType ( )
inlineprotected

Definition at line 3713 of file ItemBase.c.

3714 {
3715 return m_LockType;
3716 }

References m_LockType.

◆ GetLoopDeploySoundset()

string InventoryItem::GetLoopDeploySoundset ( )
protected

◆ GetMuzzleID()

int InventoryItem::GetMuzzleID ( )
inlineprotected

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

Definition at line 695 of file ItemBase.c.

696 {
697 if (!m_WeaponTypeToID)
699
700 if (m_WeaponTypeToID.Contains(GetType()))
701 {
702 return m_WeaponTypeToID.Get(GetType());
703 }
704 else
705 {
706 // Register new weapon ID
708 }
709
711 }
static int m_LastRegisteredWeaponID
Definition ItemBase.c:113
static ref map< string, int > m_WeaponTypeToID
Definition ItemBase.c:112

References GetType(), m_LastRegisteredWeaponID, and m_WeaponTypeToID.

◆ GetNumberOfItems()

int InventoryItem::GetNumberOfItems ( )
inlineprotected

Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.

Definition at line 3393 of file ItemBase.c.

3394 {
3395 int item_count = 0;
3396 ItemBase item;
3397
3398 if (GetInventory().GetCargo() != NULL)
3399 {
3400 item_count = GetInventory().GetCargo().GetItemCount();
3401 }
3402
3403 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
3404 {
3405 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
3406 if (item)
3407 item_count += item.GetNumberOfItems();
3408 }
3409 return item_count;
3410 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo().

◆ GetOverheatingCoef()

float InventoryItem::GetOverheatingCoef ( )
inlineprotected

Definition at line 605 of file ItemBase.c.

606 {
607 if (m_MaxOverheatingValue > 0)
609
610 return -1;
611 }

References m_MaxOverheatingValue, m_OverheatingShots, and m_ShotsToStartOverheating.

◆ GetOverheatingValue()

float InventoryItem::GetOverheatingValue ( )
inlineprotected

Definition at line 505 of file ItemBase.c.

506 {
507 return m_OverheatingShots;
508 }

References m_OverheatingShots.

◆ GetPlaceSoundset()

string InventoryItem::GetPlaceSoundset ( )
protected

◆ GetProtectionLevel()

float InventoryItem::GetProtectionLevel ( int type,
bool consider_filter = false,
int system = 0 )
inlineprotected

Definition at line 3951 of file ItemBase.c.

3952 {
3953 if (IsDamageDestroyed() || (HasQuantity() && GetQuantity() <= 0))
3954 {
3955 return 0;
3956 }
3957
3958 if (GetInventory().GetAttachmentSlotsCount() != 0)//is it an item with attachable filter ?
3959 {
3960 ItemBase filter = ItemBase.Cast(FindAttachmentBySlotName("GasMaskFilter"));
3961 if (filter)
3962 return filter.GetProtectionLevel(type, false, system);//it's a valid filter, return the protection
3963 else
3964 return 0;//otherwise return 0 when no filter attached
3965 }
3966
3967 string subclassPath, entryName;
3968
3969 switch (type)
3970 {
3971 case DEF_BIOLOGICAL:
3972 entryName = "biological";
3973 break;
3974 case DEF_CHEMICAL:
3975 entryName = "chemical";
3976 break;
3977 default:
3978 entryName = "biological";
3979 break;
3980 }
3981
3982 subclassPath = "CfgVehicles " + this.GetType() + " Protection ";
3983
3984 return GetGame().ConfigGetFloat(subclassPath + entryName);
3985 }
bool IsDamageDestroyed(ActionTarget target)
Definition ActionBase.c:841
const int DEF_BIOLOGICAL
Definition constants.c:478
const int DEF_CHEMICAL
Definition constants.c:479

References DEF_BIOLOGICAL, DEF_CHEMICAL, GetGame(), GetQuantity(), GetType(), HasQuantity(), and IsDamageDestroyed().

◆ GetQuantity()

override float InventoryItem::GetQuantity ( )
inlineprotected

Definition at line 3329 of file ItemBase.c.

3330 {
3331 return m_VarQuantity;
3332 }
float m_VarQuantity
Definition ItemBase.c:29

References m_VarQuantity.

◆ GetQuantityInit()

int InventoryItem::GetQuantityInit ( )
inlineprotected

Definition at line 3318 of file ItemBase.c.

3319 {
3320 return m_VarQuantityInit;
3321 }
int m_VarQuantityInit
Definition ItemBase.c:31

References m_VarQuantityInit.

◆ GetQuantityMax()

override int InventoryItem::GetQuantityMax ( )
inlineprotected

Definition at line 3275 of file ItemBase.c.

3276 {
3277 float max = 0;
3278
3280 if (GetInventory())
3281 GetInventory().GetCurrentInventoryLocation(il);
3282
3283 int slot = il.GetSlot();
3284
3285 if (slot != -1)
3287
3288 if (max <= 0)
3290
3291 if (max <= 0)
3293
3294 return max;
3295 }
float m_VarStackMax
Definition ItemBase.c:35
int m_VarQuantityMax
Definition ItemBase.c:33
provides access to slot configuration
static proto native int GetStackMaxForSlotId(int slot_Id)

References InventorySlots::GetStackMaxForSlotId(), m_VarQuantityMax, and m_VarStackMax.

◆ GetQuantityMin()

int InventoryItem::GetQuantityMin ( )
inlineprotected

Definition at line 3313 of file ItemBase.c.

3314 {
3315 return m_VarQuantityMin;
3316 }
int m_VarQuantityMin
Definition ItemBase.c:32

References m_VarQuantityMin.

◆ GetQuantityNormalized()

float InventoryItem::GetQuantityNormalized ( )
inlineprotected

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)

Definition at line 3261 of file ItemBase.c.

3262 {
3264 }
int GetQuantityMin()
Definition ItemBase.c:3313
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...

References GetQuantityMax(), GetQuantityMin(), Math::InverseLerp(), and m_VarQuantity.

◆ GetQuickBarBonus()

override int InventoryItem::GetQuickBarBonus ( )
inlineprotected

Definition at line 287 of file ItemBase.c.

288 {
289 return m_QuickBarBonus;
290 }
int m_QuickBarBonus
Definition ItemBase.c:64

References m_QuickBarBonus.

◆ GetRecipesActions()

void InventoryItem::GetRecipesActions ( Man player,
out TSelectableActionInfoArray outputList )
inlineprotected

Definition at line 2105 of file ItemBase.c.

2106 {
2107 PlayerBase p = PlayerBase.Cast(player);
2108
2109 array<int> recipesIds = p.m_Recipes;
2110 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(GetPlugin(PluginRecipesManager));
2112 {
2113 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
2114 moduleRecipesManager.GetValidRecipes(ItemBase.Cast(this), ItemBase.Cast(itemInHands), recipesIds, p);
2115 }
2116
2117 for (int i = 0;i < recipesIds.Count(); i++)
2118 {
2119 int key = recipesIds.Get(i);
2120 string recipeName = moduleRecipesManager.GetRecipeName(key);
2122 }
2123 }
Param3 TSelectableActionInfo
const int SAT_CRAFTING
Definition constants.c:423

References GetPlugin(), and SAT_CRAFTING.

◆ GetSingleInventoryItemWeight()

float InventoryItem::GetSingleInventoryItemWeight ( )
inlineprotected

Definition at line 3349 of file ItemBase.c.

3350 {
3352 }
override float GetSingleInventoryItemWeightEx()
Definition ItemBase.c:3340

References GetSingleInventoryItemWeightEx().

◆ GetSingleInventoryItemWeightEx()

override float InventoryItem::GetSingleInventoryItemWeightEx ( )
inlineprotected

Definition at line 3340 of file ItemBase.c.

3341 {
3342 //this needs to be first stored inside local variables, when returned directly during inside return call, the result is completely different due to enforce script bug
3343 float weightEx = GetWeightEx();//overall weight of the item
3344 float special = GetInventoryAndCargoWeight();//cargo and attachment weight
3345 return weightEx - special;
3346 }

◆ GetSoakingIncrement()

float InventoryItem::GetSoakingIncrement ( string pIncrementName)
inlineprotected

Definition at line 3577 of file ItemBase.c.

3578 {
3579 string paramPath = string.Format("CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2", GetType(), pIncrementName);
3580 if (GetGame().ConfigIsExisting(paramPath))
3581 return GetGame().ConfigGetFloat(paramPath);
3582
3583 return 0.0;
3584 }

References GetGame(), and GetType().

◆ GetTargetQuantityMax()

override int InventoryItem::GetTargetQuantityMax ( int attSlotID = -1)
inlineprotected

Definition at line 3297 of file ItemBase.c.

3298 {
3299 float quantity_max = 0;
3300
3301 if (attSlotID != -1)
3303
3304 if (quantity_max <= 0)
3306
3307 if (quantity_max <= 0)
3309
3310 return quantity_max;
3311 }

References InventorySlots::GetStackMaxForSlotId(), m_VarQuantityMax, and m_VarStackMax.

◆ GetTemperature()

override float InventoryItem::GetTemperature ( )
inlineprotected

Definition at line 3538 of file ItemBase.c.

3539 {
3540 return m_VarTemperature;
3541 }
float m_VarTemperature
Definition ItemBase.c:38

References m_VarTemperature.

◆ GetTemperatureInit()

override float InventoryItem::GetTemperatureInit ( )
inlineprotected

Definition at line 3543 of file ItemBase.c.

3544 {
3545 return m_VarTemperatureInit;
3546 }
float m_VarTemperatureInit
Definition ItemBase.c:39

References m_VarTemperatureInit.

◆ GetTemperatureMax()

override float InventoryItem::GetTemperatureMax ( )
inlineprotected

Definition at line 3553 of file ItemBase.c.

3554 {
3555 return m_VarTemperatureMax;
3556 }
float m_VarTemperatureMax
Definition ItemBase.c:41

References m_VarTemperatureMax.

◆ GetTemperatureMin()

override float InventoryItem::GetTemperatureMin ( )
inlineprotected

Definition at line 3548 of file ItemBase.c.

3549 {
3550 return m_VarTemperatureMin;
3551 }
float m_VarTemperatureMin
Definition ItemBase.c:40

References m_VarTemperatureMin.

◆ GetUnitWeight()

float InventoryItem::GetUnitWeight ( bool include_wetness = true)
inlineprotected

Obsolete, use GetWeightEx instead.

Definition at line 3413 of file ItemBase.c.

3414 {
3415 float weight = 0;
3416 float wetness = 1;
3417 if (include_wetness)
3418 wetness += GetWet();
3419 if (m_CanThisBeSplit) //quantity determines size of the stack
3420 {
3421 weight = wetness * m_ConfigWeight;
3422 }
3423 else if (ConfigGetFloat("liquidContainerType") > 0) //is a liquid container, default liquid weight is set to 1. May revisit later?
3424 {
3425 weight = 1;
3426 }
3427 return weight;
3428 }

References GetWet(), and m_CanThisBeSplit.

◆ GetValidFinishers()

array< int > InventoryItem::GetValidFinishers ( )
inlineprotected

returns an array of possible finishers

Definition at line 4631 of file ItemBase.c.

4632 {
4633 return null;
4634 }

◆ GetVariablesFloat()

array< float > InventoryItem::GetVariablesFloat ( )
inlineprotected

Definition at line 2585 of file ItemBase.c.

2586 {
2590 }
static ref TFloatArray ARRAY_FLOAT
void SerializeNumericalVars(array< float > floats_out)
Definition ItemBase.c:2631

References CachedObjectsArrays::ARRAY_FLOAT, and SerializeNumericalVars().

◆ GetWeightSpecialized()

float InventoryItem::GetWeightSpecialized ( bool forceRecalc = false)
inlineprotected

Definition at line 3354 of file ItemBase.c.

3355 {
3356 if (m_CanThisBeSplit) //quantity determines size of the stack
3357 {
3358 #ifdef DEVELOPER
3359 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
3360 {
3361 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
3362 data1.SetCalcDetails("TIB1: " + GetConfigWeightModifiedDebugText() +" * " + GetQuantity()+"(quantity)");
3363 }
3364 #endif
3365
3366 return GetQuantity() * GetConfigWeightModified();
3367 }
3368 else if (HasEnergyManager())// items with energy manager
3369 {
3370 #ifdef DEVELOPER
3371 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
3372 {
3373 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
3374 data2.SetCalcDetails("TIB2: "+super.GetWeightSpecialized(forceRecalc)+"(contents weight) + " + GetConfigWeightModifiedDebugText() +" + " + GetCompEM().GetEnergy()+"(energy) * " + ConfigGetFloat("weightPerQuantityUnit") +"(weightPerQuantityUnit)");
3375 }
3376 #endif
3377 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
3378 }
3379 else//everything else
3380 {
3381 #ifdef DEVELOPER
3382 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
3383 {
3384 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
3385 data3.SetCalcDetails("TIB3: "+super.GetWeightSpecialized(forceRecalc)+"(contents weight) + " + GetConfigWeightModifiedDebugText() +" + " + GetQuantity()+"(quantity) * " + ConfigGetFloat("weightPerQuantityUnit") +"(weightPerQuantityUnit))");
3386 }
3387 #endif
3388 return super.GetWeightSpecialized(forceRecalc) + (GetQuantity() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
3389 }
3390 }
float GetEnergy()
Definition ItemBase.c:3474

References GetEnergy(), GetQuantity(), and m_CanThisBeSplit.

◆ GetWet()

override float InventoryItem::GetWet ( )
inlineprotected

Definition at line 3615 of file ItemBase.c.

3616 {
3617 return m_VarWet;
3618 }
float m_VarWet
Definition ItemBase.c:43

References m_VarWet.

◆ GetWetInit()

override float InventoryItem::GetWetInit ( )
inlineprotected

Definition at line 3630 of file ItemBase.c.

3631 {
3632 return m_VarWetInit;
3633 }
float m_VarWetInit
Definition ItemBase.c:45

References m_VarWetInit.

◆ GetWetLevel()

override EWetnessLevel InventoryItem::GetWetLevel ( )
inlineprotected

Definition at line 3650 of file ItemBase.c.

3651 {
3652 return GetWetLevelInternal(m_VarWet);
3653 }

References m_VarWet.

◆ GetWetMax()

override float InventoryItem::GetWetMax ( )
inlineprotected

Definition at line 3620 of file ItemBase.c.

3621 {
3622 return m_VarWetMax;
3623 }
float m_VarWetMax
Definition ItemBase.c:47

References m_VarWetMax.

◆ GetWetMin()

override float InventoryItem::GetWetMin ( )
inlineprotected

Definition at line 3625 of file ItemBase.c.

3626 {
3627 return m_VarWetMin;
3628 }
float m_VarWetMin
Definition ItemBase.c:46

References m_VarWetMin.

◆ GetWrittenNoteData()

WrittenNoteData InventoryItem::GetWrittenNoteData ( )
inlineprotected

Definition at line 4437 of file ItemBase.c.

4437{};

◆ HasDebugActionsMask()

static bool InventoryItem::HasDebugActionsMask ( int mask)
inlinestaticprotected

Definition at line 770 of file ItemBase.c.

771 {
772 return ItemBase.m_DebugActionsMask & mask;
773 }

◆ HasFoodStage()

bool InventoryItem::HasFoodStage ( )
inlineprotected

Definition at line 2372 of file ItemBase.c.

2373 {
2374 string config_path = string.Format("CfgVehicles %1 Food FoodStages", GetType());
2375 return GetGame().ConfigIsExisting(config_path);
2376 }

References GetGame(), and GetType().

◆ HasMuzzle()

bool InventoryItem::HasMuzzle ( )
inlineprotected

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

Definition at line 686 of file ItemBase.c.

687 {
688 if (IsInherited(Weapon) || IsInherited(SuppressorBase))
689 return true;
690
691 return false;
692 }
script counterpart to engine's class Weapon

◆ HasQuantity()

bool InventoryItem::HasQuantity ( )
inlineprotected

Definition at line 3324 of file ItemBase.c.

3325 {
3326 return !(GetQuantityMax() - GetQuantityMin() == 0);
3327 }

References GetQuantityMax(), and GetQuantityMin().

◆ HidesSelectionBySlot()

bool InventoryItem::HidesSelectionBySlot ( )
inlineprotected

Definition at line 4432 of file ItemBase.c.

4433 {
4435 }
bool m_HideSelectionsBySlot
Definition ItemBase.c:125

References m_HideSelectionsBySlot.

◆ HierarchyCheck()

void InventoryItem::HierarchyCheck ( out bool hasParent,
out bool hasRootAsPlayer,
out ItemBase refParentIB )
inlineprotected

Definition at line 4525 of file ItemBase.c.

4526 {
4527 // hierarchy check for an item to decide whether it has some parent and it is in some player inventory
4528 EntityAI parent = GetHierarchyParent();
4529 if (!parent)
4530 {
4531 hasParent = false;
4532 hasRootAsPlayer = false;
4533 }
4534 else
4535 {
4536 hasParent = true;
4537 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
4538 refParentIB = ItemBase.Cast(parent);
4539 }
4540 }

◆ IDToName()

string InventoryItem::IDToName ( int id)
inlineprotected

Definition at line 2598 of file ItemBase.c.

2599 {
2600 PluginVariables plugin = PluginVariables.Cast(GetPlugin(PluginVariables));
2601 return plugin.GetName(id);
2602 }

References GetPlugin().

◆ IncreaseOverheating()

void InventoryItem::IncreaseOverheating ( ItemBase weapon,
string ammoType,
ItemBase muzzle_owner,
ItemBase suppressor,
string config_to_search )
inlineprotected

Definition at line 510 of file ItemBase.c.

511 {
512 if (m_MaxOverheatingValue > 0)
513 {
515
518
519 m_CheckOverheating.Stop();
520 m_CheckOverheating.Run(m_OverheatingDecayInterval, this, "OnOverheatingDecay");
521
523 }
524 }
ref Timer m_CheckOverheating
Definition ItemBase.c:118
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
Definition ItemBase.c:526
float m_OverheatingDecayInterval
Definition ItemBase.c:121

References CALL_CATEGORY_SYSTEM, CheckOverheating(), m_CheckOverheating, m_MaxOverheatingValue, m_OverheatingDecayInterval, and m_OverheatingShots.

◆ InitializeActions()

void InventoryItem::InitializeActions ( )
inlineprotected

Definition at line 292 of file ItemBase.c.

293 {
295 if (!m_InputActionMap)
296 {
299 SetActions();
301 }
302 }
map< typename, ref array< ActionBase_Basic > > TInputActionMap
string Type
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
Definition ItemBase.c:15
void SetActions()
Definition ItemBase.c:315

References m_InputActionMap, m_ItemTypeActionsMap, ItemBase::SetActions(), and Type.

◆ InitItemVariables()

void InventoryItem::InitItemVariables ( )
inlineprotected

Definition at line 195 of file ItemBase.c.

196 {
197 m_VarQuantityInit = ConfigGetInt("varQuantityInit");
198 m_VarQuantity = m_VarQuantityInit;//should be by the CE, this is just a precaution
199 m_VarQuantityMin = ConfigGetInt("varQuantityMin");
200 m_VarQuantityMax = ConfigGetInt("varQuantityMax");
201 m_VarStackMax = ConfigGetFloat("varStackMax");
202 m_Count = ConfigGetInt("count");
203
204 m_CanShowQuantity = ConfigGetBool("quantityShow");
205 m_HasQuantityBar = ConfigGetBool("quantityBar");
206
207 m_VarTemperatureInit = ConfigGetFloat("varTemperatureInit");
209 m_VarTemperatureMin = ConfigGetFloat("varTemperatureMin");
210 m_VarTemperatureMax = ConfigGetFloat("varTemperatureMax");
211
212
213 m_CleannessInit = ConfigGetInt("varCleannessInit");
215 m_CleannessMin = ConfigGetInt("varCleannessMin");
216 m_CleannessMax = ConfigGetInt("varCleannessMax");
217
218 m_WantPlayImpactSound = false;
219 m_ImpactSpeed = 0.0;
220
221 m_VarWetInit = ConfigGetFloat("varWetInit");
223 m_VarWetMin = ConfigGetFloat("varWetMin");
224 m_VarWetMax = ConfigGetFloat("varWetMax");
225
227 m_IsBeingPlaced = false;
228 m_IsHologram = false;
229 m_IsPlaceSound = false;
230 m_IsDeploySound = false;
231 m_IsTakeable = true;
232 m_IsSoundSynchRemote = false;
233 m_CanBeMovedOverride = false;
237 m_CanBeDigged = ConfigGetBool("canBeDigged");
238
239 ConfigGetIntArray("compatibleLocks", m_CompatibleLocks);
240 m_LockType = ConfigGetInt("lockType");
241
242 //Define if item can be split and set ability to be combined accordingly
243 if (ConfigIsExisting("canBeSplit"))
244 {
245 can_this_be_combined = ConfigGetBool("canBeSplit");
247 }
248
249 if (ConfigIsExisting("itemBehaviour"))
250 m_ItemBehaviour = ConfigGetInt("itemBehaviour");
251
252 //RegisterNetSyncVariableInt("m_VariablesMask");
253 if (HasQuantity()) RegisterNetSyncVariableFloat("m_VarQuantity", GetQuantityMin(), m_VarQuantityMax);
254 RegisterNetSyncVariableFloat("m_VarTemperature", GetTemperatureMin(),GetTemperatureMax());
255 RegisterNetSyncVariableFloat("m_VarWet", GetWetMin(), GetWetMax(), 2);
256 RegisterNetSyncVariableInt("m_VarLiquidType");
257 RegisterNetSyncVariableInt("m_Cleanness",0,1);
258
259 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
260 RegisterNetSyncVariableFloat("m_ImpactSpeed");
261 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
262
263 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
264 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
265 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
266 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
267
268 RegisterNetSyncVariableBool("m_IsBeingPlaced");
269 RegisterNetSyncVariableBool("m_IsTakeable");
270 RegisterNetSyncVariableBool("m_IsHologram");
271
272 if (UsesGlobalDeploy())
273 {
274 RegisterNetSyncVariableBool("m_IsSoundSynchRemote");
275 RegisterNetSyncVariableBool("m_IsDeploySound");
276 }
277
278 m_LockSoundSet = ConfigGetString("lockSoundSet");
279 }
bool m_IsBeingPlaced
Definition ItemBase.c:65
bool m_IsPlaceSound
Definition ItemBase.c:67
override float GetWetMin()
Definition ItemBase.c:3625
int m_CleannessMax
Definition ItemBase.c:52
float GetHeatIsolationInit()
Definition ItemBase.c:3558
bool m_IsSoundSynchRemote
Definition ItemBase.c:70
bool m_CanShowQuantity
Definition ItemBase.c:78
float m_ItemAttachOffset
Definition ItemBase.c:61
bool m_IsDeploySound
Definition ItemBase.c:68
bool m_HasQuantityBar
Definition ItemBase.c:79
bool m_IsTakeable
Definition ItemBase.c:69
float m_ItemModelLength
Definition ItemBase.c:60
override float GetTemperatureMax()
Definition ItemBase.c:3553
int m_CleannessMin
Definition ItemBase.c:51
bool m_IsHologram
Definition ItemBase.c:66
int GetLiquidTypeInit()
Definition ItemBase.c:3771
int m_CleannessInit
Definition ItemBase.c:50
override float GetTemperatureMin()
Definition ItemBase.c:3548
float GetItemModelLength()
Definition ItemBase.c:3673
bool UsesGlobalDeploy()
Definition ItemBase.c:282
ref array< int > m_CompatibleLocks
Definition ItemBase.c:134
float GetItemAttachOffset()
Definition ItemBase.c:3682
int m_ItemBehaviour
Definition ItemBase.c:63
override float GetWetMax()
Definition ItemBase.c:3620

References can_this_be_combined, GetHeatIsolationInit(), GetItemAttachOffset(), GetItemModelLength(), GetLiquidTypeInit(), GetQuantityMin(), GetTemperatureMax(), GetTemperatureMin(), GetWetMax(), GetWetMin(), HasQuantity(), m_CanBeDigged, m_CanBeMovedOverride, m_CanShowQuantity, m_CanThisBeSplit, m_Cleanness, m_CleannessInit, m_CleannessMax, m_CleannessMin, m_CompatibleLocks, m_Count, m_HasQuantityBar, m_HeatIsolation, m_ImpactSpeed, m_IsBeingPlaced, m_IsDeploySound, m_IsHologram, m_IsPlaceSound, m_IsSoundSynchRemote, m_IsTakeable, m_ItemAttachOffset, m_ItemBehaviour, m_ItemModelLength, m_LockSoundSet, m_LockType, m_VarLiquidType, m_VarQuantity, m_VarQuantityInit, m_VarQuantityMax, m_VarQuantityMin, m_VarStackMax, m_VarTemperature, m_VarTemperatureInit, m_VarTemperatureMax, m_VarTemperatureMin, m_VarWet, m_VarWetInit, m_VarWetMax, m_VarWetMin, m_WantPlayImpactSound, and UsesGlobalDeploy().

◆ InsertAgent()

override void InventoryItem::InsertAgent ( int agent,
float count = 1 )
inlineprotected

Definition at line 3873 of file ItemBase.c.

3874 {
3875 if (count < 1)
3876 return;
3877 //Debug.Log("Inserting Agent on item: " + agent.ToString() +" count: " + count.ToString());
3879 }

References m_AttachedAgents.

◆ IsBeingPlaced()

override bool InventoryItem::IsBeingPlaced ( )
inlineprotected

Definition at line 959 of file ItemBase.c.

960 {
961 return m_IsBeingPlaced;
962 }

References m_IsBeingPlaced.

◆ IsBloodContainer()

bool InventoryItem::IsBloodContainer ( )
inlineprotected

Definition at line 907 of file ItemBase.c.

908 {
909 return false;
910 }

◆ IsCargoException4x3()

bool InventoryItem::IsCargoException4x3 ( EntityAI item)
inlineprotected

Definition at line 4604 of file ItemBase.c.

4605 {
4606 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
4607 }

◆ IsColorSet()

bool InventoryItem::IsColorSet ( )
inlineprotected

Definition at line 3743 of file ItemBase.c.

3744 {
3746 }
bool IsVariableSet(int variable)
'true' if this variable has ever been changed from default
Definition ItemBase.c:3446

References IsVariableSet(), and VARIABLE_COLOR.

◆ IsCombineAll()

bool InventoryItem::IsCombineAll ( ItemBase other_item,
bool use_stack_max = false )
inlineprotected

Definition at line 2032 of file ItemBase.c.

2033 {
2034 return ComputeQuantityUsed(other_item, use_stack_max) == other_item.GetQuantity();
2035 }
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
Definition ItemBase.c:2047

References ComputeQuantityUsed().

◆ IsCoverFaceForShave()

bool InventoryItem::IsCoverFaceForShave ( string slot_name)
inlineprotected

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

Definition at line 4470 of file ItemBase.c.

4471 {
4472 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
4473 }

◆ IsDeployable()

bool InventoryItem::IsDeployable ( )
inlineprotected

Definition at line 4225 of file ItemBase.c.

4226 {
4227 return false;
4228 }

◆ IsDeploySound()

bool InventoryItem::IsDeploySound ( )
inlineprotected

Definition at line 4311 of file ItemBase.c.

4312 {
4313 return m_IsDeploySound;
4314 }

References m_IsDeploySound.

◆ IsExplosive()

bool InventoryItem::IsExplosive ( )
inlineprotected

explosive

Definition at line 919 of file ItemBase.c.

920 {
921 return false;
922 }

◆ IsFacingPlayer()

bool InventoryItem::IsFacingPlayer ( PlayerBase player,
string selection )
inlineprotected

Definition at line 943 of file ItemBase.c.

944 {
945 return true;
946 }

◆ IsFullQuantity()

bool InventoryItem::IsFullQuantity ( )
inlineprotected

Definition at line 3334 of file ItemBase.c.

3335 {
3336 return GetQuantity() >= GetQuantityMax();
3337 }

References GetQuantity(), and GetQuantityMax().

◆ IsHeavyBehaviour()

override bool InventoryItem::IsHeavyBehaviour ( )
inlineprotected

Definition at line 4195 of file ItemBase.c.

4196 {
4197 if (m_ItemBehaviour == 0)
4198 {
4199 return true;
4200 }
4201
4202 return false;
4203 }

References m_ItemBehaviour.

◆ IsHologram()

override bool InventoryItem::IsHologram ( )
inlineprotected

Definition at line 975 of file ItemBase.c.

976 {
977 return m_IsHologram;
978 }

References m_IsHologram.

◆ IsIgnoredByConstruction()

override bool InventoryItem::IsIgnoredByConstruction ( )
inlineprotected

Definition at line 2365 of file ItemBase.c.

2366 {
2367 return true;
2368 }

◆ IsItemBase()

override bool InventoryItem::IsItemBase ( )
inlineprotected

Definition at line 2502 of file ItemBase.c.

2503 {
2504 return true;
2505 }

◆ IsLightSource()

bool InventoryItem::IsLightSource ( )
inlineprotected

Definition at line 931 of file ItemBase.c.

932 {
933 return false;
934 }

◆ IsLiquidContainer()

bool InventoryItem::IsLiquidContainer ( )
inlineprotected

Definition at line 902 of file ItemBase.c.

903 {
904 return (ConfigGetFloat("liquidContainerType") != 0);
905 }

◆ IsLiquidPresent()

bool InventoryItem::IsLiquidPresent ( )
inlineprotected

Definition at line 896 of file ItemBase.c.

897 {
898
899 return (GetLiquidType() != 0 && HasQuantity());
900 }
int GetLiquidType()
Definition ItemBase.c:3776

References GetLiquidType(), and HasQuantity().

◆ IsNVG()

bool InventoryItem::IsNVG ( )
inlineprotected

Definition at line 912 of file ItemBase.c.

913 {
914 return false;
915 }

◆ IsOneHandedBehaviour()

override bool InventoryItem::IsOneHandedBehaviour ( )
inlineprotected

Definition at line 4205 of file ItemBase.c.

4206 {
4207 if (m_ItemBehaviour == 1)
4208 {
4209 return true;
4210 }
4211
4212 return false;
4213 }

References m_ItemBehaviour.

◆ IsOpen()

bool InventoryItem::IsOpen ( )
inlineprotected

Definition at line 4006 of file ItemBase.c.

4007 {
4008 return true;
4009 }

◆ IsOverheatingEffectActive()

bool InventoryItem::IsOverheatingEffectActive ( )
inlineprotected

Definition at line 543 of file ItemBase.c.

544 {
546 }
bool m_IsOverheatingEffectActive
Definition ItemBase.c:116

References m_IsOverheatingEffectActive.

◆ IsPlaceSound()

bool InventoryItem::IsPlaceSound ( )
inlineprotected

Definition at line 4301 of file ItemBase.c.

4302 {
4303 return m_IsPlaceSound;
4304 }

References m_IsPlaceSound.

◆ IsPlayerInside()

bool InventoryItem::IsPlayerInside ( PlayerBase player,
string selection )
inlineprotected

Definition at line 948 of file ItemBase.c.

949 {
950 return true;
951 }

◆ IsResultOfSplit()

bool InventoryItem::IsResultOfSplit ( )
inlineprotected

Definition at line 2037 of file ItemBase.c.

2038 {
2039 return m_IsResultOfSplit;
2040 }

◆ IsServerCheck()

bool InventoryItem::IsServerCheck ( bool allow_client)
inlineprotected

Definition at line 3656 of file ItemBase.c.

3657 {
3658 if (g_Game.IsServer())
3659 return true;
3660
3661 if (allow_client)
3662 return true;
3663
3664 if (GetGame().IsClient() && GetGame().IsMultiplayer())
3665 {
3666 Error("Attempting to change variable client side, variables are supposed to be changed on server only !!");
3667 return false;
3668 }
3669
3670 return true;
3671 }
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

References Error(), g_Game, and GetGame().

◆ IsSoundSynchRemote()

bool InventoryItem::IsSoundSynchRemote ( )
inlineprotected

Definition at line 4286 of file ItemBase.c.

4287 {
4288 return m_IsSoundSynchRemote;
4289 }

References m_IsSoundSynchRemote.

◆ IsTakeable()

override bool InventoryItem::IsTakeable ( )
inlineprotected

Definition at line 4245 of file ItemBase.c.

4246 {
4247 return m_IsTakeable;
4248 }

References m_IsTakeable.

◆ IsTwoHandedBehaviour()

override bool InventoryItem::IsTwoHandedBehaviour ( )
inlineprotected

Definition at line 4215 of file ItemBase.c.

4216 {
4217 if (m_ItemBehaviour == 2)
4218 {
4219 return true;
4220 }
4221
4222 return false;
4223 }

References m_ItemBehaviour.

◆ IsVariableSet()

bool InventoryItem::IsVariableSet ( int variable)
inlineprotected

'true' if this variable has ever been changed from default

Definition at line 3446 of file ItemBase.c.

3447 {
3448 return (variable & m_VariablesMask);
3449 }
int m_VariablesMask
Definition ItemBase.c:26

References m_VariablesMask.

◆ ItemBase()

void InventoryItem::ItemBase ( )
inlineprotected

Definition at line 144 of file ItemBase.c.

145 {
146 SetEventMask(EntityEvent.INIT); // Enable EOnInit event
148
152
153 if (!GetGame().IsDedicatedServer())
154 {
155 if (HasMuzzle())
156 {
158
160 {
162 }
163 }
164
166 m_ActionsInitialize = false;
167 }
168
169 m_OldLocation = null;
170
171 if (GetGame().IsServer())
172 {
173 m_AdminLog = PluginAdminLog.Cast(GetPlugin(PluginAdminLog));
174 }
175
176 if (ConfigIsExisting("headSelectionsToHide"))
177 {
179 ConfigGetTextArray("headSelectionsToHide",m_HeadHidingSelections);
180 }
181
183 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
184 {
185 m_HideSelectionsBySlot = ConfigGetBool("hideSelectionsByinventorySlot");
186 }
187
188
189
190 m_QuickBarBonus = Math.Max(0, ConfigGetInt("quickBarBonus"));
191
192 m_IsResultOfSplit = false;
193 }
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
Definition ItemBase.c:686
ref TIntArray m_SingleUseActions
Definition ItemBase.c:96
void InitItemVariables()
Definition ItemBase.c:195
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
Definition ItemBase.c:695
void LoadParticleConfigOnOverheating(int id)
Definition ItemBase.c:449
PluginAdminLog m_AdminLog
Definition ItemBase.c:128
ref TIntArray m_ContinuousActions
Definition ItemBase.c:97
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
Definition ItemBase.c:4251
ref TIntArray m_InteractActions
Definition ItemBase.c:98
void LoadParticleConfigOnFire(int id)
Definition ItemBase.c:380
array< int > TIntArray
Definition EnScript.c:668
EntityEvent
Entity events for event-mask, or throwing event from code.
Definition EnEntity.c:44
static proto float Max(float x, float y)
Returns bigger of two given values.

References GetGame(), GetMuzzleID(), GetPlugin(), HasMuzzle(), ItemBase::InitItemVariables(), LoadParticleConfigOnFire(), LoadParticleConfigOnOverheating(), m_ActionsInitialize, m_AdminLog, m_ContinuousActions, m_HeadHidingSelections, m_HideSelectionsBySlot, m_InteractActions, m_QuickBarBonus, m_ShotsToStartOverheating, m_SingleUseActions, Math::Max(), and PreLoadSoundAttachmentType().

◆ KillAllOverheatingParticles()

void InventoryItem::KillAllOverheatingParticles ( )
inlineprotected

Definition at line 641 of file ItemBase.c.

642 {
644 {
645 for (int i = m_OverheatingParticles.Count(); i > 0; i--)
646 {
647 int id = i - 1;
649
650 if (OP)
651 {
652 Particle p = OP.GetParticle();
653
654 if (p)
655 {
656 p.Stop();
657 }
658
659 delete OP;
660 }
661 }
662
665 }
666 }
ref array< ref OverheatingParticle > m_OverheatingParticles
Definition ItemBase.c:122
Legacy way of using particles in the game.
Definition Particle.c:7

References m_OverheatingParticles.

◆ KindOf()

override bool InventoryItem::KindOf ( string tag)
inlineprotected

Definition at line 2508 of file ItemBase.c.

2509 {
2510 bool found = false;
2511 string item_name = this.GetType();
2513 GetGame().ConfigGetTextArray("cfgVehicles " + item_name + " itemInfo", item_tag_array);
2514
2515 int array_size = item_tag_array.Count();
2516 for (int i = 0; i < array_size; i++)
2517 {
2518 if (item_tag_array.Get(i) == tag)
2519 {
2520 found = true;
2521 break;
2522 }
2523 }
2524 return found;
2525 }

References GetGame(), and GetType().

◆ LoadAgents()

bool InventoryItem::LoadAgents ( ParamsReadContext ctx,
int version )
inlineprotected

Definition at line 3935 of file ItemBase.c.

3936 {
3937 if (!ctx.Read(m_AttachedAgents))
3938 return false;
3939 return true;
3940 }

References m_AttachedAgents.

◆ LoadParticleConfigOnFire()

void InventoryItem::LoadParticleConfigOnFire ( int id)
inlineprotected

Definition at line 380 of file ItemBase.c.

381 {
382 if (!m_OnFireEffect)
384
387
388 string config_to_search = "CfgVehicles";
389 string muzzle_owner_config;
390
391 if (!m_OnFireEffect.Contains(id))
392 {
393 if (IsInherited(Weapon))
394 config_to_search = "CfgWeapons";
395
397
398 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
399
400 int config_OnFire_subclass_count = GetGame().ConfigGetChildrenCount(config_OnFire_class);
401
403 {
405
406 for (int i = 0; i < config_OnFire_subclass_count; i++)
407 {
408 string particle_class = "";
409 GetGame().ConfigGetChildName(config_OnFire_class, i, particle_class);
412 WPOF_array.Insert(WPOF);
413 }
414
415
416 m_OnFireEffect.Insert(id, WPOF_array);
417 }
418 }
419
420 if (!m_OnBulletCasingEjectEffect.Contains(id))
421 {
422 config_to_search = "CfgWeapons"; // Bullet Eject efect is supported on weapons only.
424
425 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
426
428
429 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
430 {
432
433 for (i = 0; i < config_OnBulletCasingEject_count; i++)
434 {
435 string particle_class2 = "";
439 WPOBE_array.Insert(WPOBE);
440 }
441
442
444 }
445 }
446 }
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
Definition ItemBase.c:110
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
Definition ItemBase.c:109

References GetGame(), GetType(), m_OnBulletCasingEjectEffect, and m_OnFireEffect.

◆ LoadParticleConfigOnOverheating()

void InventoryItem::LoadParticleConfigOnOverheating ( int id)
inlineprotected

Definition at line 449 of file ItemBase.c.

450 {
453
454 if (!m_OnOverheatingEffect.Contains(id))
455 {
456 string config_to_search = "CfgVehicles";
457
458 if (IsInherited(Weapon))
459 config_to_search = "CfgWeapons";
460
461 string muzzle_owner_config = config_to_search + " " + GetType() + " ";
462 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
463
464 if (GetGame().ConfigIsExisting(config_OnOverheating_class))
465 {
466
467 m_ShotsToStartOverheating = GetGame().ConfigGetFloat(config_OnOverheating_class + "shotsToStartOverheating");
468
470 {
471 m_ShotsToStartOverheating = -1; // This prevents futher readings from config for future creations of this item
472 string error = "Error reading config " + GetType() + ">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
473 Error(error);
474 return;
475 }
476
477 m_OverheatingDecayInterval = GetGame().ConfigGetFloat(config_OnOverheating_class + "overheatingDecayInterval");
478 m_MaxOverheatingValue = GetGame().ConfigGetFloat(config_OnOverheating_class + "maxOverheatingValue");
479
480
481
484
485 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
486 {
487 string particle_class = "";
488 GetGame().ConfigGetChildName(config_OnOverheating_class, i, particle_class);
490 int entry_type = GetGame().ConfigGetType(config_OnOverheating_entry);
491
492 if (entry_type == CT_CLASS)
493 {
495 WPOOH_array.Insert(WPOF);
496 }
497 }
498
499
501 }
502 }
503 }
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
Definition ItemBase.c:111

References Error(), GetGame(), GetType(), m_MaxOverheatingValue, m_OnOverheatingEffect, m_OverheatingDecayInterval, and m_ShotsToStartOverheating.

◆ LoadVariables()

bool InventoryItem::LoadVariables ( ParamsReadContext ctx,
int version = -1 )
inlineprotected

Definition at line 2911 of file ItemBase.c.

2912 {
2913 int varFlags;
2914 if (version <= 108 && version != -1)
2915 {
2916 //read the flags
2918 {
2919 return false;
2920 }
2921 else
2922 {
2924 //--------------
2926 {
2927 if (!ReadVarsFromCTX(ctx, version))
2928 return false;
2929 }
2930 }
2931 }
2932 else
2933 {
2934 //read the flags
2935 if (!ctx.Read(varFlags))
2936 {
2937 return false;
2938 }
2939 else
2940 {
2941 //--------------
2943 {
2944 if (!ReadVarsFromCTX(ctx, version))
2945 return false;
2946 }
2947 }
2948 }
2949 return true;
2950 }
static ref Param1< int > PARAM1_INT
bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
Definition ItemBase.c:2774
static const int FLOAT

References ItemVariableFlags::FLOAT, CachedObjectsParams::PARAM1_INT, and ReadVarsFromCTX().

◆ LockToParent()

void InventoryItem::LockToParent ( )
inlineprotected

Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible in inventory over this item.

Definition at line 837 of file ItemBase.c.

838 {
839 EntityAI parent = GetHierarchyParent();
840
841 if (parent)
842 {
844 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
845 parent.GetInventory().SetSlotLock(inventory_location_to_lock.GetSlot(), true);
846 }
847 }

◆ MessageToOwnerAction()

void InventoryItem::MessageToOwnerAction ( string text)
inlineprotected

Send message to owner player in yellow color.

Returns
void
item_stone.MessageToOwnerAction("Some Action Message");

Definition at line 2456 of file ItemBase.c.

2457 {
2458 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
2459
2460 if (player)
2461 {
2462 player.MessageAction(text);
2463 }
2464 }

◆ MessageToOwnerFriendly()

void InventoryItem::MessageToOwnerFriendly ( string text)
inlineprotected

Send message to owner player in green color.

Returns
void
item_stone.MessageToOwnerFriendly("Some Friendly Message");

Definition at line 2474 of file ItemBase.c.

2475 {
2476 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
2477
2478 if (player)
2479 {
2480 player.MessageFriendly(text);
2481 }
2482 }

◆ MessageToOwnerImportant()

void InventoryItem::MessageToOwnerImportant ( string text)
inlineprotected

Send message to owner player in red color.

Returns
void
item_stone.MessageToOwnerImportant("Some Important Message");

Definition at line 2492 of file ItemBase.c.

2493 {
2494 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
2495
2496 if (player)
2497 {
2498 player.MessageImportant(text);
2499 }
2500 }

◆ MessageToOwnerStatus()

void InventoryItem::MessageToOwnerStatus ( string text)
inlineprotected

Send message to owner player in grey color.

Returns
void
item_stone.MessageToOwnerStatus("Some Status Message");

Definition at line 2438 of file ItemBase.c.

2439 {
2440 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
2441
2442 if (player)
2443 {
2444 player.MessageStatus(text);
2445 }
2446 }

◆ NameToID()

int InventoryItem::NameToID ( string name)
inlineprotected

Definition at line 2592 of file ItemBase.c.

2593 {
2594 PluginVariables plugin = PluginVariables.Cast(GetPlugin(PluginVariables));
2595 return plugin.GetID(name);
2596 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo

References GetPlugin(), and name.

◆ OnAction()

override bool InventoryItem::OnAction ( int action_id,
Man player,
ParamsReadContext ctx )
inlineprotected

Definition at line 2168 of file ItemBase.c.

2169 {
2170 super.OnAction(action_id, player, ctx);
2171 if (action_id >= EActions.RECIPES_RANGE_START && action_id < EActions.RECIPES_RANGE_END)
2172 {
2173 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(GetPlugin(PluginRecipesManager));
2174 int idWithoutOffset = action_id - EActions.RECIPES_RANGE_START;
2175 PlayerBase p = PlayerBase.Cast(player);
2176 if (EActions.RECIPES_RANGE_START < 1000)
2177 {
2178 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
2179 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
2180 }
2181 }
2182 #ifndef SERVER
2183 else if (action_id == EActions.WATCH_PLAYER)
2184 {
2185 PluginDeveloper.SetDeveloperItemClientEx(player);
2186 }
2187 #endif
2188 if (GetGame().IsServer())
2189 {
2190 if (action_id >= EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id < EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
2191 {
2192 int id = action_id - EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
2193 OnDebugButtonPressServer(id + 1);
2194 }
2195
2196 else if (action_id >= EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id < EActions.DEBUG_AGENTS_RANGE_INJECT_END)
2197 {
2198 int agent_id = action_id - EActions.DEBUG_AGENTS_RANGE_INJECT_START;
2199 InsertAgent(agent_id,100);
2200 }
2201
2202 else if (action_id >= EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id < EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
2203 {
2204 int agent_id2 = action_id - EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
2206 }
2207
2208 else if (action_id == EActions.ADD_QUANTITY)
2209 {
2210 if (IsMagazine())
2211 {
2212 Magazine mag = Magazine.Cast(this);
2213 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
2214 }
2215 else
2216 {
2217 AddQuantity(GetQuantityMax() * 0.2);
2218 }
2219
2220 if (m_EM)
2221 {
2222 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
2223 }
2224 //PrintVariables();
2225 }
2226
2227 else if (action_id == EActions.REMOVE_QUANTITY) //Quantity -20%
2228 {
2229 if (IsMagazine())
2230 {
2231 Magazine mag2 = Magazine.Cast(this);
2232 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
2233 }
2234 else
2235 {
2236 AddQuantity(- GetQuantityMax() * 0.2);
2237 }
2238 if (m_EM)
2239 {
2240 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
2241 }
2242 //PrintVariables();
2243 }
2244
2245 else if (action_id == EActions.SET_QUANTITY_0) //SetMaxQuantity
2246 {
2247 SetQuantity(0);
2248
2249 if (m_EM)
2250 {
2251 m_EM.SetEnergy(0);
2252 }
2253 }
2254
2255 else if (action_id == EActions.SET_MAX_QUANTITY) //SetMaxQuantity
2256 {
2258
2259 if (m_EM)
2260 {
2261 m_EM.SetEnergy(m_EM.GetEnergyMax());
2262 }
2263 }
2264
2265 else if (action_id == EActions.ADD_HEALTH)
2266 {
2267 AddHealth("","",GetMaxHealth("","Health")/5);
2268 }
2269 else if (action_id == EActions.REMOVE_HEALTH)
2270 {
2271 AddHealth("","",-GetMaxHealth("","Health")/5);
2272 }
2273 else if (action_id == EActions.DESTROY_HEALTH)
2274 {
2275 SetHealth01("","",0);
2276 }
2277 else if (action_id == EActions.WATCH_ITEM)
2278 {
2280 mid.RegisterDebugItem(ItemBase.Cast(this), PlayerBase.Cast(player));
2281 #ifdef DEVELOPER
2283 #endif
2284 }
2285
2286 else if (action_id == EActions.ADD_TEMPERATURE)
2287 {
2288 AddTemperature(20);
2289 //PrintVariables();
2290 }
2291
2292 else if (action_id == EActions.REMOVE_TEMPERATURE)
2293 {
2294 AddTemperature(-20);
2295 //PrintVariables();
2296 }
2297
2298 else if (action_id == EActions.ADD_WETNESS)
2299 {
2300 AddWet(GetWetMax()/5);
2301 //PrintVariables();
2302 }
2303
2304 else if (action_id == EActions.REMOVE_WETNESS)
2305 {
2306 AddWet(-GetWetMax()/5);
2307 //PrintVariables();
2308 }
2309
2310 else if (action_id == EActions.LIQUIDTYPE_UP)
2311 {
2312 int curr_type = GetLiquidType();
2314 //AddWet(1);
2315 //PrintVariables();
2316 }
2317
2318 else if (action_id == EActions.LIQUIDTYPE_DOWN)
2319 {
2320 int curr_type2 = GetLiquidType();
2322 }
2323
2324 else if (action_id == EActions.MAKE_SPECIAL)
2325 {
2326 auto debugParams = DebugSpawnParams.WithPlayer(player);
2327 OnDebugSpawnEx(debugParams);
2328 }
2329
2330 else if (action_id == EActions.DELETE)
2331 {
2332 Delete();
2333 }
2334
2335 }
2336
2337
2338 return false;
2339 }
void PluginItemDiagnostic()
override void InsertAgent(int agent, float count=1)
Definition ItemBase.c:3873
void SetQuantityMax()
Definition ItemBase.c:3239
override void AddTemperature(float value)
Definition ItemBase.c:3528
override void RemoveAgent(int agent_id)
Definition ItemBase.c:3854
override void AddWet(float value)
Definition ItemBase.c:3605

References AddQuantity(), AddTemperature(), AddWet(), GetGame(), GetLiquidType(), GetPlugin(), GetQuantityMax(), GetWetMax(), InsertAgent(), PluginItemDiagnostic(), RemoveAgent(), SetLiquidType(), SetQuantity(), and SetQuantityMax().

◆ OnActivatedByItem()

void InventoryItem::OnActivatedByItem ( notnull ItemBase item)
protected

Called when this item is activated by other.

◆ OnActivatedByTripWire()

void InventoryItem::OnActivatedByTripWire ( )
protected

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

◆ OnApply()

void InventoryItem::OnApply ( PlayerBase player)
protected

◆ OnAttachmentQuantityChanged()

void InventoryItem::OnAttachmentQuantityChanged ( ItemBase item)
inlineprotected

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

Definition at line 1858 of file ItemBase.c.

1859 {
1860 // insert code here
1861 }

◆ OnAttachmentQuantityChangedEx()

void InventoryItem::OnAttachmentQuantityChangedEx ( ItemBase item,
float delta )
inlineprotected

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

Definition at line 1864 of file ItemBase.c.

1865 {
1867 }
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
Definition ItemBase.c:1858

References OnAttachmentQuantityChanged().

◆ OnCEUpdate()

override void InventoryItem::OnCEUpdate ( )
inlineprotected

Definition at line 4572 of file ItemBase.c.

4573 {
4574 super.OnCEUpdate();
4575
4576 bool hasParent = false, hasRootAsPlayer = false;
4578
4579 bool wwtu = g_Game.IsWorldWetTempUpdateEnabled();
4580 bool foodDecay = g_Game.IsFoodDecayEnabled();
4581
4582 if (wwtu || foodDecay)
4583 {
4587
4589 {
4591
4592 if (processWetness)
4593 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
4594
4596 ProcessItemTemperature(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
4597
4598 if (processDecay)
4599 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
4600 }
4601 }
4602 }
bool CanHaveTemperature()
Definition ItemBase.c:4566
bool CanDecay()
Definition ItemBase.c:4547
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
Definition ItemBase.c:4500
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
Definition ItemBase.c:4525
bool CanProcessDecay()
Definition ItemBase.c:4553
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
Definition ItemBase.c:4475
void ProcessDecay(float delta, bool hasRootAsPlayer)
Definition ItemBase.c:4542
bool CanHaveWetness()
Definition ItemBase.c:4560

References CanDecay(), CanHaveTemperature(), CanHaveWetness(), CanProcessDecay(), g_Game, HierarchyCheck(), ProcessDecay(), ProcessItemTemperature(), and ProcessItemWetness().

◆ OnCombine()

void InventoryItem::OnCombine ( ItemBase other_item)
inlineprotected

Definition at line 2097 of file ItemBase.c.

2098 {
2099 #ifdef SERVER
2100 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
2101 GetHierarchyParent().IncreaseLifetimeUp();
2102 #endif
2103 };

◆ OnCreatePhysics()

override void InventoryItem::OnCreatePhysics ( )
inlineprotected

Definition at line 1191 of file ItemBase.c.

1192 {
1194 }
void RefreshPhysics()

References ItemBase::RefreshPhysics().

◆ OnEndPlacement()

void InventoryItem::OnEndPlacement ( )
inlineprotected

Definition at line 973 of file ItemBase.c.

973{}

◆ OnEnergyAdded()

override void InventoryItem::OnEnergyAdded ( )
inlineprotected

Definition at line 3492 of file ItemBase.c.

3493 {
3494 super.OnEnergyAdded();
3495
3497 }
void ConvertEnergyToQuantity()
Definition ItemBase.c:3500

References ConvertEnergyToQuantity().

◆ OnEnergyConsumed()

override void InventoryItem::OnEnergyConsumed ( )
inlineprotected

Definition at line 3485 of file ItemBase.c.

3486 {
3487 super.OnEnergyConsumed();
3488
3490 }

References ConvertEnergyToQuantity().

◆ OnInventoryEnter()

void InventoryItem::OnInventoryEnter ( Man player)
inlineprotected

Event called on item when it is placed in the player(Man) inventory, passes the owner as a parameter.

Definition at line 3783 of file ItemBase.c.

3784 {
3786 if (PlayerBase.CastTo(nplayer, player))
3787 {
3788 m_CanPlayImpactSound = true;
3789 //nplayer.OnItemInventoryEnter(this);
3790 nplayer.SetEnableQuickBarEntityShortcut(this,true);
3791 }
3792 }

References m_CanPlayImpactSound.

◆ OnInventoryExit()

void InventoryItem::OnInventoryExit ( Man player)
inlineprotected

Event called on item when it is removed from the player(Man) inventory, passes the old owner as a parameter.

Definition at line 3796 of file ItemBase.c.

3797 {
3799 if (PlayerBase.CastTo(nplayer,player))
3800 {
3801 //nplayer.OnItemInventoryExit(this);
3802 nplayer.SetEnableQuickBarEntityShortcut(this,false);
3803
3804 }
3805
3806 //if (!GetGame().IsDedicatedServer())
3807 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
3808
3809
3810 if (HasEnergyManager())
3811 {
3812 GetCompEM().UpdatePlugState(); // Unplug the el. device if it's necesarry.
3813 }
3814 }

◆ OnItemAttachmentSlotChanged()

override void InventoryItem::OnItemAttachmentSlotChanged ( notnull InventoryLocation oldLoc,
notnull InventoryLocation newLoc )
inlineprotected

Definition at line 1196 of file ItemBase.c.

1197 {
1198
1199 }

◆ OnItemInHandsPlayerSwimStart()

void InventoryItem::OnItemInHandsPlayerSwimStart ( PlayerBase player)
protected

◆ OnItemLocationChanged()

override void InventoryItem::OnItemLocationChanged ( EntityAI old_owner,
EntityAI new_owner )
inlineprotected

Definition at line 1201 of file ItemBase.c.

1202 {
1203 super.OnItemLocationChanged(old_owner, new_owner);
1204
1205 Man ownerPlayerOld = null;
1206 Man ownerPlayerNew = null;
1207
1208 if (old_owner)
1209 {
1210 if (old_owner.IsMan())
1211 {
1212 ownerPlayerOld = Man.Cast(old_owner);
1213 }
1214 else
1215 {
1216 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
1217 }
1218 }
1219
1220 if (new_owner)
1221 {
1222 if (new_owner.IsMan())
1223 {
1224 ownerPlayerNew = Man.Cast(new_owner);
1225 }
1226 else
1227 {
1228 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
1229 }
1230 }
1231
1233 {
1234 if (ownerPlayerOld)
1235 {
1237 GetInventory().EnumerateInventory(InventoryTraversalType.PREORDER,subItemsExit);
1238 for (int i = 0; i < subItemsExit.Count(); i++)
1239 {
1241 itemExit.OnInventoryExit(ownerPlayerOld);
1242 }
1243 }
1244
1245 if (ownerPlayerNew)
1246 {
1248 GetInventory().EnumerateInventory(InventoryTraversalType.PREORDER,subItemsEnter);
1249 for (int j = 0; j < subItemsEnter.Count(); j++)
1250 {
1252 itemEnter.OnInventoryEnter(ownerPlayerNew);
1253 }
1254 }
1255 }
1256 }

◆ OnMovedInsideCargo()

override void InventoryItem::OnMovedInsideCargo ( EntityAI container)
inlineprotected

Definition at line 1030 of file ItemBase.c.

1031 {
1032 super.OnMovedInsideCargo(container);
1033
1034 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
1035 }

◆ OnOverheatingDecay()

void InventoryItem::OnOverheatingDecay ( )
inlineprotected

Definition at line 548 of file ItemBase.c.

549 {
550 if (m_MaxOverheatingValue > 0)
551 m_OverheatingShots -= 1 + m_OverheatingShots / m_MaxOverheatingValue; // The hotter a barrel is, the faster it needs to cool down.
552 else
554
555 if (m_OverheatingShots <= 0)
556 {
557 m_CheckOverheating.Stop();
559 }
560 else
561 {
564
565 m_CheckOverheating.Stop();
566 m_CheckOverheating.Run(m_OverheatingDecayInterval, this, "OnOverheatingDecay");
567 }
568
569 CheckOverheating(this, "", this);
570 }
const int CALL_CATEGORY_GAMEPLAY
Definition tools.c:10

References CALL_CATEGORY_GAMEPLAY, CheckOverheating(), m_CheckOverheating, m_MaxOverheatingValue, m_OverheatingDecayInterval, and m_OverheatingShots.

◆ OnPlacementComplete()

override void InventoryItem::OnPlacementComplete ( Man player,
vector position = "0 0 0",
vector orientation = "0 0 0" )
inlineprotected

Definition at line 3824 of file ItemBase.c.

3825 {
3826 if (m_AdminLog)
3827 {
3828 m_AdminLog.OnPlacementComplete(player, this);
3829 }
3830 if (GetGame().IsServer())
3831 {
3832 SetIsDeploySound(true);
3833 }
3834 super.OnPlacementComplete(player, position, orientation);
3835 }
void SetIsDeploySound(bool is_deploy_sound)
Definition ItemBase.c:4306

References GetGame(), m_AdminLog, and SetIsDeploySound().

◆ OnPlacementStarted()

override void InventoryItem::OnPlacementStarted ( Man player)
inlineprotected

Definition at line 3817 of file ItemBase.c.

3818 {
3819 super.OnPlacementStarted(player);
3820
3821 SetTakeable(false);
3822 }
override void SetTakeable(bool pState)
Definition ItemBase.c:4239

References SetTakeable().

◆ OnQuantityChanged()

void InventoryItem::OnQuantityChanged ( float delta)
inlineprotected

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

Definition at line 1846 of file ItemBase.c.

1847 {
1848 SetWeightDirty();
1849 ItemBase parent = ItemBase.Cast(GetHierarchyParent());
1850
1851 if (parent)
1852 {
1853 parent.OnAttachmentQuantityChangedEx(this, delta);
1854 }
1855 }

◆ OnRightClick()

override void InventoryItem::OnRightClick ( )
inlineprotected

Definition at line 1907 of file ItemBase.c.

1908 {
1909 super.OnRightClick();
1910
1911 if (CanBeSplit() && !GetDayZGame().IsLeftCtrlDown() && !GetGame().GetPlayer().GetInventory().HasInventoryReservation(this,null))
1912 {
1913 if (GetGame().IsClient())
1914 {
1916 {
1917 vector m4[4];
1919
1920 EntityAI root = GetHierarchyRoot();
1921
1923 if (!player.GetInventory().FindFirstFreeLocationForNewEntity(GetType(), FindInventoryLocationType.CARGO, dst))
1924 {
1925 if (root)
1926 {
1927 root.GetTransform(m4);
1928 dst.SetGround(this, m4);
1929 }
1930 else
1931 GetInventory().GetCurrentInventoryLocation(dst);
1932 }
1933 else
1934 {
1935 dst.SetCargo(dst.GetParent(), this, dst.GetIdx(), dst.GetRow(), dst.GetCol(), dst.GetFlip());
1936 if (GetGame().GetPlayer().GetInventory().HasInventoryReservation(null, dst))
1937 {
1938 if (root)
1939 {
1940 root.GetTransform(m4);
1941 dst.SetGround(this, m4);
1942 }
1943 else
1944 GetInventory().GetCurrentInventoryLocation(dst);
1945 }
1946 else
1947 {
1948 GetGame().GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
1949 }
1950 }
1951
1954 ctx.Write(4);
1955 ItemBase thiz = this; // @NOTE: workaround for correct serialization
1956 ctx.Write(thiz);
1957 dst.WriteToContext(ctx);
1958 ctx.Write(true); // dummy
1959 ctx.Send();
1960 }
1961 }
1962 else if (!GetGame().IsMultiplayer())
1963 {
1965 }
1966 }
1967 }
DayZGame GetDayZGame()
Definition DayZGame.c:3530
void SplitItem(PlayerBase player)
Definition ItemBase.c:1810
override bool CanBeSplit()
Definition ItemBase.c:1514

References GameInventory::c_InventoryReservationTimeoutShortMS, CanBeSplit(), ScriptInputUserData::CanStoreInputUserData(), GetDayZGame(), GetGame(), GetPlayer(), GetType(), INPUT_UDT_ITEM_MANIPULATION, and SplitItem().

◆ OnRPC()

override void InventoryItem::OnRPC ( PlayerIdentity sender,
int rpc_type,
ParamsReadContext ctx )
inlineprotected

Definition at line 2528 of file ItemBase.c.

2529 {
2530 //Debug.Log("OnRPC called");
2531 super.OnRPC(sender, rpc_type,ctx);
2532
2533 //Play soundset for attachment locking (ActionLockAttachment.c)
2534 switch (rpc_type)
2535 {
2536 #ifndef SERVER
2537 case ERPCs.RPC_SOUND_LOCK_ATTACH:
2539
2540 if (!ctx.Read(p))
2541 return;
2542
2543 bool play = p.param1;
2544 string soundSet = p.param2;
2545
2546 if (play)
2547 {
2548 if (m_LockingSound)
2549 {
2550 if (!m_LockingSound.IsSoundPlaying())
2551 {
2553 }
2554 }
2555 else
2556 {
2558 }
2559 }
2560 else
2561 {
2563 }
2564
2565 break;
2566 #endif
2567
2568 }
2569
2570 if (GetWrittenNoteData())
2571 {
2573 }
2574 }
ERPCs
Definition ERPCs.c:2
WrittenNoteData GetWrittenNoteData()
Definition ItemBase.c:4437
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)

References SEffectManager::DestroyEffect(), GetPosition, ItemBase::GetWrittenNoteData(), EffectSound::IsSoundPlaying(), m_LockingSound, and SEffectManager::PlaySound().

◆ OnStoreLoad()

override bool InventoryItem::OnStoreLoad ( ParamsReadContext ctx,
int version )
inlineprotected

Definition at line 2954 of file ItemBase.c.

2955 {
2956 m_IsStoreLoad = true;
2957
2959 {
2960 m_FixDamageSystemInit = true;
2961 }
2962
2963 if (!super.OnStoreLoad(ctx, version))
2964 {
2965 m_IsStoreLoad = false;
2966 return false;
2967 }
2968
2969 if (version >= 114)
2970 {
2972
2973 if (!ctx.Read(hasQuickBarIndexSaved))
2974 {
2975 m_IsStoreLoad = false;
2976 return false;
2977 }
2978
2980 {
2981 int itmQBIndex;
2982
2983 //Load quickbar item bind
2984 if (!ctx.Read(itmQBIndex))
2985 {
2986 m_IsStoreLoad = false;
2987 return false;
2988 }
2989
2990 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
2991 if (itmQBIndex != -1 && parentPlayer)
2992 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
2993 }
2994 }
2995 else
2996 {
2997 // Backup of how it used to be
2999 int itemQBIndex;
3000 if (version == int.MAX)
3001 {
3002 if (!ctx.Read(itemQBIndex))
3003 {
3004 m_IsStoreLoad = false;
3005 return false;
3006 }
3007 }
3008 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
3009 {
3010 //Load quickbar item bind
3011 if (!ctx.Read(itemQBIndex))
3012 {
3013 m_IsStoreLoad = false;
3014 return false;
3015 }
3016 if (itemQBIndex != -1 && player)
3017 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
3018 }
3019 }
3020
3021 // variable management system
3022 if (!LoadVariables(ctx, version))
3023 {
3024 m_IsStoreLoad = false;
3025 return false;
3026 }
3027
3028 //agent trasmission system
3029 if (!LoadAgents(ctx, version))
3030 {
3031 m_IsStoreLoad = false;
3032 return false;
3033 }
3034 if (version >= 132)
3035 {
3037 if (raib)
3038 {
3039 if (!raib.OnStoreLoad(ctx,version))
3040 {
3041 m_IsStoreLoad = false;
3042 return false;
3043 }
3044 }
3045 }
3046
3047 m_IsStoreLoad = false;
3048 return true;
3049 }
const int MAX
Definition EnConvert.c:27
bool LoadVariables(ParamsReadContext ctx, int version=-1)
Definition ItemBase.c:2911
int GetDamageSystemVersionChange()
Re-sets DamageSystem changes.
Definition ItemBase.c:718
bool LoadAgents(ParamsReadContext ctx, int version)
Definition ItemBase.c:3935

References Class::CastTo(), ItemBase::GetDamageSystemVersionChange(), GetRemotelyActivatedItemBehaviour(), LoadAgents(), LoadVariables(), m_FixDamageSystemInit, m_IsStoreLoad, and MAX.

◆ OnStoreSave()

override void InventoryItem::OnStoreSave ( ParamsWriteContext ctx)
inlineprotected

Definition at line 3053 of file ItemBase.c.

3054 {
3055 super.OnStoreSave(ctx);
3057 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
3058 {
3059 ctx.Write(true); // Keep track of if we should actually read this in or not
3060 //Save quickbar item bind
3061 int itemQBIndex = -1;
3062 itemQBIndex = player.FindQuickBarEntityIndex(this);
3063 ctx.Write(itemQBIndex);
3064 }
3065 else
3066 {
3067 ctx.Write(false); // Keep track of if we should actually read this in or not
3068 }
3069
3070 SaveVariables(ctx);// variable management system
3071 SaveAgents(ctx);//agent trasmission system
3072
3074 if (raib)
3075 {
3076 raib.OnStoreSave(ctx);
3077 }
3078 }
void SaveAgents(ParamsWriteContext ctx)
Definition ItemBase.c:3942
void SaveVariables(ParamsWriteContext ctx)
Definition ItemBase.c:2888

References GetRemotelyActivatedItemBehaviour(), SaveAgents(), and SaveVariables().

◆ OnSyncVariables()

void InventoryItem::OnSyncVariables ( ParamsReadContext ctx)
inlineprotected

Definition at line 2604 of file ItemBase.c.

2605 {
2606 //Debug.Log("OnSyncVariables called for item: "+ ToString(this.GetType()),"varSync");
2607 //read the flags
2608 //ref Param1<int> pflags = new Param1<int>(0);
2609 int varFlags;
2610 if (!ctx.Read(varFlags))
2611 return;
2612
2613 //ctx.Read(CachedObjectsParams.PARAM1_INT);
2614
2615 //int varFlags = CachedObjectsParams.PARAM1_INT.param1;
2616 //--------------
2617
2618
2620 {
2622 }
2623 /*
2624 if (varFlags & ItemVariableFlags.STRING)
2625 {
2626 OnSyncStrings(ctx);
2627 }
2628 */
2629 }

References ItemVariableFlags::FLOAT, and ReadVarsFromCTX().

◆ OnVariablesSynchronized()

override void InventoryItem::OnVariablesSynchronized ( )
inlineprotected

Definition at line 3117 of file ItemBase.c.

3118 {
3119 if (m_Initialized)
3120 {
3121 #ifdef PLATFORM_CONSOLE
3122 //bruteforce it is
3123 if (m_CanThisBeSplit)
3124 {
3125 UIScriptedMenu menu = GetGame().GetUIManager().FindMenu(MENU_INVENTORY);
3126 if (menu)
3127 {
3128 menu.Refresh();
3129 }
3130 }
3131 #endif
3132 }
3133
3135 {
3137 }
3138
3140 {
3142 }
3143
3144 if (IsDeploySound())
3145 {
3147 }
3148
3150 {
3151 PlayImpactSound(m_ConfigWeight, m_ImpactSpeed, m_ImpactSoundSurfaceHash);
3152 m_WantPlayImpactSound = false;
3153 }
3154
3156 {
3157 SetWeightDirty();
3159 }
3160 if (m_VarWet != m_VarWetPrev)
3161 {
3164 }
3165
3166 super.OnVariablesSynchronized();
3167 }
bool m_Initialized
float m_VarWetPrev
Definition ItemBase.c:44
void PlayDeploySound()
Definition ItemBase.c:4337
void PlayDeployLoopSoundEx()
Definition ItemBase.c:4316
bool CanPlayDeployLoopSound()
Definition ItemBase.c:4373
float m_VarQuantityPrev
Definition ItemBase.c:30
void StopDeployLoopSoundEx()
Definition ItemBase.c:4328
bool IsDeploySound()
Definition ItemBase.c:4311
override void OnWetChanged(float newVal, float oldVal)
Definition ItemBase.c:3635
const int MENU_INVENTORY
Definition constants.c:170
proto native bool dBodyIsDynamic(notnull IEntity ent)

References CanPlayDeployLoopSound(), dBodyIsDynamic(), GetGame(), IsDeploySound(), m_CanThisBeSplit, m_DeployLoopSoundEx, m_ImpactSoundSurfaceHash, m_ImpactSpeed, m_Initialized, m_VarQuantity, m_VarQuantityPrev, m_VarWet, m_VarWetPrev, m_WantPlayImpactSound, MENU_INVENTORY, OnWetChanged(), PlayDeployLoopSoundEx(), PlayDeploySound(), and StopDeployLoopSoundEx().

◆ OnWasAttached()

override void InventoryItem::OnWasAttached ( EntityAI parent,
int slot_id )
inlineprotected

Definition at line 1317 of file ItemBase.c.

1318 {
1319 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
1320
1321 super.OnWasAttached(parent, slot_id);
1322
1323 if (HasQuantity())
1324 UpdateNetSyncVariableFloat("m_VarQuantity", GetQuantityMin(), m_VarQuantityMax);
1325
1327 }
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
Definition ItemBase.c:4379
static proto native owned string GetSlotName(int id)
converts slot_id to string

References GetQuantityMin(), InventorySlots::GetSlotName(), HasQuantity(), m_VarQuantityMax, and PlayAttachSound().

◆ OnWasDetached()

override void InventoryItem::OnWasDetached ( EntityAI parent,
int slot_id )
inlineprotected

Definition at line 1329 of file ItemBase.c.

1330 {
1331 super.OnWasDetached(parent, slot_id);
1332
1333 if (HasQuantity())
1334 UpdateNetSyncVariableFloat("m_VarQuantity", GetQuantityMin(), m_VarQuantityMax);
1335 }

References GetQuantityMin(), HasQuantity(), and m_VarQuantityMax.

◆ OnWetChanged()

override void InventoryItem::OnWetChanged ( float newVal,
float oldVal )
inlineprotected

Definition at line 3635 of file ItemBase.c.

3636 {
3637 EWetnessLevel newLevel = GetWetLevelInternal(newVal);
3638 EWetnessLevel oldLevel = GetWetLevelInternal(oldVal);
3639 if (newLevel != oldLevel)
3640 {
3642 }
3643 }
EWetnessLevel
Definition EntityAI.c:2
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
Definition ItemBase.c:3645

References OnWetLevelChanged().

◆ OnWetLevelChanged()

override void InventoryItem::OnWetLevelChanged ( EWetnessLevel newLevel,
EWetnessLevel oldLevel )
inlineprotected

Definition at line 3645 of file ItemBase.c.

3646 {
3647 SetWeightDirty();
3648 }

◆ Open()

void InventoryItem::Open ( )
protected

Implementations only.

◆ PairWithDevice()

bool InventoryItem::PairWithDevice ( notnull ItemBase otherDevice)
inlineprotected

Definition at line 4642 of file ItemBase.c.

4643 {
4644 if (GetGame().IsServer())
4645 {
4648 if (!trg)
4649 {
4651 explosive = this;
4652 }
4653
4654 explosive.PairRemote(trg);
4655 trg.SetControlledDevice(explosive);
4656
4658 trg.SetPersistentPairID(persistentID);
4659 explosive.SetPersistentPairID(persistentID);
4660
4661 return true;
4662 }
4663 return false;
4664 }

References RemotelyActivatedItemBehaviour::GeneratePersistentID(), and GetGame().

◆ PerformDamageSystemReinit()

void InventoryItem::PerformDamageSystemReinit ( )
inlineprotected

Definition at line 4445 of file ItemBase.c.

4446 {
4448 GetDamageZones(zone_names);
4449 for (int i = 0; i < zone_names.Count(); i++)
4450 {
4451 SetHealthMax(zone_names.Get(i),"Health");
4452 }
4453 SetHealthMax("","Health");
4454 }

◆ PlayAttachSound()

void InventoryItem::PlayAttachSound ( string slot_type)
inlineprotected

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

Definition at line 4379 of file ItemBase.c.

4380 {
4381 if (!GetGame().IsDedicatedServer())
4382 {
4383 if (ConfigIsExisting("attachSoundSet"))
4384 {
4385 string cfg_path = "";
4386 string soundset = "";
4387 string type_name = GetType();
4388
4391 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
4392 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
4393
4394 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
4395 {
4396 for (int i = 0; i < cfg_soundset_array.Count(); i++)
4397 {
4398 if (cfg_slot_array[i] == slot_type)
4399 {
4401 break;
4402 }
4403 }
4404 }
4405
4406 if (soundset != "")
4407 {
4409 sound.SetAutodestroy(true);
4410 }
4411 }
4412 }
4413 }
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5

References GetGame(), GetPosition, GetType(), and SEffectManager::PlaySound().

◆ PlayBulletCasingEjectParticles()

static void InventoryItem::PlayBulletCasingEjectParticles ( ItemBase weapon,
string ammoType,
ItemBase muzzle_owner,
ItemBase suppressor,
string config_to_search )
inlinestaticprotected

Definition at line 4114 of file ItemBase.c.

4115 {
4116 int id = muzzle_owner.GetMuzzleID();
4118
4119 if (WPOBE_array)
4120 {
4121 for (int i = 0; i < WPOBE_array.Count(); i++)
4122 {
4124
4125 if (WPOBE)
4126 {
4128 }
4129 }
4130 }
4131 }

References m_OnBulletCasingEjectEffect.

◆ PlayDeployFinishSound()

void InventoryItem::PlayDeployFinishSound ( )
inlineprotected

Definition at line 4349 of file ItemBase.c.

4350 {
4351 if (!GetGame().IsDedicatedServer() && !m_SoundDeployFinish)
4352 {
4356 else
4357 Debug.Log("dbgSounds | null m_SoundDeployFinish from sound set: " + GetDeployFinishSoundset());
4358 }
4359 }
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
EffectSound m_SoundDeployFinish
Definition ItemBase.c:141
string GetDeployFinishSoundset()

References ItemBase::GetDeployFinishSoundset(), GetGame(), GetPosition, Debug::Log(), m_SoundDeployFinish, SEffectManager::PlaySound(), and EffectSound::SetAutodestroy().

◆ PlayDeployLoopSoundEx()

void InventoryItem::PlayDeployLoopSoundEx ( )
inlineprotected

Definition at line 4316 of file ItemBase.c.

4317 {
4318 if (!GetGame().IsDedicatedServer() && !m_DeployLoopSoundEx)
4319 {
4323 else
4324 Debug.Log("dbgSounds | null m_DeployLoopSoundEx from sound set: " + GetLoopDeploySoundset());
4325 }
4326 }
string GetLoopDeploySoundset()

References GetGame(), ItemBase::GetLoopDeploySoundset(), GetPosition, Debug::Log(), m_DeployLoopSoundEx, SEffectManager::PlaySound(), and EffectSound::SetAutodestroy().

◆ PlayDeploySound()

void InventoryItem::PlayDeploySound ( )
inlineprotected

Definition at line 4337 of file ItemBase.c.

4338 {
4339 if (!GetGame().IsDedicatedServer() && !m_SoundDeploy)
4340 {
4342 if (m_SoundDeploy)
4344 else
4345 Debug.Log("dbgSounds | null m_SoundDeploy from sound set: " + GetDeploySoundset());
4346 }
4347 }
EffectSound m_SoundDeploy
Definition ItemBase.c:140
string GetDeploySoundset()

References ItemBase::GetDeploySoundset(), GetGame(), GetPosition, Debug::Log(), m_SoundDeploy, SEffectManager::PlaySound(), and EffectSound::SetAutodestroy().

◆ PlayDetachSound()

void InventoryItem::PlayDetachSound ( string slot_type)
inlineprotected

Definition at line 4415 of file ItemBase.c.

4416 {
4417 //TODO - evaluate if needed and devise universal config structure if so
4418 }

◆ PlayFireParticles()

static void InventoryItem::PlayFireParticles ( ItemBase weapon,
int muzzle_index,
string ammoType,
ItemBase muzzle_owner,
ItemBase suppressor,
string config_to_search )
inlinestaticprotected

Definition at line 4094 of file ItemBase.c.

4095 {
4096 int id = muzzle_owner.GetMuzzleID();
4098
4099 if (WPOF_array)
4100 {
4101 for (int i = 0; i < WPOF_array.Count(); i++)
4102 {
4104
4105 if (WPOF)
4106 {
4108 }
4109 }
4110 }
4111 }

References m_OnFireEffect.

◆ PlayOverheatingParticles()

static void InventoryItem::PlayOverheatingParticles ( ItemBase weapon,
string ammoType,
ItemBase muzzle_owner,
ItemBase suppressor,
string config_to_search )
inlinestaticprotected

Definition at line 4134 of file ItemBase.c.

4135 {
4136 int id = muzzle_owner.GetMuzzleID();
4137 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
4138
4139 if (WPOOH_array)
4140 {
4141 for (int i = 0; i < WPOOH_array.Count(); i++)
4142 {
4144
4145 if (WPOOH)
4146 {
4148 }
4149 }
4150 }
4151 }

◆ PlayPlaceSound()

void InventoryItem::PlayPlaceSound ( )
inlineprotected

Definition at line 4361 of file ItemBase.c.

4362 {
4363 if (!GetGame().IsDedicatedServer() && !m_SoundPlace)
4364 {
4366 if (m_SoundPlace)
4368 else
4369 Debug.Log("dbgSounds | null m_SoundPlace from sound set: " + GetPlaceSoundset());
4370 }
4371 }
EffectSound m_SoundPlace
Definition ItemBase.c:139
string GetPlaceSoundset()

References GetGame(), ItemBase::GetPlaceSoundset(), GetPosition, Debug::Log(), m_SoundPlace, SEffectManager::PlaySound(), and EffectSound::SetAutodestroy().

◆ PreLoadSoundAttachmentType()

void InventoryItem::PreLoadSoundAttachmentType ( )
inlineprotected

Attachment Sound Type getting from config file.

Definition at line 4251 of file ItemBase.c.

4252 {
4253 string att_type = "None";
4254
4255 if (ConfigIsExisting("soundAttType"))
4256 {
4257 att_type = ConfigGetString("soundAttType");
4258 }
4259
4261 }

References m_SoundAttType.

◆ ProcessDecay()

void InventoryItem::ProcessDecay ( float delta,
bool hasRootAsPlayer )
inlineprotected

Definition at line 4542 of file ItemBase.c.

4543 {
4544 // this is stub, implemented on Edible_Base
4545 }

◆ ProcessItemTemperature()

void InventoryItem::ProcessItemTemperature ( float delta,
bool hasParent,
bool hasRootAsPlayer,
ItemBase refParentIB )
inlineprotected

Definition at line 4500 of file ItemBase.c.

4501 {
4503 {
4504 if (refParentIB)
4505 {
4506 // cooling of an item inside other
4507 if (GetTemperature() > refParentIB.GetTemperature())
4509 }
4510 else
4511 {
4512 // cooling of an item on ground or inside non-itembase (car, ...)
4514 }
4515 }
4516 }
override bool IsFireplace()
const float TEMPERATURE_RATE_COOLING_INSIDE
Definition constants.c:809

References AddTemperature(), GetTemperature(), GetTemperatureMin(), IsFireplace(), and GameConstants::TEMPERATURE_RATE_COOLING_INSIDE.

◆ ProcessItemWetness()

void InventoryItem::ProcessItemWetness ( float delta,
bool hasParent,
bool hasRootAsPlayer,
ItemBase refParentIB )
inlineprotected

Definition at line 4475 of file ItemBase.c.

4476 {
4477 if (!hasRootAsPlayer)
4478 {
4479 if (refParentIB)
4480 {
4481 // parent is wet
4484 // parent has liquid inside
4485 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (m_VarWet < m_VarWetMax))
4487 // drying
4488 else if (m_VarWet > m_VarWetMin)
4489 AddWet(-1 * delta * GetDryingIncrement("ground") * 2);
4490 }
4491 else
4492 {
4493 // drying on ground or inside non-itembase (car, ...)
4494 if (m_VarWet > m_VarWetMin)
4495 AddWet(-1 * delta * GetDryingIncrement("ground"));
4496 }
4497 }
4498 }
float GetDryingIncrement(string pIncrementName)
Definition ItemBase.c:3568
const float WETNESS_RATE_WETTING_INSIDE
Definition constants.c:804
const float WETNESS_RATE_WETTING_LIQUID
Definition constants.c:805
const float STATE_SOAKING_WET
Definition constants.c:782

References AddWet(), GetDryingIncrement(), m_VarWet, m_VarWetMax, m_VarWetMin, GameConstants::STATE_SOAKING_WET, GameConstants::WETNESS_RATE_WETTING_INSIDE, and GameConstants::WETNESS_RATE_WETTING_LIQUID.

◆ ProcessItemWetnessAndTemperature()

void InventoryItem::ProcessItemWetnessAndTemperature ( float delta,
bool hasParent,
bool hasRootAsPlayer,
ItemBase refParentIB )
inlineprotected

◆ ReadVarsFromCTX()

bool InventoryItem::ReadVarsFromCTX ( ParamsReadContext ctx,
int version = -1 )
inlineprotected

Definition at line 2774 of file ItemBase.c.

2775 {
2776 int numOfItems;
2777 int intValue;
2778 float value;
2779 if (version <= 108 && version!= -1)
2780 {
2782 return false;
2783
2786
2787 for (int i = 0; i < numOfItems; i++)
2788 {
2790 return false;
2792
2794 }
2795
2797 return true;
2798 }
2799 else if (version <= 116 && version!= -1)
2800 {
2801 if (!ctx.Read(numOfItems))
2802 return false;
2803
2805
2806 for (int j = 0; j < numOfItems; j++)
2807 {
2808 if (!ctx.Read(value))
2809 return false;
2811 }
2812
2814 return true;
2815 }
2816 else
2817 {
2818 int mask;
2819 if (!ctx.Read(mask))
2820 return false;
2821
2822 if (mask & VARIABLE_QUANTITY)
2823 {
2824 if (!ctx.Read(value))
2825 return false;
2826
2827 if (m_IsStoreLoad)
2828 {
2830 }
2831 else
2832 {
2833 SetQuantity(value, true, false, false, false);
2834 }
2835 }
2836 //--------------------------------------------
2838 {
2839 if (!ctx.Read(value))
2840 return false;
2842 }
2843 //--------------------------------------------
2844 if (mask & VARIABLE_WET)
2845 {
2846 if (!ctx.Read(value))
2847 return false;
2848 SetWet(value);
2849 }
2850 //--------------------------------------------
2852 {
2853 if (!ctx.Read(intValue))
2854 return false;
2856 }
2857 //--------------------------------------------
2858 if (mask & VARIABLE_COLOR)
2859 {
2860 if (!ctx.Read(intValue))
2861 return false;
2862
2864 if (!ctx.Read(value))
2865 return false;
2866
2868 if (!ctx.Read(value))
2869 return false;
2870
2872 if (!ctx.Read(value))
2873 return false;
2874
2876 }
2877 //--------------------------------------------
2879 {
2880 if (!ctx.Read(intValue))
2881 return false;
2883 }
2884 }
2885 return true;
2886 }
static ref Param1< float > PARAM1_FLOAT
void DeSerializeNumericalVars(array< float > floats)
Definition ItemBase.c:2671

References CachedObjectsArrays::ARRAY_FLOAT, DeSerializeNumericalVars(), m_ColorComponentA, m_ColorComponentB, m_ColorComponentG, m_ColorComponentR, m_IsStoreLoad, m_StoreLoadedQuantity, CachedObjectsParams::PARAM1_FLOAT, CachedObjectsParams::PARAM1_INT, SetCleanness(), SetLiquidType(), SetQuantity(), SetTemperature(), SetWet(), VARIABLE_CLEANNESS, VARIABLE_COLOR, VARIABLE_LIQUIDTYPE, VARIABLE_QUANTITY, VARIABLE_TEMPERATURE, and VARIABLE_WET.

◆ RefreshPhysics()

void InventoryItem::RefreshPhysics ( )
protected

◆ RegisterOverheatingParticle()

void InventoryItem::RegisterOverheatingParticle ( Particle p,
float min_heat_coef,
float max_heat_coef,
int particle_id,
Object parent,
vector local_pos,
vector local_ori )
inlineprotected

Definition at line 591 of file ItemBase.c.

592 {
595
597 OP.RegisterParticle(p);
598 OP.SetOverheatingLimitMin(min_heat_coef);
599 OP.SetOverheatingLimitMax(max_heat_coef);
600 OP.SetParticleParams(particle_id, parent, local_pos, local_ori);
601
603 }
int particle_id

References m_OverheatingParticles, and particle_id.

◆ RemoveAction()

void InventoryItem::RemoveAction ( typename actionName )
inlineprotected

Definition at line 362 of file ItemBase.c.

363 {
365 ActionBase action = player.GetActionManager().GetAction(actionName);
366 typename ai = action.GetInputType();
368
369 if (action_array)
370 {
371 action_array.RemoveItem(action);
372 }
373 }

References GetGame(), GetPlayer(), and m_InputActionMap.

◆ RemoveAgent()

override void InventoryItem::RemoveAgent ( int agent_id)
inlineprotected

Definition at line 3854 of file ItemBase.c.

3855 {
3857 {
3859 }
3860 }
bool ContainsAgent(int agent_id)
Definition ItemBase.c:3841

References ContainsAgent(), and m_AttachedAgents.

◆ RemoveAllAgents()

override void InventoryItem::RemoveAllAgents ( )
inlineprotected

Definition at line 3863 of file ItemBase.c.

3864 {
3865 m_AttachedAgents = 0;
3866 }

References m_AttachedAgents.

◆ RemoveAllAgentsExcept()

override void InventoryItem::RemoveAllAgentsExcept ( int agents_to_keep_mask)
inlineprotected

Definition at line 3868 of file ItemBase.c.

References m_AttachedAgents.

◆ RemoveDebugActionsMask()

static void InventoryItem::RemoveDebugActionsMask ( int mask)
inlinestaticprotected

Definition at line 785 of file ItemBase.c.

786 {
787 ItemBase.m_DebugActionsMask &= ~mask;
788 }

◆ RemoveItemVariable()

void InventoryItem::RemoveItemVariable ( int variable)
inlineprotected

Removes variable from variable mask, making it appear as though the variable has never been changed from default.

Definition at line 3440 of file ItemBase.c.

3441 {
3443 }

References m_VariablesMask.

◆ RemoveLightSourceItem()

void InventoryItem::RemoveLightSourceItem ( )
inlineprotected

Definition at line 4620 of file ItemBase.c.

4621 {
4623 }

References m_LightSourceItem.

◆ Repair()

bool InventoryItem::Repair ( PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight )
inlineprotected

Definition at line 2396 of file ItemBase.c.

References GetPlugin().

◆ SaveAgents()

void InventoryItem::SaveAgents ( ParamsWriteContext ctx)
inlineprotected

Definition at line 3942 of file ItemBase.c.

3943 {
3944
3945 ctx.Write(m_AttachedAgents);
3946 }

References m_AttachedAgents.

◆ SaveVariables()

void InventoryItem::SaveVariables ( ParamsWriteContext ctx)
inlineprotected

Definition at line 2888 of file ItemBase.c.

2889 {
2890 //Debug.Log("Saving Item Stage 0 "+ClassName(this)+" " + ToString(this));
2891
2892 //first set the flags
2893
2894 int varFlags = 0;
2895
2896 if (m_VariablesMask)
2898
2899 ctx.Write(varFlags);
2900 //-------------------
2901
2902 //now serialize the variables
2903
2904 //floats
2905 if (m_VariablesMask)
2907 }
void WriteVarsToCTX(ParamsWriteContext ctx)
Definition ItemBase.c:2735

References ItemVariableFlags::FLOAT, m_VariablesMask, and WriteVarsToCTX().

◆ SerializeNumericalVars()

void InventoryItem::SerializeNumericalVars ( array< float > floats_out)
inlineprotected

Definition at line 2631 of file ItemBase.c.

2632 {
2633 // the order of serialization must be the same as the order of de-serialization
2635 //--------------------------------------------
2637 {
2638 floats_out.Insert(m_VarQuantity);
2639 }
2640 //--------------------------------------------
2642 {
2644 }
2645 //--------------------------------------------
2647 {
2648 floats_out.Insert(m_VarWet);
2649 }
2650 //--------------------------------------------
2652 {
2654 }
2655 //--------------------------------------------
2657 {
2662 }
2663 //--------------------------------------------
2665 {
2666 floats_out.Insert(m_Cleanness);
2667 }
2668 //--------------------------------------------
2669 }

References IsVariableSet(), m_Cleanness, m_ColorComponentA, m_ColorComponentB, m_ColorComponentG, m_ColorComponentR, m_VariablesMask, m_VarLiquidType, m_VarQuantity, m_VarTemperature, m_VarWet, VARIABLE_CLEANNESS, VARIABLE_COLOR, VARIABLE_LIQUIDTYPE, VARIABLE_QUANTITY, VARIABLE_TEMPERATURE, and VARIABLE_WET.

◆ SetActions()

void InventoryItem::SetActions ( )
inlineprotected

◆ SetCanBeMovedOverride()

void InventoryItem::SetCanBeMovedOverride ( bool setting)
inlineprotected

Definition at line 2425 of file ItemBase.c.

2426 {
2428 }

References m_CanBeMovedOverride.

◆ SetCEBasedQuantity()

void InventoryItem::SetCEBasedQuantity ( )
inlineprotected

Definition at line 803 of file ItemBase.c.

804 {
805 if (GetEconomyProfile())
806 {
807 float q_max = GetEconomyProfile().GetQuantityMax();
808 if (q_max > 0)
809 {
810 float q_min = GetEconomyProfile().GetQuantityMin();
812
813 if (HasComponent(COMP_TYPE_ENERGY_MANAGER))//more direct access for speed
814 {
815 ComponentEnergyManager comp = GetCompEM();
816 if (comp && (comp.GetEnergyMaxPristine() || comp.GetEnergyAtSpawn()))//checking for a potential for energy, we need to check both values, as both are optional, only when both are set to 0, we know the item can't have energy
817 {
818 //Print("setting EM quantity for " + this + " to " + quantity_randomized);
819 comp.SetEnergy0To1(quantity_randomized);
820 }
821 /*
822 else
823 Print("NOT setting EM quantity for " + this + " to " + quantity_randomized);
824 */
825 }
826 else if (HasQuantity())
827 {
829 //PrintString("<==> Normalized quantity for item: "+ GetType()+", qmin:"+q_min.ToString()+"; qmax:"+q_max.ToString()+";quantity:" +quantity_randomized.ToString());
830 }
831
832 }
833 }
834 }
const int COMP_TYPE_ENERGY_MANAGER
Definition Component.c:9
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106

References COMP_TYPE_ENERGY_MANAGER, HasQuantity(), Math::RandomFloatInclusive(), and SetQuantityNormalized().

◆ SetCleanness()

void InventoryItem::SetCleanness ( int value,
bool allow_client = false )
inlineprotected

Definition at line 3691 of file ItemBase.c.

3692 {
3694 return;
3695
3697
3699
3702 }
void SetVariableMask(int variable)
Definition ItemBase.c:3430
bool IsServerCheck(bool allow_client)
Definition ItemBase.c:3656
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.

References Math::Clamp(), IsServerCheck(), m_Cleanness, m_CleannessMax, m_CleannessMin, SetVariableMask(), and VARIABLE_CLEANNESS.

◆ SetColor()

void InventoryItem::SetColor ( int r,
int g,
int b,
int a )
inlineprotected

◆ SetDebugActionsMask()

static void InventoryItem::SetDebugActionsMask ( int mask)
inlinestaticprotected

Definition at line 775 of file ItemBase.c.

776 {
777 ItemBase.m_DebugActionsMask = mask;
778 }

◆ SetIsBeingPlaced()

void InventoryItem::SetIsBeingPlaced ( bool is_being_placed)
inlineprotected

Definition at line 964 of file ItemBase.c.

965 {
967 if (!is_being_placed)
969 SetSynchDirty();
970 }
void OnEndPlacement()
Definition ItemBase.c:973

References m_IsBeingPlaced, and ItemBase::OnEndPlacement().

◆ SetIsDeploySound()

void InventoryItem::SetIsDeploySound ( bool is_deploy_sound)
inlineprotected

Definition at line 4306 of file ItemBase.c.

4307 {
4309 }

References m_IsDeploySound.

◆ SetIsHologram()

void InventoryItem::SetIsHologram ( bool is_hologram)
inlineprotected

Definition at line 990 of file ItemBase.c.

991 {
993 SetSynchDirty();
994 }

References m_IsHologram.

◆ SetIsPlaceSound()

void InventoryItem::SetIsPlaceSound ( bool is_place_sound)
inlineprotected

Definition at line 4296 of file ItemBase.c.

4297 {
4299 }

References m_IsPlaceSound.

◆ SetLiquidType()

void InventoryItem::SetLiquidType ( int value,
bool allow_client = false )
inlineprotected

Definition at line 3762 of file ItemBase.c.

3763 {
3765 return;
3766
3769 }

References IsServerCheck(), m_VarLiquidType, SetVariableMask(), and VARIABLE_LIQUIDTYPE.

◆ SetQuantity()

bool InventoryItem::SetQuantity ( float value,
bool destroy_config = true,
bool destroy_forced = false,
bool allow_client = false,
bool clamp_to_stack_max = true )
inlineprotected

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.

Definition at line 3172 of file ItemBase.c.

3173 {
3175 return false;
3176
3177 if (!HasQuantity())
3178 return false;
3179
3180 if (IsLiquidContainer() && GetLiquidType() == 0)
3181 {
3182 Debug.LogError("No LiquidType specified, try setting 'varLiquidTypeInit' to a particular liquid type");
3183 return false;
3184 }
3185
3186 float min = GetQuantityMin();
3187 float max = GetQuantityMax();
3188
3189 if (value <= (min + 0.001))
3190 value = min;
3191
3192 if (value == min)
3193 {
3194 if (destroy_config)
3195 {
3196 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
3197 if (dstr)
3198 {
3200 this.Delete();
3201 return true;
3202 }
3203 }
3204 else if (destroy_forced)
3205 {
3207 this.Delete();
3208 return true;
3209 }
3210 // we get here if destroy_config IS true AND dstr(config destroy param) IS false;
3211 RemoveAllAgents();//we remove all agents when we got to the min value, but the item is not getting deleted
3212 }
3213
3214 float delta = m_VarQuantity;
3216
3217 if (m_StoreLoadedQuantity == float.LOWEST)//any other value means we are setting quantity from storage
3218 {
3220
3221 if (delta)
3222 {
3224 }
3225 }
3226
3228
3229 return false;
3230 }
override void RemoveAllAgents()
Definition ItemBase.c:3863
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
Definition ItemBase.c:1846

References Math::Clamp(), GetLiquidType(), GetQuantityMax(), GetQuantityMin(), HasQuantity(), IsLiquidContainer(), IsServerCheck(), Debug::LogError(), LOWEST, m_StoreLoadedQuantity, m_VarQuantity, OnQuantityChanged(), RemoveAllAgents(), SetVariableMask(), and VARIABLE_QUANTITY.

◆ SetQuantityMax()

void InventoryItem::SetQuantityMax ( )
inlineprotected

Definition at line 3239 of file ItemBase.c.

3240 {
3241 float max = GetQuantityMax();
3243 }

References GetQuantityMax(), and SetQuantity().

◆ SetQuantityNormalized()

void InventoryItem::SetQuantityNormalized ( float value,
bool destroy_config = true,
bool destroy_forced = false )
inlineprotected

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)

Definition at line 3252 of file ItemBase.c.

3253 {
3254 float value_clamped = Math.Clamp(value, 0, 1);//just to make sure
3257 }
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.

References Math::Clamp(), GetQuantityMax(), GetQuantityMin(), Math::Lerp(), Math::Round(), and SetQuantity().

◆ SetQuantityToMinimum()

override void InventoryItem::SetQuantityToMinimum ( )
inlineprotected

Definition at line 3245 of file ItemBase.c.

3246 {
3247 float min = GetQuantityMin();
3249 }

References GetQuantityMin(), and SetQuantity().

◆ SetResultOfSplit()

void InventoryItem::SetResultOfSplit ( bool value)
inlineprotected

Definition at line 2042 of file ItemBase.c.

2043 {
2045 }

◆ SetTakeable()

override void InventoryItem::SetTakeable ( bool pState)
inlineprotected

Definition at line 4239 of file ItemBase.c.

4240 {
4242 SetSynchDirty();
4243 }

References m_IsTakeable.

◆ SetTemperature()

override void InventoryItem::SetTemperature ( float value,
bool allow_client = false )
inlineprotected

◆ SetTemperatureMax()

override void InventoryItem::SetTemperatureMax ( )
inlineprotected

Definition at line 3533 of file ItemBase.c.

3534 {
3536 }

References m_VarTemperatureMax, and SetTemperature().

◆ SetVariableMask()

void InventoryItem::SetVariableMask ( int variable)
inlineprotected

Definition at line 3430 of file ItemBase.c.

3431 {
3433 if (GetGame().IsServer())
3434 {
3435 SetSynchDirty();
3436 }
3437 }

References GetGame(), and m_VariablesMask.

◆ SetWet()

override void InventoryItem::SetWet ( float value,
bool allow_client = false )
inlineprotected

Definition at line 3586 of file ItemBase.c.

3587 {
3589 return;
3590
3591 float min = GetWetMin();
3592 float max = GetWetMax();
3593
3594 float previousValue = m_VarWet;
3595
3597
3598 if (previousValue != m_VarWet)
3599 {
3602 }
3603 }

References Math::Clamp(), GetWetMax(), GetWetMin(), IsServerCheck(), m_VarWet, OnWetChanged(), SetVariableMask(), and VARIABLE_WET.

◆ SetWetMax()

override void InventoryItem::SetWetMax ( )
inlineprotected

Definition at line 3610 of file ItemBase.c.

3611 {
3613 }

References m_VarWetMax, and SetWet().

◆ SetZoneDamageCEInit()

void InventoryItem::SetZoneDamageCEInit ( )
inlineprotected

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

Definition at line 4457 of file ItemBase.c.

4458 {
4459 float global_health = GetHealth01("","Health");
4461 GetDamageZones(zones);
4462 //set damage of all zones to match global health level
4463 for (int i = 0; i < zones.Count(); i++)
4464 {
4465 SetHealth01(zones.Get(i),"Health",global_health);
4466 }
4467 }

◆ SoundSynchRemote()

void InventoryItem::SoundSynchRemote ( )
inlineprotected

Definition at line 4279 of file ItemBase.c.

4280 {
4281 m_IsSoundSynchRemote = true;
4282
4283 SetSynchDirty();
4284 }

References m_IsSoundSynchRemote.

◆ SoundSynchRemoteReset()

void InventoryItem::SoundSynchRemoteReset ( )
inlineprotected

Definition at line 4272 of file ItemBase.c.

4273 {
4274 m_IsSoundSynchRemote = false;
4275
4276 SetSynchDirty();
4277 }

References m_IsSoundSynchRemote.

◆ SplitIntoStackMax()

void InventoryItem::SplitIntoStackMax ( EntityAI destination_entity,
int slot_id,
PlayerBase player )
inlineprotected

Definition at line 1545 of file ItemBase.c.

1546 {
1547 float split_quantity_new;
1549 float quantity = GetQuantity();
1552
1554 {
1555 if (stack_max <= GetQuantity())
1557 else
1559
1560 new_item = ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(this.GetType(), slot_id));
1561 if (new_item)
1562 {
1563 new_item.SetResultOfSplit(true);
1564 MiscGameplayFunctions.TransferItemProperties(this, new_item);
1566 new_item.SetQuantity(split_quantity_new);
1567 }
1568 }
1569 else if (destination_entity && slot_id == -1)
1570 {
1571 if (quantity > stack_max)
1573 else
1575
1576 if (destination_entity.GetInventory().FindFreeLocationFor(this, FindInventoryLocationType.ANY, loc))
1577 {
1578 Object o = destination_entity.GetInventory().LocationCreateEntity(loc, GetType(), ECE_IN_INVENTORY, RF_DEFAULT);
1579 new_item = ItemBase.Cast(o);
1580 }
1581
1582 if (new_item)
1583 {
1584 new_item.SetResultOfSplit(true);
1585 MiscGameplayFunctions.TransferItemProperties(this, new_item);
1587 new_item.SetQuantity(split_quantity_new);
1588 }
1589 }
1590 else
1591 {
1592 if (stack_max != 0)
1593 {
1594 if (stack_max < GetQuantity())
1595 {
1597 }
1598
1599 if (split_quantity_new == 0)
1600 {
1601 if (!GetGame().IsMultiplayer())
1602 player.PhysicalPredictiveDropItem(this);
1603 else
1604 player.ServerDropEntity(this);
1605 return;
1606 }
1607
1608 new_item = ItemBase.Cast(GetGame().CreateObjectEx(GetType(), player.GetWorldPosition(), ECE_PLACE_ON_SURFACE));
1609
1610 if (new_item)
1611 {
1612 new_item.SetResultOfSplit(true);
1613 MiscGameplayFunctions.TransferItemProperties(this, new_item);
1615 new_item.SetQuantity(stack_max);
1616 new_item.PlaceOnSurface();
1617 }
1618 }
1619 }
1620 }
const int ECE_PLACE_ON_SURFACE
const int ECE_IN_INVENTORY
const int RF_DEFAULT
override int GetTargetQuantityMax(int attSlotID=-1)
Definition ItemBase.c:3297
static proto native bool IsSlotIdValid(int slotId)
verifies existence of the slot id

References AddQuantity(), ECE_IN_INVENTORY, ECE_PLACE_ON_SURFACE, GetGame(), GetQuantity(), GetTargetQuantityMax(), GetType(), InventorySlots::IsSlotIdValid(), RF_DEFAULT, and SetQuantity().

◆ SplitIntoStackMaxCargo()

void InventoryItem::SplitIntoStackMaxCargo ( EntityAI destination_entity,
int idx,
int row,
int col )
inlineprotected

Definition at line 1704 of file ItemBase.c.

1705 {
1706 float quantity = GetQuantity();
1707 float split_quantity_new;
1710 {
1712 if (quantity > stackable)
1714 else
1716
1717 new_item = ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(this.GetType(), idx, row, col, false));
1718 if (new_item)
1719 {
1720 new_item.SetResultOfSplit(true);
1721 MiscGameplayFunctions.TransferItemProperties(this,new_item);
1723 new_item.SetQuantity(split_quantity_new);
1724 }
1725 }
1726 }

References AddQuantity(), GetQuantity(), and GetTargetQuantityMax().

◆ SplitIntoStackMaxCargoClient()

void InventoryItem::SplitIntoStackMaxCargoClient ( EntityAI destination_entity,
int idx,
int row,
int col )
inlineprotected

Definition at line 1643 of file ItemBase.c.

1644 {
1645 if (GetGame().IsClient())
1646 {
1648 {
1651 ctx.Write(2);
1652 ItemBase dummy = this; // @NOTE: workaround for correct serialization
1653 ctx.Write(dummy);
1654 ctx.Write(destination_entity);
1655 ctx.Write(true);
1656 ctx.Write(idx);
1657 ctx.Write(row);
1658 ctx.Write(col);
1659 ctx.Send();
1660 }
1661 }
1662 else if (!GetGame().IsMultiplayer())
1663 {
1665 }
1666 }
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
Definition ItemBase.c:1704

References ScriptInputUserData::CanStoreInputUserData(), GetGame(), INPUT_UDT_ITEM_MANIPULATION, and SplitIntoStackMaxCargo().

◆ SplitIntoStackMaxClient()

void InventoryItem::SplitIntoStackMaxClient ( EntityAI destination_entity,
int slot_id )
inlineprotected

Definition at line 1522 of file ItemBase.c.

1523 {
1524 if (GetGame().IsClient())
1525 {
1527 {
1530 ctx.Write(1);
1531 ItemBase i1 = this; // @NOTE: workaround for correct serialization
1532 ctx.Write(i1);
1533 ctx.Write(destination_entity);
1534 ctx.Write(true);
1535 ctx.Write(slot_id);
1536 ctx.Send();
1537 }
1538 }
1539 else if (!GetGame().IsMultiplayer())
1540 {
1542 }
1543 }
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
Definition ItemBase.c:1545

References ScriptInputUserData::CanStoreInputUserData(), GetGame(), GetPlayer(), INPUT_UDT_ITEM_MANIPULATION, and SplitIntoStackMax().

◆ SplitIntoStackMaxHands()

void InventoryItem::SplitIntoStackMaxHands ( PlayerBase player)
inlineprotected

Definition at line 1752 of file ItemBase.c.

1753 {
1754 float quantity = GetQuantity();
1755 float split_quantity_new;
1757 if (player)
1758 {
1760 if (quantity > stackable)
1762 else
1764
1765 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.GetType());
1766 new_item = ItemBase.Cast(in_hands);
1767 if (new_item)
1768 {
1769 new_item.SetResultOfSplit(true);
1770 MiscGameplayFunctions.TransferItemProperties(this,new_item);
1772 new_item.SetQuantity(split_quantity_new);
1773 }
1774 }
1775 }

References AddQuantity(), GetQuantity(), GetTargetQuantityMax(), and GetType().

◆ SplitIntoStackMaxHandsClient()

void InventoryItem::SplitIntoStackMaxHandsClient ( PlayerBase player)
inlineprotected

Definition at line 1728 of file ItemBase.c.

1729 {
1730 if (GetGame().IsClient())
1731 {
1733 {
1736 ctx.Write(3);
1737 ItemBase i1 = this; // @NOTE: workaround for correct serialization
1738 ctx.Write(i1);
1740 ctx.Write(destination_entity);
1741 ctx.Write(true);
1742 ctx.Write(0);
1743 ctx.Send();
1744 }
1745 }
1746 else if (!GetGame().IsMultiplayer())
1747 {
1749 }
1750 }
void SplitIntoStackMaxHands(PlayerBase player)
Definition ItemBase.c:1752

References ScriptInputUserData::CanStoreInputUserData(), GetGame(), INPUT_UDT_ITEM_MANIPULATION, and SplitIntoStackMaxHands().

◆ SplitIntoStackMaxToInventoryLocation()

void InventoryItem::SplitIntoStackMaxToInventoryLocation ( notnull InventoryLocation dst)
inlineprotected

Definition at line 1668 of file ItemBase.c.

1669 {
1671 }
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
Definition ItemBase.c:1673

References SplitIntoStackMaxToInventoryLocationEx().

◆ SplitIntoStackMaxToInventoryLocationClient()

void InventoryItem::SplitIntoStackMaxToInventoryLocationClient ( notnull InventoryLocation dst)
inlineprotected

Definition at line 1622 of file ItemBase.c.

1623 {
1624 if (GetGame().IsClient())
1625 {
1627 {
1630 ctx.Write(4);
1631 ItemBase thiz = this; // @NOTE: workaround for correct serialization
1632 ctx.Write(thiz);
1633 dst.WriteToContext(ctx);
1634 ctx.Send();
1635 }
1636 }
1637 else if (!GetGame().IsMultiplayer())
1638 {
1640 }
1641 }
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
Definition ItemBase.c:1668

References ScriptInputUserData::CanStoreInputUserData(), GetGame(), INPUT_UDT_ITEM_MANIPULATION, and SplitIntoStackMaxToInventoryLocation().

◆ SplitIntoStackMaxToInventoryLocationEx()

ItemBase InventoryItem::SplitIntoStackMaxToInventoryLocationEx ( notnull InventoryLocation dst)
inlineprotected

Definition at line 1673 of file ItemBase.c.

1674 {
1675 float quantity = GetQuantity();
1676 float split_quantity_new;
1678 if (dst.IsValid())
1679 {
1680 int slot_id = dst.GetSlot();
1682
1683 if (quantity > stack_max)
1685 else
1687
1689
1690 if (new_item)
1691 {
1692 new_item.SetResultOfSplit(true);
1693 MiscGameplayFunctions.TransferItemProperties(this,new_item);
1695 new_item.SetQuantity(split_quantity_new);
1696 }
1697
1698 return new_item;
1699 }
1700
1701 return null;
1702 }
static proto native EntityAI LocationCreateEntity(notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
creates new item directly at location

References AddQuantity(), ECE_IN_INVENTORY, GetQuantity(), GetTargetQuantityMax(), GameInventory::LocationCreateEntity(), and RF_DEFAULT.

◆ SplitItem()

void InventoryItem::SplitItem ( PlayerBase player)
inlineprotected

Definition at line 1810 of file ItemBase.c.

1811 {
1812 if (!CanBeSplit())
1813 {
1814 return;
1815 }
1816
1817 float quantity = GetQuantity();
1819
1821 bool found = player.GetInventory().FindFirstFreeLocationForNewEntity(GetType(), FindInventoryLocationType.ATTACHMENT, invloc);
1822
1824 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
1825
1826 if (new_item)
1827 {
1828 if (new_item.GetQuantityMax() < split_quantity_new)
1829 {
1830 split_quantity_new = new_item.GetQuantityMax();
1831 }
1832 if (found && invloc.IsValid() && invloc.GetType() == InventoryLocationType.ATTACHMENT && split_quantity_new > 1)
1833 {
1834 AddQuantity(-1);
1835 new_item.SetQuantity(1);
1836 }
1837 else
1838 {
1840 new_item.SetQuantity(split_quantity_new);
1841 }
1842 }
1843 }
static proto float Floor(float f)
Returns floor of value.

References AddQuantity(), CanBeSplit(), Math::Floor(), GetQuantity(), and GetType().

◆ SplitItemToInventoryLocation()

void InventoryItem::SplitItemToInventoryLocation ( notnull InventoryLocation dst)
inlineprotected

Definition at line 1777 of file ItemBase.c.

1778 {
1779 if (!CanBeSplit())
1780 return;
1781
1782 float quantity = GetQuantity();
1783 float split_quantity_new = Math.Floor(quantity * 0.5);
1784
1786
1787 if (new_item)
1788 {
1789 if (new_item.GetQuantityMax() < split_quantity_new)
1790 {
1791 split_quantity_new = new_item.GetQuantityMax();
1792 }
1793
1794 new_item.SetResultOfSplit(true);
1795 MiscGameplayFunctions.TransferItemProperties(this, new_item);
1796
1797 if (dst.IsValid() && dst.GetType() == InventoryLocationType.ATTACHMENT && split_quantity_new > 1)
1798 {
1799 AddQuantity(-1);
1800 new_item.SetQuantity(1);
1801 }
1802 else
1803 {
1805 new_item.SetQuantity(split_quantity_new);
1806 }
1807 }
1808 }

References AddQuantity(), CanBeSplit(), ECE_IN_INVENTORY, Math::Floor(), GetQuantity(), GetType(), GameInventory::LocationCreateEntity(), and RF_DEFAULT.

◆ StartOverheating()

void InventoryItem::StartOverheating ( ItemBase weapon = null,
string ammoType = "",
ItemBase muzzle_owner = null,
ItemBase suppressor = null,
string config_to_search = "" )
inlineprotected

Definition at line 572 of file ItemBase.c.

573 {
575 ItemBase.PlayOverheatingParticles(this, ammoType, this, suppressor, "CfgWeapons");
576 }

References m_IsOverheatingEffectActive.

◆ StopDeployLoopSoundEx()

void InventoryItem::StopDeployLoopSoundEx ( )
inlineprotected

Definition at line 4328 of file ItemBase.c.

4329 {
4330 if (!GetGame().IsDedicatedServer())
4331 {
4334 }
4335 }
void SetSoundFadeOut(float fade_out)
Set the sound fade out duration.

References GetGame(), m_DeployLoopSoundEx, EffectSound::SetSoundFadeOut(), and EffectSound::SoundStop().

◆ StopItemDynamicPhysics()

void InventoryItem::StopItemDynamicPhysics ( )
inlineprotected

Definition at line 4439 of file ItemBase.c.

4440 {
4441 SetDynamicPhysicsLifeTime(0.01);
4442 m_ItemBeingDroppedPhys = false;
4443 }
bool m_ItemBeingDroppedPhys
Definition ItemBase.c:72

References m_ItemBeingDroppedPhys.

◆ StopOverheating()

void InventoryItem::StopOverheating ( ItemBase weapon = null,
string ammoType = "",
ItemBase muzzle_owner = null,
ItemBase suppressor = null,
string config_to_search = "" )
inlineprotected

Definition at line 585 of file ItemBase.c.

586 {
588 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
589 }

References m_IsOverheatingEffectActive.

◆ StopOverheatingParticles()

static void InventoryItem::StopOverheatingParticles ( ItemBase weapon,
string ammoType,
ItemBase muzzle_owner,
ItemBase suppressor,
string config_to_search )
inlinestaticprotected

Definition at line 4174 of file ItemBase.c.

4175 {
4176 int id = muzzle_owner.GetMuzzleID();
4177 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
4178
4179 if (WPOOH_array)
4180 {
4181 for (int i = 0; i < WPOOH_array.Count(); i++)
4182 {
4184
4185 if (WPOOH)
4186 {
4188 }
4189 }
4190 }
4191 }

◆ ToggleDebugActionsMask()

static void InventoryItem::ToggleDebugActionsMask ( int mask)
inlinestaticprotected

Definition at line 790 of file ItemBase.c.

791 {
793 {
795 }
796 else
797 {
799 }
800 }
static void RemoveDebugActionsMask(int mask)
Definition ItemBase.c:785
static bool HasDebugActionsMask(int mask)
Definition ItemBase.c:770
static void AddDebugActionsMask(int mask)
Definition ItemBase.c:780

References AddDebugActionsMask(), HasDebugActionsMask(), and RemoveDebugActionsMask().

◆ TransferAgents()

void InventoryItem::TransferAgents ( int agents)
inlineprotected

transfer agents from another item

Definition at line 3882 of file ItemBase.c.

3883 {
3885 }

References m_AttachedAgents.

◆ TransferModifiers()

void InventoryItem::TransferModifiers ( PlayerBase reciever)
private

appears to be deprecated, legacy code

◆ TransferVariablesFloat()

void InventoryItem::TransferVariablesFloat ( array< float > float_vars)
inlineprotected

Definition at line 2580 of file ItemBase.c.

2581 {
2583 }

References DeSerializeNumericalVars().

◆ UnlockFromParent()

void InventoryItem::UnlockFromParent ( )
inlineprotected

Unlocks this item from its attachment slot of its parent.

Definition at line 850 of file ItemBase.c.

851 {
852 EntityAI parent = GetHierarchyParent();
853
854 if (parent)
855 {
857 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
858 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.GetSlot(), false);
859 }
860 }

◆ UpdateAllOverheatingParticles()

void InventoryItem::UpdateAllOverheatingParticles ( )
inlineprotected

Definition at line 613 of file ItemBase.c.

614 {
616 {
618 int count = m_OverheatingParticles.Count();
619
620 for (int i = count; i > 0; --i)
621 {
622 int id = i - 1;
624 Particle p = OP.GetParticle();
625
626 float overheat_min = OP.GetOverheatingLimitMin();
627 float overheat_max = OP.GetOverheatingLimitMax();
628
630 {
631 if (p)
632 {
633 p.Stop();
634 OP.RegisterParticle(null);
635 }
636 }
637 }
638 }
639 }
float GetOverheatingCoef()
Definition ItemBase.c:605

References GetOverheatingCoef(), and m_OverheatingParticles.

◆ UpdateOverheating()

void InventoryItem::UpdateOverheating ( ItemBase weapon = null,
string ammoType = "",
ItemBase muzzle_owner = null,
ItemBase suppressor = null,
string config_to_search = "" )
inlineprotected

Definition at line 578 of file ItemBase.c.

579 {
581 ItemBase.UpdateOverheatingParticles(this, ammoType, this, suppressor, "CfgWeapons");
583 }
void KillAllOverheatingParticles()
Definition ItemBase.c:641
void UpdateAllOverheatingParticles()
Definition ItemBase.c:613

References KillAllOverheatingParticles(), and UpdateAllOverheatingParticles().

◆ UpdateOverheatingParticles()

static void InventoryItem::UpdateOverheatingParticles ( ItemBase weapon,
string ammoType,
ItemBase muzzle_owner,
ItemBase suppressor,
string config_to_search )
inlinestaticprotected

Definition at line 4154 of file ItemBase.c.

4155 {
4156 int id = muzzle_owner.GetMuzzleID();
4157 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
4158
4159 if (WPOOH_array)
4160 {
4161 for (int i = 0; i < WPOOH_array.Count(); i++)
4162 {
4164
4165 if (WPOOH)
4166 {
4168 }
4169 }
4170 }
4171 }

◆ UsesGlobalDeploy()

bool InventoryItem::UsesGlobalDeploy ( )
inlineprotected

Definition at line 282 of file ItemBase.c.

283 {
284 return false;
285 }

◆ WriteVarsToCTX()

void InventoryItem::WriteVarsToCTX ( ParamsWriteContext ctx)
inlineprotected

Definition at line 2735 of file ItemBase.c.

2736 {
2737 ctx.Write(m_VariablesMask);
2738
2739 //--------------------------------------------
2741 {
2742 ctx.Write(m_VarQuantity);
2743 }
2744 //--------------------------------------------
2746 {
2747 ctx.Write(m_VarTemperature);
2748 }
2749 //--------------------------------------------
2751 {
2752 ctx.Write(m_VarWet);
2753 }
2754 //--------------------------------------------
2756 {
2757 ctx.Write(m_VarLiquidType);
2758 }
2759 //--------------------------------------------
2761 {
2762 ctx.Write(m_ColorComponentR);
2763 ctx.Write(m_ColorComponentG);
2764 ctx.Write(m_ColorComponentB);
2765 ctx.Write(m_ColorComponentA);
2766 }
2767 //--------------------------------------------
2769 {
2770 ctx.Write(m_Cleanness);
2771 }
2772 }

References IsVariableSet(), m_Cleanness, m_ColorComponentA, m_ColorComponentB, m_ColorComponentG, m_ColorComponentR, m_VariablesMask, m_VarLiquidType, m_VarQuantity, m_VarTemperature, m_VarWet, VARIABLE_CLEANNESS, VARIABLE_COLOR, VARIABLE_LIQUIDTYPE, VARIABLE_QUANTITY, VARIABLE_TEMPERATURE, and VARIABLE_WET.

Member Data Documentation

◆ can_this_be_combined

bool InventoryItem::can_this_be_combined = false
private

Definition at line 75 of file ItemBase.c.

◆ m_ActionsInitialize

bool InventoryItem::m_ActionsInitialize
private

Definition at line 17 of file ItemBase.c.

◆ m_AdminLog

PluginAdminLog InventoryItem::m_AdminLog
protected

Definition at line 128 of file ItemBase.c.

◆ m_AttachedAgents

int InventoryItem::m_AttachedAgents
private

Definition at line 102 of file ItemBase.c.

◆ m_CanBeDigged

bool InventoryItem::m_CanBeDigged
protected

Definition at line 80 of file ItemBase.c.

◆ m_CanBeMovedOverride

bool InventoryItem::m_CanBeMovedOverride
private

Definition at line 73 of file ItemBase.c.

◆ m_CanPlayImpactSound

bool InventoryItem::m_CanPlayImpactSound = true
private

Definition at line 55 of file ItemBase.c.

◆ m_CanShowQuantity

bool InventoryItem::m_CanShowQuantity
private

Definition at line 78 of file ItemBase.c.

◆ m_CanThisBeSplit

bool InventoryItem::m_CanThisBeSplit = false
private

Definition at line 76 of file ItemBase.c.

◆ m_CheckOverheating

ref Timer InventoryItem::m_CheckOverheating
private

Definition at line 118 of file ItemBase.c.

◆ m_Cleanness

int InventoryItem::m_Cleanness
private

Definition at line 49 of file ItemBase.c.

◆ m_CleannessInit

int InventoryItem::m_CleannessInit
private

Definition at line 50 of file ItemBase.c.

◆ m_CleannessMax

int InventoryItem::m_CleannessMax
private

Definition at line 52 of file ItemBase.c.

◆ m_CleannessMin

int InventoryItem::m_CleannessMin
private

Definition at line 51 of file ItemBase.c.

◆ m_ColorComponentA

int InventoryItem::m_ColorComponentA
protected

Definition at line 90 of file ItemBase.c.

◆ m_ColorComponentB

int InventoryItem::m_ColorComponentB
protected

Definition at line 89 of file ItemBase.c.

◆ m_ColorComponentG

int InventoryItem::m_ColorComponentG
protected

Definition at line 88 of file ItemBase.c.

◆ m_ColorComponentR

int InventoryItem::m_ColorComponentR
protected

Definition at line 87 of file ItemBase.c.

◆ m_CompatibleLocks

ref array<int> InventoryItem::m_CompatibleLocks = new array<int>
protected

Definition at line 134 of file ItemBase.c.

◆ m_ContinuousActions

ref TIntArray InventoryItem::m_ContinuousActions
protected

Definition at line 97 of file ItemBase.c.

◆ m_Count

int InventoryItem::m_Count
private

Definition at line 34 of file ItemBase.c.

◆ m_DebugActionsMask

int InventoryItem::m_DebugActionsMask
staticprivate

Definition at line 19 of file ItemBase.c.

◆ m_DeployLoopSoundEx

EffectSound InventoryItem::m_DeployLoopSoundEx
protected

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

Definition at line 83 of file ItemBase.c.

◆ m_FixDamageSystemInit

bool InventoryItem::m_FixDamageSystemInit = false
private

Definition at line 74 of file ItemBase.c.

◆ m_HasQuantityBar

bool InventoryItem::m_HasQuantityBar
private

Definition at line 79 of file ItemBase.c.

◆ m_HeadHidingSelections

ref TStringArray InventoryItem::m_HeadHidingSelections
protected

Definition at line 124 of file ItemBase.c.

◆ m_HeatIsolation

float InventoryItem::m_HeatIsolation
private

Definition at line 59 of file ItemBase.c.

◆ m_HideSelectionsBySlot

bool InventoryItem::m_HideSelectionsBySlot
protected

Definition at line 125 of file ItemBase.c.

◆ m_ImpactSoundSurfaceHash

int InventoryItem::m_ImpactSoundSurfaceHash
private

Definition at line 57 of file ItemBase.c.

◆ m_ImpactSpeed

float InventoryItem::m_ImpactSpeed
private

Definition at line 56 of file ItemBase.c.

◆ m_InputActionMap

TInputActionMap InventoryItem::m_InputActionMap
private

Definition at line 16 of file ItemBase.c.

◆ m_InteractActions

ref TIntArray InventoryItem::m_InteractActions
protected

Definition at line 98 of file ItemBase.c.

◆ m_IsBeingPlaced

bool InventoryItem::m_IsBeingPlaced
private

Definition at line 65 of file ItemBase.c.

◆ m_IsDeploySound

bool InventoryItem::m_IsDeploySound
private

Definition at line 68 of file ItemBase.c.

◆ m_IsHologram

bool InventoryItem::m_IsHologram
private

Definition at line 66 of file ItemBase.c.

◆ m_IsOverheatingEffectActive

bool InventoryItem::m_IsOverheatingEffectActive
private

Definition at line 116 of file ItemBase.c.

◆ m_IsPlaceSound

bool InventoryItem::m_IsPlaceSound
private

Definition at line 67 of file ItemBase.c.

◆ m_IsSoundSynchRemote

bool InventoryItem::m_IsSoundSynchRemote
private

Definition at line 70 of file ItemBase.c.

◆ m_IsStoreLoad

bool InventoryItem::m_IsStoreLoad = false
private

Definition at line 77 of file ItemBase.c.

◆ m_IsTakeable

bool InventoryItem::m_IsTakeable
private

Definition at line 69 of file ItemBase.c.

◆ m_ItemAttachOffset

float InventoryItem::m_ItemAttachOffset
private

Definition at line 61 of file ItemBase.c.

◆ m_ItemBehaviour

int InventoryItem::m_ItemBehaviour = -1
private

Definition at line 63 of file ItemBase.c.

◆ m_ItemBeingDroppedPhys

bool InventoryItem::m_ItemBeingDroppedPhys
private

Definition at line 72 of file ItemBase.c.

◆ m_ItemModelLength

float InventoryItem::m_ItemModelLength
private

Definition at line 60 of file ItemBase.c.

◆ m_ItemTypeActionsMap

ref map<typename, ref TInputActionMap> InventoryItem::m_ItemTypeActionsMap = new map<typename, ref TInputActionMap>
staticprivate

Definition at line 15 of file ItemBase.c.

◆ m_LastRegisteredWeaponID

int InventoryItem::m_LastRegisteredWeaponID = 0
staticprivate

Definition at line 113 of file ItemBase.c.

◆ m_LightSourceItem

ItemBase InventoryItem::m_LightSourceItem
protected

Definition at line 94 of file ItemBase.c.

◆ m_LockingSound

ref EffectSound InventoryItem::m_LockingSound
protected

Definition at line 136 of file ItemBase.c.

◆ m_LockSoundSet

string InventoryItem::m_LockSoundSet = ""
protected

Definition at line 137 of file ItemBase.c.

◆ m_LockType

int InventoryItem::m_LockType
protected

Definition at line 135 of file ItemBase.c.

◆ m_MaxOverheatingValue

int InventoryItem::m_MaxOverheatingValue = 0
private

Definition at line 120 of file ItemBase.c.

◆ m_OnBulletCasingEjectEffect

ref map<int, ref array<ref WeaponParticlesOnBulletCasingEject> > InventoryItem::m_OnBulletCasingEjectEffect
staticprivate

Definition at line 110 of file ItemBase.c.

◆ m_OnFireEffect

ref map<int, ref array<ref WeaponParticlesOnFire> > InventoryItem::m_OnFireEffect
staticprivate

Definition at line 109 of file ItemBase.c.

◆ m_OnOverheatingEffect

ref map<int, ref array<ref WeaponParticlesOnOverheating> > InventoryItem::m_OnOverheatingEffect
private

Definition at line 111 of file ItemBase.c.

◆ m_OverheatingDecayInterval

float InventoryItem::m_OverheatingDecayInterval = 1
private

Definition at line 121 of file ItemBase.c.

◆ m_OverheatingParticles

ref array<ref OverheatingParticle> InventoryItem::m_OverheatingParticles
private

Definition at line 122 of file ItemBase.c.

◆ m_OverheatingShots

float InventoryItem::m_OverheatingShots
private

Definition at line 117 of file ItemBase.c.

◆ m_PhysDropTimer

ref Timer InventoryItem::m_PhysDropTimer
protected

Definition at line 131 of file ItemBase.c.

◆ m_QuickBarBonus

int InventoryItem::m_QuickBarBonus = 0
private

Definition at line 64 of file ItemBase.c.

◆ m_RecipesInitialized

bool InventoryItem::m_RecipesInitialized
private

Definition at line 20 of file ItemBase.c.

◆ m_ShotsToStartOverheating

int InventoryItem::m_ShotsToStartOverheating = 0
private

Definition at line 119 of file ItemBase.c.

◆ m_SingleUseActions

ref TIntArray InventoryItem::m_SingleUseActions
protected

Definition at line 96 of file ItemBase.c.

◆ m_SoundAttType

string InventoryItem::m_SoundAttType
protected

Definition at line 85 of file ItemBase.c.

◆ m_SoundDeploy

EffectSound InventoryItem::m_SoundDeploy
protected

Definition at line 140 of file ItemBase.c.

◆ m_SoundDeployFinish

EffectSound InventoryItem::m_SoundDeployFinish
protected

Definition at line 141 of file ItemBase.c.

◆ m_SoundPlace

EffectSound InventoryItem::m_SoundPlace
protected

Definition at line 139 of file ItemBase.c.

◆ m_StoreLoadedQuantity

float InventoryItem::m_StoreLoadedQuantity = float.LOWEST
private

Definition at line 36 of file ItemBase.c.

◆ m_ThrowItemOnDrop

bool InventoryItem::m_ThrowItemOnDrop
private

Definition at line 71 of file ItemBase.c.

◆ m_VariablesMask

int InventoryItem::m_VariablesMask
private

Definition at line 26 of file ItemBase.c.

◆ m_VarLiquidType

int InventoryItem::m_VarLiquidType
private

Definition at line 62 of file ItemBase.c.

◆ m_VarQuantity

float InventoryItem::m_VarQuantity
private

Definition at line 29 of file ItemBase.c.

◆ m_VarQuantityInit

int InventoryItem::m_VarQuantityInit
private

Definition at line 31 of file ItemBase.c.

◆ m_VarQuantityMax

int InventoryItem::m_VarQuantityMax
private

Definition at line 33 of file ItemBase.c.

◆ m_VarQuantityMin

int InventoryItem::m_VarQuantityMin
private

Definition at line 32 of file ItemBase.c.

◆ m_VarQuantityPrev

float InventoryItem::m_VarQuantityPrev
private

Definition at line 30 of file ItemBase.c.

◆ m_VarStackMax

float InventoryItem::m_VarStackMax
private

Definition at line 35 of file ItemBase.c.

◆ m_VarTemperature

float InventoryItem::m_VarTemperature
private

Definition at line 38 of file ItemBase.c.

◆ m_VarTemperatureInit

float InventoryItem::m_VarTemperatureInit
private

Definition at line 39 of file ItemBase.c.

◆ m_VarTemperatureMax

float InventoryItem::m_VarTemperatureMax
private

Definition at line 41 of file ItemBase.c.

◆ m_VarTemperatureMin

float InventoryItem::m_VarTemperatureMin
private

Definition at line 40 of file ItemBase.c.

◆ m_VarWet

float InventoryItem::m_VarWet
private

Definition at line 43 of file ItemBase.c.

◆ m_VarWetInit

float InventoryItem::m_VarWetInit
private

Definition at line 45 of file ItemBase.c.

◆ m_VarWetMax

float InventoryItem::m_VarWetMax
private

Definition at line 47 of file ItemBase.c.

◆ m_VarWetMin

float InventoryItem::m_VarWetMin
private

Definition at line 46 of file ItemBase.c.

◆ m_VarWetPrev

float InventoryItem::m_VarWetPrev
private

Definition at line 44 of file ItemBase.c.

◆ m_WantPlayImpactSound

bool InventoryItem::m_WantPlayImpactSound
private

Definition at line 54 of file ItemBase.c.

◆ m_WeaponTypeToID

ref map<string, int> InventoryItem::m_WeaponTypeToID
staticprivate

Definition at line 112 of file ItemBase.c.


The documentation for this class was generated from the following file: