5401{
5403 {
5404 return true;
5405 }
5406};
5407
5408
5409
5411{
5415
5417
5420
5421
5422
5423
5424
5433
5439
5444
5449
5470 protected bool m_IsResultOfSplit
5471
5473
5478
5479
5480
5482
5486
5487
5488
5490
5493
5494
5495
5501
5502
5510
5513
5514
5516
5517
5519
5520
5525
5526
5531
5532
5534
5535
5537 {
5542
5543 if (!
GetGame().IsDedicatedServer())
5544 {
5546 {
5548
5550 {
5552 }
5553 }
5554
5557 }
5558
5559 m_OldLocation = null;
5560
5562 {
5564 }
5565
5566 if (ConfigIsExisting("headSelectionsToHide"))
5567 {
5570 }
5571
5573 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5574 {
5576 }
5577
5579
5580 m_IsResultOfSplit = false;
5581
5583 }
5584
5586 {
5587 super.InitItemVariables();
5588
5594 m_Count = ConfigGetInt(
"count");
5595
5598
5603
5606
5611
5623
5627
5628
5631 if (ConfigIsExisting("canBeSplit"))
5632 {
5635 }
5636
5638 if (ConfigIsExisting("itemBehaviour"))
5640
5641
5644 RegisterNetSyncVariableInt("m_VarLiquidType");
5645 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5646
5647 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5648 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5649 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5650
5651 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5652 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5653 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5654 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5655
5656 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5657 RegisterNetSyncVariableBool("m_IsTakeable");
5658 RegisterNetSyncVariableBool("m_IsHologram");
5659
5662 {
5665 }
5666
5668
5670 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5672
5673 }
5674
5676 {
5678 }
5679
5681 {
5684 {
5689 }
5690 }
5691
5692 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5693 {
5695 {
5698 }
5699
5701 }
5702
5704 {
5710 }
5711
5713
5715 {
5717
5718 if (!action)
5719 {
5720 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5721 return;
5722 }
5723
5725 if (!ai)
5726 {
5728 return;
5729 }
5730
5732 if (!action_array)
5733 {
5734 action_array = new array<ActionBase_Basic>;
5736 }
5737 if (LogManager.IsActionLogEnable())
5738 {
5739 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5740 }
5741
5742 if (action_array.Find(action) != -1)
5743 {
5744 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5745 }
5746 else
5747 {
5748 action_array.Insert(action);
5749 }
5750 }
5751
5753 {
5755 ActionBase action = player.GetActionManager().GetAction(actionName);
5758
5759 if (action_array)
5760 {
5761 action_array.RemoveItem(action);
5762 }
5763 }
5764
5765
5766
5768 {
5769 ActionOverrideData overrideData = new ActionOverrideData();
5773
5775 if (!actionMap)
5776 {
5779 }
5780
5781 actionMap.Insert(this.
Type(), overrideData);
5782
5783 }
5784
5786
5788
5789
5791 {
5794
5797
5798 string config_to_search = "CfgVehicles";
5799 string muzzle_owner_config;
5800
5802 {
5803 if (IsInherited(Weapon))
5804 config_to_search = "CfgWeapons";
5805
5806 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5807
5808 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5809
5811
5812 if (config_OnFire_subclass_count > 0)
5813 {
5814 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5815
5816 for (int i = 0; i < config_OnFire_subclass_count; i++)
5817 {
5818 string particle_class = "";
5820 string config_OnFire_entry = config_OnFire_class + particle_class;
5821 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5822 WPOF_array.Insert(WPOF);
5823 }
5824
5825
5827 }
5828 }
5829
5831 {
5832 config_to_search = "CfgWeapons";
5833 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5834
5835 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5836
5838
5839 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5840 {
5841 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5842
5843 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5844 {
5845 string particle_class2 = "";
5847 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5848 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5849 WPOBE_array.Insert(WPOBE);
5850 }
5851
5852
5854 }
5855 }
5856 }
5857
5858
5860 {
5863
5865 {
5866 string config_to_search = "CfgVehicles";
5867
5868 if (IsInherited(Weapon))
5869 config_to_search = "CfgWeapons";
5870
5871 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5872 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5873
5874 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5875 {
5876
5878
5880 {
5882 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5884 return;
5885 }
5886
5889
5890
5891
5893 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5894
5895 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5896 {
5897 string particle_class = "";
5899 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5901
5902 if (entry_type == CT_CLASS)
5903 {
5904 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5905 WPOOH_array.Insert(WPOF);
5906 }
5907 }
5908
5909
5911 }
5912 }
5913 }
5914
5916 {
5918 }
5919
5921 {
5923 {
5925
5928
5931
5932 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5933 }
5934 }
5935
5937 {
5939 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5940
5942 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5943
5945 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5946
5948 {
5950 }
5951 }
5952
5954 {
5956 }
5957
5959 {
5962 else
5964
5966 {
5969 }
5970 else
5971 {
5974
5977 }
5978
5980 }
5981
5983 {
5985 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5986 }
5987
5989 {
5991 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
5993 }
5994
5996 {
5998 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5999 }
6000
6002 {
6005
6006 OverheatingParticle OP = new OverheatingParticle();
6011
6013 }
6014
6016 {
6019
6020 return -1;
6021 }
6022
6024 {
6026 {
6029
6030 for (int i = count; i > 0; --i)
6031 {
6032 int id = i - 1;
6035
6038
6039 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6040 {
6041 if (p)
6042 {
6045 }
6046 }
6047 }
6048 }
6049 }
6050
6052 {
6054 {
6056 {
6057 int id = i - 1;
6059
6060 if (OP)
6061 {
6063
6064 if (p)
6065 {
6067 }
6068
6069 delete OP;
6070 }
6071 }
6072
6075 }
6076 }
6077
6080 {
6081 return 0.0;
6082 }
6083
6084
6086 {
6087 return 250;
6088 }
6089
6091 {
6092 return 0;
6093 }
6094
6097 {
6099 return true;
6100
6101 return false;
6102 }
6103
6106 {
6109
6111 {
6113 }
6114 else
6115 {
6116
6118 }
6119
6121 }
6122
6129 {
6130 return -1;
6131 }
6132
6133
6134
6135
6137 {
6139 {
6141 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6142
6143 if (r_index >= 0)
6144 {
6145 InventoryLocation r_il = new InventoryLocation;
6146 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6147
6148 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6151 {
6152 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6153 }
6155 {
6156 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6157 }
6158
6159 }
6160
6161 player.GetHumanInventory().ClearUserReservedLocation(this);
6162 }
6163
6166 }
6167
6168
6169
6170
6172 {
6173 return ItemBase.m_DebugActionsMask;
6174 }
6175
6177 {
6178 return ItemBase.m_DebugActionsMask & mask;
6179 }
6180
6182 {
6183 ItemBase.m_DebugActionsMask = mask;
6184 }
6185
6187 {
6188 ItemBase.m_DebugActionsMask |= mask;
6189 }
6190
6192 {
6193 ItemBase.m_DebugActionsMask &= ~mask;
6194 }
6195
6197 {
6199 {
6201 }
6202 else
6203 {
6205 }
6206 }
6207
6208
6210 {
6211 if (GetEconomyProfile())
6212 {
6213 float q_max = GetEconomyProfile().GetQuantityMax();
6214 if (q_max > 0)
6215 {
6216 float q_min = GetEconomyProfile().GetQuantityMin();
6217 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6218
6220 {
6221 ComponentEnergyManager comp = GetCompEM();
6223 {
6225 }
6226 }
6228 {
6230
6231 }
6232
6233 }
6234 }
6235 }
6236
6239 {
6240 EntityAI parent = GetHierarchyParent();
6241
6242 if (parent)
6243 {
6244 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6245 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6246 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6247 }
6248 }
6249
6252 {
6253 EntityAI parent = GetHierarchyParent();
6254
6255 if (parent)
6256 {
6257 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6258 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6259 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6260 }
6261 }
6262
6264 {
6265
6266
6267
6268
6270
6272 {
6273 if (ScriptInputUserData.CanStoreInputUserData())
6274 {
6275 ScriptInputUserData ctx = new ScriptInputUserData;
6281 ctx.
Write(use_stack_max);
6284
6286 {
6287 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6288 }
6289 }
6290 }
6291 else if (!
GetGame().IsMultiplayer())
6292 {
6294 }
6295 }
6296
6298 {
6300 }
6301
6303 {
6305 }
6306
6308 {
6310 }
6311
6313 {
6314
6315 return false;
6316 }
6317
6319 {
6320 return false;
6321 }
6322
6326 {
6327 return false;
6328 }
6329
6331 {
6332 return "";
6333 }
6334
6336
6338 {
6339 return false;
6340 }
6341
6343 {
6344 return true;
6345 }
6346
6347
6348
6350 {
6351 return true;
6352 }
6353
6355 {
6356 return true;
6357 }
6358
6360 {
6361 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6363 }
6364
6366 {
6368 }
6369
6371 {
6373 if (!is_being_placed)
6375 SetSynchDirty();
6376 }
6377
6378
6380
6382 {
6384 }
6385
6387 {
6389 }
6390
6392 {
6393 return 1;
6394 }
6395
6397 {
6398 return false;
6399 }
6400
6402 {
6404 SetSynchDirty();
6405 }
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6442 {
6443 super.OnMovedInsideCargo(container);
6444
6445 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6446 }
6447
6448 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6449 {
6450 super.EEItemLocationChanged(oldLoc,newLoc);
6451
6452 PlayerBase new_player = null;
6453 PlayerBase old_player = null;
6454
6455 if (newLoc.GetParent())
6456 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6457
6458 if (oldLoc.GetParent())
6459 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6460
6462 {
6463 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6464
6465 if (r_index >= 0)
6466 {
6467 InventoryLocation r_il = new InventoryLocation;
6468 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6469
6470 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6473 {
6474 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6475 }
6477 {
6478 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6479 }
6480
6481 }
6482 }
6483
6485 {
6486 if (new_player)
6487 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6488
6489 if (new_player == old_player)
6490 {
6491
6492 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6493 {
6495 {
6496 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6497 {
6498 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6499 }
6500 }
6501 else
6502 {
6503 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6504 }
6505 }
6506
6507 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6508 {
6509 int type = oldLoc.GetType();
6511 {
6512 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6513 }
6515 {
6516 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6517 }
6518 }
6519 if (!m_OldLocation)
6520 {
6521 m_OldLocation = new InventoryLocation;
6522 }
6523 m_OldLocation.Copy(oldLoc);
6524 }
6525 else
6526 {
6527 if (m_OldLocation)
6528 {
6529 m_OldLocation.Reset();
6530 }
6531 }
6532
6534 }
6535 else
6536 {
6537 if (new_player)
6538 {
6539 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6540 if (res_index >= 0)
6541 {
6542 InventoryLocation il = new InventoryLocation;
6543 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6545 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6548 {
6549 il.
GetParent().GetOnReleaseLock().Invoke(it);
6550 }
6552 {
6554 }
6555
6556 }
6557 }
6559 {
6560
6562 }
6563
6564 if (m_OldLocation)
6565 {
6566 m_OldLocation.Reset();
6567 }
6568 }
6569 }
6570
6571 override void EOnContact(IEntity other, Contact extra)
6572 {
6574 {
6575 int liquidType = -1;
6577 if (impactSpeed > 0.0)
6578 {
6580 #ifndef SERVER
6582 #else
6584 SetSynchDirty();
6585 #endif
6587 }
6588 }
6589
6590 #ifdef SERVER
6591 if (GetCompEM() && GetCompEM().IsPlugged())
6592 {
6593 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6594 GetCompEM().UnplugThis();
6595 }
6596 #endif
6597 }
6598
6600
6602 {
6604 }
6605
6607 {
6608
6609 }
6610
6612 {
6613 super.OnItemLocationChanged(old_owner, new_owner);
6614
6615 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6616 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6617
6618 if (!relatedPlayer && playerNew)
6619 relatedPlayer = playerNew;
6620
6621 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6622 {
6624 if (actionMgr)
6625 {
6626 ActionBase currentAction = actionMgr.GetRunningAction();
6627 if (currentAction)
6629 }
6630 }
6631
6632 Man ownerPlayerOld = null;
6633 Man ownerPlayerNew = null;
6634
6635 if (old_owner)
6636 {
6637 if (old_owner.
IsMan())
6638 {
6639 ownerPlayerOld = Man.Cast(old_owner);
6640 }
6641 else
6642 {
6643 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6644 }
6645 }
6646 else
6647 {
6649 {
6651
6652 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6653 {
6654 GetCompEM().UnplugThis();
6655 }
6656 }
6657 }
6658
6659 if (new_owner)
6660 {
6661 if (new_owner.
IsMan())
6662 {
6663 ownerPlayerNew = Man.Cast(new_owner);
6664 }
6665 else
6666 {
6667 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6668 }
6669 }
6670
6671 if (ownerPlayerOld != ownerPlayerNew)
6672 {
6673 if (ownerPlayerOld)
6674 {
6675 array<EntityAI> subItemsExit = new array<EntityAI>;
6677 for (int i = 0; i < subItemsExit.Count(); i++)
6678 {
6681 }
6682 }
6683
6684 if (ownerPlayerNew)
6685 {
6686 array<EntityAI> subItemsEnter = new array<EntityAI>;
6688 for (int j = 0; j < subItemsEnter.Count(); j++)
6689 {
6692 }
6693 }
6694 }
6695 else if (ownerPlayerNew != null)
6696 {
6697 PlayerBase nplayer;
6698 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6699 {
6700 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6702 for (int k = 0; k < subItemsUpdate.Count(); k++)
6703 {
6705 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6706 }
6707 }
6708 }
6709
6710 if (old_owner)
6711 old_owner.OnChildItemRemoved(this);
6712 if (new_owner)
6713 new_owner.OnChildItemReceived(this);
6714 }
6715
6716
6718 {
6719 super.EEDelete(parent);
6720 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6721 if (player)
6722 {
6724
6725 if (player.IsAlive())
6726 {
6727 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6728 if (r_index >= 0)
6729 {
6730 InventoryLocation r_il = new InventoryLocation;
6731 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6732
6733 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6736 {
6737 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6738 }
6740 {
6741 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6742 }
6743
6744 }
6745
6746 player.RemoveQuickBarEntityShortcut(this);
6747 }
6748 }
6749 }
6750
6752 {
6753 super.EEKilled(killer);
6754
6757 {
6758 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6759 {
6760 if (IsMagazine())
6761 {
6762 if (Magazine.Cast(this).GetAmmoCount() > 0)
6763 {
6765 }
6766 }
6767 else
6768 {
6770 }
6771 }
6772 }
6773 }
6774
6776 {
6777 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6778
6779 super.OnWasAttached(parent, slot_id);
6780
6783
6785 }
6786
6788 {
6789 super.OnWasDetached(parent, slot_id);
6790
6793 }
6794
6796 {
6797 int idx;
6800
6801 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6802 if (inventory_slots.Count() < 1)
6803 {
6804 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6805 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6806 }
6807 else
6808 {
6809 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6810 }
6811
6812 idx = inventory_slots.Find(slot);
6813 if (idx < 0)
6814 return "";
6815
6816 return attach_types.Get(idx);
6817 }
6818
6820 {
6821 int idx = -1;
6822 string slot;
6823
6826
6827 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6828 if (inventory_slots.Count() < 1)
6829 {
6830 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6831 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6832 }
6833 else
6834 {
6835 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6836 if (detach_types.Count() < 1)
6837 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6838 }
6839
6840 for (int i = 0; i < inventory_slots.Count(); i++)
6841 {
6842 slot = inventory_slots.Get(i);
6843 }
6844
6845 if (slot != "")
6846 {
6847 if (detach_types.Count() == 1)
6848 idx = 0;
6849 else
6850 idx = inventory_slots.Find(slot);
6851 }
6852 if (idx < 0)
6853 return "";
6854
6855 return detach_types.Get(idx);
6856 }
6857
6859 {
6860
6862
6863
6864 float min_time = 1;
6865 float max_time = 3;
6866 float delay = Math.RandomFloat(min_time, max_time);
6867
6868 explode_timer.Run(delay, this, "DoAmmoExplosion");
6869 }
6870
6872 {
6873 Magazine magazine = Magazine.Cast(this);
6874 int pop_sounds_count = 6;
6875 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6876
6877
6878 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6879 string sound_name = pop_sounds[ sound_idx ];
6881
6882
6883 magazine.ServerAddAmmoCount(-1);
6884
6885
6886 float min_temp_to_explode = 100;
6887
6888 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
6889 {
6891 }
6892 }
6893
6894
6895 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6896 {
6897 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6898
6899 const int CHANCE_DAMAGE_CARGO = 4;
6900 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6901 const int CHANCE_DAMAGE_NOTHING = 2;
6902
6904 {
6905 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6906 int chances;
6907 int rnd;
6908
6909 if (GetInventory().GetCargo())
6910 {
6911 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6912 rnd = Math.RandomInt(0,chances);
6913
6914 if (rnd < CHANCE_DAMAGE_CARGO)
6915 {
6917 }
6918 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6919 {
6921 }
6922 }
6923 else
6924 {
6925 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6926 rnd = Math.RandomInt(0,chances);
6927
6928 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6929 {
6931 }
6932 }
6933 }
6934 }
6935
6937 {
6938 if (GetInventory().GetCargo())
6939 {
6940 int item_count = GetInventory().GetCargo().GetItemCount();
6941 if (item_count > 0)
6942 {
6943 int random_pick = Math.RandomInt(0, item_count);
6945 if (!item.IsExplosive())
6946 {
6947 item.AddHealth("","",damage);
6948 return true;
6949 }
6950 }
6951 }
6952 return false;
6953 }
6954
6956 {
6957 int attachment_count = GetInventory().AttachmentCount();
6958 if (attachment_count > 0)
6959 {
6960 int random_pick = Math.RandomInt(0, attachment_count);
6961 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
6962 if (!attachment.IsExplosive())
6963 {
6964 attachment.AddHealth("","",damage);
6965 return true;
6966 }
6967 }
6968 return false;
6969 }
6970
6972 {
6974 }
6975
6977 {
6979 return GetInventory().CanRemoveEntity();
6980
6981 return false;
6982 }
6983
6985 {
6986
6988 return false;
6989
6990
6992 return false;
6993
6994
6995
6997 if (delta == 0)
6998 return false;
6999
7000
7001 return true;
7002 }
7003
7005 {
7007 {
7008 if (ScriptInputUserData.CanStoreInputUserData())
7009 {
7010 ScriptInputUserData ctx = new ScriptInputUserData;
7015 ctx.
Write(destination_entity);
7019 }
7020 }
7021 else if (!
GetGame().IsMultiplayer())
7022 {
7024 }
7025 }
7026
7028 {
7029 float split_quantity_new;
7033 InventoryLocation loc = new InventoryLocation;
7034
7035 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7036 {
7038 split_quantity_new = stack_max;
7039 else
7041
7043 {
7044 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7045 if (new_item)
7046 {
7047 new_item.SetResultOfSplit(true);
7048 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7050 new_item.
SetQuantity(split_quantity_new,
false,
true);
7051 }
7052 }
7053 }
7054 else if (destination_entity && slot_id == -1)
7055 {
7056 if (quantity > stack_max)
7057 split_quantity_new = stack_max;
7058 else
7059 split_quantity_new = quantity;
7060
7062 {
7064 {
7067 }
7068
7069 if (new_item)
7070 {
7071 new_item.SetResultOfSplit(true);
7072 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7074 new_item.
SetQuantity(split_quantity_new,
false,
true);
7075 }
7076 }
7077 }
7078 else
7079 {
7080 if (stack_max != 0)
7081 {
7083 {
7085 }
7086
7087 if (split_quantity_new == 0)
7088 {
7089 if (!
GetGame().IsMultiplayer())
7090 player.PhysicalPredictiveDropItem(this);
7091 else
7092 player.ServerDropEntity(this);
7093 return;
7094 }
7095
7097 {
7099
7100 if (new_item)
7101 {
7102 new_item.SetResultOfSplit(true);
7103 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7106 new_item.PlaceOnSurface();
7107 }
7108 }
7109 }
7110 }
7111 }
7112
7114 {
7115 float split_quantity_new;
7119 InventoryLocation loc = new InventoryLocation;
7120
7121 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7122 {
7124 split_quantity_new = stack_max;
7125 else
7127
7129 {
7130 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7131 if (new_item)
7132 {
7133 new_item.SetResultOfSplit(true);
7134 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7136 new_item.
SetQuantity(split_quantity_new,
false,
true);
7137 }
7138 }
7139 }
7140 else if (destination_entity && slot_id == -1)
7141 {
7142 if (quantity > stack_max)
7143 split_quantity_new = stack_max;
7144 else
7145 split_quantity_new = quantity;
7146
7148 {
7150 {
7153 }
7154
7155 if (new_item)
7156 {
7157 new_item.SetResultOfSplit(true);
7158 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7160 new_item.
SetQuantity(split_quantity_new,
false,
true);
7161 }
7162 }
7163 }
7164 else
7165 {
7166 if (stack_max != 0)
7167 {
7169 {
7171 }
7172
7174 {
7176
7177 if (new_item)
7178 {
7179 new_item.SetResultOfSplit(true);
7180 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7183 new_item.PlaceOnSurface();
7184 }
7185 }
7186 }
7187 }
7188 }
7189
7191 {
7193 {
7194 if (ScriptInputUserData.CanStoreInputUserData())
7195 {
7196 ScriptInputUserData ctx = new ScriptInputUserData;
7201 dst.WriteToContext(ctx);
7203 }
7204 }
7205 else if (!
GetGame().IsMultiplayer())
7206 {
7208 }
7209 }
7210
7212 {
7214 {
7215 if (ScriptInputUserData.CanStoreInputUserData())
7216 {
7217 ScriptInputUserData ctx = new ScriptInputUserData;
7222 ctx.
Write(destination_entity);
7228 }
7229 }
7230 else if (!
GetGame().IsMultiplayer())
7231 {
7233 }
7234 }
7235
7237 {
7239 }
7240
7242 {
7244 float split_quantity_new;
7246 if (dst.IsValid())
7247 {
7248 int slot_id = dst.GetSlot();
7250
7251 if (quantity > stack_max)
7252 split_quantity_new = stack_max;
7253 else
7254 split_quantity_new = quantity;
7255
7257 {
7259
7260 if (new_item)
7261 {
7262 new_item.SetResultOfSplit(true);
7263 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7265 new_item.
SetQuantity(split_quantity_new,
false,
true);
7266 }
7267
7268 return new_item;
7269 }
7270 }
7271
7272 return null;
7273 }
7274
7276 {
7278 float split_quantity_new;
7280 if (destination_entity)
7281 {
7283 if (quantity > stackable)
7284 split_quantity_new = stackable;
7285 else
7286 split_quantity_new = quantity;
7287
7289 {
7290 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7291 if (new_item)
7292 {
7293 new_item.SetResultOfSplit(true);
7294 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7296 new_item.
SetQuantity(split_quantity_new,
false,
true);
7297 }
7298 }
7299 }
7300 }
7301
7303 {
7305 {
7306 if (ScriptInputUserData.CanStoreInputUserData())
7307 {
7308 ScriptInputUserData ctx = new ScriptInputUserData;
7313 ItemBase destination_entity =
this;
7314 ctx.
Write(destination_entity);
7318 }
7319 }
7320 else if (!
GetGame().IsMultiplayer())
7321 {
7323 }
7324 }
7325
7327 {
7329 float split_quantity_new;
7331 if (player)
7332 {
7334 if (quantity > stackable)
7335 split_quantity_new = stackable;
7336 else
7337 split_quantity_new = quantity;
7338
7340 {
7341 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7342 new_item =
ItemBase.Cast(in_hands);
7343 if (new_item)
7344 {
7345 new_item.SetResultOfSplit(true);
7346 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7348 new_item.SetQuantity(split_quantity_new, false, true);
7349 }
7350 }
7351 }
7352 }
7353
7355 {
7357 float split_quantity_new = Math.Floor(quantity * 0.5);
7358
7360 return;
7361
7363
7364 if (new_item)
7365 {
7366 if (new_item.GetQuantityMax() < split_quantity_new)
7367 {
7368 split_quantity_new = new_item.GetQuantityMax();
7369 }
7370
7371 new_item.SetResultOfSplit(true);
7372 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7373
7375 {
7378 }
7379 else
7380 {
7382 new_item.
SetQuantity(split_quantity_new,
false,
true);
7383 }
7384 }
7385 }
7386
7388 {
7390 float split_quantity_new = Math.Floor(quantity / 2);
7391
7393 return;
7394
7395 InventoryLocation invloc = new InventoryLocation;
7397
7399 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7400
7401 if (new_item)
7402 {
7403 if (new_item.GetQuantityMax() < split_quantity_new)
7404 {
7405 split_quantity_new = new_item.GetQuantityMax();
7406 }
7408 {
7411 }
7412 else if (split_quantity_new > 1)
7413 {
7415 new_item.
SetQuantity(split_quantity_new,
false,
true);
7416 }
7417 }
7418 }
7419
7422 {
7423 SetWeightDirty();
7425
7426 if (parent)
7427 parent.OnAttachmentQuantityChangedEx(this, delta);
7428
7430 {
7432 {
7434 }
7436 {
7437 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7439 }
7440 }
7441
7442 }
7443
7446 {
7447
7448 }
7449
7452 {
7454 }
7455
7457 {
7458 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7459
7461 {
7462 if (newLevel == GameConstants.STATE_RUINED)
7463 {
7465 EntityAI parent = GetHierarchyParent();
7466 if (parent && parent.IsFireplace())
7467 {
7468 CargoBase cargo = GetInventory().GetCargo();
7469 if (cargo)
7470 {
7472 {
7474 }
7475 }
7476 }
7477 }
7478
7480 {
7481
7483 return;
7484 }
7485
7486 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7487 {
7489 }
7490 }
7491 }
7492
7493
7495 {
7496 super.OnRightClick();
7497
7499 {
7501 {
7502 if (ScriptInputUserData.CanStoreInputUserData())
7503 {
7504 EntityAI root = GetHierarchyRoot();
7505 Man playerOwner = GetHierarchyRootPlayer();
7506 InventoryLocation dst = new InventoryLocation;
7507
7508
7509 if (!playerOwner && root && root == this)
7510 {
7512 }
7513 else
7514 {
7515
7516 GetInventory().GetCurrentInventoryLocation(dst);
7518 {
7521 {
7523 }
7524 else
7525 {
7527
7528
7529 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7530 {
7532 }
7533 else
7534 {
7535 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7536 }
7537 }
7538 }
7539 }
7540
7541 ScriptInputUserData ctx = new ScriptInputUserData;
7549 }
7550 }
7551 else if (!
GetGame().IsMultiplayer())
7552 {
7554 }
7555 }
7556 }
7557
7559 {
7560 if (root)
7561 {
7562 vector m4[4];
7563 root.GetTransform(m4);
7564 dst.SetGround(this, m4);
7565 }
7566 else
7567 {
7568 GetInventory().GetCurrentInventoryLocation(dst);
7569 }
7570 }
7571
7572 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7573 {
7574
7575 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7576 return false;
7577
7578 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7579 return false;
7580
7581
7583 return false;
7584
7585
7586 Magazine mag = Magazine.Cast(this);
7587 if (mag)
7588 {
7589 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7590 return false;
7591
7592 if (stack_max_limit)
7593 {
7594 Magazine other_mag = Magazine.Cast(other_item);
7595 if (other_item)
7596 {
7597 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7598 return false;
7599 }
7600
7601 }
7602 }
7603 else
7604 {
7605
7607 return false;
7608
7610 return false;
7611 }
7612
7613 PlayerBase player = null;
7614 if (CastTo(player, GetHierarchyRootPlayer()))
7615 {
7616 if (player.GetInventory().HasAttachment(this))
7617 return false;
7618
7619 if (player.IsItemsToDelete())
7620 return false;
7621 }
7622
7623 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7624 return false;
7625
7626 int slotID;
7628 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7629 return false;
7630
7631 return true;
7632 }
7633
7635 {
7637 }
7638
7640 {
7641 return m_IsResultOfSplit;
7642 }
7643
7645 {
7646 m_IsResultOfSplit = value;
7647 }
7648
7650 {
7652 }
7653
7655 {
7656 float other_item_quantity = other_item.GetQuantity();
7657 float this_free_space;
7658
7660
7662
7663 if (other_item_quantity > this_free_space)
7664 {
7665 return this_free_space;
7666 }
7667 else
7668 {
7669 return other_item_quantity;
7670 }
7671 }
7672
7674 {
7676 }
7677
7679 {
7681 return;
7682
7683 if (!IsMagazine() && other_item)
7684 {
7686 if (quantity_used != 0)
7687 {
7688 float hp1 = GetHealth01("","");
7689 float hp2 = other_item.GetHealth01("","");
7690 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7691 hpResult = hpResult / (
GetQuantity() + quantity_used);
7692
7693 hpResult *= GetMaxHealth();
7694 Math.Round(hpResult);
7695 SetHealth("", "Health", hpResult);
7696
7698 other_item.AddQuantity(-quantity_used);
7699 }
7700 }
7702 }
7703
7705 {
7706 #ifdef SERVER
7707 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7708 GetHierarchyParent().IncreaseLifetimeUp();
7709 #endif
7710 };
7711
7713 {
7714 PlayerBase p = PlayerBase.Cast(player);
7715
7716 array<int> recipesIds = p.m_Recipes;
7717 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7718 if (moduleRecipesManager)
7719 {
7720 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7721 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7722 }
7723
7724 for (int i = 0;i < recipesIds.Count(); i++)
7725 {
7726 int key = recipesIds.Get(i);
7727 string recipeName = moduleRecipesManager.GetRecipeName(key);
7729 }
7730 }
7731
7732
7733 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7734 {
7735 super.GetDebugActions(outputList);
7736
7737
7743
7744
7749
7754
7755
7759
7760
7762 {
7766 }
7767
7770
7771
7775
7777
7778 InventoryLocation loc = new InventoryLocation();
7779 GetInventory().GetCurrentInventoryLocation(loc);
7781 {
7782 if (Gizmo_IsSupported())
7785 }
7786
7788 }
7789
7790
7791
7792
7794 {
7795 super.OnAction(action_id, player, ctx);
7796
7798 {
7799 switch (action_id)
7800 {
7803 return true;
7806 return true;
7807 }
7808 }
7809
7811 {
7812 switch (action_id)
7813 {
7815 Delete();
7816 return true;
7817 }
7818 }
7819
7820 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7821 {
7822 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7823 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7824 PlayerBase p = PlayerBase.Cast(player);
7825 if (
EActions.RECIPES_RANGE_START < 1000)
7826 {
7827 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7828 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7829 }
7830 }
7831 #ifndef SERVER
7832 else if (action_id ==
EActions.WATCH_PLAYER)
7833 {
7834 PluginDeveloper.SetDeveloperItemClientEx(player);
7835 }
7836 #endif
7838 {
7839 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7840 {
7841 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7842 OnDebugButtonPressServer(id + 1);
7843 }
7844
7845 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7846 {
7847 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7849 }
7850
7851 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7852 {
7853 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7855 }
7856
7857 else if (action_id ==
EActions.ADD_QUANTITY)
7858 {
7859 if (IsMagazine())
7860 {
7861 Magazine mag = Magazine.Cast(this);
7862 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7863 }
7864 else
7865 {
7867 }
7868
7869 if (m_EM)
7870 {
7871 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7872 }
7873
7874 }
7875
7876 else if (action_id ==
EActions.REMOVE_QUANTITY)
7877 {
7878 if (IsMagazine())
7879 {
7880 Magazine mag2 = Magazine.Cast(this);
7881 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7882 }
7883 else
7884 {
7886 }
7887 if (m_EM)
7888 {
7889 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7890 }
7891
7892 }
7893
7894 else if (action_id ==
EActions.SET_QUANTITY_0)
7895 {
7897
7898 if (m_EM)
7899 {
7900 m_EM.SetEnergy(0);
7901 }
7902 }
7903
7904 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7905 {
7907
7908 if (m_EM)
7909 {
7910 m_EM.SetEnergy(m_EM.GetEnergyMax());
7911 }
7912 }
7913
7914 else if (action_id ==
EActions.ADD_HEALTH)
7915 {
7916 AddHealth("","",GetMaxHealth("","Health")/5);
7917 }
7918 else if (action_id ==
EActions.REMOVE_HEALTH)
7919 {
7920 AddHealth("","",-GetMaxHealth("","Health")/5);
7921 }
7922 else if (action_id ==
EActions.DESTROY_HEALTH)
7923 {
7924 SetHealth01("","",0);
7925 }
7926 else if (action_id ==
EActions.WATCH_ITEM)
7927 {
7929 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7930 #ifdef DEVELOPER
7931 SetDebugDeveloper_item(this);
7932 #endif
7933 }
7934
7935 else if (action_id ==
EActions.ADD_TEMPERATURE)
7936 {
7937 AddTemperature(20);
7938
7939 }
7940
7941 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7942 {
7943 AddTemperature(-20);
7944
7945 }
7946
7947 else if (action_id ==
EActions.FLIP_FROZEN)
7948 {
7949 SetFrozen(!GetIsFrozen());
7950
7951 }
7952
7953 else if (action_id ==
EActions.ADD_WETNESS)
7954 {
7956
7957 }
7958
7959 else if (action_id ==
EActions.REMOVE_WETNESS)
7960 {
7962
7963 }
7964
7965 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7966 {
7969
7970
7971 }
7972
7973 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
7974 {
7977 }
7978
7979 else if (action_id ==
EActions.MAKE_SPECIAL)
7980 {
7981 auto debugParams = DebugSpawnParams.WithPlayer(player);
7982 OnDebugSpawnEx(debugParams);
7983 }
7984
7985 }
7986
7987
7988 return false;
7989 }
7990
7991
7992
7993
7997
8000
8001
8002
8004 {
8005 return false;
8006 }
8007
8008
8010 {
8011 return true;
8012 }
8013
8014
8016 {
8017 return true;
8018 }
8019
8020
8021
8023 {
8024 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8026 }
8027
8030 {
8031 return null;
8032 }
8033
8035 {
8036 return false;
8037 }
8038
8040 {
8041 return false;
8042 }
8043
8047
8048
8050 {
8051 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8052 return module_repairing.CanRepair(this, item_repair_kit);
8053 }
8054
8055
8056 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8057 {
8058 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8059 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8060 }
8061
8062
8064 {
8065
8066
8067
8068
8069
8070
8071
8072
8073 return 1;
8074 }
8075
8076
8077
8079 {
8081 }
8082
8083
8084
8086 {
8088 }
8089
8090
8099 {
8100 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8101
8102 if (player)
8103 {
8104 player.MessageStatus(text);
8105 }
8106 }
8107
8108
8117 {
8118 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8119
8120 if (player)
8121 {
8122 player.MessageAction(text);
8123 }
8124 }
8125
8126
8135 {
8136 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8137
8138 if (player)
8139 {
8140 player.MessageFriendly(text);
8141 }
8142 }
8143
8144
8153 {
8154 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8155
8156 if (player)
8157 {
8158 player.MessageImportant(text);
8159 }
8160 }
8161
8163 {
8164 return true;
8165 }
8166
8167
8168 override bool KindOf(
string tag)
8169 {
8170 bool found = false;
8171 string item_name = this.
GetType();
8174
8175 int array_size = item_tag_array.Count();
8176 for (int i = 0; i < array_size; i++)
8177 {
8178 if (item_tag_array.Get(i) == tag)
8179 {
8180 found = true;
8181 break;
8182 }
8183 }
8184 return found;
8185 }
8186
8187
8189 {
8190
8191 super.OnRPC(sender, rpc_type,ctx);
8192
8193
8194 switch (rpc_type)
8195 {
8196 #ifndef SERVER
8197 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8198 Param2<bool, string> p = new Param2<bool, string>(false, "");
8199
8201 return;
8202
8203 bool play = p.param1;
8204 string soundSet = p.param2;
8205
8206 if (play)
8207 {
8209 {
8211 {
8213 }
8214 }
8215 else
8216 {
8218 }
8219 }
8220 else
8221 {
8223 }
8224
8225 break;
8226 #endif
8227
8228 }
8229
8231 {
8233 }
8234 }
8235
8236
8237
8238
8240 {
8241 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8242 return plugin.GetID(
name);
8243 }
8244
8246 {
8247 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8248 return plugin.GetName(id);
8249 }
8250
8253 {
8254
8255
8256 int varFlags;
8257 if (!ctx.
Read(varFlags))
8258 return;
8259
8260 if (varFlags & ItemVariableFlags.FLOAT)
8261 {
8263 }
8264 }
8265
8267 {
8268
8269 super.SerializeNumericalVars(floats_out);
8270
8271
8272
8274 {
8276 }
8277
8279 {
8281 }
8282
8284 {
8286 }
8287
8289 {
8294 }
8295
8297 {
8299 }
8300 }
8301
8303 {
8304
8305 super.DeSerializeNumericalVars(floats);
8306
8307
8308 int index = 0;
8309 int mask = Math.Round(floats.Get(index));
8310
8311 index++;
8312
8314 {
8316 {
8318 }
8319 else
8320 {
8321 float quantity = floats.Get(index);
8323 }
8324 index++;
8325 }
8326
8328 {
8329 float wet = floats.Get(index);
8331 index++;
8332 }
8333
8335 {
8336 int liquidtype = Math.Round(floats.Get(index));
8338 index++;
8339 }
8340
8342 {
8344 index++;
8346 index++;
8348 index++;
8350 index++;
8351 }
8352
8354 {
8355 int cleanness = Math.Round(floats.Get(index));
8357 index++;
8358 }
8359 }
8360
8362 {
8363 super.WriteVarsToCTX(ctx);
8364
8365
8367 {
8369 }
8370
8372 {
8374 }
8375
8377 {
8379 }
8380
8382 {
8383 int r,g,b,a;
8389 }
8390
8392 {
8394 }
8395 }
8396
8398 {
8399 if (!super.ReadVarsFromCTX(ctx,version))
8400 return false;
8401
8402 int intValue;
8403 float value;
8404
8405 if (version < 140)
8406 {
8407 if (!ctx.
Read(intValue))
8408 return false;
8409
8410 m_VariablesMask = intValue;
8411 }
8412
8414 {
8415 if (!ctx.
Read(value))
8416 return false;
8417
8419 {
8421 }
8422 else
8423 {
8425 }
8426 }
8427
8428 if (version < 140)
8429 {
8431 {
8432 if (!ctx.
Read(value))
8433 return false;
8434 SetTemperatureDirect(value);
8435 }
8436 }
8437
8439 {
8440 if (!ctx.
Read(value))
8441 return false;
8443 }
8444
8446 {
8447 if (!ctx.
Read(intValue))
8448 return false;
8450 }
8451
8453 {
8454 int r,g,b,a;
8456 return false;
8458 return false;
8460 return false;
8462 return false;
8463
8465 }
8466
8468 {
8469 if (!ctx.
Read(intValue))
8470 return false;
8472 }
8473
8474 if (version >= 138 && version < 140)
8475 {
8477 {
8478 if (!ctx.
Read(intValue))
8479 return false;
8480 SetFrozen(intValue);
8481 }
8482 }
8483
8484 return true;
8485 }
8486
8487
8489 {
8492 {
8494 }
8495
8496 if (!super.OnStoreLoad(ctx, version))
8497 {
8499 return false;
8500 }
8501
8502 if (version >= 114)
8503 {
8504 bool hasQuickBarIndexSaved;
8505
8506 if (!ctx.
Read(hasQuickBarIndexSaved))
8507 {
8509 return false;
8510 }
8511
8512 if (hasQuickBarIndexSaved)
8513 {
8514 int itmQBIndex;
8515
8516
8517 if (!ctx.
Read(itmQBIndex))
8518 {
8520 return false;
8521 }
8522
8523 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8524 if (itmQBIndex != -1 && parentPlayer)
8525 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8526 }
8527 }
8528 else
8529 {
8530
8531 PlayerBase player;
8532 int itemQBIndex;
8533 if (version ==
int.
MAX)
8534 {
8535 if (!ctx.
Read(itemQBIndex))
8536 {
8538 return false;
8539 }
8540 }
8541 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8542 {
8543
8544 if (!ctx.
Read(itemQBIndex))
8545 {
8547 return false;
8548 }
8549 if (itemQBIndex != -1 && player)
8550 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8551 }
8552 }
8553
8554 if (version < 140)
8555 {
8556
8557 if (!LoadVariables(ctx, version))
8558 {
8560 return false;
8561 }
8562 }
8563
8564
8566 {
8568 return false;
8569 }
8570 if (version >= 132)
8571 {
8573 if (raib)
8574 {
8576 {
8578 return false;
8579 }
8580 }
8581 }
8582
8584 return true;
8585 }
8586
8587
8588
8590 {
8591 super.OnStoreSave(ctx);
8592
8593 PlayerBase player;
8594 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8595 {
8597
8598 int itemQBIndex = -1;
8599 itemQBIndex = player.FindQuickBarEntityIndex(this);
8600 ctx.
Write(itemQBIndex);
8601 }
8602 else
8603 {
8605 }
8606
8608
8610 if (raib)
8611 {
8613 }
8614 }
8615
8616
8618 {
8619 super.AfterStoreLoad();
8620
8622 {
8624 }
8625
8627 {
8630 }
8631 }
8632
8634 {
8635 super.EEOnAfterLoad();
8636
8638 {
8640 }
8641
8644 }
8645
8647 {
8648 return false;
8649 }
8650
8651
8652
8654 {
8656 {
8657 #ifdef PLATFORM_CONSOLE
8658
8660 {
8662 if (menu)
8663 {
8665 }
8666 }
8667 #endif
8668 }
8669
8671 {
8674 }
8675
8677 {
8678 SetWeightDirty();
8680 }
8682 {
8685 }
8686
8688 {
8691 }
8693 {
8696 }
8697
8698 super.OnVariablesSynchronized();
8699 }
8700
8701
8702
8704 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8705 {
8706 if (!IsServerCheck(allow_client))
8707 return false;
8708
8710 return false;
8711
8714
8715 if (value <= (min + 0.001))
8716 value = min;
8717
8718 if (value == min)
8719 {
8720 if (destroy_config)
8721 {
8722 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8723 if (dstr)
8724 {
8726 this.Delete();
8727 return true;
8728 }
8729 }
8730 else if (destroy_forced)
8731 {
8733 this.Delete();
8734 return true;
8735 }
8736
8738 }
8739
8742
8744 {
8746
8747 if (delta)
8749 }
8750
8752
8753 return false;
8754 }
8755
8756
8758 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8759 {
8761 }
8762
8764 {
8767 }
8768
8770 {
8773 }
8774
8776 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8777 {
8778 float value_clamped = Math.Clamp(value, 0, 1);
8780 SetQuantity(result, destroy_config, destroy_forced);
8781 }
8782
8783
8786 {
8788 }
8789
8791 {
8793 }
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8805 {
8806 int slot = -1;
8807 if (GetInventory())
8808 {
8809 InventoryLocation il = new InventoryLocation;
8810 GetInventory().GetCurrentInventoryLocation(il);
8812 }
8813
8815 }
8816
8818 {
8819 float quantity_max = 0;
8820
8822 {
8823 if (attSlotID != -1)
8824 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8825
8826 if (quantity_max <= 0)
8828 }
8829
8830 if (quantity_max <= 0)
8832
8833 return quantity_max;
8834 }
8835
8837 {
8839 }
8840
8842 {
8844 }
8845
8846
8848 {
8850 }
8851
8853 {
8855 }
8856
8858 {
8860 }
8861
8862
8864 {
8865
8866 float weightEx = GetWeightEx();
8867 float special = GetInventoryAndCargoWeight();
8868 return weightEx - special;
8869 }
8870
8871
8873 {
8875 }
8876
8878 {
8880 {
8881 #ifdef DEVELOPER
8882 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8883 {
8884 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8886 }
8887 #endif
8888
8890 }
8891 else if (HasEnergyManager())
8892 {
8893 #ifdef DEVELOPER
8894 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8895 {
8896 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8897 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8898 }
8899 #endif
8900 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
8901 }
8902 else
8903 {
8904 #ifdef DEVELOPER
8905 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8906 {
8907 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8908 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8909 }
8910 #endif
8911 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
8912 }
8913 }
8914
8917 {
8918 int item_count = 0;
8920
8921 if (GetInventory().GetCargo() != NULL)
8922 {
8923 item_count = GetInventory().GetCargo().GetItemCount();
8924 }
8925
8926 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8927 {
8928 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8929 if (item)
8930 item_count += item.GetNumberOfItems();
8931 }
8932 return item_count;
8933 }
8934
8937 {
8938 float weight = 0;
8939 float wetness = 1;
8940 if (include_wetness)
8943 {
8944 weight = wetness * m_ConfigWeight;
8945 }
8947 {
8948 weight = 1;
8949 }
8950 return weight;
8951 }
8952
8953
8954
8956 {
8957 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8958 {
8959 GameInventory inv = GetInventory();
8960 array<EntityAI> items = new array<EntityAI>;
8962 for (int i = 0; i < items.Count(); i++)
8963 {
8965 if (item)
8966 {
8968 }
8969 }
8970 }
8971 }
8972
8973
8974
8975
8977 {
8978 float energy = 0;
8979 if (HasEnergyManager())
8980 {
8981 energy = GetCompEM().GetEnergy();
8982 }
8983 return energy;
8984 }
8985
8986
8988 {
8989 super.OnEnergyConsumed();
8990
8992 }
8993
8995 {
8996 super.OnEnergyAdded();
8997
8999 }
9000
9001
9003 {
9004 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9005 {
9007 {
9008 float energy_0to1 = GetCompEM().GetEnergy0To1();
9010 }
9011 }
9012 }
9013
9014
9016 {
9017 return ConfigGetFloat("heatIsolation");
9018 }
9019
9021 {
9023 }
9024
9026 {
9027 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9028 if (
GetGame().ConfigIsExisting(paramPath))
9030
9031 return 0.0;
9032 }
9033
9035 {
9036 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9037 if (
GetGame().ConfigIsExisting(paramPath))
9039
9040 return 0.0;
9041 }
9042
9043 override void SetWet(
float value,
bool allow_client =
false)
9044 {
9045 if (!IsServerCheck(allow_client))
9046 return;
9047
9050
9052
9053 m_VarWet = Math.Clamp(value, min, max);
9054
9056 {
9059 }
9060 }
9061
9062 override void AddWet(
float value)
9063 {
9065 }
9066
9068 {
9070 }
9071
9073 {
9075 }
9076
9078 {
9080 }
9081
9083 {
9085 }
9086
9088 {
9090 }
9091
9093 {
9096 if (newLevel != oldLevel)
9097 {
9099 }
9100 }
9101
9103 {
9104 SetWeightDirty();
9105 }
9106
9108 {
9109 return GetWetLevelInternal(
m_VarWet);
9110 }
9111
9112
9113
9115 {
9117 }
9118
9120 {
9122 }
9123
9125 {
9127 }
9128
9130 {
9132 }
9133
9134
9135
9137 {
9138 if (ConfigIsExisting("itemModelLength"))
9139 {
9140 return ConfigGetFloat("itemModelLength");
9141 }
9142 return 0;
9143 }
9144
9146 {
9147 if (ConfigIsExisting("itemAttachOffset"))
9148 {
9149 return ConfigGetFloat("itemAttachOffset");
9150 }
9151 return 0;
9152 }
9153
9154 override void SetCleanness(
int value,
bool allow_client =
false)
9155 {
9156 if (!IsServerCheck(allow_client))
9157 return;
9158
9160
9162
9165 }
9166
9168 {
9170 }
9171
9173 {
9174 return true;
9175 }
9176
9177
9178
9179
9181 {
9183 }
9184
9186 {
9188 }
9189
9190
9191
9192
9193 override void SetColor(
int r,
int g,
int b,
int a)
9194 {
9200 }
9202 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9203 {
9208 }
9209
9211 {
9213 }
9214
9217 {
9218 int r,g,b,a;
9220 r = r/255;
9221 g = g/255;
9222 b = b/255;
9223 a = a/255;
9224 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9225 }
9226
9227
9228
9229 override void SetLiquidType(
int value,
bool allow_client =
false)
9230 {
9231 if (!IsServerCheck(allow_client))
9232 return;
9233
9238 }
9239
9241 {
9242 return ConfigGetInt("varLiquidTypeInit");
9243 }
9244
9246 {
9248 }
9249
9251 {
9253 SetFrozen(false);
9254 }
9255
9258 {
9259 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9260 }
9261
9262
9265 {
9266 PlayerBase nplayer;
9267 if (PlayerBase.CastTo(nplayer, player))
9268 {
9270
9271 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9272 }
9273 }
9274
9275
9278 {
9279 PlayerBase nplayer;
9280 if (PlayerBase.CastTo(nplayer,player))
9281 {
9282
9283 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9284
9285 }
9286
9287
9288 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9289
9290
9291 if (HasEnergyManager())
9292 {
9293 GetCompEM().UpdatePlugState();
9294 }
9295 }
9296
9297
9299 {
9300 super.OnPlacementStarted(player);
9301
9303 }
9304
9305 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9306 {
9308 {
9309 m_AdminLog.OnPlacementComplete(player,
this);
9310 }
9311
9312 super.OnPlacementComplete(player, position, orientation);
9313 }
9314
9315
9316
9317
9318
9320 {
9322 {
9323 return true;
9324 }
9325 else
9326 {
9327 return false;
9328 }
9329 }
9330
9331
9333 {
9335 {
9337 }
9338 }
9339
9340
9342 {
9344 }
9345
9347 {
9349 }
9350
9351 override void InsertAgent(
int agent,
float count = 1)
9352 {
9353 if (count < 1)
9354 return;
9355
9357 }
9358
9361 {
9363 }
9364
9365
9367 {
9369 }
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9413 {
9415 return false;
9416 return true;
9417 }
9418
9420 {
9421
9423 }
9424
9425
9428 {
9429 super.CheckForRoofLimited(timeTresholdMS);
9430
9432 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9433 {
9434 m_PreviousRoofTestTime = time;
9435 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9436 }
9437 }
9438
9439
9441 {
9443 {
9444 return 0;
9445 }
9446
9447 if (GetInventory().GetAttachmentSlotsCount() != 0)
9448 {
9449 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9450 if (filter)
9451 return filter.GetProtectionLevel(type, false, system);
9452 else
9453 return 0;
9454 }
9455
9456 string subclassPath, entryName;
9457
9458 switch (type)
9459 {
9461 entryName = "biological";
9462 break;
9464 entryName = "chemical";
9465 break;
9466 default:
9467 entryName = "biological";
9468 break;
9469 }
9470
9471 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9472
9474 }
9475
9476
9477
9480 {
9481 if (!IsMagazine())
9483
9485 }
9486
9487
9488
9489
9490
9495 {
9496 return true;
9497 }
9498
9500 {
9502 }
9503
9504
9505
9506
9507
9509 {
9510 if (parent)
9511 {
9512 if (parent.IsInherited(DayZInfected))
9513 return true;
9514
9515 if (!parent.IsRuined())
9516 return true;
9517 }
9518
9519 return true;
9520 }
9521
9523 {
9524 if (!super.CanPutAsAttachment(parent))
9525 {
9526 return false;
9527 }
9528
9529 if (!IsRuined() && !parent.IsRuined())
9530 {
9531 return true;
9532 }
9533
9534 return false;
9535 }
9536
9538 {
9539
9540
9541
9542
9543 return super.CanReceiveItemIntoCargo(item);
9544 }
9545
9547 {
9548
9549
9550
9551
9552 GameInventory attachmentInv = attachment.GetInventory();
9554 {
9555 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9556 return false;
9557 }
9558
9559 InventoryLocation loc = new InventoryLocation();
9560 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9561 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9562 return false;
9563
9564 return super.CanReceiveAttachment(attachment, slotId);
9565 }
9566
9568 {
9569 if (!super.CanReleaseAttachment(attachment))
9570 return false;
9571
9572 return GetInventory().AreChildrenAccessible();
9573 }
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9596 {
9597 int id = muzzle_owner.GetMuzzleID();
9598 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9599
9600 if (WPOF_array)
9601 {
9602 for (int i = 0; i < WPOF_array.Count(); i++)
9603 {
9604 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9605
9606 if (WPOF)
9607 {
9608 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9609 }
9610 }
9611 }
9612 }
9613
9614
9616 {
9617 int id = muzzle_owner.GetMuzzleID();
9619
9620 if (WPOBE_array)
9621 {
9622 for (int i = 0; i < WPOBE_array.Count(); i++)
9623 {
9624 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9625
9626 if (WPOBE)
9627 {
9628 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9629 }
9630 }
9631 }
9632 }
9633
9634
9636 {
9637 int id = muzzle_owner.GetMuzzleID();
9638 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9639
9640 if (WPOOH_array)
9641 {
9642 for (int i = 0; i < WPOOH_array.Count(); i++)
9643 {
9644 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9645
9646 if (WPOOH)
9647 {
9648 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9649 }
9650 }
9651 }
9652 }
9653
9654
9656 {
9657 int id = muzzle_owner.GetMuzzleID();
9658 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9659
9660 if (WPOOH_array)
9661 {
9662 for (int i = 0; i < WPOOH_array.Count(); i++)
9663 {
9664 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9665
9666 if (WPOOH)
9667 {
9668 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9669 }
9670 }
9671 }
9672 }
9673
9674
9676 {
9677 int id = muzzle_owner.GetMuzzleID();
9678 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9679
9680 if (WPOOH_array)
9681 {
9682 for (int i = 0; i < WPOOH_array.Count(); i++)
9683 {
9684 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9685
9686 if (WPOOH)
9687 {
9688 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9689 }
9690 }
9691 }
9692 }
9693
9694
9695
9697 {
9699 {
9700 return true;
9701 }
9702
9703 return false;
9704 }
9705
9707 {
9709 {
9710 return true;
9711 }
9712
9713 return false;
9714 }
9715
9717 {
9719 {
9720 return true;
9721 }
9722
9723 return false;
9724 }
9725
9727 {
9728 return false;
9729 }
9730
9733 {
9734 return UATimeSpent.DEFAULT_DEPLOY;
9735 }
9736
9737
9738
9739
9741 {
9743 SetSynchDirty();
9744 }
9745
9747 {
9749 }
9750
9751
9753 {
9754 return false;
9755 }
9756
9759 {
9760 string att_type = "None";
9761
9762 if (ConfigIsExisting("soundAttType"))
9763 {
9764 att_type = ConfigGetString("soundAttType");
9765 }
9766
9768 }
9769
9771 {
9773 }
9774
9775
9776
9777
9778
9784
9786 {
9789
9791 }
9792
9793
9795 {
9797 return;
9798
9800
9803
9806
9807 SoundParameters params = new SoundParameters();
9811 }
9812
9813
9815 {
9817 return;
9818
9820 SetSynchDirty();
9821
9824 }
9825
9826
9828 {
9830 return;
9831
9833 SetSynchDirty();
9834
9837 }
9838
9840 {
9842 }
9843
9845 {
9847 }
9848
9851 {
9852 if (!
GetGame().IsDedicatedServer())
9853 {
9854 if (ConfigIsExisting("attachSoundSet"))
9855 {
9856 string cfg_path = "";
9857 string soundset = "";
9859
9862 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9863 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9864
9865 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9866 {
9867 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9868 {
9869 if (cfg_slot_array[i] == slot_type)
9870 {
9871 soundset = cfg_soundset_array[i];
9872 break;
9873 }
9874 }
9875 }
9876
9877 if (soundset != "")
9878 {
9879 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9881 }
9882 }
9883 }
9884 }
9885
9887 {
9888
9889 }
9890
9891 void OnApply(PlayerBase player);
9892
9894 {
9895 return 1.0;
9896 };
9897
9899 {
9901 }
9902
9904 {
9906 }
9907
9909
9911 {
9912 SetDynamicPhysicsLifeTime(0.01);
9914 }
9915
9917 {
9918 array<string> zone_names = new array<string>;
9919 GetDamageZones(zone_names);
9920 for (int i = 0; i < zone_names.Count(); i++)
9921 {
9922 SetHealthMax(zone_names.Get(i),"Health");
9923 }
9924 SetHealthMax("","Health");
9925 }
9926
9929 {
9930 float global_health = GetHealth01("","Health");
9931 array<string> zones = new array<string>;
9932 GetDamageZones(zones);
9933
9934 for (int i = 0; i < zones.Count(); i++)
9935 {
9936 SetHealth01(zones.Get(i),"Health",global_health);
9937 }
9938 }
9939
9942 {
9943 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9944 }
9945
9947 {
9948 if (!hasRootAsPlayer)
9949 {
9950 if (refParentIB)
9951 {
9952
9953 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9954 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9955
9956 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9957 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9958
9961 }
9962 else
9963 {
9964
9967 }
9968 }
9969 }
9970
9972 {
9974 {
9975 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
9976 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
9977 {
9978 float heatPermCoef = 1.0;
9980 while (ent)
9981 {
9982 heatPermCoef *= ent.GetHeatPermeabilityCoef();
9983 ent = ent.GetHierarchyParent();
9984 }
9985
9986 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
9987 }
9988 }
9989 }
9990
9992 {
9993
9994 EntityAI parent = GetHierarchyParent();
9995 if (!parent)
9996 {
9997 hasParent = false;
9998 hasRootAsPlayer = false;
9999 }
10000 else
10001 {
10002 hasParent = true;
10003 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10004 refParentIB =
ItemBase.Cast(parent);
10005 }
10006 }
10007
10008 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10009 {
10010
10011 }
10012
10014 {
10015
10016 return false;
10017 }
10018
10020 {
10021
10022
10023 return false;
10024 }
10025
10027 {
10028
10029 return false;
10030 }
10031
10034 {
10035 return !GetIsFrozen() &&
IsOpen();
10036 }
10037
10039 {
10040 bool hasParent = false, hasRootAsPlayer = false;
10042
10043 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10044 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10045
10046 if (wwtu || foodDecay)
10047 {
10051
10052 if (processWetness || processTemperature || processDecay)
10053 {
10055
10056 if (processWetness)
10057 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10058
10059 if (processTemperature)
10061
10062 if (processDecay)
10063 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10064 }
10065 }
10066 }
10067
10070 {
10072 }
10073
10075 {
10078
10079 return super.GetTemperatureFreezeThreshold();
10080 }
10081
10083 {
10086
10087 return super.GetTemperatureThawThreshold();
10088 }
10089
10091 {
10094
10095 return super.GetItemOverheatThreshold();
10096 }
10097
10099 {
10101 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10102
10103 return super.GetTemperatureFreezeTime();
10104 }
10105
10107 {
10109 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10110
10111 return super.GetTemperatureThawTime();
10112 }
10113
10118
10120 {
10121 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10122 }
10123
10125 {
10126 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10127 }
10128
10131 {
10133 }
10134
10136 {
10138 }
10139
10141 {
10143 }
10144
10147 {
10148 return null;
10149 }
10150
10153 {
10154 return false;
10155 }
10156
10158 {
10160 {
10163 if (!trg)
10164 {
10166 explosive = this;
10167 }
10168
10169 explosive.PairRemote(trg);
10171
10172 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10173 trg.SetPersistentPairID(persistentID);
10174 explosive.SetPersistentPairID(persistentID);
10175
10176 return true;
10177 }
10178 return false;
10179 }
10180
10183 {
10184 float ret = 1.0;
10187 ret *= GetHealth01();
10188
10189 return ret;
10190 }
10191
10192 #ifdef DEVELOPER
10193 override void SetDebugItem()
10194 {
10195 super.SetDebugItem();
10196 _itemBase = this;
10197 }
10198
10200 {
10201 string text = super.GetDebugText();
10202
10204 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10205
10206 return text;
10207 }
10208 #endif
10209
10211 {
10212 return true;
10213 }
10214
10216
10218
10220 {
10223 }
10224
10225
10233
10249}
10250
10252{
10254 if (entity)
10255 {
10256 bool is_item = entity.IsInherited(
ItemBase);
10257 if (is_item && full_quantity)
10258 {
10261 }
10262 }
10263 else
10264 {
10266 return NULL;
10267 }
10268 return entity;
10269}
10270
10272{
10273 if (item)
10274 {
10275 if (health > 0)
10276 item.SetHealth("", "", health);
10277
10278 if (item.CanHaveTemperature())
10279 {
10281 if (item.CanFreeze())
10282 item.SetFrozen(false);
10283 }
10284
10285 if (item.HasEnergyManager())
10286 {
10287 if (quantity >= 0)
10288 {
10289 item.GetCompEM().SetEnergy0To1(quantity);
10290 }
10291 else
10292 {
10294 }
10295 }
10296 else if (item.IsMagazine())
10297 {
10298 Magazine mag = Magazine.Cast(item);
10299 if (quantity >= 0)
10300 {
10301 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10302 }
10303 else
10304 {
10306 }
10307
10308 }
10309 else
10310 {
10311 if (quantity >= 0)
10312 {
10313 item.SetQuantityNormalized(quantity, false);
10314 }
10315 else
10316 {
10318 }
10319
10320 }
10321 }
10322}
10323
10324#ifdef DEVELOPER
10326#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.