5461{
5463 {
5464 return true;
5465 }
5466};
5467
5468
5469
5471{
5475
5477
5480
5481
5482
5483
5484
5493
5499
5504
5509
5530 protected bool m_IsResultOfSplit
5531
5533
5538
5539
5540
5542
5546
5547
5548
5550
5553
5554
5555
5561
5562
5570
5573
5574
5576
5577
5579
5580
5585
5586
5591
5592
5594
5595
5597 {
5602
5603 if (!
GetGame().IsDedicatedServer())
5604 {
5606 {
5608
5610 {
5612 }
5613 }
5614
5617 }
5618
5619 m_OldLocation = null;
5620
5622 {
5624 }
5625
5626 if (ConfigIsExisting("headSelectionsToHide"))
5627 {
5630 }
5631
5633 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5634 {
5636 }
5637
5639
5640 m_IsResultOfSplit = false;
5641
5643 }
5644
5646 {
5647 super.InitItemVariables();
5648
5654 m_Count = ConfigGetInt(
"count");
5655
5658
5663
5666
5671
5683
5687
5688
5691 if (ConfigIsExisting("canBeSplit"))
5692 {
5695 }
5696
5698 if (ConfigIsExisting("itemBehaviour"))
5700
5701
5704 RegisterNetSyncVariableInt("m_VarLiquidType");
5705 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5706
5707 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5708 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5709 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5710
5711 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5712 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5713 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5714 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5715
5716 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5717 RegisterNetSyncVariableBool("m_IsTakeable");
5718 RegisterNetSyncVariableBool("m_IsHologram");
5719
5722 {
5725 }
5726
5728
5730 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5732
5733 }
5734
5736 {
5738 }
5739
5741 {
5744 {
5749 }
5750 }
5751
5752 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5753 {
5755 {
5758 }
5759
5761 }
5762
5764 {
5770 }
5771
5773
5775 {
5777
5778 if (!action)
5779 {
5780 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5781 return;
5782 }
5783
5785 if (!ai)
5786 {
5788 return;
5789 }
5790
5792 if (!action_array)
5793 {
5794 action_array = new array<ActionBase_Basic>;
5796 }
5797 if (LogManager.IsActionLogEnable())
5798 {
5799 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5800 }
5801
5802 if (action_array.Find(action) != -1)
5803 {
5804 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5805 }
5806 else
5807 {
5808 action_array.Insert(action);
5809 }
5810 }
5811
5813 {
5815 ActionBase action = player.GetActionManager().GetAction(actionName);
5818
5819 if (action_array)
5820 {
5821 action_array.RemoveItem(action);
5822 }
5823 }
5824
5825
5826
5828 {
5829 ActionOverrideData overrideData = new ActionOverrideData();
5833
5835 if (!actionMap)
5836 {
5839 }
5840
5841 actionMap.Insert(this.
Type(), overrideData);
5842
5843 }
5844
5846
5848
5849
5851 {
5854
5857
5858 string config_to_search = "CfgVehicles";
5859 string muzzle_owner_config;
5860
5862 {
5863 if (IsInherited(Weapon))
5864 config_to_search = "CfgWeapons";
5865
5866 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5867
5868 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5869
5871
5872 if (config_OnFire_subclass_count > 0)
5873 {
5874 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5875
5876 for (int i = 0; i < config_OnFire_subclass_count; i++)
5877 {
5878 string particle_class = "";
5880 string config_OnFire_entry = config_OnFire_class + particle_class;
5881 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5882 WPOF_array.Insert(WPOF);
5883 }
5884
5885
5887 }
5888 }
5889
5891 {
5892 config_to_search = "CfgWeapons";
5893 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5894
5895 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5896
5898
5899 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5900 {
5901 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5902
5903 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5904 {
5905 string particle_class2 = "";
5907 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5908 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5909 WPOBE_array.Insert(WPOBE);
5910 }
5911
5912
5914 }
5915 }
5916 }
5917
5918
5920 {
5923
5925 {
5926 string config_to_search = "CfgVehicles";
5927
5928 if (IsInherited(Weapon))
5929 config_to_search = "CfgWeapons";
5930
5931 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5932 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5933
5934 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5935 {
5936
5938
5940 {
5942 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5944 return;
5945 }
5946
5949
5950
5951
5953 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5954
5955 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5956 {
5957 string particle_class = "";
5959 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
5961
5962 if (entry_type == CT_CLASS)
5963 {
5964 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
5965 WPOOH_array.Insert(WPOF);
5966 }
5967 }
5968
5969
5971 }
5972 }
5973 }
5974
5976 {
5978 }
5979
5981 {
5983 {
5985
5988
5991
5992 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
5993 }
5994 }
5995
5997 {
5999 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6000
6002 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6003
6005 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6006
6008 {
6010 }
6011 }
6012
6014 {
6016 }
6017
6019 {
6022 else
6024
6026 {
6029 }
6030 else
6031 {
6034
6037 }
6038
6040 }
6041
6043 {
6045 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6046 }
6047
6049 {
6051 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6053 }
6054
6056 {
6058 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6059 }
6060
6062 {
6065
6066 OverheatingParticle OP = new OverheatingParticle();
6071
6073 }
6074
6076 {
6079
6080 return -1;
6081 }
6082
6084 {
6086 {
6089
6090 for (int i = count; i > 0; --i)
6091 {
6092 int id = i - 1;
6095
6098
6099 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6100 {
6101 if (p)
6102 {
6105 }
6106 }
6107 }
6108 }
6109 }
6110
6112 {
6114 {
6116 {
6117 int id = i - 1;
6119
6120 if (OP)
6121 {
6123
6124 if (p)
6125 {
6127 }
6128
6129 delete OP;
6130 }
6131 }
6132
6135 }
6136 }
6137
6140 {
6141 return 0.0;
6142 }
6143
6144
6146 {
6147 return 250;
6148 }
6149
6151 {
6152 return 0;
6153 }
6154
6157 {
6159 return true;
6160
6161 return false;
6162 }
6163
6166 {
6169
6171 {
6173 }
6174 else
6175 {
6176
6178 }
6179
6181 }
6182
6189 {
6190 return -1;
6191 }
6192
6193
6194
6195
6197 {
6199 {
6201 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6202
6203 if (r_index >= 0)
6204 {
6205 InventoryLocation r_il = new InventoryLocation;
6206 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6207
6208 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6211 {
6212 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6213 }
6215 {
6216 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6217 }
6218
6219 }
6220
6221 player.GetHumanInventory().ClearUserReservedLocation(this);
6222 }
6223
6226 }
6227
6228
6229
6230
6232 {
6233 return ItemBase.m_DebugActionsMask;
6234 }
6235
6237 {
6238 return ItemBase.m_DebugActionsMask & mask;
6239 }
6240
6242 {
6243 ItemBase.m_DebugActionsMask = mask;
6244 }
6245
6247 {
6248 ItemBase.m_DebugActionsMask |= mask;
6249 }
6250
6252 {
6253 ItemBase.m_DebugActionsMask &= ~mask;
6254 }
6255
6257 {
6259 {
6261 }
6262 else
6263 {
6265 }
6266 }
6267
6268
6270 {
6271 if (GetEconomyProfile())
6272 {
6273 float q_max = GetEconomyProfile().GetQuantityMax();
6274 if (q_max > 0)
6275 {
6276 float q_min = GetEconomyProfile().GetQuantityMin();
6277 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6278
6280 {
6281 ComponentEnergyManager comp = GetCompEM();
6283 {
6285 }
6286 }
6288 {
6290
6291 }
6292
6293 }
6294 }
6295 }
6296
6299 {
6300 EntityAI parent = GetHierarchyParent();
6301
6302 if (parent)
6303 {
6304 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6305 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6306 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6307 }
6308 }
6309
6312 {
6313 EntityAI parent = GetHierarchyParent();
6314
6315 if (parent)
6316 {
6317 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6318 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6319 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6320 }
6321 }
6322
6324 {
6325
6326
6327
6328
6330
6332 {
6333 if (ScriptInputUserData.CanStoreInputUserData())
6334 {
6335 ScriptInputUserData ctx = new ScriptInputUserData;
6341 ctx.
Write(use_stack_max);
6344
6346 {
6347 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6348 }
6349 }
6350 }
6351 else if (!
GetGame().IsMultiplayer())
6352 {
6354 }
6355 }
6356
6358 {
6360 }
6361
6363 {
6365 }
6366
6368 {
6370 }
6371
6373 {
6374
6375 return false;
6376 }
6377
6379 {
6380 return false;
6381 }
6382
6386 {
6387 return false;
6388 }
6389
6391 {
6392 return "";
6393 }
6394
6396
6398 {
6399 return false;
6400 }
6401
6403 {
6404 return true;
6405 }
6406
6407
6408
6410 {
6411 return true;
6412 }
6413
6415 {
6416 return true;
6417 }
6418
6420 {
6421 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6423 }
6424
6426 {
6428 }
6429
6431 {
6433 if (!is_being_placed)
6435 SetSynchDirty();
6436 }
6437
6438
6440
6442 {
6444 }
6445
6447 {
6449 }
6450
6452 {
6453 return 1;
6454 }
6455
6457 {
6458 return false;
6459 }
6460
6462 {
6464 SetSynchDirty();
6465 }
6466
6467
6468
6469
6470
6471
6472
6473
6474
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
6502 {
6503 super.OnMovedInsideCargo(container);
6504
6505 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6506 }
6507
6508 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6509 {
6510 super.EEItemLocationChanged(oldLoc,newLoc);
6511
6512 PlayerBase new_player = null;
6513 PlayerBase old_player = null;
6514
6515 if (newLoc.GetParent())
6516 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6517
6518 if (oldLoc.GetParent())
6519 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6520
6522 {
6523 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6524
6525 if (r_index >= 0)
6526 {
6527 InventoryLocation r_il = new InventoryLocation;
6528 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6529
6530 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6533 {
6534 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6535 }
6537 {
6538 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6539 }
6540
6541 }
6542 }
6543
6545 {
6546 if (new_player)
6547 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6548
6549 if (new_player == old_player)
6550 {
6551
6552 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6553 {
6555 {
6556 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6557 {
6558 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6559 }
6560 }
6561 else
6562 {
6563 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6564 }
6565 }
6566
6567 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6568 {
6569 int type = oldLoc.GetType();
6571 {
6572 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6573 }
6575 {
6576 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6577 }
6578 }
6579 if (!m_OldLocation)
6580 {
6581 m_OldLocation = new InventoryLocation;
6582 }
6583 m_OldLocation.Copy(oldLoc);
6584 }
6585 else
6586 {
6587 if (m_OldLocation)
6588 {
6589 m_OldLocation.Reset();
6590 }
6591 }
6592
6594 }
6595 else
6596 {
6597 if (new_player)
6598 {
6599 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6600 if (res_index >= 0)
6601 {
6602 InventoryLocation il = new InventoryLocation;
6603 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6605 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6608 {
6609 il.
GetParent().GetOnReleaseLock().Invoke(it);
6610 }
6612 {
6614 }
6615
6616 }
6617 }
6619 {
6620
6622 }
6623
6624 if (m_OldLocation)
6625 {
6626 m_OldLocation.Reset();
6627 }
6628 }
6629 }
6630
6631 override void EOnContact(IEntity other, Contact extra)
6632 {
6634 {
6635 int liquidType = -1;
6637 if (impactSpeed > 0.0)
6638 {
6640 #ifndef SERVER
6642 #else
6644 SetSynchDirty();
6645 #endif
6647 }
6648 }
6649
6650 #ifdef SERVER
6651 if (GetCompEM() && GetCompEM().IsPlugged())
6652 {
6653 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6654 GetCompEM().UnplugThis();
6655 }
6656 #endif
6657 }
6658
6660
6662 {
6664 }
6665
6667 {
6668
6669 }
6670
6672 {
6673 super.OnItemLocationChanged(old_owner, new_owner);
6674
6675 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6676 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6677
6678 if (!relatedPlayer && playerNew)
6679 relatedPlayer = playerNew;
6680
6681 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6682 {
6684 if (actionMgr)
6685 {
6686 ActionBase currentAction = actionMgr.GetRunningAction();
6687 if (currentAction)
6689 }
6690 }
6691
6692 Man ownerPlayerOld = null;
6693 Man ownerPlayerNew = null;
6694
6695 if (old_owner)
6696 {
6697 if (old_owner.
IsMan())
6698 {
6699 ownerPlayerOld = Man.Cast(old_owner);
6700 }
6701 else
6702 {
6703 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6704 }
6705 }
6706 else
6707 {
6709 {
6711
6712 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6713 {
6714 GetCompEM().UnplugThis();
6715 }
6716 }
6717 }
6718
6719 if (new_owner)
6720 {
6721 if (new_owner.
IsMan())
6722 {
6723 ownerPlayerNew = Man.Cast(new_owner);
6724 }
6725 else
6726 {
6727 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6728 }
6729 }
6730
6731 if (ownerPlayerOld != ownerPlayerNew)
6732 {
6733 if (ownerPlayerOld)
6734 {
6735 array<EntityAI> subItemsExit = new array<EntityAI>;
6737 for (int i = 0; i < subItemsExit.Count(); i++)
6738 {
6741 }
6742 }
6743
6744 if (ownerPlayerNew)
6745 {
6746 array<EntityAI> subItemsEnter = new array<EntityAI>;
6748 for (int j = 0; j < subItemsEnter.Count(); j++)
6749 {
6752 }
6753 }
6754 }
6755 else if (ownerPlayerNew != null)
6756 {
6757 PlayerBase nplayer;
6758 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6759 {
6760 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6762 for (int k = 0; k < subItemsUpdate.Count(); k++)
6763 {
6765 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6766 }
6767 }
6768 }
6769
6770 if (old_owner)
6771 old_owner.OnChildItemRemoved(this);
6772 if (new_owner)
6773 new_owner.OnChildItemReceived(this);
6774 }
6775
6776
6778 {
6779 super.EEDelete(parent);
6780 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6781 if (player)
6782 {
6784
6785 if (player.IsAlive())
6786 {
6787 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6788 if (r_index >= 0)
6789 {
6790 InventoryLocation r_il = new InventoryLocation;
6791 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6792
6793 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6796 {
6797 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6798 }
6800 {
6801 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6802 }
6803
6804 }
6805
6806 player.RemoveQuickBarEntityShortcut(this);
6807 }
6808 }
6809 }
6810
6812 {
6813 super.EEKilled(killer);
6814
6817 {
6818 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6819 {
6820 if (IsMagazine())
6821 {
6822 if (Magazine.Cast(this).GetAmmoCount() > 0)
6823 {
6825 }
6826 }
6827 else
6828 {
6830 }
6831 }
6832 }
6833 }
6834
6836 {
6837 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6838
6839 super.OnWasAttached(parent, slot_id);
6840
6843
6845 }
6846
6848 {
6849 super.OnWasDetached(parent, slot_id);
6850
6853 }
6854
6856 {
6857 int idx;
6860
6861 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6862 if (inventory_slots.Count() < 1)
6863 {
6864 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6865 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6866 }
6867 else
6868 {
6869 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6870 }
6871
6872 idx = inventory_slots.Find(slot);
6873 if (idx < 0)
6874 return "";
6875
6876 return attach_types.Get(idx);
6877 }
6878
6880 {
6881 int idx = -1;
6882 string slot;
6883
6886
6887 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6888 if (inventory_slots.Count() < 1)
6889 {
6890 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6891 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6892 }
6893 else
6894 {
6895 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6896 if (detach_types.Count() < 1)
6897 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6898 }
6899
6900 for (int i = 0; i < inventory_slots.Count(); i++)
6901 {
6902 slot = inventory_slots.Get(i);
6903 }
6904
6905 if (slot != "")
6906 {
6907 if (detach_types.Count() == 1)
6908 idx = 0;
6909 else
6910 idx = inventory_slots.Find(slot);
6911 }
6912 if (idx < 0)
6913 return "";
6914
6915 return detach_types.Get(idx);
6916 }
6917
6919 {
6920
6922
6923
6924 float min_time = 1;
6925 float max_time = 3;
6926 float delay = Math.RandomFloat(min_time, max_time);
6927
6928 explode_timer.Run(delay, this, "DoAmmoExplosion");
6929 }
6930
6932 {
6933 Magazine magazine = Magazine.Cast(this);
6934 int pop_sounds_count = 6;
6935 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6936
6937
6938 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6939 string sound_name = pop_sounds[ sound_idx ];
6941
6942
6943 magazine.ServerAddAmmoCount(-1);
6944
6945
6946 float min_temp_to_explode = 100;
6947
6948 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
6949 {
6951 }
6952 }
6953
6954
6955 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6956 {
6957 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
6958
6959 const int CHANCE_DAMAGE_CARGO = 4;
6960 const int CHANCE_DAMAGE_ATTACHMENT = 1;
6961 const int CHANCE_DAMAGE_NOTHING = 2;
6962
6964 {
6965 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
6966 int chances;
6967 int rnd;
6968
6969 if (GetInventory().GetCargo())
6970 {
6971 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6972 rnd = Math.RandomInt(0,chances);
6973
6974 if (rnd < CHANCE_DAMAGE_CARGO)
6975 {
6977 }
6978 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
6979 {
6981 }
6982 }
6983 else
6984 {
6985 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
6986 rnd = Math.RandomInt(0,chances);
6987
6988 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
6989 {
6991 }
6992 }
6993 }
6994 }
6995
6997 {
6998 if (GetInventory().GetCargo())
6999 {
7000 int item_count = GetInventory().GetCargo().GetItemCount();
7001 if (item_count > 0)
7002 {
7003 int random_pick = Math.RandomInt(0, item_count);
7005 if (!item.IsExplosive())
7006 {
7007 item.AddHealth("","",damage);
7008 return true;
7009 }
7010 }
7011 }
7012 return false;
7013 }
7014
7016 {
7017 int attachment_count = GetInventory().AttachmentCount();
7018 if (attachment_count > 0)
7019 {
7020 int random_pick = Math.RandomInt(0, attachment_count);
7021 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7022 if (!attachment.IsExplosive())
7023 {
7024 attachment.AddHealth("","",damage);
7025 return true;
7026 }
7027 }
7028 return false;
7029 }
7030
7032 {
7034 }
7035
7037 {
7039 return GetInventory().CanRemoveEntity();
7040
7041 return false;
7042 }
7043
7045 {
7047 return;
7048
7050 {
7051 if (ScriptInputUserData.CanStoreInputUserData())
7052 {
7053 ScriptInputUserData ctx = new ScriptInputUserData;
7058 ctx.
Write(destination_entity);
7062 }
7063 }
7064 else if (!
GetGame().IsMultiplayer())
7065 {
7067 }
7068 }
7069
7071 {
7073 return;
7074
7075 float split_quantity_new;
7079 InventoryLocation loc = new InventoryLocation;
7080
7081 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7082 {
7084 split_quantity_new = stack_max;
7085 else
7087
7088 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7089 if (new_item)
7090 {
7091 new_item.SetResultOfSplit(true);
7092 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7094 new_item.SetQuantity(split_quantity_new);
7095 }
7096 }
7097 else if (destination_entity && slot_id == -1)
7098 {
7099 if (quantity > stack_max)
7100 split_quantity_new = stack_max;
7101 else
7102 split_quantity_new = quantity;
7103
7105 {
7108 }
7109
7110 if (new_item)
7111 {
7112 new_item.SetResultOfSplit(true);
7113 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7115 new_item.SetQuantity(split_quantity_new);
7116 }
7117 }
7118 else
7119 {
7120 if (stack_max != 0)
7121 {
7123 {
7125 }
7126
7127 if (split_quantity_new == 0)
7128 {
7129 if (!
GetGame().IsMultiplayer())
7130 player.PhysicalPredictiveDropItem(this);
7131 else
7132 player.ServerDropEntity(this);
7133 return;
7134 }
7135
7137
7138 if (new_item)
7139 {
7140 new_item.SetResultOfSplit(true);
7141 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7143 new_item.SetQuantity(stack_max);
7144 new_item.PlaceOnSurface();
7145 }
7146 }
7147 }
7148 }
7149
7151 {
7153 return;
7154
7155 float split_quantity_new;
7159 InventoryLocation loc = new InventoryLocation;
7160
7161 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7162 {
7164 split_quantity_new = stack_max;
7165 else
7167
7168 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7169 if (new_item)
7170 {
7171 new_item.SetResultOfSplit(true);
7172 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7174 new_item.SetQuantity(split_quantity_new);
7175 }
7176 }
7177 else if (destination_entity && slot_id == -1)
7178 {
7179 if (quantity > stack_max)
7180 split_quantity_new = stack_max;
7181 else
7182 split_quantity_new = quantity;
7183
7185 {
7188 }
7189
7190 if (new_item)
7191 {
7192 new_item.SetResultOfSplit(true);
7193 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7195 new_item.SetQuantity(split_quantity_new);
7196 }
7197 }
7198 else
7199 {
7200 if (stack_max != 0)
7201 {
7203 {
7205 }
7206
7208
7209 if (new_item)
7210 {
7211 new_item.SetResultOfSplit(true);
7212 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7214 new_item.SetQuantity(stack_max);
7215 new_item.PlaceOnSurface();
7216 }
7217 }
7218 }
7219 }
7220
7222 {
7224 return;
7225
7227 {
7228 if (ScriptInputUserData.CanStoreInputUserData())
7229 {
7230 ScriptInputUserData ctx = new ScriptInputUserData;
7235 dst.WriteToContext(ctx);
7237 }
7238 }
7239 else if (!
GetGame().IsMultiplayer())
7240 {
7242 }
7243 }
7244
7246 {
7248 return;
7249
7251 {
7252 if (ScriptInputUserData.CanStoreInputUserData())
7253 {
7254 ScriptInputUserData ctx = new ScriptInputUserData;
7259 ctx.
Write(destination_entity);
7265 }
7266 }
7267 else if (!
GetGame().IsMultiplayer())
7268 {
7270 }
7271 }
7272
7274 {
7276 }
7277
7279 {
7281 return this;
7282
7284 float split_quantity_new;
7286 if (dst.IsValid())
7287 {
7288 int slot_id = dst.GetSlot();
7290
7291 if (quantity > stack_max)
7292 split_quantity_new = stack_max;
7293 else
7294 split_quantity_new = quantity;
7295
7297
7298 if (new_item)
7299 {
7300 new_item.SetResultOfSplit(true);
7301 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7304 }
7305
7306 return new_item;
7307 }
7308
7309 return null;
7310 }
7311
7313 {
7315 return;
7316
7318 float split_quantity_new;
7320 if (destination_entity)
7321 {
7323 if (quantity > stackable)
7324 split_quantity_new = stackable;
7325 else
7326 split_quantity_new = quantity;
7327
7328 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7329 if (new_item)
7330 {
7331 new_item.SetResultOfSplit(true);
7332 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7334 new_item.SetQuantity(split_quantity_new);
7335 }
7336 }
7337 }
7338
7340 {
7342 return;
7343
7345 {
7346 if (ScriptInputUserData.CanStoreInputUserData())
7347 {
7348 ScriptInputUserData ctx = new ScriptInputUserData;
7353 ItemBase destination_entity =
this;
7354 ctx.
Write(destination_entity);
7358 }
7359 }
7360 else if (!
GetGame().IsMultiplayer())
7361 {
7363 }
7364 }
7365
7367 {
7369 return;
7370
7372 float split_quantity_new;
7374 if (player)
7375 {
7377 if (quantity > stackable)
7378 split_quantity_new = stackable;
7379 else
7380 split_quantity_new = quantity;
7381
7382 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7383 new_item =
ItemBase.Cast(in_hands);
7384 if (new_item)
7385 {
7386 new_item.SetResultOfSplit(true);
7387 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7389 new_item.SetQuantity(split_quantity_new);
7390 }
7391 }
7392 }
7393
7395 {
7397 return;
7398
7400 float split_quantity_new = Math.Floor(quantity * 0.5);
7401
7403
7404 if (new_item)
7405 {
7406 if (new_item.GetQuantityMax() < split_quantity_new)
7407 {
7408 split_quantity_new = new_item.GetQuantityMax();
7409 }
7410
7411 new_item.SetResultOfSplit(true);
7412 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7413
7415 {
7418 }
7419 else
7420 {
7423 }
7424 }
7425 }
7426
7428 {
7430 return;
7431
7433 float split_quantity_new = Math.Floor(quantity / 2);
7434
7435 InventoryLocation invloc = new InventoryLocation;
7437
7439 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7440
7441 if (new_item)
7442 {
7443 if (new_item.GetQuantityMax() < split_quantity_new)
7444 {
7445 split_quantity_new = new_item.GetQuantityMax();
7446 }
7448 {
7451 }
7452 else
7453 {
7456 }
7457 }
7458 }
7459
7462 {
7463 SetWeightDirty();
7465
7466 if (parent)
7467 parent.OnAttachmentQuantityChangedEx(this, delta);
7468
7470 {
7472 {
7474 }
7476 {
7477 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7479 }
7480 }
7481
7482 }
7483
7486 {
7487
7488 }
7489
7492 {
7494 }
7495
7497 {
7498 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7499
7501 {
7502 if (newLevel == GameConstants.STATE_RUINED)
7503 {
7505 EntityAI parent = GetHierarchyParent();
7506 if (parent && parent.IsFireplace())
7507 {
7508 CargoBase cargo = GetInventory().GetCargo();
7509 if (cargo)
7510 {
7512 {
7514 }
7515 }
7516 }
7517 }
7518
7520 {
7521
7523 return;
7524 }
7525
7526 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7527 {
7529 }
7530 }
7531 }
7532
7533
7535 {
7536 super.OnRightClick();
7537
7539 {
7541 {
7542 if (ScriptInputUserData.CanStoreInputUserData())
7543 {
7544 vector m4[4];
7546
7547 EntityAI root = GetHierarchyRoot();
7548
7549 InventoryLocation dst = new InventoryLocation;
7551 {
7552 if (root)
7553 {
7554 root.GetTransform(m4);
7556 }
7557 else
7558 GetInventory().GetCurrentInventoryLocation(dst);
7559 }
7560 else
7561 {
7563
7564
7565 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7566 {
7567 if (root)
7568 {
7569 root.GetTransform(m4);
7571 }
7572 else
7573 GetInventory().GetCurrentInventoryLocation(dst);
7574 }
7575 else
7576 {
7577 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7578 }
7579 }
7580
7581 ScriptInputUserData ctx = new ScriptInputUserData;
7589 }
7590 }
7591 else if (!
GetGame().IsMultiplayer())
7592 {
7594 }
7595 }
7596 }
7597
7598 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7599 {
7600
7601 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7602 return false;
7603
7604 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7605 return false;
7606
7607
7609 return false;
7610
7611
7612 Magazine mag = Magazine.Cast(this);
7613 if (mag)
7614 {
7615 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7616 return false;
7617
7618 if (stack_max_limit)
7619 {
7620 Magazine other_mag = Magazine.Cast(other_item);
7621 if (other_item)
7622 {
7623 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7624 return false;
7625 }
7626
7627 }
7628 }
7629 else
7630 {
7631
7633 return false;
7634
7636 return false;
7637 }
7638
7639 PlayerBase player = null;
7640 if (CastTo(player, GetHierarchyRootPlayer()))
7641 {
7642 if (player.GetInventory().HasAttachment(this))
7643 return false;
7644
7645 if (player.IsItemsToDelete())
7646 return false;
7647 }
7648
7649 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7650 return false;
7651
7652 int slotID;
7654 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7655 return false;
7656
7657 return true;
7658 }
7659
7661 {
7663 }
7664
7666 {
7667 return m_IsResultOfSplit;
7668 }
7669
7671 {
7672 m_IsResultOfSplit = value;
7673 }
7674
7676 {
7678 }
7679
7681 {
7682 float other_item_quantity = other_item.GetQuantity();
7683 float this_free_space;
7684
7686
7688
7689 if (other_item_quantity > this_free_space)
7690 {
7691 return this_free_space;
7692 }
7693 else
7694 {
7695 return other_item_quantity;
7696 }
7697 }
7698
7700 {
7702 }
7703
7705 {
7707 return;
7708
7709 if (!IsMagazine() && other_item)
7710 {
7712 if (quantity_used != 0)
7713 {
7714 float hp1 = GetHealth01("","");
7715 float hp2 = other_item.GetHealth01("","");
7716 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7717 hpResult = hpResult / (
GetQuantity() + quantity_used);
7718
7719 hpResult *= GetMaxHealth();
7720 Math.Round(hpResult);
7721 SetHealth("", "Health", hpResult);
7722
7724 other_item.AddQuantity(-quantity_used);
7725 }
7726 }
7728 }
7729
7731 {
7732 #ifdef SERVER
7733 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7734 GetHierarchyParent().IncreaseLifetimeUp();
7735 #endif
7736 };
7737
7739 {
7740 PlayerBase p = PlayerBase.Cast(player);
7741
7742 array<int> recipesIds = p.m_Recipes;
7743 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7744 if (moduleRecipesManager)
7745 {
7746 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7747 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7748 }
7749
7750 for (int i = 0;i < recipesIds.Count(); i++)
7751 {
7752 int key = recipesIds.Get(i);
7753 string recipeName = moduleRecipesManager.GetRecipeName(key);
7755 }
7756 }
7757
7758
7759 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7760 {
7761 super.GetDebugActions(outputList);
7762
7763
7768
7769
7773
7777
7778
7781
7782
7784 {
7787 }
7788
7790
7793
7797 }
7798
7799
7800
7801
7803 {
7804 super.OnAction(action_id, player, ctx);
7805 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7806 {
7807 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7808 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7809 PlayerBase p = PlayerBase.Cast(player);
7810 if (
EActions.RECIPES_RANGE_START < 1000)
7811 {
7812 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7813 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7814 }
7815 }
7816 #ifndef SERVER
7817 else if (action_id ==
EActions.WATCH_PLAYER)
7818 {
7819 PluginDeveloper.SetDeveloperItemClientEx(player);
7820 }
7821 #endif
7823 {
7824 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7825 {
7826 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7827 OnDebugButtonPressServer(id + 1);
7828 }
7829
7830 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7831 {
7832 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7834 }
7835
7836 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7837 {
7838 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7840 }
7841
7842 else if (action_id ==
EActions.ADD_QUANTITY)
7843 {
7844 if (IsMagazine())
7845 {
7846 Magazine mag = Magazine.Cast(this);
7847 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7848 }
7849 else
7850 {
7852 }
7853
7854 if (m_EM)
7855 {
7856 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7857 }
7858
7859 }
7860
7861 else if (action_id ==
EActions.REMOVE_QUANTITY)
7862 {
7863 if (IsMagazine())
7864 {
7865 Magazine mag2 = Magazine.Cast(this);
7866 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7867 }
7868 else
7869 {
7871 }
7872 if (m_EM)
7873 {
7874 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7875 }
7876
7877 }
7878
7879 else if (action_id ==
EActions.SET_QUANTITY_0)
7880 {
7882
7883 if (m_EM)
7884 {
7885 m_EM.SetEnergy(0);
7886 }
7887 }
7888
7889 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7890 {
7892
7893 if (m_EM)
7894 {
7895 m_EM.SetEnergy(m_EM.GetEnergyMax());
7896 }
7897 }
7898
7899 else if (action_id ==
EActions.ADD_HEALTH)
7900 {
7901 AddHealth("","",GetMaxHealth("","Health")/5);
7902 }
7903 else if (action_id ==
EActions.REMOVE_HEALTH)
7904 {
7905 AddHealth("","",-GetMaxHealth("","Health")/5);
7906 }
7907 else if (action_id ==
EActions.DESTROY_HEALTH)
7908 {
7909 SetHealth01("","",0);
7910 }
7911 else if (action_id ==
EActions.WATCH_ITEM)
7912 {
7914 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7915 #ifdef DEVELOPER
7916 SetDebugDeveloper_item(this);
7917 #endif
7918 }
7919
7920 else if (action_id ==
EActions.ADD_TEMPERATURE)
7921 {
7922 AddTemperature(20);
7923
7924 }
7925
7926 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7927 {
7928 AddTemperature(-20);
7929
7930 }
7931
7932 else if (action_id ==
EActions.FLIP_FROZEN)
7933 {
7934 SetFrozen(!GetIsFrozen());
7935
7936 }
7937
7938 else if (action_id ==
EActions.ADD_WETNESS)
7939 {
7941
7942 }
7943
7944 else if (action_id ==
EActions.REMOVE_WETNESS)
7945 {
7947
7948 }
7949
7950 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7951 {
7954
7955
7956 }
7957
7958 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
7959 {
7962 }
7963
7964 else if (action_id ==
EActions.MAKE_SPECIAL)
7965 {
7966 auto debugParams = DebugSpawnParams.WithPlayer(player);
7967 OnDebugSpawnEx(debugParams);
7968 }
7969
7970 else if (action_id ==
EActions.DELETE)
7971 {
7972 Delete();
7973 }
7974
7975 }
7976
7977
7978 return false;
7979 }
7980
7981
7982
7983
7987
7990
7991
7992
7994 {
7995 return false;
7996 }
7997
7998
8000 {
8001 return true;
8002 }
8003
8004
8006 {
8007 return true;
8008 }
8009
8010
8011
8013 {
8014 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8016 }
8017
8020 {
8021 return null;
8022 }
8023
8025 {
8026 return false;
8027 }
8028
8030 {
8031 return false;
8032 }
8033
8037
8038
8040 {
8041 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8042 return module_repairing.CanRepair(this, item_repair_kit);
8043 }
8044
8045
8046 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8047 {
8048 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8049 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8050 }
8051
8052
8054 {
8055
8056
8057
8058
8059
8060
8061
8062
8063 return 1;
8064 }
8065
8066
8067
8069 {
8071 }
8072
8073
8074
8076 {
8078 }
8079
8080
8089 {
8090 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8091
8092 if (player)
8093 {
8094 player.MessageStatus(text);
8095 }
8096 }
8097
8098
8107 {
8108 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8109
8110 if (player)
8111 {
8112 player.MessageAction(text);
8113 }
8114 }
8115
8116
8125 {
8126 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8127
8128 if (player)
8129 {
8130 player.MessageFriendly(text);
8131 }
8132 }
8133
8134
8143 {
8144 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8145
8146 if (player)
8147 {
8148 player.MessageImportant(text);
8149 }
8150 }
8151
8153 {
8154 return true;
8155 }
8156
8157
8158 override bool KindOf(
string tag)
8159 {
8160 bool found = false;
8161 string item_name = this.
GetType();
8164
8165 int array_size = item_tag_array.Count();
8166 for (int i = 0; i < array_size; i++)
8167 {
8168 if (item_tag_array.Get(i) == tag)
8169 {
8170 found = true;
8171 break;
8172 }
8173 }
8174 return found;
8175 }
8176
8177
8179 {
8180
8181 super.OnRPC(sender, rpc_type,ctx);
8182
8183
8184 switch (rpc_type)
8185 {
8186 #ifndef SERVER
8187 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8188 Param2<bool, string> p = new Param2<bool, string>(false, "");
8189
8191 return;
8192
8193 bool play = p.param1;
8194 string soundSet = p.param2;
8195
8196 if (play)
8197 {
8199 {
8201 {
8203 }
8204 }
8205 else
8206 {
8208 }
8209 }
8210 else
8211 {
8213 }
8214
8215 break;
8216 #endif
8217
8218 }
8219
8221 {
8223 }
8224 }
8225
8226
8227
8228
8230 {
8231 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8232 return plugin.GetID(
name);
8233 }
8234
8236 {
8237 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8238 return plugin.GetName(id);
8239 }
8240
8243 {
8244
8245
8246 int varFlags;
8247 if (!ctx.
Read(varFlags))
8248 return;
8249
8250 if (varFlags & ItemVariableFlags.FLOAT)
8251 {
8253 }
8254 }
8255
8257 {
8258
8259 super.SerializeNumericalVars(floats_out);
8260
8261
8262
8264 {
8266 }
8267
8269 {
8271 }
8272
8274 {
8276 }
8277
8279 {
8284 }
8285
8287 {
8289 }
8290 }
8291
8293 {
8294
8295 super.DeSerializeNumericalVars(floats);
8296
8297
8298 int index = 0;
8299 int mask = Math.Round(floats.Get(index));
8300
8301 index++;
8302
8304 {
8306 {
8308 }
8309 else
8310 {
8311 float quantity = floats.Get(index);
8313 }
8314 index++;
8315 }
8316
8318 {
8319 float wet = floats.Get(index);
8321 index++;
8322 }
8323
8325 {
8326 int liquidtype = Math.Round(floats.Get(index));
8328 index++;
8329 }
8330
8332 {
8334 index++;
8336 index++;
8338 index++;
8340 index++;
8341 }
8342
8344 {
8345 int cleanness = Math.Round(floats.Get(index));
8347 index++;
8348 }
8349 }
8350
8352 {
8353 super.WriteVarsToCTX(ctx);
8354
8355
8357 {
8359 }
8360
8362 {
8364 }
8365
8367 {
8369 }
8370
8372 {
8373 int r,g,b,a;
8379 }
8380
8382 {
8384 }
8385 }
8386
8388 {
8389 if (!super.ReadVarsFromCTX(ctx,version))
8390 return false;
8391
8392 int intValue;
8393 float value;
8394
8395 if (version < 140)
8396 {
8397 if (!ctx.
Read(intValue))
8398 return false;
8399
8400 m_VariablesMask = intValue;
8401 }
8402
8404 {
8405 if (!ctx.
Read(value))
8406 return false;
8407
8409 {
8411 }
8412 else
8413 {
8415 }
8416 }
8417
8418 if (version < 140)
8419 {
8421 {
8422 if (!ctx.
Read(value))
8423 return false;
8424 SetTemperatureDirect(value);
8425 }
8426 }
8427
8429 {
8430 if (!ctx.
Read(value))
8431 return false;
8433 }
8434
8436 {
8437 if (!ctx.
Read(intValue))
8438 return false;
8440 }
8441
8443 {
8444 int r,g,b,a;
8446 return false;
8448 return false;
8450 return false;
8452 return false;
8453
8455 }
8456
8458 {
8459 if (!ctx.
Read(intValue))
8460 return false;
8462 }
8463
8464 if (version >= 138 && version < 140)
8465 {
8467 {
8468 if (!ctx.
Read(intValue))
8469 return false;
8470 SetFrozen(intValue);
8471 }
8472 }
8473
8474 return true;
8475 }
8476
8477
8479 {
8482 {
8484 }
8485
8486 if (!super.OnStoreLoad(ctx, version))
8487 {
8489 return false;
8490 }
8491
8492 if (version >= 114)
8493 {
8494 bool hasQuickBarIndexSaved;
8495
8496 if (!ctx.
Read(hasQuickBarIndexSaved))
8497 {
8499 return false;
8500 }
8501
8502 if (hasQuickBarIndexSaved)
8503 {
8504 int itmQBIndex;
8505
8506
8507 if (!ctx.
Read(itmQBIndex))
8508 {
8510 return false;
8511 }
8512
8513 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8514 if (itmQBIndex != -1 && parentPlayer)
8515 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8516 }
8517 }
8518 else
8519 {
8520
8521 PlayerBase player;
8522 int itemQBIndex;
8523 if (version ==
int.
MAX)
8524 {
8525 if (!ctx.
Read(itemQBIndex))
8526 {
8528 return false;
8529 }
8530 }
8531 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8532 {
8533
8534 if (!ctx.
Read(itemQBIndex))
8535 {
8537 return false;
8538 }
8539 if (itemQBIndex != -1 && player)
8540 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8541 }
8542 }
8543
8544 if (version < 140)
8545 {
8546
8547 if (!LoadVariables(ctx, version))
8548 {
8550 return false;
8551 }
8552 }
8553
8554
8556 {
8558 return false;
8559 }
8560 if (version >= 132)
8561 {
8563 if (raib)
8564 {
8566 {
8568 return false;
8569 }
8570 }
8571 }
8572
8574 return true;
8575 }
8576
8577
8578
8580 {
8581 super.OnStoreSave(ctx);
8582
8583 PlayerBase player;
8584 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8585 {
8587
8588 int itemQBIndex = -1;
8589 itemQBIndex = player.FindQuickBarEntityIndex(this);
8590 ctx.
Write(itemQBIndex);
8591 }
8592 else
8593 {
8595 }
8596
8598
8600 if (raib)
8601 {
8603 }
8604 }
8605
8606
8608 {
8609 super.AfterStoreLoad();
8610
8612 {
8614 }
8615
8617 {
8620 }
8621 }
8622
8624 {
8625 super.EEOnAfterLoad();
8626
8628 {
8630 }
8631
8634 }
8635
8637 {
8638 return false;
8639 }
8640
8641
8642
8644 {
8646 {
8647 #ifdef PLATFORM_CONSOLE
8648
8650 {
8652 if (menu)
8653 {
8655 }
8656 }
8657 #endif
8658 }
8659
8661 {
8664 }
8665
8667 {
8668 SetWeightDirty();
8670 }
8672 {
8675 }
8676
8678 {
8681 }
8683 {
8686 }
8687
8688 super.OnVariablesSynchronized();
8689 }
8690
8691
8692
8694 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8695 {
8696 if (!IsServerCheck(allow_client))
8697 return false;
8698
8700 return false;
8701
8704
8705 if (value <= (min + 0.001))
8706 value = min;
8707
8708 if (value == min)
8709 {
8710 if (destroy_config)
8711 {
8712 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8713 if (dstr)
8714 {
8716 this.Delete();
8717 return true;
8718 }
8719 }
8720 else if (destroy_forced)
8721 {
8723 this.Delete();
8724 return true;
8725 }
8726
8728 }
8729
8732
8734 {
8736
8737 if (delta)
8739 }
8740
8742
8743 return false;
8744 }
8745
8746
8748 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8749 {
8751 }
8752
8754 {
8757 }
8758
8760 {
8763 }
8764
8767 {
8768 float value_clamped = Math.Clamp(value, 0, 1);
8770 SetQuantity(result, destroy_config, destroy_forced);
8771 }
8772
8773
8776 {
8778 }
8779
8781 {
8783 }
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8795 {
8796 int slot = -1;
8797 if (GetInventory())
8798 {
8799 InventoryLocation il = new InventoryLocation;
8800 GetInventory().GetCurrentInventoryLocation(il);
8802 }
8803
8805 }
8806
8808 {
8809 float quantity_max = 0;
8810
8812 {
8813 if (attSlotID != -1)
8814 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8815
8816 if (quantity_max <= 0)
8818 }
8819
8820 if (quantity_max <= 0)
8822
8823 return quantity_max;
8824 }
8825
8827 {
8829 }
8830
8832 {
8834 }
8835
8836
8838 {
8840 }
8841
8843 {
8845 }
8846
8848 {
8850 }
8851
8852
8854 {
8855
8856 float weightEx = GetWeightEx();
8857 float special = GetInventoryAndCargoWeight();
8858 return weightEx - special;
8859 }
8860
8861
8863 {
8865 }
8866
8868 {
8870 {
8871 #ifdef DEVELOPER
8872 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8873 {
8874 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8876 }
8877 #endif
8878
8880 }
8881 else if (HasEnergyManager())
8882 {
8883 #ifdef DEVELOPER
8884 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8885 {
8886 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8887 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8888 }
8889 #endif
8890 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8891 }
8892 else
8893 {
8894 #ifdef DEVELOPER
8895 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8896 {
8897 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8898 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8899 }
8900 #endif
8901 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
8902 }
8903 }
8904
8907 {
8908 int item_count = 0;
8910
8911 if (GetInventory().GetCargo() != NULL)
8912 {
8913 item_count = GetInventory().GetCargo().GetItemCount();
8914 }
8915
8916 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8917 {
8918 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8919 if (item)
8920 item_count += item.GetNumberOfItems();
8921 }
8922 return item_count;
8923 }
8924
8927 {
8928 float weight = 0;
8929 float wetness = 1;
8930 if (include_wetness)
8933 {
8934 weight = wetness * m_ConfigWeight;
8935 }
8937 {
8938 weight = 1;
8939 }
8940 return weight;
8941 }
8942
8943
8944
8946 {
8947 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8948 {
8949 GameInventory inv = GetInventory();
8950 array<EntityAI> items = new array<EntityAI>;
8952 for (int i = 0; i < items.Count(); i++)
8953 {
8955 if (item)
8956 {
8958 }
8959 }
8960 }
8961 }
8962
8963
8964
8965
8967 {
8968 float energy = 0;
8969 if (HasEnergyManager())
8970 {
8971 energy = GetCompEM().GetEnergy();
8972 }
8973 return energy;
8974 }
8975
8976
8978 {
8979 super.OnEnergyConsumed();
8980
8982 }
8983
8985 {
8986 super.OnEnergyAdded();
8987
8989 }
8990
8991
8993 {
8994 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
8995 {
8997 {
8998 float energy_0to1 = GetCompEM().GetEnergy0To1();
9000 }
9001 }
9002 }
9003
9004
9006 {
9007 return ConfigGetFloat("heatIsolation");
9008 }
9009
9011 {
9013 }
9014
9016 {
9017 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9018 if (
GetGame().ConfigIsExisting(paramPath))
9020
9021 return 0.0;
9022 }
9023
9025 {
9026 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9027 if (
GetGame().ConfigIsExisting(paramPath))
9029
9030 return 0.0;
9031 }
9032
9033 override void SetWet(
float value,
bool allow_client =
false)
9034 {
9035 if (!IsServerCheck(allow_client))
9036 return;
9037
9040
9042
9043 m_VarWet = Math.Clamp(value, min, max);
9044
9046 {
9049 }
9050 }
9051
9052 override void AddWet(
float value)
9053 {
9055 }
9056
9058 {
9060 }
9061
9063 {
9065 }
9066
9068 {
9070 }
9071
9073 {
9075 }
9076
9078 {
9080 }
9081
9083 {
9086 if (newLevel != oldLevel)
9087 {
9089 }
9090 }
9091
9093 {
9094 SetWeightDirty();
9095 }
9096
9098 {
9099 return GetWetLevelInternal(
m_VarWet);
9100 }
9101
9102
9103
9105 {
9107 }
9108
9110 {
9112 }
9113
9115 {
9117 }
9118
9120 {
9122 }
9123
9124
9125
9127 {
9128 if (ConfigIsExisting("itemModelLength"))
9129 {
9130 return ConfigGetFloat("itemModelLength");
9131 }
9132 return 0;
9133 }
9134
9136 {
9137 if (ConfigIsExisting("itemAttachOffset"))
9138 {
9139 return ConfigGetFloat("itemAttachOffset");
9140 }
9141 return 0;
9142 }
9143
9144 override void SetCleanness(
int value,
bool allow_client =
false)
9145 {
9146 if (!IsServerCheck(allow_client))
9147 return;
9148
9150
9152
9155 }
9156
9158 {
9160 }
9161
9163 {
9164 return true;
9165 }
9166
9167
9168
9169
9171 {
9173 }
9174
9176 {
9178 }
9179
9180
9181
9182
9183 override void SetColor(
int r,
int g,
int b,
int a)
9184 {
9190 }
9192 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9193 {
9198 }
9199
9201 {
9203 }
9204
9207 {
9208 int r,g,b,a;
9210 r = r/255;
9211 g = g/255;
9212 b = b/255;
9213 a = a/255;
9214 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9215 }
9216
9217
9218
9219 override void SetLiquidType(
int value,
bool allow_client =
false)
9220 {
9221 if (!IsServerCheck(allow_client))
9222 return;
9223
9228 }
9229
9231 {
9232 return ConfigGetInt("varLiquidTypeInit");
9233 }
9234
9236 {
9238 }
9239
9241 {
9243 SetFrozen(false);
9244 }
9245
9248 {
9249 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9250 }
9251
9252
9255 {
9256 PlayerBase nplayer;
9257 if (PlayerBase.CastTo(nplayer, player))
9258 {
9260
9261 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9262 }
9263 }
9264
9265
9268 {
9269 PlayerBase nplayer;
9270 if (PlayerBase.CastTo(nplayer,player))
9271 {
9272
9273 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9274
9275 }
9276
9277
9278 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9279
9280
9281 if (HasEnergyManager())
9282 {
9283 GetCompEM().UpdatePlugState();
9284 }
9285 }
9286
9287
9289 {
9290 super.OnPlacementStarted(player);
9291
9293 }
9294
9295 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9296 {
9298 {
9299 m_AdminLog.OnPlacementComplete(player,
this);
9300 }
9301
9302 super.OnPlacementComplete(player, position, orientation);
9303 }
9304
9305
9306
9307
9308
9310 {
9312 {
9313 return true;
9314 }
9315 else
9316 {
9317 return false;
9318 }
9319 }
9320
9321
9323 {
9325 {
9327 }
9328 }
9329
9330
9332 {
9334 }
9335
9337 {
9339 }
9340
9341 override void InsertAgent(
int agent,
float count = 1)
9342 {
9343 if (count < 1)
9344 return;
9345
9347 }
9348
9351 {
9353 }
9354
9355
9357 {
9359 }
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9403 {
9405 return false;
9406 return true;
9407 }
9408
9410 {
9411
9413 }
9414
9415
9418 {
9419 super.CheckForRoofLimited(timeTresholdMS);
9420
9422 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9423 {
9424 m_PreviousRoofTestTime = time;
9425 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9426 }
9427 }
9428
9429
9431 {
9433 {
9434 return 0;
9435 }
9436
9437 if (GetInventory().GetAttachmentSlotsCount() != 0)
9438 {
9439 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9440 if (filter)
9441 return filter.GetProtectionLevel(type, false, system);
9442 else
9443 return 0;
9444 }
9445
9446 string subclassPath, entryName;
9447
9448 switch (type)
9449 {
9451 entryName = "biological";
9452 break;
9454 entryName = "chemical";
9455 break;
9456 default:
9457 entryName = "biological";
9458 break;
9459 }
9460
9461 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9462
9464 }
9465
9466
9467
9470 {
9471 if (!IsMagazine())
9473
9475 }
9476
9477
9478
9479
9480
9485 {
9486 return true;
9487 }
9488
9490 {
9492 }
9493
9494
9495
9496
9497
9499 {
9500 if (parent)
9501 {
9502 if (parent.IsInherited(DayZInfected))
9503 return true;
9504
9505 if (!parent.IsRuined())
9506 return true;
9507 }
9508
9509 return true;
9510 }
9511
9513 {
9514 if (!super.CanPutAsAttachment(parent))
9515 {
9516 return false;
9517 }
9518
9519 if (!IsRuined() && !parent.IsRuined())
9520 {
9521 return true;
9522 }
9523
9524 return false;
9525 }
9526
9528 {
9529
9530
9531
9532
9533 return super.CanReceiveItemIntoCargo(item);
9534 }
9535
9537 {
9538
9539
9540
9541
9542 GameInventory attachmentInv = attachment.GetInventory();
9544 {
9545 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9546 return false;
9547 }
9548
9549 InventoryLocation loc = new InventoryLocation();
9550 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9551 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9552 return false;
9553
9554 return super.CanReceiveAttachment(attachment, slotId);
9555 }
9556
9558 {
9559 if (!super.CanReleaseAttachment(attachment))
9560 return false;
9561
9562 return GetInventory().AreChildrenAccessible();
9563 }
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9586 {
9587 int id = muzzle_owner.GetMuzzleID();
9588 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9589
9590 if (WPOF_array)
9591 {
9592 for (int i = 0; i < WPOF_array.Count(); i++)
9593 {
9594 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9595
9596 if (WPOF)
9597 {
9598 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9599 }
9600 }
9601 }
9602 }
9603
9604
9606 {
9607 int id = muzzle_owner.GetMuzzleID();
9609
9610 if (WPOBE_array)
9611 {
9612 for (int i = 0; i < WPOBE_array.Count(); i++)
9613 {
9614 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9615
9616 if (WPOBE)
9617 {
9618 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9619 }
9620 }
9621 }
9622 }
9623
9624
9626 {
9627 int id = muzzle_owner.GetMuzzleID();
9628 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9629
9630 if (WPOOH_array)
9631 {
9632 for (int i = 0; i < WPOOH_array.Count(); i++)
9633 {
9634 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9635
9636 if (WPOOH)
9637 {
9638 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9639 }
9640 }
9641 }
9642 }
9643
9644
9646 {
9647 int id = muzzle_owner.GetMuzzleID();
9648 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9649
9650 if (WPOOH_array)
9651 {
9652 for (int i = 0; i < WPOOH_array.Count(); i++)
9653 {
9654 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9655
9656 if (WPOOH)
9657 {
9658 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9659 }
9660 }
9661 }
9662 }
9663
9664
9666 {
9667 int id = muzzle_owner.GetMuzzleID();
9668 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9669
9670 if (WPOOH_array)
9671 {
9672 for (int i = 0; i < WPOOH_array.Count(); i++)
9673 {
9674 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9675
9676 if (WPOOH)
9677 {
9678 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9679 }
9680 }
9681 }
9682 }
9683
9684
9685
9687 {
9689 {
9690 return true;
9691 }
9692
9693 return false;
9694 }
9695
9697 {
9699 {
9700 return true;
9701 }
9702
9703 return false;
9704 }
9705
9707 {
9709 {
9710 return true;
9711 }
9712
9713 return false;
9714 }
9715
9717 {
9718 return false;
9719 }
9720
9723 {
9724 return UATimeSpent.DEFAULT_DEPLOY;
9725 }
9726
9727
9728
9729
9731 {
9733 SetSynchDirty();
9734 }
9735
9737 {
9739 }
9740
9741
9743 {
9744 return false;
9745 }
9746
9749 {
9750 string att_type = "None";
9751
9752 if (ConfigIsExisting("soundAttType"))
9753 {
9754 att_type = ConfigGetString("soundAttType");
9755 }
9756
9758 }
9759
9761 {
9763 }
9764
9765
9766
9767
9768
9772
9774 {
9777
9779 }
9780
9781
9783 {
9785 return;
9786
9788
9791
9794
9795 SoundParameters params = new SoundParameters();
9799 }
9800
9801
9803 {
9805 return;
9806
9808 SetSynchDirty();
9809
9812 }
9813
9814
9816 {
9818 return;
9819
9821 SetSynchDirty();
9822
9825 }
9826
9828 {
9830 }
9831
9833 {
9835 }
9836
9839 {
9840 if (!
GetGame().IsDedicatedServer())
9841 {
9842 if (ConfigIsExisting("attachSoundSet"))
9843 {
9844 string cfg_path = "";
9845 string soundset = "";
9847
9850 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9851 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9852
9853 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9854 {
9855 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9856 {
9857 if (cfg_slot_array[i] == slot_type)
9858 {
9859 soundset = cfg_soundset_array[i];
9860 break;
9861 }
9862 }
9863 }
9864
9865 if (soundset != "")
9866 {
9867 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9869 }
9870 }
9871 }
9872 }
9873
9875 {
9876
9877 }
9878
9879 void OnApply(PlayerBase player);
9880
9882 {
9883 return 1.0;
9884 };
9885
9887 {
9889 }
9890
9892 {
9894 }
9895
9897
9899 {
9900 SetDynamicPhysicsLifeTime(0.01);
9902 }
9903
9905 {
9906 array<string> zone_names = new array<string>;
9907 GetDamageZones(zone_names);
9908 for (int i = 0; i < zone_names.Count(); i++)
9909 {
9910 SetHealthMax(zone_names.Get(i),"Health");
9911 }
9912 SetHealthMax("","Health");
9913 }
9914
9917 {
9918 float global_health = GetHealth01("","Health");
9919 array<string> zones = new array<string>;
9920 GetDamageZones(zones);
9921
9922 for (int i = 0; i < zones.Count(); i++)
9923 {
9924 SetHealth01(zones.Get(i),"Health",global_health);
9925 }
9926 }
9927
9930 {
9931 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9932 }
9933
9935 {
9936 if (!hasRootAsPlayer)
9937 {
9938 if (refParentIB)
9939 {
9940
9941 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9942 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9943
9944 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9945 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9946
9949 }
9950 else
9951 {
9952
9955 }
9956 }
9957 }
9958
9960 {
9962 {
9963 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
9964 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
9965 {
9966 float heatPermCoef = 1.0;
9968 while (ent)
9969 {
9970 heatPermCoef *= ent.GetHeatPermeabilityCoef();
9971 ent = ent.GetHierarchyParent();
9972 }
9973
9974 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
9975 }
9976 }
9977 }
9978
9980 {
9981
9982 EntityAI parent = GetHierarchyParent();
9983 if (!parent)
9984 {
9985 hasParent = false;
9986 hasRootAsPlayer = false;
9987 }
9988 else
9989 {
9990 hasParent = true;
9991 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
9992 refParentIB =
ItemBase.Cast(parent);
9993 }
9994 }
9995
9996 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
9997 {
9998
9999 }
10000
10002 {
10003
10004 return false;
10005 }
10006
10008 {
10009
10010
10011 return false;
10012 }
10013
10015 {
10016
10017 return false;
10018 }
10019
10022 {
10023 return !GetIsFrozen() &&
IsOpen();
10024 }
10025
10027 {
10028 bool hasParent = false, hasRootAsPlayer = false;
10030
10031 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10032 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10033
10034 if (wwtu || foodDecay)
10035 {
10039
10040 if (processWetness || processTemperature || processDecay)
10041 {
10043
10044 if (processWetness)
10045 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10046
10047 if (processTemperature)
10049
10050 if (processDecay)
10051 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10052 }
10053 }
10054 }
10055
10058 {
10060 }
10061
10063 {
10066
10067 return super.GetTemperatureFreezeThreshold();
10068 }
10069
10071 {
10074
10075 return super.GetTemperatureThawThreshold();
10076 }
10077
10079 {
10082
10083 return super.GetItemOverheatThreshold();
10084 }
10085
10087 {
10089 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10090
10091 return super.GetTemperatureFreezeTime();
10092 }
10093
10095 {
10097 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10098
10099 return super.GetTemperatureThawTime();
10100 }
10101
10106
10108 {
10109 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10110 }
10111
10113 {
10114 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10115 }
10116
10119 {
10121 }
10122
10124 {
10126 }
10127
10129 {
10131 }
10132
10135 {
10136 return null;
10137 }
10138
10141 {
10142 return false;
10143 }
10144
10146 {
10148 {
10151 if (!trg)
10152 {
10154 explosive = this;
10155 }
10156
10157 explosive.PairRemote(trg);
10159
10160 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10161 trg.SetPersistentPairID(persistentID);
10162 explosive.SetPersistentPairID(persistentID);
10163
10164 return true;
10165 }
10166 return false;
10167 }
10168
10171 {
10172 float ret = 1.0;
10175 ret *= GetHealth01();
10176
10177 return ret;
10178 }
10179
10180 #ifdef DEVELOPER
10181 override void SetDebugItem()
10182 {
10183 super.SetDebugItem();
10184 _itemBase = this;
10185 }
10186
10188 {
10189 string text = super.GetDebugText();
10190
10192 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10193
10194 return text;
10195 }
10196 #endif
10197
10199 {
10200 return true;
10201 }
10202
10204
10206
10208 {
10211 }
10212
10213
10221
10237}
10238
10240{
10242 if (entity)
10243 {
10244 bool is_item = entity.IsInherited(
ItemBase);
10245 if (is_item && full_quantity)
10246 {
10249 }
10250 }
10251 else
10252 {
10254 return NULL;
10255 }
10256 return entity;
10257}
10258
10260{
10261 if (item)
10262 {
10263 if (health > 0)
10264 item.SetHealth("", "", health);
10265
10266 if (item.CanHaveTemperature())
10267 {
10269 if (item.CanFreeze())
10270 item.SetFrozen(false);
10271 }
10272
10273 if (item.HasEnergyManager())
10274 {
10275 if (quantity >= 0)
10276 {
10277 item.GetCompEM().SetEnergy0To1(quantity);
10278 }
10279 else
10280 {
10282 }
10283 }
10284 else if (item.IsMagazine())
10285 {
10286 Magazine mag = Magazine.Cast(item);
10287 if (quantity >= 0)
10288 {
10289 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10290 }
10291 else
10292 {
10294 }
10295
10296 }
10297 else
10298 {
10299 if (quantity >= 0)
10300 {
10301 item.SetQuantityNormalized(quantity, false);
10302 }
10303 else
10304 {
10306 }
10307
10308 }
10309 }
10310}
10311
10312#ifdef DEVELOPER
10314#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.