10enum SurfaceAnimationBone
35enum EItemManipulationContext
43enum EInventoryIconVisibility
55 OCCUPANCY_INVALID = -1,
57 LEGACY_EYEWEAR_HEADGEAR,
59 LEGACY_HEADSTRAP_HEADGEAR,
60 LEGACY_HEADSTRAP_MASK,
62 LEGACY_HEADGEAR_EYEWEWEAR,
63 LEGACY_HEADGEAR_HEADSTRAP,
65 LEGACY_MASK_EYEWEWEAR,
66 LEGACY_MASK_HEADSTRAP,
68 EXCLUSION_HEADGEAR_HELMET_0,
70 EXCLUSION_HEADSTRAP_0,
75 EXCLUSION_GLASSES_REGULAR_0,
76 EXCLUSION_GLASSES_TIGHT_0,
79 SHAVING_HEADGEAR_ATT_0,
80 SHAVING_EYEWEAR_ATT_0,
87 static DebugSpawnParams WithPlayer(Man player)
89 DebugSpawnParams params =
new DebugSpawnParams();
90 params.m_Player = player;
95class TSelectableActionInfoArrayEx
extends array<ref Param> {}
101 bool m_DeathSyncSent;
102 bool m_KilledByHeadshot;
103 bool m_PreparedToDelete =
false;
104 bool m_RefresherViable =
false;
105 bool m_WeightDirty = 1;
106 protected bool m_RoofAbove =
false;
108 private ref set<int> m_AttachmentExclusionMaskGlobal;
109 private ref set<int> m_AttachmentExclusionMaskChildren;
116 const int DEAD_REPLACE_DELAY = 250;
117 const int DELETE_CHECK_DELAY = 100;
128 float m_ConfigWeight = ConfigGetInt(
"weight");
130 private float m_LastUpdatedTime;
132 protected float m_PreviousRoofTestTime = 0;
136 bool m_PendingDelete =
false;
138 bool m_TransportHitRegistered =
false;
198 float m_LastFTChangeTime;;
199 float m_PresumedTimeRemaining;
206 string param_access_energy_sys =
"CfgVehicles " + type +
" EnergyManager ";
207 bool is_electic_device =
GetGame().ConfigIsExisting(param_access_energy_sys);
209 if (is_electic_device)
212 RegisterNetSyncVariableBool(
"m_EM.m_IsSwichedOn");
213 RegisterNetSyncVariableBool(
"m_EM.m_CanWork");
214 RegisterNetSyncVariableBool(
"m_EM.m_IsPlugged");
215 RegisterNetSyncVariableInt(
"m_EM.m_EnergySourceNetworkIDLow");
216 RegisterNetSyncVariableInt(
"m_EM.m_EnergySourceNetworkIDHigh");
217 RegisterNetSyncVariableFloat(
"m_EM.m_Energy");
221 RegisterNetSyncVariableInt(
"m_ViewIndex", 0, 99 );
223 RegisterNetSyncVariableBool(
"m_RefresherViable");
227 m_LastUpdatedTime = 0.0;
228 m_ElapsedSinceLastUpdate = 0.0;
230 m_CanDisplayWeight = ConfigGetBool(
"displayWeight");
232 InitDamageZoneMapping();
233 InitDamageZoneDisplayNameMapping();
248 void InitItemVariables()
250 m_VarTemperatureInit = ConfigGetFloat(
"varTemperatureInit");
251 m_VarTemperatureMin = ConfigGetFloat(
"varTemperatureMin");
252 m_VarTemperatureMax = ConfigGetFloat(
"varTemperatureMax");
254 if (ConfigIsExisting(
"varTemperatureFreezePoint"))
255 m_VarTemperatureFreezeThreshold = ConfigGetFloat(
"varTemperatureFreezePoint");
257 m_VarTemperatureFreezeThreshold =
float.LOWEST;
259 if (ConfigIsExisting(
"varTemperatureThawPoint"))
260 m_VarTemperatureThawThreshold = ConfigGetFloat(
"varTemperatureThawPoint");
262 m_VarTemperatureThawThreshold =
float.LOWEST;
264 m_VarTemperatureFreezeTime =
Math.Clamp(ConfigGetFloat(
"varTemperatureFreezeTime"),1,
float.
MAX);
265 m_VarTemperatureThawTime =
Math.Clamp(ConfigGetFloat(
"varTemperatureThawTime"),1,
float.
MAX);
266 if (ConfigIsExisting(
"varTemperatureOverheatTime"))
267 m_VarTemperatureOverheatTime = ConfigGetFloat(
"varTemperatureOverheatTime");
269 m_VarTemperatureOverheatTime = -1;
271 if (ConfigIsExisting(
"varHeatPermeabilityCoef"))
272 m_VarHeatPermeabilityCoef = ConfigGetFloat(
"varHeatPermeabilityCoef");
274 m_VarHeatPermeabilityCoef = 1;
278 RegisterNetSyncVariableFloat(
"m_VarTemperature", GetTemperatureMin(),GetTemperatureMax());
279 RegisterNetSyncVariableBool(
"m_IsFrozen");
285 m_FreezeThawProgress = -1;
302 return EInventoryIconVisibility.ALWAYS;
309 Component CreateComponent(
int comp_type,
string extended_class_name=
"")
311 return GetComponent(comp_type, extended_class_name);
315 Component GetComponent(
int comp_type,
string extended_class_name=
"")
317 if ( m_ComponentsBank == NULL )
320 return m_ComponentsBank.GetComponent(comp_type, extended_class_name);
324 bool DeleteComponent(
int comp_type)
326 return m_ComponentsBank.DeleteComponent(comp_type);
340 bool HasComponent(
int comp_type)
342 if ( m_ComponentsBank )
343 return m_ComponentsBank.IsComponentAlreadyExist(comp_type);
349 void MaxLifetimeRefreshCalc()
351 if ( (!
GetGame().IsMultiplayer() ||
GetGame().IsServer()) && GetEconomyProfile() )
353 float lifetime = GetEconomyProfile().GetLifetime();
354 int frequency = GetCEApi().GetCEGlobalInt(
"FlagRefreshFrequency");
355 if ( frequency <= 0 )
360 if ( frequency <= lifetime )
362 m_RefresherViable =
true;
374 return m_RefresherViable;
378 override void SetDebugItem()
380 super.SetDebugItem();
387 void InitDamageZoneMapping()
390 DamageSystem.GetDamageZoneMap(
this,m_DamageZoneMap);
394 void InitDamageZoneDisplayNameMapping()
398 string component_name;
404 else if ( IsMagazine() )
413 path_base =
string.Format(
"%1 %2 DamageSystem DamageZones", path_base,
GetType() );
415 if ( !
GetGame().ConfigIsExisting(path_base) )
417 component_name = GetDisplayName();
418 GetGame().FormatRawConfigStringKeys(component_name);
419 m_DamageDisplayNameMap.Insert(
"".Hash(), component_name );
424 GetDamageZones( zone_names );
426 for (
int i = 0; i < zone_names.Count(); i++ )
428 path =
string.Format(
"%1 %2 displayName", path_base, zone_names[i] );
432 GetGame().FormatRawConfigStringKeys(component_name);
433 m_DamageDisplayNameMap.Insert( zone_names[i].Hash(), component_name );
452 return m_DamageZoneMap;
457 return m_DamageDisplayNameMap;
463 return m_CanDisplayWeight;
467 void Log(
string msg,
string fnc_name =
"n/a")
469 Debug.Log(msg,
"Object",
"n/a", fnc_name, this.
GetType());
475 Debug.LogWarning(msg,
"Object",
"n/a", fnc_name, this.
GetType());
481 Debug.LogError(msg,
"Object",
"n/a", fnc_name, this.
GetType());
487 return GetCompBS() && GetCompBS().IsSkinned();
493 GetCompBS().SetAsSkinned();
498 if ( !IsSkinned() && tool )
507 if (m_BloodInfectionChanceCached.Find(type, value))
515 string basePath =
string.Format(
"cfgVehicles %1 Skinning BloodInfectionSettings",
GetType());
516 if (
g_Game.ConfigIsExisting(basePath))
520 float value =
g_Game.ConfigGetFloat(
string.Format(
"%1 %2 chance", basePath, agentName));
521 m_BloodInfectionChanceCached.Set(type, value);
650 return (!HasAnyCargo() && GetInventory().AttachmentCount() == 0);
668 CargoBase cargo = GetInventory().GetCargo();
670 if(!cargo)
return false;
672 if( cargo.GetItemCount() > 0 )
684 return m_AttachmentsWithCargo;
689 return m_AttachmentsWithAttachments;
716 return !( GetParent() || GetHierarchyParent() );
741 return IsDamageDestroyed();
746 if (ai && ai.IsBeingBackstabbed())
753 return !IsDamageDestroyed();
771 m_PendingDelete =
true;
783 if (GetHierarchyRootPlayer() == null || (GetHierarchyRootPlayer() && !GetHierarchyRootPlayer().IsAlive()))
790 GetHierarchyRootPlayer().JunctureDeleteItem(
this);
792 GetHierarchyRootPlayer().AddItemToDelete(
this);
804 return IsPreparedToDelete() || m_PendingDelete || ToDelete() ||
IsPendingDeletion();
809 if (super.CanBeActionTarget())
811 return !IsSetForDeletion();
821 m_PreparedToDelete =
true;
826 return m_PreparedToDelete;
847 Debug.Log(
"TryDelete - not ready for deletion");
851 if (
GetGame().HasInventoryJunctureItem(
this))
853 Debug.Log(
"TryDelete - deferred call");
859 Debug.Log(
"TryDelete - OnBeforeTryDelete end");
861 Debug.Log(
"TryDelete - DeleteSafe end");
883 if (!GetHierarchyParent())
886 return GetHierarchyParent().GetHierarchyLevel(lvl+1);
891 InitAttachmentExclusionValues();
899 GetInventory().EEInit();
900 m_AttachmentsWithCargo.Clear();
901 m_AttachmentsWithAttachments.Clear();
902 for (
int i = 0; i < GetInventory().AttachmentCount(); i++ )
904 EntityAI attachment = GetInventory().GetAttachmentFromIndex( i );
907 if ( attachment.GetInventory().GetCargo() )
909 m_AttachmentsWithCargo.Insert( attachment );
912 if ( attachment.GetInventory().GetAttachmentSlotsCount() > 0 )
914 m_AttachmentsWithAttachments.Insert( attachment );
920 MaxLifetimeRefreshCalc();
929 m_PendingDelete =
true;
930 GetInventory().EEDelete(parent);
938 super.OnExplosionEffects(source, directHit, componentIndex, surface, pos, surfNormal, energyFactor, explosionFactor, isWater, ammoType);
940 g_Game.GetWorld().AddEnvShootingSource(pos, 1.0);
942 if (m_DestructionBehaviourObj && m_DestructionBehaviourObj.HasExplosionDamage())
944 m_DestructionBehaviourObj.OnExplosionEffects(source, directHit, componentIndex, surface, pos, surfNormal, energyFactor, explosionFactor, isWater, ammoType);
957 EntityAI old_owner = oldLoc.GetParent();
958 EntityAI new_owner = newLoc.GetParent();
959 OnItemLocationChanged(old_owner, new_owner);
963 OnItemAttachmentSlotChanged(oldLoc,newLoc);
971 Error(
"EntityAI::EEItemLocationChanged - detached, but old_owner is null");
977 OnWasAttached(newLoc.GetParent(), newLoc.GetSlot());
979 Error(
"EntityAI::EEItemLocationChanged - attached, but new_owner is null");
984 Man.Cast(oldLoc.GetParent()).OnItemInHandsChanged();
989 Man.Cast(newLoc.GetParent()).OnItemInHandsChanged();
1008 m_LastUpdatedTime =
GetGame().GetTickTime();
1010 if (GetInventory() && newParent == null)
1012 GetInventory().ResetFlipCargo();
1024 EntityAI parent = GetHierarchyParent();
1030 parent.OnAttachmentRuined(
this);
1036 AttemptDestructionBehaviour(oldLevel,newLevel, zone);
1051 if (!m_DestructionBehaviourObj)
1056 if (m_DestructionBehaviourObj)
1058 m_DestructionBehaviourObj.OnHealthLevelChanged(
this, oldLevel, newLevel, zone);
1063 ErrorEx(
"Incorrect destruction behaviour type, make sure the class returned in 'GetDestructionBehaviour()' is a valid type inheriting from 'DestructionEffectBase'");
1074 if (m_OnKilledInvoker)
1075 m_OnKilledInvoker.Invoke(
this, killer);
1103 dead_entity.SetHealth(GetHealth());
1113 if (m_OnHitByInvoker)
1114 m_OnHitByInvoker.Invoke(
this, damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
1130 PropagateExclusionValueRecursive(item.GetAttachmentExclusionMaskAll(slotId),slotId);
1133 if ( m_ComponentsBank != NULL )
1137 if ( m_ComponentsBank.IsComponentAlreadyExist(comp_key) )
1139 m_ComponentsBank.GetComponent(comp_key).Event_OnItemAttached(item, slot_name);
1145 if ( m_EM && item.GetCompEM())
1148 if ( item.GetInventory().GetCargo() )
1149 m_AttachmentsWithCargo.Insert( item );
1151 if ( item.GetInventory().GetAttachmentSlotsCount() > 0 )
1152 m_AttachmentsWithAttachments.Insert( item );
1154 if ( m_OnItemAttached )
1155 m_OnItemAttached.Invoke( item, slot_name,
this );
1165 ClearExclusionValueRecursive(item.GetAttachmentExclusionMaskAll(slotId),slotId);
1168 if ( m_ComponentsBank != NULL )
1172 if ( m_ComponentsBank.IsComponentAlreadyExist(comp_key) )
1174 m_ComponentsBank.GetComponent(comp_key).Event_OnItemDetached(item, slot_name);
1180 if (m_EM && item.GetCompEM())
1183 if ( m_AttachmentsWithCargo.Find( item ) > -1 )
1184 m_AttachmentsWithCargo.RemoveItem( item );
1186 if ( m_AttachmentsWithAttachments.Find( item ) > -1 )
1187 m_AttachmentsWithAttachments.RemoveItem( item );
1190 if ( m_OnItemDetached )
1191 m_OnItemDetached.Invoke( item, slot_name,
this );
1198 if( m_OnItemAddedIntoCargo )
1199 m_OnItemAddedIntoCargo.Invoke( item,
this );
1201 item.OnMovedInsideCargo(
this);
1208 if( m_OnItemRemovedFromCargo )
1209 m_OnItemRemovedFromCargo.Invoke( item,
this );
1211 item.OnRemovedFromCargo(
this);
1216 if( m_OnItemMovedInCargo )
1217 m_OnItemMovedInCargo.Invoke( item,
this );
1218 item.OnMovedWithinCargo(
this);
1223 if( !m_OnItemAttached )
1225 return m_OnItemAttached;
1230 if( !m_OnItemDetached )
1232 return m_OnItemDetached;
1237 if( !m_OnItemAddedIntoCargo )
1239 return m_OnItemAddedIntoCargo;
1244 if( !m_OnItemRemovedFromCargo )
1246 return m_OnItemRemovedFromCargo;
1251 if( !m_OnItemMovedInCargo )
1253 return m_OnItemMovedInCargo;
1258 if( !m_OnItemFlipped )
1260 return m_OnItemFlipped;
1265 if( !m_OnViewIndexChanged )
1267 return m_OnViewIndexChanged;
1279 if( !m_OnReleaseLock )
1281 return m_OnReleaseLock;
1286 if( !m_OnAttachmentSetLock )
1288 return m_OnAttachmentSetLock;
1293 if( !m_OnAttachmentReleaseLock )
1295 return m_OnAttachmentReleaseLock;
1300 if ( !m_OnHitByInvoker )
1302 return m_OnHitByInvoker;
1307 if ( !m_OnKilledInvoker )
1309 return m_OnKilledInvoker;
1352 bool is_attachment =
false;
1354 if (potential_energy_source)
1355 is_attachment = GetInventory().HasAttachment(potential_energy_source);
1357 if ( !is_attachment && potential_energy_source )
1358 is_attachment = potential_energy_source.GetInventory().HasAttachment(
this);
1360 if ( potential_energy_source && potential_energy_source.GetCompEM() && !is_attachment )
1378 if (GetHierarchyRootPlayer())
1379 GetHierarchyRootPlayer().SetProcessUIWarning(
true);
1385 string cfg_path =
"cfgVehicles " +
GetType() +
" AnimationSources";
1387 if (
GetGame().ConfigIsExisting(cfg_path) )
1389 int selections =
GetGame().ConfigGetChildrenCount(cfg_path);
1391 for (
int i = 0; i < selections; i++)
1393 string selection_name;
1394 GetGame().ConfigGetChildName(cfg_path, i, selection_name);
1395 HideSelection(selection_name);
1403 string cfg_path =
"cfgVehicles " +
GetType() +
" AnimationSources";
1405 if (
GetGame().ConfigIsExisting(cfg_path) )
1407 int selections =
GetGame().ConfigGetChildrenCount(cfg_path);
1409 for (
int i = 0; i < selections; i++)
1411 string selection_name;
1412 GetGame().ConfigGetChildName(cfg_path, i, selection_name);
1413 ShowSelection(selection_name);
1427 return CheckAttachmentReceiveExclusion(attachment,slotId);
1450 return !IsHologram();
1466 if( attachment && attachment.GetInventory() && GetInventory() )
1469 attachment.GetInventory().GetCurrentInventoryLocation( il );
1472 int slot = il.GetSlot();
1473 return !GetInventory().GetSlotLock( slot );
1496 EntityAI att = GetInventory().FindAttachment(slot);
1498 return att.CanBeCombined(e,
true, stack_max_limit);
1524 if (GetInventory() && GetInventory().GetCargo())
1525 return GetInventory().GetCargo().CanReceiveItemIntoCargo(item);
1549 return !IsHologram();
1560 if (GetInventory() && GetInventory().GetCargo())
1561 return GetInventory().GetCargo().CanSwapItemInCargo(child_entity, new_entity);
1625 int attachmentDepth = 0;
1628 if (ent.GetInventory().GetCurrentInventoryLocation(lcn) && lcn.IsValid())
1642 ent = ent.GetHierarchyParent();
1645 return attachmentDepth <=
GameConstants.INVENTORY_MAX_REACHABLE_DEPTH_ATT;
1671 return !IsHologram();
1702 Debug.LogWarning(
"Obsolete function - use CanDisplayAttachmentSlot with slot id parameter");
1720 int count = GetInventory().GetAttachmentSlotsCount();
1722 for (
int i = 0; i < count; i++)
1724 slotID = GetInventory().GetAttachmentSlotId(i);
1748 return GetInventory().GetCargo() != null;
1772 return GetHierarchyRootPlayer() ==
GetGame().GetPlayer();
1783 SetInvisible(
false);
1784 OnInvisibleSet(
false);
1785 SetInvisibleRecursive(
false,parent);
1803 return GetInventory().GetAttachmentSlotsCount();
1810 if (
g_Game && GetInventory())
1814 return GetInventory().FindAttachment(slot_id);
1822 Man player = GetHierarchyRootPlayer();
1827 if (!inv || inv.GetUserReservedLocationCount() == 0)
1830 int id = inv.FindFirstUserReservedLocationIndexForContainer(
this);
1835 inv.GetUserReservedLocation(
id, loc);
1837 if (loc.GetSlot() != slotID)
1848 EntityAI parent = GetHierarchyParent();
1852 GetInventory().GetCurrentInventoryLocation( inventory_location );
1854 return parent.GetInventory().GetSlotLock( inventory_location.GetSlot() );
1865 if (
GetGame().IsMultiplayer() )
1866 return GetInventory().TakeEntityToInventory(
InventoryMode.JUNCTURE, flags, item);
1868 return GetInventory().TakeEntityToInventory(
InventoryMode.PREDICTIVE, flags, item);
1872 return GetInventory().TakeEntityToInventory(
InventoryMode.LOCAL, flags, item);
1876 return GetInventory().TakeEntityToInventory(
InventoryMode.SERVER, flags, item);
1880 if (
GetGame().IsMultiplayer() )
1881 return GetInventory().TakeEntityToTargetInventory(
InventoryMode.JUNCTURE, target, flags, item);
1883 return GetInventory().TakeEntityToTargetInventory(
InventoryMode.PREDICTIVE, target, flags, item);
1887 return GetInventory().TakeEntityToTargetInventory(
InventoryMode.LOCAL, target, flags, item);
1891 return GetInventory().TakeEntityToTargetInventory(
InventoryMode.SERVER, target, flags, item);
1898 if (
GetGame().IsMultiplayer() )
1899 return GetInventory().TakeEntityToCargo(
InventoryMode.JUNCTURE, item);
1901 return GetInventory().TakeEntityToCargo(
InventoryMode.PREDICTIVE, item);
1905 return GetInventory().TakeEntityToCargo(
InventoryMode.LOCAL, item);
1909 return GetInventory().TakeEntityToCargo(
InventoryMode.SERVER, item);
1914 if (
GetGame().IsMultiplayer() )
1915 return GetInventory().TakeEntityToTargetCargo(
InventoryMode.JUNCTURE, target, item);
1917 return GetInventory().TakeEntityToTargetCargo(
InventoryMode.PREDICTIVE, target, item);
1921 return GetInventory().TakeEntityToTargetCargo(
InventoryMode.LOCAL, target, item);
1925 return GetInventory().TakeEntityToTargetCargo(
InventoryMode.SERVER, target, item);
1932 if (
GetGame().IsMultiplayer() )
1933 return GetInventory().TakeEntityToCargoEx(
InventoryMode.JUNCTURE, item, idx, row, col);
1935 return GetInventory().TakeEntityToCargoEx(
InventoryMode.PREDICTIVE, item, idx, row, col);
1939 return GetInventory().TakeEntityToCargoEx(
InventoryMode.LOCAL, item, idx, row, col);
1944 if (
GetGame().IsMultiplayer() )
1945 return GetInventory().TakeEntityToTargetCargoEx(
InventoryMode.JUNCTURE, cargo, item, row, col);
1947 return GetInventory().TakeEntityToTargetCargoEx(
InventoryMode.PREDICTIVE, cargo, item, row, col);
1951 return GetInventory().TakeEntityToTargetCargoEx(
InventoryMode.LOCAL, cargo, item, row, col);
1955 return GetInventory().TakeEntityToTargetCargoEx(
InventoryMode.SERVER, cargo, item, row, col);
1962 if (
GetGame().IsMultiplayer() )
1963 return GetInventory().TakeEntityAsAttachmentEx(
InventoryMode.JUNCTURE, item, slot);
1965 return GetInventory().TakeEntityAsAttachmentEx(
InventoryMode.PREDICTIVE, item, slot);
1969 return GetInventory().TakeEntityAsAttachmentEx(
InventoryMode.LOCAL, item, slot);
1973 return GetInventory().TakeEntityAsAttachmentEx(
InventoryMode.SERVER, item, slot);
1978 if (
GetGame().IsMultiplayer() )
1979 return GetInventory().TakeEntityAsTargetAttachmentEx(
InventoryMode.JUNCTURE, target, item, slot);
1981 return GetInventory().TakeEntityAsTargetAttachmentEx(
InventoryMode.PREDICTIVE, target, item, slot);
1985 return GetInventory().TakeEntityAsTargetAttachmentEx(
InventoryMode.LOCAL, target, item, slot);
1989 return GetInventory().TakeEntityAsTargetAttachmentEx(
InventoryMode.SERVER, target, item, slot);
1994 if (
GetGame().IsMultiplayer() )
1995 return GetInventory().TakeEntityAsTargetAttachment(
InventoryMode.JUNCTURE, target, item);
1997 return GetInventory().TakeEntityAsTargetAttachment(
InventoryMode.PREDICTIVE, target, item);
2001 return GetInventory().TakeEntityAsTargetAttachment(
InventoryMode.LOCAL, target, item);
2005 return GetInventory().TakeEntityAsTargetAttachment(
InventoryMode.SERVER, target, item);
2010 if (
GetGame().IsMultiplayer() )
2011 return GetInventory().TakeToDst(
InventoryMode.JUNCTURE, src, dst);
2013 return GetInventory().TakeToDst(
InventoryMode.PREDICTIVE, src, dst);
2017 return GetInventory().TakeToDst(
InventoryMode.LOCAL, src, dst);
2021 return GetInventory().TakeToDst(
InventoryMode.SERVER, src, dst);
2029 if (
GetGame().IsMultiplayer())
2030 return GetInventory().TakeEntityAsAttachment(
InventoryMode.JUNCTURE, item);
2032 return GetInventory().TakeEntityAsAttachment(
InventoryMode.PREDICTIVE, item);
2036 return GetInventory().TakeEntityAsAttachment(
InventoryMode.LOCAL, item);
2040 return GetInventory().TakeEntityAsAttachment(
InventoryMode.SERVER, item);
2063 for (
int i = 0; i < GetInventory().AttachmentCount(); i++ )
2065 EntityAI attachment = GetInventory().GetAttachmentFromIndex( i );
2066 if ( attachment && attachment.IsInherited( type ) )
2077 for (
int i = 0; i < GetInventory().AttachmentCount(); i++ )
2079 EntityAI attachment = GetInventory().GetAttachmentFromIndex ( i );
2080 if ( attachment.IsKindOf ( type ) )
2104 return SpawnEntityOnGroundPos(object_name, pos);
2113 Math3D.MatrixIdentity4(mat);
2115 il.SetGround(NULL, mat);
2123 il.SetGround(NULL, mat);
2136 void SetWet(
float value,
bool allow_client =
false);
2198 bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true);
2238 return (IsMan() || IsAnimal() || IsZombie()) && IsAlive() ||
IsCorpse();
2243 EntityAI rootParent = GetHierarchyRoot();
2244 bool isParentAliveOrganism =
false;
2245 if (rootParent && rootParent !=
this)
2246 isParentAliveOrganism = (rootParent.IsMan() || rootParent.IsAnimal() || rootParent.IsZombie()) && rootParent.IsAlive();
2248 if (UseConfigInitTemperature())
2250 SetTemperatureDirect(m_VarTemperatureInit);
2252 else if (isParentAliveOrganism)
2254 SetTemperatureDirect(rootParent.GetTemperature());
2258 SetTemperatureDirect(
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this));
2266 if (!IsServerCheck(allow_client))
2269 float min = GetTemperatureMin();
2270 float max = GetTemperatureMax();
2271 float previousValue = m_VarTemperature;
2272 m_VarTemperature =
Math.Clamp(value, min, max);
2274 if (previousValue != m_VarTemperature)
2285 if (!IsServerCheck(allow_client))
2301 m_LastFTChangeTime = -1;
2302 m_PresumedTimeRemaining = -1;
2307 Debug.Log(
"SetTemperatureEx | entity " +
this +
" does not have temperature range defined!");
2311 if (!m_TAC.TryAccessSource(data))
2314 if (!IsServerCheck(
false))
2317 InterpolateTempData(TemperatureDataInterpolated.Cast(data));
2318 float target =
Math.Clamp(data.m_AdjustedTarget, GetTemperatureMin(), GetTemperatureMax());
2321 if (CanItemOverheat())
2328 HandleItemOverheating(delta,data);
2346 SetTemperatureDirect(target);
2348 HandleFreezingProgression(delta,data);
2352 SetTemperatureDirect(target);
2354 HandleFreezingProgression(delta,data);
2369 SetTemperatureDirect(target);
2371 HandleFreezingProgression(delta,data);
2375 SetTemperatureDirect(target);
2377 HandleFreezingProgression(delta,data);
2383 SetTemperatureDirect(target);
2392 Debug.Log(
"RefreshTemperatureAccess | entity " +
this +
" does not have temperature range defined!");
2396 m_TAC.TryAccessSource(data);
2409 SetTemperatureDirect(GetTemperatureMax());
2415 return m_VarTemperature;
2420 return m_VarTemperatureInit;
2425 return m_VarTemperatureMin;
2430 return m_VarTemperatureMax;
2445 return m_VarHeatPermeabilityCoef;
2450 return m_VarTemperatureFreezeThreshold;
2455 return m_VarTemperatureThawThreshold;
2460 return m_VarTemperatureFreezeTime;
2465 return m_VarTemperatureThawTime;
2471 return m_FreezeThawProgress;
2477 return m_FreezeThawProgress <= 0.0 || m_FreezeThawProgress >= 1.0;
2483 m_FreezeThawProgress = val;
2498 if (!CanFreeze() && frozen)
2501 bool previous = m_IsFrozen;
2502 m_IsFrozen = frozen;
2503 SetFreezeThawProgress(frozen);
2505 if (previous != frozen)
2508 OnFreezeStateChangeServer();
2514 float progressVal = m_FreezeThawProgress;
2515 float progressDelta = 1;
2520 if (data.m_UpdateTimeInfo == -1)
2521 progressDelta = (-deltaHeat /
GameConstants.TEMPERATURE_RATE_AVERAGE_ABS) *
GameConstants.TEMPERATURE_FREEZETHAW_LEGACY_COEF;
2523 progressDelta *= data.m_UpdateTimeInfo;
2525 if (progressDelta == 0)
2528 float changeTimeDefault;
2529 float changeTimeMin;
2543 float coef = data.m_UpdateTimeCoef;
2548 changeTimeDefault *= 1/coef;
2550 changeTime =
Math.Lerp(
Math.Max(changeTimeDefault,changeTimeMin),changeTimeMin,data.m_InterpolatedFraction);
2551 progressVal = progressVal + progressDelta / changeTime;
2553 float remnantTemp = 0;
2554 if (!m_IsFrozen && progressVal >= 1)
2557 if (progressVal > 1.0)
2559 if (data.m_UpdateTimeInfo == -1)
2560 remnantTemp = (progressVal - 1) * changeTime *
GameConstants.TEMPERATURE_RATE_AVERAGE_ABS * -1;
2562 remnantTemp = (((progressVal - 1) * changeTime) / progressDelta) * deltaHeat;
2565 else if (m_IsFrozen && progressVal <= 0)
2568 if (progressVal < 0.0)
2570 if (data.m_UpdateTimeInfo == -1)
2571 remnantTemp = -progressVal * changeTime *
GameConstants.TEMPERATURE_RATE_AVERAGE_ABS;
2573 remnantTemp = ((-progressVal * changeTime) / progressDelta) * deltaHeat;
2578 if ((progressDelta < 0 && !m_IsFrozen) || (progressDelta > 0 && m_IsFrozen))
2579 progressVal = (progressDelta *
GameConstants.TEMPERATURE_FREEZETHAW_ACCELERATION_COEF) / changeTime + m_FreezeThawProgress;
2581 SetFreezeThawProgress(
Math.Clamp(progressVal,0,1));
2584 if (remnantTemp >=
GameConstants.TEMPERATURE_SENSITIVITY_THRESHOLD)
2588 if (progressVal > 0 && progressVal < 1)
2590 m_LastFTChangeTime = changeTime;
2592 m_PresumedTimeRemaining = (1 - progressVal) * changeTime;
2594 m_PresumedTimeRemaining = progressVal * changeTime;
2606 return GetItemOverheatTime() >= 0;
2612 return GetTemperatureMax();
2618 return m_VarTemperatureOverheatTime;
2623 return m_OverheatProgress >= 1;
2628 return m_OverheatProgress;
2633 float previous = m_OverheatProgress;
2634 m_OverheatProgress =
Math.Clamp(val,0,1);
2636 if (m_OverheatProgress >= 1)
2639 OnItemOverheatStart();
2641 OnItemOverheat(deltaTime);
2643 else if (previous >= 1)
2645 OnItemOverheatEnd();
2656 float deltaTime = 1;
2657 float progressVal = m_OverheatProgress;
2662 if (data.m_UpdateTimeInfo == -1)
2663 deltaTime = deltaHeat /
GameConstants.TEMPERATURE_RATE_AVERAGE_ABS;
2665 deltaTime *= data.m_UpdateTimeInfo;
2667 if (GetItemOverheatTime() > 0)
2669 float changeTime =
Math.Lerp(
Math.Max(
GameConstants.TEMPERATURE_TIME_OVERHEAT_MIN,GetItemOverheatTime()),
GameConstants.TEMPERATURE_TIME_OVERHEAT_MIN,
Math.Clamp(data.m_InterpolatedFraction,0,1));
2670 progressVal += deltaTime / changeTime;
2676 else if (deltaHeat > 0)
2680 SetItemOverheatProgress(
Math.Clamp(progressVal,0,1),deltaTime);
2734 Error(
"Attempting to change variable client side, variables are supposed to be changed on server only !!");
2745 return m_HiddenSelectionsData;
2751 if (m_HiddenSelectionsData)
2752 return m_HiddenSelectionsData.GetHiddenSelectionIndex( selection );
2760 if (m_HiddenSelectionsData)
2761 return m_HiddenSelectionsData.m_HiddenSelections;
2763 return super.GetHiddenSelections();
2769 if (m_HiddenSelectionsData)
2770 return m_HiddenSelectionsData.m_HiddenSelectionsTextures;
2772 return super.GetHiddenSelectionsTextures();
2778 if (m_HiddenSelectionsData)
2779 return m_HiddenSelectionsData.m_HiddenSelectionsMaterials;
2781 return super.GetHiddenSelectionsMaterials();
2905 energy_source.GetPersistentID(b1, b2, b3, b4);
2949 if ( !ctx.Read( f_energy ) )
2954 bool b_is_passive =
false;
2955 if ( !ctx.Read( b_is_passive ) )
2960 bool b_is_on =
false;
2961 if ( !ctx.Read( b_is_on ) )
2968 bool b_is_plugged =
false;
2969 if ( !ctx.Read( b_is_plugged ) )
2973 if ( version <= 103 )
2976 int i_energy_source_ID_low = 0;
2977 if ( !ctx.Read( i_energy_source_ID_low ) )
2981 int i_energy_source_ID_high = 0;
2982 if ( !ctx.Read( i_energy_source_ID_high ) )
2992 if ( !ctx.Read(b1) )
return false;
2993 if ( !ctx.Read(b2) )
return false;
2994 if ( !ctx.Read(b3) )
return false;
2995 if ( !ctx.Read(b4) )
return false;
3014 if (!LoadVariables(ctx, version))
3031 if (
GetGame().IsMultiplayer() )
3054 string object = energy_source.GetType();
3055 Error(
"Synchronization error! Object " +
object +
" has no instance of the Energy Manager component!");
3071 if (m_IsFrozen != m_IsFrozenLocal && !
GetGame().IsDedicatedServer())
3073 m_IsFrozenLocal = m_IsFrozen;
3074 OnFreezeStateChangeClient();
3084 return (variable & m_VariablesMask);
3089 m_VariablesMask = variable | m_VariablesMask;
3099 m_VariablesMask = ~variable & m_VariablesMask;
3119 if (m_VariablesMask)
3122 ctx.Write(varFlags);
3127 if (m_VariablesMask)
3137 if (!ctx.Read(varFlags))
3154 ctx.Write(m_VariablesMask);
3160 ctx.Write((
int)GetIsFrozen());
3173 if (!ctx.Read(intValue))
3176 m_VariablesMask = intValue;
3181 if (!ctx.Read(value))
3183 SetTemperatureDirect(value);
3185 if (!ctx.Read(intValue))
3187 SetFrozen(intValue);
3196 floats_out.Insert(m_VariablesMask);
3201 floats_out.Insert(m_VarTemperature);
3202 floats_out.Insert((
float)GetIsFrozen());
3203 floats_out.Insert((
float)GetFreezeThawProgress());
3211 int mask =
Math.Round(floats.Get(index));
3217 float temperature = floats.Get(index);
3218 SetTemperatureDirect(temperature);
3219 floats.RemoveOrdered(index);
3221 bool frozen =
Math.Round(floats.Get(index));
3223 floats.RemoveOrdered(index);
3225 float FTProgress = floats.Get(index);
3226 SetFreezeThawProgress(FTProgress);
3227 floats.RemoveOrdered(index);
3237 if ( m_ComponentsBank != NULL )
3241 if ( m_ComponentsBank.IsComponentAlreadyExist(comp_key) )
3243 m_ComponentsBank.GetComponent(comp_key).Event_OnFrame(other, timeSlice);
3251 string text =
string.Empty;
3253 text +=
"Weight: " + GetWeightEx() +
"\n";
3254 text +=
"Disabled: " + GetIsSimulationDisabled() +
"\n";
3256 if (GetEconomyProfile())
3257 text +=
"CE Lifetime default: " + (
int)GetEconomyProfile().GetLifetime() +
"\n";
3258 text +=
"CE Lifetime remaining: " + (
int)GetLifetime() +
"\n";
3265 text +=
"Switched On: " + compEM.
IsSwitchedOn() +
"\n";
3266 text +=
"Is Working: " + compEM.
IsWorking() +
"\n";
3313 SetAnimationPhase ( selection_name, 1 );
3322 SetAnimationPhase ( selection_name, 0 );
3346 if (GetHierarchyParent())
3347 GetHierarchyParent().IncreaseLifetimeUp();
3420 super.OnRPC(sender, rpc_type, ctx);
3427 case ERPCs.RPC_BS_SKINNED_STATE:
3429 Param1<bool> p_skinned_state=
new Param1<bool>(
false);
3430 if (ctx.Read(p_skinned_state))
3432 float state = p_skinned_state.param1;
3433 if (state && GetCompBS())
3434 GetCompBS().SetAsSkinnedClient();
3439 case ERPCs.RPC_EXPLODE_EVENT:
3448 #ifdef DIAG_DEVELOPER
3458 int AttachmentsCount = GetInventory().AttachmentCount();
3459 if (AttachmentsCount > 0)
3461 for (i = 0; i < AttachmentsCount; i++)
3463 GetInventory().GetAttachmentFromIndex(i).FixEntity();
3467 CargoBase cargo = GetInventory().GetCargo();
3470 int cargoCount = cargo.GetItemCount();
3471 for (i = 0; i < cargoCount; i++)
3473 cargo.GetItem(i).FixEntity();
3487 return m_ConfigWeight * GetWetWeightModifier();
3491 string GetConfigWeightModifiedDebugText()
3493 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
3495 return "(" + m_ConfigWeight +
"(config weight) * " + GetWetWeightModifier() +
"(Wetness Modifier))";
3497 return string.Empty;
3505 return GetWeightEx();
3517 if (WeightDebug.m_VerbosityFlags & WeightDebugType.SET_DIRTY_FLAG)
3519 Print(
"---------------------------------------");
3520 Print(
"ent:" +
this +
" - SetWeightDirty");
3521 if (WeightDebug.m_VerbosityFlags & WeightDebugType.DUMP_STACK)
3525 Print(
"---------------------------------------");
3529 if (GetHierarchyParent())
3531 GetHierarchyParent().SetWeightDirty();
3541 int AttachmentsCount = GetInventory().AttachmentCount();
3542 if (AttachmentsCount > 0)
3544 for (i = 0; i < AttachmentsCount; i++)
3546 totalWeight += GetInventory().GetAttachmentFromIndex(i).GetWeightEx(forceRecalc);
3550 CargoBase cargo = GetInventory().GetCargo();
3553 int cargoCount = cargo.GetItemCount();
3554 for (i = 0; i < cargoCount; i++)
3556 totalWeight += cargo.GetItem(i).GetWeightEx(forceRecalc);
3565 return GetInventoryAndCargoWeight(forceRecalc);
3572 if (m_WeightDirty || forceRecalc)
3578 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
3580 WeightDebug.GetWeightDebug(
this).SetWeight(m_WeightEx);
3582 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_DIRTY)
3584 Print(
"ent:" +
this +
" - Dirty Recalc");
3585 if (WeightDebug.m_VerbosityFlags & WeightDebugType.DUMP_STACK)
3596 void UpdateWeight(WeightUpdateType updateType = WeightUpdateType.FULL,
float weightAdjustment = 0);
3616 if (action_id ==
EActions.FIX_ENTITY)
3618 #ifdef DIAG_DEVELOPER
3622 else if (action_id ==
EActions.GET_TOTAL_WEIGHT)
3624 WeightDebug.ClearWeightDebug();
3626 Debug.Log(
"======================== "+
GetType() +
" =================================");
3630 Debug.Log(
"----------------------------------------------------------------------------------------------");
3632 else if (action_id ==
EActions.GET_TOTAL_WEIGHT_RECALC)
3634 WeightDebug.ClearWeightDebug();
3635 WeightDebug.SetVerbosityFlags(WeightDebugType.RECALC_FORCED);
3637 Debug.Log(
"======================== "+
GetType() +
" RECALC ===========================");
3641 WeightDebug.PrintAll(
this);
3642 Debug.Log(
"----------------------------------------------------------------------------------------------");
3643 WeightDebug.SetVerbosityFlags(0);
3645 else if (action_id ==
EActions.GET_PLAYER_WEIGHT)
3647 WeightDebug.ClearWeightDebug();
3649 Debug.Log(
"======================== PLAYER: "+player+
" ===========================");
3651 Debug.Log(
"New overall weight Player:"+player.GetWeightEx().ToString());
3653 Debug.Log(
"----------------------------------------------------------------------------------------------");
3655 else if (action_id ==
EActions.GET_PLAYER_WEIGHT_RECALC)
3657 WeightDebug.ClearWeightDebug();
3658 WeightDebug.SetVerbosityFlags(WeightDebugType.RECALC_FORCED);
3660 Debug.Log(
"======================== PLAYER RECALC: "+player+
" ===========================");
3662 Debug.Log(
"New overall weight Player:"+player.GetWeightEx(
true).ToString());
3663 WeightDebug.PrintAll(player);
3664 Debug.Log(
"----------------------------------------------------------------------------------------------");
3665 WeightDebug.SetVerbosityFlags(0);
3673 int m_ViewIndex = 0;
3678 m_ViewIndex = index;
3689 if ( MemoryPointExists(
"invView2" ) )
3691 #ifdef PLATFORM_WINDOWS
3693 GetInventory().GetCurrentInventoryLocation( il );
3724 #ifdef PLATFORM_CONSOLE
3735 Debug.LogError(
"EntityAI: HitComponentForAI not set properly for that entity (" +
GetType() +
")");
3743 Debug.LogError(
"EntityAI: DefaultHitComponent not set properly for that entity (" +
GetType() +
")");
3751 Debug.LogError(
"EntityAI: DefaultHitPositionComponent not set for that entity (" +
GetType() +
")");
3757 Debug.LogError(
"EntityAI: SuitableFinisherHitComponents not set for that entity (" +
GetType() +
")");
3763 Debug.LogError(
"EntityAI: DefaultHitPosition not set for that entity (" +
GetType() +
")");
3803 return GetTemperatureMin() < GetTemperatureMax();
3825 float currentTime =
GetGame().GetTickTime();
3826 if (m_LastUpdatedTime == 0)
3827 m_LastUpdatedTime = currentTime;
3829 m_ElapsedSinceLastUpdate = currentTime - m_LastUpdatedTime;
3830 m_LastUpdatedTime = currentTime;
3838 if (
g_Game.IsWorldWetTempUpdateEnabled())
3842 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
3843 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
3845 float heatPermCoef = 1.0;
3849 heatPermCoef *= ent.GetHeatPermeabilityCoef();
3850 ent = ent.GetHierarchyParent();
3867 ConfigGetTextArray(
"Attachments", slots);
3870 ConfigGetTextArray(
"magazines", mags);
3884 int consumable_count;
3886 for (
int i = 0; i < all_paths.Count(); i++)
3888 config_path = all_paths.Get(i);
3889 int children_count =
GetGame().ConfigGetChildrenCount(config_path);
3891 for (
int x = 0;
x < children_count;
x++)
3893 GetGame().ConfigGetChildName(config_path,
x, child_name);
3894 path = config_path +
" " + child_name;
3895 scope =
GetGame().ConfigGetInt( config_path +
" " + child_name +
" scope" );
3896 bool should_check = 1;
3897 if ( config_path ==
"CfgVehicles" && scope == 0)
3905 GetGame().ConfigGetText( config_path +
" " + child_name +
" inventorySlot",inv_slot );
3906 for (
int z = 0; z < slots.Count(); z++)
3908 if (slots.Get(z) == inv_slot)
3910 this.GetInventory().CreateInInventory( child_name );
3942 int invulnerability;
3943 switch (servercfg_param)
3945 case "disableContainerDamage":
3949 case "disableBaseDamage":
3954 if (invulnerability > 0)
3956 SetAllowDamage(
false);
3974 attachmentsArray.Copy(attachments);
3977 for (
int i = 0; i < GetInventory().GetAttachmentSlotsCount(); i++)
3979 attachmentsArray.Insert(GetInventory().GetAttachmentSlotId(i));
3985 foreach(
int slot : attachmentsArray )
3988 item = parent.GetInventory().FindAttachment(slot);
3994 if( item.GetInventory().AttachmentCount() > 0 )
3996 for(i = 0; i < item.GetInventory().GetAttachmentSlotsCount(); i++)
3998 childrenAtt.Insert(item.GetInventory().GetAttachmentSlotId(i));
4001 SetInvisibleRecursive(invisible,item,childrenAtt);
4004 item.SetInvisible(invisible);
4005 item.OnInvisibleSet(invisible);
4036 if (!m_TransportHitRegistered)
4038 m_TransportHitRegistered =
true;
4046 if (
Car.CastTo(car, transport))
4048 if (car.GetSpeedometerAbsolute() > 2 )
4050 damage = m_TransportHitVelocity.Length();
4051 ProcessDirectDamage(DT_CUSTOM, transport,
"",
"TransportHit",
"0 0 0", damage);
4055 m_TransportHitRegistered =
false;
4059 if (IsDamageDestroyed() && car.GetSpeedometerAbsolute() > 3)
4061 impulse = 40 * m_TransportHitVelocity;
4062 impulse[1] = 40 * 1.5;
4066 else if (Boat.CastTo(boat, transport))
4068 Human player = Human.Cast(
this);
4069 if (player && player.PhysicsGetLinkedEntity() == boat)
4071 m_TransportHitRegistered =
false;
4075 if (m_TransportHitVelocity.Normalize() > 5)
4077 damage = m_TransportHitVelocity.Length() * 0.5;
4078 ProcessDirectDamage(DT_CUSTOM, transport,
"",
"TransportHit",
"0 0 0", damage);
4081 m_TransportHitRegistered =
false;
4086 if (m_TransportHitVelocity.Length() > 0.1)
4088 damage = m_TransportHitVelocity.Length();
4089 ProcessDirectDamage(DT_CUSTOM, transport,
"",
"TransportHit",
"0 0 0", damage);
4093 m_TransportHitRegistered =
false;
4097 if (IsDamageDestroyed() && m_TransportHitVelocity.Length() > 0.3)
4099 impulse = 40 * m_TransportHitVelocity;
4100 impulse[1] = 40 * 1.5;
4121 return GetUniversalTemperatureSource() != null && GetUniversalTemperatureSource().IsActive();
4126 return m_UniversalTemperatureSource;
4131 m_UniversalTemperatureSource = uts;
4166 private void InitAttachmentExclusionValues()
4169 m_AttachmentExclusionMaskGlobal =
new set<int>;
4170 m_AttachmentExclusionMaskChildren =
new set<int>();
4172 int count = GetInventory().GetSlotIdCount();
4177 InitInherentSlotExclusionMap();
4178 InitGlobalExclusionValues();
4179 InitLegacyConfigExclusionValues();
4183 private void InitInherentSlotExclusionMap()
4185 int count = GetInventory().GetSlotIdCount();
4190 for (
int i = 0; i < count; i++)
4192 slotId = GetInventory().GetSlotId(i);
4193 SetAttachmentExclusionMaskSlot(slotId,GetAttachmentExclusionInitSlotValue(slotId));
4200 set<int> dflt =
new set<int>;
4207 bool performLegacyInit = InitLegacyExclusionCheck();
4210 InitLegacySlotExclusionValuesImplicit();
4212 if (performLegacyInit)
4213 InitLegacySlotExclusionValuesDerived();
4220 if (m_AttachmentExclusionMaskGlobal.Count() > 0)
4224 int count = m_AttachmentExclusionSlotMap.Count();
4227 for (
int i = 0; i < count; i++)
4229 int countSet = m_AttachmentExclusionSlotMap.GetElement(i).Count();
4248 int slotCount = GetInventory().GetSlotIdCount();
4249 for (
int i = 0; i < slotCount; i++)
4251 slotId = GetInventory().GetSlotId(i);
4258 tmp.Copy(GetAttachmentExclusionInitSlotValue(slotId));
4259 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_MASK);
4260 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_HEADSTRAP);
4261 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_EYEWEWEAR);
4262 SetAttachmentExclusionMaskSlot(slotId,tmp);
4269 tmp.Copy(GetAttachmentExclusionInitSlotValue(slotId));
4270 tmp.Insert(EAttExclusions.LEGACY_MASK_HEADGEAR);
4271 tmp.Insert(EAttExclusions.LEGACY_MASK_HEADSTRAP);
4272 tmp.Insert(EAttExclusions.LEGACY_MASK_EYEWEWEAR);
4273 SetAttachmentExclusionMaskSlot(slotId,tmp);
4280 tmp.Copy(GetAttachmentExclusionInitSlotValue(slotId));
4281 if (ConfigGetBool(
"isStrap"))
4283 tmp.Insert(EAttExclusions.LEGACY_HEADSTRAP_HEADGEAR);
4284 tmp.Insert(EAttExclusions.LEGACY_HEADSTRAP_MASK);
4288 tmp.Insert(EAttExclusions.LEGACY_EYEWEAR_HEADGEAR);
4289 tmp.Insert(EAttExclusions.LEGACY_EYEWEAR_MASK);
4291 SetAttachmentExclusionMaskSlot(slotId,tmp);
4301 int slotCount = GetInventory().GetSlotIdCount();
4302 for (
int i = 0; i < slotCount; i++)
4304 slotId = GetInventory().GetSlotId(i);
4311 tmp.Copy(GetAttachmentExclusionMaskSlot(slotId));
4312 if (ConfigGetBool(
"noNVStrap"))
4314 tmp.Insert(EAttExclusions.LEGACY_HEADSTRAP_HEADGEAR);
4316 if (ConfigGetBool(
"noMask"))
4318 tmp.Insert(EAttExclusions.LEGACY_MASK_HEADGEAR);
4320 if (ConfigGetBool(
"noEyewear"))
4322 tmp.Insert(EAttExclusions.LEGACY_EYEWEAR_HEADGEAR);
4324 SetAttachmentExclusionMaskSlot(slotId,tmp);
4331 tmp.Copy(GetAttachmentExclusionMaskSlot(slotId));
4332 if (ConfigGetBool(
"noNVStrap"))
4334 tmp.Insert(EAttExclusions.LEGACY_HEADSTRAP_MASK);
4336 if (ConfigGetBool(
"noHelmet"))
4338 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_MASK);
4340 if (ConfigGetBool(
"noEyewear"))
4342 tmp.Insert(EAttExclusions.LEGACY_EYEWEAR_MASK);
4344 SetAttachmentExclusionMaskSlot(slotId,tmp);
4351 tmp.Copy(GetAttachmentExclusionMaskSlot(slotId));
4352 if (ConfigGetBool(
"isStrap"))
4354 if (ConfigGetBool(
"noHelmet"))
4356 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_HEADSTRAP);
4358 if (ConfigGetBool(
"noMask"))
4360 tmp.Insert(EAttExclusions.LEGACY_MASK_HEADSTRAP);
4365 if (ConfigGetBool(
"noHelmet"))
4367 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_EYEWEWEAR);
4369 if (ConfigGetBool(
"noMask"))
4371 tmp.Insert(EAttExclusions.LEGACY_MASK_EYEWEWEAR);
4374 SetAttachmentExclusionMaskSlot(slotId,tmp);
4387 if (m_AttachmentExclusionMaskGlobal.Find(value) == -1)
4388 m_AttachmentExclusionMaskGlobal.Insert(value);
4394 int idx = m_AttachmentExclusionMaskGlobal.Find(value);
4396 m_AttachmentExclusionMaskGlobal.Remove(idx);
4401 m_AttachmentExclusionMaskGlobal.Clear();
4402 m_AttachmentExclusionMaskGlobal.Copy(values);
4408 if (m_AttachmentExclusionSlotMap)
4410 m_AttachmentExclusionSlotMap.Set(slotId,values);
4413 ErrorEx(
"m_AttachmentExclusionSlotMap not available! Fill the 'inventorySlot[]' in the " +
this +
" config file.");
4416 private void PropagateExclusionValueRecursive(set<int> values,
int slotId)
4418 if (values && values.Count() != 0)
4422 GetInventory().GetCurrentInventoryLocation(lcn);
4423 if (CheckExclusionAccessPropagation(lcn.GetSlot(), slotId, values, passThis))
4425 m_AttachmentExclusionMaskChildren.InsertSet(passThis);
4426 EntityAI parent = GetHierarchyParent();
4428 parent.PropagateExclusionValueRecursive(passThis,lcn.GetSlot());
4433 private void ClearExclusionValueRecursive(set<int> values,
int slotId)
4435 if (values && values.Count() != 0)
4439 GetInventory().GetCurrentInventoryLocation(lcn);
4440 if (CheckExclusionAccessPropagation(lcn.GetSlot(), slotId, values, passThis))
4442 int count = passThis.Count();
4443 for (
int i = 0; i < count; i++)
4445 m_AttachmentExclusionMaskChildren.RemoveItem(passThis[i]);
4447 EntityAI parent = GetHierarchyParent();
4449 parent.ClearExclusionValueRecursive(passThis,lcn.GetSlot());
4455 set<int> GetAttachmentExclusionMaskAll(
int slotId)
4457 set<int> values =
new set<int>();
4458 set<int> slotValues = GetAttachmentExclusionMaskSlot(slotId);
4460 values.InsertSet(slotValues);
4461 values.InsertSet(m_AttachmentExclusionMaskGlobal);
4462 values.InsertSet(m_AttachmentExclusionMaskChildren);
4468 set<int> GetAttachmentExclusionMaskSlot(
int slotId)
4470 return m_AttachmentExclusionSlotMap.Get(slotId);
4474 set<int> GetAttachmentExclusionMaskGlobal()
4476 return m_AttachmentExclusionMaskGlobal;
4480 set<int> GetAttachmentExclusionMaskChildren()
4482 return m_AttachmentExclusionMaskChildren;
4486 private bool HasInternalExclusionConflicts(
int targetSlot)
4488 set<int> targetSlotValues = GetAttachmentExclusionMaskSlot(targetSlot);
4489 if (targetSlotValues)
4491 set<int> additionalValues =
new set<int>();
4492 additionalValues.InsertSet(GetAttachmentExclusionMaskGlobal());
4493 additionalValues.InsertSet(GetAttachmentExclusionMaskChildren());
4495 if (additionalValues.Count() > 0)
4497 int countTarget = targetSlotValues.Count();
4498 for (
int i = 0; i < countTarget; i++)
4500 if (additionalValues.Find(targetSlotValues[i]) != -1)
4515 GetInventory().GetCurrentAttachmentSlotInfo(slotId,
slotName);
4517 set<int> currentSlotValuesAll = GetAttachmentExclusionMaskAll(slotId);
4518 int count = values.Count();
4519 for (
int i = 0; i < count; i++)
4521 if (currentSlotValuesAll.Find(values[i]) != -1)
4530 if (values && values.Count() != 0)
4533 GetInventory().GetCurrentInventoryLocation(lcn);
4534 EntityAI parent = GetHierarchyParent();
4536 if (CheckExclusionAccessCondition(lcn.GetSlot(),targetSlot, values, passThis))
4538 if (parent && parent !=
this)
4540 return parent.IsExclusionFlagPresentRecursive(passThis,lcn.GetSlot());
4543 return IsExclusionFlagPresent(passThis);
4555 if (occupiedException)
4557 adjustedValue = value;
4561 if (targetException)
4563 adjustedValue = null;
4567 AdjustExclusionAccessCondition(occupiedSlot,targetSlot,value,adjustedValue);
4568 return adjustedValue.Count() != 0;
4574 adjustedValue = value;
4583 if (targetException)
4585 adjustedValue = null;
4589 AdjustExclusionAccessPropagation(occupiedSlot,targetSlot,value,adjustedValue);
4590 return adjustedValue.Count() != 0;
4596 AdjustExclusionAccessCondition(occupiedSlot,testedSlot,value,adjustedValue);
4602 EntityAI currentAtt = GetInventory().FindAttachment(slotId);
4603 bool hasInternalConflict = attachment.HasInternalExclusionConflicts(slotId);
4608 diff = attachment.GetAttachmentExclusionMaskAll(slotId);
4609 diff.RemoveItems(currentAtt.GetAttachmentExclusionMaskAll(slotId));
4610 if (diff.Count() == 0)
4612 return !hasInternalConflict;
4616 return !hasInternalConflict && !IsExclusionFlagPresentRecursive(diff,slotId);
4619 else if (attachment.GetInventory().GetCurrentInventoryLocation(curLoc) && curLoc.GetType() ==
InventoryLocationType.ATTACHMENT)
4621 EntityAI rootOwner = attachment.GetHierarchyRoot();
4622 if (rootOwner && rootOwner == this.GetHierarchyRoot())
4624 diff = attachment.GetAttachmentExclusionMaskAll(slotId);
4625 diff.RemoveItems(attachment.GetAttachmentExclusionMaskAll(curLoc.GetSlot()));
4626 if (diff.Count() == 0)
4628 return !hasInternalConflict;
4632 return !hasInternalConflict && !IsExclusionFlagPresentRecursive(diff,slotId);
4636 return !hasInternalConflict && !IsExclusionFlagPresentRecursive(attachment.GetAttachmentExclusionMaskAll(slotId),slotId);
4657void SetDebugDeveloper_item(
Object entity)
4660 entity.SetDebugItem();
enum EWetnessLevel BUSH_SOFT
enum EWetnessLevel HIDE_HANDS_SLOT
Param4< int, int, string, int > TSelectableActionInfoWithColor
enum EWetnessLevel UPDATE
enum EWetnessLevel HIDE_VICINITY
enum EWetnessLevel DETACHING
enum EWetnessLevel BUSH_HARD
enum EWetnessLevel LeftFrontLimb
enum EWetnessLevel REMOVE
enum EWetnessLevel RECURSIVE_ADD
enum EWetnessLevel TREE_HARD
enum EWetnessLevel TREE_SOFT
Param3 TSelectableActionInfo
enum EWetnessLevel ALWAYS
icon visibility, meant to be used in a bitmask
enum EWetnessLevel HIDE_PLAYER_CONTAINER
enum EWetnessLevel RightFrontLimb
enum EWetnessLevel LeftBackLimb
enum EWetnessLevel ATTACHING
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
override bool IsDestructionBehaviour()
override bool IsSelfAdjustingTemperature()
override bool ReplaceOnDeath()
override string GetDeadItemName()
class Animal_CapraHircus extends AnimalBase GetDestructionBehaviour()
override bool IsRefresherSignalingViable()
override void OnDamageDestroyed(int oldLevel)
override bool KeepHealthOnReplace()
override void DeathUpdate()
const int ECE_OBJECT_SWAP
const int ECE_PLACE_ON_SURFACE
PlayerSpawnPreset slotName
void OnEntityKilled(Object killer, EntityAI target)
AnalyticsManagerServer GetAnalyticsServer()
proto native EntityAI GetEntityByPersitentID(int b1, int b2, int b3, int b4)
represents base for cargo storage for entities
void SwitchOn()
Energy manager: Switches ON the device so it starts doing its work if it has enough energy.
bool GetPreviousSwitchState()
int GetEnergySourceNetworkIDLow()
bool IsWorking()
Energy manager: Returns true if this device is working right now.
void SetPassiveState(bool state=true)
Energy manager: Changes the status of this device. When it's passive (true), the main timer and OnWor...
int GetEnergySourceStorageIDb4()
void UnplugThis()
Energy manager: Unplugs this device from its power source.
void HandleMoveInsideCargo(EntityAI container)
float GetEnergy()
Energy manager: Returns the amount of stored energy this device has.
bool IsPlugged()
Energy manager: Returns true if this device is plugged into some other device (even if they are OFF o...
EntityAI GetEnergySource()
Energy manager: Returns the energy source this device is plugged into.
void OnAttachmentRemoved(EntityAI elec_device)
int GetEnergySourceNetworkIDHigh()
bool IsPassive()
Energy manager: Returns true if this device is set to be passive. False if otherwise.
void StoreEnergySourceIDs(int b1, int b2, int b3, int b4)
int GetEnergySourceStorageIDb2()
void OnAttachmentAdded(EntityAI elec_device)
void SetEnergy(float new_energy)
Energy manager: Sets stored energy for this device. It ignores the min/max limit!
bool GetRestorePlugState()
void RestorePlugState(bool state)
void SwitchOff()
Energy manager: Switches OFF the device.
int GetEnergySourceStorageIDb1()
bool PlugThisInto(EntityAI energy_source, int socket_id=-1)
Energy manager: Attempts to plug this device into the energy_source. Returns true if the action was s...
bool IsSwitchedOn()
Energy manager: Returns state of the switch. Whenever the device is working or not does not matter....
int GetEnergySourceStorageIDb3()
Wrapper class for managing sound through SEffectManager.
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
override int GetHideIconMask()
bool PredictiveDropEntity(notnull EntityAI item)
bool CanLoadAttachment(EntityAI attachment)
void LogError(string msg, string fnc_name="n/a")
LogError.
void OnSwitchOff()
Energy manager event: Called when the device is switched OFF.
void InitLegacySlotExclusionValuesImplicit()
adding base one-directional relations between headgear, masks, eyewear, and headstraps (exception)
bool PredictiveTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
float GetWetWeightModifier()
void SetStoreLoadedQuantity(float value)
void OnEnergyConsumed()
Energy manager event: Called when energy was consumed on this device. ALWAYS CALL super....
proto native EntityAI GetHierarchyParent()
Returns direct parent of current entity.
void TransferVariablesFloat(array< float > float_vars)
proto native Man GetHierarchyRootPlayer()
Returns root of current hierarchy cast to Man.
EntityAI GetAttachmentByType(typename type)
Get attached entity by type.
bool IsEmpty()
is this container empty or not, checks both cargo and attachments
vector GetUniversalTemperatureSourcePosition()
void InterpolateTempData(TemperatureDataInterpolated data)
void SoundSoftBushFallingPlay()
bool ServerTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
bool CanCombineAttachment(notnull EntityAI e, int slot, bool stack_max_limit=false)
void HideSelection(string selection_name)
Hides selection of the given name. Must be configed in config.cpp and models.cfg.
bool CanDetachAttachment(EntityAI parent)
calls this->CanDetachAttachment(parent)
bool CanAssignToQuickbar()
bool CanReceiveAttachment(EntityAI attachment, int slotId)
calls this->CanReceiveAttachment(attachment)
float GetTemperatureFreezeTime()
bool CanBeTargetedByAI(EntityAI ai)
int GetTurnableValveIndex(int pComponentIndex)
bool UseConfigInitTemperature()
bool CanBePlaced(Man player, vector position)
void EEDelete(EntityAI parent)
Called right before object deleting.
proto native float GetLifetimeMax()
Get max economy lifetime per instance - default is from DB (seconds)
bool PredictiveTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
ArrowManagerBase GetArrowManager()
float GetTemperatureInit()
void GetColor(out int r, out int g, out int b, out int a)
float m_VarTemperatureFreezeTime
void ProcessInvulnerabilityCheck(string servercfg_param)
bool CanDisplayAttachmentSlot(string slot_name)
void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void OnOwnSocketReleased(EntityAI device)
Energy manager event: When something is UNPLUGGED from this device.
void SetColor(int r, int g, int b, int a)
bool LocalTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
ref TemperatureAccessComponent m_TAC
float GetItemOverheatProgress()
float GetWeightSpecialized(bool forceRecalc=false)
returns weight of the entity in a way that's specific to the entity type and is internal to the weigh...
void SoundHardBushFallingPlay()
bool ServerTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
float ConvertNonlethalDamage(float damage)
DEPRECATED - for legacy purposes.
void EEInventoryIn(Man newParentMan, EntityAI diz, EntityAI newParent)
string GetAttachmentSoundType()
returns sound type of attachment (used for clothing and weapons on DayZPlayerImplement,...
float GetTemperatureFreezeThreshold()
bool PredictiveTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
proto native bool IsPilotLight()
void OnChildItemRemoved(InventoryItem item)
EntityAI SpawnEntityOnGround(string object_name, vector mat[4])
void CacheSkinningBloodInfectionChance(eAgents type)
void SwitchItemSelectionTexture(EntityAI item, string slot_name)
void EEParentedFrom(EntityAI parent)
Called from 'IEntity.RemoveChild' or 'IEntity.AddChild' when hierarchy changes.
bool GetInventoryHandAnimation(notnull InventoryLocation loc, out int value)
ScriptInvoker GetOnItemRemovedFromCargo()
void AfterStoreLoad()
Called when entity is being loaded from DB or Storage (after all children loaded)
void SetFrozen(bool frozen)
void RegisterTransportHit(Transport transport)
bool OnStoreLoad(ParamsReadContext ctx, int version)
Called when data is loaded from persistence (on server side).
float GetItemOverheatThreshold()
if undefined, max temperature used as default
void SetPersistentPairID(int id)
void OnIsUnplugged(EntityAI last_energy_source)
Energy manager event: Called when this device is UNPLUGGED from the energy source.
array< EntityAI > GetAttachmentsWithAttachments()
bool HasAnyCargo()
is this container empty or not, checks only cargo
ScriptInvoker GetOnSetLock()
void SetFreezeThawProgress(float val)
0->1 when freezing, 1->0 when thawing
bool CanSwapEntities(EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
void OnBinLoadItemsDropped()
Called when an item fails to get loaded into the inventory of an entity and gets dropped.
void OnDebugSpawnEx(DebugSpawnParams params)
bool CanLoadItemIntoCargo(EntityAI item)
calls this->CanLoadItemIntoCargo(item), is called on server start when loading in the storage
ref ScriptInvoker m_OnAttachmentSetLock
EntityAI SpawnEntityOnGroundPos(string object_name, vector pos)
override TStringArray GetHiddenSelectionsMaterials()
Returns the hiddenSelectionsMaterials array from the object's config.
override TStringArray GetHiddenSelections()
Returns the hiddenSelectionsTextures array from the object's config.
float GetHeatPermeabilityCoef()
Returns temperature change speed multiplier for this item and all its children (multiplicative intera...
bool IsIgnoredByConstruction()
float m_VarTemperatureThawThreshold
void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
float HeightCheckOverride()
used as script-side override of distance for specific height checks
proto native void PlaceOnSurfaceRotated(out vector trans[4], vector pos, float dx=0, float dz=0, float fAngle=0, bool align=false)
void SerializeNumericalVars(array< float > floats_out)
void SetAttachmentExclusionMaskSlot(int slotId, set< int > values)
sets values for specific slot
ScriptInvoker GetOnKilledInvoker()
EntityAI SpawnInInventoryOrGroundPos(string object_name, GameInventory inv, vector pos)
void SetStoreLoad(bool value)
ScriptInvoker GetOnAttachmentReleaseLock()
void SetBayonetAttached(bool pState, int slot_idx=-1)
bool CanReleaseFromHands(EntityAI handheld)
calls this->CanReleaseFromHands(handheld)
bool TranslateSlotFromSelection(string selection_name, out int slot_id)
override TStringArray GetHiddenSelectionsTextures()
Returns the hiddenSelectionsTextures array from the object's config.
bool OnAction(int action_id, Man player, ParamsReadContext ctx)
float GetInventoryAndCargoWeight(bool forceRecalc=false)
proto native void RegisterNetSyncVariableFloat(string variableName, float minValue=0, float maxValue=0, int precision=1)
registers float variable synchronized over network
bool CanSwapItemInCargo(EntityAI child_entity, EntityAI new_entity)
calls this->CanSwapItemInCargo(child_entity, new_entity)
override EntityAI ProcessMeleeItemDamage(int mode=0)
void RemoveItemVariable(int variable)
Removes variable from variable mask, making it appear as though the variable has never been changed f...
void IncreaseLifetimeUp()
Reset economy lifetime to default across entity hierarchy all the way to the topmost entity.
void OnIgnitedThisFailed(EntityAI fire_source)
Executed on Server when some item failed to ignite this one.
float GetWeightEx(bool forceRecalc=false)
returns overall weight of the entity, 'forceRecalc = true' is meant to be used only when debugging,...
void EEItemDetached(EntityAI item, string slot_name)
bool IsValveTurnable(int pValveIndex)
void OnDebugButtonPressServer(int button_index)
proto native GameInventory GetInventory()
bool GetCookingTargetTemperature(out float temperature)
specifically for cooking system, to get heat source target temperatures
float m_VarHeatPermeabilityCoef
void SetTemperatureMax()
presumably for debug purposes?
ref ScriptInvoker m_OnKilledInvoker
void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
bool LocalTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
bool LocalTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
void OnInitEnergy()
Energy manager event: Object's initialization. Energy Manager is fully initialized by this point.
bool IsTwoHandedBehaviour()
returns item behaviour of item (more in ItemBase)
void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
bool LocalTakeEntityToCargo(notnull EntityAI item)
string ChangeIntoOnAttach(string slot)
bool CanReleaseCargo(EntityAI cargo)
calls this->CanReleaseCargo(cargo)
void OnStoreSave(ParamsWriteContext ctx)
Engine calls this function to collect data from entity to store for persistence (on server side).
float GetStoreLoadedQuantity()
ref ScriptInvoker m_OnSetLock
ref ScriptInvoker m_OnItemDetached
void OnPlacementCancelled(Man player)
bool DoPlacingHeightCheck()
Do the roof check when placing this?
proto native void CreateAndInitInventory()
void OnWorkStart()
Energy manager event: Called only once when this device starts doing its work.
bool HasTurnableValveBehavior()
Turnable Valve behaviour.
bool PredictiveTakeEntityToCargoEx(notnull EntityAI item, int idx, int row, int col)
Put item into into cargo on specific cargo location.
bool PredictiveTakeEntityToCargo(notnull EntityAI item)
Put item into into cargo.
ScriptInvoker GetOnItemMovedInCargo()
void EECargoMove(EntityAI item)
bool IsUniversalTemperatureSource()
Universal Temperature Sources Helpers.
void SetTemperatureEx(TemperatureData data)
sets temperature, handles base overheating and freezing state progression logics
bool PredictiveTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
bool LocalTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
void SetFromProjectile(ProjectileStoppedInfo info)
proto native void RegisterNetSyncVariableBoolSignal(string variableName)
when bool variable is true, it's sent to clients and become false again
proto native owned string GetObjectMaterial(int index)
set< int > GetAttachmentExclusionInitSlotValue(int slotId)
override this to modify slot behavior for specific items, or just set 'm_AttachmentExclusionMaskGloba...
void OnWork(float consumed_energy)
Energy manager event: Called every device update if its supposed to do some work. The update can be e...
void CombineItemsClient(EntityAI entity2, bool use_stack_max=false)
void DebugDirectionDelete()
bool IsSkinned()
Skinning.
static EWetnessLevel GetWetLevelInternal(float wetness)
void OnIsPlugged(EntityAI source_device)
Energy manager event: Called when this device is plugged into some energy source.
proto native void RegisterNetSyncVariableBool(string variableName)
registers bool variable synchronized over network
ref ScriptInvoker m_OnViewIndexChanged
proto native void SetObjectMaterial(int index, string mat_name)
Change material in hiddenSelections.
Shape DebugDirectionDraw(float distance=1)
UTemperatureSource GetUniversalTemperatureSource()
void RefreshTemperatureAccess(TemperatureData data)
refreshes access without setting temperature, keeps the source locked in
bool DisassembleOnLastDetach()
float m_VarTemperatureInit
void OnItemOverheatStart()
override to implement desired overheat behavior on entity
bool ServerTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
void EEItemAttached(EntityAI item, string slot_name)
void EEOnAfterLoad()
Called when entity is part of "connected system" and being restored after load.
int GetButtstockAttachmentIdx()
bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
proto native void UpdateNetSyncVariableFloat(string variableName, float minValue=0, float maxValue=0, int precision=1)
void OnWasDetached(EntityAI parent, int slot_id)
proto native void SetSimpleHiddenSelectionState(int index, bool state)
Simple hidden selection state; 0 == hidden.
void ExecuteActionsConnectedToValve(int pValveIndex)
bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
string CanBePlacedFailMessage(Man player, vector position)
Method which returns message why object can't be placed at given position.
void OnIgnitedTarget(EntityAI target_item)
Executed on Server when this item ignites some target item.
bool CanBeSkinnedWith(EntityAI tool)
bool CanReceiveItemIntoHands(EntityAI item_to_hands)
calls this->CanReceiveItemIntoHands(item_to_hands)
void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
bool CanDisplayAttachmentSlot(int slot_id)
bool IgnoreOutOfReachCondition()
bool LocalTakeEntityAsAttachment(notnull EntityAI item)
bool IsOneHandedBehaviour()
returns item behaviour of item (more in ItemBase)
ref ScriptInvoker m_OnItemMovedInCargo
void EECargoIn(EntityAI item)
void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
int GetMeleeTargetType()
value is related to EMeleeTargetType
array< float > GetVariablesFloat()
void OnIgnitedTargetFailed(EntityAI target_item)
Executed on Server when this item failed to ignite target item.
bool IsSplitable()
returns just the configured 'canBeSplit' bool
bool HasButtstockAttached()
proto native void UpdateNetSyncVariableInt(string variableName, float minValue=0, float maxValue=0)
array< EntityAI > GetAttachmentsWithCargo()
void DeSerializeNumericalVars(array< float > floats)
int GetViewIndex()
Returns item preview index !!!! IF OVERRIDING with more dynamic events call GetOnViewIndexChanged() i...
void OnOwnSocketTaken(EntityAI device)
Energy manager event: When something is plugged into this device.
bool IsPreparedToDelete()
bool ServerTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
string GetDefaultHitPositionComponent()
returns default hit position component name for the Entity (overriden by type if needed - used mainly...
bool CanReleaseAttachment(EntityAI attachment)
calls this->CanReleaseAttachment(attachment)
bool LocalTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
override bool IsHologram()
void AdjustExclusionAccessPropagation(int occupiedSlot, int testedSlot, set< int > value, inout set< int > adjustedValue)
if we want to filter propagation specifically; DO NOT override unless you know what you are doing.
void GetDebugButtonNames(out string button1, out string button2, out string button3, out string button4)
void EEKilled(Object killer)
called on server when the entity is killed
EntityAI GetAttachmentByConfigTypeName(string type)
Get attached entity by config type name.
float GetTemperatureThawTime()
bool IsTargetIgnitionSuccessful(EntityAI item_target)
Final evaluation just before the target item is actually ignited. Evaluated on Server.
proto native void IncreaseLifetime()
Reset economy lifetime to default (seconds)
bool KeepHealthOnReplace()
bool CanAssignAttachmentsToQuickbar()
override void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
void InsertAgent(int agent, float count=1)
ref ScriptInvoker m_OnItemAddedIntoCargo
void AddTemperature(float value)
void OnRemovedFromCargo(EntityAI container)
Called when this item exits cargo of some container.
void OnFreezeStateChangeServer()
proto native float GetLifetime()
Get remaining economy lifetime (seconds)
proto native owned string GetObjectTexture(int index)
bool IsHeavyBehaviour()
returns item behaviour of item (more in ItemBase)
float GetSkinningBloodInfectionChance(eAgents type)
void OnIgnitedThis(EntityAI fire_source)
Executed on Server when some item ignited this one.
float m_VarTemperatureMax
void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
void SetVariableMask(int variable)
void OnSwitchOn()
Energy manager event: Called when the device is switched on.
bool CanDropEntity(notnull EntityAI item)
Returns if item can be dropped out from this entity.
float GetTemperatureMin()
void SetItemOverheatProgress(float val, float deltaTime=0)
bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
Reads from storage CTX.
bool PredictiveTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
ScriptInvoker GetOnItemAttached()
void OnDamageDestroyed(int oldLevel)
Called when the health gets to the min value, 'oldLevel' is previous health level,...
float m_ElapsedSinceLastUpdate
void OnWorkStop()
Energy manager event: Called when the device stops working (was switched OFF or ran out of energy)
bool CanIgniteItem(EntityAI ignite_target=NULL)
Override this method and check if the given item can be ignited right now by this one....
ScriptInvoker GetOnItemAddedIntoCargo()
ref ScriptInvoker m_OnItemAttached
RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
Remotely controlled devices helpers.
bool ServerTakeEntityToCargo(notnull EntityAI item)
ref ScriptInvoker m_OnItemFlipped
bool CanSaveItemInHands(EntityAI item_in_hands)
UTemperatureSource m_UniversalTemperatureSource
bool CanBeIgnitedBy(EntityAI igniter=NULL)
Override this method so it checks whenever this item can be ignited right now or not....
override void EOnFrame(IEntity other, float timeSlice)
ScriptInvoker GetOnHitByInvoker()
bool ServerDropEntity(notnull EntityAI item)
proto native void DestroyInventory()
bool LocalTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
void SetViewIndex(int index)
Sets item preview index.
void ShowSelection(string selection_name)
Shows selection of the given name. Must be configed in config.hpp and models.cfg.
void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
array< string > GetSuitableFinisherHitComponents()
void OnCEUpdate()
Central economy calls this function whenever going over all the entities.
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
void HandleFreezingProgression(float deltaHeat, TemperatureData data)
proto native void SetLifetimeMax(float fLifeTime)
Set (override) max economy lifetime per entity instance (seconds)
void OnHologramBeingPlaced(Man player)
DamageZoneMap GetEntityDamageZoneMap()
bool ServerTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
void SetTemperature(float value, bool allow_client=false)
not really deprecated, but missing context info from TemperatureData. Default values used instead.
void OnEnergyAdded()
Energy manager event: Called when energy was added on this device. ALWAYS CALL super....
ref ScriptInvoker m_OnHitByInvoker
void OnItemOverheat(float deltaTime)
string GetInvulnerabilityTypeString()
bool PredictiveTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
bool CheckAttachmentReceiveExclusion(EntityAI attachment, int slotId)
checks specifically for att. exclusion conflicts before att. receive
proto native CEItemProfile GetEconomyProfile()
Get economy item profile (if assigned, otherwise null)
bool CheckExclusionAccessCondition(int occupiedSlot, int targetSlot, set< int > value, inout set< int > adjustedValue)
void DebugDirectionSetColor(int color)
bool LocalTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
proto native bool IsSimpleHiddenSelectionVisible(int index)
void SaveVariables(ParamsWriteContext ctx)
void SetCleanness(int value, bool allow_client=false)
bool LocalTakeEntityToCargoEx(notnull EntityAI item, int idx, int row, int col)
bool CanHaveTemperature()
returns true used on selected items that have a temperature effect and can processes temperature chan...
bool ServerTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
void UpdateWeight(WeightUpdateType updateType=WeightUpdateType.FULL, float weightAdjustment=0)
float m_VarTemperatureThawTime
float ConvertNonlethalDamage(float damage, DamageType damageType)
proto native EntityAI GetHierarchyRoot()
Returns root of current hierarchy (for example: if this entity is in Backpack on gnd,...
void SwitchItemSelectionTextureEx(EItemManipulationContext context, Param par=null)
float HeightStartCheckOverride()
used as script-side override of start pos for specific height checks
bool HasFlammableMaterial()
Override this method to return TRUE when this item has or can provide fire. Evaluated on server and c...
bool IsExclusionFlagPresentRecursive(set< int > values, int targetSlot)
Gets flag from what is effectively an owner.
ComponentBodyStaging GetCompBS()
Use this to access Body Staging component on dead character. Returns NULL if the given object lacks s...
HiddenSelectionsData GetHiddenSelectionsData()
void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void DebugBBoxSetColor(int color)
void AdjustExclusionAccessCondition(int occupiedSlot, int testedSlot, set< int > value, inout set< int > adjustedValue)
if we want to filter
string GetHitComponentForAI()
Returns hit component for the Entity (overriden for each Type - PlayerBase, DayZInfected,...
void LogWarning(string msg, string fnc_name="n/a")
LogWarning.
ScriptInvoker GetOnViewIndexChanged()
void SoundHardTreeFallingPlay()
void AttemptDestructionBehaviour(int oldLevel, int newLevel, string zone)
void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
proto native void RegisterNetSyncVariableInt(string variableName, int minValue=0, int maxValue=0)
registers int variable synchronized over network
void SetUniversalTemperatureSource(UTemperatureSource uts)
float GetConfigWeightModified()
bool CanItemOverheat()
Overheat time CAN be 0, GameConstants.TEMPERATURE_TIME_OVERHEAT_MIN is ignored if so.
int GetBayonetAttachmentIdx()
ComponentEnergyManager GetCompEM()
void RemoveAllAgentsExcept(int agent_to_keep)
void SetTakeable(bool pState)
bool PredictiveTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
Put item anywhere into this entity (as attachment or into cargo, recursively)
proto native void SetObjectTexture(int index, string texture_name)
Change texture in hiddenSelections.
bool ServerTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
bool CanDisplayAnyAttachmentSlot()
void SetButtstockAttached(bool pState, int slot_idx=-1)
int GetTargetQuantityMax(int attSlotID=-1)
bool CanPutIntoHands(EntityAI parent)
calls this->CanPutIntoHands(parent)
bool IsSlotReserved(int slotID)
float m_VarTemperatureOverheatTime
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
bool IsSelfAdjustingTemperature()
override void Delete()
Delete this object in next frame.
bool CanDisplayWeight()
'displayWeight' in item config
proto void GetPersistentID(out int b1, out int b2, out int b3, out int b4)
void SoundSoftTreeFallingPlay()
bool InitLegacyExclusionCheck()
bool IsVariableSet(int variable)
'true' if this variable has ever been changed from default
float GetSingleInventoryItemWeightEx()
bool CanReceiveItemIntoCargo(EntityAI item)
calls this->CanReceiveItemIntoCargo(item)
proto native void SwitchLight(bool isOn)
bool LoadVariables(ParamsReadContext ctx, int version=-1)
EWetnessLevel GetWetLevel()
bool HasEnergyManager()
If this item has class EnergyManager in its config then it returns true. Otherwise returns false.
void ShowAllSelections()
Sets all animation values to 0, making them VISIBLE if they are configured in models....
bool CanSwitchDuringAttach(EntityAI parent)
bool CanBeSplit()
returns current splitability
ScriptInvoker GetOnItemFlipped()
void HideAllSelections()
Sets all animation values to 1, making them INVISIBLE if they are configured in models....
void OnItemOverheatEnd()
note, that the deltaTime could be reverse-calculated and not totally accurate
void InitGlobalExclusionValues()
override to init part of the mask, independent of slot-specific behavior
float GetFreezeThawProgress()
on server only
void SetPrepareToDelete()
override bool IsEntityAI()
void SetWet(float value, bool allow_client=false)
bool AreChildrenAccessible()
bool LocalDropEntity(notnull EntityAI item)
float GetQuantityNormalized()
void SetLiquidType(int value, bool allow_client=false)
bool CanRemoveFromHands(EntityAI parent)
calls this->CanRemoveFromHands(parent)
void OnChildItemReceived(InventoryItem item)
bool IsInventoryVisible()
void OnPlacementStarted(Man player)
bool PlacementCanBeRotated()
Should return false if you want to disable hologram rotation.
float GetItemOverheatTime()
any configured value >= 0 will simulate overheating
ScriptInvoker GetOnAttachmentSetLock()
bool CanDisplayAttachmentCategory(string category_name)
void EEInventoryOut(Man oldParentMan, EntityAI diz, EntityAI newParent)
proto native void SetAITargetCallbacks(AbstractAITargetCallbacks callbacks)
void OnFreezeStateChangeClient()
void OnWasAttached(EntityAI parent, int slot_id)
ref ScriptInvoker m_OnItemRemovedFromCargo
void SetRoofAbove(bool state)
float m_VarTemperatureMin
void EECargoOut(EntityAI item)
void InitLegacySlotExclusionValuesDerived()
void InitLegacyConfigExclusionValues()
proto native void SetLifetime(float fLifeTime)
Set (override) remaining economy lifetime (seconds)
int GetHierarchyLevel(int lvl=0)
EntityAI FindAttachmentBySlotName(string slot_name)
bool CanPutInCargo(EntityAI parent)
calls this->CanPutInCargo(parent)
bool IsFreezeThawProgressFinished()
on server only
void SetQuantityToMinimum()
bool IsThisIgnitionSuccessful(EntityAI item_source=NULL)
Final evaluation just before this item is actually ignited from fire source. Evaluated on Server.
bool PredictiveTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
Returns if item can be added as attachment on specific slot. Note that slot index IS NOT slot ID!...
void RemoveAgent(int agent_id)
bool IsExclusionFlagPresent(set< int > values)
checks 'this' if the incoming flag is present for the current state (slot behavior and others)
void SetAttachmentExclusionMaskGlobal(set< int > values)
void SetInvisibleRecursive(bool invisible, EntityAI parent=null, array< int > attachments=null)
bool LocalTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
void Log(string msg, string fnc_name="n/a")
Log.
proto native void SetSynchDirty()
Sets object synchronization dirty flag, which signalize that object wants to be synchronized (take ef...
void EEInit()
Called upon object creation.
float m_VarTemperatureFreezeThreshold
vector GetDefaultHitPosition()
bool PredictiveTakeEntityAsAttachment(notnull EntityAI item)
Put item into as attachment.
int GetHiddenSelectionIndex(string selection)
Returns index of the string found in cfg array 'hiddenSelections'. If it's not found then it returns ...
float m_FreezeThawProgress
bool HasBayonetAttached()
void SetTemperatureDirect(float value, bool allow_client=false)
float GetLiquidThroughputCoef()
Returns liquid throughput coeficient.
void WriteVarsToCTX(ParamsWriteContext ctx)
Writes to storage CTX.
ref ScriptInvoker m_OnAttachmentReleaseLock
float GetTemperatureThawThreshold()
void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
ref ScriptInvoker m_OnReleaseLock
void EEParentedTo(EntityAI parent)
Called from 'IEntity.AddChild'.
map< int, string > GetEntityDamageDisplayNameMap()
void OnMovedInsideCargo(EntityAI container)
Called when this item enters cargo of some container.
void EEHitByRemote(int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos)
void ClearSingleExclusionValueGlobal(EAttExclusions value)
to help with item staging exclusions
void OnVariablesSynchronized()
Called on clients after receiving synchronization data from server.
void OnAttachmentRuined(EntityAI attachment)
Called when some attachment of this parent is ruined. Called on server and client side.
void OnDebugButtonPressClient(int button_index)
proto native void SetPilotLight(bool isOn)
void AddSingleExclusionValueGlobal(EAttExclusions value)
to help with item staging exclusions
bool CanRemoveFromCargo(EntityAI parent)
calls this->CanRemoveFromCargo(parent)
void CombineItemsEx(EntityAI entity2, bool use_stack_max=false)
proto native void RegisterNetSyncVariableObject(string variableName)
registers object variable synchronized over network, only synchronizes if network id is assigned....
void OnMovedWithinCargo(EntityAI container)
Called when this item moves within cargo of some container.
override bool CanBeActionTarget()
bool ServerTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
vector m_TransportHitVelocity
void PairRemote(notnull EntityAI trigger)
void OnWetChanged(float newVal, float oldVal)
string GetDefaultHitComponent()
returns default hit component for the Entity (overriden for each Type - PlayerBase,...
ref DamageZoneMap m_DamageZoneMap
bool IsIgnited()
Override this method and make it so it returns whenever this item is on fire right now or not....
bool IsServerCheck(bool allow_client)
bool CheckExclusionAccessPropagation(int occupiedSlot, int targetSlot, set< int > value, inout set< int > adjustedValue)
special propagation contition
ScriptInvoker GetOnReleaseLock()
void HandleItemOverheating(float deltaHeat, TemperatureData data)
float GetTemperatureMax()
bool ServerTakeEntityAsAttachment(notnull EntityAI item)
bool CanPutAsAttachment(EntityAI parent)
calls this->CanPutAsAttachment(parent)
string ChangeIntoOnDetach()
ScriptInvoker GetOnItemDetached()
int GetSlotsCountCorrect()
script counterpart to engine's class Inventory
EntityAI CreateInInventory(string type)
creates entity somewhere in inventory
inventory for plain man/human
provides access to slot configuration
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
The class that will be instanced (moddable)
void SetPersistentPairID(int id)
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.
ScriptInvoker Class provide list of callbacks usage:
Serialization general interface. Serializer API works with:
Native class for boats - handles physics simulation.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
override bool IsInitialized()
override void DeferredInit()
map< string, ref array< string > > DamageZoneMap
DamageType
exposed from C++ (do not change)
override bool IsPrepareToDelete()
override bool CanHaveTemperature()
proto native CGame GetGame()
const int COMP_TYPE_BODY_STAGING
const int COMP_TYPE_COUNT
const int COMP_TYPE_ENERGY_MANAGER
const int COMP_TYPE_ETITY_DEBUG
void Error(string err)
Messagebox with error message.
proto void DumpStack()
Prints current call stack (stack trace)
proto void Print(void var)
Prints content of variable to console/log.
bool IsPendingDeletion()
Get whether the Effect is queued up for being cleaned up.
const float MELEE_ITEM_DAMAGE
array< string > TStringArray
const int VARIABLE_TEMPERATURE
const float LIQUID_THROUGHPUT_DEFAULT
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.
proto native bool dBodyIsActive(notnull IEntity ent)
proto void dBodyApplyImpulse(notnull IEntity body, vector impulse)
Applies impuls on a rigidbody (origin)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
class Hatchback_02_Blue extends Hatchback_02 OnDebugSpawn
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
override void ProcessVariables()
float GetWeightSpecialized(bool forceRecalc=false)
override float GetTemperatureFreezeThreshold()
override float GetTemperatureFreezeTime()
override float GetTemperatureThawThreshold()
override EWetnessLevel GetWetLevel()
override float GetWetMax()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void WriteVarsToCTX(ParamsWriteContext ctx)
override float GetTemperatureThawTime()
override float GetSingleInventoryItemWeightEx()
override void DeSerializeNumericalVars(array< float > floats)
override float GetItemOverheatThreshold()
override void SerializeNumericalVars(array< float > floats_out)
override float GetWetMin()
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
override void OnWasDetached(EntityAI parent, int slot_id)
void TemperatureData(float val, ETemperatureAccessTypes accessType=ETemperatureAccessTypes.ACCESS_UNKNOWN, float time=-1, float timeCoef=1, float heatPermCoef=1)
override bool CanDisplayAttachmentSlot(int slot_id)