5584{
5586 {
5587 return true;
5588 }
5589};
5590
5591
5592
5594{
5598
5600
5603
5604
5605
5606
5607
5616
5622
5627
5632
5653 protected bool m_IsResultOfSplit
5654
5656
5661
5662
5663
5665
5669
5670
5671
5673
5676
5677
5678
5684
5685
5693
5696
5697
5699
5700
5702
5703
5708
5709
5714
5715
5717
5718
5720 {
5725
5726 if (!
GetGame().IsDedicatedServer())
5727 {
5729 {
5731
5733 {
5735 }
5736 }
5737
5740 }
5741
5742 m_OldLocation = null;
5743
5745 {
5747 }
5748
5749 if (ConfigIsExisting("headSelectionsToHide"))
5750 {
5753 }
5754
5756 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5757 {
5759 }
5760
5762
5763 m_IsResultOfSplit = false;
5764
5766 }
5767
5769 {
5770 super.InitItemVariables();
5771
5777 m_Count = ConfigGetInt(
"count");
5778
5781
5786
5789
5794
5806
5810
5811
5814 if (ConfigIsExisting("canBeSplit"))
5815 {
5818 }
5819
5821 if (ConfigIsExisting("itemBehaviour"))
5823
5824
5827 RegisterNetSyncVariableInt("m_VarLiquidType");
5828 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5829
5830 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5831 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5832 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5833
5834 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5835 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5836 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5837 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5838
5839 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5840 RegisterNetSyncVariableBool("m_IsTakeable");
5841 RegisterNetSyncVariableBool("m_IsHologram");
5842
5845 {
5848 }
5849
5851
5853 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5855
5856 }
5857
5859 {
5861 }
5862
5864 {
5867 {
5872 }
5873 }
5874
5875 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5876 {
5878 {
5881 }
5882
5884 }
5885
5887 {
5893 }
5894
5896
5898 {
5900
5901 if (!action)
5902 {
5903 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5904 return;
5905 }
5906
5908 if (!ai)
5909 {
5911 return;
5912 }
5913
5915 if (!action_array)
5916 {
5917 action_array = new array<ActionBase_Basic>;
5919 }
5920 if (LogManager.IsActionLogEnable())
5921 {
5922 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5923 }
5924
5925 if (action_array.Find(action) != -1)
5926 {
5927 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5928 }
5929 else
5930 {
5931 action_array.Insert(action);
5932 }
5933 }
5934
5936 {
5938 ActionBase action = player.GetActionManager().GetAction(actionName);
5941
5942 if (action_array)
5943 {
5944 action_array.RemoveItem(action);
5945 }
5946 }
5947
5948
5949
5951 {
5952 ActionOverrideData overrideData = new ActionOverrideData();
5956
5958 if (!actionMap)
5959 {
5962 }
5963
5964 actionMap.Insert(this.
Type(), overrideData);
5965
5966 }
5967
5969
5971
5972
5974 {
5977
5980
5981 string config_to_search = "CfgVehicles";
5982 string muzzle_owner_config;
5983
5985 {
5986 if (IsInherited(Weapon))
5987 config_to_search = "CfgWeapons";
5988
5989 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5990
5991 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5992
5994
5995 if (config_OnFire_subclass_count > 0)
5996 {
5997 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5998
5999 for (int i = 0; i < config_OnFire_subclass_count; i++)
6000 {
6001 string particle_class = "";
6003 string config_OnFire_entry = config_OnFire_class + particle_class;
6004 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6005 WPOF_array.Insert(WPOF);
6006 }
6007
6008
6010 }
6011 }
6012
6014 {
6015 config_to_search = "CfgWeapons";
6016 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6017
6018 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6019
6021
6022 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6023 {
6024 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6025
6026 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6027 {
6028 string particle_class2 = "";
6030 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6031 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6032 WPOBE_array.Insert(WPOBE);
6033 }
6034
6035
6037 }
6038 }
6039 }
6040
6041
6043 {
6046
6048 {
6049 string config_to_search = "CfgVehicles";
6050
6051 if (IsInherited(Weapon))
6052 config_to_search = "CfgWeapons";
6053
6054 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6055 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6056
6057 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6058 {
6059
6061
6063 {
6065 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6067 return;
6068 }
6069
6072
6073
6074
6076 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6077
6078 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6079 {
6080 string particle_class = "";
6082 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6084
6085 if (entry_type == CT_CLASS)
6086 {
6087 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6088 WPOOH_array.Insert(WPOF);
6089 }
6090 }
6091
6092
6094 }
6095 }
6096 }
6097
6099 {
6101 }
6102
6104 {
6106 {
6108
6111
6114
6115 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6116 }
6117 }
6118
6120 {
6122 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6123
6125 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6126
6128 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6129
6131 {
6133 }
6134 }
6135
6137 {
6139 }
6140
6142 {
6145 else
6147
6149 {
6152 }
6153 else
6154 {
6157
6160 }
6161
6163 }
6164
6166 {
6168 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6169 }
6170
6172 {
6174 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6176 }
6177
6179 {
6181 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6182 }
6183
6185 {
6188
6189 OverheatingParticle OP = new OverheatingParticle();
6194
6196 }
6197
6199 {
6202
6203 return -1;
6204 }
6205
6207 {
6209 {
6212
6213 for (int i = count; i > 0; --i)
6214 {
6215 int id = i - 1;
6218
6221
6222 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6223 {
6224 if (p)
6225 {
6228 }
6229 }
6230 }
6231 }
6232 }
6233
6235 {
6237 {
6239 {
6240 int id = i - 1;
6242
6243 if (OP)
6244 {
6246
6247 if (p)
6248 {
6250 }
6251
6252 delete OP;
6253 }
6254 }
6255
6258 }
6259 }
6260
6263 {
6264 return 0.0;
6265 }
6266
6267
6269 {
6270 return 250;
6271 }
6272
6274 {
6275 return 0;
6276 }
6277
6280 {
6282 return true;
6283
6284 return false;
6285 }
6286
6289 {
6292
6294 {
6296 }
6297 else
6298 {
6299
6301 }
6302
6304 }
6305
6312 {
6313 return -1;
6314 }
6315
6316
6317
6318
6320 {
6322 {
6324 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6325
6326 if (r_index >= 0)
6327 {
6328 InventoryLocation r_il = new InventoryLocation;
6329 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6330
6331 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6334 {
6335 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6336 }
6338 {
6339 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6340 }
6341
6342 }
6343
6344 player.GetHumanInventory().ClearUserReservedLocation(this);
6345 }
6346
6349 }
6350
6351
6352
6353
6355 {
6356 return ItemBase.m_DebugActionsMask;
6357 }
6358
6360 {
6361 return ItemBase.m_DebugActionsMask & mask;
6362 }
6363
6365 {
6366 ItemBase.m_DebugActionsMask = mask;
6367 }
6368
6370 {
6371 ItemBase.m_DebugActionsMask |= mask;
6372 }
6373
6375 {
6376 ItemBase.m_DebugActionsMask &= ~mask;
6377 }
6378
6380 {
6382 {
6384 }
6385 else
6386 {
6388 }
6389 }
6390
6391
6393 {
6394 if (GetEconomyProfile())
6395 {
6396 float q_max = GetEconomyProfile().GetQuantityMax();
6397 if (q_max > 0)
6398 {
6399 float q_min = GetEconomyProfile().GetQuantityMin();
6400 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6401
6403 {
6404 ComponentEnergyManager comp = GetCompEM();
6406 {
6408 }
6409 }
6411 {
6413
6414 }
6415
6416 }
6417 }
6418 }
6419
6422 {
6423 EntityAI parent = GetHierarchyParent();
6424
6425 if (parent)
6426 {
6427 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6428 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6429 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6430 }
6431 }
6432
6435 {
6436 EntityAI parent = GetHierarchyParent();
6437
6438 if (parent)
6439 {
6440 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6441 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6442 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6443 }
6444 }
6445
6447 {
6448
6449
6450
6451
6453
6455 {
6456 if (ScriptInputUserData.CanStoreInputUserData())
6457 {
6458 ScriptInputUserData ctx = new ScriptInputUserData;
6464 ctx.
Write(use_stack_max);
6467
6469 {
6470 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6471 }
6472 }
6473 }
6474 else if (!
GetGame().IsMultiplayer())
6475 {
6477 }
6478 }
6479
6481 {
6483 }
6484
6486 {
6488 }
6489
6491 {
6493 }
6494
6496 {
6497
6498 return false;
6499 }
6500
6502 {
6503 return false;
6504 }
6505
6509 {
6510 return false;
6511 }
6512
6514 {
6515 return "";
6516 }
6517
6519
6521 {
6522 return false;
6523 }
6524
6526 {
6527 return true;
6528 }
6529
6530
6531
6533 {
6534 return true;
6535 }
6536
6538 {
6539 return true;
6540 }
6541
6543 {
6544 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6546 }
6547
6549 {
6551 }
6552
6554 {
6556 if (!is_being_placed)
6558 SetSynchDirty();
6559 }
6560
6561
6563
6565 {
6567 }
6568
6570 {
6572 }
6573
6575 {
6576 return 1;
6577 }
6578
6580 {
6581 return false;
6582 }
6583
6585 {
6587 SetSynchDirty();
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
6616
6617
6618
6619
6620
6621
6622
6623
6625 {
6626 super.OnMovedInsideCargo(container);
6627
6628 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6629 }
6630
6631 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6632 {
6633 super.EEItemLocationChanged(oldLoc,newLoc);
6634
6635 PlayerBase new_player = null;
6636 PlayerBase old_player = null;
6637
6638 if (newLoc.GetParent())
6639 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6640
6641 if (oldLoc.GetParent())
6642 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6643
6645 {
6646 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6647
6648 if (r_index >= 0)
6649 {
6650 InventoryLocation r_il = new InventoryLocation;
6651 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6652
6653 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6656 {
6657 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6658 }
6660 {
6661 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6662 }
6663
6664 }
6665 }
6666
6668 {
6669 if (new_player)
6670 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6671
6672 if (new_player == old_player)
6673 {
6674
6675 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6676 {
6678 {
6679 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6680 {
6681 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6682 }
6683 }
6684 else
6685 {
6686 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6687 }
6688 }
6689
6690 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6691 {
6692 int type = oldLoc.GetType();
6694 {
6695 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6696 }
6698 {
6699 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6700 }
6701 }
6702 if (!m_OldLocation)
6703 {
6704 m_OldLocation = new InventoryLocation;
6705 }
6706 m_OldLocation.Copy(oldLoc);
6707 }
6708 else
6709 {
6710 if (m_OldLocation)
6711 {
6712 m_OldLocation.Reset();
6713 }
6714 }
6715
6717 }
6718 else
6719 {
6720 if (new_player)
6721 {
6722 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6723 if (res_index >= 0)
6724 {
6725 InventoryLocation il = new InventoryLocation;
6726 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6728 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6731 {
6732 il.
GetParent().GetOnReleaseLock().Invoke(it);
6733 }
6735 {
6737 }
6738
6739 }
6740 }
6742 {
6743
6745 }
6746
6747 if (m_OldLocation)
6748 {
6749 m_OldLocation.Reset();
6750 }
6751 }
6752 }
6753
6754 override void EOnContact(IEntity other, Contact extra)
6755 {
6757 {
6758 int liquidType = -1;
6760 if (impactSpeed > 0.0)
6761 {
6763 #ifndef SERVER
6765 #else
6767 SetSynchDirty();
6768 #endif
6770 }
6771 }
6772
6773 #ifdef SERVER
6774 if (GetCompEM() && GetCompEM().IsPlugged())
6775 {
6776 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6777 GetCompEM().UnplugThis();
6778 }
6779 #endif
6780 }
6781
6783
6785 {
6787 }
6788
6790 {
6791
6792 }
6793
6795 {
6796 super.OnItemLocationChanged(old_owner, new_owner);
6797
6798 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6799 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6800
6801 if (!relatedPlayer && playerNew)
6802 relatedPlayer = playerNew;
6803
6804 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6805 {
6807 if (actionMgr)
6808 {
6809 ActionBase currentAction = actionMgr.GetRunningAction();
6810 if (currentAction)
6812 }
6813 }
6814
6815 Man ownerPlayerOld = null;
6816 Man ownerPlayerNew = null;
6817
6818 if (old_owner)
6819 {
6820 if (old_owner.
IsMan())
6821 {
6822 ownerPlayerOld = Man.Cast(old_owner);
6823 }
6824 else
6825 {
6826 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6827 }
6828 }
6829 else
6830 {
6832 {
6834
6835 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6836 {
6837 GetCompEM().UnplugThis();
6838 }
6839 }
6840 }
6841
6842 if (new_owner)
6843 {
6844 if (new_owner.
IsMan())
6845 {
6846 ownerPlayerNew = Man.Cast(new_owner);
6847 }
6848 else
6849 {
6850 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6851 }
6852 }
6853
6854 if (ownerPlayerOld != ownerPlayerNew)
6855 {
6856 if (ownerPlayerOld)
6857 {
6858 array<EntityAI> subItemsExit = new array<EntityAI>;
6860 for (int i = 0; i < subItemsExit.Count(); i++)
6861 {
6864 }
6865 }
6866
6867 if (ownerPlayerNew)
6868 {
6869 array<EntityAI> subItemsEnter = new array<EntityAI>;
6871 for (int j = 0; j < subItemsEnter.Count(); j++)
6872 {
6875 }
6876 }
6877 }
6878 else if (ownerPlayerNew != null)
6879 {
6880 PlayerBase nplayer;
6881 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6882 {
6883 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6885 for (int k = 0; k < subItemsUpdate.Count(); k++)
6886 {
6888 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6889 }
6890 }
6891 }
6892
6893 if (old_owner)
6894 old_owner.OnChildItemRemoved(this);
6895 if (new_owner)
6896 new_owner.OnChildItemReceived(this);
6897 }
6898
6899
6901 {
6902 super.EEDelete(parent);
6903 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6904 if (player)
6905 {
6907
6908 if (player.IsAlive())
6909 {
6910 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6911 if (r_index >= 0)
6912 {
6913 InventoryLocation r_il = new InventoryLocation;
6914 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6915
6916 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6919 {
6920 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6921 }
6923 {
6924 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6925 }
6926
6927 }
6928
6929 player.RemoveQuickBarEntityShortcut(this);
6930 }
6931 }
6932 }
6933
6935 {
6936 super.EEKilled(killer);
6937
6940 {
6941 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6942 {
6943 if (IsMagazine())
6944 {
6945 if (Magazine.Cast(this).GetAmmoCount() > 0)
6946 {
6948 }
6949 }
6950 else
6951 {
6953 }
6954 }
6955 }
6956 }
6957
6959 {
6960 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6961
6962 super.OnWasAttached(parent, slot_id);
6963
6966
6968 }
6969
6971 {
6972 super.OnWasDetached(parent, slot_id);
6973
6976 }
6977
6979 {
6980 int idx;
6983
6984 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6985 if (inventory_slots.Count() < 1)
6986 {
6987 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6988 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6989 }
6990 else
6991 {
6992 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6993 }
6994
6995 idx = inventory_slots.Find(slot);
6996 if (idx < 0)
6997 return "";
6998
6999 return attach_types.Get(idx);
7000 }
7001
7003 {
7004 int idx = -1;
7005 string slot;
7006
7009
7010 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7011 if (inventory_slots.Count() < 1)
7012 {
7013 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7014 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7015 }
7016 else
7017 {
7018 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7019 if (detach_types.Count() < 1)
7020 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7021 }
7022
7023 for (int i = 0; i < inventory_slots.Count(); i++)
7024 {
7025 slot = inventory_slots.Get(i);
7026 }
7027
7028 if (slot != "")
7029 {
7030 if (detach_types.Count() == 1)
7031 idx = 0;
7032 else
7033 idx = inventory_slots.Find(slot);
7034 }
7035 if (idx < 0)
7036 return "";
7037
7038 return detach_types.Get(idx);
7039 }
7040
7042 {
7043
7045
7046
7047 float min_time = 1;
7048 float max_time = 3;
7049 float delay = Math.RandomFloat(min_time, max_time);
7050
7051 explode_timer.Run(delay, this, "DoAmmoExplosion");
7052 }
7053
7055 {
7056 Magazine magazine = Magazine.Cast(this);
7057 int pop_sounds_count = 6;
7058 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7059
7060
7061 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7062 string sound_name = pop_sounds[ sound_idx ];
7064
7065
7066 magazine.ServerAddAmmoCount(-1);
7067
7068
7069 float min_temp_to_explode = 100;
7070
7071 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
7072 {
7074 }
7075 }
7076
7077
7078 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7079 {
7080 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7081
7082 const int CHANCE_DAMAGE_CARGO = 4;
7083 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7084 const int CHANCE_DAMAGE_NOTHING = 2;
7085
7087 {
7088 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7089 int chances;
7090 int rnd;
7091
7092 if (GetInventory().GetCargo())
7093 {
7094 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7095 rnd = Math.RandomInt(0,chances);
7096
7097 if (rnd < CHANCE_DAMAGE_CARGO)
7098 {
7100 }
7101 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7102 {
7104 }
7105 }
7106 else
7107 {
7108 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7109 rnd = Math.RandomInt(0,chances);
7110
7111 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7112 {
7114 }
7115 }
7116 }
7117 }
7118
7120 {
7121 if (GetInventory().GetCargo())
7122 {
7123 int item_count = GetInventory().GetCargo().GetItemCount();
7124 if (item_count > 0)
7125 {
7126 int random_pick = Math.RandomInt(0, item_count);
7128 if (!item.IsExplosive())
7129 {
7130 item.AddHealth("","",damage);
7131 return true;
7132 }
7133 }
7134 }
7135 return false;
7136 }
7137
7139 {
7140 int attachment_count = GetInventory().AttachmentCount();
7141 if (attachment_count > 0)
7142 {
7143 int random_pick = Math.RandomInt(0, attachment_count);
7144 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7145 if (!attachment.IsExplosive())
7146 {
7147 attachment.AddHealth("","",damage);
7148 return true;
7149 }
7150 }
7151 return false;
7152 }
7153
7155 {
7157 }
7158
7160 {
7162 return GetInventory().CanRemoveEntity();
7163
7164 return false;
7165 }
7166
7168 {
7169
7171 return false;
7172
7173
7175 return false;
7176
7177
7178
7180 if (delta == 0)
7181 return false;
7182
7183
7184 return true;
7185 }
7186
7188 {
7190 {
7191 if (ScriptInputUserData.CanStoreInputUserData())
7192 {
7193 ScriptInputUserData ctx = new ScriptInputUserData;
7198 ctx.
Write(destination_entity);
7202 }
7203 }
7204 else if (!
GetGame().IsMultiplayer())
7205 {
7207 }
7208 }
7209
7211 {
7212 float split_quantity_new;
7216 InventoryLocation loc = new InventoryLocation;
7217
7218 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7219 {
7221 split_quantity_new = stack_max;
7222 else
7224
7226 {
7227 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7228 if (new_item)
7229 {
7230 new_item.SetResultOfSplit(true);
7231 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7233 new_item.
SetQuantity(split_quantity_new,
false,
true);
7234 }
7235 }
7236 }
7237 else if (destination_entity && slot_id == -1)
7238 {
7239 if (quantity > stack_max)
7240 split_quantity_new = stack_max;
7241 else
7242 split_quantity_new = quantity;
7243
7245 {
7247 {
7250 }
7251
7252 if (new_item)
7253 {
7254 new_item.SetResultOfSplit(true);
7255 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7257 new_item.
SetQuantity(split_quantity_new,
false,
true);
7258 }
7259 }
7260 }
7261 else
7262 {
7263 if (stack_max != 0)
7264 {
7266 {
7268 }
7269
7270 if (split_quantity_new == 0)
7271 {
7272 if (!
GetGame().IsMultiplayer())
7273 player.PhysicalPredictiveDropItem(this);
7274 else
7275 player.ServerDropEntity(this);
7276 return;
7277 }
7278
7280 {
7282
7283 if (new_item)
7284 {
7285 new_item.SetResultOfSplit(true);
7286 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7289 new_item.PlaceOnSurface();
7290 }
7291 }
7292 }
7293 }
7294 }
7295
7297 {
7298 float split_quantity_new;
7302 InventoryLocation loc = new InventoryLocation;
7303
7304 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7305 {
7307 split_quantity_new = stack_max;
7308 else
7310
7312 {
7313 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7314 if (new_item)
7315 {
7316 new_item.SetResultOfSplit(true);
7317 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7319 new_item.
SetQuantity(split_quantity_new,
false,
true);
7320 }
7321 }
7322 }
7323 else if (destination_entity && slot_id == -1)
7324 {
7325 if (quantity > stack_max)
7326 split_quantity_new = stack_max;
7327 else
7328 split_quantity_new = quantity;
7329
7331 {
7333 {
7336 }
7337
7338 if (new_item)
7339 {
7340 new_item.SetResultOfSplit(true);
7341 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7343 new_item.
SetQuantity(split_quantity_new,
false,
true);
7344 }
7345 }
7346 }
7347 else
7348 {
7349 if (stack_max != 0)
7350 {
7352 {
7354 }
7355
7357 {
7359
7360 if (new_item)
7361 {
7362 new_item.SetResultOfSplit(true);
7363 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7366 new_item.PlaceOnSurface();
7367 }
7368 }
7369 }
7370 }
7371 }
7372
7374 {
7376 {
7377 if (ScriptInputUserData.CanStoreInputUserData())
7378 {
7379 ScriptInputUserData ctx = new ScriptInputUserData;
7384 dst.WriteToContext(ctx);
7386 }
7387 }
7388 else if (!
GetGame().IsMultiplayer())
7389 {
7391 }
7392 }
7393
7395 {
7397 {
7398 if (ScriptInputUserData.CanStoreInputUserData())
7399 {
7400 ScriptInputUserData ctx = new ScriptInputUserData;
7405 ctx.
Write(destination_entity);
7411 }
7412 }
7413 else if (!
GetGame().IsMultiplayer())
7414 {
7416 }
7417 }
7418
7420 {
7422 }
7423
7425 {
7427 float split_quantity_new;
7429 if (dst.IsValid())
7430 {
7431 int slot_id = dst.GetSlot();
7433
7434 if (quantity > stack_max)
7435 split_quantity_new = stack_max;
7436 else
7437 split_quantity_new = quantity;
7438
7440 {
7442
7443 if (new_item)
7444 {
7445 new_item.SetResultOfSplit(true);
7446 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7448 new_item.
SetQuantity(split_quantity_new,
false,
true);
7449 }
7450
7451 return new_item;
7452 }
7453 }
7454
7455 return null;
7456 }
7457
7459 {
7461 float split_quantity_new;
7463 if (destination_entity)
7464 {
7466 if (quantity > stackable)
7467 split_quantity_new = stackable;
7468 else
7469 split_quantity_new = quantity;
7470
7472 {
7473 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7474 if (new_item)
7475 {
7476 new_item.SetResultOfSplit(true);
7477 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7479 new_item.
SetQuantity(split_quantity_new,
false,
true);
7480 }
7481 }
7482 }
7483 }
7484
7486 {
7488 {
7489 if (ScriptInputUserData.CanStoreInputUserData())
7490 {
7491 ScriptInputUserData ctx = new ScriptInputUserData;
7496 ItemBase destination_entity =
this;
7497 ctx.
Write(destination_entity);
7501 }
7502 }
7503 else if (!
GetGame().IsMultiplayer())
7504 {
7506 }
7507 }
7508
7510 {
7512 float split_quantity_new;
7514 if (player)
7515 {
7517 if (quantity > stackable)
7518 split_quantity_new = stackable;
7519 else
7520 split_quantity_new = quantity;
7521
7523 {
7524 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7525 new_item =
ItemBase.Cast(in_hands);
7526 if (new_item)
7527 {
7528 new_item.SetResultOfSplit(true);
7529 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7531 new_item.SetQuantity(split_quantity_new, false, true);
7532 }
7533 }
7534 }
7535 }
7536
7538 {
7540 float split_quantity_new = Math.Floor(quantity * 0.5);
7541
7543 return;
7544
7546
7547 if (new_item)
7548 {
7549 if (new_item.GetQuantityMax() < split_quantity_new)
7550 {
7551 split_quantity_new = new_item.GetQuantityMax();
7552 }
7553
7554 new_item.SetResultOfSplit(true);
7555 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7556
7558 {
7561 }
7562 else
7563 {
7565 new_item.
SetQuantity(split_quantity_new,
false,
true);
7566 }
7567 }
7568 }
7569
7571 {
7573 float split_quantity_new = Math.Floor(quantity / 2);
7574
7576 return;
7577
7578 InventoryLocation invloc = new InventoryLocation;
7580
7582 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7583
7584 if (new_item)
7585 {
7586 if (new_item.GetQuantityMax() < split_quantity_new)
7587 {
7588 split_quantity_new = new_item.GetQuantityMax();
7589 }
7591 {
7594 }
7595 else if (split_quantity_new > 1)
7596 {
7598 new_item.
SetQuantity(split_quantity_new,
false,
true);
7599 }
7600 }
7601 }
7602
7605 {
7606 SetWeightDirty();
7608
7609 if (parent)
7610 parent.OnAttachmentQuantityChangedEx(this, delta);
7611
7613 {
7615 {
7617 }
7619 {
7620 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7622 }
7623 }
7624
7625 }
7626
7629 {
7630
7631 }
7632
7635 {
7637 }
7638
7640 {
7641 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7642
7644 {
7645 if (newLevel == GameConstants.STATE_RUINED)
7646 {
7648 EntityAI parent = GetHierarchyParent();
7649 if (parent && parent.IsFireplace())
7650 {
7651 CargoBase cargo = GetInventory().GetCargo();
7652 if (cargo)
7653 {
7655 {
7657 }
7658 }
7659 }
7660 }
7661
7663 {
7664
7666 return;
7667 }
7668
7669 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7670 {
7672 }
7673 }
7674 }
7675
7676
7678 {
7679 super.OnRightClick();
7680
7682 {
7684 {
7685 if (ScriptInputUserData.CanStoreInputUserData())
7686 {
7687 EntityAI root = GetHierarchyRoot();
7688 Man playerOwner = GetHierarchyRootPlayer();
7689 InventoryLocation dst = new InventoryLocation;
7690
7691
7692 if (!playerOwner && root && root == this)
7693 {
7695 }
7696 else
7697 {
7698
7699 GetInventory().GetCurrentInventoryLocation(dst);
7701 {
7704 {
7706 }
7707 else
7708 {
7710
7711
7712 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7713 {
7715 }
7716 else
7717 {
7718 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7719 }
7720 }
7721 }
7722 }
7723
7724 ScriptInputUserData ctx = new ScriptInputUserData;
7732 }
7733 }
7734 else if (!
GetGame().IsMultiplayer())
7735 {
7737 }
7738 }
7739 }
7740
7742 {
7743 if (root)
7744 {
7745 vector m4[4];
7746 root.GetTransform(m4);
7747 dst.SetGround(this, m4);
7748 }
7749 else
7750 {
7751 GetInventory().GetCurrentInventoryLocation(dst);
7752 }
7753 }
7754
7755 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7756 {
7757
7758 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7759 return false;
7760
7761 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7762 return false;
7763
7764
7766 return false;
7767
7768
7769 Magazine mag = Magazine.Cast(this);
7770 if (mag)
7771 {
7772 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7773 return false;
7774
7775 if (stack_max_limit)
7776 {
7777 Magazine other_mag = Magazine.Cast(other_item);
7778 if (other_item)
7779 {
7780 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7781 return false;
7782 }
7783
7784 }
7785 }
7786 else
7787 {
7788
7790 return false;
7791
7793 return false;
7794 }
7795
7796 PlayerBase player = null;
7797 if (CastTo(player, GetHierarchyRootPlayer()))
7798 {
7799 if (player.GetInventory().HasAttachment(this))
7800 return false;
7801
7802 if (player.IsItemsToDelete())
7803 return false;
7804 }
7805
7806 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7807 return false;
7808
7809 int slotID;
7811 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7812 return false;
7813
7814 return true;
7815 }
7816
7818 {
7820 }
7821
7823 {
7824 return m_IsResultOfSplit;
7825 }
7826
7828 {
7829 m_IsResultOfSplit = value;
7830 }
7831
7833 {
7835 }
7836
7838 {
7839 float other_item_quantity = other_item.GetQuantity();
7840 float this_free_space;
7841
7843
7845
7846 if (other_item_quantity > this_free_space)
7847 {
7848 return this_free_space;
7849 }
7850 else
7851 {
7852 return other_item_quantity;
7853 }
7854 }
7855
7857 {
7859 }
7860
7862 {
7864 return;
7865
7866 if (!IsMagazine() && other_item)
7867 {
7869 if (quantity_used != 0)
7870 {
7871 float hp1 = GetHealth01("","");
7872 float hp2 = other_item.GetHealth01("","");
7873 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7874 hpResult = hpResult / (
GetQuantity() + quantity_used);
7875
7876 hpResult *= GetMaxHealth();
7877 Math.Round(hpResult);
7878 SetHealth("", "Health", hpResult);
7879
7881 other_item.AddQuantity(-quantity_used);
7882 }
7883 }
7885 }
7886
7888 {
7889 #ifdef SERVER
7890 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7891 GetHierarchyParent().IncreaseLifetimeUp();
7892 #endif
7893 };
7894
7896 {
7897 PlayerBase p = PlayerBase.Cast(player);
7898
7899 array<int> recipesIds = p.m_Recipes;
7900 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7901 if (moduleRecipesManager)
7902 {
7903 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7904 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7905 }
7906
7907 for (int i = 0;i < recipesIds.Count(); i++)
7908 {
7909 int key = recipesIds.Get(i);
7910 string recipeName = moduleRecipesManager.GetRecipeName(key);
7912 }
7913 }
7914
7915
7916 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7917 {
7918 super.GetDebugActions(outputList);
7919
7920
7926
7927
7932
7937
7938
7942
7943
7945 {
7949 }
7950
7953
7954
7958
7960
7961 InventoryLocation loc = new InventoryLocation();
7962 GetInventory().GetCurrentInventoryLocation(loc);
7964 {
7965 if (Gizmo_IsSupported())
7968 }
7969
7971 }
7972
7973
7974
7975
7977 {
7978 super.OnAction(action_id, player, ctx);
7979
7981 {
7982 switch (action_id)
7983 {
7986 return true;
7989 return true;
7990 }
7991 }
7992
7994 {
7995 switch (action_id)
7996 {
7998 Delete();
7999 return true;
8000 }
8001 }
8002
8003 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8004 {
8005 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8006 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8007 PlayerBase p = PlayerBase.Cast(player);
8008 if (
EActions.RECIPES_RANGE_START < 1000)
8009 {
8010 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8011 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8012 }
8013 }
8014 #ifndef SERVER
8015 else if (action_id ==
EActions.WATCH_PLAYER)
8016 {
8017 PluginDeveloper.SetDeveloperItemClientEx(player);
8018 }
8019 #endif
8021 {
8022 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8023 {
8024 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8025 OnDebugButtonPressServer(id + 1);
8026 }
8027
8028 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8029 {
8030 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8032 }
8033
8034 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8035 {
8036 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8038 }
8039
8040 else if (action_id ==
EActions.ADD_QUANTITY)
8041 {
8042 if (IsMagazine())
8043 {
8044 Magazine mag = Magazine.Cast(this);
8045 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8046 }
8047 else
8048 {
8050 }
8051
8052 if (m_EM)
8053 {
8054 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8055 }
8056
8057 }
8058
8059 else if (action_id ==
EActions.REMOVE_QUANTITY)
8060 {
8061 if (IsMagazine())
8062 {
8063 Magazine mag2 = Magazine.Cast(this);
8064 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8065 }
8066 else
8067 {
8069 }
8070 if (m_EM)
8071 {
8072 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8073 }
8074
8075 }
8076
8077 else if (action_id ==
EActions.SET_QUANTITY_0)
8078 {
8080
8081 if (m_EM)
8082 {
8083 m_EM.SetEnergy(0);
8084 }
8085 }
8086
8087 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8088 {
8090
8091 if (m_EM)
8092 {
8093 m_EM.SetEnergy(m_EM.GetEnergyMax());
8094 }
8095 }
8096
8097 else if (action_id ==
EActions.ADD_HEALTH)
8098 {
8099 AddHealth("","",GetMaxHealth("","Health")/5);
8100 }
8101 else if (action_id ==
EActions.REMOVE_HEALTH)
8102 {
8103 AddHealth("","",-GetMaxHealth("","Health")/5);
8104 }
8105 else if (action_id ==
EActions.DESTROY_HEALTH)
8106 {
8107 SetHealth01("","",0);
8108 }
8109 else if (action_id ==
EActions.WATCH_ITEM)
8110 {
8112 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8113 #ifdef DEVELOPER
8114 SetDebugDeveloper_item(this);
8115 #endif
8116 }
8117
8118 else if (action_id ==
EActions.ADD_TEMPERATURE)
8119 {
8120 AddTemperature(20);
8121
8122 }
8123
8124 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8125 {
8126 AddTemperature(-20);
8127
8128 }
8129
8130 else if (action_id ==
EActions.FLIP_FROZEN)
8131 {
8132 SetFrozen(!GetIsFrozen());
8133
8134 }
8135
8136 else if (action_id ==
EActions.ADD_WETNESS)
8137 {
8139
8140 }
8141
8142 else if (action_id ==
EActions.REMOVE_WETNESS)
8143 {
8145
8146 }
8147
8148 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8149 {
8152
8153
8154 }
8155
8156 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8157 {
8160 }
8161
8162 else if (action_id ==
EActions.MAKE_SPECIAL)
8163 {
8164 auto debugParams = DebugSpawnParams.WithPlayer(player);
8165 OnDebugSpawnEx(debugParams);
8166 }
8167
8168 }
8169
8170
8171 return false;
8172 }
8173
8174
8175
8176
8180
8183
8184
8185
8187 {
8188 return false;
8189 }
8190
8191
8193 {
8194 return true;
8195 }
8196
8197
8199 {
8200 return true;
8201 }
8202
8203
8204
8206 {
8207 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8209 }
8210
8213 {
8214 return null;
8215 }
8216
8218 {
8219 return false;
8220 }
8221
8223 {
8224 return false;
8225 }
8226
8230
8231
8233 {
8234 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8235 return module_repairing.CanRepair(this, item_repair_kit);
8236 }
8237
8238
8239 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8240 {
8241 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8242 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8243 }
8244
8245
8247 {
8248
8249
8250
8251
8252
8253
8254
8255
8256 return 1;
8257 }
8258
8259
8260
8262 {
8264 }
8265
8266
8267
8269 {
8271 }
8272
8273
8282 {
8283 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8284
8285 if (player)
8286 {
8287 player.MessageStatus(text);
8288 }
8289 }
8290
8291
8300 {
8301 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8302
8303 if (player)
8304 {
8305 player.MessageAction(text);
8306 }
8307 }
8308
8309
8318 {
8319 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8320
8321 if (player)
8322 {
8323 player.MessageFriendly(text);
8324 }
8325 }
8326
8327
8336 {
8337 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8338
8339 if (player)
8340 {
8341 player.MessageImportant(text);
8342 }
8343 }
8344
8346 {
8347 return true;
8348 }
8349
8350
8351 override bool KindOf(
string tag)
8352 {
8353 bool found = false;
8354 string item_name = this.
GetType();
8357
8358 int array_size = item_tag_array.Count();
8359 for (int i = 0; i < array_size; i++)
8360 {
8361 if (item_tag_array.Get(i) == tag)
8362 {
8363 found = true;
8364 break;
8365 }
8366 }
8367 return found;
8368 }
8369
8370
8372 {
8373
8374 super.OnRPC(sender, rpc_type,ctx);
8375
8376
8377 switch (rpc_type)
8378 {
8379 #ifndef SERVER
8380 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8381 Param2<bool, string> p = new Param2<bool, string>(false, "");
8382
8384 return;
8385
8386 bool play = p.param1;
8387 string soundSet = p.param2;
8388
8389 if (play)
8390 {
8392 {
8394 {
8396 }
8397 }
8398 else
8399 {
8401 }
8402 }
8403 else
8404 {
8406 }
8407
8408 break;
8409 #endif
8410
8411 }
8412
8414 {
8416 }
8417 }
8418
8419
8420
8421
8423 {
8424 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8425 return plugin.GetID(
name);
8426 }
8427
8429 {
8430 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8431 return plugin.GetName(id);
8432 }
8433
8436 {
8437
8438
8439 int varFlags;
8440 if (!ctx.
Read(varFlags))
8441 return;
8442
8443 if (varFlags & ItemVariableFlags.FLOAT)
8444 {
8446 }
8447 }
8448
8450 {
8451
8452 super.SerializeNumericalVars(floats_out);
8453
8454
8455
8457 {
8459 }
8460
8462 {
8464 }
8465
8467 {
8469 }
8470
8472 {
8477 }
8478
8480 {
8482 }
8483 }
8484
8486 {
8487
8488 super.DeSerializeNumericalVars(floats);
8489
8490
8491 int index = 0;
8492 int mask = Math.Round(floats.Get(index));
8493
8494 index++;
8495
8497 {
8499 {
8501 }
8502 else
8503 {
8504 float quantity = floats.Get(index);
8506 }
8507 index++;
8508 }
8509
8511 {
8512 float wet = floats.Get(index);
8514 index++;
8515 }
8516
8518 {
8519 int liquidtype = Math.Round(floats.Get(index));
8521 index++;
8522 }
8523
8525 {
8527 index++;
8529 index++;
8531 index++;
8533 index++;
8534 }
8535
8537 {
8538 int cleanness = Math.Round(floats.Get(index));
8540 index++;
8541 }
8542 }
8543
8545 {
8546 super.WriteVarsToCTX(ctx);
8547
8548
8550 {
8552 }
8553
8555 {
8557 }
8558
8560 {
8562 }
8563
8565 {
8566 int r,g,b,a;
8572 }
8573
8575 {
8577 }
8578 }
8579
8581 {
8582 if (!super.ReadVarsFromCTX(ctx,version))
8583 return false;
8584
8585 int intValue;
8586 float value;
8587
8588 if (version < 140)
8589 {
8590 if (!ctx.
Read(intValue))
8591 return false;
8592
8593 m_VariablesMask = intValue;
8594 }
8595
8597 {
8598 if (!ctx.
Read(value))
8599 return false;
8600
8602 {
8604 }
8605 else
8606 {
8608 }
8609 }
8610
8611 if (version < 140)
8612 {
8614 {
8615 if (!ctx.
Read(value))
8616 return false;
8617 SetTemperatureDirect(value);
8618 }
8619 }
8620
8622 {
8623 if (!ctx.
Read(value))
8624 return false;
8626 }
8627
8629 {
8630 if (!ctx.
Read(intValue))
8631 return false;
8633 }
8634
8636 {
8637 int r,g,b,a;
8639 return false;
8641 return false;
8643 return false;
8645 return false;
8646
8648 }
8649
8651 {
8652 if (!ctx.
Read(intValue))
8653 return false;
8655 }
8656
8657 if (version >= 138 && version < 140)
8658 {
8660 {
8661 if (!ctx.
Read(intValue))
8662 return false;
8663 SetFrozen(intValue);
8664 }
8665 }
8666
8667 return true;
8668 }
8669
8670
8672 {
8675 {
8677 }
8678
8679 if (!super.OnStoreLoad(ctx, version))
8680 {
8682 return false;
8683 }
8684
8685 if (version >= 114)
8686 {
8687 bool hasQuickBarIndexSaved;
8688
8689 if (!ctx.
Read(hasQuickBarIndexSaved))
8690 {
8692 return false;
8693 }
8694
8695 if (hasQuickBarIndexSaved)
8696 {
8697 int itmQBIndex;
8698
8699
8700 if (!ctx.
Read(itmQBIndex))
8701 {
8703 return false;
8704 }
8705
8706 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8707 if (itmQBIndex != -1 && parentPlayer)
8708 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8709 }
8710 }
8711 else
8712 {
8713
8714 PlayerBase player;
8715 int itemQBIndex;
8716 if (version ==
int.
MAX)
8717 {
8718 if (!ctx.
Read(itemQBIndex))
8719 {
8721 return false;
8722 }
8723 }
8724 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8725 {
8726
8727 if (!ctx.
Read(itemQBIndex))
8728 {
8730 return false;
8731 }
8732 if (itemQBIndex != -1 && player)
8733 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8734 }
8735 }
8736
8737 if (version < 140)
8738 {
8739
8740 if (!LoadVariables(ctx, version))
8741 {
8743 return false;
8744 }
8745 }
8746
8747
8749 {
8751 return false;
8752 }
8753 if (version >= 132)
8754 {
8756 if (raib)
8757 {
8759 {
8761 return false;
8762 }
8763 }
8764 }
8765
8767 return true;
8768 }
8769
8770
8771
8773 {
8774 super.OnStoreSave(ctx);
8775
8776 PlayerBase player;
8777 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8778 {
8780
8781 int itemQBIndex = -1;
8782 itemQBIndex = player.FindQuickBarEntityIndex(this);
8783 ctx.
Write(itemQBIndex);
8784 }
8785 else
8786 {
8788 }
8789
8791
8793 if (raib)
8794 {
8796 }
8797 }
8798
8799
8801 {
8802 super.AfterStoreLoad();
8803
8805 {
8807 }
8808
8810 {
8813 }
8814 }
8815
8817 {
8818 super.EEOnAfterLoad();
8819
8821 {
8823 }
8824
8827 }
8828
8830 {
8831 return false;
8832 }
8833
8834
8835
8837 {
8839 {
8840 #ifdef PLATFORM_CONSOLE
8841
8843 {
8845 if (menu)
8846 {
8848 }
8849 }
8850 #endif
8851 }
8852
8854 {
8857 }
8858
8860 {
8861 SetWeightDirty();
8863 }
8865 {
8868 }
8869
8871 {
8874 }
8876 {
8879 }
8880
8881 super.OnVariablesSynchronized();
8882 }
8883
8884
8885
8887 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8888 {
8889 if (!IsServerCheck(allow_client))
8890 return false;
8891
8893 return false;
8894
8897
8898 if (value <= (min + 0.001))
8899 value = min;
8900
8901 if (value == min)
8902 {
8903 if (destroy_config)
8904 {
8905 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8906 if (dstr)
8907 {
8909 this.Delete();
8910 return true;
8911 }
8912 }
8913 else if (destroy_forced)
8914 {
8916 this.Delete();
8917 return true;
8918 }
8919
8921 }
8922
8925
8927 {
8929
8930 if (delta)
8932 }
8933
8935
8936 return false;
8937 }
8938
8939
8941 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8942 {
8944 }
8945
8947 {
8950 }
8951
8953 {
8956 }
8957
8959 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8960 {
8961 float value_clamped = Math.Clamp(value, 0, 1);
8963 SetQuantity(result, destroy_config, destroy_forced);
8964 }
8965
8966
8969 {
8971 }
8972
8974 {
8976 }
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8988 {
8989 int slot = -1;
8990 if (GetInventory())
8991 {
8992 InventoryLocation il = new InventoryLocation;
8993 GetInventory().GetCurrentInventoryLocation(il);
8995 }
8996
8998 }
8999
9001 {
9002 float quantity_max = 0;
9003
9005 {
9006 if (attSlotID != -1)
9007 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9008
9009 if (quantity_max <= 0)
9011 }
9012
9013 if (quantity_max <= 0)
9015
9016 return quantity_max;
9017 }
9018
9020 {
9022 }
9023
9025 {
9027 }
9028
9029
9031 {
9033 }
9034
9036 {
9038 }
9039
9041 {
9043 }
9044
9045
9047 {
9048
9049 float weightEx = GetWeightEx();
9050 float special = GetInventoryAndCargoWeight();
9051 return weightEx - special;
9052 }
9053
9054
9056 {
9058 }
9059
9061 {
9063 {
9064 #ifdef DEVELOPER
9065 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9066 {
9067 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9069 }
9070 #endif
9071
9073 }
9074 else if (HasEnergyManager())
9075 {
9076 #ifdef DEVELOPER
9077 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9078 {
9079 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9080 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9081 }
9082 #endif
9083 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
9084 }
9085 else
9086 {
9087 #ifdef DEVELOPER
9088 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9089 {
9090 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9091 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9092 }
9093 #endif
9094 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9095 }
9096 }
9097
9100 {
9101 int item_count = 0;
9103
9104 if (GetInventory().GetCargo() != NULL)
9105 {
9106 item_count = GetInventory().GetCargo().GetItemCount();
9107 }
9108
9109 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9110 {
9111 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9112 if (item)
9113 item_count += item.GetNumberOfItems();
9114 }
9115 return item_count;
9116 }
9117
9120 {
9121 float weight = 0;
9122 float wetness = 1;
9123 if (include_wetness)
9126 {
9127 weight = wetness * m_ConfigWeight;
9128 }
9130 {
9131 weight = 1;
9132 }
9133 return weight;
9134 }
9135
9136
9137
9139 {
9140 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9141 {
9142 GameInventory inv = GetInventory();
9143 array<EntityAI> items = new array<EntityAI>;
9145 for (int i = 0; i < items.Count(); i++)
9146 {
9148 if (item)
9149 {
9151 }
9152 }
9153 }
9154 }
9155
9156
9157
9158
9160 {
9161 float energy = 0;
9162 if (HasEnergyManager())
9163 {
9164 energy = GetCompEM().GetEnergy();
9165 }
9166 return energy;
9167 }
9168
9169
9171 {
9172 super.OnEnergyConsumed();
9173
9175 }
9176
9178 {
9179 super.OnEnergyAdded();
9180
9182 }
9183
9184
9186 {
9187 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9188 {
9190 {
9191 float energy_0to1 = GetCompEM().GetEnergy0To1();
9193 }
9194 }
9195 }
9196
9197
9199 {
9200 return ConfigGetFloat("heatIsolation");
9201 }
9202
9204 {
9206 }
9207
9209 {
9210 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9211 if (
GetGame().ConfigIsExisting(paramPath))
9213
9214 return 0.0;
9215 }
9216
9218 {
9219 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9220 if (
GetGame().ConfigIsExisting(paramPath))
9222
9223 return 0.0;
9224 }
9225
9226 override void SetWet(
float value,
bool allow_client =
false)
9227 {
9228 if (!IsServerCheck(allow_client))
9229 return;
9230
9233
9235
9236 m_VarWet = Math.Clamp(value, min, max);
9237
9239 {
9242 }
9243 }
9244
9245 override void AddWet(
float value)
9246 {
9248 }
9249
9251 {
9253 }
9254
9256 {
9258 }
9259
9261 {
9263 }
9264
9266 {
9268 }
9269
9271 {
9273 }
9274
9276 {
9279 if (newLevel != oldLevel)
9280 {
9282 }
9283 }
9284
9286 {
9287 SetWeightDirty();
9288 }
9289
9291 {
9292 return GetWetLevelInternal(
m_VarWet);
9293 }
9294
9295
9296
9298 {
9300 }
9301
9303 {
9305 }
9306
9308 {
9310 }
9311
9313 {
9315 }
9316
9317
9318
9320 {
9321 if (ConfigIsExisting("itemModelLength"))
9322 {
9323 return ConfigGetFloat("itemModelLength");
9324 }
9325 return 0;
9326 }
9327
9329 {
9330 if (ConfigIsExisting("itemAttachOffset"))
9331 {
9332 return ConfigGetFloat("itemAttachOffset");
9333 }
9334 return 0;
9335 }
9336
9337 override void SetCleanness(
int value,
bool allow_client =
false)
9338 {
9339 if (!IsServerCheck(allow_client))
9340 return;
9341
9343
9345
9348 }
9349
9351 {
9353 }
9354
9356 {
9357 return true;
9358 }
9359
9360
9361
9362
9364 {
9366 }
9367
9369 {
9371 }
9372
9373
9374
9375
9376 override void SetColor(
int r,
int g,
int b,
int a)
9377 {
9383 }
9385 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9386 {
9391 }
9392
9394 {
9396 }
9397
9400 {
9401 int r,g,b,a;
9403 r = r/255;
9404 g = g/255;
9405 b = b/255;
9406 a = a/255;
9407 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9408 }
9409
9410
9411
9412 override void SetLiquidType(
int value,
bool allow_client =
false)
9413 {
9414 if (!IsServerCheck(allow_client))
9415 return;
9416
9421 }
9422
9424 {
9425 return ConfigGetInt("varLiquidTypeInit");
9426 }
9427
9429 {
9431 }
9432
9434 {
9436 SetFrozen(false);
9437 }
9438
9441 {
9442 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9443 }
9444
9445
9448 {
9449 PlayerBase nplayer;
9450 if (PlayerBase.CastTo(nplayer, player))
9451 {
9453
9454 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9455 }
9456 }
9457
9458
9461 {
9462 PlayerBase nplayer;
9463 if (PlayerBase.CastTo(nplayer,player))
9464 {
9465
9466 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9467
9468 }
9469
9470
9471 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9472
9473
9474 if (HasEnergyManager())
9475 {
9476 GetCompEM().UpdatePlugState();
9477 }
9478 }
9479
9480
9482 {
9483 super.OnPlacementStarted(player);
9484
9486 }
9487
9488 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9489 {
9491 {
9492 m_AdminLog.OnPlacementComplete(player,
this);
9493 }
9494
9495 super.OnPlacementComplete(player, position, orientation);
9496 }
9497
9498
9499
9500
9501
9503 {
9505 {
9506 return true;
9507 }
9508 else
9509 {
9510 return false;
9511 }
9512 }
9513
9514
9516 {
9518 {
9520 }
9521 }
9522
9523
9525 {
9527 }
9528
9530 {
9532 }
9533
9534 override void InsertAgent(
int agent,
float count = 1)
9535 {
9536 if (count < 1)
9537 return;
9538
9540 }
9541
9544 {
9546 }
9547
9548
9550 {
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
9587
9588
9589
9590
9591
9592
9593
9594
9596 {
9598 return false;
9599 return true;
9600 }
9601
9603 {
9604
9606 }
9607
9608
9611 {
9612 super.CheckForRoofLimited(timeTresholdMS);
9613
9615 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9616 {
9617 m_PreviousRoofTestTime = time;
9618 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9619 }
9620 }
9621
9622
9624 {
9626 {
9627 return 0;
9628 }
9629
9630 if (GetInventory().GetAttachmentSlotsCount() != 0)
9631 {
9632 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9633 if (filter)
9634 return filter.GetProtectionLevel(type, false, system);
9635 else
9636 return 0;
9637 }
9638
9639 string subclassPath, entryName;
9640
9641 switch (type)
9642 {
9644 entryName = "biological";
9645 break;
9647 entryName = "chemical";
9648 break;
9649 default:
9650 entryName = "biological";
9651 break;
9652 }
9653
9654 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9655
9657 }
9658
9659
9660
9663 {
9664 if (!IsMagazine())
9666
9668 }
9669
9670
9671
9672
9673
9678 {
9679 return true;
9680 }
9681
9683 {
9685 }
9686
9687
9688
9689
9690
9692 {
9693 if (parent)
9694 {
9695 if (parent.IsInherited(DayZInfected))
9696 return true;
9697
9698 if (!parent.IsRuined())
9699 return true;
9700 }
9701
9702 return true;
9703 }
9704
9706 {
9707 if (!super.CanPutAsAttachment(parent))
9708 {
9709 return false;
9710 }
9711
9712 if (!IsRuined() && !parent.IsRuined())
9713 {
9714 return true;
9715 }
9716
9717 return false;
9718 }
9719
9721 {
9722
9723
9724
9725
9726 return super.CanReceiveItemIntoCargo(item);
9727 }
9728
9730 {
9731
9732
9733
9734
9735 GameInventory attachmentInv = attachment.GetInventory();
9737 {
9738 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9739 return false;
9740 }
9741
9742 InventoryLocation loc = new InventoryLocation();
9743 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9744 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9745 return false;
9746
9747 return super.CanReceiveAttachment(attachment, slotId);
9748 }
9749
9751 {
9752 if (!super.CanReleaseAttachment(attachment))
9753 return false;
9754
9755 return GetInventory().AreChildrenAccessible();
9756 }
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9779 {
9780 int id = muzzle_owner.GetMuzzleID();
9781 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9782
9783 if (WPOF_array)
9784 {
9785 for (int i = 0; i < WPOF_array.Count(); i++)
9786 {
9787 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9788
9789 if (WPOF)
9790 {
9791 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9792 }
9793 }
9794 }
9795 }
9796
9797
9799 {
9800 int id = muzzle_owner.GetMuzzleID();
9802
9803 if (WPOBE_array)
9804 {
9805 for (int i = 0; i < WPOBE_array.Count(); i++)
9806 {
9807 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9808
9809 if (WPOBE)
9810 {
9811 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9812 }
9813 }
9814 }
9815 }
9816
9817
9819 {
9820 int id = muzzle_owner.GetMuzzleID();
9821 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9822
9823 if (WPOOH_array)
9824 {
9825 for (int i = 0; i < WPOOH_array.Count(); i++)
9826 {
9827 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9828
9829 if (WPOOH)
9830 {
9831 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9832 }
9833 }
9834 }
9835 }
9836
9837
9839 {
9840 int id = muzzle_owner.GetMuzzleID();
9841 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9842
9843 if (WPOOH_array)
9844 {
9845 for (int i = 0; i < WPOOH_array.Count(); i++)
9846 {
9847 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9848
9849 if (WPOOH)
9850 {
9851 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9852 }
9853 }
9854 }
9855 }
9856
9857
9859 {
9860 int id = muzzle_owner.GetMuzzleID();
9861 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9862
9863 if (WPOOH_array)
9864 {
9865 for (int i = 0; i < WPOOH_array.Count(); i++)
9866 {
9867 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9868
9869 if (WPOOH)
9870 {
9871 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9872 }
9873 }
9874 }
9875 }
9876
9877
9878
9880 {
9882 {
9883 return true;
9884 }
9885
9886 return false;
9887 }
9888
9890 {
9892 {
9893 return true;
9894 }
9895
9896 return false;
9897 }
9898
9900 {
9902 {
9903 return true;
9904 }
9905
9906 return false;
9907 }
9908
9910 {
9911 return false;
9912 }
9913
9916 {
9917 return UATimeSpent.DEFAULT_DEPLOY;
9918 }
9919
9920
9921
9922
9924 {
9926 SetSynchDirty();
9927 }
9928
9930 {
9932 }
9933
9934
9936 {
9937 return false;
9938 }
9939
9942 {
9943 string att_type = "None";
9944
9945 if (ConfigIsExisting("soundAttType"))
9946 {
9947 att_type = ConfigGetString("soundAttType");
9948 }
9949
9951 }
9952
9954 {
9956 }
9957
9958
9959
9960
9961
9967
9969 {
9972
9974 }
9975
9976
9978 {
9980 return;
9981
9983
9986
9989
9990 SoundParameters params = new SoundParameters();
9994 }
9995
9996
9998 {
10000 return;
10001
10003 SetSynchDirty();
10004
10007 }
10008
10009
10011 {
10013 return;
10014
10016 SetSynchDirty();
10017
10020 }
10021
10023 {
10025 }
10026
10028 {
10030 }
10031
10034 {
10035 if (!
GetGame().IsDedicatedServer())
10036 {
10037 if (ConfigIsExisting("attachSoundSet"))
10038 {
10039 string cfg_path = "";
10040 string soundset = "";
10041 string type_name =
GetType();
10042
10045 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10046 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10047
10048 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10049 {
10050 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10051 {
10052 if (cfg_slot_array[i] == slot_type)
10053 {
10054 soundset = cfg_soundset_array[i];
10055 break;
10056 }
10057 }
10058 }
10059
10060 if (soundset != "")
10061 {
10062 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10064 }
10065 }
10066 }
10067 }
10068
10070 {
10071
10072 }
10073
10074 void OnApply(PlayerBase player);
10075
10077 {
10078 return 1.0;
10079 };
10080
10082 {
10084 }
10085
10087 {
10089 }
10090
10092
10094 {
10095 SetDynamicPhysicsLifeTime(0.01);
10097 }
10098
10100 {
10101 array<string> zone_names = new array<string>;
10102 GetDamageZones(zone_names);
10103 for (int i = 0; i < zone_names.Count(); i++)
10104 {
10105 SetHealthMax(zone_names.Get(i),"Health");
10106 }
10107 SetHealthMax("","Health");
10108 }
10109
10112 {
10113 float global_health = GetHealth01("","Health");
10114 array<string> zones = new array<string>;
10115 GetDamageZones(zones);
10116
10117 for (int i = 0; i < zones.Count(); i++)
10118 {
10119 SetHealth01(zones.Get(i),"Health",global_health);
10120 }
10121 }
10122
10125 {
10126 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10127 }
10128
10130 {
10131 if (!hasRootAsPlayer)
10132 {
10133 if (refParentIB)
10134 {
10135
10136 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10137 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10138
10139 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10140 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10141
10144 }
10145 else
10146 {
10147
10150 }
10151 }
10152 }
10153
10155 {
10157 {
10158 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10159 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10160 {
10161 float heatPermCoef = 1.0;
10163 while (ent)
10164 {
10165 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10166 ent = ent.GetHierarchyParent();
10167 }
10168
10169 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10170 }
10171 }
10172 }
10173
10175 {
10176
10177 EntityAI parent = GetHierarchyParent();
10178 if (!parent)
10179 {
10180 hasParent = false;
10181 hasRootAsPlayer = false;
10182 }
10183 else
10184 {
10185 hasParent = true;
10186 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10187 refParentIB =
ItemBase.Cast(parent);
10188 }
10189 }
10190
10191 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10192 {
10193
10194 }
10195
10197 {
10198
10199 return false;
10200 }
10201
10203 {
10204
10205
10206 return false;
10207 }
10208
10210 {
10211
10212 return false;
10213 }
10214
10217 {
10218 return !GetIsFrozen() &&
IsOpen();
10219 }
10220
10222 {
10223 bool hasParent = false, hasRootAsPlayer = false;
10225
10226 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10227 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10228
10229 if (wwtu || foodDecay)
10230 {
10234
10235 if (processWetness || processTemperature || processDecay)
10236 {
10238
10239 if (processWetness)
10240 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10241
10242 if (processTemperature)
10244
10245 if (processDecay)
10246 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10247 }
10248 }
10249 }
10250
10253 {
10255 }
10256
10258 {
10261
10262 return super.GetTemperatureFreezeThreshold();
10263 }
10264
10266 {
10269
10270 return super.GetTemperatureThawThreshold();
10271 }
10272
10274 {
10277
10278 return super.GetItemOverheatThreshold();
10279 }
10280
10282 {
10284 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10285
10286 return super.GetTemperatureFreezeTime();
10287 }
10288
10290 {
10292 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10293
10294 return super.GetTemperatureThawTime();
10295 }
10296
10301
10303 {
10304 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10305 }
10306
10308 {
10309 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10310 }
10311
10314 {
10316 }
10317
10319 {
10321 }
10322
10324 {
10326 }
10327
10330 {
10331 return null;
10332 }
10333
10336 {
10337 return false;
10338 }
10339
10341 {
10343 {
10346 if (!trg)
10347 {
10349 explosive = this;
10350 }
10351
10352 explosive.PairRemote(trg);
10354
10355 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10356 trg.SetPersistentPairID(persistentID);
10357 explosive.SetPersistentPairID(persistentID);
10358
10359 return true;
10360 }
10361 return false;
10362 }
10363
10366 {
10367 float ret = 1.0;
10370 ret *= GetHealth01();
10371
10372 return ret;
10373 }
10374
10375 #ifdef DEVELOPER
10376 override void SetDebugItem()
10377 {
10378 super.SetDebugItem();
10379 _itemBase = this;
10380 }
10381
10383 {
10384 string text = super.GetDebugText();
10385
10387 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10388
10389 return text;
10390 }
10391 #endif
10392
10394 {
10395 return true;
10396 }
10397
10399
10401
10403 {
10406 }
10407
10408
10416
10432}
10433
10435{
10437 if (entity)
10438 {
10439 bool is_item = entity.IsInherited(
ItemBase);
10440 if (is_item && full_quantity)
10441 {
10444 }
10445 }
10446 else
10447 {
10449 return NULL;
10450 }
10451 return entity;
10452}
10453
10455{
10456 if (item)
10457 {
10458 if (health > 0)
10459 item.SetHealth("", "", health);
10460
10461 if (item.CanHaveTemperature())
10462 {
10464 if (item.CanFreeze())
10465 item.SetFrozen(false);
10466 }
10467
10468 if (item.HasEnergyManager())
10469 {
10470 if (quantity >= 0)
10471 {
10472 item.GetCompEM().SetEnergy0To1(quantity);
10473 }
10474 else
10475 {
10477 }
10478 }
10479 else if (item.IsMagazine())
10480 {
10481 Magazine mag = Magazine.Cast(item);
10482 if (quantity >= 0)
10483 {
10484 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10485 }
10486 else
10487 {
10489 }
10490
10491 }
10492 else
10493 {
10494 if (quantity >= 0)
10495 {
10496 item.SetQuantityNormalized(quantity, false);
10497 }
10498 else
10499 {
10501 }
10502
10503 }
10504 }
10505}
10506
10507#ifdef DEVELOPER
10509#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.