5512{
5514 {
5515 return true;
5516 }
5517};
5518
5519
5520
5522{
5526
5528
5531
5532
5533
5534
5535
5544
5550
5555
5560
5581 protected bool m_IsResultOfSplit
5582
5584
5589
5590
5591
5593
5597
5598
5599
5601
5604
5605
5606
5612
5613
5621
5624
5625
5627
5628
5630
5631
5636
5637
5642
5643
5645
5646
5648 {
5653
5654 if (!
GetGame().IsDedicatedServer())
5655 {
5657 {
5659
5661 {
5663 }
5664 }
5665
5668 }
5669
5670 m_OldLocation = null;
5671
5673 {
5675 }
5676
5677 if (ConfigIsExisting("headSelectionsToHide"))
5678 {
5681 }
5682
5684 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5685 {
5687 }
5688
5690
5691 m_IsResultOfSplit = false;
5692
5694 }
5695
5697 {
5698 super.InitItemVariables();
5699
5705 m_Count = ConfigGetInt(
"count");
5706
5709
5714
5717
5722
5734
5738
5739
5742 if (ConfigIsExisting("canBeSplit"))
5743 {
5746 }
5747
5749 if (ConfigIsExisting("itemBehaviour"))
5751
5752
5755 RegisterNetSyncVariableInt("m_VarLiquidType");
5756 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5757
5758 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5759 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5760 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5761
5762 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5763 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5764 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5765 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5766
5767 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5768 RegisterNetSyncVariableBool("m_IsTakeable");
5769 RegisterNetSyncVariableBool("m_IsHologram");
5770
5773 {
5776 }
5777
5779
5781 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5783
5784 }
5785
5787 {
5789 }
5790
5792 {
5795 {
5800 }
5801 }
5802
5803 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5804 {
5806 {
5809 }
5810
5812 }
5813
5815 {
5821 }
5822
5824
5826 {
5828
5829 if (!action)
5830 {
5831 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5832 return;
5833 }
5834
5836 if (!ai)
5837 {
5839 return;
5840 }
5841
5843 if (!action_array)
5844 {
5845 action_array = new array<ActionBase_Basic>;
5847 }
5848 if (LogManager.IsActionLogEnable())
5849 {
5850 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5851 }
5852
5853 if (action_array.Find(action) != -1)
5854 {
5855 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5856 }
5857 else
5858 {
5859 action_array.Insert(action);
5860 }
5861 }
5862
5864 {
5866 ActionBase action = player.GetActionManager().GetAction(actionName);
5869
5870 if (action_array)
5871 {
5872 action_array.RemoveItem(action);
5873 }
5874 }
5875
5876
5877
5879 {
5880 ActionOverrideData overrideData = new ActionOverrideData();
5884
5886 if (!actionMap)
5887 {
5890 }
5891
5892 actionMap.Insert(this.
Type(), overrideData);
5893
5894 }
5895
5897
5899
5900
5902 {
5905
5908
5909 string config_to_search = "CfgVehicles";
5910 string muzzle_owner_config;
5911
5913 {
5914 if (IsInherited(Weapon))
5915 config_to_search = "CfgWeapons";
5916
5917 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5918
5919 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5920
5922
5923 if (config_OnFire_subclass_count > 0)
5924 {
5925 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5926
5927 for (int i = 0; i < config_OnFire_subclass_count; i++)
5928 {
5929 string particle_class = "";
5931 string config_OnFire_entry = config_OnFire_class + particle_class;
5932 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5933 WPOF_array.Insert(WPOF);
5934 }
5935
5936
5938 }
5939 }
5940
5942 {
5943 config_to_search = "CfgWeapons";
5944 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5945
5946 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5947
5949
5950 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5951 {
5952 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5953
5954 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5955 {
5956 string particle_class2 = "";
5958 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5959 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5960 WPOBE_array.Insert(WPOBE);
5961 }
5962
5963
5965 }
5966 }
5967 }
5968
5969
5971 {
5974
5976 {
5977 string config_to_search = "CfgVehicles";
5978
5979 if (IsInherited(Weapon))
5980 config_to_search = "CfgWeapons";
5981
5982 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5983 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5984
5985 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5986 {
5987
5989
5991 {
5993 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5995 return;
5996 }
5997
6000
6001
6002
6004 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6005
6006 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6007 {
6008 string particle_class = "";
6010 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6012
6013 if (entry_type == CT_CLASS)
6014 {
6015 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6016 WPOOH_array.Insert(WPOF);
6017 }
6018 }
6019
6020
6022 }
6023 }
6024 }
6025
6027 {
6029 }
6030
6032 {
6034 {
6036
6039
6042
6043 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6044 }
6045 }
6046
6048 {
6050 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6051
6053 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6054
6056 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6057
6059 {
6061 }
6062 }
6063
6065 {
6067 }
6068
6070 {
6073 else
6075
6077 {
6080 }
6081 else
6082 {
6085
6088 }
6089
6091 }
6092
6094 {
6096 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6097 }
6098
6100 {
6102 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6104 }
6105
6107 {
6109 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6110 }
6111
6113 {
6116
6117 OverheatingParticle OP = new OverheatingParticle();
6122
6124 }
6125
6127 {
6130
6131 return -1;
6132 }
6133
6135 {
6137 {
6140
6141 for (int i = count; i > 0; --i)
6142 {
6143 int id = i - 1;
6146
6149
6150 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6151 {
6152 if (p)
6153 {
6156 }
6157 }
6158 }
6159 }
6160 }
6161
6163 {
6165 {
6167 {
6168 int id = i - 1;
6170
6171 if (OP)
6172 {
6174
6175 if (p)
6176 {
6178 }
6179
6180 delete OP;
6181 }
6182 }
6183
6186 }
6187 }
6188
6191 {
6192 return 0.0;
6193 }
6194
6195
6197 {
6198 return 250;
6199 }
6200
6202 {
6203 return 0;
6204 }
6205
6208 {
6210 return true;
6211
6212 return false;
6213 }
6214
6217 {
6220
6222 {
6224 }
6225 else
6226 {
6227
6229 }
6230
6232 }
6233
6240 {
6241 return -1;
6242 }
6243
6244
6245
6246
6248 {
6250 {
6252 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6253
6254 if (r_index >= 0)
6255 {
6256 InventoryLocation r_il = new InventoryLocation;
6257 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6258
6259 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6262 {
6263 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6264 }
6266 {
6267 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6268 }
6269
6270 }
6271
6272 player.GetHumanInventory().ClearUserReservedLocation(this);
6273 }
6274
6277 }
6278
6279
6280
6281
6283 {
6284 return ItemBase.m_DebugActionsMask;
6285 }
6286
6288 {
6289 return ItemBase.m_DebugActionsMask & mask;
6290 }
6291
6293 {
6294 ItemBase.m_DebugActionsMask = mask;
6295 }
6296
6298 {
6299 ItemBase.m_DebugActionsMask |= mask;
6300 }
6301
6303 {
6304 ItemBase.m_DebugActionsMask &= ~mask;
6305 }
6306
6308 {
6310 {
6312 }
6313 else
6314 {
6316 }
6317 }
6318
6319
6321 {
6322 if (GetEconomyProfile())
6323 {
6324 float q_max = GetEconomyProfile().GetQuantityMax();
6325 if (q_max > 0)
6326 {
6327 float q_min = GetEconomyProfile().GetQuantityMin();
6328 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6329
6331 {
6332 ComponentEnergyManager comp = GetCompEM();
6334 {
6336 }
6337 }
6339 {
6341
6342 }
6343
6344 }
6345 }
6346 }
6347
6350 {
6351 EntityAI parent = GetHierarchyParent();
6352
6353 if (parent)
6354 {
6355 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6356 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6357 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6358 }
6359 }
6360
6363 {
6364 EntityAI parent = GetHierarchyParent();
6365
6366 if (parent)
6367 {
6368 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6369 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6370 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6371 }
6372 }
6373
6375 {
6376
6377
6378
6379
6381
6383 {
6384 if (ScriptInputUserData.CanStoreInputUserData())
6385 {
6386 ScriptInputUserData ctx = new ScriptInputUserData;
6392 ctx.
Write(use_stack_max);
6395
6397 {
6398 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6399 }
6400 }
6401 }
6402 else if (!
GetGame().IsMultiplayer())
6403 {
6405 }
6406 }
6407
6409 {
6411 }
6412
6414 {
6416 }
6417
6419 {
6421 }
6422
6424 {
6425
6426 return false;
6427 }
6428
6430 {
6431 return false;
6432 }
6433
6437 {
6438 return false;
6439 }
6440
6442 {
6443 return "";
6444 }
6445
6447
6449 {
6450 return false;
6451 }
6452
6454 {
6455 return true;
6456 }
6457
6458
6459
6461 {
6462 return true;
6463 }
6464
6466 {
6467 return true;
6468 }
6469
6471 {
6472 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6474 }
6475
6477 {
6479 }
6480
6482 {
6484 if (!is_being_placed)
6486 SetSynchDirty();
6487 }
6488
6489
6491
6493 {
6495 }
6496
6498 {
6500 }
6501
6503 {
6504 return 1;
6505 }
6506
6508 {
6509 return false;
6510 }
6511
6513 {
6515 SetSynchDirty();
6516 }
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6553 {
6554 super.OnMovedInsideCargo(container);
6555
6556 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6557 }
6558
6559 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6560 {
6561 super.EEItemLocationChanged(oldLoc,newLoc);
6562
6563 PlayerBase new_player = null;
6564 PlayerBase old_player = null;
6565
6566 if (newLoc.GetParent())
6567 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6568
6569 if (oldLoc.GetParent())
6570 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6571
6573 {
6574 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6575
6576 if (r_index >= 0)
6577 {
6578 InventoryLocation r_il = new InventoryLocation;
6579 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6580
6581 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6584 {
6585 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6586 }
6588 {
6589 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6590 }
6591
6592 }
6593 }
6594
6596 {
6597 if (new_player)
6598 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6599
6600 if (new_player == old_player)
6601 {
6602
6603 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6604 {
6606 {
6607 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6608 {
6609 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6610 }
6611 }
6612 else
6613 {
6614 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6615 }
6616 }
6617
6618 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6619 {
6620 int type = oldLoc.GetType();
6622 {
6623 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6624 }
6626 {
6627 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6628 }
6629 }
6630 if (!m_OldLocation)
6631 {
6632 m_OldLocation = new InventoryLocation;
6633 }
6634 m_OldLocation.Copy(oldLoc);
6635 }
6636 else
6637 {
6638 if (m_OldLocation)
6639 {
6640 m_OldLocation.Reset();
6641 }
6642 }
6643
6645 }
6646 else
6647 {
6648 if (new_player)
6649 {
6650 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6651 if (res_index >= 0)
6652 {
6653 InventoryLocation il = new InventoryLocation;
6654 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6656 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6659 {
6660 il.
GetParent().GetOnReleaseLock().Invoke(it);
6661 }
6663 {
6665 }
6666
6667 }
6668 }
6670 {
6671
6673 }
6674
6675 if (m_OldLocation)
6676 {
6677 m_OldLocation.Reset();
6678 }
6679 }
6680 }
6681
6682 override void EOnContact(IEntity other, Contact extra)
6683 {
6685 {
6686 int liquidType = -1;
6688 if (impactSpeed > 0.0)
6689 {
6691 #ifndef SERVER
6693 #else
6695 SetSynchDirty();
6696 #endif
6698 }
6699 }
6700
6701 #ifdef SERVER
6702 if (GetCompEM() && GetCompEM().IsPlugged())
6703 {
6704 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6705 GetCompEM().UnplugThis();
6706 }
6707 #endif
6708 }
6709
6711
6713 {
6715 }
6716
6718 {
6719
6720 }
6721
6723 {
6724 super.OnItemLocationChanged(old_owner, new_owner);
6725
6726 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6727 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6728
6729 if (!relatedPlayer && playerNew)
6730 relatedPlayer = playerNew;
6731
6732 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6733 {
6735 if (actionMgr)
6736 {
6737 ActionBase currentAction = actionMgr.GetRunningAction();
6738 if (currentAction)
6740 }
6741 }
6742
6743 Man ownerPlayerOld = null;
6744 Man ownerPlayerNew = null;
6745
6746 if (old_owner)
6747 {
6748 if (old_owner.
IsMan())
6749 {
6750 ownerPlayerOld = Man.Cast(old_owner);
6751 }
6752 else
6753 {
6754 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6755 }
6756 }
6757 else
6758 {
6760 {
6762
6763 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6764 {
6765 GetCompEM().UnplugThis();
6766 }
6767 }
6768 }
6769
6770 if (new_owner)
6771 {
6772 if (new_owner.
IsMan())
6773 {
6774 ownerPlayerNew = Man.Cast(new_owner);
6775 }
6776 else
6777 {
6778 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6779 }
6780 }
6781
6782 if (ownerPlayerOld != ownerPlayerNew)
6783 {
6784 if (ownerPlayerOld)
6785 {
6786 array<EntityAI> subItemsExit = new array<EntityAI>;
6788 for (int i = 0; i < subItemsExit.Count(); i++)
6789 {
6792 }
6793 }
6794
6795 if (ownerPlayerNew)
6796 {
6797 array<EntityAI> subItemsEnter = new array<EntityAI>;
6799 for (int j = 0; j < subItemsEnter.Count(); j++)
6800 {
6803 }
6804 }
6805 }
6806 else if (ownerPlayerNew != null)
6807 {
6808 PlayerBase nplayer;
6809 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6810 {
6811 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6813 for (int k = 0; k < subItemsUpdate.Count(); k++)
6814 {
6816 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6817 }
6818 }
6819 }
6820
6821 if (old_owner)
6822 old_owner.OnChildItemRemoved(this);
6823 if (new_owner)
6824 new_owner.OnChildItemReceived(this);
6825 }
6826
6827
6829 {
6830 super.EEDelete(parent);
6831 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6832 if (player)
6833 {
6835
6836 if (player.IsAlive())
6837 {
6838 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6839 if (r_index >= 0)
6840 {
6841 InventoryLocation r_il = new InventoryLocation;
6842 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6843
6844 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6847 {
6848 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6849 }
6851 {
6852 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6853 }
6854
6855 }
6856
6857 player.RemoveQuickBarEntityShortcut(this);
6858 }
6859 }
6860 }
6861
6863 {
6864 super.EEKilled(killer);
6865
6868 {
6869 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6870 {
6871 if (IsMagazine())
6872 {
6873 if (Magazine.Cast(this).GetAmmoCount() > 0)
6874 {
6876 }
6877 }
6878 else
6879 {
6881 }
6882 }
6883 }
6884 }
6885
6887 {
6888 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6889
6890 super.OnWasAttached(parent, slot_id);
6891
6894
6896 }
6897
6899 {
6900 super.OnWasDetached(parent, slot_id);
6901
6904 }
6905
6907 {
6908 int idx;
6911
6912 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6913 if (inventory_slots.Count() < 1)
6914 {
6915 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6916 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6917 }
6918 else
6919 {
6920 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6921 }
6922
6923 idx = inventory_slots.Find(slot);
6924 if (idx < 0)
6925 return "";
6926
6927 return attach_types.Get(idx);
6928 }
6929
6931 {
6932 int idx = -1;
6933 string slot;
6934
6937
6938 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6939 if (inventory_slots.Count() < 1)
6940 {
6941 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6942 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6943 }
6944 else
6945 {
6946 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6947 if (detach_types.Count() < 1)
6948 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6949 }
6950
6951 for (int i = 0; i < inventory_slots.Count(); i++)
6952 {
6953 slot = inventory_slots.Get(i);
6954 }
6955
6956 if (slot != "")
6957 {
6958 if (detach_types.Count() == 1)
6959 idx = 0;
6960 else
6961 idx = inventory_slots.Find(slot);
6962 }
6963 if (idx < 0)
6964 return "";
6965
6966 return detach_types.Get(idx);
6967 }
6968
6970 {
6971
6973
6974
6975 float min_time = 1;
6976 float max_time = 3;
6977 float delay = Math.RandomFloat(min_time, max_time);
6978
6979 explode_timer.Run(delay, this, "DoAmmoExplosion");
6980 }
6981
6983 {
6984 Magazine magazine = Magazine.Cast(this);
6985 int pop_sounds_count = 6;
6986 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6987
6988
6989 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6990 string sound_name = pop_sounds[ sound_idx ];
6992
6993
6994 magazine.ServerAddAmmoCount(-1);
6995
6996
6997 float min_temp_to_explode = 100;
6998
6999 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7000 {
7002 }
7003 }
7004
7005
7006 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7007 {
7008 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7009
7010 const int CHANCE_DAMAGE_CARGO = 4;
7011 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7012 const int CHANCE_DAMAGE_NOTHING = 2;
7013
7015 {
7016 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7017 int chances;
7018 int rnd;
7019
7020 if (GetInventory().GetCargo())
7021 {
7022 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7023 rnd = Math.RandomInt(0,chances);
7024
7025 if (rnd < CHANCE_DAMAGE_CARGO)
7026 {
7028 }
7029 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7030 {
7032 }
7033 }
7034 else
7035 {
7036 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7037 rnd = Math.RandomInt(0,chances);
7038
7039 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7040 {
7042 }
7043 }
7044 }
7045 }
7046
7048 {
7049 if (GetInventory().GetCargo())
7050 {
7051 int item_count = GetInventory().GetCargo().GetItemCount();
7052 if (item_count > 0)
7053 {
7054 int random_pick = Math.RandomInt(0, item_count);
7056 if (!item.IsExplosive())
7057 {
7058 item.AddHealth("","",damage);
7059 return true;
7060 }
7061 }
7062 }
7063 return false;
7064 }
7065
7067 {
7068 int attachment_count = GetInventory().AttachmentCount();
7069 if (attachment_count > 0)
7070 {
7071 int random_pick = Math.RandomInt(0, attachment_count);
7072 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7073 if (!attachment.IsExplosive())
7074 {
7075 attachment.AddHealth("","",damage);
7076 return true;
7077 }
7078 }
7079 return false;
7080 }
7081
7083 {
7085 }
7086
7088 {
7090 return GetInventory().CanRemoveEntity();
7091
7092 return false;
7093 }
7094
7096 {
7098 return;
7099
7101 {
7102 if (ScriptInputUserData.CanStoreInputUserData())
7103 {
7104 ScriptInputUserData ctx = new ScriptInputUserData;
7109 ctx.
Write(destination_entity);
7113 }
7114 }
7115 else if (!
GetGame().IsMultiplayer())
7116 {
7118 }
7119 }
7120
7122 {
7124 return;
7125
7126 float split_quantity_new;
7130 InventoryLocation loc = new InventoryLocation;
7131
7132 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7133 {
7135 split_quantity_new = stack_max;
7136 else
7138
7139 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7140 if (new_item)
7141 {
7142 new_item.SetResultOfSplit(true);
7143 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7145 new_item.SetQuantity(split_quantity_new);
7146 }
7147 }
7148 else if (destination_entity && slot_id == -1)
7149 {
7150 if (quantity > stack_max)
7151 split_quantity_new = stack_max;
7152 else
7153 split_quantity_new = quantity;
7154
7156 {
7159 }
7160
7161 if (new_item)
7162 {
7163 new_item.SetResultOfSplit(true);
7164 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7166 new_item.SetQuantity(split_quantity_new);
7167 }
7168 }
7169 else
7170 {
7171 if (stack_max != 0)
7172 {
7174 {
7176 }
7177
7178 if (split_quantity_new == 0)
7179 {
7180 if (!
GetGame().IsMultiplayer())
7181 player.PhysicalPredictiveDropItem(this);
7182 else
7183 player.ServerDropEntity(this);
7184 return;
7185 }
7186
7188
7189 if (new_item)
7190 {
7191 new_item.SetResultOfSplit(true);
7192 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7194 new_item.SetQuantity(stack_max);
7195 new_item.PlaceOnSurface();
7196 }
7197 }
7198 }
7199 }
7200
7202 {
7204 return;
7205
7206 float split_quantity_new;
7210 InventoryLocation loc = new InventoryLocation;
7211
7212 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7213 {
7215 split_quantity_new = stack_max;
7216 else
7218
7219 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7220 if (new_item)
7221 {
7222 new_item.SetResultOfSplit(true);
7223 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7225 new_item.SetQuantity(split_quantity_new);
7226 }
7227 }
7228 else if (destination_entity && slot_id == -1)
7229 {
7230 if (quantity > stack_max)
7231 split_quantity_new = stack_max;
7232 else
7233 split_quantity_new = quantity;
7234
7236 {
7239 }
7240
7241 if (new_item)
7242 {
7243 new_item.SetResultOfSplit(true);
7244 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7246 new_item.SetQuantity(split_quantity_new);
7247 }
7248 }
7249 else
7250 {
7251 if (stack_max != 0)
7252 {
7254 {
7256 }
7257
7259
7260 if (new_item)
7261 {
7262 new_item.SetResultOfSplit(true);
7263 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7265 new_item.SetQuantity(stack_max);
7266 new_item.PlaceOnSurface();
7267 }
7268 }
7269 }
7270 }
7271
7273 {
7275 return;
7276
7278 {
7279 if (ScriptInputUserData.CanStoreInputUserData())
7280 {
7281 ScriptInputUserData ctx = new ScriptInputUserData;
7286 dst.WriteToContext(ctx);
7288 }
7289 }
7290 else if (!
GetGame().IsMultiplayer())
7291 {
7293 }
7294 }
7295
7297 {
7299 return;
7300
7302 {
7303 if (ScriptInputUserData.CanStoreInputUserData())
7304 {
7305 ScriptInputUserData ctx = new ScriptInputUserData;
7310 ctx.
Write(destination_entity);
7316 }
7317 }
7318 else if (!
GetGame().IsMultiplayer())
7319 {
7321 }
7322 }
7323
7325 {
7327 }
7328
7330 {
7332 return this;
7333
7335 float split_quantity_new;
7337 if (dst.IsValid())
7338 {
7339 int slot_id = dst.GetSlot();
7341
7342 if (quantity > stack_max)
7343 split_quantity_new = stack_max;
7344 else
7345 split_quantity_new = quantity;
7346
7348
7349 if (new_item)
7350 {
7351 new_item.SetResultOfSplit(true);
7352 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7355 }
7356
7357 return new_item;
7358 }
7359
7360 return null;
7361 }
7362
7364 {
7366 return;
7367
7369 float split_quantity_new;
7371 if (destination_entity)
7372 {
7374 if (quantity > stackable)
7375 split_quantity_new = stackable;
7376 else
7377 split_quantity_new = quantity;
7378
7379 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7380 if (new_item)
7381 {
7382 new_item.SetResultOfSplit(true);
7383 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7385 new_item.SetQuantity(split_quantity_new);
7386 }
7387 }
7388 }
7389
7391 {
7393 return;
7394
7396 {
7397 if (ScriptInputUserData.CanStoreInputUserData())
7398 {
7399 ScriptInputUserData ctx = new ScriptInputUserData;
7404 ItemBase destination_entity =
this;
7405 ctx.
Write(destination_entity);
7409 }
7410 }
7411 else if (!
GetGame().IsMultiplayer())
7412 {
7414 }
7415 }
7416
7418 {
7420 return;
7421
7423 float split_quantity_new;
7425 if (player)
7426 {
7428 if (quantity > stackable)
7429 split_quantity_new = stackable;
7430 else
7431 split_quantity_new = quantity;
7432
7433 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7434 new_item =
ItemBase.Cast(in_hands);
7435 if (new_item)
7436 {
7437 new_item.SetResultOfSplit(true);
7438 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7440 new_item.SetQuantity(split_quantity_new);
7441 }
7442 }
7443 }
7444
7446 {
7448 return;
7449
7451 float split_quantity_new = Math.Floor(quantity * 0.5);
7452
7454
7455 if (new_item)
7456 {
7457 if (new_item.GetQuantityMax() < split_quantity_new)
7458 {
7459 split_quantity_new = new_item.GetQuantityMax();
7460 }
7461
7462 new_item.SetResultOfSplit(true);
7463 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7464
7466 {
7469 }
7470 else
7471 {
7474 }
7475 }
7476 }
7477
7479 {
7481 return;
7482
7484 float split_quantity_new = Math.Floor(quantity / 2);
7485
7486 InventoryLocation invloc = new InventoryLocation;
7488
7490 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7491
7492 if (new_item)
7493 {
7494 if (new_item.GetQuantityMax() < split_quantity_new)
7495 {
7496 split_quantity_new = new_item.GetQuantityMax();
7497 }
7499 {
7502 }
7503 else
7504 {
7507 }
7508 }
7509 }
7510
7513 {
7514 SetWeightDirty();
7516
7517 if (parent)
7518 parent.OnAttachmentQuantityChangedEx(this, delta);
7519
7521 {
7523 {
7525 }
7527 {
7528 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7530 }
7531 }
7532
7533 }
7534
7537 {
7538
7539 }
7540
7543 {
7545 }
7546
7548 {
7549 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7550
7552 {
7553 if (newLevel == GameConstants.STATE_RUINED)
7554 {
7556 EntityAI parent = GetHierarchyParent();
7557 if (parent && parent.IsFireplace())
7558 {
7559 CargoBase cargo = GetInventory().GetCargo();
7560 if (cargo)
7561 {
7563 {
7565 }
7566 }
7567 }
7568 }
7569
7571 {
7572
7574 return;
7575 }
7576
7577 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7578 {
7580 }
7581 }
7582 }
7583
7584
7586 {
7587 super.OnRightClick();
7588
7590 {
7592 {
7593 if (ScriptInputUserData.CanStoreInputUserData())
7594 {
7595 vector m4[4];
7597
7598 EntityAI root = GetHierarchyRoot();
7599
7600 InventoryLocation dst = new InventoryLocation;
7602 {
7603 if (root)
7604 {
7605 root.GetTransform(m4);
7607 }
7608 else
7609 GetInventory().GetCurrentInventoryLocation(dst);
7610 }
7611 else
7612 {
7614
7615
7616 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7617 {
7618 if (root)
7619 {
7620 root.GetTransform(m4);
7622 }
7623 else
7624 GetInventory().GetCurrentInventoryLocation(dst);
7625 }
7626 else
7627 {
7628 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7629 }
7630 }
7631
7632 ScriptInputUserData ctx = new ScriptInputUserData;
7640 }
7641 }
7642 else if (!
GetGame().IsMultiplayer())
7643 {
7645 }
7646 }
7647 }
7648
7649 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7650 {
7651
7652 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7653 return false;
7654
7655 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7656 return false;
7657
7658
7660 return false;
7661
7662
7663 Magazine mag = Magazine.Cast(this);
7664 if (mag)
7665 {
7666 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7667 return false;
7668
7669 if (stack_max_limit)
7670 {
7671 Magazine other_mag = Magazine.Cast(other_item);
7672 if (other_item)
7673 {
7674 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7675 return false;
7676 }
7677
7678 }
7679 }
7680 else
7681 {
7682
7684 return false;
7685
7687 return false;
7688 }
7689
7690 PlayerBase player = null;
7691 if (CastTo(player, GetHierarchyRootPlayer()))
7692 {
7693 if (player.GetInventory().HasAttachment(this))
7694 return false;
7695
7696 if (player.IsItemsToDelete())
7697 return false;
7698 }
7699
7700 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7701 return false;
7702
7703 int slotID;
7705 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7706 return false;
7707
7708 return true;
7709 }
7710
7712 {
7714 }
7715
7717 {
7718 return m_IsResultOfSplit;
7719 }
7720
7722 {
7723 m_IsResultOfSplit = value;
7724 }
7725
7727 {
7729 }
7730
7732 {
7733 float other_item_quantity = other_item.GetQuantity();
7734 float this_free_space;
7735
7737
7739
7740 if (other_item_quantity > this_free_space)
7741 {
7742 return this_free_space;
7743 }
7744 else
7745 {
7746 return other_item_quantity;
7747 }
7748 }
7749
7751 {
7753 }
7754
7756 {
7758 return;
7759
7760 if (!IsMagazine() && other_item)
7761 {
7763 if (quantity_used != 0)
7764 {
7765 float hp1 = GetHealth01("","");
7766 float hp2 = other_item.GetHealth01("","");
7767 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7768 hpResult = hpResult / (
GetQuantity() + quantity_used);
7769
7770 hpResult *= GetMaxHealth();
7771 Math.Round(hpResult);
7772 SetHealth("", "Health", hpResult);
7773
7775 other_item.AddQuantity(-quantity_used);
7776 }
7777 }
7779 }
7780
7782 {
7783 #ifdef SERVER
7784 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7785 GetHierarchyParent().IncreaseLifetimeUp();
7786 #endif
7787 };
7788
7790 {
7791 PlayerBase p = PlayerBase.Cast(player);
7792
7793 array<int> recipesIds = p.m_Recipes;
7794 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7795 if (moduleRecipesManager)
7796 {
7797 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7798 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7799 }
7800
7801 for (int i = 0;i < recipesIds.Count(); i++)
7802 {
7803 int key = recipesIds.Get(i);
7804 string recipeName = moduleRecipesManager.GetRecipeName(key);
7806 }
7807 }
7808
7809
7810 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7811 {
7812 super.GetDebugActions(outputList);
7813
7814
7819
7820
7824
7828
7829
7832
7833
7835 {
7838 }
7839
7841
7844
7848 }
7849
7850
7851
7852
7854 {
7855 super.OnAction(action_id, player, ctx);
7856 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7857 {
7858 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7859 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7860 PlayerBase p = PlayerBase.Cast(player);
7861 if (
EActions.RECIPES_RANGE_START < 1000)
7862 {
7863 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7864 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7865 }
7866 }
7867 #ifndef SERVER
7868 else if (action_id ==
EActions.WATCH_PLAYER)
7869 {
7870 PluginDeveloper.SetDeveloperItemClientEx(player);
7871 }
7872 #endif
7874 {
7875 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7876 {
7877 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7878 OnDebugButtonPressServer(id + 1);
7879 }
7880
7881 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7882 {
7883 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7885 }
7886
7887 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7888 {
7889 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7891 }
7892
7893 else if (action_id ==
EActions.ADD_QUANTITY)
7894 {
7895 if (IsMagazine())
7896 {
7897 Magazine mag = Magazine.Cast(this);
7898 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7899 }
7900 else
7901 {
7903 }
7904
7905 if (m_EM)
7906 {
7907 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7908 }
7909
7910 }
7911
7912 else if (action_id ==
EActions.REMOVE_QUANTITY)
7913 {
7914 if (IsMagazine())
7915 {
7916 Magazine mag2 = Magazine.Cast(this);
7917 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7918 }
7919 else
7920 {
7922 }
7923 if (m_EM)
7924 {
7925 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7926 }
7927
7928 }
7929
7930 else if (action_id ==
EActions.SET_QUANTITY_0)
7931 {
7933
7934 if (m_EM)
7935 {
7936 m_EM.SetEnergy(0);
7937 }
7938 }
7939
7940 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7941 {
7943
7944 if (m_EM)
7945 {
7946 m_EM.SetEnergy(m_EM.GetEnergyMax());
7947 }
7948 }
7949
7950 else if (action_id ==
EActions.ADD_HEALTH)
7951 {
7952 AddHealth("","",GetMaxHealth("","Health")/5);
7953 }
7954 else if (action_id ==
EActions.REMOVE_HEALTH)
7955 {
7956 AddHealth("","",-GetMaxHealth("","Health")/5);
7957 }
7958 else if (action_id ==
EActions.DESTROY_HEALTH)
7959 {
7960 SetHealth01("","",0);
7961 }
7962 else if (action_id ==
EActions.WATCH_ITEM)
7963 {
7965 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7966 #ifdef DEVELOPER
7967 SetDebugDeveloper_item(this);
7968 #endif
7969 }
7970
7971 else if (action_id ==
EActions.ADD_TEMPERATURE)
7972 {
7973 AddTemperature(20);
7974
7975 }
7976
7977 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7978 {
7979 AddTemperature(-20);
7980
7981 }
7982
7983 else if (action_id ==
EActions.FLIP_FROZEN)
7984 {
7985 SetFrozen(!GetIsFrozen());
7986
7987 }
7988
7989 else if (action_id ==
EActions.ADD_WETNESS)
7990 {
7992
7993 }
7994
7995 else if (action_id ==
EActions.REMOVE_WETNESS)
7996 {
7998
7999 }
8000
8001 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8002 {
8005
8006
8007 }
8008
8009 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8010 {
8013 }
8014
8015 else if (action_id ==
EActions.MAKE_SPECIAL)
8016 {
8017 auto debugParams = DebugSpawnParams.WithPlayer(player);
8018 OnDebugSpawnEx(debugParams);
8019 }
8020
8021 else if (action_id ==
EActions.DELETE)
8022 {
8023 Delete();
8024 }
8025
8026 }
8027
8028
8029 return false;
8030 }
8031
8032
8033
8034
8038
8041
8042
8043
8045 {
8046 return false;
8047 }
8048
8049
8051 {
8052 return true;
8053 }
8054
8055
8057 {
8058 return true;
8059 }
8060
8061
8062
8064 {
8065 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8067 }
8068
8071 {
8072 return null;
8073 }
8074
8076 {
8077 return false;
8078 }
8079
8081 {
8082 return false;
8083 }
8084
8088
8089
8091 {
8092 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8093 return module_repairing.CanRepair(this, item_repair_kit);
8094 }
8095
8096
8097 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8098 {
8099 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8100 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8101 }
8102
8103
8105 {
8106
8107
8108
8109
8110
8111
8112
8113
8114 return 1;
8115 }
8116
8117
8118
8120 {
8122 }
8123
8124
8125
8127 {
8129 }
8130
8131
8140 {
8141 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8142
8143 if (player)
8144 {
8145 player.MessageStatus(text);
8146 }
8147 }
8148
8149
8158 {
8159 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8160
8161 if (player)
8162 {
8163 player.MessageAction(text);
8164 }
8165 }
8166
8167
8176 {
8177 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8178
8179 if (player)
8180 {
8181 player.MessageFriendly(text);
8182 }
8183 }
8184
8185
8194 {
8195 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8196
8197 if (player)
8198 {
8199 player.MessageImportant(text);
8200 }
8201 }
8202
8204 {
8205 return true;
8206 }
8207
8208
8209 override bool KindOf(
string tag)
8210 {
8211 bool found = false;
8212 string item_name = this.
GetType();
8215
8216 int array_size = item_tag_array.Count();
8217 for (int i = 0; i < array_size; i++)
8218 {
8219 if (item_tag_array.Get(i) == tag)
8220 {
8221 found = true;
8222 break;
8223 }
8224 }
8225 return found;
8226 }
8227
8228
8230 {
8231
8232 super.OnRPC(sender, rpc_type,ctx);
8233
8234
8235 switch (rpc_type)
8236 {
8237 #ifndef SERVER
8238 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8239 Param2<bool, string> p = new Param2<bool, string>(false, "");
8240
8242 return;
8243
8244 bool play = p.param1;
8245 string soundSet = p.param2;
8246
8247 if (play)
8248 {
8250 {
8252 {
8254 }
8255 }
8256 else
8257 {
8259 }
8260 }
8261 else
8262 {
8264 }
8265
8266 break;
8267 #endif
8268
8269 }
8270
8272 {
8274 }
8275 }
8276
8277
8278
8279
8281 {
8282 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8283 return plugin.GetID(
name);
8284 }
8285
8287 {
8288 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8289 return plugin.GetName(id);
8290 }
8291
8294 {
8295
8296
8297 int varFlags;
8298 if (!ctx.
Read(varFlags))
8299 return;
8300
8301 if (varFlags & ItemVariableFlags.FLOAT)
8302 {
8304 }
8305 }
8306
8308 {
8309
8310 super.SerializeNumericalVars(floats_out);
8311
8312
8313
8315 {
8317 }
8318
8320 {
8322 }
8323
8325 {
8327 }
8328
8330 {
8335 }
8336
8338 {
8340 }
8341 }
8342
8344 {
8345
8346 super.DeSerializeNumericalVars(floats);
8347
8348
8349 int index = 0;
8350 int mask = Math.Round(floats.Get(index));
8351
8352 index++;
8353
8355 {
8357 {
8359 }
8360 else
8361 {
8362 float quantity = floats.Get(index);
8364 }
8365 index++;
8366 }
8367
8369 {
8370 float wet = floats.Get(index);
8372 index++;
8373 }
8374
8376 {
8377 int liquidtype = Math.Round(floats.Get(index));
8379 index++;
8380 }
8381
8383 {
8385 index++;
8387 index++;
8389 index++;
8391 index++;
8392 }
8393
8395 {
8396 int cleanness = Math.Round(floats.Get(index));
8398 index++;
8399 }
8400 }
8401
8403 {
8404 super.WriteVarsToCTX(ctx);
8405
8406
8408 {
8410 }
8411
8413 {
8415 }
8416
8418 {
8420 }
8421
8423 {
8424 int r,g,b,a;
8430 }
8431
8433 {
8435 }
8436 }
8437
8439 {
8440 if (!super.ReadVarsFromCTX(ctx,version))
8441 return false;
8442
8443 int intValue;
8444 float value;
8445
8446 if (version < 140)
8447 {
8448 if (!ctx.
Read(intValue))
8449 return false;
8450
8451 m_VariablesMask = intValue;
8452 }
8453
8455 {
8456 if (!ctx.
Read(value))
8457 return false;
8458
8460 {
8462 }
8463 else
8464 {
8466 }
8467 }
8468
8469 if (version < 140)
8470 {
8472 {
8473 if (!ctx.
Read(value))
8474 return false;
8475 SetTemperatureDirect(value);
8476 }
8477 }
8478
8480 {
8481 if (!ctx.
Read(value))
8482 return false;
8484 }
8485
8487 {
8488 if (!ctx.
Read(intValue))
8489 return false;
8491 }
8492
8494 {
8495 int r,g,b,a;
8497 return false;
8499 return false;
8501 return false;
8503 return false;
8504
8506 }
8507
8509 {
8510 if (!ctx.
Read(intValue))
8511 return false;
8513 }
8514
8515 if (version >= 138 && version < 140)
8516 {
8518 {
8519 if (!ctx.
Read(intValue))
8520 return false;
8521 SetFrozen(intValue);
8522 }
8523 }
8524
8525 return true;
8526 }
8527
8528
8530 {
8533 {
8535 }
8536
8537 if (!super.OnStoreLoad(ctx, version))
8538 {
8540 return false;
8541 }
8542
8543 if (version >= 114)
8544 {
8545 bool hasQuickBarIndexSaved;
8546
8547 if (!ctx.
Read(hasQuickBarIndexSaved))
8548 {
8550 return false;
8551 }
8552
8553 if (hasQuickBarIndexSaved)
8554 {
8555 int itmQBIndex;
8556
8557
8558 if (!ctx.
Read(itmQBIndex))
8559 {
8561 return false;
8562 }
8563
8564 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8565 if (itmQBIndex != -1 && parentPlayer)
8566 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8567 }
8568 }
8569 else
8570 {
8571
8572 PlayerBase player;
8573 int itemQBIndex;
8574 if (version ==
int.
MAX)
8575 {
8576 if (!ctx.
Read(itemQBIndex))
8577 {
8579 return false;
8580 }
8581 }
8582 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8583 {
8584
8585 if (!ctx.
Read(itemQBIndex))
8586 {
8588 return false;
8589 }
8590 if (itemQBIndex != -1 && player)
8591 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8592 }
8593 }
8594
8595 if (version < 140)
8596 {
8597
8598 if (!LoadVariables(ctx, version))
8599 {
8601 return false;
8602 }
8603 }
8604
8605
8607 {
8609 return false;
8610 }
8611 if (version >= 132)
8612 {
8614 if (raib)
8615 {
8617 {
8619 return false;
8620 }
8621 }
8622 }
8623
8625 return true;
8626 }
8627
8628
8629
8631 {
8632 super.OnStoreSave(ctx);
8633
8634 PlayerBase player;
8635 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8636 {
8638
8639 int itemQBIndex = -1;
8640 itemQBIndex = player.FindQuickBarEntityIndex(this);
8641 ctx.
Write(itemQBIndex);
8642 }
8643 else
8644 {
8646 }
8647
8649
8651 if (raib)
8652 {
8654 }
8655 }
8656
8657
8659 {
8660 super.AfterStoreLoad();
8661
8663 {
8665 }
8666
8668 {
8671 }
8672 }
8673
8675 {
8676 super.EEOnAfterLoad();
8677
8679 {
8681 }
8682
8685 }
8686
8688 {
8689 return false;
8690 }
8691
8692
8693
8695 {
8697 {
8698 #ifdef PLATFORM_CONSOLE
8699
8701 {
8703 if (menu)
8704 {
8706 }
8707 }
8708 #endif
8709 }
8710
8712 {
8715 }
8716
8718 {
8719 SetWeightDirty();
8721 }
8723 {
8726 }
8727
8729 {
8732 }
8734 {
8737 }
8738
8739 super.OnVariablesSynchronized();
8740 }
8741
8742
8743
8745 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8746 {
8747 if (!IsServerCheck(allow_client))
8748 return false;
8749
8751 return false;
8752
8755
8756 if (value <= (min + 0.001))
8757 value = min;
8758
8759 if (value == min)
8760 {
8761 if (destroy_config)
8762 {
8763 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8764 if (dstr)
8765 {
8767 this.Delete();
8768 return true;
8769 }
8770 }
8771 else if (destroy_forced)
8772 {
8774 this.Delete();
8775 return true;
8776 }
8777
8779 }
8780
8783
8785 {
8787
8788 if (delta)
8790 }
8791
8793
8794 return false;
8795 }
8796
8797
8799 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8800 {
8802 }
8803
8805 {
8808 }
8809
8811 {
8814 }
8815
8818 {
8819 float value_clamped = Math.Clamp(value, 0, 1);
8821 SetQuantity(result, destroy_config, destroy_forced);
8822 }
8823
8824
8827 {
8829 }
8830
8832 {
8834 }
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8846 {
8847 int slot = -1;
8848 if (GetInventory())
8849 {
8850 InventoryLocation il = new InventoryLocation;
8851 GetInventory().GetCurrentInventoryLocation(il);
8853 }
8854
8856 }
8857
8859 {
8860 float quantity_max = 0;
8861
8863 {
8864 if (attSlotID != -1)
8865 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8866
8867 if (quantity_max <= 0)
8869 }
8870
8871 if (quantity_max <= 0)
8873
8874 return quantity_max;
8875 }
8876
8878 {
8880 }
8881
8883 {
8885 }
8886
8887
8889 {
8891 }
8892
8894 {
8896 }
8897
8899 {
8901 }
8902
8903
8905 {
8906
8907 float weightEx = GetWeightEx();
8908 float special = GetInventoryAndCargoWeight();
8909 return weightEx - special;
8910 }
8911
8912
8914 {
8916 }
8917
8919 {
8921 {
8922 #ifdef DEVELOPER
8923 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8924 {
8925 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8927 }
8928 #endif
8929
8931 }
8932 else if (HasEnergyManager())
8933 {
8934 #ifdef DEVELOPER
8935 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8936 {
8937 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8938 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8939 }
8940 #endif
8941 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8942 }
8943 else
8944 {
8945 #ifdef DEVELOPER
8946 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8947 {
8948 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8949 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8950 }
8951 #endif
8952 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
8953 }
8954 }
8955
8958 {
8959 int item_count = 0;
8961
8962 if (GetInventory().GetCargo() != NULL)
8963 {
8964 item_count = GetInventory().GetCargo().GetItemCount();
8965 }
8966
8967 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8968 {
8969 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8970 if (item)
8971 item_count += item.GetNumberOfItems();
8972 }
8973 return item_count;
8974 }
8975
8978 {
8979 float weight = 0;
8980 float wetness = 1;
8981 if (include_wetness)
8984 {
8985 weight = wetness * m_ConfigWeight;
8986 }
8988 {
8989 weight = 1;
8990 }
8991 return weight;
8992 }
8993
8994
8995
8997 {
8998 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8999 {
9000 GameInventory inv = GetInventory();
9001 array<EntityAI> items = new array<EntityAI>;
9003 for (int i = 0; i < items.Count(); i++)
9004 {
9006 if (item)
9007 {
9009 }
9010 }
9011 }
9012 }
9013
9014
9015
9016
9018 {
9019 float energy = 0;
9020 if (HasEnergyManager())
9021 {
9022 energy = GetCompEM().GetEnergy();
9023 }
9024 return energy;
9025 }
9026
9027
9029 {
9030 super.OnEnergyConsumed();
9031
9033 }
9034
9036 {
9037 super.OnEnergyAdded();
9038
9040 }
9041
9042
9044 {
9045 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9046 {
9048 {
9049 float energy_0to1 = GetCompEM().GetEnergy0To1();
9051 }
9052 }
9053 }
9054
9055
9057 {
9058 return ConfigGetFloat("heatIsolation");
9059 }
9060
9062 {
9064 }
9065
9067 {
9068 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9069 if (
GetGame().ConfigIsExisting(paramPath))
9071
9072 return 0.0;
9073 }
9074
9076 {
9077 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9078 if (
GetGame().ConfigIsExisting(paramPath))
9080
9081 return 0.0;
9082 }
9083
9084 override void SetWet(
float value,
bool allow_client =
false)
9085 {
9086 if (!IsServerCheck(allow_client))
9087 return;
9088
9091
9093
9094 m_VarWet = Math.Clamp(value, min, max);
9095
9097 {
9100 }
9101 }
9102
9103 override void AddWet(
float value)
9104 {
9106 }
9107
9109 {
9111 }
9112
9114 {
9116 }
9117
9119 {
9121 }
9122
9124 {
9126 }
9127
9129 {
9131 }
9132
9134 {
9137 if (newLevel != oldLevel)
9138 {
9140 }
9141 }
9142
9144 {
9145 SetWeightDirty();
9146 }
9147
9149 {
9150 return GetWetLevelInternal(
m_VarWet);
9151 }
9152
9153
9154
9156 {
9158 }
9159
9161 {
9163 }
9164
9166 {
9168 }
9169
9171 {
9173 }
9174
9175
9176
9178 {
9179 if (ConfigIsExisting("itemModelLength"))
9180 {
9181 return ConfigGetFloat("itemModelLength");
9182 }
9183 return 0;
9184 }
9185
9187 {
9188 if (ConfigIsExisting("itemAttachOffset"))
9189 {
9190 return ConfigGetFloat("itemAttachOffset");
9191 }
9192 return 0;
9193 }
9194
9195 override void SetCleanness(
int value,
bool allow_client =
false)
9196 {
9197 if (!IsServerCheck(allow_client))
9198 return;
9199
9201
9203
9206 }
9207
9209 {
9211 }
9212
9214 {
9215 return true;
9216 }
9217
9218
9219
9220
9222 {
9224 }
9225
9227 {
9229 }
9230
9231
9232
9233
9234 override void SetColor(
int r,
int g,
int b,
int a)
9235 {
9241 }
9243 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9244 {
9249 }
9250
9252 {
9254 }
9255
9258 {
9259 int r,g,b,a;
9261 r = r/255;
9262 g = g/255;
9263 b = b/255;
9264 a = a/255;
9265 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9266 }
9267
9268
9269
9270 override void SetLiquidType(
int value,
bool allow_client =
false)
9271 {
9272 if (!IsServerCheck(allow_client))
9273 return;
9274
9279 }
9280
9282 {
9283 return ConfigGetInt("varLiquidTypeInit");
9284 }
9285
9287 {
9289 }
9290
9292 {
9294 SetFrozen(false);
9295 }
9296
9299 {
9300 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9301 }
9302
9303
9306 {
9307 PlayerBase nplayer;
9308 if (PlayerBase.CastTo(nplayer, player))
9309 {
9311
9312 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9313 }
9314 }
9315
9316
9319 {
9320 PlayerBase nplayer;
9321 if (PlayerBase.CastTo(nplayer,player))
9322 {
9323
9324 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9325
9326 }
9327
9328
9329 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9330
9331
9332 if (HasEnergyManager())
9333 {
9334 GetCompEM().UpdatePlugState();
9335 }
9336 }
9337
9338
9340 {
9341 super.OnPlacementStarted(player);
9342
9344 }
9345
9346 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9347 {
9349 {
9350 m_AdminLog.OnPlacementComplete(player,
this);
9351 }
9352
9353 super.OnPlacementComplete(player, position, orientation);
9354 }
9355
9356
9357
9358
9359
9361 {
9363 {
9364 return true;
9365 }
9366 else
9367 {
9368 return false;
9369 }
9370 }
9371
9372
9374 {
9376 {
9378 }
9379 }
9380
9381
9383 {
9385 }
9386
9388 {
9390 }
9391
9392 override void InsertAgent(
int agent,
float count = 1)
9393 {
9394 if (count < 1)
9395 return;
9396
9398 }
9399
9402 {
9404 }
9405
9406
9408 {
9410 }
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9454 {
9456 return false;
9457 return true;
9458 }
9459
9461 {
9462
9464 }
9465
9466
9469 {
9470 super.CheckForRoofLimited(timeTresholdMS);
9471
9473 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9474 {
9475 m_PreviousRoofTestTime = time;
9476 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9477 }
9478 }
9479
9480
9482 {
9484 {
9485 return 0;
9486 }
9487
9488 if (GetInventory().GetAttachmentSlotsCount() != 0)
9489 {
9490 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9491 if (filter)
9492 return filter.GetProtectionLevel(type, false, system);
9493 else
9494 return 0;
9495 }
9496
9497 string subclassPath, entryName;
9498
9499 switch (type)
9500 {
9502 entryName = "biological";
9503 break;
9505 entryName = "chemical";
9506 break;
9507 default:
9508 entryName = "biological";
9509 break;
9510 }
9511
9512 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9513
9515 }
9516
9517
9518
9521 {
9522 if (!IsMagazine())
9524
9526 }
9527
9528
9529
9530
9531
9536 {
9537 return true;
9538 }
9539
9541 {
9543 }
9544
9545
9546
9547
9548
9550 {
9551 if (parent)
9552 {
9553 if (parent.IsInherited(DayZInfected))
9554 return true;
9555
9556 if (!parent.IsRuined())
9557 return true;
9558 }
9559
9560 return true;
9561 }
9562
9564 {
9565 if (!super.CanPutAsAttachment(parent))
9566 {
9567 return false;
9568 }
9569
9570 if (!IsRuined() && !parent.IsRuined())
9571 {
9572 return true;
9573 }
9574
9575 return false;
9576 }
9577
9579 {
9580
9581
9582
9583
9584 return super.CanReceiveItemIntoCargo(item);
9585 }
9586
9588 {
9589
9590
9591
9592
9593 GameInventory attachmentInv = attachment.GetInventory();
9595 {
9596 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9597 return false;
9598 }
9599
9600 InventoryLocation loc = new InventoryLocation();
9601 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9602 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9603 return false;
9604
9605 return super.CanReceiveAttachment(attachment, slotId);
9606 }
9607
9609 {
9610 if (!super.CanReleaseAttachment(attachment))
9611 return false;
9612
9613 return GetInventory().AreChildrenAccessible();
9614 }
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9637 {
9638 int id = muzzle_owner.GetMuzzleID();
9639 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9640
9641 if (WPOF_array)
9642 {
9643 for (int i = 0; i < WPOF_array.Count(); i++)
9644 {
9645 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9646
9647 if (WPOF)
9648 {
9649 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9650 }
9651 }
9652 }
9653 }
9654
9655
9657 {
9658 int id = muzzle_owner.GetMuzzleID();
9660
9661 if (WPOBE_array)
9662 {
9663 for (int i = 0; i < WPOBE_array.Count(); i++)
9664 {
9665 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9666
9667 if (WPOBE)
9668 {
9669 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9670 }
9671 }
9672 }
9673 }
9674
9675
9677 {
9678 int id = muzzle_owner.GetMuzzleID();
9679 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9680
9681 if (WPOOH_array)
9682 {
9683 for (int i = 0; i < WPOOH_array.Count(); i++)
9684 {
9685 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9686
9687 if (WPOOH)
9688 {
9689 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9690 }
9691 }
9692 }
9693 }
9694
9695
9697 {
9698 int id = muzzle_owner.GetMuzzleID();
9699 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9700
9701 if (WPOOH_array)
9702 {
9703 for (int i = 0; i < WPOOH_array.Count(); i++)
9704 {
9705 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9706
9707 if (WPOOH)
9708 {
9709 WPOOH.OnUpdate(weapon, 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.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9730 }
9731 }
9732 }
9733 }
9734
9735
9736
9738 {
9740 {
9741 return true;
9742 }
9743
9744 return false;
9745 }
9746
9748 {
9750 {
9751 return true;
9752 }
9753
9754 return false;
9755 }
9756
9758 {
9760 {
9761 return true;
9762 }
9763
9764 return false;
9765 }
9766
9768 {
9769 return false;
9770 }
9771
9774 {
9775 return UATimeSpent.DEFAULT_DEPLOY;
9776 }
9777
9778
9779
9780
9782 {
9784 SetSynchDirty();
9785 }
9786
9788 {
9790 }
9791
9792
9794 {
9795 return false;
9796 }
9797
9800 {
9801 string att_type = "None";
9802
9803 if (ConfigIsExisting("soundAttType"))
9804 {
9805 att_type = ConfigGetString("soundAttType");
9806 }
9807
9809 }
9810
9812 {
9814 }
9815
9816
9817
9818
9819
9823
9825 {
9828
9830 }
9831
9832
9834 {
9836 return;
9837
9839
9842
9845
9846 SoundParameters params = new SoundParameters();
9850 }
9851
9852
9854 {
9856 return;
9857
9859 SetSynchDirty();
9860
9863 }
9864
9865
9867 {
9869 return;
9870
9872 SetSynchDirty();
9873
9876 }
9877
9879 {
9881 }
9882
9884 {
9886 }
9887
9890 {
9891 if (!
GetGame().IsDedicatedServer())
9892 {
9893 if (ConfigIsExisting("attachSoundSet"))
9894 {
9895 string cfg_path = "";
9896 string soundset = "";
9898
9901 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9902 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9903
9904 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9905 {
9906 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9907 {
9908 if (cfg_slot_array[i] == slot_type)
9909 {
9910 soundset = cfg_soundset_array[i];
9911 break;
9912 }
9913 }
9914 }
9915
9916 if (soundset != "")
9917 {
9918 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9920 }
9921 }
9922 }
9923 }
9924
9926 {
9927
9928 }
9929
9930 void OnApply(PlayerBase player);
9931
9933 {
9934 return 1.0;
9935 };
9936
9938 {
9940 }
9941
9943 {
9945 }
9946
9948
9950 {
9951 SetDynamicPhysicsLifeTime(0.01);
9953 }
9954
9956 {
9957 array<string> zone_names = new array<string>;
9958 GetDamageZones(zone_names);
9959 for (int i = 0; i < zone_names.Count(); i++)
9960 {
9961 SetHealthMax(zone_names.Get(i),"Health");
9962 }
9963 SetHealthMax("","Health");
9964 }
9965
9968 {
9969 float global_health = GetHealth01("","Health");
9970 array<string> zones = new array<string>;
9971 GetDamageZones(zones);
9972
9973 for (int i = 0; i < zones.Count(); i++)
9974 {
9975 SetHealth01(zones.Get(i),"Health",global_health);
9976 }
9977 }
9978
9981 {
9982 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9983 }
9984
9986 {
9987 if (!hasRootAsPlayer)
9988 {
9989 if (refParentIB)
9990 {
9991
9992 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9993 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9994
9995 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9996 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9997
10000 }
10001 else
10002 {
10003
10006 }
10007 }
10008 }
10009
10011 {
10013 {
10014 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10015 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10016 {
10017 float heatPermCoef = 1.0;
10019 while (ent)
10020 {
10021 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10022 ent = ent.GetHierarchyParent();
10023 }
10024
10025 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10026 }
10027 }
10028 }
10029
10031 {
10032
10033 EntityAI parent = GetHierarchyParent();
10034 if (!parent)
10035 {
10036 hasParent = false;
10037 hasRootAsPlayer = false;
10038 }
10039 else
10040 {
10041 hasParent = true;
10042 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10043 refParentIB =
ItemBase.Cast(parent);
10044 }
10045 }
10046
10047 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10048 {
10049
10050 }
10051
10053 {
10054
10055 return false;
10056 }
10057
10059 {
10060
10061
10062 return false;
10063 }
10064
10066 {
10067
10068 return false;
10069 }
10070
10073 {
10074 return !GetIsFrozen() &&
IsOpen();
10075 }
10076
10078 {
10079 bool hasParent = false, hasRootAsPlayer = false;
10081
10082 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10083 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10084
10085 if (wwtu || foodDecay)
10086 {
10090
10091 if (processWetness || processTemperature || processDecay)
10092 {
10094
10095 if (processWetness)
10096 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10097
10098 if (processTemperature)
10100
10101 if (processDecay)
10102 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10103 }
10104 }
10105 }
10106
10109 {
10111 }
10112
10114 {
10117
10118 return super.GetTemperatureFreezeThreshold();
10119 }
10120
10122 {
10125
10126 return super.GetTemperatureThawThreshold();
10127 }
10128
10130 {
10133
10134 return super.GetItemOverheatThreshold();
10135 }
10136
10138 {
10140 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10141
10142 return super.GetTemperatureFreezeTime();
10143 }
10144
10146 {
10148 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10149
10150 return super.GetTemperatureThawTime();
10151 }
10152
10157
10159 {
10160 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10161 }
10162
10164 {
10165 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10166 }
10167
10170 {
10172 }
10173
10175 {
10177 }
10178
10180 {
10182 }
10183
10186 {
10187 return null;
10188 }
10189
10192 {
10193 return false;
10194 }
10195
10197 {
10199 {
10202 if (!trg)
10203 {
10205 explosive = this;
10206 }
10207
10208 explosive.PairRemote(trg);
10210
10211 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10212 trg.SetPersistentPairID(persistentID);
10213 explosive.SetPersistentPairID(persistentID);
10214
10215 return true;
10216 }
10217 return false;
10218 }
10219
10222 {
10223 float ret = 1.0;
10226 ret *= GetHealth01();
10227
10228 return ret;
10229 }
10230
10231 #ifdef DEVELOPER
10232 override void SetDebugItem()
10233 {
10234 super.SetDebugItem();
10235 _itemBase = this;
10236 }
10237
10239 {
10240 string text = super.GetDebugText();
10241
10243 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10244
10245 return text;
10246 }
10247 #endif
10248
10250 {
10251 return true;
10252 }
10253
10255
10257
10259 {
10262 }
10263
10264
10272
10288}
10289
10291{
10293 if (entity)
10294 {
10295 bool is_item = entity.IsInherited(
ItemBase);
10296 if (is_item && full_quantity)
10297 {
10300 }
10301 }
10302 else
10303 {
10305 return NULL;
10306 }
10307 return entity;
10308}
10309
10311{
10312 if (item)
10313 {
10314 if (health > 0)
10315 item.SetHealth("", "", health);
10316
10317 if (item.CanHaveTemperature())
10318 {
10320 if (item.CanFreeze())
10321 item.SetFrozen(false);
10322 }
10323
10324 if (item.HasEnergyManager())
10325 {
10326 if (quantity >= 0)
10327 {
10328 item.GetCompEM().SetEnergy0To1(quantity);
10329 }
10330 else
10331 {
10333 }
10334 }
10335 else if (item.IsMagazine())
10336 {
10337 Magazine mag = Magazine.Cast(item);
10338 if (quantity >= 0)
10339 {
10340 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10341 }
10342 else
10343 {
10345 }
10346
10347 }
10348 else
10349 {
10350 if (quantity >= 0)
10351 {
10352 item.SetQuantityNormalized(quantity, false);
10353 }
10354 else
10355 {
10357 }
10358
10359 }
10360 }
10361}
10362
10363#ifdef DEVELOPER
10365#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.