5762{
5764 {
5765 return true;
5766 }
5767};
5768
5769
5770
5772{
5776
5778
5781
5782
5783
5784
5785
5794
5800
5805
5810
5831 protected bool m_IsResultOfSplit
5832
5834
5839
5840
5841
5843
5847
5848
5849
5851
5854
5855
5856
5862
5863
5871
5874
5875
5877
5878
5880
5881
5886
5887
5892
5893
5895
5896
5898 {
5903
5904 if (!
GetGame().IsDedicatedServer())
5905 {
5907 {
5909
5911 {
5913 }
5914 }
5915
5918 }
5919
5920 m_OldLocation = null;
5921
5923 {
5925 }
5926
5927 if (ConfigIsExisting("headSelectionsToHide"))
5928 {
5931 }
5932
5934 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5935 {
5937 }
5938
5940
5941 m_IsResultOfSplit = false;
5942
5944 }
5945
5947 {
5948 super.InitItemVariables();
5949
5955 m_Count = ConfigGetInt(
"count");
5956
5959
5964
5967
5972
5984
5988
5989
5992 if (ConfigIsExisting("canBeSplit"))
5993 {
5996 }
5997
5999 if (ConfigIsExisting("itemBehaviour"))
6001
6002
6005 RegisterNetSyncVariableInt("m_VarLiquidType");
6006 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6007
6008 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6009 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6010 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6011
6012 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6013 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6014 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6015 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6016
6017 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6018 RegisterNetSyncVariableBool("m_IsTakeable");
6019 RegisterNetSyncVariableBool("m_IsHologram");
6020
6023 {
6026 }
6027
6029
6031 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6033
6034 }
6035
6037 {
6039 }
6040
6042 {
6045 {
6050 }
6051 }
6052
6053 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6054 {
6056 {
6059 }
6060
6062 }
6063
6065 {
6071 }
6072
6074
6076 {
6078
6079 if (!action)
6080 {
6081 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6082 return;
6083 }
6084
6086 if (!ai)
6087 {
6089 return;
6090 }
6091
6093 if (!action_array)
6094 {
6095 action_array = new array<ActionBase_Basic>;
6097 }
6098 if (LogManager.IsActionLogEnable())
6099 {
6100 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6101 }
6102
6103 if (action_array.Find(action) != -1)
6104 {
6105 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6106 }
6107 else
6108 {
6109 action_array.Insert(action);
6110 }
6111 }
6112
6114 {
6116 ActionBase action = player.GetActionManager().GetAction(actionName);
6119
6120 if (action_array)
6121 {
6122 action_array.RemoveItem(action);
6123 }
6124 }
6125
6126
6127
6129 {
6130 ActionOverrideData overrideData = new ActionOverrideData();
6134
6136 if (!actionMap)
6137 {
6140 }
6141
6142 actionMap.Insert(this.
Type(), overrideData);
6143
6144 }
6145
6147
6149
6150
6152 {
6155
6158
6159 string config_to_search = "CfgVehicles";
6160 string muzzle_owner_config;
6161
6163 {
6164 if (IsInherited(Weapon))
6165 config_to_search = "CfgWeapons";
6166
6167 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6168
6169 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6170
6172
6173 if (config_OnFire_subclass_count > 0)
6174 {
6175 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6176
6177 for (int i = 0; i < config_OnFire_subclass_count; i++)
6178 {
6179 string particle_class = "";
6181 string config_OnFire_entry = config_OnFire_class + particle_class;
6182 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6183 WPOF_array.Insert(WPOF);
6184 }
6185
6186
6188 }
6189 }
6190
6192 {
6193 config_to_search = "CfgWeapons";
6194 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6195
6196 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6197
6199
6200 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6201 {
6202 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6203
6204 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6205 {
6206 string particle_class2 = "";
6208 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6209 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6210 WPOBE_array.Insert(WPOBE);
6211 }
6212
6213
6215 }
6216 }
6217 }
6218
6219
6221 {
6224
6226 {
6227 string config_to_search = "CfgVehicles";
6228
6229 if (IsInherited(Weapon))
6230 config_to_search = "CfgWeapons";
6231
6232 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6233 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6234
6235 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6236 {
6237
6239
6241 {
6243 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6245 return;
6246 }
6247
6250
6251
6252
6254 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6255
6256 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6257 {
6258 string particle_class = "";
6260 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6262
6263 if (entry_type == CT_CLASS)
6264 {
6265 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6266 WPOOH_array.Insert(WPOF);
6267 }
6268 }
6269
6270
6272 }
6273 }
6274 }
6275
6277 {
6279 }
6280
6282 {
6284 {
6286
6289
6292
6293 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6294 }
6295 }
6296
6298 {
6300 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6301
6303 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6304
6306 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6307
6309 {
6311 }
6312 }
6313
6315 {
6317 }
6318
6320 {
6323 else
6325
6327 {
6330 }
6331 else
6332 {
6335
6338 }
6339
6341 }
6342
6344 {
6346 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6347 }
6348
6350 {
6352 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6354 }
6355
6357 {
6359 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6360 }
6361
6363 {
6366
6367 OverheatingParticle OP = new OverheatingParticle();
6372
6374 }
6375
6377 {
6380
6381 return -1;
6382 }
6383
6385 {
6387 {
6390
6391 for (int i = count; i > 0; --i)
6392 {
6393 int id = i - 1;
6396
6399
6400 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6401 {
6402 if (p)
6403 {
6406 }
6407 }
6408 }
6409 }
6410 }
6411
6413 {
6415 {
6417 {
6418 int id = i - 1;
6420
6421 if (OP)
6422 {
6424
6425 if (p)
6426 {
6428 }
6429
6430 delete OP;
6431 }
6432 }
6433
6436 }
6437 }
6438
6441 {
6442 return 0.0;
6443 }
6444
6445
6447 {
6448 return 250;
6449 }
6450
6452 {
6453 return 0;
6454 }
6455
6458 {
6460 return true;
6461
6462 return false;
6463 }
6464
6467 {
6470
6472 {
6474 }
6475 else
6476 {
6477
6479 }
6480
6482 }
6483
6490 {
6491 return -1;
6492 }
6493
6494
6495
6496
6498 {
6500 {
6502 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6503
6504 if (r_index >= 0)
6505 {
6506 InventoryLocation r_il = new InventoryLocation;
6507 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6508
6509 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6512 {
6513 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6514 }
6516 {
6517 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6518 }
6519
6520 }
6521
6522 player.GetHumanInventory().ClearUserReservedLocation(this);
6523 }
6524
6527 }
6528
6529
6530
6531
6533 {
6534 return ItemBase.m_DebugActionsMask;
6535 }
6536
6538 {
6539 return ItemBase.m_DebugActionsMask & mask;
6540 }
6541
6543 {
6544 ItemBase.m_DebugActionsMask = mask;
6545 }
6546
6548 {
6549 ItemBase.m_DebugActionsMask |= mask;
6550 }
6551
6553 {
6554 ItemBase.m_DebugActionsMask &= ~mask;
6555 }
6556
6558 {
6560 {
6562 }
6563 else
6564 {
6566 }
6567 }
6568
6569
6571 {
6572 if (GetEconomyProfile())
6573 {
6574 float q_max = GetEconomyProfile().GetQuantityMax();
6575 if (q_max > 0)
6576 {
6577 float q_min = GetEconomyProfile().GetQuantityMin();
6578 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6579
6581 {
6582 ComponentEnergyManager comp = GetCompEM();
6584 {
6586 }
6587 }
6589 {
6591
6592 }
6593
6594 }
6595 }
6596 }
6597
6600 {
6601 EntityAI parent = GetHierarchyParent();
6602
6603 if (parent)
6604 {
6605 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6606 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6607 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6608 }
6609 }
6610
6613 {
6614 EntityAI parent = GetHierarchyParent();
6615
6616 if (parent)
6617 {
6618 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6619 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6620 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6621 }
6622 }
6623
6625 {
6626
6627
6628
6629
6631
6633 {
6634 if (ScriptInputUserData.CanStoreInputUserData())
6635 {
6636 ScriptInputUserData ctx = new ScriptInputUserData;
6642 ctx.
Write(use_stack_max);
6645
6647 {
6648 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6649 }
6650 }
6651 }
6652 else if (!
GetGame().IsMultiplayer())
6653 {
6655 }
6656 }
6657
6659 {
6661 }
6662
6664 {
6666 }
6667
6669 {
6671 }
6672
6674 {
6675
6676 return false;
6677 }
6678
6680 {
6681 return false;
6682 }
6683
6687 {
6688 return false;
6689 }
6690
6692 {
6693 return "";
6694 }
6695
6697
6699 {
6700 return false;
6701 }
6702
6704 {
6705 return true;
6706 }
6707
6708
6709
6711 {
6712 return true;
6713 }
6714
6716 {
6717 return true;
6718 }
6719
6721 {
6722 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6724 }
6725
6727 {
6729 }
6730
6732 {
6734 if (!is_being_placed)
6736 SetSynchDirty();
6737 }
6738
6739
6741
6743 {
6745 }
6746
6748 {
6750 }
6751
6753 {
6754 return 1;
6755 }
6756
6758 {
6759 return false;
6760 }
6761
6763 {
6765 SetSynchDirty();
6766 }
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6803 {
6804 super.OnMovedInsideCargo(container);
6805
6806 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6807 }
6808
6809 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6810 {
6811 super.EEItemLocationChanged(oldLoc,newLoc);
6812
6813 PlayerBase new_player = null;
6814 PlayerBase old_player = null;
6815
6816 if (newLoc.GetParent())
6817 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6818
6819 if (oldLoc.GetParent())
6820 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6821
6823 {
6824 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6825
6826 if (r_index >= 0)
6827 {
6828 InventoryLocation r_il = new InventoryLocation;
6829 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6830
6831 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6834 {
6835 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6836 }
6838 {
6839 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6840 }
6841
6842 }
6843 }
6844
6846 {
6847 if (new_player)
6848 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6849
6850 if (new_player == old_player)
6851 {
6852
6853 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6854 {
6856 {
6857 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6858 {
6859 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6860 }
6861 }
6862 else
6863 {
6864 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6865 }
6866 }
6867
6868 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6869 {
6870 int type = oldLoc.GetType();
6872 {
6873 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6874 }
6876 {
6877 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6878 }
6879 }
6880 if (!m_OldLocation)
6881 {
6882 m_OldLocation = new InventoryLocation;
6883 }
6884 m_OldLocation.Copy(oldLoc);
6885 }
6886 else
6887 {
6888 if (m_OldLocation)
6889 {
6890 m_OldLocation.Reset();
6891 }
6892 }
6893
6895 }
6896 else
6897 {
6898 if (new_player)
6899 {
6900 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6901 if (res_index >= 0)
6902 {
6903 InventoryLocation il = new InventoryLocation;
6904 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6906 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6909 {
6910 il.
GetParent().GetOnReleaseLock().Invoke(it);
6911 }
6913 {
6915 }
6916
6917 }
6918 }
6920 {
6921
6923 }
6924
6925 if (m_OldLocation)
6926 {
6927 m_OldLocation.Reset();
6928 }
6929 }
6930 }
6931
6932 override void EOnContact(IEntity other, Contact extra)
6933 {
6935 {
6936 int liquidType = -1;
6938 if (impactSpeed > 0.0)
6939 {
6941 #ifndef SERVER
6943 #else
6945 SetSynchDirty();
6946 #endif
6948 }
6949 }
6950
6951 #ifdef SERVER
6952 if (GetCompEM() && GetCompEM().IsPlugged())
6953 {
6954 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6955 GetCompEM().UnplugThis();
6956 }
6957 #endif
6958 }
6959
6961
6963 {
6965 }
6966
6968 {
6969
6970 }
6971
6973 {
6974 super.OnItemLocationChanged(old_owner, new_owner);
6975
6976 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6977 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6978
6979 if (!relatedPlayer && playerNew)
6980 relatedPlayer = playerNew;
6981
6982 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6983 {
6985 if (actionMgr)
6986 {
6987 ActionBase currentAction = actionMgr.GetRunningAction();
6988 if (currentAction)
6990 }
6991 }
6992
6993 Man ownerPlayerOld = null;
6994 Man ownerPlayerNew = null;
6995
6996 if (old_owner)
6997 {
6998 if (old_owner.
IsMan())
6999 {
7000 ownerPlayerOld = Man.Cast(old_owner);
7001 }
7002 else
7003 {
7004 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7005 }
7006 }
7007 else
7008 {
7010 {
7012
7013 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7014 {
7015 GetCompEM().UnplugThis();
7016 }
7017 }
7018 }
7019
7020 if (new_owner)
7021 {
7022 if (new_owner.
IsMan())
7023 {
7024 ownerPlayerNew = Man.Cast(new_owner);
7025 }
7026 else
7027 {
7028 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7029 }
7030 }
7031
7032 if (ownerPlayerOld != ownerPlayerNew)
7033 {
7034 if (ownerPlayerOld)
7035 {
7036 array<EntityAI> subItemsExit = new array<EntityAI>;
7038 for (int i = 0; i < subItemsExit.Count(); i++)
7039 {
7042 }
7043 }
7044
7045 if (ownerPlayerNew)
7046 {
7047 array<EntityAI> subItemsEnter = new array<EntityAI>;
7049 for (int j = 0; j < subItemsEnter.Count(); j++)
7050 {
7053 }
7054 }
7055 }
7056 else if (ownerPlayerNew != null)
7057 {
7058 PlayerBase nplayer;
7059 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7060 {
7061 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7063 for (int k = 0; k < subItemsUpdate.Count(); k++)
7064 {
7066 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7067 }
7068 }
7069 }
7070
7071 if (old_owner)
7072 old_owner.OnChildItemRemoved(this);
7073 if (new_owner)
7074 new_owner.OnChildItemReceived(this);
7075 }
7076
7077
7079 {
7080 super.EEDelete(parent);
7081 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7082 if (player)
7083 {
7085
7086 if (player.IsAlive())
7087 {
7088 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7089 if (r_index >= 0)
7090 {
7091 InventoryLocation r_il = new InventoryLocation;
7092 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7093
7094 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7097 {
7098 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7099 }
7101 {
7102 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7103 }
7104
7105 }
7106
7107 player.RemoveQuickBarEntityShortcut(this);
7108 }
7109 }
7110 }
7111
7113 {
7114 super.EEKilled(killer);
7115
7118 {
7119 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7120 {
7121 if (IsMagazine())
7122 {
7123 if (Magazine.Cast(this).GetAmmoCount() > 0)
7124 {
7126 }
7127 }
7128 else
7129 {
7131 }
7132 }
7133 }
7134 }
7135
7137 {
7138 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7139
7140 super.OnWasAttached(parent, slot_id);
7141
7144
7146 }
7147
7149 {
7150 super.OnWasDetached(parent, slot_id);
7151
7154 }
7155
7157 {
7158 int idx;
7161
7162 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7163 if (inventory_slots.Count() < 1)
7164 {
7165 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7166 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7167 }
7168 else
7169 {
7170 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7171 }
7172
7173 idx = inventory_slots.Find(slot);
7174 if (idx < 0)
7175 return "";
7176
7177 return attach_types.Get(idx);
7178 }
7179
7181 {
7182 int idx = -1;
7183 string slot;
7184
7187
7188 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7189 if (inventory_slots.Count() < 1)
7190 {
7191 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7192 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7193 }
7194 else
7195 {
7196 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7197 if (detach_types.Count() < 1)
7198 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7199 }
7200
7201 for (int i = 0; i < inventory_slots.Count(); i++)
7202 {
7203 slot = inventory_slots.Get(i);
7204 }
7205
7206 if (slot != "")
7207 {
7208 if (detach_types.Count() == 1)
7209 idx = 0;
7210 else
7211 idx = inventory_slots.Find(slot);
7212 }
7213 if (idx < 0)
7214 return "";
7215
7216 return detach_types.Get(idx);
7217 }
7218
7220 {
7221
7223
7224
7225 float min_time = 1;
7226 float max_time = 3;
7227 float delay = Math.RandomFloat(min_time, max_time);
7228
7229 explode_timer.Run(delay, this, "DoAmmoExplosion");
7230 }
7231
7233 {
7234 Magazine magazine = Magazine.Cast(this);
7235 int pop_sounds_count = 6;
7236 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7237
7238
7239 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7240 string sound_name = pop_sounds[ sound_idx ];
7242
7243
7244 magazine.ServerAddAmmoCount(-1);
7245
7246
7247 float min_temp_to_explode = 100;
7248
7249 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7250 {
7252 }
7253 }
7254
7255
7256 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7257 {
7258 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7259
7260 const int CHANCE_DAMAGE_CARGO = 4;
7261 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7262 const int CHANCE_DAMAGE_NOTHING = 2;
7263
7265 {
7266 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7267 int chances;
7268 int rnd;
7269
7270 if (GetInventory().GetCargo())
7271 {
7272 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7273 rnd = Math.RandomInt(0,chances);
7274
7275 if (rnd < CHANCE_DAMAGE_CARGO)
7276 {
7278 }
7279 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7280 {
7282 }
7283 }
7284 else
7285 {
7286 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7287 rnd = Math.RandomInt(0,chances);
7288
7289 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7290 {
7292 }
7293 }
7294 }
7295 }
7296
7298 {
7299 if (GetInventory().GetCargo())
7300 {
7301 int item_count = GetInventory().GetCargo().GetItemCount();
7302 if (item_count > 0)
7303 {
7304 int random_pick = Math.RandomInt(0, item_count);
7306 if (!item.IsExplosive())
7307 {
7308 item.AddHealth("","",damage);
7309 return true;
7310 }
7311 }
7312 }
7313 return false;
7314 }
7315
7317 {
7318 int attachment_count = GetInventory().AttachmentCount();
7319 if (attachment_count > 0)
7320 {
7321 int random_pick = Math.RandomInt(0, attachment_count);
7322 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7323 if (!attachment.IsExplosive())
7324 {
7325 attachment.AddHealth("","",damage);
7326 return true;
7327 }
7328 }
7329 return false;
7330 }
7331
7333 {
7335 }
7336
7338 {
7340 return GetInventory().CanRemoveEntity();
7341
7342 return false;
7343 }
7344
7346 {
7348 return;
7349
7351 {
7352 if (ScriptInputUserData.CanStoreInputUserData())
7353 {
7354 ScriptInputUserData ctx = new ScriptInputUserData;
7359 ctx.
Write(destination_entity);
7363 }
7364 }
7365 else if (!
GetGame().IsMultiplayer())
7366 {
7368 }
7369 }
7370
7372 {
7374 return;
7375
7376 float split_quantity_new;
7380 InventoryLocation loc = new InventoryLocation;
7381
7382 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7383 {
7385 split_quantity_new = stack_max;
7386 else
7388
7389 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7390 if (new_item)
7391 {
7392 new_item.SetResultOfSplit(true);
7393 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7395 new_item.SetQuantity(split_quantity_new);
7396 }
7397 }
7398 else if (destination_entity && slot_id == -1)
7399 {
7400 if (quantity > stack_max)
7401 split_quantity_new = stack_max;
7402 else
7403 split_quantity_new = quantity;
7404
7406 {
7409 }
7410
7411 if (new_item)
7412 {
7413 new_item.SetResultOfSplit(true);
7414 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7416 new_item.SetQuantity(split_quantity_new);
7417 }
7418 }
7419 else
7420 {
7421 if (stack_max != 0)
7422 {
7424 {
7426 }
7427
7428 if (split_quantity_new == 0)
7429 {
7430 if (!
GetGame().IsMultiplayer())
7431 player.PhysicalPredictiveDropItem(this);
7432 else
7433 player.ServerDropEntity(this);
7434 return;
7435 }
7436
7438
7439 if (new_item)
7440 {
7441 new_item.SetResultOfSplit(true);
7442 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7444 new_item.SetQuantity(stack_max);
7445 new_item.PlaceOnSurface();
7446 }
7447 }
7448 }
7449 }
7450
7452 {
7454 return;
7455
7456 float split_quantity_new;
7460 InventoryLocation loc = new InventoryLocation;
7461
7462 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7463 {
7465 split_quantity_new = stack_max;
7466 else
7468
7469 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7470 if (new_item)
7471 {
7472 new_item.SetResultOfSplit(true);
7473 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7475 new_item.SetQuantity(split_quantity_new);
7476 }
7477 }
7478 else if (destination_entity && slot_id == -1)
7479 {
7480 if (quantity > stack_max)
7481 split_quantity_new = stack_max;
7482 else
7483 split_quantity_new = quantity;
7484
7486 {
7489 }
7490
7491 if (new_item)
7492 {
7493 new_item.SetResultOfSplit(true);
7494 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7496 new_item.SetQuantity(split_quantity_new);
7497 }
7498 }
7499 else
7500 {
7501 if (stack_max != 0)
7502 {
7504 {
7506 }
7507
7509
7510 if (new_item)
7511 {
7512 new_item.SetResultOfSplit(true);
7513 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7515 new_item.SetQuantity(stack_max);
7516 new_item.PlaceOnSurface();
7517 }
7518 }
7519 }
7520 }
7521
7523 {
7525 return;
7526
7528 {
7529 if (ScriptInputUserData.CanStoreInputUserData())
7530 {
7531 ScriptInputUserData ctx = new ScriptInputUserData;
7536 dst.WriteToContext(ctx);
7538 }
7539 }
7540 else if (!
GetGame().IsMultiplayer())
7541 {
7543 }
7544 }
7545
7547 {
7549 return;
7550
7552 {
7553 if (ScriptInputUserData.CanStoreInputUserData())
7554 {
7555 ScriptInputUserData ctx = new ScriptInputUserData;
7560 ctx.
Write(destination_entity);
7566 }
7567 }
7568 else if (!
GetGame().IsMultiplayer())
7569 {
7571 }
7572 }
7573
7575 {
7577 }
7578
7580 {
7582 return this;
7583
7585 float split_quantity_new;
7587 if (dst.IsValid())
7588 {
7589 int slot_id = dst.GetSlot();
7591
7592 if (quantity > stack_max)
7593 split_quantity_new = stack_max;
7594 else
7595 split_quantity_new = quantity;
7596
7598
7599 if (new_item)
7600 {
7601 new_item.SetResultOfSplit(true);
7602 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7605 }
7606
7607 return new_item;
7608 }
7609
7610 return null;
7611 }
7612
7614 {
7616 return;
7617
7619 float split_quantity_new;
7621 if (destination_entity)
7622 {
7624 if (quantity > stackable)
7625 split_quantity_new = stackable;
7626 else
7627 split_quantity_new = quantity;
7628
7629 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7630 if (new_item)
7631 {
7632 new_item.SetResultOfSplit(true);
7633 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7635 new_item.SetQuantity(split_quantity_new);
7636 }
7637 }
7638 }
7639
7641 {
7643 return;
7644
7646 {
7647 if (ScriptInputUserData.CanStoreInputUserData())
7648 {
7649 ScriptInputUserData ctx = new ScriptInputUserData;
7654 ItemBase destination_entity =
this;
7655 ctx.
Write(destination_entity);
7659 }
7660 }
7661 else if (!
GetGame().IsMultiplayer())
7662 {
7664 }
7665 }
7666
7668 {
7670 return;
7671
7673 float split_quantity_new;
7675 if (player)
7676 {
7678 if (quantity > stackable)
7679 split_quantity_new = stackable;
7680 else
7681 split_quantity_new = quantity;
7682
7683 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7684 new_item =
ItemBase.Cast(in_hands);
7685 if (new_item)
7686 {
7687 new_item.SetResultOfSplit(true);
7688 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7690 new_item.SetQuantity(split_quantity_new);
7691 }
7692 }
7693 }
7694
7696 {
7698 return;
7699
7701 float split_quantity_new = Math.Floor(quantity * 0.5);
7702
7704
7705 if (new_item)
7706 {
7707 if (new_item.GetQuantityMax() < split_quantity_new)
7708 {
7709 split_quantity_new = new_item.GetQuantityMax();
7710 }
7711
7712 new_item.SetResultOfSplit(true);
7713 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7714
7716 {
7719 }
7720 else
7721 {
7724 }
7725 }
7726 }
7727
7729 {
7731 return;
7732
7734 float split_quantity_new = Math.Floor(quantity / 2);
7735
7736 InventoryLocation invloc = new InventoryLocation;
7738
7740 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7741
7742 if (new_item)
7743 {
7744 if (new_item.GetQuantityMax() < split_quantity_new)
7745 {
7746 split_quantity_new = new_item.GetQuantityMax();
7747 }
7749 {
7752 }
7753 else
7754 {
7757 }
7758 }
7759 }
7760
7763 {
7764 SetWeightDirty();
7766
7767 if (parent)
7768 parent.OnAttachmentQuantityChangedEx(this, delta);
7769
7771 {
7773 {
7775 }
7777 {
7778 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7780 }
7781 }
7782
7783 }
7784
7787 {
7788
7789 }
7790
7793 {
7795 }
7796
7798 {
7799 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7800
7802 {
7803 if (newLevel == GameConstants.STATE_RUINED)
7804 {
7806 EntityAI parent = GetHierarchyParent();
7807 if (parent && parent.IsFireplace())
7808 {
7809 CargoBase cargo = GetInventory().GetCargo();
7810 if (cargo)
7811 {
7813 {
7815 }
7816 }
7817 }
7818 }
7819
7821 {
7822
7824 return;
7825 }
7826
7827 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7828 {
7830 }
7831 }
7832 }
7833
7834
7836 {
7837 super.OnRightClick();
7838
7840 {
7842 {
7843 if (ScriptInputUserData.CanStoreInputUserData())
7844 {
7845 vector m4[4];
7847
7848 EntityAI root = GetHierarchyRoot();
7849
7850 InventoryLocation dst = new InventoryLocation;
7852 {
7853 if (root)
7854 {
7855 root.GetTransform(m4);
7857 }
7858 else
7859 GetInventory().GetCurrentInventoryLocation(dst);
7860 }
7861 else
7862 {
7864
7865
7866 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7867 {
7868 if (root)
7869 {
7870 root.GetTransform(m4);
7872 }
7873 else
7874 GetInventory().GetCurrentInventoryLocation(dst);
7875 }
7876 else
7877 {
7878 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7879 }
7880 }
7881
7882 ScriptInputUserData ctx = new ScriptInputUserData;
7890 }
7891 }
7892 else if (!
GetGame().IsMultiplayer())
7893 {
7895 }
7896 }
7897 }
7898
7899 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7900 {
7901
7902 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7903 return false;
7904
7905 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7906 return false;
7907
7908
7910 return false;
7911
7912
7913 Magazine mag = Magazine.Cast(this);
7914 if (mag)
7915 {
7916 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7917 return false;
7918
7919 if (stack_max_limit)
7920 {
7921 Magazine other_mag = Magazine.Cast(other_item);
7922 if (other_item)
7923 {
7924 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7925 return false;
7926 }
7927
7928 }
7929 }
7930 else
7931 {
7932
7934 return false;
7935
7937 return false;
7938 }
7939
7940 PlayerBase player = null;
7941 if (CastTo(player, GetHierarchyRootPlayer()))
7942 {
7943 if (player.GetInventory().HasAttachment(this))
7944 return false;
7945
7946 if (player.IsItemsToDelete())
7947 return false;
7948 }
7949
7950 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7951 return false;
7952
7953 int slotID;
7955 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7956 return false;
7957
7958 return true;
7959 }
7960
7962 {
7964 }
7965
7967 {
7968 return m_IsResultOfSplit;
7969 }
7970
7972 {
7973 m_IsResultOfSplit = value;
7974 }
7975
7977 {
7979 }
7980
7982 {
7983 float other_item_quantity = other_item.GetQuantity();
7984 float this_free_space;
7985
7987
7989
7990 if (other_item_quantity > this_free_space)
7991 {
7992 return this_free_space;
7993 }
7994 else
7995 {
7996 return other_item_quantity;
7997 }
7998 }
7999
8001 {
8003 }
8004
8006 {
8008 return;
8009
8010 if (!IsMagazine() && other_item)
8011 {
8013 if (quantity_used != 0)
8014 {
8015 float hp1 = GetHealth01("","");
8016 float hp2 = other_item.GetHealth01("","");
8017 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8018 hpResult = hpResult / (
GetQuantity() + quantity_used);
8019
8020 hpResult *= GetMaxHealth();
8021 Math.Round(hpResult);
8022 SetHealth("", "Health", hpResult);
8023
8025 other_item.AddQuantity(-quantity_used);
8026 }
8027 }
8029 }
8030
8032 {
8033 #ifdef SERVER
8034 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8035 GetHierarchyParent().IncreaseLifetimeUp();
8036 #endif
8037 };
8038
8040 {
8041 PlayerBase p = PlayerBase.Cast(player);
8042
8043 array<int> recipesIds = p.m_Recipes;
8044 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8045 if (moduleRecipesManager)
8046 {
8047 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8048 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8049 }
8050
8051 for (int i = 0;i < recipesIds.Count(); i++)
8052 {
8053 int key = recipesIds.Get(i);
8054 string recipeName = moduleRecipesManager.GetRecipeName(key);
8056 }
8057 }
8058
8059
8060 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8061 {
8062 super.GetDebugActions(outputList);
8063
8064
8069
8070
8074
8078
8079
8082
8083
8085 {
8088 }
8089
8091
8094
8098 }
8099
8100
8101
8102
8104 {
8105 super.OnAction(action_id, player, ctx);
8106 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8107 {
8108 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8109 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8110 PlayerBase p = PlayerBase.Cast(player);
8111 if (
EActions.RECIPES_RANGE_START < 1000)
8112 {
8113 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8114 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8115 }
8116 }
8117 #ifndef SERVER
8118 else if (action_id ==
EActions.WATCH_PLAYER)
8119 {
8120 PluginDeveloper.SetDeveloperItemClientEx(player);
8121 }
8122 #endif
8124 {
8125 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8126 {
8127 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8128 OnDebugButtonPressServer(id + 1);
8129 }
8130
8131 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8132 {
8133 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8135 }
8136
8137 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8138 {
8139 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8141 }
8142
8143 else if (action_id ==
EActions.ADD_QUANTITY)
8144 {
8145 if (IsMagazine())
8146 {
8147 Magazine mag = Magazine.Cast(this);
8148 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8149 }
8150 else
8151 {
8153 }
8154
8155 if (m_EM)
8156 {
8157 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8158 }
8159
8160 }
8161
8162 else if (action_id ==
EActions.REMOVE_QUANTITY)
8163 {
8164 if (IsMagazine())
8165 {
8166 Magazine mag2 = Magazine.Cast(this);
8167 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8168 }
8169 else
8170 {
8172 }
8173 if (m_EM)
8174 {
8175 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8176 }
8177
8178 }
8179
8180 else if (action_id ==
EActions.SET_QUANTITY_0)
8181 {
8183
8184 if (m_EM)
8185 {
8186 m_EM.SetEnergy(0);
8187 }
8188 }
8189
8190 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8191 {
8193
8194 if (m_EM)
8195 {
8196 m_EM.SetEnergy(m_EM.GetEnergyMax());
8197 }
8198 }
8199
8200 else if (action_id ==
EActions.ADD_HEALTH)
8201 {
8202 AddHealth("","",GetMaxHealth("","Health")/5);
8203 }
8204 else if (action_id ==
EActions.REMOVE_HEALTH)
8205 {
8206 AddHealth("","",-GetMaxHealth("","Health")/5);
8207 }
8208 else if (action_id ==
EActions.DESTROY_HEALTH)
8209 {
8210 SetHealth01("","",0);
8211 }
8212 else if (action_id ==
EActions.WATCH_ITEM)
8213 {
8215 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8216 #ifdef DEVELOPER
8217 SetDebugDeveloper_item(this);
8218 #endif
8219 }
8220
8221 else if (action_id ==
EActions.ADD_TEMPERATURE)
8222 {
8223 AddTemperature(20);
8224
8225 }
8226
8227 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8228 {
8229 AddTemperature(-20);
8230
8231 }
8232
8233 else if (action_id ==
EActions.FLIP_FROZEN)
8234 {
8235 SetFrozen(!GetIsFrozen());
8236
8237 }
8238
8239 else if (action_id ==
EActions.ADD_WETNESS)
8240 {
8242
8243 }
8244
8245 else if (action_id ==
EActions.REMOVE_WETNESS)
8246 {
8248
8249 }
8250
8251 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8252 {
8255
8256
8257 }
8258
8259 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8260 {
8263 }
8264
8265 else if (action_id ==
EActions.MAKE_SPECIAL)
8266 {
8267 auto debugParams = DebugSpawnParams.WithPlayer(player);
8268 OnDebugSpawnEx(debugParams);
8269 }
8270
8271 else if (action_id ==
EActions.DELETE)
8272 {
8273 Delete();
8274 }
8275
8276 }
8277
8278
8279 return false;
8280 }
8281
8282
8283
8284
8288
8291
8292
8293
8295 {
8296 return false;
8297 }
8298
8299
8301 {
8302 return true;
8303 }
8304
8305
8307 {
8308 return true;
8309 }
8310
8311
8312
8314 {
8315 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8317 }
8318
8321 {
8322 return null;
8323 }
8324
8326 {
8327 return false;
8328 }
8329
8331 {
8332 return false;
8333 }
8334
8338
8339
8341 {
8342 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8343 return module_repairing.CanRepair(this, item_repair_kit);
8344 }
8345
8346
8347 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8348 {
8349 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8350 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8351 }
8352
8353
8355 {
8356
8357
8358
8359
8360
8361
8362
8363
8364 return 1;
8365 }
8366
8367
8368
8370 {
8372 }
8373
8374
8375
8377 {
8379 }
8380
8381
8390 {
8391 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8392
8393 if (player)
8394 {
8395 player.MessageStatus(text);
8396 }
8397 }
8398
8399
8408 {
8409 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8410
8411 if (player)
8412 {
8413 player.MessageAction(text);
8414 }
8415 }
8416
8417
8426 {
8427 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8428
8429 if (player)
8430 {
8431 player.MessageFriendly(text);
8432 }
8433 }
8434
8435
8444 {
8445 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8446
8447 if (player)
8448 {
8449 player.MessageImportant(text);
8450 }
8451 }
8452
8454 {
8455 return true;
8456 }
8457
8458
8459 override bool KindOf(
string tag)
8460 {
8461 bool found = false;
8462 string item_name = this.
GetType();
8465
8466 int array_size = item_tag_array.Count();
8467 for (int i = 0; i < array_size; i++)
8468 {
8469 if (item_tag_array.Get(i) == tag)
8470 {
8471 found = true;
8472 break;
8473 }
8474 }
8475 return found;
8476 }
8477
8478
8480 {
8481
8482 super.OnRPC(sender, rpc_type,ctx);
8483
8484
8485 switch (rpc_type)
8486 {
8487 #ifndef SERVER
8488 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8489 Param2<bool, string> p = new Param2<bool, string>(false, "");
8490
8492 return;
8493
8494 bool play = p.param1;
8495 string soundSet = p.param2;
8496
8497 if (play)
8498 {
8500 {
8502 {
8504 }
8505 }
8506 else
8507 {
8509 }
8510 }
8511 else
8512 {
8514 }
8515
8516 break;
8517 #endif
8518
8519 }
8520
8522 {
8524 }
8525 }
8526
8527
8528
8529
8531 {
8532 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8533 return plugin.GetID(
name);
8534 }
8535
8537 {
8538 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8539 return plugin.GetName(id);
8540 }
8541
8544 {
8545
8546
8547 int varFlags;
8548 if (!ctx.
Read(varFlags))
8549 return;
8550
8551 if (varFlags & ItemVariableFlags.FLOAT)
8552 {
8554 }
8555 }
8556
8558 {
8559
8560 super.SerializeNumericalVars(floats_out);
8561
8562
8563
8565 {
8567 }
8568
8570 {
8572 }
8573
8575 {
8577 }
8578
8580 {
8585 }
8586
8588 {
8590 }
8591 }
8592
8594 {
8595
8596 super.DeSerializeNumericalVars(floats);
8597
8598
8599 int index = 0;
8600 int mask = Math.Round(floats.Get(index));
8601
8602 index++;
8603
8605 {
8607 {
8609 }
8610 else
8611 {
8612 float quantity = floats.Get(index);
8614 }
8615 index++;
8616 }
8617
8619 {
8620 float wet = floats.Get(index);
8622 index++;
8623 }
8624
8626 {
8627 int liquidtype = Math.Round(floats.Get(index));
8629 index++;
8630 }
8631
8633 {
8635 index++;
8637 index++;
8639 index++;
8641 index++;
8642 }
8643
8645 {
8646 int cleanness = Math.Round(floats.Get(index));
8648 index++;
8649 }
8650 }
8651
8653 {
8654 super.WriteVarsToCTX(ctx);
8655
8656
8658 {
8660 }
8661
8663 {
8665 }
8666
8668 {
8670 }
8671
8673 {
8674 int r,g,b,a;
8680 }
8681
8683 {
8685 }
8686 }
8687
8689 {
8690 if (!super.ReadVarsFromCTX(ctx,version))
8691 return false;
8692
8693 int intValue;
8694 float value;
8695
8696 if (version < 140)
8697 {
8698 if (!ctx.
Read(intValue))
8699 return false;
8700
8701 m_VariablesMask = intValue;
8702 }
8703
8705 {
8706 if (!ctx.
Read(value))
8707 return false;
8708
8710 {
8712 }
8713 else
8714 {
8716 }
8717 }
8718
8719 if (version < 140)
8720 {
8722 {
8723 if (!ctx.
Read(value))
8724 return false;
8725 SetTemperatureDirect(value);
8726 }
8727 }
8728
8730 {
8731 if (!ctx.
Read(value))
8732 return false;
8734 }
8735
8737 {
8738 if (!ctx.
Read(intValue))
8739 return false;
8741 }
8742
8744 {
8745 int r,g,b,a;
8747 return false;
8749 return false;
8751 return false;
8753 return false;
8754
8756 }
8757
8759 {
8760 if (!ctx.
Read(intValue))
8761 return false;
8763 }
8764
8765 if (version >= 138 && version < 140)
8766 {
8768 {
8769 if (!ctx.
Read(intValue))
8770 return false;
8771 SetFrozen(intValue);
8772 }
8773 }
8774
8775 return true;
8776 }
8777
8778
8780 {
8783 {
8785 }
8786
8787 if (!super.OnStoreLoad(ctx, version))
8788 {
8790 return false;
8791 }
8792
8793 if (version >= 114)
8794 {
8795 bool hasQuickBarIndexSaved;
8796
8797 if (!ctx.
Read(hasQuickBarIndexSaved))
8798 {
8800 return false;
8801 }
8802
8803 if (hasQuickBarIndexSaved)
8804 {
8805 int itmQBIndex;
8806
8807
8808 if (!ctx.
Read(itmQBIndex))
8809 {
8811 return false;
8812 }
8813
8814 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8815 if (itmQBIndex != -1 && parentPlayer)
8816 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8817 }
8818 }
8819 else
8820 {
8821
8822 PlayerBase player;
8823 int itemQBIndex;
8824 if (version ==
int.
MAX)
8825 {
8826 if (!ctx.
Read(itemQBIndex))
8827 {
8829 return false;
8830 }
8831 }
8832 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8833 {
8834
8835 if (!ctx.
Read(itemQBIndex))
8836 {
8838 return false;
8839 }
8840 if (itemQBIndex != -1 && player)
8841 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8842 }
8843 }
8844
8845 if (version < 140)
8846 {
8847
8848 if (!LoadVariables(ctx, version))
8849 {
8851 return false;
8852 }
8853 }
8854
8855
8857 {
8859 return false;
8860 }
8861 if (version >= 132)
8862 {
8864 if (raib)
8865 {
8867 {
8869 return false;
8870 }
8871 }
8872 }
8873
8875 return true;
8876 }
8877
8878
8879
8881 {
8882 super.OnStoreSave(ctx);
8883
8884 PlayerBase player;
8885 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8886 {
8888
8889 int itemQBIndex = -1;
8890 itemQBIndex = player.FindQuickBarEntityIndex(this);
8891 ctx.
Write(itemQBIndex);
8892 }
8893 else
8894 {
8896 }
8897
8899
8901 if (raib)
8902 {
8904 }
8905 }
8906
8907
8909 {
8910 super.AfterStoreLoad();
8911
8913 {
8915 }
8916
8918 {
8921 }
8922 }
8923
8925 {
8926 super.EEOnAfterLoad();
8927
8929 {
8931 }
8932
8935 }
8936
8938 {
8939 return false;
8940 }
8941
8942
8943
8945 {
8947 {
8948 #ifdef PLATFORM_CONSOLE
8949
8951 {
8953 if (menu)
8954 {
8956 }
8957 }
8958 #endif
8959 }
8960
8962 {
8965 }
8966
8968 {
8969 SetWeightDirty();
8971 }
8973 {
8976 }
8977
8979 {
8982 }
8984 {
8987 }
8988
8989 super.OnVariablesSynchronized();
8990 }
8991
8992
8993
8995 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8996 {
8997 if (!IsServerCheck(allow_client))
8998 return false;
8999
9001 return false;
9002
9005
9006 if (value <= (min + 0.001))
9007 value = min;
9008
9009 if (value == min)
9010 {
9011 if (destroy_config)
9012 {
9013 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9014 if (dstr)
9015 {
9017 this.Delete();
9018 return true;
9019 }
9020 }
9021 else if (destroy_forced)
9022 {
9024 this.Delete();
9025 return true;
9026 }
9027
9029 }
9030
9033
9035 {
9037
9038 if (delta)
9040 }
9041
9043
9044 return false;
9045 }
9046
9047
9049 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9050 {
9052 }
9053
9055 {
9058 }
9059
9061 {
9064 }
9065
9068 {
9069 float value_clamped = Math.Clamp(value, 0, 1);
9071 SetQuantity(result, destroy_config, destroy_forced);
9072 }
9073
9074
9077 {
9079 }
9080
9082 {
9084 }
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9096 {
9097 int slot = -1;
9098 if (GetInventory())
9099 {
9100 InventoryLocation il = new InventoryLocation;
9101 GetInventory().GetCurrentInventoryLocation(il);
9103 }
9104
9106 }
9107
9109 {
9110 float quantity_max = 0;
9111
9113 {
9114 if (attSlotID != -1)
9115 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9116
9117 if (quantity_max <= 0)
9119 }
9120
9121 if (quantity_max <= 0)
9123
9124 return quantity_max;
9125 }
9126
9128 {
9130 }
9131
9133 {
9135 }
9136
9137
9139 {
9141 }
9142
9144 {
9146 }
9147
9149 {
9151 }
9152
9153
9155 {
9156
9157 float weightEx = GetWeightEx();
9158 float special = GetInventoryAndCargoWeight();
9159 return weightEx - special;
9160 }
9161
9162
9164 {
9166 }
9167
9169 {
9171 {
9172 #ifdef DEVELOPER
9173 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9174 {
9175 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9177 }
9178 #endif
9179
9181 }
9182 else if (HasEnergyManager())
9183 {
9184 #ifdef DEVELOPER
9185 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9186 {
9187 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9188 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9189 }
9190 #endif
9191 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9192 }
9193 else
9194 {
9195 #ifdef DEVELOPER
9196 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9197 {
9198 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9199 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9200 }
9201 #endif
9202 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9203 }
9204 }
9205
9208 {
9209 int item_count = 0;
9211
9212 if (GetInventory().GetCargo() != NULL)
9213 {
9214 item_count = GetInventory().GetCargo().GetItemCount();
9215 }
9216
9217 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9218 {
9219 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9220 if (item)
9221 item_count += item.GetNumberOfItems();
9222 }
9223 return item_count;
9224 }
9225
9228 {
9229 float weight = 0;
9230 float wetness = 1;
9231 if (include_wetness)
9234 {
9235 weight = wetness * m_ConfigWeight;
9236 }
9238 {
9239 weight = 1;
9240 }
9241 return weight;
9242 }
9243
9244
9245
9247 {
9248 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9249 {
9250 GameInventory inv = GetInventory();
9251 array<EntityAI> items = new array<EntityAI>;
9253 for (int i = 0; i < items.Count(); i++)
9254 {
9256 if (item)
9257 {
9259 }
9260 }
9261 }
9262 }
9263
9264
9265
9266
9268 {
9269 float energy = 0;
9270 if (HasEnergyManager())
9271 {
9272 energy = GetCompEM().GetEnergy();
9273 }
9274 return energy;
9275 }
9276
9277
9279 {
9280 super.OnEnergyConsumed();
9281
9283 }
9284
9286 {
9287 super.OnEnergyAdded();
9288
9290 }
9291
9292
9294 {
9295 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9296 {
9298 {
9299 float energy_0to1 = GetCompEM().GetEnergy0To1();
9301 }
9302 }
9303 }
9304
9305
9307 {
9308 return ConfigGetFloat("heatIsolation");
9309 }
9310
9312 {
9314 }
9315
9317 {
9318 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9319 if (
GetGame().ConfigIsExisting(paramPath))
9321
9322 return 0.0;
9323 }
9324
9326 {
9327 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9328 if (
GetGame().ConfigIsExisting(paramPath))
9330
9331 return 0.0;
9332 }
9333
9334 override void SetWet(
float value,
bool allow_client =
false)
9335 {
9336 if (!IsServerCheck(allow_client))
9337 return;
9338
9341
9343
9344 m_VarWet = Math.Clamp(value, min, max);
9345
9347 {
9350 }
9351 }
9352
9353 override void AddWet(
float value)
9354 {
9356 }
9357
9359 {
9361 }
9362
9364 {
9366 }
9367
9369 {
9371 }
9372
9374 {
9376 }
9377
9379 {
9381 }
9382
9384 {
9387 if (newLevel != oldLevel)
9388 {
9390 }
9391 }
9392
9394 {
9395 SetWeightDirty();
9396 }
9397
9399 {
9400 return GetWetLevelInternal(
m_VarWet);
9401 }
9402
9403
9404
9406 {
9408 }
9409
9411 {
9413 }
9414
9416 {
9418 }
9419
9421 {
9423 }
9424
9425
9426
9428 {
9429 if (ConfigIsExisting("itemModelLength"))
9430 {
9431 return ConfigGetFloat("itemModelLength");
9432 }
9433 return 0;
9434 }
9435
9437 {
9438 if (ConfigIsExisting("itemAttachOffset"))
9439 {
9440 return ConfigGetFloat("itemAttachOffset");
9441 }
9442 return 0;
9443 }
9444
9445 override void SetCleanness(
int value,
bool allow_client =
false)
9446 {
9447 if (!IsServerCheck(allow_client))
9448 return;
9449
9451
9453
9456 }
9457
9459 {
9461 }
9462
9464 {
9465 return true;
9466 }
9467
9468
9469
9470
9472 {
9474 }
9475
9477 {
9479 }
9480
9481
9482
9483
9484 override void SetColor(
int r,
int g,
int b,
int a)
9485 {
9491 }
9493 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9494 {
9499 }
9500
9502 {
9504 }
9505
9508 {
9509 int r,g,b,a;
9511 r = r/255;
9512 g = g/255;
9513 b = b/255;
9514 a = a/255;
9515 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9516 }
9517
9518
9519
9520 override void SetLiquidType(
int value,
bool allow_client =
false)
9521 {
9522 if (!IsServerCheck(allow_client))
9523 return;
9524
9529 }
9530
9532 {
9533 return ConfigGetInt("varLiquidTypeInit");
9534 }
9535
9537 {
9539 }
9540
9542 {
9544 SetFrozen(false);
9545 }
9546
9549 {
9550 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9551 }
9552
9553
9556 {
9557 PlayerBase nplayer;
9558 if (PlayerBase.CastTo(nplayer, player))
9559 {
9561
9562 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9563 }
9564 }
9565
9566
9569 {
9570 PlayerBase nplayer;
9571 if (PlayerBase.CastTo(nplayer,player))
9572 {
9573
9574 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9575
9576 }
9577
9578
9579 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9580
9581
9582 if (HasEnergyManager())
9583 {
9584 GetCompEM().UpdatePlugState();
9585 }
9586 }
9587
9588
9590 {
9591 super.OnPlacementStarted(player);
9592
9594 }
9595
9596 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9597 {
9599 {
9600 m_AdminLog.OnPlacementComplete(player,
this);
9601 }
9602
9603 super.OnPlacementComplete(player, position, orientation);
9604 }
9605
9606
9607
9608
9609
9611 {
9613 {
9614 return true;
9615 }
9616 else
9617 {
9618 return false;
9619 }
9620 }
9621
9622
9624 {
9626 {
9628 }
9629 }
9630
9631
9633 {
9635 }
9636
9638 {
9640 }
9641
9642 override void InsertAgent(
int agent,
float count = 1)
9643 {
9644 if (count < 1)
9645 return;
9646
9648 }
9649
9652 {
9654 }
9655
9656
9658 {
9660 }
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9704 {
9706 return false;
9707 return true;
9708 }
9709
9711 {
9712
9714 }
9715
9716
9719 {
9720 super.CheckForRoofLimited(timeTresholdMS);
9721
9723 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9724 {
9725 m_PreviousRoofTestTime = time;
9726 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9727 }
9728 }
9729
9730
9732 {
9734 {
9735 return 0;
9736 }
9737
9738 if (GetInventory().GetAttachmentSlotsCount() != 0)
9739 {
9740 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9741 if (filter)
9742 return filter.GetProtectionLevel(type, false, system);
9743 else
9744 return 0;
9745 }
9746
9747 string subclassPath, entryName;
9748
9749 switch (type)
9750 {
9752 entryName = "biological";
9753 break;
9755 entryName = "chemical";
9756 break;
9757 default:
9758 entryName = "biological";
9759 break;
9760 }
9761
9762 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9763
9765 }
9766
9767
9768
9771 {
9772 if (!IsMagazine())
9774
9776 }
9777
9778
9779
9780
9781
9786 {
9787 return true;
9788 }
9789
9791 {
9793 }
9794
9795
9796
9797
9798
9800 {
9801 if (parent)
9802 {
9803 if (parent.IsInherited(DayZInfected))
9804 return true;
9805
9806 if (!parent.IsRuined())
9807 return true;
9808 }
9809
9810 return true;
9811 }
9812
9814 {
9815 if (!super.CanPutAsAttachment(parent))
9816 {
9817 return false;
9818 }
9819
9820 if (!IsRuined() && !parent.IsRuined())
9821 {
9822 return true;
9823 }
9824
9825 return false;
9826 }
9827
9829 {
9830
9831
9832
9833
9834 return super.CanReceiveItemIntoCargo(item);
9835 }
9836
9838 {
9839
9840
9841
9842
9843 GameInventory attachmentInv = attachment.GetInventory();
9845 {
9846 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9847 return false;
9848 }
9849
9850 InventoryLocation loc = new InventoryLocation();
9851 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9852 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9853 return false;
9854
9855 return super.CanReceiveAttachment(attachment, slotId);
9856 }
9857
9859 {
9860 if (!super.CanReleaseAttachment(attachment))
9861 return false;
9862
9863 return GetInventory().AreChildrenAccessible();
9864 }
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9887 {
9888 int id = muzzle_owner.GetMuzzleID();
9889 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9890
9891 if (WPOF_array)
9892 {
9893 for (int i = 0; i < WPOF_array.Count(); i++)
9894 {
9895 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9896
9897 if (WPOF)
9898 {
9899 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9900 }
9901 }
9902 }
9903 }
9904
9905
9907 {
9908 int id = muzzle_owner.GetMuzzleID();
9910
9911 if (WPOBE_array)
9912 {
9913 for (int i = 0; i < WPOBE_array.Count(); i++)
9914 {
9915 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9916
9917 if (WPOBE)
9918 {
9919 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9920 }
9921 }
9922 }
9923 }
9924
9925
9927 {
9928 int id = muzzle_owner.GetMuzzleID();
9929 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9930
9931 if (WPOOH_array)
9932 {
9933 for (int i = 0; i < WPOOH_array.Count(); i++)
9934 {
9935 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9936
9937 if (WPOOH)
9938 {
9939 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9940 }
9941 }
9942 }
9943 }
9944
9945
9947 {
9948 int id = muzzle_owner.GetMuzzleID();
9949 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9950
9951 if (WPOOH_array)
9952 {
9953 for (int i = 0; i < WPOOH_array.Count(); i++)
9954 {
9955 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9956
9957 if (WPOOH)
9958 {
9959 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9960 }
9961 }
9962 }
9963 }
9964
9965
9967 {
9968 int id = muzzle_owner.GetMuzzleID();
9969 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9970
9971 if (WPOOH_array)
9972 {
9973 for (int i = 0; i < WPOOH_array.Count(); i++)
9974 {
9975 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9976
9977 if (WPOOH)
9978 {
9979 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9980 }
9981 }
9982 }
9983 }
9984
9985
9986
9988 {
9990 {
9991 return true;
9992 }
9993
9994 return false;
9995 }
9996
9998 {
10000 {
10001 return true;
10002 }
10003
10004 return false;
10005 }
10006
10008 {
10010 {
10011 return true;
10012 }
10013
10014 return false;
10015 }
10016
10018 {
10019 return false;
10020 }
10021
10024 {
10025 return UATimeSpent.DEFAULT_DEPLOY;
10026 }
10027
10028
10029
10030
10032 {
10034 SetSynchDirty();
10035 }
10036
10038 {
10040 }
10041
10042
10044 {
10045 return false;
10046 }
10047
10050 {
10051 string att_type = "None";
10052
10053 if (ConfigIsExisting("soundAttType"))
10054 {
10055 att_type = ConfigGetString("soundAttType");
10056 }
10057
10059 }
10060
10062 {
10064 }
10065
10066
10067
10068
10069
10073
10075 {
10078
10080 }
10081
10082
10084 {
10086 return;
10087
10089
10092
10095
10096 SoundParameters params = new SoundParameters();
10100 }
10101
10102
10104 {
10106 return;
10107
10109 SetSynchDirty();
10110
10113 }
10114
10115
10117 {
10119 return;
10120
10122 SetSynchDirty();
10123
10126 }
10127
10129 {
10131 }
10132
10134 {
10136 }
10137
10140 {
10141 if (!
GetGame().IsDedicatedServer())
10142 {
10143 if (ConfigIsExisting("attachSoundSet"))
10144 {
10145 string cfg_path = "";
10146 string soundset = "";
10147 string type_name =
GetType();
10148
10151 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10152 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10153
10154 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10155 {
10156 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10157 {
10158 if (cfg_slot_array[i] == slot_type)
10159 {
10160 soundset = cfg_soundset_array[i];
10161 break;
10162 }
10163 }
10164 }
10165
10166 if (soundset != "")
10167 {
10168 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10170 }
10171 }
10172 }
10173 }
10174
10176 {
10177
10178 }
10179
10180 void OnApply(PlayerBase player);
10181
10183 {
10184 return 1.0;
10185 };
10186
10188 {
10190 }
10191
10193 {
10195 }
10196
10198
10200 {
10201 SetDynamicPhysicsLifeTime(0.01);
10203 }
10204
10206 {
10207 array<string> zone_names = new array<string>;
10208 GetDamageZones(zone_names);
10209 for (int i = 0; i < zone_names.Count(); i++)
10210 {
10211 SetHealthMax(zone_names.Get(i),"Health");
10212 }
10213 SetHealthMax("","Health");
10214 }
10215
10218 {
10219 float global_health = GetHealth01("","Health");
10220 array<string> zones = new array<string>;
10221 GetDamageZones(zones);
10222
10223 for (int i = 0; i < zones.Count(); i++)
10224 {
10225 SetHealth01(zones.Get(i),"Health",global_health);
10226 }
10227 }
10228
10231 {
10232 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10233 }
10234
10236 {
10237 if (!hasRootAsPlayer)
10238 {
10239 if (refParentIB)
10240 {
10241
10242 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10243 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10244
10245 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10246 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10247
10250 }
10251 else
10252 {
10253
10256 }
10257 }
10258 }
10259
10261 {
10263 {
10264 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10265 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10266 {
10267 float heatPermCoef = 1.0;
10269 while (ent)
10270 {
10271 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10272 ent = ent.GetHierarchyParent();
10273 }
10274
10275 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10276 }
10277 }
10278 }
10279
10281 {
10282
10283 EntityAI parent = GetHierarchyParent();
10284 if (!parent)
10285 {
10286 hasParent = false;
10287 hasRootAsPlayer = false;
10288 }
10289 else
10290 {
10291 hasParent = true;
10292 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10293 refParentIB =
ItemBase.Cast(parent);
10294 }
10295 }
10296
10297 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10298 {
10299
10300 }
10301
10303 {
10304
10305 return false;
10306 }
10307
10309 {
10310
10311
10312 return false;
10313 }
10314
10316 {
10317
10318 return false;
10319 }
10320
10323 {
10324 return !GetIsFrozen() &&
IsOpen();
10325 }
10326
10328 {
10329 bool hasParent = false, hasRootAsPlayer = false;
10331
10332 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10333 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10334
10335 if (wwtu || foodDecay)
10336 {
10340
10341 if (processWetness || processTemperature || processDecay)
10342 {
10344
10345 if (processWetness)
10346 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10347
10348 if (processTemperature)
10350
10351 if (processDecay)
10352 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10353 }
10354 }
10355 }
10356
10359 {
10361 }
10362
10364 {
10367
10368 return super.GetTemperatureFreezeThreshold();
10369 }
10370
10372 {
10375
10376 return super.GetTemperatureThawThreshold();
10377 }
10378
10380 {
10383
10384 return super.GetItemOverheatThreshold();
10385 }
10386
10388 {
10390 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10391
10392 return super.GetTemperatureFreezeTime();
10393 }
10394
10396 {
10398 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10399
10400 return super.GetTemperatureThawTime();
10401 }
10402
10407
10409 {
10410 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10411 }
10412
10414 {
10415 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10416 }
10417
10420 {
10422 }
10423
10425 {
10427 }
10428
10430 {
10432 }
10433
10436 {
10437 return null;
10438 }
10439
10442 {
10443 return false;
10444 }
10445
10447 {
10449 {
10452 if (!trg)
10453 {
10455 explosive = this;
10456 }
10457
10458 explosive.PairRemote(trg);
10460
10461 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10462 trg.SetPersistentPairID(persistentID);
10463 explosive.SetPersistentPairID(persistentID);
10464
10465 return true;
10466 }
10467 return false;
10468 }
10469
10472 {
10473 float ret = 1.0;
10476 ret *= GetHealth01();
10477
10478 return ret;
10479 }
10480
10481 #ifdef DEVELOPER
10482 override void SetDebugItem()
10483 {
10484 super.SetDebugItem();
10485 _itemBase = this;
10486 }
10487
10489 {
10490 string text = super.GetDebugText();
10491
10493 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10494
10495 return text;
10496 }
10497 #endif
10498
10500 {
10501 return true;
10502 }
10503
10505
10507
10509 {
10512 }
10513
10514
10522
10538}
10539
10541{
10543 if (entity)
10544 {
10545 bool is_item = entity.IsInherited(
ItemBase);
10546 if (is_item && full_quantity)
10547 {
10550 }
10551 }
10552 else
10553 {
10555 return NULL;
10556 }
10557 return entity;
10558}
10559
10561{
10562 if (item)
10563 {
10564 if (health > 0)
10565 item.SetHealth("", "", health);
10566
10567 if (item.CanHaveTemperature())
10568 {
10570 if (item.CanFreeze())
10571 item.SetFrozen(false);
10572 }
10573
10574 if (item.HasEnergyManager())
10575 {
10576 if (quantity >= 0)
10577 {
10578 item.GetCompEM().SetEnergy0To1(quantity);
10579 }
10580 else
10581 {
10583 }
10584 }
10585 else if (item.IsMagazine())
10586 {
10587 Magazine mag = Magazine.Cast(item);
10588 if (quantity >= 0)
10589 {
10590 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10591 }
10592 else
10593 {
10595 }
10596
10597 }
10598 else
10599 {
10600 if (quantity >= 0)
10601 {
10602 item.SetQuantityNormalized(quantity, false);
10603 }
10604 else
10605 {
10607 }
10608
10609 }
10610 }
10611}
10612
10613#ifdef DEVELOPER
10615#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.