5767{
5769 {
5770 return true;
5771 }
5772};
5773
5774
5775
5777{
5781
5783
5786
5787
5788
5789
5790
5799
5805
5810
5815
5836 protected bool m_IsResultOfSplit
5837
5839
5844
5845
5846
5848
5852
5853
5854
5856
5859
5860
5861
5867
5868
5876
5879
5880
5882
5883
5885
5886
5891
5892
5897
5898
5900
5901
5903 {
5908
5909 if (!
GetGame().IsDedicatedServer())
5910 {
5912 {
5914
5916 {
5918 }
5919 }
5920
5923 }
5924
5925 m_OldLocation = null;
5926
5928 {
5930 }
5931
5932 if (ConfigIsExisting("headSelectionsToHide"))
5933 {
5936 }
5937
5939 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5940 {
5942 }
5943
5945
5946 m_IsResultOfSplit = false;
5947
5949 }
5950
5952 {
5953 super.InitItemVariables();
5954
5960 m_Count = ConfigGetInt(
"count");
5961
5964
5969
5972
5977
5989
5993
5994
5997 if (ConfigIsExisting("canBeSplit"))
5998 {
6001 }
6002
6004 if (ConfigIsExisting("itemBehaviour"))
6006
6007
6010 RegisterNetSyncVariableInt("m_VarLiquidType");
6011 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6012
6013 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6014 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6015 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6016
6017 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6018 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6019 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6020 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6021
6022 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6023 RegisterNetSyncVariableBool("m_IsTakeable");
6024 RegisterNetSyncVariableBool("m_IsHologram");
6025
6028 {
6031 }
6032
6034
6036 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6038
6039 }
6040
6042 {
6044 }
6045
6047 {
6050 {
6055 }
6056 }
6057
6058 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6059 {
6061 {
6064 }
6065
6067 }
6068
6070 {
6076 }
6077
6079
6081 {
6083
6084 if (!action)
6085 {
6086 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6087 return;
6088 }
6089
6091 if (!ai)
6092 {
6094 return;
6095 }
6096
6098 if (!action_array)
6099 {
6100 action_array = new array<ActionBase_Basic>;
6102 }
6103 if (LogManager.IsActionLogEnable())
6104 {
6105 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6106 }
6107
6108 if (action_array.Find(action) != -1)
6109 {
6110 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6111 }
6112 else
6113 {
6114 action_array.Insert(action);
6115 }
6116 }
6117
6119 {
6121 ActionBase action = player.GetActionManager().GetAction(actionName);
6124
6125 if (action_array)
6126 {
6127 action_array.RemoveItem(action);
6128 }
6129 }
6130
6131
6132
6134 {
6135 ActionOverrideData overrideData = new ActionOverrideData();
6139
6141 if (!actionMap)
6142 {
6145 }
6146
6147 actionMap.Insert(this.
Type(), overrideData);
6148
6149 }
6150
6152
6154
6155
6157 {
6160
6163
6164 string config_to_search = "CfgVehicles";
6165 string muzzle_owner_config;
6166
6168 {
6169 if (IsInherited(Weapon))
6170 config_to_search = "CfgWeapons";
6171
6172 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6173
6174 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6175
6177
6178 if (config_OnFire_subclass_count > 0)
6179 {
6180 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6181
6182 for (int i = 0; i < config_OnFire_subclass_count; i++)
6183 {
6184 string particle_class = "";
6186 string config_OnFire_entry = config_OnFire_class + particle_class;
6187 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6188 WPOF_array.Insert(WPOF);
6189 }
6190
6191
6193 }
6194 }
6195
6197 {
6198 config_to_search = "CfgWeapons";
6199 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6200
6201 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6202
6204
6205 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6206 {
6207 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6208
6209 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6210 {
6211 string particle_class2 = "";
6213 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6214 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6215 WPOBE_array.Insert(WPOBE);
6216 }
6217
6218
6220 }
6221 }
6222 }
6223
6224
6226 {
6229
6231 {
6232 string config_to_search = "CfgVehicles";
6233
6234 if (IsInherited(Weapon))
6235 config_to_search = "CfgWeapons";
6236
6237 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6238 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6239
6240 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6241 {
6242
6244
6246 {
6248 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6250 return;
6251 }
6252
6255
6256
6257
6259 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6260
6261 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6262 {
6263 string particle_class = "";
6265 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6267
6268 if (entry_type == CT_CLASS)
6269 {
6270 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6271 WPOOH_array.Insert(WPOF);
6272 }
6273 }
6274
6275
6277 }
6278 }
6279 }
6280
6282 {
6284 }
6285
6287 {
6289 {
6291
6294
6297
6298 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6299 }
6300 }
6301
6303 {
6305 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6306
6308 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6309
6311 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6312
6314 {
6316 }
6317 }
6318
6320 {
6322 }
6323
6325 {
6328 else
6330
6332 {
6335 }
6336 else
6337 {
6340
6343 }
6344
6346 }
6347
6349 {
6351 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6352 }
6353
6355 {
6357 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6359 }
6360
6362 {
6364 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6365 }
6366
6368 {
6371
6372 OverheatingParticle OP = new OverheatingParticle();
6377
6379 }
6380
6382 {
6385
6386 return -1;
6387 }
6388
6390 {
6392 {
6395
6396 for (int i = count; i > 0; --i)
6397 {
6398 int id = i - 1;
6401
6404
6405 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6406 {
6407 if (p)
6408 {
6411 }
6412 }
6413 }
6414 }
6415 }
6416
6418 {
6420 {
6422 {
6423 int id = i - 1;
6425
6426 if (OP)
6427 {
6429
6430 if (p)
6431 {
6433 }
6434
6435 delete OP;
6436 }
6437 }
6438
6441 }
6442 }
6443
6446 {
6447 return 0.0;
6448 }
6449
6450
6452 {
6453 return 250;
6454 }
6455
6457 {
6458 return 0;
6459 }
6460
6463 {
6465 return true;
6466
6467 return false;
6468 }
6469
6472 {
6475
6477 {
6479 }
6480 else
6481 {
6482
6484 }
6485
6487 }
6488
6495 {
6496 return -1;
6497 }
6498
6499
6500
6501
6503 {
6505 {
6507 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6508
6509 if (r_index >= 0)
6510 {
6511 InventoryLocation r_il = new InventoryLocation;
6512 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6513
6514 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6517 {
6518 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6519 }
6521 {
6522 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6523 }
6524
6525 }
6526
6527 player.GetHumanInventory().ClearUserReservedLocation(this);
6528 }
6529
6532 }
6533
6534
6535
6536
6538 {
6539 return ItemBase.m_DebugActionsMask;
6540 }
6541
6543 {
6544 return ItemBase.m_DebugActionsMask & mask;
6545 }
6546
6548 {
6549 ItemBase.m_DebugActionsMask = mask;
6550 }
6551
6553 {
6554 ItemBase.m_DebugActionsMask |= mask;
6555 }
6556
6558 {
6559 ItemBase.m_DebugActionsMask &= ~mask;
6560 }
6561
6563 {
6565 {
6567 }
6568 else
6569 {
6571 }
6572 }
6573
6574
6576 {
6577 if (GetEconomyProfile())
6578 {
6579 float q_max = GetEconomyProfile().GetQuantityMax();
6580 if (q_max > 0)
6581 {
6582 float q_min = GetEconomyProfile().GetQuantityMin();
6583 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6584
6586 {
6587 ComponentEnergyManager comp = GetCompEM();
6589 {
6591 }
6592 }
6594 {
6596
6597 }
6598
6599 }
6600 }
6601 }
6602
6605 {
6606 EntityAI parent = GetHierarchyParent();
6607
6608 if (parent)
6609 {
6610 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6611 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6612 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6613 }
6614 }
6615
6618 {
6619 EntityAI parent = GetHierarchyParent();
6620
6621 if (parent)
6622 {
6623 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6624 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6625 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6626 }
6627 }
6628
6630 {
6631
6632
6633
6634
6636
6638 {
6639 if (ScriptInputUserData.CanStoreInputUserData())
6640 {
6641 ScriptInputUserData ctx = new ScriptInputUserData;
6647 ctx.
Write(use_stack_max);
6650
6652 {
6653 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6654 }
6655 }
6656 }
6657 else if (!
GetGame().IsMultiplayer())
6658 {
6660 }
6661 }
6662
6664 {
6666 }
6667
6669 {
6671 }
6672
6674 {
6676 }
6677
6679 {
6680
6681 return false;
6682 }
6683
6685 {
6686 return false;
6687 }
6688
6692 {
6693 return false;
6694 }
6695
6697 {
6698 return "";
6699 }
6700
6702
6704 {
6705 return false;
6706 }
6707
6709 {
6710 return true;
6711 }
6712
6713
6714
6716 {
6717 return true;
6718 }
6719
6721 {
6722 return true;
6723 }
6724
6726 {
6727 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6729 }
6730
6732 {
6734 }
6735
6737 {
6739 if (!is_being_placed)
6741 SetSynchDirty();
6742 }
6743
6744
6746
6748 {
6750 }
6751
6753 {
6755 }
6756
6758 {
6759 return 1;
6760 }
6761
6763 {
6764 return false;
6765 }
6766
6768 {
6770 SetSynchDirty();
6771 }
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6808 {
6809 super.OnMovedInsideCargo(container);
6810
6811 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6812 }
6813
6814 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6815 {
6816 super.EEItemLocationChanged(oldLoc,newLoc);
6817
6818 PlayerBase new_player = null;
6819 PlayerBase old_player = null;
6820
6821 if (newLoc.GetParent())
6822 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6823
6824 if (oldLoc.GetParent())
6825 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6826
6828 {
6829 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6830
6831 if (r_index >= 0)
6832 {
6833 InventoryLocation r_il = new InventoryLocation;
6834 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6835
6836 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6839 {
6840 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6841 }
6843 {
6844 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6845 }
6846
6847 }
6848 }
6849
6851 {
6852 if (new_player)
6853 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6854
6855 if (new_player == old_player)
6856 {
6857
6858 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6859 {
6861 {
6862 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6863 {
6864 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6865 }
6866 }
6867 else
6868 {
6869 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6870 }
6871 }
6872
6873 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6874 {
6875 int type = oldLoc.GetType();
6877 {
6878 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6879 }
6881 {
6882 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6883 }
6884 }
6885 if (!m_OldLocation)
6886 {
6887 m_OldLocation = new InventoryLocation;
6888 }
6889 m_OldLocation.Copy(oldLoc);
6890 }
6891 else
6892 {
6893 if (m_OldLocation)
6894 {
6895 m_OldLocation.Reset();
6896 }
6897 }
6898
6900 }
6901 else
6902 {
6903 if (new_player)
6904 {
6905 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6906 if (res_index >= 0)
6907 {
6908 InventoryLocation il = new InventoryLocation;
6909 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6911 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6914 {
6915 il.
GetParent().GetOnReleaseLock().Invoke(it);
6916 }
6918 {
6920 }
6921
6922 }
6923 }
6925 {
6926
6928 }
6929
6930 if (m_OldLocation)
6931 {
6932 m_OldLocation.Reset();
6933 }
6934 }
6935 }
6936
6937 override void EOnContact(IEntity other, Contact extra)
6938 {
6940 {
6941 int liquidType = -1;
6943 if (impactSpeed > 0.0)
6944 {
6946 #ifndef SERVER
6948 #else
6950 SetSynchDirty();
6951 #endif
6953 }
6954 }
6955
6956 #ifdef SERVER
6957 if (GetCompEM() && GetCompEM().IsPlugged())
6958 {
6959 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6960 GetCompEM().UnplugThis();
6961 }
6962 #endif
6963 }
6964
6966
6968 {
6970 }
6971
6973 {
6974
6975 }
6976
6978 {
6979 super.OnItemLocationChanged(old_owner, new_owner);
6980
6981 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6982 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6983
6984 if (!relatedPlayer && playerNew)
6985 relatedPlayer = playerNew;
6986
6987 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6988 {
6990 if (actionMgr)
6991 {
6992 ActionBase currentAction = actionMgr.GetRunningAction();
6993 if (currentAction)
6995 }
6996 }
6997
6998 Man ownerPlayerOld = null;
6999 Man ownerPlayerNew = null;
7000
7001 if (old_owner)
7002 {
7003 if (old_owner.
IsMan())
7004 {
7005 ownerPlayerOld = Man.Cast(old_owner);
7006 }
7007 else
7008 {
7009 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7010 }
7011 }
7012 else
7013 {
7015 {
7017
7018 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7019 {
7020 GetCompEM().UnplugThis();
7021 }
7022 }
7023 }
7024
7025 if (new_owner)
7026 {
7027 if (new_owner.
IsMan())
7028 {
7029 ownerPlayerNew = Man.Cast(new_owner);
7030 }
7031 else
7032 {
7033 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7034 }
7035 }
7036
7037 if (ownerPlayerOld != ownerPlayerNew)
7038 {
7039 if (ownerPlayerOld)
7040 {
7041 array<EntityAI> subItemsExit = new array<EntityAI>;
7043 for (int i = 0; i < subItemsExit.Count(); i++)
7044 {
7047 }
7048 }
7049
7050 if (ownerPlayerNew)
7051 {
7052 array<EntityAI> subItemsEnter = new array<EntityAI>;
7054 for (int j = 0; j < subItemsEnter.Count(); j++)
7055 {
7058 }
7059 }
7060 }
7061 else if (ownerPlayerNew != null)
7062 {
7063 PlayerBase nplayer;
7064 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7065 {
7066 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7068 for (int k = 0; k < subItemsUpdate.Count(); k++)
7069 {
7071 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7072 }
7073 }
7074 }
7075
7076 if (old_owner)
7077 old_owner.OnChildItemRemoved(this);
7078 if (new_owner)
7079 new_owner.OnChildItemReceived(this);
7080 }
7081
7082
7084 {
7085 super.EEDelete(parent);
7086 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7087 if (player)
7088 {
7090
7091 if (player.IsAlive())
7092 {
7093 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7094 if (r_index >= 0)
7095 {
7096 InventoryLocation r_il = new InventoryLocation;
7097 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7098
7099 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7102 {
7103 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7104 }
7106 {
7107 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7108 }
7109
7110 }
7111
7112 player.RemoveQuickBarEntityShortcut(this);
7113 }
7114 }
7115 }
7116
7118 {
7119 super.EEKilled(killer);
7120
7123 {
7124 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7125 {
7126 if (IsMagazine())
7127 {
7128 if (Magazine.Cast(this).GetAmmoCount() > 0)
7129 {
7131 }
7132 }
7133 else
7134 {
7136 }
7137 }
7138 }
7139 }
7140
7142 {
7143 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7144
7145 super.OnWasAttached(parent, slot_id);
7146
7149
7151 }
7152
7154 {
7155 super.OnWasDetached(parent, slot_id);
7156
7159 }
7160
7162 {
7163 int idx;
7166
7167 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7168 if (inventory_slots.Count() < 1)
7169 {
7170 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7171 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7172 }
7173 else
7174 {
7175 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7176 }
7177
7178 idx = inventory_slots.Find(slot);
7179 if (idx < 0)
7180 return "";
7181
7182 return attach_types.Get(idx);
7183 }
7184
7186 {
7187 int idx = -1;
7188 string slot;
7189
7192
7193 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7194 if (inventory_slots.Count() < 1)
7195 {
7196 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7197 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7198 }
7199 else
7200 {
7201 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7202 if (detach_types.Count() < 1)
7203 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7204 }
7205
7206 for (int i = 0; i < inventory_slots.Count(); i++)
7207 {
7208 slot = inventory_slots.Get(i);
7209 }
7210
7211 if (slot != "")
7212 {
7213 if (detach_types.Count() == 1)
7214 idx = 0;
7215 else
7216 idx = inventory_slots.Find(slot);
7217 }
7218 if (idx < 0)
7219 return "";
7220
7221 return detach_types.Get(idx);
7222 }
7223
7225 {
7226
7228
7229
7230 float min_time = 1;
7231 float max_time = 3;
7232 float delay = Math.RandomFloat(min_time, max_time);
7233
7234 explode_timer.Run(delay, this, "DoAmmoExplosion");
7235 }
7236
7238 {
7239 Magazine magazine = Magazine.Cast(this);
7240 int pop_sounds_count = 6;
7241 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7242
7243
7244 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7245 string sound_name = pop_sounds[ sound_idx ];
7247
7248
7249 magazine.ServerAddAmmoCount(-1);
7250
7251
7252 float min_temp_to_explode = 100;
7253
7254 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7255 {
7257 }
7258 }
7259
7260
7261 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7262 {
7263 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7264
7265 const int CHANCE_DAMAGE_CARGO = 4;
7266 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7267 const int CHANCE_DAMAGE_NOTHING = 2;
7268
7270 {
7271 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7272 int chances;
7273 int rnd;
7274
7275 if (GetInventory().GetCargo())
7276 {
7277 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7278 rnd = Math.RandomInt(0,chances);
7279
7280 if (rnd < CHANCE_DAMAGE_CARGO)
7281 {
7283 }
7284 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7285 {
7287 }
7288 }
7289 else
7290 {
7291 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7292 rnd = Math.RandomInt(0,chances);
7293
7294 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7295 {
7297 }
7298 }
7299 }
7300 }
7301
7303 {
7304 if (GetInventory().GetCargo())
7305 {
7306 int item_count = GetInventory().GetCargo().GetItemCount();
7307 if (item_count > 0)
7308 {
7309 int random_pick = Math.RandomInt(0, item_count);
7311 if (!item.IsExplosive())
7312 {
7313 item.AddHealth("","",damage);
7314 return true;
7315 }
7316 }
7317 }
7318 return false;
7319 }
7320
7322 {
7323 int attachment_count = GetInventory().AttachmentCount();
7324 if (attachment_count > 0)
7325 {
7326 int random_pick = Math.RandomInt(0, attachment_count);
7327 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7328 if (!attachment.IsExplosive())
7329 {
7330 attachment.AddHealth("","",damage);
7331 return true;
7332 }
7333 }
7334 return false;
7335 }
7336
7338 {
7340 }
7341
7343 {
7345 return GetInventory().CanRemoveEntity();
7346
7347 return false;
7348 }
7349
7351 {
7353 return;
7354
7356 {
7357 if (ScriptInputUserData.CanStoreInputUserData())
7358 {
7359 ScriptInputUserData ctx = new ScriptInputUserData;
7364 ctx.
Write(destination_entity);
7368 }
7369 }
7370 else if (!
GetGame().IsMultiplayer())
7371 {
7373 }
7374 }
7375
7377 {
7379 return;
7380
7381 float split_quantity_new;
7385 InventoryLocation loc = new InventoryLocation;
7386
7387 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7388 {
7390 split_quantity_new = stack_max;
7391 else
7393
7394 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7395 if (new_item)
7396 {
7397 new_item.SetResultOfSplit(true);
7398 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7400 new_item.SetQuantity(split_quantity_new);
7401 }
7402 }
7403 else if (destination_entity && slot_id == -1)
7404 {
7405 if (quantity > stack_max)
7406 split_quantity_new = stack_max;
7407 else
7408 split_quantity_new = quantity;
7409
7411 {
7414 }
7415
7416 if (new_item)
7417 {
7418 new_item.SetResultOfSplit(true);
7419 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7421 new_item.SetQuantity(split_quantity_new);
7422 }
7423 }
7424 else
7425 {
7426 if (stack_max != 0)
7427 {
7429 {
7431 }
7432
7433 if (split_quantity_new == 0)
7434 {
7435 if (!
GetGame().IsMultiplayer())
7436 player.PhysicalPredictiveDropItem(this);
7437 else
7438 player.ServerDropEntity(this);
7439 return;
7440 }
7441
7443
7444 if (new_item)
7445 {
7446 new_item.SetResultOfSplit(true);
7447 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7449 new_item.SetQuantity(stack_max);
7450 new_item.PlaceOnSurface();
7451 }
7452 }
7453 }
7454 }
7455
7457 {
7459 return;
7460
7461 float split_quantity_new;
7465 InventoryLocation loc = new InventoryLocation;
7466
7467 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7468 {
7470 split_quantity_new = stack_max;
7471 else
7473
7474 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7475 if (new_item)
7476 {
7477 new_item.SetResultOfSplit(true);
7478 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7480 new_item.SetQuantity(split_quantity_new);
7481 }
7482 }
7483 else if (destination_entity && slot_id == -1)
7484 {
7485 if (quantity > stack_max)
7486 split_quantity_new = stack_max;
7487 else
7488 split_quantity_new = quantity;
7489
7491 {
7494 }
7495
7496 if (new_item)
7497 {
7498 new_item.SetResultOfSplit(true);
7499 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7501 new_item.SetQuantity(split_quantity_new);
7502 }
7503 }
7504 else
7505 {
7506 if (stack_max != 0)
7507 {
7509 {
7511 }
7512
7514
7515 if (new_item)
7516 {
7517 new_item.SetResultOfSplit(true);
7518 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7520 new_item.SetQuantity(stack_max);
7521 new_item.PlaceOnSurface();
7522 }
7523 }
7524 }
7525 }
7526
7528 {
7530 return;
7531
7533 {
7534 if (ScriptInputUserData.CanStoreInputUserData())
7535 {
7536 ScriptInputUserData ctx = new ScriptInputUserData;
7541 dst.WriteToContext(ctx);
7543 }
7544 }
7545 else if (!
GetGame().IsMultiplayer())
7546 {
7548 }
7549 }
7550
7552 {
7554 return;
7555
7557 {
7558 if (ScriptInputUserData.CanStoreInputUserData())
7559 {
7560 ScriptInputUserData ctx = new ScriptInputUserData;
7565 ctx.
Write(destination_entity);
7571 }
7572 }
7573 else if (!
GetGame().IsMultiplayer())
7574 {
7576 }
7577 }
7578
7580 {
7582 }
7583
7585 {
7587 return this;
7588
7590 float split_quantity_new;
7592 if (dst.IsValid())
7593 {
7594 int slot_id = dst.GetSlot();
7596
7597 if (quantity > stack_max)
7598 split_quantity_new = stack_max;
7599 else
7600 split_quantity_new = quantity;
7601
7603
7604 if (new_item)
7605 {
7606 new_item.SetResultOfSplit(true);
7607 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7610 }
7611
7612 return new_item;
7613 }
7614
7615 return null;
7616 }
7617
7619 {
7621 return;
7622
7624 float split_quantity_new;
7626 if (destination_entity)
7627 {
7629 if (quantity > stackable)
7630 split_quantity_new = stackable;
7631 else
7632 split_quantity_new = quantity;
7633
7634 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7635 if (new_item)
7636 {
7637 new_item.SetResultOfSplit(true);
7638 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7640 new_item.SetQuantity(split_quantity_new);
7641 }
7642 }
7643 }
7644
7646 {
7648 return;
7649
7651 {
7652 if (ScriptInputUserData.CanStoreInputUserData())
7653 {
7654 ScriptInputUserData ctx = new ScriptInputUserData;
7659 ItemBase destination_entity =
this;
7660 ctx.
Write(destination_entity);
7664 }
7665 }
7666 else if (!
GetGame().IsMultiplayer())
7667 {
7669 }
7670 }
7671
7673 {
7675 return;
7676
7678 float split_quantity_new;
7680 if (player)
7681 {
7683 if (quantity > stackable)
7684 split_quantity_new = stackable;
7685 else
7686 split_quantity_new = quantity;
7687
7688 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7689 new_item =
ItemBase.Cast(in_hands);
7690 if (new_item)
7691 {
7692 new_item.SetResultOfSplit(true);
7693 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7695 new_item.SetQuantity(split_quantity_new);
7696 }
7697 }
7698 }
7699
7701 {
7703 return;
7704
7706 float split_quantity_new = Math.Floor(quantity * 0.5);
7707
7709
7710 if (new_item)
7711 {
7712 if (new_item.GetQuantityMax() < split_quantity_new)
7713 {
7714 split_quantity_new = new_item.GetQuantityMax();
7715 }
7716
7717 new_item.SetResultOfSplit(true);
7718 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7719
7721 {
7724 }
7725 else
7726 {
7729 }
7730 }
7731 }
7732
7734 {
7736 return;
7737
7739 float split_quantity_new = Math.Floor(quantity / 2);
7740
7741 InventoryLocation invloc = new InventoryLocation;
7743
7745 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7746
7747 if (new_item)
7748 {
7749 if (new_item.GetQuantityMax() < split_quantity_new)
7750 {
7751 split_quantity_new = new_item.GetQuantityMax();
7752 }
7754 {
7757 }
7758 else
7759 {
7762 }
7763 }
7764 }
7765
7768 {
7769 SetWeightDirty();
7771
7772 if (parent)
7773 parent.OnAttachmentQuantityChangedEx(this, delta);
7774
7776 {
7778 {
7780 }
7782 {
7783 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7785 }
7786 }
7787
7788 }
7789
7792 {
7793
7794 }
7795
7798 {
7800 }
7801
7803 {
7804 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7805
7807 {
7808 if (newLevel == GameConstants.STATE_RUINED)
7809 {
7811 EntityAI parent = GetHierarchyParent();
7812 if (parent && parent.IsFireplace())
7813 {
7814 CargoBase cargo = GetInventory().GetCargo();
7815 if (cargo)
7816 {
7818 {
7820 }
7821 }
7822 }
7823 }
7824
7826 {
7827
7829 return;
7830 }
7831
7832 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7833 {
7835 }
7836 }
7837 }
7838
7839
7841 {
7842 super.OnRightClick();
7843
7845 {
7847 {
7848 if (ScriptInputUserData.CanStoreInputUserData())
7849 {
7850 vector m4[4];
7852
7853 EntityAI root = GetHierarchyRoot();
7854
7855 InventoryLocation dst = new InventoryLocation;
7857 {
7858 if (root)
7859 {
7860 root.GetTransform(m4);
7862 }
7863 else
7864 GetInventory().GetCurrentInventoryLocation(dst);
7865 }
7866 else
7867 {
7869
7870
7871 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7872 {
7873 if (root)
7874 {
7875 root.GetTransform(m4);
7877 }
7878 else
7879 GetInventory().GetCurrentInventoryLocation(dst);
7880 }
7881 else
7882 {
7883 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7884 }
7885 }
7886
7887 ScriptInputUserData ctx = new ScriptInputUserData;
7895 }
7896 }
7897 else if (!
GetGame().IsMultiplayer())
7898 {
7900 }
7901 }
7902 }
7903
7904 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7905 {
7906
7907 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7908 return false;
7909
7910 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7911 return false;
7912
7913
7915 return false;
7916
7917
7918 Magazine mag = Magazine.Cast(this);
7919 if (mag)
7920 {
7921 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7922 return false;
7923
7924 if (stack_max_limit)
7925 {
7926 Magazine other_mag = Magazine.Cast(other_item);
7927 if (other_item)
7928 {
7929 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7930 return false;
7931 }
7932
7933 }
7934 }
7935 else
7936 {
7937
7939 return false;
7940
7942 return false;
7943 }
7944
7945 PlayerBase player = null;
7946 if (CastTo(player, GetHierarchyRootPlayer()))
7947 {
7948 if (player.GetInventory().HasAttachment(this))
7949 return false;
7950
7951 if (player.IsItemsToDelete())
7952 return false;
7953 }
7954
7955 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7956 return false;
7957
7958 int slotID;
7960 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7961 return false;
7962
7963 return true;
7964 }
7965
7967 {
7969 }
7970
7972 {
7973 return m_IsResultOfSplit;
7974 }
7975
7977 {
7978 m_IsResultOfSplit = value;
7979 }
7980
7982 {
7984 }
7985
7987 {
7988 float other_item_quantity = other_item.GetQuantity();
7989 float this_free_space;
7990
7992
7994
7995 if (other_item_quantity > this_free_space)
7996 {
7997 return this_free_space;
7998 }
7999 else
8000 {
8001 return other_item_quantity;
8002 }
8003 }
8004
8006 {
8008 }
8009
8011 {
8013 return;
8014
8015 if (!IsMagazine() && other_item)
8016 {
8018 if (quantity_used != 0)
8019 {
8020 float hp1 = GetHealth01("","");
8021 float hp2 = other_item.GetHealth01("","");
8022 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8023 hpResult = hpResult / (
GetQuantity() + quantity_used);
8024
8025 hpResult *= GetMaxHealth();
8026 Math.Round(hpResult);
8027 SetHealth("", "Health", hpResult);
8028
8030 other_item.AddQuantity(-quantity_used);
8031 }
8032 }
8034 }
8035
8037 {
8038 #ifdef SERVER
8039 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8040 GetHierarchyParent().IncreaseLifetimeUp();
8041 #endif
8042 };
8043
8045 {
8046 PlayerBase p = PlayerBase.Cast(player);
8047
8048 array<int> recipesIds = p.m_Recipes;
8049 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8050 if (moduleRecipesManager)
8051 {
8052 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8053 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8054 }
8055
8056 for (int i = 0;i < recipesIds.Count(); i++)
8057 {
8058 int key = recipesIds.Get(i);
8059 string recipeName = moduleRecipesManager.GetRecipeName(key);
8061 }
8062 }
8063
8064
8065 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8066 {
8067 super.GetDebugActions(outputList);
8068
8069
8074
8075
8079
8083
8084
8087
8088
8090 {
8093 }
8094
8096
8099
8103 }
8104
8105
8106
8107
8109 {
8110 super.OnAction(action_id, player, ctx);
8111 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8112 {
8113 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8114 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8115 PlayerBase p = PlayerBase.Cast(player);
8116 if (
EActions.RECIPES_RANGE_START < 1000)
8117 {
8118 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8119 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8120 }
8121 }
8122 #ifndef SERVER
8123 else if (action_id ==
EActions.WATCH_PLAYER)
8124 {
8125 PluginDeveloper.SetDeveloperItemClientEx(player);
8126 }
8127 #endif
8129 {
8130 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8131 {
8132 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8133 OnDebugButtonPressServer(id + 1);
8134 }
8135
8136 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8137 {
8138 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8140 }
8141
8142 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8143 {
8144 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8146 }
8147
8148 else if (action_id ==
EActions.ADD_QUANTITY)
8149 {
8150 if (IsMagazine())
8151 {
8152 Magazine mag = Magazine.Cast(this);
8153 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8154 }
8155 else
8156 {
8158 }
8159
8160 if (m_EM)
8161 {
8162 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8163 }
8164
8165 }
8166
8167 else if (action_id ==
EActions.REMOVE_QUANTITY)
8168 {
8169 if (IsMagazine())
8170 {
8171 Magazine mag2 = Magazine.Cast(this);
8172 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8173 }
8174 else
8175 {
8177 }
8178 if (m_EM)
8179 {
8180 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8181 }
8182
8183 }
8184
8185 else if (action_id ==
EActions.SET_QUANTITY_0)
8186 {
8188
8189 if (m_EM)
8190 {
8191 m_EM.SetEnergy(0);
8192 }
8193 }
8194
8195 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8196 {
8198
8199 if (m_EM)
8200 {
8201 m_EM.SetEnergy(m_EM.GetEnergyMax());
8202 }
8203 }
8204
8205 else if (action_id ==
EActions.ADD_HEALTH)
8206 {
8207 AddHealth("","",GetMaxHealth("","Health")/5);
8208 }
8209 else if (action_id ==
EActions.REMOVE_HEALTH)
8210 {
8211 AddHealth("","",-GetMaxHealth("","Health")/5);
8212 }
8213 else if (action_id ==
EActions.DESTROY_HEALTH)
8214 {
8215 SetHealth01("","",0);
8216 }
8217 else if (action_id ==
EActions.WATCH_ITEM)
8218 {
8220 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8221 #ifdef DEVELOPER
8222 SetDebugDeveloper_item(this);
8223 #endif
8224 }
8225
8226 else if (action_id ==
EActions.ADD_TEMPERATURE)
8227 {
8228 AddTemperature(20);
8229
8230 }
8231
8232 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8233 {
8234 AddTemperature(-20);
8235
8236 }
8237
8238 else if (action_id ==
EActions.FLIP_FROZEN)
8239 {
8240 SetFrozen(!GetIsFrozen());
8241
8242 }
8243
8244 else if (action_id ==
EActions.ADD_WETNESS)
8245 {
8247
8248 }
8249
8250 else if (action_id ==
EActions.REMOVE_WETNESS)
8251 {
8253
8254 }
8255
8256 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8257 {
8260
8261
8262 }
8263
8264 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8265 {
8268 }
8269
8270 else if (action_id ==
EActions.MAKE_SPECIAL)
8271 {
8272 auto debugParams = DebugSpawnParams.WithPlayer(player);
8273 OnDebugSpawnEx(debugParams);
8274 }
8275
8276 else if (action_id ==
EActions.DELETE)
8277 {
8278 Delete();
8279 }
8280
8281 }
8282
8283
8284 return false;
8285 }
8286
8287
8288
8289
8293
8296
8297
8298
8300 {
8301 return false;
8302 }
8303
8304
8306 {
8307 return true;
8308 }
8309
8310
8312 {
8313 return true;
8314 }
8315
8316
8317
8319 {
8320 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8322 }
8323
8326 {
8327 return null;
8328 }
8329
8331 {
8332 return false;
8333 }
8334
8336 {
8337 return false;
8338 }
8339
8343
8344
8346 {
8347 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8348 return module_repairing.CanRepair(this, item_repair_kit);
8349 }
8350
8351
8352 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8353 {
8354 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8355 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8356 }
8357
8358
8360 {
8361
8362
8363
8364
8365
8366
8367
8368
8369 return 1;
8370 }
8371
8372
8373
8375 {
8377 }
8378
8379
8380
8382 {
8384 }
8385
8386
8395 {
8396 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8397
8398 if (player)
8399 {
8400 player.MessageStatus(text);
8401 }
8402 }
8403
8404
8413 {
8414 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8415
8416 if (player)
8417 {
8418 player.MessageAction(text);
8419 }
8420 }
8421
8422
8431 {
8432 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8433
8434 if (player)
8435 {
8436 player.MessageFriendly(text);
8437 }
8438 }
8439
8440
8449 {
8450 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8451
8452 if (player)
8453 {
8454 player.MessageImportant(text);
8455 }
8456 }
8457
8459 {
8460 return true;
8461 }
8462
8463
8464 override bool KindOf(
string tag)
8465 {
8466 bool found = false;
8467 string item_name = this.
GetType();
8470
8471 int array_size = item_tag_array.Count();
8472 for (int i = 0; i < array_size; i++)
8473 {
8474 if (item_tag_array.Get(i) == tag)
8475 {
8476 found = true;
8477 break;
8478 }
8479 }
8480 return found;
8481 }
8482
8483
8485 {
8486
8487 super.OnRPC(sender, rpc_type,ctx);
8488
8489
8490 switch (rpc_type)
8491 {
8492 #ifndef SERVER
8493 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8494 Param2<bool, string> p = new Param2<bool, string>(false, "");
8495
8497 return;
8498
8499 bool play = p.param1;
8500 string soundSet = p.param2;
8501
8502 if (play)
8503 {
8505 {
8507 {
8509 }
8510 }
8511 else
8512 {
8514 }
8515 }
8516 else
8517 {
8519 }
8520
8521 break;
8522 #endif
8523
8524 }
8525
8527 {
8529 }
8530 }
8531
8532
8533
8534
8536 {
8537 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8538 return plugin.GetID(
name);
8539 }
8540
8542 {
8543 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8544 return plugin.GetName(id);
8545 }
8546
8549 {
8550
8551
8552 int varFlags;
8553 if (!ctx.
Read(varFlags))
8554 return;
8555
8556 if (varFlags & ItemVariableFlags.FLOAT)
8557 {
8559 }
8560 }
8561
8563 {
8564
8565 super.SerializeNumericalVars(floats_out);
8566
8567
8568
8570 {
8572 }
8573
8575 {
8577 }
8578
8580 {
8582 }
8583
8585 {
8590 }
8591
8593 {
8595 }
8596 }
8597
8599 {
8600
8601 super.DeSerializeNumericalVars(floats);
8602
8603
8604 int index = 0;
8605 int mask = Math.Round(floats.Get(index));
8606
8607 index++;
8608
8610 {
8612 {
8614 }
8615 else
8616 {
8617 float quantity = floats.Get(index);
8619 }
8620 index++;
8621 }
8622
8624 {
8625 float wet = floats.Get(index);
8627 index++;
8628 }
8629
8631 {
8632 int liquidtype = Math.Round(floats.Get(index));
8634 index++;
8635 }
8636
8638 {
8640 index++;
8642 index++;
8644 index++;
8646 index++;
8647 }
8648
8650 {
8651 int cleanness = Math.Round(floats.Get(index));
8653 index++;
8654 }
8655 }
8656
8658 {
8659 super.WriteVarsToCTX(ctx);
8660
8661
8663 {
8665 }
8666
8668 {
8670 }
8671
8673 {
8675 }
8676
8678 {
8679 int r,g,b,a;
8685 }
8686
8688 {
8690 }
8691 }
8692
8694 {
8695 if (!super.ReadVarsFromCTX(ctx,version))
8696 return false;
8697
8698 int intValue;
8699 float value;
8700
8701 if (version < 140)
8702 {
8703 if (!ctx.
Read(intValue))
8704 return false;
8705
8706 m_VariablesMask = intValue;
8707 }
8708
8710 {
8711 if (!ctx.
Read(value))
8712 return false;
8713
8715 {
8717 }
8718 else
8719 {
8721 }
8722 }
8723
8724 if (version < 140)
8725 {
8727 {
8728 if (!ctx.
Read(value))
8729 return false;
8730 SetTemperatureDirect(value);
8731 }
8732 }
8733
8735 {
8736 if (!ctx.
Read(value))
8737 return false;
8739 }
8740
8742 {
8743 if (!ctx.
Read(intValue))
8744 return false;
8746 }
8747
8749 {
8750 int r,g,b,a;
8752 return false;
8754 return false;
8756 return false;
8758 return false;
8759
8761 }
8762
8764 {
8765 if (!ctx.
Read(intValue))
8766 return false;
8768 }
8769
8770 if (version >= 138 && version < 140)
8771 {
8773 {
8774 if (!ctx.
Read(intValue))
8775 return false;
8776 SetFrozen(intValue);
8777 }
8778 }
8779
8780 return true;
8781 }
8782
8783
8785 {
8788 {
8790 }
8791
8792 if (!super.OnStoreLoad(ctx, version))
8793 {
8795 return false;
8796 }
8797
8798 if (version >= 114)
8799 {
8800 bool hasQuickBarIndexSaved;
8801
8802 if (!ctx.
Read(hasQuickBarIndexSaved))
8803 {
8805 return false;
8806 }
8807
8808 if (hasQuickBarIndexSaved)
8809 {
8810 int itmQBIndex;
8811
8812
8813 if (!ctx.
Read(itmQBIndex))
8814 {
8816 return false;
8817 }
8818
8819 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8820 if (itmQBIndex != -1 && parentPlayer)
8821 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8822 }
8823 }
8824 else
8825 {
8826
8827 PlayerBase player;
8828 int itemQBIndex;
8829 if (version ==
int.
MAX)
8830 {
8831 if (!ctx.
Read(itemQBIndex))
8832 {
8834 return false;
8835 }
8836 }
8837 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8838 {
8839
8840 if (!ctx.
Read(itemQBIndex))
8841 {
8843 return false;
8844 }
8845 if (itemQBIndex != -1 && player)
8846 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8847 }
8848 }
8849
8850 if (version < 140)
8851 {
8852
8853 if (!LoadVariables(ctx, version))
8854 {
8856 return false;
8857 }
8858 }
8859
8860
8862 {
8864 return false;
8865 }
8866 if (version >= 132)
8867 {
8869 if (raib)
8870 {
8872 {
8874 return false;
8875 }
8876 }
8877 }
8878
8880 return true;
8881 }
8882
8883
8884
8886 {
8887 super.OnStoreSave(ctx);
8888
8889 PlayerBase player;
8890 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8891 {
8893
8894 int itemQBIndex = -1;
8895 itemQBIndex = player.FindQuickBarEntityIndex(this);
8896 ctx.
Write(itemQBIndex);
8897 }
8898 else
8899 {
8901 }
8902
8904
8906 if (raib)
8907 {
8909 }
8910 }
8911
8912
8914 {
8915 super.AfterStoreLoad();
8916
8918 {
8920 }
8921
8923 {
8926 }
8927 }
8928
8930 {
8931 super.EEOnAfterLoad();
8932
8934 {
8936 }
8937
8940 }
8941
8943 {
8944 return false;
8945 }
8946
8947
8948
8950 {
8952 {
8953 #ifdef PLATFORM_CONSOLE
8954
8956 {
8958 if (menu)
8959 {
8961 }
8962 }
8963 #endif
8964 }
8965
8967 {
8970 }
8971
8973 {
8974 SetWeightDirty();
8976 }
8978 {
8981 }
8982
8984 {
8987 }
8989 {
8992 }
8993
8994 super.OnVariablesSynchronized();
8995 }
8996
8997
8998
9000 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9001 {
9002 if (!IsServerCheck(allow_client))
9003 return false;
9004
9006 return false;
9007
9010
9011 if (value <= (min + 0.001))
9012 value = min;
9013
9014 if (value == min)
9015 {
9016 if (destroy_config)
9017 {
9018 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9019 if (dstr)
9020 {
9022 this.Delete();
9023 return true;
9024 }
9025 }
9026 else if (destroy_forced)
9027 {
9029 this.Delete();
9030 return true;
9031 }
9032
9034 }
9035
9038
9040 {
9042
9043 if (delta)
9045 }
9046
9048
9049 return false;
9050 }
9051
9052
9054 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9055 {
9057 }
9058
9060 {
9063 }
9064
9066 {
9069 }
9070
9073 {
9074 float value_clamped = Math.Clamp(value, 0, 1);
9076 SetQuantity(result, destroy_config, destroy_forced);
9077 }
9078
9079
9082 {
9084 }
9085
9087 {
9089 }
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9101 {
9102 int slot = -1;
9103 if (GetInventory())
9104 {
9105 InventoryLocation il = new InventoryLocation;
9106 GetInventory().GetCurrentInventoryLocation(il);
9108 }
9109
9111 }
9112
9114 {
9115 float quantity_max = 0;
9116
9118 {
9119 if (attSlotID != -1)
9120 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9121
9122 if (quantity_max <= 0)
9124 }
9125
9126 if (quantity_max <= 0)
9128
9129 return quantity_max;
9130 }
9131
9133 {
9135 }
9136
9138 {
9140 }
9141
9142
9144 {
9146 }
9147
9149 {
9151 }
9152
9154 {
9156 }
9157
9158
9160 {
9161
9162 float weightEx = GetWeightEx();
9163 float special = GetInventoryAndCargoWeight();
9164 return weightEx - special;
9165 }
9166
9167
9169 {
9171 }
9172
9174 {
9176 {
9177 #ifdef DEVELOPER
9178 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9179 {
9180 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9182 }
9183 #endif
9184
9186 }
9187 else if (HasEnergyManager())
9188 {
9189 #ifdef DEVELOPER
9190 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9191 {
9192 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9193 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9194 }
9195 #endif
9196 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9197 }
9198 else
9199 {
9200 #ifdef DEVELOPER
9201 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9202 {
9203 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9204 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9205 }
9206 #endif
9207 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9208 }
9209 }
9210
9213 {
9214 int item_count = 0;
9216
9217 if (GetInventory().GetCargo() != NULL)
9218 {
9219 item_count = GetInventory().GetCargo().GetItemCount();
9220 }
9221
9222 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9223 {
9224 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9225 if (item)
9226 item_count += item.GetNumberOfItems();
9227 }
9228 return item_count;
9229 }
9230
9233 {
9234 float weight = 0;
9235 float wetness = 1;
9236 if (include_wetness)
9239 {
9240 weight = wetness * m_ConfigWeight;
9241 }
9243 {
9244 weight = 1;
9245 }
9246 return weight;
9247 }
9248
9249
9250
9252 {
9253 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9254 {
9255 GameInventory inv = GetInventory();
9256 array<EntityAI> items = new array<EntityAI>;
9258 for (int i = 0; i < items.Count(); i++)
9259 {
9261 if (item)
9262 {
9264 }
9265 }
9266 }
9267 }
9268
9269
9270
9271
9273 {
9274 float energy = 0;
9275 if (HasEnergyManager())
9276 {
9277 energy = GetCompEM().GetEnergy();
9278 }
9279 return energy;
9280 }
9281
9282
9284 {
9285 super.OnEnergyConsumed();
9286
9288 }
9289
9291 {
9292 super.OnEnergyAdded();
9293
9295 }
9296
9297
9299 {
9300 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9301 {
9303 {
9304 float energy_0to1 = GetCompEM().GetEnergy0To1();
9306 }
9307 }
9308 }
9309
9310
9312 {
9313 return ConfigGetFloat("heatIsolation");
9314 }
9315
9317 {
9319 }
9320
9322 {
9323 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9324 if (
GetGame().ConfigIsExisting(paramPath))
9326
9327 return 0.0;
9328 }
9329
9331 {
9332 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9333 if (
GetGame().ConfigIsExisting(paramPath))
9335
9336 return 0.0;
9337 }
9338
9339 override void SetWet(
float value,
bool allow_client =
false)
9340 {
9341 if (!IsServerCheck(allow_client))
9342 return;
9343
9346
9348
9349 m_VarWet = Math.Clamp(value, min, max);
9350
9352 {
9355 }
9356 }
9357
9358 override void AddWet(
float value)
9359 {
9361 }
9362
9364 {
9366 }
9367
9369 {
9371 }
9372
9374 {
9376 }
9377
9379 {
9381 }
9382
9384 {
9386 }
9387
9389 {
9392 if (newLevel != oldLevel)
9393 {
9395 }
9396 }
9397
9399 {
9400 SetWeightDirty();
9401 }
9402
9404 {
9405 return GetWetLevelInternal(
m_VarWet);
9406 }
9407
9408
9409
9411 {
9413 }
9414
9416 {
9418 }
9419
9421 {
9423 }
9424
9426 {
9428 }
9429
9430
9431
9433 {
9434 if (ConfigIsExisting("itemModelLength"))
9435 {
9436 return ConfigGetFloat("itemModelLength");
9437 }
9438 return 0;
9439 }
9440
9442 {
9443 if (ConfigIsExisting("itemAttachOffset"))
9444 {
9445 return ConfigGetFloat("itemAttachOffset");
9446 }
9447 return 0;
9448 }
9449
9450 override void SetCleanness(
int value,
bool allow_client =
false)
9451 {
9452 if (!IsServerCheck(allow_client))
9453 return;
9454
9456
9458
9461 }
9462
9464 {
9466 }
9467
9469 {
9470 return true;
9471 }
9472
9473
9474
9475
9477 {
9479 }
9480
9482 {
9484 }
9485
9486
9487
9488
9489 override void SetColor(
int r,
int g,
int b,
int a)
9490 {
9496 }
9498 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9499 {
9504 }
9505
9507 {
9509 }
9510
9513 {
9514 int r,g,b,a;
9516 r = r/255;
9517 g = g/255;
9518 b = b/255;
9519 a = a/255;
9520 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9521 }
9522
9523
9524
9525 override void SetLiquidType(
int value,
bool allow_client =
false)
9526 {
9527 if (!IsServerCheck(allow_client))
9528 return;
9529
9534 }
9535
9537 {
9538 return ConfigGetInt("varLiquidTypeInit");
9539 }
9540
9542 {
9544 }
9545
9547 {
9549 SetFrozen(false);
9550 }
9551
9554 {
9555 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9556 }
9557
9558
9561 {
9562 PlayerBase nplayer;
9563 if (PlayerBase.CastTo(nplayer, player))
9564 {
9566
9567 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9568 }
9569 }
9570
9571
9574 {
9575 PlayerBase nplayer;
9576 if (PlayerBase.CastTo(nplayer,player))
9577 {
9578
9579 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9580
9581 }
9582
9583
9584 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9585
9586
9587 if (HasEnergyManager())
9588 {
9589 GetCompEM().UpdatePlugState();
9590 }
9591 }
9592
9593
9595 {
9596 super.OnPlacementStarted(player);
9597
9599 }
9600
9601 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9602 {
9604 {
9605 m_AdminLog.OnPlacementComplete(player,
this);
9606 }
9607
9608 super.OnPlacementComplete(player, position, orientation);
9609 }
9610
9611
9612
9613
9614
9616 {
9618 {
9619 return true;
9620 }
9621 else
9622 {
9623 return false;
9624 }
9625 }
9626
9627
9629 {
9631 {
9633 }
9634 }
9635
9636
9638 {
9640 }
9641
9643 {
9645 }
9646
9647 override void InsertAgent(
int agent,
float count = 1)
9648 {
9649 if (count < 1)
9650 return;
9651
9653 }
9654
9657 {
9659 }
9660
9661
9663 {
9665 }
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9709 {
9711 return false;
9712 return true;
9713 }
9714
9716 {
9717
9719 }
9720
9721
9724 {
9725 super.CheckForRoofLimited(timeTresholdMS);
9726
9728 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9729 {
9730 m_PreviousRoofTestTime = time;
9731 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9732 }
9733 }
9734
9735
9737 {
9739 {
9740 return 0;
9741 }
9742
9743 if (GetInventory().GetAttachmentSlotsCount() != 0)
9744 {
9745 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9746 if (filter)
9747 return filter.GetProtectionLevel(type, false, system);
9748 else
9749 return 0;
9750 }
9751
9752 string subclassPath, entryName;
9753
9754 switch (type)
9755 {
9757 entryName = "biological";
9758 break;
9760 entryName = "chemical";
9761 break;
9762 default:
9763 entryName = "biological";
9764 break;
9765 }
9766
9767 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9768
9770 }
9771
9772
9773
9776 {
9777 if (!IsMagazine())
9779
9781 }
9782
9783
9784
9785
9786
9791 {
9792 return true;
9793 }
9794
9796 {
9798 }
9799
9800
9801
9802
9803
9805 {
9806 if (parent)
9807 {
9808 if (parent.IsInherited(DayZInfected))
9809 return true;
9810
9811 if (!parent.IsRuined())
9812 return true;
9813 }
9814
9815 return true;
9816 }
9817
9819 {
9820 if (!super.CanPutAsAttachment(parent))
9821 {
9822 return false;
9823 }
9824
9825 if (!IsRuined() && !parent.IsRuined())
9826 {
9827 return true;
9828 }
9829
9830 return false;
9831 }
9832
9834 {
9835
9836
9837
9838
9839 return super.CanReceiveItemIntoCargo(item);
9840 }
9841
9843 {
9844
9845
9846
9847
9848 GameInventory attachmentInv = attachment.GetInventory();
9850 {
9851 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9852 return false;
9853 }
9854
9855 InventoryLocation loc = new InventoryLocation();
9856 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9857 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9858 return false;
9859
9860 return super.CanReceiveAttachment(attachment, slotId);
9861 }
9862
9864 {
9865 if (!super.CanReleaseAttachment(attachment))
9866 return false;
9867
9868 return GetInventory().AreChildrenAccessible();
9869 }
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9892 {
9893 int id = muzzle_owner.GetMuzzleID();
9894 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9895
9896 if (WPOF_array)
9897 {
9898 for (int i = 0; i < WPOF_array.Count(); i++)
9899 {
9900 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9901
9902 if (WPOF)
9903 {
9904 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9905 }
9906 }
9907 }
9908 }
9909
9910
9912 {
9913 int id = muzzle_owner.GetMuzzleID();
9915
9916 if (WPOBE_array)
9917 {
9918 for (int i = 0; i < WPOBE_array.Count(); i++)
9919 {
9920 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9921
9922 if (WPOBE)
9923 {
9924 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9925 }
9926 }
9927 }
9928 }
9929
9930
9932 {
9933 int id = muzzle_owner.GetMuzzleID();
9934 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9935
9936 if (WPOOH_array)
9937 {
9938 for (int i = 0; i < WPOOH_array.Count(); i++)
9939 {
9940 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9941
9942 if (WPOOH)
9943 {
9944 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9945 }
9946 }
9947 }
9948 }
9949
9950
9952 {
9953 int id = muzzle_owner.GetMuzzleID();
9954 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9955
9956 if (WPOOH_array)
9957 {
9958 for (int i = 0; i < WPOOH_array.Count(); i++)
9959 {
9960 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9961
9962 if (WPOOH)
9963 {
9964 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9965 }
9966 }
9967 }
9968 }
9969
9970
9972 {
9973 int id = muzzle_owner.GetMuzzleID();
9974 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9975
9976 if (WPOOH_array)
9977 {
9978 for (int i = 0; i < WPOOH_array.Count(); i++)
9979 {
9980 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9981
9982 if (WPOOH)
9983 {
9984 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9985 }
9986 }
9987 }
9988 }
9989
9990
9991
9993 {
9995 {
9996 return true;
9997 }
9998
9999 return false;
10000 }
10001
10003 {
10005 {
10006 return true;
10007 }
10008
10009 return false;
10010 }
10011
10013 {
10015 {
10016 return true;
10017 }
10018
10019 return false;
10020 }
10021
10023 {
10024 return false;
10025 }
10026
10029 {
10030 return UATimeSpent.DEFAULT_DEPLOY;
10031 }
10032
10033
10034
10035
10037 {
10039 SetSynchDirty();
10040 }
10041
10043 {
10045 }
10046
10047
10049 {
10050 return false;
10051 }
10052
10055 {
10056 string att_type = "None";
10057
10058 if (ConfigIsExisting("soundAttType"))
10059 {
10060 att_type = ConfigGetString("soundAttType");
10061 }
10062
10064 }
10065
10067 {
10069 }
10070
10071
10072
10073
10074
10078
10080 {
10083
10085 }
10086
10087
10089 {
10091 return;
10092
10094
10097
10100
10101 SoundParameters params = new SoundParameters();
10105 }
10106
10107
10109 {
10111 return;
10112
10114 SetSynchDirty();
10115
10118 }
10119
10120
10122 {
10124 return;
10125
10127 SetSynchDirty();
10128
10131 }
10132
10134 {
10136 }
10137
10139 {
10141 }
10142
10145 {
10146 if (!
GetGame().IsDedicatedServer())
10147 {
10148 if (ConfigIsExisting("attachSoundSet"))
10149 {
10150 string cfg_path = "";
10151 string soundset = "";
10152 string type_name =
GetType();
10153
10156 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10157 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10158
10159 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10160 {
10161 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10162 {
10163 if (cfg_slot_array[i] == slot_type)
10164 {
10165 soundset = cfg_soundset_array[i];
10166 break;
10167 }
10168 }
10169 }
10170
10171 if (soundset != "")
10172 {
10173 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10175 }
10176 }
10177 }
10178 }
10179
10181 {
10182
10183 }
10184
10185 void OnApply(PlayerBase player);
10186
10188 {
10189 return 1.0;
10190 };
10191
10193 {
10195 }
10196
10198 {
10200 }
10201
10203
10205 {
10206 SetDynamicPhysicsLifeTime(0.01);
10208 }
10209
10211 {
10212 array<string> zone_names = new array<string>;
10213 GetDamageZones(zone_names);
10214 for (int i = 0; i < zone_names.Count(); i++)
10215 {
10216 SetHealthMax(zone_names.Get(i),"Health");
10217 }
10218 SetHealthMax("","Health");
10219 }
10220
10223 {
10224 float global_health = GetHealth01("","Health");
10225 array<string> zones = new array<string>;
10226 GetDamageZones(zones);
10227
10228 for (int i = 0; i < zones.Count(); i++)
10229 {
10230 SetHealth01(zones.Get(i),"Health",global_health);
10231 }
10232 }
10233
10236 {
10237 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10238 }
10239
10241 {
10242 if (!hasRootAsPlayer)
10243 {
10244 if (refParentIB)
10245 {
10246
10247 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10248 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10249
10250 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10251 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10252
10255 }
10256 else
10257 {
10258
10261 }
10262 }
10263 }
10264
10266 {
10268 {
10269 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10270 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10271 {
10272 float heatPermCoef = 1.0;
10274 while (ent)
10275 {
10276 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10277 ent = ent.GetHierarchyParent();
10278 }
10279
10280 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10281 }
10282 }
10283 }
10284
10286 {
10287
10288 EntityAI parent = GetHierarchyParent();
10289 if (!parent)
10290 {
10291 hasParent = false;
10292 hasRootAsPlayer = false;
10293 }
10294 else
10295 {
10296 hasParent = true;
10297 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10298 refParentIB =
ItemBase.Cast(parent);
10299 }
10300 }
10301
10302 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10303 {
10304
10305 }
10306
10308 {
10309
10310 return false;
10311 }
10312
10314 {
10315
10316
10317 return false;
10318 }
10319
10321 {
10322
10323 return false;
10324 }
10325
10328 {
10329 return !GetIsFrozen() &&
IsOpen();
10330 }
10331
10333 {
10334 bool hasParent = false, hasRootAsPlayer = false;
10336
10337 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10338 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10339
10340 if (wwtu || foodDecay)
10341 {
10345
10346 if (processWetness || processTemperature || processDecay)
10347 {
10349
10350 if (processWetness)
10351 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10352
10353 if (processTemperature)
10355
10356 if (processDecay)
10357 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10358 }
10359 }
10360 }
10361
10364 {
10366 }
10367
10369 {
10372
10373 return super.GetTemperatureFreezeThreshold();
10374 }
10375
10377 {
10380
10381 return super.GetTemperatureThawThreshold();
10382 }
10383
10385 {
10388
10389 return super.GetItemOverheatThreshold();
10390 }
10391
10393 {
10395 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10396
10397 return super.GetTemperatureFreezeTime();
10398 }
10399
10401 {
10403 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10404
10405 return super.GetTemperatureThawTime();
10406 }
10407
10412
10414 {
10415 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10416 }
10417
10419 {
10420 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10421 }
10422
10425 {
10427 }
10428
10430 {
10432 }
10433
10435 {
10437 }
10438
10441 {
10442 return null;
10443 }
10444
10447 {
10448 return false;
10449 }
10450
10452 {
10454 {
10457 if (!trg)
10458 {
10460 explosive = this;
10461 }
10462
10463 explosive.PairRemote(trg);
10465
10466 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10467 trg.SetPersistentPairID(persistentID);
10468 explosive.SetPersistentPairID(persistentID);
10469
10470 return true;
10471 }
10472 return false;
10473 }
10474
10477 {
10478 float ret = 1.0;
10481 ret *= GetHealth01();
10482
10483 return ret;
10484 }
10485
10486 #ifdef DEVELOPER
10487 override void SetDebugItem()
10488 {
10489 super.SetDebugItem();
10490 _itemBase = this;
10491 }
10492
10494 {
10495 string text = super.GetDebugText();
10496
10498 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10499
10500 return text;
10501 }
10502 #endif
10503
10505 {
10506 return true;
10507 }
10508
10510
10512
10514 {
10517 }
10518
10519
10527
10543}
10544
10546{
10548 if (entity)
10549 {
10550 bool is_item = entity.IsInherited(
ItemBase);
10551 if (is_item && full_quantity)
10552 {
10555 }
10556 }
10557 else
10558 {
10560 return NULL;
10561 }
10562 return entity;
10563}
10564
10566{
10567 if (item)
10568 {
10569 if (health > 0)
10570 item.SetHealth("", "", health);
10571
10572 if (item.CanHaveTemperature())
10573 {
10575 if (item.CanFreeze())
10576 item.SetFrozen(false);
10577 }
10578
10579 if (item.HasEnergyManager())
10580 {
10581 if (quantity >= 0)
10582 {
10583 item.GetCompEM().SetEnergy0To1(quantity);
10584 }
10585 else
10586 {
10588 }
10589 }
10590 else if (item.IsMagazine())
10591 {
10592 Magazine mag = Magazine.Cast(item);
10593 if (quantity >= 0)
10594 {
10595 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10596 }
10597 else
10598 {
10600 }
10601
10602 }
10603 else
10604 {
10605 if (quantity >= 0)
10606 {
10607 item.SetQuantityNormalized(quantity, false);
10608 }
10609 else
10610 {
10612 }
10613
10614 }
10615 }
10616}
10617
10618#ifdef DEVELOPER
10620#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.