5639{
5641 {
5642 return true;
5643 }
5644};
5645
5646
5647
5649{
5653
5655
5658
5659
5660
5661
5662
5671
5677
5682
5687
5708 protected bool m_IsResultOfSplit
5709
5711
5716
5717
5718
5720
5724
5725
5726
5728
5731
5732
5733
5739
5740
5748
5751
5752
5754
5755
5757
5758
5763
5764
5769
5770
5772
5773
5775 {
5780
5781 if (!
GetGame().IsDedicatedServer())
5782 {
5784 {
5786
5788 {
5790 }
5791 }
5792
5795 }
5796
5797 m_OldLocation = null;
5798
5800 {
5802 }
5803
5804 if (ConfigIsExisting("headSelectionsToHide"))
5805 {
5808 }
5809
5811 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5812 {
5814 }
5815
5817
5818 m_IsResultOfSplit = false;
5819
5821 }
5822
5824 {
5825 super.InitItemVariables();
5826
5832 m_Count = ConfigGetInt(
"count");
5833
5836
5841
5844
5849
5861
5865
5866
5869 if (ConfigIsExisting("canBeSplit"))
5870 {
5873 }
5874
5876 if (ConfigIsExisting("itemBehaviour"))
5878
5879
5882 RegisterNetSyncVariableInt("m_VarLiquidType");
5883 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5884
5885 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5886 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5887 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5888
5889 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5890 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5891 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5892 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5893
5894 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5895 RegisterNetSyncVariableBool("m_IsTakeable");
5896 RegisterNetSyncVariableBool("m_IsHologram");
5897
5900 {
5903 }
5904
5906
5908 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5910
5911 }
5912
5914 {
5916 }
5917
5919 {
5922 {
5927 }
5928 }
5929
5930 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5931 {
5933 {
5936 }
5937
5939 }
5940
5942 {
5948 }
5949
5951
5953 {
5955
5956 if (!action)
5957 {
5958 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
5959 return;
5960 }
5961
5963 if (!ai)
5964 {
5966 return;
5967 }
5968
5970 if (!action_array)
5971 {
5972 action_array = new array<ActionBase_Basic>;
5974 }
5975 if (LogManager.IsActionLogEnable())
5976 {
5977 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
5978 }
5979
5980 if (action_array.Find(action) != -1)
5981 {
5982 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
5983 }
5984 else
5985 {
5986 action_array.Insert(action);
5987 }
5988 }
5989
5991 {
5993 ActionBase action = player.GetActionManager().GetAction(actionName);
5996
5997 if (action_array)
5998 {
5999 action_array.RemoveItem(action);
6000 }
6001 }
6002
6003
6004
6006 {
6007 ActionOverrideData overrideData = new ActionOverrideData();
6011
6013 if (!actionMap)
6014 {
6017 }
6018
6019 actionMap.Insert(this.
Type(), overrideData);
6020
6021 }
6022
6024
6026
6027
6029 {
6032
6035
6036 string config_to_search = "CfgVehicles";
6037 string muzzle_owner_config;
6038
6040 {
6041 if (IsInherited(Weapon))
6042 config_to_search = "CfgWeapons";
6043
6044 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6045
6046 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6047
6049
6050 if (config_OnFire_subclass_count > 0)
6051 {
6052 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6053
6054 for (int i = 0; i < config_OnFire_subclass_count; i++)
6055 {
6056 string particle_class = "";
6058 string config_OnFire_entry = config_OnFire_class + particle_class;
6059 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6060 WPOF_array.Insert(WPOF);
6061 }
6062
6063
6065 }
6066 }
6067
6069 {
6070 config_to_search = "CfgWeapons";
6071 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6072
6073 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6074
6076
6077 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6078 {
6079 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6080
6081 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6082 {
6083 string particle_class2 = "";
6085 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6086 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6087 WPOBE_array.Insert(WPOBE);
6088 }
6089
6090
6092 }
6093 }
6094 }
6095
6096
6098 {
6101
6103 {
6104 string config_to_search = "CfgVehicles";
6105
6106 if (IsInherited(Weapon))
6107 config_to_search = "CfgWeapons";
6108
6109 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6110 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6111
6112 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6113 {
6114
6116
6118 {
6120 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6122 return;
6123 }
6124
6127
6128
6129
6131 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6132
6133 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6134 {
6135 string particle_class = "";
6137 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6139
6140 if (entry_type == CT_CLASS)
6141 {
6142 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6143 WPOOH_array.Insert(WPOF);
6144 }
6145 }
6146
6147
6149 }
6150 }
6151 }
6152
6154 {
6156 }
6157
6159 {
6161 {
6163
6166
6169
6170 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6171 }
6172 }
6173
6175 {
6177 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6178
6180 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6181
6183 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6184
6186 {
6188 }
6189 }
6190
6192 {
6194 }
6195
6197 {
6200 else
6202
6204 {
6207 }
6208 else
6209 {
6212
6215 }
6216
6218 }
6219
6221 {
6223 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6224 }
6225
6227 {
6229 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6231 }
6232
6234 {
6236 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6237 }
6238
6240 {
6243
6244 OverheatingParticle OP = new OverheatingParticle();
6249
6251 }
6252
6254 {
6257
6258 return -1;
6259 }
6260
6262 {
6264 {
6267
6268 for (int i = count; i > 0; --i)
6269 {
6270 int id = i - 1;
6273
6276
6277 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6278 {
6279 if (p)
6280 {
6283 }
6284 }
6285 }
6286 }
6287 }
6288
6290 {
6292 {
6294 {
6295 int id = i - 1;
6297
6298 if (OP)
6299 {
6301
6302 if (p)
6303 {
6305 }
6306
6307 delete OP;
6308 }
6309 }
6310
6313 }
6314 }
6315
6318 {
6319 return 0.0;
6320 }
6321
6322
6324 {
6325 return 250;
6326 }
6327
6329 {
6330 return 0;
6331 }
6332
6335 {
6337 return true;
6338
6339 return false;
6340 }
6341
6344 {
6347
6349 {
6351 }
6352 else
6353 {
6354
6356 }
6357
6359 }
6360
6367 {
6368 return -1;
6369 }
6370
6371
6372
6373
6375 {
6377 {
6379 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6380
6381 if (r_index >= 0)
6382 {
6383 InventoryLocation r_il = new InventoryLocation;
6384 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6385
6386 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6389 {
6390 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6391 }
6393 {
6394 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6395 }
6396
6397 }
6398
6399 player.GetHumanInventory().ClearUserReservedLocation(this);
6400 }
6401
6404 }
6405
6406
6407
6408
6410 {
6411 return ItemBase.m_DebugActionsMask;
6412 }
6413
6415 {
6416 return ItemBase.m_DebugActionsMask & mask;
6417 }
6418
6420 {
6421 ItemBase.m_DebugActionsMask = mask;
6422 }
6423
6425 {
6426 ItemBase.m_DebugActionsMask |= mask;
6427 }
6428
6430 {
6431 ItemBase.m_DebugActionsMask &= ~mask;
6432 }
6433
6435 {
6437 {
6439 }
6440 else
6441 {
6443 }
6444 }
6445
6446
6448 {
6449 if (GetEconomyProfile())
6450 {
6451 float q_max = GetEconomyProfile().GetQuantityMax();
6452 if (q_max > 0)
6453 {
6454 float q_min = GetEconomyProfile().GetQuantityMin();
6455 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6456
6458 {
6459 ComponentEnergyManager comp = GetCompEM();
6461 {
6463 }
6464 }
6466 {
6468
6469 }
6470
6471 }
6472 }
6473 }
6474
6477 {
6478 EntityAI parent = GetHierarchyParent();
6479
6480 if (parent)
6481 {
6482 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6483 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6484 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6485 }
6486 }
6487
6490 {
6491 EntityAI parent = GetHierarchyParent();
6492
6493 if (parent)
6494 {
6495 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6496 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6497 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6498 }
6499 }
6500
6502 {
6503
6504
6505
6506
6508
6510 {
6511 if (ScriptInputUserData.CanStoreInputUserData())
6512 {
6513 ScriptInputUserData ctx = new ScriptInputUserData;
6519 ctx.
Write(use_stack_max);
6522
6524 {
6525 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6526 }
6527 }
6528 }
6529 else if (!
GetGame().IsMultiplayer())
6530 {
6532 }
6533 }
6534
6536 {
6538 }
6539
6541 {
6543 }
6544
6546 {
6548 }
6549
6551 {
6552
6553 return false;
6554 }
6555
6557 {
6558 return false;
6559 }
6560
6564 {
6565 return false;
6566 }
6567
6569 {
6570 return "";
6571 }
6572
6574
6576 {
6577 return false;
6578 }
6579
6581 {
6582 return true;
6583 }
6584
6585
6586
6588 {
6589 return true;
6590 }
6591
6593 {
6594 return true;
6595 }
6596
6598 {
6599 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6601 }
6602
6604 {
6606 }
6607
6609 {
6611 if (!is_being_placed)
6613 SetSynchDirty();
6614 }
6615
6616
6618
6620 {
6622 }
6623
6625 {
6627 }
6628
6630 {
6631 return 1;
6632 }
6633
6635 {
6636 return false;
6637 }
6638
6640 {
6642 SetSynchDirty();
6643 }
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6680 {
6681 super.OnMovedInsideCargo(container);
6682
6683 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6684 }
6685
6686 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6687 {
6688 super.EEItemLocationChanged(oldLoc,newLoc);
6689
6690 PlayerBase new_player = null;
6691 PlayerBase old_player = null;
6692
6693 if (newLoc.GetParent())
6694 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6695
6696 if (oldLoc.GetParent())
6697 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6698
6700 {
6701 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6702
6703 if (r_index >= 0)
6704 {
6705 InventoryLocation r_il = new InventoryLocation;
6706 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6707
6708 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6711 {
6712 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6713 }
6715 {
6716 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6717 }
6718
6719 }
6720 }
6721
6723 {
6724 if (new_player)
6725 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6726
6727 if (new_player == old_player)
6728 {
6729
6730 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6731 {
6733 {
6734 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6735 {
6736 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6737 }
6738 }
6739 else
6740 {
6741 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6742 }
6743 }
6744
6745 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6746 {
6747 int type = oldLoc.GetType();
6749 {
6750 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6751 }
6753 {
6754 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6755 }
6756 }
6757 if (!m_OldLocation)
6758 {
6759 m_OldLocation = new InventoryLocation;
6760 }
6761 m_OldLocation.Copy(oldLoc);
6762 }
6763 else
6764 {
6765 if (m_OldLocation)
6766 {
6767 m_OldLocation.Reset();
6768 }
6769 }
6770
6772 }
6773 else
6774 {
6775 if (new_player)
6776 {
6777 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6778 if (res_index >= 0)
6779 {
6780 InventoryLocation il = new InventoryLocation;
6781 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6783 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6786 {
6787 il.
GetParent().GetOnReleaseLock().Invoke(it);
6788 }
6790 {
6792 }
6793
6794 }
6795 }
6797 {
6798
6800 }
6801
6802 if (m_OldLocation)
6803 {
6804 m_OldLocation.Reset();
6805 }
6806 }
6807 }
6808
6809 override void EOnContact(IEntity other, Contact extra)
6810 {
6812 {
6813 int liquidType = -1;
6815 if (impactSpeed > 0.0)
6816 {
6818 #ifndef SERVER
6820 #else
6822 SetSynchDirty();
6823 #endif
6825 }
6826 }
6827
6828 #ifdef SERVER
6829 if (GetCompEM() && GetCompEM().IsPlugged())
6830 {
6831 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6832 GetCompEM().UnplugThis();
6833 }
6834 #endif
6835 }
6836
6838
6840 {
6842 }
6843
6845 {
6846
6847 }
6848
6850 {
6851 super.OnItemLocationChanged(old_owner, new_owner);
6852
6853 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6854 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6855
6856 if (!relatedPlayer && playerNew)
6857 relatedPlayer = playerNew;
6858
6859 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6860 {
6862 if (actionMgr)
6863 {
6864 ActionBase currentAction = actionMgr.GetRunningAction();
6865 if (currentAction)
6867 }
6868 }
6869
6870 Man ownerPlayerOld = null;
6871 Man ownerPlayerNew = null;
6872
6873 if (old_owner)
6874 {
6875 if (old_owner.
IsMan())
6876 {
6877 ownerPlayerOld = Man.Cast(old_owner);
6878 }
6879 else
6880 {
6881 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6882 }
6883 }
6884 else
6885 {
6887 {
6889
6890 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6891 {
6892 GetCompEM().UnplugThis();
6893 }
6894 }
6895 }
6896
6897 if (new_owner)
6898 {
6899 if (new_owner.
IsMan())
6900 {
6901 ownerPlayerNew = Man.Cast(new_owner);
6902 }
6903 else
6904 {
6905 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6906 }
6907 }
6908
6909 if (ownerPlayerOld != ownerPlayerNew)
6910 {
6911 if (ownerPlayerOld)
6912 {
6913 array<EntityAI> subItemsExit = new array<EntityAI>;
6915 for (int i = 0; i < subItemsExit.Count(); i++)
6916 {
6919 }
6920 }
6921
6922 if (ownerPlayerNew)
6923 {
6924 array<EntityAI> subItemsEnter = new array<EntityAI>;
6926 for (int j = 0; j < subItemsEnter.Count(); j++)
6927 {
6930 }
6931 }
6932 }
6933 else if (ownerPlayerNew != null)
6934 {
6935 PlayerBase nplayer;
6936 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
6937 {
6938 array<EntityAI> subItemsUpdate = new array<EntityAI>;
6940 for (int k = 0; k < subItemsUpdate.Count(); k++)
6941 {
6943 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
6944 }
6945 }
6946 }
6947
6948 if (old_owner)
6949 old_owner.OnChildItemRemoved(this);
6950 if (new_owner)
6951 new_owner.OnChildItemReceived(this);
6952 }
6953
6954
6956 {
6957 super.EEDelete(parent);
6958 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
6959 if (player)
6960 {
6962
6963 if (player.IsAlive())
6964 {
6965 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6966 if (r_index >= 0)
6967 {
6968 InventoryLocation r_il = new InventoryLocation;
6969 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6970
6971 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6974 {
6975 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6976 }
6978 {
6979 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6980 }
6981
6982 }
6983
6984 player.RemoveQuickBarEntityShortcut(this);
6985 }
6986 }
6987 }
6988
6990 {
6991 super.EEKilled(killer);
6992
6995 {
6996 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
6997 {
6998 if (IsMagazine())
6999 {
7000 if (Magazine.Cast(this).GetAmmoCount() > 0)
7001 {
7003 }
7004 }
7005 else
7006 {
7008 }
7009 }
7010 }
7011 }
7012
7014 {
7015 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7016
7017 super.OnWasAttached(parent, slot_id);
7018
7021
7023 }
7024
7026 {
7027 super.OnWasDetached(parent, slot_id);
7028
7031 }
7032
7034 {
7035 int idx;
7038
7039 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7040 if (inventory_slots.Count() < 1)
7041 {
7042 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7043 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7044 }
7045 else
7046 {
7047 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7048 }
7049
7050 idx = inventory_slots.Find(slot);
7051 if (idx < 0)
7052 return "";
7053
7054 return attach_types.Get(idx);
7055 }
7056
7058 {
7059 int idx = -1;
7060 string slot;
7061
7064
7065 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7066 if (inventory_slots.Count() < 1)
7067 {
7068 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7069 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7070 }
7071 else
7072 {
7073 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7074 if (detach_types.Count() < 1)
7075 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7076 }
7077
7078 for (int i = 0; i < inventory_slots.Count(); i++)
7079 {
7080 slot = inventory_slots.Get(i);
7081 }
7082
7083 if (slot != "")
7084 {
7085 if (detach_types.Count() == 1)
7086 idx = 0;
7087 else
7088 idx = inventory_slots.Find(slot);
7089 }
7090 if (idx < 0)
7091 return "";
7092
7093 return detach_types.Get(idx);
7094 }
7095
7097 {
7098
7100
7101
7102 float min_time = 1;
7103 float max_time = 3;
7104 float delay = Math.RandomFloat(min_time, max_time);
7105
7106 explode_timer.Run(delay, this, "DoAmmoExplosion");
7107 }
7108
7110 {
7111 Magazine magazine = Magazine.Cast(this);
7112 int pop_sounds_count = 6;
7113 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7114
7115
7116 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7117 string sound_name = pop_sounds[ sound_idx ];
7119
7120
7121 magazine.ServerAddAmmoCount(-1);
7122
7123
7124 float min_temp_to_explode = 100;
7125
7126 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
7127 {
7129 }
7130 }
7131
7132
7133 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7134 {
7135 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7136
7137 const int CHANCE_DAMAGE_CARGO = 4;
7138 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7139 const int CHANCE_DAMAGE_NOTHING = 2;
7140
7142 {
7143 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7144 int chances;
7145 int rnd;
7146
7147 if (GetInventory().GetCargo())
7148 {
7149 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7150 rnd = Math.RandomInt(0,chances);
7151
7152 if (rnd < CHANCE_DAMAGE_CARGO)
7153 {
7155 }
7156 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7157 {
7159 }
7160 }
7161 else
7162 {
7163 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7164 rnd = Math.RandomInt(0,chances);
7165
7166 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7167 {
7169 }
7170 }
7171 }
7172 }
7173
7175 {
7176 if (GetInventory().GetCargo())
7177 {
7178 int item_count = GetInventory().GetCargo().GetItemCount();
7179 if (item_count > 0)
7180 {
7181 int random_pick = Math.RandomInt(0, item_count);
7183 if (!item.IsExplosive())
7184 {
7185 item.AddHealth("","",damage);
7186 return true;
7187 }
7188 }
7189 }
7190 return false;
7191 }
7192
7194 {
7195 int attachment_count = GetInventory().AttachmentCount();
7196 if (attachment_count > 0)
7197 {
7198 int random_pick = Math.RandomInt(0, attachment_count);
7199 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7200 if (!attachment.IsExplosive())
7201 {
7202 attachment.AddHealth("","",damage);
7203 return true;
7204 }
7205 }
7206 return false;
7207 }
7208
7210 {
7212 }
7213
7215 {
7217 return GetInventory().CanRemoveEntity();
7218
7219 return false;
7220 }
7221
7223 {
7224
7226 return false;
7227
7228
7230 return false;
7231
7232
7233
7235 if (delta == 0)
7236 return false;
7237
7238
7239 return true;
7240 }
7241
7243 {
7245 {
7246 if (ScriptInputUserData.CanStoreInputUserData())
7247 {
7248 ScriptInputUserData ctx = new ScriptInputUserData;
7253 ctx.
Write(destination_entity);
7257 }
7258 }
7259 else if (!
GetGame().IsMultiplayer())
7260 {
7262 }
7263 }
7264
7266 {
7267 float split_quantity_new;
7271 InventoryLocation loc = new InventoryLocation;
7272
7273 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7274 {
7276 split_quantity_new = stack_max;
7277 else
7279
7281 {
7282 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7283 if (new_item)
7284 {
7285 new_item.SetResultOfSplit(true);
7286 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7288 new_item.
SetQuantity(split_quantity_new,
false,
true);
7289 }
7290 }
7291 }
7292 else if (destination_entity && slot_id == -1)
7293 {
7294 if (quantity > stack_max)
7295 split_quantity_new = stack_max;
7296 else
7297 split_quantity_new = quantity;
7298
7300 {
7302 {
7305 }
7306
7307 if (new_item)
7308 {
7309 new_item.SetResultOfSplit(true);
7310 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7312 new_item.
SetQuantity(split_quantity_new,
false,
true);
7313 }
7314 }
7315 }
7316 else
7317 {
7318 if (stack_max != 0)
7319 {
7321 {
7323 }
7324
7325 if (split_quantity_new == 0)
7326 {
7327 if (!
GetGame().IsMultiplayer())
7328 player.PhysicalPredictiveDropItem(this);
7329 else
7330 player.ServerDropEntity(this);
7331 return;
7332 }
7333
7335 {
7337
7338 if (new_item)
7339 {
7340 new_item.SetResultOfSplit(true);
7341 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7344 new_item.PlaceOnSurface();
7345 }
7346 }
7347 }
7348 }
7349 }
7350
7352 {
7353 float split_quantity_new;
7357 InventoryLocation loc = new InventoryLocation;
7358
7359 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7360 {
7362 split_quantity_new = stack_max;
7363 else
7365
7367 {
7368 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7369 if (new_item)
7370 {
7371 new_item.SetResultOfSplit(true);
7372 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7374 new_item.
SetQuantity(split_quantity_new,
false,
true);
7375 }
7376 }
7377 }
7378 else if (destination_entity && slot_id == -1)
7379 {
7380 if (quantity > stack_max)
7381 split_quantity_new = stack_max;
7382 else
7383 split_quantity_new = quantity;
7384
7386 {
7388 {
7391 }
7392
7393 if (new_item)
7394 {
7395 new_item.SetResultOfSplit(true);
7396 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7398 new_item.
SetQuantity(split_quantity_new,
false,
true);
7399 }
7400 }
7401 }
7402 else
7403 {
7404 if (stack_max != 0)
7405 {
7407 {
7409 }
7410
7412 {
7414
7415 if (new_item)
7416 {
7417 new_item.SetResultOfSplit(true);
7418 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7421 new_item.PlaceOnSurface();
7422 }
7423 }
7424 }
7425 }
7426 }
7427
7429 {
7431 {
7432 if (ScriptInputUserData.CanStoreInputUserData())
7433 {
7434 ScriptInputUserData ctx = new ScriptInputUserData;
7439 dst.WriteToContext(ctx);
7441 }
7442 }
7443 else if (!
GetGame().IsMultiplayer())
7444 {
7446 }
7447 }
7448
7450 {
7452 {
7453 if (ScriptInputUserData.CanStoreInputUserData())
7454 {
7455 ScriptInputUserData ctx = new ScriptInputUserData;
7460 ctx.
Write(destination_entity);
7466 }
7467 }
7468 else if (!
GetGame().IsMultiplayer())
7469 {
7471 }
7472 }
7473
7475 {
7477 }
7478
7480 {
7482 float split_quantity_new;
7484 if (dst.IsValid())
7485 {
7486 int slot_id = dst.GetSlot();
7488
7489 if (quantity > stack_max)
7490 split_quantity_new = stack_max;
7491 else
7492 split_quantity_new = quantity;
7493
7495 {
7497
7498 if (new_item)
7499 {
7500 new_item.SetResultOfSplit(true);
7501 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7503 new_item.
SetQuantity(split_quantity_new,
false,
true);
7504 }
7505
7506 return new_item;
7507 }
7508 }
7509
7510 return null;
7511 }
7512
7514 {
7516 float split_quantity_new;
7518 if (destination_entity)
7519 {
7521 if (quantity > stackable)
7522 split_quantity_new = stackable;
7523 else
7524 split_quantity_new = quantity;
7525
7527 {
7528 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7529 if (new_item)
7530 {
7531 new_item.SetResultOfSplit(true);
7532 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7534 new_item.
SetQuantity(split_quantity_new,
false,
true);
7535 }
7536 }
7537 }
7538 }
7539
7541 {
7543 {
7544 if (ScriptInputUserData.CanStoreInputUserData())
7545 {
7546 ScriptInputUserData ctx = new ScriptInputUserData;
7551 ItemBase destination_entity =
this;
7552 ctx.
Write(destination_entity);
7556 }
7557 }
7558 else if (!
GetGame().IsMultiplayer())
7559 {
7561 }
7562 }
7563
7565 {
7567 float split_quantity_new;
7569 if (player)
7570 {
7572 if (quantity > stackable)
7573 split_quantity_new = stackable;
7574 else
7575 split_quantity_new = quantity;
7576
7578 {
7579 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7580 new_item =
ItemBase.Cast(in_hands);
7581 if (new_item)
7582 {
7583 new_item.SetResultOfSplit(true);
7584 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7586 new_item.SetQuantity(split_quantity_new, false, true);
7587 }
7588 }
7589 }
7590 }
7591
7593 {
7595 float split_quantity_new = Math.Floor(quantity * 0.5);
7596
7598 return;
7599
7601
7602 if (new_item)
7603 {
7604 if (new_item.GetQuantityMax() < split_quantity_new)
7605 {
7606 split_quantity_new = new_item.GetQuantityMax();
7607 }
7608
7609 new_item.SetResultOfSplit(true);
7610 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7611
7613 {
7616 }
7617 else
7618 {
7620 new_item.
SetQuantity(split_quantity_new,
false,
true);
7621 }
7622 }
7623 }
7624
7626 {
7628 float split_quantity_new = Math.Floor(quantity / 2);
7629
7631 return;
7632
7633 InventoryLocation invloc = new InventoryLocation;
7635
7637 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7638
7639 if (new_item)
7640 {
7641 if (new_item.GetQuantityMax() < split_quantity_new)
7642 {
7643 split_quantity_new = new_item.GetQuantityMax();
7644 }
7646 {
7649 }
7650 else if (split_quantity_new > 1)
7651 {
7653 new_item.
SetQuantity(split_quantity_new,
false,
true);
7654 }
7655 }
7656 }
7657
7660 {
7661 SetWeightDirty();
7663
7664 if (parent)
7665 parent.OnAttachmentQuantityChangedEx(this, delta);
7666
7668 {
7670 {
7672 }
7674 {
7675 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7677 }
7678 }
7679
7680 }
7681
7684 {
7685
7686 }
7687
7690 {
7692 }
7693
7695 {
7696 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7697
7699 {
7700 if (newLevel == GameConstants.STATE_RUINED)
7701 {
7703 EntityAI parent = GetHierarchyParent();
7704 if (parent && parent.IsFireplace())
7705 {
7706 CargoBase cargo = GetInventory().GetCargo();
7707 if (cargo)
7708 {
7710 {
7712 }
7713 }
7714 }
7715 }
7716
7718 {
7719
7721 return;
7722 }
7723
7724 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7725 {
7727 }
7728 }
7729 }
7730
7731
7733 {
7734 super.OnRightClick();
7735
7737 {
7739 {
7740 if (ScriptInputUserData.CanStoreInputUserData())
7741 {
7742 EntityAI root = GetHierarchyRoot();
7743 Man playerOwner = GetHierarchyRootPlayer();
7744 InventoryLocation dst = new InventoryLocation;
7745
7746
7747 if (!playerOwner && root && root == this)
7748 {
7750 }
7751 else
7752 {
7753
7754 GetInventory().GetCurrentInventoryLocation(dst);
7756 {
7759 {
7761 }
7762 else
7763 {
7765
7766
7767 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7768 {
7770 }
7771 else
7772 {
7773 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7774 }
7775 }
7776 }
7777 }
7778
7779 ScriptInputUserData ctx = new ScriptInputUserData;
7787 }
7788 }
7789 else if (!
GetGame().IsMultiplayer())
7790 {
7792 }
7793 }
7794 }
7795
7797 {
7798 if (root)
7799 {
7800 vector m4[4];
7801 root.GetTransform(m4);
7802 dst.SetGround(this, m4);
7803 }
7804 else
7805 {
7806 GetInventory().GetCurrentInventoryLocation(dst);
7807 }
7808 }
7809
7810 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7811 {
7812
7813 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7814 return false;
7815
7816 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7817 return false;
7818
7819
7821 return false;
7822
7823
7824 Magazine mag = Magazine.Cast(this);
7825 if (mag)
7826 {
7827 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7828 return false;
7829
7830 if (stack_max_limit)
7831 {
7832 Magazine other_mag = Magazine.Cast(other_item);
7833 if (other_item)
7834 {
7835 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7836 return false;
7837 }
7838
7839 }
7840 }
7841 else
7842 {
7843
7845 return false;
7846
7848 return false;
7849 }
7850
7851 PlayerBase player = null;
7852 if (CastTo(player, GetHierarchyRootPlayer()))
7853 {
7854 if (player.GetInventory().HasAttachment(this))
7855 return false;
7856
7857 if (player.IsItemsToDelete())
7858 return false;
7859 }
7860
7861 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7862 return false;
7863
7864 int slotID;
7866 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7867 return false;
7868
7869 return true;
7870 }
7871
7873 {
7875 }
7876
7878 {
7879 return m_IsResultOfSplit;
7880 }
7881
7883 {
7884 m_IsResultOfSplit = value;
7885 }
7886
7888 {
7890 }
7891
7893 {
7894 float other_item_quantity = other_item.GetQuantity();
7895 float this_free_space;
7896
7898
7900
7901 if (other_item_quantity > this_free_space)
7902 {
7903 return this_free_space;
7904 }
7905 else
7906 {
7907 return other_item_quantity;
7908 }
7909 }
7910
7912 {
7914 }
7915
7917 {
7919 return;
7920
7921 if (!IsMagazine() && other_item)
7922 {
7924 if (quantity_used != 0)
7925 {
7926 float hp1 = GetHealth01("","");
7927 float hp2 = other_item.GetHealth01("","");
7928 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7929 hpResult = hpResult / (
GetQuantity() + quantity_used);
7930
7931 hpResult *= GetMaxHealth();
7932 Math.Round(hpResult);
7933 SetHealth("", "Health", hpResult);
7934
7936 other_item.AddQuantity(-quantity_used);
7937 }
7938 }
7940 }
7941
7943 {
7944 #ifdef SERVER
7945 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7946 GetHierarchyParent().IncreaseLifetimeUp();
7947 #endif
7948 };
7949
7951 {
7952 PlayerBase p = PlayerBase.Cast(player);
7953
7954 array<int> recipesIds = p.m_Recipes;
7955 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7956 if (moduleRecipesManager)
7957 {
7958 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7959 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7960 }
7961
7962 for (int i = 0;i < recipesIds.Count(); i++)
7963 {
7964 int key = recipesIds.Get(i);
7965 string recipeName = moduleRecipesManager.GetRecipeName(key);
7967 }
7968 }
7969
7970
7971 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
7972 {
7973 super.GetDebugActions(outputList);
7974
7975
7981
7982
7987
7992
7993
7997
7998
8000 {
8004 }
8005
8008
8009
8013
8015
8016 InventoryLocation loc = new InventoryLocation();
8017 GetInventory().GetCurrentInventoryLocation(loc);
8019 {
8020 if (Gizmo_IsSupported())
8023 }
8024
8026 }
8027
8028
8029
8030
8032 {
8033 super.OnAction(action_id, player, ctx);
8034
8036 {
8037 switch (action_id)
8038 {
8041 return true;
8044 return true;
8045 }
8046 }
8047
8049 {
8050 switch (action_id)
8051 {
8053 Delete();
8054 return true;
8055 }
8056 }
8057
8058 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8059 {
8060 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8061 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8062 PlayerBase p = PlayerBase.Cast(player);
8063 if (
EActions.RECIPES_RANGE_START < 1000)
8064 {
8065 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8066 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8067 }
8068 }
8069 #ifndef SERVER
8070 else if (action_id ==
EActions.WATCH_PLAYER)
8071 {
8072 PluginDeveloper.SetDeveloperItemClientEx(player);
8073 }
8074 #endif
8076 {
8077 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8078 {
8079 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8080 OnDebugButtonPressServer(id + 1);
8081 }
8082
8083 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8084 {
8085 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8087 }
8088
8089 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8090 {
8091 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8093 }
8094
8095 else if (action_id ==
EActions.ADD_QUANTITY)
8096 {
8097 if (IsMagazine())
8098 {
8099 Magazine mag = Magazine.Cast(this);
8100 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8101 }
8102 else
8103 {
8105 }
8106
8107 if (m_EM)
8108 {
8109 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8110 }
8111
8112 }
8113
8114 else if (action_id ==
EActions.REMOVE_QUANTITY)
8115 {
8116 if (IsMagazine())
8117 {
8118 Magazine mag2 = Magazine.Cast(this);
8119 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8120 }
8121 else
8122 {
8124 }
8125 if (m_EM)
8126 {
8127 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8128 }
8129
8130 }
8131
8132 else if (action_id ==
EActions.SET_QUANTITY_0)
8133 {
8135
8136 if (m_EM)
8137 {
8138 m_EM.SetEnergy(0);
8139 }
8140 }
8141
8142 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8143 {
8145
8146 if (m_EM)
8147 {
8148 m_EM.SetEnergy(m_EM.GetEnergyMax());
8149 }
8150 }
8151
8152 else if (action_id ==
EActions.ADD_HEALTH)
8153 {
8154 AddHealth("","",GetMaxHealth("","Health")/5);
8155 }
8156 else if (action_id ==
EActions.REMOVE_HEALTH)
8157 {
8158 AddHealth("","",-GetMaxHealth("","Health")/5);
8159 }
8160 else if (action_id ==
EActions.DESTROY_HEALTH)
8161 {
8162 SetHealth01("","",0);
8163 }
8164 else if (action_id ==
EActions.WATCH_ITEM)
8165 {
8167 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8168 #ifdef DEVELOPER
8169 SetDebugDeveloper_item(this);
8170 #endif
8171 }
8172
8173 else if (action_id ==
EActions.ADD_TEMPERATURE)
8174 {
8175 AddTemperature(20);
8176
8177 }
8178
8179 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8180 {
8181 AddTemperature(-20);
8182
8183 }
8184
8185 else if (action_id ==
EActions.FLIP_FROZEN)
8186 {
8187 SetFrozen(!GetIsFrozen());
8188
8189 }
8190
8191 else if (action_id ==
EActions.ADD_WETNESS)
8192 {
8194
8195 }
8196
8197 else if (action_id ==
EActions.REMOVE_WETNESS)
8198 {
8200
8201 }
8202
8203 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8204 {
8207
8208
8209 }
8210
8211 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8212 {
8215 }
8216
8217 else if (action_id ==
EActions.MAKE_SPECIAL)
8218 {
8219 auto debugParams = DebugSpawnParams.WithPlayer(player);
8220 OnDebugSpawnEx(debugParams);
8221 }
8222
8223 }
8224
8225
8226 return false;
8227 }
8228
8229
8230
8231
8235
8238
8239
8240
8242 {
8243 return false;
8244 }
8245
8246
8248 {
8249 return true;
8250 }
8251
8252
8254 {
8255 return true;
8256 }
8257
8258
8259
8261 {
8262 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8264 }
8265
8268 {
8269 return null;
8270 }
8271
8273 {
8274 return false;
8275 }
8276
8278 {
8279 return false;
8280 }
8281
8285
8286
8288 {
8289 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8290 return module_repairing.CanRepair(this, item_repair_kit);
8291 }
8292
8293
8294 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8295 {
8296 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8297 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8298 }
8299
8300
8302 {
8303
8304
8305
8306
8307
8308
8309
8310
8311 return 1;
8312 }
8313
8314
8315
8317 {
8319 }
8320
8321
8322
8324 {
8326 }
8327
8328
8337 {
8338 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8339
8340 if (player)
8341 {
8342 player.MessageStatus(text);
8343 }
8344 }
8345
8346
8355 {
8356 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8357
8358 if (player)
8359 {
8360 player.MessageAction(text);
8361 }
8362 }
8363
8364
8373 {
8374 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8375
8376 if (player)
8377 {
8378 player.MessageFriendly(text);
8379 }
8380 }
8381
8382
8391 {
8392 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8393
8394 if (player)
8395 {
8396 player.MessageImportant(text);
8397 }
8398 }
8399
8401 {
8402 return true;
8403 }
8404
8405
8406 override bool KindOf(
string tag)
8407 {
8408 bool found = false;
8409 string item_name = this.
GetType();
8412
8413 int array_size = item_tag_array.Count();
8414 for (int i = 0; i < array_size; i++)
8415 {
8416 if (item_tag_array.Get(i) == tag)
8417 {
8418 found = true;
8419 break;
8420 }
8421 }
8422 return found;
8423 }
8424
8425
8427 {
8428
8429 super.OnRPC(sender, rpc_type,ctx);
8430
8431
8432 switch (rpc_type)
8433 {
8434 #ifndef SERVER
8435 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8436 Param2<bool, string> p = new Param2<bool, string>(false, "");
8437
8439 return;
8440
8441 bool play = p.param1;
8442 string soundSet = p.param2;
8443
8444 if (play)
8445 {
8447 {
8449 {
8451 }
8452 }
8453 else
8454 {
8456 }
8457 }
8458 else
8459 {
8461 }
8462
8463 break;
8464 #endif
8465
8466 }
8467
8469 {
8471 }
8472 }
8473
8474
8475
8476
8478 {
8479 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8480 return plugin.GetID(
name);
8481 }
8482
8484 {
8485 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8486 return plugin.GetName(id);
8487 }
8488
8491 {
8492
8493
8494 int varFlags;
8495 if (!ctx.
Read(varFlags))
8496 return;
8497
8498 if (varFlags & ItemVariableFlags.FLOAT)
8499 {
8501 }
8502 }
8503
8505 {
8506
8507 super.SerializeNumericalVars(floats_out);
8508
8509
8510
8512 {
8514 }
8515
8517 {
8519 }
8520
8522 {
8524 }
8525
8527 {
8532 }
8533
8535 {
8537 }
8538 }
8539
8541 {
8542
8543 super.DeSerializeNumericalVars(floats);
8544
8545
8546 int index = 0;
8547 int mask = Math.Round(floats.Get(index));
8548
8549 index++;
8550
8552 {
8554 {
8556 }
8557 else
8558 {
8559 float quantity = floats.Get(index);
8561 }
8562 index++;
8563 }
8564
8566 {
8567 float wet = floats.Get(index);
8569 index++;
8570 }
8571
8573 {
8574 int liquidtype = Math.Round(floats.Get(index));
8576 index++;
8577 }
8578
8580 {
8582 index++;
8584 index++;
8586 index++;
8588 index++;
8589 }
8590
8592 {
8593 int cleanness = Math.Round(floats.Get(index));
8595 index++;
8596 }
8597 }
8598
8600 {
8601 super.WriteVarsToCTX(ctx);
8602
8603
8605 {
8607 }
8608
8610 {
8612 }
8613
8615 {
8617 }
8618
8620 {
8621 int r,g,b,a;
8627 }
8628
8630 {
8632 }
8633 }
8634
8636 {
8637 if (!super.ReadVarsFromCTX(ctx,version))
8638 return false;
8639
8640 int intValue;
8641 float value;
8642
8643 if (version < 140)
8644 {
8645 if (!ctx.
Read(intValue))
8646 return false;
8647
8648 m_VariablesMask = intValue;
8649 }
8650
8652 {
8653 if (!ctx.
Read(value))
8654 return false;
8655
8657 {
8659 }
8660 else
8661 {
8663 }
8664 }
8665
8666 if (version < 140)
8667 {
8669 {
8670 if (!ctx.
Read(value))
8671 return false;
8672 SetTemperatureDirect(value);
8673 }
8674 }
8675
8677 {
8678 if (!ctx.
Read(value))
8679 return false;
8681 }
8682
8684 {
8685 if (!ctx.
Read(intValue))
8686 return false;
8688 }
8689
8691 {
8692 int r,g,b,a;
8694 return false;
8696 return false;
8698 return false;
8700 return false;
8701
8703 }
8704
8706 {
8707 if (!ctx.
Read(intValue))
8708 return false;
8710 }
8711
8712 if (version >= 138 && version < 140)
8713 {
8715 {
8716 if (!ctx.
Read(intValue))
8717 return false;
8718 SetFrozen(intValue);
8719 }
8720 }
8721
8722 return true;
8723 }
8724
8725
8727 {
8730 {
8732 }
8733
8734 if (!super.OnStoreLoad(ctx, version))
8735 {
8737 return false;
8738 }
8739
8740 if (version >= 114)
8741 {
8742 bool hasQuickBarIndexSaved;
8743
8744 if (!ctx.
Read(hasQuickBarIndexSaved))
8745 {
8747 return false;
8748 }
8749
8750 if (hasQuickBarIndexSaved)
8751 {
8752 int itmQBIndex;
8753
8754
8755 if (!ctx.
Read(itmQBIndex))
8756 {
8758 return false;
8759 }
8760
8761 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8762 if (itmQBIndex != -1 && parentPlayer)
8763 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8764 }
8765 }
8766 else
8767 {
8768
8769 PlayerBase player;
8770 int itemQBIndex;
8771 if (version ==
int.
MAX)
8772 {
8773 if (!ctx.
Read(itemQBIndex))
8774 {
8776 return false;
8777 }
8778 }
8779 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8780 {
8781
8782 if (!ctx.
Read(itemQBIndex))
8783 {
8785 return false;
8786 }
8787 if (itemQBIndex != -1 && player)
8788 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8789 }
8790 }
8791
8792 if (version < 140)
8793 {
8794
8795 if (!LoadVariables(ctx, version))
8796 {
8798 return false;
8799 }
8800 }
8801
8802
8804 {
8806 return false;
8807 }
8808 if (version >= 132)
8809 {
8811 if (raib)
8812 {
8814 {
8816 return false;
8817 }
8818 }
8819 }
8820
8822 return true;
8823 }
8824
8825
8826
8828 {
8829 super.OnStoreSave(ctx);
8830
8831 PlayerBase player;
8832 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8833 {
8835
8836 int itemQBIndex = -1;
8837 itemQBIndex = player.FindQuickBarEntityIndex(this);
8838 ctx.
Write(itemQBIndex);
8839 }
8840 else
8841 {
8843 }
8844
8846
8848 if (raib)
8849 {
8851 }
8852 }
8853
8854
8856 {
8857 super.AfterStoreLoad();
8858
8860 {
8862 }
8863
8865 {
8868 }
8869 }
8870
8872 {
8873 super.EEOnAfterLoad();
8874
8876 {
8878 }
8879
8882 }
8883
8885 {
8886 return false;
8887 }
8888
8889
8890
8892 {
8894 {
8895 #ifdef PLATFORM_CONSOLE
8896
8898 {
8900 if (menu)
8901 {
8903 }
8904 }
8905 #endif
8906 }
8907
8909 {
8912 }
8913
8915 {
8916 SetWeightDirty();
8918 }
8920 {
8923 }
8924
8926 {
8929 }
8931 {
8934 }
8935
8936 super.OnVariablesSynchronized();
8937 }
8938
8939
8940
8942 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8943 {
8944 if (!IsServerCheck(allow_client))
8945 return false;
8946
8948 return false;
8949
8952
8953 if (value <= (min + 0.001))
8954 value = min;
8955
8956 if (value == min)
8957 {
8958 if (destroy_config)
8959 {
8960 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8961 if (dstr)
8962 {
8964 this.Delete();
8965 return true;
8966 }
8967 }
8968 else if (destroy_forced)
8969 {
8971 this.Delete();
8972 return true;
8973 }
8974
8976 }
8977
8980
8982 {
8984
8985 if (delta)
8987 }
8988
8990
8991 return false;
8992 }
8993
8994
8996 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8997 {
8999 }
9000
9002 {
9005 }
9006
9008 {
9011 }
9012
9014 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9015 {
9016 float value_clamped = Math.Clamp(value, 0, 1);
9018 SetQuantity(result, destroy_config, destroy_forced);
9019 }
9020
9021
9024 {
9026 }
9027
9029 {
9031 }
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9043 {
9044 int slot = -1;
9045 if (GetInventory())
9046 {
9047 InventoryLocation il = new InventoryLocation;
9048 GetInventory().GetCurrentInventoryLocation(il);
9050 }
9051
9053 }
9054
9056 {
9057 float quantity_max = 0;
9058
9060 {
9061 if (attSlotID != -1)
9062 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9063
9064 if (quantity_max <= 0)
9066 }
9067
9068 if (quantity_max <= 0)
9070
9071 return quantity_max;
9072 }
9073
9075 {
9077 }
9078
9080 {
9082 }
9083
9084
9086 {
9088 }
9089
9091 {
9093 }
9094
9096 {
9098 }
9099
9100
9102 {
9103
9104 float weightEx = GetWeightEx();
9105 float special = GetInventoryAndCargoWeight();
9106 return weightEx - special;
9107 }
9108
9109
9111 {
9113 }
9114
9116 {
9118 {
9119 #ifdef DEVELOPER
9120 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9121 {
9122 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9124 }
9125 #endif
9126
9128 }
9129 else if (HasEnergyManager())
9130 {
9131 #ifdef DEVELOPER
9132 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9133 {
9134 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9135 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9136 }
9137 #endif
9138 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
9139 }
9140 else
9141 {
9142 #ifdef DEVELOPER
9143 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9144 {
9145 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9146 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9147 }
9148 #endif
9149 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9150 }
9151 }
9152
9155 {
9156 int item_count = 0;
9158
9159 if (GetInventory().GetCargo() != NULL)
9160 {
9161 item_count = GetInventory().GetCargo().GetItemCount();
9162 }
9163
9164 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9165 {
9166 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9167 if (item)
9168 item_count += item.GetNumberOfItems();
9169 }
9170 return item_count;
9171 }
9172
9175 {
9176 float weight = 0;
9177 float wetness = 1;
9178 if (include_wetness)
9181 {
9182 weight = wetness * m_ConfigWeight;
9183 }
9185 {
9186 weight = 1;
9187 }
9188 return weight;
9189 }
9190
9191
9192
9194 {
9195 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9196 {
9197 GameInventory inv = GetInventory();
9198 array<EntityAI> items = new array<EntityAI>;
9200 for (int i = 0; i < items.Count(); i++)
9201 {
9203 if (item)
9204 {
9206 }
9207 }
9208 }
9209 }
9210
9211
9212
9213
9215 {
9216 float energy = 0;
9217 if (HasEnergyManager())
9218 {
9219 energy = GetCompEM().GetEnergy();
9220 }
9221 return energy;
9222 }
9223
9224
9226 {
9227 super.OnEnergyConsumed();
9228
9230 }
9231
9233 {
9234 super.OnEnergyAdded();
9235
9237 }
9238
9239
9241 {
9242 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9243 {
9245 {
9246 float energy_0to1 = GetCompEM().GetEnergy0To1();
9248 }
9249 }
9250 }
9251
9252
9254 {
9255 return ConfigGetFloat("heatIsolation");
9256 }
9257
9259 {
9261 }
9262
9264 {
9265 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9266 if (
GetGame().ConfigIsExisting(paramPath))
9268
9269 return 0.0;
9270 }
9271
9273 {
9274 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9275 if (
GetGame().ConfigIsExisting(paramPath))
9277
9278 return 0.0;
9279 }
9280
9281 override void SetWet(
float value,
bool allow_client =
false)
9282 {
9283 if (!IsServerCheck(allow_client))
9284 return;
9285
9288
9290
9291 m_VarWet = Math.Clamp(value, min, max);
9292
9294 {
9297 }
9298 }
9299
9300 override void AddWet(
float value)
9301 {
9303 }
9304
9306 {
9308 }
9309
9311 {
9313 }
9314
9316 {
9318 }
9319
9321 {
9323 }
9324
9326 {
9328 }
9329
9331 {
9334 if (newLevel != oldLevel)
9335 {
9337 }
9338 }
9339
9341 {
9342 SetWeightDirty();
9343 }
9344
9346 {
9347 return GetWetLevelInternal(
m_VarWet);
9348 }
9349
9350
9351
9353 {
9355 }
9356
9358 {
9360 }
9361
9363 {
9365 }
9366
9368 {
9370 }
9371
9372
9373
9375 {
9376 if (ConfigIsExisting("itemModelLength"))
9377 {
9378 return ConfigGetFloat("itemModelLength");
9379 }
9380 return 0;
9381 }
9382
9384 {
9385 if (ConfigIsExisting("itemAttachOffset"))
9386 {
9387 return ConfigGetFloat("itemAttachOffset");
9388 }
9389 return 0;
9390 }
9391
9392 override void SetCleanness(
int value,
bool allow_client =
false)
9393 {
9394 if (!IsServerCheck(allow_client))
9395 return;
9396
9398
9400
9403 }
9404
9406 {
9408 }
9409
9411 {
9412 return true;
9413 }
9414
9415
9416
9417
9419 {
9421 }
9422
9424 {
9426 }
9427
9428
9429
9430
9431 override void SetColor(
int r,
int g,
int b,
int a)
9432 {
9438 }
9440 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9441 {
9446 }
9447
9449 {
9451 }
9452
9455 {
9456 int r,g,b,a;
9458 r = r/255;
9459 g = g/255;
9460 b = b/255;
9461 a = a/255;
9462 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9463 }
9464
9465
9466
9467 override void SetLiquidType(
int value,
bool allow_client =
false)
9468 {
9469 if (!IsServerCheck(allow_client))
9470 return;
9471
9476 }
9477
9479 {
9480 return ConfigGetInt("varLiquidTypeInit");
9481 }
9482
9484 {
9486 }
9487
9489 {
9491 SetFrozen(false);
9492 }
9493
9496 {
9497 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9498 }
9499
9500
9503 {
9504 PlayerBase nplayer;
9505 if (PlayerBase.CastTo(nplayer, player))
9506 {
9508
9509 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9510 }
9511 }
9512
9513
9516 {
9517 PlayerBase nplayer;
9518 if (PlayerBase.CastTo(nplayer,player))
9519 {
9520
9521 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9522
9523 }
9524
9525
9526 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9527
9528
9529 if (HasEnergyManager())
9530 {
9531 GetCompEM().UpdatePlugState();
9532 }
9533 }
9534
9535
9537 {
9538 super.OnPlacementStarted(player);
9539
9541 }
9542
9543 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9544 {
9546 {
9547 m_AdminLog.OnPlacementComplete(player,
this);
9548 }
9549
9550 super.OnPlacementComplete(player, position, orientation);
9551 }
9552
9553
9554
9555
9556
9558 {
9560 {
9561 return true;
9562 }
9563 else
9564 {
9565 return false;
9566 }
9567 }
9568
9569
9571 {
9573 {
9575 }
9576 }
9577
9578
9580 {
9582 }
9583
9585 {
9587 }
9588
9589 override void InsertAgent(
int agent,
float count = 1)
9590 {
9591 if (count < 1)
9592 return;
9593
9595 }
9596
9599 {
9601 }
9602
9603
9605 {
9607 }
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9651 {
9653 return false;
9654 return true;
9655 }
9656
9658 {
9659
9661 }
9662
9663
9666 {
9667 super.CheckForRoofLimited(timeTresholdMS);
9668
9670 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9671 {
9672 m_PreviousRoofTestTime = time;
9673 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9674 }
9675 }
9676
9677
9679 {
9681 {
9682 return 0;
9683 }
9684
9685 if (GetInventory().GetAttachmentSlotsCount() != 0)
9686 {
9687 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9688 if (filter)
9689 return filter.GetProtectionLevel(type, false, system);
9690 else
9691 return 0;
9692 }
9693
9694 string subclassPath, entryName;
9695
9696 switch (type)
9697 {
9699 entryName = "biological";
9700 break;
9702 entryName = "chemical";
9703 break;
9704 default:
9705 entryName = "biological";
9706 break;
9707 }
9708
9709 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9710
9712 }
9713
9714
9715
9718 {
9719 if (!IsMagazine())
9721
9723 }
9724
9725
9726
9727
9728
9733 {
9734 return true;
9735 }
9736
9738 {
9740 }
9741
9742
9743
9744
9745
9747 {
9748 if (parent)
9749 {
9750 if (parent.IsInherited(DayZInfected))
9751 return true;
9752
9753 if (!parent.IsRuined())
9754 return true;
9755 }
9756
9757 return true;
9758 }
9759
9761 {
9762 if (!super.CanPutAsAttachment(parent))
9763 {
9764 return false;
9765 }
9766
9767 if (!IsRuined() && !parent.IsRuined())
9768 {
9769 return true;
9770 }
9771
9772 return false;
9773 }
9774
9776 {
9777
9778
9779
9780
9781 return super.CanReceiveItemIntoCargo(item);
9782 }
9783
9785 {
9786
9787
9788
9789
9790 GameInventory attachmentInv = attachment.GetInventory();
9792 {
9793 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9794 return false;
9795 }
9796
9797 InventoryLocation loc = new InventoryLocation();
9798 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9799 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9800 return false;
9801
9802 return super.CanReceiveAttachment(attachment, slotId);
9803 }
9804
9806 {
9807 if (!super.CanReleaseAttachment(attachment))
9808 return false;
9809
9810 return GetInventory().AreChildrenAccessible();
9811 }
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9834 {
9835 int id = muzzle_owner.GetMuzzleID();
9836 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9837
9838 if (WPOF_array)
9839 {
9840 for (int i = 0; i < WPOF_array.Count(); i++)
9841 {
9842 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9843
9844 if (WPOF)
9845 {
9846 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9847 }
9848 }
9849 }
9850 }
9851
9852
9854 {
9855 int id = muzzle_owner.GetMuzzleID();
9857
9858 if (WPOBE_array)
9859 {
9860 for (int i = 0; i < WPOBE_array.Count(); i++)
9861 {
9862 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9863
9864 if (WPOBE)
9865 {
9866 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9867 }
9868 }
9869 }
9870 }
9871
9872
9874 {
9875 int id = muzzle_owner.GetMuzzleID();
9876 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9877
9878 if (WPOOH_array)
9879 {
9880 for (int i = 0; i < WPOOH_array.Count(); i++)
9881 {
9882 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9883
9884 if (WPOOH)
9885 {
9886 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9887 }
9888 }
9889 }
9890 }
9891
9892
9894 {
9895 int id = muzzle_owner.GetMuzzleID();
9896 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9897
9898 if (WPOOH_array)
9899 {
9900 for (int i = 0; i < WPOOH_array.Count(); i++)
9901 {
9902 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9903
9904 if (WPOOH)
9905 {
9906 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9907 }
9908 }
9909 }
9910 }
9911
9912
9914 {
9915 int id = muzzle_owner.GetMuzzleID();
9916 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9917
9918 if (WPOOH_array)
9919 {
9920 for (int i = 0; i < WPOOH_array.Count(); i++)
9921 {
9922 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9923
9924 if (WPOOH)
9925 {
9926 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9927 }
9928 }
9929 }
9930 }
9931
9932
9933
9935 {
9937 {
9938 return true;
9939 }
9940
9941 return false;
9942 }
9943
9945 {
9947 {
9948 return true;
9949 }
9950
9951 return false;
9952 }
9953
9955 {
9957 {
9958 return true;
9959 }
9960
9961 return false;
9962 }
9963
9965 {
9966 return false;
9967 }
9968
9971 {
9972 return UATimeSpent.DEFAULT_DEPLOY;
9973 }
9974
9975
9976
9977
9979 {
9981 SetSynchDirty();
9982 }
9983
9985 {
9987 }
9988
9989
9991 {
9992 return false;
9993 }
9994
9997 {
9998 string att_type = "None";
9999
10000 if (ConfigIsExisting("soundAttType"))
10001 {
10002 att_type = ConfigGetString("soundAttType");
10003 }
10004
10006 }
10007
10009 {
10011 }
10012
10013
10014
10015
10016
10022
10024 {
10027
10029 }
10030
10031
10033 {
10035 return;
10036
10038
10041
10044
10045 SoundParameters params = new SoundParameters();
10049 }
10050
10051
10053 {
10055 return;
10056
10058 SetSynchDirty();
10059
10062 }
10063
10064
10066 {
10068 return;
10069
10071 SetSynchDirty();
10072
10075 }
10076
10078 {
10080 }
10081
10083 {
10085 }
10086
10089 {
10090 if (!
GetGame().IsDedicatedServer())
10091 {
10092 if (ConfigIsExisting("attachSoundSet"))
10093 {
10094 string cfg_path = "";
10095 string soundset = "";
10096 string type_name =
GetType();
10097
10100 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10101 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10102
10103 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10104 {
10105 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10106 {
10107 if (cfg_slot_array[i] == slot_type)
10108 {
10109 soundset = cfg_soundset_array[i];
10110 break;
10111 }
10112 }
10113 }
10114
10115 if (soundset != "")
10116 {
10117 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10119 }
10120 }
10121 }
10122 }
10123
10125 {
10126
10127 }
10128
10129 void OnApply(PlayerBase player);
10130
10132 {
10133 return 1.0;
10134 };
10135
10137 {
10139 }
10140
10142 {
10144 }
10145
10147
10149 {
10150 SetDynamicPhysicsLifeTime(0.01);
10152 }
10153
10155 {
10156 array<string> zone_names = new array<string>;
10157 GetDamageZones(zone_names);
10158 for (int i = 0; i < zone_names.Count(); i++)
10159 {
10160 SetHealthMax(zone_names.Get(i),"Health");
10161 }
10162 SetHealthMax("","Health");
10163 }
10164
10167 {
10168 float global_health = GetHealth01("","Health");
10169 array<string> zones = new array<string>;
10170 GetDamageZones(zones);
10171
10172 for (int i = 0; i < zones.Count(); i++)
10173 {
10174 SetHealth01(zones.Get(i),"Health",global_health);
10175 }
10176 }
10177
10180 {
10181 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10182 }
10183
10185 {
10186 if (!hasRootAsPlayer)
10187 {
10188 if (refParentIB)
10189 {
10190
10191 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10192 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10193
10194 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10195 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10196
10199 }
10200 else
10201 {
10202
10205 }
10206 }
10207 }
10208
10210 {
10212 {
10213 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10214 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10215 {
10216 float heatPermCoef = 1.0;
10218 while (ent)
10219 {
10220 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10221 ent = ent.GetHierarchyParent();
10222 }
10223
10224 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10225 }
10226 }
10227 }
10228
10230 {
10231
10232 EntityAI parent = GetHierarchyParent();
10233 if (!parent)
10234 {
10235 hasParent = false;
10236 hasRootAsPlayer = false;
10237 }
10238 else
10239 {
10240 hasParent = true;
10241 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10242 refParentIB =
ItemBase.Cast(parent);
10243 }
10244 }
10245
10246 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10247 {
10248
10249 }
10250
10252 {
10253
10254 return false;
10255 }
10256
10258 {
10259
10260
10261 return false;
10262 }
10263
10265 {
10266
10267 return false;
10268 }
10269
10272 {
10273 return !GetIsFrozen() &&
IsOpen();
10274 }
10275
10277 {
10278 bool hasParent = false, hasRootAsPlayer = false;
10280
10281 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10282 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10283
10284 if (wwtu || foodDecay)
10285 {
10289
10290 if (processWetness || processTemperature || processDecay)
10291 {
10293
10294 if (processWetness)
10295 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10296
10297 if (processTemperature)
10299
10300 if (processDecay)
10301 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10302 }
10303 }
10304 }
10305
10308 {
10310 }
10311
10313 {
10316
10317 return super.GetTemperatureFreezeThreshold();
10318 }
10319
10321 {
10324
10325 return super.GetTemperatureThawThreshold();
10326 }
10327
10329 {
10332
10333 return super.GetItemOverheatThreshold();
10334 }
10335
10337 {
10339 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10340
10341 return super.GetTemperatureFreezeTime();
10342 }
10343
10345 {
10347 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10348
10349 return super.GetTemperatureThawTime();
10350 }
10351
10356
10358 {
10359 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10360 }
10361
10363 {
10364 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10365 }
10366
10369 {
10371 }
10372
10374 {
10376 }
10377
10379 {
10381 }
10382
10385 {
10386 return null;
10387 }
10388
10391 {
10392 return false;
10393 }
10394
10396 {
10398 {
10401 if (!trg)
10402 {
10404 explosive = this;
10405 }
10406
10407 explosive.PairRemote(trg);
10409
10410 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10411 trg.SetPersistentPairID(persistentID);
10412 explosive.SetPersistentPairID(persistentID);
10413
10414 return true;
10415 }
10416 return false;
10417 }
10418
10421 {
10422 float ret = 1.0;
10425 ret *= GetHealth01();
10426
10427 return ret;
10428 }
10429
10430 #ifdef DEVELOPER
10431 override void SetDebugItem()
10432 {
10433 super.SetDebugItem();
10434 _itemBase = this;
10435 }
10436
10438 {
10439 string text = super.GetDebugText();
10440
10442 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10443
10444 return text;
10445 }
10446 #endif
10447
10449 {
10450 return true;
10451 }
10452
10454
10456
10458 {
10461 }
10462
10463
10471
10487}
10488
10490{
10492 if (entity)
10493 {
10494 bool is_item = entity.IsInherited(
ItemBase);
10495 if (is_item && full_quantity)
10496 {
10499 }
10500 }
10501 else
10502 {
10504 return NULL;
10505 }
10506 return entity;
10507}
10508
10510{
10511 if (item)
10512 {
10513 if (health > 0)
10514 item.SetHealth("", "", health);
10515
10516 if (item.CanHaveTemperature())
10517 {
10519 if (item.CanFreeze())
10520 item.SetFrozen(false);
10521 }
10522
10523 if (item.HasEnergyManager())
10524 {
10525 if (quantity >= 0)
10526 {
10527 item.GetCompEM().SetEnergy0To1(quantity);
10528 }
10529 else
10530 {
10532 }
10533 }
10534 else if (item.IsMagazine())
10535 {
10536 Magazine mag = Magazine.Cast(item);
10537 if (quantity >= 0)
10538 {
10539 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10540 }
10541 else
10542 {
10544 }
10545
10546 }
10547 else
10548 {
10549 if (quantity >= 0)
10550 {
10551 item.SetQuantityNormalized(quantity, false);
10552 }
10553 else
10554 {
10556 }
10557
10558 }
10559 }
10560}
10561
10562#ifdef DEVELOPER
10564#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.