5143{
5145 {
5146 return true;
5147 }
5148};
5149
5150
5151
5153{
5157
5159
5162
5163
5164
5165
5166
5175
5181
5186
5191
5212 protected bool m_IsResultOfSplit
5213
5215
5220
5221
5222
5224
5228
5229
5230
5232
5235
5236
5237
5243
5244
5252
5255
5256
5258
5259
5261
5262
5267
5268
5273
5274
5276
5277
5279 {
5284
5285 if (!
GetGame().IsDedicatedServer())
5286 {
5288 {
5290
5292 {
5294 }
5295 }
5296
5299 }
5300
5301 m_OldLocation = null;
5302
5304 {
5306 }
5307
5308 if (ConfigIsExisting("headSelectionsToHide"))
5309 {
5312 }
5313
5315 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5316 {
5318 }
5319
5321
5322 m_IsResultOfSplit = false;
5323
5325 }
5326
5328 {
5329 super.InitItemVariables();
5330
5336 m_Count = ConfigGetInt(
"count");
5337
5340
5345
5348
5353
5365
5369
5370
5373 if (ConfigIsExisting("canBeSplit"))
5374 {
5377 }
5378
5380 if (ConfigIsExisting("itemBehaviour"))
5382
5383
5386 RegisterNetSyncVariableInt("m_VarLiquidType");
5387 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5388
5389 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5390 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5391 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5392
5393 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5394 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5395 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5396 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5397
5398 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5399 RegisterNetSyncVariableBool("m_IsTakeable");
5400 RegisterNetSyncVariableBool("m_IsHologram");
5401
5404 {
5407 }
5408
5410
5412 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5414
5415 }
5416
5418 {
5420 }
5421
5423 {
5426 {
5431 }
5432 }
5433
5434 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5435 {
5437 {
5440 }
5441
5443 }
5444
5446 {
5452 }
5453
5455
5457 {
5459
5460 if (!action)
5461 {
5462 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5463 return;
5464 }
5465
5467 if (!ai)
5468 {
5470 return;
5471 }
5472
5474 if (!action_array)
5475 {
5476 action_array = new array<ActionBase_Basic>;
5478 }
5479 if (LogManager.IsActionLogEnable())
5480 {
5481 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5482 }
5483
5484 if (action_array.Find(action) != -1)
5485 {
5486 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5487 }
5488 else
5489 {
5490 action_array.Insert(action);
5491 }
5492 }
5493
5495 {
5497 ActionBase action = player.GetActionManager().GetAction(actionName);
5500
5501 if (action_array)
5502 {
5503 action_array.RemoveItem(action);
5504 }
5505 }
5506
5507
5508
5510 {
5511 ActionOverrideData overrideData = new ActionOverrideData();
5515
5517 if (!actionMap)
5518 {
5521 }
5522
5523 actionMap.Insert(this.
Type(), overrideData);
5524
5525 }
5526
5528
5530
5531
5533 {
5536
5539
5540 string config_to_search = "CfgVehicles";
5541 string muzzle_owner_config;
5542
5544 {
5545 if (IsInherited(Weapon))
5546 config_to_search = "CfgWeapons";
5547
5548 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5549
5550 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5551
5553
5554 if (config_OnFire_subclass_count > 0)
5555 {
5556 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5557
5558 for (int i = 0; i < config_OnFire_subclass_count; i++)
5559 {
5560 string particle_class = "";
5562 string config_OnFire_entry = config_OnFire_class + particle_class;
5563 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5564 WPOF_array.Insert(WPOF);
5565 }
5566
5567
5569 }
5570 }
5571
5573 {
5574 config_to_search = "CfgWeapons";
5575 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5576
5577 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5578
5580
5581 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5582 {
5583 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5584
5585 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5586 {
5587 string particle_class2 = "";
5589 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5590 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5591 WPOBE_array.Insert(WPOBE);
5592 }
5593
5594
5596 }
5597 }
5598 }
5599
5600
5602 {
5605
5607 {
5608 string config_to_search = "CfgVehicles";
5609
5610 if (IsInherited(Weapon))
5611 config_to_search = "CfgWeapons";
5612
5613 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5614 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5615
5616 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5617 {
5618
5620
5622 {
5624 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5626 return;
5627 }
5628
5631
5632
5633
5635 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5636
5637 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5638 {
5639 string particle_class = "";
5641 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5643
5644 if (entry_type == CT_CLASS)
5645 {
5646 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5647 WPOOH_array.Insert(WPOF);
5648 }
5649 }
5650
5651
5653 }
5654 }
5655 }
5656
5658 {
5660 }
5661
5663 {
5665 {
5667
5670
5673
5674 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5675 }
5676 }
5677
5679 {
5681 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5682
5684 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5685
5687 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5688
5690 {
5692 }
5693 }
5694
5696 {
5698 }
5699
5701 {
5704 else
5706
5708 {
5711 }
5712 else
5713 {
5716
5719 }
5720
5722 }
5723
5725 {
5727 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5728 }
5729
5731 {
5733 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5735 }
5736
5738 {
5740 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5741 }
5742
5744 {
5747
5748 OverheatingParticle OP = new OverheatingParticle();
5753
5755 }
5756
5758 {
5761
5762 return -1;
5763 }
5764
5766 {
5768 {
5771
5772 for (int i = count; i > 0; --i)
5773 {
5774 int id = i - 1;
5777
5780
5781 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
5782 {
5783 if (p)
5784 {
5787 }
5788 }
5789 }
5790 }
5791 }
5792
5794 {
5796 {
5798 {
5799 int id = i - 1;
5801
5802 if (OP)
5803 {
5805
5806 if (p)
5807 {
5809 }
5810
5811 delete OP;
5812 }
5813 }
5814
5817 }
5818 }
5819
5822 {
5823 return 0.0;
5824 }
5825
5826
5828 {
5829 return 250;
5830 }
5831
5833 {
5834 return 0;
5835 }
5836
5839 {
5841 return true;
5842
5843 return false;
5844 }
5845
5848 {
5851
5853 {
5855 }
5856 else
5857 {
5858
5860 }
5861
5863 }
5864
5871 {
5872 return -1;
5873 }
5874
5875
5876
5877
5879 {
5881 {
5883 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
5884
5885 if (r_index >= 0)
5886 {
5887 InventoryLocation r_il = new InventoryLocation;
5888 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
5889
5890 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
5893 {
5894 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
5895 }
5897 {
5898 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
5899 }
5900
5901 }
5902
5903 player.GetHumanInventory().ClearUserReservedLocation(this);
5904 }
5905
5908 }
5909
5910
5911
5912
5914 {
5915 return ItemBase.m_DebugActionsMask;
5916 }
5917
5919 {
5920 return ItemBase.m_DebugActionsMask & mask;
5921 }
5922
5924 {
5925 ItemBase.m_DebugActionsMask = mask;
5926 }
5927
5929 {
5930 ItemBase.m_DebugActionsMask |= mask;
5931 }
5932
5934 {
5935 ItemBase.m_DebugActionsMask &= ~mask;
5936 }
5937
5939 {
5941 {
5943 }
5944 else
5945 {
5947 }
5948 }
5949
5950
5952 {
5953 if (GetEconomyProfile())
5954 {
5955 float q_max = GetEconomyProfile().GetQuantityMax();
5956 if (q_max > 0)
5957 {
5958 float q_min = GetEconomyProfile().GetQuantityMin();
5959 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
5960
5962 {
5963 ComponentEnergyManager comp = GetCompEM();
5965 {
5967 }
5968 }
5970 {
5972
5973 }
5974
5975 }
5976 }
5977 }
5978
5981 {
5982 EntityAI parent = GetHierarchyParent();
5983
5984 if (parent)
5985 {
5986 InventoryLocation inventory_location_to_lock = new InventoryLocation;
5987 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
5988 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
5989 }
5990 }
5991
5994 {
5995 EntityAI parent = GetHierarchyParent();
5996
5997 if (parent)
5998 {
5999 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6000 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6001 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6002 }
6003 }
6004
6006 {
6007
6008
6009
6010
6012
6014 {
6015 if (ScriptInputUserData.CanStoreInputUserData())
6016 {
6017 ScriptInputUserData ctx = new ScriptInputUserData;
6023 ctx.
Write(use_stack_max);
6026
6028 {
6029 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6030 }
6031 }
6032 }
6033 else if (!
GetGame().IsMultiplayer())
6034 {
6036 }
6037 }
6038
6040 {
6042 }
6043
6045 {
6047 }
6048
6050 {
6052 }
6053
6055 {
6056
6057 return false;
6058 }
6059
6061 {
6062 return false;
6063 }
6064
6068 {
6069 return false;
6070 }
6071
6073 {
6074 return "";
6075 }
6076
6078
6080 {
6081 return false;
6082 }
6083
6085 {
6086 return true;
6087 }
6088
6089
6090
6092 {
6093 return true;
6094 }
6095
6097 {
6098 return true;
6099 }
6100
6102 {
6103 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6105 }
6106
6108 {
6110 }
6111
6113 {
6115 if (!is_being_placed)
6117 SetSynchDirty();
6118 }
6119
6120
6122
6124 {
6126 }
6127
6129 {
6131 }
6132
6134 {
6135 return 1;
6136 }
6137
6139 {
6140 return false;
6141 }
6142
6144 {
6146 SetSynchDirty();
6147 }
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6184 {
6185 super.OnMovedInsideCargo(container);
6186
6187 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6188 }
6189
6190 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6191 {
6192 super.EEItemLocationChanged(oldLoc,newLoc);
6193
6194 PlayerBase new_player = null;
6195 PlayerBase old_player = null;
6196
6197 if (newLoc.GetParent())
6198 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6199
6200 if (oldLoc.GetParent())
6201 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6202
6204 {
6205 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6206
6207 if (r_index >= 0)
6208 {
6209 InventoryLocation r_il = new InventoryLocation;
6210 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6211
6212 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6215 {
6216 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6217 }
6219 {
6220 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6221 }
6222
6223 }
6224 }
6225
6227 {
6228 if (new_player)
6229 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6230
6231 if (new_player == old_player)
6232 {
6233
6234 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6235 {
6237 {
6238 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6239 {
6240 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6241 }
6242 }
6243 else
6244 {
6245 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6246 }
6247 }
6248
6249 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6250 {
6251 int type = oldLoc.GetType();
6253 {
6254 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6255 }
6257 {
6258 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6259 }
6260 }
6261 if (!m_OldLocation)
6262 {
6263 m_OldLocation = new InventoryLocation;
6264 }
6265 m_OldLocation.Copy(oldLoc);
6266 }
6267 else
6268 {
6269 if (m_OldLocation)
6270 {
6271 m_OldLocation.Reset();
6272 }
6273 }
6274
6276 }
6277 else
6278 {
6279 if (new_player)
6280 {
6281 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6282 if (res_index >= 0)
6283 {
6284 InventoryLocation il = new InventoryLocation;
6285 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6287 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6290 {
6291 il.
GetParent().GetOnReleaseLock().Invoke(it);
6292 }
6294 {
6296 }
6297
6298 }
6299 }
6301 {
6302
6304 }
6305
6306 if (m_OldLocation)
6307 {
6308 m_OldLocation.Reset();
6309 }
6310 }
6311 }
6312
6313 override void EOnContact(IEntity other, Contact extra)
6314 {
6316 {
6317 int liquidType = -1;
6319 if (impactSpeed > 0.0)
6320 {
6322 #ifndef SERVER
6324 #else
6326 SetSynchDirty();
6327 #endif
6329 }
6330 }
6331
6332 #ifdef SERVER
6333 if (GetCompEM() && GetCompEM().IsPlugged())
6334 {
6335 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6336 GetCompEM().UnplugThis();
6337 }
6338 #endif
6339 }
6340
6342
6344 {
6346 }
6347
6349 {
6350
6351 }
6352
6354 {
6355 super.OnItemLocationChanged(old_owner, new_owner);
6356
6357 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6358 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6359
6360 if (!relatedPlayer && playerNew)
6361 relatedPlayer = playerNew;
6362
6363 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6364 {
6366 if (actionMgr)
6367 {
6368 ActionBase currentAction = actionMgr.GetRunningAction();
6369 if (currentAction)
6371 }
6372 }
6373
6374 Man ownerPlayerOld = null;
6375 Man ownerPlayerNew = null;
6376
6377 if (old_owner)
6378 {
6379 if (old_owner.
IsMan())
6380 {
6381 ownerPlayerOld = Man.Cast(old_owner);
6382 }
6383 else
6384 {
6385 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6386 }
6387 }
6388 else
6389 {
6391 {
6393
6394 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6395 {
6396 GetCompEM().UnplugThis();
6397 }
6398 }
6399 }
6400
6401 if (new_owner)
6402 {
6403 if (new_owner.
IsMan())
6404 {
6405 ownerPlayerNew = Man.Cast(new_owner);
6406 }
6407 else
6408 {
6409 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6410 }
6411 }
6412
6413 if (ownerPlayerOld != ownerPlayerNew)
6414 {
6415 if (ownerPlayerOld)
6416 {
6417 array<EntityAI> subItemsExit = new array<EntityAI>;
6419 for (int i = 0; i < subItemsExit.Count(); i++)
6420 {
6423 }
6424 }
6425
6426 if (ownerPlayerNew)
6427 {
6428 array<EntityAI> subItemsEnter = new array<EntityAI>;
6430 for (int j = 0; j < subItemsEnter.Count(); j++)
6431 {
6434 }
6435 }
6436 }
6437 else if (ownerPlayerNew != null)
6438 {
6439 PlayerBase nplayer;
6440 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6441 {
6442 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6444 for (int k = 0; k < subItemsUpdate.Count(); k++)
6445 {
6447 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6448 }
6449 }
6450 }
6451
6452 if (old_owner)
6453 old_owner.OnChildItemRemoved(this);
6454 if (new_owner)
6455 new_owner.OnChildItemReceived(this);
6456 }
6457
6458
6460 {
6461 super.EEDelete(parent);
6462 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6463 if (player)
6464 {
6466
6467 if (player.IsAlive())
6468 {
6469 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6470 if (r_index >= 0)
6471 {
6472 InventoryLocation r_il = new InventoryLocation;
6473 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6474
6475 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6478 {
6479 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6480 }
6482 {
6483 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6484 }
6485
6486 }
6487
6488 player.RemoveQuickBarEntityShortcut(this);
6489 }
6490 }
6491 }
6492
6494 {
6495 super.EEKilled(killer);
6496
6499 {
6500 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6501 {
6502 if (IsMagazine())
6503 {
6504 if (Magazine.Cast(this).GetAmmoCount() > 0)
6505 {
6507 }
6508 }
6509 else
6510 {
6512 }
6513 }
6514 }
6515 }
6516
6518 {
6519 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6520
6521 super.OnWasAttached(parent, slot_id);
6522
6525
6527 }
6528
6530 {
6531 super.OnWasDetached(parent, slot_id);
6532
6535 }
6536
6538 {
6539 int idx;
6542
6543 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6544 if (inventory_slots.Count() < 1)
6545 {
6546 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6547 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6548 }
6549 else
6550 {
6551 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6552 }
6553
6554 idx = inventory_slots.Find(slot);
6555 if (idx < 0)
6556 return "";
6557
6558 return attach_types.Get(idx);
6559 }
6560
6562 {
6563 int idx = -1;
6564 string slot;
6565
6568
6569 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6570 if (inventory_slots.Count() < 1)
6571 {
6572 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6573 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6574 }
6575 else
6576 {
6577 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6578 if (detach_types.Count() < 1)
6579 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6580 }
6581
6582 for (int i = 0; i < inventory_slots.Count(); i++)
6583 {
6584 slot = inventory_slots.Get(i);
6585 }
6586
6587 if (slot != "")
6588 {
6589 if (detach_types.Count() == 1)
6590 idx = 0;
6591 else
6592 idx = inventory_slots.Find(slot);
6593 }
6594 if (idx < 0)
6595 return "";
6596
6597 return detach_types.Get(idx);
6598 }
6599
6601 {
6602
6604
6605
6606 float min_time = 1;
6607 float max_time = 3;
6608 float delay = Math.RandomFloat(min_time, max_time);
6609
6610 explode_timer.Run(delay, this, "DoAmmoExplosion");
6611 }
6612
6614 {
6615 Magazine magazine = Magazine.Cast(this);
6616 int pop_sounds_count = 6;
6617 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6618
6619
6620 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6621 string sound_name = pop_sounds[ sound_idx ];
6623
6624
6625 magazine.ServerAddAmmoCount(-1);
6626
6627
6628 float min_temp_to_explode = 100;
6629
6630 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
6631 {
6633 }
6634 }
6635
6636
6637 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6638 {
6639 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6640
6641 const int CHANCE_DAMAGE_CARGO = 4;
6642 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6643 const int CHANCE_DAMAGE_NOTHING = 2;
6644
6646 {
6647 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6648 int chances;
6649 int rnd;
6650
6651 if (GetInventory().GetCargo())
6652 {
6653 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6654 rnd = Math.RandomInt(0,chances);
6655
6656 if (rnd < CHANCE_DAMAGE_CARGO)
6657 {
6659 }
6660 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6661 {
6663 }
6664 }
6665 else
6666 {
6667 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6668 rnd = Math.RandomInt(0,chances);
6669
6670 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6671 {
6673 }
6674 }
6675 }
6676 }
6677
6679 {
6680 if (GetInventory().GetCargo())
6681 {
6682 int item_count = GetInventory().GetCargo().GetItemCount();
6683 if (item_count > 0)
6684 {
6685 int random_pick = Math.RandomInt(0, item_count);
6687 if (!item.IsExplosive())
6688 {
6689 item.AddHealth("","",damage);
6690 return true;
6691 }
6692 }
6693 }
6694 return false;
6695 }
6696
6698 {
6699 int attachment_count = GetInventory().AttachmentCount();
6700 if (attachment_count > 0)
6701 {
6702 int random_pick = Math.RandomInt(0, attachment_count);
6703 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
6704 if (!attachment.IsExplosive())
6705 {
6706 attachment.AddHealth("","",damage);
6707 return true;
6708 }
6709 }
6710 return false;
6711 }
6712
6714 {
6716 }
6717
6719 {
6721 return GetInventory().CanRemoveEntity();
6722
6723 return false;
6724 }
6725
6727 {
6729 return;
6730
6732 {
6733 if (ScriptInputUserData.CanStoreInputUserData())
6734 {
6735 ScriptInputUserData ctx = new ScriptInputUserData;
6740 ctx.
Write(destination_entity);
6744 }
6745 }
6746 else if (!
GetGame().IsMultiplayer())
6747 {
6749 }
6750 }
6751
6753 {
6755 return;
6756
6757 float split_quantity_new;
6761 InventoryLocation loc = new InventoryLocation;
6762
6763 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6764 {
6766 split_quantity_new = stack_max;
6767 else
6769
6770 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6771 if (new_item)
6772 {
6773 new_item.SetResultOfSplit(true);
6774 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6776 new_item.SetQuantity(split_quantity_new);
6777 }
6778 }
6779 else if (destination_entity && slot_id == -1)
6780 {
6781 if (quantity > stack_max)
6782 split_quantity_new = stack_max;
6783 else
6784 split_quantity_new = quantity;
6785
6787 {
6790 }
6791
6792 if (new_item)
6793 {
6794 new_item.SetResultOfSplit(true);
6795 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6797 new_item.SetQuantity(split_quantity_new);
6798 }
6799 }
6800 else
6801 {
6802 if (stack_max != 0)
6803 {
6805 {
6807 }
6808
6809 if (split_quantity_new == 0)
6810 {
6811 if (!
GetGame().IsMultiplayer())
6812 player.PhysicalPredictiveDropItem(this);
6813 else
6814 player.ServerDropEntity(this);
6815 return;
6816 }
6817
6819
6820 if (new_item)
6821 {
6822 new_item.SetResultOfSplit(true);
6823 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6825 new_item.SetQuantity(stack_max);
6826 new_item.PlaceOnSurface();
6827 }
6828 }
6829 }
6830 }
6831
6833 {
6835 return;
6836
6837 float split_quantity_new;
6841 InventoryLocation loc = new InventoryLocation;
6842
6843 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6844 {
6846 split_quantity_new = stack_max;
6847 else
6849
6850 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6851 if (new_item)
6852 {
6853 new_item.SetResultOfSplit(true);
6854 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6856 new_item.SetQuantity(split_quantity_new);
6857 }
6858 }
6859 else if (destination_entity && slot_id == -1)
6860 {
6861 if (quantity > stack_max)
6862 split_quantity_new = stack_max;
6863 else
6864 split_quantity_new = quantity;
6865
6867 {
6870 }
6871
6872 if (new_item)
6873 {
6874 new_item.SetResultOfSplit(true);
6875 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6877 new_item.SetQuantity(split_quantity_new);
6878 }
6879 }
6880 else
6881 {
6882 if (stack_max != 0)
6883 {
6885 {
6887 }
6888
6890
6891 if (new_item)
6892 {
6893 new_item.SetResultOfSplit(true);
6894 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6896 new_item.SetQuantity(stack_max);
6897 new_item.PlaceOnSurface();
6898 }
6899 }
6900 }
6901 }
6902
6904 {
6906 return;
6907
6909 {
6910 if (ScriptInputUserData.CanStoreInputUserData())
6911 {
6912 ScriptInputUserData ctx = new ScriptInputUserData;
6917 dst.WriteToContext(ctx);
6919 }
6920 }
6921 else if (!
GetGame().IsMultiplayer())
6922 {
6924 }
6925 }
6926
6928 {
6930 return;
6931
6933 {
6934 if (ScriptInputUserData.CanStoreInputUserData())
6935 {
6936 ScriptInputUserData ctx = new ScriptInputUserData;
6941 ctx.
Write(destination_entity);
6947 }
6948 }
6949 else if (!
GetGame().IsMultiplayer())
6950 {
6952 }
6953 }
6954
6956 {
6958 }
6959
6961 {
6963 return this;
6964
6966 float split_quantity_new;
6968 if (dst.IsValid())
6969 {
6970 int slot_id = dst.GetSlot();
6972
6973 if (quantity > stack_max)
6974 split_quantity_new = stack_max;
6975 else
6976 split_quantity_new = quantity;
6977
6979
6980 if (new_item)
6981 {
6982 new_item.SetResultOfSplit(true);
6983 MiscGameplayFunctions.TransferItemProperties(this,new_item);
6986 }
6987
6988 return new_item;
6989 }
6990
6991 return null;
6992 }
6993
6995 {
6997 return;
6998
7000 float split_quantity_new;
7002 if (destination_entity)
7003 {
7005 if (quantity > stackable)
7006 split_quantity_new = stackable;
7007 else
7008 split_quantity_new = quantity;
7009
7010 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7011 if (new_item)
7012 {
7013 new_item.SetResultOfSplit(true);
7014 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7016 new_item.SetQuantity(split_quantity_new);
7017 }
7018 }
7019 }
7020
7022 {
7024 return;
7025
7027 {
7028 if (ScriptInputUserData.CanStoreInputUserData())
7029 {
7030 ScriptInputUserData ctx = new ScriptInputUserData;
7035 ItemBase destination_entity =
this;
7036 ctx.
Write(destination_entity);
7040 }
7041 }
7042 else if (!
GetGame().IsMultiplayer())
7043 {
7045 }
7046 }
7047
7049 {
7051 return;
7052
7054 float split_quantity_new;
7056 if (player)
7057 {
7059 if (quantity > stackable)
7060 split_quantity_new = stackable;
7061 else
7062 split_quantity_new = quantity;
7063
7064 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7065 new_item =
ItemBase.Cast(in_hands);
7066 if (new_item)
7067 {
7068 new_item.SetResultOfSplit(true);
7069 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7071 new_item.SetQuantity(split_quantity_new);
7072 }
7073 }
7074 }
7075
7077 {
7079 return;
7080
7082 float split_quantity_new = Math.Floor(quantity * 0.5);
7083
7085
7086 if (new_item)
7087 {
7088 if (new_item.GetQuantityMax() < split_quantity_new)
7089 {
7090 split_quantity_new = new_item.GetQuantityMax();
7091 }
7092
7093 new_item.SetResultOfSplit(true);
7094 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7095
7097 {
7100 }
7101 else
7102 {
7105 }
7106 }
7107 }
7108
7110 {
7112 return;
7113
7115 float split_quantity_new = Math.Floor(quantity / 2);
7116
7117 InventoryLocation invloc = new InventoryLocation;
7119
7121 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7122
7123 if (new_item)
7124 {
7125 if (new_item.GetQuantityMax() < split_quantity_new)
7126 {
7127 split_quantity_new = new_item.GetQuantityMax();
7128 }
7130 {
7133 }
7134 else
7135 {
7138 }
7139 }
7140 }
7141
7144 {
7145 SetWeightDirty();
7147
7148 if (parent)
7149 parent.OnAttachmentQuantityChangedEx(this, delta);
7150
7152 {
7154 {
7156 }
7158 {
7159 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7161 }
7162 }
7163
7164 }
7165
7168 {
7169
7170 }
7171
7174 {
7176 }
7177
7179 {
7180 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7181
7183 {
7184 if (newLevel == GameConstants.STATE_RUINED)
7185 {
7187 EntityAI parent = GetHierarchyParent();
7188 if (parent && parent.IsFireplace())
7189 {
7190 CargoBase cargo = GetInventory().GetCargo();
7191 if (cargo)
7192 {
7194 {
7196 }
7197 }
7198 }
7199 }
7200
7202 {
7203
7205 return;
7206 }
7207
7208 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7209 {
7211 }
7212 }
7213 }
7214
7215
7217 {
7218 super.OnRightClick();
7219
7221 {
7223 {
7224 if (ScriptInputUserData.CanStoreInputUserData())
7225 {
7226 vector m4[4];
7228
7229 EntityAI root = GetHierarchyRoot();
7230
7231 InventoryLocation dst = new InventoryLocation;
7233 {
7234 if (root)
7235 {
7236 root.GetTransform(m4);
7238 }
7239 else
7240 GetInventory().GetCurrentInventoryLocation(dst);
7241 }
7242 else
7243 {
7245
7246
7247 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7248 {
7249 if (root)
7250 {
7251 root.GetTransform(m4);
7253 }
7254 else
7255 GetInventory().GetCurrentInventoryLocation(dst);
7256 }
7257 else
7258 {
7259 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7260 }
7261 }
7262
7263 ScriptInputUserData ctx = new ScriptInputUserData;
7271 }
7272 }
7273 else if (!
GetGame().IsMultiplayer())
7274 {
7276 }
7277 }
7278 }
7279
7280 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7281 {
7282
7283 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7284 return false;
7285
7286 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7287 return false;
7288
7289
7291 return false;
7292
7293
7294 Magazine mag = Magazine.Cast(this);
7295 if (mag)
7296 {
7297 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7298 return false;
7299
7300 if (stack_max_limit)
7301 {
7302 Magazine other_mag = Magazine.Cast(other_item);
7303 if (other_item)
7304 {
7305 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7306 return false;
7307 }
7308
7309 }
7310 }
7311 else
7312 {
7313
7315 return false;
7316
7318 return false;
7319 }
7320
7321 PlayerBase player = null;
7322 if (CastTo(player, GetHierarchyRootPlayer()))
7323 {
7324 if (player.GetInventory().HasAttachment(this))
7325 return false;
7326
7327 if (player.IsItemsToDelete())
7328 return false;
7329 }
7330
7331 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7332 return false;
7333
7334 int slotID;
7336 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7337 return false;
7338
7339 return true;
7340 }
7341
7343 {
7345 }
7346
7348 {
7349 return m_IsResultOfSplit;
7350 }
7351
7353 {
7354 m_IsResultOfSplit = value;
7355 }
7356
7358 {
7360 }
7361
7363 {
7364 float other_item_quantity = other_item.GetQuantity();
7365 float this_free_space;
7366
7368
7370
7371 if (other_item_quantity > this_free_space)
7372 {
7373 return this_free_space;
7374 }
7375 else
7376 {
7377 return other_item_quantity;
7378 }
7379 }
7380
7382 {
7384 }
7385
7387 {
7389 return;
7390
7391 if (!IsMagazine() && other_item)
7392 {
7394 if (quantity_used != 0)
7395 {
7396 float hp1 = GetHealth01("","");
7397 float hp2 = other_item.GetHealth01("","");
7398 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7399 hpResult = hpResult / (
GetQuantity() + quantity_used);
7400
7401 hpResult *= GetMaxHealth();
7402 Math.Round(hpResult);
7403 SetHealth("", "Health", hpResult);
7404
7406 other_item.AddQuantity(-quantity_used);
7407 }
7408 }
7410 }
7411
7413 {
7414 #ifdef SERVER
7415 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7416 GetHierarchyParent().IncreaseLifetimeUp();
7417 #endif
7418 };
7419
7421 {
7422 PlayerBase p = PlayerBase.Cast(player);
7423
7424 array<int> recipesIds = p.m_Recipes;
7425 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7426 if (moduleRecipesManager)
7427 {
7428 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7429 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7430 }
7431
7432 for (int i = 0;i < recipesIds.Count(); i++)
7433 {
7434 int key = recipesIds.Get(i);
7435 string recipeName = moduleRecipesManager.GetRecipeName(key);
7437 }
7438 }
7439
7440
7441 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7442 {
7443 super.GetDebugActions(outputList);
7444
7445
7450
7451
7455
7459
7460
7463
7464
7466 {
7469 }
7470
7472
7475
7479 }
7480
7481
7482
7483
7485 {
7486 super.OnAction(action_id, player, ctx);
7487 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7488 {
7489 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7490 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7491 PlayerBase p = PlayerBase.Cast(player);
7492 if (
EActions.RECIPES_RANGE_START < 1000)
7493 {
7494 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7495 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7496 }
7497 }
7498 #ifndef SERVER
7499 else if (action_id ==
EActions.WATCH_PLAYER)
7500 {
7501 PluginDeveloper.SetDeveloperItemClientEx(player);
7502 }
7503 #endif
7505 {
7506 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7507 {
7508 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7509 OnDebugButtonPressServer(id + 1);
7510 }
7511
7512 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7513 {
7514 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7516 }
7517
7518 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7519 {
7520 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7522 }
7523
7524 else if (action_id ==
EActions.ADD_QUANTITY)
7525 {
7526 if (IsMagazine())
7527 {
7528 Magazine mag = Magazine.Cast(this);
7529 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7530 }
7531 else
7532 {
7534 }
7535
7536 if (m_EM)
7537 {
7538 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7539 }
7540
7541 }
7542
7543 else if (action_id ==
EActions.REMOVE_QUANTITY)
7544 {
7545 if (IsMagazine())
7546 {
7547 Magazine mag2 = Magazine.Cast(this);
7548 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7549 }
7550 else
7551 {
7553 }
7554 if (m_EM)
7555 {
7556 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7557 }
7558
7559 }
7560
7561 else if (action_id ==
EActions.SET_QUANTITY_0)
7562 {
7564
7565 if (m_EM)
7566 {
7567 m_EM.SetEnergy(0);
7568 }
7569 }
7570
7571 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7572 {
7574
7575 if (m_EM)
7576 {
7577 m_EM.SetEnergy(m_EM.GetEnergyMax());
7578 }
7579 }
7580
7581 else if (action_id ==
EActions.ADD_HEALTH)
7582 {
7583 AddHealth("","",GetMaxHealth("","Health")/5);
7584 }
7585 else if (action_id ==
EActions.REMOVE_HEALTH)
7586 {
7587 AddHealth("","",-GetMaxHealth("","Health")/5);
7588 }
7589 else if (action_id ==
EActions.DESTROY_HEALTH)
7590 {
7591 SetHealth01("","",0);
7592 }
7593 else if (action_id ==
EActions.WATCH_ITEM)
7594 {
7596 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7597 #ifdef DEVELOPER
7598 SetDebugDeveloper_item(this);
7599 #endif
7600 }
7601
7602 else if (action_id ==
EActions.ADD_TEMPERATURE)
7603 {
7604 AddTemperature(20);
7605
7606 }
7607
7608 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7609 {
7610 AddTemperature(-20);
7611
7612 }
7613
7614 else if (action_id ==
EActions.FLIP_FROZEN)
7615 {
7616 SetFrozen(!GetIsFrozen());
7617
7618 }
7619
7620 else if (action_id ==
EActions.ADD_WETNESS)
7621 {
7623
7624 }
7625
7626 else if (action_id ==
EActions.REMOVE_WETNESS)
7627 {
7629
7630 }
7631
7632 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7633 {
7636
7637
7638 }
7639
7640 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
7641 {
7644 }
7645
7646 else if (action_id ==
EActions.MAKE_SPECIAL)
7647 {
7648 auto debugParams = DebugSpawnParams.WithPlayer(player);
7649 OnDebugSpawnEx(debugParams);
7650 }
7651
7652 else if (action_id ==
EActions.DELETE)
7653 {
7654 Delete();
7655 }
7656
7657 }
7658
7659
7660 return false;
7661 }
7662
7663
7664
7665
7669
7672
7673
7674
7676 {
7677 return false;
7678 }
7679
7680
7682 {
7683 return true;
7684 }
7685
7686
7688 {
7689 return true;
7690 }
7691
7692
7693
7695 {
7696 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
7698 }
7699
7702 {
7703 return null;
7704 }
7705
7707 {
7708 return false;
7709 }
7710
7712 {
7713 return false;
7714 }
7715
7719
7720
7722 {
7723 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7724 return module_repairing.CanRepair(this, item_repair_kit);
7725 }
7726
7727
7728 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
7729 {
7730 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7731 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
7732 }
7733
7734
7736 {
7737
7738
7739
7740
7741
7742
7743
7744
7745 return 1;
7746 }
7747
7748
7749
7751 {
7753 }
7754
7755
7756
7758 {
7760 }
7761
7762
7771 {
7772 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7773
7774 if (player)
7775 {
7776 player.MessageStatus(text);
7777 }
7778 }
7779
7780
7789 {
7790 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7791
7792 if (player)
7793 {
7794 player.MessageAction(text);
7795 }
7796 }
7797
7798
7807 {
7808 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7809
7810 if (player)
7811 {
7812 player.MessageFriendly(text);
7813 }
7814 }
7815
7816
7825 {
7826 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7827
7828 if (player)
7829 {
7830 player.MessageImportant(text);
7831 }
7832 }
7833
7835 {
7836 return true;
7837 }
7838
7839
7840 override bool KindOf(
string tag)
7841 {
7842 bool found = false;
7843 string item_name = this.
GetType();
7846
7847 int array_size = item_tag_array.Count();
7848 for (int i = 0; i < array_size; i++)
7849 {
7850 if (item_tag_array.Get(i) == tag)
7851 {
7852 found = true;
7853 break;
7854 }
7855 }
7856 return found;
7857 }
7858
7859
7861 {
7862
7863 super.OnRPC(sender, rpc_type,ctx);
7864
7865
7866 switch (rpc_type)
7867 {
7868 #ifndef SERVER
7869 case ERPCs.RPC_SOUND_LOCK_ATTACH:
7870 Param2<bool, string> p = new Param2<bool, string>(false, "");
7871
7873 return;
7874
7875 bool play = p.param1;
7876 string soundSet = p.param2;
7877
7878 if (play)
7879 {
7881 {
7883 {
7885 }
7886 }
7887 else
7888 {
7890 }
7891 }
7892 else
7893 {
7895 }
7896
7897 break;
7898 #endif
7899
7900 }
7901
7903 {
7905 }
7906 }
7907
7908
7909
7910
7912 {
7913 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
7914 return plugin.GetID(
name);
7915 }
7916
7918 {
7919 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
7920 return plugin.GetName(id);
7921 }
7922
7925 {
7926
7927
7928 int varFlags;
7929 if (!ctx.
Read(varFlags))
7930 return;
7931
7932 if (varFlags & ItemVariableFlags.FLOAT)
7933 {
7935 }
7936 }
7937
7939 {
7940
7941 super.SerializeNumericalVars(floats_out);
7942
7943
7944
7946 {
7948 }
7949
7951 {
7953 }
7954
7956 {
7958 }
7959
7961 {
7966 }
7967
7969 {
7971 }
7972 }
7973
7975 {
7976
7977 super.DeSerializeNumericalVars(floats);
7978
7979
7980 int index = 0;
7981 int mask = Math.Round(floats.Get(index));
7982
7983 index++;
7984
7986 {
7988 {
7990 }
7991 else
7992 {
7993 float quantity = floats.Get(index);
7995 }
7996 index++;
7997 }
7998
8000 {
8001 float wet = floats.Get(index);
8003 index++;
8004 }
8005
8007 {
8008 int liquidtype = Math.Round(floats.Get(index));
8010 index++;
8011 }
8012
8014 {
8016 index++;
8018 index++;
8020 index++;
8022 index++;
8023 }
8024
8026 {
8027 int cleanness = Math.Round(floats.Get(index));
8029 index++;
8030 }
8031 }
8032
8034 {
8035 super.WriteVarsToCTX(ctx);
8036
8037
8039 {
8041 }
8042
8044 {
8046 }
8047
8049 {
8051 }
8052
8054 {
8055 int r,g,b,a;
8061 }
8062
8064 {
8066 }
8067 }
8068
8070 {
8071 if (!super.ReadVarsFromCTX(ctx,version))
8072 return false;
8073
8074 int intValue;
8075 float value;
8076
8077 if (version < 140)
8078 {
8079 if (!ctx.
Read(intValue))
8080 return false;
8081
8082 m_VariablesMask = intValue;
8083 }
8084
8086 {
8087 if (!ctx.
Read(value))
8088 return false;
8089
8091 {
8093 }
8094 else
8095 {
8097 }
8098 }
8099
8100 if (version < 140)
8101 {
8103 {
8104 if (!ctx.
Read(value))
8105 return false;
8106 SetTemperatureDirect(value);
8107 }
8108 }
8109
8111 {
8112 if (!ctx.
Read(value))
8113 return false;
8115 }
8116
8118 {
8119 if (!ctx.
Read(intValue))
8120 return false;
8122 }
8123
8125 {
8126 int r,g,b,a;
8128 return false;
8130 return false;
8132 return false;
8134 return false;
8135
8137 }
8138
8140 {
8141 if (!ctx.
Read(intValue))
8142 return false;
8144 }
8145
8146 if (version >= 138 && version < 140)
8147 {
8149 {
8150 if (!ctx.
Read(intValue))
8151 return false;
8152 SetFrozen(intValue);
8153 }
8154 }
8155
8156 return true;
8157 }
8158
8159
8161 {
8164 {
8166 }
8167
8168 if (!super.OnStoreLoad(ctx, version))
8169 {
8171 return false;
8172 }
8173
8174 if (version >= 114)
8175 {
8176 bool hasQuickBarIndexSaved;
8177
8178 if (!ctx.
Read(hasQuickBarIndexSaved))
8179 {
8181 return false;
8182 }
8183
8184 if (hasQuickBarIndexSaved)
8185 {
8186 int itmQBIndex;
8187
8188
8189 if (!ctx.
Read(itmQBIndex))
8190 {
8192 return false;
8193 }
8194
8195 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8196 if (itmQBIndex != -1 && parentPlayer)
8197 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8198 }
8199 }
8200 else
8201 {
8202
8203 PlayerBase player;
8204 int itemQBIndex;
8205 if (version ==
int.
MAX)
8206 {
8207 if (!ctx.
Read(itemQBIndex))
8208 {
8210 return false;
8211 }
8212 }
8213 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8214 {
8215
8216 if (!ctx.
Read(itemQBIndex))
8217 {
8219 return false;
8220 }
8221 if (itemQBIndex != -1 && player)
8222 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8223 }
8224 }
8225
8226 if (version < 140)
8227 {
8228
8229 if (!LoadVariables(ctx, version))
8230 {
8232 return false;
8233 }
8234 }
8235
8236
8238 {
8240 return false;
8241 }
8242 if (version >= 132)
8243 {
8245 if (raib)
8246 {
8248 {
8250 return false;
8251 }
8252 }
8253 }
8254
8256 return true;
8257 }
8258
8259
8260
8262 {
8263 super.OnStoreSave(ctx);
8264
8265 PlayerBase player;
8266 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8267 {
8269
8270 int itemQBIndex = -1;
8271 itemQBIndex = player.FindQuickBarEntityIndex(this);
8272 ctx.
Write(itemQBIndex);
8273 }
8274 else
8275 {
8277 }
8278
8280
8282 if (raib)
8283 {
8285 }
8286 }
8287
8288
8290 {
8291 super.AfterStoreLoad();
8292
8294 {
8296 }
8297
8299 {
8302 }
8303 }
8304
8306 {
8307 super.EEOnAfterLoad();
8308
8310 {
8312 }
8313
8316 }
8317
8319 {
8320 return false;
8321 }
8322
8323
8324
8326 {
8328 {
8329 #ifdef PLATFORM_CONSOLE
8330
8332 {
8334 if (menu)
8335 {
8337 }
8338 }
8339 #endif
8340 }
8341
8343 {
8346 }
8347
8349 {
8350 SetWeightDirty();
8352 }
8354 {
8357 }
8358
8360 {
8363 }
8365 {
8368 }
8369
8370 super.OnVariablesSynchronized();
8371 }
8372
8373
8374
8376 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8377 {
8378 if (!IsServerCheck(allow_client))
8379 return false;
8380
8382 return false;
8383
8386
8387 if (value <= (min + 0.001))
8388 value = min;
8389
8390 if (value == min)
8391 {
8392 if (destroy_config)
8393 {
8394 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8395 if (dstr)
8396 {
8398 this.Delete();
8399 return true;
8400 }
8401 }
8402 else if (destroy_forced)
8403 {
8405 this.Delete();
8406 return true;
8407 }
8408
8410 }
8411
8414
8416 {
8418
8419 if (delta)
8421 }
8422
8424
8425 return false;
8426 }
8427
8428
8430 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8431 {
8433 }
8434
8436 {
8439 }
8440
8442 {
8445 }
8446
8449 {
8450 float value_clamped = Math.Clamp(value, 0, 1);
8452 SetQuantity(result, destroy_config, destroy_forced);
8453 }
8454
8455
8458 {
8460 }
8461
8463 {
8465 }
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8477 {
8478 int slot = -1;
8479 if (GetInventory())
8480 {
8481 InventoryLocation il = new InventoryLocation;
8482 GetInventory().GetCurrentInventoryLocation(il);
8484 }
8485
8487 }
8488
8490 {
8491 float quantity_max = 0;
8492
8494 {
8495 if (attSlotID != -1)
8496 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8497
8498 if (quantity_max <= 0)
8500 }
8501
8502 if (quantity_max <= 0)
8504
8505 return quantity_max;
8506 }
8507
8509 {
8511 }
8512
8514 {
8516 }
8517
8518
8520 {
8522 }
8523
8525 {
8527 }
8528
8530 {
8532 }
8533
8534
8536 {
8537
8538 float weightEx = GetWeightEx();
8539 float special = GetInventoryAndCargoWeight();
8540 return weightEx - special;
8541 }
8542
8543
8545 {
8547 }
8548
8550 {
8552 {
8553 #ifdef DEVELOPER
8554 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8555 {
8556 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8558 }
8559 #endif
8560
8562 }
8563 else if (HasEnergyManager())
8564 {
8565 #ifdef DEVELOPER
8566 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8567 {
8568 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8569 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8570 }
8571 #endif
8572 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8573 }
8574 else
8575 {
8576 #ifdef DEVELOPER
8577 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8578 {
8579 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8580 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8581 }
8582 #endif
8583 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
8584 }
8585 }
8586
8589 {
8590 int item_count = 0;
8592
8593 if (GetInventory().GetCargo() != NULL)
8594 {
8595 item_count = GetInventory().GetCargo().GetItemCount();
8596 }
8597
8598 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8599 {
8600 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8601 if (item)
8602 item_count += item.GetNumberOfItems();
8603 }
8604 return item_count;
8605 }
8606
8609 {
8610 float weight = 0;
8611 float wetness = 1;
8612 if (include_wetness)
8615 {
8616 weight = wetness * m_ConfigWeight;
8617 }
8619 {
8620 weight = 1;
8621 }
8622 return weight;
8623 }
8624
8625
8626
8628 {
8629 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8630 {
8631 GameInventory inv = GetInventory();
8632 array<EntityAI> items = new array<EntityAI>;
8634 for (int i = 0; i < items.Count(); i++)
8635 {
8637 if (item)
8638 {
8640 }
8641 }
8642 }
8643 }
8644
8645
8646
8647
8649 {
8650 float energy = 0;
8651 if (HasEnergyManager())
8652 {
8653 energy = GetCompEM().GetEnergy();
8654 }
8655 return energy;
8656 }
8657
8658
8660 {
8661 super.OnEnergyConsumed();
8662
8664 }
8665
8667 {
8668 super.OnEnergyAdded();
8669
8671 }
8672
8673
8675 {
8676 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
8677 {
8679 {
8680 float energy_0to1 = GetCompEM().GetEnergy0To1();
8682 }
8683 }
8684 }
8685
8686
8688 {
8689 return ConfigGetFloat("heatIsolation");
8690 }
8691
8693 {
8695 }
8696
8698 {
8699 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
8700 if (
GetGame().ConfigIsExisting(paramPath))
8702
8703 return 0.0;
8704 }
8705
8707 {
8708 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
8709 if (
GetGame().ConfigIsExisting(paramPath))
8711
8712 return 0.0;
8713 }
8714
8715 override void SetWet(
float value,
bool allow_client =
false)
8716 {
8717 if (!IsServerCheck(allow_client))
8718 return;
8719
8722
8724
8725 m_VarWet = Math.Clamp(value, min, max);
8726
8728 {
8731 }
8732 }
8733
8734 override void AddWet(
float value)
8735 {
8737 }
8738
8740 {
8742 }
8743
8745 {
8747 }
8748
8750 {
8752 }
8753
8755 {
8757 }
8758
8760 {
8762 }
8763
8765 {
8768 if (newLevel != oldLevel)
8769 {
8771 }
8772 }
8773
8775 {
8776 SetWeightDirty();
8777 }
8778
8780 {
8781 return GetWetLevelInternal(
m_VarWet);
8782 }
8783
8784
8785
8787 {
8789 }
8790
8792 {
8794 }
8795
8797 {
8799 }
8800
8802 {
8804 }
8805
8806
8807
8809 {
8810 if (ConfigIsExisting("itemModelLength"))
8811 {
8812 return ConfigGetFloat("itemModelLength");
8813 }
8814 return 0;
8815 }
8816
8818 {
8819 if (ConfigIsExisting("itemAttachOffset"))
8820 {
8821 return ConfigGetFloat("itemAttachOffset");
8822 }
8823 return 0;
8824 }
8825
8826 override void SetCleanness(
int value,
bool allow_client =
false)
8827 {
8828 if (!IsServerCheck(allow_client))
8829 return;
8830
8832
8834
8837 }
8838
8840 {
8842 }
8843
8845 {
8846 return true;
8847 }
8848
8849
8850
8851
8853 {
8855 }
8856
8858 {
8860 }
8861
8862
8863
8864
8865 override void SetColor(
int r,
int g,
int b,
int a)
8866 {
8872 }
8874 override void GetColor(out
int r,out
int g,out
int b,out
int a)
8875 {
8880 }
8881
8883 {
8885 }
8886
8889 {
8890 int r,g,b,a;
8892 r = r/255;
8893 g = g/255;
8894 b = b/255;
8895 a = a/255;
8896 return MiscGameplayFunctions.GetColorString(r, g, b, a);
8897 }
8898
8899
8900
8901 override void SetLiquidType(
int value,
bool allow_client =
false)
8902 {
8903 if (!IsServerCheck(allow_client))
8904 return;
8905
8910 }
8911
8913 {
8914 return ConfigGetInt("varLiquidTypeInit");
8915 }
8916
8918 {
8920 }
8921
8923 {
8925 SetFrozen(false);
8926 }
8927
8930 {
8931 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
8932 }
8933
8934
8937 {
8938 PlayerBase nplayer;
8939 if (PlayerBase.CastTo(nplayer, player))
8940 {
8942
8943 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
8944 }
8945 }
8946
8947
8950 {
8951 PlayerBase nplayer;
8952 if (PlayerBase.CastTo(nplayer,player))
8953 {
8954
8955 nplayer.SetEnableQuickBarEntityShortcut(this,false);
8956
8957 }
8958
8959
8960 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
8961
8962
8963 if (HasEnergyManager())
8964 {
8965 GetCompEM().UpdatePlugState();
8966 }
8967 }
8968
8969
8971 {
8972 super.OnPlacementStarted(player);
8973
8975 }
8976
8977 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
8978 {
8980 {
8981 m_AdminLog.OnPlacementComplete(player,
this);
8982 }
8983
8984 super.OnPlacementComplete(player, position, orientation);
8985 }
8986
8987
8988
8989
8990
8992 {
8994 {
8995 return true;
8996 }
8997 else
8998 {
8999 return false;
9000 }
9001 }
9002
9003
9005 {
9007 {
9009 }
9010 }
9011
9012
9014 {
9016 }
9017
9019 {
9021 }
9022
9023 override void InsertAgent(
int agent,
float count = 1)
9024 {
9025 if (count < 1)
9026 return;
9027
9029 }
9030
9033 {
9035 }
9036
9037
9039 {
9041 }
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9085 {
9087 return false;
9088 return true;
9089 }
9090
9092 {
9093
9095 }
9096
9097
9100 {
9101 super.CheckForRoofLimited(timeTresholdMS);
9102
9104 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9105 {
9106 m_PreviousRoofTestTime = time;
9107 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9108 }
9109 }
9110
9111
9113 {
9115 {
9116 return 0;
9117 }
9118
9119 if (GetInventory().GetAttachmentSlotsCount() != 0)
9120 {
9121 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9122 if (filter)
9123 return filter.GetProtectionLevel(type, false, system);
9124 else
9125 return 0;
9126 }
9127
9128 string subclassPath, entryName;
9129
9130 switch (type)
9131 {
9133 entryName = "biological";
9134 break;
9136 entryName = "chemical";
9137 break;
9138 default:
9139 entryName = "biological";
9140 break;
9141 }
9142
9143 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9144
9146 }
9147
9148
9149
9152 {
9153 if (!IsMagazine())
9155
9157 }
9158
9159
9160
9161
9162
9167 {
9168 return true;
9169 }
9170
9172 {
9174 }
9175
9176
9177
9178
9179
9181 {
9182 if (parent)
9183 {
9184 if (parent.IsInherited(DayZInfected))
9185 return true;
9186
9187 if (!parent.IsRuined())
9188 return true;
9189 }
9190
9191 return true;
9192 }
9193
9195 {
9196 if (!super.CanPutAsAttachment(parent))
9197 {
9198 return false;
9199 }
9200
9201 if (!IsRuined() && !parent.IsRuined())
9202 {
9203 return true;
9204 }
9205
9206 return false;
9207 }
9208
9210 {
9211
9212
9213
9214
9215 return super.CanReceiveItemIntoCargo(item);
9216 }
9217
9219 {
9220
9221
9222
9223
9224 GameInventory attachmentInv = attachment.GetInventory();
9226 {
9227 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9228 return false;
9229 }
9230
9231 InventoryLocation loc = new InventoryLocation();
9232 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9233 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9234 return false;
9235
9236 return super.CanReceiveAttachment(attachment, slotId);
9237 }
9238
9240 {
9241 if (!super.CanReleaseAttachment(attachment))
9242 return false;
9243
9244 return GetInventory().AreChildrenAccessible();
9245 }
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9268 {
9269 int id = muzzle_owner.GetMuzzleID();
9270 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9271
9272 if (WPOF_array)
9273 {
9274 for (int i = 0; i < WPOF_array.Count(); i++)
9275 {
9276 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9277
9278 if (WPOF)
9279 {
9280 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9281 }
9282 }
9283 }
9284 }
9285
9286
9288 {
9289 int id = muzzle_owner.GetMuzzleID();
9291
9292 if (WPOBE_array)
9293 {
9294 for (int i = 0; i < WPOBE_array.Count(); i++)
9295 {
9296 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9297
9298 if (WPOBE)
9299 {
9300 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9301 }
9302 }
9303 }
9304 }
9305
9306
9308 {
9309 int id = muzzle_owner.GetMuzzleID();
9310 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9311
9312 if (WPOOH_array)
9313 {
9314 for (int i = 0; i < WPOOH_array.Count(); i++)
9315 {
9316 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9317
9318 if (WPOOH)
9319 {
9320 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9321 }
9322 }
9323 }
9324 }
9325
9326
9328 {
9329 int id = muzzle_owner.GetMuzzleID();
9330 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9331
9332 if (WPOOH_array)
9333 {
9334 for (int i = 0; i < WPOOH_array.Count(); i++)
9335 {
9336 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9337
9338 if (WPOOH)
9339 {
9340 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9341 }
9342 }
9343 }
9344 }
9345
9346
9348 {
9349 int id = muzzle_owner.GetMuzzleID();
9350 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9351
9352 if (WPOOH_array)
9353 {
9354 for (int i = 0; i < WPOOH_array.Count(); i++)
9355 {
9356 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9357
9358 if (WPOOH)
9359 {
9360 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9361 }
9362 }
9363 }
9364 }
9365
9366
9367
9369 {
9371 {
9372 return true;
9373 }
9374
9375 return false;
9376 }
9377
9379 {
9381 {
9382 return true;
9383 }
9384
9385 return false;
9386 }
9387
9389 {
9391 {
9392 return true;
9393 }
9394
9395 return false;
9396 }
9397
9399 {
9400 return false;
9401 }
9402
9405 {
9406 return UATimeSpent.DEFAULT_DEPLOY;
9407 }
9408
9409
9410
9411
9413 {
9415 SetSynchDirty();
9416 }
9417
9419 {
9421 }
9422
9423
9425 {
9426 return false;
9427 }
9428
9431 {
9432 string att_type = "None";
9433
9434 if (ConfigIsExisting("soundAttType"))
9435 {
9436 att_type = ConfigGetString("soundAttType");
9437 }
9438
9440 }
9441
9443 {
9445 }
9446
9447
9448
9449
9450
9454
9456 {
9459
9461 }
9462
9463
9465 {
9467 return;
9468
9470
9473
9476
9477 SoundParameters params = new SoundParameters();
9481 }
9482
9483
9485 {
9487 return;
9488
9490 SetSynchDirty();
9491
9494 }
9495
9496
9498 {
9500 return;
9501
9503 SetSynchDirty();
9504
9507 }
9508
9510 {
9512 }
9513
9515 {
9517 }
9518
9521 {
9522 if (!
GetGame().IsDedicatedServer())
9523 {
9524 if (ConfigIsExisting("attachSoundSet"))
9525 {
9526 string cfg_path = "";
9527 string soundset = "";
9529
9532 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9533 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9534
9535 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9536 {
9537 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9538 {
9539 if (cfg_slot_array[i] == slot_type)
9540 {
9541 soundset = cfg_soundset_array[i];
9542 break;
9543 }
9544 }
9545 }
9546
9547 if (soundset != "")
9548 {
9549 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9551 }
9552 }
9553 }
9554 }
9555
9557 {
9558
9559 }
9560
9561 void OnApply(PlayerBase player);
9562
9564 {
9565 return 1.0;
9566 };
9567
9569 {
9571 }
9572
9574 {
9576 }
9577
9579
9581 {
9582 SetDynamicPhysicsLifeTime(0.01);
9584 }
9585
9587 {
9588 array<string> zone_names = new array<string>;
9589 GetDamageZones(zone_names);
9590 for (int i = 0; i < zone_names.Count(); i++)
9591 {
9592 SetHealthMax(zone_names.Get(i),"Health");
9593 }
9594 SetHealthMax("","Health");
9595 }
9596
9599 {
9600 float global_health = GetHealth01("","Health");
9601 array<string> zones = new array<string>;
9602 GetDamageZones(zones);
9603
9604 for (int i = 0; i < zones.Count(); i++)
9605 {
9606 SetHealth01(zones.Get(i),"Health",global_health);
9607 }
9608 }
9609
9612 {
9613 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9614 }
9615
9617 {
9618 if (!hasRootAsPlayer)
9619 {
9620 if (refParentIB)
9621 {
9622
9623 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9624 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9625
9626 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9627 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9628
9631 }
9632 else
9633 {
9634
9637 }
9638 }
9639 }
9640
9642 {
9644 {
9645 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
9646 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
9647 {
9648 float heatPermCoef = 1.0;
9650 while (ent)
9651 {
9652 heatPermCoef *= ent.GetHeatPermeabilityCoef();
9653 ent = ent.GetHierarchyParent();
9654 }
9655
9656 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
9657 }
9658 }
9659 }
9660
9662 {
9663
9664 EntityAI parent = GetHierarchyParent();
9665 if (!parent)
9666 {
9667 hasParent = false;
9668 hasRootAsPlayer = false;
9669 }
9670 else
9671 {
9672 hasParent = true;
9673 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
9674 refParentIB =
ItemBase.Cast(parent);
9675 }
9676 }
9677
9678 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
9679 {
9680
9681 }
9682
9684 {
9685
9686 return false;
9687 }
9688
9690 {
9691
9692
9693 return false;
9694 }
9695
9697 {
9698
9699 return false;
9700 }
9701
9704 {
9705 return !GetIsFrozen() &&
IsOpen();
9706 }
9707
9709 {
9710 bool hasParent = false, hasRootAsPlayer = false;
9712
9713 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
9714 bool foodDecay =
g_Game.IsFoodDecayEnabled();
9715
9716 if (wwtu || foodDecay)
9717 {
9721
9722 if (processWetness || processTemperature || processDecay)
9723 {
9725
9726 if (processWetness)
9727 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
9728
9729 if (processTemperature)
9731
9732 if (processDecay)
9733 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
9734 }
9735 }
9736 }
9737
9740 {
9742 }
9743
9745 {
9748
9749 return super.GetTemperatureFreezeThreshold();
9750 }
9751
9753 {
9756
9757 return super.GetTemperatureThawThreshold();
9758 }
9759
9761 {
9764
9765 return super.GetItemOverheatThreshold();
9766 }
9767
9769 {
9771 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
9772
9773 return super.GetTemperatureFreezeTime();
9774 }
9775
9777 {
9779 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
9780
9781 return super.GetTemperatureThawTime();
9782 }
9783
9788
9790 {
9791 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
9792 }
9793
9795 {
9796 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
9797 }
9798
9801 {
9803 }
9804
9806 {
9808 }
9809
9811 {
9813 }
9814
9817 {
9818 return null;
9819 }
9820
9823 {
9824 return false;
9825 }
9826
9828 {
9830 {
9833 if (!trg)
9834 {
9836 explosive = this;
9837 }
9838
9839 explosive.PairRemote(trg);
9841
9842 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
9843 trg.SetPersistentPairID(persistentID);
9844 explosive.SetPersistentPairID(persistentID);
9845
9846 return true;
9847 }
9848 return false;
9849 }
9850
9853 {
9854 float ret = 1.0;
9857 ret *= GetHealth01();
9858
9859 return ret;
9860 }
9861
9862 #ifdef DEVELOPER
9863 override void SetDebugItem()
9864 {
9865 super.SetDebugItem();
9866 _itemBase = this;
9867 }
9868
9870 {
9871 string text = super.GetDebugText();
9872
9874 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
9875
9876 return text;
9877 }
9878 #endif
9879
9881 {
9882 return true;
9883 }
9884
9886
9888
9890 {
9893 }
9894
9895
9903
9919}
9920
9922{
9924 if (entity)
9925 {
9926 bool is_item = entity.IsInherited(
ItemBase);
9927 if (is_item && full_quantity)
9928 {
9931 }
9932 }
9933 else
9934 {
9936 return NULL;
9937 }
9938 return entity;
9939}
9940
9942{
9943 if (item)
9944 {
9945 if (health > 0)
9946 item.SetHealth("", "", health);
9947
9948 if (item.CanHaveTemperature())
9949 {
9951 if (item.CanFreeze())
9952 item.SetFrozen(false);
9953 }
9954
9955 if (item.HasEnergyManager())
9956 {
9957 if (quantity >= 0)
9958 {
9959 item.GetCompEM().SetEnergy0To1(quantity);
9960 }
9961 else
9962 {
9964 }
9965 }
9966 else if (item.IsMagazine())
9967 {
9968 Magazine mag = Magazine.Cast(item);
9969 if (quantity >= 0)
9970 {
9971 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
9972 }
9973 else
9974 {
9976 }
9977
9978 }
9979 else
9980 {
9981 if (quantity >= 0)
9982 {
9983 item.SetQuantityNormalized(quantity, false);
9984 }
9985 else
9986 {
9988 }
9989
9990 }
9991 }
9992}
9993
9994#ifdef DEVELOPER
9996#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
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 SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void 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)
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)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
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()
override int GetLiquidType()
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)
void Open()
Implementations only.
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 EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
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 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)
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
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
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
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 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.