6589{
6591 {
6592 return true;
6593 }
6594};
6595
6596
6597
6599{
6603
6605
6608
6609
6610
6611
6612
6621
6627
6632
6637
6658 protected bool m_IsResultOfSplit
6659
6661
6666
6667
6668
6670
6674
6675
6676
6678
6681
6682
6683
6689
6690
6698
6701
6702
6704
6705
6707
6708
6713
6714
6719
6720
6722
6723
6725 {
6730
6731 if (!
GetGame().IsDedicatedServer())
6732 {
6734 {
6736
6738 {
6740 }
6741 }
6742
6745 }
6746
6747 m_OldLocation = null;
6748
6750 {
6752 }
6753
6754 if (ConfigIsExisting("headSelectionsToHide"))
6755 {
6758 }
6759
6761 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6762 {
6764 }
6765
6767
6768 m_IsResultOfSplit = false;
6769
6771 }
6772
6774 {
6775 super.InitItemVariables();
6776
6782 m_Count = ConfigGetInt(
"count");
6783
6786
6791
6794
6799
6811
6815
6816
6819 if (ConfigIsExisting("canBeSplit"))
6820 {
6823 }
6824
6826 if (ConfigIsExisting("itemBehaviour"))
6828
6829
6832 RegisterNetSyncVariableInt("m_VarLiquidType");
6833 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6834
6835 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6836 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6837 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6838
6839 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6840 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6841 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6842 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6843
6844 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6845 RegisterNetSyncVariableBool("m_IsTakeable");
6846 RegisterNetSyncVariableBool("m_IsHologram");
6847
6850 {
6853 }
6854
6856
6858 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6860
6861 }
6862
6864 {
6866 }
6867
6869 {
6872 {
6877 }
6878 }
6879
6880 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6881 {
6883 {
6886 }
6887
6889 }
6890
6892 {
6898 }
6899
6901
6903 {
6905
6906 if (!action)
6907 {
6908 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6909 return;
6910 }
6911
6913 if (!ai)
6914 {
6916 return;
6917 }
6918
6920 if (!action_array)
6921 {
6922 action_array = new array<ActionBase_Basic>;
6924 }
6925 if (LogManager.IsActionLogEnable())
6926 {
6927 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6928 }
6929
6930 if (action_array.Find(action) != -1)
6931 {
6932 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6933 }
6934 else
6935 {
6936 action_array.Insert(action);
6937 }
6938 }
6939
6941 {
6943 ActionBase action = player.GetActionManager().GetAction(actionName);
6946
6947 if (action_array)
6948 {
6949 action_array.RemoveItem(action);
6950 }
6951 }
6952
6953
6954
6956 {
6957 ActionOverrideData overrideData = new ActionOverrideData();
6961
6963 if (!actionMap)
6964 {
6967 }
6968
6969 actionMap.Insert(this.
Type(), overrideData);
6970
6971 }
6972
6974
6976
6977
6979 {
6982
6985
6986 string config_to_search = "CfgVehicles";
6987 string muzzle_owner_config;
6988
6990 {
6991 if (IsInherited(Weapon))
6992 config_to_search = "CfgWeapons";
6993
6994 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6995
6996 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6997
6999
7000 if (config_OnFire_subclass_count > 0)
7001 {
7002 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7003
7004 for (int i = 0; i < config_OnFire_subclass_count; i++)
7005 {
7006 string particle_class = "";
7008 string config_OnFire_entry = config_OnFire_class + particle_class;
7009 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7010 WPOF_array.Insert(WPOF);
7011 }
7012
7013
7015 }
7016 }
7017
7019 {
7020 config_to_search = "CfgWeapons";
7021 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7022
7023 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7024
7026
7027 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7028 {
7029 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7030
7031 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7032 {
7033 string particle_class2 = "";
7035 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7036 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7037 WPOBE_array.Insert(WPOBE);
7038 }
7039
7040
7042 }
7043 }
7044 }
7045
7046
7048 {
7051
7053 {
7054 string config_to_search = "CfgVehicles";
7055
7056 if (IsInherited(Weapon))
7057 config_to_search = "CfgWeapons";
7058
7059 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7060 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7061
7062 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7063 {
7064
7066
7068 {
7070 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7072 return;
7073 }
7074
7077
7078
7079
7081 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7082
7083 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7084 {
7085 string particle_class = "";
7087 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7089
7090 if (entry_type == CT_CLASS)
7091 {
7092 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7093 WPOOH_array.Insert(WPOF);
7094 }
7095 }
7096
7097
7099 }
7100 }
7101 }
7102
7104 {
7106 }
7107
7109 {
7111 {
7113
7116
7119
7120 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7121 }
7122 }
7123
7125 {
7127 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7128
7130 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7131
7133 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7134
7136 {
7138 }
7139 }
7140
7142 {
7144 }
7145
7147 {
7150 else
7152
7154 {
7157 }
7158 else
7159 {
7162
7165 }
7166
7168 }
7169
7171 {
7173 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7174 }
7175
7177 {
7179 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7181 }
7182
7184 {
7186 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7187 }
7188
7190 {
7193
7194 OverheatingParticle OP = new OverheatingParticle();
7199
7201 }
7202
7204 {
7207
7208 return -1;
7209 }
7210
7212 {
7214 {
7217
7218 for (int i = count; i > 0; --i)
7219 {
7220 int id = i - 1;
7223
7226
7227 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7228 {
7229 if (p)
7230 {
7233 }
7234 }
7235 }
7236 }
7237 }
7238
7240 {
7242 {
7244 {
7245 int id = i - 1;
7247
7248 if (OP)
7249 {
7251
7252 if (p)
7253 {
7255 }
7256
7257 delete OP;
7258 }
7259 }
7260
7263 }
7264 }
7265
7268 {
7269 return 0.0;
7270 }
7271
7272
7274 {
7275 return 250;
7276 }
7277
7279 {
7280 return 0;
7281 }
7282
7285 {
7287 return true;
7288
7289 return false;
7290 }
7291
7294 {
7297
7299 {
7301 }
7302 else
7303 {
7304
7306 }
7307
7309 }
7310
7317 {
7318 return -1;
7319 }
7320
7321
7322
7323
7325 {
7327 {
7329 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7330
7331 if (r_index >= 0)
7332 {
7333 InventoryLocation r_il = new InventoryLocation;
7334 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7335
7336 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7339 {
7340 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7341 }
7343 {
7344 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7345 }
7346
7347 }
7348
7349 player.GetHumanInventory().ClearUserReservedLocation(this);
7350 }
7351
7354 }
7355
7356
7357
7358
7360 {
7361 return ItemBase.m_DebugActionsMask;
7362 }
7363
7365 {
7366 return ItemBase.m_DebugActionsMask & mask;
7367 }
7368
7370 {
7371 ItemBase.m_DebugActionsMask = mask;
7372 }
7373
7375 {
7376 ItemBase.m_DebugActionsMask |= mask;
7377 }
7378
7380 {
7381 ItemBase.m_DebugActionsMask &= ~mask;
7382 }
7383
7385 {
7387 {
7389 }
7390 else
7391 {
7393 }
7394 }
7395
7396
7398 {
7399 if (GetEconomyProfile())
7400 {
7401 float q_max = GetEconomyProfile().GetQuantityMax();
7402 if (q_max > 0)
7403 {
7404 float q_min = GetEconomyProfile().GetQuantityMin();
7405 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7406
7408 {
7409 ComponentEnergyManager comp = GetCompEM();
7411 {
7413 }
7414 }
7416 {
7418
7419 }
7420
7421 }
7422 }
7423 }
7424
7427 {
7428 EntityAI parent = GetHierarchyParent();
7429
7430 if (parent)
7431 {
7432 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7433 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7434 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7435 }
7436 }
7437
7440 {
7441 EntityAI parent = GetHierarchyParent();
7442
7443 if (parent)
7444 {
7445 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7446 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7447 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7448 }
7449 }
7450
7452 {
7453
7454
7455
7456
7458
7460 {
7461 if (ScriptInputUserData.CanStoreInputUserData())
7462 {
7463 ScriptInputUserData ctx = new ScriptInputUserData;
7469 ctx.
Write(use_stack_max);
7472
7474 {
7475 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7476 }
7477 }
7478 }
7479 else if (!
GetGame().IsMultiplayer())
7480 {
7482 }
7483 }
7484
7486 {
7488 }
7489
7491 {
7493 }
7494
7496 {
7498 }
7499
7501 {
7502
7503 return false;
7504 }
7505
7507 {
7508 return false;
7509 }
7510
7514 {
7515 return false;
7516 }
7517
7519 {
7520 return "";
7521 }
7522
7524
7526 {
7527 return false;
7528 }
7529
7531 {
7532 return true;
7533 }
7534
7535
7536
7538 {
7539 return true;
7540 }
7541
7543 {
7544 return true;
7545 }
7546
7548 {
7549 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7551 }
7552
7554 {
7556 }
7557
7559 {
7561 if (!is_being_placed)
7563 SetSynchDirty();
7564 }
7565
7566
7568
7570 {
7572 }
7573
7575 {
7577 }
7578
7580 {
7581 return 1;
7582 }
7583
7585 {
7586 return false;
7587 }
7588
7590 {
7592 SetSynchDirty();
7593 }
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7630 {
7631 super.OnMovedInsideCargo(container);
7632
7633 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7634 }
7635
7636 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7637 {
7638 super.EEItemLocationChanged(oldLoc,newLoc);
7639
7640 PlayerBase new_player = null;
7641 PlayerBase old_player = null;
7642
7643 if (newLoc.GetParent())
7644 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7645
7646 if (oldLoc.GetParent())
7647 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7648
7650 {
7651 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7652
7653 if (r_index >= 0)
7654 {
7655 InventoryLocation r_il = new InventoryLocation;
7656 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7657
7658 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7661 {
7662 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7663 }
7665 {
7666 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7667 }
7668
7669 }
7670 }
7671
7673 {
7674 if (new_player)
7675 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7676
7677 if (new_player == old_player)
7678 {
7679
7680 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7681 {
7683 {
7684 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7685 {
7686 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7687 }
7688 }
7689 else
7690 {
7691 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7692 }
7693 }
7694
7695 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7696 {
7697 int type = oldLoc.GetType();
7699 {
7700 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7701 }
7703 {
7704 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7705 }
7706 }
7707 if (!m_OldLocation)
7708 {
7709 m_OldLocation = new InventoryLocation;
7710 }
7711 m_OldLocation.Copy(oldLoc);
7712 }
7713 else
7714 {
7715 if (m_OldLocation)
7716 {
7717 m_OldLocation.Reset();
7718 }
7719 }
7720
7722 }
7723 else
7724 {
7725 if (new_player)
7726 {
7727 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7728 if (res_index >= 0)
7729 {
7730 InventoryLocation il = new InventoryLocation;
7731 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7733 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7736 {
7737 il.
GetParent().GetOnReleaseLock().Invoke(it);
7738 }
7740 {
7742 }
7743
7744 }
7745 }
7747 {
7748
7750 }
7751
7752 if (m_OldLocation)
7753 {
7754 m_OldLocation.Reset();
7755 }
7756 }
7757 }
7758
7759 override void EOnContact(IEntity other, Contact extra)
7760 {
7762 {
7763 int liquidType = -1;
7765 if (impactSpeed > 0.0)
7766 {
7768 #ifndef SERVER
7770 #else
7772 SetSynchDirty();
7773 #endif
7775 }
7776 }
7777
7778 #ifdef SERVER
7779 if (GetCompEM() && GetCompEM().IsPlugged())
7780 {
7781 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7782 GetCompEM().UnplugThis();
7783 }
7784 #endif
7785 }
7786
7788
7790 {
7792 }
7793
7795 {
7796
7797 }
7798
7800 {
7801 super.OnItemLocationChanged(old_owner, new_owner);
7802
7803 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7804 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7805
7806 if (!relatedPlayer && playerNew)
7807 relatedPlayer = playerNew;
7808
7809 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7810 {
7812 if (actionMgr)
7813 {
7814 ActionBase currentAction = actionMgr.GetRunningAction();
7815 if (currentAction)
7817 }
7818 }
7819
7820 Man ownerPlayerOld = null;
7821 Man ownerPlayerNew = null;
7822
7823 if (old_owner)
7824 {
7825 if (old_owner.
IsMan())
7826 {
7827 ownerPlayerOld = Man.Cast(old_owner);
7828 }
7829 else
7830 {
7831 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7832 }
7833 }
7834 else
7835 {
7837 {
7839
7840 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7841 {
7842 GetCompEM().UnplugThis();
7843 }
7844 }
7845 }
7846
7847 if (new_owner)
7848 {
7849 if (new_owner.
IsMan())
7850 {
7851 ownerPlayerNew = Man.Cast(new_owner);
7852 }
7853 else
7854 {
7855 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7856 }
7857 }
7858
7859 if (ownerPlayerOld != ownerPlayerNew)
7860 {
7861 if (ownerPlayerOld)
7862 {
7863 array<EntityAI> subItemsExit = new array<EntityAI>;
7865 for (int i = 0; i < subItemsExit.Count(); i++)
7866 {
7869 }
7870 }
7871
7872 if (ownerPlayerNew)
7873 {
7874 array<EntityAI> subItemsEnter = new array<EntityAI>;
7876 for (int j = 0; j < subItemsEnter.Count(); j++)
7877 {
7880 }
7881 }
7882 }
7883 else if (ownerPlayerNew != null)
7884 {
7885 PlayerBase nplayer;
7886 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7887 {
7888 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7890 for (int k = 0; k < subItemsUpdate.Count(); k++)
7891 {
7893 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7894 }
7895 }
7896 }
7897
7898 if (old_owner)
7899 old_owner.OnChildItemRemoved(this);
7900 if (new_owner)
7901 new_owner.OnChildItemReceived(this);
7902 }
7903
7904
7906 {
7907 super.EEDelete(parent);
7908 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7909 if (player)
7910 {
7912
7913 if (player.IsAlive())
7914 {
7915 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7916 if (r_index >= 0)
7917 {
7918 InventoryLocation r_il = new InventoryLocation;
7919 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7920
7921 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7924 {
7925 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7926 }
7928 {
7929 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7930 }
7931
7932 }
7933
7934 player.RemoveQuickBarEntityShortcut(this);
7935 }
7936 }
7937 }
7938
7940 {
7941 super.EEKilled(killer);
7942
7945 {
7946 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7947 {
7948 if (IsMagazine())
7949 {
7950 if (Magazine.Cast(this).GetAmmoCount() > 0)
7951 {
7953 }
7954 }
7955 else
7956 {
7958 }
7959 }
7960 }
7961 }
7962
7964 {
7965 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7966
7967 super.OnWasAttached(parent, slot_id);
7968
7971
7973 }
7974
7976 {
7977 super.OnWasDetached(parent, slot_id);
7978
7981 }
7982
7984 {
7985 int idx;
7988
7989 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7990 if (inventory_slots.Count() < 1)
7991 {
7992 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7993 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7994 }
7995 else
7996 {
7997 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7998 }
7999
8000 idx = inventory_slots.Find(slot);
8001 if (idx < 0)
8002 return "";
8003
8004 return attach_types.Get(idx);
8005 }
8006
8008 {
8009 int idx = -1;
8010 string slot;
8011
8014
8015 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8016 if (inventory_slots.Count() < 1)
8017 {
8018 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8019 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8020 }
8021 else
8022 {
8023 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8024 if (detach_types.Count() < 1)
8025 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8026 }
8027
8028 for (int i = 0; i < inventory_slots.Count(); i++)
8029 {
8030 slot = inventory_slots.Get(i);
8031 }
8032
8033 if (slot != "")
8034 {
8035 if (detach_types.Count() == 1)
8036 idx = 0;
8037 else
8038 idx = inventory_slots.Find(slot);
8039 }
8040 if (idx < 0)
8041 return "";
8042
8043 return detach_types.Get(idx);
8044 }
8045
8047 {
8048
8050
8051
8052 float min_time = 1;
8053 float max_time = 3;
8054 float delay = Math.RandomFloat(min_time, max_time);
8055
8056 explode_timer.Run(delay, this, "DoAmmoExplosion");
8057 }
8058
8060 {
8061 Magazine magazine = Magazine.Cast(this);
8062 int pop_sounds_count = 6;
8063 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8064
8065
8066 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8067 string sound_name = pop_sounds[ sound_idx ];
8069
8070
8071 magazine.ServerAddAmmoCount(-1);
8072
8073
8074 float min_temp_to_explode = 100;
8075
8076 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8077 {
8079 }
8080 }
8081
8082
8083 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8084 {
8085 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8086
8087 const int CHANCE_DAMAGE_CARGO = 4;
8088 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8089 const int CHANCE_DAMAGE_NOTHING = 2;
8090
8092 {
8093 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8094 int chances;
8095 int rnd;
8096
8097 if (GetInventory().GetCargo())
8098 {
8099 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8100 rnd = Math.RandomInt(0,chances);
8101
8102 if (rnd < CHANCE_DAMAGE_CARGO)
8103 {
8105 }
8106 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8107 {
8109 }
8110 }
8111 else
8112 {
8113 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8114 rnd = Math.RandomInt(0,chances);
8115
8116 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8117 {
8119 }
8120 }
8121 }
8122 }
8123
8125 {
8126 if (GetInventory().GetCargo())
8127 {
8128 int item_count = GetInventory().GetCargo().GetItemCount();
8129 if (item_count > 0)
8130 {
8131 int random_pick = Math.RandomInt(0, item_count);
8133 if (!item.IsExplosive())
8134 {
8135 item.AddHealth("","",damage);
8136 return true;
8137 }
8138 }
8139 }
8140 return false;
8141 }
8142
8144 {
8145 int attachment_count = GetInventory().AttachmentCount();
8146 if (attachment_count > 0)
8147 {
8148 int random_pick = Math.RandomInt(0, attachment_count);
8149 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8150 if (!attachment.IsExplosive())
8151 {
8152 attachment.AddHealth("","",damage);
8153 return true;
8154 }
8155 }
8156 return false;
8157 }
8158
8160 {
8162 }
8163
8165 {
8167 return GetInventory().CanRemoveEntity();
8168
8169 return false;
8170 }
8171
8173 {
8175 return;
8176
8178 {
8179 if (ScriptInputUserData.CanStoreInputUserData())
8180 {
8181 ScriptInputUserData ctx = new ScriptInputUserData;
8186 ctx.
Write(destination_entity);
8190 }
8191 }
8192 else if (!
GetGame().IsMultiplayer())
8193 {
8195 }
8196 }
8197
8199 {
8201 return;
8202
8203 float split_quantity_new;
8207 InventoryLocation loc = new InventoryLocation;
8208
8209 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8210 {
8212 split_quantity_new = stack_max;
8213 else
8215
8216 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8217 if (new_item)
8218 {
8219 new_item.SetResultOfSplit(true);
8220 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8222 new_item.SetQuantity(split_quantity_new);
8223 }
8224 }
8225 else if (destination_entity && slot_id == -1)
8226 {
8227 if (quantity > stack_max)
8228 split_quantity_new = stack_max;
8229 else
8230 split_quantity_new = quantity;
8231
8233 {
8236 }
8237
8238 if (new_item)
8239 {
8240 new_item.SetResultOfSplit(true);
8241 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8243 new_item.SetQuantity(split_quantity_new);
8244 }
8245 }
8246 else
8247 {
8248 if (stack_max != 0)
8249 {
8251 {
8253 }
8254
8255 if (split_quantity_new == 0)
8256 {
8257 if (!
GetGame().IsMultiplayer())
8258 player.PhysicalPredictiveDropItem(this);
8259 else
8260 player.ServerDropEntity(this);
8261 return;
8262 }
8263
8265
8266 if (new_item)
8267 {
8268 new_item.SetResultOfSplit(true);
8269 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8271 new_item.SetQuantity(stack_max);
8272 new_item.PlaceOnSurface();
8273 }
8274 }
8275 }
8276 }
8277
8279 {
8281 return;
8282
8283 float split_quantity_new;
8287 InventoryLocation loc = new InventoryLocation;
8288
8289 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8290 {
8292 split_quantity_new = stack_max;
8293 else
8295
8296 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8297 if (new_item)
8298 {
8299 new_item.SetResultOfSplit(true);
8300 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8302 new_item.SetQuantity(split_quantity_new);
8303 }
8304 }
8305 else if (destination_entity && slot_id == -1)
8306 {
8307 if (quantity > stack_max)
8308 split_quantity_new = stack_max;
8309 else
8310 split_quantity_new = quantity;
8311
8313 {
8316 }
8317
8318 if (new_item)
8319 {
8320 new_item.SetResultOfSplit(true);
8321 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8323 new_item.SetQuantity(split_quantity_new);
8324 }
8325 }
8326 else
8327 {
8328 if (stack_max != 0)
8329 {
8331 {
8333 }
8334
8336
8337 if (new_item)
8338 {
8339 new_item.SetResultOfSplit(true);
8340 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8342 new_item.SetQuantity(stack_max);
8343 new_item.PlaceOnSurface();
8344 }
8345 }
8346 }
8347 }
8348
8350 {
8352 return;
8353
8355 {
8356 if (ScriptInputUserData.CanStoreInputUserData())
8357 {
8358 ScriptInputUserData ctx = new ScriptInputUserData;
8363 dst.WriteToContext(ctx);
8365 }
8366 }
8367 else if (!
GetGame().IsMultiplayer())
8368 {
8370 }
8371 }
8372
8374 {
8376 return;
8377
8379 {
8380 if (ScriptInputUserData.CanStoreInputUserData())
8381 {
8382 ScriptInputUserData ctx = new ScriptInputUserData;
8387 ctx.
Write(destination_entity);
8393 }
8394 }
8395 else if (!
GetGame().IsMultiplayer())
8396 {
8398 }
8399 }
8400
8402 {
8404 }
8405
8407 {
8409 return this;
8410
8412 float split_quantity_new;
8414 if (dst.IsValid())
8415 {
8416 int slot_id = dst.GetSlot();
8418
8419 if (quantity > stack_max)
8420 split_quantity_new = stack_max;
8421 else
8422 split_quantity_new = quantity;
8423
8425
8426 if (new_item)
8427 {
8428 new_item.SetResultOfSplit(true);
8429 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8432 }
8433
8434 return new_item;
8435 }
8436
8437 return null;
8438 }
8439
8441 {
8443 return;
8444
8446 float split_quantity_new;
8448 if (destination_entity)
8449 {
8451 if (quantity > stackable)
8452 split_quantity_new = stackable;
8453 else
8454 split_quantity_new = quantity;
8455
8456 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8457 if (new_item)
8458 {
8459 new_item.SetResultOfSplit(true);
8460 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8462 new_item.SetQuantity(split_quantity_new);
8463 }
8464 }
8465 }
8466
8468 {
8470 return;
8471
8473 {
8474 if (ScriptInputUserData.CanStoreInputUserData())
8475 {
8476 ScriptInputUserData ctx = new ScriptInputUserData;
8481 ItemBase destination_entity =
this;
8482 ctx.
Write(destination_entity);
8486 }
8487 }
8488 else if (!
GetGame().IsMultiplayer())
8489 {
8491 }
8492 }
8493
8495 {
8497 return;
8498
8500 float split_quantity_new;
8502 if (player)
8503 {
8505 if (quantity > stackable)
8506 split_quantity_new = stackable;
8507 else
8508 split_quantity_new = quantity;
8509
8510 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8511 new_item =
ItemBase.Cast(in_hands);
8512 if (new_item)
8513 {
8514 new_item.SetResultOfSplit(true);
8515 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8517 new_item.SetQuantity(split_quantity_new);
8518 }
8519 }
8520 }
8521
8523 {
8525 return;
8526
8528 float split_quantity_new = Math.Floor(quantity * 0.5);
8529
8531
8532 if (new_item)
8533 {
8534 if (new_item.GetQuantityMax() < split_quantity_new)
8535 {
8536 split_quantity_new = new_item.GetQuantityMax();
8537 }
8538
8539 new_item.SetResultOfSplit(true);
8540 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8541
8543 {
8546 }
8547 else
8548 {
8551 }
8552 }
8553 }
8554
8556 {
8558 return;
8559
8561 float split_quantity_new = Math.Floor(quantity / 2);
8562
8563 InventoryLocation invloc = new InventoryLocation;
8565
8567 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8568
8569 if (new_item)
8570 {
8571 if (new_item.GetQuantityMax() < split_quantity_new)
8572 {
8573 split_quantity_new = new_item.GetQuantityMax();
8574 }
8576 {
8579 }
8580 else
8581 {
8584 }
8585 }
8586 }
8587
8590 {
8591 SetWeightDirty();
8593
8594 if (parent)
8595 parent.OnAttachmentQuantityChangedEx(this, delta);
8596
8598 {
8600 {
8602 }
8604 {
8605 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8607 }
8608 }
8609
8610 }
8611
8614 {
8615
8616 }
8617
8620 {
8622 }
8623
8625 {
8626 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8627
8629 {
8630 if (newLevel == GameConstants.STATE_RUINED)
8631 {
8633 EntityAI parent = GetHierarchyParent();
8634 if (parent && parent.IsFireplace())
8635 {
8636 CargoBase cargo = GetInventory().GetCargo();
8637 if (cargo)
8638 {
8640 {
8642 }
8643 }
8644 }
8645 }
8646
8648 {
8649
8651 return;
8652 }
8653
8654 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8655 {
8657 }
8658 }
8659 }
8660
8661
8663 {
8664 super.OnRightClick();
8665
8667 {
8669 {
8670 if (ScriptInputUserData.CanStoreInputUserData())
8671 {
8672 vector m4[4];
8674
8675 EntityAI root = GetHierarchyRoot();
8676
8677 InventoryLocation dst = new InventoryLocation;
8679 {
8680 if (root)
8681 {
8682 root.GetTransform(m4);
8684 }
8685 else
8686 GetInventory().GetCurrentInventoryLocation(dst);
8687 }
8688 else
8689 {
8691
8692
8693 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8694 {
8695 if (root)
8696 {
8697 root.GetTransform(m4);
8699 }
8700 else
8701 GetInventory().GetCurrentInventoryLocation(dst);
8702 }
8703 else
8704 {
8705 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8706 }
8707 }
8708
8709 ScriptInputUserData ctx = new ScriptInputUserData;
8717 }
8718 }
8719 else if (!
GetGame().IsMultiplayer())
8720 {
8722 }
8723 }
8724 }
8725
8726 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8727 {
8728
8729 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8730 return false;
8731
8732 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8733 return false;
8734
8735
8737 return false;
8738
8739
8740 Magazine mag = Magazine.Cast(this);
8741 if (mag)
8742 {
8743 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8744 return false;
8745
8746 if (stack_max_limit)
8747 {
8748 Magazine other_mag = Magazine.Cast(other_item);
8749 if (other_item)
8750 {
8751 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8752 return false;
8753 }
8754
8755 }
8756 }
8757 else
8758 {
8759
8761 return false;
8762
8764 return false;
8765 }
8766
8767 PlayerBase player = null;
8768 if (CastTo(player, GetHierarchyRootPlayer()))
8769 {
8770 if (player.GetInventory().HasAttachment(this))
8771 return false;
8772
8773 if (player.IsItemsToDelete())
8774 return false;
8775 }
8776
8777 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8778 return false;
8779
8780 int slotID;
8782 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8783 return false;
8784
8785 return true;
8786 }
8787
8789 {
8791 }
8792
8794 {
8795 return m_IsResultOfSplit;
8796 }
8797
8799 {
8800 m_IsResultOfSplit = value;
8801 }
8802
8804 {
8806 }
8807
8809 {
8810 float other_item_quantity = other_item.GetQuantity();
8811 float this_free_space;
8812
8814
8816
8817 if (other_item_quantity > this_free_space)
8818 {
8819 return this_free_space;
8820 }
8821 else
8822 {
8823 return other_item_quantity;
8824 }
8825 }
8826
8828 {
8830 }
8831
8833 {
8835 return;
8836
8837 if (!IsMagazine() && other_item)
8838 {
8840 if (quantity_used != 0)
8841 {
8842 float hp1 = GetHealth01("","");
8843 float hp2 = other_item.GetHealth01("","");
8844 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8845 hpResult = hpResult / (
GetQuantity() + quantity_used);
8846
8847 hpResult *= GetMaxHealth();
8848 Math.Round(hpResult);
8849 SetHealth("", "Health", hpResult);
8850
8852 other_item.AddQuantity(-quantity_used);
8853 }
8854 }
8856 }
8857
8859 {
8860 #ifdef SERVER
8861 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8862 GetHierarchyParent().IncreaseLifetimeUp();
8863 #endif
8864 };
8865
8867 {
8868 PlayerBase p = PlayerBase.Cast(player);
8869
8870 array<int> recipesIds = p.m_Recipes;
8871 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8872 if (moduleRecipesManager)
8873 {
8874 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8875 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8876 }
8877
8878 for (int i = 0;i < recipesIds.Count(); i++)
8879 {
8880 int key = recipesIds.Get(i);
8881 string recipeName = moduleRecipesManager.GetRecipeName(key);
8883 }
8884 }
8885
8886
8887 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8888 {
8889 super.GetDebugActions(outputList);
8890
8891
8896
8897
8901
8905
8906
8909
8910
8912 {
8915 }
8916
8918
8921
8925 }
8926
8927
8928
8929
8931 {
8932 super.OnAction(action_id, player, ctx);
8933 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8934 {
8935 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8936 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8937 PlayerBase p = PlayerBase.Cast(player);
8938 if (
EActions.RECIPES_RANGE_START < 1000)
8939 {
8940 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8941 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8942 }
8943 }
8944 #ifndef SERVER
8945 else if (action_id ==
EActions.WATCH_PLAYER)
8946 {
8947 PluginDeveloper.SetDeveloperItemClientEx(player);
8948 }
8949 #endif
8951 {
8952 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8953 {
8954 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8955 OnDebugButtonPressServer(id + 1);
8956 }
8957
8958 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8959 {
8960 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8962 }
8963
8964 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8965 {
8966 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8968 }
8969
8970 else if (action_id ==
EActions.ADD_QUANTITY)
8971 {
8972 if (IsMagazine())
8973 {
8974 Magazine mag = Magazine.Cast(this);
8975 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8976 }
8977 else
8978 {
8980 }
8981
8982 if (m_EM)
8983 {
8984 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8985 }
8986
8987 }
8988
8989 else if (action_id ==
EActions.REMOVE_QUANTITY)
8990 {
8991 if (IsMagazine())
8992 {
8993 Magazine mag2 = Magazine.Cast(this);
8994 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8995 }
8996 else
8997 {
8999 }
9000 if (m_EM)
9001 {
9002 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9003 }
9004
9005 }
9006
9007 else if (action_id ==
EActions.SET_QUANTITY_0)
9008 {
9010
9011 if (m_EM)
9012 {
9013 m_EM.SetEnergy(0);
9014 }
9015 }
9016
9017 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9018 {
9020
9021 if (m_EM)
9022 {
9023 m_EM.SetEnergy(m_EM.GetEnergyMax());
9024 }
9025 }
9026
9027 else if (action_id ==
EActions.ADD_HEALTH)
9028 {
9029 AddHealth("","",GetMaxHealth("","Health")/5);
9030 }
9031 else if (action_id ==
EActions.REMOVE_HEALTH)
9032 {
9033 AddHealth("","",-GetMaxHealth("","Health")/5);
9034 }
9035 else if (action_id ==
EActions.DESTROY_HEALTH)
9036 {
9037 SetHealth01("","",0);
9038 }
9039 else if (action_id ==
EActions.WATCH_ITEM)
9040 {
9042 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9043 #ifdef DEVELOPER
9044 SetDebugDeveloper_item(this);
9045 #endif
9046 }
9047
9048 else if (action_id ==
EActions.ADD_TEMPERATURE)
9049 {
9050 AddTemperature(20);
9051
9052 }
9053
9054 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9055 {
9056 AddTemperature(-20);
9057
9058 }
9059
9060 else if (action_id ==
EActions.FLIP_FROZEN)
9061 {
9062 SetFrozen(!GetIsFrozen());
9063
9064 }
9065
9066 else if (action_id ==
EActions.ADD_WETNESS)
9067 {
9069
9070 }
9071
9072 else if (action_id ==
EActions.REMOVE_WETNESS)
9073 {
9075
9076 }
9077
9078 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9079 {
9082
9083
9084 }
9085
9086 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9087 {
9090 }
9091
9092 else if (action_id ==
EActions.MAKE_SPECIAL)
9093 {
9094 auto debugParams = DebugSpawnParams.WithPlayer(player);
9095 OnDebugSpawnEx(debugParams);
9096 }
9097
9098 else if (action_id ==
EActions.DELETE)
9099 {
9100 Delete();
9101 }
9102
9103 }
9104
9105
9106 return false;
9107 }
9108
9109
9110
9111
9115
9118
9119
9120
9122 {
9123 return false;
9124 }
9125
9126
9128 {
9129 return true;
9130 }
9131
9132
9134 {
9135 return true;
9136 }
9137
9138
9139
9141 {
9142 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9144 }
9145
9148 {
9149 return null;
9150 }
9151
9153 {
9154 return false;
9155 }
9156
9158 {
9159 return false;
9160 }
9161
9165
9166
9168 {
9169 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9170 return module_repairing.CanRepair(this, item_repair_kit);
9171 }
9172
9173
9174 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9175 {
9176 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9177 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9178 }
9179
9180
9182 {
9183
9184
9185
9186
9187
9188
9189
9190
9191 return 1;
9192 }
9193
9194
9195
9197 {
9199 }
9200
9201
9202
9204 {
9206 }
9207
9208
9217 {
9218 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9219
9220 if (player)
9221 {
9222 player.MessageStatus(text);
9223 }
9224 }
9225
9226
9235 {
9236 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9237
9238 if (player)
9239 {
9240 player.MessageAction(text);
9241 }
9242 }
9243
9244
9253 {
9254 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9255
9256 if (player)
9257 {
9258 player.MessageFriendly(text);
9259 }
9260 }
9261
9262
9271 {
9272 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9273
9274 if (player)
9275 {
9276 player.MessageImportant(text);
9277 }
9278 }
9279
9281 {
9282 return true;
9283 }
9284
9285
9286 override bool KindOf(
string tag)
9287 {
9288 bool found = false;
9289 string item_name = this.
GetType();
9292
9293 int array_size = item_tag_array.Count();
9294 for (int i = 0; i < array_size; i++)
9295 {
9296 if (item_tag_array.Get(i) == tag)
9297 {
9298 found = true;
9299 break;
9300 }
9301 }
9302 return found;
9303 }
9304
9305
9307 {
9308
9309 super.OnRPC(sender, rpc_type,ctx);
9310
9311
9312 switch (rpc_type)
9313 {
9314 #ifndef SERVER
9315 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9316 Param2<bool, string> p = new Param2<bool, string>(false, "");
9317
9319 return;
9320
9321 bool play = p.param1;
9322 string soundSet = p.param2;
9323
9324 if (play)
9325 {
9327 {
9329 {
9331 }
9332 }
9333 else
9334 {
9336 }
9337 }
9338 else
9339 {
9341 }
9342
9343 break;
9344 #endif
9345
9346 }
9347
9349 {
9351 }
9352 }
9353
9354
9355
9356
9358 {
9359 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9360 return plugin.GetID(
name);
9361 }
9362
9364 {
9365 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9366 return plugin.GetName(id);
9367 }
9368
9371 {
9372
9373
9374 int varFlags;
9375 if (!ctx.
Read(varFlags))
9376 return;
9377
9378 if (varFlags & ItemVariableFlags.FLOAT)
9379 {
9381 }
9382 }
9383
9385 {
9386
9387 super.SerializeNumericalVars(floats_out);
9388
9389
9390
9392 {
9394 }
9395
9397 {
9399 }
9400
9402 {
9404 }
9405
9407 {
9412 }
9413
9415 {
9417 }
9418 }
9419
9421 {
9422
9423 super.DeSerializeNumericalVars(floats);
9424
9425
9426 int index = 0;
9427 int mask = Math.Round(floats.Get(index));
9428
9429 index++;
9430
9432 {
9434 {
9436 }
9437 else
9438 {
9439 float quantity = floats.Get(index);
9441 }
9442 index++;
9443 }
9444
9446 {
9447 float wet = floats.Get(index);
9449 index++;
9450 }
9451
9453 {
9454 int liquidtype = Math.Round(floats.Get(index));
9456 index++;
9457 }
9458
9460 {
9462 index++;
9464 index++;
9466 index++;
9468 index++;
9469 }
9470
9472 {
9473 int cleanness = Math.Round(floats.Get(index));
9475 index++;
9476 }
9477 }
9478
9480 {
9481 super.WriteVarsToCTX(ctx);
9482
9483
9485 {
9487 }
9488
9490 {
9492 }
9493
9495 {
9497 }
9498
9500 {
9501 int r,g,b,a;
9507 }
9508
9510 {
9512 }
9513 }
9514
9516 {
9517 if (!super.ReadVarsFromCTX(ctx,version))
9518 return false;
9519
9520 int intValue;
9521 float value;
9522
9523 if (version < 140)
9524 {
9525 if (!ctx.
Read(intValue))
9526 return false;
9527
9528 m_VariablesMask = intValue;
9529 }
9530
9532 {
9533 if (!ctx.
Read(value))
9534 return false;
9535
9537 {
9539 }
9540 else
9541 {
9543 }
9544 }
9545
9546 if (version < 140)
9547 {
9549 {
9550 if (!ctx.
Read(value))
9551 return false;
9552 SetTemperatureDirect(value);
9553 }
9554 }
9555
9557 {
9558 if (!ctx.
Read(value))
9559 return false;
9561 }
9562
9564 {
9565 if (!ctx.
Read(intValue))
9566 return false;
9568 }
9569
9571 {
9572 int r,g,b,a;
9574 return false;
9576 return false;
9578 return false;
9580 return false;
9581
9583 }
9584
9586 {
9587 if (!ctx.
Read(intValue))
9588 return false;
9590 }
9591
9592 if (version >= 138 && version < 140)
9593 {
9595 {
9596 if (!ctx.
Read(intValue))
9597 return false;
9598 SetFrozen(intValue);
9599 }
9600 }
9601
9602 return true;
9603 }
9604
9605
9607 {
9610 {
9612 }
9613
9614 if (!super.OnStoreLoad(ctx, version))
9615 {
9617 return false;
9618 }
9619
9620 if (version >= 114)
9621 {
9622 bool hasQuickBarIndexSaved;
9623
9624 if (!ctx.
Read(hasQuickBarIndexSaved))
9625 {
9627 return false;
9628 }
9629
9630 if (hasQuickBarIndexSaved)
9631 {
9632 int itmQBIndex;
9633
9634
9635 if (!ctx.
Read(itmQBIndex))
9636 {
9638 return false;
9639 }
9640
9641 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9642 if (itmQBIndex != -1 && parentPlayer)
9643 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9644 }
9645 }
9646 else
9647 {
9648
9649 PlayerBase player;
9650 int itemQBIndex;
9651 if (version ==
int.
MAX)
9652 {
9653 if (!ctx.
Read(itemQBIndex))
9654 {
9656 return false;
9657 }
9658 }
9659 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9660 {
9661
9662 if (!ctx.
Read(itemQBIndex))
9663 {
9665 return false;
9666 }
9667 if (itemQBIndex != -1 && player)
9668 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9669 }
9670 }
9671
9672 if (version < 140)
9673 {
9674
9675 if (!LoadVariables(ctx, version))
9676 {
9678 return false;
9679 }
9680 }
9681
9682
9684 {
9686 return false;
9687 }
9688 if (version >= 132)
9689 {
9691 if (raib)
9692 {
9694 {
9696 return false;
9697 }
9698 }
9699 }
9700
9702 return true;
9703 }
9704
9705
9706
9708 {
9709 super.OnStoreSave(ctx);
9710
9711 PlayerBase player;
9712 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9713 {
9715
9716 int itemQBIndex = -1;
9717 itemQBIndex = player.FindQuickBarEntityIndex(this);
9718 ctx.
Write(itemQBIndex);
9719 }
9720 else
9721 {
9723 }
9724
9726
9728 if (raib)
9729 {
9731 }
9732 }
9733
9734
9736 {
9737 super.AfterStoreLoad();
9738
9740 {
9742 }
9743
9745 {
9748 }
9749 }
9750
9752 {
9753 super.EEOnAfterLoad();
9754
9756 {
9758 }
9759
9762 }
9763
9765 {
9766 return false;
9767 }
9768
9769
9770
9772 {
9774 {
9775 #ifdef PLATFORM_CONSOLE
9776
9778 {
9780 if (menu)
9781 {
9783 }
9784 }
9785 #endif
9786 }
9787
9789 {
9792 }
9793
9795 {
9796 SetWeightDirty();
9798 }
9800 {
9803 }
9804
9806 {
9809 }
9811 {
9814 }
9815
9816 super.OnVariablesSynchronized();
9817 }
9818
9819
9820
9822 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9823 {
9824 if (!IsServerCheck(allow_client))
9825 return false;
9826
9828 return false;
9829
9832
9833 if (value <= (min + 0.001))
9834 value = min;
9835
9836 if (value == min)
9837 {
9838 if (destroy_config)
9839 {
9840 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9841 if (dstr)
9842 {
9844 this.Delete();
9845 return true;
9846 }
9847 }
9848 else if (destroy_forced)
9849 {
9851 this.Delete();
9852 return true;
9853 }
9854
9856 }
9857
9860
9862 {
9864
9865 if (delta)
9867 }
9868
9870
9871 return false;
9872 }
9873
9874
9876 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9877 {
9879 }
9880
9882 {
9885 }
9886
9888 {
9891 }
9892
9895 {
9896 float value_clamped = Math.Clamp(value, 0, 1);
9898 SetQuantity(result, destroy_config, destroy_forced);
9899 }
9900
9901
9904 {
9906 }
9907
9909 {
9911 }
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9923 {
9924 int slot = -1;
9925 if (GetInventory())
9926 {
9927 InventoryLocation il = new InventoryLocation;
9928 GetInventory().GetCurrentInventoryLocation(il);
9930 }
9931
9933 }
9934
9936 {
9937 float quantity_max = 0;
9938
9940 {
9941 if (attSlotID != -1)
9942 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9943
9944 if (quantity_max <= 0)
9946 }
9947
9948 if (quantity_max <= 0)
9950
9951 return quantity_max;
9952 }
9953
9955 {
9957 }
9958
9960 {
9962 }
9963
9964
9966 {
9968 }
9969
9971 {
9973 }
9974
9976 {
9978 }
9979
9980
9982 {
9983
9984 float weightEx = GetWeightEx();
9985 float special = GetInventoryAndCargoWeight();
9986 return weightEx - special;
9987 }
9988
9989
9991 {
9993 }
9994
9996 {
9998 {
9999 #ifdef DEVELOPER
10000 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10001 {
10002 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10004 }
10005 #endif
10006
10007 return GetQuantity() * GetConfigWeightModified();
10008 }
10009 else if (HasEnergyManager())
10010 {
10011 #ifdef DEVELOPER
10012 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10013 {
10014 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10015 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10016 }
10017 #endif
10018 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10019 }
10020 else
10021 {
10022 #ifdef DEVELOPER
10023 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10024 {
10025 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10026 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10027 }
10028 #endif
10029 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10030 }
10031 }
10032
10035 {
10036 int item_count = 0;
10038
10039 if (GetInventory().GetCargo() != NULL)
10040 {
10041 item_count = GetInventory().GetCargo().GetItemCount();
10042 }
10043
10044 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10045 {
10046 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10047 if (item)
10048 item_count += item.GetNumberOfItems();
10049 }
10050 return item_count;
10051 }
10052
10055 {
10056 float weight = 0;
10057 float wetness = 1;
10058 if (include_wetness)
10061 {
10062 weight = wetness * m_ConfigWeight;
10063 }
10065 {
10066 weight = 1;
10067 }
10068 return weight;
10069 }
10070
10071
10072
10074 {
10075 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10076 {
10077 GameInventory inv = GetInventory();
10078 array<EntityAI> items = new array<EntityAI>;
10080 for (int i = 0; i < items.Count(); i++)
10081 {
10083 if (item)
10084 {
10086 }
10087 }
10088 }
10089 }
10090
10091
10092
10093
10095 {
10096 float energy = 0;
10097 if (HasEnergyManager())
10098 {
10099 energy = GetCompEM().GetEnergy();
10100 }
10101 return energy;
10102 }
10103
10104
10106 {
10107 super.OnEnergyConsumed();
10108
10110 }
10111
10113 {
10114 super.OnEnergyAdded();
10115
10117 }
10118
10119
10121 {
10122 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10123 {
10125 {
10126 float energy_0to1 = GetCompEM().GetEnergy0To1();
10128 }
10129 }
10130 }
10131
10132
10134 {
10135 return ConfigGetFloat("heatIsolation");
10136 }
10137
10139 {
10141 }
10142
10144 {
10145 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10146 if (
GetGame().ConfigIsExisting(paramPath))
10148
10149 return 0.0;
10150 }
10151
10153 {
10154 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10155 if (
GetGame().ConfigIsExisting(paramPath))
10157
10158 return 0.0;
10159 }
10160
10161 override void SetWet(
float value,
bool allow_client =
false)
10162 {
10163 if (!IsServerCheck(allow_client))
10164 return;
10165
10168
10170
10171 m_VarWet = Math.Clamp(value, min, max);
10172
10174 {
10177 }
10178 }
10179
10180 override void AddWet(
float value)
10181 {
10183 }
10184
10186 {
10188 }
10189
10191 {
10193 }
10194
10196 {
10198 }
10199
10201 {
10203 }
10204
10206 {
10208 }
10209
10210 override void OnWetChanged(
float newVal,
float oldVal)
10211 {
10214 if (newLevel != oldLevel)
10215 {
10217 }
10218 }
10219
10221 {
10222 SetWeightDirty();
10223 }
10224
10226 {
10227 return GetWetLevelInternal(
m_VarWet);
10228 }
10229
10230
10231
10233 {
10235 }
10236
10238 {
10240 }
10241
10243 {
10245 }
10246
10248 {
10250 }
10251
10252
10253
10255 {
10256 if (ConfigIsExisting("itemModelLength"))
10257 {
10258 return ConfigGetFloat("itemModelLength");
10259 }
10260 return 0;
10261 }
10262
10264 {
10265 if (ConfigIsExisting("itemAttachOffset"))
10266 {
10267 return ConfigGetFloat("itemAttachOffset");
10268 }
10269 return 0;
10270 }
10271
10272 override void SetCleanness(
int value,
bool allow_client =
false)
10273 {
10274 if (!IsServerCheck(allow_client))
10275 return;
10276
10278
10280
10283 }
10284
10286 {
10288 }
10289
10291 {
10292 return true;
10293 }
10294
10295
10296
10297
10299 {
10301 }
10302
10304 {
10306 }
10307
10308
10309
10310
10311 override void SetColor(
int r,
int g,
int b,
int a)
10312 {
10318 }
10320 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10321 {
10326 }
10327
10329 {
10331 }
10332
10335 {
10336 int r,g,b,a;
10338 r = r/255;
10339 g = g/255;
10340 b = b/255;
10341 a = a/255;
10342 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10343 }
10344
10345
10346
10347 override void SetLiquidType(
int value,
bool allow_client =
false)
10348 {
10349 if (!IsServerCheck(allow_client))
10350 return;
10351
10356 }
10357
10359 {
10360 return ConfigGetInt("varLiquidTypeInit");
10361 }
10362
10364 {
10366 }
10367
10369 {
10371 SetFrozen(false);
10372 }
10373
10376 {
10377 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10378 }
10379
10380
10383 {
10384 PlayerBase nplayer;
10385 if (PlayerBase.CastTo(nplayer, player))
10386 {
10388
10389 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10390 }
10391 }
10392
10393
10396 {
10397 PlayerBase nplayer;
10398 if (PlayerBase.CastTo(nplayer,player))
10399 {
10400
10401 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10402
10403 }
10404
10405
10406 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10407
10408
10409 if (HasEnergyManager())
10410 {
10411 GetCompEM().UpdatePlugState();
10412 }
10413 }
10414
10415
10417 {
10418 super.OnPlacementStarted(player);
10419
10421 }
10422
10423 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10424 {
10426 {
10427 m_AdminLog.OnPlacementComplete(player,
this);
10428 }
10429
10430 super.OnPlacementComplete(player, position, orientation);
10431 }
10432
10433
10434
10435
10436
10438 {
10440 {
10441 return true;
10442 }
10443 else
10444 {
10445 return false;
10446 }
10447 }
10448
10449
10451 {
10453 {
10455 }
10456 }
10457
10458
10460 {
10462 }
10463
10465 {
10467 }
10468
10469 override void InsertAgent(
int agent,
float count = 1)
10470 {
10471 if (count < 1)
10472 return;
10473
10475 }
10476
10479 {
10481 }
10482
10483
10485 {
10487 }
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10531 {
10533 return false;
10534 return true;
10535 }
10536
10538 {
10539
10541 }
10542
10543
10546 {
10547 super.CheckForRoofLimited(timeTresholdMS);
10548
10550 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10551 {
10552 m_PreviousRoofTestTime = time;
10553 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10554 }
10555 }
10556
10557
10559 {
10561 {
10562 return 0;
10563 }
10564
10565 if (GetInventory().GetAttachmentSlotsCount() != 0)
10566 {
10567 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10568 if (filter)
10569 return filter.GetProtectionLevel(type, false, system);
10570 else
10571 return 0;
10572 }
10573
10574 string subclassPath, entryName;
10575
10576 switch (type)
10577 {
10579 entryName = "biological";
10580 break;
10582 entryName = "chemical";
10583 break;
10584 default:
10585 entryName = "biological";
10586 break;
10587 }
10588
10589 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10590
10592 }
10593
10594
10595
10598 {
10599 if (!IsMagazine())
10601
10603 }
10604
10605
10606
10607
10608
10613 {
10614 return true;
10615 }
10616
10618 {
10620 }
10621
10622
10623
10624
10625
10627 {
10628 if (parent)
10629 {
10630 if (parent.IsInherited(DayZInfected))
10631 return true;
10632
10633 if (!parent.IsRuined())
10634 return true;
10635 }
10636
10637 return true;
10638 }
10639
10641 {
10642 if (!super.CanPutAsAttachment(parent))
10643 {
10644 return false;
10645 }
10646
10647 if (!IsRuined() && !parent.IsRuined())
10648 {
10649 return true;
10650 }
10651
10652 return false;
10653 }
10654
10656 {
10657
10658
10659
10660
10661 return super.CanReceiveItemIntoCargo(item);
10662 }
10663
10665 {
10666
10667
10668
10669
10670 GameInventory attachmentInv = attachment.GetInventory();
10672 {
10673 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10674 return false;
10675 }
10676
10677 InventoryLocation loc = new InventoryLocation();
10678 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10679 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10680 return false;
10681
10682 return super.CanReceiveAttachment(attachment, slotId);
10683 }
10684
10686 {
10687 if (!super.CanReleaseAttachment(attachment))
10688 return false;
10689
10690 return GetInventory().AreChildrenAccessible();
10691 }
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10714 {
10715 int id = muzzle_owner.GetMuzzleID();
10716 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10717
10718 if (WPOF_array)
10719 {
10720 for (int i = 0; i < WPOF_array.Count(); i++)
10721 {
10722 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10723
10724 if (WPOF)
10725 {
10726 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10727 }
10728 }
10729 }
10730 }
10731
10732
10734 {
10735 int id = muzzle_owner.GetMuzzleID();
10737
10738 if (WPOBE_array)
10739 {
10740 for (int i = 0; i < WPOBE_array.Count(); i++)
10741 {
10742 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10743
10744 if (WPOBE)
10745 {
10746 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10747 }
10748 }
10749 }
10750 }
10751
10752
10754 {
10755 int id = muzzle_owner.GetMuzzleID();
10756 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10757
10758 if (WPOOH_array)
10759 {
10760 for (int i = 0; i < WPOOH_array.Count(); i++)
10761 {
10762 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10763
10764 if (WPOOH)
10765 {
10766 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10767 }
10768 }
10769 }
10770 }
10771
10772
10774 {
10775 int id = muzzle_owner.GetMuzzleID();
10776 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10777
10778 if (WPOOH_array)
10779 {
10780 for (int i = 0; i < WPOOH_array.Count(); i++)
10781 {
10782 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10783
10784 if (WPOOH)
10785 {
10786 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10787 }
10788 }
10789 }
10790 }
10791
10792
10794 {
10795 int id = muzzle_owner.GetMuzzleID();
10796 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10797
10798 if (WPOOH_array)
10799 {
10800 for (int i = 0; i < WPOOH_array.Count(); i++)
10801 {
10802 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10803
10804 if (WPOOH)
10805 {
10806 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10807 }
10808 }
10809 }
10810 }
10811
10812
10813
10815 {
10817 {
10818 return true;
10819 }
10820
10821 return false;
10822 }
10823
10825 {
10827 {
10828 return true;
10829 }
10830
10831 return false;
10832 }
10833
10835 {
10837 {
10838 return true;
10839 }
10840
10841 return false;
10842 }
10843
10845 {
10846 return false;
10847 }
10848
10851 {
10852 return UATimeSpent.DEFAULT_DEPLOY;
10853 }
10854
10855
10856
10857
10859 {
10861 SetSynchDirty();
10862 }
10863
10865 {
10867 }
10868
10869
10871 {
10872 return false;
10873 }
10874
10877 {
10878 string att_type = "None";
10879
10880 if (ConfigIsExisting("soundAttType"))
10881 {
10882 att_type = ConfigGetString("soundAttType");
10883 }
10884
10886 }
10887
10889 {
10891 }
10892
10893
10894
10895
10896
10900
10902 {
10905
10907 }
10908
10909
10911 {
10913 return;
10914
10916
10919
10922
10923 SoundParameters params = new SoundParameters();
10927 }
10928
10929
10931 {
10933 return;
10934
10936 SetSynchDirty();
10937
10940 }
10941
10942
10944 {
10946 return;
10947
10949 SetSynchDirty();
10950
10953 }
10954
10956 {
10958 }
10959
10961 {
10963 }
10964
10967 {
10968 if (!
GetGame().IsDedicatedServer())
10969 {
10970 if (ConfigIsExisting("attachSoundSet"))
10971 {
10972 string cfg_path = "";
10973 string soundset = "";
10974 string type_name =
GetType();
10975
10978 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10979 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10980
10981 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10982 {
10983 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10984 {
10985 if (cfg_slot_array[i] == slot_type)
10986 {
10987 soundset = cfg_soundset_array[i];
10988 break;
10989 }
10990 }
10991 }
10992
10993 if (soundset != "")
10994 {
10995 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10997 }
10998 }
10999 }
11000 }
11001
11003 {
11004
11005 }
11006
11007 void OnApply(PlayerBase player);
11008
11010 {
11011 return 1.0;
11012 };
11013
11015 {
11017 }
11018
11020 {
11022 }
11023
11025
11027 {
11028 SetDynamicPhysicsLifeTime(0.01);
11030 }
11031
11033 {
11034 array<string> zone_names = new array<string>;
11035 GetDamageZones(zone_names);
11036 for (int i = 0; i < zone_names.Count(); i++)
11037 {
11038 SetHealthMax(zone_names.Get(i),"Health");
11039 }
11040 SetHealthMax("","Health");
11041 }
11042
11045 {
11046 float global_health = GetHealth01("","Health");
11047 array<string> zones = new array<string>;
11048 GetDamageZones(zones);
11049
11050 for (int i = 0; i < zones.Count(); i++)
11051 {
11052 SetHealth01(zones.Get(i),"Health",global_health);
11053 }
11054 }
11055
11058 {
11059 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11060 }
11061
11063 {
11064 if (!hasRootAsPlayer)
11065 {
11066 if (refParentIB)
11067 {
11068
11069 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11070 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11071
11072 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11073 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11074
11077 }
11078 else
11079 {
11080
11083 }
11084 }
11085 }
11086
11088 {
11090 {
11091 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11092 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11093 {
11094 float heatPermCoef = 1.0;
11096 while (ent)
11097 {
11098 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11099 ent = ent.GetHierarchyParent();
11100 }
11101
11102 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11103 }
11104 }
11105 }
11106
11108 {
11109
11110 EntityAI parent = GetHierarchyParent();
11111 if (!parent)
11112 {
11113 hasParent = false;
11114 hasRootAsPlayer = false;
11115 }
11116 else
11117 {
11118 hasParent = true;
11119 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11120 refParentIB =
ItemBase.Cast(parent);
11121 }
11122 }
11123
11124 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11125 {
11126
11127 }
11128
11130 {
11131
11132 return false;
11133 }
11134
11136 {
11137
11138
11139 return false;
11140 }
11141
11143 {
11144
11145 return false;
11146 }
11147
11150 {
11151 return !GetIsFrozen() &&
IsOpen();
11152 }
11153
11155 {
11156 bool hasParent = false, hasRootAsPlayer = false;
11158
11159 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11160 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11161
11162 if (wwtu || foodDecay)
11163 {
11167
11168 if (processWetness || processTemperature || processDecay)
11169 {
11171
11172 if (processWetness)
11173 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11174
11175 if (processTemperature)
11177
11178 if (processDecay)
11179 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11180 }
11181 }
11182 }
11183
11186 {
11188 }
11189
11191 {
11194
11195 return super.GetTemperatureFreezeThreshold();
11196 }
11197
11199 {
11202
11203 return super.GetTemperatureThawThreshold();
11204 }
11205
11207 {
11210
11211 return super.GetItemOverheatThreshold();
11212 }
11213
11215 {
11217 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11218
11219 return super.GetTemperatureFreezeTime();
11220 }
11221
11223 {
11225 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11226
11227 return super.GetTemperatureThawTime();
11228 }
11229
11234
11236 {
11237 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11238 }
11239
11241 {
11242 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11243 }
11244
11247 {
11249 }
11250
11252 {
11254 }
11255
11257 {
11259 }
11260
11263 {
11264 return null;
11265 }
11266
11269 {
11270 return false;
11271 }
11272
11274 {
11276 {
11279 if (!trg)
11280 {
11282 explosive = this;
11283 }
11284
11285 explosive.PairRemote(trg);
11287
11288 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11289 trg.SetPersistentPairID(persistentID);
11290 explosive.SetPersistentPairID(persistentID);
11291
11292 return true;
11293 }
11294 return false;
11295 }
11296
11299 {
11300 float ret = 1.0;
11303 ret *= GetHealth01();
11304
11305 return ret;
11306 }
11307
11308 #ifdef DEVELOPER
11309 override void SetDebugItem()
11310 {
11311 super.SetDebugItem();
11312 _itemBase = this;
11313 }
11314
11316 {
11317 string text = super.GetDebugText();
11318
11320 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11321
11322 return text;
11323 }
11324 #endif
11325
11327 {
11328 return true;
11329 }
11330
11332
11334
11336 {
11339 }
11340
11341
11349
11365}
11366
11368{
11370 if (entity)
11371 {
11372 bool is_item = entity.IsInherited(
ItemBase);
11373 if (is_item && full_quantity)
11374 {
11377 }
11378 }
11379 else
11380 {
11382 return NULL;
11383 }
11384 return entity;
11385}
11386
11388{
11389 if (item)
11390 {
11391 if (health > 0)
11392 item.SetHealth("", "", health);
11393
11394 if (item.CanHaveTemperature())
11395 {
11397 if (item.CanFreeze())
11398 item.SetFrozen(false);
11399 }
11400
11401 if (item.HasEnergyManager())
11402 {
11403 if (quantity >= 0)
11404 {
11405 item.GetCompEM().SetEnergy0To1(quantity);
11406 }
11407 else
11408 {
11410 }
11411 }
11412 else if (item.IsMagazine())
11413 {
11414 Magazine mag = Magazine.Cast(item);
11415 if (quantity >= 0)
11416 {
11417 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11418 }
11419 else
11420 {
11422 }
11423
11424 }
11425 else
11426 {
11427 if (quantity >= 0)
11428 {
11429 item.SetQuantityNormalized(quantity, false);
11430 }
11431 else
11432 {
11434 }
11435
11436 }
11437 }
11438}
11439
11440#ifdef DEVELOPER
11442#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.