5813{
5815 {
5816 return true;
5817 }
5818};
5819
5820
5821
5823{
5827
5829
5832
5833
5834
5835
5836
5845
5851
5856
5861
5882 protected bool m_IsResultOfSplit
5883
5885
5890
5891
5892
5894
5898
5899
5900
5902
5905
5906
5907
5913
5914
5922
5925
5926
5928
5929
5931
5932
5937
5938
5943
5944
5946
5947
5949 {
5954
5955 if (!
GetGame().IsDedicatedServer())
5956 {
5958 {
5960
5962 {
5964 }
5965 }
5966
5969 }
5970
5971 m_OldLocation = null;
5972
5974 {
5976 }
5977
5978 if (ConfigIsExisting("headSelectionsToHide"))
5979 {
5982 }
5983
5985 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5986 {
5988 }
5989
5991
5992 m_IsResultOfSplit = false;
5993
5995 }
5996
5998 {
5999 super.InitItemVariables();
6000
6006 m_Count = ConfigGetInt(
"count");
6007
6010
6015
6018
6023
6035
6039
6040
6043 if (ConfigIsExisting("canBeSplit"))
6044 {
6047 }
6048
6050 if (ConfigIsExisting("itemBehaviour"))
6052
6053
6056 RegisterNetSyncVariableInt("m_VarLiquidType");
6057 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6058
6059 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6060 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6061 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6062
6063 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6064 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6065 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6066 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6067
6068 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6069 RegisterNetSyncVariableBool("m_IsTakeable");
6070 RegisterNetSyncVariableBool("m_IsHologram");
6071
6074 {
6077 }
6078
6080
6082 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6084
6085 }
6086
6088 {
6090 }
6091
6093 {
6096 {
6101 }
6102 }
6103
6104 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6105 {
6107 {
6110 }
6111
6113 }
6114
6116 {
6122 }
6123
6125
6127 {
6129
6130 if (!action)
6131 {
6132 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6133 return;
6134 }
6135
6137 if (!ai)
6138 {
6140 return;
6141 }
6142
6144 if (!action_array)
6145 {
6146 action_array = new array<ActionBase_Basic>;
6148 }
6149 if (LogManager.IsActionLogEnable())
6150 {
6151 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6152 }
6153
6154 if (action_array.Find(action) != -1)
6155 {
6156 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6157 }
6158 else
6159 {
6160 action_array.Insert(action);
6161 }
6162 }
6163
6165 {
6167 ActionBase action = player.GetActionManager().GetAction(actionName);
6170
6171 if (action_array)
6172 {
6173 action_array.RemoveItem(action);
6174 }
6175 }
6176
6177
6178
6180 {
6181 ActionOverrideData overrideData = new ActionOverrideData();
6185
6187 if (!actionMap)
6188 {
6191 }
6192
6193 actionMap.Insert(this.
Type(), overrideData);
6194
6195 }
6196
6198
6200
6201
6203 {
6206
6209
6210 string config_to_search = "CfgVehicles";
6211 string muzzle_owner_config;
6212
6214 {
6215 if (IsInherited(Weapon))
6216 config_to_search = "CfgWeapons";
6217
6218 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6219
6220 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6221
6223
6224 if (config_OnFire_subclass_count > 0)
6225 {
6226 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6227
6228 for (int i = 0; i < config_OnFire_subclass_count; i++)
6229 {
6230 string particle_class = "";
6232 string config_OnFire_entry = config_OnFire_class + particle_class;
6233 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6234 WPOF_array.Insert(WPOF);
6235 }
6236
6237
6239 }
6240 }
6241
6243 {
6244 config_to_search = "CfgWeapons";
6245 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6246
6247 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6248
6250
6251 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6252 {
6253 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6254
6255 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6256 {
6257 string particle_class2 = "";
6259 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6260 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6261 WPOBE_array.Insert(WPOBE);
6262 }
6263
6264
6266 }
6267 }
6268 }
6269
6270
6272 {
6275
6277 {
6278 string config_to_search = "CfgVehicles";
6279
6280 if (IsInherited(Weapon))
6281 config_to_search = "CfgWeapons";
6282
6283 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6284 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6285
6286 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6287 {
6288
6290
6292 {
6294 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6296 return;
6297 }
6298
6301
6302
6303
6305 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6306
6307 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6308 {
6309 string particle_class = "";
6311 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6313
6314 if (entry_type == CT_CLASS)
6315 {
6316 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6317 WPOOH_array.Insert(WPOF);
6318 }
6319 }
6320
6321
6323 }
6324 }
6325 }
6326
6328 {
6330 }
6331
6333 {
6335 {
6337
6340
6343
6344 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6345 }
6346 }
6347
6349 {
6351 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6352
6354 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6355
6357 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6358
6360 {
6362 }
6363 }
6364
6366 {
6368 }
6369
6371 {
6374 else
6376
6378 {
6381 }
6382 else
6383 {
6386
6389 }
6390
6392 }
6393
6395 {
6397 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6398 }
6399
6401 {
6403 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6405 }
6406
6408 {
6410 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6411 }
6412
6414 {
6417
6418 OverheatingParticle OP = new OverheatingParticle();
6423
6425 }
6426
6428 {
6431
6432 return -1;
6433 }
6434
6436 {
6438 {
6441
6442 for (int i = count; i > 0; --i)
6443 {
6444 int id = i - 1;
6447
6450
6451 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6452 {
6453 if (p)
6454 {
6457 }
6458 }
6459 }
6460 }
6461 }
6462
6464 {
6466 {
6468 {
6469 int id = i - 1;
6471
6472 if (OP)
6473 {
6475
6476 if (p)
6477 {
6479 }
6480
6481 delete OP;
6482 }
6483 }
6484
6487 }
6488 }
6489
6492 {
6493 return 0.0;
6494 }
6495
6496
6498 {
6499 return 250;
6500 }
6501
6503 {
6504 return 0;
6505 }
6506
6509 {
6511 return true;
6512
6513 return false;
6514 }
6515
6518 {
6521
6523 {
6525 }
6526 else
6527 {
6528
6530 }
6531
6533 }
6534
6541 {
6542 return -1;
6543 }
6544
6545
6546
6547
6549 {
6551 {
6553 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6554
6555 if (r_index >= 0)
6556 {
6557 InventoryLocation r_il = new InventoryLocation;
6558 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6559
6560 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6563 {
6564 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6565 }
6567 {
6568 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6569 }
6570
6571 }
6572
6573 player.GetHumanInventory().ClearUserReservedLocation(this);
6574 }
6575
6578 }
6579
6580
6581
6582
6584 {
6585 return ItemBase.m_DebugActionsMask;
6586 }
6587
6589 {
6590 return ItemBase.m_DebugActionsMask & mask;
6591 }
6592
6594 {
6595 ItemBase.m_DebugActionsMask = mask;
6596 }
6597
6599 {
6600 ItemBase.m_DebugActionsMask |= mask;
6601 }
6602
6604 {
6605 ItemBase.m_DebugActionsMask &= ~mask;
6606 }
6607
6609 {
6611 {
6613 }
6614 else
6615 {
6617 }
6618 }
6619
6620
6622 {
6623 if (GetEconomyProfile())
6624 {
6625 float q_max = GetEconomyProfile().GetQuantityMax();
6626 if (q_max > 0)
6627 {
6628 float q_min = GetEconomyProfile().GetQuantityMin();
6629 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6630
6632 {
6633 ComponentEnergyManager comp = GetCompEM();
6635 {
6637 }
6638 }
6640 {
6642
6643 }
6644
6645 }
6646 }
6647 }
6648
6651 {
6652 EntityAI parent = GetHierarchyParent();
6653
6654 if (parent)
6655 {
6656 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6657 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6658 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6659 }
6660 }
6661
6664 {
6665 EntityAI parent = GetHierarchyParent();
6666
6667 if (parent)
6668 {
6669 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6670 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6671 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6672 }
6673 }
6674
6676 {
6677
6678
6679
6680
6682
6684 {
6685 if (ScriptInputUserData.CanStoreInputUserData())
6686 {
6687 ScriptInputUserData ctx = new ScriptInputUserData;
6693 ctx.
Write(use_stack_max);
6696
6698 {
6699 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6700 }
6701 }
6702 }
6703 else if (!
GetGame().IsMultiplayer())
6704 {
6706 }
6707 }
6708
6710 {
6712 }
6713
6715 {
6717 }
6718
6720 {
6722 }
6723
6725 {
6726
6727 return false;
6728 }
6729
6731 {
6732 return false;
6733 }
6734
6738 {
6739 return false;
6740 }
6741
6743 {
6744 return "";
6745 }
6746
6748
6750 {
6751 return false;
6752 }
6753
6755 {
6756 return true;
6757 }
6758
6759
6760
6762 {
6763 return true;
6764 }
6765
6767 {
6768 return true;
6769 }
6770
6772 {
6773 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6775 }
6776
6778 {
6780 }
6781
6783 {
6785 if (!is_being_placed)
6787 SetSynchDirty();
6788 }
6789
6790
6792
6794 {
6796 }
6797
6799 {
6801 }
6802
6804 {
6805 return 1;
6806 }
6807
6809 {
6810 return false;
6811 }
6812
6814 {
6816 SetSynchDirty();
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
6847
6848
6849
6850
6851
6852
6854 {
6855 super.OnMovedInsideCargo(container);
6856
6857 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6858 }
6859
6860 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6861 {
6862 super.EEItemLocationChanged(oldLoc,newLoc);
6863
6864 PlayerBase new_player = null;
6865 PlayerBase old_player = null;
6866
6867 if (newLoc.GetParent())
6868 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6869
6870 if (oldLoc.GetParent())
6871 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6872
6874 {
6875 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6876
6877 if (r_index >= 0)
6878 {
6879 InventoryLocation r_il = new InventoryLocation;
6880 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6881
6882 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6885 {
6886 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6887 }
6889 {
6890 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6891 }
6892
6893 }
6894 }
6895
6897 {
6898 if (new_player)
6899 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6900
6901 if (new_player == old_player)
6902 {
6903
6904 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6905 {
6907 {
6908 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6909 {
6910 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6911 }
6912 }
6913 else
6914 {
6915 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6916 }
6917 }
6918
6919 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6920 {
6921 int type = oldLoc.GetType();
6923 {
6924 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6925 }
6927 {
6928 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6929 }
6930 }
6931 if (!m_OldLocation)
6932 {
6933 m_OldLocation = new InventoryLocation;
6934 }
6935 m_OldLocation.Copy(oldLoc);
6936 }
6937 else
6938 {
6939 if (m_OldLocation)
6940 {
6941 m_OldLocation.Reset();
6942 }
6943 }
6944
6946 }
6947 else
6948 {
6949 if (new_player)
6950 {
6951 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6952 if (res_index >= 0)
6953 {
6954 InventoryLocation il = new InventoryLocation;
6955 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6957 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6960 {
6961 il.
GetParent().GetOnReleaseLock().Invoke(it);
6962 }
6964 {
6966 }
6967
6968 }
6969 }
6971 {
6972
6974 }
6975
6976 if (m_OldLocation)
6977 {
6978 m_OldLocation.Reset();
6979 }
6980 }
6981 }
6982
6983 override void EOnContact(IEntity other, Contact extra)
6984 {
6986 {
6987 int liquidType = -1;
6989 if (impactSpeed > 0.0)
6990 {
6992 #ifndef SERVER
6994 #else
6996 SetSynchDirty();
6997 #endif
6999 }
7000 }
7001
7002 #ifdef SERVER
7003 if (GetCompEM() && GetCompEM().IsPlugged())
7004 {
7005 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7006 GetCompEM().UnplugThis();
7007 }
7008 #endif
7009 }
7010
7012
7014 {
7016 }
7017
7019 {
7020
7021 }
7022
7024 {
7025 super.OnItemLocationChanged(old_owner, new_owner);
7026
7027 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7028 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7029
7030 if (!relatedPlayer && playerNew)
7031 relatedPlayer = playerNew;
7032
7033 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7034 {
7036 if (actionMgr)
7037 {
7038 ActionBase currentAction = actionMgr.GetRunningAction();
7039 if (currentAction)
7041 }
7042 }
7043
7044 Man ownerPlayerOld = null;
7045 Man ownerPlayerNew = null;
7046
7047 if (old_owner)
7048 {
7049 if (old_owner.
IsMan())
7050 {
7051 ownerPlayerOld = Man.Cast(old_owner);
7052 }
7053 else
7054 {
7055 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7056 }
7057 }
7058 else
7059 {
7061 {
7063
7064 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7065 {
7066 GetCompEM().UnplugThis();
7067 }
7068 }
7069 }
7070
7071 if (new_owner)
7072 {
7073 if (new_owner.
IsMan())
7074 {
7075 ownerPlayerNew = Man.Cast(new_owner);
7076 }
7077 else
7078 {
7079 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7080 }
7081 }
7082
7083 if (ownerPlayerOld != ownerPlayerNew)
7084 {
7085 if (ownerPlayerOld)
7086 {
7087 array<EntityAI> subItemsExit = new array<EntityAI>;
7089 for (int i = 0; i < subItemsExit.Count(); i++)
7090 {
7093 }
7094 }
7095
7096 if (ownerPlayerNew)
7097 {
7098 array<EntityAI> subItemsEnter = new array<EntityAI>;
7100 for (int j = 0; j < subItemsEnter.Count(); j++)
7101 {
7104 }
7105 }
7106 }
7107 else if (ownerPlayerNew != null)
7108 {
7109 PlayerBase nplayer;
7110 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7111 {
7112 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7114 for (int k = 0; k < subItemsUpdate.Count(); k++)
7115 {
7117 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7118 }
7119 }
7120 }
7121
7122 if (old_owner)
7123 old_owner.OnChildItemRemoved(this);
7124 if (new_owner)
7125 new_owner.OnChildItemReceived(this);
7126 }
7127
7128
7130 {
7131 super.EEDelete(parent);
7132 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7133 if (player)
7134 {
7136
7137 if (player.IsAlive())
7138 {
7139 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7140 if (r_index >= 0)
7141 {
7142 InventoryLocation r_il = new InventoryLocation;
7143 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7144
7145 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7148 {
7149 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7150 }
7152 {
7153 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7154 }
7155
7156 }
7157
7158 player.RemoveQuickBarEntityShortcut(this);
7159 }
7160 }
7161 }
7162
7164 {
7165 super.EEKilled(killer);
7166
7169 {
7170 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7171 {
7172 if (IsMagazine())
7173 {
7174 if (Magazine.Cast(this).GetAmmoCount() > 0)
7175 {
7177 }
7178 }
7179 else
7180 {
7182 }
7183 }
7184 }
7185 }
7186
7188 {
7189 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7190
7191 super.OnWasAttached(parent, slot_id);
7192
7195
7197 }
7198
7200 {
7201 super.OnWasDetached(parent, slot_id);
7202
7205 }
7206
7208 {
7209 int idx;
7212
7213 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7214 if (inventory_slots.Count() < 1)
7215 {
7216 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7217 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7218 }
7219 else
7220 {
7221 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7222 }
7223
7224 idx = inventory_slots.Find(slot);
7225 if (idx < 0)
7226 return "";
7227
7228 return attach_types.Get(idx);
7229 }
7230
7232 {
7233 int idx = -1;
7234 string slot;
7235
7238
7239 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7240 if (inventory_slots.Count() < 1)
7241 {
7242 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7243 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7244 }
7245 else
7246 {
7247 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7248 if (detach_types.Count() < 1)
7249 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7250 }
7251
7252 for (int i = 0; i < inventory_slots.Count(); i++)
7253 {
7254 slot = inventory_slots.Get(i);
7255 }
7256
7257 if (slot != "")
7258 {
7259 if (detach_types.Count() == 1)
7260 idx = 0;
7261 else
7262 idx = inventory_slots.Find(slot);
7263 }
7264 if (idx < 0)
7265 return "";
7266
7267 return detach_types.Get(idx);
7268 }
7269
7271 {
7272
7274
7275
7276 float min_time = 1;
7277 float max_time = 3;
7278 float delay = Math.RandomFloat(min_time, max_time);
7279
7280 explode_timer.Run(delay, this, "DoAmmoExplosion");
7281 }
7282
7284 {
7285 Magazine magazine = Magazine.Cast(this);
7286 int pop_sounds_count = 6;
7287 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7288
7289
7290 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7291 string sound_name = pop_sounds[ sound_idx ];
7293
7294
7295 magazine.ServerAddAmmoCount(-1);
7296
7297
7298 float min_temp_to_explode = 100;
7299
7300 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
7301 {
7303 }
7304 }
7305
7306
7307 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7308 {
7309 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7310
7311 const int CHANCE_DAMAGE_CARGO = 4;
7312 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7313 const int CHANCE_DAMAGE_NOTHING = 2;
7314
7316 {
7317 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7318 int chances;
7319 int rnd;
7320
7321 if (GetInventory().GetCargo())
7322 {
7323 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7324 rnd = Math.RandomInt(0,chances);
7325
7326 if (rnd < CHANCE_DAMAGE_CARGO)
7327 {
7329 }
7330 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7331 {
7333 }
7334 }
7335 else
7336 {
7337 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7338 rnd = Math.RandomInt(0,chances);
7339
7340 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7341 {
7343 }
7344 }
7345 }
7346 }
7347
7349 {
7350 if (GetInventory().GetCargo())
7351 {
7352 int item_count = GetInventory().GetCargo().GetItemCount();
7353 if (item_count > 0)
7354 {
7355 int random_pick = Math.RandomInt(0, item_count);
7357 if (!item.IsExplosive())
7358 {
7359 item.AddHealth("","",damage);
7360 return true;
7361 }
7362 }
7363 }
7364 return false;
7365 }
7366
7368 {
7369 int attachment_count = GetInventory().AttachmentCount();
7370 if (attachment_count > 0)
7371 {
7372 int random_pick = Math.RandomInt(0, attachment_count);
7373 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7374 if (!attachment.IsExplosive())
7375 {
7376 attachment.AddHealth("","",damage);
7377 return true;
7378 }
7379 }
7380 return false;
7381 }
7382
7384 {
7386 }
7387
7389 {
7391 return GetInventory().CanRemoveEntity();
7392
7393 return false;
7394 }
7395
7397 {
7398
7400 return false;
7401
7402
7404 return false;
7405
7406
7407
7409 if (delta == 0)
7410 return false;
7411
7412
7413 return true;
7414 }
7415
7417 {
7419 {
7420 if (ScriptInputUserData.CanStoreInputUserData())
7421 {
7422 ScriptInputUserData ctx = new ScriptInputUserData;
7427 ctx.
Write(destination_entity);
7431 }
7432 }
7433 else if (!
GetGame().IsMultiplayer())
7434 {
7436 }
7437 }
7438
7440 {
7441 float split_quantity_new;
7445 InventoryLocation loc = new InventoryLocation;
7446
7447 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7448 {
7450 split_quantity_new = stack_max;
7451 else
7453
7455 {
7456 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7457 if (new_item)
7458 {
7459 new_item.SetResultOfSplit(true);
7460 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7462 new_item.
SetQuantity(split_quantity_new,
false,
true);
7463 }
7464 }
7465 }
7466 else if (destination_entity && slot_id == -1)
7467 {
7468 if (quantity > stack_max)
7469 split_quantity_new = stack_max;
7470 else
7471 split_quantity_new = quantity;
7472
7474 {
7476 {
7479 }
7480
7481 if (new_item)
7482 {
7483 new_item.SetResultOfSplit(true);
7484 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7486 new_item.
SetQuantity(split_quantity_new,
false,
true);
7487 }
7488 }
7489 }
7490 else
7491 {
7492 if (stack_max != 0)
7493 {
7495 {
7497 }
7498
7499 if (split_quantity_new == 0)
7500 {
7501 if (!
GetGame().IsMultiplayer())
7502 player.PhysicalPredictiveDropItem(this);
7503 else
7504 player.ServerDropEntity(this);
7505 return;
7506 }
7507
7509 {
7511
7512 if (new_item)
7513 {
7514 new_item.SetResultOfSplit(true);
7515 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7518 new_item.PlaceOnSurface();
7519 }
7520 }
7521 }
7522 }
7523 }
7524
7526 {
7527 float split_quantity_new;
7531 InventoryLocation loc = new InventoryLocation;
7532
7533 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7534 {
7536 split_quantity_new = stack_max;
7537 else
7539
7541 {
7542 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7543 if (new_item)
7544 {
7545 new_item.SetResultOfSplit(true);
7546 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7548 new_item.
SetQuantity(split_quantity_new,
false,
true);
7549 }
7550 }
7551 }
7552 else if (destination_entity && slot_id == -1)
7553 {
7554 if (quantity > stack_max)
7555 split_quantity_new = stack_max;
7556 else
7557 split_quantity_new = quantity;
7558
7560 {
7562 {
7565 }
7566
7567 if (new_item)
7568 {
7569 new_item.SetResultOfSplit(true);
7570 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7572 new_item.
SetQuantity(split_quantity_new,
false,
true);
7573 }
7574 }
7575 }
7576 else
7577 {
7578 if (stack_max != 0)
7579 {
7581 {
7583 }
7584
7586 {
7588
7589 if (new_item)
7590 {
7591 new_item.SetResultOfSplit(true);
7592 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7595 new_item.PlaceOnSurface();
7596 }
7597 }
7598 }
7599 }
7600 }
7601
7603 {
7605 {
7606 if (ScriptInputUserData.CanStoreInputUserData())
7607 {
7608 ScriptInputUserData ctx = new ScriptInputUserData;
7613 dst.WriteToContext(ctx);
7615 }
7616 }
7617 else if (!
GetGame().IsMultiplayer())
7618 {
7620 }
7621 }
7622
7624 {
7626 {
7627 if (ScriptInputUserData.CanStoreInputUserData())
7628 {
7629 ScriptInputUserData ctx = new ScriptInputUserData;
7634 ctx.
Write(destination_entity);
7640 }
7641 }
7642 else if (!
GetGame().IsMultiplayer())
7643 {
7645 }
7646 }
7647
7649 {
7651 }
7652
7654 {
7656 float split_quantity_new;
7658 if (dst.IsValid())
7659 {
7660 int slot_id = dst.GetSlot();
7662
7663 if (quantity > stack_max)
7664 split_quantity_new = stack_max;
7665 else
7666 split_quantity_new = quantity;
7667
7669 {
7671
7672 if (new_item)
7673 {
7674 new_item.SetResultOfSplit(true);
7675 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7677 new_item.
SetQuantity(split_quantity_new,
false,
true);
7678 }
7679
7680 return new_item;
7681 }
7682 }
7683
7684 return null;
7685 }
7686
7688 {
7690 float split_quantity_new;
7692 if (destination_entity)
7693 {
7695 if (quantity > stackable)
7696 split_quantity_new = stackable;
7697 else
7698 split_quantity_new = quantity;
7699
7701 {
7702 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7703 if (new_item)
7704 {
7705 new_item.SetResultOfSplit(true);
7706 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7708 new_item.
SetQuantity(split_quantity_new,
false,
true);
7709 }
7710 }
7711 }
7712 }
7713
7715 {
7717 {
7718 if (ScriptInputUserData.CanStoreInputUserData())
7719 {
7720 ScriptInputUserData ctx = new ScriptInputUserData;
7725 ItemBase destination_entity =
this;
7726 ctx.
Write(destination_entity);
7730 }
7731 }
7732 else if (!
GetGame().IsMultiplayer())
7733 {
7735 }
7736 }
7737
7739 {
7741 float split_quantity_new;
7743 if (player)
7744 {
7746 if (quantity > stackable)
7747 split_quantity_new = stackable;
7748 else
7749 split_quantity_new = quantity;
7750
7752 {
7753 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7754 new_item =
ItemBase.Cast(in_hands);
7755 if (new_item)
7756 {
7757 new_item.SetResultOfSplit(true);
7758 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7760 new_item.SetQuantity(split_quantity_new, false, true);
7761 }
7762 }
7763 }
7764 }
7765
7767 {
7769 float split_quantity_new = Math.Floor(quantity * 0.5);
7770
7772 return;
7773
7775
7776 if (new_item)
7777 {
7778 if (new_item.GetQuantityMax() < split_quantity_new)
7779 {
7780 split_quantity_new = new_item.GetQuantityMax();
7781 }
7782
7783 new_item.SetResultOfSplit(true);
7784 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7785
7787 {
7790 }
7791 else
7792 {
7794 new_item.
SetQuantity(split_quantity_new,
false,
true);
7795 }
7796 }
7797 }
7798
7800 {
7802 float split_quantity_new = Math.Floor(quantity / 2);
7803
7805 return;
7806
7807 InventoryLocation invloc = new InventoryLocation;
7809
7811 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7812
7813 if (new_item)
7814 {
7815 if (new_item.GetQuantityMax() < split_quantity_new)
7816 {
7817 split_quantity_new = new_item.GetQuantityMax();
7818 }
7820 {
7823 }
7824 else if (split_quantity_new > 1)
7825 {
7827 new_item.
SetQuantity(split_quantity_new,
false,
true);
7828 }
7829 }
7830 }
7831
7834 {
7835 SetWeightDirty();
7837
7838 if (parent)
7839 parent.OnAttachmentQuantityChangedEx(this, delta);
7840
7842 {
7844 {
7846 }
7848 {
7849 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7851 }
7852 }
7853
7854 }
7855
7858 {
7859
7860 }
7861
7864 {
7866 }
7867
7869 {
7870 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7871
7873 {
7874 if (newLevel == GameConstants.STATE_RUINED)
7875 {
7877 EntityAI parent = GetHierarchyParent();
7878 if (parent && parent.IsFireplace())
7879 {
7880 CargoBase cargo = GetInventory().GetCargo();
7881 if (cargo)
7882 {
7884 {
7886 }
7887 }
7888 }
7889 }
7890
7892 {
7893
7895 return;
7896 }
7897
7898 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7899 {
7901 }
7902 }
7903 }
7904
7905
7907 {
7908 super.OnRightClick();
7909
7911 {
7913 {
7914 if (ScriptInputUserData.CanStoreInputUserData())
7915 {
7916 EntityAI root = GetHierarchyRoot();
7917 Man playerOwner = GetHierarchyRootPlayer();
7918 InventoryLocation dst = new InventoryLocation;
7919
7920
7921 if (!playerOwner && root && root == this)
7922 {
7924 }
7925 else
7926 {
7927
7928 GetInventory().GetCurrentInventoryLocation(dst);
7930 {
7933 {
7935 }
7936 else
7937 {
7939
7940
7941 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7942 {
7944 }
7945 else
7946 {
7947 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7948 }
7949 }
7950 }
7951 }
7952
7953 ScriptInputUserData ctx = new ScriptInputUserData;
7961 }
7962 }
7963 else if (!
GetGame().IsMultiplayer())
7964 {
7966 }
7967 }
7968 }
7969
7971 {
7972 if (root)
7973 {
7974 vector m4[4];
7975 root.GetTransform(m4);
7976 dst.SetGround(this, m4);
7977 }
7978 else
7979 {
7980 GetInventory().GetCurrentInventoryLocation(dst);
7981 }
7982 }
7983
7984 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7985 {
7986
7987 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7988 return false;
7989
7990 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7991 return false;
7992
7993
7995 return false;
7996
7997
7998 Magazine mag = Magazine.Cast(this);
7999 if (mag)
8000 {
8001 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8002 return false;
8003
8004 if (stack_max_limit)
8005 {
8006 Magazine other_mag = Magazine.Cast(other_item);
8007 if (other_item)
8008 {
8009 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8010 return false;
8011 }
8012
8013 }
8014 }
8015 else
8016 {
8017
8019 return false;
8020
8022 return false;
8023 }
8024
8025 PlayerBase player = null;
8026 if (CastTo(player, GetHierarchyRootPlayer()))
8027 {
8028 if (player.GetInventory().HasAttachment(this))
8029 return false;
8030
8031 if (player.IsItemsToDelete())
8032 return false;
8033 }
8034
8035 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8036 return false;
8037
8038 int slotID;
8040 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8041 return false;
8042
8043 return true;
8044 }
8045
8047 {
8049 }
8050
8052 {
8053 return m_IsResultOfSplit;
8054 }
8055
8057 {
8058 m_IsResultOfSplit = value;
8059 }
8060
8062 {
8064 }
8065
8067 {
8068 float other_item_quantity = other_item.GetQuantity();
8069 float this_free_space;
8070
8072
8074
8075 if (other_item_quantity > this_free_space)
8076 {
8077 return this_free_space;
8078 }
8079 else
8080 {
8081 return other_item_quantity;
8082 }
8083 }
8084
8086 {
8088 }
8089
8091 {
8093 return;
8094
8095 if (!IsMagazine() && other_item)
8096 {
8098 if (quantity_used != 0)
8099 {
8100 float hp1 = GetHealth01("","");
8101 float hp2 = other_item.GetHealth01("","");
8102 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8103 hpResult = hpResult / (
GetQuantity() + quantity_used);
8104
8105 hpResult *= GetMaxHealth();
8106 Math.Round(hpResult);
8107 SetHealth("", "Health", hpResult);
8108
8110 other_item.AddQuantity(-quantity_used);
8111 }
8112 }
8114 }
8115
8117 {
8118 #ifdef SERVER
8119 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8120 GetHierarchyParent().IncreaseLifetimeUp();
8121 #endif
8122 };
8123
8125 {
8126 PlayerBase p = PlayerBase.Cast(player);
8127
8128 array<int> recipesIds = p.m_Recipes;
8129 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8130 if (moduleRecipesManager)
8131 {
8132 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8133 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8134 }
8135
8136 for (int i = 0;i < recipesIds.Count(); i++)
8137 {
8138 int key = recipesIds.Get(i);
8139 string recipeName = moduleRecipesManager.GetRecipeName(key);
8141 }
8142 }
8143
8144
8145 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8146 {
8147 super.GetDebugActions(outputList);
8148
8149
8155
8156
8161
8166
8167
8171
8172
8174 {
8178 }
8179
8182
8183
8187
8189
8190 InventoryLocation loc = new InventoryLocation();
8191 GetInventory().GetCurrentInventoryLocation(loc);
8193 {
8194 if (Gizmo_IsSupported())
8197 }
8198
8200 }
8201
8202
8203
8204
8206 {
8207 super.OnAction(action_id, player, ctx);
8208
8210 {
8211 switch (action_id)
8212 {
8215 return true;
8218 return true;
8219 }
8220 }
8221
8223 {
8224 switch (action_id)
8225 {
8227 Delete();
8228 return true;
8229 }
8230 }
8231
8232 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8233 {
8234 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8235 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8236 PlayerBase p = PlayerBase.Cast(player);
8237 if (
EActions.RECIPES_RANGE_START < 1000)
8238 {
8239 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8240 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8241 }
8242 }
8243 #ifndef SERVER
8244 else if (action_id ==
EActions.WATCH_PLAYER)
8245 {
8246 PluginDeveloper.SetDeveloperItemClientEx(player);
8247 }
8248 #endif
8250 {
8251 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8252 {
8253 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8254 OnDebugButtonPressServer(id + 1);
8255 }
8256
8257 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8258 {
8259 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8261 }
8262
8263 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8264 {
8265 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8267 }
8268
8269 else if (action_id ==
EActions.ADD_QUANTITY)
8270 {
8271 if (IsMagazine())
8272 {
8273 Magazine mag = Magazine.Cast(this);
8274 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8275 }
8276 else
8277 {
8279 }
8280
8281 if (m_EM)
8282 {
8283 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8284 }
8285
8286 }
8287
8288 else if (action_id ==
EActions.REMOVE_QUANTITY)
8289 {
8290 if (IsMagazine())
8291 {
8292 Magazine mag2 = Magazine.Cast(this);
8293 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8294 }
8295 else
8296 {
8298 }
8299 if (m_EM)
8300 {
8301 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8302 }
8303
8304 }
8305
8306 else if (action_id ==
EActions.SET_QUANTITY_0)
8307 {
8309
8310 if (m_EM)
8311 {
8312 m_EM.SetEnergy(0);
8313 }
8314 }
8315
8316 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8317 {
8319
8320 if (m_EM)
8321 {
8322 m_EM.SetEnergy(m_EM.GetEnergyMax());
8323 }
8324 }
8325
8326 else if (action_id ==
EActions.ADD_HEALTH)
8327 {
8328 AddHealth("","",GetMaxHealth("","Health")/5);
8329 }
8330 else if (action_id ==
EActions.REMOVE_HEALTH)
8331 {
8332 AddHealth("","",-GetMaxHealth("","Health")/5);
8333 }
8334 else if (action_id ==
EActions.DESTROY_HEALTH)
8335 {
8336 SetHealth01("","",0);
8337 }
8338 else if (action_id ==
EActions.WATCH_ITEM)
8339 {
8341 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8342 #ifdef DEVELOPER
8343 SetDebugDeveloper_item(this);
8344 #endif
8345 }
8346
8347 else if (action_id ==
EActions.ADD_TEMPERATURE)
8348 {
8349 AddTemperature(20);
8350
8351 }
8352
8353 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8354 {
8355 AddTemperature(-20);
8356
8357 }
8358
8359 else if (action_id ==
EActions.FLIP_FROZEN)
8360 {
8361 SetFrozen(!GetIsFrozen());
8362
8363 }
8364
8365 else if (action_id ==
EActions.ADD_WETNESS)
8366 {
8368
8369 }
8370
8371 else if (action_id ==
EActions.REMOVE_WETNESS)
8372 {
8374
8375 }
8376
8377 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8378 {
8381
8382
8383 }
8384
8385 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8386 {
8389 }
8390
8391 else if (action_id ==
EActions.MAKE_SPECIAL)
8392 {
8393 auto debugParams = DebugSpawnParams.WithPlayer(player);
8394 OnDebugSpawnEx(debugParams);
8395 }
8396
8397 }
8398
8399
8400 return false;
8401 }
8402
8403
8404
8405
8409
8412
8413
8414
8416 {
8417 return false;
8418 }
8419
8420
8422 {
8423 return true;
8424 }
8425
8426
8428 {
8429 return true;
8430 }
8431
8432
8433
8435 {
8436 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8438 }
8439
8442 {
8443 return null;
8444 }
8445
8447 {
8448 return false;
8449 }
8450
8452 {
8453 return false;
8454 }
8455
8459
8460
8462 {
8463 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8464 return module_repairing.CanRepair(this, item_repair_kit);
8465 }
8466
8467
8468 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8469 {
8470 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8471 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8472 }
8473
8474
8476 {
8477
8478
8479
8480
8481
8482
8483
8484
8485 return 1;
8486 }
8487
8488
8489
8491 {
8493 }
8494
8495
8496
8498 {
8500 }
8501
8502
8511 {
8512 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8513
8514 if (player)
8515 {
8516 player.MessageStatus(text);
8517 }
8518 }
8519
8520
8529 {
8530 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8531
8532 if (player)
8533 {
8534 player.MessageAction(text);
8535 }
8536 }
8537
8538
8547 {
8548 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8549
8550 if (player)
8551 {
8552 player.MessageFriendly(text);
8553 }
8554 }
8555
8556
8565 {
8566 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8567
8568 if (player)
8569 {
8570 player.MessageImportant(text);
8571 }
8572 }
8573
8575 {
8576 return true;
8577 }
8578
8579
8580 override bool KindOf(
string tag)
8581 {
8582 bool found = false;
8583 string item_name = this.
GetType();
8586
8587 int array_size = item_tag_array.Count();
8588 for (int i = 0; i < array_size; i++)
8589 {
8590 if (item_tag_array.Get(i) == tag)
8591 {
8592 found = true;
8593 break;
8594 }
8595 }
8596 return found;
8597 }
8598
8599
8601 {
8602
8603 super.OnRPC(sender, rpc_type,ctx);
8604
8605
8606 switch (rpc_type)
8607 {
8608 #ifndef SERVER
8609 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8610 Param2<bool, string> p = new Param2<bool, string>(false, "");
8611
8613 return;
8614
8615 bool play = p.param1;
8616 string soundSet = p.param2;
8617
8618 if (play)
8619 {
8621 {
8623 {
8625 }
8626 }
8627 else
8628 {
8630 }
8631 }
8632 else
8633 {
8635 }
8636
8637 break;
8638 #endif
8639
8640 }
8641
8643 {
8645 }
8646 }
8647
8648
8649
8650
8652 {
8653 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8654 return plugin.GetID(
name);
8655 }
8656
8658 {
8659 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8660 return plugin.GetName(id);
8661 }
8662
8665 {
8666
8667
8668 int varFlags;
8669 if (!ctx.
Read(varFlags))
8670 return;
8671
8672 if (varFlags & ItemVariableFlags.FLOAT)
8673 {
8675 }
8676 }
8677
8679 {
8680
8681 super.SerializeNumericalVars(floats_out);
8682
8683
8684
8686 {
8688 }
8689
8691 {
8693 }
8694
8696 {
8698 }
8699
8701 {
8706 }
8707
8709 {
8711 }
8712 }
8713
8715 {
8716
8717 super.DeSerializeNumericalVars(floats);
8718
8719
8720 int index = 0;
8721 int mask = Math.Round(floats.Get(index));
8722
8723 index++;
8724
8726 {
8728 {
8730 }
8731 else
8732 {
8733 float quantity = floats.Get(index);
8735 }
8736 index++;
8737 }
8738
8740 {
8741 float wet = floats.Get(index);
8743 index++;
8744 }
8745
8747 {
8748 int liquidtype = Math.Round(floats.Get(index));
8750 index++;
8751 }
8752
8754 {
8756 index++;
8758 index++;
8760 index++;
8762 index++;
8763 }
8764
8766 {
8767 int cleanness = Math.Round(floats.Get(index));
8769 index++;
8770 }
8771 }
8772
8774 {
8775 super.WriteVarsToCTX(ctx);
8776
8777
8779 {
8781 }
8782
8784 {
8786 }
8787
8789 {
8791 }
8792
8794 {
8795 int r,g,b,a;
8801 }
8802
8804 {
8806 }
8807 }
8808
8810 {
8811 if (!super.ReadVarsFromCTX(ctx,version))
8812 return false;
8813
8814 int intValue;
8815 float value;
8816
8817 if (version < 140)
8818 {
8819 if (!ctx.
Read(intValue))
8820 return false;
8821
8822 m_VariablesMask = intValue;
8823 }
8824
8826 {
8827 if (!ctx.
Read(value))
8828 return false;
8829
8831 {
8833 }
8834 else
8835 {
8837 }
8838 }
8839
8840 if (version < 140)
8841 {
8843 {
8844 if (!ctx.
Read(value))
8845 return false;
8846 SetTemperatureDirect(value);
8847 }
8848 }
8849
8851 {
8852 if (!ctx.
Read(value))
8853 return false;
8855 }
8856
8858 {
8859 if (!ctx.
Read(intValue))
8860 return false;
8862 }
8863
8865 {
8866 int r,g,b,a;
8868 return false;
8870 return false;
8872 return false;
8874 return false;
8875
8877 }
8878
8880 {
8881 if (!ctx.
Read(intValue))
8882 return false;
8884 }
8885
8886 if (version >= 138 && version < 140)
8887 {
8889 {
8890 if (!ctx.
Read(intValue))
8891 return false;
8892 SetFrozen(intValue);
8893 }
8894 }
8895
8896 return true;
8897 }
8898
8899
8901 {
8904 {
8906 }
8907
8908 if (!super.OnStoreLoad(ctx, version))
8909 {
8911 return false;
8912 }
8913
8914 if (version >= 114)
8915 {
8916 bool hasQuickBarIndexSaved;
8917
8918 if (!ctx.
Read(hasQuickBarIndexSaved))
8919 {
8921 return false;
8922 }
8923
8924 if (hasQuickBarIndexSaved)
8925 {
8926 int itmQBIndex;
8927
8928
8929 if (!ctx.
Read(itmQBIndex))
8930 {
8932 return false;
8933 }
8934
8935 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8936 if (itmQBIndex != -1 && parentPlayer)
8937 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8938 }
8939 }
8940 else
8941 {
8942
8943 PlayerBase player;
8944 int itemQBIndex;
8945 if (version ==
int.
MAX)
8946 {
8947 if (!ctx.
Read(itemQBIndex))
8948 {
8950 return false;
8951 }
8952 }
8953 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8954 {
8955
8956 if (!ctx.
Read(itemQBIndex))
8957 {
8959 return false;
8960 }
8961 if (itemQBIndex != -1 && player)
8962 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8963 }
8964 }
8965
8966 if (version < 140)
8967 {
8968
8969 if (!LoadVariables(ctx, version))
8970 {
8972 return false;
8973 }
8974 }
8975
8976
8978 {
8980 return false;
8981 }
8982 if (version >= 132)
8983 {
8985 if (raib)
8986 {
8988 {
8990 return false;
8991 }
8992 }
8993 }
8994
8996 return true;
8997 }
8998
8999
9000
9002 {
9003 super.OnStoreSave(ctx);
9004
9005 PlayerBase player;
9006 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9007 {
9009
9010 int itemQBIndex = -1;
9011 itemQBIndex = player.FindQuickBarEntityIndex(this);
9012 ctx.
Write(itemQBIndex);
9013 }
9014 else
9015 {
9017 }
9018
9020
9022 if (raib)
9023 {
9025 }
9026 }
9027
9028
9030 {
9031 super.AfterStoreLoad();
9032
9034 {
9036 }
9037
9039 {
9042 }
9043 }
9044
9046 {
9047 super.EEOnAfterLoad();
9048
9050 {
9052 }
9053
9056 }
9057
9059 {
9060 return false;
9061 }
9062
9063
9064
9066 {
9068 {
9069 #ifdef PLATFORM_CONSOLE
9070
9072 {
9074 if (menu)
9075 {
9077 }
9078 }
9079 #endif
9080 }
9081
9083 {
9086 }
9087
9089 {
9090 SetWeightDirty();
9092 }
9094 {
9097 }
9098
9100 {
9103 }
9105 {
9108 }
9109
9110 super.OnVariablesSynchronized();
9111 }
9112
9113
9114
9116 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9117 {
9118 if (!IsServerCheck(allow_client))
9119 return false;
9120
9122 return false;
9123
9126
9127 if (value <= (min + 0.001))
9128 value = min;
9129
9130 if (value == min)
9131 {
9132 if (destroy_config)
9133 {
9134 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9135 if (dstr)
9136 {
9138 this.Delete();
9139 return true;
9140 }
9141 }
9142 else if (destroy_forced)
9143 {
9145 this.Delete();
9146 return true;
9147 }
9148
9150 }
9151
9154
9156 {
9158
9159 if (delta)
9161 }
9162
9164
9165 return false;
9166 }
9167
9168
9170 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9171 {
9173 }
9174
9176 {
9179 }
9180
9182 {
9185 }
9186
9188 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9189 {
9190 float value_clamped = Math.Clamp(value, 0, 1);
9192 SetQuantity(result, destroy_config, destroy_forced);
9193 }
9194
9195
9198 {
9200 }
9201
9203 {
9205 }
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9217 {
9218 int slot = -1;
9219 if (GetInventory())
9220 {
9221 InventoryLocation il = new InventoryLocation;
9222 GetInventory().GetCurrentInventoryLocation(il);
9224 }
9225
9227 }
9228
9230 {
9231 float quantity_max = 0;
9232
9234 {
9235 if (attSlotID != -1)
9236 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9237
9238 if (quantity_max <= 0)
9240 }
9241
9242 if (quantity_max <= 0)
9244
9245 return quantity_max;
9246 }
9247
9249 {
9251 }
9252
9254 {
9256 }
9257
9258
9260 {
9262 }
9263
9265 {
9267 }
9268
9270 {
9272 }
9273
9274
9276 {
9277
9278 float weightEx = GetWeightEx();
9279 float special = GetInventoryAndCargoWeight();
9280 return weightEx - special;
9281 }
9282
9283
9285 {
9287 }
9288
9290 {
9292 {
9293 #ifdef DEVELOPER
9294 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9295 {
9296 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9298 }
9299 #endif
9300
9302 }
9303 else if (HasEnergyManager())
9304 {
9305 #ifdef DEVELOPER
9306 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9307 {
9308 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9309 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9310 }
9311 #endif
9312 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
9313 }
9314 else
9315 {
9316 #ifdef DEVELOPER
9317 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9318 {
9319 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9320 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9321 }
9322 #endif
9323 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9324 }
9325 }
9326
9329 {
9330 int item_count = 0;
9332
9333 if (GetInventory().GetCargo() != NULL)
9334 {
9335 item_count = GetInventory().GetCargo().GetItemCount();
9336 }
9337
9338 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9339 {
9340 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9341 if (item)
9342 item_count += item.GetNumberOfItems();
9343 }
9344 return item_count;
9345 }
9346
9349 {
9350 float weight = 0;
9351 float wetness = 1;
9352 if (include_wetness)
9355 {
9356 weight = wetness * m_ConfigWeight;
9357 }
9359 {
9360 weight = 1;
9361 }
9362 return weight;
9363 }
9364
9365
9366
9368 {
9369 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9370 {
9371 GameInventory inv = GetInventory();
9372 array<EntityAI> items = new array<EntityAI>;
9374 for (int i = 0; i < items.Count(); i++)
9375 {
9377 if (item)
9378 {
9380 }
9381 }
9382 }
9383 }
9384
9385
9386
9387
9389 {
9390 float energy = 0;
9391 if (HasEnergyManager())
9392 {
9393 energy = GetCompEM().GetEnergy();
9394 }
9395 return energy;
9396 }
9397
9398
9400 {
9401 super.OnEnergyConsumed();
9402
9404 }
9405
9407 {
9408 super.OnEnergyAdded();
9409
9411 }
9412
9413
9415 {
9416 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9417 {
9419 {
9420 float energy_0to1 = GetCompEM().GetEnergy0To1();
9422 }
9423 }
9424 }
9425
9426
9428 {
9429 return ConfigGetFloat("heatIsolation");
9430 }
9431
9433 {
9435 }
9436
9438 {
9439 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9440 if (
GetGame().ConfigIsExisting(paramPath))
9442
9443 return 0.0;
9444 }
9445
9447 {
9448 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9449 if (
GetGame().ConfigIsExisting(paramPath))
9451
9452 return 0.0;
9453 }
9454
9455 override void SetWet(
float value,
bool allow_client =
false)
9456 {
9457 if (!IsServerCheck(allow_client))
9458 return;
9459
9462
9464
9465 m_VarWet = Math.Clamp(value, min, max);
9466
9468 {
9471 }
9472 }
9473
9474 override void AddWet(
float value)
9475 {
9477 }
9478
9480 {
9482 }
9483
9485 {
9487 }
9488
9490 {
9492 }
9493
9495 {
9497 }
9498
9500 {
9502 }
9503
9505 {
9508 if (newLevel != oldLevel)
9509 {
9511 }
9512 }
9513
9515 {
9516 SetWeightDirty();
9517 }
9518
9520 {
9521 return GetWetLevelInternal(
m_VarWet);
9522 }
9523
9524
9525
9527 {
9529 }
9530
9532 {
9534 }
9535
9537 {
9539 }
9540
9542 {
9544 }
9545
9546
9547
9549 {
9550 if (ConfigIsExisting("itemModelLength"))
9551 {
9552 return ConfigGetFloat("itemModelLength");
9553 }
9554 return 0;
9555 }
9556
9558 {
9559 if (ConfigIsExisting("itemAttachOffset"))
9560 {
9561 return ConfigGetFloat("itemAttachOffset");
9562 }
9563 return 0;
9564 }
9565
9566 override void SetCleanness(
int value,
bool allow_client =
false)
9567 {
9568 if (!IsServerCheck(allow_client))
9569 return;
9570
9572
9574
9577 }
9578
9580 {
9582 }
9583
9585 {
9586 return true;
9587 }
9588
9589
9590
9591
9593 {
9595 }
9596
9598 {
9600 }
9601
9602
9603
9604
9605 override void SetColor(
int r,
int g,
int b,
int a)
9606 {
9612 }
9614 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9615 {
9620 }
9621
9623 {
9625 }
9626
9629 {
9630 int r,g,b,a;
9632 r = r/255;
9633 g = g/255;
9634 b = b/255;
9635 a = a/255;
9636 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9637 }
9638
9639
9640
9641 override void SetLiquidType(
int value,
bool allow_client =
false)
9642 {
9643 if (!IsServerCheck(allow_client))
9644 return;
9645
9650 }
9651
9653 {
9654 return ConfigGetInt("varLiquidTypeInit");
9655 }
9656
9658 {
9660 }
9661
9663 {
9665 SetFrozen(false);
9666 }
9667
9670 {
9671 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9672 }
9673
9674
9677 {
9678 PlayerBase nplayer;
9679 if (PlayerBase.CastTo(nplayer, player))
9680 {
9682
9683 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9684 }
9685 }
9686
9687
9690 {
9691 PlayerBase nplayer;
9692 if (PlayerBase.CastTo(nplayer,player))
9693 {
9694
9695 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9696
9697 }
9698
9699
9700 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9701
9702
9703 if (HasEnergyManager())
9704 {
9705 GetCompEM().UpdatePlugState();
9706 }
9707 }
9708
9709
9711 {
9712 super.OnPlacementStarted(player);
9713
9715 }
9716
9717 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9718 {
9720 {
9721 m_AdminLog.OnPlacementComplete(player,
this);
9722 }
9723
9724 super.OnPlacementComplete(player, position, orientation);
9725 }
9726
9727
9728
9729
9730
9732 {
9734 {
9735 return true;
9736 }
9737 else
9738 {
9739 return false;
9740 }
9741 }
9742
9743
9745 {
9747 {
9749 }
9750 }
9751
9752
9754 {
9756 }
9757
9759 {
9761 }
9762
9763 override void InsertAgent(
int agent,
float count = 1)
9764 {
9765 if (count < 1)
9766 return;
9767
9769 }
9770
9773 {
9775 }
9776
9777
9779 {
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
9818
9819
9820
9821
9822
9823
9825 {
9827 return false;
9828 return true;
9829 }
9830
9832 {
9833
9835 }
9836
9837
9840 {
9841 super.CheckForRoofLimited(timeTresholdMS);
9842
9844 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9845 {
9846 m_PreviousRoofTestTime = time;
9847 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9848 }
9849 }
9850
9851
9853 {
9855 {
9856 return 0;
9857 }
9858
9859 if (GetInventory().GetAttachmentSlotsCount() != 0)
9860 {
9861 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9862 if (filter)
9863 return filter.GetProtectionLevel(type, false, system);
9864 else
9865 return 0;
9866 }
9867
9868 string subclassPath, entryName;
9869
9870 switch (type)
9871 {
9873 entryName = "biological";
9874 break;
9876 entryName = "chemical";
9877 break;
9878 default:
9879 entryName = "biological";
9880 break;
9881 }
9882
9883 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9884
9886 }
9887
9888
9889
9892 {
9893 if (!IsMagazine())
9895
9897 }
9898
9899
9900
9901
9902
9907 {
9908 return true;
9909 }
9910
9912 {
9914 }
9915
9916
9917
9918
9919
9921 {
9922 if (parent)
9923 {
9924 if (parent.IsInherited(DayZInfected))
9925 return true;
9926
9927 if (!parent.IsRuined())
9928 return true;
9929 }
9930
9931 return true;
9932 }
9933
9935 {
9936 if (!super.CanPutAsAttachment(parent))
9937 {
9938 return false;
9939 }
9940
9941 if (!IsRuined() && !parent.IsRuined())
9942 {
9943 return true;
9944 }
9945
9946 return false;
9947 }
9948
9950 {
9951
9952
9953
9954
9955 return super.CanReceiveItemIntoCargo(item);
9956 }
9957
9959 {
9960
9961
9962
9963
9964 GameInventory attachmentInv = attachment.GetInventory();
9966 {
9967 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9968 return false;
9969 }
9970
9971 InventoryLocation loc = new InventoryLocation();
9972 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9973 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9974 return false;
9975
9976 return super.CanReceiveAttachment(attachment, slotId);
9977 }
9978
9980 {
9981 if (!super.CanReleaseAttachment(attachment))
9982 return false;
9983
9984 return GetInventory().AreChildrenAccessible();
9985 }
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10008 {
10009 int id = muzzle_owner.GetMuzzleID();
10010 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10011
10012 if (WPOF_array)
10013 {
10014 for (int i = 0; i < WPOF_array.Count(); i++)
10015 {
10016 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10017
10018 if (WPOF)
10019 {
10020 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10021 }
10022 }
10023 }
10024 }
10025
10026
10028 {
10029 int id = muzzle_owner.GetMuzzleID();
10031
10032 if (WPOBE_array)
10033 {
10034 for (int i = 0; i < WPOBE_array.Count(); i++)
10035 {
10036 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10037
10038 if (WPOBE)
10039 {
10040 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10041 }
10042 }
10043 }
10044 }
10045
10046
10048 {
10049 int id = muzzle_owner.GetMuzzleID();
10050 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10051
10052 if (WPOOH_array)
10053 {
10054 for (int i = 0; i < WPOOH_array.Count(); i++)
10055 {
10056 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10057
10058 if (WPOOH)
10059 {
10060 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10061 }
10062 }
10063 }
10064 }
10065
10066
10068 {
10069 int id = muzzle_owner.GetMuzzleID();
10070 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10071
10072 if (WPOOH_array)
10073 {
10074 for (int i = 0; i < WPOOH_array.Count(); i++)
10075 {
10076 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10077
10078 if (WPOOH)
10079 {
10080 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10081 }
10082 }
10083 }
10084 }
10085
10086
10088 {
10089 int id = muzzle_owner.GetMuzzleID();
10090 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10091
10092 if (WPOOH_array)
10093 {
10094 for (int i = 0; i < WPOOH_array.Count(); i++)
10095 {
10096 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10097
10098 if (WPOOH)
10099 {
10100 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10101 }
10102 }
10103 }
10104 }
10105
10106
10107
10109 {
10111 {
10112 return true;
10113 }
10114
10115 return false;
10116 }
10117
10119 {
10121 {
10122 return true;
10123 }
10124
10125 return false;
10126 }
10127
10129 {
10131 {
10132 return true;
10133 }
10134
10135 return false;
10136 }
10137
10139 {
10140 return false;
10141 }
10142
10145 {
10146 return UATimeSpent.DEFAULT_DEPLOY;
10147 }
10148
10149
10150
10151
10153 {
10155 SetSynchDirty();
10156 }
10157
10159 {
10161 }
10162
10163
10165 {
10166 return false;
10167 }
10168
10171 {
10172 string att_type = "None";
10173
10174 if (ConfigIsExisting("soundAttType"))
10175 {
10176 att_type = ConfigGetString("soundAttType");
10177 }
10178
10180 }
10181
10183 {
10185 }
10186
10187
10188
10189
10190
10196
10198 {
10201
10203 }
10204
10205
10207 {
10209 return;
10210
10212
10215
10218
10219 SoundParameters params = new SoundParameters();
10223 }
10224
10225
10227 {
10229 return;
10230
10232 SetSynchDirty();
10233
10236 }
10237
10238
10240 {
10242 return;
10243
10245 SetSynchDirty();
10246
10249 }
10250
10252 {
10254 }
10255
10257 {
10259 }
10260
10263 {
10264 if (!
GetGame().IsDedicatedServer())
10265 {
10266 if (ConfigIsExisting("attachSoundSet"))
10267 {
10268 string cfg_path = "";
10269 string soundset = "";
10270 string type_name =
GetType();
10271
10274 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10275 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10276
10277 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10278 {
10279 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10280 {
10281 if (cfg_slot_array[i] == slot_type)
10282 {
10283 soundset = cfg_soundset_array[i];
10284 break;
10285 }
10286 }
10287 }
10288
10289 if (soundset != "")
10290 {
10291 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10293 }
10294 }
10295 }
10296 }
10297
10299 {
10300
10301 }
10302
10303 void OnApply(PlayerBase player);
10304
10306 {
10307 return 1.0;
10308 };
10309
10311 {
10313 }
10314
10316 {
10318 }
10319
10321
10323 {
10324 SetDynamicPhysicsLifeTime(0.01);
10326 }
10327
10329 {
10330 array<string> zone_names = new array<string>;
10331 GetDamageZones(zone_names);
10332 for (int i = 0; i < zone_names.Count(); i++)
10333 {
10334 SetHealthMax(zone_names.Get(i),"Health");
10335 }
10336 SetHealthMax("","Health");
10337 }
10338
10341 {
10342 float global_health = GetHealth01("","Health");
10343 array<string> zones = new array<string>;
10344 GetDamageZones(zones);
10345
10346 for (int i = 0; i < zones.Count(); i++)
10347 {
10348 SetHealth01(zones.Get(i),"Health",global_health);
10349 }
10350 }
10351
10354 {
10355 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10356 }
10357
10359 {
10360 if (!hasRootAsPlayer)
10361 {
10362 if (refParentIB)
10363 {
10364
10365 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10366 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10367
10368 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10369 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10370
10373 }
10374 else
10375 {
10376
10379 }
10380 }
10381 }
10382
10384 {
10386 {
10387 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10388 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10389 {
10390 float heatPermCoef = 1.0;
10392 while (ent)
10393 {
10394 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10395 ent = ent.GetHierarchyParent();
10396 }
10397
10398 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10399 }
10400 }
10401 }
10402
10404 {
10405
10406 EntityAI parent = GetHierarchyParent();
10407 if (!parent)
10408 {
10409 hasParent = false;
10410 hasRootAsPlayer = false;
10411 }
10412 else
10413 {
10414 hasParent = true;
10415 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10416 refParentIB =
ItemBase.Cast(parent);
10417 }
10418 }
10419
10420 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10421 {
10422
10423 }
10424
10426 {
10427
10428 return false;
10429 }
10430
10432 {
10433
10434
10435 return false;
10436 }
10437
10439 {
10440
10441 return false;
10442 }
10443
10446 {
10447 return !GetIsFrozen() &&
IsOpen();
10448 }
10449
10451 {
10452 bool hasParent = false, hasRootAsPlayer = false;
10454
10455 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10456 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10457
10458 if (wwtu || foodDecay)
10459 {
10463
10464 if (processWetness || processTemperature || processDecay)
10465 {
10467
10468 if (processWetness)
10469 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10470
10471 if (processTemperature)
10473
10474 if (processDecay)
10475 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10476 }
10477 }
10478 }
10479
10482 {
10484 }
10485
10487 {
10490
10491 return super.GetTemperatureFreezeThreshold();
10492 }
10493
10495 {
10498
10499 return super.GetTemperatureThawThreshold();
10500 }
10501
10503 {
10506
10507 return super.GetItemOverheatThreshold();
10508 }
10509
10511 {
10513 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10514
10515 return super.GetTemperatureFreezeTime();
10516 }
10517
10519 {
10521 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10522
10523 return super.GetTemperatureThawTime();
10524 }
10525
10530
10532 {
10533 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10534 }
10535
10537 {
10538 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10539 }
10540
10543 {
10545 }
10546
10548 {
10550 }
10551
10553 {
10555 }
10556
10559 {
10560 return null;
10561 }
10562
10565 {
10566 return false;
10567 }
10568
10570 {
10572 {
10575 if (!trg)
10576 {
10578 explosive = this;
10579 }
10580
10581 explosive.PairRemote(trg);
10583
10584 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10585 trg.SetPersistentPairID(persistentID);
10586 explosive.SetPersistentPairID(persistentID);
10587
10588 return true;
10589 }
10590 return false;
10591 }
10592
10595 {
10596 float ret = 1.0;
10599 ret *= GetHealth01();
10600
10601 return ret;
10602 }
10603
10604 #ifdef DEVELOPER
10605 override void SetDebugItem()
10606 {
10607 super.SetDebugItem();
10608 _itemBase = this;
10609 }
10610
10612 {
10613 string text = super.GetDebugText();
10614
10616 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10617
10618 return text;
10619 }
10620 #endif
10621
10623 {
10624 return true;
10625 }
10626
10628
10630
10632 {
10635 }
10636
10637
10645
10661}
10662
10664{
10666 if (entity)
10667 {
10668 bool is_item = entity.IsInherited(
ItemBase);
10669 if (is_item && full_quantity)
10670 {
10673 }
10674 }
10675 else
10676 {
10678 return NULL;
10679 }
10680 return entity;
10681}
10682
10684{
10685 if (item)
10686 {
10687 if (health > 0)
10688 item.SetHealth("", "", health);
10689
10690 if (item.CanHaveTemperature())
10691 {
10693 if (item.CanFreeze())
10694 item.SetFrozen(false);
10695 }
10696
10697 if (item.HasEnergyManager())
10698 {
10699 if (quantity >= 0)
10700 {
10701 item.GetCompEM().SetEnergy0To1(quantity);
10702 }
10703 else
10704 {
10706 }
10707 }
10708 else if (item.IsMagazine())
10709 {
10710 Magazine mag = Magazine.Cast(item);
10711 if (quantity >= 0)
10712 {
10713 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10714 }
10715 else
10716 {
10718 }
10719
10720 }
10721 else
10722 {
10723 if (quantity >= 0)
10724 {
10725 item.SetQuantityNormalized(quantity, false);
10726 }
10727 else
10728 {
10730 }
10731
10732 }
10733 }
10734}
10735
10736#ifdef DEVELOPER
10738#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.