5673{
5675 {
5676 return true;
5677 }
5678};
5679
5680
5681
5683{
5687
5689
5692
5693
5694
5695
5696
5705
5711
5716
5721
5742 protected bool m_IsResultOfSplit
5743
5745
5750
5751
5752
5754
5758
5759
5760
5762
5765
5766
5767
5773
5774
5782
5785
5786
5788
5789
5791
5792
5797
5798
5803
5804
5806
5807
5809 {
5814
5815 if (!
GetGame().IsDedicatedServer())
5816 {
5818 {
5820
5822 {
5824 }
5825 }
5826
5829 }
5830
5831 m_OldLocation = null;
5832
5834 {
5836 }
5837
5838 if (ConfigIsExisting("headSelectionsToHide"))
5839 {
5842 }
5843
5845 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5846 {
5848 }
5849
5851
5852 m_IsResultOfSplit = false;
5853
5855 }
5856
5858 {
5859 super.InitItemVariables();
5860
5866 m_Count = ConfigGetInt(
"count");
5867
5870
5875
5878
5883
5895
5899
5900
5903 if (ConfigIsExisting("canBeSplit"))
5904 {
5907 }
5908
5910 if (ConfigIsExisting("itemBehaviour"))
5912
5913
5916 RegisterNetSyncVariableInt("m_VarLiquidType");
5917 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5918
5919 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5920 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5921 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5922
5923 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5924 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5925 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5926 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5927
5928 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5929 RegisterNetSyncVariableBool("m_IsTakeable");
5930 RegisterNetSyncVariableBool("m_IsHologram");
5931
5934 {
5937 }
5938
5940
5942 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5944
5945 }
5946
5948 {
5950 }
5951
5953 {
5956 {
5961 }
5962 }
5963
5964 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5965 {
5967 {
5970 }
5971
5973 }
5974
5976 {
5982 }
5983
5985
5987 {
5989
5990 if (!action)
5991 {
5992 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5993 return;
5994 }
5995
5997 if (!ai)
5998 {
6000 return;
6001 }
6002
6004 if (!action_array)
6005 {
6006 action_array = new array<ActionBase_Basic>;
6008 }
6009 if (LogManager.IsActionLogEnable())
6010 {
6011 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6012 }
6013
6014 if (action_array.Find(action) != -1)
6015 {
6016 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6017 }
6018 else
6019 {
6020 action_array.Insert(action);
6021 }
6022 }
6023
6025 {
6027 ActionBase action = player.GetActionManager().GetAction(actionName);
6030
6031 if (action_array)
6032 {
6033 action_array.RemoveItem(action);
6034 }
6035 }
6036
6037
6038
6040 {
6041 ActionOverrideData overrideData = new ActionOverrideData();
6045
6047 if (!actionMap)
6048 {
6051 }
6052
6053 actionMap.Insert(this.
Type(), overrideData);
6054
6055 }
6056
6058
6060
6061
6063 {
6066
6069
6070 string config_to_search = "CfgVehicles";
6071 string muzzle_owner_config;
6072
6074 {
6075 if (IsInherited(Weapon))
6076 config_to_search = "CfgWeapons";
6077
6078 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6079
6080 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6081
6083
6084 if (config_OnFire_subclass_count > 0)
6085 {
6086 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6087
6088 for (int i = 0; i < config_OnFire_subclass_count; i++)
6089 {
6090 string particle_class = "";
6092 string config_OnFire_entry = config_OnFire_class + particle_class;
6093 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6094 WPOF_array.Insert(WPOF);
6095 }
6096
6097
6099 }
6100 }
6101
6103 {
6104 config_to_search = "CfgWeapons";
6105 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6106
6107 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6108
6110
6111 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6112 {
6113 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6114
6115 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6116 {
6117 string particle_class2 = "";
6119 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6120 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6121 WPOBE_array.Insert(WPOBE);
6122 }
6123
6124
6126 }
6127 }
6128 }
6129
6130
6132 {
6135
6137 {
6138 string config_to_search = "CfgVehicles";
6139
6140 if (IsInherited(Weapon))
6141 config_to_search = "CfgWeapons";
6142
6143 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6144 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6145
6146 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6147 {
6148
6150
6152 {
6154 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6156 return;
6157 }
6158
6161
6162
6163
6165 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6166
6167 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6168 {
6169 string particle_class = "";
6171 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6173
6174 if (entry_type == CT_CLASS)
6175 {
6176 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6177 WPOOH_array.Insert(WPOF);
6178 }
6179 }
6180
6181
6183 }
6184 }
6185 }
6186
6188 {
6190 }
6191
6193 {
6195 {
6197
6200
6203
6204 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6205 }
6206 }
6207
6209 {
6211 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6212
6214 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6215
6217 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6218
6220 {
6222 }
6223 }
6224
6226 {
6228 }
6229
6231 {
6234 else
6236
6238 {
6241 }
6242 else
6243 {
6246
6249 }
6250
6252 }
6253
6255 {
6257 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6258 }
6259
6261 {
6263 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6265 }
6266
6268 {
6270 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6271 }
6272
6274 {
6277
6278 OverheatingParticle OP = new OverheatingParticle();
6283
6285 }
6286
6288 {
6291
6292 return -1;
6293 }
6294
6296 {
6298 {
6301
6302 for (int i = count; i > 0; --i)
6303 {
6304 int id = i - 1;
6307
6310
6311 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6312 {
6313 if (p)
6314 {
6317 }
6318 }
6319 }
6320 }
6321 }
6322
6324 {
6326 {
6328 {
6329 int id = i - 1;
6331
6332 if (OP)
6333 {
6335
6336 if (p)
6337 {
6339 }
6340
6341 delete OP;
6342 }
6343 }
6344
6347 }
6348 }
6349
6352 {
6353 return 0.0;
6354 }
6355
6356
6358 {
6359 return 250;
6360 }
6361
6363 {
6364 return 0;
6365 }
6366
6369 {
6371 return true;
6372
6373 return false;
6374 }
6375
6378 {
6381
6383 {
6385 }
6386 else
6387 {
6388
6390 }
6391
6393 }
6394
6401 {
6402 return -1;
6403 }
6404
6405
6406
6407
6409 {
6411 {
6413 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6414
6415 if (r_index >= 0)
6416 {
6417 InventoryLocation r_il = new InventoryLocation;
6418 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6419
6420 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6423 {
6424 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6425 }
6427 {
6428 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6429 }
6430
6431 }
6432
6433 player.GetHumanInventory().ClearUserReservedLocation(this);
6434 }
6435
6438 }
6439
6440
6441
6442
6444 {
6445 return ItemBase.m_DebugActionsMask;
6446 }
6447
6449 {
6450 return ItemBase.m_DebugActionsMask & mask;
6451 }
6452
6454 {
6455 ItemBase.m_DebugActionsMask = mask;
6456 }
6457
6459 {
6460 ItemBase.m_DebugActionsMask |= mask;
6461 }
6462
6464 {
6465 ItemBase.m_DebugActionsMask &= ~mask;
6466 }
6467
6469 {
6471 {
6473 }
6474 else
6475 {
6477 }
6478 }
6479
6480
6482 {
6483 if (GetEconomyProfile())
6484 {
6485 float q_max = GetEconomyProfile().GetQuantityMax();
6486 if (q_max > 0)
6487 {
6488 float q_min = GetEconomyProfile().GetQuantityMin();
6489 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6490
6492 {
6493 ComponentEnergyManager comp = GetCompEM();
6495 {
6497 }
6498 }
6500 {
6502
6503 }
6504
6505 }
6506 }
6507 }
6508
6511 {
6512 EntityAI parent = GetHierarchyParent();
6513
6514 if (parent)
6515 {
6516 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6517 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6518 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6519 }
6520 }
6521
6524 {
6525 EntityAI parent = GetHierarchyParent();
6526
6527 if (parent)
6528 {
6529 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6530 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6531 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6532 }
6533 }
6534
6536 {
6537
6538
6539
6540
6542
6544 {
6545 if (ScriptInputUserData.CanStoreInputUserData())
6546 {
6547 ScriptInputUserData ctx = new ScriptInputUserData;
6553 ctx.
Write(use_stack_max);
6556
6558 {
6559 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6560 }
6561 }
6562 }
6563 else if (!
GetGame().IsMultiplayer())
6564 {
6566 }
6567 }
6568
6570 {
6572 }
6573
6575 {
6577 }
6578
6580 {
6582 }
6583
6585 {
6586
6587 return false;
6588 }
6589
6591 {
6592 return false;
6593 }
6594
6598 {
6599 return false;
6600 }
6601
6603 {
6604 return "";
6605 }
6606
6608
6610 {
6611 return false;
6612 }
6613
6615 {
6616 return true;
6617 }
6618
6619
6620
6622 {
6623 return true;
6624 }
6625
6627 {
6628 return true;
6629 }
6630
6632 {
6633 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6635 }
6636
6638 {
6640 }
6641
6643 {
6645 if (!is_being_placed)
6647 SetSynchDirty();
6648 }
6649
6650
6652
6654 {
6656 }
6657
6659 {
6661 }
6662
6664 {
6665 return 1;
6666 }
6667
6669 {
6670 return false;
6671 }
6672
6674 {
6676 SetSynchDirty();
6677 }
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6714 {
6715 super.OnMovedInsideCargo(container);
6716
6717 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6718 }
6719
6720 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6721 {
6722 super.EEItemLocationChanged(oldLoc,newLoc);
6723
6724 PlayerBase new_player = null;
6725 PlayerBase old_player = null;
6726
6727 if (newLoc.GetParent())
6728 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6729
6730 if (oldLoc.GetParent())
6731 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6732
6734 {
6735 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6736
6737 if (r_index >= 0)
6738 {
6739 InventoryLocation r_il = new InventoryLocation;
6740 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6741
6742 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6745 {
6746 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6747 }
6749 {
6750 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6751 }
6752
6753 }
6754 }
6755
6757 {
6758 if (new_player)
6759 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6760
6761 if (new_player == old_player)
6762 {
6763
6764 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6765 {
6767 {
6768 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6769 {
6770 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6771 }
6772 }
6773 else
6774 {
6775 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6776 }
6777 }
6778
6779 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6780 {
6781 int type = oldLoc.GetType();
6783 {
6784 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6785 }
6787 {
6788 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6789 }
6790 }
6791 if (!m_OldLocation)
6792 {
6793 m_OldLocation = new InventoryLocation;
6794 }
6795 m_OldLocation.Copy(oldLoc);
6796 }
6797 else
6798 {
6799 if (m_OldLocation)
6800 {
6801 m_OldLocation.Reset();
6802 }
6803 }
6804
6806 }
6807 else
6808 {
6809 if (new_player)
6810 {
6811 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6812 if (res_index >= 0)
6813 {
6814 InventoryLocation il = new InventoryLocation;
6815 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6817 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6820 {
6821 il.
GetParent().GetOnReleaseLock().Invoke(it);
6822 }
6824 {
6826 }
6827
6828 }
6829 }
6831 {
6832
6834 }
6835
6836 if (m_OldLocation)
6837 {
6838 m_OldLocation.Reset();
6839 }
6840 }
6841 }
6842
6843 override void EOnContact(IEntity other, Contact extra)
6844 {
6846 {
6847 int liquidType = -1;
6849 if (impactSpeed > 0.0)
6850 {
6852 #ifndef SERVER
6854 #else
6856 SetSynchDirty();
6857 #endif
6859 }
6860 }
6861
6862 #ifdef SERVER
6863 if (GetCompEM() && GetCompEM().IsPlugged())
6864 {
6865 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6866 GetCompEM().UnplugThis();
6867 }
6868 #endif
6869 }
6870
6872
6874 {
6876 }
6877
6879 {
6880
6881 }
6882
6884 {
6885 super.OnItemLocationChanged(old_owner, new_owner);
6886
6887 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6888 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6889
6890 if (!relatedPlayer && playerNew)
6891 relatedPlayer = playerNew;
6892
6893 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6894 {
6896 if (actionMgr)
6897 {
6898 ActionBase currentAction = actionMgr.GetRunningAction();
6899 if (currentAction)
6901 }
6902 }
6903
6904 Man ownerPlayerOld = null;
6905 Man ownerPlayerNew = null;
6906
6907 if (old_owner)
6908 {
6909 if (old_owner.
IsMan())
6910 {
6911 ownerPlayerOld = Man.Cast(old_owner);
6912 }
6913 else
6914 {
6915 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6916 }
6917 }
6918 else
6919 {
6921 {
6923
6924 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6925 {
6926 GetCompEM().UnplugThis();
6927 }
6928 }
6929 }
6930
6931 if (new_owner)
6932 {
6933 if (new_owner.
IsMan())
6934 {
6935 ownerPlayerNew = Man.Cast(new_owner);
6936 }
6937 else
6938 {
6939 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6940 }
6941 }
6942
6943 if (ownerPlayerOld != ownerPlayerNew)
6944 {
6945 if (ownerPlayerOld)
6946 {
6947 array<EntityAI> subItemsExit = new array<EntityAI>;
6949 for (int i = 0; i < subItemsExit.Count(); i++)
6950 {
6953 }
6954 }
6955
6956 if (ownerPlayerNew)
6957 {
6958 array<EntityAI> subItemsEnter = new array<EntityAI>;
6960 for (int j = 0; j < subItemsEnter.Count(); j++)
6961 {
6964 }
6965 }
6966 }
6967 else if (ownerPlayerNew != null)
6968 {
6969 PlayerBase nplayer;
6970 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6971 {
6972 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6974 for (int k = 0; k < subItemsUpdate.Count(); k++)
6975 {
6977 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6978 }
6979 }
6980 }
6981
6982 if (old_owner)
6983 old_owner.OnChildItemRemoved(this);
6984 if (new_owner)
6985 new_owner.OnChildItemReceived(this);
6986 }
6987
6988
6990 {
6991 super.EEDelete(parent);
6992 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6993 if (player)
6994 {
6996
6997 if (player.IsAlive())
6998 {
6999 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7000 if (r_index >= 0)
7001 {
7002 InventoryLocation r_il = new InventoryLocation;
7003 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7004
7005 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7008 {
7009 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7010 }
7012 {
7013 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7014 }
7015
7016 }
7017
7018 player.RemoveQuickBarEntityShortcut(this);
7019 }
7020 }
7021 }
7022
7024 {
7025 super.EEKilled(killer);
7026
7029 {
7030 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7031 {
7032 if (IsMagazine())
7033 {
7034 if (Magazine.Cast(this).GetAmmoCount() > 0)
7035 {
7037 }
7038 }
7039 else
7040 {
7042 }
7043 }
7044 }
7045 }
7046
7048 {
7049 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7050
7051 super.OnWasAttached(parent, slot_id);
7052
7055
7057 }
7058
7060 {
7061 super.OnWasDetached(parent, slot_id);
7062
7065 }
7066
7068 {
7069 int idx;
7072
7073 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7074 if (inventory_slots.Count() < 1)
7075 {
7076 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7077 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7078 }
7079 else
7080 {
7081 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7082 }
7083
7084 idx = inventory_slots.Find(slot);
7085 if (idx < 0)
7086 return "";
7087
7088 return attach_types.Get(idx);
7089 }
7090
7092 {
7093 int idx = -1;
7094 string slot;
7095
7098
7099 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7100 if (inventory_slots.Count() < 1)
7101 {
7102 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7103 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7104 }
7105 else
7106 {
7107 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7108 if (detach_types.Count() < 1)
7109 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7110 }
7111
7112 for (int i = 0; i < inventory_slots.Count(); i++)
7113 {
7114 slot = inventory_slots.Get(i);
7115 }
7116
7117 if (slot != "")
7118 {
7119 if (detach_types.Count() == 1)
7120 idx = 0;
7121 else
7122 idx = inventory_slots.Find(slot);
7123 }
7124 if (idx < 0)
7125 return "";
7126
7127 return detach_types.Get(idx);
7128 }
7129
7131 {
7132
7134
7135
7136 float min_time = 1;
7137 float max_time = 3;
7138 float delay = Math.RandomFloat(min_time, max_time);
7139
7140 explode_timer.Run(delay, this, "DoAmmoExplosion");
7141 }
7142
7144 {
7145 Magazine magazine = Magazine.Cast(this);
7146 int pop_sounds_count = 6;
7147 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7148
7149
7150 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7151 string sound_name = pop_sounds[ sound_idx ];
7153
7154
7155 magazine.ServerAddAmmoCount(-1);
7156
7157
7158 float min_temp_to_explode = 100;
7159
7160 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7161 {
7163 }
7164 }
7165
7166
7167 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7168 {
7169 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7170
7171 const int CHANCE_DAMAGE_CARGO = 4;
7172 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7173 const int CHANCE_DAMAGE_NOTHING = 2;
7174
7176 {
7177 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7178 int chances;
7179 int rnd;
7180
7181 if (GetInventory().GetCargo())
7182 {
7183 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7184 rnd = Math.RandomInt(0,chances);
7185
7186 if (rnd < CHANCE_DAMAGE_CARGO)
7187 {
7189 }
7190 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7191 {
7193 }
7194 }
7195 else
7196 {
7197 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7198 rnd = Math.RandomInt(0,chances);
7199
7200 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7201 {
7203 }
7204 }
7205 }
7206 }
7207
7209 {
7210 if (GetInventory().GetCargo())
7211 {
7212 int item_count = GetInventory().GetCargo().GetItemCount();
7213 if (item_count > 0)
7214 {
7215 int random_pick = Math.RandomInt(0, item_count);
7217 if (!item.IsExplosive())
7218 {
7219 item.AddHealth("","",damage);
7220 return true;
7221 }
7222 }
7223 }
7224 return false;
7225 }
7226
7228 {
7229 int attachment_count = GetInventory().AttachmentCount();
7230 if (attachment_count > 0)
7231 {
7232 int random_pick = Math.RandomInt(0, attachment_count);
7233 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7234 if (!attachment.IsExplosive())
7235 {
7236 attachment.AddHealth("","",damage);
7237 return true;
7238 }
7239 }
7240 return false;
7241 }
7242
7244 {
7246 }
7247
7249 {
7251 return GetInventory().CanRemoveEntity();
7252
7253 return false;
7254 }
7255
7257 {
7259 return;
7260
7262 {
7263 if (ScriptInputUserData.CanStoreInputUserData())
7264 {
7265 ScriptInputUserData ctx = new ScriptInputUserData;
7270 ctx.
Write(destination_entity);
7274 }
7275 }
7276 else if (!
GetGame().IsMultiplayer())
7277 {
7279 }
7280 }
7281
7283 {
7285 return;
7286
7287 float split_quantity_new;
7291 InventoryLocation loc = new InventoryLocation;
7292
7293 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7294 {
7296 split_quantity_new = stack_max;
7297 else
7299
7300 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7301 if (new_item)
7302 {
7303 new_item.SetResultOfSplit(true);
7304 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7306 new_item.SetQuantity(split_quantity_new);
7307 }
7308 }
7309 else if (destination_entity && slot_id == -1)
7310 {
7311 if (quantity > stack_max)
7312 split_quantity_new = stack_max;
7313 else
7314 split_quantity_new = quantity;
7315
7317 {
7320 }
7321
7322 if (new_item)
7323 {
7324 new_item.SetResultOfSplit(true);
7325 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7327 new_item.SetQuantity(split_quantity_new);
7328 }
7329 }
7330 else
7331 {
7332 if (stack_max != 0)
7333 {
7335 {
7337 }
7338
7339 if (split_quantity_new == 0)
7340 {
7341 if (!
GetGame().IsMultiplayer())
7342 player.PhysicalPredictiveDropItem(this);
7343 else
7344 player.ServerDropEntity(this);
7345 return;
7346 }
7347
7349
7350 if (new_item)
7351 {
7352 new_item.SetResultOfSplit(true);
7353 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7355 new_item.SetQuantity(stack_max);
7356 new_item.PlaceOnSurface();
7357 }
7358 }
7359 }
7360 }
7361
7363 {
7365 return;
7366
7367 float split_quantity_new;
7371 InventoryLocation loc = new InventoryLocation;
7372
7373 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7374 {
7376 split_quantity_new = stack_max;
7377 else
7379
7380 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7381 if (new_item)
7382 {
7383 new_item.SetResultOfSplit(true);
7384 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7386 new_item.SetQuantity(split_quantity_new);
7387 }
7388 }
7389 else if (destination_entity && slot_id == -1)
7390 {
7391 if (quantity > stack_max)
7392 split_quantity_new = stack_max;
7393 else
7394 split_quantity_new = quantity;
7395
7397 {
7400 }
7401
7402 if (new_item)
7403 {
7404 new_item.SetResultOfSplit(true);
7405 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7407 new_item.SetQuantity(split_quantity_new);
7408 }
7409 }
7410 else
7411 {
7412 if (stack_max != 0)
7413 {
7415 {
7417 }
7418
7420
7421 if (new_item)
7422 {
7423 new_item.SetResultOfSplit(true);
7424 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7426 new_item.SetQuantity(stack_max);
7427 new_item.PlaceOnSurface();
7428 }
7429 }
7430 }
7431 }
7432
7434 {
7436 return;
7437
7439 {
7440 if (ScriptInputUserData.CanStoreInputUserData())
7441 {
7442 ScriptInputUserData ctx = new ScriptInputUserData;
7447 dst.WriteToContext(ctx);
7449 }
7450 }
7451 else if (!
GetGame().IsMultiplayer())
7452 {
7454 }
7455 }
7456
7458 {
7460 return;
7461
7463 {
7464 if (ScriptInputUserData.CanStoreInputUserData())
7465 {
7466 ScriptInputUserData ctx = new ScriptInputUserData;
7471 ctx.
Write(destination_entity);
7477 }
7478 }
7479 else if (!
GetGame().IsMultiplayer())
7480 {
7482 }
7483 }
7484
7486 {
7488 }
7489
7491 {
7493 return this;
7494
7496 float split_quantity_new;
7498 if (dst.IsValid())
7499 {
7500 int slot_id = dst.GetSlot();
7502
7503 if (quantity > stack_max)
7504 split_quantity_new = stack_max;
7505 else
7506 split_quantity_new = quantity;
7507
7509
7510 if (new_item)
7511 {
7512 new_item.SetResultOfSplit(true);
7513 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7516 }
7517
7518 return new_item;
7519 }
7520
7521 return null;
7522 }
7523
7525 {
7527 return;
7528
7530 float split_quantity_new;
7532 if (destination_entity)
7533 {
7535 if (quantity > stackable)
7536 split_quantity_new = stackable;
7537 else
7538 split_quantity_new = quantity;
7539
7540 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7541 if (new_item)
7542 {
7543 new_item.SetResultOfSplit(true);
7544 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7546 new_item.SetQuantity(split_quantity_new);
7547 }
7548 }
7549 }
7550
7552 {
7554 return;
7555
7557 {
7558 if (ScriptInputUserData.CanStoreInputUserData())
7559 {
7560 ScriptInputUserData ctx = new ScriptInputUserData;
7565 ItemBase destination_entity =
this;
7566 ctx.
Write(destination_entity);
7570 }
7571 }
7572 else if (!
GetGame().IsMultiplayer())
7573 {
7575 }
7576 }
7577
7579 {
7581 return;
7582
7584 float split_quantity_new;
7586 if (player)
7587 {
7589 if (quantity > stackable)
7590 split_quantity_new = stackable;
7591 else
7592 split_quantity_new = quantity;
7593
7594 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7595 new_item =
ItemBase.Cast(in_hands);
7596 if (new_item)
7597 {
7598 new_item.SetResultOfSplit(true);
7599 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7601 new_item.SetQuantity(split_quantity_new);
7602 }
7603 }
7604 }
7605
7607 {
7609 return;
7610
7612 float split_quantity_new = Math.Floor(quantity * 0.5);
7613
7615
7616 if (new_item)
7617 {
7618 if (new_item.GetQuantityMax() < split_quantity_new)
7619 {
7620 split_quantity_new = new_item.GetQuantityMax();
7621 }
7622
7623 new_item.SetResultOfSplit(true);
7624 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7625
7627 {
7630 }
7631 else
7632 {
7635 }
7636 }
7637 }
7638
7640 {
7642 return;
7643
7645 float split_quantity_new = Math.Floor(quantity / 2);
7646
7647 InventoryLocation invloc = new InventoryLocation;
7649
7651 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7652
7653 if (new_item)
7654 {
7655 if (new_item.GetQuantityMax() < split_quantity_new)
7656 {
7657 split_quantity_new = new_item.GetQuantityMax();
7658 }
7660 {
7663 }
7664 else
7665 {
7668 }
7669 }
7670 }
7671
7674 {
7675 SetWeightDirty();
7677
7678 if (parent)
7679 parent.OnAttachmentQuantityChangedEx(this, delta);
7680
7682 {
7684 {
7686 }
7688 {
7689 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7691 }
7692 }
7693
7694 }
7695
7698 {
7699
7700 }
7701
7704 {
7706 }
7707
7709 {
7710 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7711
7713 {
7714 if (newLevel == GameConstants.STATE_RUINED)
7715 {
7717 EntityAI parent = GetHierarchyParent();
7718 if (parent && parent.IsFireplace())
7719 {
7720 CargoBase cargo = GetInventory().GetCargo();
7721 if (cargo)
7722 {
7724 {
7726 }
7727 }
7728 }
7729 }
7730
7732 {
7733
7735 return;
7736 }
7737
7738 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7739 {
7741 }
7742 }
7743 }
7744
7745
7747 {
7748 super.OnRightClick();
7749
7751 {
7753 {
7754 if (ScriptInputUserData.CanStoreInputUserData())
7755 {
7756 vector m4[4];
7758
7759 EntityAI root = GetHierarchyRoot();
7760
7761 InventoryLocation dst = new InventoryLocation;
7763 {
7764 if (root)
7765 {
7766 root.GetTransform(m4);
7768 }
7769 else
7770 GetInventory().GetCurrentInventoryLocation(dst);
7771 }
7772 else
7773 {
7775
7776
7777 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7778 {
7779 if (root)
7780 {
7781 root.GetTransform(m4);
7783 }
7784 else
7785 GetInventory().GetCurrentInventoryLocation(dst);
7786 }
7787 else
7788 {
7789 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7790 }
7791 }
7792
7793 ScriptInputUserData ctx = new ScriptInputUserData;
7801 }
7802 }
7803 else if (!
GetGame().IsMultiplayer())
7804 {
7806 }
7807 }
7808 }
7809
7810 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7811 {
7812
7813 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7814 return false;
7815
7816 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7817 return false;
7818
7819
7821 return false;
7822
7823
7824 Magazine mag = Magazine.Cast(this);
7825 if (mag)
7826 {
7827 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7828 return false;
7829
7830 if (stack_max_limit)
7831 {
7832 Magazine other_mag = Magazine.Cast(other_item);
7833 if (other_item)
7834 {
7835 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7836 return false;
7837 }
7838
7839 }
7840 }
7841 else
7842 {
7843
7845 return false;
7846
7848 return false;
7849 }
7850
7851 PlayerBase player = null;
7852 if (CastTo(player, GetHierarchyRootPlayer()))
7853 {
7854 if (player.GetInventory().HasAttachment(this))
7855 return false;
7856
7857 if (player.IsItemsToDelete())
7858 return false;
7859 }
7860
7861 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7862 return false;
7863
7864 int slotID;
7866 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7867 return false;
7868
7869 return true;
7870 }
7871
7873 {
7875 }
7876
7878 {
7879 return m_IsResultOfSplit;
7880 }
7881
7883 {
7884 m_IsResultOfSplit = value;
7885 }
7886
7888 {
7890 }
7891
7893 {
7894 float other_item_quantity = other_item.GetQuantity();
7895 float this_free_space;
7896
7898
7900
7901 if (other_item_quantity > this_free_space)
7902 {
7903 return this_free_space;
7904 }
7905 else
7906 {
7907 return other_item_quantity;
7908 }
7909 }
7910
7912 {
7914 }
7915
7917 {
7919 return;
7920
7921 if (!IsMagazine() && other_item)
7922 {
7924 if (quantity_used != 0)
7925 {
7926 float hp1 = GetHealth01("","");
7927 float hp2 = other_item.GetHealth01("","");
7928 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7929 hpResult = hpResult / (
GetQuantity() + quantity_used);
7930
7931 hpResult *= GetMaxHealth();
7932 Math.Round(hpResult);
7933 SetHealth("", "Health", hpResult);
7934
7936 other_item.AddQuantity(-quantity_used);
7937 }
7938 }
7940 }
7941
7943 {
7944 #ifdef SERVER
7945 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7946 GetHierarchyParent().IncreaseLifetimeUp();
7947 #endif
7948 };
7949
7951 {
7952 PlayerBase p = PlayerBase.Cast(player);
7953
7954 array<int> recipesIds = p.m_Recipes;
7955 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7956 if (moduleRecipesManager)
7957 {
7958 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7959 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7960 }
7961
7962 for (int i = 0;i < recipesIds.Count(); i++)
7963 {
7964 int key = recipesIds.Get(i);
7965 string recipeName = moduleRecipesManager.GetRecipeName(key);
7967 }
7968 }
7969
7970
7971 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7972 {
7973 super.GetDebugActions(outputList);
7974
7975
7980
7981
7985
7989
7990
7993
7994
7996 {
7999 }
8000
8002
8005
8009 }
8010
8011
8012
8013
8015 {
8016 super.OnAction(action_id, player, ctx);
8017 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8018 {
8019 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8020 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8021 PlayerBase p = PlayerBase.Cast(player);
8022 if (
EActions.RECIPES_RANGE_START < 1000)
8023 {
8024 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8025 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8026 }
8027 }
8028 #ifndef SERVER
8029 else if (action_id ==
EActions.WATCH_PLAYER)
8030 {
8031 PluginDeveloper.SetDeveloperItemClientEx(player);
8032 }
8033 #endif
8035 {
8036 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8037 {
8038 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8039 OnDebugButtonPressServer(id + 1);
8040 }
8041
8042 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8043 {
8044 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8046 }
8047
8048 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8049 {
8050 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8052 }
8053
8054 else if (action_id ==
EActions.ADD_QUANTITY)
8055 {
8056 if (IsMagazine())
8057 {
8058 Magazine mag = Magazine.Cast(this);
8059 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8060 }
8061 else
8062 {
8064 }
8065
8066 if (m_EM)
8067 {
8068 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8069 }
8070
8071 }
8072
8073 else if (action_id ==
EActions.REMOVE_QUANTITY)
8074 {
8075 if (IsMagazine())
8076 {
8077 Magazine mag2 = Magazine.Cast(this);
8078 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8079 }
8080 else
8081 {
8083 }
8084 if (m_EM)
8085 {
8086 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8087 }
8088
8089 }
8090
8091 else if (action_id ==
EActions.SET_QUANTITY_0)
8092 {
8094
8095 if (m_EM)
8096 {
8097 m_EM.SetEnergy(0);
8098 }
8099 }
8100
8101 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8102 {
8104
8105 if (m_EM)
8106 {
8107 m_EM.SetEnergy(m_EM.GetEnergyMax());
8108 }
8109 }
8110
8111 else if (action_id ==
EActions.ADD_HEALTH)
8112 {
8113 AddHealth("","",GetMaxHealth("","Health")/5);
8114 }
8115 else if (action_id ==
EActions.REMOVE_HEALTH)
8116 {
8117 AddHealth("","",-GetMaxHealth("","Health")/5);
8118 }
8119 else if (action_id ==
EActions.DESTROY_HEALTH)
8120 {
8121 SetHealth01("","",0);
8122 }
8123 else if (action_id ==
EActions.WATCH_ITEM)
8124 {
8126 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8127 #ifdef DEVELOPER
8128 SetDebugDeveloper_item(this);
8129 #endif
8130 }
8131
8132 else if (action_id ==
EActions.ADD_TEMPERATURE)
8133 {
8134 AddTemperature(20);
8135
8136 }
8137
8138 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8139 {
8140 AddTemperature(-20);
8141
8142 }
8143
8144 else if (action_id ==
EActions.FLIP_FROZEN)
8145 {
8146 SetFrozen(!GetIsFrozen());
8147
8148 }
8149
8150 else if (action_id ==
EActions.ADD_WETNESS)
8151 {
8153
8154 }
8155
8156 else if (action_id ==
EActions.REMOVE_WETNESS)
8157 {
8159
8160 }
8161
8162 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8163 {
8166
8167
8168 }
8169
8170 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8171 {
8174 }
8175
8176 else if (action_id ==
EActions.MAKE_SPECIAL)
8177 {
8178 auto debugParams = DebugSpawnParams.WithPlayer(player);
8179 OnDebugSpawnEx(debugParams);
8180 }
8181
8182 else if (action_id ==
EActions.DELETE)
8183 {
8184 Delete();
8185 }
8186
8187 }
8188
8189
8190 return false;
8191 }
8192
8193
8194
8195
8199
8202
8203
8204
8206 {
8207 return false;
8208 }
8209
8210
8212 {
8213 return true;
8214 }
8215
8216
8218 {
8219 return true;
8220 }
8221
8222
8223
8225 {
8226 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8228 }
8229
8232 {
8233 return null;
8234 }
8235
8237 {
8238 return false;
8239 }
8240
8242 {
8243 return false;
8244 }
8245
8249
8250
8252 {
8253 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8254 return module_repairing.CanRepair(this, item_repair_kit);
8255 }
8256
8257
8258 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8259 {
8260 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8261 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8262 }
8263
8264
8266 {
8267
8268
8269
8270
8271
8272
8273
8274
8275 return 1;
8276 }
8277
8278
8279
8281 {
8283 }
8284
8285
8286
8288 {
8290 }
8291
8292
8301 {
8302 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8303
8304 if (player)
8305 {
8306 player.MessageStatus(text);
8307 }
8308 }
8309
8310
8319 {
8320 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8321
8322 if (player)
8323 {
8324 player.MessageAction(text);
8325 }
8326 }
8327
8328
8337 {
8338 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8339
8340 if (player)
8341 {
8342 player.MessageFriendly(text);
8343 }
8344 }
8345
8346
8355 {
8356 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8357
8358 if (player)
8359 {
8360 player.MessageImportant(text);
8361 }
8362 }
8363
8365 {
8366 return true;
8367 }
8368
8369
8370 override bool KindOf(
string tag)
8371 {
8372 bool found = false;
8373 string item_name = this.
GetType();
8376
8377 int array_size = item_tag_array.Count();
8378 for (int i = 0; i < array_size; i++)
8379 {
8380 if (item_tag_array.Get(i) == tag)
8381 {
8382 found = true;
8383 break;
8384 }
8385 }
8386 return found;
8387 }
8388
8389
8391 {
8392
8393 super.OnRPC(sender, rpc_type,ctx);
8394
8395
8396 switch (rpc_type)
8397 {
8398 #ifndef SERVER
8399 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8400 Param2<bool, string> p = new Param2<bool, string>(false, "");
8401
8403 return;
8404
8405 bool play = p.param1;
8406 string soundSet = p.param2;
8407
8408 if (play)
8409 {
8411 {
8413 {
8415 }
8416 }
8417 else
8418 {
8420 }
8421 }
8422 else
8423 {
8425 }
8426
8427 break;
8428 #endif
8429
8430 }
8431
8433 {
8435 }
8436 }
8437
8438
8439
8440
8442 {
8443 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8444 return plugin.GetID(
name);
8445 }
8446
8448 {
8449 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8450 return plugin.GetName(id);
8451 }
8452
8455 {
8456
8457
8458 int varFlags;
8459 if (!ctx.
Read(varFlags))
8460 return;
8461
8462 if (varFlags & ItemVariableFlags.FLOAT)
8463 {
8465 }
8466 }
8467
8469 {
8470
8471 super.SerializeNumericalVars(floats_out);
8472
8473
8474
8476 {
8478 }
8479
8481 {
8483 }
8484
8486 {
8488 }
8489
8491 {
8496 }
8497
8499 {
8501 }
8502 }
8503
8505 {
8506
8507 super.DeSerializeNumericalVars(floats);
8508
8509
8510 int index = 0;
8511 int mask = Math.Round(floats.Get(index));
8512
8513 index++;
8514
8516 {
8518 {
8520 }
8521 else
8522 {
8523 float quantity = floats.Get(index);
8525 }
8526 index++;
8527 }
8528
8530 {
8531 float wet = floats.Get(index);
8533 index++;
8534 }
8535
8537 {
8538 int liquidtype = Math.Round(floats.Get(index));
8540 index++;
8541 }
8542
8544 {
8546 index++;
8548 index++;
8550 index++;
8552 index++;
8553 }
8554
8556 {
8557 int cleanness = Math.Round(floats.Get(index));
8559 index++;
8560 }
8561 }
8562
8564 {
8565 super.WriteVarsToCTX(ctx);
8566
8567
8569 {
8571 }
8572
8574 {
8576 }
8577
8579 {
8581 }
8582
8584 {
8585 int r,g,b,a;
8591 }
8592
8594 {
8596 }
8597 }
8598
8600 {
8601 if (!super.ReadVarsFromCTX(ctx,version))
8602 return false;
8603
8604 int intValue;
8605 float value;
8606
8607 if (version < 140)
8608 {
8609 if (!ctx.
Read(intValue))
8610 return false;
8611
8612 m_VariablesMask = intValue;
8613 }
8614
8616 {
8617 if (!ctx.
Read(value))
8618 return false;
8619
8621 {
8623 }
8624 else
8625 {
8627 }
8628 }
8629
8630 if (version < 140)
8631 {
8633 {
8634 if (!ctx.
Read(value))
8635 return false;
8636 SetTemperatureDirect(value);
8637 }
8638 }
8639
8641 {
8642 if (!ctx.
Read(value))
8643 return false;
8645 }
8646
8648 {
8649 if (!ctx.
Read(intValue))
8650 return false;
8652 }
8653
8655 {
8656 int r,g,b,a;
8658 return false;
8660 return false;
8662 return false;
8664 return false;
8665
8667 }
8668
8670 {
8671 if (!ctx.
Read(intValue))
8672 return false;
8674 }
8675
8676 if (version >= 138 && version < 140)
8677 {
8679 {
8680 if (!ctx.
Read(intValue))
8681 return false;
8682 SetFrozen(intValue);
8683 }
8684 }
8685
8686 return true;
8687 }
8688
8689
8691 {
8694 {
8696 }
8697
8698 if (!super.OnStoreLoad(ctx, version))
8699 {
8701 return false;
8702 }
8703
8704 if (version >= 114)
8705 {
8706 bool hasQuickBarIndexSaved;
8707
8708 if (!ctx.
Read(hasQuickBarIndexSaved))
8709 {
8711 return false;
8712 }
8713
8714 if (hasQuickBarIndexSaved)
8715 {
8716 int itmQBIndex;
8717
8718
8719 if (!ctx.
Read(itmQBIndex))
8720 {
8722 return false;
8723 }
8724
8725 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8726 if (itmQBIndex != -1 && parentPlayer)
8727 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8728 }
8729 }
8730 else
8731 {
8732
8733 PlayerBase player;
8734 int itemQBIndex;
8735 if (version ==
int.
MAX)
8736 {
8737 if (!ctx.
Read(itemQBIndex))
8738 {
8740 return false;
8741 }
8742 }
8743 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8744 {
8745
8746 if (!ctx.
Read(itemQBIndex))
8747 {
8749 return false;
8750 }
8751 if (itemQBIndex != -1 && player)
8752 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8753 }
8754 }
8755
8756 if (version < 140)
8757 {
8758
8759 if (!LoadVariables(ctx, version))
8760 {
8762 return false;
8763 }
8764 }
8765
8766
8768 {
8770 return false;
8771 }
8772 if (version >= 132)
8773 {
8775 if (raib)
8776 {
8778 {
8780 return false;
8781 }
8782 }
8783 }
8784
8786 return true;
8787 }
8788
8789
8790
8792 {
8793 super.OnStoreSave(ctx);
8794
8795 PlayerBase player;
8796 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8797 {
8799
8800 int itemQBIndex = -1;
8801 itemQBIndex = player.FindQuickBarEntityIndex(this);
8802 ctx.
Write(itemQBIndex);
8803 }
8804 else
8805 {
8807 }
8808
8810
8812 if (raib)
8813 {
8815 }
8816 }
8817
8818
8820 {
8821 super.AfterStoreLoad();
8822
8824 {
8826 }
8827
8829 {
8832 }
8833 }
8834
8836 {
8837 super.EEOnAfterLoad();
8838
8840 {
8842 }
8843
8846 }
8847
8849 {
8850 return false;
8851 }
8852
8853
8854
8856 {
8858 {
8859 #ifdef PLATFORM_CONSOLE
8860
8862 {
8864 if (menu)
8865 {
8867 }
8868 }
8869 #endif
8870 }
8871
8873 {
8876 }
8877
8879 {
8880 SetWeightDirty();
8882 }
8884 {
8887 }
8888
8890 {
8893 }
8895 {
8898 }
8899
8900 super.OnVariablesSynchronized();
8901 }
8902
8903
8904
8906 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8907 {
8908 if (!IsServerCheck(allow_client))
8909 return false;
8910
8912 return false;
8913
8916
8917 if (value <= (min + 0.001))
8918 value = min;
8919
8920 if (value == min)
8921 {
8922 if (destroy_config)
8923 {
8924 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8925 if (dstr)
8926 {
8928 this.Delete();
8929 return true;
8930 }
8931 }
8932 else if (destroy_forced)
8933 {
8935 this.Delete();
8936 return true;
8937 }
8938
8940 }
8941
8944
8946 {
8948
8949 if (delta)
8951 }
8952
8954
8955 return false;
8956 }
8957
8958
8960 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8961 {
8963 }
8964
8966 {
8969 }
8970
8972 {
8975 }
8976
8979 {
8980 float value_clamped = Math.Clamp(value, 0, 1);
8982 SetQuantity(result, destroy_config, destroy_forced);
8983 }
8984
8985
8988 {
8990 }
8991
8993 {
8995 }
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9007 {
9008 int slot = -1;
9009 if (GetInventory())
9010 {
9011 InventoryLocation il = new InventoryLocation;
9012 GetInventory().GetCurrentInventoryLocation(il);
9014 }
9015
9017 }
9018
9020 {
9021 float quantity_max = 0;
9022
9024 {
9025 if (attSlotID != -1)
9026 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9027
9028 if (quantity_max <= 0)
9030 }
9031
9032 if (quantity_max <= 0)
9034
9035 return quantity_max;
9036 }
9037
9039 {
9041 }
9042
9044 {
9046 }
9047
9048
9050 {
9052 }
9053
9055 {
9057 }
9058
9060 {
9062 }
9063
9064
9066 {
9067
9068 float weightEx = GetWeightEx();
9069 float special = GetInventoryAndCargoWeight();
9070 return weightEx - special;
9071 }
9072
9073
9075 {
9077 }
9078
9080 {
9082 {
9083 #ifdef DEVELOPER
9084 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9085 {
9086 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9088 }
9089 #endif
9090
9092 }
9093 else if (HasEnergyManager())
9094 {
9095 #ifdef DEVELOPER
9096 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9097 {
9098 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9099 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9100 }
9101 #endif
9102 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9103 }
9104 else
9105 {
9106 #ifdef DEVELOPER
9107 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9108 {
9109 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9110 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9111 }
9112 #endif
9113 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9114 }
9115 }
9116
9119 {
9120 int item_count = 0;
9122
9123 if (GetInventory().GetCargo() != NULL)
9124 {
9125 item_count = GetInventory().GetCargo().GetItemCount();
9126 }
9127
9128 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9129 {
9130 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9131 if (item)
9132 item_count += item.GetNumberOfItems();
9133 }
9134 return item_count;
9135 }
9136
9139 {
9140 float weight = 0;
9141 float wetness = 1;
9142 if (include_wetness)
9145 {
9146 weight = wetness * m_ConfigWeight;
9147 }
9149 {
9150 weight = 1;
9151 }
9152 return weight;
9153 }
9154
9155
9156
9158 {
9159 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9160 {
9161 GameInventory inv = GetInventory();
9162 array<EntityAI> items = new array<EntityAI>;
9164 for (int i = 0; i < items.Count(); i++)
9165 {
9167 if (item)
9168 {
9170 }
9171 }
9172 }
9173 }
9174
9175
9176
9177
9179 {
9180 float energy = 0;
9181 if (HasEnergyManager())
9182 {
9183 energy = GetCompEM().GetEnergy();
9184 }
9185 return energy;
9186 }
9187
9188
9190 {
9191 super.OnEnergyConsumed();
9192
9194 }
9195
9197 {
9198 super.OnEnergyAdded();
9199
9201 }
9202
9203
9205 {
9206 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9207 {
9209 {
9210 float energy_0to1 = GetCompEM().GetEnergy0To1();
9212 }
9213 }
9214 }
9215
9216
9218 {
9219 return ConfigGetFloat("heatIsolation");
9220 }
9221
9223 {
9225 }
9226
9228 {
9229 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9230 if (
GetGame().ConfigIsExisting(paramPath))
9232
9233 return 0.0;
9234 }
9235
9237 {
9238 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9239 if (
GetGame().ConfigIsExisting(paramPath))
9241
9242 return 0.0;
9243 }
9244
9245 override void SetWet(
float value,
bool allow_client =
false)
9246 {
9247 if (!IsServerCheck(allow_client))
9248 return;
9249
9252
9254
9255 m_VarWet = Math.Clamp(value, min, max);
9256
9258 {
9261 }
9262 }
9263
9264 override void AddWet(
float value)
9265 {
9267 }
9268
9270 {
9272 }
9273
9275 {
9277 }
9278
9280 {
9282 }
9283
9285 {
9287 }
9288
9290 {
9292 }
9293
9295 {
9298 if (newLevel != oldLevel)
9299 {
9301 }
9302 }
9303
9305 {
9306 SetWeightDirty();
9307 }
9308
9310 {
9311 return GetWetLevelInternal(
m_VarWet);
9312 }
9313
9314
9315
9317 {
9319 }
9320
9322 {
9324 }
9325
9327 {
9329 }
9330
9332 {
9334 }
9335
9336
9337
9339 {
9340 if (ConfigIsExisting("itemModelLength"))
9341 {
9342 return ConfigGetFloat("itemModelLength");
9343 }
9344 return 0;
9345 }
9346
9348 {
9349 if (ConfigIsExisting("itemAttachOffset"))
9350 {
9351 return ConfigGetFloat("itemAttachOffset");
9352 }
9353 return 0;
9354 }
9355
9356 override void SetCleanness(
int value,
bool allow_client =
false)
9357 {
9358 if (!IsServerCheck(allow_client))
9359 return;
9360
9362
9364
9367 }
9368
9370 {
9372 }
9373
9375 {
9376 return true;
9377 }
9378
9379
9380
9381
9383 {
9385 }
9386
9388 {
9390 }
9391
9392
9393
9394
9395 override void SetColor(
int r,
int g,
int b,
int a)
9396 {
9402 }
9404 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9405 {
9410 }
9411
9413 {
9415 }
9416
9419 {
9420 int r,g,b,a;
9422 r = r/255;
9423 g = g/255;
9424 b = b/255;
9425 a = a/255;
9426 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9427 }
9428
9429
9430
9431 override void SetLiquidType(
int value,
bool allow_client =
false)
9432 {
9433 if (!IsServerCheck(allow_client))
9434 return;
9435
9440 }
9441
9443 {
9444 return ConfigGetInt("varLiquidTypeInit");
9445 }
9446
9448 {
9450 }
9451
9453 {
9455 SetFrozen(false);
9456 }
9457
9460 {
9461 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9462 }
9463
9464
9467 {
9468 PlayerBase nplayer;
9469 if (PlayerBase.CastTo(nplayer, player))
9470 {
9472
9473 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9474 }
9475 }
9476
9477
9480 {
9481 PlayerBase nplayer;
9482 if (PlayerBase.CastTo(nplayer,player))
9483 {
9484
9485 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9486
9487 }
9488
9489
9490 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9491
9492
9493 if (HasEnergyManager())
9494 {
9495 GetCompEM().UpdatePlugState();
9496 }
9497 }
9498
9499
9501 {
9502 super.OnPlacementStarted(player);
9503
9505 }
9506
9507 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9508 {
9510 {
9511 m_AdminLog.OnPlacementComplete(player,
this);
9512 }
9513
9514 super.OnPlacementComplete(player, position, orientation);
9515 }
9516
9517
9518
9519
9520
9522 {
9524 {
9525 return true;
9526 }
9527 else
9528 {
9529 return false;
9530 }
9531 }
9532
9533
9535 {
9537 {
9539 }
9540 }
9541
9542
9544 {
9546 }
9547
9549 {
9551 }
9552
9553 override void InsertAgent(
int agent,
float count = 1)
9554 {
9555 if (count < 1)
9556 return;
9557
9559 }
9560
9563 {
9565 }
9566
9567
9569 {
9571 }
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
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
9615 {
9617 return false;
9618 return true;
9619 }
9620
9622 {
9623
9625 }
9626
9627
9630 {
9631 super.CheckForRoofLimited(timeTresholdMS);
9632
9634 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9635 {
9636 m_PreviousRoofTestTime = time;
9637 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9638 }
9639 }
9640
9641
9643 {
9645 {
9646 return 0;
9647 }
9648
9649 if (GetInventory().GetAttachmentSlotsCount() != 0)
9650 {
9651 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9652 if (filter)
9653 return filter.GetProtectionLevel(type, false, system);
9654 else
9655 return 0;
9656 }
9657
9658 string subclassPath, entryName;
9659
9660 switch (type)
9661 {
9663 entryName = "biological";
9664 break;
9666 entryName = "chemical";
9667 break;
9668 default:
9669 entryName = "biological";
9670 break;
9671 }
9672
9673 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9674
9676 }
9677
9678
9679
9682 {
9683 if (!IsMagazine())
9685
9687 }
9688
9689
9690
9691
9692
9697 {
9698 return true;
9699 }
9700
9702 {
9704 }
9705
9706
9707
9708
9709
9711 {
9712 if (parent)
9713 {
9714 if (parent.IsInherited(DayZInfected))
9715 return true;
9716
9717 if (!parent.IsRuined())
9718 return true;
9719 }
9720
9721 return true;
9722 }
9723
9725 {
9726 if (!super.CanPutAsAttachment(parent))
9727 {
9728 return false;
9729 }
9730
9731 if (!IsRuined() && !parent.IsRuined())
9732 {
9733 return true;
9734 }
9735
9736 return false;
9737 }
9738
9740 {
9741
9742
9743
9744
9745 return super.CanReceiveItemIntoCargo(item);
9746 }
9747
9749 {
9750
9751
9752
9753
9754 GameInventory attachmentInv = attachment.GetInventory();
9756 {
9757 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9758 return false;
9759 }
9760
9761 InventoryLocation loc = new InventoryLocation();
9762 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9763 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9764 return false;
9765
9766 return super.CanReceiveAttachment(attachment, slotId);
9767 }
9768
9770 {
9771 if (!super.CanReleaseAttachment(attachment))
9772 return false;
9773
9774 return GetInventory().AreChildrenAccessible();
9775 }
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9798 {
9799 int id = muzzle_owner.GetMuzzleID();
9800 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9801
9802 if (WPOF_array)
9803 {
9804 for (int i = 0; i < WPOF_array.Count(); i++)
9805 {
9806 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9807
9808 if (WPOF)
9809 {
9810 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9811 }
9812 }
9813 }
9814 }
9815
9816
9818 {
9819 int id = muzzle_owner.GetMuzzleID();
9821
9822 if (WPOBE_array)
9823 {
9824 for (int i = 0; i < WPOBE_array.Count(); i++)
9825 {
9826 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9827
9828 if (WPOBE)
9829 {
9830 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9831 }
9832 }
9833 }
9834 }
9835
9836
9838 {
9839 int id = muzzle_owner.GetMuzzleID();
9840 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9841
9842 if (WPOOH_array)
9843 {
9844 for (int i = 0; i < WPOOH_array.Count(); i++)
9845 {
9846 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9847
9848 if (WPOOH)
9849 {
9850 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9851 }
9852 }
9853 }
9854 }
9855
9856
9858 {
9859 int id = muzzle_owner.GetMuzzleID();
9860 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9861
9862 if (WPOOH_array)
9863 {
9864 for (int i = 0; i < WPOOH_array.Count(); i++)
9865 {
9866 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9867
9868 if (WPOOH)
9869 {
9870 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9871 }
9872 }
9873 }
9874 }
9875
9876
9878 {
9879 int id = muzzle_owner.GetMuzzleID();
9880 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9881
9882 if (WPOOH_array)
9883 {
9884 for (int i = 0; i < WPOOH_array.Count(); i++)
9885 {
9886 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9887
9888 if (WPOOH)
9889 {
9890 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9891 }
9892 }
9893 }
9894 }
9895
9896
9897
9899 {
9901 {
9902 return true;
9903 }
9904
9905 return false;
9906 }
9907
9909 {
9911 {
9912 return true;
9913 }
9914
9915 return false;
9916 }
9917
9919 {
9921 {
9922 return true;
9923 }
9924
9925 return false;
9926 }
9927
9929 {
9930 return false;
9931 }
9932
9935 {
9936 return UATimeSpent.DEFAULT_DEPLOY;
9937 }
9938
9939
9940
9941
9943 {
9945 SetSynchDirty();
9946 }
9947
9949 {
9951 }
9952
9953
9955 {
9956 return false;
9957 }
9958
9961 {
9962 string att_type = "None";
9963
9964 if (ConfigIsExisting("soundAttType"))
9965 {
9966 att_type = ConfigGetString("soundAttType");
9967 }
9968
9970 }
9971
9973 {
9975 }
9976
9977
9978
9979
9980
9984
9986 {
9989
9991 }
9992
9993
9995 {
9997 return;
9998
10000
10003
10006
10007 SoundParameters params = new SoundParameters();
10011 }
10012
10013
10015 {
10017 return;
10018
10020 SetSynchDirty();
10021
10024 }
10025
10026
10028 {
10030 return;
10031
10033 SetSynchDirty();
10034
10037 }
10038
10040 {
10042 }
10043
10045 {
10047 }
10048
10051 {
10052 if (!
GetGame().IsDedicatedServer())
10053 {
10054 if (ConfigIsExisting("attachSoundSet"))
10055 {
10056 string cfg_path = "";
10057 string soundset = "";
10058 string type_name =
GetType();
10059
10062 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10063 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10064
10065 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10066 {
10067 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10068 {
10069 if (cfg_slot_array[i] == slot_type)
10070 {
10071 soundset = cfg_soundset_array[i];
10072 break;
10073 }
10074 }
10075 }
10076
10077 if (soundset != "")
10078 {
10079 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10081 }
10082 }
10083 }
10084 }
10085
10087 {
10088
10089 }
10090
10091 void OnApply(PlayerBase player);
10092
10094 {
10095 return 1.0;
10096 };
10097
10099 {
10101 }
10102
10104 {
10106 }
10107
10109
10111 {
10112 SetDynamicPhysicsLifeTime(0.01);
10114 }
10115
10117 {
10118 array<string> zone_names = new array<string>;
10119 GetDamageZones(zone_names);
10120 for (int i = 0; i < zone_names.Count(); i++)
10121 {
10122 SetHealthMax(zone_names.Get(i),"Health");
10123 }
10124 SetHealthMax("","Health");
10125 }
10126
10129 {
10130 float global_health = GetHealth01("","Health");
10131 array<string> zones = new array<string>;
10132 GetDamageZones(zones);
10133
10134 for (int i = 0; i < zones.Count(); i++)
10135 {
10136 SetHealth01(zones.Get(i),"Health",global_health);
10137 }
10138 }
10139
10142 {
10143 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10144 }
10145
10147 {
10148 if (!hasRootAsPlayer)
10149 {
10150 if (refParentIB)
10151 {
10152
10153 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10154 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10155
10156 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10157 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10158
10161 }
10162 else
10163 {
10164
10167 }
10168 }
10169 }
10170
10172 {
10174 {
10175 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10176 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10177 {
10178 float heatPermCoef = 1.0;
10180 while (ent)
10181 {
10182 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10183 ent = ent.GetHierarchyParent();
10184 }
10185
10186 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10187 }
10188 }
10189 }
10190
10192 {
10193
10194 EntityAI parent = GetHierarchyParent();
10195 if (!parent)
10196 {
10197 hasParent = false;
10198 hasRootAsPlayer = false;
10199 }
10200 else
10201 {
10202 hasParent = true;
10203 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10204 refParentIB =
ItemBase.Cast(parent);
10205 }
10206 }
10207
10208 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10209 {
10210
10211 }
10212
10214 {
10215
10216 return false;
10217 }
10218
10220 {
10221
10222
10223 return false;
10224 }
10225
10227 {
10228
10229 return false;
10230 }
10231
10234 {
10235 return !GetIsFrozen() &&
IsOpen();
10236 }
10237
10239 {
10240 bool hasParent = false, hasRootAsPlayer = false;
10242
10243 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10244 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10245
10246 if (wwtu || foodDecay)
10247 {
10251
10252 if (processWetness || processTemperature || processDecay)
10253 {
10255
10256 if (processWetness)
10257 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10258
10259 if (processTemperature)
10261
10262 if (processDecay)
10263 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10264 }
10265 }
10266 }
10267
10270 {
10272 }
10273
10275 {
10278
10279 return super.GetTemperatureFreezeThreshold();
10280 }
10281
10283 {
10286
10287 return super.GetTemperatureThawThreshold();
10288 }
10289
10291 {
10294
10295 return super.GetItemOverheatThreshold();
10296 }
10297
10299 {
10301 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10302
10303 return super.GetTemperatureFreezeTime();
10304 }
10305
10307 {
10309 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10310
10311 return super.GetTemperatureThawTime();
10312 }
10313
10318
10320 {
10321 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10322 }
10323
10325 {
10326 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10327 }
10328
10331 {
10333 }
10334
10336 {
10338 }
10339
10341 {
10343 }
10344
10347 {
10348 return null;
10349 }
10350
10353 {
10354 return false;
10355 }
10356
10358 {
10360 {
10363 if (!trg)
10364 {
10366 explosive = this;
10367 }
10368
10369 explosive.PairRemote(trg);
10371
10372 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10373 trg.SetPersistentPairID(persistentID);
10374 explosive.SetPersistentPairID(persistentID);
10375
10376 return true;
10377 }
10378 return false;
10379 }
10380
10383 {
10384 float ret = 1.0;
10387 ret *= GetHealth01();
10388
10389 return ret;
10390 }
10391
10392 #ifdef DEVELOPER
10393 override void SetDebugItem()
10394 {
10395 super.SetDebugItem();
10396 _itemBase = this;
10397 }
10398
10400 {
10401 string text = super.GetDebugText();
10402
10404 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10405
10406 return text;
10407 }
10408 #endif
10409
10411 {
10412 return true;
10413 }
10414
10416
10418
10420 {
10423 }
10424
10425
10433
10449}
10450
10452{
10454 if (entity)
10455 {
10456 bool is_item = entity.IsInherited(
ItemBase);
10457 if (is_item && full_quantity)
10458 {
10461 }
10462 }
10463 else
10464 {
10466 return NULL;
10467 }
10468 return entity;
10469}
10470
10472{
10473 if (item)
10474 {
10475 if (health > 0)
10476 item.SetHealth("", "", health);
10477
10478 if (item.CanHaveTemperature())
10479 {
10481 if (item.CanFreeze())
10482 item.SetFrozen(false);
10483 }
10484
10485 if (item.HasEnergyManager())
10486 {
10487 if (quantity >= 0)
10488 {
10489 item.GetCompEM().SetEnergy0To1(quantity);
10490 }
10491 else
10492 {
10494 }
10495 }
10496 else if (item.IsMagazine())
10497 {
10498 Magazine mag = Magazine.Cast(item);
10499 if (quantity >= 0)
10500 {
10501 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10502 }
10503 else
10504 {
10506 }
10507
10508 }
10509 else
10510 {
10511 if (quantity >= 0)
10512 {
10513 item.SetQuantityNormalized(quantity, false);
10514 }
10515 else
10516 {
10518 }
10519
10520 }
10521 }
10522}
10523
10524#ifdef DEVELOPER
10526#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.