6466{
6468 {
6469 return true;
6470 }
6471};
6472
6473
6474
6476{
6480
6482
6485
6486
6487
6488
6489
6498
6504
6509
6514
6535 protected bool m_IsResultOfSplit
6536
6538
6543
6544
6545
6547
6551
6552
6553
6555
6558
6559
6560
6566
6567
6575
6578
6579
6581
6582
6584
6585
6590
6591
6596
6597
6599
6600
6602 {
6607
6608 if (!
GetGame().IsDedicatedServer())
6609 {
6611 {
6613
6615 {
6617 }
6618 }
6619
6622 }
6623
6624 m_OldLocation = null;
6625
6627 {
6629 }
6630
6631 if (ConfigIsExisting("headSelectionsToHide"))
6632 {
6635 }
6636
6638 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6639 {
6641 }
6642
6644
6645 m_IsResultOfSplit = false;
6646
6648 }
6649
6651 {
6652 super.InitItemVariables();
6653
6659 m_Count = ConfigGetInt(
"count");
6660
6663
6668
6671
6676
6688
6692
6693
6696 if (ConfigIsExisting("canBeSplit"))
6697 {
6700 }
6701
6703 if (ConfigIsExisting("itemBehaviour"))
6705
6706
6709 RegisterNetSyncVariableInt("m_VarLiquidType");
6710 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6711
6712 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6713 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6714 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6715
6716 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6717 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6718 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6719 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6720
6721 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6722 RegisterNetSyncVariableBool("m_IsTakeable");
6723 RegisterNetSyncVariableBool("m_IsHologram");
6724
6727 {
6730 }
6731
6733
6735 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6737
6738 }
6739
6741 {
6743 }
6744
6746 {
6749 {
6754 }
6755 }
6756
6757 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6758 {
6760 {
6763 }
6764
6766 }
6767
6769 {
6775 }
6776
6778
6780 {
6782
6783 if (!action)
6784 {
6785 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6786 return;
6787 }
6788
6790 if (!ai)
6791 {
6793 return;
6794 }
6795
6797 if (!action_array)
6798 {
6799 action_array = new array<ActionBase_Basic>;
6801 }
6802 if (LogManager.IsActionLogEnable())
6803 {
6804 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6805 }
6806
6807 if (action_array.Find(action) != -1)
6808 {
6809 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6810 }
6811 else
6812 {
6813 action_array.Insert(action);
6814 }
6815 }
6816
6818 {
6820 ActionBase action = player.GetActionManager().GetAction(actionName);
6823
6824 if (action_array)
6825 {
6826 action_array.RemoveItem(action);
6827 }
6828 }
6829
6830
6831
6833 {
6834 ActionOverrideData overrideData = new ActionOverrideData();
6838
6840 if (!actionMap)
6841 {
6844 }
6845
6846 actionMap.Insert(this.
Type(), overrideData);
6847
6848 }
6849
6851
6853
6854
6856 {
6859
6862
6863 string config_to_search = "CfgVehicles";
6864 string muzzle_owner_config;
6865
6867 {
6868 if (IsInherited(Weapon))
6869 config_to_search = "CfgWeapons";
6870
6871 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6872
6873 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6874
6876
6877 if (config_OnFire_subclass_count > 0)
6878 {
6879 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6880
6881 for (int i = 0; i < config_OnFire_subclass_count; i++)
6882 {
6883 string particle_class = "";
6885 string config_OnFire_entry = config_OnFire_class + particle_class;
6886 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6887 WPOF_array.Insert(WPOF);
6888 }
6889
6890
6892 }
6893 }
6894
6896 {
6897 config_to_search = "CfgWeapons";
6898 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6899
6900 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6901
6903
6904 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6905 {
6906 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6907
6908 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6909 {
6910 string particle_class2 = "";
6912 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6913 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6914 WPOBE_array.Insert(WPOBE);
6915 }
6916
6917
6919 }
6920 }
6921 }
6922
6923
6925 {
6928
6930 {
6931 string config_to_search = "CfgVehicles";
6932
6933 if (IsInherited(Weapon))
6934 config_to_search = "CfgWeapons";
6935
6936 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6937 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6938
6939 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6940 {
6941
6943
6945 {
6947 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6949 return;
6950 }
6951
6954
6955
6956
6958 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6959
6960 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6961 {
6962 string particle_class = "";
6964 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6966
6967 if (entry_type == CT_CLASS)
6968 {
6969 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6970 WPOOH_array.Insert(WPOF);
6971 }
6972 }
6973
6974
6976 }
6977 }
6978 }
6979
6981 {
6983 }
6984
6986 {
6988 {
6990
6993
6996
6997 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6998 }
6999 }
7000
7002 {
7004 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7005
7007 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7008
7010 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7011
7013 {
7015 }
7016 }
7017
7019 {
7021 }
7022
7024 {
7027 else
7029
7031 {
7034 }
7035 else
7036 {
7039
7042 }
7043
7045 }
7046
7048 {
7050 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7051 }
7052
7054 {
7056 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7058 }
7059
7061 {
7063 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7064 }
7065
7067 {
7070
7071 OverheatingParticle OP = new OverheatingParticle();
7076
7078 }
7079
7081 {
7084
7085 return -1;
7086 }
7087
7089 {
7091 {
7094
7095 for (int i = count; i > 0; --i)
7096 {
7097 int id = i - 1;
7100
7103
7104 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7105 {
7106 if (p)
7107 {
7110 }
7111 }
7112 }
7113 }
7114 }
7115
7117 {
7119 {
7121 {
7122 int id = i - 1;
7124
7125 if (OP)
7126 {
7128
7129 if (p)
7130 {
7132 }
7133
7134 delete OP;
7135 }
7136 }
7137
7140 }
7141 }
7142
7145 {
7146 return 0.0;
7147 }
7148
7149
7151 {
7152 return 250;
7153 }
7154
7156 {
7157 return 0;
7158 }
7159
7162 {
7164 return true;
7165
7166 return false;
7167 }
7168
7171 {
7174
7176 {
7178 }
7179 else
7180 {
7181
7183 }
7184
7186 }
7187
7194 {
7195 return -1;
7196 }
7197
7198
7199
7200
7202 {
7204 {
7206 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7207
7208 if (r_index >= 0)
7209 {
7210 InventoryLocation r_il = new InventoryLocation;
7211 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7212
7213 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7216 {
7217 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7218 }
7220 {
7221 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7222 }
7223
7224 }
7225
7226 player.GetHumanInventory().ClearUserReservedLocation(this);
7227 }
7228
7231 }
7232
7233
7234
7235
7237 {
7238 return ItemBase.m_DebugActionsMask;
7239 }
7240
7242 {
7243 return ItemBase.m_DebugActionsMask & mask;
7244 }
7245
7247 {
7248 ItemBase.m_DebugActionsMask = mask;
7249 }
7250
7252 {
7253 ItemBase.m_DebugActionsMask |= mask;
7254 }
7255
7257 {
7258 ItemBase.m_DebugActionsMask &= ~mask;
7259 }
7260
7262 {
7264 {
7266 }
7267 else
7268 {
7270 }
7271 }
7272
7273
7275 {
7276 if (GetEconomyProfile())
7277 {
7278 float q_max = GetEconomyProfile().GetQuantityMax();
7279 if (q_max > 0)
7280 {
7281 float q_min = GetEconomyProfile().GetQuantityMin();
7282 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7283
7285 {
7286 ComponentEnergyManager comp = GetCompEM();
7288 {
7290 }
7291 }
7293 {
7295
7296 }
7297
7298 }
7299 }
7300 }
7301
7304 {
7305 EntityAI parent = GetHierarchyParent();
7306
7307 if (parent)
7308 {
7309 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7310 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7311 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7312 }
7313 }
7314
7317 {
7318 EntityAI parent = GetHierarchyParent();
7319
7320 if (parent)
7321 {
7322 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7323 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7324 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7325 }
7326 }
7327
7329 {
7330
7331
7332
7333
7335
7337 {
7338 if (ScriptInputUserData.CanStoreInputUserData())
7339 {
7340 ScriptInputUserData ctx = new ScriptInputUserData;
7346 ctx.
Write(use_stack_max);
7349
7351 {
7352 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7353 }
7354 }
7355 }
7356 else if (!
GetGame().IsMultiplayer())
7357 {
7359 }
7360 }
7361
7363 {
7365 }
7366
7368 {
7370 }
7371
7373 {
7375 }
7376
7378 {
7379
7380 return false;
7381 }
7382
7384 {
7385 return false;
7386 }
7387
7391 {
7392 return false;
7393 }
7394
7396 {
7397 return "";
7398 }
7399
7401
7403 {
7404 return false;
7405 }
7406
7408 {
7409 return true;
7410 }
7411
7412
7413
7415 {
7416 return true;
7417 }
7418
7420 {
7421 return true;
7422 }
7423
7425 {
7426 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7428 }
7429
7431 {
7433 }
7434
7436 {
7438 if (!is_being_placed)
7440 SetSynchDirty();
7441 }
7442
7443
7445
7447 {
7449 }
7450
7452 {
7454 }
7455
7457 {
7458 return 1;
7459 }
7460
7462 {
7463 return false;
7464 }
7465
7467 {
7469 SetSynchDirty();
7470 }
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7507 {
7508 super.OnMovedInsideCargo(container);
7509
7510 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7511 }
7512
7513 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7514 {
7515 super.EEItemLocationChanged(oldLoc,newLoc);
7516
7517 PlayerBase new_player = null;
7518 PlayerBase old_player = null;
7519
7520 if (newLoc.GetParent())
7521 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7522
7523 if (oldLoc.GetParent())
7524 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7525
7527 {
7528 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7529
7530 if (r_index >= 0)
7531 {
7532 InventoryLocation r_il = new InventoryLocation;
7533 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7534
7535 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7538 {
7539 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7540 }
7542 {
7543 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7544 }
7545
7546 }
7547 }
7548
7550 {
7551 if (new_player)
7552 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7553
7554 if (new_player == old_player)
7555 {
7556
7557 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7558 {
7560 {
7561 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7562 {
7563 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7564 }
7565 }
7566 else
7567 {
7568 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7569 }
7570 }
7571
7572 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7573 {
7574 int type = oldLoc.GetType();
7576 {
7577 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7578 }
7580 {
7581 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7582 }
7583 }
7584 if (!m_OldLocation)
7585 {
7586 m_OldLocation = new InventoryLocation;
7587 }
7588 m_OldLocation.Copy(oldLoc);
7589 }
7590 else
7591 {
7592 if (m_OldLocation)
7593 {
7594 m_OldLocation.Reset();
7595 }
7596 }
7597
7599 }
7600 else
7601 {
7602 if (new_player)
7603 {
7604 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7605 if (res_index >= 0)
7606 {
7607 InventoryLocation il = new InventoryLocation;
7608 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7610 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7613 {
7614 il.
GetParent().GetOnReleaseLock().Invoke(it);
7615 }
7617 {
7619 }
7620
7621 }
7622 }
7624 {
7625
7627 }
7628
7629 if (m_OldLocation)
7630 {
7631 m_OldLocation.Reset();
7632 }
7633 }
7634 }
7635
7636 override void EOnContact(IEntity other, Contact extra)
7637 {
7639 {
7640 int liquidType = -1;
7642 if (impactSpeed > 0.0)
7643 {
7645 #ifndef SERVER
7647 #else
7649 SetSynchDirty();
7650 #endif
7652 }
7653 }
7654
7655 #ifdef SERVER
7656 if (GetCompEM() && GetCompEM().IsPlugged())
7657 {
7658 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7659 GetCompEM().UnplugThis();
7660 }
7661 #endif
7662 }
7663
7665
7667 {
7669 }
7670
7672 {
7673
7674 }
7675
7677 {
7678 super.OnItemLocationChanged(old_owner, new_owner);
7679
7680 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7681 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7682
7683 if (!relatedPlayer && playerNew)
7684 relatedPlayer = playerNew;
7685
7686 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7687 {
7689 if (actionMgr)
7690 {
7691 ActionBase currentAction = actionMgr.GetRunningAction();
7692 if (currentAction)
7694 }
7695 }
7696
7697 Man ownerPlayerOld = null;
7698 Man ownerPlayerNew = null;
7699
7700 if (old_owner)
7701 {
7702 if (old_owner.
IsMan())
7703 {
7704 ownerPlayerOld = Man.Cast(old_owner);
7705 }
7706 else
7707 {
7708 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7709 }
7710 }
7711 else
7712 {
7714 {
7716
7717 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7718 {
7719 GetCompEM().UnplugThis();
7720 }
7721 }
7722 }
7723
7724 if (new_owner)
7725 {
7726 if (new_owner.
IsMan())
7727 {
7728 ownerPlayerNew = Man.Cast(new_owner);
7729 }
7730 else
7731 {
7732 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7733 }
7734 }
7735
7736 if (ownerPlayerOld != ownerPlayerNew)
7737 {
7738 if (ownerPlayerOld)
7739 {
7740 array<EntityAI> subItemsExit = new array<EntityAI>;
7742 for (int i = 0; i < subItemsExit.Count(); i++)
7743 {
7746 }
7747 }
7748
7749 if (ownerPlayerNew)
7750 {
7751 array<EntityAI> subItemsEnter = new array<EntityAI>;
7753 for (int j = 0; j < subItemsEnter.Count(); j++)
7754 {
7757 }
7758 }
7759 }
7760 else if (ownerPlayerNew != null)
7761 {
7762 PlayerBase nplayer;
7763 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7764 {
7765 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7767 for (int k = 0; k < subItemsUpdate.Count(); k++)
7768 {
7770 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7771 }
7772 }
7773 }
7774
7775 if (old_owner)
7776 old_owner.OnChildItemRemoved(this);
7777 if (new_owner)
7778 new_owner.OnChildItemReceived(this);
7779 }
7780
7781
7783 {
7784 super.EEDelete(parent);
7785 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7786 if (player)
7787 {
7789
7790 if (player.IsAlive())
7791 {
7792 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7793 if (r_index >= 0)
7794 {
7795 InventoryLocation r_il = new InventoryLocation;
7796 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7797
7798 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7801 {
7802 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7803 }
7805 {
7806 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7807 }
7808
7809 }
7810
7811 player.RemoveQuickBarEntityShortcut(this);
7812 }
7813 }
7814 }
7815
7817 {
7818 super.EEKilled(killer);
7819
7822 {
7823 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7824 {
7825 if (IsMagazine())
7826 {
7827 if (Magazine.Cast(this).GetAmmoCount() > 0)
7828 {
7830 }
7831 }
7832 else
7833 {
7835 }
7836 }
7837 }
7838 }
7839
7841 {
7842 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7843
7844 super.OnWasAttached(parent, slot_id);
7845
7848
7850 }
7851
7853 {
7854 super.OnWasDetached(parent, slot_id);
7855
7858 }
7859
7861 {
7862 int idx;
7865
7866 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7867 if (inventory_slots.Count() < 1)
7868 {
7869 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7870 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7871 }
7872 else
7873 {
7874 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7875 }
7876
7877 idx = inventory_slots.Find(slot);
7878 if (idx < 0)
7879 return "";
7880
7881 return attach_types.Get(idx);
7882 }
7883
7885 {
7886 int idx = -1;
7887 string slot;
7888
7891
7892 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7893 if (inventory_slots.Count() < 1)
7894 {
7895 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7896 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7897 }
7898 else
7899 {
7900 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7901 if (detach_types.Count() < 1)
7902 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7903 }
7904
7905 for (int i = 0; i < inventory_slots.Count(); i++)
7906 {
7907 slot = inventory_slots.Get(i);
7908 }
7909
7910 if (slot != "")
7911 {
7912 if (detach_types.Count() == 1)
7913 idx = 0;
7914 else
7915 idx = inventory_slots.Find(slot);
7916 }
7917 if (idx < 0)
7918 return "";
7919
7920 return detach_types.Get(idx);
7921 }
7922
7924 {
7925
7927
7928
7929 float min_time = 1;
7930 float max_time = 3;
7931 float delay = Math.RandomFloat(min_time, max_time);
7932
7933 explode_timer.Run(delay, this, "DoAmmoExplosion");
7934 }
7935
7937 {
7938 Magazine magazine = Magazine.Cast(this);
7939 int pop_sounds_count = 6;
7940 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7941
7942
7943 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7944 string sound_name = pop_sounds[ sound_idx ];
7946
7947
7948 magazine.ServerAddAmmoCount(-1);
7949
7950
7951 float min_temp_to_explode = 100;
7952
7953 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7954 {
7956 }
7957 }
7958
7959
7960 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7961 {
7962 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7963
7964 const int CHANCE_DAMAGE_CARGO = 4;
7965 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7966 const int CHANCE_DAMAGE_NOTHING = 2;
7967
7969 {
7970 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7971 int chances;
7972 int rnd;
7973
7974 if (GetInventory().GetCargo())
7975 {
7976 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7977 rnd = Math.RandomInt(0,chances);
7978
7979 if (rnd < CHANCE_DAMAGE_CARGO)
7980 {
7982 }
7983 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7984 {
7986 }
7987 }
7988 else
7989 {
7990 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7991 rnd = Math.RandomInt(0,chances);
7992
7993 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7994 {
7996 }
7997 }
7998 }
7999 }
8000
8002 {
8003 if (GetInventory().GetCargo())
8004 {
8005 int item_count = GetInventory().GetCargo().GetItemCount();
8006 if (item_count > 0)
8007 {
8008 int random_pick = Math.RandomInt(0, item_count);
8010 if (!item.IsExplosive())
8011 {
8012 item.AddHealth("","",damage);
8013 return true;
8014 }
8015 }
8016 }
8017 return false;
8018 }
8019
8021 {
8022 int attachment_count = GetInventory().AttachmentCount();
8023 if (attachment_count > 0)
8024 {
8025 int random_pick = Math.RandomInt(0, attachment_count);
8026 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8027 if (!attachment.IsExplosive())
8028 {
8029 attachment.AddHealth("","",damage);
8030 return true;
8031 }
8032 }
8033 return false;
8034 }
8035
8037 {
8039 }
8040
8042 {
8044 return GetInventory().CanRemoveEntity();
8045
8046 return false;
8047 }
8048
8050 {
8052 return;
8053
8055 {
8056 if (ScriptInputUserData.CanStoreInputUserData())
8057 {
8058 ScriptInputUserData ctx = new ScriptInputUserData;
8063 ctx.
Write(destination_entity);
8067 }
8068 }
8069 else if (!
GetGame().IsMultiplayer())
8070 {
8072 }
8073 }
8074
8076 {
8078 return;
8079
8080 float split_quantity_new;
8084 InventoryLocation loc = new InventoryLocation;
8085
8086 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8087 {
8089 split_quantity_new = stack_max;
8090 else
8092
8093 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8094 if (new_item)
8095 {
8096 new_item.SetResultOfSplit(true);
8097 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8099 new_item.SetQuantity(split_quantity_new);
8100 }
8101 }
8102 else if (destination_entity && slot_id == -1)
8103 {
8104 if (quantity > stack_max)
8105 split_quantity_new = stack_max;
8106 else
8107 split_quantity_new = quantity;
8108
8110 {
8113 }
8114
8115 if (new_item)
8116 {
8117 new_item.SetResultOfSplit(true);
8118 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8120 new_item.SetQuantity(split_quantity_new);
8121 }
8122 }
8123 else
8124 {
8125 if (stack_max != 0)
8126 {
8128 {
8130 }
8131
8132 if (split_quantity_new == 0)
8133 {
8134 if (!
GetGame().IsMultiplayer())
8135 player.PhysicalPredictiveDropItem(this);
8136 else
8137 player.ServerDropEntity(this);
8138 return;
8139 }
8140
8142
8143 if (new_item)
8144 {
8145 new_item.SetResultOfSplit(true);
8146 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8148 new_item.SetQuantity(stack_max);
8149 new_item.PlaceOnSurface();
8150 }
8151 }
8152 }
8153 }
8154
8156 {
8158 return;
8159
8160 float split_quantity_new;
8164 InventoryLocation loc = new InventoryLocation;
8165
8166 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8167 {
8169 split_quantity_new = stack_max;
8170 else
8172
8173 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8174 if (new_item)
8175 {
8176 new_item.SetResultOfSplit(true);
8177 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8179 new_item.SetQuantity(split_quantity_new);
8180 }
8181 }
8182 else if (destination_entity && slot_id == -1)
8183 {
8184 if (quantity > stack_max)
8185 split_quantity_new = stack_max;
8186 else
8187 split_quantity_new = quantity;
8188
8190 {
8193 }
8194
8195 if (new_item)
8196 {
8197 new_item.SetResultOfSplit(true);
8198 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8200 new_item.SetQuantity(split_quantity_new);
8201 }
8202 }
8203 else
8204 {
8205 if (stack_max != 0)
8206 {
8208 {
8210 }
8211
8213
8214 if (new_item)
8215 {
8216 new_item.SetResultOfSplit(true);
8217 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8219 new_item.SetQuantity(stack_max);
8220 new_item.PlaceOnSurface();
8221 }
8222 }
8223 }
8224 }
8225
8227 {
8229 return;
8230
8232 {
8233 if (ScriptInputUserData.CanStoreInputUserData())
8234 {
8235 ScriptInputUserData ctx = new ScriptInputUserData;
8240 dst.WriteToContext(ctx);
8242 }
8243 }
8244 else if (!
GetGame().IsMultiplayer())
8245 {
8247 }
8248 }
8249
8251 {
8253 return;
8254
8256 {
8257 if (ScriptInputUserData.CanStoreInputUserData())
8258 {
8259 ScriptInputUserData ctx = new ScriptInputUserData;
8264 ctx.
Write(destination_entity);
8270 }
8271 }
8272 else if (!
GetGame().IsMultiplayer())
8273 {
8275 }
8276 }
8277
8279 {
8281 }
8282
8284 {
8286 return this;
8287
8289 float split_quantity_new;
8291 if (dst.IsValid())
8292 {
8293 int slot_id = dst.GetSlot();
8295
8296 if (quantity > stack_max)
8297 split_quantity_new = stack_max;
8298 else
8299 split_quantity_new = quantity;
8300
8302
8303 if (new_item)
8304 {
8305 new_item.SetResultOfSplit(true);
8306 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8309 }
8310
8311 return new_item;
8312 }
8313
8314 return null;
8315 }
8316
8318 {
8320 return;
8321
8323 float split_quantity_new;
8325 if (destination_entity)
8326 {
8328 if (quantity > stackable)
8329 split_quantity_new = stackable;
8330 else
8331 split_quantity_new = quantity;
8332
8333 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8334 if (new_item)
8335 {
8336 new_item.SetResultOfSplit(true);
8337 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8339 new_item.SetQuantity(split_quantity_new);
8340 }
8341 }
8342 }
8343
8345 {
8347 return;
8348
8350 {
8351 if (ScriptInputUserData.CanStoreInputUserData())
8352 {
8353 ScriptInputUserData ctx = new ScriptInputUserData;
8358 ItemBase destination_entity =
this;
8359 ctx.
Write(destination_entity);
8363 }
8364 }
8365 else if (!
GetGame().IsMultiplayer())
8366 {
8368 }
8369 }
8370
8372 {
8374 return;
8375
8377 float split_quantity_new;
8379 if (player)
8380 {
8382 if (quantity > stackable)
8383 split_quantity_new = stackable;
8384 else
8385 split_quantity_new = quantity;
8386
8387 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8388 new_item =
ItemBase.Cast(in_hands);
8389 if (new_item)
8390 {
8391 new_item.SetResultOfSplit(true);
8392 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8394 new_item.SetQuantity(split_quantity_new);
8395 }
8396 }
8397 }
8398
8400 {
8402 return;
8403
8405 float split_quantity_new = Math.Floor(quantity * 0.5);
8406
8408
8409 if (new_item)
8410 {
8411 if (new_item.GetQuantityMax() < split_quantity_new)
8412 {
8413 split_quantity_new = new_item.GetQuantityMax();
8414 }
8415
8416 new_item.SetResultOfSplit(true);
8417 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8418
8420 {
8423 }
8424 else
8425 {
8428 }
8429 }
8430 }
8431
8433 {
8435 return;
8436
8438 float split_quantity_new = Math.Floor(quantity / 2);
8439
8440 InventoryLocation invloc = new InventoryLocation;
8442
8444 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8445
8446 if (new_item)
8447 {
8448 if (new_item.GetQuantityMax() < split_quantity_new)
8449 {
8450 split_quantity_new = new_item.GetQuantityMax();
8451 }
8453 {
8456 }
8457 else
8458 {
8461 }
8462 }
8463 }
8464
8467 {
8468 SetWeightDirty();
8470
8471 if (parent)
8472 parent.OnAttachmentQuantityChangedEx(this, delta);
8473
8475 {
8477 {
8479 }
8481 {
8482 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8484 }
8485 }
8486
8487 }
8488
8491 {
8492
8493 }
8494
8497 {
8499 }
8500
8502 {
8503 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8504
8506 {
8507 if (newLevel == GameConstants.STATE_RUINED)
8508 {
8510 EntityAI parent = GetHierarchyParent();
8511 if (parent && parent.IsFireplace())
8512 {
8513 CargoBase cargo = GetInventory().GetCargo();
8514 if (cargo)
8515 {
8517 {
8519 }
8520 }
8521 }
8522 }
8523
8525 {
8526
8528 return;
8529 }
8530
8531 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8532 {
8534 }
8535 }
8536 }
8537
8538
8540 {
8541 super.OnRightClick();
8542
8544 {
8546 {
8547 if (ScriptInputUserData.CanStoreInputUserData())
8548 {
8549 vector m4[4];
8551
8552 EntityAI root = GetHierarchyRoot();
8553
8554 InventoryLocation dst = new InventoryLocation;
8556 {
8557 if (root)
8558 {
8559 root.GetTransform(m4);
8561 }
8562 else
8563 GetInventory().GetCurrentInventoryLocation(dst);
8564 }
8565 else
8566 {
8568
8569
8570 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8571 {
8572 if (root)
8573 {
8574 root.GetTransform(m4);
8576 }
8577 else
8578 GetInventory().GetCurrentInventoryLocation(dst);
8579 }
8580 else
8581 {
8582 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8583 }
8584 }
8585
8586 ScriptInputUserData ctx = new ScriptInputUserData;
8594 }
8595 }
8596 else if (!
GetGame().IsMultiplayer())
8597 {
8599 }
8600 }
8601 }
8602
8603 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8604 {
8605
8606 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8607 return false;
8608
8609 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8610 return false;
8611
8612
8614 return false;
8615
8616
8617 Magazine mag = Magazine.Cast(this);
8618 if (mag)
8619 {
8620 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8621 return false;
8622
8623 if (stack_max_limit)
8624 {
8625 Magazine other_mag = Magazine.Cast(other_item);
8626 if (other_item)
8627 {
8628 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8629 return false;
8630 }
8631
8632 }
8633 }
8634 else
8635 {
8636
8638 return false;
8639
8641 return false;
8642 }
8643
8644 PlayerBase player = null;
8645 if (CastTo(player, GetHierarchyRootPlayer()))
8646 {
8647 if (player.GetInventory().HasAttachment(this))
8648 return false;
8649
8650 if (player.IsItemsToDelete())
8651 return false;
8652 }
8653
8654 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8655 return false;
8656
8657 int slotID;
8659 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8660 return false;
8661
8662 return true;
8663 }
8664
8666 {
8668 }
8669
8671 {
8672 return m_IsResultOfSplit;
8673 }
8674
8676 {
8677 m_IsResultOfSplit = value;
8678 }
8679
8681 {
8683 }
8684
8686 {
8687 float other_item_quantity = other_item.GetQuantity();
8688 float this_free_space;
8689
8691
8693
8694 if (other_item_quantity > this_free_space)
8695 {
8696 return this_free_space;
8697 }
8698 else
8699 {
8700 return other_item_quantity;
8701 }
8702 }
8703
8705 {
8707 }
8708
8710 {
8712 return;
8713
8714 if (!IsMagazine() && other_item)
8715 {
8717 if (quantity_used != 0)
8718 {
8719 float hp1 = GetHealth01("","");
8720 float hp2 = other_item.GetHealth01("","");
8721 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8722 hpResult = hpResult / (
GetQuantity() + quantity_used);
8723
8724 hpResult *= GetMaxHealth();
8725 Math.Round(hpResult);
8726 SetHealth("", "Health", hpResult);
8727
8729 other_item.AddQuantity(-quantity_used);
8730 }
8731 }
8733 }
8734
8736 {
8737 #ifdef SERVER
8738 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8739 GetHierarchyParent().IncreaseLifetimeUp();
8740 #endif
8741 };
8742
8744 {
8745 PlayerBase p = PlayerBase.Cast(player);
8746
8747 array<int> recipesIds = p.m_Recipes;
8748 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8749 if (moduleRecipesManager)
8750 {
8751 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8752 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8753 }
8754
8755 for (int i = 0;i < recipesIds.Count(); i++)
8756 {
8757 int key = recipesIds.Get(i);
8758 string recipeName = moduleRecipesManager.GetRecipeName(key);
8760 }
8761 }
8762
8763
8764 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8765 {
8766 super.GetDebugActions(outputList);
8767
8768
8773
8774
8778
8782
8783
8786
8787
8789 {
8792 }
8793
8795
8798
8802 }
8803
8804
8805
8806
8808 {
8809 super.OnAction(action_id, player, ctx);
8810 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8811 {
8812 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8813 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8814 PlayerBase p = PlayerBase.Cast(player);
8815 if (
EActions.RECIPES_RANGE_START < 1000)
8816 {
8817 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8818 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8819 }
8820 }
8821 #ifndef SERVER
8822 else if (action_id ==
EActions.WATCH_PLAYER)
8823 {
8824 PluginDeveloper.SetDeveloperItemClientEx(player);
8825 }
8826 #endif
8828 {
8829 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8830 {
8831 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8832 OnDebugButtonPressServer(id + 1);
8833 }
8834
8835 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8836 {
8837 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8839 }
8840
8841 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8842 {
8843 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8845 }
8846
8847 else if (action_id ==
EActions.ADD_QUANTITY)
8848 {
8849 if (IsMagazine())
8850 {
8851 Magazine mag = Magazine.Cast(this);
8852 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8853 }
8854 else
8855 {
8857 }
8858
8859 if (m_EM)
8860 {
8861 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8862 }
8863
8864 }
8865
8866 else if (action_id ==
EActions.REMOVE_QUANTITY)
8867 {
8868 if (IsMagazine())
8869 {
8870 Magazine mag2 = Magazine.Cast(this);
8871 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8872 }
8873 else
8874 {
8876 }
8877 if (m_EM)
8878 {
8879 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8880 }
8881
8882 }
8883
8884 else if (action_id ==
EActions.SET_QUANTITY_0)
8885 {
8887
8888 if (m_EM)
8889 {
8890 m_EM.SetEnergy(0);
8891 }
8892 }
8893
8894 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8895 {
8897
8898 if (m_EM)
8899 {
8900 m_EM.SetEnergy(m_EM.GetEnergyMax());
8901 }
8902 }
8903
8904 else if (action_id ==
EActions.ADD_HEALTH)
8905 {
8906 AddHealth("","",GetMaxHealth("","Health")/5);
8907 }
8908 else if (action_id ==
EActions.REMOVE_HEALTH)
8909 {
8910 AddHealth("","",-GetMaxHealth("","Health")/5);
8911 }
8912 else if (action_id ==
EActions.DESTROY_HEALTH)
8913 {
8914 SetHealth01("","",0);
8915 }
8916 else if (action_id ==
EActions.WATCH_ITEM)
8917 {
8919 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8920 #ifdef DEVELOPER
8921 SetDebugDeveloper_item(this);
8922 #endif
8923 }
8924
8925 else if (action_id ==
EActions.ADD_TEMPERATURE)
8926 {
8927 AddTemperature(20);
8928
8929 }
8930
8931 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8932 {
8933 AddTemperature(-20);
8934
8935 }
8936
8937 else if (action_id ==
EActions.FLIP_FROZEN)
8938 {
8939 SetFrozen(!GetIsFrozen());
8940
8941 }
8942
8943 else if (action_id ==
EActions.ADD_WETNESS)
8944 {
8946
8947 }
8948
8949 else if (action_id ==
EActions.REMOVE_WETNESS)
8950 {
8952
8953 }
8954
8955 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8956 {
8959
8960
8961 }
8962
8963 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8964 {
8967 }
8968
8969 else if (action_id ==
EActions.MAKE_SPECIAL)
8970 {
8971 auto debugParams = DebugSpawnParams.WithPlayer(player);
8972 OnDebugSpawnEx(debugParams);
8973 }
8974
8975 else if (action_id ==
EActions.DELETE)
8976 {
8977 Delete();
8978 }
8979
8980 }
8981
8982
8983 return false;
8984 }
8985
8986
8987
8988
8992
8995
8996
8997
8999 {
9000 return false;
9001 }
9002
9003
9005 {
9006 return true;
9007 }
9008
9009
9011 {
9012 return true;
9013 }
9014
9015
9016
9018 {
9019 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9021 }
9022
9025 {
9026 return null;
9027 }
9028
9030 {
9031 return false;
9032 }
9033
9035 {
9036 return false;
9037 }
9038
9042
9043
9045 {
9046 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9047 return module_repairing.CanRepair(this, item_repair_kit);
9048 }
9049
9050
9051 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9052 {
9053 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9054 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9055 }
9056
9057
9059 {
9060
9061
9062
9063
9064
9065
9066
9067
9068 return 1;
9069 }
9070
9071
9072
9074 {
9076 }
9077
9078
9079
9081 {
9083 }
9084
9085
9094 {
9095 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9096
9097 if (player)
9098 {
9099 player.MessageStatus(text);
9100 }
9101 }
9102
9103
9112 {
9113 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9114
9115 if (player)
9116 {
9117 player.MessageAction(text);
9118 }
9119 }
9120
9121
9130 {
9131 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9132
9133 if (player)
9134 {
9135 player.MessageFriendly(text);
9136 }
9137 }
9138
9139
9148 {
9149 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9150
9151 if (player)
9152 {
9153 player.MessageImportant(text);
9154 }
9155 }
9156
9158 {
9159 return true;
9160 }
9161
9162
9163 override bool KindOf(
string tag)
9164 {
9165 bool found = false;
9166 string item_name = this.
GetType();
9169
9170 int array_size = item_tag_array.Count();
9171 for (int i = 0; i < array_size; i++)
9172 {
9173 if (item_tag_array.Get(i) == tag)
9174 {
9175 found = true;
9176 break;
9177 }
9178 }
9179 return found;
9180 }
9181
9182
9184 {
9185
9186 super.OnRPC(sender, rpc_type,ctx);
9187
9188
9189 switch (rpc_type)
9190 {
9191 #ifndef SERVER
9192 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9193 Param2<bool, string> p = new Param2<bool, string>(false, "");
9194
9196 return;
9197
9198 bool play = p.param1;
9199 string soundSet = p.param2;
9200
9201 if (play)
9202 {
9204 {
9206 {
9208 }
9209 }
9210 else
9211 {
9213 }
9214 }
9215 else
9216 {
9218 }
9219
9220 break;
9221 #endif
9222
9223 }
9224
9226 {
9228 }
9229 }
9230
9231
9232
9233
9235 {
9236 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9237 return plugin.GetID(
name);
9238 }
9239
9241 {
9242 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9243 return plugin.GetName(id);
9244 }
9245
9248 {
9249
9250
9251 int varFlags;
9252 if (!ctx.
Read(varFlags))
9253 return;
9254
9255 if (varFlags & ItemVariableFlags.FLOAT)
9256 {
9258 }
9259 }
9260
9262 {
9263
9264 super.SerializeNumericalVars(floats_out);
9265
9266
9267
9269 {
9271 }
9272
9274 {
9276 }
9277
9279 {
9281 }
9282
9284 {
9289 }
9290
9292 {
9294 }
9295 }
9296
9298 {
9299
9300 super.DeSerializeNumericalVars(floats);
9301
9302
9303 int index = 0;
9304 int mask = Math.Round(floats.Get(index));
9305
9306 index++;
9307
9309 {
9311 {
9313 }
9314 else
9315 {
9316 float quantity = floats.Get(index);
9318 }
9319 index++;
9320 }
9321
9323 {
9324 float wet = floats.Get(index);
9326 index++;
9327 }
9328
9330 {
9331 int liquidtype = Math.Round(floats.Get(index));
9333 index++;
9334 }
9335
9337 {
9339 index++;
9341 index++;
9343 index++;
9345 index++;
9346 }
9347
9349 {
9350 int cleanness = Math.Round(floats.Get(index));
9352 index++;
9353 }
9354 }
9355
9357 {
9358 super.WriteVarsToCTX(ctx);
9359
9360
9362 {
9364 }
9365
9367 {
9369 }
9370
9372 {
9374 }
9375
9377 {
9378 int r,g,b,a;
9384 }
9385
9387 {
9389 }
9390 }
9391
9393 {
9394 if (!super.ReadVarsFromCTX(ctx,version))
9395 return false;
9396
9397 int intValue;
9398 float value;
9399
9400 if (version < 140)
9401 {
9402 if (!ctx.
Read(intValue))
9403 return false;
9404
9405 m_VariablesMask = intValue;
9406 }
9407
9409 {
9410 if (!ctx.
Read(value))
9411 return false;
9412
9414 {
9416 }
9417 else
9418 {
9420 }
9421 }
9422
9423 if (version < 140)
9424 {
9426 {
9427 if (!ctx.
Read(value))
9428 return false;
9429 SetTemperatureDirect(value);
9430 }
9431 }
9432
9434 {
9435 if (!ctx.
Read(value))
9436 return false;
9438 }
9439
9441 {
9442 if (!ctx.
Read(intValue))
9443 return false;
9445 }
9446
9448 {
9449 int r,g,b,a;
9451 return false;
9453 return false;
9455 return false;
9457 return false;
9458
9460 }
9461
9463 {
9464 if (!ctx.
Read(intValue))
9465 return false;
9467 }
9468
9469 if (version >= 138 && version < 140)
9470 {
9472 {
9473 if (!ctx.
Read(intValue))
9474 return false;
9475 SetFrozen(intValue);
9476 }
9477 }
9478
9479 return true;
9480 }
9481
9482
9484 {
9487 {
9489 }
9490
9491 if (!super.OnStoreLoad(ctx, version))
9492 {
9494 return false;
9495 }
9496
9497 if (version >= 114)
9498 {
9499 bool hasQuickBarIndexSaved;
9500
9501 if (!ctx.
Read(hasQuickBarIndexSaved))
9502 {
9504 return false;
9505 }
9506
9507 if (hasQuickBarIndexSaved)
9508 {
9509 int itmQBIndex;
9510
9511
9512 if (!ctx.
Read(itmQBIndex))
9513 {
9515 return false;
9516 }
9517
9518 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9519 if (itmQBIndex != -1 && parentPlayer)
9520 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9521 }
9522 }
9523 else
9524 {
9525
9526 PlayerBase player;
9527 int itemQBIndex;
9528 if (version ==
int.
MAX)
9529 {
9530 if (!ctx.
Read(itemQBIndex))
9531 {
9533 return false;
9534 }
9535 }
9536 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9537 {
9538
9539 if (!ctx.
Read(itemQBIndex))
9540 {
9542 return false;
9543 }
9544 if (itemQBIndex != -1 && player)
9545 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9546 }
9547 }
9548
9549 if (version < 140)
9550 {
9551
9552 if (!LoadVariables(ctx, version))
9553 {
9555 return false;
9556 }
9557 }
9558
9559
9561 {
9563 return false;
9564 }
9565 if (version >= 132)
9566 {
9568 if (raib)
9569 {
9571 {
9573 return false;
9574 }
9575 }
9576 }
9577
9579 return true;
9580 }
9581
9582
9583
9585 {
9586 super.OnStoreSave(ctx);
9587
9588 PlayerBase player;
9589 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9590 {
9592
9593 int itemQBIndex = -1;
9594 itemQBIndex = player.FindQuickBarEntityIndex(this);
9595 ctx.
Write(itemQBIndex);
9596 }
9597 else
9598 {
9600 }
9601
9603
9605 if (raib)
9606 {
9608 }
9609 }
9610
9611
9613 {
9614 super.AfterStoreLoad();
9615
9617 {
9619 }
9620
9622 {
9625 }
9626 }
9627
9629 {
9630 super.EEOnAfterLoad();
9631
9633 {
9635 }
9636
9639 }
9640
9642 {
9643 return false;
9644 }
9645
9646
9647
9649 {
9651 {
9652 #ifdef PLATFORM_CONSOLE
9653
9655 {
9657 if (menu)
9658 {
9660 }
9661 }
9662 #endif
9663 }
9664
9666 {
9669 }
9670
9672 {
9673 SetWeightDirty();
9675 }
9677 {
9680 }
9681
9683 {
9686 }
9688 {
9691 }
9692
9693 super.OnVariablesSynchronized();
9694 }
9695
9696
9697
9699 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9700 {
9701 if (!IsServerCheck(allow_client))
9702 return false;
9703
9705 return false;
9706
9709
9710 if (value <= (min + 0.001))
9711 value = min;
9712
9713 if (value == min)
9714 {
9715 if (destroy_config)
9716 {
9717 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9718 if (dstr)
9719 {
9721 this.Delete();
9722 return true;
9723 }
9724 }
9725 else if (destroy_forced)
9726 {
9728 this.Delete();
9729 return true;
9730 }
9731
9733 }
9734
9737
9739 {
9741
9742 if (delta)
9744 }
9745
9747
9748 return false;
9749 }
9750
9751
9753 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9754 {
9756 }
9757
9759 {
9762 }
9763
9765 {
9768 }
9769
9772 {
9773 float value_clamped = Math.Clamp(value, 0, 1);
9775 SetQuantity(result, destroy_config, destroy_forced);
9776 }
9777
9778
9781 {
9783 }
9784
9786 {
9788 }
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9800 {
9801 int slot = -1;
9802 if (GetInventory())
9803 {
9804 InventoryLocation il = new InventoryLocation;
9805 GetInventory().GetCurrentInventoryLocation(il);
9807 }
9808
9810 }
9811
9813 {
9814 float quantity_max = 0;
9815
9817 {
9818 if (attSlotID != -1)
9819 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9820
9821 if (quantity_max <= 0)
9823 }
9824
9825 if (quantity_max <= 0)
9827
9828 return quantity_max;
9829 }
9830
9832 {
9834 }
9835
9837 {
9839 }
9840
9841
9843 {
9845 }
9846
9848 {
9850 }
9851
9853 {
9855 }
9856
9857
9859 {
9860
9861 float weightEx = GetWeightEx();
9862 float special = GetInventoryAndCargoWeight();
9863 return weightEx - special;
9864 }
9865
9866
9868 {
9870 }
9871
9873 {
9875 {
9876 #ifdef DEVELOPER
9877 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9878 {
9879 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9881 }
9882 #endif
9883
9885 }
9886 else if (HasEnergyManager())
9887 {
9888 #ifdef DEVELOPER
9889 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9890 {
9891 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9892 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9893 }
9894 #endif
9895 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9896 }
9897 else
9898 {
9899 #ifdef DEVELOPER
9900 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9901 {
9902 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9903 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9904 }
9905 #endif
9906 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9907 }
9908 }
9909
9912 {
9913 int item_count = 0;
9915
9916 if (GetInventory().GetCargo() != NULL)
9917 {
9918 item_count = GetInventory().GetCargo().GetItemCount();
9919 }
9920
9921 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9922 {
9923 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9924 if (item)
9925 item_count += item.GetNumberOfItems();
9926 }
9927 return item_count;
9928 }
9929
9932 {
9933 float weight = 0;
9934 float wetness = 1;
9935 if (include_wetness)
9938 {
9939 weight = wetness * m_ConfigWeight;
9940 }
9942 {
9943 weight = 1;
9944 }
9945 return weight;
9946 }
9947
9948
9949
9951 {
9952 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9953 {
9954 GameInventory inv = GetInventory();
9955 array<EntityAI> items = new array<EntityAI>;
9957 for (int i = 0; i < items.Count(); i++)
9958 {
9960 if (item)
9961 {
9963 }
9964 }
9965 }
9966 }
9967
9968
9969
9970
9972 {
9973 float energy = 0;
9974 if (HasEnergyManager())
9975 {
9976 energy = GetCompEM().GetEnergy();
9977 }
9978 return energy;
9979 }
9980
9981
9983 {
9984 super.OnEnergyConsumed();
9985
9987 }
9988
9990 {
9991 super.OnEnergyAdded();
9992
9994 }
9995
9996
9998 {
9999 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10000 {
10002 {
10003 float energy_0to1 = GetCompEM().GetEnergy0To1();
10005 }
10006 }
10007 }
10008
10009
10011 {
10012 return ConfigGetFloat("heatIsolation");
10013 }
10014
10016 {
10018 }
10019
10021 {
10022 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10023 if (
GetGame().ConfigIsExisting(paramPath))
10025
10026 return 0.0;
10027 }
10028
10030 {
10031 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10032 if (
GetGame().ConfigIsExisting(paramPath))
10034
10035 return 0.0;
10036 }
10037
10038 override void SetWet(
float value,
bool allow_client =
false)
10039 {
10040 if (!IsServerCheck(allow_client))
10041 return;
10042
10045
10047
10048 m_VarWet = Math.Clamp(value, min, max);
10049
10051 {
10054 }
10055 }
10056
10057 override void AddWet(
float value)
10058 {
10060 }
10061
10063 {
10065 }
10066
10068 {
10070 }
10071
10073 {
10075 }
10076
10078 {
10080 }
10081
10083 {
10085 }
10086
10087 override void OnWetChanged(
float newVal,
float oldVal)
10088 {
10091 if (newLevel != oldLevel)
10092 {
10094 }
10095 }
10096
10098 {
10099 SetWeightDirty();
10100 }
10101
10103 {
10104 return GetWetLevelInternal(
m_VarWet);
10105 }
10106
10107
10108
10110 {
10112 }
10113
10115 {
10117 }
10118
10120 {
10122 }
10123
10125 {
10127 }
10128
10129
10130
10132 {
10133 if (ConfigIsExisting("itemModelLength"))
10134 {
10135 return ConfigGetFloat("itemModelLength");
10136 }
10137 return 0;
10138 }
10139
10141 {
10142 if (ConfigIsExisting("itemAttachOffset"))
10143 {
10144 return ConfigGetFloat("itemAttachOffset");
10145 }
10146 return 0;
10147 }
10148
10149 override void SetCleanness(
int value,
bool allow_client =
false)
10150 {
10151 if (!IsServerCheck(allow_client))
10152 return;
10153
10155
10157
10160 }
10161
10163 {
10165 }
10166
10168 {
10169 return true;
10170 }
10171
10172
10173
10174
10176 {
10178 }
10179
10181 {
10183 }
10184
10185
10186
10187
10188 override void SetColor(
int r,
int g,
int b,
int a)
10189 {
10195 }
10197 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10198 {
10203 }
10204
10206 {
10208 }
10209
10212 {
10213 int r,g,b,a;
10215 r = r/255;
10216 g = g/255;
10217 b = b/255;
10218 a = a/255;
10219 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10220 }
10221
10222
10223
10224 override void SetLiquidType(
int value,
bool allow_client =
false)
10225 {
10226 if (!IsServerCheck(allow_client))
10227 return;
10228
10233 }
10234
10236 {
10237 return ConfigGetInt("varLiquidTypeInit");
10238 }
10239
10241 {
10243 }
10244
10246 {
10248 SetFrozen(false);
10249 }
10250
10253 {
10254 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10255 }
10256
10257
10260 {
10261 PlayerBase nplayer;
10262 if (PlayerBase.CastTo(nplayer, player))
10263 {
10265
10266 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10267 }
10268 }
10269
10270
10273 {
10274 PlayerBase nplayer;
10275 if (PlayerBase.CastTo(nplayer,player))
10276 {
10277
10278 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10279
10280 }
10281
10282
10283 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10284
10285
10286 if (HasEnergyManager())
10287 {
10288 GetCompEM().UpdatePlugState();
10289 }
10290 }
10291
10292
10294 {
10295 super.OnPlacementStarted(player);
10296
10298 }
10299
10300 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10301 {
10303 {
10304 m_AdminLog.OnPlacementComplete(player,
this);
10305 }
10306
10307 super.OnPlacementComplete(player, position, orientation);
10308 }
10309
10310
10311
10312
10313
10315 {
10317 {
10318 return true;
10319 }
10320 else
10321 {
10322 return false;
10323 }
10324 }
10325
10326
10328 {
10330 {
10332 }
10333 }
10334
10335
10337 {
10339 }
10340
10342 {
10344 }
10345
10346 override void InsertAgent(
int agent,
float count = 1)
10347 {
10348 if (count < 1)
10349 return;
10350
10352 }
10353
10356 {
10358 }
10359
10360
10362 {
10364 }
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10408 {
10410 return false;
10411 return true;
10412 }
10413
10415 {
10416
10418 }
10419
10420
10423 {
10424 super.CheckForRoofLimited(timeTresholdMS);
10425
10427 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10428 {
10429 m_PreviousRoofTestTime = time;
10430 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10431 }
10432 }
10433
10434
10436 {
10438 {
10439 return 0;
10440 }
10441
10442 if (GetInventory().GetAttachmentSlotsCount() != 0)
10443 {
10444 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10445 if (filter)
10446 return filter.GetProtectionLevel(type, false, system);
10447 else
10448 return 0;
10449 }
10450
10451 string subclassPath, entryName;
10452
10453 switch (type)
10454 {
10456 entryName = "biological";
10457 break;
10459 entryName = "chemical";
10460 break;
10461 default:
10462 entryName = "biological";
10463 break;
10464 }
10465
10466 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10467
10469 }
10470
10471
10472
10475 {
10476 if (!IsMagazine())
10478
10480 }
10481
10482
10483
10484
10485
10490 {
10491 return true;
10492 }
10493
10495 {
10497 }
10498
10499
10500
10501
10502
10504 {
10505 if (parent)
10506 {
10507 if (parent.IsInherited(DayZInfected))
10508 return true;
10509
10510 if (!parent.IsRuined())
10511 return true;
10512 }
10513
10514 return true;
10515 }
10516
10518 {
10519 if (!super.CanPutAsAttachment(parent))
10520 {
10521 return false;
10522 }
10523
10524 if (!IsRuined() && !parent.IsRuined())
10525 {
10526 return true;
10527 }
10528
10529 return false;
10530 }
10531
10533 {
10534
10535
10536
10537
10538 return super.CanReceiveItemIntoCargo(item);
10539 }
10540
10542 {
10543
10544
10545
10546
10547 GameInventory attachmentInv = attachment.GetInventory();
10549 {
10550 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10551 return false;
10552 }
10553
10554 InventoryLocation loc = new InventoryLocation();
10555 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10556 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10557 return false;
10558
10559 return super.CanReceiveAttachment(attachment, slotId);
10560 }
10561
10563 {
10564 if (!super.CanReleaseAttachment(attachment))
10565 return false;
10566
10567 return GetInventory().AreChildrenAccessible();
10568 }
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10591 {
10592 int id = muzzle_owner.GetMuzzleID();
10593 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10594
10595 if (WPOF_array)
10596 {
10597 for (int i = 0; i < WPOF_array.Count(); i++)
10598 {
10599 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10600
10601 if (WPOF)
10602 {
10603 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10604 }
10605 }
10606 }
10607 }
10608
10609
10611 {
10612 int id = muzzle_owner.GetMuzzleID();
10614
10615 if (WPOBE_array)
10616 {
10617 for (int i = 0; i < WPOBE_array.Count(); i++)
10618 {
10619 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10620
10621 if (WPOBE)
10622 {
10623 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10624 }
10625 }
10626 }
10627 }
10628
10629
10631 {
10632 int id = muzzle_owner.GetMuzzleID();
10633 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10634
10635 if (WPOOH_array)
10636 {
10637 for (int i = 0; i < WPOOH_array.Count(); i++)
10638 {
10639 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10640
10641 if (WPOOH)
10642 {
10643 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10644 }
10645 }
10646 }
10647 }
10648
10649
10651 {
10652 int id = muzzle_owner.GetMuzzleID();
10653 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10654
10655 if (WPOOH_array)
10656 {
10657 for (int i = 0; i < WPOOH_array.Count(); i++)
10658 {
10659 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10660
10661 if (WPOOH)
10662 {
10663 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10664 }
10665 }
10666 }
10667 }
10668
10669
10671 {
10672 int id = muzzle_owner.GetMuzzleID();
10673 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10674
10675 if (WPOOH_array)
10676 {
10677 for (int i = 0; i < WPOOH_array.Count(); i++)
10678 {
10679 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10680
10681 if (WPOOH)
10682 {
10683 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10684 }
10685 }
10686 }
10687 }
10688
10689
10690
10692 {
10694 {
10695 return true;
10696 }
10697
10698 return false;
10699 }
10700
10702 {
10704 {
10705 return true;
10706 }
10707
10708 return false;
10709 }
10710
10712 {
10714 {
10715 return true;
10716 }
10717
10718 return false;
10719 }
10720
10722 {
10723 return false;
10724 }
10725
10728 {
10729 return UATimeSpent.DEFAULT_DEPLOY;
10730 }
10731
10732
10733
10734
10736 {
10738 SetSynchDirty();
10739 }
10740
10742 {
10744 }
10745
10746
10748 {
10749 return false;
10750 }
10751
10754 {
10755 string att_type = "None";
10756
10757 if (ConfigIsExisting("soundAttType"))
10758 {
10759 att_type = ConfigGetString("soundAttType");
10760 }
10761
10763 }
10764
10766 {
10768 }
10769
10770
10771
10772
10773
10777
10779 {
10782
10784 }
10785
10786
10788 {
10790 return;
10791
10793
10796
10799
10800 SoundParameters params = new SoundParameters();
10804 }
10805
10806
10808 {
10810 return;
10811
10813 SetSynchDirty();
10814
10817 }
10818
10819
10821 {
10823 return;
10824
10826 SetSynchDirty();
10827
10830 }
10831
10833 {
10835 }
10836
10838 {
10840 }
10841
10844 {
10845 if (!
GetGame().IsDedicatedServer())
10846 {
10847 if (ConfigIsExisting("attachSoundSet"))
10848 {
10849 string cfg_path = "";
10850 string soundset = "";
10851 string type_name =
GetType();
10852
10855 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10856 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10857
10858 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10859 {
10860 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10861 {
10862 if (cfg_slot_array[i] == slot_type)
10863 {
10864 soundset = cfg_soundset_array[i];
10865 break;
10866 }
10867 }
10868 }
10869
10870 if (soundset != "")
10871 {
10872 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10874 }
10875 }
10876 }
10877 }
10878
10880 {
10881
10882 }
10883
10884 void OnApply(PlayerBase player);
10885
10887 {
10888 return 1.0;
10889 };
10890
10892 {
10894 }
10895
10897 {
10899 }
10900
10902
10904 {
10905 SetDynamicPhysicsLifeTime(0.01);
10907 }
10908
10910 {
10911 array<string> zone_names = new array<string>;
10912 GetDamageZones(zone_names);
10913 for (int i = 0; i < zone_names.Count(); i++)
10914 {
10915 SetHealthMax(zone_names.Get(i),"Health");
10916 }
10917 SetHealthMax("","Health");
10918 }
10919
10922 {
10923 float global_health = GetHealth01("","Health");
10924 array<string> zones = new array<string>;
10925 GetDamageZones(zones);
10926
10927 for (int i = 0; i < zones.Count(); i++)
10928 {
10929 SetHealth01(zones.Get(i),"Health",global_health);
10930 }
10931 }
10932
10935 {
10936 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10937 }
10938
10940 {
10941 if (!hasRootAsPlayer)
10942 {
10943 if (refParentIB)
10944 {
10945
10946 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10947 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10948
10949 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10950 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10951
10954 }
10955 else
10956 {
10957
10960 }
10961 }
10962 }
10963
10965 {
10967 {
10968 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10969 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10970 {
10971 float heatPermCoef = 1.0;
10973 while (ent)
10974 {
10975 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10976 ent = ent.GetHierarchyParent();
10977 }
10978
10979 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10980 }
10981 }
10982 }
10983
10985 {
10986
10987 EntityAI parent = GetHierarchyParent();
10988 if (!parent)
10989 {
10990 hasParent = false;
10991 hasRootAsPlayer = false;
10992 }
10993 else
10994 {
10995 hasParent = true;
10996 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10997 refParentIB =
ItemBase.Cast(parent);
10998 }
10999 }
11000
11001 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11002 {
11003
11004 }
11005
11007 {
11008
11009 return false;
11010 }
11011
11013 {
11014
11015
11016 return false;
11017 }
11018
11020 {
11021
11022 return false;
11023 }
11024
11027 {
11028 return !GetIsFrozen() &&
IsOpen();
11029 }
11030
11032 {
11033 bool hasParent = false, hasRootAsPlayer = false;
11035
11036 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11037 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11038
11039 if (wwtu || foodDecay)
11040 {
11044
11045 if (processWetness || processTemperature || processDecay)
11046 {
11048
11049 if (processWetness)
11050 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11051
11052 if (processTemperature)
11054
11055 if (processDecay)
11056 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11057 }
11058 }
11059 }
11060
11063 {
11065 }
11066
11068 {
11071
11072 return super.GetTemperatureFreezeThreshold();
11073 }
11074
11076 {
11079
11080 return super.GetTemperatureThawThreshold();
11081 }
11082
11084 {
11087
11088 return super.GetItemOverheatThreshold();
11089 }
11090
11092 {
11094 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11095
11096 return super.GetTemperatureFreezeTime();
11097 }
11098
11100 {
11102 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11103
11104 return super.GetTemperatureThawTime();
11105 }
11106
11111
11113 {
11114 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11115 }
11116
11118 {
11119 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11120 }
11121
11124 {
11126 }
11127
11129 {
11131 }
11132
11134 {
11136 }
11137
11140 {
11141 return null;
11142 }
11143
11146 {
11147 return false;
11148 }
11149
11151 {
11153 {
11156 if (!trg)
11157 {
11159 explosive = this;
11160 }
11161
11162 explosive.PairRemote(trg);
11164
11165 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11166 trg.SetPersistentPairID(persistentID);
11167 explosive.SetPersistentPairID(persistentID);
11168
11169 return true;
11170 }
11171 return false;
11172 }
11173
11176 {
11177 float ret = 1.0;
11180 ret *= GetHealth01();
11181
11182 return ret;
11183 }
11184
11185 #ifdef DEVELOPER
11186 override void SetDebugItem()
11187 {
11188 super.SetDebugItem();
11189 _itemBase = this;
11190 }
11191
11193 {
11194 string text = super.GetDebugText();
11195
11197 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11198
11199 return text;
11200 }
11201 #endif
11202
11204 {
11205 return true;
11206 }
11207
11209
11211
11213 {
11216 }
11217
11218
11226
11242}
11243
11245{
11247 if (entity)
11248 {
11249 bool is_item = entity.IsInherited(
ItemBase);
11250 if (is_item && full_quantity)
11251 {
11254 }
11255 }
11256 else
11257 {
11259 return NULL;
11260 }
11261 return entity;
11262}
11263
11265{
11266 if (item)
11267 {
11268 if (health > 0)
11269 item.SetHealth("", "", health);
11270
11271 if (item.CanHaveTemperature())
11272 {
11274 if (item.CanFreeze())
11275 item.SetFrozen(false);
11276 }
11277
11278 if (item.HasEnergyManager())
11279 {
11280 if (quantity >= 0)
11281 {
11282 item.GetCompEM().SetEnergy0To1(quantity);
11283 }
11284 else
11285 {
11287 }
11288 }
11289 else if (item.IsMagazine())
11290 {
11291 Magazine mag = Magazine.Cast(item);
11292 if (quantity >= 0)
11293 {
11294 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11295 }
11296 else
11297 {
11299 }
11300
11301 }
11302 else
11303 {
11304 if (quantity >= 0)
11305 {
11306 item.SetQuantityNormalized(quantity, false);
11307 }
11308 else
11309 {
11311 }
11312
11313 }
11314 }
11315}
11316
11317#ifdef DEVELOPER
11319#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.