5296{
5298 {
5299 return true;
5300 }
5301};
5302
5303
5304
5306{
5310
5312
5315
5316
5317
5318
5319
5328
5334
5339
5344
5365 protected bool m_IsResultOfSplit
5366
5368
5373
5374
5375
5377
5381
5382
5383
5385
5388
5389
5390
5396
5397
5405
5408
5409
5411
5412
5414
5415
5420
5421
5426
5427
5429
5430
5432 {
5437
5438 if (!
GetGame().IsDedicatedServer())
5439 {
5441 {
5443
5445 {
5447 }
5448 }
5449
5452 }
5453
5454 m_OldLocation = null;
5455
5457 {
5459 }
5460
5461 if (ConfigIsExisting("headSelectionsToHide"))
5462 {
5465 }
5466
5468 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5469 {
5471 }
5472
5474
5475 m_IsResultOfSplit = false;
5476
5478 }
5479
5481 {
5482 super.InitItemVariables();
5483
5489 m_Count = ConfigGetInt(
"count");
5490
5493
5498
5501
5506
5518
5522
5523
5526 if (ConfigIsExisting("canBeSplit"))
5527 {
5530 }
5531
5533 if (ConfigIsExisting("itemBehaviour"))
5535
5536
5539 RegisterNetSyncVariableInt("m_VarLiquidType");
5540 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5541
5542 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5543 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5544 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5545
5546 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5547 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5548 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5549 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5550
5551 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5552 RegisterNetSyncVariableBool("m_IsTakeable");
5553 RegisterNetSyncVariableBool("m_IsHologram");
5554
5557 {
5560 }
5561
5563
5565 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5567
5568 }
5569
5571 {
5573 }
5574
5576 {
5579 {
5584 }
5585 }
5586
5587 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5588 {
5590 {
5593 }
5594
5596 }
5597
5599 {
5605 }
5606
5608
5610 {
5612
5613 if (!action)
5614 {
5615 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5616 return;
5617 }
5618
5620 if (!ai)
5621 {
5623 return;
5624 }
5625
5627 if (!action_array)
5628 {
5629 action_array = new array<ActionBase_Basic>;
5631 }
5632 if (LogManager.IsActionLogEnable())
5633 {
5634 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5635 }
5636
5637 if (action_array.Find(action) != -1)
5638 {
5639 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5640 }
5641 else
5642 {
5643 action_array.Insert(action);
5644 }
5645 }
5646
5648 {
5650 ActionBase action = player.GetActionManager().GetAction(actionName);
5653
5654 if (action_array)
5655 {
5656 action_array.RemoveItem(action);
5657 }
5658 }
5659
5660
5661
5663 {
5664 ActionOverrideData overrideData = new ActionOverrideData();
5668
5670 if (!actionMap)
5671 {
5674 }
5675
5676 actionMap.Insert(this.
Type(), overrideData);
5677
5678 }
5679
5681
5683
5684
5686 {
5689
5692
5693 string config_to_search = "CfgVehicles";
5694 string muzzle_owner_config;
5695
5697 {
5698 if (IsInherited(Weapon))
5699 config_to_search = "CfgWeapons";
5700
5701 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5702
5703 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5704
5706
5707 if (config_OnFire_subclass_count > 0)
5708 {
5709 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5710
5711 for (int i = 0; i < config_OnFire_subclass_count; i++)
5712 {
5713 string particle_class = "";
5715 string config_OnFire_entry = config_OnFire_class + particle_class;
5716 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5717 WPOF_array.Insert(WPOF);
5718 }
5719
5720
5722 }
5723 }
5724
5726 {
5727 config_to_search = "CfgWeapons";
5728 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5729
5730 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5731
5733
5734 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5735 {
5736 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5737
5738 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5739 {
5740 string particle_class2 = "";
5742 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5743 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5744 WPOBE_array.Insert(WPOBE);
5745 }
5746
5747
5749 }
5750 }
5751 }
5752
5753
5755 {
5758
5760 {
5761 string config_to_search = "CfgVehicles";
5762
5763 if (IsInherited(Weapon))
5764 config_to_search = "CfgWeapons";
5765
5766 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5767 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5768
5769 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5770 {
5771
5773
5775 {
5777 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5779 return;
5780 }
5781
5784
5785
5786
5788 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5789
5790 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5791 {
5792 string particle_class = "";
5794 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5796
5797 if (entry_type == CT_CLASS)
5798 {
5799 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5800 WPOOH_array.Insert(WPOF);
5801 }
5802 }
5803
5804
5806 }
5807 }
5808 }
5809
5811 {
5813 }
5814
5816 {
5818 {
5820
5823
5826
5827 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5828 }
5829 }
5830
5832 {
5834 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5835
5837 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5838
5840 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5841
5843 {
5845 }
5846 }
5847
5849 {
5851 }
5852
5854 {
5857 else
5859
5861 {
5864 }
5865 else
5866 {
5869
5872 }
5873
5875 }
5876
5878 {
5880 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5881 }
5882
5884 {
5886 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5888 }
5889
5891 {
5893 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5894 }
5895
5897 {
5900
5901 OverheatingParticle OP = new OverheatingParticle();
5906
5908 }
5909
5911 {
5914
5915 return -1;
5916 }
5917
5919 {
5921 {
5924
5925 for (int i = count; i > 0; --i)
5926 {
5927 int id = i - 1;
5930
5933
5934 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
5935 {
5936 if (p)
5937 {
5940 }
5941 }
5942 }
5943 }
5944 }
5945
5947 {
5949 {
5951 {
5952 int id = i - 1;
5954
5955 if (OP)
5956 {
5958
5959 if (p)
5960 {
5962 }
5963
5964 delete OP;
5965 }
5966 }
5967
5970 }
5971 }
5972
5975 {
5976 return 0.0;
5977 }
5978
5979
5981 {
5982 return 250;
5983 }
5984
5986 {
5987 return 0;
5988 }
5989
5992 {
5994 return true;
5995
5996 return false;
5997 }
5998
6001 {
6004
6006 {
6008 }
6009 else
6010 {
6011
6013 }
6014
6016 }
6017
6024 {
6025 return -1;
6026 }
6027
6028
6029
6030
6032 {
6034 {
6036 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6037
6038 if (r_index >= 0)
6039 {
6040 InventoryLocation r_il = new InventoryLocation;
6041 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6042
6043 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6046 {
6047 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6048 }
6050 {
6051 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6052 }
6053
6054 }
6055
6056 player.GetHumanInventory().ClearUserReservedLocation(this);
6057 }
6058
6061 }
6062
6063
6064
6065
6067 {
6068 return ItemBase.m_DebugActionsMask;
6069 }
6070
6072 {
6073 return ItemBase.m_DebugActionsMask & mask;
6074 }
6075
6077 {
6078 ItemBase.m_DebugActionsMask = mask;
6079 }
6080
6082 {
6083 ItemBase.m_DebugActionsMask |= mask;
6084 }
6085
6087 {
6088 ItemBase.m_DebugActionsMask &= ~mask;
6089 }
6090
6092 {
6094 {
6096 }
6097 else
6098 {
6100 }
6101 }
6102
6103
6105 {
6106 if (GetEconomyProfile())
6107 {
6108 float q_max = GetEconomyProfile().GetQuantityMax();
6109 if (q_max > 0)
6110 {
6111 float q_min = GetEconomyProfile().GetQuantityMin();
6112 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6113
6115 {
6116 ComponentEnergyManager comp = GetCompEM();
6118 {
6120 }
6121 }
6123 {
6125
6126 }
6127
6128 }
6129 }
6130 }
6131
6134 {
6135 EntityAI parent = GetHierarchyParent();
6136
6137 if (parent)
6138 {
6139 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6140 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6141 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6142 }
6143 }
6144
6147 {
6148 EntityAI parent = GetHierarchyParent();
6149
6150 if (parent)
6151 {
6152 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6153 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6154 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6155 }
6156 }
6157
6159 {
6160
6161
6162
6163
6165
6167 {
6168 if (ScriptInputUserData.CanStoreInputUserData())
6169 {
6170 ScriptInputUserData ctx = new ScriptInputUserData;
6176 ctx.
Write(use_stack_max);
6179
6181 {
6182 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6183 }
6184 }
6185 }
6186 else if (!
GetGame().IsMultiplayer())
6187 {
6189 }
6190 }
6191
6193 {
6195 }
6196
6198 {
6200 }
6201
6203 {
6205 }
6206
6208 {
6209
6210 return false;
6211 }
6212
6214 {
6215 return false;
6216 }
6217
6221 {
6222 return false;
6223 }
6224
6226 {
6227 return "";
6228 }
6229
6231
6233 {
6234 return false;
6235 }
6236
6238 {
6239 return true;
6240 }
6241
6242
6243
6245 {
6246 return true;
6247 }
6248
6250 {
6251 return true;
6252 }
6253
6255 {
6256 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6258 }
6259
6261 {
6263 }
6264
6266 {
6268 if (!is_being_placed)
6270 SetSynchDirty();
6271 }
6272
6273
6275
6277 {
6279 }
6280
6282 {
6284 }
6285
6287 {
6288 return 1;
6289 }
6290
6292 {
6293 return false;
6294 }
6295
6297 {
6299 SetSynchDirty();
6300 }
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6337 {
6338 super.OnMovedInsideCargo(container);
6339
6340 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6341 }
6342
6343 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6344 {
6345 super.EEItemLocationChanged(oldLoc,newLoc);
6346
6347 PlayerBase new_player = null;
6348 PlayerBase old_player = null;
6349
6350 if (newLoc.GetParent())
6351 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6352
6353 if (oldLoc.GetParent())
6354 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6355
6357 {
6358 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6359
6360 if (r_index >= 0)
6361 {
6362 InventoryLocation r_il = new InventoryLocation;
6363 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6364
6365 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6368 {
6369 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6370 }
6372 {
6373 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6374 }
6375
6376 }
6377 }
6378
6380 {
6381 if (new_player)
6382 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6383
6384 if (new_player == old_player)
6385 {
6386
6387 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6388 {
6390 {
6391 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6392 {
6393 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6394 }
6395 }
6396 else
6397 {
6398 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6399 }
6400 }
6401
6402 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6403 {
6404 int type = oldLoc.GetType();
6406 {
6407 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6408 }
6410 {
6411 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6412 }
6413 }
6414 if (!m_OldLocation)
6415 {
6416 m_OldLocation = new InventoryLocation;
6417 }
6418 m_OldLocation.Copy(oldLoc);
6419 }
6420 else
6421 {
6422 if (m_OldLocation)
6423 {
6424 m_OldLocation.Reset();
6425 }
6426 }
6427
6429 }
6430 else
6431 {
6432 if (new_player)
6433 {
6434 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6435 if (res_index >= 0)
6436 {
6437 InventoryLocation il = new InventoryLocation;
6438 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6440 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6443 {
6444 il.
GetParent().GetOnReleaseLock().Invoke(it);
6445 }
6447 {
6449 }
6450
6451 }
6452 }
6454 {
6455
6457 }
6458
6459 if (m_OldLocation)
6460 {
6461 m_OldLocation.Reset();
6462 }
6463 }
6464 }
6465
6466 override void EOnContact(IEntity other, Contact extra)
6467 {
6469 {
6470 int liquidType = -1;
6472 if (impactSpeed > 0.0)
6473 {
6475 #ifndef SERVER
6477 #else
6479 SetSynchDirty();
6480 #endif
6482 }
6483 }
6484
6485 #ifdef SERVER
6486 if (GetCompEM() && GetCompEM().IsPlugged())
6487 {
6488 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6489 GetCompEM().UnplugThis();
6490 }
6491 #endif
6492 }
6493
6495
6497 {
6499 }
6500
6502 {
6503
6504 }
6505
6507 {
6508 super.OnItemLocationChanged(old_owner, new_owner);
6509
6510 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6511 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6512
6513 if (!relatedPlayer && playerNew)
6514 relatedPlayer = playerNew;
6515
6516 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6517 {
6519 if (actionMgr)
6520 {
6521 ActionBase currentAction = actionMgr.GetRunningAction();
6522 if (currentAction)
6524 }
6525 }
6526
6527 Man ownerPlayerOld = null;
6528 Man ownerPlayerNew = null;
6529
6530 if (old_owner)
6531 {
6532 if (old_owner.
IsMan())
6533 {
6534 ownerPlayerOld = Man.Cast(old_owner);
6535 }
6536 else
6537 {
6538 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6539 }
6540 }
6541 else
6542 {
6544 {
6546
6547 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6548 {
6549 GetCompEM().UnplugThis();
6550 }
6551 }
6552 }
6553
6554 if (new_owner)
6555 {
6556 if (new_owner.
IsMan())
6557 {
6558 ownerPlayerNew = Man.Cast(new_owner);
6559 }
6560 else
6561 {
6562 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6563 }
6564 }
6565
6566 if (ownerPlayerOld != ownerPlayerNew)
6567 {
6568 if (ownerPlayerOld)
6569 {
6570 array<EntityAI> subItemsExit = new array<EntityAI>;
6572 for (int i = 0; i < subItemsExit.Count(); i++)
6573 {
6576 }
6577 }
6578
6579 if (ownerPlayerNew)
6580 {
6581 array<EntityAI> subItemsEnter = new array<EntityAI>;
6583 for (int j = 0; j < subItemsEnter.Count(); j++)
6584 {
6587 }
6588 }
6589 }
6590 else if (ownerPlayerNew != null)
6591 {
6592 PlayerBase nplayer;
6593 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6594 {
6595 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6597 for (int k = 0; k < subItemsUpdate.Count(); k++)
6598 {
6600 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6601 }
6602 }
6603 }
6604
6605 if (old_owner)
6606 old_owner.OnChildItemRemoved(this);
6607 if (new_owner)
6608 new_owner.OnChildItemReceived(this);
6609 }
6610
6611
6613 {
6614 super.EEDelete(parent);
6615 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6616 if (player)
6617 {
6619
6620 if (player.IsAlive())
6621 {
6622 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6623 if (r_index >= 0)
6624 {
6625 InventoryLocation r_il = new InventoryLocation;
6626 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6627
6628 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6631 {
6632 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6633 }
6635 {
6636 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6637 }
6638
6639 }
6640
6641 player.RemoveQuickBarEntityShortcut(this);
6642 }
6643 }
6644 }
6645
6647 {
6648 super.EEKilled(killer);
6649
6652 {
6653 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6654 {
6655 if (IsMagazine())
6656 {
6657 if (Magazine.Cast(this).GetAmmoCount() > 0)
6658 {
6660 }
6661 }
6662 else
6663 {
6665 }
6666 }
6667 }
6668 }
6669
6671 {
6672 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6673
6674 super.OnWasAttached(parent, slot_id);
6675
6678
6680 }
6681
6683 {
6684 super.OnWasDetached(parent, slot_id);
6685
6688 }
6689
6691 {
6692 int idx;
6695
6696 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6697 if (inventory_slots.Count() < 1)
6698 {
6699 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6700 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6701 }
6702 else
6703 {
6704 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6705 }
6706
6707 idx = inventory_slots.Find(slot);
6708 if (idx < 0)
6709 return "";
6710
6711 return attach_types.Get(idx);
6712 }
6713
6715 {
6716 int idx = -1;
6717 string slot;
6718
6721
6722 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6723 if (inventory_slots.Count() < 1)
6724 {
6725 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6726 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6727 }
6728 else
6729 {
6730 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6731 if (detach_types.Count() < 1)
6732 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6733 }
6734
6735 for (int i = 0; i < inventory_slots.Count(); i++)
6736 {
6737 slot = inventory_slots.Get(i);
6738 }
6739
6740 if (slot != "")
6741 {
6742 if (detach_types.Count() == 1)
6743 idx = 0;
6744 else
6745 idx = inventory_slots.Find(slot);
6746 }
6747 if (idx < 0)
6748 return "";
6749
6750 return detach_types.Get(idx);
6751 }
6752
6754 {
6755
6757
6758
6759 float min_time = 1;
6760 float max_time = 3;
6761 float delay = Math.RandomFloat(min_time, max_time);
6762
6763 explode_timer.Run(delay, this, "DoAmmoExplosion");
6764 }
6765
6767 {
6768 Magazine magazine = Magazine.Cast(this);
6769 int pop_sounds_count = 6;
6770 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6771
6772
6773 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6774 string sound_name = pop_sounds[ sound_idx ];
6776
6777
6778 magazine.ServerAddAmmoCount(-1);
6779
6780
6781 float min_temp_to_explode = 100;
6782
6783 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
6784 {
6786 }
6787 }
6788
6789
6790 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6791 {
6792 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6793
6794 const int CHANCE_DAMAGE_CARGO = 4;
6795 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6796 const int CHANCE_DAMAGE_NOTHING = 2;
6797
6799 {
6800 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6801 int chances;
6802 int rnd;
6803
6804 if (GetInventory().GetCargo())
6805 {
6806 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6807 rnd = Math.RandomInt(0,chances);
6808
6809 if (rnd < CHANCE_DAMAGE_CARGO)
6810 {
6812 }
6813 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6814 {
6816 }
6817 }
6818 else
6819 {
6820 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6821 rnd = Math.RandomInt(0,chances);
6822
6823 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6824 {
6826 }
6827 }
6828 }
6829 }
6830
6832 {
6833 if (GetInventory().GetCargo())
6834 {
6835 int item_count = GetInventory().GetCargo().GetItemCount();
6836 if (item_count > 0)
6837 {
6838 int random_pick = Math.RandomInt(0, item_count);
6840 if (!item.IsExplosive())
6841 {
6842 item.AddHealth("","",damage);
6843 return true;
6844 }
6845 }
6846 }
6847 return false;
6848 }
6849
6851 {
6852 int attachment_count = GetInventory().AttachmentCount();
6853 if (attachment_count > 0)
6854 {
6855 int random_pick = Math.RandomInt(0, attachment_count);
6856 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
6857 if (!attachment.IsExplosive())
6858 {
6859 attachment.AddHealth("","",damage);
6860 return true;
6861 }
6862 }
6863 return false;
6864 }
6865
6867 {
6869 }
6870
6872 {
6874 return GetInventory().CanRemoveEntity();
6875
6876 return false;
6877 }
6878
6880 {
6882 return;
6883
6885 {
6886 if (ScriptInputUserData.CanStoreInputUserData())
6887 {
6888 ScriptInputUserData ctx = new ScriptInputUserData;
6893 ctx.
Write(destination_entity);
6897 }
6898 }
6899 else if (!
GetGame().IsMultiplayer())
6900 {
6902 }
6903 }
6904
6906 {
6908 return;
6909
6910 float split_quantity_new;
6914 InventoryLocation loc = new InventoryLocation;
6915
6916 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6917 {
6919 split_quantity_new = stack_max;
6920 else
6922
6923 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
6924 if (new_item)
6925 {
6926 new_item.SetResultOfSplit(true);
6927 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6929 new_item.SetQuantity(split_quantity_new);
6930 }
6931 }
6932 else if (destination_entity && slot_id == -1)
6933 {
6934 if (quantity > stack_max)
6935 split_quantity_new = stack_max;
6936 else
6937 split_quantity_new = quantity;
6938
6940 {
6943 }
6944
6945 if (new_item)
6946 {
6947 new_item.SetResultOfSplit(true);
6948 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6950 new_item.SetQuantity(split_quantity_new);
6951 }
6952 }
6953 else
6954 {
6955 if (stack_max != 0)
6956 {
6958 {
6960 }
6961
6962 if (split_quantity_new == 0)
6963 {
6964 if (!
GetGame().IsMultiplayer())
6965 player.PhysicalPredictiveDropItem(this);
6966 else
6967 player.ServerDropEntity(this);
6968 return;
6969 }
6970
6972
6973 if (new_item)
6974 {
6975 new_item.SetResultOfSplit(true);
6976 MiscGameplayFunctions.TransferItemProperties(this, new_item);
6978 new_item.SetQuantity(stack_max);
6979 new_item.PlaceOnSurface();
6980 }
6981 }
6982 }
6983 }
6984
6986 {
6988 return;
6989
6990 float split_quantity_new;
6994 InventoryLocation loc = new InventoryLocation;
6995
6996 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
6997 {
6999 split_quantity_new = stack_max;
7000 else
7002
7003 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7004 if (new_item)
7005 {
7006 new_item.SetResultOfSplit(true);
7007 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7009 new_item.SetQuantity(split_quantity_new);
7010 }
7011 }
7012 else if (destination_entity && slot_id == -1)
7013 {
7014 if (quantity > stack_max)
7015 split_quantity_new = stack_max;
7016 else
7017 split_quantity_new = quantity;
7018
7020 {
7023 }
7024
7025 if (new_item)
7026 {
7027 new_item.SetResultOfSplit(true);
7028 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7030 new_item.SetQuantity(split_quantity_new);
7031 }
7032 }
7033 else
7034 {
7035 if (stack_max != 0)
7036 {
7038 {
7040 }
7041
7043
7044 if (new_item)
7045 {
7046 new_item.SetResultOfSplit(true);
7047 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7049 new_item.SetQuantity(stack_max);
7050 new_item.PlaceOnSurface();
7051 }
7052 }
7053 }
7054 }
7055
7057 {
7059 return;
7060
7062 {
7063 if (ScriptInputUserData.CanStoreInputUserData())
7064 {
7065 ScriptInputUserData ctx = new ScriptInputUserData;
7070 dst.WriteToContext(ctx);
7072 }
7073 }
7074 else if (!
GetGame().IsMultiplayer())
7075 {
7077 }
7078 }
7079
7081 {
7083 return;
7084
7086 {
7087 if (ScriptInputUserData.CanStoreInputUserData())
7088 {
7089 ScriptInputUserData ctx = new ScriptInputUserData;
7094 ctx.
Write(destination_entity);
7100 }
7101 }
7102 else if (!
GetGame().IsMultiplayer())
7103 {
7105 }
7106 }
7107
7109 {
7111 }
7112
7114 {
7116 return this;
7117
7119 float split_quantity_new;
7121 if (dst.IsValid())
7122 {
7123 int slot_id = dst.GetSlot();
7125
7126 if (quantity > stack_max)
7127 split_quantity_new = stack_max;
7128 else
7129 split_quantity_new = quantity;
7130
7132
7133 if (new_item)
7134 {
7135 new_item.SetResultOfSplit(true);
7136 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7139 }
7140
7141 return new_item;
7142 }
7143
7144 return null;
7145 }
7146
7148 {
7150 return;
7151
7153 float split_quantity_new;
7155 if (destination_entity)
7156 {
7158 if (quantity > stackable)
7159 split_quantity_new = stackable;
7160 else
7161 split_quantity_new = quantity;
7162
7163 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7164 if (new_item)
7165 {
7166 new_item.SetResultOfSplit(true);
7167 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7169 new_item.SetQuantity(split_quantity_new);
7170 }
7171 }
7172 }
7173
7175 {
7177 return;
7178
7180 {
7181 if (ScriptInputUserData.CanStoreInputUserData())
7182 {
7183 ScriptInputUserData ctx = new ScriptInputUserData;
7188 ItemBase destination_entity =
this;
7189 ctx.
Write(destination_entity);
7193 }
7194 }
7195 else if (!
GetGame().IsMultiplayer())
7196 {
7198 }
7199 }
7200
7202 {
7204 return;
7205
7207 float split_quantity_new;
7209 if (player)
7210 {
7212 if (quantity > stackable)
7213 split_quantity_new = stackable;
7214 else
7215 split_quantity_new = quantity;
7216
7217 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7218 new_item =
ItemBase.Cast(in_hands);
7219 if (new_item)
7220 {
7221 new_item.SetResultOfSplit(true);
7222 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7224 new_item.SetQuantity(split_quantity_new);
7225 }
7226 }
7227 }
7228
7230 {
7232 return;
7233
7235 float split_quantity_new = Math.Floor(quantity * 0.5);
7236
7238
7239 if (new_item)
7240 {
7241 if (new_item.GetQuantityMax() < split_quantity_new)
7242 {
7243 split_quantity_new = new_item.GetQuantityMax();
7244 }
7245
7246 new_item.SetResultOfSplit(true);
7247 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7248
7250 {
7253 }
7254 else
7255 {
7258 }
7259 }
7260 }
7261
7263 {
7265 return;
7266
7268 float split_quantity_new = Math.Floor(quantity / 2);
7269
7270 InventoryLocation invloc = new InventoryLocation;
7272
7274 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7275
7276 if (new_item)
7277 {
7278 if (new_item.GetQuantityMax() < split_quantity_new)
7279 {
7280 split_quantity_new = new_item.GetQuantityMax();
7281 }
7283 {
7286 }
7287 else
7288 {
7291 }
7292 }
7293 }
7294
7297 {
7298 SetWeightDirty();
7300
7301 if (parent)
7302 parent.OnAttachmentQuantityChangedEx(this, delta);
7303
7305 {
7307 {
7309 }
7311 {
7312 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7314 }
7315 }
7316
7317 }
7318
7321 {
7322
7323 }
7324
7327 {
7329 }
7330
7332 {
7333 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7334
7336 {
7337 if (newLevel == GameConstants.STATE_RUINED)
7338 {
7340 EntityAI parent = GetHierarchyParent();
7341 if (parent && parent.IsFireplace())
7342 {
7343 CargoBase cargo = GetInventory().GetCargo();
7344 if (cargo)
7345 {
7347 {
7349 }
7350 }
7351 }
7352 }
7353
7355 {
7356
7358 return;
7359 }
7360
7361 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7362 {
7364 }
7365 }
7366 }
7367
7368
7370 {
7371 super.OnRightClick();
7372
7374 {
7376 {
7377 if (ScriptInputUserData.CanStoreInputUserData())
7378 {
7379 vector m4[4];
7381
7382 EntityAI root = GetHierarchyRoot();
7383
7384 InventoryLocation dst = new InventoryLocation;
7386 {
7387 if (root)
7388 {
7389 root.GetTransform(m4);
7391 }
7392 else
7393 GetInventory().GetCurrentInventoryLocation(dst);
7394 }
7395 else
7396 {
7398
7399
7400 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7401 {
7402 if (root)
7403 {
7404 root.GetTransform(m4);
7406 }
7407 else
7408 GetInventory().GetCurrentInventoryLocation(dst);
7409 }
7410 else
7411 {
7412 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7413 }
7414 }
7415
7416 ScriptInputUserData ctx = new ScriptInputUserData;
7424 }
7425 }
7426 else if (!
GetGame().IsMultiplayer())
7427 {
7429 }
7430 }
7431 }
7432
7433 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7434 {
7435
7436 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7437 return false;
7438
7439 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7440 return false;
7441
7442
7444 return false;
7445
7446
7447 Magazine mag = Magazine.Cast(this);
7448 if (mag)
7449 {
7450 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7451 return false;
7452
7453 if (stack_max_limit)
7454 {
7455 Magazine other_mag = Magazine.Cast(other_item);
7456 if (other_item)
7457 {
7458 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7459 return false;
7460 }
7461
7462 }
7463 }
7464 else
7465 {
7466
7468 return false;
7469
7471 return false;
7472 }
7473
7474 PlayerBase player = null;
7475 if (CastTo(player, GetHierarchyRootPlayer()))
7476 {
7477 if (player.GetInventory().HasAttachment(this))
7478 return false;
7479
7480 if (player.IsItemsToDelete())
7481 return false;
7482 }
7483
7484 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7485 return false;
7486
7487 int slotID;
7489 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7490 return false;
7491
7492 return true;
7493 }
7494
7496 {
7498 }
7499
7501 {
7502 return m_IsResultOfSplit;
7503 }
7504
7506 {
7507 m_IsResultOfSplit = value;
7508 }
7509
7511 {
7513 }
7514
7516 {
7517 float other_item_quantity = other_item.GetQuantity();
7518 float this_free_space;
7519
7521
7523
7524 if (other_item_quantity > this_free_space)
7525 {
7526 return this_free_space;
7527 }
7528 else
7529 {
7530 return other_item_quantity;
7531 }
7532 }
7533
7535 {
7537 }
7538
7540 {
7542 return;
7543
7544 if (!IsMagazine() && other_item)
7545 {
7547 if (quantity_used != 0)
7548 {
7549 float hp1 = GetHealth01("","");
7550 float hp2 = other_item.GetHealth01("","");
7551 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7552 hpResult = hpResult / (
GetQuantity() + quantity_used);
7553
7554 hpResult *= GetMaxHealth();
7555 Math.Round(hpResult);
7556 SetHealth("", "Health", hpResult);
7557
7559 other_item.AddQuantity(-quantity_used);
7560 }
7561 }
7563 }
7564
7566 {
7567 #ifdef SERVER
7568 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7569 GetHierarchyParent().IncreaseLifetimeUp();
7570 #endif
7571 };
7572
7574 {
7575 PlayerBase p = PlayerBase.Cast(player);
7576
7577 array<int> recipesIds = p.m_Recipes;
7578 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7579 if (moduleRecipesManager)
7580 {
7581 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7582 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7583 }
7584
7585 for (int i = 0;i < recipesIds.Count(); i++)
7586 {
7587 int key = recipesIds.Get(i);
7588 string recipeName = moduleRecipesManager.GetRecipeName(key);
7590 }
7591 }
7592
7593
7594 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7595 {
7596 super.GetDebugActions(outputList);
7597
7598
7603
7604
7608
7612
7613
7616
7617
7619 {
7622 }
7623
7625
7628
7632 }
7633
7634
7635
7636
7638 {
7639 super.OnAction(action_id, player, ctx);
7640 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7641 {
7642 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7643 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7644 PlayerBase p = PlayerBase.Cast(player);
7645 if (
EActions.RECIPES_RANGE_START < 1000)
7646 {
7647 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7648 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7649 }
7650 }
7651 #ifndef SERVER
7652 else if (action_id ==
EActions.WATCH_PLAYER)
7653 {
7654 PluginDeveloper.SetDeveloperItemClientEx(player);
7655 }
7656 #endif
7658 {
7659 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7660 {
7661 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7662 OnDebugButtonPressServer(id + 1);
7663 }
7664
7665 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7666 {
7667 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7669 }
7670
7671 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7672 {
7673 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7675 }
7676
7677 else if (action_id ==
EActions.ADD_QUANTITY)
7678 {
7679 if (IsMagazine())
7680 {
7681 Magazine mag = Magazine.Cast(this);
7682 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7683 }
7684 else
7685 {
7687 }
7688
7689 if (m_EM)
7690 {
7691 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7692 }
7693
7694 }
7695
7696 else if (action_id ==
EActions.REMOVE_QUANTITY)
7697 {
7698 if (IsMagazine())
7699 {
7700 Magazine mag2 = Magazine.Cast(this);
7701 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7702 }
7703 else
7704 {
7706 }
7707 if (m_EM)
7708 {
7709 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7710 }
7711
7712 }
7713
7714 else if (action_id ==
EActions.SET_QUANTITY_0)
7715 {
7717
7718 if (m_EM)
7719 {
7720 m_EM.SetEnergy(0);
7721 }
7722 }
7723
7724 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7725 {
7727
7728 if (m_EM)
7729 {
7730 m_EM.SetEnergy(m_EM.GetEnergyMax());
7731 }
7732 }
7733
7734 else if (action_id ==
EActions.ADD_HEALTH)
7735 {
7736 AddHealth("","",GetMaxHealth("","Health")/5);
7737 }
7738 else if (action_id ==
EActions.REMOVE_HEALTH)
7739 {
7740 AddHealth("","",-GetMaxHealth("","Health")/5);
7741 }
7742 else if (action_id ==
EActions.DESTROY_HEALTH)
7743 {
7744 SetHealth01("","",0);
7745 }
7746 else if (action_id ==
EActions.WATCH_ITEM)
7747 {
7749 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7750 #ifdef DEVELOPER
7751 SetDebugDeveloper_item(this);
7752 #endif
7753 }
7754
7755 else if (action_id ==
EActions.ADD_TEMPERATURE)
7756 {
7757 AddTemperature(20);
7758
7759 }
7760
7761 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7762 {
7763 AddTemperature(-20);
7764
7765 }
7766
7767 else if (action_id ==
EActions.FLIP_FROZEN)
7768 {
7769 SetFrozen(!GetIsFrozen());
7770
7771 }
7772
7773 else if (action_id ==
EActions.ADD_WETNESS)
7774 {
7776
7777 }
7778
7779 else if (action_id ==
EActions.REMOVE_WETNESS)
7780 {
7782
7783 }
7784
7785 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7786 {
7789
7790
7791 }
7792
7793 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
7794 {
7797 }
7798
7799 else if (action_id ==
EActions.MAKE_SPECIAL)
7800 {
7801 auto debugParams = DebugSpawnParams.WithPlayer(player);
7802 OnDebugSpawnEx(debugParams);
7803 }
7804
7805 else if (action_id ==
EActions.DELETE)
7806 {
7807 Delete();
7808 }
7809
7810 }
7811
7812
7813 return false;
7814 }
7815
7816
7817
7818
7822
7825
7826
7827
7829 {
7830 return false;
7831 }
7832
7833
7835 {
7836 return true;
7837 }
7838
7839
7841 {
7842 return true;
7843 }
7844
7845
7846
7848 {
7849 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
7851 }
7852
7855 {
7856 return null;
7857 }
7858
7860 {
7861 return false;
7862 }
7863
7865 {
7866 return false;
7867 }
7868
7872
7873
7875 {
7876 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7877 return module_repairing.CanRepair(this, item_repair_kit);
7878 }
7879
7880
7881 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
7882 {
7883 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
7884 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
7885 }
7886
7887
7889 {
7890
7891
7892
7893
7894
7895
7896
7897
7898 return 1;
7899 }
7900
7901
7902
7904 {
7906 }
7907
7908
7909
7911 {
7913 }
7914
7915
7924 {
7925 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7926
7927 if (player)
7928 {
7929 player.MessageStatus(text);
7930 }
7931 }
7932
7933
7942 {
7943 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7944
7945 if (player)
7946 {
7947 player.MessageAction(text);
7948 }
7949 }
7950
7951
7960 {
7961 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7962
7963 if (player)
7964 {
7965 player.MessageFriendly(text);
7966 }
7967 }
7968
7969
7978 {
7979 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
7980
7981 if (player)
7982 {
7983 player.MessageImportant(text);
7984 }
7985 }
7986
7988 {
7989 return true;
7990 }
7991
7992
7993 override bool KindOf(
string tag)
7994 {
7995 bool found = false;
7996 string item_name = this.
GetType();
7999
8000 int array_size = item_tag_array.Count();
8001 for (int i = 0; i < array_size; i++)
8002 {
8003 if (item_tag_array.Get(i) == tag)
8004 {
8005 found = true;
8006 break;
8007 }
8008 }
8009 return found;
8010 }
8011
8012
8014 {
8015
8016 super.OnRPC(sender, rpc_type,ctx);
8017
8018
8019 switch (rpc_type)
8020 {
8021 #ifndef SERVER
8022 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8023 Param2<bool, string> p = new Param2<bool, string>(false, "");
8024
8026 return;
8027
8028 bool play = p.param1;
8029 string soundSet = p.param2;
8030
8031 if (play)
8032 {
8034 {
8036 {
8038 }
8039 }
8040 else
8041 {
8043 }
8044 }
8045 else
8046 {
8048 }
8049
8050 break;
8051 #endif
8052
8053 }
8054
8056 {
8058 }
8059 }
8060
8061
8062
8063
8065 {
8066 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8067 return plugin.GetID(
name);
8068 }
8069
8071 {
8072 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8073 return plugin.GetName(id);
8074 }
8075
8078 {
8079
8080
8081 int varFlags;
8082 if (!ctx.
Read(varFlags))
8083 return;
8084
8085 if (varFlags & ItemVariableFlags.FLOAT)
8086 {
8088 }
8089 }
8090
8092 {
8093
8094 super.SerializeNumericalVars(floats_out);
8095
8096
8097
8099 {
8101 }
8102
8104 {
8106 }
8107
8109 {
8111 }
8112
8114 {
8119 }
8120
8122 {
8124 }
8125 }
8126
8128 {
8129
8130 super.DeSerializeNumericalVars(floats);
8131
8132
8133 int index = 0;
8134 int mask = Math.Round(floats.Get(index));
8135
8136 index++;
8137
8139 {
8141 {
8143 }
8144 else
8145 {
8146 float quantity = floats.Get(index);
8148 }
8149 index++;
8150 }
8151
8153 {
8154 float wet = floats.Get(index);
8156 index++;
8157 }
8158
8160 {
8161 int liquidtype = Math.Round(floats.Get(index));
8163 index++;
8164 }
8165
8167 {
8169 index++;
8171 index++;
8173 index++;
8175 index++;
8176 }
8177
8179 {
8180 int cleanness = Math.Round(floats.Get(index));
8182 index++;
8183 }
8184 }
8185
8187 {
8188 super.WriteVarsToCTX(ctx);
8189
8190
8192 {
8194 }
8195
8197 {
8199 }
8200
8202 {
8204 }
8205
8207 {
8208 int r,g,b,a;
8214 }
8215
8217 {
8219 }
8220 }
8221
8223 {
8224 if (!super.ReadVarsFromCTX(ctx,version))
8225 return false;
8226
8227 int intValue;
8228 float value;
8229
8230 if (version < 140)
8231 {
8232 if (!ctx.
Read(intValue))
8233 return false;
8234
8235 m_VariablesMask = intValue;
8236 }
8237
8239 {
8240 if (!ctx.
Read(value))
8241 return false;
8242
8244 {
8246 }
8247 else
8248 {
8250 }
8251 }
8252
8253 if (version < 140)
8254 {
8256 {
8257 if (!ctx.
Read(value))
8258 return false;
8259 SetTemperatureDirect(value);
8260 }
8261 }
8262
8264 {
8265 if (!ctx.
Read(value))
8266 return false;
8268 }
8269
8271 {
8272 if (!ctx.
Read(intValue))
8273 return false;
8275 }
8276
8278 {
8279 int r,g,b,a;
8281 return false;
8283 return false;
8285 return false;
8287 return false;
8288
8290 }
8291
8293 {
8294 if (!ctx.
Read(intValue))
8295 return false;
8297 }
8298
8299 if (version >= 138 && version < 140)
8300 {
8302 {
8303 if (!ctx.
Read(intValue))
8304 return false;
8305 SetFrozen(intValue);
8306 }
8307 }
8308
8309 return true;
8310 }
8311
8312
8314 {
8317 {
8319 }
8320
8321 if (!super.OnStoreLoad(ctx, version))
8322 {
8324 return false;
8325 }
8326
8327 if (version >= 114)
8328 {
8329 bool hasQuickBarIndexSaved;
8330
8331 if (!ctx.
Read(hasQuickBarIndexSaved))
8332 {
8334 return false;
8335 }
8336
8337 if (hasQuickBarIndexSaved)
8338 {
8339 int itmQBIndex;
8340
8341
8342 if (!ctx.
Read(itmQBIndex))
8343 {
8345 return false;
8346 }
8347
8348 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8349 if (itmQBIndex != -1 && parentPlayer)
8350 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8351 }
8352 }
8353 else
8354 {
8355
8356 PlayerBase player;
8357 int itemQBIndex;
8358 if (version ==
int.
MAX)
8359 {
8360 if (!ctx.
Read(itemQBIndex))
8361 {
8363 return false;
8364 }
8365 }
8366 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8367 {
8368
8369 if (!ctx.
Read(itemQBIndex))
8370 {
8372 return false;
8373 }
8374 if (itemQBIndex != -1 && player)
8375 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8376 }
8377 }
8378
8379 if (version < 140)
8380 {
8381
8382 if (!LoadVariables(ctx, version))
8383 {
8385 return false;
8386 }
8387 }
8388
8389
8391 {
8393 return false;
8394 }
8395 if (version >= 132)
8396 {
8398 if (raib)
8399 {
8401 {
8403 return false;
8404 }
8405 }
8406 }
8407
8409 return true;
8410 }
8411
8412
8413
8415 {
8416 super.OnStoreSave(ctx);
8417
8418 PlayerBase player;
8419 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8420 {
8422
8423 int itemQBIndex = -1;
8424 itemQBIndex = player.FindQuickBarEntityIndex(this);
8425 ctx.
Write(itemQBIndex);
8426 }
8427 else
8428 {
8430 }
8431
8433
8435 if (raib)
8436 {
8438 }
8439 }
8440
8441
8443 {
8444 super.AfterStoreLoad();
8445
8447 {
8449 }
8450
8452 {
8455 }
8456 }
8457
8459 {
8460 super.EEOnAfterLoad();
8461
8463 {
8465 }
8466
8469 }
8470
8472 {
8473 return false;
8474 }
8475
8476
8477
8479 {
8481 {
8482 #ifdef PLATFORM_CONSOLE
8483
8485 {
8487 if (menu)
8488 {
8490 }
8491 }
8492 #endif
8493 }
8494
8496 {
8499 }
8500
8502 {
8503 SetWeightDirty();
8505 }
8507 {
8510 }
8511
8513 {
8516 }
8518 {
8521 }
8522
8523 super.OnVariablesSynchronized();
8524 }
8525
8526
8527
8529 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8530 {
8531 if (!IsServerCheck(allow_client))
8532 return false;
8533
8535 return false;
8536
8539
8540 if (value <= (min + 0.001))
8541 value = min;
8542
8543 if (value == min)
8544 {
8545 if (destroy_config)
8546 {
8547 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8548 if (dstr)
8549 {
8551 this.Delete();
8552 return true;
8553 }
8554 }
8555 else if (destroy_forced)
8556 {
8558 this.Delete();
8559 return true;
8560 }
8561
8563 }
8564
8567
8569 {
8571
8572 if (delta)
8574 }
8575
8577
8578 return false;
8579 }
8580
8581
8583 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8584 {
8586 }
8587
8589 {
8592 }
8593
8595 {
8598 }
8599
8602 {
8603 float value_clamped = Math.Clamp(value, 0, 1);
8605 SetQuantity(result, destroy_config, destroy_forced);
8606 }
8607
8608
8611 {
8613 }
8614
8616 {
8618 }
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8630 {
8631 int slot = -1;
8632 if (GetInventory())
8633 {
8634 InventoryLocation il = new InventoryLocation;
8635 GetInventory().GetCurrentInventoryLocation(il);
8637 }
8638
8640 }
8641
8643 {
8644 float quantity_max = 0;
8645
8647 {
8648 if (attSlotID != -1)
8649 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8650
8651 if (quantity_max <= 0)
8653 }
8654
8655 if (quantity_max <= 0)
8657
8658 return quantity_max;
8659 }
8660
8662 {
8664 }
8665
8667 {
8669 }
8670
8671
8673 {
8675 }
8676
8678 {
8680 }
8681
8683 {
8685 }
8686
8687
8689 {
8690
8691 float weightEx = GetWeightEx();
8692 float special = GetInventoryAndCargoWeight();
8693 return weightEx - special;
8694 }
8695
8696
8698 {
8700 }
8701
8703 {
8705 {
8706 #ifdef DEVELOPER
8707 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8708 {
8709 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8711 }
8712 #endif
8713
8715 }
8716 else if (HasEnergyManager())
8717 {
8718 #ifdef DEVELOPER
8719 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8720 {
8721 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8722 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8723 }
8724 #endif
8725 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8726 }
8727 else
8728 {
8729 #ifdef DEVELOPER
8730 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8731 {
8732 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8733 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8734 }
8735 #endif
8736 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
8737 }
8738 }
8739
8742 {
8743 int item_count = 0;
8745
8746 if (GetInventory().GetCargo() != NULL)
8747 {
8748 item_count = GetInventory().GetCargo().GetItemCount();
8749 }
8750
8751 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8752 {
8753 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8754 if (item)
8755 item_count += item.GetNumberOfItems();
8756 }
8757 return item_count;
8758 }
8759
8762 {
8763 float weight = 0;
8764 float wetness = 1;
8765 if (include_wetness)
8768 {
8769 weight = wetness * m_ConfigWeight;
8770 }
8772 {
8773 weight = 1;
8774 }
8775 return weight;
8776 }
8777
8778
8779
8781 {
8782 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8783 {
8784 GameInventory inv = GetInventory();
8785 array<EntityAI> items = new array<EntityAI>;
8787 for (int i = 0; i < items.Count(); i++)
8788 {
8790 if (item)
8791 {
8793 }
8794 }
8795 }
8796 }
8797
8798
8799
8800
8802 {
8803 float energy = 0;
8804 if (HasEnergyManager())
8805 {
8806 energy = GetCompEM().GetEnergy();
8807 }
8808 return energy;
8809 }
8810
8811
8813 {
8814 super.OnEnergyConsumed();
8815
8817 }
8818
8820 {
8821 super.OnEnergyAdded();
8822
8824 }
8825
8826
8828 {
8829 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
8830 {
8832 {
8833 float energy_0to1 = GetCompEM().GetEnergy0To1();
8835 }
8836 }
8837 }
8838
8839
8841 {
8842 return ConfigGetFloat("heatIsolation");
8843 }
8844
8846 {
8848 }
8849
8851 {
8852 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
8853 if (
GetGame().ConfigIsExisting(paramPath))
8855
8856 return 0.0;
8857 }
8858
8860 {
8861 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
8862 if (
GetGame().ConfigIsExisting(paramPath))
8864
8865 return 0.0;
8866 }
8867
8868 override void SetWet(
float value,
bool allow_client =
false)
8869 {
8870 if (!IsServerCheck(allow_client))
8871 return;
8872
8875
8877
8878 m_VarWet = Math.Clamp(value, min, max);
8879
8881 {
8884 }
8885 }
8886
8887 override void AddWet(
float value)
8888 {
8890 }
8891
8893 {
8895 }
8896
8898 {
8900 }
8901
8903 {
8905 }
8906
8908 {
8910 }
8911
8913 {
8915 }
8916
8918 {
8921 if (newLevel != oldLevel)
8922 {
8924 }
8925 }
8926
8928 {
8929 SetWeightDirty();
8930 }
8931
8933 {
8934 return GetWetLevelInternal(
m_VarWet);
8935 }
8936
8937
8938
8940 {
8942 }
8943
8945 {
8947 }
8948
8950 {
8952 }
8953
8955 {
8957 }
8958
8959
8960
8962 {
8963 if (ConfigIsExisting("itemModelLength"))
8964 {
8965 return ConfigGetFloat("itemModelLength");
8966 }
8967 return 0;
8968 }
8969
8971 {
8972 if (ConfigIsExisting("itemAttachOffset"))
8973 {
8974 return ConfigGetFloat("itemAttachOffset");
8975 }
8976 return 0;
8977 }
8978
8979 override void SetCleanness(
int value,
bool allow_client =
false)
8980 {
8981 if (!IsServerCheck(allow_client))
8982 return;
8983
8985
8987
8990 }
8991
8993 {
8995 }
8996
8998 {
8999 return true;
9000 }
9001
9002
9003
9004
9006 {
9008 }
9009
9011 {
9013 }
9014
9015
9016
9017
9018 override void SetColor(
int r,
int g,
int b,
int a)
9019 {
9025 }
9027 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9028 {
9033 }
9034
9036 {
9038 }
9039
9042 {
9043 int r,g,b,a;
9045 r = r/255;
9046 g = g/255;
9047 b = b/255;
9048 a = a/255;
9049 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9050 }
9051
9052
9053
9054 override void SetLiquidType(
int value,
bool allow_client =
false)
9055 {
9056 if (!IsServerCheck(allow_client))
9057 return;
9058
9063 }
9064
9066 {
9067 return ConfigGetInt("varLiquidTypeInit");
9068 }
9069
9071 {
9073 }
9074
9076 {
9078 SetFrozen(false);
9079 }
9080
9083 {
9084 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9085 }
9086
9087
9090 {
9091 PlayerBase nplayer;
9092 if (PlayerBase.CastTo(nplayer, player))
9093 {
9095
9096 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9097 }
9098 }
9099
9100
9103 {
9104 PlayerBase nplayer;
9105 if (PlayerBase.CastTo(nplayer,player))
9106 {
9107
9108 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9109
9110 }
9111
9112
9113 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9114
9115
9116 if (HasEnergyManager())
9117 {
9118 GetCompEM().UpdatePlugState();
9119 }
9120 }
9121
9122
9124 {
9125 super.OnPlacementStarted(player);
9126
9128 }
9129
9130 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9131 {
9133 {
9134 m_AdminLog.OnPlacementComplete(player,
this);
9135 }
9136
9137 super.OnPlacementComplete(player, position, orientation);
9138 }
9139
9140
9141
9142
9143
9145 {
9147 {
9148 return true;
9149 }
9150 else
9151 {
9152 return false;
9153 }
9154 }
9155
9156
9158 {
9160 {
9162 }
9163 }
9164
9165
9167 {
9169 }
9170
9172 {
9174 }
9175
9176 override void InsertAgent(
int agent,
float count = 1)
9177 {
9178 if (count < 1)
9179 return;
9180
9182 }
9183
9186 {
9188 }
9189
9190
9192 {
9194 }
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9238 {
9240 return false;
9241 return true;
9242 }
9243
9245 {
9246
9248 }
9249
9250
9253 {
9254 super.CheckForRoofLimited(timeTresholdMS);
9255
9257 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9258 {
9259 m_PreviousRoofTestTime = time;
9260 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9261 }
9262 }
9263
9264
9266 {
9268 {
9269 return 0;
9270 }
9271
9272 if (GetInventory().GetAttachmentSlotsCount() != 0)
9273 {
9274 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9275 if (filter)
9276 return filter.GetProtectionLevel(type, false, system);
9277 else
9278 return 0;
9279 }
9280
9281 string subclassPath, entryName;
9282
9283 switch (type)
9284 {
9286 entryName = "biological";
9287 break;
9289 entryName = "chemical";
9290 break;
9291 default:
9292 entryName = "biological";
9293 break;
9294 }
9295
9296 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9297
9299 }
9300
9301
9302
9305 {
9306 if (!IsMagazine())
9308
9310 }
9311
9312
9313
9314
9315
9320 {
9321 return true;
9322 }
9323
9325 {
9327 }
9328
9329
9330
9331
9332
9334 {
9335 if (parent)
9336 {
9337 if (parent.IsInherited(DayZInfected))
9338 return true;
9339
9340 if (!parent.IsRuined())
9341 return true;
9342 }
9343
9344 return true;
9345 }
9346
9348 {
9349 if (!super.CanPutAsAttachment(parent))
9350 {
9351 return false;
9352 }
9353
9354 if (!IsRuined() && !parent.IsRuined())
9355 {
9356 return true;
9357 }
9358
9359 return false;
9360 }
9361
9363 {
9364
9365
9366
9367
9368 return super.CanReceiveItemIntoCargo(item);
9369 }
9370
9372 {
9373
9374
9375
9376
9377 GameInventory attachmentInv = attachment.GetInventory();
9379 {
9380 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9381 return false;
9382 }
9383
9384 InventoryLocation loc = new InventoryLocation();
9385 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9386 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9387 return false;
9388
9389 return super.CanReceiveAttachment(attachment, slotId);
9390 }
9391
9393 {
9394 if (!super.CanReleaseAttachment(attachment))
9395 return false;
9396
9397 return GetInventory().AreChildrenAccessible();
9398 }
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9421 {
9422 int id = muzzle_owner.GetMuzzleID();
9423 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9424
9425 if (WPOF_array)
9426 {
9427 for (int i = 0; i < WPOF_array.Count(); i++)
9428 {
9429 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9430
9431 if (WPOF)
9432 {
9433 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9434 }
9435 }
9436 }
9437 }
9438
9439
9441 {
9442 int id = muzzle_owner.GetMuzzleID();
9444
9445 if (WPOBE_array)
9446 {
9447 for (int i = 0; i < WPOBE_array.Count(); i++)
9448 {
9449 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9450
9451 if (WPOBE)
9452 {
9453 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9454 }
9455 }
9456 }
9457 }
9458
9459
9461 {
9462 int id = muzzle_owner.GetMuzzleID();
9463 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9464
9465 if (WPOOH_array)
9466 {
9467 for (int i = 0; i < WPOOH_array.Count(); i++)
9468 {
9469 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9470
9471 if (WPOOH)
9472 {
9473 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9474 }
9475 }
9476 }
9477 }
9478
9479
9481 {
9482 int id = muzzle_owner.GetMuzzleID();
9483 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9484
9485 if (WPOOH_array)
9486 {
9487 for (int i = 0; i < WPOOH_array.Count(); i++)
9488 {
9489 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9490
9491 if (WPOOH)
9492 {
9493 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9494 }
9495 }
9496 }
9497 }
9498
9499
9501 {
9502 int id = muzzle_owner.GetMuzzleID();
9503 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9504
9505 if (WPOOH_array)
9506 {
9507 for (int i = 0; i < WPOOH_array.Count(); i++)
9508 {
9509 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9510
9511 if (WPOOH)
9512 {
9513 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9514 }
9515 }
9516 }
9517 }
9518
9519
9520
9522 {
9524 {
9525 return true;
9526 }
9527
9528 return false;
9529 }
9530
9532 {
9534 {
9535 return true;
9536 }
9537
9538 return false;
9539 }
9540
9542 {
9544 {
9545 return true;
9546 }
9547
9548 return false;
9549 }
9550
9552 {
9553 return false;
9554 }
9555
9558 {
9559 return UATimeSpent.DEFAULT_DEPLOY;
9560 }
9561
9562
9563
9564
9566 {
9568 SetSynchDirty();
9569 }
9570
9572 {
9574 }
9575
9576
9578 {
9579 return false;
9580 }
9581
9584 {
9585 string att_type = "None";
9586
9587 if (ConfigIsExisting("soundAttType"))
9588 {
9589 att_type = ConfigGetString("soundAttType");
9590 }
9591
9593 }
9594
9596 {
9598 }
9599
9600
9601
9602
9603
9607
9609 {
9612
9614 }
9615
9616
9618 {
9620 return;
9621
9623
9626
9629
9630 SoundParameters params = new SoundParameters();
9634 }
9635
9636
9638 {
9640 return;
9641
9643 SetSynchDirty();
9644
9647 }
9648
9649
9651 {
9653 return;
9654
9656 SetSynchDirty();
9657
9660 }
9661
9663 {
9665 }
9666
9668 {
9670 }
9671
9674 {
9675 if (!
GetGame().IsDedicatedServer())
9676 {
9677 if (ConfigIsExisting("attachSoundSet"))
9678 {
9679 string cfg_path = "";
9680 string soundset = "";
9682
9685 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9686 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9687
9688 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9689 {
9690 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9691 {
9692 if (cfg_slot_array[i] == slot_type)
9693 {
9694 soundset = cfg_soundset_array[i];
9695 break;
9696 }
9697 }
9698 }
9699
9700 if (soundset != "")
9701 {
9702 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9704 }
9705 }
9706 }
9707 }
9708
9710 {
9711
9712 }
9713
9714 void OnApply(PlayerBase player);
9715
9717 {
9718 return 1.0;
9719 };
9720
9722 {
9724 }
9725
9727 {
9729 }
9730
9732
9734 {
9735 SetDynamicPhysicsLifeTime(0.01);
9737 }
9738
9740 {
9741 array<string> zone_names = new array<string>;
9742 GetDamageZones(zone_names);
9743 for (int i = 0; i < zone_names.Count(); i++)
9744 {
9745 SetHealthMax(zone_names.Get(i),"Health");
9746 }
9747 SetHealthMax("","Health");
9748 }
9749
9752 {
9753 float global_health = GetHealth01("","Health");
9754 array<string> zones = new array<string>;
9755 GetDamageZones(zones);
9756
9757 for (int i = 0; i < zones.Count(); i++)
9758 {
9759 SetHealth01(zones.Get(i),"Health",global_health);
9760 }
9761 }
9762
9765 {
9766 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9767 }
9768
9770 {
9771 if (!hasRootAsPlayer)
9772 {
9773 if (refParentIB)
9774 {
9775
9776 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9777 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9778
9779 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9780 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9781
9784 }
9785 else
9786 {
9787
9790 }
9791 }
9792 }
9793
9795 {
9797 {
9798 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
9799 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
9800 {
9801 float heatPermCoef = 1.0;
9803 while (ent)
9804 {
9805 heatPermCoef *= ent.GetHeatPermeabilityCoef();
9806 ent = ent.GetHierarchyParent();
9807 }
9808
9809 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
9810 }
9811 }
9812 }
9813
9815 {
9816
9817 EntityAI parent = GetHierarchyParent();
9818 if (!parent)
9819 {
9820 hasParent = false;
9821 hasRootAsPlayer = false;
9822 }
9823 else
9824 {
9825 hasParent = true;
9826 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
9827 refParentIB =
ItemBase.Cast(parent);
9828 }
9829 }
9830
9831 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
9832 {
9833
9834 }
9835
9837 {
9838
9839 return false;
9840 }
9841
9843 {
9844
9845
9846 return false;
9847 }
9848
9850 {
9851
9852 return false;
9853 }
9854
9857 {
9858 return !GetIsFrozen() &&
IsOpen();
9859 }
9860
9862 {
9863 bool hasParent = false, hasRootAsPlayer = false;
9865
9866 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
9867 bool foodDecay =
g_Game.IsFoodDecayEnabled();
9868
9869 if (wwtu || foodDecay)
9870 {
9874
9875 if (processWetness || processTemperature || processDecay)
9876 {
9878
9879 if (processWetness)
9880 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
9881
9882 if (processTemperature)
9884
9885 if (processDecay)
9886 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
9887 }
9888 }
9889 }
9890
9893 {
9895 }
9896
9898 {
9901
9902 return super.GetTemperatureFreezeThreshold();
9903 }
9904
9906 {
9909
9910 return super.GetTemperatureThawThreshold();
9911 }
9912
9914 {
9917
9918 return super.GetItemOverheatThreshold();
9919 }
9920
9922 {
9924 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
9925
9926 return super.GetTemperatureFreezeTime();
9927 }
9928
9930 {
9932 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
9933
9934 return super.GetTemperatureThawTime();
9935 }
9936
9941
9943 {
9944 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
9945 }
9946
9948 {
9949 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
9950 }
9951
9954 {
9956 }
9957
9959 {
9961 }
9962
9964 {
9966 }
9967
9970 {
9971 return null;
9972 }
9973
9976 {
9977 return false;
9978 }
9979
9981 {
9983 {
9986 if (!trg)
9987 {
9989 explosive = this;
9990 }
9991
9992 explosive.PairRemote(trg);
9994
9995 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
9996 trg.SetPersistentPairID(persistentID);
9997 explosive.SetPersistentPairID(persistentID);
9998
9999 return true;
10000 }
10001 return false;
10002 }
10003
10006 {
10007 float ret = 1.0;
10010 ret *= GetHealth01();
10011
10012 return ret;
10013 }
10014
10015 #ifdef DEVELOPER
10016 override void SetDebugItem()
10017 {
10018 super.SetDebugItem();
10019 _itemBase = this;
10020 }
10021
10023 {
10024 string text = super.GetDebugText();
10025
10027 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10028
10029 return text;
10030 }
10031 #endif
10032
10034 {
10035 return true;
10036 }
10037
10039
10041
10043 {
10046 }
10047
10048
10056
10072}
10073
10075{
10077 if (entity)
10078 {
10079 bool is_item = entity.IsInherited(
ItemBase);
10080 if (is_item && full_quantity)
10081 {
10084 }
10085 }
10086 else
10087 {
10089 return NULL;
10090 }
10091 return entity;
10092}
10093
10095{
10096 if (item)
10097 {
10098 if (health > 0)
10099 item.SetHealth("", "", health);
10100
10101 if (item.CanHaveTemperature())
10102 {
10104 if (item.CanFreeze())
10105 item.SetFrozen(false);
10106 }
10107
10108 if (item.HasEnergyManager())
10109 {
10110 if (quantity >= 0)
10111 {
10112 item.GetCompEM().SetEnergy0To1(quantity);
10113 }
10114 else
10115 {
10117 }
10118 }
10119 else if (item.IsMagazine())
10120 {
10121 Magazine mag = Magazine.Cast(item);
10122 if (quantity >= 0)
10123 {
10124 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10125 }
10126 else
10127 {
10129 }
10130
10131 }
10132 else
10133 {
10134 if (quantity >= 0)
10135 {
10136 item.SetQuantityNormalized(quantity, false);
10137 }
10138 else
10139 {
10141 }
10142
10143 }
10144 }
10145}
10146
10147#ifdef DEVELOPER
10149#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.