5471{
5473 {
5474 return true;
5475 }
5476};
5477
5478
5479
5481{
5485
5487
5490
5491
5492
5493
5494
5503
5509
5514
5519
5540 protected bool m_IsResultOfSplit
5541
5543
5548
5549
5550
5552
5556
5557
5558
5560
5563
5564
5565
5571
5572
5580
5583
5584
5586
5587
5589
5590
5595
5596
5601
5602
5604
5605
5607 {
5612
5613 if (!
GetGame().IsDedicatedServer())
5614 {
5616 {
5618
5620 {
5622 }
5623 }
5624
5627 }
5628
5629 m_OldLocation = null;
5630
5632 {
5634 }
5635
5636 if (ConfigIsExisting("headSelectionsToHide"))
5637 {
5640 }
5641
5643 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5644 {
5646 }
5647
5649
5650 m_IsResultOfSplit = false;
5651
5653 }
5654
5656 {
5657 super.InitItemVariables();
5658
5664 m_Count = ConfigGetInt(
"count");
5665
5668
5673
5676
5681
5693
5697
5698
5701 if (ConfigIsExisting("canBeSplit"))
5702 {
5705 }
5706
5708 if (ConfigIsExisting("itemBehaviour"))
5710
5711
5714 RegisterNetSyncVariableInt("m_VarLiquidType");
5715 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5716
5717 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5718 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5719 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5720
5721 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5722 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5723 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5724 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5725
5726 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5727 RegisterNetSyncVariableBool("m_IsTakeable");
5728 RegisterNetSyncVariableBool("m_IsHologram");
5729
5732 {
5735 }
5736
5738
5740 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5742
5743 }
5744
5746 {
5748 }
5749
5751 {
5754 {
5759 }
5760 }
5761
5762 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5763 {
5765 {
5768 }
5769
5771 }
5772
5774 {
5780 }
5781
5783
5785 {
5787
5788 if (!action)
5789 {
5790 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5791 return;
5792 }
5793
5795 if (!ai)
5796 {
5798 return;
5799 }
5800
5802 if (!action_array)
5803 {
5804 action_array = new array<ActionBase_Basic>;
5806 }
5807 if (LogManager.IsActionLogEnable())
5808 {
5809 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5810 }
5811
5812 if (action_array.Find(action) != -1)
5813 {
5814 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5815 }
5816 else
5817 {
5818 action_array.Insert(action);
5819 }
5820 }
5821
5823 {
5825 ActionBase action = player.GetActionManager().GetAction(actionName);
5828
5829 if (action_array)
5830 {
5831 action_array.RemoveItem(action);
5832 }
5833 }
5834
5835
5836
5838 {
5839 ActionOverrideData overrideData = new ActionOverrideData();
5843
5845 if (!actionMap)
5846 {
5849 }
5850
5851 actionMap.Insert(this.
Type(), overrideData);
5852
5853 }
5854
5856
5858
5859
5861 {
5864
5867
5868 string config_to_search = "CfgVehicles";
5869 string muzzle_owner_config;
5870
5872 {
5873 if (IsInherited(Weapon))
5874 config_to_search = "CfgWeapons";
5875
5876 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5877
5878 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5879
5881
5882 if (config_OnFire_subclass_count > 0)
5883 {
5884 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5885
5886 for (int i = 0; i < config_OnFire_subclass_count; i++)
5887 {
5888 string particle_class = "";
5890 string config_OnFire_entry = config_OnFire_class + particle_class;
5891 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5892 WPOF_array.Insert(WPOF);
5893 }
5894
5895
5897 }
5898 }
5899
5901 {
5902 config_to_search = "CfgWeapons";
5903 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5904
5905 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5906
5908
5909 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5910 {
5911 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5912
5913 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5914 {
5915 string particle_class2 = "";
5917 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5918 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5919 WPOBE_array.Insert(WPOBE);
5920 }
5921
5922
5924 }
5925 }
5926 }
5927
5928
5930 {
5933
5935 {
5936 string config_to_search = "CfgVehicles";
5937
5938 if (IsInherited(Weapon))
5939 config_to_search = "CfgWeapons";
5940
5941 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5942 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5943
5944 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5945 {
5946
5948
5950 {
5952 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5954 return;
5955 }
5956
5959
5960
5961
5963 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5964
5965 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5966 {
5967 string particle_class = "";
5969 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5971
5972 if (entry_type == CT_CLASS)
5973 {
5974 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5975 WPOOH_array.Insert(WPOF);
5976 }
5977 }
5978
5979
5981 }
5982 }
5983 }
5984
5986 {
5988 }
5989
5991 {
5993 {
5995
5998
6001
6002 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6003 }
6004 }
6005
6007 {
6009 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6010
6012 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6013
6015 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6016
6018 {
6020 }
6021 }
6022
6024 {
6026 }
6027
6029 {
6032 else
6034
6036 {
6039 }
6040 else
6041 {
6044
6047 }
6048
6050 }
6051
6053 {
6055 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6056 }
6057
6059 {
6061 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6063 }
6064
6066 {
6068 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6069 }
6070
6072 {
6075
6076 OverheatingParticle OP = new OverheatingParticle();
6081
6083 }
6084
6086 {
6089
6090 return -1;
6091 }
6092
6094 {
6096 {
6099
6100 for (int i = count; i > 0; --i)
6101 {
6102 int id = i - 1;
6105
6108
6109 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6110 {
6111 if (p)
6112 {
6115 }
6116 }
6117 }
6118 }
6119 }
6120
6122 {
6124 {
6126 {
6127 int id = i - 1;
6129
6130 if (OP)
6131 {
6133
6134 if (p)
6135 {
6137 }
6138
6139 delete OP;
6140 }
6141 }
6142
6145 }
6146 }
6147
6150 {
6151 return 0.0;
6152 }
6153
6154
6156 {
6157 return 250;
6158 }
6159
6161 {
6162 return 0;
6163 }
6164
6167 {
6169 return true;
6170
6171 return false;
6172 }
6173
6176 {
6179
6181 {
6183 }
6184 else
6185 {
6186
6188 }
6189
6191 }
6192
6199 {
6200 return -1;
6201 }
6202
6203
6204
6205
6207 {
6209 {
6211 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6212
6213 if (r_index >= 0)
6214 {
6215 InventoryLocation r_il = new InventoryLocation;
6216 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6217
6218 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6221 {
6222 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6223 }
6225 {
6226 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6227 }
6228
6229 }
6230
6231 player.GetHumanInventory().ClearUserReservedLocation(this);
6232 }
6233
6236 }
6237
6238
6239
6240
6242 {
6243 return ItemBase.m_DebugActionsMask;
6244 }
6245
6247 {
6248 return ItemBase.m_DebugActionsMask & mask;
6249 }
6250
6252 {
6253 ItemBase.m_DebugActionsMask = mask;
6254 }
6255
6257 {
6258 ItemBase.m_DebugActionsMask |= mask;
6259 }
6260
6262 {
6263 ItemBase.m_DebugActionsMask &= ~mask;
6264 }
6265
6267 {
6269 {
6271 }
6272 else
6273 {
6275 }
6276 }
6277
6278
6280 {
6281 if (GetEconomyProfile())
6282 {
6283 float q_max = GetEconomyProfile().GetQuantityMax();
6284 if (q_max > 0)
6285 {
6286 float q_min = GetEconomyProfile().GetQuantityMin();
6287 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6288
6290 {
6291 ComponentEnergyManager comp = GetCompEM();
6293 {
6295 }
6296 }
6298 {
6300
6301 }
6302
6303 }
6304 }
6305 }
6306
6309 {
6310 EntityAI parent = GetHierarchyParent();
6311
6312 if (parent)
6313 {
6314 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6315 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6316 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6317 }
6318 }
6319
6322 {
6323 EntityAI parent = GetHierarchyParent();
6324
6325 if (parent)
6326 {
6327 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6328 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6329 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6330 }
6331 }
6332
6334 {
6335
6336
6337
6338
6340
6342 {
6343 if (ScriptInputUserData.CanStoreInputUserData())
6344 {
6345 ScriptInputUserData ctx = new ScriptInputUserData;
6351 ctx.
Write(use_stack_max);
6354
6356 {
6357 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6358 }
6359 }
6360 }
6361 else if (!
GetGame().IsMultiplayer())
6362 {
6364 }
6365 }
6366
6368 {
6370 }
6371
6373 {
6375 }
6376
6378 {
6380 }
6381
6383 {
6384
6385 return false;
6386 }
6387
6389 {
6390 return false;
6391 }
6392
6396 {
6397 return false;
6398 }
6399
6401 {
6402 return "";
6403 }
6404
6406
6408 {
6409 return false;
6410 }
6411
6413 {
6414 return true;
6415 }
6416
6417
6418
6420 {
6421 return true;
6422 }
6423
6425 {
6426 return true;
6427 }
6428
6430 {
6431 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6433 }
6434
6436 {
6438 }
6439
6441 {
6443 if (!is_being_placed)
6445 SetSynchDirty();
6446 }
6447
6448
6450
6452 {
6454 }
6455
6457 {
6459 }
6460
6462 {
6463 return 1;
6464 }
6465
6467 {
6468 return false;
6469 }
6470
6472 {
6474 SetSynchDirty();
6475 }
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6512 {
6513 super.OnMovedInsideCargo(container);
6514
6515 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6516 }
6517
6518 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6519 {
6520 super.EEItemLocationChanged(oldLoc,newLoc);
6521
6522 PlayerBase new_player = null;
6523 PlayerBase old_player = null;
6524
6525 if (newLoc.GetParent())
6526 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6527
6528 if (oldLoc.GetParent())
6529 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6530
6532 {
6533 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6534
6535 if (r_index >= 0)
6536 {
6537 InventoryLocation r_il = new InventoryLocation;
6538 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6539
6540 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6543 {
6544 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6545 }
6547 {
6548 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6549 }
6550
6551 }
6552 }
6553
6555 {
6556 if (new_player)
6557 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6558
6559 if (new_player == old_player)
6560 {
6561
6562 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6563 {
6565 {
6566 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6567 {
6568 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6569 }
6570 }
6571 else
6572 {
6573 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6574 }
6575 }
6576
6577 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6578 {
6579 int type = oldLoc.GetType();
6581 {
6582 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6583 }
6585 {
6586 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6587 }
6588 }
6589 if (!m_OldLocation)
6590 {
6591 m_OldLocation = new InventoryLocation;
6592 }
6593 m_OldLocation.Copy(oldLoc);
6594 }
6595 else
6596 {
6597 if (m_OldLocation)
6598 {
6599 m_OldLocation.Reset();
6600 }
6601 }
6602
6604 }
6605 else
6606 {
6607 if (new_player)
6608 {
6609 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6610 if (res_index >= 0)
6611 {
6612 InventoryLocation il = new InventoryLocation;
6613 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6615 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6618 {
6619 il.
GetParent().GetOnReleaseLock().Invoke(it);
6620 }
6622 {
6624 }
6625
6626 }
6627 }
6629 {
6630
6632 }
6633
6634 if (m_OldLocation)
6635 {
6636 m_OldLocation.Reset();
6637 }
6638 }
6639 }
6640
6641 override void EOnContact(IEntity other, Contact extra)
6642 {
6644 {
6645 int liquidType = -1;
6647 if (impactSpeed > 0.0)
6648 {
6650 #ifndef SERVER
6652 #else
6654 SetSynchDirty();
6655 #endif
6657 }
6658 }
6659
6660 #ifdef SERVER
6661 if (GetCompEM() && GetCompEM().IsPlugged())
6662 {
6663 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6664 GetCompEM().UnplugThis();
6665 }
6666 #endif
6667 }
6668
6670
6672 {
6674 }
6675
6677 {
6678
6679 }
6680
6682 {
6683 super.OnItemLocationChanged(old_owner, new_owner);
6684
6685 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6686 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6687
6688 if (!relatedPlayer && playerNew)
6689 relatedPlayer = playerNew;
6690
6691 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6692 {
6694 if (actionMgr)
6695 {
6696 ActionBase currentAction = actionMgr.GetRunningAction();
6697 if (currentAction)
6699 }
6700 }
6701
6702 Man ownerPlayerOld = null;
6703 Man ownerPlayerNew = null;
6704
6705 if (old_owner)
6706 {
6707 if (old_owner.
IsMan())
6708 {
6709 ownerPlayerOld = Man.Cast(old_owner);
6710 }
6711 else
6712 {
6713 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6714 }
6715 }
6716 else
6717 {
6719 {
6721
6722 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6723 {
6724 GetCompEM().UnplugThis();
6725 }
6726 }
6727 }
6728
6729 if (new_owner)
6730 {
6731 if (new_owner.
IsMan())
6732 {
6733 ownerPlayerNew = Man.Cast(new_owner);
6734 }
6735 else
6736 {
6737 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6738 }
6739 }
6740
6741 if (ownerPlayerOld != ownerPlayerNew)
6742 {
6743 if (ownerPlayerOld)
6744 {
6745 array<EntityAI> subItemsExit = new array<EntityAI>;
6747 for (int i = 0; i < subItemsExit.Count(); i++)
6748 {
6751 }
6752 }
6753
6754 if (ownerPlayerNew)
6755 {
6756 array<EntityAI> subItemsEnter = new array<EntityAI>;
6758 for (int j = 0; j < subItemsEnter.Count(); j++)
6759 {
6762 }
6763 }
6764 }
6765 else if (ownerPlayerNew != null)
6766 {
6767 PlayerBase nplayer;
6768 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6769 {
6770 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6772 for (int k = 0; k < subItemsUpdate.Count(); k++)
6773 {
6775 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6776 }
6777 }
6778 }
6779
6780 if (old_owner)
6781 old_owner.OnChildItemRemoved(this);
6782 if (new_owner)
6783 new_owner.OnChildItemReceived(this);
6784 }
6785
6786
6788 {
6789 super.EEDelete(parent);
6790 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6791 if (player)
6792 {
6794
6795 if (player.IsAlive())
6796 {
6797 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6798 if (r_index >= 0)
6799 {
6800 InventoryLocation r_il = new InventoryLocation;
6801 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6802
6803 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6806 {
6807 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6808 }
6810 {
6811 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6812 }
6813
6814 }
6815
6816 player.RemoveQuickBarEntityShortcut(this);
6817 }
6818 }
6819 }
6820
6822 {
6823 super.EEKilled(killer);
6824
6827 {
6828 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6829 {
6830 if (IsMagazine())
6831 {
6832 if (Magazine.Cast(this).GetAmmoCount() > 0)
6833 {
6835 }
6836 }
6837 else
6838 {
6840 }
6841 }
6842 }
6843 }
6844
6846 {
6847 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6848
6849 super.OnWasAttached(parent, slot_id);
6850
6853
6855 }
6856
6858 {
6859 super.OnWasDetached(parent, slot_id);
6860
6863 }
6864
6866 {
6867 int idx;
6870
6871 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6872 if (inventory_slots.Count() < 1)
6873 {
6874 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6875 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6876 }
6877 else
6878 {
6879 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6880 }
6881
6882 idx = inventory_slots.Find(slot);
6883 if (idx < 0)
6884 return "";
6885
6886 return attach_types.Get(idx);
6887 }
6888
6890 {
6891 int idx = -1;
6892 string slot;
6893
6896
6897 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6898 if (inventory_slots.Count() < 1)
6899 {
6900 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6901 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6902 }
6903 else
6904 {
6905 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6906 if (detach_types.Count() < 1)
6907 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6908 }
6909
6910 for (int i = 0; i < inventory_slots.Count(); i++)
6911 {
6912 slot = inventory_slots.Get(i);
6913 }
6914
6915 if (slot != "")
6916 {
6917 if (detach_types.Count() == 1)
6918 idx = 0;
6919 else
6920 idx = inventory_slots.Find(slot);
6921 }
6922 if (idx < 0)
6923 return "";
6924
6925 return detach_types.Get(idx);
6926 }
6927
6929 {
6930
6932
6933
6934 float min_time = 1;
6935 float max_time = 3;
6936 float delay = Math.RandomFloat(min_time, max_time);
6937
6938 explode_timer.Run(delay, this, "DoAmmoExplosion");
6939 }
6940
6942 {
6943 Magazine magazine = Magazine.Cast(this);
6944 int pop_sounds_count = 6;
6945 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6946
6947
6948 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6949 string sound_name = pop_sounds[ sound_idx ];
6951
6952
6953 magazine.ServerAddAmmoCount(-1);
6954
6955
6956 float min_temp_to_explode = 100;
6957
6958 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
6959 {
6961 }
6962 }
6963
6964
6965 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6966 {
6967 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6968
6969 const int CHANCE_DAMAGE_CARGO = 4;
6970 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6971 const int CHANCE_DAMAGE_NOTHING = 2;
6972
6974 {
6975 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6976 int chances;
6977 int rnd;
6978
6979 if (GetInventory().GetCargo())
6980 {
6981 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6982 rnd = Math.RandomInt(0,chances);
6983
6984 if (rnd < CHANCE_DAMAGE_CARGO)
6985 {
6987 }
6988 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6989 {
6991 }
6992 }
6993 else
6994 {
6995 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6996 rnd = Math.RandomInt(0,chances);
6997
6998 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6999 {
7001 }
7002 }
7003 }
7004 }
7005
7007 {
7008 if (GetInventory().GetCargo())
7009 {
7010 int item_count = GetInventory().GetCargo().GetItemCount();
7011 if (item_count > 0)
7012 {
7013 int random_pick = Math.RandomInt(0, item_count);
7015 if (!item.IsExplosive())
7016 {
7017 item.AddHealth("","",damage);
7018 return true;
7019 }
7020 }
7021 }
7022 return false;
7023 }
7024
7026 {
7027 int attachment_count = GetInventory().AttachmentCount();
7028 if (attachment_count > 0)
7029 {
7030 int random_pick = Math.RandomInt(0, attachment_count);
7031 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7032 if (!attachment.IsExplosive())
7033 {
7034 attachment.AddHealth("","",damage);
7035 return true;
7036 }
7037 }
7038 return false;
7039 }
7040
7042 {
7044 }
7045
7047 {
7049 return GetInventory().CanRemoveEntity();
7050
7051 return false;
7052 }
7053
7055 {
7056
7058 return false;
7059
7060
7062 return false;
7063
7064
7065
7067 if (delta == 0)
7068 return false;
7069
7070
7071 return true;
7072 }
7073
7075 {
7077 {
7078 if (ScriptInputUserData.CanStoreInputUserData())
7079 {
7080 ScriptInputUserData ctx = new ScriptInputUserData;
7085 ctx.
Write(destination_entity);
7089 }
7090 }
7091 else if (!
GetGame().IsMultiplayer())
7092 {
7094 }
7095 }
7096
7098 {
7099 float split_quantity_new;
7103 InventoryLocation loc = new InventoryLocation;
7104
7105 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7106 {
7108 split_quantity_new = stack_max;
7109 else
7111
7113 {
7114 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7115 if (new_item)
7116 {
7117 new_item.SetResultOfSplit(true);
7118 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7120 new_item.
SetQuantity(split_quantity_new,
false,
true);
7121 }
7122 }
7123 }
7124 else if (destination_entity && slot_id == -1)
7125 {
7126 if (quantity > stack_max)
7127 split_quantity_new = stack_max;
7128 else
7129 split_quantity_new = quantity;
7130
7132 {
7134 {
7137 }
7138
7139 if (new_item)
7140 {
7141 new_item.SetResultOfSplit(true);
7142 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7144 new_item.
SetQuantity(split_quantity_new,
false,
true);
7145 }
7146 }
7147 }
7148 else
7149 {
7150 if (stack_max != 0)
7151 {
7153 {
7155 }
7156
7157 if (split_quantity_new == 0)
7158 {
7159 if (!
GetGame().IsMultiplayer())
7160 player.PhysicalPredictiveDropItem(this);
7161 else
7162 player.ServerDropEntity(this);
7163 return;
7164 }
7165
7167 {
7169
7170 if (new_item)
7171 {
7172 new_item.SetResultOfSplit(true);
7173 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7176 new_item.PlaceOnSurface();
7177 }
7178 }
7179 }
7180 }
7181 }
7182
7184 {
7185 float split_quantity_new;
7189 InventoryLocation loc = new InventoryLocation;
7190
7191 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7192 {
7194 split_quantity_new = stack_max;
7195 else
7197
7199 {
7200 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7201 if (new_item)
7202 {
7203 new_item.SetResultOfSplit(true);
7204 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7206 new_item.
SetQuantity(split_quantity_new,
false,
true);
7207 }
7208 }
7209 }
7210 else if (destination_entity && slot_id == -1)
7211 {
7212 if (quantity > stack_max)
7213 split_quantity_new = stack_max;
7214 else
7215 split_quantity_new = quantity;
7216
7218 {
7220 {
7223 }
7224
7225 if (new_item)
7226 {
7227 new_item.SetResultOfSplit(true);
7228 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7230 new_item.
SetQuantity(split_quantity_new,
false,
true);
7231 }
7232 }
7233 }
7234 else
7235 {
7236 if (stack_max != 0)
7237 {
7239 {
7241 }
7242
7244 {
7246
7247 if (new_item)
7248 {
7249 new_item.SetResultOfSplit(true);
7250 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7253 new_item.PlaceOnSurface();
7254 }
7255 }
7256 }
7257 }
7258 }
7259
7261 {
7263 {
7264 if (ScriptInputUserData.CanStoreInputUserData())
7265 {
7266 ScriptInputUserData ctx = new ScriptInputUserData;
7271 dst.WriteToContext(ctx);
7273 }
7274 }
7275 else if (!
GetGame().IsMultiplayer())
7276 {
7278 }
7279 }
7280
7282 {
7284 {
7285 if (ScriptInputUserData.CanStoreInputUserData())
7286 {
7287 ScriptInputUserData ctx = new ScriptInputUserData;
7292 ctx.
Write(destination_entity);
7298 }
7299 }
7300 else if (!
GetGame().IsMultiplayer())
7301 {
7303 }
7304 }
7305
7307 {
7309 }
7310
7312 {
7314 float split_quantity_new;
7316 if (dst.IsValid())
7317 {
7318 int slot_id = dst.GetSlot();
7320
7321 if (quantity > stack_max)
7322 split_quantity_new = stack_max;
7323 else
7324 split_quantity_new = quantity;
7325
7327 {
7329
7330 if (new_item)
7331 {
7332 new_item.SetResultOfSplit(true);
7333 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7335 new_item.
SetQuantity(split_quantity_new,
false,
true);
7336 }
7337
7338 return new_item;
7339 }
7340 }
7341
7342 return null;
7343 }
7344
7346 {
7348 float split_quantity_new;
7350 if (destination_entity)
7351 {
7353 if (quantity > stackable)
7354 split_quantity_new = stackable;
7355 else
7356 split_quantity_new = quantity;
7357
7359 {
7360 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7361 if (new_item)
7362 {
7363 new_item.SetResultOfSplit(true);
7364 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7366 new_item.
SetQuantity(split_quantity_new,
false,
true);
7367 }
7368 }
7369 }
7370 }
7371
7373 {
7375 {
7376 if (ScriptInputUserData.CanStoreInputUserData())
7377 {
7378 ScriptInputUserData ctx = new ScriptInputUserData;
7383 ItemBase destination_entity =
this;
7384 ctx.
Write(destination_entity);
7388 }
7389 }
7390 else if (!
GetGame().IsMultiplayer())
7391 {
7393 }
7394 }
7395
7397 {
7399 float split_quantity_new;
7401 if (player)
7402 {
7404 if (quantity > stackable)
7405 split_quantity_new = stackable;
7406 else
7407 split_quantity_new = quantity;
7408
7410 {
7411 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7412 new_item =
ItemBase.Cast(in_hands);
7413 if (new_item)
7414 {
7415 new_item.SetResultOfSplit(true);
7416 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7418 new_item.SetQuantity(split_quantity_new, false, true);
7419 }
7420 }
7421 }
7422 }
7423
7425 {
7427 float split_quantity_new = Math.Floor(quantity * 0.5);
7428
7430 return;
7431
7433
7434 if (new_item)
7435 {
7436 if (new_item.GetQuantityMax() < split_quantity_new)
7437 {
7438 split_quantity_new = new_item.GetQuantityMax();
7439 }
7440
7441 new_item.SetResultOfSplit(true);
7442 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7443
7445 {
7448 }
7449 else
7450 {
7452 new_item.
SetQuantity(split_quantity_new,
false,
true);
7453 }
7454 }
7455 }
7456
7458 {
7460 float split_quantity_new = Math.Floor(quantity / 2);
7461
7463 return;
7464
7465 InventoryLocation invloc = new InventoryLocation;
7467
7469 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7470
7471 if (new_item)
7472 {
7473 if (new_item.GetQuantityMax() < split_quantity_new)
7474 {
7475 split_quantity_new = new_item.GetQuantityMax();
7476 }
7478 {
7481 }
7482 else if (split_quantity_new > 1)
7483 {
7485 new_item.
SetQuantity(split_quantity_new,
false,
true);
7486 }
7487 }
7488 }
7489
7492 {
7493 SetWeightDirty();
7495
7496 if (parent)
7497 parent.OnAttachmentQuantityChangedEx(this, delta);
7498
7500 {
7502 {
7504 }
7506 {
7507 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7509 }
7510 }
7511
7512 }
7513
7516 {
7517
7518 }
7519
7522 {
7524 }
7525
7527 {
7528 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7529
7531 {
7532 if (newLevel == GameConstants.STATE_RUINED)
7533 {
7535 EntityAI parent = GetHierarchyParent();
7536 if (parent && parent.IsFireplace())
7537 {
7538 CargoBase cargo = GetInventory().GetCargo();
7539 if (cargo)
7540 {
7542 {
7544 }
7545 }
7546 }
7547 }
7548
7550 {
7551
7553 return;
7554 }
7555
7556 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7557 {
7559 }
7560 }
7561 }
7562
7563
7565 {
7566 super.OnRightClick();
7567
7569 {
7571 {
7572 if (ScriptInputUserData.CanStoreInputUserData())
7573 {
7574 EntityAI root = GetHierarchyRoot();
7575 Man playerOwner = GetHierarchyRootPlayer();
7576 InventoryLocation dst = new InventoryLocation;
7577
7578
7579 if (!playerOwner && root && root == this)
7580 {
7582 }
7583 else
7584 {
7585
7586 GetInventory().GetCurrentInventoryLocation(dst);
7588 {
7591 {
7593 }
7594 else
7595 {
7597
7598
7599 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7600 {
7602 }
7603 else
7604 {
7605 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7606 }
7607 }
7608 }
7609 }
7610
7611 ScriptInputUserData ctx = new ScriptInputUserData;
7619 }
7620 }
7621 else if (!
GetGame().IsMultiplayer())
7622 {
7624 }
7625 }
7626 }
7627
7629 {
7630 if (root)
7631 {
7632 vector m4[4];
7633 root.GetTransform(m4);
7634 dst.SetGround(this, m4);
7635 }
7636 else
7637 {
7638 GetInventory().GetCurrentInventoryLocation(dst);
7639 }
7640 }
7641
7642 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7643 {
7644
7645 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7646 return false;
7647
7648 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7649 return false;
7650
7651
7653 return false;
7654
7655
7656 Magazine mag = Magazine.Cast(this);
7657 if (mag)
7658 {
7659 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7660 return false;
7661
7662 if (stack_max_limit)
7663 {
7664 Magazine other_mag = Magazine.Cast(other_item);
7665 if (other_item)
7666 {
7667 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7668 return false;
7669 }
7670
7671 }
7672 }
7673 else
7674 {
7675
7677 return false;
7678
7680 return false;
7681 }
7682
7683 PlayerBase player = null;
7684 if (CastTo(player, GetHierarchyRootPlayer()))
7685 {
7686 if (player.GetInventory().HasAttachment(this))
7687 return false;
7688
7689 if (player.IsItemsToDelete())
7690 return false;
7691 }
7692
7693 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7694 return false;
7695
7696 int slotID;
7698 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7699 return false;
7700
7701 return true;
7702 }
7703
7705 {
7707 }
7708
7710 {
7711 return m_IsResultOfSplit;
7712 }
7713
7715 {
7716 m_IsResultOfSplit = value;
7717 }
7718
7720 {
7722 }
7723
7725 {
7726 float other_item_quantity = other_item.GetQuantity();
7727 float this_free_space;
7728
7730
7732
7733 if (other_item_quantity > this_free_space)
7734 {
7735 return this_free_space;
7736 }
7737 else
7738 {
7739 return other_item_quantity;
7740 }
7741 }
7742
7744 {
7746 }
7747
7749 {
7751 return;
7752
7753 if (!IsMagazine() && other_item)
7754 {
7756 if (quantity_used != 0)
7757 {
7758 float hp1 = GetHealth01("","");
7759 float hp2 = other_item.GetHealth01("","");
7760 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7761 hpResult = hpResult / (
GetQuantity() + quantity_used);
7762
7763 hpResult *= GetMaxHealth();
7764 Math.Round(hpResult);
7765 SetHealth("", "Health", hpResult);
7766
7768 other_item.AddQuantity(-quantity_used);
7769 }
7770 }
7772 }
7773
7775 {
7776 #ifdef SERVER
7777 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7778 GetHierarchyParent().IncreaseLifetimeUp();
7779 #endif
7780 };
7781
7783 {
7784 PlayerBase p = PlayerBase.Cast(player);
7785
7786 array<int> recipesIds = p.m_Recipes;
7787 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7788 if (moduleRecipesManager)
7789 {
7790 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7791 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7792 }
7793
7794 for (int i = 0;i < recipesIds.Count(); i++)
7795 {
7796 int key = recipesIds.Get(i);
7797 string recipeName = moduleRecipesManager.GetRecipeName(key);
7799 }
7800 }
7801
7802
7803 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7804 {
7805 super.GetDebugActions(outputList);
7806
7807
7813
7814
7819
7824
7825
7829
7830
7832 {
7836 }
7837
7840
7841
7845
7847
7848 InventoryLocation loc = new InventoryLocation();
7849 GetInventory().GetCurrentInventoryLocation(loc);
7851 {
7852 if (Gizmo_IsSupported())
7855 }
7856
7858 }
7859
7860
7861
7862
7864 {
7865 super.OnAction(action_id, player, ctx);
7866
7868 {
7869 switch (action_id)
7870 {
7873 return true;
7876 return true;
7877 }
7878 }
7879
7881 {
7882 switch (action_id)
7883 {
7885 Delete();
7886 return true;
7887 }
7888 }
7889
7890 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7891 {
7892 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7893 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7894 PlayerBase p = PlayerBase.Cast(player);
7895 if (
EActions.RECIPES_RANGE_START < 1000)
7896 {
7897 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7898 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7899 }
7900 }
7901 #ifndef SERVER
7902 else if (action_id ==
EActions.WATCH_PLAYER)
7903 {
7904 PluginDeveloper.SetDeveloperItemClientEx(player);
7905 }
7906 #endif
7908 {
7909 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7910 {
7911 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7912 OnDebugButtonPressServer(id + 1);
7913 }
7914
7915 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7916 {
7917 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7919 }
7920
7921 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7922 {
7923 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7925 }
7926
7927 else if (action_id ==
EActions.ADD_QUANTITY)
7928 {
7929 if (IsMagazine())
7930 {
7931 Magazine mag = Magazine.Cast(this);
7932 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7933 }
7934 else
7935 {
7937 }
7938
7939 if (m_EM)
7940 {
7941 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7942 }
7943
7944 }
7945
7946 else if (action_id ==
EActions.REMOVE_QUANTITY)
7947 {
7948 if (IsMagazine())
7949 {
7950 Magazine mag2 = Magazine.Cast(this);
7951 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7952 }
7953 else
7954 {
7956 }
7957 if (m_EM)
7958 {
7959 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7960 }
7961
7962 }
7963
7964 else if (action_id ==
EActions.SET_QUANTITY_0)
7965 {
7967
7968 if (m_EM)
7969 {
7970 m_EM.SetEnergy(0);
7971 }
7972 }
7973
7974 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7975 {
7977
7978 if (m_EM)
7979 {
7980 m_EM.SetEnergy(m_EM.GetEnergyMax());
7981 }
7982 }
7983
7984 else if (action_id ==
EActions.ADD_HEALTH)
7985 {
7986 AddHealth("","",GetMaxHealth("","Health")/5);
7987 }
7988 else if (action_id ==
EActions.REMOVE_HEALTH)
7989 {
7990 AddHealth("","",-GetMaxHealth("","Health")/5);
7991 }
7992 else if (action_id ==
EActions.DESTROY_HEALTH)
7993 {
7994 SetHealth01("","",0);
7995 }
7996 else if (action_id ==
EActions.WATCH_ITEM)
7997 {
7999 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8000 #ifdef DEVELOPER
8001 SetDebugDeveloper_item(this);
8002 #endif
8003 }
8004
8005 else if (action_id ==
EActions.ADD_TEMPERATURE)
8006 {
8007 AddTemperature(20);
8008
8009 }
8010
8011 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8012 {
8013 AddTemperature(-20);
8014
8015 }
8016
8017 else if (action_id ==
EActions.FLIP_FROZEN)
8018 {
8019 SetFrozen(!GetIsFrozen());
8020
8021 }
8022
8023 else if (action_id ==
EActions.ADD_WETNESS)
8024 {
8026
8027 }
8028
8029 else if (action_id ==
EActions.REMOVE_WETNESS)
8030 {
8032
8033 }
8034
8035 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8036 {
8039
8040
8041 }
8042
8043 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8044 {
8047 }
8048
8049 else if (action_id ==
EActions.MAKE_SPECIAL)
8050 {
8051 auto debugParams = DebugSpawnParams.WithPlayer(player);
8052 OnDebugSpawnEx(debugParams);
8053 }
8054
8055 }
8056
8057
8058 return false;
8059 }
8060
8061
8062
8063
8067
8070
8071
8072
8074 {
8075 return false;
8076 }
8077
8078
8080 {
8081 return true;
8082 }
8083
8084
8086 {
8087 return true;
8088 }
8089
8090
8091
8093 {
8094 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8096 }
8097
8100 {
8101 return null;
8102 }
8103
8105 {
8106 return false;
8107 }
8108
8110 {
8111 return false;
8112 }
8113
8117
8118
8120 {
8121 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8122 return module_repairing.CanRepair(this, item_repair_kit);
8123 }
8124
8125
8126 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8127 {
8128 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8129 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8130 }
8131
8132
8134 {
8135
8136
8137
8138
8139
8140
8141
8142
8143 return 1;
8144 }
8145
8146
8147
8149 {
8151 }
8152
8153
8154
8156 {
8158 }
8159
8160
8169 {
8170 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8171
8172 if (player)
8173 {
8174 player.MessageStatus(text);
8175 }
8176 }
8177
8178
8187 {
8188 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8189
8190 if (player)
8191 {
8192 player.MessageAction(text);
8193 }
8194 }
8195
8196
8205 {
8206 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8207
8208 if (player)
8209 {
8210 player.MessageFriendly(text);
8211 }
8212 }
8213
8214
8223 {
8224 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8225
8226 if (player)
8227 {
8228 player.MessageImportant(text);
8229 }
8230 }
8231
8233 {
8234 return true;
8235 }
8236
8237
8238 override bool KindOf(
string tag)
8239 {
8240 bool found = false;
8241 string item_name = this.
GetType();
8244
8245 int array_size = item_tag_array.Count();
8246 for (int i = 0; i < array_size; i++)
8247 {
8248 if (item_tag_array.Get(i) == tag)
8249 {
8250 found = true;
8251 break;
8252 }
8253 }
8254 return found;
8255 }
8256
8257
8259 {
8260
8261 super.OnRPC(sender, rpc_type,ctx);
8262
8263
8264 switch (rpc_type)
8265 {
8266 #ifndef SERVER
8267 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8268 Param2<bool, string> p = new Param2<bool, string>(false, "");
8269
8271 return;
8272
8273 bool play = p.param1;
8274 string soundSet = p.param2;
8275
8276 if (play)
8277 {
8279 {
8281 {
8283 }
8284 }
8285 else
8286 {
8288 }
8289 }
8290 else
8291 {
8293 }
8294
8295 break;
8296 #endif
8297
8298 }
8299
8301 {
8303 }
8304 }
8305
8306
8307
8308
8310 {
8311 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8312 return plugin.GetID(
name);
8313 }
8314
8316 {
8317 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8318 return plugin.GetName(id);
8319 }
8320
8323 {
8324
8325
8326 int varFlags;
8327 if (!ctx.
Read(varFlags))
8328 return;
8329
8330 if (varFlags & ItemVariableFlags.FLOAT)
8331 {
8333 }
8334 }
8335
8337 {
8338
8339 super.SerializeNumericalVars(floats_out);
8340
8341
8342
8344 {
8346 }
8347
8349 {
8351 }
8352
8354 {
8356 }
8357
8359 {
8364 }
8365
8367 {
8369 }
8370 }
8371
8373 {
8374
8375 super.DeSerializeNumericalVars(floats);
8376
8377
8378 int index = 0;
8379 int mask = Math.Round(floats.Get(index));
8380
8381 index++;
8382
8384 {
8386 {
8388 }
8389 else
8390 {
8391 float quantity = floats.Get(index);
8393 }
8394 index++;
8395 }
8396
8398 {
8399 float wet = floats.Get(index);
8401 index++;
8402 }
8403
8405 {
8406 int liquidtype = Math.Round(floats.Get(index));
8408 index++;
8409 }
8410
8412 {
8414 index++;
8416 index++;
8418 index++;
8420 index++;
8421 }
8422
8424 {
8425 int cleanness = Math.Round(floats.Get(index));
8427 index++;
8428 }
8429 }
8430
8432 {
8433 super.WriteVarsToCTX(ctx);
8434
8435
8437 {
8439 }
8440
8442 {
8444 }
8445
8447 {
8449 }
8450
8452 {
8453 int r,g,b,a;
8459 }
8460
8462 {
8464 }
8465 }
8466
8468 {
8469 if (!super.ReadVarsFromCTX(ctx,version))
8470 return false;
8471
8472 int intValue;
8473 float value;
8474
8475 if (version < 140)
8476 {
8477 if (!ctx.
Read(intValue))
8478 return false;
8479
8480 m_VariablesMask = intValue;
8481 }
8482
8484 {
8485 if (!ctx.
Read(value))
8486 return false;
8487
8489 {
8491 }
8492 else
8493 {
8495 }
8496 }
8497
8498 if (version < 140)
8499 {
8501 {
8502 if (!ctx.
Read(value))
8503 return false;
8504 SetTemperatureDirect(value);
8505 }
8506 }
8507
8509 {
8510 if (!ctx.
Read(value))
8511 return false;
8513 }
8514
8516 {
8517 if (!ctx.
Read(intValue))
8518 return false;
8520 }
8521
8523 {
8524 int r,g,b,a;
8526 return false;
8528 return false;
8530 return false;
8532 return false;
8533
8535 }
8536
8538 {
8539 if (!ctx.
Read(intValue))
8540 return false;
8542 }
8543
8544 if (version >= 138 && version < 140)
8545 {
8547 {
8548 if (!ctx.
Read(intValue))
8549 return false;
8550 SetFrozen(intValue);
8551 }
8552 }
8553
8554 return true;
8555 }
8556
8557
8559 {
8562 {
8564 }
8565
8566 if (!super.OnStoreLoad(ctx, version))
8567 {
8569 return false;
8570 }
8571
8572 if (version >= 114)
8573 {
8574 bool hasQuickBarIndexSaved;
8575
8576 if (!ctx.
Read(hasQuickBarIndexSaved))
8577 {
8579 return false;
8580 }
8581
8582 if (hasQuickBarIndexSaved)
8583 {
8584 int itmQBIndex;
8585
8586
8587 if (!ctx.
Read(itmQBIndex))
8588 {
8590 return false;
8591 }
8592
8593 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8594 if (itmQBIndex != -1 && parentPlayer)
8595 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8596 }
8597 }
8598 else
8599 {
8600
8601 PlayerBase player;
8602 int itemQBIndex;
8603 if (version ==
int.
MAX)
8604 {
8605 if (!ctx.
Read(itemQBIndex))
8606 {
8608 return false;
8609 }
8610 }
8611 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8612 {
8613
8614 if (!ctx.
Read(itemQBIndex))
8615 {
8617 return false;
8618 }
8619 if (itemQBIndex != -1 && player)
8620 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8621 }
8622 }
8623
8624 if (version < 140)
8625 {
8626
8627 if (!LoadVariables(ctx, version))
8628 {
8630 return false;
8631 }
8632 }
8633
8634
8636 {
8638 return false;
8639 }
8640 if (version >= 132)
8641 {
8643 if (raib)
8644 {
8646 {
8648 return false;
8649 }
8650 }
8651 }
8652
8654 return true;
8655 }
8656
8657
8658
8660 {
8661 super.OnStoreSave(ctx);
8662
8663 PlayerBase player;
8664 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8665 {
8667
8668 int itemQBIndex = -1;
8669 itemQBIndex = player.FindQuickBarEntityIndex(this);
8670 ctx.
Write(itemQBIndex);
8671 }
8672 else
8673 {
8675 }
8676
8678
8680 if (raib)
8681 {
8683 }
8684 }
8685
8686
8688 {
8689 super.AfterStoreLoad();
8690
8692 {
8694 }
8695
8697 {
8700 }
8701 }
8702
8704 {
8705 super.EEOnAfterLoad();
8706
8708 {
8710 }
8711
8714 }
8715
8717 {
8718 return false;
8719 }
8720
8721
8722
8724 {
8726 {
8727 #ifdef PLATFORM_CONSOLE
8728
8730 {
8732 if (menu)
8733 {
8735 }
8736 }
8737 #endif
8738 }
8739
8741 {
8744 }
8745
8747 {
8748 SetWeightDirty();
8750 }
8752 {
8755 }
8756
8758 {
8761 }
8763 {
8766 }
8767
8768 super.OnVariablesSynchronized();
8769 }
8770
8771
8772
8774 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8775 {
8776 if (!IsServerCheck(allow_client))
8777 return false;
8778
8780 return false;
8781
8784
8785 if (value <= (min + 0.001))
8786 value = min;
8787
8788 if (value == min)
8789 {
8790 if (destroy_config)
8791 {
8792 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8793 if (dstr)
8794 {
8796 this.Delete();
8797 return true;
8798 }
8799 }
8800 else if (destroy_forced)
8801 {
8803 this.Delete();
8804 return true;
8805 }
8806
8808 }
8809
8812
8814 {
8816
8817 if (delta)
8819 }
8820
8822
8823 return false;
8824 }
8825
8826
8828 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8829 {
8831 }
8832
8834 {
8837 }
8838
8840 {
8843 }
8844
8846 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8847 {
8848 float value_clamped = Math.Clamp(value, 0, 1);
8850 SetQuantity(result, destroy_config, destroy_forced);
8851 }
8852
8853
8856 {
8858 }
8859
8861 {
8863 }
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8875 {
8876 int slot = -1;
8877 if (GetInventory())
8878 {
8879 InventoryLocation il = new InventoryLocation;
8880 GetInventory().GetCurrentInventoryLocation(il);
8882 }
8883
8885 }
8886
8888 {
8889 float quantity_max = 0;
8890
8892 {
8893 if (attSlotID != -1)
8894 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8895
8896 if (quantity_max <= 0)
8898 }
8899
8900 if (quantity_max <= 0)
8902
8903 return quantity_max;
8904 }
8905
8907 {
8909 }
8910
8912 {
8914 }
8915
8916
8918 {
8920 }
8921
8923 {
8925 }
8926
8928 {
8930 }
8931
8932
8934 {
8935
8936 float weightEx = GetWeightEx();
8937 float special = GetInventoryAndCargoWeight();
8938 return weightEx - special;
8939 }
8940
8941
8943 {
8945 }
8946
8948 {
8950 {
8951 #ifdef DEVELOPER
8952 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8953 {
8954 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8956 }
8957 #endif
8958
8960 }
8961 else if (HasEnergyManager())
8962 {
8963 #ifdef DEVELOPER
8964 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8965 {
8966 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8967 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8968 }
8969 #endif
8970 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
8971 }
8972 else
8973 {
8974 #ifdef DEVELOPER
8975 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8976 {
8977 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8978 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8979 }
8980 #endif
8981 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
8982 }
8983 }
8984
8987 {
8988 int item_count = 0;
8990
8991 if (GetInventory().GetCargo() != NULL)
8992 {
8993 item_count = GetInventory().GetCargo().GetItemCount();
8994 }
8995
8996 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8997 {
8998 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8999 if (item)
9000 item_count += item.GetNumberOfItems();
9001 }
9002 return item_count;
9003 }
9004
9007 {
9008 float weight = 0;
9009 float wetness = 1;
9010 if (include_wetness)
9013 {
9014 weight = wetness * m_ConfigWeight;
9015 }
9017 {
9018 weight = 1;
9019 }
9020 return weight;
9021 }
9022
9023
9024
9026 {
9027 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9028 {
9029 GameInventory inv = GetInventory();
9030 array<EntityAI> items = new array<EntityAI>;
9032 for (int i = 0; i < items.Count(); i++)
9033 {
9035 if (item)
9036 {
9038 }
9039 }
9040 }
9041 }
9042
9043
9044
9045
9047 {
9048 float energy = 0;
9049 if (HasEnergyManager())
9050 {
9051 energy = GetCompEM().GetEnergy();
9052 }
9053 return energy;
9054 }
9055
9056
9058 {
9059 super.OnEnergyConsumed();
9060
9062 }
9063
9065 {
9066 super.OnEnergyAdded();
9067
9069 }
9070
9071
9073 {
9074 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9075 {
9077 {
9078 float energy_0to1 = GetCompEM().GetEnergy0To1();
9080 }
9081 }
9082 }
9083
9084
9086 {
9087 return ConfigGetFloat("heatIsolation");
9088 }
9089
9091 {
9093 }
9094
9096 {
9097 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9098 if (
GetGame().ConfigIsExisting(paramPath))
9100
9101 return 0.0;
9102 }
9103
9105 {
9106 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9107 if (
GetGame().ConfigIsExisting(paramPath))
9109
9110 return 0.0;
9111 }
9112
9113 override void SetWet(
float value,
bool allow_client =
false)
9114 {
9115 if (!IsServerCheck(allow_client))
9116 return;
9117
9120
9122
9123 m_VarWet = Math.Clamp(value, min, max);
9124
9126 {
9129 }
9130 }
9131
9132 override void AddWet(
float value)
9133 {
9135 }
9136
9138 {
9140 }
9141
9143 {
9145 }
9146
9148 {
9150 }
9151
9153 {
9155 }
9156
9158 {
9160 }
9161
9163 {
9166 if (newLevel != oldLevel)
9167 {
9169 }
9170 }
9171
9173 {
9174 SetWeightDirty();
9175 }
9176
9178 {
9179 return GetWetLevelInternal(
m_VarWet);
9180 }
9181
9182
9183
9185 {
9187 }
9188
9190 {
9192 }
9193
9195 {
9197 }
9198
9200 {
9202 }
9203
9204
9205
9207 {
9208 if (ConfigIsExisting("itemModelLength"))
9209 {
9210 return ConfigGetFloat("itemModelLength");
9211 }
9212 return 0;
9213 }
9214
9216 {
9217 if (ConfigIsExisting("itemAttachOffset"))
9218 {
9219 return ConfigGetFloat("itemAttachOffset");
9220 }
9221 return 0;
9222 }
9223
9224 override void SetCleanness(
int value,
bool allow_client =
false)
9225 {
9226 if (!IsServerCheck(allow_client))
9227 return;
9228
9230
9232
9235 }
9236
9238 {
9240 }
9241
9243 {
9244 return true;
9245 }
9246
9247
9248
9249
9251 {
9253 }
9254
9256 {
9258 }
9259
9260
9261
9262
9263 override void SetColor(
int r,
int g,
int b,
int a)
9264 {
9270 }
9272 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9273 {
9278 }
9279
9281 {
9283 }
9284
9287 {
9288 int r,g,b,a;
9290 r = r/255;
9291 g = g/255;
9292 b = b/255;
9293 a = a/255;
9294 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9295 }
9296
9297
9298
9299 override void SetLiquidType(
int value,
bool allow_client =
false)
9300 {
9301 if (!IsServerCheck(allow_client))
9302 return;
9303
9308 }
9309
9311 {
9312 return ConfigGetInt("varLiquidTypeInit");
9313 }
9314
9316 {
9318 }
9319
9321 {
9323 SetFrozen(false);
9324 }
9325
9328 {
9329 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9330 }
9331
9332
9335 {
9336 PlayerBase nplayer;
9337 if (PlayerBase.CastTo(nplayer, player))
9338 {
9340
9341 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9342 }
9343 }
9344
9345
9348 {
9349 PlayerBase nplayer;
9350 if (PlayerBase.CastTo(nplayer,player))
9351 {
9352
9353 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9354
9355 }
9356
9357
9358 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9359
9360
9361 if (HasEnergyManager())
9362 {
9363 GetCompEM().UpdatePlugState();
9364 }
9365 }
9366
9367
9369 {
9370 super.OnPlacementStarted(player);
9371
9373 }
9374
9375 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9376 {
9378 {
9379 m_AdminLog.OnPlacementComplete(player,
this);
9380 }
9381
9382 super.OnPlacementComplete(player, position, orientation);
9383 }
9384
9385
9386
9387
9388
9390 {
9392 {
9393 return true;
9394 }
9395 else
9396 {
9397 return false;
9398 }
9399 }
9400
9401
9403 {
9405 {
9407 }
9408 }
9409
9410
9412 {
9414 }
9415
9417 {
9419 }
9420
9421 override void InsertAgent(
int agent,
float count = 1)
9422 {
9423 if (count < 1)
9424 return;
9425
9427 }
9428
9431 {
9433 }
9434
9435
9437 {
9439 }
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9483 {
9485 return false;
9486 return true;
9487 }
9488
9490 {
9491
9493 }
9494
9495
9498 {
9499 super.CheckForRoofLimited(timeTresholdMS);
9500
9502 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9503 {
9504 m_PreviousRoofTestTime = time;
9505 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9506 }
9507 }
9508
9509
9511 {
9513 {
9514 return 0;
9515 }
9516
9517 if (GetInventory().GetAttachmentSlotsCount() != 0)
9518 {
9519 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9520 if (filter)
9521 return filter.GetProtectionLevel(type, false, system);
9522 else
9523 return 0;
9524 }
9525
9526 string subclassPath, entryName;
9527
9528 switch (type)
9529 {
9531 entryName = "biological";
9532 break;
9534 entryName = "chemical";
9535 break;
9536 default:
9537 entryName = "biological";
9538 break;
9539 }
9540
9541 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9542
9544 }
9545
9546
9547
9550 {
9551 if (!IsMagazine())
9553
9555 }
9556
9557
9558
9559
9560
9565 {
9566 return true;
9567 }
9568
9570 {
9572 }
9573
9574
9575
9576
9577
9579 {
9580 if (parent)
9581 {
9582 if (parent.IsInherited(DayZInfected))
9583 return true;
9584
9585 if (!parent.IsRuined())
9586 return true;
9587 }
9588
9589 return true;
9590 }
9591
9593 {
9594 if (!super.CanPutAsAttachment(parent))
9595 {
9596 return false;
9597 }
9598
9599 if (!IsRuined() && !parent.IsRuined())
9600 {
9601 return true;
9602 }
9603
9604 return false;
9605 }
9606
9608 {
9609
9610
9611
9612
9613 return super.CanReceiveItemIntoCargo(item);
9614 }
9615
9617 {
9618
9619
9620
9621
9622 GameInventory attachmentInv = attachment.GetInventory();
9624 {
9625 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9626 return false;
9627 }
9628
9629 InventoryLocation loc = new InventoryLocation();
9630 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9631 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9632 return false;
9633
9634 return super.CanReceiveAttachment(attachment, slotId);
9635 }
9636
9638 {
9639 if (!super.CanReleaseAttachment(attachment))
9640 return false;
9641
9642 return GetInventory().AreChildrenAccessible();
9643 }
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9666 {
9667 int id = muzzle_owner.GetMuzzleID();
9668 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9669
9670 if (WPOF_array)
9671 {
9672 for (int i = 0; i < WPOF_array.Count(); i++)
9673 {
9674 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9675
9676 if (WPOF)
9677 {
9678 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9679 }
9680 }
9681 }
9682 }
9683
9684
9686 {
9687 int id = muzzle_owner.GetMuzzleID();
9689
9690 if (WPOBE_array)
9691 {
9692 for (int i = 0; i < WPOBE_array.Count(); i++)
9693 {
9694 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9695
9696 if (WPOBE)
9697 {
9698 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9699 }
9700 }
9701 }
9702 }
9703
9704
9706 {
9707 int id = muzzle_owner.GetMuzzleID();
9708 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9709
9710 if (WPOOH_array)
9711 {
9712 for (int i = 0; i < WPOOH_array.Count(); i++)
9713 {
9714 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9715
9716 if (WPOOH)
9717 {
9718 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9719 }
9720 }
9721 }
9722 }
9723
9724
9726 {
9727 int id = muzzle_owner.GetMuzzleID();
9728 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9729
9730 if (WPOOH_array)
9731 {
9732 for (int i = 0; i < WPOOH_array.Count(); i++)
9733 {
9734 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9735
9736 if (WPOOH)
9737 {
9738 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9739 }
9740 }
9741 }
9742 }
9743
9744
9746 {
9747 int id = muzzle_owner.GetMuzzleID();
9748 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9749
9750 if (WPOOH_array)
9751 {
9752 for (int i = 0; i < WPOOH_array.Count(); i++)
9753 {
9754 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9755
9756 if (WPOOH)
9757 {
9758 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9759 }
9760 }
9761 }
9762 }
9763
9764
9765
9767 {
9769 {
9770 return true;
9771 }
9772
9773 return false;
9774 }
9775
9777 {
9779 {
9780 return true;
9781 }
9782
9783 return false;
9784 }
9785
9787 {
9789 {
9790 return true;
9791 }
9792
9793 return false;
9794 }
9795
9797 {
9798 return false;
9799 }
9800
9803 {
9804 return UATimeSpent.DEFAULT_DEPLOY;
9805 }
9806
9807
9808
9809
9811 {
9813 SetSynchDirty();
9814 }
9815
9817 {
9819 }
9820
9821
9823 {
9824 return false;
9825 }
9826
9829 {
9830 string att_type = "None";
9831
9832 if (ConfigIsExisting("soundAttType"))
9833 {
9834 att_type = ConfigGetString("soundAttType");
9835 }
9836
9838 }
9839
9841 {
9843 }
9844
9845
9846
9847
9848
9854
9856 {
9859
9861 }
9862
9863
9865 {
9867 return;
9868
9870
9873
9876
9877 SoundParameters params = new SoundParameters();
9881 }
9882
9883
9885 {
9887 return;
9888
9890 SetSynchDirty();
9891
9894 }
9895
9896
9898 {
9900 return;
9901
9903 SetSynchDirty();
9904
9907 }
9908
9910 {
9912 }
9913
9915 {
9917 }
9918
9921 {
9922 if (!
GetGame().IsDedicatedServer())
9923 {
9924 if (ConfigIsExisting("attachSoundSet"))
9925 {
9926 string cfg_path = "";
9927 string soundset = "";
9929
9932 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9933 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9934
9935 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9936 {
9937 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9938 {
9939 if (cfg_slot_array[i] == slot_type)
9940 {
9941 soundset = cfg_soundset_array[i];
9942 break;
9943 }
9944 }
9945 }
9946
9947 if (soundset != "")
9948 {
9949 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9951 }
9952 }
9953 }
9954 }
9955
9957 {
9958
9959 }
9960
9961 void OnApply(PlayerBase player);
9962
9964 {
9965 return 1.0;
9966 };
9967
9969 {
9971 }
9972
9974 {
9976 }
9977
9979
9981 {
9982 SetDynamicPhysicsLifeTime(0.01);
9984 }
9985
9987 {
9988 array<string> zone_names = new array<string>;
9989 GetDamageZones(zone_names);
9990 for (int i = 0; i < zone_names.Count(); i++)
9991 {
9992 SetHealthMax(zone_names.Get(i),"Health");
9993 }
9994 SetHealthMax("","Health");
9995 }
9996
9999 {
10000 float global_health = GetHealth01("","Health");
10001 array<string> zones = new array<string>;
10002 GetDamageZones(zones);
10003
10004 for (int i = 0; i < zones.Count(); i++)
10005 {
10006 SetHealth01(zones.Get(i),"Health",global_health);
10007 }
10008 }
10009
10012 {
10013 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10014 }
10015
10017 {
10018 if (!hasRootAsPlayer)
10019 {
10020 if (refParentIB)
10021 {
10022
10023 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10024 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10025
10026 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10027 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10028
10031 }
10032 else
10033 {
10034
10037 }
10038 }
10039 }
10040
10042 {
10044 {
10045 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10046 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10047 {
10048 float heatPermCoef = 1.0;
10050 while (ent)
10051 {
10052 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10053 ent = ent.GetHierarchyParent();
10054 }
10055
10056 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10057 }
10058 }
10059 }
10060
10062 {
10063
10064 EntityAI parent = GetHierarchyParent();
10065 if (!parent)
10066 {
10067 hasParent = false;
10068 hasRootAsPlayer = false;
10069 }
10070 else
10071 {
10072 hasParent = true;
10073 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10074 refParentIB =
ItemBase.Cast(parent);
10075 }
10076 }
10077
10078 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10079 {
10080
10081 }
10082
10084 {
10085
10086 return false;
10087 }
10088
10090 {
10091
10092
10093 return false;
10094 }
10095
10097 {
10098
10099 return false;
10100 }
10101
10104 {
10105 return !GetIsFrozen() &&
IsOpen();
10106 }
10107
10109 {
10110 bool hasParent = false, hasRootAsPlayer = false;
10112
10113 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10114 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10115
10116 if (wwtu || foodDecay)
10117 {
10121
10122 if (processWetness || processTemperature || processDecay)
10123 {
10125
10126 if (processWetness)
10127 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10128
10129 if (processTemperature)
10131
10132 if (processDecay)
10133 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10134 }
10135 }
10136 }
10137
10140 {
10142 }
10143
10145 {
10148
10149 return super.GetTemperatureFreezeThreshold();
10150 }
10151
10153 {
10156
10157 return super.GetTemperatureThawThreshold();
10158 }
10159
10161 {
10164
10165 return super.GetItemOverheatThreshold();
10166 }
10167
10169 {
10171 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10172
10173 return super.GetTemperatureFreezeTime();
10174 }
10175
10177 {
10179 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10180
10181 return super.GetTemperatureThawTime();
10182 }
10183
10188
10190 {
10191 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10192 }
10193
10195 {
10196 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10197 }
10198
10201 {
10203 }
10204
10206 {
10208 }
10209
10211 {
10213 }
10214
10217 {
10218 return null;
10219 }
10220
10223 {
10224 return false;
10225 }
10226
10228 {
10230 {
10233 if (!trg)
10234 {
10236 explosive = this;
10237 }
10238
10239 explosive.PairRemote(trg);
10241
10242 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10243 trg.SetPersistentPairID(persistentID);
10244 explosive.SetPersistentPairID(persistentID);
10245
10246 return true;
10247 }
10248 return false;
10249 }
10250
10253 {
10254 float ret = 1.0;
10257 ret *= GetHealth01();
10258
10259 return ret;
10260 }
10261
10262 #ifdef DEVELOPER
10263 override void SetDebugItem()
10264 {
10265 super.SetDebugItem();
10266 _itemBase = this;
10267 }
10268
10270 {
10271 string text = super.GetDebugText();
10272
10274 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10275
10276 return text;
10277 }
10278 #endif
10279
10281 {
10282 return true;
10283 }
10284
10286
10288
10290 {
10293 }
10294
10295
10303
10319}
10320
10322{
10324 if (entity)
10325 {
10326 bool is_item = entity.IsInherited(
ItemBase);
10327 if (is_item && full_quantity)
10328 {
10331 }
10332 }
10333 else
10334 {
10336 return NULL;
10337 }
10338 return entity;
10339}
10340
10342{
10343 if (item)
10344 {
10345 if (health > 0)
10346 item.SetHealth("", "", health);
10347
10348 if (item.CanHaveTemperature())
10349 {
10351 if (item.CanFreeze())
10352 item.SetFrozen(false);
10353 }
10354
10355 if (item.HasEnergyManager())
10356 {
10357 if (quantity >= 0)
10358 {
10359 item.GetCompEM().SetEnergy0To1(quantity);
10360 }
10361 else
10362 {
10364 }
10365 }
10366 else if (item.IsMagazine())
10367 {
10368 Magazine mag = Magazine.Cast(item);
10369 if (quantity >= 0)
10370 {
10371 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10372 }
10373 else
10374 {
10376 }
10377
10378 }
10379 else
10380 {
10381 if (quantity >= 0)
10382 {
10383 item.SetQuantityNormalized(quantity, false);
10384 }
10385 else
10386 {
10388 }
10389
10390 }
10391 }
10392}
10393
10394#ifdef DEVELOPER
10396#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
Open
Implementations only.
override void EEOnCECreate()
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 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)
bool ShouldSplitQuantity(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)
override 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...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
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()
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)
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 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 void GizmoSelectObject(Object object)
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 native void GizmoSelectPhysics(Physics physics)
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
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 string GetFoldSoundset()
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 string GetLoopFoldSoundset()
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.