153 if (!
GetGame().IsDedicatedServer())
169 m_OldLocation =
null;
176 if (ConfigIsExisting(
"headSelectionsToHide"))
183 if (ConfigIsExisting(
"hideSelectionsByinventorySlot"))
202 m_Count = ConfigGetInt(
"count");
243 if (ConfigIsExisting(
"canBeSplit"))
249 if (ConfigIsExisting(
"itemBehaviour"))
256 RegisterNetSyncVariableInt(
"m_VarLiquidType");
257 RegisterNetSyncVariableInt(
"m_Cleanness",0,1);
259 RegisterNetSyncVariableBoolSignal(
"m_WantPlayImpactSound");
260 RegisterNetSyncVariableFloat(
"m_ImpactSpeed");
261 RegisterNetSyncVariableInt(
"m_ImpactSoundSurfaceHash");
263 RegisterNetSyncVariableInt(
"m_ColorComponentR", 0, 255);
264 RegisterNetSyncVariableInt(
"m_ColorComponentG", 0, 255);
265 RegisterNetSyncVariableInt(
"m_ColorComponentB", 0, 255);
266 RegisterNetSyncVariableInt(
"m_ColorComponentA", 0, 255);
268 RegisterNetSyncVariableBool(
"m_IsBeingPlaced");
269 RegisterNetSyncVariableBool(
"m_IsTakeable");
270 RegisterNetSyncVariableBool(
"m_IsHologram");
274 RegisterNetSyncVariableBool(
"m_IsSoundSynchRemote");
275 RegisterNetSyncVariableBool(
"m_IsDeploySound");
295 if (!m_InputActionMap)
334 typename ai =
action.GetInputType();
354 Debug.
Log(
"Action " +
action.Type() +
" already added to " +
this +
", skipping!");
366 typename ai =
action.GetInputType();
472 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
597 OP.RegisterParticle(
p);
634 OP.RegisterParticle(
null);
736 int r_index =
player.GetHumanInventory().FindUserReservedLocationIndex(
this);
743 player.GetHumanInventory().ClearUserReservedLocationAtIndex(
r_index);
747 r_il.GetParent().GetOnReleaseLock().Invoke(
this);
751 r_il.GetParent().GetOnAttachmentReleaseLock().Invoke(
this,
r_il.GetSlot());
756 player.GetHumanInventory().ClearUserReservedLocation(
this);
805 if (GetEconomyProfile())
807 float q_max = GetEconomyProfile().GetQuantityMax();
810 float q_min = GetEconomyProfile().GetQuantityMin();
816 if (
comp && (
comp.GetEnergyMaxPristine() ||
comp.GetEnergyAtSpawn()))
839 EntityAI parent = GetHierarchyParent();
852 EntityAI parent = GetHierarchyParent();
890 else if (!
GetGame().IsMultiplayer())
904 return (ConfigGetFloat(
"liquidContainerType") != 0);
1052 int r_index =
old_player.GetHumanInventory().FindUserReservedLocationIndex(
this);
1063 r_il.GetParent().GetOnReleaseLock().Invoke(
this);
1067 r_il.GetParent().GetOnAttachmentReleaseLock().Invoke(
this,
r_il.GetSlot());
1085 if (
oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(
oldLoc,
false,
false,
false,
true,
false,
false))
1096 if (
new_player.GetHumanInventory().FindUserReservedLocationIndex(
this) >= 0)
1098 int type =
oldLoc.GetType();
1101 oldLoc.GetParent().GetOnSetLock().Invoke(
this);
1105 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(
this,
oldLoc.GetSlot());
1118 m_OldLocation.Reset();
1122 GetGame().GetAnalyticsClient().OnItemAttachedAtPlayer(
this,
"Hands");
1138 il.GetParent().GetOnReleaseLock().Invoke(
it);
1142 il.GetParent().GetOnAttachmentReleaseLock().Invoke(
it,
il.GetSlot());
1156 m_OldLocation.Reset();
1181 if (GetCompEM() && GetCompEM().IsPlugged())
1184 GetCompEM().UnplugThis();
1261 super.EEDelete(parent);
1269 int r_index =
player.GetHumanInventory().FindUserReservedLocationIndex(
this);
1275 player.GetHumanInventory().ClearUserReservedLocationAtIndex(
r_index);
1279 r_il.GetParent().GetOnReleaseLock().Invoke(
this);
1283 r_il.GetParent().GetOnAttachmentReleaseLock().Invoke(
this,
r_il.GetSlot());
1288 player.RemoveQuickBarEntityShortcut(
this);
1304 if (
Magazine.Cast(
this).GetAmmoCount() > 0)
1347 attach_types.Insert(ConfigGetString(
"ChangeIntoOnAttach"));
1373 detach_types.Insert(this.ConfigGetString(
"ChangeIntoOnDetach"));
1377 this.ConfigGetTextArray(
"ChangeIntoOnDetach",
detach_types);
1379 detach_types.Insert(this.ConfigGetString(
"ChangeIntoOnDetach"));
1417 string pop_sounds[ 6 ] = {
"ammopops_1",
"ammopops_2",
"ammopops_3",
"ammopops_4",
"ammopops_5",
"ammopops_6" };
1451 if (GetInventory().GetCargo())
1480 if (GetInventory().GetCargo())
1482 int item_count = GetInventory().GetCargo().GetItemCount();
1487 if (!
item.IsExplosive())
1539 else if (!
GetGame().IsMultiplayer())
1601 if (!
GetGame().IsMultiplayer())
1602 player.PhysicalPredictiveDropItem(
this);
1604 player.ServerDropEntity(
this);
1637 else if (!
GetGame().IsMultiplayer())
1662 else if (!
GetGame().IsMultiplayer())
1746 else if (!
GetGame().IsMultiplayer())
1824 new_item =
player.CreateCopyOfItemInInventoryOrGroundEx(
this,
true);
1853 parent.OnAttachmentQuantityChangedEx(
this,
delta);
1878 EntityAI parent = GetHierarchyParent();
1879 if (parent && parent.IsFireplace())
1884 for (
int i = 0;
i <
cargo.GetItemCount(); ++
i)
1909 super.OnRightClick();
1928 dst.SetGround(
this,
m4);
1931 GetInventory().GetCurrentInventoryLocation(
dst);
1935 dst.SetCargo(
dst.GetParent(),
this,
dst.GetIdx(),
dst.GetRow(),
dst.GetCol(),
dst.GetFlip());
1941 dst.SetGround(
this,
m4);
1944 GetInventory().GetCurrentInventoryLocation(
dst);
1962 else if (!
GetGame().IsMultiplayer())
1987 if (
mag.GetAmmoCount() >=
mag.GetAmmoMax())
2012 if (CastTo(
player, GetHierarchyRootPlayer()))
2014 if (
player.GetInventory().HasAttachment(
this))
2017 if (
player.IsItemsToDelete())
2026 if (GetInventory().GetCurrentAttachmentSlotInfo(
slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(
slotID))
2081 float hp1 = GetHealth01(
"",
"");
2100 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
2101 GetHierarchyParent().IncreaseLifetimeUp();
2176 if (
EActions.RECIPES_RANGE_START < 1000)
2185 PluginDeveloper.SetDeveloperItemClientEx(
player);
2193 OnDebugButtonPressServer(
id + 1);
2213 mag.ServerSetAmmoCount(
mag.GetAmmoCount() +
mag.GetAmmoMax() * 0.2);
2222 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
2232 mag2.ServerSetAmmoCount(
mag2.GetAmmoCount() -
mag2.GetAmmoMax() * 0.2);
2240 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
2261 m_EM.SetEnergy(m_EM.GetEnergyMax());
2267 AddHealth(
"",
"",GetMaxHealth(
"",
"Health")/5);
2271 AddHealth(
"",
"",-GetMaxHealth(
"",
"Health")/5);
2275 SetHealth01(
"",
"",0);
2537 case ERPCs.RPC_SOUND_LOCK_ATTACH:
2543 bool play =
p.param1;
2594 PluginVariables
plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
2600 PluginVariables
plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
2601 return plugin.GetName(
id);
2779 if (version <= 108 && version!= -1)
2799 else if (version <= 116 && version!= -1)
2914 if (version <= 108 && version != -1)
2963 if (!
super.OnStoreLoad(
ctx, version))
3000 if (version ==
int.
MAX)
3039 if (!
raib.OnStoreLoad(
ctx,version))
3083 super.AfterStoreLoad();
3099 super.EEOnAfterLoad();
3121 #ifdef PLATFORM_CONSOLE
3166 super.OnVariablesSynchronized();
3182 Debug.
LogError(
"No LiquidType specified, try setting 'varLiquidTypeInit' to a particular liquid type");
3196 bool dstr = ConfigGetBool(
"varQuantityDestroyOnMin");
3281 GetInventory().GetCurrentInventoryLocation(
il);
3283 int slot =
il.GetSlot();
3344 float special = GetInventoryAndCargoWeight();
3368 else if (HasEnergyManager())
3377 return super.GetWeightSpecialized(
forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
3388 return super.GetWeightSpecialized(
forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
3398 if (GetInventory().GetCargo() !=
NULL)
3400 item_count = GetInventory().GetCargo().GetItemCount();
3403 for (
int i = 0;
i < GetInventory().AttachmentCount();
i++)
3423 else if (ConfigGetFloat(
"liquidContainerType") > 0)
3455 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
3460 for (
int i = 0;
i <
items.Count();
i++)
3477 if (HasEnergyManager())
3479 energy = GetCompEM().GetEnergy();
3487 super.OnEnergyConsumed();
3494 super.OnEnergyAdded();
3502 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
3560 return ConfigGetFloat(
"heatIsolation");
3652 return GetWetLevelInternal(
m_VarWet);
3666 Error(
"Attempting to change variable client side, variables are supposed to be changed on server only !!");
3675 if (ConfigIsExisting(
"itemModelLength"))
3677 return ConfigGetFloat(
"itemModelLength");
3684 if (ConfigIsExisting(
"itemAttachOffset"))
3686 return ConfigGetFloat(
"itemAttachOffset");
3773 return ConfigGetInt(
"varLiquidTypeInit");
3790 nplayer.SetEnableQuickBarEntityShortcut(
this,
true);
3802 nplayer.SetEnableQuickBarEntityShortcut(
this,
false);
3807 player.GetHumanInventory().ClearUserReservedLocationForContainer(
this);
3810 if (HasEnergyManager())
3812 GetCompEM().UpdatePlugState();
3958 if (GetInventory().GetAttachmentSlotsCount() != 0)
4027 if (!parent.IsRuined())
4036 if (!
super.CanPutAsAttachment(parent))
4041 if (!IsRuined() && !parent.IsRuined())
4055 return super.CanReceiveItemIntoCargo(
item);
4067 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(
PlayerBase))
4255 if (ConfigIsExisting(
"soundAttType"))
4257 att_type = ConfigGetString(
"soundAttType");
4330 if (!
GetGame().IsDedicatedServer())
4381 if (!
GetGame().IsDedicatedServer())
4383 if (ConfigIsExisting(
"attachSoundSet"))
4409 sound.SetAutodestroy(
true);
4441 SetDynamicPhysicsLifeTime(0.01);
4453 SetHealthMax(
"",
"Health");
4461 GetDamageZones(
zones);
4463 for (
int i = 0;
i <
zones.Count();
i++)
4472 return IsExclusionFlagPresent(
PlayerBase.GetFaceCoverageShaveValues());
4528 EntityAI parent = GetHierarchyParent();
4579 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
4606 return (
item.IsKindOf(
"Cauldron") ||
item.IsKindOf(
"Pot") ||
item.IsKindOf(
"FryingPan") ||
item.IsKindOf(
"SmallProtectorCase") || (
item.IsKindOf(
"PortableGasStove") &&
item.FindAttachmentBySlotName(
"CookingEquipment")));
4669 super.SetDebugItem();
4689 item.SetQuantity(
item.GetQuantityInit());
4708 if (
item.HasEnergyManager())
4719 else if (
item.IsMagazine())
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
bool IsDamageDestroyed(ActionTarget target)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
TInputActionMap m_InputActionMap
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsFireplace()
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
void SplitItem(PlayerBase player)
override void InsertAgent(int agent, float count=1)
void SetIsDeploySound(bool is_deploy_sound)
override void AddTemperature(float value)
override void SetTemperature(float value, bool allow_client=false)
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
ref TStringArray m_HeadHidingSelections
bool LoadAgents(ParamsReadContext ctx, int version)
ref array< ref OverheatingParticle > m_OverheatingParticles
bool m_IsSoundSynchRemote
ref array< int > m_CompatibleLocks
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...
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
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...
override float GetTemperatureMax()
ref TIntArray m_InteractActions
bool CanPlayDeployLoopSound()
bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override float GetWetMax()
bool LoadVariables(ParamsReadContext ctx, int version=-1)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
bool m_CanBeMovedOverride
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
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...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
bool IsServerCheck(bool allow_client)
float GetDryingIncrement(string pIncrementName)
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
float m_VarTemperatureInit
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
float GetOverheatingCoef()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SetVariableMask(int variable)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
bool IsVariableSet(int variable)
'true' if this variable has ever been changed from default
float GetItemModelLength()
void CombineItems(ItemBase other_item, bool use_stack_max=true)
float GetHeatIsolationInit()
override float GetTemperature()
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
override float GetTemperatureMin()
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
bool can_this_be_combined
EffectSound m_SoundDeploy
bool DamageItemAttachments(float damage)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
bool m_WantPlayImpactSound
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void SerializeNumericalVars(array< float > floats_out)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
override bool CanBeSplit()
ref Timer m_CheckOverheating
bool CanHaveTemperature()
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetItemAttachOffset()
void SetCleanness(int value, bool allow_client=false)
void ProcessDecay(float delta, bool hasRootAsPlayer)
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
EffectSound m_DeployLoopSoundEx
distinguish if item has been created as new or it came from splitting (server only flag)
bool ContainsAgent(int agent_id)
override void AddWet(float value)
void SplitIntoStackMaxHands(PlayerBase player)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
bool m_IsOverheatingEffectActive
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
void DeSerializeNumericalVars(array< float > floats)
static void RemoveDebugActionsMask(int mask)
void PerformDamageSystemReinit()
static int m_LastRegisteredWeaponID
void SaveVariables(ParamsWriteContext ctx)
float m_VarTemperatureMin
void StopDeployLoopSoundEx()
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
void KillAllOverheatingParticles()
override int GetQuantityMax()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
void SetLiquidType(int value, bool allow_client=false)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
void WriteVarsToCTX(ParamsWriteContext ctx)
ItemBase m_LightSourceItem
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
float m_VarTemperatureMax
EffectSound m_SoundDeployFinish
override float GetWetMin()
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
override void Explode(int damageType, string ammoType="")
class JsonUndergroundAreaTriggerData GetPosition
static ref TFloatArray ARRAY_FLOAT
static ref Param1< int > PARAM1_INT
static ref Param1< float > PARAM1_FLOAT
represents base for cargo storage for entities
Super root of all classes in Enforce script.
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.
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.
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Wrapper class for managing sound through SEffectManager.
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
void SetSoundFadeOut(float fade_out)
Set the sound fade out duration.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
void SoundStop()
Stops sound.
script counterpart to engine's class Inventory
const int c_InventoryReservationTimeoutShortMS
static proto native EntityAI LocationCreateEntity(notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
creates new item directly at location
override string GetAttachmentSoundType()
void KillAllOverheatingParticles()
override float GetQuantity()
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
bool IsVariableSet(int variable)
'true' if this variable has ever been changed from default
override string ChangeIntoOnDetach()
override void OnEnergyConsumed()
string GetLoopDeploySoundset()
override void ClearInventory()
void SoundSynchRemoteReset()
void PlayDeployLoopSoundEx()
bool m_ItemBeingDroppedPhys
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
bool LoadVariables(ParamsReadContext ctx, int version=-1)
void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
EffectSound m_SoundDeployFinish
ItemBase GetLightSourceItem()
override bool IsOneHandedBehaviour()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
void RemoveAction(typename actionName)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
bool CanHaveTemperature()
void StopItemDynamicPhysics()
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override float GetTemperatureInit()
override void RemoveAllAgentsExcept(int agents_to_keep_mask)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override float GetWetMin()
ref array< ref OverheatingParticle > m_OverheatingParticles
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
override bool CanDisplayCargo()
override void SetWetMax()
void RemoveItemVariable(int variable)
Removes variable from variable mask, making it appear as though the variable has never been changed f...
float m_VarTemperatureInit
bool CanPlayDeployLoopSound()
override bool IsHologram()
array< string > GetHeadHidingSelection()
float GetHeatIsolationInit()
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
bool HidesSelectionBySlot()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
bool m_IsSoundSynchRemote
float m_VarTemperatureMin
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
void SetIsPlaceSound(bool is_place_sound)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
override void RemoveAllAgents()
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...
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...
override void OnStoreSave(ParamsWriteContext ctx)
override bool CanPutInCargo(EntityAI parent)
override void SetQuantityToMinimum()
WrittenNoteData GetWrittenNoteData()
float GetOverheatingValue()
ref TIntArray m_SingleUseActions
override void SetTakeable(bool pState)
array< int > GetValidFinishers()
returns an array of possible finishers
ref Timer m_CheckOverheating
bool CanBeCookedOnStick()
float GetOverheatingCoef()
bool m_RecipesInitialized
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
override void SetWet(float value, bool allow_client=false)
void SetVariableMask(int variable)
float GetSoakingIncrement(string pIncrementName)
void SplitIntoStackMaxHandsClient(PlayerBase player)
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
TInputActionMap m_InputActionMap
override void EEKilled(Object killer)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void OnInventoryExit(Man player)
Event called on item when it is removed from the player(Man) inventory, passes the old owner as a par...
void SetLiquidType(int value, bool allow_client=false)
void TransferAgents(int agents)
transfer agents from another item
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
override bool CanPutAsAttachment(EntityAI parent)
ref EffectSound m_LockingSound
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
void WriteVarsToCTX(ParamsWriteContext ctx)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void SaveAgents(ParamsWriteContext ctx)
void TransferVariablesFloat(array< float > float_vars)
override void SetTemperatureMax()
void SplitIntoStackMaxHands(PlayerBase player)
override void OnEnergyAdded()
void StopDeployLoopSoundEx()
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
override bool KindOf(string tag)
override void InsertAgent(int agent, float count=1)
override EWetnessLevel GetWetLevel()
override int GetQuantityMax()
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
override void OnCreatePhysics()
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
static int GetDebugActionsMask()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
void ConvertEnergyToQuantity()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
bool IsFacingPlayer(PlayerBase player, string selection)
override float GetWetInit()
void SetIsDeploySound(bool is_deploy_sound)
override void OnPlacementStarted(Man player)
static void RemoveDebugActionsMask(int mask)
override int GetQuickBarBonus()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
override bool CanObstruct()
void PerformDamageSystemReinit()
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void GetColor(out int r, out int g, out int b, out int a)
gets item's color variable as components
static bool HasDebugActionsMask(int mask)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
override int GetTargetQuantityMax(int attSlotID=-1)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void AddAction(typename actionName)
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
bool IsCargoException4x3(EntityAI item)
bool IsServerCheck(bool allow_client)
override void EEOnAfterLoad()
override void OnVariablesSynchronized()
float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void OnInventoryEnter(Man player)
Event called on item when it is placed in the player(Man) inventory, passes the owner as a parameter.
override void OnWasDetached(EntityAI parent, int slot_id)
override void OnMovedInsideCargo(EntityAI container)
override float GetSingleInventoryItemWeightEx()
override bool IsIgnoredByConstruction()
void OnActivatedByTripWire()
bool ContainsAgent(int agent_id)
static ref map< string, int > m_WeaponTypeToID
void SerializeNumericalVars(array< float > floats_out)
bool CanBeMovedOverride()
void Open()
Implementations only.
override void SetTemperature(float value, bool allow_client=false)
bool m_HideSelectionsBySlot
override bool IsItemBase()
void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
static void SetDebugActionsMask(int mask)
override bool IsTwoHandedBehaviour()
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
float GetWeightSpecialized(bool forceRecalc=false)
float GetDeployTime()
how long it takes to deploy this item in seconds
void SetColor(int r, int g, int b, int a)
float m_VarTemperatureMax
float GetBandagingEffectivity()
bool CanBeUsedForSuicide()
int m_ImpactSoundSurfaceHash
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void SaveVariables(ParamsWriteContext ctx)
override bool IsTakeable()
static void AddDebugActionsMask(int mask)
override void AddTemperature(float value)
override void OnWasAttached(EntityAI parent, int slot_id)
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
array< float > GetVariablesFloat()
override string ChangeIntoOnAttach(string slot)
EffectSound m_SoundDeploy
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
bool m_IsOverheatingEffectActive
override void AfterStoreLoad()
static void ToggleDebugActionsMask(int mask)
bool m_WantPlayImpactSound
bool DamageItemAttachments(float damage)
float GetSingleInventoryItemWeight()
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
override float GetTemperatureMax()
string GetPlaceSoundset()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
bool CanBeRepairedByCrafting()
void PlayDeployFinishSound()
float GetDryingIncrement(string pIncrementName)
override void RemoveAgent(int agent_id)
bool m_CanBeMovedOverride
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void LoadParticleConfigOnOverheating(int id)
void SetCanBeMovedOverride(bool setting)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
override bool CanReceiveItemIntoCargo(EntityAI item)
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void UpdateAllOverheatingParticles()
int GetDamageSystemVersionChange()
Re-sets DamageSystem changes.
bool IsSoundSynchRemote()
void CopyScriptPropertiesFrom(EntityAI oldItem)
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
bool IsPlayerInside(PlayerBase player, string selection)
override void OnCEUpdate()
PluginAdminLog m_AdminLog
override float GetTemperatureMin()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
float GetItemModelLength()
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
void OnCombine(ItemBase other_item)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
void SetResultOfSplit(bool value)
float GetFilterDamageRatio()
void SplitItem(PlayerBase player)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnWetChanged(float newVal, float oldVal)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
int NameToID(string name)
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
void SetIsBeingPlaced(bool is_being_placed)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool CanBeSplit()
ref TIntArray m_ContinuousActions
float GetItemAttachOffset()
bool CanRepair(ItemBase item_repair_kit)
ScriptedLightBase GetLight()
override float GetTemperature()
bool PairWithDevice(notnull ItemBase otherDevice)
static int m_DebugActionsMask
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
distinguish if item has been created as new or it came from splitting (server only flag)
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
bool AllowFoodConsumption()
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsBeingPlaced()
void SetCleanness(int value, bool allow_client=false)
override void EEDelete(EntityAI parent)
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...
string GetDeploySoundset()
void PlayDetachSound(string slot_type)
void SetCEBasedQuantity()
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
override void OnRightClick()
void ProcessDecay(float delta, bool hasRootAsPlayer)
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
bool IsOverheatingEffectActive()
ItemBase m_LightSourceItem
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnItemInHandsPlayerSwimStart(PlayerBase player)
bool LoadAgents(ParamsReadContext ctx, int version)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
ref TIntArray m_InteractActions
bool DamageItemInCargo(float damage)
void LoadParticleConfigOnFire(int id)
override bool IsHeavyBehaviour()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
ref Timer m_PhysDropTimer
void RemoveLightSourceItem()
float GetInfectionChance(int system=0, Param param=null)
Infection chance while/after using this item, originally used for wound infection after bandaging,...
void DeSerializeNumericalVars(array< float > floats)
string GetDeployFinishSoundset()
override float GetWetMax()
ref TStringArray m_HeadHidingSelections
override void EOnContact(IEntity other, Contact extra)
void OnApply(PlayerBase player)
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
override void AddWet(float value)
proto native InventoryLocation Copy(notnull InventoryLocation rhs)
copies location data to another location
provides access to slot configuration
static proto native bool IsSlotIdValid(int slotId)
verifies existence of the slot id
static proto native int GetStackMaxForSlotId(int slot_Id)
static proto native owned string GetSlotName(int id)
converts slot_id to string
override bool CanPutAsAttachment(EntityAI parent)
override string GetDeployFinishSoundset()
override bool IsItemTent()
override void SetActions()
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override void InitItemVariables()
override string GetDeploySoundset()
override string GetPlaceSoundset()
override bool IsPlayerInside(PlayerBase player, string selection)
override void RefreshPhysics()
override string GetLoopDeploySoundset()
override void OnInventoryExit(Man player)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsClothing()
override void OnEndPlacement()
static bool IsActionLogEnable()
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Legacy way of using particles in the game.
The class that will be instanced (moddable)
static int GeneratePersistentID()
Manager class for managing Effect (EffectParticle, EffectSound)
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.
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Serialization general interface. Serializer API works with:
const float DEFAULT_DEPLOY
script counterpart to engine's class Weapon
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto void Print(void var)
Prints content of variable to console/log.
const float WETNESS_RATE_WETTING_INSIDE
const float TEMPERATURE_RATE_COOLING_INSIDE
const float ITEM_TEMPERATURE_TO_EXPLODE_MIN
misc
const float WETNESS_RATE_WETTING_LIQUID
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
const float STATE_SOAKING_WET
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Floor(float f)
Returns floor of value.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
static proto float Round(float f)
Returns mathematical round of value.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
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'.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION