5750{
5752 {
5753 return true;
5754 }
5755};
5756
5757
5758
5760{
5764
5766
5769
5770
5771
5772
5773
5782
5788
5793
5798
5819 protected bool m_IsResultOfSplit
5820
5822
5827
5828
5829
5831
5835
5836
5837
5839
5842
5843
5844
5850
5851
5859
5862
5863
5865
5866
5868
5869
5874
5875
5880
5881
5883
5884
5886 {
5891
5892 if (!
GetGame().IsDedicatedServer())
5893 {
5895 {
5897
5899 {
5901 }
5902 }
5903
5906 }
5907
5908 m_OldLocation = null;
5909
5911 {
5913 }
5914
5915 if (ConfigIsExisting("headSelectionsToHide"))
5916 {
5919 }
5920
5922 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
5923 {
5925 }
5926
5928
5929 m_IsResultOfSplit = false;
5930
5932 }
5933
5935 {
5936 super.InitItemVariables();
5937
5943 m_Count = ConfigGetInt(
"count");
5944
5947
5952
5955
5960
5972
5976
5977
5980 if (ConfigIsExisting("canBeSplit"))
5981 {
5984 }
5985
5987 if (ConfigIsExisting("itemBehaviour"))
5989
5990
5993 RegisterNetSyncVariableInt("m_VarLiquidType");
5994 RegisterNetSyncVariableInt("m_Cleanness",0,1);
5995
5996 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
5997 RegisterNetSyncVariableFloat("m_ImpactSpeed");
5998 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
5999
6000 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6001 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6002 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6003 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6004
6005 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6006 RegisterNetSyncVariableBool("m_IsTakeable");
6007 RegisterNetSyncVariableBool("m_IsHologram");
6008
6011 {
6014 }
6015
6017
6019 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6021
6022 }
6023
6025 {
6027 }
6028
6030 {
6033 {
6038 }
6039 }
6040
6041 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6042 {
6044 {
6047 }
6048
6050 }
6051
6053 {
6059 }
6060
6062
6064 {
6066
6067 if (!action)
6068 {
6069 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6070 return;
6071 }
6072
6074 if (!ai)
6075 {
6077 return;
6078 }
6079
6081 if (!action_array)
6082 {
6083 action_array = new array<ActionBase_Basic>;
6085 }
6086 if (LogManager.IsActionLogEnable())
6087 {
6088 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6089 }
6090
6091 if (action_array.Find(action) != -1)
6092 {
6093 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6094 }
6095 else
6096 {
6097 action_array.Insert(action);
6098 }
6099 }
6100
6102 {
6104 ActionBase action = player.GetActionManager().GetAction(actionName);
6107
6108 if (action_array)
6109 {
6110 action_array.RemoveItem(action);
6111 }
6112 }
6113
6114
6115
6117 {
6118 ActionOverrideData overrideData = new ActionOverrideData();
6122
6124 if (!actionMap)
6125 {
6128 }
6129
6130 actionMap.Insert(this.
Type(), overrideData);
6131
6132 }
6133
6135
6137
6138
6140 {
6143
6146
6147 string config_to_search = "CfgVehicles";
6148 string muzzle_owner_config;
6149
6151 {
6152 if (IsInherited(Weapon))
6153 config_to_search = "CfgWeapons";
6154
6155 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6156
6157 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6158
6160
6161 if (config_OnFire_subclass_count > 0)
6162 {
6163 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6164
6165 for (int i = 0; i < config_OnFire_subclass_count; i++)
6166 {
6167 string particle_class = "";
6169 string config_OnFire_entry = config_OnFire_class + particle_class;
6170 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6171 WPOF_array.Insert(WPOF);
6172 }
6173
6174
6176 }
6177 }
6178
6180 {
6181 config_to_search = "CfgWeapons";
6182 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6183
6184 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6185
6187
6188 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6189 {
6190 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6191
6192 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6193 {
6194 string particle_class2 = "";
6196 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6197 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6198 WPOBE_array.Insert(WPOBE);
6199 }
6200
6201
6203 }
6204 }
6205 }
6206
6207
6209 {
6212
6214 {
6215 string config_to_search = "CfgVehicles";
6216
6217 if (IsInherited(Weapon))
6218 config_to_search = "CfgWeapons";
6219
6220 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6221 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6222
6223 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6224 {
6225
6227
6229 {
6231 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6233 return;
6234 }
6235
6238
6239
6240
6242 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6243
6244 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6245 {
6246 string particle_class = "";
6248 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6250
6251 if (entry_type == CT_CLASS)
6252 {
6253 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6254 WPOOH_array.Insert(WPOF);
6255 }
6256 }
6257
6258
6260 }
6261 }
6262 }
6263
6265 {
6267 }
6268
6270 {
6272 {
6274
6277
6280
6281 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6282 }
6283 }
6284
6286 {
6288 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6289
6291 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6292
6294 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6295
6297 {
6299 }
6300 }
6301
6303 {
6305 }
6306
6308 {
6311 else
6313
6315 {
6318 }
6319 else
6320 {
6323
6326 }
6327
6329 }
6330
6332 {
6334 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6335 }
6336
6338 {
6340 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6342 }
6343
6345 {
6347 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6348 }
6349
6351 {
6354
6355 OverheatingParticle OP = new OverheatingParticle();
6360
6362 }
6363
6365 {
6368
6369 return -1;
6370 }
6371
6373 {
6375 {
6378
6379 for (int i = count; i > 0; --i)
6380 {
6381 int id = i - 1;
6384
6387
6388 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6389 {
6390 if (p)
6391 {
6394 }
6395 }
6396 }
6397 }
6398 }
6399
6401 {
6403 {
6405 {
6406 int id = i - 1;
6408
6409 if (OP)
6410 {
6412
6413 if (p)
6414 {
6416 }
6417
6418 delete OP;
6419 }
6420 }
6421
6424 }
6425 }
6426
6429 {
6430 return 0.0;
6431 }
6432
6433
6435 {
6436 return 250;
6437 }
6438
6440 {
6441 return 0;
6442 }
6443
6446 {
6448 return true;
6449
6450 return false;
6451 }
6452
6455 {
6458
6460 {
6462 }
6463 else
6464 {
6465
6467 }
6468
6470 }
6471
6478 {
6479 return -1;
6480 }
6481
6482
6483
6484
6486 {
6488 {
6490 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6491
6492 if (r_index >= 0)
6493 {
6494 InventoryLocation r_il = new InventoryLocation;
6495 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6496
6497 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6500 {
6501 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6502 }
6504 {
6505 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6506 }
6507
6508 }
6509
6510 player.GetHumanInventory().ClearUserReservedLocation(this);
6511 }
6512
6515 }
6516
6517
6518
6519
6521 {
6522 return ItemBase.m_DebugActionsMask;
6523 }
6524
6526 {
6527 return ItemBase.m_DebugActionsMask & mask;
6528 }
6529
6531 {
6532 ItemBase.m_DebugActionsMask = mask;
6533 }
6534
6536 {
6537 ItemBase.m_DebugActionsMask |= mask;
6538 }
6539
6541 {
6542 ItemBase.m_DebugActionsMask &= ~mask;
6543 }
6544
6546 {
6548 {
6550 }
6551 else
6552 {
6554 }
6555 }
6556
6557
6559 {
6560 if (GetEconomyProfile())
6561 {
6562 float q_max = GetEconomyProfile().GetQuantityMax();
6563 if (q_max > 0)
6564 {
6565 float q_min = GetEconomyProfile().GetQuantityMin();
6566 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6567
6569 {
6570 ComponentEnergyManager comp = GetCompEM();
6572 {
6574 }
6575 }
6577 {
6579
6580 }
6581
6582 }
6583 }
6584 }
6585
6588 {
6589 EntityAI parent = GetHierarchyParent();
6590
6591 if (parent)
6592 {
6593 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6594 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6595 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6596 }
6597 }
6598
6601 {
6602 EntityAI parent = GetHierarchyParent();
6603
6604 if (parent)
6605 {
6606 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6607 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6608 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6609 }
6610 }
6611
6613 {
6614
6615
6616
6617
6619
6621 {
6622 if (ScriptInputUserData.CanStoreInputUserData())
6623 {
6624 ScriptInputUserData ctx = new ScriptInputUserData;
6630 ctx.
Write(use_stack_max);
6633
6635 {
6636 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6637 }
6638 }
6639 }
6640 else if (!
GetGame().IsMultiplayer())
6641 {
6643 }
6644 }
6645
6647 {
6649 }
6650
6652 {
6654 }
6655
6657 {
6659 }
6660
6662 {
6663
6664 return false;
6665 }
6666
6668 {
6669 return false;
6670 }
6671
6675 {
6676 return false;
6677 }
6678
6680 {
6681 return "";
6682 }
6683
6685
6687 {
6688 return false;
6689 }
6690
6692 {
6693 return true;
6694 }
6695
6696
6697
6699 {
6700 return true;
6701 }
6702
6704 {
6705 return true;
6706 }
6707
6709 {
6710 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6712 }
6713
6715 {
6717 }
6718
6720 {
6722 if (!is_being_placed)
6724 SetSynchDirty();
6725 }
6726
6727
6729
6731 {
6733 }
6734
6736 {
6738 }
6739
6741 {
6742 return 1;
6743 }
6744
6746 {
6747 return false;
6748 }
6749
6751 {
6753 SetSynchDirty();
6754 }
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6791 {
6792 super.OnMovedInsideCargo(container);
6793
6794 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6795 }
6796
6797 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6798 {
6799 super.EEItemLocationChanged(oldLoc,newLoc);
6800
6801 PlayerBase new_player = null;
6802 PlayerBase old_player = null;
6803
6804 if (newLoc.GetParent())
6805 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6806
6807 if (oldLoc.GetParent())
6808 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6809
6811 {
6812 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6813
6814 if (r_index >= 0)
6815 {
6816 InventoryLocation r_il = new InventoryLocation;
6817 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6818
6819 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6822 {
6823 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6824 }
6826 {
6827 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6828 }
6829
6830 }
6831 }
6832
6834 {
6835 if (new_player)
6836 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6837
6838 if (new_player == old_player)
6839 {
6840
6841 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6842 {
6844 {
6845 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6846 {
6847 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6848 }
6849 }
6850 else
6851 {
6852 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6853 }
6854 }
6855
6856 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6857 {
6858 int type = oldLoc.GetType();
6860 {
6861 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6862 }
6864 {
6865 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6866 }
6867 }
6868 if (!m_OldLocation)
6869 {
6870 m_OldLocation = new InventoryLocation;
6871 }
6872 m_OldLocation.Copy(oldLoc);
6873 }
6874 else
6875 {
6876 if (m_OldLocation)
6877 {
6878 m_OldLocation.Reset();
6879 }
6880 }
6881
6883 }
6884 else
6885 {
6886 if (new_player)
6887 {
6888 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6889 if (res_index >= 0)
6890 {
6891 InventoryLocation il = new InventoryLocation;
6892 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6894 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6897 {
6898 il.
GetParent().GetOnReleaseLock().Invoke(it);
6899 }
6901 {
6903 }
6904
6905 }
6906 }
6908 {
6909
6911 }
6912
6913 if (m_OldLocation)
6914 {
6915 m_OldLocation.Reset();
6916 }
6917 }
6918 }
6919
6920 override void EOnContact(IEntity other, Contact extra)
6921 {
6923 {
6924 int liquidType = -1;
6926 if (impactSpeed > 0.0)
6927 {
6929 #ifndef SERVER
6931 #else
6933 SetSynchDirty();
6934 #endif
6936 }
6937 }
6938
6939 #ifdef SERVER
6940 if (GetCompEM() && GetCompEM().IsPlugged())
6941 {
6942 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
6943 GetCompEM().UnplugThis();
6944 }
6945 #endif
6946 }
6947
6949
6951 {
6953 }
6954
6956 {
6957
6958 }
6959
6961 {
6962 super.OnItemLocationChanged(old_owner, new_owner);
6963
6964 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
6965 PlayerBase playerNew = PlayerBase.Cast(new_owner);
6966
6967 if (!relatedPlayer && playerNew)
6968 relatedPlayer = playerNew;
6969
6970 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
6971 {
6973 if (actionMgr)
6974 {
6975 ActionBase currentAction = actionMgr.GetRunningAction();
6976 if (currentAction)
6978 }
6979 }
6980
6981 Man ownerPlayerOld = null;
6982 Man ownerPlayerNew = null;
6983
6984 if (old_owner)
6985 {
6986 if (old_owner.
IsMan())
6987 {
6988 ownerPlayerOld = Man.Cast(old_owner);
6989 }
6990 else
6991 {
6992 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
6993 }
6994 }
6995 else
6996 {
6998 {
7000
7001 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7002 {
7003 GetCompEM().UnplugThis();
7004 }
7005 }
7006 }
7007
7008 if (new_owner)
7009 {
7010 if (new_owner.
IsMan())
7011 {
7012 ownerPlayerNew = Man.Cast(new_owner);
7013 }
7014 else
7015 {
7016 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7017 }
7018 }
7019
7020 if (ownerPlayerOld != ownerPlayerNew)
7021 {
7022 if (ownerPlayerOld)
7023 {
7024 array<EntityAI> subItemsExit = new array<EntityAI>;
7026 for (int i = 0; i < subItemsExit.Count(); i++)
7027 {
7030 }
7031 }
7032
7033 if (ownerPlayerNew)
7034 {
7035 array<EntityAI> subItemsEnter = new array<EntityAI>;
7037 for (int j = 0; j < subItemsEnter.Count(); j++)
7038 {
7041 }
7042 }
7043 }
7044 else if (ownerPlayerNew != null)
7045 {
7046 PlayerBase nplayer;
7047 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7048 {
7049 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7051 for (int k = 0; k < subItemsUpdate.Count(); k++)
7052 {
7054 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7055 }
7056 }
7057 }
7058
7059 if (old_owner)
7060 old_owner.OnChildItemRemoved(this);
7061 if (new_owner)
7062 new_owner.OnChildItemReceived(this);
7063 }
7064
7065
7067 {
7068 super.EEDelete(parent);
7069 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7070 if (player)
7071 {
7073
7074 if (player.IsAlive())
7075 {
7076 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7077 if (r_index >= 0)
7078 {
7079 InventoryLocation r_il = new InventoryLocation;
7080 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7081
7082 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7085 {
7086 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7087 }
7089 {
7090 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7091 }
7092
7093 }
7094
7095 player.RemoveQuickBarEntityShortcut(this);
7096 }
7097 }
7098 }
7099
7101 {
7102 super.EEKilled(killer);
7103
7106 {
7107 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7108 {
7109 if (IsMagazine())
7110 {
7111 if (Magazine.Cast(this).GetAmmoCount() > 0)
7112 {
7114 }
7115 }
7116 else
7117 {
7119 }
7120 }
7121 }
7122 }
7123
7125 {
7126 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7127
7128 super.OnWasAttached(parent, slot_id);
7129
7132
7134 }
7135
7137 {
7138 super.OnWasDetached(parent, slot_id);
7139
7142 }
7143
7145 {
7146 int idx;
7149
7150 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7151 if (inventory_slots.Count() < 1)
7152 {
7153 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7154 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7155 }
7156 else
7157 {
7158 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7159 }
7160
7161 idx = inventory_slots.Find(slot);
7162 if (idx < 0)
7163 return "";
7164
7165 return attach_types.Get(idx);
7166 }
7167
7169 {
7170 int idx = -1;
7171 string slot;
7172
7175
7176 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7177 if (inventory_slots.Count() < 1)
7178 {
7179 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7180 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7181 }
7182 else
7183 {
7184 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7185 if (detach_types.Count() < 1)
7186 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7187 }
7188
7189 for (int i = 0; i < inventory_slots.Count(); i++)
7190 {
7191 slot = inventory_slots.Get(i);
7192 }
7193
7194 if (slot != "")
7195 {
7196 if (detach_types.Count() == 1)
7197 idx = 0;
7198 else
7199 idx = inventory_slots.Find(slot);
7200 }
7201 if (idx < 0)
7202 return "";
7203
7204 return detach_types.Get(idx);
7205 }
7206
7208 {
7209
7211
7212
7213 float min_time = 1;
7214 float max_time = 3;
7215 float delay = Math.RandomFloat(min_time, max_time);
7216
7217 explode_timer.Run(delay, this, "DoAmmoExplosion");
7218 }
7219
7221 {
7222 Magazine magazine = Magazine.Cast(this);
7223 int pop_sounds_count = 6;
7224 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7225
7226
7227 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7228 string sound_name = pop_sounds[ sound_idx ];
7230
7231
7232 magazine.ServerAddAmmoCount(-1);
7233
7234
7235 float min_temp_to_explode = 100;
7236
7237 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
7238 {
7240 }
7241 }
7242
7243
7244 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7245 {
7246 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7247
7248 const int CHANCE_DAMAGE_CARGO = 4;
7249 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7250 const int CHANCE_DAMAGE_NOTHING = 2;
7251
7253 {
7254 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7255 int chances;
7256 int rnd;
7257
7258 if (GetInventory().GetCargo())
7259 {
7260 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7261 rnd = Math.RandomInt(0,chances);
7262
7263 if (rnd < CHANCE_DAMAGE_CARGO)
7264 {
7266 }
7267 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7268 {
7270 }
7271 }
7272 else
7273 {
7274 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7275 rnd = Math.RandomInt(0,chances);
7276
7277 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7278 {
7280 }
7281 }
7282 }
7283 }
7284
7286 {
7287 if (GetInventory().GetCargo())
7288 {
7289 int item_count = GetInventory().GetCargo().GetItemCount();
7290 if (item_count > 0)
7291 {
7292 int random_pick = Math.RandomInt(0, item_count);
7294 if (!item.IsExplosive())
7295 {
7296 item.AddHealth("","",damage);
7297 return true;
7298 }
7299 }
7300 }
7301 return false;
7302 }
7303
7305 {
7306 int attachment_count = GetInventory().AttachmentCount();
7307 if (attachment_count > 0)
7308 {
7309 int random_pick = Math.RandomInt(0, attachment_count);
7310 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7311 if (!attachment.IsExplosive())
7312 {
7313 attachment.AddHealth("","",damage);
7314 return true;
7315 }
7316 }
7317 return false;
7318 }
7319
7321 {
7323 }
7324
7326 {
7328 return GetInventory().CanRemoveEntity();
7329
7330 return false;
7331 }
7332
7334 {
7335
7337 return false;
7338
7339
7341 return false;
7342
7343
7344
7346 if (delta == 0)
7347 return false;
7348
7349
7350 return true;
7351 }
7352
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 {
7378 float split_quantity_new;
7382 InventoryLocation loc = new InventoryLocation;
7383
7384 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7385 {
7387 split_quantity_new = stack_max;
7388 else
7390
7392 {
7393 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7394 if (new_item)
7395 {
7396 new_item.SetResultOfSplit(true);
7397 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7399 new_item.
SetQuantity(split_quantity_new,
false,
true);
7400 }
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 {
7413 {
7416 }
7417
7418 if (new_item)
7419 {
7420 new_item.SetResultOfSplit(true);
7421 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7423 new_item.
SetQuantity(split_quantity_new,
false,
true);
7424 }
7425 }
7426 }
7427 else
7428 {
7429 if (stack_max != 0)
7430 {
7432 {
7434 }
7435
7436 if (split_quantity_new == 0)
7437 {
7438 if (!
GetGame().IsMultiplayer())
7439 player.PhysicalPredictiveDropItem(this);
7440 else
7441 player.ServerDropEntity(this);
7442 return;
7443 }
7444
7446 {
7448
7449 if (new_item)
7450 {
7451 new_item.SetResultOfSplit(true);
7452 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7455 new_item.PlaceOnSurface();
7456 }
7457 }
7458 }
7459 }
7460 }
7461
7463 {
7464 float split_quantity_new;
7468 InventoryLocation loc = new InventoryLocation;
7469
7470 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7471 {
7473 split_quantity_new = stack_max;
7474 else
7476
7478 {
7479 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7480 if (new_item)
7481 {
7482 new_item.SetResultOfSplit(true);
7483 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7485 new_item.
SetQuantity(split_quantity_new,
false,
true);
7486 }
7487 }
7488 }
7489 else if (destination_entity && slot_id == -1)
7490 {
7491 if (quantity > stack_max)
7492 split_quantity_new = stack_max;
7493 else
7494 split_quantity_new = quantity;
7495
7497 {
7499 {
7502 }
7503
7504 if (new_item)
7505 {
7506 new_item.SetResultOfSplit(true);
7507 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7509 new_item.
SetQuantity(split_quantity_new,
false,
true);
7510 }
7511 }
7512 }
7513 else
7514 {
7515 if (stack_max != 0)
7516 {
7518 {
7520 }
7521
7523 {
7525
7526 if (new_item)
7527 {
7528 new_item.SetResultOfSplit(true);
7529 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7532 new_item.PlaceOnSurface();
7533 }
7534 }
7535 }
7536 }
7537 }
7538
7540 {
7542 {
7543 if (ScriptInputUserData.CanStoreInputUserData())
7544 {
7545 ScriptInputUserData ctx = new ScriptInputUserData;
7550 dst.WriteToContext(ctx);
7552 }
7553 }
7554 else if (!
GetGame().IsMultiplayer())
7555 {
7557 }
7558 }
7559
7561 {
7563 {
7564 if (ScriptInputUserData.CanStoreInputUserData())
7565 {
7566 ScriptInputUserData ctx = new ScriptInputUserData;
7571 ctx.
Write(destination_entity);
7577 }
7578 }
7579 else if (!
GetGame().IsMultiplayer())
7580 {
7582 }
7583 }
7584
7586 {
7588 }
7589
7591 {
7593 float split_quantity_new;
7595 if (dst.IsValid())
7596 {
7597 int slot_id = dst.GetSlot();
7599
7600 if (quantity > stack_max)
7601 split_quantity_new = stack_max;
7602 else
7603 split_quantity_new = quantity;
7604
7606 {
7608
7609 if (new_item)
7610 {
7611 new_item.SetResultOfSplit(true);
7612 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7614 new_item.
SetQuantity(split_quantity_new,
false,
true);
7615 }
7616
7617 return new_item;
7618 }
7619 }
7620
7621 return null;
7622 }
7623
7625 {
7627 float split_quantity_new;
7629 if (destination_entity)
7630 {
7632 if (quantity > stackable)
7633 split_quantity_new = stackable;
7634 else
7635 split_quantity_new = quantity;
7636
7638 {
7639 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7640 if (new_item)
7641 {
7642 new_item.SetResultOfSplit(true);
7643 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7645 new_item.
SetQuantity(split_quantity_new,
false,
true);
7646 }
7647 }
7648 }
7649 }
7650
7652 {
7654 {
7655 if (ScriptInputUserData.CanStoreInputUserData())
7656 {
7657 ScriptInputUserData ctx = new ScriptInputUserData;
7662 ItemBase destination_entity =
this;
7663 ctx.
Write(destination_entity);
7667 }
7668 }
7669 else if (!
GetGame().IsMultiplayer())
7670 {
7672 }
7673 }
7674
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
7689 {
7690 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7691 new_item =
ItemBase.Cast(in_hands);
7692 if (new_item)
7693 {
7694 new_item.SetResultOfSplit(true);
7695 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7697 new_item.SetQuantity(split_quantity_new, false, true);
7698 }
7699 }
7700 }
7701 }
7702
7704 {
7706 float split_quantity_new = Math.Floor(quantity * 0.5);
7707
7709 return;
7710
7712
7713 if (new_item)
7714 {
7715 if (new_item.GetQuantityMax() < split_quantity_new)
7716 {
7717 split_quantity_new = new_item.GetQuantityMax();
7718 }
7719
7720 new_item.SetResultOfSplit(true);
7721 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7722
7724 {
7727 }
7728 else
7729 {
7731 new_item.
SetQuantity(split_quantity_new,
false,
true);
7732 }
7733 }
7734 }
7735
7737 {
7739 float split_quantity_new = Math.Floor(quantity / 2);
7740
7742 return;
7743
7744 InventoryLocation invloc = new InventoryLocation;
7746
7748 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7749
7750 if (new_item)
7751 {
7752 if (new_item.GetQuantityMax() < split_quantity_new)
7753 {
7754 split_quantity_new = new_item.GetQuantityMax();
7755 }
7757 {
7760 }
7761 else if (split_quantity_new > 1)
7762 {
7764 new_item.
SetQuantity(split_quantity_new,
false,
true);
7765 }
7766 }
7767 }
7768
7771 {
7772 SetWeightDirty();
7774
7775 if (parent)
7776 parent.OnAttachmentQuantityChangedEx(this, delta);
7777
7779 {
7781 {
7783 }
7785 {
7786 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7788 }
7789 }
7790
7791 }
7792
7795 {
7796
7797 }
7798
7801 {
7803 }
7804
7806 {
7807 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7808
7810 {
7811 if (newLevel == GameConstants.STATE_RUINED)
7812 {
7814 EntityAI parent = GetHierarchyParent();
7815 if (parent && parent.IsFireplace())
7816 {
7817 CargoBase cargo = GetInventory().GetCargo();
7818 if (cargo)
7819 {
7821 {
7823 }
7824 }
7825 }
7826 }
7827
7829 {
7830
7832 return;
7833 }
7834
7835 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7836 {
7838 }
7839 }
7840 }
7841
7842
7844 {
7845 super.OnRightClick();
7846
7848 {
7850 {
7851 if (ScriptInputUserData.CanStoreInputUserData())
7852 {
7853 EntityAI root = GetHierarchyRoot();
7854 Man playerOwner = GetHierarchyRootPlayer();
7855 InventoryLocation dst = new InventoryLocation;
7856
7857
7858 if (!playerOwner && root && root == this)
7859 {
7861 }
7862 else
7863 {
7864
7865 GetInventory().GetCurrentInventoryLocation(dst);
7867 {
7870 {
7872 }
7873 else
7874 {
7876
7877
7878 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7879 {
7881 }
7882 else
7883 {
7884 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7885 }
7886 }
7887 }
7888 }
7889
7890 ScriptInputUserData ctx = new ScriptInputUserData;
7898 }
7899 }
7900 else if (!
GetGame().IsMultiplayer())
7901 {
7903 }
7904 }
7905 }
7906
7908 {
7909 if (root)
7910 {
7911 vector m4[4];
7912 root.GetTransform(m4);
7913 dst.SetGround(this, m4);
7914 }
7915 else
7916 {
7917 GetInventory().GetCurrentInventoryLocation(dst);
7918 }
7919 }
7920
7921 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
7922 {
7923
7924 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
7925 return false;
7926
7927 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
7928 return false;
7929
7930
7932 return false;
7933
7934
7935 Magazine mag = Magazine.Cast(this);
7936 if (mag)
7937 {
7938 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
7939 return false;
7940
7941 if (stack_max_limit)
7942 {
7943 Magazine other_mag = Magazine.Cast(other_item);
7944 if (other_item)
7945 {
7946 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
7947 return false;
7948 }
7949
7950 }
7951 }
7952 else
7953 {
7954
7956 return false;
7957
7959 return false;
7960 }
7961
7962 PlayerBase player = null;
7963 if (CastTo(player, GetHierarchyRootPlayer()))
7964 {
7965 if (player.GetInventory().HasAttachment(this))
7966 return false;
7967
7968 if (player.IsItemsToDelete())
7969 return false;
7970 }
7971
7972 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
7973 return false;
7974
7975 int slotID;
7977 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
7978 return false;
7979
7980 return true;
7981 }
7982
7984 {
7986 }
7987
7989 {
7990 return m_IsResultOfSplit;
7991 }
7992
7994 {
7995 m_IsResultOfSplit = value;
7996 }
7997
7999 {
8001 }
8002
8004 {
8005 float other_item_quantity = other_item.GetQuantity();
8006 float this_free_space;
8007
8009
8011
8012 if (other_item_quantity > this_free_space)
8013 {
8014 return this_free_space;
8015 }
8016 else
8017 {
8018 return other_item_quantity;
8019 }
8020 }
8021
8023 {
8025 }
8026
8028 {
8030 return;
8031
8032 if (!IsMagazine() && other_item)
8033 {
8035 if (quantity_used != 0)
8036 {
8037 float hp1 = GetHealth01("","");
8038 float hp2 = other_item.GetHealth01("","");
8039 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8040 hpResult = hpResult / (
GetQuantity() + quantity_used);
8041
8042 hpResult *= GetMaxHealth();
8043 Math.Round(hpResult);
8044 SetHealth("", "Health", hpResult);
8045
8047 other_item.AddQuantity(-quantity_used);
8048 }
8049 }
8051 }
8052
8054 {
8055 #ifdef SERVER
8056 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8057 GetHierarchyParent().IncreaseLifetimeUp();
8058 #endif
8059 };
8060
8062 {
8063 PlayerBase p = PlayerBase.Cast(player);
8064
8065 array<int> recipesIds = p.m_Recipes;
8066 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8067 if (moduleRecipesManager)
8068 {
8069 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8070 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8071 }
8072
8073 for (int i = 0;i < recipesIds.Count(); i++)
8074 {
8075 int key = recipesIds.Get(i);
8076 string recipeName = moduleRecipesManager.GetRecipeName(key);
8078 }
8079 }
8080
8081
8082 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8083 {
8084 super.GetDebugActions(outputList);
8085
8086
8092
8093
8098
8103
8104
8108
8109
8111 {
8115 }
8116
8119
8120
8124
8126
8127 InventoryLocation loc = new InventoryLocation();
8128 GetInventory().GetCurrentInventoryLocation(loc);
8130 {
8131 if (Gizmo_IsSupported())
8134 }
8135
8137 }
8138
8139
8140
8141
8143 {
8144 super.OnAction(action_id, player, ctx);
8145
8147 {
8148 switch (action_id)
8149 {
8152 return true;
8155 return true;
8156 }
8157 }
8158
8160 {
8161 switch (action_id)
8162 {
8164 Delete();
8165 return true;
8166 }
8167 }
8168
8169 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8170 {
8171 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8172 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8173 PlayerBase p = PlayerBase.Cast(player);
8174 if (
EActions.RECIPES_RANGE_START < 1000)
8175 {
8176 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8177 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8178 }
8179 }
8180 #ifndef SERVER
8181 else if (action_id ==
EActions.WATCH_PLAYER)
8182 {
8183 PluginDeveloper.SetDeveloperItemClientEx(player);
8184 }
8185 #endif
8187 {
8188 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8189 {
8190 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8191 OnDebugButtonPressServer(id + 1);
8192 }
8193
8194 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8195 {
8196 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8198 }
8199
8200 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8201 {
8202 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8204 }
8205
8206 else if (action_id ==
EActions.ADD_QUANTITY)
8207 {
8208 if (IsMagazine())
8209 {
8210 Magazine mag = Magazine.Cast(this);
8211 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8212 }
8213 else
8214 {
8216 }
8217
8218 if (m_EM)
8219 {
8220 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8221 }
8222
8223 }
8224
8225 else if (action_id ==
EActions.REMOVE_QUANTITY)
8226 {
8227 if (IsMagazine())
8228 {
8229 Magazine mag2 = Magazine.Cast(this);
8230 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8231 }
8232 else
8233 {
8235 }
8236 if (m_EM)
8237 {
8238 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8239 }
8240
8241 }
8242
8243 else if (action_id ==
EActions.SET_QUANTITY_0)
8244 {
8246
8247 if (m_EM)
8248 {
8249 m_EM.SetEnergy(0);
8250 }
8251 }
8252
8253 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8254 {
8256
8257 if (m_EM)
8258 {
8259 m_EM.SetEnergy(m_EM.GetEnergyMax());
8260 }
8261 }
8262
8263 else if (action_id ==
EActions.ADD_HEALTH)
8264 {
8265 AddHealth("","",GetMaxHealth("","Health")/5);
8266 }
8267 else if (action_id ==
EActions.REMOVE_HEALTH)
8268 {
8269 AddHealth("","",-GetMaxHealth("","Health")/5);
8270 }
8271 else if (action_id ==
EActions.DESTROY_HEALTH)
8272 {
8273 SetHealth01("","",0);
8274 }
8275 else if (action_id ==
EActions.WATCH_ITEM)
8276 {
8278 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8279 #ifdef DEVELOPER
8280 SetDebugDeveloper_item(this);
8281 #endif
8282 }
8283
8284 else if (action_id ==
EActions.ADD_TEMPERATURE)
8285 {
8286 AddTemperature(20);
8287
8288 }
8289
8290 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8291 {
8292 AddTemperature(-20);
8293
8294 }
8295
8296 else if (action_id ==
EActions.FLIP_FROZEN)
8297 {
8298 SetFrozen(!GetIsFrozen());
8299
8300 }
8301
8302 else if (action_id ==
EActions.ADD_WETNESS)
8303 {
8305
8306 }
8307
8308 else if (action_id ==
EActions.REMOVE_WETNESS)
8309 {
8311
8312 }
8313
8314 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8315 {
8318
8319
8320 }
8321
8322 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8323 {
8326 }
8327
8328 else if (action_id ==
EActions.MAKE_SPECIAL)
8329 {
8330 auto debugParams = DebugSpawnParams.WithPlayer(player);
8331 OnDebugSpawnEx(debugParams);
8332 }
8333
8334 }
8335
8336
8337 return false;
8338 }
8339
8340
8341
8342
8346
8349
8350
8351
8353 {
8354 return false;
8355 }
8356
8357
8359 {
8360 return true;
8361 }
8362
8363
8365 {
8366 return true;
8367 }
8368
8369
8370
8372 {
8373 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8375 }
8376
8379 {
8380 return null;
8381 }
8382
8384 {
8385 return false;
8386 }
8387
8389 {
8390 return false;
8391 }
8392
8396
8397
8399 {
8400 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8401 return module_repairing.CanRepair(this, item_repair_kit);
8402 }
8403
8404
8405 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8406 {
8407 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8408 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8409 }
8410
8411
8413 {
8414
8415
8416
8417
8418
8419
8420
8421
8422 return 1;
8423 }
8424
8425
8426
8428 {
8430 }
8431
8432
8433
8435 {
8437 }
8438
8439
8448 {
8449 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8450
8451 if (player)
8452 {
8453 player.MessageStatus(text);
8454 }
8455 }
8456
8457
8466 {
8467 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8468
8469 if (player)
8470 {
8471 player.MessageAction(text);
8472 }
8473 }
8474
8475
8484 {
8485 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8486
8487 if (player)
8488 {
8489 player.MessageFriendly(text);
8490 }
8491 }
8492
8493
8502 {
8503 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8504
8505 if (player)
8506 {
8507 player.MessageImportant(text);
8508 }
8509 }
8510
8512 {
8513 return true;
8514 }
8515
8516
8517 override bool KindOf(
string tag)
8518 {
8519 bool found = false;
8520 string item_name = this.
GetType();
8523
8524 int array_size = item_tag_array.Count();
8525 for (int i = 0; i < array_size; i++)
8526 {
8527 if (item_tag_array.Get(i) == tag)
8528 {
8529 found = true;
8530 break;
8531 }
8532 }
8533 return found;
8534 }
8535
8536
8538 {
8539
8540 super.OnRPC(sender, rpc_type,ctx);
8541
8542
8543 switch (rpc_type)
8544 {
8545 #ifndef SERVER
8546 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8547 Param2<bool, string> p = new Param2<bool, string>(false, "");
8548
8550 return;
8551
8552 bool play = p.param1;
8553 string soundSet = p.param2;
8554
8555 if (play)
8556 {
8558 {
8560 {
8562 }
8563 }
8564 else
8565 {
8567 }
8568 }
8569 else
8570 {
8572 }
8573
8574 break;
8575 #endif
8576
8577 }
8578
8580 {
8582 }
8583 }
8584
8585
8586
8587
8589 {
8590 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8591 return plugin.GetID(
name);
8592 }
8593
8595 {
8596 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8597 return plugin.GetName(id);
8598 }
8599
8602 {
8603
8604
8605 int varFlags;
8606 if (!ctx.
Read(varFlags))
8607 return;
8608
8609 if (varFlags & ItemVariableFlags.FLOAT)
8610 {
8612 }
8613 }
8614
8616 {
8617
8618 super.SerializeNumericalVars(floats_out);
8619
8620
8621
8623 {
8625 }
8626
8628 {
8630 }
8631
8633 {
8635 }
8636
8638 {
8643 }
8644
8646 {
8648 }
8649 }
8650
8652 {
8653
8654 super.DeSerializeNumericalVars(floats);
8655
8656
8657 int index = 0;
8658 int mask = Math.Round(floats.Get(index));
8659
8660 index++;
8661
8663 {
8665 {
8667 }
8668 else
8669 {
8670 float quantity = floats.Get(index);
8672 }
8673 index++;
8674 }
8675
8677 {
8678 float wet = floats.Get(index);
8680 index++;
8681 }
8682
8684 {
8685 int liquidtype = Math.Round(floats.Get(index));
8687 index++;
8688 }
8689
8691 {
8693 index++;
8695 index++;
8697 index++;
8699 index++;
8700 }
8701
8703 {
8704 int cleanness = Math.Round(floats.Get(index));
8706 index++;
8707 }
8708 }
8709
8711 {
8712 super.WriteVarsToCTX(ctx);
8713
8714
8716 {
8718 }
8719
8721 {
8723 }
8724
8726 {
8728 }
8729
8731 {
8732 int r,g,b,a;
8738 }
8739
8741 {
8743 }
8744 }
8745
8747 {
8748 if (!super.ReadVarsFromCTX(ctx,version))
8749 return false;
8750
8751 int intValue;
8752 float value;
8753
8754 if (version < 140)
8755 {
8756 if (!ctx.
Read(intValue))
8757 return false;
8758
8759 m_VariablesMask = intValue;
8760 }
8761
8763 {
8764 if (!ctx.
Read(value))
8765 return false;
8766
8768 {
8770 }
8771 else
8772 {
8774 }
8775 }
8776
8777 if (version < 140)
8778 {
8780 {
8781 if (!ctx.
Read(value))
8782 return false;
8783 SetTemperatureDirect(value);
8784 }
8785 }
8786
8788 {
8789 if (!ctx.
Read(value))
8790 return false;
8792 }
8793
8795 {
8796 if (!ctx.
Read(intValue))
8797 return false;
8799 }
8800
8802 {
8803 int r,g,b,a;
8805 return false;
8807 return false;
8809 return false;
8811 return false;
8812
8814 }
8815
8817 {
8818 if (!ctx.
Read(intValue))
8819 return false;
8821 }
8822
8823 if (version >= 138 && version < 140)
8824 {
8826 {
8827 if (!ctx.
Read(intValue))
8828 return false;
8829 SetFrozen(intValue);
8830 }
8831 }
8832
8833 return true;
8834 }
8835
8836
8838 {
8841 {
8843 }
8844
8845 if (!super.OnStoreLoad(ctx, version))
8846 {
8848 return false;
8849 }
8850
8851 if (version >= 114)
8852 {
8853 bool hasQuickBarIndexSaved;
8854
8855 if (!ctx.
Read(hasQuickBarIndexSaved))
8856 {
8858 return false;
8859 }
8860
8861 if (hasQuickBarIndexSaved)
8862 {
8863 int itmQBIndex;
8864
8865
8866 if (!ctx.
Read(itmQBIndex))
8867 {
8869 return false;
8870 }
8871
8872 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8873 if (itmQBIndex != -1 && parentPlayer)
8874 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8875 }
8876 }
8877 else
8878 {
8879
8880 PlayerBase player;
8881 int itemQBIndex;
8882 if (version ==
int.
MAX)
8883 {
8884 if (!ctx.
Read(itemQBIndex))
8885 {
8887 return false;
8888 }
8889 }
8890 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8891 {
8892
8893 if (!ctx.
Read(itemQBIndex))
8894 {
8896 return false;
8897 }
8898 if (itemQBIndex != -1 && player)
8899 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8900 }
8901 }
8902
8903 if (version < 140)
8904 {
8905
8906 if (!LoadVariables(ctx, version))
8907 {
8909 return false;
8910 }
8911 }
8912
8913
8915 {
8917 return false;
8918 }
8919 if (version >= 132)
8920 {
8922 if (raib)
8923 {
8925 {
8927 return false;
8928 }
8929 }
8930 }
8931
8933 return true;
8934 }
8935
8936
8937
8939 {
8940 super.OnStoreSave(ctx);
8941
8942 PlayerBase player;
8943 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
8944 {
8946
8947 int itemQBIndex = -1;
8948 itemQBIndex = player.FindQuickBarEntityIndex(this);
8949 ctx.
Write(itemQBIndex);
8950 }
8951 else
8952 {
8954 }
8955
8957
8959 if (raib)
8960 {
8962 }
8963 }
8964
8965
8967 {
8968 super.AfterStoreLoad();
8969
8971 {
8973 }
8974
8976 {
8979 }
8980 }
8981
8983 {
8984 super.EEOnAfterLoad();
8985
8987 {
8989 }
8990
8993 }
8994
8996 {
8997 return false;
8998 }
8999
9000
9001
9003 {
9005 {
9006 #ifdef PLATFORM_CONSOLE
9007
9009 {
9011 if (menu)
9012 {
9014 }
9015 }
9016 #endif
9017 }
9018
9020 {
9023 }
9024
9026 {
9027 SetWeightDirty();
9029 }
9031 {
9034 }
9035
9037 {
9040 }
9042 {
9045 }
9046
9047 super.OnVariablesSynchronized();
9048 }
9049
9050
9051
9053 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9054 {
9055 if (!IsServerCheck(allow_client))
9056 return false;
9057
9059 return false;
9060
9063
9064 if (value <= (min + 0.001))
9065 value = min;
9066
9067 if (value == min)
9068 {
9069 if (destroy_config)
9070 {
9071 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9072 if (dstr)
9073 {
9075 this.Delete();
9076 return true;
9077 }
9078 }
9079 else if (destroy_forced)
9080 {
9082 this.Delete();
9083 return true;
9084 }
9085
9087 }
9088
9091
9093 {
9095
9096 if (delta)
9098 }
9099
9101
9102 return false;
9103 }
9104
9105
9107 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9108 {
9110 }
9111
9113 {
9116 }
9117
9119 {
9122 }
9123
9125 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9126 {
9127 float value_clamped = Math.Clamp(value, 0, 1);
9129 SetQuantity(result, destroy_config, destroy_forced);
9130 }
9131
9132
9135 {
9137 }
9138
9140 {
9142 }
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9154 {
9155 int slot = -1;
9156 if (GetInventory())
9157 {
9158 InventoryLocation il = new InventoryLocation;
9159 GetInventory().GetCurrentInventoryLocation(il);
9161 }
9162
9164 }
9165
9167 {
9168 float quantity_max = 0;
9169
9171 {
9172 if (attSlotID != -1)
9173 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9174
9175 if (quantity_max <= 0)
9177 }
9178
9179 if (quantity_max <= 0)
9181
9182 return quantity_max;
9183 }
9184
9186 {
9188 }
9189
9191 {
9193 }
9194
9195
9197 {
9199 }
9200
9202 {
9204 }
9205
9207 {
9209 }
9210
9211
9213 {
9214
9215 float weightEx = GetWeightEx();
9216 float special = GetInventoryAndCargoWeight();
9217 return weightEx - special;
9218 }
9219
9220
9222 {
9224 }
9225
9227 {
9229 {
9230 #ifdef DEVELOPER
9231 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9232 {
9233 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9235 }
9236 #endif
9237
9239 }
9240 else if (HasEnergyManager())
9241 {
9242 #ifdef DEVELOPER
9243 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9244 {
9245 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9246 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9247 }
9248 #endif
9249 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
9250 }
9251 else
9252 {
9253 #ifdef DEVELOPER
9254 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9255 {
9256 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9257 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9258 }
9259 #endif
9260 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9261 }
9262 }
9263
9266 {
9267 int item_count = 0;
9269
9270 if (GetInventory().GetCargo() != NULL)
9271 {
9272 item_count = GetInventory().GetCargo().GetItemCount();
9273 }
9274
9275 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9276 {
9277 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9278 if (item)
9279 item_count += item.GetNumberOfItems();
9280 }
9281 return item_count;
9282 }
9283
9286 {
9287 float weight = 0;
9288 float wetness = 1;
9289 if (include_wetness)
9292 {
9293 weight = wetness * m_ConfigWeight;
9294 }
9296 {
9297 weight = 1;
9298 }
9299 return weight;
9300 }
9301
9302
9303
9305 {
9306 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9307 {
9308 GameInventory inv = GetInventory();
9309 array<EntityAI> items = new array<EntityAI>;
9311 for (int i = 0; i < items.Count(); i++)
9312 {
9314 if (item)
9315 {
9317 }
9318 }
9319 }
9320 }
9321
9322
9323
9324
9326 {
9327 float energy = 0;
9328 if (HasEnergyManager())
9329 {
9330 energy = GetCompEM().GetEnergy();
9331 }
9332 return energy;
9333 }
9334
9335
9337 {
9338 super.OnEnergyConsumed();
9339
9341 }
9342
9344 {
9345 super.OnEnergyAdded();
9346
9348 }
9349
9350
9352 {
9353 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9354 {
9356 {
9357 float energy_0to1 = GetCompEM().GetEnergy0To1();
9359 }
9360 }
9361 }
9362
9363
9365 {
9366 return ConfigGetFloat("heatIsolation");
9367 }
9368
9370 {
9372 }
9373
9375 {
9376 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9377 if (
GetGame().ConfigIsExisting(paramPath))
9379
9380 return 0.0;
9381 }
9382
9384 {
9385 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9386 if (
GetGame().ConfigIsExisting(paramPath))
9388
9389 return 0.0;
9390 }
9391
9392 override void SetWet(
float value,
bool allow_client =
false)
9393 {
9394 if (!IsServerCheck(allow_client))
9395 return;
9396
9399
9401
9402 m_VarWet = Math.Clamp(value, min, max);
9403
9405 {
9408 }
9409 }
9410
9411 override void AddWet(
float value)
9412 {
9414 }
9415
9417 {
9419 }
9420
9422 {
9424 }
9425
9427 {
9429 }
9430
9432 {
9434 }
9435
9437 {
9439 }
9440
9442 {
9445 if (newLevel != oldLevel)
9446 {
9448 }
9449 }
9450
9452 {
9453 SetWeightDirty();
9454 }
9455
9457 {
9458 return GetWetLevelInternal(
m_VarWet);
9459 }
9460
9461
9462
9464 {
9466 }
9467
9469 {
9471 }
9472
9474 {
9476 }
9477
9479 {
9481 }
9482
9483
9484
9486 {
9487 if (ConfigIsExisting("itemModelLength"))
9488 {
9489 return ConfigGetFloat("itemModelLength");
9490 }
9491 return 0;
9492 }
9493
9495 {
9496 if (ConfigIsExisting("itemAttachOffset"))
9497 {
9498 return ConfigGetFloat("itemAttachOffset");
9499 }
9500 return 0;
9501 }
9502
9503 override void SetCleanness(
int value,
bool allow_client =
false)
9504 {
9505 if (!IsServerCheck(allow_client))
9506 return;
9507
9509
9511
9514 }
9515
9517 {
9519 }
9520
9522 {
9523 return true;
9524 }
9525
9526
9527
9528
9530 {
9532 }
9533
9535 {
9537 }
9538
9539
9540
9541
9542 override void SetColor(
int r,
int g,
int b,
int a)
9543 {
9549 }
9551 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9552 {
9557 }
9558
9560 {
9562 }
9563
9566 {
9567 int r,g,b,a;
9569 r = r/255;
9570 g = g/255;
9571 b = b/255;
9572 a = a/255;
9573 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9574 }
9575
9576
9577
9578 override void SetLiquidType(
int value,
bool allow_client =
false)
9579 {
9580 if (!IsServerCheck(allow_client))
9581 return;
9582
9587 }
9588
9590 {
9591 return ConfigGetInt("varLiquidTypeInit");
9592 }
9593
9595 {
9597 }
9598
9600 {
9602 SetFrozen(false);
9603 }
9604
9607 {
9608 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9609 }
9610
9611
9614 {
9615 PlayerBase nplayer;
9616 if (PlayerBase.CastTo(nplayer, player))
9617 {
9619
9620 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9621 }
9622 }
9623
9624
9627 {
9628 PlayerBase nplayer;
9629 if (PlayerBase.CastTo(nplayer,player))
9630 {
9631
9632 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9633
9634 }
9635
9636
9637 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9638
9639
9640 if (HasEnergyManager())
9641 {
9642 GetCompEM().UpdatePlugState();
9643 }
9644 }
9645
9646
9648 {
9649 super.OnPlacementStarted(player);
9650
9652 }
9653
9654 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9655 {
9657 {
9658 m_AdminLog.OnPlacementComplete(player,
this);
9659 }
9660
9661 super.OnPlacementComplete(player, position, orientation);
9662 }
9663
9664
9665
9666
9667
9669 {
9671 {
9672 return true;
9673 }
9674 else
9675 {
9676 return false;
9677 }
9678 }
9679
9680
9682 {
9684 {
9686 }
9687 }
9688
9689
9691 {
9693 }
9694
9696 {
9698 }
9699
9700 override void InsertAgent(
int agent,
float count = 1)
9701 {
9702 if (count < 1)
9703 return;
9704
9706 }
9707
9710 {
9712 }
9713
9714
9716 {
9718 }
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9762 {
9764 return false;
9765 return true;
9766 }
9767
9769 {
9770
9772 }
9773
9774
9777 {
9778 super.CheckForRoofLimited(timeTresholdMS);
9779
9781 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9782 {
9783 m_PreviousRoofTestTime = time;
9784 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9785 }
9786 }
9787
9788
9790 {
9792 {
9793 return 0;
9794 }
9795
9796 if (GetInventory().GetAttachmentSlotsCount() != 0)
9797 {
9798 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9799 if (filter)
9800 return filter.GetProtectionLevel(type, false, system);
9801 else
9802 return 0;
9803 }
9804
9805 string subclassPath, entryName;
9806
9807 switch (type)
9808 {
9810 entryName = "biological";
9811 break;
9813 entryName = "chemical";
9814 break;
9815 default:
9816 entryName = "biological";
9817 break;
9818 }
9819
9820 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9821
9823 }
9824
9825
9826
9829 {
9830 if (!IsMagazine())
9832
9834 }
9835
9836
9837
9838
9839
9844 {
9845 return true;
9846 }
9847
9849 {
9851 }
9852
9853
9854
9855
9856
9858 {
9859 if (parent)
9860 {
9861 if (parent.IsInherited(DayZInfected))
9862 return true;
9863
9864 if (!parent.IsRuined())
9865 return true;
9866 }
9867
9868 return true;
9869 }
9870
9872 {
9873 if (!super.CanPutAsAttachment(parent))
9874 {
9875 return false;
9876 }
9877
9878 if (!IsRuined() && !parent.IsRuined())
9879 {
9880 return true;
9881 }
9882
9883 return false;
9884 }
9885
9887 {
9888
9889
9890
9891
9892 return super.CanReceiveItemIntoCargo(item);
9893 }
9894
9896 {
9897
9898
9899
9900
9901 GameInventory attachmentInv = attachment.GetInventory();
9903 {
9904 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9905 return false;
9906 }
9907
9908 InventoryLocation loc = new InventoryLocation();
9909 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9910 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9911 return false;
9912
9913 return super.CanReceiveAttachment(attachment, slotId);
9914 }
9915
9917 {
9918 if (!super.CanReleaseAttachment(attachment))
9919 return false;
9920
9921 return GetInventory().AreChildrenAccessible();
9922 }
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9945 {
9946 int id = muzzle_owner.GetMuzzleID();
9947 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
9948
9949 if (WPOF_array)
9950 {
9951 for (int i = 0; i < WPOF_array.Count(); i++)
9952 {
9953 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
9954
9955 if (WPOF)
9956 {
9957 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
9958 }
9959 }
9960 }
9961 }
9962
9963
9965 {
9966 int id = muzzle_owner.GetMuzzleID();
9968
9969 if (WPOBE_array)
9970 {
9971 for (int i = 0; i < WPOBE_array.Count(); i++)
9972 {
9973 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
9974
9975 if (WPOBE)
9976 {
9977 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9978 }
9979 }
9980 }
9981 }
9982
9983
9985 {
9986 int id = muzzle_owner.GetMuzzleID();
9987 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
9988
9989 if (WPOOH_array)
9990 {
9991 for (int i = 0; i < WPOOH_array.Count(); i++)
9992 {
9993 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
9994
9995 if (WPOOH)
9996 {
9997 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
9998 }
9999 }
10000 }
10001 }
10002
10003
10005 {
10006 int id = muzzle_owner.GetMuzzleID();
10007 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10008
10009 if (WPOOH_array)
10010 {
10011 for (int i = 0; i < WPOOH_array.Count(); i++)
10012 {
10013 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10014
10015 if (WPOOH)
10016 {
10017 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10018 }
10019 }
10020 }
10021 }
10022
10023
10025 {
10026 int id = muzzle_owner.GetMuzzleID();
10027 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10028
10029 if (WPOOH_array)
10030 {
10031 for (int i = 0; i < WPOOH_array.Count(); i++)
10032 {
10033 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10034
10035 if (WPOOH)
10036 {
10037 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10038 }
10039 }
10040 }
10041 }
10042
10043
10044
10046 {
10048 {
10049 return true;
10050 }
10051
10052 return false;
10053 }
10054
10056 {
10058 {
10059 return true;
10060 }
10061
10062 return false;
10063 }
10064
10066 {
10068 {
10069 return true;
10070 }
10071
10072 return false;
10073 }
10074
10076 {
10077 return false;
10078 }
10079
10082 {
10083 return UATimeSpent.DEFAULT_DEPLOY;
10084 }
10085
10086
10087
10088
10090 {
10092 SetSynchDirty();
10093 }
10094
10096 {
10098 }
10099
10100
10102 {
10103 return false;
10104 }
10105
10108 {
10109 string att_type = "None";
10110
10111 if (ConfigIsExisting("soundAttType"))
10112 {
10113 att_type = ConfigGetString("soundAttType");
10114 }
10115
10117 }
10118
10120 {
10122 }
10123
10124
10125
10126
10127
10133
10135 {
10138
10140 }
10141
10142
10144 {
10146 return;
10147
10149
10152
10155
10156 SoundParameters params = new SoundParameters();
10160 }
10161
10162
10164 {
10166 return;
10167
10169 SetSynchDirty();
10170
10173 }
10174
10175
10177 {
10179 return;
10180
10182 SetSynchDirty();
10183
10186 }
10187
10189 {
10191 }
10192
10194 {
10196 }
10197
10200 {
10201 if (!
GetGame().IsDedicatedServer())
10202 {
10203 if (ConfigIsExisting("attachSoundSet"))
10204 {
10205 string cfg_path = "";
10206 string soundset = "";
10207 string type_name =
GetType();
10208
10211 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10212 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10213
10214 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10215 {
10216 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10217 {
10218 if (cfg_slot_array[i] == slot_type)
10219 {
10220 soundset = cfg_soundset_array[i];
10221 break;
10222 }
10223 }
10224 }
10225
10226 if (soundset != "")
10227 {
10228 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10230 }
10231 }
10232 }
10233 }
10234
10236 {
10237
10238 }
10239
10240 void OnApply(PlayerBase player);
10241
10243 {
10244 return 1.0;
10245 };
10246
10248 {
10250 }
10251
10253 {
10255 }
10256
10258
10260 {
10261 SetDynamicPhysicsLifeTime(0.01);
10263 }
10264
10266 {
10267 array<string> zone_names = new array<string>;
10268 GetDamageZones(zone_names);
10269 for (int i = 0; i < zone_names.Count(); i++)
10270 {
10271 SetHealthMax(zone_names.Get(i),"Health");
10272 }
10273 SetHealthMax("","Health");
10274 }
10275
10278 {
10279 float global_health = GetHealth01("","Health");
10280 array<string> zones = new array<string>;
10281 GetDamageZones(zones);
10282
10283 for (int i = 0; i < zones.Count(); i++)
10284 {
10285 SetHealth01(zones.Get(i),"Health",global_health);
10286 }
10287 }
10288
10291 {
10292 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10293 }
10294
10296 {
10297 if (!hasRootAsPlayer)
10298 {
10299 if (refParentIB)
10300 {
10301
10302 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10303 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10304
10305 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10306 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10307
10310 }
10311 else
10312 {
10313
10316 }
10317 }
10318 }
10319
10321 {
10323 {
10324 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10325 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10326 {
10327 float heatPermCoef = 1.0;
10329 while (ent)
10330 {
10331 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10332 ent = ent.GetHierarchyParent();
10333 }
10334
10335 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10336 }
10337 }
10338 }
10339
10341 {
10342
10343 EntityAI parent = GetHierarchyParent();
10344 if (!parent)
10345 {
10346 hasParent = false;
10347 hasRootAsPlayer = false;
10348 }
10349 else
10350 {
10351 hasParent = true;
10352 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10353 refParentIB =
ItemBase.Cast(parent);
10354 }
10355 }
10356
10357 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10358 {
10359
10360 }
10361
10363 {
10364
10365 return false;
10366 }
10367
10369 {
10370
10371
10372 return false;
10373 }
10374
10376 {
10377
10378 return false;
10379 }
10380
10383 {
10384 return !GetIsFrozen() &&
IsOpen();
10385 }
10386
10388 {
10389 bool hasParent = false, hasRootAsPlayer = false;
10391
10392 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10393 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10394
10395 if (wwtu || foodDecay)
10396 {
10400
10401 if (processWetness || processTemperature || processDecay)
10402 {
10404
10405 if (processWetness)
10406 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10407
10408 if (processTemperature)
10410
10411 if (processDecay)
10412 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10413 }
10414 }
10415 }
10416
10419 {
10421 }
10422
10424 {
10427
10428 return super.GetTemperatureFreezeThreshold();
10429 }
10430
10432 {
10435
10436 return super.GetTemperatureThawThreshold();
10437 }
10438
10440 {
10443
10444 return super.GetItemOverheatThreshold();
10445 }
10446
10448 {
10450 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10451
10452 return super.GetTemperatureFreezeTime();
10453 }
10454
10456 {
10458 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10459
10460 return super.GetTemperatureThawTime();
10461 }
10462
10467
10469 {
10470 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10471 }
10472
10474 {
10475 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10476 }
10477
10480 {
10482 }
10483
10485 {
10487 }
10488
10490 {
10492 }
10493
10496 {
10497 return null;
10498 }
10499
10502 {
10503 return false;
10504 }
10505
10507 {
10509 {
10512 if (!trg)
10513 {
10515 explosive = this;
10516 }
10517
10518 explosive.PairRemote(trg);
10520
10521 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10522 trg.SetPersistentPairID(persistentID);
10523 explosive.SetPersistentPairID(persistentID);
10524
10525 return true;
10526 }
10527 return false;
10528 }
10529
10532 {
10533 float ret = 1.0;
10536 ret *= GetHealth01();
10537
10538 return ret;
10539 }
10540
10541 #ifdef DEVELOPER
10542 override void SetDebugItem()
10543 {
10544 super.SetDebugItem();
10545 _itemBase = this;
10546 }
10547
10549 {
10550 string text = super.GetDebugText();
10551
10553 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10554
10555 return text;
10556 }
10557 #endif
10558
10560 {
10561 return true;
10562 }
10563
10565
10567
10569 {
10572 }
10573
10574
10582
10598}
10599
10601{
10603 if (entity)
10604 {
10605 bool is_item = entity.IsInherited(
ItemBase);
10606 if (is_item && full_quantity)
10607 {
10610 }
10611 }
10612 else
10613 {
10615 return NULL;
10616 }
10617 return entity;
10618}
10619
10621{
10622 if (item)
10623 {
10624 if (health > 0)
10625 item.SetHealth("", "", health);
10626
10627 if (item.CanHaveTemperature())
10628 {
10630 if (item.CanFreeze())
10631 item.SetFrozen(false);
10632 }
10633
10634 if (item.HasEnergyManager())
10635 {
10636 if (quantity >= 0)
10637 {
10638 item.GetCompEM().SetEnergy0To1(quantity);
10639 }
10640 else
10641 {
10643 }
10644 }
10645 else if (item.IsMagazine())
10646 {
10647 Magazine mag = Magazine.Cast(item);
10648 if (quantity >= 0)
10649 {
10650 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10651 }
10652 else
10653 {
10655 }
10656
10657 }
10658 else
10659 {
10660 if (quantity >= 0)
10661 {
10662 item.SetQuantityNormalized(quantity, false);
10663 }
10664 else
10665 {
10667 }
10668
10669 }
10670 }
10671}
10672
10673#ifdef DEVELOPER
10675#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.