5745{
5747 {
5748 return true;
5749 }
5750};
5751
5752
5753
5755{
5759
5761
5764
5765
5766
5767
5768
5777
5783
5788
5793
5814 protected bool m_IsResultOfSplit
5815
5817
5822
5823
5824
5826
5830
5831
5832
5834
5837
5838
5839
5845
5846
5854
5857
5858
5860
5861
5863
5864
5869
5870
5875
5876
5878
5879
5881 {
5886
5887 if (!
GetGame().IsDedicatedServer())
5888 {
5890 {
5892
5894 {
5896 }
5897 }
5898
5901 }
5902
5903 m_OldLocation = null;
5904
5906 {
5908 }
5909
5910 if (ConfigIsExisting("headSelectionsToHide"))
5911 {
5914 }
5915
5917 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5918 {
5920 }
5921
5923
5924 m_IsResultOfSplit = false;
5925
5927 }
5928
5930 {
5931 super.InitItemVariables();
5932
5938 m_Count = ConfigGetInt(
"count");
5939
5942
5947
5950
5955
5967
5971
5972
5975 if (ConfigIsExisting("canBeSplit"))
5976 {
5979 }
5980
5982 if (ConfigIsExisting("itemBehaviour"))
5984
5985
5988 RegisterNetSyncVariableInt("m_VarLiquidType");
5989 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5990
5991 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5992 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5993 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5994
5995 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5996 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5997 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5998 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5999
6000 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6001 RegisterNetSyncVariableBool("m_IsTakeable");
6002 RegisterNetSyncVariableBool("m_IsHologram");
6003
6006 {
6009 }
6010
6012
6014 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6016
6017 }
6018
6020 {
6022 }
6023
6025 {
6028 {
6033 }
6034 }
6035
6036 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6037 {
6039 {
6042 }
6043
6045 }
6046
6048 {
6054 }
6055
6057
6059 {
6061
6062 if (!action)
6063 {
6064 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6065 return;
6066 }
6067
6069 if (!ai)
6070 {
6072 return;
6073 }
6074
6076 if (!action_array)
6077 {
6078 action_array = new array<ActionBase_Basic>;
6080 }
6081 if (LogManager.IsActionLogEnable())
6082 {
6083 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6084 }
6085
6086 if (action_array.Find(action) != -1)
6087 {
6088 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6089 }
6090 else
6091 {
6092 action_array.Insert(action);
6093 }
6094 }
6095
6097 {
6099 ActionBase action = player.GetActionManager().GetAction(actionName);
6102
6103 if (action_array)
6104 {
6105 action_array.RemoveItem(action);
6106 }
6107 }
6108
6109
6110
6112 {
6113 ActionOverrideData overrideData = new ActionOverrideData();
6117
6119 if (!actionMap)
6120 {
6123 }
6124
6125 actionMap.Insert(this.
Type(), overrideData);
6126
6127 }
6128
6130
6132
6133
6135 {
6138
6141
6142 string config_to_search = "CfgVehicles";
6143 string muzzle_owner_config;
6144
6146 {
6147 if (IsInherited(Weapon))
6148 config_to_search = "CfgWeapons";
6149
6150 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6151
6152 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6153
6155
6156 if (config_OnFire_subclass_count > 0)
6157 {
6158 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6159
6160 for (int i = 0; i < config_OnFire_subclass_count; i++)
6161 {
6162 string particle_class = "";
6164 string config_OnFire_entry = config_OnFire_class + particle_class;
6165 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6166 WPOF_array.Insert(WPOF);
6167 }
6168
6169
6171 }
6172 }
6173
6175 {
6176 config_to_search = "CfgWeapons";
6177 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6178
6179 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6180
6182
6183 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6184 {
6185 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6186
6187 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6188 {
6189 string particle_class2 = "";
6191 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6192 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6193 WPOBE_array.Insert(WPOBE);
6194 }
6195
6196
6198 }
6199 }
6200 }
6201
6202
6204 {
6207
6209 {
6210 string config_to_search = "CfgVehicles";
6211
6212 if (IsInherited(Weapon))
6213 config_to_search = "CfgWeapons";
6214
6215 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6216 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6217
6218 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6219 {
6220
6222
6224 {
6226 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6228 return;
6229 }
6230
6233
6234
6235
6237 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6238
6239 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6240 {
6241 string particle_class = "";
6243 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6245
6246 if (entry_type == CT_CLASS)
6247 {
6248 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6249 WPOOH_array.Insert(WPOF);
6250 }
6251 }
6252
6253
6255 }
6256 }
6257 }
6258
6260 {
6262 }
6263
6265 {
6267 {
6269
6272
6275
6276 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6277 }
6278 }
6279
6281 {
6283 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6284
6286 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6287
6289 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6290
6292 {
6294 }
6295 }
6296
6298 {
6300 }
6301
6303 {
6306 else
6308
6310 {
6313 }
6314 else
6315 {
6318
6321 }
6322
6324 }
6325
6327 {
6329 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6330 }
6331
6333 {
6335 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6337 }
6338
6340 {
6342 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6343 }
6344
6346 {
6349
6350 OverheatingParticle OP = new OverheatingParticle();
6355
6357 }
6358
6360 {
6363
6364 return -1;
6365 }
6366
6368 {
6370 {
6373
6374 for (int i = count; i > 0; --i)
6375 {
6376 int id = i - 1;
6379
6382
6383 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6384 {
6385 if (p)
6386 {
6389 }
6390 }
6391 }
6392 }
6393 }
6394
6396 {
6398 {
6400 {
6401 int id = i - 1;
6403
6404 if (OP)
6405 {
6407
6408 if (p)
6409 {
6411 }
6412
6413 delete OP;
6414 }
6415 }
6416
6419 }
6420 }
6421
6424 {
6425 return 0.0;
6426 }
6427
6428
6430 {
6431 return 250;
6432 }
6433
6435 {
6436 return 0;
6437 }
6438
6441 {
6443 return true;
6444
6445 return false;
6446 }
6447
6450 {
6453
6455 {
6457 }
6458 else
6459 {
6460
6462 }
6463
6465 }
6466
6473 {
6474 return -1;
6475 }
6476
6477
6478
6479
6481 {
6483 {
6485 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6486
6487 if (r_index >= 0)
6488 {
6489 InventoryLocation r_il = new InventoryLocation;
6490 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6491
6492 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6495 {
6496 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6497 }
6499 {
6500 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6501 }
6502
6503 }
6504
6505 player.GetHumanInventory().ClearUserReservedLocation(this);
6506 }
6507
6510 }
6511
6512
6513
6514
6516 {
6517 return ItemBase.m_DebugActionsMask;
6518 }
6519
6521 {
6522 return ItemBase.m_DebugActionsMask & mask;
6523 }
6524
6526 {
6527 ItemBase.m_DebugActionsMask = mask;
6528 }
6529
6531 {
6532 ItemBase.m_DebugActionsMask |= mask;
6533 }
6534
6536 {
6537 ItemBase.m_DebugActionsMask &= ~mask;
6538 }
6539
6541 {
6543 {
6545 }
6546 else
6547 {
6549 }
6550 }
6551
6552
6554 {
6555 if (GetEconomyProfile())
6556 {
6557 float q_max = GetEconomyProfile().GetQuantityMax();
6558 if (q_max > 0)
6559 {
6560 float q_min = GetEconomyProfile().GetQuantityMin();
6561 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6562
6564 {
6565 ComponentEnergyManager comp = GetCompEM();
6567 {
6569 }
6570 }
6572 {
6574
6575 }
6576
6577 }
6578 }
6579 }
6580
6583 {
6584 EntityAI parent = GetHierarchyParent();
6585
6586 if (parent)
6587 {
6588 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6589 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6590 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6591 }
6592 }
6593
6596 {
6597 EntityAI parent = GetHierarchyParent();
6598
6599 if (parent)
6600 {
6601 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6602 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6603 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6604 }
6605 }
6606
6608 {
6609
6610
6611
6612
6614
6616 {
6617 if (ScriptInputUserData.CanStoreInputUserData())
6618 {
6619 ScriptInputUserData ctx = new ScriptInputUserData;
6625 ctx.
Write(use_stack_max);
6628
6630 {
6631 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6632 }
6633 }
6634 }
6635 else if (!
GetGame().IsMultiplayer())
6636 {
6638 }
6639 }
6640
6642 {
6644 }
6645
6647 {
6649 }
6650
6652 {
6654 }
6655
6657 {
6658
6659 return false;
6660 }
6661
6663 {
6664 return false;
6665 }
6666
6670 {
6671 return false;
6672 }
6673
6675 {
6676 return "";
6677 }
6678
6680
6682 {
6683 return false;
6684 }
6685
6687 {
6688 return true;
6689 }
6690
6691
6692
6694 {
6695 return true;
6696 }
6697
6699 {
6700 return true;
6701 }
6702
6704 {
6705 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6707 }
6708
6710 {
6712 }
6713
6715 {
6717 if (!is_being_placed)
6719 SetSynchDirty();
6720 }
6721
6722
6724
6726 {
6728 }
6729
6731 {
6733 }
6734
6736 {
6737 return 1;
6738 }
6739
6741 {
6742 return false;
6743 }
6744
6746 {
6748 SetSynchDirty();
6749 }
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6786 {
6787 super.OnMovedInsideCargo(container);
6788
6789 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6790 }
6791
6792 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6793 {
6794 super.EEItemLocationChanged(oldLoc,newLoc);
6795
6796 PlayerBase new_player = null;
6797 PlayerBase old_player = null;
6798
6799 if (newLoc.GetParent())
6800 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6801
6802 if (oldLoc.GetParent())
6803 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6804
6806 {
6807 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6808
6809 if (r_index >= 0)
6810 {
6811 InventoryLocation r_il = new InventoryLocation;
6812 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6813
6814 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6817 {
6818 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6819 }
6821 {
6822 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6823 }
6824
6825 }
6826 }
6827
6829 {
6830 if (new_player)
6831 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6832
6833 if (new_player == old_player)
6834 {
6835
6836 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6837 {
6839 {
6840 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6841 {
6842 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6843 }
6844 }
6845 else
6846 {
6847 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6848 }
6849 }
6850
6851 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6852 {
6853 int type = oldLoc.GetType();
6855 {
6856 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6857 }
6859 {
6860 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6861 }
6862 }
6863 if (!m_OldLocation)
6864 {
6865 m_OldLocation = new InventoryLocation;
6866 }
6867 m_OldLocation.Copy(oldLoc);
6868 }
6869 else
6870 {
6871 if (m_OldLocation)
6872 {
6873 m_OldLocation.Reset();
6874 }
6875 }
6876
6878 }
6879 else
6880 {
6881 if (new_player)
6882 {
6883 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6884 if (res_index >= 0)
6885 {
6886 InventoryLocation il = new InventoryLocation;
6887 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6889 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6892 {
6893 il.
GetParent().GetOnReleaseLock().Invoke(it);
6894 }
6896 {
6898 }
6899
6900 }
6901 }
6903 {
6904
6906 }
6907
6908 if (m_OldLocation)
6909 {
6910 m_OldLocation.Reset();
6911 }
6912 }
6913 }
6914
6915 override void EOnContact(IEntity other, Contact extra)
6916 {
6918 {
6919 int liquidType = -1;
6921 if (impactSpeed > 0.0)
6922 {
6924 #ifndef SERVER
6926 #else
6928 SetSynchDirty();
6929 #endif
6931 }
6932 }
6933
6934 #ifdef SERVER
6935 if (GetCompEM() && GetCompEM().IsPlugged())
6936 {
6937 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6938 GetCompEM().UnplugThis();
6939 }
6940 #endif
6941 }
6942
6944
6946 {
6948 }
6949
6951 {
6952
6953 }
6954
6956 {
6957 super.OnItemLocationChanged(old_owner, new_owner);
6958
6959 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6960 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6961
6962 if (!relatedPlayer && playerNew)
6963 relatedPlayer = playerNew;
6964
6965 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6966 {
6968 if (actionMgr)
6969 {
6970 ActionBase currentAction = actionMgr.GetRunningAction();
6971 if (currentAction)
6973 }
6974 }
6975
6976 Man ownerPlayerOld = null;
6977 Man ownerPlayerNew = null;
6978
6979 if (old_owner)
6980 {
6981 if (old_owner.
IsMan())
6982 {
6983 ownerPlayerOld = Man.Cast(old_owner);
6984 }
6985 else
6986 {
6987 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6988 }
6989 }
6990 else
6991 {
6993 {
6995
6996 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6997 {
6998 GetCompEM().UnplugThis();
6999 }
7000 }
7001 }
7002
7003 if (new_owner)
7004 {
7005 if (new_owner.
IsMan())
7006 {
7007 ownerPlayerNew = Man.Cast(new_owner);
7008 }
7009 else
7010 {
7011 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7012 }
7013 }
7014
7015 if (ownerPlayerOld != ownerPlayerNew)
7016 {
7017 if (ownerPlayerOld)
7018 {
7019 array<EntityAI> subItemsExit = new array<EntityAI>;
7021 for (int i = 0; i < subItemsExit.Count(); i++)
7022 {
7025 }
7026 }
7027
7028 if (ownerPlayerNew)
7029 {
7030 array<EntityAI> subItemsEnter = new array<EntityAI>;
7032 for (int j = 0; j < subItemsEnter.Count(); j++)
7033 {
7036 }
7037 }
7038 }
7039 else if (ownerPlayerNew != null)
7040 {
7041 PlayerBase nplayer;
7042 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7043 {
7044 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7046 for (int k = 0; k < subItemsUpdate.Count(); k++)
7047 {
7049 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7050 }
7051 }
7052 }
7053
7054 if (old_owner)
7055 old_owner.OnChildItemRemoved(this);
7056 if (new_owner)
7057 new_owner.OnChildItemReceived(this);
7058 }
7059
7060
7062 {
7063 super.EEDelete(parent);
7064 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7065 if (player)
7066 {
7068
7069 if (player.IsAlive())
7070 {
7071 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7072 if (r_index >= 0)
7073 {
7074 InventoryLocation r_il = new InventoryLocation;
7075 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7076
7077 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7080 {
7081 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7082 }
7084 {
7085 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7086 }
7087
7088 }
7089
7090 player.RemoveQuickBarEntityShortcut(this);
7091 }
7092 }
7093 }
7094
7096 {
7097 super.EEKilled(killer);
7098
7101 {
7102 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7103 {
7104 if (IsMagazine())
7105 {
7106 if (Magazine.Cast(this).GetAmmoCount() > 0)
7107 {
7109 }
7110 }
7111 else
7112 {
7114 }
7115 }
7116 }
7117 }
7118
7120 {
7121 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7122
7123 super.OnWasAttached(parent, slot_id);
7124
7127
7129 }
7130
7132 {
7133 super.OnWasDetached(parent, slot_id);
7134
7137 }
7138
7140 {
7141 int idx;
7144
7145 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7146 if (inventory_slots.Count() < 1)
7147 {
7148 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7149 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7150 }
7151 else
7152 {
7153 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7154 }
7155
7156 idx = inventory_slots.Find(slot);
7157 if (idx < 0)
7158 return "";
7159
7160 return attach_types.Get(idx);
7161 }
7162
7164 {
7165 int idx = -1;
7166 string slot;
7167
7170
7171 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7172 if (inventory_slots.Count() < 1)
7173 {
7174 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7175 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7176 }
7177 else
7178 {
7179 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7180 if (detach_types.Count() < 1)
7181 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7182 }
7183
7184 for (int i = 0; i < inventory_slots.Count(); i++)
7185 {
7186 slot = inventory_slots.Get(i);
7187 }
7188
7189 if (slot != "")
7190 {
7191 if (detach_types.Count() == 1)
7192 idx = 0;
7193 else
7194 idx = inventory_slots.Find(slot);
7195 }
7196 if (idx < 0)
7197 return "";
7198
7199 return detach_types.Get(idx);
7200 }
7201
7203 {
7204
7206
7207
7208 float min_time = 1;
7209 float max_time = 3;
7210 float delay = Math.RandomFloat(min_time, max_time);
7211
7212 explode_timer.Run(delay, this, "DoAmmoExplosion");
7213 }
7214
7216 {
7217 Magazine magazine = Magazine.Cast(this);
7218 int pop_sounds_count = 6;
7219 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7220
7221
7222 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7223 string sound_name = pop_sounds[ sound_idx ];
7225
7226
7227 magazine.ServerAddAmmoCount(-1);
7228
7229
7230 float min_temp_to_explode = 100;
7231
7232 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
7233 {
7235 }
7236 }
7237
7238
7239 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7240 {
7241 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7242
7243 const int CHANCE_DAMAGE_CARGO = 4;
7244 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7245 const int CHANCE_DAMAGE_NOTHING = 2;
7246
7248 {
7249 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7250 int chances;
7251 int rnd;
7252
7253 if (GetInventory().GetCargo())
7254 {
7255 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7256 rnd = Math.RandomInt(0,chances);
7257
7258 if (rnd < CHANCE_DAMAGE_CARGO)
7259 {
7261 }
7262 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7263 {
7265 }
7266 }
7267 else
7268 {
7269 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7270 rnd = Math.RandomInt(0,chances);
7271
7272 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7273 {
7275 }
7276 }
7277 }
7278 }
7279
7281 {
7282 if (GetInventory().GetCargo())
7283 {
7284 int item_count = GetInventory().GetCargo().GetItemCount();
7285 if (item_count > 0)
7286 {
7287 int random_pick = Math.RandomInt(0, item_count);
7289 if (!item.IsExplosive())
7290 {
7291 item.AddHealth("","",damage);
7292 return true;
7293 }
7294 }
7295 }
7296 return false;
7297 }
7298
7300 {
7301 int attachment_count = GetInventory().AttachmentCount();
7302 if (attachment_count > 0)
7303 {
7304 int random_pick = Math.RandomInt(0, attachment_count);
7305 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7306 if (!attachment.IsExplosive())
7307 {
7308 attachment.AddHealth("","",damage);
7309 return true;
7310 }
7311 }
7312 return false;
7313 }
7314
7316 {
7318 }
7319
7321 {
7323 return GetInventory().CanRemoveEntity();
7324
7325 return false;
7326 }
7327
7329 {
7330
7332 return false;
7333
7334
7336 return false;
7337
7338
7339
7341 if (delta == 0)
7342 return false;
7343
7344
7345 return true;
7346 }
7347
7349 {
7351 {
7352 if (ScriptInputUserData.CanStoreInputUserData())
7353 {
7354 ScriptInputUserData ctx = new ScriptInputUserData;
7359 ctx.
Write(destination_entity);
7363 }
7364 }
7365 else if (!
GetGame().IsMultiplayer())
7366 {
7368 }
7369 }
7370
7372 {
7373 float split_quantity_new;
7377 InventoryLocation loc = new InventoryLocation;
7378
7379 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7380 {
7382 split_quantity_new = stack_max;
7383 else
7385
7387 {
7388 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7389 if (new_item)
7390 {
7391 new_item.SetResultOfSplit(true);
7392 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7394 new_item.
SetQuantity(split_quantity_new,
false,
true);
7395 }
7396 }
7397 }
7398 else if (destination_entity && slot_id == -1)
7399 {
7400 if (quantity > stack_max)
7401 split_quantity_new = stack_max;
7402 else
7403 split_quantity_new = quantity;
7404
7406 {
7408 {
7411 }
7412
7413 if (new_item)
7414 {
7415 new_item.SetResultOfSplit(true);
7416 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7418 new_item.
SetQuantity(split_quantity_new,
false,
true);
7419 }
7420 }
7421 }
7422 else
7423 {
7424 if (stack_max != 0)
7425 {
7427 {
7429 }
7430
7431 if (split_quantity_new == 0)
7432 {
7433 if (!
GetGame().IsMultiplayer())
7434 player.PhysicalPredictiveDropItem(this);
7435 else
7436 player.ServerDropEntity(this);
7437 return;
7438 }
7439
7441 {
7443
7444 if (new_item)
7445 {
7446 new_item.SetResultOfSplit(true);
7447 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7450 new_item.PlaceOnSurface();
7451 }
7452 }
7453 }
7454 }
7455 }
7456
7458 {
7459 float split_quantity_new;
7463 InventoryLocation loc = new InventoryLocation;
7464
7465 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7466 {
7468 split_quantity_new = stack_max;
7469 else
7471
7473 {
7474 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7475 if (new_item)
7476 {
7477 new_item.SetResultOfSplit(true);
7478 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7480 new_item.
SetQuantity(split_quantity_new,
false,
true);
7481 }
7482 }
7483 }
7484 else if (destination_entity && slot_id == -1)
7485 {
7486 if (quantity > stack_max)
7487 split_quantity_new = stack_max;
7488 else
7489 split_quantity_new = quantity;
7490
7492 {
7494 {
7497 }
7498
7499 if (new_item)
7500 {
7501 new_item.SetResultOfSplit(true);
7502 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7504 new_item.
SetQuantity(split_quantity_new,
false,
true);
7505 }
7506 }
7507 }
7508 else
7509 {
7510 if (stack_max != 0)
7511 {
7513 {
7515 }
7516
7518 {
7520
7521 if (new_item)
7522 {
7523 new_item.SetResultOfSplit(true);
7524 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7527 new_item.PlaceOnSurface();
7528 }
7529 }
7530 }
7531 }
7532 }
7533
7535 {
7537 {
7538 if (ScriptInputUserData.CanStoreInputUserData())
7539 {
7540 ScriptInputUserData ctx = new ScriptInputUserData;
7545 dst.WriteToContext(ctx);
7547 }
7548 }
7549 else if (!
GetGame().IsMultiplayer())
7550 {
7552 }
7553 }
7554
7556 {
7558 {
7559 if (ScriptInputUserData.CanStoreInputUserData())
7560 {
7561 ScriptInputUserData ctx = new ScriptInputUserData;
7566 ctx.
Write(destination_entity);
7572 }
7573 }
7574 else if (!
GetGame().IsMultiplayer())
7575 {
7577 }
7578 }
7579
7581 {
7583 }
7584
7586 {
7588 float split_quantity_new;
7590 if (dst.IsValid())
7591 {
7592 int slot_id = dst.GetSlot();
7594
7595 if (quantity > stack_max)
7596 split_quantity_new = stack_max;
7597 else
7598 split_quantity_new = quantity;
7599
7601 {
7603
7604 if (new_item)
7605 {
7606 new_item.SetResultOfSplit(true);
7607 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7609 new_item.
SetQuantity(split_quantity_new,
false,
true);
7610 }
7611
7612 return new_item;
7613 }
7614 }
7615
7616 return null;
7617 }
7618
7620 {
7622 float split_quantity_new;
7624 if (destination_entity)
7625 {
7627 if (quantity > stackable)
7628 split_quantity_new = stackable;
7629 else
7630 split_quantity_new = quantity;
7631
7633 {
7634 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7635 if (new_item)
7636 {
7637 new_item.SetResultOfSplit(true);
7638 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7640 new_item.
SetQuantity(split_quantity_new,
false,
true);
7641 }
7642 }
7643 }
7644 }
7645
7647 {
7649 {
7650 if (ScriptInputUserData.CanStoreInputUserData())
7651 {
7652 ScriptInputUserData ctx = new ScriptInputUserData;
7657 ItemBase destination_entity =
this;
7658 ctx.
Write(destination_entity);
7662 }
7663 }
7664 else if (!
GetGame().IsMultiplayer())
7665 {
7667 }
7668 }
7669
7671 {
7673 float split_quantity_new;
7675 if (player)
7676 {
7678 if (quantity > stackable)
7679 split_quantity_new = stackable;
7680 else
7681 split_quantity_new = quantity;
7682
7684 {
7685 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7686 new_item =
ItemBase.Cast(in_hands);
7687 if (new_item)
7688 {
7689 new_item.SetResultOfSplit(true);
7690 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7692 new_item.SetQuantity(split_quantity_new, false, true);
7693 }
7694 }
7695 }
7696 }
7697
7699 {
7701 float split_quantity_new = Math.Floor(quantity * 0.5);
7702
7704 return;
7705
7707
7708 if (new_item)
7709 {
7710 if (new_item.GetQuantityMax() < split_quantity_new)
7711 {
7712 split_quantity_new = new_item.GetQuantityMax();
7713 }
7714
7715 new_item.SetResultOfSplit(true);
7716 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7717
7719 {
7722 }
7723 else
7724 {
7726 new_item.
SetQuantity(split_quantity_new,
false,
true);
7727 }
7728 }
7729 }
7730
7732 {
7734 float split_quantity_new = Math.Floor(quantity / 2);
7735
7737 return;
7738
7739 InventoryLocation invloc = new InventoryLocation;
7741
7743 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7744
7745 if (new_item)
7746 {
7747 if (new_item.GetQuantityMax() < split_quantity_new)
7748 {
7749 split_quantity_new = new_item.GetQuantityMax();
7750 }
7752 {
7755 }
7756 else if (split_quantity_new > 1)
7757 {
7759 new_item.
SetQuantity(split_quantity_new,
false,
true);
7760 }
7761 }
7762 }
7763
7766 {
7767 SetWeightDirty();
7769
7770 if (parent)
7771 parent.OnAttachmentQuantityChangedEx(this, delta);
7772
7774 {
7776 {
7778 }
7780 {
7781 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7783 }
7784 }
7785
7786 }
7787
7790 {
7791
7792 }
7793
7796 {
7798 }
7799
7801 {
7802 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7803
7805 {
7806 if (newLevel == GameConstants.STATE_RUINED)
7807 {
7809 EntityAI parent = GetHierarchyParent();
7810 if (parent && parent.IsFireplace())
7811 {
7812 CargoBase cargo = GetInventory().GetCargo();
7813 if (cargo)
7814 {
7816 {
7818 }
7819 }
7820 }
7821 }
7822
7824 {
7825
7827 return;
7828 }
7829
7830 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7831 {
7833 }
7834 }
7835 }
7836
7837
7839 {
7840 super.OnRightClick();
7841
7843 {
7845 {
7846 if (ScriptInputUserData.CanStoreInputUserData())
7847 {
7848 EntityAI root = GetHierarchyRoot();
7849 Man playerOwner = GetHierarchyRootPlayer();
7850 InventoryLocation dst = new InventoryLocation;
7851
7852
7853 if (!playerOwner && root && root == this)
7854 {
7856 }
7857 else
7858 {
7859
7860 GetInventory().GetCurrentInventoryLocation(dst);
7862 {
7865 {
7867 }
7868 else
7869 {
7871
7872
7873 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7874 {
7876 }
7877 else
7878 {
7879 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7880 }
7881 }
7882 }
7883 }
7884
7885 ScriptInputUserData ctx = new ScriptInputUserData;
7893 }
7894 }
7895 else if (!
GetGame().IsMultiplayer())
7896 {
7898 }
7899 }
7900 }
7901
7903 {
7904 if (root)
7905 {
7906 vector m4[4];
7907 root.GetTransform(m4);
7908 dst.SetGround(this, m4);
7909 }
7910 else
7911 {
7912 GetInventory().GetCurrentInventoryLocation(dst);
7913 }
7914 }
7915
7916 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7917 {
7918
7919 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7920 return false;
7921
7922 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7923 return false;
7924
7925
7927 return false;
7928
7929
7930 Magazine mag = Magazine.Cast(this);
7931 if (mag)
7932 {
7933 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7934 return false;
7935
7936 if (stack_max_limit)
7937 {
7938 Magazine other_mag = Magazine.Cast(other_item);
7939 if (other_item)
7940 {
7941 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7942 return false;
7943 }
7944
7945 }
7946 }
7947 else
7948 {
7949
7951 return false;
7952
7954 return false;
7955 }
7956
7957 PlayerBase player = null;
7958 if (CastTo(player, GetHierarchyRootPlayer()))
7959 {
7960 if (player.GetInventory().HasAttachment(this))
7961 return false;
7962
7963 if (player.IsItemsToDelete())
7964 return false;
7965 }
7966
7967 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7968 return false;
7969
7970 int slotID;
7972 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7973 return false;
7974
7975 return true;
7976 }
7977
7979 {
7981 }
7982
7984 {
7985 return m_IsResultOfSplit;
7986 }
7987
7989 {
7990 m_IsResultOfSplit = value;
7991 }
7992
7994 {
7996 }
7997
7999 {
8000 float other_item_quantity = other_item.GetQuantity();
8001 float this_free_space;
8002
8004
8006
8007 if (other_item_quantity > this_free_space)
8008 {
8009 return this_free_space;
8010 }
8011 else
8012 {
8013 return other_item_quantity;
8014 }
8015 }
8016
8018 {
8020 }
8021
8023 {
8025 return;
8026
8027 if (!IsMagazine() && other_item)
8028 {
8030 if (quantity_used != 0)
8031 {
8032 float hp1 = GetHealth01("","");
8033 float hp2 = other_item.GetHealth01("","");
8034 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8035 hpResult = hpResult / (
GetQuantity() + quantity_used);
8036
8037 hpResult *= GetMaxHealth();
8038 Math.Round(hpResult);
8039 SetHealth("", "Health", hpResult);
8040
8042 other_item.AddQuantity(-quantity_used);
8043 }
8044 }
8046 }
8047
8049 {
8050 #ifdef SERVER
8051 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8052 GetHierarchyParent().IncreaseLifetimeUp();
8053 #endif
8054 };
8055
8057 {
8058 PlayerBase p = PlayerBase.Cast(player);
8059
8060 array<int> recipesIds = p.m_Recipes;
8061 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8062 if (moduleRecipesManager)
8063 {
8064 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8065 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8066 }
8067
8068 for (int i = 0;i < recipesIds.Count(); i++)
8069 {
8070 int key = recipesIds.Get(i);
8071 string recipeName = moduleRecipesManager.GetRecipeName(key);
8073 }
8074 }
8075
8076
8077 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8078 {
8079 super.GetDebugActions(outputList);
8080
8081
8087
8088
8093
8098
8099
8103
8104
8106 {
8110 }
8111
8114
8115
8119
8121
8122 InventoryLocation loc = new InventoryLocation();
8123 GetInventory().GetCurrentInventoryLocation(loc);
8125 {
8126 if (Gizmo_IsSupported())
8129 }
8130
8132 }
8133
8134
8135
8136
8138 {
8139 super.OnAction(action_id, player, ctx);
8140
8142 {
8143 switch (action_id)
8144 {
8147 return true;
8150 return true;
8151 }
8152 }
8153
8155 {
8156 switch (action_id)
8157 {
8159 Delete();
8160 return true;
8161 }
8162 }
8163
8164 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8165 {
8166 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8167 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8168 PlayerBase p = PlayerBase.Cast(player);
8169 if (
EActions.RECIPES_RANGE_START < 1000)
8170 {
8171 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8172 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8173 }
8174 }
8175 #ifndef SERVER
8176 else if (action_id ==
EActions.WATCH_PLAYER)
8177 {
8178 PluginDeveloper.SetDeveloperItemClientEx(player);
8179 }
8180 #endif
8182 {
8183 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8184 {
8185 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8186 OnDebugButtonPressServer(id + 1);
8187 }
8188
8189 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8190 {
8191 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8193 }
8194
8195 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8196 {
8197 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8199 }
8200
8201 else if (action_id ==
EActions.ADD_QUANTITY)
8202 {
8203 if (IsMagazine())
8204 {
8205 Magazine mag = Magazine.Cast(this);
8206 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8207 }
8208 else
8209 {
8211 }
8212
8213 if (m_EM)
8214 {
8215 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8216 }
8217
8218 }
8219
8220 else if (action_id ==
EActions.REMOVE_QUANTITY)
8221 {
8222 if (IsMagazine())
8223 {
8224 Magazine mag2 = Magazine.Cast(this);
8225 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8226 }
8227 else
8228 {
8230 }
8231 if (m_EM)
8232 {
8233 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8234 }
8235
8236 }
8237
8238 else if (action_id ==
EActions.SET_QUANTITY_0)
8239 {
8241
8242 if (m_EM)
8243 {
8244 m_EM.SetEnergy(0);
8245 }
8246 }
8247
8248 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8249 {
8251
8252 if (m_EM)
8253 {
8254 m_EM.SetEnergy(m_EM.GetEnergyMax());
8255 }
8256 }
8257
8258 else if (action_id ==
EActions.ADD_HEALTH)
8259 {
8260 AddHealth("","",GetMaxHealth("","Health")/5);
8261 }
8262 else if (action_id ==
EActions.REMOVE_HEALTH)
8263 {
8264 AddHealth("","",-GetMaxHealth("","Health")/5);
8265 }
8266 else if (action_id ==
EActions.DESTROY_HEALTH)
8267 {
8268 SetHealth01("","",0);
8269 }
8270 else if (action_id ==
EActions.WATCH_ITEM)
8271 {
8273 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8274 #ifdef DEVELOPER
8275 SetDebugDeveloper_item(this);
8276 #endif
8277 }
8278
8279 else if (action_id ==
EActions.ADD_TEMPERATURE)
8280 {
8281 AddTemperature(20);
8282
8283 }
8284
8285 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8286 {
8287 AddTemperature(-20);
8288
8289 }
8290
8291 else if (action_id ==
EActions.FLIP_FROZEN)
8292 {
8293 SetFrozen(!GetIsFrozen());
8294
8295 }
8296
8297 else if (action_id ==
EActions.ADD_WETNESS)
8298 {
8300
8301 }
8302
8303 else if (action_id ==
EActions.REMOVE_WETNESS)
8304 {
8306
8307 }
8308
8309 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8310 {
8313
8314
8315 }
8316
8317 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8318 {
8321 }
8322
8323 else if (action_id ==
EActions.MAKE_SPECIAL)
8324 {
8325 auto debugParams = DebugSpawnParams.WithPlayer(player);
8326 OnDebugSpawnEx(debugParams);
8327 }
8328
8329 }
8330
8331
8332 return false;
8333 }
8334
8335
8336
8337
8341
8344
8345
8346
8348 {
8349 return false;
8350 }
8351
8352
8354 {
8355 return true;
8356 }
8357
8358
8360 {
8361 return true;
8362 }
8363
8364
8365
8367 {
8368 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8370 }
8371
8374 {
8375 return null;
8376 }
8377
8379 {
8380 return false;
8381 }
8382
8384 {
8385 return false;
8386 }
8387
8391
8392
8394 {
8395 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8396 return module_repairing.CanRepair(this, item_repair_kit);
8397 }
8398
8399
8400 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8401 {
8402 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8403 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8404 }
8405
8406
8408 {
8409
8410
8411
8412
8413
8414
8415
8416
8417 return 1;
8418 }
8419
8420
8421
8423 {
8425 }
8426
8427
8428
8430 {
8432 }
8433
8434
8443 {
8444 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8445
8446 if (player)
8447 {
8448 player.MessageStatus(text);
8449 }
8450 }
8451
8452
8461 {
8462 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8463
8464 if (player)
8465 {
8466 player.MessageAction(text);
8467 }
8468 }
8469
8470
8479 {
8480 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8481
8482 if (player)
8483 {
8484 player.MessageFriendly(text);
8485 }
8486 }
8487
8488
8497 {
8498 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8499
8500 if (player)
8501 {
8502 player.MessageImportant(text);
8503 }
8504 }
8505
8507 {
8508 return true;
8509 }
8510
8511
8512 override bool KindOf(
string tag)
8513 {
8514 bool found = false;
8515 string item_name = this.
GetType();
8518
8519 int array_size = item_tag_array.Count();
8520 for (int i = 0; i < array_size; i++)
8521 {
8522 if (item_tag_array.Get(i) == tag)
8523 {
8524 found = true;
8525 break;
8526 }
8527 }
8528 return found;
8529 }
8530
8531
8533 {
8534
8535 super.OnRPC(sender, rpc_type,ctx);
8536
8537
8538 switch (rpc_type)
8539 {
8540 #ifndef SERVER
8541 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8542 Param2<bool, string> p = new Param2<bool, string>(false, "");
8543
8545 return;
8546
8547 bool play = p.param1;
8548 string soundSet = p.param2;
8549
8550 if (play)
8551 {
8553 {
8555 {
8557 }
8558 }
8559 else
8560 {
8562 }
8563 }
8564 else
8565 {
8567 }
8568
8569 break;
8570 #endif
8571
8572 }
8573
8575 {
8577 }
8578 }
8579
8580
8581
8582
8584 {
8585 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8586 return plugin.GetID(
name);
8587 }
8588
8590 {
8591 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8592 return plugin.GetName(id);
8593 }
8594
8597 {
8598
8599
8600 int varFlags;
8601 if (!ctx.
Read(varFlags))
8602 return;
8603
8604 if (varFlags & ItemVariableFlags.FLOAT)
8605 {
8607 }
8608 }
8609
8611 {
8612
8613 super.SerializeNumericalVars(floats_out);
8614
8615
8616
8618 {
8620 }
8621
8623 {
8625 }
8626
8628 {
8630 }
8631
8633 {
8638 }
8639
8641 {
8643 }
8644 }
8645
8647 {
8648
8649 super.DeSerializeNumericalVars(floats);
8650
8651
8652 int index = 0;
8653 int mask = Math.Round(floats.Get(index));
8654
8655 index++;
8656
8658 {
8660 {
8662 }
8663 else
8664 {
8665 float quantity = floats.Get(index);
8667 }
8668 index++;
8669 }
8670
8672 {
8673 float wet = floats.Get(index);
8675 index++;
8676 }
8677
8679 {
8680 int liquidtype = Math.Round(floats.Get(index));
8682 index++;
8683 }
8684
8686 {
8688 index++;
8690 index++;
8692 index++;
8694 index++;
8695 }
8696
8698 {
8699 int cleanness = Math.Round(floats.Get(index));
8701 index++;
8702 }
8703 }
8704
8706 {
8707 super.WriteVarsToCTX(ctx);
8708
8709
8711 {
8713 }
8714
8716 {
8718 }
8719
8721 {
8723 }
8724
8726 {
8727 int r,g,b,a;
8733 }
8734
8736 {
8738 }
8739 }
8740
8742 {
8743 if (!super.ReadVarsFromCTX(ctx,version))
8744 return false;
8745
8746 int intValue;
8747 float value;
8748
8749 if (version < 140)
8750 {
8751 if (!ctx.
Read(intValue))
8752 return false;
8753
8754 m_VariablesMask = intValue;
8755 }
8756
8758 {
8759 if (!ctx.
Read(value))
8760 return false;
8761
8763 {
8765 }
8766 else
8767 {
8769 }
8770 }
8771
8772 if (version < 140)
8773 {
8775 {
8776 if (!ctx.
Read(value))
8777 return false;
8778 SetTemperatureDirect(value);
8779 }
8780 }
8781
8783 {
8784 if (!ctx.
Read(value))
8785 return false;
8787 }
8788
8790 {
8791 if (!ctx.
Read(intValue))
8792 return false;
8794 }
8795
8797 {
8798 int r,g,b,a;
8800 return false;
8802 return false;
8804 return false;
8806 return false;
8807
8809 }
8810
8812 {
8813 if (!ctx.
Read(intValue))
8814 return false;
8816 }
8817
8818 if (version >= 138 && version < 140)
8819 {
8821 {
8822 if (!ctx.
Read(intValue))
8823 return false;
8824 SetFrozen(intValue);
8825 }
8826 }
8827
8828 return true;
8829 }
8830
8831
8833 {
8836 {
8838 }
8839
8840 if (!super.OnStoreLoad(ctx, version))
8841 {
8843 return false;
8844 }
8845
8846 if (version >= 114)
8847 {
8848 bool hasQuickBarIndexSaved;
8849
8850 if (!ctx.
Read(hasQuickBarIndexSaved))
8851 {
8853 return false;
8854 }
8855
8856 if (hasQuickBarIndexSaved)
8857 {
8858 int itmQBIndex;
8859
8860
8861 if (!ctx.
Read(itmQBIndex))
8862 {
8864 return false;
8865 }
8866
8867 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8868 if (itmQBIndex != -1 && parentPlayer)
8869 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8870 }
8871 }
8872 else
8873 {
8874
8875 PlayerBase player;
8876 int itemQBIndex;
8877 if (version ==
int.
MAX)
8878 {
8879 if (!ctx.
Read(itemQBIndex))
8880 {
8882 return false;
8883 }
8884 }
8885 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8886 {
8887
8888 if (!ctx.
Read(itemQBIndex))
8889 {
8891 return false;
8892 }
8893 if (itemQBIndex != -1 && player)
8894 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8895 }
8896 }
8897
8898 if (version < 140)
8899 {
8900
8901 if (!LoadVariables(ctx, version))
8902 {
8904 return false;
8905 }
8906 }
8907
8908
8910 {
8912 return false;
8913 }
8914 if (version >= 132)
8915 {
8917 if (raib)
8918 {
8920 {
8922 return false;
8923 }
8924 }
8925 }
8926
8928 return true;
8929 }
8930
8931
8932
8934 {
8935 super.OnStoreSave(ctx);
8936
8937 PlayerBase player;
8938 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8939 {
8941
8942 int itemQBIndex = -1;
8943 itemQBIndex = player.FindQuickBarEntityIndex(this);
8944 ctx.
Write(itemQBIndex);
8945 }
8946 else
8947 {
8949 }
8950
8952
8954 if (raib)
8955 {
8957 }
8958 }
8959
8960
8962 {
8963 super.AfterStoreLoad();
8964
8966 {
8968 }
8969
8971 {
8974 }
8975 }
8976
8978 {
8979 super.EEOnAfterLoad();
8980
8982 {
8984 }
8985
8988 }
8989
8991 {
8992 return false;
8993 }
8994
8995
8996
8998 {
9000 {
9001 #ifdef PLATFORM_CONSOLE
9002
9004 {
9006 if (menu)
9007 {
9009 }
9010 }
9011 #endif
9012 }
9013
9015 {
9018 }
9019
9021 {
9022 SetWeightDirty();
9024 }
9026 {
9029 }
9030
9032 {
9035 }
9037 {
9040 }
9041
9042 super.OnVariablesSynchronized();
9043 }
9044
9045
9046
9048 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9049 {
9050 if (!IsServerCheck(allow_client))
9051 return false;
9052
9054 return false;
9055
9058
9059 if (value <= (min + 0.001))
9060 value = min;
9061
9062 if (value == min)
9063 {
9064 if (destroy_config)
9065 {
9066 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9067 if (dstr)
9068 {
9070 this.Delete();
9071 return true;
9072 }
9073 }
9074 else if (destroy_forced)
9075 {
9077 this.Delete();
9078 return true;
9079 }
9080
9082 }
9083
9086
9088 {
9090
9091 if (delta)
9093 }
9094
9096
9097 return false;
9098 }
9099
9100
9102 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9103 {
9105 }
9106
9108 {
9111 }
9112
9114 {
9117 }
9118
9120 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9121 {
9122 float value_clamped = Math.Clamp(value, 0, 1);
9124 SetQuantity(result, destroy_config, destroy_forced);
9125 }
9126
9127
9130 {
9132 }
9133
9135 {
9137 }
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9149 {
9150 int slot = -1;
9151 if (GetInventory())
9152 {
9153 InventoryLocation il = new InventoryLocation;
9154 GetInventory().GetCurrentInventoryLocation(il);
9156 }
9157
9159 }
9160
9162 {
9163 float quantity_max = 0;
9164
9166 {
9167 if (attSlotID != -1)
9168 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9169
9170 if (quantity_max <= 0)
9172 }
9173
9174 if (quantity_max <= 0)
9176
9177 return quantity_max;
9178 }
9179
9181 {
9183 }
9184
9186 {
9188 }
9189
9190
9192 {
9194 }
9195
9197 {
9199 }
9200
9202 {
9204 }
9205
9206
9208 {
9209
9210 float weightEx = GetWeightEx();
9211 float special = GetInventoryAndCargoWeight();
9212 return weightEx - special;
9213 }
9214
9215
9217 {
9219 }
9220
9222 {
9224 {
9225 #ifdef DEVELOPER
9226 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9227 {
9228 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9230 }
9231 #endif
9232
9234 }
9235 else if (HasEnergyManager())
9236 {
9237 #ifdef DEVELOPER
9238 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9239 {
9240 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9241 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9242 }
9243 #endif
9244 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
9245 }
9246 else
9247 {
9248 #ifdef DEVELOPER
9249 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9250 {
9251 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9252 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9253 }
9254 #endif
9255 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9256 }
9257 }
9258
9261 {
9262 int item_count = 0;
9264
9265 if (GetInventory().GetCargo() != NULL)
9266 {
9267 item_count = GetInventory().GetCargo().GetItemCount();
9268 }
9269
9270 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9271 {
9272 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9273 if (item)
9274 item_count += item.GetNumberOfItems();
9275 }
9276 return item_count;
9277 }
9278
9281 {
9282 float weight = 0;
9283 float wetness = 1;
9284 if (include_wetness)
9287 {
9288 weight = wetness * m_ConfigWeight;
9289 }
9291 {
9292 weight = 1;
9293 }
9294 return weight;
9295 }
9296
9297
9298
9300 {
9301 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9302 {
9303 GameInventory inv = GetInventory();
9304 array<EntityAI> items = new array<EntityAI>;
9306 for (int i = 0; i < items.Count(); i++)
9307 {
9309 if (item)
9310 {
9312 }
9313 }
9314 }
9315 }
9316
9317
9318
9319
9321 {
9322 float energy = 0;
9323 if (HasEnergyManager())
9324 {
9325 energy = GetCompEM().GetEnergy();
9326 }
9327 return energy;
9328 }
9329
9330
9332 {
9333 super.OnEnergyConsumed();
9334
9336 }
9337
9339 {
9340 super.OnEnergyAdded();
9341
9343 }
9344
9345
9347 {
9348 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9349 {
9351 {
9352 float energy_0to1 = GetCompEM().GetEnergy0To1();
9354 }
9355 }
9356 }
9357
9358
9360 {
9361 return ConfigGetFloat("heatIsolation");
9362 }
9363
9365 {
9367 }
9368
9370 {
9371 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9372 if (
GetGame().ConfigIsExisting(paramPath))
9374
9375 return 0.0;
9376 }
9377
9379 {
9380 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9381 if (
GetGame().ConfigIsExisting(paramPath))
9383
9384 return 0.0;
9385 }
9386
9387 override void SetWet(
float value,
bool allow_client =
false)
9388 {
9389 if (!IsServerCheck(allow_client))
9390 return;
9391
9394
9396
9397 m_VarWet = Math.Clamp(value, min, max);
9398
9400 {
9403 }
9404 }
9405
9406 override void AddWet(
float value)
9407 {
9409 }
9410
9412 {
9414 }
9415
9417 {
9419 }
9420
9422 {
9424 }
9425
9427 {
9429 }
9430
9432 {
9434 }
9435
9437 {
9440 if (newLevel != oldLevel)
9441 {
9443 }
9444 }
9445
9447 {
9448 SetWeightDirty();
9449 }
9450
9452 {
9453 return GetWetLevelInternal(
m_VarWet);
9454 }
9455
9456
9457
9459 {
9461 }
9462
9464 {
9466 }
9467
9469 {
9471 }
9472
9474 {
9476 }
9477
9478
9479
9481 {
9482 if (ConfigIsExisting("itemModelLength"))
9483 {
9484 return ConfigGetFloat("itemModelLength");
9485 }
9486 return 0;
9487 }
9488
9490 {
9491 if (ConfigIsExisting("itemAttachOffset"))
9492 {
9493 return ConfigGetFloat("itemAttachOffset");
9494 }
9495 return 0;
9496 }
9497
9498 override void SetCleanness(
int value,
bool allow_client =
false)
9499 {
9500 if (!IsServerCheck(allow_client))
9501 return;
9502
9504
9506
9509 }
9510
9512 {
9514 }
9515
9517 {
9518 return true;
9519 }
9520
9521
9522
9523
9525 {
9527 }
9528
9530 {
9532 }
9533
9534
9535
9536
9537 override void SetColor(
int r,
int g,
int b,
int a)
9538 {
9544 }
9546 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9547 {
9552 }
9553
9555 {
9557 }
9558
9561 {
9562 int r,g,b,a;
9564 r = r/255;
9565 g = g/255;
9566 b = b/255;
9567 a = a/255;
9568 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9569 }
9570
9571
9572
9573 override void SetLiquidType(
int value,
bool allow_client =
false)
9574 {
9575 if (!IsServerCheck(allow_client))
9576 return;
9577
9582 }
9583
9585 {
9586 return ConfigGetInt("varLiquidTypeInit");
9587 }
9588
9590 {
9592 }
9593
9595 {
9597 SetFrozen(false);
9598 }
9599
9602 {
9603 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9604 }
9605
9606
9609 {
9610 PlayerBase nplayer;
9611 if (PlayerBase.CastTo(nplayer, player))
9612 {
9614
9615 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9616 }
9617 }
9618
9619
9622 {
9623 PlayerBase nplayer;
9624 if (PlayerBase.CastTo(nplayer,player))
9625 {
9626
9627 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9628
9629 }
9630
9631
9632 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9633
9634
9635 if (HasEnergyManager())
9636 {
9637 GetCompEM().UpdatePlugState();
9638 }
9639 }
9640
9641
9643 {
9644 super.OnPlacementStarted(player);
9645
9647 }
9648
9649 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9650 {
9652 {
9653 m_AdminLog.OnPlacementComplete(player,
this);
9654 }
9655
9656 super.OnPlacementComplete(player, position, orientation);
9657 }
9658
9659
9660
9661
9662
9664 {
9666 {
9667 return true;
9668 }
9669 else
9670 {
9671 return false;
9672 }
9673 }
9674
9675
9677 {
9679 {
9681 }
9682 }
9683
9684
9686 {
9688 }
9689
9691 {
9693 }
9694
9695 override void InsertAgent(
int agent,
float count = 1)
9696 {
9697 if (count < 1)
9698 return;
9699
9701 }
9702
9705 {
9707 }
9708
9709
9711 {
9713 }
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9757 {
9759 return false;
9760 return true;
9761 }
9762
9764 {
9765
9767 }
9768
9769
9772 {
9773 super.CheckForRoofLimited(timeTresholdMS);
9774
9776 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9777 {
9778 m_PreviousRoofTestTime = time;
9779 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9780 }
9781 }
9782
9783
9785 {
9787 {
9788 return 0;
9789 }
9790
9791 if (GetInventory().GetAttachmentSlotsCount() != 0)
9792 {
9793 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9794 if (filter)
9795 return filter.GetProtectionLevel(type, false, system);
9796 else
9797 return 0;
9798 }
9799
9800 string subclassPath, entryName;
9801
9802 switch (type)
9803 {
9805 entryName = "biological";
9806 break;
9808 entryName = "chemical";
9809 break;
9810 default:
9811 entryName = "biological";
9812 break;
9813 }
9814
9815 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9816
9818 }
9819
9820
9821
9824 {
9825 if (!IsMagazine())
9827
9829 }
9830
9831
9832
9833
9834
9839 {
9840 return true;
9841 }
9842
9844 {
9846 }
9847
9848
9849
9850
9851
9853 {
9854 if (parent)
9855 {
9856 if (parent.IsInherited(DayZInfected))
9857 return true;
9858
9859 if (!parent.IsRuined())
9860 return true;
9861 }
9862
9863 return true;
9864 }
9865
9867 {
9868 if (!super.CanPutAsAttachment(parent))
9869 {
9870 return false;
9871 }
9872
9873 if (!IsRuined() && !parent.IsRuined())
9874 {
9875 return true;
9876 }
9877
9878 return false;
9879 }
9880
9882 {
9883
9884
9885
9886
9887 return super.CanReceiveItemIntoCargo(item);
9888 }
9889
9891 {
9892
9893
9894
9895
9896 GameInventory attachmentInv = attachment.GetInventory();
9898 {
9899 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9900 return false;
9901 }
9902
9903 InventoryLocation loc = new InventoryLocation();
9904 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9905 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9906 return false;
9907
9908 return super.CanReceiveAttachment(attachment, slotId);
9909 }
9910
9912 {
9913 if (!super.CanReleaseAttachment(attachment))
9914 return false;
9915
9916 return GetInventory().AreChildrenAccessible();
9917 }
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9940 {
9941 int id = muzzle_owner.GetMuzzleID();
9942 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9943
9944 if (WPOF_array)
9945 {
9946 for (int i = 0; i < WPOF_array.Count(); i++)
9947 {
9948 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9949
9950 if (WPOF)
9951 {
9952 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9953 }
9954 }
9955 }
9956 }
9957
9958
9960 {
9961 int id = muzzle_owner.GetMuzzleID();
9963
9964 if (WPOBE_array)
9965 {
9966 for (int i = 0; i < WPOBE_array.Count(); i++)
9967 {
9968 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9969
9970 if (WPOBE)
9971 {
9972 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9973 }
9974 }
9975 }
9976 }
9977
9978
9980 {
9981 int id = muzzle_owner.GetMuzzleID();
9982 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9983
9984 if (WPOOH_array)
9985 {
9986 for (int i = 0; i < WPOOH_array.Count(); i++)
9987 {
9988 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9989
9990 if (WPOOH)
9991 {
9992 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9993 }
9994 }
9995 }
9996 }
9997
9998
10000 {
10001 int id = muzzle_owner.GetMuzzleID();
10002 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10003
10004 if (WPOOH_array)
10005 {
10006 for (int i = 0; i < WPOOH_array.Count(); i++)
10007 {
10008 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10009
10010 if (WPOOH)
10011 {
10012 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10013 }
10014 }
10015 }
10016 }
10017
10018
10020 {
10021 int id = muzzle_owner.GetMuzzleID();
10022 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10023
10024 if (WPOOH_array)
10025 {
10026 for (int i = 0; i < WPOOH_array.Count(); i++)
10027 {
10028 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10029
10030 if (WPOOH)
10031 {
10032 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10033 }
10034 }
10035 }
10036 }
10037
10038
10039
10041 {
10043 {
10044 return true;
10045 }
10046
10047 return false;
10048 }
10049
10051 {
10053 {
10054 return true;
10055 }
10056
10057 return false;
10058 }
10059
10061 {
10063 {
10064 return true;
10065 }
10066
10067 return false;
10068 }
10069
10071 {
10072 return false;
10073 }
10074
10077 {
10078 return UATimeSpent.DEFAULT_DEPLOY;
10079 }
10080
10081
10082
10083
10085 {
10087 SetSynchDirty();
10088 }
10089
10091 {
10093 }
10094
10095
10097 {
10098 return false;
10099 }
10100
10103 {
10104 string att_type = "None";
10105
10106 if (ConfigIsExisting("soundAttType"))
10107 {
10108 att_type = ConfigGetString("soundAttType");
10109 }
10110
10112 }
10113
10115 {
10117 }
10118
10119
10120
10121
10122
10128
10130 {
10133
10135 }
10136
10137
10139 {
10141 return;
10142
10144
10147
10150
10151 SoundParameters params = new SoundParameters();
10155 }
10156
10157
10159 {
10161 return;
10162
10164 SetSynchDirty();
10165
10168 }
10169
10170
10172 {
10174 return;
10175
10177 SetSynchDirty();
10178
10181 }
10182
10184 {
10186 }
10187
10189 {
10191 }
10192
10195 {
10196 if (!
GetGame().IsDedicatedServer())
10197 {
10198 if (ConfigIsExisting("attachSoundSet"))
10199 {
10200 string cfg_path = "";
10201 string soundset = "";
10202 string type_name =
GetType();
10203
10206 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10207 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10208
10209 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10210 {
10211 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10212 {
10213 if (cfg_slot_array[i] == slot_type)
10214 {
10215 soundset = cfg_soundset_array[i];
10216 break;
10217 }
10218 }
10219 }
10220
10221 if (soundset != "")
10222 {
10223 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10225 }
10226 }
10227 }
10228 }
10229
10231 {
10232
10233 }
10234
10235 void OnApply(PlayerBase player);
10236
10238 {
10239 return 1.0;
10240 };
10241
10243 {
10245 }
10246
10248 {
10250 }
10251
10253
10255 {
10256 SetDynamicPhysicsLifeTime(0.01);
10258 }
10259
10261 {
10262 array<string> zone_names = new array<string>;
10263 GetDamageZones(zone_names);
10264 for (int i = 0; i < zone_names.Count(); i++)
10265 {
10266 SetHealthMax(zone_names.Get(i),"Health");
10267 }
10268 SetHealthMax("","Health");
10269 }
10270
10273 {
10274 float global_health = GetHealth01("","Health");
10275 array<string> zones = new array<string>;
10276 GetDamageZones(zones);
10277
10278 for (int i = 0; i < zones.Count(); i++)
10279 {
10280 SetHealth01(zones.Get(i),"Health",global_health);
10281 }
10282 }
10283
10286 {
10287 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10288 }
10289
10291 {
10292 if (!hasRootAsPlayer)
10293 {
10294 if (refParentIB)
10295 {
10296
10297 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10298 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10299
10300 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10301 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10302
10305 }
10306 else
10307 {
10308
10311 }
10312 }
10313 }
10314
10316 {
10318 {
10319 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10320 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10321 {
10322 float heatPermCoef = 1.0;
10324 while (ent)
10325 {
10326 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10327 ent = ent.GetHierarchyParent();
10328 }
10329
10330 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10331 }
10332 }
10333 }
10334
10336 {
10337
10338 EntityAI parent = GetHierarchyParent();
10339 if (!parent)
10340 {
10341 hasParent = false;
10342 hasRootAsPlayer = false;
10343 }
10344 else
10345 {
10346 hasParent = true;
10347 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10348 refParentIB =
ItemBase.Cast(parent);
10349 }
10350 }
10351
10352 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10353 {
10354
10355 }
10356
10358 {
10359
10360 return false;
10361 }
10362
10364 {
10365
10366
10367 return false;
10368 }
10369
10371 {
10372
10373 return false;
10374 }
10375
10378 {
10379 return !GetIsFrozen() &&
IsOpen();
10380 }
10381
10383 {
10384 bool hasParent = false, hasRootAsPlayer = false;
10386
10387 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10388 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10389
10390 if (wwtu || foodDecay)
10391 {
10395
10396 if (processWetness || processTemperature || processDecay)
10397 {
10399
10400 if (processWetness)
10401 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10402
10403 if (processTemperature)
10405
10406 if (processDecay)
10407 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10408 }
10409 }
10410 }
10411
10414 {
10416 }
10417
10419 {
10422
10423 return super.GetTemperatureFreezeThreshold();
10424 }
10425
10427 {
10430
10431 return super.GetTemperatureThawThreshold();
10432 }
10433
10435 {
10438
10439 return super.GetItemOverheatThreshold();
10440 }
10441
10443 {
10445 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10446
10447 return super.GetTemperatureFreezeTime();
10448 }
10449
10451 {
10453 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10454
10455 return super.GetTemperatureThawTime();
10456 }
10457
10462
10464 {
10465 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10466 }
10467
10469 {
10470 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10471 }
10472
10475 {
10477 }
10478
10480 {
10482 }
10483
10485 {
10487 }
10488
10491 {
10492 return null;
10493 }
10494
10497 {
10498 return false;
10499 }
10500
10502 {
10504 {
10507 if (!trg)
10508 {
10510 explosive = this;
10511 }
10512
10513 explosive.PairRemote(trg);
10515
10516 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10517 trg.SetPersistentPairID(persistentID);
10518 explosive.SetPersistentPairID(persistentID);
10519
10520 return true;
10521 }
10522 return false;
10523 }
10524
10527 {
10528 float ret = 1.0;
10531 ret *= GetHealth01();
10532
10533 return ret;
10534 }
10535
10536 #ifdef DEVELOPER
10537 override void SetDebugItem()
10538 {
10539 super.SetDebugItem();
10540 _itemBase = this;
10541 }
10542
10544 {
10545 string text = super.GetDebugText();
10546
10548 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10549
10550 return text;
10551 }
10552 #endif
10553
10555 {
10556 return true;
10557 }
10558
10560
10562
10564 {
10567 }
10568
10569
10577
10593}
10594
10596{
10598 if (entity)
10599 {
10600 bool is_item = entity.IsInherited(
ItemBase);
10601 if (is_item && full_quantity)
10602 {
10605 }
10606 }
10607 else
10608 {
10610 return NULL;
10611 }
10612 return entity;
10613}
10614
10616{
10617 if (item)
10618 {
10619 if (health > 0)
10620 item.SetHealth("", "", health);
10621
10622 if (item.CanHaveTemperature())
10623 {
10625 if (item.CanFreeze())
10626 item.SetFrozen(false);
10627 }
10628
10629 if (item.HasEnergyManager())
10630 {
10631 if (quantity >= 0)
10632 {
10633 item.GetCompEM().SetEnergy0To1(quantity);
10634 }
10635 else
10636 {
10638 }
10639 }
10640 else if (item.IsMagazine())
10641 {
10642 Magazine mag = Magazine.Cast(item);
10643 if (quantity >= 0)
10644 {
10645 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10646 }
10647 else
10648 {
10650 }
10651
10652 }
10653 else
10654 {
10655 if (quantity >= 0)
10656 {
10657 item.SetQuantityNormalized(quantity, false);
10658 }
10659 else
10660 {
10662 }
10663
10664 }
10665 }
10666}
10667
10668#ifdef DEVELOPER
10670#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.