5834{
5836 {
5837 return true;
5838 }
5839};
5840
5841
5842
5844{
5848
5850
5853
5854
5855
5856
5857
5866
5872
5877
5882
5903 protected bool m_IsResultOfSplit
5904
5906
5911
5912
5913
5915
5919
5920
5921
5923
5926
5927
5928
5934
5935
5943
5946
5947
5949
5950
5952
5953
5958
5959
5964
5965
5967
5968
5970 {
5975
5976 if (!
GetGame().IsDedicatedServer())
5977 {
5979 {
5981
5983 {
5985 }
5986 }
5987
5990 }
5991
5992 m_OldLocation = null;
5993
5995 {
5997 }
5998
5999 if (ConfigIsExisting("headSelectionsToHide"))
6000 {
6003 }
6004
6006 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6007 {
6009 }
6010
6012
6013 m_IsResultOfSplit = false;
6014
6016 }
6017
6019 {
6020 super.InitItemVariables();
6021
6027 m_Count = ConfigGetInt(
"count");
6028
6031
6036
6039
6044
6056
6060
6061
6064 if (ConfigIsExisting("canBeSplit"))
6065 {
6068 }
6069
6071 if (ConfigIsExisting("itemBehaviour"))
6073
6074
6077 RegisterNetSyncVariableInt("m_VarLiquidType");
6078 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6079
6080 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6081 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6082 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6083
6084 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6085 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6086 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6087 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6088
6089 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6090 RegisterNetSyncVariableBool("m_IsTakeable");
6091 RegisterNetSyncVariableBool("m_IsHologram");
6092
6095 {
6098 }
6099
6101
6103 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6105
6106 }
6107
6109 {
6111 }
6112
6114 {
6117 {
6122 }
6123 }
6124
6125 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6126 {
6128 {
6131 }
6132
6134 }
6135
6137 {
6143 }
6144
6146
6148 {
6150
6151 if (!action)
6152 {
6153 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6154 return;
6155 }
6156
6158 if (!ai)
6159 {
6161 return;
6162 }
6163
6165 if (!action_array)
6166 {
6167 action_array = new array<ActionBase_Basic>;
6169 }
6170 if (LogManager.IsActionLogEnable())
6171 {
6172 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6173 }
6174
6175 if (action_array.Find(action) != -1)
6176 {
6177 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6178 }
6179 else
6180 {
6181 action_array.Insert(action);
6182 }
6183 }
6184
6186 {
6188 ActionBase action = player.GetActionManager().GetAction(actionName);
6191
6192 if (action_array)
6193 {
6194 action_array.RemoveItem(action);
6195 }
6196 }
6197
6198
6199
6201 {
6202 ActionOverrideData overrideData = new ActionOverrideData();
6206
6208 if (!actionMap)
6209 {
6212 }
6213
6214 actionMap.Insert(this.
Type(), overrideData);
6215
6216 }
6217
6219
6221
6222
6224 {
6227
6230
6231 string config_to_search = "CfgVehicles";
6232 string muzzle_owner_config;
6233
6235 {
6236 if (IsInherited(Weapon))
6237 config_to_search = "CfgWeapons";
6238
6239 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6240
6241 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6242
6244
6245 if (config_OnFire_subclass_count > 0)
6246 {
6247 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6248
6249 for (int i = 0; i < config_OnFire_subclass_count; i++)
6250 {
6251 string particle_class = "";
6253 string config_OnFire_entry = config_OnFire_class + particle_class;
6254 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6255 WPOF_array.Insert(WPOF);
6256 }
6257
6258
6260 }
6261 }
6262
6264 {
6265 config_to_search = "CfgWeapons";
6266 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6267
6268 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6269
6271
6272 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6273 {
6274 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6275
6276 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6277 {
6278 string particle_class2 = "";
6280 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6281 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6282 WPOBE_array.Insert(WPOBE);
6283 }
6284
6285
6287 }
6288 }
6289 }
6290
6291
6293 {
6296
6298 {
6299 string config_to_search = "CfgVehicles";
6300
6301 if (IsInherited(Weapon))
6302 config_to_search = "CfgWeapons";
6303
6304 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6305 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6306
6307 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6308 {
6309
6311
6313 {
6315 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6317 return;
6318 }
6319
6322
6323
6324
6326 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6327
6328 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6329 {
6330 string particle_class = "";
6332 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6334
6335 if (entry_type == CT_CLASS)
6336 {
6337 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6338 WPOOH_array.Insert(WPOF);
6339 }
6340 }
6341
6342
6344 }
6345 }
6346 }
6347
6349 {
6351 }
6352
6354 {
6356 {
6358
6361
6364
6365 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6366 }
6367 }
6368
6370 {
6372 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6373
6375 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6376
6378 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6379
6381 {
6383 }
6384 }
6385
6387 {
6389 }
6390
6392 {
6395 else
6397
6399 {
6402 }
6403 else
6404 {
6407
6410 }
6411
6413 }
6414
6416 {
6418 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6419 }
6420
6422 {
6424 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6426 }
6427
6429 {
6431 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6432 }
6433
6435 {
6438
6439 OverheatingParticle OP = new OverheatingParticle();
6444
6446 }
6447
6449 {
6452
6453 return -1;
6454 }
6455
6457 {
6459 {
6462
6463 for (int i = count; i > 0; --i)
6464 {
6465 int id = i - 1;
6468
6471
6472 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6473 {
6474 if (p)
6475 {
6478 }
6479 }
6480 }
6481 }
6482 }
6483
6485 {
6487 {
6489 {
6490 int id = i - 1;
6492
6493 if (OP)
6494 {
6496
6497 if (p)
6498 {
6500 }
6501
6502 delete OP;
6503 }
6504 }
6505
6508 }
6509 }
6510
6513 {
6514 return 0.0;
6515 }
6516
6517
6519 {
6520 return 250;
6521 }
6522
6524 {
6525 return 0;
6526 }
6527
6530 {
6532 return true;
6533
6534 return false;
6535 }
6536
6539 {
6542
6544 {
6546 }
6547 else
6548 {
6549
6551 }
6552
6554 }
6555
6562 {
6563 return -1;
6564 }
6565
6566
6567
6568
6570 {
6572 {
6574 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6575
6576 if (r_index >= 0)
6577 {
6578 InventoryLocation r_il = new InventoryLocation;
6579 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6580
6581 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6584 {
6585 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6586 }
6588 {
6589 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6590 }
6591
6592 }
6593
6594 player.GetHumanInventory().ClearUserReservedLocation(this);
6595 }
6596
6599 }
6600
6601
6602
6603
6605 {
6606 return ItemBase.m_DebugActionsMask;
6607 }
6608
6610 {
6611 return ItemBase.m_DebugActionsMask & mask;
6612 }
6613
6615 {
6616 ItemBase.m_DebugActionsMask = mask;
6617 }
6618
6620 {
6621 ItemBase.m_DebugActionsMask |= mask;
6622 }
6623
6625 {
6626 ItemBase.m_DebugActionsMask &= ~mask;
6627 }
6628
6630 {
6632 {
6634 }
6635 else
6636 {
6638 }
6639 }
6640
6641
6643 {
6644 if (GetEconomyProfile())
6645 {
6646 float q_max = GetEconomyProfile().GetQuantityMax();
6647 if (q_max > 0)
6648 {
6649 float q_min = GetEconomyProfile().GetQuantityMin();
6650 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6651
6653 {
6654 ComponentEnergyManager comp = GetCompEM();
6656 {
6658 }
6659 }
6661 {
6663
6664 }
6665
6666 }
6667 }
6668 }
6669
6672 {
6673 EntityAI parent = GetHierarchyParent();
6674
6675 if (parent)
6676 {
6677 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6678 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6679 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6680 }
6681 }
6682
6685 {
6686 EntityAI parent = GetHierarchyParent();
6687
6688 if (parent)
6689 {
6690 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6691 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6692 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6693 }
6694 }
6695
6697 {
6698
6699
6700
6701
6703
6705 {
6706 if (ScriptInputUserData.CanStoreInputUserData())
6707 {
6708 ScriptInputUserData ctx = new ScriptInputUserData;
6714 ctx.
Write(use_stack_max);
6717
6719 {
6720 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6721 }
6722 }
6723 }
6724 else if (!
GetGame().IsMultiplayer())
6725 {
6727 }
6728 }
6729
6731 {
6733 }
6734
6736 {
6738 }
6739
6741 {
6743 }
6744
6746 {
6747
6748 return false;
6749 }
6750
6752 {
6753 return false;
6754 }
6755
6759 {
6760 return false;
6761 }
6762
6764 {
6765 return "";
6766 }
6767
6769
6771 {
6772 return false;
6773 }
6774
6776 {
6777 return true;
6778 }
6779
6780
6781
6783 {
6784 return true;
6785 }
6786
6788 {
6789 return true;
6790 }
6791
6793 {
6794 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6796 }
6797
6799 {
6801 }
6802
6804 {
6806 if (!is_being_placed)
6808 SetSynchDirty();
6809 }
6810
6811
6813
6815 {
6817 }
6818
6820 {
6822 }
6823
6825 {
6826 return 1;
6827 }
6828
6830 {
6831 return false;
6832 }
6833
6835 {
6837 SetSynchDirty();
6838 }
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6875 {
6876 super.OnMovedInsideCargo(container);
6877
6878 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6879 }
6880
6881 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6882 {
6883 super.EEItemLocationChanged(oldLoc,newLoc);
6884
6885 PlayerBase new_player = null;
6886 PlayerBase old_player = null;
6887
6888 if (newLoc.GetParent())
6889 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6890
6891 if (oldLoc.GetParent())
6892 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6893
6895 {
6896 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6897
6898 if (r_index >= 0)
6899 {
6900 InventoryLocation r_il = new InventoryLocation;
6901 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6902
6903 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6906 {
6907 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6908 }
6910 {
6911 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6912 }
6913
6914 }
6915 }
6916
6918 {
6919 if (new_player)
6920 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6921
6922 if (new_player == old_player)
6923 {
6924
6925 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6926 {
6928 {
6929 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6930 {
6931 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6932 }
6933 }
6934 else
6935 {
6936 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6937 }
6938 }
6939
6940 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
6941 {
6942 int type = oldLoc.GetType();
6944 {
6945 oldLoc.GetParent().GetOnSetLock().Invoke(this);
6946 }
6948 {
6949 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
6950 }
6951 }
6952 if (!m_OldLocation)
6953 {
6954 m_OldLocation = new InventoryLocation;
6955 }
6956 m_OldLocation.Copy(oldLoc);
6957 }
6958 else
6959 {
6960 if (m_OldLocation)
6961 {
6962 m_OldLocation.Reset();
6963 }
6964 }
6965
6967 }
6968 else
6969 {
6970 if (new_player)
6971 {
6972 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
6973 if (res_index >= 0)
6974 {
6975 InventoryLocation il = new InventoryLocation;
6976 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
6978 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
6981 {
6982 il.
GetParent().GetOnReleaseLock().Invoke(it);
6983 }
6985 {
6987 }
6988
6989 }
6990 }
6992 {
6993
6995 }
6996
6997 if (m_OldLocation)
6998 {
6999 m_OldLocation.Reset();
7000 }
7001 }
7002 }
7003
7004 override void EOnContact(IEntity other, Contact extra)
7005 {
7007 {
7008 int liquidType = -1;
7010 if (impactSpeed > 0.0)
7011 {
7013 #ifndef SERVER
7015 #else
7017 SetSynchDirty();
7018 #endif
7020 }
7021 }
7022
7023 #ifdef SERVER
7024 if (GetCompEM() && GetCompEM().IsPlugged())
7025 {
7026 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7027 GetCompEM().UnplugThis();
7028 }
7029 #endif
7030 }
7031
7033
7035 {
7037 }
7038
7040 {
7041
7042 }
7043
7045 {
7046 super.OnItemLocationChanged(old_owner, new_owner);
7047
7048 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7049 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7050
7051 if (!relatedPlayer && playerNew)
7052 relatedPlayer = playerNew;
7053
7054 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7055 {
7057 if (actionMgr)
7058 {
7059 ActionBase currentAction = actionMgr.GetRunningAction();
7060 if (currentAction)
7062 }
7063 }
7064
7065 Man ownerPlayerOld = null;
7066 Man ownerPlayerNew = null;
7067
7068 if (old_owner)
7069 {
7070 if (old_owner.
IsMan())
7071 {
7072 ownerPlayerOld = Man.Cast(old_owner);
7073 }
7074 else
7075 {
7076 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7077 }
7078 }
7079 else
7080 {
7082 {
7084
7085 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7086 {
7087 GetCompEM().UnplugThis();
7088 }
7089 }
7090 }
7091
7092 if (new_owner)
7093 {
7094 if (new_owner.
IsMan())
7095 {
7096 ownerPlayerNew = Man.Cast(new_owner);
7097 }
7098 else
7099 {
7100 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7101 }
7102 }
7103
7104 if (ownerPlayerOld != ownerPlayerNew)
7105 {
7106 if (ownerPlayerOld)
7107 {
7108 array<EntityAI> subItemsExit = new array<EntityAI>;
7110 for (int i = 0; i < subItemsExit.Count(); i++)
7111 {
7114 }
7115 }
7116
7117 if (ownerPlayerNew)
7118 {
7119 array<EntityAI> subItemsEnter = new array<EntityAI>;
7121 for (int j = 0; j < subItemsEnter.Count(); j++)
7122 {
7125 }
7126 }
7127 }
7128 else if (ownerPlayerNew != null)
7129 {
7130 PlayerBase nplayer;
7131 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7132 {
7133 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7135 for (int k = 0; k < subItemsUpdate.Count(); k++)
7136 {
7138 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7139 }
7140 }
7141 }
7142
7143 if (old_owner)
7144 old_owner.OnChildItemRemoved(this);
7145 if (new_owner)
7146 new_owner.OnChildItemReceived(this);
7147 }
7148
7149
7151 {
7152 super.EEDelete(parent);
7153 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7154 if (player)
7155 {
7157
7158 if (player.IsAlive())
7159 {
7160 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7161 if (r_index >= 0)
7162 {
7163 InventoryLocation r_il = new InventoryLocation;
7164 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7165
7166 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7169 {
7170 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7171 }
7173 {
7174 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7175 }
7176
7177 }
7178
7179 player.RemoveQuickBarEntityShortcut(this);
7180 }
7181 }
7182 }
7183
7185 {
7186 super.EEKilled(killer);
7187
7190 {
7191 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7192 {
7193 if (IsMagazine())
7194 {
7195 if (Magazine.Cast(this).GetAmmoCount() > 0)
7196 {
7198 }
7199 }
7200 else
7201 {
7203 }
7204 }
7205 }
7206 }
7207
7209 {
7210 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7211
7212 super.OnWasAttached(parent, slot_id);
7213
7216
7218 }
7219
7221 {
7222 super.OnWasDetached(parent, slot_id);
7223
7226 }
7227
7229 {
7230 int idx;
7233
7234 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7235 if (inventory_slots.Count() < 1)
7236 {
7237 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7238 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7239 }
7240 else
7241 {
7242 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7243 }
7244
7245 idx = inventory_slots.Find(slot);
7246 if (idx < 0)
7247 return "";
7248
7249 return attach_types.Get(idx);
7250 }
7251
7253 {
7254 int idx = -1;
7255 string slot;
7256
7259
7260 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7261 if (inventory_slots.Count() < 1)
7262 {
7263 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7264 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7265 }
7266 else
7267 {
7268 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7269 if (detach_types.Count() < 1)
7270 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7271 }
7272
7273 for (int i = 0; i < inventory_slots.Count(); i++)
7274 {
7275 slot = inventory_slots.Get(i);
7276 }
7277
7278 if (slot != "")
7279 {
7280 if (detach_types.Count() == 1)
7281 idx = 0;
7282 else
7283 idx = inventory_slots.Find(slot);
7284 }
7285 if (idx < 0)
7286 return "";
7287
7288 return detach_types.Get(idx);
7289 }
7290
7292 {
7293
7295
7296
7297 float min_time = 1;
7298 float max_time = 3;
7299 float delay = Math.RandomFloat(min_time, max_time);
7300
7301 explode_timer.Run(delay, this, "DoAmmoExplosion");
7302 }
7303
7305 {
7306 Magazine magazine = Magazine.Cast(this);
7307 int pop_sounds_count = 6;
7308 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7309
7310
7311 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7312 string sound_name = pop_sounds[ sound_idx ];
7314
7315
7316 magazine.ServerAddAmmoCount(-1);
7317
7318
7319 float min_temp_to_explode = 100;
7320
7321 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
7322 {
7324 }
7325 }
7326
7327
7328 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7329 {
7330 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7331
7332 const int CHANCE_DAMAGE_CARGO = 4;
7333 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7334 const int CHANCE_DAMAGE_NOTHING = 2;
7335
7337 {
7338 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7339 int chances;
7340 int rnd;
7341
7342 if (GetInventory().GetCargo())
7343 {
7344 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7345 rnd = Math.RandomInt(0,chances);
7346
7347 if (rnd < CHANCE_DAMAGE_CARGO)
7348 {
7350 }
7351 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7352 {
7354 }
7355 }
7356 else
7357 {
7358 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7359 rnd = Math.RandomInt(0,chances);
7360
7361 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7362 {
7364 }
7365 }
7366 }
7367 }
7368
7370 {
7371 if (GetInventory().GetCargo())
7372 {
7373 int item_count = GetInventory().GetCargo().GetItemCount();
7374 if (item_count > 0)
7375 {
7376 int random_pick = Math.RandomInt(0, item_count);
7378 if (!item.IsExplosive())
7379 {
7380 item.AddHealth("","",damage);
7381 return true;
7382 }
7383 }
7384 }
7385 return false;
7386 }
7387
7389 {
7390 int attachment_count = GetInventory().AttachmentCount();
7391 if (attachment_count > 0)
7392 {
7393 int random_pick = Math.RandomInt(0, attachment_count);
7394 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7395 if (!attachment.IsExplosive())
7396 {
7397 attachment.AddHealth("","",damage);
7398 return true;
7399 }
7400 }
7401 return false;
7402 }
7403
7405 {
7407 }
7408
7410 {
7412 return GetInventory().CanRemoveEntity();
7413
7414 return false;
7415 }
7416
7418 {
7419
7421 return false;
7422
7423
7425 return false;
7426
7427
7428
7430 if (delta == 0)
7431 return false;
7432
7433
7434 return true;
7435 }
7436
7438 {
7440 {
7441 if (ScriptInputUserData.CanStoreInputUserData())
7442 {
7443 ScriptInputUserData ctx = new ScriptInputUserData;
7448 ctx.
Write(destination_entity);
7452 }
7453 }
7454 else if (!
GetGame().IsMultiplayer())
7455 {
7457 }
7458 }
7459
7461 {
7462 float split_quantity_new;
7466 InventoryLocation loc = new InventoryLocation;
7467
7468 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7469 {
7471 split_quantity_new = stack_max;
7472 else
7474
7476 {
7477 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7478 if (new_item)
7479 {
7480 new_item.SetResultOfSplit(true);
7481 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7483 new_item.
SetQuantity(split_quantity_new,
false,
true);
7484 }
7485 }
7486 }
7487 else if (destination_entity && slot_id == -1)
7488 {
7489 if (quantity > stack_max)
7490 split_quantity_new = stack_max;
7491 else
7492 split_quantity_new = quantity;
7493
7495 {
7497 {
7500 }
7501
7502 if (new_item)
7503 {
7504 new_item.SetResultOfSplit(true);
7505 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7507 new_item.
SetQuantity(split_quantity_new,
false,
true);
7508 }
7509 }
7510 }
7511 else
7512 {
7513 if (stack_max != 0)
7514 {
7516 {
7518 }
7519
7520 if (split_quantity_new == 0)
7521 {
7522 if (!
GetGame().IsMultiplayer())
7523 player.PhysicalPredictiveDropItem(this);
7524 else
7525 player.ServerDropEntity(this);
7526 return;
7527 }
7528
7530 {
7532
7533 if (new_item)
7534 {
7535 new_item.SetResultOfSplit(true);
7536 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7539 new_item.PlaceOnSurface();
7540 }
7541 }
7542 }
7543 }
7544 }
7545
7547 {
7548 float split_quantity_new;
7552 InventoryLocation loc = new InventoryLocation;
7553
7554 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7555 {
7557 split_quantity_new = stack_max;
7558 else
7560
7562 {
7563 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7564 if (new_item)
7565 {
7566 new_item.SetResultOfSplit(true);
7567 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7569 new_item.
SetQuantity(split_quantity_new,
false,
true);
7570 }
7571 }
7572 }
7573 else if (destination_entity && slot_id == -1)
7574 {
7575 if (quantity > stack_max)
7576 split_quantity_new = stack_max;
7577 else
7578 split_quantity_new = quantity;
7579
7581 {
7583 {
7586 }
7587
7588 if (new_item)
7589 {
7590 new_item.SetResultOfSplit(true);
7591 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7593 new_item.
SetQuantity(split_quantity_new,
false,
true);
7594 }
7595 }
7596 }
7597 else
7598 {
7599 if (stack_max != 0)
7600 {
7602 {
7604 }
7605
7607 {
7609
7610 if (new_item)
7611 {
7612 new_item.SetResultOfSplit(true);
7613 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7616 new_item.PlaceOnSurface();
7617 }
7618 }
7619 }
7620 }
7621 }
7622
7624 {
7626 {
7627 if (ScriptInputUserData.CanStoreInputUserData())
7628 {
7629 ScriptInputUserData ctx = new ScriptInputUserData;
7634 dst.WriteToContext(ctx);
7636 }
7637 }
7638 else if (!
GetGame().IsMultiplayer())
7639 {
7641 }
7642 }
7643
7645 {
7647 {
7648 if (ScriptInputUserData.CanStoreInputUserData())
7649 {
7650 ScriptInputUserData ctx = new ScriptInputUserData;
7655 ctx.
Write(destination_entity);
7661 }
7662 }
7663 else if (!
GetGame().IsMultiplayer())
7664 {
7666 }
7667 }
7668
7670 {
7672 }
7673
7675 {
7677 float split_quantity_new;
7679 if (dst.IsValid())
7680 {
7681 int slot_id = dst.GetSlot();
7683
7684 if (quantity > stack_max)
7685 split_quantity_new = stack_max;
7686 else
7687 split_quantity_new = quantity;
7688
7690 {
7692
7693 if (new_item)
7694 {
7695 new_item.SetResultOfSplit(true);
7696 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7698 new_item.
SetQuantity(split_quantity_new,
false,
true);
7699 }
7700
7701 return new_item;
7702 }
7703 }
7704
7705 return null;
7706 }
7707
7709 {
7711 float split_quantity_new;
7713 if (destination_entity)
7714 {
7716 if (quantity > stackable)
7717 split_quantity_new = stackable;
7718 else
7719 split_quantity_new = quantity;
7720
7722 {
7723 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7724 if (new_item)
7725 {
7726 new_item.SetResultOfSplit(true);
7727 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7729 new_item.
SetQuantity(split_quantity_new,
false,
true);
7730 }
7731 }
7732 }
7733 }
7734
7736 {
7738 {
7739 if (ScriptInputUserData.CanStoreInputUserData())
7740 {
7741 ScriptInputUserData ctx = new ScriptInputUserData;
7746 ItemBase destination_entity =
this;
7747 ctx.
Write(destination_entity);
7751 }
7752 }
7753 else if (!
GetGame().IsMultiplayer())
7754 {
7756 }
7757 }
7758
7760 {
7762 float split_quantity_new;
7764 if (player)
7765 {
7767 if (quantity > stackable)
7768 split_quantity_new = stackable;
7769 else
7770 split_quantity_new = quantity;
7771
7773 {
7774 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7775 new_item =
ItemBase.Cast(in_hands);
7776 if (new_item)
7777 {
7778 new_item.SetResultOfSplit(true);
7779 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7781 new_item.SetQuantity(split_quantity_new, false, true);
7782 }
7783 }
7784 }
7785 }
7786
7788 {
7790 float split_quantity_new = Math.Floor(quantity * 0.5);
7791
7793 return;
7794
7796
7797 if (new_item)
7798 {
7799 if (new_item.GetQuantityMax() < split_quantity_new)
7800 {
7801 split_quantity_new = new_item.GetQuantityMax();
7802 }
7803
7804 new_item.SetResultOfSplit(true);
7805 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7806
7808 {
7811 }
7812 else
7813 {
7815 new_item.
SetQuantity(split_quantity_new,
false,
true);
7816 }
7817 }
7818 }
7819
7821 {
7823 float split_quantity_new = Math.Floor(quantity / 2);
7824
7826 return;
7827
7828 InventoryLocation invloc = new InventoryLocation;
7830
7832 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7833
7834 if (new_item)
7835 {
7836 if (new_item.GetQuantityMax() < split_quantity_new)
7837 {
7838 split_quantity_new = new_item.GetQuantityMax();
7839 }
7841 {
7844 }
7845 else if (split_quantity_new > 1)
7846 {
7848 new_item.
SetQuantity(split_quantity_new,
false,
true);
7849 }
7850 }
7851 }
7852
7855 {
7856 SetWeightDirty();
7858
7859 if (parent)
7860 parent.OnAttachmentQuantityChangedEx(this, delta);
7861
7863 {
7865 {
7867 }
7869 {
7870 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7872 }
7873 }
7874
7875 }
7876
7879 {
7880
7881 }
7882
7885 {
7887 }
7888
7890 {
7891 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7892
7894 {
7895 if (newLevel == GameConstants.STATE_RUINED)
7896 {
7898 EntityAI parent = GetHierarchyParent();
7899 if (parent && parent.IsFireplace())
7900 {
7901 CargoBase cargo = GetInventory().GetCargo();
7902 if (cargo)
7903 {
7905 {
7907 }
7908 }
7909 }
7910 }
7911
7913 {
7914
7916 return;
7917 }
7918
7919 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7920 {
7922 }
7923 }
7924 }
7925
7926
7928 {
7929 super.OnRightClick();
7930
7932 {
7934 {
7935 if (ScriptInputUserData.CanStoreInputUserData())
7936 {
7937 EntityAI root = GetHierarchyRoot();
7938 Man playerOwner = GetHierarchyRootPlayer();
7939 InventoryLocation dst = new InventoryLocation;
7940
7941
7942 if (!playerOwner && root && root == this)
7943 {
7945 }
7946 else
7947 {
7948
7949 GetInventory().GetCurrentInventoryLocation(dst);
7951 {
7954 {
7956 }
7957 else
7958 {
7960
7961
7962 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
7963 {
7965 }
7966 else
7967 {
7968 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
7969 }
7970 }
7971 }
7972 }
7973
7974 ScriptInputUserData ctx = new ScriptInputUserData;
7982 }
7983 }
7984 else if (!
GetGame().IsMultiplayer())
7985 {
7987 }
7988 }
7989 }
7990
7992 {
7993 if (root)
7994 {
7995 vector m4[4];
7996 root.GetTransform(m4);
7997 dst.SetGround(this, m4);
7998 }
7999 else
8000 {
8001 GetInventory().GetCurrentInventoryLocation(dst);
8002 }
8003 }
8004
8005 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8006 {
8007
8008 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8009 return false;
8010
8011 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8012 return false;
8013
8014
8016 return false;
8017
8018
8019 Magazine mag = Magazine.Cast(this);
8020 if (mag)
8021 {
8022 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8023 return false;
8024
8025 if (stack_max_limit)
8026 {
8027 Magazine other_mag = Magazine.Cast(other_item);
8028 if (other_item)
8029 {
8030 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8031 return false;
8032 }
8033
8034 }
8035 }
8036 else
8037 {
8038
8040 return false;
8041
8043 return false;
8044 }
8045
8046 PlayerBase player = null;
8047 if (CastTo(player, GetHierarchyRootPlayer()))
8048 {
8049 if (player.GetInventory().HasAttachment(this))
8050 return false;
8051
8052 if (player.IsItemsToDelete())
8053 return false;
8054 }
8055
8056 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8057 return false;
8058
8059 int slotID;
8061 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8062 return false;
8063
8064 return true;
8065 }
8066
8068 {
8070 }
8071
8073 {
8074 return m_IsResultOfSplit;
8075 }
8076
8078 {
8079 m_IsResultOfSplit = value;
8080 }
8081
8083 {
8085 }
8086
8088 {
8089 float other_item_quantity = other_item.GetQuantity();
8090 float this_free_space;
8091
8093
8095
8096 if (other_item_quantity > this_free_space)
8097 {
8098 return this_free_space;
8099 }
8100 else
8101 {
8102 return other_item_quantity;
8103 }
8104 }
8105
8107 {
8109 }
8110
8112 {
8114 return;
8115
8116 if (!IsMagazine() && other_item)
8117 {
8119 if (quantity_used != 0)
8120 {
8121 float hp1 = GetHealth01("","");
8122 float hp2 = other_item.GetHealth01("","");
8123 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8124 hpResult = hpResult / (
GetQuantity() + quantity_used);
8125
8126 hpResult *= GetMaxHealth();
8127 Math.Round(hpResult);
8128 SetHealth("", "Health", hpResult);
8129
8131 other_item.AddQuantity(-quantity_used);
8132 }
8133 }
8135 }
8136
8138 {
8139 #ifdef SERVER
8140 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8141 GetHierarchyParent().IncreaseLifetimeUp();
8142 #endif
8143 };
8144
8146 {
8147 PlayerBase p = PlayerBase.Cast(player);
8148
8149 array<int> recipesIds = p.m_Recipes;
8150 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8151 if (moduleRecipesManager)
8152 {
8153 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8154 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8155 }
8156
8157 for (int i = 0;i < recipesIds.Count(); i++)
8158 {
8159 int key = recipesIds.Get(i);
8160 string recipeName = moduleRecipesManager.GetRecipeName(key);
8162 }
8163 }
8164
8165
8166 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8167 {
8168 super.GetDebugActions(outputList);
8169
8170
8176
8177
8182
8187
8188
8192
8193
8195 {
8199 }
8200
8203
8204
8208
8210
8211 InventoryLocation loc = new InventoryLocation();
8212 GetInventory().GetCurrentInventoryLocation(loc);
8214 {
8215 if (Gizmo_IsSupported())
8218 }
8219
8221 }
8222
8223
8224
8225
8227 {
8228 super.OnAction(action_id, player, ctx);
8229
8231 {
8232 switch (action_id)
8233 {
8236 return true;
8239 return true;
8240 }
8241 }
8242
8244 {
8245 switch (action_id)
8246 {
8248 Delete();
8249 return true;
8250 }
8251 }
8252
8253 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8254 {
8255 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8256 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8257 PlayerBase p = PlayerBase.Cast(player);
8258 if (
EActions.RECIPES_RANGE_START < 1000)
8259 {
8260 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8261 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8262 }
8263 }
8264 #ifndef SERVER
8265 else if (action_id ==
EActions.WATCH_PLAYER)
8266 {
8267 PluginDeveloper.SetDeveloperItemClientEx(player);
8268 }
8269 #endif
8271 {
8272 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8273 {
8274 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8275 OnDebugButtonPressServer(id + 1);
8276 }
8277
8278 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8279 {
8280 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8282 }
8283
8284 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8285 {
8286 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8288 }
8289
8290 else if (action_id ==
EActions.ADD_QUANTITY)
8291 {
8292 if (IsMagazine())
8293 {
8294 Magazine mag = Magazine.Cast(this);
8295 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8296 }
8297 else
8298 {
8300 }
8301
8302 if (m_EM)
8303 {
8304 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8305 }
8306
8307 }
8308
8309 else if (action_id ==
EActions.REMOVE_QUANTITY)
8310 {
8311 if (IsMagazine())
8312 {
8313 Magazine mag2 = Magazine.Cast(this);
8314 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8315 }
8316 else
8317 {
8319 }
8320 if (m_EM)
8321 {
8322 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8323 }
8324
8325 }
8326
8327 else if (action_id ==
EActions.SET_QUANTITY_0)
8328 {
8330
8331 if (m_EM)
8332 {
8333 m_EM.SetEnergy(0);
8334 }
8335 }
8336
8337 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8338 {
8340
8341 if (m_EM)
8342 {
8343 m_EM.SetEnergy(m_EM.GetEnergyMax());
8344 }
8345 }
8346
8347 else if (action_id ==
EActions.ADD_HEALTH)
8348 {
8349 AddHealth("","",GetMaxHealth("","Health")/5);
8350 }
8351 else if (action_id ==
EActions.REMOVE_HEALTH)
8352 {
8353 AddHealth("","",-GetMaxHealth("","Health")/5);
8354 }
8355 else if (action_id ==
EActions.DESTROY_HEALTH)
8356 {
8357 SetHealth01("","",0);
8358 }
8359 else if (action_id ==
EActions.WATCH_ITEM)
8360 {
8362 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8363 #ifdef DEVELOPER
8364 SetDebugDeveloper_item(this);
8365 #endif
8366 }
8367
8368 else if (action_id ==
EActions.ADD_TEMPERATURE)
8369 {
8370 AddTemperature(20);
8371
8372 }
8373
8374 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8375 {
8376 AddTemperature(-20);
8377
8378 }
8379
8380 else if (action_id ==
EActions.FLIP_FROZEN)
8381 {
8382 SetFrozen(!GetIsFrozen());
8383
8384 }
8385
8386 else if (action_id ==
EActions.ADD_WETNESS)
8387 {
8389
8390 }
8391
8392 else if (action_id ==
EActions.REMOVE_WETNESS)
8393 {
8395
8396 }
8397
8398 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8399 {
8402
8403
8404 }
8405
8406 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8407 {
8410 }
8411
8412 else if (action_id ==
EActions.MAKE_SPECIAL)
8413 {
8414 auto debugParams = DebugSpawnParams.WithPlayer(player);
8415 OnDebugSpawnEx(debugParams);
8416 }
8417
8418 }
8419
8420
8421 return false;
8422 }
8423
8424
8425
8426
8430
8433
8434
8435
8437 {
8438 return false;
8439 }
8440
8441
8443 {
8444 return true;
8445 }
8446
8447
8449 {
8450 return true;
8451 }
8452
8453
8454
8456 {
8457 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8459 }
8460
8463 {
8464 return null;
8465 }
8466
8468 {
8469 return false;
8470 }
8471
8473 {
8474 return false;
8475 }
8476
8480
8481
8483 {
8484 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8485 return module_repairing.CanRepair(this, item_repair_kit);
8486 }
8487
8488
8489 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8490 {
8491 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8492 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8493 }
8494
8495
8497 {
8498
8499
8500
8501
8502
8503
8504
8505
8506 return 1;
8507 }
8508
8509
8510
8512 {
8514 }
8515
8516
8517
8519 {
8521 }
8522
8523
8532 {
8533 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8534
8535 if (player)
8536 {
8537 player.MessageStatus(text);
8538 }
8539 }
8540
8541
8550 {
8551 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8552
8553 if (player)
8554 {
8555 player.MessageAction(text);
8556 }
8557 }
8558
8559
8568 {
8569 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8570
8571 if (player)
8572 {
8573 player.MessageFriendly(text);
8574 }
8575 }
8576
8577
8586 {
8587 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8588
8589 if (player)
8590 {
8591 player.MessageImportant(text);
8592 }
8593 }
8594
8596 {
8597 return true;
8598 }
8599
8600
8601 override bool KindOf(
string tag)
8602 {
8603 bool found = false;
8604 string item_name = this.
GetType();
8607
8608 int array_size = item_tag_array.Count();
8609 for (int i = 0; i < array_size; i++)
8610 {
8611 if (item_tag_array.Get(i) == tag)
8612 {
8613 found = true;
8614 break;
8615 }
8616 }
8617 return found;
8618 }
8619
8620
8622 {
8623
8624 super.OnRPC(sender, rpc_type,ctx);
8625
8626
8627 switch (rpc_type)
8628 {
8629 #ifndef SERVER
8630 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8631 Param2<bool, string> p = new Param2<bool, string>(false, "");
8632
8634 return;
8635
8636 bool play = p.param1;
8637 string soundSet = p.param2;
8638
8639 if (play)
8640 {
8642 {
8644 {
8646 }
8647 }
8648 else
8649 {
8651 }
8652 }
8653 else
8654 {
8656 }
8657
8658 break;
8659 #endif
8660
8661 }
8662
8664 {
8666 }
8667 }
8668
8669
8670
8671
8673 {
8674 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8675 return plugin.GetID(
name);
8676 }
8677
8679 {
8680 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8681 return plugin.GetName(id);
8682 }
8683
8686 {
8687
8688
8689 int varFlags;
8690 if (!ctx.
Read(varFlags))
8691 return;
8692
8693 if (varFlags & ItemVariableFlags.FLOAT)
8694 {
8696 }
8697 }
8698
8700 {
8701
8702 super.SerializeNumericalVars(floats_out);
8703
8704
8705
8707 {
8709 }
8710
8712 {
8714 }
8715
8717 {
8719 }
8720
8722 {
8727 }
8728
8730 {
8732 }
8733 }
8734
8736 {
8737
8738 super.DeSerializeNumericalVars(floats);
8739
8740
8741 int index = 0;
8742 int mask = Math.Round(floats.Get(index));
8743
8744 index++;
8745
8747 {
8749 {
8751 }
8752 else
8753 {
8754 float quantity = floats.Get(index);
8756 }
8757 index++;
8758 }
8759
8761 {
8762 float wet = floats.Get(index);
8764 index++;
8765 }
8766
8768 {
8769 int liquidtype = Math.Round(floats.Get(index));
8771 index++;
8772 }
8773
8775 {
8777 index++;
8779 index++;
8781 index++;
8783 index++;
8784 }
8785
8787 {
8788 int cleanness = Math.Round(floats.Get(index));
8790 index++;
8791 }
8792 }
8793
8795 {
8796 super.WriteVarsToCTX(ctx);
8797
8798
8800 {
8802 }
8803
8805 {
8807 }
8808
8810 {
8812 }
8813
8815 {
8816 int r,g,b,a;
8822 }
8823
8825 {
8827 }
8828 }
8829
8831 {
8832 if (!super.ReadVarsFromCTX(ctx,version))
8833 return false;
8834
8835 int intValue;
8836 float value;
8837
8838 if (version < 140)
8839 {
8840 if (!ctx.
Read(intValue))
8841 return false;
8842
8843 m_VariablesMask = intValue;
8844 }
8845
8847 {
8848 if (!ctx.
Read(value))
8849 return false;
8850
8852 {
8854 }
8855 else
8856 {
8858 }
8859 }
8860
8861 if (version < 140)
8862 {
8864 {
8865 if (!ctx.
Read(value))
8866 return false;
8867 SetTemperatureDirect(value);
8868 }
8869 }
8870
8872 {
8873 if (!ctx.
Read(value))
8874 return false;
8876 }
8877
8879 {
8880 if (!ctx.
Read(intValue))
8881 return false;
8883 }
8884
8886 {
8887 int r,g,b,a;
8889 return false;
8891 return false;
8893 return false;
8895 return false;
8896
8898 }
8899
8901 {
8902 if (!ctx.
Read(intValue))
8903 return false;
8905 }
8906
8907 if (version >= 138 && version < 140)
8908 {
8910 {
8911 if (!ctx.
Read(intValue))
8912 return false;
8913 SetFrozen(intValue);
8914 }
8915 }
8916
8917 return true;
8918 }
8919
8920
8922 {
8925 {
8927 }
8928
8929 if (!super.OnStoreLoad(ctx, version))
8930 {
8932 return false;
8933 }
8934
8935 if (version >= 114)
8936 {
8937 bool hasQuickBarIndexSaved;
8938
8939 if (!ctx.
Read(hasQuickBarIndexSaved))
8940 {
8942 return false;
8943 }
8944
8945 if (hasQuickBarIndexSaved)
8946 {
8947 int itmQBIndex;
8948
8949
8950 if (!ctx.
Read(itmQBIndex))
8951 {
8953 return false;
8954 }
8955
8956 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
8957 if (itmQBIndex != -1 && parentPlayer)
8958 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
8959 }
8960 }
8961 else
8962 {
8963
8964 PlayerBase player;
8965 int itemQBIndex;
8966 if (version ==
int.
MAX)
8967 {
8968 if (!ctx.
Read(itemQBIndex))
8969 {
8971 return false;
8972 }
8973 }
8974 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
8975 {
8976
8977 if (!ctx.
Read(itemQBIndex))
8978 {
8980 return false;
8981 }
8982 if (itemQBIndex != -1 && player)
8983 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
8984 }
8985 }
8986
8987 if (version < 140)
8988 {
8989
8990 if (!LoadVariables(ctx, version))
8991 {
8993 return false;
8994 }
8995 }
8996
8997
8999 {
9001 return false;
9002 }
9003 if (version >= 132)
9004 {
9006 if (raib)
9007 {
9009 {
9011 return false;
9012 }
9013 }
9014 }
9015
9017 return true;
9018 }
9019
9020
9021
9023 {
9024 super.OnStoreSave(ctx);
9025
9026 PlayerBase player;
9027 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9028 {
9030
9031 int itemQBIndex = -1;
9032 itemQBIndex = player.FindQuickBarEntityIndex(this);
9033 ctx.
Write(itemQBIndex);
9034 }
9035 else
9036 {
9038 }
9039
9041
9043 if (raib)
9044 {
9046 }
9047 }
9048
9049
9051 {
9052 super.AfterStoreLoad();
9053
9055 {
9057 }
9058
9060 {
9063 }
9064 }
9065
9067 {
9068 super.EEOnAfterLoad();
9069
9071 {
9073 }
9074
9077 }
9078
9080 {
9081 return false;
9082 }
9083
9084
9085
9087 {
9089 {
9090 #ifdef PLATFORM_CONSOLE
9091
9093 {
9095 if (menu)
9096 {
9098 }
9099 }
9100 #endif
9101 }
9102
9104 {
9107 }
9108
9110 {
9111 SetWeightDirty();
9113 }
9115 {
9118 }
9119
9121 {
9124 }
9126 {
9129 }
9130
9131 super.OnVariablesSynchronized();
9132 }
9133
9134
9135
9137 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9138 {
9139 if (!IsServerCheck(allow_client))
9140 return false;
9141
9143 return false;
9144
9147
9148 if (value <= (min + 0.001))
9149 value = min;
9150
9151 if (value == min)
9152 {
9153 if (destroy_config)
9154 {
9155 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9156 if (dstr)
9157 {
9159 this.Delete();
9160 return true;
9161 }
9162 }
9163 else if (destroy_forced)
9164 {
9166 this.Delete();
9167 return true;
9168 }
9169
9171 }
9172
9175
9177 {
9179
9180 if (delta)
9182 }
9183
9185
9186 return false;
9187 }
9188
9189
9191 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9192 {
9194 }
9195
9197 {
9200 }
9201
9203 {
9206 }
9207
9209 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9210 {
9211 float value_clamped = Math.Clamp(value, 0, 1);
9213 SetQuantity(result, destroy_config, destroy_forced);
9214 }
9215
9216
9219 {
9221 }
9222
9224 {
9226 }
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9238 {
9239 int slot = -1;
9240 if (GetInventory())
9241 {
9242 InventoryLocation il = new InventoryLocation;
9243 GetInventory().GetCurrentInventoryLocation(il);
9245 }
9246
9248 }
9249
9251 {
9252 float quantity_max = 0;
9253
9255 {
9256 if (attSlotID != -1)
9257 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9258
9259 if (quantity_max <= 0)
9261 }
9262
9263 if (quantity_max <= 0)
9265
9266 return quantity_max;
9267 }
9268
9270 {
9272 }
9273
9275 {
9277 }
9278
9279
9281 {
9283 }
9284
9286 {
9288 }
9289
9291 {
9293 }
9294
9295
9297 {
9298
9299 float weightEx = GetWeightEx();
9300 float special = GetInventoryAndCargoWeight();
9301 return weightEx - special;
9302 }
9303
9304
9306 {
9308 }
9309
9311 {
9313 {
9314 #ifdef DEVELOPER
9315 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9316 {
9317 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9319 }
9320 #endif
9321
9323 }
9324 else if (HasEnergyManager())
9325 {
9326 #ifdef DEVELOPER
9327 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9328 {
9329 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9330 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9331 }
9332 #endif
9333 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
9334 }
9335 else
9336 {
9337 #ifdef DEVELOPER
9338 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9339 {
9340 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9341 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9342 }
9343 #endif
9344 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9345 }
9346 }
9347
9350 {
9351 int item_count = 0;
9353
9354 if (GetInventory().GetCargo() != NULL)
9355 {
9356 item_count = GetInventory().GetCargo().GetItemCount();
9357 }
9358
9359 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9360 {
9361 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9362 if (item)
9363 item_count += item.GetNumberOfItems();
9364 }
9365 return item_count;
9366 }
9367
9370 {
9371 float weight = 0;
9372 float wetness = 1;
9373 if (include_wetness)
9376 {
9377 weight = wetness * m_ConfigWeight;
9378 }
9380 {
9381 weight = 1;
9382 }
9383 return weight;
9384 }
9385
9386
9387
9389 {
9390 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9391 {
9392 GameInventory inv = GetInventory();
9393 array<EntityAI> items = new array<EntityAI>;
9395 for (int i = 0; i < items.Count(); i++)
9396 {
9398 if (item)
9399 {
9401 }
9402 }
9403 }
9404 }
9405
9406
9407
9408
9410 {
9411 float energy = 0;
9412 if (HasEnergyManager())
9413 {
9414 energy = GetCompEM().GetEnergy();
9415 }
9416 return energy;
9417 }
9418
9419
9421 {
9422 super.OnEnergyConsumed();
9423
9425 }
9426
9428 {
9429 super.OnEnergyAdded();
9430
9432 }
9433
9434
9436 {
9437 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9438 {
9440 {
9441 float energy_0to1 = GetCompEM().GetEnergy0To1();
9443 }
9444 }
9445 }
9446
9447
9449 {
9450 return ConfigGetFloat("heatIsolation");
9451 }
9452
9454 {
9456 }
9457
9459 {
9460 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9461 if (
GetGame().ConfigIsExisting(paramPath))
9463
9464 return 0.0;
9465 }
9466
9468 {
9469 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9470 if (
GetGame().ConfigIsExisting(paramPath))
9472
9473 return 0.0;
9474 }
9475
9476 override void SetWet(
float value,
bool allow_client =
false)
9477 {
9478 if (!IsServerCheck(allow_client))
9479 return;
9480
9483
9485
9486 m_VarWet = Math.Clamp(value, min, max);
9487
9489 {
9492 }
9493 }
9494
9495 override void AddWet(
float value)
9496 {
9498 }
9499
9501 {
9503 }
9504
9506 {
9508 }
9509
9511 {
9513 }
9514
9516 {
9518 }
9519
9521 {
9523 }
9524
9526 {
9529 if (newLevel != oldLevel)
9530 {
9532 }
9533 }
9534
9536 {
9537 SetWeightDirty();
9538 }
9539
9541 {
9542 return GetWetLevelInternal(
m_VarWet);
9543 }
9544
9545
9546
9548 {
9550 }
9551
9553 {
9555 }
9556
9558 {
9560 }
9561
9563 {
9565 }
9566
9567
9568
9570 {
9571 if (ConfigIsExisting("itemModelLength"))
9572 {
9573 return ConfigGetFloat("itemModelLength");
9574 }
9575 return 0;
9576 }
9577
9579 {
9580 if (ConfigIsExisting("itemAttachOffset"))
9581 {
9582 return ConfigGetFloat("itemAttachOffset");
9583 }
9584 return 0;
9585 }
9586
9587 override void SetCleanness(
int value,
bool allow_client =
false)
9588 {
9589 if (!IsServerCheck(allow_client))
9590 return;
9591
9593
9595
9598 }
9599
9601 {
9603 }
9604
9606 {
9607 return true;
9608 }
9609
9610
9611
9612
9614 {
9616 }
9617
9619 {
9621 }
9622
9623
9624
9625
9626 override void SetColor(
int r,
int g,
int b,
int a)
9627 {
9633 }
9635 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9636 {
9641 }
9642
9644 {
9646 }
9647
9650 {
9651 int r,g,b,a;
9653 r = r/255;
9654 g = g/255;
9655 b = b/255;
9656 a = a/255;
9657 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9658 }
9659
9660
9661
9662 override void SetLiquidType(
int value,
bool allow_client =
false)
9663 {
9664 if (!IsServerCheck(allow_client))
9665 return;
9666
9671 }
9672
9674 {
9675 return ConfigGetInt("varLiquidTypeInit");
9676 }
9677
9679 {
9681 }
9682
9684 {
9686 SetFrozen(false);
9687 }
9688
9691 {
9692 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9693 }
9694
9695
9698 {
9699 PlayerBase nplayer;
9700 if (PlayerBase.CastTo(nplayer, player))
9701 {
9703
9704 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9705 }
9706 }
9707
9708
9711 {
9712 PlayerBase nplayer;
9713 if (PlayerBase.CastTo(nplayer,player))
9714 {
9715
9716 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9717
9718 }
9719
9720
9721 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9722
9723
9724 if (HasEnergyManager())
9725 {
9726 GetCompEM().UpdatePlugState();
9727 }
9728 }
9729
9730
9732 {
9733 super.OnPlacementStarted(player);
9734
9736 }
9737
9738 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9739 {
9741 {
9742 m_AdminLog.OnPlacementComplete(player,
this);
9743 }
9744
9745 super.OnPlacementComplete(player, position, orientation);
9746 }
9747
9748
9749
9750
9751
9753 {
9755 {
9756 return true;
9757 }
9758 else
9759 {
9760 return false;
9761 }
9762 }
9763
9764
9766 {
9768 {
9770 }
9771 }
9772
9773
9775 {
9777 }
9778
9780 {
9782 }
9783
9784 override void InsertAgent(
int agent,
float count = 1)
9785 {
9786 if (count < 1)
9787 return;
9788
9790 }
9791
9794 {
9796 }
9797
9798
9800 {
9802 }
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9846 {
9848 return false;
9849 return true;
9850 }
9851
9853 {
9854
9856 }
9857
9858
9861 {
9862 super.CheckForRoofLimited(timeTresholdMS);
9863
9865 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9866 {
9867 m_PreviousRoofTestTime = time;
9868 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9869 }
9870 }
9871
9872
9874 {
9876 {
9877 return 0;
9878 }
9879
9880 if (GetInventory().GetAttachmentSlotsCount() != 0)
9881 {
9882 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9883 if (filter)
9884 return filter.GetProtectionLevel(type, false, system);
9885 else
9886 return 0;
9887 }
9888
9889 string subclassPath, entryName;
9890
9891 switch (type)
9892 {
9894 entryName = "biological";
9895 break;
9897 entryName = "chemical";
9898 break;
9899 default:
9900 entryName = "biological";
9901 break;
9902 }
9903
9904 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9905
9907 }
9908
9909
9910
9913 {
9914 if (!IsMagazine())
9916
9918 }
9919
9920
9921
9922
9923
9928 {
9929 return true;
9930 }
9931
9933 {
9935 }
9936
9937
9938
9939
9940
9942 {
9943 if (parent)
9944 {
9945 if (parent.IsInherited(DayZInfected))
9946 return true;
9947
9948 if (!parent.IsRuined())
9949 return true;
9950 }
9951
9952 return true;
9953 }
9954
9956 {
9957 if (!super.CanPutAsAttachment(parent))
9958 {
9959 return false;
9960 }
9961
9962 if (!IsRuined() && !parent.IsRuined())
9963 {
9964 return true;
9965 }
9966
9967 return false;
9968 }
9969
9971 {
9972
9973
9974
9975
9976 return super.CanReceiveItemIntoCargo(item);
9977 }
9978
9980 {
9981
9982
9983
9984
9985 GameInventory attachmentInv = attachment.GetInventory();
9987 {
9988 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
9989 return false;
9990 }
9991
9992 InventoryLocation loc = new InventoryLocation();
9993 attachment.GetInventory().GetCurrentInventoryLocation(loc);
9994 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
9995 return false;
9996
9997 return super.CanReceiveAttachment(attachment, slotId);
9998 }
9999
10001 {
10002 if (!super.CanReleaseAttachment(attachment))
10003 return false;
10004
10005 return GetInventory().AreChildrenAccessible();
10006 }
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10029 {
10030 int id = muzzle_owner.GetMuzzleID();
10031 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10032
10033 if (WPOF_array)
10034 {
10035 for (int i = 0; i < WPOF_array.Count(); i++)
10036 {
10037 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10038
10039 if (WPOF)
10040 {
10041 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10042 }
10043 }
10044 }
10045 }
10046
10047
10049 {
10050 int id = muzzle_owner.GetMuzzleID();
10052
10053 if (WPOBE_array)
10054 {
10055 for (int i = 0; i < WPOBE_array.Count(); i++)
10056 {
10057 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10058
10059 if (WPOBE)
10060 {
10061 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10062 }
10063 }
10064 }
10065 }
10066
10067
10069 {
10070 int id = muzzle_owner.GetMuzzleID();
10071 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10072
10073 if (WPOOH_array)
10074 {
10075 for (int i = 0; i < WPOOH_array.Count(); i++)
10076 {
10077 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10078
10079 if (WPOOH)
10080 {
10081 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10082 }
10083 }
10084 }
10085 }
10086
10087
10089 {
10090 int id = muzzle_owner.GetMuzzleID();
10091 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10092
10093 if (WPOOH_array)
10094 {
10095 for (int i = 0; i < WPOOH_array.Count(); i++)
10096 {
10097 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10098
10099 if (WPOOH)
10100 {
10101 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10102 }
10103 }
10104 }
10105 }
10106
10107
10109 {
10110 int id = muzzle_owner.GetMuzzleID();
10111 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10112
10113 if (WPOOH_array)
10114 {
10115 for (int i = 0; i < WPOOH_array.Count(); i++)
10116 {
10117 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10118
10119 if (WPOOH)
10120 {
10121 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10122 }
10123 }
10124 }
10125 }
10126
10127
10128
10130 {
10132 {
10133 return true;
10134 }
10135
10136 return false;
10137 }
10138
10140 {
10142 {
10143 return true;
10144 }
10145
10146 return false;
10147 }
10148
10150 {
10152 {
10153 return true;
10154 }
10155
10156 return false;
10157 }
10158
10160 {
10161 return false;
10162 }
10163
10166 {
10167 return UATimeSpent.DEFAULT_DEPLOY;
10168 }
10169
10170
10171
10172
10174 {
10176 SetSynchDirty();
10177 }
10178
10180 {
10182 }
10183
10184
10186 {
10187 return false;
10188 }
10189
10192 {
10193 string att_type = "None";
10194
10195 if (ConfigIsExisting("soundAttType"))
10196 {
10197 att_type = ConfigGetString("soundAttType");
10198 }
10199
10201 }
10202
10204 {
10206 }
10207
10208
10209
10210
10211
10217
10219 {
10222
10224 }
10225
10226
10228 {
10230 return;
10231
10233
10236
10239
10240 SoundParameters params = new SoundParameters();
10244 }
10245
10246
10248 {
10250 return;
10251
10253 SetSynchDirty();
10254
10257 }
10258
10259
10261 {
10263 return;
10264
10266 SetSynchDirty();
10267
10270 }
10271
10273 {
10275 }
10276
10278 {
10280 }
10281
10284 {
10285 if (!
GetGame().IsDedicatedServer())
10286 {
10287 if (ConfigIsExisting("attachSoundSet"))
10288 {
10289 string cfg_path = "";
10290 string soundset = "";
10291 string type_name =
GetType();
10292
10295 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10296 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10297
10298 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10299 {
10300 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10301 {
10302 if (cfg_slot_array[i] == slot_type)
10303 {
10304 soundset = cfg_soundset_array[i];
10305 break;
10306 }
10307 }
10308 }
10309
10310 if (soundset != "")
10311 {
10312 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10314 }
10315 }
10316 }
10317 }
10318
10320 {
10321
10322 }
10323
10324 void OnApply(PlayerBase player);
10325
10327 {
10328 return 1.0;
10329 };
10330
10332 {
10334 }
10335
10337 {
10339 }
10340
10342
10344 {
10345 SetDynamicPhysicsLifeTime(0.01);
10347 }
10348
10350 {
10351 array<string> zone_names = new array<string>;
10352 GetDamageZones(zone_names);
10353 for (int i = 0; i < zone_names.Count(); i++)
10354 {
10355 SetHealthMax(zone_names.Get(i),"Health");
10356 }
10357 SetHealthMax("","Health");
10358 }
10359
10362 {
10363 float global_health = GetHealth01("","Health");
10364 array<string> zones = new array<string>;
10365 GetDamageZones(zones);
10366
10367 for (int i = 0; i < zones.Count(); i++)
10368 {
10369 SetHealth01(zones.Get(i),"Health",global_health);
10370 }
10371 }
10372
10375 {
10376 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10377 }
10378
10380 {
10381 if (!hasRootAsPlayer)
10382 {
10383 if (refParentIB)
10384 {
10385
10386 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10387 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10388
10389 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10390 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10391
10394 }
10395 else
10396 {
10397
10400 }
10401 }
10402 }
10403
10405 {
10407 {
10408 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10409 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10410 {
10411 float heatPermCoef = 1.0;
10413 while (ent)
10414 {
10415 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10416 ent = ent.GetHierarchyParent();
10417 }
10418
10419 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10420 }
10421 }
10422 }
10423
10425 {
10426
10427 EntityAI parent = GetHierarchyParent();
10428 if (!parent)
10429 {
10430 hasParent = false;
10431 hasRootAsPlayer = false;
10432 }
10433 else
10434 {
10435 hasParent = true;
10436 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10437 refParentIB =
ItemBase.Cast(parent);
10438 }
10439 }
10440
10441 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10442 {
10443
10444 }
10445
10447 {
10448
10449 return false;
10450 }
10451
10453 {
10454
10455
10456 return false;
10457 }
10458
10460 {
10461
10462 return false;
10463 }
10464
10467 {
10468 return !GetIsFrozen() &&
IsOpen();
10469 }
10470
10472 {
10473 bool hasParent = false, hasRootAsPlayer = false;
10475
10476 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10477 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10478
10479 if (wwtu || foodDecay)
10480 {
10484
10485 if (processWetness || processTemperature || processDecay)
10486 {
10488
10489 if (processWetness)
10490 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10491
10492 if (processTemperature)
10494
10495 if (processDecay)
10496 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10497 }
10498 }
10499 }
10500
10503 {
10505 }
10506
10508 {
10511
10512 return super.GetTemperatureFreezeThreshold();
10513 }
10514
10516 {
10519
10520 return super.GetTemperatureThawThreshold();
10521 }
10522
10524 {
10527
10528 return super.GetItemOverheatThreshold();
10529 }
10530
10532 {
10534 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10535
10536 return super.GetTemperatureFreezeTime();
10537 }
10538
10540 {
10542 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10543
10544 return super.GetTemperatureThawTime();
10545 }
10546
10551
10553 {
10554 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10555 }
10556
10558 {
10559 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10560 }
10561
10564 {
10566 }
10567
10569 {
10571 }
10572
10574 {
10576 }
10577
10580 {
10581 return null;
10582 }
10583
10586 {
10587 return false;
10588 }
10589
10591 {
10593 {
10596 if (!trg)
10597 {
10599 explosive = this;
10600 }
10601
10602 explosive.PairRemote(trg);
10604
10605 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10606 trg.SetPersistentPairID(persistentID);
10607 explosive.SetPersistentPairID(persistentID);
10608
10609 return true;
10610 }
10611 return false;
10612 }
10613
10616 {
10617 float ret = 1.0;
10620 ret *= GetHealth01();
10621
10622 return ret;
10623 }
10624
10625 #ifdef DEVELOPER
10626 override void SetDebugItem()
10627 {
10628 super.SetDebugItem();
10629 _itemBase = this;
10630 }
10631
10633 {
10634 string text = super.GetDebugText();
10635
10637 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10638
10639 return text;
10640 }
10641 #endif
10642
10644 {
10645 return true;
10646 }
10647
10649
10651
10653 {
10656 }
10657
10658
10666
10682}
10683
10685{
10687 if (entity)
10688 {
10689 bool is_item = entity.IsInherited(
ItemBase);
10690 if (is_item && full_quantity)
10691 {
10694 }
10695 }
10696 else
10697 {
10699 return NULL;
10700 }
10701 return entity;
10702}
10703
10705{
10706 if (item)
10707 {
10708 if (health > 0)
10709 item.SetHealth("", "", health);
10710
10711 if (item.CanHaveTemperature())
10712 {
10714 if (item.CanFreeze())
10715 item.SetFrozen(false);
10716 }
10717
10718 if (item.HasEnergyManager())
10719 {
10720 if (quantity >= 0)
10721 {
10722 item.GetCompEM().SetEnergy0To1(quantity);
10723 }
10724 else
10725 {
10727 }
10728 }
10729 else if (item.IsMagazine())
10730 {
10731 Magazine mag = Magazine.Cast(item);
10732 if (quantity >= 0)
10733 {
10734 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10735 }
10736 else
10737 {
10739 }
10740
10741 }
10742 else
10743 {
10744 if (quantity >= 0)
10745 {
10746 item.SetQuantityNormalized(quantity, false);
10747 }
10748 else
10749 {
10751 }
10752
10753 }
10754 }
10755}
10756
10757#ifdef DEVELOPER
10759#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.