6537{
6539 {
6540 return true;
6541 }
6542};
6543
6544
6545
6547{
6551
6553
6556
6557
6558
6559
6560
6569
6575
6580
6585
6606 protected bool m_IsResultOfSplit
6607
6609
6614
6615
6616
6618
6622
6623
6624
6626
6629
6630
6631
6637
6638
6646
6649
6650
6652
6653
6655
6656
6661
6662
6667
6668
6670
6671
6673 {
6678
6679 if (!
GetGame().IsDedicatedServer())
6680 {
6682 {
6684
6686 {
6688 }
6689 }
6690
6693 }
6694
6695 m_OldLocation = null;
6696
6698 {
6700 }
6701
6702 if (ConfigIsExisting("headSelectionsToHide"))
6703 {
6706 }
6707
6709 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6710 {
6712 }
6713
6715
6716 m_IsResultOfSplit = false;
6717
6719 }
6720
6722 {
6723 super.InitItemVariables();
6724
6730 m_Count = ConfigGetInt(
"count");
6731
6734
6739
6742
6747
6759
6763
6764
6767 if (ConfigIsExisting("canBeSplit"))
6768 {
6771 }
6772
6774 if (ConfigIsExisting("itemBehaviour"))
6776
6777
6780 RegisterNetSyncVariableInt("m_VarLiquidType");
6781 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6782
6783 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6784 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6785 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6786
6787 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6788 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6789 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6790 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6791
6792 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6793 RegisterNetSyncVariableBool("m_IsTakeable");
6794 RegisterNetSyncVariableBool("m_IsHologram");
6795
6798 {
6801 }
6802
6804
6806 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6808
6809 }
6810
6812 {
6814 }
6815
6817 {
6820 {
6825 }
6826 }
6827
6828 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6829 {
6831 {
6834 }
6835
6837 }
6838
6840 {
6846 }
6847
6849
6851 {
6853
6854 if (!action)
6855 {
6856 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6857 return;
6858 }
6859
6861 if (!ai)
6862 {
6864 return;
6865 }
6866
6868 if (!action_array)
6869 {
6870 action_array = new array<ActionBase_Basic>;
6872 }
6873 if (LogManager.IsActionLogEnable())
6874 {
6875 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6876 }
6877
6878 if (action_array.Find(action) != -1)
6879 {
6880 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6881 }
6882 else
6883 {
6884 action_array.Insert(action);
6885 }
6886 }
6887
6889 {
6891 ActionBase action = player.GetActionManager().GetAction(actionName);
6894
6895 if (action_array)
6896 {
6897 action_array.RemoveItem(action);
6898 }
6899 }
6900
6901
6902
6904 {
6905 ActionOverrideData overrideData = new ActionOverrideData();
6909
6911 if (!actionMap)
6912 {
6915 }
6916
6917 actionMap.Insert(this.
Type(), overrideData);
6918
6919 }
6920
6922
6924
6925
6927 {
6930
6933
6934 string config_to_search = "CfgVehicles";
6935 string muzzle_owner_config;
6936
6938 {
6939 if (IsInherited(Weapon))
6940 config_to_search = "CfgWeapons";
6941
6942 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6943
6944 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6945
6947
6948 if (config_OnFire_subclass_count > 0)
6949 {
6950 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6951
6952 for (int i = 0; i < config_OnFire_subclass_count; i++)
6953 {
6954 string particle_class = "";
6956 string config_OnFire_entry = config_OnFire_class + particle_class;
6957 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6958 WPOF_array.Insert(WPOF);
6959 }
6960
6961
6963 }
6964 }
6965
6967 {
6968 config_to_search = "CfgWeapons";
6969 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6970
6971 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6972
6974
6975 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6976 {
6977 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6978
6979 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6980 {
6981 string particle_class2 = "";
6983 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6984 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6985 WPOBE_array.Insert(WPOBE);
6986 }
6987
6988
6990 }
6991 }
6992 }
6993
6994
6996 {
6999
7001 {
7002 string config_to_search = "CfgVehicles";
7003
7004 if (IsInherited(Weapon))
7005 config_to_search = "CfgWeapons";
7006
7007 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7008 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7009
7010 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7011 {
7012
7014
7016 {
7018 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7020 return;
7021 }
7022
7025
7026
7027
7029 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7030
7031 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7032 {
7033 string particle_class = "";
7035 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7037
7038 if (entry_type == CT_CLASS)
7039 {
7040 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7041 WPOOH_array.Insert(WPOF);
7042 }
7043 }
7044
7045
7047 }
7048 }
7049 }
7050
7052 {
7054 }
7055
7057 {
7059 {
7061
7064
7067
7068 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7069 }
7070 }
7071
7073 {
7075 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7076
7078 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7079
7081 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7082
7084 {
7086 }
7087 }
7088
7090 {
7092 }
7093
7095 {
7098 else
7100
7102 {
7105 }
7106 else
7107 {
7110
7113 }
7114
7116 }
7117
7119 {
7121 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7122 }
7123
7125 {
7127 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7129 }
7130
7132 {
7134 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7135 }
7136
7138 {
7141
7142 OverheatingParticle OP = new OverheatingParticle();
7147
7149 }
7150
7152 {
7155
7156 return -1;
7157 }
7158
7160 {
7162 {
7165
7166 for (int i = count; i > 0; --i)
7167 {
7168 int id = i - 1;
7171
7174
7175 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7176 {
7177 if (p)
7178 {
7181 }
7182 }
7183 }
7184 }
7185 }
7186
7188 {
7190 {
7192 {
7193 int id = i - 1;
7195
7196 if (OP)
7197 {
7199
7200 if (p)
7201 {
7203 }
7204
7205 delete OP;
7206 }
7207 }
7208
7211 }
7212 }
7213
7216 {
7217 return 0.0;
7218 }
7219
7220
7222 {
7223 return 250;
7224 }
7225
7227 {
7228 return 0;
7229 }
7230
7233 {
7235 return true;
7236
7237 return false;
7238 }
7239
7242 {
7245
7247 {
7249 }
7250 else
7251 {
7252
7254 }
7255
7257 }
7258
7265 {
7266 return -1;
7267 }
7268
7269
7270
7271
7273 {
7275 {
7277 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7278
7279 if (r_index >= 0)
7280 {
7281 InventoryLocation r_il = new InventoryLocation;
7282 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7283
7284 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7287 {
7288 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7289 }
7291 {
7292 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7293 }
7294
7295 }
7296
7297 player.GetHumanInventory().ClearUserReservedLocation(this);
7298 }
7299
7302 }
7303
7304
7305
7306
7308 {
7309 return ItemBase.m_DebugActionsMask;
7310 }
7311
7313 {
7314 return ItemBase.m_DebugActionsMask & mask;
7315 }
7316
7318 {
7319 ItemBase.m_DebugActionsMask = mask;
7320 }
7321
7323 {
7324 ItemBase.m_DebugActionsMask |= mask;
7325 }
7326
7328 {
7329 ItemBase.m_DebugActionsMask &= ~mask;
7330 }
7331
7333 {
7335 {
7337 }
7338 else
7339 {
7341 }
7342 }
7343
7344
7346 {
7347 if (GetEconomyProfile())
7348 {
7349 float q_max = GetEconomyProfile().GetQuantityMax();
7350 if (q_max > 0)
7351 {
7352 float q_min = GetEconomyProfile().GetQuantityMin();
7353 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7354
7356 {
7357 ComponentEnergyManager comp = GetCompEM();
7359 {
7361 }
7362 }
7364 {
7366
7367 }
7368
7369 }
7370 }
7371 }
7372
7375 {
7376 EntityAI parent = GetHierarchyParent();
7377
7378 if (parent)
7379 {
7380 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7381 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7382 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7383 }
7384 }
7385
7388 {
7389 EntityAI parent = GetHierarchyParent();
7390
7391 if (parent)
7392 {
7393 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7394 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7395 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7396 }
7397 }
7398
7400 {
7401
7402
7403
7404
7406
7408 {
7409 if (ScriptInputUserData.CanStoreInputUserData())
7410 {
7411 ScriptInputUserData ctx = new ScriptInputUserData;
7417 ctx.
Write(use_stack_max);
7420
7422 {
7423 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7424 }
7425 }
7426 }
7427 else if (!
GetGame().IsMultiplayer())
7428 {
7430 }
7431 }
7432
7434 {
7436 }
7437
7439 {
7441 }
7442
7444 {
7446 }
7447
7449 {
7450
7451 return false;
7452 }
7453
7455 {
7456 return false;
7457 }
7458
7462 {
7463 return false;
7464 }
7465
7467 {
7468 return "";
7469 }
7470
7472
7474 {
7475 return false;
7476 }
7477
7479 {
7480 return true;
7481 }
7482
7483
7484
7486 {
7487 return true;
7488 }
7489
7491 {
7492 return true;
7493 }
7494
7496 {
7497 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7499 }
7500
7502 {
7504 }
7505
7507 {
7509 if (!is_being_placed)
7511 SetSynchDirty();
7512 }
7513
7514
7516
7518 {
7520 }
7521
7523 {
7525 }
7526
7528 {
7529 return 1;
7530 }
7531
7533 {
7534 return false;
7535 }
7536
7538 {
7540 SetSynchDirty();
7541 }
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7578 {
7579 super.OnMovedInsideCargo(container);
7580
7581 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7582 }
7583
7584 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7585 {
7586 super.EEItemLocationChanged(oldLoc,newLoc);
7587
7588 PlayerBase new_player = null;
7589 PlayerBase old_player = null;
7590
7591 if (newLoc.GetParent())
7592 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7593
7594 if (oldLoc.GetParent())
7595 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7596
7598 {
7599 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7600
7601 if (r_index >= 0)
7602 {
7603 InventoryLocation r_il = new InventoryLocation;
7604 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7605
7606 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7609 {
7610 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7611 }
7613 {
7614 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7615 }
7616
7617 }
7618 }
7619
7621 {
7622 if (new_player)
7623 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7624
7625 if (new_player == old_player)
7626 {
7627
7628 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7629 {
7631 {
7632 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7633 {
7634 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7635 }
7636 }
7637 else
7638 {
7639 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7640 }
7641 }
7642
7643 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7644 {
7645 int type = oldLoc.GetType();
7647 {
7648 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7649 }
7651 {
7652 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7653 }
7654 }
7655 if (!m_OldLocation)
7656 {
7657 m_OldLocation = new InventoryLocation;
7658 }
7659 m_OldLocation.Copy(oldLoc);
7660 }
7661 else
7662 {
7663 if (m_OldLocation)
7664 {
7665 m_OldLocation.Reset();
7666 }
7667 }
7668
7670 }
7671 else
7672 {
7673 if (new_player)
7674 {
7675 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7676 if (res_index >= 0)
7677 {
7678 InventoryLocation il = new InventoryLocation;
7679 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7681 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7684 {
7685 il.
GetParent().GetOnReleaseLock().Invoke(it);
7686 }
7688 {
7690 }
7691
7692 }
7693 }
7695 {
7696
7698 }
7699
7700 if (m_OldLocation)
7701 {
7702 m_OldLocation.Reset();
7703 }
7704 }
7705 }
7706
7707 override void EOnContact(IEntity other, Contact extra)
7708 {
7710 {
7711 int liquidType = -1;
7713 if (impactSpeed > 0.0)
7714 {
7716 #ifndef SERVER
7718 #else
7720 SetSynchDirty();
7721 #endif
7723 }
7724 }
7725
7726 #ifdef SERVER
7727 if (GetCompEM() && GetCompEM().IsPlugged())
7728 {
7729 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7730 GetCompEM().UnplugThis();
7731 }
7732 #endif
7733 }
7734
7736
7738 {
7740 }
7741
7743 {
7744
7745 }
7746
7748 {
7749 super.OnItemLocationChanged(old_owner, new_owner);
7750
7751 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7752 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7753
7754 if (!relatedPlayer && playerNew)
7755 relatedPlayer = playerNew;
7756
7757 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7758 {
7760 if (actionMgr)
7761 {
7762 ActionBase currentAction = actionMgr.GetRunningAction();
7763 if (currentAction)
7765 }
7766 }
7767
7768 Man ownerPlayerOld = null;
7769 Man ownerPlayerNew = null;
7770
7771 if (old_owner)
7772 {
7773 if (old_owner.
IsMan())
7774 {
7775 ownerPlayerOld = Man.Cast(old_owner);
7776 }
7777 else
7778 {
7779 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7780 }
7781 }
7782 else
7783 {
7785 {
7787
7788 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7789 {
7790 GetCompEM().UnplugThis();
7791 }
7792 }
7793 }
7794
7795 if (new_owner)
7796 {
7797 if (new_owner.
IsMan())
7798 {
7799 ownerPlayerNew = Man.Cast(new_owner);
7800 }
7801 else
7802 {
7803 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7804 }
7805 }
7806
7807 if (ownerPlayerOld != ownerPlayerNew)
7808 {
7809 if (ownerPlayerOld)
7810 {
7811 array<EntityAI> subItemsExit = new array<EntityAI>;
7813 for (int i = 0; i < subItemsExit.Count(); i++)
7814 {
7817 }
7818 }
7819
7820 if (ownerPlayerNew)
7821 {
7822 array<EntityAI> subItemsEnter = new array<EntityAI>;
7824 for (int j = 0; j < subItemsEnter.Count(); j++)
7825 {
7828 }
7829 }
7830 }
7831 else if (ownerPlayerNew != null)
7832 {
7833 PlayerBase nplayer;
7834 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7835 {
7836 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7838 for (int k = 0; k < subItemsUpdate.Count(); k++)
7839 {
7841 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7842 }
7843 }
7844 }
7845
7846 if (old_owner)
7847 old_owner.OnChildItemRemoved(this);
7848 if (new_owner)
7849 new_owner.OnChildItemReceived(this);
7850 }
7851
7852
7854 {
7855 super.EEDelete(parent);
7856 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7857 if (player)
7858 {
7860
7861 if (player.IsAlive())
7862 {
7863 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7864 if (r_index >= 0)
7865 {
7866 InventoryLocation r_il = new InventoryLocation;
7867 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7868
7869 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7872 {
7873 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7874 }
7876 {
7877 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7878 }
7879
7880 }
7881
7882 player.RemoveQuickBarEntityShortcut(this);
7883 }
7884 }
7885 }
7886
7888 {
7889 super.EEKilled(killer);
7890
7893 {
7894 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7895 {
7896 if (IsMagazine())
7897 {
7898 if (Magazine.Cast(this).GetAmmoCount() > 0)
7899 {
7901 }
7902 }
7903 else
7904 {
7906 }
7907 }
7908 }
7909 }
7910
7912 {
7913 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7914
7915 super.OnWasAttached(parent, slot_id);
7916
7919
7921 }
7922
7924 {
7925 super.OnWasDetached(parent, slot_id);
7926
7929 }
7930
7932 {
7933 int idx;
7936
7937 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7938 if (inventory_slots.Count() < 1)
7939 {
7940 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7941 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7942 }
7943 else
7944 {
7945 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7946 }
7947
7948 idx = inventory_slots.Find(slot);
7949 if (idx < 0)
7950 return "";
7951
7952 return attach_types.Get(idx);
7953 }
7954
7956 {
7957 int idx = -1;
7958 string slot;
7959
7962
7963 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7964 if (inventory_slots.Count() < 1)
7965 {
7966 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7967 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7968 }
7969 else
7970 {
7971 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7972 if (detach_types.Count() < 1)
7973 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7974 }
7975
7976 for (int i = 0; i < inventory_slots.Count(); i++)
7977 {
7978 slot = inventory_slots.Get(i);
7979 }
7980
7981 if (slot != "")
7982 {
7983 if (detach_types.Count() == 1)
7984 idx = 0;
7985 else
7986 idx = inventory_slots.Find(slot);
7987 }
7988 if (idx < 0)
7989 return "";
7990
7991 return detach_types.Get(idx);
7992 }
7993
7995 {
7996
7998
7999
8000 float min_time = 1;
8001 float max_time = 3;
8002 float delay = Math.RandomFloat(min_time, max_time);
8003
8004 explode_timer.Run(delay, this, "DoAmmoExplosion");
8005 }
8006
8008 {
8009 Magazine magazine = Magazine.Cast(this);
8010 int pop_sounds_count = 6;
8011 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8012
8013
8014 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8015 string sound_name = pop_sounds[ sound_idx ];
8017
8018
8019 magazine.ServerAddAmmoCount(-1);
8020
8021
8022 float min_temp_to_explode = 100;
8023
8024 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8025 {
8027 }
8028 }
8029
8030
8031 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8032 {
8033 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8034
8035 const int CHANCE_DAMAGE_CARGO = 4;
8036 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8037 const int CHANCE_DAMAGE_NOTHING = 2;
8038
8040 {
8041 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8042 int chances;
8043 int rnd;
8044
8045 if (GetInventory().GetCargo())
8046 {
8047 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8048 rnd = Math.RandomInt(0,chances);
8049
8050 if (rnd < CHANCE_DAMAGE_CARGO)
8051 {
8053 }
8054 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8055 {
8057 }
8058 }
8059 else
8060 {
8061 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8062 rnd = Math.RandomInt(0,chances);
8063
8064 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8065 {
8067 }
8068 }
8069 }
8070 }
8071
8073 {
8074 if (GetInventory().GetCargo())
8075 {
8076 int item_count = GetInventory().GetCargo().GetItemCount();
8077 if (item_count > 0)
8078 {
8079 int random_pick = Math.RandomInt(0, item_count);
8081 if (!item.IsExplosive())
8082 {
8083 item.AddHealth("","",damage);
8084 return true;
8085 }
8086 }
8087 }
8088 return false;
8089 }
8090
8092 {
8093 int attachment_count = GetInventory().AttachmentCount();
8094 if (attachment_count > 0)
8095 {
8096 int random_pick = Math.RandomInt(0, attachment_count);
8097 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8098 if (!attachment.IsExplosive())
8099 {
8100 attachment.AddHealth("","",damage);
8101 return true;
8102 }
8103 }
8104 return false;
8105 }
8106
8108 {
8110 }
8111
8113 {
8115 return GetInventory().CanRemoveEntity();
8116
8117 return false;
8118 }
8119
8121 {
8123 return;
8124
8126 {
8127 if (ScriptInputUserData.CanStoreInputUserData())
8128 {
8129 ScriptInputUserData ctx = new ScriptInputUserData;
8134 ctx.
Write(destination_entity);
8138 }
8139 }
8140 else if (!
GetGame().IsMultiplayer())
8141 {
8143 }
8144 }
8145
8147 {
8149 return;
8150
8151 float split_quantity_new;
8155 InventoryLocation loc = new InventoryLocation;
8156
8157 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8158 {
8160 split_quantity_new = stack_max;
8161 else
8163
8164 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8165 if (new_item)
8166 {
8167 new_item.SetResultOfSplit(true);
8168 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8170 new_item.SetQuantity(split_quantity_new);
8171 }
8172 }
8173 else if (destination_entity && slot_id == -1)
8174 {
8175 if (quantity > stack_max)
8176 split_quantity_new = stack_max;
8177 else
8178 split_quantity_new = quantity;
8179
8181 {
8184 }
8185
8186 if (new_item)
8187 {
8188 new_item.SetResultOfSplit(true);
8189 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8191 new_item.SetQuantity(split_quantity_new);
8192 }
8193 }
8194 else
8195 {
8196 if (stack_max != 0)
8197 {
8199 {
8201 }
8202
8203 if (split_quantity_new == 0)
8204 {
8205 if (!
GetGame().IsMultiplayer())
8206 player.PhysicalPredictiveDropItem(this);
8207 else
8208 player.ServerDropEntity(this);
8209 return;
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
8231 float split_quantity_new;
8235 InventoryLocation loc = new InventoryLocation;
8236
8237 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8238 {
8240 split_quantity_new = stack_max;
8241 else
8243
8244 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8245 if (new_item)
8246 {
8247 new_item.SetResultOfSplit(true);
8248 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8250 new_item.SetQuantity(split_quantity_new);
8251 }
8252 }
8253 else if (destination_entity && slot_id == -1)
8254 {
8255 if (quantity > stack_max)
8256 split_quantity_new = stack_max;
8257 else
8258 split_quantity_new = quantity;
8259
8261 {
8264 }
8265
8266 if (new_item)
8267 {
8268 new_item.SetResultOfSplit(true);
8269 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8271 new_item.SetQuantity(split_quantity_new);
8272 }
8273 }
8274 else
8275 {
8276 if (stack_max != 0)
8277 {
8279 {
8281 }
8282
8284
8285 if (new_item)
8286 {
8287 new_item.SetResultOfSplit(true);
8288 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8290 new_item.SetQuantity(stack_max);
8291 new_item.PlaceOnSurface();
8292 }
8293 }
8294 }
8295 }
8296
8298 {
8300 return;
8301
8303 {
8304 if (ScriptInputUserData.CanStoreInputUserData())
8305 {
8306 ScriptInputUserData ctx = new ScriptInputUserData;
8311 dst.WriteToContext(ctx);
8313 }
8314 }
8315 else if (!
GetGame().IsMultiplayer())
8316 {
8318 }
8319 }
8320
8322 {
8324 return;
8325
8327 {
8328 if (ScriptInputUserData.CanStoreInputUserData())
8329 {
8330 ScriptInputUserData ctx = new ScriptInputUserData;
8335 ctx.
Write(destination_entity);
8341 }
8342 }
8343 else if (!
GetGame().IsMultiplayer())
8344 {
8346 }
8347 }
8348
8350 {
8352 }
8353
8355 {
8357 return this;
8358
8360 float split_quantity_new;
8362 if (dst.IsValid())
8363 {
8364 int slot_id = dst.GetSlot();
8366
8367 if (quantity > stack_max)
8368 split_quantity_new = stack_max;
8369 else
8370 split_quantity_new = quantity;
8371
8373
8374 if (new_item)
8375 {
8376 new_item.SetResultOfSplit(true);
8377 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8380 }
8381
8382 return new_item;
8383 }
8384
8385 return null;
8386 }
8387
8389 {
8391 return;
8392
8394 float split_quantity_new;
8396 if (destination_entity)
8397 {
8399 if (quantity > stackable)
8400 split_quantity_new = stackable;
8401 else
8402 split_quantity_new = quantity;
8403
8404 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8405 if (new_item)
8406 {
8407 new_item.SetResultOfSplit(true);
8408 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8410 new_item.SetQuantity(split_quantity_new);
8411 }
8412 }
8413 }
8414
8416 {
8418 return;
8419
8421 {
8422 if (ScriptInputUserData.CanStoreInputUserData())
8423 {
8424 ScriptInputUserData ctx = new ScriptInputUserData;
8429 ItemBase destination_entity =
this;
8430 ctx.
Write(destination_entity);
8434 }
8435 }
8436 else if (!
GetGame().IsMultiplayer())
8437 {
8439 }
8440 }
8441
8443 {
8445 return;
8446
8448 float split_quantity_new;
8450 if (player)
8451 {
8453 if (quantity > stackable)
8454 split_quantity_new = stackable;
8455 else
8456 split_quantity_new = quantity;
8457
8458 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8459 new_item =
ItemBase.Cast(in_hands);
8460 if (new_item)
8461 {
8462 new_item.SetResultOfSplit(true);
8463 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8465 new_item.SetQuantity(split_quantity_new);
8466 }
8467 }
8468 }
8469
8471 {
8473 return;
8474
8476 float split_quantity_new = Math.Floor(quantity * 0.5);
8477
8479
8480 if (new_item)
8481 {
8482 if (new_item.GetQuantityMax() < split_quantity_new)
8483 {
8484 split_quantity_new = new_item.GetQuantityMax();
8485 }
8486
8487 new_item.SetResultOfSplit(true);
8488 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8489
8491 {
8494 }
8495 else
8496 {
8499 }
8500 }
8501 }
8502
8504 {
8506 return;
8507
8509 float split_quantity_new = Math.Floor(quantity / 2);
8510
8511 InventoryLocation invloc = new InventoryLocation;
8513
8515 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8516
8517 if (new_item)
8518 {
8519 if (new_item.GetQuantityMax() < split_quantity_new)
8520 {
8521 split_quantity_new = new_item.GetQuantityMax();
8522 }
8524 {
8527 }
8528 else
8529 {
8532 }
8533 }
8534 }
8535
8538 {
8539 SetWeightDirty();
8541
8542 if (parent)
8543 parent.OnAttachmentQuantityChangedEx(this, delta);
8544
8546 {
8548 {
8550 }
8552 {
8553 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8555 }
8556 }
8557
8558 }
8559
8562 {
8563
8564 }
8565
8568 {
8570 }
8571
8573 {
8574 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8575
8577 {
8578 if (newLevel == GameConstants.STATE_RUINED)
8579 {
8581 EntityAI parent = GetHierarchyParent();
8582 if (parent && parent.IsFireplace())
8583 {
8584 CargoBase cargo = GetInventory().GetCargo();
8585 if (cargo)
8586 {
8588 {
8590 }
8591 }
8592 }
8593 }
8594
8596 {
8597
8599 return;
8600 }
8601
8602 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8603 {
8605 }
8606 }
8607 }
8608
8609
8611 {
8612 super.OnRightClick();
8613
8615 {
8617 {
8618 if (ScriptInputUserData.CanStoreInputUserData())
8619 {
8620 vector m4[4];
8622
8623 EntityAI root = GetHierarchyRoot();
8624
8625 InventoryLocation dst = new InventoryLocation;
8627 {
8628 if (root)
8629 {
8630 root.GetTransform(m4);
8632 }
8633 else
8634 GetInventory().GetCurrentInventoryLocation(dst);
8635 }
8636 else
8637 {
8639
8640
8641 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8642 {
8643 if (root)
8644 {
8645 root.GetTransform(m4);
8647 }
8648 else
8649 GetInventory().GetCurrentInventoryLocation(dst);
8650 }
8651 else
8652 {
8653 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8654 }
8655 }
8656
8657 ScriptInputUserData ctx = new ScriptInputUserData;
8665 }
8666 }
8667 else if (!
GetGame().IsMultiplayer())
8668 {
8670 }
8671 }
8672 }
8673
8674 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8675 {
8676
8677 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8678 return false;
8679
8680 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8681 return false;
8682
8683
8685 return false;
8686
8687
8688 Magazine mag = Magazine.Cast(this);
8689 if (mag)
8690 {
8691 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8692 return false;
8693
8694 if (stack_max_limit)
8695 {
8696 Magazine other_mag = Magazine.Cast(other_item);
8697 if (other_item)
8698 {
8699 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8700 return false;
8701 }
8702
8703 }
8704 }
8705 else
8706 {
8707
8709 return false;
8710
8712 return false;
8713 }
8714
8715 PlayerBase player = null;
8716 if (CastTo(player, GetHierarchyRootPlayer()))
8717 {
8718 if (player.GetInventory().HasAttachment(this))
8719 return false;
8720
8721 if (player.IsItemsToDelete())
8722 return false;
8723 }
8724
8725 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8726 return false;
8727
8728 int slotID;
8730 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8731 return false;
8732
8733 return true;
8734 }
8735
8737 {
8739 }
8740
8742 {
8743 return m_IsResultOfSplit;
8744 }
8745
8747 {
8748 m_IsResultOfSplit = value;
8749 }
8750
8752 {
8754 }
8755
8757 {
8758 float other_item_quantity = other_item.GetQuantity();
8759 float this_free_space;
8760
8762
8764
8765 if (other_item_quantity > this_free_space)
8766 {
8767 return this_free_space;
8768 }
8769 else
8770 {
8771 return other_item_quantity;
8772 }
8773 }
8774
8776 {
8778 }
8779
8781 {
8783 return;
8784
8785 if (!IsMagazine() && other_item)
8786 {
8788 if (quantity_used != 0)
8789 {
8790 float hp1 = GetHealth01("","");
8791 float hp2 = other_item.GetHealth01("","");
8792 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8793 hpResult = hpResult / (
GetQuantity() + quantity_used);
8794
8795 hpResult *= GetMaxHealth();
8796 Math.Round(hpResult);
8797 SetHealth("", "Health", hpResult);
8798
8800 other_item.AddQuantity(-quantity_used);
8801 }
8802 }
8804 }
8805
8807 {
8808 #ifdef SERVER
8809 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8810 GetHierarchyParent().IncreaseLifetimeUp();
8811 #endif
8812 };
8813
8815 {
8816 PlayerBase p = PlayerBase.Cast(player);
8817
8818 array<int> recipesIds = p.m_Recipes;
8819 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8820 if (moduleRecipesManager)
8821 {
8822 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8823 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8824 }
8825
8826 for (int i = 0;i < recipesIds.Count(); i++)
8827 {
8828 int key = recipesIds.Get(i);
8829 string recipeName = moduleRecipesManager.GetRecipeName(key);
8831 }
8832 }
8833
8834
8835 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8836 {
8837 super.GetDebugActions(outputList);
8838
8839
8844
8845
8849
8853
8854
8857
8858
8860 {
8863 }
8864
8866
8869
8873 }
8874
8875
8876
8877
8879 {
8880 super.OnAction(action_id, player, ctx);
8881 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8882 {
8883 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8884 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8885 PlayerBase p = PlayerBase.Cast(player);
8886 if (
EActions.RECIPES_RANGE_START < 1000)
8887 {
8888 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8889 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8890 }
8891 }
8892 #ifndef SERVER
8893 else if (action_id ==
EActions.WATCH_PLAYER)
8894 {
8895 PluginDeveloper.SetDeveloperItemClientEx(player);
8896 }
8897 #endif
8899 {
8900 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8901 {
8902 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8903 OnDebugButtonPressServer(id + 1);
8904 }
8905
8906 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8907 {
8908 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8910 }
8911
8912 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8913 {
8914 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8916 }
8917
8918 else if (action_id ==
EActions.ADD_QUANTITY)
8919 {
8920 if (IsMagazine())
8921 {
8922 Magazine mag = Magazine.Cast(this);
8923 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8924 }
8925 else
8926 {
8928 }
8929
8930 if (m_EM)
8931 {
8932 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8933 }
8934
8935 }
8936
8937 else if (action_id ==
EActions.REMOVE_QUANTITY)
8938 {
8939 if (IsMagazine())
8940 {
8941 Magazine mag2 = Magazine.Cast(this);
8942 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8943 }
8944 else
8945 {
8947 }
8948 if (m_EM)
8949 {
8950 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8951 }
8952
8953 }
8954
8955 else if (action_id ==
EActions.SET_QUANTITY_0)
8956 {
8958
8959 if (m_EM)
8960 {
8961 m_EM.SetEnergy(0);
8962 }
8963 }
8964
8965 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8966 {
8968
8969 if (m_EM)
8970 {
8971 m_EM.SetEnergy(m_EM.GetEnergyMax());
8972 }
8973 }
8974
8975 else if (action_id ==
EActions.ADD_HEALTH)
8976 {
8977 AddHealth("","",GetMaxHealth("","Health")/5);
8978 }
8979 else if (action_id ==
EActions.REMOVE_HEALTH)
8980 {
8981 AddHealth("","",-GetMaxHealth("","Health")/5);
8982 }
8983 else if (action_id ==
EActions.DESTROY_HEALTH)
8984 {
8985 SetHealth01("","",0);
8986 }
8987 else if (action_id ==
EActions.WATCH_ITEM)
8988 {
8990 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8991 #ifdef DEVELOPER
8992 SetDebugDeveloper_item(this);
8993 #endif
8994 }
8995
8996 else if (action_id ==
EActions.ADD_TEMPERATURE)
8997 {
8998 AddTemperature(20);
8999
9000 }
9001
9002 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9003 {
9004 AddTemperature(-20);
9005
9006 }
9007
9008 else if (action_id ==
EActions.FLIP_FROZEN)
9009 {
9010 SetFrozen(!GetIsFrozen());
9011
9012 }
9013
9014 else if (action_id ==
EActions.ADD_WETNESS)
9015 {
9017
9018 }
9019
9020 else if (action_id ==
EActions.REMOVE_WETNESS)
9021 {
9023
9024 }
9025
9026 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9027 {
9030
9031
9032 }
9033
9034 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9035 {
9038 }
9039
9040 else if (action_id ==
EActions.MAKE_SPECIAL)
9041 {
9042 auto debugParams = DebugSpawnParams.WithPlayer(player);
9043 OnDebugSpawnEx(debugParams);
9044 }
9045
9046 else if (action_id ==
EActions.DELETE)
9047 {
9048 Delete();
9049 }
9050
9051 }
9052
9053
9054 return false;
9055 }
9056
9057
9058
9059
9063
9066
9067
9068
9070 {
9071 return false;
9072 }
9073
9074
9076 {
9077 return true;
9078 }
9079
9080
9082 {
9083 return true;
9084 }
9085
9086
9087
9089 {
9090 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9092 }
9093
9096 {
9097 return null;
9098 }
9099
9101 {
9102 return false;
9103 }
9104
9106 {
9107 return false;
9108 }
9109
9113
9114
9116 {
9117 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9118 return module_repairing.CanRepair(this, item_repair_kit);
9119 }
9120
9121
9122 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9123 {
9124 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9125 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9126 }
9127
9128
9130 {
9131
9132
9133
9134
9135
9136
9137
9138
9139 return 1;
9140 }
9141
9142
9143
9145 {
9147 }
9148
9149
9150
9152 {
9154 }
9155
9156
9165 {
9166 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9167
9168 if (player)
9169 {
9170 player.MessageStatus(text);
9171 }
9172 }
9173
9174
9183 {
9184 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9185
9186 if (player)
9187 {
9188 player.MessageAction(text);
9189 }
9190 }
9191
9192
9201 {
9202 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9203
9204 if (player)
9205 {
9206 player.MessageFriendly(text);
9207 }
9208 }
9209
9210
9219 {
9220 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9221
9222 if (player)
9223 {
9224 player.MessageImportant(text);
9225 }
9226 }
9227
9229 {
9230 return true;
9231 }
9232
9233
9234 override bool KindOf(
string tag)
9235 {
9236 bool found = false;
9237 string item_name = this.
GetType();
9240
9241 int array_size = item_tag_array.Count();
9242 for (int i = 0; i < array_size; i++)
9243 {
9244 if (item_tag_array.Get(i) == tag)
9245 {
9246 found = true;
9247 break;
9248 }
9249 }
9250 return found;
9251 }
9252
9253
9255 {
9256
9257 super.OnRPC(sender, rpc_type,ctx);
9258
9259
9260 switch (rpc_type)
9261 {
9262 #ifndef SERVER
9263 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9264 Param2<bool, string> p = new Param2<bool, string>(false, "");
9265
9267 return;
9268
9269 bool play = p.param1;
9270 string soundSet = p.param2;
9271
9272 if (play)
9273 {
9275 {
9277 {
9279 }
9280 }
9281 else
9282 {
9284 }
9285 }
9286 else
9287 {
9289 }
9290
9291 break;
9292 #endif
9293
9294 }
9295
9297 {
9299 }
9300 }
9301
9302
9303
9304
9306 {
9307 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9308 return plugin.GetID(
name);
9309 }
9310
9312 {
9313 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9314 return plugin.GetName(id);
9315 }
9316
9319 {
9320
9321
9322 int varFlags;
9323 if (!ctx.
Read(varFlags))
9324 return;
9325
9326 if (varFlags & ItemVariableFlags.FLOAT)
9327 {
9329 }
9330 }
9331
9333 {
9334
9335 super.SerializeNumericalVars(floats_out);
9336
9337
9338
9340 {
9342 }
9343
9345 {
9347 }
9348
9350 {
9352 }
9353
9355 {
9360 }
9361
9363 {
9365 }
9366 }
9367
9369 {
9370
9371 super.DeSerializeNumericalVars(floats);
9372
9373
9374 int index = 0;
9375 int mask = Math.Round(floats.Get(index));
9376
9377 index++;
9378
9380 {
9382 {
9384 }
9385 else
9386 {
9387 float quantity = floats.Get(index);
9389 }
9390 index++;
9391 }
9392
9394 {
9395 float wet = floats.Get(index);
9397 index++;
9398 }
9399
9401 {
9402 int liquidtype = Math.Round(floats.Get(index));
9404 index++;
9405 }
9406
9408 {
9410 index++;
9412 index++;
9414 index++;
9416 index++;
9417 }
9418
9420 {
9421 int cleanness = Math.Round(floats.Get(index));
9423 index++;
9424 }
9425 }
9426
9428 {
9429 super.WriteVarsToCTX(ctx);
9430
9431
9433 {
9435 }
9436
9438 {
9440 }
9441
9443 {
9445 }
9446
9448 {
9449 int r,g,b,a;
9455 }
9456
9458 {
9460 }
9461 }
9462
9464 {
9465 if (!super.ReadVarsFromCTX(ctx,version))
9466 return false;
9467
9468 int intValue;
9469 float value;
9470
9471 if (version < 140)
9472 {
9473 if (!ctx.
Read(intValue))
9474 return false;
9475
9476 m_VariablesMask = intValue;
9477 }
9478
9480 {
9481 if (!ctx.
Read(value))
9482 return false;
9483
9485 {
9487 }
9488 else
9489 {
9491 }
9492 }
9493
9494 if (version < 140)
9495 {
9497 {
9498 if (!ctx.
Read(value))
9499 return false;
9500 SetTemperatureDirect(value);
9501 }
9502 }
9503
9505 {
9506 if (!ctx.
Read(value))
9507 return false;
9509 }
9510
9512 {
9513 if (!ctx.
Read(intValue))
9514 return false;
9516 }
9517
9519 {
9520 int r,g,b,a;
9522 return false;
9524 return false;
9526 return false;
9528 return false;
9529
9531 }
9532
9534 {
9535 if (!ctx.
Read(intValue))
9536 return false;
9538 }
9539
9540 if (version >= 138 && version < 140)
9541 {
9543 {
9544 if (!ctx.
Read(intValue))
9545 return false;
9546 SetFrozen(intValue);
9547 }
9548 }
9549
9550 return true;
9551 }
9552
9553
9555 {
9558 {
9560 }
9561
9562 if (!super.OnStoreLoad(ctx, version))
9563 {
9565 return false;
9566 }
9567
9568 if (version >= 114)
9569 {
9570 bool hasQuickBarIndexSaved;
9571
9572 if (!ctx.
Read(hasQuickBarIndexSaved))
9573 {
9575 return false;
9576 }
9577
9578 if (hasQuickBarIndexSaved)
9579 {
9580 int itmQBIndex;
9581
9582
9583 if (!ctx.
Read(itmQBIndex))
9584 {
9586 return false;
9587 }
9588
9589 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9590 if (itmQBIndex != -1 && parentPlayer)
9591 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9592 }
9593 }
9594 else
9595 {
9596
9597 PlayerBase player;
9598 int itemQBIndex;
9599 if (version ==
int.
MAX)
9600 {
9601 if (!ctx.
Read(itemQBIndex))
9602 {
9604 return false;
9605 }
9606 }
9607 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9608 {
9609
9610 if (!ctx.
Read(itemQBIndex))
9611 {
9613 return false;
9614 }
9615 if (itemQBIndex != -1 && player)
9616 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9617 }
9618 }
9619
9620 if (version < 140)
9621 {
9622
9623 if (!LoadVariables(ctx, version))
9624 {
9626 return false;
9627 }
9628 }
9629
9630
9632 {
9634 return false;
9635 }
9636 if (version >= 132)
9637 {
9639 if (raib)
9640 {
9642 {
9644 return false;
9645 }
9646 }
9647 }
9648
9650 return true;
9651 }
9652
9653
9654
9656 {
9657 super.OnStoreSave(ctx);
9658
9659 PlayerBase player;
9660 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9661 {
9663
9664 int itemQBIndex = -1;
9665 itemQBIndex = player.FindQuickBarEntityIndex(this);
9666 ctx.
Write(itemQBIndex);
9667 }
9668 else
9669 {
9671 }
9672
9674
9676 if (raib)
9677 {
9679 }
9680 }
9681
9682
9684 {
9685 super.AfterStoreLoad();
9686
9688 {
9690 }
9691
9693 {
9696 }
9697 }
9698
9700 {
9701 super.EEOnAfterLoad();
9702
9704 {
9706 }
9707
9710 }
9711
9713 {
9714 return false;
9715 }
9716
9717
9718
9720 {
9722 {
9723 #ifdef PLATFORM_CONSOLE
9724
9726 {
9728 if (menu)
9729 {
9731 }
9732 }
9733 #endif
9734 }
9735
9737 {
9740 }
9741
9743 {
9744 SetWeightDirty();
9746 }
9748 {
9751 }
9752
9754 {
9757 }
9759 {
9762 }
9763
9764 super.OnVariablesSynchronized();
9765 }
9766
9767
9768
9770 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9771 {
9772 if (!IsServerCheck(allow_client))
9773 return false;
9774
9776 return false;
9777
9780
9781 if (value <= (min + 0.001))
9782 value = min;
9783
9784 if (value == min)
9785 {
9786 if (destroy_config)
9787 {
9788 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9789 if (dstr)
9790 {
9792 this.Delete();
9793 return true;
9794 }
9795 }
9796 else if (destroy_forced)
9797 {
9799 this.Delete();
9800 return true;
9801 }
9802
9804 }
9805
9808
9810 {
9812
9813 if (delta)
9815 }
9816
9818
9819 return false;
9820 }
9821
9822
9824 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9825 {
9827 }
9828
9830 {
9833 }
9834
9836 {
9839 }
9840
9843 {
9844 float value_clamped = Math.Clamp(value, 0, 1);
9846 SetQuantity(result, destroy_config, destroy_forced);
9847 }
9848
9849
9852 {
9854 }
9855
9857 {
9859 }
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9871 {
9872 int slot = -1;
9873 if (GetInventory())
9874 {
9875 InventoryLocation il = new InventoryLocation;
9876 GetInventory().GetCurrentInventoryLocation(il);
9878 }
9879
9881 }
9882
9884 {
9885 float quantity_max = 0;
9886
9888 {
9889 if (attSlotID != -1)
9890 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9891
9892 if (quantity_max <= 0)
9894 }
9895
9896 if (quantity_max <= 0)
9898
9899 return quantity_max;
9900 }
9901
9903 {
9905 }
9906
9908 {
9910 }
9911
9912
9914 {
9916 }
9917
9919 {
9921 }
9922
9924 {
9926 }
9927
9928
9930 {
9931
9932 float weightEx = GetWeightEx();
9933 float special = GetInventoryAndCargoWeight();
9934 return weightEx - special;
9935 }
9936
9937
9939 {
9941 }
9942
9944 {
9946 {
9947 #ifdef DEVELOPER
9948 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9949 {
9950 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9952 }
9953 #endif
9954
9956 }
9957 else if (HasEnergyManager())
9958 {
9959 #ifdef DEVELOPER
9960 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9961 {
9962 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9963 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9964 }
9965 #endif
9966 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9967 }
9968 else
9969 {
9970 #ifdef DEVELOPER
9971 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9972 {
9973 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9974 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9975 }
9976 #endif
9977 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9978 }
9979 }
9980
9983 {
9984 int item_count = 0;
9986
9987 if (GetInventory().GetCargo() != NULL)
9988 {
9989 item_count = GetInventory().GetCargo().GetItemCount();
9990 }
9991
9992 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9993 {
9994 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9995 if (item)
9996 item_count += item.GetNumberOfItems();
9997 }
9998 return item_count;
9999 }
10000
10003 {
10004 float weight = 0;
10005 float wetness = 1;
10006 if (include_wetness)
10009 {
10010 weight = wetness * m_ConfigWeight;
10011 }
10013 {
10014 weight = 1;
10015 }
10016 return weight;
10017 }
10018
10019
10020
10022 {
10023 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10024 {
10025 GameInventory inv = GetInventory();
10026 array<EntityAI> items = new array<EntityAI>;
10028 for (int i = 0; i < items.Count(); i++)
10029 {
10031 if (item)
10032 {
10034 }
10035 }
10036 }
10037 }
10038
10039
10040
10041
10043 {
10044 float energy = 0;
10045 if (HasEnergyManager())
10046 {
10047 energy = GetCompEM().GetEnergy();
10048 }
10049 return energy;
10050 }
10051
10052
10054 {
10055 super.OnEnergyConsumed();
10056
10058 }
10059
10061 {
10062 super.OnEnergyAdded();
10063
10065 }
10066
10067
10069 {
10070 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10071 {
10073 {
10074 float energy_0to1 = GetCompEM().GetEnergy0To1();
10076 }
10077 }
10078 }
10079
10080
10082 {
10083 return ConfigGetFloat("heatIsolation");
10084 }
10085
10087 {
10089 }
10090
10092 {
10093 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10094 if (
GetGame().ConfigIsExisting(paramPath))
10096
10097 return 0.0;
10098 }
10099
10101 {
10102 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10103 if (
GetGame().ConfigIsExisting(paramPath))
10105
10106 return 0.0;
10107 }
10108
10109 override void SetWet(
float value,
bool allow_client =
false)
10110 {
10111 if (!IsServerCheck(allow_client))
10112 return;
10113
10116
10118
10119 m_VarWet = Math.Clamp(value, min, max);
10120
10122 {
10125 }
10126 }
10127
10128 override void AddWet(
float value)
10129 {
10131 }
10132
10134 {
10136 }
10137
10139 {
10141 }
10142
10144 {
10146 }
10147
10149 {
10151 }
10152
10154 {
10156 }
10157
10158 override void OnWetChanged(
float newVal,
float oldVal)
10159 {
10162 if (newLevel != oldLevel)
10163 {
10165 }
10166 }
10167
10169 {
10170 SetWeightDirty();
10171 }
10172
10174 {
10175 return GetWetLevelInternal(
m_VarWet);
10176 }
10177
10178
10179
10181 {
10183 }
10184
10186 {
10188 }
10189
10191 {
10193 }
10194
10196 {
10198 }
10199
10200
10201
10203 {
10204 if (ConfigIsExisting("itemModelLength"))
10205 {
10206 return ConfigGetFloat("itemModelLength");
10207 }
10208 return 0;
10209 }
10210
10212 {
10213 if (ConfigIsExisting("itemAttachOffset"))
10214 {
10215 return ConfigGetFloat("itemAttachOffset");
10216 }
10217 return 0;
10218 }
10219
10220 override void SetCleanness(
int value,
bool allow_client =
false)
10221 {
10222 if (!IsServerCheck(allow_client))
10223 return;
10224
10226
10228
10231 }
10232
10234 {
10236 }
10237
10239 {
10240 return true;
10241 }
10242
10243
10244
10245
10247 {
10249 }
10250
10252 {
10254 }
10255
10256
10257
10258
10259 override void SetColor(
int r,
int g,
int b,
int a)
10260 {
10266 }
10268 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10269 {
10274 }
10275
10277 {
10279 }
10280
10283 {
10284 int r,g,b,a;
10286 r = r/255;
10287 g = g/255;
10288 b = b/255;
10289 a = a/255;
10290 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10291 }
10292
10293
10294
10295 override void SetLiquidType(
int value,
bool allow_client =
false)
10296 {
10297 if (!IsServerCheck(allow_client))
10298 return;
10299
10304 }
10305
10307 {
10308 return ConfigGetInt("varLiquidTypeInit");
10309 }
10310
10312 {
10314 }
10315
10317 {
10319 SetFrozen(false);
10320 }
10321
10324 {
10325 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10326 }
10327
10328
10331 {
10332 PlayerBase nplayer;
10333 if (PlayerBase.CastTo(nplayer, player))
10334 {
10336
10337 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10338 }
10339 }
10340
10341
10344 {
10345 PlayerBase nplayer;
10346 if (PlayerBase.CastTo(nplayer,player))
10347 {
10348
10349 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10350
10351 }
10352
10353
10354 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10355
10356
10357 if (HasEnergyManager())
10358 {
10359 GetCompEM().UpdatePlugState();
10360 }
10361 }
10362
10363
10365 {
10366 super.OnPlacementStarted(player);
10367
10369 }
10370
10371 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10372 {
10374 {
10375 m_AdminLog.OnPlacementComplete(player,
this);
10376 }
10377
10378 super.OnPlacementComplete(player, position, orientation);
10379 }
10380
10381
10382
10383
10384
10386 {
10388 {
10389 return true;
10390 }
10391 else
10392 {
10393 return false;
10394 }
10395 }
10396
10397
10399 {
10401 {
10403 }
10404 }
10405
10406
10408 {
10410 }
10411
10413 {
10415 }
10416
10417 override void InsertAgent(
int agent,
float count = 1)
10418 {
10419 if (count < 1)
10420 return;
10421
10423 }
10424
10427 {
10429 }
10430
10431
10433 {
10435 }
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10479 {
10481 return false;
10482 return true;
10483 }
10484
10486 {
10487
10489 }
10490
10491
10494 {
10495 super.CheckForRoofLimited(timeTresholdMS);
10496
10498 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10499 {
10500 m_PreviousRoofTestTime = time;
10501 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10502 }
10503 }
10504
10505
10507 {
10509 {
10510 return 0;
10511 }
10512
10513 if (GetInventory().GetAttachmentSlotsCount() != 0)
10514 {
10515 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10516 if (filter)
10517 return filter.GetProtectionLevel(type, false, system);
10518 else
10519 return 0;
10520 }
10521
10522 string subclassPath, entryName;
10523
10524 switch (type)
10525 {
10527 entryName = "biological";
10528 break;
10530 entryName = "chemical";
10531 break;
10532 default:
10533 entryName = "biological";
10534 break;
10535 }
10536
10537 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10538
10540 }
10541
10542
10543
10546 {
10547 if (!IsMagazine())
10549
10551 }
10552
10553
10554
10555
10556
10561 {
10562 return true;
10563 }
10564
10566 {
10568 }
10569
10570
10571
10572
10573
10575 {
10576 if (parent)
10577 {
10578 if (parent.IsInherited(DayZInfected))
10579 return true;
10580
10581 if (!parent.IsRuined())
10582 return true;
10583 }
10584
10585 return true;
10586 }
10587
10589 {
10590 if (!super.CanPutAsAttachment(parent))
10591 {
10592 return false;
10593 }
10594
10595 if (!IsRuined() && !parent.IsRuined())
10596 {
10597 return true;
10598 }
10599
10600 return false;
10601 }
10602
10604 {
10605
10606
10607
10608
10609 return super.CanReceiveItemIntoCargo(item);
10610 }
10611
10613 {
10614
10615
10616
10617
10618 GameInventory attachmentInv = attachment.GetInventory();
10620 {
10621 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10622 return false;
10623 }
10624
10625 InventoryLocation loc = new InventoryLocation();
10626 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10627 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10628 return false;
10629
10630 return super.CanReceiveAttachment(attachment, slotId);
10631 }
10632
10634 {
10635 if (!super.CanReleaseAttachment(attachment))
10636 return false;
10637
10638 return GetInventory().AreChildrenAccessible();
10639 }
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10662 {
10663 int id = muzzle_owner.GetMuzzleID();
10664 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10665
10666 if (WPOF_array)
10667 {
10668 for (int i = 0; i < WPOF_array.Count(); i++)
10669 {
10670 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10671
10672 if (WPOF)
10673 {
10674 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10675 }
10676 }
10677 }
10678 }
10679
10680
10682 {
10683 int id = muzzle_owner.GetMuzzleID();
10685
10686 if (WPOBE_array)
10687 {
10688 for (int i = 0; i < WPOBE_array.Count(); i++)
10689 {
10690 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10691
10692 if (WPOBE)
10693 {
10694 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10695 }
10696 }
10697 }
10698 }
10699
10700
10702 {
10703 int id = muzzle_owner.GetMuzzleID();
10704 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10705
10706 if (WPOOH_array)
10707 {
10708 for (int i = 0; i < WPOOH_array.Count(); i++)
10709 {
10710 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10711
10712 if (WPOOH)
10713 {
10714 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10715 }
10716 }
10717 }
10718 }
10719
10720
10722 {
10723 int id = muzzle_owner.GetMuzzleID();
10724 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10725
10726 if (WPOOH_array)
10727 {
10728 for (int i = 0; i < WPOOH_array.Count(); i++)
10729 {
10730 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10731
10732 if (WPOOH)
10733 {
10734 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10735 }
10736 }
10737 }
10738 }
10739
10740
10742 {
10743 int id = muzzle_owner.GetMuzzleID();
10744 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10745
10746 if (WPOOH_array)
10747 {
10748 for (int i = 0; i < WPOOH_array.Count(); i++)
10749 {
10750 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10751
10752 if (WPOOH)
10753 {
10754 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10755 }
10756 }
10757 }
10758 }
10759
10760
10761
10763 {
10765 {
10766 return true;
10767 }
10768
10769 return false;
10770 }
10771
10773 {
10775 {
10776 return true;
10777 }
10778
10779 return false;
10780 }
10781
10783 {
10785 {
10786 return true;
10787 }
10788
10789 return false;
10790 }
10791
10793 {
10794 return false;
10795 }
10796
10799 {
10800 return UATimeSpent.DEFAULT_DEPLOY;
10801 }
10802
10803
10804
10805
10807 {
10809 SetSynchDirty();
10810 }
10811
10813 {
10815 }
10816
10817
10819 {
10820 return false;
10821 }
10822
10825 {
10826 string att_type = "None";
10827
10828 if (ConfigIsExisting("soundAttType"))
10829 {
10830 att_type = ConfigGetString("soundAttType");
10831 }
10832
10834 }
10835
10837 {
10839 }
10840
10841
10842
10843
10844
10848
10850 {
10853
10855 }
10856
10857
10859 {
10861 return;
10862
10864
10867
10870
10871 SoundParameters params = new SoundParameters();
10875 }
10876
10877
10879 {
10881 return;
10882
10884 SetSynchDirty();
10885
10888 }
10889
10890
10892 {
10894 return;
10895
10897 SetSynchDirty();
10898
10901 }
10902
10904 {
10906 }
10907
10909 {
10911 }
10912
10915 {
10916 if (!
GetGame().IsDedicatedServer())
10917 {
10918 if (ConfigIsExisting("attachSoundSet"))
10919 {
10920 string cfg_path = "";
10921 string soundset = "";
10922 string type_name =
GetType();
10923
10926 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10927 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10928
10929 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10930 {
10931 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10932 {
10933 if (cfg_slot_array[i] == slot_type)
10934 {
10935 soundset = cfg_soundset_array[i];
10936 break;
10937 }
10938 }
10939 }
10940
10941 if (soundset != "")
10942 {
10943 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10945 }
10946 }
10947 }
10948 }
10949
10951 {
10952
10953 }
10954
10955 void OnApply(PlayerBase player);
10956
10958 {
10959 return 1.0;
10960 };
10961
10963 {
10965 }
10966
10968 {
10970 }
10971
10973
10975 {
10976 SetDynamicPhysicsLifeTime(0.01);
10978 }
10979
10981 {
10982 array<string> zone_names = new array<string>;
10983 GetDamageZones(zone_names);
10984 for (int i = 0; i < zone_names.Count(); i++)
10985 {
10986 SetHealthMax(zone_names.Get(i),"Health");
10987 }
10988 SetHealthMax("","Health");
10989 }
10990
10993 {
10994 float global_health = GetHealth01("","Health");
10995 array<string> zones = new array<string>;
10996 GetDamageZones(zones);
10997
10998 for (int i = 0; i < zones.Count(); i++)
10999 {
11000 SetHealth01(zones.Get(i),"Health",global_health);
11001 }
11002 }
11003
11006 {
11007 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11008 }
11009
11011 {
11012 if (!hasRootAsPlayer)
11013 {
11014 if (refParentIB)
11015 {
11016
11017 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11018 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11019
11020 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11021 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11022
11025 }
11026 else
11027 {
11028
11031 }
11032 }
11033 }
11034
11036 {
11038 {
11039 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11040 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11041 {
11042 float heatPermCoef = 1.0;
11044 while (ent)
11045 {
11046 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11047 ent = ent.GetHierarchyParent();
11048 }
11049
11050 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11051 }
11052 }
11053 }
11054
11056 {
11057
11058 EntityAI parent = GetHierarchyParent();
11059 if (!parent)
11060 {
11061 hasParent = false;
11062 hasRootAsPlayer = false;
11063 }
11064 else
11065 {
11066 hasParent = true;
11067 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11068 refParentIB =
ItemBase.Cast(parent);
11069 }
11070 }
11071
11072 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11073 {
11074
11075 }
11076
11078 {
11079
11080 return false;
11081 }
11082
11084 {
11085
11086
11087 return false;
11088 }
11089
11091 {
11092
11093 return false;
11094 }
11095
11098 {
11099 return !GetIsFrozen() &&
IsOpen();
11100 }
11101
11103 {
11104 bool hasParent = false, hasRootAsPlayer = false;
11106
11107 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11108 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11109
11110 if (wwtu || foodDecay)
11111 {
11115
11116 if (processWetness || processTemperature || processDecay)
11117 {
11119
11120 if (processWetness)
11121 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11122
11123 if (processTemperature)
11125
11126 if (processDecay)
11127 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11128 }
11129 }
11130 }
11131
11134 {
11136 }
11137
11139 {
11142
11143 return super.GetTemperatureFreezeThreshold();
11144 }
11145
11147 {
11150
11151 return super.GetTemperatureThawThreshold();
11152 }
11153
11155 {
11158
11159 return super.GetItemOverheatThreshold();
11160 }
11161
11163 {
11165 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11166
11167 return super.GetTemperatureFreezeTime();
11168 }
11169
11171 {
11173 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11174
11175 return super.GetTemperatureThawTime();
11176 }
11177
11182
11184 {
11185 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11186 }
11187
11189 {
11190 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11191 }
11192
11195 {
11197 }
11198
11200 {
11202 }
11203
11205 {
11207 }
11208
11211 {
11212 return null;
11213 }
11214
11217 {
11218 return false;
11219 }
11220
11222 {
11224 {
11227 if (!trg)
11228 {
11230 explosive = this;
11231 }
11232
11233 explosive.PairRemote(trg);
11235
11236 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11237 trg.SetPersistentPairID(persistentID);
11238 explosive.SetPersistentPairID(persistentID);
11239
11240 return true;
11241 }
11242 return false;
11243 }
11244
11247 {
11248 float ret = 1.0;
11251 ret *= GetHealth01();
11252
11253 return ret;
11254 }
11255
11256 #ifdef DEVELOPER
11257 override void SetDebugItem()
11258 {
11259 super.SetDebugItem();
11260 _itemBase = this;
11261 }
11262
11264 {
11265 string text = super.GetDebugText();
11266
11268 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11269
11270 return text;
11271 }
11272 #endif
11273
11275 {
11276 return true;
11277 }
11278
11280
11282
11284 {
11287 }
11288
11289
11297
11313}
11314
11316{
11318 if (entity)
11319 {
11320 bool is_item = entity.IsInherited(
ItemBase);
11321 if (is_item && full_quantity)
11322 {
11325 }
11326 }
11327 else
11328 {
11330 return NULL;
11331 }
11332 return entity;
11333}
11334
11336{
11337 if (item)
11338 {
11339 if (health > 0)
11340 item.SetHealth("", "", health);
11341
11342 if (item.CanHaveTemperature())
11343 {
11345 if (item.CanFreeze())
11346 item.SetFrozen(false);
11347 }
11348
11349 if (item.HasEnergyManager())
11350 {
11351 if (quantity >= 0)
11352 {
11353 item.GetCompEM().SetEnergy0To1(quantity);
11354 }
11355 else
11356 {
11358 }
11359 }
11360 else if (item.IsMagazine())
11361 {
11362 Magazine mag = Magazine.Cast(item);
11363 if (quantity >= 0)
11364 {
11365 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11366 }
11367 else
11368 {
11370 }
11371
11372 }
11373 else
11374 {
11375 if (quantity >= 0)
11376 {
11377 item.SetQuantityNormalized(quantity, false);
11378 }
11379 else
11380 {
11382 }
11383
11384 }
11385 }
11386}
11387
11388#ifdef DEVELOPER
11390#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.