5552{
5554 {
5555 return true;
5556 }
5557};
5558
5559
5560
5562{
5566
5568
5571
5572
5573
5574
5575
5584
5590
5595
5600
5621 protected bool m_IsResultOfSplit
5622
5624
5629
5630
5631
5633
5637
5638
5639
5641
5644
5645
5646
5652
5653
5661
5664
5665
5667
5668
5670
5671
5676
5677
5682
5683
5685
5686
5688 {
5693
5694 if (!
GetGame().IsDedicatedServer())
5695 {
5697 {
5699
5701 {
5703 }
5704 }
5705
5708 }
5709
5710 m_OldLocation = null;
5711
5713 {
5715 }
5716
5717 if (ConfigIsExisting("headSelectionsToHide"))
5718 {
5721 }
5722
5724 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5725 {
5727 }
5728
5730
5731 m_IsResultOfSplit = false;
5732
5734 }
5735
5737 {
5738 super.InitItemVariables();
5739
5745 m_Count = ConfigGetInt(
"count");
5746
5749
5754
5757
5762
5774
5778
5779
5782 if (ConfigIsExisting("canBeSplit"))
5783 {
5786 }
5787
5789 if (ConfigIsExisting("itemBehaviour"))
5791
5792
5795 RegisterNetSyncVariableInt("m_VarLiquidType");
5796 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5797
5798 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5799 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5800 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5801
5802 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5803 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5804 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5805 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5806
5807 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5808 RegisterNetSyncVariableBool("m_IsTakeable");
5809 RegisterNetSyncVariableBool("m_IsHologram");
5810
5813 {
5816 }
5817
5819
5821 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5823
5824 }
5825
5827 {
5829 }
5830
5832 {
5835 {
5840 }
5841 }
5842
5843 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5844 {
5846 {
5849 }
5850
5852 }
5853
5855 {
5861 }
5862
5864
5866 {
5868
5869 if (!action)
5870 {
5871 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5872 return;
5873 }
5874
5876 if (!ai)
5877 {
5879 return;
5880 }
5881
5883 if (!action_array)
5884 {
5885 action_array = new array<ActionBase_Basic>;
5887 }
5888 if (LogManager.IsActionLogEnable())
5889 {
5890 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5891 }
5892
5893 if (action_array.Find(action) != -1)
5894 {
5895 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5896 }
5897 else
5898 {
5899 action_array.Insert(action);
5900 }
5901 }
5902
5904 {
5906 ActionBase action = player.GetActionManager().GetAction(actionName);
5909
5910 if (action_array)
5911 {
5912 action_array.RemoveItem(action);
5913 }
5914 }
5915
5916
5917
5919 {
5920 ActionOverrideData overrideData = new ActionOverrideData();
5924
5926 if (!actionMap)
5927 {
5930 }
5931
5932 actionMap.Insert(this.
Type(), overrideData);
5933
5934 }
5935
5937
5939
5940
5942 {
5945
5948
5949 string config_to_search = "CfgVehicles";
5950 string muzzle_owner_config;
5951
5953 {
5954 if (IsInherited(Weapon))
5955 config_to_search = "CfgWeapons";
5956
5957 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5958
5959 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5960
5962
5963 if (config_OnFire_subclass_count > 0)
5964 {
5965 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5966
5967 for (int i = 0; i < config_OnFire_subclass_count; i++)
5968 {
5969 string particle_class = "";
5971 string config_OnFire_entry = config_OnFire_class + particle_class;
5972 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5973 WPOF_array.Insert(WPOF);
5974 }
5975
5976
5978 }
5979 }
5980
5982 {
5983 config_to_search = "CfgWeapons";
5984 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5985
5986 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5987
5989
5990 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5991 {
5992 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5993
5994 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5995 {
5996 string particle_class2 = "";
5998 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5999 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6000 WPOBE_array.Insert(WPOBE);
6001 }
6002
6003
6005 }
6006 }
6007 }
6008
6009
6011 {
6014
6016 {
6017 string config_to_search = "CfgVehicles";
6018
6019 if (IsInherited(Weapon))
6020 config_to_search = "CfgWeapons";
6021
6022 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6023 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6024
6025 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6026 {
6027
6029
6031 {
6033 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6035 return;
6036 }
6037
6040
6041
6042
6044 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6045
6046 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6047 {
6048 string particle_class = "";
6050 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6052
6053 if (entry_type == CT_CLASS)
6054 {
6055 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6056 WPOOH_array.Insert(WPOF);
6057 }
6058 }
6059
6060
6062 }
6063 }
6064 }
6065
6067 {
6069 }
6070
6072 {
6074 {
6076
6079
6082
6083 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6084 }
6085 }
6086
6088 {
6090 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6091
6093 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6094
6096 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6097
6099 {
6101 }
6102 }
6103
6105 {
6107 }
6108
6110 {
6113 else
6115
6117 {
6120 }
6121 else
6122 {
6125
6128 }
6129
6131 }
6132
6134 {
6136 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6137 }
6138
6140 {
6142 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6144 }
6145
6147 {
6149 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6150 }
6151
6153 {
6156
6157 OverheatingParticle OP = new OverheatingParticle();
6162
6164 }
6165
6167 {
6170
6171 return -1;
6172 }
6173
6175 {
6177 {
6180
6181 for (int i = count; i > 0; --i)
6182 {
6183 int id = i - 1;
6186
6189
6190 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6191 {
6192 if (p)
6193 {
6196 }
6197 }
6198 }
6199 }
6200 }
6201
6203 {
6205 {
6207 {
6208 int id = i - 1;
6210
6211 if (OP)
6212 {
6214
6215 if (p)
6216 {
6218 }
6219
6220 delete OP;
6221 }
6222 }
6223
6226 }
6227 }
6228
6231 {
6232 return 0.0;
6233 }
6234
6235
6237 {
6238 return 250;
6239 }
6240
6242 {
6243 return 0;
6244 }
6245
6248 {
6250 return true;
6251
6252 return false;
6253 }
6254
6257 {
6260
6262 {
6264 }
6265 else
6266 {
6267
6269 }
6270
6272 }
6273
6280 {
6281 return -1;
6282 }
6283
6284
6285
6286
6288 {
6290 {
6292 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6293
6294 if (r_index >= 0)
6295 {
6296 InventoryLocation r_il = new InventoryLocation;
6297 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6298
6299 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6302 {
6303 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6304 }
6306 {
6307 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6308 }
6309
6310 }
6311
6312 player.GetHumanInventory().ClearUserReservedLocation(this);
6313 }
6314
6317 }
6318
6319
6320
6321
6323 {
6324 return ItemBase.m_DebugActionsMask;
6325 }
6326
6328 {
6329 return ItemBase.m_DebugActionsMask & mask;
6330 }
6331
6333 {
6334 ItemBase.m_DebugActionsMask = mask;
6335 }
6336
6338 {
6339 ItemBase.m_DebugActionsMask |= mask;
6340 }
6341
6343 {
6344 ItemBase.m_DebugActionsMask &= ~mask;
6345 }
6346
6348 {
6350 {
6352 }
6353 else
6354 {
6356 }
6357 }
6358
6359
6361 {
6362 if (GetEconomyProfile())
6363 {
6364 float q_max = GetEconomyProfile().GetQuantityMax();
6365 if (q_max > 0)
6366 {
6367 float q_min = GetEconomyProfile().GetQuantityMin();
6368 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6369
6371 {
6372 ComponentEnergyManager comp = GetCompEM();
6374 {
6376 }
6377 }
6379 {
6381
6382 }
6383
6384 }
6385 }
6386 }
6387
6390 {
6391 EntityAI parent = GetHierarchyParent();
6392
6393 if (parent)
6394 {
6395 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6396 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6397 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6398 }
6399 }
6400
6403 {
6404 EntityAI parent = GetHierarchyParent();
6405
6406 if (parent)
6407 {
6408 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6409 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6410 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6411 }
6412 }
6413
6415 {
6416
6417
6418
6419
6421
6423 {
6424 if (ScriptInputUserData.CanStoreInputUserData())
6425 {
6426 ScriptInputUserData ctx = new ScriptInputUserData;
6432 ctx.
Write(use_stack_max);
6435
6437 {
6438 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6439 }
6440 }
6441 }
6442 else if (!
GetGame().IsMultiplayer())
6443 {
6445 }
6446 }
6447
6449 {
6451 }
6452
6454 {
6456 }
6457
6459 {
6461 }
6462
6464 {
6465
6466 return false;
6467 }
6468
6470 {
6471 return false;
6472 }
6473
6477 {
6478 return false;
6479 }
6480
6482 {
6483 return "";
6484 }
6485
6487
6489 {
6490 return false;
6491 }
6492
6494 {
6495 return true;
6496 }
6497
6498
6499
6501 {
6502 return true;
6503 }
6504
6506 {
6507 return true;
6508 }
6509
6511 {
6512 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6514 }
6515
6517 {
6519 }
6520
6522 {
6524 if (!is_being_placed)
6526 SetSynchDirty();
6527 }
6528
6529
6531
6533 {
6535 }
6536
6538 {
6540 }
6541
6543 {
6544 return 1;
6545 }
6546
6548 {
6549 return false;
6550 }
6551
6553 {
6555 SetSynchDirty();
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
6587
6588
6589
6590
6591
6593 {
6594 super.OnMovedInsideCargo(container);
6595
6596 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6597 }
6598
6599 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6600 {
6601 super.EEItemLocationChanged(oldLoc,newLoc);
6602
6603 PlayerBase new_player = null;
6604 PlayerBase old_player = null;
6605
6606 if (newLoc.GetParent())
6607 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6608
6609 if (oldLoc.GetParent())
6610 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6611
6613 {
6614 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6615
6616 if (r_index >= 0)
6617 {
6618 InventoryLocation r_il = new InventoryLocation;
6619 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6620
6621 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6624 {
6625 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6626 }
6628 {
6629 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6630 }
6631
6632 }
6633 }
6634
6636 {
6637 if (new_player)
6638 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6639
6640 if (new_player == old_player)
6641 {
6642
6643 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6644 {
6646 {
6647 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6648 {
6649 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6650 }
6651 }
6652 else
6653 {
6654 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6655 }
6656 }
6657
6658 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6659 {
6660 int type = oldLoc.GetType();
6662 {
6663 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6664 }
6666 {
6667 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6668 }
6669 }
6670 if (!m_OldLocation)
6671 {
6672 m_OldLocation = new InventoryLocation;
6673 }
6674 m_OldLocation.Copy(oldLoc);
6675 }
6676 else
6677 {
6678 if (m_OldLocation)
6679 {
6680 m_OldLocation.Reset();
6681 }
6682 }
6683
6685 }
6686 else
6687 {
6688 if (new_player)
6689 {
6690 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6691 if (res_index >= 0)
6692 {
6693 InventoryLocation il = new InventoryLocation;
6694 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6696 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6699 {
6700 il.
GetParent().GetOnReleaseLock().Invoke(it);
6701 }
6703 {
6705 }
6706
6707 }
6708 }
6710 {
6711
6713 }
6714
6715 if (m_OldLocation)
6716 {
6717 m_OldLocation.Reset();
6718 }
6719 }
6720 }
6721
6722 override void EOnContact(IEntity other, Contact extra)
6723 {
6725 {
6726 int liquidType = -1;
6728 if (impactSpeed > 0.0)
6729 {
6731 #ifndef SERVER
6733 #else
6735 SetSynchDirty();
6736 #endif
6738 }
6739 }
6740
6741 #ifdef SERVER
6742 if (GetCompEM() && GetCompEM().IsPlugged())
6743 {
6744 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6745 GetCompEM().UnplugThis();
6746 }
6747 #endif
6748 }
6749
6751
6753 {
6755 }
6756
6758 {
6759
6760 }
6761
6763 {
6764 super.OnItemLocationChanged(old_owner, new_owner);
6765
6766 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6767 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6768
6769 if (!relatedPlayer && playerNew)
6770 relatedPlayer = playerNew;
6771
6772 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6773 {
6775 if (actionMgr)
6776 {
6777 ActionBase currentAction = actionMgr.GetRunningAction();
6778 if (currentAction)
6780 }
6781 }
6782
6783 Man ownerPlayerOld = null;
6784 Man ownerPlayerNew = null;
6785
6786 if (old_owner)
6787 {
6788 if (old_owner.
IsMan())
6789 {
6790 ownerPlayerOld = Man.Cast(old_owner);
6791 }
6792 else
6793 {
6794 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6795 }
6796 }
6797 else
6798 {
6800 {
6802
6803 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6804 {
6805 GetCompEM().UnplugThis();
6806 }
6807 }
6808 }
6809
6810 if (new_owner)
6811 {
6812 if (new_owner.
IsMan())
6813 {
6814 ownerPlayerNew = Man.Cast(new_owner);
6815 }
6816 else
6817 {
6818 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6819 }
6820 }
6821
6822 if (ownerPlayerOld != ownerPlayerNew)
6823 {
6824 if (ownerPlayerOld)
6825 {
6826 array<EntityAI> subItemsExit = new array<EntityAI>;
6828 for (int i = 0; i < subItemsExit.Count(); i++)
6829 {
6832 }
6833 }
6834
6835 if (ownerPlayerNew)
6836 {
6837 array<EntityAI> subItemsEnter = new array<EntityAI>;
6839 for (int j = 0; j < subItemsEnter.Count(); j++)
6840 {
6843 }
6844 }
6845 }
6846 else if (ownerPlayerNew != null)
6847 {
6848 PlayerBase nplayer;
6849 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6850 {
6851 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6853 for (int k = 0; k < subItemsUpdate.Count(); k++)
6854 {
6856 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6857 }
6858 }
6859 }
6860
6861 if (old_owner)
6862 old_owner.OnChildItemRemoved(this);
6863 if (new_owner)
6864 new_owner.OnChildItemReceived(this);
6865 }
6866
6867
6869 {
6870 super.EEDelete(parent);
6871 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6872 if (player)
6873 {
6875
6876 if (player.IsAlive())
6877 {
6878 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6879 if (r_index >= 0)
6880 {
6881 InventoryLocation r_il = new InventoryLocation;
6882 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6883
6884 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6887 {
6888 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6889 }
6891 {
6892 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6893 }
6894
6895 }
6896
6897 player.RemoveQuickBarEntityShortcut(this);
6898 }
6899 }
6900 }
6901
6903 {
6904 super.EEKilled(killer);
6905
6908 {
6909 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6910 {
6911 if (IsMagazine())
6912 {
6913 if (Magazine.Cast(this).GetAmmoCount() > 0)
6914 {
6916 }
6917 }
6918 else
6919 {
6921 }
6922 }
6923 }
6924 }
6925
6927 {
6928 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6929
6930 super.OnWasAttached(parent, slot_id);
6931
6934
6936 }
6937
6939 {
6940 super.OnWasDetached(parent, slot_id);
6941
6944 }
6945
6947 {
6948 int idx;
6951
6952 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6953 if (inventory_slots.Count() < 1)
6954 {
6955 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6956 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6957 }
6958 else
6959 {
6960 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6961 }
6962
6963 idx = inventory_slots.Find(slot);
6964 if (idx < 0)
6965 return "";
6966
6967 return attach_types.Get(idx);
6968 }
6969
6971 {
6972 int idx = -1;
6973 string slot;
6974
6977
6978 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6979 if (inventory_slots.Count() < 1)
6980 {
6981 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6982 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6983 }
6984 else
6985 {
6986 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6987 if (detach_types.Count() < 1)
6988 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6989 }
6990
6991 for (int i = 0; i < inventory_slots.Count(); i++)
6992 {
6993 slot = inventory_slots.Get(i);
6994 }
6995
6996 if (slot != "")
6997 {
6998 if (detach_types.Count() == 1)
6999 idx = 0;
7000 else
7001 idx = inventory_slots.Find(slot);
7002 }
7003 if (idx < 0)
7004 return "";
7005
7006 return detach_types.Get(idx);
7007 }
7008
7010 {
7011
7013
7014
7015 float min_time = 1;
7016 float max_time = 3;
7017 float delay = Math.RandomFloat(min_time, max_time);
7018
7019 explode_timer.Run(delay, this, "DoAmmoExplosion");
7020 }
7021
7023 {
7024 Magazine magazine = Magazine.Cast(this);
7025 int pop_sounds_count = 6;
7026 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7027
7028
7029 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7030 string sound_name = pop_sounds[ sound_idx ];
7032
7033
7034 magazine.ServerAddAmmoCount(-1);
7035
7036
7037 float min_temp_to_explode = 100;
7038
7039 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7040 {
7042 }
7043 }
7044
7045
7046 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7047 {
7048 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7049
7050 const int CHANCE_DAMAGE_CARGO = 4;
7051 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7052 const int CHANCE_DAMAGE_NOTHING = 2;
7053
7055 {
7056 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7057 int chances;
7058 int rnd;
7059
7060 if (GetInventory().GetCargo())
7061 {
7062 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7063 rnd = Math.RandomInt(0,chances);
7064
7065 if (rnd < CHANCE_DAMAGE_CARGO)
7066 {
7068 }
7069 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7070 {
7072 }
7073 }
7074 else
7075 {
7076 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7077 rnd = Math.RandomInt(0,chances);
7078
7079 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7080 {
7082 }
7083 }
7084 }
7085 }
7086
7088 {
7089 if (GetInventory().GetCargo())
7090 {
7091 int item_count = GetInventory().GetCargo().GetItemCount();
7092 if (item_count > 0)
7093 {
7094 int random_pick = Math.RandomInt(0, item_count);
7096 if (!item.IsExplosive())
7097 {
7098 item.AddHealth("","",damage);
7099 return true;
7100 }
7101 }
7102 }
7103 return false;
7104 }
7105
7107 {
7108 int attachment_count = GetInventory().AttachmentCount();
7109 if (attachment_count > 0)
7110 {
7111 int random_pick = Math.RandomInt(0, attachment_count);
7112 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7113 if (!attachment.IsExplosive())
7114 {
7115 attachment.AddHealth("","",damage);
7116 return true;
7117 }
7118 }
7119 return false;
7120 }
7121
7123 {
7125 }
7126
7128 {
7130 return GetInventory().CanRemoveEntity();
7131
7132 return false;
7133 }
7134
7136 {
7138 return;
7139
7141 {
7142 if (ScriptInputUserData.CanStoreInputUserData())
7143 {
7144 ScriptInputUserData ctx = new ScriptInputUserData;
7149 ctx.
Write(destination_entity);
7153 }
7154 }
7155 else if (!
GetGame().IsMultiplayer())
7156 {
7158 }
7159 }
7160
7162 {
7164 return;
7165
7166 float split_quantity_new;
7170 InventoryLocation loc = new InventoryLocation;
7171
7172 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7173 {
7175 split_quantity_new = stack_max;
7176 else
7178
7179 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7180 if (new_item)
7181 {
7182 new_item.SetResultOfSplit(true);
7183 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7185 new_item.SetQuantity(split_quantity_new);
7186 }
7187 }
7188 else if (destination_entity && slot_id == -1)
7189 {
7190 if (quantity > stack_max)
7191 split_quantity_new = stack_max;
7192 else
7193 split_quantity_new = quantity;
7194
7196 {
7199 }
7200
7201 if (new_item)
7202 {
7203 new_item.SetResultOfSplit(true);
7204 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7206 new_item.SetQuantity(split_quantity_new);
7207 }
7208 }
7209 else
7210 {
7211 if (stack_max != 0)
7212 {
7214 {
7216 }
7217
7218 if (split_quantity_new == 0)
7219 {
7220 if (!
GetGame().IsMultiplayer())
7221 player.PhysicalPredictiveDropItem(this);
7222 else
7223 player.ServerDropEntity(this);
7224 return;
7225 }
7226
7228
7229 if (new_item)
7230 {
7231 new_item.SetResultOfSplit(true);
7232 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7234 new_item.SetQuantity(stack_max);
7235 new_item.PlaceOnSurface();
7236 }
7237 }
7238 }
7239 }
7240
7242 {
7244 return;
7245
7246 float split_quantity_new;
7250 InventoryLocation loc = new InventoryLocation;
7251
7252 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7253 {
7255 split_quantity_new = stack_max;
7256 else
7258
7259 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7260 if (new_item)
7261 {
7262 new_item.SetResultOfSplit(true);
7263 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7265 new_item.SetQuantity(split_quantity_new);
7266 }
7267 }
7268 else if (destination_entity && slot_id == -1)
7269 {
7270 if (quantity > stack_max)
7271 split_quantity_new = stack_max;
7272 else
7273 split_quantity_new = quantity;
7274
7276 {
7279 }
7280
7281 if (new_item)
7282 {
7283 new_item.SetResultOfSplit(true);
7284 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7286 new_item.SetQuantity(split_quantity_new);
7287 }
7288 }
7289 else
7290 {
7291 if (stack_max != 0)
7292 {
7294 {
7296 }
7297
7299
7300 if (new_item)
7301 {
7302 new_item.SetResultOfSplit(true);
7303 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7305 new_item.SetQuantity(stack_max);
7306 new_item.PlaceOnSurface();
7307 }
7308 }
7309 }
7310 }
7311
7313 {
7315 return;
7316
7318 {
7319 if (ScriptInputUserData.CanStoreInputUserData())
7320 {
7321 ScriptInputUserData ctx = new ScriptInputUserData;
7326 dst.WriteToContext(ctx);
7328 }
7329 }
7330 else if (!
GetGame().IsMultiplayer())
7331 {
7333 }
7334 }
7335
7337 {
7339 return;
7340
7342 {
7343 if (ScriptInputUserData.CanStoreInputUserData())
7344 {
7345 ScriptInputUserData ctx = new ScriptInputUserData;
7350 ctx.
Write(destination_entity);
7356 }
7357 }
7358 else if (!
GetGame().IsMultiplayer())
7359 {
7361 }
7362 }
7363
7365 {
7367 }
7368
7370 {
7372 return this;
7373
7375 float split_quantity_new;
7377 if (dst.IsValid())
7378 {
7379 int slot_id = dst.GetSlot();
7381
7382 if (quantity > stack_max)
7383 split_quantity_new = stack_max;
7384 else
7385 split_quantity_new = quantity;
7386
7388
7389 if (new_item)
7390 {
7391 new_item.SetResultOfSplit(true);
7392 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7395 }
7396
7397 return new_item;
7398 }
7399
7400 return null;
7401 }
7402
7404 {
7406 return;
7407
7409 float split_quantity_new;
7411 if (destination_entity)
7412 {
7414 if (quantity > stackable)
7415 split_quantity_new = stackable;
7416 else
7417 split_quantity_new = quantity;
7418
7419 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7420 if (new_item)
7421 {
7422 new_item.SetResultOfSplit(true);
7423 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7425 new_item.SetQuantity(split_quantity_new);
7426 }
7427 }
7428 }
7429
7431 {
7433 return;
7434
7436 {
7437 if (ScriptInputUserData.CanStoreInputUserData())
7438 {
7439 ScriptInputUserData ctx = new ScriptInputUserData;
7444 ItemBase destination_entity =
this;
7445 ctx.
Write(destination_entity);
7449 }
7450 }
7451 else if (!
GetGame().IsMultiplayer())
7452 {
7454 }
7455 }
7456
7458 {
7460 return;
7461
7463 float split_quantity_new;
7465 if (player)
7466 {
7468 if (quantity > stackable)
7469 split_quantity_new = stackable;
7470 else
7471 split_quantity_new = quantity;
7472
7473 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7474 new_item =
ItemBase.Cast(in_hands);
7475 if (new_item)
7476 {
7477 new_item.SetResultOfSplit(true);
7478 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7480 new_item.SetQuantity(split_quantity_new);
7481 }
7482 }
7483 }
7484
7486 {
7488 return;
7489
7491 float split_quantity_new = Math.Floor(quantity * 0.5);
7492
7494
7495 if (new_item)
7496 {
7497 if (new_item.GetQuantityMax() < split_quantity_new)
7498 {
7499 split_quantity_new = new_item.GetQuantityMax();
7500 }
7501
7502 new_item.SetResultOfSplit(true);
7503 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7504
7506 {
7509 }
7510 else
7511 {
7514 }
7515 }
7516 }
7517
7519 {
7521 return;
7522
7524 float split_quantity_new = Math.Floor(quantity / 2);
7525
7526 InventoryLocation invloc = new InventoryLocation;
7528
7530 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7531
7532 if (new_item)
7533 {
7534 if (new_item.GetQuantityMax() < split_quantity_new)
7535 {
7536 split_quantity_new = new_item.GetQuantityMax();
7537 }
7539 {
7542 }
7543 else
7544 {
7547 }
7548 }
7549 }
7550
7553 {
7554 SetWeightDirty();
7556
7557 if (parent)
7558 parent.OnAttachmentQuantityChangedEx(this, delta);
7559
7561 {
7563 {
7565 }
7567 {
7568 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7570 }
7571 }
7572
7573 }
7574
7577 {
7578
7579 }
7580
7583 {
7585 }
7586
7588 {
7589 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7590
7592 {
7593 if (newLevel == GameConstants.STATE_RUINED)
7594 {
7596 EntityAI parent = GetHierarchyParent();
7597 if (parent && parent.IsFireplace())
7598 {
7599 CargoBase cargo = GetInventory().GetCargo();
7600 if (cargo)
7601 {
7603 {
7605 }
7606 }
7607 }
7608 }
7609
7611 {
7612
7614 return;
7615 }
7616
7617 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7618 {
7620 }
7621 }
7622 }
7623
7624
7626 {
7627 super.OnRightClick();
7628
7630 {
7632 {
7633 if (ScriptInputUserData.CanStoreInputUserData())
7634 {
7635 vector m4[4];
7637
7638 EntityAI root = GetHierarchyRoot();
7639
7640 InventoryLocation dst = new InventoryLocation;
7642 {
7643 if (root)
7644 {
7645 root.GetTransform(m4);
7647 }
7648 else
7649 GetInventory().GetCurrentInventoryLocation(dst);
7650 }
7651 else
7652 {
7654
7655
7656 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7657 {
7658 if (root)
7659 {
7660 root.GetTransform(m4);
7662 }
7663 else
7664 GetInventory().GetCurrentInventoryLocation(dst);
7665 }
7666 else
7667 {
7668 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7669 }
7670 }
7671
7672 ScriptInputUserData ctx = new ScriptInputUserData;
7680 }
7681 }
7682 else if (!
GetGame().IsMultiplayer())
7683 {
7685 }
7686 }
7687 }
7688
7689 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7690 {
7691
7692 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7693 return false;
7694
7695 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7696 return false;
7697
7698
7700 return false;
7701
7702
7703 Magazine mag = Magazine.Cast(this);
7704 if (mag)
7705 {
7706 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7707 return false;
7708
7709 if (stack_max_limit)
7710 {
7711 Magazine other_mag = Magazine.Cast(other_item);
7712 if (other_item)
7713 {
7714 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7715 return false;
7716 }
7717
7718 }
7719 }
7720 else
7721 {
7722
7724 return false;
7725
7727 return false;
7728 }
7729
7730 PlayerBase player = null;
7731 if (CastTo(player, GetHierarchyRootPlayer()))
7732 {
7733 if (player.GetInventory().HasAttachment(this))
7734 return false;
7735
7736 if (player.IsItemsToDelete())
7737 return false;
7738 }
7739
7740 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7741 return false;
7742
7743 int slotID;
7745 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7746 return false;
7747
7748 return true;
7749 }
7750
7752 {
7754 }
7755
7757 {
7758 return m_IsResultOfSplit;
7759 }
7760
7762 {
7763 m_IsResultOfSplit = value;
7764 }
7765
7767 {
7769 }
7770
7772 {
7773 float other_item_quantity = other_item.GetQuantity();
7774 float this_free_space;
7775
7777
7779
7780 if (other_item_quantity > this_free_space)
7781 {
7782 return this_free_space;
7783 }
7784 else
7785 {
7786 return other_item_quantity;
7787 }
7788 }
7789
7791 {
7793 }
7794
7796 {
7798 return;
7799
7800 if (!IsMagazine() && other_item)
7801 {
7803 if (quantity_used != 0)
7804 {
7805 float hp1 = GetHealth01("","");
7806 float hp2 = other_item.GetHealth01("","");
7807 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7808 hpResult = hpResult / (
GetQuantity() + quantity_used);
7809
7810 hpResult *= GetMaxHealth();
7811 Math.Round(hpResult);
7812 SetHealth("", "Health", hpResult);
7813
7815 other_item.AddQuantity(-quantity_used);
7816 }
7817 }
7819 }
7820
7822 {
7823 #ifdef SERVER
7824 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7825 GetHierarchyParent().IncreaseLifetimeUp();
7826 #endif
7827 };
7828
7830 {
7831 PlayerBase p = PlayerBase.Cast(player);
7832
7833 array<int> recipesIds = p.m_Recipes;
7834 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7835 if (moduleRecipesManager)
7836 {
7837 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7838 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7839 }
7840
7841 for (int i = 0;i < recipesIds.Count(); i++)
7842 {
7843 int key = recipesIds.Get(i);
7844 string recipeName = moduleRecipesManager.GetRecipeName(key);
7846 }
7847 }
7848
7849
7850 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7851 {
7852 super.GetDebugActions(outputList);
7853
7854
7859
7860
7864
7868
7869
7872
7873
7875 {
7878 }
7879
7881
7884
7888 }
7889
7890
7891
7892
7894 {
7895 super.OnAction(action_id, player, ctx);
7896 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7897 {
7898 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7899 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7900 PlayerBase p = PlayerBase.Cast(player);
7901 if (
EActions.RECIPES_RANGE_START < 1000)
7902 {
7903 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7904 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7905 }
7906 }
7907 #ifndef SERVER
7908 else if (action_id ==
EActions.WATCH_PLAYER)
7909 {
7910 PluginDeveloper.SetDeveloperItemClientEx(player);
7911 }
7912 #endif
7914 {
7915 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7916 {
7917 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7918 OnDebugButtonPressServer(id + 1);
7919 }
7920
7921 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7922 {
7923 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7925 }
7926
7927 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7928 {
7929 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7931 }
7932
7933 else if (action_id ==
EActions.ADD_QUANTITY)
7934 {
7935 if (IsMagazine())
7936 {
7937 Magazine mag = Magazine.Cast(this);
7938 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7939 }
7940 else
7941 {
7943 }
7944
7945 if (m_EM)
7946 {
7947 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7948 }
7949
7950 }
7951
7952 else if (action_id ==
EActions.REMOVE_QUANTITY)
7953 {
7954 if (IsMagazine())
7955 {
7956 Magazine mag2 = Magazine.Cast(this);
7957 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7958 }
7959 else
7960 {
7962 }
7963 if (m_EM)
7964 {
7965 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7966 }
7967
7968 }
7969
7970 else if (action_id ==
EActions.SET_QUANTITY_0)
7971 {
7973
7974 if (m_EM)
7975 {
7976 m_EM.SetEnergy(0);
7977 }
7978 }
7979
7980 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7981 {
7983
7984 if (m_EM)
7985 {
7986 m_EM.SetEnergy(m_EM.GetEnergyMax());
7987 }
7988 }
7989
7990 else if (action_id ==
EActions.ADD_HEALTH)
7991 {
7992 AddHealth("","",GetMaxHealth("","Health")/5);
7993 }
7994 else if (action_id ==
EActions.REMOVE_HEALTH)
7995 {
7996 AddHealth("","",-GetMaxHealth("","Health")/5);
7997 }
7998 else if (action_id ==
EActions.DESTROY_HEALTH)
7999 {
8000 SetHealth01("","",0);
8001 }
8002 else if (action_id ==
EActions.WATCH_ITEM)
8003 {
8005 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8006 #ifdef DEVELOPER
8007 SetDebugDeveloper_item(this);
8008 #endif
8009 }
8010
8011 else if (action_id ==
EActions.ADD_TEMPERATURE)
8012 {
8013 AddTemperature(20);
8014
8015 }
8016
8017 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8018 {
8019 AddTemperature(-20);
8020
8021 }
8022
8023 else if (action_id ==
EActions.FLIP_FROZEN)
8024 {
8025 SetFrozen(!GetIsFrozen());
8026
8027 }
8028
8029 else if (action_id ==
EActions.ADD_WETNESS)
8030 {
8032
8033 }
8034
8035 else if (action_id ==
EActions.REMOVE_WETNESS)
8036 {
8038
8039 }
8040
8041 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8042 {
8045
8046
8047 }
8048
8049 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8050 {
8053 }
8054
8055 else if (action_id ==
EActions.MAKE_SPECIAL)
8056 {
8057 auto debugParams = DebugSpawnParams.WithPlayer(player);
8058 OnDebugSpawnEx(debugParams);
8059 }
8060
8061 else if (action_id ==
EActions.DELETE)
8062 {
8063 Delete();
8064 }
8065
8066 }
8067
8068
8069 return false;
8070 }
8071
8072
8073
8074
8078
8081
8082
8083
8085 {
8086 return false;
8087 }
8088
8089
8091 {
8092 return true;
8093 }
8094
8095
8097 {
8098 return true;
8099 }
8100
8101
8102
8104 {
8105 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8107 }
8108
8111 {
8112 return null;
8113 }
8114
8116 {
8117 return false;
8118 }
8119
8121 {
8122 return false;
8123 }
8124
8128
8129
8131 {
8132 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8133 return module_repairing.CanRepair(this, item_repair_kit);
8134 }
8135
8136
8137 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8138 {
8139 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8140 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8141 }
8142
8143
8145 {
8146
8147
8148
8149
8150
8151
8152
8153
8154 return 1;
8155 }
8156
8157
8158
8160 {
8162 }
8163
8164
8165
8167 {
8169 }
8170
8171
8180 {
8181 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8182
8183 if (player)
8184 {
8185 player.MessageStatus(text);
8186 }
8187 }
8188
8189
8198 {
8199 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8200
8201 if (player)
8202 {
8203 player.MessageAction(text);
8204 }
8205 }
8206
8207
8216 {
8217 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8218
8219 if (player)
8220 {
8221 player.MessageFriendly(text);
8222 }
8223 }
8224
8225
8234 {
8235 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8236
8237 if (player)
8238 {
8239 player.MessageImportant(text);
8240 }
8241 }
8242
8244 {
8245 return true;
8246 }
8247
8248
8249 override bool KindOf(
string tag)
8250 {
8251 bool found = false;
8252 string item_name = this.
GetType();
8255
8256 int array_size = item_tag_array.Count();
8257 for (int i = 0; i < array_size; i++)
8258 {
8259 if (item_tag_array.Get(i) == tag)
8260 {
8261 found = true;
8262 break;
8263 }
8264 }
8265 return found;
8266 }
8267
8268
8270 {
8271
8272 super.OnRPC(sender, rpc_type,ctx);
8273
8274
8275 switch (rpc_type)
8276 {
8277 #ifndef SERVER
8278 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8279 Param2<bool, string> p = new Param2<bool, string>(false, "");
8280
8282 return;
8283
8284 bool play = p.param1;
8285 string soundSet = p.param2;
8286
8287 if (play)
8288 {
8290 {
8292 {
8294 }
8295 }
8296 else
8297 {
8299 }
8300 }
8301 else
8302 {
8304 }
8305
8306 break;
8307 #endif
8308
8309 }
8310
8312 {
8314 }
8315 }
8316
8317
8318
8319
8321 {
8322 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8323 return plugin.GetID(
name);
8324 }
8325
8327 {
8328 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8329 return plugin.GetName(id);
8330 }
8331
8334 {
8335
8336
8337 int varFlags;
8338 if (!ctx.
Read(varFlags))
8339 return;
8340
8341 if (varFlags & ItemVariableFlags.FLOAT)
8342 {
8344 }
8345 }
8346
8348 {
8349
8350 super.SerializeNumericalVars(floats_out);
8351
8352
8353
8355 {
8357 }
8358
8360 {
8362 }
8363
8365 {
8367 }
8368
8370 {
8375 }
8376
8378 {
8380 }
8381 }
8382
8384 {
8385
8386 super.DeSerializeNumericalVars(floats);
8387
8388
8389 int index = 0;
8390 int mask = Math.Round(floats.Get(index));
8391
8392 index++;
8393
8395 {
8397 {
8399 }
8400 else
8401 {
8402 float quantity = floats.Get(index);
8404 }
8405 index++;
8406 }
8407
8409 {
8410 float wet = floats.Get(index);
8412 index++;
8413 }
8414
8416 {
8417 int liquidtype = Math.Round(floats.Get(index));
8419 index++;
8420 }
8421
8423 {
8425 index++;
8427 index++;
8429 index++;
8431 index++;
8432 }
8433
8435 {
8436 int cleanness = Math.Round(floats.Get(index));
8438 index++;
8439 }
8440 }
8441
8443 {
8444 super.WriteVarsToCTX(ctx);
8445
8446
8448 {
8450 }
8451
8453 {
8455 }
8456
8458 {
8460 }
8461
8463 {
8464 int r,g,b,a;
8470 }
8471
8473 {
8475 }
8476 }
8477
8479 {
8480 if (!super.ReadVarsFromCTX(ctx,version))
8481 return false;
8482
8483 int intValue;
8484 float value;
8485
8486 if (version < 140)
8487 {
8488 if (!ctx.
Read(intValue))
8489 return false;
8490
8491 m_VariablesMask = intValue;
8492 }
8493
8495 {
8496 if (!ctx.
Read(value))
8497 return false;
8498
8500 {
8502 }
8503 else
8504 {
8506 }
8507 }
8508
8509 if (version < 140)
8510 {
8512 {
8513 if (!ctx.
Read(value))
8514 return false;
8515 SetTemperatureDirect(value);
8516 }
8517 }
8518
8520 {
8521 if (!ctx.
Read(value))
8522 return false;
8524 }
8525
8527 {
8528 if (!ctx.
Read(intValue))
8529 return false;
8531 }
8532
8534 {
8535 int r,g,b,a;
8537 return false;
8539 return false;
8541 return false;
8543 return false;
8544
8546 }
8547
8549 {
8550 if (!ctx.
Read(intValue))
8551 return false;
8553 }
8554
8555 if (version >= 138 && version < 140)
8556 {
8558 {
8559 if (!ctx.
Read(intValue))
8560 return false;
8561 SetFrozen(intValue);
8562 }
8563 }
8564
8565 return true;
8566 }
8567
8568
8570 {
8573 {
8575 }
8576
8577 if (!super.OnStoreLoad(ctx, version))
8578 {
8580 return false;
8581 }
8582
8583 if (version >= 114)
8584 {
8585 bool hasQuickBarIndexSaved;
8586
8587 if (!ctx.
Read(hasQuickBarIndexSaved))
8588 {
8590 return false;
8591 }
8592
8593 if (hasQuickBarIndexSaved)
8594 {
8595 int itmQBIndex;
8596
8597
8598 if (!ctx.
Read(itmQBIndex))
8599 {
8601 return false;
8602 }
8603
8604 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8605 if (itmQBIndex != -1 && parentPlayer)
8606 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8607 }
8608 }
8609 else
8610 {
8611
8612 PlayerBase player;
8613 int itemQBIndex;
8614 if (version ==
int.
MAX)
8615 {
8616 if (!ctx.
Read(itemQBIndex))
8617 {
8619 return false;
8620 }
8621 }
8622 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8623 {
8624
8625 if (!ctx.
Read(itemQBIndex))
8626 {
8628 return false;
8629 }
8630 if (itemQBIndex != -1 && player)
8631 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8632 }
8633 }
8634
8635 if (version < 140)
8636 {
8637
8638 if (!LoadVariables(ctx, version))
8639 {
8641 return false;
8642 }
8643 }
8644
8645
8647 {
8649 return false;
8650 }
8651 if (version >= 132)
8652 {
8654 if (raib)
8655 {
8657 {
8659 return false;
8660 }
8661 }
8662 }
8663
8665 return true;
8666 }
8667
8668
8669
8671 {
8672 super.OnStoreSave(ctx);
8673
8674 PlayerBase player;
8675 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8676 {
8678
8679 int itemQBIndex = -1;
8680 itemQBIndex = player.FindQuickBarEntityIndex(this);
8681 ctx.
Write(itemQBIndex);
8682 }
8683 else
8684 {
8686 }
8687
8689
8691 if (raib)
8692 {
8694 }
8695 }
8696
8697
8699 {
8700 super.AfterStoreLoad();
8701
8703 {
8705 }
8706
8708 {
8711 }
8712 }
8713
8715 {
8716 super.EEOnAfterLoad();
8717
8719 {
8721 }
8722
8725 }
8726
8728 {
8729 return false;
8730 }
8731
8732
8733
8735 {
8737 {
8738 #ifdef PLATFORM_CONSOLE
8739
8741 {
8743 if (menu)
8744 {
8746 }
8747 }
8748 #endif
8749 }
8750
8752 {
8755 }
8756
8758 {
8759 SetWeightDirty();
8761 }
8763 {
8766 }
8767
8769 {
8772 }
8774 {
8777 }
8778
8779 super.OnVariablesSynchronized();
8780 }
8781
8782
8783
8785 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8786 {
8787 if (!IsServerCheck(allow_client))
8788 return false;
8789
8791 return false;
8792
8795
8796 if (value <= (min + 0.001))
8797 value = min;
8798
8799 if (value == min)
8800 {
8801 if (destroy_config)
8802 {
8803 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8804 if (dstr)
8805 {
8807 this.Delete();
8808 return true;
8809 }
8810 }
8811 else if (destroy_forced)
8812 {
8814 this.Delete();
8815 return true;
8816 }
8817
8819 }
8820
8823
8825 {
8827
8828 if (delta)
8830 }
8831
8833
8834 return false;
8835 }
8836
8837
8839 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8840 {
8842 }
8843
8845 {
8848 }
8849
8851 {
8854 }
8855
8858 {
8859 float value_clamped = Math.Clamp(value, 0, 1);
8861 SetQuantity(result, destroy_config, destroy_forced);
8862 }
8863
8864
8867 {
8869 }
8870
8872 {
8874 }
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8886 {
8887 int slot = -1;
8888 if (GetInventory())
8889 {
8890 InventoryLocation il = new InventoryLocation;
8891 GetInventory().GetCurrentInventoryLocation(il);
8893 }
8894
8896 }
8897
8899 {
8900 float quantity_max = 0;
8901
8903 {
8904 if (attSlotID != -1)
8905 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8906
8907 if (quantity_max <= 0)
8909 }
8910
8911 if (quantity_max <= 0)
8913
8914 return quantity_max;
8915 }
8916
8918 {
8920 }
8921
8923 {
8925 }
8926
8927
8929 {
8931 }
8932
8934 {
8936 }
8937
8939 {
8941 }
8942
8943
8945 {
8946
8947 float weightEx = GetWeightEx();
8948 float special = GetInventoryAndCargoWeight();
8949 return weightEx - special;
8950 }
8951
8952
8954 {
8956 }
8957
8959 {
8961 {
8962 #ifdef DEVELOPER
8963 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8964 {
8965 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8967 }
8968 #endif
8969
8971 }
8972 else if (HasEnergyManager())
8973 {
8974 #ifdef DEVELOPER
8975 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8976 {
8977 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8978 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8979 }
8980 #endif
8981 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8982 }
8983 else
8984 {
8985 #ifdef DEVELOPER
8986 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8987 {
8988 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8989 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8990 }
8991 #endif
8992 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
8993 }
8994 }
8995
8998 {
8999 int item_count = 0;
9001
9002 if (GetInventory().GetCargo() != NULL)
9003 {
9004 item_count = GetInventory().GetCargo().GetItemCount();
9005 }
9006
9007 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9008 {
9009 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9010 if (item)
9011 item_count += item.GetNumberOfItems();
9012 }
9013 return item_count;
9014 }
9015
9018 {
9019 float weight = 0;
9020 float wetness = 1;
9021 if (include_wetness)
9024 {
9025 weight = wetness * m_ConfigWeight;
9026 }
9028 {
9029 weight = 1;
9030 }
9031 return weight;
9032 }
9033
9034
9035
9037 {
9038 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9039 {
9040 GameInventory inv = GetInventory();
9041 array<EntityAI> items = new array<EntityAI>;
9043 for (int i = 0; i < items.Count(); i++)
9044 {
9046 if (item)
9047 {
9049 }
9050 }
9051 }
9052 }
9053
9054
9055
9056
9058 {
9059 float energy = 0;
9060 if (HasEnergyManager())
9061 {
9062 energy = GetCompEM().GetEnergy();
9063 }
9064 return energy;
9065 }
9066
9067
9069 {
9070 super.OnEnergyConsumed();
9071
9073 }
9074
9076 {
9077 super.OnEnergyAdded();
9078
9080 }
9081
9082
9084 {
9085 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9086 {
9088 {
9089 float energy_0to1 = GetCompEM().GetEnergy0To1();
9091 }
9092 }
9093 }
9094
9095
9097 {
9098 return ConfigGetFloat("heatIsolation");
9099 }
9100
9102 {
9104 }
9105
9107 {
9108 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9109 if (
GetGame().ConfigIsExisting(paramPath))
9111
9112 return 0.0;
9113 }
9114
9116 {
9117 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9118 if (
GetGame().ConfigIsExisting(paramPath))
9120
9121 return 0.0;
9122 }
9123
9124 override void SetWet(
float value,
bool allow_client =
false)
9125 {
9126 if (!IsServerCheck(allow_client))
9127 return;
9128
9131
9133
9134 m_VarWet = Math.Clamp(value, min, max);
9135
9137 {
9140 }
9141 }
9142
9143 override void AddWet(
float value)
9144 {
9146 }
9147
9149 {
9151 }
9152
9154 {
9156 }
9157
9159 {
9161 }
9162
9164 {
9166 }
9167
9169 {
9171 }
9172
9174 {
9177 if (newLevel != oldLevel)
9178 {
9180 }
9181 }
9182
9184 {
9185 SetWeightDirty();
9186 }
9187
9189 {
9190 return GetWetLevelInternal(
m_VarWet);
9191 }
9192
9193
9194
9196 {
9198 }
9199
9201 {
9203 }
9204
9206 {
9208 }
9209
9211 {
9213 }
9214
9215
9216
9218 {
9219 if (ConfigIsExisting("itemModelLength"))
9220 {
9221 return ConfigGetFloat("itemModelLength");
9222 }
9223 return 0;
9224 }
9225
9227 {
9228 if (ConfigIsExisting("itemAttachOffset"))
9229 {
9230 return ConfigGetFloat("itemAttachOffset");
9231 }
9232 return 0;
9233 }
9234
9235 override void SetCleanness(
int value,
bool allow_client =
false)
9236 {
9237 if (!IsServerCheck(allow_client))
9238 return;
9239
9241
9243
9246 }
9247
9249 {
9251 }
9252
9254 {
9255 return true;
9256 }
9257
9258
9259
9260
9262 {
9264 }
9265
9267 {
9269 }
9270
9271
9272
9273
9274 override void SetColor(
int r,
int g,
int b,
int a)
9275 {
9281 }
9283 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9284 {
9289 }
9290
9292 {
9294 }
9295
9298 {
9299 int r,g,b,a;
9301 r = r/255;
9302 g = g/255;
9303 b = b/255;
9304 a = a/255;
9305 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9306 }
9307
9308
9309
9310 override void SetLiquidType(
int value,
bool allow_client =
false)
9311 {
9312 if (!IsServerCheck(allow_client))
9313 return;
9314
9319 }
9320
9322 {
9323 return ConfigGetInt("varLiquidTypeInit");
9324 }
9325
9327 {
9329 }
9330
9332 {
9334 SetFrozen(false);
9335 }
9336
9339 {
9340 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9341 }
9342
9343
9346 {
9347 PlayerBase nplayer;
9348 if (PlayerBase.CastTo(nplayer, player))
9349 {
9351
9352 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9353 }
9354 }
9355
9356
9359 {
9360 PlayerBase nplayer;
9361 if (PlayerBase.CastTo(nplayer,player))
9362 {
9363
9364 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9365
9366 }
9367
9368
9369 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9370
9371
9372 if (HasEnergyManager())
9373 {
9374 GetCompEM().UpdatePlugState();
9375 }
9376 }
9377
9378
9380 {
9381 super.OnPlacementStarted(player);
9382
9384 }
9385
9386 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9387 {
9389 {
9390 m_AdminLog.OnPlacementComplete(player,
this);
9391 }
9392
9393 super.OnPlacementComplete(player, position, orientation);
9394 }
9395
9396
9397
9398
9399
9401 {
9403 {
9404 return true;
9405 }
9406 else
9407 {
9408 return false;
9409 }
9410 }
9411
9412
9414 {
9416 {
9418 }
9419 }
9420
9421
9423 {
9425 }
9426
9428 {
9430 }
9431
9432 override void InsertAgent(
int agent,
float count = 1)
9433 {
9434 if (count < 1)
9435 return;
9436
9438 }
9439
9442 {
9444 }
9445
9446
9448 {
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
9488
9489
9490
9491
9492
9494 {
9496 return false;
9497 return true;
9498 }
9499
9501 {
9502
9504 }
9505
9506
9509 {
9510 super.CheckForRoofLimited(timeTresholdMS);
9511
9513 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9514 {
9515 m_PreviousRoofTestTime = time;
9516 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9517 }
9518 }
9519
9520
9522 {
9524 {
9525 return 0;
9526 }
9527
9528 if (GetInventory().GetAttachmentSlotsCount() != 0)
9529 {
9530 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9531 if (filter)
9532 return filter.GetProtectionLevel(type, false, system);
9533 else
9534 return 0;
9535 }
9536
9537 string subclassPath, entryName;
9538
9539 switch (type)
9540 {
9542 entryName = "biological";
9543 break;
9545 entryName = "chemical";
9546 break;
9547 default:
9548 entryName = "biological";
9549 break;
9550 }
9551
9552 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9553
9555 }
9556
9557
9558
9561 {
9562 if (!IsMagazine())
9564
9566 }
9567
9568
9569
9570
9571
9576 {
9577 return true;
9578 }
9579
9581 {
9583 }
9584
9585
9586
9587
9588
9590 {
9591 if (parent)
9592 {
9593 if (parent.IsInherited(DayZInfected))
9594 return true;
9595
9596 if (!parent.IsRuined())
9597 return true;
9598 }
9599
9600 return true;
9601 }
9602
9604 {
9605 if (!super.CanPutAsAttachment(parent))
9606 {
9607 return false;
9608 }
9609
9610 if (!IsRuined() && !parent.IsRuined())
9611 {
9612 return true;
9613 }
9614
9615 return false;
9616 }
9617
9619 {
9620
9621
9622
9623
9624 return super.CanReceiveItemIntoCargo(item);
9625 }
9626
9628 {
9629
9630
9631
9632
9633 GameInventory attachmentInv = attachment.GetInventory();
9635 {
9636 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9637 return false;
9638 }
9639
9640 InventoryLocation loc = new InventoryLocation();
9641 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9642 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9643 return false;
9644
9645 return super.CanReceiveAttachment(attachment, slotId);
9646 }
9647
9649 {
9650 if (!super.CanReleaseAttachment(attachment))
9651 return false;
9652
9653 return GetInventory().AreChildrenAccessible();
9654 }
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9677 {
9678 int id = muzzle_owner.GetMuzzleID();
9679 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9680
9681 if (WPOF_array)
9682 {
9683 for (int i = 0; i < WPOF_array.Count(); i++)
9684 {
9685 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9686
9687 if (WPOF)
9688 {
9689 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9690 }
9691 }
9692 }
9693 }
9694
9695
9697 {
9698 int id = muzzle_owner.GetMuzzleID();
9700
9701 if (WPOBE_array)
9702 {
9703 for (int i = 0; i < WPOBE_array.Count(); i++)
9704 {
9705 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9706
9707 if (WPOBE)
9708 {
9709 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9710 }
9711 }
9712 }
9713 }
9714
9715
9717 {
9718 int id = muzzle_owner.GetMuzzleID();
9719 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9720
9721 if (WPOOH_array)
9722 {
9723 for (int i = 0; i < WPOOH_array.Count(); i++)
9724 {
9725 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9726
9727 if (WPOOH)
9728 {
9729 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9730 }
9731 }
9732 }
9733 }
9734
9735
9737 {
9738 int id = muzzle_owner.GetMuzzleID();
9739 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9740
9741 if (WPOOH_array)
9742 {
9743 for (int i = 0; i < WPOOH_array.Count(); i++)
9744 {
9745 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9746
9747 if (WPOOH)
9748 {
9749 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9750 }
9751 }
9752 }
9753 }
9754
9755
9757 {
9758 int id = muzzle_owner.GetMuzzleID();
9759 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9760
9761 if (WPOOH_array)
9762 {
9763 for (int i = 0; i < WPOOH_array.Count(); i++)
9764 {
9765 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9766
9767 if (WPOOH)
9768 {
9769 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9770 }
9771 }
9772 }
9773 }
9774
9775
9776
9778 {
9780 {
9781 return true;
9782 }
9783
9784 return false;
9785 }
9786
9788 {
9790 {
9791 return true;
9792 }
9793
9794 return false;
9795 }
9796
9798 {
9800 {
9801 return true;
9802 }
9803
9804 return false;
9805 }
9806
9808 {
9809 return false;
9810 }
9811
9814 {
9815 return UATimeSpent.DEFAULT_DEPLOY;
9816 }
9817
9818
9819
9820
9822 {
9824 SetSynchDirty();
9825 }
9826
9828 {
9830 }
9831
9832
9834 {
9835 return false;
9836 }
9837
9840 {
9841 string att_type = "None";
9842
9843 if (ConfigIsExisting("soundAttType"))
9844 {
9845 att_type = ConfigGetString("soundAttType");
9846 }
9847
9849 }
9850
9852 {
9854 }
9855
9856
9857
9858
9859
9863
9865 {
9868
9870 }
9871
9872
9874 {
9876 return;
9877
9879
9882
9885
9886 SoundParameters params = new SoundParameters();
9890 }
9891
9892
9894 {
9896 return;
9897
9899 SetSynchDirty();
9900
9903 }
9904
9905
9907 {
9909 return;
9910
9912 SetSynchDirty();
9913
9916 }
9917
9919 {
9921 }
9922
9924 {
9926 }
9927
9930 {
9931 if (!
GetGame().IsDedicatedServer())
9932 {
9933 if (ConfigIsExisting("attachSoundSet"))
9934 {
9935 string cfg_path = "";
9936 string soundset = "";
9938
9941 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9942 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9943
9944 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9945 {
9946 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9947 {
9948 if (cfg_slot_array[i] == slot_type)
9949 {
9950 soundset = cfg_soundset_array[i];
9951 break;
9952 }
9953 }
9954 }
9955
9956 if (soundset != "")
9957 {
9958 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9960 }
9961 }
9962 }
9963 }
9964
9966 {
9967
9968 }
9969
9970 void OnApply(PlayerBase player);
9971
9973 {
9974 return 1.0;
9975 };
9976
9978 {
9980 }
9981
9983 {
9985 }
9986
9988
9990 {
9991 SetDynamicPhysicsLifeTime(0.01);
9993 }
9994
9996 {
9997 array<string> zone_names = new array<string>;
9998 GetDamageZones(zone_names);
9999 for (int i = 0; i < zone_names.Count(); i++)
10000 {
10001 SetHealthMax(zone_names.Get(i),"Health");
10002 }
10003 SetHealthMax("","Health");
10004 }
10005
10008 {
10009 float global_health = GetHealth01("","Health");
10010 array<string> zones = new array<string>;
10011 GetDamageZones(zones);
10012
10013 for (int i = 0; i < zones.Count(); i++)
10014 {
10015 SetHealth01(zones.Get(i),"Health",global_health);
10016 }
10017 }
10018
10021 {
10022 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10023 }
10024
10026 {
10027 if (!hasRootAsPlayer)
10028 {
10029 if (refParentIB)
10030 {
10031
10032 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10033 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10034
10035 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10036 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10037
10040 }
10041 else
10042 {
10043
10046 }
10047 }
10048 }
10049
10051 {
10053 {
10054 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10055 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10056 {
10057 float heatPermCoef = 1.0;
10059 while (ent)
10060 {
10061 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10062 ent = ent.GetHierarchyParent();
10063 }
10064
10065 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10066 }
10067 }
10068 }
10069
10071 {
10072
10073 EntityAI parent = GetHierarchyParent();
10074 if (!parent)
10075 {
10076 hasParent = false;
10077 hasRootAsPlayer = false;
10078 }
10079 else
10080 {
10081 hasParent = true;
10082 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10083 refParentIB =
ItemBase.Cast(parent);
10084 }
10085 }
10086
10087 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10088 {
10089
10090 }
10091
10093 {
10094
10095 return false;
10096 }
10097
10099 {
10100
10101
10102 return false;
10103 }
10104
10106 {
10107
10108 return false;
10109 }
10110
10113 {
10114 return !GetIsFrozen() &&
IsOpen();
10115 }
10116
10118 {
10119 bool hasParent = false, hasRootAsPlayer = false;
10121
10122 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10123 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10124
10125 if (wwtu || foodDecay)
10126 {
10130
10131 if (processWetness || processTemperature || processDecay)
10132 {
10134
10135 if (processWetness)
10136 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10137
10138 if (processTemperature)
10140
10141 if (processDecay)
10142 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10143 }
10144 }
10145 }
10146
10149 {
10151 }
10152
10154 {
10157
10158 return super.GetTemperatureFreezeThreshold();
10159 }
10160
10162 {
10165
10166 return super.GetTemperatureThawThreshold();
10167 }
10168
10170 {
10173
10174 return super.GetItemOverheatThreshold();
10175 }
10176
10178 {
10180 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10181
10182 return super.GetTemperatureFreezeTime();
10183 }
10184
10186 {
10188 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10189
10190 return super.GetTemperatureThawTime();
10191 }
10192
10197
10199 {
10200 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10201 }
10202
10204 {
10205 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10206 }
10207
10210 {
10212 }
10213
10215 {
10217 }
10218
10220 {
10222 }
10223
10226 {
10227 return null;
10228 }
10229
10232 {
10233 return false;
10234 }
10235
10237 {
10239 {
10242 if (!trg)
10243 {
10245 explosive = this;
10246 }
10247
10248 explosive.PairRemote(trg);
10250
10251 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10252 trg.SetPersistentPairID(persistentID);
10253 explosive.SetPersistentPairID(persistentID);
10254
10255 return true;
10256 }
10257 return false;
10258 }
10259
10262 {
10263 float ret = 1.0;
10266 ret *= GetHealth01();
10267
10268 return ret;
10269 }
10270
10271 #ifdef DEVELOPER
10272 override void SetDebugItem()
10273 {
10274 super.SetDebugItem();
10275 _itemBase = this;
10276 }
10277
10279 {
10280 string text = super.GetDebugText();
10281
10283 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10284
10285 return text;
10286 }
10287 #endif
10288
10290 {
10291 return true;
10292 }
10293
10295
10297
10299 {
10302 }
10303
10304
10312
10328}
10329
10331{
10333 if (entity)
10334 {
10335 bool is_item = entity.IsInherited(
ItemBase);
10336 if (is_item && full_quantity)
10337 {
10340 }
10341 }
10342 else
10343 {
10345 return NULL;
10346 }
10347 return entity;
10348}
10349
10351{
10352 if (item)
10353 {
10354 if (health > 0)
10355 item.SetHealth("", "", health);
10356
10357 if (item.CanHaveTemperature())
10358 {
10360 if (item.CanFreeze())
10361 item.SetFrozen(false);
10362 }
10363
10364 if (item.HasEnergyManager())
10365 {
10366 if (quantity >= 0)
10367 {
10368 item.GetCompEM().SetEnergy0To1(quantity);
10369 }
10370 else
10371 {
10373 }
10374 }
10375 else if (item.IsMagazine())
10376 {
10377 Magazine mag = Magazine.Cast(item);
10378 if (quantity >= 0)
10379 {
10380 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10381 }
10382 else
10383 {
10385 }
10386
10387 }
10388 else
10389 {
10390 if (quantity >= 0)
10391 {
10392 item.SetQuantityNormalized(quantity, false);
10393 }
10394 else
10395 {
10397 }
10398
10399 }
10400 }
10401}
10402
10403#ifdef DEVELOPER
10405#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.