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
DamageType
exposed from C++ (do not change)
override bool IsPrepareToDelete()
override bool CanHaveTemperature()
proto GizmoApi GetGizmoApi()
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
void SplitItem(PlayerBase player)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void SetWet(float value, bool allow_client=false)
void StartItemSoundServer(int id, int slotId)
bool LoadAgents(ParamsReadContext ctx, int version)
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
ItemBaseType Inventory_BaseType
override float GetWetMax()
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
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="")
float GetDryingIncrement(string pIncrementName)
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
void SetCEBasedQuantity()
float GetOverheatingCoef()
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
override float GetStoreLoadedQuantity()
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
float GetHeatIsolationInit()
override bool HasQuantity()
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
override void SetTakeable(bool pState)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
static void AddDebugActionsMask(int mask)
override bool IsSplitable()
bool DamageItemAttachments(float damage)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
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 IsOverheatingEffectActive()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetItemAttachOffset()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
bool ContainsAgent(int agent_id)
override void AddWet(float value)
void SplitIntoStackMaxHands(PlayerBase player)
override void SetStoreLoadedQuantity(float value)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
static void RemoveDebugActionsMask(int mask)
void PerformDamageSystemReinit()
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
void KillAllOverheatingParticles()
override int GetQuantityMax()
override void RemoveAgent(int agent_id)
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
void LoadParticleConfigOnOverheating(int id)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
void ItemSoundHandler(ItemBase parent)
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
represents base for cargo storage for entities
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 LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Wrapper class for managing sound through SEffectManager.
proto native EntityAI GetAttachmentFromIndex(int index)
proto native bool GetCurrentInventoryLocation(out notnull InventoryLocation loc)
returns information about current item location
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
const int c_InventoryReservationTimeoutShortMS
static proto native EntityAI LocationCreateEntity(notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
creates new item directly at location
proto native int AttachmentCount()
Returns count of attachments attached to this item.
proto native bool FindFreeLocationFor(notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFreeLocationFor.
script counterpart to engine's class Inventory
proto void SelectObject(Object object)
proto void SelectPhysics(Physics physics)
override string GetAttachmentSoundType()
void KillAllOverheatingParticles()
ref ItemSoundHandler m_ItemSoundHandler
bool IsActionTargetVisible()
override float GetQuantity()
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
override string ChangeIntoOnDetach()
override void OnEnergyConsumed()
string GetLoopDeploySoundset()
override void ClearInventory()
void SoundSynchRemoteReset()
void PlayDeployLoopSoundEx()
bool m_ItemBeingDroppedPhys
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
EffectSound m_SoundDeployFinish
ItemBase GetLightSourceItem()
override bool IsOneHandedBehaviour()
override bool IsSplitable()
override void SetColor(int r, int g, int b, int a)
override int GetCleanness()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override float GetTemperatureThawThreshold()
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
void RemoveAction(typename actionName)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool HasQuantity()
override float GetTemperatureThawTime()
void StopItemDynamicPhysics()
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool IsStoreLoad()
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override float GetWetMin()
ref array< ref OverheatingParticle > m_OverheatingParticles
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
override bool CanDisplayCargo()
override void SetWetMax()
bool CanPlayDeployLoopSound()
override bool IsHologram()
array< string > GetHeadHidingSelection()
float GetHeatIsolationInit()
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
override void InitItemVariables()
void StartItemSoundServer(int id, int slotId)
override void ProcessVariables()
bool HidesSelectionBySlot()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
bool m_IsSoundSynchRemote
void RemoveAudioVisualsOnClient()
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
void SetIsPlaceSound(bool is_place_sound)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
void ClearStopItemSoundServer()
override void RemoveAllAgents()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override void OnStoreSave(ParamsWriteContext ctx)
string GetLoopFoldSoundset()
override bool CanPutInCargo(EntityAI parent)
override void SetQuantityToMinimum()
WrittenNoteData GetWrittenNoteData()
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
float GetOverheatingValue()
ref TIntArray m_SingleUseActions
override void SetTakeable(bool pState)
array< int > GetValidFinishers()
returns an array of possible finishers
ref Timer m_CheckOverheating
bool CanBeCookedOnStick()
float GetOverheatingCoef()
bool m_RecipesInitialized
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
override void SetWet(float value, bool allow_client=false)
float GetSoakingIncrement(string pIncrementName)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void SplitIntoStackMaxHandsClient(PlayerBase player)
static int m_LastRegisteredWeaponID
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
TInputActionMap m_InputActionMap
override void EEKilled(Object killer)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void OnInventoryExit(Man player)
Event called on item when it is removed from the player(Man) inventory, passes the old owner as a par...
int m_MaxOverheatingValue
override float GetTemperatureFreezeTime()
void TransferAgents(int agents)
transfer agents from another item
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
override bool CanPutAsAttachment(EntityAI parent)
int GetOnDigWormsAmount()
ref EffectSound m_LockingSound
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
ItemSoundHandler GetItemSoundHandler()
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void SaveAgents(ParamsWriteContext ctx)
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
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...
void SplitIntoStackMaxHands(PlayerBase player)
override void OnEnergyAdded()
void StopDeployLoopSoundEx()
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
override bool KindOf(string tag)
override void InsertAgent(int agent, float count=1)
int m_ShotsToStartOverheating
override EWetnessLevel GetWetLevel()
override int GetQuantityMax()
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
override void OnCreatePhysics()
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
static int GetDebugActionsMask()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
void ConvertEnergyToQuantity()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
bool IsFacingPlayer(PlayerBase player, string selection)
override float GetWetInit()
override void SetStoreLoadedQuantity(float value)
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void SetIsDeploySound(bool is_deploy_sound)
override void RemoveAllAgentsExcept(int agent_to_keep)
override void OnPlacementStarted(Man player)
static void RemoveDebugActionsMask(int mask)
override int GetQuickBarBonus()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override int GetLiquidType()
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
override bool CanObstruct()
void PerformDamageSystemReinit()
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...
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
float m_OverheatingDecayInterval
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
static bool HasDebugActionsMask(int mask)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
override int GetTargetQuantityMax(int attSlotID=-1)
void StartItemSoundServer(int id)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void AddAction(typename actionName)
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
bool IsCargoException4x3(EntityAI item)
bool m_FixDamageSystemInit
override void EEOnAfterLoad()
float m_StoreLoadedQuantity
override void SetLiquidType(int value, bool allow_client=false)
override void OnVariablesSynchronized()
void OnInventoryEnter(Man player)
Event called on item when it is placed in the player(Man) inventory, passes the owner as a parameter.
override void OnWasDetached(EntityAI parent, int slot_id)
override void OnMovedInsideCargo(EntityAI container)
override float GetSingleInventoryItemWeightEx()
override bool IsIgnoredByConstruction()
void OnActivatedByTripWire()
bool ContainsAgent(int agent_id)
static ref map< string, int > m_WeaponTypeToID
float m_TemperaturePerQuantityWeight
bool CanBeMovedOverride()
void Open()
Implementations only.
bool m_HideSelectionsBySlot
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
override bool IsItemBase()
static void SetDebugActionsMask(int mask)
override bool IsTwoHandedBehaviour()
override float GetItemOverheatThreshold()
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
float GetWeightSpecialized(bool forceRecalc=false)
float GetDeployTime()
how long it takes to deploy this item in seconds
override float GetStoreLoadedQuantity()
float GetBandagingEffectivity()
bool CanBeUsedForSuicide()
int m_ImpactSoundSurfaceHash
bool can_this_be_combined
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
override bool IsTakeable()
override void SetCleanness(int value, bool allow_client=false)
override void SetStoreLoad(bool value)
static void AddDebugActionsMask(int mask)
override void OnWasAttached(EntityAI parent, int slot_id)
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
override void DeSerializeNumericalVars(array< float > floats)
override string ChangeIntoOnAttach(string slot)
EffectSound m_SoundDeploy
bool ShouldSplitQuantity(float quantity)
override float GetTemperatureFreezeThreshold()
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
bool m_IsOverheatingEffectActive
override void AfterStoreLoad()
static void ToggleDebugActionsMask(int mask)
bool m_WantPlayImpactSound
bool DamageItemAttachments(float damage)
float GetSingleInventoryItemWeight()
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
override int GetQuantityMin()
bool m_CanPlayImpactSound
void StopItemSoundServer(int id)
string GetPlaceSoundset()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
override void WriteVarsToCTX(ParamsWriteContext ctx)
bool CanBeRepairedByCrafting()
void PlayDeployFinishSound()
float GetDryingIncrement(string pIncrementName)
override void RemoveAgent(int agent_id)
bool m_CanBeMovedOverride
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void LoadParticleConfigOnOverheating(int id)
override void SerializeNumericalVars(array< float > floats_out)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void SetCanBeMovedOverride(bool setting)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
int m_LiquidContainerMask
void OnOverheatingDecay()
override bool CanReceiveItemIntoCargo(EntityAI item)
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void UpdateAllOverheatingParticles()
int GetDamageSystemVersionChange()
Re-sets DamageSystem changes.
bool IsSoundSynchRemote()
void CopyScriptPropertiesFrom(EntityAI oldItem)
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
bool IsPlayerInside(PlayerBase player, string selection)
PluginAdminLog m_AdminLog
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
float GetItemModelLength()
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
void ClearStartItemSoundServer()
void OnCombine(ItemBase other_item)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
void SetResultOfSplit(bool value)
float GetFilterDamageRatio()
void SplitItem(PlayerBase player)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnWetChanged(float newVal, float oldVal)
void OnLiquidTypeChanged(int oldType, int newType)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
int NameToID(string name)
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
void SetIsBeingPlaced(bool is_being_placed)
float GetDisinfectQuantity(int system=0, Param param1=null)
ref array< int > m_CompatibleLocks
override bool CanBeSplit()
ref TIntArray m_ContinuousActions
float GetItemAttachOffset()
bool CanRepair(ItemBase item_repair_kit)
ScriptedLightBase GetLight()
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
bool PairWithDevice(notnull ItemBase otherDevice)
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
override void GetColor(out int r, out int g, out int b, out int a)
gets item's color variable as components
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
static int m_DebugActionsMask
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
bool AllowFoodConsumption()
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsBeingPlaced()
override void EEDelete(EntityAI parent)
string GetDeploySoundset()
void PlayDetachSound(string slot_type)
void SetCEBasedQuantity()
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
override void OnRightClick()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool CanReleaseAttachment(EntityAI attachment)
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
bool IsOverheatingEffectActive()
ItemBase m_LightSourceItem
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnItemInHandsPlayerSwimStart(PlayerBase player)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool LoadAgents(ParamsReadContext ctx, int version)
const int ITEM_SOUNDS_MAX
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
ref TIntArray m_InteractActions
bool DamageItemInCargo(float damage)
void LoadParticleConfigOnFire(int id)
override bool IsHeavyBehaviour()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
float GetQuantityNormalizedScripted()
ref Timer m_PhysDropTimer
void RemoveLightSourceItem()
float GetInfectionChance(int system=0, Param param=null)
Infection chance while/after using this item, originally used for wound infection after bandaging,...
string GetDeployFinishSoundset()
override float GetWetMax()
ref TStringArray m_HeadHidingSelections
override void EOnContact(IEntity other, Contact extra)
void OnApply(PlayerBase player)
int GetLiquidContainerMask()
void SetActionAnimOverrides()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
override void AddWet(float value)
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
const int INVALID
Invalid slot (-1)
static proto native bool IsSlotIdValid(int slotId)
verifies existence of the slot id
static proto native int GetStackMaxForSlotId(int slot_Id)
provides access to slot configuration
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
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 string GetDeploySoundset()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void RefreshPhysics()
override string GetLoopDeploySoundset()
override void OnInventoryExit(Man player)
override void InitItemSounds()
override void OnCombine(ItemBase other_item)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsClothing()
override bool CanBeSplit()
override void OnEndPlacement()
static bool IsActionLogEnable()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
Legacy way of using particles in the game.
The class that will be instanced (moddable)
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
static int GeneratePersistentID()
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Manager class for managing Effect (EffectParticle, 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.
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
Serializer ParamsWriteContext
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_THAW_MIN
static const float TEMPERATURE_TIME_FREEZE_MIN
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const float ITEM_TEMPERATURE_QUANTITY_WEIGHT_MULTIPLIER
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
const float STATE_SOAKING_WET
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Floor(float f)
Returns floor of value.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
static proto float Round(float f)
Returns mathematical round of value.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
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.