5706{
5708 {
5709 return true;
5710 }
5711};
5712
5713
5714
5716{
5720
5722
5725
5726
5727
5728
5729
5738
5744
5749
5754
5775 protected bool m_IsResultOfSplit
5776
5778
5783
5784
5785
5787
5791
5792
5793
5795
5798
5799
5800
5806
5807
5815
5818
5819
5821
5822
5824
5825
5830
5831
5836
5837
5839
5840
5842 {
5847
5848 if (!
GetGame().IsDedicatedServer())
5849 {
5851 {
5853
5855 {
5857 }
5858 }
5859
5862 }
5863
5864 m_OldLocation = null;
5865
5867 {
5869 }
5870
5871 if (ConfigIsExisting("headSelectionsToHide"))
5872 {
5875 }
5876
5878 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5879 {
5881 }
5882
5884
5885 m_IsResultOfSplit = false;
5886
5888 }
5889
5891 {
5892 super.InitItemVariables();
5893
5899 m_Count = ConfigGetInt(
"count");
5900
5903
5908
5911
5916
5928
5932
5933
5936 if (ConfigIsExisting("canBeSplit"))
5937 {
5940 }
5941
5943 if (ConfigIsExisting("itemBehaviour"))
5945
5946
5949 RegisterNetSyncVariableInt("m_VarLiquidType");
5950 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5951
5952 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5953 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5954 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5955
5956 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5957 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5958 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5959 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5960
5961 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5962 RegisterNetSyncVariableBool("m_IsTakeable");
5963 RegisterNetSyncVariableBool("m_IsHologram");
5964
5967 {
5970 }
5971
5973
5975 if (ConfigIsExisting("temperaturePerQuantityWeight"))
5977
5978 }
5979
5981 {
5983 }
5984
5986 {
5989 {
5994 }
5995 }
5996
5997 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
5998 {
6000 {
6003 }
6004
6006 }
6007
6009 {
6015 }
6016
6018
6020 {
6022
6023 if (!action)
6024 {
6025 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6026 return;
6027 }
6028
6030 if (!ai)
6031 {
6033 return;
6034 }
6035
6037 if (!action_array)
6038 {
6039 action_array = new array<ActionBase_Basic>;
6041 }
6042 if (LogManager.IsActionLogEnable())
6043 {
6044 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6045 }
6046
6047 if (action_array.Find(action) != -1)
6048 {
6049 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6050 }
6051 else
6052 {
6053 action_array.Insert(action);
6054 }
6055 }
6056
6058 {
6060 ActionBase action = player.GetActionManager().GetAction(actionName);
6063
6064 if (action_array)
6065 {
6066 action_array.RemoveItem(action);
6067 }
6068 }
6069
6070
6071
6073 {
6074 ActionOverrideData overrideData = new ActionOverrideData();
6078
6080 if (!actionMap)
6081 {
6084 }
6085
6086 actionMap.Insert(this.
Type(), overrideData);
6087
6088 }
6089
6091
6093
6094
6096 {
6099
6102
6103 string config_to_search = "CfgVehicles";
6104 string muzzle_owner_config;
6105
6107 {
6108 if (IsInherited(Weapon))
6109 config_to_search = "CfgWeapons";
6110
6111 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6112
6113 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6114
6116
6117 if (config_OnFire_subclass_count > 0)
6118 {
6119 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6120
6121 for (int i = 0; i < config_OnFire_subclass_count; i++)
6122 {
6123 string particle_class = "";
6125 string config_OnFire_entry = config_OnFire_class + particle_class;
6126 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6127 WPOF_array.Insert(WPOF);
6128 }
6129
6130
6132 }
6133 }
6134
6136 {
6137 config_to_search = "CfgWeapons";
6138 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6139
6140 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6141
6143
6144 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6145 {
6146 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6147
6148 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6149 {
6150 string particle_class2 = "";
6152 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6153 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6154 WPOBE_array.Insert(WPOBE);
6155 }
6156
6157
6159 }
6160 }
6161 }
6162
6163
6165 {
6168
6170 {
6171 string config_to_search = "CfgVehicles";
6172
6173 if (IsInherited(Weapon))
6174 config_to_search = "CfgWeapons";
6175
6176 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6177 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6178
6179 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6180 {
6181
6183
6185 {
6187 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6189 return;
6190 }
6191
6194
6195
6196
6198 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6199
6200 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6201 {
6202 string particle_class = "";
6204 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6206
6207 if (entry_type == CT_CLASS)
6208 {
6209 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6210 WPOOH_array.Insert(WPOF);
6211 }
6212 }
6213
6214
6216 }
6217 }
6218 }
6219
6221 {
6223 }
6224
6226 {
6228 {
6230
6233
6236
6237 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6238 }
6239 }
6240
6242 {
6244 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6245
6247 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6248
6250 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6251
6253 {
6255 }
6256 }
6257
6259 {
6261 }
6262
6264 {
6267 else
6269
6271 {
6274 }
6275 else
6276 {
6279
6282 }
6283
6285 }
6286
6288 {
6290 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6291 }
6292
6294 {
6296 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6298 }
6299
6301 {
6303 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6304 }
6305
6307 {
6310
6311 OverheatingParticle OP = new OverheatingParticle();
6316
6318 }
6319
6321 {
6324
6325 return -1;
6326 }
6327
6329 {
6331 {
6334
6335 for (int i = count; i > 0; --i)
6336 {
6337 int id = i - 1;
6340
6343
6344 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6345 {
6346 if (p)
6347 {
6350 }
6351 }
6352 }
6353 }
6354 }
6355
6357 {
6359 {
6361 {
6362 int id = i - 1;
6364
6365 if (OP)
6366 {
6368
6369 if (p)
6370 {
6372 }
6373
6374 delete OP;
6375 }
6376 }
6377
6380 }
6381 }
6382
6385 {
6386 return 0.0;
6387 }
6388
6389
6391 {
6392 return 250;
6393 }
6394
6396 {
6397 return 0;
6398 }
6399
6402 {
6404 return true;
6405
6406 return false;
6407 }
6408
6411 {
6414
6416 {
6418 }
6419 else
6420 {
6421
6423 }
6424
6426 }
6427
6434 {
6435 return -1;
6436 }
6437
6438
6439
6440
6442 {
6444 {
6446 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6447
6448 if (r_index >= 0)
6449 {
6450 InventoryLocation r_il = new InventoryLocation;
6451 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6452
6453 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6456 {
6457 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6458 }
6460 {
6461 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6462 }
6463
6464 }
6465
6466 player.GetHumanInventory().ClearUserReservedLocation(this);
6467 }
6468
6471 }
6472
6473
6474
6475
6477 {
6478 return ItemBase.m_DebugActionsMask;
6479 }
6480
6482 {
6483 return ItemBase.m_DebugActionsMask & mask;
6484 }
6485
6487 {
6488 ItemBase.m_DebugActionsMask = mask;
6489 }
6490
6492 {
6493 ItemBase.m_DebugActionsMask |= mask;
6494 }
6495
6497 {
6498 ItemBase.m_DebugActionsMask &= ~mask;
6499 }
6500
6502 {
6504 {
6506 }
6507 else
6508 {
6510 }
6511 }
6512
6513
6515 {
6516 if (GetEconomyProfile())
6517 {
6518 float q_max = GetEconomyProfile().GetQuantityMax();
6519 if (q_max > 0)
6520 {
6521 float q_min = GetEconomyProfile().GetQuantityMin();
6522 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6523
6525 {
6526 ComponentEnergyManager comp = GetCompEM();
6528 {
6530 }
6531 }
6533 {
6535
6536 }
6537
6538 }
6539 }
6540 }
6541
6544 {
6545 EntityAI parent = GetHierarchyParent();
6546
6547 if (parent)
6548 {
6549 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6550 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6551 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6552 }
6553 }
6554
6557 {
6558 EntityAI parent = GetHierarchyParent();
6559
6560 if (parent)
6561 {
6562 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6563 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6564 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6565 }
6566 }
6567
6569 {
6570
6571
6572
6573
6575
6577 {
6578 if (ScriptInputUserData.CanStoreInputUserData())
6579 {
6580 ScriptInputUserData ctx = new ScriptInputUserData;
6586 ctx.
Write(use_stack_max);
6589
6591 {
6592 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6593 }
6594 }
6595 }
6596 else if (!
GetGame().IsMultiplayer())
6597 {
6599 }
6600 }
6601
6603 {
6605 }
6606
6608 {
6610 }
6611
6613 {
6615 }
6616
6618 {
6619
6620 return false;
6621 }
6622
6624 {
6625 return false;
6626 }
6627
6631 {
6632 return false;
6633 }
6634
6636 {
6637 return "";
6638 }
6639
6641
6643 {
6644 return false;
6645 }
6646
6648 {
6649 return true;
6650 }
6651
6652
6653
6655 {
6656 return true;
6657 }
6658
6660 {
6661 return true;
6662 }
6663
6665 {
6666 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6668 }
6669
6671 {
6673 }
6674
6676 {
6678 if (!is_being_placed)
6680 SetSynchDirty();
6681 }
6682
6683
6685
6687 {
6689 }
6690
6692 {
6694 }
6695
6697 {
6698 return 1;
6699 }
6700
6702 {
6703 return false;
6704 }
6705
6707 {
6709 SetSynchDirty();
6710 }
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6747 {
6748 super.OnMovedInsideCargo(container);
6749
6750 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6751 }
6752
6753 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6754 {
6755 super.EEItemLocationChanged(oldLoc,newLoc);
6756
6757 PlayerBase new_player = null;
6758 PlayerBase old_player = null;
6759
6760 if (newLoc.GetParent())
6761 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6762
6763 if (oldLoc.GetParent())
6764 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6765
6767 {
6768 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6769
6770 if (r_index >= 0)
6771 {
6772 InventoryLocation r_il = new InventoryLocation;
6773 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6774
6775 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6778 {
6779 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6780 }
6782 {
6783 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6784 }
6785
6786 }
6787 }
6788
6790 {
6791 if (new_player)
6792 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6793
6794 if (new_player == old_player)
6795 {
6796
6797 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6798 {
6800 {
6801 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6802 {
6803 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6804 }
6805 }
6806 else
6807 {
6808 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6809 }
6810 }
6811
6812 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6813 {
6814 int type = oldLoc.GetType();
6816 {
6817 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6818 }
6820 {
6821 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6822 }
6823 }
6824 if (!m_OldLocation)
6825 {
6826 m_OldLocation = new InventoryLocation;
6827 }
6828 m_OldLocation.Copy(oldLoc);
6829 }
6830 else
6831 {
6832 if (m_OldLocation)
6833 {
6834 m_OldLocation.Reset();
6835 }
6836 }
6837
6839 }
6840 else
6841 {
6842 if (new_player)
6843 {
6844 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6845 if (res_index >= 0)
6846 {
6847 InventoryLocation il = new InventoryLocation;
6848 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6850 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6853 {
6854 il.
GetParent().GetOnReleaseLock().Invoke(it);
6855 }
6857 {
6859 }
6860
6861 }
6862 }
6864 {
6865
6867 }
6868
6869 if (m_OldLocation)
6870 {
6871 m_OldLocation.Reset();
6872 }
6873 }
6874 }
6875
6876 override void EOnContact(IEntity other, Contact extra)
6877 {
6879 {
6880 int liquidType = -1;
6882 if (impactSpeed > 0.0)
6883 {
6885 #ifndef SERVER
6887 #else
6889 SetSynchDirty();
6890 #endif
6892 }
6893 }
6894
6895 #ifdef SERVER
6896 if (GetCompEM() && GetCompEM().IsPlugged())
6897 {
6898 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6899 GetCompEM().UnplugThis();
6900 }
6901 #endif
6902 }
6903
6905
6907 {
6909 }
6910
6912 {
6913
6914 }
6915
6917 {
6918 super.OnItemLocationChanged(old_owner, new_owner);
6919
6920 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6921 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6922
6923 if (!relatedPlayer && playerNew)
6924 relatedPlayer = playerNew;
6925
6926 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6927 {
6929 if (actionMgr)
6930 {
6931 ActionBase currentAction = actionMgr.GetRunningAction();
6932 if (currentAction)
6934 }
6935 }
6936
6937 Man ownerPlayerOld = null;
6938 Man ownerPlayerNew = null;
6939
6940 if (old_owner)
6941 {
6942 if (old_owner.
IsMan())
6943 {
6944 ownerPlayerOld = Man.Cast(old_owner);
6945 }
6946 else
6947 {
6948 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6949 }
6950 }
6951 else
6952 {
6954 {
6956
6957 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6958 {
6959 GetCompEM().UnplugThis();
6960 }
6961 }
6962 }
6963
6964 if (new_owner)
6965 {
6966 if (new_owner.
IsMan())
6967 {
6968 ownerPlayerNew = Man.Cast(new_owner);
6969 }
6970 else
6971 {
6972 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
6973 }
6974 }
6975
6976 if (ownerPlayerOld != ownerPlayerNew)
6977 {
6978 if (ownerPlayerOld)
6979 {
6980 array<EntityAI> subItemsExit = new array<EntityAI>;
6982 for (int i = 0; i < subItemsExit.Count(); i++)
6983 {
6986 }
6987 }
6988
6989 if (ownerPlayerNew)
6990 {
6991 array<EntityAI> subItemsEnter = new array<EntityAI>;
6993 for (int j = 0; j < subItemsEnter.Count(); j++)
6994 {
6997 }
6998 }
6999 }
7000 else if (ownerPlayerNew != null)
7001 {
7002 PlayerBase nplayer;
7003 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7004 {
7005 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7007 for (int k = 0; k < subItemsUpdate.Count(); k++)
7008 {
7010 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7011 }
7012 }
7013 }
7014
7015 if (old_owner)
7016 old_owner.OnChildItemRemoved(this);
7017 if (new_owner)
7018 new_owner.OnChildItemReceived(this);
7019 }
7020
7021
7023 {
7024 super.EEDelete(parent);
7025 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7026 if (player)
7027 {
7029
7030 if (player.IsAlive())
7031 {
7032 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7033 if (r_index >= 0)
7034 {
7035 InventoryLocation r_il = new InventoryLocation;
7036 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7037
7038 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7041 {
7042 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7043 }
7045 {
7046 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7047 }
7048
7049 }
7050
7051 player.RemoveQuickBarEntityShortcut(this);
7052 }
7053 }
7054 }
7055
7057 {
7058 super.EEKilled(killer);
7059
7062 {
7063 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7064 {
7065 if (IsMagazine())
7066 {
7067 if (Magazine.Cast(this).GetAmmoCount() > 0)
7068 {
7070 }
7071 }
7072 else
7073 {
7075 }
7076 }
7077 }
7078 }
7079
7081 {
7082 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7083
7084 super.OnWasAttached(parent, slot_id);
7085
7088
7090 }
7091
7093 {
7094 super.OnWasDetached(parent, slot_id);
7095
7098 }
7099
7101 {
7102 int idx;
7105
7106 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7107 if (inventory_slots.Count() < 1)
7108 {
7109 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7110 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7111 }
7112 else
7113 {
7114 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7115 }
7116
7117 idx = inventory_slots.Find(slot);
7118 if (idx < 0)
7119 return "";
7120
7121 return attach_types.Get(idx);
7122 }
7123
7125 {
7126 int idx = -1;
7127 string slot;
7128
7131
7132 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7133 if (inventory_slots.Count() < 1)
7134 {
7135 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7136 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7137 }
7138 else
7139 {
7140 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7141 if (detach_types.Count() < 1)
7142 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7143 }
7144
7145 for (int i = 0; i < inventory_slots.Count(); i++)
7146 {
7147 slot = inventory_slots.Get(i);
7148 }
7149
7150 if (slot != "")
7151 {
7152 if (detach_types.Count() == 1)
7153 idx = 0;
7154 else
7155 idx = inventory_slots.Find(slot);
7156 }
7157 if (idx < 0)
7158 return "";
7159
7160 return detach_types.Get(idx);
7161 }
7162
7164 {
7165
7167
7168
7169 float min_time = 1;
7170 float max_time = 3;
7171 float delay = Math.RandomFloat(min_time, max_time);
7172
7173 explode_timer.Run(delay, this, "DoAmmoExplosion");
7174 }
7175
7177 {
7178 Magazine magazine = Magazine.Cast(this);
7179 int pop_sounds_count = 6;
7180 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7181
7182
7183 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7184 string sound_name = pop_sounds[ sound_idx ];
7186
7187
7188 magazine.ServerAddAmmoCount(-1);
7189
7190
7191 float min_temp_to_explode = 100;
7192
7193 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7194 {
7196 }
7197 }
7198
7199
7200 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7201 {
7202 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7203
7204 const int CHANCE_DAMAGE_CARGO = 4;
7205 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7206 const int CHANCE_DAMAGE_NOTHING = 2;
7207
7209 {
7210 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7211 int chances;
7212 int rnd;
7213
7214 if (GetInventory().GetCargo())
7215 {
7216 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7217 rnd = Math.RandomInt(0,chances);
7218
7219 if (rnd < CHANCE_DAMAGE_CARGO)
7220 {
7222 }
7223 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7224 {
7226 }
7227 }
7228 else
7229 {
7230 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7231 rnd = Math.RandomInt(0,chances);
7232
7233 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7234 {
7236 }
7237 }
7238 }
7239 }
7240
7242 {
7243 if (GetInventory().GetCargo())
7244 {
7245 int item_count = GetInventory().GetCargo().GetItemCount();
7246 if (item_count > 0)
7247 {
7248 int random_pick = Math.RandomInt(0, item_count);
7250 if (!item.IsExplosive())
7251 {
7252 item.AddHealth("","",damage);
7253 return true;
7254 }
7255 }
7256 }
7257 return false;
7258 }
7259
7261 {
7262 int attachment_count = GetInventory().AttachmentCount();
7263 if (attachment_count > 0)
7264 {
7265 int random_pick = Math.RandomInt(0, attachment_count);
7266 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7267 if (!attachment.IsExplosive())
7268 {
7269 attachment.AddHealth("","",damage);
7270 return true;
7271 }
7272 }
7273 return false;
7274 }
7275
7277 {
7279 }
7280
7282 {
7284 return GetInventory().CanRemoveEntity();
7285
7286 return false;
7287 }
7288
7290 {
7292 return;
7293
7295 {
7296 if (ScriptInputUserData.CanStoreInputUserData())
7297 {
7298 ScriptInputUserData ctx = new ScriptInputUserData;
7303 ctx.
Write(destination_entity);
7307 }
7308 }
7309 else if (!
GetGame().IsMultiplayer())
7310 {
7312 }
7313 }
7314
7316 {
7318 return;
7319
7320 float split_quantity_new;
7324 InventoryLocation loc = new InventoryLocation;
7325
7326 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7327 {
7329 split_quantity_new = stack_max;
7330 else
7332
7333 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7334 if (new_item)
7335 {
7336 new_item.SetResultOfSplit(true);
7337 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7339 new_item.SetQuantity(split_quantity_new);
7340 }
7341 }
7342 else if (destination_entity && slot_id == -1)
7343 {
7344 if (quantity > stack_max)
7345 split_quantity_new = stack_max;
7346 else
7347 split_quantity_new = quantity;
7348
7350 {
7353 }
7354
7355 if (new_item)
7356 {
7357 new_item.SetResultOfSplit(true);
7358 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7360 new_item.SetQuantity(split_quantity_new);
7361 }
7362 }
7363 else
7364 {
7365 if (stack_max != 0)
7366 {
7368 {
7370 }
7371
7372 if (split_quantity_new == 0)
7373 {
7374 if (!
GetGame().IsMultiplayer())
7375 player.PhysicalPredictiveDropItem(this);
7376 else
7377 player.ServerDropEntity(this);
7378 return;
7379 }
7380
7382
7383 if (new_item)
7384 {
7385 new_item.SetResultOfSplit(true);
7386 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7388 new_item.SetQuantity(stack_max);
7389 new_item.PlaceOnSurface();
7390 }
7391 }
7392 }
7393 }
7394
7396 {
7398 return;
7399
7400 float split_quantity_new;
7404 InventoryLocation loc = new InventoryLocation;
7405
7406 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7407 {
7409 split_quantity_new = stack_max;
7410 else
7412
7413 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7414 if (new_item)
7415 {
7416 new_item.SetResultOfSplit(true);
7417 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7419 new_item.SetQuantity(split_quantity_new);
7420 }
7421 }
7422 else if (destination_entity && slot_id == -1)
7423 {
7424 if (quantity > stack_max)
7425 split_quantity_new = stack_max;
7426 else
7427 split_quantity_new = quantity;
7428
7430 {
7433 }
7434
7435 if (new_item)
7436 {
7437 new_item.SetResultOfSplit(true);
7438 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7440 new_item.SetQuantity(split_quantity_new);
7441 }
7442 }
7443 else
7444 {
7445 if (stack_max != 0)
7446 {
7448 {
7450 }
7451
7453
7454 if (new_item)
7455 {
7456 new_item.SetResultOfSplit(true);
7457 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7459 new_item.SetQuantity(stack_max);
7460 new_item.PlaceOnSurface();
7461 }
7462 }
7463 }
7464 }
7465
7467 {
7469 return;
7470
7472 {
7473 if (ScriptInputUserData.CanStoreInputUserData())
7474 {
7475 ScriptInputUserData ctx = new ScriptInputUserData;
7480 dst.WriteToContext(ctx);
7482 }
7483 }
7484 else if (!
GetGame().IsMultiplayer())
7485 {
7487 }
7488 }
7489
7491 {
7493 return;
7494
7496 {
7497 if (ScriptInputUserData.CanStoreInputUserData())
7498 {
7499 ScriptInputUserData ctx = new ScriptInputUserData;
7504 ctx.
Write(destination_entity);
7510 }
7511 }
7512 else if (!
GetGame().IsMultiplayer())
7513 {
7515 }
7516 }
7517
7519 {
7521 }
7522
7524 {
7526 return this;
7527
7529 float split_quantity_new;
7531 if (dst.IsValid())
7532 {
7533 int slot_id = dst.GetSlot();
7535
7536 if (quantity > stack_max)
7537 split_quantity_new = stack_max;
7538 else
7539 split_quantity_new = quantity;
7540
7542
7543 if (new_item)
7544 {
7545 new_item.SetResultOfSplit(true);
7546 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7549 }
7550
7551 return new_item;
7552 }
7553
7554 return null;
7555 }
7556
7558 {
7560 return;
7561
7563 float split_quantity_new;
7565 if (destination_entity)
7566 {
7568 if (quantity > stackable)
7569 split_quantity_new = stackable;
7570 else
7571 split_quantity_new = quantity;
7572
7573 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7574 if (new_item)
7575 {
7576 new_item.SetResultOfSplit(true);
7577 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7579 new_item.SetQuantity(split_quantity_new);
7580 }
7581 }
7582 }
7583
7585 {
7587 return;
7588
7590 {
7591 if (ScriptInputUserData.CanStoreInputUserData())
7592 {
7593 ScriptInputUserData ctx = new ScriptInputUserData;
7598 ItemBase destination_entity =
this;
7599 ctx.
Write(destination_entity);
7603 }
7604 }
7605 else if (!
GetGame().IsMultiplayer())
7606 {
7608 }
7609 }
7610
7612 {
7614 return;
7615
7617 float split_quantity_new;
7619 if (player)
7620 {
7622 if (quantity > stackable)
7623 split_quantity_new = stackable;
7624 else
7625 split_quantity_new = quantity;
7626
7627 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7628 new_item =
ItemBase.Cast(in_hands);
7629 if (new_item)
7630 {
7631 new_item.SetResultOfSplit(true);
7632 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7634 new_item.SetQuantity(split_quantity_new);
7635 }
7636 }
7637 }
7638
7640 {
7642 return;
7643
7645 float split_quantity_new = Math.Floor(quantity * 0.5);
7646
7648
7649 if (new_item)
7650 {
7651 if (new_item.GetQuantityMax() < split_quantity_new)
7652 {
7653 split_quantity_new = new_item.GetQuantityMax();
7654 }
7655
7656 new_item.SetResultOfSplit(true);
7657 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7658
7660 {
7663 }
7664 else
7665 {
7668 }
7669 }
7670 }
7671
7673 {
7675 return;
7676
7678 float split_quantity_new = Math.Floor(quantity / 2);
7679
7680 InventoryLocation invloc = new InventoryLocation;
7682
7684 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7685
7686 if (new_item)
7687 {
7688 if (new_item.GetQuantityMax() < split_quantity_new)
7689 {
7690 split_quantity_new = new_item.GetQuantityMax();
7691 }
7693 {
7696 }
7697 else
7698 {
7701 }
7702 }
7703 }
7704
7707 {
7708 SetWeightDirty();
7710
7711 if (parent)
7712 parent.OnAttachmentQuantityChangedEx(this, delta);
7713
7715 {
7717 {
7719 }
7721 {
7722 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7724 }
7725 }
7726
7727 }
7728
7731 {
7732
7733 }
7734
7737 {
7739 }
7740
7742 {
7743 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7744
7746 {
7747 if (newLevel == GameConstants.STATE_RUINED)
7748 {
7750 EntityAI parent = GetHierarchyParent();
7751 if (parent && parent.IsFireplace())
7752 {
7753 CargoBase cargo = GetInventory().GetCargo();
7754 if (cargo)
7755 {
7757 {
7759 }
7760 }
7761 }
7762 }
7763
7765 {
7766
7768 return;
7769 }
7770
7771 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7772 {
7774 }
7775 }
7776 }
7777
7778
7780 {
7781 super.OnRightClick();
7782
7784 {
7786 {
7787 if (ScriptInputUserData.CanStoreInputUserData())
7788 {
7789 vector m4[4];
7791
7792 EntityAI root = GetHierarchyRoot();
7793
7794 InventoryLocation dst = new InventoryLocation;
7796 {
7797 if (root)
7798 {
7799 root.GetTransform(m4);
7801 }
7802 else
7803 GetInventory().GetCurrentInventoryLocation(dst);
7804 }
7805 else
7806 {
7808
7809
7810 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7811 {
7812 if (root)
7813 {
7814 root.GetTransform(m4);
7816 }
7817 else
7818 GetInventory().GetCurrentInventoryLocation(dst);
7819 }
7820 else
7821 {
7822 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7823 }
7824 }
7825
7826 ScriptInputUserData ctx = new ScriptInputUserData;
7834 }
7835 }
7836 else if (!
GetGame().IsMultiplayer())
7837 {
7839 }
7840 }
7841 }
7842
7843 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7844 {
7845
7846 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7847 return false;
7848
7849 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7850 return false;
7851
7852
7854 return false;
7855
7856
7857 Magazine mag = Magazine.Cast(this);
7858 if (mag)
7859 {
7860 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7861 return false;
7862
7863 if (stack_max_limit)
7864 {
7865 Magazine other_mag = Magazine.Cast(other_item);
7866 if (other_item)
7867 {
7868 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7869 return false;
7870 }
7871
7872 }
7873 }
7874 else
7875 {
7876
7878 return false;
7879
7881 return false;
7882 }
7883
7884 PlayerBase player = null;
7885 if (CastTo(player, GetHierarchyRootPlayer()))
7886 {
7887 if (player.GetInventory().HasAttachment(this))
7888 return false;
7889
7890 if (player.IsItemsToDelete())
7891 return false;
7892 }
7893
7894 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7895 return false;
7896
7897 int slotID;
7899 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7900 return false;
7901
7902 return true;
7903 }
7904
7906 {
7908 }
7909
7911 {
7912 return m_IsResultOfSplit;
7913 }
7914
7916 {
7917 m_IsResultOfSplit = value;
7918 }
7919
7921 {
7923 }
7924
7926 {
7927 float other_item_quantity = other_item.GetQuantity();
7928 float this_free_space;
7929
7931
7933
7934 if (other_item_quantity > this_free_space)
7935 {
7936 return this_free_space;
7937 }
7938 else
7939 {
7940 return other_item_quantity;
7941 }
7942 }
7943
7945 {
7947 }
7948
7950 {
7952 return;
7953
7954 if (!IsMagazine() && other_item)
7955 {
7957 if (quantity_used != 0)
7958 {
7959 float hp1 = GetHealth01("","");
7960 float hp2 = other_item.GetHealth01("","");
7961 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7962 hpResult = hpResult / (
GetQuantity() + quantity_used);
7963
7964 hpResult *= GetMaxHealth();
7965 Math.Round(hpResult);
7966 SetHealth("", "Health", hpResult);
7967
7969 other_item.AddQuantity(-quantity_used);
7970 }
7971 }
7973 }
7974
7976 {
7977 #ifdef SERVER
7978 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
7979 GetHierarchyParent().IncreaseLifetimeUp();
7980 #endif
7981 };
7982
7984 {
7985 PlayerBase p = PlayerBase.Cast(player);
7986
7987 array<int> recipesIds = p.m_Recipes;
7988 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
7989 if (moduleRecipesManager)
7990 {
7991 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
7992 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
7993 }
7994
7995 for (int i = 0;i < recipesIds.Count(); i++)
7996 {
7997 int key = recipesIds.Get(i);
7998 string recipeName = moduleRecipesManager.GetRecipeName(key);
8000 }
8001 }
8002
8003
8004 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8005 {
8006 super.GetDebugActions(outputList);
8007
8008
8013
8014
8018
8022
8023
8026
8027
8029 {
8032 }
8033
8035
8038
8042 }
8043
8044
8045
8046
8048 {
8049 super.OnAction(action_id, player, ctx);
8050 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8051 {
8052 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8053 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8054 PlayerBase p = PlayerBase.Cast(player);
8055 if (
EActions.RECIPES_RANGE_START < 1000)
8056 {
8057 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8058 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8059 }
8060 }
8061 #ifndef SERVER
8062 else if (action_id ==
EActions.WATCH_PLAYER)
8063 {
8064 PluginDeveloper.SetDeveloperItemClientEx(player);
8065 }
8066 #endif
8068 {
8069 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8070 {
8071 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8072 OnDebugButtonPressServer(id + 1);
8073 }
8074
8075 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8076 {
8077 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8079 }
8080
8081 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8082 {
8083 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8085 }
8086
8087 else if (action_id ==
EActions.ADD_QUANTITY)
8088 {
8089 if (IsMagazine())
8090 {
8091 Magazine mag = Magazine.Cast(this);
8092 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8093 }
8094 else
8095 {
8097 }
8098
8099 if (m_EM)
8100 {
8101 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8102 }
8103
8104 }
8105
8106 else if (action_id ==
EActions.REMOVE_QUANTITY)
8107 {
8108 if (IsMagazine())
8109 {
8110 Magazine mag2 = Magazine.Cast(this);
8111 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8112 }
8113 else
8114 {
8116 }
8117 if (m_EM)
8118 {
8119 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8120 }
8121
8122 }
8123
8124 else if (action_id ==
EActions.SET_QUANTITY_0)
8125 {
8127
8128 if (m_EM)
8129 {
8130 m_EM.SetEnergy(0);
8131 }
8132 }
8133
8134 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8135 {
8137
8138 if (m_EM)
8139 {
8140 m_EM.SetEnergy(m_EM.GetEnergyMax());
8141 }
8142 }
8143
8144 else if (action_id ==
EActions.ADD_HEALTH)
8145 {
8146 AddHealth("","",GetMaxHealth("","Health")/5);
8147 }
8148 else if (action_id ==
EActions.REMOVE_HEALTH)
8149 {
8150 AddHealth("","",-GetMaxHealth("","Health")/5);
8151 }
8152 else if (action_id ==
EActions.DESTROY_HEALTH)
8153 {
8154 SetHealth01("","",0);
8155 }
8156 else if (action_id ==
EActions.WATCH_ITEM)
8157 {
8159 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8160 #ifdef DEVELOPER
8161 SetDebugDeveloper_item(this);
8162 #endif
8163 }
8164
8165 else if (action_id ==
EActions.ADD_TEMPERATURE)
8166 {
8167 AddTemperature(20);
8168
8169 }
8170
8171 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8172 {
8173 AddTemperature(-20);
8174
8175 }
8176
8177 else if (action_id ==
EActions.FLIP_FROZEN)
8178 {
8179 SetFrozen(!GetIsFrozen());
8180
8181 }
8182
8183 else if (action_id ==
EActions.ADD_WETNESS)
8184 {
8186
8187 }
8188
8189 else if (action_id ==
EActions.REMOVE_WETNESS)
8190 {
8192
8193 }
8194
8195 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8196 {
8199
8200
8201 }
8202
8203 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8204 {
8207 }
8208
8209 else if (action_id ==
EActions.MAKE_SPECIAL)
8210 {
8211 auto debugParams = DebugSpawnParams.WithPlayer(player);
8212 OnDebugSpawnEx(debugParams);
8213 }
8214
8215 else if (action_id ==
EActions.DELETE)
8216 {
8217 Delete();
8218 }
8219
8220 }
8221
8222
8223 return false;
8224 }
8225
8226
8227
8228
8232
8235
8236
8237
8239 {
8240 return false;
8241 }
8242
8243
8245 {
8246 return true;
8247 }
8248
8249
8251 {
8252 return true;
8253 }
8254
8255
8256
8258 {
8259 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8261 }
8262
8265 {
8266 return null;
8267 }
8268
8270 {
8271 return false;
8272 }
8273
8275 {
8276 return false;
8277 }
8278
8282
8283
8285 {
8286 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8287 return module_repairing.CanRepair(this, item_repair_kit);
8288 }
8289
8290
8291 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8292 {
8293 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8294 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8295 }
8296
8297
8299 {
8300
8301
8302
8303
8304
8305
8306
8307
8308 return 1;
8309 }
8310
8311
8312
8314 {
8316 }
8317
8318
8319
8321 {
8323 }
8324
8325
8334 {
8335 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8336
8337 if (player)
8338 {
8339 player.MessageStatus(text);
8340 }
8341 }
8342
8343
8352 {
8353 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8354
8355 if (player)
8356 {
8357 player.MessageAction(text);
8358 }
8359 }
8360
8361
8370 {
8371 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8372
8373 if (player)
8374 {
8375 player.MessageFriendly(text);
8376 }
8377 }
8378
8379
8388 {
8389 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8390
8391 if (player)
8392 {
8393 player.MessageImportant(text);
8394 }
8395 }
8396
8398 {
8399 return true;
8400 }
8401
8402
8403 override bool KindOf(
string tag)
8404 {
8405 bool found = false;
8406 string item_name = this.
GetType();
8409
8410 int array_size = item_tag_array.Count();
8411 for (int i = 0; i < array_size; i++)
8412 {
8413 if (item_tag_array.Get(i) == tag)
8414 {
8415 found = true;
8416 break;
8417 }
8418 }
8419 return found;
8420 }
8421
8422
8424 {
8425
8426 super.OnRPC(sender, rpc_type,ctx);
8427
8428
8429 switch (rpc_type)
8430 {
8431 #ifndef SERVER
8432 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8433 Param2<bool, string> p = new Param2<bool, string>(false, "");
8434
8436 return;
8437
8438 bool play = p.param1;
8439 string soundSet = p.param2;
8440
8441 if (play)
8442 {
8444 {
8446 {
8448 }
8449 }
8450 else
8451 {
8453 }
8454 }
8455 else
8456 {
8458 }
8459
8460 break;
8461 #endif
8462
8463 }
8464
8466 {
8468 }
8469 }
8470
8471
8472
8473
8475 {
8476 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8477 return plugin.GetID(
name);
8478 }
8479
8481 {
8482 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8483 return plugin.GetName(id);
8484 }
8485
8488 {
8489
8490
8491 int varFlags;
8492 if (!ctx.
Read(varFlags))
8493 return;
8494
8495 if (varFlags & ItemVariableFlags.FLOAT)
8496 {
8498 }
8499 }
8500
8502 {
8503
8504 super.SerializeNumericalVars(floats_out);
8505
8506
8507
8509 {
8511 }
8512
8514 {
8516 }
8517
8519 {
8521 }
8522
8524 {
8529 }
8530
8532 {
8534 }
8535 }
8536
8538 {
8539
8540 super.DeSerializeNumericalVars(floats);
8541
8542
8543 int index = 0;
8544 int mask = Math.Round(floats.Get(index));
8545
8546 index++;
8547
8549 {
8551 {
8553 }
8554 else
8555 {
8556 float quantity = floats.Get(index);
8558 }
8559 index++;
8560 }
8561
8563 {
8564 float wet = floats.Get(index);
8566 index++;
8567 }
8568
8570 {
8571 int liquidtype = Math.Round(floats.Get(index));
8573 index++;
8574 }
8575
8577 {
8579 index++;
8581 index++;
8583 index++;
8585 index++;
8586 }
8587
8589 {
8590 int cleanness = Math.Round(floats.Get(index));
8592 index++;
8593 }
8594 }
8595
8597 {
8598 super.WriteVarsToCTX(ctx);
8599
8600
8602 {
8604 }
8605
8607 {
8609 }
8610
8612 {
8614 }
8615
8617 {
8618 int r,g,b,a;
8624 }
8625
8627 {
8629 }
8630 }
8631
8633 {
8634 if (!super.ReadVarsFromCTX(ctx,version))
8635 return false;
8636
8637 int intValue;
8638 float value;
8639
8640 if (version < 140)
8641 {
8642 if (!ctx.
Read(intValue))
8643 return false;
8644
8645 m_VariablesMask = intValue;
8646 }
8647
8649 {
8650 if (!ctx.
Read(value))
8651 return false;
8652
8654 {
8656 }
8657 else
8658 {
8660 }
8661 }
8662
8663 if (version < 140)
8664 {
8666 {
8667 if (!ctx.
Read(value))
8668 return false;
8669 SetTemperatureDirect(value);
8670 }
8671 }
8672
8674 {
8675 if (!ctx.
Read(value))
8676 return false;
8678 }
8679
8681 {
8682 if (!ctx.
Read(intValue))
8683 return false;
8685 }
8686
8688 {
8689 int r,g,b,a;
8691 return false;
8693 return false;
8695 return false;
8697 return false;
8698
8700 }
8701
8703 {
8704 if (!ctx.
Read(intValue))
8705 return false;
8707 }
8708
8709 if (version >= 138 && version < 140)
8710 {
8712 {
8713 if (!ctx.
Read(intValue))
8714 return false;
8715 SetFrozen(intValue);
8716 }
8717 }
8718
8719 return true;
8720 }
8721
8722
8724 {
8727 {
8729 }
8730
8731 if (!super.OnStoreLoad(ctx, version))
8732 {
8734 return false;
8735 }
8736
8737 if (version >= 114)
8738 {
8739 bool hasQuickBarIndexSaved;
8740
8741 if (!ctx.
Read(hasQuickBarIndexSaved))
8742 {
8744 return false;
8745 }
8746
8747 if (hasQuickBarIndexSaved)
8748 {
8749 int itmQBIndex;
8750
8751
8752 if (!ctx.
Read(itmQBIndex))
8753 {
8755 return false;
8756 }
8757
8758 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8759 if (itmQBIndex != -1 && parentPlayer)
8760 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8761 }
8762 }
8763 else
8764 {
8765
8766 PlayerBase player;
8767 int itemQBIndex;
8768 if (version ==
int.
MAX)
8769 {
8770 if (!ctx.
Read(itemQBIndex))
8771 {
8773 return false;
8774 }
8775 }
8776 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8777 {
8778
8779 if (!ctx.
Read(itemQBIndex))
8780 {
8782 return false;
8783 }
8784 if (itemQBIndex != -1 && player)
8785 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8786 }
8787 }
8788
8789 if (version < 140)
8790 {
8791
8792 if (!LoadVariables(ctx, version))
8793 {
8795 return false;
8796 }
8797 }
8798
8799
8801 {
8803 return false;
8804 }
8805 if (version >= 132)
8806 {
8808 if (raib)
8809 {
8811 {
8813 return false;
8814 }
8815 }
8816 }
8817
8819 return true;
8820 }
8821
8822
8823
8825 {
8826 super.OnStoreSave(ctx);
8827
8828 PlayerBase player;
8829 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8830 {
8832
8833 int itemQBIndex = -1;
8834 itemQBIndex = player.FindQuickBarEntityIndex(this);
8835 ctx.
Write(itemQBIndex);
8836 }
8837 else
8838 {
8840 }
8841
8843
8845 if (raib)
8846 {
8848 }
8849 }
8850
8851
8853 {
8854 super.AfterStoreLoad();
8855
8857 {
8859 }
8860
8862 {
8865 }
8866 }
8867
8869 {
8870 super.EEOnAfterLoad();
8871
8873 {
8875 }
8876
8879 }
8880
8882 {
8883 return false;
8884 }
8885
8886
8887
8889 {
8891 {
8892 #ifdef PLATFORM_CONSOLE
8893
8895 {
8897 if (menu)
8898 {
8900 }
8901 }
8902 #endif
8903 }
8904
8906 {
8909 }
8910
8912 {
8913 SetWeightDirty();
8915 }
8917 {
8920 }
8921
8923 {
8926 }
8928 {
8931 }
8932
8933 super.OnVariablesSynchronized();
8934 }
8935
8936
8937
8939 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8940 {
8941 if (!IsServerCheck(allow_client))
8942 return false;
8943
8945 return false;
8946
8949
8950 if (value <= (min + 0.001))
8951 value = min;
8952
8953 if (value == min)
8954 {
8955 if (destroy_config)
8956 {
8957 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8958 if (dstr)
8959 {
8961 this.Delete();
8962 return true;
8963 }
8964 }
8965 else if (destroy_forced)
8966 {
8968 this.Delete();
8969 return true;
8970 }
8971
8973 }
8974
8977
8979 {
8981
8982 if (delta)
8984 }
8985
8987
8988 return false;
8989 }
8990
8991
8993 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
8994 {
8996 }
8997
8999 {
9002 }
9003
9005 {
9008 }
9009
9012 {
9013 float value_clamped = Math.Clamp(value, 0, 1);
9015 SetQuantity(result, destroy_config, destroy_forced);
9016 }
9017
9018
9021 {
9023 }
9024
9026 {
9028 }
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9040 {
9041 int slot = -1;
9042 if (GetInventory())
9043 {
9044 InventoryLocation il = new InventoryLocation;
9045 GetInventory().GetCurrentInventoryLocation(il);
9047 }
9048
9050 }
9051
9053 {
9054 float quantity_max = 0;
9055
9057 {
9058 if (attSlotID != -1)
9059 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9060
9061 if (quantity_max <= 0)
9063 }
9064
9065 if (quantity_max <= 0)
9067
9068 return quantity_max;
9069 }
9070
9072 {
9074 }
9075
9077 {
9079 }
9080
9081
9083 {
9085 }
9086
9088 {
9090 }
9091
9093 {
9095 }
9096
9097
9099 {
9100
9101 float weightEx = GetWeightEx();
9102 float special = GetInventoryAndCargoWeight();
9103 return weightEx - special;
9104 }
9105
9106
9108 {
9110 }
9111
9113 {
9115 {
9116 #ifdef DEVELOPER
9117 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9118 {
9119 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9121 }
9122 #endif
9123
9125 }
9126 else if (HasEnergyManager())
9127 {
9128 #ifdef DEVELOPER
9129 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9130 {
9131 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9132 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9133 }
9134 #endif
9135 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9136 }
9137 else
9138 {
9139 #ifdef DEVELOPER
9140 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9141 {
9142 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9143 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9144 }
9145 #endif
9146 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9147 }
9148 }
9149
9152 {
9153 int item_count = 0;
9155
9156 if (GetInventory().GetCargo() != NULL)
9157 {
9158 item_count = GetInventory().GetCargo().GetItemCount();
9159 }
9160
9161 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9162 {
9163 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9164 if (item)
9165 item_count += item.GetNumberOfItems();
9166 }
9167 return item_count;
9168 }
9169
9172 {
9173 float weight = 0;
9174 float wetness = 1;
9175 if (include_wetness)
9178 {
9179 weight = wetness * m_ConfigWeight;
9180 }
9182 {
9183 weight = 1;
9184 }
9185 return weight;
9186 }
9187
9188
9189
9191 {
9192 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9193 {
9194 GameInventory inv = GetInventory();
9195 array<EntityAI> items = new array<EntityAI>;
9197 for (int i = 0; i < items.Count(); i++)
9198 {
9200 if (item)
9201 {
9203 }
9204 }
9205 }
9206 }
9207
9208
9209
9210
9212 {
9213 float energy = 0;
9214 if (HasEnergyManager())
9215 {
9216 energy = GetCompEM().GetEnergy();
9217 }
9218 return energy;
9219 }
9220
9221
9223 {
9224 super.OnEnergyConsumed();
9225
9227 }
9228
9230 {
9231 super.OnEnergyAdded();
9232
9234 }
9235
9236
9238 {
9239 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9240 {
9242 {
9243 float energy_0to1 = GetCompEM().GetEnergy0To1();
9245 }
9246 }
9247 }
9248
9249
9251 {
9252 return ConfigGetFloat("heatIsolation");
9253 }
9254
9256 {
9258 }
9259
9261 {
9262 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9263 if (
GetGame().ConfigIsExisting(paramPath))
9265
9266 return 0.0;
9267 }
9268
9270 {
9271 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9272 if (
GetGame().ConfigIsExisting(paramPath))
9274
9275 return 0.0;
9276 }
9277
9278 override void SetWet(
float value,
bool allow_client =
false)
9279 {
9280 if (!IsServerCheck(allow_client))
9281 return;
9282
9285
9287
9288 m_VarWet = Math.Clamp(value, min, max);
9289
9291 {
9294 }
9295 }
9296
9297 override void AddWet(
float value)
9298 {
9300 }
9301
9303 {
9305 }
9306
9308 {
9310 }
9311
9313 {
9315 }
9316
9318 {
9320 }
9321
9323 {
9325 }
9326
9328 {
9331 if (newLevel != oldLevel)
9332 {
9334 }
9335 }
9336
9338 {
9339 SetWeightDirty();
9340 }
9341
9343 {
9344 return GetWetLevelInternal(
m_VarWet);
9345 }
9346
9347
9348
9350 {
9352 }
9353
9355 {
9357 }
9358
9360 {
9362 }
9363
9365 {
9367 }
9368
9369
9370
9372 {
9373 if (ConfigIsExisting("itemModelLength"))
9374 {
9375 return ConfigGetFloat("itemModelLength");
9376 }
9377 return 0;
9378 }
9379
9381 {
9382 if (ConfigIsExisting("itemAttachOffset"))
9383 {
9384 return ConfigGetFloat("itemAttachOffset");
9385 }
9386 return 0;
9387 }
9388
9389 override void SetCleanness(
int value,
bool allow_client =
false)
9390 {
9391 if (!IsServerCheck(allow_client))
9392 return;
9393
9395
9397
9400 }
9401
9403 {
9405 }
9406
9408 {
9409 return true;
9410 }
9411
9412
9413
9414
9416 {
9418 }
9419
9421 {
9423 }
9424
9425
9426
9427
9428 override void SetColor(
int r,
int g,
int b,
int a)
9429 {
9435 }
9437 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9438 {
9443 }
9444
9446 {
9448 }
9449
9452 {
9453 int r,g,b,a;
9455 r = r/255;
9456 g = g/255;
9457 b = b/255;
9458 a = a/255;
9459 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9460 }
9461
9462
9463
9464 override void SetLiquidType(
int value,
bool allow_client =
false)
9465 {
9466 if (!IsServerCheck(allow_client))
9467 return;
9468
9473 }
9474
9476 {
9477 return ConfigGetInt("varLiquidTypeInit");
9478 }
9479
9481 {
9483 }
9484
9486 {
9488 SetFrozen(false);
9489 }
9490
9493 {
9494 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9495 }
9496
9497
9500 {
9501 PlayerBase nplayer;
9502 if (PlayerBase.CastTo(nplayer, player))
9503 {
9505
9506 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9507 }
9508 }
9509
9510
9513 {
9514 PlayerBase nplayer;
9515 if (PlayerBase.CastTo(nplayer,player))
9516 {
9517
9518 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9519
9520 }
9521
9522
9523 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9524
9525
9526 if (HasEnergyManager())
9527 {
9528 GetCompEM().UpdatePlugState();
9529 }
9530 }
9531
9532
9534 {
9535 super.OnPlacementStarted(player);
9536
9538 }
9539
9540 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9541 {
9543 {
9544 m_AdminLog.OnPlacementComplete(player,
this);
9545 }
9546
9547 super.OnPlacementComplete(player, position, orientation);
9548 }
9549
9550
9551
9552
9553
9555 {
9557 {
9558 return true;
9559 }
9560 else
9561 {
9562 return false;
9563 }
9564 }
9565
9566
9568 {
9570 {
9572 }
9573 }
9574
9575
9577 {
9579 }
9580
9582 {
9584 }
9585
9586 override void InsertAgent(
int agent,
float count = 1)
9587 {
9588 if (count < 1)
9589 return;
9590
9592 }
9593
9596 {
9598 }
9599
9600
9602 {
9604 }
9605
9606
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
9648 {
9650 return false;
9651 return true;
9652 }
9653
9655 {
9656
9658 }
9659
9660
9663 {
9664 super.CheckForRoofLimited(timeTresholdMS);
9665
9667 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9668 {
9669 m_PreviousRoofTestTime = time;
9670 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9671 }
9672 }
9673
9674
9676 {
9678 {
9679 return 0;
9680 }
9681
9682 if (GetInventory().GetAttachmentSlotsCount() != 0)
9683 {
9684 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9685 if (filter)
9686 return filter.GetProtectionLevel(type, false, system);
9687 else
9688 return 0;
9689 }
9690
9691 string subclassPath, entryName;
9692
9693 switch (type)
9694 {
9696 entryName = "biological";
9697 break;
9699 entryName = "chemical";
9700 break;
9701 default:
9702 entryName = "biological";
9703 break;
9704 }
9705
9706 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9707
9709 }
9710
9711
9712
9715 {
9716 if (!IsMagazine())
9718
9720 }
9721
9722
9723
9724
9725
9730 {
9731 return true;
9732 }
9733
9735 {
9737 }
9738
9739
9740
9741
9742
9744 {
9745 if (parent)
9746 {
9747 if (parent.IsInherited(DayZInfected))
9748 return true;
9749
9750 if (!parent.IsRuined())
9751 return true;
9752 }
9753
9754 return true;
9755 }
9756
9758 {
9759 if (!super.CanPutAsAttachment(parent))
9760 {
9761 return false;
9762 }
9763
9764 if (!IsRuined() && !parent.IsRuined())
9765 {
9766 return true;
9767 }
9768
9769 return false;
9770 }
9771
9773 {
9774
9775
9776
9777
9778 return super.CanReceiveItemIntoCargo(item);
9779 }
9780
9782 {
9783
9784
9785
9786
9787 GameInventory attachmentInv = attachment.GetInventory();
9789 {
9790 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9791 return false;
9792 }
9793
9794 InventoryLocation loc = new InventoryLocation();
9795 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9796 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9797 return false;
9798
9799 return super.CanReceiveAttachment(attachment, slotId);
9800 }
9801
9803 {
9804 if (!super.CanReleaseAttachment(attachment))
9805 return false;
9806
9807 return GetInventory().AreChildrenAccessible();
9808 }
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9831 {
9832 int id = muzzle_owner.GetMuzzleID();
9833 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9834
9835 if (WPOF_array)
9836 {
9837 for (int i = 0; i < WPOF_array.Count(); i++)
9838 {
9839 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9840
9841 if (WPOF)
9842 {
9843 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9844 }
9845 }
9846 }
9847 }
9848
9849
9851 {
9852 int id = muzzle_owner.GetMuzzleID();
9854
9855 if (WPOBE_array)
9856 {
9857 for (int i = 0; i < WPOBE_array.Count(); i++)
9858 {
9859 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9860
9861 if (WPOBE)
9862 {
9863 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9864 }
9865 }
9866 }
9867 }
9868
9869
9871 {
9872 int id = muzzle_owner.GetMuzzleID();
9873 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9874
9875 if (WPOOH_array)
9876 {
9877 for (int i = 0; i < WPOOH_array.Count(); i++)
9878 {
9879 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9880
9881 if (WPOOH)
9882 {
9883 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9884 }
9885 }
9886 }
9887 }
9888
9889
9891 {
9892 int id = muzzle_owner.GetMuzzleID();
9893 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9894
9895 if (WPOOH_array)
9896 {
9897 for (int i = 0; i < WPOOH_array.Count(); i++)
9898 {
9899 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9900
9901 if (WPOOH)
9902 {
9903 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9904 }
9905 }
9906 }
9907 }
9908
9909
9911 {
9912 int id = muzzle_owner.GetMuzzleID();
9913 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9914
9915 if (WPOOH_array)
9916 {
9917 for (int i = 0; i < WPOOH_array.Count(); i++)
9918 {
9919 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9920
9921 if (WPOOH)
9922 {
9923 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9924 }
9925 }
9926 }
9927 }
9928
9929
9930
9932 {
9934 {
9935 return true;
9936 }
9937
9938 return false;
9939 }
9940
9942 {
9944 {
9945 return true;
9946 }
9947
9948 return false;
9949 }
9950
9952 {
9954 {
9955 return true;
9956 }
9957
9958 return false;
9959 }
9960
9962 {
9963 return false;
9964 }
9965
9968 {
9969 return UATimeSpent.DEFAULT_DEPLOY;
9970 }
9971
9972
9973
9974
9976 {
9978 SetSynchDirty();
9979 }
9980
9982 {
9984 }
9985
9986
9988 {
9989 return false;
9990 }
9991
9994 {
9995 string att_type = "None";
9996
9997 if (ConfigIsExisting("soundAttType"))
9998 {
9999 att_type = ConfigGetString("soundAttType");
10000 }
10001
10003 }
10004
10006 {
10008 }
10009
10010
10011
10012
10013
10017
10019 {
10022
10024 }
10025
10026
10028 {
10030 return;
10031
10033
10036
10039
10040 SoundParameters params = new SoundParameters();
10044 }
10045
10046
10048 {
10050 return;
10051
10053 SetSynchDirty();
10054
10057 }
10058
10059
10061 {
10063 return;
10064
10066 SetSynchDirty();
10067
10070 }
10071
10073 {
10075 }
10076
10078 {
10080 }
10081
10084 {
10085 if (!
GetGame().IsDedicatedServer())
10086 {
10087 if (ConfigIsExisting("attachSoundSet"))
10088 {
10089 string cfg_path = "";
10090 string soundset = "";
10091 string type_name =
GetType();
10092
10095 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10096 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10097
10098 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10099 {
10100 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10101 {
10102 if (cfg_slot_array[i] == slot_type)
10103 {
10104 soundset = cfg_soundset_array[i];
10105 break;
10106 }
10107 }
10108 }
10109
10110 if (soundset != "")
10111 {
10112 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10114 }
10115 }
10116 }
10117 }
10118
10120 {
10121
10122 }
10123
10124 void OnApply(PlayerBase player);
10125
10127 {
10128 return 1.0;
10129 };
10130
10132 {
10134 }
10135
10137 {
10139 }
10140
10142
10144 {
10145 SetDynamicPhysicsLifeTime(0.01);
10147 }
10148
10150 {
10151 array<string> zone_names = new array<string>;
10152 GetDamageZones(zone_names);
10153 for (int i = 0; i < zone_names.Count(); i++)
10154 {
10155 SetHealthMax(zone_names.Get(i),"Health");
10156 }
10157 SetHealthMax("","Health");
10158 }
10159
10162 {
10163 float global_health = GetHealth01("","Health");
10164 array<string> zones = new array<string>;
10165 GetDamageZones(zones);
10166
10167 for (int i = 0; i < zones.Count(); i++)
10168 {
10169 SetHealth01(zones.Get(i),"Health",global_health);
10170 }
10171 }
10172
10175 {
10176 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10177 }
10178
10180 {
10181 if (!hasRootAsPlayer)
10182 {
10183 if (refParentIB)
10184 {
10185
10186 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10187 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10188
10189 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10190 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10191
10194 }
10195 else
10196 {
10197
10200 }
10201 }
10202 }
10203
10205 {
10207 {
10208 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10209 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10210 {
10211 float heatPermCoef = 1.0;
10213 while (ent)
10214 {
10215 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10216 ent = ent.GetHierarchyParent();
10217 }
10218
10219 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10220 }
10221 }
10222 }
10223
10225 {
10226
10227 EntityAI parent = GetHierarchyParent();
10228 if (!parent)
10229 {
10230 hasParent = false;
10231 hasRootAsPlayer = false;
10232 }
10233 else
10234 {
10235 hasParent = true;
10236 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10237 refParentIB =
ItemBase.Cast(parent);
10238 }
10239 }
10240
10241 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10242 {
10243
10244 }
10245
10247 {
10248
10249 return false;
10250 }
10251
10253 {
10254
10255
10256 return false;
10257 }
10258
10260 {
10261
10262 return false;
10263 }
10264
10267 {
10268 return !GetIsFrozen() &&
IsOpen();
10269 }
10270
10272 {
10273 bool hasParent = false, hasRootAsPlayer = false;
10275
10276 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10277 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10278
10279 if (wwtu || foodDecay)
10280 {
10284
10285 if (processWetness || processTemperature || processDecay)
10286 {
10288
10289 if (processWetness)
10290 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10291
10292 if (processTemperature)
10294
10295 if (processDecay)
10296 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10297 }
10298 }
10299 }
10300
10303 {
10305 }
10306
10308 {
10311
10312 return super.GetTemperatureFreezeThreshold();
10313 }
10314
10316 {
10319
10320 return super.GetTemperatureThawThreshold();
10321 }
10322
10324 {
10327
10328 return super.GetItemOverheatThreshold();
10329 }
10330
10332 {
10334 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10335
10336 return super.GetTemperatureFreezeTime();
10337 }
10338
10340 {
10342 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10343
10344 return super.GetTemperatureThawTime();
10345 }
10346
10351
10353 {
10354 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10355 }
10356
10358 {
10359 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10360 }
10361
10364 {
10366 }
10367
10369 {
10371 }
10372
10374 {
10376 }
10377
10380 {
10381 return null;
10382 }
10383
10386 {
10387 return false;
10388 }
10389
10391 {
10393 {
10396 if (!trg)
10397 {
10399 explosive = this;
10400 }
10401
10402 explosive.PairRemote(trg);
10404
10405 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10406 trg.SetPersistentPairID(persistentID);
10407 explosive.SetPersistentPairID(persistentID);
10408
10409 return true;
10410 }
10411 return false;
10412 }
10413
10416 {
10417 float ret = 1.0;
10420 ret *= GetHealth01();
10421
10422 return ret;
10423 }
10424
10425 #ifdef DEVELOPER
10426 override void SetDebugItem()
10427 {
10428 super.SetDebugItem();
10429 _itemBase = this;
10430 }
10431
10433 {
10434 string text = super.GetDebugText();
10435
10437 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10438
10439 return text;
10440 }
10441 #endif
10442
10444 {
10445 return true;
10446 }
10447
10449
10451
10453 {
10456 }
10457
10458
10466
10482}
10483
10485{
10487 if (entity)
10488 {
10489 bool is_item = entity.IsInherited(
ItemBase);
10490 if (is_item && full_quantity)
10491 {
10494 }
10495 }
10496 else
10497 {
10499 return NULL;
10500 }
10501 return entity;
10502}
10503
10505{
10506 if (item)
10507 {
10508 if (health > 0)
10509 item.SetHealth("", "", health);
10510
10511 if (item.CanHaveTemperature())
10512 {
10514 if (item.CanFreeze())
10515 item.SetFrozen(false);
10516 }
10517
10518 if (item.HasEnergyManager())
10519 {
10520 if (quantity >= 0)
10521 {
10522 item.GetCompEM().SetEnergy0To1(quantity);
10523 }
10524 else
10525 {
10527 }
10528 }
10529 else if (item.IsMagazine())
10530 {
10531 Magazine mag = Magazine.Cast(item);
10532 if (quantity >= 0)
10533 {
10534 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10535 }
10536 else
10537 {
10539 }
10540
10541 }
10542 else
10543 {
10544 if (quantity >= 0)
10545 {
10546 item.SetQuantityNormalized(quantity, false);
10547 }
10548 else
10549 {
10551 }
10552
10553 }
10554 }
10555}
10556
10557#ifdef DEVELOPER
10559#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.