5533{
5535 {
5536 return true;
5537 }
5538};
5539
5540
5541
5543{
5547
5549
5552
5553
5554
5555
5556
5565
5571
5576
5581
5602 protected bool m_IsResultOfSplit
5603
5605
5610
5611
5612
5614
5618
5619
5620
5622
5625
5626
5627
5633
5634
5642
5645
5646
5648
5649
5651
5652
5657
5658
5663
5664
5666
5667
5669 {
5674
5675 if (!
GetGame().IsDedicatedServer())
5676 {
5678 {
5680
5682 {
5684 }
5685 }
5686
5689 }
5690
5691 m_OldLocation = null;
5692
5694 {
5696 }
5697
5698 if (ConfigIsExisting("headSelectionsToHide"))
5699 {
5702 }
5703
5705 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5706 {
5708 }
5709
5711
5712 m_IsResultOfSplit = false;
5713
5715 }
5716
5718 {
5719 super.InitItemVariables();
5720
5726 m_Count = ConfigGetInt(
"count");
5727
5730
5735
5738
5743
5755
5759
5760
5763 if (ConfigIsExisting("canBeSplit"))
5764 {
5767 }
5768
5770 if (ConfigIsExisting("itemBehaviour"))
5772
5773
5776 RegisterNetSyncVariableInt("m_VarLiquidType");
5777 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5778
5779 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5780 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5781 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5782
5783 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5784 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5785 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5786 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5787
5788 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5789 RegisterNetSyncVariableBool("m_IsTakeable");
5790 RegisterNetSyncVariableBool("m_IsHologram");
5791
5794 {
5797 }
5798
5800
5802 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5804
5805 }
5806
5808 {
5810 }
5811
5813 {
5816 {
5821 }
5822 }
5823
5824 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5825 {
5827 {
5830 }
5831
5833 }
5834
5836 {
5842 }
5843
5845
5847 {
5849
5850 if (!action)
5851 {
5852 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5853 return;
5854 }
5855
5857 if (!ai)
5858 {
5860 return;
5861 }
5862
5864 if (!action_array)
5865 {
5866 action_array = new array<ActionBase_Basic>;
5868 }
5869 if (LogManager.IsActionLogEnable())
5870 {
5871 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5872 }
5873
5874 if (action_array.Find(action) != -1)
5875 {
5876 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5877 }
5878 else
5879 {
5880 action_array.Insert(action);
5881 }
5882 }
5883
5885 {
5887 ActionBase action = player.GetActionManager().GetAction(actionName);
5890
5891 if (action_array)
5892 {
5893 action_array.RemoveItem(action);
5894 }
5895 }
5896
5897
5898
5900 {
5901 ActionOverrideData overrideData = new ActionOverrideData();
5905
5907 if (!actionMap)
5908 {
5911 }
5912
5913 actionMap.Insert(this.
Type(), overrideData);
5914
5915 }
5916
5918
5920
5921
5923 {
5926
5929
5930 string config_to_search = "CfgVehicles";
5931 string muzzle_owner_config;
5932
5934 {
5935 if (IsInherited(Weapon))
5936 config_to_search = "CfgWeapons";
5937
5938 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5939
5940 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5941
5943
5944 if (config_OnFire_subclass_count > 0)
5945 {
5946 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5947
5948 for (int i = 0; i < config_OnFire_subclass_count; i++)
5949 {
5950 string particle_class = "";
5952 string config_OnFire_entry = config_OnFire_class + particle_class;
5953 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5954 WPOF_array.Insert(WPOF);
5955 }
5956
5957
5959 }
5960 }
5961
5963 {
5964 config_to_search = "CfgWeapons";
5965 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5966
5967 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5968
5970
5971 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5972 {
5973 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5974
5975 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5976 {
5977 string particle_class2 = "";
5979 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5980 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5981 WPOBE_array.Insert(WPOBE);
5982 }
5983
5984
5986 }
5987 }
5988 }
5989
5990
5992 {
5995
5997 {
5998 string config_to_search = "CfgVehicles";
5999
6000 if (IsInherited(Weapon))
6001 config_to_search = "CfgWeapons";
6002
6003 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6004 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6005
6006 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6007 {
6008
6010
6012 {
6014 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6016 return;
6017 }
6018
6021
6022
6023
6025 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6026
6027 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6028 {
6029 string particle_class = "";
6031 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6033
6034 if (entry_type == CT_CLASS)
6035 {
6036 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6037 WPOOH_array.Insert(WPOF);
6038 }
6039 }
6040
6041
6043 }
6044 }
6045 }
6046
6048 {
6050 }
6051
6053 {
6055 {
6057
6060
6063
6064 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6065 }
6066 }
6067
6069 {
6071 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6072
6074 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6075
6077 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6078
6080 {
6082 }
6083 }
6084
6086 {
6088 }
6089
6091 {
6094 else
6096
6098 {
6101 }
6102 else
6103 {
6106
6109 }
6110
6112 }
6113
6115 {
6117 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6118 }
6119
6121 {
6123 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6125 }
6126
6128 {
6130 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6131 }
6132
6134 {
6137
6138 OverheatingParticle OP = new OverheatingParticle();
6143
6145 }
6146
6148 {
6151
6152 return -1;
6153 }
6154
6156 {
6158 {
6161
6162 for (int i = count; i > 0; --i)
6163 {
6164 int id = i - 1;
6167
6170
6171 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6172 {
6173 if (p)
6174 {
6177 }
6178 }
6179 }
6180 }
6181 }
6182
6184 {
6186 {
6188 {
6189 int id = i - 1;
6191
6192 if (OP)
6193 {
6195
6196 if (p)
6197 {
6199 }
6200
6201 delete OP;
6202 }
6203 }
6204
6207 }
6208 }
6209
6212 {
6213 return 0.0;
6214 }
6215
6216
6218 {
6219 return 250;
6220 }
6221
6223 {
6224 return 0;
6225 }
6226
6229 {
6231 return true;
6232
6233 return false;
6234 }
6235
6238 {
6241
6243 {
6245 }
6246 else
6247 {
6248
6250 }
6251
6253 }
6254
6261 {
6262 return -1;
6263 }
6264
6265
6266
6267
6269 {
6271 {
6273 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6274
6275 if (r_index >= 0)
6276 {
6277 InventoryLocation r_il = new InventoryLocation;
6278 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6279
6280 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6283 {
6284 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6285 }
6287 {
6288 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6289 }
6290
6291 }
6292
6293 player.GetHumanInventory().ClearUserReservedLocation(this);
6294 }
6295
6298 }
6299
6300
6301
6302
6304 {
6305 return ItemBase.m_DebugActionsMask;
6306 }
6307
6309 {
6310 return ItemBase.m_DebugActionsMask & mask;
6311 }
6312
6314 {
6315 ItemBase.m_DebugActionsMask = mask;
6316 }
6317
6319 {
6320 ItemBase.m_DebugActionsMask |= mask;
6321 }
6322
6324 {
6325 ItemBase.m_DebugActionsMask &= ~mask;
6326 }
6327
6329 {
6331 {
6333 }
6334 else
6335 {
6337 }
6338 }
6339
6340
6342 {
6343 if (GetEconomyProfile())
6344 {
6345 float q_max = GetEconomyProfile().GetQuantityMax();
6346 if (q_max > 0)
6347 {
6348 float q_min = GetEconomyProfile().GetQuantityMin();
6349 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6350
6352 {
6353 ComponentEnergyManager comp = GetCompEM();
6355 {
6357 }
6358 }
6360 {
6362
6363 }
6364
6365 }
6366 }
6367 }
6368
6371 {
6372 EntityAI parent = GetHierarchyParent();
6373
6374 if (parent)
6375 {
6376 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6377 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6378 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6379 }
6380 }
6381
6384 {
6385 EntityAI parent = GetHierarchyParent();
6386
6387 if (parent)
6388 {
6389 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6390 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6391 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6392 }
6393 }
6394
6396 {
6397
6398
6399
6400
6402
6404 {
6405 if (ScriptInputUserData.CanStoreInputUserData())
6406 {
6407 ScriptInputUserData ctx = new ScriptInputUserData;
6413 ctx.
Write(use_stack_max);
6416
6418 {
6419 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6420 }
6421 }
6422 }
6423 else if (!
GetGame().IsMultiplayer())
6424 {
6426 }
6427 }
6428
6430 {
6432 }
6433
6435 {
6437 }
6438
6440 {
6442 }
6443
6445 {
6446
6447 return false;
6448 }
6449
6451 {
6452 return false;
6453 }
6454
6458 {
6459 return false;
6460 }
6461
6463 {
6464 return "";
6465 }
6466
6468
6470 {
6471 return false;
6472 }
6473
6475 {
6476 return true;
6477 }
6478
6479
6480
6482 {
6483 return true;
6484 }
6485
6487 {
6488 return true;
6489 }
6490
6492 {
6493 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6495 }
6496
6498 {
6500 }
6501
6503 {
6505 if (!is_being_placed)
6507 SetSynchDirty();
6508 }
6509
6510
6512
6514 {
6516 }
6517
6519 {
6521 }
6522
6524 {
6525 return 1;
6526 }
6527
6529 {
6530 return false;
6531 }
6532
6534 {
6536 SetSynchDirty();
6537 }
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6574 {
6575 super.OnMovedInsideCargo(container);
6576
6577 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6578 }
6579
6580 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6581 {
6582 super.EEItemLocationChanged(oldLoc,newLoc);
6583
6584 PlayerBase new_player = null;
6585 PlayerBase old_player = null;
6586
6587 if (newLoc.GetParent())
6588 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6589
6590 if (oldLoc.GetParent())
6591 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6592
6594 {
6595 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6596
6597 if (r_index >= 0)
6598 {
6599 InventoryLocation r_il = new InventoryLocation;
6600 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6601
6602 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6605 {
6606 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6607 }
6609 {
6610 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6611 }
6612
6613 }
6614 }
6615
6617 {
6618 if (new_player)
6619 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6620
6621 if (new_player == old_player)
6622 {
6623
6624 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6625 {
6627 {
6628 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6629 {
6630 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6631 }
6632 }
6633 else
6634 {
6635 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6636 }
6637 }
6638
6639 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6640 {
6641 int type = oldLoc.GetType();
6643 {
6644 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6645 }
6647 {
6648 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6649 }
6650 }
6651 if (!m_OldLocation)
6652 {
6653 m_OldLocation = new InventoryLocation;
6654 }
6655 m_OldLocation.Copy(oldLoc);
6656 }
6657 else
6658 {
6659 if (m_OldLocation)
6660 {
6661 m_OldLocation.Reset();
6662 }
6663 }
6664
6666 }
6667 else
6668 {
6669 if (new_player)
6670 {
6671 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6672 if (res_index >= 0)
6673 {
6674 InventoryLocation il = new InventoryLocation;
6675 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6677 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6680 {
6681 il.
GetParent().GetOnReleaseLock().Invoke(it);
6682 }
6684 {
6686 }
6687
6688 }
6689 }
6691 {
6692
6694 }
6695
6696 if (m_OldLocation)
6697 {
6698 m_OldLocation.Reset();
6699 }
6700 }
6701 }
6702
6703 override void EOnContact(IEntity other, Contact extra)
6704 {
6706 {
6707 int liquidType = -1;
6709 if (impactSpeed > 0.0)
6710 {
6712 #ifndef SERVER
6714 #else
6716 SetSynchDirty();
6717 #endif
6719 }
6720 }
6721
6722 #ifdef SERVER
6723 if (GetCompEM() && GetCompEM().IsPlugged())
6724 {
6725 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6726 GetCompEM().UnplugThis();
6727 }
6728 #endif
6729 }
6730
6732
6734 {
6736 }
6737
6739 {
6740
6741 }
6742
6744 {
6745 super.OnItemLocationChanged(old_owner, new_owner);
6746
6747 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6748 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6749
6750 if (!relatedPlayer && playerNew)
6751 relatedPlayer = playerNew;
6752
6753 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6754 {
6756 if (actionMgr)
6757 {
6758 ActionBase currentAction = actionMgr.GetRunningAction();
6759 if (currentAction)
6761 }
6762 }
6763
6764 Man ownerPlayerOld = null;
6765 Man ownerPlayerNew = null;
6766
6767 if (old_owner)
6768 {
6769 if (old_owner.
IsMan())
6770 {
6771 ownerPlayerOld = Man.Cast(old_owner);
6772 }
6773 else
6774 {
6775 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6776 }
6777 }
6778 else
6779 {
6781 {
6783
6784 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6785 {
6786 GetCompEM().UnplugThis();
6787 }
6788 }
6789 }
6790
6791 if (new_owner)
6792 {
6793 if (new_owner.
IsMan())
6794 {
6795 ownerPlayerNew = Man.Cast(new_owner);
6796 }
6797 else
6798 {
6799 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6800 }
6801 }
6802
6803 if (ownerPlayerOld != ownerPlayerNew)
6804 {
6805 if (ownerPlayerOld)
6806 {
6807 array<EntityAI> subItemsExit = new array<EntityAI>;
6809 for (int i = 0; i < subItemsExit.Count(); i++)
6810 {
6813 }
6814 }
6815
6816 if (ownerPlayerNew)
6817 {
6818 array<EntityAI> subItemsEnter = new array<EntityAI>;
6820 for (int j = 0; j < subItemsEnter.Count(); j++)
6821 {
6824 }
6825 }
6826 }
6827 else if (ownerPlayerNew != null)
6828 {
6829 PlayerBase nplayer;
6830 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6831 {
6832 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6834 for (int k = 0; k < subItemsUpdate.Count(); k++)
6835 {
6837 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6838 }
6839 }
6840 }
6841
6842 if (old_owner)
6843 old_owner.OnChildItemRemoved(this);
6844 if (new_owner)
6845 new_owner.OnChildItemReceived(this);
6846 }
6847
6848
6850 {
6851 super.EEDelete(parent);
6852 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6853 if (player)
6854 {
6856
6857 if (player.IsAlive())
6858 {
6859 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6860 if (r_index >= 0)
6861 {
6862 InventoryLocation r_il = new InventoryLocation;
6863 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6864
6865 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6868 {
6869 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6870 }
6872 {
6873 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6874 }
6875
6876 }
6877
6878 player.RemoveQuickBarEntityShortcut(this);
6879 }
6880 }
6881 }
6882
6884 {
6885 super.EEKilled(killer);
6886
6889 {
6890 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6891 {
6892 if (IsMagazine())
6893 {
6894 if (Magazine.Cast(this).GetAmmoCount() > 0)
6895 {
6897 }
6898 }
6899 else
6900 {
6902 }
6903 }
6904 }
6905 }
6906
6908 {
6909 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6910
6911 super.OnWasAttached(parent, slot_id);
6912
6915
6917 }
6918
6920 {
6921 super.OnWasDetached(parent, slot_id);
6922
6925 }
6926
6928 {
6929 int idx;
6932
6933 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6934 if (inventory_slots.Count() < 1)
6935 {
6936 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6937 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6938 }
6939 else
6940 {
6941 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6942 }
6943
6944 idx = inventory_slots.Find(slot);
6945 if (idx < 0)
6946 return "";
6947
6948 return attach_types.Get(idx);
6949 }
6950
6952 {
6953 int idx = -1;
6954 string slot;
6955
6958
6959 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6960 if (inventory_slots.Count() < 1)
6961 {
6962 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6963 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6964 }
6965 else
6966 {
6967 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6968 if (detach_types.Count() < 1)
6969 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6970 }
6971
6972 for (int i = 0; i < inventory_slots.Count(); i++)
6973 {
6974 slot = inventory_slots.Get(i);
6975 }
6976
6977 if (slot != "")
6978 {
6979 if (detach_types.Count() == 1)
6980 idx = 0;
6981 else
6982 idx = inventory_slots.Find(slot);
6983 }
6984 if (idx < 0)
6985 return "";
6986
6987 return detach_types.Get(idx);
6988 }
6989
6991 {
6992
6994
6995
6996 float min_time = 1;
6997 float max_time = 3;
6998 float delay = Math.RandomFloat(min_time, max_time);
6999
7000 explode_timer.Run(delay, this, "DoAmmoExplosion");
7001 }
7002
7004 {
7005 Magazine magazine = Magazine.Cast(this);
7006 int pop_sounds_count = 6;
7007 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7008
7009
7010 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7011 string sound_name = pop_sounds[ sound_idx ];
7013
7014
7015 magazine.ServerAddAmmoCount(-1);
7016
7017
7018 float min_temp_to_explode = 100;
7019
7020 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
7021 {
7023 }
7024 }
7025
7026
7027 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7028 {
7029 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7030
7031 const int CHANCE_DAMAGE_CARGO = 4;
7032 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7033 const int CHANCE_DAMAGE_NOTHING = 2;
7034
7036 {
7037 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7038 int chances;
7039 int rnd;
7040
7041 if (GetInventory().GetCargo())
7042 {
7043 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7044 rnd = Math.RandomInt(0,chances);
7045
7046 if (rnd < CHANCE_DAMAGE_CARGO)
7047 {
7049 }
7050 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7051 {
7053 }
7054 }
7055 else
7056 {
7057 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7058 rnd = Math.RandomInt(0,chances);
7059
7060 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7061 {
7063 }
7064 }
7065 }
7066 }
7067
7069 {
7070 if (GetInventory().GetCargo())
7071 {
7072 int item_count = GetInventory().GetCargo().GetItemCount();
7073 if (item_count > 0)
7074 {
7075 int random_pick = Math.RandomInt(0, item_count);
7077 if (!item.IsExplosive())
7078 {
7079 item.AddHealth("","",damage);
7080 return true;
7081 }
7082 }
7083 }
7084 return false;
7085 }
7086
7088 {
7089 int attachment_count = GetInventory().AttachmentCount();
7090 if (attachment_count > 0)
7091 {
7092 int random_pick = Math.RandomInt(0, attachment_count);
7093 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7094 if (!attachment.IsExplosive())
7095 {
7096 attachment.AddHealth("","",damage);
7097 return true;
7098 }
7099 }
7100 return false;
7101 }
7102
7104 {
7106 }
7107
7109 {
7111 return GetInventory().CanRemoveEntity();
7112
7113 return false;
7114 }
7115
7117 {
7118
7120 return false;
7121
7122
7124 return false;
7125
7126
7127
7129 if (delta == 0)
7130 return false;
7131
7132
7133 return true;
7134 }
7135
7137 {
7139 {
7140 if (ScriptInputUserData.CanStoreInputUserData())
7141 {
7142 ScriptInputUserData ctx = new ScriptInputUserData;
7147 ctx.
Write(destination_entity);
7151 }
7152 }
7153 else if (!
GetGame().IsMultiplayer())
7154 {
7156 }
7157 }
7158
7160 {
7161 float split_quantity_new;
7165 InventoryLocation loc = new InventoryLocation;
7166
7167 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7168 {
7170 split_quantity_new = stack_max;
7171 else
7173
7175 {
7176 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7177 if (new_item)
7178 {
7179 new_item.SetResultOfSplit(true);
7180 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7182 new_item.
SetQuantity(split_quantity_new,
false,
true);
7183 }
7184 }
7185 }
7186 else if (destination_entity && slot_id == -1)
7187 {
7188 if (quantity > stack_max)
7189 split_quantity_new = stack_max;
7190 else
7191 split_quantity_new = quantity;
7192
7194 {
7196 {
7199 }
7200
7201 if (new_item)
7202 {
7203 new_item.SetResultOfSplit(true);
7204 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7206 new_item.
SetQuantity(split_quantity_new,
false,
true);
7207 }
7208 }
7209 }
7210 else
7211 {
7212 if (stack_max != 0)
7213 {
7215 {
7217 }
7218
7219 if (split_quantity_new == 0)
7220 {
7221 if (!
GetGame().IsMultiplayer())
7222 player.PhysicalPredictiveDropItem(this);
7223 else
7224 player.ServerDropEntity(this);
7225 return;
7226 }
7227
7229 {
7231
7232 if (new_item)
7233 {
7234 new_item.SetResultOfSplit(true);
7235 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7238 new_item.PlaceOnSurface();
7239 }
7240 }
7241 }
7242 }
7243 }
7244
7246 {
7247 float split_quantity_new;
7251 InventoryLocation loc = new InventoryLocation;
7252
7253 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7254 {
7256 split_quantity_new = stack_max;
7257 else
7259
7261 {
7262 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7263 if (new_item)
7264 {
7265 new_item.SetResultOfSplit(true);
7266 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7268 new_item.
SetQuantity(split_quantity_new,
false,
true);
7269 }
7270 }
7271 }
7272 else if (destination_entity && slot_id == -1)
7273 {
7274 if (quantity > stack_max)
7275 split_quantity_new = stack_max;
7276 else
7277 split_quantity_new = quantity;
7278
7280 {
7282 {
7285 }
7286
7287 if (new_item)
7288 {
7289 new_item.SetResultOfSplit(true);
7290 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7292 new_item.
SetQuantity(split_quantity_new,
false,
true);
7293 }
7294 }
7295 }
7296 else
7297 {
7298 if (stack_max != 0)
7299 {
7301 {
7303 }
7304
7306 {
7308
7309 if (new_item)
7310 {
7311 new_item.SetResultOfSplit(true);
7312 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7315 new_item.PlaceOnSurface();
7316 }
7317 }
7318 }
7319 }
7320 }
7321
7323 {
7325 {
7326 if (ScriptInputUserData.CanStoreInputUserData())
7327 {
7328 ScriptInputUserData ctx = new ScriptInputUserData;
7333 dst.WriteToContext(ctx);
7335 }
7336 }
7337 else if (!
GetGame().IsMultiplayer())
7338 {
7340 }
7341 }
7342
7344 {
7346 {
7347 if (ScriptInputUserData.CanStoreInputUserData())
7348 {
7349 ScriptInputUserData ctx = new ScriptInputUserData;
7354 ctx.
Write(destination_entity);
7360 }
7361 }
7362 else if (!
GetGame().IsMultiplayer())
7363 {
7365 }
7366 }
7367
7369 {
7371 }
7372
7374 {
7376 float split_quantity_new;
7378 if (dst.IsValid())
7379 {
7380 int slot_id = dst.GetSlot();
7382
7383 if (quantity > stack_max)
7384 split_quantity_new = stack_max;
7385 else
7386 split_quantity_new = quantity;
7387
7389 {
7391
7392 if (new_item)
7393 {
7394 new_item.SetResultOfSplit(true);
7395 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7397 new_item.
SetQuantity(split_quantity_new,
false,
true);
7398 }
7399
7400 return new_item;
7401 }
7402 }
7403
7404 return null;
7405 }
7406
7408 {
7410 float split_quantity_new;
7412 if (destination_entity)
7413 {
7415 if (quantity > stackable)
7416 split_quantity_new = stackable;
7417 else
7418 split_quantity_new = quantity;
7419
7421 {
7422 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7423 if (new_item)
7424 {
7425 new_item.SetResultOfSplit(true);
7426 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7428 new_item.
SetQuantity(split_quantity_new,
false,
true);
7429 }
7430 }
7431 }
7432 }
7433
7435 {
7437 {
7438 if (ScriptInputUserData.CanStoreInputUserData())
7439 {
7440 ScriptInputUserData ctx = new ScriptInputUserData;
7445 ItemBase destination_entity =
this;
7446 ctx.
Write(destination_entity);
7450 }
7451 }
7452 else if (!
GetGame().IsMultiplayer())
7453 {
7455 }
7456 }
7457
7459 {
7461 float split_quantity_new;
7463 if (player)
7464 {
7466 if (quantity > stackable)
7467 split_quantity_new = stackable;
7468 else
7469 split_quantity_new = quantity;
7470
7472 {
7473 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7474 new_item =
ItemBase.Cast(in_hands);
7475 if (new_item)
7476 {
7477 new_item.SetResultOfSplit(true);
7478 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7480 new_item.SetQuantity(split_quantity_new, false, true);
7481 }
7482 }
7483 }
7484 }
7485
7487 {
7489 float split_quantity_new = Math.Floor(quantity * 0.5);
7490
7492 return;
7493
7495
7496 if (new_item)
7497 {
7498 if (new_item.GetQuantityMax() < split_quantity_new)
7499 {
7500 split_quantity_new = new_item.GetQuantityMax();
7501 }
7502
7503 new_item.SetResultOfSplit(true);
7504 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7505
7507 {
7510 }
7511 else
7512 {
7514 new_item.
SetQuantity(split_quantity_new,
false,
true);
7515 }
7516 }
7517 }
7518
7520 {
7522 float split_quantity_new = Math.Floor(quantity / 2);
7523
7525 return;
7526
7527 InventoryLocation invloc = new InventoryLocation;
7529
7531 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7532
7533 if (new_item)
7534 {
7535 if (new_item.GetQuantityMax() < split_quantity_new)
7536 {
7537 split_quantity_new = new_item.GetQuantityMax();
7538 }
7540 {
7543 }
7544 else if (split_quantity_new > 1)
7545 {
7547 new_item.
SetQuantity(split_quantity_new,
false,
true);
7548 }
7549 }
7550 }
7551
7554 {
7555 SetWeightDirty();
7557
7558 if (parent)
7559 parent.OnAttachmentQuantityChangedEx(this, delta);
7560
7562 {
7564 {
7566 }
7568 {
7569 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7571 }
7572 }
7573
7574 }
7575
7578 {
7579
7580 }
7581
7584 {
7586 }
7587
7589 {
7590 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7591
7593 {
7594 if (newLevel == GameConstants.STATE_RUINED)
7595 {
7597 EntityAI parent = GetHierarchyParent();
7598 if (parent && parent.IsFireplace())
7599 {
7600 CargoBase cargo = GetInventory().GetCargo();
7601 if (cargo)
7602 {
7604 {
7606 }
7607 }
7608 }
7609 }
7610
7612 {
7613
7615 return;
7616 }
7617
7618 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7619 {
7621 }
7622 }
7623 }
7624
7625
7627 {
7628 super.OnRightClick();
7629
7631 {
7633 {
7634 if (ScriptInputUserData.CanStoreInputUserData())
7635 {
7636 EntityAI root = GetHierarchyRoot();
7637 Man playerOwner = GetHierarchyRootPlayer();
7638 InventoryLocation dst = new InventoryLocation;
7639
7640
7641 if (!playerOwner && root && root == this)
7642 {
7644 }
7645 else
7646 {
7647
7648 GetInventory().GetCurrentInventoryLocation(dst);
7650 {
7653 {
7655 }
7656 else
7657 {
7659
7660
7661 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7662 {
7664 }
7665 else
7666 {
7667 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7668 }
7669 }
7670 }
7671 }
7672
7673 ScriptInputUserData ctx = new ScriptInputUserData;
7681 }
7682 }
7683 else if (!
GetGame().IsMultiplayer())
7684 {
7686 }
7687 }
7688 }
7689
7691 {
7692 if (root)
7693 {
7694 vector m4[4];
7695 root.GetTransform(m4);
7696 dst.SetGround(this, m4);
7697 }
7698 else
7699 {
7700 GetInventory().GetCurrentInventoryLocation(dst);
7701 }
7702 }
7703
7704 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7705 {
7706
7707 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7708 return false;
7709
7710 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7711 return false;
7712
7713
7715 return false;
7716
7717
7718 Magazine mag = Magazine.Cast(this);
7719 if (mag)
7720 {
7721 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7722 return false;
7723
7724 if (stack_max_limit)
7725 {
7726 Magazine other_mag = Magazine.Cast(other_item);
7727 if (other_item)
7728 {
7729 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7730 return false;
7731 }
7732
7733 }
7734 }
7735 else
7736 {
7737
7739 return false;
7740
7742 return false;
7743 }
7744
7745 PlayerBase player = null;
7746 if (CastTo(player, GetHierarchyRootPlayer()))
7747 {
7748 if (player.GetInventory().HasAttachment(this))
7749 return false;
7750
7751 if (player.IsItemsToDelete())
7752 return false;
7753 }
7754
7755 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7756 return false;
7757
7758 int slotID;
7760 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7761 return false;
7762
7763 return true;
7764 }
7765
7767 {
7769 }
7770
7772 {
7773 return m_IsResultOfSplit;
7774 }
7775
7777 {
7778 m_IsResultOfSplit = value;
7779 }
7780
7782 {
7784 }
7785
7787 {
7788 float other_item_quantity = other_item.GetQuantity();
7789 float this_free_space;
7790
7792
7794
7795 if (other_item_quantity > this_free_space)
7796 {
7797 return this_free_space;
7798 }
7799 else
7800 {
7801 return other_item_quantity;
7802 }
7803 }
7804
7806 {
7808 }
7809
7811 {
7813 return;
7814
7815 if (!IsMagazine() && other_item)
7816 {
7818 if (quantity_used != 0)
7819 {
7820 float hp1 = GetHealth01("","");
7821 float hp2 = other_item.GetHealth01("","");
7822 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7823 hpResult = hpResult / (
GetQuantity() + quantity_used);
7824
7825 hpResult *= GetMaxHealth();
7826 Math.Round(hpResult);
7827 SetHealth("", "Health", hpResult);
7828
7830 other_item.AddQuantity(-quantity_used);
7831 }
7832 }
7834 }
7835
7837 {
7838 #ifdef SERVER
7839 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7840 GetHierarchyParent().IncreaseLifetimeUp();
7841 #endif
7842 };
7843
7845 {
7846 PlayerBase p = PlayerBase.Cast(player);
7847
7848 array<int> recipesIds = p.m_Recipes;
7849 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7850 if (moduleRecipesManager)
7851 {
7852 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7853 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7854 }
7855
7856 for (int i = 0;i < recipesIds.Count(); i++)
7857 {
7858 int key = recipesIds.Get(i);
7859 string recipeName = moduleRecipesManager.GetRecipeName(key);
7861 }
7862 }
7863
7864
7865 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7866 {
7867 super.GetDebugActions(outputList);
7868
7869
7875
7876
7881
7886
7887
7891
7892
7894 {
7898 }
7899
7902
7903
7907
7909
7910 InventoryLocation loc = new InventoryLocation();
7911 GetInventory().GetCurrentInventoryLocation(loc);
7913 {
7914 if (Gizmo_IsSupported())
7917 }
7918
7920 }
7921
7922
7923
7924
7926 {
7927 super.OnAction(action_id, player, ctx);
7928
7930 {
7931 switch (action_id)
7932 {
7935 return true;
7938 return true;
7939 }
7940 }
7941
7943 {
7944 switch (action_id)
7945 {
7947 Delete();
7948 return true;
7949 }
7950 }
7951
7952 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7953 {
7954 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7955 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7956 PlayerBase p = PlayerBase.Cast(player);
7957 if (
EActions.RECIPES_RANGE_START < 1000)
7958 {
7959 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7960 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7961 }
7962 }
7963 #ifndef SERVER
7964 else if (action_id ==
EActions.WATCH_PLAYER)
7965 {
7966 PluginDeveloper.SetDeveloperItemClientEx(player);
7967 }
7968 #endif
7970 {
7971 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7972 {
7973 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7974 OnDebugButtonPressServer(id + 1);
7975 }
7976
7977 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7978 {
7979 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7981 }
7982
7983 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7984 {
7985 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7987 }
7988
7989 else if (action_id ==
EActions.ADD_QUANTITY)
7990 {
7991 if (IsMagazine())
7992 {
7993 Magazine mag = Magazine.Cast(this);
7994 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7995 }
7996 else
7997 {
7999 }
8000
8001 if (m_EM)
8002 {
8003 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8004 }
8005
8006 }
8007
8008 else if (action_id ==
EActions.REMOVE_QUANTITY)
8009 {
8010 if (IsMagazine())
8011 {
8012 Magazine mag2 = Magazine.Cast(this);
8013 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8014 }
8015 else
8016 {
8018 }
8019 if (m_EM)
8020 {
8021 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8022 }
8023
8024 }
8025
8026 else if (action_id ==
EActions.SET_QUANTITY_0)
8027 {
8029
8030 if (m_EM)
8031 {
8032 m_EM.SetEnergy(0);
8033 }
8034 }
8035
8036 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8037 {
8039
8040 if (m_EM)
8041 {
8042 m_EM.SetEnergy(m_EM.GetEnergyMax());
8043 }
8044 }
8045
8046 else if (action_id ==
EActions.ADD_HEALTH)
8047 {
8048 AddHealth("","",GetMaxHealth("","Health")/5);
8049 }
8050 else if (action_id ==
EActions.REMOVE_HEALTH)
8051 {
8052 AddHealth("","",-GetMaxHealth("","Health")/5);
8053 }
8054 else if (action_id ==
EActions.DESTROY_HEALTH)
8055 {
8056 SetHealth01("","",0);
8057 }
8058 else if (action_id ==
EActions.WATCH_ITEM)
8059 {
8061 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8062 #ifdef DEVELOPER
8063 SetDebugDeveloper_item(this);
8064 #endif
8065 }
8066
8067 else if (action_id ==
EActions.ADD_TEMPERATURE)
8068 {
8069 AddTemperature(20);
8070
8071 }
8072
8073 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8074 {
8075 AddTemperature(-20);
8076
8077 }
8078
8079 else if (action_id ==
EActions.FLIP_FROZEN)
8080 {
8081 SetFrozen(!GetIsFrozen());
8082
8083 }
8084
8085 else if (action_id ==
EActions.ADD_WETNESS)
8086 {
8088
8089 }
8090
8091 else if (action_id ==
EActions.REMOVE_WETNESS)
8092 {
8094
8095 }
8096
8097 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8098 {
8101
8102
8103 }
8104
8105 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8106 {
8109 }
8110
8111 else if (action_id ==
EActions.MAKE_SPECIAL)
8112 {
8113 auto debugParams = DebugSpawnParams.WithPlayer(player);
8114 OnDebugSpawnEx(debugParams);
8115 }
8116
8117 }
8118
8119
8120 return false;
8121 }
8122
8123
8124
8125
8129
8132
8133
8134
8136 {
8137 return false;
8138 }
8139
8140
8142 {
8143 return true;
8144 }
8145
8146
8148 {
8149 return true;
8150 }
8151
8152
8153
8155 {
8156 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8158 }
8159
8162 {
8163 return null;
8164 }
8165
8167 {
8168 return false;
8169 }
8170
8172 {
8173 return false;
8174 }
8175
8179
8180
8182 {
8183 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8184 return module_repairing.CanRepair(this, item_repair_kit);
8185 }
8186
8187
8188 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8189 {
8190 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8191 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8192 }
8193
8194
8196 {
8197
8198
8199
8200
8201
8202
8203
8204
8205 return 1;
8206 }
8207
8208
8209
8211 {
8213 }
8214
8215
8216
8218 {
8220 }
8221
8222
8231 {
8232 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8233
8234 if (player)
8235 {
8236 player.MessageStatus(text);
8237 }
8238 }
8239
8240
8249 {
8250 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8251
8252 if (player)
8253 {
8254 player.MessageAction(text);
8255 }
8256 }
8257
8258
8267 {
8268 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8269
8270 if (player)
8271 {
8272 player.MessageFriendly(text);
8273 }
8274 }
8275
8276
8285 {
8286 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8287
8288 if (player)
8289 {
8290 player.MessageImportant(text);
8291 }
8292 }
8293
8295 {
8296 return true;
8297 }
8298
8299
8300 override bool KindOf(
string tag)
8301 {
8302 bool found = false;
8303 string item_name = this.
GetType();
8306
8307 int array_size = item_tag_array.Count();
8308 for (int i = 0; i < array_size; i++)
8309 {
8310 if (item_tag_array.Get(i) == tag)
8311 {
8312 found = true;
8313 break;
8314 }
8315 }
8316 return found;
8317 }
8318
8319
8321 {
8322
8323 super.OnRPC(sender, rpc_type,ctx);
8324
8325
8326 switch (rpc_type)
8327 {
8328 #ifndef SERVER
8329 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8330 Param2<bool, string> p = new Param2<bool, string>(false, "");
8331
8333 return;
8334
8335 bool play = p.param1;
8336 string soundSet = p.param2;
8337
8338 if (play)
8339 {
8341 {
8343 {
8345 }
8346 }
8347 else
8348 {
8350 }
8351 }
8352 else
8353 {
8355 }
8356
8357 break;
8358 #endif
8359
8360 }
8361
8363 {
8365 }
8366 }
8367
8368
8369
8370
8372 {
8373 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8374 return plugin.GetID(
name);
8375 }
8376
8378 {
8379 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8380 return plugin.GetName(id);
8381 }
8382
8385 {
8386
8387
8388 int varFlags;
8389 if (!ctx.
Read(varFlags))
8390 return;
8391
8392 if (varFlags & ItemVariableFlags.FLOAT)
8393 {
8395 }
8396 }
8397
8399 {
8400
8401 super.SerializeNumericalVars(floats_out);
8402
8403
8404
8406 {
8408 }
8409
8411 {
8413 }
8414
8416 {
8418 }
8419
8421 {
8426 }
8427
8429 {
8431 }
8432 }
8433
8435 {
8436
8437 super.DeSerializeNumericalVars(floats);
8438
8439
8440 int index = 0;
8441 int mask = Math.Round(floats.Get(index));
8442
8443 index++;
8444
8446 {
8448 {
8450 }
8451 else
8452 {
8453 float quantity = floats.Get(index);
8455 }
8456 index++;
8457 }
8458
8460 {
8461 float wet = floats.Get(index);
8463 index++;
8464 }
8465
8467 {
8468 int liquidtype = Math.Round(floats.Get(index));
8470 index++;
8471 }
8472
8474 {
8476 index++;
8478 index++;
8480 index++;
8482 index++;
8483 }
8484
8486 {
8487 int cleanness = Math.Round(floats.Get(index));
8489 index++;
8490 }
8491 }
8492
8494 {
8495 super.WriteVarsToCTX(ctx);
8496
8497
8499 {
8501 }
8502
8504 {
8506 }
8507
8509 {
8511 }
8512
8514 {
8515 int r,g,b,a;
8521 }
8522
8524 {
8526 }
8527 }
8528
8530 {
8531 if (!super.ReadVarsFromCTX(ctx,version))
8532 return false;
8533
8534 int intValue;
8535 float value;
8536
8537 if (version < 140)
8538 {
8539 if (!ctx.
Read(intValue))
8540 return false;
8541
8542 m_VariablesMask = intValue;
8543 }
8544
8546 {
8547 if (!ctx.
Read(value))
8548 return false;
8549
8551 {
8553 }
8554 else
8555 {
8557 }
8558 }
8559
8560 if (version < 140)
8561 {
8563 {
8564 if (!ctx.
Read(value))
8565 return false;
8566 SetTemperatureDirect(value);
8567 }
8568 }
8569
8571 {
8572 if (!ctx.
Read(value))
8573 return false;
8575 }
8576
8578 {
8579 if (!ctx.
Read(intValue))
8580 return false;
8582 }
8583
8585 {
8586 int r,g,b,a;
8588 return false;
8590 return false;
8592 return false;
8594 return false;
8595
8597 }
8598
8600 {
8601 if (!ctx.
Read(intValue))
8602 return false;
8604 }
8605
8606 if (version >= 138 && version < 140)
8607 {
8609 {
8610 if (!ctx.
Read(intValue))
8611 return false;
8612 SetFrozen(intValue);
8613 }
8614 }
8615
8616 return true;
8617 }
8618
8619
8621 {
8624 {
8626 }
8627
8628 if (!super.OnStoreLoad(ctx, version))
8629 {
8631 return false;
8632 }
8633
8634 if (version >= 114)
8635 {
8636 bool hasQuickBarIndexSaved;
8637
8638 if (!ctx.
Read(hasQuickBarIndexSaved))
8639 {
8641 return false;
8642 }
8643
8644 if (hasQuickBarIndexSaved)
8645 {
8646 int itmQBIndex;
8647
8648
8649 if (!ctx.
Read(itmQBIndex))
8650 {
8652 return false;
8653 }
8654
8655 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8656 if (itmQBIndex != -1 && parentPlayer)
8657 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8658 }
8659 }
8660 else
8661 {
8662
8663 PlayerBase player;
8664 int itemQBIndex;
8665 if (version ==
int.
MAX)
8666 {
8667 if (!ctx.
Read(itemQBIndex))
8668 {
8670 return false;
8671 }
8672 }
8673 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8674 {
8675
8676 if (!ctx.
Read(itemQBIndex))
8677 {
8679 return false;
8680 }
8681 if (itemQBIndex != -1 && player)
8682 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8683 }
8684 }
8685
8686 if (version < 140)
8687 {
8688
8689 if (!LoadVariables(ctx, version))
8690 {
8692 return false;
8693 }
8694 }
8695
8696
8698 {
8700 return false;
8701 }
8702 if (version >= 132)
8703 {
8705 if (raib)
8706 {
8708 {
8710 return false;
8711 }
8712 }
8713 }
8714
8716 return true;
8717 }
8718
8719
8720
8722 {
8723 super.OnStoreSave(ctx);
8724
8725 PlayerBase player;
8726 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8727 {
8729
8730 int itemQBIndex = -1;
8731 itemQBIndex = player.FindQuickBarEntityIndex(this);
8732 ctx.
Write(itemQBIndex);
8733 }
8734 else
8735 {
8737 }
8738
8740
8742 if (raib)
8743 {
8745 }
8746 }
8747
8748
8750 {
8751 super.AfterStoreLoad();
8752
8754 {
8756 }
8757
8759 {
8762 }
8763 }
8764
8766 {
8767 super.EEOnAfterLoad();
8768
8770 {
8772 }
8773
8776 }
8777
8779 {
8780 return false;
8781 }
8782
8783
8784
8786 {
8788 {
8789 #ifdef PLATFORM_CONSOLE
8790
8792 {
8794 if (menu)
8795 {
8797 }
8798 }
8799 #endif
8800 }
8801
8803 {
8806 }
8807
8809 {
8810 SetWeightDirty();
8812 }
8814 {
8817 }
8818
8820 {
8823 }
8825 {
8828 }
8829
8830 super.OnVariablesSynchronized();
8831 }
8832
8833
8834
8836 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8837 {
8838 if (!IsServerCheck(allow_client))
8839 return false;
8840
8842 return false;
8843
8846
8847 if (value <= (min + 0.001))
8848 value = min;
8849
8850 if (value == min)
8851 {
8852 if (destroy_config)
8853 {
8854 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8855 if (dstr)
8856 {
8858 this.Delete();
8859 return true;
8860 }
8861 }
8862 else if (destroy_forced)
8863 {
8865 this.Delete();
8866 return true;
8867 }
8868
8870 }
8871
8874
8876 {
8878
8879 if (delta)
8881 }
8882
8884
8885 return false;
8886 }
8887
8888
8890 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8891 {
8893 }
8894
8896 {
8899 }
8900
8902 {
8905 }
8906
8908 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8909 {
8910 float value_clamped = Math.Clamp(value, 0, 1);
8912 SetQuantity(result, destroy_config, destroy_forced);
8913 }
8914
8915
8918 {
8920 }
8921
8923 {
8925 }
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8937 {
8938 int slot = -1;
8939 if (GetInventory())
8940 {
8941 InventoryLocation il = new InventoryLocation;
8942 GetInventory().GetCurrentInventoryLocation(il);
8944 }
8945
8947 }
8948
8950 {
8951 float quantity_max = 0;
8952
8954 {
8955 if (attSlotID != -1)
8956 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8957
8958 if (quantity_max <= 0)
8960 }
8961
8962 if (quantity_max <= 0)
8964
8965 return quantity_max;
8966 }
8967
8969 {
8971 }
8972
8974 {
8976 }
8977
8978
8980 {
8982 }
8983
8985 {
8987 }
8988
8990 {
8992 }
8993
8994
8996 {
8997
8998 float weightEx = GetWeightEx();
8999 float special = GetInventoryAndCargoWeight();
9000 return weightEx - special;
9001 }
9002
9003
9005 {
9007 }
9008
9010 {
9012 {
9013 #ifdef DEVELOPER
9014 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9015 {
9016 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9018 }
9019 #endif
9020
9022 }
9023 else if (HasEnergyManager())
9024 {
9025 #ifdef DEVELOPER
9026 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9027 {
9028 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9029 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9030 }
9031 #endif
9032 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
9033 }
9034 else
9035 {
9036 #ifdef DEVELOPER
9037 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9038 {
9039 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9040 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9041 }
9042 #endif
9043 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9044 }
9045 }
9046
9049 {
9050 int item_count = 0;
9052
9053 if (GetInventory().GetCargo() != NULL)
9054 {
9055 item_count = GetInventory().GetCargo().GetItemCount();
9056 }
9057
9058 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9059 {
9060 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9061 if (item)
9062 item_count += item.GetNumberOfItems();
9063 }
9064 return item_count;
9065 }
9066
9069 {
9070 float weight = 0;
9071 float wetness = 1;
9072 if (include_wetness)
9075 {
9076 weight = wetness * m_ConfigWeight;
9077 }
9079 {
9080 weight = 1;
9081 }
9082 return weight;
9083 }
9084
9085
9086
9088 {
9089 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9090 {
9091 GameInventory inv = GetInventory();
9092 array<EntityAI> items = new array<EntityAI>;
9094 for (int i = 0; i < items.Count(); i++)
9095 {
9097 if (item)
9098 {
9100 }
9101 }
9102 }
9103 }
9104
9105
9106
9107
9109 {
9110 float energy = 0;
9111 if (HasEnergyManager())
9112 {
9113 energy = GetCompEM().GetEnergy();
9114 }
9115 return energy;
9116 }
9117
9118
9120 {
9121 super.OnEnergyConsumed();
9122
9124 }
9125
9127 {
9128 super.OnEnergyAdded();
9129
9131 }
9132
9133
9135 {
9136 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9137 {
9139 {
9140 float energy_0to1 = GetCompEM().GetEnergy0To1();
9142 }
9143 }
9144 }
9145
9146
9148 {
9149 return ConfigGetFloat("heatIsolation");
9150 }
9151
9153 {
9155 }
9156
9158 {
9159 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9160 if (
GetGame().ConfigIsExisting(paramPath))
9162
9163 return 0.0;
9164 }
9165
9167 {
9168 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9169 if (
GetGame().ConfigIsExisting(paramPath))
9171
9172 return 0.0;
9173 }
9174
9175 override void SetWet(
float value,
bool allow_client =
false)
9176 {
9177 if (!IsServerCheck(allow_client))
9178 return;
9179
9182
9184
9185 m_VarWet = Math.Clamp(value, min, max);
9186
9188 {
9191 }
9192 }
9193
9194 override void AddWet(
float value)
9195 {
9197 }
9198
9200 {
9202 }
9203
9205 {
9207 }
9208
9210 {
9212 }
9213
9215 {
9217 }
9218
9220 {
9222 }
9223
9225 {
9228 if (newLevel != oldLevel)
9229 {
9231 }
9232 }
9233
9235 {
9236 SetWeightDirty();
9237 }
9238
9240 {
9241 return GetWetLevelInternal(
m_VarWet);
9242 }
9243
9244
9245
9247 {
9249 }
9250
9252 {
9254 }
9255
9257 {
9259 }
9260
9262 {
9264 }
9265
9266
9267
9269 {
9270 if (ConfigIsExisting("itemModelLength"))
9271 {
9272 return ConfigGetFloat("itemModelLength");
9273 }
9274 return 0;
9275 }
9276
9278 {
9279 if (ConfigIsExisting("itemAttachOffset"))
9280 {
9281 return ConfigGetFloat("itemAttachOffset");
9282 }
9283 return 0;
9284 }
9285
9286 override void SetCleanness(
int value,
bool allow_client =
false)
9287 {
9288 if (!IsServerCheck(allow_client))
9289 return;
9290
9292
9294
9297 }
9298
9300 {
9302 }
9303
9305 {
9306 return true;
9307 }
9308
9309
9310
9311
9313 {
9315 }
9316
9318 {
9320 }
9321
9322
9323
9324
9325 override void SetColor(
int r,
int g,
int b,
int a)
9326 {
9332 }
9334 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9335 {
9340 }
9341
9343 {
9345 }
9346
9349 {
9350 int r,g,b,a;
9352 r = r/255;
9353 g = g/255;
9354 b = b/255;
9355 a = a/255;
9356 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9357 }
9358
9359
9360
9361 override void SetLiquidType(
int value,
bool allow_client =
false)
9362 {
9363 if (!IsServerCheck(allow_client))
9364 return;
9365
9370 }
9371
9373 {
9374 return ConfigGetInt("varLiquidTypeInit");
9375 }
9376
9378 {
9380 }
9381
9383 {
9385 SetFrozen(false);
9386 }
9387
9390 {
9391 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9392 }
9393
9394
9397 {
9398 PlayerBase nplayer;
9399 if (PlayerBase.CastTo(nplayer, player))
9400 {
9402
9403 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9404 }
9405 }
9406
9407
9410 {
9411 PlayerBase nplayer;
9412 if (PlayerBase.CastTo(nplayer,player))
9413 {
9414
9415 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9416
9417 }
9418
9419
9420 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9421
9422
9423 if (HasEnergyManager())
9424 {
9425 GetCompEM().UpdatePlugState();
9426 }
9427 }
9428
9429
9431 {
9432 super.OnPlacementStarted(player);
9433
9435 }
9436
9437 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9438 {
9440 {
9441 m_AdminLog.OnPlacementComplete(player,
this);
9442 }
9443
9444 super.OnPlacementComplete(player, position, orientation);
9445 }
9446
9447
9448
9449
9450
9452 {
9454 {
9455 return true;
9456 }
9457 else
9458 {
9459 return false;
9460 }
9461 }
9462
9463
9465 {
9467 {
9469 }
9470 }
9471
9472
9474 {
9476 }
9477
9479 {
9481 }
9482
9483 override void InsertAgent(
int agent,
float count = 1)
9484 {
9485 if (count < 1)
9486 return;
9487
9489 }
9490
9493 {
9495 }
9496
9497
9499 {
9501 }
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9545 {
9547 return false;
9548 return true;
9549 }
9550
9552 {
9553
9555 }
9556
9557
9560 {
9561 super.CheckForRoofLimited(timeTresholdMS);
9562
9564 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9565 {
9566 m_PreviousRoofTestTime = time;
9567 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9568 }
9569 }
9570
9571
9573 {
9575 {
9576 return 0;
9577 }
9578
9579 if (GetInventory().GetAttachmentSlotsCount() != 0)
9580 {
9581 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9582 if (filter)
9583 return filter.GetProtectionLevel(type, false, system);
9584 else
9585 return 0;
9586 }
9587
9588 string subclassPath, entryName;
9589
9590 switch (type)
9591 {
9593 entryName = "biological";
9594 break;
9596 entryName = "chemical";
9597 break;
9598 default:
9599 entryName = "biological";
9600 break;
9601 }
9602
9603 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9604
9606 }
9607
9608
9609
9612 {
9613 if (!IsMagazine())
9615
9617 }
9618
9619
9620
9621
9622
9627 {
9628 return true;
9629 }
9630
9632 {
9634 }
9635
9636
9637
9638
9639
9641 {
9642 if (parent)
9643 {
9644 if (parent.IsInherited(DayZInfected))
9645 return true;
9646
9647 if (!parent.IsRuined())
9648 return true;
9649 }
9650
9651 return true;
9652 }
9653
9655 {
9656 if (!super.CanPutAsAttachment(parent))
9657 {
9658 return false;
9659 }
9660
9661 if (!IsRuined() && !parent.IsRuined())
9662 {
9663 return true;
9664 }
9665
9666 return false;
9667 }
9668
9670 {
9671
9672
9673
9674
9675 return super.CanReceiveItemIntoCargo(item);
9676 }
9677
9679 {
9680
9681
9682
9683
9684 GameInventory attachmentInv = attachment.GetInventory();
9686 {
9687 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9688 return false;
9689 }
9690
9691 InventoryLocation loc = new InventoryLocation();
9692 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9693 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9694 return false;
9695
9696 return super.CanReceiveAttachment(attachment, slotId);
9697 }
9698
9700 {
9701 if (!super.CanReleaseAttachment(attachment))
9702 return false;
9703
9704 return GetInventory().AreChildrenAccessible();
9705 }
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9728 {
9729 int id = muzzle_owner.GetMuzzleID();
9730 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9731
9732 if (WPOF_array)
9733 {
9734 for (int i = 0; i < WPOF_array.Count(); i++)
9735 {
9736 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9737
9738 if (WPOF)
9739 {
9740 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9741 }
9742 }
9743 }
9744 }
9745
9746
9748 {
9749 int id = muzzle_owner.GetMuzzleID();
9751
9752 if (WPOBE_array)
9753 {
9754 for (int i = 0; i < WPOBE_array.Count(); i++)
9755 {
9756 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9757
9758 if (WPOBE)
9759 {
9760 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9761 }
9762 }
9763 }
9764 }
9765
9766
9768 {
9769 int id = muzzle_owner.GetMuzzleID();
9770 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9771
9772 if (WPOOH_array)
9773 {
9774 for (int i = 0; i < WPOOH_array.Count(); i++)
9775 {
9776 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9777
9778 if (WPOOH)
9779 {
9780 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9781 }
9782 }
9783 }
9784 }
9785
9786
9788 {
9789 int id = muzzle_owner.GetMuzzleID();
9790 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9791
9792 if (WPOOH_array)
9793 {
9794 for (int i = 0; i < WPOOH_array.Count(); i++)
9795 {
9796 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9797
9798 if (WPOOH)
9799 {
9800 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9801 }
9802 }
9803 }
9804 }
9805
9806
9808 {
9809 int id = muzzle_owner.GetMuzzleID();
9810 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9811
9812 if (WPOOH_array)
9813 {
9814 for (int i = 0; i < WPOOH_array.Count(); i++)
9815 {
9816 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9817
9818 if (WPOOH)
9819 {
9820 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9821 }
9822 }
9823 }
9824 }
9825
9826
9827
9829 {
9831 {
9832 return true;
9833 }
9834
9835 return false;
9836 }
9837
9839 {
9841 {
9842 return true;
9843 }
9844
9845 return false;
9846 }
9847
9849 {
9851 {
9852 return true;
9853 }
9854
9855 return false;
9856 }
9857
9859 {
9860 return false;
9861 }
9862
9865 {
9866 return UATimeSpent.DEFAULT_DEPLOY;
9867 }
9868
9869
9870
9871
9873 {
9875 SetSynchDirty();
9876 }
9877
9879 {
9881 }
9882
9883
9885 {
9886 return false;
9887 }
9888
9891 {
9892 string att_type = "None";
9893
9894 if (ConfigIsExisting("soundAttType"))
9895 {
9896 att_type = ConfigGetString("soundAttType");
9897 }
9898
9900 }
9901
9903 {
9905 }
9906
9907
9908
9909
9910
9916
9918 {
9921
9923 }
9924
9925
9927 {
9929 return;
9930
9932
9935
9938
9939 SoundParameters params = new SoundParameters();
9943 }
9944
9945
9947 {
9949 return;
9950
9952 SetSynchDirty();
9953
9956 }
9957
9958
9960 {
9962 return;
9963
9965 SetSynchDirty();
9966
9969 }
9970
9972 {
9974 }
9975
9977 {
9979 }
9980
9983 {
9984 if (!
GetGame().IsDedicatedServer())
9985 {
9986 if (ConfigIsExisting("attachSoundSet"))
9987 {
9988 string cfg_path = "";
9989 string soundset = "";
9991
9994 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9995 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9996
9997 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9998 {
9999 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10000 {
10001 if (cfg_slot_array[i] == slot_type)
10002 {
10003 soundset = cfg_soundset_array[i];
10004 break;
10005 }
10006 }
10007 }
10008
10009 if (soundset != "")
10010 {
10011 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10013 }
10014 }
10015 }
10016 }
10017
10019 {
10020
10021 }
10022
10023 void OnApply(PlayerBase player);
10024
10026 {
10027 return 1.0;
10028 };
10029
10031 {
10033 }
10034
10036 {
10038 }
10039
10041
10043 {
10044 SetDynamicPhysicsLifeTime(0.01);
10046 }
10047
10049 {
10050 array<string> zone_names = new array<string>;
10051 GetDamageZones(zone_names);
10052 for (int i = 0; i < zone_names.Count(); i++)
10053 {
10054 SetHealthMax(zone_names.Get(i),"Health");
10055 }
10056 SetHealthMax("","Health");
10057 }
10058
10061 {
10062 float global_health = GetHealth01("","Health");
10063 array<string> zones = new array<string>;
10064 GetDamageZones(zones);
10065
10066 for (int i = 0; i < zones.Count(); i++)
10067 {
10068 SetHealth01(zones.Get(i),"Health",global_health);
10069 }
10070 }
10071
10074 {
10075 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10076 }
10077
10079 {
10080 if (!hasRootAsPlayer)
10081 {
10082 if (refParentIB)
10083 {
10084
10085 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10086 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10087
10088 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10089 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10090
10093 }
10094 else
10095 {
10096
10099 }
10100 }
10101 }
10102
10104 {
10106 {
10107 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10108 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10109 {
10110 float heatPermCoef = 1.0;
10112 while (ent)
10113 {
10114 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10115 ent = ent.GetHierarchyParent();
10116 }
10117
10118 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10119 }
10120 }
10121 }
10122
10124 {
10125
10126 EntityAI parent = GetHierarchyParent();
10127 if (!parent)
10128 {
10129 hasParent = false;
10130 hasRootAsPlayer = false;
10131 }
10132 else
10133 {
10134 hasParent = true;
10135 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10136 refParentIB =
ItemBase.Cast(parent);
10137 }
10138 }
10139
10140 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10141 {
10142
10143 }
10144
10146 {
10147
10148 return false;
10149 }
10150
10152 {
10153
10154
10155 return false;
10156 }
10157
10159 {
10160
10161 return false;
10162 }
10163
10166 {
10167 return !GetIsFrozen() &&
IsOpen();
10168 }
10169
10171 {
10172 bool hasParent = false, hasRootAsPlayer = false;
10174
10175 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10176 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10177
10178 if (wwtu || foodDecay)
10179 {
10183
10184 if (processWetness || processTemperature || processDecay)
10185 {
10187
10188 if (processWetness)
10189 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10190
10191 if (processTemperature)
10193
10194 if (processDecay)
10195 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10196 }
10197 }
10198 }
10199
10202 {
10204 }
10205
10207 {
10210
10211 return super.GetTemperatureFreezeThreshold();
10212 }
10213
10215 {
10218
10219 return super.GetTemperatureThawThreshold();
10220 }
10221
10223 {
10226
10227 return super.GetItemOverheatThreshold();
10228 }
10229
10231 {
10233 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10234
10235 return super.GetTemperatureFreezeTime();
10236 }
10237
10239 {
10241 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10242
10243 return super.GetTemperatureThawTime();
10244 }
10245
10250
10252 {
10253 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10254 }
10255
10257 {
10258 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10259 }
10260
10263 {
10265 }
10266
10268 {
10270 }
10271
10273 {
10275 }
10276
10279 {
10280 return null;
10281 }
10282
10285 {
10286 return false;
10287 }
10288
10290 {
10292 {
10295 if (!trg)
10296 {
10298 explosive = this;
10299 }
10300
10301 explosive.PairRemote(trg);
10303
10304 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10305 trg.SetPersistentPairID(persistentID);
10306 explosive.SetPersistentPairID(persistentID);
10307
10308 return true;
10309 }
10310 return false;
10311 }
10312
10315 {
10316 float ret = 1.0;
10319 ret *= GetHealth01();
10320
10321 return ret;
10322 }
10323
10324 #ifdef DEVELOPER
10325 override void SetDebugItem()
10326 {
10327 super.SetDebugItem();
10328 _itemBase = this;
10329 }
10330
10332 {
10333 string text = super.GetDebugText();
10334
10336 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10337
10338 return text;
10339 }
10340 #endif
10341
10343 {
10344 return true;
10345 }
10346
10348
10350
10352 {
10355 }
10356
10357
10365
10381}
10382
10384{
10386 if (entity)
10387 {
10388 bool is_item = entity.IsInherited(
ItemBase);
10389 if (is_item && full_quantity)
10390 {
10393 }
10394 }
10395 else
10396 {
10398 return NULL;
10399 }
10400 return entity;
10401}
10402
10404{
10405 if (item)
10406 {
10407 if (health > 0)
10408 item.SetHealth("", "", health);
10409
10410 if (item.CanHaveTemperature())
10411 {
10413 if (item.CanFreeze())
10414 item.SetFrozen(false);
10415 }
10416
10417 if (item.HasEnergyManager())
10418 {
10419 if (quantity >= 0)
10420 {
10421 item.GetCompEM().SetEnergy0To1(quantity);
10422 }
10423 else
10424 {
10426 }
10427 }
10428 else if (item.IsMagazine())
10429 {
10430 Magazine mag = Magazine.Cast(item);
10431 if (quantity >= 0)
10432 {
10433 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10434 }
10435 else
10436 {
10438 }
10439
10440 }
10441 else
10442 {
10443 if (quantity >= 0)
10444 {
10445 item.SetQuantityNormalized(quantity, false);
10446 }
10447 else
10448 {
10450 }
10451
10452 }
10453 }
10454}
10455
10456#ifdef DEVELOPER
10458#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.