5557{
5559 {
5560 return true;
5561 }
5562};
5563
5564
5565
5567{
5571
5573
5576
5577
5578
5579
5580
5589
5595
5600
5605
5626 protected bool m_IsResultOfSplit
5627
5629
5634
5635
5636
5638
5642
5643
5644
5646
5649
5650
5651
5657
5658
5666
5669
5670
5672
5673
5675
5676
5681
5682
5687
5688
5690
5691
5693 {
5698
5699 if (!
GetGame().IsDedicatedServer())
5700 {
5702 {
5704
5706 {
5708 }
5709 }
5710
5713 }
5714
5715 m_OldLocation = null;
5716
5718 {
5720 }
5721
5722 if (ConfigIsExisting("headSelectionsToHide"))
5723 {
5726 }
5727
5729 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5730 {
5732 }
5733
5735
5736 m_IsResultOfSplit = false;
5737
5739 }
5740
5742 {
5743 super.InitItemVariables();
5744
5750 m_Count = ConfigGetInt(
"count");
5751
5754
5759
5762
5767
5779
5783
5784
5787 if (ConfigIsExisting("canBeSplit"))
5788 {
5791 }
5792
5794 if (ConfigIsExisting("itemBehaviour"))
5796
5797
5800 RegisterNetSyncVariableInt("m_VarLiquidType");
5801 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5802
5803 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5804 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5805 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5806
5807 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5808 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5809 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5810 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5811
5812 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5813 RegisterNetSyncVariableBool("m_IsTakeable");
5814 RegisterNetSyncVariableBool("m_IsHologram");
5815
5818 {
5821 }
5822
5824
5826 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5828
5829 }
5830
5832 {
5834 }
5835
5837 {
5840 {
5845 }
5846 }
5847
5848 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5849 {
5851 {
5854 }
5855
5857 }
5858
5860 {
5866 }
5867
5869
5871 {
5873
5874 if (!action)
5875 {
5876 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5877 return;
5878 }
5879
5881 if (!ai)
5882 {
5884 return;
5885 }
5886
5888 if (!action_array)
5889 {
5890 action_array = new array<ActionBase_Basic>;
5892 }
5893 if (LogManager.IsActionLogEnable())
5894 {
5895 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5896 }
5897
5898 if (action_array.Find(action) != -1)
5899 {
5900 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5901 }
5902 else
5903 {
5904 action_array.Insert(action);
5905 }
5906 }
5907
5909 {
5911 ActionBase action = player.GetActionManager().GetAction(actionName);
5914
5915 if (action_array)
5916 {
5917 action_array.RemoveItem(action);
5918 }
5919 }
5920
5921
5922
5924 {
5925 ActionOverrideData overrideData = new ActionOverrideData();
5929
5931 if (!actionMap)
5932 {
5935 }
5936
5937 actionMap.Insert(this.
Type(), overrideData);
5938
5939 }
5940
5942
5944
5945
5947 {
5950
5953
5954 string config_to_search = "CfgVehicles";
5955 string muzzle_owner_config;
5956
5958 {
5959 if (IsInherited(Weapon))
5960 config_to_search = "CfgWeapons";
5961
5962 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5963
5964 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5965
5967
5968 if (config_OnFire_subclass_count > 0)
5969 {
5970 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5971
5972 for (int i = 0; i < config_OnFire_subclass_count; i++)
5973 {
5974 string particle_class = "";
5976 string config_OnFire_entry = config_OnFire_class + particle_class;
5977 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5978 WPOF_array.Insert(WPOF);
5979 }
5980
5981
5983 }
5984 }
5985
5987 {
5988 config_to_search = "CfgWeapons";
5989 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5990
5991 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5992
5994
5995 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5996 {
5997 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5998
5999 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6000 {
6001 string particle_class2 = "";
6003 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6004 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6005 WPOBE_array.Insert(WPOBE);
6006 }
6007
6008
6010 }
6011 }
6012 }
6013
6014
6016 {
6019
6021 {
6022 string config_to_search = "CfgVehicles";
6023
6024 if (IsInherited(Weapon))
6025 config_to_search = "CfgWeapons";
6026
6027 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6028 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6029
6030 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6031 {
6032
6034
6036 {
6038 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6040 return;
6041 }
6042
6045
6046
6047
6049 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6050
6051 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6052 {
6053 string particle_class = "";
6055 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6057
6058 if (entry_type == CT_CLASS)
6059 {
6060 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6061 WPOOH_array.Insert(WPOF);
6062 }
6063 }
6064
6065
6067 }
6068 }
6069 }
6070
6072 {
6074 }
6075
6077 {
6079 {
6081
6084
6087
6088 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6089 }
6090 }
6091
6093 {
6095 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6096
6098 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6099
6101 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6102
6104 {
6106 }
6107 }
6108
6110 {
6112 }
6113
6115 {
6118 else
6120
6122 {
6125 }
6126 else
6127 {
6130
6133 }
6134
6136 }
6137
6139 {
6141 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6142 }
6143
6145 {
6147 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6149 }
6150
6152 {
6154 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6155 }
6156
6158 {
6161
6162 OverheatingParticle OP = new OverheatingParticle();
6167
6169 }
6170
6172 {
6175
6176 return -1;
6177 }
6178
6180 {
6182 {
6185
6186 for (int i = count; i > 0; --i)
6187 {
6188 int id = i - 1;
6191
6194
6195 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6196 {
6197 if (p)
6198 {
6201 }
6202 }
6203 }
6204 }
6205 }
6206
6208 {
6210 {
6212 {
6213 int id = i - 1;
6215
6216 if (OP)
6217 {
6219
6220 if (p)
6221 {
6223 }
6224
6225 delete OP;
6226 }
6227 }
6228
6231 }
6232 }
6233
6236 {
6237 return 0.0;
6238 }
6239
6240
6242 {
6243 return 250;
6244 }
6245
6247 {
6248 return 0;
6249 }
6250
6253 {
6255 return true;
6256
6257 return false;
6258 }
6259
6262 {
6265
6267 {
6269 }
6270 else
6271 {
6272
6274 }
6275
6277 }
6278
6285 {
6286 return -1;
6287 }
6288
6289
6290
6291
6293 {
6295 {
6297 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6298
6299 if (r_index >= 0)
6300 {
6301 InventoryLocation r_il = new InventoryLocation;
6302 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6303
6304 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6307 {
6308 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6309 }
6311 {
6312 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6313 }
6314
6315 }
6316
6317 player.GetHumanInventory().ClearUserReservedLocation(this);
6318 }
6319
6322 }
6323
6324
6325
6326
6328 {
6329 return ItemBase.m_DebugActionsMask;
6330 }
6331
6333 {
6334 return ItemBase.m_DebugActionsMask & mask;
6335 }
6336
6338 {
6339 ItemBase.m_DebugActionsMask = mask;
6340 }
6341
6343 {
6344 ItemBase.m_DebugActionsMask |= mask;
6345 }
6346
6348 {
6349 ItemBase.m_DebugActionsMask &= ~mask;
6350 }
6351
6353 {
6355 {
6357 }
6358 else
6359 {
6361 }
6362 }
6363
6364
6366 {
6367 if (GetEconomyProfile())
6368 {
6369 float q_max = GetEconomyProfile().GetQuantityMax();
6370 if (q_max > 0)
6371 {
6372 float q_min = GetEconomyProfile().GetQuantityMin();
6373 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6374
6376 {
6377 ComponentEnergyManager comp = GetCompEM();
6379 {
6381 }
6382 }
6384 {
6386
6387 }
6388
6389 }
6390 }
6391 }
6392
6395 {
6396 EntityAI parent = GetHierarchyParent();
6397
6398 if (parent)
6399 {
6400 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6401 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6402 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6403 }
6404 }
6405
6408 {
6409 EntityAI parent = GetHierarchyParent();
6410
6411 if (parent)
6412 {
6413 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6414 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6415 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6416 }
6417 }
6418
6420 {
6421
6422
6423
6424
6426
6428 {
6429 if (ScriptInputUserData.CanStoreInputUserData())
6430 {
6431 ScriptInputUserData ctx = new ScriptInputUserData;
6437 ctx.
Write(use_stack_max);
6440
6442 {
6443 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6444 }
6445 }
6446 }
6447 else if (!
GetGame().IsMultiplayer())
6448 {
6450 }
6451 }
6452
6454 {
6456 }
6457
6459 {
6461 }
6462
6464 {
6466 }
6467
6469 {
6470
6471 return false;
6472 }
6473
6475 {
6476 return false;
6477 }
6478
6482 {
6483 return false;
6484 }
6485
6487 {
6488 return "";
6489 }
6490
6492
6494 {
6495 return false;
6496 }
6497
6499 {
6500 return true;
6501 }
6502
6503
6504
6506 {
6507 return true;
6508 }
6509
6511 {
6512 return true;
6513 }
6514
6516 {
6517 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6519 }
6520
6522 {
6524 }
6525
6527 {
6529 if (!is_being_placed)
6531 SetSynchDirty();
6532 }
6533
6534
6536
6538 {
6540 }
6541
6543 {
6545 }
6546
6548 {
6549 return 1;
6550 }
6551
6553 {
6554 return false;
6555 }
6556
6558 {
6560 SetSynchDirty();
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
6592
6593
6594
6595
6596
6598 {
6599 super.OnMovedInsideCargo(container);
6600
6601 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6602 }
6603
6604 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6605 {
6606 super.EEItemLocationChanged(oldLoc,newLoc);
6607
6608 PlayerBase new_player = null;
6609 PlayerBase old_player = null;
6610
6611 if (newLoc.GetParent())
6612 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6613
6614 if (oldLoc.GetParent())
6615 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6616
6618 {
6619 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6620
6621 if (r_index >= 0)
6622 {
6623 InventoryLocation r_il = new InventoryLocation;
6624 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6625
6626 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6629 {
6630 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6631 }
6633 {
6634 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6635 }
6636
6637 }
6638 }
6639
6641 {
6642 if (new_player)
6643 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6644
6645 if (new_player == old_player)
6646 {
6647
6648 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6649 {
6651 {
6652 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6653 {
6654 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6655 }
6656 }
6657 else
6658 {
6659 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6660 }
6661 }
6662
6663 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6664 {
6665 int type = oldLoc.GetType();
6667 {
6668 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6669 }
6671 {
6672 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6673 }
6674 }
6675 if (!m_OldLocation)
6676 {
6677 m_OldLocation = new InventoryLocation;
6678 }
6679 m_OldLocation.Copy(oldLoc);
6680 }
6681 else
6682 {
6683 if (m_OldLocation)
6684 {
6685 m_OldLocation.Reset();
6686 }
6687 }
6688
6690 }
6691 else
6692 {
6693 if (new_player)
6694 {
6695 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6696 if (res_index >= 0)
6697 {
6698 InventoryLocation il = new InventoryLocation;
6699 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6701 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6704 {
6705 il.
GetParent().GetOnReleaseLock().Invoke(it);
6706 }
6708 {
6710 }
6711
6712 }
6713 }
6715 {
6716
6718 }
6719
6720 if (m_OldLocation)
6721 {
6722 m_OldLocation.Reset();
6723 }
6724 }
6725 }
6726
6727 override void EOnContact(IEntity other, Contact extra)
6728 {
6730 {
6731 int liquidType = -1;
6733 if (impactSpeed > 0.0)
6734 {
6736 #ifndef SERVER
6738 #else
6740 SetSynchDirty();
6741 #endif
6743 }
6744 }
6745
6746 #ifdef SERVER
6747 if (GetCompEM() && GetCompEM().IsPlugged())
6748 {
6749 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6750 GetCompEM().UnplugThis();
6751 }
6752 #endif
6753 }
6754
6756
6758 {
6760 }
6761
6763 {
6764
6765 }
6766
6768 {
6769 super.OnItemLocationChanged(old_owner, new_owner);
6770
6771 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6772 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6773
6774 if (!relatedPlayer && playerNew)
6775 relatedPlayer = playerNew;
6776
6777 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6778 {
6780 if (actionMgr)
6781 {
6782 ActionBase currentAction = actionMgr.GetRunningAction();
6783 if (currentAction)
6785 }
6786 }
6787
6788 Man ownerPlayerOld = null;
6789 Man ownerPlayerNew = null;
6790
6791 if (old_owner)
6792 {
6793 if (old_owner.
IsMan())
6794 {
6795 ownerPlayerOld = Man.Cast(old_owner);
6796 }
6797 else
6798 {
6799 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6800 }
6801 }
6802 else
6803 {
6805 {
6807
6808 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6809 {
6810 GetCompEM().UnplugThis();
6811 }
6812 }
6813 }
6814
6815 if (new_owner)
6816 {
6817 if (new_owner.
IsMan())
6818 {
6819 ownerPlayerNew = Man.Cast(new_owner);
6820 }
6821 else
6822 {
6823 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6824 }
6825 }
6826
6827 if (ownerPlayerOld != ownerPlayerNew)
6828 {
6829 if (ownerPlayerOld)
6830 {
6831 array<EntityAI> subItemsExit = new array<EntityAI>;
6833 for (int i = 0; i < subItemsExit.Count(); i++)
6834 {
6837 }
6838 }
6839
6840 if (ownerPlayerNew)
6841 {
6842 array<EntityAI> subItemsEnter = new array<EntityAI>;
6844 for (int j = 0; j < subItemsEnter.Count(); j++)
6845 {
6848 }
6849 }
6850 }
6851 else if (ownerPlayerNew != null)
6852 {
6853 PlayerBase nplayer;
6854 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6855 {
6856 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6858 for (int k = 0; k < subItemsUpdate.Count(); k++)
6859 {
6861 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6862 }
6863 }
6864 }
6865
6866 if (old_owner)
6867 old_owner.OnChildItemRemoved(this);
6868 if (new_owner)
6869 new_owner.OnChildItemReceived(this);
6870 }
6871
6872
6874 {
6875 super.EEDelete(parent);
6876 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6877 if (player)
6878 {
6880
6881 if (player.IsAlive())
6882 {
6883 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6884 if (r_index >= 0)
6885 {
6886 InventoryLocation r_il = new InventoryLocation;
6887 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6888
6889 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6892 {
6893 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6894 }
6896 {
6897 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6898 }
6899
6900 }
6901
6902 player.RemoveQuickBarEntityShortcut(this);
6903 }
6904 }
6905 }
6906
6908 {
6909 super.EEKilled(killer);
6910
6913 {
6914 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6915 {
6916 if (IsMagazine())
6917 {
6918 if (Magazine.Cast(this).GetAmmoCount() > 0)
6919 {
6921 }
6922 }
6923 else
6924 {
6926 }
6927 }
6928 }
6929 }
6930
6932 {
6933 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6934
6935 super.OnWasAttached(parent, slot_id);
6936
6939
6941 }
6942
6944 {
6945 super.OnWasDetached(parent, slot_id);
6946
6949 }
6950
6952 {
6953 int idx;
6956
6957 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6958 if (inventory_slots.Count() < 1)
6959 {
6960 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6961 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6962 }
6963 else
6964 {
6965 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6966 }
6967
6968 idx = inventory_slots.Find(slot);
6969 if (idx < 0)
6970 return "";
6971
6972 return attach_types.Get(idx);
6973 }
6974
6976 {
6977 int idx = -1;
6978 string slot;
6979
6982
6983 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6984 if (inventory_slots.Count() < 1)
6985 {
6986 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6987 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6988 }
6989 else
6990 {
6991 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6992 if (detach_types.Count() < 1)
6993 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6994 }
6995
6996 for (int i = 0; i < inventory_slots.Count(); i++)
6997 {
6998 slot = inventory_slots.Get(i);
6999 }
7000
7001 if (slot != "")
7002 {
7003 if (detach_types.Count() == 1)
7004 idx = 0;
7005 else
7006 idx = inventory_slots.Find(slot);
7007 }
7008 if (idx < 0)
7009 return "";
7010
7011 return detach_types.Get(idx);
7012 }
7013
7015 {
7016
7018
7019
7020 float min_time = 1;
7021 float max_time = 3;
7022 float delay = Math.RandomFloat(min_time, max_time);
7023
7024 explode_timer.Run(delay, this, "DoAmmoExplosion");
7025 }
7026
7028 {
7029 Magazine magazine = Magazine.Cast(this);
7030 int pop_sounds_count = 6;
7031 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7032
7033
7034 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7035 string sound_name = pop_sounds[ sound_idx ];
7037
7038
7039 magazine.ServerAddAmmoCount(-1);
7040
7041
7042 float min_temp_to_explode = 100;
7043
7044 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7045 {
7047 }
7048 }
7049
7050
7051 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7052 {
7053 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7054
7055 const int CHANCE_DAMAGE_CARGO = 4;
7056 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7057 const int CHANCE_DAMAGE_NOTHING = 2;
7058
7060 {
7061 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7062 int chances;
7063 int rnd;
7064
7065 if (GetInventory().GetCargo())
7066 {
7067 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7068 rnd = Math.RandomInt(0,chances);
7069
7070 if (rnd < CHANCE_DAMAGE_CARGO)
7071 {
7073 }
7074 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7075 {
7077 }
7078 }
7079 else
7080 {
7081 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7082 rnd = Math.RandomInt(0,chances);
7083
7084 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7085 {
7087 }
7088 }
7089 }
7090 }
7091
7093 {
7094 if (GetInventory().GetCargo())
7095 {
7096 int item_count = GetInventory().GetCargo().GetItemCount();
7097 if (item_count > 0)
7098 {
7099 int random_pick = Math.RandomInt(0, item_count);
7101 if (!item.IsExplosive())
7102 {
7103 item.AddHealth("","",damage);
7104 return true;
7105 }
7106 }
7107 }
7108 return false;
7109 }
7110
7112 {
7113 int attachment_count = GetInventory().AttachmentCount();
7114 if (attachment_count > 0)
7115 {
7116 int random_pick = Math.RandomInt(0, attachment_count);
7117 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7118 if (!attachment.IsExplosive())
7119 {
7120 attachment.AddHealth("","",damage);
7121 return true;
7122 }
7123 }
7124 return false;
7125 }
7126
7128 {
7130 }
7131
7133 {
7135 return GetInventory().CanRemoveEntity();
7136
7137 return false;
7138 }
7139
7141 {
7143 return;
7144
7146 {
7147 if (ScriptInputUserData.CanStoreInputUserData())
7148 {
7149 ScriptInputUserData ctx = new ScriptInputUserData;
7154 ctx.
Write(destination_entity);
7158 }
7159 }
7160 else if (!
GetGame().IsMultiplayer())
7161 {
7163 }
7164 }
7165
7167 {
7169 return;
7170
7171 float split_quantity_new;
7175 InventoryLocation loc = new InventoryLocation;
7176
7177 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7178 {
7180 split_quantity_new = stack_max;
7181 else
7183
7184 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7185 if (new_item)
7186 {
7187 new_item.SetResultOfSplit(true);
7188 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7190 new_item.SetQuantity(split_quantity_new);
7191 }
7192 }
7193 else if (destination_entity && slot_id == -1)
7194 {
7195 if (quantity > stack_max)
7196 split_quantity_new = stack_max;
7197 else
7198 split_quantity_new = quantity;
7199
7201 {
7204 }
7205
7206 if (new_item)
7207 {
7208 new_item.SetResultOfSplit(true);
7209 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7211 new_item.SetQuantity(split_quantity_new);
7212 }
7213 }
7214 else
7215 {
7216 if (stack_max != 0)
7217 {
7219 {
7221 }
7222
7223 if (split_quantity_new == 0)
7224 {
7225 if (!
GetGame().IsMultiplayer())
7226 player.PhysicalPredictiveDropItem(this);
7227 else
7228 player.ServerDropEntity(this);
7229 return;
7230 }
7231
7233
7234 if (new_item)
7235 {
7236 new_item.SetResultOfSplit(true);
7237 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7239 new_item.SetQuantity(stack_max);
7240 new_item.PlaceOnSurface();
7241 }
7242 }
7243 }
7244 }
7245
7247 {
7249 return;
7250
7251 float split_quantity_new;
7255 InventoryLocation loc = new InventoryLocation;
7256
7257 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7258 {
7260 split_quantity_new = stack_max;
7261 else
7263
7264 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7265 if (new_item)
7266 {
7267 new_item.SetResultOfSplit(true);
7268 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7270 new_item.SetQuantity(split_quantity_new);
7271 }
7272 }
7273 else if (destination_entity && slot_id == -1)
7274 {
7275 if (quantity > stack_max)
7276 split_quantity_new = stack_max;
7277 else
7278 split_quantity_new = quantity;
7279
7281 {
7284 }
7285
7286 if (new_item)
7287 {
7288 new_item.SetResultOfSplit(true);
7289 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7291 new_item.SetQuantity(split_quantity_new);
7292 }
7293 }
7294 else
7295 {
7296 if (stack_max != 0)
7297 {
7299 {
7301 }
7302
7304
7305 if (new_item)
7306 {
7307 new_item.SetResultOfSplit(true);
7308 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7310 new_item.SetQuantity(stack_max);
7311 new_item.PlaceOnSurface();
7312 }
7313 }
7314 }
7315 }
7316
7318 {
7320 return;
7321
7323 {
7324 if (ScriptInputUserData.CanStoreInputUserData())
7325 {
7326 ScriptInputUserData ctx = new ScriptInputUserData;
7331 dst.WriteToContext(ctx);
7333 }
7334 }
7335 else if (!
GetGame().IsMultiplayer())
7336 {
7338 }
7339 }
7340
7342 {
7344 return;
7345
7347 {
7348 if (ScriptInputUserData.CanStoreInputUserData())
7349 {
7350 ScriptInputUserData ctx = new ScriptInputUserData;
7355 ctx.
Write(destination_entity);
7361 }
7362 }
7363 else if (!
GetGame().IsMultiplayer())
7364 {
7366 }
7367 }
7368
7370 {
7372 }
7373
7375 {
7377 return this;
7378
7380 float split_quantity_new;
7382 if (dst.IsValid())
7383 {
7384 int slot_id = dst.GetSlot();
7386
7387 if (quantity > stack_max)
7388 split_quantity_new = stack_max;
7389 else
7390 split_quantity_new = quantity;
7391
7393
7394 if (new_item)
7395 {
7396 new_item.SetResultOfSplit(true);
7397 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7400 }
7401
7402 return new_item;
7403 }
7404
7405 return null;
7406 }
7407
7409 {
7411 return;
7412
7414 float split_quantity_new;
7416 if (destination_entity)
7417 {
7419 if (quantity > stackable)
7420 split_quantity_new = stackable;
7421 else
7422 split_quantity_new = quantity;
7423
7424 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7425 if (new_item)
7426 {
7427 new_item.SetResultOfSplit(true);
7428 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7430 new_item.SetQuantity(split_quantity_new);
7431 }
7432 }
7433 }
7434
7436 {
7438 return;
7439
7441 {
7442 if (ScriptInputUserData.CanStoreInputUserData())
7443 {
7444 ScriptInputUserData ctx = new ScriptInputUserData;
7449 ItemBase destination_entity =
this;
7450 ctx.
Write(destination_entity);
7454 }
7455 }
7456 else if (!
GetGame().IsMultiplayer())
7457 {
7459 }
7460 }
7461
7463 {
7465 return;
7466
7468 float split_quantity_new;
7470 if (player)
7471 {
7473 if (quantity > stackable)
7474 split_quantity_new = stackable;
7475 else
7476 split_quantity_new = quantity;
7477
7478 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7479 new_item =
ItemBase.Cast(in_hands);
7480 if (new_item)
7481 {
7482 new_item.SetResultOfSplit(true);
7483 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7485 new_item.SetQuantity(split_quantity_new);
7486 }
7487 }
7488 }
7489
7491 {
7493 return;
7494
7496 float split_quantity_new = Math.Floor(quantity * 0.5);
7497
7499
7500 if (new_item)
7501 {
7502 if (new_item.GetQuantityMax() < split_quantity_new)
7503 {
7504 split_quantity_new = new_item.GetQuantityMax();
7505 }
7506
7507 new_item.SetResultOfSplit(true);
7508 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7509
7511 {
7514 }
7515 else
7516 {
7519 }
7520 }
7521 }
7522
7524 {
7526 return;
7527
7529 float split_quantity_new = Math.Floor(quantity / 2);
7530
7531 InventoryLocation invloc = new InventoryLocation;
7533
7535 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7536
7537 if (new_item)
7538 {
7539 if (new_item.GetQuantityMax() < split_quantity_new)
7540 {
7541 split_quantity_new = new_item.GetQuantityMax();
7542 }
7544 {
7547 }
7548 else
7549 {
7552 }
7553 }
7554 }
7555
7558 {
7559 SetWeightDirty();
7561
7562 if (parent)
7563 parent.OnAttachmentQuantityChangedEx(this, delta);
7564
7566 {
7568 {
7570 }
7572 {
7573 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7575 }
7576 }
7577
7578 }
7579
7582 {
7583
7584 }
7585
7588 {
7590 }
7591
7593 {
7594 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7595
7597 {
7598 if (newLevel == GameConstants.STATE_RUINED)
7599 {
7601 EntityAI parent = GetHierarchyParent();
7602 if (parent && parent.IsFireplace())
7603 {
7604 CargoBase cargo = GetInventory().GetCargo();
7605 if (cargo)
7606 {
7608 {
7610 }
7611 }
7612 }
7613 }
7614
7616 {
7617
7619 return;
7620 }
7621
7622 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7623 {
7625 }
7626 }
7627 }
7628
7629
7631 {
7632 super.OnRightClick();
7633
7635 {
7637 {
7638 if (ScriptInputUserData.CanStoreInputUserData())
7639 {
7640 vector m4[4];
7642
7643 EntityAI root = GetHierarchyRoot();
7644
7645 InventoryLocation dst = new InventoryLocation;
7647 {
7648 if (root)
7649 {
7650 root.GetTransform(m4);
7652 }
7653 else
7654 GetInventory().GetCurrentInventoryLocation(dst);
7655 }
7656 else
7657 {
7659
7660
7661 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7662 {
7663 if (root)
7664 {
7665 root.GetTransform(m4);
7667 }
7668 else
7669 GetInventory().GetCurrentInventoryLocation(dst);
7670 }
7671 else
7672 {
7673 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7674 }
7675 }
7676
7677 ScriptInputUserData ctx = new ScriptInputUserData;
7685 }
7686 }
7687 else if (!
GetGame().IsMultiplayer())
7688 {
7690 }
7691 }
7692 }
7693
7694 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7695 {
7696
7697 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7698 return false;
7699
7700 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7701 return false;
7702
7703
7705 return false;
7706
7707
7708 Magazine mag = Magazine.Cast(this);
7709 if (mag)
7710 {
7711 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7712 return false;
7713
7714 if (stack_max_limit)
7715 {
7716 Magazine other_mag = Magazine.Cast(other_item);
7717 if (other_item)
7718 {
7719 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7720 return false;
7721 }
7722
7723 }
7724 }
7725 else
7726 {
7727
7729 return false;
7730
7732 return false;
7733 }
7734
7735 PlayerBase player = null;
7736 if (CastTo(player, GetHierarchyRootPlayer()))
7737 {
7738 if (player.GetInventory().HasAttachment(this))
7739 return false;
7740
7741 if (player.IsItemsToDelete())
7742 return false;
7743 }
7744
7745 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7746 return false;
7747
7748 int slotID;
7750 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7751 return false;
7752
7753 return true;
7754 }
7755
7757 {
7759 }
7760
7762 {
7763 return m_IsResultOfSplit;
7764 }
7765
7767 {
7768 m_IsResultOfSplit = value;
7769 }
7770
7772 {
7774 }
7775
7777 {
7778 float other_item_quantity = other_item.GetQuantity();
7779 float this_free_space;
7780
7782
7784
7785 if (other_item_quantity > this_free_space)
7786 {
7787 return this_free_space;
7788 }
7789 else
7790 {
7791 return other_item_quantity;
7792 }
7793 }
7794
7796 {
7798 }
7799
7801 {
7803 return;
7804
7805 if (!IsMagazine() && other_item)
7806 {
7808 if (quantity_used != 0)
7809 {
7810 float hp1 = GetHealth01("","");
7811 float hp2 = other_item.GetHealth01("","");
7812 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7813 hpResult = hpResult / (
GetQuantity() + quantity_used);
7814
7815 hpResult *= GetMaxHealth();
7816 Math.Round(hpResult);
7817 SetHealth("", "Health", hpResult);
7818
7820 other_item.AddQuantity(-quantity_used);
7821 }
7822 }
7824 }
7825
7827 {
7828 #ifdef SERVER
7829 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7830 GetHierarchyParent().IncreaseLifetimeUp();
7831 #endif
7832 };
7833
7835 {
7836 PlayerBase p = PlayerBase.Cast(player);
7837
7838 array<int> recipesIds = p.m_Recipes;
7839 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7840 if (moduleRecipesManager)
7841 {
7842 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7843 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7844 }
7845
7846 for (int i = 0;i < recipesIds.Count(); i++)
7847 {
7848 int key = recipesIds.Get(i);
7849 string recipeName = moduleRecipesManager.GetRecipeName(key);
7851 }
7852 }
7853
7854
7855 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7856 {
7857 super.GetDebugActions(outputList);
7858
7859
7864
7865
7869
7873
7874
7877
7878
7880 {
7883 }
7884
7886
7889
7893 }
7894
7895
7896
7897
7899 {
7900 super.OnAction(action_id, player, ctx);
7901 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7902 {
7903 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7904 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7905 PlayerBase p = PlayerBase.Cast(player);
7906 if (
EActions.RECIPES_RANGE_START < 1000)
7907 {
7908 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7909 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7910 }
7911 }
7912 #ifndef SERVER
7913 else if (action_id ==
EActions.WATCH_PLAYER)
7914 {
7915 PluginDeveloper.SetDeveloperItemClientEx(player);
7916 }
7917 #endif
7919 {
7920 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7921 {
7922 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7923 OnDebugButtonPressServer(id + 1);
7924 }
7925
7926 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7927 {
7928 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7930 }
7931
7932 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7933 {
7934 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7936 }
7937
7938 else if (action_id ==
EActions.ADD_QUANTITY)
7939 {
7940 if (IsMagazine())
7941 {
7942 Magazine mag = Magazine.Cast(this);
7943 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7944 }
7945 else
7946 {
7948 }
7949
7950 if (m_EM)
7951 {
7952 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7953 }
7954
7955 }
7956
7957 else if (action_id ==
EActions.REMOVE_QUANTITY)
7958 {
7959 if (IsMagazine())
7960 {
7961 Magazine mag2 = Magazine.Cast(this);
7962 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7963 }
7964 else
7965 {
7967 }
7968 if (m_EM)
7969 {
7970 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7971 }
7972
7973 }
7974
7975 else if (action_id ==
EActions.SET_QUANTITY_0)
7976 {
7978
7979 if (m_EM)
7980 {
7981 m_EM.SetEnergy(0);
7982 }
7983 }
7984
7985 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7986 {
7988
7989 if (m_EM)
7990 {
7991 m_EM.SetEnergy(m_EM.GetEnergyMax());
7992 }
7993 }
7994
7995 else if (action_id ==
EActions.ADD_HEALTH)
7996 {
7997 AddHealth("","",GetMaxHealth("","Health")/5);
7998 }
7999 else if (action_id ==
EActions.REMOVE_HEALTH)
8000 {
8001 AddHealth("","",-GetMaxHealth("","Health")/5);
8002 }
8003 else if (action_id ==
EActions.DESTROY_HEALTH)
8004 {
8005 SetHealth01("","",0);
8006 }
8007 else if (action_id ==
EActions.WATCH_ITEM)
8008 {
8010 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8011 #ifdef DEVELOPER
8012 SetDebugDeveloper_item(this);
8013 #endif
8014 }
8015
8016 else if (action_id ==
EActions.ADD_TEMPERATURE)
8017 {
8018 AddTemperature(20);
8019
8020 }
8021
8022 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8023 {
8024 AddTemperature(-20);
8025
8026 }
8027
8028 else if (action_id ==
EActions.FLIP_FROZEN)
8029 {
8030 SetFrozen(!GetIsFrozen());
8031
8032 }
8033
8034 else if (action_id ==
EActions.ADD_WETNESS)
8035 {
8037
8038 }
8039
8040 else if (action_id ==
EActions.REMOVE_WETNESS)
8041 {
8043
8044 }
8045
8046 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8047 {
8050
8051
8052 }
8053
8054 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8055 {
8058 }
8059
8060 else if (action_id ==
EActions.MAKE_SPECIAL)
8061 {
8062 auto debugParams = DebugSpawnParams.WithPlayer(player);
8063 OnDebugSpawnEx(debugParams);
8064 }
8065
8066 else if (action_id ==
EActions.DELETE)
8067 {
8068 Delete();
8069 }
8070
8071 }
8072
8073
8074 return false;
8075 }
8076
8077
8078
8079
8083
8086
8087
8088
8090 {
8091 return false;
8092 }
8093
8094
8096 {
8097 return true;
8098 }
8099
8100
8102 {
8103 return true;
8104 }
8105
8106
8107
8109 {
8110 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8112 }
8113
8116 {
8117 return null;
8118 }
8119
8121 {
8122 return false;
8123 }
8124
8126 {
8127 return false;
8128 }
8129
8133
8134
8136 {
8137 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8138 return module_repairing.CanRepair(this, item_repair_kit);
8139 }
8140
8141
8142 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8143 {
8144 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8145 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8146 }
8147
8148
8150 {
8151
8152
8153
8154
8155
8156
8157
8158
8159 return 1;
8160 }
8161
8162
8163
8165 {
8167 }
8168
8169
8170
8172 {
8174 }
8175
8176
8185 {
8186 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8187
8188 if (player)
8189 {
8190 player.MessageStatus(text);
8191 }
8192 }
8193
8194
8203 {
8204 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8205
8206 if (player)
8207 {
8208 player.MessageAction(text);
8209 }
8210 }
8211
8212
8221 {
8222 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8223
8224 if (player)
8225 {
8226 player.MessageFriendly(text);
8227 }
8228 }
8229
8230
8239 {
8240 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8241
8242 if (player)
8243 {
8244 player.MessageImportant(text);
8245 }
8246 }
8247
8249 {
8250 return true;
8251 }
8252
8253
8254 override bool KindOf(
string tag)
8255 {
8256 bool found = false;
8257 string item_name = this.
GetType();
8260
8261 int array_size = item_tag_array.Count();
8262 for (int i = 0; i < array_size; i++)
8263 {
8264 if (item_tag_array.Get(i) == tag)
8265 {
8266 found = true;
8267 break;
8268 }
8269 }
8270 return found;
8271 }
8272
8273
8275 {
8276
8277 super.OnRPC(sender, rpc_type,ctx);
8278
8279
8280 switch (rpc_type)
8281 {
8282 #ifndef SERVER
8283 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8284 Param2<bool, string> p = new Param2<bool, string>(false, "");
8285
8287 return;
8288
8289 bool play = p.param1;
8290 string soundSet = p.param2;
8291
8292 if (play)
8293 {
8295 {
8297 {
8299 }
8300 }
8301 else
8302 {
8304 }
8305 }
8306 else
8307 {
8309 }
8310
8311 break;
8312 #endif
8313
8314 }
8315
8317 {
8319 }
8320 }
8321
8322
8323
8324
8326 {
8327 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8328 return plugin.GetID(
name);
8329 }
8330
8332 {
8333 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8334 return plugin.GetName(id);
8335 }
8336
8339 {
8340
8341
8342 int varFlags;
8343 if (!ctx.
Read(varFlags))
8344 return;
8345
8346 if (varFlags & ItemVariableFlags.FLOAT)
8347 {
8349 }
8350 }
8351
8353 {
8354
8355 super.SerializeNumericalVars(floats_out);
8356
8357
8358
8360 {
8362 }
8363
8365 {
8367 }
8368
8370 {
8372 }
8373
8375 {
8380 }
8381
8383 {
8385 }
8386 }
8387
8389 {
8390
8391 super.DeSerializeNumericalVars(floats);
8392
8393
8394 int index = 0;
8395 int mask = Math.Round(floats.Get(index));
8396
8397 index++;
8398
8400 {
8402 {
8404 }
8405 else
8406 {
8407 float quantity = floats.Get(index);
8409 }
8410 index++;
8411 }
8412
8414 {
8415 float wet = floats.Get(index);
8417 index++;
8418 }
8419
8421 {
8422 int liquidtype = Math.Round(floats.Get(index));
8424 index++;
8425 }
8426
8428 {
8430 index++;
8432 index++;
8434 index++;
8436 index++;
8437 }
8438
8440 {
8441 int cleanness = Math.Round(floats.Get(index));
8443 index++;
8444 }
8445 }
8446
8448 {
8449 super.WriteVarsToCTX(ctx);
8450
8451
8453 {
8455 }
8456
8458 {
8460 }
8461
8463 {
8465 }
8466
8468 {
8469 int r,g,b,a;
8475 }
8476
8478 {
8480 }
8481 }
8482
8484 {
8485 if (!super.ReadVarsFromCTX(ctx,version))
8486 return false;
8487
8488 int intValue;
8489 float value;
8490
8491 if (version < 140)
8492 {
8493 if (!ctx.
Read(intValue))
8494 return false;
8495
8496 m_VariablesMask = intValue;
8497 }
8498
8500 {
8501 if (!ctx.
Read(value))
8502 return false;
8503
8505 {
8507 }
8508 else
8509 {
8511 }
8512 }
8513
8514 if (version < 140)
8515 {
8517 {
8518 if (!ctx.
Read(value))
8519 return false;
8520 SetTemperatureDirect(value);
8521 }
8522 }
8523
8525 {
8526 if (!ctx.
Read(value))
8527 return false;
8529 }
8530
8532 {
8533 if (!ctx.
Read(intValue))
8534 return false;
8536 }
8537
8539 {
8540 int r,g,b,a;
8542 return false;
8544 return false;
8546 return false;
8548 return false;
8549
8551 }
8552
8554 {
8555 if (!ctx.
Read(intValue))
8556 return false;
8558 }
8559
8560 if (version >= 138 && version < 140)
8561 {
8563 {
8564 if (!ctx.
Read(intValue))
8565 return false;
8566 SetFrozen(intValue);
8567 }
8568 }
8569
8570 return true;
8571 }
8572
8573
8575 {
8578 {
8580 }
8581
8582 if (!super.OnStoreLoad(ctx, version))
8583 {
8585 return false;
8586 }
8587
8588 if (version >= 114)
8589 {
8590 bool hasQuickBarIndexSaved;
8591
8592 if (!ctx.
Read(hasQuickBarIndexSaved))
8593 {
8595 return false;
8596 }
8597
8598 if (hasQuickBarIndexSaved)
8599 {
8600 int itmQBIndex;
8601
8602
8603 if (!ctx.
Read(itmQBIndex))
8604 {
8606 return false;
8607 }
8608
8609 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8610 if (itmQBIndex != -1 && parentPlayer)
8611 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8612 }
8613 }
8614 else
8615 {
8616
8617 PlayerBase player;
8618 int itemQBIndex;
8619 if (version ==
int.
MAX)
8620 {
8621 if (!ctx.
Read(itemQBIndex))
8622 {
8624 return false;
8625 }
8626 }
8627 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8628 {
8629
8630 if (!ctx.
Read(itemQBIndex))
8631 {
8633 return false;
8634 }
8635 if (itemQBIndex != -1 && player)
8636 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8637 }
8638 }
8639
8640 if (version < 140)
8641 {
8642
8643 if (!LoadVariables(ctx, version))
8644 {
8646 return false;
8647 }
8648 }
8649
8650
8652 {
8654 return false;
8655 }
8656 if (version >= 132)
8657 {
8659 if (raib)
8660 {
8662 {
8664 return false;
8665 }
8666 }
8667 }
8668
8670 return true;
8671 }
8672
8673
8674
8676 {
8677 super.OnStoreSave(ctx);
8678
8679 PlayerBase player;
8680 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8681 {
8683
8684 int itemQBIndex = -1;
8685 itemQBIndex = player.FindQuickBarEntityIndex(this);
8686 ctx.
Write(itemQBIndex);
8687 }
8688 else
8689 {
8691 }
8692
8694
8696 if (raib)
8697 {
8699 }
8700 }
8701
8702
8704 {
8705 super.AfterStoreLoad();
8706
8708 {
8710 }
8711
8713 {
8716 }
8717 }
8718
8720 {
8721 super.EEOnAfterLoad();
8722
8724 {
8726 }
8727
8730 }
8731
8733 {
8734 return false;
8735 }
8736
8737
8738
8740 {
8742 {
8743 #ifdef PLATFORM_CONSOLE
8744
8746 {
8748 if (menu)
8749 {
8751 }
8752 }
8753 #endif
8754 }
8755
8757 {
8760 }
8761
8763 {
8764 SetWeightDirty();
8766 }
8768 {
8771 }
8772
8774 {
8777 }
8779 {
8782 }
8783
8784 super.OnVariablesSynchronized();
8785 }
8786
8787
8788
8790 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8791 {
8792 if (!IsServerCheck(allow_client))
8793 return false;
8794
8796 return false;
8797
8800
8801 if (value <= (min + 0.001))
8802 value = min;
8803
8804 if (value == min)
8805 {
8806 if (destroy_config)
8807 {
8808 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8809 if (dstr)
8810 {
8812 this.Delete();
8813 return true;
8814 }
8815 }
8816 else if (destroy_forced)
8817 {
8819 this.Delete();
8820 return true;
8821 }
8822
8824 }
8825
8828
8830 {
8832
8833 if (delta)
8835 }
8836
8838
8839 return false;
8840 }
8841
8842
8844 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8845 {
8847 }
8848
8850 {
8853 }
8854
8856 {
8859 }
8860
8863 {
8864 float value_clamped = Math.Clamp(value, 0, 1);
8866 SetQuantity(result, destroy_config, destroy_forced);
8867 }
8868
8869
8872 {
8874 }
8875
8877 {
8879 }
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8891 {
8892 int slot = -1;
8893 if (GetInventory())
8894 {
8895 InventoryLocation il = new InventoryLocation;
8896 GetInventory().GetCurrentInventoryLocation(il);
8898 }
8899
8901 }
8902
8904 {
8905 float quantity_max = 0;
8906
8908 {
8909 if (attSlotID != -1)
8910 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8911
8912 if (quantity_max <= 0)
8914 }
8915
8916 if (quantity_max <= 0)
8918
8919 return quantity_max;
8920 }
8921
8923 {
8925 }
8926
8928 {
8930 }
8931
8932
8934 {
8936 }
8937
8939 {
8941 }
8942
8944 {
8946 }
8947
8948
8950 {
8951
8952 float weightEx = GetWeightEx();
8953 float special = GetInventoryAndCargoWeight();
8954 return weightEx - special;
8955 }
8956
8957
8959 {
8961 }
8962
8964 {
8966 {
8967 #ifdef DEVELOPER
8968 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8969 {
8970 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8972 }
8973 #endif
8974
8976 }
8977 else if (HasEnergyManager())
8978 {
8979 #ifdef DEVELOPER
8980 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8981 {
8982 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8983 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8984 }
8985 #endif
8986 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8987 }
8988 else
8989 {
8990 #ifdef DEVELOPER
8991 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8992 {
8993 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8994 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8995 }
8996 #endif
8997 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
8998 }
8999 }
9000
9003 {
9004 int item_count = 0;
9006
9007 if (GetInventory().GetCargo() != NULL)
9008 {
9009 item_count = GetInventory().GetCargo().GetItemCount();
9010 }
9011
9012 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9013 {
9014 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9015 if (item)
9016 item_count += item.GetNumberOfItems();
9017 }
9018 return item_count;
9019 }
9020
9023 {
9024 float weight = 0;
9025 float wetness = 1;
9026 if (include_wetness)
9029 {
9030 weight = wetness * m_ConfigWeight;
9031 }
9033 {
9034 weight = 1;
9035 }
9036 return weight;
9037 }
9038
9039
9040
9042 {
9043 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9044 {
9045 GameInventory inv = GetInventory();
9046 array<EntityAI> items = new array<EntityAI>;
9048 for (int i = 0; i < items.Count(); i++)
9049 {
9051 if (item)
9052 {
9054 }
9055 }
9056 }
9057 }
9058
9059
9060
9061
9063 {
9064 float energy = 0;
9065 if (HasEnergyManager())
9066 {
9067 energy = GetCompEM().GetEnergy();
9068 }
9069 return energy;
9070 }
9071
9072
9074 {
9075 super.OnEnergyConsumed();
9076
9078 }
9079
9081 {
9082 super.OnEnergyAdded();
9083
9085 }
9086
9087
9089 {
9090 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9091 {
9093 {
9094 float energy_0to1 = GetCompEM().GetEnergy0To1();
9096 }
9097 }
9098 }
9099
9100
9102 {
9103 return ConfigGetFloat("heatIsolation");
9104 }
9105
9107 {
9109 }
9110
9112 {
9113 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9114 if (
GetGame().ConfigIsExisting(paramPath))
9116
9117 return 0.0;
9118 }
9119
9121 {
9122 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9123 if (
GetGame().ConfigIsExisting(paramPath))
9125
9126 return 0.0;
9127 }
9128
9129 override void SetWet(
float value,
bool allow_client =
false)
9130 {
9131 if (!IsServerCheck(allow_client))
9132 return;
9133
9136
9138
9139 m_VarWet = Math.Clamp(value, min, max);
9140
9142 {
9145 }
9146 }
9147
9148 override void AddWet(
float value)
9149 {
9151 }
9152
9154 {
9156 }
9157
9159 {
9161 }
9162
9164 {
9166 }
9167
9169 {
9171 }
9172
9174 {
9176 }
9177
9179 {
9182 if (newLevel != oldLevel)
9183 {
9185 }
9186 }
9187
9189 {
9190 SetWeightDirty();
9191 }
9192
9194 {
9195 return GetWetLevelInternal(
m_VarWet);
9196 }
9197
9198
9199
9201 {
9203 }
9204
9206 {
9208 }
9209
9211 {
9213 }
9214
9216 {
9218 }
9219
9220
9221
9223 {
9224 if (ConfigIsExisting("itemModelLength"))
9225 {
9226 return ConfigGetFloat("itemModelLength");
9227 }
9228 return 0;
9229 }
9230
9232 {
9233 if (ConfigIsExisting("itemAttachOffset"))
9234 {
9235 return ConfigGetFloat("itemAttachOffset");
9236 }
9237 return 0;
9238 }
9239
9240 override void SetCleanness(
int value,
bool allow_client =
false)
9241 {
9242 if (!IsServerCheck(allow_client))
9243 return;
9244
9246
9248
9251 }
9252
9254 {
9256 }
9257
9259 {
9260 return true;
9261 }
9262
9263
9264
9265
9267 {
9269 }
9270
9272 {
9274 }
9275
9276
9277
9278
9279 override void SetColor(
int r,
int g,
int b,
int a)
9280 {
9286 }
9288 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9289 {
9294 }
9295
9297 {
9299 }
9300
9303 {
9304 int r,g,b,a;
9306 r = r/255;
9307 g = g/255;
9308 b = b/255;
9309 a = a/255;
9310 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9311 }
9312
9313
9314
9315 override void SetLiquidType(
int value,
bool allow_client =
false)
9316 {
9317 if (!IsServerCheck(allow_client))
9318 return;
9319
9324 }
9325
9327 {
9328 return ConfigGetInt("varLiquidTypeInit");
9329 }
9330
9332 {
9334 }
9335
9337 {
9339 SetFrozen(false);
9340 }
9341
9344 {
9345 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9346 }
9347
9348
9351 {
9352 PlayerBase nplayer;
9353 if (PlayerBase.CastTo(nplayer, player))
9354 {
9356
9357 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9358 }
9359 }
9360
9361
9364 {
9365 PlayerBase nplayer;
9366 if (PlayerBase.CastTo(nplayer,player))
9367 {
9368
9369 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9370
9371 }
9372
9373
9374 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9375
9376
9377 if (HasEnergyManager())
9378 {
9379 GetCompEM().UpdatePlugState();
9380 }
9381 }
9382
9383
9385 {
9386 super.OnPlacementStarted(player);
9387
9389 }
9390
9391 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9392 {
9394 {
9395 m_AdminLog.OnPlacementComplete(player,
this);
9396 }
9397
9398 super.OnPlacementComplete(player, position, orientation);
9399 }
9400
9401
9402
9403
9404
9406 {
9408 {
9409 return true;
9410 }
9411 else
9412 {
9413 return false;
9414 }
9415 }
9416
9417
9419 {
9421 {
9423 }
9424 }
9425
9426
9428 {
9430 }
9431
9433 {
9435 }
9436
9437 override void InsertAgent(
int agent,
float count = 1)
9438 {
9439 if (count < 1)
9440 return;
9441
9443 }
9444
9447 {
9449 }
9450
9451
9453 {
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
9493
9494
9495
9496
9497
9499 {
9501 return false;
9502 return true;
9503 }
9504
9506 {
9507
9509 }
9510
9511
9514 {
9515 super.CheckForRoofLimited(timeTresholdMS);
9516
9518 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9519 {
9520 m_PreviousRoofTestTime = time;
9521 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9522 }
9523 }
9524
9525
9527 {
9529 {
9530 return 0;
9531 }
9532
9533 if (GetInventory().GetAttachmentSlotsCount() != 0)
9534 {
9535 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9536 if (filter)
9537 return filter.GetProtectionLevel(type, false, system);
9538 else
9539 return 0;
9540 }
9541
9542 string subclassPath, entryName;
9543
9544 switch (type)
9545 {
9547 entryName = "biological";
9548 break;
9550 entryName = "chemical";
9551 break;
9552 default:
9553 entryName = "biological";
9554 break;
9555 }
9556
9557 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9558
9560 }
9561
9562
9563
9566 {
9567 if (!IsMagazine())
9569
9571 }
9572
9573
9574
9575
9576
9581 {
9582 return true;
9583 }
9584
9586 {
9588 }
9589
9590
9591
9592
9593
9595 {
9596 if (parent)
9597 {
9598 if (parent.IsInherited(DayZInfected))
9599 return true;
9600
9601 if (!parent.IsRuined())
9602 return true;
9603 }
9604
9605 return true;
9606 }
9607
9609 {
9610 if (!super.CanPutAsAttachment(parent))
9611 {
9612 return false;
9613 }
9614
9615 if (!IsRuined() && !parent.IsRuined())
9616 {
9617 return true;
9618 }
9619
9620 return false;
9621 }
9622
9624 {
9625
9626
9627
9628
9629 return super.CanReceiveItemIntoCargo(item);
9630 }
9631
9633 {
9634
9635
9636
9637
9638 GameInventory attachmentInv = attachment.GetInventory();
9640 {
9641 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9642 return false;
9643 }
9644
9645 InventoryLocation loc = new InventoryLocation();
9646 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9647 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9648 return false;
9649
9650 return super.CanReceiveAttachment(attachment, slotId);
9651 }
9652
9654 {
9655 if (!super.CanReleaseAttachment(attachment))
9656 return false;
9657
9658 return GetInventory().AreChildrenAccessible();
9659 }
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9682 {
9683 int id = muzzle_owner.GetMuzzleID();
9684 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9685
9686 if (WPOF_array)
9687 {
9688 for (int i = 0; i < WPOF_array.Count(); i++)
9689 {
9690 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9691
9692 if (WPOF)
9693 {
9694 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9695 }
9696 }
9697 }
9698 }
9699
9700
9702 {
9703 int id = muzzle_owner.GetMuzzleID();
9705
9706 if (WPOBE_array)
9707 {
9708 for (int i = 0; i < WPOBE_array.Count(); i++)
9709 {
9710 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9711
9712 if (WPOBE)
9713 {
9714 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9715 }
9716 }
9717 }
9718 }
9719
9720
9722 {
9723 int id = muzzle_owner.GetMuzzleID();
9724 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9725
9726 if (WPOOH_array)
9727 {
9728 for (int i = 0; i < WPOOH_array.Count(); i++)
9729 {
9730 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9731
9732 if (WPOOH)
9733 {
9734 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9735 }
9736 }
9737 }
9738 }
9739
9740
9742 {
9743 int id = muzzle_owner.GetMuzzleID();
9744 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9745
9746 if (WPOOH_array)
9747 {
9748 for (int i = 0; i < WPOOH_array.Count(); i++)
9749 {
9750 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9751
9752 if (WPOOH)
9753 {
9754 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9755 }
9756 }
9757 }
9758 }
9759
9760
9762 {
9763 int id = muzzle_owner.GetMuzzleID();
9764 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9765
9766 if (WPOOH_array)
9767 {
9768 for (int i = 0; i < WPOOH_array.Count(); i++)
9769 {
9770 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9771
9772 if (WPOOH)
9773 {
9774 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9775 }
9776 }
9777 }
9778 }
9779
9780
9781
9783 {
9785 {
9786 return true;
9787 }
9788
9789 return false;
9790 }
9791
9793 {
9795 {
9796 return true;
9797 }
9798
9799 return false;
9800 }
9801
9803 {
9805 {
9806 return true;
9807 }
9808
9809 return false;
9810 }
9811
9813 {
9814 return false;
9815 }
9816
9819 {
9820 return UATimeSpent.DEFAULT_DEPLOY;
9821 }
9822
9823
9824
9825
9827 {
9829 SetSynchDirty();
9830 }
9831
9833 {
9835 }
9836
9837
9839 {
9840 return false;
9841 }
9842
9845 {
9846 string att_type = "None";
9847
9848 if (ConfigIsExisting("soundAttType"))
9849 {
9850 att_type = ConfigGetString("soundAttType");
9851 }
9852
9854 }
9855
9857 {
9859 }
9860
9861
9862
9863
9864
9868
9870 {
9873
9875 }
9876
9877
9879 {
9881 return;
9882
9884
9887
9890
9891 SoundParameters params = new SoundParameters();
9895 }
9896
9897
9899 {
9901 return;
9902
9904 SetSynchDirty();
9905
9908 }
9909
9910
9912 {
9914 return;
9915
9917 SetSynchDirty();
9918
9921 }
9922
9924 {
9926 }
9927
9929 {
9931 }
9932
9935 {
9936 if (!
GetGame().IsDedicatedServer())
9937 {
9938 if (ConfigIsExisting("attachSoundSet"))
9939 {
9940 string cfg_path = "";
9941 string soundset = "";
9943
9946 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9947 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9948
9949 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9950 {
9951 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9952 {
9953 if (cfg_slot_array[i] == slot_type)
9954 {
9955 soundset = cfg_soundset_array[i];
9956 break;
9957 }
9958 }
9959 }
9960
9961 if (soundset != "")
9962 {
9963 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9965 }
9966 }
9967 }
9968 }
9969
9971 {
9972
9973 }
9974
9975 void OnApply(PlayerBase player);
9976
9978 {
9979 return 1.0;
9980 };
9981
9983 {
9985 }
9986
9988 {
9990 }
9991
9993
9995 {
9996 SetDynamicPhysicsLifeTime(0.01);
9998 }
9999
10001 {
10002 array<string> zone_names = new array<string>;
10003 GetDamageZones(zone_names);
10004 for (int i = 0; i < zone_names.Count(); i++)
10005 {
10006 SetHealthMax(zone_names.Get(i),"Health");
10007 }
10008 SetHealthMax("","Health");
10009 }
10010
10013 {
10014 float global_health = GetHealth01("","Health");
10015 array<string> zones = new array<string>;
10016 GetDamageZones(zones);
10017
10018 for (int i = 0; i < zones.Count(); i++)
10019 {
10020 SetHealth01(zones.Get(i),"Health",global_health);
10021 }
10022 }
10023
10026 {
10027 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10028 }
10029
10031 {
10032 if (!hasRootAsPlayer)
10033 {
10034 if (refParentIB)
10035 {
10036
10037 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10038 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10039
10040 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10041 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10042
10045 }
10046 else
10047 {
10048
10051 }
10052 }
10053 }
10054
10056 {
10058 {
10059 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10060 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10061 {
10062 float heatPermCoef = 1.0;
10064 while (ent)
10065 {
10066 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10067 ent = ent.GetHierarchyParent();
10068 }
10069
10070 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10071 }
10072 }
10073 }
10074
10076 {
10077
10078 EntityAI parent = GetHierarchyParent();
10079 if (!parent)
10080 {
10081 hasParent = false;
10082 hasRootAsPlayer = false;
10083 }
10084 else
10085 {
10086 hasParent = true;
10087 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10088 refParentIB =
ItemBase.Cast(parent);
10089 }
10090 }
10091
10092 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10093 {
10094
10095 }
10096
10098 {
10099
10100 return false;
10101 }
10102
10104 {
10105
10106
10107 return false;
10108 }
10109
10111 {
10112
10113 return false;
10114 }
10115
10118 {
10119 return !GetIsFrozen() &&
IsOpen();
10120 }
10121
10123 {
10124 bool hasParent = false, hasRootAsPlayer = false;
10126
10127 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10128 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10129
10130 if (wwtu || foodDecay)
10131 {
10135
10136 if (processWetness || processTemperature || processDecay)
10137 {
10139
10140 if (processWetness)
10141 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10142
10143 if (processTemperature)
10145
10146 if (processDecay)
10147 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10148 }
10149 }
10150 }
10151
10154 {
10156 }
10157
10159 {
10162
10163 return super.GetTemperatureFreezeThreshold();
10164 }
10165
10167 {
10170
10171 return super.GetTemperatureThawThreshold();
10172 }
10173
10175 {
10178
10179 return super.GetItemOverheatThreshold();
10180 }
10181
10183 {
10185 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10186
10187 return super.GetTemperatureFreezeTime();
10188 }
10189
10191 {
10193 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10194
10195 return super.GetTemperatureThawTime();
10196 }
10197
10202
10204 {
10205 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10206 }
10207
10209 {
10210 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10211 }
10212
10215 {
10217 }
10218
10220 {
10222 }
10223
10225 {
10227 }
10228
10231 {
10232 return null;
10233 }
10234
10237 {
10238 return false;
10239 }
10240
10242 {
10244 {
10247 if (!trg)
10248 {
10250 explosive = this;
10251 }
10252
10253 explosive.PairRemote(trg);
10255
10256 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10257 trg.SetPersistentPairID(persistentID);
10258 explosive.SetPersistentPairID(persistentID);
10259
10260 return true;
10261 }
10262 return false;
10263 }
10264
10267 {
10268 float ret = 1.0;
10271 ret *= GetHealth01();
10272
10273 return ret;
10274 }
10275
10276 #ifdef DEVELOPER
10277 override void SetDebugItem()
10278 {
10279 super.SetDebugItem();
10280 _itemBase = this;
10281 }
10282
10284 {
10285 string text = super.GetDebugText();
10286
10288 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10289
10290 return text;
10291 }
10292 #endif
10293
10295 {
10296 return true;
10297 }
10298
10300
10302
10304 {
10307 }
10308
10309
10317
10333}
10334
10336{
10338 if (entity)
10339 {
10340 bool is_item = entity.IsInherited(
ItemBase);
10341 if (is_item && full_quantity)
10342 {
10345 }
10346 }
10347 else
10348 {
10350 return NULL;
10351 }
10352 return entity;
10353}
10354
10356{
10357 if (item)
10358 {
10359 if (health > 0)
10360 item.SetHealth("", "", health);
10361
10362 if (item.CanHaveTemperature())
10363 {
10365 if (item.CanFreeze())
10366 item.SetFrozen(false);
10367 }
10368
10369 if (item.HasEnergyManager())
10370 {
10371 if (quantity >= 0)
10372 {
10373 item.GetCompEM().SetEnergy0To1(quantity);
10374 }
10375 else
10376 {
10378 }
10379 }
10380 else if (item.IsMagazine())
10381 {
10382 Magazine mag = Magazine.Cast(item);
10383 if (quantity >= 0)
10384 {
10385 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10386 }
10387 else
10388 {
10390 }
10391
10392 }
10393 else
10394 {
10395 if (quantity >= 0)
10396 {
10397 item.SetQuantityNormalized(quantity, false);
10398 }
10399 else
10400 {
10402 }
10403
10404 }
10405 }
10406}
10407
10408#ifdef DEVELOPER
10410#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.