5977{
5979 {
5980 return true;
5981 }
5982};
5983
5984
5985
5987{
5991
5993
5996
5997
5998
5999
6000
6009
6015
6020
6025
6046 protected bool m_IsResultOfSplit
6047
6049
6054
6055
6056
6058
6062
6063
6064
6066
6069
6070
6071
6077
6078
6086
6089
6090
6092
6093
6095
6096
6101
6102
6107
6108
6110
6111
6113 {
6118
6119 if (!
GetGame().IsDedicatedServer())
6120 {
6122 {
6124
6126 {
6128 }
6129 }
6130
6133 }
6134
6135 m_OldLocation = null;
6136
6138 {
6140 }
6141
6142 if (ConfigIsExisting("headSelectionsToHide"))
6143 {
6146 }
6147
6149 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6150 {
6152 }
6153
6155
6156 m_IsResultOfSplit = false;
6157
6159 }
6160
6162 {
6163 super.InitItemVariables();
6164
6170 m_Count = ConfigGetInt(
"count");
6171
6174
6179
6182
6187
6199
6203
6204
6207 if (ConfigIsExisting("canBeSplit"))
6208 {
6211 }
6212
6214 if (ConfigIsExisting("itemBehaviour"))
6216
6217
6220 RegisterNetSyncVariableInt("m_VarLiquidType");
6221 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6222
6223 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6224 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6225 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6226
6227 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6228 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6229 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6230 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6231
6232 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6233 RegisterNetSyncVariableBool("m_IsTakeable");
6234 RegisterNetSyncVariableBool("m_IsHologram");
6235
6238 {
6241 }
6242
6244
6246 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6248
6249 }
6250
6252 {
6254 }
6255
6257 {
6260 {
6265 }
6266 }
6267
6268 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6269 {
6271 {
6274 }
6275
6277 }
6278
6280 {
6286 }
6287
6289
6291 {
6293
6294 if (!action)
6295 {
6296 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6297 return;
6298 }
6299
6301 if (!ai)
6302 {
6304 return;
6305 }
6306
6308 if (!action_array)
6309 {
6310 action_array = new array<ActionBase_Basic>;
6312 }
6313 if (LogManager.IsActionLogEnable())
6314 {
6315 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6316 }
6317
6318 if (action_array.Find(action) != -1)
6319 {
6320 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6321 }
6322 else
6323 {
6324 action_array.Insert(action);
6325 }
6326 }
6327
6329 {
6331 ActionBase action = player.GetActionManager().GetAction(actionName);
6334
6335 if (action_array)
6336 {
6337 action_array.RemoveItem(action);
6338 }
6339 }
6340
6341
6342
6344 {
6345 ActionOverrideData overrideData = new ActionOverrideData();
6349
6351 if (!actionMap)
6352 {
6355 }
6356
6357 actionMap.Insert(this.
Type(), overrideData);
6358
6359 }
6360
6362
6364
6365
6367 {
6370
6373
6374 string config_to_search = "CfgVehicles";
6375 string muzzle_owner_config;
6376
6378 {
6379 if (IsInherited(Weapon))
6380 config_to_search = "CfgWeapons";
6381
6382 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6383
6384 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6385
6387
6388 if (config_OnFire_subclass_count > 0)
6389 {
6390 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6391
6392 for (int i = 0; i < config_OnFire_subclass_count; i++)
6393 {
6394 string particle_class = "";
6396 string config_OnFire_entry = config_OnFire_class + particle_class;
6397 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6398 WPOF_array.Insert(WPOF);
6399 }
6400
6401
6403 }
6404 }
6405
6407 {
6408 config_to_search = "CfgWeapons";
6409 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6410
6411 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6412
6414
6415 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6416 {
6417 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6418
6419 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6420 {
6421 string particle_class2 = "";
6423 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6424 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6425 WPOBE_array.Insert(WPOBE);
6426 }
6427
6428
6430 }
6431 }
6432 }
6433
6434
6436 {
6439
6441 {
6442 string config_to_search = "CfgVehicles";
6443
6444 if (IsInherited(Weapon))
6445 config_to_search = "CfgWeapons";
6446
6447 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6448 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6449
6450 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6451 {
6452
6454
6456 {
6458 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6460 return;
6461 }
6462
6465
6466
6467
6469 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6470
6471 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6472 {
6473 string particle_class = "";
6475 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6477
6478 if (entry_type == CT_CLASS)
6479 {
6480 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6481 WPOOH_array.Insert(WPOF);
6482 }
6483 }
6484
6485
6487 }
6488 }
6489 }
6490
6492 {
6494 }
6495
6497 {
6499 {
6501
6504
6507
6508 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6509 }
6510 }
6511
6513 {
6515 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6516
6518 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6519
6521 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6522
6524 {
6526 }
6527 }
6528
6530 {
6532 }
6533
6535 {
6538 else
6540
6542 {
6545 }
6546 else
6547 {
6550
6553 }
6554
6556 }
6557
6559 {
6561 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6562 }
6563
6565 {
6567 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6569 }
6570
6572 {
6574 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6575 }
6576
6578 {
6581
6582 OverheatingParticle OP = new OverheatingParticle();
6587
6589 }
6590
6592 {
6595
6596 return -1;
6597 }
6598
6600 {
6602 {
6605
6606 for (int i = count; i > 0; --i)
6607 {
6608 int id = i - 1;
6611
6614
6615 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6616 {
6617 if (p)
6618 {
6621 }
6622 }
6623 }
6624 }
6625 }
6626
6628 {
6630 {
6632 {
6633 int id = i - 1;
6635
6636 if (OP)
6637 {
6639
6640 if (p)
6641 {
6643 }
6644
6645 delete OP;
6646 }
6647 }
6648
6651 }
6652 }
6653
6656 {
6657 return 0.0;
6658 }
6659
6660
6662 {
6663 return 250;
6664 }
6665
6667 {
6668 return 0;
6669 }
6670
6673 {
6675 return true;
6676
6677 return false;
6678 }
6679
6682 {
6685
6687 {
6689 }
6690 else
6691 {
6692
6694 }
6695
6697 }
6698
6705 {
6706 return -1;
6707 }
6708
6709
6710
6711
6713 {
6715 {
6717 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6718
6719 if (r_index >= 0)
6720 {
6721 InventoryLocation r_il = new InventoryLocation;
6722 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6723
6724 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6727 {
6728 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6729 }
6731 {
6732 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6733 }
6734
6735 }
6736
6737 player.GetHumanInventory().ClearUserReservedLocation(this);
6738 }
6739
6742 }
6743
6744
6745
6746
6748 {
6749 return ItemBase.m_DebugActionsMask;
6750 }
6751
6753 {
6754 return ItemBase.m_DebugActionsMask & mask;
6755 }
6756
6758 {
6759 ItemBase.m_DebugActionsMask = mask;
6760 }
6761
6763 {
6764 ItemBase.m_DebugActionsMask |= mask;
6765 }
6766
6768 {
6769 ItemBase.m_DebugActionsMask &= ~mask;
6770 }
6771
6773 {
6775 {
6777 }
6778 else
6779 {
6781 }
6782 }
6783
6784
6786 {
6787 if (GetEconomyProfile())
6788 {
6789 float q_max = GetEconomyProfile().GetQuantityMax();
6790 if (q_max > 0)
6791 {
6792 float q_min = GetEconomyProfile().GetQuantityMin();
6793 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6794
6796 {
6797 ComponentEnergyManager comp = GetCompEM();
6799 {
6801 }
6802 }
6804 {
6806
6807 }
6808
6809 }
6810 }
6811 }
6812
6815 {
6816 EntityAI parent = GetHierarchyParent();
6817
6818 if (parent)
6819 {
6820 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6821 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6822 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6823 }
6824 }
6825
6828 {
6829 EntityAI parent = GetHierarchyParent();
6830
6831 if (parent)
6832 {
6833 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6834 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6835 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6836 }
6837 }
6838
6840 {
6841
6842
6843
6844
6846
6848 {
6849 if (ScriptInputUserData.CanStoreInputUserData())
6850 {
6851 ScriptInputUserData ctx = new ScriptInputUserData;
6857 ctx.
Write(use_stack_max);
6860
6862 {
6863 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6864 }
6865 }
6866 }
6867 else if (!
GetGame().IsMultiplayer())
6868 {
6870 }
6871 }
6872
6874 {
6876 }
6877
6879 {
6881 }
6882
6884 {
6886 }
6887
6889 {
6890
6891 return false;
6892 }
6893
6895 {
6896 return false;
6897 }
6898
6902 {
6903 return false;
6904 }
6905
6907 {
6908 return "";
6909 }
6910
6912
6914 {
6915 return false;
6916 }
6917
6919 {
6920 return true;
6921 }
6922
6923
6924
6926 {
6927 return true;
6928 }
6929
6931 {
6932 return true;
6933 }
6934
6936 {
6937 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6939 }
6940
6942 {
6944 }
6945
6947 {
6949 if (!is_being_placed)
6951 SetSynchDirty();
6952 }
6953
6954
6956
6958 {
6960 }
6961
6963 {
6965 }
6966
6968 {
6969 return 1;
6970 }
6971
6973 {
6974 return false;
6975 }
6976
6978 {
6980 SetSynchDirty();
6981 }
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7018 {
7019 super.OnMovedInsideCargo(container);
7020
7021 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7022 }
7023
7024 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7025 {
7026 super.EEItemLocationChanged(oldLoc,newLoc);
7027
7028 PlayerBase new_player = null;
7029 PlayerBase old_player = null;
7030
7031 if (newLoc.GetParent())
7032 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7033
7034 if (oldLoc.GetParent())
7035 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7036
7038 {
7039 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7040
7041 if (r_index >= 0)
7042 {
7043 InventoryLocation r_il = new InventoryLocation;
7044 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7045
7046 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7049 {
7050 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7051 }
7053 {
7054 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7055 }
7056
7057 }
7058 }
7059
7061 {
7062 if (new_player)
7063 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7064
7065 if (new_player == old_player)
7066 {
7067
7068 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7069 {
7071 {
7072 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7073 {
7074 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7075 }
7076 }
7077 else
7078 {
7079 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7080 }
7081 }
7082
7083 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7084 {
7085 int type = oldLoc.GetType();
7087 {
7088 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7089 }
7091 {
7092 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7093 }
7094 }
7095 if (!m_OldLocation)
7096 {
7097 m_OldLocation = new InventoryLocation;
7098 }
7099 m_OldLocation.Copy(oldLoc);
7100 }
7101 else
7102 {
7103 if (m_OldLocation)
7104 {
7105 m_OldLocation.Reset();
7106 }
7107 }
7108
7110 }
7111 else
7112 {
7113 if (new_player)
7114 {
7115 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7116 if (res_index >= 0)
7117 {
7118 InventoryLocation il = new InventoryLocation;
7119 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7121 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7124 {
7125 il.
GetParent().GetOnReleaseLock().Invoke(it);
7126 }
7128 {
7130 }
7131
7132 }
7133 }
7135 {
7136
7138 }
7139
7140 if (m_OldLocation)
7141 {
7142 m_OldLocation.Reset();
7143 }
7144 }
7145 }
7146
7147 override void EOnContact(IEntity other, Contact extra)
7148 {
7150 {
7151 int liquidType = -1;
7153 if (impactSpeed > 0.0)
7154 {
7156 #ifndef SERVER
7158 #else
7160 SetSynchDirty();
7161 #endif
7163 }
7164 }
7165
7166 #ifdef SERVER
7167 if (GetCompEM() && GetCompEM().IsPlugged())
7168 {
7169 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7170 GetCompEM().UnplugThis();
7171 }
7172 #endif
7173 }
7174
7176
7178 {
7180 }
7181
7183 {
7184
7185 }
7186
7188 {
7189 super.OnItemLocationChanged(old_owner, new_owner);
7190
7191 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7192 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7193
7194 if (!relatedPlayer && playerNew)
7195 relatedPlayer = playerNew;
7196
7197 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7198 {
7200 if (actionMgr)
7201 {
7202 ActionBase currentAction = actionMgr.GetRunningAction();
7203 if (currentAction)
7205 }
7206 }
7207
7208 Man ownerPlayerOld = null;
7209 Man ownerPlayerNew = null;
7210
7211 if (old_owner)
7212 {
7213 if (old_owner.
IsMan())
7214 {
7215 ownerPlayerOld = Man.Cast(old_owner);
7216 }
7217 else
7218 {
7219 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7220 }
7221 }
7222 else
7223 {
7225 {
7227
7228 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7229 {
7230 GetCompEM().UnplugThis();
7231 }
7232 }
7233 }
7234
7235 if (new_owner)
7236 {
7237 if (new_owner.
IsMan())
7238 {
7239 ownerPlayerNew = Man.Cast(new_owner);
7240 }
7241 else
7242 {
7243 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7244 }
7245 }
7246
7247 if (ownerPlayerOld != ownerPlayerNew)
7248 {
7249 if (ownerPlayerOld)
7250 {
7251 array<EntityAI> subItemsExit = new array<EntityAI>;
7253 for (int i = 0; i < subItemsExit.Count(); i++)
7254 {
7257 }
7258 }
7259
7260 if (ownerPlayerNew)
7261 {
7262 array<EntityAI> subItemsEnter = new array<EntityAI>;
7264 for (int j = 0; j < subItemsEnter.Count(); j++)
7265 {
7268 }
7269 }
7270 }
7271 else if (ownerPlayerNew != null)
7272 {
7273 PlayerBase nplayer;
7274 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7275 {
7276 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7278 for (int k = 0; k < subItemsUpdate.Count(); k++)
7279 {
7281 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7282 }
7283 }
7284 }
7285
7286 if (old_owner)
7287 old_owner.OnChildItemRemoved(this);
7288 if (new_owner)
7289 new_owner.OnChildItemReceived(this);
7290 }
7291
7292
7294 {
7295 super.EEDelete(parent);
7296 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7297 if (player)
7298 {
7300
7301 if (player.IsAlive())
7302 {
7303 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7304 if (r_index >= 0)
7305 {
7306 InventoryLocation r_il = new InventoryLocation;
7307 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7308
7309 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7312 {
7313 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7314 }
7316 {
7317 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7318 }
7319
7320 }
7321
7322 player.RemoveQuickBarEntityShortcut(this);
7323 }
7324 }
7325 }
7326
7328 {
7329 super.EEKilled(killer);
7330
7333 {
7334 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7335 {
7336 if (IsMagazine())
7337 {
7338 if (Magazine.Cast(this).GetAmmoCount() > 0)
7339 {
7341 }
7342 }
7343 else
7344 {
7346 }
7347 }
7348 }
7349 }
7350
7352 {
7353 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7354
7355 super.OnWasAttached(parent, slot_id);
7356
7359
7361 }
7362
7364 {
7365 super.OnWasDetached(parent, slot_id);
7366
7369 }
7370
7372 {
7373 int idx;
7376
7377 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7378 if (inventory_slots.Count() < 1)
7379 {
7380 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7381 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7382 }
7383 else
7384 {
7385 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7386 }
7387
7388 idx = inventory_slots.Find(slot);
7389 if (idx < 0)
7390 return "";
7391
7392 return attach_types.Get(idx);
7393 }
7394
7396 {
7397 int idx = -1;
7398 string slot;
7399
7402
7403 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7404 if (inventory_slots.Count() < 1)
7405 {
7406 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7407 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7408 }
7409 else
7410 {
7411 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7412 if (detach_types.Count() < 1)
7413 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7414 }
7415
7416 for (int i = 0; i < inventory_slots.Count(); i++)
7417 {
7418 slot = inventory_slots.Get(i);
7419 }
7420
7421 if (slot != "")
7422 {
7423 if (detach_types.Count() == 1)
7424 idx = 0;
7425 else
7426 idx = inventory_slots.Find(slot);
7427 }
7428 if (idx < 0)
7429 return "";
7430
7431 return detach_types.Get(idx);
7432 }
7433
7435 {
7436
7438
7439
7440 float min_time = 1;
7441 float max_time = 3;
7442 float delay = Math.RandomFloat(min_time, max_time);
7443
7444 explode_timer.Run(delay, this, "DoAmmoExplosion");
7445 }
7446
7448 {
7449 Magazine magazine = Magazine.Cast(this);
7450 int pop_sounds_count = 6;
7451 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7452
7453
7454 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7455 string sound_name = pop_sounds[ sound_idx ];
7457
7458
7459 magazine.ServerAddAmmoCount(-1);
7460
7461
7462 float min_temp_to_explode = 100;
7463
7464 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7465 {
7467 }
7468 }
7469
7470
7471 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7472 {
7473 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7474
7475 const int CHANCE_DAMAGE_CARGO = 4;
7476 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7477 const int CHANCE_DAMAGE_NOTHING = 2;
7478
7480 {
7481 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7482 int chances;
7483 int rnd;
7484
7485 if (GetInventory().GetCargo())
7486 {
7487 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7488 rnd = Math.RandomInt(0,chances);
7489
7490 if (rnd < CHANCE_DAMAGE_CARGO)
7491 {
7493 }
7494 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7495 {
7497 }
7498 }
7499 else
7500 {
7501 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7502 rnd = Math.RandomInt(0,chances);
7503
7504 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7505 {
7507 }
7508 }
7509 }
7510 }
7511
7513 {
7514 if (GetInventory().GetCargo())
7515 {
7516 int item_count = GetInventory().GetCargo().GetItemCount();
7517 if (item_count > 0)
7518 {
7519 int random_pick = Math.RandomInt(0, item_count);
7521 if (!item.IsExplosive())
7522 {
7523 item.AddHealth("","",damage);
7524 return true;
7525 }
7526 }
7527 }
7528 return false;
7529 }
7530
7532 {
7533 int attachment_count = GetInventory().AttachmentCount();
7534 if (attachment_count > 0)
7535 {
7536 int random_pick = Math.RandomInt(0, attachment_count);
7537 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7538 if (!attachment.IsExplosive())
7539 {
7540 attachment.AddHealth("","",damage);
7541 return true;
7542 }
7543 }
7544 return false;
7545 }
7546
7548 {
7550 }
7551
7553 {
7555 return GetInventory().CanRemoveEntity();
7556
7557 return false;
7558 }
7559
7561 {
7563 return;
7564
7566 {
7567 if (ScriptInputUserData.CanStoreInputUserData())
7568 {
7569 ScriptInputUserData ctx = new ScriptInputUserData;
7574 ctx.
Write(destination_entity);
7578 }
7579 }
7580 else if (!
GetGame().IsMultiplayer())
7581 {
7583 }
7584 }
7585
7587 {
7589 return;
7590
7591 float split_quantity_new;
7595 InventoryLocation loc = new InventoryLocation;
7596
7597 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7598 {
7600 split_quantity_new = stack_max;
7601 else
7603
7604 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7605 if (new_item)
7606 {
7607 new_item.SetResultOfSplit(true);
7608 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7610 new_item.SetQuantity(split_quantity_new);
7611 }
7612 }
7613 else if (destination_entity && slot_id == -1)
7614 {
7615 if (quantity > stack_max)
7616 split_quantity_new = stack_max;
7617 else
7618 split_quantity_new = quantity;
7619
7621 {
7624 }
7625
7626 if (new_item)
7627 {
7628 new_item.SetResultOfSplit(true);
7629 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7631 new_item.SetQuantity(split_quantity_new);
7632 }
7633 }
7634 else
7635 {
7636 if (stack_max != 0)
7637 {
7639 {
7641 }
7642
7643 if (split_quantity_new == 0)
7644 {
7645 if (!
GetGame().IsMultiplayer())
7646 player.PhysicalPredictiveDropItem(this);
7647 else
7648 player.ServerDropEntity(this);
7649 return;
7650 }
7651
7653
7654 if (new_item)
7655 {
7656 new_item.SetResultOfSplit(true);
7657 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7659 new_item.SetQuantity(stack_max);
7660 new_item.PlaceOnSurface();
7661 }
7662 }
7663 }
7664 }
7665
7667 {
7669 return;
7670
7671 float split_quantity_new;
7675 InventoryLocation loc = new InventoryLocation;
7676
7677 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7678 {
7680 split_quantity_new = stack_max;
7681 else
7683
7684 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7685 if (new_item)
7686 {
7687 new_item.SetResultOfSplit(true);
7688 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7690 new_item.SetQuantity(split_quantity_new);
7691 }
7692 }
7693 else if (destination_entity && slot_id == -1)
7694 {
7695 if (quantity > stack_max)
7696 split_quantity_new = stack_max;
7697 else
7698 split_quantity_new = quantity;
7699
7701 {
7704 }
7705
7706 if (new_item)
7707 {
7708 new_item.SetResultOfSplit(true);
7709 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7711 new_item.SetQuantity(split_quantity_new);
7712 }
7713 }
7714 else
7715 {
7716 if (stack_max != 0)
7717 {
7719 {
7721 }
7722
7724
7725 if (new_item)
7726 {
7727 new_item.SetResultOfSplit(true);
7728 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7730 new_item.SetQuantity(stack_max);
7731 new_item.PlaceOnSurface();
7732 }
7733 }
7734 }
7735 }
7736
7738 {
7740 return;
7741
7743 {
7744 if (ScriptInputUserData.CanStoreInputUserData())
7745 {
7746 ScriptInputUserData ctx = new ScriptInputUserData;
7751 dst.WriteToContext(ctx);
7753 }
7754 }
7755 else if (!
GetGame().IsMultiplayer())
7756 {
7758 }
7759 }
7760
7762 {
7764 return;
7765
7767 {
7768 if (ScriptInputUserData.CanStoreInputUserData())
7769 {
7770 ScriptInputUserData ctx = new ScriptInputUserData;
7775 ctx.
Write(destination_entity);
7781 }
7782 }
7783 else if (!
GetGame().IsMultiplayer())
7784 {
7786 }
7787 }
7788
7790 {
7792 }
7793
7795 {
7797 return this;
7798
7800 float split_quantity_new;
7802 if (dst.IsValid())
7803 {
7804 int slot_id = dst.GetSlot();
7806
7807 if (quantity > stack_max)
7808 split_quantity_new = stack_max;
7809 else
7810 split_quantity_new = quantity;
7811
7813
7814 if (new_item)
7815 {
7816 new_item.SetResultOfSplit(true);
7817 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7820 }
7821
7822 return new_item;
7823 }
7824
7825 return null;
7826 }
7827
7829 {
7831 return;
7832
7834 float split_quantity_new;
7836 if (destination_entity)
7837 {
7839 if (quantity > stackable)
7840 split_quantity_new = stackable;
7841 else
7842 split_quantity_new = quantity;
7843
7844 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7845 if (new_item)
7846 {
7847 new_item.SetResultOfSplit(true);
7848 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7850 new_item.SetQuantity(split_quantity_new);
7851 }
7852 }
7853 }
7854
7856 {
7858 return;
7859
7861 {
7862 if (ScriptInputUserData.CanStoreInputUserData())
7863 {
7864 ScriptInputUserData ctx = new ScriptInputUserData;
7869 ItemBase destination_entity =
this;
7870 ctx.
Write(destination_entity);
7874 }
7875 }
7876 else if (!
GetGame().IsMultiplayer())
7877 {
7879 }
7880 }
7881
7883 {
7885 return;
7886
7888 float split_quantity_new;
7890 if (player)
7891 {
7893 if (quantity > stackable)
7894 split_quantity_new = stackable;
7895 else
7896 split_quantity_new = quantity;
7897
7898 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7899 new_item =
ItemBase.Cast(in_hands);
7900 if (new_item)
7901 {
7902 new_item.SetResultOfSplit(true);
7903 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7905 new_item.SetQuantity(split_quantity_new);
7906 }
7907 }
7908 }
7909
7911 {
7913 return;
7914
7916 float split_quantity_new = Math.Floor(quantity * 0.5);
7917
7919
7920 if (new_item)
7921 {
7922 if (new_item.GetQuantityMax() < split_quantity_new)
7923 {
7924 split_quantity_new = new_item.GetQuantityMax();
7925 }
7926
7927 new_item.SetResultOfSplit(true);
7928 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7929
7931 {
7934 }
7935 else
7936 {
7939 }
7940 }
7941 }
7942
7944 {
7946 return;
7947
7949 float split_quantity_new = Math.Floor(quantity / 2);
7950
7951 InventoryLocation invloc = new InventoryLocation;
7953
7955 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7956
7957 if (new_item)
7958 {
7959 if (new_item.GetQuantityMax() < split_quantity_new)
7960 {
7961 split_quantity_new = new_item.GetQuantityMax();
7962 }
7964 {
7967 }
7968 else
7969 {
7972 }
7973 }
7974 }
7975
7978 {
7979 SetWeightDirty();
7981
7982 if (parent)
7983 parent.OnAttachmentQuantityChangedEx(this, delta);
7984
7986 {
7988 {
7990 }
7992 {
7993 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
7995 }
7996 }
7997
7998 }
7999
8002 {
8003
8004 }
8005
8008 {
8010 }
8011
8013 {
8014 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8015
8017 {
8018 if (newLevel == GameConstants.STATE_RUINED)
8019 {
8021 EntityAI parent = GetHierarchyParent();
8022 if (parent && parent.IsFireplace())
8023 {
8024 CargoBase cargo = GetInventory().GetCargo();
8025 if (cargo)
8026 {
8028 {
8030 }
8031 }
8032 }
8033 }
8034
8036 {
8037
8039 return;
8040 }
8041
8042 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8043 {
8045 }
8046 }
8047 }
8048
8049
8051 {
8052 super.OnRightClick();
8053
8055 {
8057 {
8058 if (ScriptInputUserData.CanStoreInputUserData())
8059 {
8060 vector m4[4];
8062
8063 EntityAI root = GetHierarchyRoot();
8064
8065 InventoryLocation dst = new InventoryLocation;
8067 {
8068 if (root)
8069 {
8070 root.GetTransform(m4);
8072 }
8073 else
8074 GetInventory().GetCurrentInventoryLocation(dst);
8075 }
8076 else
8077 {
8079
8080
8081 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8082 {
8083 if (root)
8084 {
8085 root.GetTransform(m4);
8087 }
8088 else
8089 GetInventory().GetCurrentInventoryLocation(dst);
8090 }
8091 else
8092 {
8093 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8094 }
8095 }
8096
8097 ScriptInputUserData ctx = new ScriptInputUserData;
8105 }
8106 }
8107 else if (!
GetGame().IsMultiplayer())
8108 {
8110 }
8111 }
8112 }
8113
8114 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8115 {
8116
8117 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8118 return false;
8119
8120 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8121 return false;
8122
8123
8125 return false;
8126
8127
8128 Magazine mag = Magazine.Cast(this);
8129 if (mag)
8130 {
8131 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8132 return false;
8133
8134 if (stack_max_limit)
8135 {
8136 Magazine other_mag = Magazine.Cast(other_item);
8137 if (other_item)
8138 {
8139 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8140 return false;
8141 }
8142
8143 }
8144 }
8145 else
8146 {
8147
8149 return false;
8150
8152 return false;
8153 }
8154
8155 PlayerBase player = null;
8156 if (CastTo(player, GetHierarchyRootPlayer()))
8157 {
8158 if (player.GetInventory().HasAttachment(this))
8159 return false;
8160
8161 if (player.IsItemsToDelete())
8162 return false;
8163 }
8164
8165 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8166 return false;
8167
8168 int slotID;
8170 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8171 return false;
8172
8173 return true;
8174 }
8175
8177 {
8179 }
8180
8182 {
8183 return m_IsResultOfSplit;
8184 }
8185
8187 {
8188 m_IsResultOfSplit = value;
8189 }
8190
8192 {
8194 }
8195
8197 {
8198 float other_item_quantity = other_item.GetQuantity();
8199 float this_free_space;
8200
8202
8204
8205 if (other_item_quantity > this_free_space)
8206 {
8207 return this_free_space;
8208 }
8209 else
8210 {
8211 return other_item_quantity;
8212 }
8213 }
8214
8216 {
8218 }
8219
8221 {
8223 return;
8224
8225 if (!IsMagazine() && other_item)
8226 {
8228 if (quantity_used != 0)
8229 {
8230 float hp1 = GetHealth01("","");
8231 float hp2 = other_item.GetHealth01("","");
8232 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8233 hpResult = hpResult / (
GetQuantity() + quantity_used);
8234
8235 hpResult *= GetMaxHealth();
8236 Math.Round(hpResult);
8237 SetHealth("", "Health", hpResult);
8238
8240 other_item.AddQuantity(-quantity_used);
8241 }
8242 }
8244 }
8245
8247 {
8248 #ifdef SERVER
8249 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8250 GetHierarchyParent().IncreaseLifetimeUp();
8251 #endif
8252 };
8253
8255 {
8256 PlayerBase p = PlayerBase.Cast(player);
8257
8258 array<int> recipesIds = p.m_Recipes;
8259 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8260 if (moduleRecipesManager)
8261 {
8262 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8263 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8264 }
8265
8266 for (int i = 0;i < recipesIds.Count(); i++)
8267 {
8268 int key = recipesIds.Get(i);
8269 string recipeName = moduleRecipesManager.GetRecipeName(key);
8271 }
8272 }
8273
8274
8275 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8276 {
8277 super.GetDebugActions(outputList);
8278
8279
8284
8285
8289
8293
8294
8297
8298
8300 {
8303 }
8304
8306
8309
8313 }
8314
8315
8316
8317
8319 {
8320 super.OnAction(action_id, player, ctx);
8321 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8322 {
8323 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8324 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8325 PlayerBase p = PlayerBase.Cast(player);
8326 if (
EActions.RECIPES_RANGE_START < 1000)
8327 {
8328 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8329 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8330 }
8331 }
8332 #ifndef SERVER
8333 else if (action_id ==
EActions.WATCH_PLAYER)
8334 {
8335 PluginDeveloper.SetDeveloperItemClientEx(player);
8336 }
8337 #endif
8339 {
8340 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8341 {
8342 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8343 OnDebugButtonPressServer(id + 1);
8344 }
8345
8346 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8347 {
8348 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8350 }
8351
8352 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8353 {
8354 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8356 }
8357
8358 else if (action_id ==
EActions.ADD_QUANTITY)
8359 {
8360 if (IsMagazine())
8361 {
8362 Magazine mag = Magazine.Cast(this);
8363 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8364 }
8365 else
8366 {
8368 }
8369
8370 if (m_EM)
8371 {
8372 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8373 }
8374
8375 }
8376
8377 else if (action_id ==
EActions.REMOVE_QUANTITY)
8378 {
8379 if (IsMagazine())
8380 {
8381 Magazine mag2 = Magazine.Cast(this);
8382 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8383 }
8384 else
8385 {
8387 }
8388 if (m_EM)
8389 {
8390 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8391 }
8392
8393 }
8394
8395 else if (action_id ==
EActions.SET_QUANTITY_0)
8396 {
8398
8399 if (m_EM)
8400 {
8401 m_EM.SetEnergy(0);
8402 }
8403 }
8404
8405 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8406 {
8408
8409 if (m_EM)
8410 {
8411 m_EM.SetEnergy(m_EM.GetEnergyMax());
8412 }
8413 }
8414
8415 else if (action_id ==
EActions.ADD_HEALTH)
8416 {
8417 AddHealth("","",GetMaxHealth("","Health")/5);
8418 }
8419 else if (action_id ==
EActions.REMOVE_HEALTH)
8420 {
8421 AddHealth("","",-GetMaxHealth("","Health")/5);
8422 }
8423 else if (action_id ==
EActions.DESTROY_HEALTH)
8424 {
8425 SetHealth01("","",0);
8426 }
8427 else if (action_id ==
EActions.WATCH_ITEM)
8428 {
8430 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8431 #ifdef DEVELOPER
8432 SetDebugDeveloper_item(this);
8433 #endif
8434 }
8435
8436 else if (action_id ==
EActions.ADD_TEMPERATURE)
8437 {
8438 AddTemperature(20);
8439
8440 }
8441
8442 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8443 {
8444 AddTemperature(-20);
8445
8446 }
8447
8448 else if (action_id ==
EActions.FLIP_FROZEN)
8449 {
8450 SetFrozen(!GetIsFrozen());
8451
8452 }
8453
8454 else if (action_id ==
EActions.ADD_WETNESS)
8455 {
8457
8458 }
8459
8460 else if (action_id ==
EActions.REMOVE_WETNESS)
8461 {
8463
8464 }
8465
8466 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8467 {
8470
8471
8472 }
8473
8474 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8475 {
8478 }
8479
8480 else if (action_id ==
EActions.MAKE_SPECIAL)
8481 {
8482 auto debugParams = DebugSpawnParams.WithPlayer(player);
8483 OnDebugSpawnEx(debugParams);
8484 }
8485
8486 else if (action_id ==
EActions.DELETE)
8487 {
8488 Delete();
8489 }
8490
8491 }
8492
8493
8494 return false;
8495 }
8496
8497
8498
8499
8503
8506
8507
8508
8510 {
8511 return false;
8512 }
8513
8514
8516 {
8517 return true;
8518 }
8519
8520
8522 {
8523 return true;
8524 }
8525
8526
8527
8529 {
8530 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8532 }
8533
8536 {
8537 return null;
8538 }
8539
8541 {
8542 return false;
8543 }
8544
8546 {
8547 return false;
8548 }
8549
8553
8554
8556 {
8557 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8558 return module_repairing.CanRepair(this, item_repair_kit);
8559 }
8560
8561
8562 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8563 {
8564 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8565 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8566 }
8567
8568
8570 {
8571
8572
8573
8574
8575
8576
8577
8578
8579 return 1;
8580 }
8581
8582
8583
8585 {
8587 }
8588
8589
8590
8592 {
8594 }
8595
8596
8605 {
8606 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8607
8608 if (player)
8609 {
8610 player.MessageStatus(text);
8611 }
8612 }
8613
8614
8623 {
8624 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8625
8626 if (player)
8627 {
8628 player.MessageAction(text);
8629 }
8630 }
8631
8632
8641 {
8642 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8643
8644 if (player)
8645 {
8646 player.MessageFriendly(text);
8647 }
8648 }
8649
8650
8659 {
8660 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8661
8662 if (player)
8663 {
8664 player.MessageImportant(text);
8665 }
8666 }
8667
8669 {
8670 return true;
8671 }
8672
8673
8674 override bool KindOf(
string tag)
8675 {
8676 bool found = false;
8677 string item_name = this.
GetType();
8680
8681 int array_size = item_tag_array.Count();
8682 for (int i = 0; i < array_size; i++)
8683 {
8684 if (item_tag_array.Get(i) == tag)
8685 {
8686 found = true;
8687 break;
8688 }
8689 }
8690 return found;
8691 }
8692
8693
8695 {
8696
8697 super.OnRPC(sender, rpc_type,ctx);
8698
8699
8700 switch (rpc_type)
8701 {
8702 #ifndef SERVER
8703 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8704 Param2<bool, string> p = new Param2<bool, string>(false, "");
8705
8707 return;
8708
8709 bool play = p.param1;
8710 string soundSet = p.param2;
8711
8712 if (play)
8713 {
8715 {
8717 {
8719 }
8720 }
8721 else
8722 {
8724 }
8725 }
8726 else
8727 {
8729 }
8730
8731 break;
8732 #endif
8733
8734 }
8735
8737 {
8739 }
8740 }
8741
8742
8743
8744
8746 {
8747 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8748 return plugin.GetID(
name);
8749 }
8750
8752 {
8753 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8754 return plugin.GetName(id);
8755 }
8756
8759 {
8760
8761
8762 int varFlags;
8763 if (!ctx.
Read(varFlags))
8764 return;
8765
8766 if (varFlags & ItemVariableFlags.FLOAT)
8767 {
8769 }
8770 }
8771
8773 {
8774
8775 super.SerializeNumericalVars(floats_out);
8776
8777
8778
8780 {
8782 }
8783
8785 {
8787 }
8788
8790 {
8792 }
8793
8795 {
8800 }
8801
8803 {
8805 }
8806 }
8807
8809 {
8810
8811 super.DeSerializeNumericalVars(floats);
8812
8813
8814 int index = 0;
8815 int mask = Math.Round(floats.Get(index));
8816
8817 index++;
8818
8820 {
8822 {
8824 }
8825 else
8826 {
8827 float quantity = floats.Get(index);
8829 }
8830 index++;
8831 }
8832
8834 {
8835 float wet = floats.Get(index);
8837 index++;
8838 }
8839
8841 {
8842 int liquidtype = Math.Round(floats.Get(index));
8844 index++;
8845 }
8846
8848 {
8850 index++;
8852 index++;
8854 index++;
8856 index++;
8857 }
8858
8860 {
8861 int cleanness = Math.Round(floats.Get(index));
8863 index++;
8864 }
8865 }
8866
8868 {
8869 super.WriteVarsToCTX(ctx);
8870
8871
8873 {
8875 }
8876
8878 {
8880 }
8881
8883 {
8885 }
8886
8888 {
8889 int r,g,b,a;
8895 }
8896
8898 {
8900 }
8901 }
8902
8904 {
8905 if (!super.ReadVarsFromCTX(ctx,version))
8906 return false;
8907
8908 int intValue;
8909 float value;
8910
8911 if (version < 140)
8912 {
8913 if (!ctx.
Read(intValue))
8914 return false;
8915
8916 m_VariablesMask = intValue;
8917 }
8918
8920 {
8921 if (!ctx.
Read(value))
8922 return false;
8923
8925 {
8927 }
8928 else
8929 {
8931 }
8932 }
8933
8934 if (version < 140)
8935 {
8937 {
8938 if (!ctx.
Read(value))
8939 return false;
8940 SetTemperatureDirect(value);
8941 }
8942 }
8943
8945 {
8946 if (!ctx.
Read(value))
8947 return false;
8949 }
8950
8952 {
8953 if (!ctx.
Read(intValue))
8954 return false;
8956 }
8957
8959 {
8960 int r,g,b,a;
8962 return false;
8964 return false;
8966 return false;
8968 return false;
8969
8971 }
8972
8974 {
8975 if (!ctx.
Read(intValue))
8976 return false;
8978 }
8979
8980 if (version >= 138 && version < 140)
8981 {
8983 {
8984 if (!ctx.
Read(intValue))
8985 return false;
8986 SetFrozen(intValue);
8987 }
8988 }
8989
8990 return true;
8991 }
8992
8993
8995 {
8998 {
9000 }
9001
9002 if (!super.OnStoreLoad(ctx, version))
9003 {
9005 return false;
9006 }
9007
9008 if (version >= 114)
9009 {
9010 bool hasQuickBarIndexSaved;
9011
9012 if (!ctx.
Read(hasQuickBarIndexSaved))
9013 {
9015 return false;
9016 }
9017
9018 if (hasQuickBarIndexSaved)
9019 {
9020 int itmQBIndex;
9021
9022
9023 if (!ctx.
Read(itmQBIndex))
9024 {
9026 return false;
9027 }
9028
9029 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9030 if (itmQBIndex != -1 && parentPlayer)
9031 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9032 }
9033 }
9034 else
9035 {
9036
9037 PlayerBase player;
9038 int itemQBIndex;
9039 if (version ==
int.
MAX)
9040 {
9041 if (!ctx.
Read(itemQBIndex))
9042 {
9044 return false;
9045 }
9046 }
9047 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9048 {
9049
9050 if (!ctx.
Read(itemQBIndex))
9051 {
9053 return false;
9054 }
9055 if (itemQBIndex != -1 && player)
9056 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9057 }
9058 }
9059
9060 if (version < 140)
9061 {
9062
9063 if (!LoadVariables(ctx, version))
9064 {
9066 return false;
9067 }
9068 }
9069
9070
9072 {
9074 return false;
9075 }
9076 if (version >= 132)
9077 {
9079 if (raib)
9080 {
9082 {
9084 return false;
9085 }
9086 }
9087 }
9088
9090 return true;
9091 }
9092
9093
9094
9096 {
9097 super.OnStoreSave(ctx);
9098
9099 PlayerBase player;
9100 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9101 {
9103
9104 int itemQBIndex = -1;
9105 itemQBIndex = player.FindQuickBarEntityIndex(this);
9106 ctx.
Write(itemQBIndex);
9107 }
9108 else
9109 {
9111 }
9112
9114
9116 if (raib)
9117 {
9119 }
9120 }
9121
9122
9124 {
9125 super.AfterStoreLoad();
9126
9128 {
9130 }
9131
9133 {
9136 }
9137 }
9138
9140 {
9141 super.EEOnAfterLoad();
9142
9144 {
9146 }
9147
9150 }
9151
9153 {
9154 return false;
9155 }
9156
9157
9158
9160 {
9162 {
9163 #ifdef PLATFORM_CONSOLE
9164
9166 {
9168 if (menu)
9169 {
9171 }
9172 }
9173 #endif
9174 }
9175
9177 {
9180 }
9181
9183 {
9184 SetWeightDirty();
9186 }
9188 {
9191 }
9192
9194 {
9197 }
9199 {
9202 }
9203
9204 super.OnVariablesSynchronized();
9205 }
9206
9207
9208
9210 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9211 {
9212 if (!IsServerCheck(allow_client))
9213 return false;
9214
9216 return false;
9217
9220
9221 if (value <= (min + 0.001))
9222 value = min;
9223
9224 if (value == min)
9225 {
9226 if (destroy_config)
9227 {
9228 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9229 if (dstr)
9230 {
9232 this.Delete();
9233 return true;
9234 }
9235 }
9236 else if (destroy_forced)
9237 {
9239 this.Delete();
9240 return true;
9241 }
9242
9244 }
9245
9248
9250 {
9252
9253 if (delta)
9255 }
9256
9258
9259 return false;
9260 }
9261
9262
9264 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9265 {
9267 }
9268
9270 {
9273 }
9274
9276 {
9279 }
9280
9283 {
9284 float value_clamped = Math.Clamp(value, 0, 1);
9286 SetQuantity(result, destroy_config, destroy_forced);
9287 }
9288
9289
9292 {
9294 }
9295
9297 {
9299 }
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9311 {
9312 int slot = -1;
9313 if (GetInventory())
9314 {
9315 InventoryLocation il = new InventoryLocation;
9316 GetInventory().GetCurrentInventoryLocation(il);
9318 }
9319
9321 }
9322
9324 {
9325 float quantity_max = 0;
9326
9328 {
9329 if (attSlotID != -1)
9330 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9331
9332 if (quantity_max <= 0)
9334 }
9335
9336 if (quantity_max <= 0)
9338
9339 return quantity_max;
9340 }
9341
9343 {
9345 }
9346
9348 {
9350 }
9351
9352
9354 {
9356 }
9357
9359 {
9361 }
9362
9364 {
9366 }
9367
9368
9370 {
9371
9372 float weightEx = GetWeightEx();
9373 float special = GetInventoryAndCargoWeight();
9374 return weightEx - special;
9375 }
9376
9377
9379 {
9381 }
9382
9384 {
9386 {
9387 #ifdef DEVELOPER
9388 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9389 {
9390 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9392 }
9393 #endif
9394
9396 }
9397 else if (HasEnergyManager())
9398 {
9399 #ifdef DEVELOPER
9400 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9401 {
9402 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9403 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9404 }
9405 #endif
9406 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9407 }
9408 else
9409 {
9410 #ifdef DEVELOPER
9411 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9412 {
9413 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9414 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9415 }
9416 #endif
9417 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9418 }
9419 }
9420
9423 {
9424 int item_count = 0;
9426
9427 if (GetInventory().GetCargo() != NULL)
9428 {
9429 item_count = GetInventory().GetCargo().GetItemCount();
9430 }
9431
9432 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9433 {
9434 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9435 if (item)
9436 item_count += item.GetNumberOfItems();
9437 }
9438 return item_count;
9439 }
9440
9443 {
9444 float weight = 0;
9445 float wetness = 1;
9446 if (include_wetness)
9449 {
9450 weight = wetness * m_ConfigWeight;
9451 }
9453 {
9454 weight = 1;
9455 }
9456 return weight;
9457 }
9458
9459
9460
9462 {
9463 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9464 {
9465 GameInventory inv = GetInventory();
9466 array<EntityAI> items = new array<EntityAI>;
9468 for (int i = 0; i < items.Count(); i++)
9469 {
9471 if (item)
9472 {
9474 }
9475 }
9476 }
9477 }
9478
9479
9480
9481
9483 {
9484 float energy = 0;
9485 if (HasEnergyManager())
9486 {
9487 energy = GetCompEM().GetEnergy();
9488 }
9489 return energy;
9490 }
9491
9492
9494 {
9495 super.OnEnergyConsumed();
9496
9498 }
9499
9501 {
9502 super.OnEnergyAdded();
9503
9505 }
9506
9507
9509 {
9510 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9511 {
9513 {
9514 float energy_0to1 = GetCompEM().GetEnergy0To1();
9516 }
9517 }
9518 }
9519
9520
9522 {
9523 return ConfigGetFloat("heatIsolation");
9524 }
9525
9527 {
9529 }
9530
9532 {
9533 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9534 if (
GetGame().ConfigIsExisting(paramPath))
9536
9537 return 0.0;
9538 }
9539
9541 {
9542 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9543 if (
GetGame().ConfigIsExisting(paramPath))
9545
9546 return 0.0;
9547 }
9548
9549 override void SetWet(
float value,
bool allow_client =
false)
9550 {
9551 if (!IsServerCheck(allow_client))
9552 return;
9553
9556
9558
9559 m_VarWet = Math.Clamp(value, min, max);
9560
9562 {
9565 }
9566 }
9567
9568 override void AddWet(
float value)
9569 {
9571 }
9572
9574 {
9576 }
9577
9579 {
9581 }
9582
9584 {
9586 }
9587
9589 {
9591 }
9592
9594 {
9596 }
9597
9599 {
9602 if (newLevel != oldLevel)
9603 {
9605 }
9606 }
9607
9609 {
9610 SetWeightDirty();
9611 }
9612
9614 {
9615 return GetWetLevelInternal(
m_VarWet);
9616 }
9617
9618
9619
9621 {
9623 }
9624
9626 {
9628 }
9629
9631 {
9633 }
9634
9636 {
9638 }
9639
9640
9641
9643 {
9644 if (ConfigIsExisting("itemModelLength"))
9645 {
9646 return ConfigGetFloat("itemModelLength");
9647 }
9648 return 0;
9649 }
9650
9652 {
9653 if (ConfigIsExisting("itemAttachOffset"))
9654 {
9655 return ConfigGetFloat("itemAttachOffset");
9656 }
9657 return 0;
9658 }
9659
9660 override void SetCleanness(
int value,
bool allow_client =
false)
9661 {
9662 if (!IsServerCheck(allow_client))
9663 return;
9664
9666
9668
9671 }
9672
9674 {
9676 }
9677
9679 {
9680 return true;
9681 }
9682
9683
9684
9685
9687 {
9689 }
9690
9692 {
9694 }
9695
9696
9697
9698
9699 override void SetColor(
int r,
int g,
int b,
int a)
9700 {
9706 }
9708 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9709 {
9714 }
9715
9717 {
9719 }
9720
9723 {
9724 int r,g,b,a;
9726 r = r/255;
9727 g = g/255;
9728 b = b/255;
9729 a = a/255;
9730 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9731 }
9732
9733
9734
9735 override void SetLiquidType(
int value,
bool allow_client =
false)
9736 {
9737 if (!IsServerCheck(allow_client))
9738 return;
9739
9744 }
9745
9747 {
9748 return ConfigGetInt("varLiquidTypeInit");
9749 }
9750
9752 {
9754 }
9755
9757 {
9759 SetFrozen(false);
9760 }
9761
9764 {
9765 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9766 }
9767
9768
9771 {
9772 PlayerBase nplayer;
9773 if (PlayerBase.CastTo(nplayer, player))
9774 {
9776
9777 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9778 }
9779 }
9780
9781
9784 {
9785 PlayerBase nplayer;
9786 if (PlayerBase.CastTo(nplayer,player))
9787 {
9788
9789 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9790
9791 }
9792
9793
9794 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9795
9796
9797 if (HasEnergyManager())
9798 {
9799 GetCompEM().UpdatePlugState();
9800 }
9801 }
9802
9803
9805 {
9806 super.OnPlacementStarted(player);
9807
9809 }
9810
9811 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9812 {
9814 {
9815 m_AdminLog.OnPlacementComplete(player,
this);
9816 }
9817
9818 super.OnPlacementComplete(player, position, orientation);
9819 }
9820
9821
9822
9823
9824
9826 {
9828 {
9829 return true;
9830 }
9831 else
9832 {
9833 return false;
9834 }
9835 }
9836
9837
9839 {
9841 {
9843 }
9844 }
9845
9846
9848 {
9850 }
9851
9853 {
9855 }
9856
9857 override void InsertAgent(
int agent,
float count = 1)
9858 {
9859 if (count < 1)
9860 return;
9861
9863 }
9864
9867 {
9869 }
9870
9871
9873 {
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
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9919 {
9921 return false;
9922 return true;
9923 }
9924
9926 {
9927
9929 }
9930
9931
9934 {
9935 super.CheckForRoofLimited(timeTresholdMS);
9936
9938 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9939 {
9940 m_PreviousRoofTestTime = time;
9941 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9942 }
9943 }
9944
9945
9947 {
9949 {
9950 return 0;
9951 }
9952
9953 if (GetInventory().GetAttachmentSlotsCount() != 0)
9954 {
9955 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9956 if (filter)
9957 return filter.GetProtectionLevel(type, false, system);
9958 else
9959 return 0;
9960 }
9961
9962 string subclassPath, entryName;
9963
9964 switch (type)
9965 {
9967 entryName = "biological";
9968 break;
9970 entryName = "chemical";
9971 break;
9972 default:
9973 entryName = "biological";
9974 break;
9975 }
9976
9977 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9978
9980 }
9981
9982
9983
9986 {
9987 if (!IsMagazine())
9989
9991 }
9992
9993
9994
9995
9996
10001 {
10002 return true;
10003 }
10004
10006 {
10008 }
10009
10010
10011
10012
10013
10015 {
10016 if (parent)
10017 {
10018 if (parent.IsInherited(DayZInfected))
10019 return true;
10020
10021 if (!parent.IsRuined())
10022 return true;
10023 }
10024
10025 return true;
10026 }
10027
10029 {
10030 if (!super.CanPutAsAttachment(parent))
10031 {
10032 return false;
10033 }
10034
10035 if (!IsRuined() && !parent.IsRuined())
10036 {
10037 return true;
10038 }
10039
10040 return false;
10041 }
10042
10044 {
10045
10046
10047
10048
10049 return super.CanReceiveItemIntoCargo(item);
10050 }
10051
10053 {
10054
10055
10056
10057
10058 GameInventory attachmentInv = attachment.GetInventory();
10060 {
10061 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10062 return false;
10063 }
10064
10065 InventoryLocation loc = new InventoryLocation();
10066 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10067 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10068 return false;
10069
10070 return super.CanReceiveAttachment(attachment, slotId);
10071 }
10072
10074 {
10075 if (!super.CanReleaseAttachment(attachment))
10076 return false;
10077
10078 return GetInventory().AreChildrenAccessible();
10079 }
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10102 {
10103 int id = muzzle_owner.GetMuzzleID();
10104 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10105
10106 if (WPOF_array)
10107 {
10108 for (int i = 0; i < WPOF_array.Count(); i++)
10109 {
10110 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10111
10112 if (WPOF)
10113 {
10114 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10115 }
10116 }
10117 }
10118 }
10119
10120
10122 {
10123 int id = muzzle_owner.GetMuzzleID();
10125
10126 if (WPOBE_array)
10127 {
10128 for (int i = 0; i < WPOBE_array.Count(); i++)
10129 {
10130 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10131
10132 if (WPOBE)
10133 {
10134 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10135 }
10136 }
10137 }
10138 }
10139
10140
10142 {
10143 int id = muzzle_owner.GetMuzzleID();
10144 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10145
10146 if (WPOOH_array)
10147 {
10148 for (int i = 0; i < WPOOH_array.Count(); i++)
10149 {
10150 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10151
10152 if (WPOOH)
10153 {
10154 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10155 }
10156 }
10157 }
10158 }
10159
10160
10162 {
10163 int id = muzzle_owner.GetMuzzleID();
10164 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10165
10166 if (WPOOH_array)
10167 {
10168 for (int i = 0; i < WPOOH_array.Count(); i++)
10169 {
10170 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10171
10172 if (WPOOH)
10173 {
10174 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10175 }
10176 }
10177 }
10178 }
10179
10180
10182 {
10183 int id = muzzle_owner.GetMuzzleID();
10184 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10185
10186 if (WPOOH_array)
10187 {
10188 for (int i = 0; i < WPOOH_array.Count(); i++)
10189 {
10190 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10191
10192 if (WPOOH)
10193 {
10194 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10195 }
10196 }
10197 }
10198 }
10199
10200
10201
10203 {
10205 {
10206 return true;
10207 }
10208
10209 return false;
10210 }
10211
10213 {
10215 {
10216 return true;
10217 }
10218
10219 return false;
10220 }
10221
10223 {
10225 {
10226 return true;
10227 }
10228
10229 return false;
10230 }
10231
10233 {
10234 return false;
10235 }
10236
10239 {
10240 return UATimeSpent.DEFAULT_DEPLOY;
10241 }
10242
10243
10244
10245
10247 {
10249 SetSynchDirty();
10250 }
10251
10253 {
10255 }
10256
10257
10259 {
10260 return false;
10261 }
10262
10265 {
10266 string att_type = "None";
10267
10268 if (ConfigIsExisting("soundAttType"))
10269 {
10270 att_type = ConfigGetString("soundAttType");
10271 }
10272
10274 }
10275
10277 {
10279 }
10280
10281
10282
10283
10284
10288
10290 {
10293
10295 }
10296
10297
10299 {
10301 return;
10302
10304
10307
10310
10311 SoundParameters params = new SoundParameters();
10315 }
10316
10317
10319 {
10321 return;
10322
10324 SetSynchDirty();
10325
10328 }
10329
10330
10332 {
10334 return;
10335
10337 SetSynchDirty();
10338
10341 }
10342
10344 {
10346 }
10347
10349 {
10351 }
10352
10355 {
10356 if (!
GetGame().IsDedicatedServer())
10357 {
10358 if (ConfigIsExisting("attachSoundSet"))
10359 {
10360 string cfg_path = "";
10361 string soundset = "";
10362 string type_name =
GetType();
10363
10366 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10367 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10368
10369 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10370 {
10371 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10372 {
10373 if (cfg_slot_array[i] == slot_type)
10374 {
10375 soundset = cfg_soundset_array[i];
10376 break;
10377 }
10378 }
10379 }
10380
10381 if (soundset != "")
10382 {
10383 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10385 }
10386 }
10387 }
10388 }
10389
10391 {
10392
10393 }
10394
10395 void OnApply(PlayerBase player);
10396
10398 {
10399 return 1.0;
10400 };
10401
10403 {
10405 }
10406
10408 {
10410 }
10411
10413
10415 {
10416 SetDynamicPhysicsLifeTime(0.01);
10418 }
10419
10421 {
10422 array<string> zone_names = new array<string>;
10423 GetDamageZones(zone_names);
10424 for (int i = 0; i < zone_names.Count(); i++)
10425 {
10426 SetHealthMax(zone_names.Get(i),"Health");
10427 }
10428 SetHealthMax("","Health");
10429 }
10430
10433 {
10434 float global_health = GetHealth01("","Health");
10435 array<string> zones = new array<string>;
10436 GetDamageZones(zones);
10437
10438 for (int i = 0; i < zones.Count(); i++)
10439 {
10440 SetHealth01(zones.Get(i),"Health",global_health);
10441 }
10442 }
10443
10446 {
10447 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10448 }
10449
10451 {
10452 if (!hasRootAsPlayer)
10453 {
10454 if (refParentIB)
10455 {
10456
10457 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10458 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10459
10460 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10461 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10462
10465 }
10466 else
10467 {
10468
10471 }
10472 }
10473 }
10474
10476 {
10478 {
10479 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10480 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10481 {
10482 float heatPermCoef = 1.0;
10484 while (ent)
10485 {
10486 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10487 ent = ent.GetHierarchyParent();
10488 }
10489
10490 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10491 }
10492 }
10493 }
10494
10496 {
10497
10498 EntityAI parent = GetHierarchyParent();
10499 if (!parent)
10500 {
10501 hasParent = false;
10502 hasRootAsPlayer = false;
10503 }
10504 else
10505 {
10506 hasParent = true;
10507 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10508 refParentIB =
ItemBase.Cast(parent);
10509 }
10510 }
10511
10512 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10513 {
10514
10515 }
10516
10518 {
10519
10520 return false;
10521 }
10522
10524 {
10525
10526
10527 return false;
10528 }
10529
10531 {
10532
10533 return false;
10534 }
10535
10538 {
10539 return !GetIsFrozen() &&
IsOpen();
10540 }
10541
10543 {
10544 bool hasParent = false, hasRootAsPlayer = false;
10546
10547 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10548 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10549
10550 if (wwtu || foodDecay)
10551 {
10555
10556 if (processWetness || processTemperature || processDecay)
10557 {
10559
10560 if (processWetness)
10561 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10562
10563 if (processTemperature)
10565
10566 if (processDecay)
10567 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10568 }
10569 }
10570 }
10571
10574 {
10576 }
10577
10579 {
10582
10583 return super.GetTemperatureFreezeThreshold();
10584 }
10585
10587 {
10590
10591 return super.GetTemperatureThawThreshold();
10592 }
10593
10595 {
10598
10599 return super.GetItemOverheatThreshold();
10600 }
10601
10603 {
10605 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10606
10607 return super.GetTemperatureFreezeTime();
10608 }
10609
10611 {
10613 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10614
10615 return super.GetTemperatureThawTime();
10616 }
10617
10622
10624 {
10625 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10626 }
10627
10629 {
10630 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10631 }
10632
10635 {
10637 }
10638
10640 {
10642 }
10643
10645 {
10647 }
10648
10651 {
10652 return null;
10653 }
10654
10657 {
10658 return false;
10659 }
10660
10662 {
10664 {
10667 if (!trg)
10668 {
10670 explosive = this;
10671 }
10672
10673 explosive.PairRemote(trg);
10675
10676 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10677 trg.SetPersistentPairID(persistentID);
10678 explosive.SetPersistentPairID(persistentID);
10679
10680 return true;
10681 }
10682 return false;
10683 }
10684
10687 {
10688 float ret = 1.0;
10691 ret *= GetHealth01();
10692
10693 return ret;
10694 }
10695
10696 #ifdef DEVELOPER
10697 override void SetDebugItem()
10698 {
10699 super.SetDebugItem();
10700 _itemBase = this;
10701 }
10702
10704 {
10705 string text = super.GetDebugText();
10706
10708 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10709
10710 return text;
10711 }
10712 #endif
10713
10715 {
10716 return true;
10717 }
10718
10720
10722
10724 {
10727 }
10728
10729
10737
10753}
10754
10756{
10758 if (entity)
10759 {
10760 bool is_item = entity.IsInherited(
ItemBase);
10761 if (is_item && full_quantity)
10762 {
10765 }
10766 }
10767 else
10768 {
10770 return NULL;
10771 }
10772 return entity;
10773}
10774
10776{
10777 if (item)
10778 {
10779 if (health > 0)
10780 item.SetHealth("", "", health);
10781
10782 if (item.CanHaveTemperature())
10783 {
10785 if (item.CanFreeze())
10786 item.SetFrozen(false);
10787 }
10788
10789 if (item.HasEnergyManager())
10790 {
10791 if (quantity >= 0)
10792 {
10793 item.GetCompEM().SetEnergy0To1(quantity);
10794 }
10795 else
10796 {
10798 }
10799 }
10800 else if (item.IsMagazine())
10801 {
10802 Magazine mag = Magazine.Cast(item);
10803 if (quantity >= 0)
10804 {
10805 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10806 }
10807 else
10808 {
10810 }
10811
10812 }
10813 else
10814 {
10815 if (quantity >= 0)
10816 {
10817 item.SetQuantityNormalized(quantity, false);
10818 }
10819 else
10820 {
10822 }
10823
10824 }
10825 }
10826}
10827
10828#ifdef DEVELOPER
10830#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.