5547{
5549 {
5550 return true;
5551 }
5552};
5553
5554
5555
5557{
5561
5563
5566
5567
5568
5569
5570
5579
5585
5590
5595
5616 protected bool m_IsResultOfSplit
5617
5619
5624
5625
5626
5628
5632
5633
5634
5636
5639
5640
5641
5647
5648
5656
5659
5660
5662
5663
5665
5666
5671
5672
5677
5678
5680
5681
5683 {
5688
5689 if (!
GetGame().IsDedicatedServer())
5690 {
5692 {
5694
5696 {
5698 }
5699 }
5700
5703 }
5704
5705 m_OldLocation = null;
5706
5708 {
5710 }
5711
5712 if (ConfigIsExisting("headSelectionsToHide"))
5713 {
5716 }
5717
5719 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5720 {
5722 }
5723
5725
5726 m_IsResultOfSplit = false;
5727
5729 }
5730
5732 {
5733 super.InitItemVariables();
5734
5740 m_Count = ConfigGetInt(
"count");
5741
5744
5749
5752
5757
5769
5773
5774
5777 if (ConfigIsExisting("canBeSplit"))
5778 {
5781 }
5782
5784 if (ConfigIsExisting("itemBehaviour"))
5786
5787
5790 RegisterNetSyncVariableInt("m_VarLiquidType");
5791 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5792
5793 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5794 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5795 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5796
5797 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5798 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5799 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5800 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5801
5802 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5803 RegisterNetSyncVariableBool("m_IsTakeable");
5804 RegisterNetSyncVariableBool("m_IsHologram");
5805
5808 {
5811 }
5812
5814
5816 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5818
5819 }
5820
5822 {
5824 }
5825
5827 {
5830 {
5835 }
5836 }
5837
5838 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5839 {
5841 {
5844 }
5845
5847 }
5848
5850 {
5856 }
5857
5859
5861 {
5863
5864 if (!action)
5865 {
5866 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5867 return;
5868 }
5869
5871 if (!ai)
5872 {
5874 return;
5875 }
5876
5878 if (!action_array)
5879 {
5880 action_array = new array<ActionBase_Basic>;
5882 }
5883 if (LogManager.IsActionLogEnable())
5884 {
5885 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5886 }
5887
5888 if (action_array.Find(action) != -1)
5889 {
5890 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5891 }
5892 else
5893 {
5894 action_array.Insert(action);
5895 }
5896 }
5897
5899 {
5901 ActionBase action = player.GetActionManager().GetAction(actionName);
5904
5905 if (action_array)
5906 {
5907 action_array.RemoveItem(action);
5908 }
5909 }
5910
5911
5912
5914 {
5915 ActionOverrideData overrideData = new ActionOverrideData();
5919
5921 if (!actionMap)
5922 {
5925 }
5926
5927 actionMap.Insert(this.
Type(), overrideData);
5928
5929 }
5930
5932
5934
5935
5937 {
5940
5943
5944 string config_to_search = "CfgVehicles";
5945 string muzzle_owner_config;
5946
5948 {
5949 if (IsInherited(Weapon))
5950 config_to_search = "CfgWeapons";
5951
5952 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5953
5954 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5955
5957
5958 if (config_OnFire_subclass_count > 0)
5959 {
5960 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5961
5962 for (int i = 0; i < config_OnFire_subclass_count; i++)
5963 {
5964 string particle_class = "";
5966 string config_OnFire_entry = config_OnFire_class + particle_class;
5967 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5968 WPOF_array.Insert(WPOF);
5969 }
5970
5971
5973 }
5974 }
5975
5977 {
5978 config_to_search = "CfgWeapons";
5979 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5980
5981 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5982
5984
5985 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5986 {
5987 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5988
5989 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5990 {
5991 string particle_class2 = "";
5993 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5994 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5995 WPOBE_array.Insert(WPOBE);
5996 }
5997
5998
6000 }
6001 }
6002 }
6003
6004
6006 {
6009
6011 {
6012 string config_to_search = "CfgVehicles";
6013
6014 if (IsInherited(Weapon))
6015 config_to_search = "CfgWeapons";
6016
6017 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6018 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6019
6020 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6021 {
6022
6024
6026 {
6028 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6030 return;
6031 }
6032
6035
6036
6037
6039 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6040
6041 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6042 {
6043 string particle_class = "";
6045 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6047
6048 if (entry_type == CT_CLASS)
6049 {
6050 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6051 WPOOH_array.Insert(WPOF);
6052 }
6053 }
6054
6055
6057 }
6058 }
6059 }
6060
6062 {
6064 }
6065
6067 {
6069 {
6071
6074
6077
6078 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6079 }
6080 }
6081
6083 {
6085 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6086
6088 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6089
6091 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6092
6094 {
6096 }
6097 }
6098
6100 {
6102 }
6103
6105 {
6108 else
6110
6112 {
6115 }
6116 else
6117 {
6120
6123 }
6124
6126 }
6127
6129 {
6131 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6132 }
6133
6135 {
6137 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6139 }
6140
6142 {
6144 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6145 }
6146
6148 {
6151
6152 OverheatingParticle OP = new OverheatingParticle();
6157
6159 }
6160
6162 {
6165
6166 return -1;
6167 }
6168
6170 {
6172 {
6175
6176 for (int i = count; i > 0; --i)
6177 {
6178 int id = i - 1;
6181
6184
6185 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6186 {
6187 if (p)
6188 {
6191 }
6192 }
6193 }
6194 }
6195 }
6196
6198 {
6200 {
6202 {
6203 int id = i - 1;
6205
6206 if (OP)
6207 {
6209
6210 if (p)
6211 {
6213 }
6214
6215 delete OP;
6216 }
6217 }
6218
6221 }
6222 }
6223
6226 {
6227 return 0.0;
6228 }
6229
6230
6232 {
6233 return 250;
6234 }
6235
6237 {
6238 return 0;
6239 }
6240
6243 {
6245 return true;
6246
6247 return false;
6248 }
6249
6252 {
6255
6257 {
6259 }
6260 else
6261 {
6262
6264 }
6265
6267 }
6268
6275 {
6276 return -1;
6277 }
6278
6279
6280
6281
6283 {
6285 {
6287 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6288
6289 if (r_index >= 0)
6290 {
6291 InventoryLocation r_il = new InventoryLocation;
6292 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6293
6294 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6297 {
6298 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6299 }
6301 {
6302 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6303 }
6304
6305 }
6306
6307 player.GetHumanInventory().ClearUserReservedLocation(this);
6308 }
6309
6312 }
6313
6314
6315
6316
6318 {
6319 return ItemBase.m_DebugActionsMask;
6320 }
6321
6323 {
6324 return ItemBase.m_DebugActionsMask & mask;
6325 }
6326
6328 {
6329 ItemBase.m_DebugActionsMask = mask;
6330 }
6331
6333 {
6334 ItemBase.m_DebugActionsMask |= mask;
6335 }
6336
6338 {
6339 ItemBase.m_DebugActionsMask &= ~mask;
6340 }
6341
6343 {
6345 {
6347 }
6348 else
6349 {
6351 }
6352 }
6353
6354
6356 {
6357 if (GetEconomyProfile())
6358 {
6359 float q_max = GetEconomyProfile().GetQuantityMax();
6360 if (q_max > 0)
6361 {
6362 float q_min = GetEconomyProfile().GetQuantityMin();
6363 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6364
6366 {
6367 ComponentEnergyManager comp = GetCompEM();
6369 {
6371 }
6372 }
6374 {
6376
6377 }
6378
6379 }
6380 }
6381 }
6382
6385 {
6386 EntityAI parent = GetHierarchyParent();
6387
6388 if (parent)
6389 {
6390 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6391 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6392 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6393 }
6394 }
6395
6398 {
6399 EntityAI parent = GetHierarchyParent();
6400
6401 if (parent)
6402 {
6403 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6404 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6405 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6406 }
6407 }
6408
6410 {
6411
6412
6413
6414
6416
6418 {
6419 if (ScriptInputUserData.CanStoreInputUserData())
6420 {
6421 ScriptInputUserData ctx = new ScriptInputUserData;
6427 ctx.
Write(use_stack_max);
6430
6432 {
6433 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6434 }
6435 }
6436 }
6437 else if (!
GetGame().IsMultiplayer())
6438 {
6440 }
6441 }
6442
6444 {
6446 }
6447
6449 {
6451 }
6452
6454 {
6456 }
6457
6459 {
6460
6461 return false;
6462 }
6463
6465 {
6466 return false;
6467 }
6468
6472 {
6473 return false;
6474 }
6475
6477 {
6478 return "";
6479 }
6480
6482
6484 {
6485 return false;
6486 }
6487
6489 {
6490 return true;
6491 }
6492
6493
6494
6496 {
6497 return true;
6498 }
6499
6501 {
6502 return true;
6503 }
6504
6506 {
6507 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6509 }
6510
6512 {
6514 }
6515
6517 {
6519 if (!is_being_placed)
6521 SetSynchDirty();
6522 }
6523
6524
6526
6528 {
6530 }
6531
6533 {
6535 }
6536
6538 {
6539 return 1;
6540 }
6541
6543 {
6544 return false;
6545 }
6546
6548 {
6550 SetSynchDirty();
6551 }
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6588 {
6589 super.OnMovedInsideCargo(container);
6590
6591 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6592 }
6593
6594 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6595 {
6596 super.EEItemLocationChanged(oldLoc,newLoc);
6597
6598 PlayerBase new_player = null;
6599 PlayerBase old_player = null;
6600
6601 if (newLoc.GetParent())
6602 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6603
6604 if (oldLoc.GetParent())
6605 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6606
6608 {
6609 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6610
6611 if (r_index >= 0)
6612 {
6613 InventoryLocation r_il = new InventoryLocation;
6614 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6615
6616 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6619 {
6620 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6621 }
6623 {
6624 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6625 }
6626
6627 }
6628 }
6629
6631 {
6632 if (new_player)
6633 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6634
6635 if (new_player == old_player)
6636 {
6637
6638 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6639 {
6641 {
6642 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6643 {
6644 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6645 }
6646 }
6647 else
6648 {
6649 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6650 }
6651 }
6652
6653 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6654 {
6655 int type = oldLoc.GetType();
6657 {
6658 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6659 }
6661 {
6662 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6663 }
6664 }
6665 if (!m_OldLocation)
6666 {
6667 m_OldLocation = new InventoryLocation;
6668 }
6669 m_OldLocation.Copy(oldLoc);
6670 }
6671 else
6672 {
6673 if (m_OldLocation)
6674 {
6675 m_OldLocation.Reset();
6676 }
6677 }
6678
6680 }
6681 else
6682 {
6683 if (new_player)
6684 {
6685 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6686 if (res_index >= 0)
6687 {
6688 InventoryLocation il = new InventoryLocation;
6689 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6691 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6694 {
6695 il.
GetParent().GetOnReleaseLock().Invoke(it);
6696 }
6698 {
6700 }
6701
6702 }
6703 }
6705 {
6706
6708 }
6709
6710 if (m_OldLocation)
6711 {
6712 m_OldLocation.Reset();
6713 }
6714 }
6715 }
6716
6717 override void EOnContact(IEntity other, Contact extra)
6718 {
6720 {
6721 int liquidType = -1;
6723 if (impactSpeed > 0.0)
6724 {
6726 #ifndef SERVER
6728 #else
6730 SetSynchDirty();
6731 #endif
6733 }
6734 }
6735
6736 #ifdef SERVER
6737 if (GetCompEM() && GetCompEM().IsPlugged())
6738 {
6739 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6740 GetCompEM().UnplugThis();
6741 }
6742 #endif
6743 }
6744
6746
6748 {
6750 }
6751
6753 {
6754
6755 }
6756
6758 {
6759 super.OnItemLocationChanged(old_owner, new_owner);
6760
6761 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6762 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6763
6764 if (!relatedPlayer && playerNew)
6765 relatedPlayer = playerNew;
6766
6767 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6768 {
6770 if (actionMgr)
6771 {
6772 ActionBase currentAction = actionMgr.GetRunningAction();
6773 if (currentAction)
6775 }
6776 }
6777
6778 Man ownerPlayerOld = null;
6779 Man ownerPlayerNew = null;
6780
6781 if (old_owner)
6782 {
6783 if (old_owner.
IsMan())
6784 {
6785 ownerPlayerOld = Man.Cast(old_owner);
6786 }
6787 else
6788 {
6789 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6790 }
6791 }
6792 else
6793 {
6795 {
6797
6798 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6799 {
6800 GetCompEM().UnplugThis();
6801 }
6802 }
6803 }
6804
6805 if (new_owner)
6806 {
6807 if (new_owner.
IsMan())
6808 {
6809 ownerPlayerNew = Man.Cast(new_owner);
6810 }
6811 else
6812 {
6813 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6814 }
6815 }
6816
6817 if (ownerPlayerOld != ownerPlayerNew)
6818 {
6819 if (ownerPlayerOld)
6820 {
6821 array<EntityAI> subItemsExit = new array<EntityAI>;
6823 for (int i = 0; i < subItemsExit.Count(); i++)
6824 {
6827 }
6828 }
6829
6830 if (ownerPlayerNew)
6831 {
6832 array<EntityAI> subItemsEnter = new array<EntityAI>;
6834 for (int j = 0; j < subItemsEnter.Count(); j++)
6835 {
6838 }
6839 }
6840 }
6841 else if (ownerPlayerNew != null)
6842 {
6843 PlayerBase nplayer;
6844 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6845 {
6846 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6848 for (int k = 0; k < subItemsUpdate.Count(); k++)
6849 {
6851 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6852 }
6853 }
6854 }
6855
6856 if (old_owner)
6857 old_owner.OnChildItemRemoved(this);
6858 if (new_owner)
6859 new_owner.OnChildItemReceived(this);
6860 }
6861
6862
6864 {
6865 super.EEDelete(parent);
6866 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6867 if (player)
6868 {
6870
6871 if (player.IsAlive())
6872 {
6873 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6874 if (r_index >= 0)
6875 {
6876 InventoryLocation r_il = new InventoryLocation;
6877 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6878
6879 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6882 {
6883 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6884 }
6886 {
6887 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6888 }
6889
6890 }
6891
6892 player.RemoveQuickBarEntityShortcut(this);
6893 }
6894 }
6895 }
6896
6898 {
6899 super.EEKilled(killer);
6900
6903 {
6904 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6905 {
6906 if (IsMagazine())
6907 {
6908 if (Magazine.Cast(this).GetAmmoCount() > 0)
6909 {
6911 }
6912 }
6913 else
6914 {
6916 }
6917 }
6918 }
6919 }
6920
6922 {
6923 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6924
6925 super.OnWasAttached(parent, slot_id);
6926
6929
6931 }
6932
6934 {
6935 super.OnWasDetached(parent, slot_id);
6936
6939 }
6940
6942 {
6943 int idx;
6946
6947 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6948 if (inventory_slots.Count() < 1)
6949 {
6950 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6951 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6952 }
6953 else
6954 {
6955 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6956 }
6957
6958 idx = inventory_slots.Find(slot);
6959 if (idx < 0)
6960 return "";
6961
6962 return attach_types.Get(idx);
6963 }
6964
6966 {
6967 int idx = -1;
6968 string slot;
6969
6972
6973 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6974 if (inventory_slots.Count() < 1)
6975 {
6976 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6977 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6978 }
6979 else
6980 {
6981 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6982 if (detach_types.Count() < 1)
6983 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6984 }
6985
6986 for (int i = 0; i < inventory_slots.Count(); i++)
6987 {
6988 slot = inventory_slots.Get(i);
6989 }
6990
6991 if (slot != "")
6992 {
6993 if (detach_types.Count() == 1)
6994 idx = 0;
6995 else
6996 idx = inventory_slots.Find(slot);
6997 }
6998 if (idx < 0)
6999 return "";
7000
7001 return detach_types.Get(idx);
7002 }
7003
7005 {
7006
7008
7009
7010 float min_time = 1;
7011 float max_time = 3;
7012 float delay = Math.RandomFloat(min_time, max_time);
7013
7014 explode_timer.Run(delay, this, "DoAmmoExplosion");
7015 }
7016
7018 {
7019 Magazine magazine = Magazine.Cast(this);
7020 int pop_sounds_count = 6;
7021 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7022
7023
7024 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7025 string sound_name = pop_sounds[ sound_idx ];
7027
7028
7029 magazine.ServerAddAmmoCount(-1);
7030
7031
7032 float min_temp_to_explode = 100;
7033
7034 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7035 {
7037 }
7038 }
7039
7040
7041 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7042 {
7043 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7044
7045 const int CHANCE_DAMAGE_CARGO = 4;
7046 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7047 const int CHANCE_DAMAGE_NOTHING = 2;
7048
7050 {
7051 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7052 int chances;
7053 int rnd;
7054
7055 if (GetInventory().GetCargo())
7056 {
7057 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7058 rnd = Math.RandomInt(0,chances);
7059
7060 if (rnd < CHANCE_DAMAGE_CARGO)
7061 {
7063 }
7064 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7065 {
7067 }
7068 }
7069 else
7070 {
7071 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7072 rnd = Math.RandomInt(0,chances);
7073
7074 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7075 {
7077 }
7078 }
7079 }
7080 }
7081
7083 {
7084 if (GetInventory().GetCargo())
7085 {
7086 int item_count = GetInventory().GetCargo().GetItemCount();
7087 if (item_count > 0)
7088 {
7089 int random_pick = Math.RandomInt(0, item_count);
7091 if (!item.IsExplosive())
7092 {
7093 item.AddHealth("","",damage);
7094 return true;
7095 }
7096 }
7097 }
7098 return false;
7099 }
7100
7102 {
7103 int attachment_count = GetInventory().AttachmentCount();
7104 if (attachment_count > 0)
7105 {
7106 int random_pick = Math.RandomInt(0, attachment_count);
7107 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7108 if (!attachment.IsExplosive())
7109 {
7110 attachment.AddHealth("","",damage);
7111 return true;
7112 }
7113 }
7114 return false;
7115 }
7116
7118 {
7120 }
7121
7123 {
7125 return GetInventory().CanRemoveEntity();
7126
7127 return false;
7128 }
7129
7131 {
7133 return;
7134
7136 {
7137 if (ScriptInputUserData.CanStoreInputUserData())
7138 {
7139 ScriptInputUserData ctx = new ScriptInputUserData;
7144 ctx.
Write(destination_entity);
7148 }
7149 }
7150 else if (!
GetGame().IsMultiplayer())
7151 {
7153 }
7154 }
7155
7157 {
7159 return;
7160
7161 float split_quantity_new;
7165 InventoryLocation loc = new InventoryLocation;
7166
7167 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7168 {
7170 split_quantity_new = stack_max;
7171 else
7173
7174 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7175 if (new_item)
7176 {
7177 new_item.SetResultOfSplit(true);
7178 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7180 new_item.SetQuantity(split_quantity_new);
7181 }
7182 }
7183 else if (destination_entity && slot_id == -1)
7184 {
7185 if (quantity > stack_max)
7186 split_quantity_new = stack_max;
7187 else
7188 split_quantity_new = quantity;
7189
7191 {
7194 }
7195
7196 if (new_item)
7197 {
7198 new_item.SetResultOfSplit(true);
7199 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7201 new_item.SetQuantity(split_quantity_new);
7202 }
7203 }
7204 else
7205 {
7206 if (stack_max != 0)
7207 {
7209 {
7211 }
7212
7213 if (split_quantity_new == 0)
7214 {
7215 if (!
GetGame().IsMultiplayer())
7216 player.PhysicalPredictiveDropItem(this);
7217 else
7218 player.ServerDropEntity(this);
7219 return;
7220 }
7221
7223
7224 if (new_item)
7225 {
7226 new_item.SetResultOfSplit(true);
7227 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7229 new_item.SetQuantity(stack_max);
7230 new_item.PlaceOnSurface();
7231 }
7232 }
7233 }
7234 }
7235
7237 {
7239 return;
7240
7241 float split_quantity_new;
7245 InventoryLocation loc = new InventoryLocation;
7246
7247 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7248 {
7250 split_quantity_new = stack_max;
7251 else
7253
7254 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7255 if (new_item)
7256 {
7257 new_item.SetResultOfSplit(true);
7258 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7260 new_item.SetQuantity(split_quantity_new);
7261 }
7262 }
7263 else if (destination_entity && slot_id == -1)
7264 {
7265 if (quantity > stack_max)
7266 split_quantity_new = stack_max;
7267 else
7268 split_quantity_new = quantity;
7269
7271 {
7274 }
7275
7276 if (new_item)
7277 {
7278 new_item.SetResultOfSplit(true);
7279 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7281 new_item.SetQuantity(split_quantity_new);
7282 }
7283 }
7284 else
7285 {
7286 if (stack_max != 0)
7287 {
7289 {
7291 }
7292
7294
7295 if (new_item)
7296 {
7297 new_item.SetResultOfSplit(true);
7298 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7300 new_item.SetQuantity(stack_max);
7301 new_item.PlaceOnSurface();
7302 }
7303 }
7304 }
7305 }
7306
7308 {
7310 return;
7311
7313 {
7314 if (ScriptInputUserData.CanStoreInputUserData())
7315 {
7316 ScriptInputUserData ctx = new ScriptInputUserData;
7321 dst.WriteToContext(ctx);
7323 }
7324 }
7325 else if (!
GetGame().IsMultiplayer())
7326 {
7328 }
7329 }
7330
7332 {
7334 return;
7335
7337 {
7338 if (ScriptInputUserData.CanStoreInputUserData())
7339 {
7340 ScriptInputUserData ctx = new ScriptInputUserData;
7345 ctx.
Write(destination_entity);
7351 }
7352 }
7353 else if (!
GetGame().IsMultiplayer())
7354 {
7356 }
7357 }
7358
7360 {
7362 }
7363
7365 {
7367 return this;
7368
7370 float split_quantity_new;
7372 if (dst.IsValid())
7373 {
7374 int slot_id = dst.GetSlot();
7376
7377 if (quantity > stack_max)
7378 split_quantity_new = stack_max;
7379 else
7380 split_quantity_new = quantity;
7381
7383
7384 if (new_item)
7385 {
7386 new_item.SetResultOfSplit(true);
7387 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7390 }
7391
7392 return new_item;
7393 }
7394
7395 return null;
7396 }
7397
7399 {
7401 return;
7402
7404 float split_quantity_new;
7406 if (destination_entity)
7407 {
7409 if (quantity > stackable)
7410 split_quantity_new = stackable;
7411 else
7412 split_quantity_new = quantity;
7413
7414 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7415 if (new_item)
7416 {
7417 new_item.SetResultOfSplit(true);
7418 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7420 new_item.SetQuantity(split_quantity_new);
7421 }
7422 }
7423 }
7424
7426 {
7428 return;
7429
7431 {
7432 if (ScriptInputUserData.CanStoreInputUserData())
7433 {
7434 ScriptInputUserData ctx = new ScriptInputUserData;
7439 ItemBase destination_entity =
this;
7440 ctx.
Write(destination_entity);
7444 }
7445 }
7446 else if (!
GetGame().IsMultiplayer())
7447 {
7449 }
7450 }
7451
7453 {
7455 return;
7456
7458 float split_quantity_new;
7460 if (player)
7461 {
7463 if (quantity > stackable)
7464 split_quantity_new = stackable;
7465 else
7466 split_quantity_new = quantity;
7467
7468 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7469 new_item =
ItemBase.Cast(in_hands);
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 }
7479
7481 {
7483 return;
7484
7486 float split_quantity_new = Math.Floor(quantity * 0.5);
7487
7489
7490 if (new_item)
7491 {
7492 if (new_item.GetQuantityMax() < split_quantity_new)
7493 {
7494 split_quantity_new = new_item.GetQuantityMax();
7495 }
7496
7497 new_item.SetResultOfSplit(true);
7498 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7499
7501 {
7504 }
7505 else
7506 {
7509 }
7510 }
7511 }
7512
7514 {
7516 return;
7517
7519 float split_quantity_new = Math.Floor(quantity / 2);
7520
7521 InventoryLocation invloc = new InventoryLocation;
7523
7525 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7526
7527 if (new_item)
7528 {
7529 if (new_item.GetQuantityMax() < split_quantity_new)
7530 {
7531 split_quantity_new = new_item.GetQuantityMax();
7532 }
7534 {
7537 }
7538 else
7539 {
7542 }
7543 }
7544 }
7545
7548 {
7549 SetWeightDirty();
7551
7552 if (parent)
7553 parent.OnAttachmentQuantityChangedEx(this, delta);
7554
7556 {
7558 {
7560 }
7562 {
7563 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7565 }
7566 }
7567
7568 }
7569
7572 {
7573
7574 }
7575
7578 {
7580 }
7581
7583 {
7584 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7585
7587 {
7588 if (newLevel == GameConstants.STATE_RUINED)
7589 {
7591 EntityAI parent = GetHierarchyParent();
7592 if (parent && parent.IsFireplace())
7593 {
7594 CargoBase cargo = GetInventory().GetCargo();
7595 if (cargo)
7596 {
7598 {
7600 }
7601 }
7602 }
7603 }
7604
7606 {
7607
7609 return;
7610 }
7611
7612 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7613 {
7615 }
7616 }
7617 }
7618
7619
7621 {
7622 super.OnRightClick();
7623
7625 {
7627 {
7628 if (ScriptInputUserData.CanStoreInputUserData())
7629 {
7630 vector m4[4];
7632
7633 EntityAI root = GetHierarchyRoot();
7634
7635 InventoryLocation dst = new InventoryLocation;
7637 {
7638 if (root)
7639 {
7640 root.GetTransform(m4);
7642 }
7643 else
7644 GetInventory().GetCurrentInventoryLocation(dst);
7645 }
7646 else
7647 {
7649
7650
7651 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7652 {
7653 if (root)
7654 {
7655 root.GetTransform(m4);
7657 }
7658 else
7659 GetInventory().GetCurrentInventoryLocation(dst);
7660 }
7661 else
7662 {
7663 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7664 }
7665 }
7666
7667 ScriptInputUserData ctx = new ScriptInputUserData;
7675 }
7676 }
7677 else if (!
GetGame().IsMultiplayer())
7678 {
7680 }
7681 }
7682 }
7683
7684 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7685 {
7686
7687 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7688 return false;
7689
7690 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7691 return false;
7692
7693
7695 return false;
7696
7697
7698 Magazine mag = Magazine.Cast(this);
7699 if (mag)
7700 {
7701 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7702 return false;
7703
7704 if (stack_max_limit)
7705 {
7706 Magazine other_mag = Magazine.Cast(other_item);
7707 if (other_item)
7708 {
7709 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7710 return false;
7711 }
7712
7713 }
7714 }
7715 else
7716 {
7717
7719 return false;
7720
7722 return false;
7723 }
7724
7725 PlayerBase player = null;
7726 if (CastTo(player, GetHierarchyRootPlayer()))
7727 {
7728 if (player.GetInventory().HasAttachment(this))
7729 return false;
7730
7731 if (player.IsItemsToDelete())
7732 return false;
7733 }
7734
7735 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7736 return false;
7737
7738 int slotID;
7740 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7741 return false;
7742
7743 return true;
7744 }
7745
7747 {
7749 }
7750
7752 {
7753 return m_IsResultOfSplit;
7754 }
7755
7757 {
7758 m_IsResultOfSplit = value;
7759 }
7760
7762 {
7764 }
7765
7767 {
7768 float other_item_quantity = other_item.GetQuantity();
7769 float this_free_space;
7770
7772
7774
7775 if (other_item_quantity > this_free_space)
7776 {
7777 return this_free_space;
7778 }
7779 else
7780 {
7781 return other_item_quantity;
7782 }
7783 }
7784
7786 {
7788 }
7789
7791 {
7793 return;
7794
7795 if (!IsMagazine() && other_item)
7796 {
7798 if (quantity_used != 0)
7799 {
7800 float hp1 = GetHealth01("","");
7801 float hp2 = other_item.GetHealth01("","");
7802 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7803 hpResult = hpResult / (
GetQuantity() + quantity_used);
7804
7805 hpResult *= GetMaxHealth();
7806 Math.Round(hpResult);
7807 SetHealth("", "Health", hpResult);
7808
7810 other_item.AddQuantity(-quantity_used);
7811 }
7812 }
7814 }
7815
7817 {
7818 #ifdef SERVER
7819 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7820 GetHierarchyParent().IncreaseLifetimeUp();
7821 #endif
7822 };
7823
7825 {
7826 PlayerBase p = PlayerBase.Cast(player);
7827
7828 array<int> recipesIds = p.m_Recipes;
7829 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7830 if (moduleRecipesManager)
7831 {
7832 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7833 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7834 }
7835
7836 for (int i = 0;i < recipesIds.Count(); i++)
7837 {
7838 int key = recipesIds.Get(i);
7839 string recipeName = moduleRecipesManager.GetRecipeName(key);
7841 }
7842 }
7843
7844
7845 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7846 {
7847 super.GetDebugActions(outputList);
7848
7849
7854
7855
7859
7863
7864
7867
7868
7870 {
7873 }
7874
7876
7879
7883 }
7884
7885
7886
7887
7889 {
7890 super.OnAction(action_id, player, ctx);
7891 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7892 {
7893 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7894 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7895 PlayerBase p = PlayerBase.Cast(player);
7896 if (
EActions.RECIPES_RANGE_START < 1000)
7897 {
7898 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7899 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7900 }
7901 }
7902 #ifndef SERVER
7903 else if (action_id ==
EActions.WATCH_PLAYER)
7904 {
7905 PluginDeveloper.SetDeveloperItemClientEx(player);
7906 }
7907 #endif
7909 {
7910 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7911 {
7912 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7913 OnDebugButtonPressServer(id + 1);
7914 }
7915
7916 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7917 {
7918 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7920 }
7921
7922 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7923 {
7924 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7926 }
7927
7928 else if (action_id ==
EActions.ADD_QUANTITY)
7929 {
7930 if (IsMagazine())
7931 {
7932 Magazine mag = Magazine.Cast(this);
7933 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7934 }
7935 else
7936 {
7938 }
7939
7940 if (m_EM)
7941 {
7942 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7943 }
7944
7945 }
7946
7947 else if (action_id ==
EActions.REMOVE_QUANTITY)
7948 {
7949 if (IsMagazine())
7950 {
7951 Magazine mag2 = Magazine.Cast(this);
7952 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7953 }
7954 else
7955 {
7957 }
7958 if (m_EM)
7959 {
7960 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7961 }
7962
7963 }
7964
7965 else if (action_id ==
EActions.SET_QUANTITY_0)
7966 {
7968
7969 if (m_EM)
7970 {
7971 m_EM.SetEnergy(0);
7972 }
7973 }
7974
7975 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7976 {
7978
7979 if (m_EM)
7980 {
7981 m_EM.SetEnergy(m_EM.GetEnergyMax());
7982 }
7983 }
7984
7985 else if (action_id ==
EActions.ADD_HEALTH)
7986 {
7987 AddHealth("","",GetMaxHealth("","Health")/5);
7988 }
7989 else if (action_id ==
EActions.REMOVE_HEALTH)
7990 {
7991 AddHealth("","",-GetMaxHealth("","Health")/5);
7992 }
7993 else if (action_id ==
EActions.DESTROY_HEALTH)
7994 {
7995 SetHealth01("","",0);
7996 }
7997 else if (action_id ==
EActions.WATCH_ITEM)
7998 {
8000 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8001 #ifdef DEVELOPER
8002 SetDebugDeveloper_item(this);
8003 #endif
8004 }
8005
8006 else if (action_id ==
EActions.ADD_TEMPERATURE)
8007 {
8008 AddTemperature(20);
8009
8010 }
8011
8012 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8013 {
8014 AddTemperature(-20);
8015
8016 }
8017
8018 else if (action_id ==
EActions.FLIP_FROZEN)
8019 {
8020 SetFrozen(!GetIsFrozen());
8021
8022 }
8023
8024 else if (action_id ==
EActions.ADD_WETNESS)
8025 {
8027
8028 }
8029
8030 else if (action_id ==
EActions.REMOVE_WETNESS)
8031 {
8033
8034 }
8035
8036 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8037 {
8040
8041
8042 }
8043
8044 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8045 {
8048 }
8049
8050 else if (action_id ==
EActions.MAKE_SPECIAL)
8051 {
8052 auto debugParams = DebugSpawnParams.WithPlayer(player);
8053 OnDebugSpawnEx(debugParams);
8054 }
8055
8056 else if (action_id ==
EActions.DELETE)
8057 {
8058 Delete();
8059 }
8060
8061 }
8062
8063
8064 return false;
8065 }
8066
8067
8068
8069
8073
8076
8077
8078
8080 {
8081 return false;
8082 }
8083
8084
8086 {
8087 return true;
8088 }
8089
8090
8092 {
8093 return true;
8094 }
8095
8096
8097
8099 {
8100 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8102 }
8103
8106 {
8107 return null;
8108 }
8109
8111 {
8112 return false;
8113 }
8114
8116 {
8117 return false;
8118 }
8119
8123
8124
8126 {
8127 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8128 return module_repairing.CanRepair(this, item_repair_kit);
8129 }
8130
8131
8132 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8133 {
8134 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8135 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8136 }
8137
8138
8140 {
8141
8142
8143
8144
8145
8146
8147
8148
8149 return 1;
8150 }
8151
8152
8153
8155 {
8157 }
8158
8159
8160
8162 {
8164 }
8165
8166
8175 {
8176 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8177
8178 if (player)
8179 {
8180 player.MessageStatus(text);
8181 }
8182 }
8183
8184
8193 {
8194 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8195
8196 if (player)
8197 {
8198 player.MessageAction(text);
8199 }
8200 }
8201
8202
8211 {
8212 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8213
8214 if (player)
8215 {
8216 player.MessageFriendly(text);
8217 }
8218 }
8219
8220
8229 {
8230 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8231
8232 if (player)
8233 {
8234 player.MessageImportant(text);
8235 }
8236 }
8237
8239 {
8240 return true;
8241 }
8242
8243
8244 override bool KindOf(
string tag)
8245 {
8246 bool found = false;
8247 string item_name = this.
GetType();
8250
8251 int array_size = item_tag_array.Count();
8252 for (int i = 0; i < array_size; i++)
8253 {
8254 if (item_tag_array.Get(i) == tag)
8255 {
8256 found = true;
8257 break;
8258 }
8259 }
8260 return found;
8261 }
8262
8263
8265 {
8266
8267 super.OnRPC(sender, rpc_type,ctx);
8268
8269
8270 switch (rpc_type)
8271 {
8272 #ifndef SERVER
8273 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8274 Param2<bool, string> p = new Param2<bool, string>(false, "");
8275
8277 return;
8278
8279 bool play = p.param1;
8280 string soundSet = p.param2;
8281
8282 if (play)
8283 {
8285 {
8287 {
8289 }
8290 }
8291 else
8292 {
8294 }
8295 }
8296 else
8297 {
8299 }
8300
8301 break;
8302 #endif
8303
8304 }
8305
8307 {
8309 }
8310 }
8311
8312
8313
8314
8316 {
8317 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8318 return plugin.GetID(
name);
8319 }
8320
8322 {
8323 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8324 return plugin.GetName(id);
8325 }
8326
8329 {
8330
8331
8332 int varFlags;
8333 if (!ctx.
Read(varFlags))
8334 return;
8335
8336 if (varFlags & ItemVariableFlags.FLOAT)
8337 {
8339 }
8340 }
8341
8343 {
8344
8345 super.SerializeNumericalVars(floats_out);
8346
8347
8348
8350 {
8352 }
8353
8355 {
8357 }
8358
8360 {
8362 }
8363
8365 {
8370 }
8371
8373 {
8375 }
8376 }
8377
8379 {
8380
8381 super.DeSerializeNumericalVars(floats);
8382
8383
8384 int index = 0;
8385 int mask = Math.Round(floats.Get(index));
8386
8387 index++;
8388
8390 {
8392 {
8394 }
8395 else
8396 {
8397 float quantity = floats.Get(index);
8399 }
8400 index++;
8401 }
8402
8404 {
8405 float wet = floats.Get(index);
8407 index++;
8408 }
8409
8411 {
8412 int liquidtype = Math.Round(floats.Get(index));
8414 index++;
8415 }
8416
8418 {
8420 index++;
8422 index++;
8424 index++;
8426 index++;
8427 }
8428
8430 {
8431 int cleanness = Math.Round(floats.Get(index));
8433 index++;
8434 }
8435 }
8436
8438 {
8439 super.WriteVarsToCTX(ctx);
8440
8441
8443 {
8445 }
8446
8448 {
8450 }
8451
8453 {
8455 }
8456
8458 {
8459 int r,g,b,a;
8465 }
8466
8468 {
8470 }
8471 }
8472
8474 {
8475 if (!super.ReadVarsFromCTX(ctx,version))
8476 return false;
8477
8478 int intValue;
8479 float value;
8480
8481 if (version < 140)
8482 {
8483 if (!ctx.
Read(intValue))
8484 return false;
8485
8486 m_VariablesMask = intValue;
8487 }
8488
8490 {
8491 if (!ctx.
Read(value))
8492 return false;
8493
8495 {
8497 }
8498 else
8499 {
8501 }
8502 }
8503
8504 if (version < 140)
8505 {
8507 {
8508 if (!ctx.
Read(value))
8509 return false;
8510 SetTemperatureDirect(value);
8511 }
8512 }
8513
8515 {
8516 if (!ctx.
Read(value))
8517 return false;
8519 }
8520
8522 {
8523 if (!ctx.
Read(intValue))
8524 return false;
8526 }
8527
8529 {
8530 int r,g,b,a;
8532 return false;
8534 return false;
8536 return false;
8538 return false;
8539
8541 }
8542
8544 {
8545 if (!ctx.
Read(intValue))
8546 return false;
8548 }
8549
8550 if (version >= 138 && version < 140)
8551 {
8553 {
8554 if (!ctx.
Read(intValue))
8555 return false;
8556 SetFrozen(intValue);
8557 }
8558 }
8559
8560 return true;
8561 }
8562
8563
8565 {
8568 {
8570 }
8571
8572 if (!super.OnStoreLoad(ctx, version))
8573 {
8575 return false;
8576 }
8577
8578 if (version >= 114)
8579 {
8580 bool hasQuickBarIndexSaved;
8581
8582 if (!ctx.
Read(hasQuickBarIndexSaved))
8583 {
8585 return false;
8586 }
8587
8588 if (hasQuickBarIndexSaved)
8589 {
8590 int itmQBIndex;
8591
8592
8593 if (!ctx.
Read(itmQBIndex))
8594 {
8596 return false;
8597 }
8598
8599 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8600 if (itmQBIndex != -1 && parentPlayer)
8601 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8602 }
8603 }
8604 else
8605 {
8606
8607 PlayerBase player;
8608 int itemQBIndex;
8609 if (version ==
int.
MAX)
8610 {
8611 if (!ctx.
Read(itemQBIndex))
8612 {
8614 return false;
8615 }
8616 }
8617 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8618 {
8619
8620 if (!ctx.
Read(itemQBIndex))
8621 {
8623 return false;
8624 }
8625 if (itemQBIndex != -1 && player)
8626 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8627 }
8628 }
8629
8630 if (version < 140)
8631 {
8632
8633 if (!LoadVariables(ctx, version))
8634 {
8636 return false;
8637 }
8638 }
8639
8640
8642 {
8644 return false;
8645 }
8646 if (version >= 132)
8647 {
8649 if (raib)
8650 {
8652 {
8654 return false;
8655 }
8656 }
8657 }
8658
8660 return true;
8661 }
8662
8663
8664
8666 {
8667 super.OnStoreSave(ctx);
8668
8669 PlayerBase player;
8670 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8671 {
8673
8674 int itemQBIndex = -1;
8675 itemQBIndex = player.FindQuickBarEntityIndex(this);
8676 ctx.
Write(itemQBIndex);
8677 }
8678 else
8679 {
8681 }
8682
8684
8686 if (raib)
8687 {
8689 }
8690 }
8691
8692
8694 {
8695 super.AfterStoreLoad();
8696
8698 {
8700 }
8701
8703 {
8706 }
8707 }
8708
8710 {
8711 super.EEOnAfterLoad();
8712
8714 {
8716 }
8717
8720 }
8721
8723 {
8724 return false;
8725 }
8726
8727
8728
8730 {
8732 {
8733 #ifdef PLATFORM_CONSOLE
8734
8736 {
8738 if (menu)
8739 {
8741 }
8742 }
8743 #endif
8744 }
8745
8747 {
8750 }
8751
8753 {
8754 SetWeightDirty();
8756 }
8758 {
8761 }
8762
8764 {
8767 }
8769 {
8772 }
8773
8774 super.OnVariablesSynchronized();
8775 }
8776
8777
8778
8780 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8781 {
8782 if (!IsServerCheck(allow_client))
8783 return false;
8784
8786 return false;
8787
8790
8791 if (value <= (min + 0.001))
8792 value = min;
8793
8794 if (value == min)
8795 {
8796 if (destroy_config)
8797 {
8798 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8799 if (dstr)
8800 {
8802 this.Delete();
8803 return true;
8804 }
8805 }
8806 else if (destroy_forced)
8807 {
8809 this.Delete();
8810 return true;
8811 }
8812
8814 }
8815
8818
8820 {
8822
8823 if (delta)
8825 }
8826
8828
8829 return false;
8830 }
8831
8832
8834 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8835 {
8837 }
8838
8840 {
8843 }
8844
8846 {
8849 }
8850
8853 {
8854 float value_clamped = Math.Clamp(value, 0, 1);
8856 SetQuantity(result, destroy_config, destroy_forced);
8857 }
8858
8859
8862 {
8864 }
8865
8867 {
8869 }
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8881 {
8882 int slot = -1;
8883 if (GetInventory())
8884 {
8885 InventoryLocation il = new InventoryLocation;
8886 GetInventory().GetCurrentInventoryLocation(il);
8888 }
8889
8891 }
8892
8894 {
8895 float quantity_max = 0;
8896
8898 {
8899 if (attSlotID != -1)
8900 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8901
8902 if (quantity_max <= 0)
8904 }
8905
8906 if (quantity_max <= 0)
8908
8909 return quantity_max;
8910 }
8911
8913 {
8915 }
8916
8918 {
8920 }
8921
8922
8924 {
8926 }
8927
8929 {
8931 }
8932
8934 {
8936 }
8937
8938
8940 {
8941
8942 float weightEx = GetWeightEx();
8943 float special = GetInventoryAndCargoWeight();
8944 return weightEx - special;
8945 }
8946
8947
8949 {
8951 }
8952
8954 {
8956 {
8957 #ifdef DEVELOPER
8958 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8959 {
8960 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8962 }
8963 #endif
8964
8966 }
8967 else if (HasEnergyManager())
8968 {
8969 #ifdef DEVELOPER
8970 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8971 {
8972 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8973 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8974 }
8975 #endif
8976 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8977 }
8978 else
8979 {
8980 #ifdef DEVELOPER
8981 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8982 {
8983 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8984 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8985 }
8986 #endif
8987 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
8988 }
8989 }
8990
8993 {
8994 int item_count = 0;
8996
8997 if (GetInventory().GetCargo() != NULL)
8998 {
8999 item_count = GetInventory().GetCargo().GetItemCount();
9000 }
9001
9002 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9003 {
9004 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9005 if (item)
9006 item_count += item.GetNumberOfItems();
9007 }
9008 return item_count;
9009 }
9010
9013 {
9014 float weight = 0;
9015 float wetness = 1;
9016 if (include_wetness)
9019 {
9020 weight = wetness * m_ConfigWeight;
9021 }
9023 {
9024 weight = 1;
9025 }
9026 return weight;
9027 }
9028
9029
9030
9032 {
9033 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9034 {
9035 GameInventory inv = GetInventory();
9036 array<EntityAI> items = new array<EntityAI>;
9038 for (int i = 0; i < items.Count(); i++)
9039 {
9041 if (item)
9042 {
9044 }
9045 }
9046 }
9047 }
9048
9049
9050
9051
9053 {
9054 float energy = 0;
9055 if (HasEnergyManager())
9056 {
9057 energy = GetCompEM().GetEnergy();
9058 }
9059 return energy;
9060 }
9061
9062
9064 {
9065 super.OnEnergyConsumed();
9066
9068 }
9069
9071 {
9072 super.OnEnergyAdded();
9073
9075 }
9076
9077
9079 {
9080 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9081 {
9083 {
9084 float energy_0to1 = GetCompEM().GetEnergy0To1();
9086 }
9087 }
9088 }
9089
9090
9092 {
9093 return ConfigGetFloat("heatIsolation");
9094 }
9095
9097 {
9099 }
9100
9102 {
9103 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9104 if (
GetGame().ConfigIsExisting(paramPath))
9106
9107 return 0.0;
9108 }
9109
9111 {
9112 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9113 if (
GetGame().ConfigIsExisting(paramPath))
9115
9116 return 0.0;
9117 }
9118
9119 override void SetWet(
float value,
bool allow_client =
false)
9120 {
9121 if (!IsServerCheck(allow_client))
9122 return;
9123
9126
9128
9129 m_VarWet = Math.Clamp(value, min, max);
9130
9132 {
9135 }
9136 }
9137
9138 override void AddWet(
float value)
9139 {
9141 }
9142
9144 {
9146 }
9147
9149 {
9151 }
9152
9154 {
9156 }
9157
9159 {
9161 }
9162
9164 {
9166 }
9167
9169 {
9172 if (newLevel != oldLevel)
9173 {
9175 }
9176 }
9177
9179 {
9180 SetWeightDirty();
9181 }
9182
9184 {
9185 return GetWetLevelInternal(
m_VarWet);
9186 }
9187
9188
9189
9191 {
9193 }
9194
9196 {
9198 }
9199
9201 {
9203 }
9204
9206 {
9208 }
9209
9210
9211
9213 {
9214 if (ConfigIsExisting("itemModelLength"))
9215 {
9216 return ConfigGetFloat("itemModelLength");
9217 }
9218 return 0;
9219 }
9220
9222 {
9223 if (ConfigIsExisting("itemAttachOffset"))
9224 {
9225 return ConfigGetFloat("itemAttachOffset");
9226 }
9227 return 0;
9228 }
9229
9230 override void SetCleanness(
int value,
bool allow_client =
false)
9231 {
9232 if (!IsServerCheck(allow_client))
9233 return;
9234
9236
9238
9241 }
9242
9244 {
9246 }
9247
9249 {
9250 return true;
9251 }
9252
9253
9254
9255
9257 {
9259 }
9260
9262 {
9264 }
9265
9266
9267
9268
9269 override void SetColor(
int r,
int g,
int b,
int a)
9270 {
9276 }
9278 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9279 {
9284 }
9285
9287 {
9289 }
9290
9293 {
9294 int r,g,b,a;
9296 r = r/255;
9297 g = g/255;
9298 b = b/255;
9299 a = a/255;
9300 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9301 }
9302
9303
9304
9305 override void SetLiquidType(
int value,
bool allow_client =
false)
9306 {
9307 if (!IsServerCheck(allow_client))
9308 return;
9309
9314 }
9315
9317 {
9318 return ConfigGetInt("varLiquidTypeInit");
9319 }
9320
9322 {
9324 }
9325
9327 {
9329 SetFrozen(false);
9330 }
9331
9334 {
9335 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9336 }
9337
9338
9341 {
9342 PlayerBase nplayer;
9343 if (PlayerBase.CastTo(nplayer, player))
9344 {
9346
9347 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9348 }
9349 }
9350
9351
9354 {
9355 PlayerBase nplayer;
9356 if (PlayerBase.CastTo(nplayer,player))
9357 {
9358
9359 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9360
9361 }
9362
9363
9364 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9365
9366
9367 if (HasEnergyManager())
9368 {
9369 GetCompEM().UpdatePlugState();
9370 }
9371 }
9372
9373
9375 {
9376 super.OnPlacementStarted(player);
9377
9379 }
9380
9381 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9382 {
9384 {
9385 m_AdminLog.OnPlacementComplete(player,
this);
9386 }
9387
9388 super.OnPlacementComplete(player, position, orientation);
9389 }
9390
9391
9392
9393
9394
9396 {
9398 {
9399 return true;
9400 }
9401 else
9402 {
9403 return false;
9404 }
9405 }
9406
9407
9409 {
9411 {
9413 }
9414 }
9415
9416
9418 {
9420 }
9421
9423 {
9425 }
9426
9427 override void InsertAgent(
int agent,
float count = 1)
9428 {
9429 if (count < 1)
9430 return;
9431
9433 }
9434
9437 {
9439 }
9440
9441
9443 {
9445 }
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9489 {
9491 return false;
9492 return true;
9493 }
9494
9496 {
9497
9499 }
9500
9501
9504 {
9505 super.CheckForRoofLimited(timeTresholdMS);
9506
9508 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9509 {
9510 m_PreviousRoofTestTime = time;
9511 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9512 }
9513 }
9514
9515
9517 {
9519 {
9520 return 0;
9521 }
9522
9523 if (GetInventory().GetAttachmentSlotsCount() != 0)
9524 {
9525 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9526 if (filter)
9527 return filter.GetProtectionLevel(type, false, system);
9528 else
9529 return 0;
9530 }
9531
9532 string subclassPath, entryName;
9533
9534 switch (type)
9535 {
9537 entryName = "biological";
9538 break;
9540 entryName = "chemical";
9541 break;
9542 default:
9543 entryName = "biological";
9544 break;
9545 }
9546
9547 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9548
9550 }
9551
9552
9553
9556 {
9557 if (!IsMagazine())
9559
9561 }
9562
9563
9564
9565
9566
9571 {
9572 return true;
9573 }
9574
9576 {
9578 }
9579
9580
9581
9582
9583
9585 {
9586 if (parent)
9587 {
9588 if (parent.IsInherited(DayZInfected))
9589 return true;
9590
9591 if (!parent.IsRuined())
9592 return true;
9593 }
9594
9595 return true;
9596 }
9597
9599 {
9600 if (!super.CanPutAsAttachment(parent))
9601 {
9602 return false;
9603 }
9604
9605 if (!IsRuined() && !parent.IsRuined())
9606 {
9607 return true;
9608 }
9609
9610 return false;
9611 }
9612
9614 {
9615
9616
9617
9618
9619 return super.CanReceiveItemIntoCargo(item);
9620 }
9621
9623 {
9624
9625
9626
9627
9628 GameInventory attachmentInv = attachment.GetInventory();
9630 {
9631 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9632 return false;
9633 }
9634
9635 InventoryLocation loc = new InventoryLocation();
9636 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9637 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9638 return false;
9639
9640 return super.CanReceiveAttachment(attachment, slotId);
9641 }
9642
9644 {
9645 if (!super.CanReleaseAttachment(attachment))
9646 return false;
9647
9648 return GetInventory().AreChildrenAccessible();
9649 }
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9672 {
9673 int id = muzzle_owner.GetMuzzleID();
9674 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9675
9676 if (WPOF_array)
9677 {
9678 for (int i = 0; i < WPOF_array.Count(); i++)
9679 {
9680 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9681
9682 if (WPOF)
9683 {
9684 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9685 }
9686 }
9687 }
9688 }
9689
9690
9692 {
9693 int id = muzzle_owner.GetMuzzleID();
9695
9696 if (WPOBE_array)
9697 {
9698 for (int i = 0; i < WPOBE_array.Count(); i++)
9699 {
9700 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9701
9702 if (WPOBE)
9703 {
9704 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9705 }
9706 }
9707 }
9708 }
9709
9710
9712 {
9713 int id = muzzle_owner.GetMuzzleID();
9714 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9715
9716 if (WPOOH_array)
9717 {
9718 for (int i = 0; i < WPOOH_array.Count(); i++)
9719 {
9720 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9721
9722 if (WPOOH)
9723 {
9724 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9725 }
9726 }
9727 }
9728 }
9729
9730
9732 {
9733 int id = muzzle_owner.GetMuzzleID();
9734 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9735
9736 if (WPOOH_array)
9737 {
9738 for (int i = 0; i < WPOOH_array.Count(); i++)
9739 {
9740 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9741
9742 if (WPOOH)
9743 {
9744 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9745 }
9746 }
9747 }
9748 }
9749
9750
9752 {
9753 int id = muzzle_owner.GetMuzzleID();
9754 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9755
9756 if (WPOOH_array)
9757 {
9758 for (int i = 0; i < WPOOH_array.Count(); i++)
9759 {
9760 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9761
9762 if (WPOOH)
9763 {
9764 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9765 }
9766 }
9767 }
9768 }
9769
9770
9771
9773 {
9775 {
9776 return true;
9777 }
9778
9779 return false;
9780 }
9781
9783 {
9785 {
9786 return true;
9787 }
9788
9789 return false;
9790 }
9791
9793 {
9795 {
9796 return true;
9797 }
9798
9799 return false;
9800 }
9801
9803 {
9804 return false;
9805 }
9806
9809 {
9810 return UATimeSpent.DEFAULT_DEPLOY;
9811 }
9812
9813
9814
9815
9817 {
9819 SetSynchDirty();
9820 }
9821
9823 {
9825 }
9826
9827
9829 {
9830 return false;
9831 }
9832
9835 {
9836 string att_type = "None";
9837
9838 if (ConfigIsExisting("soundAttType"))
9839 {
9840 att_type = ConfigGetString("soundAttType");
9841 }
9842
9844 }
9845
9847 {
9849 }
9850
9851
9852
9853
9854
9858
9860 {
9863
9865 }
9866
9867
9869 {
9871 return;
9872
9874
9877
9880
9881 SoundParameters params = new SoundParameters();
9885 }
9886
9887
9889 {
9891 return;
9892
9894 SetSynchDirty();
9895
9898 }
9899
9900
9902 {
9904 return;
9905
9907 SetSynchDirty();
9908
9911 }
9912
9914 {
9916 }
9917
9919 {
9921 }
9922
9925 {
9926 if (!
GetGame().IsDedicatedServer())
9927 {
9928 if (ConfigIsExisting("attachSoundSet"))
9929 {
9930 string cfg_path = "";
9931 string soundset = "";
9933
9936 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9937 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9938
9939 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9940 {
9941 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9942 {
9943 if (cfg_slot_array[i] == slot_type)
9944 {
9945 soundset = cfg_soundset_array[i];
9946 break;
9947 }
9948 }
9949 }
9950
9951 if (soundset != "")
9952 {
9953 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9955 }
9956 }
9957 }
9958 }
9959
9961 {
9962
9963 }
9964
9965 void OnApply(PlayerBase player);
9966
9968 {
9969 return 1.0;
9970 };
9971
9973 {
9975 }
9976
9978 {
9980 }
9981
9983
9985 {
9986 SetDynamicPhysicsLifeTime(0.01);
9988 }
9989
9991 {
9992 array<string> zone_names = new array<string>;
9993 GetDamageZones(zone_names);
9994 for (int i = 0; i < zone_names.Count(); i++)
9995 {
9996 SetHealthMax(zone_names.Get(i),"Health");
9997 }
9998 SetHealthMax("","Health");
9999 }
10000
10003 {
10004 float global_health = GetHealth01("","Health");
10005 array<string> zones = new array<string>;
10006 GetDamageZones(zones);
10007
10008 for (int i = 0; i < zones.Count(); i++)
10009 {
10010 SetHealth01(zones.Get(i),"Health",global_health);
10011 }
10012 }
10013
10016 {
10017 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10018 }
10019
10021 {
10022 if (!hasRootAsPlayer)
10023 {
10024 if (refParentIB)
10025 {
10026
10027 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10028 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10029
10030 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10031 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10032
10035 }
10036 else
10037 {
10038
10041 }
10042 }
10043 }
10044
10046 {
10048 {
10049 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10050 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10051 {
10052 float heatPermCoef = 1.0;
10054 while (ent)
10055 {
10056 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10057 ent = ent.GetHierarchyParent();
10058 }
10059
10060 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10061 }
10062 }
10063 }
10064
10066 {
10067
10068 EntityAI parent = GetHierarchyParent();
10069 if (!parent)
10070 {
10071 hasParent = false;
10072 hasRootAsPlayer = false;
10073 }
10074 else
10075 {
10076 hasParent = true;
10077 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10078 refParentIB =
ItemBase.Cast(parent);
10079 }
10080 }
10081
10082 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10083 {
10084
10085 }
10086
10088 {
10089
10090 return false;
10091 }
10092
10094 {
10095
10096
10097 return false;
10098 }
10099
10101 {
10102
10103 return false;
10104 }
10105
10108 {
10109 return !GetIsFrozen() &&
IsOpen();
10110 }
10111
10113 {
10114 bool hasParent = false, hasRootAsPlayer = false;
10116
10117 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10118 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10119
10120 if (wwtu || foodDecay)
10121 {
10125
10126 if (processWetness || processTemperature || processDecay)
10127 {
10129
10130 if (processWetness)
10131 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10132
10133 if (processTemperature)
10135
10136 if (processDecay)
10137 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10138 }
10139 }
10140 }
10141
10144 {
10146 }
10147
10149 {
10152
10153 return super.GetTemperatureFreezeThreshold();
10154 }
10155
10157 {
10160
10161 return super.GetTemperatureThawThreshold();
10162 }
10163
10165 {
10168
10169 return super.GetItemOverheatThreshold();
10170 }
10171
10173 {
10175 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10176
10177 return super.GetTemperatureFreezeTime();
10178 }
10179
10181 {
10183 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10184
10185 return super.GetTemperatureThawTime();
10186 }
10187
10192
10194 {
10195 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10196 }
10197
10199 {
10200 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10201 }
10202
10205 {
10207 }
10208
10210 {
10212 }
10213
10215 {
10217 }
10218
10221 {
10222 return null;
10223 }
10224
10227 {
10228 return false;
10229 }
10230
10232 {
10234 {
10237 if (!trg)
10238 {
10240 explosive = this;
10241 }
10242
10243 explosive.PairRemote(trg);
10245
10246 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10247 trg.SetPersistentPairID(persistentID);
10248 explosive.SetPersistentPairID(persistentID);
10249
10250 return true;
10251 }
10252 return false;
10253 }
10254
10257 {
10258 float ret = 1.0;
10261 ret *= GetHealth01();
10262
10263 return ret;
10264 }
10265
10266 #ifdef DEVELOPER
10267 override void SetDebugItem()
10268 {
10269 super.SetDebugItem();
10270 _itemBase = this;
10271 }
10272
10274 {
10275 string text = super.GetDebugText();
10276
10278 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10279
10280 return text;
10281 }
10282 #endif
10283
10285 {
10286 return true;
10287 }
10288
10290
10292
10294 {
10297 }
10298
10299
10307
10323}
10324
10326{
10328 if (entity)
10329 {
10330 bool is_item = entity.IsInherited(
ItemBase);
10331 if (is_item && full_quantity)
10332 {
10335 }
10336 }
10337 else
10338 {
10340 return NULL;
10341 }
10342 return entity;
10343}
10344
10346{
10347 if (item)
10348 {
10349 if (health > 0)
10350 item.SetHealth("", "", health);
10351
10352 if (item.CanHaveTemperature())
10353 {
10355 if (item.CanFreeze())
10356 item.SetFrozen(false);
10357 }
10358
10359 if (item.HasEnergyManager())
10360 {
10361 if (quantity >= 0)
10362 {
10363 item.GetCompEM().SetEnergy0To1(quantity);
10364 }
10365 else
10366 {
10368 }
10369 }
10370 else if (item.IsMagazine())
10371 {
10372 Magazine mag = Magazine.Cast(item);
10373 if (quantity >= 0)
10374 {
10375 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10376 }
10377 else
10378 {
10380 }
10381
10382 }
10383 else
10384 {
10385 if (quantity >= 0)
10386 {
10387 item.SetQuantityNormalized(quantity, false);
10388 }
10389 else
10390 {
10392 }
10393
10394 }
10395 }
10396}
10397
10398#ifdef DEVELOPER
10400#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.