5694{
5696 {
5697 return true;
5698 }
5699};
5700
5701
5702
5704{
5708
5710
5713
5714
5715
5716
5717
5726
5732
5737
5742
5763 protected bool m_IsResultOfSplit
5764
5766
5771
5772
5773
5775
5779
5780
5781
5783
5786
5787
5788
5794
5795
5803
5806
5807
5809
5810
5812
5813
5818
5819
5824
5825
5827
5828
5830 {
5835
5836 if (!
GetGame().IsDedicatedServer())
5837 {
5839 {
5841
5843 {
5845 }
5846 }
5847
5850 }
5851
5852 m_OldLocation = null;
5853
5855 {
5857 }
5858
5859 if (ConfigIsExisting("headSelectionsToHide"))
5860 {
5863 }
5864
5866 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5867 {
5869 }
5870
5872
5873 m_IsResultOfSplit = false;
5874
5876 }
5877
5879 {
5880 super.InitItemVariables();
5881
5887 m_Count = ConfigGetInt(
"count");
5888
5891
5896
5899
5904
5916
5920
5921
5924 if (ConfigIsExisting("canBeSplit"))
5925 {
5928 }
5929
5931 if (ConfigIsExisting("itemBehaviour"))
5933
5934
5937 RegisterNetSyncVariableInt("m_VarLiquidType");
5938 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5939
5940 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5941 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5942 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5943
5944 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5945 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5946 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5947 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5948
5949 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5950 RegisterNetSyncVariableBool("m_IsTakeable");
5951 RegisterNetSyncVariableBool("m_IsHologram");
5952
5955 {
5958 }
5959
5961
5963 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5965
5966 }
5967
5969 {
5971 }
5972
5974 {
5977 {
5982 }
5983 }
5984
5985 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5986 {
5988 {
5991 }
5992
5994 }
5995
5997 {
6003 }
6004
6006
6008 {
6010
6011 if (!action)
6012 {
6013 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6014 return;
6015 }
6016
6018 if (!ai)
6019 {
6021 return;
6022 }
6023
6025 if (!action_array)
6026 {
6027 action_array = new array<ActionBase_Basic>;
6029 }
6030 if (LogManager.IsActionLogEnable())
6031 {
6032 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6033 }
6034
6035 if (action_array.Find(action) != -1)
6036 {
6037 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6038 }
6039 else
6040 {
6041 action_array.Insert(action);
6042 }
6043 }
6044
6046 {
6048 ActionBase action = player.GetActionManager().GetAction(actionName);
6051
6052 if (action_array)
6053 {
6054 action_array.RemoveItem(action);
6055 }
6056 }
6057
6058
6059
6061 {
6062 ActionOverrideData overrideData = new ActionOverrideData();
6066
6068 if (!actionMap)
6069 {
6072 }
6073
6074 actionMap.Insert(this.
Type(), overrideData);
6075
6076 }
6077
6079
6081
6082
6084 {
6087
6090
6091 string config_to_search = "CfgVehicles";
6092 string muzzle_owner_config;
6093
6095 {
6096 if (IsInherited(Weapon))
6097 config_to_search = "CfgWeapons";
6098
6099 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6100
6101 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6102
6104
6105 if (config_OnFire_subclass_count > 0)
6106 {
6107 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6108
6109 for (int i = 0; i < config_OnFire_subclass_count; i++)
6110 {
6111 string particle_class = "";
6113 string config_OnFire_entry = config_OnFire_class + particle_class;
6114 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6115 WPOF_array.Insert(WPOF);
6116 }
6117
6118
6120 }
6121 }
6122
6124 {
6125 config_to_search = "CfgWeapons";
6126 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6127
6128 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6129
6131
6132 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6133 {
6134 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6135
6136 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6137 {
6138 string particle_class2 = "";
6140 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6141 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6142 WPOBE_array.Insert(WPOBE);
6143 }
6144
6145
6147 }
6148 }
6149 }
6150
6151
6153 {
6156
6158 {
6159 string config_to_search = "CfgVehicles";
6160
6161 if (IsInherited(Weapon))
6162 config_to_search = "CfgWeapons";
6163
6164 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6165 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6166
6167 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6168 {
6169
6171
6173 {
6175 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6177 return;
6178 }
6179
6182
6183
6184
6186 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6187
6188 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6189 {
6190 string particle_class = "";
6192 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6194
6195 if (entry_type == CT_CLASS)
6196 {
6197 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6198 WPOOH_array.Insert(WPOF);
6199 }
6200 }
6201
6202
6204 }
6205 }
6206 }
6207
6209 {
6211 }
6212
6214 {
6216 {
6218
6221
6224
6225 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6226 }
6227 }
6228
6230 {
6232 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6233
6235 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6236
6238 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6239
6241 {
6243 }
6244 }
6245
6247 {
6249 }
6250
6252 {
6255 else
6257
6259 {
6262 }
6263 else
6264 {
6267
6270 }
6271
6273 }
6274
6276 {
6278 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6279 }
6280
6282 {
6284 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6286 }
6287
6289 {
6291 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6292 }
6293
6295 {
6298
6299 OverheatingParticle OP = new OverheatingParticle();
6304
6306 }
6307
6309 {
6312
6313 return -1;
6314 }
6315
6317 {
6319 {
6322
6323 for (int i = count; i > 0; --i)
6324 {
6325 int id = i - 1;
6328
6331
6332 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6333 {
6334 if (p)
6335 {
6338 }
6339 }
6340 }
6341 }
6342 }
6343
6345 {
6347 {
6349 {
6350 int id = i - 1;
6352
6353 if (OP)
6354 {
6356
6357 if (p)
6358 {
6360 }
6361
6362 delete OP;
6363 }
6364 }
6365
6368 }
6369 }
6370
6373 {
6374 return 0.0;
6375 }
6376
6377
6379 {
6380 return 250;
6381 }
6382
6384 {
6385 return 0;
6386 }
6387
6390 {
6392 return true;
6393
6394 return false;
6395 }
6396
6399 {
6402
6404 {
6406 }
6407 else
6408 {
6409
6411 }
6412
6414 }
6415
6422 {
6423 return -1;
6424 }
6425
6426
6427
6428
6430 {
6432 {
6434 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6435
6436 if (r_index >= 0)
6437 {
6438 InventoryLocation r_il = new InventoryLocation;
6439 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6440
6441 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6444 {
6445 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6446 }
6448 {
6449 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6450 }
6451
6452 }
6453
6454 player.GetHumanInventory().ClearUserReservedLocation(this);
6455 }
6456
6459 }
6460
6461
6462
6463
6465 {
6466 return ItemBase.m_DebugActionsMask;
6467 }
6468
6470 {
6471 return ItemBase.m_DebugActionsMask & mask;
6472 }
6473
6475 {
6476 ItemBase.m_DebugActionsMask = mask;
6477 }
6478
6480 {
6481 ItemBase.m_DebugActionsMask |= mask;
6482 }
6483
6485 {
6486 ItemBase.m_DebugActionsMask &= ~mask;
6487 }
6488
6490 {
6492 {
6494 }
6495 else
6496 {
6498 }
6499 }
6500
6501
6503 {
6504 if (GetEconomyProfile())
6505 {
6506 float q_max = GetEconomyProfile().GetQuantityMax();
6507 if (q_max > 0)
6508 {
6509 float q_min = GetEconomyProfile().GetQuantityMin();
6510 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6511
6513 {
6514 ComponentEnergyManager comp = GetCompEM();
6516 {
6518 }
6519 }
6521 {
6523
6524 }
6525
6526 }
6527 }
6528 }
6529
6532 {
6533 EntityAI parent = GetHierarchyParent();
6534
6535 if (parent)
6536 {
6537 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6538 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6539 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6540 }
6541 }
6542
6545 {
6546 EntityAI parent = GetHierarchyParent();
6547
6548 if (parent)
6549 {
6550 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6551 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6552 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6553 }
6554 }
6555
6557 {
6558
6559
6560
6561
6563
6565 {
6566 if (ScriptInputUserData.CanStoreInputUserData())
6567 {
6568 ScriptInputUserData ctx = new ScriptInputUserData;
6574 ctx.
Write(use_stack_max);
6577
6579 {
6580 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6581 }
6582 }
6583 }
6584 else if (!
GetGame().IsMultiplayer())
6585 {
6587 }
6588 }
6589
6591 {
6593 }
6594
6596 {
6598 }
6599
6601 {
6603 }
6604
6606 {
6607
6608 return false;
6609 }
6610
6612 {
6613 return false;
6614 }
6615
6619 {
6620 return false;
6621 }
6622
6624 {
6625 return "";
6626 }
6627
6629
6631 {
6632 return false;
6633 }
6634
6636 {
6637 return true;
6638 }
6639
6640
6641
6643 {
6644 return true;
6645 }
6646
6648 {
6649 return true;
6650 }
6651
6653 {
6654 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6656 }
6657
6659 {
6661 }
6662
6664 {
6666 if (!is_being_placed)
6668 SetSynchDirty();
6669 }
6670
6671
6673
6675 {
6677 }
6678
6680 {
6682 }
6683
6685 {
6686 return 1;
6687 }
6688
6690 {
6691 return false;
6692 }
6693
6695 {
6697 SetSynchDirty();
6698 }
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6735 {
6736 super.OnMovedInsideCargo(container);
6737
6738 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6739 }
6740
6741 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6742 {
6743 super.EEItemLocationChanged(oldLoc,newLoc);
6744
6745 PlayerBase new_player = null;
6746 PlayerBase old_player = null;
6747
6748 if (newLoc.GetParent())
6749 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6750
6751 if (oldLoc.GetParent())
6752 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6753
6755 {
6756 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6757
6758 if (r_index >= 0)
6759 {
6760 InventoryLocation r_il = new InventoryLocation;
6761 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6762
6763 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6766 {
6767 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6768 }
6770 {
6771 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6772 }
6773
6774 }
6775 }
6776
6778 {
6779 if (new_player)
6780 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6781
6782 if (new_player == old_player)
6783 {
6784
6785 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6786 {
6788 {
6789 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6790 {
6791 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6792 }
6793 }
6794 else
6795 {
6796 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6797 }
6798 }
6799
6800 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6801 {
6802 int type = oldLoc.GetType();
6804 {
6805 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6806 }
6808 {
6809 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6810 }
6811 }
6812 if (!m_OldLocation)
6813 {
6814 m_OldLocation = new InventoryLocation;
6815 }
6816 m_OldLocation.Copy(oldLoc);
6817 }
6818 else
6819 {
6820 if (m_OldLocation)
6821 {
6822 m_OldLocation.Reset();
6823 }
6824 }
6825
6827 }
6828 else
6829 {
6830 if (new_player)
6831 {
6832 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6833 if (res_index >= 0)
6834 {
6835 InventoryLocation il = new InventoryLocation;
6836 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6838 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6841 {
6842 il.
GetParent().GetOnReleaseLock().Invoke(it);
6843 }
6845 {
6847 }
6848
6849 }
6850 }
6852 {
6853
6855 }
6856
6857 if (m_OldLocation)
6858 {
6859 m_OldLocation.Reset();
6860 }
6861 }
6862 }
6863
6864 override void EOnContact(IEntity other, Contact extra)
6865 {
6867 {
6868 int liquidType = -1;
6870 if (impactSpeed > 0.0)
6871 {
6873 #ifndef SERVER
6875 #else
6877 SetSynchDirty();
6878 #endif
6880 }
6881 }
6882
6883 #ifdef SERVER
6884 if (GetCompEM() && GetCompEM().IsPlugged())
6885 {
6886 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6887 GetCompEM().UnplugThis();
6888 }
6889 #endif
6890 }
6891
6893
6895 {
6897 }
6898
6900 {
6901
6902 }
6903
6905 {
6906 super.OnItemLocationChanged(old_owner, new_owner);
6907
6908 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6909 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6910
6911 if (!relatedPlayer && playerNew)
6912 relatedPlayer = playerNew;
6913
6914 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6915 {
6917 if (actionMgr)
6918 {
6919 ActionBase currentAction = actionMgr.GetRunningAction();
6920 if (currentAction)
6922 }
6923 }
6924
6925 Man ownerPlayerOld = null;
6926 Man ownerPlayerNew = null;
6927
6928 if (old_owner)
6929 {
6930 if (old_owner.
IsMan())
6931 {
6932 ownerPlayerOld = Man.Cast(old_owner);
6933 }
6934 else
6935 {
6936 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6937 }
6938 }
6939 else
6940 {
6942 {
6944
6945 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6946 {
6947 GetCompEM().UnplugThis();
6948 }
6949 }
6950 }
6951
6952 if (new_owner)
6953 {
6954 if (new_owner.
IsMan())
6955 {
6956 ownerPlayerNew = Man.Cast(new_owner);
6957 }
6958 else
6959 {
6960 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6961 }
6962 }
6963
6964 if (ownerPlayerOld != ownerPlayerNew)
6965 {
6966 if (ownerPlayerOld)
6967 {
6968 array<EntityAI> subItemsExit = new array<EntityAI>;
6970 for (int i = 0; i < subItemsExit.Count(); i++)
6971 {
6974 }
6975 }
6976
6977 if (ownerPlayerNew)
6978 {
6979 array<EntityAI> subItemsEnter = new array<EntityAI>;
6981 for (int j = 0; j < subItemsEnter.Count(); j++)
6982 {
6985 }
6986 }
6987 }
6988 else if (ownerPlayerNew != null)
6989 {
6990 PlayerBase nplayer;
6991 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6992 {
6993 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6995 for (int k = 0; k < subItemsUpdate.Count(); k++)
6996 {
6998 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6999 }
7000 }
7001 }
7002
7003 if (old_owner)
7004 old_owner.OnChildItemRemoved(this);
7005 if (new_owner)
7006 new_owner.OnChildItemReceived(this);
7007 }
7008
7009
7011 {
7012 super.EEDelete(parent);
7013 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7014 if (player)
7015 {
7017
7018 if (player.IsAlive())
7019 {
7020 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7021 if (r_index >= 0)
7022 {
7023 InventoryLocation r_il = new InventoryLocation;
7024 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7025
7026 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7029 {
7030 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7031 }
7033 {
7034 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7035 }
7036
7037 }
7038
7039 player.RemoveQuickBarEntityShortcut(this);
7040 }
7041 }
7042 }
7043
7045 {
7046 super.EEKilled(killer);
7047
7050 {
7051 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7052 {
7053 if (IsMagazine())
7054 {
7055 if (Magazine.Cast(this).GetAmmoCount() > 0)
7056 {
7058 }
7059 }
7060 else
7061 {
7063 }
7064 }
7065 }
7066 }
7067
7069 {
7070 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7071
7072 super.OnWasAttached(parent, slot_id);
7073
7076
7078 }
7079
7081 {
7082 super.OnWasDetached(parent, slot_id);
7083
7086 }
7087
7089 {
7090 int idx;
7093
7094 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7095 if (inventory_slots.Count() < 1)
7096 {
7097 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7098 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7099 }
7100 else
7101 {
7102 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7103 }
7104
7105 idx = inventory_slots.Find(slot);
7106 if (idx < 0)
7107 return "";
7108
7109 return attach_types.Get(idx);
7110 }
7111
7113 {
7114 int idx = -1;
7115 string slot;
7116
7119
7120 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7121 if (inventory_slots.Count() < 1)
7122 {
7123 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7124 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7125 }
7126 else
7127 {
7128 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7129 if (detach_types.Count() < 1)
7130 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7131 }
7132
7133 for (int i = 0; i < inventory_slots.Count(); i++)
7134 {
7135 slot = inventory_slots.Get(i);
7136 }
7137
7138 if (slot != "")
7139 {
7140 if (detach_types.Count() == 1)
7141 idx = 0;
7142 else
7143 idx = inventory_slots.Find(slot);
7144 }
7145 if (idx < 0)
7146 return "";
7147
7148 return detach_types.Get(idx);
7149 }
7150
7152 {
7153
7155
7156
7157 float min_time = 1;
7158 float max_time = 3;
7159 float delay = Math.RandomFloat(min_time, max_time);
7160
7161 explode_timer.Run(delay, this, "DoAmmoExplosion");
7162 }
7163
7165 {
7166 Magazine magazine = Magazine.Cast(this);
7167 int pop_sounds_count = 6;
7168 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7169
7170
7171 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7172 string sound_name = pop_sounds[ sound_idx ];
7174
7175
7176 magazine.ServerAddAmmoCount(-1);
7177
7178
7179 float min_temp_to_explode = 100;
7180
7181 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7182 {
7184 }
7185 }
7186
7187
7188 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7189 {
7190 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7191
7192 const int CHANCE_DAMAGE_CARGO = 4;
7193 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7194 const int CHANCE_DAMAGE_NOTHING = 2;
7195
7197 {
7198 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7199 int chances;
7200 int rnd;
7201
7202 if (GetInventory().GetCargo())
7203 {
7204 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7205 rnd = Math.RandomInt(0,chances);
7206
7207 if (rnd < CHANCE_DAMAGE_CARGO)
7208 {
7210 }
7211 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7212 {
7214 }
7215 }
7216 else
7217 {
7218 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7219 rnd = Math.RandomInt(0,chances);
7220
7221 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7222 {
7224 }
7225 }
7226 }
7227 }
7228
7230 {
7231 if (GetInventory().GetCargo())
7232 {
7233 int item_count = GetInventory().GetCargo().GetItemCount();
7234 if (item_count > 0)
7235 {
7236 int random_pick = Math.RandomInt(0, item_count);
7238 if (!item.IsExplosive())
7239 {
7240 item.AddHealth("","",damage);
7241 return true;
7242 }
7243 }
7244 }
7245 return false;
7246 }
7247
7249 {
7250 int attachment_count = GetInventory().AttachmentCount();
7251 if (attachment_count > 0)
7252 {
7253 int random_pick = Math.RandomInt(0, attachment_count);
7254 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7255 if (!attachment.IsExplosive())
7256 {
7257 attachment.AddHealth("","",damage);
7258 return true;
7259 }
7260 }
7261 return false;
7262 }
7263
7265 {
7267 }
7268
7270 {
7272 return GetInventory().CanRemoveEntity();
7273
7274 return false;
7275 }
7276
7278 {
7280 return;
7281
7283 {
7284 if (ScriptInputUserData.CanStoreInputUserData())
7285 {
7286 ScriptInputUserData ctx = new ScriptInputUserData;
7291 ctx.
Write(destination_entity);
7295 }
7296 }
7297 else if (!
GetGame().IsMultiplayer())
7298 {
7300 }
7301 }
7302
7304 {
7306 return;
7307
7308 float split_quantity_new;
7312 InventoryLocation loc = new InventoryLocation;
7313
7314 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7315 {
7317 split_quantity_new = stack_max;
7318 else
7320
7321 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7322 if (new_item)
7323 {
7324 new_item.SetResultOfSplit(true);
7325 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7327 new_item.SetQuantity(split_quantity_new);
7328 }
7329 }
7330 else if (destination_entity && slot_id == -1)
7331 {
7332 if (quantity > stack_max)
7333 split_quantity_new = stack_max;
7334 else
7335 split_quantity_new = quantity;
7336
7338 {
7341 }
7342
7343 if (new_item)
7344 {
7345 new_item.SetResultOfSplit(true);
7346 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7348 new_item.SetQuantity(split_quantity_new);
7349 }
7350 }
7351 else
7352 {
7353 if (stack_max != 0)
7354 {
7356 {
7358 }
7359
7360 if (split_quantity_new == 0)
7361 {
7362 if (!
GetGame().IsMultiplayer())
7363 player.PhysicalPredictiveDropItem(this);
7364 else
7365 player.ServerDropEntity(this);
7366 return;
7367 }
7368
7370
7371 if (new_item)
7372 {
7373 new_item.SetResultOfSplit(true);
7374 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7376 new_item.SetQuantity(stack_max);
7377 new_item.PlaceOnSurface();
7378 }
7379 }
7380 }
7381 }
7382
7384 {
7386 return;
7387
7388 float split_quantity_new;
7392 InventoryLocation loc = new InventoryLocation;
7393
7394 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7395 {
7397 split_quantity_new = stack_max;
7398 else
7400
7401 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7402 if (new_item)
7403 {
7404 new_item.SetResultOfSplit(true);
7405 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7407 new_item.SetQuantity(split_quantity_new);
7408 }
7409 }
7410 else if (destination_entity && slot_id == -1)
7411 {
7412 if (quantity > stack_max)
7413 split_quantity_new = stack_max;
7414 else
7415 split_quantity_new = quantity;
7416
7418 {
7421 }
7422
7423 if (new_item)
7424 {
7425 new_item.SetResultOfSplit(true);
7426 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7428 new_item.SetQuantity(split_quantity_new);
7429 }
7430 }
7431 else
7432 {
7433 if (stack_max != 0)
7434 {
7436 {
7438 }
7439
7441
7442 if (new_item)
7443 {
7444 new_item.SetResultOfSplit(true);
7445 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7447 new_item.SetQuantity(stack_max);
7448 new_item.PlaceOnSurface();
7449 }
7450 }
7451 }
7452 }
7453
7455 {
7457 return;
7458
7460 {
7461 if (ScriptInputUserData.CanStoreInputUserData())
7462 {
7463 ScriptInputUserData ctx = new ScriptInputUserData;
7468 dst.WriteToContext(ctx);
7470 }
7471 }
7472 else if (!
GetGame().IsMultiplayer())
7473 {
7475 }
7476 }
7477
7479 {
7481 return;
7482
7484 {
7485 if (ScriptInputUserData.CanStoreInputUserData())
7486 {
7487 ScriptInputUserData ctx = new ScriptInputUserData;
7492 ctx.
Write(destination_entity);
7498 }
7499 }
7500 else if (!
GetGame().IsMultiplayer())
7501 {
7503 }
7504 }
7505
7507 {
7509 }
7510
7512 {
7514 return this;
7515
7517 float split_quantity_new;
7519 if (dst.IsValid())
7520 {
7521 int slot_id = dst.GetSlot();
7523
7524 if (quantity > stack_max)
7525 split_quantity_new = stack_max;
7526 else
7527 split_quantity_new = quantity;
7528
7530
7531 if (new_item)
7532 {
7533 new_item.SetResultOfSplit(true);
7534 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7537 }
7538
7539 return new_item;
7540 }
7541
7542 return null;
7543 }
7544
7546 {
7548 return;
7549
7551 float split_quantity_new;
7553 if (destination_entity)
7554 {
7556 if (quantity > stackable)
7557 split_quantity_new = stackable;
7558 else
7559 split_quantity_new = quantity;
7560
7561 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7562 if (new_item)
7563 {
7564 new_item.SetResultOfSplit(true);
7565 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7567 new_item.SetQuantity(split_quantity_new);
7568 }
7569 }
7570 }
7571
7573 {
7575 return;
7576
7578 {
7579 if (ScriptInputUserData.CanStoreInputUserData())
7580 {
7581 ScriptInputUserData ctx = new ScriptInputUserData;
7586 ItemBase destination_entity =
this;
7587 ctx.
Write(destination_entity);
7591 }
7592 }
7593 else if (!
GetGame().IsMultiplayer())
7594 {
7596 }
7597 }
7598
7600 {
7602 return;
7603
7605 float split_quantity_new;
7607 if (player)
7608 {
7610 if (quantity > stackable)
7611 split_quantity_new = stackable;
7612 else
7613 split_quantity_new = quantity;
7614
7615 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7616 new_item =
ItemBase.Cast(in_hands);
7617 if (new_item)
7618 {
7619 new_item.SetResultOfSplit(true);
7620 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7622 new_item.SetQuantity(split_quantity_new);
7623 }
7624 }
7625 }
7626
7628 {
7630 return;
7631
7633 float split_quantity_new = Math.Floor(quantity * 0.5);
7634
7636
7637 if (new_item)
7638 {
7639 if (new_item.GetQuantityMax() < split_quantity_new)
7640 {
7641 split_quantity_new = new_item.GetQuantityMax();
7642 }
7643
7644 new_item.SetResultOfSplit(true);
7645 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7646
7648 {
7651 }
7652 else
7653 {
7656 }
7657 }
7658 }
7659
7661 {
7663 return;
7664
7666 float split_quantity_new = Math.Floor(quantity / 2);
7667
7668 InventoryLocation invloc = new InventoryLocation;
7670
7672 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7673
7674 if (new_item)
7675 {
7676 if (new_item.GetQuantityMax() < split_quantity_new)
7677 {
7678 split_quantity_new = new_item.GetQuantityMax();
7679 }
7681 {
7684 }
7685 else
7686 {
7689 }
7690 }
7691 }
7692
7695 {
7696 SetWeightDirty();
7698
7699 if (parent)
7700 parent.OnAttachmentQuantityChangedEx(this, delta);
7701
7703 {
7705 {
7707 }
7709 {
7710 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7712 }
7713 }
7714
7715 }
7716
7719 {
7720
7721 }
7722
7725 {
7727 }
7728
7730 {
7731 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7732
7734 {
7735 if (newLevel == GameConstants.STATE_RUINED)
7736 {
7738 EntityAI parent = GetHierarchyParent();
7739 if (parent && parent.IsFireplace())
7740 {
7741 CargoBase cargo = GetInventory().GetCargo();
7742 if (cargo)
7743 {
7745 {
7747 }
7748 }
7749 }
7750 }
7751
7753 {
7754
7756 return;
7757 }
7758
7759 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7760 {
7762 }
7763 }
7764 }
7765
7766
7768 {
7769 super.OnRightClick();
7770
7772 {
7774 {
7775 if (ScriptInputUserData.CanStoreInputUserData())
7776 {
7777 vector m4[4];
7779
7780 EntityAI root = GetHierarchyRoot();
7781
7782 InventoryLocation dst = new InventoryLocation;
7784 {
7785 if (root)
7786 {
7787 root.GetTransform(m4);
7789 }
7790 else
7791 GetInventory().GetCurrentInventoryLocation(dst);
7792 }
7793 else
7794 {
7796
7797
7798 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7799 {
7800 if (root)
7801 {
7802 root.GetTransform(m4);
7804 }
7805 else
7806 GetInventory().GetCurrentInventoryLocation(dst);
7807 }
7808 else
7809 {
7810 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7811 }
7812 }
7813
7814 ScriptInputUserData ctx = new ScriptInputUserData;
7822 }
7823 }
7824 else if (!
GetGame().IsMultiplayer())
7825 {
7827 }
7828 }
7829 }
7830
7831 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7832 {
7833
7834 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7835 return false;
7836
7837 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7838 return false;
7839
7840
7842 return false;
7843
7844
7845 Magazine mag = Magazine.Cast(this);
7846 if (mag)
7847 {
7848 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7849 return false;
7850
7851 if (stack_max_limit)
7852 {
7853 Magazine other_mag = Magazine.Cast(other_item);
7854 if (other_item)
7855 {
7856 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7857 return false;
7858 }
7859
7860 }
7861 }
7862 else
7863 {
7864
7866 return false;
7867
7869 return false;
7870 }
7871
7872 PlayerBase player = null;
7873 if (CastTo(player, GetHierarchyRootPlayer()))
7874 {
7875 if (player.GetInventory().HasAttachment(this))
7876 return false;
7877
7878 if (player.IsItemsToDelete())
7879 return false;
7880 }
7881
7882 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7883 return false;
7884
7885 int slotID;
7887 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7888 return false;
7889
7890 return true;
7891 }
7892
7894 {
7896 }
7897
7899 {
7900 return m_IsResultOfSplit;
7901 }
7902
7904 {
7905 m_IsResultOfSplit = value;
7906 }
7907
7909 {
7911 }
7912
7914 {
7915 float other_item_quantity = other_item.GetQuantity();
7916 float this_free_space;
7917
7919
7921
7922 if (other_item_quantity > this_free_space)
7923 {
7924 return this_free_space;
7925 }
7926 else
7927 {
7928 return other_item_quantity;
7929 }
7930 }
7931
7933 {
7935 }
7936
7938 {
7940 return;
7941
7942 if (!IsMagazine() && other_item)
7943 {
7945 if (quantity_used != 0)
7946 {
7947 float hp1 = GetHealth01("","");
7948 float hp2 = other_item.GetHealth01("","");
7949 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7950 hpResult = hpResult / (
GetQuantity() + quantity_used);
7951
7952 hpResult *= GetMaxHealth();
7953 Math.Round(hpResult);
7954 SetHealth("", "Health", hpResult);
7955
7957 other_item.AddQuantity(-quantity_used);
7958 }
7959 }
7961 }
7962
7964 {
7965 #ifdef SERVER
7966 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7967 GetHierarchyParent().IncreaseLifetimeUp();
7968 #endif
7969 };
7970
7972 {
7973 PlayerBase p = PlayerBase.Cast(player);
7974
7975 array<int> recipesIds = p.m_Recipes;
7976 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7977 if (moduleRecipesManager)
7978 {
7979 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7980 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7981 }
7982
7983 for (int i = 0;i < recipesIds.Count(); i++)
7984 {
7985 int key = recipesIds.Get(i);
7986 string recipeName = moduleRecipesManager.GetRecipeName(key);
7988 }
7989 }
7990
7991
7992 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7993 {
7994 super.GetDebugActions(outputList);
7995
7996
8001
8002
8006
8010
8011
8014
8015
8017 {
8020 }
8021
8023
8026
8030 }
8031
8032
8033
8034
8036 {
8037 super.OnAction(action_id, player, ctx);
8038 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8039 {
8040 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8041 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8042 PlayerBase p = PlayerBase.Cast(player);
8043 if (
EActions.RECIPES_RANGE_START < 1000)
8044 {
8045 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8046 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8047 }
8048 }
8049 #ifndef SERVER
8050 else if (action_id ==
EActions.WATCH_PLAYER)
8051 {
8052 PluginDeveloper.SetDeveloperItemClientEx(player);
8053 }
8054 #endif
8056 {
8057 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8058 {
8059 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8060 OnDebugButtonPressServer(id + 1);
8061 }
8062
8063 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8064 {
8065 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8067 }
8068
8069 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8070 {
8071 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8073 }
8074
8075 else if (action_id ==
EActions.ADD_QUANTITY)
8076 {
8077 if (IsMagazine())
8078 {
8079 Magazine mag = Magazine.Cast(this);
8080 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8081 }
8082 else
8083 {
8085 }
8086
8087 if (m_EM)
8088 {
8089 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8090 }
8091
8092 }
8093
8094 else if (action_id ==
EActions.REMOVE_QUANTITY)
8095 {
8096 if (IsMagazine())
8097 {
8098 Magazine mag2 = Magazine.Cast(this);
8099 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8100 }
8101 else
8102 {
8104 }
8105 if (m_EM)
8106 {
8107 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8108 }
8109
8110 }
8111
8112 else if (action_id ==
EActions.SET_QUANTITY_0)
8113 {
8115
8116 if (m_EM)
8117 {
8118 m_EM.SetEnergy(0);
8119 }
8120 }
8121
8122 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8123 {
8125
8126 if (m_EM)
8127 {
8128 m_EM.SetEnergy(m_EM.GetEnergyMax());
8129 }
8130 }
8131
8132 else if (action_id ==
EActions.ADD_HEALTH)
8133 {
8134 AddHealth("","",GetMaxHealth("","Health")/5);
8135 }
8136 else if (action_id ==
EActions.REMOVE_HEALTH)
8137 {
8138 AddHealth("","",-GetMaxHealth("","Health")/5);
8139 }
8140 else if (action_id ==
EActions.DESTROY_HEALTH)
8141 {
8142 SetHealth01("","",0);
8143 }
8144 else if (action_id ==
EActions.WATCH_ITEM)
8145 {
8147 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8148 #ifdef DEVELOPER
8149 SetDebugDeveloper_item(this);
8150 #endif
8151 }
8152
8153 else if (action_id ==
EActions.ADD_TEMPERATURE)
8154 {
8155 AddTemperature(20);
8156
8157 }
8158
8159 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8160 {
8161 AddTemperature(-20);
8162
8163 }
8164
8165 else if (action_id ==
EActions.FLIP_FROZEN)
8166 {
8167 SetFrozen(!GetIsFrozen());
8168
8169 }
8170
8171 else if (action_id ==
EActions.ADD_WETNESS)
8172 {
8174
8175 }
8176
8177 else if (action_id ==
EActions.REMOVE_WETNESS)
8178 {
8180
8181 }
8182
8183 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8184 {
8187
8188
8189 }
8190
8191 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8192 {
8195 }
8196
8197 else if (action_id ==
EActions.MAKE_SPECIAL)
8198 {
8199 auto debugParams = DebugSpawnParams.WithPlayer(player);
8200 OnDebugSpawnEx(debugParams);
8201 }
8202
8203 else if (action_id ==
EActions.DELETE)
8204 {
8205 Delete();
8206 }
8207
8208 }
8209
8210
8211 return false;
8212 }
8213
8214
8215
8216
8220
8223
8224
8225
8227 {
8228 return false;
8229 }
8230
8231
8233 {
8234 return true;
8235 }
8236
8237
8239 {
8240 return true;
8241 }
8242
8243
8244
8246 {
8247 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8249 }
8250
8253 {
8254 return null;
8255 }
8256
8258 {
8259 return false;
8260 }
8261
8263 {
8264 return false;
8265 }
8266
8270
8271
8273 {
8274 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8275 return module_repairing.CanRepair(this, item_repair_kit);
8276 }
8277
8278
8279 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8280 {
8281 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8282 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8283 }
8284
8285
8287 {
8288
8289
8290
8291
8292
8293
8294
8295
8296 return 1;
8297 }
8298
8299
8300
8302 {
8304 }
8305
8306
8307
8309 {
8311 }
8312
8313
8322 {
8323 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8324
8325 if (player)
8326 {
8327 player.MessageStatus(text);
8328 }
8329 }
8330
8331
8340 {
8341 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8342
8343 if (player)
8344 {
8345 player.MessageAction(text);
8346 }
8347 }
8348
8349
8358 {
8359 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8360
8361 if (player)
8362 {
8363 player.MessageFriendly(text);
8364 }
8365 }
8366
8367
8376 {
8377 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8378
8379 if (player)
8380 {
8381 player.MessageImportant(text);
8382 }
8383 }
8384
8386 {
8387 return true;
8388 }
8389
8390
8391 override bool KindOf(
string tag)
8392 {
8393 bool found = false;
8394 string item_name = this.
GetType();
8397
8398 int array_size = item_tag_array.Count();
8399 for (int i = 0; i < array_size; i++)
8400 {
8401 if (item_tag_array.Get(i) == tag)
8402 {
8403 found = true;
8404 break;
8405 }
8406 }
8407 return found;
8408 }
8409
8410
8412 {
8413
8414 super.OnRPC(sender, rpc_type,ctx);
8415
8416
8417 switch (rpc_type)
8418 {
8419 #ifndef SERVER
8420 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8421 Param2<bool, string> p = new Param2<bool, string>(false, "");
8422
8424 return;
8425
8426 bool play = p.param1;
8427 string soundSet = p.param2;
8428
8429 if (play)
8430 {
8432 {
8434 {
8436 }
8437 }
8438 else
8439 {
8441 }
8442 }
8443 else
8444 {
8446 }
8447
8448 break;
8449 #endif
8450
8451 }
8452
8454 {
8456 }
8457 }
8458
8459
8460
8461
8463 {
8464 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8465 return plugin.GetID(
name);
8466 }
8467
8469 {
8470 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8471 return plugin.GetName(id);
8472 }
8473
8476 {
8477
8478
8479 int varFlags;
8480 if (!ctx.
Read(varFlags))
8481 return;
8482
8483 if (varFlags & ItemVariableFlags.FLOAT)
8484 {
8486 }
8487 }
8488
8490 {
8491
8492 super.SerializeNumericalVars(floats_out);
8493
8494
8495
8497 {
8499 }
8500
8502 {
8504 }
8505
8507 {
8509 }
8510
8512 {
8517 }
8518
8520 {
8522 }
8523 }
8524
8526 {
8527
8528 super.DeSerializeNumericalVars(floats);
8529
8530
8531 int index = 0;
8532 int mask = Math.Round(floats.Get(index));
8533
8534 index++;
8535
8537 {
8539 {
8541 }
8542 else
8543 {
8544 float quantity = floats.Get(index);
8546 }
8547 index++;
8548 }
8549
8551 {
8552 float wet = floats.Get(index);
8554 index++;
8555 }
8556
8558 {
8559 int liquidtype = Math.Round(floats.Get(index));
8561 index++;
8562 }
8563
8565 {
8567 index++;
8569 index++;
8571 index++;
8573 index++;
8574 }
8575
8577 {
8578 int cleanness = Math.Round(floats.Get(index));
8580 index++;
8581 }
8582 }
8583
8585 {
8586 super.WriteVarsToCTX(ctx);
8587
8588
8590 {
8592 }
8593
8595 {
8597 }
8598
8600 {
8602 }
8603
8605 {
8606 int r,g,b,a;
8612 }
8613
8615 {
8617 }
8618 }
8619
8621 {
8622 if (!super.ReadVarsFromCTX(ctx,version))
8623 return false;
8624
8625 int intValue;
8626 float value;
8627
8628 if (version < 140)
8629 {
8630 if (!ctx.
Read(intValue))
8631 return false;
8632
8633 m_VariablesMask = intValue;
8634 }
8635
8637 {
8638 if (!ctx.
Read(value))
8639 return false;
8640
8642 {
8644 }
8645 else
8646 {
8648 }
8649 }
8650
8651 if (version < 140)
8652 {
8654 {
8655 if (!ctx.
Read(value))
8656 return false;
8657 SetTemperatureDirect(value);
8658 }
8659 }
8660
8662 {
8663 if (!ctx.
Read(value))
8664 return false;
8666 }
8667
8669 {
8670 if (!ctx.
Read(intValue))
8671 return false;
8673 }
8674
8676 {
8677 int r,g,b,a;
8679 return false;
8681 return false;
8683 return false;
8685 return false;
8686
8688 }
8689
8691 {
8692 if (!ctx.
Read(intValue))
8693 return false;
8695 }
8696
8697 if (version >= 138 && version < 140)
8698 {
8700 {
8701 if (!ctx.
Read(intValue))
8702 return false;
8703 SetFrozen(intValue);
8704 }
8705 }
8706
8707 return true;
8708 }
8709
8710
8712 {
8715 {
8717 }
8718
8719 if (!super.OnStoreLoad(ctx, version))
8720 {
8722 return false;
8723 }
8724
8725 if (version >= 114)
8726 {
8727 bool hasQuickBarIndexSaved;
8728
8729 if (!ctx.
Read(hasQuickBarIndexSaved))
8730 {
8732 return false;
8733 }
8734
8735 if (hasQuickBarIndexSaved)
8736 {
8737 int itmQBIndex;
8738
8739
8740 if (!ctx.
Read(itmQBIndex))
8741 {
8743 return false;
8744 }
8745
8746 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8747 if (itmQBIndex != -1 && parentPlayer)
8748 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8749 }
8750 }
8751 else
8752 {
8753
8754 PlayerBase player;
8755 int itemQBIndex;
8756 if (version ==
int.
MAX)
8757 {
8758 if (!ctx.
Read(itemQBIndex))
8759 {
8761 return false;
8762 }
8763 }
8764 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8765 {
8766
8767 if (!ctx.
Read(itemQBIndex))
8768 {
8770 return false;
8771 }
8772 if (itemQBIndex != -1 && player)
8773 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8774 }
8775 }
8776
8777 if (version < 140)
8778 {
8779
8780 if (!LoadVariables(ctx, version))
8781 {
8783 return false;
8784 }
8785 }
8786
8787
8789 {
8791 return false;
8792 }
8793 if (version >= 132)
8794 {
8796 if (raib)
8797 {
8799 {
8801 return false;
8802 }
8803 }
8804 }
8805
8807 return true;
8808 }
8809
8810
8811
8813 {
8814 super.OnStoreSave(ctx);
8815
8816 PlayerBase player;
8817 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8818 {
8820
8821 int itemQBIndex = -1;
8822 itemQBIndex = player.FindQuickBarEntityIndex(this);
8823 ctx.
Write(itemQBIndex);
8824 }
8825 else
8826 {
8828 }
8829
8831
8833 if (raib)
8834 {
8836 }
8837 }
8838
8839
8841 {
8842 super.AfterStoreLoad();
8843
8845 {
8847 }
8848
8850 {
8853 }
8854 }
8855
8857 {
8858 super.EEOnAfterLoad();
8859
8861 {
8863 }
8864
8867 }
8868
8870 {
8871 return false;
8872 }
8873
8874
8875
8877 {
8879 {
8880 #ifdef PLATFORM_CONSOLE
8881
8883 {
8885 if (menu)
8886 {
8888 }
8889 }
8890 #endif
8891 }
8892
8894 {
8897 }
8898
8900 {
8901 SetWeightDirty();
8903 }
8905 {
8908 }
8909
8911 {
8914 }
8916 {
8919 }
8920
8921 super.OnVariablesSynchronized();
8922 }
8923
8924
8925
8927 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8928 {
8929 if (!IsServerCheck(allow_client))
8930 return false;
8931
8933 return false;
8934
8937
8938 if (value <= (min + 0.001))
8939 value = min;
8940
8941 if (value == min)
8942 {
8943 if (destroy_config)
8944 {
8945 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8946 if (dstr)
8947 {
8949 this.Delete();
8950 return true;
8951 }
8952 }
8953 else if (destroy_forced)
8954 {
8956 this.Delete();
8957 return true;
8958 }
8959
8961 }
8962
8965
8967 {
8969
8970 if (delta)
8972 }
8973
8975
8976 return false;
8977 }
8978
8979
8981 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8982 {
8984 }
8985
8987 {
8990 }
8991
8993 {
8996 }
8997
9000 {
9001 float value_clamped = Math.Clamp(value, 0, 1);
9003 SetQuantity(result, destroy_config, destroy_forced);
9004 }
9005
9006
9009 {
9011 }
9012
9014 {
9016 }
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9028 {
9029 int slot = -1;
9030 if (GetInventory())
9031 {
9032 InventoryLocation il = new InventoryLocation;
9033 GetInventory().GetCurrentInventoryLocation(il);
9035 }
9036
9038 }
9039
9041 {
9042 float quantity_max = 0;
9043
9045 {
9046 if (attSlotID != -1)
9047 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9048
9049 if (quantity_max <= 0)
9051 }
9052
9053 if (quantity_max <= 0)
9055
9056 return quantity_max;
9057 }
9058
9060 {
9062 }
9063
9065 {
9067 }
9068
9069
9071 {
9073 }
9074
9076 {
9078 }
9079
9081 {
9083 }
9084
9085
9087 {
9088
9089 float weightEx = GetWeightEx();
9090 float special = GetInventoryAndCargoWeight();
9091 return weightEx - special;
9092 }
9093
9094
9096 {
9098 }
9099
9101 {
9103 {
9104 #ifdef DEVELOPER
9105 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9106 {
9107 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9109 }
9110 #endif
9111
9113 }
9114 else if (HasEnergyManager())
9115 {
9116 #ifdef DEVELOPER
9117 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9118 {
9119 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9120 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9121 }
9122 #endif
9123 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9124 }
9125 else
9126 {
9127 #ifdef DEVELOPER
9128 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9129 {
9130 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9131 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9132 }
9133 #endif
9134 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9135 }
9136 }
9137
9140 {
9141 int item_count = 0;
9143
9144 if (GetInventory().GetCargo() != NULL)
9145 {
9146 item_count = GetInventory().GetCargo().GetItemCount();
9147 }
9148
9149 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9150 {
9151 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9152 if (item)
9153 item_count += item.GetNumberOfItems();
9154 }
9155 return item_count;
9156 }
9157
9160 {
9161 float weight = 0;
9162 float wetness = 1;
9163 if (include_wetness)
9166 {
9167 weight = wetness * m_ConfigWeight;
9168 }
9170 {
9171 weight = 1;
9172 }
9173 return weight;
9174 }
9175
9176
9177
9179 {
9180 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9181 {
9182 GameInventory inv = GetInventory();
9183 array<EntityAI> items = new array<EntityAI>;
9185 for (int i = 0; i < items.Count(); i++)
9186 {
9188 if (item)
9189 {
9191 }
9192 }
9193 }
9194 }
9195
9196
9197
9198
9200 {
9201 float energy = 0;
9202 if (HasEnergyManager())
9203 {
9204 energy = GetCompEM().GetEnergy();
9205 }
9206 return energy;
9207 }
9208
9209
9211 {
9212 super.OnEnergyConsumed();
9213
9215 }
9216
9218 {
9219 super.OnEnergyAdded();
9220
9222 }
9223
9224
9226 {
9227 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9228 {
9230 {
9231 float energy_0to1 = GetCompEM().GetEnergy0To1();
9233 }
9234 }
9235 }
9236
9237
9239 {
9240 return ConfigGetFloat("heatIsolation");
9241 }
9242
9244 {
9246 }
9247
9249 {
9250 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9251 if (
GetGame().ConfigIsExisting(paramPath))
9253
9254 return 0.0;
9255 }
9256
9258 {
9259 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9260 if (
GetGame().ConfigIsExisting(paramPath))
9262
9263 return 0.0;
9264 }
9265
9266 override void SetWet(
float value,
bool allow_client =
false)
9267 {
9268 if (!IsServerCheck(allow_client))
9269 return;
9270
9273
9275
9276 m_VarWet = Math.Clamp(value, min, max);
9277
9279 {
9282 }
9283 }
9284
9285 override void AddWet(
float value)
9286 {
9288 }
9289
9291 {
9293 }
9294
9296 {
9298 }
9299
9301 {
9303 }
9304
9306 {
9308 }
9309
9311 {
9313 }
9314
9316 {
9319 if (newLevel != oldLevel)
9320 {
9322 }
9323 }
9324
9326 {
9327 SetWeightDirty();
9328 }
9329
9331 {
9332 return GetWetLevelInternal(
m_VarWet);
9333 }
9334
9335
9336
9338 {
9340 }
9341
9343 {
9345 }
9346
9348 {
9350 }
9351
9353 {
9355 }
9356
9357
9358
9360 {
9361 if (ConfigIsExisting("itemModelLength"))
9362 {
9363 return ConfigGetFloat("itemModelLength");
9364 }
9365 return 0;
9366 }
9367
9369 {
9370 if (ConfigIsExisting("itemAttachOffset"))
9371 {
9372 return ConfigGetFloat("itemAttachOffset");
9373 }
9374 return 0;
9375 }
9376
9377 override void SetCleanness(
int value,
bool allow_client =
false)
9378 {
9379 if (!IsServerCheck(allow_client))
9380 return;
9381
9383
9385
9388 }
9389
9391 {
9393 }
9394
9396 {
9397 return true;
9398 }
9399
9400
9401
9402
9404 {
9406 }
9407
9409 {
9411 }
9412
9413
9414
9415
9416 override void SetColor(
int r,
int g,
int b,
int a)
9417 {
9423 }
9425 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9426 {
9431 }
9432
9434 {
9436 }
9437
9440 {
9441 int r,g,b,a;
9443 r = r/255;
9444 g = g/255;
9445 b = b/255;
9446 a = a/255;
9447 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9448 }
9449
9450
9451
9452 override void SetLiquidType(
int value,
bool allow_client =
false)
9453 {
9454 if (!IsServerCheck(allow_client))
9455 return;
9456
9461 }
9462
9464 {
9465 return ConfigGetInt("varLiquidTypeInit");
9466 }
9467
9469 {
9471 }
9472
9474 {
9476 SetFrozen(false);
9477 }
9478
9481 {
9482 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9483 }
9484
9485
9488 {
9489 PlayerBase nplayer;
9490 if (PlayerBase.CastTo(nplayer, player))
9491 {
9493
9494 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9495 }
9496 }
9497
9498
9501 {
9502 PlayerBase nplayer;
9503 if (PlayerBase.CastTo(nplayer,player))
9504 {
9505
9506 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9507
9508 }
9509
9510
9511 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9512
9513
9514 if (HasEnergyManager())
9515 {
9516 GetCompEM().UpdatePlugState();
9517 }
9518 }
9519
9520
9522 {
9523 super.OnPlacementStarted(player);
9524
9526 }
9527
9528 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9529 {
9531 {
9532 m_AdminLog.OnPlacementComplete(player,
this);
9533 }
9534
9535 super.OnPlacementComplete(player, position, orientation);
9536 }
9537
9538
9539
9540
9541
9543 {
9545 {
9546 return true;
9547 }
9548 else
9549 {
9550 return false;
9551 }
9552 }
9553
9554
9556 {
9558 {
9560 }
9561 }
9562
9563
9565 {
9567 }
9568
9570 {
9572 }
9573
9574 override void InsertAgent(
int agent,
float count = 1)
9575 {
9576 if (count < 1)
9577 return;
9578
9580 }
9581
9584 {
9586 }
9587
9588
9590 {
9592 }
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9636 {
9638 return false;
9639 return true;
9640 }
9641
9643 {
9644
9646 }
9647
9648
9651 {
9652 super.CheckForRoofLimited(timeTresholdMS);
9653
9655 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9656 {
9657 m_PreviousRoofTestTime = time;
9658 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9659 }
9660 }
9661
9662
9664 {
9666 {
9667 return 0;
9668 }
9669
9670 if (GetInventory().GetAttachmentSlotsCount() != 0)
9671 {
9672 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9673 if (filter)
9674 return filter.GetProtectionLevel(type, false, system);
9675 else
9676 return 0;
9677 }
9678
9679 string subclassPath, entryName;
9680
9681 switch (type)
9682 {
9684 entryName = "biological";
9685 break;
9687 entryName = "chemical";
9688 break;
9689 default:
9690 entryName = "biological";
9691 break;
9692 }
9693
9694 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9695
9697 }
9698
9699
9700
9703 {
9704 if (!IsMagazine())
9706
9708 }
9709
9710
9711
9712
9713
9718 {
9719 return true;
9720 }
9721
9723 {
9725 }
9726
9727
9728
9729
9730
9732 {
9733 if (parent)
9734 {
9735 if (parent.IsInherited(DayZInfected))
9736 return true;
9737
9738 if (!parent.IsRuined())
9739 return true;
9740 }
9741
9742 return true;
9743 }
9744
9746 {
9747 if (!super.CanPutAsAttachment(parent))
9748 {
9749 return false;
9750 }
9751
9752 if (!IsRuined() && !parent.IsRuined())
9753 {
9754 return true;
9755 }
9756
9757 return false;
9758 }
9759
9761 {
9762
9763
9764
9765
9766 return super.CanReceiveItemIntoCargo(item);
9767 }
9768
9770 {
9771
9772
9773
9774
9775 GameInventory attachmentInv = attachment.GetInventory();
9777 {
9778 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9779 return false;
9780 }
9781
9782 InventoryLocation loc = new InventoryLocation();
9783 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9784 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9785 return false;
9786
9787 return super.CanReceiveAttachment(attachment, slotId);
9788 }
9789
9791 {
9792 if (!super.CanReleaseAttachment(attachment))
9793 return false;
9794
9795 return GetInventory().AreChildrenAccessible();
9796 }
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9819 {
9820 int id = muzzle_owner.GetMuzzleID();
9821 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9822
9823 if (WPOF_array)
9824 {
9825 for (int i = 0; i < WPOF_array.Count(); i++)
9826 {
9827 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9828
9829 if (WPOF)
9830 {
9831 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9832 }
9833 }
9834 }
9835 }
9836
9837
9839 {
9840 int id = muzzle_owner.GetMuzzleID();
9842
9843 if (WPOBE_array)
9844 {
9845 for (int i = 0; i < WPOBE_array.Count(); i++)
9846 {
9847 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9848
9849 if (WPOBE)
9850 {
9851 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9852 }
9853 }
9854 }
9855 }
9856
9857
9859 {
9860 int id = muzzle_owner.GetMuzzleID();
9861 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9862
9863 if (WPOOH_array)
9864 {
9865 for (int i = 0; i < WPOOH_array.Count(); i++)
9866 {
9867 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9868
9869 if (WPOOH)
9870 {
9871 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9872 }
9873 }
9874 }
9875 }
9876
9877
9879 {
9880 int id = muzzle_owner.GetMuzzleID();
9881 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9882
9883 if (WPOOH_array)
9884 {
9885 for (int i = 0; i < WPOOH_array.Count(); i++)
9886 {
9887 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9888
9889 if (WPOOH)
9890 {
9891 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9892 }
9893 }
9894 }
9895 }
9896
9897
9899 {
9900 int id = muzzle_owner.GetMuzzleID();
9901 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9902
9903 if (WPOOH_array)
9904 {
9905 for (int i = 0; i < WPOOH_array.Count(); i++)
9906 {
9907 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9908
9909 if (WPOOH)
9910 {
9911 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9912 }
9913 }
9914 }
9915 }
9916
9917
9918
9920 {
9922 {
9923 return true;
9924 }
9925
9926 return false;
9927 }
9928
9930 {
9932 {
9933 return true;
9934 }
9935
9936 return false;
9937 }
9938
9940 {
9942 {
9943 return true;
9944 }
9945
9946 return false;
9947 }
9948
9950 {
9951 return false;
9952 }
9953
9956 {
9957 return UATimeSpent.DEFAULT_DEPLOY;
9958 }
9959
9960
9961
9962
9964 {
9966 SetSynchDirty();
9967 }
9968
9970 {
9972 }
9973
9974
9976 {
9977 return false;
9978 }
9979
9982 {
9983 string att_type = "None";
9984
9985 if (ConfigIsExisting("soundAttType"))
9986 {
9987 att_type = ConfigGetString("soundAttType");
9988 }
9989
9991 }
9992
9994 {
9996 }
9997
9998
9999
10000
10001
10005
10007 {
10010
10012 }
10013
10014
10016 {
10018 return;
10019
10021
10024
10027
10028 SoundParameters params = new SoundParameters();
10032 }
10033
10034
10036 {
10038 return;
10039
10041 SetSynchDirty();
10042
10045 }
10046
10047
10049 {
10051 return;
10052
10054 SetSynchDirty();
10055
10058 }
10059
10061 {
10063 }
10064
10066 {
10068 }
10069
10072 {
10073 if (!
GetGame().IsDedicatedServer())
10074 {
10075 if (ConfigIsExisting("attachSoundSet"))
10076 {
10077 string cfg_path = "";
10078 string soundset = "";
10079 string type_name =
GetType();
10080
10083 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10084 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10085
10086 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10087 {
10088 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10089 {
10090 if (cfg_slot_array[i] == slot_type)
10091 {
10092 soundset = cfg_soundset_array[i];
10093 break;
10094 }
10095 }
10096 }
10097
10098 if (soundset != "")
10099 {
10100 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10102 }
10103 }
10104 }
10105 }
10106
10108 {
10109
10110 }
10111
10112 void OnApply(PlayerBase player);
10113
10115 {
10116 return 1.0;
10117 };
10118
10120 {
10122 }
10123
10125 {
10127 }
10128
10130
10132 {
10133 SetDynamicPhysicsLifeTime(0.01);
10135 }
10136
10138 {
10139 array<string> zone_names = new array<string>;
10140 GetDamageZones(zone_names);
10141 for (int i = 0; i < zone_names.Count(); i++)
10142 {
10143 SetHealthMax(zone_names.Get(i),"Health");
10144 }
10145 SetHealthMax("","Health");
10146 }
10147
10150 {
10151 float global_health = GetHealth01("","Health");
10152 array<string> zones = new array<string>;
10153 GetDamageZones(zones);
10154
10155 for (int i = 0; i < zones.Count(); i++)
10156 {
10157 SetHealth01(zones.Get(i),"Health",global_health);
10158 }
10159 }
10160
10163 {
10164 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10165 }
10166
10168 {
10169 if (!hasRootAsPlayer)
10170 {
10171 if (refParentIB)
10172 {
10173
10174 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10175 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10176
10177 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10178 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10179
10182 }
10183 else
10184 {
10185
10188 }
10189 }
10190 }
10191
10193 {
10195 {
10196 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10197 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10198 {
10199 float heatPermCoef = 1.0;
10201 while (ent)
10202 {
10203 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10204 ent = ent.GetHierarchyParent();
10205 }
10206
10207 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10208 }
10209 }
10210 }
10211
10213 {
10214
10215 EntityAI parent = GetHierarchyParent();
10216 if (!parent)
10217 {
10218 hasParent = false;
10219 hasRootAsPlayer = false;
10220 }
10221 else
10222 {
10223 hasParent = true;
10224 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10225 refParentIB =
ItemBase.Cast(parent);
10226 }
10227 }
10228
10229 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10230 {
10231
10232 }
10233
10235 {
10236
10237 return false;
10238 }
10239
10241 {
10242
10243
10244 return false;
10245 }
10246
10248 {
10249
10250 return false;
10251 }
10252
10255 {
10256 return !GetIsFrozen() &&
IsOpen();
10257 }
10258
10260 {
10261 bool hasParent = false, hasRootAsPlayer = false;
10263
10264 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10265 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10266
10267 if (wwtu || foodDecay)
10268 {
10272
10273 if (processWetness || processTemperature || processDecay)
10274 {
10276
10277 if (processWetness)
10278 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10279
10280 if (processTemperature)
10282
10283 if (processDecay)
10284 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10285 }
10286 }
10287 }
10288
10291 {
10293 }
10294
10296 {
10299
10300 return super.GetTemperatureFreezeThreshold();
10301 }
10302
10304 {
10307
10308 return super.GetTemperatureThawThreshold();
10309 }
10310
10312 {
10315
10316 return super.GetItemOverheatThreshold();
10317 }
10318
10320 {
10322 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10323
10324 return super.GetTemperatureFreezeTime();
10325 }
10326
10328 {
10330 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10331
10332 return super.GetTemperatureThawTime();
10333 }
10334
10339
10341 {
10342 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10343 }
10344
10346 {
10347 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10348 }
10349
10352 {
10354 }
10355
10357 {
10359 }
10360
10362 {
10364 }
10365
10368 {
10369 return null;
10370 }
10371
10374 {
10375 return false;
10376 }
10377
10379 {
10381 {
10384 if (!trg)
10385 {
10387 explosive = this;
10388 }
10389
10390 explosive.PairRemote(trg);
10392
10393 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10394 trg.SetPersistentPairID(persistentID);
10395 explosive.SetPersistentPairID(persistentID);
10396
10397 return true;
10398 }
10399 return false;
10400 }
10401
10404 {
10405 float ret = 1.0;
10408 ret *= GetHealth01();
10409
10410 return ret;
10411 }
10412
10413 #ifdef DEVELOPER
10414 override void SetDebugItem()
10415 {
10416 super.SetDebugItem();
10417 _itemBase = this;
10418 }
10419
10421 {
10422 string text = super.GetDebugText();
10423
10425 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10426
10427 return text;
10428 }
10429 #endif
10430
10432 {
10433 return true;
10434 }
10435
10437
10439
10441 {
10444 }
10445
10446
10454
10470}
10471
10473{
10475 if (entity)
10476 {
10477 bool is_item = entity.IsInherited(
ItemBase);
10478 if (is_item && full_quantity)
10479 {
10482 }
10483 }
10484 else
10485 {
10487 return NULL;
10488 }
10489 return entity;
10490}
10491
10493{
10494 if (item)
10495 {
10496 if (health > 0)
10497 item.SetHealth("", "", health);
10498
10499 if (item.CanHaveTemperature())
10500 {
10502 if (item.CanFreeze())
10503 item.SetFrozen(false);
10504 }
10505
10506 if (item.HasEnergyManager())
10507 {
10508 if (quantity >= 0)
10509 {
10510 item.GetCompEM().SetEnergy0To1(quantity);
10511 }
10512 else
10513 {
10515 }
10516 }
10517 else if (item.IsMagazine())
10518 {
10519 Magazine mag = Magazine.Cast(item);
10520 if (quantity >= 0)
10521 {
10522 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10523 }
10524 else
10525 {
10527 }
10528
10529 }
10530 else
10531 {
10532 if (quantity >= 0)
10533 {
10534 item.SetQuantityNormalized(quantity, false);
10535 }
10536 else
10537 {
10539 }
10540
10541 }
10542 }
10543}
10544
10545#ifdef DEVELOPER
10547#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.