6743{
6745 {
6746 return true;
6747 }
6748};
6749
6750
6751
6753{
6757
6759
6762
6763
6764
6765
6766
6775
6781
6786
6791
6812 protected bool m_IsResultOfSplit
6813
6815
6820
6821
6822
6824
6828
6829
6830
6832
6835
6836
6837
6843
6844
6852
6855
6856
6858
6859
6861
6862
6867
6868
6873
6874
6876
6877
6879 {
6884
6885 if (!
GetGame().IsDedicatedServer())
6886 {
6888 {
6890
6892 {
6894 }
6895 }
6896
6899 }
6900
6901 m_OldLocation = null;
6902
6904 {
6906 }
6907
6908 if (ConfigIsExisting("headSelectionsToHide"))
6909 {
6912 }
6913
6915 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6916 {
6918 }
6919
6921
6922 m_IsResultOfSplit = false;
6923
6925 }
6926
6928 {
6929 super.InitItemVariables();
6930
6936 m_Count = ConfigGetInt(
"count");
6937
6940
6945
6948
6953
6965
6969
6970
6973 if (ConfigIsExisting("canBeSplit"))
6974 {
6977 }
6978
6980 if (ConfigIsExisting("itemBehaviour"))
6982
6983
6986 RegisterNetSyncVariableInt("m_VarLiquidType");
6987 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6988
6989 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6990 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6991 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6992
6993 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6994 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6995 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6996 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6997
6998 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6999 RegisterNetSyncVariableBool("m_IsTakeable");
7000 RegisterNetSyncVariableBool("m_IsHologram");
7001
7004 {
7007 }
7008
7010
7012 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7014
7015 }
7016
7018 {
7020 }
7021
7023 {
7026 {
7031 }
7032 }
7033
7034 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7035 {
7037 {
7040 }
7041
7043 }
7044
7046 {
7052 }
7053
7055
7057 {
7059
7060 if (!action)
7061 {
7062 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7063 return;
7064 }
7065
7067 if (!ai)
7068 {
7070 return;
7071 }
7072
7074 if (!action_array)
7075 {
7076 action_array = new array<ActionBase_Basic>;
7078 }
7079 if (LogManager.IsActionLogEnable())
7080 {
7081 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7082 }
7083
7084 if (action_array.Find(action) != -1)
7085 {
7086 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7087 }
7088 else
7089 {
7090 action_array.Insert(action);
7091 }
7092 }
7093
7095 {
7097 ActionBase action = player.GetActionManager().GetAction(actionName);
7100
7101 if (action_array)
7102 {
7103 action_array.RemoveItem(action);
7104 }
7105 }
7106
7107
7108
7110 {
7111 ActionOverrideData overrideData = new ActionOverrideData();
7115
7117 if (!actionMap)
7118 {
7121 }
7122
7123 actionMap.Insert(this.
Type(), overrideData);
7124
7125 }
7126
7128
7130
7131
7133 {
7136
7139
7140 string config_to_search = "CfgVehicles";
7141 string muzzle_owner_config;
7142
7144 {
7145 if (IsInherited(Weapon))
7146 config_to_search = "CfgWeapons";
7147
7148 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7149
7150 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7151
7153
7154 if (config_OnFire_subclass_count > 0)
7155 {
7156 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7157
7158 for (int i = 0; i < config_OnFire_subclass_count; i++)
7159 {
7160 string particle_class = "";
7162 string config_OnFire_entry = config_OnFire_class + particle_class;
7163 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7164 WPOF_array.Insert(WPOF);
7165 }
7166
7167
7169 }
7170 }
7171
7173 {
7174 config_to_search = "CfgWeapons";
7175 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7176
7177 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7178
7180
7181 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7182 {
7183 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7184
7185 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7186 {
7187 string particle_class2 = "";
7189 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7190 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7191 WPOBE_array.Insert(WPOBE);
7192 }
7193
7194
7196 }
7197 }
7198 }
7199
7200
7202 {
7205
7207 {
7208 string config_to_search = "CfgVehicles";
7209
7210 if (IsInherited(Weapon))
7211 config_to_search = "CfgWeapons";
7212
7213 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7214 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7215
7216 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7217 {
7218
7220
7222 {
7224 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7226 return;
7227 }
7228
7231
7232
7233
7235 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7236
7237 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7238 {
7239 string particle_class = "";
7241 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7243
7244 if (entry_type == CT_CLASS)
7245 {
7246 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7247 WPOOH_array.Insert(WPOF);
7248 }
7249 }
7250
7251
7253 }
7254 }
7255 }
7256
7258 {
7260 }
7261
7263 {
7265 {
7267
7270
7273
7274 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7275 }
7276 }
7277
7279 {
7281 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7282
7284 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7285
7287 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7288
7290 {
7292 }
7293 }
7294
7296 {
7298 }
7299
7301 {
7304 else
7306
7308 {
7311 }
7312 else
7313 {
7316
7319 }
7320
7322 }
7323
7325 {
7327 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7328 }
7329
7331 {
7333 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7335 }
7336
7338 {
7340 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7341 }
7342
7344 {
7347
7348 OverheatingParticle OP = new OverheatingParticle();
7353
7355 }
7356
7358 {
7361
7362 return -1;
7363 }
7364
7366 {
7368 {
7371
7372 for (int i = count; i > 0; --i)
7373 {
7374 int id = i - 1;
7377
7380
7381 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7382 {
7383 if (p)
7384 {
7387 }
7388 }
7389 }
7390 }
7391 }
7392
7394 {
7396 {
7398 {
7399 int id = i - 1;
7401
7402 if (OP)
7403 {
7405
7406 if (p)
7407 {
7409 }
7410
7411 delete OP;
7412 }
7413 }
7414
7417 }
7418 }
7419
7422 {
7423 return 0.0;
7424 }
7425
7426
7428 {
7429 return 250;
7430 }
7431
7433 {
7434 return 0;
7435 }
7436
7439 {
7441 return true;
7442
7443 return false;
7444 }
7445
7448 {
7451
7453 {
7455 }
7456 else
7457 {
7458
7460 }
7461
7463 }
7464
7471 {
7472 return -1;
7473 }
7474
7475
7476
7477
7479 {
7481 {
7483 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7484
7485 if (r_index >= 0)
7486 {
7487 InventoryLocation r_il = new InventoryLocation;
7488 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7489
7490 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7493 {
7494 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7495 }
7497 {
7498 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7499 }
7500
7501 }
7502
7503 player.GetHumanInventory().ClearUserReservedLocation(this);
7504 }
7505
7508 }
7509
7510
7511
7512
7514 {
7515 return ItemBase.m_DebugActionsMask;
7516 }
7517
7519 {
7520 return ItemBase.m_DebugActionsMask & mask;
7521 }
7522
7524 {
7525 ItemBase.m_DebugActionsMask = mask;
7526 }
7527
7529 {
7530 ItemBase.m_DebugActionsMask |= mask;
7531 }
7532
7534 {
7535 ItemBase.m_DebugActionsMask &= ~mask;
7536 }
7537
7539 {
7541 {
7543 }
7544 else
7545 {
7547 }
7548 }
7549
7550
7552 {
7553 if (GetEconomyProfile())
7554 {
7555 float q_max = GetEconomyProfile().GetQuantityMax();
7556 if (q_max > 0)
7557 {
7558 float q_min = GetEconomyProfile().GetQuantityMin();
7559 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7560
7562 {
7563 ComponentEnergyManager comp = GetCompEM();
7565 {
7567 }
7568 }
7570 {
7572
7573 }
7574
7575 }
7576 }
7577 }
7578
7581 {
7582 EntityAI parent = GetHierarchyParent();
7583
7584 if (parent)
7585 {
7586 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7587 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7588 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7589 }
7590 }
7591
7594 {
7595 EntityAI parent = GetHierarchyParent();
7596
7597 if (parent)
7598 {
7599 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7600 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7601 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7602 }
7603 }
7604
7606 {
7607
7608
7609
7610
7612
7614 {
7615 if (ScriptInputUserData.CanStoreInputUserData())
7616 {
7617 ScriptInputUserData ctx = new ScriptInputUserData;
7623 ctx.
Write(use_stack_max);
7626
7628 {
7629 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7630 }
7631 }
7632 }
7633 else if (!
GetGame().IsMultiplayer())
7634 {
7636 }
7637 }
7638
7640 {
7642 }
7643
7645 {
7647 }
7648
7650 {
7652 }
7653
7655 {
7656
7657 return false;
7658 }
7659
7661 {
7662 return false;
7663 }
7664
7668 {
7669 return false;
7670 }
7671
7673 {
7674 return "";
7675 }
7676
7678
7680 {
7681 return false;
7682 }
7683
7685 {
7686 return true;
7687 }
7688
7689
7690
7692 {
7693 return true;
7694 }
7695
7697 {
7698 return true;
7699 }
7700
7702 {
7703 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7705 }
7706
7708 {
7710 }
7711
7713 {
7715 if (!is_being_placed)
7717 SetSynchDirty();
7718 }
7719
7720
7722
7724 {
7726 }
7727
7729 {
7731 }
7732
7734 {
7735 return 1;
7736 }
7737
7739 {
7740 return false;
7741 }
7742
7744 {
7746 SetSynchDirty();
7747 }
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7784 {
7785 super.OnMovedInsideCargo(container);
7786
7787 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7788 }
7789
7790 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7791 {
7792 super.EEItemLocationChanged(oldLoc,newLoc);
7793
7794 PlayerBase new_player = null;
7795 PlayerBase old_player = null;
7796
7797 if (newLoc.GetParent())
7798 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7799
7800 if (oldLoc.GetParent())
7801 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7802
7804 {
7805 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7806
7807 if (r_index >= 0)
7808 {
7809 InventoryLocation r_il = new InventoryLocation;
7810 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7811
7812 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7815 {
7816 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7817 }
7819 {
7820 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7821 }
7822
7823 }
7824 }
7825
7827 {
7828 if (new_player)
7829 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7830
7831 if (new_player == old_player)
7832 {
7833
7834 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7835 {
7837 {
7838 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7839 {
7840 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7841 }
7842 }
7843 else
7844 {
7845 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7846 }
7847 }
7848
7849 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7850 {
7851 int type = oldLoc.GetType();
7853 {
7854 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7855 }
7857 {
7858 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7859 }
7860 }
7861 if (!m_OldLocation)
7862 {
7863 m_OldLocation = new InventoryLocation;
7864 }
7865 m_OldLocation.Copy(oldLoc);
7866 }
7867 else
7868 {
7869 if (m_OldLocation)
7870 {
7871 m_OldLocation.Reset();
7872 }
7873 }
7874
7876 }
7877 else
7878 {
7879 if (new_player)
7880 {
7881 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7882 if (res_index >= 0)
7883 {
7884 InventoryLocation il = new InventoryLocation;
7885 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7887 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7890 {
7891 il.
GetParent().GetOnReleaseLock().Invoke(it);
7892 }
7894 {
7896 }
7897
7898 }
7899 }
7901 {
7902
7904 }
7905
7906 if (m_OldLocation)
7907 {
7908 m_OldLocation.Reset();
7909 }
7910 }
7911 }
7912
7913 override void EOnContact(IEntity other, Contact extra)
7914 {
7916 {
7917 int liquidType = -1;
7919 if (impactSpeed > 0.0)
7920 {
7922 #ifndef SERVER
7924 #else
7926 SetSynchDirty();
7927 #endif
7929 }
7930 }
7931
7932 #ifdef SERVER
7933 if (GetCompEM() && GetCompEM().IsPlugged())
7934 {
7935 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7936 GetCompEM().UnplugThis();
7937 }
7938 #endif
7939 }
7940
7942
7944 {
7946 }
7947
7949 {
7950
7951 }
7952
7954 {
7955 super.OnItemLocationChanged(old_owner, new_owner);
7956
7957 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7958 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7959
7960 if (!relatedPlayer && playerNew)
7961 relatedPlayer = playerNew;
7962
7963 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7964 {
7966 if (actionMgr)
7967 {
7968 ActionBase currentAction = actionMgr.GetRunningAction();
7969 if (currentAction)
7971 }
7972 }
7973
7974 Man ownerPlayerOld = null;
7975 Man ownerPlayerNew = null;
7976
7977 if (old_owner)
7978 {
7979 if (old_owner.
IsMan())
7980 {
7981 ownerPlayerOld = Man.Cast(old_owner);
7982 }
7983 else
7984 {
7985 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7986 }
7987 }
7988 else
7989 {
7991 {
7993
7994 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7995 {
7996 GetCompEM().UnplugThis();
7997 }
7998 }
7999 }
8000
8001 if (new_owner)
8002 {
8003 if (new_owner.
IsMan())
8004 {
8005 ownerPlayerNew = Man.Cast(new_owner);
8006 }
8007 else
8008 {
8009 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8010 }
8011 }
8012
8013 if (ownerPlayerOld != ownerPlayerNew)
8014 {
8015 if (ownerPlayerOld)
8016 {
8017 array<EntityAI> subItemsExit = new array<EntityAI>;
8019 for (int i = 0; i < subItemsExit.Count(); i++)
8020 {
8023 }
8024 }
8025
8026 if (ownerPlayerNew)
8027 {
8028 array<EntityAI> subItemsEnter = new array<EntityAI>;
8030 for (int j = 0; j < subItemsEnter.Count(); j++)
8031 {
8034 }
8035 }
8036 }
8037 else if (ownerPlayerNew != null)
8038 {
8039 PlayerBase nplayer;
8040 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8041 {
8042 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8044 for (int k = 0; k < subItemsUpdate.Count(); k++)
8045 {
8047 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8048 }
8049 }
8050 }
8051
8052 if (old_owner)
8053 old_owner.OnChildItemRemoved(this);
8054 if (new_owner)
8055 new_owner.OnChildItemReceived(this);
8056 }
8057
8058
8060 {
8061 super.EEDelete(parent);
8062 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8063 if (player)
8064 {
8066
8067 if (player.IsAlive())
8068 {
8069 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8070 if (r_index >= 0)
8071 {
8072 InventoryLocation r_il = new InventoryLocation;
8073 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8074
8075 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8078 {
8079 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8080 }
8082 {
8083 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8084 }
8085
8086 }
8087
8088 player.RemoveQuickBarEntityShortcut(this);
8089 }
8090 }
8091 }
8092
8094 {
8095 super.EEKilled(killer);
8096
8099 {
8100 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8101 {
8102 if (IsMagazine())
8103 {
8104 if (Magazine.Cast(this).GetAmmoCount() > 0)
8105 {
8107 }
8108 }
8109 else
8110 {
8112 }
8113 }
8114 }
8115 }
8116
8118 {
8119 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8120
8121 super.OnWasAttached(parent, slot_id);
8122
8125
8127 }
8128
8130 {
8131 super.OnWasDetached(parent, slot_id);
8132
8135 }
8136
8138 {
8139 int idx;
8142
8143 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8144 if (inventory_slots.Count() < 1)
8145 {
8146 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8147 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8148 }
8149 else
8150 {
8151 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8152 }
8153
8154 idx = inventory_slots.Find(slot);
8155 if (idx < 0)
8156 return "";
8157
8158 return attach_types.Get(idx);
8159 }
8160
8162 {
8163 int idx = -1;
8164 string slot;
8165
8168
8169 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8170 if (inventory_slots.Count() < 1)
8171 {
8172 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8173 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8174 }
8175 else
8176 {
8177 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8178 if (detach_types.Count() < 1)
8179 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8180 }
8181
8182 for (int i = 0; i < inventory_slots.Count(); i++)
8183 {
8184 slot = inventory_slots.Get(i);
8185 }
8186
8187 if (slot != "")
8188 {
8189 if (detach_types.Count() == 1)
8190 idx = 0;
8191 else
8192 idx = inventory_slots.Find(slot);
8193 }
8194 if (idx < 0)
8195 return "";
8196
8197 return detach_types.Get(idx);
8198 }
8199
8201 {
8202
8204
8205
8206 float min_time = 1;
8207 float max_time = 3;
8208 float delay = Math.RandomFloat(min_time, max_time);
8209
8210 explode_timer.Run(delay, this, "DoAmmoExplosion");
8211 }
8212
8214 {
8215 Magazine magazine = Magazine.Cast(this);
8216 int pop_sounds_count = 6;
8217 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8218
8219
8220 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8221 string sound_name = pop_sounds[ sound_idx ];
8223
8224
8225 magazine.ServerAddAmmoCount(-1);
8226
8227
8228 float min_temp_to_explode = 100;
8229
8230 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8231 {
8233 }
8234 }
8235
8236
8237 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8238 {
8239 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8240
8241 const int CHANCE_DAMAGE_CARGO = 4;
8242 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8243 const int CHANCE_DAMAGE_NOTHING = 2;
8244
8246 {
8247 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8248 int chances;
8249 int rnd;
8250
8251 if (GetInventory().GetCargo())
8252 {
8253 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8254 rnd = Math.RandomInt(0,chances);
8255
8256 if (rnd < CHANCE_DAMAGE_CARGO)
8257 {
8259 }
8260 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8261 {
8263 }
8264 }
8265 else
8266 {
8267 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8268 rnd = Math.RandomInt(0,chances);
8269
8270 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8271 {
8273 }
8274 }
8275 }
8276 }
8277
8279 {
8280 if (GetInventory().GetCargo())
8281 {
8282 int item_count = GetInventory().GetCargo().GetItemCount();
8283 if (item_count > 0)
8284 {
8285 int random_pick = Math.RandomInt(0, item_count);
8287 if (!item.IsExplosive())
8288 {
8289 item.AddHealth("","",damage);
8290 return true;
8291 }
8292 }
8293 }
8294 return false;
8295 }
8296
8298 {
8299 int attachment_count = GetInventory().AttachmentCount();
8300 if (attachment_count > 0)
8301 {
8302 int random_pick = Math.RandomInt(0, attachment_count);
8303 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8304 if (!attachment.IsExplosive())
8305 {
8306 attachment.AddHealth("","",damage);
8307 return true;
8308 }
8309 }
8310 return false;
8311 }
8312
8314 {
8316 }
8317
8319 {
8321 return GetInventory().CanRemoveEntity();
8322
8323 return false;
8324 }
8325
8327 {
8329 return;
8330
8332 {
8333 if (ScriptInputUserData.CanStoreInputUserData())
8334 {
8335 ScriptInputUserData ctx = new ScriptInputUserData;
8340 ctx.
Write(destination_entity);
8344 }
8345 }
8346 else if (!
GetGame().IsMultiplayer())
8347 {
8349 }
8350 }
8351
8353 {
8355 return;
8356
8357 float split_quantity_new;
8361 InventoryLocation loc = new InventoryLocation;
8362
8363 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8364 {
8366 split_quantity_new = stack_max;
8367 else
8369
8370 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8371 if (new_item)
8372 {
8373 new_item.SetResultOfSplit(true);
8374 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8376 new_item.SetQuantity(split_quantity_new);
8377 }
8378 }
8379 else if (destination_entity && slot_id == -1)
8380 {
8381 if (quantity > stack_max)
8382 split_quantity_new = stack_max;
8383 else
8384 split_quantity_new = quantity;
8385
8387 {
8390 }
8391
8392 if (new_item)
8393 {
8394 new_item.SetResultOfSplit(true);
8395 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8397 new_item.SetQuantity(split_quantity_new);
8398 }
8399 }
8400 else
8401 {
8402 if (stack_max != 0)
8403 {
8405 {
8407 }
8408
8409 if (split_quantity_new == 0)
8410 {
8411 if (!
GetGame().IsMultiplayer())
8412 player.PhysicalPredictiveDropItem(this);
8413 else
8414 player.ServerDropEntity(this);
8415 return;
8416 }
8417
8419
8420 if (new_item)
8421 {
8422 new_item.SetResultOfSplit(true);
8423 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8425 new_item.SetQuantity(stack_max);
8426 new_item.PlaceOnSurface();
8427 }
8428 }
8429 }
8430 }
8431
8433 {
8435 return;
8436
8437 float split_quantity_new;
8441 InventoryLocation loc = new InventoryLocation;
8442
8443 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8444 {
8446 split_quantity_new = stack_max;
8447 else
8449
8450 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8451 if (new_item)
8452 {
8453 new_item.SetResultOfSplit(true);
8454 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8456 new_item.SetQuantity(split_quantity_new);
8457 }
8458 }
8459 else if (destination_entity && slot_id == -1)
8460 {
8461 if (quantity > stack_max)
8462 split_quantity_new = stack_max;
8463 else
8464 split_quantity_new = quantity;
8465
8467 {
8470 }
8471
8472 if (new_item)
8473 {
8474 new_item.SetResultOfSplit(true);
8475 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8477 new_item.SetQuantity(split_quantity_new);
8478 }
8479 }
8480 else
8481 {
8482 if (stack_max != 0)
8483 {
8485 {
8487 }
8488
8490
8491 if (new_item)
8492 {
8493 new_item.SetResultOfSplit(true);
8494 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8496 new_item.SetQuantity(stack_max);
8497 new_item.PlaceOnSurface();
8498 }
8499 }
8500 }
8501 }
8502
8504 {
8506 return;
8507
8509 {
8510 if (ScriptInputUserData.CanStoreInputUserData())
8511 {
8512 ScriptInputUserData ctx = new ScriptInputUserData;
8517 dst.WriteToContext(ctx);
8519 }
8520 }
8521 else if (!
GetGame().IsMultiplayer())
8522 {
8524 }
8525 }
8526
8528 {
8530 return;
8531
8533 {
8534 if (ScriptInputUserData.CanStoreInputUserData())
8535 {
8536 ScriptInputUserData ctx = new ScriptInputUserData;
8541 ctx.
Write(destination_entity);
8547 }
8548 }
8549 else if (!
GetGame().IsMultiplayer())
8550 {
8552 }
8553 }
8554
8556 {
8558 }
8559
8561 {
8563 return this;
8564
8566 float split_quantity_new;
8568 if (dst.IsValid())
8569 {
8570 int slot_id = dst.GetSlot();
8572
8573 if (quantity > stack_max)
8574 split_quantity_new = stack_max;
8575 else
8576 split_quantity_new = quantity;
8577
8579
8580 if (new_item)
8581 {
8582 new_item.SetResultOfSplit(true);
8583 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8586 }
8587
8588 return new_item;
8589 }
8590
8591 return null;
8592 }
8593
8595 {
8597 return;
8598
8600 float split_quantity_new;
8602 if (destination_entity)
8603 {
8605 if (quantity > stackable)
8606 split_quantity_new = stackable;
8607 else
8608 split_quantity_new = quantity;
8609
8610 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8611 if (new_item)
8612 {
8613 new_item.SetResultOfSplit(true);
8614 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8616 new_item.SetQuantity(split_quantity_new);
8617 }
8618 }
8619 }
8620
8622 {
8624 return;
8625
8627 {
8628 if (ScriptInputUserData.CanStoreInputUserData())
8629 {
8630 ScriptInputUserData ctx = new ScriptInputUserData;
8635 ItemBase destination_entity =
this;
8636 ctx.
Write(destination_entity);
8640 }
8641 }
8642 else if (!
GetGame().IsMultiplayer())
8643 {
8645 }
8646 }
8647
8649 {
8651 return;
8652
8654 float split_quantity_new;
8656 if (player)
8657 {
8659 if (quantity > stackable)
8660 split_quantity_new = stackable;
8661 else
8662 split_quantity_new = quantity;
8663
8664 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8665 new_item =
ItemBase.Cast(in_hands);
8666 if (new_item)
8667 {
8668 new_item.SetResultOfSplit(true);
8669 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8671 new_item.SetQuantity(split_quantity_new);
8672 }
8673 }
8674 }
8675
8677 {
8679 return;
8680
8682 float split_quantity_new = Math.Floor(quantity * 0.5);
8683
8685
8686 if (new_item)
8687 {
8688 if (new_item.GetQuantityMax() < split_quantity_new)
8689 {
8690 split_quantity_new = new_item.GetQuantityMax();
8691 }
8692
8693 new_item.SetResultOfSplit(true);
8694 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8695
8697 {
8700 }
8701 else
8702 {
8705 }
8706 }
8707 }
8708
8710 {
8712 return;
8713
8715 float split_quantity_new = Math.Floor(quantity / 2);
8716
8717 InventoryLocation invloc = new InventoryLocation;
8719
8721 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8722
8723 if (new_item)
8724 {
8725 if (new_item.GetQuantityMax() < split_quantity_new)
8726 {
8727 split_quantity_new = new_item.GetQuantityMax();
8728 }
8730 {
8733 }
8734 else
8735 {
8738 }
8739 }
8740 }
8741
8744 {
8745 SetWeightDirty();
8747
8748 if (parent)
8749 parent.OnAttachmentQuantityChangedEx(this, delta);
8750
8752 {
8754 {
8756 }
8758 {
8759 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8761 }
8762 }
8763
8764 }
8765
8768 {
8769
8770 }
8771
8774 {
8776 }
8777
8779 {
8780 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8781
8783 {
8784 if (newLevel == GameConstants.STATE_RUINED)
8785 {
8787 EntityAI parent = GetHierarchyParent();
8788 if (parent && parent.IsFireplace())
8789 {
8790 CargoBase cargo = GetInventory().GetCargo();
8791 if (cargo)
8792 {
8794 {
8796 }
8797 }
8798 }
8799 }
8800
8802 {
8803
8805 return;
8806 }
8807
8808 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8809 {
8811 }
8812 }
8813 }
8814
8815
8817 {
8818 super.OnRightClick();
8819
8821 {
8823 {
8824 if (ScriptInputUserData.CanStoreInputUserData())
8825 {
8826 vector m4[4];
8828
8829 EntityAI root = GetHierarchyRoot();
8830
8831 InventoryLocation dst = new InventoryLocation;
8833 {
8834 if (root)
8835 {
8836 root.GetTransform(m4);
8838 }
8839 else
8840 GetInventory().GetCurrentInventoryLocation(dst);
8841 }
8842 else
8843 {
8845
8846
8847 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8848 {
8849 if (root)
8850 {
8851 root.GetTransform(m4);
8853 }
8854 else
8855 GetInventory().GetCurrentInventoryLocation(dst);
8856 }
8857 else
8858 {
8859 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8860 }
8861 }
8862
8863 ScriptInputUserData ctx = new ScriptInputUserData;
8871 }
8872 }
8873 else if (!
GetGame().IsMultiplayer())
8874 {
8876 }
8877 }
8878 }
8879
8880 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8881 {
8882
8883 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8884 return false;
8885
8886 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8887 return false;
8888
8889
8891 return false;
8892
8893
8894 Magazine mag = Magazine.Cast(this);
8895 if (mag)
8896 {
8897 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8898 return false;
8899
8900 if (stack_max_limit)
8901 {
8902 Magazine other_mag = Magazine.Cast(other_item);
8903 if (other_item)
8904 {
8905 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8906 return false;
8907 }
8908
8909 }
8910 }
8911 else
8912 {
8913
8915 return false;
8916
8918 return false;
8919 }
8920
8921 PlayerBase player = null;
8922 if (CastTo(player, GetHierarchyRootPlayer()))
8923 {
8924 if (player.GetInventory().HasAttachment(this))
8925 return false;
8926
8927 if (player.IsItemsToDelete())
8928 return false;
8929 }
8930
8931 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8932 return false;
8933
8934 int slotID;
8936 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8937 return false;
8938
8939 return true;
8940 }
8941
8943 {
8945 }
8946
8948 {
8949 return m_IsResultOfSplit;
8950 }
8951
8953 {
8954 m_IsResultOfSplit = value;
8955 }
8956
8958 {
8960 }
8961
8963 {
8964 float other_item_quantity = other_item.GetQuantity();
8965 float this_free_space;
8966
8968
8970
8971 if (other_item_quantity > this_free_space)
8972 {
8973 return this_free_space;
8974 }
8975 else
8976 {
8977 return other_item_quantity;
8978 }
8979 }
8980
8982 {
8984 }
8985
8987 {
8989 return;
8990
8991 if (!IsMagazine() && other_item)
8992 {
8994 if (quantity_used != 0)
8995 {
8996 float hp1 = GetHealth01("","");
8997 float hp2 = other_item.GetHealth01("","");
8998 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8999 hpResult = hpResult / (
GetQuantity() + quantity_used);
9000
9001 hpResult *= GetMaxHealth();
9002 Math.Round(hpResult);
9003 SetHealth("", "Health", hpResult);
9004
9006 other_item.AddQuantity(-quantity_used);
9007 }
9008 }
9010 }
9011
9013 {
9014 #ifdef SERVER
9015 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9016 GetHierarchyParent().IncreaseLifetimeUp();
9017 #endif
9018 };
9019
9021 {
9022 PlayerBase p = PlayerBase.Cast(player);
9023
9024 array<int> recipesIds = p.m_Recipes;
9025 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9026 if (moduleRecipesManager)
9027 {
9028 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9029 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9030 }
9031
9032 for (int i = 0;i < recipesIds.Count(); i++)
9033 {
9034 int key = recipesIds.Get(i);
9035 string recipeName = moduleRecipesManager.GetRecipeName(key);
9037 }
9038 }
9039
9040
9041 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9042 {
9043 super.GetDebugActions(outputList);
9044
9045
9050
9051
9055
9059
9060
9063
9064
9066 {
9069 }
9070
9072
9075
9079 }
9080
9081
9082
9083
9085 {
9086 super.OnAction(action_id, player, ctx);
9087 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9088 {
9089 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9090 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9091 PlayerBase p = PlayerBase.Cast(player);
9092 if (
EActions.RECIPES_RANGE_START < 1000)
9093 {
9094 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9095 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9096 }
9097 }
9098 #ifndef SERVER
9099 else if (action_id ==
EActions.WATCH_PLAYER)
9100 {
9101 PluginDeveloper.SetDeveloperItemClientEx(player);
9102 }
9103 #endif
9105 {
9106 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9107 {
9108 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9109 OnDebugButtonPressServer(id + 1);
9110 }
9111
9112 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9113 {
9114 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9116 }
9117
9118 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9119 {
9120 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9122 }
9123
9124 else if (action_id ==
EActions.ADD_QUANTITY)
9125 {
9126 if (IsMagazine())
9127 {
9128 Magazine mag = Magazine.Cast(this);
9129 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9130 }
9131 else
9132 {
9134 }
9135
9136 if (m_EM)
9137 {
9138 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9139 }
9140
9141 }
9142
9143 else if (action_id ==
EActions.REMOVE_QUANTITY)
9144 {
9145 if (IsMagazine())
9146 {
9147 Magazine mag2 = Magazine.Cast(this);
9148 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9149 }
9150 else
9151 {
9153 }
9154 if (m_EM)
9155 {
9156 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9157 }
9158
9159 }
9160
9161 else if (action_id ==
EActions.SET_QUANTITY_0)
9162 {
9164
9165 if (m_EM)
9166 {
9167 m_EM.SetEnergy(0);
9168 }
9169 }
9170
9171 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9172 {
9174
9175 if (m_EM)
9176 {
9177 m_EM.SetEnergy(m_EM.GetEnergyMax());
9178 }
9179 }
9180
9181 else if (action_id ==
EActions.ADD_HEALTH)
9182 {
9183 AddHealth("","",GetMaxHealth("","Health")/5);
9184 }
9185 else if (action_id ==
EActions.REMOVE_HEALTH)
9186 {
9187 AddHealth("","",-GetMaxHealth("","Health")/5);
9188 }
9189 else if (action_id ==
EActions.DESTROY_HEALTH)
9190 {
9191 SetHealth01("","",0);
9192 }
9193 else if (action_id ==
EActions.WATCH_ITEM)
9194 {
9196 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9197 #ifdef DEVELOPER
9198 SetDebugDeveloper_item(this);
9199 #endif
9200 }
9201
9202 else if (action_id ==
EActions.ADD_TEMPERATURE)
9203 {
9204 AddTemperature(20);
9205
9206 }
9207
9208 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9209 {
9210 AddTemperature(-20);
9211
9212 }
9213
9214 else if (action_id ==
EActions.FLIP_FROZEN)
9215 {
9216 SetFrozen(!GetIsFrozen());
9217
9218 }
9219
9220 else if (action_id ==
EActions.ADD_WETNESS)
9221 {
9223
9224 }
9225
9226 else if (action_id ==
EActions.REMOVE_WETNESS)
9227 {
9229
9230 }
9231
9232 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9233 {
9236
9237
9238 }
9239
9240 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9241 {
9244 }
9245
9246 else if (action_id ==
EActions.MAKE_SPECIAL)
9247 {
9248 auto debugParams = DebugSpawnParams.WithPlayer(player);
9249 OnDebugSpawnEx(debugParams);
9250 }
9251
9252 else if (action_id ==
EActions.DELETE)
9253 {
9254 Delete();
9255 }
9256
9257 }
9258
9259
9260 return false;
9261 }
9262
9263
9264
9265
9269
9272
9273
9274
9276 {
9277 return false;
9278 }
9279
9280
9282 {
9283 return true;
9284 }
9285
9286
9288 {
9289 return true;
9290 }
9291
9292
9293
9295 {
9296 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9298 }
9299
9302 {
9303 return null;
9304 }
9305
9307 {
9308 return false;
9309 }
9310
9312 {
9313 return false;
9314 }
9315
9319
9320
9322 {
9323 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9324 return module_repairing.CanRepair(this, item_repair_kit);
9325 }
9326
9327
9328 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9329 {
9330 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9331 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9332 }
9333
9334
9336 {
9337
9338
9339
9340
9341
9342
9343
9344
9345 return 1;
9346 }
9347
9348
9349
9351 {
9353 }
9354
9355
9356
9358 {
9360 }
9361
9362
9371 {
9372 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9373
9374 if (player)
9375 {
9376 player.MessageStatus(text);
9377 }
9378 }
9379
9380
9389 {
9390 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9391
9392 if (player)
9393 {
9394 player.MessageAction(text);
9395 }
9396 }
9397
9398
9407 {
9408 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9409
9410 if (player)
9411 {
9412 player.MessageFriendly(text);
9413 }
9414 }
9415
9416
9425 {
9426 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9427
9428 if (player)
9429 {
9430 player.MessageImportant(text);
9431 }
9432 }
9433
9435 {
9436 return true;
9437 }
9438
9439
9440 override bool KindOf(
string tag)
9441 {
9442 bool found = false;
9443 string item_name = this.
GetType();
9446
9447 int array_size = item_tag_array.Count();
9448 for (int i = 0; i < array_size; i++)
9449 {
9450 if (item_tag_array.Get(i) == tag)
9451 {
9452 found = true;
9453 break;
9454 }
9455 }
9456 return found;
9457 }
9458
9459
9461 {
9462
9463 super.OnRPC(sender, rpc_type,ctx);
9464
9465
9466 switch (rpc_type)
9467 {
9468 #ifndef SERVER
9469 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9470 Param2<bool, string> p = new Param2<bool, string>(false, "");
9471
9473 return;
9474
9475 bool play = p.param1;
9476 string soundSet = p.param2;
9477
9478 if (play)
9479 {
9481 {
9483 {
9485 }
9486 }
9487 else
9488 {
9490 }
9491 }
9492 else
9493 {
9495 }
9496
9497 break;
9498 #endif
9499
9500 }
9501
9503 {
9505 }
9506 }
9507
9508
9509
9510
9512 {
9513 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9514 return plugin.GetID(
name);
9515 }
9516
9518 {
9519 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9520 return plugin.GetName(id);
9521 }
9522
9525 {
9526
9527
9528 int varFlags;
9529 if (!ctx.
Read(varFlags))
9530 return;
9531
9532 if (varFlags & ItemVariableFlags.FLOAT)
9533 {
9535 }
9536 }
9537
9539 {
9540
9541 super.SerializeNumericalVars(floats_out);
9542
9543
9544
9546 {
9548 }
9549
9551 {
9553 }
9554
9556 {
9558 }
9559
9561 {
9566 }
9567
9569 {
9571 }
9572 }
9573
9575 {
9576
9577 super.DeSerializeNumericalVars(floats);
9578
9579
9580 int index = 0;
9581 int mask = Math.Round(floats.Get(index));
9582
9583 index++;
9584
9586 {
9588 {
9590 }
9591 else
9592 {
9593 float quantity = floats.Get(index);
9595 }
9596 index++;
9597 }
9598
9600 {
9601 float wet = floats.Get(index);
9603 index++;
9604 }
9605
9607 {
9608 int liquidtype = Math.Round(floats.Get(index));
9610 index++;
9611 }
9612
9614 {
9616 index++;
9618 index++;
9620 index++;
9622 index++;
9623 }
9624
9626 {
9627 int cleanness = Math.Round(floats.Get(index));
9629 index++;
9630 }
9631 }
9632
9634 {
9635 super.WriteVarsToCTX(ctx);
9636
9637
9639 {
9641 }
9642
9644 {
9646 }
9647
9649 {
9651 }
9652
9654 {
9655 int r,g,b,a;
9661 }
9662
9664 {
9666 }
9667 }
9668
9670 {
9671 if (!super.ReadVarsFromCTX(ctx,version))
9672 return false;
9673
9674 int intValue;
9675 float value;
9676
9677 if (version < 140)
9678 {
9679 if (!ctx.
Read(intValue))
9680 return false;
9681
9682 m_VariablesMask = intValue;
9683 }
9684
9686 {
9687 if (!ctx.
Read(value))
9688 return false;
9689
9691 {
9693 }
9694 else
9695 {
9697 }
9698 }
9699
9700 if (version < 140)
9701 {
9703 {
9704 if (!ctx.
Read(value))
9705 return false;
9706 SetTemperatureDirect(value);
9707 }
9708 }
9709
9711 {
9712 if (!ctx.
Read(value))
9713 return false;
9715 }
9716
9718 {
9719 if (!ctx.
Read(intValue))
9720 return false;
9722 }
9723
9725 {
9726 int r,g,b,a;
9728 return false;
9730 return false;
9732 return false;
9734 return false;
9735
9737 }
9738
9740 {
9741 if (!ctx.
Read(intValue))
9742 return false;
9744 }
9745
9746 if (version >= 138 && version < 140)
9747 {
9749 {
9750 if (!ctx.
Read(intValue))
9751 return false;
9752 SetFrozen(intValue);
9753 }
9754 }
9755
9756 return true;
9757 }
9758
9759
9761 {
9764 {
9766 }
9767
9768 if (!super.OnStoreLoad(ctx, version))
9769 {
9771 return false;
9772 }
9773
9774 if (version >= 114)
9775 {
9776 bool hasQuickBarIndexSaved;
9777
9778 if (!ctx.
Read(hasQuickBarIndexSaved))
9779 {
9781 return false;
9782 }
9783
9784 if (hasQuickBarIndexSaved)
9785 {
9786 int itmQBIndex;
9787
9788
9789 if (!ctx.
Read(itmQBIndex))
9790 {
9792 return false;
9793 }
9794
9795 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9796 if (itmQBIndex != -1 && parentPlayer)
9797 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9798 }
9799 }
9800 else
9801 {
9802
9803 PlayerBase player;
9804 int itemQBIndex;
9805 if (version ==
int.
MAX)
9806 {
9807 if (!ctx.
Read(itemQBIndex))
9808 {
9810 return false;
9811 }
9812 }
9813 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9814 {
9815
9816 if (!ctx.
Read(itemQBIndex))
9817 {
9819 return false;
9820 }
9821 if (itemQBIndex != -1 && player)
9822 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9823 }
9824 }
9825
9826 if (version < 140)
9827 {
9828
9829 if (!LoadVariables(ctx, version))
9830 {
9832 return false;
9833 }
9834 }
9835
9836
9838 {
9840 return false;
9841 }
9842 if (version >= 132)
9843 {
9845 if (raib)
9846 {
9848 {
9850 return false;
9851 }
9852 }
9853 }
9854
9856 return true;
9857 }
9858
9859
9860
9862 {
9863 super.OnStoreSave(ctx);
9864
9865 PlayerBase player;
9866 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9867 {
9869
9870 int itemQBIndex = -1;
9871 itemQBIndex = player.FindQuickBarEntityIndex(this);
9872 ctx.
Write(itemQBIndex);
9873 }
9874 else
9875 {
9877 }
9878
9880
9882 if (raib)
9883 {
9885 }
9886 }
9887
9888
9890 {
9891 super.AfterStoreLoad();
9892
9894 {
9896 }
9897
9899 {
9902 }
9903 }
9904
9906 {
9907 super.EEOnAfterLoad();
9908
9910 {
9912 }
9913
9916 }
9917
9919 {
9920 return false;
9921 }
9922
9923
9924
9926 {
9928 {
9929 #ifdef PLATFORM_CONSOLE
9930
9932 {
9934 if (menu)
9935 {
9937 }
9938 }
9939 #endif
9940 }
9941
9943 {
9946 }
9947
9949 {
9950 SetWeightDirty();
9952 }
9954 {
9957 }
9958
9960 {
9963 }
9965 {
9968 }
9969
9970 super.OnVariablesSynchronized();
9971 }
9972
9973
9974
9976 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9977 {
9978 if (!IsServerCheck(allow_client))
9979 return false;
9980
9982 return false;
9983
9986
9987 if (value <= (min + 0.001))
9988 value = min;
9989
9990 if (value == min)
9991 {
9992 if (destroy_config)
9993 {
9994 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9995 if (dstr)
9996 {
9998 this.Delete();
9999 return true;
10000 }
10001 }
10002 else if (destroy_forced)
10003 {
10005 this.Delete();
10006 return true;
10007 }
10008
10010 }
10011
10014
10016 {
10018
10019 if (delta)
10021 }
10022
10024
10025 return false;
10026 }
10027
10028
10030 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10031 {
10033 }
10034
10036 {
10039 }
10040
10042 {
10045 }
10046
10049 {
10050 float value_clamped = Math.Clamp(value, 0, 1);
10052 SetQuantity(result, destroy_config, destroy_forced);
10053 }
10054
10055
10058 {
10060 }
10061
10063 {
10065 }
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10077 {
10078 int slot = -1;
10079 if (GetInventory())
10080 {
10081 InventoryLocation il = new InventoryLocation;
10082 GetInventory().GetCurrentInventoryLocation(il);
10084 }
10085
10087 }
10088
10090 {
10091 float quantity_max = 0;
10092
10094 {
10095 if (attSlotID != -1)
10096 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10097
10098 if (quantity_max <= 0)
10100 }
10101
10102 if (quantity_max <= 0)
10104
10105 return quantity_max;
10106 }
10107
10109 {
10111 }
10112
10114 {
10116 }
10117
10118
10120 {
10122 }
10123
10125 {
10127 }
10128
10130 {
10132 }
10133
10134
10136 {
10137
10138 float weightEx = GetWeightEx();
10139 float special = GetInventoryAndCargoWeight();
10140 return weightEx - special;
10141 }
10142
10143
10145 {
10147 }
10148
10150 {
10152 {
10153 #ifdef DEVELOPER
10154 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10155 {
10156 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10158 }
10159 #endif
10160
10161 return GetQuantity() * GetConfigWeightModified();
10162 }
10163 else if (HasEnergyManager())
10164 {
10165 #ifdef DEVELOPER
10166 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10167 {
10168 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10169 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10170 }
10171 #endif
10172 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10173 }
10174 else
10175 {
10176 #ifdef DEVELOPER
10177 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10178 {
10179 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10180 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10181 }
10182 #endif
10183 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10184 }
10185 }
10186
10189 {
10190 int item_count = 0;
10192
10193 if (GetInventory().GetCargo() != NULL)
10194 {
10195 item_count = GetInventory().GetCargo().GetItemCount();
10196 }
10197
10198 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10199 {
10200 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10201 if (item)
10202 item_count += item.GetNumberOfItems();
10203 }
10204 return item_count;
10205 }
10206
10209 {
10210 float weight = 0;
10211 float wetness = 1;
10212 if (include_wetness)
10215 {
10216 weight = wetness * m_ConfigWeight;
10217 }
10219 {
10220 weight = 1;
10221 }
10222 return weight;
10223 }
10224
10225
10226
10228 {
10229 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10230 {
10231 GameInventory inv = GetInventory();
10232 array<EntityAI> items = new array<EntityAI>;
10234 for (int i = 0; i < items.Count(); i++)
10235 {
10237 if (item)
10238 {
10240 }
10241 }
10242 }
10243 }
10244
10245
10246
10247
10249 {
10250 float energy = 0;
10251 if (HasEnergyManager())
10252 {
10253 energy = GetCompEM().GetEnergy();
10254 }
10255 return energy;
10256 }
10257
10258
10260 {
10261 super.OnEnergyConsumed();
10262
10264 }
10265
10267 {
10268 super.OnEnergyAdded();
10269
10271 }
10272
10273
10275 {
10276 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10277 {
10279 {
10280 float energy_0to1 = GetCompEM().GetEnergy0To1();
10282 }
10283 }
10284 }
10285
10286
10288 {
10289 return ConfigGetFloat("heatIsolation");
10290 }
10291
10293 {
10295 }
10296
10298 {
10299 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10300 if (
GetGame().ConfigIsExisting(paramPath))
10302
10303 return 0.0;
10304 }
10305
10307 {
10308 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10309 if (
GetGame().ConfigIsExisting(paramPath))
10311
10312 return 0.0;
10313 }
10314
10315 override void SetWet(
float value,
bool allow_client =
false)
10316 {
10317 if (!IsServerCheck(allow_client))
10318 return;
10319
10322
10324
10325 m_VarWet = Math.Clamp(value, min, max);
10326
10328 {
10331 }
10332 }
10333
10334 override void AddWet(
float value)
10335 {
10337 }
10338
10340 {
10342 }
10343
10345 {
10347 }
10348
10350 {
10352 }
10353
10355 {
10357 }
10358
10360 {
10362 }
10363
10364 override void OnWetChanged(
float newVal,
float oldVal)
10365 {
10368 if (newLevel != oldLevel)
10369 {
10371 }
10372 }
10373
10375 {
10376 SetWeightDirty();
10377 }
10378
10380 {
10381 return GetWetLevelInternal(
m_VarWet);
10382 }
10383
10384
10385
10387 {
10389 }
10390
10392 {
10394 }
10395
10397 {
10399 }
10400
10402 {
10404 }
10405
10406
10407
10409 {
10410 if (ConfigIsExisting("itemModelLength"))
10411 {
10412 return ConfigGetFloat("itemModelLength");
10413 }
10414 return 0;
10415 }
10416
10418 {
10419 if (ConfigIsExisting("itemAttachOffset"))
10420 {
10421 return ConfigGetFloat("itemAttachOffset");
10422 }
10423 return 0;
10424 }
10425
10426 override void SetCleanness(
int value,
bool allow_client =
false)
10427 {
10428 if (!IsServerCheck(allow_client))
10429 return;
10430
10432
10434
10437 }
10438
10440 {
10442 }
10443
10445 {
10446 return true;
10447 }
10448
10449
10450
10451
10453 {
10455 }
10456
10458 {
10460 }
10461
10462
10463
10464
10465 override void SetColor(
int r,
int g,
int b,
int a)
10466 {
10472 }
10474 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10475 {
10480 }
10481
10483 {
10485 }
10486
10489 {
10490 int r,g,b,a;
10492 r = r/255;
10493 g = g/255;
10494 b = b/255;
10495 a = a/255;
10496 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10497 }
10498
10499
10500
10501 override void SetLiquidType(
int value,
bool allow_client =
false)
10502 {
10503 if (!IsServerCheck(allow_client))
10504 return;
10505
10510 }
10511
10513 {
10514 return ConfigGetInt("varLiquidTypeInit");
10515 }
10516
10518 {
10520 }
10521
10523 {
10525 SetFrozen(false);
10526 }
10527
10530 {
10531 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10532 }
10533
10534
10537 {
10538 PlayerBase nplayer;
10539 if (PlayerBase.CastTo(nplayer, player))
10540 {
10542
10543 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10544 }
10545 }
10546
10547
10550 {
10551 PlayerBase nplayer;
10552 if (PlayerBase.CastTo(nplayer,player))
10553 {
10554
10555 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10556
10557 }
10558
10559
10560 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10561
10562
10563 if (HasEnergyManager())
10564 {
10565 GetCompEM().UpdatePlugState();
10566 }
10567 }
10568
10569
10571 {
10572 super.OnPlacementStarted(player);
10573
10575 }
10576
10577 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10578 {
10580 {
10581 m_AdminLog.OnPlacementComplete(player,
this);
10582 }
10583
10584 super.OnPlacementComplete(player, position, orientation);
10585 }
10586
10587
10588
10589
10590
10592 {
10594 {
10595 return true;
10596 }
10597 else
10598 {
10599 return false;
10600 }
10601 }
10602
10603
10605 {
10607 {
10609 }
10610 }
10611
10612
10614 {
10616 }
10617
10619 {
10621 }
10622
10623 override void InsertAgent(
int agent,
float count = 1)
10624 {
10625 if (count < 1)
10626 return;
10627
10629 }
10630
10633 {
10635 }
10636
10637
10639 {
10641 }
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10685 {
10687 return false;
10688 return true;
10689 }
10690
10692 {
10693
10695 }
10696
10697
10700 {
10701 super.CheckForRoofLimited(timeTresholdMS);
10702
10704 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10705 {
10706 m_PreviousRoofTestTime = time;
10707 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10708 }
10709 }
10710
10711
10713 {
10715 {
10716 return 0;
10717 }
10718
10719 if (GetInventory().GetAttachmentSlotsCount() != 0)
10720 {
10721 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10722 if (filter)
10723 return filter.GetProtectionLevel(type, false, system);
10724 else
10725 return 0;
10726 }
10727
10728 string subclassPath, entryName;
10729
10730 switch (type)
10731 {
10733 entryName = "biological";
10734 break;
10736 entryName = "chemical";
10737 break;
10738 default:
10739 entryName = "biological";
10740 break;
10741 }
10742
10743 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10744
10746 }
10747
10748
10749
10752 {
10753 if (!IsMagazine())
10755
10757 }
10758
10759
10760
10761
10762
10767 {
10768 return true;
10769 }
10770
10772 {
10774 }
10775
10776
10777
10778
10779
10781 {
10782 if (parent)
10783 {
10784 if (parent.IsInherited(DayZInfected))
10785 return true;
10786
10787 if (!parent.IsRuined())
10788 return true;
10789 }
10790
10791 return true;
10792 }
10793
10795 {
10796 if (!super.CanPutAsAttachment(parent))
10797 {
10798 return false;
10799 }
10800
10801 if (!IsRuined() && !parent.IsRuined())
10802 {
10803 return true;
10804 }
10805
10806 return false;
10807 }
10808
10810 {
10811
10812
10813
10814
10815 return super.CanReceiveItemIntoCargo(item);
10816 }
10817
10819 {
10820
10821
10822
10823
10824 GameInventory attachmentInv = attachment.GetInventory();
10826 {
10827 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10828 return false;
10829 }
10830
10831 InventoryLocation loc = new InventoryLocation();
10832 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10833 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10834 return false;
10835
10836 return super.CanReceiveAttachment(attachment, slotId);
10837 }
10838
10840 {
10841 if (!super.CanReleaseAttachment(attachment))
10842 return false;
10843
10844 return GetInventory().AreChildrenAccessible();
10845 }
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10868 {
10869 int id = muzzle_owner.GetMuzzleID();
10870 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10871
10872 if (WPOF_array)
10873 {
10874 for (int i = 0; i < WPOF_array.Count(); i++)
10875 {
10876 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10877
10878 if (WPOF)
10879 {
10880 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10881 }
10882 }
10883 }
10884 }
10885
10886
10888 {
10889 int id = muzzle_owner.GetMuzzleID();
10891
10892 if (WPOBE_array)
10893 {
10894 for (int i = 0; i < WPOBE_array.Count(); i++)
10895 {
10896 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10897
10898 if (WPOBE)
10899 {
10900 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10901 }
10902 }
10903 }
10904 }
10905
10906
10908 {
10909 int id = muzzle_owner.GetMuzzleID();
10910 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10911
10912 if (WPOOH_array)
10913 {
10914 for (int i = 0; i < WPOOH_array.Count(); i++)
10915 {
10916 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10917
10918 if (WPOOH)
10919 {
10920 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10921 }
10922 }
10923 }
10924 }
10925
10926
10928 {
10929 int id = muzzle_owner.GetMuzzleID();
10930 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10931
10932 if (WPOOH_array)
10933 {
10934 for (int i = 0; i < WPOOH_array.Count(); i++)
10935 {
10936 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10937
10938 if (WPOOH)
10939 {
10940 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10941 }
10942 }
10943 }
10944 }
10945
10946
10948 {
10949 int id = muzzle_owner.GetMuzzleID();
10950 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10951
10952 if (WPOOH_array)
10953 {
10954 for (int i = 0; i < WPOOH_array.Count(); i++)
10955 {
10956 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10957
10958 if (WPOOH)
10959 {
10960 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10961 }
10962 }
10963 }
10964 }
10965
10966
10967
10969 {
10971 {
10972 return true;
10973 }
10974
10975 return false;
10976 }
10977
10979 {
10981 {
10982 return true;
10983 }
10984
10985 return false;
10986 }
10987
10989 {
10991 {
10992 return true;
10993 }
10994
10995 return false;
10996 }
10997
10999 {
11000 return false;
11001 }
11002
11005 {
11006 return UATimeSpent.DEFAULT_DEPLOY;
11007 }
11008
11009
11010
11011
11013 {
11015 SetSynchDirty();
11016 }
11017
11019 {
11021 }
11022
11023
11025 {
11026 return false;
11027 }
11028
11031 {
11032 string att_type = "None";
11033
11034 if (ConfigIsExisting("soundAttType"))
11035 {
11036 att_type = ConfigGetString("soundAttType");
11037 }
11038
11040 }
11041
11043 {
11045 }
11046
11047
11048
11049
11050
11054
11056 {
11059
11061 }
11062
11063
11065 {
11067 return;
11068
11070
11073
11076
11077 SoundParameters params = new SoundParameters();
11081 }
11082
11083
11085 {
11087 return;
11088
11090 SetSynchDirty();
11091
11094 }
11095
11096
11098 {
11100 return;
11101
11103 SetSynchDirty();
11104
11107 }
11108
11110 {
11112 }
11113
11115 {
11117 }
11118
11121 {
11122 if (!
GetGame().IsDedicatedServer())
11123 {
11124 if (ConfigIsExisting("attachSoundSet"))
11125 {
11126 string cfg_path = "";
11127 string soundset = "";
11128 string type_name =
GetType();
11129
11132 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11133 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11134
11135 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11136 {
11137 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11138 {
11139 if (cfg_slot_array[i] == slot_type)
11140 {
11141 soundset = cfg_soundset_array[i];
11142 break;
11143 }
11144 }
11145 }
11146
11147 if (soundset != "")
11148 {
11149 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11151 }
11152 }
11153 }
11154 }
11155
11157 {
11158
11159 }
11160
11161 void OnApply(PlayerBase player);
11162
11164 {
11165 return 1.0;
11166 };
11167
11169 {
11171 }
11172
11174 {
11176 }
11177
11179
11181 {
11182 SetDynamicPhysicsLifeTime(0.01);
11184 }
11185
11187 {
11188 array<string> zone_names = new array<string>;
11189 GetDamageZones(zone_names);
11190 for (int i = 0; i < zone_names.Count(); i++)
11191 {
11192 SetHealthMax(zone_names.Get(i),"Health");
11193 }
11194 SetHealthMax("","Health");
11195 }
11196
11199 {
11200 float global_health = GetHealth01("","Health");
11201 array<string> zones = new array<string>;
11202 GetDamageZones(zones);
11203
11204 for (int i = 0; i < zones.Count(); i++)
11205 {
11206 SetHealth01(zones.Get(i),"Health",global_health);
11207 }
11208 }
11209
11212 {
11213 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11214 }
11215
11217 {
11218 if (!hasRootAsPlayer)
11219 {
11220 if (refParentIB)
11221 {
11222
11223 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11224 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11225
11226 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11227 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11228
11231 }
11232 else
11233 {
11234
11237 }
11238 }
11239 }
11240
11242 {
11244 {
11245 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11246 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11247 {
11248 float heatPermCoef = 1.0;
11250 while (ent)
11251 {
11252 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11253 ent = ent.GetHierarchyParent();
11254 }
11255
11256 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11257 }
11258 }
11259 }
11260
11262 {
11263
11264 EntityAI parent = GetHierarchyParent();
11265 if (!parent)
11266 {
11267 hasParent = false;
11268 hasRootAsPlayer = false;
11269 }
11270 else
11271 {
11272 hasParent = true;
11273 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11274 refParentIB =
ItemBase.Cast(parent);
11275 }
11276 }
11277
11278 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11279 {
11280
11281 }
11282
11284 {
11285
11286 return false;
11287 }
11288
11290 {
11291
11292
11293 return false;
11294 }
11295
11297 {
11298
11299 return false;
11300 }
11301
11304 {
11305 return !GetIsFrozen() &&
IsOpen();
11306 }
11307
11309 {
11310 bool hasParent = false, hasRootAsPlayer = false;
11312
11313 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11314 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11315
11316 if (wwtu || foodDecay)
11317 {
11321
11322 if (processWetness || processTemperature || processDecay)
11323 {
11325
11326 if (processWetness)
11327 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11328
11329 if (processTemperature)
11331
11332 if (processDecay)
11333 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11334 }
11335 }
11336 }
11337
11340 {
11342 }
11343
11345 {
11348
11349 return super.GetTemperatureFreezeThreshold();
11350 }
11351
11353 {
11356
11357 return super.GetTemperatureThawThreshold();
11358 }
11359
11361 {
11364
11365 return super.GetItemOverheatThreshold();
11366 }
11367
11369 {
11371 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11372
11373 return super.GetTemperatureFreezeTime();
11374 }
11375
11377 {
11379 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11380
11381 return super.GetTemperatureThawTime();
11382 }
11383
11388
11390 {
11391 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11392 }
11393
11395 {
11396 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11397 }
11398
11401 {
11403 }
11404
11406 {
11408 }
11409
11411 {
11413 }
11414
11417 {
11418 return null;
11419 }
11420
11423 {
11424 return false;
11425 }
11426
11428 {
11430 {
11433 if (!trg)
11434 {
11436 explosive = this;
11437 }
11438
11439 explosive.PairRemote(trg);
11441
11442 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11443 trg.SetPersistentPairID(persistentID);
11444 explosive.SetPersistentPairID(persistentID);
11445
11446 return true;
11447 }
11448 return false;
11449 }
11450
11453 {
11454 float ret = 1.0;
11457 ret *= GetHealth01();
11458
11459 return ret;
11460 }
11461
11462 #ifdef DEVELOPER
11463 override void SetDebugItem()
11464 {
11465 super.SetDebugItem();
11466 _itemBase = this;
11467 }
11468
11470 {
11471 string text = super.GetDebugText();
11472
11474 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11475
11476 return text;
11477 }
11478 #endif
11479
11481 {
11482 return true;
11483 }
11484
11486
11488
11490 {
11493 }
11494
11495
11503
11519}
11520
11522{
11524 if (entity)
11525 {
11526 bool is_item = entity.IsInherited(
ItemBase);
11527 if (is_item && full_quantity)
11528 {
11531 }
11532 }
11533 else
11534 {
11536 return NULL;
11537 }
11538 return entity;
11539}
11540
11542{
11543 if (item)
11544 {
11545 if (health > 0)
11546 item.SetHealth("", "", health);
11547
11548 if (item.CanHaveTemperature())
11549 {
11551 if (item.CanFreeze())
11552 item.SetFrozen(false);
11553 }
11554
11555 if (item.HasEnergyManager())
11556 {
11557 if (quantity >= 0)
11558 {
11559 item.GetCompEM().SetEnergy0To1(quantity);
11560 }
11561 else
11562 {
11564 }
11565 }
11566 else if (item.IsMagazine())
11567 {
11568 Magazine mag = Magazine.Cast(item);
11569 if (quantity >= 0)
11570 {
11571 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11572 }
11573 else
11574 {
11576 }
11577
11578 }
11579 else
11580 {
11581 if (quantity >= 0)
11582 {
11583 item.SetQuantityNormalized(quantity, false);
11584 }
11585 else
11586 {
11588 }
11589
11590 }
11591 }
11592}
11593
11594#ifdef DEVELOPER
11596#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.