74 protected bool m_IsResultOfSplit
147 if (!
GetGame().IsDedicatedServer())
163 m_OldLocation = null;
170 if (ConfigIsExisting(
"headSelectionsToHide"))
177 if (ConfigIsExisting(
"hideSelectionsByinventorySlot"))
184 m_IsResultOfSplit =
false;
191 super.InitItemVariables();
198 m_Count = ConfigGetInt(
"count");
235 if (ConfigIsExisting(
"canBeSplit"))
242 if (ConfigIsExisting(
"itemBehaviour"))
248 RegisterNetSyncVariableInt(
"m_VarLiquidType");
249 RegisterNetSyncVariableInt(
"m_Cleanness",0,1);
251 RegisterNetSyncVariableBoolSignal(
"m_WantPlayImpactSound");
252 RegisterNetSyncVariableFloat(
"m_ImpactSpeed");
253 RegisterNetSyncVariableInt(
"m_ImpactSoundSurfaceHash");
255 RegisterNetSyncVariableInt(
"m_ColorComponentR", 0, 255);
256 RegisterNetSyncVariableInt(
"m_ColorComponentG", 0, 255);
257 RegisterNetSyncVariableInt(
"m_ColorComponentB", 0, 255);
258 RegisterNetSyncVariableInt(
"m_ColorComponentA", 0, 255);
260 RegisterNetSyncVariableBool(
"m_IsBeingPlaced");
261 RegisterNetSyncVariableBool(
"m_IsTakeable");
262 RegisterNetSyncVariableBool(
"m_IsHologram");
274 if (ConfigIsExisting(
"temperaturePerQuantityWeight"))
287 if (!m_InputActionMap)
343 Debug.
ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
346 if (action_array.Find(action) != -1)
348 Debug.
Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
352 action_array.Insert(action);
359 ActionBase action = player.GetActionManager().GetAction(actionName);
365 action_array.RemoveItem(action);
385 actionMap.Insert(this.
Type(), overrideData);
402 string config_to_search =
"CfgVehicles";
403 string muzzle_owner_config;
408 config_to_search =
"CfgWeapons";
410 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
412 string config_OnFire_class = muzzle_owner_config +
"Particles " +
"OnFire ";
416 if (config_OnFire_subclass_count > 0)
420 for (
int i = 0; i < config_OnFire_subclass_count; i++)
422 string particle_class =
"";
424 string config_OnFire_entry = config_OnFire_class + particle_class;
425 WeaponParticlesOnFire WPOF =
new WeaponParticlesOnFire(
this, config_OnFire_entry);
426 WPOF_array.Insert(WPOF);
436 config_to_search =
"CfgWeapons";
437 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
439 string config_OnBulletCasingEject_class = muzzle_owner_config +
"Particles " +
"OnBulletCasingEject ";
443 if (config_OnBulletCasingEject_count > 0 && IsInherited(
Weapon))
447 for (i = 0; i < config_OnBulletCasingEject_count; i++)
449 string particle_class2 =
"";
451 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
452 WeaponParticlesOnBulletCasingEject WPOBE =
new WeaponParticlesOnBulletCasingEject(
this, config_OnBulletCasingEject_entry);
453 WPOBE_array.Insert(WPOBE);
470 string config_to_search =
"CfgVehicles";
473 config_to_search =
"CfgWeapons";
475 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
476 string config_OnOverheating_class = muzzle_owner_config +
"Particles " +
"OnOverheating ";
478 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
486 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
499 for (
int i = 0; i < config_OnOverheating_subclass_count; i++)
501 string particle_class =
"";
503 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
506 if (entry_type == CT_CLASS)
508 WeaponParticlesOnOverheating WPOF =
new WeaponParticlesOnOverheating(
this, config_OnOverheating_entry);
509 WPOOH_array.Insert(WPOF);
536 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
546 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
549 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
589 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
595 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
602 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
634 for (
int i = count; i > 0; --i)
643 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
745 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(
this);
750 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
752 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
756 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
765 player.GetHumanInventory().ClearUserReservedLocation(
this);
782 return ItemBase.m_DebugActionsMask & mask;
792 ItemBase.m_DebugActionsMask |= mask;
797 ItemBase.m_DebugActionsMask &= ~mask;
815 if (GetEconomyProfile())
817 float q_max = GetEconomyProfile().GetQuantityMax();
820 float q_min = GetEconomyProfile().GetQuantityMin();
844 EntityAI parent = GetHierarchyParent();
849 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
850 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
857 EntityAI parent = GetHierarchyParent();
862 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
863 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
885 ctx.
Write(use_stack_max);
895 else if (!
GetGame().IsMultiplayer())
977 if (!is_being_placed)
1047 super.OnMovedInsideCargo(container);
1049 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(
this, {
Bolt_Base});
1054 super.EEItemLocationChanged(oldLoc,newLoc);
1059 if (newLoc.GetParent())
1060 new_player =
PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
1062 if (oldLoc.GetParent())
1063 old_player =
PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
1067 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(
this);
1072 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
1074 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
1078 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
1082 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
1091 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
1093 if (new_player == old_player)
1096 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
1100 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc,
false,
false,
false,
true,
false,
false))
1102 new_player.GetHumanInventory().SetUserReservedLocation(
this,oldLoc);
1107 new_player.GetHumanInventory().SetUserReservedLocation(
this,oldLoc);
1111 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(
this) >= 0)
1113 int type = oldLoc.GetType();
1116 oldLoc.GetParent().GetOnSetLock().Invoke(
this);
1120 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(
this, oldLoc.GetSlot());
1127 m_OldLocation.Copy(oldLoc);
1133 m_OldLocation.Reset();
1143 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(
this, newLoc);
1147 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
1149 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
1153 il.
GetParent().GetOnReleaseLock().Invoke(it);
1170 m_OldLocation.Reset();
1179 int liquidType = -1;
1181 if (impactSpeed > 0.0)
1195 if (GetCompEM() && GetCompEM().IsPlugged())
1198 GetCompEM().UnplugThis();
1217 super.OnItemLocationChanged(old_owner, new_owner);
1222 if (!relatedPlayer && playerNew)
1223 relatedPlayer = playerNew;
1225 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
1230 ActionBase currentAction = actionMgr.GetRunningAction();
1236 Man ownerPlayerOld = null;
1237 Man ownerPlayerNew = null;
1241 if (old_owner.
IsMan())
1243 ownerPlayerOld = Man.Cast(old_owner);
1247 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
1256 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
1258 GetCompEM().UnplugThis();
1265 if (new_owner.
IsMan())
1267 ownerPlayerNew = Man.Cast(new_owner);
1271 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
1275 if (ownerPlayerOld != ownerPlayerNew)
1281 for (
int i = 0; i < subItemsExit.Count(); i++)
1292 for (
int j = 0; j < subItemsEnter.Count(); j++)
1299 else if (ownerPlayerNew != null)
1302 if (
PlayerBase.CastTo(nplayer, ownerPlayerNew))
1306 for (
int k = 0; k < subItemsUpdate.Count(); k++)
1309 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
1315 old_owner.OnChildItemRemoved(
this);
1317 new_owner.OnChildItemReceived(
this);
1323 super.EEDelete(parent);
1329 if (player.IsAlive())
1331 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(
this);
1335 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
1337 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
1341 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
1345 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
1350 player.RemoveQuickBarEntityShortcut(
this);
1357 super.EEKilled(killer);
1366 if (Magazine.Cast(
this).GetAmmoCount() > 0)
1381 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(
this, {
Bolt_Base});
1383 super.OnWasAttached(parent, slot_id);
1393 super.OnWasDetached(parent, slot_id);
1405 ConfigGetTextArray(
"ChangeInventorySlot",inventory_slots);
1406 if (inventory_slots.Count() < 1)
1408 inventory_slots.Insert(ConfigGetString(
"ChangeInventorySlot"));
1409 attach_types.Insert(ConfigGetString(
"ChangeIntoOnAttach"));
1413 ConfigGetTextArray(
"ChangeIntoOnAttach",attach_types);
1416 idx = inventory_slots.Find(slot);
1420 return attach_types.Get(idx);
1431 this.ConfigGetTextArray(
"ChangeInventorySlot",inventory_slots);
1432 if (inventory_slots.Count() < 1)
1434 inventory_slots.Insert(this.ConfigGetString(
"ChangeInventorySlot"));
1435 detach_types.Insert(this.ConfigGetString(
"ChangeIntoOnDetach"));
1439 this.ConfigGetTextArray(
"ChangeIntoOnDetach",detach_types);
1440 if (detach_types.Count() < 1)
1441 detach_types.Insert(this.ConfigGetString(
"ChangeIntoOnDetach"));
1444 for (
int i = 0; i < inventory_slots.Count(); i++)
1446 slot = inventory_slots.Get(i);
1451 if (detach_types.Count() == 1)
1454 idx = inventory_slots.Find(slot);
1459 return detach_types.Get(idx);
1472 explode_timer.Run(delay,
this,
"DoAmmoExplosion");
1477 Magazine magazine = Magazine.Cast(
this);
1478 int pop_sounds_count = 6;
1479 string pop_sounds[ 6 ] = {
"ammopops_1",
"ammopops_2",
"ammopops_3",
"ammopops_4",
"ammopops_5",
"ammopops_6" };
1483 string sound_name = pop_sounds[ sound_idx ];
1487 magazine.ServerAddAmmoCount(-1);
1490 float min_temp_to_explode = 100;
1492 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
1501 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
1503 const int CHANCE_DAMAGE_CARGO = 4;
1504 const int CHANCE_DAMAGE_ATTACHMENT = 1;
1505 const int CHANCE_DAMAGE_NOTHING = 2;
1509 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
1513 if (GetInventory().GetCargo())
1515 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
1518 if (rnd < CHANCE_DAMAGE_CARGO)
1522 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
1529 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
1532 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
1542 if (GetInventory().GetCargo())
1544 int item_count = GetInventory().GetCargo().GetItemCount();
1549 if (!item.IsExplosive())
1551 item.AddHealth(
"",
"",damage);
1561 int attachment_count = GetInventory().AttachmentCount();
1562 if (attachment_count > 0)
1565 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
1566 if (!attachment.IsExplosive())
1568 attachment.AddHealth(
"",
"",damage);
1583 return GetInventory().CanRemoveEntity();
1602 ctx.
Write(destination_entity);
1608 else if (!
GetGame().IsMultiplayer())
1619 float split_quantity_new;
1628 split_quantity_new = stack_max;
1632 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
1635 new_item.SetResultOfSplit(
true);
1636 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1638 new_item.SetQuantity(split_quantity_new);
1641 else if (destination_entity && slot_id == -1)
1643 if (quantity > stack_max)
1644 split_quantity_new = stack_max;
1646 split_quantity_new = quantity;
1656 new_item.SetResultOfSplit(
true);
1657 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1659 new_item.SetQuantity(split_quantity_new);
1671 if (split_quantity_new == 0)
1673 if (!
GetGame().IsMultiplayer())
1674 player.PhysicalPredictiveDropItem(
this);
1676 player.ServerDropEntity(
this);
1684 new_item.SetResultOfSplit(
true);
1685 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1687 new_item.SetQuantity(stack_max);
1688 new_item.PlaceOnSurface();
1699 float split_quantity_new;
1708 split_quantity_new = stack_max;
1712 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
1715 new_item.SetResultOfSplit(
true);
1716 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1718 new_item.SetQuantity(split_quantity_new);
1721 else if (destination_entity && slot_id == -1)
1723 if (quantity > stack_max)
1724 split_quantity_new = stack_max;
1726 split_quantity_new = quantity;
1736 new_item.SetResultOfSplit(
true);
1737 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1739 new_item.SetQuantity(split_quantity_new);
1755 new_item.SetResultOfSplit(
true);
1756 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1758 new_item.SetQuantity(stack_max);
1759 new_item.PlaceOnSurface();
1779 dst.WriteToContext(ctx);
1783 else if (!
GetGame().IsMultiplayer())
1803 ctx.
Write(destination_entity);
1811 else if (!
GetGame().IsMultiplayer())
1828 float split_quantity_new;
1832 int slot_id = dst.GetSlot();
1835 if (quantity > stack_max)
1836 split_quantity_new = stack_max;
1838 split_quantity_new = quantity;
1844 new_item.SetResultOfSplit(
true);
1845 MiscGameplayFunctions.TransferItemProperties(
this,new_item);
1862 float split_quantity_new;
1864 if (destination_entity)
1867 if (quantity > stackable)
1868 split_quantity_new = stackable;
1870 split_quantity_new = quantity;
1872 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
1875 new_item.SetResultOfSplit(
true);
1876 MiscGameplayFunctions.TransferItemProperties(
this,new_item);
1878 new_item.SetQuantity(split_quantity_new);
1897 ItemBase destination_entity =
this;
1898 ctx.
Write(destination_entity);
1904 else if (!
GetGame().IsMultiplayer())
1916 float split_quantity_new;
1921 if (quantity > stackable)
1922 split_quantity_new = stackable;
1924 split_quantity_new = quantity;
1926 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
1927 new_item =
ItemBase.Cast(in_hands);
1930 new_item.SetResultOfSplit(
true);
1931 MiscGameplayFunctions.TransferItemProperties(
this,new_item);
1933 new_item.SetQuantity(split_quantity_new);
1944 float split_quantity_new =
Math.
Floor(quantity * 0.5);
1950 if (new_item.GetQuantityMax() < split_quantity_new)
1952 split_quantity_new = new_item.GetQuantityMax();
1955 new_item.SetResultOfSplit(
true);
1956 MiscGameplayFunctions.TransferItemProperties(
this, new_item);
1977 float split_quantity_new =
Math.
Floor(quantity / 2);
1983 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(
this,
true);
1987 if (new_item.GetQuantityMax() < split_quantity_new)
1989 split_quantity_new = new_item.GetQuantityMax();
2011 parent.OnAttachmentQuantityChangedEx(
this, delta);
2021 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
2042 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
2049 EntityAI parent = GetHierarchyParent();
2050 if (parent && parent.IsFireplace())
2052 CargoBase cargo = GetInventory().GetCargo();
2070 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
2080 super.OnRightClick();
2091 EntityAI root = GetHierarchyRoot();
2098 root.GetTransform(m4);
2102 GetInventory().GetCurrentInventoryLocation(dst);
2109 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
2113 root.GetTransform(m4);
2117 GetInventory().GetCurrentInventoryLocation(dst);
2135 else if (!
GetGame().IsMultiplayer())
2145 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
2156 Magazine mag = Magazine.Cast(
this);
2159 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
2162 if (stack_max_limit)
2164 Magazine other_mag = Magazine.Cast(other_item);
2167 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
2184 if (CastTo(player, GetHierarchyRootPlayer()))
2186 if (player.GetInventory().HasAttachment(
this))
2189 if (player.IsItemsToDelete())
2193 if (reservation_check && (GetInventory().HasInventoryReservation(
this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
2198 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
2211 return m_IsResultOfSplit;
2216 m_IsResultOfSplit = value;
2226 float other_item_quantity = other_item.GetQuantity();
2227 float this_free_space;
2233 if (other_item_quantity > this_free_space)
2235 return this_free_space;
2239 return other_item_quantity;
2253 if (!IsMagazine() && other_item)
2256 if (quantity_used != 0)
2258 float hp1 = GetHealth01(
"",
"");
2259 float hp2 = other_item.GetHealth01(
"",
"");
2260 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
2261 hpResult = hpResult / (
GetQuantity() + quantity_used);
2263 hpResult *= GetMaxHealth();
2265 SetHealth(
"",
"Health", hpResult);
2268 other_item.AddQuantity(-quantity_used);
2277 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
2278 GetHierarchyParent().IncreaseLifetimeUp();
2287 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
2288 if (moduleRecipesManager)
2291 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
2294 for (
int i = 0;i < recipesIds.Count(); i++)
2296 int key = recipesIds.Get(i);
2297 string recipeName = moduleRecipesManager.GetRecipeName(key);
2305 super.GetDebugActions(outputList);
2348 super.OnAction(action_id, player, ctx);
2349 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
2351 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
2352 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
2354 if (
EActions.RECIPES_RANGE_START < 1000)
2356 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
2357 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
2361 else if (action_id ==
EActions.WATCH_PLAYER)
2363 PluginDeveloper.SetDeveloperItemClientEx(player);
2368 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
2370 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
2371 OnDebugButtonPressServer(
id + 1);
2374 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
2376 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
2380 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
2382 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
2386 else if (action_id ==
EActions.ADD_QUANTITY)
2390 Magazine mag = Magazine.Cast(
this);
2391 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
2400 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
2405 else if (action_id ==
EActions.REMOVE_QUANTITY)
2409 Magazine mag2 = Magazine.Cast(
this);
2410 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
2418 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
2423 else if (action_id ==
EActions.SET_QUANTITY_0)
2433 else if (action_id ==
EActions.SET_MAX_QUANTITY)
2439 m_EM.SetEnergy(m_EM.GetEnergyMax());
2443 else if (action_id ==
EActions.ADD_HEALTH)
2445 AddHealth(
"",
"",GetMaxHealth(
"",
"Health")/5);
2447 else if (action_id ==
EActions.REMOVE_HEALTH)
2449 AddHealth(
"",
"",-GetMaxHealth(
"",
"Health")/5);
2451 else if (action_id ==
EActions.DESTROY_HEALTH)
2453 SetHealth01(
"",
"",0);
2455 else if (action_id ==
EActions.WATCH_ITEM)
2460 SetDebugDeveloper_item(
this);
2464 else if (action_id ==
EActions.ADD_TEMPERATURE)
2470 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
2472 AddTemperature(-20);
2476 else if (action_id ==
EActions.FLIP_FROZEN)
2478 SetFrozen(!GetIsFrozen());
2482 else if (action_id ==
EActions.ADD_WETNESS)
2488 else if (action_id ==
EActions.REMOVE_WETNESS)
2494 else if (action_id ==
EActions.LIQUIDTYPE_UP)
2502 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
2508 else if (action_id ==
EActions.MAKE_SPECIAL)
2510 auto debugParams = DebugSpawnParams.WithPlayer(player);
2511 OnDebugSpawnEx(debugParams);
2514 else if (action_id ==
EActions.DELETE)
2558 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
2585 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
2586 return module_repairing.CanRepair(
this, item_repair_kit);
2592 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
2593 return module_repairing.Repair(player,
this, item_repair_kit, specialty_weight);
2638 player.MessageStatus(text);
2656 player.MessageAction(text);
2674 player.MessageFriendly(text);
2692 player.MessageImportant(text);
2705 string item_name = this.
GetType();
2709 int array_size = item_tag_array.Count();
2710 for (
int i = 0; i < array_size; i++)
2712 if (item_tag_array.Get(i) == tag)
2725 super.OnRPC(sender, rpc_type,ctx);
2731 case ERPCs.RPC_SOUND_LOCK_ATTACH:
2737 bool play = p.param1;
2738 string soundSet = p.param2;
2775 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
2776 return plugin.GetID(
name);
2781 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
2782 return plugin.GetName(
id);
2791 if (!ctx.
Read(varFlags))
2803 super.SerializeNumericalVars(floats_out);
2839 super.DeSerializeNumericalVars(floats);
2843 int mask =
Math.
Round(floats.Get(index));
2855 float quantity = floats.Get(index);
2863 float wet = floats.Get(index);
2870 int liquidtype =
Math.
Round(floats.Get(index));
2889 int cleanness =
Math.
Round(floats.Get(index));
2897 super.WriteVarsToCTX(ctx);
2933 if (!super.ReadVarsFromCTX(ctx,version))
2941 if (!ctx.
Read(intValue))
2944 m_VariablesMask = intValue;
2949 if (!ctx.
Read(value))
2966 if (!ctx.
Read(value))
2968 SetTemperatureDirect(value);
2974 if (!ctx.
Read(value))
2981 if (!ctx.
Read(intValue))
3003 if (!ctx.
Read(intValue))
3008 if (version >= 138 && version < 140)
3012 if (!ctx.
Read(intValue))
3014 SetFrozen(intValue);
3030 if (!super.OnStoreLoad(ctx, version))
3038 bool hasQuickBarIndexSaved;
3040 if (!ctx.
Read(hasQuickBarIndexSaved))
3046 if (hasQuickBarIndexSaved)
3051 if (!ctx.
Read(itmQBIndex))
3058 if (itmQBIndex != -1 && parentPlayer)
3059 parentPlayer.SetLoadedQuickBarItemBind(
this, itmQBIndex);
3067 if (version ==
int.
MAX)
3069 if (!ctx.
Read(itemQBIndex))
3075 else if (
Class.
CastTo(player, GetHierarchyRootPlayer()))
3078 if (!ctx.
Read(itemQBIndex))
3083 if (itemQBIndex != -1 && player)
3084 player.SetLoadedQuickBarItemBind(
this,itemQBIndex);
3091 if (!LoadVariables(ctx, version))
3125 super.OnStoreSave(ctx);
3128 if (
PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
3132 int itemQBIndex = -1;
3133 itemQBIndex = player.FindQuickBarEntityIndex(
this);
3134 ctx.
Write(itemQBIndex);
3153 super.AfterStoreLoad();
3169 super.EEOnAfterLoad();
3191 #ifdef PLATFORM_CONSOLE
3232 super.OnVariablesSynchronized();
3238 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
3240 if (!IsServerCheck(allow_client))
3249 if (value <= (min + 0.001))
3256 bool dstr = ConfigGetBool(
"varQuantityDestroyOnMin");
3264 else if (destroy_forced)
3292 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
3312 float value_clamped =
Math.
Clamp(value, 0, 1);
3314 SetQuantity(result, destroy_config, destroy_forced);
3344 GetInventory().GetCurrentInventoryLocation(il);
3353 float quantity_max = 0;
3357 if (attSlotID != -1)
3360 if (quantity_max <= 0)
3364 if (quantity_max <= 0)
3367 return quantity_max;
3400 float weightEx = GetWeightEx();
3401 float special = GetInventoryAndCargoWeight();
3402 return weightEx - special;
3416 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
3425 else if (HasEnergyManager())
3428 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
3431 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
3434 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
3439 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
3442 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
3445 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
3455 if (GetInventory().GetCargo() != NULL)
3457 item_count = GetInventory().GetCargo().GetItemCount();
3460 for (
int i = 0; i < GetInventory().AttachmentCount(); i++)
3462 Class.
CastTo(item,GetInventory().GetAttachmentFromIndex(i));
3464 item_count += item.GetNumberOfItems();
3474 if (include_wetness)
3478 weight = wetness * m_ConfigWeight;
3491 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
3496 for (
int i = 0; i < items.Count(); i++)
3513 if (HasEnergyManager())
3515 energy = GetCompEM().GetEnergy();
3523 super.OnEnergyConsumed();
3530 super.OnEnergyAdded();
3538 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
3542 float energy_0to1 = GetCompEM().GetEnergy0To1();
3551 return ConfigGetFloat(
"heatIsolation");
3561 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
3562 if (
GetGame().ConfigIsExisting(paramPath))
3570 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
3571 if (
GetGame().ConfigIsExisting(paramPath))
3577 override void SetWet(
float value,
bool allow_client =
false)
3579 if (!IsServerCheck(allow_client))
3630 if (newLevel != oldLevel)
3643 return GetWetLevelInternal(
m_VarWet);
3672 if (ConfigIsExisting(
"itemModelLength"))
3674 return ConfigGetFloat(
"itemModelLength");
3681 if (ConfigIsExisting(
"itemAttachOffset"))
3683 return ConfigGetFloat(
"itemAttachOffset");
3690 if (!IsServerCheck(allow_client))
3736 override void GetColor(out
int r,out
int g,out
int b,out
int a)
3758 return MiscGameplayFunctions.GetColorString(r, g, b, a);
3765 if (!IsServerCheck(allow_client))
3776 return ConfigGetInt(
"varLiquidTypeInit");
3793 player.SetEnableQuickBarEntityShortcut(
this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
3805 nplayer.SetEnableQuickBarEntityShortcut(
this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
3817 nplayer.SetEnableQuickBarEntityShortcut(
this,
false);
3822 player.GetHumanInventory().ClearUserReservedLocationForContainer(
this);
3825 if (HasEnergyManager())
3827 GetCompEM().UpdatePlugState();
3834 super.OnPlacementStarted(player);
3843 m_AdminLog.OnPlacementComplete(player,
this);
3846 super.OnPlacementComplete(player, position, orientation);
3963 super.CheckForRoofLimited(timeTresholdMS);
3966 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
3968 m_PreviousRoofTestTime = time;
3969 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(
this));
3981 if (GetInventory().GetAttachmentSlotsCount() != 0)
3983 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
3985 return filter.GetProtectionLevel(type,
false, system);
3990 string subclassPath, entryName;
3995 entryName =
"biological";
3998 entryName =
"chemical";
4001 entryName =
"biological";
4005 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
4049 if (!parent.IsRuined())
4058 if (!super.CanPutAsAttachment(parent))
4063 if (!IsRuined() && !parent.IsRuined())
4077 return super.CanReceiveItemIntoCargo(item);
4089 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(
PlayerBase))
4094 attachment.GetInventory().GetCurrentInventoryLocation(loc);
4095 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
4098 return super.CanReceiveAttachment(attachment, slotId);
4103 if (!super.CanReleaseAttachment(attachment))
4106 return GetInventory().AreChildrenAccessible();
4131 int id = muzzle_owner.GetMuzzleID();
4136 for (
int i = 0; i < WPOF_array.Count(); i++)
4138 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
4142 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
4151 int id = muzzle_owner.GetMuzzleID();
4156 for (
int i = 0; i < WPOBE_array.Count(); i++)
4158 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
4162 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
4171 int id = muzzle_owner.GetMuzzleID();
4176 for (
int i = 0; i < WPOOH_array.Count(); i++)
4178 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
4182 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
4191 int id = muzzle_owner.GetMuzzleID();
4196 for (
int i = 0; i < WPOOH_array.Count(); i++)
4198 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
4202 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
4211 int id = muzzle_owner.GetMuzzleID();
4216 for (
int i = 0; i < WPOOH_array.Count(); i++)
4218 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
4222 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
4294 string att_type =
"None";
4296 if (ConfigIsExisting(
"soundAttType"))
4298 att_type = ConfigGetString(
"soundAttType");
4384 if (!
GetGame().IsDedicatedServer())
4386 if (ConfigIsExisting(
"attachSoundSet"))
4388 string cfg_path =
"";
4389 string soundset =
"";
4394 ConfigGetTextArray(
"attachSoundSet",cfg_soundset_array);
4395 ConfigGetTextArray(
"attachSoundSlot",cfg_slot_array);
4397 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
4399 for (
int i = 0; i < cfg_soundset_array.Count(); i++)
4401 if (cfg_slot_array[i] == slot_type)
4403 soundset = cfg_soundset_array[i];
4444 SetDynamicPhysicsLifeTime(0.01);
4451 GetDamageZones(zone_names);
4452 for (
int i = 0; i < zone_names.Count(); i++)
4454 SetHealthMax(zone_names.Get(i),
"Health");
4456 SetHealthMax(
"",
"Health");
4462 float global_health = GetHealth01(
"",
"Health");
4464 GetDamageZones(zones);
4466 for (
int i = 0; i < zones.Count(); i++)
4468 SetHealth01(zones.Get(i),
"Health",global_health);
4475 return IsExclusionFlagPresent(
PlayerBase.GetFaceCoverageShaveValues());
4480 if (!hasRootAsPlayer)
4488 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
4507 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
4508 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
4510 float heatPermCoef = 1.0;
4514 heatPermCoef *= ent.GetHeatPermeabilityCoef();
4515 ent = ent.GetHierarchyParent();
4526 EntityAI parent = GetHierarchyParent();
4530 hasRootAsPlayer =
false;
4535 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
4536 refParentIB =
ItemBase.Cast(parent);
4567 return !GetIsFrozen() &&
IsOpen();
4572 bool hasParent =
false, hasRootAsPlayer =
false;
4575 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
4576 bool foodDecay =
g_Game.IsFoodDecayEnabled();
4578 if (wwtu || foodDecay)
4584 if (processWetness || processTemperature || processDecay)
4589 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
4591 if (processTemperature)
4595 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
4611 return super.GetTemperatureFreezeThreshold();
4619 return super.GetTemperatureThawThreshold();
4627 return super.GetItemOverheatThreshold();
4635 return super.GetTemperatureFreezeTime();
4643 return super.GetTemperatureThawTime();
4653 return (item.IsKindOf(
"Cauldron") || item.IsKindOf(
"Pot") || item.IsKindOf(
"FryingPan") || item.IsKindOf(
"SmallProtectorCase") || (item.IsKindOf(
"PortableGasStove") && item.FindAttachmentBySlotName(
"CookingEquipment")));
4658 MiscGameplayFunctions.TransferItemProperties(oldItem,
this);
4701 explosive.PairRemote(trg);
4705 trg.SetPersistentPairID(persistentID);
4706 explosive.SetPersistentPairID(persistentID);
4719 ret *= GetHealth01();
4725 override void SetDebugItem()
4727 super.SetDebugItem();
4733 string text = super.GetDebugText();
4736 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
4789 if (is_item && full_quantity)
4808 item.SetHealth(
"",
"", health);
4810 if (item.CanHaveTemperature())
4813 if (item.CanFreeze())
4814 item.SetFrozen(
false);
4817 if (item.HasEnergyManager())
4821 item.GetCompEM().SetEnergy0To1(quantity);
4828 else if (item.IsMagazine())
4830 Magazine mag = Magazine.Cast(item);
4833 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
4845 item.SetQuantityNormalized(quantity,
false);
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
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 CanHaveTemperature()
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)
bool LoadAgents(ParamsReadContext ctx, int version)
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
override float 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()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
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)
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...
bool IsOverheatingEffectActive()
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)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
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 HumanInventory GetHumanInventory()
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
script counterpart to engine's class Inventory
proto native EntityAI GetEntityInHands()
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()
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)
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
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
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)
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)
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
string GetDeploySoundset()
void PlayDetachSound(string slot_type)
void SetCEBasedQuantity()
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
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
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
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
static proto native bool IsSlotIdValid(int slotId)
verifies existence of the slot id
static proto native int GetStackMaxForSlotId(int slot_Id)
static proto native owned string GetSlotName(int id)
converts slot_id to string
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 void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, 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)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
const float DEFAULT_DEPLOY
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
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
proto native CGame GetGame()
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
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
class JsonUndergroundAreaTriggerData GetPosition
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.