4984{
4986 {
4987 return true;
4988 }
4989};
4990
4991
4992
4994{
4998
5000
5003
5004
5005
5006
5007
5016
5022
5027
5032
5053 protected bool m_IsResultOfSplit
5054
5056
5061
5062
5063
5065
5069
5070
5071
5073
5076
5077
5078
5084
5085
5093
5096
5097
5099
5100
5102
5103
5108
5109
5114
5115
5117
5118
5120 {
5125
5126 if (!
GetGame().IsDedicatedServer())
5127 {
5129 {
5131
5133 {
5135 }
5136 }
5137
5140 }
5141
5142 m_OldLocation = null;
5143
5145 {
5147 }
5148
5149 if (ConfigIsExisting("headSelectionsToHide"))
5150 {
5153 }
5154
5156 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5157 {
5159 }
5160
5162
5163 m_IsResultOfSplit = false;
5164
5166 }
5167
5169 {
5170 super.InitItemVariables();
5171
5177 m_Count = ConfigGetInt(
"count");
5178
5181
5186
5189
5194
5206
5210
5211
5214 if (ConfigIsExisting("canBeSplit"))
5215 {
5218 }
5219
5221 if (ConfigIsExisting("itemBehaviour"))
5223
5224
5227 RegisterNetSyncVariableInt("m_VarLiquidType");
5228 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5229
5230 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5231 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5232 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5233
5234 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5235 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5236 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5237 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5238
5239 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5240 RegisterNetSyncVariableBool("m_IsTakeable");
5241 RegisterNetSyncVariableBool("m_IsHologram");
5242
5245 {
5248 }
5249
5251
5253 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5255
5256 }
5257
5259 {
5261 }
5262
5264 {
5267 {
5272 }
5273 }
5274
5275 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5276 {
5278 {
5281 }
5282
5284 }
5285
5287 {
5293 }
5294
5296
5298 {
5300
5301 if (!action)
5302 {
5303 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5304 return;
5305 }
5306
5308 if (!ai)
5309 {
5311 return;
5312 }
5313
5315 if (!action_array)
5316 {
5317 action_array = new array<ActionBase_Basic>;
5319 }
5320 if (LogManager.IsActionLogEnable())
5321 {
5322 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5323 }
5324
5325 if (action_array.Find(action) != -1)
5326 {
5327 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5328 }
5329 else
5330 {
5331 action_array.Insert(action);
5332 }
5333 }
5334
5336 {
5338 ActionBase action = player.GetActionManager().GetAction(actionName);
5341
5342 if (action_array)
5343 {
5344 action_array.RemoveItem(action);
5345 }
5346 }
5347
5348
5349
5351 {
5352 ActionOverrideData overrideData = new ActionOverrideData();
5356
5358 if (!actionMap)
5359 {
5362 }
5363
5364 actionMap.Insert(this.
Type(), overrideData);
5365
5366 }
5367
5369
5371
5372
5374 {
5377
5380
5381 string config_to_search = "CfgVehicles";
5382 string muzzle_owner_config;
5383
5385 {
5386 if (IsInherited(Weapon))
5387 config_to_search = "CfgWeapons";
5388
5389 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5390
5391 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5392
5394
5395 if (config_OnFire_subclass_count > 0)
5396 {
5397 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5398
5399 for (int i = 0; i < config_OnFire_subclass_count; i++)
5400 {
5401 string particle_class = "";
5403 string config_OnFire_entry = config_OnFire_class + particle_class;
5404 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5405 WPOF_array.Insert(WPOF);
5406 }
5407
5408
5410 }
5411 }
5412
5414 {
5415 config_to_search = "CfgWeapons";
5416 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5417
5418 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5419
5421
5422 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5423 {
5424 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5425
5426 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5427 {
5428 string particle_class2 = "";
5430 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5431 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5432 WPOBE_array.Insert(WPOBE);
5433 }
5434
5435
5437 }
5438 }
5439 }
5440
5441
5443 {
5446
5448 {
5449 string config_to_search = "CfgVehicles";
5450
5451 if (IsInherited(Weapon))
5452 config_to_search = "CfgWeapons";
5453
5454 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5455 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5456
5457 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5458 {
5459
5461
5463 {
5465 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5467 return;
5468 }
5469
5472
5473
5474
5476 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5477
5478 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5479 {
5480 string particle_class = "";
5482 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5484
5485 if (entry_type == CT_CLASS)
5486 {
5487 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5488 WPOOH_array.Insert(WPOF);
5489 }
5490 }
5491
5492
5494 }
5495 }
5496 }
5497
5499 {
5501 }
5502
5504 {
5506 {
5508
5511
5514
5515 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5516 }
5517 }
5518
5520 {
5522 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5523
5525 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5526
5528 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5529
5531 {
5533 }
5534 }
5535
5537 {
5539 }
5540
5542 {
5545 else
5547
5549 {
5552 }
5553 else
5554 {
5557
5560 }
5561
5563 }
5564
5566 {
5568 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5569 }
5570
5572 {
5574 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5576 }
5577
5579 {
5581 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5582 }
5583
5585 {
5588
5589 OverheatingParticle OP = new OverheatingParticle();
5594
5596 }
5597
5599 {
5602
5603 return -1;
5604 }
5605
5607 {
5609 {
5612
5613 for (int i = count; i > 0; --i)
5614 {
5615 int id = i - 1;
5618
5621
5622 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
5623 {
5624 if (p)
5625 {
5628 }
5629 }
5630 }
5631 }
5632 }
5633
5635 {
5637 {
5639 {
5640 int id = i - 1;
5642
5643 if (OP)
5644 {
5646
5647 if (p)
5648 {
5650 }
5651
5652 delete OP;
5653 }
5654 }
5655
5658 }
5659 }
5660
5663 {
5664 return 0.0;
5665 }
5666
5667
5669 {
5670 return 250;
5671 }
5672
5674 {
5675 return 0;
5676 }
5677
5680 {
5682 return true;
5683
5684 return false;
5685 }
5686
5689 {
5692
5694 {
5696 }
5697 else
5698 {
5699
5701 }
5702
5704 }
5705
5712 {
5713 return -1;
5714 }
5715
5716
5717
5718
5720 {
5722 {
5724 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
5725
5726 if (r_index >= 0)
5727 {
5728 InventoryLocation r_il = new InventoryLocation;
5729 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
5730
5731 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
5734 {
5735 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
5736 }
5738 {
5739 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
5740 }
5741
5742 }
5743
5744 player.GetHumanInventory().ClearUserReservedLocation(this);
5745 }
5746
5749 }
5750
5751
5752
5753
5755 {
5756 return ItemBase.m_DebugActionsMask;
5757 }
5758
5760 {
5761 return ItemBase.m_DebugActionsMask & mask;
5762 }
5763
5765 {
5766 ItemBase.m_DebugActionsMask = mask;
5767 }
5768
5770 {
5771 ItemBase.m_DebugActionsMask |= mask;
5772 }
5773
5775 {
5776 ItemBase.m_DebugActionsMask &= ~mask;
5777 }
5778
5780 {
5782 {
5784 }
5785 else
5786 {
5788 }
5789 }
5790
5791
5793 {
5794 if (GetEconomyProfile())
5795 {
5796 float q_max = GetEconomyProfile().GetQuantityMax();
5797 if (q_max > 0)
5798 {
5799 float q_min = GetEconomyProfile().GetQuantityMin();
5800 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
5801
5803 {
5804 ComponentEnergyManager comp = GetCompEM();
5806 {
5808 }
5809 }
5811 {
5813
5814 }
5815
5816 }
5817 }
5818 }
5819
5822 {
5823 EntityAI parent = GetHierarchyParent();
5824
5825 if (parent)
5826 {
5827 InventoryLocation inventory_location_to_lock = new InventoryLocation;
5828 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
5829 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
5830 }
5831 }
5832
5835 {
5836 EntityAI parent = GetHierarchyParent();
5837
5838 if (parent)
5839 {
5840 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
5841 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
5842 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
5843 }
5844 }
5845
5847 {
5848
5849
5850
5851
5853
5855 {
5856 if (ScriptInputUserData.CanStoreInputUserData())
5857 {
5858 ScriptInputUserData ctx = new ScriptInputUserData;
5864 ctx.
Write(use_stack_max);
5867
5869 {
5870 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
5871 }
5872 }
5873 }
5874 else if (!
GetGame().IsMultiplayer())
5875 {
5877 }
5878 }
5879
5881 {
5883 }
5884
5886 {
5888 }
5889
5891 {
5893 }
5894
5896 {
5897
5898 return false;
5899 }
5900
5902 {
5903 return false;
5904 }
5905
5909 {
5910 return false;
5911 }
5912
5914 {
5915 return "";
5916 }
5917
5919
5921 {
5922 return false;
5923 }
5924
5926 {
5927 return true;
5928 }
5929
5930
5931
5933 {
5934 return true;
5935 }
5936
5938 {
5939 return true;
5940 }
5941
5943 {
5944 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
5946 }
5947
5949 {
5951 }
5952
5954 {
5956 if (!is_being_placed)
5958 SetSynchDirty();
5959 }
5960
5961
5963
5965 {
5967 }
5968
5970 {
5972 }
5973
5975 {
5976 return 1;
5977 }
5978
5980 {
5981 return false;
5982 }
5983
5985 {
5987 SetSynchDirty();
5988 }
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6025 {
6026 super.OnMovedInsideCargo(container);
6027
6028 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6029 }
6030
6031 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6032 {
6033 super.EEItemLocationChanged(oldLoc,newLoc);
6034
6035 PlayerBase new_player = null;
6036 PlayerBase old_player = null;
6037
6038 if (newLoc.GetParent())
6039 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6040
6041 if (oldLoc.GetParent())
6042 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6043
6045 {
6046 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6047
6048 if (r_index >= 0)
6049 {
6050 InventoryLocation r_il = new InventoryLocation;
6051 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6052
6053 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6056 {
6057 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6058 }
6060 {
6061 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6062 }
6063
6064 }
6065 }
6066
6068 {
6069 if (new_player)
6070 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6071
6072 if (new_player == old_player)
6073 {
6074
6075 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6076 {
6078 {
6079 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6080 {
6081 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6082 }
6083 }
6084 else
6085 {
6086 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6087 }
6088 }
6089
6090 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6091 {
6092 int type = oldLoc.GetType();
6094 {
6095 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6096 }
6098 {
6099 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6100 }
6101 }
6102 if (!m_OldLocation)
6103 {
6104 m_OldLocation = new InventoryLocation;
6105 }
6106 m_OldLocation.Copy(oldLoc);
6107 }
6108 else
6109 {
6110 if (m_OldLocation)
6111 {
6112 m_OldLocation.Reset();
6113 }
6114 }
6115
6117 }
6118 else
6119 {
6120 if (new_player)
6121 {
6122 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6123 if (res_index >= 0)
6124 {
6125 InventoryLocation il = new InventoryLocation;
6126 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6128 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6131 {
6132 il.
GetParent().GetOnReleaseLock().Invoke(it);
6133 }
6135 {
6137 }
6138
6139 }
6140 }
6142 {
6143
6145 }
6146
6147 if (m_OldLocation)
6148 {
6149 m_OldLocation.Reset();
6150 }
6151 }
6152 }
6153
6154 override void EOnContact(IEntity other, Contact extra)
6155 {
6157 {
6158 int liquidType = -1;
6160 if (impactSpeed > 0.0)
6161 {
6163 #ifndef SERVER
6165 #else
6167 SetSynchDirty();
6168 #endif
6170 }
6171 }
6172
6173 #ifdef SERVER
6174 if (GetCompEM() && GetCompEM().IsPlugged())
6175 {
6176 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6177 GetCompEM().UnplugThis();
6178 }
6179 #endif
6180 }
6181
6183
6185 {
6187 }
6188
6190 {
6191
6192 }
6193
6195 {
6196 super.OnItemLocationChanged(old_owner, new_owner);
6197
6198 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6199 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6200
6201 if (!relatedPlayer && playerNew)
6202 relatedPlayer = playerNew;
6203
6204 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6205 {
6207 if (actionMgr)
6208 {
6209 ActionBase currentAction = actionMgr.GetRunningAction();
6210 if (currentAction)
6212 }
6213 }
6214
6215 Man ownerPlayerOld = null;
6216 Man ownerPlayerNew = null;
6217
6218 if (old_owner)
6219 {
6220 if (old_owner.
IsMan())
6221 {
6222 ownerPlayerOld = Man.Cast(old_owner);
6223 }
6224 else
6225 {
6226 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6227 }
6228 }
6229 else
6230 {
6232 {
6234
6235 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6236 {
6237 GetCompEM().UnplugThis();
6238 }
6239 }
6240 }
6241
6242 if (new_owner)
6243 {
6244 if (new_owner.
IsMan())
6245 {
6246 ownerPlayerNew = Man.Cast(new_owner);
6247 }
6248 else
6249 {
6250 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6251 }
6252 }
6253
6254 if (ownerPlayerOld != ownerPlayerNew)
6255 {
6256 if (ownerPlayerOld)
6257 {
6258 array<EntityAI> subItemsExit = new array<EntityAI>;
6260 for (int i = 0; i < subItemsExit.Count(); i++)
6261 {
6264 }
6265 }
6266
6267 if (ownerPlayerNew)
6268 {
6269 array<EntityAI> subItemsEnter = new array<EntityAI>;
6271 for (int j = 0; j < subItemsEnter.Count(); j++)
6272 {
6275 }
6276 }
6277 }
6278 else if (ownerPlayerNew != null)
6279 {
6280 PlayerBase nplayer;
6281 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6282 {
6283 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6285 for (int k = 0; k < subItemsUpdate.Count(); k++)
6286 {
6288 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6289 }
6290 }
6291 }
6292
6293 if (old_owner)
6294 old_owner.OnChildItemRemoved(this);
6295 if (new_owner)
6296 new_owner.OnChildItemReceived(this);
6297 }
6298
6299
6301 {
6302 super.EEDelete(parent);
6303 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6304 if (player)
6305 {
6307
6308 if (player.IsAlive())
6309 {
6310 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6311 if (r_index >= 0)
6312 {
6313 InventoryLocation r_il = new InventoryLocation;
6314 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6315
6316 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6319 {
6320 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6321 }
6323 {
6324 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6325 }
6326
6327 }
6328
6329 player.RemoveQuickBarEntityShortcut(this);
6330 }
6331 }
6332 }
6333
6335 {
6336 super.EEKilled(killer);
6337
6340 {
6341 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6342 {
6343 if (IsMagazine())
6344 {
6345 if (Magazine.Cast(this).GetAmmoCount() > 0)
6346 {
6348 }
6349 }
6350 else
6351 {
6353 }
6354 }
6355 }
6356 }
6357
6359 {
6360 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6361
6362 super.OnWasAttached(parent, slot_id);
6363
6366
6368 }
6369
6371 {
6372 super.OnWasDetached(parent, slot_id);
6373
6376 }
6377
6379 {
6380 int idx;
6383
6384 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6385 if (inventory_slots.Count() < 1)
6386 {
6387 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6388 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6389 }
6390 else
6391 {
6392 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6393 }
6394
6395 idx = inventory_slots.Find(slot);
6396 if (idx < 0)
6397 return "";
6398
6399 return attach_types.Get(idx);
6400 }
6401
6403 {
6404 int idx = -1;
6405 string slot;
6406
6409
6410 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6411 if (inventory_slots.Count() < 1)
6412 {
6413 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6414 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6415 }
6416 else
6417 {
6418 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6419 if (detach_types.Count() < 1)
6420 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6421 }
6422
6423 for (int i = 0; i < inventory_slots.Count(); i++)
6424 {
6425 slot = inventory_slots.Get(i);
6426 }
6427
6428 if (slot != "")
6429 {
6430 if (detach_types.Count() == 1)
6431 idx = 0;
6432 else
6433 idx = inventory_slots.Find(slot);
6434 }
6435 if (idx < 0)
6436 return "";
6437
6438 return detach_types.Get(idx);
6439 }
6440
6442 {
6443
6445
6446
6447 float min_time = 1;
6448 float max_time = 3;
6449 float delay = Math.RandomFloat(min_time, max_time);
6450
6451 explode_timer.Run(delay, this, "DoAmmoExplosion");
6452 }
6453
6455 {
6456 Magazine magazine = Magazine.Cast(this);
6457 int pop_sounds_count = 6;
6458 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6459
6460
6461 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6462 string sound_name = pop_sounds[ sound_idx ];
6464
6465
6466 magazine.ServerAddAmmoCount(-1);
6467
6468
6469 float min_temp_to_explode = 100;
6470
6471 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
6472 {
6474 }
6475 }
6476
6477
6478 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6479 {
6480 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6481
6482 const int CHANCE_DAMAGE_CARGO = 4;
6483 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6484 const int CHANCE_DAMAGE_NOTHING = 2;
6485
6487 {
6488 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6489 int chances;
6490 int rnd;
6491
6492 if (GetInventory().GetCargo())
6493 {
6494 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6495 rnd = Math.RandomInt(0,chances);
6496
6497 if (rnd < CHANCE_DAMAGE_CARGO)
6498 {
6500 }
6501 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6502 {
6504 }
6505 }
6506 else
6507 {
6508 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6509 rnd = Math.RandomInt(0,chances);
6510
6511 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6512 {
6514 }
6515 }
6516 }
6517 }
6518
6520 {
6521 if (GetInventory().GetCargo())
6522 {
6523 int item_count = GetInventory().GetCargo().GetItemCount();
6524 if (item_count > 0)
6525 {
6526 int random_pick = Math.RandomInt(0, item_count);
6528 if (!item.IsExplosive())
6529 {
6530 item.AddHealth("","",damage);
6531 return true;
6532 }
6533 }
6534 }
6535 return false;
6536 }
6537
6539 {
6540 int attachment_count = GetInventory().AttachmentCount();
6541 if (attachment_count > 0)
6542 {
6543 int random_pick = Math.RandomInt(0, attachment_count);
6544 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
6545 if (!attachment.IsExplosive())
6546 {
6547 attachment.AddHealth("","",damage);
6548 return true;
6549 }
6550 }
6551 return false;
6552 }
6553
6555 {
6557 }
6558
6560 {
6562 return GetInventory().CanRemoveEntity();
6563
6564 return false;
6565 }
6566
6568 {
6569
6571 return false;
6572
6573
6575 return false;
6576
6577
6578
6580 if (delta == 0)
6581 return false;
6582
6583
6584 return true;
6585 }
6586
6588 {
6590 {
6591 if (ScriptInputUserData.CanStoreInputUserData())
6592 {
6593 ScriptInputUserData ctx = new ScriptInputUserData;
6598 ctx.
Write(destination_entity);
6602 }
6603 }
6604 else if (!
GetGame().IsMultiplayer())
6605 {
6607 }
6608 }
6609
6611 {
6612 float split_quantity_new;
6616 InventoryLocation loc = new InventoryLocation;
6617
6618 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6619 {
6621 split_quantity_new = stack_max;
6622 else
6624
6626 {
6627 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6628 if (new_item)
6629 {
6630 new_item.SetResultOfSplit(true);
6631 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6633 new_item.
SetQuantity(split_quantity_new,
false,
true);
6634 }
6635 }
6636 }
6637 else if (destination_entity && slot_id == -1)
6638 {
6639 if (quantity > stack_max)
6640 split_quantity_new = stack_max;
6641 else
6642 split_quantity_new = quantity;
6643
6645 {
6647 {
6650 }
6651
6652 if (new_item)
6653 {
6654 new_item.SetResultOfSplit(true);
6655 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6657 new_item.
SetQuantity(split_quantity_new,
false,
true);
6658 }
6659 }
6660 }
6661 else
6662 {
6663 if (stack_max != 0)
6664 {
6666 {
6668 }
6669
6670 if (split_quantity_new == 0)
6671 {
6672 if (!
GetGame().IsMultiplayer())
6673 player.PhysicalPredictiveDropItem(this);
6674 else
6675 player.ServerDropEntity(this);
6676 return;
6677 }
6678
6680 {
6682
6683 if (new_item)
6684 {
6685 new_item.SetResultOfSplit(true);
6686 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6689 new_item.PlaceOnSurface();
6690 }
6691 }
6692 }
6693 }
6694 }
6695
6697 {
6698 float split_quantity_new;
6702 InventoryLocation loc = new InventoryLocation;
6703
6704 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6705 {
6707 split_quantity_new = stack_max;
6708 else
6710
6712 {
6713 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6714 if (new_item)
6715 {
6716 new_item.SetResultOfSplit(true);
6717 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6719 new_item.
SetQuantity(split_quantity_new,
false,
true);
6720 }
6721 }
6722 }
6723 else if (destination_entity && slot_id == -1)
6724 {
6725 if (quantity > stack_max)
6726 split_quantity_new = stack_max;
6727 else
6728 split_quantity_new = quantity;
6729
6731 {
6733 {
6736 }
6737
6738 if (new_item)
6739 {
6740 new_item.SetResultOfSplit(true);
6741 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6743 new_item.
SetQuantity(split_quantity_new,
false,
true);
6744 }
6745 }
6746 }
6747 else
6748 {
6749 if (stack_max != 0)
6750 {
6752 {
6754 }
6755
6757 {
6759
6760 if (new_item)
6761 {
6762 new_item.SetResultOfSplit(true);
6763 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6766 new_item.PlaceOnSurface();
6767 }
6768 }
6769 }
6770 }
6771 }
6772
6774 {
6776 {
6777 if (ScriptInputUserData.CanStoreInputUserData())
6778 {
6779 ScriptInputUserData ctx = new ScriptInputUserData;
6784 dst.WriteToContext(ctx);
6786 }
6787 }
6788 else if (!
GetGame().IsMultiplayer())
6789 {
6791 }
6792 }
6793
6795 {
6797 {
6798 if (ScriptInputUserData.CanStoreInputUserData())
6799 {
6800 ScriptInputUserData ctx = new ScriptInputUserData;
6805 ctx.
Write(destination_entity);
6811 }
6812 }
6813 else if (!
GetGame().IsMultiplayer())
6814 {
6816 }
6817 }
6818
6820 {
6822 }
6823
6825 {
6827 float split_quantity_new;
6829 if (dst.IsValid())
6830 {
6831 int slot_id = dst.GetSlot();
6833
6834 if (quantity > stack_max)
6835 split_quantity_new = stack_max;
6836 else
6837 split_quantity_new = quantity;
6838
6840 {
6842
6843 if (new_item)
6844 {
6845 new_item.SetResultOfSplit(true);
6846 MiscGameplayFunctions.TransferItemProperties(this,new_item);
6848 new_item.
SetQuantity(split_quantity_new,
false,
true);
6849 }
6850
6851 return new_item;
6852 }
6853 }
6854
6855 return null;
6856 }
6857
6859 {
6861 float split_quantity_new;
6863 if (destination_entity)
6864 {
6866 if (quantity > stackable)
6867 split_quantity_new = stackable;
6868 else
6869 split_quantity_new = quantity;
6870
6872 {
6873 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
6874 if (new_item)
6875 {
6876 new_item.SetResultOfSplit(true);
6877 MiscGameplayFunctions.TransferItemProperties(this,new_item);
6879 new_item.
SetQuantity(split_quantity_new,
false,
true);
6880 }
6881 }
6882 }
6883 }
6884
6886 {
6888 {
6889 if (ScriptInputUserData.CanStoreInputUserData())
6890 {
6891 ScriptInputUserData ctx = new ScriptInputUserData;
6896 ItemBase destination_entity =
this;
6897 ctx.
Write(destination_entity);
6901 }
6902 }
6903 else if (!
GetGame().IsMultiplayer())
6904 {
6906 }
6907 }
6908
6910 {
6912 float split_quantity_new;
6914 if (player)
6915 {
6917 if (quantity > stackable)
6918 split_quantity_new = stackable;
6919 else
6920 split_quantity_new = quantity;
6921
6923 {
6924 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
6925 new_item =
ItemBase.Cast(in_hands);
6926 if (new_item)
6927 {
6928 new_item.SetResultOfSplit(true);
6929 MiscGameplayFunctions.TransferItemProperties(this,new_item);
6931 new_item.SetQuantity(split_quantity_new, false, true);
6932 }
6933 }
6934 }
6935 }
6936
6938 {
6940 float split_quantity_new = Math.Floor(quantity * 0.5);
6941
6943 return;
6944
6946
6947 if (new_item)
6948 {
6949 if (new_item.GetQuantityMax() < split_quantity_new)
6950 {
6951 split_quantity_new = new_item.GetQuantityMax();
6952 }
6953
6954 new_item.SetResultOfSplit(true);
6955 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6956
6958 {
6961 }
6962 else
6963 {
6965 new_item.
SetQuantity(split_quantity_new,
false,
true);
6966 }
6967 }
6968 }
6969
6971 {
6973 float split_quantity_new = Math.Floor(quantity / 2);
6974
6976 return;
6977
6978 InventoryLocation invloc = new InventoryLocation;
6980
6982 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
6983
6984 if (new_item)
6985 {
6986 if (new_item.GetQuantityMax() < split_quantity_new)
6987 {
6988 split_quantity_new = new_item.GetQuantityMax();
6989 }
6991 {
6994 }
6995 else if (split_quantity_new > 1)
6996 {
6998 new_item.
SetQuantity(split_quantity_new,
false,
true);
6999 }
7000 }
7001 }
7002
7005 {
7006 SetWeightDirty();
7008
7009 if (parent)
7010 parent.OnAttachmentQuantityChangedEx(this, delta);
7011
7013 {
7015 {
7017 }
7019 {
7020 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7022 }
7023 }
7024
7025 }
7026
7029 {
7030
7031 }
7032
7035 {
7037 }
7038
7040 {
7041 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7042
7044 {
7045 if (newLevel == GameConstants.STATE_RUINED)
7046 {
7048 EntityAI parent = GetHierarchyParent();
7049 if (parent && parent.IsFireplace())
7050 {
7051 CargoBase cargo = GetInventory().GetCargo();
7052 if (cargo)
7053 {
7055 {
7057 }
7058 }
7059 }
7060 }
7061
7063 {
7064
7066 return;
7067 }
7068
7069 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7070 {
7072 }
7073 }
7074 }
7075
7076
7078 {
7079 super.OnRightClick();
7080
7082 {
7084 {
7085 if (ScriptInputUserData.CanStoreInputUserData())
7086 {
7087 EntityAI root = GetHierarchyRoot();
7088 Man playerOwner = GetHierarchyRootPlayer();
7089 InventoryLocation dst = new InventoryLocation;
7090
7091
7092 if (!playerOwner && root && root == this)
7093 {
7095 }
7096 else
7097 {
7098
7099 GetInventory().GetCurrentInventoryLocation(dst);
7101 {
7104 {
7106 }
7107 else
7108 {
7110
7111
7112 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7113 {
7115 }
7116 else
7117 {
7118 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7119 }
7120 }
7121 }
7122 }
7123
7124 ScriptInputUserData ctx = new ScriptInputUserData;
7132 }
7133 }
7134 else if (!
GetGame().IsMultiplayer())
7135 {
7137 }
7138 }
7139 }
7140
7142 {
7143 if (root)
7144 {
7145 vector m4[4];
7146 root.GetTransform(m4);
7147 dst.SetGround(this, m4);
7148 }
7149 else
7150 {
7151 GetInventory().GetCurrentInventoryLocation(dst);
7152 }
7153 }
7154
7155 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7156 {
7157
7158 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7159 return false;
7160
7161 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7162 return false;
7163
7164
7166 return false;
7167
7168
7169 Magazine mag = Magazine.Cast(this);
7170 if (mag)
7171 {
7172 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7173 return false;
7174
7175 if (stack_max_limit)
7176 {
7177 Magazine other_mag = Magazine.Cast(other_item);
7178 if (other_item)
7179 {
7180 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7181 return false;
7182 }
7183
7184 }
7185 }
7186 else
7187 {
7188
7190 return false;
7191
7193 return false;
7194 }
7195
7196 PlayerBase player = null;
7197 if (CastTo(player, GetHierarchyRootPlayer()))
7198 {
7199 if (player.GetInventory().HasAttachment(this))
7200 return false;
7201
7202 if (player.IsItemsToDelete())
7203 return false;
7204 }
7205
7206 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7207 return false;
7208
7209 int slotID;
7211 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7212 return false;
7213
7214 return true;
7215 }
7216
7218 {
7220 }
7221
7223 {
7224 return m_IsResultOfSplit;
7225 }
7226
7228 {
7229 m_IsResultOfSplit = value;
7230 }
7231
7233 {
7235 }
7236
7238 {
7239 float other_item_quantity = other_item.GetQuantity();
7240 float this_free_space;
7241
7243
7245
7246 if (other_item_quantity > this_free_space)
7247 {
7248 return this_free_space;
7249 }
7250 else
7251 {
7252 return other_item_quantity;
7253 }
7254 }
7255
7257 {
7259 }
7260
7262 {
7264 return;
7265
7266 if (!IsMagazine() && other_item)
7267 {
7269 if (quantity_used != 0)
7270 {
7271 float hp1 = GetHealth01("","");
7272 float hp2 = other_item.GetHealth01("","");
7273 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7274 hpResult = hpResult / (
GetQuantity() + quantity_used);
7275
7276 hpResult *= GetMaxHealth();
7277 Math.Round(hpResult);
7278 SetHealth("", "Health", hpResult);
7279
7281 other_item.AddQuantity(-quantity_used);
7282 }
7283 }
7285 }
7286
7288 {
7289 #ifdef SERVER
7290 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7291 GetHierarchyParent().IncreaseLifetimeUp();
7292 #endif
7293 };
7294
7296 {
7297 PlayerBase p = PlayerBase.Cast(player);
7298
7299 array<int> recipesIds = p.m_Recipes;
7300 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7301 if (moduleRecipesManager)
7302 {
7303 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7304 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7305 }
7306
7307 for (int i = 0;i < recipesIds.Count(); i++)
7308 {
7309 int key = recipesIds.Get(i);
7310 string recipeName = moduleRecipesManager.GetRecipeName(key);
7312 }
7313 }
7314
7315
7316 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7317 {
7318 super.GetDebugActions(outputList);
7319
7320
7326
7327
7332
7337
7338
7342
7343
7345 {
7349 }
7350
7353
7354
7358
7360
7361 InventoryLocation loc = new InventoryLocation();
7362 GetInventory().GetCurrentInventoryLocation(loc);
7364 {
7365 if (Gizmo_IsSupported())
7368 }
7369
7371 }
7372
7373
7374
7375
7377 {
7378 super.OnAction(action_id, player, ctx);
7379
7381 {
7382 switch (action_id)
7383 {
7386 return true;
7389 return true;
7390 }
7391 }
7392
7394 {
7395 switch (action_id)
7396 {
7398 Delete();
7399 return true;
7400 }
7401 }
7402
7403 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7404 {
7405 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7406 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7407 PlayerBase p = PlayerBase.Cast(player);
7408 if (
EActions.RECIPES_RANGE_START < 1000)
7409 {
7410 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7411 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7412 }
7413 }
7414 #ifndef SERVER
7415 else if (action_id ==
EActions.WATCH_PLAYER)
7416 {
7417 PluginDeveloper.SetDeveloperItemClientEx(player);
7418 }
7419 #endif
7421 {
7422 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7423 {
7424 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7425 OnDebugButtonPressServer(id + 1);
7426 }
7427
7428 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7429 {
7430 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7432 }
7433
7434 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7435 {
7436 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7438 }
7439
7440 else if (action_id ==
EActions.ADD_QUANTITY)
7441 {
7442 if (IsMagazine())
7443 {
7444 Magazine mag = Magazine.Cast(this);
7445 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7446 }
7447 else
7448 {
7450 }
7451
7452 if (m_EM)
7453 {
7454 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7455 }
7456
7457 }
7458
7459 else if (action_id ==
EActions.REMOVE_QUANTITY)
7460 {
7461 if (IsMagazine())
7462 {
7463 Magazine mag2 = Magazine.Cast(this);
7464 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7465 }
7466 else
7467 {
7469 }
7470 if (m_EM)
7471 {
7472 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7473 }
7474
7475 }
7476
7477 else if (action_id ==
EActions.SET_QUANTITY_0)
7478 {
7480
7481 if (m_EM)
7482 {
7483 m_EM.SetEnergy(0);
7484 }
7485 }
7486
7487 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7488 {
7490
7491 if (m_EM)
7492 {
7493 m_EM.SetEnergy(m_EM.GetEnergyMax());
7494 }
7495 }
7496
7497 else if (action_id ==
EActions.ADD_HEALTH)
7498 {
7499 AddHealth("","",GetMaxHealth("","Health")/5);
7500 }
7501 else if (action_id ==
EActions.REMOVE_HEALTH)
7502 {
7503 AddHealth("","",-GetMaxHealth("","Health")/5);
7504 }
7505 else if (action_id ==
EActions.DESTROY_HEALTH)
7506 {
7507 SetHealth01("","",0);
7508 }
7509 else if (action_id ==
EActions.WATCH_ITEM)
7510 {
7512 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7513 #ifdef DEVELOPER
7514 SetDebugDeveloper_item(this);
7515 #endif
7516 }
7517
7518 else if (action_id ==
EActions.ADD_TEMPERATURE)
7519 {
7520 AddTemperature(20);
7521
7522 }
7523
7524 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7525 {
7526 AddTemperature(-20);
7527
7528 }
7529
7530 else if (action_id ==
EActions.FLIP_FROZEN)
7531 {
7532 SetFrozen(!GetIsFrozen());
7533
7534 }
7535
7536 else if (action_id ==
EActions.ADD_WETNESS)
7537 {
7539
7540 }
7541
7542 else if (action_id ==
EActions.REMOVE_WETNESS)
7543 {
7545
7546 }
7547
7548 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7549 {
7552
7553
7554 }
7555
7556 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
7557 {
7560 }
7561
7562 else if (action_id ==
EActions.MAKE_SPECIAL)
7563 {
7564 auto debugParams = DebugSpawnParams.WithPlayer(player);
7565 OnDebugSpawnEx(debugParams);
7566 }
7567
7568 }
7569
7570
7571 return false;
7572 }
7573
7574
7575
7576
7580
7583
7584
7585
7587 {
7588 return false;
7589 }
7590
7591
7593 {
7594 return true;
7595 }
7596
7597
7599 {
7600 return true;
7601 }
7602
7603
7604
7606 {
7607 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
7609 }
7610
7613 {
7614 return null;
7615 }
7616
7618 {
7619 return false;
7620 }
7621
7623 {
7624 return false;
7625 }
7626
7630
7631
7633 {
7634 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7635 return module_repairing.CanRepair(this, item_repair_kit);
7636 }
7637
7638
7639 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
7640 {
7641 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7642 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
7643 }
7644
7645
7647 {
7648
7649
7650
7651
7652
7653
7654
7655
7656 return 1;
7657 }
7658
7659
7660
7662 {
7664 }
7665
7666
7667
7669 {
7671 }
7672
7673
7682 {
7683 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7684
7685 if (player)
7686 {
7687 player.MessageStatus(text);
7688 }
7689 }
7690
7691
7700 {
7701 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7702
7703 if (player)
7704 {
7705 player.MessageAction(text);
7706 }
7707 }
7708
7709
7718 {
7719 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7720
7721 if (player)
7722 {
7723 player.MessageFriendly(text);
7724 }
7725 }
7726
7727
7736 {
7737 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7738
7739 if (player)
7740 {
7741 player.MessageImportant(text);
7742 }
7743 }
7744
7746 {
7747 return true;
7748 }
7749
7750
7751 override bool KindOf(
string tag)
7752 {
7753 bool found = false;
7754 string item_name = this.
GetType();
7757
7758 int array_size = item_tag_array.Count();
7759 for (int i = 0; i < array_size; i++)
7760 {
7761 if (item_tag_array.Get(i) == tag)
7762 {
7763 found = true;
7764 break;
7765 }
7766 }
7767 return found;
7768 }
7769
7770
7772 {
7773
7774 super.OnRPC(sender, rpc_type,ctx);
7775
7776
7777 switch (rpc_type)
7778 {
7779 #ifndef SERVER
7780 case ERPCs.RPC_SOUND_LOCK_ATTACH:
7781 Param2<bool, string> p = new Param2<bool, string>(false, "");
7782
7784 return;
7785
7786 bool play = p.param1;
7787 string soundSet = p.param2;
7788
7789 if (play)
7790 {
7792 {
7794 {
7796 }
7797 }
7798 else
7799 {
7801 }
7802 }
7803 else
7804 {
7806 }
7807
7808 break;
7809 #endif
7810
7811 }
7812
7814 {
7816 }
7817 }
7818
7819
7820
7821
7823 {
7824 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
7825 return plugin.GetID(
name);
7826 }
7827
7829 {
7830 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
7831 return plugin.GetName(id);
7832 }
7833
7836 {
7837
7838
7839 int varFlags;
7840 if (!ctx.
Read(varFlags))
7841 return;
7842
7843 if (varFlags & ItemVariableFlags.FLOAT)
7844 {
7846 }
7847 }
7848
7850 {
7851
7852 super.SerializeNumericalVars(floats_out);
7853
7854
7855
7857 {
7859 }
7860
7862 {
7864 }
7865
7867 {
7869 }
7870
7872 {
7877 }
7878
7880 {
7882 }
7883 }
7884
7886 {
7887
7888 super.DeSerializeNumericalVars(floats);
7889
7890
7891 int index = 0;
7892 int mask = Math.Round(floats.Get(index));
7893
7894 index++;
7895
7897 {
7899 {
7901 }
7902 else
7903 {
7904 float quantity = floats.Get(index);
7906 }
7907 index++;
7908 }
7909
7911 {
7912 float wet = floats.Get(index);
7914 index++;
7915 }
7916
7918 {
7919 int liquidtype = Math.Round(floats.Get(index));
7921 index++;
7922 }
7923
7925 {
7927 index++;
7929 index++;
7931 index++;
7933 index++;
7934 }
7935
7937 {
7938 int cleanness = Math.Round(floats.Get(index));
7940 index++;
7941 }
7942 }
7943
7945 {
7946 super.WriteVarsToCTX(ctx);
7947
7948
7950 {
7952 }
7953
7955 {
7957 }
7958
7960 {
7962 }
7963
7965 {
7966 int r,g,b,a;
7972 }
7973
7975 {
7977 }
7978 }
7979
7981 {
7982 if (!super.ReadVarsFromCTX(ctx,version))
7983 return false;
7984
7985 int intValue;
7986 float value;
7987
7988 if (version < 140)
7989 {
7990 if (!ctx.
Read(intValue))
7991 return false;
7992
7993 m_VariablesMask = intValue;
7994 }
7995
7997 {
7998 if (!ctx.
Read(value))
7999 return false;
8000
8002 {
8004 }
8005 else
8006 {
8008 }
8009 }
8010
8011 if (version < 140)
8012 {
8014 {
8015 if (!ctx.
Read(value))
8016 return false;
8017 SetTemperatureDirect(value);
8018 }
8019 }
8020
8022 {
8023 if (!ctx.
Read(value))
8024 return false;
8026 }
8027
8029 {
8030 if (!ctx.
Read(intValue))
8031 return false;
8033 }
8034
8036 {
8037 int r,g,b,a;
8039 return false;
8041 return false;
8043 return false;
8045 return false;
8046
8048 }
8049
8051 {
8052 if (!ctx.
Read(intValue))
8053 return false;
8055 }
8056
8057 if (version >= 138 && version < 140)
8058 {
8060 {
8061 if (!ctx.
Read(intValue))
8062 return false;
8063 SetFrozen(intValue);
8064 }
8065 }
8066
8067 return true;
8068 }
8069
8070
8072 {
8075 {
8077 }
8078
8079 if (!super.OnStoreLoad(ctx, version))
8080 {
8082 return false;
8083 }
8084
8085 if (version >= 114)
8086 {
8087 bool hasQuickBarIndexSaved;
8088
8089 if (!ctx.
Read(hasQuickBarIndexSaved))
8090 {
8092 return false;
8093 }
8094
8095 if (hasQuickBarIndexSaved)
8096 {
8097 int itmQBIndex;
8098
8099
8100 if (!ctx.
Read(itmQBIndex))
8101 {
8103 return false;
8104 }
8105
8106 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8107 if (itmQBIndex != -1 && parentPlayer)
8108 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8109 }
8110 }
8111 else
8112 {
8113
8114 PlayerBase player;
8115 int itemQBIndex;
8116 if (version ==
int.
MAX)
8117 {
8118 if (!ctx.
Read(itemQBIndex))
8119 {
8121 return false;
8122 }
8123 }
8124 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8125 {
8126
8127 if (!ctx.
Read(itemQBIndex))
8128 {
8130 return false;
8131 }
8132 if (itemQBIndex != -1 && player)
8133 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8134 }
8135 }
8136
8137 if (version < 140)
8138 {
8139
8140 if (!LoadVariables(ctx, version))
8141 {
8143 return false;
8144 }
8145 }
8146
8147
8149 {
8151 return false;
8152 }
8153 if (version >= 132)
8154 {
8156 if (raib)
8157 {
8159 {
8161 return false;
8162 }
8163 }
8164 }
8165
8167 return true;
8168 }
8169
8170
8171
8173 {
8174 super.OnStoreSave(ctx);
8175
8176 PlayerBase player;
8177 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8178 {
8180
8181 int itemQBIndex = -1;
8182 itemQBIndex = player.FindQuickBarEntityIndex(this);
8183 ctx.
Write(itemQBIndex);
8184 }
8185 else
8186 {
8188 }
8189
8191
8193 if (raib)
8194 {
8196 }
8197 }
8198
8199
8201 {
8202 super.AfterStoreLoad();
8203
8205 {
8207 }
8208
8210 {
8213 }
8214 }
8215
8217 {
8218 super.EEOnAfterLoad();
8219
8221 {
8223 }
8224
8227 }
8228
8230 {
8231 return false;
8232 }
8233
8234
8235
8237 {
8239 {
8240 #ifdef PLATFORM_CONSOLE
8241
8243 {
8245 if (menu)
8246 {
8248 }
8249 }
8250 #endif
8251 }
8252
8254 {
8257 }
8258
8260 {
8261 SetWeightDirty();
8263 }
8265 {
8268 }
8269
8271 {
8274 }
8276 {
8279 }
8280
8281 super.OnVariablesSynchronized();
8282 }
8283
8284
8285
8287 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8288 {
8289 if (!IsServerCheck(allow_client))
8290 return false;
8291
8293 return false;
8294
8297
8298 if (value <= (min + 0.001))
8299 value = min;
8300
8301 if (value == min)
8302 {
8303 if (destroy_config)
8304 {
8305 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8306 if (dstr)
8307 {
8309 this.Delete();
8310 return true;
8311 }
8312 }
8313 else if (destroy_forced)
8314 {
8316 this.Delete();
8317 return true;
8318 }
8319
8321 }
8322
8325
8327 {
8329
8330 if (delta)
8332 }
8333
8335
8336 return false;
8337 }
8338
8339
8341 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8342 {
8344 }
8345
8347 {
8350 }
8351
8353 {
8356 }
8357
8359 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8360 {
8361 float value_clamped = Math.Clamp(value, 0, 1);
8363 SetQuantity(result, destroy_config, destroy_forced);
8364 }
8365
8366
8369 {
8371 }
8372
8374 {
8376 }
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8388 {
8389 int slot = -1;
8390 if (GetInventory())
8391 {
8392 InventoryLocation il = new InventoryLocation;
8393 GetInventory().GetCurrentInventoryLocation(il);
8395 }
8396
8398 }
8399
8401 {
8402 float quantity_max = 0;
8403
8405 {
8406 if (attSlotID != -1)
8407 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8408
8409 if (quantity_max <= 0)
8411 }
8412
8413 if (quantity_max <= 0)
8415
8416 return quantity_max;
8417 }
8418
8420 {
8422 }
8423
8425 {
8427 }
8428
8429
8431 {
8433 }
8434
8436 {
8438 }
8439
8441 {
8443 }
8444
8445
8447 {
8448
8449 float weightEx = GetWeightEx();
8450 float special = GetInventoryAndCargoWeight();
8451 return weightEx - special;
8452 }
8453
8454
8456 {
8458 }
8459
8461 {
8463 {
8464 #ifdef DEVELOPER
8465 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8466 {
8467 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8469 }
8470 #endif
8471
8473 }
8474 else if (HasEnergyManager())
8475 {
8476 #ifdef DEVELOPER
8477 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8478 {
8479 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8480 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8481 }
8482 #endif
8483 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
8484 }
8485 else
8486 {
8487 #ifdef DEVELOPER
8488 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8489 {
8490 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8491 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8492 }
8493 #endif
8494 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
8495 }
8496 }
8497
8500 {
8501 int item_count = 0;
8503
8504 if (GetInventory().GetCargo() != NULL)
8505 {
8506 item_count = GetInventory().GetCargo().GetItemCount();
8507 }
8508
8509 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8510 {
8511 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8512 if (item)
8513 item_count += item.GetNumberOfItems();
8514 }
8515 return item_count;
8516 }
8517
8520 {
8521 float weight = 0;
8522 float wetness = 1;
8523 if (include_wetness)
8526 {
8527 weight = wetness * m_ConfigWeight;
8528 }
8530 {
8531 weight = 1;
8532 }
8533 return weight;
8534 }
8535
8536
8537
8539 {
8540 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8541 {
8542 GameInventory inv = GetInventory();
8543 array<EntityAI> items = new array<EntityAI>;
8545 for (int i = 0; i < items.Count(); i++)
8546 {
8548 if (item)
8549 {
8551 }
8552 }
8553 }
8554 }
8555
8556
8557
8558
8560 {
8561 float energy = 0;
8562 if (HasEnergyManager())
8563 {
8564 energy = GetCompEM().GetEnergy();
8565 }
8566 return energy;
8567 }
8568
8569
8571 {
8572 super.OnEnergyConsumed();
8573
8575 }
8576
8578 {
8579 super.OnEnergyAdded();
8580
8582 }
8583
8584
8586 {
8587 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
8588 {
8590 {
8591 float energy_0to1 = GetCompEM().GetEnergy0To1();
8593 }
8594 }
8595 }
8596
8597
8599 {
8600 return ConfigGetFloat("heatIsolation");
8601 }
8602
8604 {
8606 }
8607
8609 {
8610 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
8611 if (
GetGame().ConfigIsExisting(paramPath))
8613
8614 return 0.0;
8615 }
8616
8618 {
8619 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
8620 if (
GetGame().ConfigIsExisting(paramPath))
8622
8623 return 0.0;
8624 }
8625
8626 override void SetWet(
float value,
bool allow_client =
false)
8627 {
8628 if (!IsServerCheck(allow_client))
8629 return;
8630
8633
8635
8636 m_VarWet = Math.Clamp(value, min, max);
8637
8639 {
8642 }
8643 }
8644
8645 override void AddWet(
float value)
8646 {
8648 }
8649
8651 {
8653 }
8654
8656 {
8658 }
8659
8661 {
8663 }
8664
8666 {
8668 }
8669
8671 {
8673 }
8674
8676 {
8679 if (newLevel != oldLevel)
8680 {
8682 }
8683 }
8684
8686 {
8687 SetWeightDirty();
8688 }
8689
8691 {
8692 return GetWetLevelInternal(
m_VarWet);
8693 }
8694
8695
8696
8698 {
8700 }
8701
8703 {
8705 }
8706
8708 {
8710 }
8711
8713 {
8715 }
8716
8717
8718
8720 {
8721 if (ConfigIsExisting("itemModelLength"))
8722 {
8723 return ConfigGetFloat("itemModelLength");
8724 }
8725 return 0;
8726 }
8727
8729 {
8730 if (ConfigIsExisting("itemAttachOffset"))
8731 {
8732 return ConfigGetFloat("itemAttachOffset");
8733 }
8734 return 0;
8735 }
8736
8737 override void SetCleanness(
int value,
bool allow_client =
false)
8738 {
8739 if (!IsServerCheck(allow_client))
8740 return;
8741
8743
8745
8748 }
8749
8751 {
8753 }
8754
8756 {
8757 return true;
8758 }
8759
8760
8761
8762
8764 {
8766 }
8767
8769 {
8771 }
8772
8773
8774
8775
8776 override void SetColor(
int r,
int g,
int b,
int a)
8777 {
8783 }
8785 override void GetColor(out
int r,out
int g,out
int b,out
int a)
8786 {
8791 }
8792
8794 {
8796 }
8797
8800 {
8801 int r,g,b,a;
8803 r = r/255;
8804 g = g/255;
8805 b = b/255;
8806 a = a/255;
8807 return MiscGameplayFunctions.GetColorString(r, g, b, a);
8808 }
8809
8810
8811
8812 override void SetLiquidType(
int value,
bool allow_client =
false)
8813 {
8814 if (!IsServerCheck(allow_client))
8815 return;
8816
8821 }
8822
8824 {
8825 return ConfigGetInt("varLiquidTypeInit");
8826 }
8827
8829 {
8831 }
8832
8834 {
8836 SetFrozen(false);
8837 }
8838
8841 {
8842 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
8843 }
8844
8845
8848 {
8849 PlayerBase nplayer;
8850 if (PlayerBase.CastTo(nplayer, player))
8851 {
8853
8854 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
8855 }
8856 }
8857
8858
8861 {
8862 PlayerBase nplayer;
8863 if (PlayerBase.CastTo(nplayer,player))
8864 {
8865
8866 nplayer.SetEnableQuickBarEntityShortcut(this,false);
8867
8868 }
8869
8870
8871 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
8872
8873
8874 if (HasEnergyManager())
8875 {
8876 GetCompEM().UpdatePlugState();
8877 }
8878 }
8879
8880
8882 {
8883 super.OnPlacementStarted(player);
8884
8886 }
8887
8888 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
8889 {
8891 {
8892 m_AdminLog.OnPlacementComplete(player,
this);
8893 }
8894
8895 super.OnPlacementComplete(player, position, orientation);
8896 }
8897
8898
8899
8900
8901
8903 {
8905 {
8906 return true;
8907 }
8908 else
8909 {
8910 return false;
8911 }
8912 }
8913
8914
8916 {
8918 {
8920 }
8921 }
8922
8923
8925 {
8927 }
8928
8930 {
8932 }
8933
8934 override void InsertAgent(
int agent,
float count = 1)
8935 {
8936 if (count < 1)
8937 return;
8938
8940 }
8941
8944 {
8946 }
8947
8948
8950 {
8952 }
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8996 {
8998 return false;
8999 return true;
9000 }
9001
9003 {
9004
9006 }
9007
9008
9011 {
9012 super.CheckForRoofLimited(timeTresholdMS);
9013
9015 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9016 {
9017 m_PreviousRoofTestTime = time;
9018 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9019 }
9020 }
9021
9022
9024 {
9026 {
9027 return 0;
9028 }
9029
9030 if (GetInventory().GetAttachmentSlotsCount() != 0)
9031 {
9032 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9033 if (filter)
9034 return filter.GetProtectionLevel(type, false, system);
9035 else
9036 return 0;
9037 }
9038
9039 string subclassPath, entryName;
9040
9041 switch (type)
9042 {
9044 entryName = "biological";
9045 break;
9047 entryName = "chemical";
9048 break;
9049 default:
9050 entryName = "biological";
9051 break;
9052 }
9053
9054 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9055
9057 }
9058
9059
9060
9063 {
9064 if (!IsMagazine())
9066
9068 }
9069
9070
9071
9072
9073
9078 {
9079 return true;
9080 }
9081
9083 {
9085 }
9086
9087
9088
9089
9090
9092 {
9093 if (parent)
9094 {
9095 if (parent.IsInherited(DayZInfected))
9096 return true;
9097
9098 if (!parent.IsRuined())
9099 return true;
9100 }
9101
9102 return true;
9103 }
9104
9106 {
9107 if (!super.CanPutAsAttachment(parent))
9108 {
9109 return false;
9110 }
9111
9112 if (!IsRuined() && !parent.IsRuined())
9113 {
9114 return true;
9115 }
9116
9117 return false;
9118 }
9119
9121 {
9122
9123
9124
9125
9126 return super.CanReceiveItemIntoCargo(item);
9127 }
9128
9130 {
9131
9132
9133
9134
9135 GameInventory attachmentInv = attachment.GetInventory();
9137 {
9138 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9139 return false;
9140 }
9141
9142 InventoryLocation loc = new InventoryLocation();
9143 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9144 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9145 return false;
9146
9147 return super.CanReceiveAttachment(attachment, slotId);
9148 }
9149
9151 {
9152 if (!super.CanReleaseAttachment(attachment))
9153 return false;
9154
9155 return GetInventory().AreChildrenAccessible();
9156 }
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9179 {
9180 int id = muzzle_owner.GetMuzzleID();
9181 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9182
9183 if (WPOF_array)
9184 {
9185 for (int i = 0; i < WPOF_array.Count(); i++)
9186 {
9187 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9188
9189 if (WPOF)
9190 {
9191 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9192 }
9193 }
9194 }
9195 }
9196
9197
9199 {
9200 int id = muzzle_owner.GetMuzzleID();
9202
9203 if (WPOBE_array)
9204 {
9205 for (int i = 0; i < WPOBE_array.Count(); i++)
9206 {
9207 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9208
9209 if (WPOBE)
9210 {
9211 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9212 }
9213 }
9214 }
9215 }
9216
9217
9219 {
9220 int id = muzzle_owner.GetMuzzleID();
9221 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9222
9223 if (WPOOH_array)
9224 {
9225 for (int i = 0; i < WPOOH_array.Count(); i++)
9226 {
9227 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9228
9229 if (WPOOH)
9230 {
9231 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9232 }
9233 }
9234 }
9235 }
9236
9237
9239 {
9240 int id = muzzle_owner.GetMuzzleID();
9241 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9242
9243 if (WPOOH_array)
9244 {
9245 for (int i = 0; i < WPOOH_array.Count(); i++)
9246 {
9247 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9248
9249 if (WPOOH)
9250 {
9251 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9252 }
9253 }
9254 }
9255 }
9256
9257
9259 {
9260 int id = muzzle_owner.GetMuzzleID();
9261 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9262
9263 if (WPOOH_array)
9264 {
9265 for (int i = 0; i < WPOOH_array.Count(); i++)
9266 {
9267 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9268
9269 if (WPOOH)
9270 {
9271 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9272 }
9273 }
9274 }
9275 }
9276
9277
9278
9280 {
9282 {
9283 return true;
9284 }
9285
9286 return false;
9287 }
9288
9290 {
9292 {
9293 return true;
9294 }
9295
9296 return false;
9297 }
9298
9300 {
9302 {
9303 return true;
9304 }
9305
9306 return false;
9307 }
9308
9310 {
9311 return false;
9312 }
9313
9316 {
9317 return UATimeSpent.DEFAULT_DEPLOY;
9318 }
9319
9320
9321
9322
9324 {
9326 SetSynchDirty();
9327 }
9328
9330 {
9332 }
9333
9334
9336 {
9337 return false;
9338 }
9339
9342 {
9343 string att_type = "None";
9344
9345 if (ConfigIsExisting("soundAttType"))
9346 {
9347 att_type = ConfigGetString("soundAttType");
9348 }
9349
9351 }
9352
9354 {
9356 }
9357
9358
9359
9360
9361
9367
9369 {
9372
9374 }
9375
9376
9378 {
9380 return;
9381
9383
9386
9389
9390 SoundParameters params = new SoundParameters();
9394 }
9395
9396
9398 {
9400 return;
9401
9403 SetSynchDirty();
9404
9407 }
9408
9409
9411 {
9413 return;
9414
9416 SetSynchDirty();
9417
9420 }
9421
9423 {
9425 }
9426
9428 {
9430 }
9431
9434 {
9435 if (!
GetGame().IsDedicatedServer())
9436 {
9437 if (ConfigIsExisting("attachSoundSet"))
9438 {
9439 string cfg_path = "";
9440 string soundset = "";
9442
9445 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9446 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9447
9448 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9449 {
9450 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9451 {
9452 if (cfg_slot_array[i] == slot_type)
9453 {
9454 soundset = cfg_soundset_array[i];
9455 break;
9456 }
9457 }
9458 }
9459
9460 if (soundset != "")
9461 {
9462 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9464 }
9465 }
9466 }
9467 }
9468
9470 {
9471
9472 }
9473
9474 void OnApply(PlayerBase player);
9475
9477 {
9478 return 1.0;
9479 };
9480
9482 {
9484 }
9485
9487 {
9489 }
9490
9492
9494 {
9495 SetDynamicPhysicsLifeTime(0.01);
9497 }
9498
9500 {
9501 array<string> zone_names = new array<string>;
9502 GetDamageZones(zone_names);
9503 for (int i = 0; i < zone_names.Count(); i++)
9504 {
9505 SetHealthMax(zone_names.Get(i),"Health");
9506 }
9507 SetHealthMax("","Health");
9508 }
9509
9512 {
9513 float global_health = GetHealth01("","Health");
9514 array<string> zones = new array<string>;
9515 GetDamageZones(zones);
9516
9517 for (int i = 0; i < zones.Count(); i++)
9518 {
9519 SetHealth01(zones.Get(i),"Health",global_health);
9520 }
9521 }
9522
9525 {
9526 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9527 }
9528
9530 {
9531 if (!hasRootAsPlayer)
9532 {
9533 if (refParentIB)
9534 {
9535
9536 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9537 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9538
9539 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9540 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9541
9544 }
9545 else
9546 {
9547
9550 }
9551 }
9552 }
9553
9555 {
9557 {
9558 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
9559 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
9560 {
9561 float heatPermCoef = 1.0;
9563 while (ent)
9564 {
9565 heatPermCoef *= ent.GetHeatPermeabilityCoef();
9566 ent = ent.GetHierarchyParent();
9567 }
9568
9569 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
9570 }
9571 }
9572 }
9573
9575 {
9576
9577 EntityAI parent = GetHierarchyParent();
9578 if (!parent)
9579 {
9580 hasParent = false;
9581 hasRootAsPlayer = false;
9582 }
9583 else
9584 {
9585 hasParent = true;
9586 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
9587 refParentIB =
ItemBase.Cast(parent);
9588 }
9589 }
9590
9591 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
9592 {
9593
9594 }
9595
9597 {
9598
9599 return false;
9600 }
9601
9603 {
9604
9605
9606 return false;
9607 }
9608
9610 {
9611
9612 return false;
9613 }
9614
9617 {
9618 return !GetIsFrozen() &&
IsOpen();
9619 }
9620
9622 {
9623 bool hasParent = false, hasRootAsPlayer = false;
9625
9626 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
9627 bool foodDecay =
g_Game.IsFoodDecayEnabled();
9628
9629 if (wwtu || foodDecay)
9630 {
9634
9635 if (processWetness || processTemperature || processDecay)
9636 {
9638
9639 if (processWetness)
9640 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
9641
9642 if (processTemperature)
9644
9645 if (processDecay)
9646 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
9647 }
9648 }
9649 }
9650
9653 {
9655 }
9656
9658 {
9661
9662 return super.GetTemperatureFreezeThreshold();
9663 }
9664
9666 {
9669
9670 return super.GetTemperatureThawThreshold();
9671 }
9672
9674 {
9677
9678 return super.GetItemOverheatThreshold();
9679 }
9680
9682 {
9684 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
9685
9686 return super.GetTemperatureFreezeTime();
9687 }
9688
9690 {
9692 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
9693
9694 return super.GetTemperatureThawTime();
9695 }
9696
9701
9703 {
9704 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
9705 }
9706
9708 {
9709 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
9710 }
9711
9714 {
9716 }
9717
9719 {
9721 }
9722
9724 {
9726 }
9727
9730 {
9731 return null;
9732 }
9733
9736 {
9737 return false;
9738 }
9739
9741 {
9743 {
9746 if (!trg)
9747 {
9749 explosive = this;
9750 }
9751
9752 explosive.PairRemote(trg);
9754
9755 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
9756 trg.SetPersistentPairID(persistentID);
9757 explosive.SetPersistentPairID(persistentID);
9758
9759 return true;
9760 }
9761 return false;
9762 }
9763
9766 {
9767 float ret = 1.0;
9770 ret *= GetHealth01();
9771
9772 return ret;
9773 }
9774
9775 #ifdef DEVELOPER
9776 override void SetDebugItem()
9777 {
9778 super.SetDebugItem();
9779 _itemBase = this;
9780 }
9781
9783 {
9784 string text = super.GetDebugText();
9785
9787 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
9788
9789 return text;
9790 }
9791 #endif
9792
9794 {
9795 return true;
9796 }
9797
9799
9801
9803 {
9806 }
9807
9808
9816
9832}
9833
9835{
9837 if (entity)
9838 {
9839 bool is_item = entity.IsInherited(
ItemBase);
9840 if (is_item && full_quantity)
9841 {
9844 }
9845 }
9846 else
9847 {
9849 return NULL;
9850 }
9851 return entity;
9852}
9853
9855{
9856 if (item)
9857 {
9858 if (health > 0)
9859 item.SetHealth("", "", health);
9860
9861 if (item.CanHaveTemperature())
9862 {
9864 if (item.CanFreeze())
9865 item.SetFrozen(false);
9866 }
9867
9868 if (item.HasEnergyManager())
9869 {
9870 if (quantity >= 0)
9871 {
9872 item.GetCompEM().SetEnergy0To1(quantity);
9873 }
9874 else
9875 {
9877 }
9878 }
9879 else if (item.IsMagazine())
9880 {
9881 Magazine mag = Magazine.Cast(item);
9882 if (quantity >= 0)
9883 {
9884 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
9885 }
9886 else
9887 {
9889 }
9890
9891 }
9892 else
9893 {
9894 if (quantity >= 0)
9895 {
9896 item.SetQuantityNormalized(quantity, false);
9897 }
9898 else
9899 {
9901 }
9902
9903 }
9904 }
9905}
9906
9907#ifdef DEVELOPER
9909#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
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
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
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)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
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...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
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()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
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()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
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.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
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...
void OnApply(PlayerBase player)
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 m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
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 PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
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 void GizmoSelectObject(Object object)
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 native void GizmoSelectPhysics(Physics physics)
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)
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 ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
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
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
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 InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
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)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
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)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
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)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
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.