6682{
6684 {
6685 return true;
6686 }
6687};
6688
6689
6690
6692{
6696
6698
6701
6702
6703
6704
6705
6714
6720
6725
6730
6751 protected bool m_IsResultOfSplit
6752
6754
6759
6760
6761
6763
6767
6768
6769
6771
6774
6775
6776
6782
6783
6791
6794
6795
6797
6798
6800
6801
6806
6807
6812
6813
6815
6816
6818 {
6823
6824 if (!
GetGame().IsDedicatedServer())
6825 {
6827 {
6829
6831 {
6833 }
6834 }
6835
6838 }
6839
6840 m_OldLocation = null;
6841
6843 {
6845 }
6846
6847 if (ConfigIsExisting("headSelectionsToHide"))
6848 {
6851 }
6852
6854 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6855 {
6857 }
6858
6860
6861 m_IsResultOfSplit = false;
6862
6864 }
6865
6867 {
6868 super.InitItemVariables();
6869
6875 m_Count = ConfigGetInt(
"count");
6876
6879
6884
6887
6892
6904
6908
6909
6912 if (ConfigIsExisting("canBeSplit"))
6913 {
6916 }
6917
6919 if (ConfigIsExisting("itemBehaviour"))
6921
6922
6925 RegisterNetSyncVariableInt("m_VarLiquidType");
6926 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6927
6928 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6929 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6930 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6931
6932 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6933 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6934 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6935 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6936
6937 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6938 RegisterNetSyncVariableBool("m_IsTakeable");
6939 RegisterNetSyncVariableBool("m_IsHologram");
6940
6943 {
6946 }
6947
6949
6951 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6953
6954 }
6955
6957 {
6959 }
6960
6962 {
6965 {
6970 }
6971 }
6972
6973 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6974 {
6976 {
6979 }
6980
6982 }
6983
6985 {
6991 }
6992
6994
6996 {
6998
6999 if (!action)
7000 {
7001 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7002 return;
7003 }
7004
7006 if (!ai)
7007 {
7009 return;
7010 }
7011
7013 if (!action_array)
7014 {
7015 action_array = new array<ActionBase_Basic>;
7017 }
7018 if (LogManager.IsActionLogEnable())
7019 {
7020 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7021 }
7022
7023 if (action_array.Find(action) != -1)
7024 {
7025 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7026 }
7027 else
7028 {
7029 action_array.Insert(action);
7030 }
7031 }
7032
7034 {
7036 ActionBase action = player.GetActionManager().GetAction(actionName);
7039
7040 if (action_array)
7041 {
7042 action_array.RemoveItem(action);
7043 }
7044 }
7045
7046
7047
7049 {
7050 ActionOverrideData overrideData = new ActionOverrideData();
7054
7056 if (!actionMap)
7057 {
7060 }
7061
7062 actionMap.Insert(this.
Type(), overrideData);
7063
7064 }
7065
7067
7069
7070
7072 {
7075
7078
7079 string config_to_search = "CfgVehicles";
7080 string muzzle_owner_config;
7081
7083 {
7084 if (IsInherited(Weapon))
7085 config_to_search = "CfgWeapons";
7086
7087 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7088
7089 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7090
7092
7093 if (config_OnFire_subclass_count > 0)
7094 {
7095 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7096
7097 for (int i = 0; i < config_OnFire_subclass_count; i++)
7098 {
7099 string particle_class = "";
7101 string config_OnFire_entry = config_OnFire_class + particle_class;
7102 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7103 WPOF_array.Insert(WPOF);
7104 }
7105
7106
7108 }
7109 }
7110
7112 {
7113 config_to_search = "CfgWeapons";
7114 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7115
7116 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7117
7119
7120 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7121 {
7122 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7123
7124 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7125 {
7126 string particle_class2 = "";
7128 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7129 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7130 WPOBE_array.Insert(WPOBE);
7131 }
7132
7133
7135 }
7136 }
7137 }
7138
7139
7141 {
7144
7146 {
7147 string config_to_search = "CfgVehicles";
7148
7149 if (IsInherited(Weapon))
7150 config_to_search = "CfgWeapons";
7151
7152 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7153 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7154
7155 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7156 {
7157
7159
7161 {
7163 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7165 return;
7166 }
7167
7170
7171
7172
7174 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7175
7176 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7177 {
7178 string particle_class = "";
7180 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7182
7183 if (entry_type == CT_CLASS)
7184 {
7185 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7186 WPOOH_array.Insert(WPOF);
7187 }
7188 }
7189
7190
7192 }
7193 }
7194 }
7195
7197 {
7199 }
7200
7202 {
7204 {
7206
7209
7212
7213 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7214 }
7215 }
7216
7218 {
7220 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7221
7223 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7224
7226 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7227
7229 {
7231 }
7232 }
7233
7235 {
7237 }
7238
7240 {
7243 else
7245
7247 {
7250 }
7251 else
7252 {
7255
7258 }
7259
7261 }
7262
7264 {
7266 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7267 }
7268
7270 {
7272 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7274 }
7275
7277 {
7279 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7280 }
7281
7283 {
7286
7287 OverheatingParticle OP = new OverheatingParticle();
7292
7294 }
7295
7297 {
7300
7301 return -1;
7302 }
7303
7305 {
7307 {
7310
7311 for (int i = count; i > 0; --i)
7312 {
7313 int id = i - 1;
7316
7319
7320 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7321 {
7322 if (p)
7323 {
7326 }
7327 }
7328 }
7329 }
7330 }
7331
7333 {
7335 {
7337 {
7338 int id = i - 1;
7340
7341 if (OP)
7342 {
7344
7345 if (p)
7346 {
7348 }
7349
7350 delete OP;
7351 }
7352 }
7353
7356 }
7357 }
7358
7361 {
7362 return 0.0;
7363 }
7364
7365
7367 {
7368 return 250;
7369 }
7370
7372 {
7373 return 0;
7374 }
7375
7378 {
7380 return true;
7381
7382 return false;
7383 }
7384
7387 {
7390
7392 {
7394 }
7395 else
7396 {
7397
7399 }
7400
7402 }
7403
7410 {
7411 return -1;
7412 }
7413
7414
7415
7416
7418 {
7420 {
7422 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7423
7424 if (r_index >= 0)
7425 {
7426 InventoryLocation r_il = new InventoryLocation;
7427 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7428
7429 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7432 {
7433 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7434 }
7436 {
7437 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7438 }
7439
7440 }
7441
7442 player.GetHumanInventory().ClearUserReservedLocation(this);
7443 }
7444
7447 }
7448
7449
7450
7451
7453 {
7454 return ItemBase.m_DebugActionsMask;
7455 }
7456
7458 {
7459 return ItemBase.m_DebugActionsMask & mask;
7460 }
7461
7463 {
7464 ItemBase.m_DebugActionsMask = mask;
7465 }
7466
7468 {
7469 ItemBase.m_DebugActionsMask |= mask;
7470 }
7471
7473 {
7474 ItemBase.m_DebugActionsMask &= ~mask;
7475 }
7476
7478 {
7480 {
7482 }
7483 else
7484 {
7486 }
7487 }
7488
7489
7491 {
7492 if (GetEconomyProfile())
7493 {
7494 float q_max = GetEconomyProfile().GetQuantityMax();
7495 if (q_max > 0)
7496 {
7497 float q_min = GetEconomyProfile().GetQuantityMin();
7498 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7499
7501 {
7502 ComponentEnergyManager comp = GetCompEM();
7504 {
7506 }
7507 }
7509 {
7511
7512 }
7513
7514 }
7515 }
7516 }
7517
7520 {
7521 EntityAI parent = GetHierarchyParent();
7522
7523 if (parent)
7524 {
7525 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7526 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7527 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7528 }
7529 }
7530
7533 {
7534 EntityAI parent = GetHierarchyParent();
7535
7536 if (parent)
7537 {
7538 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7539 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7540 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7541 }
7542 }
7543
7545 {
7546
7547
7548
7549
7551
7553 {
7554 if (ScriptInputUserData.CanStoreInputUserData())
7555 {
7556 ScriptInputUserData ctx = new ScriptInputUserData;
7562 ctx.
Write(use_stack_max);
7565
7567 {
7568 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7569 }
7570 }
7571 }
7572 else if (!
GetGame().IsMultiplayer())
7573 {
7575 }
7576 }
7577
7579 {
7581 }
7582
7584 {
7586 }
7587
7589 {
7591 }
7592
7594 {
7595
7596 return false;
7597 }
7598
7600 {
7601 return false;
7602 }
7603
7607 {
7608 return false;
7609 }
7610
7612 {
7613 return "";
7614 }
7615
7617
7619 {
7620 return false;
7621 }
7622
7624 {
7625 return true;
7626 }
7627
7628
7629
7631 {
7632 return true;
7633 }
7634
7636 {
7637 return true;
7638 }
7639
7641 {
7642 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7644 }
7645
7647 {
7649 }
7650
7652 {
7654 if (!is_being_placed)
7656 SetSynchDirty();
7657 }
7658
7659
7661
7663 {
7665 }
7666
7668 {
7670 }
7671
7673 {
7674 return 1;
7675 }
7676
7678 {
7679 return false;
7680 }
7681
7683 {
7685 SetSynchDirty();
7686 }
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7723 {
7724 super.OnMovedInsideCargo(container);
7725
7726 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7727 }
7728
7729 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7730 {
7731 super.EEItemLocationChanged(oldLoc,newLoc);
7732
7733 PlayerBase new_player = null;
7734 PlayerBase old_player = null;
7735
7736 if (newLoc.GetParent())
7737 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7738
7739 if (oldLoc.GetParent())
7740 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7741
7743 {
7744 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7745
7746 if (r_index >= 0)
7747 {
7748 InventoryLocation r_il = new InventoryLocation;
7749 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7750
7751 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7754 {
7755 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7756 }
7758 {
7759 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7760 }
7761
7762 }
7763 }
7764
7766 {
7767 if (new_player)
7768 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7769
7770 if (new_player == old_player)
7771 {
7772
7773 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7774 {
7776 {
7777 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7778 {
7779 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7780 }
7781 }
7782 else
7783 {
7784 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7785 }
7786 }
7787
7788 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7789 {
7790 int type = oldLoc.GetType();
7792 {
7793 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7794 }
7796 {
7797 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7798 }
7799 }
7800 if (!m_OldLocation)
7801 {
7802 m_OldLocation = new InventoryLocation;
7803 }
7804 m_OldLocation.Copy(oldLoc);
7805 }
7806 else
7807 {
7808 if (m_OldLocation)
7809 {
7810 m_OldLocation.Reset();
7811 }
7812 }
7813
7815 }
7816 else
7817 {
7818 if (new_player)
7819 {
7820 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7821 if (res_index >= 0)
7822 {
7823 InventoryLocation il = new InventoryLocation;
7824 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7826 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7829 {
7830 il.
GetParent().GetOnReleaseLock().Invoke(it);
7831 }
7833 {
7835 }
7836
7837 }
7838 }
7840 {
7841
7843 }
7844
7845 if (m_OldLocation)
7846 {
7847 m_OldLocation.Reset();
7848 }
7849 }
7850 }
7851
7852 override void EOnContact(IEntity other, Contact extra)
7853 {
7855 {
7856 int liquidType = -1;
7858 if (impactSpeed > 0.0)
7859 {
7861 #ifndef SERVER
7863 #else
7865 SetSynchDirty();
7866 #endif
7868 }
7869 }
7870
7871 #ifdef SERVER
7872 if (GetCompEM() && GetCompEM().IsPlugged())
7873 {
7874 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7875 GetCompEM().UnplugThis();
7876 }
7877 #endif
7878 }
7879
7881
7883 {
7885 }
7886
7888 {
7889
7890 }
7891
7893 {
7894 super.OnItemLocationChanged(old_owner, new_owner);
7895
7896 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7897 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7898
7899 if (!relatedPlayer && playerNew)
7900 relatedPlayer = playerNew;
7901
7902 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7903 {
7905 if (actionMgr)
7906 {
7907 ActionBase currentAction = actionMgr.GetRunningAction();
7908 if (currentAction)
7910 }
7911 }
7912
7913 Man ownerPlayerOld = null;
7914 Man ownerPlayerNew = null;
7915
7916 if (old_owner)
7917 {
7918 if (old_owner.
IsMan())
7919 {
7920 ownerPlayerOld = Man.Cast(old_owner);
7921 }
7922 else
7923 {
7924 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7925 }
7926 }
7927 else
7928 {
7930 {
7932
7933 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7934 {
7935 GetCompEM().UnplugThis();
7936 }
7937 }
7938 }
7939
7940 if (new_owner)
7941 {
7942 if (new_owner.
IsMan())
7943 {
7944 ownerPlayerNew = Man.Cast(new_owner);
7945 }
7946 else
7947 {
7948 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7949 }
7950 }
7951
7952 if (ownerPlayerOld != ownerPlayerNew)
7953 {
7954 if (ownerPlayerOld)
7955 {
7956 array<EntityAI> subItemsExit = new array<EntityAI>;
7958 for (int i = 0; i < subItemsExit.Count(); i++)
7959 {
7962 }
7963 }
7964
7965 if (ownerPlayerNew)
7966 {
7967 array<EntityAI> subItemsEnter = new array<EntityAI>;
7969 for (int j = 0; j < subItemsEnter.Count(); j++)
7970 {
7973 }
7974 }
7975 }
7976 else if (ownerPlayerNew != null)
7977 {
7978 PlayerBase nplayer;
7979 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7980 {
7981 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7983 for (int k = 0; k < subItemsUpdate.Count(); k++)
7984 {
7986 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7987 }
7988 }
7989 }
7990
7991 if (old_owner)
7992 old_owner.OnChildItemRemoved(this);
7993 if (new_owner)
7994 new_owner.OnChildItemReceived(this);
7995 }
7996
7997
7999 {
8000 super.EEDelete(parent);
8001 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8002 if (player)
8003 {
8005
8006 if (player.IsAlive())
8007 {
8008 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8009 if (r_index >= 0)
8010 {
8011 InventoryLocation r_il = new InventoryLocation;
8012 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8013
8014 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8017 {
8018 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8019 }
8021 {
8022 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8023 }
8024
8025 }
8026
8027 player.RemoveQuickBarEntityShortcut(this);
8028 }
8029 }
8030 }
8031
8033 {
8034 super.EEKilled(killer);
8035
8038 {
8039 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8040 {
8041 if (IsMagazine())
8042 {
8043 if (Magazine.Cast(this).GetAmmoCount() > 0)
8044 {
8046 }
8047 }
8048 else
8049 {
8051 }
8052 }
8053 }
8054 }
8055
8057 {
8058 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8059
8060 super.OnWasAttached(parent, slot_id);
8061
8064
8066 }
8067
8069 {
8070 super.OnWasDetached(parent, slot_id);
8071
8074 }
8075
8077 {
8078 int idx;
8081
8082 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8083 if (inventory_slots.Count() < 1)
8084 {
8085 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8086 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8087 }
8088 else
8089 {
8090 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8091 }
8092
8093 idx = inventory_slots.Find(slot);
8094 if (idx < 0)
8095 return "";
8096
8097 return attach_types.Get(idx);
8098 }
8099
8101 {
8102 int idx = -1;
8103 string slot;
8104
8107
8108 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8109 if (inventory_slots.Count() < 1)
8110 {
8111 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8112 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8113 }
8114 else
8115 {
8116 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8117 if (detach_types.Count() < 1)
8118 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8119 }
8120
8121 for (int i = 0; i < inventory_slots.Count(); i++)
8122 {
8123 slot = inventory_slots.Get(i);
8124 }
8125
8126 if (slot != "")
8127 {
8128 if (detach_types.Count() == 1)
8129 idx = 0;
8130 else
8131 idx = inventory_slots.Find(slot);
8132 }
8133 if (idx < 0)
8134 return "";
8135
8136 return detach_types.Get(idx);
8137 }
8138
8140 {
8141
8143
8144
8145 float min_time = 1;
8146 float max_time = 3;
8147 float delay = Math.RandomFloat(min_time, max_time);
8148
8149 explode_timer.Run(delay, this, "DoAmmoExplosion");
8150 }
8151
8153 {
8154 Magazine magazine = Magazine.Cast(this);
8155 int pop_sounds_count = 6;
8156 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8157
8158
8159 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8160 string sound_name = pop_sounds[ sound_idx ];
8162
8163
8164 magazine.ServerAddAmmoCount(-1);
8165
8166
8167 float min_temp_to_explode = 100;
8168
8169 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8170 {
8172 }
8173 }
8174
8175
8176 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8177 {
8178 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8179
8180 const int CHANCE_DAMAGE_CARGO = 4;
8181 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8182 const int CHANCE_DAMAGE_NOTHING = 2;
8183
8185 {
8186 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8187 int chances;
8188 int rnd;
8189
8190 if (GetInventory().GetCargo())
8191 {
8192 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8193 rnd = Math.RandomInt(0,chances);
8194
8195 if (rnd < CHANCE_DAMAGE_CARGO)
8196 {
8198 }
8199 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8200 {
8202 }
8203 }
8204 else
8205 {
8206 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8207 rnd = Math.RandomInt(0,chances);
8208
8209 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8210 {
8212 }
8213 }
8214 }
8215 }
8216
8218 {
8219 if (GetInventory().GetCargo())
8220 {
8221 int item_count = GetInventory().GetCargo().GetItemCount();
8222 if (item_count > 0)
8223 {
8224 int random_pick = Math.RandomInt(0, item_count);
8226 if (!item.IsExplosive())
8227 {
8228 item.AddHealth("","",damage);
8229 return true;
8230 }
8231 }
8232 }
8233 return false;
8234 }
8235
8237 {
8238 int attachment_count = GetInventory().AttachmentCount();
8239 if (attachment_count > 0)
8240 {
8241 int random_pick = Math.RandomInt(0, attachment_count);
8242 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8243 if (!attachment.IsExplosive())
8244 {
8245 attachment.AddHealth("","",damage);
8246 return true;
8247 }
8248 }
8249 return false;
8250 }
8251
8253 {
8255 }
8256
8258 {
8260 return GetInventory().CanRemoveEntity();
8261
8262 return false;
8263 }
8264
8266 {
8268 return;
8269
8271 {
8272 if (ScriptInputUserData.CanStoreInputUserData())
8273 {
8274 ScriptInputUserData ctx = new ScriptInputUserData;
8279 ctx.
Write(destination_entity);
8283 }
8284 }
8285 else if (!
GetGame().IsMultiplayer())
8286 {
8288 }
8289 }
8290
8292 {
8294 return;
8295
8296 float split_quantity_new;
8300 InventoryLocation loc = new InventoryLocation;
8301
8302 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8303 {
8305 split_quantity_new = stack_max;
8306 else
8308
8309 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8310 if (new_item)
8311 {
8312 new_item.SetResultOfSplit(true);
8313 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8315 new_item.SetQuantity(split_quantity_new);
8316 }
8317 }
8318 else if (destination_entity && slot_id == -1)
8319 {
8320 if (quantity > stack_max)
8321 split_quantity_new = stack_max;
8322 else
8323 split_quantity_new = quantity;
8324
8326 {
8329 }
8330
8331 if (new_item)
8332 {
8333 new_item.SetResultOfSplit(true);
8334 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8336 new_item.SetQuantity(split_quantity_new);
8337 }
8338 }
8339 else
8340 {
8341 if (stack_max != 0)
8342 {
8344 {
8346 }
8347
8348 if (split_quantity_new == 0)
8349 {
8350 if (!
GetGame().IsMultiplayer())
8351 player.PhysicalPredictiveDropItem(this);
8352 else
8353 player.ServerDropEntity(this);
8354 return;
8355 }
8356
8358
8359 if (new_item)
8360 {
8361 new_item.SetResultOfSplit(true);
8362 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8364 new_item.SetQuantity(stack_max);
8365 new_item.PlaceOnSurface();
8366 }
8367 }
8368 }
8369 }
8370
8372 {
8374 return;
8375
8376 float split_quantity_new;
8380 InventoryLocation loc = new InventoryLocation;
8381
8382 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8383 {
8385 split_quantity_new = stack_max;
8386 else
8388
8389 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8390 if (new_item)
8391 {
8392 new_item.SetResultOfSplit(true);
8393 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8395 new_item.SetQuantity(split_quantity_new);
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 {
8409 }
8410
8411 if (new_item)
8412 {
8413 new_item.SetResultOfSplit(true);
8414 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8416 new_item.SetQuantity(split_quantity_new);
8417 }
8418 }
8419 else
8420 {
8421 if (stack_max != 0)
8422 {
8424 {
8426 }
8427
8429
8430 if (new_item)
8431 {
8432 new_item.SetResultOfSplit(true);
8433 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8435 new_item.SetQuantity(stack_max);
8436 new_item.PlaceOnSurface();
8437 }
8438 }
8439 }
8440 }
8441
8443 {
8445 return;
8446
8448 {
8449 if (ScriptInputUserData.CanStoreInputUserData())
8450 {
8451 ScriptInputUserData ctx = new ScriptInputUserData;
8456 dst.WriteToContext(ctx);
8458 }
8459 }
8460 else if (!
GetGame().IsMultiplayer())
8461 {
8463 }
8464 }
8465
8467 {
8469 return;
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 return this;
8503
8505 float split_quantity_new;
8507 if (dst.IsValid())
8508 {
8509 int slot_id = dst.GetSlot();
8511
8512 if (quantity > stack_max)
8513 split_quantity_new = stack_max;
8514 else
8515 split_quantity_new = quantity;
8516
8518
8519 if (new_item)
8520 {
8521 new_item.SetResultOfSplit(true);
8522 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8525 }
8526
8527 return new_item;
8528 }
8529
8530 return null;
8531 }
8532
8534 {
8536 return;
8537
8539 float split_quantity_new;
8541 if (destination_entity)
8542 {
8544 if (quantity > stackable)
8545 split_quantity_new = stackable;
8546 else
8547 split_quantity_new = quantity;
8548
8549 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8550 if (new_item)
8551 {
8552 new_item.SetResultOfSplit(true);
8553 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8555 new_item.SetQuantity(split_quantity_new);
8556 }
8557 }
8558 }
8559
8561 {
8563 return;
8564
8566 {
8567 if (ScriptInputUserData.CanStoreInputUserData())
8568 {
8569 ScriptInputUserData ctx = new ScriptInputUserData;
8574 ItemBase destination_entity =
this;
8575 ctx.
Write(destination_entity);
8579 }
8580 }
8581 else if (!
GetGame().IsMultiplayer())
8582 {
8584 }
8585 }
8586
8588 {
8590 return;
8591
8593 float split_quantity_new;
8595 if (player)
8596 {
8598 if (quantity > stackable)
8599 split_quantity_new = stackable;
8600 else
8601 split_quantity_new = quantity;
8602
8603 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8604 new_item =
ItemBase.Cast(in_hands);
8605 if (new_item)
8606 {
8607 new_item.SetResultOfSplit(true);
8608 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8610 new_item.SetQuantity(split_quantity_new);
8611 }
8612 }
8613 }
8614
8616 {
8618 return;
8619
8621 float split_quantity_new = Math.Floor(quantity * 0.5);
8622
8624
8625 if (new_item)
8626 {
8627 if (new_item.GetQuantityMax() < split_quantity_new)
8628 {
8629 split_quantity_new = new_item.GetQuantityMax();
8630 }
8631
8632 new_item.SetResultOfSplit(true);
8633 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8634
8636 {
8639 }
8640 else
8641 {
8644 }
8645 }
8646 }
8647
8649 {
8651 return;
8652
8654 float split_quantity_new = Math.Floor(quantity / 2);
8655
8656 InventoryLocation invloc = new InventoryLocation;
8658
8660 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8661
8662 if (new_item)
8663 {
8664 if (new_item.GetQuantityMax() < split_quantity_new)
8665 {
8666 split_quantity_new = new_item.GetQuantityMax();
8667 }
8669 {
8672 }
8673 else
8674 {
8677 }
8678 }
8679 }
8680
8683 {
8684 SetWeightDirty();
8686
8687 if (parent)
8688 parent.OnAttachmentQuantityChangedEx(this, delta);
8689
8691 {
8693 {
8695 }
8697 {
8698 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8700 }
8701 }
8702
8703 }
8704
8707 {
8708
8709 }
8710
8713 {
8715 }
8716
8718 {
8719 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8720
8722 {
8723 if (newLevel == GameConstants.STATE_RUINED)
8724 {
8726 EntityAI parent = GetHierarchyParent();
8727 if (parent && parent.IsFireplace())
8728 {
8729 CargoBase cargo = GetInventory().GetCargo();
8730 if (cargo)
8731 {
8733 {
8735 }
8736 }
8737 }
8738 }
8739
8741 {
8742
8744 return;
8745 }
8746
8747 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8748 {
8750 }
8751 }
8752 }
8753
8754
8756 {
8757 super.OnRightClick();
8758
8760 {
8762 {
8763 if (ScriptInputUserData.CanStoreInputUserData())
8764 {
8765 vector m4[4];
8767
8768 EntityAI root = GetHierarchyRoot();
8769
8770 InventoryLocation dst = new InventoryLocation;
8772 {
8773 if (root)
8774 {
8775 root.GetTransform(m4);
8777 }
8778 else
8779 GetInventory().GetCurrentInventoryLocation(dst);
8780 }
8781 else
8782 {
8784
8785
8786 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8787 {
8788 if (root)
8789 {
8790 root.GetTransform(m4);
8792 }
8793 else
8794 GetInventory().GetCurrentInventoryLocation(dst);
8795 }
8796 else
8797 {
8798 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8799 }
8800 }
8801
8802 ScriptInputUserData ctx = new ScriptInputUserData;
8810 }
8811 }
8812 else if (!
GetGame().IsMultiplayer())
8813 {
8815 }
8816 }
8817 }
8818
8819 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8820 {
8821
8822 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8823 return false;
8824
8825 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8826 return false;
8827
8828
8830 return false;
8831
8832
8833 Magazine mag = Magazine.Cast(this);
8834 if (mag)
8835 {
8836 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8837 return false;
8838
8839 if (stack_max_limit)
8840 {
8841 Magazine other_mag = Magazine.Cast(other_item);
8842 if (other_item)
8843 {
8844 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8845 return false;
8846 }
8847
8848 }
8849 }
8850 else
8851 {
8852
8854 return false;
8855
8857 return false;
8858 }
8859
8860 PlayerBase player = null;
8861 if (CastTo(player, GetHierarchyRootPlayer()))
8862 {
8863 if (player.GetInventory().HasAttachment(this))
8864 return false;
8865
8866 if (player.IsItemsToDelete())
8867 return false;
8868 }
8869
8870 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8871 return false;
8872
8873 int slotID;
8875 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8876 return false;
8877
8878 return true;
8879 }
8880
8882 {
8884 }
8885
8887 {
8888 return m_IsResultOfSplit;
8889 }
8890
8892 {
8893 m_IsResultOfSplit = value;
8894 }
8895
8897 {
8899 }
8900
8902 {
8903 float other_item_quantity = other_item.GetQuantity();
8904 float this_free_space;
8905
8907
8909
8910 if (other_item_quantity > this_free_space)
8911 {
8912 return this_free_space;
8913 }
8914 else
8915 {
8916 return other_item_quantity;
8917 }
8918 }
8919
8921 {
8923 }
8924
8926 {
8928 return;
8929
8930 if (!IsMagazine() && other_item)
8931 {
8933 if (quantity_used != 0)
8934 {
8935 float hp1 = GetHealth01("","");
8936 float hp2 = other_item.GetHealth01("","");
8937 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8938 hpResult = hpResult / (
GetQuantity() + quantity_used);
8939
8940 hpResult *= GetMaxHealth();
8941 Math.Round(hpResult);
8942 SetHealth("", "Health", hpResult);
8943
8945 other_item.AddQuantity(-quantity_used);
8946 }
8947 }
8949 }
8950
8952 {
8953 #ifdef SERVER
8954 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8955 GetHierarchyParent().IncreaseLifetimeUp();
8956 #endif
8957 };
8958
8960 {
8961 PlayerBase p = PlayerBase.Cast(player);
8962
8963 array<int> recipesIds = p.m_Recipes;
8964 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8965 if (moduleRecipesManager)
8966 {
8967 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8968 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8969 }
8970
8971 for (int i = 0;i < recipesIds.Count(); i++)
8972 {
8973 int key = recipesIds.Get(i);
8974 string recipeName = moduleRecipesManager.GetRecipeName(key);
8976 }
8977 }
8978
8979
8980 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8981 {
8982 super.GetDebugActions(outputList);
8983
8984
8989
8990
8994
8998
8999
9002
9003
9005 {
9008 }
9009
9011
9014
9018 }
9019
9020
9021
9022
9024 {
9025 super.OnAction(action_id, player, ctx);
9026 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9027 {
9028 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9029 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9030 PlayerBase p = PlayerBase.Cast(player);
9031 if (
EActions.RECIPES_RANGE_START < 1000)
9032 {
9033 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9034 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9035 }
9036 }
9037 #ifndef SERVER
9038 else if (action_id ==
EActions.WATCH_PLAYER)
9039 {
9040 PluginDeveloper.SetDeveloperItemClientEx(player);
9041 }
9042 #endif
9044 {
9045 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9046 {
9047 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9048 OnDebugButtonPressServer(id + 1);
9049 }
9050
9051 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9052 {
9053 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9055 }
9056
9057 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9058 {
9059 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9061 }
9062
9063 else if (action_id ==
EActions.ADD_QUANTITY)
9064 {
9065 if (IsMagazine())
9066 {
9067 Magazine mag = Magazine.Cast(this);
9068 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9069 }
9070 else
9071 {
9073 }
9074
9075 if (m_EM)
9076 {
9077 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9078 }
9079
9080 }
9081
9082 else if (action_id ==
EActions.REMOVE_QUANTITY)
9083 {
9084 if (IsMagazine())
9085 {
9086 Magazine mag2 = Magazine.Cast(this);
9087 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9088 }
9089 else
9090 {
9092 }
9093 if (m_EM)
9094 {
9095 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9096 }
9097
9098 }
9099
9100 else if (action_id ==
EActions.SET_QUANTITY_0)
9101 {
9103
9104 if (m_EM)
9105 {
9106 m_EM.SetEnergy(0);
9107 }
9108 }
9109
9110 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9111 {
9113
9114 if (m_EM)
9115 {
9116 m_EM.SetEnergy(m_EM.GetEnergyMax());
9117 }
9118 }
9119
9120 else if (action_id ==
EActions.ADD_HEALTH)
9121 {
9122 AddHealth("","",GetMaxHealth("","Health")/5);
9123 }
9124 else if (action_id ==
EActions.REMOVE_HEALTH)
9125 {
9126 AddHealth("","",-GetMaxHealth("","Health")/5);
9127 }
9128 else if (action_id ==
EActions.DESTROY_HEALTH)
9129 {
9130 SetHealth01("","",0);
9131 }
9132 else if (action_id ==
EActions.WATCH_ITEM)
9133 {
9135 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9136 #ifdef DEVELOPER
9137 SetDebugDeveloper_item(this);
9138 #endif
9139 }
9140
9141 else if (action_id ==
EActions.ADD_TEMPERATURE)
9142 {
9143 AddTemperature(20);
9144
9145 }
9146
9147 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9148 {
9149 AddTemperature(-20);
9150
9151 }
9152
9153 else if (action_id ==
EActions.FLIP_FROZEN)
9154 {
9155 SetFrozen(!GetIsFrozen());
9156
9157 }
9158
9159 else if (action_id ==
EActions.ADD_WETNESS)
9160 {
9162
9163 }
9164
9165 else if (action_id ==
EActions.REMOVE_WETNESS)
9166 {
9168
9169 }
9170
9171 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9172 {
9175
9176
9177 }
9178
9179 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9180 {
9183 }
9184
9185 else if (action_id ==
EActions.MAKE_SPECIAL)
9186 {
9187 auto debugParams = DebugSpawnParams.WithPlayer(player);
9188 OnDebugSpawnEx(debugParams);
9189 }
9190
9191 else if (action_id ==
EActions.DELETE)
9192 {
9193 Delete();
9194 }
9195
9196 }
9197
9198
9199 return false;
9200 }
9201
9202
9203
9204
9208
9211
9212
9213
9215 {
9216 return false;
9217 }
9218
9219
9221 {
9222 return true;
9223 }
9224
9225
9227 {
9228 return true;
9229 }
9230
9231
9232
9234 {
9235 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9237 }
9238
9241 {
9242 return null;
9243 }
9244
9246 {
9247 return false;
9248 }
9249
9251 {
9252 return false;
9253 }
9254
9258
9259
9261 {
9262 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9263 return module_repairing.CanRepair(this, item_repair_kit);
9264 }
9265
9266
9267 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9268 {
9269 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9270 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9271 }
9272
9273
9275 {
9276
9277
9278
9279
9280
9281
9282
9283
9284 return 1;
9285 }
9286
9287
9288
9290 {
9292 }
9293
9294
9295
9297 {
9299 }
9300
9301
9310 {
9311 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9312
9313 if (player)
9314 {
9315 player.MessageStatus(text);
9316 }
9317 }
9318
9319
9328 {
9329 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9330
9331 if (player)
9332 {
9333 player.MessageAction(text);
9334 }
9335 }
9336
9337
9346 {
9347 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9348
9349 if (player)
9350 {
9351 player.MessageFriendly(text);
9352 }
9353 }
9354
9355
9364 {
9365 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9366
9367 if (player)
9368 {
9369 player.MessageImportant(text);
9370 }
9371 }
9372
9374 {
9375 return true;
9376 }
9377
9378
9379 override bool KindOf(
string tag)
9380 {
9381 bool found = false;
9382 string item_name = this.
GetType();
9385
9386 int array_size = item_tag_array.Count();
9387 for (int i = 0; i < array_size; i++)
9388 {
9389 if (item_tag_array.Get(i) == tag)
9390 {
9391 found = true;
9392 break;
9393 }
9394 }
9395 return found;
9396 }
9397
9398
9400 {
9401
9402 super.OnRPC(sender, rpc_type,ctx);
9403
9404
9405 switch (rpc_type)
9406 {
9407 #ifndef SERVER
9408 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9409 Param2<bool, string> p = new Param2<bool, string>(false, "");
9410
9412 return;
9413
9414 bool play = p.param1;
9415 string soundSet = p.param2;
9416
9417 if (play)
9418 {
9420 {
9422 {
9424 }
9425 }
9426 else
9427 {
9429 }
9430 }
9431 else
9432 {
9434 }
9435
9436 break;
9437 #endif
9438
9439 }
9440
9442 {
9444 }
9445 }
9446
9447
9448
9449
9451 {
9452 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9453 return plugin.GetID(
name);
9454 }
9455
9457 {
9458 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9459 return plugin.GetName(id);
9460 }
9461
9464 {
9465
9466
9467 int varFlags;
9468 if (!ctx.
Read(varFlags))
9469 return;
9470
9471 if (varFlags & ItemVariableFlags.FLOAT)
9472 {
9474 }
9475 }
9476
9478 {
9479
9480 super.SerializeNumericalVars(floats_out);
9481
9482
9483
9485 {
9487 }
9488
9490 {
9492 }
9493
9495 {
9497 }
9498
9500 {
9505 }
9506
9508 {
9510 }
9511 }
9512
9514 {
9515
9516 super.DeSerializeNumericalVars(floats);
9517
9518
9519 int index = 0;
9520 int mask = Math.Round(floats.Get(index));
9521
9522 index++;
9523
9525 {
9527 {
9529 }
9530 else
9531 {
9532 float quantity = floats.Get(index);
9534 }
9535 index++;
9536 }
9537
9539 {
9540 float wet = floats.Get(index);
9542 index++;
9543 }
9544
9546 {
9547 int liquidtype = Math.Round(floats.Get(index));
9549 index++;
9550 }
9551
9553 {
9555 index++;
9557 index++;
9559 index++;
9561 index++;
9562 }
9563
9565 {
9566 int cleanness = Math.Round(floats.Get(index));
9568 index++;
9569 }
9570 }
9571
9573 {
9574 super.WriteVarsToCTX(ctx);
9575
9576
9578 {
9580 }
9581
9583 {
9585 }
9586
9588 {
9590 }
9591
9593 {
9594 int r,g,b,a;
9600 }
9601
9603 {
9605 }
9606 }
9607
9609 {
9610 if (!super.ReadVarsFromCTX(ctx,version))
9611 return false;
9612
9613 int intValue;
9614 float value;
9615
9616 if (version < 140)
9617 {
9618 if (!ctx.
Read(intValue))
9619 return false;
9620
9621 m_VariablesMask = intValue;
9622 }
9623
9625 {
9626 if (!ctx.
Read(value))
9627 return false;
9628
9630 {
9632 }
9633 else
9634 {
9636 }
9637 }
9638
9639 if (version < 140)
9640 {
9642 {
9643 if (!ctx.
Read(value))
9644 return false;
9645 SetTemperatureDirect(value);
9646 }
9647 }
9648
9650 {
9651 if (!ctx.
Read(value))
9652 return false;
9654 }
9655
9657 {
9658 if (!ctx.
Read(intValue))
9659 return false;
9661 }
9662
9664 {
9665 int r,g,b,a;
9667 return false;
9669 return false;
9671 return false;
9673 return false;
9674
9676 }
9677
9679 {
9680 if (!ctx.
Read(intValue))
9681 return false;
9683 }
9684
9685 if (version >= 138 && version < 140)
9686 {
9688 {
9689 if (!ctx.
Read(intValue))
9690 return false;
9691 SetFrozen(intValue);
9692 }
9693 }
9694
9695 return true;
9696 }
9697
9698
9700 {
9703 {
9705 }
9706
9707 if (!super.OnStoreLoad(ctx, version))
9708 {
9710 return false;
9711 }
9712
9713 if (version >= 114)
9714 {
9715 bool hasQuickBarIndexSaved;
9716
9717 if (!ctx.
Read(hasQuickBarIndexSaved))
9718 {
9720 return false;
9721 }
9722
9723 if (hasQuickBarIndexSaved)
9724 {
9725 int itmQBIndex;
9726
9727
9728 if (!ctx.
Read(itmQBIndex))
9729 {
9731 return false;
9732 }
9733
9734 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9735 if (itmQBIndex != -1 && parentPlayer)
9736 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9737 }
9738 }
9739 else
9740 {
9741
9742 PlayerBase player;
9743 int itemQBIndex;
9744 if (version ==
int.
MAX)
9745 {
9746 if (!ctx.
Read(itemQBIndex))
9747 {
9749 return false;
9750 }
9751 }
9752 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9753 {
9754
9755 if (!ctx.
Read(itemQBIndex))
9756 {
9758 return false;
9759 }
9760 if (itemQBIndex != -1 && player)
9761 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9762 }
9763 }
9764
9765 if (version < 140)
9766 {
9767
9768 if (!LoadVariables(ctx, version))
9769 {
9771 return false;
9772 }
9773 }
9774
9775
9777 {
9779 return false;
9780 }
9781 if (version >= 132)
9782 {
9784 if (raib)
9785 {
9787 {
9789 return false;
9790 }
9791 }
9792 }
9793
9795 return true;
9796 }
9797
9798
9799
9801 {
9802 super.OnStoreSave(ctx);
9803
9804 PlayerBase player;
9805 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9806 {
9808
9809 int itemQBIndex = -1;
9810 itemQBIndex = player.FindQuickBarEntityIndex(this);
9811 ctx.
Write(itemQBIndex);
9812 }
9813 else
9814 {
9816 }
9817
9819
9821 if (raib)
9822 {
9824 }
9825 }
9826
9827
9829 {
9830 super.AfterStoreLoad();
9831
9833 {
9835 }
9836
9838 {
9841 }
9842 }
9843
9845 {
9846 super.EEOnAfterLoad();
9847
9849 {
9851 }
9852
9855 }
9856
9858 {
9859 return false;
9860 }
9861
9862
9863
9865 {
9867 {
9868 #ifdef PLATFORM_CONSOLE
9869
9871 {
9873 if (menu)
9874 {
9876 }
9877 }
9878 #endif
9879 }
9880
9882 {
9885 }
9886
9888 {
9889 SetWeightDirty();
9891 }
9893 {
9896 }
9897
9899 {
9902 }
9904 {
9907 }
9908
9909 super.OnVariablesSynchronized();
9910 }
9911
9912
9913
9915 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9916 {
9917 if (!IsServerCheck(allow_client))
9918 return false;
9919
9921 return false;
9922
9925
9926 if (value <= (min + 0.001))
9927 value = min;
9928
9929 if (value == min)
9930 {
9931 if (destroy_config)
9932 {
9933 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9934 if (dstr)
9935 {
9937 this.Delete();
9938 return true;
9939 }
9940 }
9941 else if (destroy_forced)
9942 {
9944 this.Delete();
9945 return true;
9946 }
9947
9949 }
9950
9953
9955 {
9957
9958 if (delta)
9960 }
9961
9963
9964 return false;
9965 }
9966
9967
9969 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9970 {
9972 }
9973
9975 {
9978 }
9979
9981 {
9984 }
9985
9988 {
9989 float value_clamped = Math.Clamp(value, 0, 1);
9991 SetQuantity(result, destroy_config, destroy_forced);
9992 }
9993
9994
9997 {
9999 }
10000
10002 {
10004 }
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10016 {
10017 int slot = -1;
10018 if (GetInventory())
10019 {
10020 InventoryLocation il = new InventoryLocation;
10021 GetInventory().GetCurrentInventoryLocation(il);
10023 }
10024
10026 }
10027
10029 {
10030 float quantity_max = 0;
10031
10033 {
10034 if (attSlotID != -1)
10035 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10036
10037 if (quantity_max <= 0)
10039 }
10040
10041 if (quantity_max <= 0)
10043
10044 return quantity_max;
10045 }
10046
10048 {
10050 }
10051
10053 {
10055 }
10056
10057
10059 {
10061 }
10062
10064 {
10066 }
10067
10069 {
10071 }
10072
10073
10075 {
10076
10077 float weightEx = GetWeightEx();
10078 float special = GetInventoryAndCargoWeight();
10079 return weightEx - special;
10080 }
10081
10082
10084 {
10086 }
10087
10089 {
10091 {
10092 #ifdef DEVELOPER
10093 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10094 {
10095 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10097 }
10098 #endif
10099
10100 return GetQuantity() * GetConfigWeightModified();
10101 }
10102 else if (HasEnergyManager())
10103 {
10104 #ifdef DEVELOPER
10105 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10106 {
10107 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10108 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10109 }
10110 #endif
10111 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10112 }
10113 else
10114 {
10115 #ifdef DEVELOPER
10116 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10117 {
10118 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10119 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10120 }
10121 #endif
10122 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10123 }
10124 }
10125
10128 {
10129 int item_count = 0;
10131
10132 if (GetInventory().GetCargo() != NULL)
10133 {
10134 item_count = GetInventory().GetCargo().GetItemCount();
10135 }
10136
10137 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10138 {
10139 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10140 if (item)
10141 item_count += item.GetNumberOfItems();
10142 }
10143 return item_count;
10144 }
10145
10148 {
10149 float weight = 0;
10150 float wetness = 1;
10151 if (include_wetness)
10154 {
10155 weight = wetness * m_ConfigWeight;
10156 }
10158 {
10159 weight = 1;
10160 }
10161 return weight;
10162 }
10163
10164
10165
10167 {
10168 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10169 {
10170 GameInventory inv = GetInventory();
10171 array<EntityAI> items = new array<EntityAI>;
10173 for (int i = 0; i < items.Count(); i++)
10174 {
10176 if (item)
10177 {
10179 }
10180 }
10181 }
10182 }
10183
10184
10185
10186
10188 {
10189 float energy = 0;
10190 if (HasEnergyManager())
10191 {
10192 energy = GetCompEM().GetEnergy();
10193 }
10194 return energy;
10195 }
10196
10197
10199 {
10200 super.OnEnergyConsumed();
10201
10203 }
10204
10206 {
10207 super.OnEnergyAdded();
10208
10210 }
10211
10212
10214 {
10215 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10216 {
10218 {
10219 float energy_0to1 = GetCompEM().GetEnergy0To1();
10221 }
10222 }
10223 }
10224
10225
10227 {
10228 return ConfigGetFloat("heatIsolation");
10229 }
10230
10232 {
10234 }
10235
10237 {
10238 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10239 if (
GetGame().ConfigIsExisting(paramPath))
10241
10242 return 0.0;
10243 }
10244
10246 {
10247 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10248 if (
GetGame().ConfigIsExisting(paramPath))
10250
10251 return 0.0;
10252 }
10253
10254 override void SetWet(
float value,
bool allow_client =
false)
10255 {
10256 if (!IsServerCheck(allow_client))
10257 return;
10258
10261
10263
10264 m_VarWet = Math.Clamp(value, min, max);
10265
10267 {
10270 }
10271 }
10272
10273 override void AddWet(
float value)
10274 {
10276 }
10277
10279 {
10281 }
10282
10284 {
10286 }
10287
10289 {
10291 }
10292
10294 {
10296 }
10297
10299 {
10301 }
10302
10303 override void OnWetChanged(
float newVal,
float oldVal)
10304 {
10307 if (newLevel != oldLevel)
10308 {
10310 }
10311 }
10312
10314 {
10315 SetWeightDirty();
10316 }
10317
10319 {
10320 return GetWetLevelInternal(
m_VarWet);
10321 }
10322
10323
10324
10326 {
10328 }
10329
10331 {
10333 }
10334
10336 {
10338 }
10339
10341 {
10343 }
10344
10345
10346
10348 {
10349 if (ConfigIsExisting("itemModelLength"))
10350 {
10351 return ConfigGetFloat("itemModelLength");
10352 }
10353 return 0;
10354 }
10355
10357 {
10358 if (ConfigIsExisting("itemAttachOffset"))
10359 {
10360 return ConfigGetFloat("itemAttachOffset");
10361 }
10362 return 0;
10363 }
10364
10365 override void SetCleanness(
int value,
bool allow_client =
false)
10366 {
10367 if (!IsServerCheck(allow_client))
10368 return;
10369
10371
10373
10376 }
10377
10379 {
10381 }
10382
10384 {
10385 return true;
10386 }
10387
10388
10389
10390
10392 {
10394 }
10395
10397 {
10399 }
10400
10401
10402
10403
10404 override void SetColor(
int r,
int g,
int b,
int a)
10405 {
10411 }
10413 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10414 {
10419 }
10420
10422 {
10424 }
10425
10428 {
10429 int r,g,b,a;
10431 r = r/255;
10432 g = g/255;
10433 b = b/255;
10434 a = a/255;
10435 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10436 }
10437
10438
10439
10440 override void SetLiquidType(
int value,
bool allow_client =
false)
10441 {
10442 if (!IsServerCheck(allow_client))
10443 return;
10444
10449 }
10450
10452 {
10453 return ConfigGetInt("varLiquidTypeInit");
10454 }
10455
10457 {
10459 }
10460
10462 {
10464 SetFrozen(false);
10465 }
10466
10469 {
10470 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10471 }
10472
10473
10476 {
10477 PlayerBase nplayer;
10478 if (PlayerBase.CastTo(nplayer, player))
10479 {
10481
10482 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10483 }
10484 }
10485
10486
10489 {
10490 PlayerBase nplayer;
10491 if (PlayerBase.CastTo(nplayer,player))
10492 {
10493
10494 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10495
10496 }
10497
10498
10499 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10500
10501
10502 if (HasEnergyManager())
10503 {
10504 GetCompEM().UpdatePlugState();
10505 }
10506 }
10507
10508
10510 {
10511 super.OnPlacementStarted(player);
10512
10514 }
10515
10516 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10517 {
10519 {
10520 m_AdminLog.OnPlacementComplete(player,
this);
10521 }
10522
10523 super.OnPlacementComplete(player, position, orientation);
10524 }
10525
10526
10527
10528
10529
10531 {
10533 {
10534 return true;
10535 }
10536 else
10537 {
10538 return false;
10539 }
10540 }
10541
10542
10544 {
10546 {
10548 }
10549 }
10550
10551
10553 {
10555 }
10556
10558 {
10560 }
10561
10562 override void InsertAgent(
int agent,
float count = 1)
10563 {
10564 if (count < 1)
10565 return;
10566
10568 }
10569
10572 {
10574 }
10575
10576
10578 {
10580 }
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10624 {
10626 return false;
10627 return true;
10628 }
10629
10631 {
10632
10634 }
10635
10636
10639 {
10640 super.CheckForRoofLimited(timeTresholdMS);
10641
10643 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10644 {
10645 m_PreviousRoofTestTime = time;
10646 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10647 }
10648 }
10649
10650
10652 {
10654 {
10655 return 0;
10656 }
10657
10658 if (GetInventory().GetAttachmentSlotsCount() != 0)
10659 {
10660 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10661 if (filter)
10662 return filter.GetProtectionLevel(type, false, system);
10663 else
10664 return 0;
10665 }
10666
10667 string subclassPath, entryName;
10668
10669 switch (type)
10670 {
10672 entryName = "biological";
10673 break;
10675 entryName = "chemical";
10676 break;
10677 default:
10678 entryName = "biological";
10679 break;
10680 }
10681
10682 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10683
10685 }
10686
10687
10688
10691 {
10692 if (!IsMagazine())
10694
10696 }
10697
10698
10699
10700
10701
10706 {
10707 return true;
10708 }
10709
10711 {
10713 }
10714
10715
10716
10717
10718
10720 {
10721 if (parent)
10722 {
10723 if (parent.IsInherited(DayZInfected))
10724 return true;
10725
10726 if (!parent.IsRuined())
10727 return true;
10728 }
10729
10730 return true;
10731 }
10732
10734 {
10735 if (!super.CanPutAsAttachment(parent))
10736 {
10737 return false;
10738 }
10739
10740 if (!IsRuined() && !parent.IsRuined())
10741 {
10742 return true;
10743 }
10744
10745 return false;
10746 }
10747
10749 {
10750
10751
10752
10753
10754 return super.CanReceiveItemIntoCargo(item);
10755 }
10756
10758 {
10759
10760
10761
10762
10763 GameInventory attachmentInv = attachment.GetInventory();
10765 {
10766 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10767 return false;
10768 }
10769
10770 InventoryLocation loc = new InventoryLocation();
10771 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10772 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10773 return false;
10774
10775 return super.CanReceiveAttachment(attachment, slotId);
10776 }
10777
10779 {
10780 if (!super.CanReleaseAttachment(attachment))
10781 return false;
10782
10783 return GetInventory().AreChildrenAccessible();
10784 }
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10807 {
10808 int id = muzzle_owner.GetMuzzleID();
10809 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10810
10811 if (WPOF_array)
10812 {
10813 for (int i = 0; i < WPOF_array.Count(); i++)
10814 {
10815 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10816
10817 if (WPOF)
10818 {
10819 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10820 }
10821 }
10822 }
10823 }
10824
10825
10827 {
10828 int id = muzzle_owner.GetMuzzleID();
10830
10831 if (WPOBE_array)
10832 {
10833 for (int i = 0; i < WPOBE_array.Count(); i++)
10834 {
10835 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10836
10837 if (WPOBE)
10838 {
10839 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10840 }
10841 }
10842 }
10843 }
10844
10845
10847 {
10848 int id = muzzle_owner.GetMuzzleID();
10849 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10850
10851 if (WPOOH_array)
10852 {
10853 for (int i = 0; i < WPOOH_array.Count(); i++)
10854 {
10855 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10856
10857 if (WPOOH)
10858 {
10859 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10860 }
10861 }
10862 }
10863 }
10864
10865
10867 {
10868 int id = muzzle_owner.GetMuzzleID();
10869 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10870
10871 if (WPOOH_array)
10872 {
10873 for (int i = 0; i < WPOOH_array.Count(); i++)
10874 {
10875 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10876
10877 if (WPOOH)
10878 {
10879 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10880 }
10881 }
10882 }
10883 }
10884
10885
10887 {
10888 int id = muzzle_owner.GetMuzzleID();
10889 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10890
10891 if (WPOOH_array)
10892 {
10893 for (int i = 0; i < WPOOH_array.Count(); i++)
10894 {
10895 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10896
10897 if (WPOOH)
10898 {
10899 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10900 }
10901 }
10902 }
10903 }
10904
10905
10906
10908 {
10910 {
10911 return true;
10912 }
10913
10914 return false;
10915 }
10916
10918 {
10920 {
10921 return true;
10922 }
10923
10924 return false;
10925 }
10926
10928 {
10930 {
10931 return true;
10932 }
10933
10934 return false;
10935 }
10936
10938 {
10939 return false;
10940 }
10941
10944 {
10945 return UATimeSpent.DEFAULT_DEPLOY;
10946 }
10947
10948
10949
10950
10952 {
10954 SetSynchDirty();
10955 }
10956
10958 {
10960 }
10961
10962
10964 {
10965 return false;
10966 }
10967
10970 {
10971 string att_type = "None";
10972
10973 if (ConfigIsExisting("soundAttType"))
10974 {
10975 att_type = ConfigGetString("soundAttType");
10976 }
10977
10979 }
10980
10982 {
10984 }
10985
10986
10987
10988
10989
10993
10995 {
10998
11000 }
11001
11002
11004 {
11006 return;
11007
11009
11012
11015
11016 SoundParameters params = new SoundParameters();
11020 }
11021
11022
11024 {
11026 return;
11027
11029 SetSynchDirty();
11030
11033 }
11034
11035
11037 {
11039 return;
11040
11042 SetSynchDirty();
11043
11046 }
11047
11049 {
11051 }
11052
11054 {
11056 }
11057
11060 {
11061 if (!
GetGame().IsDedicatedServer())
11062 {
11063 if (ConfigIsExisting("attachSoundSet"))
11064 {
11065 string cfg_path = "";
11066 string soundset = "";
11067 string type_name =
GetType();
11068
11071 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11072 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11073
11074 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11075 {
11076 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11077 {
11078 if (cfg_slot_array[i] == slot_type)
11079 {
11080 soundset = cfg_soundset_array[i];
11081 break;
11082 }
11083 }
11084 }
11085
11086 if (soundset != "")
11087 {
11088 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11090 }
11091 }
11092 }
11093 }
11094
11096 {
11097
11098 }
11099
11100 void OnApply(PlayerBase player);
11101
11103 {
11104 return 1.0;
11105 };
11106
11108 {
11110 }
11111
11113 {
11115 }
11116
11118
11120 {
11121 SetDynamicPhysicsLifeTime(0.01);
11123 }
11124
11126 {
11127 array<string> zone_names = new array<string>;
11128 GetDamageZones(zone_names);
11129 for (int i = 0; i < zone_names.Count(); i++)
11130 {
11131 SetHealthMax(zone_names.Get(i),"Health");
11132 }
11133 SetHealthMax("","Health");
11134 }
11135
11138 {
11139 float global_health = GetHealth01("","Health");
11140 array<string> zones = new array<string>;
11141 GetDamageZones(zones);
11142
11143 for (int i = 0; i < zones.Count(); i++)
11144 {
11145 SetHealth01(zones.Get(i),"Health",global_health);
11146 }
11147 }
11148
11151 {
11152 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11153 }
11154
11156 {
11157 if (!hasRootAsPlayer)
11158 {
11159 if (refParentIB)
11160 {
11161
11162 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11163 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11164
11165 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11166 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11167
11170 }
11171 else
11172 {
11173
11176 }
11177 }
11178 }
11179
11181 {
11183 {
11184 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11185 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11186 {
11187 float heatPermCoef = 1.0;
11189 while (ent)
11190 {
11191 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11192 ent = ent.GetHierarchyParent();
11193 }
11194
11195 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11196 }
11197 }
11198 }
11199
11201 {
11202
11203 EntityAI parent = GetHierarchyParent();
11204 if (!parent)
11205 {
11206 hasParent = false;
11207 hasRootAsPlayer = false;
11208 }
11209 else
11210 {
11211 hasParent = true;
11212 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11213 refParentIB =
ItemBase.Cast(parent);
11214 }
11215 }
11216
11217 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11218 {
11219
11220 }
11221
11223 {
11224
11225 return false;
11226 }
11227
11229 {
11230
11231
11232 return false;
11233 }
11234
11236 {
11237
11238 return false;
11239 }
11240
11243 {
11244 return !GetIsFrozen() &&
IsOpen();
11245 }
11246
11248 {
11249 bool hasParent = false, hasRootAsPlayer = false;
11251
11252 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11253 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11254
11255 if (wwtu || foodDecay)
11256 {
11260
11261 if (processWetness || processTemperature || processDecay)
11262 {
11264
11265 if (processWetness)
11266 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11267
11268 if (processTemperature)
11270
11271 if (processDecay)
11272 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11273 }
11274 }
11275 }
11276
11279 {
11281 }
11282
11284 {
11287
11288 return super.GetTemperatureFreezeThreshold();
11289 }
11290
11292 {
11295
11296 return super.GetTemperatureThawThreshold();
11297 }
11298
11300 {
11303
11304 return super.GetItemOverheatThreshold();
11305 }
11306
11308 {
11310 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11311
11312 return super.GetTemperatureFreezeTime();
11313 }
11314
11316 {
11318 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11319
11320 return super.GetTemperatureThawTime();
11321 }
11322
11327
11329 {
11330 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11331 }
11332
11334 {
11335 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11336 }
11337
11340 {
11342 }
11343
11345 {
11347 }
11348
11350 {
11352 }
11353
11356 {
11357 return null;
11358 }
11359
11362 {
11363 return false;
11364 }
11365
11367 {
11369 {
11372 if (!trg)
11373 {
11375 explosive = this;
11376 }
11377
11378 explosive.PairRemote(trg);
11380
11381 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11382 trg.SetPersistentPairID(persistentID);
11383 explosive.SetPersistentPairID(persistentID);
11384
11385 return true;
11386 }
11387 return false;
11388 }
11389
11392 {
11393 float ret = 1.0;
11396 ret *= GetHealth01();
11397
11398 return ret;
11399 }
11400
11401 #ifdef DEVELOPER
11402 override void SetDebugItem()
11403 {
11404 super.SetDebugItem();
11405 _itemBase = this;
11406 }
11407
11409 {
11410 string text = super.GetDebugText();
11411
11413 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11414
11415 return text;
11416 }
11417 #endif
11418
11420 {
11421 return true;
11422 }
11423
11425
11427
11429 {
11432 }
11433
11434
11442
11458}
11459
11461{
11463 if (entity)
11464 {
11465 bool is_item = entity.IsInherited(
ItemBase);
11466 if (is_item && full_quantity)
11467 {
11470 }
11471 }
11472 else
11473 {
11475 return NULL;
11476 }
11477 return entity;
11478}
11479
11481{
11482 if (item)
11483 {
11484 if (health > 0)
11485 item.SetHealth("", "", health);
11486
11487 if (item.CanHaveTemperature())
11488 {
11490 if (item.CanFreeze())
11491 item.SetFrozen(false);
11492 }
11493
11494 if (item.HasEnergyManager())
11495 {
11496 if (quantity >= 0)
11497 {
11498 item.GetCompEM().SetEnergy0To1(quantity);
11499 }
11500 else
11501 {
11503 }
11504 }
11505 else if (item.IsMagazine())
11506 {
11507 Magazine mag = Magazine.Cast(item);
11508 if (quantity >= 0)
11509 {
11510 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11511 }
11512 else
11513 {
11515 }
11516
11517 }
11518 else
11519 {
11520 if (quantity >= 0)
11521 {
11522 item.SetQuantityNormalized(quantity, false);
11523 }
11524 else
11525 {
11527 }
11528
11529 }
11530 }
11531}
11532
11533#ifdef DEVELOPER
11535#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.