Infection chance while/after using this item, originally used for wound infection after bandaging, params 'system' and 'param' can allow usage by other systems as well.
5527{
5529 {
5530 return true;
5531 }
5532};
5533
5534
5535
5537{
5541
5543
5546
5547
5548
5549
5550
5559
5565
5570
5575
5596 protected bool m_IsResultOfSplit
5597
5599
5604
5605
5606
5608
5612
5613
5614
5616
5619
5620
5621
5627
5628
5636
5639
5640
5642
5643
5645
5646
5651
5652
5657
5658
5660
5661
5663 {
5668
5669 if (!
GetGame().IsDedicatedServer())
5670 {
5672 {
5674
5676 {
5678 }
5679 }
5680
5683 }
5684
5685 m_OldLocation = null;
5686
5688 {
5690 }
5691
5692 if (ConfigIsExisting("headSelectionsToHide"))
5693 {
5696 }
5697
5699 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5700 {
5702 }
5703
5705
5706 m_IsResultOfSplit = false;
5707
5709 }
5710
5712 {
5713 super.InitItemVariables();
5714
5720 m_Count = ConfigGetInt(
"count");
5721
5724
5729
5732
5737
5749
5753
5754
5757 if (ConfigIsExisting("canBeSplit"))
5758 {
5761 }
5762
5764 if (ConfigIsExisting("itemBehaviour"))
5766
5767
5770 RegisterNetSyncVariableInt("m_VarLiquidType");
5771 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5772
5773 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5774 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5775 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5776
5777 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5778 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5779 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5780 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5781
5782 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5783 RegisterNetSyncVariableBool("m_IsTakeable");
5784 RegisterNetSyncVariableBool("m_IsHologram");
5785
5788 {
5791 }
5792
5794
5796 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5798
5799 }
5800
5802 {
5804 }
5805
5807 {
5810 {
5815 }
5816 }
5817
5818 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5819 {
5821 {
5824 }
5825
5827 }
5828
5830 {
5836 }
5837
5839
5841 {
5843
5844 if (!action)
5845 {
5846 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5847 return;
5848 }
5849
5851 if (!ai)
5852 {
5854 return;
5855 }
5856
5858 if (!action_array)
5859 {
5860 action_array = new array<ActionBase_Basic>;
5862 }
5863 if (LogManager.IsActionLogEnable())
5864 {
5865 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5866 }
5867
5868 if (action_array.Find(action) != -1)
5869 {
5870 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5871 }
5872 else
5873 {
5874 action_array.Insert(action);
5875 }
5876 }
5877
5879 {
5881 ActionBase action = player.GetActionManager().GetAction(actionName);
5884
5885 if (action_array)
5886 {
5887 action_array.RemoveItem(action);
5888 }
5889 }
5890
5891
5892
5894 {
5895 ActionOverrideData overrideData = new ActionOverrideData();
5899
5901 if (!actionMap)
5902 {
5905 }
5906
5907 actionMap.Insert(this.
Type(), overrideData);
5908
5909 }
5910
5912
5914
5915
5917 {
5920
5923
5924 string config_to_search = "CfgVehicles";
5925 string muzzle_owner_config;
5926
5928 {
5929 if (IsInherited(Weapon))
5930 config_to_search = "CfgWeapons";
5931
5932 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5933
5934 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5935
5937
5938 if (config_OnFire_subclass_count > 0)
5939 {
5940 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5941
5942 for (int i = 0; i < config_OnFire_subclass_count; i++)
5943 {
5944 string particle_class = "";
5946 string config_OnFire_entry = config_OnFire_class + particle_class;
5947 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5948 WPOF_array.Insert(WPOF);
5949 }
5950
5951
5953 }
5954 }
5955
5957 {
5958 config_to_search = "CfgWeapons";
5959 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5960
5961 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5962
5964
5965 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5966 {
5967 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5968
5969 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5970 {
5971 string particle_class2 = "";
5973 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5974 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5975 WPOBE_array.Insert(WPOBE);
5976 }
5977
5978
5980 }
5981 }
5982 }
5983
5984
5986 {
5989
5991 {
5992 string config_to_search = "CfgVehicles";
5993
5994 if (IsInherited(Weapon))
5995 config_to_search = "CfgWeapons";
5996
5997 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5998 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5999
6000 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6001 {
6002
6004
6006 {
6008 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6010 return;
6011 }
6012
6015
6016
6017
6019 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6020
6021 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6022 {
6023 string particle_class = "";
6025 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6027
6028 if (entry_type == CT_CLASS)
6029 {
6030 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6031 WPOOH_array.Insert(WPOF);
6032 }
6033 }
6034
6035
6037 }
6038 }
6039 }
6040
6042 {
6044 }
6045
6047 {
6049 {
6051
6054
6057
6058 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6059 }
6060 }
6061
6063 {
6065 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6066
6068 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6069
6071 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6072
6074 {
6076 }
6077 }
6078
6080 {
6082 }
6083
6085 {
6088 else
6090
6092 {
6095 }
6096 else
6097 {
6100
6103 }
6104
6106 }
6107
6109 {
6111 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6112 }
6113
6115 {
6117 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6119 }
6120
6122 {
6124 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6125 }
6126
6128 {
6131
6132 OverheatingParticle OP = new OverheatingParticle();
6137
6139 }
6140
6142 {
6145
6146 return -1;
6147 }
6148
6150 {
6152 {
6155
6156 for (int i = count; i > 0; --i)
6157 {
6158 int id = i - 1;
6161
6164
6165 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6166 {
6167 if (p)
6168 {
6171 }
6172 }
6173 }
6174 }
6175 }
6176
6178 {
6180 {
6182 {
6183 int id = i - 1;
6185
6186 if (OP)
6187 {
6189
6190 if (p)
6191 {
6193 }
6194
6195 delete OP;
6196 }
6197 }
6198
6201 }
6202 }
6203
6206 {
6207 return 0.0;
6208 }
6209
6210
6212 {
6213 return 250;
6214 }
6215
6217 {
6218 return 0;
6219 }
6220
6223 {
6225 return true;
6226
6227 return false;
6228 }
6229
6232 {
6235
6237 {
6239 }
6240 else
6241 {
6242
6244 }
6245
6247 }
6248
6255 {
6256 return -1;
6257 }
6258
6259
6260
6261
6263 {
6265 {
6267 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6268
6269 if (r_index >= 0)
6270 {
6271 InventoryLocation r_il = new InventoryLocation;
6272 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6273
6274 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6277 {
6278 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6279 }
6281 {
6282 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6283 }
6284
6285 }
6286
6287 player.GetHumanInventory().ClearUserReservedLocation(this);
6288 }
6289
6292 }
6293
6294
6295
6296
6298 {
6299 return ItemBase.m_DebugActionsMask;
6300 }
6301
6303 {
6304 return ItemBase.m_DebugActionsMask & mask;
6305 }
6306
6308 {
6309 ItemBase.m_DebugActionsMask = mask;
6310 }
6311
6313 {
6314 ItemBase.m_DebugActionsMask |= mask;
6315 }
6316
6318 {
6319 ItemBase.m_DebugActionsMask &= ~mask;
6320 }
6321
6323 {
6325 {
6327 }
6328 else
6329 {
6331 }
6332 }
6333
6334
6336 {
6337 if (GetEconomyProfile())
6338 {
6339 float q_max = GetEconomyProfile().GetQuantityMax();
6340 if (q_max > 0)
6341 {
6342 float q_min = GetEconomyProfile().GetQuantityMin();
6343 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6344
6346 {
6347 ComponentEnergyManager comp = GetCompEM();
6349 {
6351 }
6352 }
6354 {
6356
6357 }
6358
6359 }
6360 }
6361 }
6362
6365 {
6366 EntityAI parent = GetHierarchyParent();
6367
6368 if (parent)
6369 {
6370 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6371 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6372 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6373 }
6374 }
6375
6378 {
6379 EntityAI parent = GetHierarchyParent();
6380
6381 if (parent)
6382 {
6383 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6384 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6385 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6386 }
6387 }
6388
6390 {
6391
6392
6393
6394
6396
6398 {
6399 if (ScriptInputUserData.CanStoreInputUserData())
6400 {
6401 ScriptInputUserData ctx = new ScriptInputUserData;
6407 ctx.
Write(use_stack_max);
6410
6412 {
6413 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6414 }
6415 }
6416 }
6417 else if (!
GetGame().IsMultiplayer())
6418 {
6420 }
6421 }
6422
6424 {
6426 }
6427
6429 {
6431 }
6432
6434 {
6436 }
6437
6439 {
6440
6441 return false;
6442 }
6443
6445 {
6446 return false;
6447 }
6448
6452 {
6453 return false;
6454 }
6455
6457 {
6458 return "";
6459 }
6460
6462
6464 {
6465 return false;
6466 }
6467
6469 {
6470 return true;
6471 }
6472
6473
6474
6476 {
6477 return true;
6478 }
6479
6481 {
6482 return true;
6483 }
6484
6486 {
6487 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6489 }
6490
6492 {
6494 }
6495
6497 {
6499 if (!is_being_placed)
6501 SetSynchDirty();
6502 }
6503
6504
6506
6508 {
6510 }
6511
6513 {
6515 }
6516
6518 {
6519 return 1;
6520 }
6521
6523 {
6524 return false;
6525 }
6526
6528 {
6530 SetSynchDirty();
6531 }
6532
6533
6534
6535
6536
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
6568 {
6569 super.OnMovedInsideCargo(container);
6570
6571 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6572 }
6573
6574 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6575 {
6576 super.EEItemLocationChanged(oldLoc,newLoc);
6577
6578 PlayerBase new_player = null;
6579 PlayerBase old_player = null;
6580
6581 if (newLoc.GetParent())
6582 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6583
6584 if (oldLoc.GetParent())
6585 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6586
6588 {
6589 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6590
6591 if (r_index >= 0)
6592 {
6593 InventoryLocation r_il = new InventoryLocation;
6594 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6595
6596 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6599 {
6600 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6601 }
6603 {
6604 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6605 }
6606
6607 }
6608 }
6609
6611 {
6612 if (new_player)
6613 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6614
6615 if (new_player == old_player)
6616 {
6617
6618 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6619 {
6621 {
6622 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6623 {
6624 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6625 }
6626 }
6627 else
6628 {
6629 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6630 }
6631 }
6632
6633 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6634 {
6635 int type = oldLoc.GetType();
6637 {
6638 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6639 }
6641 {
6642 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6643 }
6644 }
6645 if (!m_OldLocation)
6646 {
6647 m_OldLocation = new InventoryLocation;
6648 }
6649 m_OldLocation.Copy(oldLoc);
6650 }
6651 else
6652 {
6653 if (m_OldLocation)
6654 {
6655 m_OldLocation.Reset();
6656 }
6657 }
6658
6660 }
6661 else
6662 {
6663 if (new_player)
6664 {
6665 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6666 if (res_index >= 0)
6667 {
6668 InventoryLocation il = new InventoryLocation;
6669 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6671 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6674 {
6675 il.
GetParent().GetOnReleaseLock().Invoke(it);
6676 }
6678 {
6680 }
6681
6682 }
6683 }
6685 {
6686
6688 }
6689
6690 if (m_OldLocation)
6691 {
6692 m_OldLocation.Reset();
6693 }
6694 }
6695 }
6696
6697 override void EOnContact(IEntity other, Contact extra)
6698 {
6700 {
6701 int liquidType = -1;
6703 if (impactSpeed > 0.0)
6704 {
6706 #ifndef SERVER
6708 #else
6710 SetSynchDirty();
6711 #endif
6713 }
6714 }
6715
6716 #ifdef SERVER
6717 if (GetCompEM() && GetCompEM().IsPlugged())
6718 {
6719 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6720 GetCompEM().UnplugThis();
6721 }
6722 #endif
6723 }
6724
6726
6728 {
6730 }
6731
6733 {
6734
6735 }
6736
6738 {
6739 super.OnItemLocationChanged(old_owner, new_owner);
6740
6741 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6742 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6743
6744 if (!relatedPlayer && playerNew)
6745 relatedPlayer = playerNew;
6746
6747 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6748 {
6750 if (actionMgr)
6751 {
6752 ActionBase currentAction = actionMgr.GetRunningAction();
6753 if (currentAction)
6755 }
6756 }
6757
6758 Man ownerPlayerOld = null;
6759 Man ownerPlayerNew = null;
6760
6761 if (old_owner)
6762 {
6763 if (old_owner.
IsMan())
6764 {
6765 ownerPlayerOld = Man.Cast(old_owner);
6766 }
6767 else
6768 {
6769 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6770 }
6771 }
6772 else
6773 {
6775 {
6777
6778 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6779 {
6780 GetCompEM().UnplugThis();
6781 }
6782 }
6783 }
6784
6785 if (new_owner)
6786 {
6787 if (new_owner.
IsMan())
6788 {
6789 ownerPlayerNew = Man.Cast(new_owner);
6790 }
6791 else
6792 {
6793 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6794 }
6795 }
6796
6797 if (ownerPlayerOld != ownerPlayerNew)
6798 {
6799 if (ownerPlayerOld)
6800 {
6801 array<EntityAI> subItemsExit = new array<EntityAI>;
6803 for (int i = 0; i < subItemsExit.Count(); i++)
6804 {
6807 }
6808 }
6809
6810 if (ownerPlayerNew)
6811 {
6812 array<EntityAI> subItemsEnter = new array<EntityAI>;
6814 for (int j = 0; j < subItemsEnter.Count(); j++)
6815 {
6818 }
6819 }
6820 }
6821 else if (ownerPlayerNew != null)
6822 {
6823 PlayerBase nplayer;
6824 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6825 {
6826 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6828 for (int k = 0; k < subItemsUpdate.Count(); k++)
6829 {
6831 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6832 }
6833 }
6834 }
6835
6836 if (old_owner)
6837 old_owner.OnChildItemRemoved(this);
6838 if (new_owner)
6839 new_owner.OnChildItemReceived(this);
6840 }
6841
6842
6844 {
6845 super.EEDelete(parent);
6846 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6847 if (player)
6848 {
6850
6851 if (player.IsAlive())
6852 {
6853 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6854 if (r_index >= 0)
6855 {
6856 InventoryLocation r_il = new InventoryLocation;
6857 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6858
6859 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6862 {
6863 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6864 }
6866 {
6867 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6868 }
6869
6870 }
6871
6872 player.RemoveQuickBarEntityShortcut(this);
6873 }
6874 }
6875 }
6876
6878 {
6879 super.EEKilled(killer);
6880
6883 {
6884 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6885 {
6886 if (IsMagazine())
6887 {
6888 if (Magazine.Cast(this).GetAmmoCount() > 0)
6889 {
6891 }
6892 }
6893 else
6894 {
6896 }
6897 }
6898 }
6899 }
6900
6902 {
6903 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6904
6905 super.OnWasAttached(parent, slot_id);
6906
6909
6911 }
6912
6914 {
6915 super.OnWasDetached(parent, slot_id);
6916
6919 }
6920
6922 {
6923 int idx;
6926
6927 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6928 if (inventory_slots.Count() < 1)
6929 {
6930 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6931 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6932 }
6933 else
6934 {
6935 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6936 }
6937
6938 idx = inventory_slots.Find(slot);
6939 if (idx < 0)
6940 return "";
6941
6942 return attach_types.Get(idx);
6943 }
6944
6946 {
6947 int idx = -1;
6948 string slot;
6949
6952
6953 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6954 if (inventory_slots.Count() < 1)
6955 {
6956 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6957 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6958 }
6959 else
6960 {
6961 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6962 if (detach_types.Count() < 1)
6963 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6964 }
6965
6966 for (int i = 0; i < inventory_slots.Count(); i++)
6967 {
6968 slot = inventory_slots.Get(i);
6969 }
6970
6971 if (slot != "")
6972 {
6973 if (detach_types.Count() == 1)
6974 idx = 0;
6975 else
6976 idx = inventory_slots.Find(slot);
6977 }
6978 if (idx < 0)
6979 return "";
6980
6981 return detach_types.Get(idx);
6982 }
6983
6985 {
6986
6988
6989
6990 float min_time = 1;
6991 float max_time = 3;
6992 float delay = Math.RandomFloat(min_time, max_time);
6993
6994 explode_timer.Run(delay, this, "DoAmmoExplosion");
6995 }
6996
6998 {
6999 Magazine magazine = Magazine.Cast(this);
7000 int pop_sounds_count = 6;
7001 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7002
7003
7004 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7005 string sound_name = pop_sounds[ sound_idx ];
7007
7008
7009 magazine.ServerAddAmmoCount(-1);
7010
7011
7012 float min_temp_to_explode = 100;
7013
7014 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
7015 {
7017 }
7018 }
7019
7020
7021 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7022 {
7023 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7024
7025 const int CHANCE_DAMAGE_CARGO = 4;
7026 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7027 const int CHANCE_DAMAGE_NOTHING = 2;
7028
7030 {
7031 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7032 int chances;
7033 int rnd;
7034
7035 if (GetInventory().GetCargo())
7036 {
7037 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7038 rnd = Math.RandomInt(0,chances);
7039
7040 if (rnd < CHANCE_DAMAGE_CARGO)
7041 {
7043 }
7044 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7045 {
7047 }
7048 }
7049 else
7050 {
7051 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7052 rnd = Math.RandomInt(0,chances);
7053
7054 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7055 {
7057 }
7058 }
7059 }
7060 }
7061
7063 {
7064 if (GetInventory().GetCargo())
7065 {
7066 int item_count = GetInventory().GetCargo().GetItemCount();
7067 if (item_count > 0)
7068 {
7069 int random_pick = Math.RandomInt(0, item_count);
7071 if (!item.IsExplosive())
7072 {
7073 item.AddHealth("","",damage);
7074 return true;
7075 }
7076 }
7077 }
7078 return false;
7079 }
7080
7082 {
7083 int attachment_count = GetInventory().AttachmentCount();
7084 if (attachment_count > 0)
7085 {
7086 int random_pick = Math.RandomInt(0, attachment_count);
7087 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7088 if (!attachment.IsExplosive())
7089 {
7090 attachment.AddHealth("","",damage);
7091 return true;
7092 }
7093 }
7094 return false;
7095 }
7096
7098 {
7100 }
7101
7103 {
7105 return GetInventory().CanRemoveEntity();
7106
7107 return false;
7108 }
7109
7111 {
7112
7114 return false;
7115
7116
7118 return false;
7119
7120
7121
7123 if (delta == 0)
7124 return false;
7125
7126
7127 return true;
7128 }
7129
7131 {
7133 {
7134 if (ScriptInputUserData.CanStoreInputUserData())
7135 {
7136 ScriptInputUserData ctx = new ScriptInputUserData;
7141 ctx.
Write(destination_entity);
7145 }
7146 }
7147 else if (!
GetGame().IsMultiplayer())
7148 {
7150 }
7151 }
7152
7154 {
7155 float split_quantity_new;
7159 InventoryLocation loc = new InventoryLocation;
7160
7161 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7162 {
7164 split_quantity_new = stack_max;
7165 else
7167
7169 {
7170 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7171 if (new_item)
7172 {
7173 new_item.SetResultOfSplit(true);
7174 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7176 new_item.
SetQuantity(split_quantity_new,
false,
true);
7177 }
7178 }
7179 }
7180 else if (destination_entity && slot_id == -1)
7181 {
7182 if (quantity > stack_max)
7183 split_quantity_new = stack_max;
7184 else
7185 split_quantity_new = quantity;
7186
7188 {
7190 {
7193 }
7194
7195 if (new_item)
7196 {
7197 new_item.SetResultOfSplit(true);
7198 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7200 new_item.
SetQuantity(split_quantity_new,
false,
true);
7201 }
7202 }
7203 }
7204 else
7205 {
7206 if (stack_max != 0)
7207 {
7209 {
7211 }
7212
7213 if (split_quantity_new == 0)
7214 {
7215 if (!
GetGame().IsMultiplayer())
7216 player.PhysicalPredictiveDropItem(this);
7217 else
7218 player.ServerDropEntity(this);
7219 return;
7220 }
7221
7223 {
7225
7226 if (new_item)
7227 {
7228 new_item.SetResultOfSplit(true);
7229 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7232 new_item.PlaceOnSurface();
7233 }
7234 }
7235 }
7236 }
7237 }
7238
7240 {
7241 float split_quantity_new;
7245 InventoryLocation loc = new InventoryLocation;
7246
7247 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7248 {
7250 split_quantity_new = stack_max;
7251 else
7253
7255 {
7256 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7257 if (new_item)
7258 {
7259 new_item.SetResultOfSplit(true);
7260 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7262 new_item.
SetQuantity(split_quantity_new,
false,
true);
7263 }
7264 }
7265 }
7266 else if (destination_entity && slot_id == -1)
7267 {
7268 if (quantity > stack_max)
7269 split_quantity_new = stack_max;
7270 else
7271 split_quantity_new = quantity;
7272
7274 {
7276 {
7279 }
7280
7281 if (new_item)
7282 {
7283 new_item.SetResultOfSplit(true);
7284 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7286 new_item.
SetQuantity(split_quantity_new,
false,
true);
7287 }
7288 }
7289 }
7290 else
7291 {
7292 if (stack_max != 0)
7293 {
7295 {
7297 }
7298
7300 {
7302
7303 if (new_item)
7304 {
7305 new_item.SetResultOfSplit(true);
7306 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7309 new_item.PlaceOnSurface();
7310 }
7311 }
7312 }
7313 }
7314 }
7315
7317 {
7319 {
7320 if (ScriptInputUserData.CanStoreInputUserData())
7321 {
7322 ScriptInputUserData ctx = new ScriptInputUserData;
7327 dst.WriteToContext(ctx);
7329 }
7330 }
7331 else if (!
GetGame().IsMultiplayer())
7332 {
7334 }
7335 }
7336
7338 {
7340 {
7341 if (ScriptInputUserData.CanStoreInputUserData())
7342 {
7343 ScriptInputUserData ctx = new ScriptInputUserData;
7348 ctx.
Write(destination_entity);
7354 }
7355 }
7356 else if (!
GetGame().IsMultiplayer())
7357 {
7359 }
7360 }
7361
7363 {
7365 }
7366
7368 {
7370 float split_quantity_new;
7372 if (dst.IsValid())
7373 {
7374 int slot_id = dst.GetSlot();
7376
7377 if (quantity > stack_max)
7378 split_quantity_new = stack_max;
7379 else
7380 split_quantity_new = quantity;
7381
7383 {
7385
7386 if (new_item)
7387 {
7388 new_item.SetResultOfSplit(true);
7389 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7391 new_item.
SetQuantity(split_quantity_new,
false,
true);
7392 }
7393
7394 return new_item;
7395 }
7396 }
7397
7398 return null;
7399 }
7400
7402 {
7404 float split_quantity_new;
7406 if (destination_entity)
7407 {
7409 if (quantity > stackable)
7410 split_quantity_new = stackable;
7411 else
7412 split_quantity_new = quantity;
7413
7415 {
7416 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7417 if (new_item)
7418 {
7419 new_item.SetResultOfSplit(true);
7420 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7422 new_item.
SetQuantity(split_quantity_new,
false,
true);
7423 }
7424 }
7425 }
7426 }
7427
7429 {
7431 {
7432 if (ScriptInputUserData.CanStoreInputUserData())
7433 {
7434 ScriptInputUserData ctx = new ScriptInputUserData;
7439 ItemBase destination_entity =
this;
7440 ctx.
Write(destination_entity);
7444 }
7445 }
7446 else if (!
GetGame().IsMultiplayer())
7447 {
7449 }
7450 }
7451
7453 {
7455 float split_quantity_new;
7457 if (player)
7458 {
7460 if (quantity > stackable)
7461 split_quantity_new = stackable;
7462 else
7463 split_quantity_new = quantity;
7464
7466 {
7467 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7468 new_item =
ItemBase.Cast(in_hands);
7469 if (new_item)
7470 {
7471 new_item.SetResultOfSplit(true);
7472 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7474 new_item.SetQuantity(split_quantity_new, false, true);
7475 }
7476 }
7477 }
7478 }
7479
7481 {
7483 float split_quantity_new = Math.Floor(quantity * 0.5);
7484
7486 return;
7487
7489
7490 if (new_item)
7491 {
7492 if (new_item.GetQuantityMax() < split_quantity_new)
7493 {
7494 split_quantity_new = new_item.GetQuantityMax();
7495 }
7496
7497 new_item.SetResultOfSplit(true);
7498 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7499
7501 {
7504 }
7505 else
7506 {
7508 new_item.
SetQuantity(split_quantity_new,
false,
true);
7509 }
7510 }
7511 }
7512
7514 {
7516 float split_quantity_new = Math.Floor(quantity / 2);
7517
7519 return;
7520
7521 InventoryLocation invloc = new InventoryLocation;
7523
7525 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7526
7527 if (new_item)
7528 {
7529 if (new_item.GetQuantityMax() < split_quantity_new)
7530 {
7531 split_quantity_new = new_item.GetQuantityMax();
7532 }
7534 {
7537 }
7538 else if (split_quantity_new > 1)
7539 {
7541 new_item.
SetQuantity(split_quantity_new,
false,
true);
7542 }
7543 }
7544 }
7545
7548 {
7549 SetWeightDirty();
7551
7552 if (parent)
7553 parent.OnAttachmentQuantityChangedEx(this, delta);
7554
7556 {
7558 {
7560 }
7562 {
7563 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7565 }
7566 }
7567
7568 }
7569
7572 {
7573
7574 }
7575
7578 {
7580 }
7581
7583 {
7584 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7585
7587 {
7588 if (newLevel == GameConstants.STATE_RUINED)
7589 {
7591 EntityAI parent = GetHierarchyParent();
7592 if (parent && parent.IsFireplace())
7593 {
7594 CargoBase cargo = GetInventory().GetCargo();
7595 if (cargo)
7596 {
7598 {
7600 }
7601 }
7602 }
7603 }
7604
7606 {
7607
7609 return;
7610 }
7611
7612 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7613 {
7615 }
7616 }
7617 }
7618
7619
7621 {
7622 super.OnRightClick();
7623
7625 {
7627 {
7628 if (ScriptInputUserData.CanStoreInputUserData())
7629 {
7630 EntityAI root = GetHierarchyRoot();
7631 Man playerOwner = GetHierarchyRootPlayer();
7632 InventoryLocation dst = new InventoryLocation;
7633
7634
7635 if (!playerOwner && root && root == this)
7636 {
7638 }
7639 else
7640 {
7641
7642 GetInventory().GetCurrentInventoryLocation(dst);
7644 {
7647 {
7649 }
7650 else
7651 {
7653
7654
7655 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7656 {
7658 }
7659 else
7660 {
7661 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7662 }
7663 }
7664 }
7665 }
7666
7667 ScriptInputUserData ctx = new ScriptInputUserData;
7675 }
7676 }
7677 else if (!
GetGame().IsMultiplayer())
7678 {
7680 }
7681 }
7682 }
7683
7685 {
7686 if (root)
7687 {
7688 vector m4[4];
7689 root.GetTransform(m4);
7690 dst.SetGround(this, m4);
7691 }
7692 else
7693 {
7694 GetInventory().GetCurrentInventoryLocation(dst);
7695 }
7696 }
7697
7698 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7699 {
7700
7701 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7702 return false;
7703
7704 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7705 return false;
7706
7707
7709 return false;
7710
7711
7712 Magazine mag = Magazine.Cast(this);
7713 if (mag)
7714 {
7715 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7716 return false;
7717
7718 if (stack_max_limit)
7719 {
7720 Magazine other_mag = Magazine.Cast(other_item);
7721 if (other_item)
7722 {
7723 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7724 return false;
7725 }
7726
7727 }
7728 }
7729 else
7730 {
7731
7733 return false;
7734
7736 return false;
7737 }
7738
7739 PlayerBase player = null;
7740 if (CastTo(player, GetHierarchyRootPlayer()))
7741 {
7742 if (player.GetInventory().HasAttachment(this))
7743 return false;
7744
7745 if (player.IsItemsToDelete())
7746 return false;
7747 }
7748
7749 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7750 return false;
7751
7752 int slotID;
7754 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7755 return false;
7756
7757 return true;
7758 }
7759
7761 {
7763 }
7764
7766 {
7767 return m_IsResultOfSplit;
7768 }
7769
7771 {
7772 m_IsResultOfSplit = value;
7773 }
7774
7776 {
7778 }
7779
7781 {
7782 float other_item_quantity = other_item.GetQuantity();
7783 float this_free_space;
7784
7786
7788
7789 if (other_item_quantity > this_free_space)
7790 {
7791 return this_free_space;
7792 }
7793 else
7794 {
7795 return other_item_quantity;
7796 }
7797 }
7798
7800 {
7802 }
7803
7805 {
7807 return;
7808
7809 if (!IsMagazine() && other_item)
7810 {
7812 if (quantity_used != 0)
7813 {
7814 float hp1 = GetHealth01("","");
7815 float hp2 = other_item.GetHealth01("","");
7816 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7817 hpResult = hpResult / (
GetQuantity() + quantity_used);
7818
7819 hpResult *= GetMaxHealth();
7820 Math.Round(hpResult);
7821 SetHealth("", "Health", hpResult);
7822
7824 other_item.AddQuantity(-quantity_used);
7825 }
7826 }
7828 }
7829
7831 {
7832 #ifdef SERVER
7833 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7834 GetHierarchyParent().IncreaseLifetimeUp();
7835 #endif
7836 };
7837
7839 {
7840 PlayerBase p = PlayerBase.Cast(player);
7841
7842 array<int> recipesIds = p.m_Recipes;
7843 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7844 if (moduleRecipesManager)
7845 {
7846 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7847 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7848 }
7849
7850 for (int i = 0;i < recipesIds.Count(); i++)
7851 {
7852 int key = recipesIds.Get(i);
7853 string recipeName = moduleRecipesManager.GetRecipeName(key);
7855 }
7856 }
7857
7858
7859 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7860 {
7861 super.GetDebugActions(outputList);
7862
7863
7869
7870
7875
7880
7881
7885
7886
7888 {
7892 }
7893
7896
7897
7901
7903
7904 InventoryLocation loc = new InventoryLocation();
7905 GetInventory().GetCurrentInventoryLocation(loc);
7907 {
7908 if (Gizmo_IsSupported())
7911 }
7912
7914 }
7915
7916
7917
7918
7920 {
7921 super.OnAction(action_id, player, ctx);
7922
7924 {
7925 switch (action_id)
7926 {
7929 return true;
7932 return true;
7933 }
7934 }
7935
7937 {
7938 switch (action_id)
7939 {
7941 Delete();
7942 return true;
7943 }
7944 }
7945
7946 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7947 {
7948 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7949 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7950 PlayerBase p = PlayerBase.Cast(player);
7951 if (
EActions.RECIPES_RANGE_START < 1000)
7952 {
7953 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7954 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7955 }
7956 }
7957 #ifndef SERVER
7958 else if (action_id ==
EActions.WATCH_PLAYER)
7959 {
7960 PluginDeveloper.SetDeveloperItemClientEx(player);
7961 }
7962 #endif
7964 {
7965 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7966 {
7967 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7968 OnDebugButtonPressServer(id + 1);
7969 }
7970
7971 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7972 {
7973 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7975 }
7976
7977 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7978 {
7979 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7981 }
7982
7983 else if (action_id ==
EActions.ADD_QUANTITY)
7984 {
7985 if (IsMagazine())
7986 {
7987 Magazine mag = Magazine.Cast(this);
7988 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7989 }
7990 else
7991 {
7993 }
7994
7995 if (m_EM)
7996 {
7997 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7998 }
7999
8000 }
8001
8002 else if (action_id ==
EActions.REMOVE_QUANTITY)
8003 {
8004 if (IsMagazine())
8005 {
8006 Magazine mag2 = Magazine.Cast(this);
8007 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8008 }
8009 else
8010 {
8012 }
8013 if (m_EM)
8014 {
8015 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8016 }
8017
8018 }
8019
8020 else if (action_id ==
EActions.SET_QUANTITY_0)
8021 {
8023
8024 if (m_EM)
8025 {
8026 m_EM.SetEnergy(0);
8027 }
8028 }
8029
8030 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8031 {
8033
8034 if (m_EM)
8035 {
8036 m_EM.SetEnergy(m_EM.GetEnergyMax());
8037 }
8038 }
8039
8040 else if (action_id ==
EActions.ADD_HEALTH)
8041 {
8042 AddHealth("","",GetMaxHealth("","Health")/5);
8043 }
8044 else if (action_id ==
EActions.REMOVE_HEALTH)
8045 {
8046 AddHealth("","",-GetMaxHealth("","Health")/5);
8047 }
8048 else if (action_id ==
EActions.DESTROY_HEALTH)
8049 {
8050 SetHealth01("","",0);
8051 }
8052 else if (action_id ==
EActions.WATCH_ITEM)
8053 {
8055 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8056 #ifdef DEVELOPER
8057 SetDebugDeveloper_item(this);
8058 #endif
8059 }
8060
8061 else if (action_id ==
EActions.ADD_TEMPERATURE)
8062 {
8063 AddTemperature(20);
8064
8065 }
8066
8067 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8068 {
8069 AddTemperature(-20);
8070
8071 }
8072
8073 else if (action_id ==
EActions.FLIP_FROZEN)
8074 {
8075 SetFrozen(!GetIsFrozen());
8076
8077 }
8078
8079 else if (action_id ==
EActions.ADD_WETNESS)
8080 {
8082
8083 }
8084
8085 else if (action_id ==
EActions.REMOVE_WETNESS)
8086 {
8088
8089 }
8090
8091 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8092 {
8095
8096
8097 }
8098
8099 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8100 {
8103 }
8104
8105 else if (action_id ==
EActions.MAKE_SPECIAL)
8106 {
8107 auto debugParams = DebugSpawnParams.WithPlayer(player);
8108 OnDebugSpawnEx(debugParams);
8109 }
8110
8111 }
8112
8113
8114 return false;
8115 }
8116
8117
8118
8119
8123
8126
8127
8128
8130 {
8131 return false;
8132 }
8133
8134
8136 {
8137 return true;
8138 }
8139
8140
8142 {
8143 return true;
8144 }
8145
8146
8147
8149 {
8150 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8152 }
8153
8156 {
8157 return null;
8158 }
8159
8161 {
8162 return false;
8163 }
8164
8166 {
8167 return false;
8168 }
8169
8173
8174
8176 {
8177 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8178 return module_repairing.CanRepair(this, item_repair_kit);
8179 }
8180
8181
8182 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8183 {
8184 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8185 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8186 }
8187
8188
8190 {
8191
8192
8193
8194
8195
8196
8197
8198
8199 return 1;
8200 }
8201
8202
8203
8205 {
8207 }
8208
8209
8210
8212 {
8214 }
8215
8216
8225 {
8226 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8227
8228 if (player)
8229 {
8230 player.MessageStatus(text);
8231 }
8232 }
8233
8234
8243 {
8244 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8245
8246 if (player)
8247 {
8248 player.MessageAction(text);
8249 }
8250 }
8251
8252
8261 {
8262 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8263
8264 if (player)
8265 {
8266 player.MessageFriendly(text);
8267 }
8268 }
8269
8270
8279 {
8280 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8281
8282 if (player)
8283 {
8284 player.MessageImportant(text);
8285 }
8286 }
8287
8289 {
8290 return true;
8291 }
8292
8293
8294 override bool KindOf(
string tag)
8295 {
8296 bool found = false;
8297 string item_name = this.
GetType();
8300
8301 int array_size = item_tag_array.Count();
8302 for (int i = 0; i < array_size; i++)
8303 {
8304 if (item_tag_array.Get(i) == tag)
8305 {
8306 found = true;
8307 break;
8308 }
8309 }
8310 return found;
8311 }
8312
8313
8315 {
8316
8317 super.OnRPC(sender, rpc_type,ctx);
8318
8319
8320 switch (rpc_type)
8321 {
8322 #ifndef SERVER
8323 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8324 Param2<bool, string> p = new Param2<bool, string>(false, "");
8325
8327 return;
8328
8329 bool play = p.param1;
8330 string soundSet = p.param2;
8331
8332 if (play)
8333 {
8335 {
8337 {
8339 }
8340 }
8341 else
8342 {
8344 }
8345 }
8346 else
8347 {
8349 }
8350
8351 break;
8352 #endif
8353
8354 }
8355
8357 {
8359 }
8360 }
8361
8362
8363
8364
8366 {
8367 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8368 return plugin.GetID(
name);
8369 }
8370
8372 {
8373 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8374 return plugin.GetName(id);
8375 }
8376
8379 {
8380
8381
8382 int varFlags;
8383 if (!ctx.
Read(varFlags))
8384 return;
8385
8386 if (varFlags & ItemVariableFlags.FLOAT)
8387 {
8389 }
8390 }
8391
8393 {
8394
8395 super.SerializeNumericalVars(floats_out);
8396
8397
8398
8400 {
8402 }
8403
8405 {
8407 }
8408
8410 {
8412 }
8413
8415 {
8420 }
8421
8423 {
8425 }
8426 }
8427
8429 {
8430
8431 super.DeSerializeNumericalVars(floats);
8432
8433
8434 int index = 0;
8435 int mask = Math.Round(floats.Get(index));
8436
8437 index++;
8438
8440 {
8442 {
8444 }
8445 else
8446 {
8447 float quantity = floats.Get(index);
8449 }
8450 index++;
8451 }
8452
8454 {
8455 float wet = floats.Get(index);
8457 index++;
8458 }
8459
8461 {
8462 int liquidtype = Math.Round(floats.Get(index));
8464 index++;
8465 }
8466
8468 {
8470 index++;
8472 index++;
8474 index++;
8476 index++;
8477 }
8478
8480 {
8481 int cleanness = Math.Round(floats.Get(index));
8483 index++;
8484 }
8485 }
8486
8488 {
8489 super.WriteVarsToCTX(ctx);
8490
8491
8493 {
8495 }
8496
8498 {
8500 }
8501
8503 {
8505 }
8506
8508 {
8509 int r,g,b,a;
8515 }
8516
8518 {
8520 }
8521 }
8522
8524 {
8525 if (!super.ReadVarsFromCTX(ctx,version))
8526 return false;
8527
8528 int intValue;
8529 float value;
8530
8531 if (version < 140)
8532 {
8533 if (!ctx.
Read(intValue))
8534 return false;
8535
8536 m_VariablesMask = intValue;
8537 }
8538
8540 {
8541 if (!ctx.
Read(value))
8542 return false;
8543
8545 {
8547 }
8548 else
8549 {
8551 }
8552 }
8553
8554 if (version < 140)
8555 {
8557 {
8558 if (!ctx.
Read(value))
8559 return false;
8560 SetTemperatureDirect(value);
8561 }
8562 }
8563
8565 {
8566 if (!ctx.
Read(value))
8567 return false;
8569 }
8570
8572 {
8573 if (!ctx.
Read(intValue))
8574 return false;
8576 }
8577
8579 {
8580 int r,g,b,a;
8582 return false;
8584 return false;
8586 return false;
8588 return false;
8589
8591 }
8592
8594 {
8595 if (!ctx.
Read(intValue))
8596 return false;
8598 }
8599
8600 if (version >= 138 && version < 140)
8601 {
8603 {
8604 if (!ctx.
Read(intValue))
8605 return false;
8606 SetFrozen(intValue);
8607 }
8608 }
8609
8610 return true;
8611 }
8612
8613
8615 {
8618 {
8620 }
8621
8622 if (!super.OnStoreLoad(ctx, version))
8623 {
8625 return false;
8626 }
8627
8628 if (version >= 114)
8629 {
8630 bool hasQuickBarIndexSaved;
8631
8632 if (!ctx.
Read(hasQuickBarIndexSaved))
8633 {
8635 return false;
8636 }
8637
8638 if (hasQuickBarIndexSaved)
8639 {
8640 int itmQBIndex;
8641
8642
8643 if (!ctx.
Read(itmQBIndex))
8644 {
8646 return false;
8647 }
8648
8649 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8650 if (itmQBIndex != -1 && parentPlayer)
8651 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8652 }
8653 }
8654 else
8655 {
8656
8657 PlayerBase player;
8658 int itemQBIndex;
8659 if (version ==
int.
MAX)
8660 {
8661 if (!ctx.
Read(itemQBIndex))
8662 {
8664 return false;
8665 }
8666 }
8667 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8668 {
8669
8670 if (!ctx.
Read(itemQBIndex))
8671 {
8673 return false;
8674 }
8675 if (itemQBIndex != -1 && player)
8676 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8677 }
8678 }
8679
8680 if (version < 140)
8681 {
8682
8683 if (!LoadVariables(ctx, version))
8684 {
8686 return false;
8687 }
8688 }
8689
8690
8692 {
8694 return false;
8695 }
8696 if (version >= 132)
8697 {
8699 if (raib)
8700 {
8702 {
8704 return false;
8705 }
8706 }
8707 }
8708
8710 return true;
8711 }
8712
8713
8714
8716 {
8717 super.OnStoreSave(ctx);
8718
8719 PlayerBase player;
8720 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8721 {
8723
8724 int itemQBIndex = -1;
8725 itemQBIndex = player.FindQuickBarEntityIndex(this);
8726 ctx.
Write(itemQBIndex);
8727 }
8728 else
8729 {
8731 }
8732
8734
8736 if (raib)
8737 {
8739 }
8740 }
8741
8742
8744 {
8745 super.AfterStoreLoad();
8746
8748 {
8750 }
8751
8753 {
8756 }
8757 }
8758
8760 {
8761 super.EEOnAfterLoad();
8762
8764 {
8766 }
8767
8770 }
8771
8773 {
8774 return false;
8775 }
8776
8777
8778
8780 {
8782 {
8783 #ifdef PLATFORM_CONSOLE
8784
8786 {
8788 if (menu)
8789 {
8791 }
8792 }
8793 #endif
8794 }
8795
8797 {
8800 }
8801
8803 {
8804 SetWeightDirty();
8806 }
8808 {
8811 }
8812
8814 {
8817 }
8819 {
8822 }
8823
8824 super.OnVariablesSynchronized();
8825 }
8826
8827
8828
8830 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8831 {
8832 if (!IsServerCheck(allow_client))
8833 return false;
8834
8836 return false;
8837
8840
8841 if (value <= (min + 0.001))
8842 value = min;
8843
8844 if (value == min)
8845 {
8846 if (destroy_config)
8847 {
8848 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8849 if (dstr)
8850 {
8852 this.Delete();
8853 return true;
8854 }
8855 }
8856 else if (destroy_forced)
8857 {
8859 this.Delete();
8860 return true;
8861 }
8862
8864 }
8865
8868
8870 {
8872
8873 if (delta)
8875 }
8876
8878
8879 return false;
8880 }
8881
8882
8884 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8885 {
8887 }
8888
8890 {
8893 }
8894
8896 {
8899 }
8900
8902 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8903 {
8904 float value_clamped = Math.Clamp(value, 0, 1);
8906 SetQuantity(result, destroy_config, destroy_forced);
8907 }
8908
8909
8912 {
8914 }
8915
8917 {
8919 }
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8931 {
8932 int slot = -1;
8933 if (GetInventory())
8934 {
8935 InventoryLocation il = new InventoryLocation;
8936 GetInventory().GetCurrentInventoryLocation(il);
8938 }
8939
8941 }
8942
8944 {
8945 float quantity_max = 0;
8946
8948 {
8949 if (attSlotID != -1)
8950 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8951
8952 if (quantity_max <= 0)
8954 }
8955
8956 if (quantity_max <= 0)
8958
8959 return quantity_max;
8960 }
8961
8963 {
8965 }
8966
8968 {
8970 }
8971
8972
8974 {
8976 }
8977
8979 {
8981 }
8982
8984 {
8986 }
8987
8988
8990 {
8991
8992 float weightEx = GetWeightEx();
8993 float special = GetInventoryAndCargoWeight();
8994 return weightEx - special;
8995 }
8996
8997
8999 {
9001 }
9002
9004 {
9006 {
9007 #ifdef DEVELOPER
9008 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9009 {
9010 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9012 }
9013 #endif
9014
9016 }
9017 else if (HasEnergyManager())
9018 {
9019 #ifdef DEVELOPER
9020 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9021 {
9022 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9023 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9024 }
9025 #endif
9026 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
9027 }
9028 else
9029 {
9030 #ifdef DEVELOPER
9031 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9032 {
9033 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9034 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9035 }
9036 #endif
9037 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9038 }
9039 }
9040
9043 {
9044 int item_count = 0;
9046
9047 if (GetInventory().GetCargo() != NULL)
9048 {
9049 item_count = GetInventory().GetCargo().GetItemCount();
9050 }
9051
9052 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9053 {
9054 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9055 if (item)
9056 item_count += item.GetNumberOfItems();
9057 }
9058 return item_count;
9059 }
9060
9063 {
9064 float weight = 0;
9065 float wetness = 1;
9066 if (include_wetness)
9069 {
9070 weight = wetness * m_ConfigWeight;
9071 }
9073 {
9074 weight = 1;
9075 }
9076 return weight;
9077 }
9078
9079
9080
9082 {
9083 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9084 {
9085 GameInventory inv = GetInventory();
9086 array<EntityAI> items = new array<EntityAI>;
9088 for (int i = 0; i < items.Count(); i++)
9089 {
9091 if (item)
9092 {
9094 }
9095 }
9096 }
9097 }
9098
9099
9100
9101
9103 {
9104 float energy = 0;
9105 if (HasEnergyManager())
9106 {
9107 energy = GetCompEM().GetEnergy();
9108 }
9109 return energy;
9110 }
9111
9112
9114 {
9115 super.OnEnergyConsumed();
9116
9118 }
9119
9121 {
9122 super.OnEnergyAdded();
9123
9125 }
9126
9127
9129 {
9130 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9131 {
9133 {
9134 float energy_0to1 = GetCompEM().GetEnergy0To1();
9136 }
9137 }
9138 }
9139
9140
9142 {
9143 return ConfigGetFloat("heatIsolation");
9144 }
9145
9147 {
9149 }
9150
9152 {
9153 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9154 if (
GetGame().ConfigIsExisting(paramPath))
9156
9157 return 0.0;
9158 }
9159
9161 {
9162 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9163 if (
GetGame().ConfigIsExisting(paramPath))
9165
9166 return 0.0;
9167 }
9168
9169 override void SetWet(
float value,
bool allow_client =
false)
9170 {
9171 if (!IsServerCheck(allow_client))
9172 return;
9173
9176
9178
9179 m_VarWet = Math.Clamp(value, min, max);
9180
9182 {
9185 }
9186 }
9187
9188 override void AddWet(
float value)
9189 {
9191 }
9192
9194 {
9196 }
9197
9199 {
9201 }
9202
9204 {
9206 }
9207
9209 {
9211 }
9212
9214 {
9216 }
9217
9219 {
9222 if (newLevel != oldLevel)
9223 {
9225 }
9226 }
9227
9229 {
9230 SetWeightDirty();
9231 }
9232
9234 {
9235 return GetWetLevelInternal(
m_VarWet);
9236 }
9237
9238
9239
9241 {
9243 }
9244
9246 {
9248 }
9249
9251 {
9253 }
9254
9256 {
9258 }
9259
9260
9261
9263 {
9264 if (ConfigIsExisting("itemModelLength"))
9265 {
9266 return ConfigGetFloat("itemModelLength");
9267 }
9268 return 0;
9269 }
9270
9272 {
9273 if (ConfigIsExisting("itemAttachOffset"))
9274 {
9275 return ConfigGetFloat("itemAttachOffset");
9276 }
9277 return 0;
9278 }
9279
9280 override void SetCleanness(
int value,
bool allow_client =
false)
9281 {
9282 if (!IsServerCheck(allow_client))
9283 return;
9284
9286
9288
9291 }
9292
9294 {
9296 }
9297
9299 {
9300 return true;
9301 }
9302
9303
9304
9305
9307 {
9309 }
9310
9312 {
9314 }
9315
9316
9317
9318
9319 override void SetColor(
int r,
int g,
int b,
int a)
9320 {
9326 }
9328 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9329 {
9334 }
9335
9337 {
9339 }
9340
9343 {
9344 int r,g,b,a;
9346 r = r/255;
9347 g = g/255;
9348 b = b/255;
9349 a = a/255;
9350 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9351 }
9352
9353
9354
9355 override void SetLiquidType(
int value,
bool allow_client =
false)
9356 {
9357 if (!IsServerCheck(allow_client))
9358 return;
9359
9364 }
9365
9367 {
9368 return ConfigGetInt("varLiquidTypeInit");
9369 }
9370
9372 {
9374 }
9375
9377 {
9379 SetFrozen(false);
9380 }
9381
9384 {
9385 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9386 }
9387
9388
9391 {
9392 PlayerBase nplayer;
9393 if (PlayerBase.CastTo(nplayer, player))
9394 {
9396
9397 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9398 }
9399 }
9400
9401
9404 {
9405 PlayerBase nplayer;
9406 if (PlayerBase.CastTo(nplayer,player))
9407 {
9408
9409 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9410
9411 }
9412
9413
9414 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9415
9416
9417 if (HasEnergyManager())
9418 {
9419 GetCompEM().UpdatePlugState();
9420 }
9421 }
9422
9423
9425 {
9426 super.OnPlacementStarted(player);
9427
9429 }
9430
9431 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9432 {
9434 {
9435 m_AdminLog.OnPlacementComplete(player,
this);
9436 }
9437
9438 super.OnPlacementComplete(player, position, orientation);
9439 }
9440
9441
9442
9443
9444
9446 {
9448 {
9449 return true;
9450 }
9451 else
9452 {
9453 return false;
9454 }
9455 }
9456
9457
9459 {
9461 {
9463 }
9464 }
9465
9466
9468 {
9470 }
9471
9473 {
9475 }
9476
9477 override void InsertAgent(
int agent,
float count = 1)
9478 {
9479 if (count < 1)
9480 return;
9481
9483 }
9484
9487 {
9489 }
9490
9491
9493 {
9495 }
9496
9497
9498
9499
9500
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
9539 {
9541 return false;
9542 return true;
9543 }
9544
9546 {
9547
9549 }
9550
9551
9554 {
9555 super.CheckForRoofLimited(timeTresholdMS);
9556
9558 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9559 {
9560 m_PreviousRoofTestTime = time;
9561 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9562 }
9563 }
9564
9565
9567 {
9569 {
9570 return 0;
9571 }
9572
9573 if (GetInventory().GetAttachmentSlotsCount() != 0)
9574 {
9575 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9576 if (filter)
9577 return filter.GetProtectionLevel(type, false, system);
9578 else
9579 return 0;
9580 }
9581
9582 string subclassPath, entryName;
9583
9584 switch (type)
9585 {
9587 entryName = "biological";
9588 break;
9590 entryName = "chemical";
9591 break;
9592 default:
9593 entryName = "biological";
9594 break;
9595 }
9596
9597 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9598
9600 }
9601
9602
9603
9606 {
9607 if (!IsMagazine())
9609
9611 }
9612
9613
9614
9615
9616
9621 {
9622 return true;
9623 }
9624
9626 {
9628 }
9629
9630
9631
9632
9633
9635 {
9636 if (parent)
9637 {
9638 if (parent.IsInherited(DayZInfected))
9639 return true;
9640
9641 if (!parent.IsRuined())
9642 return true;
9643 }
9644
9645 return true;
9646 }
9647
9649 {
9650 if (!super.CanPutAsAttachment(parent))
9651 {
9652 return false;
9653 }
9654
9655 if (!IsRuined() && !parent.IsRuined())
9656 {
9657 return true;
9658 }
9659
9660 return false;
9661 }
9662
9664 {
9665
9666
9667
9668
9669 return super.CanReceiveItemIntoCargo(item);
9670 }
9671
9673 {
9674
9675
9676
9677
9678 GameInventory attachmentInv = attachment.GetInventory();
9680 {
9681 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9682 return false;
9683 }
9684
9685 InventoryLocation loc = new InventoryLocation();
9686 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9687 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9688 return false;
9689
9690 return super.CanReceiveAttachment(attachment, slotId);
9691 }
9692
9694 {
9695 if (!super.CanReleaseAttachment(attachment))
9696 return false;
9697
9698 return GetInventory().AreChildrenAccessible();
9699 }
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9722 {
9723 int id = muzzle_owner.GetMuzzleID();
9724 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9725
9726 if (WPOF_array)
9727 {
9728 for (int i = 0; i < WPOF_array.Count(); i++)
9729 {
9730 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9731
9732 if (WPOF)
9733 {
9734 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9735 }
9736 }
9737 }
9738 }
9739
9740
9742 {
9743 int id = muzzle_owner.GetMuzzleID();
9745
9746 if (WPOBE_array)
9747 {
9748 for (int i = 0; i < WPOBE_array.Count(); i++)
9749 {
9750 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9751
9752 if (WPOBE)
9753 {
9754 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9755 }
9756 }
9757 }
9758 }
9759
9760
9762 {
9763 int id = muzzle_owner.GetMuzzleID();
9764 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9765
9766 if (WPOOH_array)
9767 {
9768 for (int i = 0; i < WPOOH_array.Count(); i++)
9769 {
9770 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9771
9772 if (WPOOH)
9773 {
9774 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9775 }
9776 }
9777 }
9778 }
9779
9780
9782 {
9783 int id = muzzle_owner.GetMuzzleID();
9784 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9785
9786 if (WPOOH_array)
9787 {
9788 for (int i = 0; i < WPOOH_array.Count(); i++)
9789 {
9790 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9791
9792 if (WPOOH)
9793 {
9794 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9795 }
9796 }
9797 }
9798 }
9799
9800
9802 {
9803 int id = muzzle_owner.GetMuzzleID();
9804 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9805
9806 if (WPOOH_array)
9807 {
9808 for (int i = 0; i < WPOOH_array.Count(); i++)
9809 {
9810 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9811
9812 if (WPOOH)
9813 {
9814 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9815 }
9816 }
9817 }
9818 }
9819
9820
9821
9823 {
9825 {
9826 return true;
9827 }
9828
9829 return false;
9830 }
9831
9833 {
9835 {
9836 return true;
9837 }
9838
9839 return false;
9840 }
9841
9843 {
9845 {
9846 return true;
9847 }
9848
9849 return false;
9850 }
9851
9853 {
9854 return false;
9855 }
9856
9859 {
9860 return UATimeSpent.DEFAULT_DEPLOY;
9861 }
9862
9863
9864
9865
9867 {
9869 SetSynchDirty();
9870 }
9871
9873 {
9875 }
9876
9877
9879 {
9880 return false;
9881 }
9882
9885 {
9886 string att_type = "None";
9887
9888 if (ConfigIsExisting("soundAttType"))
9889 {
9890 att_type = ConfigGetString("soundAttType");
9891 }
9892
9894 }
9895
9897 {
9899 }
9900
9901
9902
9903
9904
9910
9912 {
9915
9917 }
9918
9919
9921 {
9923 return;
9924
9926
9929
9932
9933 SoundParameters params = new SoundParameters();
9937 }
9938
9939
9941 {
9943 return;
9944
9946 SetSynchDirty();
9947
9950 }
9951
9952
9954 {
9956 return;
9957
9959 SetSynchDirty();
9960
9963 }
9964
9966 {
9968 }
9969
9971 {
9973 }
9974
9977 {
9978 if (!
GetGame().IsDedicatedServer())
9979 {
9980 if (ConfigIsExisting("attachSoundSet"))
9981 {
9982 string cfg_path = "";
9983 string soundset = "";
9985
9988 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9989 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9990
9991 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9992 {
9993 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9994 {
9995 if (cfg_slot_array[i] == slot_type)
9996 {
9997 soundset = cfg_soundset_array[i];
9998 break;
9999 }
10000 }
10001 }
10002
10003 if (soundset != "")
10004 {
10005 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10007 }
10008 }
10009 }
10010 }
10011
10013 {
10014
10015 }
10016
10017 void OnApply(PlayerBase player);
10018
10020 {
10021 return 1.0;
10022 };
10023
10025 {
10027 }
10028
10030 {
10032 }
10033
10035
10037 {
10038 SetDynamicPhysicsLifeTime(0.01);
10040 }
10041
10043 {
10044 array<string> zone_names = new array<string>;
10045 GetDamageZones(zone_names);
10046 for (int i = 0; i < zone_names.Count(); i++)
10047 {
10048 SetHealthMax(zone_names.Get(i),"Health");
10049 }
10050 SetHealthMax("","Health");
10051 }
10052
10055 {
10056 float global_health = GetHealth01("","Health");
10057 array<string> zones = new array<string>;
10058 GetDamageZones(zones);
10059
10060 for (int i = 0; i < zones.Count(); i++)
10061 {
10062 SetHealth01(zones.Get(i),"Health",global_health);
10063 }
10064 }
10065
10068 {
10069 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10070 }
10071
10073 {
10074 if (!hasRootAsPlayer)
10075 {
10076 if (refParentIB)
10077 {
10078
10079 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10080 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10081
10082 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10083 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10084
10087 }
10088 else
10089 {
10090
10093 }
10094 }
10095 }
10096
10098 {
10100 {
10101 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10102 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10103 {
10104 float heatPermCoef = 1.0;
10106 while (ent)
10107 {
10108 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10109 ent = ent.GetHierarchyParent();
10110 }
10111
10112 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10113 }
10114 }
10115 }
10116
10118 {
10119
10120 EntityAI parent = GetHierarchyParent();
10121 if (!parent)
10122 {
10123 hasParent = false;
10124 hasRootAsPlayer = false;
10125 }
10126 else
10127 {
10128 hasParent = true;
10129 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10130 refParentIB =
ItemBase.Cast(parent);
10131 }
10132 }
10133
10134 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10135 {
10136
10137 }
10138
10140 {
10141
10142 return false;
10143 }
10144
10146 {
10147
10148
10149 return false;
10150 }
10151
10153 {
10154
10155 return false;
10156 }
10157
10160 {
10161 return !GetIsFrozen() &&
IsOpen();
10162 }
10163
10165 {
10166 bool hasParent = false, hasRootAsPlayer = false;
10168
10169 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10170 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10171
10172 if (wwtu || foodDecay)
10173 {
10177
10178 if (processWetness || processTemperature || processDecay)
10179 {
10181
10182 if (processWetness)
10183 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10184
10185 if (processTemperature)
10187
10188 if (processDecay)
10189 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10190 }
10191 }
10192 }
10193
10196 {
10198 }
10199
10201 {
10204
10205 return super.GetTemperatureFreezeThreshold();
10206 }
10207
10209 {
10212
10213 return super.GetTemperatureThawThreshold();
10214 }
10215
10217 {
10220
10221 return super.GetItemOverheatThreshold();
10222 }
10223
10225 {
10227 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10228
10229 return super.GetTemperatureFreezeTime();
10230 }
10231
10233 {
10235 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10236
10237 return super.GetTemperatureThawTime();
10238 }
10239
10244
10246 {
10247 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10248 }
10249
10251 {
10252 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10253 }
10254
10257 {
10259 }
10260
10262 {
10264 }
10265
10267 {
10269 }
10270
10273 {
10274 return null;
10275 }
10276
10279 {
10280 return false;
10281 }
10282
10284 {
10286 {
10289 if (!trg)
10290 {
10292 explosive = this;
10293 }
10294
10295 explosive.PairRemote(trg);
10297
10298 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10299 trg.SetPersistentPairID(persistentID);
10300 explosive.SetPersistentPairID(persistentID);
10301
10302 return true;
10303 }
10304 return false;
10305 }
10306
10309 {
10310 float ret = 1.0;
10313 ret *= GetHealth01();
10314
10315 return ret;
10316 }
10317
10318 #ifdef DEVELOPER
10319 override void SetDebugItem()
10320 {
10321 super.SetDebugItem();
10322 _itemBase = this;
10323 }
10324
10326 {
10327 string text = super.GetDebugText();
10328
10330 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10331
10332 return text;
10333 }
10334 #endif
10335
10337 {
10338 return true;
10339 }
10340
10342
10344
10346 {
10349 }
10350
10351
10359
10375}
10376
10378{
10380 if (entity)
10381 {
10382 bool is_item = entity.IsInherited(
ItemBase);
10383 if (is_item && full_quantity)
10384 {
10387 }
10388 }
10389 else
10390 {
10392 return NULL;
10393 }
10394 return entity;
10395}
10396
10398{
10399 if (item)
10400 {
10401 if (health > 0)
10402 item.SetHealth("", "", health);
10403
10404 if (item.CanHaveTemperature())
10405 {
10407 if (item.CanFreeze())
10408 item.SetFrozen(false);
10409 }
10410
10411 if (item.HasEnergyManager())
10412 {
10413 if (quantity >= 0)
10414 {
10415 item.GetCompEM().SetEnergy0To1(quantity);
10416 }
10417 else
10418 {
10420 }
10421 }
10422 else if (item.IsMagazine())
10423 {
10424 Magazine mag = Magazine.Cast(item);
10425 if (quantity >= 0)
10426 {
10427 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10428 }
10429 else
10430 {
10432 }
10433
10434 }
10435 else
10436 {
10437 if (quantity >= 0)
10438 {
10439 item.SetQuantityNormalized(quantity, false);
10440 }
10441 else
10442 {
10444 }
10445
10446 }
10447 }
10448}
10449
10450#ifdef DEVELOPER
10452#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.