Re-sets DamageSystem changes.
5576{
5578 {
5579 return true;
5580 }
5581};
5582
5583
5584
5586{
5590
5592
5595
5596
5597
5598
5599
5608
5614
5619
5624
5645 protected bool m_IsResultOfSplit
5646
5648
5653
5654
5655
5657
5661
5662
5663
5665
5668
5669
5670
5676
5677
5685
5688
5689
5691
5692
5694
5695
5700
5701
5706
5707
5709
5710
5712 {
5717
5718 if (!
GetGame().IsDedicatedServer())
5719 {
5721 {
5723
5725 {
5727 }
5728 }
5729
5732 }
5733
5734 m_OldLocation = null;
5735
5737 {
5739 }
5740
5741 if (ConfigIsExisting("headSelectionsToHide"))
5742 {
5745 }
5746
5748 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5749 {
5751 }
5752
5754
5755 m_IsResultOfSplit = false;
5756
5758 }
5759
5761 {
5762 super.InitItemVariables();
5763
5769 m_Count = ConfigGetInt(
"count");
5770
5773
5778
5781
5786
5798
5802
5803
5806 if (ConfigIsExisting("canBeSplit"))
5807 {
5810 }
5811
5813 if (ConfigIsExisting("itemBehaviour"))
5815
5816
5819 RegisterNetSyncVariableInt("m_VarLiquidType");
5820 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5821
5822 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5823 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5824 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5825
5826 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5827 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5828 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5829 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5830
5831 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5832 RegisterNetSyncVariableBool("m_IsTakeable");
5833 RegisterNetSyncVariableBool("m_IsHologram");
5834
5837 {
5840 }
5841
5843
5845 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5847
5848 }
5849
5851 {
5853 }
5854
5856 {
5859 {
5864 }
5865 }
5866
5867 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5868 {
5870 {
5873 }
5874
5876 }
5877
5879 {
5885 }
5886
5888
5890 {
5892
5893 if (!action)
5894 {
5895 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5896 return;
5897 }
5898
5900 if (!ai)
5901 {
5903 return;
5904 }
5905
5907 if (!action_array)
5908 {
5909 action_array = new array<ActionBase_Basic>;
5911 }
5912 if (LogManager.IsActionLogEnable())
5913 {
5914 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5915 }
5916
5917 if (action_array.Find(action) != -1)
5918 {
5919 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5920 }
5921 else
5922 {
5923 action_array.Insert(action);
5924 }
5925 }
5926
5928 {
5930 ActionBase action = player.GetActionManager().GetAction(actionName);
5933
5934 if (action_array)
5935 {
5936 action_array.RemoveItem(action);
5937 }
5938 }
5939
5940
5941
5943 {
5944 ActionOverrideData overrideData = new ActionOverrideData();
5948
5950 if (!actionMap)
5951 {
5954 }
5955
5956 actionMap.Insert(this.
Type(), overrideData);
5957
5958 }
5959
5961
5963
5964
5966 {
5969
5972
5973 string config_to_search = "CfgVehicles";
5974 string muzzle_owner_config;
5975
5977 {
5978 if (IsInherited(Weapon))
5979 config_to_search = "CfgWeapons";
5980
5981 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5982
5983 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5984
5986
5987 if (config_OnFire_subclass_count > 0)
5988 {
5989 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5990
5991 for (int i = 0; i < config_OnFire_subclass_count; i++)
5992 {
5993 string particle_class = "";
5995 string config_OnFire_entry = config_OnFire_class + particle_class;
5996 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5997 WPOF_array.Insert(WPOF);
5998 }
5999
6000
6002 }
6003 }
6004
6006 {
6007 config_to_search = "CfgWeapons";
6008 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6009
6010 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6011
6013
6014 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6015 {
6016 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6017
6018 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6019 {
6020 string particle_class2 = "";
6022 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6023 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6024 WPOBE_array.Insert(WPOBE);
6025 }
6026
6027
6029 }
6030 }
6031 }
6032
6033
6035 {
6038
6040 {
6041 string config_to_search = "CfgVehicles";
6042
6043 if (IsInherited(Weapon))
6044 config_to_search = "CfgWeapons";
6045
6046 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6047 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6048
6049 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6050 {
6051
6053
6055 {
6057 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6059 return;
6060 }
6061
6064
6065
6066
6068 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6069
6070 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6071 {
6072 string particle_class = "";
6074 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6076
6077 if (entry_type == CT_CLASS)
6078 {
6079 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6080 WPOOH_array.Insert(WPOF);
6081 }
6082 }
6083
6084
6086 }
6087 }
6088 }
6089
6091 {
6093 }
6094
6096 {
6098 {
6100
6103
6106
6107 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6108 }
6109 }
6110
6112 {
6114 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6115
6117 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6118
6120 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6121
6123 {
6125 }
6126 }
6127
6129 {
6131 }
6132
6134 {
6137 else
6139
6141 {
6144 }
6145 else
6146 {
6149
6152 }
6153
6155 }
6156
6158 {
6160 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6161 }
6162
6164 {
6166 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6168 }
6169
6171 {
6173 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6174 }
6175
6177 {
6180
6181 OverheatingParticle OP = new OverheatingParticle();
6186
6188 }
6189
6191 {
6194
6195 return -1;
6196 }
6197
6199 {
6201 {
6204
6205 for (int i = count; i > 0; --i)
6206 {
6207 int id = i - 1;
6210
6213
6214 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6215 {
6216 if (p)
6217 {
6220 }
6221 }
6222 }
6223 }
6224 }
6225
6227 {
6229 {
6231 {
6232 int id = i - 1;
6234
6235 if (OP)
6236 {
6238
6239 if (p)
6240 {
6242 }
6243
6244 delete OP;
6245 }
6246 }
6247
6250 }
6251 }
6252
6255 {
6256 return 0.0;
6257 }
6258
6259
6261 {
6262 return 250;
6263 }
6264
6266 {
6267 return 0;
6268 }
6269
6272 {
6274 return true;
6275
6276 return false;
6277 }
6278
6281 {
6284
6286 {
6288 }
6289 else
6290 {
6291
6293 }
6294
6296 }
6297
6304 {
6305 return -1;
6306 }
6307
6308
6309
6310
6312 {
6314 {
6316 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6317
6318 if (r_index >= 0)
6319 {
6320 InventoryLocation r_il = new InventoryLocation;
6321 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6322
6323 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6326 {
6327 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6328 }
6330 {
6331 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6332 }
6333
6334 }
6335
6336 player.GetHumanInventory().ClearUserReservedLocation(this);
6337 }
6338
6341 }
6342
6343
6344
6345
6347 {
6348 return ItemBase.m_DebugActionsMask;
6349 }
6350
6352 {
6353 return ItemBase.m_DebugActionsMask & mask;
6354 }
6355
6357 {
6358 ItemBase.m_DebugActionsMask = mask;
6359 }
6360
6362 {
6363 ItemBase.m_DebugActionsMask |= mask;
6364 }
6365
6367 {
6368 ItemBase.m_DebugActionsMask &= ~mask;
6369 }
6370
6372 {
6374 {
6376 }
6377 else
6378 {
6380 }
6381 }
6382
6383
6385 {
6386 if (GetEconomyProfile())
6387 {
6388 float q_max = GetEconomyProfile().GetQuantityMax();
6389 if (q_max > 0)
6390 {
6391 float q_min = GetEconomyProfile().GetQuantityMin();
6392 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6393
6395 {
6396 ComponentEnergyManager comp = GetCompEM();
6398 {
6400 }
6401 }
6403 {
6405
6406 }
6407
6408 }
6409 }
6410 }
6411
6414 {
6415 EntityAI parent = GetHierarchyParent();
6416
6417 if (parent)
6418 {
6419 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6420 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6421 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6422 }
6423 }
6424
6427 {
6428 EntityAI parent = GetHierarchyParent();
6429
6430 if (parent)
6431 {
6432 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6433 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6434 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6435 }
6436 }
6437
6439 {
6440
6441
6442
6443
6445
6447 {
6448 if (ScriptInputUserData.CanStoreInputUserData())
6449 {
6450 ScriptInputUserData ctx = new ScriptInputUserData;
6456 ctx.
Write(use_stack_max);
6459
6461 {
6462 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6463 }
6464 }
6465 }
6466 else if (!
GetGame().IsMultiplayer())
6467 {
6469 }
6470 }
6471
6473 {
6475 }
6476
6478 {
6480 }
6481
6483 {
6485 }
6486
6488 {
6489
6490 return false;
6491 }
6492
6494 {
6495 return false;
6496 }
6497
6501 {
6502 return false;
6503 }
6504
6506 {
6507 return "";
6508 }
6509
6511
6513 {
6514 return false;
6515 }
6516
6518 {
6519 return true;
6520 }
6521
6522
6523
6525 {
6526 return true;
6527 }
6528
6530 {
6531 return true;
6532 }
6533
6535 {
6536 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6538 }
6539
6541 {
6543 }
6544
6546 {
6548 if (!is_being_placed)
6550 SetSynchDirty();
6551 }
6552
6553
6555
6557 {
6559 }
6560
6562 {
6564 }
6565
6567 {
6568 return 1;
6569 }
6570
6572 {
6573 return false;
6574 }
6575
6577 {
6579 SetSynchDirty();
6580 }
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6617 {
6618 super.OnMovedInsideCargo(container);
6619
6620 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6621 }
6622
6623 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6624 {
6625 super.EEItemLocationChanged(oldLoc,newLoc);
6626
6627 PlayerBase new_player = null;
6628 PlayerBase old_player = null;
6629
6630 if (newLoc.GetParent())
6631 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6632
6633 if (oldLoc.GetParent())
6634 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6635
6637 {
6638 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6639
6640 if (r_index >= 0)
6641 {
6642 InventoryLocation r_il = new InventoryLocation;
6643 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6644
6645 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6648 {
6649 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6650 }
6652 {
6653 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6654 }
6655
6656 }
6657 }
6658
6660 {
6661 if (new_player)
6662 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6663
6664 if (new_player == old_player)
6665 {
6666
6667 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6668 {
6670 {
6671 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6672 {
6673 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6674 }
6675 }
6676 else
6677 {
6678 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6679 }
6680 }
6681
6682 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6683 {
6684 int type = oldLoc.GetType();
6686 {
6687 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6688 }
6690 {
6691 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6692 }
6693 }
6694 if (!m_OldLocation)
6695 {
6696 m_OldLocation = new InventoryLocation;
6697 }
6698 m_OldLocation.Copy(oldLoc);
6699 }
6700 else
6701 {
6702 if (m_OldLocation)
6703 {
6704 m_OldLocation.Reset();
6705 }
6706 }
6707
6709 }
6710 else
6711 {
6712 if (new_player)
6713 {
6714 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6715 if (res_index >= 0)
6716 {
6717 InventoryLocation il = new InventoryLocation;
6718 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6720 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6723 {
6724 il.
GetParent().GetOnReleaseLock().Invoke(it);
6725 }
6727 {
6729 }
6730
6731 }
6732 }
6734 {
6735
6737 }
6738
6739 if (m_OldLocation)
6740 {
6741 m_OldLocation.Reset();
6742 }
6743 }
6744 }
6745
6746 override void EOnContact(IEntity other, Contact extra)
6747 {
6749 {
6750 int liquidType = -1;
6752 if (impactSpeed > 0.0)
6753 {
6755 #ifndef SERVER
6757 #else
6759 SetSynchDirty();
6760 #endif
6762 }
6763 }
6764
6765 #ifdef SERVER
6766 if (GetCompEM() && GetCompEM().IsPlugged())
6767 {
6768 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6769 GetCompEM().UnplugThis();
6770 }
6771 #endif
6772 }
6773
6775
6777 {
6779 }
6780
6782 {
6783
6784 }
6785
6787 {
6788 super.OnItemLocationChanged(old_owner, new_owner);
6789
6790 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6791 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6792
6793 if (!relatedPlayer && playerNew)
6794 relatedPlayer = playerNew;
6795
6796 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6797 {
6799 if (actionMgr)
6800 {
6801 ActionBase currentAction = actionMgr.GetRunningAction();
6802 if (currentAction)
6804 }
6805 }
6806
6807 Man ownerPlayerOld = null;
6808 Man ownerPlayerNew = null;
6809
6810 if (old_owner)
6811 {
6812 if (old_owner.
IsMan())
6813 {
6814 ownerPlayerOld = Man.Cast(old_owner);
6815 }
6816 else
6817 {
6818 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6819 }
6820 }
6821 else
6822 {
6824 {
6826
6827 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6828 {
6829 GetCompEM().UnplugThis();
6830 }
6831 }
6832 }
6833
6834 if (new_owner)
6835 {
6836 if (new_owner.
IsMan())
6837 {
6838 ownerPlayerNew = Man.Cast(new_owner);
6839 }
6840 else
6841 {
6842 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6843 }
6844 }
6845
6846 if (ownerPlayerOld != ownerPlayerNew)
6847 {
6848 if (ownerPlayerOld)
6849 {
6850 array<EntityAI> subItemsExit = new array<EntityAI>;
6852 for (int i = 0; i < subItemsExit.Count(); i++)
6853 {
6856 }
6857 }
6858
6859 if (ownerPlayerNew)
6860 {
6861 array<EntityAI> subItemsEnter = new array<EntityAI>;
6863 for (int j = 0; j < subItemsEnter.Count(); j++)
6864 {
6867 }
6868 }
6869 }
6870 else if (ownerPlayerNew != null)
6871 {
6872 PlayerBase nplayer;
6873 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6874 {
6875 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6877 for (int k = 0; k < subItemsUpdate.Count(); k++)
6878 {
6880 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6881 }
6882 }
6883 }
6884
6885 if (old_owner)
6886 old_owner.OnChildItemRemoved(this);
6887 if (new_owner)
6888 new_owner.OnChildItemReceived(this);
6889 }
6890
6891
6893 {
6894 super.EEDelete(parent);
6895 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6896 if (player)
6897 {
6899
6900 if (player.IsAlive())
6901 {
6902 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6903 if (r_index >= 0)
6904 {
6905 InventoryLocation r_il = new InventoryLocation;
6906 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6907
6908 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6911 {
6912 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6913 }
6915 {
6916 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6917 }
6918
6919 }
6920
6921 player.RemoveQuickBarEntityShortcut(this);
6922 }
6923 }
6924 }
6925
6927 {
6928 super.EEKilled(killer);
6929
6932 {
6933 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6934 {
6935 if (IsMagazine())
6936 {
6937 if (Magazine.Cast(this).GetAmmoCount() > 0)
6938 {
6940 }
6941 }
6942 else
6943 {
6945 }
6946 }
6947 }
6948 }
6949
6951 {
6952 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6953
6954 super.OnWasAttached(parent, slot_id);
6955
6958
6960 }
6961
6963 {
6964 super.OnWasDetached(parent, slot_id);
6965
6968 }
6969
6971 {
6972 int idx;
6975
6976 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6977 if (inventory_slots.Count() < 1)
6978 {
6979 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6980 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6981 }
6982 else
6983 {
6984 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6985 }
6986
6987 idx = inventory_slots.Find(slot);
6988 if (idx < 0)
6989 return "";
6990
6991 return attach_types.Get(idx);
6992 }
6993
6995 {
6996 int idx = -1;
6997 string slot;
6998
7001
7002 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7003 if (inventory_slots.Count() < 1)
7004 {
7005 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7006 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7007 }
7008 else
7009 {
7010 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7011 if (detach_types.Count() < 1)
7012 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7013 }
7014
7015 for (int i = 0; i < inventory_slots.Count(); i++)
7016 {
7017 slot = inventory_slots.Get(i);
7018 }
7019
7020 if (slot != "")
7021 {
7022 if (detach_types.Count() == 1)
7023 idx = 0;
7024 else
7025 idx = inventory_slots.Find(slot);
7026 }
7027 if (idx < 0)
7028 return "";
7029
7030 return detach_types.Get(idx);
7031 }
7032
7034 {
7035
7037
7038
7039 float min_time = 1;
7040 float max_time = 3;
7041 float delay = Math.RandomFloat(min_time, max_time);
7042
7043 explode_timer.Run(delay, this, "DoAmmoExplosion");
7044 }
7045
7047 {
7048 Magazine magazine = Magazine.Cast(this);
7049 int pop_sounds_count = 6;
7050 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7051
7052
7053 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7054 string sound_name = pop_sounds[ sound_idx ];
7056
7057
7058 magazine.ServerAddAmmoCount(-1);
7059
7060
7061 float min_temp_to_explode = 100;
7062
7063 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
7064 {
7066 }
7067 }
7068
7069
7070 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7071 {
7072 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7073
7074 const int CHANCE_DAMAGE_CARGO = 4;
7075 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7076 const int CHANCE_DAMAGE_NOTHING = 2;
7077
7079 {
7080 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7081 int chances;
7082 int rnd;
7083
7084 if (GetInventory().GetCargo())
7085 {
7086 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7087 rnd = Math.RandomInt(0,chances);
7088
7089 if (rnd < CHANCE_DAMAGE_CARGO)
7090 {
7092 }
7093 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7094 {
7096 }
7097 }
7098 else
7099 {
7100 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7101 rnd = Math.RandomInt(0,chances);
7102
7103 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7104 {
7106 }
7107 }
7108 }
7109 }
7110
7112 {
7113 if (GetInventory().GetCargo())
7114 {
7115 int item_count = GetInventory().GetCargo().GetItemCount();
7116 if (item_count > 0)
7117 {
7118 int random_pick = Math.RandomInt(0, item_count);
7120 if (!item.IsExplosive())
7121 {
7122 item.AddHealth("","",damage);
7123 return true;
7124 }
7125 }
7126 }
7127 return false;
7128 }
7129
7131 {
7132 int attachment_count = GetInventory().AttachmentCount();
7133 if (attachment_count > 0)
7134 {
7135 int random_pick = Math.RandomInt(0, attachment_count);
7136 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7137 if (!attachment.IsExplosive())
7138 {
7139 attachment.AddHealth("","",damage);
7140 return true;
7141 }
7142 }
7143 return false;
7144 }
7145
7147 {
7149 }
7150
7152 {
7154 return GetInventory().CanRemoveEntity();
7155
7156 return false;
7157 }
7158
7160 {
7161
7163 return false;
7164
7165
7167 return false;
7168
7169
7170
7172 if (delta == 0)
7173 return false;
7174
7175
7176 return true;
7177 }
7178
7180 {
7182 {
7183 if (ScriptInputUserData.CanStoreInputUserData())
7184 {
7185 ScriptInputUserData ctx = new ScriptInputUserData;
7190 ctx.
Write(destination_entity);
7194 }
7195 }
7196 else if (!
GetGame().IsMultiplayer())
7197 {
7199 }
7200 }
7201
7203 {
7204 float split_quantity_new;
7208 InventoryLocation loc = new InventoryLocation;
7209
7210 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7211 {
7213 split_quantity_new = stack_max;
7214 else
7216
7218 {
7219 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7220 if (new_item)
7221 {
7222 new_item.SetResultOfSplit(true);
7223 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7225 new_item.
SetQuantity(split_quantity_new,
false,
true);
7226 }
7227 }
7228 }
7229 else if (destination_entity && slot_id == -1)
7230 {
7231 if (quantity > stack_max)
7232 split_quantity_new = stack_max;
7233 else
7234 split_quantity_new = quantity;
7235
7237 {
7239 {
7242 }
7243
7244 if (new_item)
7245 {
7246 new_item.SetResultOfSplit(true);
7247 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7249 new_item.
SetQuantity(split_quantity_new,
false,
true);
7250 }
7251 }
7252 }
7253 else
7254 {
7255 if (stack_max != 0)
7256 {
7258 {
7260 }
7261
7262 if (split_quantity_new == 0)
7263 {
7264 if (!
GetGame().IsMultiplayer())
7265 player.PhysicalPredictiveDropItem(this);
7266 else
7267 player.ServerDropEntity(this);
7268 return;
7269 }
7270
7272 {
7274
7275 if (new_item)
7276 {
7277 new_item.SetResultOfSplit(true);
7278 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7281 new_item.PlaceOnSurface();
7282 }
7283 }
7284 }
7285 }
7286 }
7287
7289 {
7290 float split_quantity_new;
7294 InventoryLocation loc = new InventoryLocation;
7295
7296 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7297 {
7299 split_quantity_new = stack_max;
7300 else
7302
7304 {
7305 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7306 if (new_item)
7307 {
7308 new_item.SetResultOfSplit(true);
7309 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7311 new_item.
SetQuantity(split_quantity_new,
false,
true);
7312 }
7313 }
7314 }
7315 else if (destination_entity && slot_id == -1)
7316 {
7317 if (quantity > stack_max)
7318 split_quantity_new = stack_max;
7319 else
7320 split_quantity_new = quantity;
7321
7323 {
7325 {
7328 }
7329
7330 if (new_item)
7331 {
7332 new_item.SetResultOfSplit(true);
7333 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7335 new_item.
SetQuantity(split_quantity_new,
false,
true);
7336 }
7337 }
7338 }
7339 else
7340 {
7341 if (stack_max != 0)
7342 {
7344 {
7346 }
7347
7349 {
7351
7352 if (new_item)
7353 {
7354 new_item.SetResultOfSplit(true);
7355 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7358 new_item.PlaceOnSurface();
7359 }
7360 }
7361 }
7362 }
7363 }
7364
7366 {
7368 {
7369 if (ScriptInputUserData.CanStoreInputUserData())
7370 {
7371 ScriptInputUserData ctx = new ScriptInputUserData;
7376 dst.WriteToContext(ctx);
7378 }
7379 }
7380 else if (!
GetGame().IsMultiplayer())
7381 {
7383 }
7384 }
7385
7387 {
7389 {
7390 if (ScriptInputUserData.CanStoreInputUserData())
7391 {
7392 ScriptInputUserData ctx = new ScriptInputUserData;
7397 ctx.
Write(destination_entity);
7403 }
7404 }
7405 else if (!
GetGame().IsMultiplayer())
7406 {
7408 }
7409 }
7410
7412 {
7414 }
7415
7417 {
7419 float split_quantity_new;
7421 if (dst.IsValid())
7422 {
7423 int slot_id = dst.GetSlot();
7425
7426 if (quantity > stack_max)
7427 split_quantity_new = stack_max;
7428 else
7429 split_quantity_new = quantity;
7430
7432 {
7434
7435 if (new_item)
7436 {
7437 new_item.SetResultOfSplit(true);
7438 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7440 new_item.
SetQuantity(split_quantity_new,
false,
true);
7441 }
7442
7443 return new_item;
7444 }
7445 }
7446
7447 return null;
7448 }
7449
7451 {
7453 float split_quantity_new;
7455 if (destination_entity)
7456 {
7458 if (quantity > stackable)
7459 split_quantity_new = stackable;
7460 else
7461 split_quantity_new = quantity;
7462
7464 {
7465 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7466 if (new_item)
7467 {
7468 new_item.SetResultOfSplit(true);
7469 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7471 new_item.
SetQuantity(split_quantity_new,
false,
true);
7472 }
7473 }
7474 }
7475 }
7476
7478 {
7480 {
7481 if (ScriptInputUserData.CanStoreInputUserData())
7482 {
7483 ScriptInputUserData ctx = new ScriptInputUserData;
7488 ItemBase destination_entity =
this;
7489 ctx.
Write(destination_entity);
7493 }
7494 }
7495 else if (!
GetGame().IsMultiplayer())
7496 {
7498 }
7499 }
7500
7502 {
7504 float split_quantity_new;
7506 if (player)
7507 {
7509 if (quantity > stackable)
7510 split_quantity_new = stackable;
7511 else
7512 split_quantity_new = quantity;
7513
7515 {
7516 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7517 new_item =
ItemBase.Cast(in_hands);
7518 if (new_item)
7519 {
7520 new_item.SetResultOfSplit(true);
7521 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7523 new_item.SetQuantity(split_quantity_new, false, true);
7524 }
7525 }
7526 }
7527 }
7528
7530 {
7532 float split_quantity_new = Math.Floor(quantity * 0.5);
7533
7535 return;
7536
7538
7539 if (new_item)
7540 {
7541 if (new_item.GetQuantityMax() < split_quantity_new)
7542 {
7543 split_quantity_new = new_item.GetQuantityMax();
7544 }
7545
7546 new_item.SetResultOfSplit(true);
7547 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7548
7550 {
7553 }
7554 else
7555 {
7557 new_item.
SetQuantity(split_quantity_new,
false,
true);
7558 }
7559 }
7560 }
7561
7563 {
7565 float split_quantity_new = Math.Floor(quantity / 2);
7566
7568 return;
7569
7570 InventoryLocation invloc = new InventoryLocation;
7572
7574 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7575
7576 if (new_item)
7577 {
7578 if (new_item.GetQuantityMax() < split_quantity_new)
7579 {
7580 split_quantity_new = new_item.GetQuantityMax();
7581 }
7583 {
7586 }
7587 else if (split_quantity_new > 1)
7588 {
7590 new_item.
SetQuantity(split_quantity_new,
false,
true);
7591 }
7592 }
7593 }
7594
7597 {
7598 SetWeightDirty();
7600
7601 if (parent)
7602 parent.OnAttachmentQuantityChangedEx(this, delta);
7603
7605 {
7607 {
7609 }
7611 {
7612 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7614 }
7615 }
7616
7617 }
7618
7621 {
7622
7623 }
7624
7627 {
7629 }
7630
7632 {
7633 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7634
7636 {
7637 if (newLevel == GameConstants.STATE_RUINED)
7638 {
7640 EntityAI parent = GetHierarchyParent();
7641 if (parent && parent.IsFireplace())
7642 {
7643 CargoBase cargo = GetInventory().GetCargo();
7644 if (cargo)
7645 {
7647 {
7649 }
7650 }
7651 }
7652 }
7653
7655 {
7656
7658 return;
7659 }
7660
7661 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7662 {
7664 }
7665 }
7666 }
7667
7668
7670 {
7671 super.OnRightClick();
7672
7674 {
7676 {
7677 if (ScriptInputUserData.CanStoreInputUserData())
7678 {
7679 EntityAI root = GetHierarchyRoot();
7680 Man playerOwner = GetHierarchyRootPlayer();
7681 InventoryLocation dst = new InventoryLocation;
7682
7683
7684 if (!playerOwner && root && root == this)
7685 {
7687 }
7688 else
7689 {
7690
7691 GetInventory().GetCurrentInventoryLocation(dst);
7693 {
7696 {
7698 }
7699 else
7700 {
7702
7703
7704 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7705 {
7707 }
7708 else
7709 {
7710 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7711 }
7712 }
7713 }
7714 }
7715
7716 ScriptInputUserData ctx = new ScriptInputUserData;
7724 }
7725 }
7726 else if (!
GetGame().IsMultiplayer())
7727 {
7729 }
7730 }
7731 }
7732
7734 {
7735 if (root)
7736 {
7737 vector m4[4];
7738 root.GetTransform(m4);
7739 dst.SetGround(this, m4);
7740 }
7741 else
7742 {
7743 GetInventory().GetCurrentInventoryLocation(dst);
7744 }
7745 }
7746
7747 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7748 {
7749
7750 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7751 return false;
7752
7753 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7754 return false;
7755
7756
7758 return false;
7759
7760
7761 Magazine mag = Magazine.Cast(this);
7762 if (mag)
7763 {
7764 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7765 return false;
7766
7767 if (stack_max_limit)
7768 {
7769 Magazine other_mag = Magazine.Cast(other_item);
7770 if (other_item)
7771 {
7772 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7773 return false;
7774 }
7775
7776 }
7777 }
7778 else
7779 {
7780
7782 return false;
7783
7785 return false;
7786 }
7787
7788 PlayerBase player = null;
7789 if (CastTo(player, GetHierarchyRootPlayer()))
7790 {
7791 if (player.GetInventory().HasAttachment(this))
7792 return false;
7793
7794 if (player.IsItemsToDelete())
7795 return false;
7796 }
7797
7798 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7799 return false;
7800
7801 int slotID;
7803 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7804 return false;
7805
7806 return true;
7807 }
7808
7810 {
7812 }
7813
7815 {
7816 return m_IsResultOfSplit;
7817 }
7818
7820 {
7821 m_IsResultOfSplit = value;
7822 }
7823
7825 {
7827 }
7828
7830 {
7831 float other_item_quantity = other_item.GetQuantity();
7832 float this_free_space;
7833
7835
7837
7838 if (other_item_quantity > this_free_space)
7839 {
7840 return this_free_space;
7841 }
7842 else
7843 {
7844 return other_item_quantity;
7845 }
7846 }
7847
7849 {
7851 }
7852
7854 {
7856 return;
7857
7858 if (!IsMagazine() && other_item)
7859 {
7861 if (quantity_used != 0)
7862 {
7863 float hp1 = GetHealth01("","");
7864 float hp2 = other_item.GetHealth01("","");
7865 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7866 hpResult = hpResult / (
GetQuantity() + quantity_used);
7867
7868 hpResult *= GetMaxHealth();
7869 Math.Round(hpResult);
7870 SetHealth("", "Health", hpResult);
7871
7873 other_item.AddQuantity(-quantity_used);
7874 }
7875 }
7877 }
7878
7880 {
7881 #ifdef SERVER
7882 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7883 GetHierarchyParent().IncreaseLifetimeUp();
7884 #endif
7885 };
7886
7888 {
7889 PlayerBase p = PlayerBase.Cast(player);
7890
7891 array<int> recipesIds = p.m_Recipes;
7892 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7893 if (moduleRecipesManager)
7894 {
7895 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7896 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7897 }
7898
7899 for (int i = 0;i < recipesIds.Count(); i++)
7900 {
7901 int key = recipesIds.Get(i);
7902 string recipeName = moduleRecipesManager.GetRecipeName(key);
7904 }
7905 }
7906
7907
7908 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7909 {
7910 super.GetDebugActions(outputList);
7911
7912
7918
7919
7924
7929
7930
7934
7935
7937 {
7941 }
7942
7945
7946
7950
7952
7953 InventoryLocation loc = new InventoryLocation();
7954 GetInventory().GetCurrentInventoryLocation(loc);
7956 {
7957 if (Gizmo_IsSupported())
7960 }
7961
7963 }
7964
7965
7966
7967
7969 {
7970 super.OnAction(action_id, player, ctx);
7971
7973 {
7974 switch (action_id)
7975 {
7978 return true;
7981 return true;
7982 }
7983 }
7984
7986 {
7987 switch (action_id)
7988 {
7990 Delete();
7991 return true;
7992 }
7993 }
7994
7995 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7996 {
7997 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7998 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7999 PlayerBase p = PlayerBase.Cast(player);
8000 if (
EActions.RECIPES_RANGE_START < 1000)
8001 {
8002 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8003 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8004 }
8005 }
8006 #ifndef SERVER
8007 else if (action_id ==
EActions.WATCH_PLAYER)
8008 {
8009 PluginDeveloper.SetDeveloperItemClientEx(player);
8010 }
8011 #endif
8013 {
8014 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8015 {
8016 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8017 OnDebugButtonPressServer(id + 1);
8018 }
8019
8020 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8021 {
8022 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8024 }
8025
8026 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8027 {
8028 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8030 }
8031
8032 else if (action_id ==
EActions.ADD_QUANTITY)
8033 {
8034 if (IsMagazine())
8035 {
8036 Magazine mag = Magazine.Cast(this);
8037 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8038 }
8039 else
8040 {
8042 }
8043
8044 if (m_EM)
8045 {
8046 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8047 }
8048
8049 }
8050
8051 else if (action_id ==
EActions.REMOVE_QUANTITY)
8052 {
8053 if (IsMagazine())
8054 {
8055 Magazine mag2 = Magazine.Cast(this);
8056 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8057 }
8058 else
8059 {
8061 }
8062 if (m_EM)
8063 {
8064 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8065 }
8066
8067 }
8068
8069 else if (action_id ==
EActions.SET_QUANTITY_0)
8070 {
8072
8073 if (m_EM)
8074 {
8075 m_EM.SetEnergy(0);
8076 }
8077 }
8078
8079 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8080 {
8082
8083 if (m_EM)
8084 {
8085 m_EM.SetEnergy(m_EM.GetEnergyMax());
8086 }
8087 }
8088
8089 else if (action_id ==
EActions.ADD_HEALTH)
8090 {
8091 AddHealth("","",GetMaxHealth("","Health")/5);
8092 }
8093 else if (action_id ==
EActions.REMOVE_HEALTH)
8094 {
8095 AddHealth("","",-GetMaxHealth("","Health")/5);
8096 }
8097 else if (action_id ==
EActions.DESTROY_HEALTH)
8098 {
8099 SetHealth01("","",0);
8100 }
8101 else if (action_id ==
EActions.WATCH_ITEM)
8102 {
8104 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8105 #ifdef DEVELOPER
8106 SetDebugDeveloper_item(this);
8107 #endif
8108 }
8109
8110 else if (action_id ==
EActions.ADD_TEMPERATURE)
8111 {
8112 AddTemperature(20);
8113
8114 }
8115
8116 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8117 {
8118 AddTemperature(-20);
8119
8120 }
8121
8122 else if (action_id ==
EActions.FLIP_FROZEN)
8123 {
8124 SetFrozen(!GetIsFrozen());
8125
8126 }
8127
8128 else if (action_id ==
EActions.ADD_WETNESS)
8129 {
8131
8132 }
8133
8134 else if (action_id ==
EActions.REMOVE_WETNESS)
8135 {
8137
8138 }
8139
8140 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8141 {
8144
8145
8146 }
8147
8148 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8149 {
8152 }
8153
8154 else if (action_id ==
EActions.MAKE_SPECIAL)
8155 {
8156 auto debugParams = DebugSpawnParams.WithPlayer(player);
8157 OnDebugSpawnEx(debugParams);
8158 }
8159
8160 }
8161
8162
8163 return false;
8164 }
8165
8166
8167
8168
8172
8175
8176
8177
8179 {
8180 return false;
8181 }
8182
8183
8185 {
8186 return true;
8187 }
8188
8189
8191 {
8192 return true;
8193 }
8194
8195
8196
8198 {
8199 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8201 }
8202
8205 {
8206 return null;
8207 }
8208
8210 {
8211 return false;
8212 }
8213
8215 {
8216 return false;
8217 }
8218
8222
8223
8225 {
8226 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8227 return module_repairing.CanRepair(this, item_repair_kit);
8228 }
8229
8230
8231 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8232 {
8233 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8234 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8235 }
8236
8237
8239 {
8240
8241
8242
8243
8244
8245
8246
8247
8248 return 1;
8249 }
8250
8251
8252
8254 {
8256 }
8257
8258
8259
8261 {
8263 }
8264
8265
8274 {
8275 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8276
8277 if (player)
8278 {
8279 player.MessageStatus(text);
8280 }
8281 }
8282
8283
8292 {
8293 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8294
8295 if (player)
8296 {
8297 player.MessageAction(text);
8298 }
8299 }
8300
8301
8310 {
8311 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8312
8313 if (player)
8314 {
8315 player.MessageFriendly(text);
8316 }
8317 }
8318
8319
8328 {
8329 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8330
8331 if (player)
8332 {
8333 player.MessageImportant(text);
8334 }
8335 }
8336
8338 {
8339 return true;
8340 }
8341
8342
8343 override bool KindOf(
string tag)
8344 {
8345 bool found = false;
8346 string item_name = this.
GetType();
8349
8350 int array_size = item_tag_array.Count();
8351 for (int i = 0; i < array_size; i++)
8352 {
8353 if (item_tag_array.Get(i) == tag)
8354 {
8355 found = true;
8356 break;
8357 }
8358 }
8359 return found;
8360 }
8361
8362
8364 {
8365
8366 super.OnRPC(sender, rpc_type,ctx);
8367
8368
8369 switch (rpc_type)
8370 {
8371 #ifndef SERVER
8372 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8373 Param2<bool, string> p = new Param2<bool, string>(false, "");
8374
8376 return;
8377
8378 bool play = p.param1;
8379 string soundSet = p.param2;
8380
8381 if (play)
8382 {
8384 {
8386 {
8388 }
8389 }
8390 else
8391 {
8393 }
8394 }
8395 else
8396 {
8398 }
8399
8400 break;
8401 #endif
8402
8403 }
8404
8406 {
8408 }
8409 }
8410
8411
8412
8413
8415 {
8416 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8417 return plugin.GetID(
name);
8418 }
8419
8421 {
8422 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8423 return plugin.GetName(id);
8424 }
8425
8428 {
8429
8430
8431 int varFlags;
8432 if (!ctx.
Read(varFlags))
8433 return;
8434
8435 if (varFlags & ItemVariableFlags.FLOAT)
8436 {
8438 }
8439 }
8440
8442 {
8443
8444 super.SerializeNumericalVars(floats_out);
8445
8446
8447
8449 {
8451 }
8452
8454 {
8456 }
8457
8459 {
8461 }
8462
8464 {
8469 }
8470
8472 {
8474 }
8475 }
8476
8478 {
8479
8480 super.DeSerializeNumericalVars(floats);
8481
8482
8483 int index = 0;
8484 int mask = Math.Round(floats.Get(index));
8485
8486 index++;
8487
8489 {
8491 {
8493 }
8494 else
8495 {
8496 float quantity = floats.Get(index);
8498 }
8499 index++;
8500 }
8501
8503 {
8504 float wet = floats.Get(index);
8506 index++;
8507 }
8508
8510 {
8511 int liquidtype = Math.Round(floats.Get(index));
8513 index++;
8514 }
8515
8517 {
8519 index++;
8521 index++;
8523 index++;
8525 index++;
8526 }
8527
8529 {
8530 int cleanness = Math.Round(floats.Get(index));
8532 index++;
8533 }
8534 }
8535
8537 {
8538 super.WriteVarsToCTX(ctx);
8539
8540
8542 {
8544 }
8545
8547 {
8549 }
8550
8552 {
8554 }
8555
8557 {
8558 int r,g,b,a;
8564 }
8565
8567 {
8569 }
8570 }
8571
8573 {
8574 if (!super.ReadVarsFromCTX(ctx,version))
8575 return false;
8576
8577 int intValue;
8578 float value;
8579
8580 if (version < 140)
8581 {
8582 if (!ctx.
Read(intValue))
8583 return false;
8584
8585 m_VariablesMask = intValue;
8586 }
8587
8589 {
8590 if (!ctx.
Read(value))
8591 return false;
8592
8594 {
8596 }
8597 else
8598 {
8600 }
8601 }
8602
8603 if (version < 140)
8604 {
8606 {
8607 if (!ctx.
Read(value))
8608 return false;
8609 SetTemperatureDirect(value);
8610 }
8611 }
8612
8614 {
8615 if (!ctx.
Read(value))
8616 return false;
8618 }
8619
8621 {
8622 if (!ctx.
Read(intValue))
8623 return false;
8625 }
8626
8628 {
8629 int r,g,b,a;
8631 return false;
8633 return false;
8635 return false;
8637 return false;
8638
8640 }
8641
8643 {
8644 if (!ctx.
Read(intValue))
8645 return false;
8647 }
8648
8649 if (version >= 138 && version < 140)
8650 {
8652 {
8653 if (!ctx.
Read(intValue))
8654 return false;
8655 SetFrozen(intValue);
8656 }
8657 }
8658
8659 return true;
8660 }
8661
8662
8664 {
8667 {
8669 }
8670
8671 if (!super.OnStoreLoad(ctx, version))
8672 {
8674 return false;
8675 }
8676
8677 if (version >= 114)
8678 {
8679 bool hasQuickBarIndexSaved;
8680
8681 if (!ctx.
Read(hasQuickBarIndexSaved))
8682 {
8684 return false;
8685 }
8686
8687 if (hasQuickBarIndexSaved)
8688 {
8689 int itmQBIndex;
8690
8691
8692 if (!ctx.
Read(itmQBIndex))
8693 {
8695 return false;
8696 }
8697
8698 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8699 if (itmQBIndex != -1 && parentPlayer)
8700 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8701 }
8702 }
8703 else
8704 {
8705
8706 PlayerBase player;
8707 int itemQBIndex;
8708 if (version ==
int.
MAX)
8709 {
8710 if (!ctx.
Read(itemQBIndex))
8711 {
8713 return false;
8714 }
8715 }
8716 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8717 {
8718
8719 if (!ctx.
Read(itemQBIndex))
8720 {
8722 return false;
8723 }
8724 if (itemQBIndex != -1 && player)
8725 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8726 }
8727 }
8728
8729 if (version < 140)
8730 {
8731
8732 if (!LoadVariables(ctx, version))
8733 {
8735 return false;
8736 }
8737 }
8738
8739
8741 {
8743 return false;
8744 }
8745 if (version >= 132)
8746 {
8748 if (raib)
8749 {
8751 {
8753 return false;
8754 }
8755 }
8756 }
8757
8759 return true;
8760 }
8761
8762
8763
8765 {
8766 super.OnStoreSave(ctx);
8767
8768 PlayerBase player;
8769 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8770 {
8772
8773 int itemQBIndex = -1;
8774 itemQBIndex = player.FindQuickBarEntityIndex(this);
8775 ctx.
Write(itemQBIndex);
8776 }
8777 else
8778 {
8780 }
8781
8783
8785 if (raib)
8786 {
8788 }
8789 }
8790
8791
8793 {
8794 super.AfterStoreLoad();
8795
8797 {
8799 }
8800
8802 {
8805 }
8806 }
8807
8809 {
8810 super.EEOnAfterLoad();
8811
8813 {
8815 }
8816
8819 }
8820
8822 {
8823 return false;
8824 }
8825
8826
8827
8829 {
8831 {
8832 #ifdef PLATFORM_CONSOLE
8833
8835 {
8837 if (menu)
8838 {
8840 }
8841 }
8842 #endif
8843 }
8844
8846 {
8849 }
8850
8852 {
8853 SetWeightDirty();
8855 }
8857 {
8860 }
8861
8863 {
8866 }
8868 {
8871 }
8872
8873 super.OnVariablesSynchronized();
8874 }
8875
8876
8877
8879 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8880 {
8881 if (!IsServerCheck(allow_client))
8882 return false;
8883
8885 return false;
8886
8889
8890 if (value <= (min + 0.001))
8891 value = min;
8892
8893 if (value == min)
8894 {
8895 if (destroy_config)
8896 {
8897 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8898 if (dstr)
8899 {
8901 this.Delete();
8902 return true;
8903 }
8904 }
8905 else if (destroy_forced)
8906 {
8908 this.Delete();
8909 return true;
8910 }
8911
8913 }
8914
8917
8919 {
8921
8922 if (delta)
8924 }
8925
8927
8928 return false;
8929 }
8930
8931
8933 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8934 {
8936 }
8937
8939 {
8942 }
8943
8945 {
8948 }
8949
8951 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8952 {
8953 float value_clamped = Math.Clamp(value, 0, 1);
8955 SetQuantity(result, destroy_config, destroy_forced);
8956 }
8957
8958
8961 {
8963 }
8964
8966 {
8968 }
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8980 {
8981 int slot = -1;
8982 if (GetInventory())
8983 {
8984 InventoryLocation il = new InventoryLocation;
8985 GetInventory().GetCurrentInventoryLocation(il);
8987 }
8988
8990 }
8991
8993 {
8994 float quantity_max = 0;
8995
8997 {
8998 if (attSlotID != -1)
8999 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9000
9001 if (quantity_max <= 0)
9003 }
9004
9005 if (quantity_max <= 0)
9007
9008 return quantity_max;
9009 }
9010
9012 {
9014 }
9015
9017 {
9019 }
9020
9021
9023 {
9025 }
9026
9028 {
9030 }
9031
9033 {
9035 }
9036
9037
9039 {
9040
9041 float weightEx = GetWeightEx();
9042 float special = GetInventoryAndCargoWeight();
9043 return weightEx - special;
9044 }
9045
9046
9048 {
9050 }
9051
9053 {
9055 {
9056 #ifdef DEVELOPER
9057 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9058 {
9059 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9061 }
9062 #endif
9063
9065 }
9066 else if (HasEnergyManager())
9067 {
9068 #ifdef DEVELOPER
9069 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9070 {
9071 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9072 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9073 }
9074 #endif
9075 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
9076 }
9077 else
9078 {
9079 #ifdef DEVELOPER
9080 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9081 {
9082 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9083 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9084 }
9085 #endif
9086 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9087 }
9088 }
9089
9092 {
9093 int item_count = 0;
9095
9096 if (GetInventory().GetCargo() != NULL)
9097 {
9098 item_count = GetInventory().GetCargo().GetItemCount();
9099 }
9100
9101 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9102 {
9103 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9104 if (item)
9105 item_count += item.GetNumberOfItems();
9106 }
9107 return item_count;
9108 }
9109
9112 {
9113 float weight = 0;
9114 float wetness = 1;
9115 if (include_wetness)
9118 {
9119 weight = wetness * m_ConfigWeight;
9120 }
9122 {
9123 weight = 1;
9124 }
9125 return weight;
9126 }
9127
9128
9129
9131 {
9132 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9133 {
9134 GameInventory inv = GetInventory();
9135 array<EntityAI> items = new array<EntityAI>;
9137 for (int i = 0; i < items.Count(); i++)
9138 {
9140 if (item)
9141 {
9143 }
9144 }
9145 }
9146 }
9147
9148
9149
9150
9152 {
9153 float energy = 0;
9154 if (HasEnergyManager())
9155 {
9156 energy = GetCompEM().GetEnergy();
9157 }
9158 return energy;
9159 }
9160
9161
9163 {
9164 super.OnEnergyConsumed();
9165
9167 }
9168
9170 {
9171 super.OnEnergyAdded();
9172
9174 }
9175
9176
9178 {
9179 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9180 {
9182 {
9183 float energy_0to1 = GetCompEM().GetEnergy0To1();
9185 }
9186 }
9187 }
9188
9189
9191 {
9192 return ConfigGetFloat("heatIsolation");
9193 }
9194
9196 {
9198 }
9199
9201 {
9202 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9203 if (
GetGame().ConfigIsExisting(paramPath))
9205
9206 return 0.0;
9207 }
9208
9210 {
9211 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9212 if (
GetGame().ConfigIsExisting(paramPath))
9214
9215 return 0.0;
9216 }
9217
9218 override void SetWet(
float value,
bool allow_client =
false)
9219 {
9220 if (!IsServerCheck(allow_client))
9221 return;
9222
9225
9227
9228 m_VarWet = Math.Clamp(value, min, max);
9229
9231 {
9234 }
9235 }
9236
9237 override void AddWet(
float value)
9238 {
9240 }
9241
9243 {
9245 }
9246
9248 {
9250 }
9251
9253 {
9255 }
9256
9258 {
9260 }
9261
9263 {
9265 }
9266
9268 {
9271 if (newLevel != oldLevel)
9272 {
9274 }
9275 }
9276
9278 {
9279 SetWeightDirty();
9280 }
9281
9283 {
9284 return GetWetLevelInternal(
m_VarWet);
9285 }
9286
9287
9288
9290 {
9292 }
9293
9295 {
9297 }
9298
9300 {
9302 }
9303
9305 {
9307 }
9308
9309
9310
9312 {
9313 if (ConfigIsExisting("itemModelLength"))
9314 {
9315 return ConfigGetFloat("itemModelLength");
9316 }
9317 return 0;
9318 }
9319
9321 {
9322 if (ConfigIsExisting("itemAttachOffset"))
9323 {
9324 return ConfigGetFloat("itemAttachOffset");
9325 }
9326 return 0;
9327 }
9328
9329 override void SetCleanness(
int value,
bool allow_client =
false)
9330 {
9331 if (!IsServerCheck(allow_client))
9332 return;
9333
9335
9337
9340 }
9341
9343 {
9345 }
9346
9348 {
9349 return true;
9350 }
9351
9352
9353
9354
9356 {
9358 }
9359
9361 {
9363 }
9364
9365
9366
9367
9368 override void SetColor(
int r,
int g,
int b,
int a)
9369 {
9375 }
9377 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9378 {
9383 }
9384
9386 {
9388 }
9389
9392 {
9393 int r,g,b,a;
9395 r = r/255;
9396 g = g/255;
9397 b = b/255;
9398 a = a/255;
9399 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9400 }
9401
9402
9403
9404 override void SetLiquidType(
int value,
bool allow_client =
false)
9405 {
9406 if (!IsServerCheck(allow_client))
9407 return;
9408
9413 }
9414
9416 {
9417 return ConfigGetInt("varLiquidTypeInit");
9418 }
9419
9421 {
9423 }
9424
9426 {
9428 SetFrozen(false);
9429 }
9430
9433 {
9434 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9435 }
9436
9437
9440 {
9441 PlayerBase nplayer;
9442 if (PlayerBase.CastTo(nplayer, player))
9443 {
9445
9446 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9447 }
9448 }
9449
9450
9453 {
9454 PlayerBase nplayer;
9455 if (PlayerBase.CastTo(nplayer,player))
9456 {
9457
9458 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9459
9460 }
9461
9462
9463 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9464
9465
9466 if (HasEnergyManager())
9467 {
9468 GetCompEM().UpdatePlugState();
9469 }
9470 }
9471
9472
9474 {
9475 super.OnPlacementStarted(player);
9476
9478 }
9479
9480 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9481 {
9483 {
9484 m_AdminLog.OnPlacementComplete(player,
this);
9485 }
9486
9487 super.OnPlacementComplete(player, position, orientation);
9488 }
9489
9490
9491
9492
9493
9495 {
9497 {
9498 return true;
9499 }
9500 else
9501 {
9502 return false;
9503 }
9504 }
9505
9506
9508 {
9510 {
9512 }
9513 }
9514
9515
9517 {
9519 }
9520
9522 {
9524 }
9525
9526 override void InsertAgent(
int agent,
float count = 1)
9527 {
9528 if (count < 1)
9529 return;
9530
9532 }
9533
9536 {
9538 }
9539
9540
9542 {
9544 }
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9588 {
9590 return false;
9591 return true;
9592 }
9593
9595 {
9596
9598 }
9599
9600
9603 {
9604 super.CheckForRoofLimited(timeTresholdMS);
9605
9607 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9608 {
9609 m_PreviousRoofTestTime = time;
9610 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9611 }
9612 }
9613
9614
9616 {
9618 {
9619 return 0;
9620 }
9621
9622 if (GetInventory().GetAttachmentSlotsCount() != 0)
9623 {
9624 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9625 if (filter)
9626 return filter.GetProtectionLevel(type, false, system);
9627 else
9628 return 0;
9629 }
9630
9631 string subclassPath, entryName;
9632
9633 switch (type)
9634 {
9636 entryName = "biological";
9637 break;
9639 entryName = "chemical";
9640 break;
9641 default:
9642 entryName = "biological";
9643 break;
9644 }
9645
9646 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9647
9649 }
9650
9651
9652
9655 {
9656 if (!IsMagazine())
9658
9660 }
9661
9662
9663
9664
9665
9670 {
9671 return true;
9672 }
9673
9675 {
9677 }
9678
9679
9680
9681
9682
9684 {
9685 if (parent)
9686 {
9687 if (parent.IsInherited(DayZInfected))
9688 return true;
9689
9690 if (!parent.IsRuined())
9691 return true;
9692 }
9693
9694 return true;
9695 }
9696
9698 {
9699 if (!super.CanPutAsAttachment(parent))
9700 {
9701 return false;
9702 }
9703
9704 if (!IsRuined() && !parent.IsRuined())
9705 {
9706 return true;
9707 }
9708
9709 return false;
9710 }
9711
9713 {
9714
9715
9716
9717
9718 return super.CanReceiveItemIntoCargo(item);
9719 }
9720
9722 {
9723
9724
9725
9726
9727 GameInventory attachmentInv = attachment.GetInventory();
9729 {
9730 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9731 return false;
9732 }
9733
9734 InventoryLocation loc = new InventoryLocation();
9735 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9736 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9737 return false;
9738
9739 return super.CanReceiveAttachment(attachment, slotId);
9740 }
9741
9743 {
9744 if (!super.CanReleaseAttachment(attachment))
9745 return false;
9746
9747 return GetInventory().AreChildrenAccessible();
9748 }
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9771 {
9772 int id = muzzle_owner.GetMuzzleID();
9773 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9774
9775 if (WPOF_array)
9776 {
9777 for (int i = 0; i < WPOF_array.Count(); i++)
9778 {
9779 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9780
9781 if (WPOF)
9782 {
9783 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9784 }
9785 }
9786 }
9787 }
9788
9789
9791 {
9792 int id = muzzle_owner.GetMuzzleID();
9794
9795 if (WPOBE_array)
9796 {
9797 for (int i = 0; i < WPOBE_array.Count(); i++)
9798 {
9799 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9800
9801 if (WPOBE)
9802 {
9803 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9804 }
9805 }
9806 }
9807 }
9808
9809
9811 {
9812 int id = muzzle_owner.GetMuzzleID();
9813 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9814
9815 if (WPOOH_array)
9816 {
9817 for (int i = 0; i < WPOOH_array.Count(); i++)
9818 {
9819 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9820
9821 if (WPOOH)
9822 {
9823 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9824 }
9825 }
9826 }
9827 }
9828
9829
9831 {
9832 int id = muzzle_owner.GetMuzzleID();
9833 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9834
9835 if (WPOOH_array)
9836 {
9837 for (int i = 0; i < WPOOH_array.Count(); i++)
9838 {
9839 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9840
9841 if (WPOOH)
9842 {
9843 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9844 }
9845 }
9846 }
9847 }
9848
9849
9851 {
9852 int id = muzzle_owner.GetMuzzleID();
9853 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9854
9855 if (WPOOH_array)
9856 {
9857 for (int i = 0; i < WPOOH_array.Count(); i++)
9858 {
9859 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9860
9861 if (WPOOH)
9862 {
9863 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9864 }
9865 }
9866 }
9867 }
9868
9869
9870
9872 {
9874 {
9875 return true;
9876 }
9877
9878 return false;
9879 }
9880
9882 {
9884 {
9885 return true;
9886 }
9887
9888 return false;
9889 }
9890
9892 {
9894 {
9895 return true;
9896 }
9897
9898 return false;
9899 }
9900
9902 {
9903 return false;
9904 }
9905
9908 {
9909 return UATimeSpent.DEFAULT_DEPLOY;
9910 }
9911
9912
9913
9914
9916 {
9918 SetSynchDirty();
9919 }
9920
9922 {
9924 }
9925
9926
9928 {
9929 return false;
9930 }
9931
9934 {
9935 string att_type = "None";
9936
9937 if (ConfigIsExisting("soundAttType"))
9938 {
9939 att_type = ConfigGetString("soundAttType");
9940 }
9941
9943 }
9944
9946 {
9948 }
9949
9950
9951
9952
9953
9959
9961 {
9964
9966 }
9967
9968
9970 {
9972 return;
9973
9975
9978
9981
9982 SoundParameters params = new SoundParameters();
9986 }
9987
9988
9990 {
9992 return;
9993
9995 SetSynchDirty();
9996
9999 }
10000
10001
10003 {
10005 return;
10006
10008 SetSynchDirty();
10009
10012 }
10013
10015 {
10017 }
10018
10020 {
10022 }
10023
10026 {
10027 if (!
GetGame().IsDedicatedServer())
10028 {
10029 if (ConfigIsExisting("attachSoundSet"))
10030 {
10031 string cfg_path = "";
10032 string soundset = "";
10033 string type_name =
GetType();
10034
10037 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10038 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10039
10040 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10041 {
10042 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10043 {
10044 if (cfg_slot_array[i] == slot_type)
10045 {
10046 soundset = cfg_soundset_array[i];
10047 break;
10048 }
10049 }
10050 }
10051
10052 if (soundset != "")
10053 {
10054 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10056 }
10057 }
10058 }
10059 }
10060
10062 {
10063
10064 }
10065
10066 void OnApply(PlayerBase player);
10067
10069 {
10070 return 1.0;
10071 };
10072
10074 {
10076 }
10077
10079 {
10081 }
10082
10084
10086 {
10087 SetDynamicPhysicsLifeTime(0.01);
10089 }
10090
10092 {
10093 array<string> zone_names = new array<string>;
10094 GetDamageZones(zone_names);
10095 for (int i = 0; i < zone_names.Count(); i++)
10096 {
10097 SetHealthMax(zone_names.Get(i),"Health");
10098 }
10099 SetHealthMax("","Health");
10100 }
10101
10104 {
10105 float global_health = GetHealth01("","Health");
10106 array<string> zones = new array<string>;
10107 GetDamageZones(zones);
10108
10109 for (int i = 0; i < zones.Count(); i++)
10110 {
10111 SetHealth01(zones.Get(i),"Health",global_health);
10112 }
10113 }
10114
10117 {
10118 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10119 }
10120
10122 {
10123 if (!hasRootAsPlayer)
10124 {
10125 if (refParentIB)
10126 {
10127
10128 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10129 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10130
10131 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10132 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10133
10136 }
10137 else
10138 {
10139
10142 }
10143 }
10144 }
10145
10147 {
10149 {
10150 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10151 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10152 {
10153 float heatPermCoef = 1.0;
10155 while (ent)
10156 {
10157 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10158 ent = ent.GetHierarchyParent();
10159 }
10160
10161 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10162 }
10163 }
10164 }
10165
10167 {
10168
10169 EntityAI parent = GetHierarchyParent();
10170 if (!parent)
10171 {
10172 hasParent = false;
10173 hasRootAsPlayer = false;
10174 }
10175 else
10176 {
10177 hasParent = true;
10178 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10179 refParentIB =
ItemBase.Cast(parent);
10180 }
10181 }
10182
10183 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10184 {
10185
10186 }
10187
10189 {
10190
10191 return false;
10192 }
10193
10195 {
10196
10197
10198 return false;
10199 }
10200
10202 {
10203
10204 return false;
10205 }
10206
10209 {
10210 return !GetIsFrozen() &&
IsOpen();
10211 }
10212
10214 {
10215 bool hasParent = false, hasRootAsPlayer = false;
10217
10218 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10219 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10220
10221 if (wwtu || foodDecay)
10222 {
10226
10227 if (processWetness || processTemperature || processDecay)
10228 {
10230
10231 if (processWetness)
10232 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10233
10234 if (processTemperature)
10236
10237 if (processDecay)
10238 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10239 }
10240 }
10241 }
10242
10245 {
10247 }
10248
10250 {
10253
10254 return super.GetTemperatureFreezeThreshold();
10255 }
10256
10258 {
10261
10262 return super.GetTemperatureThawThreshold();
10263 }
10264
10266 {
10269
10270 return super.GetItemOverheatThreshold();
10271 }
10272
10274 {
10276 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10277
10278 return super.GetTemperatureFreezeTime();
10279 }
10280
10282 {
10284 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10285
10286 return super.GetTemperatureThawTime();
10287 }
10288
10293
10295 {
10296 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10297 }
10298
10300 {
10301 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10302 }
10303
10306 {
10308 }
10309
10311 {
10313 }
10314
10316 {
10318 }
10319
10322 {
10323 return null;
10324 }
10325
10328 {
10329 return false;
10330 }
10331
10333 {
10335 {
10338 if (!trg)
10339 {
10341 explosive = this;
10342 }
10343
10344 explosive.PairRemote(trg);
10346
10347 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10348 trg.SetPersistentPairID(persistentID);
10349 explosive.SetPersistentPairID(persistentID);
10350
10351 return true;
10352 }
10353 return false;
10354 }
10355
10358 {
10359 float ret = 1.0;
10362 ret *= GetHealth01();
10363
10364 return ret;
10365 }
10366
10367 #ifdef DEVELOPER
10368 override void SetDebugItem()
10369 {
10370 super.SetDebugItem();
10371 _itemBase = this;
10372 }
10373
10375 {
10376 string text = super.GetDebugText();
10377
10379 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10380
10381 return text;
10382 }
10383 #endif
10384
10386 {
10387 return true;
10388 }
10389
10391
10393
10395 {
10398 }
10399
10400
10408
10424}
10425
10427{
10429 if (entity)
10430 {
10431 bool is_item = entity.IsInherited(
ItemBase);
10432 if (is_item && full_quantity)
10433 {
10436 }
10437 }
10438 else
10439 {
10441 return NULL;
10442 }
10443 return entity;
10444}
10445
10447{
10448 if (item)
10449 {
10450 if (health > 0)
10451 item.SetHealth("", "", health);
10452
10453 if (item.CanHaveTemperature())
10454 {
10456 if (item.CanFreeze())
10457 item.SetFrozen(false);
10458 }
10459
10460 if (item.HasEnergyManager())
10461 {
10462 if (quantity >= 0)
10463 {
10464 item.GetCompEM().SetEnergy0To1(quantity);
10465 }
10466 else
10467 {
10469 }
10470 }
10471 else if (item.IsMagazine())
10472 {
10473 Magazine mag = Magazine.Cast(item);
10474 if (quantity >= 0)
10475 {
10476 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10477 }
10478 else
10479 {
10481 }
10482
10483 }
10484 else
10485 {
10486 if (quantity >= 0)
10487 {
10488 item.SetQuantityNormalized(quantity, false);
10489 }
10490 else
10491 {
10493 }
10494
10495 }
10496 }
10497}
10498
10499#ifdef DEVELOPER
10501#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.