5200{
5202 {
5203 return true;
5204 }
5205};
5206
5207
5208
5210{
5214
5216
5219
5220
5221
5222
5223
5232
5238
5243
5248
5269 protected bool m_IsResultOfSplit
5270
5272
5277
5278
5279
5281
5285
5286
5287
5289
5292
5293
5294
5300
5301
5309
5312
5313
5315
5316
5318
5319
5324
5325
5330
5331
5333
5334
5336 {
5341
5342 if (!
GetGame().IsDedicatedServer())
5343 {
5345 {
5347
5349 {
5351 }
5352 }
5353
5356 }
5357
5358 m_OldLocation = null;
5359
5361 {
5363 }
5364
5365 if (ConfigIsExisting("headSelectionsToHide"))
5366 {
5369 }
5370
5372 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5373 {
5375 }
5376
5378
5379 m_IsResultOfSplit = false;
5380
5382 }
5383
5385 {
5386 super.InitItemVariables();
5387
5393 m_Count = ConfigGetInt(
"count");
5394
5397
5402
5405
5410
5422
5426
5427
5430 if (ConfigIsExisting("canBeSplit"))
5431 {
5434 }
5435
5437 if (ConfigIsExisting("itemBehaviour"))
5439
5440
5443 RegisterNetSyncVariableInt("m_VarLiquidType");
5444 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5445
5446 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5447 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5448 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5449
5450 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5451 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5452 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5453 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5454
5455 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5456 RegisterNetSyncVariableBool("m_IsTakeable");
5457 RegisterNetSyncVariableBool("m_IsHologram");
5458
5461 {
5464 }
5465
5467
5469 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5471
5472 }
5473
5475 {
5477 }
5478
5480 {
5483 {
5488 }
5489 }
5490
5491 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5492 {
5494 {
5497 }
5498
5500 }
5501
5503 {
5509 }
5510
5512
5514 {
5516
5517 if (!action)
5518 {
5519 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5520 return;
5521 }
5522
5524 if (!ai)
5525 {
5527 return;
5528 }
5529
5531 if (!action_array)
5532 {
5533 action_array = new array<ActionBase_Basic>;
5535 }
5536 if (LogManager.IsActionLogEnable())
5537 {
5538 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5539 }
5540
5541 if (action_array.Find(action) != -1)
5542 {
5543 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5544 }
5545 else
5546 {
5547 action_array.Insert(action);
5548 }
5549 }
5550
5552 {
5554 ActionBase action = player.GetActionManager().GetAction(actionName);
5557
5558 if (action_array)
5559 {
5560 action_array.RemoveItem(action);
5561 }
5562 }
5563
5564
5565
5567 {
5568 ActionOverrideData overrideData = new ActionOverrideData();
5572
5574 if (!actionMap)
5575 {
5578 }
5579
5580 actionMap.Insert(this.
Type(), overrideData);
5581
5582 }
5583
5585
5587
5588
5590 {
5593
5596
5597 string config_to_search = "CfgVehicles";
5598 string muzzle_owner_config;
5599
5601 {
5602 if (IsInherited(Weapon))
5603 config_to_search = "CfgWeapons";
5604
5605 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5606
5607 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5608
5610
5611 if (config_OnFire_subclass_count > 0)
5612 {
5613 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5614
5615 for (int i = 0; i < config_OnFire_subclass_count; i++)
5616 {
5617 string particle_class = "";
5619 string config_OnFire_entry = config_OnFire_class + particle_class;
5620 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5621 WPOF_array.Insert(WPOF);
5622 }
5623
5624
5626 }
5627 }
5628
5630 {
5631 config_to_search = "CfgWeapons";
5632 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5633
5634 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5635
5637
5638 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5639 {
5640 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5641
5642 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5643 {
5644 string particle_class2 = "";
5646 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5647 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5648 WPOBE_array.Insert(WPOBE);
5649 }
5650
5651
5653 }
5654 }
5655 }
5656
5657
5659 {
5662
5664 {
5665 string config_to_search = "CfgVehicles";
5666
5667 if (IsInherited(Weapon))
5668 config_to_search = "CfgWeapons";
5669
5670 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5671 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5672
5673 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5674 {
5675
5677
5679 {
5681 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5683 return;
5684 }
5685
5688
5689
5690
5692 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5693
5694 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5695 {
5696 string particle_class = "";
5698 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5700
5701 if (entry_type == CT_CLASS)
5702 {
5703 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5704 WPOOH_array.Insert(WPOF);
5705 }
5706 }
5707
5708
5710 }
5711 }
5712 }
5713
5715 {
5717 }
5718
5720 {
5722 {
5724
5727
5730
5731 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5732 }
5733 }
5734
5736 {
5738 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5739
5741 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5742
5744 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5745
5747 {
5749 }
5750 }
5751
5753 {
5755 }
5756
5758 {
5761 else
5763
5765 {
5768 }
5769 else
5770 {
5773
5776 }
5777
5779 }
5780
5782 {
5784 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5785 }
5786
5788 {
5790 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5792 }
5793
5795 {
5797 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5798 }
5799
5801 {
5804
5805 OverheatingParticle OP = new OverheatingParticle();
5810
5812 }
5813
5815 {
5818
5819 return -1;
5820 }
5821
5823 {
5825 {
5828
5829 for (int i = count; i > 0; --i)
5830 {
5831 int id = i - 1;
5834
5837
5838 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
5839 {
5840 if (p)
5841 {
5844 }
5845 }
5846 }
5847 }
5848 }
5849
5851 {
5853 {
5855 {
5856 int id = i - 1;
5858
5859 if (OP)
5860 {
5862
5863 if (p)
5864 {
5866 }
5867
5868 delete OP;
5869 }
5870 }
5871
5874 }
5875 }
5876
5879 {
5880 return 0.0;
5881 }
5882
5883
5885 {
5886 return 250;
5887 }
5888
5890 {
5891 return 0;
5892 }
5893
5896 {
5898 return true;
5899
5900 return false;
5901 }
5902
5905 {
5908
5910 {
5912 }
5913 else
5914 {
5915
5917 }
5918
5920 }
5921
5928 {
5929 return -1;
5930 }
5931
5932
5933
5934
5936 {
5938 {
5940 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
5941
5942 if (r_index >= 0)
5943 {
5944 InventoryLocation r_il = new InventoryLocation;
5945 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
5946
5947 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
5950 {
5951 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
5952 }
5954 {
5955 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
5956 }
5957
5958 }
5959
5960 player.GetHumanInventory().ClearUserReservedLocation(this);
5961 }
5962
5965 }
5966
5967
5968
5969
5971 {
5972 return ItemBase.m_DebugActionsMask;
5973 }
5974
5976 {
5977 return ItemBase.m_DebugActionsMask & mask;
5978 }
5979
5981 {
5982 ItemBase.m_DebugActionsMask = mask;
5983 }
5984
5986 {
5987 ItemBase.m_DebugActionsMask |= mask;
5988 }
5989
5991 {
5992 ItemBase.m_DebugActionsMask &= ~mask;
5993 }
5994
5996 {
5998 {
6000 }
6001 else
6002 {
6004 }
6005 }
6006
6007
6009 {
6010 if (GetEconomyProfile())
6011 {
6012 float q_max = GetEconomyProfile().GetQuantityMax();
6013 if (q_max > 0)
6014 {
6015 float q_min = GetEconomyProfile().GetQuantityMin();
6016 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6017
6019 {
6020 ComponentEnergyManager comp = GetCompEM();
6022 {
6024 }
6025 }
6027 {
6029
6030 }
6031
6032 }
6033 }
6034 }
6035
6038 {
6039 EntityAI parent = GetHierarchyParent();
6040
6041 if (parent)
6042 {
6043 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6044 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6045 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6046 }
6047 }
6048
6051 {
6052 EntityAI parent = GetHierarchyParent();
6053
6054 if (parent)
6055 {
6056 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6057 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6058 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6059 }
6060 }
6061
6063 {
6064
6065
6066
6067
6069
6071 {
6072 if (ScriptInputUserData.CanStoreInputUserData())
6073 {
6074 ScriptInputUserData ctx = new ScriptInputUserData;
6080 ctx.
Write(use_stack_max);
6083
6085 {
6086 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6087 }
6088 }
6089 }
6090 else if (!
GetGame().IsMultiplayer())
6091 {
6093 }
6094 }
6095
6097 {
6099 }
6100
6102 {
6104 }
6105
6107 {
6109 }
6110
6112 {
6113
6114 return false;
6115 }
6116
6118 {
6119 return false;
6120 }
6121
6125 {
6126 return false;
6127 }
6128
6130 {
6131 return "";
6132 }
6133
6135
6137 {
6138 return false;
6139 }
6140
6142 {
6143 return true;
6144 }
6145
6146
6147
6149 {
6150 return true;
6151 }
6152
6154 {
6155 return true;
6156 }
6157
6159 {
6160 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6162 }
6163
6165 {
6167 }
6168
6170 {
6172 if (!is_being_placed)
6174 SetSynchDirty();
6175 }
6176
6177
6179
6181 {
6183 }
6184
6186 {
6188 }
6189
6191 {
6192 return 1;
6193 }
6194
6196 {
6197 return false;
6198 }
6199
6201 {
6203 SetSynchDirty();
6204 }
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6241 {
6242 super.OnMovedInsideCargo(container);
6243
6244 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6245 }
6246
6247 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6248 {
6249 super.EEItemLocationChanged(oldLoc,newLoc);
6250
6251 PlayerBase new_player = null;
6252 PlayerBase old_player = null;
6253
6254 if (newLoc.GetParent())
6255 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6256
6257 if (oldLoc.GetParent())
6258 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6259
6261 {
6262 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6263
6264 if (r_index >= 0)
6265 {
6266 InventoryLocation r_il = new InventoryLocation;
6267 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6268
6269 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6272 {
6273 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6274 }
6276 {
6277 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6278 }
6279
6280 }
6281 }
6282
6284 {
6285 if (new_player)
6286 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6287
6288 if (new_player == old_player)
6289 {
6290
6291 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6292 {
6294 {
6295 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6296 {
6297 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6298 }
6299 }
6300 else
6301 {
6302 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6303 }
6304 }
6305
6306 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6307 {
6308 int type = oldLoc.GetType();
6310 {
6311 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6312 }
6314 {
6315 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6316 }
6317 }
6318 if (!m_OldLocation)
6319 {
6320 m_OldLocation = new InventoryLocation;
6321 }
6322 m_OldLocation.Copy(oldLoc);
6323 }
6324 else
6325 {
6326 if (m_OldLocation)
6327 {
6328 m_OldLocation.Reset();
6329 }
6330 }
6331
6333 }
6334 else
6335 {
6336 if (new_player)
6337 {
6338 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6339 if (res_index >= 0)
6340 {
6341 InventoryLocation il = new InventoryLocation;
6342 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6344 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6347 {
6348 il.
GetParent().GetOnReleaseLock().Invoke(it);
6349 }
6351 {
6353 }
6354
6355 }
6356 }
6358 {
6359
6361 }
6362
6363 if (m_OldLocation)
6364 {
6365 m_OldLocation.Reset();
6366 }
6367 }
6368 }
6369
6370 override void EOnContact(IEntity other, Contact extra)
6371 {
6373 {
6374 int liquidType = -1;
6376 if (impactSpeed > 0.0)
6377 {
6379 #ifndef SERVER
6381 #else
6383 SetSynchDirty();
6384 #endif
6386 }
6387 }
6388
6389 #ifdef SERVER
6390 if (GetCompEM() && GetCompEM().IsPlugged())
6391 {
6392 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6393 GetCompEM().UnplugThis();
6394 }
6395 #endif
6396 }
6397
6399
6401 {
6403 }
6404
6406 {
6407
6408 }
6409
6411 {
6412 super.OnItemLocationChanged(old_owner, new_owner);
6413
6414 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6415 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6416
6417 if (!relatedPlayer && playerNew)
6418 relatedPlayer = playerNew;
6419
6420 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6421 {
6423 if (actionMgr)
6424 {
6425 ActionBase currentAction = actionMgr.GetRunningAction();
6426 if (currentAction)
6428 }
6429 }
6430
6431 Man ownerPlayerOld = null;
6432 Man ownerPlayerNew = null;
6433
6434 if (old_owner)
6435 {
6436 if (old_owner.
IsMan())
6437 {
6438 ownerPlayerOld = Man.Cast(old_owner);
6439 }
6440 else
6441 {
6442 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6443 }
6444 }
6445 else
6446 {
6448 {
6450
6451 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6452 {
6453 GetCompEM().UnplugThis();
6454 }
6455 }
6456 }
6457
6458 if (new_owner)
6459 {
6460 if (new_owner.
IsMan())
6461 {
6462 ownerPlayerNew = Man.Cast(new_owner);
6463 }
6464 else
6465 {
6466 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6467 }
6468 }
6469
6470 if (ownerPlayerOld != ownerPlayerNew)
6471 {
6472 if (ownerPlayerOld)
6473 {
6474 array<EntityAI> subItemsExit = new array<EntityAI>;
6476 for (int i = 0; i < subItemsExit.Count(); i++)
6477 {
6480 }
6481 }
6482
6483 if (ownerPlayerNew)
6484 {
6485 array<EntityAI> subItemsEnter = new array<EntityAI>;
6487 for (int j = 0; j < subItemsEnter.Count(); j++)
6488 {
6491 }
6492 }
6493 }
6494 else if (ownerPlayerNew != null)
6495 {
6496 PlayerBase nplayer;
6497 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6498 {
6499 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6501 for (int k = 0; k < subItemsUpdate.Count(); k++)
6502 {
6504 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6505 }
6506 }
6507 }
6508
6509 if (old_owner)
6510 old_owner.OnChildItemRemoved(this);
6511 if (new_owner)
6512 new_owner.OnChildItemReceived(this);
6513 }
6514
6515
6517 {
6518 super.EEDelete(parent);
6519 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6520 if (player)
6521 {
6523
6524 if (player.IsAlive())
6525 {
6526 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6527 if (r_index >= 0)
6528 {
6529 InventoryLocation r_il = new InventoryLocation;
6530 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6531
6532 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6535 {
6536 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6537 }
6539 {
6540 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6541 }
6542
6543 }
6544
6545 player.RemoveQuickBarEntityShortcut(this);
6546 }
6547 }
6548 }
6549
6551 {
6552 super.EEKilled(killer);
6553
6556 {
6557 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6558 {
6559 if (IsMagazine())
6560 {
6561 if (Magazine.Cast(this).GetAmmoCount() > 0)
6562 {
6564 }
6565 }
6566 else
6567 {
6569 }
6570 }
6571 }
6572 }
6573
6575 {
6576 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6577
6578 super.OnWasAttached(parent, slot_id);
6579
6582
6584 }
6585
6587 {
6588 super.OnWasDetached(parent, slot_id);
6589
6592 }
6593
6595 {
6596 int idx;
6599
6600 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6601 if (inventory_slots.Count() < 1)
6602 {
6603 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6604 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6605 }
6606 else
6607 {
6608 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6609 }
6610
6611 idx = inventory_slots.Find(slot);
6612 if (idx < 0)
6613 return "";
6614
6615 return attach_types.Get(idx);
6616 }
6617
6619 {
6620 int idx = -1;
6621 string slot;
6622
6625
6626 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6627 if (inventory_slots.Count() < 1)
6628 {
6629 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6630 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6631 }
6632 else
6633 {
6634 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6635 if (detach_types.Count() < 1)
6636 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6637 }
6638
6639 for (int i = 0; i < inventory_slots.Count(); i++)
6640 {
6641 slot = inventory_slots.Get(i);
6642 }
6643
6644 if (slot != "")
6645 {
6646 if (detach_types.Count() == 1)
6647 idx = 0;
6648 else
6649 idx = inventory_slots.Find(slot);
6650 }
6651 if (idx < 0)
6652 return "";
6653
6654 return detach_types.Get(idx);
6655 }
6656
6658 {
6659
6661
6662
6663 float min_time = 1;
6664 float max_time = 3;
6665 float delay = Math.RandomFloat(min_time, max_time);
6666
6667 explode_timer.Run(delay, this, "DoAmmoExplosion");
6668 }
6669
6671 {
6672 Magazine magazine = Magazine.Cast(this);
6673 int pop_sounds_count = 6;
6674 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6675
6676
6677 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6678 string sound_name = pop_sounds[ sound_idx ];
6680
6681
6682 magazine.ServerAddAmmoCount(-1);
6683
6684
6685 float min_temp_to_explode = 100;
6686
6687 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
6688 {
6690 }
6691 }
6692
6693
6694 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6695 {
6696 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6697
6698 const int CHANCE_DAMAGE_CARGO = 4;
6699 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6700 const int CHANCE_DAMAGE_NOTHING = 2;
6701
6703 {
6704 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6705 int chances;
6706 int rnd;
6707
6708 if (GetInventory().GetCargo())
6709 {
6710 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6711 rnd = Math.RandomInt(0,chances);
6712
6713 if (rnd < CHANCE_DAMAGE_CARGO)
6714 {
6716 }
6717 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6718 {
6720 }
6721 }
6722 else
6723 {
6724 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6725 rnd = Math.RandomInt(0,chances);
6726
6727 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6728 {
6730 }
6731 }
6732 }
6733 }
6734
6736 {
6737 if (GetInventory().GetCargo())
6738 {
6739 int item_count = GetInventory().GetCargo().GetItemCount();
6740 if (item_count > 0)
6741 {
6742 int random_pick = Math.RandomInt(0, item_count);
6744 if (!item.IsExplosive())
6745 {
6746 item.AddHealth("","",damage);
6747 return true;
6748 }
6749 }
6750 }
6751 return false;
6752 }
6753
6755 {
6756 int attachment_count = GetInventory().AttachmentCount();
6757 if (attachment_count > 0)
6758 {
6759 int random_pick = Math.RandomInt(0, attachment_count);
6760 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
6761 if (!attachment.IsExplosive())
6762 {
6763 attachment.AddHealth("","",damage);
6764 return true;
6765 }
6766 }
6767 return false;
6768 }
6769
6771 {
6773 }
6774
6776 {
6778 return GetInventory().CanRemoveEntity();
6779
6780 return false;
6781 }
6782
6784 {
6785
6787 return false;
6788
6789
6791 return false;
6792
6793
6794
6796 if (delta == 0)
6797 return false;
6798
6799
6800 return true;
6801 }
6802
6804 {
6806 {
6807 if (ScriptInputUserData.CanStoreInputUserData())
6808 {
6809 ScriptInputUserData ctx = new ScriptInputUserData;
6814 ctx.
Write(destination_entity);
6818 }
6819 }
6820 else if (!
GetGame().IsMultiplayer())
6821 {
6823 }
6824 }
6825
6827 {
6828 float split_quantity_new;
6832 InventoryLocation loc = new InventoryLocation;
6833
6834 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6835 {
6837 split_quantity_new = stack_max;
6838 else
6840
6842 {
6843 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6844 if (new_item)
6845 {
6846 new_item.SetResultOfSplit(true);
6847 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6849 new_item.
SetQuantity(split_quantity_new,
false,
true);
6850 }
6851 }
6852 }
6853 else if (destination_entity && slot_id == -1)
6854 {
6855 if (quantity > stack_max)
6856 split_quantity_new = stack_max;
6857 else
6858 split_quantity_new = quantity;
6859
6861 {
6863 {
6866 }
6867
6868 if (new_item)
6869 {
6870 new_item.SetResultOfSplit(true);
6871 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6873 new_item.
SetQuantity(split_quantity_new,
false,
true);
6874 }
6875 }
6876 }
6877 else
6878 {
6879 if (stack_max != 0)
6880 {
6882 {
6884 }
6885
6886 if (split_quantity_new == 0)
6887 {
6888 if (!
GetGame().IsMultiplayer())
6889 player.PhysicalPredictiveDropItem(this);
6890 else
6891 player.ServerDropEntity(this);
6892 return;
6893 }
6894
6896 {
6898
6899 if (new_item)
6900 {
6901 new_item.SetResultOfSplit(true);
6902 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6905 new_item.PlaceOnSurface();
6906 }
6907 }
6908 }
6909 }
6910 }
6911
6913 {
6914 float split_quantity_new;
6918 InventoryLocation loc = new InventoryLocation;
6919
6920 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6921 {
6923 split_quantity_new = stack_max;
6924 else
6926
6928 {
6929 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6930 if (new_item)
6931 {
6932 new_item.SetResultOfSplit(true);
6933 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6935 new_item.
SetQuantity(split_quantity_new,
false,
true);
6936 }
6937 }
6938 }
6939 else if (destination_entity && slot_id == -1)
6940 {
6941 if (quantity > stack_max)
6942 split_quantity_new = stack_max;
6943 else
6944 split_quantity_new = quantity;
6945
6947 {
6949 {
6952 }
6953
6954 if (new_item)
6955 {
6956 new_item.SetResultOfSplit(true);
6957 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6959 new_item.
SetQuantity(split_quantity_new,
false,
true);
6960 }
6961 }
6962 }
6963 else
6964 {
6965 if (stack_max != 0)
6966 {
6968 {
6970 }
6971
6973 {
6975
6976 if (new_item)
6977 {
6978 new_item.SetResultOfSplit(true);
6979 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6982 new_item.PlaceOnSurface();
6983 }
6984 }
6985 }
6986 }
6987 }
6988
6990 {
6992 {
6993 if (ScriptInputUserData.CanStoreInputUserData())
6994 {
6995 ScriptInputUserData ctx = new ScriptInputUserData;
7000 dst.WriteToContext(ctx);
7002 }
7003 }
7004 else if (!
GetGame().IsMultiplayer())
7005 {
7007 }
7008 }
7009
7011 {
7013 {
7014 if (ScriptInputUserData.CanStoreInputUserData())
7015 {
7016 ScriptInputUserData ctx = new ScriptInputUserData;
7021 ctx.
Write(destination_entity);
7027 }
7028 }
7029 else if (!
GetGame().IsMultiplayer())
7030 {
7032 }
7033 }
7034
7036 {
7038 }
7039
7041 {
7043 float split_quantity_new;
7045 if (dst.IsValid())
7046 {
7047 int slot_id = dst.GetSlot();
7049
7050 if (quantity > stack_max)
7051 split_quantity_new = stack_max;
7052 else
7053 split_quantity_new = quantity;
7054
7056 {
7058
7059 if (new_item)
7060 {
7061 new_item.SetResultOfSplit(true);
7062 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7064 new_item.
SetQuantity(split_quantity_new,
false,
true);
7065 }
7066
7067 return new_item;
7068 }
7069 }
7070
7071 return null;
7072 }
7073
7075 {
7077 float split_quantity_new;
7079 if (destination_entity)
7080 {
7082 if (quantity > stackable)
7083 split_quantity_new = stackable;
7084 else
7085 split_quantity_new = quantity;
7086
7088 {
7089 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7090 if (new_item)
7091 {
7092 new_item.SetResultOfSplit(true);
7093 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7095 new_item.
SetQuantity(split_quantity_new,
false,
true);
7096 }
7097 }
7098 }
7099 }
7100
7102 {
7104 {
7105 if (ScriptInputUserData.CanStoreInputUserData())
7106 {
7107 ScriptInputUserData ctx = new ScriptInputUserData;
7112 ItemBase destination_entity =
this;
7113 ctx.
Write(destination_entity);
7117 }
7118 }
7119 else if (!
GetGame().IsMultiplayer())
7120 {
7122 }
7123 }
7124
7126 {
7128 float split_quantity_new;
7130 if (player)
7131 {
7133 if (quantity > stackable)
7134 split_quantity_new = stackable;
7135 else
7136 split_quantity_new = quantity;
7137
7139 {
7140 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7141 new_item =
ItemBase.Cast(in_hands);
7142 if (new_item)
7143 {
7144 new_item.SetResultOfSplit(true);
7145 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7147 new_item.SetQuantity(split_quantity_new, false, true);
7148 }
7149 }
7150 }
7151 }
7152
7154 {
7156 float split_quantity_new = Math.Floor(quantity * 0.5);
7157
7159 return;
7160
7162
7163 if (new_item)
7164 {
7165 if (new_item.GetQuantityMax() < split_quantity_new)
7166 {
7167 split_quantity_new = new_item.GetQuantityMax();
7168 }
7169
7170 new_item.SetResultOfSplit(true);
7171 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7172
7174 {
7177 }
7178 else
7179 {
7181 new_item.
SetQuantity(split_quantity_new,
false,
true);
7182 }
7183 }
7184 }
7185
7187 {
7189 float split_quantity_new = Math.Floor(quantity / 2);
7190
7192 return;
7193
7194 InventoryLocation invloc = new InventoryLocation;
7196
7198 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7199
7200 if (new_item)
7201 {
7202 if (new_item.GetQuantityMax() < split_quantity_new)
7203 {
7204 split_quantity_new = new_item.GetQuantityMax();
7205 }
7207 {
7210 }
7211 else if (split_quantity_new > 1)
7212 {
7214 new_item.
SetQuantity(split_quantity_new,
false,
true);
7215 }
7216 }
7217 }
7218
7221 {
7222 SetWeightDirty();
7224
7225 if (parent)
7226 parent.OnAttachmentQuantityChangedEx(this, delta);
7227
7229 {
7231 {
7233 }
7235 {
7236 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7238 }
7239 }
7240
7241 }
7242
7245 {
7246
7247 }
7248
7251 {
7253 }
7254
7256 {
7257 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7258
7260 {
7261 if (newLevel == GameConstants.STATE_RUINED)
7262 {
7264 EntityAI parent = GetHierarchyParent();
7265 if (parent && parent.IsFireplace())
7266 {
7267 CargoBase cargo = GetInventory().GetCargo();
7268 if (cargo)
7269 {
7271 {
7273 }
7274 }
7275 }
7276 }
7277
7279 {
7280
7282 return;
7283 }
7284
7285 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7286 {
7288 }
7289 }
7290 }
7291
7292
7294 {
7295 super.OnRightClick();
7296
7298 {
7300 {
7301 if (ScriptInputUserData.CanStoreInputUserData())
7302 {
7303 EntityAI root = GetHierarchyRoot();
7304 Man playerOwner = GetHierarchyRootPlayer();
7305 InventoryLocation dst = new InventoryLocation;
7306
7307
7308 if (!playerOwner && root && root == this)
7309 {
7311 }
7312 else
7313 {
7314
7315 GetInventory().GetCurrentInventoryLocation(dst);
7317 {
7320 {
7322 }
7323 else
7324 {
7326
7327
7328 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7329 {
7331 }
7332 else
7333 {
7334 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7335 }
7336 }
7337 }
7338 }
7339
7340 ScriptInputUserData ctx = new ScriptInputUserData;
7348 }
7349 }
7350 else if (!
GetGame().IsMultiplayer())
7351 {
7353 }
7354 }
7355 }
7356
7358 {
7359 if (root)
7360 {
7361 vector m4[4];
7362 root.GetTransform(m4);
7363 dst.SetGround(this, m4);
7364 }
7365 else
7366 {
7367 GetInventory().GetCurrentInventoryLocation(dst);
7368 }
7369 }
7370
7371 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7372 {
7373
7374 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7375 return false;
7376
7377 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7378 return false;
7379
7380
7382 return false;
7383
7384
7385 Magazine mag = Magazine.Cast(this);
7386 if (mag)
7387 {
7388 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7389 return false;
7390
7391 if (stack_max_limit)
7392 {
7393 Magazine other_mag = Magazine.Cast(other_item);
7394 if (other_item)
7395 {
7396 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7397 return false;
7398 }
7399
7400 }
7401 }
7402 else
7403 {
7404
7406 return false;
7407
7409 return false;
7410 }
7411
7412 PlayerBase player = null;
7413 if (CastTo(player, GetHierarchyRootPlayer()))
7414 {
7415 if (player.GetInventory().HasAttachment(this))
7416 return false;
7417
7418 if (player.IsItemsToDelete())
7419 return false;
7420 }
7421
7422 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7423 return false;
7424
7425 int slotID;
7427 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7428 return false;
7429
7430 return true;
7431 }
7432
7434 {
7436 }
7437
7439 {
7440 return m_IsResultOfSplit;
7441 }
7442
7444 {
7445 m_IsResultOfSplit = value;
7446 }
7447
7449 {
7451 }
7452
7454 {
7455 float other_item_quantity = other_item.GetQuantity();
7456 float this_free_space;
7457
7459
7461
7462 if (other_item_quantity > this_free_space)
7463 {
7464 return this_free_space;
7465 }
7466 else
7467 {
7468 return other_item_quantity;
7469 }
7470 }
7471
7473 {
7475 }
7476
7478 {
7480 return;
7481
7482 if (!IsMagazine() && other_item)
7483 {
7485 if (quantity_used != 0)
7486 {
7487 float hp1 = GetHealth01("","");
7488 float hp2 = other_item.GetHealth01("","");
7489 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7490 hpResult = hpResult / (
GetQuantity() + quantity_used);
7491
7492 hpResult *= GetMaxHealth();
7493 Math.Round(hpResult);
7494 SetHealth("", "Health", hpResult);
7495
7497 other_item.AddQuantity(-quantity_used);
7498 }
7499 }
7501 }
7502
7504 {
7505 #ifdef SERVER
7506 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7507 GetHierarchyParent().IncreaseLifetimeUp();
7508 #endif
7509 };
7510
7512 {
7513 PlayerBase p = PlayerBase.Cast(player);
7514
7515 array<int> recipesIds = p.m_Recipes;
7516 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7517 if (moduleRecipesManager)
7518 {
7519 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7520 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7521 }
7522
7523 for (int i = 0;i < recipesIds.Count(); i++)
7524 {
7525 int key = recipesIds.Get(i);
7526 string recipeName = moduleRecipesManager.GetRecipeName(key);
7528 }
7529 }
7530
7531
7532 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7533 {
7534 super.GetDebugActions(outputList);
7535
7536
7542
7543
7548
7553
7554
7558
7559
7561 {
7565 }
7566
7569
7570
7574
7576
7577 InventoryLocation loc = new InventoryLocation();
7578 GetInventory().GetCurrentInventoryLocation(loc);
7580 {
7581 if (Gizmo_IsSupported())
7584 }
7585
7587 }
7588
7589
7590
7591
7593 {
7594 super.OnAction(action_id, player, ctx);
7595
7597 {
7598 switch (action_id)
7599 {
7602 return true;
7605 return true;
7606 }
7607 }
7608
7610 {
7611 switch (action_id)
7612 {
7614 Delete();
7615 return true;
7616 }
7617 }
7618
7619 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7620 {
7621 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7622 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7623 PlayerBase p = PlayerBase.Cast(player);
7624 if (
EActions.RECIPES_RANGE_START < 1000)
7625 {
7626 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7627 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7628 }
7629 }
7630 #ifndef SERVER
7631 else if (action_id ==
EActions.WATCH_PLAYER)
7632 {
7633 PluginDeveloper.SetDeveloperItemClientEx(player);
7634 }
7635 #endif
7637 {
7638 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7639 {
7640 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7641 OnDebugButtonPressServer(id + 1);
7642 }
7643
7644 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7645 {
7646 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7648 }
7649
7650 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7651 {
7652 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7654 }
7655
7656 else if (action_id ==
EActions.ADD_QUANTITY)
7657 {
7658 if (IsMagazine())
7659 {
7660 Magazine mag = Magazine.Cast(this);
7661 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7662 }
7663 else
7664 {
7666 }
7667
7668 if (m_EM)
7669 {
7670 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7671 }
7672
7673 }
7674
7675 else if (action_id ==
EActions.REMOVE_QUANTITY)
7676 {
7677 if (IsMagazine())
7678 {
7679 Magazine mag2 = Magazine.Cast(this);
7680 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7681 }
7682 else
7683 {
7685 }
7686 if (m_EM)
7687 {
7688 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7689 }
7690
7691 }
7692
7693 else if (action_id ==
EActions.SET_QUANTITY_0)
7694 {
7696
7697 if (m_EM)
7698 {
7699 m_EM.SetEnergy(0);
7700 }
7701 }
7702
7703 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7704 {
7706
7707 if (m_EM)
7708 {
7709 m_EM.SetEnergy(m_EM.GetEnergyMax());
7710 }
7711 }
7712
7713 else if (action_id ==
EActions.ADD_HEALTH)
7714 {
7715 AddHealth("","",GetMaxHealth("","Health")/5);
7716 }
7717 else if (action_id ==
EActions.REMOVE_HEALTH)
7718 {
7719 AddHealth("","",-GetMaxHealth("","Health")/5);
7720 }
7721 else if (action_id ==
EActions.DESTROY_HEALTH)
7722 {
7723 SetHealth01("","",0);
7724 }
7725 else if (action_id ==
EActions.WATCH_ITEM)
7726 {
7728 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7729 #ifdef DEVELOPER
7730 SetDebugDeveloper_item(this);
7731 #endif
7732 }
7733
7734 else if (action_id ==
EActions.ADD_TEMPERATURE)
7735 {
7736 AddTemperature(20);
7737
7738 }
7739
7740 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7741 {
7742 AddTemperature(-20);
7743
7744 }
7745
7746 else if (action_id ==
EActions.FLIP_FROZEN)
7747 {
7748 SetFrozen(!GetIsFrozen());
7749
7750 }
7751
7752 else if (action_id ==
EActions.ADD_WETNESS)
7753 {
7755
7756 }
7757
7758 else if (action_id ==
EActions.REMOVE_WETNESS)
7759 {
7761
7762 }
7763
7764 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7765 {
7768
7769
7770 }
7771
7772 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
7773 {
7776 }
7777
7778 else if (action_id ==
EActions.MAKE_SPECIAL)
7779 {
7780 auto debugParams = DebugSpawnParams.WithPlayer(player);
7781 OnDebugSpawnEx(debugParams);
7782 }
7783
7784 }
7785
7786
7787 return false;
7788 }
7789
7790
7791
7792
7796
7799
7800
7801
7803 {
7804 return false;
7805 }
7806
7807
7809 {
7810 return true;
7811 }
7812
7813
7815 {
7816 return true;
7817 }
7818
7819
7820
7822 {
7823 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
7825 }
7826
7829 {
7830 return null;
7831 }
7832
7834 {
7835 return false;
7836 }
7837
7839 {
7840 return false;
7841 }
7842
7846
7847
7849 {
7850 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7851 return module_repairing.CanRepair(this, item_repair_kit);
7852 }
7853
7854
7855 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
7856 {
7857 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7858 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
7859 }
7860
7861
7863 {
7864
7865
7866
7867
7868
7869
7870
7871
7872 return 1;
7873 }
7874
7875
7876
7878 {
7880 }
7881
7882
7883
7885 {
7887 }
7888
7889
7898 {
7899 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7900
7901 if (player)
7902 {
7903 player.MessageStatus(text);
7904 }
7905 }
7906
7907
7916 {
7917 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7918
7919 if (player)
7920 {
7921 player.MessageAction(text);
7922 }
7923 }
7924
7925
7934 {
7935 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7936
7937 if (player)
7938 {
7939 player.MessageFriendly(text);
7940 }
7941 }
7942
7943
7952 {
7953 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7954
7955 if (player)
7956 {
7957 player.MessageImportant(text);
7958 }
7959 }
7960
7962 {
7963 return true;
7964 }
7965
7966
7967 override bool KindOf(
string tag)
7968 {
7969 bool found = false;
7970 string item_name = this.
GetType();
7973
7974 int array_size = item_tag_array.Count();
7975 for (int i = 0; i < array_size; i++)
7976 {
7977 if (item_tag_array.Get(i) == tag)
7978 {
7979 found = true;
7980 break;
7981 }
7982 }
7983 return found;
7984 }
7985
7986
7988 {
7989
7990 super.OnRPC(sender, rpc_type,ctx);
7991
7992
7993 switch (rpc_type)
7994 {
7995 #ifndef SERVER
7996 case ERPCs.RPC_SOUND_LOCK_ATTACH:
7997 Param2<bool, string> p = new Param2<bool, string>(false, "");
7998
8000 return;
8001
8002 bool play = p.param1;
8003 string soundSet = p.param2;
8004
8005 if (play)
8006 {
8008 {
8010 {
8012 }
8013 }
8014 else
8015 {
8017 }
8018 }
8019 else
8020 {
8022 }
8023
8024 break;
8025 #endif
8026
8027 }
8028
8030 {
8032 }
8033 }
8034
8035
8036
8037
8039 {
8040 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8041 return plugin.GetID(
name);
8042 }
8043
8045 {
8046 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8047 return plugin.GetName(id);
8048 }
8049
8052 {
8053
8054
8055 int varFlags;
8056 if (!ctx.
Read(varFlags))
8057 return;
8058
8059 if (varFlags & ItemVariableFlags.FLOAT)
8060 {
8062 }
8063 }
8064
8066 {
8067
8068 super.SerializeNumericalVars(floats_out);
8069
8070
8071
8073 {
8075 }
8076
8078 {
8080 }
8081
8083 {
8085 }
8086
8088 {
8093 }
8094
8096 {
8098 }
8099 }
8100
8102 {
8103
8104 super.DeSerializeNumericalVars(floats);
8105
8106
8107 int index = 0;
8108 int mask = Math.Round(floats.Get(index));
8109
8110 index++;
8111
8113 {
8115 {
8117 }
8118 else
8119 {
8120 float quantity = floats.Get(index);
8122 }
8123 index++;
8124 }
8125
8127 {
8128 float wet = floats.Get(index);
8130 index++;
8131 }
8132
8134 {
8135 int liquidtype = Math.Round(floats.Get(index));
8137 index++;
8138 }
8139
8141 {
8143 index++;
8145 index++;
8147 index++;
8149 index++;
8150 }
8151
8153 {
8154 int cleanness = Math.Round(floats.Get(index));
8156 index++;
8157 }
8158 }
8159
8161 {
8162 super.WriteVarsToCTX(ctx);
8163
8164
8166 {
8168 }
8169
8171 {
8173 }
8174
8176 {
8178 }
8179
8181 {
8182 int r,g,b,a;
8188 }
8189
8191 {
8193 }
8194 }
8195
8197 {
8198 if (!super.ReadVarsFromCTX(ctx,version))
8199 return false;
8200
8201 int intValue;
8202 float value;
8203
8204 if (version < 140)
8205 {
8206 if (!ctx.
Read(intValue))
8207 return false;
8208
8209 m_VariablesMask = intValue;
8210 }
8211
8213 {
8214 if (!ctx.
Read(value))
8215 return false;
8216
8218 {
8220 }
8221 else
8222 {
8224 }
8225 }
8226
8227 if (version < 140)
8228 {
8230 {
8231 if (!ctx.
Read(value))
8232 return false;
8233 SetTemperatureDirect(value);
8234 }
8235 }
8236
8238 {
8239 if (!ctx.
Read(value))
8240 return false;
8242 }
8243
8245 {
8246 if (!ctx.
Read(intValue))
8247 return false;
8249 }
8250
8252 {
8253 int r,g,b,a;
8255 return false;
8257 return false;
8259 return false;
8261 return false;
8262
8264 }
8265
8267 {
8268 if (!ctx.
Read(intValue))
8269 return false;
8271 }
8272
8273 if (version >= 138 && version < 140)
8274 {
8276 {
8277 if (!ctx.
Read(intValue))
8278 return false;
8279 SetFrozen(intValue);
8280 }
8281 }
8282
8283 return true;
8284 }
8285
8286
8288 {
8291 {
8293 }
8294
8295 if (!super.OnStoreLoad(ctx, version))
8296 {
8298 return false;
8299 }
8300
8301 if (version >= 114)
8302 {
8303 bool hasQuickBarIndexSaved;
8304
8305 if (!ctx.
Read(hasQuickBarIndexSaved))
8306 {
8308 return false;
8309 }
8310
8311 if (hasQuickBarIndexSaved)
8312 {
8313 int itmQBIndex;
8314
8315
8316 if (!ctx.
Read(itmQBIndex))
8317 {
8319 return false;
8320 }
8321
8322 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8323 if (itmQBIndex != -1 && parentPlayer)
8324 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8325 }
8326 }
8327 else
8328 {
8329
8330 PlayerBase player;
8331 int itemQBIndex;
8332 if (version ==
int.
MAX)
8333 {
8334 if (!ctx.
Read(itemQBIndex))
8335 {
8337 return false;
8338 }
8339 }
8340 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8341 {
8342
8343 if (!ctx.
Read(itemQBIndex))
8344 {
8346 return false;
8347 }
8348 if (itemQBIndex != -1 && player)
8349 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8350 }
8351 }
8352
8353 if (version < 140)
8354 {
8355
8356 if (!LoadVariables(ctx, version))
8357 {
8359 return false;
8360 }
8361 }
8362
8363
8365 {
8367 return false;
8368 }
8369 if (version >= 132)
8370 {
8372 if (raib)
8373 {
8375 {
8377 return false;
8378 }
8379 }
8380 }
8381
8383 return true;
8384 }
8385
8386
8387
8389 {
8390 super.OnStoreSave(ctx);
8391
8392 PlayerBase player;
8393 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8394 {
8396
8397 int itemQBIndex = -1;
8398 itemQBIndex = player.FindQuickBarEntityIndex(this);
8399 ctx.
Write(itemQBIndex);
8400 }
8401 else
8402 {
8404 }
8405
8407
8409 if (raib)
8410 {
8412 }
8413 }
8414
8415
8417 {
8418 super.AfterStoreLoad();
8419
8421 {
8423 }
8424
8426 {
8429 }
8430 }
8431
8433 {
8434 super.EEOnAfterLoad();
8435
8437 {
8439 }
8440
8443 }
8444
8446 {
8447 return false;
8448 }
8449
8450
8451
8453 {
8455 {
8456 #ifdef PLATFORM_CONSOLE
8457
8459 {
8461 if (menu)
8462 {
8464 }
8465 }
8466 #endif
8467 }
8468
8470 {
8473 }
8474
8476 {
8477 SetWeightDirty();
8479 }
8481 {
8484 }
8485
8487 {
8490 }
8492 {
8495 }
8496
8497 super.OnVariablesSynchronized();
8498 }
8499
8500
8501
8503 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8504 {
8505 if (!IsServerCheck(allow_client))
8506 return false;
8507
8509 return false;
8510
8513
8514 if (value <= (min + 0.001))
8515 value = min;
8516
8517 if (value == min)
8518 {
8519 if (destroy_config)
8520 {
8521 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8522 if (dstr)
8523 {
8525 this.Delete();
8526 return true;
8527 }
8528 }
8529 else if (destroy_forced)
8530 {
8532 this.Delete();
8533 return true;
8534 }
8535
8537 }
8538
8541
8543 {
8545
8546 if (delta)
8548 }
8549
8551
8552 return false;
8553 }
8554
8555
8557 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8558 {
8560 }
8561
8563 {
8566 }
8567
8569 {
8572 }
8573
8575 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8576 {
8577 float value_clamped = Math.Clamp(value, 0, 1);
8579 SetQuantity(result, destroy_config, destroy_forced);
8580 }
8581
8582
8585 {
8587 }
8588
8590 {
8592 }
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8604 {
8605 int slot = -1;
8606 if (GetInventory())
8607 {
8608 InventoryLocation il = new InventoryLocation;
8609 GetInventory().GetCurrentInventoryLocation(il);
8611 }
8612
8614 }
8615
8617 {
8618 float quantity_max = 0;
8619
8621 {
8622 if (attSlotID != -1)
8623 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8624
8625 if (quantity_max <= 0)
8627 }
8628
8629 if (quantity_max <= 0)
8631
8632 return quantity_max;
8633 }
8634
8636 {
8638 }
8639
8641 {
8643 }
8644
8645
8647 {
8649 }
8650
8652 {
8654 }
8655
8657 {
8659 }
8660
8661
8663 {
8664
8665 float weightEx = GetWeightEx();
8666 float special = GetInventoryAndCargoWeight();
8667 return weightEx - special;
8668 }
8669
8670
8672 {
8674 }
8675
8677 {
8679 {
8680 #ifdef DEVELOPER
8681 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8682 {
8683 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8685 }
8686 #endif
8687
8689 }
8690 else if (HasEnergyManager())
8691 {
8692 #ifdef DEVELOPER
8693 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8694 {
8695 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8696 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8697 }
8698 #endif
8699 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
8700 }
8701 else
8702 {
8703 #ifdef DEVELOPER
8704 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8705 {
8706 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8707 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8708 }
8709 #endif
8710 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
8711 }
8712 }
8713
8716 {
8717 int item_count = 0;
8719
8720 if (GetInventory().GetCargo() != NULL)
8721 {
8722 item_count = GetInventory().GetCargo().GetItemCount();
8723 }
8724
8725 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8726 {
8727 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8728 if (item)
8729 item_count += item.GetNumberOfItems();
8730 }
8731 return item_count;
8732 }
8733
8736 {
8737 float weight = 0;
8738 float wetness = 1;
8739 if (include_wetness)
8742 {
8743 weight = wetness * m_ConfigWeight;
8744 }
8746 {
8747 weight = 1;
8748 }
8749 return weight;
8750 }
8751
8752
8753
8755 {
8756 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8757 {
8758 GameInventory inv = GetInventory();
8759 array<EntityAI> items = new array<EntityAI>;
8761 for (int i = 0; i < items.Count(); i++)
8762 {
8764 if (item)
8765 {
8767 }
8768 }
8769 }
8770 }
8771
8772
8773
8774
8776 {
8777 float energy = 0;
8778 if (HasEnergyManager())
8779 {
8780 energy = GetCompEM().GetEnergy();
8781 }
8782 return energy;
8783 }
8784
8785
8787 {
8788 super.OnEnergyConsumed();
8789
8791 }
8792
8794 {
8795 super.OnEnergyAdded();
8796
8798 }
8799
8800
8802 {
8803 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
8804 {
8806 {
8807 float energy_0to1 = GetCompEM().GetEnergy0To1();
8809 }
8810 }
8811 }
8812
8813
8815 {
8816 return ConfigGetFloat("heatIsolation");
8817 }
8818
8820 {
8822 }
8823
8825 {
8826 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
8827 if (
GetGame().ConfigIsExisting(paramPath))
8829
8830 return 0.0;
8831 }
8832
8834 {
8835 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
8836 if (
GetGame().ConfigIsExisting(paramPath))
8838
8839 return 0.0;
8840 }
8841
8842 override void SetWet(
float value,
bool allow_client =
false)
8843 {
8844 if (!IsServerCheck(allow_client))
8845 return;
8846
8849
8851
8852 m_VarWet = Math.Clamp(value, min, max);
8853
8855 {
8858 }
8859 }
8860
8861 override void AddWet(
float value)
8862 {
8864 }
8865
8867 {
8869 }
8870
8872 {
8874 }
8875
8877 {
8879 }
8880
8882 {
8884 }
8885
8887 {
8889 }
8890
8892 {
8895 if (newLevel != oldLevel)
8896 {
8898 }
8899 }
8900
8902 {
8903 SetWeightDirty();
8904 }
8905
8907 {
8908 return GetWetLevelInternal(
m_VarWet);
8909 }
8910
8911
8912
8914 {
8916 }
8917
8919 {
8921 }
8922
8924 {
8926 }
8927
8929 {
8931 }
8932
8933
8934
8936 {
8937 if (ConfigIsExisting("itemModelLength"))
8938 {
8939 return ConfigGetFloat("itemModelLength");
8940 }
8941 return 0;
8942 }
8943
8945 {
8946 if (ConfigIsExisting("itemAttachOffset"))
8947 {
8948 return ConfigGetFloat("itemAttachOffset");
8949 }
8950 return 0;
8951 }
8952
8953 override void SetCleanness(
int value,
bool allow_client =
false)
8954 {
8955 if (!IsServerCheck(allow_client))
8956 return;
8957
8959
8961
8964 }
8965
8967 {
8969 }
8970
8972 {
8973 return true;
8974 }
8975
8976
8977
8978
8980 {
8982 }
8983
8985 {
8987 }
8988
8989
8990
8991
8992 override void SetColor(
int r,
int g,
int b,
int a)
8993 {
8999 }
9001 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9002 {
9007 }
9008
9010 {
9012 }
9013
9016 {
9017 int r,g,b,a;
9019 r = r/255;
9020 g = g/255;
9021 b = b/255;
9022 a = a/255;
9023 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9024 }
9025
9026
9027
9028 override void SetLiquidType(
int value,
bool allow_client =
false)
9029 {
9030 if (!IsServerCheck(allow_client))
9031 return;
9032
9037 }
9038
9040 {
9041 return ConfigGetInt("varLiquidTypeInit");
9042 }
9043
9045 {
9047 }
9048
9050 {
9052 SetFrozen(false);
9053 }
9054
9057 {
9058 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9059 }
9060
9061
9064 {
9065 PlayerBase nplayer;
9066 if (PlayerBase.CastTo(nplayer, player))
9067 {
9069
9070 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9071 }
9072 }
9073
9074
9077 {
9078 PlayerBase nplayer;
9079 if (PlayerBase.CastTo(nplayer,player))
9080 {
9081
9082 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9083
9084 }
9085
9086
9087 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9088
9089
9090 if (HasEnergyManager())
9091 {
9092 GetCompEM().UpdatePlugState();
9093 }
9094 }
9095
9096
9098 {
9099 super.OnPlacementStarted(player);
9100
9102 }
9103
9104 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9105 {
9107 {
9108 m_AdminLog.OnPlacementComplete(player,
this);
9109 }
9110
9111 super.OnPlacementComplete(player, position, orientation);
9112 }
9113
9114
9115
9116
9117
9119 {
9121 {
9122 return true;
9123 }
9124 else
9125 {
9126 return false;
9127 }
9128 }
9129
9130
9132 {
9134 {
9136 }
9137 }
9138
9139
9141 {
9143 }
9144
9146 {
9148 }
9149
9150 override void InsertAgent(
int agent,
float count = 1)
9151 {
9152 if (count < 1)
9153 return;
9154
9156 }
9157
9160 {
9162 }
9163
9164
9166 {
9168 }
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9212 {
9214 return false;
9215 return true;
9216 }
9217
9219 {
9220
9222 }
9223
9224
9227 {
9228 super.CheckForRoofLimited(timeTresholdMS);
9229
9231 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9232 {
9233 m_PreviousRoofTestTime = time;
9234 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9235 }
9236 }
9237
9238
9240 {
9242 {
9243 return 0;
9244 }
9245
9246 if (GetInventory().GetAttachmentSlotsCount() != 0)
9247 {
9248 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9249 if (filter)
9250 return filter.GetProtectionLevel(type, false, system);
9251 else
9252 return 0;
9253 }
9254
9255 string subclassPath, entryName;
9256
9257 switch (type)
9258 {
9260 entryName = "biological";
9261 break;
9263 entryName = "chemical";
9264 break;
9265 default:
9266 entryName = "biological";
9267 break;
9268 }
9269
9270 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9271
9273 }
9274
9275
9276
9279 {
9280 if (!IsMagazine())
9282
9284 }
9285
9286
9287
9288
9289
9294 {
9295 return true;
9296 }
9297
9299 {
9301 }
9302
9303
9304
9305
9306
9308 {
9309 if (parent)
9310 {
9311 if (parent.IsInherited(DayZInfected))
9312 return true;
9313
9314 if (!parent.IsRuined())
9315 return true;
9316 }
9317
9318 return true;
9319 }
9320
9322 {
9323 if (!super.CanPutAsAttachment(parent))
9324 {
9325 return false;
9326 }
9327
9328 if (!IsRuined() && !parent.IsRuined())
9329 {
9330 return true;
9331 }
9332
9333 return false;
9334 }
9335
9337 {
9338
9339
9340
9341
9342 return super.CanReceiveItemIntoCargo(item);
9343 }
9344
9346 {
9347
9348
9349
9350
9351 GameInventory attachmentInv = attachment.GetInventory();
9353 {
9354 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9355 return false;
9356 }
9357
9358 InventoryLocation loc = new InventoryLocation();
9359 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9360 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9361 return false;
9362
9363 return super.CanReceiveAttachment(attachment, slotId);
9364 }
9365
9367 {
9368 if (!super.CanReleaseAttachment(attachment))
9369 return false;
9370
9371 return GetInventory().AreChildrenAccessible();
9372 }
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9395 {
9396 int id = muzzle_owner.GetMuzzleID();
9397 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9398
9399 if (WPOF_array)
9400 {
9401 for (int i = 0; i < WPOF_array.Count(); i++)
9402 {
9403 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9404
9405 if (WPOF)
9406 {
9407 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9408 }
9409 }
9410 }
9411 }
9412
9413
9415 {
9416 int id = muzzle_owner.GetMuzzleID();
9418
9419 if (WPOBE_array)
9420 {
9421 for (int i = 0; i < WPOBE_array.Count(); i++)
9422 {
9423 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9424
9425 if (WPOBE)
9426 {
9427 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9428 }
9429 }
9430 }
9431 }
9432
9433
9435 {
9436 int id = muzzle_owner.GetMuzzleID();
9437 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9438
9439 if (WPOOH_array)
9440 {
9441 for (int i = 0; i < WPOOH_array.Count(); i++)
9442 {
9443 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9444
9445 if (WPOOH)
9446 {
9447 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9448 }
9449 }
9450 }
9451 }
9452
9453
9455 {
9456 int id = muzzle_owner.GetMuzzleID();
9457 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9458
9459 if (WPOOH_array)
9460 {
9461 for (int i = 0; i < WPOOH_array.Count(); i++)
9462 {
9463 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9464
9465 if (WPOOH)
9466 {
9467 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9468 }
9469 }
9470 }
9471 }
9472
9473
9475 {
9476 int id = muzzle_owner.GetMuzzleID();
9477 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9478
9479 if (WPOOH_array)
9480 {
9481 for (int i = 0; i < WPOOH_array.Count(); i++)
9482 {
9483 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9484
9485 if (WPOOH)
9486 {
9487 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9488 }
9489 }
9490 }
9491 }
9492
9493
9494
9496 {
9498 {
9499 return true;
9500 }
9501
9502 return false;
9503 }
9504
9506 {
9508 {
9509 return true;
9510 }
9511
9512 return false;
9513 }
9514
9516 {
9518 {
9519 return true;
9520 }
9521
9522 return false;
9523 }
9524
9526 {
9527 return false;
9528 }
9529
9532 {
9533 return UATimeSpent.DEFAULT_DEPLOY;
9534 }
9535
9536
9537
9538
9540 {
9542 SetSynchDirty();
9543 }
9544
9546 {
9548 }
9549
9550
9552 {
9553 return false;
9554 }
9555
9558 {
9559 string att_type = "None";
9560
9561 if (ConfigIsExisting("soundAttType"))
9562 {
9563 att_type = ConfigGetString("soundAttType");
9564 }
9565
9567 }
9568
9570 {
9572 }
9573
9574
9575
9576
9577
9583
9585 {
9588
9590 }
9591
9592
9594 {
9596 return;
9597
9599
9602
9605
9606 SoundParameters params = new SoundParameters();
9610 }
9611
9612
9614 {
9616 return;
9617
9619 SetSynchDirty();
9620
9623 }
9624
9625
9627 {
9629 return;
9630
9632 SetSynchDirty();
9633
9636 }
9637
9639 {
9641 }
9642
9644 {
9646 }
9647
9650 {
9651 if (!
GetGame().IsDedicatedServer())
9652 {
9653 if (ConfigIsExisting("attachSoundSet"))
9654 {
9655 string cfg_path = "";
9656 string soundset = "";
9658
9661 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9662 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9663
9664 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9665 {
9666 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9667 {
9668 if (cfg_slot_array[i] == slot_type)
9669 {
9670 soundset = cfg_soundset_array[i];
9671 break;
9672 }
9673 }
9674 }
9675
9676 if (soundset != "")
9677 {
9678 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9680 }
9681 }
9682 }
9683 }
9684
9686 {
9687
9688 }
9689
9690 void OnApply(PlayerBase player);
9691
9693 {
9694 return 1.0;
9695 };
9696
9698 {
9700 }
9701
9703 {
9705 }
9706
9708
9710 {
9711 SetDynamicPhysicsLifeTime(0.01);
9713 }
9714
9716 {
9717 array<string> zone_names = new array<string>;
9718 GetDamageZones(zone_names);
9719 for (int i = 0; i < zone_names.Count(); i++)
9720 {
9721 SetHealthMax(zone_names.Get(i),"Health");
9722 }
9723 SetHealthMax("","Health");
9724 }
9725
9728 {
9729 float global_health = GetHealth01("","Health");
9730 array<string> zones = new array<string>;
9731 GetDamageZones(zones);
9732
9733 for (int i = 0; i < zones.Count(); i++)
9734 {
9735 SetHealth01(zones.Get(i),"Health",global_health);
9736 }
9737 }
9738
9741 {
9742 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9743 }
9744
9746 {
9747 if (!hasRootAsPlayer)
9748 {
9749 if (refParentIB)
9750 {
9751
9752 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9753 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9754
9755 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9756 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9757
9760 }
9761 else
9762 {
9763
9766 }
9767 }
9768 }
9769
9771 {
9773 {
9774 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
9775 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
9776 {
9777 float heatPermCoef = 1.0;
9779 while (ent)
9780 {
9781 heatPermCoef *= ent.GetHeatPermeabilityCoef();
9782 ent = ent.GetHierarchyParent();
9783 }
9784
9785 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
9786 }
9787 }
9788 }
9789
9791 {
9792
9793 EntityAI parent = GetHierarchyParent();
9794 if (!parent)
9795 {
9796 hasParent = false;
9797 hasRootAsPlayer = false;
9798 }
9799 else
9800 {
9801 hasParent = true;
9802 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
9803 refParentIB =
ItemBase.Cast(parent);
9804 }
9805 }
9806
9807 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
9808 {
9809
9810 }
9811
9813 {
9814
9815 return false;
9816 }
9817
9819 {
9820
9821
9822 return false;
9823 }
9824
9826 {
9827
9828 return false;
9829 }
9830
9833 {
9834 return !GetIsFrozen() &&
IsOpen();
9835 }
9836
9838 {
9839 bool hasParent = false, hasRootAsPlayer = false;
9841
9842 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
9843 bool foodDecay =
g_Game.IsFoodDecayEnabled();
9844
9845 if (wwtu || foodDecay)
9846 {
9850
9851 if (processWetness || processTemperature || processDecay)
9852 {
9854
9855 if (processWetness)
9856 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
9857
9858 if (processTemperature)
9860
9861 if (processDecay)
9862 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
9863 }
9864 }
9865 }
9866
9869 {
9871 }
9872
9874 {
9877
9878 return super.GetTemperatureFreezeThreshold();
9879 }
9880
9882 {
9885
9886 return super.GetTemperatureThawThreshold();
9887 }
9888
9890 {
9893
9894 return super.GetItemOverheatThreshold();
9895 }
9896
9898 {
9900 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
9901
9902 return super.GetTemperatureFreezeTime();
9903 }
9904
9906 {
9908 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
9909
9910 return super.GetTemperatureThawTime();
9911 }
9912
9917
9919 {
9920 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
9921 }
9922
9924 {
9925 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
9926 }
9927
9930 {
9932 }
9933
9935 {
9937 }
9938
9940 {
9942 }
9943
9946 {
9947 return null;
9948 }
9949
9952 {
9953 return false;
9954 }
9955
9957 {
9959 {
9962 if (!trg)
9963 {
9965 explosive = this;
9966 }
9967
9968 explosive.PairRemote(trg);
9970
9971 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
9972 trg.SetPersistentPairID(persistentID);
9973 explosive.SetPersistentPairID(persistentID);
9974
9975 return true;
9976 }
9977 return false;
9978 }
9979
9982 {
9983 float ret = 1.0;
9986 ret *= GetHealth01();
9987
9988 return ret;
9989 }
9990
9991 #ifdef DEVELOPER
9992 override void SetDebugItem()
9993 {
9994 super.SetDebugItem();
9995 _itemBase = this;
9996 }
9997
9999 {
10000 string text = super.GetDebugText();
10001
10003 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10004
10005 return text;
10006 }
10007 #endif
10008
10010 {
10011 return true;
10012 }
10013
10015
10017
10019 {
10022 }
10023
10024
10032
10048}
10049
10051{
10053 if (entity)
10054 {
10055 bool is_item = entity.IsInherited(
ItemBase);
10056 if (is_item && full_quantity)
10057 {
10060 }
10061 }
10062 else
10063 {
10065 return NULL;
10066 }
10067 return entity;
10068}
10069
10071{
10072 if (item)
10073 {
10074 if (health > 0)
10075 item.SetHealth("", "", health);
10076
10077 if (item.CanHaveTemperature())
10078 {
10080 if (item.CanFreeze())
10081 item.SetFrozen(false);
10082 }
10083
10084 if (item.HasEnergyManager())
10085 {
10086 if (quantity >= 0)
10087 {
10088 item.GetCompEM().SetEnergy0To1(quantity);
10089 }
10090 else
10091 {
10093 }
10094 }
10095 else if (item.IsMagazine())
10096 {
10097 Magazine mag = Magazine.Cast(item);
10098 if (quantity >= 0)
10099 {
10100 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10101 }
10102 else
10103 {
10105 }
10106
10107 }
10108 else
10109 {
10110 if (quantity >= 0)
10111 {
10112 item.SetQuantityNormalized(quantity, false);
10113 }
10114 else
10115 {
10117 }
10118
10119 }
10120 }
10121}
10122
10123#ifdef DEVELOPER
10125#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.