5735{
5737 {
5738 return true;
5739 }
5740};
5741
5742
5743
5745{
5749
5751
5754
5755
5756
5757
5758
5767
5773
5778
5783
5804 protected bool m_IsResultOfSplit
5805
5807
5812
5813
5814
5816
5820
5821
5822
5824
5827
5828
5829
5835
5836
5844
5847
5848
5850
5851
5853
5854
5859
5860
5865
5866
5868
5869
5871 {
5876
5877 if (!
GetGame().IsDedicatedServer())
5878 {
5880 {
5882
5884 {
5886 }
5887 }
5888
5891 }
5892
5893 m_OldLocation = null;
5894
5896 {
5898 }
5899
5900 if (ConfigIsExisting("headSelectionsToHide"))
5901 {
5904 }
5905
5907 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5908 {
5910 }
5911
5913
5914 m_IsResultOfSplit = false;
5915
5917 }
5918
5920 {
5921 super.InitItemVariables();
5922
5928 m_Count = ConfigGetInt(
"count");
5929
5932
5937
5940
5945
5957
5961
5962
5965 if (ConfigIsExisting("canBeSplit"))
5966 {
5969 }
5970
5972 if (ConfigIsExisting("itemBehaviour"))
5974
5975
5978 RegisterNetSyncVariableInt("m_VarLiquidType");
5979 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5980
5981 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5982 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5983 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5984
5985 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
5986 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
5987 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
5988 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
5989
5990 RegisterNetSyncVariableBool("m_IsBeingPlaced");
5991 RegisterNetSyncVariableBool("m_IsTakeable");
5992 RegisterNetSyncVariableBool("m_IsHologram");
5993
5996 {
5999 }
6000
6002
6004 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6006
6007 }
6008
6010 {
6012 }
6013
6015 {
6018 {
6023 }
6024 }
6025
6026 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6027 {
6029 {
6032 }
6033
6035 }
6036
6038 {
6044 }
6045
6047
6049 {
6051
6052 if (!action)
6053 {
6054 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6055 return;
6056 }
6057
6059 if (!ai)
6060 {
6062 return;
6063 }
6064
6066 if (!action_array)
6067 {
6068 action_array = new array<ActionBase_Basic>;
6070 }
6071 if (LogManager.IsActionLogEnable())
6072 {
6073 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6074 }
6075
6076 if (action_array.Find(action) != -1)
6077 {
6078 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6079 }
6080 else
6081 {
6082 action_array.Insert(action);
6083 }
6084 }
6085
6087 {
6089 ActionBase action = player.GetActionManager().GetAction(actionName);
6092
6093 if (action_array)
6094 {
6095 action_array.RemoveItem(action);
6096 }
6097 }
6098
6099
6100
6102 {
6103 ActionOverrideData overrideData = new ActionOverrideData();
6107
6109 if (!actionMap)
6110 {
6113 }
6114
6115 actionMap.Insert(this.
Type(), overrideData);
6116
6117 }
6118
6120
6122
6123
6125 {
6128
6131
6132 string config_to_search = "CfgVehicles";
6133 string muzzle_owner_config;
6134
6136 {
6137 if (IsInherited(Weapon))
6138 config_to_search = "CfgWeapons";
6139
6140 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6141
6142 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6143
6145
6146 if (config_OnFire_subclass_count > 0)
6147 {
6148 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6149
6150 for (int i = 0; i < config_OnFire_subclass_count; i++)
6151 {
6152 string particle_class = "";
6154 string config_OnFire_entry = config_OnFire_class + particle_class;
6155 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6156 WPOF_array.Insert(WPOF);
6157 }
6158
6159
6161 }
6162 }
6163
6165 {
6166 config_to_search = "CfgWeapons";
6167 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6168
6169 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6170
6172
6173 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6174 {
6175 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6176
6177 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6178 {
6179 string particle_class2 = "";
6181 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6182 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6183 WPOBE_array.Insert(WPOBE);
6184 }
6185
6186
6188 }
6189 }
6190 }
6191
6192
6194 {
6197
6199 {
6200 string config_to_search = "CfgVehicles";
6201
6202 if (IsInherited(Weapon))
6203 config_to_search = "CfgWeapons";
6204
6205 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6206 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6207
6208 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6209 {
6210
6212
6214 {
6216 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6218 return;
6219 }
6220
6223
6224
6225
6227 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6228
6229 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6230 {
6231 string particle_class = "";
6233 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6235
6236 if (entry_type == CT_CLASS)
6237 {
6238 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6239 WPOOH_array.Insert(WPOF);
6240 }
6241 }
6242
6243
6245 }
6246 }
6247 }
6248
6250 {
6252 }
6253
6255 {
6257 {
6259
6262
6265
6266 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6267 }
6268 }
6269
6271 {
6273 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6274
6276 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6277
6279 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6280
6282 {
6284 }
6285 }
6286
6288 {
6290 }
6291
6293 {
6296 else
6298
6300 {
6303 }
6304 else
6305 {
6308
6311 }
6312
6314 }
6315
6317 {
6319 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6320 }
6321
6323 {
6325 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6327 }
6328
6330 {
6332 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6333 }
6334
6336 {
6339
6340 OverheatingParticle OP = new OverheatingParticle();
6345
6347 }
6348
6350 {
6353
6354 return -1;
6355 }
6356
6358 {
6360 {
6363
6364 for (int i = count; i > 0; --i)
6365 {
6366 int id = i - 1;
6369
6372
6373 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6374 {
6375 if (p)
6376 {
6379 }
6380 }
6381 }
6382 }
6383 }
6384
6386 {
6388 {
6390 {
6391 int id = i - 1;
6393
6394 if (OP)
6395 {
6397
6398 if (p)
6399 {
6401 }
6402
6403 delete OP;
6404 }
6405 }
6406
6409 }
6410 }
6411
6414 {
6415 return 0.0;
6416 }
6417
6418
6420 {
6421 return 250;
6422 }
6423
6425 {
6426 return 0;
6427 }
6428
6431 {
6433 return true;
6434
6435 return false;
6436 }
6437
6440 {
6443
6445 {
6447 }
6448 else
6449 {
6450
6452 }
6453
6455 }
6456
6463 {
6464 return -1;
6465 }
6466
6467
6468
6469
6471 {
6473 {
6475 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6476
6477 if (r_index >= 0)
6478 {
6479 InventoryLocation r_il = new InventoryLocation;
6480 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6481
6482 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6485 {
6486 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6487 }
6489 {
6490 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6491 }
6492
6493 }
6494
6495 player.GetHumanInventory().ClearUserReservedLocation(this);
6496 }
6497
6500 }
6501
6502
6503
6504
6506 {
6507 return ItemBase.m_DebugActionsMask;
6508 }
6509
6511 {
6512 return ItemBase.m_DebugActionsMask & mask;
6513 }
6514
6516 {
6517 ItemBase.m_DebugActionsMask = mask;
6518 }
6519
6521 {
6522 ItemBase.m_DebugActionsMask |= mask;
6523 }
6524
6526 {
6527 ItemBase.m_DebugActionsMask &= ~mask;
6528 }
6529
6531 {
6533 {
6535 }
6536 else
6537 {
6539 }
6540 }
6541
6542
6544 {
6545 if (GetEconomyProfile())
6546 {
6547 float q_max = GetEconomyProfile().GetQuantityMax();
6548 if (q_max > 0)
6549 {
6550 float q_min = GetEconomyProfile().GetQuantityMin();
6551 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6552
6554 {
6555 ComponentEnergyManager comp = GetCompEM();
6557 {
6559 }
6560 }
6562 {
6564
6565 }
6566
6567 }
6568 }
6569 }
6570
6573 {
6574 EntityAI parent = GetHierarchyParent();
6575
6576 if (parent)
6577 {
6578 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6579 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6580 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6581 }
6582 }
6583
6586 {
6587 EntityAI parent = GetHierarchyParent();
6588
6589 if (parent)
6590 {
6591 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6592 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6593 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6594 }
6595 }
6596
6598 {
6599
6600
6601
6602
6604
6606 {
6607 if (ScriptInputUserData.CanStoreInputUserData())
6608 {
6609 ScriptInputUserData ctx = new ScriptInputUserData;
6615 ctx.
Write(use_stack_max);
6618
6620 {
6621 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6622 }
6623 }
6624 }
6625 else if (!
GetGame().IsMultiplayer())
6626 {
6628 }
6629 }
6630
6632 {
6634 }
6635
6637 {
6639 }
6640
6642 {
6644 }
6645
6647 {
6648
6649 return false;
6650 }
6651
6653 {
6654 return false;
6655 }
6656
6660 {
6661 return false;
6662 }
6663
6665 {
6666 return "";
6667 }
6668
6670
6672 {
6673 return false;
6674 }
6675
6677 {
6678 return true;
6679 }
6680
6681
6682
6684 {
6685 return true;
6686 }
6687
6689 {
6690 return true;
6691 }
6692
6694 {
6695 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6697 }
6698
6700 {
6702 }
6703
6705 {
6707 if (!is_being_placed)
6709 SetSynchDirty();
6710 }
6711
6712
6714
6716 {
6718 }
6719
6721 {
6723 }
6724
6726 {
6727 return 1;
6728 }
6729
6731 {
6732 return false;
6733 }
6734
6736 {
6738 SetSynchDirty();
6739 }
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6776 {
6777 super.OnMovedInsideCargo(container);
6778
6779 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6780 }
6781
6782 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6783 {
6784 super.EEItemLocationChanged(oldLoc,newLoc);
6785
6786 PlayerBase new_player = null;
6787 PlayerBase old_player = null;
6788
6789 if (newLoc.GetParent())
6790 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6791
6792 if (oldLoc.GetParent())
6793 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6794
6796 {
6797 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6798
6799 if (r_index >= 0)
6800 {
6801 InventoryLocation r_il = new InventoryLocation;
6802 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6803
6804 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6807 {
6808 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6809 }
6811 {
6812 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6813 }
6814
6815 }
6816 }
6817
6819 {
6820 if (new_player)
6821 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6822
6823 if (new_player == old_player)
6824 {
6825
6826 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6827 {
6829 {
6830 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6831 {
6832 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6833 }
6834 }
6835 else
6836 {
6837 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6838 }
6839 }
6840
6841 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6842 {
6843 int type = oldLoc.GetType();
6845 {
6846 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6847 }
6849 {
6850 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6851 }
6852 }
6853 if (!m_OldLocation)
6854 {
6855 m_OldLocation = new InventoryLocation;
6856 }
6857 m_OldLocation.Copy(oldLoc);
6858 }
6859 else
6860 {
6861 if (m_OldLocation)
6862 {
6863 m_OldLocation.Reset();
6864 }
6865 }
6866
6868 }
6869 else
6870 {
6871 if (new_player)
6872 {
6873 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6874 if (res_index >= 0)
6875 {
6876 InventoryLocation il = new InventoryLocation;
6877 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6879 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6882 {
6883 il.
GetParent().GetOnReleaseLock().Invoke(it);
6884 }
6886 {
6888 }
6889
6890 }
6891 }
6893 {
6894
6896 }
6897
6898 if (m_OldLocation)
6899 {
6900 m_OldLocation.Reset();
6901 }
6902 }
6903 }
6904
6905 override void EOnContact(IEntity other, Contact extra)
6906 {
6908 {
6909 int liquidType = -1;
6911 if (impactSpeed > 0.0)
6912 {
6914 #ifndef SERVER
6916 #else
6918 SetSynchDirty();
6919 #endif
6921 }
6922 }
6923
6924 #ifdef SERVER
6925 if (GetCompEM() && GetCompEM().IsPlugged())
6926 {
6927 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6928 GetCompEM().UnplugThis();
6929 }
6930 #endif
6931 }
6932
6934
6936 {
6938 }
6939
6941 {
6942
6943 }
6944
6946 {
6947 super.OnItemLocationChanged(old_owner, new_owner);
6948
6949 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6950 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6951
6952 if (!relatedPlayer && playerNew)
6953 relatedPlayer = playerNew;
6954
6955 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6956 {
6958 if (actionMgr)
6959 {
6960 ActionBase currentAction = actionMgr.GetRunningAction();
6961 if (currentAction)
6963 }
6964 }
6965
6966 Man ownerPlayerOld = null;
6967 Man ownerPlayerNew = null;
6968
6969 if (old_owner)
6970 {
6971 if (old_owner.
IsMan())
6972 {
6973 ownerPlayerOld = Man.Cast(old_owner);
6974 }
6975 else
6976 {
6977 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6978 }
6979 }
6980 else
6981 {
6983 {
6985
6986 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
6987 {
6988 GetCompEM().UnplugThis();
6989 }
6990 }
6991 }
6992
6993 if (new_owner)
6994 {
6995 if (new_owner.
IsMan())
6996 {
6997 ownerPlayerNew = Man.Cast(new_owner);
6998 }
6999 else
7000 {
7001 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7002 }
7003 }
7004
7005 if (ownerPlayerOld != ownerPlayerNew)
7006 {
7007 if (ownerPlayerOld)
7008 {
7009 array<EntityAI> subItemsExit = new array<EntityAI>;
7011 for (int i = 0; i < subItemsExit.Count(); i++)
7012 {
7015 }
7016 }
7017
7018 if (ownerPlayerNew)
7019 {
7020 array<EntityAI> subItemsEnter = new array<EntityAI>;
7022 for (int j = 0; j < subItemsEnter.Count(); j++)
7023 {
7026 }
7027 }
7028 }
7029 else if (ownerPlayerNew != null)
7030 {
7031 PlayerBase nplayer;
7032 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7033 {
7034 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7036 for (int k = 0; k < subItemsUpdate.Count(); k++)
7037 {
7039 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7040 }
7041 }
7042 }
7043
7044 if (old_owner)
7045 old_owner.OnChildItemRemoved(this);
7046 if (new_owner)
7047 new_owner.OnChildItemReceived(this);
7048 }
7049
7050
7052 {
7053 super.EEDelete(parent);
7054 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7055 if (player)
7056 {
7058
7059 if (player.IsAlive())
7060 {
7061 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7062 if (r_index >= 0)
7063 {
7064 InventoryLocation r_il = new InventoryLocation;
7065 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7066
7067 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7070 {
7071 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7072 }
7074 {
7075 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7076 }
7077
7078 }
7079
7080 player.RemoveQuickBarEntityShortcut(this);
7081 }
7082 }
7083 }
7084
7086 {
7087 super.EEKilled(killer);
7088
7091 {
7092 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7093 {
7094 if (IsMagazine())
7095 {
7096 if (Magazine.Cast(this).GetAmmoCount() > 0)
7097 {
7099 }
7100 }
7101 else
7102 {
7104 }
7105 }
7106 }
7107 }
7108
7110 {
7111 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7112
7113 super.OnWasAttached(parent, slot_id);
7114
7117
7119 }
7120
7122 {
7123 super.OnWasDetached(parent, slot_id);
7124
7127 }
7128
7130 {
7131 int idx;
7134
7135 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7136 if (inventory_slots.Count() < 1)
7137 {
7138 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7139 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7140 }
7141 else
7142 {
7143 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7144 }
7145
7146 idx = inventory_slots.Find(slot);
7147 if (idx < 0)
7148 return "";
7149
7150 return attach_types.Get(idx);
7151 }
7152
7154 {
7155 int idx = -1;
7156 string slot;
7157
7160
7161 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7162 if (inventory_slots.Count() < 1)
7163 {
7164 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7165 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7166 }
7167 else
7168 {
7169 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7170 if (detach_types.Count() < 1)
7171 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7172 }
7173
7174 for (int i = 0; i < inventory_slots.Count(); i++)
7175 {
7176 slot = inventory_slots.Get(i);
7177 }
7178
7179 if (slot != "")
7180 {
7181 if (detach_types.Count() == 1)
7182 idx = 0;
7183 else
7184 idx = inventory_slots.Find(slot);
7185 }
7186 if (idx < 0)
7187 return "";
7188
7189 return detach_types.Get(idx);
7190 }
7191
7193 {
7194
7196
7197
7198 float min_time = 1;
7199 float max_time = 3;
7200 float delay = Math.RandomFloat(min_time, max_time);
7201
7202 explode_timer.Run(delay, this, "DoAmmoExplosion");
7203 }
7204
7206 {
7207 Magazine magazine = Magazine.Cast(this);
7208 int pop_sounds_count = 6;
7209 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7210
7211
7212 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7213 string sound_name = pop_sounds[ sound_idx ];
7215
7216
7217 magazine.ServerAddAmmoCount(-1);
7218
7219
7220 float min_temp_to_explode = 100;
7221
7222 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7223 {
7225 }
7226 }
7227
7228
7229 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7230 {
7231 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7232
7233 const int CHANCE_DAMAGE_CARGO = 4;
7234 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7235 const int CHANCE_DAMAGE_NOTHING = 2;
7236
7238 {
7239 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7240 int chances;
7241 int rnd;
7242
7243 if (GetInventory().GetCargo())
7244 {
7245 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7246 rnd = Math.RandomInt(0,chances);
7247
7248 if (rnd < CHANCE_DAMAGE_CARGO)
7249 {
7251 }
7252 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7253 {
7255 }
7256 }
7257 else
7258 {
7259 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7260 rnd = Math.RandomInt(0,chances);
7261
7262 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7263 {
7265 }
7266 }
7267 }
7268 }
7269
7271 {
7272 if (GetInventory().GetCargo())
7273 {
7274 int item_count = GetInventory().GetCargo().GetItemCount();
7275 if (item_count > 0)
7276 {
7277 int random_pick = Math.RandomInt(0, item_count);
7279 if (!item.IsExplosive())
7280 {
7281 item.AddHealth("","",damage);
7282 return true;
7283 }
7284 }
7285 }
7286 return false;
7287 }
7288
7290 {
7291 int attachment_count = GetInventory().AttachmentCount();
7292 if (attachment_count > 0)
7293 {
7294 int random_pick = Math.RandomInt(0, attachment_count);
7295 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7296 if (!attachment.IsExplosive())
7297 {
7298 attachment.AddHealth("","",damage);
7299 return true;
7300 }
7301 }
7302 return false;
7303 }
7304
7306 {
7308 }
7309
7311 {
7313 return GetInventory().CanRemoveEntity();
7314
7315 return false;
7316 }
7317
7319 {
7321 return;
7322
7324 {
7325 if (ScriptInputUserData.CanStoreInputUserData())
7326 {
7327 ScriptInputUserData ctx = new ScriptInputUserData;
7332 ctx.
Write(destination_entity);
7336 }
7337 }
7338 else if (!
GetGame().IsMultiplayer())
7339 {
7341 }
7342 }
7343
7345 {
7347 return;
7348
7349 float split_quantity_new;
7353 InventoryLocation loc = new InventoryLocation;
7354
7355 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7356 {
7358 split_quantity_new = stack_max;
7359 else
7361
7362 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7363 if (new_item)
7364 {
7365 new_item.SetResultOfSplit(true);
7366 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7368 new_item.SetQuantity(split_quantity_new);
7369 }
7370 }
7371 else if (destination_entity && slot_id == -1)
7372 {
7373 if (quantity > stack_max)
7374 split_quantity_new = stack_max;
7375 else
7376 split_quantity_new = quantity;
7377
7379 {
7382 }
7383
7384 if (new_item)
7385 {
7386 new_item.SetResultOfSplit(true);
7387 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7389 new_item.SetQuantity(split_quantity_new);
7390 }
7391 }
7392 else
7393 {
7394 if (stack_max != 0)
7395 {
7397 {
7399 }
7400
7401 if (split_quantity_new == 0)
7402 {
7403 if (!
GetGame().IsMultiplayer())
7404 player.PhysicalPredictiveDropItem(this);
7405 else
7406 player.ServerDropEntity(this);
7407 return;
7408 }
7409
7411
7412 if (new_item)
7413 {
7414 new_item.SetResultOfSplit(true);
7415 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7417 new_item.SetQuantity(stack_max);
7418 new_item.PlaceOnSurface();
7419 }
7420 }
7421 }
7422 }
7423
7425 {
7427 return;
7428
7429 float split_quantity_new;
7433 InventoryLocation loc = new InventoryLocation;
7434
7435 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7436 {
7438 split_quantity_new = stack_max;
7439 else
7441
7442 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7443 if (new_item)
7444 {
7445 new_item.SetResultOfSplit(true);
7446 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7448 new_item.SetQuantity(split_quantity_new);
7449 }
7450 }
7451 else if (destination_entity && slot_id == -1)
7452 {
7453 if (quantity > stack_max)
7454 split_quantity_new = stack_max;
7455 else
7456 split_quantity_new = quantity;
7457
7459 {
7462 }
7463
7464 if (new_item)
7465 {
7466 new_item.SetResultOfSplit(true);
7467 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7469 new_item.SetQuantity(split_quantity_new);
7470 }
7471 }
7472 else
7473 {
7474 if (stack_max != 0)
7475 {
7477 {
7479 }
7480
7482
7483 if (new_item)
7484 {
7485 new_item.SetResultOfSplit(true);
7486 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7488 new_item.SetQuantity(stack_max);
7489 new_item.PlaceOnSurface();
7490 }
7491 }
7492 }
7493 }
7494
7496 {
7498 return;
7499
7501 {
7502 if (ScriptInputUserData.CanStoreInputUserData())
7503 {
7504 ScriptInputUserData ctx = new ScriptInputUserData;
7509 dst.WriteToContext(ctx);
7511 }
7512 }
7513 else if (!
GetGame().IsMultiplayer())
7514 {
7516 }
7517 }
7518
7520 {
7522 return;
7523
7525 {
7526 if (ScriptInputUserData.CanStoreInputUserData())
7527 {
7528 ScriptInputUserData ctx = new ScriptInputUserData;
7533 ctx.
Write(destination_entity);
7539 }
7540 }
7541 else if (!
GetGame().IsMultiplayer())
7542 {
7544 }
7545 }
7546
7548 {
7550 }
7551
7553 {
7555 return this;
7556
7558 float split_quantity_new;
7560 if (dst.IsValid())
7561 {
7562 int slot_id = dst.GetSlot();
7564
7565 if (quantity > stack_max)
7566 split_quantity_new = stack_max;
7567 else
7568 split_quantity_new = quantity;
7569
7571
7572 if (new_item)
7573 {
7574 new_item.SetResultOfSplit(true);
7575 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7578 }
7579
7580 return new_item;
7581 }
7582
7583 return null;
7584 }
7585
7587 {
7589 return;
7590
7592 float split_quantity_new;
7594 if (destination_entity)
7595 {
7597 if (quantity > stackable)
7598 split_quantity_new = stackable;
7599 else
7600 split_quantity_new = quantity;
7601
7602 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7603 if (new_item)
7604 {
7605 new_item.SetResultOfSplit(true);
7606 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7608 new_item.SetQuantity(split_quantity_new);
7609 }
7610 }
7611 }
7612
7614 {
7616 return;
7617
7619 {
7620 if (ScriptInputUserData.CanStoreInputUserData())
7621 {
7622 ScriptInputUserData ctx = new ScriptInputUserData;
7627 ItemBase destination_entity =
this;
7628 ctx.
Write(destination_entity);
7632 }
7633 }
7634 else if (!
GetGame().IsMultiplayer())
7635 {
7637 }
7638 }
7639
7641 {
7643 return;
7644
7646 float split_quantity_new;
7648 if (player)
7649 {
7651 if (quantity > stackable)
7652 split_quantity_new = stackable;
7653 else
7654 split_quantity_new = quantity;
7655
7656 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7657 new_item =
ItemBase.Cast(in_hands);
7658 if (new_item)
7659 {
7660 new_item.SetResultOfSplit(true);
7661 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7663 new_item.SetQuantity(split_quantity_new);
7664 }
7665 }
7666 }
7667
7669 {
7671 return;
7672
7674 float split_quantity_new = Math.Floor(quantity * 0.5);
7675
7677
7678 if (new_item)
7679 {
7680 if (new_item.GetQuantityMax() < split_quantity_new)
7681 {
7682 split_quantity_new = new_item.GetQuantityMax();
7683 }
7684
7685 new_item.SetResultOfSplit(true);
7686 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7687
7689 {
7692 }
7693 else
7694 {
7697 }
7698 }
7699 }
7700
7702 {
7704 return;
7705
7707 float split_quantity_new = Math.Floor(quantity / 2);
7708
7709 InventoryLocation invloc = new InventoryLocation;
7711
7713 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7714
7715 if (new_item)
7716 {
7717 if (new_item.GetQuantityMax() < split_quantity_new)
7718 {
7719 split_quantity_new = new_item.GetQuantityMax();
7720 }
7722 {
7725 }
7726 else
7727 {
7730 }
7731 }
7732 }
7733
7736 {
7737 SetWeightDirty();
7739
7740 if (parent)
7741 parent.OnAttachmentQuantityChangedEx(this, delta);
7742
7744 {
7746 {
7748 }
7750 {
7751 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7753 }
7754 }
7755
7756 }
7757
7760 {
7761
7762 }
7763
7766 {
7768 }
7769
7771 {
7772 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7773
7775 {
7776 if (newLevel == GameConstants.STATE_RUINED)
7777 {
7779 EntityAI parent = GetHierarchyParent();
7780 if (parent && parent.IsFireplace())
7781 {
7782 CargoBase cargo = GetInventory().GetCargo();
7783 if (cargo)
7784 {
7786 {
7788 }
7789 }
7790 }
7791 }
7792
7794 {
7795
7797 return;
7798 }
7799
7800 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7801 {
7803 }
7804 }
7805 }
7806
7807
7809 {
7810 super.OnRightClick();
7811
7813 {
7815 {
7816 if (ScriptInputUserData.CanStoreInputUserData())
7817 {
7818 vector m4[4];
7820
7821 EntityAI root = GetHierarchyRoot();
7822
7823 InventoryLocation dst = new InventoryLocation;
7825 {
7826 if (root)
7827 {
7828 root.GetTransform(m4);
7830 }
7831 else
7832 GetInventory().GetCurrentInventoryLocation(dst);
7833 }
7834 else
7835 {
7837
7838
7839 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7840 {
7841 if (root)
7842 {
7843 root.GetTransform(m4);
7845 }
7846 else
7847 GetInventory().GetCurrentInventoryLocation(dst);
7848 }
7849 else
7850 {
7851 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7852 }
7853 }
7854
7855 ScriptInputUserData ctx = new ScriptInputUserData;
7863 }
7864 }
7865 else if (!
GetGame().IsMultiplayer())
7866 {
7868 }
7869 }
7870 }
7871
7872 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7873 {
7874
7875 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7876 return false;
7877
7878 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7879 return false;
7880
7881
7883 return false;
7884
7885
7886 Magazine mag = Magazine.Cast(this);
7887 if (mag)
7888 {
7889 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7890 return false;
7891
7892 if (stack_max_limit)
7893 {
7894 Magazine other_mag = Magazine.Cast(other_item);
7895 if (other_item)
7896 {
7897 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7898 return false;
7899 }
7900
7901 }
7902 }
7903 else
7904 {
7905
7907 return false;
7908
7910 return false;
7911 }
7912
7913 PlayerBase player = null;
7914 if (CastTo(player, GetHierarchyRootPlayer()))
7915 {
7916 if (player.GetInventory().HasAttachment(this))
7917 return false;
7918
7919 if (player.IsItemsToDelete())
7920 return false;
7921 }
7922
7923 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7924 return false;
7925
7926 int slotID;
7928 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7929 return false;
7930
7931 return true;
7932 }
7933
7935 {
7937 }
7938
7940 {
7941 return m_IsResultOfSplit;
7942 }
7943
7945 {
7946 m_IsResultOfSplit = value;
7947 }
7948
7950 {
7952 }
7953
7955 {
7956 float other_item_quantity = other_item.GetQuantity();
7957 float this_free_space;
7958
7960
7962
7963 if (other_item_quantity > this_free_space)
7964 {
7965 return this_free_space;
7966 }
7967 else
7968 {
7969 return other_item_quantity;
7970 }
7971 }
7972
7974 {
7976 }
7977
7979 {
7981 return;
7982
7983 if (!IsMagazine() && other_item)
7984 {
7986 if (quantity_used != 0)
7987 {
7988 float hp1 = GetHealth01("","");
7989 float hp2 = other_item.GetHealth01("","");
7990 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
7991 hpResult = hpResult / (
GetQuantity() + quantity_used);
7992
7993 hpResult *= GetMaxHealth();
7994 Math.Round(hpResult);
7995 SetHealth("", "Health", hpResult);
7996
7998 other_item.AddQuantity(-quantity_used);
7999 }
8000 }
8002 }
8003
8005 {
8006 #ifdef SERVER
8007 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8008 GetHierarchyParent().IncreaseLifetimeUp();
8009 #endif
8010 };
8011
8013 {
8014 PlayerBase p = PlayerBase.Cast(player);
8015
8016 array<int> recipesIds = p.m_Recipes;
8017 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8018 if (moduleRecipesManager)
8019 {
8020 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8021 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8022 }
8023
8024 for (int i = 0;i < recipesIds.Count(); i++)
8025 {
8026 int key = recipesIds.Get(i);
8027 string recipeName = moduleRecipesManager.GetRecipeName(key);
8029 }
8030 }
8031
8032
8033 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8034 {
8035 super.GetDebugActions(outputList);
8036
8037
8042
8043
8047
8051
8052
8055
8056
8058 {
8061 }
8062
8064
8067
8071 }
8072
8073
8074
8075
8077 {
8078 super.OnAction(action_id, player, ctx);
8079 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8080 {
8081 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8082 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8083 PlayerBase p = PlayerBase.Cast(player);
8084 if (
EActions.RECIPES_RANGE_START < 1000)
8085 {
8086 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8087 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8088 }
8089 }
8090 #ifndef SERVER
8091 else if (action_id ==
EActions.WATCH_PLAYER)
8092 {
8093 PluginDeveloper.SetDeveloperItemClientEx(player);
8094 }
8095 #endif
8097 {
8098 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8099 {
8100 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8101 OnDebugButtonPressServer(id + 1);
8102 }
8103
8104 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8105 {
8106 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8108 }
8109
8110 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8111 {
8112 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8114 }
8115
8116 else if (action_id ==
EActions.ADD_QUANTITY)
8117 {
8118 if (IsMagazine())
8119 {
8120 Magazine mag = Magazine.Cast(this);
8121 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8122 }
8123 else
8124 {
8126 }
8127
8128 if (m_EM)
8129 {
8130 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8131 }
8132
8133 }
8134
8135 else if (action_id ==
EActions.REMOVE_QUANTITY)
8136 {
8137 if (IsMagazine())
8138 {
8139 Magazine mag2 = Magazine.Cast(this);
8140 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8141 }
8142 else
8143 {
8145 }
8146 if (m_EM)
8147 {
8148 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8149 }
8150
8151 }
8152
8153 else if (action_id ==
EActions.SET_QUANTITY_0)
8154 {
8156
8157 if (m_EM)
8158 {
8159 m_EM.SetEnergy(0);
8160 }
8161 }
8162
8163 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8164 {
8166
8167 if (m_EM)
8168 {
8169 m_EM.SetEnergy(m_EM.GetEnergyMax());
8170 }
8171 }
8172
8173 else if (action_id ==
EActions.ADD_HEALTH)
8174 {
8175 AddHealth("","",GetMaxHealth("","Health")/5);
8176 }
8177 else if (action_id ==
EActions.REMOVE_HEALTH)
8178 {
8179 AddHealth("","",-GetMaxHealth("","Health")/5);
8180 }
8181 else if (action_id ==
EActions.DESTROY_HEALTH)
8182 {
8183 SetHealth01("","",0);
8184 }
8185 else if (action_id ==
EActions.WATCH_ITEM)
8186 {
8188 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8189 #ifdef DEVELOPER
8190 SetDebugDeveloper_item(this);
8191 #endif
8192 }
8193
8194 else if (action_id ==
EActions.ADD_TEMPERATURE)
8195 {
8196 AddTemperature(20);
8197
8198 }
8199
8200 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8201 {
8202 AddTemperature(-20);
8203
8204 }
8205
8206 else if (action_id ==
EActions.FLIP_FROZEN)
8207 {
8208 SetFrozen(!GetIsFrozen());
8209
8210 }
8211
8212 else if (action_id ==
EActions.ADD_WETNESS)
8213 {
8215
8216 }
8217
8218 else if (action_id ==
EActions.REMOVE_WETNESS)
8219 {
8221
8222 }
8223
8224 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8225 {
8228
8229
8230 }
8231
8232 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8233 {
8236 }
8237
8238 else if (action_id ==
EActions.MAKE_SPECIAL)
8239 {
8240 auto debugParams = DebugSpawnParams.WithPlayer(player);
8241 OnDebugSpawnEx(debugParams);
8242 }
8243
8244 else if (action_id ==
EActions.DELETE)
8245 {
8246 Delete();
8247 }
8248
8249 }
8250
8251
8252 return false;
8253 }
8254
8255
8256
8257
8261
8264
8265
8266
8268 {
8269 return false;
8270 }
8271
8272
8274 {
8275 return true;
8276 }
8277
8278
8280 {
8281 return true;
8282 }
8283
8284
8285
8287 {
8288 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8290 }
8291
8294 {
8295 return null;
8296 }
8297
8299 {
8300 return false;
8301 }
8302
8304 {
8305 return false;
8306 }
8307
8311
8312
8314 {
8315 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8316 return module_repairing.CanRepair(this, item_repair_kit);
8317 }
8318
8319
8320 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8321 {
8322 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8323 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8324 }
8325
8326
8328 {
8329
8330
8331
8332
8333
8334
8335
8336
8337 return 1;
8338 }
8339
8340
8341
8343 {
8345 }
8346
8347
8348
8350 {
8352 }
8353
8354
8363 {
8364 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8365
8366 if (player)
8367 {
8368 player.MessageStatus(text);
8369 }
8370 }
8371
8372
8381 {
8382 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8383
8384 if (player)
8385 {
8386 player.MessageAction(text);
8387 }
8388 }
8389
8390
8399 {
8400 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8401
8402 if (player)
8403 {
8404 player.MessageFriendly(text);
8405 }
8406 }
8407
8408
8417 {
8418 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8419
8420 if (player)
8421 {
8422 player.MessageImportant(text);
8423 }
8424 }
8425
8427 {
8428 return true;
8429 }
8430
8431
8432 override bool KindOf(
string tag)
8433 {
8434 bool found = false;
8435 string item_name = this.
GetType();
8438
8439 int array_size = item_tag_array.Count();
8440 for (int i = 0; i < array_size; i++)
8441 {
8442 if (item_tag_array.Get(i) == tag)
8443 {
8444 found = true;
8445 break;
8446 }
8447 }
8448 return found;
8449 }
8450
8451
8453 {
8454
8455 super.OnRPC(sender, rpc_type,ctx);
8456
8457
8458 switch (rpc_type)
8459 {
8460 #ifndef SERVER
8461 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8462 Param2<bool, string> p = new Param2<bool, string>(false, "");
8463
8465 return;
8466
8467 bool play = p.param1;
8468 string soundSet = p.param2;
8469
8470 if (play)
8471 {
8473 {
8475 {
8477 }
8478 }
8479 else
8480 {
8482 }
8483 }
8484 else
8485 {
8487 }
8488
8489 break;
8490 #endif
8491
8492 }
8493
8495 {
8497 }
8498 }
8499
8500
8501
8502
8504 {
8505 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8506 return plugin.GetID(
name);
8507 }
8508
8510 {
8511 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8512 return plugin.GetName(id);
8513 }
8514
8517 {
8518
8519
8520 int varFlags;
8521 if (!ctx.
Read(varFlags))
8522 return;
8523
8524 if (varFlags & ItemVariableFlags.FLOAT)
8525 {
8527 }
8528 }
8529
8531 {
8532
8533 super.SerializeNumericalVars(floats_out);
8534
8535
8536
8538 {
8540 }
8541
8543 {
8545 }
8546
8548 {
8550 }
8551
8553 {
8558 }
8559
8561 {
8563 }
8564 }
8565
8567 {
8568
8569 super.DeSerializeNumericalVars(floats);
8570
8571
8572 int index = 0;
8573 int mask = Math.Round(floats.Get(index));
8574
8575 index++;
8576
8578 {
8580 {
8582 }
8583 else
8584 {
8585 float quantity = floats.Get(index);
8587 }
8588 index++;
8589 }
8590
8592 {
8593 float wet = floats.Get(index);
8595 index++;
8596 }
8597
8599 {
8600 int liquidtype = Math.Round(floats.Get(index));
8602 index++;
8603 }
8604
8606 {
8608 index++;
8610 index++;
8612 index++;
8614 index++;
8615 }
8616
8618 {
8619 int cleanness = Math.Round(floats.Get(index));
8621 index++;
8622 }
8623 }
8624
8626 {
8627 super.WriteVarsToCTX(ctx);
8628
8629
8631 {
8633 }
8634
8636 {
8638 }
8639
8641 {
8643 }
8644
8646 {
8647 int r,g,b,a;
8653 }
8654
8656 {
8658 }
8659 }
8660
8662 {
8663 if (!super.ReadVarsFromCTX(ctx,version))
8664 return false;
8665
8666 int intValue;
8667 float value;
8668
8669 if (version < 140)
8670 {
8671 if (!ctx.
Read(intValue))
8672 return false;
8673
8674 m_VariablesMask = intValue;
8675 }
8676
8678 {
8679 if (!ctx.
Read(value))
8680 return false;
8681
8683 {
8685 }
8686 else
8687 {
8689 }
8690 }
8691
8692 if (version < 140)
8693 {
8695 {
8696 if (!ctx.
Read(value))
8697 return false;
8698 SetTemperatureDirect(value);
8699 }
8700 }
8701
8703 {
8704 if (!ctx.
Read(value))
8705 return false;
8707 }
8708
8710 {
8711 if (!ctx.
Read(intValue))
8712 return false;
8714 }
8715
8717 {
8718 int r,g,b,a;
8720 return false;
8722 return false;
8724 return false;
8726 return false;
8727
8729 }
8730
8732 {
8733 if (!ctx.
Read(intValue))
8734 return false;
8736 }
8737
8738 if (version >= 138 && version < 140)
8739 {
8741 {
8742 if (!ctx.
Read(intValue))
8743 return false;
8744 SetFrozen(intValue);
8745 }
8746 }
8747
8748 return true;
8749 }
8750
8751
8753 {
8756 {
8758 }
8759
8760 if (!super.OnStoreLoad(ctx, version))
8761 {
8763 return false;
8764 }
8765
8766 if (version >= 114)
8767 {
8768 bool hasQuickBarIndexSaved;
8769
8770 if (!ctx.
Read(hasQuickBarIndexSaved))
8771 {
8773 return false;
8774 }
8775
8776 if (hasQuickBarIndexSaved)
8777 {
8778 int itmQBIndex;
8779
8780
8781 if (!ctx.
Read(itmQBIndex))
8782 {
8784 return false;
8785 }
8786
8787 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8788 if (itmQBIndex != -1 && parentPlayer)
8789 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8790 }
8791 }
8792 else
8793 {
8794
8795 PlayerBase player;
8796 int itemQBIndex;
8797 if (version ==
int.
MAX)
8798 {
8799 if (!ctx.
Read(itemQBIndex))
8800 {
8802 return false;
8803 }
8804 }
8805 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8806 {
8807
8808 if (!ctx.
Read(itemQBIndex))
8809 {
8811 return false;
8812 }
8813 if (itemQBIndex != -1 && player)
8814 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8815 }
8816 }
8817
8818 if (version < 140)
8819 {
8820
8821 if (!LoadVariables(ctx, version))
8822 {
8824 return false;
8825 }
8826 }
8827
8828
8830 {
8832 return false;
8833 }
8834 if (version >= 132)
8835 {
8837 if (raib)
8838 {
8840 {
8842 return false;
8843 }
8844 }
8845 }
8846
8848 return true;
8849 }
8850
8851
8852
8854 {
8855 super.OnStoreSave(ctx);
8856
8857 PlayerBase player;
8858 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8859 {
8861
8862 int itemQBIndex = -1;
8863 itemQBIndex = player.FindQuickBarEntityIndex(this);
8864 ctx.
Write(itemQBIndex);
8865 }
8866 else
8867 {
8869 }
8870
8872
8874 if (raib)
8875 {
8877 }
8878 }
8879
8880
8882 {
8883 super.AfterStoreLoad();
8884
8886 {
8888 }
8889
8891 {
8894 }
8895 }
8896
8898 {
8899 super.EEOnAfterLoad();
8900
8902 {
8904 }
8905
8908 }
8909
8911 {
8912 return false;
8913 }
8914
8915
8916
8918 {
8920 {
8921 #ifdef PLATFORM_CONSOLE
8922
8924 {
8926 if (menu)
8927 {
8929 }
8930 }
8931 #endif
8932 }
8933
8935 {
8938 }
8939
8941 {
8942 SetWeightDirty();
8944 }
8946 {
8949 }
8950
8952 {
8955 }
8957 {
8960 }
8961
8962 super.OnVariablesSynchronized();
8963 }
8964
8965
8966
8968 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
8969 {
8970 if (!IsServerCheck(allow_client))
8971 return false;
8972
8974 return false;
8975
8978
8979 if (value <= (min + 0.001))
8980 value = min;
8981
8982 if (value == min)
8983 {
8984 if (destroy_config)
8985 {
8986 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
8987 if (dstr)
8988 {
8990 this.Delete();
8991 return true;
8992 }
8993 }
8994 else if (destroy_forced)
8995 {
8997 this.Delete();
8998 return true;
8999 }
9000
9002 }
9003
9006
9008 {
9010
9011 if (delta)
9013 }
9014
9016
9017 return false;
9018 }
9019
9020
9022 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9023 {
9025 }
9026
9028 {
9031 }
9032
9034 {
9037 }
9038
9041 {
9042 float value_clamped = Math.Clamp(value, 0, 1);
9044 SetQuantity(result, destroy_config, destroy_forced);
9045 }
9046
9047
9050 {
9052 }
9053
9055 {
9057 }
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9069 {
9070 int slot = -1;
9071 if (GetInventory())
9072 {
9073 InventoryLocation il = new InventoryLocation;
9074 GetInventory().GetCurrentInventoryLocation(il);
9076 }
9077
9079 }
9080
9082 {
9083 float quantity_max = 0;
9084
9086 {
9087 if (attSlotID != -1)
9088 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9089
9090 if (quantity_max <= 0)
9092 }
9093
9094 if (quantity_max <= 0)
9096
9097 return quantity_max;
9098 }
9099
9101 {
9103 }
9104
9106 {
9108 }
9109
9110
9112 {
9114 }
9115
9117 {
9119 }
9120
9122 {
9124 }
9125
9126
9128 {
9129
9130 float weightEx = GetWeightEx();
9131 float special = GetInventoryAndCargoWeight();
9132 return weightEx - special;
9133 }
9134
9135
9137 {
9139 }
9140
9142 {
9144 {
9145 #ifdef DEVELOPER
9146 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9147 {
9148 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9150 }
9151 #endif
9152
9154 }
9155 else if (HasEnergyManager())
9156 {
9157 #ifdef DEVELOPER
9158 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9159 {
9160 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9161 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9162 }
9163 #endif
9164 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9165 }
9166 else
9167 {
9168 #ifdef DEVELOPER
9169 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9170 {
9171 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9172 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9173 }
9174 #endif
9175 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9176 }
9177 }
9178
9181 {
9182 int item_count = 0;
9184
9185 if (GetInventory().GetCargo() != NULL)
9186 {
9187 item_count = GetInventory().GetCargo().GetItemCount();
9188 }
9189
9190 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9191 {
9192 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9193 if (item)
9194 item_count += item.GetNumberOfItems();
9195 }
9196 return item_count;
9197 }
9198
9201 {
9202 float weight = 0;
9203 float wetness = 1;
9204 if (include_wetness)
9207 {
9208 weight = wetness * m_ConfigWeight;
9209 }
9211 {
9212 weight = 1;
9213 }
9214 return weight;
9215 }
9216
9217
9218
9220 {
9221 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9222 {
9223 GameInventory inv = GetInventory();
9224 array<EntityAI> items = new array<EntityAI>;
9226 for (int i = 0; i < items.Count(); i++)
9227 {
9229 if (item)
9230 {
9232 }
9233 }
9234 }
9235 }
9236
9237
9238
9239
9241 {
9242 float energy = 0;
9243 if (HasEnergyManager())
9244 {
9245 energy = GetCompEM().GetEnergy();
9246 }
9247 return energy;
9248 }
9249
9250
9252 {
9253 super.OnEnergyConsumed();
9254
9256 }
9257
9259 {
9260 super.OnEnergyAdded();
9261
9263 }
9264
9265
9267 {
9268 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9269 {
9271 {
9272 float energy_0to1 = GetCompEM().GetEnergy0To1();
9274 }
9275 }
9276 }
9277
9278
9280 {
9281 return ConfigGetFloat("heatIsolation");
9282 }
9283
9285 {
9287 }
9288
9290 {
9291 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9292 if (
GetGame().ConfigIsExisting(paramPath))
9294
9295 return 0.0;
9296 }
9297
9299 {
9300 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9301 if (
GetGame().ConfigIsExisting(paramPath))
9303
9304 return 0.0;
9305 }
9306
9307 override void SetWet(
float value,
bool allow_client =
false)
9308 {
9309 if (!IsServerCheck(allow_client))
9310 return;
9311
9314
9316
9317 m_VarWet = Math.Clamp(value, min, max);
9318
9320 {
9323 }
9324 }
9325
9326 override void AddWet(
float value)
9327 {
9329 }
9330
9332 {
9334 }
9335
9337 {
9339 }
9340
9342 {
9344 }
9345
9347 {
9349 }
9350
9352 {
9354 }
9355
9357 {
9360 if (newLevel != oldLevel)
9361 {
9363 }
9364 }
9365
9367 {
9368 SetWeightDirty();
9369 }
9370
9372 {
9373 return GetWetLevelInternal(
m_VarWet);
9374 }
9375
9376
9377
9379 {
9381 }
9382
9384 {
9386 }
9387
9389 {
9391 }
9392
9394 {
9396 }
9397
9398
9399
9401 {
9402 if (ConfigIsExisting("itemModelLength"))
9403 {
9404 return ConfigGetFloat("itemModelLength");
9405 }
9406 return 0;
9407 }
9408
9410 {
9411 if (ConfigIsExisting("itemAttachOffset"))
9412 {
9413 return ConfigGetFloat("itemAttachOffset");
9414 }
9415 return 0;
9416 }
9417
9418 override void SetCleanness(
int value,
bool allow_client =
false)
9419 {
9420 if (!IsServerCheck(allow_client))
9421 return;
9422
9424
9426
9429 }
9430
9432 {
9434 }
9435
9437 {
9438 return true;
9439 }
9440
9441
9442
9443
9445 {
9447 }
9448
9450 {
9452 }
9453
9454
9455
9456
9457 override void SetColor(
int r,
int g,
int b,
int a)
9458 {
9464 }
9466 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9467 {
9472 }
9473
9475 {
9477 }
9478
9481 {
9482 int r,g,b,a;
9484 r = r/255;
9485 g = g/255;
9486 b = b/255;
9487 a = a/255;
9488 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9489 }
9490
9491
9492
9493 override void SetLiquidType(
int value,
bool allow_client =
false)
9494 {
9495 if (!IsServerCheck(allow_client))
9496 return;
9497
9502 }
9503
9505 {
9506 return ConfigGetInt("varLiquidTypeInit");
9507 }
9508
9510 {
9512 }
9513
9515 {
9517 SetFrozen(false);
9518 }
9519
9522 {
9523 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9524 }
9525
9526
9529 {
9530 PlayerBase nplayer;
9531 if (PlayerBase.CastTo(nplayer, player))
9532 {
9534
9535 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9536 }
9537 }
9538
9539
9542 {
9543 PlayerBase nplayer;
9544 if (PlayerBase.CastTo(nplayer,player))
9545 {
9546
9547 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9548
9549 }
9550
9551
9552 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9553
9554
9555 if (HasEnergyManager())
9556 {
9557 GetCompEM().UpdatePlugState();
9558 }
9559 }
9560
9561
9563 {
9564 super.OnPlacementStarted(player);
9565
9567 }
9568
9569 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9570 {
9572 {
9573 m_AdminLog.OnPlacementComplete(player,
this);
9574 }
9575
9576 super.OnPlacementComplete(player, position, orientation);
9577 }
9578
9579
9580
9581
9582
9584 {
9586 {
9587 return true;
9588 }
9589 else
9590 {
9591 return false;
9592 }
9593 }
9594
9595
9597 {
9599 {
9601 }
9602 }
9603
9604
9606 {
9608 }
9609
9611 {
9613 }
9614
9615 override void InsertAgent(
int agent,
float count = 1)
9616 {
9617 if (count < 1)
9618 return;
9619
9621 }
9622
9625 {
9627 }
9628
9629
9631 {
9633 }
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9677 {
9679 return false;
9680 return true;
9681 }
9682
9684 {
9685
9687 }
9688
9689
9692 {
9693 super.CheckForRoofLimited(timeTresholdMS);
9694
9696 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9697 {
9698 m_PreviousRoofTestTime = time;
9699 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9700 }
9701 }
9702
9703
9705 {
9707 {
9708 return 0;
9709 }
9710
9711 if (GetInventory().GetAttachmentSlotsCount() != 0)
9712 {
9713 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9714 if (filter)
9715 return filter.GetProtectionLevel(type, false, system);
9716 else
9717 return 0;
9718 }
9719
9720 string subclassPath, entryName;
9721
9722 switch (type)
9723 {
9725 entryName = "biological";
9726 break;
9728 entryName = "chemical";
9729 break;
9730 default:
9731 entryName = "biological";
9732 break;
9733 }
9734
9735 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9736
9738 }
9739
9740
9741
9744 {
9745 if (!IsMagazine())
9747
9749 }
9750
9751
9752
9753
9754
9759 {
9760 return true;
9761 }
9762
9764 {
9766 }
9767
9768
9769
9770
9771
9773 {
9774 if (parent)
9775 {
9776 if (parent.IsInherited(DayZInfected))
9777 return true;
9778
9779 if (!parent.IsRuined())
9780 return true;
9781 }
9782
9783 return true;
9784 }
9785
9787 {
9788 if (!super.CanPutAsAttachment(parent))
9789 {
9790 return false;
9791 }
9792
9793 if (!IsRuined() && !parent.IsRuined())
9794 {
9795 return true;
9796 }
9797
9798 return false;
9799 }
9800
9802 {
9803
9804
9805
9806
9807 return super.CanReceiveItemIntoCargo(item);
9808 }
9809
9811 {
9812
9813
9814
9815
9816 GameInventory attachmentInv = attachment.GetInventory();
9818 {
9819 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9820 return false;
9821 }
9822
9823 InventoryLocation loc = new InventoryLocation();
9824 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9825 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9826 return false;
9827
9828 return super.CanReceiveAttachment(attachment, slotId);
9829 }
9830
9832 {
9833 if (!super.CanReleaseAttachment(attachment))
9834 return false;
9835
9836 return GetInventory().AreChildrenAccessible();
9837 }
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9860 {
9861 int id = muzzle_owner.GetMuzzleID();
9862 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9863
9864 if (WPOF_array)
9865 {
9866 for (int i = 0; i < WPOF_array.Count(); i++)
9867 {
9868 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9869
9870 if (WPOF)
9871 {
9872 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9873 }
9874 }
9875 }
9876 }
9877
9878
9880 {
9881 int id = muzzle_owner.GetMuzzleID();
9883
9884 if (WPOBE_array)
9885 {
9886 for (int i = 0; i < WPOBE_array.Count(); i++)
9887 {
9888 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9889
9890 if (WPOBE)
9891 {
9892 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9893 }
9894 }
9895 }
9896 }
9897
9898
9900 {
9901 int id = muzzle_owner.GetMuzzleID();
9902 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9903
9904 if (WPOOH_array)
9905 {
9906 for (int i = 0; i < WPOOH_array.Count(); i++)
9907 {
9908 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9909
9910 if (WPOOH)
9911 {
9912 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9913 }
9914 }
9915 }
9916 }
9917
9918
9920 {
9921 int id = muzzle_owner.GetMuzzleID();
9922 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9923
9924 if (WPOOH_array)
9925 {
9926 for (int i = 0; i < WPOOH_array.Count(); i++)
9927 {
9928 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9929
9930 if (WPOOH)
9931 {
9932 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9933 }
9934 }
9935 }
9936 }
9937
9938
9940 {
9941 int id = muzzle_owner.GetMuzzleID();
9942 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9943
9944 if (WPOOH_array)
9945 {
9946 for (int i = 0; i < WPOOH_array.Count(); i++)
9947 {
9948 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9949
9950 if (WPOOH)
9951 {
9952 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9953 }
9954 }
9955 }
9956 }
9957
9958
9959
9961 {
9963 {
9964 return true;
9965 }
9966
9967 return false;
9968 }
9969
9971 {
9973 {
9974 return true;
9975 }
9976
9977 return false;
9978 }
9979
9981 {
9983 {
9984 return true;
9985 }
9986
9987 return false;
9988 }
9989
9991 {
9992 return false;
9993 }
9994
9997 {
9998 return UATimeSpent.DEFAULT_DEPLOY;
9999 }
10000
10001
10002
10003
10005 {
10007 SetSynchDirty();
10008 }
10009
10011 {
10013 }
10014
10015
10017 {
10018 return false;
10019 }
10020
10023 {
10024 string att_type = "None";
10025
10026 if (ConfigIsExisting("soundAttType"))
10027 {
10028 att_type = ConfigGetString("soundAttType");
10029 }
10030
10032 }
10033
10035 {
10037 }
10038
10039
10040
10041
10042
10046
10048 {
10051
10053 }
10054
10055
10057 {
10059 return;
10060
10062
10065
10068
10069 SoundParameters params = new SoundParameters();
10073 }
10074
10075
10077 {
10079 return;
10080
10082 SetSynchDirty();
10083
10086 }
10087
10088
10090 {
10092 return;
10093
10095 SetSynchDirty();
10096
10099 }
10100
10102 {
10104 }
10105
10107 {
10109 }
10110
10113 {
10114 if (!
GetGame().IsDedicatedServer())
10115 {
10116 if (ConfigIsExisting("attachSoundSet"))
10117 {
10118 string cfg_path = "";
10119 string soundset = "";
10120 string type_name =
GetType();
10121
10124 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10125 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10126
10127 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10128 {
10129 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10130 {
10131 if (cfg_slot_array[i] == slot_type)
10132 {
10133 soundset = cfg_soundset_array[i];
10134 break;
10135 }
10136 }
10137 }
10138
10139 if (soundset != "")
10140 {
10141 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10143 }
10144 }
10145 }
10146 }
10147
10149 {
10150
10151 }
10152
10153 void OnApply(PlayerBase player);
10154
10156 {
10157 return 1.0;
10158 };
10159
10161 {
10163 }
10164
10166 {
10168 }
10169
10171
10173 {
10174 SetDynamicPhysicsLifeTime(0.01);
10176 }
10177
10179 {
10180 array<string> zone_names = new array<string>;
10181 GetDamageZones(zone_names);
10182 for (int i = 0; i < zone_names.Count(); i++)
10183 {
10184 SetHealthMax(zone_names.Get(i),"Health");
10185 }
10186 SetHealthMax("","Health");
10187 }
10188
10191 {
10192 float global_health = GetHealth01("","Health");
10193 array<string> zones = new array<string>;
10194 GetDamageZones(zones);
10195
10196 for (int i = 0; i < zones.Count(); i++)
10197 {
10198 SetHealth01(zones.Get(i),"Health",global_health);
10199 }
10200 }
10201
10204 {
10205 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10206 }
10207
10209 {
10210 if (!hasRootAsPlayer)
10211 {
10212 if (refParentIB)
10213 {
10214
10215 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10216 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10217
10218 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10219 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10220
10223 }
10224 else
10225 {
10226
10229 }
10230 }
10231 }
10232
10234 {
10236 {
10237 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10238 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10239 {
10240 float heatPermCoef = 1.0;
10242 while (ent)
10243 {
10244 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10245 ent = ent.GetHierarchyParent();
10246 }
10247
10248 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10249 }
10250 }
10251 }
10252
10254 {
10255
10256 EntityAI parent = GetHierarchyParent();
10257 if (!parent)
10258 {
10259 hasParent = false;
10260 hasRootAsPlayer = false;
10261 }
10262 else
10263 {
10264 hasParent = true;
10265 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10266 refParentIB =
ItemBase.Cast(parent);
10267 }
10268 }
10269
10270 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10271 {
10272
10273 }
10274
10276 {
10277
10278 return false;
10279 }
10280
10282 {
10283
10284
10285 return false;
10286 }
10287
10289 {
10290
10291 return false;
10292 }
10293
10296 {
10297 return !GetIsFrozen() &&
IsOpen();
10298 }
10299
10301 {
10302 bool hasParent = false, hasRootAsPlayer = false;
10304
10305 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10306 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10307
10308 if (wwtu || foodDecay)
10309 {
10313
10314 if (processWetness || processTemperature || processDecay)
10315 {
10317
10318 if (processWetness)
10319 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10320
10321 if (processTemperature)
10323
10324 if (processDecay)
10325 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10326 }
10327 }
10328 }
10329
10332 {
10334 }
10335
10337 {
10340
10341 return super.GetTemperatureFreezeThreshold();
10342 }
10343
10345 {
10348
10349 return super.GetTemperatureThawThreshold();
10350 }
10351
10353 {
10356
10357 return super.GetItemOverheatThreshold();
10358 }
10359
10361 {
10363 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10364
10365 return super.GetTemperatureFreezeTime();
10366 }
10367
10369 {
10371 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10372
10373 return super.GetTemperatureThawTime();
10374 }
10375
10380
10382 {
10383 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10384 }
10385
10387 {
10388 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10389 }
10390
10393 {
10395 }
10396
10398 {
10400 }
10401
10403 {
10405 }
10406
10409 {
10410 return null;
10411 }
10412
10415 {
10416 return false;
10417 }
10418
10420 {
10422 {
10425 if (!trg)
10426 {
10428 explosive = this;
10429 }
10430
10431 explosive.PairRemote(trg);
10433
10434 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10435 trg.SetPersistentPairID(persistentID);
10436 explosive.SetPersistentPairID(persistentID);
10437
10438 return true;
10439 }
10440 return false;
10441 }
10442
10445 {
10446 float ret = 1.0;
10449 ret *= GetHealth01();
10450
10451 return ret;
10452 }
10453
10454 #ifdef DEVELOPER
10455 override void SetDebugItem()
10456 {
10457 super.SetDebugItem();
10458 _itemBase = this;
10459 }
10460
10462 {
10463 string text = super.GetDebugText();
10464
10466 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10467
10468 return text;
10469 }
10470 #endif
10471
10473 {
10474 return true;
10475 }
10476
10478
10480
10482 {
10485 }
10486
10487
10495
10511}
10512
10514{
10516 if (entity)
10517 {
10518 bool is_item = entity.IsInherited(
ItemBase);
10519 if (is_item && full_quantity)
10520 {
10523 }
10524 }
10525 else
10526 {
10528 return NULL;
10529 }
10530 return entity;
10531}
10532
10534{
10535 if (item)
10536 {
10537 if (health > 0)
10538 item.SetHealth("", "", health);
10539
10540 if (item.CanHaveTemperature())
10541 {
10543 if (item.CanFreeze())
10544 item.SetFrozen(false);
10545 }
10546
10547 if (item.HasEnergyManager())
10548 {
10549 if (quantity >= 0)
10550 {
10551 item.GetCompEM().SetEnergy0To1(quantity);
10552 }
10553 else
10554 {
10556 }
10557 }
10558 else if (item.IsMagazine())
10559 {
10560 Magazine mag = Magazine.Cast(item);
10561 if (quantity >= 0)
10562 {
10563 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10564 }
10565 else
10566 {
10568 }
10569
10570 }
10571 else
10572 {
10573 if (quantity >= 0)
10574 {
10575 item.SetQuantityNormalized(quantity, false);
10576 }
10577 else
10578 {
10580 }
10581
10582 }
10583 }
10584}
10585
10586#ifdef DEVELOPER
10588#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.