5777{
5779 {
5780 return true;
5781 }
5782};
5783
5784
5785
5787{
5791
5793
5796
5797
5798
5799
5800
5809
5815
5820
5825
5846 protected bool m_IsResultOfSplit
5847
5849
5854
5855
5856
5858
5862
5863
5864
5866
5869
5870
5871
5877
5878
5886
5889
5890
5892
5893
5895
5896
5901
5902
5907
5908
5910
5911
5913 {
5918
5919 if (!
GetGame().IsDedicatedServer())
5920 {
5922 {
5924
5926 {
5928 }
5929 }
5930
5933 }
5934
5935 m_OldLocation = null;
5936
5938 {
5940 }
5941
5942 if (ConfigIsExisting("headSelectionsToHide"))
5943 {
5946 }
5947
5949 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5950 {
5952 }
5953
5955
5956 m_IsResultOfSplit = false;
5957
5959 }
5960
5962 {
5963 super.InitItemVariables();
5964
5970 m_Count = ConfigGetInt(
"count");
5971
5974
5979
5982
5987
5999
6003
6004
6007 if (ConfigIsExisting("canBeSplit"))
6008 {
6011 }
6012
6014 if (ConfigIsExisting("itemBehaviour"))
6016
6017
6020 RegisterNetSyncVariableInt("m_VarLiquidType");
6021 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6022
6023 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6024 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6025 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6026
6027 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6028 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6029 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6030 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6031
6032 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6033 RegisterNetSyncVariableBool("m_IsTakeable");
6034 RegisterNetSyncVariableBool("m_IsHologram");
6035
6038 {
6041 }
6042
6044
6046 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6048
6049 }
6050
6052 {
6054 }
6055
6057 {
6060 {
6065 }
6066 }
6067
6068 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6069 {
6071 {
6074 }
6075
6077 }
6078
6080 {
6086 }
6087
6089
6091 {
6093
6094 if (!action)
6095 {
6096 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6097 return;
6098 }
6099
6101 if (!ai)
6102 {
6104 return;
6105 }
6106
6108 if (!action_array)
6109 {
6110 action_array = new array<ActionBase_Basic>;
6112 }
6113 if (LogManager.IsActionLogEnable())
6114 {
6115 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6116 }
6117
6118 if (action_array.Find(action) != -1)
6119 {
6120 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6121 }
6122 else
6123 {
6124 action_array.Insert(action);
6125 }
6126 }
6127
6129 {
6131 ActionBase action = player.GetActionManager().GetAction(actionName);
6134
6135 if (action_array)
6136 {
6137 action_array.RemoveItem(action);
6138 }
6139 }
6140
6141
6142
6144 {
6145 ActionOverrideData overrideData = new ActionOverrideData();
6149
6151 if (!actionMap)
6152 {
6155 }
6156
6157 actionMap.Insert(this.
Type(), overrideData);
6158
6159 }
6160
6162
6164
6165
6167 {
6170
6173
6174 string config_to_search = "CfgVehicles";
6175 string muzzle_owner_config;
6176
6178 {
6179 if (IsInherited(Weapon))
6180 config_to_search = "CfgWeapons";
6181
6182 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6183
6184 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6185
6187
6188 if (config_OnFire_subclass_count > 0)
6189 {
6190 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6191
6192 for (int i = 0; i < config_OnFire_subclass_count; i++)
6193 {
6194 string particle_class = "";
6196 string config_OnFire_entry = config_OnFire_class + particle_class;
6197 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6198 WPOF_array.Insert(WPOF);
6199 }
6200
6201
6203 }
6204 }
6205
6207 {
6208 config_to_search = "CfgWeapons";
6209 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6210
6211 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6212
6214
6215 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6216 {
6217 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6218
6219 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6220 {
6221 string particle_class2 = "";
6223 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6224 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6225 WPOBE_array.Insert(WPOBE);
6226 }
6227
6228
6230 }
6231 }
6232 }
6233
6234
6236 {
6239
6241 {
6242 string config_to_search = "CfgVehicles";
6243
6244 if (IsInherited(Weapon))
6245 config_to_search = "CfgWeapons";
6246
6247 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6248 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6249
6250 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6251 {
6252
6254
6256 {
6258 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6260 return;
6261 }
6262
6265
6266
6267
6269 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6270
6271 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6272 {
6273 string particle_class = "";
6275 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6277
6278 if (entry_type == CT_CLASS)
6279 {
6280 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6281 WPOOH_array.Insert(WPOF);
6282 }
6283 }
6284
6285
6287 }
6288 }
6289 }
6290
6292 {
6294 }
6295
6297 {
6299 {
6301
6304
6307
6308 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6309 }
6310 }
6311
6313 {
6315 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6316
6318 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6319
6321 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6322
6324 {
6326 }
6327 }
6328
6330 {
6332 }
6333
6335 {
6338 else
6340
6342 {
6345 }
6346 else
6347 {
6350
6353 }
6354
6356 }
6357
6359 {
6361 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6362 }
6363
6365 {
6367 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6369 }
6370
6372 {
6374 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6375 }
6376
6378 {
6381
6382 OverheatingParticle OP = new OverheatingParticle();
6387
6389 }
6390
6392 {
6395
6396 return -1;
6397 }
6398
6400 {
6402 {
6405
6406 for (int i = count; i > 0; --i)
6407 {
6408 int id = i - 1;
6411
6414
6415 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6416 {
6417 if (p)
6418 {
6421 }
6422 }
6423 }
6424 }
6425 }
6426
6428 {
6430 {
6432 {
6433 int id = i - 1;
6435
6436 if (OP)
6437 {
6439
6440 if (p)
6441 {
6443 }
6444
6445 delete OP;
6446 }
6447 }
6448
6451 }
6452 }
6453
6456 {
6457 return 0.0;
6458 }
6459
6460
6462 {
6463 return 250;
6464 }
6465
6467 {
6468 return 0;
6469 }
6470
6473 {
6475 return true;
6476
6477 return false;
6478 }
6479
6482 {
6485
6487 {
6489 }
6490 else
6491 {
6492
6494 }
6495
6497 }
6498
6505 {
6506 return -1;
6507 }
6508
6509
6510
6511
6513 {
6515 {
6517 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6518
6519 if (r_index >= 0)
6520 {
6521 InventoryLocation r_il = new InventoryLocation;
6522 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6523
6524 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6527 {
6528 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6529 }
6531 {
6532 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6533 }
6534
6535 }
6536
6537 player.GetHumanInventory().ClearUserReservedLocation(this);
6538 }
6539
6542 }
6543
6544
6545
6546
6548 {
6549 return ItemBase.m_DebugActionsMask;
6550 }
6551
6553 {
6554 return ItemBase.m_DebugActionsMask & mask;
6555 }
6556
6558 {
6559 ItemBase.m_DebugActionsMask = mask;
6560 }
6561
6563 {
6564 ItemBase.m_DebugActionsMask |= mask;
6565 }
6566
6568 {
6569 ItemBase.m_DebugActionsMask &= ~mask;
6570 }
6571
6573 {
6575 {
6577 }
6578 else
6579 {
6581 }
6582 }
6583
6584
6586 {
6587 if (GetEconomyProfile())
6588 {
6589 float q_max = GetEconomyProfile().GetQuantityMax();
6590 if (q_max > 0)
6591 {
6592 float q_min = GetEconomyProfile().GetQuantityMin();
6593 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6594
6596 {
6597 ComponentEnergyManager comp = GetCompEM();
6599 {
6601 }
6602 }
6604 {
6606
6607 }
6608
6609 }
6610 }
6611 }
6612
6615 {
6616 EntityAI parent = GetHierarchyParent();
6617
6618 if (parent)
6619 {
6620 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6621 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6622 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6623 }
6624 }
6625
6628 {
6629 EntityAI parent = GetHierarchyParent();
6630
6631 if (parent)
6632 {
6633 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6634 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6635 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6636 }
6637 }
6638
6640 {
6641
6642
6643
6644
6646
6648 {
6649 if (ScriptInputUserData.CanStoreInputUserData())
6650 {
6651 ScriptInputUserData ctx = new ScriptInputUserData;
6657 ctx.
Write(use_stack_max);
6660
6662 {
6663 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6664 }
6665 }
6666 }
6667 else if (!
GetGame().IsMultiplayer())
6668 {
6670 }
6671 }
6672
6674 {
6676 }
6677
6679 {
6681 }
6682
6684 {
6686 }
6687
6689 {
6690
6691 return false;
6692 }
6693
6695 {
6696 return false;
6697 }
6698
6702 {
6703 return false;
6704 }
6705
6707 {
6708 return "";
6709 }
6710
6712
6714 {
6715 return false;
6716 }
6717
6719 {
6720 return true;
6721 }
6722
6723
6724
6726 {
6727 return true;
6728 }
6729
6731 {
6732 return true;
6733 }
6734
6736 {
6737 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6739 }
6740
6742 {
6744 }
6745
6747 {
6749 if (!is_being_placed)
6751 SetSynchDirty();
6752 }
6753
6754
6756
6758 {
6760 }
6761
6763 {
6765 }
6766
6768 {
6769 return 1;
6770 }
6771
6773 {
6774 return false;
6775 }
6776
6778 {
6780 SetSynchDirty();
6781 }
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6818 {
6819 super.OnMovedInsideCargo(container);
6820
6821 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6822 }
6823
6824 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6825 {
6826 super.EEItemLocationChanged(oldLoc,newLoc);
6827
6828 PlayerBase new_player = null;
6829 PlayerBase old_player = null;
6830
6831 if (newLoc.GetParent())
6832 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6833
6834 if (oldLoc.GetParent())
6835 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6836
6838 {
6839 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6840
6841 if (r_index >= 0)
6842 {
6843 InventoryLocation r_il = new InventoryLocation;
6844 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6845
6846 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6849 {
6850 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6851 }
6853 {
6854 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6855 }
6856
6857 }
6858 }
6859
6861 {
6862 if (new_player)
6863 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6864
6865 if (new_player == old_player)
6866 {
6867
6868 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6869 {
6871 {
6872 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6873 {
6874 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6875 }
6876 }
6877 else
6878 {
6879 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6880 }
6881 }
6882
6883 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6884 {
6885 int type = oldLoc.GetType();
6887 {
6888 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6889 }
6891 {
6892 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6893 }
6894 }
6895 if (!m_OldLocation)
6896 {
6897 m_OldLocation = new InventoryLocation;
6898 }
6899 m_OldLocation.Copy(oldLoc);
6900 }
6901 else
6902 {
6903 if (m_OldLocation)
6904 {
6905 m_OldLocation.Reset();
6906 }
6907 }
6908
6910 }
6911 else
6912 {
6913 if (new_player)
6914 {
6915 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6916 if (res_index >= 0)
6917 {
6918 InventoryLocation il = new InventoryLocation;
6919 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6921 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6924 {
6925 il.
GetParent().GetOnReleaseLock().Invoke(it);
6926 }
6928 {
6930 }
6931
6932 }
6933 }
6935 {
6936
6938 }
6939
6940 if (m_OldLocation)
6941 {
6942 m_OldLocation.Reset();
6943 }
6944 }
6945 }
6946
6947 override void EOnContact(IEntity other, Contact extra)
6948 {
6950 {
6951 int liquidType = -1;
6953 if (impactSpeed > 0.0)
6954 {
6956 #ifndef SERVER
6958 #else
6960 SetSynchDirty();
6961 #endif
6963 }
6964 }
6965
6966 #ifdef SERVER
6967 if (GetCompEM() && GetCompEM().IsPlugged())
6968 {
6969 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6970 GetCompEM().UnplugThis();
6971 }
6972 #endif
6973 }
6974
6976
6978 {
6980 }
6981
6983 {
6984
6985 }
6986
6988 {
6989 super.OnItemLocationChanged(old_owner, new_owner);
6990
6991 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6992 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6993
6994 if (!relatedPlayer && playerNew)
6995 relatedPlayer = playerNew;
6996
6997 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6998 {
7000 if (actionMgr)
7001 {
7002 ActionBase currentAction = actionMgr.GetRunningAction();
7003 if (currentAction)
7005 }
7006 }
7007
7008 Man ownerPlayerOld = null;
7009 Man ownerPlayerNew = null;
7010
7011 if (old_owner)
7012 {
7013 if (old_owner.
IsMan())
7014 {
7015 ownerPlayerOld = Man.Cast(old_owner);
7016 }
7017 else
7018 {
7019 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7020 }
7021 }
7022 else
7023 {
7025 {
7027
7028 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7029 {
7030 GetCompEM().UnplugThis();
7031 }
7032 }
7033 }
7034
7035 if (new_owner)
7036 {
7037 if (new_owner.
IsMan())
7038 {
7039 ownerPlayerNew = Man.Cast(new_owner);
7040 }
7041 else
7042 {
7043 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7044 }
7045 }
7046
7047 if (ownerPlayerOld != ownerPlayerNew)
7048 {
7049 if (ownerPlayerOld)
7050 {
7051 array<EntityAI> subItemsExit = new array<EntityAI>;
7053 for (int i = 0; i < subItemsExit.Count(); i++)
7054 {
7057 }
7058 }
7059
7060 if (ownerPlayerNew)
7061 {
7062 array<EntityAI> subItemsEnter = new array<EntityAI>;
7064 for (int j = 0; j < subItemsEnter.Count(); j++)
7065 {
7068 }
7069 }
7070 }
7071 else if (ownerPlayerNew != null)
7072 {
7073 PlayerBase nplayer;
7074 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7075 {
7076 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7078 for (int k = 0; k < subItemsUpdate.Count(); k++)
7079 {
7081 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7082 }
7083 }
7084 }
7085
7086 if (old_owner)
7087 old_owner.OnChildItemRemoved(this);
7088 if (new_owner)
7089 new_owner.OnChildItemReceived(this);
7090 }
7091
7092
7094 {
7095 super.EEDelete(parent);
7096 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7097 if (player)
7098 {
7100
7101 if (player.IsAlive())
7102 {
7103 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7104 if (r_index >= 0)
7105 {
7106 InventoryLocation r_il = new InventoryLocation;
7107 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7108
7109 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7112 {
7113 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7114 }
7116 {
7117 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7118 }
7119
7120 }
7121
7122 player.RemoveQuickBarEntityShortcut(this);
7123 }
7124 }
7125 }
7126
7128 {
7129 super.EEKilled(killer);
7130
7133 {
7134 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7135 {
7136 if (IsMagazine())
7137 {
7138 if (Magazine.Cast(this).GetAmmoCount() > 0)
7139 {
7141 }
7142 }
7143 else
7144 {
7146 }
7147 }
7148 }
7149 }
7150
7152 {
7153 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7154
7155 super.OnWasAttached(parent, slot_id);
7156
7159
7161 }
7162
7164 {
7165 super.OnWasDetached(parent, slot_id);
7166
7169 }
7170
7172 {
7173 int idx;
7176
7177 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7178 if (inventory_slots.Count() < 1)
7179 {
7180 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7181 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7182 }
7183 else
7184 {
7185 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7186 }
7187
7188 idx = inventory_slots.Find(slot);
7189 if (idx < 0)
7190 return "";
7191
7192 return attach_types.Get(idx);
7193 }
7194
7196 {
7197 int idx = -1;
7198 string slot;
7199
7202
7203 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7204 if (inventory_slots.Count() < 1)
7205 {
7206 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7207 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7208 }
7209 else
7210 {
7211 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7212 if (detach_types.Count() < 1)
7213 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7214 }
7215
7216 for (int i = 0; i < inventory_slots.Count(); i++)
7217 {
7218 slot = inventory_slots.Get(i);
7219 }
7220
7221 if (slot != "")
7222 {
7223 if (detach_types.Count() == 1)
7224 idx = 0;
7225 else
7226 idx = inventory_slots.Find(slot);
7227 }
7228 if (idx < 0)
7229 return "";
7230
7231 return detach_types.Get(idx);
7232 }
7233
7235 {
7236
7238
7239
7240 float min_time = 1;
7241 float max_time = 3;
7242 float delay = Math.RandomFloat(min_time, max_time);
7243
7244 explode_timer.Run(delay, this, "DoAmmoExplosion");
7245 }
7246
7248 {
7249 Magazine magazine = Magazine.Cast(this);
7250 int pop_sounds_count = 6;
7251 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7252
7253
7254 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7255 string sound_name = pop_sounds[ sound_idx ];
7257
7258
7259 magazine.ServerAddAmmoCount(-1);
7260
7261
7262 float min_temp_to_explode = 100;
7263
7264 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7265 {
7267 }
7268 }
7269
7270
7271 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7272 {
7273 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7274
7275 const int CHANCE_DAMAGE_CARGO = 4;
7276 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7277 const int CHANCE_DAMAGE_NOTHING = 2;
7278
7280 {
7281 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7282 int chances;
7283 int rnd;
7284
7285 if (GetInventory().GetCargo())
7286 {
7287 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7288 rnd = Math.RandomInt(0,chances);
7289
7290 if (rnd < CHANCE_DAMAGE_CARGO)
7291 {
7293 }
7294 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7295 {
7297 }
7298 }
7299 else
7300 {
7301 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7302 rnd = Math.RandomInt(0,chances);
7303
7304 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7305 {
7307 }
7308 }
7309 }
7310 }
7311
7313 {
7314 if (GetInventory().GetCargo())
7315 {
7316 int item_count = GetInventory().GetCargo().GetItemCount();
7317 if (item_count > 0)
7318 {
7319 int random_pick = Math.RandomInt(0, item_count);
7321 if (!item.IsExplosive())
7322 {
7323 item.AddHealth("","",damage);
7324 return true;
7325 }
7326 }
7327 }
7328 return false;
7329 }
7330
7332 {
7333 int attachment_count = GetInventory().AttachmentCount();
7334 if (attachment_count > 0)
7335 {
7336 int random_pick = Math.RandomInt(0, attachment_count);
7337 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7338 if (!attachment.IsExplosive())
7339 {
7340 attachment.AddHealth("","",damage);
7341 return true;
7342 }
7343 }
7344 return false;
7345 }
7346
7348 {
7350 }
7351
7353 {
7355 return GetInventory().CanRemoveEntity();
7356
7357 return false;
7358 }
7359
7361 {
7363 return;
7364
7366 {
7367 if (ScriptInputUserData.CanStoreInputUserData())
7368 {
7369 ScriptInputUserData ctx = new ScriptInputUserData;
7374 ctx.
Write(destination_entity);
7378 }
7379 }
7380 else if (!
GetGame().IsMultiplayer())
7381 {
7383 }
7384 }
7385
7387 {
7389 return;
7390
7391 float split_quantity_new;
7395 InventoryLocation loc = new InventoryLocation;
7396
7397 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7398 {
7400 split_quantity_new = stack_max;
7401 else
7403
7404 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7405 if (new_item)
7406 {
7407 new_item.SetResultOfSplit(true);
7408 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7410 new_item.SetQuantity(split_quantity_new);
7411 }
7412 }
7413 else if (destination_entity && slot_id == -1)
7414 {
7415 if (quantity > stack_max)
7416 split_quantity_new = stack_max;
7417 else
7418 split_quantity_new = quantity;
7419
7421 {
7424 }
7425
7426 if (new_item)
7427 {
7428 new_item.SetResultOfSplit(true);
7429 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7431 new_item.SetQuantity(split_quantity_new);
7432 }
7433 }
7434 else
7435 {
7436 if (stack_max != 0)
7437 {
7439 {
7441 }
7442
7443 if (split_quantity_new == 0)
7444 {
7445 if (!
GetGame().IsMultiplayer())
7446 player.PhysicalPredictiveDropItem(this);
7447 else
7448 player.ServerDropEntity(this);
7449 return;
7450 }
7451
7453
7454 if (new_item)
7455 {
7456 new_item.SetResultOfSplit(true);
7457 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7459 new_item.SetQuantity(stack_max);
7460 new_item.PlaceOnSurface();
7461 }
7462 }
7463 }
7464 }
7465
7467 {
7469 return;
7470
7471 float split_quantity_new;
7475 InventoryLocation loc = new InventoryLocation;
7476
7477 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7478 {
7480 split_quantity_new = stack_max;
7481 else
7483
7484 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7485 if (new_item)
7486 {
7487 new_item.SetResultOfSplit(true);
7488 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7490 new_item.SetQuantity(split_quantity_new);
7491 }
7492 }
7493 else if (destination_entity && slot_id == -1)
7494 {
7495 if (quantity > stack_max)
7496 split_quantity_new = stack_max;
7497 else
7498 split_quantity_new = quantity;
7499
7501 {
7504 }
7505
7506 if (new_item)
7507 {
7508 new_item.SetResultOfSplit(true);
7509 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7511 new_item.SetQuantity(split_quantity_new);
7512 }
7513 }
7514 else
7515 {
7516 if (stack_max != 0)
7517 {
7519 {
7521 }
7522
7524
7525 if (new_item)
7526 {
7527 new_item.SetResultOfSplit(true);
7528 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7530 new_item.SetQuantity(stack_max);
7531 new_item.PlaceOnSurface();
7532 }
7533 }
7534 }
7535 }
7536
7538 {
7540 return;
7541
7543 {
7544 if (ScriptInputUserData.CanStoreInputUserData())
7545 {
7546 ScriptInputUserData ctx = new ScriptInputUserData;
7551 dst.WriteToContext(ctx);
7553 }
7554 }
7555 else if (!
GetGame().IsMultiplayer())
7556 {
7558 }
7559 }
7560
7562 {
7564 return;
7565
7567 {
7568 if (ScriptInputUserData.CanStoreInputUserData())
7569 {
7570 ScriptInputUserData ctx = new ScriptInputUserData;
7575 ctx.
Write(destination_entity);
7581 }
7582 }
7583 else if (!
GetGame().IsMultiplayer())
7584 {
7586 }
7587 }
7588
7590 {
7592 }
7593
7595 {
7597 return this;
7598
7600 float split_quantity_new;
7602 if (dst.IsValid())
7603 {
7604 int slot_id = dst.GetSlot();
7606
7607 if (quantity > stack_max)
7608 split_quantity_new = stack_max;
7609 else
7610 split_quantity_new = quantity;
7611
7613
7614 if (new_item)
7615 {
7616 new_item.SetResultOfSplit(true);
7617 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7620 }
7621
7622 return new_item;
7623 }
7624
7625 return null;
7626 }
7627
7629 {
7631 return;
7632
7634 float split_quantity_new;
7636 if (destination_entity)
7637 {
7639 if (quantity > stackable)
7640 split_quantity_new = stackable;
7641 else
7642 split_quantity_new = quantity;
7643
7644 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7645 if (new_item)
7646 {
7647 new_item.SetResultOfSplit(true);
7648 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7650 new_item.SetQuantity(split_quantity_new);
7651 }
7652 }
7653 }
7654
7656 {
7658 return;
7659
7661 {
7662 if (ScriptInputUserData.CanStoreInputUserData())
7663 {
7664 ScriptInputUserData ctx = new ScriptInputUserData;
7669 ItemBase destination_entity =
this;
7670 ctx.
Write(destination_entity);
7674 }
7675 }
7676 else if (!
GetGame().IsMultiplayer())
7677 {
7679 }
7680 }
7681
7683 {
7685 return;
7686
7688 float split_quantity_new;
7690 if (player)
7691 {
7693 if (quantity > stackable)
7694 split_quantity_new = stackable;
7695 else
7696 split_quantity_new = quantity;
7697
7698 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7699 new_item =
ItemBase.Cast(in_hands);
7700 if (new_item)
7701 {
7702 new_item.SetResultOfSplit(true);
7703 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7705 new_item.SetQuantity(split_quantity_new);
7706 }
7707 }
7708 }
7709
7711 {
7713 return;
7714
7716 float split_quantity_new = Math.Floor(quantity * 0.5);
7717
7719
7720 if (new_item)
7721 {
7722 if (new_item.GetQuantityMax() < split_quantity_new)
7723 {
7724 split_quantity_new = new_item.GetQuantityMax();
7725 }
7726
7727 new_item.SetResultOfSplit(true);
7728 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7729
7731 {
7734 }
7735 else
7736 {
7739 }
7740 }
7741 }
7742
7744 {
7746 return;
7747
7749 float split_quantity_new = Math.Floor(quantity / 2);
7750
7751 InventoryLocation invloc = new InventoryLocation;
7753
7755 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7756
7757 if (new_item)
7758 {
7759 if (new_item.GetQuantityMax() < split_quantity_new)
7760 {
7761 split_quantity_new = new_item.GetQuantityMax();
7762 }
7764 {
7767 }
7768 else
7769 {
7772 }
7773 }
7774 }
7775
7778 {
7779 SetWeightDirty();
7781
7782 if (parent)
7783 parent.OnAttachmentQuantityChangedEx(this, delta);
7784
7786 {
7788 {
7790 }
7792 {
7793 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7795 }
7796 }
7797
7798 }
7799
7802 {
7803
7804 }
7805
7808 {
7810 }
7811
7813 {
7814 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7815
7817 {
7818 if (newLevel == GameConstants.STATE_RUINED)
7819 {
7821 EntityAI parent = GetHierarchyParent();
7822 if (parent && parent.IsFireplace())
7823 {
7824 CargoBase cargo = GetInventory().GetCargo();
7825 if (cargo)
7826 {
7828 {
7830 }
7831 }
7832 }
7833 }
7834
7836 {
7837
7839 return;
7840 }
7841
7842 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7843 {
7845 }
7846 }
7847 }
7848
7849
7851 {
7852 super.OnRightClick();
7853
7855 {
7857 {
7858 if (ScriptInputUserData.CanStoreInputUserData())
7859 {
7860 vector m4[4];
7862
7863 EntityAI root = GetHierarchyRoot();
7864
7865 InventoryLocation dst = new InventoryLocation;
7867 {
7868 if (root)
7869 {
7870 root.GetTransform(m4);
7872 }
7873 else
7874 GetInventory().GetCurrentInventoryLocation(dst);
7875 }
7876 else
7877 {
7879
7880
7881 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7882 {
7883 if (root)
7884 {
7885 root.GetTransform(m4);
7887 }
7888 else
7889 GetInventory().GetCurrentInventoryLocation(dst);
7890 }
7891 else
7892 {
7893 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7894 }
7895 }
7896
7897 ScriptInputUserData ctx = new ScriptInputUserData;
7905 }
7906 }
7907 else if (!
GetGame().IsMultiplayer())
7908 {
7910 }
7911 }
7912 }
7913
7914 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7915 {
7916
7917 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7918 return false;
7919
7920 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7921 return false;
7922
7923
7925 return false;
7926
7927
7928 Magazine mag = Magazine.Cast(this);
7929 if (mag)
7930 {
7931 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7932 return false;
7933
7934 if (stack_max_limit)
7935 {
7936 Magazine other_mag = Magazine.Cast(other_item);
7937 if (other_item)
7938 {
7939 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7940 return false;
7941 }
7942
7943 }
7944 }
7945 else
7946 {
7947
7949 return false;
7950
7952 return false;
7953 }
7954
7955 PlayerBase player = null;
7956 if (CastTo(player, GetHierarchyRootPlayer()))
7957 {
7958 if (player.GetInventory().HasAttachment(this))
7959 return false;
7960
7961 if (player.IsItemsToDelete())
7962 return false;
7963 }
7964
7965 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7966 return false;
7967
7968 int slotID;
7970 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7971 return false;
7972
7973 return true;
7974 }
7975
7977 {
7979 }
7980
7982 {
7983 return m_IsResultOfSplit;
7984 }
7985
7987 {
7988 m_IsResultOfSplit = value;
7989 }
7990
7992 {
7994 }
7995
7997 {
7998 float other_item_quantity = other_item.GetQuantity();
7999 float this_free_space;
8000
8002
8004
8005 if (other_item_quantity > this_free_space)
8006 {
8007 return this_free_space;
8008 }
8009 else
8010 {
8011 return other_item_quantity;
8012 }
8013 }
8014
8016 {
8018 }
8019
8021 {
8023 return;
8024
8025 if (!IsMagazine() && other_item)
8026 {
8028 if (quantity_used != 0)
8029 {
8030 float hp1 = GetHealth01("","");
8031 float hp2 = other_item.GetHealth01("","");
8032 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8033 hpResult = hpResult / (
GetQuantity() + quantity_used);
8034
8035 hpResult *= GetMaxHealth();
8036 Math.Round(hpResult);
8037 SetHealth("", "Health", hpResult);
8038
8040 other_item.AddQuantity(-quantity_used);
8041 }
8042 }
8044 }
8045
8047 {
8048 #ifdef SERVER
8049 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8050 GetHierarchyParent().IncreaseLifetimeUp();
8051 #endif
8052 };
8053
8055 {
8056 PlayerBase p = PlayerBase.Cast(player);
8057
8058 array<int> recipesIds = p.m_Recipes;
8059 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8060 if (moduleRecipesManager)
8061 {
8062 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8063 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8064 }
8065
8066 for (int i = 0;i < recipesIds.Count(); i++)
8067 {
8068 int key = recipesIds.Get(i);
8069 string recipeName = moduleRecipesManager.GetRecipeName(key);
8071 }
8072 }
8073
8074
8075 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8076 {
8077 super.GetDebugActions(outputList);
8078
8079
8084
8085
8089
8093
8094
8097
8098
8100 {
8103 }
8104
8106
8109
8113 }
8114
8115
8116
8117
8119 {
8120 super.OnAction(action_id, player, ctx);
8121 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8122 {
8123 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8124 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8125 PlayerBase p = PlayerBase.Cast(player);
8126 if (
EActions.RECIPES_RANGE_START < 1000)
8127 {
8128 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8129 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8130 }
8131 }
8132 #ifndef SERVER
8133 else if (action_id ==
EActions.WATCH_PLAYER)
8134 {
8135 PluginDeveloper.SetDeveloperItemClientEx(player);
8136 }
8137 #endif
8139 {
8140 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8141 {
8142 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8143 OnDebugButtonPressServer(id + 1);
8144 }
8145
8146 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8147 {
8148 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8150 }
8151
8152 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8153 {
8154 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8156 }
8157
8158 else if (action_id ==
EActions.ADD_QUANTITY)
8159 {
8160 if (IsMagazine())
8161 {
8162 Magazine mag = Magazine.Cast(this);
8163 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8164 }
8165 else
8166 {
8168 }
8169
8170 if (m_EM)
8171 {
8172 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8173 }
8174
8175 }
8176
8177 else if (action_id ==
EActions.REMOVE_QUANTITY)
8178 {
8179 if (IsMagazine())
8180 {
8181 Magazine mag2 = Magazine.Cast(this);
8182 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8183 }
8184 else
8185 {
8187 }
8188 if (m_EM)
8189 {
8190 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8191 }
8192
8193 }
8194
8195 else if (action_id ==
EActions.SET_QUANTITY_0)
8196 {
8198
8199 if (m_EM)
8200 {
8201 m_EM.SetEnergy(0);
8202 }
8203 }
8204
8205 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8206 {
8208
8209 if (m_EM)
8210 {
8211 m_EM.SetEnergy(m_EM.GetEnergyMax());
8212 }
8213 }
8214
8215 else if (action_id ==
EActions.ADD_HEALTH)
8216 {
8217 AddHealth("","",GetMaxHealth("","Health")/5);
8218 }
8219 else if (action_id ==
EActions.REMOVE_HEALTH)
8220 {
8221 AddHealth("","",-GetMaxHealth("","Health")/5);
8222 }
8223 else if (action_id ==
EActions.DESTROY_HEALTH)
8224 {
8225 SetHealth01("","",0);
8226 }
8227 else if (action_id ==
EActions.WATCH_ITEM)
8228 {
8230 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8231 #ifdef DEVELOPER
8232 SetDebugDeveloper_item(this);
8233 #endif
8234 }
8235
8236 else if (action_id ==
EActions.ADD_TEMPERATURE)
8237 {
8238 AddTemperature(20);
8239
8240 }
8241
8242 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8243 {
8244 AddTemperature(-20);
8245
8246 }
8247
8248 else if (action_id ==
EActions.FLIP_FROZEN)
8249 {
8250 SetFrozen(!GetIsFrozen());
8251
8252 }
8253
8254 else if (action_id ==
EActions.ADD_WETNESS)
8255 {
8257
8258 }
8259
8260 else if (action_id ==
EActions.REMOVE_WETNESS)
8261 {
8263
8264 }
8265
8266 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8267 {
8270
8271
8272 }
8273
8274 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8275 {
8278 }
8279
8280 else if (action_id ==
EActions.MAKE_SPECIAL)
8281 {
8282 auto debugParams = DebugSpawnParams.WithPlayer(player);
8283 OnDebugSpawnEx(debugParams);
8284 }
8285
8286 else if (action_id ==
EActions.DELETE)
8287 {
8288 Delete();
8289 }
8290
8291 }
8292
8293
8294 return false;
8295 }
8296
8297
8298
8299
8303
8306
8307
8308
8310 {
8311 return false;
8312 }
8313
8314
8316 {
8317 return true;
8318 }
8319
8320
8322 {
8323 return true;
8324 }
8325
8326
8327
8329 {
8330 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8332 }
8333
8336 {
8337 return null;
8338 }
8339
8341 {
8342 return false;
8343 }
8344
8346 {
8347 return false;
8348 }
8349
8353
8354
8356 {
8357 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8358 return module_repairing.CanRepair(this, item_repair_kit);
8359 }
8360
8361
8362 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8363 {
8364 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8365 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8366 }
8367
8368
8370 {
8371
8372
8373
8374
8375
8376
8377
8378
8379 return 1;
8380 }
8381
8382
8383
8385 {
8387 }
8388
8389
8390
8392 {
8394 }
8395
8396
8405 {
8406 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8407
8408 if (player)
8409 {
8410 player.MessageStatus(text);
8411 }
8412 }
8413
8414
8423 {
8424 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8425
8426 if (player)
8427 {
8428 player.MessageAction(text);
8429 }
8430 }
8431
8432
8441 {
8442 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8443
8444 if (player)
8445 {
8446 player.MessageFriendly(text);
8447 }
8448 }
8449
8450
8459 {
8460 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8461
8462 if (player)
8463 {
8464 player.MessageImportant(text);
8465 }
8466 }
8467
8469 {
8470 return true;
8471 }
8472
8473
8474 override bool KindOf(
string tag)
8475 {
8476 bool found = false;
8477 string item_name = this.
GetType();
8480
8481 int array_size = item_tag_array.Count();
8482 for (int i = 0; i < array_size; i++)
8483 {
8484 if (item_tag_array.Get(i) == tag)
8485 {
8486 found = true;
8487 break;
8488 }
8489 }
8490 return found;
8491 }
8492
8493
8495 {
8496
8497 super.OnRPC(sender, rpc_type,ctx);
8498
8499
8500 switch (rpc_type)
8501 {
8502 #ifndef SERVER
8503 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8504 Param2<bool, string> p = new Param2<bool, string>(false, "");
8505
8507 return;
8508
8509 bool play = p.param1;
8510 string soundSet = p.param2;
8511
8512 if (play)
8513 {
8515 {
8517 {
8519 }
8520 }
8521 else
8522 {
8524 }
8525 }
8526 else
8527 {
8529 }
8530
8531 break;
8532 #endif
8533
8534 }
8535
8537 {
8539 }
8540 }
8541
8542
8543
8544
8546 {
8547 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8548 return plugin.GetID(
name);
8549 }
8550
8552 {
8553 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8554 return plugin.GetName(id);
8555 }
8556
8559 {
8560
8561
8562 int varFlags;
8563 if (!ctx.
Read(varFlags))
8564 return;
8565
8566 if (varFlags & ItemVariableFlags.FLOAT)
8567 {
8569 }
8570 }
8571
8573 {
8574
8575 super.SerializeNumericalVars(floats_out);
8576
8577
8578
8580 {
8582 }
8583
8585 {
8587 }
8588
8590 {
8592 }
8593
8595 {
8600 }
8601
8603 {
8605 }
8606 }
8607
8609 {
8610
8611 super.DeSerializeNumericalVars(floats);
8612
8613
8614 int index = 0;
8615 int mask = Math.Round(floats.Get(index));
8616
8617 index++;
8618
8620 {
8622 {
8624 }
8625 else
8626 {
8627 float quantity = floats.Get(index);
8629 }
8630 index++;
8631 }
8632
8634 {
8635 float wet = floats.Get(index);
8637 index++;
8638 }
8639
8641 {
8642 int liquidtype = Math.Round(floats.Get(index));
8644 index++;
8645 }
8646
8648 {
8650 index++;
8652 index++;
8654 index++;
8656 index++;
8657 }
8658
8660 {
8661 int cleanness = Math.Round(floats.Get(index));
8663 index++;
8664 }
8665 }
8666
8668 {
8669 super.WriteVarsToCTX(ctx);
8670
8671
8673 {
8675 }
8676
8678 {
8680 }
8681
8683 {
8685 }
8686
8688 {
8689 int r,g,b,a;
8695 }
8696
8698 {
8700 }
8701 }
8702
8704 {
8705 if (!super.ReadVarsFromCTX(ctx,version))
8706 return false;
8707
8708 int intValue;
8709 float value;
8710
8711 if (version < 140)
8712 {
8713 if (!ctx.
Read(intValue))
8714 return false;
8715
8716 m_VariablesMask = intValue;
8717 }
8718
8720 {
8721 if (!ctx.
Read(value))
8722 return false;
8723
8725 {
8727 }
8728 else
8729 {
8731 }
8732 }
8733
8734 if (version < 140)
8735 {
8737 {
8738 if (!ctx.
Read(value))
8739 return false;
8740 SetTemperatureDirect(value);
8741 }
8742 }
8743
8745 {
8746 if (!ctx.
Read(value))
8747 return false;
8749 }
8750
8752 {
8753 if (!ctx.
Read(intValue))
8754 return false;
8756 }
8757
8759 {
8760 int r,g,b,a;
8762 return false;
8764 return false;
8766 return false;
8768 return false;
8769
8771 }
8772
8774 {
8775 if (!ctx.
Read(intValue))
8776 return false;
8778 }
8779
8780 if (version >= 138 && version < 140)
8781 {
8783 {
8784 if (!ctx.
Read(intValue))
8785 return false;
8786 SetFrozen(intValue);
8787 }
8788 }
8789
8790 return true;
8791 }
8792
8793
8795 {
8798 {
8800 }
8801
8802 if (!super.OnStoreLoad(ctx, version))
8803 {
8805 return false;
8806 }
8807
8808 if (version >= 114)
8809 {
8810 bool hasQuickBarIndexSaved;
8811
8812 if (!ctx.
Read(hasQuickBarIndexSaved))
8813 {
8815 return false;
8816 }
8817
8818 if (hasQuickBarIndexSaved)
8819 {
8820 int itmQBIndex;
8821
8822
8823 if (!ctx.
Read(itmQBIndex))
8824 {
8826 return false;
8827 }
8828
8829 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8830 if (itmQBIndex != -1 && parentPlayer)
8831 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8832 }
8833 }
8834 else
8835 {
8836
8837 PlayerBase player;
8838 int itemQBIndex;
8839 if (version ==
int.
MAX)
8840 {
8841 if (!ctx.
Read(itemQBIndex))
8842 {
8844 return false;
8845 }
8846 }
8847 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8848 {
8849
8850 if (!ctx.
Read(itemQBIndex))
8851 {
8853 return false;
8854 }
8855 if (itemQBIndex != -1 && player)
8856 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8857 }
8858 }
8859
8860 if (version < 140)
8861 {
8862
8863 if (!LoadVariables(ctx, version))
8864 {
8866 return false;
8867 }
8868 }
8869
8870
8872 {
8874 return false;
8875 }
8876 if (version >= 132)
8877 {
8879 if (raib)
8880 {
8882 {
8884 return false;
8885 }
8886 }
8887 }
8888
8890 return true;
8891 }
8892
8893
8894
8896 {
8897 super.OnStoreSave(ctx);
8898
8899 PlayerBase player;
8900 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8901 {
8903
8904 int itemQBIndex = -1;
8905 itemQBIndex = player.FindQuickBarEntityIndex(this);
8906 ctx.
Write(itemQBIndex);
8907 }
8908 else
8909 {
8911 }
8912
8914
8916 if (raib)
8917 {
8919 }
8920 }
8921
8922
8924 {
8925 super.AfterStoreLoad();
8926
8928 {
8930 }
8931
8933 {
8936 }
8937 }
8938
8940 {
8941 super.EEOnAfterLoad();
8942
8944 {
8946 }
8947
8950 }
8951
8953 {
8954 return false;
8955 }
8956
8957
8958
8960 {
8962 {
8963 #ifdef PLATFORM_CONSOLE
8964
8966 {
8968 if (menu)
8969 {
8971 }
8972 }
8973 #endif
8974 }
8975
8977 {
8980 }
8981
8983 {
8984 SetWeightDirty();
8986 }
8988 {
8991 }
8992
8994 {
8997 }
8999 {
9002 }
9003
9004 super.OnVariablesSynchronized();
9005 }
9006
9007
9008
9010 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9011 {
9012 if (!IsServerCheck(allow_client))
9013 return false;
9014
9016 return false;
9017
9020
9021 if (value <= (min + 0.001))
9022 value = min;
9023
9024 if (value == min)
9025 {
9026 if (destroy_config)
9027 {
9028 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9029 if (dstr)
9030 {
9032 this.Delete();
9033 return true;
9034 }
9035 }
9036 else if (destroy_forced)
9037 {
9039 this.Delete();
9040 return true;
9041 }
9042
9044 }
9045
9048
9050 {
9052
9053 if (delta)
9055 }
9056
9058
9059 return false;
9060 }
9061
9062
9064 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9065 {
9067 }
9068
9070 {
9073 }
9074
9076 {
9079 }
9080
9083 {
9084 float value_clamped = Math.Clamp(value, 0, 1);
9086 SetQuantity(result, destroy_config, destroy_forced);
9087 }
9088
9089
9092 {
9094 }
9095
9097 {
9099 }
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9111 {
9112 int slot = -1;
9113 if (GetInventory())
9114 {
9115 InventoryLocation il = new InventoryLocation;
9116 GetInventory().GetCurrentInventoryLocation(il);
9118 }
9119
9121 }
9122
9124 {
9125 float quantity_max = 0;
9126
9128 {
9129 if (attSlotID != -1)
9130 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9131
9132 if (quantity_max <= 0)
9134 }
9135
9136 if (quantity_max <= 0)
9138
9139 return quantity_max;
9140 }
9141
9143 {
9145 }
9146
9148 {
9150 }
9151
9152
9154 {
9156 }
9157
9159 {
9161 }
9162
9164 {
9166 }
9167
9168
9170 {
9171
9172 float weightEx = GetWeightEx();
9173 float special = GetInventoryAndCargoWeight();
9174 return weightEx - special;
9175 }
9176
9177
9179 {
9181 }
9182
9184 {
9186 {
9187 #ifdef DEVELOPER
9188 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9189 {
9190 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9192 }
9193 #endif
9194
9196 }
9197 else if (HasEnergyManager())
9198 {
9199 #ifdef DEVELOPER
9200 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9201 {
9202 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9203 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9204 }
9205 #endif
9206 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9207 }
9208 else
9209 {
9210 #ifdef DEVELOPER
9211 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9212 {
9213 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9214 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9215 }
9216 #endif
9217 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9218 }
9219 }
9220
9223 {
9224 int item_count = 0;
9226
9227 if (GetInventory().GetCargo() != NULL)
9228 {
9229 item_count = GetInventory().GetCargo().GetItemCount();
9230 }
9231
9232 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9233 {
9234 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9235 if (item)
9236 item_count += item.GetNumberOfItems();
9237 }
9238 return item_count;
9239 }
9240
9243 {
9244 float weight = 0;
9245 float wetness = 1;
9246 if (include_wetness)
9249 {
9250 weight = wetness * m_ConfigWeight;
9251 }
9253 {
9254 weight = 1;
9255 }
9256 return weight;
9257 }
9258
9259
9260
9262 {
9263 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9264 {
9265 GameInventory inv = GetInventory();
9266 array<EntityAI> items = new array<EntityAI>;
9268 for (int i = 0; i < items.Count(); i++)
9269 {
9271 if (item)
9272 {
9274 }
9275 }
9276 }
9277 }
9278
9279
9280
9281
9283 {
9284 float energy = 0;
9285 if (HasEnergyManager())
9286 {
9287 energy = GetCompEM().GetEnergy();
9288 }
9289 return energy;
9290 }
9291
9292
9294 {
9295 super.OnEnergyConsumed();
9296
9298 }
9299
9301 {
9302 super.OnEnergyAdded();
9303
9305 }
9306
9307
9309 {
9310 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9311 {
9313 {
9314 float energy_0to1 = GetCompEM().GetEnergy0To1();
9316 }
9317 }
9318 }
9319
9320
9322 {
9323 return ConfigGetFloat("heatIsolation");
9324 }
9325
9327 {
9329 }
9330
9332 {
9333 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9334 if (
GetGame().ConfigIsExisting(paramPath))
9336
9337 return 0.0;
9338 }
9339
9341 {
9342 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9343 if (
GetGame().ConfigIsExisting(paramPath))
9345
9346 return 0.0;
9347 }
9348
9349 override void SetWet(
float value,
bool allow_client =
false)
9350 {
9351 if (!IsServerCheck(allow_client))
9352 return;
9353
9356
9358
9359 m_VarWet = Math.Clamp(value, min, max);
9360
9362 {
9365 }
9366 }
9367
9368 override void AddWet(
float value)
9369 {
9371 }
9372
9374 {
9376 }
9377
9379 {
9381 }
9382
9384 {
9386 }
9387
9389 {
9391 }
9392
9394 {
9396 }
9397
9399 {
9402 if (newLevel != oldLevel)
9403 {
9405 }
9406 }
9407
9409 {
9410 SetWeightDirty();
9411 }
9412
9414 {
9415 return GetWetLevelInternal(
m_VarWet);
9416 }
9417
9418
9419
9421 {
9423 }
9424
9426 {
9428 }
9429
9431 {
9433 }
9434
9436 {
9438 }
9439
9440
9441
9443 {
9444 if (ConfigIsExisting("itemModelLength"))
9445 {
9446 return ConfigGetFloat("itemModelLength");
9447 }
9448 return 0;
9449 }
9450
9452 {
9453 if (ConfigIsExisting("itemAttachOffset"))
9454 {
9455 return ConfigGetFloat("itemAttachOffset");
9456 }
9457 return 0;
9458 }
9459
9460 override void SetCleanness(
int value,
bool allow_client =
false)
9461 {
9462 if (!IsServerCheck(allow_client))
9463 return;
9464
9466
9468
9471 }
9472
9474 {
9476 }
9477
9479 {
9480 return true;
9481 }
9482
9483
9484
9485
9487 {
9489 }
9490
9492 {
9494 }
9495
9496
9497
9498
9499 override void SetColor(
int r,
int g,
int b,
int a)
9500 {
9506 }
9508 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9509 {
9514 }
9515
9517 {
9519 }
9520
9523 {
9524 int r,g,b,a;
9526 r = r/255;
9527 g = g/255;
9528 b = b/255;
9529 a = a/255;
9530 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9531 }
9532
9533
9534
9535 override void SetLiquidType(
int value,
bool allow_client =
false)
9536 {
9537 if (!IsServerCheck(allow_client))
9538 return;
9539
9544 }
9545
9547 {
9548 return ConfigGetInt("varLiquidTypeInit");
9549 }
9550
9552 {
9554 }
9555
9557 {
9559 SetFrozen(false);
9560 }
9561
9564 {
9565 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9566 }
9567
9568
9571 {
9572 PlayerBase nplayer;
9573 if (PlayerBase.CastTo(nplayer, player))
9574 {
9576
9577 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9578 }
9579 }
9580
9581
9584 {
9585 PlayerBase nplayer;
9586 if (PlayerBase.CastTo(nplayer,player))
9587 {
9588
9589 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9590
9591 }
9592
9593
9594 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9595
9596
9597 if (HasEnergyManager())
9598 {
9599 GetCompEM().UpdatePlugState();
9600 }
9601 }
9602
9603
9605 {
9606 super.OnPlacementStarted(player);
9607
9609 }
9610
9611 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9612 {
9614 {
9615 m_AdminLog.OnPlacementComplete(player,
this);
9616 }
9617
9618 super.OnPlacementComplete(player, position, orientation);
9619 }
9620
9621
9622
9623
9624
9626 {
9628 {
9629 return true;
9630 }
9631 else
9632 {
9633 return false;
9634 }
9635 }
9636
9637
9639 {
9641 {
9643 }
9644 }
9645
9646
9648 {
9650 }
9651
9653 {
9655 }
9656
9657 override void InsertAgent(
int agent,
float count = 1)
9658 {
9659 if (count < 1)
9660 return;
9661
9663 }
9664
9667 {
9669 }
9670
9671
9673 {
9675 }
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9719 {
9721 return false;
9722 return true;
9723 }
9724
9726 {
9727
9729 }
9730
9731
9734 {
9735 super.CheckForRoofLimited(timeTresholdMS);
9736
9738 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9739 {
9740 m_PreviousRoofTestTime = time;
9741 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9742 }
9743 }
9744
9745
9747 {
9749 {
9750 return 0;
9751 }
9752
9753 if (GetInventory().GetAttachmentSlotsCount() != 0)
9754 {
9755 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9756 if (filter)
9757 return filter.GetProtectionLevel(type, false, system);
9758 else
9759 return 0;
9760 }
9761
9762 string subclassPath, entryName;
9763
9764 switch (type)
9765 {
9767 entryName = "biological";
9768 break;
9770 entryName = "chemical";
9771 break;
9772 default:
9773 entryName = "biological";
9774 break;
9775 }
9776
9777 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9778
9780 }
9781
9782
9783
9786 {
9787 if (!IsMagazine())
9789
9791 }
9792
9793
9794
9795
9796
9801 {
9802 return true;
9803 }
9804
9806 {
9808 }
9809
9810
9811
9812
9813
9815 {
9816 if (parent)
9817 {
9818 if (parent.IsInherited(DayZInfected))
9819 return true;
9820
9821 if (!parent.IsRuined())
9822 return true;
9823 }
9824
9825 return true;
9826 }
9827
9829 {
9830 if (!super.CanPutAsAttachment(parent))
9831 {
9832 return false;
9833 }
9834
9835 if (!IsRuined() && !parent.IsRuined())
9836 {
9837 return true;
9838 }
9839
9840 return false;
9841 }
9842
9844 {
9845
9846
9847
9848
9849 return super.CanReceiveItemIntoCargo(item);
9850 }
9851
9853 {
9854
9855
9856
9857
9858 GameInventory attachmentInv = attachment.GetInventory();
9860 {
9861 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9862 return false;
9863 }
9864
9865 InventoryLocation loc = new InventoryLocation();
9866 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9867 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9868 return false;
9869
9870 return super.CanReceiveAttachment(attachment, slotId);
9871 }
9872
9874 {
9875 if (!super.CanReleaseAttachment(attachment))
9876 return false;
9877
9878 return GetInventory().AreChildrenAccessible();
9879 }
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9902 {
9903 int id = muzzle_owner.GetMuzzleID();
9904 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9905
9906 if (WPOF_array)
9907 {
9908 for (int i = 0; i < WPOF_array.Count(); i++)
9909 {
9910 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9911
9912 if (WPOF)
9913 {
9914 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9915 }
9916 }
9917 }
9918 }
9919
9920
9922 {
9923 int id = muzzle_owner.GetMuzzleID();
9925
9926 if (WPOBE_array)
9927 {
9928 for (int i = 0; i < WPOBE_array.Count(); i++)
9929 {
9930 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9931
9932 if (WPOBE)
9933 {
9934 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9935 }
9936 }
9937 }
9938 }
9939
9940
9942 {
9943 int id = muzzle_owner.GetMuzzleID();
9944 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9945
9946 if (WPOOH_array)
9947 {
9948 for (int i = 0; i < WPOOH_array.Count(); i++)
9949 {
9950 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9951
9952 if (WPOOH)
9953 {
9954 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9955 }
9956 }
9957 }
9958 }
9959
9960
9962 {
9963 int id = muzzle_owner.GetMuzzleID();
9964 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9965
9966 if (WPOOH_array)
9967 {
9968 for (int i = 0; i < WPOOH_array.Count(); i++)
9969 {
9970 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9971
9972 if (WPOOH)
9973 {
9974 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9975 }
9976 }
9977 }
9978 }
9979
9980
9982 {
9983 int id = muzzle_owner.GetMuzzleID();
9984 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9985
9986 if (WPOOH_array)
9987 {
9988 for (int i = 0; i < WPOOH_array.Count(); i++)
9989 {
9990 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9991
9992 if (WPOOH)
9993 {
9994 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9995 }
9996 }
9997 }
9998 }
9999
10000
10001
10003 {
10005 {
10006 return true;
10007 }
10008
10009 return false;
10010 }
10011
10013 {
10015 {
10016 return true;
10017 }
10018
10019 return false;
10020 }
10021
10023 {
10025 {
10026 return true;
10027 }
10028
10029 return false;
10030 }
10031
10033 {
10034 return false;
10035 }
10036
10039 {
10040 return UATimeSpent.DEFAULT_DEPLOY;
10041 }
10042
10043
10044
10045
10047 {
10049 SetSynchDirty();
10050 }
10051
10053 {
10055 }
10056
10057
10059 {
10060 return false;
10061 }
10062
10065 {
10066 string att_type = "None";
10067
10068 if (ConfigIsExisting("soundAttType"))
10069 {
10070 att_type = ConfigGetString("soundAttType");
10071 }
10072
10074 }
10075
10077 {
10079 }
10080
10081
10082
10083
10084
10088
10090 {
10093
10095 }
10096
10097
10099 {
10101 return;
10102
10104
10107
10110
10111 SoundParameters params = new SoundParameters();
10115 }
10116
10117
10119 {
10121 return;
10122
10124 SetSynchDirty();
10125
10128 }
10129
10130
10132 {
10134 return;
10135
10137 SetSynchDirty();
10138
10141 }
10142
10144 {
10146 }
10147
10149 {
10151 }
10152
10155 {
10156 if (!
GetGame().IsDedicatedServer())
10157 {
10158 if (ConfigIsExisting("attachSoundSet"))
10159 {
10160 string cfg_path = "";
10161 string soundset = "";
10162 string type_name =
GetType();
10163
10166 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10167 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10168
10169 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10170 {
10171 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10172 {
10173 if (cfg_slot_array[i] == slot_type)
10174 {
10175 soundset = cfg_soundset_array[i];
10176 break;
10177 }
10178 }
10179 }
10180
10181 if (soundset != "")
10182 {
10183 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10185 }
10186 }
10187 }
10188 }
10189
10191 {
10192
10193 }
10194
10195 void OnApply(PlayerBase player);
10196
10198 {
10199 return 1.0;
10200 };
10201
10203 {
10205 }
10206
10208 {
10210 }
10211
10213
10215 {
10216 SetDynamicPhysicsLifeTime(0.01);
10218 }
10219
10221 {
10222 array<string> zone_names = new array<string>;
10223 GetDamageZones(zone_names);
10224 for (int i = 0; i < zone_names.Count(); i++)
10225 {
10226 SetHealthMax(zone_names.Get(i),"Health");
10227 }
10228 SetHealthMax("","Health");
10229 }
10230
10233 {
10234 float global_health = GetHealth01("","Health");
10235 array<string> zones = new array<string>;
10236 GetDamageZones(zones);
10237
10238 for (int i = 0; i < zones.Count(); i++)
10239 {
10240 SetHealth01(zones.Get(i),"Health",global_health);
10241 }
10242 }
10243
10246 {
10247 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10248 }
10249
10251 {
10252 if (!hasRootAsPlayer)
10253 {
10254 if (refParentIB)
10255 {
10256
10257 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10258 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10259
10260 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10261 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10262
10265 }
10266 else
10267 {
10268
10271 }
10272 }
10273 }
10274
10276 {
10278 {
10279 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10280 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10281 {
10282 float heatPermCoef = 1.0;
10284 while (ent)
10285 {
10286 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10287 ent = ent.GetHierarchyParent();
10288 }
10289
10290 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10291 }
10292 }
10293 }
10294
10296 {
10297
10298 EntityAI parent = GetHierarchyParent();
10299 if (!parent)
10300 {
10301 hasParent = false;
10302 hasRootAsPlayer = false;
10303 }
10304 else
10305 {
10306 hasParent = true;
10307 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10308 refParentIB =
ItemBase.Cast(parent);
10309 }
10310 }
10311
10312 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10313 {
10314
10315 }
10316
10318 {
10319
10320 return false;
10321 }
10322
10324 {
10325
10326
10327 return false;
10328 }
10329
10331 {
10332
10333 return false;
10334 }
10335
10338 {
10339 return !GetIsFrozen() &&
IsOpen();
10340 }
10341
10343 {
10344 bool hasParent = false, hasRootAsPlayer = false;
10346
10347 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10348 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10349
10350 if (wwtu || foodDecay)
10351 {
10355
10356 if (processWetness || processTemperature || processDecay)
10357 {
10359
10360 if (processWetness)
10361 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10362
10363 if (processTemperature)
10365
10366 if (processDecay)
10367 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10368 }
10369 }
10370 }
10371
10374 {
10376 }
10377
10379 {
10382
10383 return super.GetTemperatureFreezeThreshold();
10384 }
10385
10387 {
10390
10391 return super.GetTemperatureThawThreshold();
10392 }
10393
10395 {
10398
10399 return super.GetItemOverheatThreshold();
10400 }
10401
10403 {
10405 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10406
10407 return super.GetTemperatureFreezeTime();
10408 }
10409
10411 {
10413 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10414
10415 return super.GetTemperatureThawTime();
10416 }
10417
10422
10424 {
10425 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10426 }
10427
10429 {
10430 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10431 }
10432
10435 {
10437 }
10438
10440 {
10442 }
10443
10445 {
10447 }
10448
10451 {
10452 return null;
10453 }
10454
10457 {
10458 return false;
10459 }
10460
10462 {
10464 {
10467 if (!trg)
10468 {
10470 explosive = this;
10471 }
10472
10473 explosive.PairRemote(trg);
10475
10476 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10477 trg.SetPersistentPairID(persistentID);
10478 explosive.SetPersistentPairID(persistentID);
10479
10480 return true;
10481 }
10482 return false;
10483 }
10484
10487 {
10488 float ret = 1.0;
10491 ret *= GetHealth01();
10492
10493 return ret;
10494 }
10495
10496 #ifdef DEVELOPER
10497 override void SetDebugItem()
10498 {
10499 super.SetDebugItem();
10500 _itemBase = this;
10501 }
10502
10504 {
10505 string text = super.GetDebugText();
10506
10508 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10509
10510 return text;
10511 }
10512 #endif
10513
10515 {
10516 return true;
10517 }
10518
10520
10522
10524 {
10527 }
10528
10529
10537
10553}
10554
10556{
10558 if (entity)
10559 {
10560 bool is_item = entity.IsInherited(
ItemBase);
10561 if (is_item && full_quantity)
10562 {
10565 }
10566 }
10567 else
10568 {
10570 return NULL;
10571 }
10572 return entity;
10573}
10574
10576{
10577 if (item)
10578 {
10579 if (health > 0)
10580 item.SetHealth("", "", health);
10581
10582 if (item.CanHaveTemperature())
10583 {
10585 if (item.CanFreeze())
10586 item.SetFrozen(false);
10587 }
10588
10589 if (item.HasEnergyManager())
10590 {
10591 if (quantity >= 0)
10592 {
10593 item.GetCompEM().SetEnergy0To1(quantity);
10594 }
10595 else
10596 {
10598 }
10599 }
10600 else if (item.IsMagazine())
10601 {
10602 Magazine mag = Magazine.Cast(item);
10603 if (quantity >= 0)
10604 {
10605 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10606 }
10607 else
10608 {
10610 }
10611
10612 }
10613 else
10614 {
10615 if (quantity >= 0)
10616 {
10617 item.SetQuantityNormalized(quantity, false);
10618 }
10619 else
10620 {
10622 }
10623
10624 }
10625 }
10626}
10627
10628#ifdef DEVELOPER
10630#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.