5688{
5690 {
5691 return true;
5692 }
5693};
5694
5695
5696
5698{
5702
5704
5707
5708
5709
5710
5711
5720
5726
5731
5736
5757 protected bool m_IsResultOfSplit
5758
5760
5765
5766
5767
5769
5773
5774
5775
5777
5780
5781
5782
5788
5789
5797
5800
5801
5803
5804
5806
5807
5812
5813
5818
5819
5821
5822
5824 {
5829
5830 if (!
GetGame().IsDedicatedServer())
5831 {
5833 {
5835
5837 {
5839 }
5840 }
5841
5844 }
5845
5846 m_OldLocation = null;
5847
5849 {
5851 }
5852
5853 if (ConfigIsExisting("headSelectionsToHide"))
5854 {
5857 }
5858
5860 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5861 {
5863 }
5864
5866
5867 m_IsResultOfSplit = false;
5868
5870 }
5871
5873 {
5874 super.InitItemVariables();
5875
5881 m_Count = ConfigGetInt(
"count");
5882
5885
5890
5893
5898
5910
5914
5915
5918 if (ConfigIsExisting("canBeSplit"))
5919 {
5922 }
5923
5925 if (ConfigIsExisting("itemBehaviour"))
5927
5928
5931 RegisterNetSyncVariableInt("m_VarLiquidType");
5932 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5933
5934 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5935 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5936 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5937
5938 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5939 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5940 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5941 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5942
5943 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5944 RegisterNetSyncVariableBool("m_IsTakeable");
5945 RegisterNetSyncVariableBool("m_IsHologram");
5946
5949 {
5952 }
5953
5955
5957 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5959
5960 }
5961
5963 {
5965 }
5966
5968 {
5971 {
5976 }
5977 }
5978
5979 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5980 {
5982 {
5985 }
5986
5988 }
5989
5991 {
5997 }
5998
6000
6002 {
6004
6005 if (!action)
6006 {
6007 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6008 return;
6009 }
6010
6012 if (!ai)
6013 {
6015 return;
6016 }
6017
6019 if (!action_array)
6020 {
6021 action_array = new array<ActionBase_Basic>;
6023 }
6024 if (LogManager.IsActionLogEnable())
6025 {
6026 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6027 }
6028
6029 if (action_array.Find(action) != -1)
6030 {
6031 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6032 }
6033 else
6034 {
6035 action_array.Insert(action);
6036 }
6037 }
6038
6040 {
6042 ActionBase action = player.GetActionManager().GetAction(actionName);
6045
6046 if (action_array)
6047 {
6048 action_array.RemoveItem(action);
6049 }
6050 }
6051
6052
6053
6055 {
6056 ActionOverrideData overrideData = new ActionOverrideData();
6060
6062 if (!actionMap)
6063 {
6066 }
6067
6068 actionMap.Insert(this.
Type(), overrideData);
6069
6070 }
6071
6073
6075
6076
6078 {
6081
6084
6085 string config_to_search = "CfgVehicles";
6086 string muzzle_owner_config;
6087
6089 {
6090 if (IsInherited(Weapon))
6091 config_to_search = "CfgWeapons";
6092
6093 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6094
6095 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6096
6098
6099 if (config_OnFire_subclass_count > 0)
6100 {
6101 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6102
6103 for (int i = 0; i < config_OnFire_subclass_count; i++)
6104 {
6105 string particle_class = "";
6107 string config_OnFire_entry = config_OnFire_class + particle_class;
6108 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6109 WPOF_array.Insert(WPOF);
6110 }
6111
6112
6114 }
6115 }
6116
6118 {
6119 config_to_search = "CfgWeapons";
6120 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6121
6122 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6123
6125
6126 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6127 {
6128 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6129
6130 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6131 {
6132 string particle_class2 = "";
6134 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6135 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6136 WPOBE_array.Insert(WPOBE);
6137 }
6138
6139
6141 }
6142 }
6143 }
6144
6145
6147 {
6150
6152 {
6153 string config_to_search = "CfgVehicles";
6154
6155 if (IsInherited(Weapon))
6156 config_to_search = "CfgWeapons";
6157
6158 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6159 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6160
6161 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6162 {
6163
6165
6167 {
6169 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6171 return;
6172 }
6173
6176
6177
6178
6180 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6181
6182 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6183 {
6184 string particle_class = "";
6186 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6188
6189 if (entry_type == CT_CLASS)
6190 {
6191 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6192 WPOOH_array.Insert(WPOF);
6193 }
6194 }
6195
6196
6198 }
6199 }
6200 }
6201
6203 {
6205 }
6206
6208 {
6210 {
6212
6215
6218
6219 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6220 }
6221 }
6222
6224 {
6226 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6227
6229 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6230
6232 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6233
6235 {
6237 }
6238 }
6239
6241 {
6243 }
6244
6246 {
6249 else
6251
6253 {
6256 }
6257 else
6258 {
6261
6264 }
6265
6267 }
6268
6270 {
6272 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6273 }
6274
6276 {
6278 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6280 }
6281
6283 {
6285 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6286 }
6287
6289 {
6292
6293 OverheatingParticle OP = new OverheatingParticle();
6298
6300 }
6301
6303 {
6306
6307 return -1;
6308 }
6309
6311 {
6313 {
6316
6317 for (int i = count; i > 0; --i)
6318 {
6319 int id = i - 1;
6322
6325
6326 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6327 {
6328 if (p)
6329 {
6332 }
6333 }
6334 }
6335 }
6336 }
6337
6339 {
6341 {
6343 {
6344 int id = i - 1;
6346
6347 if (OP)
6348 {
6350
6351 if (p)
6352 {
6354 }
6355
6356 delete OP;
6357 }
6358 }
6359
6362 }
6363 }
6364
6367 {
6368 return 0.0;
6369 }
6370
6371
6373 {
6374 return 250;
6375 }
6376
6378 {
6379 return 0;
6380 }
6381
6384 {
6386 return true;
6387
6388 return false;
6389 }
6390
6393 {
6396
6398 {
6400 }
6401 else
6402 {
6403
6405 }
6406
6408 }
6409
6416 {
6417 return -1;
6418 }
6419
6420
6421
6422
6424 {
6426 {
6428 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6429
6430 if (r_index >= 0)
6431 {
6432 InventoryLocation r_il = new InventoryLocation;
6433 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6434
6435 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6438 {
6439 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6440 }
6442 {
6443 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6444 }
6445
6446 }
6447
6448 player.GetHumanInventory().ClearUserReservedLocation(this);
6449 }
6450
6453 }
6454
6455
6456
6457
6459 {
6460 return ItemBase.m_DebugActionsMask;
6461 }
6462
6464 {
6465 return ItemBase.m_DebugActionsMask & mask;
6466 }
6467
6469 {
6470 ItemBase.m_DebugActionsMask = mask;
6471 }
6472
6474 {
6475 ItemBase.m_DebugActionsMask |= mask;
6476 }
6477
6479 {
6480 ItemBase.m_DebugActionsMask &= ~mask;
6481 }
6482
6484 {
6486 {
6488 }
6489 else
6490 {
6492 }
6493 }
6494
6495
6497 {
6498 if (GetEconomyProfile())
6499 {
6500 float q_max = GetEconomyProfile().GetQuantityMax();
6501 if (q_max > 0)
6502 {
6503 float q_min = GetEconomyProfile().GetQuantityMin();
6504 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6505
6507 {
6508 ComponentEnergyManager comp = GetCompEM();
6510 {
6512 }
6513 }
6515 {
6517
6518 }
6519
6520 }
6521 }
6522 }
6523
6526 {
6527 EntityAI parent = GetHierarchyParent();
6528
6529 if (parent)
6530 {
6531 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6532 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6533 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6534 }
6535 }
6536
6539 {
6540 EntityAI parent = GetHierarchyParent();
6541
6542 if (parent)
6543 {
6544 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6545 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6546 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6547 }
6548 }
6549
6551 {
6552
6553
6554
6555
6557
6559 {
6560 if (ScriptInputUserData.CanStoreInputUserData())
6561 {
6562 ScriptInputUserData ctx = new ScriptInputUserData;
6568 ctx.
Write(use_stack_max);
6571
6573 {
6574 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6575 }
6576 }
6577 }
6578 else if (!
GetGame().IsMultiplayer())
6579 {
6581 }
6582 }
6583
6585 {
6587 }
6588
6590 {
6592 }
6593
6595 {
6597 }
6598
6600 {
6601
6602 return false;
6603 }
6604
6606 {
6607 return false;
6608 }
6609
6613 {
6614 return false;
6615 }
6616
6618 {
6619 return "";
6620 }
6621
6623
6625 {
6626 return false;
6627 }
6628
6630 {
6631 return true;
6632 }
6633
6634
6635
6637 {
6638 return true;
6639 }
6640
6642 {
6643 return true;
6644 }
6645
6647 {
6648 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6650 }
6651
6653 {
6655 }
6656
6658 {
6660 if (!is_being_placed)
6662 SetSynchDirty();
6663 }
6664
6665
6667
6669 {
6671 }
6672
6674 {
6676 }
6677
6679 {
6680 return 1;
6681 }
6682
6684 {
6685 return false;
6686 }
6687
6689 {
6691 SetSynchDirty();
6692 }
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6729 {
6730 super.OnMovedInsideCargo(container);
6731
6732 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6733 }
6734
6735 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6736 {
6737 super.EEItemLocationChanged(oldLoc,newLoc);
6738
6739 PlayerBase new_player = null;
6740 PlayerBase old_player = null;
6741
6742 if (newLoc.GetParent())
6743 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6744
6745 if (oldLoc.GetParent())
6746 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6747
6749 {
6750 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6751
6752 if (r_index >= 0)
6753 {
6754 InventoryLocation r_il = new InventoryLocation;
6755 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6756
6757 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6760 {
6761 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6762 }
6764 {
6765 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6766 }
6767
6768 }
6769 }
6770
6772 {
6773 if (new_player)
6774 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6775
6776 if (new_player == old_player)
6777 {
6778
6779 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6780 {
6782 {
6783 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6784 {
6785 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6786 }
6787 }
6788 else
6789 {
6790 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6791 }
6792 }
6793
6794 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6795 {
6796 int type = oldLoc.GetType();
6798 {
6799 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6800 }
6802 {
6803 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6804 }
6805 }
6806 if (!m_OldLocation)
6807 {
6808 m_OldLocation = new InventoryLocation;
6809 }
6810 m_OldLocation.Copy(oldLoc);
6811 }
6812 else
6813 {
6814 if (m_OldLocation)
6815 {
6816 m_OldLocation.Reset();
6817 }
6818 }
6819
6821 }
6822 else
6823 {
6824 if (new_player)
6825 {
6826 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6827 if (res_index >= 0)
6828 {
6829 InventoryLocation il = new InventoryLocation;
6830 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6832 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6835 {
6836 il.
GetParent().GetOnReleaseLock().Invoke(it);
6837 }
6839 {
6841 }
6842
6843 }
6844 }
6846 {
6847
6849 }
6850
6851 if (m_OldLocation)
6852 {
6853 m_OldLocation.Reset();
6854 }
6855 }
6856 }
6857
6858 override void EOnContact(IEntity other, Contact extra)
6859 {
6861 {
6862 int liquidType = -1;
6864 if (impactSpeed > 0.0)
6865 {
6867 #ifndef SERVER
6869 #else
6871 SetSynchDirty();
6872 #endif
6874 }
6875 }
6876
6877 #ifdef SERVER
6878 if (GetCompEM() && GetCompEM().IsPlugged())
6879 {
6880 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6881 GetCompEM().UnplugThis();
6882 }
6883 #endif
6884 }
6885
6887
6889 {
6891 }
6892
6894 {
6895
6896 }
6897
6899 {
6900 super.OnItemLocationChanged(old_owner, new_owner);
6901
6902 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6903 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6904
6905 if (!relatedPlayer && playerNew)
6906 relatedPlayer = playerNew;
6907
6908 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6909 {
6911 if (actionMgr)
6912 {
6913 ActionBase currentAction = actionMgr.GetRunningAction();
6914 if (currentAction)
6916 }
6917 }
6918
6919 Man ownerPlayerOld = null;
6920 Man ownerPlayerNew = null;
6921
6922 if (old_owner)
6923 {
6924 if (old_owner.
IsMan())
6925 {
6926 ownerPlayerOld = Man.Cast(old_owner);
6927 }
6928 else
6929 {
6930 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6931 }
6932 }
6933 else
6934 {
6936 {
6938
6939 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6940 {
6941 GetCompEM().UnplugThis();
6942 }
6943 }
6944 }
6945
6946 if (new_owner)
6947 {
6948 if (new_owner.
IsMan())
6949 {
6950 ownerPlayerNew = Man.Cast(new_owner);
6951 }
6952 else
6953 {
6954 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6955 }
6956 }
6957
6958 if (ownerPlayerOld != ownerPlayerNew)
6959 {
6960 if (ownerPlayerOld)
6961 {
6962 array<EntityAI> subItemsExit = new array<EntityAI>;
6964 for (int i = 0; i < subItemsExit.Count(); i++)
6965 {
6968 }
6969 }
6970
6971 if (ownerPlayerNew)
6972 {
6973 array<EntityAI> subItemsEnter = new array<EntityAI>;
6975 for (int j = 0; j < subItemsEnter.Count(); j++)
6976 {
6979 }
6980 }
6981 }
6982 else if (ownerPlayerNew != null)
6983 {
6984 PlayerBase nplayer;
6985 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6986 {
6987 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6989 for (int k = 0; k < subItemsUpdate.Count(); k++)
6990 {
6992 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6993 }
6994 }
6995 }
6996
6997 if (old_owner)
6998 old_owner.OnChildItemRemoved(this);
6999 if (new_owner)
7000 new_owner.OnChildItemReceived(this);
7001 }
7002
7003
7005 {
7006 super.EEDelete(parent);
7007 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7008 if (player)
7009 {
7011
7012 if (player.IsAlive())
7013 {
7014 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7015 if (r_index >= 0)
7016 {
7017 InventoryLocation r_il = new InventoryLocation;
7018 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7019
7020 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7023 {
7024 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7025 }
7027 {
7028 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7029 }
7030
7031 }
7032
7033 player.RemoveQuickBarEntityShortcut(this);
7034 }
7035 }
7036 }
7037
7039 {
7040 super.EEKilled(killer);
7041
7044 {
7045 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7046 {
7047 if (IsMagazine())
7048 {
7049 if (Magazine.Cast(this).GetAmmoCount() > 0)
7050 {
7052 }
7053 }
7054 else
7055 {
7057 }
7058 }
7059 }
7060 }
7061
7063 {
7064 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7065
7066 super.OnWasAttached(parent, slot_id);
7067
7070
7072 }
7073
7075 {
7076 super.OnWasDetached(parent, slot_id);
7077
7080 }
7081
7083 {
7084 int idx;
7087
7088 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7089 if (inventory_slots.Count() < 1)
7090 {
7091 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7092 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7093 }
7094 else
7095 {
7096 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7097 }
7098
7099 idx = inventory_slots.Find(slot);
7100 if (idx < 0)
7101 return "";
7102
7103 return attach_types.Get(idx);
7104 }
7105
7107 {
7108 int idx = -1;
7109 string slot;
7110
7113
7114 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7115 if (inventory_slots.Count() < 1)
7116 {
7117 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7118 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7119 }
7120 else
7121 {
7122 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7123 if (detach_types.Count() < 1)
7124 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7125 }
7126
7127 for (int i = 0; i < inventory_slots.Count(); i++)
7128 {
7129 slot = inventory_slots.Get(i);
7130 }
7131
7132 if (slot != "")
7133 {
7134 if (detach_types.Count() == 1)
7135 idx = 0;
7136 else
7137 idx = inventory_slots.Find(slot);
7138 }
7139 if (idx < 0)
7140 return "";
7141
7142 return detach_types.Get(idx);
7143 }
7144
7146 {
7147
7149
7150
7151 float min_time = 1;
7152 float max_time = 3;
7153 float delay = Math.RandomFloat(min_time, max_time);
7154
7155 explode_timer.Run(delay, this, "DoAmmoExplosion");
7156 }
7157
7159 {
7160 Magazine magazine = Magazine.Cast(this);
7161 int pop_sounds_count = 6;
7162 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7163
7164
7165 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7166 string sound_name = pop_sounds[ sound_idx ];
7168
7169
7170 magazine.ServerAddAmmoCount(-1);
7171
7172
7173 float min_temp_to_explode = 100;
7174
7175 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7176 {
7178 }
7179 }
7180
7181
7182 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7183 {
7184 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7185
7186 const int CHANCE_DAMAGE_CARGO = 4;
7187 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7188 const int CHANCE_DAMAGE_NOTHING = 2;
7189
7191 {
7192 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7193 int chances;
7194 int rnd;
7195
7196 if (GetInventory().GetCargo())
7197 {
7198 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7199 rnd = Math.RandomInt(0,chances);
7200
7201 if (rnd < CHANCE_DAMAGE_CARGO)
7202 {
7204 }
7205 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7206 {
7208 }
7209 }
7210 else
7211 {
7212 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7213 rnd = Math.RandomInt(0,chances);
7214
7215 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7216 {
7218 }
7219 }
7220 }
7221 }
7222
7224 {
7225 if (GetInventory().GetCargo())
7226 {
7227 int item_count = GetInventory().GetCargo().GetItemCount();
7228 if (item_count > 0)
7229 {
7230 int random_pick = Math.RandomInt(0, item_count);
7232 if (!item.IsExplosive())
7233 {
7234 item.AddHealth("","",damage);
7235 return true;
7236 }
7237 }
7238 }
7239 return false;
7240 }
7241
7243 {
7244 int attachment_count = GetInventory().AttachmentCount();
7245 if (attachment_count > 0)
7246 {
7247 int random_pick = Math.RandomInt(0, attachment_count);
7248 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7249 if (!attachment.IsExplosive())
7250 {
7251 attachment.AddHealth("","",damage);
7252 return true;
7253 }
7254 }
7255 return false;
7256 }
7257
7259 {
7261 }
7262
7264 {
7266 return GetInventory().CanRemoveEntity();
7267
7268 return false;
7269 }
7270
7272 {
7274 return;
7275
7277 {
7278 if (ScriptInputUserData.CanStoreInputUserData())
7279 {
7280 ScriptInputUserData ctx = new ScriptInputUserData;
7285 ctx.
Write(destination_entity);
7289 }
7290 }
7291 else if (!
GetGame().IsMultiplayer())
7292 {
7294 }
7295 }
7296
7298 {
7300 return;
7301
7302 float split_quantity_new;
7306 InventoryLocation loc = new InventoryLocation;
7307
7308 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7309 {
7311 split_quantity_new = stack_max;
7312 else
7314
7315 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7316 if (new_item)
7317 {
7318 new_item.SetResultOfSplit(true);
7319 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7321 new_item.SetQuantity(split_quantity_new);
7322 }
7323 }
7324 else if (destination_entity && slot_id == -1)
7325 {
7326 if (quantity > stack_max)
7327 split_quantity_new = stack_max;
7328 else
7329 split_quantity_new = quantity;
7330
7332 {
7335 }
7336
7337 if (new_item)
7338 {
7339 new_item.SetResultOfSplit(true);
7340 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7342 new_item.SetQuantity(split_quantity_new);
7343 }
7344 }
7345 else
7346 {
7347 if (stack_max != 0)
7348 {
7350 {
7352 }
7353
7354 if (split_quantity_new == 0)
7355 {
7356 if (!
GetGame().IsMultiplayer())
7357 player.PhysicalPredictiveDropItem(this);
7358 else
7359 player.ServerDropEntity(this);
7360 return;
7361 }
7362
7364
7365 if (new_item)
7366 {
7367 new_item.SetResultOfSplit(true);
7368 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7370 new_item.SetQuantity(stack_max);
7371 new_item.PlaceOnSurface();
7372 }
7373 }
7374 }
7375 }
7376
7378 {
7380 return;
7381
7382 float split_quantity_new;
7386 InventoryLocation loc = new InventoryLocation;
7387
7388 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7389 {
7391 split_quantity_new = stack_max;
7392 else
7394
7395 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7396 if (new_item)
7397 {
7398 new_item.SetResultOfSplit(true);
7399 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7401 new_item.SetQuantity(split_quantity_new);
7402 }
7403 }
7404 else if (destination_entity && slot_id == -1)
7405 {
7406 if (quantity > stack_max)
7407 split_quantity_new = stack_max;
7408 else
7409 split_quantity_new = quantity;
7410
7412 {
7415 }
7416
7417 if (new_item)
7418 {
7419 new_item.SetResultOfSplit(true);
7420 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7422 new_item.SetQuantity(split_quantity_new);
7423 }
7424 }
7425 else
7426 {
7427 if (stack_max != 0)
7428 {
7430 {
7432 }
7433
7435
7436 if (new_item)
7437 {
7438 new_item.SetResultOfSplit(true);
7439 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7441 new_item.SetQuantity(stack_max);
7442 new_item.PlaceOnSurface();
7443 }
7444 }
7445 }
7446 }
7447
7449 {
7451 return;
7452
7454 {
7455 if (ScriptInputUserData.CanStoreInputUserData())
7456 {
7457 ScriptInputUserData ctx = new ScriptInputUserData;
7462 dst.WriteToContext(ctx);
7464 }
7465 }
7466 else if (!
GetGame().IsMultiplayer())
7467 {
7469 }
7470 }
7471
7473 {
7475 return;
7476
7478 {
7479 if (ScriptInputUserData.CanStoreInputUserData())
7480 {
7481 ScriptInputUserData ctx = new ScriptInputUserData;
7486 ctx.
Write(destination_entity);
7492 }
7493 }
7494 else if (!
GetGame().IsMultiplayer())
7495 {
7497 }
7498 }
7499
7501 {
7503 }
7504
7506 {
7508 return this;
7509
7511 float split_quantity_new;
7513 if (dst.IsValid())
7514 {
7515 int slot_id = dst.GetSlot();
7517
7518 if (quantity > stack_max)
7519 split_quantity_new = stack_max;
7520 else
7521 split_quantity_new = quantity;
7522
7524
7525 if (new_item)
7526 {
7527 new_item.SetResultOfSplit(true);
7528 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7531 }
7532
7533 return new_item;
7534 }
7535
7536 return null;
7537 }
7538
7540 {
7542 return;
7543
7545 float split_quantity_new;
7547 if (destination_entity)
7548 {
7550 if (quantity > stackable)
7551 split_quantity_new = stackable;
7552 else
7553 split_quantity_new = quantity;
7554
7555 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7556 if (new_item)
7557 {
7558 new_item.SetResultOfSplit(true);
7559 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7561 new_item.SetQuantity(split_quantity_new);
7562 }
7563 }
7564 }
7565
7567 {
7569 return;
7570
7572 {
7573 if (ScriptInputUserData.CanStoreInputUserData())
7574 {
7575 ScriptInputUserData ctx = new ScriptInputUserData;
7580 ItemBase destination_entity =
this;
7581 ctx.
Write(destination_entity);
7585 }
7586 }
7587 else if (!
GetGame().IsMultiplayer())
7588 {
7590 }
7591 }
7592
7594 {
7596 return;
7597
7599 float split_quantity_new;
7601 if (player)
7602 {
7604 if (quantity > stackable)
7605 split_quantity_new = stackable;
7606 else
7607 split_quantity_new = quantity;
7608
7609 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7610 new_item =
ItemBase.Cast(in_hands);
7611 if (new_item)
7612 {
7613 new_item.SetResultOfSplit(true);
7614 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7616 new_item.SetQuantity(split_quantity_new);
7617 }
7618 }
7619 }
7620
7622 {
7624 return;
7625
7627 float split_quantity_new = Math.Floor(quantity * 0.5);
7628
7630
7631 if (new_item)
7632 {
7633 if (new_item.GetQuantityMax() < split_quantity_new)
7634 {
7635 split_quantity_new = new_item.GetQuantityMax();
7636 }
7637
7638 new_item.SetResultOfSplit(true);
7639 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7640
7642 {
7645 }
7646 else
7647 {
7650 }
7651 }
7652 }
7653
7655 {
7657 return;
7658
7660 float split_quantity_new = Math.Floor(quantity / 2);
7661
7662 InventoryLocation invloc = new InventoryLocation;
7664
7666 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7667
7668 if (new_item)
7669 {
7670 if (new_item.GetQuantityMax() < split_quantity_new)
7671 {
7672 split_quantity_new = new_item.GetQuantityMax();
7673 }
7675 {
7678 }
7679 else
7680 {
7683 }
7684 }
7685 }
7686
7689 {
7690 SetWeightDirty();
7692
7693 if (parent)
7694 parent.OnAttachmentQuantityChangedEx(this, delta);
7695
7697 {
7699 {
7701 }
7703 {
7704 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7706 }
7707 }
7708
7709 }
7710
7713 {
7714
7715 }
7716
7719 {
7721 }
7722
7724 {
7725 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7726
7728 {
7729 if (newLevel == GameConstants.STATE_RUINED)
7730 {
7732 EntityAI parent = GetHierarchyParent();
7733 if (parent && parent.IsFireplace())
7734 {
7735 CargoBase cargo = GetInventory().GetCargo();
7736 if (cargo)
7737 {
7739 {
7741 }
7742 }
7743 }
7744 }
7745
7747 {
7748
7750 return;
7751 }
7752
7753 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7754 {
7756 }
7757 }
7758 }
7759
7760
7762 {
7763 super.OnRightClick();
7764
7766 {
7768 {
7769 if (ScriptInputUserData.CanStoreInputUserData())
7770 {
7771 vector m4[4];
7773
7774 EntityAI root = GetHierarchyRoot();
7775
7776 InventoryLocation dst = new InventoryLocation;
7778 {
7779 if (root)
7780 {
7781 root.GetTransform(m4);
7783 }
7784 else
7785 GetInventory().GetCurrentInventoryLocation(dst);
7786 }
7787 else
7788 {
7790
7791
7792 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7793 {
7794 if (root)
7795 {
7796 root.GetTransform(m4);
7798 }
7799 else
7800 GetInventory().GetCurrentInventoryLocation(dst);
7801 }
7802 else
7803 {
7804 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7805 }
7806 }
7807
7808 ScriptInputUserData ctx = new ScriptInputUserData;
7816 }
7817 }
7818 else if (!
GetGame().IsMultiplayer())
7819 {
7821 }
7822 }
7823 }
7824
7825 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7826 {
7827
7828 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7829 return false;
7830
7831 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7832 return false;
7833
7834
7836 return false;
7837
7838
7839 Magazine mag = Magazine.Cast(this);
7840 if (mag)
7841 {
7842 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7843 return false;
7844
7845 if (stack_max_limit)
7846 {
7847 Magazine other_mag = Magazine.Cast(other_item);
7848 if (other_item)
7849 {
7850 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7851 return false;
7852 }
7853
7854 }
7855 }
7856 else
7857 {
7858
7860 return false;
7861
7863 return false;
7864 }
7865
7866 PlayerBase player = null;
7867 if (CastTo(player, GetHierarchyRootPlayer()))
7868 {
7869 if (player.GetInventory().HasAttachment(this))
7870 return false;
7871
7872 if (player.IsItemsToDelete())
7873 return false;
7874 }
7875
7876 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7877 return false;
7878
7879 int slotID;
7881 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7882 return false;
7883
7884 return true;
7885 }
7886
7888 {
7890 }
7891
7893 {
7894 return m_IsResultOfSplit;
7895 }
7896
7898 {
7899 m_IsResultOfSplit = value;
7900 }
7901
7903 {
7905 }
7906
7908 {
7909 float other_item_quantity = other_item.GetQuantity();
7910 float this_free_space;
7911
7913
7915
7916 if (other_item_quantity > this_free_space)
7917 {
7918 return this_free_space;
7919 }
7920 else
7921 {
7922 return other_item_quantity;
7923 }
7924 }
7925
7927 {
7929 }
7930
7932 {
7934 return;
7935
7936 if (!IsMagazine() && other_item)
7937 {
7939 if (quantity_used != 0)
7940 {
7941 float hp1 = GetHealth01("","");
7942 float hp2 = other_item.GetHealth01("","");
7943 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7944 hpResult = hpResult / (
GetQuantity() + quantity_used);
7945
7946 hpResult *= GetMaxHealth();
7947 Math.Round(hpResult);
7948 SetHealth("", "Health", hpResult);
7949
7951 other_item.AddQuantity(-quantity_used);
7952 }
7953 }
7955 }
7956
7958 {
7959 #ifdef SERVER
7960 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7961 GetHierarchyParent().IncreaseLifetimeUp();
7962 #endif
7963 };
7964
7966 {
7967 PlayerBase p = PlayerBase.Cast(player);
7968
7969 array<int> recipesIds = p.m_Recipes;
7970 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7971 if (moduleRecipesManager)
7972 {
7973 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7974 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7975 }
7976
7977 for (int i = 0;i < recipesIds.Count(); i++)
7978 {
7979 int key = recipesIds.Get(i);
7980 string recipeName = moduleRecipesManager.GetRecipeName(key);
7982 }
7983 }
7984
7985
7986 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7987 {
7988 super.GetDebugActions(outputList);
7989
7990
7995
7996
8000
8004
8005
8008
8009
8011 {
8014 }
8015
8017
8020
8024 }
8025
8026
8027
8028
8030 {
8031 super.OnAction(action_id, player, ctx);
8032 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8033 {
8034 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8035 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8036 PlayerBase p = PlayerBase.Cast(player);
8037 if (
EActions.RECIPES_RANGE_START < 1000)
8038 {
8039 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8040 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8041 }
8042 }
8043 #ifndef SERVER
8044 else if (action_id ==
EActions.WATCH_PLAYER)
8045 {
8046 PluginDeveloper.SetDeveloperItemClientEx(player);
8047 }
8048 #endif
8050 {
8051 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8052 {
8053 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8054 OnDebugButtonPressServer(id + 1);
8055 }
8056
8057 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8058 {
8059 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8061 }
8062
8063 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8064 {
8065 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8067 }
8068
8069 else if (action_id ==
EActions.ADD_QUANTITY)
8070 {
8071 if (IsMagazine())
8072 {
8073 Magazine mag = Magazine.Cast(this);
8074 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8075 }
8076 else
8077 {
8079 }
8080
8081 if (m_EM)
8082 {
8083 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8084 }
8085
8086 }
8087
8088 else if (action_id ==
EActions.REMOVE_QUANTITY)
8089 {
8090 if (IsMagazine())
8091 {
8092 Magazine mag2 = Magazine.Cast(this);
8093 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8094 }
8095 else
8096 {
8098 }
8099 if (m_EM)
8100 {
8101 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8102 }
8103
8104 }
8105
8106 else if (action_id ==
EActions.SET_QUANTITY_0)
8107 {
8109
8110 if (m_EM)
8111 {
8112 m_EM.SetEnergy(0);
8113 }
8114 }
8115
8116 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8117 {
8119
8120 if (m_EM)
8121 {
8122 m_EM.SetEnergy(m_EM.GetEnergyMax());
8123 }
8124 }
8125
8126 else if (action_id ==
EActions.ADD_HEALTH)
8127 {
8128 AddHealth("","",GetMaxHealth("","Health")/5);
8129 }
8130 else if (action_id ==
EActions.REMOVE_HEALTH)
8131 {
8132 AddHealth("","",-GetMaxHealth("","Health")/5);
8133 }
8134 else if (action_id ==
EActions.DESTROY_HEALTH)
8135 {
8136 SetHealth01("","",0);
8137 }
8138 else if (action_id ==
EActions.WATCH_ITEM)
8139 {
8141 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8142 #ifdef DEVELOPER
8143 SetDebugDeveloper_item(this);
8144 #endif
8145 }
8146
8147 else if (action_id ==
EActions.ADD_TEMPERATURE)
8148 {
8149 AddTemperature(20);
8150
8151 }
8152
8153 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8154 {
8155 AddTemperature(-20);
8156
8157 }
8158
8159 else if (action_id ==
EActions.FLIP_FROZEN)
8160 {
8161 SetFrozen(!GetIsFrozen());
8162
8163 }
8164
8165 else if (action_id ==
EActions.ADD_WETNESS)
8166 {
8168
8169 }
8170
8171 else if (action_id ==
EActions.REMOVE_WETNESS)
8172 {
8174
8175 }
8176
8177 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8178 {
8181
8182
8183 }
8184
8185 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8186 {
8189 }
8190
8191 else if (action_id ==
EActions.MAKE_SPECIAL)
8192 {
8193 auto debugParams = DebugSpawnParams.WithPlayer(player);
8194 OnDebugSpawnEx(debugParams);
8195 }
8196
8197 else if (action_id ==
EActions.DELETE)
8198 {
8199 Delete();
8200 }
8201
8202 }
8203
8204
8205 return false;
8206 }
8207
8208
8209
8210
8214
8217
8218
8219
8221 {
8222 return false;
8223 }
8224
8225
8227 {
8228 return true;
8229 }
8230
8231
8233 {
8234 return true;
8235 }
8236
8237
8238
8240 {
8241 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8243 }
8244
8247 {
8248 return null;
8249 }
8250
8252 {
8253 return false;
8254 }
8255
8257 {
8258 return false;
8259 }
8260
8264
8265
8267 {
8268 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8269 return module_repairing.CanRepair(this, item_repair_kit);
8270 }
8271
8272
8273 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8274 {
8275 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8276 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8277 }
8278
8279
8281 {
8282
8283
8284
8285
8286
8287
8288
8289
8290 return 1;
8291 }
8292
8293
8294
8296 {
8298 }
8299
8300
8301
8303 {
8305 }
8306
8307
8316 {
8317 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8318
8319 if (player)
8320 {
8321 player.MessageStatus(text);
8322 }
8323 }
8324
8325
8334 {
8335 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8336
8337 if (player)
8338 {
8339 player.MessageAction(text);
8340 }
8341 }
8342
8343
8352 {
8353 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8354
8355 if (player)
8356 {
8357 player.MessageFriendly(text);
8358 }
8359 }
8360
8361
8370 {
8371 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8372
8373 if (player)
8374 {
8375 player.MessageImportant(text);
8376 }
8377 }
8378
8380 {
8381 return true;
8382 }
8383
8384
8385 override bool KindOf(
string tag)
8386 {
8387 bool found = false;
8388 string item_name = this.
GetType();
8391
8392 int array_size = item_tag_array.Count();
8393 for (int i = 0; i < array_size; i++)
8394 {
8395 if (item_tag_array.Get(i) == tag)
8396 {
8397 found = true;
8398 break;
8399 }
8400 }
8401 return found;
8402 }
8403
8404
8406 {
8407
8408 super.OnRPC(sender, rpc_type,ctx);
8409
8410
8411 switch (rpc_type)
8412 {
8413 #ifndef SERVER
8414 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8415 Param2<bool, string> p = new Param2<bool, string>(false, "");
8416
8418 return;
8419
8420 bool play = p.param1;
8421 string soundSet = p.param2;
8422
8423 if (play)
8424 {
8426 {
8428 {
8430 }
8431 }
8432 else
8433 {
8435 }
8436 }
8437 else
8438 {
8440 }
8441
8442 break;
8443 #endif
8444
8445 }
8446
8448 {
8450 }
8451 }
8452
8453
8454
8455
8457 {
8458 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8459 return plugin.GetID(
name);
8460 }
8461
8463 {
8464 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8465 return plugin.GetName(id);
8466 }
8467
8470 {
8471
8472
8473 int varFlags;
8474 if (!ctx.
Read(varFlags))
8475 return;
8476
8477 if (varFlags & ItemVariableFlags.FLOAT)
8478 {
8480 }
8481 }
8482
8484 {
8485
8486 super.SerializeNumericalVars(floats_out);
8487
8488
8489
8491 {
8493 }
8494
8496 {
8498 }
8499
8501 {
8503 }
8504
8506 {
8511 }
8512
8514 {
8516 }
8517 }
8518
8520 {
8521
8522 super.DeSerializeNumericalVars(floats);
8523
8524
8525 int index = 0;
8526 int mask = Math.Round(floats.Get(index));
8527
8528 index++;
8529
8531 {
8533 {
8535 }
8536 else
8537 {
8538 float quantity = floats.Get(index);
8540 }
8541 index++;
8542 }
8543
8545 {
8546 float wet = floats.Get(index);
8548 index++;
8549 }
8550
8552 {
8553 int liquidtype = Math.Round(floats.Get(index));
8555 index++;
8556 }
8557
8559 {
8561 index++;
8563 index++;
8565 index++;
8567 index++;
8568 }
8569
8571 {
8572 int cleanness = Math.Round(floats.Get(index));
8574 index++;
8575 }
8576 }
8577
8579 {
8580 super.WriteVarsToCTX(ctx);
8581
8582
8584 {
8586 }
8587
8589 {
8591 }
8592
8594 {
8596 }
8597
8599 {
8600 int r,g,b,a;
8606 }
8607
8609 {
8611 }
8612 }
8613
8615 {
8616 if (!super.ReadVarsFromCTX(ctx,version))
8617 return false;
8618
8619 int intValue;
8620 float value;
8621
8622 if (version < 140)
8623 {
8624 if (!ctx.
Read(intValue))
8625 return false;
8626
8627 m_VariablesMask = intValue;
8628 }
8629
8631 {
8632 if (!ctx.
Read(value))
8633 return false;
8634
8636 {
8638 }
8639 else
8640 {
8642 }
8643 }
8644
8645 if (version < 140)
8646 {
8648 {
8649 if (!ctx.
Read(value))
8650 return false;
8651 SetTemperatureDirect(value);
8652 }
8653 }
8654
8656 {
8657 if (!ctx.
Read(value))
8658 return false;
8660 }
8661
8663 {
8664 if (!ctx.
Read(intValue))
8665 return false;
8667 }
8668
8670 {
8671 int r,g,b,a;
8673 return false;
8675 return false;
8677 return false;
8679 return false;
8680
8682 }
8683
8685 {
8686 if (!ctx.
Read(intValue))
8687 return false;
8689 }
8690
8691 if (version >= 138 && version < 140)
8692 {
8694 {
8695 if (!ctx.
Read(intValue))
8696 return false;
8697 SetFrozen(intValue);
8698 }
8699 }
8700
8701 return true;
8702 }
8703
8704
8706 {
8709 {
8711 }
8712
8713 if (!super.OnStoreLoad(ctx, version))
8714 {
8716 return false;
8717 }
8718
8719 if (version >= 114)
8720 {
8721 bool hasQuickBarIndexSaved;
8722
8723 if (!ctx.
Read(hasQuickBarIndexSaved))
8724 {
8726 return false;
8727 }
8728
8729 if (hasQuickBarIndexSaved)
8730 {
8731 int itmQBIndex;
8732
8733
8734 if (!ctx.
Read(itmQBIndex))
8735 {
8737 return false;
8738 }
8739
8740 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8741 if (itmQBIndex != -1 && parentPlayer)
8742 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8743 }
8744 }
8745 else
8746 {
8747
8748 PlayerBase player;
8749 int itemQBIndex;
8750 if (version ==
int.
MAX)
8751 {
8752 if (!ctx.
Read(itemQBIndex))
8753 {
8755 return false;
8756 }
8757 }
8758 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8759 {
8760
8761 if (!ctx.
Read(itemQBIndex))
8762 {
8764 return false;
8765 }
8766 if (itemQBIndex != -1 && player)
8767 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8768 }
8769 }
8770
8771 if (version < 140)
8772 {
8773
8774 if (!LoadVariables(ctx, version))
8775 {
8777 return false;
8778 }
8779 }
8780
8781
8783 {
8785 return false;
8786 }
8787 if (version >= 132)
8788 {
8790 if (raib)
8791 {
8793 {
8795 return false;
8796 }
8797 }
8798 }
8799
8801 return true;
8802 }
8803
8804
8805
8807 {
8808 super.OnStoreSave(ctx);
8809
8810 PlayerBase player;
8811 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8812 {
8814
8815 int itemQBIndex = -1;
8816 itemQBIndex = player.FindQuickBarEntityIndex(this);
8817 ctx.
Write(itemQBIndex);
8818 }
8819 else
8820 {
8822 }
8823
8825
8827 if (raib)
8828 {
8830 }
8831 }
8832
8833
8835 {
8836 super.AfterStoreLoad();
8837
8839 {
8841 }
8842
8844 {
8847 }
8848 }
8849
8851 {
8852 super.EEOnAfterLoad();
8853
8855 {
8857 }
8858
8861 }
8862
8864 {
8865 return false;
8866 }
8867
8868
8869
8871 {
8873 {
8874 #ifdef PLATFORM_CONSOLE
8875
8877 {
8879 if (menu)
8880 {
8882 }
8883 }
8884 #endif
8885 }
8886
8888 {
8891 }
8892
8894 {
8895 SetWeightDirty();
8897 }
8899 {
8902 }
8903
8905 {
8908 }
8910 {
8913 }
8914
8915 super.OnVariablesSynchronized();
8916 }
8917
8918
8919
8921 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8922 {
8923 if (!IsServerCheck(allow_client))
8924 return false;
8925
8927 return false;
8928
8931
8932 if (value <= (min + 0.001))
8933 value = min;
8934
8935 if (value == min)
8936 {
8937 if (destroy_config)
8938 {
8939 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8940 if (dstr)
8941 {
8943 this.Delete();
8944 return true;
8945 }
8946 }
8947 else if (destroy_forced)
8948 {
8950 this.Delete();
8951 return true;
8952 }
8953
8955 }
8956
8959
8961 {
8963
8964 if (delta)
8966 }
8967
8969
8970 return false;
8971 }
8972
8973
8975 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8976 {
8978 }
8979
8981 {
8984 }
8985
8987 {
8990 }
8991
8994 {
8995 float value_clamped = Math.Clamp(value, 0, 1);
8997 SetQuantity(result, destroy_config, destroy_forced);
8998 }
8999
9000
9003 {
9005 }
9006
9008 {
9010 }
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9022 {
9023 int slot = -1;
9024 if (GetInventory())
9025 {
9026 InventoryLocation il = new InventoryLocation;
9027 GetInventory().GetCurrentInventoryLocation(il);
9029 }
9030
9032 }
9033
9035 {
9036 float quantity_max = 0;
9037
9039 {
9040 if (attSlotID != -1)
9041 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9042
9043 if (quantity_max <= 0)
9045 }
9046
9047 if (quantity_max <= 0)
9049
9050 return quantity_max;
9051 }
9052
9054 {
9056 }
9057
9059 {
9061 }
9062
9063
9065 {
9067 }
9068
9070 {
9072 }
9073
9075 {
9077 }
9078
9079
9081 {
9082
9083 float weightEx = GetWeightEx();
9084 float special = GetInventoryAndCargoWeight();
9085 return weightEx - special;
9086 }
9087
9088
9090 {
9092 }
9093
9095 {
9097 {
9098 #ifdef DEVELOPER
9099 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9100 {
9101 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9103 }
9104 #endif
9105
9107 }
9108 else if (HasEnergyManager())
9109 {
9110 #ifdef DEVELOPER
9111 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9112 {
9113 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9114 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9115 }
9116 #endif
9117 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9118 }
9119 else
9120 {
9121 #ifdef DEVELOPER
9122 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9123 {
9124 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9125 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9126 }
9127 #endif
9128 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9129 }
9130 }
9131
9134 {
9135 int item_count = 0;
9137
9138 if (GetInventory().GetCargo() != NULL)
9139 {
9140 item_count = GetInventory().GetCargo().GetItemCount();
9141 }
9142
9143 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9144 {
9145 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9146 if (item)
9147 item_count += item.GetNumberOfItems();
9148 }
9149 return item_count;
9150 }
9151
9154 {
9155 float weight = 0;
9156 float wetness = 1;
9157 if (include_wetness)
9160 {
9161 weight = wetness * m_ConfigWeight;
9162 }
9164 {
9165 weight = 1;
9166 }
9167 return weight;
9168 }
9169
9170
9171
9173 {
9174 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9175 {
9176 GameInventory inv = GetInventory();
9177 array<EntityAI> items = new array<EntityAI>;
9179 for (int i = 0; i < items.Count(); i++)
9180 {
9182 if (item)
9183 {
9185 }
9186 }
9187 }
9188 }
9189
9190
9191
9192
9194 {
9195 float energy = 0;
9196 if (HasEnergyManager())
9197 {
9198 energy = GetCompEM().GetEnergy();
9199 }
9200 return energy;
9201 }
9202
9203
9205 {
9206 super.OnEnergyConsumed();
9207
9209 }
9210
9212 {
9213 super.OnEnergyAdded();
9214
9216 }
9217
9218
9220 {
9221 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9222 {
9224 {
9225 float energy_0to1 = GetCompEM().GetEnergy0To1();
9227 }
9228 }
9229 }
9230
9231
9233 {
9234 return ConfigGetFloat("heatIsolation");
9235 }
9236
9238 {
9240 }
9241
9243 {
9244 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9245 if (
GetGame().ConfigIsExisting(paramPath))
9247
9248 return 0.0;
9249 }
9250
9252 {
9253 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9254 if (
GetGame().ConfigIsExisting(paramPath))
9256
9257 return 0.0;
9258 }
9259
9260 override void SetWet(
float value,
bool allow_client =
false)
9261 {
9262 if (!IsServerCheck(allow_client))
9263 return;
9264
9267
9269
9270 m_VarWet = Math.Clamp(value, min, max);
9271
9273 {
9276 }
9277 }
9278
9279 override void AddWet(
float value)
9280 {
9282 }
9283
9285 {
9287 }
9288
9290 {
9292 }
9293
9295 {
9297 }
9298
9300 {
9302 }
9303
9305 {
9307 }
9308
9310 {
9313 if (newLevel != oldLevel)
9314 {
9316 }
9317 }
9318
9320 {
9321 SetWeightDirty();
9322 }
9323
9325 {
9326 return GetWetLevelInternal(
m_VarWet);
9327 }
9328
9329
9330
9332 {
9334 }
9335
9337 {
9339 }
9340
9342 {
9344 }
9345
9347 {
9349 }
9350
9351
9352
9354 {
9355 if (ConfigIsExisting("itemModelLength"))
9356 {
9357 return ConfigGetFloat("itemModelLength");
9358 }
9359 return 0;
9360 }
9361
9363 {
9364 if (ConfigIsExisting("itemAttachOffset"))
9365 {
9366 return ConfigGetFloat("itemAttachOffset");
9367 }
9368 return 0;
9369 }
9370
9371 override void SetCleanness(
int value,
bool allow_client =
false)
9372 {
9373 if (!IsServerCheck(allow_client))
9374 return;
9375
9377
9379
9382 }
9383
9385 {
9387 }
9388
9390 {
9391 return true;
9392 }
9393
9394
9395
9396
9398 {
9400 }
9401
9403 {
9405 }
9406
9407
9408
9409
9410 override void SetColor(
int r,
int g,
int b,
int a)
9411 {
9417 }
9419 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9420 {
9425 }
9426
9428 {
9430 }
9431
9434 {
9435 int r,g,b,a;
9437 r = r/255;
9438 g = g/255;
9439 b = b/255;
9440 a = a/255;
9441 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9442 }
9443
9444
9445
9446 override void SetLiquidType(
int value,
bool allow_client =
false)
9447 {
9448 if (!IsServerCheck(allow_client))
9449 return;
9450
9455 }
9456
9458 {
9459 return ConfigGetInt("varLiquidTypeInit");
9460 }
9461
9463 {
9465 }
9466
9468 {
9470 SetFrozen(false);
9471 }
9472
9475 {
9476 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9477 }
9478
9479
9482 {
9483 PlayerBase nplayer;
9484 if (PlayerBase.CastTo(nplayer, player))
9485 {
9487
9488 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9489 }
9490 }
9491
9492
9495 {
9496 PlayerBase nplayer;
9497 if (PlayerBase.CastTo(nplayer,player))
9498 {
9499
9500 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9501
9502 }
9503
9504
9505 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9506
9507
9508 if (HasEnergyManager())
9509 {
9510 GetCompEM().UpdatePlugState();
9511 }
9512 }
9513
9514
9516 {
9517 super.OnPlacementStarted(player);
9518
9520 }
9521
9522 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9523 {
9525 {
9526 m_AdminLog.OnPlacementComplete(player,
this);
9527 }
9528
9529 super.OnPlacementComplete(player, position, orientation);
9530 }
9531
9532
9533
9534
9535
9537 {
9539 {
9540 return true;
9541 }
9542 else
9543 {
9544 return false;
9545 }
9546 }
9547
9548
9550 {
9552 {
9554 }
9555 }
9556
9557
9559 {
9561 }
9562
9564 {
9566 }
9567
9568 override void InsertAgent(
int agent,
float count = 1)
9569 {
9570 if (count < 1)
9571 return;
9572
9574 }
9575
9578 {
9580 }
9581
9582
9584 {
9586 }
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9630 {
9632 return false;
9633 return true;
9634 }
9635
9637 {
9638
9640 }
9641
9642
9645 {
9646 super.CheckForRoofLimited(timeTresholdMS);
9647
9649 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9650 {
9651 m_PreviousRoofTestTime = time;
9652 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9653 }
9654 }
9655
9656
9658 {
9660 {
9661 return 0;
9662 }
9663
9664 if (GetInventory().GetAttachmentSlotsCount() != 0)
9665 {
9666 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9667 if (filter)
9668 return filter.GetProtectionLevel(type, false, system);
9669 else
9670 return 0;
9671 }
9672
9673 string subclassPath, entryName;
9674
9675 switch (type)
9676 {
9678 entryName = "biological";
9679 break;
9681 entryName = "chemical";
9682 break;
9683 default:
9684 entryName = "biological";
9685 break;
9686 }
9687
9688 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9689
9691 }
9692
9693
9694
9697 {
9698 if (!IsMagazine())
9700
9702 }
9703
9704
9705
9706
9707
9712 {
9713 return true;
9714 }
9715
9717 {
9719 }
9720
9721
9722
9723
9724
9726 {
9727 if (parent)
9728 {
9729 if (parent.IsInherited(DayZInfected))
9730 return true;
9731
9732 if (!parent.IsRuined())
9733 return true;
9734 }
9735
9736 return true;
9737 }
9738
9740 {
9741 if (!super.CanPutAsAttachment(parent))
9742 {
9743 return false;
9744 }
9745
9746 if (!IsRuined() && !parent.IsRuined())
9747 {
9748 return true;
9749 }
9750
9751 return false;
9752 }
9753
9755 {
9756
9757
9758
9759
9760 return super.CanReceiveItemIntoCargo(item);
9761 }
9762
9764 {
9765
9766
9767
9768
9769 GameInventory attachmentInv = attachment.GetInventory();
9771 {
9772 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9773 return false;
9774 }
9775
9776 InventoryLocation loc = new InventoryLocation();
9777 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9778 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9779 return false;
9780
9781 return super.CanReceiveAttachment(attachment, slotId);
9782 }
9783
9785 {
9786 if (!super.CanReleaseAttachment(attachment))
9787 return false;
9788
9789 return GetInventory().AreChildrenAccessible();
9790 }
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9813 {
9814 int id = muzzle_owner.GetMuzzleID();
9815 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9816
9817 if (WPOF_array)
9818 {
9819 for (int i = 0; i < WPOF_array.Count(); i++)
9820 {
9821 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9822
9823 if (WPOF)
9824 {
9825 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9826 }
9827 }
9828 }
9829 }
9830
9831
9833 {
9834 int id = muzzle_owner.GetMuzzleID();
9836
9837 if (WPOBE_array)
9838 {
9839 for (int i = 0; i < WPOBE_array.Count(); i++)
9840 {
9841 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9842
9843 if (WPOBE)
9844 {
9845 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9846 }
9847 }
9848 }
9849 }
9850
9851
9853 {
9854 int id = muzzle_owner.GetMuzzleID();
9855 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9856
9857 if (WPOOH_array)
9858 {
9859 for (int i = 0; i < WPOOH_array.Count(); i++)
9860 {
9861 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9862
9863 if (WPOOH)
9864 {
9865 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9866 }
9867 }
9868 }
9869 }
9870
9871
9873 {
9874 int id = muzzle_owner.GetMuzzleID();
9875 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9876
9877 if (WPOOH_array)
9878 {
9879 for (int i = 0; i < WPOOH_array.Count(); i++)
9880 {
9881 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9882
9883 if (WPOOH)
9884 {
9885 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9886 }
9887 }
9888 }
9889 }
9890
9891
9893 {
9894 int id = muzzle_owner.GetMuzzleID();
9895 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9896
9897 if (WPOOH_array)
9898 {
9899 for (int i = 0; i < WPOOH_array.Count(); i++)
9900 {
9901 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9902
9903 if (WPOOH)
9904 {
9905 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9906 }
9907 }
9908 }
9909 }
9910
9911
9912
9914 {
9916 {
9917 return true;
9918 }
9919
9920 return false;
9921 }
9922
9924 {
9926 {
9927 return true;
9928 }
9929
9930 return false;
9931 }
9932
9934 {
9936 {
9937 return true;
9938 }
9939
9940 return false;
9941 }
9942
9944 {
9945 return false;
9946 }
9947
9950 {
9951 return UATimeSpent.DEFAULT_DEPLOY;
9952 }
9953
9954
9955
9956
9958 {
9960 SetSynchDirty();
9961 }
9962
9964 {
9966 }
9967
9968
9970 {
9971 return false;
9972 }
9973
9976 {
9977 string att_type = "None";
9978
9979 if (ConfigIsExisting("soundAttType"))
9980 {
9981 att_type = ConfigGetString("soundAttType");
9982 }
9983
9985 }
9986
9988 {
9990 }
9991
9992
9993
9994
9995
9999
10001 {
10004
10006 }
10007
10008
10010 {
10012 return;
10013
10015
10018
10021
10022 SoundParameters params = new SoundParameters();
10026 }
10027
10028
10030 {
10032 return;
10033
10035 SetSynchDirty();
10036
10039 }
10040
10041
10043 {
10045 return;
10046
10048 SetSynchDirty();
10049
10052 }
10053
10055 {
10057 }
10058
10060 {
10062 }
10063
10066 {
10067 if (!
GetGame().IsDedicatedServer())
10068 {
10069 if (ConfigIsExisting("attachSoundSet"))
10070 {
10071 string cfg_path = "";
10072 string soundset = "";
10073 string type_name =
GetType();
10074
10077 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10078 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10079
10080 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10081 {
10082 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10083 {
10084 if (cfg_slot_array[i] == slot_type)
10085 {
10086 soundset = cfg_soundset_array[i];
10087 break;
10088 }
10089 }
10090 }
10091
10092 if (soundset != "")
10093 {
10094 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10096 }
10097 }
10098 }
10099 }
10100
10102 {
10103
10104 }
10105
10106 void OnApply(PlayerBase player);
10107
10109 {
10110 return 1.0;
10111 };
10112
10114 {
10116 }
10117
10119 {
10121 }
10122
10124
10126 {
10127 SetDynamicPhysicsLifeTime(0.01);
10129 }
10130
10132 {
10133 array<string> zone_names = new array<string>;
10134 GetDamageZones(zone_names);
10135 for (int i = 0; i < zone_names.Count(); i++)
10136 {
10137 SetHealthMax(zone_names.Get(i),"Health");
10138 }
10139 SetHealthMax("","Health");
10140 }
10141
10144 {
10145 float global_health = GetHealth01("","Health");
10146 array<string> zones = new array<string>;
10147 GetDamageZones(zones);
10148
10149 for (int i = 0; i < zones.Count(); i++)
10150 {
10151 SetHealth01(zones.Get(i),"Health",global_health);
10152 }
10153 }
10154
10157 {
10158 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10159 }
10160
10162 {
10163 if (!hasRootAsPlayer)
10164 {
10165 if (refParentIB)
10166 {
10167
10168 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10169 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10170
10171 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10172 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10173
10176 }
10177 else
10178 {
10179
10182 }
10183 }
10184 }
10185
10187 {
10189 {
10190 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10191 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10192 {
10193 float heatPermCoef = 1.0;
10195 while (ent)
10196 {
10197 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10198 ent = ent.GetHierarchyParent();
10199 }
10200
10201 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10202 }
10203 }
10204 }
10205
10207 {
10208
10209 EntityAI parent = GetHierarchyParent();
10210 if (!parent)
10211 {
10212 hasParent = false;
10213 hasRootAsPlayer = false;
10214 }
10215 else
10216 {
10217 hasParent = true;
10218 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10219 refParentIB =
ItemBase.Cast(parent);
10220 }
10221 }
10222
10223 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10224 {
10225
10226 }
10227
10229 {
10230
10231 return false;
10232 }
10233
10235 {
10236
10237
10238 return false;
10239 }
10240
10242 {
10243
10244 return false;
10245 }
10246
10249 {
10250 return !GetIsFrozen() &&
IsOpen();
10251 }
10252
10254 {
10255 bool hasParent = false, hasRootAsPlayer = false;
10257
10258 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10259 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10260
10261 if (wwtu || foodDecay)
10262 {
10266
10267 if (processWetness || processTemperature || processDecay)
10268 {
10270
10271 if (processWetness)
10272 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10273
10274 if (processTemperature)
10276
10277 if (processDecay)
10278 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10279 }
10280 }
10281 }
10282
10285 {
10287 }
10288
10290 {
10293
10294 return super.GetTemperatureFreezeThreshold();
10295 }
10296
10298 {
10301
10302 return super.GetTemperatureThawThreshold();
10303 }
10304
10306 {
10309
10310 return super.GetItemOverheatThreshold();
10311 }
10312
10314 {
10316 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10317
10318 return super.GetTemperatureFreezeTime();
10319 }
10320
10322 {
10324 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10325
10326 return super.GetTemperatureThawTime();
10327 }
10328
10333
10335 {
10336 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10337 }
10338
10340 {
10341 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10342 }
10343
10346 {
10348 }
10349
10351 {
10353 }
10354
10356 {
10358 }
10359
10362 {
10363 return null;
10364 }
10365
10368 {
10369 return false;
10370 }
10371
10373 {
10375 {
10378 if (!trg)
10379 {
10381 explosive = this;
10382 }
10383
10384 explosive.PairRemote(trg);
10386
10387 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10388 trg.SetPersistentPairID(persistentID);
10389 explosive.SetPersistentPairID(persistentID);
10390
10391 return true;
10392 }
10393 return false;
10394 }
10395
10398 {
10399 float ret = 1.0;
10402 ret *= GetHealth01();
10403
10404 return ret;
10405 }
10406
10407 #ifdef DEVELOPER
10408 override void SetDebugItem()
10409 {
10410 super.SetDebugItem();
10411 _itemBase = this;
10412 }
10413
10415 {
10416 string text = super.GetDebugText();
10417
10419 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10420
10421 return text;
10422 }
10423 #endif
10424
10426 {
10427 return true;
10428 }
10429
10431
10433
10435 {
10438 }
10439
10440
10448
10464}
10465
10467{
10469 if (entity)
10470 {
10471 bool is_item = entity.IsInherited(
ItemBase);
10472 if (is_item && full_quantity)
10473 {
10476 }
10477 }
10478 else
10479 {
10481 return NULL;
10482 }
10483 return entity;
10484}
10485
10487{
10488 if (item)
10489 {
10490 if (health > 0)
10491 item.SetHealth("", "", health);
10492
10493 if (item.CanHaveTemperature())
10494 {
10496 if (item.CanFreeze())
10497 item.SetFrozen(false);
10498 }
10499
10500 if (item.HasEnergyManager())
10501 {
10502 if (quantity >= 0)
10503 {
10504 item.GetCompEM().SetEnergy0To1(quantity);
10505 }
10506 else
10507 {
10509 }
10510 }
10511 else if (item.IsMagazine())
10512 {
10513 Magazine mag = Magazine.Cast(item);
10514 if (quantity >= 0)
10515 {
10516 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10517 }
10518 else
10519 {
10521 }
10522
10523 }
10524 else
10525 {
10526 if (quantity >= 0)
10527 {
10528 item.SetQuantityNormalized(quantity, false);
10529 }
10530 else
10531 {
10533 }
10534
10535 }
10536 }
10537}
10538
10539#ifdef DEVELOPER
10541#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
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 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...
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)
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)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
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()
override int GetLiquidType()
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)
void Open()
Implementations only.
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 EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
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 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 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
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
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 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 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.