6659{
6661 {
6662 return true;
6663 }
6664};
6665
6666
6667
6669{
6673
6675
6678
6679
6680
6681
6682
6691
6697
6702
6707
6728 protected bool m_IsResultOfSplit
6729
6731
6736
6737
6738
6740
6744
6745
6746
6748
6751
6752
6753
6759
6760
6768
6771
6772
6774
6775
6777
6778
6783
6784
6789
6790
6792
6793
6795 {
6800
6801 if (!
GetGame().IsDedicatedServer())
6802 {
6804 {
6806
6808 {
6810 }
6811 }
6812
6815 }
6816
6817 m_OldLocation = null;
6818
6820 {
6822 }
6823
6824 if (ConfigIsExisting("headSelectionsToHide"))
6825 {
6828 }
6829
6831 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6832 {
6834 }
6835
6837
6838 m_IsResultOfSplit = false;
6839
6841 }
6842
6844 {
6845 super.InitItemVariables();
6846
6852 m_Count = ConfigGetInt(
"count");
6853
6856
6861
6864
6869
6881
6885
6886
6889 if (ConfigIsExisting("canBeSplit"))
6890 {
6893 }
6894
6896 if (ConfigIsExisting("itemBehaviour"))
6898
6899
6902 RegisterNetSyncVariableInt("m_VarLiquidType");
6903 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6904
6905 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6906 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6907 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6908
6909 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6910 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6911 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6912 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6913
6914 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6915 RegisterNetSyncVariableBool("m_IsTakeable");
6916 RegisterNetSyncVariableBool("m_IsHologram");
6917
6920 {
6923 }
6924
6926
6928 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6930
6931 }
6932
6934 {
6936 }
6937
6939 {
6942 {
6947 }
6948 }
6949
6950 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6951 {
6953 {
6956 }
6957
6959 }
6960
6962 {
6968 }
6969
6971
6973 {
6975
6976 if (!action)
6977 {
6978 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6979 return;
6980 }
6981
6983 if (!ai)
6984 {
6986 return;
6987 }
6988
6990 if (!action_array)
6991 {
6992 action_array = new array<ActionBase_Basic>;
6994 }
6995 if (LogManager.IsActionLogEnable())
6996 {
6997 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6998 }
6999
7000 if (action_array.Find(action) != -1)
7001 {
7002 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7003 }
7004 else
7005 {
7006 action_array.Insert(action);
7007 }
7008 }
7009
7011 {
7013 ActionBase action = player.GetActionManager().GetAction(actionName);
7016
7017 if (action_array)
7018 {
7019 action_array.RemoveItem(action);
7020 }
7021 }
7022
7023
7024
7026 {
7027 ActionOverrideData overrideData = new ActionOverrideData();
7031
7033 if (!actionMap)
7034 {
7037 }
7038
7039 actionMap.Insert(this.
Type(), overrideData);
7040
7041 }
7042
7044
7046
7047
7049 {
7052
7055
7056 string config_to_search = "CfgVehicles";
7057 string muzzle_owner_config;
7058
7060 {
7061 if (IsInherited(Weapon))
7062 config_to_search = "CfgWeapons";
7063
7064 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7065
7066 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7067
7069
7070 if (config_OnFire_subclass_count > 0)
7071 {
7072 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7073
7074 for (int i = 0; i < config_OnFire_subclass_count; i++)
7075 {
7076 string particle_class = "";
7078 string config_OnFire_entry = config_OnFire_class + particle_class;
7079 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7080 WPOF_array.Insert(WPOF);
7081 }
7082
7083
7085 }
7086 }
7087
7089 {
7090 config_to_search = "CfgWeapons";
7091 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7092
7093 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7094
7096
7097 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7098 {
7099 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7100
7101 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7102 {
7103 string particle_class2 = "";
7105 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7106 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7107 WPOBE_array.Insert(WPOBE);
7108 }
7109
7110
7112 }
7113 }
7114 }
7115
7116
7118 {
7121
7123 {
7124 string config_to_search = "CfgVehicles";
7125
7126 if (IsInherited(Weapon))
7127 config_to_search = "CfgWeapons";
7128
7129 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7130 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7131
7132 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7133 {
7134
7136
7138 {
7140 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7142 return;
7143 }
7144
7147
7148
7149
7151 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7152
7153 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7154 {
7155 string particle_class = "";
7157 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7159
7160 if (entry_type == CT_CLASS)
7161 {
7162 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7163 WPOOH_array.Insert(WPOF);
7164 }
7165 }
7166
7167
7169 }
7170 }
7171 }
7172
7174 {
7176 }
7177
7179 {
7181 {
7183
7186
7189
7190 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7191 }
7192 }
7193
7195 {
7197 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7198
7200 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7201
7203 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7204
7206 {
7208 }
7209 }
7210
7212 {
7214 }
7215
7217 {
7220 else
7222
7224 {
7227 }
7228 else
7229 {
7232
7235 }
7236
7238 }
7239
7241 {
7243 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7244 }
7245
7247 {
7249 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7251 }
7252
7254 {
7256 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7257 }
7258
7260 {
7263
7264 OverheatingParticle OP = new OverheatingParticle();
7269
7271 }
7272
7274 {
7277
7278 return -1;
7279 }
7280
7282 {
7284 {
7287
7288 for (int i = count; i > 0; --i)
7289 {
7290 int id = i - 1;
7293
7296
7297 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7298 {
7299 if (p)
7300 {
7303 }
7304 }
7305 }
7306 }
7307 }
7308
7310 {
7312 {
7314 {
7315 int id = i - 1;
7317
7318 if (OP)
7319 {
7321
7322 if (p)
7323 {
7325 }
7326
7327 delete OP;
7328 }
7329 }
7330
7333 }
7334 }
7335
7338 {
7339 return 0.0;
7340 }
7341
7342
7344 {
7345 return 250;
7346 }
7347
7349 {
7350 return 0;
7351 }
7352
7355 {
7357 return true;
7358
7359 return false;
7360 }
7361
7364 {
7367
7369 {
7371 }
7372 else
7373 {
7374
7376 }
7377
7379 }
7380
7387 {
7388 return -1;
7389 }
7390
7391
7392
7393
7395 {
7397 {
7399 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7400
7401 if (r_index >= 0)
7402 {
7403 InventoryLocation r_il = new InventoryLocation;
7404 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7405
7406 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7409 {
7410 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7411 }
7413 {
7414 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7415 }
7416
7417 }
7418
7419 player.GetHumanInventory().ClearUserReservedLocation(this);
7420 }
7421
7424 }
7425
7426
7427
7428
7430 {
7431 return ItemBase.m_DebugActionsMask;
7432 }
7433
7435 {
7436 return ItemBase.m_DebugActionsMask & mask;
7437 }
7438
7440 {
7441 ItemBase.m_DebugActionsMask = mask;
7442 }
7443
7445 {
7446 ItemBase.m_DebugActionsMask |= mask;
7447 }
7448
7450 {
7451 ItemBase.m_DebugActionsMask &= ~mask;
7452 }
7453
7455 {
7457 {
7459 }
7460 else
7461 {
7463 }
7464 }
7465
7466
7468 {
7469 if (GetEconomyProfile())
7470 {
7471 float q_max = GetEconomyProfile().GetQuantityMax();
7472 if (q_max > 0)
7473 {
7474 float q_min = GetEconomyProfile().GetQuantityMin();
7475 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7476
7478 {
7479 ComponentEnergyManager comp = GetCompEM();
7481 {
7483 }
7484 }
7486 {
7488
7489 }
7490
7491 }
7492 }
7493 }
7494
7497 {
7498 EntityAI parent = GetHierarchyParent();
7499
7500 if (parent)
7501 {
7502 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7503 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7504 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7505 }
7506 }
7507
7510 {
7511 EntityAI parent = GetHierarchyParent();
7512
7513 if (parent)
7514 {
7515 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7516 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7517 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7518 }
7519 }
7520
7522 {
7523
7524
7525
7526
7528
7530 {
7531 if (ScriptInputUserData.CanStoreInputUserData())
7532 {
7533 ScriptInputUserData ctx = new ScriptInputUserData;
7539 ctx.
Write(use_stack_max);
7542
7544 {
7545 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7546 }
7547 }
7548 }
7549 else if (!
GetGame().IsMultiplayer())
7550 {
7552 }
7553 }
7554
7556 {
7558 }
7559
7561 {
7563 }
7564
7566 {
7568 }
7569
7571 {
7572
7573 return false;
7574 }
7575
7577 {
7578 return false;
7579 }
7580
7584 {
7585 return false;
7586 }
7587
7589 {
7590 return "";
7591 }
7592
7594
7596 {
7597 return false;
7598 }
7599
7601 {
7602 return true;
7603 }
7604
7605
7606
7608 {
7609 return true;
7610 }
7611
7613 {
7614 return true;
7615 }
7616
7618 {
7619 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7621 }
7622
7624 {
7626 }
7627
7629 {
7631 if (!is_being_placed)
7633 SetSynchDirty();
7634 }
7635
7636
7638
7640 {
7642 }
7643
7645 {
7647 }
7648
7650 {
7651 return 1;
7652 }
7653
7655 {
7656 return false;
7657 }
7658
7660 {
7662 SetSynchDirty();
7663 }
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7700 {
7701 super.OnMovedInsideCargo(container);
7702
7703 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7704 }
7705
7706 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7707 {
7708 super.EEItemLocationChanged(oldLoc,newLoc);
7709
7710 PlayerBase new_player = null;
7711 PlayerBase old_player = null;
7712
7713 if (newLoc.GetParent())
7714 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7715
7716 if (oldLoc.GetParent())
7717 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7718
7720 {
7721 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7722
7723 if (r_index >= 0)
7724 {
7725 InventoryLocation r_il = new InventoryLocation;
7726 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7727
7728 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7731 {
7732 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7733 }
7735 {
7736 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7737 }
7738
7739 }
7740 }
7741
7743 {
7744 if (new_player)
7745 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7746
7747 if (new_player == old_player)
7748 {
7749
7750 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7751 {
7753 {
7754 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7755 {
7756 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7757 }
7758 }
7759 else
7760 {
7761 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7762 }
7763 }
7764
7765 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7766 {
7767 int type = oldLoc.GetType();
7769 {
7770 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7771 }
7773 {
7774 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7775 }
7776 }
7777 if (!m_OldLocation)
7778 {
7779 m_OldLocation = new InventoryLocation;
7780 }
7781 m_OldLocation.Copy(oldLoc);
7782 }
7783 else
7784 {
7785 if (m_OldLocation)
7786 {
7787 m_OldLocation.Reset();
7788 }
7789 }
7790
7792 }
7793 else
7794 {
7795 if (new_player)
7796 {
7797 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7798 if (res_index >= 0)
7799 {
7800 InventoryLocation il = new InventoryLocation;
7801 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7803 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7806 {
7807 il.
GetParent().GetOnReleaseLock().Invoke(it);
7808 }
7810 {
7812 }
7813
7814 }
7815 }
7817 {
7818
7820 }
7821
7822 if (m_OldLocation)
7823 {
7824 m_OldLocation.Reset();
7825 }
7826 }
7827 }
7828
7829 override void EOnContact(IEntity other, Contact extra)
7830 {
7832 {
7833 int liquidType = -1;
7835 if (impactSpeed > 0.0)
7836 {
7838 #ifndef SERVER
7840 #else
7842 SetSynchDirty();
7843 #endif
7845 }
7846 }
7847
7848 #ifdef SERVER
7849 if (GetCompEM() && GetCompEM().IsPlugged())
7850 {
7851 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7852 GetCompEM().UnplugThis();
7853 }
7854 #endif
7855 }
7856
7858
7860 {
7862 }
7863
7865 {
7866
7867 }
7868
7870 {
7871 super.OnItemLocationChanged(old_owner, new_owner);
7872
7873 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7874 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7875
7876 if (!relatedPlayer && playerNew)
7877 relatedPlayer = playerNew;
7878
7879 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7880 {
7882 if (actionMgr)
7883 {
7884 ActionBase currentAction = actionMgr.GetRunningAction();
7885 if (currentAction)
7887 }
7888 }
7889
7890 Man ownerPlayerOld = null;
7891 Man ownerPlayerNew = null;
7892
7893 if (old_owner)
7894 {
7895 if (old_owner.
IsMan())
7896 {
7897 ownerPlayerOld = Man.Cast(old_owner);
7898 }
7899 else
7900 {
7901 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7902 }
7903 }
7904 else
7905 {
7907 {
7909
7910 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7911 {
7912 GetCompEM().UnplugThis();
7913 }
7914 }
7915 }
7916
7917 if (new_owner)
7918 {
7919 if (new_owner.
IsMan())
7920 {
7921 ownerPlayerNew = Man.Cast(new_owner);
7922 }
7923 else
7924 {
7925 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7926 }
7927 }
7928
7929 if (ownerPlayerOld != ownerPlayerNew)
7930 {
7931 if (ownerPlayerOld)
7932 {
7933 array<EntityAI> subItemsExit = new array<EntityAI>;
7935 for (int i = 0; i < subItemsExit.Count(); i++)
7936 {
7939 }
7940 }
7941
7942 if (ownerPlayerNew)
7943 {
7944 array<EntityAI> subItemsEnter = new array<EntityAI>;
7946 for (int j = 0; j < subItemsEnter.Count(); j++)
7947 {
7950 }
7951 }
7952 }
7953 else if (ownerPlayerNew != null)
7954 {
7955 PlayerBase nplayer;
7956 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7957 {
7958 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7960 for (int k = 0; k < subItemsUpdate.Count(); k++)
7961 {
7963 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7964 }
7965 }
7966 }
7967
7968 if (old_owner)
7969 old_owner.OnChildItemRemoved(this);
7970 if (new_owner)
7971 new_owner.OnChildItemReceived(this);
7972 }
7973
7974
7976 {
7977 super.EEDelete(parent);
7978 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7979 if (player)
7980 {
7982
7983 if (player.IsAlive())
7984 {
7985 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7986 if (r_index >= 0)
7987 {
7988 InventoryLocation r_il = new InventoryLocation;
7989 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7990
7991 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7994 {
7995 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7996 }
7998 {
7999 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8000 }
8001
8002 }
8003
8004 player.RemoveQuickBarEntityShortcut(this);
8005 }
8006 }
8007 }
8008
8010 {
8011 super.EEKilled(killer);
8012
8015 {
8016 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8017 {
8018 if (IsMagazine())
8019 {
8020 if (Magazine.Cast(this).GetAmmoCount() > 0)
8021 {
8023 }
8024 }
8025 else
8026 {
8028 }
8029 }
8030 }
8031 }
8032
8034 {
8035 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8036
8037 super.OnWasAttached(parent, slot_id);
8038
8041
8043 }
8044
8046 {
8047 super.OnWasDetached(parent, slot_id);
8048
8051 }
8052
8054 {
8055 int idx;
8058
8059 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8060 if (inventory_slots.Count() < 1)
8061 {
8062 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8063 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8064 }
8065 else
8066 {
8067 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8068 }
8069
8070 idx = inventory_slots.Find(slot);
8071 if (idx < 0)
8072 return "";
8073
8074 return attach_types.Get(idx);
8075 }
8076
8078 {
8079 int idx = -1;
8080 string slot;
8081
8084
8085 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8086 if (inventory_slots.Count() < 1)
8087 {
8088 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8089 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8090 }
8091 else
8092 {
8093 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8094 if (detach_types.Count() < 1)
8095 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8096 }
8097
8098 for (int i = 0; i < inventory_slots.Count(); i++)
8099 {
8100 slot = inventory_slots.Get(i);
8101 }
8102
8103 if (slot != "")
8104 {
8105 if (detach_types.Count() == 1)
8106 idx = 0;
8107 else
8108 idx = inventory_slots.Find(slot);
8109 }
8110 if (idx < 0)
8111 return "";
8112
8113 return detach_types.Get(idx);
8114 }
8115
8117 {
8118
8120
8121
8122 float min_time = 1;
8123 float max_time = 3;
8124 float delay = Math.RandomFloat(min_time, max_time);
8125
8126 explode_timer.Run(delay, this, "DoAmmoExplosion");
8127 }
8128
8130 {
8131 Magazine magazine = Magazine.Cast(this);
8132 int pop_sounds_count = 6;
8133 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8134
8135
8136 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8137 string sound_name = pop_sounds[ sound_idx ];
8139
8140
8141 magazine.ServerAddAmmoCount(-1);
8142
8143
8144 float min_temp_to_explode = 100;
8145
8146 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
8147 {
8149 }
8150 }
8151
8152
8153 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8154 {
8155 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8156
8157 const int CHANCE_DAMAGE_CARGO = 4;
8158 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8159 const int CHANCE_DAMAGE_NOTHING = 2;
8160
8162 {
8163 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8164 int chances;
8165 int rnd;
8166
8167 if (GetInventory().GetCargo())
8168 {
8169 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8170 rnd = Math.RandomInt(0,chances);
8171
8172 if (rnd < CHANCE_DAMAGE_CARGO)
8173 {
8175 }
8176 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8177 {
8179 }
8180 }
8181 else
8182 {
8183 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8184 rnd = Math.RandomInt(0,chances);
8185
8186 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8187 {
8189 }
8190 }
8191 }
8192 }
8193
8195 {
8196 if (GetInventory().GetCargo())
8197 {
8198 int item_count = GetInventory().GetCargo().GetItemCount();
8199 if (item_count > 0)
8200 {
8201 int random_pick = Math.RandomInt(0, item_count);
8203 if (!item.IsExplosive())
8204 {
8205 item.AddHealth("","",damage);
8206 return true;
8207 }
8208 }
8209 }
8210 return false;
8211 }
8212
8214 {
8215 int attachment_count = GetInventory().AttachmentCount();
8216 if (attachment_count > 0)
8217 {
8218 int random_pick = Math.RandomInt(0, attachment_count);
8219 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8220 if (!attachment.IsExplosive())
8221 {
8222 attachment.AddHealth("","",damage);
8223 return true;
8224 }
8225 }
8226 return false;
8227 }
8228
8230 {
8232 }
8233
8235 {
8237 return GetInventory().CanRemoveEntity();
8238
8239 return false;
8240 }
8241
8243 {
8244
8246 return false;
8247
8248
8250 return false;
8251
8252
8253
8255 if (delta == 0)
8256 return false;
8257
8258
8259 return true;
8260 }
8261
8263 {
8265 {
8266 if (ScriptInputUserData.CanStoreInputUserData())
8267 {
8268 ScriptInputUserData ctx = new ScriptInputUserData;
8273 ctx.
Write(destination_entity);
8277 }
8278 }
8279 else if (!
GetGame().IsMultiplayer())
8280 {
8282 }
8283 }
8284
8286 {
8287 float split_quantity_new;
8291 InventoryLocation loc = new InventoryLocation;
8292
8293 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8294 {
8296 split_quantity_new = stack_max;
8297 else
8299
8301 {
8302 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8303 if (new_item)
8304 {
8305 new_item.SetResultOfSplit(true);
8306 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8308 new_item.
SetQuantity(split_quantity_new,
false,
true);
8309 }
8310 }
8311 }
8312 else if (destination_entity && slot_id == -1)
8313 {
8314 if (quantity > stack_max)
8315 split_quantity_new = stack_max;
8316 else
8317 split_quantity_new = quantity;
8318
8320 {
8322 {
8325 }
8326
8327 if (new_item)
8328 {
8329 new_item.SetResultOfSplit(true);
8330 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8332 new_item.
SetQuantity(split_quantity_new,
false,
true);
8333 }
8334 }
8335 }
8336 else
8337 {
8338 if (stack_max != 0)
8339 {
8341 {
8343 }
8344
8345 if (split_quantity_new == 0)
8346 {
8347 if (!
GetGame().IsMultiplayer())
8348 player.PhysicalPredictiveDropItem(this);
8349 else
8350 player.ServerDropEntity(this);
8351 return;
8352 }
8353
8355 {
8357
8358 if (new_item)
8359 {
8360 new_item.SetResultOfSplit(true);
8361 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8364 new_item.PlaceOnSurface();
8365 }
8366 }
8367 }
8368 }
8369 }
8370
8372 {
8373 float split_quantity_new;
8377 InventoryLocation loc = new InventoryLocation;
8378
8379 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8380 {
8382 split_quantity_new = stack_max;
8383 else
8385
8387 {
8388 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8389 if (new_item)
8390 {
8391 new_item.SetResultOfSplit(true);
8392 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8394 new_item.
SetQuantity(split_quantity_new,
false,
true);
8395 }
8396 }
8397 }
8398 else if (destination_entity && slot_id == -1)
8399 {
8400 if (quantity > stack_max)
8401 split_quantity_new = stack_max;
8402 else
8403 split_quantity_new = quantity;
8404
8406 {
8408 {
8411 }
8412
8413 if (new_item)
8414 {
8415 new_item.SetResultOfSplit(true);
8416 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8418 new_item.
SetQuantity(split_quantity_new,
false,
true);
8419 }
8420 }
8421 }
8422 else
8423 {
8424 if (stack_max != 0)
8425 {
8427 {
8429 }
8430
8432 {
8434
8435 if (new_item)
8436 {
8437 new_item.SetResultOfSplit(true);
8438 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8441 new_item.PlaceOnSurface();
8442 }
8443 }
8444 }
8445 }
8446 }
8447
8449 {
8451 {
8452 if (ScriptInputUserData.CanStoreInputUserData())
8453 {
8454 ScriptInputUserData ctx = new ScriptInputUserData;
8459 dst.WriteToContext(ctx);
8461 }
8462 }
8463 else if (!
GetGame().IsMultiplayer())
8464 {
8466 }
8467 }
8468
8470 {
8472 {
8473 if (ScriptInputUserData.CanStoreInputUserData())
8474 {
8475 ScriptInputUserData ctx = new ScriptInputUserData;
8480 ctx.
Write(destination_entity);
8486 }
8487 }
8488 else if (!
GetGame().IsMultiplayer())
8489 {
8491 }
8492 }
8493
8495 {
8497 }
8498
8500 {
8502 float split_quantity_new;
8504 if (dst.IsValid())
8505 {
8506 int slot_id = dst.GetSlot();
8508
8509 if (quantity > stack_max)
8510 split_quantity_new = stack_max;
8511 else
8512 split_quantity_new = quantity;
8513
8515 {
8517
8518 if (new_item)
8519 {
8520 new_item.SetResultOfSplit(true);
8521 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8523 new_item.
SetQuantity(split_quantity_new,
false,
true);
8524 }
8525
8526 return new_item;
8527 }
8528 }
8529
8530 return null;
8531 }
8532
8534 {
8536 float split_quantity_new;
8538 if (destination_entity)
8539 {
8541 if (quantity > stackable)
8542 split_quantity_new = stackable;
8543 else
8544 split_quantity_new = quantity;
8545
8547 {
8548 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8549 if (new_item)
8550 {
8551 new_item.SetResultOfSplit(true);
8552 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8554 new_item.
SetQuantity(split_quantity_new,
false,
true);
8555 }
8556 }
8557 }
8558 }
8559
8561 {
8563 {
8564 if (ScriptInputUserData.CanStoreInputUserData())
8565 {
8566 ScriptInputUserData ctx = new ScriptInputUserData;
8571 ItemBase destination_entity =
this;
8572 ctx.
Write(destination_entity);
8576 }
8577 }
8578 else if (!
GetGame().IsMultiplayer())
8579 {
8581 }
8582 }
8583
8585 {
8587 float split_quantity_new;
8589 if (player)
8590 {
8592 if (quantity > stackable)
8593 split_quantity_new = stackable;
8594 else
8595 split_quantity_new = quantity;
8596
8598 {
8599 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8600 new_item =
ItemBase.Cast(in_hands);
8601 if (new_item)
8602 {
8603 new_item.SetResultOfSplit(true);
8604 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8606 new_item.SetQuantity(split_quantity_new, false, true);
8607 }
8608 }
8609 }
8610 }
8611
8613 {
8615 float split_quantity_new = Math.Floor(quantity * 0.5);
8616
8618 return;
8619
8621
8622 if (new_item)
8623 {
8624 if (new_item.GetQuantityMax() < split_quantity_new)
8625 {
8626 split_quantity_new = new_item.GetQuantityMax();
8627 }
8628
8629 new_item.SetResultOfSplit(true);
8630 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8631
8633 {
8636 }
8637 else
8638 {
8640 new_item.
SetQuantity(split_quantity_new,
false,
true);
8641 }
8642 }
8643 }
8644
8646 {
8648 float split_quantity_new = Math.Floor(quantity / 2);
8649
8651 return;
8652
8653 InventoryLocation invloc = new InventoryLocation;
8655
8657 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8658
8659 if (new_item)
8660 {
8661 if (new_item.GetQuantityMax() < split_quantity_new)
8662 {
8663 split_quantity_new = new_item.GetQuantityMax();
8664 }
8666 {
8669 }
8670 else if (split_quantity_new > 1)
8671 {
8673 new_item.
SetQuantity(split_quantity_new,
false,
true);
8674 }
8675 }
8676 }
8677
8680 {
8681 SetWeightDirty();
8683
8684 if (parent)
8685 parent.OnAttachmentQuantityChangedEx(this, delta);
8686
8688 {
8690 {
8692 }
8694 {
8695 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8697 }
8698 }
8699
8700 }
8701
8704 {
8705
8706 }
8707
8710 {
8712 }
8713
8715 {
8716 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8717
8719 {
8720 if (newLevel == GameConstants.STATE_RUINED)
8721 {
8723 EntityAI parent = GetHierarchyParent();
8724 if (parent && parent.IsFireplace())
8725 {
8726 CargoBase cargo = GetInventory().GetCargo();
8727 if (cargo)
8728 {
8730 {
8732 }
8733 }
8734 }
8735 }
8736
8738 {
8739
8741 return;
8742 }
8743
8744 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8745 {
8747 }
8748 }
8749 }
8750
8751
8753 {
8754 super.OnRightClick();
8755
8757 {
8759 {
8760 if (ScriptInputUserData.CanStoreInputUserData())
8761 {
8762 EntityAI root = GetHierarchyRoot();
8763 Man playerOwner = GetHierarchyRootPlayer();
8764 InventoryLocation dst = new InventoryLocation;
8765
8766
8767 if (!playerOwner && root && root == this)
8768 {
8770 }
8771 else
8772 {
8773
8774 GetInventory().GetCurrentInventoryLocation(dst);
8776 {
8779 {
8781 }
8782 else
8783 {
8785
8786
8787 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8788 {
8790 }
8791 else
8792 {
8793 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8794 }
8795 }
8796 }
8797 }
8798
8799 ScriptInputUserData ctx = new ScriptInputUserData;
8807 }
8808 }
8809 else if (!
GetGame().IsMultiplayer())
8810 {
8812 }
8813 }
8814 }
8815
8817 {
8818 if (root)
8819 {
8820 vector m4[4];
8821 root.GetTransform(m4);
8822 dst.SetGround(this, m4);
8823 }
8824 else
8825 {
8826 GetInventory().GetCurrentInventoryLocation(dst);
8827 }
8828 }
8829
8830 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8831 {
8832
8833 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8834 return false;
8835
8836 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8837 return false;
8838
8839
8841 return false;
8842
8843
8844 Magazine mag = Magazine.Cast(this);
8845 if (mag)
8846 {
8847 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8848 return false;
8849
8850 if (stack_max_limit)
8851 {
8852 Magazine other_mag = Magazine.Cast(other_item);
8853 if (other_item)
8854 {
8855 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8856 return false;
8857 }
8858
8859 }
8860 }
8861 else
8862 {
8863
8865 return false;
8866
8868 return false;
8869 }
8870
8871 PlayerBase player = null;
8872 if (CastTo(player, GetHierarchyRootPlayer()))
8873 {
8874 if (player.GetInventory().HasAttachment(this))
8875 return false;
8876
8877 if (player.IsItemsToDelete())
8878 return false;
8879 }
8880
8881 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8882 return false;
8883
8884 int slotID;
8886 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8887 return false;
8888
8889 return true;
8890 }
8891
8893 {
8895 }
8896
8898 {
8899 return m_IsResultOfSplit;
8900 }
8901
8903 {
8904 m_IsResultOfSplit = value;
8905 }
8906
8908 {
8910 }
8911
8913 {
8914 float other_item_quantity = other_item.GetQuantity();
8915 float this_free_space;
8916
8918
8920
8921 if (other_item_quantity > this_free_space)
8922 {
8923 return this_free_space;
8924 }
8925 else
8926 {
8927 return other_item_quantity;
8928 }
8929 }
8930
8932 {
8934 }
8935
8937 {
8939 return;
8940
8941 if (!IsMagazine() && other_item)
8942 {
8944 if (quantity_used != 0)
8945 {
8946 float hp1 = GetHealth01("","");
8947 float hp2 = other_item.GetHealth01("","");
8948 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8949 hpResult = hpResult / (
GetQuantity() + quantity_used);
8950
8951 hpResult *= GetMaxHealth();
8952 Math.Round(hpResult);
8953 SetHealth("", "Health", hpResult);
8954
8956 other_item.AddQuantity(-quantity_used);
8957 }
8958 }
8960 }
8961
8963 {
8964 #ifdef SERVER
8965 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8966 GetHierarchyParent().IncreaseLifetimeUp();
8967 #endif
8968 };
8969
8971 {
8972 PlayerBase p = PlayerBase.Cast(player);
8973
8974 array<int> recipesIds = p.m_Recipes;
8975 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8976 if (moduleRecipesManager)
8977 {
8978 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8979 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8980 }
8981
8982 for (int i = 0;i < recipesIds.Count(); i++)
8983 {
8984 int key = recipesIds.Get(i);
8985 string recipeName = moduleRecipesManager.GetRecipeName(key);
8987 }
8988 }
8989
8990
8991 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8992 {
8993 super.GetDebugActions(outputList);
8994
8995
9001
9002
9007
9012
9013
9017
9018
9020 {
9024 }
9025
9028
9029
9033
9035
9036 InventoryLocation loc = new InventoryLocation();
9037 GetInventory().GetCurrentInventoryLocation(loc);
9039 {
9040 if (Gizmo_IsSupported())
9043 }
9044
9046 }
9047
9048
9049
9050
9052 {
9053 super.OnAction(action_id, player, ctx);
9054
9056 {
9057 switch (action_id)
9058 {
9061 return true;
9064 return true;
9065 }
9066 }
9067
9069 {
9070 switch (action_id)
9071 {
9073 Delete();
9074 return true;
9075 }
9076 }
9077
9078 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9079 {
9080 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9081 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9082 PlayerBase p = PlayerBase.Cast(player);
9083 if (
EActions.RECIPES_RANGE_START < 1000)
9084 {
9085 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9086 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9087 }
9088 }
9089 #ifndef SERVER
9090 else if (action_id ==
EActions.WATCH_PLAYER)
9091 {
9092 PluginDeveloper.SetDeveloperItemClientEx(player);
9093 }
9094 #endif
9096 {
9097 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9098 {
9099 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9100 OnDebugButtonPressServer(id + 1);
9101 }
9102
9103 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9104 {
9105 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9107 }
9108
9109 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9110 {
9111 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9113 }
9114
9115 else if (action_id ==
EActions.ADD_QUANTITY)
9116 {
9117 if (IsMagazine())
9118 {
9119 Magazine mag = Magazine.Cast(this);
9120 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9121 }
9122 else
9123 {
9125 }
9126
9127 if (m_EM)
9128 {
9129 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9130 }
9131
9132 }
9133
9134 else if (action_id ==
EActions.REMOVE_QUANTITY)
9135 {
9136 if (IsMagazine())
9137 {
9138 Magazine mag2 = Magazine.Cast(this);
9139 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9140 }
9141 else
9142 {
9144 }
9145 if (m_EM)
9146 {
9147 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9148 }
9149
9150 }
9151
9152 else if (action_id ==
EActions.SET_QUANTITY_0)
9153 {
9155
9156 if (m_EM)
9157 {
9158 m_EM.SetEnergy(0);
9159 }
9160 }
9161
9162 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9163 {
9165
9166 if (m_EM)
9167 {
9168 m_EM.SetEnergy(m_EM.GetEnergyMax());
9169 }
9170 }
9171
9172 else if (action_id ==
EActions.ADD_HEALTH)
9173 {
9174 AddHealth("","",GetMaxHealth("","Health")/5);
9175 }
9176 else if (action_id ==
EActions.REMOVE_HEALTH)
9177 {
9178 AddHealth("","",-GetMaxHealth("","Health")/5);
9179 }
9180 else if (action_id ==
EActions.DESTROY_HEALTH)
9181 {
9182 SetHealth01("","",0);
9183 }
9184 else if (action_id ==
EActions.WATCH_ITEM)
9185 {
9187 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9188 #ifdef DEVELOPER
9189 SetDebugDeveloper_item(this);
9190 #endif
9191 }
9192
9193 else if (action_id ==
EActions.ADD_TEMPERATURE)
9194 {
9195 AddTemperature(20);
9196
9197 }
9198
9199 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9200 {
9201 AddTemperature(-20);
9202
9203 }
9204
9205 else if (action_id ==
EActions.FLIP_FROZEN)
9206 {
9207 SetFrozen(!GetIsFrozen());
9208
9209 }
9210
9211 else if (action_id ==
EActions.ADD_WETNESS)
9212 {
9214
9215 }
9216
9217 else if (action_id ==
EActions.REMOVE_WETNESS)
9218 {
9220
9221 }
9222
9223 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9224 {
9227
9228
9229 }
9230
9231 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9232 {
9235 }
9236
9237 else if (action_id ==
EActions.MAKE_SPECIAL)
9238 {
9239 auto debugParams = DebugSpawnParams.WithPlayer(player);
9240 OnDebugSpawnEx(debugParams);
9241 }
9242
9243 }
9244
9245
9246 return false;
9247 }
9248
9249
9250
9251
9255
9258
9259
9260
9262 {
9263 return false;
9264 }
9265
9266
9268 {
9269 return true;
9270 }
9271
9272
9274 {
9275 return true;
9276 }
9277
9278
9279
9281 {
9282 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9284 }
9285
9288 {
9289 return null;
9290 }
9291
9293 {
9294 return false;
9295 }
9296
9298 {
9299 return false;
9300 }
9301
9305
9306
9308 {
9309 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9310 return module_repairing.CanRepair(this, item_repair_kit);
9311 }
9312
9313
9314 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9315 {
9316 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9317 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9318 }
9319
9320
9322 {
9323
9324
9325
9326
9327
9328
9329
9330
9331 return 1;
9332 }
9333
9334
9335
9337 {
9339 }
9340
9341
9342
9344 {
9346 }
9347
9348
9357 {
9358 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9359
9360 if (player)
9361 {
9362 player.MessageStatus(text);
9363 }
9364 }
9365
9366
9375 {
9376 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9377
9378 if (player)
9379 {
9380 player.MessageAction(text);
9381 }
9382 }
9383
9384
9393 {
9394 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9395
9396 if (player)
9397 {
9398 player.MessageFriendly(text);
9399 }
9400 }
9401
9402
9411 {
9412 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9413
9414 if (player)
9415 {
9416 player.MessageImportant(text);
9417 }
9418 }
9419
9421 {
9422 return true;
9423 }
9424
9425
9426 override bool KindOf(
string tag)
9427 {
9428 bool found = false;
9429 string item_name = this.
GetType();
9432
9433 int array_size = item_tag_array.Count();
9434 for (int i = 0; i < array_size; i++)
9435 {
9436 if (item_tag_array.Get(i) == tag)
9437 {
9438 found = true;
9439 break;
9440 }
9441 }
9442 return found;
9443 }
9444
9445
9447 {
9448
9449 super.OnRPC(sender, rpc_type,ctx);
9450
9451
9452 switch (rpc_type)
9453 {
9454 #ifndef SERVER
9455 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9456 Param2<bool, string> p = new Param2<bool, string>(false, "");
9457
9459 return;
9460
9461 bool play = p.param1;
9462 string soundSet = p.param2;
9463
9464 if (play)
9465 {
9467 {
9469 {
9471 }
9472 }
9473 else
9474 {
9476 }
9477 }
9478 else
9479 {
9481 }
9482
9483 break;
9484 #endif
9485
9486 }
9487
9489 {
9491 }
9492 }
9493
9494
9495
9496
9498 {
9499 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9500 return plugin.GetID(
name);
9501 }
9502
9504 {
9505 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9506 return plugin.GetName(id);
9507 }
9508
9511 {
9512
9513
9514 int varFlags;
9515 if (!ctx.
Read(varFlags))
9516 return;
9517
9518 if (varFlags & ItemVariableFlags.FLOAT)
9519 {
9521 }
9522 }
9523
9525 {
9526
9527 super.SerializeNumericalVars(floats_out);
9528
9529
9530
9532 {
9534 }
9535
9537 {
9539 }
9540
9542 {
9544 }
9545
9547 {
9552 }
9553
9555 {
9557 }
9558 }
9559
9561 {
9562
9563 super.DeSerializeNumericalVars(floats);
9564
9565
9566 int index = 0;
9567 int mask = Math.Round(floats.Get(index));
9568
9569 index++;
9570
9572 {
9574 {
9576 }
9577 else
9578 {
9579 float quantity = floats.Get(index);
9581 }
9582 index++;
9583 }
9584
9586 {
9587 float wet = floats.Get(index);
9589 index++;
9590 }
9591
9593 {
9594 int liquidtype = Math.Round(floats.Get(index));
9596 index++;
9597 }
9598
9600 {
9602 index++;
9604 index++;
9606 index++;
9608 index++;
9609 }
9610
9612 {
9613 int cleanness = Math.Round(floats.Get(index));
9615 index++;
9616 }
9617 }
9618
9620 {
9621 super.WriteVarsToCTX(ctx);
9622
9623
9625 {
9627 }
9628
9630 {
9632 }
9633
9635 {
9637 }
9638
9640 {
9641 int r,g,b,a;
9647 }
9648
9650 {
9652 }
9653 }
9654
9656 {
9657 if (!super.ReadVarsFromCTX(ctx,version))
9658 return false;
9659
9660 int intValue;
9661 float value;
9662
9663 if (version < 140)
9664 {
9665 if (!ctx.
Read(intValue))
9666 return false;
9667
9668 m_VariablesMask = intValue;
9669 }
9670
9672 {
9673 if (!ctx.
Read(value))
9674 return false;
9675
9677 {
9679 }
9680 else
9681 {
9683 }
9684 }
9685
9686 if (version < 140)
9687 {
9689 {
9690 if (!ctx.
Read(value))
9691 return false;
9692 SetTemperatureDirect(value);
9693 }
9694 }
9695
9697 {
9698 if (!ctx.
Read(value))
9699 return false;
9701 }
9702
9704 {
9705 if (!ctx.
Read(intValue))
9706 return false;
9708 }
9709
9711 {
9712 int r,g,b,a;
9714 return false;
9716 return false;
9718 return false;
9720 return false;
9721
9723 }
9724
9726 {
9727 if (!ctx.
Read(intValue))
9728 return false;
9730 }
9731
9732 if (version >= 138 && version < 140)
9733 {
9735 {
9736 if (!ctx.
Read(intValue))
9737 return false;
9738 SetFrozen(intValue);
9739 }
9740 }
9741
9742 return true;
9743 }
9744
9745
9747 {
9750 {
9752 }
9753
9754 if (!super.OnStoreLoad(ctx, version))
9755 {
9757 return false;
9758 }
9759
9760 if (version >= 114)
9761 {
9762 bool hasQuickBarIndexSaved;
9763
9764 if (!ctx.
Read(hasQuickBarIndexSaved))
9765 {
9767 return false;
9768 }
9769
9770 if (hasQuickBarIndexSaved)
9771 {
9772 int itmQBIndex;
9773
9774
9775 if (!ctx.
Read(itmQBIndex))
9776 {
9778 return false;
9779 }
9780
9781 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9782 if (itmQBIndex != -1 && parentPlayer)
9783 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9784 }
9785 }
9786 else
9787 {
9788
9789 PlayerBase player;
9790 int itemQBIndex;
9791 if (version ==
int.
MAX)
9792 {
9793 if (!ctx.
Read(itemQBIndex))
9794 {
9796 return false;
9797 }
9798 }
9799 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9800 {
9801
9802 if (!ctx.
Read(itemQBIndex))
9803 {
9805 return false;
9806 }
9807 if (itemQBIndex != -1 && player)
9808 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9809 }
9810 }
9811
9812 if (version < 140)
9813 {
9814
9815 if (!LoadVariables(ctx, version))
9816 {
9818 return false;
9819 }
9820 }
9821
9822
9824 {
9826 return false;
9827 }
9828 if (version >= 132)
9829 {
9831 if (raib)
9832 {
9834 {
9836 return false;
9837 }
9838 }
9839 }
9840
9842 return true;
9843 }
9844
9845
9846
9848 {
9849 super.OnStoreSave(ctx);
9850
9851 PlayerBase player;
9852 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9853 {
9855
9856 int itemQBIndex = -1;
9857 itemQBIndex = player.FindQuickBarEntityIndex(this);
9858 ctx.
Write(itemQBIndex);
9859 }
9860 else
9861 {
9863 }
9864
9866
9868 if (raib)
9869 {
9871 }
9872 }
9873
9874
9876 {
9877 super.AfterStoreLoad();
9878
9880 {
9882 }
9883
9885 {
9888 }
9889 }
9890
9892 {
9893 super.EEOnAfterLoad();
9894
9896 {
9898 }
9899
9902 }
9903
9905 {
9906 return false;
9907 }
9908
9909
9910
9912 {
9914 {
9915 #ifdef PLATFORM_CONSOLE
9916
9918 {
9920 if (menu)
9921 {
9923 }
9924 }
9925 #endif
9926 }
9927
9929 {
9932 }
9933
9935 {
9936 SetWeightDirty();
9938 }
9940 {
9943 }
9944
9946 {
9949 }
9951 {
9954 }
9955
9956 super.OnVariablesSynchronized();
9957 }
9958
9959
9960
9962 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9963 {
9964 if (!IsServerCheck(allow_client))
9965 return false;
9966
9968 return false;
9969
9972
9973 if (value <= (min + 0.001))
9974 value = min;
9975
9976 if (value == min)
9977 {
9978 if (destroy_config)
9979 {
9980 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9981 if (dstr)
9982 {
9984 this.Delete();
9985 return true;
9986 }
9987 }
9988 else if (destroy_forced)
9989 {
9991 this.Delete();
9992 return true;
9993 }
9994
9996 }
9997
10000
10002 {
10004
10005 if (delta)
10007 }
10008
10010
10011 return false;
10012 }
10013
10014
10016 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10017 {
10019 }
10020
10022 {
10025 }
10026
10028 {
10031 }
10032
10034 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10035 {
10036 float value_clamped = Math.Clamp(value, 0, 1);
10038 SetQuantity(result, destroy_config, destroy_forced);
10039 }
10040
10041
10044 {
10046 }
10047
10049 {
10051 }
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10063 {
10064 int slot = -1;
10065 if (GetInventory())
10066 {
10067 InventoryLocation il = new InventoryLocation;
10068 GetInventory().GetCurrentInventoryLocation(il);
10070 }
10071
10073 }
10074
10076 {
10077 float quantity_max = 0;
10078
10080 {
10081 if (attSlotID != -1)
10082 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10083
10084 if (quantity_max <= 0)
10086 }
10087
10088 if (quantity_max <= 0)
10090
10091 return quantity_max;
10092 }
10093
10095 {
10097 }
10098
10100 {
10102 }
10103
10104
10106 {
10108 }
10109
10111 {
10113 }
10114
10116 {
10118 }
10119
10120
10122 {
10123
10124 float weightEx = GetWeightEx();
10125 float special = GetInventoryAndCargoWeight();
10126 return weightEx - special;
10127 }
10128
10129
10131 {
10133 }
10134
10136 {
10138 {
10139 #ifdef DEVELOPER
10140 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10141 {
10142 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10144 }
10145 #endif
10146
10147 return GetQuantity() * GetConfigWeightModified();
10148 }
10149 else if (HasEnergyManager())
10150 {
10151 #ifdef DEVELOPER
10152 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10153 {
10154 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10155 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10156 }
10157 #endif
10158 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
10159 }
10160 else
10161 {
10162 #ifdef DEVELOPER
10163 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10164 {
10165 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10166 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10167 }
10168 #endif
10169 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
10170 }
10171 }
10172
10175 {
10176 int item_count = 0;
10178
10179 if (GetInventory().GetCargo() != NULL)
10180 {
10181 item_count = GetInventory().GetCargo().GetItemCount();
10182 }
10183
10184 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10185 {
10186 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10187 if (item)
10188 item_count += item.GetNumberOfItems();
10189 }
10190 return item_count;
10191 }
10192
10195 {
10196 float weight = 0;
10197 float wetness = 1;
10198 if (include_wetness)
10201 {
10202 weight = wetness * m_ConfigWeight;
10203 }
10205 {
10206 weight = 1;
10207 }
10208 return weight;
10209 }
10210
10211
10212
10214 {
10215 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10216 {
10217 GameInventory inv = GetInventory();
10218 array<EntityAI> items = new array<EntityAI>;
10220 for (int i = 0; i < items.Count(); i++)
10221 {
10223 if (item)
10224 {
10226 }
10227 }
10228 }
10229 }
10230
10231
10232
10233
10235 {
10236 float energy = 0;
10237 if (HasEnergyManager())
10238 {
10239 energy = GetCompEM().GetEnergy();
10240 }
10241 return energy;
10242 }
10243
10244
10246 {
10247 super.OnEnergyConsumed();
10248
10250 }
10251
10253 {
10254 super.OnEnergyAdded();
10255
10257 }
10258
10259
10261 {
10262 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10263 {
10265 {
10266 float energy_0to1 = GetCompEM().GetEnergy0To1();
10268 }
10269 }
10270 }
10271
10272
10274 {
10275 return ConfigGetFloat("heatIsolation");
10276 }
10277
10279 {
10281 }
10282
10284 {
10285 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10286 if (
GetGame().ConfigIsExisting(paramPath))
10288
10289 return 0.0;
10290 }
10291
10293 {
10294 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10295 if (
GetGame().ConfigIsExisting(paramPath))
10297
10298 return 0.0;
10299 }
10300
10301 override void SetWet(
float value,
bool allow_client =
false)
10302 {
10303 if (!IsServerCheck(allow_client))
10304 return;
10305
10308
10310
10311 m_VarWet = Math.Clamp(value, min, max);
10312
10314 {
10317 }
10318 }
10319
10320 override void AddWet(
float value)
10321 {
10323 }
10324
10326 {
10328 }
10329
10331 {
10333 }
10334
10336 {
10338 }
10339
10341 {
10343 }
10344
10346 {
10348 }
10349
10350 override void OnWetChanged(
float newVal,
float oldVal)
10351 {
10354 if (newLevel != oldLevel)
10355 {
10357 }
10358 }
10359
10361 {
10362 SetWeightDirty();
10363 }
10364
10366 {
10367 return GetWetLevelInternal(
m_VarWet);
10368 }
10369
10370
10371
10373 {
10375 }
10376
10378 {
10380 }
10381
10383 {
10385 }
10386
10388 {
10390 }
10391
10392
10393
10395 {
10396 if (ConfigIsExisting("itemModelLength"))
10397 {
10398 return ConfigGetFloat("itemModelLength");
10399 }
10400 return 0;
10401 }
10402
10404 {
10405 if (ConfigIsExisting("itemAttachOffset"))
10406 {
10407 return ConfigGetFloat("itemAttachOffset");
10408 }
10409 return 0;
10410 }
10411
10412 override void SetCleanness(
int value,
bool allow_client =
false)
10413 {
10414 if (!IsServerCheck(allow_client))
10415 return;
10416
10418
10420
10423 }
10424
10426 {
10428 }
10429
10431 {
10432 return true;
10433 }
10434
10435
10436
10437
10439 {
10441 }
10442
10444 {
10446 }
10447
10448
10449
10450
10451 override void SetColor(
int r,
int g,
int b,
int a)
10452 {
10458 }
10460 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10461 {
10466 }
10467
10469 {
10471 }
10472
10475 {
10476 int r,g,b,a;
10478 r = r/255;
10479 g = g/255;
10480 b = b/255;
10481 a = a/255;
10482 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10483 }
10484
10485
10486
10487 override void SetLiquidType(
int value,
bool allow_client =
false)
10488 {
10489 if (!IsServerCheck(allow_client))
10490 return;
10491
10496 }
10497
10499 {
10500 return ConfigGetInt("varLiquidTypeInit");
10501 }
10502
10504 {
10506 }
10507
10509 {
10511 SetFrozen(false);
10512 }
10513
10516 {
10517 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10518 }
10519
10520
10523 {
10524 PlayerBase nplayer;
10525 if (PlayerBase.CastTo(nplayer, player))
10526 {
10528
10529 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10530 }
10531 }
10532
10533
10536 {
10537 PlayerBase nplayer;
10538 if (PlayerBase.CastTo(nplayer,player))
10539 {
10540
10541 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10542
10543 }
10544
10545
10546 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10547
10548
10549 if (HasEnergyManager())
10550 {
10551 GetCompEM().UpdatePlugState();
10552 }
10553 }
10554
10555
10557 {
10558 super.OnPlacementStarted(player);
10559
10561 }
10562
10563 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10564 {
10566 {
10567 m_AdminLog.OnPlacementComplete(player,
this);
10568 }
10569
10570 super.OnPlacementComplete(player, position, orientation);
10571 }
10572
10573
10574
10575
10576
10578 {
10580 {
10581 return true;
10582 }
10583 else
10584 {
10585 return false;
10586 }
10587 }
10588
10589
10591 {
10593 {
10595 }
10596 }
10597
10598
10600 {
10602 }
10603
10605 {
10607 }
10608
10609 override void InsertAgent(
int agent,
float count = 1)
10610 {
10611 if (count < 1)
10612 return;
10613
10615 }
10616
10619 {
10621 }
10622
10623
10625 {
10627 }
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10671 {
10673 return false;
10674 return true;
10675 }
10676
10678 {
10679
10681 }
10682
10683
10686 {
10687 super.CheckForRoofLimited(timeTresholdMS);
10688
10690 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10691 {
10692 m_PreviousRoofTestTime = time;
10693 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10694 }
10695 }
10696
10697
10699 {
10701 {
10702 return 0;
10703 }
10704
10705 if (GetInventory().GetAttachmentSlotsCount() != 0)
10706 {
10707 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10708 if (filter)
10709 return filter.GetProtectionLevel(type, false, system);
10710 else
10711 return 0;
10712 }
10713
10714 string subclassPath, entryName;
10715
10716 switch (type)
10717 {
10719 entryName = "biological";
10720 break;
10722 entryName = "chemical";
10723 break;
10724 default:
10725 entryName = "biological";
10726 break;
10727 }
10728
10729 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10730
10732 }
10733
10734
10735
10738 {
10739 if (!IsMagazine())
10741
10743 }
10744
10745
10746
10747
10748
10753 {
10754 return true;
10755 }
10756
10758 {
10760 }
10761
10762
10763
10764
10765
10767 {
10768 if (parent)
10769 {
10770 if (parent.IsInherited(DayZInfected))
10771 return true;
10772
10773 if (!parent.IsRuined())
10774 return true;
10775 }
10776
10777 return true;
10778 }
10779
10781 {
10782 if (!super.CanPutAsAttachment(parent))
10783 {
10784 return false;
10785 }
10786
10787 if (!IsRuined() && !parent.IsRuined())
10788 {
10789 return true;
10790 }
10791
10792 return false;
10793 }
10794
10796 {
10797
10798
10799
10800
10801 return super.CanReceiveItemIntoCargo(item);
10802 }
10803
10805 {
10806
10807
10808
10809
10810 GameInventory attachmentInv = attachment.GetInventory();
10812 {
10813 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10814 return false;
10815 }
10816
10817 InventoryLocation loc = new InventoryLocation();
10818 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10819 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10820 return false;
10821
10822 return super.CanReceiveAttachment(attachment, slotId);
10823 }
10824
10826 {
10827 if (!super.CanReleaseAttachment(attachment))
10828 return false;
10829
10830 return GetInventory().AreChildrenAccessible();
10831 }
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10854 {
10855 int id = muzzle_owner.GetMuzzleID();
10856 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10857
10858 if (WPOF_array)
10859 {
10860 for (int i = 0; i < WPOF_array.Count(); i++)
10861 {
10862 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10863
10864 if (WPOF)
10865 {
10866 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10867 }
10868 }
10869 }
10870 }
10871
10872
10874 {
10875 int id = muzzle_owner.GetMuzzleID();
10877
10878 if (WPOBE_array)
10879 {
10880 for (int i = 0; i < WPOBE_array.Count(); i++)
10881 {
10882 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10883
10884 if (WPOBE)
10885 {
10886 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10887 }
10888 }
10889 }
10890 }
10891
10892
10894 {
10895 int id = muzzle_owner.GetMuzzleID();
10896 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10897
10898 if (WPOOH_array)
10899 {
10900 for (int i = 0; i < WPOOH_array.Count(); i++)
10901 {
10902 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10903
10904 if (WPOOH)
10905 {
10906 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10907 }
10908 }
10909 }
10910 }
10911
10912
10914 {
10915 int id = muzzle_owner.GetMuzzleID();
10916 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10917
10918 if (WPOOH_array)
10919 {
10920 for (int i = 0; i < WPOOH_array.Count(); i++)
10921 {
10922 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10923
10924 if (WPOOH)
10925 {
10926 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10927 }
10928 }
10929 }
10930 }
10931
10932
10934 {
10935 int id = muzzle_owner.GetMuzzleID();
10936 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10937
10938 if (WPOOH_array)
10939 {
10940 for (int i = 0; i < WPOOH_array.Count(); i++)
10941 {
10942 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10943
10944 if (WPOOH)
10945 {
10946 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10947 }
10948 }
10949 }
10950 }
10951
10952
10953
10955 {
10957 {
10958 return true;
10959 }
10960
10961 return false;
10962 }
10963
10965 {
10967 {
10968 return true;
10969 }
10970
10971 return false;
10972 }
10973
10975 {
10977 {
10978 return true;
10979 }
10980
10981 return false;
10982 }
10983
10985 {
10986 return false;
10987 }
10988
10991 {
10992 return UATimeSpent.DEFAULT_DEPLOY;
10993 }
10994
10995
10996
10997
10999 {
11001 SetSynchDirty();
11002 }
11003
11005 {
11007 }
11008
11009
11011 {
11012 return false;
11013 }
11014
11017 {
11018 string att_type = "None";
11019
11020 if (ConfigIsExisting("soundAttType"))
11021 {
11022 att_type = ConfigGetString("soundAttType");
11023 }
11024
11026 }
11027
11029 {
11031 }
11032
11033
11034
11035
11036
11042
11044 {
11047
11049 }
11050
11051
11053 {
11055 return;
11056
11058
11061
11064
11065 SoundParameters params = new SoundParameters();
11069 }
11070
11071
11073 {
11075 return;
11076
11078 SetSynchDirty();
11079
11082 }
11083
11084
11086 {
11088 return;
11089
11091 SetSynchDirty();
11092
11095 }
11096
11098 {
11100 }
11101
11103 {
11105 }
11106
11109 {
11110 if (!
GetGame().IsDedicatedServer())
11111 {
11112 if (ConfigIsExisting("attachSoundSet"))
11113 {
11114 string cfg_path = "";
11115 string soundset = "";
11116 string type_name =
GetType();
11117
11120 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11121 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11122
11123 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11124 {
11125 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11126 {
11127 if (cfg_slot_array[i] == slot_type)
11128 {
11129 soundset = cfg_soundset_array[i];
11130 break;
11131 }
11132 }
11133 }
11134
11135 if (soundset != "")
11136 {
11137 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11139 }
11140 }
11141 }
11142 }
11143
11145 {
11146
11147 }
11148
11149 void OnApply(PlayerBase player);
11150
11152 {
11153 return 1.0;
11154 };
11155
11157 {
11159 }
11160
11162 {
11164 }
11165
11167
11169 {
11170 SetDynamicPhysicsLifeTime(0.01);
11172 }
11173
11175 {
11176 array<string> zone_names = new array<string>;
11177 GetDamageZones(zone_names);
11178 for (int i = 0; i < zone_names.Count(); i++)
11179 {
11180 SetHealthMax(zone_names.Get(i),"Health");
11181 }
11182 SetHealthMax("","Health");
11183 }
11184
11187 {
11188 float global_health = GetHealth01("","Health");
11189 array<string> zones = new array<string>;
11190 GetDamageZones(zones);
11191
11192 for (int i = 0; i < zones.Count(); i++)
11193 {
11194 SetHealth01(zones.Get(i),"Health",global_health);
11195 }
11196 }
11197
11200 {
11201 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11202 }
11203
11205 {
11206 if (!hasRootAsPlayer)
11207 {
11208 if (refParentIB)
11209 {
11210
11211 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11212 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11213
11214 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11215 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11216
11219 }
11220 else
11221 {
11222
11225 }
11226 }
11227 }
11228
11230 {
11232 {
11233 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11234 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
11235 {
11236 float heatPermCoef = 1.0;
11238 while (ent)
11239 {
11240 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11241 ent = ent.GetHierarchyParent();
11242 }
11243
11244 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11245 }
11246 }
11247 }
11248
11250 {
11251
11252 EntityAI parent = GetHierarchyParent();
11253 if (!parent)
11254 {
11255 hasParent = false;
11256 hasRootAsPlayer = false;
11257 }
11258 else
11259 {
11260 hasParent = true;
11261 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11262 refParentIB =
ItemBase.Cast(parent);
11263 }
11264 }
11265
11266 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11267 {
11268
11269 }
11270
11272 {
11273
11274 return false;
11275 }
11276
11278 {
11279
11280
11281 return false;
11282 }
11283
11285 {
11286
11287 return false;
11288 }
11289
11292 {
11293 return !GetIsFrozen() &&
IsOpen();
11294 }
11295
11297 {
11298 bool hasParent = false, hasRootAsPlayer = false;
11300
11301 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11302 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11303
11304 if (wwtu || foodDecay)
11305 {
11309
11310 if (processWetness || processTemperature || processDecay)
11311 {
11313
11314 if (processWetness)
11315 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11316
11317 if (processTemperature)
11319
11320 if (processDecay)
11321 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11322 }
11323 }
11324 }
11325
11328 {
11330 }
11331
11333 {
11336
11337 return super.GetTemperatureFreezeThreshold();
11338 }
11339
11341 {
11344
11345 return super.GetTemperatureThawThreshold();
11346 }
11347
11349 {
11352
11353 return super.GetItemOverheatThreshold();
11354 }
11355
11357 {
11359 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11360
11361 return super.GetTemperatureFreezeTime();
11362 }
11363
11365 {
11367 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11368
11369 return super.GetTemperatureThawTime();
11370 }
11371
11376
11378 {
11379 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11380 }
11381
11383 {
11384 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11385 }
11386
11389 {
11391 }
11392
11394 {
11396 }
11397
11399 {
11401 }
11402
11405 {
11406 return null;
11407 }
11408
11411 {
11412 return false;
11413 }
11414
11416 {
11418 {
11421 if (!trg)
11422 {
11424 explosive = this;
11425 }
11426
11427 explosive.PairRemote(trg);
11429
11430 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11431 trg.SetPersistentPairID(persistentID);
11432 explosive.SetPersistentPairID(persistentID);
11433
11434 return true;
11435 }
11436 return false;
11437 }
11438
11441 {
11442 float ret = 1.0;
11445 ret *= GetHealth01();
11446
11447 return ret;
11448 }
11449
11450 #ifdef DEVELOPER
11451 override void SetDebugItem()
11452 {
11453 super.SetDebugItem();
11454 _itemBase = this;
11455 }
11456
11458 {
11459 string text = super.GetDebugText();
11460
11462 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11463
11464 return text;
11465 }
11466 #endif
11467
11469 {
11470 return true;
11471 }
11472
11474
11476
11478 {
11481 }
11482
11483
11491
11507}
11508
11510{
11512 if (entity)
11513 {
11514 bool is_item = entity.IsInherited(
ItemBase);
11515 if (is_item && full_quantity)
11516 {
11519 }
11520 }
11521 else
11522 {
11524 return NULL;
11525 }
11526 return entity;
11527}
11528
11530{
11531 if (item)
11532 {
11533 if (health > 0)
11534 item.SetHealth("", "", health);
11535
11536 if (item.CanHaveTemperature())
11537 {
11539 if (item.CanFreeze())
11540 item.SetFrozen(false);
11541 }
11542
11543 if (item.HasEnergyManager())
11544 {
11545 if (quantity >= 0)
11546 {
11547 item.GetCompEM().SetEnergy0To1(quantity);
11548 }
11549 else
11550 {
11552 }
11553 }
11554 else if (item.IsMagazine())
11555 {
11556 Magazine mag = Magazine.Cast(item);
11557 if (quantity >= 0)
11558 {
11559 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11560 }
11561 else
11562 {
11564 }
11565
11566 }
11567 else
11568 {
11569 if (quantity >= 0)
11570 {
11571 item.SetQuantityNormalized(quantity, false);
11572 }
11573 else
11574 {
11576 }
11577
11578 }
11579 }
11580}
11581
11582#ifdef DEVELOPER
11584#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.