5896{
5898 {
5899 return true;
5900 }
5901};
5902
5903
5904
5906{
5910
5912
5915
5916
5917
5918
5919
5928
5934
5939
5944
5965 protected bool m_IsResultOfSplit
5966
5968
5973
5974
5975
5977
5981
5982
5983
5985
5988
5989
5990
5996
5997
6005
6008
6009
6011
6012
6014
6015
6020
6021
6026
6027
6029
6030
6032 {
6037
6038 if (!
GetGame().IsDedicatedServer())
6039 {
6041 {
6043
6045 {
6047 }
6048 }
6049
6052 }
6053
6054 m_OldLocation = null;
6055
6057 {
6059 }
6060
6061 if (ConfigIsExisting("headSelectionsToHide"))
6062 {
6065 }
6066
6068 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6069 {
6071 }
6072
6074
6075 m_IsResultOfSplit = false;
6076
6078 }
6079
6081 {
6082 super.InitItemVariables();
6083
6089 m_Count = ConfigGetInt(
"count");
6090
6093
6098
6101
6106
6118
6122
6123
6126 if (ConfigIsExisting("canBeSplit"))
6127 {
6130 }
6131
6133 if (ConfigIsExisting("itemBehaviour"))
6135
6136
6139 RegisterNetSyncVariableInt("m_VarLiquidType");
6140 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6141
6142 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6143 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6144 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6145
6146 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6147 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6148 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6149 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6150
6151 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6152 RegisterNetSyncVariableBool("m_IsTakeable");
6153 RegisterNetSyncVariableBool("m_IsHologram");
6154
6157 {
6160 }
6161
6163
6165 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6167
6168 }
6169
6171 {
6173 }
6174
6176 {
6179 {
6184 }
6185 }
6186
6187 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6188 {
6190 {
6193 }
6194
6196 }
6197
6199 {
6205 }
6206
6208
6210 {
6212
6213 if (!action)
6214 {
6215 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6216 return;
6217 }
6218
6220 if (!ai)
6221 {
6223 return;
6224 }
6225
6227 if (!action_array)
6228 {
6229 action_array = new array<ActionBase_Basic>;
6231 }
6232 if (LogManager.IsActionLogEnable())
6233 {
6234 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6235 }
6236
6237 if (action_array.Find(action) != -1)
6238 {
6239 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6240 }
6241 else
6242 {
6243 action_array.Insert(action);
6244 }
6245 }
6246
6248 {
6250 ActionBase action = player.GetActionManager().GetAction(actionName);
6253
6254 if (action_array)
6255 {
6256 action_array.RemoveItem(action);
6257 }
6258 }
6259
6260
6261
6263 {
6264 ActionOverrideData overrideData = new ActionOverrideData();
6268
6270 if (!actionMap)
6271 {
6274 }
6275
6276 actionMap.Insert(this.
Type(), overrideData);
6277
6278 }
6279
6281
6283
6284
6286 {
6289
6292
6293 string config_to_search = "CfgVehicles";
6294 string muzzle_owner_config;
6295
6297 {
6298 if (IsInherited(Weapon))
6299 config_to_search = "CfgWeapons";
6300
6301 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6302
6303 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6304
6306
6307 if (config_OnFire_subclass_count > 0)
6308 {
6309 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6310
6311 for (int i = 0; i < config_OnFire_subclass_count; i++)
6312 {
6313 string particle_class = "";
6315 string config_OnFire_entry = config_OnFire_class + particle_class;
6316 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6317 WPOF_array.Insert(WPOF);
6318 }
6319
6320
6322 }
6323 }
6324
6326 {
6327 config_to_search = "CfgWeapons";
6328 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6329
6330 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6331
6333
6334 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6335 {
6336 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6337
6338 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6339 {
6340 string particle_class2 = "";
6342 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6343 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6344 WPOBE_array.Insert(WPOBE);
6345 }
6346
6347
6349 }
6350 }
6351 }
6352
6353
6355 {
6358
6360 {
6361 string config_to_search = "CfgVehicles";
6362
6363 if (IsInherited(Weapon))
6364 config_to_search = "CfgWeapons";
6365
6366 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6367 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6368
6369 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6370 {
6371
6373
6375 {
6377 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6379 return;
6380 }
6381
6384
6385
6386
6388 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6389
6390 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6391 {
6392 string particle_class = "";
6394 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6396
6397 if (entry_type == CT_CLASS)
6398 {
6399 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6400 WPOOH_array.Insert(WPOF);
6401 }
6402 }
6403
6404
6406 }
6407 }
6408 }
6409
6411 {
6413 }
6414
6416 {
6418 {
6420
6423
6426
6427 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6428 }
6429 }
6430
6432 {
6434 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6435
6437 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6438
6440 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6441
6443 {
6445 }
6446 }
6447
6449 {
6451 }
6452
6454 {
6457 else
6459
6461 {
6464 }
6465 else
6466 {
6469
6472 }
6473
6475 }
6476
6478 {
6480 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6481 }
6482
6484 {
6486 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6488 }
6489
6491 {
6493 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6494 }
6495
6497 {
6500
6501 OverheatingParticle OP = new OverheatingParticle();
6506
6508 }
6509
6511 {
6514
6515 return -1;
6516 }
6517
6519 {
6521 {
6524
6525 for (int i = count; i > 0; --i)
6526 {
6527 int id = i - 1;
6530
6533
6534 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6535 {
6536 if (p)
6537 {
6540 }
6541 }
6542 }
6543 }
6544 }
6545
6547 {
6549 {
6551 {
6552 int id = i - 1;
6554
6555 if (OP)
6556 {
6558
6559 if (p)
6560 {
6562 }
6563
6564 delete OP;
6565 }
6566 }
6567
6570 }
6571 }
6572
6575 {
6576 return 0.0;
6577 }
6578
6579
6581 {
6582 return 250;
6583 }
6584
6586 {
6587 return 0;
6588 }
6589
6592 {
6594 return true;
6595
6596 return false;
6597 }
6598
6601 {
6604
6606 {
6608 }
6609 else
6610 {
6611
6613 }
6614
6616 }
6617
6624 {
6625 return -1;
6626 }
6627
6628
6629
6630
6632 {
6634 {
6636 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6637
6638 if (r_index >= 0)
6639 {
6640 InventoryLocation r_il = new InventoryLocation;
6641 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6642
6643 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6646 {
6647 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6648 }
6650 {
6651 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6652 }
6653
6654 }
6655
6656 player.GetHumanInventory().ClearUserReservedLocation(this);
6657 }
6658
6661 }
6662
6663
6664
6665
6667 {
6668 return ItemBase.m_DebugActionsMask;
6669 }
6670
6672 {
6673 return ItemBase.m_DebugActionsMask & mask;
6674 }
6675
6677 {
6678 ItemBase.m_DebugActionsMask = mask;
6679 }
6680
6682 {
6683 ItemBase.m_DebugActionsMask |= mask;
6684 }
6685
6687 {
6688 ItemBase.m_DebugActionsMask &= ~mask;
6689 }
6690
6692 {
6694 {
6696 }
6697 else
6698 {
6700 }
6701 }
6702
6703
6705 {
6706 if (GetEconomyProfile())
6707 {
6708 float q_max = GetEconomyProfile().GetQuantityMax();
6709 if (q_max > 0)
6710 {
6711 float q_min = GetEconomyProfile().GetQuantityMin();
6712 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6713
6715 {
6716 ComponentEnergyManager comp = GetCompEM();
6718 {
6720 }
6721 }
6723 {
6725
6726 }
6727
6728 }
6729 }
6730 }
6731
6734 {
6735 EntityAI parent = GetHierarchyParent();
6736
6737 if (parent)
6738 {
6739 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6740 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6741 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6742 }
6743 }
6744
6747 {
6748 EntityAI parent = GetHierarchyParent();
6749
6750 if (parent)
6751 {
6752 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6753 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6754 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6755 }
6756 }
6757
6759 {
6760
6761
6762
6763
6765
6767 {
6768 if (ScriptInputUserData.CanStoreInputUserData())
6769 {
6770 ScriptInputUserData ctx = new ScriptInputUserData;
6776 ctx.
Write(use_stack_max);
6779
6781 {
6782 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6783 }
6784 }
6785 }
6786 else if (!
GetGame().IsMultiplayer())
6787 {
6789 }
6790 }
6791
6793 {
6795 }
6796
6798 {
6800 }
6801
6803 {
6805 }
6806
6808 {
6809
6810 return false;
6811 }
6812
6814 {
6815 return false;
6816 }
6817
6821 {
6822 return false;
6823 }
6824
6826 {
6827 return "";
6828 }
6829
6831
6833 {
6834 return false;
6835 }
6836
6838 {
6839 return true;
6840 }
6841
6842
6843
6845 {
6846 return true;
6847 }
6848
6850 {
6851 return true;
6852 }
6853
6855 {
6856 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6858 }
6859
6861 {
6863 }
6864
6866 {
6868 if (!is_being_placed)
6870 SetSynchDirty();
6871 }
6872
6873
6875
6877 {
6879 }
6880
6882 {
6884 }
6885
6887 {
6888 return 1;
6889 }
6890
6892 {
6893 return false;
6894 }
6895
6897 {
6899 SetSynchDirty();
6900 }
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6937 {
6938 super.OnMovedInsideCargo(container);
6939
6940 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
6941 }
6942
6943 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
6944 {
6945 super.EEItemLocationChanged(oldLoc,newLoc);
6946
6947 PlayerBase new_player = null;
6948 PlayerBase old_player = null;
6949
6950 if (newLoc.GetParent())
6951 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
6952
6953 if (oldLoc.GetParent())
6954 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
6955
6957 {
6958 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
6959
6960 if (r_index >= 0)
6961 {
6962 InventoryLocation r_il = new InventoryLocation;
6963 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6964
6965 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6968 {
6969 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6970 }
6972 {
6973 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6974 }
6975
6976 }
6977 }
6978
6980 {
6981 if (new_player)
6982 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
6983
6984 if (new_player == old_player)
6985 {
6986
6987 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
6988 {
6990 {
6991 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
6992 {
6993 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6994 }
6995 }
6996 else
6997 {
6998 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
6999 }
7000 }
7001
7002 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7003 {
7004 int type = oldLoc.GetType();
7006 {
7007 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7008 }
7010 {
7011 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7012 }
7013 }
7014 if (!m_OldLocation)
7015 {
7016 m_OldLocation = new InventoryLocation;
7017 }
7018 m_OldLocation.Copy(oldLoc);
7019 }
7020 else
7021 {
7022 if (m_OldLocation)
7023 {
7024 m_OldLocation.Reset();
7025 }
7026 }
7027
7029 }
7030 else
7031 {
7032 if (new_player)
7033 {
7034 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7035 if (res_index >= 0)
7036 {
7037 InventoryLocation il = new InventoryLocation;
7038 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7040 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7043 {
7044 il.
GetParent().GetOnReleaseLock().Invoke(it);
7045 }
7047 {
7049 }
7050
7051 }
7052 }
7054 {
7055
7057 }
7058
7059 if (m_OldLocation)
7060 {
7061 m_OldLocation.Reset();
7062 }
7063 }
7064 }
7065
7066 override void EOnContact(IEntity other, Contact extra)
7067 {
7069 {
7070 int liquidType = -1;
7072 if (impactSpeed > 0.0)
7073 {
7075 #ifndef SERVER
7077 #else
7079 SetSynchDirty();
7080 #endif
7082 }
7083 }
7084
7085 #ifdef SERVER
7086 if (GetCompEM() && GetCompEM().IsPlugged())
7087 {
7088 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7089 GetCompEM().UnplugThis();
7090 }
7091 #endif
7092 }
7093
7095
7097 {
7099 }
7100
7102 {
7103
7104 }
7105
7107 {
7108 super.OnItemLocationChanged(old_owner, new_owner);
7109
7110 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7111 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7112
7113 if (!relatedPlayer && playerNew)
7114 relatedPlayer = playerNew;
7115
7116 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7117 {
7119 if (actionMgr)
7120 {
7121 ActionBase currentAction = actionMgr.GetRunningAction();
7122 if (currentAction)
7124 }
7125 }
7126
7127 Man ownerPlayerOld = null;
7128 Man ownerPlayerNew = null;
7129
7130 if (old_owner)
7131 {
7132 if (old_owner.
IsMan())
7133 {
7134 ownerPlayerOld = Man.Cast(old_owner);
7135 }
7136 else
7137 {
7138 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7139 }
7140 }
7141 else
7142 {
7144 {
7146
7147 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7148 {
7149 GetCompEM().UnplugThis();
7150 }
7151 }
7152 }
7153
7154 if (new_owner)
7155 {
7156 if (new_owner.
IsMan())
7157 {
7158 ownerPlayerNew = Man.Cast(new_owner);
7159 }
7160 else
7161 {
7162 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7163 }
7164 }
7165
7166 if (ownerPlayerOld != ownerPlayerNew)
7167 {
7168 if (ownerPlayerOld)
7169 {
7170 array<EntityAI> subItemsExit = new array<EntityAI>;
7172 for (int i = 0; i < subItemsExit.Count(); i++)
7173 {
7176 }
7177 }
7178
7179 if (ownerPlayerNew)
7180 {
7181 array<EntityAI> subItemsEnter = new array<EntityAI>;
7183 for (int j = 0; j < subItemsEnter.Count(); j++)
7184 {
7187 }
7188 }
7189 }
7190 else if (ownerPlayerNew != null)
7191 {
7192 PlayerBase nplayer;
7193 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7194 {
7195 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7197 for (int k = 0; k < subItemsUpdate.Count(); k++)
7198 {
7200 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7201 }
7202 }
7203 }
7204
7205 if (old_owner)
7206 old_owner.OnChildItemRemoved(this);
7207 if (new_owner)
7208 new_owner.OnChildItemReceived(this);
7209 }
7210
7211
7213 {
7214 super.EEDelete(parent);
7215 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7216 if (player)
7217 {
7219
7220 if (player.IsAlive())
7221 {
7222 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7223 if (r_index >= 0)
7224 {
7225 InventoryLocation r_il = new InventoryLocation;
7226 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7227
7228 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7231 {
7232 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7233 }
7235 {
7236 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7237 }
7238
7239 }
7240
7241 player.RemoveQuickBarEntityShortcut(this);
7242 }
7243 }
7244 }
7245
7247 {
7248 super.EEKilled(killer);
7249
7252 {
7253 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7254 {
7255 if (IsMagazine())
7256 {
7257 if (Magazine.Cast(this).GetAmmoCount() > 0)
7258 {
7260 }
7261 }
7262 else
7263 {
7265 }
7266 }
7267 }
7268 }
7269
7271 {
7272 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7273
7274 super.OnWasAttached(parent, slot_id);
7275
7278
7280 }
7281
7283 {
7284 super.OnWasDetached(parent, slot_id);
7285
7288 }
7289
7291 {
7292 int idx;
7295
7296 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7297 if (inventory_slots.Count() < 1)
7298 {
7299 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7300 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7301 }
7302 else
7303 {
7304 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7305 }
7306
7307 idx = inventory_slots.Find(slot);
7308 if (idx < 0)
7309 return "";
7310
7311 return attach_types.Get(idx);
7312 }
7313
7315 {
7316 int idx = -1;
7317 string slot;
7318
7321
7322 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7323 if (inventory_slots.Count() < 1)
7324 {
7325 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7326 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7327 }
7328 else
7329 {
7330 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7331 if (detach_types.Count() < 1)
7332 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7333 }
7334
7335 for (int i = 0; i < inventory_slots.Count(); i++)
7336 {
7337 slot = inventory_slots.Get(i);
7338 }
7339
7340 if (slot != "")
7341 {
7342 if (detach_types.Count() == 1)
7343 idx = 0;
7344 else
7345 idx = inventory_slots.Find(slot);
7346 }
7347 if (idx < 0)
7348 return "";
7349
7350 return detach_types.Get(idx);
7351 }
7352
7354 {
7355
7357
7358
7359 float min_time = 1;
7360 float max_time = 3;
7361 float delay = Math.RandomFloat(min_time, max_time);
7362
7363 explode_timer.Run(delay, this, "DoAmmoExplosion");
7364 }
7365
7367 {
7368 Magazine magazine = Magazine.Cast(this);
7369 int pop_sounds_count = 6;
7370 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7371
7372
7373 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7374 string sound_name = pop_sounds[ sound_idx ];
7376
7377
7378 magazine.ServerAddAmmoCount(-1);
7379
7380
7381 float min_temp_to_explode = 100;
7382
7383 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
7384 {
7386 }
7387 }
7388
7389
7390 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7391 {
7392 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7393
7394 const int CHANCE_DAMAGE_CARGO = 4;
7395 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7396 const int CHANCE_DAMAGE_NOTHING = 2;
7397
7399 {
7400 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7401 int chances;
7402 int rnd;
7403
7404 if (GetInventory().GetCargo())
7405 {
7406 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7407 rnd = Math.RandomInt(0,chances);
7408
7409 if (rnd < CHANCE_DAMAGE_CARGO)
7410 {
7412 }
7413 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7414 {
7416 }
7417 }
7418 else
7419 {
7420 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7421 rnd = Math.RandomInt(0,chances);
7422
7423 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7424 {
7426 }
7427 }
7428 }
7429 }
7430
7432 {
7433 if (GetInventory().GetCargo())
7434 {
7435 int item_count = GetInventory().GetCargo().GetItemCount();
7436 if (item_count > 0)
7437 {
7438 int random_pick = Math.RandomInt(0, item_count);
7440 if (!item.IsExplosive())
7441 {
7442 item.AddHealth("","",damage);
7443 return true;
7444 }
7445 }
7446 }
7447 return false;
7448 }
7449
7451 {
7452 int attachment_count = GetInventory().AttachmentCount();
7453 if (attachment_count > 0)
7454 {
7455 int random_pick = Math.RandomInt(0, attachment_count);
7456 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7457 if (!attachment.IsExplosive())
7458 {
7459 attachment.AddHealth("","",damage);
7460 return true;
7461 }
7462 }
7463 return false;
7464 }
7465
7467 {
7469 }
7470
7472 {
7474 return GetInventory().CanRemoveEntity();
7475
7476 return false;
7477 }
7478
7480 {
7481
7483 return false;
7484
7485
7487 return false;
7488
7489
7490
7492 if (delta == 0)
7493 return false;
7494
7495
7496 return true;
7497 }
7498
7500 {
7502 {
7503 if (ScriptInputUserData.CanStoreInputUserData())
7504 {
7505 ScriptInputUserData ctx = new ScriptInputUserData;
7510 ctx.
Write(destination_entity);
7514 }
7515 }
7516 else if (!
GetGame().IsMultiplayer())
7517 {
7519 }
7520 }
7521
7523 {
7524 float split_quantity_new;
7528 InventoryLocation loc = new InventoryLocation;
7529
7530 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7531 {
7533 split_quantity_new = stack_max;
7534 else
7536
7538 {
7539 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7540 if (new_item)
7541 {
7542 new_item.SetResultOfSplit(true);
7543 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7545 new_item.
SetQuantity(split_quantity_new,
false,
true);
7546 }
7547 }
7548 }
7549 else if (destination_entity && slot_id == -1)
7550 {
7551 if (quantity > stack_max)
7552 split_quantity_new = stack_max;
7553 else
7554 split_quantity_new = quantity;
7555
7557 {
7559 {
7562 }
7563
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
7574 {
7575 if (stack_max != 0)
7576 {
7578 {
7580 }
7581
7582 if (split_quantity_new == 0)
7583 {
7584 if (!
GetGame().IsMultiplayer())
7585 player.PhysicalPredictiveDropItem(this);
7586 else
7587 player.ServerDropEntity(this);
7588 return;
7589 }
7590
7592 {
7594
7595 if (new_item)
7596 {
7597 new_item.SetResultOfSplit(true);
7598 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7601 new_item.PlaceOnSurface();
7602 }
7603 }
7604 }
7605 }
7606 }
7607
7609 {
7610 float split_quantity_new;
7614 InventoryLocation loc = new InventoryLocation;
7615
7616 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7617 {
7619 split_quantity_new = stack_max;
7620 else
7622
7624 {
7625 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7626 if (new_item)
7627 {
7628 new_item.SetResultOfSplit(true);
7629 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7631 new_item.
SetQuantity(split_quantity_new,
false,
true);
7632 }
7633 }
7634 }
7635 else if (destination_entity && slot_id == -1)
7636 {
7637 if (quantity > stack_max)
7638 split_quantity_new = stack_max;
7639 else
7640 split_quantity_new = quantity;
7641
7643 {
7645 {
7648 }
7649
7650 if (new_item)
7651 {
7652 new_item.SetResultOfSplit(true);
7653 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7655 new_item.
SetQuantity(split_quantity_new,
false,
true);
7656 }
7657 }
7658 }
7659 else
7660 {
7661 if (stack_max != 0)
7662 {
7664 {
7666 }
7667
7669 {
7671
7672 if (new_item)
7673 {
7674 new_item.SetResultOfSplit(true);
7675 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7678 new_item.PlaceOnSurface();
7679 }
7680 }
7681 }
7682 }
7683 }
7684
7686 {
7688 {
7689 if (ScriptInputUserData.CanStoreInputUserData())
7690 {
7691 ScriptInputUserData ctx = new ScriptInputUserData;
7696 dst.WriteToContext(ctx);
7698 }
7699 }
7700 else if (!
GetGame().IsMultiplayer())
7701 {
7703 }
7704 }
7705
7707 {
7709 {
7710 if (ScriptInputUserData.CanStoreInputUserData())
7711 {
7712 ScriptInputUserData ctx = new ScriptInputUserData;
7717 ctx.
Write(destination_entity);
7723 }
7724 }
7725 else if (!
GetGame().IsMultiplayer())
7726 {
7728 }
7729 }
7730
7732 {
7734 }
7735
7737 {
7739 float split_quantity_new;
7741 if (dst.IsValid())
7742 {
7743 int slot_id = dst.GetSlot();
7745
7746 if (quantity > stack_max)
7747 split_quantity_new = stack_max;
7748 else
7749 split_quantity_new = quantity;
7750
7752 {
7754
7755 if (new_item)
7756 {
7757 new_item.SetResultOfSplit(true);
7758 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7760 new_item.
SetQuantity(split_quantity_new,
false,
true);
7761 }
7762
7763 return new_item;
7764 }
7765 }
7766
7767 return null;
7768 }
7769
7771 {
7773 float split_quantity_new;
7775 if (destination_entity)
7776 {
7778 if (quantity > stackable)
7779 split_quantity_new = stackable;
7780 else
7781 split_quantity_new = quantity;
7782
7784 {
7785 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7786 if (new_item)
7787 {
7788 new_item.SetResultOfSplit(true);
7789 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7791 new_item.
SetQuantity(split_quantity_new,
false,
true);
7792 }
7793 }
7794 }
7795 }
7796
7798 {
7800 {
7801 if (ScriptInputUserData.CanStoreInputUserData())
7802 {
7803 ScriptInputUserData ctx = new ScriptInputUserData;
7808 ItemBase destination_entity =
this;
7809 ctx.
Write(destination_entity);
7813 }
7814 }
7815 else if (!
GetGame().IsMultiplayer())
7816 {
7818 }
7819 }
7820
7822 {
7824 float split_quantity_new;
7826 if (player)
7827 {
7829 if (quantity > stackable)
7830 split_quantity_new = stackable;
7831 else
7832 split_quantity_new = quantity;
7833
7835 {
7836 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7837 new_item =
ItemBase.Cast(in_hands);
7838 if (new_item)
7839 {
7840 new_item.SetResultOfSplit(true);
7841 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7843 new_item.SetQuantity(split_quantity_new, false, true);
7844 }
7845 }
7846 }
7847 }
7848
7850 {
7852 float split_quantity_new = Math.Floor(quantity * 0.5);
7853
7855 return;
7856
7858
7859 if (new_item)
7860 {
7861 if (new_item.GetQuantityMax() < split_quantity_new)
7862 {
7863 split_quantity_new = new_item.GetQuantityMax();
7864 }
7865
7866 new_item.SetResultOfSplit(true);
7867 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7868
7870 {
7873 }
7874 else
7875 {
7877 new_item.
SetQuantity(split_quantity_new,
false,
true);
7878 }
7879 }
7880 }
7881
7883 {
7885 float split_quantity_new = Math.Floor(quantity / 2);
7886
7888 return;
7889
7890 InventoryLocation invloc = new InventoryLocation;
7892
7894 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7895
7896 if (new_item)
7897 {
7898 if (new_item.GetQuantityMax() < split_quantity_new)
7899 {
7900 split_quantity_new = new_item.GetQuantityMax();
7901 }
7903 {
7906 }
7907 else if (split_quantity_new > 1)
7908 {
7910 new_item.
SetQuantity(split_quantity_new,
false,
true);
7911 }
7912 }
7913 }
7914
7917 {
7918 SetWeightDirty();
7920
7921 if (parent)
7922 parent.OnAttachmentQuantityChangedEx(this, delta);
7923
7925 {
7927 {
7929 }
7931 {
7932 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7934 }
7935 }
7936
7937 }
7938
7941 {
7942
7943 }
7944
7947 {
7949 }
7950
7952 {
7953 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
7954
7956 {
7957 if (newLevel == GameConstants.STATE_RUINED)
7958 {
7960 EntityAI parent = GetHierarchyParent();
7961 if (parent && parent.IsFireplace())
7962 {
7963 CargoBase cargo = GetInventory().GetCargo();
7964 if (cargo)
7965 {
7967 {
7969 }
7970 }
7971 }
7972 }
7973
7975 {
7976
7978 return;
7979 }
7980
7981 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
7982 {
7984 }
7985 }
7986 }
7987
7988
7990 {
7991 super.OnRightClick();
7992
7994 {
7996 {
7997 if (ScriptInputUserData.CanStoreInputUserData())
7998 {
7999 EntityAI root = GetHierarchyRoot();
8000 Man playerOwner = GetHierarchyRootPlayer();
8001 InventoryLocation dst = new InventoryLocation;
8002
8003
8004 if (!playerOwner && root && root == this)
8005 {
8007 }
8008 else
8009 {
8010
8011 GetInventory().GetCurrentInventoryLocation(dst);
8013 {
8016 {
8018 }
8019 else
8020 {
8022
8023
8024 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8025 {
8027 }
8028 else
8029 {
8030 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8031 }
8032 }
8033 }
8034 }
8035
8036 ScriptInputUserData ctx = new ScriptInputUserData;
8044 }
8045 }
8046 else if (!
GetGame().IsMultiplayer())
8047 {
8049 }
8050 }
8051 }
8052
8054 {
8055 if (root)
8056 {
8057 vector m4[4];
8058 root.GetTransform(m4);
8059 dst.SetGround(this, m4);
8060 }
8061 else
8062 {
8063 GetInventory().GetCurrentInventoryLocation(dst);
8064 }
8065 }
8066
8067 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8068 {
8069
8070 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8071 return false;
8072
8073 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8074 return false;
8075
8076
8078 return false;
8079
8080
8081 Magazine mag = Magazine.Cast(this);
8082 if (mag)
8083 {
8084 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8085 return false;
8086
8087 if (stack_max_limit)
8088 {
8089 Magazine other_mag = Magazine.Cast(other_item);
8090 if (other_item)
8091 {
8092 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8093 return false;
8094 }
8095
8096 }
8097 }
8098 else
8099 {
8100
8102 return false;
8103
8105 return false;
8106 }
8107
8108 PlayerBase player = null;
8109 if (CastTo(player, GetHierarchyRootPlayer()))
8110 {
8111 if (player.GetInventory().HasAttachment(this))
8112 return false;
8113
8114 if (player.IsItemsToDelete())
8115 return false;
8116 }
8117
8118 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8119 return false;
8120
8121 int slotID;
8123 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8124 return false;
8125
8126 return true;
8127 }
8128
8130 {
8132 }
8133
8135 {
8136 return m_IsResultOfSplit;
8137 }
8138
8140 {
8141 m_IsResultOfSplit = value;
8142 }
8143
8145 {
8147 }
8148
8150 {
8151 float other_item_quantity = other_item.GetQuantity();
8152 float this_free_space;
8153
8155
8157
8158 if (other_item_quantity > this_free_space)
8159 {
8160 return this_free_space;
8161 }
8162 else
8163 {
8164 return other_item_quantity;
8165 }
8166 }
8167
8169 {
8171 }
8172
8174 {
8176 return;
8177
8178 if (!IsMagazine() && other_item)
8179 {
8181 if (quantity_used != 0)
8182 {
8183 float hp1 = GetHealth01("","");
8184 float hp2 = other_item.GetHealth01("","");
8185 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8186 hpResult = hpResult / (
GetQuantity() + quantity_used);
8187
8188 hpResult *= GetMaxHealth();
8189 Math.Round(hpResult);
8190 SetHealth("", "Health", hpResult);
8191
8193 other_item.AddQuantity(-quantity_used);
8194 }
8195 }
8197 }
8198
8200 {
8201 #ifdef SERVER
8202 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8203 GetHierarchyParent().IncreaseLifetimeUp();
8204 #endif
8205 };
8206
8208 {
8209 PlayerBase p = PlayerBase.Cast(player);
8210
8211 array<int> recipesIds = p.m_Recipes;
8212 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8213 if (moduleRecipesManager)
8214 {
8215 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8216 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8217 }
8218
8219 for (int i = 0;i < recipesIds.Count(); i++)
8220 {
8221 int key = recipesIds.Get(i);
8222 string recipeName = moduleRecipesManager.GetRecipeName(key);
8224 }
8225 }
8226
8227
8228 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8229 {
8230 super.GetDebugActions(outputList);
8231
8232
8238
8239
8244
8249
8250
8254
8255
8257 {
8261 }
8262
8265
8266
8270
8272
8273 InventoryLocation loc = new InventoryLocation();
8274 GetInventory().GetCurrentInventoryLocation(loc);
8276 {
8277 if (Gizmo_IsSupported())
8280 }
8281
8283 }
8284
8285
8286
8287
8289 {
8290 super.OnAction(action_id, player, ctx);
8291
8293 {
8294 switch (action_id)
8295 {
8298 return true;
8301 return true;
8302 }
8303 }
8304
8306 {
8307 switch (action_id)
8308 {
8310 Delete();
8311 return true;
8312 }
8313 }
8314
8315 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8316 {
8317 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8318 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8319 PlayerBase p = PlayerBase.Cast(player);
8320 if (
EActions.RECIPES_RANGE_START < 1000)
8321 {
8322 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8323 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8324 }
8325 }
8326 #ifndef SERVER
8327 else if (action_id ==
EActions.WATCH_PLAYER)
8328 {
8329 PluginDeveloper.SetDeveloperItemClientEx(player);
8330 }
8331 #endif
8333 {
8334 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8335 {
8336 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8337 OnDebugButtonPressServer(id + 1);
8338 }
8339
8340 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8341 {
8342 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8344 }
8345
8346 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8347 {
8348 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8350 }
8351
8352 else if (action_id ==
EActions.ADD_QUANTITY)
8353 {
8354 if (IsMagazine())
8355 {
8356 Magazine mag = Magazine.Cast(this);
8357 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8358 }
8359 else
8360 {
8362 }
8363
8364 if (m_EM)
8365 {
8366 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8367 }
8368
8369 }
8370
8371 else if (action_id ==
EActions.REMOVE_QUANTITY)
8372 {
8373 if (IsMagazine())
8374 {
8375 Magazine mag2 = Magazine.Cast(this);
8376 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8377 }
8378 else
8379 {
8381 }
8382 if (m_EM)
8383 {
8384 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8385 }
8386
8387 }
8388
8389 else if (action_id ==
EActions.SET_QUANTITY_0)
8390 {
8392
8393 if (m_EM)
8394 {
8395 m_EM.SetEnergy(0);
8396 }
8397 }
8398
8399 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8400 {
8402
8403 if (m_EM)
8404 {
8405 m_EM.SetEnergy(m_EM.GetEnergyMax());
8406 }
8407 }
8408
8409 else if (action_id ==
EActions.ADD_HEALTH)
8410 {
8411 AddHealth("","",GetMaxHealth("","Health")/5);
8412 }
8413 else if (action_id ==
EActions.REMOVE_HEALTH)
8414 {
8415 AddHealth("","",-GetMaxHealth("","Health")/5);
8416 }
8417 else if (action_id ==
EActions.DESTROY_HEALTH)
8418 {
8419 SetHealth01("","",0);
8420 }
8421 else if (action_id ==
EActions.WATCH_ITEM)
8422 {
8424 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8425 #ifdef DEVELOPER
8426 SetDebugDeveloper_item(this);
8427 #endif
8428 }
8429
8430 else if (action_id ==
EActions.ADD_TEMPERATURE)
8431 {
8432 AddTemperature(20);
8433
8434 }
8435
8436 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8437 {
8438 AddTemperature(-20);
8439
8440 }
8441
8442 else if (action_id ==
EActions.FLIP_FROZEN)
8443 {
8444 SetFrozen(!GetIsFrozen());
8445
8446 }
8447
8448 else if (action_id ==
EActions.ADD_WETNESS)
8449 {
8451
8452 }
8453
8454 else if (action_id ==
EActions.REMOVE_WETNESS)
8455 {
8457
8458 }
8459
8460 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8461 {
8464
8465
8466 }
8467
8468 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8469 {
8472 }
8473
8474 else if (action_id ==
EActions.MAKE_SPECIAL)
8475 {
8476 auto debugParams = DebugSpawnParams.WithPlayer(player);
8477 OnDebugSpawnEx(debugParams);
8478 }
8479
8480 }
8481
8482
8483 return false;
8484 }
8485
8486
8487
8488
8492
8495
8496
8497
8499 {
8500 return false;
8501 }
8502
8503
8505 {
8506 return true;
8507 }
8508
8509
8511 {
8512 return true;
8513 }
8514
8515
8516
8518 {
8519 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8521 }
8522
8525 {
8526 return null;
8527 }
8528
8530 {
8531 return false;
8532 }
8533
8535 {
8536 return false;
8537 }
8538
8542
8543
8545 {
8546 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8547 return module_repairing.CanRepair(this, item_repair_kit);
8548 }
8549
8550
8551 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8552 {
8553 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8554 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8555 }
8556
8557
8559 {
8560
8561
8562
8563
8564
8565
8566
8567
8568 return 1;
8569 }
8570
8571
8572
8574 {
8576 }
8577
8578
8579
8581 {
8583 }
8584
8585
8594 {
8595 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8596
8597 if (player)
8598 {
8599 player.MessageStatus(text);
8600 }
8601 }
8602
8603
8612 {
8613 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8614
8615 if (player)
8616 {
8617 player.MessageAction(text);
8618 }
8619 }
8620
8621
8630 {
8631 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8632
8633 if (player)
8634 {
8635 player.MessageFriendly(text);
8636 }
8637 }
8638
8639
8648 {
8649 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8650
8651 if (player)
8652 {
8653 player.MessageImportant(text);
8654 }
8655 }
8656
8658 {
8659 return true;
8660 }
8661
8662
8663 override bool KindOf(
string tag)
8664 {
8665 bool found = false;
8666 string item_name = this.
GetType();
8669
8670 int array_size = item_tag_array.Count();
8671 for (int i = 0; i < array_size; i++)
8672 {
8673 if (item_tag_array.Get(i) == tag)
8674 {
8675 found = true;
8676 break;
8677 }
8678 }
8679 return found;
8680 }
8681
8682
8684 {
8685
8686 super.OnRPC(sender, rpc_type,ctx);
8687
8688
8689 switch (rpc_type)
8690 {
8691 #ifndef SERVER
8692 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8693 Param2<bool, string> p = new Param2<bool, string>(false, "");
8694
8696 return;
8697
8698 bool play = p.param1;
8699 string soundSet = p.param2;
8700
8701 if (play)
8702 {
8704 {
8706 {
8708 }
8709 }
8710 else
8711 {
8713 }
8714 }
8715 else
8716 {
8718 }
8719
8720 break;
8721 #endif
8722
8723 }
8724
8726 {
8728 }
8729 }
8730
8731
8732
8733
8735 {
8736 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8737 return plugin.GetID(
name);
8738 }
8739
8741 {
8742 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8743 return plugin.GetName(id);
8744 }
8745
8748 {
8749
8750
8751 int varFlags;
8752 if (!ctx.
Read(varFlags))
8753 return;
8754
8755 if (varFlags & ItemVariableFlags.FLOAT)
8756 {
8758 }
8759 }
8760
8762 {
8763
8764 super.SerializeNumericalVars(floats_out);
8765
8766
8767
8769 {
8771 }
8772
8774 {
8776 }
8777
8779 {
8781 }
8782
8784 {
8789 }
8790
8792 {
8794 }
8795 }
8796
8798 {
8799
8800 super.DeSerializeNumericalVars(floats);
8801
8802
8803 int index = 0;
8804 int mask = Math.Round(floats.Get(index));
8805
8806 index++;
8807
8809 {
8811 {
8813 }
8814 else
8815 {
8816 float quantity = floats.Get(index);
8818 }
8819 index++;
8820 }
8821
8823 {
8824 float wet = floats.Get(index);
8826 index++;
8827 }
8828
8830 {
8831 int liquidtype = Math.Round(floats.Get(index));
8833 index++;
8834 }
8835
8837 {
8839 index++;
8841 index++;
8843 index++;
8845 index++;
8846 }
8847
8849 {
8850 int cleanness = Math.Round(floats.Get(index));
8852 index++;
8853 }
8854 }
8855
8857 {
8858 super.WriteVarsToCTX(ctx);
8859
8860
8862 {
8864 }
8865
8867 {
8869 }
8870
8872 {
8874 }
8875
8877 {
8878 int r,g,b,a;
8884 }
8885
8887 {
8889 }
8890 }
8891
8893 {
8894 if (!super.ReadVarsFromCTX(ctx,version))
8895 return false;
8896
8897 int intValue;
8898 float value;
8899
8900 if (version < 140)
8901 {
8902 if (!ctx.
Read(intValue))
8903 return false;
8904
8905 m_VariablesMask = intValue;
8906 }
8907
8909 {
8910 if (!ctx.
Read(value))
8911 return false;
8912
8914 {
8916 }
8917 else
8918 {
8920 }
8921 }
8922
8923 if (version < 140)
8924 {
8926 {
8927 if (!ctx.
Read(value))
8928 return false;
8929 SetTemperatureDirect(value);
8930 }
8931 }
8932
8934 {
8935 if (!ctx.
Read(value))
8936 return false;
8938 }
8939
8941 {
8942 if (!ctx.
Read(intValue))
8943 return false;
8945 }
8946
8948 {
8949 int r,g,b,a;
8951 return false;
8953 return false;
8955 return false;
8957 return false;
8958
8960 }
8961
8963 {
8964 if (!ctx.
Read(intValue))
8965 return false;
8967 }
8968
8969 if (version >= 138 && version < 140)
8970 {
8972 {
8973 if (!ctx.
Read(intValue))
8974 return false;
8975 SetFrozen(intValue);
8976 }
8977 }
8978
8979 return true;
8980 }
8981
8982
8984 {
8987 {
8989 }
8990
8991 if (!super.OnStoreLoad(ctx, version))
8992 {
8994 return false;
8995 }
8996
8997 if (version >= 114)
8998 {
8999 bool hasQuickBarIndexSaved;
9000
9001 if (!ctx.
Read(hasQuickBarIndexSaved))
9002 {
9004 return false;
9005 }
9006
9007 if (hasQuickBarIndexSaved)
9008 {
9009 int itmQBIndex;
9010
9011
9012 if (!ctx.
Read(itmQBIndex))
9013 {
9015 return false;
9016 }
9017
9018 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9019 if (itmQBIndex != -1 && parentPlayer)
9020 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9021 }
9022 }
9023 else
9024 {
9025
9026 PlayerBase player;
9027 int itemQBIndex;
9028 if (version ==
int.
MAX)
9029 {
9030 if (!ctx.
Read(itemQBIndex))
9031 {
9033 return false;
9034 }
9035 }
9036 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9037 {
9038
9039 if (!ctx.
Read(itemQBIndex))
9040 {
9042 return false;
9043 }
9044 if (itemQBIndex != -1 && player)
9045 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9046 }
9047 }
9048
9049 if (version < 140)
9050 {
9051
9052 if (!LoadVariables(ctx, version))
9053 {
9055 return false;
9056 }
9057 }
9058
9059
9061 {
9063 return false;
9064 }
9065 if (version >= 132)
9066 {
9068 if (raib)
9069 {
9071 {
9073 return false;
9074 }
9075 }
9076 }
9077
9079 return true;
9080 }
9081
9082
9083
9085 {
9086 super.OnStoreSave(ctx);
9087
9088 PlayerBase player;
9089 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9090 {
9092
9093 int itemQBIndex = -1;
9094 itemQBIndex = player.FindQuickBarEntityIndex(this);
9095 ctx.
Write(itemQBIndex);
9096 }
9097 else
9098 {
9100 }
9101
9103
9105 if (raib)
9106 {
9108 }
9109 }
9110
9111
9113 {
9114 super.AfterStoreLoad();
9115
9117 {
9119 }
9120
9122 {
9125 }
9126 }
9127
9129 {
9130 super.EEOnAfterLoad();
9131
9133 {
9135 }
9136
9139 }
9140
9142 {
9143 return false;
9144 }
9145
9146
9147
9149 {
9151 {
9152 #ifdef PLATFORM_CONSOLE
9153
9155 {
9157 if (menu)
9158 {
9160 }
9161 }
9162 #endif
9163 }
9164
9166 {
9169 }
9170
9172 {
9173 SetWeightDirty();
9175 }
9177 {
9180 }
9181
9183 {
9186 }
9188 {
9191 }
9192
9193 super.OnVariablesSynchronized();
9194 }
9195
9196
9197
9199 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9200 {
9201 if (!IsServerCheck(allow_client))
9202 return false;
9203
9205 return false;
9206
9209
9210 if (value <= (min + 0.001))
9211 value = min;
9212
9213 if (value == min)
9214 {
9215 if (destroy_config)
9216 {
9217 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9218 if (dstr)
9219 {
9221 this.Delete();
9222 return true;
9223 }
9224 }
9225 else if (destroy_forced)
9226 {
9228 this.Delete();
9229 return true;
9230 }
9231
9233 }
9234
9237
9239 {
9241
9242 if (delta)
9244 }
9245
9247
9248 return false;
9249 }
9250
9251
9253 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9254 {
9256 }
9257
9259 {
9262 }
9263
9265 {
9268 }
9269
9271 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9272 {
9273 float value_clamped = Math.Clamp(value, 0, 1);
9275 SetQuantity(result, destroy_config, destroy_forced);
9276 }
9277
9278
9281 {
9283 }
9284
9286 {
9288 }
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9300 {
9301 int slot = -1;
9302 if (GetInventory())
9303 {
9304 InventoryLocation il = new InventoryLocation;
9305 GetInventory().GetCurrentInventoryLocation(il);
9307 }
9308
9310 }
9311
9313 {
9314 float quantity_max = 0;
9315
9317 {
9318 if (attSlotID != -1)
9319 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9320
9321 if (quantity_max <= 0)
9323 }
9324
9325 if (quantity_max <= 0)
9327
9328 return quantity_max;
9329 }
9330
9332 {
9334 }
9335
9337 {
9339 }
9340
9341
9343 {
9345 }
9346
9348 {
9350 }
9351
9353 {
9355 }
9356
9357
9359 {
9360
9361 float weightEx = GetWeightEx();
9362 float special = GetInventoryAndCargoWeight();
9363 return weightEx - special;
9364 }
9365
9366
9368 {
9370 }
9371
9373 {
9375 {
9376 #ifdef DEVELOPER
9377 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9378 {
9379 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9381 }
9382 #endif
9383
9385 }
9386 else if (HasEnergyManager())
9387 {
9388 #ifdef DEVELOPER
9389 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9390 {
9391 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9392 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9393 }
9394 #endif
9395 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
9396 }
9397 else
9398 {
9399 #ifdef DEVELOPER
9400 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9401 {
9402 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9403 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9404 }
9405 #endif
9406 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9407 }
9408 }
9409
9412 {
9413 int item_count = 0;
9415
9416 if (GetInventory().GetCargo() != NULL)
9417 {
9418 item_count = GetInventory().GetCargo().GetItemCount();
9419 }
9420
9421 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9422 {
9423 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9424 if (item)
9425 item_count += item.GetNumberOfItems();
9426 }
9427 return item_count;
9428 }
9429
9432 {
9433 float weight = 0;
9434 float wetness = 1;
9435 if (include_wetness)
9438 {
9439 weight = wetness * m_ConfigWeight;
9440 }
9442 {
9443 weight = 1;
9444 }
9445 return weight;
9446 }
9447
9448
9449
9451 {
9452 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9453 {
9454 GameInventory inv = GetInventory();
9455 array<EntityAI> items = new array<EntityAI>;
9457 for (int i = 0; i < items.Count(); i++)
9458 {
9460 if (item)
9461 {
9463 }
9464 }
9465 }
9466 }
9467
9468
9469
9470
9472 {
9473 float energy = 0;
9474 if (HasEnergyManager())
9475 {
9476 energy = GetCompEM().GetEnergy();
9477 }
9478 return energy;
9479 }
9480
9481
9483 {
9484 super.OnEnergyConsumed();
9485
9487 }
9488
9490 {
9491 super.OnEnergyAdded();
9492
9494 }
9495
9496
9498 {
9499 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9500 {
9502 {
9503 float energy_0to1 = GetCompEM().GetEnergy0To1();
9505 }
9506 }
9507 }
9508
9509
9511 {
9512 return ConfigGetFloat("heatIsolation");
9513 }
9514
9516 {
9518 }
9519
9521 {
9522 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9523 if (
GetGame().ConfigIsExisting(paramPath))
9525
9526 return 0.0;
9527 }
9528
9530 {
9531 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9532 if (
GetGame().ConfigIsExisting(paramPath))
9534
9535 return 0.0;
9536 }
9537
9538 override void SetWet(
float value,
bool allow_client =
false)
9539 {
9540 if (!IsServerCheck(allow_client))
9541 return;
9542
9545
9547
9548 m_VarWet = Math.Clamp(value, min, max);
9549
9551 {
9554 }
9555 }
9556
9557 override void AddWet(
float value)
9558 {
9560 }
9561
9563 {
9565 }
9566
9568 {
9570 }
9571
9573 {
9575 }
9576
9578 {
9580 }
9581
9583 {
9585 }
9586
9588 {
9591 if (newLevel != oldLevel)
9592 {
9594 }
9595 }
9596
9598 {
9599 SetWeightDirty();
9600 }
9601
9603 {
9604 return GetWetLevelInternal(
m_VarWet);
9605 }
9606
9607
9608
9610 {
9612 }
9613
9615 {
9617 }
9618
9620 {
9622 }
9623
9625 {
9627 }
9628
9629
9630
9632 {
9633 if (ConfigIsExisting("itemModelLength"))
9634 {
9635 return ConfigGetFloat("itemModelLength");
9636 }
9637 return 0;
9638 }
9639
9641 {
9642 if (ConfigIsExisting("itemAttachOffset"))
9643 {
9644 return ConfigGetFloat("itemAttachOffset");
9645 }
9646 return 0;
9647 }
9648
9649 override void SetCleanness(
int value,
bool allow_client =
false)
9650 {
9651 if (!IsServerCheck(allow_client))
9652 return;
9653
9655
9657
9660 }
9661
9663 {
9665 }
9666
9668 {
9669 return true;
9670 }
9671
9672
9673
9674
9676 {
9678 }
9679
9681 {
9683 }
9684
9685
9686
9687
9688 override void SetColor(
int r,
int g,
int b,
int a)
9689 {
9695 }
9697 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9698 {
9703 }
9704
9706 {
9708 }
9709
9712 {
9713 int r,g,b,a;
9715 r = r/255;
9716 g = g/255;
9717 b = b/255;
9718 a = a/255;
9719 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9720 }
9721
9722
9723
9724 override void SetLiquidType(
int value,
bool allow_client =
false)
9725 {
9726 if (!IsServerCheck(allow_client))
9727 return;
9728
9733 }
9734
9736 {
9737 return ConfigGetInt("varLiquidTypeInit");
9738 }
9739
9741 {
9743 }
9744
9746 {
9748 SetFrozen(false);
9749 }
9750
9753 {
9754 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9755 }
9756
9757
9760 {
9761 PlayerBase nplayer;
9762 if (PlayerBase.CastTo(nplayer, player))
9763 {
9765
9766 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9767 }
9768 }
9769
9770
9773 {
9774 PlayerBase nplayer;
9775 if (PlayerBase.CastTo(nplayer,player))
9776 {
9777
9778 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9779
9780 }
9781
9782
9783 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9784
9785
9786 if (HasEnergyManager())
9787 {
9788 GetCompEM().UpdatePlugState();
9789 }
9790 }
9791
9792
9794 {
9795 super.OnPlacementStarted(player);
9796
9798 }
9799
9800 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9801 {
9803 {
9804 m_AdminLog.OnPlacementComplete(player,
this);
9805 }
9806
9807 super.OnPlacementComplete(player, position, orientation);
9808 }
9809
9810
9811
9812
9813
9815 {
9817 {
9818 return true;
9819 }
9820 else
9821 {
9822 return false;
9823 }
9824 }
9825
9826
9828 {
9830 {
9832 }
9833 }
9834
9835
9837 {
9839 }
9840
9842 {
9844 }
9845
9846 override void InsertAgent(
int agent,
float count = 1)
9847 {
9848 if (count < 1)
9849 return;
9850
9852 }
9853
9856 {
9858 }
9859
9860
9862 {
9864 }
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9908 {
9910 return false;
9911 return true;
9912 }
9913
9915 {
9916
9918 }
9919
9920
9923 {
9924 super.CheckForRoofLimited(timeTresholdMS);
9925
9927 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9928 {
9929 m_PreviousRoofTestTime = time;
9930 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9931 }
9932 }
9933
9934
9936 {
9938 {
9939 return 0;
9940 }
9941
9942 if (GetInventory().GetAttachmentSlotsCount() != 0)
9943 {
9944 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9945 if (filter)
9946 return filter.GetProtectionLevel(type, false, system);
9947 else
9948 return 0;
9949 }
9950
9951 string subclassPath, entryName;
9952
9953 switch (type)
9954 {
9956 entryName = "biological";
9957 break;
9959 entryName = "chemical";
9960 break;
9961 default:
9962 entryName = "biological";
9963 break;
9964 }
9965
9966 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9967
9969 }
9970
9971
9972
9975 {
9976 if (!IsMagazine())
9978
9980 }
9981
9982
9983
9984
9985
9990 {
9991 return true;
9992 }
9993
9995 {
9997 }
9998
9999
10000
10001
10002
10004 {
10005 if (parent)
10006 {
10007 if (parent.IsInherited(DayZInfected))
10008 return true;
10009
10010 if (!parent.IsRuined())
10011 return true;
10012 }
10013
10014 return true;
10015 }
10016
10018 {
10019 if (!super.CanPutAsAttachment(parent))
10020 {
10021 return false;
10022 }
10023
10024 if (!IsRuined() && !parent.IsRuined())
10025 {
10026 return true;
10027 }
10028
10029 return false;
10030 }
10031
10033 {
10034
10035
10036
10037
10038 return super.CanReceiveItemIntoCargo(item);
10039 }
10040
10042 {
10043
10044
10045
10046
10047 GameInventory attachmentInv = attachment.GetInventory();
10049 {
10050 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10051 return false;
10052 }
10053
10054 InventoryLocation loc = new InventoryLocation();
10055 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10056 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10057 return false;
10058
10059 return super.CanReceiveAttachment(attachment, slotId);
10060 }
10061
10063 {
10064 if (!super.CanReleaseAttachment(attachment))
10065 return false;
10066
10067 return GetInventory().AreChildrenAccessible();
10068 }
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10091 {
10092 int id = muzzle_owner.GetMuzzleID();
10093 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10094
10095 if (WPOF_array)
10096 {
10097 for (int i = 0; i < WPOF_array.Count(); i++)
10098 {
10099 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10100
10101 if (WPOF)
10102 {
10103 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10104 }
10105 }
10106 }
10107 }
10108
10109
10111 {
10112 int id = muzzle_owner.GetMuzzleID();
10114
10115 if (WPOBE_array)
10116 {
10117 for (int i = 0; i < WPOBE_array.Count(); i++)
10118 {
10119 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10120
10121 if (WPOBE)
10122 {
10123 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10124 }
10125 }
10126 }
10127 }
10128
10129
10131 {
10132 int id = muzzle_owner.GetMuzzleID();
10133 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10134
10135 if (WPOOH_array)
10136 {
10137 for (int i = 0; i < WPOOH_array.Count(); i++)
10138 {
10139 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10140
10141 if (WPOOH)
10142 {
10143 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10144 }
10145 }
10146 }
10147 }
10148
10149
10151 {
10152 int id = muzzle_owner.GetMuzzleID();
10153 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10154
10155 if (WPOOH_array)
10156 {
10157 for (int i = 0; i < WPOOH_array.Count(); i++)
10158 {
10159 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10160
10161 if (WPOOH)
10162 {
10163 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10164 }
10165 }
10166 }
10167 }
10168
10169
10171 {
10172 int id = muzzle_owner.GetMuzzleID();
10173 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10174
10175 if (WPOOH_array)
10176 {
10177 for (int i = 0; i < WPOOH_array.Count(); i++)
10178 {
10179 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10180
10181 if (WPOOH)
10182 {
10183 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10184 }
10185 }
10186 }
10187 }
10188
10189
10190
10192 {
10194 {
10195 return true;
10196 }
10197
10198 return false;
10199 }
10200
10202 {
10204 {
10205 return true;
10206 }
10207
10208 return false;
10209 }
10210
10212 {
10214 {
10215 return true;
10216 }
10217
10218 return false;
10219 }
10220
10222 {
10223 return false;
10224 }
10225
10228 {
10229 return UATimeSpent.DEFAULT_DEPLOY;
10230 }
10231
10232
10233
10234
10236 {
10238 SetSynchDirty();
10239 }
10240
10242 {
10244 }
10245
10246
10248 {
10249 return false;
10250 }
10251
10254 {
10255 string att_type = "None";
10256
10257 if (ConfigIsExisting("soundAttType"))
10258 {
10259 att_type = ConfigGetString("soundAttType");
10260 }
10261
10263 }
10264
10266 {
10268 }
10269
10270
10271
10272
10273
10279
10281 {
10284
10286 }
10287
10288
10290 {
10292 return;
10293
10295
10298
10301
10302 SoundParameters params = new SoundParameters();
10306 }
10307
10308
10310 {
10312 return;
10313
10315 SetSynchDirty();
10316
10319 }
10320
10321
10323 {
10325 return;
10326
10328 SetSynchDirty();
10329
10332 }
10333
10335 {
10337 }
10338
10340 {
10342 }
10343
10346 {
10347 if (!
GetGame().IsDedicatedServer())
10348 {
10349 if (ConfigIsExisting("attachSoundSet"))
10350 {
10351 string cfg_path = "";
10352 string soundset = "";
10353 string type_name =
GetType();
10354
10357 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10358 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10359
10360 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10361 {
10362 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10363 {
10364 if (cfg_slot_array[i] == slot_type)
10365 {
10366 soundset = cfg_soundset_array[i];
10367 break;
10368 }
10369 }
10370 }
10371
10372 if (soundset != "")
10373 {
10374 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10376 }
10377 }
10378 }
10379 }
10380
10382 {
10383
10384 }
10385
10386 void OnApply(PlayerBase player);
10387
10389 {
10390 return 1.0;
10391 };
10392
10394 {
10396 }
10397
10399 {
10401 }
10402
10404
10406 {
10407 SetDynamicPhysicsLifeTime(0.01);
10409 }
10410
10412 {
10413 array<string> zone_names = new array<string>;
10414 GetDamageZones(zone_names);
10415 for (int i = 0; i < zone_names.Count(); i++)
10416 {
10417 SetHealthMax(zone_names.Get(i),"Health");
10418 }
10419 SetHealthMax("","Health");
10420 }
10421
10424 {
10425 float global_health = GetHealth01("","Health");
10426 array<string> zones = new array<string>;
10427 GetDamageZones(zones);
10428
10429 for (int i = 0; i < zones.Count(); i++)
10430 {
10431 SetHealth01(zones.Get(i),"Health",global_health);
10432 }
10433 }
10434
10437 {
10438 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10439 }
10440
10442 {
10443 if (!hasRootAsPlayer)
10444 {
10445 if (refParentIB)
10446 {
10447
10448 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10449 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10450
10451 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10452 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10453
10456 }
10457 else
10458 {
10459
10462 }
10463 }
10464 }
10465
10467 {
10469 {
10470 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10471 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10472 {
10473 float heatPermCoef = 1.0;
10475 while (ent)
10476 {
10477 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10478 ent = ent.GetHierarchyParent();
10479 }
10480
10481 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10482 }
10483 }
10484 }
10485
10487 {
10488
10489 EntityAI parent = GetHierarchyParent();
10490 if (!parent)
10491 {
10492 hasParent = false;
10493 hasRootAsPlayer = false;
10494 }
10495 else
10496 {
10497 hasParent = true;
10498 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10499 refParentIB =
ItemBase.Cast(parent);
10500 }
10501 }
10502
10503 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10504 {
10505
10506 }
10507
10509 {
10510
10511 return false;
10512 }
10513
10515 {
10516
10517
10518 return false;
10519 }
10520
10522 {
10523
10524 return false;
10525 }
10526
10529 {
10530 return !GetIsFrozen() &&
IsOpen();
10531 }
10532
10534 {
10535 bool hasParent = false, hasRootAsPlayer = false;
10537
10538 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10539 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10540
10541 if (wwtu || foodDecay)
10542 {
10546
10547 if (processWetness || processTemperature || processDecay)
10548 {
10550
10551 if (processWetness)
10552 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10553
10554 if (processTemperature)
10556
10557 if (processDecay)
10558 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10559 }
10560 }
10561 }
10562
10565 {
10567 }
10568
10570 {
10573
10574 return super.GetTemperatureFreezeThreshold();
10575 }
10576
10578 {
10581
10582 return super.GetTemperatureThawThreshold();
10583 }
10584
10586 {
10589
10590 return super.GetItemOverheatThreshold();
10591 }
10592
10594 {
10596 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10597
10598 return super.GetTemperatureFreezeTime();
10599 }
10600
10602 {
10604 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10605
10606 return super.GetTemperatureThawTime();
10607 }
10608
10613
10615 {
10616 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10617 }
10618
10620 {
10621 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10622 }
10623
10626 {
10628 }
10629
10631 {
10633 }
10634
10636 {
10638 }
10639
10642 {
10643 return null;
10644 }
10645
10648 {
10649 return false;
10650 }
10651
10653 {
10655 {
10658 if (!trg)
10659 {
10661 explosive = this;
10662 }
10663
10664 explosive.PairRemote(trg);
10666
10667 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10668 trg.SetPersistentPairID(persistentID);
10669 explosive.SetPersistentPairID(persistentID);
10670
10671 return true;
10672 }
10673 return false;
10674 }
10675
10678 {
10679 float ret = 1.0;
10682 ret *= GetHealth01();
10683
10684 return ret;
10685 }
10686
10687 #ifdef DEVELOPER
10688 override void SetDebugItem()
10689 {
10690 super.SetDebugItem();
10691 _itemBase = this;
10692 }
10693
10695 {
10696 string text = super.GetDebugText();
10697
10699 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10700
10701 return text;
10702 }
10703 #endif
10704
10706 {
10707 return true;
10708 }
10709
10711
10713
10715 {
10718 }
10719
10720
10728
10744}
10745
10747{
10749 if (entity)
10750 {
10751 bool is_item = entity.IsInherited(
ItemBase);
10752 if (is_item && full_quantity)
10753 {
10756 }
10757 }
10758 else
10759 {
10761 return NULL;
10762 }
10763 return entity;
10764}
10765
10767{
10768 if (item)
10769 {
10770 if (health > 0)
10771 item.SetHealth("", "", health);
10772
10773 if (item.CanHaveTemperature())
10774 {
10776 if (item.CanFreeze())
10777 item.SetFrozen(false);
10778 }
10779
10780 if (item.HasEnergyManager())
10781 {
10782 if (quantity >= 0)
10783 {
10784 item.GetCompEM().SetEnergy0To1(quantity);
10785 }
10786 else
10787 {
10789 }
10790 }
10791 else if (item.IsMagazine())
10792 {
10793 Magazine mag = Magazine.Cast(item);
10794 if (quantity >= 0)
10795 {
10796 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10797 }
10798 else
10799 {
10801 }
10802
10803 }
10804 else
10805 {
10806 if (quantity >= 0)
10807 {
10808 item.SetQuantityNormalized(quantity, false);
10809 }
10810 else
10811 {
10813 }
10814
10815 }
10816 }
10817}
10818
10819#ifdef DEVELOPER
10821#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.