5807{
5809 {
5810 return true;
5811 }
5812};
5813
5814
5815
5817{
5821
5823
5826
5827
5828
5829
5830
5839
5845
5850
5855
5876 protected bool m_IsResultOfSplit
5877
5879
5884
5885
5886
5888
5892
5893
5894
5896
5899
5900
5901
5907
5908
5916
5919
5920
5922
5923
5925
5926
5931
5932
5937
5938
5940
5941
5943 {
5948
5949 if (!
GetGame().IsDedicatedServer())
5950 {
5952 {
5954
5956 {
5958 }
5959 }
5960
5963 }
5964
5965 m_OldLocation = null;
5966
5968 {
5970 }
5971
5972 if (ConfigIsExisting("headSelectionsToHide"))
5973 {
5976 }
5977
5979 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5980 {
5982 }
5983
5985
5986 m_IsResultOfSplit = false;
5987
5989 }
5990
5992 {
5993 super.InitItemVariables();
5994
6000 m_Count = ConfigGetInt(
"count");
6001
6004
6009
6012
6017
6029
6033
6034
6037 if (ConfigIsExisting("canBeSplit"))
6038 {
6041 }
6042
6044 if (ConfigIsExisting("itemBehaviour"))
6046
6047
6050 RegisterNetSyncVariableInt("m_VarLiquidType");
6051 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6052
6053 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6054 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6055 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6056
6057 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6058 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6059 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6060 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6061
6062 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6063 RegisterNetSyncVariableBool("m_IsTakeable");
6064 RegisterNetSyncVariableBool("m_IsHologram");
6065
6068 {
6071 }
6072
6074
6076 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6078
6079 }
6080
6082 {
6084 }
6085
6087 {
6090 {
6095 }
6096 }
6097
6098 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6099 {
6101 {
6104 }
6105
6107 }
6108
6110 {
6116 }
6117
6119
6121 {
6123
6124 if (!action)
6125 {
6126 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6127 return;
6128 }
6129
6131 if (!ai)
6132 {
6134 return;
6135 }
6136
6138 if (!action_array)
6139 {
6140 action_array = new array<ActionBase_Basic>;
6142 }
6143 if (LogManager.IsActionLogEnable())
6144 {
6145 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6146 }
6147
6148 if (action_array.Find(action) != -1)
6149 {
6150 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6151 }
6152 else
6153 {
6154 action_array.Insert(action);
6155 }
6156 }
6157
6159 {
6161 ActionBase action = player.GetActionManager().GetAction(actionName);
6164
6165 if (action_array)
6166 {
6167 action_array.RemoveItem(action);
6168 }
6169 }
6170
6171
6172
6174 {
6175 ActionOverrideData overrideData = new ActionOverrideData();
6179
6181 if (!actionMap)
6182 {
6185 }
6186
6187 actionMap.Insert(this.
Type(), overrideData);
6188
6189 }
6190
6192
6194
6195
6197 {
6200
6203
6204 string config_to_search = "CfgVehicles";
6205 string muzzle_owner_config;
6206
6208 {
6209 if (IsInherited(Weapon))
6210 config_to_search = "CfgWeapons";
6211
6212 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6213
6214 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6215
6217
6218 if (config_OnFire_subclass_count > 0)
6219 {
6220 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6221
6222 for (int i = 0; i < config_OnFire_subclass_count; i++)
6223 {
6224 string particle_class = "";
6226 string config_OnFire_entry = config_OnFire_class + particle_class;
6227 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6228 WPOF_array.Insert(WPOF);
6229 }
6230
6231
6233 }
6234 }
6235
6237 {
6238 config_to_search = "CfgWeapons";
6239 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6240
6241 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6242
6244
6245 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6246 {
6247 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6248
6249 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6250 {
6251 string particle_class2 = "";
6253 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6254 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6255 WPOBE_array.Insert(WPOBE);
6256 }
6257
6258
6260 }
6261 }
6262 }
6263
6264
6266 {
6269
6271 {
6272 string config_to_search = "CfgVehicles";
6273
6274 if (IsInherited(Weapon))
6275 config_to_search = "CfgWeapons";
6276
6277 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6278 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6279
6280 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6281 {
6282
6284
6286 {
6288 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6290 return;
6291 }
6292
6295
6296
6297
6299 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6300
6301 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6302 {
6303 string particle_class = "";
6305 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6307
6308 if (entry_type == CT_CLASS)
6309 {
6310 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6311 WPOOH_array.Insert(WPOF);
6312 }
6313 }
6314
6315
6317 }
6318 }
6319 }
6320
6322 {
6324 }
6325
6327 {
6329 {
6331
6334
6337
6338 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6339 }
6340 }
6341
6343 {
6345 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6346
6348 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6349
6351 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6352
6354 {
6356 }
6357 }
6358
6360 {
6362 }
6363
6365 {
6368 else
6370
6372 {
6375 }
6376 else
6377 {
6380
6383 }
6384
6386 }
6387
6389 {
6391 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6392 }
6393
6395 {
6397 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6399 }
6400
6402 {
6404 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6405 }
6406
6408 {
6411
6412 OverheatingParticle OP = new OverheatingParticle();
6417
6419 }
6420
6422 {
6425
6426 return -1;
6427 }
6428
6430 {
6432 {
6435
6436 for (int i = count; i > 0; --i)
6437 {
6438 int id = i - 1;
6441
6444
6445 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6446 {
6447 if (p)
6448 {
6451 }
6452 }
6453 }
6454 }
6455 }
6456
6458 {
6460 {
6462 {
6463 int id = i - 1;
6465
6466 if (OP)
6467 {
6469
6470 if (p)
6471 {
6473 }
6474
6475 delete OP;
6476 }
6477 }
6478
6481 }
6482 }
6483
6486 {
6487 return 0.0;
6488 }
6489
6490
6492 {
6493 return 250;
6494 }
6495
6497 {
6498 return 0;
6499 }
6500
6503 {
6505 return true;
6506
6507 return false;
6508 }
6509
6512 {
6515
6517 {
6519 }
6520 else
6521 {
6522
6524 }
6525
6527 }
6528
6535 {
6536 return -1;
6537 }
6538
6539
6540
6541
6543 {
6545 {
6547 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6548
6549 if (r_index >= 0)
6550 {
6551 InventoryLocation r_il = new InventoryLocation;
6552 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6553
6554 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6557 {
6558 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6559 }
6561 {
6562 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6563 }
6564
6565 }
6566
6567 player.GetHumanInventory().ClearUserReservedLocation(this);
6568 }
6569
6572 }
6573
6574
6575
6576
6578 {
6579 return ItemBase.m_DebugActionsMask;
6580 }
6581
6583 {
6584 return ItemBase.m_DebugActionsMask & mask;
6585 }
6586
6588 {
6589 ItemBase.m_DebugActionsMask = mask;
6590 }
6591
6593 {
6594 ItemBase.m_DebugActionsMask |= mask;
6595 }
6596
6598 {
6599 ItemBase.m_DebugActionsMask &= ~mask;
6600 }
6601
6603 {
6605 {
6607 }
6608 else
6609 {
6611 }
6612 }
6613
6614
6616 {
6617 if (GetEconomyProfile())
6618 {
6619 float q_max = GetEconomyProfile().GetQuantityMax();
6620 if (q_max > 0)
6621 {
6622 float q_min = GetEconomyProfile().GetQuantityMin();
6623 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6624
6626 {
6627 ComponentEnergyManager comp = GetCompEM();
6629 {
6631 }
6632 }
6634 {
6636
6637 }
6638
6639 }
6640 }
6641 }
6642
6645 {
6646 EntityAI parent = GetHierarchyParent();
6647
6648 if (parent)
6649 {
6650 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6651 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6652 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6653 }
6654 }
6655
6658 {
6659 EntityAI parent = GetHierarchyParent();
6660
6661 if (parent)
6662 {
6663 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6664 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6665 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6666 }
6667 }
6668
6670 {
6671
6672
6673
6674
6676
6678 {
6679 if (ScriptInputUserData.CanStoreInputUserData())
6680 {
6681 ScriptInputUserData ctx = new ScriptInputUserData;
6687 ctx.
Write(use_stack_max);
6690
6692 {
6693 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6694 }
6695 }
6696 }
6697 else if (!
GetGame().IsMultiplayer())
6698 {
6700 }
6701 }
6702
6704 {
6706 }
6707
6709 {
6711 }
6712
6714 {
6716 }
6717
6719 {
6720
6721 return false;
6722 }
6723
6725 {
6726 return false;
6727 }
6728
6732 {
6733 return false;
6734 }
6735
6737 {
6738 return "";
6739 }
6740
6742
6744 {
6745 return false;
6746 }
6747
6749 {
6750 return true;
6751 }
6752
6753
6754
6756 {
6757 return true;
6758 }
6759
6761 {
6762 return true;
6763 }
6764
6766 {
6767 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6769 }
6770
6772 {
6774 }
6775
6777 {
6779 if (!is_being_placed)
6781 SetSynchDirty();
6782 }
6783
6784
6786
6788 {
6790 }
6791
6793 {
6795 }
6796
6798 {
6799 return 1;
6800 }
6801
6803 {
6804 return false;
6805 }
6806
6808 {
6810 SetSynchDirty();
6811 }
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6848 {
6849 super.OnMovedInsideCargo(container);
6850
6851 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6852 }
6853
6854 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6855 {
6856 super.EEItemLocationChanged(oldLoc,newLoc);
6857
6858 PlayerBase new_player = null;
6859 PlayerBase old_player = null;
6860
6861 if (newLoc.GetParent())
6862 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6863
6864 if (oldLoc.GetParent())
6865 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6866
6868 {
6869 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6870
6871 if (r_index >= 0)
6872 {
6873 InventoryLocation r_il = new InventoryLocation;
6874 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6875
6876 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6879 {
6880 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6881 }
6883 {
6884 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6885 }
6886
6887 }
6888 }
6889
6891 {
6892 if (new_player)
6893 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6894
6895 if (new_player == old_player)
6896 {
6897
6898 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6899 {
6901 {
6902 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6903 {
6904 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6905 }
6906 }
6907 else
6908 {
6909 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6910 }
6911 }
6912
6913 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6914 {
6915 int type = oldLoc.GetType();
6917 {
6918 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6919 }
6921 {
6922 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6923 }
6924 }
6925 if (!m_OldLocation)
6926 {
6927 m_OldLocation = new InventoryLocation;
6928 }
6929 m_OldLocation.Copy(oldLoc);
6930 }
6931 else
6932 {
6933 if (m_OldLocation)
6934 {
6935 m_OldLocation.Reset();
6936 }
6937 }
6938
6940 }
6941 else
6942 {
6943 if (new_player)
6944 {
6945 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6946 if (res_index >= 0)
6947 {
6948 InventoryLocation il = new InventoryLocation;
6949 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6951 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6954 {
6955 il.
GetParent().GetOnReleaseLock().Invoke(it);
6956 }
6958 {
6960 }
6961
6962 }
6963 }
6965 {
6966
6968 }
6969
6970 if (m_OldLocation)
6971 {
6972 m_OldLocation.Reset();
6973 }
6974 }
6975 }
6976
6977 override void EOnContact(IEntity other, Contact extra)
6978 {
6980 {
6981 int liquidType = -1;
6983 if (impactSpeed > 0.0)
6984 {
6986 #ifndef SERVER
6988 #else
6990 SetSynchDirty();
6991 #endif
6993 }
6994 }
6995
6996 #ifdef SERVER
6997 if (GetCompEM() && GetCompEM().IsPlugged())
6998 {
6999 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7000 GetCompEM().UnplugThis();
7001 }
7002 #endif
7003 }
7004
7006
7008 {
7010 }
7011
7013 {
7014
7015 }
7016
7018 {
7019 super.OnItemLocationChanged(old_owner, new_owner);
7020
7021 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7022 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7023
7024 if (!relatedPlayer && playerNew)
7025 relatedPlayer = playerNew;
7026
7027 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7028 {
7030 if (actionMgr)
7031 {
7032 ActionBase currentAction = actionMgr.GetRunningAction();
7033 if (currentAction)
7035 }
7036 }
7037
7038 Man ownerPlayerOld = null;
7039 Man ownerPlayerNew = null;
7040
7041 if (old_owner)
7042 {
7043 if (old_owner.
IsMan())
7044 {
7045 ownerPlayerOld = Man.Cast(old_owner);
7046 }
7047 else
7048 {
7049 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7050 }
7051 }
7052 else
7053 {
7055 {
7057
7058 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7059 {
7060 GetCompEM().UnplugThis();
7061 }
7062 }
7063 }
7064
7065 if (new_owner)
7066 {
7067 if (new_owner.
IsMan())
7068 {
7069 ownerPlayerNew = Man.Cast(new_owner);
7070 }
7071 else
7072 {
7073 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7074 }
7075 }
7076
7077 if (ownerPlayerOld != ownerPlayerNew)
7078 {
7079 if (ownerPlayerOld)
7080 {
7081 array<EntityAI> subItemsExit = new array<EntityAI>;
7083 for (int i = 0; i < subItemsExit.Count(); i++)
7084 {
7087 }
7088 }
7089
7090 if (ownerPlayerNew)
7091 {
7092 array<EntityAI> subItemsEnter = new array<EntityAI>;
7094 for (int j = 0; j < subItemsEnter.Count(); j++)
7095 {
7098 }
7099 }
7100 }
7101 else if (ownerPlayerNew != null)
7102 {
7103 PlayerBase nplayer;
7104 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7105 {
7106 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7108 for (int k = 0; k < subItemsUpdate.Count(); k++)
7109 {
7111 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7112 }
7113 }
7114 }
7115
7116 if (old_owner)
7117 old_owner.OnChildItemRemoved(this);
7118 if (new_owner)
7119 new_owner.OnChildItemReceived(this);
7120 }
7121
7122
7124 {
7125 super.EEDelete(parent);
7126 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7127 if (player)
7128 {
7130
7131 if (player.IsAlive())
7132 {
7133 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7134 if (r_index >= 0)
7135 {
7136 InventoryLocation r_il = new InventoryLocation;
7137 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7138
7139 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7142 {
7143 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7144 }
7146 {
7147 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7148 }
7149
7150 }
7151
7152 player.RemoveQuickBarEntityShortcut(this);
7153 }
7154 }
7155 }
7156
7158 {
7159 super.EEKilled(killer);
7160
7163 {
7164 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7165 {
7166 if (IsMagazine())
7167 {
7168 if (Magazine.Cast(this).GetAmmoCount() > 0)
7169 {
7171 }
7172 }
7173 else
7174 {
7176 }
7177 }
7178 }
7179 }
7180
7182 {
7183 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7184
7185 super.OnWasAttached(parent, slot_id);
7186
7189
7191 }
7192
7194 {
7195 super.OnWasDetached(parent, slot_id);
7196
7199 }
7200
7202 {
7203 int idx;
7206
7207 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7208 if (inventory_slots.Count() < 1)
7209 {
7210 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7211 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7212 }
7213 else
7214 {
7215 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7216 }
7217
7218 idx = inventory_slots.Find(slot);
7219 if (idx < 0)
7220 return "";
7221
7222 return attach_types.Get(idx);
7223 }
7224
7226 {
7227 int idx = -1;
7228 string slot;
7229
7232
7233 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7234 if (inventory_slots.Count() < 1)
7235 {
7236 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7237 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7238 }
7239 else
7240 {
7241 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7242 if (detach_types.Count() < 1)
7243 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7244 }
7245
7246 for (int i = 0; i < inventory_slots.Count(); i++)
7247 {
7248 slot = inventory_slots.Get(i);
7249 }
7250
7251 if (slot != "")
7252 {
7253 if (detach_types.Count() == 1)
7254 idx = 0;
7255 else
7256 idx = inventory_slots.Find(slot);
7257 }
7258 if (idx < 0)
7259 return "";
7260
7261 return detach_types.Get(idx);
7262 }
7263
7265 {
7266
7268
7269
7270 float min_time = 1;
7271 float max_time = 3;
7272 float delay = Math.RandomFloat(min_time, max_time);
7273
7274 explode_timer.Run(delay, this, "DoAmmoExplosion");
7275 }
7276
7278 {
7279 Magazine magazine = Magazine.Cast(this);
7280 int pop_sounds_count = 6;
7281 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7282
7283
7284 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7285 string sound_name = pop_sounds[ sound_idx ];
7287
7288
7289 magazine.ServerAddAmmoCount(-1);
7290
7291
7292 float min_temp_to_explode = 100;
7293
7294 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
7295 {
7297 }
7298 }
7299
7300
7301 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7302 {
7303 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7304
7305 const int CHANCE_DAMAGE_CARGO = 4;
7306 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7307 const int CHANCE_DAMAGE_NOTHING = 2;
7308
7310 {
7311 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7312 int chances;
7313 int rnd;
7314
7315 if (GetInventory().GetCargo())
7316 {
7317 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7318 rnd = Math.RandomInt(0,chances);
7319
7320 if (rnd < CHANCE_DAMAGE_CARGO)
7321 {
7323 }
7324 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7325 {
7327 }
7328 }
7329 else
7330 {
7331 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7332 rnd = Math.RandomInt(0,chances);
7333
7334 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7335 {
7337 }
7338 }
7339 }
7340 }
7341
7343 {
7344 if (GetInventory().GetCargo())
7345 {
7346 int item_count = GetInventory().GetCargo().GetItemCount();
7347 if (item_count > 0)
7348 {
7349 int random_pick = Math.RandomInt(0, item_count);
7351 if (!item.IsExplosive())
7352 {
7353 item.AddHealth("","",damage);
7354 return true;
7355 }
7356 }
7357 }
7358 return false;
7359 }
7360
7362 {
7363 int attachment_count = GetInventory().AttachmentCount();
7364 if (attachment_count > 0)
7365 {
7366 int random_pick = Math.RandomInt(0, attachment_count);
7367 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7368 if (!attachment.IsExplosive())
7369 {
7370 attachment.AddHealth("","",damage);
7371 return true;
7372 }
7373 }
7374 return false;
7375 }
7376
7378 {
7380 }
7381
7383 {
7385 return GetInventory().CanRemoveEntity();
7386
7387 return false;
7388 }
7389
7391 {
7392
7394 return false;
7395
7396
7398 return false;
7399
7400
7401
7403 if (delta == 0)
7404 return false;
7405
7406
7407 return true;
7408 }
7409
7411 {
7413 {
7414 if (ScriptInputUserData.CanStoreInputUserData())
7415 {
7416 ScriptInputUserData ctx = new ScriptInputUserData;
7421 ctx.
Write(destination_entity);
7425 }
7426 }
7427 else if (!
GetGame().IsMultiplayer())
7428 {
7430 }
7431 }
7432
7434 {
7435 float split_quantity_new;
7439 InventoryLocation loc = new InventoryLocation;
7440
7441 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7442 {
7444 split_quantity_new = stack_max;
7445 else
7447
7449 {
7450 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7451 if (new_item)
7452 {
7453 new_item.SetResultOfSplit(true);
7454 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7456 new_item.
SetQuantity(split_quantity_new,
false,
true);
7457 }
7458 }
7459 }
7460 else if (destination_entity && slot_id == -1)
7461 {
7462 if (quantity > stack_max)
7463 split_quantity_new = stack_max;
7464 else
7465 split_quantity_new = quantity;
7466
7468 {
7470 {
7473 }
7474
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
7485 {
7486 if (stack_max != 0)
7487 {
7489 {
7491 }
7492
7493 if (split_quantity_new == 0)
7494 {
7495 if (!
GetGame().IsMultiplayer())
7496 player.PhysicalPredictiveDropItem(this);
7497 else
7498 player.ServerDropEntity(this);
7499 return;
7500 }
7501
7503 {
7505
7506 if (new_item)
7507 {
7508 new_item.SetResultOfSplit(true);
7509 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7512 new_item.PlaceOnSurface();
7513 }
7514 }
7515 }
7516 }
7517 }
7518
7520 {
7521 float split_quantity_new;
7525 InventoryLocation loc = new InventoryLocation;
7526
7527 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7528 {
7530 split_quantity_new = stack_max;
7531 else
7533
7535 {
7536 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7537 if (new_item)
7538 {
7539 new_item.SetResultOfSplit(true);
7540 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7542 new_item.
SetQuantity(split_quantity_new,
false,
true);
7543 }
7544 }
7545 }
7546 else if (destination_entity && slot_id == -1)
7547 {
7548 if (quantity > stack_max)
7549 split_quantity_new = stack_max;
7550 else
7551 split_quantity_new = quantity;
7552
7554 {
7556 {
7559 }
7560
7561 if (new_item)
7562 {
7563 new_item.SetResultOfSplit(true);
7564 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7566 new_item.
SetQuantity(split_quantity_new,
false,
true);
7567 }
7568 }
7569 }
7570 else
7571 {
7572 if (stack_max != 0)
7573 {
7575 {
7577 }
7578
7580 {
7582
7583 if (new_item)
7584 {
7585 new_item.SetResultOfSplit(true);
7586 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7589 new_item.PlaceOnSurface();
7590 }
7591 }
7592 }
7593 }
7594 }
7595
7597 {
7599 {
7600 if (ScriptInputUserData.CanStoreInputUserData())
7601 {
7602 ScriptInputUserData ctx = new ScriptInputUserData;
7607 dst.WriteToContext(ctx);
7609 }
7610 }
7611 else if (!
GetGame().IsMultiplayer())
7612 {
7614 }
7615 }
7616
7618 {
7620 {
7621 if (ScriptInputUserData.CanStoreInputUserData())
7622 {
7623 ScriptInputUserData ctx = new ScriptInputUserData;
7628 ctx.
Write(destination_entity);
7634 }
7635 }
7636 else if (!
GetGame().IsMultiplayer())
7637 {
7639 }
7640 }
7641
7643 {
7645 }
7646
7648 {
7650 float split_quantity_new;
7652 if (dst.IsValid())
7653 {
7654 int slot_id = dst.GetSlot();
7656
7657 if (quantity > stack_max)
7658 split_quantity_new = stack_max;
7659 else
7660 split_quantity_new = quantity;
7661
7663 {
7665
7666 if (new_item)
7667 {
7668 new_item.SetResultOfSplit(true);
7669 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7671 new_item.
SetQuantity(split_quantity_new,
false,
true);
7672 }
7673
7674 return new_item;
7675 }
7676 }
7677
7678 return null;
7679 }
7680
7682 {
7684 float split_quantity_new;
7686 if (destination_entity)
7687 {
7689 if (quantity > stackable)
7690 split_quantity_new = stackable;
7691 else
7692 split_quantity_new = quantity;
7693
7695 {
7696 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7697 if (new_item)
7698 {
7699 new_item.SetResultOfSplit(true);
7700 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7702 new_item.
SetQuantity(split_quantity_new,
false,
true);
7703 }
7704 }
7705 }
7706 }
7707
7709 {
7711 {
7712 if (ScriptInputUserData.CanStoreInputUserData())
7713 {
7714 ScriptInputUserData ctx = new ScriptInputUserData;
7719 ItemBase destination_entity =
this;
7720 ctx.
Write(destination_entity);
7724 }
7725 }
7726 else if (!
GetGame().IsMultiplayer())
7727 {
7729 }
7730 }
7731
7733 {
7735 float split_quantity_new;
7737 if (player)
7738 {
7740 if (quantity > stackable)
7741 split_quantity_new = stackable;
7742 else
7743 split_quantity_new = quantity;
7744
7746 {
7747 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7748 new_item =
ItemBase.Cast(in_hands);
7749 if (new_item)
7750 {
7751 new_item.SetResultOfSplit(true);
7752 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7754 new_item.SetQuantity(split_quantity_new, false, true);
7755 }
7756 }
7757 }
7758 }
7759
7761 {
7763 float split_quantity_new = Math.Floor(quantity * 0.5);
7764
7766 return;
7767
7769
7770 if (new_item)
7771 {
7772 if (new_item.GetQuantityMax() < split_quantity_new)
7773 {
7774 split_quantity_new = new_item.GetQuantityMax();
7775 }
7776
7777 new_item.SetResultOfSplit(true);
7778 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7779
7781 {
7784 }
7785 else
7786 {
7788 new_item.
SetQuantity(split_quantity_new,
false,
true);
7789 }
7790 }
7791 }
7792
7794 {
7796 float split_quantity_new = Math.Floor(quantity / 2);
7797
7799 return;
7800
7801 InventoryLocation invloc = new InventoryLocation;
7803
7805 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7806
7807 if (new_item)
7808 {
7809 if (new_item.GetQuantityMax() < split_quantity_new)
7810 {
7811 split_quantity_new = new_item.GetQuantityMax();
7812 }
7814 {
7817 }
7818 else if (split_quantity_new > 1)
7819 {
7821 new_item.
SetQuantity(split_quantity_new,
false,
true);
7822 }
7823 }
7824 }
7825
7828 {
7829 SetWeightDirty();
7831
7832 if (parent)
7833 parent.OnAttachmentQuantityChangedEx(this, delta);
7834
7836 {
7838 {
7840 }
7842 {
7843 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7845 }
7846 }
7847
7848 }
7849
7852 {
7853
7854 }
7855
7858 {
7860 }
7861
7863 {
7864 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7865
7867 {
7868 if (newLevel == GameConstants.STATE_RUINED)
7869 {
7871 EntityAI parent = GetHierarchyParent();
7872 if (parent && parent.IsFireplace())
7873 {
7874 CargoBase cargo = GetInventory().GetCargo();
7875 if (cargo)
7876 {
7878 {
7880 }
7881 }
7882 }
7883 }
7884
7886 {
7887
7889 return;
7890 }
7891
7892 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7893 {
7895 }
7896 }
7897 }
7898
7899
7901 {
7902 super.OnRightClick();
7903
7905 {
7907 {
7908 if (ScriptInputUserData.CanStoreInputUserData())
7909 {
7910 EntityAI root = GetHierarchyRoot();
7911 Man playerOwner = GetHierarchyRootPlayer();
7912 InventoryLocation dst = new InventoryLocation;
7913
7914
7915 if (!playerOwner && root && root == this)
7916 {
7918 }
7919 else
7920 {
7921
7922 GetInventory().GetCurrentInventoryLocation(dst);
7924 {
7927 {
7929 }
7930 else
7931 {
7933
7934
7935 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7936 {
7938 }
7939 else
7940 {
7941 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7942 }
7943 }
7944 }
7945 }
7946
7947 ScriptInputUserData ctx = new ScriptInputUserData;
7955 }
7956 }
7957 else if (!
GetGame().IsMultiplayer())
7958 {
7960 }
7961 }
7962 }
7963
7965 {
7966 if (root)
7967 {
7968 vector m4[4];
7969 root.GetTransform(m4);
7970 dst.SetGround(this, m4);
7971 }
7972 else
7973 {
7974 GetInventory().GetCurrentInventoryLocation(dst);
7975 }
7976 }
7977
7978 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7979 {
7980
7981 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7982 return false;
7983
7984 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7985 return false;
7986
7987
7989 return false;
7990
7991
7992 Magazine mag = Magazine.Cast(this);
7993 if (mag)
7994 {
7995 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7996 return false;
7997
7998 if (stack_max_limit)
7999 {
8000 Magazine other_mag = Magazine.Cast(other_item);
8001 if (other_item)
8002 {
8003 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8004 return false;
8005 }
8006
8007 }
8008 }
8009 else
8010 {
8011
8013 return false;
8014
8016 return false;
8017 }
8018
8019 PlayerBase player = null;
8020 if (CastTo(player, GetHierarchyRootPlayer()))
8021 {
8022 if (player.GetInventory().HasAttachment(this))
8023 return false;
8024
8025 if (player.IsItemsToDelete())
8026 return false;
8027 }
8028
8029 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8030 return false;
8031
8032 int slotID;
8034 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8035 return false;
8036
8037 return true;
8038 }
8039
8041 {
8043 }
8044
8046 {
8047 return m_IsResultOfSplit;
8048 }
8049
8051 {
8052 m_IsResultOfSplit = value;
8053 }
8054
8056 {
8058 }
8059
8061 {
8062 float other_item_quantity = other_item.GetQuantity();
8063 float this_free_space;
8064
8066
8068
8069 if (other_item_quantity > this_free_space)
8070 {
8071 return this_free_space;
8072 }
8073 else
8074 {
8075 return other_item_quantity;
8076 }
8077 }
8078
8080 {
8082 }
8083
8085 {
8087 return;
8088
8089 if (!IsMagazine() && other_item)
8090 {
8092 if (quantity_used != 0)
8093 {
8094 float hp1 = GetHealth01("","");
8095 float hp2 = other_item.GetHealth01("","");
8096 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8097 hpResult = hpResult / (
GetQuantity() + quantity_used);
8098
8099 hpResult *= GetMaxHealth();
8100 Math.Round(hpResult);
8101 SetHealth("", "Health", hpResult);
8102
8104 other_item.AddQuantity(-quantity_used);
8105 }
8106 }
8108 }
8109
8111 {
8112 #ifdef SERVER
8113 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8114 GetHierarchyParent().IncreaseLifetimeUp();
8115 #endif
8116 };
8117
8119 {
8120 PlayerBase p = PlayerBase.Cast(player);
8121
8122 array<int> recipesIds = p.m_Recipes;
8123 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8124 if (moduleRecipesManager)
8125 {
8126 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8127 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8128 }
8129
8130 for (int i = 0;i < recipesIds.Count(); i++)
8131 {
8132 int key = recipesIds.Get(i);
8133 string recipeName = moduleRecipesManager.GetRecipeName(key);
8135 }
8136 }
8137
8138
8139 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8140 {
8141 super.GetDebugActions(outputList);
8142
8143
8149
8150
8155
8160
8161
8165
8166
8168 {
8172 }
8173
8176
8177
8181
8183
8184 InventoryLocation loc = new InventoryLocation();
8185 GetInventory().GetCurrentInventoryLocation(loc);
8187 {
8188 if (Gizmo_IsSupported())
8191 }
8192
8194 }
8195
8196
8197
8198
8200 {
8201 super.OnAction(action_id, player, ctx);
8202
8204 {
8205 switch (action_id)
8206 {
8209 return true;
8212 return true;
8213 }
8214 }
8215
8217 {
8218 switch (action_id)
8219 {
8221 Delete();
8222 return true;
8223 }
8224 }
8225
8226 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8227 {
8228 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8229 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8230 PlayerBase p = PlayerBase.Cast(player);
8231 if (
EActions.RECIPES_RANGE_START < 1000)
8232 {
8233 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8234 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8235 }
8236 }
8237 #ifndef SERVER
8238 else if (action_id ==
EActions.WATCH_PLAYER)
8239 {
8240 PluginDeveloper.SetDeveloperItemClientEx(player);
8241 }
8242 #endif
8244 {
8245 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8246 {
8247 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8248 OnDebugButtonPressServer(id + 1);
8249 }
8250
8251 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8252 {
8253 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8255 }
8256
8257 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8258 {
8259 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8261 }
8262
8263 else if (action_id ==
EActions.ADD_QUANTITY)
8264 {
8265 if (IsMagazine())
8266 {
8267 Magazine mag = Magazine.Cast(this);
8268 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8269 }
8270 else
8271 {
8273 }
8274
8275 if (m_EM)
8276 {
8277 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8278 }
8279
8280 }
8281
8282 else if (action_id ==
EActions.REMOVE_QUANTITY)
8283 {
8284 if (IsMagazine())
8285 {
8286 Magazine mag2 = Magazine.Cast(this);
8287 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8288 }
8289 else
8290 {
8292 }
8293 if (m_EM)
8294 {
8295 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8296 }
8297
8298 }
8299
8300 else if (action_id ==
EActions.SET_QUANTITY_0)
8301 {
8303
8304 if (m_EM)
8305 {
8306 m_EM.SetEnergy(0);
8307 }
8308 }
8309
8310 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8311 {
8313
8314 if (m_EM)
8315 {
8316 m_EM.SetEnergy(m_EM.GetEnergyMax());
8317 }
8318 }
8319
8320 else if (action_id ==
EActions.ADD_HEALTH)
8321 {
8322 AddHealth("","",GetMaxHealth("","Health")/5);
8323 }
8324 else if (action_id ==
EActions.REMOVE_HEALTH)
8325 {
8326 AddHealth("","",-GetMaxHealth("","Health")/5);
8327 }
8328 else if (action_id ==
EActions.DESTROY_HEALTH)
8329 {
8330 SetHealth01("","",0);
8331 }
8332 else if (action_id ==
EActions.WATCH_ITEM)
8333 {
8335 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8336 #ifdef DEVELOPER
8337 SetDebugDeveloper_item(this);
8338 #endif
8339 }
8340
8341 else if (action_id ==
EActions.ADD_TEMPERATURE)
8342 {
8343 AddTemperature(20);
8344
8345 }
8346
8347 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8348 {
8349 AddTemperature(-20);
8350
8351 }
8352
8353 else if (action_id ==
EActions.FLIP_FROZEN)
8354 {
8355 SetFrozen(!GetIsFrozen());
8356
8357 }
8358
8359 else if (action_id ==
EActions.ADD_WETNESS)
8360 {
8362
8363 }
8364
8365 else if (action_id ==
EActions.REMOVE_WETNESS)
8366 {
8368
8369 }
8370
8371 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8372 {
8375
8376
8377 }
8378
8379 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8380 {
8383 }
8384
8385 else if (action_id ==
EActions.MAKE_SPECIAL)
8386 {
8387 auto debugParams = DebugSpawnParams.WithPlayer(player);
8388 OnDebugSpawnEx(debugParams);
8389 }
8390
8391 }
8392
8393
8394 return false;
8395 }
8396
8397
8398
8399
8403
8406
8407
8408
8410 {
8411 return false;
8412 }
8413
8414
8416 {
8417 return true;
8418 }
8419
8420
8422 {
8423 return true;
8424 }
8425
8426
8427
8429 {
8430 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8432 }
8433
8436 {
8437 return null;
8438 }
8439
8441 {
8442 return false;
8443 }
8444
8446 {
8447 return false;
8448 }
8449
8453
8454
8456 {
8457 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8458 return module_repairing.CanRepair(this, item_repair_kit);
8459 }
8460
8461
8462 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8463 {
8464 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8465 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8466 }
8467
8468
8470 {
8471
8472
8473
8474
8475
8476
8477
8478
8479 return 1;
8480 }
8481
8482
8483
8485 {
8487 }
8488
8489
8490
8492 {
8494 }
8495
8496
8505 {
8506 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8507
8508 if (player)
8509 {
8510 player.MessageStatus(text);
8511 }
8512 }
8513
8514
8523 {
8524 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8525
8526 if (player)
8527 {
8528 player.MessageAction(text);
8529 }
8530 }
8531
8532
8541 {
8542 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8543
8544 if (player)
8545 {
8546 player.MessageFriendly(text);
8547 }
8548 }
8549
8550
8559 {
8560 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8561
8562 if (player)
8563 {
8564 player.MessageImportant(text);
8565 }
8566 }
8567
8569 {
8570 return true;
8571 }
8572
8573
8574 override bool KindOf(
string tag)
8575 {
8576 bool found = false;
8577 string item_name = this.
GetType();
8580
8581 int array_size = item_tag_array.Count();
8582 for (int i = 0; i < array_size; i++)
8583 {
8584 if (item_tag_array.Get(i) == tag)
8585 {
8586 found = true;
8587 break;
8588 }
8589 }
8590 return found;
8591 }
8592
8593
8595 {
8596
8597 super.OnRPC(sender, rpc_type,ctx);
8598
8599
8600 switch (rpc_type)
8601 {
8602 #ifndef SERVER
8603 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8604 Param2<bool, string> p = new Param2<bool, string>(false, "");
8605
8607 return;
8608
8609 bool play = p.param1;
8610 string soundSet = p.param2;
8611
8612 if (play)
8613 {
8615 {
8617 {
8619 }
8620 }
8621 else
8622 {
8624 }
8625 }
8626 else
8627 {
8629 }
8630
8631 break;
8632 #endif
8633
8634 }
8635
8637 {
8639 }
8640 }
8641
8642
8643
8644
8646 {
8647 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8648 return plugin.GetID(
name);
8649 }
8650
8652 {
8653 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8654 return plugin.GetName(id);
8655 }
8656
8659 {
8660
8661
8662 int varFlags;
8663 if (!ctx.
Read(varFlags))
8664 return;
8665
8666 if (varFlags & ItemVariableFlags.FLOAT)
8667 {
8669 }
8670 }
8671
8673 {
8674
8675 super.SerializeNumericalVars(floats_out);
8676
8677
8678
8680 {
8682 }
8683
8685 {
8687 }
8688
8690 {
8692 }
8693
8695 {
8700 }
8701
8703 {
8705 }
8706 }
8707
8709 {
8710
8711 super.DeSerializeNumericalVars(floats);
8712
8713
8714 int index = 0;
8715 int mask = Math.Round(floats.Get(index));
8716
8717 index++;
8718
8720 {
8722 {
8724 }
8725 else
8726 {
8727 float quantity = floats.Get(index);
8729 }
8730 index++;
8731 }
8732
8734 {
8735 float wet = floats.Get(index);
8737 index++;
8738 }
8739
8741 {
8742 int liquidtype = Math.Round(floats.Get(index));
8744 index++;
8745 }
8746
8748 {
8750 index++;
8752 index++;
8754 index++;
8756 index++;
8757 }
8758
8760 {
8761 int cleanness = Math.Round(floats.Get(index));
8763 index++;
8764 }
8765 }
8766
8768 {
8769 super.WriteVarsToCTX(ctx);
8770
8771
8773 {
8775 }
8776
8778 {
8780 }
8781
8783 {
8785 }
8786
8788 {
8789 int r,g,b,a;
8795 }
8796
8798 {
8800 }
8801 }
8802
8804 {
8805 if (!super.ReadVarsFromCTX(ctx,version))
8806 return false;
8807
8808 int intValue;
8809 float value;
8810
8811 if (version < 140)
8812 {
8813 if (!ctx.
Read(intValue))
8814 return false;
8815
8816 m_VariablesMask = intValue;
8817 }
8818
8820 {
8821 if (!ctx.
Read(value))
8822 return false;
8823
8825 {
8827 }
8828 else
8829 {
8831 }
8832 }
8833
8834 if (version < 140)
8835 {
8837 {
8838 if (!ctx.
Read(value))
8839 return false;
8840 SetTemperatureDirect(value);
8841 }
8842 }
8843
8845 {
8846 if (!ctx.
Read(value))
8847 return false;
8849 }
8850
8852 {
8853 if (!ctx.
Read(intValue))
8854 return false;
8856 }
8857
8859 {
8860 int r,g,b,a;
8862 return false;
8864 return false;
8866 return false;
8868 return false;
8869
8871 }
8872
8874 {
8875 if (!ctx.
Read(intValue))
8876 return false;
8878 }
8879
8880 if (version >= 138 && version < 140)
8881 {
8883 {
8884 if (!ctx.
Read(intValue))
8885 return false;
8886 SetFrozen(intValue);
8887 }
8888 }
8889
8890 return true;
8891 }
8892
8893
8895 {
8898 {
8900 }
8901
8902 if (!super.OnStoreLoad(ctx, version))
8903 {
8905 return false;
8906 }
8907
8908 if (version >= 114)
8909 {
8910 bool hasQuickBarIndexSaved;
8911
8912 if (!ctx.
Read(hasQuickBarIndexSaved))
8913 {
8915 return false;
8916 }
8917
8918 if (hasQuickBarIndexSaved)
8919 {
8920 int itmQBIndex;
8921
8922
8923 if (!ctx.
Read(itmQBIndex))
8924 {
8926 return false;
8927 }
8928
8929 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8930 if (itmQBIndex != -1 && parentPlayer)
8931 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8932 }
8933 }
8934 else
8935 {
8936
8937 PlayerBase player;
8938 int itemQBIndex;
8939 if (version ==
int.
MAX)
8940 {
8941 if (!ctx.
Read(itemQBIndex))
8942 {
8944 return false;
8945 }
8946 }
8947 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8948 {
8949
8950 if (!ctx.
Read(itemQBIndex))
8951 {
8953 return false;
8954 }
8955 if (itemQBIndex != -1 && player)
8956 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8957 }
8958 }
8959
8960 if (version < 140)
8961 {
8962
8963 if (!LoadVariables(ctx, version))
8964 {
8966 return false;
8967 }
8968 }
8969
8970
8972 {
8974 return false;
8975 }
8976 if (version >= 132)
8977 {
8979 if (raib)
8980 {
8982 {
8984 return false;
8985 }
8986 }
8987 }
8988
8990 return true;
8991 }
8992
8993
8994
8996 {
8997 super.OnStoreSave(ctx);
8998
8999 PlayerBase player;
9000 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9001 {
9003
9004 int itemQBIndex = -1;
9005 itemQBIndex = player.FindQuickBarEntityIndex(this);
9006 ctx.
Write(itemQBIndex);
9007 }
9008 else
9009 {
9011 }
9012
9014
9016 if (raib)
9017 {
9019 }
9020 }
9021
9022
9024 {
9025 super.AfterStoreLoad();
9026
9028 {
9030 }
9031
9033 {
9036 }
9037 }
9038
9040 {
9041 super.EEOnAfterLoad();
9042
9044 {
9046 }
9047
9050 }
9051
9053 {
9054 return false;
9055 }
9056
9057
9058
9060 {
9062 {
9063 #ifdef PLATFORM_CONSOLE
9064
9066 {
9068 if (menu)
9069 {
9071 }
9072 }
9073 #endif
9074 }
9075
9077 {
9080 }
9081
9083 {
9084 SetWeightDirty();
9086 }
9088 {
9091 }
9092
9094 {
9097 }
9099 {
9102 }
9103
9104 super.OnVariablesSynchronized();
9105 }
9106
9107
9108
9110 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9111 {
9112 if (!IsServerCheck(allow_client))
9113 return false;
9114
9116 return false;
9117
9120
9121 if (value <= (min + 0.001))
9122 value = min;
9123
9124 if (value == min)
9125 {
9126 if (destroy_config)
9127 {
9128 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9129 if (dstr)
9130 {
9132 this.Delete();
9133 return true;
9134 }
9135 }
9136 else if (destroy_forced)
9137 {
9139 this.Delete();
9140 return true;
9141 }
9142
9144 }
9145
9148
9150 {
9152
9153 if (delta)
9155 }
9156
9158
9159 return false;
9160 }
9161
9162
9164 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9165 {
9167 }
9168
9170 {
9173 }
9174
9176 {
9179 }
9180
9182 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9183 {
9184 float value_clamped = Math.Clamp(value, 0, 1);
9186 SetQuantity(result, destroy_config, destroy_forced);
9187 }
9188
9189
9192 {
9194 }
9195
9197 {
9199 }
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9211 {
9212 int slot = -1;
9213 if (GetInventory())
9214 {
9215 InventoryLocation il = new InventoryLocation;
9216 GetInventory().GetCurrentInventoryLocation(il);
9218 }
9219
9221 }
9222
9224 {
9225 float quantity_max = 0;
9226
9228 {
9229 if (attSlotID != -1)
9230 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9231
9232 if (quantity_max <= 0)
9234 }
9235
9236 if (quantity_max <= 0)
9238
9239 return quantity_max;
9240 }
9241
9243 {
9245 }
9246
9248 {
9250 }
9251
9252
9254 {
9256 }
9257
9259 {
9261 }
9262
9264 {
9266 }
9267
9268
9270 {
9271
9272 float weightEx = GetWeightEx();
9273 float special = GetInventoryAndCargoWeight();
9274 return weightEx - special;
9275 }
9276
9277
9279 {
9281 }
9282
9284 {
9286 {
9287 #ifdef DEVELOPER
9288 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9289 {
9290 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9292 }
9293 #endif
9294
9296 }
9297 else if (HasEnergyManager())
9298 {
9299 #ifdef DEVELOPER
9300 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9301 {
9302 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9303 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9304 }
9305 #endif
9306 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
9307 }
9308 else
9309 {
9310 #ifdef DEVELOPER
9311 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9312 {
9313 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9314 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9315 }
9316 #endif
9317 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9318 }
9319 }
9320
9323 {
9324 int item_count = 0;
9326
9327 if (GetInventory().GetCargo() != NULL)
9328 {
9329 item_count = GetInventory().GetCargo().GetItemCount();
9330 }
9331
9332 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9333 {
9334 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9335 if (item)
9336 item_count += item.GetNumberOfItems();
9337 }
9338 return item_count;
9339 }
9340
9343 {
9344 float weight = 0;
9345 float wetness = 1;
9346 if (include_wetness)
9349 {
9350 weight = wetness * m_ConfigWeight;
9351 }
9353 {
9354 weight = 1;
9355 }
9356 return weight;
9357 }
9358
9359
9360
9362 {
9363 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9364 {
9365 GameInventory inv = GetInventory();
9366 array<EntityAI> items = new array<EntityAI>;
9368 for (int i = 0; i < items.Count(); i++)
9369 {
9371 if (item)
9372 {
9374 }
9375 }
9376 }
9377 }
9378
9379
9380
9381
9383 {
9384 float energy = 0;
9385 if (HasEnergyManager())
9386 {
9387 energy = GetCompEM().GetEnergy();
9388 }
9389 return energy;
9390 }
9391
9392
9394 {
9395 super.OnEnergyConsumed();
9396
9398 }
9399
9401 {
9402 super.OnEnergyAdded();
9403
9405 }
9406
9407
9409 {
9410 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9411 {
9413 {
9414 float energy_0to1 = GetCompEM().GetEnergy0To1();
9416 }
9417 }
9418 }
9419
9420
9422 {
9423 return ConfigGetFloat("heatIsolation");
9424 }
9425
9427 {
9429 }
9430
9432 {
9433 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9434 if (
GetGame().ConfigIsExisting(paramPath))
9436
9437 return 0.0;
9438 }
9439
9441 {
9442 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9443 if (
GetGame().ConfigIsExisting(paramPath))
9445
9446 return 0.0;
9447 }
9448
9449 override void SetWet(
float value,
bool allow_client =
false)
9450 {
9451 if (!IsServerCheck(allow_client))
9452 return;
9453
9456
9458
9459 m_VarWet = Math.Clamp(value, min, max);
9460
9462 {
9465 }
9466 }
9467
9468 override void AddWet(
float value)
9469 {
9471 }
9472
9474 {
9476 }
9477
9479 {
9481 }
9482
9484 {
9486 }
9487
9489 {
9491 }
9492
9494 {
9496 }
9497
9499 {
9502 if (newLevel != oldLevel)
9503 {
9505 }
9506 }
9507
9509 {
9510 SetWeightDirty();
9511 }
9512
9514 {
9515 return GetWetLevelInternal(
m_VarWet);
9516 }
9517
9518
9519
9521 {
9523 }
9524
9526 {
9528 }
9529
9531 {
9533 }
9534
9536 {
9538 }
9539
9540
9541
9543 {
9544 if (ConfigIsExisting("itemModelLength"))
9545 {
9546 return ConfigGetFloat("itemModelLength");
9547 }
9548 return 0;
9549 }
9550
9552 {
9553 if (ConfigIsExisting("itemAttachOffset"))
9554 {
9555 return ConfigGetFloat("itemAttachOffset");
9556 }
9557 return 0;
9558 }
9559
9560 override void SetCleanness(
int value,
bool allow_client =
false)
9561 {
9562 if (!IsServerCheck(allow_client))
9563 return;
9564
9566
9568
9571 }
9572
9574 {
9576 }
9577
9579 {
9580 return true;
9581 }
9582
9583
9584
9585
9587 {
9589 }
9590
9592 {
9594 }
9595
9596
9597
9598
9599 override void SetColor(
int r,
int g,
int b,
int a)
9600 {
9606 }
9608 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9609 {
9614 }
9615
9617 {
9619 }
9620
9623 {
9624 int r,g,b,a;
9626 r = r/255;
9627 g = g/255;
9628 b = b/255;
9629 a = a/255;
9630 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9631 }
9632
9633
9634
9635 override void SetLiquidType(
int value,
bool allow_client =
false)
9636 {
9637 if (!IsServerCheck(allow_client))
9638 return;
9639
9644 }
9645
9647 {
9648 return ConfigGetInt("varLiquidTypeInit");
9649 }
9650
9652 {
9654 }
9655
9657 {
9659 SetFrozen(false);
9660 }
9661
9664 {
9665 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9666 }
9667
9668
9671 {
9672 PlayerBase nplayer;
9673 if (PlayerBase.CastTo(nplayer, player))
9674 {
9676
9677 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9678 }
9679 }
9680
9681
9684 {
9685 PlayerBase nplayer;
9686 if (PlayerBase.CastTo(nplayer,player))
9687 {
9688
9689 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9690
9691 }
9692
9693
9694 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9695
9696
9697 if (HasEnergyManager())
9698 {
9699 GetCompEM().UpdatePlugState();
9700 }
9701 }
9702
9703
9705 {
9706 super.OnPlacementStarted(player);
9707
9709 }
9710
9711 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9712 {
9714 {
9715 m_AdminLog.OnPlacementComplete(player,
this);
9716 }
9717
9718 super.OnPlacementComplete(player, position, orientation);
9719 }
9720
9721
9722
9723
9724
9726 {
9728 {
9729 return true;
9730 }
9731 else
9732 {
9733 return false;
9734 }
9735 }
9736
9737
9739 {
9741 {
9743 }
9744 }
9745
9746
9748 {
9750 }
9751
9753 {
9755 }
9756
9757 override void InsertAgent(
int agent,
float count = 1)
9758 {
9759 if (count < 1)
9760 return;
9761
9763 }
9764
9767 {
9769 }
9770
9771
9773 {
9775 }
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9819 {
9821 return false;
9822 return true;
9823 }
9824
9826 {
9827
9829 }
9830
9831
9834 {
9835 super.CheckForRoofLimited(timeTresholdMS);
9836
9838 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9839 {
9840 m_PreviousRoofTestTime = time;
9841 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9842 }
9843 }
9844
9845
9847 {
9849 {
9850 return 0;
9851 }
9852
9853 if (GetInventory().GetAttachmentSlotsCount() != 0)
9854 {
9855 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9856 if (filter)
9857 return filter.GetProtectionLevel(type, false, system);
9858 else
9859 return 0;
9860 }
9861
9862 string subclassPath, entryName;
9863
9864 switch (type)
9865 {
9867 entryName = "biological";
9868 break;
9870 entryName = "chemical";
9871 break;
9872 default:
9873 entryName = "biological";
9874 break;
9875 }
9876
9877 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9878
9880 }
9881
9882
9883
9886 {
9887 if (!IsMagazine())
9889
9891 }
9892
9893
9894
9895
9896
9901 {
9902 return true;
9903 }
9904
9906 {
9908 }
9909
9910
9911
9912
9913
9915 {
9916 if (parent)
9917 {
9918 if (parent.IsInherited(DayZInfected))
9919 return true;
9920
9921 if (!parent.IsRuined())
9922 return true;
9923 }
9924
9925 return true;
9926 }
9927
9929 {
9930 if (!super.CanPutAsAttachment(parent))
9931 {
9932 return false;
9933 }
9934
9935 if (!IsRuined() && !parent.IsRuined())
9936 {
9937 return true;
9938 }
9939
9940 return false;
9941 }
9942
9944 {
9945
9946
9947
9948
9949 return super.CanReceiveItemIntoCargo(item);
9950 }
9951
9953 {
9954
9955
9956
9957
9958 GameInventory attachmentInv = attachment.GetInventory();
9960 {
9961 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9962 return false;
9963 }
9964
9965 InventoryLocation loc = new InventoryLocation();
9966 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9967 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9968 return false;
9969
9970 return super.CanReceiveAttachment(attachment, slotId);
9971 }
9972
9974 {
9975 if (!super.CanReleaseAttachment(attachment))
9976 return false;
9977
9978 return GetInventory().AreChildrenAccessible();
9979 }
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10002 {
10003 int id = muzzle_owner.GetMuzzleID();
10004 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10005
10006 if (WPOF_array)
10007 {
10008 for (int i = 0; i < WPOF_array.Count(); i++)
10009 {
10010 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10011
10012 if (WPOF)
10013 {
10014 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10015 }
10016 }
10017 }
10018 }
10019
10020
10022 {
10023 int id = muzzle_owner.GetMuzzleID();
10025
10026 if (WPOBE_array)
10027 {
10028 for (int i = 0; i < WPOBE_array.Count(); i++)
10029 {
10030 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10031
10032 if (WPOBE)
10033 {
10034 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10035 }
10036 }
10037 }
10038 }
10039
10040
10042 {
10043 int id = muzzle_owner.GetMuzzleID();
10044 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10045
10046 if (WPOOH_array)
10047 {
10048 for (int i = 0; i < WPOOH_array.Count(); i++)
10049 {
10050 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10051
10052 if (WPOOH)
10053 {
10054 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10055 }
10056 }
10057 }
10058 }
10059
10060
10062 {
10063 int id = muzzle_owner.GetMuzzleID();
10064 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10065
10066 if (WPOOH_array)
10067 {
10068 for (int i = 0; i < WPOOH_array.Count(); i++)
10069 {
10070 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10071
10072 if (WPOOH)
10073 {
10074 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10075 }
10076 }
10077 }
10078 }
10079
10080
10082 {
10083 int id = muzzle_owner.GetMuzzleID();
10084 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10085
10086 if (WPOOH_array)
10087 {
10088 for (int i = 0; i < WPOOH_array.Count(); i++)
10089 {
10090 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10091
10092 if (WPOOH)
10093 {
10094 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10095 }
10096 }
10097 }
10098 }
10099
10100
10101
10103 {
10105 {
10106 return true;
10107 }
10108
10109 return false;
10110 }
10111
10113 {
10115 {
10116 return true;
10117 }
10118
10119 return false;
10120 }
10121
10123 {
10125 {
10126 return true;
10127 }
10128
10129 return false;
10130 }
10131
10133 {
10134 return false;
10135 }
10136
10139 {
10140 return UATimeSpent.DEFAULT_DEPLOY;
10141 }
10142
10143
10144
10145
10147 {
10149 SetSynchDirty();
10150 }
10151
10153 {
10155 }
10156
10157
10159 {
10160 return false;
10161 }
10162
10165 {
10166 string att_type = "None";
10167
10168 if (ConfigIsExisting("soundAttType"))
10169 {
10170 att_type = ConfigGetString("soundAttType");
10171 }
10172
10174 }
10175
10177 {
10179 }
10180
10181
10182
10183
10184
10190
10192 {
10195
10197 }
10198
10199
10201 {
10203 return;
10204
10206
10209
10212
10213 SoundParameters params = new SoundParameters();
10217 }
10218
10219
10221 {
10223 return;
10224
10226 SetSynchDirty();
10227
10230 }
10231
10232
10234 {
10236 return;
10237
10239 SetSynchDirty();
10240
10243 }
10244
10246 {
10248 }
10249
10251 {
10253 }
10254
10257 {
10258 if (!
GetGame().IsDedicatedServer())
10259 {
10260 if (ConfigIsExisting("attachSoundSet"))
10261 {
10262 string cfg_path = "";
10263 string soundset = "";
10264 string type_name =
GetType();
10265
10268 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10269 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10270
10271 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10272 {
10273 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10274 {
10275 if (cfg_slot_array[i] == slot_type)
10276 {
10277 soundset = cfg_soundset_array[i];
10278 break;
10279 }
10280 }
10281 }
10282
10283 if (soundset != "")
10284 {
10285 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10287 }
10288 }
10289 }
10290 }
10291
10293 {
10294
10295 }
10296
10297 void OnApply(PlayerBase player);
10298
10300 {
10301 return 1.0;
10302 };
10303
10305 {
10307 }
10308
10310 {
10312 }
10313
10315
10317 {
10318 SetDynamicPhysicsLifeTime(0.01);
10320 }
10321
10323 {
10324 array<string> zone_names = new array<string>;
10325 GetDamageZones(zone_names);
10326 for (int i = 0; i < zone_names.Count(); i++)
10327 {
10328 SetHealthMax(zone_names.Get(i),"Health");
10329 }
10330 SetHealthMax("","Health");
10331 }
10332
10335 {
10336 float global_health = GetHealth01("","Health");
10337 array<string> zones = new array<string>;
10338 GetDamageZones(zones);
10339
10340 for (int i = 0; i < zones.Count(); i++)
10341 {
10342 SetHealth01(zones.Get(i),"Health",global_health);
10343 }
10344 }
10345
10348 {
10349 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10350 }
10351
10353 {
10354 if (!hasRootAsPlayer)
10355 {
10356 if (refParentIB)
10357 {
10358
10359 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10360 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10361
10362 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10363 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10364
10367 }
10368 else
10369 {
10370
10373 }
10374 }
10375 }
10376
10378 {
10380 {
10381 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10382 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10383 {
10384 float heatPermCoef = 1.0;
10386 while (ent)
10387 {
10388 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10389 ent = ent.GetHierarchyParent();
10390 }
10391
10392 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10393 }
10394 }
10395 }
10396
10398 {
10399
10400 EntityAI parent = GetHierarchyParent();
10401 if (!parent)
10402 {
10403 hasParent = false;
10404 hasRootAsPlayer = false;
10405 }
10406 else
10407 {
10408 hasParent = true;
10409 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10410 refParentIB =
ItemBase.Cast(parent);
10411 }
10412 }
10413
10414 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10415 {
10416
10417 }
10418
10420 {
10421
10422 return false;
10423 }
10424
10426 {
10427
10428
10429 return false;
10430 }
10431
10433 {
10434
10435 return false;
10436 }
10437
10440 {
10441 return !GetIsFrozen() &&
IsOpen();
10442 }
10443
10445 {
10446 bool hasParent = false, hasRootAsPlayer = false;
10448
10449 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10450 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10451
10452 if (wwtu || foodDecay)
10453 {
10457
10458 if (processWetness || processTemperature || processDecay)
10459 {
10461
10462 if (processWetness)
10463 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10464
10465 if (processTemperature)
10467
10468 if (processDecay)
10469 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10470 }
10471 }
10472 }
10473
10476 {
10478 }
10479
10481 {
10484
10485 return super.GetTemperatureFreezeThreshold();
10486 }
10487
10489 {
10492
10493 return super.GetTemperatureThawThreshold();
10494 }
10495
10497 {
10500
10501 return super.GetItemOverheatThreshold();
10502 }
10503
10505 {
10507 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10508
10509 return super.GetTemperatureFreezeTime();
10510 }
10511
10513 {
10515 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10516
10517 return super.GetTemperatureThawTime();
10518 }
10519
10524
10526 {
10527 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10528 }
10529
10531 {
10532 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10533 }
10534
10537 {
10539 }
10540
10542 {
10544 }
10545
10547 {
10549 }
10550
10553 {
10554 return null;
10555 }
10556
10559 {
10560 return false;
10561 }
10562
10564 {
10566 {
10569 if (!trg)
10570 {
10572 explosive = this;
10573 }
10574
10575 explosive.PairRemote(trg);
10577
10578 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10579 trg.SetPersistentPairID(persistentID);
10580 explosive.SetPersistentPairID(persistentID);
10581
10582 return true;
10583 }
10584 return false;
10585 }
10586
10589 {
10590 float ret = 1.0;
10593 ret *= GetHealth01();
10594
10595 return ret;
10596 }
10597
10598 #ifdef DEVELOPER
10599 override void SetDebugItem()
10600 {
10601 super.SetDebugItem();
10602 _itemBase = this;
10603 }
10604
10606 {
10607 string text = super.GetDebugText();
10608
10610 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10611
10612 return text;
10613 }
10614 #endif
10615
10617 {
10618 return true;
10619 }
10620
10622
10624
10626 {
10629 }
10630
10631
10639
10655}
10656
10658{
10660 if (entity)
10661 {
10662 bool is_item = entity.IsInherited(
ItemBase);
10663 if (is_item && full_quantity)
10664 {
10667 }
10668 }
10669 else
10670 {
10672 return NULL;
10673 }
10674 return entity;
10675}
10676
10678{
10679 if (item)
10680 {
10681 if (health > 0)
10682 item.SetHealth("", "", health);
10683
10684 if (item.CanHaveTemperature())
10685 {
10687 if (item.CanFreeze())
10688 item.SetFrozen(false);
10689 }
10690
10691 if (item.HasEnergyManager())
10692 {
10693 if (quantity >= 0)
10694 {
10695 item.GetCompEM().SetEnergy0To1(quantity);
10696 }
10697 else
10698 {
10700 }
10701 }
10702 else if (item.IsMagazine())
10703 {
10704 Magazine mag = Magazine.Cast(item);
10705 if (quantity >= 0)
10706 {
10707 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10708 }
10709 else
10710 {
10712 }
10713
10714 }
10715 else
10716 {
10717 if (quantity >= 0)
10718 {
10719 item.SetQuantityNormalized(quantity, false);
10720 }
10721 else
10722 {
10724 }
10725
10726 }
10727 }
10728}
10729
10730#ifdef DEVELOPER
10732#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.