6234{
6236 {
6237 return true;
6238 }
6239};
6240
6241
6242
6244{
6248
6250
6253
6254
6255
6256
6257
6266
6272
6277
6282
6303 protected bool m_IsResultOfSplit
6304
6306
6311
6312
6313
6315
6319
6320
6321
6323
6326
6327
6328
6334
6335
6343
6346
6347
6349
6350
6352
6353
6358
6359
6364
6365
6367
6368
6370 {
6375
6376 if (!
GetGame().IsDedicatedServer())
6377 {
6379 {
6381
6383 {
6385 }
6386 }
6387
6390 }
6391
6392 m_OldLocation = null;
6393
6395 {
6397 }
6398
6399 if (ConfigIsExisting("headSelectionsToHide"))
6400 {
6403 }
6404
6406 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6407 {
6409 }
6410
6412
6413 m_IsResultOfSplit = false;
6414
6416 }
6417
6419 {
6420 super.InitItemVariables();
6421
6427 m_Count = ConfigGetInt(
"count");
6428
6431
6436
6439
6444
6456
6460
6461
6464 if (ConfigIsExisting("canBeSplit"))
6465 {
6468 }
6469
6471 if (ConfigIsExisting("itemBehaviour"))
6473
6474
6477 RegisterNetSyncVariableInt("m_VarLiquidType");
6478 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6479
6480 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6481 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6482 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6483
6484 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6485 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6486 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6487 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6488
6489 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6490 RegisterNetSyncVariableBool("m_IsTakeable");
6491 RegisterNetSyncVariableBool("m_IsHologram");
6492
6495 {
6498 }
6499
6501
6503 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6505
6506 }
6507
6509 {
6511 }
6512
6514 {
6517 {
6522 }
6523 }
6524
6525 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6526 {
6528 {
6531 }
6532
6534 }
6535
6537 {
6543 }
6544
6546
6548 {
6550
6551 if (!action)
6552 {
6553 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6554 return;
6555 }
6556
6558 if (!ai)
6559 {
6561 return;
6562 }
6563
6565 if (!action_array)
6566 {
6567 action_array = new array<ActionBase_Basic>;
6569 }
6570 if (LogManager.IsActionLogEnable())
6571 {
6572 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6573 }
6574
6575 if (action_array.Find(action) != -1)
6576 {
6577 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6578 }
6579 else
6580 {
6581 action_array.Insert(action);
6582 }
6583 }
6584
6586 {
6588 ActionBase action = player.GetActionManager().GetAction(actionName);
6591
6592 if (action_array)
6593 {
6594 action_array.RemoveItem(action);
6595 }
6596 }
6597
6598
6599
6601 {
6602 ActionOverrideData overrideData = new ActionOverrideData();
6606
6608 if (!actionMap)
6609 {
6612 }
6613
6614 actionMap.Insert(this.
Type(), overrideData);
6615
6616 }
6617
6619
6621
6622
6624 {
6627
6630
6631 string config_to_search = "CfgVehicles";
6632 string muzzle_owner_config;
6633
6635 {
6636 if (IsInherited(Weapon))
6637 config_to_search = "CfgWeapons";
6638
6639 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6640
6641 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6642
6644
6645 if (config_OnFire_subclass_count > 0)
6646 {
6647 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6648
6649 for (int i = 0; i < config_OnFire_subclass_count; i++)
6650 {
6651 string particle_class = "";
6653 string config_OnFire_entry = config_OnFire_class + particle_class;
6654 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6655 WPOF_array.Insert(WPOF);
6656 }
6657
6658
6660 }
6661 }
6662
6664 {
6665 config_to_search = "CfgWeapons";
6666 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6667
6668 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6669
6671
6672 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6673 {
6674 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6675
6676 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6677 {
6678 string particle_class2 = "";
6680 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6681 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6682 WPOBE_array.Insert(WPOBE);
6683 }
6684
6685
6687 }
6688 }
6689 }
6690
6691
6693 {
6696
6698 {
6699 string config_to_search = "CfgVehicles";
6700
6701 if (IsInherited(Weapon))
6702 config_to_search = "CfgWeapons";
6703
6704 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6705 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6706
6707 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6708 {
6709
6711
6713 {
6715 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6717 return;
6718 }
6719
6722
6723
6724
6726 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6727
6728 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6729 {
6730 string particle_class = "";
6732 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6734
6735 if (entry_type == CT_CLASS)
6736 {
6737 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6738 WPOOH_array.Insert(WPOF);
6739 }
6740 }
6741
6742
6744 }
6745 }
6746 }
6747
6749 {
6751 }
6752
6754 {
6756 {
6758
6761
6764
6765 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6766 }
6767 }
6768
6770 {
6772 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6773
6775 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6776
6778 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6779
6781 {
6783 }
6784 }
6785
6787 {
6789 }
6790
6792 {
6795 else
6797
6799 {
6802 }
6803 else
6804 {
6807
6810 }
6811
6813 }
6814
6816 {
6818 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6819 }
6820
6822 {
6824 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6826 }
6827
6829 {
6831 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6832 }
6833
6835 {
6838
6839 OverheatingParticle OP = new OverheatingParticle();
6844
6846 }
6847
6849 {
6852
6853 return -1;
6854 }
6855
6857 {
6859 {
6862
6863 for (int i = count; i > 0; --i)
6864 {
6865 int id = i - 1;
6868
6871
6872 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6873 {
6874 if (p)
6875 {
6878 }
6879 }
6880 }
6881 }
6882 }
6883
6885 {
6887 {
6889 {
6890 int id = i - 1;
6892
6893 if (OP)
6894 {
6896
6897 if (p)
6898 {
6900 }
6901
6902 delete OP;
6903 }
6904 }
6905
6908 }
6909 }
6910
6913 {
6914 return 0.0;
6915 }
6916
6917
6919 {
6920 return 250;
6921 }
6922
6924 {
6925 return 0;
6926 }
6927
6930 {
6932 return true;
6933
6934 return false;
6935 }
6936
6939 {
6942
6944 {
6946 }
6947 else
6948 {
6949
6951 }
6952
6954 }
6955
6962 {
6963 return -1;
6964 }
6965
6966
6967
6968
6970 {
6972 {
6974 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6975
6976 if (r_index >= 0)
6977 {
6978 InventoryLocation r_il = new InventoryLocation;
6979 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6980
6981 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6984 {
6985 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6986 }
6988 {
6989 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6990 }
6991
6992 }
6993
6994 player.GetHumanInventory().ClearUserReservedLocation(this);
6995 }
6996
6999 }
7000
7001
7002
7003
7005 {
7006 return ItemBase.m_DebugActionsMask;
7007 }
7008
7010 {
7011 return ItemBase.m_DebugActionsMask & mask;
7012 }
7013
7015 {
7016 ItemBase.m_DebugActionsMask = mask;
7017 }
7018
7020 {
7021 ItemBase.m_DebugActionsMask |= mask;
7022 }
7023
7025 {
7026 ItemBase.m_DebugActionsMask &= ~mask;
7027 }
7028
7030 {
7032 {
7034 }
7035 else
7036 {
7038 }
7039 }
7040
7041
7043 {
7044 if (GetEconomyProfile())
7045 {
7046 float q_max = GetEconomyProfile().GetQuantityMax();
7047 if (q_max > 0)
7048 {
7049 float q_min = GetEconomyProfile().GetQuantityMin();
7050 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7051
7053 {
7054 ComponentEnergyManager comp = GetCompEM();
7056 {
7058 }
7059 }
7061 {
7063
7064 }
7065
7066 }
7067 }
7068 }
7069
7072 {
7073 EntityAI parent = GetHierarchyParent();
7074
7075 if (parent)
7076 {
7077 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7078 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7079 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7080 }
7081 }
7082
7085 {
7086 EntityAI parent = GetHierarchyParent();
7087
7088 if (parent)
7089 {
7090 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7091 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7092 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7093 }
7094 }
7095
7097 {
7098
7099
7100
7101
7103
7105 {
7106 if (ScriptInputUserData.CanStoreInputUserData())
7107 {
7108 ScriptInputUserData ctx = new ScriptInputUserData;
7114 ctx.
Write(use_stack_max);
7117
7119 {
7120 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7121 }
7122 }
7123 }
7124 else if (!
GetGame().IsMultiplayer())
7125 {
7127 }
7128 }
7129
7131 {
7133 }
7134
7136 {
7138 }
7139
7141 {
7143 }
7144
7146 {
7147
7148 return false;
7149 }
7150
7152 {
7153 return false;
7154 }
7155
7159 {
7160 return false;
7161 }
7162
7164 {
7165 return "";
7166 }
7167
7169
7171 {
7172 return false;
7173 }
7174
7176 {
7177 return true;
7178 }
7179
7180
7181
7183 {
7184 return true;
7185 }
7186
7188 {
7189 return true;
7190 }
7191
7193 {
7194 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7196 }
7197
7199 {
7201 }
7202
7204 {
7206 if (!is_being_placed)
7208 SetSynchDirty();
7209 }
7210
7211
7213
7215 {
7217 }
7218
7220 {
7222 }
7223
7225 {
7226 return 1;
7227 }
7228
7230 {
7231 return false;
7232 }
7233
7235 {
7237 SetSynchDirty();
7238 }
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7275 {
7276 super.OnMovedInsideCargo(container);
7277
7278 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7279 }
7280
7281 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7282 {
7283 super.EEItemLocationChanged(oldLoc,newLoc);
7284
7285 PlayerBase new_player = null;
7286 PlayerBase old_player = null;
7287
7288 if (newLoc.GetParent())
7289 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7290
7291 if (oldLoc.GetParent())
7292 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7293
7295 {
7296 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7297
7298 if (r_index >= 0)
7299 {
7300 InventoryLocation r_il = new InventoryLocation;
7301 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7302
7303 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7306 {
7307 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7308 }
7310 {
7311 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7312 }
7313
7314 }
7315 }
7316
7318 {
7319 if (new_player)
7320 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7321
7322 if (new_player == old_player)
7323 {
7324
7325 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7326 {
7328 {
7329 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7330 {
7331 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7332 }
7333 }
7334 else
7335 {
7336 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7337 }
7338 }
7339
7340 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7341 {
7342 int type = oldLoc.GetType();
7344 {
7345 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7346 }
7348 {
7349 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7350 }
7351 }
7352 if (!m_OldLocation)
7353 {
7354 m_OldLocation = new InventoryLocation;
7355 }
7356 m_OldLocation.Copy(oldLoc);
7357 }
7358 else
7359 {
7360 if (m_OldLocation)
7361 {
7362 m_OldLocation.Reset();
7363 }
7364 }
7365
7367 }
7368 else
7369 {
7370 if (new_player)
7371 {
7372 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7373 if (res_index >= 0)
7374 {
7375 InventoryLocation il = new InventoryLocation;
7376 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7378 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7381 {
7382 il.
GetParent().GetOnReleaseLock().Invoke(it);
7383 }
7385 {
7387 }
7388
7389 }
7390 }
7392 {
7393
7395 }
7396
7397 if (m_OldLocation)
7398 {
7399 m_OldLocation.Reset();
7400 }
7401 }
7402 }
7403
7404 override void EOnContact(IEntity other, Contact extra)
7405 {
7407 {
7408 int liquidType = -1;
7410 if (impactSpeed > 0.0)
7411 {
7413 #ifndef SERVER
7415 #else
7417 SetSynchDirty();
7418 #endif
7420 }
7421 }
7422
7423 #ifdef SERVER
7424 if (GetCompEM() && GetCompEM().IsPlugged())
7425 {
7426 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7427 GetCompEM().UnplugThis();
7428 }
7429 #endif
7430 }
7431
7433
7435 {
7437 }
7438
7440 {
7441
7442 }
7443
7445 {
7446 super.OnItemLocationChanged(old_owner, new_owner);
7447
7448 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7449 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7450
7451 if (!relatedPlayer && playerNew)
7452 relatedPlayer = playerNew;
7453
7454 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7455 {
7457 if (actionMgr)
7458 {
7459 ActionBase currentAction = actionMgr.GetRunningAction();
7460 if (currentAction)
7462 }
7463 }
7464
7465 Man ownerPlayerOld = null;
7466 Man ownerPlayerNew = null;
7467
7468 if (old_owner)
7469 {
7470 if (old_owner.
IsMan())
7471 {
7472 ownerPlayerOld = Man.Cast(old_owner);
7473 }
7474 else
7475 {
7476 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7477 }
7478 }
7479 else
7480 {
7482 {
7484
7485 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7486 {
7487 GetCompEM().UnplugThis();
7488 }
7489 }
7490 }
7491
7492 if (new_owner)
7493 {
7494 if (new_owner.
IsMan())
7495 {
7496 ownerPlayerNew = Man.Cast(new_owner);
7497 }
7498 else
7499 {
7500 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7501 }
7502 }
7503
7504 if (ownerPlayerOld != ownerPlayerNew)
7505 {
7506 if (ownerPlayerOld)
7507 {
7508 array<EntityAI> subItemsExit = new array<EntityAI>;
7510 for (int i = 0; i < subItemsExit.Count(); i++)
7511 {
7514 }
7515 }
7516
7517 if (ownerPlayerNew)
7518 {
7519 array<EntityAI> subItemsEnter = new array<EntityAI>;
7521 for (int j = 0; j < subItemsEnter.Count(); j++)
7522 {
7525 }
7526 }
7527 }
7528 else if (ownerPlayerNew != null)
7529 {
7530 PlayerBase nplayer;
7531 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7532 {
7533 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7535 for (int k = 0; k < subItemsUpdate.Count(); k++)
7536 {
7538 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7539 }
7540 }
7541 }
7542
7543 if (old_owner)
7544 old_owner.OnChildItemRemoved(this);
7545 if (new_owner)
7546 new_owner.OnChildItemReceived(this);
7547 }
7548
7549
7551 {
7552 super.EEDelete(parent);
7553 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7554 if (player)
7555 {
7557
7558 if (player.IsAlive())
7559 {
7560 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7561 if (r_index >= 0)
7562 {
7563 InventoryLocation r_il = new InventoryLocation;
7564 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7565
7566 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7569 {
7570 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7571 }
7573 {
7574 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7575 }
7576
7577 }
7578
7579 player.RemoveQuickBarEntityShortcut(this);
7580 }
7581 }
7582 }
7583
7585 {
7586 super.EEKilled(killer);
7587
7590 {
7591 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7592 {
7593 if (IsMagazine())
7594 {
7595 if (Magazine.Cast(this).GetAmmoCount() > 0)
7596 {
7598 }
7599 }
7600 else
7601 {
7603 }
7604 }
7605 }
7606 }
7607
7609 {
7610 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7611
7612 super.OnWasAttached(parent, slot_id);
7613
7616
7618 }
7619
7621 {
7622 super.OnWasDetached(parent, slot_id);
7623
7626 }
7627
7629 {
7630 int idx;
7633
7634 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7635 if (inventory_slots.Count() < 1)
7636 {
7637 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7638 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7639 }
7640 else
7641 {
7642 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7643 }
7644
7645 idx = inventory_slots.Find(slot);
7646 if (idx < 0)
7647 return "";
7648
7649 return attach_types.Get(idx);
7650 }
7651
7653 {
7654 int idx = -1;
7655 string slot;
7656
7659
7660 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7661 if (inventory_slots.Count() < 1)
7662 {
7663 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7664 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7665 }
7666 else
7667 {
7668 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7669 if (detach_types.Count() < 1)
7670 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7671 }
7672
7673 for (int i = 0; i < inventory_slots.Count(); i++)
7674 {
7675 slot = inventory_slots.Get(i);
7676 }
7677
7678 if (slot != "")
7679 {
7680 if (detach_types.Count() == 1)
7681 idx = 0;
7682 else
7683 idx = inventory_slots.Find(slot);
7684 }
7685 if (idx < 0)
7686 return "";
7687
7688 return detach_types.Get(idx);
7689 }
7690
7692 {
7693
7695
7696
7697 float min_time = 1;
7698 float max_time = 3;
7699 float delay = Math.RandomFloat(min_time, max_time);
7700
7701 explode_timer.Run(delay, this, "DoAmmoExplosion");
7702 }
7703
7705 {
7706 Magazine magazine = Magazine.Cast(this);
7707 int pop_sounds_count = 6;
7708 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7709
7710
7711 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7712 string sound_name = pop_sounds[ sound_idx ];
7714
7715
7716 magazine.ServerAddAmmoCount(-1);
7717
7718
7719 float min_temp_to_explode = 100;
7720
7721 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7722 {
7724 }
7725 }
7726
7727
7728 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7729 {
7730 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7731
7732 const int CHANCE_DAMAGE_CARGO = 4;
7733 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7734 const int CHANCE_DAMAGE_NOTHING = 2;
7735
7737 {
7738 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7739 int chances;
7740 int rnd;
7741
7742 if (GetInventory().GetCargo())
7743 {
7744 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7745 rnd = Math.RandomInt(0,chances);
7746
7747 if (rnd < CHANCE_DAMAGE_CARGO)
7748 {
7750 }
7751 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7752 {
7754 }
7755 }
7756 else
7757 {
7758 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7759 rnd = Math.RandomInt(0,chances);
7760
7761 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7762 {
7764 }
7765 }
7766 }
7767 }
7768
7770 {
7771 if (GetInventory().GetCargo())
7772 {
7773 int item_count = GetInventory().GetCargo().GetItemCount();
7774 if (item_count > 0)
7775 {
7776 int random_pick = Math.RandomInt(0, item_count);
7778 if (!item.IsExplosive())
7779 {
7780 item.AddHealth("","",damage);
7781 return true;
7782 }
7783 }
7784 }
7785 return false;
7786 }
7787
7789 {
7790 int attachment_count = GetInventory().AttachmentCount();
7791 if (attachment_count > 0)
7792 {
7793 int random_pick = Math.RandomInt(0, attachment_count);
7794 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7795 if (!attachment.IsExplosive())
7796 {
7797 attachment.AddHealth("","",damage);
7798 return true;
7799 }
7800 }
7801 return false;
7802 }
7803
7805 {
7807 }
7808
7810 {
7812 return GetInventory().CanRemoveEntity();
7813
7814 return false;
7815 }
7816
7818 {
7820 return;
7821
7823 {
7824 if (ScriptInputUserData.CanStoreInputUserData())
7825 {
7826 ScriptInputUserData ctx = new ScriptInputUserData;
7831 ctx.
Write(destination_entity);
7835 }
7836 }
7837 else if (!
GetGame().IsMultiplayer())
7838 {
7840 }
7841 }
7842
7844 {
7846 return;
7847
7848 float split_quantity_new;
7852 InventoryLocation loc = new InventoryLocation;
7853
7854 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7855 {
7857 split_quantity_new = stack_max;
7858 else
7860
7861 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7862 if (new_item)
7863 {
7864 new_item.SetResultOfSplit(true);
7865 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7867 new_item.SetQuantity(split_quantity_new);
7868 }
7869 }
7870 else if (destination_entity && slot_id == -1)
7871 {
7872 if (quantity > stack_max)
7873 split_quantity_new = stack_max;
7874 else
7875 split_quantity_new = quantity;
7876
7878 {
7881 }
7882
7883 if (new_item)
7884 {
7885 new_item.SetResultOfSplit(true);
7886 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7888 new_item.SetQuantity(split_quantity_new);
7889 }
7890 }
7891 else
7892 {
7893 if (stack_max != 0)
7894 {
7896 {
7898 }
7899
7900 if (split_quantity_new == 0)
7901 {
7902 if (!
GetGame().IsMultiplayer())
7903 player.PhysicalPredictiveDropItem(this);
7904 else
7905 player.ServerDropEntity(this);
7906 return;
7907 }
7908
7910
7911 if (new_item)
7912 {
7913 new_item.SetResultOfSplit(true);
7914 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7916 new_item.SetQuantity(stack_max);
7917 new_item.PlaceOnSurface();
7918 }
7919 }
7920 }
7921 }
7922
7924 {
7926 return;
7927
7928 float split_quantity_new;
7932 InventoryLocation loc = new InventoryLocation;
7933
7934 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7935 {
7937 split_quantity_new = stack_max;
7938 else
7940
7941 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7942 if (new_item)
7943 {
7944 new_item.SetResultOfSplit(true);
7945 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7947 new_item.SetQuantity(split_quantity_new);
7948 }
7949 }
7950 else if (destination_entity && slot_id == -1)
7951 {
7952 if (quantity > stack_max)
7953 split_quantity_new = stack_max;
7954 else
7955 split_quantity_new = quantity;
7956
7958 {
7961 }
7962
7963 if (new_item)
7964 {
7965 new_item.SetResultOfSplit(true);
7966 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7968 new_item.SetQuantity(split_quantity_new);
7969 }
7970 }
7971 else
7972 {
7973 if (stack_max != 0)
7974 {
7976 {
7978 }
7979
7981
7982 if (new_item)
7983 {
7984 new_item.SetResultOfSplit(true);
7985 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7987 new_item.SetQuantity(stack_max);
7988 new_item.PlaceOnSurface();
7989 }
7990 }
7991 }
7992 }
7993
7995 {
7997 return;
7998
8000 {
8001 if (ScriptInputUserData.CanStoreInputUserData())
8002 {
8003 ScriptInputUserData ctx = new ScriptInputUserData;
8008 dst.WriteToContext(ctx);
8010 }
8011 }
8012 else if (!
GetGame().IsMultiplayer())
8013 {
8015 }
8016 }
8017
8019 {
8021 return;
8022
8024 {
8025 if (ScriptInputUserData.CanStoreInputUserData())
8026 {
8027 ScriptInputUserData ctx = new ScriptInputUserData;
8032 ctx.
Write(destination_entity);
8038 }
8039 }
8040 else if (!
GetGame().IsMultiplayer())
8041 {
8043 }
8044 }
8045
8047 {
8049 }
8050
8052 {
8054 return this;
8055
8057 float split_quantity_new;
8059 if (dst.IsValid())
8060 {
8061 int slot_id = dst.GetSlot();
8063
8064 if (quantity > stack_max)
8065 split_quantity_new = stack_max;
8066 else
8067 split_quantity_new = quantity;
8068
8070
8071 if (new_item)
8072 {
8073 new_item.SetResultOfSplit(true);
8074 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8077 }
8078
8079 return new_item;
8080 }
8081
8082 return null;
8083 }
8084
8086 {
8088 return;
8089
8091 float split_quantity_new;
8093 if (destination_entity)
8094 {
8096 if (quantity > stackable)
8097 split_quantity_new = stackable;
8098 else
8099 split_quantity_new = quantity;
8100
8101 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8102 if (new_item)
8103 {
8104 new_item.SetResultOfSplit(true);
8105 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8107 new_item.SetQuantity(split_quantity_new);
8108 }
8109 }
8110 }
8111
8113 {
8115 return;
8116
8118 {
8119 if (ScriptInputUserData.CanStoreInputUserData())
8120 {
8121 ScriptInputUserData ctx = new ScriptInputUserData;
8126 ItemBase destination_entity =
this;
8127 ctx.
Write(destination_entity);
8131 }
8132 }
8133 else if (!
GetGame().IsMultiplayer())
8134 {
8136 }
8137 }
8138
8140 {
8142 return;
8143
8145 float split_quantity_new;
8147 if (player)
8148 {
8150 if (quantity > stackable)
8151 split_quantity_new = stackable;
8152 else
8153 split_quantity_new = quantity;
8154
8155 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8156 new_item =
ItemBase.Cast(in_hands);
8157 if (new_item)
8158 {
8159 new_item.SetResultOfSplit(true);
8160 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8162 new_item.SetQuantity(split_quantity_new);
8163 }
8164 }
8165 }
8166
8168 {
8170 return;
8171
8173 float split_quantity_new = Math.Floor(quantity * 0.5);
8174
8176
8177 if (new_item)
8178 {
8179 if (new_item.GetQuantityMax() < split_quantity_new)
8180 {
8181 split_quantity_new = new_item.GetQuantityMax();
8182 }
8183
8184 new_item.SetResultOfSplit(true);
8185 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8186
8188 {
8191 }
8192 else
8193 {
8196 }
8197 }
8198 }
8199
8201 {
8203 return;
8204
8206 float split_quantity_new = Math.Floor(quantity / 2);
8207
8208 InventoryLocation invloc = new InventoryLocation;
8210
8212 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8213
8214 if (new_item)
8215 {
8216 if (new_item.GetQuantityMax() < split_quantity_new)
8217 {
8218 split_quantity_new = new_item.GetQuantityMax();
8219 }
8221 {
8224 }
8225 else
8226 {
8229 }
8230 }
8231 }
8232
8235 {
8236 SetWeightDirty();
8238
8239 if (parent)
8240 parent.OnAttachmentQuantityChangedEx(this, delta);
8241
8243 {
8245 {
8247 }
8249 {
8250 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8252 }
8253 }
8254
8255 }
8256
8259 {
8260
8261 }
8262
8265 {
8267 }
8268
8270 {
8271 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8272
8274 {
8275 if (newLevel == GameConstants.STATE_RUINED)
8276 {
8278 EntityAI parent = GetHierarchyParent();
8279 if (parent && parent.IsFireplace())
8280 {
8281 CargoBase cargo = GetInventory().GetCargo();
8282 if (cargo)
8283 {
8285 {
8287 }
8288 }
8289 }
8290 }
8291
8293 {
8294
8296 return;
8297 }
8298
8299 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8300 {
8302 }
8303 }
8304 }
8305
8306
8308 {
8309 super.OnRightClick();
8310
8312 {
8314 {
8315 if (ScriptInputUserData.CanStoreInputUserData())
8316 {
8317 vector m4[4];
8319
8320 EntityAI root = GetHierarchyRoot();
8321
8322 InventoryLocation dst = new InventoryLocation;
8324 {
8325 if (root)
8326 {
8327 root.GetTransform(m4);
8329 }
8330 else
8331 GetInventory().GetCurrentInventoryLocation(dst);
8332 }
8333 else
8334 {
8336
8337
8338 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8339 {
8340 if (root)
8341 {
8342 root.GetTransform(m4);
8344 }
8345 else
8346 GetInventory().GetCurrentInventoryLocation(dst);
8347 }
8348 else
8349 {
8350 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8351 }
8352 }
8353
8354 ScriptInputUserData ctx = new ScriptInputUserData;
8362 }
8363 }
8364 else if (!
GetGame().IsMultiplayer())
8365 {
8367 }
8368 }
8369 }
8370
8371 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8372 {
8373
8374 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8375 return false;
8376
8377 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8378 return false;
8379
8380
8382 return false;
8383
8384
8385 Magazine mag = Magazine.Cast(this);
8386 if (mag)
8387 {
8388 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8389 return false;
8390
8391 if (stack_max_limit)
8392 {
8393 Magazine other_mag = Magazine.Cast(other_item);
8394 if (other_item)
8395 {
8396 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8397 return false;
8398 }
8399
8400 }
8401 }
8402 else
8403 {
8404
8406 return false;
8407
8409 return false;
8410 }
8411
8412 PlayerBase player = null;
8413 if (CastTo(player, GetHierarchyRootPlayer()))
8414 {
8415 if (player.GetInventory().HasAttachment(this))
8416 return false;
8417
8418 if (player.IsItemsToDelete())
8419 return false;
8420 }
8421
8422 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8423 return false;
8424
8425 int slotID;
8427 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8428 return false;
8429
8430 return true;
8431 }
8432
8434 {
8436 }
8437
8439 {
8440 return m_IsResultOfSplit;
8441 }
8442
8444 {
8445 m_IsResultOfSplit = value;
8446 }
8447
8449 {
8451 }
8452
8454 {
8455 float other_item_quantity = other_item.GetQuantity();
8456 float this_free_space;
8457
8459
8461
8462 if (other_item_quantity > this_free_space)
8463 {
8464 return this_free_space;
8465 }
8466 else
8467 {
8468 return other_item_quantity;
8469 }
8470 }
8471
8473 {
8475 }
8476
8478 {
8480 return;
8481
8482 if (!IsMagazine() && other_item)
8483 {
8485 if (quantity_used != 0)
8486 {
8487 float hp1 = GetHealth01("","");
8488 float hp2 = other_item.GetHealth01("","");
8489 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8490 hpResult = hpResult / (
GetQuantity() + quantity_used);
8491
8492 hpResult *= GetMaxHealth();
8493 Math.Round(hpResult);
8494 SetHealth("", "Health", hpResult);
8495
8497 other_item.AddQuantity(-quantity_used);
8498 }
8499 }
8501 }
8502
8504 {
8505 #ifdef SERVER
8506 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8507 GetHierarchyParent().IncreaseLifetimeUp();
8508 #endif
8509 };
8510
8512 {
8513 PlayerBase p = PlayerBase.Cast(player);
8514
8515 array<int> recipesIds = p.m_Recipes;
8516 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8517 if (moduleRecipesManager)
8518 {
8519 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8520 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8521 }
8522
8523 for (int i = 0;i < recipesIds.Count(); i++)
8524 {
8525 int key = recipesIds.Get(i);
8526 string recipeName = moduleRecipesManager.GetRecipeName(key);
8528 }
8529 }
8530
8531
8532 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8533 {
8534 super.GetDebugActions(outputList);
8535
8536
8541
8542
8546
8550
8551
8554
8555
8557 {
8560 }
8561
8563
8566
8570 }
8571
8572
8573
8574
8576 {
8577 super.OnAction(action_id, player, ctx);
8578 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8579 {
8580 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8581 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8582 PlayerBase p = PlayerBase.Cast(player);
8583 if (
EActions.RECIPES_RANGE_START < 1000)
8584 {
8585 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8586 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8587 }
8588 }
8589 #ifndef SERVER
8590 else if (action_id ==
EActions.WATCH_PLAYER)
8591 {
8592 PluginDeveloper.SetDeveloperItemClientEx(player);
8593 }
8594 #endif
8596 {
8597 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8598 {
8599 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8600 OnDebugButtonPressServer(id + 1);
8601 }
8602
8603 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8604 {
8605 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8607 }
8608
8609 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8610 {
8611 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8613 }
8614
8615 else if (action_id ==
EActions.ADD_QUANTITY)
8616 {
8617 if (IsMagazine())
8618 {
8619 Magazine mag = Magazine.Cast(this);
8620 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8621 }
8622 else
8623 {
8625 }
8626
8627 if (m_EM)
8628 {
8629 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8630 }
8631
8632 }
8633
8634 else if (action_id ==
EActions.REMOVE_QUANTITY)
8635 {
8636 if (IsMagazine())
8637 {
8638 Magazine mag2 = Magazine.Cast(this);
8639 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8640 }
8641 else
8642 {
8644 }
8645 if (m_EM)
8646 {
8647 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8648 }
8649
8650 }
8651
8652 else if (action_id ==
EActions.SET_QUANTITY_0)
8653 {
8655
8656 if (m_EM)
8657 {
8658 m_EM.SetEnergy(0);
8659 }
8660 }
8661
8662 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8663 {
8665
8666 if (m_EM)
8667 {
8668 m_EM.SetEnergy(m_EM.GetEnergyMax());
8669 }
8670 }
8671
8672 else if (action_id ==
EActions.ADD_HEALTH)
8673 {
8674 AddHealth("","",GetMaxHealth("","Health")/5);
8675 }
8676 else if (action_id ==
EActions.REMOVE_HEALTH)
8677 {
8678 AddHealth("","",-GetMaxHealth("","Health")/5);
8679 }
8680 else if (action_id ==
EActions.DESTROY_HEALTH)
8681 {
8682 SetHealth01("","",0);
8683 }
8684 else if (action_id ==
EActions.WATCH_ITEM)
8685 {
8687 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8688 #ifdef DEVELOPER
8689 SetDebugDeveloper_item(this);
8690 #endif
8691 }
8692
8693 else if (action_id ==
EActions.ADD_TEMPERATURE)
8694 {
8695 AddTemperature(20);
8696
8697 }
8698
8699 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8700 {
8701 AddTemperature(-20);
8702
8703 }
8704
8705 else if (action_id ==
EActions.FLIP_FROZEN)
8706 {
8707 SetFrozen(!GetIsFrozen());
8708
8709 }
8710
8711 else if (action_id ==
EActions.ADD_WETNESS)
8712 {
8714
8715 }
8716
8717 else if (action_id ==
EActions.REMOVE_WETNESS)
8718 {
8720
8721 }
8722
8723 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8724 {
8727
8728
8729 }
8730
8731 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8732 {
8735 }
8736
8737 else if (action_id ==
EActions.MAKE_SPECIAL)
8738 {
8739 auto debugParams = DebugSpawnParams.WithPlayer(player);
8740 OnDebugSpawnEx(debugParams);
8741 }
8742
8743 else if (action_id ==
EActions.DELETE)
8744 {
8745 Delete();
8746 }
8747
8748 }
8749
8750
8751 return false;
8752 }
8753
8754
8755
8756
8760
8763
8764
8765
8767 {
8768 return false;
8769 }
8770
8771
8773 {
8774 return true;
8775 }
8776
8777
8779 {
8780 return true;
8781 }
8782
8783
8784
8786 {
8787 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8789 }
8790
8793 {
8794 return null;
8795 }
8796
8798 {
8799 return false;
8800 }
8801
8803 {
8804 return false;
8805 }
8806
8810
8811
8813 {
8814 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8815 return module_repairing.CanRepair(this, item_repair_kit);
8816 }
8817
8818
8819 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8820 {
8821 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8822 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8823 }
8824
8825
8827 {
8828
8829
8830
8831
8832
8833
8834
8835
8836 return 1;
8837 }
8838
8839
8840
8842 {
8844 }
8845
8846
8847
8849 {
8851 }
8852
8853
8862 {
8863 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8864
8865 if (player)
8866 {
8867 player.MessageStatus(text);
8868 }
8869 }
8870
8871
8880 {
8881 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8882
8883 if (player)
8884 {
8885 player.MessageAction(text);
8886 }
8887 }
8888
8889
8898 {
8899 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8900
8901 if (player)
8902 {
8903 player.MessageFriendly(text);
8904 }
8905 }
8906
8907
8916 {
8917 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8918
8919 if (player)
8920 {
8921 player.MessageImportant(text);
8922 }
8923 }
8924
8926 {
8927 return true;
8928 }
8929
8930
8931 override bool KindOf(
string tag)
8932 {
8933 bool found = false;
8934 string item_name = this.
GetType();
8937
8938 int array_size = item_tag_array.Count();
8939 for (int i = 0; i < array_size; i++)
8940 {
8941 if (item_tag_array.Get(i) == tag)
8942 {
8943 found = true;
8944 break;
8945 }
8946 }
8947 return found;
8948 }
8949
8950
8952 {
8953
8954 super.OnRPC(sender, rpc_type,ctx);
8955
8956
8957 switch (rpc_type)
8958 {
8959 #ifndef SERVER
8960 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8961 Param2<bool, string> p = new Param2<bool, string>(false, "");
8962
8964 return;
8965
8966 bool play = p.param1;
8967 string soundSet = p.param2;
8968
8969 if (play)
8970 {
8972 {
8974 {
8976 }
8977 }
8978 else
8979 {
8981 }
8982 }
8983 else
8984 {
8986 }
8987
8988 break;
8989 #endif
8990
8991 }
8992
8994 {
8996 }
8997 }
8998
8999
9000
9001
9003 {
9004 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9005 return plugin.GetID(
name);
9006 }
9007
9009 {
9010 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9011 return plugin.GetName(id);
9012 }
9013
9016 {
9017
9018
9019 int varFlags;
9020 if (!ctx.
Read(varFlags))
9021 return;
9022
9023 if (varFlags & ItemVariableFlags.FLOAT)
9024 {
9026 }
9027 }
9028
9030 {
9031
9032 super.SerializeNumericalVars(floats_out);
9033
9034
9035
9037 {
9039 }
9040
9042 {
9044 }
9045
9047 {
9049 }
9050
9052 {
9057 }
9058
9060 {
9062 }
9063 }
9064
9066 {
9067
9068 super.DeSerializeNumericalVars(floats);
9069
9070
9071 int index = 0;
9072 int mask = Math.Round(floats.Get(index));
9073
9074 index++;
9075
9077 {
9079 {
9081 }
9082 else
9083 {
9084 float quantity = floats.Get(index);
9086 }
9087 index++;
9088 }
9089
9091 {
9092 float wet = floats.Get(index);
9094 index++;
9095 }
9096
9098 {
9099 int liquidtype = Math.Round(floats.Get(index));
9101 index++;
9102 }
9103
9105 {
9107 index++;
9109 index++;
9111 index++;
9113 index++;
9114 }
9115
9117 {
9118 int cleanness = Math.Round(floats.Get(index));
9120 index++;
9121 }
9122 }
9123
9125 {
9126 super.WriteVarsToCTX(ctx);
9127
9128
9130 {
9132 }
9133
9135 {
9137 }
9138
9140 {
9142 }
9143
9145 {
9146 int r,g,b,a;
9152 }
9153
9155 {
9157 }
9158 }
9159
9161 {
9162 if (!super.ReadVarsFromCTX(ctx,version))
9163 return false;
9164
9165 int intValue;
9166 float value;
9167
9168 if (version < 140)
9169 {
9170 if (!ctx.
Read(intValue))
9171 return false;
9172
9173 m_VariablesMask = intValue;
9174 }
9175
9177 {
9178 if (!ctx.
Read(value))
9179 return false;
9180
9182 {
9184 }
9185 else
9186 {
9188 }
9189 }
9190
9191 if (version < 140)
9192 {
9194 {
9195 if (!ctx.
Read(value))
9196 return false;
9197 SetTemperatureDirect(value);
9198 }
9199 }
9200
9202 {
9203 if (!ctx.
Read(value))
9204 return false;
9206 }
9207
9209 {
9210 if (!ctx.
Read(intValue))
9211 return false;
9213 }
9214
9216 {
9217 int r,g,b,a;
9219 return false;
9221 return false;
9223 return false;
9225 return false;
9226
9228 }
9229
9231 {
9232 if (!ctx.
Read(intValue))
9233 return false;
9235 }
9236
9237 if (version >= 138 && version < 140)
9238 {
9240 {
9241 if (!ctx.
Read(intValue))
9242 return false;
9243 SetFrozen(intValue);
9244 }
9245 }
9246
9247 return true;
9248 }
9249
9250
9252 {
9255 {
9257 }
9258
9259 if (!super.OnStoreLoad(ctx, version))
9260 {
9262 return false;
9263 }
9264
9265 if (version >= 114)
9266 {
9267 bool hasQuickBarIndexSaved;
9268
9269 if (!ctx.
Read(hasQuickBarIndexSaved))
9270 {
9272 return false;
9273 }
9274
9275 if (hasQuickBarIndexSaved)
9276 {
9277 int itmQBIndex;
9278
9279
9280 if (!ctx.
Read(itmQBIndex))
9281 {
9283 return false;
9284 }
9285
9286 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9287 if (itmQBIndex != -1 && parentPlayer)
9288 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9289 }
9290 }
9291 else
9292 {
9293
9294 PlayerBase player;
9295 int itemQBIndex;
9296 if (version ==
int.
MAX)
9297 {
9298 if (!ctx.
Read(itemQBIndex))
9299 {
9301 return false;
9302 }
9303 }
9304 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9305 {
9306
9307 if (!ctx.
Read(itemQBIndex))
9308 {
9310 return false;
9311 }
9312 if (itemQBIndex != -1 && player)
9313 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9314 }
9315 }
9316
9317 if (version < 140)
9318 {
9319
9320 if (!LoadVariables(ctx, version))
9321 {
9323 return false;
9324 }
9325 }
9326
9327
9329 {
9331 return false;
9332 }
9333 if (version >= 132)
9334 {
9336 if (raib)
9337 {
9339 {
9341 return false;
9342 }
9343 }
9344 }
9345
9347 return true;
9348 }
9349
9350
9351
9353 {
9354 super.OnStoreSave(ctx);
9355
9356 PlayerBase player;
9357 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9358 {
9360
9361 int itemQBIndex = -1;
9362 itemQBIndex = player.FindQuickBarEntityIndex(this);
9363 ctx.
Write(itemQBIndex);
9364 }
9365 else
9366 {
9368 }
9369
9371
9373 if (raib)
9374 {
9376 }
9377 }
9378
9379
9381 {
9382 super.AfterStoreLoad();
9383
9385 {
9387 }
9388
9390 {
9393 }
9394 }
9395
9397 {
9398 super.EEOnAfterLoad();
9399
9401 {
9403 }
9404
9407 }
9408
9410 {
9411 return false;
9412 }
9413
9414
9415
9417 {
9419 {
9420 #ifdef PLATFORM_CONSOLE
9421
9423 {
9425 if (menu)
9426 {
9428 }
9429 }
9430 #endif
9431 }
9432
9434 {
9437 }
9438
9440 {
9441 SetWeightDirty();
9443 }
9445 {
9448 }
9449
9451 {
9454 }
9456 {
9459 }
9460
9461 super.OnVariablesSynchronized();
9462 }
9463
9464
9465
9467 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9468 {
9469 if (!IsServerCheck(allow_client))
9470 return false;
9471
9473 return false;
9474
9477
9478 if (value <= (min + 0.001))
9479 value = min;
9480
9481 if (value == min)
9482 {
9483 if (destroy_config)
9484 {
9485 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9486 if (dstr)
9487 {
9489 this.Delete();
9490 return true;
9491 }
9492 }
9493 else if (destroy_forced)
9494 {
9496 this.Delete();
9497 return true;
9498 }
9499
9501 }
9502
9505
9507 {
9509
9510 if (delta)
9512 }
9513
9515
9516 return false;
9517 }
9518
9519
9521 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9522 {
9524 }
9525
9527 {
9530 }
9531
9533 {
9536 }
9537
9540 {
9541 float value_clamped = Math.Clamp(value, 0, 1);
9543 SetQuantity(result, destroy_config, destroy_forced);
9544 }
9545
9546
9549 {
9551 }
9552
9554 {
9556 }
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9568 {
9569 int slot = -1;
9570 if (GetInventory())
9571 {
9572 InventoryLocation il = new InventoryLocation;
9573 GetInventory().GetCurrentInventoryLocation(il);
9575 }
9576
9578 }
9579
9581 {
9582 float quantity_max = 0;
9583
9585 {
9586 if (attSlotID != -1)
9587 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9588
9589 if (quantity_max <= 0)
9591 }
9592
9593 if (quantity_max <= 0)
9595
9596 return quantity_max;
9597 }
9598
9600 {
9602 }
9603
9605 {
9607 }
9608
9609
9611 {
9613 }
9614
9616 {
9618 }
9619
9621 {
9623 }
9624
9625
9627 {
9628
9629 float weightEx = GetWeightEx();
9630 float special = GetInventoryAndCargoWeight();
9631 return weightEx - special;
9632 }
9633
9634
9636 {
9638 }
9639
9641 {
9643 {
9644 #ifdef DEVELOPER
9645 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9646 {
9647 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9649 }
9650 #endif
9651
9653 }
9654 else if (HasEnergyManager())
9655 {
9656 #ifdef DEVELOPER
9657 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9658 {
9659 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9660 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9661 }
9662 #endif
9663 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9664 }
9665 else
9666 {
9667 #ifdef DEVELOPER
9668 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9669 {
9670 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9671 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9672 }
9673 #endif
9674 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9675 }
9676 }
9677
9680 {
9681 int item_count = 0;
9683
9684 if (GetInventory().GetCargo() != NULL)
9685 {
9686 item_count = GetInventory().GetCargo().GetItemCount();
9687 }
9688
9689 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9690 {
9691 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9692 if (item)
9693 item_count += item.GetNumberOfItems();
9694 }
9695 return item_count;
9696 }
9697
9700 {
9701 float weight = 0;
9702 float wetness = 1;
9703 if (include_wetness)
9706 {
9707 weight = wetness * m_ConfigWeight;
9708 }
9710 {
9711 weight = 1;
9712 }
9713 return weight;
9714 }
9715
9716
9717
9719 {
9720 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9721 {
9722 GameInventory inv = GetInventory();
9723 array<EntityAI> items = new array<EntityAI>;
9725 for (int i = 0; i < items.Count(); i++)
9726 {
9728 if (item)
9729 {
9731 }
9732 }
9733 }
9734 }
9735
9736
9737
9738
9740 {
9741 float energy = 0;
9742 if (HasEnergyManager())
9743 {
9744 energy = GetCompEM().GetEnergy();
9745 }
9746 return energy;
9747 }
9748
9749
9751 {
9752 super.OnEnergyConsumed();
9753
9755 }
9756
9758 {
9759 super.OnEnergyAdded();
9760
9762 }
9763
9764
9766 {
9767 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9768 {
9770 {
9771 float energy_0to1 = GetCompEM().GetEnergy0To1();
9773 }
9774 }
9775 }
9776
9777
9779 {
9780 return ConfigGetFloat("heatIsolation");
9781 }
9782
9784 {
9786 }
9787
9789 {
9790 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9791 if (
GetGame().ConfigIsExisting(paramPath))
9793
9794 return 0.0;
9795 }
9796
9798 {
9799 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9800 if (
GetGame().ConfigIsExisting(paramPath))
9802
9803 return 0.0;
9804 }
9805
9806 override void SetWet(
float value,
bool allow_client =
false)
9807 {
9808 if (!IsServerCheck(allow_client))
9809 return;
9810
9813
9815
9816 m_VarWet = Math.Clamp(value, min, max);
9817
9819 {
9822 }
9823 }
9824
9825 override void AddWet(
float value)
9826 {
9828 }
9829
9831 {
9833 }
9834
9836 {
9838 }
9839
9841 {
9843 }
9844
9846 {
9848 }
9849
9851 {
9853 }
9854
9856 {
9859 if (newLevel != oldLevel)
9860 {
9862 }
9863 }
9864
9866 {
9867 SetWeightDirty();
9868 }
9869
9871 {
9872 return GetWetLevelInternal(
m_VarWet);
9873 }
9874
9875
9876
9878 {
9880 }
9881
9883 {
9885 }
9886
9888 {
9890 }
9891
9893 {
9895 }
9896
9897
9898
9900 {
9901 if (ConfigIsExisting("itemModelLength"))
9902 {
9903 return ConfigGetFloat("itemModelLength");
9904 }
9905 return 0;
9906 }
9907
9909 {
9910 if (ConfigIsExisting("itemAttachOffset"))
9911 {
9912 return ConfigGetFloat("itemAttachOffset");
9913 }
9914 return 0;
9915 }
9916
9917 override void SetCleanness(
int value,
bool allow_client =
false)
9918 {
9919 if (!IsServerCheck(allow_client))
9920 return;
9921
9923
9925
9928 }
9929
9931 {
9933 }
9934
9936 {
9937 return true;
9938 }
9939
9940
9941
9942
9944 {
9946 }
9947
9949 {
9951 }
9952
9953
9954
9955
9956 override void SetColor(
int r,
int g,
int b,
int a)
9957 {
9963 }
9965 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9966 {
9971 }
9972
9974 {
9976 }
9977
9980 {
9981 int r,g,b,a;
9983 r = r/255;
9984 g = g/255;
9985 b = b/255;
9986 a = a/255;
9987 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9988 }
9989
9990
9991
9992 override void SetLiquidType(
int value,
bool allow_client =
false)
9993 {
9994 if (!IsServerCheck(allow_client))
9995 return;
9996
10001 }
10002
10004 {
10005 return ConfigGetInt("varLiquidTypeInit");
10006 }
10007
10009 {
10011 }
10012
10014 {
10016 SetFrozen(false);
10017 }
10018
10021 {
10022 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10023 }
10024
10025
10028 {
10029 PlayerBase nplayer;
10030 if (PlayerBase.CastTo(nplayer, player))
10031 {
10033
10034 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10035 }
10036 }
10037
10038
10041 {
10042 PlayerBase nplayer;
10043 if (PlayerBase.CastTo(nplayer,player))
10044 {
10045
10046 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10047
10048 }
10049
10050
10051 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10052
10053
10054 if (HasEnergyManager())
10055 {
10056 GetCompEM().UpdatePlugState();
10057 }
10058 }
10059
10060
10062 {
10063 super.OnPlacementStarted(player);
10064
10066 }
10067
10068 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10069 {
10071 {
10072 m_AdminLog.OnPlacementComplete(player,
this);
10073 }
10074
10075 super.OnPlacementComplete(player, position, orientation);
10076 }
10077
10078
10079
10080
10081
10083 {
10085 {
10086 return true;
10087 }
10088 else
10089 {
10090 return false;
10091 }
10092 }
10093
10094
10096 {
10098 {
10100 }
10101 }
10102
10103
10105 {
10107 }
10108
10110 {
10112 }
10113
10114 override void InsertAgent(
int agent,
float count = 1)
10115 {
10116 if (count < 1)
10117 return;
10118
10120 }
10121
10124 {
10126 }
10127
10128
10130 {
10132 }
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10176 {
10178 return false;
10179 return true;
10180 }
10181
10183 {
10184
10186 }
10187
10188
10191 {
10192 super.CheckForRoofLimited(timeTresholdMS);
10193
10195 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10196 {
10197 m_PreviousRoofTestTime = time;
10198 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10199 }
10200 }
10201
10202
10204 {
10206 {
10207 return 0;
10208 }
10209
10210 if (GetInventory().GetAttachmentSlotsCount() != 0)
10211 {
10212 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10213 if (filter)
10214 return filter.GetProtectionLevel(type, false, system);
10215 else
10216 return 0;
10217 }
10218
10219 string subclassPath, entryName;
10220
10221 switch (type)
10222 {
10224 entryName = "biological";
10225 break;
10227 entryName = "chemical";
10228 break;
10229 default:
10230 entryName = "biological";
10231 break;
10232 }
10233
10234 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10235
10237 }
10238
10239
10240
10243 {
10244 if (!IsMagazine())
10246
10248 }
10249
10250
10251
10252
10253
10258 {
10259 return true;
10260 }
10261
10263 {
10265 }
10266
10267
10268
10269
10270
10272 {
10273 if (parent)
10274 {
10275 if (parent.IsInherited(DayZInfected))
10276 return true;
10277
10278 if (!parent.IsRuined())
10279 return true;
10280 }
10281
10282 return true;
10283 }
10284
10286 {
10287 if (!super.CanPutAsAttachment(parent))
10288 {
10289 return false;
10290 }
10291
10292 if (!IsRuined() && !parent.IsRuined())
10293 {
10294 return true;
10295 }
10296
10297 return false;
10298 }
10299
10301 {
10302
10303
10304
10305
10306 return super.CanReceiveItemIntoCargo(item);
10307 }
10308
10310 {
10311
10312
10313
10314
10315 GameInventory attachmentInv = attachment.GetInventory();
10317 {
10318 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10319 return false;
10320 }
10321
10322 InventoryLocation loc = new InventoryLocation();
10323 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10324 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10325 return false;
10326
10327 return super.CanReceiveAttachment(attachment, slotId);
10328 }
10329
10331 {
10332 if (!super.CanReleaseAttachment(attachment))
10333 return false;
10334
10335 return GetInventory().AreChildrenAccessible();
10336 }
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10359 {
10360 int id = muzzle_owner.GetMuzzleID();
10361 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10362
10363 if (WPOF_array)
10364 {
10365 for (int i = 0; i < WPOF_array.Count(); i++)
10366 {
10367 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10368
10369 if (WPOF)
10370 {
10371 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10372 }
10373 }
10374 }
10375 }
10376
10377
10379 {
10380 int id = muzzle_owner.GetMuzzleID();
10382
10383 if (WPOBE_array)
10384 {
10385 for (int i = 0; i < WPOBE_array.Count(); i++)
10386 {
10387 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10388
10389 if (WPOBE)
10390 {
10391 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10392 }
10393 }
10394 }
10395 }
10396
10397
10399 {
10400 int id = muzzle_owner.GetMuzzleID();
10401 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10402
10403 if (WPOOH_array)
10404 {
10405 for (int i = 0; i < WPOOH_array.Count(); i++)
10406 {
10407 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10408
10409 if (WPOOH)
10410 {
10411 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10412 }
10413 }
10414 }
10415 }
10416
10417
10419 {
10420 int id = muzzle_owner.GetMuzzleID();
10421 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10422
10423 if (WPOOH_array)
10424 {
10425 for (int i = 0; i < WPOOH_array.Count(); i++)
10426 {
10427 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10428
10429 if (WPOOH)
10430 {
10431 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10432 }
10433 }
10434 }
10435 }
10436
10437
10439 {
10440 int id = muzzle_owner.GetMuzzleID();
10441 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10442
10443 if (WPOOH_array)
10444 {
10445 for (int i = 0; i < WPOOH_array.Count(); i++)
10446 {
10447 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10448
10449 if (WPOOH)
10450 {
10451 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10452 }
10453 }
10454 }
10455 }
10456
10457
10458
10460 {
10462 {
10463 return true;
10464 }
10465
10466 return false;
10467 }
10468
10470 {
10472 {
10473 return true;
10474 }
10475
10476 return false;
10477 }
10478
10480 {
10482 {
10483 return true;
10484 }
10485
10486 return false;
10487 }
10488
10490 {
10491 return false;
10492 }
10493
10496 {
10497 return UATimeSpent.DEFAULT_DEPLOY;
10498 }
10499
10500
10501
10502
10504 {
10506 SetSynchDirty();
10507 }
10508
10510 {
10512 }
10513
10514
10516 {
10517 return false;
10518 }
10519
10522 {
10523 string att_type = "None";
10524
10525 if (ConfigIsExisting("soundAttType"))
10526 {
10527 att_type = ConfigGetString("soundAttType");
10528 }
10529
10531 }
10532
10534 {
10536 }
10537
10538
10539
10540
10541
10545
10547 {
10550
10552 }
10553
10554
10556 {
10558 return;
10559
10561
10564
10567
10568 SoundParameters params = new SoundParameters();
10572 }
10573
10574
10576 {
10578 return;
10579
10581 SetSynchDirty();
10582
10585 }
10586
10587
10589 {
10591 return;
10592
10594 SetSynchDirty();
10595
10598 }
10599
10601 {
10603 }
10604
10606 {
10608 }
10609
10612 {
10613 if (!
GetGame().IsDedicatedServer())
10614 {
10615 if (ConfigIsExisting("attachSoundSet"))
10616 {
10617 string cfg_path = "";
10618 string soundset = "";
10619 string type_name =
GetType();
10620
10623 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10624 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10625
10626 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10627 {
10628 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10629 {
10630 if (cfg_slot_array[i] == slot_type)
10631 {
10632 soundset = cfg_soundset_array[i];
10633 break;
10634 }
10635 }
10636 }
10637
10638 if (soundset != "")
10639 {
10640 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10642 }
10643 }
10644 }
10645 }
10646
10648 {
10649
10650 }
10651
10652 void OnApply(PlayerBase player);
10653
10655 {
10656 return 1.0;
10657 };
10658
10660 {
10662 }
10663
10665 {
10667 }
10668
10670
10672 {
10673 SetDynamicPhysicsLifeTime(0.01);
10675 }
10676
10678 {
10679 array<string> zone_names = new array<string>;
10680 GetDamageZones(zone_names);
10681 for (int i = 0; i < zone_names.Count(); i++)
10682 {
10683 SetHealthMax(zone_names.Get(i),"Health");
10684 }
10685 SetHealthMax("","Health");
10686 }
10687
10690 {
10691 float global_health = GetHealth01("","Health");
10692 array<string> zones = new array<string>;
10693 GetDamageZones(zones);
10694
10695 for (int i = 0; i < zones.Count(); i++)
10696 {
10697 SetHealth01(zones.Get(i),"Health",global_health);
10698 }
10699 }
10700
10703 {
10704 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10705 }
10706
10708 {
10709 if (!hasRootAsPlayer)
10710 {
10711 if (refParentIB)
10712 {
10713
10714 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10715 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10716
10717 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10718 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10719
10722 }
10723 else
10724 {
10725
10728 }
10729 }
10730 }
10731
10733 {
10735 {
10736 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10737 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10738 {
10739 float heatPermCoef = 1.0;
10741 while (ent)
10742 {
10743 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10744 ent = ent.GetHierarchyParent();
10745 }
10746
10747 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10748 }
10749 }
10750 }
10751
10753 {
10754
10755 EntityAI parent = GetHierarchyParent();
10756 if (!parent)
10757 {
10758 hasParent = false;
10759 hasRootAsPlayer = false;
10760 }
10761 else
10762 {
10763 hasParent = true;
10764 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10765 refParentIB =
ItemBase.Cast(parent);
10766 }
10767 }
10768
10769 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10770 {
10771
10772 }
10773
10775 {
10776
10777 return false;
10778 }
10779
10781 {
10782
10783
10784 return false;
10785 }
10786
10788 {
10789
10790 return false;
10791 }
10792
10795 {
10796 return !GetIsFrozen() &&
IsOpen();
10797 }
10798
10800 {
10801 bool hasParent = false, hasRootAsPlayer = false;
10803
10804 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10805 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10806
10807 if (wwtu || foodDecay)
10808 {
10812
10813 if (processWetness || processTemperature || processDecay)
10814 {
10816
10817 if (processWetness)
10818 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10819
10820 if (processTemperature)
10822
10823 if (processDecay)
10824 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10825 }
10826 }
10827 }
10828
10831 {
10833 }
10834
10836 {
10839
10840 return super.GetTemperatureFreezeThreshold();
10841 }
10842
10844 {
10847
10848 return super.GetTemperatureThawThreshold();
10849 }
10850
10852 {
10855
10856 return super.GetItemOverheatThreshold();
10857 }
10858
10860 {
10862 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10863
10864 return super.GetTemperatureFreezeTime();
10865 }
10866
10868 {
10870 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10871
10872 return super.GetTemperatureThawTime();
10873 }
10874
10879
10881 {
10882 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10883 }
10884
10886 {
10887 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10888 }
10889
10892 {
10894 }
10895
10897 {
10899 }
10900
10902 {
10904 }
10905
10908 {
10909 return null;
10910 }
10911
10914 {
10915 return false;
10916 }
10917
10919 {
10921 {
10924 if (!trg)
10925 {
10927 explosive = this;
10928 }
10929
10930 explosive.PairRemote(trg);
10932
10933 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10934 trg.SetPersistentPairID(persistentID);
10935 explosive.SetPersistentPairID(persistentID);
10936
10937 return true;
10938 }
10939 return false;
10940 }
10941
10944 {
10945 float ret = 1.0;
10948 ret *= GetHealth01();
10949
10950 return ret;
10951 }
10952
10953 #ifdef DEVELOPER
10954 override void SetDebugItem()
10955 {
10956 super.SetDebugItem();
10957 _itemBase = this;
10958 }
10959
10961 {
10962 string text = super.GetDebugText();
10963
10965 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10966
10967 return text;
10968 }
10969 #endif
10970
10972 {
10973 return true;
10974 }
10975
10977
10979
10981 {
10984 }
10985
10986
10994
11010}
11011
11013{
11015 if (entity)
11016 {
11017 bool is_item = entity.IsInherited(
ItemBase);
11018 if (is_item && full_quantity)
11019 {
11022 }
11023 }
11024 else
11025 {
11027 return NULL;
11028 }
11029 return entity;
11030}
11031
11033{
11034 if (item)
11035 {
11036 if (health > 0)
11037 item.SetHealth("", "", health);
11038
11039 if (item.CanHaveTemperature())
11040 {
11042 if (item.CanFreeze())
11043 item.SetFrozen(false);
11044 }
11045
11046 if (item.HasEnergyManager())
11047 {
11048 if (quantity >= 0)
11049 {
11050 item.GetCompEM().SetEnergy0To1(quantity);
11051 }
11052 else
11053 {
11055 }
11056 }
11057 else if (item.IsMagazine())
11058 {
11059 Magazine mag = Magazine.Cast(item);
11060 if (quantity >= 0)
11061 {
11062 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11063 }
11064 else
11065 {
11067 }
11068
11069 }
11070 else
11071 {
11072 if (quantity >= 0)
11073 {
11074 item.SetQuantityNormalized(quantity, false);
11075 }
11076 else
11077 {
11079 }
11080
11081 }
11082 }
11083}
11084
11085#ifdef DEVELOPER
11087#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.