80 protected bool m_IsResultOfSplit
155 if (!
g_Game.IsDedicatedServer())
171 m_OldLocation = null;
178 if (ConfigIsExisting(
"headSelectionsToHide"))
185 if (ConfigIsExisting(
"hideSelectionsByinventorySlot"))
192 m_IsResultOfSplit =
false;
199 super.InitItemVariables();
206 m_Count = ConfigGetInt(
"count");
243 if (ConfigIsExisting(
"canBeSplit"))
250 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");
277 RegisterNetSyncVariableInt(
"m_SoundSyncSlotID",
int.
MIN,
int.
MAX);
283 if (ConfigIsExisting(
"temperaturePerQuantityWeight"))
297 if (!m_InputActionMap)
353 Debug.
ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
356 if (action_array.Find(action) != -1)
358 Debug.
Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
362 action_array.Insert(action);
369 ActionBase action = player.GetActionManager().GetAction(actionName);
375 action_array.RemoveItem(action);
395 actionMap.Insert(this.
Type(), overrideData);
412 string config_to_search =
"CfgVehicles";
413 string muzzle_owner_config;
418 config_to_search =
"CfgWeapons";
420 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
422 string config_OnFire_class = muzzle_owner_config +
"Particles " +
"OnFire ";
424 int config_OnFire_subclass_count =
g_Game.ConfigGetChildrenCount(config_OnFire_class);
426 if (config_OnFire_subclass_count > 0)
430 for (
int i = 0; i < config_OnFire_subclass_count; i++)
432 string particle_class =
"";
433 g_Game.ConfigGetChildName(config_OnFire_class, i, particle_class);
434 string config_OnFire_entry = config_OnFire_class + particle_class;
435 WeaponParticlesOnFire WPOF =
new WeaponParticlesOnFire(
this, config_OnFire_entry);
436 WPOF_array.Insert(WPOF);
446 config_to_search =
"CfgWeapons";
447 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
449 string config_OnBulletCasingEject_class = muzzle_owner_config +
"Particles " +
"OnBulletCasingEject ";
451 int config_OnBulletCasingEject_count =
g_Game.ConfigGetChildrenCount(config_OnBulletCasingEject_class);
453 if (config_OnBulletCasingEject_count > 0 && IsInherited(
Weapon))
457 for (i = 0; i < config_OnBulletCasingEject_count; i++)
459 string particle_class2 =
"";
460 g_Game.ConfigGetChildName(config_OnBulletCasingEject_class, i, particle_class2);
461 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
462 WeaponParticlesOnBulletCasingEject WPOBE =
new WeaponParticlesOnBulletCasingEject(
this, config_OnBulletCasingEject_entry);
463 WPOBE_array.Insert(WPOBE);
480 string config_to_search =
"CfgVehicles";
483 config_to_search =
"CfgWeapons";
485 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
486 string config_OnOverheating_class = muzzle_owner_config +
"Particles " +
"OnOverheating ";
488 if (
g_Game.ConfigIsExisting(config_OnOverheating_class))
496 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
506 int config_OnOverheating_subclass_count =
g_Game.ConfigGetChildrenCount(config_OnOverheating_class);
509 for (
int i = 0; i < config_OnOverheating_subclass_count; i++)
511 string particle_class =
"";
512 g_Game.ConfigGetChildName(config_OnOverheating_class, i, particle_class);
513 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
514 int entry_type =
g_Game.ConfigGetType(config_OnOverheating_entry);
516 if (entry_type == CT_CLASS)
518 WeaponParticlesOnOverheating WPOF =
new WeaponParticlesOnOverheating(
this, config_OnOverheating_entry);
519 WPOOH_array.Insert(WPOF);
546 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
556 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
559 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
599 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
605 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
612 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
644 for (
int i = count; i > 0; --i)
653 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
755 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(
this);
760 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
762 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
766 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
775 player.GetHumanInventory().ClearUserReservedLocation(
this);
792 return ItemBase.m_DebugActionsMask & mask;
802 ItemBase.m_DebugActionsMask |= mask;
807 ItemBase.m_DebugActionsMask &= ~mask;
825 if (GetEconomyProfile())
827 float q_max = GetEconomyProfile().GetQuantityMax();
830 float q_min = GetEconomyProfile().GetQuantityMin();
854 EntityAI parent = GetHierarchyParent();
859 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
860 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
867 EntityAI parent = GetHierarchyParent();
872 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
873 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
895 ctx.
Write(use_stack_max);
905 else if (!
g_Game.IsMultiplayer())
987 if (!is_being_placed)
1057 super.OnMovedInsideCargo(container);
1059 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(
this, {
Bolt_Base});
1064 super.EEItemLocationChanged(oldLoc, newLoc);
1069 if (newLoc.GetParent())
1070 newPlayer =
PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
1072 if (oldLoc.GetParent())
1073 oldPlayer =
PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
1077 int rIndex = oldPlayer.GetHumanInventory().FindUserReservedLocationIndex(
this);
1082 oldPlayer.GetHumanInventory().GetUserReservedLocation(rIndex, rIl);
1084 oldPlayer.GetHumanInventory().ClearUserReservedLocationAtIndex(rIndex);
1088 rIl.
GetParent().GetOnReleaseLock().Invoke(
this);
1101 newPlayer.ForceStandUpForHeavyItems(newLoc.GetItem());
1103 if (newPlayer == oldPlayer)
1105 if (oldLoc.GetParent() && newPlayer.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
1109 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc,
false,
false,
false,
true,
false,
false))
1111 newPlayer.GetHumanInventory().SetUserReservedLocation(
this,oldLoc);
1116 newPlayer.GetHumanInventory().SetUserReservedLocation(
this,oldLoc);
1120 if (newPlayer.GetHumanInventory().FindUserReservedLocationIndex(
this) >= 0)
1122 int type = oldLoc.GetType();
1125 oldLoc.GetParent().GetOnSetLock().Invoke(
this);
1129 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(
this, oldLoc.GetSlot());
1136 m_OldLocation.Copy(oldLoc);
1142 m_OldLocation.Reset();
1146 g_Game.GetAnalyticsClient().OnItemAttachedAtPlayer(
this,
"Hands");
1152 int resIndex = newPlayer.GetHumanInventory().FindCollidingUserReservedLocationIndex(
this, newLoc);
1156 newPlayer.GetHumanInventory().GetUserReservedLocation(resIndex, il);
1158 newPlayer.GetHumanInventory().ClearUserReservedLocationAtIndex(resIndex);
1162 il.
GetParent().GetOnReleaseLock().Invoke(it);
1179 m_OldLocation.Reset();
1185 PluginInventoryRepair.Cast(
GetPlugin(PluginInventoryRepair)).Remove(oldLoc.GetItem());
1190 PluginInventoryRepair.Cast(
GetPlugin(PluginInventoryRepair)).Add(oldLoc.GetItem());
1198 int liquidType = -1;
1200 if (impactSpeed > 0.0)
1214 if (GetCompEM() && GetCompEM().IsPlugged())
1217 GetCompEM().UnplugThis();
1236 super.OnItemLocationChanged(old_owner, new_owner);
1241 if (!relatedPlayer && playerNew)
1242 relatedPlayer = playerNew;
1244 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
1249 ActionBase currentAction = actionMgr.GetRunningAction();
1255 Man ownerPlayerOld = null;
1256 Man ownerPlayerNew = null;
1260 if (old_owner.
IsMan())
1262 ownerPlayerOld = Man.Cast(old_owner);
1266 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
1275 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
1277 GetCompEM().UnplugThis();
1284 if (new_owner.
IsMan())
1286 ownerPlayerNew = Man.Cast(new_owner);
1290 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
1294 if (ownerPlayerOld != ownerPlayerNew)
1300 for (
int i = 0; i < subItemsExit.Count(); i++)
1311 for (
int j = 0; j < subItemsEnter.Count(); j++)
1318 else if (ownerPlayerNew != null)
1321 if (
PlayerBase.CastTo(nplayer, ownerPlayerNew))
1325 for (
int k = 0; k < subItemsUpdate.Count(); k++)
1328 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
1334 old_owner.OnChildItemRemoved(
this);
1336 new_owner.OnChildItemReceived(
this);
1342 super.EEDelete(parent);
1348 if (player.IsAlive())
1350 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(
this);
1354 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
1356 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
1360 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
1364 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
1369 player.RemoveQuickBarEntityShortcut(
this);
1376 super.EEKilled(killer);
1385 if (Magazine.Cast(
this).GetAmmoCount() > 0)
1400 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(
this, {
Bolt_Base});
1402 super.OnWasAttached(parent, slot_id);
1413 super.OnWasDetached(parent, slot_id);
1428 ConfigGetTextArray(
"ChangeInventorySlot",inventory_slots);
1429 if (inventory_slots.Count() < 1)
1431 inventory_slots.Insert(ConfigGetString(
"ChangeInventorySlot"));
1432 attach_types.Insert(ConfigGetString(
"ChangeIntoOnAttach"));
1436 ConfigGetTextArray(
"ChangeIntoOnAttach",attach_types);
1439 idx = inventory_slots.Find(slot);
1443 return attach_types.Get(idx);
1454 this.ConfigGetTextArray(
"ChangeInventorySlot",inventory_slots);
1455 if (inventory_slots.Count() < 1)
1457 inventory_slots.Insert(this.ConfigGetString(
"ChangeInventorySlot"));
1458 detach_types.Insert(this.ConfigGetString(
"ChangeIntoOnDetach"));
1462 this.ConfigGetTextArray(
"ChangeIntoOnDetach",detach_types);
1463 if (detach_types.Count() < 1)
1464 detach_types.Insert(this.ConfigGetString(
"ChangeIntoOnDetach"));
1467 for (
int i = 0; i < inventory_slots.Count(); i++)
1469 slot = inventory_slots.Get(i);
1474 if (detach_types.Count() == 1)
1477 idx = inventory_slots.Find(slot);
1482 return detach_types.Get(idx);
1495 explode_timer.Run(delay,
this,
"DoAmmoExplosion");
1500 Magazine magazine = Magazine.Cast(
this);
1501 int pop_sounds_count = 6;
1502 string pop_sounds[ 6 ] = {
"ammopops_1",
"ammopops_2",
"ammopops_3",
"ammopops_4",
"ammopops_5",
"ammopops_6" };
1506 string sound_name = pop_sounds[ sound_idx ];
1507 g_Game.CreateSoundOnObject(
this, sound_name, 20,
false);
1510 magazine.ServerAddAmmoCount(-1);
1513 float min_temp_to_explode = 100;
1515 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
1524 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
1526 const int CHANCE_DAMAGE_CARGO = 4;
1527 const int CHANCE_DAMAGE_ATTACHMENT = 1;
1528 const int CHANCE_DAMAGE_NOTHING = 2;
1532 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
1536 if (GetInventory().GetCargo())
1538 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
1541 if (rnd < CHANCE_DAMAGE_CARGO)
1545 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
1552 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
1555 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
1565 CargoBase cargo = GetInventory().GetCargo();
1573 if (!item.IsExplosive())
1575 item.AddHealth(
"",
"",damage);
1587 if (attachment_count > 0)
1591 if (!attachment.IsExplosive())
1593 attachment.AddHealth(
"",
"",damage);
1608 return GetInventory().CanRemoveEntity();
1644 ctx.
Write(destination_entity);
1650 else if (!
g_Game.IsMultiplayer())
1658 float split_quantity_new;
1667 split_quantity_new = stack_max;
1673 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
1676 new_item.SetResultOfSplit(
true);
1677 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1679 new_item.
SetQuantity(split_quantity_new,
false,
true);
1683 else if (destination_entity && slot_id == -1)
1685 if (quantity > stack_max)
1686 split_quantity_new = stack_max;
1688 split_quantity_new = quantity;
1692 GameInventory destinationInventory = destination_entity.GetInventory();
1701 new_item.SetResultOfSplit(
true);
1702 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1704 new_item.
SetQuantity(split_quantity_new,
false,
true);
1717 if (split_quantity_new == 0)
1719 if (!
g_Game.IsMultiplayer())
1720 player.PhysicalPredictiveDropItem(
this);
1722 player.ServerDropEntity(
this);
1732 new_item.SetResultOfSplit(
true);
1733 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1736 new_item.PlaceOnSurface();
1745 float split_quantity_new;
1754 split_quantity_new = stack_max;
1760 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
1763 new_item.SetResultOfSplit(
true);
1764 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1766 new_item.
SetQuantity(split_quantity_new,
false,
true);
1770 else if (destination_entity && slot_id == -1)
1772 if (quantity > stack_max)
1773 split_quantity_new = stack_max;
1775 split_quantity_new = quantity;
1779 GameInventory destinationInventory = destination_entity.GetInventory();
1788 new_item.SetResultOfSplit(
true);
1789 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1791 new_item.
SetQuantity(split_quantity_new,
false,
true);
1810 new_item.SetResultOfSplit(
true);
1811 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1814 new_item.PlaceOnSurface();
1832 dst.WriteToContext(ctx);
1836 else if (!
g_Game.IsMultiplayer())
1853 ctx.
Write(destination_entity);
1861 else if (!
g_Game.IsMultiplayer())
1875 float split_quantity_new;
1879 int slot_id = dst.GetSlot();
1882 if (quantity > stack_max)
1883 split_quantity_new = stack_max;
1885 split_quantity_new = quantity;
1893 new_item.SetResultOfSplit(
true);
1894 MiscGameplayFunctions.TransferItemProperties(
this,new_item);
1896 new_item.
SetQuantity(split_quantity_new,
false,
true);
1909 float split_quantity_new;
1911 if (destination_entity)
1914 if (quantity > stackable)
1915 split_quantity_new = stackable;
1917 split_quantity_new = quantity;
1921 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
1924 new_item.SetResultOfSplit(
true);
1925 MiscGameplayFunctions.TransferItemProperties(
this,new_item);
1927 new_item.
SetQuantity(split_quantity_new,
false,
true);
1944 ItemBase destination_entity =
this;
1945 ctx.
Write(destination_entity);
1951 else if (!
g_Game.IsMultiplayer())
1960 float split_quantity_new;
1965 if (quantity > stackable)
1966 split_quantity_new = stackable;
1968 split_quantity_new = quantity;
1972 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
1973 new_item =
ItemBase.Cast(in_hands);
1976 new_item.SetResultOfSplit(
true);
1977 MiscGameplayFunctions.TransferItemProperties(
this,new_item);
1979 new_item.SetQuantity(split_quantity_new,
false,
true);
1988 float split_quantity_new =
Math.
Floor(quantity * 0.5);
1997 if (new_item.GetQuantityMax() < split_quantity_new)
1999 split_quantity_new = new_item.GetQuantityMax();
2002 new_item.SetResultOfSplit(
true);
2003 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
2013 new_item.
SetQuantity(split_quantity_new,
false,
true);
2021 float split_quantity_new =
Math.
Floor(quantity / 2);
2030 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(
this,
true);
2034 if (new_item.GetQuantityMax() < split_quantity_new)
2036 split_quantity_new = new_item.GetQuantityMax();
2043 else if (split_quantity_new > 1)
2046 new_item.
SetQuantity(split_quantity_new,
false,
true);
2058 parent.OnAttachmentQuantityChangedEx(
this, delta);
2068 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
2088 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
2095 EntityAI parent = GetHierarchyParent();
2096 if (parent && parent.IsFireplace())
2098 CargoBase cargo = GetInventory().GetCargo();
2116 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
2126 super.OnRightClick();
2134 EntityAI root = GetHierarchyRoot();
2135 Man playerOwner = GetHierarchyRootPlayer();
2139 if (!playerOwner && root && root ==
this)
2146 GetInventory().GetCurrentInventoryLocation(dst);
2159 if (
g_Game.GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
2181 else if (!
g_Game.IsMultiplayer())
2193 root.GetTransform(m4);
2194 dst.SetGround(
this, m4);
2198 GetInventory().GetCurrentInventoryLocation(dst);
2205 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
2216 Magazine mag = Magazine.Cast(
this);
2219 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
2222 if (stack_max_limit)
2224 Magazine other_mag = Magazine.Cast(other_item);
2227 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
2244 if (CastTo(player, GetHierarchyRootPlayer()))
2246 if (player.GetInventory().HasAttachment(
this))
2249 if (player.IsItemsToDelete())
2253 if (reservation_check && (GetInventory().HasInventoryReservation(
this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
2258 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
2271 return m_IsResultOfSplit;
2276 m_IsResultOfSplit = value;
2286 float other_item_quantity = other_item.GetQuantity();
2287 float this_free_space;
2293 if (other_item_quantity > this_free_space)
2295 return this_free_space;
2299 return other_item_quantity;
2313 if (!IsMagazine() && other_item)
2316 if (quantity_used != 0)
2318 float hp1 = GetHealth01(
"",
"");
2319 float hp2 = other_item.GetHealth01(
"",
"");
2320 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
2321 hpResult = hpResult / (
GetQuantity() + quantity_used);
2323 hpResult *= GetMaxHealth();
2325 SetHealth(
"",
"Health", hpResult);
2328 other_item.AddQuantity(-quantity_used);
2337 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
2338 GetHierarchyParent().IncreaseLifetimeUp();
2347 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
2348 if (moduleRecipesManager)
2350 EntityAI itemInHands = player.GetEntityInHands();
2351 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
2354 for (
int i = 0;i < recipesIds.Count(); i++)
2356 int key = recipesIds.Get(i);
2357 string recipeName = moduleRecipesManager.GetRecipeName(key);
2365 super.GetDebugActions(outputList);
2409 GetInventory().GetCurrentInventoryLocation(loc);
2412 if (Gizmo_IsSupported())
2425 super.OnAction(action_id, player, ctx);
2452 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
2454 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
2455 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
2457 if (
EActions.RECIPES_RANGE_START < 1000)
2459 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
2460 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
2464 else if (action_id ==
EActions.WATCH_PLAYER)
2466 PluginDeveloper.SetDeveloperItemClientEx(player);
2471 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
2473 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
2474 OnDebugButtonPressServer(
id + 1);
2477 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
2479 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
2483 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
2485 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
2489 else if (action_id ==
EActions.ADD_QUANTITY)
2493 Magazine mag = Magazine.Cast(
this);
2494 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
2503 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
2508 else if (action_id ==
EActions.REMOVE_QUANTITY)
2512 Magazine mag2 = Magazine.Cast(
this);
2513 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
2521 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
2526 else if (action_id ==
EActions.SET_QUANTITY_0)
2536 else if (action_id ==
EActions.SET_MAX_QUANTITY)
2542 m_EM.SetEnergy(m_EM.GetEnergyMax());
2546 else if (action_id ==
EActions.ADD_HEALTH)
2548 AddHealth(
"",
"",GetMaxHealth(
"",
"Health")/5);
2550 else if (action_id ==
EActions.REMOVE_HEALTH)
2552 AddHealth(
"",
"",-GetMaxHealth(
"",
"Health")/5);
2554 else if (action_id ==
EActions.DESTROY_HEALTH)
2556 SetHealth01(
"",
"",0);
2558 else if (action_id ==
EActions.WATCH_ITEM)
2563 SetDebugDeveloper_item(
this);
2567 else if (action_id ==
EActions.ADD_TEMPERATURE)
2573 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
2575 AddTemperature(-20);
2579 else if (action_id ==
EActions.FLIP_FROZEN)
2581 SetFrozen(!GetIsFrozen());
2585 else if (action_id ==
EActions.ADD_WETNESS)
2591 else if (action_id ==
EActions.REMOVE_WETNESS)
2597 else if (action_id ==
EActions.LIQUIDTYPE_UP)
2605 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
2611 else if (action_id ==
EActions.MAKE_SPECIAL)
2613 auto debugParams = DebugSpawnParams.WithPlayer(player);
2614 OnDebugSpawnEx(debugParams);
2656 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
2657 return g_Game.ConfigIsExisting(config_path);
2683 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
2684 return module_repairing.CanRepair(
this, item_repair_kit);
2690 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
2691 return module_repairing.Repair(player,
this, item_repair_kit, specialty_weight);
2736 player.MessageStatus(text);
2754 player.MessageAction(text);
2772 player.MessageFriendly(text);
2790 player.MessageImportant(text);
2803 string item_name = this.
GetType();
2805 g_Game.ConfigGetTextArray(
"cfgVehicles " + item_name +
" itemInfo", item_tag_array);
2807 int array_size = item_tag_array.Count();
2808 for (
int i = 0; i < array_size; i++)
2810 if (item_tag_array.Get(i) == tag)
2823 super.OnRPC(sender, rpc_type,ctx);
2829 case ERPCs.RPC_SOUND_LOCK_ATTACH:
2835 bool play = p.param1;
2836 string soundSet = p.param2;
2873 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
2874 return plugin.GetID(
name);
2879 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
2880 return plugin.GetName(
id);
2889 if (!ctx.
Read(varFlags))
2901 super.SerializeNumericalVars(floats_out);
2937 super.DeSerializeNumericalVars(floats);
2941 int mask =
Math.
Round(floats.Get(index));
2953 float quantity = floats.Get(index);
2961 float wet = floats.Get(index);
2968 int liquidtype =
Math.
Round(floats.Get(index));
2987 int cleanness =
Math.
Round(floats.Get(index));
2995 super.WriteVarsToCTX(ctx);
3031 if (!super.ReadVarsFromCTX(ctx,version))
3039 if (!ctx.
Read(intValue))
3042 m_VariablesMask = intValue;
3047 if (!ctx.
Read(value))
3064 if (!ctx.
Read(value))
3066 SetTemperatureDirect(value);
3072 if (!ctx.
Read(value))
3079 if (!ctx.
Read(intValue))
3101 if (!ctx.
Read(intValue))
3106 if (version >= 138 && version < 140)
3110 if (!ctx.
Read(intValue))
3112 SetFrozen(intValue);
3128 if (!super.OnStoreLoad(ctx, version))
3136 bool hasQuickBarIndexSaved;
3138 if (!ctx.
Read(hasQuickBarIndexSaved))
3144 if (hasQuickBarIndexSaved)
3149 if (!ctx.
Read(itmQBIndex))
3156 if (itmQBIndex != -1 && parentPlayer)
3157 parentPlayer.SetLoadedQuickBarItemBind(
this, itmQBIndex);
3165 if (version ==
int.
MAX)
3167 if (!ctx.
Read(itemQBIndex))
3173 else if (
Class.
CastTo(player, GetHierarchyRootPlayer()))
3176 if (!ctx.
Read(itemQBIndex))
3181 if (itemQBIndex != -1 && player)
3182 player.SetLoadedQuickBarItemBind(
this,itemQBIndex);
3189 if (!LoadVariables(ctx, version))
3223 super.OnStoreSave(ctx);
3226 if (
PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
3230 int itemQBIndex = -1;
3231 itemQBIndex = player.FindQuickBarEntityIndex(
this);
3232 ctx.
Write(itemQBIndex);
3251 super.AfterStoreLoad();
3267 super.EEOnAfterLoad();
3289 #ifdef PLATFORM_CONSOLE
3334 super.OnVariablesSynchronized();
3340 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
3342 if (!IsServerCheck(allow_client))
3351 if (value <= (min + 0.001))
3358 bool dstr = ConfigGetBool(
"varQuantityDestroyOnMin");
3366 else if (destroy_forced)
3381 EntityAI parent = GetHierarchyRoot();
3383 GetInventory().GetCurrentInventoryLocation(iLoc);
3386 int iLocSlot = iLoc.
GetSlot();
3413 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
3433 float value_clamped =
Math.
Clamp(value, 0, 1);
3435 SetQuantity(result, destroy_config, destroy_forced);
3475 float quantity_max = 0;
3479 if (attSlotID != -1)
3482 if (quantity_max <= 0)
3486 if (quantity_max <= 0)
3489 return quantity_max;
3522 float weightEx = GetWeightEx();
3523 float special = GetInventoryAndCargoWeight();
3524 return weightEx - special;
3538 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
3547 else if (HasEnergyManager())
3550 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
3553 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
3556 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
3561 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
3564 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
3567 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
3585 for (
int i = 0; i < nAttachments; ++i)
3589 item_count += item.GetNumberOfItems();
3599 if (include_wetness)
3603 weight = wetness * m_ConfigWeight;
3617 if ((
g_Game.IsServer() || !
g_Game.IsMultiplayer()) && inventory)
3621 for (
int i = 0; i < items.Count(); ++i)
3626 g_Game.ObjectDelete(item);
3638 if (HasEnergyManager())
3640 energy = GetCompEM().GetEnergy();
3648 super.OnEnergyConsumed();
3655 super.OnEnergyAdded();
3663 if (
g_Game.IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
3667 float energy_0to1 = GetCompEM().GetEnergy0To1();
3676 return ConfigGetFloat(
"heatIsolation");
3686 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
3687 if (
g_Game.ConfigIsExisting(paramPath))
3688 return g_Game.ConfigGetFloat(paramPath);
3695 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
3696 if (
g_Game.ConfigIsExisting(paramPath))
3697 return g_Game.ConfigGetFloat(paramPath);
3702 override void SetWet(
float value,
bool allow_client =
false)
3704 if (!IsServerCheck(allow_client))
3755 if (newLevel != oldLevel)
3768 return GetWetLevelInternal(
m_VarWet);
3797 if (ConfigIsExisting(
"itemModelLength"))
3799 return ConfigGetFloat(
"itemModelLength");
3806 if (ConfigIsExisting(
"itemAttachOffset"))
3808 return ConfigGetFloat(
"itemAttachOffset");
3815 if (!IsServerCheck(allow_client))
3861 override void GetColor(out
int r,out
int g,out
int b,out
int a)
3883 return MiscGameplayFunctions.GetColorString(r, g, b, a);
3890 if (!IsServerCheck(allow_client))
3901 return ConfigGetInt(
"varLiquidTypeInit");
3918 player.SetEnableQuickBarEntityShortcut(
this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
3929 nplayer.SetEnableQuickBarEntityShortcut(
this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
3940 nplayer.SetEnableQuickBarEntityShortcut(
this,
false);
3943 player.GetHumanInventory().ClearUserReservedLocationForContainer(
this);
3945 if (HasEnergyManager())
3947 GetCompEM().UpdatePlugState();
3954 super.OnPlacementStarted(player);
3963 m_AdminLog.OnPlacementComplete(player,
this);
3966 super.OnPlacementComplete(player, position, orientation);
4083 super.CheckForRoofLimited(timeTresholdMS);
4085 float time =
g_Game.GetTime();
4086 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
4088 m_PreviousRoofTestTime = time;
4089 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(
this));
4101 if (GetInventory().GetAttachmentSlotsCount() != 0)
4103 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
4105 return filter.GetProtectionLevel(type,
false, system);
4110 string subclassPath, entryName;
4115 entryName =
"biological";
4118 entryName =
"chemical";
4121 entryName =
"biological";
4125 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
4127 return g_Game.ConfigGetFloat(subclassPath + entryName);
4169 if (!parent.IsRuined())
4178 if (!super.CanPutAsAttachment(parent))
4183 if (!IsRuined() && !parent.IsRuined())
4197 return super.CanReceiveItemIntoCargo(item);
4209 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(
PlayerBase))
4214 attachment.GetInventory().GetCurrentInventoryLocation(loc);
4215 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
4218 return super.CanReceiveAttachment(attachment, slotId);
4223 if (!super.CanReleaseAttachment(attachment))
4226 return GetInventory().AreChildrenAccessible();
4251 int id = muzzle_owner.GetMuzzleID();
4256 for (
int i = 0; i < WPOF_array.Count(); i++)
4258 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
4262 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
4271 int id = muzzle_owner.GetMuzzleID();
4276 for (
int i = 0; i < WPOBE_array.Count(); i++)
4278 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
4282 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
4291 int id = muzzle_owner.GetMuzzleID();
4296 for (
int i = 0; i < WPOOH_array.Count(); i++)
4298 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
4302 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
4311 int id = muzzle_owner.GetMuzzleID();
4316 for (
int i = 0; i < WPOOH_array.Count(); i++)
4318 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
4322 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
4331 int id = muzzle_owner.GetMuzzleID();
4336 for (
int i = 0; i < WPOOH_array.Count(); i++)
4338 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
4342 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
4414 string att_type =
"None";
4416 if (ConfigIsExisting(
"soundAttType"))
4418 att_type = ConfigGetString(
"soundAttType");
4532 SetDynamicPhysicsLifeTime(0.01);
4539 GetDamageZones(zone_names);
4540 for (
int i = 0; i < zone_names.Count(); i++)
4542 SetHealthMax(zone_names.Get(i),
"Health");
4544 SetHealthMax(
"",
"Health");
4550 float global_health = GetHealth01(
"",
"Health");
4552 GetDamageZones(zones);
4554 for (
int i = 0; i < zones.Count(); i++)
4556 SetHealth01(zones.Get(i),
"Health",global_health);
4563 return IsExclusionFlagPresent(
PlayerBase.GetFaceCoverageShaveValues());
4568 if (!hasRootAsPlayer)
4576 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
4595 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
4596 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
4598 float heatPermCoef = 1.0;
4602 heatPermCoef *= ent.GetHeatPermeabilityCoef();
4603 ent = ent.GetHierarchyParent();
4614 EntityAI parent = GetHierarchyParent();
4618 hasRootAsPlayer =
false;
4623 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
4624 refParentIB =
ItemBase.Cast(parent);
4655 return !GetIsFrozen() &&
IsOpen();
4660 bool hasParent =
false, hasRootAsPlayer =
false;
4663 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
4664 bool foodDecay =
g_Game.IsFoodDecayEnabled();
4666 if (wwtu || foodDecay)
4672 if (processWetness || processTemperature || processDecay)
4677 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
4679 if (processTemperature)
4683 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
4699 return super.GetTemperatureFreezeThreshold();
4707 return super.GetTemperatureThawThreshold();
4715 return super.GetItemOverheatThreshold();
4723 return super.GetTemperatureFreezeTime();
4731 return super.GetTemperatureThawTime();
4741 return (item.IsKindOf(
"Cauldron") || item.IsKindOf(
"Pot") || item.IsKindOf(
"FryingPan") || item.IsKindOf(
"SmallProtectorCase") || (item.IsKindOf(
"PortableGasStove") && item.FindAttachmentBySlotName(
"CookingEquipment")));
4746 MiscGameplayFunctions.TransferItemProperties(oldItem,
this);
4789 explosive.PairRemote(trg);
4793 trg.SetPersistentPairID(persistentID);
4794 explosive.SetPersistentPairID(persistentID);
4807 ret *= GetHealth01();
4813 override void SetDebugItem()
4815 super.SetDebugItem();
4821 string text = super.GetDebugText();
4824 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
4870 [
Obsolete(
"Use ItemSoundHandler instead")]
4874 if (!
g_Game.IsDedicatedServer())
4876 if (ConfigIsExisting(
"attachSoundSet"))
4878 string cfg_path =
"";
4879 string soundset =
"";
4884 ConfigGetTextArray(
"attachSoundSet",cfg_soundset_array);
4885 ConfigGetTextArray(
"attachSoundSlot",cfg_slot_array);
4887 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
4889 for (
int i = 0; i < cfg_soundset_array.Count(); i++)
4891 if (cfg_slot_array[i] == slot_type)
4893 soundset = cfg_soundset_array[i];
4917 if (is_item && full_quantity)
4936 item.SetHealth(
"",
"", health);
4938 if (item.CanHaveTemperature())
4941 if (item.CanFreeze())
4942 item.SetFrozen(
false);
4945 if (item.HasEnergyManager())
4949 item.GetCompEM().SetEnergy0To1(quantity);
4956 else if (item.IsMagazine())
4958 Magazine mag = Magazine.Cast(item);
4961 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
4973 item.SetQuantityNormalized(quantity,
false);
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
bool SetAttachSoundEvent()
bool SetDetachSoundEvent()
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
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
void OnItemLocationChanged(ItemBase item)
represents base for cargo storage for entities
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
Super root of all classes in Enforce script.
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
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.
Wrapper class for managing sound through SEffectManager.
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
script counterpart to engine's class Inventory
proto native bool GetCurrentInventoryLocation(out notnull InventoryLocation loc)
static proto native EntityAI LocationCreateEntity(notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
const int c_InventoryReservationTimeoutShortMS
proto native EntityAI GetAttachmentFromIndex(int index)
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
proto native bool FindFreeLocationFor(notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFreeLocationFor.
proto native CargoBase GetCargo()
cargo
proto native int AttachmentCount()
Returns count of attachments attached to this item.
proto void SelectPhysics(Physics physics)
Applies impulses to set the position when dynamic, otherwise sets the transform in the physics scene.
proto void SelectObject(Object object)
Sets the transform of the object directly.
Internal ancestor of all Entity implementations.
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors).
override bool IsSplitable()
override bool IsHologram()
void ClearStopItemSoundServer()
void SetResultOfSplit(bool value)
override float GetSingleInventoryItemWeightEx()
void OnCombine(ItemBase other_item)
override float GetItemOverheatThreshold()
bool DamageItemInCargo(float damage)
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void ProcessDecay(float delta, bool hasRootAsPlayer)
string GetLoopFoldSoundset()
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
ref TIntArray m_SingleUseActions
override void OnCreatePhysics()
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ref TStringArray m_HeadHidingSelections
override void SetStoreLoadedQuantity(float value)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
ScriptedLightBase GetLight()
ref array< ref OverheatingParticle > m_OverheatingParticles
float GetQuantityNormalizedScripted()
float GetHeatIsolationInit()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
bool m_IsSoundSynchRemote
ref array< int > m_CompatibleLocks
void LoadParticleConfigOnOverheating(int id)
float m_TemperaturePerQuantityWeight
void StopItemDynamicPhysics()
bool m_RecipesInitialized
bool IsActionTargetVisible()
float GetDeployTime()
how long it takes to deploy this item in seconds
TInputActionMap m_InputActionMap
override void RemoveAllAgentsExcept(int agent_to_keep)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution).
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
override float GetTemperatureFreezeThreshold()
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_InteractActions
override void InsertAgent(int agent, float count=1)
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
override float GetTemperatureFreezeTime()
void OnLiquidTypeChanged(int oldType, int newType)
override void EOnContact(IEntity other, Contact extra)
override bool CanBeSplit()
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely).
override void SetCleanness(int value, bool allow_client=false)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
override float GetWetMax()
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
bool m_CanBeMovedOverride
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool CanDisplayCargo()
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
array< string > GetHeadHidingSelection()
override void OnStoreSave(ParamsWriteContext ctx)
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
float GetBandagingEffectivity()
override void ProcessVariables()
override void SetColor(int r, int g, int b, int a)
int m_ShotsToStartOverheating
override void GetColor(out int r, out int g, out int b, out int a)
gets item's color variable as components
override bool CanReceiveItemIntoCargo(EntityAI item)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
override string ChangeIntoOnAttach(string slot)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
void SoundSynchRemoteReset()
ItemSoundHandler GetItemSoundHandler()
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
override bool IsStoreLoad()
void ConvertEnergyToQuantity()
int GetLiquidContainerMask()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void RemoveAgent(int agent_id)
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
bool m_CanPlayImpactSound
override void EEKilled(Object killer)
static void ToggleDebugActionsMask(int mask)
PluginAdminLog m_AdminLog
void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
void OnActivatedByTripWire()
DEPRECATED use OnActivatedByItem below Called when this item is activated from a trip wire that was s...
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
override int GetQuantityMin()
void AddAction(typename actionName)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
override void RemoveAllAgents()
override float GetQuantity()
const int ITEM_SOUNDS_MAX
override bool HasQuantity()
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnWetChanged(float newVal, float oldVal)
override string GetAttachmentSoundType()
override void SetStoreLoad(bool value)
override string ChangeIntoOnDetach()
void ClearStartItemSoundServer()
string GetLoopDeploySoundset()
override void OnEnergyAdded()
override float GetWetInit()
void Open()
Implementations only.
override bool CanPutInCargo(EntityAI parent)
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
int NameToID(string name)
override bool IsBeingPlaced()
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
float GetInfectionChance(int system=0, Param param=null)
Infection chance while/after using this item, originally used for wound infection after bandaging,...
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
bool IsFacingPlayer(PlayerBase player, string selection)
override void SetWetMax()
override void SetTakeable(bool pState)
void SetIsHologram(bool is_hologram)
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
override void OnRightClick()
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
ref TIntArray m_ContinuousActions
void UpdateAllOverheatingParticles()
bool AllowFoodConsumption()
void SaveAgents(ParamsWriteContext ctx)
float GetOverheatingCoef()
int m_ImpactSoundSurfaceHash
float GetSoakingIncrement(string pIncrementName)
override bool CanReleaseAttachment(EntityAI attachment)
override void SetWet(float value, bool allow_client=false)
int m_MaxOverheatingValue
static ref map< string, int > m_WeaponTypeToID
void KillAllOverheatingParticles()
string GetPlaceSoundset()
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Set item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override bool IsOneHandedBehaviour()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
ItemBase GetLightSourceItem()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
float m_OverheatingDecayInterval
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool LoadAgents(ParamsReadContext ctx, int version)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void PlayDetachSound(string slot_type)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureThawTime()
override void EEDelete(EntityAI parent)
bool can_this_be_combined
array< int > GetValidFinishers()
returns an array of possible finishers
override int GetLiquidType()
void SetActionAnimOverrides()
override void SetQuantityToMinimum()
EffectSound m_SoundDeploy
void SetIsPlaceSound(bool is_place_sound)
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
override bool CanObstruct()
void CombineItems(ItemBase other_item, bool use_stack_max=true)
override float GetTemperatureThawThreshold()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
bool m_WantPlayImpactSound
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
override void AfterStoreLoad()
float m_StoreLoadedQuantity
override float GetWetMin()
override int GetQuickBarBonus()
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void SplitIntoStackMaxHands(PlayerBase player)
void SetIsDeploySound(bool is_deploy_sound)
override void OnWasDetached(EntityAI parent, int slot_id)
bool CanBeMovedOverride()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
override void EEOnAfterLoad()
float GetItemAttachOffset()
override bool IsIgnoredByConstruction()
static bool HasDebugActionsMask(int mask)
void RemoveAudioVisualsOnClient()
void RemoveLightSourceItem()
bool m_HideSelectionsBySlot
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
ref Timer m_CheckOverheating
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only).
string GetDeploySoundset()
void OnApply(PlayerBase player)
static int GetDebugActionsMask()
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
void OnOverheatingDecay()
bool ShouldSplitQuantity(float quantity)
void StopItemSoundServer(int id)
int GetOnDigWormsAmount()
void PerformDamageSystemReinit()
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
void OnInventoryEnter(Man player)
Event called on item when it is placed in the player(Man) inventory, passes the owner as a parameter.
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
bool CanBeUsedForSuicide()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
static void SetDebugActionsMask(int mask)
override void ClearInventory()
override bool OnStoreLoad(ParamsReadContext ctx, int version)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void SetCEBasedQuantity()
bool ContainsAgent(int agent_id)
void SetIsBeingPlaced(bool is_being_placed)
override void AddWet(float value)
override void OnMovedInsideCargo(EntityAI container)
bool HidesSelectionBySlot()
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
float GetFilterDamageRatio()
override bool CanPutAsAttachment(EntityAI parent)
void StartItemSoundServer(int id)
float GetWeightSpecialized(bool forceRecalc=false)
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
WrittenNoteData GetWrittenNoteData()
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
EffectSound m_DeployLoopSoundEx
override bool IsTakeable()
int GetDamageSystemVersionChange()
Re-sets DamageSystem changes.
void StopDeployLoopSoundEx()
override bool IsHeavyBehaviour()
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override void OnWasAttached(EntityAI parent, int slot_id)
string GetExplosiveTriggerSlotName()
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
override void OnPlacementStarted(Man player)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
float GetItemModelLength()
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
override int GetTargetQuantityMax(int attSlotID=-1)
override void OnVariablesSynchronized()
override bool KindOf(string tag)
void PlayDeployFinishSound()
bool m_IsOverheatingEffectActive
bool DamageItemAttachments(float damage)
override void DeSerializeNumericalVars(array< float > floats)
int m_LiquidContainerMask
bool CanBeCookedOnStick()
ref EffectSound m_LockingSound
void StartItemSoundServer(int id, int slotId)
bool CanPlayDeployLoopSound()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
static void AddDebugActionsMask(int mask)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
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...
static int m_LastRegisteredWeaponID
void SetCanBeMovedOverride(bool setting)
override void WriteVarsToCTX(ParamsWriteContext ctx)
static void RemoveDebugActionsMask(int mask)
bool CanBeRepairedByCrafting()
float GetOverheatingValue()
void TransferAgents(int agents)
transfer agents from another item
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void PlayDeployLoopSoundEx()
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
bool CanRepair(ItemBase item_repair_kit)
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
static int m_DebugActionsMask
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
bool m_ItemBeingDroppedPhys
override int GetCleanness()
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
override void InitItemVariables()
bool m_FixDamageSystemInit
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
void RemoveAction(typename actionName)
bool IsSoundSynchRemote()
void LoadParticleConfigOnFire(int id)
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
ItemBase m_LightSourceItem
float GetDryingIncrement(string pIncrementName)
void SplitItem(PlayerBase player)
override void SetLiquidType(int value, bool allow_client=false)
float GetSingleInventoryItemWeight()
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
override EWetnessLevel GetWetLevel()
override void SerializeNumericalVars(array< float > floats_out)
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
override float GetStoreLoadedQuantity()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
string GetDeployFinishSoundset()
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 OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
bool IsPlayerInside(PlayerBase player, string selection)
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
EffectSound m_SoundDeployFinish
bool IsOverheatingEffectActive()
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override bool IsItemBase()
ref ItemSoundHandler m_ItemSoundHandler
void CopyScriptPropertiesFrom(EntityAI oldItem)
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
override bool IsTwoHandedBehaviour()
bool PairWithDevice(notnull ItemBase otherDevice)
override int GetQuantityMax()
override void OnEnergyConsumed()
proto native int GetSlot()
returns slot id if current type is Attachment
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetParent()
returns parent of current inventory location
proto native bool IsValid()
verify current set inventory location
proto native int GetType()
returns type of InventoryLocation
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native EntityAI GetItem()
returns item of current inventory location
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
provides access to slot configuration
static proto native int GetStackMaxForSlotId(int slot_Id)
const int INVALID
Invalid slot (-1).
static proto native bool IsSlotIdValid(int slotId)
override string GetDeploySoundset()
override bool IsSelfAdjustingTemperature()
override void OnInventoryExit(Man player)
override bool CanBeSplit()
override string GetLoopDeploySoundset()
override void RefreshPhysics()
override bool IsPlayerInside(PlayerBase player, string selection)
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void SetActionAnimOverrides()
override int GetDamageSystemVersionChange()
override void OnCombine(ItemBase other_item)
override WrittenNoteData GetWrittenNoteData()
override bool IsElectricAppliance()
override bool IsItemTent()
override bool CanPutAsAttachment(EntityAI parent)
override void OnEndPlacement()
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsClothing()
override void OnInventoryEnter(Man player)
override void InitItemSounds()
override void SetActions()
static bool IsActionLogEnable()
void SetOverheatingLimitMax(float max)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
float GetOverheatingLimitMax()
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
void RegisterParticle(Particle p)
Base Param Class with no parameters.
Legacy way of using particles in the game.
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
The class that will be instanced (moddable).
void SetControlledDevice(EntityAI pDevice)
static int GeneratePersistentID()
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
Manager class for managing Effect (EffectParticle, EffectSound).
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
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.
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
const float DEFAULT_DEPLOY
script counterpart to engine's class Weapon
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
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.
DamageType
exposed from C++ (do not change)
override bool IsPrepareToDelete()
override bool CanHaveTemperature()
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
Serializer ParamsWriteContext
proto GizmoApi GetGizmoApi()
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
const float WETNESS_RATE_WETTING_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
void Obsolete(string msg="")
EntityEvent
Entity events for event-mask, or throwing event from code.
const float TEMP_COEF_WORLD
static const float TEMPERATURE_TIME_FREEZE_MIN
static const float TEMPERATURE_TIME_THAW_MIN
const float ITEM_TEMPERATURE_QUANTITY_WEIGHT_MULTIPLIER
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
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 int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static proto float Round(float f)
Returns mathematical round of value.
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 float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float AbsFloat(float f)
Returns absolute value.
static proto float Floor(float f)
Returns floor of value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
vector GetPosition()
Get the world position of the Effect.
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors).
override bool IsSplitable()
void SetResultOfSplit(bool value)
override float GetSingleInventoryItemWeightEx()
bool DamageItemInCargo(float damage)
void ProcessDecay(float delta, bool hasRootAsPlayer)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
override void SetStoreLoadedQuantity(float value)
float GetHeatIsolationInit()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
void LoadParticleConfigOnOverheating(int id)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
ItemBaseType Inventory_BaseType
override void InsertAgent(int agent, float count=1)
void OnLiquidTypeChanged(int oldType, int newType)
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMax()
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
ItemSoundHandler GetItemSoundHandler()
override bool IsStoreLoad()
void ConvertEnergyToQuantity()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
override void RemoveAgent(int agent_id)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
override int GetQuantityMin()
override void RemoveAllAgents()
override float GetQuantity()
override bool HasQuantity()
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="")
override void SetTakeable(bool pState)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UpdateAllOverheatingParticles()
void SaveAgents(ParamsWriteContext ctx)
float GetOverheatingCoef()
override void SetWet(float value, bool allow_client=false)
void SetupSpawnedItem(ItemBase item, float health, float quantity)
void KillAllOverheatingParticles()
string GetPlaceSoundset()
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
bool LoadAgents(ParamsReadContext ctx, int version)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
override int GetLiquidType()
void CombineItems(ItemBase other_item, bool use_stack_max=true)
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override float GetWetMin()
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void SplitIntoStackMaxHands(PlayerBase player)
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
float GetItemAttachOffset()
static bool HasDebugActionsMask(int mask)
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only).
bool ShouldSplitQuantity(float quantity)
void PerformDamageSystemReinit()
void SetCEBasedQuantity()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
float GetItemModelLength()
override int GetTargetQuantityMax(int attSlotID=-1)
bool DamageItemAttachments(float damage)
void StartItemSoundServer(int id, int slotId)
static void AddDebugActionsMask(int mask)
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...
static void RemoveDebugActionsMask(int mask)
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override int GetCleanness()
void LoadParticleConfigOnFire(int id)
float GetDryingIncrement(string pIncrementName)
void SplitItem(PlayerBase player)
override void SetLiquidType(int value, bool allow_client=false)
override float GetStoreLoadedQuantity()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
bool IsOverheatingEffectActive()
override int GetQuantityMax()
void ItemSoundHandler(ItemBase parent)
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
override void Explode(int damageType, string ammoType="")