5562{
5564 {
5565 return true;
5566 }
5567};
5568
5569
5570
5572{
5576
5578
5581
5582
5583
5584
5585
5594
5600
5605
5610
5631 protected bool m_IsResultOfSplit
5632
5634
5639
5640
5641
5643
5647
5648
5649
5651
5654
5655
5656
5662
5663
5671
5674
5675
5677
5678
5680
5681
5686
5687
5692
5693
5695
5696
5698 {
5703
5704 if (!
GetGame().IsDedicatedServer())
5705 {
5707 {
5709
5711 {
5713 }
5714 }
5715
5718 }
5719
5720 m_OldLocation = null;
5721
5723 {
5725 }
5726
5727 if (ConfigIsExisting("headSelectionsToHide"))
5728 {
5731 }
5732
5734 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5735 {
5737 }
5738
5740
5741 m_IsResultOfSplit = false;
5742
5744 }
5745
5747 {
5748 super.InitItemVariables();
5749
5755 m_Count = ConfigGetInt(
"count");
5756
5759
5764
5767
5772
5784
5788
5789
5792 if (ConfigIsExisting("canBeSplit"))
5793 {
5796 }
5797
5799 if (ConfigIsExisting("itemBehaviour"))
5801
5802
5805 RegisterNetSyncVariableInt("m_VarLiquidType");
5806 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5807
5808 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5809 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5810 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5811
5812 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5813 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5814 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5815 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5816
5817 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5818 RegisterNetSyncVariableBool("m_IsTakeable");
5819 RegisterNetSyncVariableBool("m_IsHologram");
5820
5823 {
5826 }
5827
5829
5831 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5833
5834 }
5835
5837 {
5839 }
5840
5842 {
5845 {
5850 }
5851 }
5852
5853 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5854 {
5856 {
5859 }
5860
5862 }
5863
5865 {
5871 }
5872
5874
5876 {
5878
5879 if (!action)
5880 {
5881 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5882 return;
5883 }
5884
5886 if (!ai)
5887 {
5889 return;
5890 }
5891
5893 if (!action_array)
5894 {
5895 action_array = new array<ActionBase_Basic>;
5897 }
5898 if (LogManager.IsActionLogEnable())
5899 {
5900 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5901 }
5902
5903 if (action_array.Find(action) != -1)
5904 {
5905 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5906 }
5907 else
5908 {
5909 action_array.Insert(action);
5910 }
5911 }
5912
5914 {
5916 ActionBase action = player.GetActionManager().GetAction(actionName);
5919
5920 if (action_array)
5921 {
5922 action_array.RemoveItem(action);
5923 }
5924 }
5925
5926
5927
5929 {
5930 ActionOverrideData overrideData = new ActionOverrideData();
5934
5936 if (!actionMap)
5937 {
5940 }
5941
5942 actionMap.Insert(this.
Type(), overrideData);
5943
5944 }
5945
5947
5949
5950
5952 {
5955
5958
5959 string config_to_search = "CfgVehicles";
5960 string muzzle_owner_config;
5961
5963 {
5964 if (IsInherited(Weapon))
5965 config_to_search = "CfgWeapons";
5966
5967 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5968
5969 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5970
5972
5973 if (config_OnFire_subclass_count > 0)
5974 {
5975 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5976
5977 for (int i = 0; i < config_OnFire_subclass_count; i++)
5978 {
5979 string particle_class = "";
5981 string config_OnFire_entry = config_OnFire_class + particle_class;
5982 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5983 WPOF_array.Insert(WPOF);
5984 }
5985
5986
5988 }
5989 }
5990
5992 {
5993 config_to_search = "CfgWeapons";
5994 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5995
5996 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5997
5999
6000 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6001 {
6002 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6003
6004 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6005 {
6006 string particle_class2 = "";
6008 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6009 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6010 WPOBE_array.Insert(WPOBE);
6011 }
6012
6013
6015 }
6016 }
6017 }
6018
6019
6021 {
6024
6026 {
6027 string config_to_search = "CfgVehicles";
6028
6029 if (IsInherited(Weapon))
6030 config_to_search = "CfgWeapons";
6031
6032 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6033 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6034
6035 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6036 {
6037
6039
6041 {
6043 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6045 return;
6046 }
6047
6050
6051
6052
6054 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6055
6056 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6057 {
6058 string particle_class = "";
6060 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6062
6063 if (entry_type == CT_CLASS)
6064 {
6065 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6066 WPOOH_array.Insert(WPOF);
6067 }
6068 }
6069
6070
6072 }
6073 }
6074 }
6075
6077 {
6079 }
6080
6082 {
6084 {
6086
6089
6092
6093 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6094 }
6095 }
6096
6098 {
6100 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6101
6103 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6104
6106 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6107
6109 {
6111 }
6112 }
6113
6115 {
6117 }
6118
6120 {
6123 else
6125
6127 {
6130 }
6131 else
6132 {
6135
6138 }
6139
6141 }
6142
6144 {
6146 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6147 }
6148
6150 {
6152 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6154 }
6155
6157 {
6159 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6160 }
6161
6163 {
6166
6167 OverheatingParticle OP = new OverheatingParticle();
6172
6174 }
6175
6177 {
6180
6181 return -1;
6182 }
6183
6185 {
6187 {
6190
6191 for (int i = count; i > 0; --i)
6192 {
6193 int id = i - 1;
6196
6199
6200 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6201 {
6202 if (p)
6203 {
6206 }
6207 }
6208 }
6209 }
6210 }
6211
6213 {
6215 {
6217 {
6218 int id = i - 1;
6220
6221 if (OP)
6222 {
6224
6225 if (p)
6226 {
6228 }
6229
6230 delete OP;
6231 }
6232 }
6233
6236 }
6237 }
6238
6241 {
6242 return 0.0;
6243 }
6244
6245
6247 {
6248 return 250;
6249 }
6250
6252 {
6253 return 0;
6254 }
6255
6258 {
6260 return true;
6261
6262 return false;
6263 }
6264
6267 {
6270
6272 {
6274 }
6275 else
6276 {
6277
6279 }
6280
6282 }
6283
6290 {
6291 return -1;
6292 }
6293
6294
6295
6296
6298 {
6300 {
6302 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6303
6304 if (r_index >= 0)
6305 {
6306 InventoryLocation r_il = new InventoryLocation;
6307 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6308
6309 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6312 {
6313 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6314 }
6316 {
6317 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6318 }
6319
6320 }
6321
6322 player.GetHumanInventory().ClearUserReservedLocation(this);
6323 }
6324
6327 }
6328
6329
6330
6331
6333 {
6334 return ItemBase.m_DebugActionsMask;
6335 }
6336
6338 {
6339 return ItemBase.m_DebugActionsMask & mask;
6340 }
6341
6343 {
6344 ItemBase.m_DebugActionsMask = mask;
6345 }
6346
6348 {
6349 ItemBase.m_DebugActionsMask |= mask;
6350 }
6351
6353 {
6354 ItemBase.m_DebugActionsMask &= ~mask;
6355 }
6356
6358 {
6360 {
6362 }
6363 else
6364 {
6366 }
6367 }
6368
6369
6371 {
6372 if (GetEconomyProfile())
6373 {
6374 float q_max = GetEconomyProfile().GetQuantityMax();
6375 if (q_max > 0)
6376 {
6377 float q_min = GetEconomyProfile().GetQuantityMin();
6378 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6379
6381 {
6382 ComponentEnergyManager comp = GetCompEM();
6384 {
6386 }
6387 }
6389 {
6391
6392 }
6393
6394 }
6395 }
6396 }
6397
6400 {
6401 EntityAI parent = GetHierarchyParent();
6402
6403 if (parent)
6404 {
6405 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6406 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6407 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6408 }
6409 }
6410
6413 {
6414 EntityAI parent = GetHierarchyParent();
6415
6416 if (parent)
6417 {
6418 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6419 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6420 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6421 }
6422 }
6423
6425 {
6426
6427
6428
6429
6431
6433 {
6434 if (ScriptInputUserData.CanStoreInputUserData())
6435 {
6436 ScriptInputUserData ctx = new ScriptInputUserData;
6442 ctx.
Write(use_stack_max);
6445
6447 {
6448 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6449 }
6450 }
6451 }
6452 else if (!
GetGame().IsMultiplayer())
6453 {
6455 }
6456 }
6457
6459 {
6461 }
6462
6464 {
6466 }
6467
6469 {
6471 }
6472
6474 {
6475
6476 return false;
6477 }
6478
6480 {
6481 return false;
6482 }
6483
6487 {
6488 return false;
6489 }
6490
6492 {
6493 return "";
6494 }
6495
6497
6499 {
6500 return false;
6501 }
6502
6504 {
6505 return true;
6506 }
6507
6508
6509
6511 {
6512 return true;
6513 }
6514
6516 {
6517 return true;
6518 }
6519
6521 {
6522 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6524 }
6525
6527 {
6529 }
6530
6532 {
6534 if (!is_being_placed)
6536 SetSynchDirty();
6537 }
6538
6539
6541
6543 {
6545 }
6546
6548 {
6550 }
6551
6553 {
6554 return 1;
6555 }
6556
6558 {
6559 return false;
6560 }
6561
6563 {
6565 SetSynchDirty();
6566 }
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6603 {
6604 super.OnMovedInsideCargo(container);
6605
6606 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6607 }
6608
6609 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6610 {
6611 super.EEItemLocationChanged(oldLoc,newLoc);
6612
6613 PlayerBase new_player = null;
6614 PlayerBase old_player = null;
6615
6616 if (newLoc.GetParent())
6617 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6618
6619 if (oldLoc.GetParent())
6620 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6621
6623 {
6624 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6625
6626 if (r_index >= 0)
6627 {
6628 InventoryLocation r_il = new InventoryLocation;
6629 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6630
6631 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6634 {
6635 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6636 }
6638 {
6639 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6640 }
6641
6642 }
6643 }
6644
6646 {
6647 if (new_player)
6648 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6649
6650 if (new_player == old_player)
6651 {
6652
6653 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6654 {
6656 {
6657 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6658 {
6659 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6660 }
6661 }
6662 else
6663 {
6664 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6665 }
6666 }
6667
6668 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6669 {
6670 int type = oldLoc.GetType();
6672 {
6673 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6674 }
6676 {
6677 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6678 }
6679 }
6680 if (!m_OldLocation)
6681 {
6682 m_OldLocation = new InventoryLocation;
6683 }
6684 m_OldLocation.Copy(oldLoc);
6685 }
6686 else
6687 {
6688 if (m_OldLocation)
6689 {
6690 m_OldLocation.Reset();
6691 }
6692 }
6693
6695 }
6696 else
6697 {
6698 if (new_player)
6699 {
6700 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6701 if (res_index >= 0)
6702 {
6703 InventoryLocation il = new InventoryLocation;
6704 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6706 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6709 {
6710 il.
GetParent().GetOnReleaseLock().Invoke(it);
6711 }
6713 {
6715 }
6716
6717 }
6718 }
6720 {
6721
6723 }
6724
6725 if (m_OldLocation)
6726 {
6727 m_OldLocation.Reset();
6728 }
6729 }
6730 }
6731
6732 override void EOnContact(IEntity other, Contact extra)
6733 {
6735 {
6736 int liquidType = -1;
6738 if (impactSpeed > 0.0)
6739 {
6741 #ifndef SERVER
6743 #else
6745 SetSynchDirty();
6746 #endif
6748 }
6749 }
6750
6751 #ifdef SERVER
6752 if (GetCompEM() && GetCompEM().IsPlugged())
6753 {
6754 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6755 GetCompEM().UnplugThis();
6756 }
6757 #endif
6758 }
6759
6761
6763 {
6765 }
6766
6768 {
6769
6770 }
6771
6773 {
6774 super.OnItemLocationChanged(old_owner, new_owner);
6775
6776 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6777 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6778
6779 if (!relatedPlayer && playerNew)
6780 relatedPlayer = playerNew;
6781
6782 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6783 {
6785 if (actionMgr)
6786 {
6787 ActionBase currentAction = actionMgr.GetRunningAction();
6788 if (currentAction)
6790 }
6791 }
6792
6793 Man ownerPlayerOld = null;
6794 Man ownerPlayerNew = null;
6795
6796 if (old_owner)
6797 {
6798 if (old_owner.
IsMan())
6799 {
6800 ownerPlayerOld = Man.Cast(old_owner);
6801 }
6802 else
6803 {
6804 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6805 }
6806 }
6807 else
6808 {
6810 {
6812
6813 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6814 {
6815 GetCompEM().UnplugThis();
6816 }
6817 }
6818 }
6819
6820 if (new_owner)
6821 {
6822 if (new_owner.
IsMan())
6823 {
6824 ownerPlayerNew = Man.Cast(new_owner);
6825 }
6826 else
6827 {
6828 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6829 }
6830 }
6831
6832 if (ownerPlayerOld != ownerPlayerNew)
6833 {
6834 if (ownerPlayerOld)
6835 {
6836 array<EntityAI> subItemsExit = new array<EntityAI>;
6838 for (int i = 0; i < subItemsExit.Count(); i++)
6839 {
6842 }
6843 }
6844
6845 if (ownerPlayerNew)
6846 {
6847 array<EntityAI> subItemsEnter = new array<EntityAI>;
6849 for (int j = 0; j < subItemsEnter.Count(); j++)
6850 {
6853 }
6854 }
6855 }
6856 else if (ownerPlayerNew != null)
6857 {
6858 PlayerBase nplayer;
6859 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6860 {
6861 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6863 for (int k = 0; k < subItemsUpdate.Count(); k++)
6864 {
6866 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6867 }
6868 }
6869 }
6870
6871 if (old_owner)
6872 old_owner.OnChildItemRemoved(this);
6873 if (new_owner)
6874 new_owner.OnChildItemReceived(this);
6875 }
6876
6877
6879 {
6880 super.EEDelete(parent);
6881 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6882 if (player)
6883 {
6885
6886 if (player.IsAlive())
6887 {
6888 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6889 if (r_index >= 0)
6890 {
6891 InventoryLocation r_il = new InventoryLocation;
6892 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6893
6894 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6897 {
6898 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6899 }
6901 {
6902 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6903 }
6904
6905 }
6906
6907 player.RemoveQuickBarEntityShortcut(this);
6908 }
6909 }
6910 }
6911
6913 {
6914 super.EEKilled(killer);
6915
6918 {
6919 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6920 {
6921 if (IsMagazine())
6922 {
6923 if (Magazine.Cast(this).GetAmmoCount() > 0)
6924 {
6926 }
6927 }
6928 else
6929 {
6931 }
6932 }
6933 }
6934 }
6935
6937 {
6938 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6939
6940 super.OnWasAttached(parent, slot_id);
6941
6944
6946 }
6947
6949 {
6950 super.OnWasDetached(parent, slot_id);
6951
6954 }
6955
6957 {
6958 int idx;
6961
6962 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6963 if (inventory_slots.Count() < 1)
6964 {
6965 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6966 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6967 }
6968 else
6969 {
6970 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6971 }
6972
6973 idx = inventory_slots.Find(slot);
6974 if (idx < 0)
6975 return "";
6976
6977 return attach_types.Get(idx);
6978 }
6979
6981 {
6982 int idx = -1;
6983 string slot;
6984
6987
6988 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6989 if (inventory_slots.Count() < 1)
6990 {
6991 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6992 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6993 }
6994 else
6995 {
6996 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6997 if (detach_types.Count() < 1)
6998 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6999 }
7000
7001 for (int i = 0; i < inventory_slots.Count(); i++)
7002 {
7003 slot = inventory_slots.Get(i);
7004 }
7005
7006 if (slot != "")
7007 {
7008 if (detach_types.Count() == 1)
7009 idx = 0;
7010 else
7011 idx = inventory_slots.Find(slot);
7012 }
7013 if (idx < 0)
7014 return "";
7015
7016 return detach_types.Get(idx);
7017 }
7018
7020 {
7021
7023
7024
7025 float min_time = 1;
7026 float max_time = 3;
7027 float delay = Math.RandomFloat(min_time, max_time);
7028
7029 explode_timer.Run(delay, this, "DoAmmoExplosion");
7030 }
7031
7033 {
7034 Magazine magazine = Magazine.Cast(this);
7035 int pop_sounds_count = 6;
7036 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7037
7038
7039 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7040 string sound_name = pop_sounds[ sound_idx ];
7042
7043
7044 magazine.ServerAddAmmoCount(-1);
7045
7046
7047 float min_temp_to_explode = 100;
7048
7049 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7050 {
7052 }
7053 }
7054
7055
7056 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7057 {
7058 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7059
7060 const int CHANCE_DAMAGE_CARGO = 4;
7061 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7062 const int CHANCE_DAMAGE_NOTHING = 2;
7063
7065 {
7066 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7067 int chances;
7068 int rnd;
7069
7070 if (GetInventory().GetCargo())
7071 {
7072 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7073 rnd = Math.RandomInt(0,chances);
7074
7075 if (rnd < CHANCE_DAMAGE_CARGO)
7076 {
7078 }
7079 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7080 {
7082 }
7083 }
7084 else
7085 {
7086 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7087 rnd = Math.RandomInt(0,chances);
7088
7089 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7090 {
7092 }
7093 }
7094 }
7095 }
7096
7098 {
7099 if (GetInventory().GetCargo())
7100 {
7101 int item_count = GetInventory().GetCargo().GetItemCount();
7102 if (item_count > 0)
7103 {
7104 int random_pick = Math.RandomInt(0, item_count);
7106 if (!item.IsExplosive())
7107 {
7108 item.AddHealth("","",damage);
7109 return true;
7110 }
7111 }
7112 }
7113 return false;
7114 }
7115
7117 {
7118 int attachment_count = GetInventory().AttachmentCount();
7119 if (attachment_count > 0)
7120 {
7121 int random_pick = Math.RandomInt(0, attachment_count);
7122 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7123 if (!attachment.IsExplosive())
7124 {
7125 attachment.AddHealth("","",damage);
7126 return true;
7127 }
7128 }
7129 return false;
7130 }
7131
7133 {
7135 }
7136
7138 {
7140 return GetInventory().CanRemoveEntity();
7141
7142 return false;
7143 }
7144
7146 {
7148 return;
7149
7151 {
7152 if (ScriptInputUserData.CanStoreInputUserData())
7153 {
7154 ScriptInputUserData ctx = new ScriptInputUserData;
7159 ctx.
Write(destination_entity);
7163 }
7164 }
7165 else if (!
GetGame().IsMultiplayer())
7166 {
7168 }
7169 }
7170
7172 {
7174 return;
7175
7176 float split_quantity_new;
7180 InventoryLocation loc = new InventoryLocation;
7181
7182 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7183 {
7185 split_quantity_new = stack_max;
7186 else
7188
7189 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
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 if (destination_entity && slot_id == -1)
7199 {
7200 if (quantity > stack_max)
7201 split_quantity_new = stack_max;
7202 else
7203 split_quantity_new = quantity;
7204
7206 {
7209 }
7210
7211 if (new_item)
7212 {
7213 new_item.SetResultOfSplit(true);
7214 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7216 new_item.SetQuantity(split_quantity_new);
7217 }
7218 }
7219 else
7220 {
7221 if (stack_max != 0)
7222 {
7224 {
7226 }
7227
7228 if (split_quantity_new == 0)
7229 {
7230 if (!
GetGame().IsMultiplayer())
7231 player.PhysicalPredictiveDropItem(this);
7232 else
7233 player.ServerDropEntity(this);
7234 return;
7235 }
7236
7238
7239 if (new_item)
7240 {
7241 new_item.SetResultOfSplit(true);
7242 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7244 new_item.SetQuantity(stack_max);
7245 new_item.PlaceOnSurface();
7246 }
7247 }
7248 }
7249 }
7250
7252 {
7254 return;
7255
7256 float split_quantity_new;
7260 InventoryLocation loc = new InventoryLocation;
7261
7262 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7263 {
7265 split_quantity_new = stack_max;
7266 else
7268
7269 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7270 if (new_item)
7271 {
7272 new_item.SetResultOfSplit(true);
7273 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7275 new_item.SetQuantity(split_quantity_new);
7276 }
7277 }
7278 else if (destination_entity && slot_id == -1)
7279 {
7280 if (quantity > stack_max)
7281 split_quantity_new = stack_max;
7282 else
7283 split_quantity_new = quantity;
7284
7286 {
7289 }
7290
7291 if (new_item)
7292 {
7293 new_item.SetResultOfSplit(true);
7294 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7296 new_item.SetQuantity(split_quantity_new);
7297 }
7298 }
7299 else
7300 {
7301 if (stack_max != 0)
7302 {
7304 {
7306 }
7307
7309
7310 if (new_item)
7311 {
7312 new_item.SetResultOfSplit(true);
7313 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7315 new_item.SetQuantity(stack_max);
7316 new_item.PlaceOnSurface();
7317 }
7318 }
7319 }
7320 }
7321
7323 {
7325 return;
7326
7328 {
7329 if (ScriptInputUserData.CanStoreInputUserData())
7330 {
7331 ScriptInputUserData ctx = new ScriptInputUserData;
7336 dst.WriteToContext(ctx);
7338 }
7339 }
7340 else if (!
GetGame().IsMultiplayer())
7341 {
7343 }
7344 }
7345
7347 {
7349 return;
7350
7352 {
7353 if (ScriptInputUserData.CanStoreInputUserData())
7354 {
7355 ScriptInputUserData ctx = new ScriptInputUserData;
7360 ctx.
Write(destination_entity);
7366 }
7367 }
7368 else if (!
GetGame().IsMultiplayer())
7369 {
7371 }
7372 }
7373
7375 {
7377 }
7378
7380 {
7382 return this;
7383
7385 float split_quantity_new;
7387 if (dst.IsValid())
7388 {
7389 int slot_id = dst.GetSlot();
7391
7392 if (quantity > stack_max)
7393 split_quantity_new = stack_max;
7394 else
7395 split_quantity_new = quantity;
7396
7398
7399 if (new_item)
7400 {
7401 new_item.SetResultOfSplit(true);
7402 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7405 }
7406
7407 return new_item;
7408 }
7409
7410 return null;
7411 }
7412
7414 {
7416 return;
7417
7419 float split_quantity_new;
7421 if (destination_entity)
7422 {
7424 if (quantity > stackable)
7425 split_quantity_new = stackable;
7426 else
7427 split_quantity_new = quantity;
7428
7429 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7430 if (new_item)
7431 {
7432 new_item.SetResultOfSplit(true);
7433 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7435 new_item.SetQuantity(split_quantity_new);
7436 }
7437 }
7438 }
7439
7441 {
7443 return;
7444
7446 {
7447 if (ScriptInputUserData.CanStoreInputUserData())
7448 {
7449 ScriptInputUserData ctx = new ScriptInputUserData;
7454 ItemBase destination_entity =
this;
7455 ctx.
Write(destination_entity);
7459 }
7460 }
7461 else if (!
GetGame().IsMultiplayer())
7462 {
7464 }
7465 }
7466
7468 {
7470 return;
7471
7473 float split_quantity_new;
7475 if (player)
7476 {
7478 if (quantity > stackable)
7479 split_quantity_new = stackable;
7480 else
7481 split_quantity_new = quantity;
7482
7483 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7484 new_item =
ItemBase.Cast(in_hands);
7485 if (new_item)
7486 {
7487 new_item.SetResultOfSplit(true);
7488 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7490 new_item.SetQuantity(split_quantity_new);
7491 }
7492 }
7493 }
7494
7496 {
7498 return;
7499
7501 float split_quantity_new = Math.Floor(quantity * 0.5);
7502
7504
7505 if (new_item)
7506 {
7507 if (new_item.GetQuantityMax() < split_quantity_new)
7508 {
7509 split_quantity_new = new_item.GetQuantityMax();
7510 }
7511
7512 new_item.SetResultOfSplit(true);
7513 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7514
7516 {
7519 }
7520 else
7521 {
7524 }
7525 }
7526 }
7527
7529 {
7531 return;
7532
7534 float split_quantity_new = Math.Floor(quantity / 2);
7535
7536 InventoryLocation invloc = new InventoryLocation;
7538
7540 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7541
7542 if (new_item)
7543 {
7544 if (new_item.GetQuantityMax() < split_quantity_new)
7545 {
7546 split_quantity_new = new_item.GetQuantityMax();
7547 }
7549 {
7552 }
7553 else
7554 {
7557 }
7558 }
7559 }
7560
7563 {
7564 SetWeightDirty();
7566
7567 if (parent)
7568 parent.OnAttachmentQuantityChangedEx(this, delta);
7569
7571 {
7573 {
7575 }
7577 {
7578 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7580 }
7581 }
7582
7583 }
7584
7587 {
7588
7589 }
7590
7593 {
7595 }
7596
7598 {
7599 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7600
7602 {
7603 if (newLevel == GameConstants.STATE_RUINED)
7604 {
7606 EntityAI parent = GetHierarchyParent();
7607 if (parent && parent.IsFireplace())
7608 {
7609 CargoBase cargo = GetInventory().GetCargo();
7610 if (cargo)
7611 {
7613 {
7615 }
7616 }
7617 }
7618 }
7619
7621 {
7622
7624 return;
7625 }
7626
7627 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7628 {
7630 }
7631 }
7632 }
7633
7634
7636 {
7637 super.OnRightClick();
7638
7640 {
7642 {
7643 if (ScriptInputUserData.CanStoreInputUserData())
7644 {
7645 vector m4[4];
7647
7648 EntityAI root = GetHierarchyRoot();
7649
7650 InventoryLocation dst = new InventoryLocation;
7652 {
7653 if (root)
7654 {
7655 root.GetTransform(m4);
7657 }
7658 else
7659 GetInventory().GetCurrentInventoryLocation(dst);
7660 }
7661 else
7662 {
7664
7665
7666 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7667 {
7668 if (root)
7669 {
7670 root.GetTransform(m4);
7672 }
7673 else
7674 GetInventory().GetCurrentInventoryLocation(dst);
7675 }
7676 else
7677 {
7678 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7679 }
7680 }
7681
7682 ScriptInputUserData ctx = new ScriptInputUserData;
7690 }
7691 }
7692 else if (!
GetGame().IsMultiplayer())
7693 {
7695 }
7696 }
7697 }
7698
7699 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7700 {
7701
7702 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7703 return false;
7704
7705 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7706 return false;
7707
7708
7710 return false;
7711
7712
7713 Magazine mag = Magazine.Cast(this);
7714 if (mag)
7715 {
7716 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7717 return false;
7718
7719 if (stack_max_limit)
7720 {
7721 Magazine other_mag = Magazine.Cast(other_item);
7722 if (other_item)
7723 {
7724 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7725 return false;
7726 }
7727
7728 }
7729 }
7730 else
7731 {
7732
7734 return false;
7735
7737 return false;
7738 }
7739
7740 PlayerBase player = null;
7741 if (CastTo(player, GetHierarchyRootPlayer()))
7742 {
7743 if (player.GetInventory().HasAttachment(this))
7744 return false;
7745
7746 if (player.IsItemsToDelete())
7747 return false;
7748 }
7749
7750 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7751 return false;
7752
7753 int slotID;
7755 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7756 return false;
7757
7758 return true;
7759 }
7760
7762 {
7764 }
7765
7767 {
7768 return m_IsResultOfSplit;
7769 }
7770
7772 {
7773 m_IsResultOfSplit = value;
7774 }
7775
7777 {
7779 }
7780
7782 {
7783 float other_item_quantity = other_item.GetQuantity();
7784 float this_free_space;
7785
7787
7789
7790 if (other_item_quantity > this_free_space)
7791 {
7792 return this_free_space;
7793 }
7794 else
7795 {
7796 return other_item_quantity;
7797 }
7798 }
7799
7801 {
7803 }
7804
7806 {
7808 return;
7809
7810 if (!IsMagazine() && other_item)
7811 {
7813 if (quantity_used != 0)
7814 {
7815 float hp1 = GetHealth01("","");
7816 float hp2 = other_item.GetHealth01("","");
7817 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7818 hpResult = hpResult / (
GetQuantity() + quantity_used);
7819
7820 hpResult *= GetMaxHealth();
7821 Math.Round(hpResult);
7822 SetHealth("", "Health", hpResult);
7823
7825 other_item.AddQuantity(-quantity_used);
7826 }
7827 }
7829 }
7830
7832 {
7833 #ifdef SERVER
7834 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7835 GetHierarchyParent().IncreaseLifetimeUp();
7836 #endif
7837 };
7838
7840 {
7841 PlayerBase p = PlayerBase.Cast(player);
7842
7843 array<int> recipesIds = p.m_Recipes;
7844 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7845 if (moduleRecipesManager)
7846 {
7847 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7848 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7849 }
7850
7851 for (int i = 0;i < recipesIds.Count(); i++)
7852 {
7853 int key = recipesIds.Get(i);
7854 string recipeName = moduleRecipesManager.GetRecipeName(key);
7856 }
7857 }
7858
7859
7860 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7861 {
7862 super.GetDebugActions(outputList);
7863
7864
7869
7870
7874
7878
7879
7882
7883
7885 {
7888 }
7889
7891
7894
7898 }
7899
7900
7901
7902
7904 {
7905 super.OnAction(action_id, player, ctx);
7906 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7907 {
7908 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7909 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7910 PlayerBase p = PlayerBase.Cast(player);
7911 if (
EActions.RECIPES_RANGE_START < 1000)
7912 {
7913 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7914 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7915 }
7916 }
7917 #ifndef SERVER
7918 else if (action_id ==
EActions.WATCH_PLAYER)
7919 {
7920 PluginDeveloper.SetDeveloperItemClientEx(player);
7921 }
7922 #endif
7924 {
7925 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7926 {
7927 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7928 OnDebugButtonPressServer(id + 1);
7929 }
7930
7931 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7932 {
7933 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7935 }
7936
7937 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7938 {
7939 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7941 }
7942
7943 else if (action_id ==
EActions.ADD_QUANTITY)
7944 {
7945 if (IsMagazine())
7946 {
7947 Magazine mag = Magazine.Cast(this);
7948 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
7949 }
7950 else
7951 {
7953 }
7954
7955 if (m_EM)
7956 {
7957 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
7958 }
7959
7960 }
7961
7962 else if (action_id ==
EActions.REMOVE_QUANTITY)
7963 {
7964 if (IsMagazine())
7965 {
7966 Magazine mag2 = Magazine.Cast(this);
7967 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
7968 }
7969 else
7970 {
7972 }
7973 if (m_EM)
7974 {
7975 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
7976 }
7977
7978 }
7979
7980 else if (action_id ==
EActions.SET_QUANTITY_0)
7981 {
7983
7984 if (m_EM)
7985 {
7986 m_EM.SetEnergy(0);
7987 }
7988 }
7989
7990 else if (action_id ==
EActions.SET_MAX_QUANTITY)
7991 {
7993
7994 if (m_EM)
7995 {
7996 m_EM.SetEnergy(m_EM.GetEnergyMax());
7997 }
7998 }
7999
8000 else if (action_id ==
EActions.ADD_HEALTH)
8001 {
8002 AddHealth("","",GetMaxHealth("","Health")/5);
8003 }
8004 else if (action_id ==
EActions.REMOVE_HEALTH)
8005 {
8006 AddHealth("","",-GetMaxHealth("","Health")/5);
8007 }
8008 else if (action_id ==
EActions.DESTROY_HEALTH)
8009 {
8010 SetHealth01("","",0);
8011 }
8012 else if (action_id ==
EActions.WATCH_ITEM)
8013 {
8015 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8016 #ifdef DEVELOPER
8017 SetDebugDeveloper_item(this);
8018 #endif
8019 }
8020
8021 else if (action_id ==
EActions.ADD_TEMPERATURE)
8022 {
8023 AddTemperature(20);
8024
8025 }
8026
8027 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8028 {
8029 AddTemperature(-20);
8030
8031 }
8032
8033 else if (action_id ==
EActions.FLIP_FROZEN)
8034 {
8035 SetFrozen(!GetIsFrozen());
8036
8037 }
8038
8039 else if (action_id ==
EActions.ADD_WETNESS)
8040 {
8042
8043 }
8044
8045 else if (action_id ==
EActions.REMOVE_WETNESS)
8046 {
8048
8049 }
8050
8051 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8052 {
8055
8056
8057 }
8058
8059 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8060 {
8063 }
8064
8065 else if (action_id ==
EActions.MAKE_SPECIAL)
8066 {
8067 auto debugParams = DebugSpawnParams.WithPlayer(player);
8068 OnDebugSpawnEx(debugParams);
8069 }
8070
8071 else if (action_id ==
EActions.DELETE)
8072 {
8073 Delete();
8074 }
8075
8076 }
8077
8078
8079 return false;
8080 }
8081
8082
8083
8084
8088
8091
8092
8093
8095 {
8096 return false;
8097 }
8098
8099
8101 {
8102 return true;
8103 }
8104
8105
8107 {
8108 return true;
8109 }
8110
8111
8112
8114 {
8115 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8117 }
8118
8121 {
8122 return null;
8123 }
8124
8126 {
8127 return false;
8128 }
8129
8131 {
8132 return false;
8133 }
8134
8138
8139
8141 {
8142 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8143 return module_repairing.CanRepair(this, item_repair_kit);
8144 }
8145
8146
8147 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8148 {
8149 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8150 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8151 }
8152
8153
8155 {
8156
8157
8158
8159
8160
8161
8162
8163
8164 return 1;
8165 }
8166
8167
8168
8170 {
8172 }
8173
8174
8175
8177 {
8179 }
8180
8181
8190 {
8191 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8192
8193 if (player)
8194 {
8195 player.MessageStatus(text);
8196 }
8197 }
8198
8199
8208 {
8209 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8210
8211 if (player)
8212 {
8213 player.MessageAction(text);
8214 }
8215 }
8216
8217
8226 {
8227 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8228
8229 if (player)
8230 {
8231 player.MessageFriendly(text);
8232 }
8233 }
8234
8235
8244 {
8245 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8246
8247 if (player)
8248 {
8249 player.MessageImportant(text);
8250 }
8251 }
8252
8254 {
8255 return true;
8256 }
8257
8258
8259 override bool KindOf(
string tag)
8260 {
8261 bool found = false;
8262 string item_name = this.
GetType();
8265
8266 int array_size = item_tag_array.Count();
8267 for (int i = 0; i < array_size; i++)
8268 {
8269 if (item_tag_array.Get(i) == tag)
8270 {
8271 found = true;
8272 break;
8273 }
8274 }
8275 return found;
8276 }
8277
8278
8280 {
8281
8282 super.OnRPC(sender, rpc_type,ctx);
8283
8284
8285 switch (rpc_type)
8286 {
8287 #ifndef SERVER
8288 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8289 Param2<bool, string> p = new Param2<bool, string>(false, "");
8290
8292 return;
8293
8294 bool play = p.param1;
8295 string soundSet = p.param2;
8296
8297 if (play)
8298 {
8300 {
8302 {
8304 }
8305 }
8306 else
8307 {
8309 }
8310 }
8311 else
8312 {
8314 }
8315
8316 break;
8317 #endif
8318
8319 }
8320
8322 {
8324 }
8325 }
8326
8327
8328
8329
8331 {
8332 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8333 return plugin.GetID(
name);
8334 }
8335
8337 {
8338 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8339 return plugin.GetName(id);
8340 }
8341
8344 {
8345
8346
8347 int varFlags;
8348 if (!ctx.
Read(varFlags))
8349 return;
8350
8351 if (varFlags & ItemVariableFlags.FLOAT)
8352 {
8354 }
8355 }
8356
8358 {
8359
8360 super.SerializeNumericalVars(floats_out);
8361
8362
8363
8365 {
8367 }
8368
8370 {
8372 }
8373
8375 {
8377 }
8378
8380 {
8385 }
8386
8388 {
8390 }
8391 }
8392
8394 {
8395
8396 super.DeSerializeNumericalVars(floats);
8397
8398
8399 int index = 0;
8400 int mask = Math.Round(floats.Get(index));
8401
8402 index++;
8403
8405 {
8407 {
8409 }
8410 else
8411 {
8412 float quantity = floats.Get(index);
8414 }
8415 index++;
8416 }
8417
8419 {
8420 float wet = floats.Get(index);
8422 index++;
8423 }
8424
8426 {
8427 int liquidtype = Math.Round(floats.Get(index));
8429 index++;
8430 }
8431
8433 {
8435 index++;
8437 index++;
8439 index++;
8441 index++;
8442 }
8443
8445 {
8446 int cleanness = Math.Round(floats.Get(index));
8448 index++;
8449 }
8450 }
8451
8453 {
8454 super.WriteVarsToCTX(ctx);
8455
8456
8458 {
8460 }
8461
8463 {
8465 }
8466
8468 {
8470 }
8471
8473 {
8474 int r,g,b,a;
8480 }
8481
8483 {
8485 }
8486 }
8487
8489 {
8490 if (!super.ReadVarsFromCTX(ctx,version))
8491 return false;
8492
8493 int intValue;
8494 float value;
8495
8496 if (version < 140)
8497 {
8498 if (!ctx.
Read(intValue))
8499 return false;
8500
8501 m_VariablesMask = intValue;
8502 }
8503
8505 {
8506 if (!ctx.
Read(value))
8507 return false;
8508
8510 {
8512 }
8513 else
8514 {
8516 }
8517 }
8518
8519 if (version < 140)
8520 {
8522 {
8523 if (!ctx.
Read(value))
8524 return false;
8525 SetTemperatureDirect(value);
8526 }
8527 }
8528
8530 {
8531 if (!ctx.
Read(value))
8532 return false;
8534 }
8535
8537 {
8538 if (!ctx.
Read(intValue))
8539 return false;
8541 }
8542
8544 {
8545 int r,g,b,a;
8547 return false;
8549 return false;
8551 return false;
8553 return false;
8554
8556 }
8557
8559 {
8560 if (!ctx.
Read(intValue))
8561 return false;
8563 }
8564
8565 if (version >= 138 && version < 140)
8566 {
8568 {
8569 if (!ctx.
Read(intValue))
8570 return false;
8571 SetFrozen(intValue);
8572 }
8573 }
8574
8575 return true;
8576 }
8577
8578
8580 {
8583 {
8585 }
8586
8587 if (!super.OnStoreLoad(ctx, version))
8588 {
8590 return false;
8591 }
8592
8593 if (version >= 114)
8594 {
8595 bool hasQuickBarIndexSaved;
8596
8597 if (!ctx.
Read(hasQuickBarIndexSaved))
8598 {
8600 return false;
8601 }
8602
8603 if (hasQuickBarIndexSaved)
8604 {
8605 int itmQBIndex;
8606
8607
8608 if (!ctx.
Read(itmQBIndex))
8609 {
8611 return false;
8612 }
8613
8614 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8615 if (itmQBIndex != -1 && parentPlayer)
8616 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8617 }
8618 }
8619 else
8620 {
8621
8622 PlayerBase player;
8623 int itemQBIndex;
8624 if (version ==
int.
MAX)
8625 {
8626 if (!ctx.
Read(itemQBIndex))
8627 {
8629 return false;
8630 }
8631 }
8632 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8633 {
8634
8635 if (!ctx.
Read(itemQBIndex))
8636 {
8638 return false;
8639 }
8640 if (itemQBIndex != -1 && player)
8641 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8642 }
8643 }
8644
8645 if (version < 140)
8646 {
8647
8648 if (!LoadVariables(ctx, version))
8649 {
8651 return false;
8652 }
8653 }
8654
8655
8657 {
8659 return false;
8660 }
8661 if (version >= 132)
8662 {
8664 if (raib)
8665 {
8667 {
8669 return false;
8670 }
8671 }
8672 }
8673
8675 return true;
8676 }
8677
8678
8679
8681 {
8682 super.OnStoreSave(ctx);
8683
8684 PlayerBase player;
8685 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8686 {
8688
8689 int itemQBIndex = -1;
8690 itemQBIndex = player.FindQuickBarEntityIndex(this);
8691 ctx.
Write(itemQBIndex);
8692 }
8693 else
8694 {
8696 }
8697
8699
8701 if (raib)
8702 {
8704 }
8705 }
8706
8707
8709 {
8710 super.AfterStoreLoad();
8711
8713 {
8715 }
8716
8718 {
8721 }
8722 }
8723
8725 {
8726 super.EEOnAfterLoad();
8727
8729 {
8731 }
8732
8735 }
8736
8738 {
8739 return false;
8740 }
8741
8742
8743
8745 {
8747 {
8748 #ifdef PLATFORM_CONSOLE
8749
8751 {
8753 if (menu)
8754 {
8756 }
8757 }
8758 #endif
8759 }
8760
8762 {
8765 }
8766
8768 {
8769 SetWeightDirty();
8771 }
8773 {
8776 }
8777
8779 {
8782 }
8784 {
8787 }
8788
8789 super.OnVariablesSynchronized();
8790 }
8791
8792
8793
8795 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8796 {
8797 if (!IsServerCheck(allow_client))
8798 return false;
8799
8801 return false;
8802
8805
8806 if (value <= (min + 0.001))
8807 value = min;
8808
8809 if (value == min)
8810 {
8811 if (destroy_config)
8812 {
8813 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8814 if (dstr)
8815 {
8817 this.Delete();
8818 return true;
8819 }
8820 }
8821 else if (destroy_forced)
8822 {
8824 this.Delete();
8825 return true;
8826 }
8827
8829 }
8830
8833
8835 {
8837
8838 if (delta)
8840 }
8841
8843
8844 return false;
8845 }
8846
8847
8849 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8850 {
8852 }
8853
8855 {
8858 }
8859
8861 {
8864 }
8865
8868 {
8869 float value_clamped = Math.Clamp(value, 0, 1);
8871 SetQuantity(result, destroy_config, destroy_forced);
8872 }
8873
8874
8877 {
8879 }
8880
8882 {
8884 }
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8896 {
8897 int slot = -1;
8898 if (GetInventory())
8899 {
8900 InventoryLocation il = new InventoryLocation;
8901 GetInventory().GetCurrentInventoryLocation(il);
8903 }
8904
8906 }
8907
8909 {
8910 float quantity_max = 0;
8911
8913 {
8914 if (attSlotID != -1)
8915 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8916
8917 if (quantity_max <= 0)
8919 }
8920
8921 if (quantity_max <= 0)
8923
8924 return quantity_max;
8925 }
8926
8928 {
8930 }
8931
8933 {
8935 }
8936
8937
8939 {
8941 }
8942
8944 {
8946 }
8947
8949 {
8951 }
8952
8953
8955 {
8956
8957 float weightEx = GetWeightEx();
8958 float special = GetInventoryAndCargoWeight();
8959 return weightEx - special;
8960 }
8961
8962
8964 {
8966 }
8967
8969 {
8971 {
8972 #ifdef DEVELOPER
8973 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8974 {
8975 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
8977 }
8978 #endif
8979
8981 }
8982 else if (HasEnergyManager())
8983 {
8984 #ifdef DEVELOPER
8985 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8986 {
8987 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
8988 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
8989 }
8990 #endif
8991 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
8992 }
8993 else
8994 {
8995 #ifdef DEVELOPER
8996 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
8997 {
8998 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
8999 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9000 }
9001 #endif
9002 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9003 }
9004 }
9005
9008 {
9009 int item_count = 0;
9011
9012 if (GetInventory().GetCargo() != NULL)
9013 {
9014 item_count = GetInventory().GetCargo().GetItemCount();
9015 }
9016
9017 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9018 {
9019 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9020 if (item)
9021 item_count += item.GetNumberOfItems();
9022 }
9023 return item_count;
9024 }
9025
9028 {
9029 float weight = 0;
9030 float wetness = 1;
9031 if (include_wetness)
9034 {
9035 weight = wetness * m_ConfigWeight;
9036 }
9038 {
9039 weight = 1;
9040 }
9041 return weight;
9042 }
9043
9044
9045
9047 {
9048 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9049 {
9050 GameInventory inv = GetInventory();
9051 array<EntityAI> items = new array<EntityAI>;
9053 for (int i = 0; i < items.Count(); i++)
9054 {
9056 if (item)
9057 {
9059 }
9060 }
9061 }
9062 }
9063
9064
9065
9066
9068 {
9069 float energy = 0;
9070 if (HasEnergyManager())
9071 {
9072 energy = GetCompEM().GetEnergy();
9073 }
9074 return energy;
9075 }
9076
9077
9079 {
9080 super.OnEnergyConsumed();
9081
9083 }
9084
9086 {
9087 super.OnEnergyAdded();
9088
9090 }
9091
9092
9094 {
9095 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9096 {
9098 {
9099 float energy_0to1 = GetCompEM().GetEnergy0To1();
9101 }
9102 }
9103 }
9104
9105
9107 {
9108 return ConfigGetFloat("heatIsolation");
9109 }
9110
9112 {
9114 }
9115
9117 {
9118 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9119 if (
GetGame().ConfigIsExisting(paramPath))
9121
9122 return 0.0;
9123 }
9124
9126 {
9127 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9128 if (
GetGame().ConfigIsExisting(paramPath))
9130
9131 return 0.0;
9132 }
9133
9134 override void SetWet(
float value,
bool allow_client =
false)
9135 {
9136 if (!IsServerCheck(allow_client))
9137 return;
9138
9141
9143
9144 m_VarWet = Math.Clamp(value, min, max);
9145
9147 {
9150 }
9151 }
9152
9153 override void AddWet(
float value)
9154 {
9156 }
9157
9159 {
9161 }
9162
9164 {
9166 }
9167
9169 {
9171 }
9172
9174 {
9176 }
9177
9179 {
9181 }
9182
9184 {
9187 if (newLevel != oldLevel)
9188 {
9190 }
9191 }
9192
9194 {
9195 SetWeightDirty();
9196 }
9197
9199 {
9200 return GetWetLevelInternal(
m_VarWet);
9201 }
9202
9203
9204
9206 {
9208 }
9209
9211 {
9213 }
9214
9216 {
9218 }
9219
9221 {
9223 }
9224
9225
9226
9228 {
9229 if (ConfigIsExisting("itemModelLength"))
9230 {
9231 return ConfigGetFloat("itemModelLength");
9232 }
9233 return 0;
9234 }
9235
9237 {
9238 if (ConfigIsExisting("itemAttachOffset"))
9239 {
9240 return ConfigGetFloat("itemAttachOffset");
9241 }
9242 return 0;
9243 }
9244
9245 override void SetCleanness(
int value,
bool allow_client =
false)
9246 {
9247 if (!IsServerCheck(allow_client))
9248 return;
9249
9251
9253
9256 }
9257
9259 {
9261 }
9262
9264 {
9265 return true;
9266 }
9267
9268
9269
9270
9272 {
9274 }
9275
9277 {
9279 }
9280
9281
9282
9283
9284 override void SetColor(
int r,
int g,
int b,
int a)
9285 {
9291 }
9293 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9294 {
9299 }
9300
9302 {
9304 }
9305
9308 {
9309 int r,g,b,a;
9311 r = r/255;
9312 g = g/255;
9313 b = b/255;
9314 a = a/255;
9315 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9316 }
9317
9318
9319
9320 override void SetLiquidType(
int value,
bool allow_client =
false)
9321 {
9322 if (!IsServerCheck(allow_client))
9323 return;
9324
9329 }
9330
9332 {
9333 return ConfigGetInt("varLiquidTypeInit");
9334 }
9335
9337 {
9339 }
9340
9342 {
9344 SetFrozen(false);
9345 }
9346
9349 {
9350 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9351 }
9352
9353
9356 {
9357 PlayerBase nplayer;
9358 if (PlayerBase.CastTo(nplayer, player))
9359 {
9361
9362 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9363 }
9364 }
9365
9366
9369 {
9370 PlayerBase nplayer;
9371 if (PlayerBase.CastTo(nplayer,player))
9372 {
9373
9374 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9375
9376 }
9377
9378
9379 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9380
9381
9382 if (HasEnergyManager())
9383 {
9384 GetCompEM().UpdatePlugState();
9385 }
9386 }
9387
9388
9390 {
9391 super.OnPlacementStarted(player);
9392
9394 }
9395
9396 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9397 {
9399 {
9400 m_AdminLog.OnPlacementComplete(player,
this);
9401 }
9402
9403 super.OnPlacementComplete(player, position, orientation);
9404 }
9405
9406
9407
9408
9409
9411 {
9413 {
9414 return true;
9415 }
9416 else
9417 {
9418 return false;
9419 }
9420 }
9421
9422
9424 {
9426 {
9428 }
9429 }
9430
9431
9433 {
9435 }
9436
9438 {
9440 }
9441
9442 override void InsertAgent(
int agent,
float count = 1)
9443 {
9444 if (count < 1)
9445 return;
9446
9448 }
9449
9452 {
9454 }
9455
9456
9458 {
9460 }
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9504 {
9506 return false;
9507 return true;
9508 }
9509
9511 {
9512
9514 }
9515
9516
9519 {
9520 super.CheckForRoofLimited(timeTresholdMS);
9521
9523 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9524 {
9525 m_PreviousRoofTestTime = time;
9526 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9527 }
9528 }
9529
9530
9532 {
9534 {
9535 return 0;
9536 }
9537
9538 if (GetInventory().GetAttachmentSlotsCount() != 0)
9539 {
9540 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9541 if (filter)
9542 return filter.GetProtectionLevel(type, false, system);
9543 else
9544 return 0;
9545 }
9546
9547 string subclassPath, entryName;
9548
9549 switch (type)
9550 {
9552 entryName = "biological";
9553 break;
9555 entryName = "chemical";
9556 break;
9557 default:
9558 entryName = "biological";
9559 break;
9560 }
9561
9562 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9563
9565 }
9566
9567
9568
9571 {
9572 if (!IsMagazine())
9574
9576 }
9577
9578
9579
9580
9581
9586 {
9587 return true;
9588 }
9589
9591 {
9593 }
9594
9595
9596
9597
9598
9600 {
9601 if (parent)
9602 {
9603 if (parent.IsInherited(DayZInfected))
9604 return true;
9605
9606 if (!parent.IsRuined())
9607 return true;
9608 }
9609
9610 return true;
9611 }
9612
9614 {
9615 if (!super.CanPutAsAttachment(parent))
9616 {
9617 return false;
9618 }
9619
9620 if (!IsRuined() && !parent.IsRuined())
9621 {
9622 return true;
9623 }
9624
9625 return false;
9626 }
9627
9629 {
9630
9631
9632
9633
9634 return super.CanReceiveItemIntoCargo(item);
9635 }
9636
9638 {
9639
9640
9641
9642
9643 GameInventory attachmentInv = attachment.GetInventory();
9645 {
9646 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9647 return false;
9648 }
9649
9650 InventoryLocation loc = new InventoryLocation();
9651 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9652 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9653 return false;
9654
9655 return super.CanReceiveAttachment(attachment, slotId);
9656 }
9657
9659 {
9660 if (!super.CanReleaseAttachment(attachment))
9661 return false;
9662
9663 return GetInventory().AreChildrenAccessible();
9664 }
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9687 {
9688 int id = muzzle_owner.GetMuzzleID();
9689 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9690
9691 if (WPOF_array)
9692 {
9693 for (int i = 0; i < WPOF_array.Count(); i++)
9694 {
9695 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9696
9697 if (WPOF)
9698 {
9699 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9700 }
9701 }
9702 }
9703 }
9704
9705
9707 {
9708 int id = muzzle_owner.GetMuzzleID();
9710
9711 if (WPOBE_array)
9712 {
9713 for (int i = 0; i < WPOBE_array.Count(); i++)
9714 {
9715 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9716
9717 if (WPOBE)
9718 {
9719 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9720 }
9721 }
9722 }
9723 }
9724
9725
9727 {
9728 int id = muzzle_owner.GetMuzzleID();
9729 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9730
9731 if (WPOOH_array)
9732 {
9733 for (int i = 0; i < WPOOH_array.Count(); i++)
9734 {
9735 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9736
9737 if (WPOOH)
9738 {
9739 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9740 }
9741 }
9742 }
9743 }
9744
9745
9747 {
9748 int id = muzzle_owner.GetMuzzleID();
9749 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9750
9751 if (WPOOH_array)
9752 {
9753 for (int i = 0; i < WPOOH_array.Count(); i++)
9754 {
9755 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9756
9757 if (WPOOH)
9758 {
9759 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9760 }
9761 }
9762 }
9763 }
9764
9765
9767 {
9768 int id = muzzle_owner.GetMuzzleID();
9769 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9770
9771 if (WPOOH_array)
9772 {
9773 for (int i = 0; i < WPOOH_array.Count(); i++)
9774 {
9775 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9776
9777 if (WPOOH)
9778 {
9779 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9780 }
9781 }
9782 }
9783 }
9784
9785
9786
9788 {
9790 {
9791 return true;
9792 }
9793
9794 return false;
9795 }
9796
9798 {
9800 {
9801 return true;
9802 }
9803
9804 return false;
9805 }
9806
9808 {
9810 {
9811 return true;
9812 }
9813
9814 return false;
9815 }
9816
9818 {
9819 return false;
9820 }
9821
9824 {
9825 return UATimeSpent.DEFAULT_DEPLOY;
9826 }
9827
9828
9829
9830
9832 {
9834 SetSynchDirty();
9835 }
9836
9838 {
9840 }
9841
9842
9844 {
9845 return false;
9846 }
9847
9850 {
9851 string att_type = "None";
9852
9853 if (ConfigIsExisting("soundAttType"))
9854 {
9855 att_type = ConfigGetString("soundAttType");
9856 }
9857
9859 }
9860
9862 {
9864 }
9865
9866
9867
9868
9869
9873
9875 {
9878
9880 }
9881
9882
9884 {
9886 return;
9887
9889
9892
9895
9896 SoundParameters params = new SoundParameters();
9900 }
9901
9902
9904 {
9906 return;
9907
9909 SetSynchDirty();
9910
9913 }
9914
9915
9917 {
9919 return;
9920
9922 SetSynchDirty();
9923
9926 }
9927
9929 {
9931 }
9932
9934 {
9936 }
9937
9940 {
9941 if (!
GetGame().IsDedicatedServer())
9942 {
9943 if (ConfigIsExisting("attachSoundSet"))
9944 {
9945 string cfg_path = "";
9946 string soundset = "";
9948
9951 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
9952 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
9953
9954 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
9955 {
9956 for (int i = 0; i < cfg_soundset_array.Count(); i++)
9957 {
9958 if (cfg_slot_array[i] == slot_type)
9959 {
9960 soundset = cfg_soundset_array[i];
9961 break;
9962 }
9963 }
9964 }
9965
9966 if (soundset != "")
9967 {
9968 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
9970 }
9971 }
9972 }
9973 }
9974
9976 {
9977
9978 }
9979
9980 void OnApply(PlayerBase player);
9981
9983 {
9984 return 1.0;
9985 };
9986
9988 {
9990 }
9991
9993 {
9995 }
9996
9998
10000 {
10001 SetDynamicPhysicsLifeTime(0.01);
10003 }
10004
10006 {
10007 array<string> zone_names = new array<string>;
10008 GetDamageZones(zone_names);
10009 for (int i = 0; i < zone_names.Count(); i++)
10010 {
10011 SetHealthMax(zone_names.Get(i),"Health");
10012 }
10013 SetHealthMax("","Health");
10014 }
10015
10018 {
10019 float global_health = GetHealth01("","Health");
10020 array<string> zones = new array<string>;
10021 GetDamageZones(zones);
10022
10023 for (int i = 0; i < zones.Count(); i++)
10024 {
10025 SetHealth01(zones.Get(i),"Health",global_health);
10026 }
10027 }
10028
10031 {
10032 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10033 }
10034
10036 {
10037 if (!hasRootAsPlayer)
10038 {
10039 if (refParentIB)
10040 {
10041
10042 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10043 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10044
10045 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10046 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10047
10050 }
10051 else
10052 {
10053
10056 }
10057 }
10058 }
10059
10061 {
10063 {
10064 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10065 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10066 {
10067 float heatPermCoef = 1.0;
10069 while (ent)
10070 {
10071 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10072 ent = ent.GetHierarchyParent();
10073 }
10074
10075 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10076 }
10077 }
10078 }
10079
10081 {
10082
10083 EntityAI parent = GetHierarchyParent();
10084 if (!parent)
10085 {
10086 hasParent = false;
10087 hasRootAsPlayer = false;
10088 }
10089 else
10090 {
10091 hasParent = true;
10092 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10093 refParentIB =
ItemBase.Cast(parent);
10094 }
10095 }
10096
10097 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10098 {
10099
10100 }
10101
10103 {
10104
10105 return false;
10106 }
10107
10109 {
10110
10111
10112 return false;
10113 }
10114
10116 {
10117
10118 return false;
10119 }
10120
10123 {
10124 return !GetIsFrozen() &&
IsOpen();
10125 }
10126
10128 {
10129 bool hasParent = false, hasRootAsPlayer = false;
10131
10132 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10133 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10134
10135 if (wwtu || foodDecay)
10136 {
10140
10141 if (processWetness || processTemperature || processDecay)
10142 {
10144
10145 if (processWetness)
10146 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10147
10148 if (processTemperature)
10150
10151 if (processDecay)
10152 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10153 }
10154 }
10155 }
10156
10159 {
10161 }
10162
10164 {
10167
10168 return super.GetTemperatureFreezeThreshold();
10169 }
10170
10172 {
10175
10176 return super.GetTemperatureThawThreshold();
10177 }
10178
10180 {
10183
10184 return super.GetItemOverheatThreshold();
10185 }
10186
10188 {
10190 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10191
10192 return super.GetTemperatureFreezeTime();
10193 }
10194
10196 {
10198 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10199
10200 return super.GetTemperatureThawTime();
10201 }
10202
10207
10209 {
10210 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10211 }
10212
10214 {
10215 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10216 }
10217
10220 {
10222 }
10223
10225 {
10227 }
10228
10230 {
10232 }
10233
10236 {
10237 return null;
10238 }
10239
10242 {
10243 return false;
10244 }
10245
10247 {
10249 {
10252 if (!trg)
10253 {
10255 explosive = this;
10256 }
10257
10258 explosive.PairRemote(trg);
10260
10261 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10262 trg.SetPersistentPairID(persistentID);
10263 explosive.SetPersistentPairID(persistentID);
10264
10265 return true;
10266 }
10267 return false;
10268 }
10269
10272 {
10273 float ret = 1.0;
10276 ret *= GetHealth01();
10277
10278 return ret;
10279 }
10280
10281 #ifdef DEVELOPER
10282 override void SetDebugItem()
10283 {
10284 super.SetDebugItem();
10285 _itemBase = this;
10286 }
10287
10289 {
10290 string text = super.GetDebugText();
10291
10293 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10294
10295 return text;
10296 }
10297 #endif
10298
10300 {
10301 return true;
10302 }
10303
10305
10307
10309 {
10312 }
10313
10314
10322
10338}
10339
10341{
10343 if (entity)
10344 {
10345 bool is_item = entity.IsInherited(
ItemBase);
10346 if (is_item && full_quantity)
10347 {
10350 }
10351 }
10352 else
10353 {
10355 return NULL;
10356 }
10357 return entity;
10358}
10359
10361{
10362 if (item)
10363 {
10364 if (health > 0)
10365 item.SetHealth("", "", health);
10366
10367 if (item.CanHaveTemperature())
10368 {
10370 if (item.CanFreeze())
10371 item.SetFrozen(false);
10372 }
10373
10374 if (item.HasEnergyManager())
10375 {
10376 if (quantity >= 0)
10377 {
10378 item.GetCompEM().SetEnergy0To1(quantity);
10379 }
10380 else
10381 {
10383 }
10384 }
10385 else if (item.IsMagazine())
10386 {
10387 Magazine mag = Magazine.Cast(item);
10388 if (quantity >= 0)
10389 {
10390 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10391 }
10392 else
10393 {
10395 }
10396
10397 }
10398 else
10399 {
10400 if (quantity >= 0)
10401 {
10402 item.SetQuantityNormalized(quantity, false);
10403 }
10404 else
10405 {
10407 }
10408
10409 }
10410 }
10411}
10412
10413#ifdef DEVELOPER
10415#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.