Re-sets DamageSystem changes.
5504{
5506 {
5507 return true;
5508 }
5509};
5510
5511
5512
5514{
5518
5520
5523
5524
5525
5526
5527
5536
5542
5547
5552
5573 protected bool m_IsResultOfSplit
5574
5576
5581
5582
5583
5585
5589
5590
5591
5593
5596
5597
5598
5604
5605
5613
5616
5617
5619
5620
5622
5623
5628
5629
5634
5635
5637
5638
5640 {
5645
5646 if (!
GetGame().IsDedicatedServer())
5647 {
5649 {
5651
5653 {
5655 }
5656 }
5657
5660 }
5661
5662 m_OldLocation = null;
5663
5665 {
5667 }
5668
5669 if (ConfigIsExisting("headSelectionsToHide"))
5670 {
5673 }
5674
5676 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5677 {
5679 }
5680
5682
5683 m_IsResultOfSplit = false;
5684
5686 }
5687
5689 {
5690 super.InitItemVariables();
5691
5697 m_Count = ConfigGetInt(
"count");
5698
5701
5706
5709
5714
5726
5730
5731
5734 if (ConfigIsExisting("canBeSplit"))
5735 {
5738 }
5739
5741 if (ConfigIsExisting("itemBehaviour"))
5743
5744
5747 RegisterNetSyncVariableInt("m_VarLiquidType");
5748 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5749
5750 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5751 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5752 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5753
5754 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5755 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5756 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5757 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5758
5759 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5760 RegisterNetSyncVariableBool("m_IsTakeable");
5761 RegisterNetSyncVariableBool("m_IsHologram");
5762
5765 {
5768 }
5769
5771
5773 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5775
5776 }
5777
5779 {
5781 }
5782
5784 {
5787 {
5792 }
5793 }
5794
5795 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5796 {
5798 {
5801 }
5802
5804 }
5805
5807 {
5813 }
5814
5816
5818 {
5820
5821 if (!action)
5822 {
5823 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5824 return;
5825 }
5826
5828 if (!ai)
5829 {
5831 return;
5832 }
5833
5835 if (!action_array)
5836 {
5837 action_array = new array<ActionBase_Basic>;
5839 }
5840 if (LogManager.IsActionLogEnable())
5841 {
5842 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5843 }
5844
5845 if (action_array.Find(action) != -1)
5846 {
5847 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5848 }
5849 else
5850 {
5851 action_array.Insert(action);
5852 }
5853 }
5854
5856 {
5858 ActionBase action = player.GetActionManager().GetAction(actionName);
5861
5862 if (action_array)
5863 {
5864 action_array.RemoveItem(action);
5865 }
5866 }
5867
5868
5869
5871 {
5872 ActionOverrideData overrideData = new ActionOverrideData();
5876
5878 if (!actionMap)
5879 {
5882 }
5883
5884 actionMap.Insert(this.
Type(), overrideData);
5885
5886 }
5887
5889
5891
5892
5894 {
5897
5900
5901 string config_to_search = "CfgVehicles";
5902 string muzzle_owner_config;
5903
5905 {
5906 if (IsInherited(Weapon))
5907 config_to_search = "CfgWeapons";
5908
5909 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5910
5911 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5912
5914
5915 if (config_OnFire_subclass_count > 0)
5916 {
5917 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5918
5919 for (int i = 0; i < config_OnFire_subclass_count; i++)
5920 {
5921 string particle_class = "";
5923 string config_OnFire_entry = config_OnFire_class + particle_class;
5924 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5925 WPOF_array.Insert(WPOF);
5926 }
5927
5928
5930 }
5931 }
5932
5934 {
5935 config_to_search = "CfgWeapons";
5936 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5937
5938 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5939
5941
5942 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5943 {
5944 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5945
5946 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5947 {
5948 string particle_class2 = "";
5950 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5951 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5952 WPOBE_array.Insert(WPOBE);
5953 }
5954
5955
5957 }
5958 }
5959 }
5960
5961
5963 {
5966
5968 {
5969 string config_to_search = "CfgVehicles";
5970
5971 if (IsInherited(Weapon))
5972 config_to_search = "CfgWeapons";
5973
5974 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5975 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
5976
5977 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
5978 {
5979
5981
5983 {
5985 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
5987 return;
5988 }
5989
5992
5993
5994
5996 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
5997
5998 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
5999 {
6000 string particle_class = "";
6002 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6004
6005 if (entry_type == CT_CLASS)
6006 {
6007 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6008 WPOOH_array.Insert(WPOF);
6009 }
6010 }
6011
6012
6014 }
6015 }
6016 }
6017
6019 {
6021 }
6022
6024 {
6026 {
6028
6031
6034
6035 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6036 }
6037 }
6038
6040 {
6042 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6043
6045 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6046
6048 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6049
6051 {
6053 }
6054 }
6055
6057 {
6059 }
6060
6062 {
6065 else
6067
6069 {
6072 }
6073 else
6074 {
6077
6080 }
6081
6083 }
6084
6086 {
6088 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6089 }
6090
6092 {
6094 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6096 }
6097
6099 {
6101 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6102 }
6103
6105 {
6108
6109 OverheatingParticle OP = new OverheatingParticle();
6114
6116 }
6117
6119 {
6122
6123 return -1;
6124 }
6125
6127 {
6129 {
6132
6133 for (int i = count; i > 0; --i)
6134 {
6135 int id = i - 1;
6138
6141
6142 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6143 {
6144 if (p)
6145 {
6148 }
6149 }
6150 }
6151 }
6152 }
6153
6155 {
6157 {
6159 {
6160 int id = i - 1;
6162
6163 if (OP)
6164 {
6166
6167 if (p)
6168 {
6170 }
6171
6172 delete OP;
6173 }
6174 }
6175
6178 }
6179 }
6180
6183 {
6184 return 0.0;
6185 }
6186
6187
6189 {
6190 return 250;
6191 }
6192
6194 {
6195 return 0;
6196 }
6197
6200 {
6202 return true;
6203
6204 return false;
6205 }
6206
6209 {
6212
6214 {
6216 }
6217 else
6218 {
6219
6221 }
6222
6224 }
6225
6232 {
6233 return -1;
6234 }
6235
6236
6237
6238
6240 {
6242 {
6244 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6245
6246 if (r_index >= 0)
6247 {
6248 InventoryLocation r_il = new InventoryLocation;
6249 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6250
6251 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6254 {
6255 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6256 }
6258 {
6259 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6260 }
6261
6262 }
6263
6264 player.GetHumanInventory().ClearUserReservedLocation(this);
6265 }
6266
6269 }
6270
6271
6272
6273
6275 {
6276 return ItemBase.m_DebugActionsMask;
6277 }
6278
6280 {
6281 return ItemBase.m_DebugActionsMask & mask;
6282 }
6283
6285 {
6286 ItemBase.m_DebugActionsMask = mask;
6287 }
6288
6290 {
6291 ItemBase.m_DebugActionsMask |= mask;
6292 }
6293
6295 {
6296 ItemBase.m_DebugActionsMask &= ~mask;
6297 }
6298
6300 {
6302 {
6304 }
6305 else
6306 {
6308 }
6309 }
6310
6311
6313 {
6314 if (GetEconomyProfile())
6315 {
6316 float q_max = GetEconomyProfile().GetQuantityMax();
6317 if (q_max > 0)
6318 {
6319 float q_min = GetEconomyProfile().GetQuantityMin();
6320 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6321
6323 {
6324 ComponentEnergyManager comp = GetCompEM();
6326 {
6328 }
6329 }
6331 {
6333
6334 }
6335
6336 }
6337 }
6338 }
6339
6342 {
6343 EntityAI parent = GetHierarchyParent();
6344
6345 if (parent)
6346 {
6347 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6348 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6349 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6350 }
6351 }
6352
6355 {
6356 EntityAI parent = GetHierarchyParent();
6357
6358 if (parent)
6359 {
6360 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6361 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6362 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6363 }
6364 }
6365
6367 {
6368
6369
6370
6371
6373
6375 {
6376 if (ScriptInputUserData.CanStoreInputUserData())
6377 {
6378 ScriptInputUserData ctx = new ScriptInputUserData;
6384 ctx.
Write(use_stack_max);
6387
6389 {
6390 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6391 }
6392 }
6393 }
6394 else if (!
GetGame().IsMultiplayer())
6395 {
6397 }
6398 }
6399
6401 {
6403 }
6404
6406 {
6408 }
6409
6411 {
6413 }
6414
6416 {
6417
6418 return false;
6419 }
6420
6422 {
6423 return false;
6424 }
6425
6429 {
6430 return false;
6431 }
6432
6434 {
6435 return "";
6436 }
6437
6439
6441 {
6442 return false;
6443 }
6444
6446 {
6447 return true;
6448 }
6449
6450
6451
6453 {
6454 return true;
6455 }
6456
6458 {
6459 return true;
6460 }
6461
6463 {
6464 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6466 }
6467
6469 {
6471 }
6472
6474 {
6476 if (!is_being_placed)
6478 SetSynchDirty();
6479 }
6480
6481
6483
6485 {
6487 }
6488
6490 {
6492 }
6493
6495 {
6496 return 1;
6497 }
6498
6500 {
6501 return false;
6502 }
6503
6505 {
6507 SetSynchDirty();
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
6539
6540
6541
6542
6543
6545 {
6546 super.OnMovedInsideCargo(container);
6547
6548 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6549 }
6550
6551 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6552 {
6553 super.EEItemLocationChanged(oldLoc,newLoc);
6554
6555 PlayerBase new_player = null;
6556 PlayerBase old_player = null;
6557
6558 if (newLoc.GetParent())
6559 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6560
6561 if (oldLoc.GetParent())
6562 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6563
6565 {
6566 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6567
6568 if (r_index >= 0)
6569 {
6570 InventoryLocation r_il = new InventoryLocation;
6571 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6572
6573 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6576 {
6577 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6578 }
6580 {
6581 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6582 }
6583
6584 }
6585 }
6586
6588 {
6589 if (new_player)
6590 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6591
6592 if (new_player == old_player)
6593 {
6594
6595 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6596 {
6598 {
6599 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6600 {
6601 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6602 }
6603 }
6604 else
6605 {
6606 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6607 }
6608 }
6609
6610 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6611 {
6612 int type = oldLoc.GetType();
6614 {
6615 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6616 }
6618 {
6619 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6620 }
6621 }
6622 if (!m_OldLocation)
6623 {
6624 m_OldLocation = new InventoryLocation;
6625 }
6626 m_OldLocation.Copy(oldLoc);
6627 }
6628 else
6629 {
6630 if (m_OldLocation)
6631 {
6632 m_OldLocation.Reset();
6633 }
6634 }
6635
6637 }
6638 else
6639 {
6640 if (new_player)
6641 {
6642 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6643 if (res_index >= 0)
6644 {
6645 InventoryLocation il = new InventoryLocation;
6646 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6648 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6651 {
6652 il.
GetParent().GetOnReleaseLock().Invoke(it);
6653 }
6655 {
6657 }
6658
6659 }
6660 }
6662 {
6663
6665 }
6666
6667 if (m_OldLocation)
6668 {
6669 m_OldLocation.Reset();
6670 }
6671 }
6672 }
6673
6674 override void EOnContact(IEntity other, Contact extra)
6675 {
6677 {
6678 int liquidType = -1;
6680 if (impactSpeed > 0.0)
6681 {
6683 #ifndef SERVER
6685 #else
6687 SetSynchDirty();
6688 #endif
6690 }
6691 }
6692
6693 #ifdef SERVER
6694 if (GetCompEM() && GetCompEM().IsPlugged())
6695 {
6696 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6697 GetCompEM().UnplugThis();
6698 }
6699 #endif
6700 }
6701
6703
6705 {
6707 }
6708
6710 {
6711
6712 }
6713
6715 {
6716 super.OnItemLocationChanged(old_owner, new_owner);
6717
6718 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6719 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6720
6721 if (!relatedPlayer && playerNew)
6722 relatedPlayer = playerNew;
6723
6724 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6725 {
6727 if (actionMgr)
6728 {
6729 ActionBase currentAction = actionMgr.GetRunningAction();
6730 if (currentAction)
6732 }
6733 }
6734
6735 Man ownerPlayerOld = null;
6736 Man ownerPlayerNew = null;
6737
6738 if (old_owner)
6739 {
6740 if (old_owner.
IsMan())
6741 {
6742 ownerPlayerOld = Man.Cast(old_owner);
6743 }
6744 else
6745 {
6746 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6747 }
6748 }
6749 else
6750 {
6752 {
6754
6755 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6756 {
6757 GetCompEM().UnplugThis();
6758 }
6759 }
6760 }
6761
6762 if (new_owner)
6763 {
6764 if (new_owner.
IsMan())
6765 {
6766 ownerPlayerNew = Man.Cast(new_owner);
6767 }
6768 else
6769 {
6770 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6771 }
6772 }
6773
6774 if (ownerPlayerOld != ownerPlayerNew)
6775 {
6776 if (ownerPlayerOld)
6777 {
6778 array<EntityAI> subItemsExit = new array<EntityAI>;
6780 for (int i = 0; i < subItemsExit.Count(); i++)
6781 {
6784 }
6785 }
6786
6787 if (ownerPlayerNew)
6788 {
6789 array<EntityAI> subItemsEnter = new array<EntityAI>;
6791 for (int j = 0; j < subItemsEnter.Count(); j++)
6792 {
6795 }
6796 }
6797 }
6798 else if (ownerPlayerNew != null)
6799 {
6800 PlayerBase nplayer;
6801 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6802 {
6803 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6805 for (int k = 0; k < subItemsUpdate.Count(); k++)
6806 {
6808 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6809 }
6810 }
6811 }
6812
6813 if (old_owner)
6814 old_owner.OnChildItemRemoved(this);
6815 if (new_owner)
6816 new_owner.OnChildItemReceived(this);
6817 }
6818
6819
6821 {
6822 super.EEDelete(parent);
6823 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6824 if (player)
6825 {
6827
6828 if (player.IsAlive())
6829 {
6830 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6831 if (r_index >= 0)
6832 {
6833 InventoryLocation r_il = new InventoryLocation;
6834 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6835
6836 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6839 {
6840 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6841 }
6843 {
6844 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6845 }
6846
6847 }
6848
6849 player.RemoveQuickBarEntityShortcut(this);
6850 }
6851 }
6852 }
6853
6855 {
6856 super.EEKilled(killer);
6857
6860 {
6861 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6862 {
6863 if (IsMagazine())
6864 {
6865 if (Magazine.Cast(this).GetAmmoCount() > 0)
6866 {
6868 }
6869 }
6870 else
6871 {
6873 }
6874 }
6875 }
6876 }
6877
6879 {
6880 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6881
6882 super.OnWasAttached(parent, slot_id);
6883
6886
6888 }
6889
6891 {
6892 super.OnWasDetached(parent, slot_id);
6893
6896 }
6897
6899 {
6900 int idx;
6903
6904 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6905 if (inventory_slots.Count() < 1)
6906 {
6907 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6908 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6909 }
6910 else
6911 {
6912 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6913 }
6914
6915 idx = inventory_slots.Find(slot);
6916 if (idx < 0)
6917 return "";
6918
6919 return attach_types.Get(idx);
6920 }
6921
6923 {
6924 int idx = -1;
6925 string slot;
6926
6929
6930 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6931 if (inventory_slots.Count() < 1)
6932 {
6933 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6934 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6935 }
6936 else
6937 {
6938 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6939 if (detach_types.Count() < 1)
6940 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6941 }
6942
6943 for (int i = 0; i < inventory_slots.Count(); i++)
6944 {
6945 slot = inventory_slots.Get(i);
6946 }
6947
6948 if (slot != "")
6949 {
6950 if (detach_types.Count() == 1)
6951 idx = 0;
6952 else
6953 idx = inventory_slots.Find(slot);
6954 }
6955 if (idx < 0)
6956 return "";
6957
6958 return detach_types.Get(idx);
6959 }
6960
6962 {
6963
6965
6966
6967 float min_time = 1;
6968 float max_time = 3;
6969 float delay = Math.RandomFloat(min_time, max_time);
6970
6971 explode_timer.Run(delay, this, "DoAmmoExplosion");
6972 }
6973
6975 {
6976 Magazine magazine = Magazine.Cast(this);
6977 int pop_sounds_count = 6;
6978 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
6979
6980
6981 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
6982 string sound_name = pop_sounds[ sound_idx ];
6984
6985
6986 magazine.ServerAddAmmoCount(-1);
6987
6988
6989 float min_temp_to_explode = 100;
6990
6991 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
6992 {
6994 }
6995 }
6996
6997
6998 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
6999 {
7000 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7001
7002 const int CHANCE_DAMAGE_CARGO = 4;
7003 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7004 const int CHANCE_DAMAGE_NOTHING = 2;
7005
7007 {
7008 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7009 int chances;
7010 int rnd;
7011
7012 if (GetInventory().GetCargo())
7013 {
7014 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7015 rnd = Math.RandomInt(0,chances);
7016
7017 if (rnd < CHANCE_DAMAGE_CARGO)
7018 {
7020 }
7021 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7022 {
7024 }
7025 }
7026 else
7027 {
7028 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7029 rnd = Math.RandomInt(0,chances);
7030
7031 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7032 {
7034 }
7035 }
7036 }
7037 }
7038
7040 {
7041 if (GetInventory().GetCargo())
7042 {
7043 int item_count = GetInventory().GetCargo().GetItemCount();
7044 if (item_count > 0)
7045 {
7046 int random_pick = Math.RandomInt(0, item_count);
7048 if (!item.IsExplosive())
7049 {
7050 item.AddHealth("","",damage);
7051 return true;
7052 }
7053 }
7054 }
7055 return false;
7056 }
7057
7059 {
7060 int attachment_count = GetInventory().AttachmentCount();
7061 if (attachment_count > 0)
7062 {
7063 int random_pick = Math.RandomInt(0, attachment_count);
7064 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7065 if (!attachment.IsExplosive())
7066 {
7067 attachment.AddHealth("","",damage);
7068 return true;
7069 }
7070 }
7071 return false;
7072 }
7073
7075 {
7077 }
7078
7080 {
7082 return GetInventory().CanRemoveEntity();
7083
7084 return false;
7085 }
7086
7088 {
7090 return;
7091
7093 {
7094 if (ScriptInputUserData.CanStoreInputUserData())
7095 {
7096 ScriptInputUserData ctx = new ScriptInputUserData;
7101 ctx.
Write(destination_entity);
7105 }
7106 }
7107 else if (!
GetGame().IsMultiplayer())
7108 {
7110 }
7111 }
7112
7114 {
7116 return;
7117
7118 float split_quantity_new;
7122 InventoryLocation loc = new InventoryLocation;
7123
7124 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7125 {
7127 split_quantity_new = stack_max;
7128 else
7130
7131 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7132 if (new_item)
7133 {
7134 new_item.SetResultOfSplit(true);
7135 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7137 new_item.SetQuantity(split_quantity_new);
7138 }
7139 }
7140 else if (destination_entity && slot_id == -1)
7141 {
7142 if (quantity > stack_max)
7143 split_quantity_new = stack_max;
7144 else
7145 split_quantity_new = quantity;
7146
7148 {
7151 }
7152
7153 if (new_item)
7154 {
7155 new_item.SetResultOfSplit(true);
7156 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7158 new_item.SetQuantity(split_quantity_new);
7159 }
7160 }
7161 else
7162 {
7163 if (stack_max != 0)
7164 {
7166 {
7168 }
7169
7170 if (split_quantity_new == 0)
7171 {
7172 if (!
GetGame().IsMultiplayer())
7173 player.PhysicalPredictiveDropItem(this);
7174 else
7175 player.ServerDropEntity(this);
7176 return;
7177 }
7178
7180
7181 if (new_item)
7182 {
7183 new_item.SetResultOfSplit(true);
7184 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7186 new_item.SetQuantity(stack_max);
7187 new_item.PlaceOnSurface();
7188 }
7189 }
7190 }
7191 }
7192
7194 {
7196 return;
7197
7198 float split_quantity_new;
7202 InventoryLocation loc = new InventoryLocation;
7203
7204 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7205 {
7207 split_quantity_new = stack_max;
7208 else
7210
7211 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7212 if (new_item)
7213 {
7214 new_item.SetResultOfSplit(true);
7215 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7217 new_item.SetQuantity(split_quantity_new);
7218 }
7219 }
7220 else if (destination_entity && slot_id == -1)
7221 {
7222 if (quantity > stack_max)
7223 split_quantity_new = stack_max;
7224 else
7225 split_quantity_new = quantity;
7226
7228 {
7231 }
7232
7233 if (new_item)
7234 {
7235 new_item.SetResultOfSplit(true);
7236 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7238 new_item.SetQuantity(split_quantity_new);
7239 }
7240 }
7241 else
7242 {
7243 if (stack_max != 0)
7244 {
7246 {
7248 }
7249
7251
7252 if (new_item)
7253 {
7254 new_item.SetResultOfSplit(true);
7255 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7257 new_item.SetQuantity(stack_max);
7258 new_item.PlaceOnSurface();
7259 }
7260 }
7261 }
7262 }
7263
7265 {
7267 return;
7268
7270 {
7271 if (ScriptInputUserData.CanStoreInputUserData())
7272 {
7273 ScriptInputUserData ctx = new ScriptInputUserData;
7278 dst.WriteToContext(ctx);
7280 }
7281 }
7282 else if (!
GetGame().IsMultiplayer())
7283 {
7285 }
7286 }
7287
7289 {
7291 return;
7292
7294 {
7295 if (ScriptInputUserData.CanStoreInputUserData())
7296 {
7297 ScriptInputUserData ctx = new ScriptInputUserData;
7302 ctx.
Write(destination_entity);
7308 }
7309 }
7310 else if (!
GetGame().IsMultiplayer())
7311 {
7313 }
7314 }
7315
7317 {
7319 }
7320
7322 {
7324 return this;
7325
7327 float split_quantity_new;
7329 if (dst.IsValid())
7330 {
7331 int slot_id = dst.GetSlot();
7333
7334 if (quantity > stack_max)
7335 split_quantity_new = stack_max;
7336 else
7337 split_quantity_new = quantity;
7338
7340
7341 if (new_item)
7342 {
7343 new_item.SetResultOfSplit(true);
7344 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7347 }
7348
7349 return new_item;
7350 }
7351
7352 return null;
7353 }
7354
7356 {
7358 return;
7359
7361 float split_quantity_new;
7363 if (destination_entity)
7364 {
7366 if (quantity > stackable)
7367 split_quantity_new = stackable;
7368 else
7369 split_quantity_new = quantity;
7370
7371 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7372 if (new_item)
7373 {
7374 new_item.SetResultOfSplit(true);
7375 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7377 new_item.SetQuantity(split_quantity_new);
7378 }
7379 }
7380 }
7381
7383 {
7385 return;
7386
7388 {
7389 if (ScriptInputUserData.CanStoreInputUserData())
7390 {
7391 ScriptInputUserData ctx = new ScriptInputUserData;
7396 ItemBase destination_entity =
this;
7397 ctx.
Write(destination_entity);
7401 }
7402 }
7403 else if (!
GetGame().IsMultiplayer())
7404 {
7406 }
7407 }
7408
7410 {
7412 return;
7413
7415 float split_quantity_new;
7417 if (player)
7418 {
7420 if (quantity > stackable)
7421 split_quantity_new = stackable;
7422 else
7423 split_quantity_new = quantity;
7424
7425 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7426 new_item =
ItemBase.Cast(in_hands);
7427 if (new_item)
7428 {
7429 new_item.SetResultOfSplit(true);
7430 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7432 new_item.SetQuantity(split_quantity_new);
7433 }
7434 }
7435 }
7436
7438 {
7440 return;
7441
7443 float split_quantity_new = Math.Floor(quantity * 0.5);
7444
7446
7447 if (new_item)
7448 {
7449 if (new_item.GetQuantityMax() < split_quantity_new)
7450 {
7451 split_quantity_new = new_item.GetQuantityMax();
7452 }
7453
7454 new_item.SetResultOfSplit(true);
7455 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7456
7458 {
7461 }
7462 else
7463 {
7466 }
7467 }
7468 }
7469
7471 {
7473 return;
7474
7476 float split_quantity_new = Math.Floor(quantity / 2);
7477
7478 InventoryLocation invloc = new InventoryLocation;
7480
7482 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7483
7484 if (new_item)
7485 {
7486 if (new_item.GetQuantityMax() < split_quantity_new)
7487 {
7488 split_quantity_new = new_item.GetQuantityMax();
7489 }
7491 {
7494 }
7495 else
7496 {
7499 }
7500 }
7501 }
7502
7505 {
7506 SetWeightDirty();
7508
7509 if (parent)
7510 parent.OnAttachmentQuantityChangedEx(this, delta);
7511
7513 {
7515 {
7517 }
7519 {
7520 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7522 }
7523 }
7524
7525 }
7526
7529 {
7530
7531 }
7532
7535 {
7537 }
7538
7540 {
7541 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7542
7544 {
7545 if (newLevel == GameConstants.STATE_RUINED)
7546 {
7548 EntityAI parent = GetHierarchyParent();
7549 if (parent && parent.IsFireplace())
7550 {
7551 CargoBase cargo = GetInventory().GetCargo();
7552 if (cargo)
7553 {
7555 {
7557 }
7558 }
7559 }
7560 }
7561
7563 {
7564
7566 return;
7567 }
7568
7569 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7570 {
7572 }
7573 }
7574 }
7575
7576
7578 {
7579 super.OnRightClick();
7580
7582 {
7584 {
7585 if (ScriptInputUserData.CanStoreInputUserData())
7586 {
7587 vector m4[4];
7589
7590 EntityAI root = GetHierarchyRoot();
7591
7592 InventoryLocation dst = new InventoryLocation;
7594 {
7595 if (root)
7596 {
7597 root.GetTransform(m4);
7599 }
7600 else
7601 GetInventory().GetCurrentInventoryLocation(dst);
7602 }
7603 else
7604 {
7606
7607
7608 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7609 {
7610 if (root)
7611 {
7612 root.GetTransform(m4);
7614 }
7615 else
7616 GetInventory().GetCurrentInventoryLocation(dst);
7617 }
7618 else
7619 {
7620 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7621 }
7622 }
7623
7624 ScriptInputUserData ctx = new ScriptInputUserData;
7632 }
7633 }
7634 else if (!
GetGame().IsMultiplayer())
7635 {
7637 }
7638 }
7639 }
7640
7641 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7642 {
7643
7644 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7645 return false;
7646
7647 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7648 return false;
7649
7650
7652 return false;
7653
7654
7655 Magazine mag = Magazine.Cast(this);
7656 if (mag)
7657 {
7658 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7659 return false;
7660
7661 if (stack_max_limit)
7662 {
7663 Magazine other_mag = Magazine.Cast(other_item);
7664 if (other_item)
7665 {
7666 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7667 return false;
7668 }
7669
7670 }
7671 }
7672 else
7673 {
7674
7676 return false;
7677
7679 return false;
7680 }
7681
7682 PlayerBase player = null;
7683 if (CastTo(player, GetHierarchyRootPlayer()))
7684 {
7685 if (player.GetInventory().HasAttachment(this))
7686 return false;
7687
7688 if (player.IsItemsToDelete())
7689 return false;
7690 }
7691
7692 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7693 return false;
7694
7695 int slotID;
7697 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7698 return false;
7699
7700 return true;
7701 }
7702
7704 {
7706 }
7707
7709 {
7710 return m_IsResultOfSplit;
7711 }
7712
7714 {
7715 m_IsResultOfSplit = value;
7716 }
7717
7719 {
7721 }
7722
7724 {
7725 float other_item_quantity = other_item.GetQuantity();
7726 float this_free_space;
7727
7729
7731
7732 if (other_item_quantity > this_free_space)
7733 {
7734 return this_free_space;
7735 }
7736 else
7737 {
7738 return other_item_quantity;
7739 }
7740 }
7741
7743 {
7745 }
7746
7748 {
7750 return;
7751
7752 if (!IsMagazine() && other_item)
7753 {
7755 if (quantity_used != 0)
7756 {
7757 float hp1 = GetHealth01("","");
7758 float hp2 = other_item.GetHealth01("","");
7759 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7760 hpResult = hpResult / (
GetQuantity() + quantity_used);
7761
7762 hpResult *= GetMaxHealth();
7763 Math.Round(hpResult);
7764 SetHealth("", "Health", hpResult);
7765
7767 other_item.AddQuantity(-quantity_used);
7768 }
7769 }
7771 }
7772
7774 {
7775 #ifdef SERVER
7776 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7777 GetHierarchyParent().IncreaseLifetimeUp();
7778 #endif
7779 };
7780
7782 {
7783 PlayerBase p = PlayerBase.Cast(player);
7784
7785 array<int> recipesIds = p.m_Recipes;
7786 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7787 if (moduleRecipesManager)
7788 {
7789 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7790 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7791 }
7792
7793 for (int i = 0;i < recipesIds.Count(); i++)
7794 {
7795 int key = recipesIds.Get(i);
7796 string recipeName = moduleRecipesManager.GetRecipeName(key);
7798 }
7799 }
7800
7801
7802 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7803 {
7804 super.GetDebugActions(outputList);
7805
7806
7811
7812
7816
7820
7821
7824
7825
7827 {
7830 }
7831
7833
7836
7840 }
7841
7842
7843
7844
7846 {
7847 super.OnAction(action_id, player, ctx);
7848 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7849 {
7850 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7851 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7852 PlayerBase p = PlayerBase.Cast(player);
7853 if (
EActions.RECIPES_RANGE_START < 1000)
7854 {
7855 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7856 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7857 }
7858 }
7859 #ifndef SERVER
7860 else if (action_id ==
EActions.WATCH_PLAYER)
7861 {
7862 PluginDeveloper.SetDeveloperItemClientEx(player);
7863 }
7864 #endif
7866 {
7867 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7868 {
7869 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7870 OnDebugButtonPressServer(id + 1);
7871 }
7872
7873 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7874 {
7875 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7877 }
7878
7879 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7880 {
7881 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7883 }
7884
7885 else if (action_id ==
EActions.ADD_QUANTITY)
7886 {
7887 if (IsMagazine())
7888 {
7889 Magazine mag = Magazine.Cast(this);
7890 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7891 }
7892 else
7893 {
7895 }
7896
7897 if (m_EM)
7898 {
7899 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7900 }
7901
7902 }
7903
7904 else if (action_id ==
EActions.REMOVE_QUANTITY)
7905 {
7906 if (IsMagazine())
7907 {
7908 Magazine mag2 = Magazine.Cast(this);
7909 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7910 }
7911 else
7912 {
7914 }
7915 if (m_EM)
7916 {
7917 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7918 }
7919
7920 }
7921
7922 else if (action_id ==
EActions.SET_QUANTITY_0)
7923 {
7925
7926 if (m_EM)
7927 {
7928 m_EM.SetEnergy(0);
7929 }
7930 }
7931
7932 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7933 {
7935
7936 if (m_EM)
7937 {
7938 m_EM.SetEnergy(m_EM.GetEnergyMax());
7939 }
7940 }
7941
7942 else if (action_id ==
EActions.ADD_HEALTH)
7943 {
7944 AddHealth("","",GetMaxHealth("","Health")/5);
7945 }
7946 else if (action_id ==
EActions.REMOVE_HEALTH)
7947 {
7948 AddHealth("","",-GetMaxHealth("","Health")/5);
7949 }
7950 else if (action_id ==
EActions.DESTROY_HEALTH)
7951 {
7952 SetHealth01("","",0);
7953 }
7954 else if (action_id ==
EActions.WATCH_ITEM)
7955 {
7957 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
7958 #ifdef DEVELOPER
7959 SetDebugDeveloper_item(this);
7960 #endif
7961 }
7962
7963 else if (action_id ==
EActions.ADD_TEMPERATURE)
7964 {
7965 AddTemperature(20);
7966
7967 }
7968
7969 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
7970 {
7971 AddTemperature(-20);
7972
7973 }
7974
7975 else if (action_id ==
EActions.FLIP_FROZEN)
7976 {
7977 SetFrozen(!GetIsFrozen());
7978
7979 }
7980
7981 else if (action_id ==
EActions.ADD_WETNESS)
7982 {
7984
7985 }
7986
7987 else if (action_id ==
EActions.REMOVE_WETNESS)
7988 {
7990
7991 }
7992
7993 else if (action_id ==
EActions.LIQUIDTYPE_UP)
7994 {
7997
7998
7999 }
8000
8001 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8002 {
8005 }
8006
8007 else if (action_id ==
EActions.MAKE_SPECIAL)
8008 {
8009 auto debugParams = DebugSpawnParams.WithPlayer(player);
8010 OnDebugSpawnEx(debugParams);
8011 }
8012
8013 else if (action_id ==
EActions.DELETE)
8014 {
8015 Delete();
8016 }
8017
8018 }
8019
8020
8021 return false;
8022 }
8023
8024
8025
8026
8030
8033
8034
8035
8037 {
8038 return false;
8039 }
8040
8041
8043 {
8044 return true;
8045 }
8046
8047
8049 {
8050 return true;
8051 }
8052
8053
8054
8056 {
8057 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8059 }
8060
8063 {
8064 return null;
8065 }
8066
8068 {
8069 return false;
8070 }
8071
8073 {
8074 return false;
8075 }
8076
8080
8081
8083 {
8084 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8085 return module_repairing.CanRepair(this, item_repair_kit);
8086 }
8087
8088
8089 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8090 {
8091 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8092 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8093 }
8094
8095
8097 {
8098
8099
8100
8101
8102
8103
8104
8105
8106 return 1;
8107 }
8108
8109
8110
8112 {
8114 }
8115
8116
8117
8119 {
8121 }
8122
8123
8132 {
8133 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8134
8135 if (player)
8136 {
8137 player.MessageStatus(text);
8138 }
8139 }
8140
8141
8150 {
8151 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8152
8153 if (player)
8154 {
8155 player.MessageAction(text);
8156 }
8157 }
8158
8159
8168 {
8169 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8170
8171 if (player)
8172 {
8173 player.MessageFriendly(text);
8174 }
8175 }
8176
8177
8186 {
8187 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8188
8189 if (player)
8190 {
8191 player.MessageImportant(text);
8192 }
8193 }
8194
8196 {
8197 return true;
8198 }
8199
8200
8201 override bool KindOf(
string tag)
8202 {
8203 bool found = false;
8204 string item_name = this.
GetType();
8207
8208 int array_size = item_tag_array.Count();
8209 for (int i = 0; i < array_size; i++)
8210 {
8211 if (item_tag_array.Get(i) == tag)
8212 {
8213 found = true;
8214 break;
8215 }
8216 }
8217 return found;
8218 }
8219
8220
8222 {
8223
8224 super.OnRPC(sender, rpc_type,ctx);
8225
8226
8227 switch (rpc_type)
8228 {
8229 #ifndef SERVER
8230 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8231 Param2<bool, string> p = new Param2<bool, string>(false, "");
8232
8234 return;
8235
8236 bool play = p.param1;
8237 string soundSet = p.param2;
8238
8239 if (play)
8240 {
8242 {
8244 {
8246 }
8247 }
8248 else
8249 {
8251 }
8252 }
8253 else
8254 {
8256 }
8257
8258 break;
8259 #endif
8260
8261 }
8262
8264 {
8266 }
8267 }
8268
8269
8270
8271
8273 {
8274 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8275 return plugin.GetID(
name);
8276 }
8277
8279 {
8280 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8281 return plugin.GetName(id);
8282 }
8283
8286 {
8287
8288
8289 int varFlags;
8290 if (!ctx.
Read(varFlags))
8291 return;
8292
8293 if (varFlags & ItemVariableFlags.FLOAT)
8294 {
8296 }
8297 }
8298
8300 {
8301
8302 super.SerializeNumericalVars(floats_out);
8303
8304
8305
8307 {
8309 }
8310
8312 {
8314 }
8315
8317 {
8319 }
8320
8322 {
8327 }
8328
8330 {
8332 }
8333 }
8334
8336 {
8337
8338 super.DeSerializeNumericalVars(floats);
8339
8340
8341 int index = 0;
8342 int mask = Math.Round(floats.Get(index));
8343
8344 index++;
8345
8347 {
8349 {
8351 }
8352 else
8353 {
8354 float quantity = floats.Get(index);
8356 }
8357 index++;
8358 }
8359
8361 {
8362 float wet = floats.Get(index);
8364 index++;
8365 }
8366
8368 {
8369 int liquidtype = Math.Round(floats.Get(index));
8371 index++;
8372 }
8373
8375 {
8377 index++;
8379 index++;
8381 index++;
8383 index++;
8384 }
8385
8387 {
8388 int cleanness = Math.Round(floats.Get(index));
8390 index++;
8391 }
8392 }
8393
8395 {
8396 super.WriteVarsToCTX(ctx);
8397
8398
8400 {
8402 }
8403
8405 {
8407 }
8408
8410 {
8412 }
8413
8415 {
8416 int r,g,b,a;
8422 }
8423
8425 {
8427 }
8428 }
8429
8431 {
8432 if (!super.ReadVarsFromCTX(ctx,version))
8433 return false;
8434
8435 int intValue;
8436 float value;
8437
8438 if (version < 140)
8439 {
8440 if (!ctx.
Read(intValue))
8441 return false;
8442
8443 m_VariablesMask = intValue;
8444 }
8445
8447 {
8448 if (!ctx.
Read(value))
8449 return false;
8450
8452 {
8454 }
8455 else
8456 {
8458 }
8459 }
8460
8461 if (version < 140)
8462 {
8464 {
8465 if (!ctx.
Read(value))
8466 return false;
8467 SetTemperatureDirect(value);
8468 }
8469 }
8470
8472 {
8473 if (!ctx.
Read(value))
8474 return false;
8476 }
8477
8479 {
8480 if (!ctx.
Read(intValue))
8481 return false;
8483 }
8484
8486 {
8487 int r,g,b,a;
8489 return false;
8491 return false;
8493 return false;
8495 return false;
8496
8498 }
8499
8501 {
8502 if (!ctx.
Read(intValue))
8503 return false;
8505 }
8506
8507 if (version >= 138 && version < 140)
8508 {
8510 {
8511 if (!ctx.
Read(intValue))
8512 return false;
8513 SetFrozen(intValue);
8514 }
8515 }
8516
8517 return true;
8518 }
8519
8520
8522 {
8525 {
8527 }
8528
8529 if (!super.OnStoreLoad(ctx, version))
8530 {
8532 return false;
8533 }
8534
8535 if (version >= 114)
8536 {
8537 bool hasQuickBarIndexSaved;
8538
8539 if (!ctx.
Read(hasQuickBarIndexSaved))
8540 {
8542 return false;
8543 }
8544
8545 if (hasQuickBarIndexSaved)
8546 {
8547 int itmQBIndex;
8548
8549
8550 if (!ctx.
Read(itmQBIndex))
8551 {
8553 return false;
8554 }
8555
8556 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8557 if (itmQBIndex != -1 && parentPlayer)
8558 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8559 }
8560 }
8561 else
8562 {
8563
8564 PlayerBase player;
8565 int itemQBIndex;
8566 if (version ==
int.
MAX)
8567 {
8568 if (!ctx.
Read(itemQBIndex))
8569 {
8571 return false;
8572 }
8573 }
8574 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8575 {
8576
8577 if (!ctx.
Read(itemQBIndex))
8578 {
8580 return false;
8581 }
8582 if (itemQBIndex != -1 && player)
8583 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8584 }
8585 }
8586
8587 if (version < 140)
8588 {
8589
8590 if (!LoadVariables(ctx, version))
8591 {
8593 return false;
8594 }
8595 }
8596
8597
8599 {
8601 return false;
8602 }
8603 if (version >= 132)
8604 {
8606 if (raib)
8607 {
8609 {
8611 return false;
8612 }
8613 }
8614 }
8615
8617 return true;
8618 }
8619
8620
8621
8623 {
8624 super.OnStoreSave(ctx);
8625
8626 PlayerBase player;
8627 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8628 {
8630
8631 int itemQBIndex = -1;
8632 itemQBIndex = player.FindQuickBarEntityIndex(this);
8633 ctx.
Write(itemQBIndex);
8634 }
8635 else
8636 {
8638 }
8639
8641
8643 if (raib)
8644 {
8646 }
8647 }
8648
8649
8651 {
8652 super.AfterStoreLoad();
8653
8655 {
8657 }
8658
8660 {
8663 }
8664 }
8665
8667 {
8668 super.EEOnAfterLoad();
8669
8671 {
8673 }
8674
8677 }
8678
8680 {
8681 return false;
8682 }
8683
8684
8685
8687 {
8689 {
8690 #ifdef PLATFORM_CONSOLE
8691
8693 {
8695 if (menu)
8696 {
8698 }
8699 }
8700 #endif
8701 }
8702
8704 {
8707 }
8708
8710 {
8711 SetWeightDirty();
8713 }
8715 {
8718 }
8719
8721 {
8724 }
8726 {
8729 }
8730
8731 super.OnVariablesSynchronized();
8732 }
8733
8734
8735
8737 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8738 {
8739 if (!IsServerCheck(allow_client))
8740 return false;
8741
8743 return false;
8744
8747
8748 if (value <= (min + 0.001))
8749 value = min;
8750
8751 if (value == min)
8752 {
8753 if (destroy_config)
8754 {
8755 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8756 if (dstr)
8757 {
8759 this.Delete();
8760 return true;
8761 }
8762 }
8763 else if (destroy_forced)
8764 {
8766 this.Delete();
8767 return true;
8768 }
8769
8771 }
8772
8775
8777 {
8779
8780 if (delta)
8782 }
8783
8785
8786 return false;
8787 }
8788
8789
8791 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8792 {
8794 }
8795
8797 {
8800 }
8801
8803 {
8806 }
8807
8810 {
8811 float value_clamped = Math.Clamp(value, 0, 1);
8813 SetQuantity(result, destroy_config, destroy_forced);
8814 }
8815
8816
8819 {
8821 }
8822
8824 {
8826 }
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8838 {
8839 int slot = -1;
8840 if (GetInventory())
8841 {
8842 InventoryLocation il = new InventoryLocation;
8843 GetInventory().GetCurrentInventoryLocation(il);
8845 }
8846
8848 }
8849
8851 {
8852 float quantity_max = 0;
8853
8855 {
8856 if (attSlotID != -1)
8857 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8858
8859 if (quantity_max <= 0)
8861 }
8862
8863 if (quantity_max <= 0)
8865
8866 return quantity_max;
8867 }
8868
8870 {
8872 }
8873
8875 {
8877 }
8878
8879
8881 {
8883 }
8884
8886 {
8888 }
8889
8891 {
8893 }
8894
8895
8897 {
8898
8899 float weightEx = GetWeightEx();
8900 float special = GetInventoryAndCargoWeight();
8901 return weightEx - special;
8902 }
8903
8904
8906 {
8908 }
8909
8911 {
8913 {
8914 #ifdef DEVELOPER
8915 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8916 {
8917 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8919 }
8920 #endif
8921
8923 }
8924 else if (HasEnergyManager())
8925 {
8926 #ifdef DEVELOPER
8927 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8928 {
8929 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8930 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8931 }
8932 #endif
8933 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8934 }
8935 else
8936 {
8937 #ifdef DEVELOPER
8938 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8939 {
8940 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8941 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
8942 }
8943 #endif
8944 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
8945 }
8946 }
8947
8950 {
8951 int item_count = 0;
8953
8954 if (GetInventory().GetCargo() != NULL)
8955 {
8956 item_count = GetInventory().GetCargo().GetItemCount();
8957 }
8958
8959 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
8960 {
8961 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
8962 if (item)
8963 item_count += item.GetNumberOfItems();
8964 }
8965 return item_count;
8966 }
8967
8970 {
8971 float weight = 0;
8972 float wetness = 1;
8973 if (include_wetness)
8976 {
8977 weight = wetness * m_ConfigWeight;
8978 }
8980 {
8981 weight = 1;
8982 }
8983 return weight;
8984 }
8985
8986
8987
8989 {
8990 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
8991 {
8992 GameInventory inv = GetInventory();
8993 array<EntityAI> items = new array<EntityAI>;
8995 for (int i = 0; i < items.Count(); i++)
8996 {
8998 if (item)
8999 {
9001 }
9002 }
9003 }
9004 }
9005
9006
9007
9008
9010 {
9011 float energy = 0;
9012 if (HasEnergyManager())
9013 {
9014 energy = GetCompEM().GetEnergy();
9015 }
9016 return energy;
9017 }
9018
9019
9021 {
9022 super.OnEnergyConsumed();
9023
9025 }
9026
9028 {
9029 super.OnEnergyAdded();
9030
9032 }
9033
9034
9036 {
9037 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9038 {
9040 {
9041 float energy_0to1 = GetCompEM().GetEnergy0To1();
9043 }
9044 }
9045 }
9046
9047
9049 {
9050 return ConfigGetFloat("heatIsolation");
9051 }
9052
9054 {
9056 }
9057
9059 {
9060 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9061 if (
GetGame().ConfigIsExisting(paramPath))
9063
9064 return 0.0;
9065 }
9066
9068 {
9069 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9070 if (
GetGame().ConfigIsExisting(paramPath))
9072
9073 return 0.0;
9074 }
9075
9076 override void SetWet(
float value,
bool allow_client =
false)
9077 {
9078 if (!IsServerCheck(allow_client))
9079 return;
9080
9083
9085
9086 m_VarWet = Math.Clamp(value, min, max);
9087
9089 {
9092 }
9093 }
9094
9095 override void AddWet(
float value)
9096 {
9098 }
9099
9101 {
9103 }
9104
9106 {
9108 }
9109
9111 {
9113 }
9114
9116 {
9118 }
9119
9121 {
9123 }
9124
9126 {
9129 if (newLevel != oldLevel)
9130 {
9132 }
9133 }
9134
9136 {
9137 SetWeightDirty();
9138 }
9139
9141 {
9142 return GetWetLevelInternal(
m_VarWet);
9143 }
9144
9145
9146
9148 {
9150 }
9151
9153 {
9155 }
9156
9158 {
9160 }
9161
9163 {
9165 }
9166
9167
9168
9170 {
9171 if (ConfigIsExisting("itemModelLength"))
9172 {
9173 return ConfigGetFloat("itemModelLength");
9174 }
9175 return 0;
9176 }
9177
9179 {
9180 if (ConfigIsExisting("itemAttachOffset"))
9181 {
9182 return ConfigGetFloat("itemAttachOffset");
9183 }
9184 return 0;
9185 }
9186
9187 override void SetCleanness(
int value,
bool allow_client =
false)
9188 {
9189 if (!IsServerCheck(allow_client))
9190 return;
9191
9193
9195
9198 }
9199
9201 {
9203 }
9204
9206 {
9207 return true;
9208 }
9209
9210
9211
9212
9214 {
9216 }
9217
9219 {
9221 }
9222
9223
9224
9225
9226 override void SetColor(
int r,
int g,
int b,
int a)
9227 {
9233 }
9235 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9236 {
9241 }
9242
9244 {
9246 }
9247
9250 {
9251 int r,g,b,a;
9253 r = r/255;
9254 g = g/255;
9255 b = b/255;
9256 a = a/255;
9257 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9258 }
9259
9260
9261
9262 override void SetLiquidType(
int value,
bool allow_client =
false)
9263 {
9264 if (!IsServerCheck(allow_client))
9265 return;
9266
9271 }
9272
9274 {
9275 return ConfigGetInt("varLiquidTypeInit");
9276 }
9277
9279 {
9281 }
9282
9284 {
9286 SetFrozen(false);
9287 }
9288
9291 {
9292 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9293 }
9294
9295
9298 {
9299 PlayerBase nplayer;
9300 if (PlayerBase.CastTo(nplayer, player))
9301 {
9303
9304 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9305 }
9306 }
9307
9308
9311 {
9312 PlayerBase nplayer;
9313 if (PlayerBase.CastTo(nplayer,player))
9314 {
9315
9316 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9317
9318 }
9319
9320
9321 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9322
9323
9324 if (HasEnergyManager())
9325 {
9326 GetCompEM().UpdatePlugState();
9327 }
9328 }
9329
9330
9332 {
9333 super.OnPlacementStarted(player);
9334
9336 }
9337
9338 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9339 {
9341 {
9342 m_AdminLog.OnPlacementComplete(player,
this);
9343 }
9344
9345 super.OnPlacementComplete(player, position, orientation);
9346 }
9347
9348
9349
9350
9351
9353 {
9355 {
9356 return true;
9357 }
9358 else
9359 {
9360 return false;
9361 }
9362 }
9363
9364
9366 {
9368 {
9370 }
9371 }
9372
9373
9375 {
9377 }
9378
9380 {
9382 }
9383
9384 override void InsertAgent(
int agent,
float count = 1)
9385 {
9386 if (count < 1)
9387 return;
9388
9390 }
9391
9394 {
9396 }
9397
9398
9400 {
9402 }
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9446 {
9448 return false;
9449 return true;
9450 }
9451
9453 {
9454
9456 }
9457
9458
9461 {
9462 super.CheckForRoofLimited(timeTresholdMS);
9463
9465 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9466 {
9467 m_PreviousRoofTestTime = time;
9468 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9469 }
9470 }
9471
9472
9474 {
9476 {
9477 return 0;
9478 }
9479
9480 if (GetInventory().GetAttachmentSlotsCount() != 0)
9481 {
9482 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9483 if (filter)
9484 return filter.GetProtectionLevel(type, false, system);
9485 else
9486 return 0;
9487 }
9488
9489 string subclassPath, entryName;
9490
9491 switch (type)
9492 {
9494 entryName = "biological";
9495 break;
9497 entryName = "chemical";
9498 break;
9499 default:
9500 entryName = "biological";
9501 break;
9502 }
9503
9504 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9505
9507 }
9508
9509
9510
9513 {
9514 if (!IsMagazine())
9516
9518 }
9519
9520
9521
9522
9523
9528 {
9529 return true;
9530 }
9531
9533 {
9535 }
9536
9537
9538
9539
9540
9542 {
9543 if (parent)
9544 {
9545 if (parent.IsInherited(DayZInfected))
9546 return true;
9547
9548 if (!parent.IsRuined())
9549 return true;
9550 }
9551
9552 return true;
9553 }
9554
9556 {
9557 if (!super.CanPutAsAttachment(parent))
9558 {
9559 return false;
9560 }
9561
9562 if (!IsRuined() && !parent.IsRuined())
9563 {
9564 return true;
9565 }
9566
9567 return false;
9568 }
9569
9571 {
9572
9573
9574
9575
9576 return super.CanReceiveItemIntoCargo(item);
9577 }
9578
9580 {
9581
9582
9583
9584
9585 GameInventory attachmentInv = attachment.GetInventory();
9587 {
9588 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9589 return false;
9590 }
9591
9592 InventoryLocation loc = new InventoryLocation();
9593 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9594 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9595 return false;
9596
9597 return super.CanReceiveAttachment(attachment, slotId);
9598 }
9599
9601 {
9602 if (!super.CanReleaseAttachment(attachment))
9603 return false;
9604
9605 return GetInventory().AreChildrenAccessible();
9606 }
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9629 {
9630 int id = muzzle_owner.GetMuzzleID();
9631 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9632
9633 if (WPOF_array)
9634 {
9635 for (int i = 0; i < WPOF_array.Count(); i++)
9636 {
9637 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9638
9639 if (WPOF)
9640 {
9641 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9642 }
9643 }
9644 }
9645 }
9646
9647
9649 {
9650 int id = muzzle_owner.GetMuzzleID();
9652
9653 if (WPOBE_array)
9654 {
9655 for (int i = 0; i < WPOBE_array.Count(); i++)
9656 {
9657 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9658
9659 if (WPOBE)
9660 {
9661 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9662 }
9663 }
9664 }
9665 }
9666
9667
9669 {
9670 int id = muzzle_owner.GetMuzzleID();
9671 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9672
9673 if (WPOOH_array)
9674 {
9675 for (int i = 0; i < WPOOH_array.Count(); i++)
9676 {
9677 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9678
9679 if (WPOOH)
9680 {
9681 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9682 }
9683 }
9684 }
9685 }
9686
9687
9689 {
9690 int id = muzzle_owner.GetMuzzleID();
9691 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9692
9693 if (WPOOH_array)
9694 {
9695 for (int i = 0; i < WPOOH_array.Count(); i++)
9696 {
9697 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9698
9699 if (WPOOH)
9700 {
9701 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9702 }
9703 }
9704 }
9705 }
9706
9707
9709 {
9710 int id = muzzle_owner.GetMuzzleID();
9711 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9712
9713 if (WPOOH_array)
9714 {
9715 for (int i = 0; i < WPOOH_array.Count(); i++)
9716 {
9717 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9718
9719 if (WPOOH)
9720 {
9721 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9722 }
9723 }
9724 }
9725 }
9726
9727
9728
9730 {
9732 {
9733 return true;
9734 }
9735
9736 return false;
9737 }
9738
9740 {
9742 {
9743 return true;
9744 }
9745
9746 return false;
9747 }
9748
9750 {
9752 {
9753 return true;
9754 }
9755
9756 return false;
9757 }
9758
9760 {
9761 return false;
9762 }
9763
9766 {
9767 return UATimeSpent.DEFAULT_DEPLOY;
9768 }
9769
9770
9771
9772
9774 {
9776 SetSynchDirty();
9777 }
9778
9780 {
9782 }
9783
9784
9786 {
9787 return false;
9788 }
9789
9792 {
9793 string att_type = "None";
9794
9795 if (ConfigIsExisting("soundAttType"))
9796 {
9797 att_type = ConfigGetString("soundAttType");
9798 }
9799
9801 }
9802
9804 {
9806 }
9807
9808
9809
9810
9811
9815
9817 {
9820
9822 }
9823
9824
9826 {
9828 return;
9829
9831
9834
9837
9838 SoundParameters params = new SoundParameters();
9842 }
9843
9844
9846 {
9848 return;
9849
9851 SetSynchDirty();
9852
9855 }
9856
9857
9859 {
9861 return;
9862
9864 SetSynchDirty();
9865
9868 }
9869
9871 {
9873 }
9874
9876 {
9878 }
9879
9882 {
9883 if (!
GetGame().IsDedicatedServer())
9884 {
9885 if (ConfigIsExisting("attachSoundSet"))
9886 {
9887 string cfg_path = "";
9888 string soundset = "";
9890
9893 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9894 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9895
9896 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9897 {
9898 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9899 {
9900 if (cfg_slot_array[i] == slot_type)
9901 {
9902 soundset = cfg_soundset_array[i];
9903 break;
9904 }
9905 }
9906 }
9907
9908 if (soundset != "")
9909 {
9910 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9912 }
9913 }
9914 }
9915 }
9916
9918 {
9919
9920 }
9921
9922 void OnApply(PlayerBase player);
9923
9925 {
9926 return 1.0;
9927 };
9928
9930 {
9932 }
9933
9935 {
9937 }
9938
9940
9942 {
9943 SetDynamicPhysicsLifeTime(0.01);
9945 }
9946
9948 {
9949 array<string> zone_names = new array<string>;
9950 GetDamageZones(zone_names);
9951 for (int i = 0; i < zone_names.Count(); i++)
9952 {
9953 SetHealthMax(zone_names.Get(i),"Health");
9954 }
9955 SetHealthMax("","Health");
9956 }
9957
9960 {
9961 float global_health = GetHealth01("","Health");
9962 array<string> zones = new array<string>;
9963 GetDamageZones(zones);
9964
9965 for (int i = 0; i < zones.Count(); i++)
9966 {
9967 SetHealth01(zones.Get(i),"Health",global_health);
9968 }
9969 }
9970
9973 {
9974 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
9975 }
9976
9978 {
9979 if (!hasRootAsPlayer)
9980 {
9981 if (refParentIB)
9982 {
9983
9984 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
9985 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
9986
9987 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
9988 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
9989
9992 }
9993 else
9994 {
9995
9998 }
9999 }
10000 }
10001
10003 {
10005 {
10006 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10007 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10008 {
10009 float heatPermCoef = 1.0;
10011 while (ent)
10012 {
10013 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10014 ent = ent.GetHierarchyParent();
10015 }
10016
10017 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10018 }
10019 }
10020 }
10021
10023 {
10024
10025 EntityAI parent = GetHierarchyParent();
10026 if (!parent)
10027 {
10028 hasParent = false;
10029 hasRootAsPlayer = false;
10030 }
10031 else
10032 {
10033 hasParent = true;
10034 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10035 refParentIB =
ItemBase.Cast(parent);
10036 }
10037 }
10038
10039 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10040 {
10041
10042 }
10043
10045 {
10046
10047 return false;
10048 }
10049
10051 {
10052
10053
10054 return false;
10055 }
10056
10058 {
10059
10060 return false;
10061 }
10062
10065 {
10066 return !GetIsFrozen() &&
IsOpen();
10067 }
10068
10070 {
10071 bool hasParent = false, hasRootAsPlayer = false;
10073
10074 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10075 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10076
10077 if (wwtu || foodDecay)
10078 {
10082
10083 if (processWetness || processTemperature || processDecay)
10084 {
10086
10087 if (processWetness)
10088 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10089
10090 if (processTemperature)
10092
10093 if (processDecay)
10094 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10095 }
10096 }
10097 }
10098
10101 {
10103 }
10104
10106 {
10109
10110 return super.GetTemperatureFreezeThreshold();
10111 }
10112
10114 {
10117
10118 return super.GetTemperatureThawThreshold();
10119 }
10120
10122 {
10125
10126 return super.GetItemOverheatThreshold();
10127 }
10128
10130 {
10132 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10133
10134 return super.GetTemperatureFreezeTime();
10135 }
10136
10138 {
10140 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10141
10142 return super.GetTemperatureThawTime();
10143 }
10144
10149
10151 {
10152 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10153 }
10154
10156 {
10157 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10158 }
10159
10162 {
10164 }
10165
10167 {
10169 }
10170
10172 {
10174 }
10175
10178 {
10179 return null;
10180 }
10181
10184 {
10185 return false;
10186 }
10187
10189 {
10191 {
10194 if (!trg)
10195 {
10197 explosive = this;
10198 }
10199
10200 explosive.PairRemote(trg);
10202
10203 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10204 trg.SetPersistentPairID(persistentID);
10205 explosive.SetPersistentPairID(persistentID);
10206
10207 return true;
10208 }
10209 return false;
10210 }
10211
10214 {
10215 float ret = 1.0;
10218 ret *= GetHealth01();
10219
10220 return ret;
10221 }
10222
10223 #ifdef DEVELOPER
10224 override void SetDebugItem()
10225 {
10226 super.SetDebugItem();
10227 _itemBase = this;
10228 }
10229
10231 {
10232 string text = super.GetDebugText();
10233
10235 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10236
10237 return text;
10238 }
10239 #endif
10240
10242 {
10243 return true;
10244 }
10245
10247
10249
10251 {
10254 }
10255
10256
10264
10280}
10281
10283{
10285 if (entity)
10286 {
10287 bool is_item = entity.IsInherited(
ItemBase);
10288 if (is_item && full_quantity)
10289 {
10292 }
10293 }
10294 else
10295 {
10297 return NULL;
10298 }
10299 return entity;
10300}
10301
10303{
10304 if (item)
10305 {
10306 if (health > 0)
10307 item.SetHealth("", "", health);
10308
10309 if (item.CanHaveTemperature())
10310 {
10312 if (item.CanFreeze())
10313 item.SetFrozen(false);
10314 }
10315
10316 if (item.HasEnergyManager())
10317 {
10318 if (quantity >= 0)
10319 {
10320 item.GetCompEM().SetEnergy0To1(quantity);
10321 }
10322 else
10323 {
10325 }
10326 }
10327 else if (item.IsMagazine())
10328 {
10329 Magazine mag = Magazine.Cast(item);
10330 if (quantity >= 0)
10331 {
10332 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10333 }
10334 else
10335 {
10337 }
10338
10339 }
10340 else
10341 {
10342 if (quantity >= 0)
10343 {
10344 item.SetQuantityNormalized(quantity, false);
10345 }
10346 else
10347 {
10349 }
10350
10351 }
10352 }
10353}
10354
10355#ifdef DEVELOPER
10357#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.