5538{
5540 {
5541 return true;
5542 }
5543};
5544
5545
5546
5548{
5552
5554
5557
5558
5559
5560
5561
5570
5576
5581
5586
5607 protected bool m_IsResultOfSplit
5608
5610
5615
5616
5617
5619
5623
5624
5625
5627
5630
5631
5632
5638
5639
5647
5650
5651
5653
5654
5656
5657
5662
5663
5668
5669
5671
5672
5674 {
5679
5680 if (!
GetGame().IsDedicatedServer())
5681 {
5683 {
5685
5687 {
5689 }
5690 }
5691
5694 }
5695
5696 m_OldLocation = null;
5697
5699 {
5701 }
5702
5703 if (ConfigIsExisting("headSelectionsToHide"))
5704 {
5707 }
5708
5710 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5711 {
5713 }
5714
5716
5717 m_IsResultOfSplit = false;
5718
5720 }
5721
5723 {
5724 super.InitItemVariables();
5725
5731 m_Count = ConfigGetInt(
"count");
5732
5735
5740
5743
5748
5760
5764
5765
5768 if (ConfigIsExisting("canBeSplit"))
5769 {
5772 }
5773
5775 if (ConfigIsExisting("itemBehaviour"))
5777
5778
5781 RegisterNetSyncVariableInt("m_VarLiquidType");
5782 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5783
5784 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5785 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5786 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5787
5788 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5789 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5790 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5791 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5792
5793 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5794 RegisterNetSyncVariableBool("m_IsTakeable");
5795 RegisterNetSyncVariableBool("m_IsHologram");
5796
5799 {
5802 }
5803
5805
5807 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5809
5810 }
5811
5813 {
5815 }
5816
5818 {
5821 {
5826 }
5827 }
5828
5829 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5830 {
5832 {
5835 }
5836
5838 }
5839
5841 {
5847 }
5848
5850
5852 {
5854
5855 if (!action)
5856 {
5857 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5858 return;
5859 }
5860
5862 if (!ai)
5863 {
5865 return;
5866 }
5867
5869 if (!action_array)
5870 {
5871 action_array = new array<ActionBase_Basic>;
5873 }
5874 if (LogManager.IsActionLogEnable())
5875 {
5876 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5877 }
5878
5879 if (action_array.Find(action) != -1)
5880 {
5881 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5882 }
5883 else
5884 {
5885 action_array.Insert(action);
5886 }
5887 }
5888
5890 {
5892 ActionBase action = player.GetActionManager().GetAction(actionName);
5895
5896 if (action_array)
5897 {
5898 action_array.RemoveItem(action);
5899 }
5900 }
5901
5902
5903
5905 {
5906 ActionOverrideData overrideData = new ActionOverrideData();
5910
5912 if (!actionMap)
5913 {
5916 }
5917
5918 actionMap.Insert(this.
Type(), overrideData);
5919
5920 }
5921
5923
5925
5926
5928 {
5931
5934
5935 string config_to_search = "CfgVehicles";
5936 string muzzle_owner_config;
5937
5939 {
5940 if (IsInherited(Weapon))
5941 config_to_search = "CfgWeapons";
5942
5943 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5944
5945 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
5946
5948
5949 if (config_OnFire_subclass_count > 0)
5950 {
5951 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
5952
5953 for (int i = 0; i < config_OnFire_subclass_count; i++)
5954 {
5955 string particle_class = "";
5957 string config_OnFire_entry = config_OnFire_class + particle_class;
5958 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
5959 WPOF_array.Insert(WPOF);
5960 }
5961
5962
5964 }
5965 }
5966
5968 {
5969 config_to_search = "CfgWeapons";
5970 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
5971
5972 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
5973
5975
5976 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
5977 {
5978 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
5979
5980 for (i = 0; i < config_OnBulletCasingEject_count; i++)
5981 {
5982 string particle_class2 = "";
5984 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
5985 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
5986 WPOBE_array.Insert(WPOBE);
5987 }
5988
5989
5991 }
5992 }
5993 }
5994
5995
5997 {
6000
6002 {
6003 string config_to_search = "CfgVehicles";
6004
6005 if (IsInherited(Weapon))
6006 config_to_search = "CfgWeapons";
6007
6008 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6009 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6010
6011 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6012 {
6013
6015
6017 {
6019 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6021 return;
6022 }
6023
6026
6027
6028
6030 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6031
6032 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6033 {
6034 string particle_class = "";
6036 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6038
6039 if (entry_type == CT_CLASS)
6040 {
6041 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6042 WPOOH_array.Insert(WPOF);
6043 }
6044 }
6045
6046
6048 }
6049 }
6050 }
6051
6053 {
6055 }
6056
6058 {
6060 {
6062
6065
6068
6069 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6070 }
6071 }
6072
6074 {
6076 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6077
6079 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6080
6082 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6083
6085 {
6087 }
6088 }
6089
6091 {
6093 }
6094
6096 {
6099 else
6101
6103 {
6106 }
6107 else
6108 {
6111
6114 }
6115
6117 }
6118
6120 {
6122 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6123 }
6124
6126 {
6128 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6130 }
6131
6133 {
6135 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6136 }
6137
6139 {
6142
6143 OverheatingParticle OP = new OverheatingParticle();
6148
6150 }
6151
6153 {
6156
6157 return -1;
6158 }
6159
6161 {
6163 {
6166
6167 for (int i = count; i > 0; --i)
6168 {
6169 int id = i - 1;
6172
6175
6176 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6177 {
6178 if (p)
6179 {
6182 }
6183 }
6184 }
6185 }
6186 }
6187
6189 {
6191 {
6193 {
6194 int id = i - 1;
6196
6197 if (OP)
6198 {
6200
6201 if (p)
6202 {
6204 }
6205
6206 delete OP;
6207 }
6208 }
6209
6212 }
6213 }
6214
6217 {
6218 return 0.0;
6219 }
6220
6221
6223 {
6224 return 250;
6225 }
6226
6228 {
6229 return 0;
6230 }
6231
6234 {
6236 return true;
6237
6238 return false;
6239 }
6240
6243 {
6246
6248 {
6250 }
6251 else
6252 {
6253
6255 }
6256
6258 }
6259
6266 {
6267 return -1;
6268 }
6269
6270
6271
6272
6274 {
6276 {
6278 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6279
6280 if (r_index >= 0)
6281 {
6282 InventoryLocation r_il = new InventoryLocation;
6283 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6284
6285 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6288 {
6289 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6290 }
6292 {
6293 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6294 }
6295
6296 }
6297
6298 player.GetHumanInventory().ClearUserReservedLocation(this);
6299 }
6300
6303 }
6304
6305
6306
6307
6309 {
6310 return ItemBase.m_DebugActionsMask;
6311 }
6312
6314 {
6315 return ItemBase.m_DebugActionsMask & mask;
6316 }
6317
6319 {
6320 ItemBase.m_DebugActionsMask = mask;
6321 }
6322
6324 {
6325 ItemBase.m_DebugActionsMask |= mask;
6326 }
6327
6329 {
6330 ItemBase.m_DebugActionsMask &= ~mask;
6331 }
6332
6334 {
6336 {
6338 }
6339 else
6340 {
6342 }
6343 }
6344
6345
6347 {
6348 if (GetEconomyProfile())
6349 {
6350 float q_max = GetEconomyProfile().GetQuantityMax();
6351 if (q_max > 0)
6352 {
6353 float q_min = GetEconomyProfile().GetQuantityMin();
6354 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6355
6357 {
6358 ComponentEnergyManager comp = GetCompEM();
6360 {
6362 }
6363 }
6365 {
6367
6368 }
6369
6370 }
6371 }
6372 }
6373
6376 {
6377 EntityAI parent = GetHierarchyParent();
6378
6379 if (parent)
6380 {
6381 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6382 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6383 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6384 }
6385 }
6386
6389 {
6390 EntityAI parent = GetHierarchyParent();
6391
6392 if (parent)
6393 {
6394 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6395 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6396 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6397 }
6398 }
6399
6401 {
6402
6403
6404
6405
6407
6409 {
6410 if (ScriptInputUserData.CanStoreInputUserData())
6411 {
6412 ScriptInputUserData ctx = new ScriptInputUserData;
6418 ctx.
Write(use_stack_max);
6421
6423 {
6424 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6425 }
6426 }
6427 }
6428 else if (!
GetGame().IsMultiplayer())
6429 {
6431 }
6432 }
6433
6435 {
6437 }
6438
6440 {
6442 }
6443
6445 {
6447 }
6448
6450 {
6451
6452 return false;
6453 }
6454
6456 {
6457 return false;
6458 }
6459
6463 {
6464 return false;
6465 }
6466
6468 {
6469 return "";
6470 }
6471
6473
6475 {
6476 return false;
6477 }
6478
6480 {
6481 return true;
6482 }
6483
6484
6485
6487 {
6488 return true;
6489 }
6490
6492 {
6493 return true;
6494 }
6495
6497 {
6498 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6500 }
6501
6503 {
6505 }
6506
6508 {
6510 if (!is_being_placed)
6512 SetSynchDirty();
6513 }
6514
6515
6517
6519 {
6521 }
6522
6524 {
6526 }
6527
6529 {
6530 return 1;
6531 }
6532
6534 {
6535 return false;
6536 }
6537
6539 {
6541 SetSynchDirty();
6542 }
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6579 {
6580 super.OnMovedInsideCargo(container);
6581
6582 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6583 }
6584
6585 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6586 {
6587 super.EEItemLocationChanged(oldLoc,newLoc);
6588
6589 PlayerBase new_player = null;
6590 PlayerBase old_player = null;
6591
6592 if (newLoc.GetParent())
6593 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6594
6595 if (oldLoc.GetParent())
6596 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6597
6599 {
6600 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6601
6602 if (r_index >= 0)
6603 {
6604 InventoryLocation r_il = new InventoryLocation;
6605 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6606
6607 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6610 {
6611 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6612 }
6614 {
6615 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6616 }
6617
6618 }
6619 }
6620
6622 {
6623 if (new_player)
6624 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6625
6626 if (new_player == old_player)
6627 {
6628
6629 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6630 {
6632 {
6633 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6634 {
6635 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6636 }
6637 }
6638 else
6639 {
6640 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6641 }
6642 }
6643
6644 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6645 {
6646 int type = oldLoc.GetType();
6648 {
6649 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6650 }
6652 {
6653 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6654 }
6655 }
6656 if (!m_OldLocation)
6657 {
6658 m_OldLocation = new InventoryLocation;
6659 }
6660 m_OldLocation.Copy(oldLoc);
6661 }
6662 else
6663 {
6664 if (m_OldLocation)
6665 {
6666 m_OldLocation.Reset();
6667 }
6668 }
6669
6671 }
6672 else
6673 {
6674 if (new_player)
6675 {
6676 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6677 if (res_index >= 0)
6678 {
6679 InventoryLocation il = new InventoryLocation;
6680 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6682 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6685 {
6686 il.
GetParent().GetOnReleaseLock().Invoke(it);
6687 }
6689 {
6691 }
6692
6693 }
6694 }
6696 {
6697
6699 }
6700
6701 if (m_OldLocation)
6702 {
6703 m_OldLocation.Reset();
6704 }
6705 }
6706 }
6707
6708 override void EOnContact(IEntity other, Contact extra)
6709 {
6711 {
6712 int liquidType = -1;
6714 if (impactSpeed > 0.0)
6715 {
6717 #ifndef SERVER
6719 #else
6721 SetSynchDirty();
6722 #endif
6724 }
6725 }
6726
6727 #ifdef SERVER
6728 if (GetCompEM() && GetCompEM().IsPlugged())
6729 {
6730 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6731 GetCompEM().UnplugThis();
6732 }
6733 #endif
6734 }
6735
6737
6739 {
6741 }
6742
6744 {
6745
6746 }
6747
6749 {
6750 super.OnItemLocationChanged(old_owner, new_owner);
6751
6752 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6753 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6754
6755 if (!relatedPlayer && playerNew)
6756 relatedPlayer = playerNew;
6757
6758 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6759 {
6761 if (actionMgr)
6762 {
6763 ActionBase currentAction = actionMgr.GetRunningAction();
6764 if (currentAction)
6766 }
6767 }
6768
6769 Man ownerPlayerOld = null;
6770 Man ownerPlayerNew = null;
6771
6772 if (old_owner)
6773 {
6774 if (old_owner.
IsMan())
6775 {
6776 ownerPlayerOld = Man.Cast(old_owner);
6777 }
6778 else
6779 {
6780 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6781 }
6782 }
6783 else
6784 {
6786 {
6788
6789 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6790 {
6791 GetCompEM().UnplugThis();
6792 }
6793 }
6794 }
6795
6796 if (new_owner)
6797 {
6798 if (new_owner.
IsMan())
6799 {
6800 ownerPlayerNew = Man.Cast(new_owner);
6801 }
6802 else
6803 {
6804 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6805 }
6806 }
6807
6808 if (ownerPlayerOld != ownerPlayerNew)
6809 {
6810 if (ownerPlayerOld)
6811 {
6812 array<EntityAI> subItemsExit = new array<EntityAI>;
6814 for (int i = 0; i < subItemsExit.Count(); i++)
6815 {
6818 }
6819 }
6820
6821 if (ownerPlayerNew)
6822 {
6823 array<EntityAI> subItemsEnter = new array<EntityAI>;
6825 for (int j = 0; j < subItemsEnter.Count(); j++)
6826 {
6829 }
6830 }
6831 }
6832 else if (ownerPlayerNew != null)
6833 {
6834 PlayerBase nplayer;
6835 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6836 {
6837 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6839 for (int k = 0; k < subItemsUpdate.Count(); k++)
6840 {
6842 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6843 }
6844 }
6845 }
6846
6847 if (old_owner)
6848 old_owner.OnChildItemRemoved(this);
6849 if (new_owner)
6850 new_owner.OnChildItemReceived(this);
6851 }
6852
6853
6855 {
6856 super.EEDelete(parent);
6857 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6858 if (player)
6859 {
6861
6862 if (player.IsAlive())
6863 {
6864 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6865 if (r_index >= 0)
6866 {
6867 InventoryLocation r_il = new InventoryLocation;
6868 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6869
6870 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6873 {
6874 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6875 }
6877 {
6878 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6879 }
6880
6881 }
6882
6883 player.RemoveQuickBarEntityShortcut(this);
6884 }
6885 }
6886 }
6887
6889 {
6890 super.EEKilled(killer);
6891
6894 {
6895 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6896 {
6897 if (IsMagazine())
6898 {
6899 if (Magazine.Cast(this).GetAmmoCount() > 0)
6900 {
6902 }
6903 }
6904 else
6905 {
6907 }
6908 }
6909 }
6910 }
6911
6913 {
6914 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6915
6916 super.OnWasAttached(parent, slot_id);
6917
6920
6922 }
6923
6925 {
6926 super.OnWasDetached(parent, slot_id);
6927
6930 }
6931
6933 {
6934 int idx;
6937
6938 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6939 if (inventory_slots.Count() < 1)
6940 {
6941 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
6942 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
6943 }
6944 else
6945 {
6946 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
6947 }
6948
6949 idx = inventory_slots.Find(slot);
6950 if (idx < 0)
6951 return "";
6952
6953 return attach_types.Get(idx);
6954 }
6955
6957 {
6958 int idx = -1;
6959 string slot;
6960
6963
6964 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
6965 if (inventory_slots.Count() < 1)
6966 {
6967 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
6968 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6969 }
6970 else
6971 {
6972 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
6973 if (detach_types.Count() < 1)
6974 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
6975 }
6976
6977 for (int i = 0; i < inventory_slots.Count(); i++)
6978 {
6979 slot = inventory_slots.Get(i);
6980 }
6981
6982 if (slot != "")
6983 {
6984 if (detach_types.Count() == 1)
6985 idx = 0;
6986 else
6987 idx = inventory_slots.Find(slot);
6988 }
6989 if (idx < 0)
6990 return "";
6991
6992 return detach_types.Get(idx);
6993 }
6994
6996 {
6997
6999
7000
7001 float min_time = 1;
7002 float max_time = 3;
7003 float delay = Math.RandomFloat(min_time, max_time);
7004
7005 explode_timer.Run(delay, this, "DoAmmoExplosion");
7006 }
7007
7009 {
7010 Magazine magazine = Magazine.Cast(this);
7011 int pop_sounds_count = 6;
7012 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7013
7014
7015 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7016 string sound_name = pop_sounds[ sound_idx ];
7018
7019
7020 magazine.ServerAddAmmoCount(-1);
7021
7022
7023 float min_temp_to_explode = 100;
7024
7025 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
7026 {
7028 }
7029 }
7030
7031
7032 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7033 {
7034 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7035
7036 const int CHANCE_DAMAGE_CARGO = 4;
7037 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7038 const int CHANCE_DAMAGE_NOTHING = 2;
7039
7041 {
7042 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7043 int chances;
7044 int rnd;
7045
7046 if (GetInventory().GetCargo())
7047 {
7048 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7049 rnd = Math.RandomInt(0,chances);
7050
7051 if (rnd < CHANCE_DAMAGE_CARGO)
7052 {
7054 }
7055 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7056 {
7058 }
7059 }
7060 else
7061 {
7062 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7063 rnd = Math.RandomInt(0,chances);
7064
7065 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7066 {
7068 }
7069 }
7070 }
7071 }
7072
7074 {
7075 if (GetInventory().GetCargo())
7076 {
7077 int item_count = GetInventory().GetCargo().GetItemCount();
7078 if (item_count > 0)
7079 {
7080 int random_pick = Math.RandomInt(0, item_count);
7082 if (!item.IsExplosive())
7083 {
7084 item.AddHealth("","",damage);
7085 return true;
7086 }
7087 }
7088 }
7089 return false;
7090 }
7091
7093 {
7094 int attachment_count = GetInventory().AttachmentCount();
7095 if (attachment_count > 0)
7096 {
7097 int random_pick = Math.RandomInt(0, attachment_count);
7098 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7099 if (!attachment.IsExplosive())
7100 {
7101 attachment.AddHealth("","",damage);
7102 return true;
7103 }
7104 }
7105 return false;
7106 }
7107
7109 {
7111 }
7112
7114 {
7116 return GetInventory().CanRemoveEntity();
7117
7118 return false;
7119 }
7120
7122 {
7123
7125 return false;
7126
7127
7129 return false;
7130
7131
7132
7134 if (delta == 0)
7135 return false;
7136
7137
7138 return true;
7139 }
7140
7142 {
7144 {
7145 if (ScriptInputUserData.CanStoreInputUserData())
7146 {
7147 ScriptInputUserData ctx = new ScriptInputUserData;
7152 ctx.
Write(destination_entity);
7156 }
7157 }
7158 else if (!
GetGame().IsMultiplayer())
7159 {
7161 }
7162 }
7163
7165 {
7166 float split_quantity_new;
7170 InventoryLocation loc = new InventoryLocation;
7171
7172 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7173 {
7175 split_quantity_new = stack_max;
7176 else
7178
7180 {
7181 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7182 if (new_item)
7183 {
7184 new_item.SetResultOfSplit(true);
7185 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7187 new_item.
SetQuantity(split_quantity_new,
false,
true);
7188 }
7189 }
7190 }
7191 else if (destination_entity && slot_id == -1)
7192 {
7193 if (quantity > stack_max)
7194 split_quantity_new = stack_max;
7195 else
7196 split_quantity_new = quantity;
7197
7199 {
7201 {
7204 }
7205
7206 if (new_item)
7207 {
7208 new_item.SetResultOfSplit(true);
7209 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7211 new_item.
SetQuantity(split_quantity_new,
false,
true);
7212 }
7213 }
7214 }
7215 else
7216 {
7217 if (stack_max != 0)
7218 {
7220 {
7222 }
7223
7224 if (split_quantity_new == 0)
7225 {
7226 if (!
GetGame().IsMultiplayer())
7227 player.PhysicalPredictiveDropItem(this);
7228 else
7229 player.ServerDropEntity(this);
7230 return;
7231 }
7232
7234 {
7236
7237 if (new_item)
7238 {
7239 new_item.SetResultOfSplit(true);
7240 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7243 new_item.PlaceOnSurface();
7244 }
7245 }
7246 }
7247 }
7248 }
7249
7251 {
7252 float split_quantity_new;
7256 InventoryLocation loc = new InventoryLocation;
7257
7258 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7259 {
7261 split_quantity_new = stack_max;
7262 else
7264
7266 {
7267 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7268 if (new_item)
7269 {
7270 new_item.SetResultOfSplit(true);
7271 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7273 new_item.
SetQuantity(split_quantity_new,
false,
true);
7274 }
7275 }
7276 }
7277 else if (destination_entity && slot_id == -1)
7278 {
7279 if (quantity > stack_max)
7280 split_quantity_new = stack_max;
7281 else
7282 split_quantity_new = quantity;
7283
7285 {
7287 {
7290 }
7291
7292 if (new_item)
7293 {
7294 new_item.SetResultOfSplit(true);
7295 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7297 new_item.
SetQuantity(split_quantity_new,
false,
true);
7298 }
7299 }
7300 }
7301 else
7302 {
7303 if (stack_max != 0)
7304 {
7306 {
7308 }
7309
7311 {
7313
7314 if (new_item)
7315 {
7316 new_item.SetResultOfSplit(true);
7317 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7320 new_item.PlaceOnSurface();
7321 }
7322 }
7323 }
7324 }
7325 }
7326
7328 {
7330 {
7331 if (ScriptInputUserData.CanStoreInputUserData())
7332 {
7333 ScriptInputUserData ctx = new ScriptInputUserData;
7338 dst.WriteToContext(ctx);
7340 }
7341 }
7342 else if (!
GetGame().IsMultiplayer())
7343 {
7345 }
7346 }
7347
7349 {
7351 {
7352 if (ScriptInputUserData.CanStoreInputUserData())
7353 {
7354 ScriptInputUserData ctx = new ScriptInputUserData;
7359 ctx.
Write(destination_entity);
7365 }
7366 }
7367 else if (!
GetGame().IsMultiplayer())
7368 {
7370 }
7371 }
7372
7374 {
7376 }
7377
7379 {
7381 float split_quantity_new;
7383 if (dst.IsValid())
7384 {
7385 int slot_id = dst.GetSlot();
7387
7388 if (quantity > stack_max)
7389 split_quantity_new = stack_max;
7390 else
7391 split_quantity_new = quantity;
7392
7394 {
7396
7397 if (new_item)
7398 {
7399 new_item.SetResultOfSplit(true);
7400 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7402 new_item.
SetQuantity(split_quantity_new,
false,
true);
7403 }
7404
7405 return new_item;
7406 }
7407 }
7408
7409 return null;
7410 }
7411
7413 {
7415 float split_quantity_new;
7417 if (destination_entity)
7418 {
7420 if (quantity > stackable)
7421 split_quantity_new = stackable;
7422 else
7423 split_quantity_new = quantity;
7424
7426 {
7427 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7428 if (new_item)
7429 {
7430 new_item.SetResultOfSplit(true);
7431 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7433 new_item.
SetQuantity(split_quantity_new,
false,
true);
7434 }
7435 }
7436 }
7437 }
7438
7440 {
7442 {
7443 if (ScriptInputUserData.CanStoreInputUserData())
7444 {
7445 ScriptInputUserData ctx = new ScriptInputUserData;
7450 ItemBase destination_entity =
this;
7451 ctx.
Write(destination_entity);
7455 }
7456 }
7457 else if (!
GetGame().IsMultiplayer())
7458 {
7460 }
7461 }
7462
7464 {
7466 float split_quantity_new;
7468 if (player)
7469 {
7471 if (quantity > stackable)
7472 split_quantity_new = stackable;
7473 else
7474 split_quantity_new = quantity;
7475
7477 {
7478 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7479 new_item =
ItemBase.Cast(in_hands);
7480 if (new_item)
7481 {
7482 new_item.SetResultOfSplit(true);
7483 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7485 new_item.SetQuantity(split_quantity_new, false, true);
7486 }
7487 }
7488 }
7489 }
7490
7492 {
7494 float split_quantity_new = Math.Floor(quantity * 0.5);
7495
7497 return;
7498
7500
7501 if (new_item)
7502 {
7503 if (new_item.GetQuantityMax() < split_quantity_new)
7504 {
7505 split_quantity_new = new_item.GetQuantityMax();
7506 }
7507
7508 new_item.SetResultOfSplit(true);
7509 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7510
7512 {
7515 }
7516 else
7517 {
7519 new_item.
SetQuantity(split_quantity_new,
false,
true);
7520 }
7521 }
7522 }
7523
7525 {
7527 float split_quantity_new = Math.Floor(quantity / 2);
7528
7530 return;
7531
7532 InventoryLocation invloc = new InventoryLocation;
7534
7536 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7537
7538 if (new_item)
7539 {
7540 if (new_item.GetQuantityMax() < split_quantity_new)
7541 {
7542 split_quantity_new = new_item.GetQuantityMax();
7543 }
7545 {
7548 }
7549 else if (split_quantity_new > 1)
7550 {
7552 new_item.
SetQuantity(split_quantity_new,
false,
true);
7553 }
7554 }
7555 }
7556
7559 {
7560 SetWeightDirty();
7562
7563 if (parent)
7564 parent.OnAttachmentQuantityChangedEx(this, delta);
7565
7567 {
7569 {
7571 }
7573 {
7574 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7576 }
7577 }
7578
7579 }
7580
7583 {
7584
7585 }
7586
7589 {
7591 }
7592
7594 {
7595 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7596
7598 {
7599 if (newLevel == GameConstants.STATE_RUINED)
7600 {
7602 EntityAI parent = GetHierarchyParent();
7603 if (parent && parent.IsFireplace())
7604 {
7605 CargoBase cargo = GetInventory().GetCargo();
7606 if (cargo)
7607 {
7609 {
7611 }
7612 }
7613 }
7614 }
7615
7617 {
7618
7620 return;
7621 }
7622
7623 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7624 {
7626 }
7627 }
7628 }
7629
7630
7632 {
7633 super.OnRightClick();
7634
7636 {
7638 {
7639 if (ScriptInputUserData.CanStoreInputUserData())
7640 {
7641 EntityAI root = GetHierarchyRoot();
7642 Man playerOwner = GetHierarchyRootPlayer();
7643 InventoryLocation dst = new InventoryLocation;
7644
7645
7646 if (!playerOwner && root && root == this)
7647 {
7649 }
7650 else
7651 {
7652
7653 GetInventory().GetCurrentInventoryLocation(dst);
7655 {
7658 {
7660 }
7661 else
7662 {
7664
7665
7666 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7667 {
7669 }
7670 else
7671 {
7672 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7673 }
7674 }
7675 }
7676 }
7677
7678 ScriptInputUserData ctx = new ScriptInputUserData;
7686 }
7687 }
7688 else if (!
GetGame().IsMultiplayer())
7689 {
7691 }
7692 }
7693 }
7694
7696 {
7697 if (root)
7698 {
7699 vector m4[4];
7700 root.GetTransform(m4);
7701 dst.SetGround(this, m4);
7702 }
7703 else
7704 {
7705 GetInventory().GetCurrentInventoryLocation(dst);
7706 }
7707 }
7708
7709 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7710 {
7711
7712 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7713 return false;
7714
7715 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7716 return false;
7717
7718
7720 return false;
7721
7722
7723 Magazine mag = Magazine.Cast(this);
7724 if (mag)
7725 {
7726 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7727 return false;
7728
7729 if (stack_max_limit)
7730 {
7731 Magazine other_mag = Magazine.Cast(other_item);
7732 if (other_item)
7733 {
7734 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7735 return false;
7736 }
7737
7738 }
7739 }
7740 else
7741 {
7742
7744 return false;
7745
7747 return false;
7748 }
7749
7750 PlayerBase player = null;
7751 if (CastTo(player, GetHierarchyRootPlayer()))
7752 {
7753 if (player.GetInventory().HasAttachment(this))
7754 return false;
7755
7756 if (player.IsItemsToDelete())
7757 return false;
7758 }
7759
7760 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7761 return false;
7762
7763 int slotID;
7765 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7766 return false;
7767
7768 return true;
7769 }
7770
7772 {
7774 }
7775
7777 {
7778 return m_IsResultOfSplit;
7779 }
7780
7782 {
7783 m_IsResultOfSplit = value;
7784 }
7785
7787 {
7789 }
7790
7792 {
7793 float other_item_quantity = other_item.GetQuantity();
7794 float this_free_space;
7795
7797
7799
7800 if (other_item_quantity > this_free_space)
7801 {
7802 return this_free_space;
7803 }
7804 else
7805 {
7806 return other_item_quantity;
7807 }
7808 }
7809
7811 {
7813 }
7814
7816 {
7818 return;
7819
7820 if (!IsMagazine() && other_item)
7821 {
7823 if (quantity_used != 0)
7824 {
7825 float hp1 = GetHealth01("","");
7826 float hp2 = other_item.GetHealth01("","");
7827 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7828 hpResult = hpResult / (
GetQuantity() + quantity_used);
7829
7830 hpResult *= GetMaxHealth();
7831 Math.Round(hpResult);
7832 SetHealth("", "Health", hpResult);
7833
7835 other_item.AddQuantity(-quantity_used);
7836 }
7837 }
7839 }
7840
7842 {
7843 #ifdef SERVER
7844 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7845 GetHierarchyParent().IncreaseLifetimeUp();
7846 #endif
7847 };
7848
7850 {
7851 PlayerBase p = PlayerBase.Cast(player);
7852
7853 array<int> recipesIds = p.m_Recipes;
7854 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7855 if (moduleRecipesManager)
7856 {
7857 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7858 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7859 }
7860
7861 for (int i = 0;i < recipesIds.Count(); i++)
7862 {
7863 int key = recipesIds.Get(i);
7864 string recipeName = moduleRecipesManager.GetRecipeName(key);
7866 }
7867 }
7868
7869
7870 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7871 {
7872 super.GetDebugActions(outputList);
7873
7874
7880
7881
7886
7891
7892
7896
7897
7899 {
7903 }
7904
7907
7908
7912
7914
7915 InventoryLocation loc = new InventoryLocation();
7916 GetInventory().GetCurrentInventoryLocation(loc);
7918 {
7919 if (Gizmo_IsSupported())
7922 }
7923
7925 }
7926
7927
7928
7929
7931 {
7932 super.OnAction(action_id, player, ctx);
7933
7935 {
7936 switch (action_id)
7937 {
7940 return true;
7943 return true;
7944 }
7945 }
7946
7948 {
7949 switch (action_id)
7950 {
7952 Delete();
7953 return true;
7954 }
7955 }
7956
7957 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
7958 {
7959 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7960 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
7961 PlayerBase p = PlayerBase.Cast(player);
7962 if (
EActions.RECIPES_RANGE_START < 1000)
7963 {
7964 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
7965 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
7966 }
7967 }
7968 #ifndef SERVER
7969 else if (action_id ==
EActions.WATCH_PLAYER)
7970 {
7971 PluginDeveloper.SetDeveloperItemClientEx(player);
7972 }
7973 #endif
7975 {
7976 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
7977 {
7978 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
7979 OnDebugButtonPressServer(id + 1);
7980 }
7981
7982 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
7983 {
7984 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
7986 }
7987
7988 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
7989 {
7990 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
7992 }
7993
7994 else if (action_id ==
EActions.ADD_QUANTITY)
7995 {
7996 if (IsMagazine())
7997 {
7998 Magazine mag = Magazine.Cast(this);
7999 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8000 }
8001 else
8002 {
8004 }
8005
8006 if (m_EM)
8007 {
8008 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8009 }
8010
8011 }
8012
8013 else if (action_id ==
EActions.REMOVE_QUANTITY)
8014 {
8015 if (IsMagazine())
8016 {
8017 Magazine mag2 = Magazine.Cast(this);
8018 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8019 }
8020 else
8021 {
8023 }
8024 if (m_EM)
8025 {
8026 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8027 }
8028
8029 }
8030
8031 else if (action_id ==
EActions.SET_QUANTITY_0)
8032 {
8034
8035 if (m_EM)
8036 {
8037 m_EM.SetEnergy(0);
8038 }
8039 }
8040
8041 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8042 {
8044
8045 if (m_EM)
8046 {
8047 m_EM.SetEnergy(m_EM.GetEnergyMax());
8048 }
8049 }
8050
8051 else if (action_id ==
EActions.ADD_HEALTH)
8052 {
8053 AddHealth("","",GetMaxHealth("","Health")/5);
8054 }
8055 else if (action_id ==
EActions.REMOVE_HEALTH)
8056 {
8057 AddHealth("","",-GetMaxHealth("","Health")/5);
8058 }
8059 else if (action_id ==
EActions.DESTROY_HEALTH)
8060 {
8061 SetHealth01("","",0);
8062 }
8063 else if (action_id ==
EActions.WATCH_ITEM)
8064 {
8066 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8067 #ifdef DEVELOPER
8068 SetDebugDeveloper_item(this);
8069 #endif
8070 }
8071
8072 else if (action_id ==
EActions.ADD_TEMPERATURE)
8073 {
8074 AddTemperature(20);
8075
8076 }
8077
8078 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8079 {
8080 AddTemperature(-20);
8081
8082 }
8083
8084 else if (action_id ==
EActions.FLIP_FROZEN)
8085 {
8086 SetFrozen(!GetIsFrozen());
8087
8088 }
8089
8090 else if (action_id ==
EActions.ADD_WETNESS)
8091 {
8093
8094 }
8095
8096 else if (action_id ==
EActions.REMOVE_WETNESS)
8097 {
8099
8100 }
8101
8102 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8103 {
8106
8107
8108 }
8109
8110 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8111 {
8114 }
8115
8116 else if (action_id ==
EActions.MAKE_SPECIAL)
8117 {
8118 auto debugParams = DebugSpawnParams.WithPlayer(player);
8119 OnDebugSpawnEx(debugParams);
8120 }
8121
8122 }
8123
8124
8125 return false;
8126 }
8127
8128
8129
8130
8134
8137
8138
8139
8141 {
8142 return false;
8143 }
8144
8145
8147 {
8148 return true;
8149 }
8150
8151
8153 {
8154 return true;
8155 }
8156
8157
8158
8160 {
8161 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8163 }
8164
8167 {
8168 return null;
8169 }
8170
8172 {
8173 return false;
8174 }
8175
8177 {
8178 return false;
8179 }
8180
8184
8185
8187 {
8188 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8189 return module_repairing.CanRepair(this, item_repair_kit);
8190 }
8191
8192
8193 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8194 {
8195 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8196 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8197 }
8198
8199
8201 {
8202
8203
8204
8205
8206
8207
8208
8209
8210 return 1;
8211 }
8212
8213
8214
8216 {
8218 }
8219
8220
8221
8223 {
8225 }
8226
8227
8236 {
8237 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8238
8239 if (player)
8240 {
8241 player.MessageStatus(text);
8242 }
8243 }
8244
8245
8254 {
8255 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8256
8257 if (player)
8258 {
8259 player.MessageAction(text);
8260 }
8261 }
8262
8263
8272 {
8273 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8274
8275 if (player)
8276 {
8277 player.MessageFriendly(text);
8278 }
8279 }
8280
8281
8290 {
8291 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8292
8293 if (player)
8294 {
8295 player.MessageImportant(text);
8296 }
8297 }
8298
8300 {
8301 return true;
8302 }
8303
8304
8305 override bool KindOf(
string tag)
8306 {
8307 bool found = false;
8308 string item_name = this.
GetType();
8311
8312 int array_size = item_tag_array.Count();
8313 for (int i = 0; i < array_size; i++)
8314 {
8315 if (item_tag_array.Get(i) == tag)
8316 {
8317 found = true;
8318 break;
8319 }
8320 }
8321 return found;
8322 }
8323
8324
8326 {
8327
8328 super.OnRPC(sender, rpc_type,ctx);
8329
8330
8331 switch (rpc_type)
8332 {
8333 #ifndef SERVER
8334 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8335 Param2<bool, string> p = new Param2<bool, string>(false, "");
8336
8338 return;
8339
8340 bool play = p.param1;
8341 string soundSet = p.param2;
8342
8343 if (play)
8344 {
8346 {
8348 {
8350 }
8351 }
8352 else
8353 {
8355 }
8356 }
8357 else
8358 {
8360 }
8361
8362 break;
8363 #endif
8364
8365 }
8366
8368 {
8370 }
8371 }
8372
8373
8374
8375
8377 {
8378 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8379 return plugin.GetID(
name);
8380 }
8381
8383 {
8384 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8385 return plugin.GetName(id);
8386 }
8387
8390 {
8391
8392
8393 int varFlags;
8394 if (!ctx.
Read(varFlags))
8395 return;
8396
8397 if (varFlags & ItemVariableFlags.FLOAT)
8398 {
8400 }
8401 }
8402
8404 {
8405
8406 super.SerializeNumericalVars(floats_out);
8407
8408
8409
8411 {
8413 }
8414
8416 {
8418 }
8419
8421 {
8423 }
8424
8426 {
8431 }
8432
8434 {
8436 }
8437 }
8438
8440 {
8441
8442 super.DeSerializeNumericalVars(floats);
8443
8444
8445 int index = 0;
8446 int mask = Math.Round(floats.Get(index));
8447
8448 index++;
8449
8451 {
8453 {
8455 }
8456 else
8457 {
8458 float quantity = floats.Get(index);
8460 }
8461 index++;
8462 }
8463
8465 {
8466 float wet = floats.Get(index);
8468 index++;
8469 }
8470
8472 {
8473 int liquidtype = Math.Round(floats.Get(index));
8475 index++;
8476 }
8477
8479 {
8481 index++;
8483 index++;
8485 index++;
8487 index++;
8488 }
8489
8491 {
8492 int cleanness = Math.Round(floats.Get(index));
8494 index++;
8495 }
8496 }
8497
8499 {
8500 super.WriteVarsToCTX(ctx);
8501
8502
8504 {
8506 }
8507
8509 {
8511 }
8512
8514 {
8516 }
8517
8519 {
8520 int r,g,b,a;
8526 }
8527
8529 {
8531 }
8532 }
8533
8535 {
8536 if (!super.ReadVarsFromCTX(ctx,version))
8537 return false;
8538
8539 int intValue;
8540 float value;
8541
8542 if (version < 140)
8543 {
8544 if (!ctx.
Read(intValue))
8545 return false;
8546
8547 m_VariablesMask = intValue;
8548 }
8549
8551 {
8552 if (!ctx.
Read(value))
8553 return false;
8554
8556 {
8558 }
8559 else
8560 {
8562 }
8563 }
8564
8565 if (version < 140)
8566 {
8568 {
8569 if (!ctx.
Read(value))
8570 return false;
8571 SetTemperatureDirect(value);
8572 }
8573 }
8574
8576 {
8577 if (!ctx.
Read(value))
8578 return false;
8580 }
8581
8583 {
8584 if (!ctx.
Read(intValue))
8585 return false;
8587 }
8588
8590 {
8591 int r,g,b,a;
8593 return false;
8595 return false;
8597 return false;
8599 return false;
8600
8602 }
8603
8605 {
8606 if (!ctx.
Read(intValue))
8607 return false;
8609 }
8610
8611 if (version >= 138 && version < 140)
8612 {
8614 {
8615 if (!ctx.
Read(intValue))
8616 return false;
8617 SetFrozen(intValue);
8618 }
8619 }
8620
8621 return true;
8622 }
8623
8624
8626 {
8629 {
8631 }
8632
8633 if (!super.OnStoreLoad(ctx, version))
8634 {
8636 return false;
8637 }
8638
8639 if (version >= 114)
8640 {
8641 bool hasQuickBarIndexSaved;
8642
8643 if (!ctx.
Read(hasQuickBarIndexSaved))
8644 {
8646 return false;
8647 }
8648
8649 if (hasQuickBarIndexSaved)
8650 {
8651 int itmQBIndex;
8652
8653
8654 if (!ctx.
Read(itmQBIndex))
8655 {
8657 return false;
8658 }
8659
8660 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8661 if (itmQBIndex != -1 && parentPlayer)
8662 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8663 }
8664 }
8665 else
8666 {
8667
8668 PlayerBase player;
8669 int itemQBIndex;
8670 if (version ==
int.
MAX)
8671 {
8672 if (!ctx.
Read(itemQBIndex))
8673 {
8675 return false;
8676 }
8677 }
8678 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8679 {
8680
8681 if (!ctx.
Read(itemQBIndex))
8682 {
8684 return false;
8685 }
8686 if (itemQBIndex != -1 && player)
8687 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8688 }
8689 }
8690
8691 if (version < 140)
8692 {
8693
8694 if (!LoadVariables(ctx, version))
8695 {
8697 return false;
8698 }
8699 }
8700
8701
8703 {
8705 return false;
8706 }
8707 if (version >= 132)
8708 {
8710 if (raib)
8711 {
8713 {
8715 return false;
8716 }
8717 }
8718 }
8719
8721 return true;
8722 }
8723
8724
8725
8727 {
8728 super.OnStoreSave(ctx);
8729
8730 PlayerBase player;
8731 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8732 {
8734
8735 int itemQBIndex = -1;
8736 itemQBIndex = player.FindQuickBarEntityIndex(this);
8737 ctx.
Write(itemQBIndex);
8738 }
8739 else
8740 {
8742 }
8743
8745
8747 if (raib)
8748 {
8750 }
8751 }
8752
8753
8755 {
8756 super.AfterStoreLoad();
8757
8759 {
8761 }
8762
8764 {
8767 }
8768 }
8769
8771 {
8772 super.EEOnAfterLoad();
8773
8775 {
8777 }
8778
8781 }
8782
8784 {
8785 return false;
8786 }
8787
8788
8789
8791 {
8793 {
8794 #ifdef PLATFORM_CONSOLE
8795
8797 {
8799 if (menu)
8800 {
8802 }
8803 }
8804 #endif
8805 }
8806
8808 {
8811 }
8812
8814 {
8815 SetWeightDirty();
8817 }
8819 {
8822 }
8823
8825 {
8828 }
8830 {
8833 }
8834
8835 super.OnVariablesSynchronized();
8836 }
8837
8838
8839
8841 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8842 {
8843 if (!IsServerCheck(allow_client))
8844 return false;
8845
8847 return false;
8848
8851
8852 if (value <= (min + 0.001))
8853 value = min;
8854
8855 if (value == min)
8856 {
8857 if (destroy_config)
8858 {
8859 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8860 if (dstr)
8861 {
8863 this.Delete();
8864 return true;
8865 }
8866 }
8867 else if (destroy_forced)
8868 {
8870 this.Delete();
8871 return true;
8872 }
8873
8875 }
8876
8879
8881 {
8883
8884 if (delta)
8886 }
8887
8889
8890 return false;
8891 }
8892
8893
8895 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8896 {
8898 }
8899
8901 {
8904 }
8905
8907 {
8910 }
8911
8913 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8914 {
8915 float value_clamped = Math.Clamp(value, 0, 1);
8917 SetQuantity(result, destroy_config, destroy_forced);
8918 }
8919
8920
8923 {
8925 }
8926
8928 {
8930 }
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8942 {
8943 int slot = -1;
8944 if (GetInventory())
8945 {
8946 InventoryLocation il = new InventoryLocation;
8947 GetInventory().GetCurrentInventoryLocation(il);
8949 }
8950
8952 }
8953
8955 {
8956 float quantity_max = 0;
8957
8959 {
8960 if (attSlotID != -1)
8961 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
8962
8963 if (quantity_max <= 0)
8965 }
8966
8967 if (quantity_max <= 0)
8969
8970 return quantity_max;
8971 }
8972
8974 {
8976 }
8977
8979 {
8981 }
8982
8983
8985 {
8987 }
8988
8990 {
8992 }
8993
8995 {
8997 }
8998
8999
9001 {
9002
9003 float weightEx = GetWeightEx();
9004 float special = GetInventoryAndCargoWeight();
9005 return weightEx - special;
9006 }
9007
9008
9010 {
9012 }
9013
9015 {
9017 {
9018 #ifdef DEVELOPER
9019 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9020 {
9021 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9023 }
9024 #endif
9025
9027 }
9028 else if (HasEnergyManager())
9029 {
9030 #ifdef DEVELOPER
9031 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9032 {
9033 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9034 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9035 }
9036 #endif
9037 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
9038 }
9039 else
9040 {
9041 #ifdef DEVELOPER
9042 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9043 {
9044 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9045 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9046 }
9047 #endif
9048 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9049 }
9050 }
9051
9054 {
9055 int item_count = 0;
9057
9058 if (GetInventory().GetCargo() != NULL)
9059 {
9060 item_count = GetInventory().GetCargo().GetItemCount();
9061 }
9062
9063 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9064 {
9065 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9066 if (item)
9067 item_count += item.GetNumberOfItems();
9068 }
9069 return item_count;
9070 }
9071
9074 {
9075 float weight = 0;
9076 float wetness = 1;
9077 if (include_wetness)
9080 {
9081 weight = wetness * m_ConfigWeight;
9082 }
9084 {
9085 weight = 1;
9086 }
9087 return weight;
9088 }
9089
9090
9091
9093 {
9094 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9095 {
9096 GameInventory inv = GetInventory();
9097 array<EntityAI> items = new array<EntityAI>;
9099 for (int i = 0; i < items.Count(); i++)
9100 {
9102 if (item)
9103 {
9105 }
9106 }
9107 }
9108 }
9109
9110
9111
9112
9114 {
9115 float energy = 0;
9116 if (HasEnergyManager())
9117 {
9118 energy = GetCompEM().GetEnergy();
9119 }
9120 return energy;
9121 }
9122
9123
9125 {
9126 super.OnEnergyConsumed();
9127
9129 }
9130
9132 {
9133 super.OnEnergyAdded();
9134
9136 }
9137
9138
9140 {
9141 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9142 {
9144 {
9145 float energy_0to1 = GetCompEM().GetEnergy0To1();
9147 }
9148 }
9149 }
9150
9151
9153 {
9154 return ConfigGetFloat("heatIsolation");
9155 }
9156
9158 {
9160 }
9161
9163 {
9164 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9165 if (
GetGame().ConfigIsExisting(paramPath))
9167
9168 return 0.0;
9169 }
9170
9172 {
9173 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9174 if (
GetGame().ConfigIsExisting(paramPath))
9176
9177 return 0.0;
9178 }
9179
9180 override void SetWet(
float value,
bool allow_client =
false)
9181 {
9182 if (!IsServerCheck(allow_client))
9183 return;
9184
9187
9189
9190 m_VarWet = Math.Clamp(value, min, max);
9191
9193 {
9196 }
9197 }
9198
9199 override void AddWet(
float value)
9200 {
9202 }
9203
9205 {
9207 }
9208
9210 {
9212 }
9213
9215 {
9217 }
9218
9220 {
9222 }
9223
9225 {
9227 }
9228
9230 {
9233 if (newLevel != oldLevel)
9234 {
9236 }
9237 }
9238
9240 {
9241 SetWeightDirty();
9242 }
9243
9245 {
9246 return GetWetLevelInternal(
m_VarWet);
9247 }
9248
9249
9250
9252 {
9254 }
9255
9257 {
9259 }
9260
9262 {
9264 }
9265
9267 {
9269 }
9270
9271
9272
9274 {
9275 if (ConfigIsExisting("itemModelLength"))
9276 {
9277 return ConfigGetFloat("itemModelLength");
9278 }
9279 return 0;
9280 }
9281
9283 {
9284 if (ConfigIsExisting("itemAttachOffset"))
9285 {
9286 return ConfigGetFloat("itemAttachOffset");
9287 }
9288 return 0;
9289 }
9290
9291 override void SetCleanness(
int value,
bool allow_client =
false)
9292 {
9293 if (!IsServerCheck(allow_client))
9294 return;
9295
9297
9299
9302 }
9303
9305 {
9307 }
9308
9310 {
9311 return true;
9312 }
9313
9314
9315
9316
9318 {
9320 }
9321
9323 {
9325 }
9326
9327
9328
9329
9330 override void SetColor(
int r,
int g,
int b,
int a)
9331 {
9337 }
9339 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9340 {
9345 }
9346
9348 {
9350 }
9351
9354 {
9355 int r,g,b,a;
9357 r = r/255;
9358 g = g/255;
9359 b = b/255;
9360 a = a/255;
9361 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9362 }
9363
9364
9365
9366 override void SetLiquidType(
int value,
bool allow_client =
false)
9367 {
9368 if (!IsServerCheck(allow_client))
9369 return;
9370
9375 }
9376
9378 {
9379 return ConfigGetInt("varLiquidTypeInit");
9380 }
9381
9383 {
9385 }
9386
9388 {
9390 SetFrozen(false);
9391 }
9392
9395 {
9396 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9397 }
9398
9399
9402 {
9403 PlayerBase nplayer;
9404 if (PlayerBase.CastTo(nplayer, player))
9405 {
9407
9408 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9409 }
9410 }
9411
9412
9415 {
9416 PlayerBase nplayer;
9417 if (PlayerBase.CastTo(nplayer,player))
9418 {
9419
9420 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9421
9422 }
9423
9424
9425 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9426
9427
9428 if (HasEnergyManager())
9429 {
9430 GetCompEM().UpdatePlugState();
9431 }
9432 }
9433
9434
9436 {
9437 super.OnPlacementStarted(player);
9438
9440 }
9441
9442 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9443 {
9445 {
9446 m_AdminLog.OnPlacementComplete(player,
this);
9447 }
9448
9449 super.OnPlacementComplete(player, position, orientation);
9450 }
9451
9452
9453
9454
9455
9457 {
9459 {
9460 return true;
9461 }
9462 else
9463 {
9464 return false;
9465 }
9466 }
9467
9468
9470 {
9472 {
9474 }
9475 }
9476
9477
9479 {
9481 }
9482
9484 {
9486 }
9487
9488 override void InsertAgent(
int agent,
float count = 1)
9489 {
9490 if (count < 1)
9491 return;
9492
9494 }
9495
9498 {
9500 }
9501
9502
9504 {
9506 }
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9550 {
9552 return false;
9553 return true;
9554 }
9555
9557 {
9558
9560 }
9561
9562
9565 {
9566 super.CheckForRoofLimited(timeTresholdMS);
9567
9569 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9570 {
9571 m_PreviousRoofTestTime = time;
9572 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9573 }
9574 }
9575
9576
9578 {
9580 {
9581 return 0;
9582 }
9583
9584 if (GetInventory().GetAttachmentSlotsCount() != 0)
9585 {
9586 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9587 if (filter)
9588 return filter.GetProtectionLevel(type, false, system);
9589 else
9590 return 0;
9591 }
9592
9593 string subclassPath, entryName;
9594
9595 switch (type)
9596 {
9598 entryName = "biological";
9599 break;
9601 entryName = "chemical";
9602 break;
9603 default:
9604 entryName = "biological";
9605 break;
9606 }
9607
9608 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9609
9611 }
9612
9613
9614
9617 {
9618 if (!IsMagazine())
9620
9622 }
9623
9624
9625
9626
9627
9632 {
9633 return true;
9634 }
9635
9637 {
9639 }
9640
9641
9642
9643
9644
9646 {
9647 if (parent)
9648 {
9649 if (parent.IsInherited(DayZInfected))
9650 return true;
9651
9652 if (!parent.IsRuined())
9653 return true;
9654 }
9655
9656 return true;
9657 }
9658
9660 {
9661 if (!super.CanPutAsAttachment(parent))
9662 {
9663 return false;
9664 }
9665
9666 if (!IsRuined() && !parent.IsRuined())
9667 {
9668 return true;
9669 }
9670
9671 return false;
9672 }
9673
9675 {
9676
9677
9678
9679
9680 return super.CanReceiveItemIntoCargo(item);
9681 }
9682
9684 {
9685
9686
9687
9688
9689 GameInventory attachmentInv = attachment.GetInventory();
9691 {
9692 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9693 return false;
9694 }
9695
9696 InventoryLocation loc = new InventoryLocation();
9697 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9698 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9699 return false;
9700
9701 return super.CanReceiveAttachment(attachment, slotId);
9702 }
9703
9705 {
9706 if (!super.CanReleaseAttachment(attachment))
9707 return false;
9708
9709 return GetInventory().AreChildrenAccessible();
9710 }
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9733 {
9734 int id = muzzle_owner.GetMuzzleID();
9735 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9736
9737 if (WPOF_array)
9738 {
9739 for (int i = 0; i < WPOF_array.Count(); i++)
9740 {
9741 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9742
9743 if (WPOF)
9744 {
9745 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9746 }
9747 }
9748 }
9749 }
9750
9751
9753 {
9754 int id = muzzle_owner.GetMuzzleID();
9756
9757 if (WPOBE_array)
9758 {
9759 for (int i = 0; i < WPOBE_array.Count(); i++)
9760 {
9761 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9762
9763 if (WPOBE)
9764 {
9765 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9766 }
9767 }
9768 }
9769 }
9770
9771
9773 {
9774 int id = muzzle_owner.GetMuzzleID();
9775 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9776
9777 if (WPOOH_array)
9778 {
9779 for (int i = 0; i < WPOOH_array.Count(); i++)
9780 {
9781 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9782
9783 if (WPOOH)
9784 {
9785 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9786 }
9787 }
9788 }
9789 }
9790
9791
9793 {
9794 int id = muzzle_owner.GetMuzzleID();
9795 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9796
9797 if (WPOOH_array)
9798 {
9799 for (int i = 0; i < WPOOH_array.Count(); i++)
9800 {
9801 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9802
9803 if (WPOOH)
9804 {
9805 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9806 }
9807 }
9808 }
9809 }
9810
9811
9813 {
9814 int id = muzzle_owner.GetMuzzleID();
9815 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9816
9817 if (WPOOH_array)
9818 {
9819 for (int i = 0; i < WPOOH_array.Count(); i++)
9820 {
9821 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9822
9823 if (WPOOH)
9824 {
9825 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9826 }
9827 }
9828 }
9829 }
9830
9831
9832
9834 {
9836 {
9837 return true;
9838 }
9839
9840 return false;
9841 }
9842
9844 {
9846 {
9847 return true;
9848 }
9849
9850 return false;
9851 }
9852
9854 {
9856 {
9857 return true;
9858 }
9859
9860 return false;
9861 }
9862
9864 {
9865 return false;
9866 }
9867
9870 {
9871 return UATimeSpent.DEFAULT_DEPLOY;
9872 }
9873
9874
9875
9876
9878 {
9880 SetSynchDirty();
9881 }
9882
9884 {
9886 }
9887
9888
9890 {
9891 return false;
9892 }
9893
9896 {
9897 string att_type = "None";
9898
9899 if (ConfigIsExisting("soundAttType"))
9900 {
9901 att_type = ConfigGetString("soundAttType");
9902 }
9903
9905 }
9906
9908 {
9910 }
9911
9912
9913
9914
9915
9921
9923 {
9926
9928 }
9929
9930
9932 {
9934 return;
9935
9937
9940
9943
9944 SoundParameters params = new SoundParameters();
9948 }
9949
9950
9952 {
9954 return;
9955
9957 SetSynchDirty();
9958
9961 }
9962
9963
9965 {
9967 return;
9968
9970 SetSynchDirty();
9971
9974 }
9975
9977 {
9979 }
9980
9982 {
9984 }
9985
9988 {
9989 if (!
GetGame().IsDedicatedServer())
9990 {
9991 if (ConfigIsExisting("attachSoundSet"))
9992 {
9993 string cfg_path = "";
9994 string soundset = "";
9996
9999 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10000 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10001
10002 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10003 {
10004 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10005 {
10006 if (cfg_slot_array[i] == slot_type)
10007 {
10008 soundset = cfg_soundset_array[i];
10009 break;
10010 }
10011 }
10012 }
10013
10014 if (soundset != "")
10015 {
10016 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10018 }
10019 }
10020 }
10021 }
10022
10024 {
10025
10026 }
10027
10028 void OnApply(PlayerBase player);
10029
10031 {
10032 return 1.0;
10033 };
10034
10036 {
10038 }
10039
10041 {
10043 }
10044
10046
10048 {
10049 SetDynamicPhysicsLifeTime(0.01);
10051 }
10052
10054 {
10055 array<string> zone_names = new array<string>;
10056 GetDamageZones(zone_names);
10057 for (int i = 0; i < zone_names.Count(); i++)
10058 {
10059 SetHealthMax(zone_names.Get(i),"Health");
10060 }
10061 SetHealthMax("","Health");
10062 }
10063
10066 {
10067 float global_health = GetHealth01("","Health");
10068 array<string> zones = new array<string>;
10069 GetDamageZones(zones);
10070
10071 for (int i = 0; i < zones.Count(); i++)
10072 {
10073 SetHealth01(zones.Get(i),"Health",global_health);
10074 }
10075 }
10076
10079 {
10080 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10081 }
10082
10084 {
10085 if (!hasRootAsPlayer)
10086 {
10087 if (refParentIB)
10088 {
10089
10090 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10091 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10092
10093 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10094 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10095
10098 }
10099 else
10100 {
10101
10104 }
10105 }
10106 }
10107
10109 {
10111 {
10112 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10113 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10114 {
10115 float heatPermCoef = 1.0;
10117 while (ent)
10118 {
10119 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10120 ent = ent.GetHierarchyParent();
10121 }
10122
10123 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10124 }
10125 }
10126 }
10127
10129 {
10130
10131 EntityAI parent = GetHierarchyParent();
10132 if (!parent)
10133 {
10134 hasParent = false;
10135 hasRootAsPlayer = false;
10136 }
10137 else
10138 {
10139 hasParent = true;
10140 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10141 refParentIB =
ItemBase.Cast(parent);
10142 }
10143 }
10144
10145 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10146 {
10147
10148 }
10149
10151 {
10152
10153 return false;
10154 }
10155
10157 {
10158
10159
10160 return false;
10161 }
10162
10164 {
10165
10166 return false;
10167 }
10168
10171 {
10172 return !GetIsFrozen() &&
IsOpen();
10173 }
10174
10176 {
10177 bool hasParent = false, hasRootAsPlayer = false;
10179
10180 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10181 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10182
10183 if (wwtu || foodDecay)
10184 {
10188
10189 if (processWetness || processTemperature || processDecay)
10190 {
10192
10193 if (processWetness)
10194 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10195
10196 if (processTemperature)
10198
10199 if (processDecay)
10200 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10201 }
10202 }
10203 }
10204
10207 {
10209 }
10210
10212 {
10215
10216 return super.GetTemperatureFreezeThreshold();
10217 }
10218
10220 {
10223
10224 return super.GetTemperatureThawThreshold();
10225 }
10226
10228 {
10231
10232 return super.GetItemOverheatThreshold();
10233 }
10234
10236 {
10238 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10239
10240 return super.GetTemperatureFreezeTime();
10241 }
10242
10244 {
10246 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10247
10248 return super.GetTemperatureThawTime();
10249 }
10250
10255
10257 {
10258 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10259 }
10260
10262 {
10263 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10264 }
10265
10268 {
10270 }
10271
10273 {
10275 }
10276
10278 {
10280 }
10281
10284 {
10285 return null;
10286 }
10287
10290 {
10291 return false;
10292 }
10293
10295 {
10297 {
10300 if (!trg)
10301 {
10303 explosive = this;
10304 }
10305
10306 explosive.PairRemote(trg);
10308
10309 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10310 trg.SetPersistentPairID(persistentID);
10311 explosive.SetPersistentPairID(persistentID);
10312
10313 return true;
10314 }
10315 return false;
10316 }
10317
10320 {
10321 float ret = 1.0;
10324 ret *= GetHealth01();
10325
10326 return ret;
10327 }
10328
10329 #ifdef DEVELOPER
10330 override void SetDebugItem()
10331 {
10332 super.SetDebugItem();
10333 _itemBase = this;
10334 }
10335
10337 {
10338 string text = super.GetDebugText();
10339
10341 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10342
10343 return text;
10344 }
10345 #endif
10346
10348 {
10349 return true;
10350 }
10351
10353
10355
10357 {
10360 }
10361
10362
10370
10386}
10387
10389{
10391 if (entity)
10392 {
10393 bool is_item = entity.IsInherited(
ItemBase);
10394 if (is_item && full_quantity)
10395 {
10398 }
10399 }
10400 else
10401 {
10403 return NULL;
10404 }
10405 return entity;
10406}
10407
10409{
10410 if (item)
10411 {
10412 if (health > 0)
10413 item.SetHealth("", "", health);
10414
10415 if (item.CanHaveTemperature())
10416 {
10418 if (item.CanFreeze())
10419 item.SetFrozen(false);
10420 }
10421
10422 if (item.HasEnergyManager())
10423 {
10424 if (quantity >= 0)
10425 {
10426 item.GetCompEM().SetEnergy0To1(quantity);
10427 }
10428 else
10429 {
10431 }
10432 }
10433 else if (item.IsMagazine())
10434 {
10435 Magazine mag = Magazine.Cast(item);
10436 if (quantity >= 0)
10437 {
10438 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10439 }
10440 else
10441 {
10443 }
10444
10445 }
10446 else
10447 {
10448 if (quantity >= 0)
10449 {
10450 item.SetQuantityNormalized(quantity, false);
10451 }
10452 else
10453 {
10455 }
10456
10457 }
10458 }
10459}
10460
10461#ifdef DEVELOPER
10463#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.