5499{
5501 {
5502 return true;
5503 }
5504};
5505
5506
5507
5509{
5513
5515
5518
5519
5520
5521
5522
5531
5537
5542
5547
5568 protected bool m_IsResultOfSplit
5569
5571
5576
5577
5578
5580
5584
5585
5586
5588
5591
5592
5593
5599
5600
5608
5611
5612
5614
5615
5617
5618
5623
5624
5629
5630
5632
5633
5635 {
5640
5641 if (!
GetGame().IsDedicatedServer())
5642 {
5644 {
5646
5648 {
5650 }
5651 }
5652
5655 }
5656
5657 m_OldLocation = null;
5658
5660 {
5662 }
5663
5664 if (ConfigIsExisting("headSelectionsToHide"))
5665 {
5668 }
5669
5671 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5672 {
5674 }
5675
5677
5678 m_IsResultOfSplit = false;
5679
5681 }
5682
5684 {
5685 super.InitItemVariables();
5686
5692 m_Count = ConfigGetInt(
"count");
5693
5696
5701
5704
5709
5721
5725
5726
5729 if (ConfigIsExisting("canBeSplit"))
5730 {
5733 }
5734
5736 if (ConfigIsExisting("itemBehaviour"))
5738
5739
5742 RegisterNetSyncVariableInt("m_VarLiquidType");
5743 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5744
5745 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5746 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5747 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5748
5749 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5750 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5751 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5752 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5753
5754 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5755 RegisterNetSyncVariableBool("m_IsTakeable");
5756 RegisterNetSyncVariableBool("m_IsHologram");
5757
5760 {
5763 }
5764
5766
5768 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5770
5771 }
5772
5774 {
5776 }
5777
5779 {
5782 {
5787 }
5788 }
5789
5790 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5791 {
5793 {
5796 }
5797
5799 }
5800
5802 {
5808 }
5809
5811
5813 {
5815
5816 if (!action)
5817 {
5818 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5819 return;
5820 }
5821
5823 if (!ai)
5824 {
5826 return;
5827 }
5828
5830 if (!action_array)
5831 {
5832 action_array = new array<ActionBase_Basic>;
5834 }
5835 if (LogManager.IsActionLogEnable())
5836 {
5837 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5838 }
5839
5840 if (action_array.Find(action) != -1)
5841 {
5842 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5843 }
5844 else
5845 {
5846 action_array.Insert(action);
5847 }
5848 }
5849
5851 {
5853 ActionBase action = player.GetActionManager().GetAction(actionName);
5856
5857 if (action_array)
5858 {
5859 action_array.RemoveItem(action);
5860 }
5861 }
5862
5863
5864
5866 {
5867 ActionOverrideData overrideData = new ActionOverrideData();
5871
5873 if (!actionMap)
5874 {
5877 }
5878
5879 actionMap.Insert(this.
Type(), overrideData);
5880
5881 }
5882
5884
5886
5887
5889 {
5892
5895
5896 string config_to_search = "CfgVehicles";
5897 string muzzle_owner_config;
5898
5900 {
5901 if (IsInherited(Weapon))
5902 config_to_search = "CfgWeapons";
5903
5904 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5905
5906 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5907
5909
5910 if (config_OnFire_subclass_count > 0)
5911 {
5912 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5913
5914 for (int i = 0; i < config_OnFire_subclass_count; i++)
5915 {
5916 string particle_class = "";
5918 string config_OnFire_entry = config_OnFire_class + particle_class;
5919 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5920 WPOF_array.Insert(WPOF);
5921 }
5922
5923
5925 }
5926 }
5927
5929 {
5930 config_to_search = "CfgWeapons";
5931 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5932
5933 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5934
5936
5937 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5938 {
5939 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5940
5941 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5942 {
5943 string particle_class2 = "";
5945 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5946 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5947 WPOBE_array.Insert(WPOBE);
5948 }
5949
5950
5952 }
5953 }
5954 }
5955
5956
5958 {
5961
5963 {
5964 string config_to_search = "CfgVehicles";
5965
5966 if (IsInherited(Weapon))
5967 config_to_search = "CfgWeapons";
5968
5969 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5970 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5971
5972 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5973 {
5974
5976
5978 {
5980 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5982 return;
5983 }
5984
5987
5988
5989
5991 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5992
5993 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5994 {
5995 string particle_class = "";
5997 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5999
6000 if (entry_type == CT_CLASS)
6001 {
6002 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6003 WPOOH_array.Insert(WPOF);
6004 }
6005 }
6006
6007
6009 }
6010 }
6011 }
6012
6014 {
6016 }
6017
6019 {
6021 {
6023
6026
6029
6030 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6031 }
6032 }
6033
6035 {
6037 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6038
6040 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6041
6043 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6044
6046 {
6048 }
6049 }
6050
6052 {
6054 }
6055
6057 {
6060 else
6062
6064 {
6067 }
6068 else
6069 {
6072
6075 }
6076
6078 }
6079
6081 {
6083 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6084 }
6085
6087 {
6089 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6091 }
6092
6094 {
6096 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6097 }
6098
6100 {
6103
6104 OverheatingParticle OP = new OverheatingParticle();
6109
6111 }
6112
6114 {
6117
6118 return -1;
6119 }
6120
6122 {
6124 {
6127
6128 for (int i = count; i > 0; --i)
6129 {
6130 int id = i - 1;
6133
6136
6137 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6138 {
6139 if (p)
6140 {
6143 }
6144 }
6145 }
6146 }
6147 }
6148
6150 {
6152 {
6154 {
6155 int id = i - 1;
6157
6158 if (OP)
6159 {
6161
6162 if (p)
6163 {
6165 }
6166
6167 delete OP;
6168 }
6169 }
6170
6173 }
6174 }
6175
6178 {
6179 return 0.0;
6180 }
6181
6182
6184 {
6185 return 250;
6186 }
6187
6189 {
6190 return 0;
6191 }
6192
6195 {
6197 return true;
6198
6199 return false;
6200 }
6201
6204 {
6207
6209 {
6211 }
6212 else
6213 {
6214
6216 }
6217
6219 }
6220
6227 {
6228 return -1;
6229 }
6230
6231
6232
6233
6235 {
6237 {
6239 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6240
6241 if (r_index >= 0)
6242 {
6243 InventoryLocation r_il = new InventoryLocation;
6244 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6245
6246 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6249 {
6250 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6251 }
6253 {
6254 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6255 }
6256
6257 }
6258
6259 player.GetHumanInventory().ClearUserReservedLocation(this);
6260 }
6261
6264 }
6265
6266
6267
6268
6270 {
6271 return ItemBase.m_DebugActionsMask;
6272 }
6273
6275 {
6276 return ItemBase.m_DebugActionsMask & mask;
6277 }
6278
6280 {
6281 ItemBase.m_DebugActionsMask = mask;
6282 }
6283
6285 {
6286 ItemBase.m_DebugActionsMask |= mask;
6287 }
6288
6290 {
6291 ItemBase.m_DebugActionsMask &= ~mask;
6292 }
6293
6295 {
6297 {
6299 }
6300 else
6301 {
6303 }
6304 }
6305
6306
6308 {
6309 if (GetEconomyProfile())
6310 {
6311 float q_max = GetEconomyProfile().GetQuantityMax();
6312 if (q_max > 0)
6313 {
6314 float q_min = GetEconomyProfile().GetQuantityMin();
6315 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6316
6318 {
6319 ComponentEnergyManager comp = GetCompEM();
6321 {
6323 }
6324 }
6326 {
6328
6329 }
6330
6331 }
6332 }
6333 }
6334
6337 {
6338 EntityAI parent = GetHierarchyParent();
6339
6340 if (parent)
6341 {
6342 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6343 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6344 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6345 }
6346 }
6347
6350 {
6351 EntityAI parent = GetHierarchyParent();
6352
6353 if (parent)
6354 {
6355 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6356 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6357 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6358 }
6359 }
6360
6362 {
6363
6364
6365
6366
6368
6370 {
6371 if (ScriptInputUserData.CanStoreInputUserData())
6372 {
6373 ScriptInputUserData ctx = new ScriptInputUserData;
6379 ctx.
Write(use_stack_max);
6382
6384 {
6385 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6386 }
6387 }
6388 }
6389 else if (!
GetGame().IsMultiplayer())
6390 {
6392 }
6393 }
6394
6396 {
6398 }
6399
6401 {
6403 }
6404
6406 {
6408 }
6409
6411 {
6412
6413 return false;
6414 }
6415
6417 {
6418 return false;
6419 }
6420
6424 {
6425 return false;
6426 }
6427
6429 {
6430 return "";
6431 }
6432
6434
6436 {
6437 return false;
6438 }
6439
6441 {
6442 return true;
6443 }
6444
6445
6446
6448 {
6449 return true;
6450 }
6451
6453 {
6454 return true;
6455 }
6456
6458 {
6459 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6461 }
6462
6464 {
6466 }
6467
6469 {
6471 if (!is_being_placed)
6473 SetSynchDirty();
6474 }
6475
6476
6478
6480 {
6482 }
6483
6485 {
6487 }
6488
6490 {
6491 return 1;
6492 }
6493
6495 {
6496 return false;
6497 }
6498
6500 {
6502 SetSynchDirty();
6503 }
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6540 {
6541 super.OnMovedInsideCargo(container);
6542
6543 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6544 }
6545
6546 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6547 {
6548 super.EEItemLocationChanged(oldLoc,newLoc);
6549
6550 PlayerBase new_player = null;
6551 PlayerBase old_player = null;
6552
6553 if (newLoc.GetParent())
6554 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6555
6556 if (oldLoc.GetParent())
6557 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6558
6560 {
6561 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6562
6563 if (r_index >= 0)
6564 {
6565 InventoryLocation r_il = new InventoryLocation;
6566 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6567
6568 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6571 {
6572 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6573 }
6575 {
6576 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6577 }
6578
6579 }
6580 }
6581
6583 {
6584 if (new_player)
6585 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6586
6587 if (new_player == old_player)
6588 {
6589
6590 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6591 {
6593 {
6594 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6595 {
6596 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6597 }
6598 }
6599 else
6600 {
6601 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6602 }
6603 }
6604
6605 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6606 {
6607 int type = oldLoc.GetType();
6609 {
6610 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6611 }
6613 {
6614 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6615 }
6616 }
6617 if (!m_OldLocation)
6618 {
6619 m_OldLocation = new InventoryLocation;
6620 }
6621 m_OldLocation.Copy(oldLoc);
6622 }
6623 else
6624 {
6625 if (m_OldLocation)
6626 {
6627 m_OldLocation.Reset();
6628 }
6629 }
6630
6632 }
6633 else
6634 {
6635 if (new_player)
6636 {
6637 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6638 if (res_index >= 0)
6639 {
6640 InventoryLocation il = new InventoryLocation;
6641 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6643 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6646 {
6647 il.
GetParent().GetOnReleaseLock().Invoke(it);
6648 }
6650 {
6652 }
6653
6654 }
6655 }
6657 {
6658
6660 }
6661
6662 if (m_OldLocation)
6663 {
6664 m_OldLocation.Reset();
6665 }
6666 }
6667 }
6668
6669 override void EOnContact(IEntity other, Contact extra)
6670 {
6672 {
6673 int liquidType = -1;
6675 if (impactSpeed > 0.0)
6676 {
6678 #ifndef SERVER
6680 #else
6682 SetSynchDirty();
6683 #endif
6685 }
6686 }
6687
6688 #ifdef SERVER
6689 if (GetCompEM() && GetCompEM().IsPlugged())
6690 {
6691 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6692 GetCompEM().UnplugThis();
6693 }
6694 #endif
6695 }
6696
6698
6700 {
6702 }
6703
6705 {
6706
6707 }
6708
6710 {
6711 super.OnItemLocationChanged(old_owner, new_owner);
6712
6713 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6714 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6715
6716 if (!relatedPlayer && playerNew)
6717 relatedPlayer = playerNew;
6718
6719 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6720 {
6722 if (actionMgr)
6723 {
6724 ActionBase currentAction = actionMgr.GetRunningAction();
6725 if (currentAction)
6727 }
6728 }
6729
6730 Man ownerPlayerOld = null;
6731 Man ownerPlayerNew = null;
6732
6733 if (old_owner)
6734 {
6735 if (old_owner.
IsMan())
6736 {
6737 ownerPlayerOld = Man.Cast(old_owner);
6738 }
6739 else
6740 {
6741 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6742 }
6743 }
6744 else
6745 {
6747 {
6749
6750 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6751 {
6752 GetCompEM().UnplugThis();
6753 }
6754 }
6755 }
6756
6757 if (new_owner)
6758 {
6759 if (new_owner.
IsMan())
6760 {
6761 ownerPlayerNew = Man.Cast(new_owner);
6762 }
6763 else
6764 {
6765 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6766 }
6767 }
6768
6769 if (ownerPlayerOld != ownerPlayerNew)
6770 {
6771 if (ownerPlayerOld)
6772 {
6773 array<EntityAI> subItemsExit = new array<EntityAI>;
6775 for (int i = 0; i < subItemsExit.Count(); i++)
6776 {
6779 }
6780 }
6781
6782 if (ownerPlayerNew)
6783 {
6784 array<EntityAI> subItemsEnter = new array<EntityAI>;
6786 for (int j = 0; j < subItemsEnter.Count(); j++)
6787 {
6790 }
6791 }
6792 }
6793 else if (ownerPlayerNew != null)
6794 {
6795 PlayerBase nplayer;
6796 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6797 {
6798 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6800 for (int k = 0; k < subItemsUpdate.Count(); k++)
6801 {
6803 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6804 }
6805 }
6806 }
6807
6808 if (old_owner)
6809 old_owner.OnChildItemRemoved(this);
6810 if (new_owner)
6811 new_owner.OnChildItemReceived(this);
6812 }
6813
6814
6816 {
6817 super.EEDelete(parent);
6818 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6819 if (player)
6820 {
6822
6823 if (player.IsAlive())
6824 {
6825 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6826 if (r_index >= 0)
6827 {
6828 InventoryLocation r_il = new InventoryLocation;
6829 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6830
6831 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6834 {
6835 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6836 }
6838 {
6839 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6840 }
6841
6842 }
6843
6844 player.RemoveQuickBarEntityShortcut(this);
6845 }
6846 }
6847 }
6848
6850 {
6851 super.EEKilled(killer);
6852
6855 {
6856 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6857 {
6858 if (IsMagazine())
6859 {
6860 if (Magazine.Cast(this).GetAmmoCount() > 0)
6861 {
6863 }
6864 }
6865 else
6866 {
6868 }
6869 }
6870 }
6871 }
6872
6874 {
6875 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6876
6877 super.OnWasAttached(parent, slot_id);
6878
6881
6883 }
6884
6886 {
6887 super.OnWasDetached(parent, slot_id);
6888
6891 }
6892
6894 {
6895 int idx;
6898
6899 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6900 if (inventory_slots.Count() < 1)
6901 {
6902 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6903 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6904 }
6905 else
6906 {
6907 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6908 }
6909
6910 idx = inventory_slots.Find(slot);
6911 if (idx < 0)
6912 return "";
6913
6914 return attach_types.Get(idx);
6915 }
6916
6918 {
6919 int idx = -1;
6920 string slot;
6921
6924
6925 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6926 if (inventory_slots.Count() < 1)
6927 {
6928 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6929 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6930 }
6931 else
6932 {
6933 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6934 if (detach_types.Count() < 1)
6935 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6936 }
6937
6938 for (int i = 0; i < inventory_slots.Count(); i++)
6939 {
6940 slot = inventory_slots.Get(i);
6941 }
6942
6943 if (slot != "")
6944 {
6945 if (detach_types.Count() == 1)
6946 idx = 0;
6947 else
6948 idx = inventory_slots.Find(slot);
6949 }
6950 if (idx < 0)
6951 return "";
6952
6953 return detach_types.Get(idx);
6954 }
6955
6957 {
6958
6960
6961
6962 float min_time = 1;
6963 float max_time = 3;
6964 float delay = Math.RandomFloat(min_time, max_time);
6965
6966 explode_timer.Run(delay, this, "DoAmmoExplosion");
6967 }
6968
6970 {
6971 Magazine magazine = Magazine.Cast(this);
6972 int pop_sounds_count = 6;
6973 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6974
6975
6976 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6977 string sound_name = pop_sounds[ sound_idx ];
6979
6980
6981 magazine.ServerAddAmmoCount(-1);
6982
6983
6984 float min_temp_to_explode = 100;
6985
6986 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
6987 {
6989 }
6990 }
6991
6992
6993 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6994 {
6995 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6996
6997 const int CHANCE_DAMAGE_CARGO = 4;
6998 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6999 const int CHANCE_DAMAGE_NOTHING = 2;
7000
7002 {
7003 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7004 int chances;
7005 int rnd;
7006
7007 if (GetInventory().GetCargo())
7008 {
7009 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7010 rnd = Math.RandomInt(0,chances);
7011
7012 if (rnd < CHANCE_DAMAGE_CARGO)
7013 {
7015 }
7016 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7017 {
7019 }
7020 }
7021 else
7022 {
7023 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7024 rnd = Math.RandomInt(0,chances);
7025
7026 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7027 {
7029 }
7030 }
7031 }
7032 }
7033
7035 {
7036 if (GetInventory().GetCargo())
7037 {
7038 int item_count = GetInventory().GetCargo().GetItemCount();
7039 if (item_count > 0)
7040 {
7041 int random_pick = Math.RandomInt(0, item_count);
7043 if (!item.IsExplosive())
7044 {
7045 item.AddHealth("","",damage);
7046 return true;
7047 }
7048 }
7049 }
7050 return false;
7051 }
7052
7054 {
7055 int attachment_count = GetInventory().AttachmentCount();
7056 if (attachment_count > 0)
7057 {
7058 int random_pick = Math.RandomInt(0, attachment_count);
7059 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7060 if (!attachment.IsExplosive())
7061 {
7062 attachment.AddHealth("","",damage);
7063 return true;
7064 }
7065 }
7066 return false;
7067 }
7068
7070 {
7072 }
7073
7075 {
7077 return GetInventory().CanRemoveEntity();
7078
7079 return false;
7080 }
7081
7083 {
7084
7086 return false;
7087
7088
7090 return false;
7091
7092
7093
7095 if (delta == 0)
7096 return false;
7097
7098
7099 return true;
7100 }
7101
7103 {
7105 {
7106 if (ScriptInputUserData.CanStoreInputUserData())
7107 {
7108 ScriptInputUserData ctx = new ScriptInputUserData;
7113 ctx.
Write(destination_entity);
7117 }
7118 }
7119 else if (!
GetGame().IsMultiplayer())
7120 {
7122 }
7123 }
7124
7126 {
7127 float split_quantity_new;
7131 InventoryLocation loc = new InventoryLocation;
7132
7133 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7134 {
7136 split_quantity_new = stack_max;
7137 else
7139
7141 {
7142 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7143 if (new_item)
7144 {
7145 new_item.SetResultOfSplit(true);
7146 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7148 new_item.
SetQuantity(split_quantity_new,
false,
true);
7149 }
7150 }
7151 }
7152 else if (destination_entity && slot_id == -1)
7153 {
7154 if (quantity > stack_max)
7155 split_quantity_new = stack_max;
7156 else
7157 split_quantity_new = quantity;
7158
7160 {
7162 {
7165 }
7166
7167 if (new_item)
7168 {
7169 new_item.SetResultOfSplit(true);
7170 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7172 new_item.
SetQuantity(split_quantity_new,
false,
true);
7173 }
7174 }
7175 }
7176 else
7177 {
7178 if (stack_max != 0)
7179 {
7181 {
7183 }
7184
7185 if (split_quantity_new == 0)
7186 {
7187 if (!
GetGame().IsMultiplayer())
7188 player.PhysicalPredictiveDropItem(this);
7189 else
7190 player.ServerDropEntity(this);
7191 return;
7192 }
7193
7195 {
7197
7198 if (new_item)
7199 {
7200 new_item.SetResultOfSplit(true);
7201 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7204 new_item.PlaceOnSurface();
7205 }
7206 }
7207 }
7208 }
7209 }
7210
7212 {
7213 float split_quantity_new;
7217 InventoryLocation loc = new InventoryLocation;
7218
7219 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7220 {
7222 split_quantity_new = stack_max;
7223 else
7225
7227 {
7228 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7229 if (new_item)
7230 {
7231 new_item.SetResultOfSplit(true);
7232 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7234 new_item.
SetQuantity(split_quantity_new,
false,
true);
7235 }
7236 }
7237 }
7238 else if (destination_entity && slot_id == -1)
7239 {
7240 if (quantity > stack_max)
7241 split_quantity_new = stack_max;
7242 else
7243 split_quantity_new = quantity;
7244
7246 {
7248 {
7251 }
7252
7253 if (new_item)
7254 {
7255 new_item.SetResultOfSplit(true);
7256 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7258 new_item.
SetQuantity(split_quantity_new,
false,
true);
7259 }
7260 }
7261 }
7262 else
7263 {
7264 if (stack_max != 0)
7265 {
7267 {
7269 }
7270
7272 {
7274
7275 if (new_item)
7276 {
7277 new_item.SetResultOfSplit(true);
7278 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7281 new_item.PlaceOnSurface();
7282 }
7283 }
7284 }
7285 }
7286 }
7287
7289 {
7291 {
7292 if (ScriptInputUserData.CanStoreInputUserData())
7293 {
7294 ScriptInputUserData ctx = new ScriptInputUserData;
7299 dst.WriteToContext(ctx);
7301 }
7302 }
7303 else if (!
GetGame().IsMultiplayer())
7304 {
7306 }
7307 }
7308
7310 {
7312 {
7313 if (ScriptInputUserData.CanStoreInputUserData())
7314 {
7315 ScriptInputUserData ctx = new ScriptInputUserData;
7320 ctx.
Write(destination_entity);
7326 }
7327 }
7328 else if (!
GetGame().IsMultiplayer())
7329 {
7331 }
7332 }
7333
7335 {
7337 }
7338
7340 {
7342 float split_quantity_new;
7344 if (dst.IsValid())
7345 {
7346 int slot_id = dst.GetSlot();
7348
7349 if (quantity > stack_max)
7350 split_quantity_new = stack_max;
7351 else
7352 split_quantity_new = quantity;
7353
7355 {
7357
7358 if (new_item)
7359 {
7360 new_item.SetResultOfSplit(true);
7361 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7363 new_item.
SetQuantity(split_quantity_new,
false,
true);
7364 }
7365
7366 return new_item;
7367 }
7368 }
7369
7370 return null;
7371 }
7372
7374 {
7376 float split_quantity_new;
7378 if (destination_entity)
7379 {
7381 if (quantity > stackable)
7382 split_quantity_new = stackable;
7383 else
7384 split_quantity_new = quantity;
7385
7387 {
7388 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7389 if (new_item)
7390 {
7391 new_item.SetResultOfSplit(true);
7392 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7394 new_item.
SetQuantity(split_quantity_new,
false,
true);
7395 }
7396 }
7397 }
7398 }
7399
7401 {
7403 {
7404 if (ScriptInputUserData.CanStoreInputUserData())
7405 {
7406 ScriptInputUserData ctx = new ScriptInputUserData;
7411 ItemBase destination_entity =
this;
7412 ctx.
Write(destination_entity);
7416 }
7417 }
7418 else if (!
GetGame().IsMultiplayer())
7419 {
7421 }
7422 }
7423
7425 {
7427 float split_quantity_new;
7429 if (player)
7430 {
7432 if (quantity > stackable)
7433 split_quantity_new = stackable;
7434 else
7435 split_quantity_new = quantity;
7436
7438 {
7439 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7440 new_item =
ItemBase.Cast(in_hands);
7441 if (new_item)
7442 {
7443 new_item.SetResultOfSplit(true);
7444 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7446 new_item.SetQuantity(split_quantity_new, false, true);
7447 }
7448 }
7449 }
7450 }
7451
7453 {
7455 float split_quantity_new = Math.Floor(quantity * 0.5);
7456
7458 return;
7459
7461
7462 if (new_item)
7463 {
7464 if (new_item.GetQuantityMax() < split_quantity_new)
7465 {
7466 split_quantity_new = new_item.GetQuantityMax();
7467 }
7468
7469 new_item.SetResultOfSplit(true);
7470 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7471
7473 {
7476 }
7477 else
7478 {
7480 new_item.
SetQuantity(split_quantity_new,
false,
true);
7481 }
7482 }
7483 }
7484
7486 {
7488 float split_quantity_new = Math.Floor(quantity / 2);
7489
7491 return;
7492
7493 InventoryLocation invloc = new InventoryLocation;
7495
7497 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7498
7499 if (new_item)
7500 {
7501 if (new_item.GetQuantityMax() < split_quantity_new)
7502 {
7503 split_quantity_new = new_item.GetQuantityMax();
7504 }
7506 {
7509 }
7510 else if (split_quantity_new > 1)
7511 {
7513 new_item.
SetQuantity(split_quantity_new,
false,
true);
7514 }
7515 }
7516 }
7517
7520 {
7521 SetWeightDirty();
7523
7524 if (parent)
7525 parent.OnAttachmentQuantityChangedEx(this, delta);
7526
7528 {
7530 {
7532 }
7534 {
7535 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7537 }
7538 }
7539
7540 }
7541
7544 {
7545
7546 }
7547
7550 {
7552 }
7553
7555 {
7556 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7557
7559 {
7560 if (newLevel == GameConstants.STATE_RUINED)
7561 {
7563 EntityAI parent = GetHierarchyParent();
7564 if (parent && parent.IsFireplace())
7565 {
7566 CargoBase cargo = GetInventory().GetCargo();
7567 if (cargo)
7568 {
7570 {
7572 }
7573 }
7574 }
7575 }
7576
7578 {
7579
7581 return;
7582 }
7583
7584 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7585 {
7587 }
7588 }
7589 }
7590
7591
7593 {
7594 super.OnRightClick();
7595
7597 {
7599 {
7600 if (ScriptInputUserData.CanStoreInputUserData())
7601 {
7602 EntityAI root = GetHierarchyRoot();
7603 Man playerOwner = GetHierarchyRootPlayer();
7604 InventoryLocation dst = new InventoryLocation;
7605
7606
7607 if (!playerOwner && root && root == this)
7608 {
7610 }
7611 else
7612 {
7613
7614 GetInventory().GetCurrentInventoryLocation(dst);
7616 {
7619 {
7621 }
7622 else
7623 {
7625
7626
7627 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7628 {
7630 }
7631 else
7632 {
7633 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7634 }
7635 }
7636 }
7637 }
7638
7639 ScriptInputUserData ctx = new ScriptInputUserData;
7647 }
7648 }
7649 else if (!
GetGame().IsMultiplayer())
7650 {
7652 }
7653 }
7654 }
7655
7657 {
7658 if (root)
7659 {
7660 vector m4[4];
7661 root.GetTransform(m4);
7662 dst.SetGround(this, m4);
7663 }
7664 else
7665 {
7666 GetInventory().GetCurrentInventoryLocation(dst);
7667 }
7668 }
7669
7670 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7671 {
7672
7673 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7674 return false;
7675
7676 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7677 return false;
7678
7679
7681 return false;
7682
7683
7684 Magazine mag = Magazine.Cast(this);
7685 if (mag)
7686 {
7687 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7688 return false;
7689
7690 if (stack_max_limit)
7691 {
7692 Magazine other_mag = Magazine.Cast(other_item);
7693 if (other_item)
7694 {
7695 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7696 return false;
7697 }
7698
7699 }
7700 }
7701 else
7702 {
7703
7705 return false;
7706
7708 return false;
7709 }
7710
7711 PlayerBase player = null;
7712 if (CastTo(player, GetHierarchyRootPlayer()))
7713 {
7714 if (player.GetInventory().HasAttachment(this))
7715 return false;
7716
7717 if (player.IsItemsToDelete())
7718 return false;
7719 }
7720
7721 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7722 return false;
7723
7724 int slotID;
7726 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7727 return false;
7728
7729 return true;
7730 }
7731
7733 {
7735 }
7736
7738 {
7739 return m_IsResultOfSplit;
7740 }
7741
7743 {
7744 m_IsResultOfSplit = value;
7745 }
7746
7748 {
7750 }
7751
7753 {
7754 float other_item_quantity = other_item.GetQuantity();
7755 float this_free_space;
7756
7758
7760
7761 if (other_item_quantity > this_free_space)
7762 {
7763 return this_free_space;
7764 }
7765 else
7766 {
7767 return other_item_quantity;
7768 }
7769 }
7770
7772 {
7774 }
7775
7777 {
7779 return;
7780
7781 if (!IsMagazine() && other_item)
7782 {
7784 if (quantity_used != 0)
7785 {
7786 float hp1 = GetHealth01("","");
7787 float hp2 = other_item.GetHealth01("","");
7788 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7789 hpResult = hpResult / (
GetQuantity() + quantity_used);
7790
7791 hpResult *= GetMaxHealth();
7792 Math.Round(hpResult);
7793 SetHealth("", "Health", hpResult);
7794
7796 other_item.AddQuantity(-quantity_used);
7797 }
7798 }
7800 }
7801
7803 {
7804 #ifdef SERVER
7805 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7806 GetHierarchyParent().IncreaseLifetimeUp();
7807 #endif
7808 };
7809
7811 {
7812 PlayerBase p = PlayerBase.Cast(player);
7813
7814 array<int> recipesIds = p.m_Recipes;
7815 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7816 if (moduleRecipesManager)
7817 {
7818 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7819 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7820 }
7821
7822 for (int i = 0;i < recipesIds.Count(); i++)
7823 {
7824 int key = recipesIds.Get(i);
7825 string recipeName = moduleRecipesManager.GetRecipeName(key);
7827 }
7828 }
7829
7830
7831 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7832 {
7833 super.GetDebugActions(outputList);
7834
7835
7841
7842
7847
7852
7853
7857
7858
7860 {
7864 }
7865
7868
7869
7873
7875
7876 InventoryLocation loc = new InventoryLocation();
7877 GetInventory().GetCurrentInventoryLocation(loc);
7879 {
7880 if (Gizmo_IsSupported())
7883 }
7884
7886 }
7887
7888
7889
7890
7892 {
7893 super.OnAction(action_id, player, ctx);
7894
7896 {
7897 switch (action_id)
7898 {
7901 return true;
7904 return true;
7905 }
7906 }
7907
7909 {
7910 switch (action_id)
7911 {
7913 Delete();
7914 return true;
7915 }
7916 }
7917
7918 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7919 {
7920 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7921 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7922 PlayerBase p = PlayerBase.Cast(player);
7923 if (
EActions.RECIPES_RANGE_START < 1000)
7924 {
7925 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7926 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7927 }
7928 }
7929 #ifndef SERVER
7930 else if (action_id ==
EActions.WATCH_PLAYER)
7931 {
7932 PluginDeveloper.SetDeveloperItemClientEx(player);
7933 }
7934 #endif
7936 {
7937 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7938 {
7939 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7940 OnDebugButtonPressServer(id + 1);
7941 }
7942
7943 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7944 {
7945 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7947 }
7948
7949 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7950 {
7951 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7953 }
7954
7955 else if (action_id ==
EActions.ADD_QUANTITY)
7956 {
7957 if (IsMagazine())
7958 {
7959 Magazine mag = Magazine.Cast(this);
7960 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7961 }
7962 else
7963 {
7965 }
7966
7967 if (m_EM)
7968 {
7969 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7970 }
7971
7972 }
7973
7974 else if (action_id ==
EActions.REMOVE_QUANTITY)
7975 {
7976 if (IsMagazine())
7977 {
7978 Magazine mag2 = Magazine.Cast(this);
7979 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7980 }
7981 else
7982 {
7984 }
7985 if (m_EM)
7986 {
7987 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7988 }
7989
7990 }
7991
7992 else if (action_id ==
EActions.SET_QUANTITY_0)
7993 {
7995
7996 if (m_EM)
7997 {
7998 m_EM.SetEnergy(0);
7999 }
8000 }
8001
8002 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8003 {
8005
8006 if (m_EM)
8007 {
8008 m_EM.SetEnergy(m_EM.GetEnergyMax());
8009 }
8010 }
8011
8012 else if (action_id ==
EActions.ADD_HEALTH)
8013 {
8014 AddHealth("","",GetMaxHealth("","Health")/5);
8015 }
8016 else if (action_id ==
EActions.REMOVE_HEALTH)
8017 {
8018 AddHealth("","",-GetMaxHealth("","Health")/5);
8019 }
8020 else if (action_id ==
EActions.DESTROY_HEALTH)
8021 {
8022 SetHealth01("","",0);
8023 }
8024 else if (action_id ==
EActions.WATCH_ITEM)
8025 {
8027 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8028 #ifdef DEVELOPER
8029 SetDebugDeveloper_item(this);
8030 #endif
8031 }
8032
8033 else if (action_id ==
EActions.ADD_TEMPERATURE)
8034 {
8035 AddTemperature(20);
8036
8037 }
8038
8039 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8040 {
8041 AddTemperature(-20);
8042
8043 }
8044
8045 else if (action_id ==
EActions.FLIP_FROZEN)
8046 {
8047 SetFrozen(!GetIsFrozen());
8048
8049 }
8050
8051 else if (action_id ==
EActions.ADD_WETNESS)
8052 {
8054
8055 }
8056
8057 else if (action_id ==
EActions.REMOVE_WETNESS)
8058 {
8060
8061 }
8062
8063 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8064 {
8067
8068
8069 }
8070
8071 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8072 {
8075 }
8076
8077 else if (action_id ==
EActions.MAKE_SPECIAL)
8078 {
8079 auto debugParams = DebugSpawnParams.WithPlayer(player);
8080 OnDebugSpawnEx(debugParams);
8081 }
8082
8083 }
8084
8085
8086 return false;
8087 }
8088
8089
8090
8091
8095
8098
8099
8100
8102 {
8103 return false;
8104 }
8105
8106
8108 {
8109 return true;
8110 }
8111
8112
8114 {
8115 return true;
8116 }
8117
8118
8119
8121 {
8122 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8124 }
8125
8128 {
8129 return null;
8130 }
8131
8133 {
8134 return false;
8135 }
8136
8138 {
8139 return false;
8140 }
8141
8145
8146
8148 {
8149 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8150 return module_repairing.CanRepair(this, item_repair_kit);
8151 }
8152
8153
8154 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8155 {
8156 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8157 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8158 }
8159
8160
8162 {
8163
8164
8165
8166
8167
8168
8169
8170
8171 return 1;
8172 }
8173
8174
8175
8177 {
8179 }
8180
8181
8182
8184 {
8186 }
8187
8188
8197 {
8198 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8199
8200 if (player)
8201 {
8202 player.MessageStatus(text);
8203 }
8204 }
8205
8206
8215 {
8216 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8217
8218 if (player)
8219 {
8220 player.MessageAction(text);
8221 }
8222 }
8223
8224
8233 {
8234 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8235
8236 if (player)
8237 {
8238 player.MessageFriendly(text);
8239 }
8240 }
8241
8242
8251 {
8252 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8253
8254 if (player)
8255 {
8256 player.MessageImportant(text);
8257 }
8258 }
8259
8261 {
8262 return true;
8263 }
8264
8265
8266 override bool KindOf(
string tag)
8267 {
8268 bool found = false;
8269 string item_name = this.
GetType();
8272
8273 int array_size = item_tag_array.Count();
8274 for (int i = 0; i < array_size; i++)
8275 {
8276 if (item_tag_array.Get(i) == tag)
8277 {
8278 found = true;
8279 break;
8280 }
8281 }
8282 return found;
8283 }
8284
8285
8287 {
8288
8289 super.OnRPC(sender, rpc_type,ctx);
8290
8291
8292 switch (rpc_type)
8293 {
8294 #ifndef SERVER
8295 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8296 Param2<bool, string> p = new Param2<bool, string>(false, "");
8297
8299 return;
8300
8301 bool play = p.param1;
8302 string soundSet = p.param2;
8303
8304 if (play)
8305 {
8307 {
8309 {
8311 }
8312 }
8313 else
8314 {
8316 }
8317 }
8318 else
8319 {
8321 }
8322
8323 break;
8324 #endif
8325
8326 }
8327
8329 {
8331 }
8332 }
8333
8334
8335
8336
8338 {
8339 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8340 return plugin.GetID(
name);
8341 }
8342
8344 {
8345 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8346 return plugin.GetName(id);
8347 }
8348
8351 {
8352
8353
8354 int varFlags;
8355 if (!ctx.
Read(varFlags))
8356 return;
8357
8358 if (varFlags & ItemVariableFlags.FLOAT)
8359 {
8361 }
8362 }
8363
8365 {
8366
8367 super.SerializeNumericalVars(floats_out);
8368
8369
8370
8372 {
8374 }
8375
8377 {
8379 }
8380
8382 {
8384 }
8385
8387 {
8392 }
8393
8395 {
8397 }
8398 }
8399
8401 {
8402
8403 super.DeSerializeNumericalVars(floats);
8404
8405
8406 int index = 0;
8407 int mask = Math.Round(floats.Get(index));
8408
8409 index++;
8410
8412 {
8414 {
8416 }
8417 else
8418 {
8419 float quantity = floats.Get(index);
8421 }
8422 index++;
8423 }
8424
8426 {
8427 float wet = floats.Get(index);
8429 index++;
8430 }
8431
8433 {
8434 int liquidtype = Math.Round(floats.Get(index));
8436 index++;
8437 }
8438
8440 {
8442 index++;
8444 index++;
8446 index++;
8448 index++;
8449 }
8450
8452 {
8453 int cleanness = Math.Round(floats.Get(index));
8455 index++;
8456 }
8457 }
8458
8460 {
8461 super.WriteVarsToCTX(ctx);
8462
8463
8465 {
8467 }
8468
8470 {
8472 }
8473
8475 {
8477 }
8478
8480 {
8481 int r,g,b,a;
8487 }
8488
8490 {
8492 }
8493 }
8494
8496 {
8497 if (!super.ReadVarsFromCTX(ctx,version))
8498 return false;
8499
8500 int intValue;
8501 float value;
8502
8503 if (version < 140)
8504 {
8505 if (!ctx.
Read(intValue))
8506 return false;
8507
8508 m_VariablesMask = intValue;
8509 }
8510
8512 {
8513 if (!ctx.
Read(value))
8514 return false;
8515
8517 {
8519 }
8520 else
8521 {
8523 }
8524 }
8525
8526 if (version < 140)
8527 {
8529 {
8530 if (!ctx.
Read(value))
8531 return false;
8532 SetTemperatureDirect(value);
8533 }
8534 }
8535
8537 {
8538 if (!ctx.
Read(value))
8539 return false;
8541 }
8542
8544 {
8545 if (!ctx.
Read(intValue))
8546 return false;
8548 }
8549
8551 {
8552 int r,g,b,a;
8554 return false;
8556 return false;
8558 return false;
8560 return false;
8561
8563 }
8564
8566 {
8567 if (!ctx.
Read(intValue))
8568 return false;
8570 }
8571
8572 if (version >= 138 && version < 140)
8573 {
8575 {
8576 if (!ctx.
Read(intValue))
8577 return false;
8578 SetFrozen(intValue);
8579 }
8580 }
8581
8582 return true;
8583 }
8584
8585
8587 {
8590 {
8592 }
8593
8594 if (!super.OnStoreLoad(ctx, version))
8595 {
8597 return false;
8598 }
8599
8600 if (version >= 114)
8601 {
8602 bool hasQuickBarIndexSaved;
8603
8604 if (!ctx.
Read(hasQuickBarIndexSaved))
8605 {
8607 return false;
8608 }
8609
8610 if (hasQuickBarIndexSaved)
8611 {
8612 int itmQBIndex;
8613
8614
8615 if (!ctx.
Read(itmQBIndex))
8616 {
8618 return false;
8619 }
8620
8621 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8622 if (itmQBIndex != -1 && parentPlayer)
8623 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8624 }
8625 }
8626 else
8627 {
8628
8629 PlayerBase player;
8630 int itemQBIndex;
8631 if (version ==
int.
MAX)
8632 {
8633 if (!ctx.
Read(itemQBIndex))
8634 {
8636 return false;
8637 }
8638 }
8639 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8640 {
8641
8642 if (!ctx.
Read(itemQBIndex))
8643 {
8645 return false;
8646 }
8647 if (itemQBIndex != -1 && player)
8648 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8649 }
8650 }
8651
8652 if (version < 140)
8653 {
8654
8655 if (!LoadVariables(ctx, version))
8656 {
8658 return false;
8659 }
8660 }
8661
8662
8664 {
8666 return false;
8667 }
8668 if (version >= 132)
8669 {
8671 if (raib)
8672 {
8674 {
8676 return false;
8677 }
8678 }
8679 }
8680
8682 return true;
8683 }
8684
8685
8686
8688 {
8689 super.OnStoreSave(ctx);
8690
8691 PlayerBase player;
8692 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8693 {
8695
8696 int itemQBIndex = -1;
8697 itemQBIndex = player.FindQuickBarEntityIndex(this);
8698 ctx.
Write(itemQBIndex);
8699 }
8700 else
8701 {
8703 }
8704
8706
8708 if (raib)
8709 {
8711 }
8712 }
8713
8714
8716 {
8717 super.AfterStoreLoad();
8718
8720 {
8722 }
8723
8725 {
8728 }
8729 }
8730
8732 {
8733 super.EEOnAfterLoad();
8734
8736 {
8738 }
8739
8742 }
8743
8745 {
8746 return false;
8747 }
8748
8749
8750
8752 {
8754 {
8755 #ifdef PLATFORM_CONSOLE
8756
8758 {
8760 if (menu)
8761 {
8763 }
8764 }
8765 #endif
8766 }
8767
8769 {
8772 }
8773
8775 {
8776 SetWeightDirty();
8778 }
8780 {
8783 }
8784
8786 {
8789 }
8791 {
8794 }
8795
8796 super.OnVariablesSynchronized();
8797 }
8798
8799
8800
8802 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8803 {
8804 if (!IsServerCheck(allow_client))
8805 return false;
8806
8808 return false;
8809
8812
8813 if (value <= (min + 0.001))
8814 value = min;
8815
8816 if (value == min)
8817 {
8818 if (destroy_config)
8819 {
8820 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8821 if (dstr)
8822 {
8824 this.Delete();
8825 return true;
8826 }
8827 }
8828 else if (destroy_forced)
8829 {
8831 this.Delete();
8832 return true;
8833 }
8834
8836 }
8837
8840
8842 {
8844
8845 if (delta)
8847 }
8848
8850
8851 return false;
8852 }
8853
8854
8856 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8857 {
8859 }
8860
8862 {
8865 }
8866
8868 {
8871 }
8872
8874 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8875 {
8876 float value_clamped = Math.Clamp(value, 0, 1);
8878 SetQuantity(result, destroy_config, destroy_forced);
8879 }
8880
8881
8884 {
8886 }
8887
8889 {
8891 }
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8903 {
8904 int slot = -1;
8905 if (GetInventory())
8906 {
8907 InventoryLocation il = new InventoryLocation;
8908 GetInventory().GetCurrentInventoryLocation(il);
8910 }
8911
8913 }
8914
8916 {
8917 float quantity_max = 0;
8918
8920 {
8921 if (attSlotID != -1)
8922 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8923
8924 if (quantity_max <= 0)
8926 }
8927
8928 if (quantity_max <= 0)
8930
8931 return quantity_max;
8932 }
8933
8935 {
8937 }
8938
8940 {
8942 }
8943
8944
8946 {
8948 }
8949
8951 {
8953 }
8954
8956 {
8958 }
8959
8960
8962 {
8963
8964 float weightEx = GetWeightEx();
8965 float special = GetInventoryAndCargoWeight();
8966 return weightEx - special;
8967 }
8968
8969
8971 {
8973 }
8974
8976 {
8978 {
8979 #ifdef DEVELOPER
8980 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8981 {
8982 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8984 }
8985 #endif
8986
8988 }
8989 else if (HasEnergyManager())
8990 {
8991 #ifdef DEVELOPER
8992 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8993 {
8994 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8995 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8996 }
8997 #endif
8998 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
8999 }
9000 else
9001 {
9002 #ifdef DEVELOPER
9003 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9004 {
9005 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9006 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9007 }
9008 #endif
9009 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9010 }
9011 }
9012
9015 {
9016 int item_count = 0;
9018
9019 if (GetInventory().GetCargo() != NULL)
9020 {
9021 item_count = GetInventory().GetCargo().GetItemCount();
9022 }
9023
9024 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9025 {
9026 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9027 if (item)
9028 item_count += item.GetNumberOfItems();
9029 }
9030 return item_count;
9031 }
9032
9035 {
9036 float weight = 0;
9037 float wetness = 1;
9038 if (include_wetness)
9041 {
9042 weight = wetness * m_ConfigWeight;
9043 }
9045 {
9046 weight = 1;
9047 }
9048 return weight;
9049 }
9050
9051
9052
9054 {
9055 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9056 {
9057 GameInventory inv = GetInventory();
9058 array<EntityAI> items = new array<EntityAI>;
9060 for (int i = 0; i < items.Count(); i++)
9061 {
9063 if (item)
9064 {
9066 }
9067 }
9068 }
9069 }
9070
9071
9072
9073
9075 {
9076 float energy = 0;
9077 if (HasEnergyManager())
9078 {
9079 energy = GetCompEM().GetEnergy();
9080 }
9081 return energy;
9082 }
9083
9084
9086 {
9087 super.OnEnergyConsumed();
9088
9090 }
9091
9093 {
9094 super.OnEnergyAdded();
9095
9097 }
9098
9099
9101 {
9102 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9103 {
9105 {
9106 float energy_0to1 = GetCompEM().GetEnergy0To1();
9108 }
9109 }
9110 }
9111
9112
9114 {
9115 return ConfigGetFloat("heatIsolation");
9116 }
9117
9119 {
9121 }
9122
9124 {
9125 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9126 if (
GetGame().ConfigIsExisting(paramPath))
9128
9129 return 0.0;
9130 }
9131
9133 {
9134 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9135 if (
GetGame().ConfigIsExisting(paramPath))
9137
9138 return 0.0;
9139 }
9140
9141 override void SetWet(
float value,
bool allow_client =
false)
9142 {
9143 if (!IsServerCheck(allow_client))
9144 return;
9145
9148
9150
9151 m_VarWet = Math.Clamp(value, min, max);
9152
9154 {
9157 }
9158 }
9159
9160 override void AddWet(
float value)
9161 {
9163 }
9164
9166 {
9168 }
9169
9171 {
9173 }
9174
9176 {
9178 }
9179
9181 {
9183 }
9184
9186 {
9188 }
9189
9191 {
9194 if (newLevel != oldLevel)
9195 {
9197 }
9198 }
9199
9201 {
9202 SetWeightDirty();
9203 }
9204
9206 {
9207 return GetWetLevelInternal(
m_VarWet);
9208 }
9209
9210
9211
9213 {
9215 }
9216
9218 {
9220 }
9221
9223 {
9225 }
9226
9228 {
9230 }
9231
9232
9233
9235 {
9236 if (ConfigIsExisting("itemModelLength"))
9237 {
9238 return ConfigGetFloat("itemModelLength");
9239 }
9240 return 0;
9241 }
9242
9244 {
9245 if (ConfigIsExisting("itemAttachOffset"))
9246 {
9247 return ConfigGetFloat("itemAttachOffset");
9248 }
9249 return 0;
9250 }
9251
9252 override void SetCleanness(
int value,
bool allow_client =
false)
9253 {
9254 if (!IsServerCheck(allow_client))
9255 return;
9256
9258
9260
9263 }
9264
9266 {
9268 }
9269
9271 {
9272 return true;
9273 }
9274
9275
9276
9277
9279 {
9281 }
9282
9284 {
9286 }
9287
9288
9289
9290
9291 override void SetColor(
int r,
int g,
int b,
int a)
9292 {
9298 }
9300 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9301 {
9306 }
9307
9309 {
9311 }
9312
9315 {
9316 int r,g,b,a;
9318 r = r/255;
9319 g = g/255;
9320 b = b/255;
9321 a = a/255;
9322 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9323 }
9324
9325
9326
9327 override void SetLiquidType(
int value,
bool allow_client =
false)
9328 {
9329 if (!IsServerCheck(allow_client))
9330 return;
9331
9336 }
9337
9339 {
9340 return ConfigGetInt("varLiquidTypeInit");
9341 }
9342
9344 {
9346 }
9347
9349 {
9351 SetFrozen(false);
9352 }
9353
9356 {
9357 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9358 }
9359
9360
9363 {
9364 PlayerBase nplayer;
9365 if (PlayerBase.CastTo(nplayer, player))
9366 {
9368
9369 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9370 }
9371 }
9372
9373
9376 {
9377 PlayerBase nplayer;
9378 if (PlayerBase.CastTo(nplayer,player))
9379 {
9380
9381 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9382
9383 }
9384
9385
9386 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9387
9388
9389 if (HasEnergyManager())
9390 {
9391 GetCompEM().UpdatePlugState();
9392 }
9393 }
9394
9395
9397 {
9398 super.OnPlacementStarted(player);
9399
9401 }
9402
9403 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9404 {
9406 {
9407 m_AdminLog.OnPlacementComplete(player,
this);
9408 }
9409
9410 super.OnPlacementComplete(player, position, orientation);
9411 }
9412
9413
9414
9415
9416
9418 {
9420 {
9421 return true;
9422 }
9423 else
9424 {
9425 return false;
9426 }
9427 }
9428
9429
9431 {
9433 {
9435 }
9436 }
9437
9438
9440 {
9442 }
9443
9445 {
9447 }
9448
9449 override void InsertAgent(
int agent,
float count = 1)
9450 {
9451 if (count < 1)
9452 return;
9453
9455 }
9456
9459 {
9461 }
9462
9463
9465 {
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
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9511 {
9513 return false;
9514 return true;
9515 }
9516
9518 {
9519
9521 }
9522
9523
9526 {
9527 super.CheckForRoofLimited(timeTresholdMS);
9528
9530 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9531 {
9532 m_PreviousRoofTestTime = time;
9533 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9534 }
9535 }
9536
9537
9539 {
9541 {
9542 return 0;
9543 }
9544
9545 if (GetInventory().GetAttachmentSlotsCount() != 0)
9546 {
9547 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9548 if (filter)
9549 return filter.GetProtectionLevel(type, false, system);
9550 else
9551 return 0;
9552 }
9553
9554 string subclassPath, entryName;
9555
9556 switch (type)
9557 {
9559 entryName = "biological";
9560 break;
9562 entryName = "chemical";
9563 break;
9564 default:
9565 entryName = "biological";
9566 break;
9567 }
9568
9569 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9570
9572 }
9573
9574
9575
9578 {
9579 if (!IsMagazine())
9581
9583 }
9584
9585
9586
9587
9588
9593 {
9594 return true;
9595 }
9596
9598 {
9600 }
9601
9602
9603
9604
9605
9607 {
9608 if (parent)
9609 {
9610 if (parent.IsInherited(DayZInfected))
9611 return true;
9612
9613 if (!parent.IsRuined())
9614 return true;
9615 }
9616
9617 return true;
9618 }
9619
9621 {
9622 if (!super.CanPutAsAttachment(parent))
9623 {
9624 return false;
9625 }
9626
9627 if (!IsRuined() && !parent.IsRuined())
9628 {
9629 return true;
9630 }
9631
9632 return false;
9633 }
9634
9636 {
9637
9638
9639
9640
9641 return super.CanReceiveItemIntoCargo(item);
9642 }
9643
9645 {
9646
9647
9648
9649
9650 GameInventory attachmentInv = attachment.GetInventory();
9652 {
9653 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9654 return false;
9655 }
9656
9657 InventoryLocation loc = new InventoryLocation();
9658 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9659 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9660 return false;
9661
9662 return super.CanReceiveAttachment(attachment, slotId);
9663 }
9664
9666 {
9667 if (!super.CanReleaseAttachment(attachment))
9668 return false;
9669
9670 return GetInventory().AreChildrenAccessible();
9671 }
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9694 {
9695 int id = muzzle_owner.GetMuzzleID();
9696 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9697
9698 if (WPOF_array)
9699 {
9700 for (int i = 0; i < WPOF_array.Count(); i++)
9701 {
9702 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9703
9704 if (WPOF)
9705 {
9706 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9707 }
9708 }
9709 }
9710 }
9711
9712
9714 {
9715 int id = muzzle_owner.GetMuzzleID();
9717
9718 if (WPOBE_array)
9719 {
9720 for (int i = 0; i < WPOBE_array.Count(); i++)
9721 {
9722 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9723
9724 if (WPOBE)
9725 {
9726 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9727 }
9728 }
9729 }
9730 }
9731
9732
9734 {
9735 int id = muzzle_owner.GetMuzzleID();
9736 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9737
9738 if (WPOOH_array)
9739 {
9740 for (int i = 0; i < WPOOH_array.Count(); i++)
9741 {
9742 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9743
9744 if (WPOOH)
9745 {
9746 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9747 }
9748 }
9749 }
9750 }
9751
9752
9754 {
9755 int id = muzzle_owner.GetMuzzleID();
9756 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9757
9758 if (WPOOH_array)
9759 {
9760 for (int i = 0; i < WPOOH_array.Count(); i++)
9761 {
9762 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9763
9764 if (WPOOH)
9765 {
9766 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9767 }
9768 }
9769 }
9770 }
9771
9772
9774 {
9775 int id = muzzle_owner.GetMuzzleID();
9776 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9777
9778 if (WPOOH_array)
9779 {
9780 for (int i = 0; i < WPOOH_array.Count(); i++)
9781 {
9782 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9783
9784 if (WPOOH)
9785 {
9786 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9787 }
9788 }
9789 }
9790 }
9791
9792
9793
9795 {
9797 {
9798 return true;
9799 }
9800
9801 return false;
9802 }
9803
9805 {
9807 {
9808 return true;
9809 }
9810
9811 return false;
9812 }
9813
9815 {
9817 {
9818 return true;
9819 }
9820
9821 return false;
9822 }
9823
9825 {
9826 return false;
9827 }
9828
9831 {
9832 return UATimeSpent.DEFAULT_DEPLOY;
9833 }
9834
9835
9836
9837
9839 {
9841 SetSynchDirty();
9842 }
9843
9845 {
9847 }
9848
9849
9851 {
9852 return false;
9853 }
9854
9857 {
9858 string att_type = "None";
9859
9860 if (ConfigIsExisting("soundAttType"))
9861 {
9862 att_type = ConfigGetString("soundAttType");
9863 }
9864
9866 }
9867
9869 {
9871 }
9872
9873
9874
9875
9876
9882
9884 {
9887
9889 }
9890
9891
9893 {
9895 return;
9896
9898
9901
9904
9905 SoundParameters params = new SoundParameters();
9909 }
9910
9911
9913 {
9915 return;
9916
9918 SetSynchDirty();
9919
9922 }
9923
9924
9926 {
9928 return;
9929
9931 SetSynchDirty();
9932
9935 }
9936
9938 {
9940 }
9941
9943 {
9945 }
9946
9949 {
9950 if (!
GetGame().IsDedicatedServer())
9951 {
9952 if (ConfigIsExisting("attachSoundSet"))
9953 {
9954 string cfg_path = "";
9955 string soundset = "";
9957
9960 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9961 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9962
9963 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9964 {
9965 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9966 {
9967 if (cfg_slot_array[i] == slot_type)
9968 {
9969 soundset = cfg_soundset_array[i];
9970 break;
9971 }
9972 }
9973 }
9974
9975 if (soundset != "")
9976 {
9977 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9979 }
9980 }
9981 }
9982 }
9983
9985 {
9986
9987 }
9988
9989 void OnApply(PlayerBase player);
9990
9992 {
9993 return 1.0;
9994 };
9995
9997 {
9999 }
10000
10002 {
10004 }
10005
10007
10009 {
10010 SetDynamicPhysicsLifeTime(0.01);
10012 }
10013
10015 {
10016 array<string> zone_names = new array<string>;
10017 GetDamageZones(zone_names);
10018 for (int i = 0; i < zone_names.Count(); i++)
10019 {
10020 SetHealthMax(zone_names.Get(i),"Health");
10021 }
10022 SetHealthMax("","Health");
10023 }
10024
10027 {
10028 float global_health = GetHealth01("","Health");
10029 array<string> zones = new array<string>;
10030 GetDamageZones(zones);
10031
10032 for (int i = 0; i < zones.Count(); i++)
10033 {
10034 SetHealth01(zones.Get(i),"Health",global_health);
10035 }
10036 }
10037
10040 {
10041 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10042 }
10043
10045 {
10046 if (!hasRootAsPlayer)
10047 {
10048 if (refParentIB)
10049 {
10050
10051 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10052 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10053
10054 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10055 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10056
10059 }
10060 else
10061 {
10062
10065 }
10066 }
10067 }
10068
10070 {
10072 {
10073 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10074 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10075 {
10076 float heatPermCoef = 1.0;
10078 while (ent)
10079 {
10080 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10081 ent = ent.GetHierarchyParent();
10082 }
10083
10084 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10085 }
10086 }
10087 }
10088
10090 {
10091
10092 EntityAI parent = GetHierarchyParent();
10093 if (!parent)
10094 {
10095 hasParent = false;
10096 hasRootAsPlayer = false;
10097 }
10098 else
10099 {
10100 hasParent = true;
10101 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10102 refParentIB =
ItemBase.Cast(parent);
10103 }
10104 }
10105
10106 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10107 {
10108
10109 }
10110
10112 {
10113
10114 return false;
10115 }
10116
10118 {
10119
10120
10121 return false;
10122 }
10123
10125 {
10126
10127 return false;
10128 }
10129
10132 {
10133 return !GetIsFrozen() &&
IsOpen();
10134 }
10135
10137 {
10138 bool hasParent = false, hasRootAsPlayer = false;
10140
10141 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10142 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10143
10144 if (wwtu || foodDecay)
10145 {
10149
10150 if (processWetness || processTemperature || processDecay)
10151 {
10153
10154 if (processWetness)
10155 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10156
10157 if (processTemperature)
10159
10160 if (processDecay)
10161 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10162 }
10163 }
10164 }
10165
10168 {
10170 }
10171
10173 {
10176
10177 return super.GetTemperatureFreezeThreshold();
10178 }
10179
10181 {
10184
10185 return super.GetTemperatureThawThreshold();
10186 }
10187
10189 {
10192
10193 return super.GetItemOverheatThreshold();
10194 }
10195
10197 {
10199 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10200
10201 return super.GetTemperatureFreezeTime();
10202 }
10203
10205 {
10207 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10208
10209 return super.GetTemperatureThawTime();
10210 }
10211
10216
10218 {
10219 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10220 }
10221
10223 {
10224 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10225 }
10226
10229 {
10231 }
10232
10234 {
10236 }
10237
10239 {
10241 }
10242
10245 {
10246 return null;
10247 }
10248
10251 {
10252 return false;
10253 }
10254
10256 {
10258 {
10261 if (!trg)
10262 {
10264 explosive = this;
10265 }
10266
10267 explosive.PairRemote(trg);
10269
10270 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10271 trg.SetPersistentPairID(persistentID);
10272 explosive.SetPersistentPairID(persistentID);
10273
10274 return true;
10275 }
10276 return false;
10277 }
10278
10281 {
10282 float ret = 1.0;
10285 ret *= GetHealth01();
10286
10287 return ret;
10288 }
10289
10290 #ifdef DEVELOPER
10291 override void SetDebugItem()
10292 {
10293 super.SetDebugItem();
10294 _itemBase = this;
10295 }
10296
10298 {
10299 string text = super.GetDebugText();
10300
10302 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10303
10304 return text;
10305 }
10306 #endif
10307
10309 {
10310 return true;
10311 }
10312
10314
10316
10318 {
10321 }
10322
10323
10331
10347}
10348
10350{
10352 if (entity)
10353 {
10354 bool is_item = entity.IsInherited(
ItemBase);
10355 if (is_item && full_quantity)
10356 {
10359 }
10360 }
10361 else
10362 {
10364 return NULL;
10365 }
10366 return entity;
10367}
10368
10370{
10371 if (item)
10372 {
10373 if (health > 0)
10374 item.SetHealth("", "", health);
10375
10376 if (item.CanHaveTemperature())
10377 {
10379 if (item.CanFreeze())
10380 item.SetFrozen(false);
10381 }
10382
10383 if (item.HasEnergyManager())
10384 {
10385 if (quantity >= 0)
10386 {
10387 item.GetCompEM().SetEnergy0To1(quantity);
10388 }
10389 else
10390 {
10392 }
10393 }
10394 else if (item.IsMagazine())
10395 {
10396 Magazine mag = Magazine.Cast(item);
10397 if (quantity >= 0)
10398 {
10399 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10400 }
10401 else
10402 {
10404 }
10405
10406 }
10407 else
10408 {
10409 if (quantity >= 0)
10410 {
10411 item.SetQuantityNormalized(quantity, false);
10412 }
10413 else
10414 {
10416 }
10417
10418 }
10419 }
10420}
10421
10422#ifdef DEVELOPER
10424#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.