Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChanged(item); first when overriding this event.
6801{
6803 {
6804 return true;
6805 }
6806};
6807
6808
6809
6811{
6815
6817
6820
6821
6822
6823
6824
6833
6839
6844
6849
6870 protected bool m_IsResultOfSplit
6871
6873
6878
6879
6880
6882
6886
6887
6888
6890
6893
6894
6895
6901
6902
6910
6913
6914
6916
6917
6919
6920
6925
6926
6931
6932
6934
6935
6937 {
6942
6943 if (!
GetGame().IsDedicatedServer())
6944 {
6946 {
6948
6950 {
6952 }
6953 }
6954
6957 }
6958
6959 m_OldLocation = null;
6960
6962 {
6964 }
6965
6966 if (ConfigIsExisting("headSelectionsToHide"))
6967 {
6970 }
6971
6973 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6974 {
6976 }
6977
6979
6980 m_IsResultOfSplit = false;
6981
6983 }
6984
6986 {
6987 super.InitItemVariables();
6988
6994 m_Count = ConfigGetInt(
"count");
6995
6998
7003
7006
7011
7023
7027
7028
7031 if (ConfigIsExisting("canBeSplit"))
7032 {
7035 }
7036
7038 if (ConfigIsExisting("itemBehaviour"))
7040
7041
7044 RegisterNetSyncVariableInt("m_VarLiquidType");
7045 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7046
7047 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7048 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7049 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7050
7051 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7052 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7053 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7054 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7055
7056 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7057 RegisterNetSyncVariableBool("m_IsTakeable");
7058 RegisterNetSyncVariableBool("m_IsHologram");
7059
7062 {
7065 }
7066
7068
7070 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7072
7073 }
7074
7076 {
7078 }
7079
7081 {
7084 {
7089 }
7090 }
7091
7092 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7093 {
7095 {
7098 }
7099
7101 }
7102
7104 {
7110 }
7111
7113
7115 {
7117
7118 if (!action)
7119 {
7120 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7121 return;
7122 }
7123
7125 if (!ai)
7126 {
7128 return;
7129 }
7130
7132 if (!action_array)
7133 {
7134 action_array = new array<ActionBase_Basic>;
7136 }
7137 if (LogManager.IsActionLogEnable())
7138 {
7139 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7140 }
7141
7142 if (action_array.Find(action) != -1)
7143 {
7144 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7145 }
7146 else
7147 {
7148 action_array.Insert(action);
7149 }
7150 }
7151
7153 {
7155 ActionBase action = player.GetActionManager().GetAction(actionName);
7158
7159 if (action_array)
7160 {
7161 action_array.RemoveItem(action);
7162 }
7163 }
7164
7165
7166
7168 {
7169 ActionOverrideData overrideData = new ActionOverrideData();
7173
7175 if (!actionMap)
7176 {
7179 }
7180
7181 actionMap.Insert(this.
Type(), overrideData);
7182
7183 }
7184
7186
7188
7189
7191 {
7194
7197
7198 string config_to_search = "CfgVehicles";
7199 string muzzle_owner_config;
7200
7202 {
7203 if (IsInherited(Weapon))
7204 config_to_search = "CfgWeapons";
7205
7206 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7207
7208 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7209
7211
7212 if (config_OnFire_subclass_count > 0)
7213 {
7214 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7215
7216 for (int i = 0; i < config_OnFire_subclass_count; i++)
7217 {
7218 string particle_class = "";
7220 string config_OnFire_entry = config_OnFire_class + particle_class;
7221 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7222 WPOF_array.Insert(WPOF);
7223 }
7224
7225
7227 }
7228 }
7229
7231 {
7232 config_to_search = "CfgWeapons";
7233 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7234
7235 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7236
7238
7239 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7240 {
7241 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7242
7243 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7244 {
7245 string particle_class2 = "";
7247 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7248 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7249 WPOBE_array.Insert(WPOBE);
7250 }
7251
7252
7254 }
7255 }
7256 }
7257
7258
7260 {
7263
7265 {
7266 string config_to_search = "CfgVehicles";
7267
7268 if (IsInherited(Weapon))
7269 config_to_search = "CfgWeapons";
7270
7271 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7272 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7273
7274 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7275 {
7276
7278
7280 {
7282 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7284 return;
7285 }
7286
7289
7290
7291
7293 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7294
7295 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7296 {
7297 string particle_class = "";
7299 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7301
7302 if (entry_type == CT_CLASS)
7303 {
7304 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7305 WPOOH_array.Insert(WPOF);
7306 }
7307 }
7308
7309
7311 }
7312 }
7313 }
7314
7316 {
7318 }
7319
7321 {
7323 {
7325
7328
7331
7332 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7333 }
7334 }
7335
7337 {
7339 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7340
7342 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7343
7345 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7346
7348 {
7350 }
7351 }
7352
7354 {
7356 }
7357
7359 {
7362 else
7364
7366 {
7369 }
7370 else
7371 {
7374
7377 }
7378
7380 }
7381
7383 {
7385 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7386 }
7387
7389 {
7391 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7393 }
7394
7396 {
7398 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7399 }
7400
7402 {
7405
7406 OverheatingParticle OP = new OverheatingParticle();
7411
7413 }
7414
7416 {
7419
7420 return -1;
7421 }
7422
7424 {
7426 {
7429
7430 for (int i = count; i > 0; --i)
7431 {
7432 int id = i - 1;
7435
7438
7439 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7440 {
7441 if (p)
7442 {
7445 }
7446 }
7447 }
7448 }
7449 }
7450
7452 {
7454 {
7456 {
7457 int id = i - 1;
7459
7460 if (OP)
7461 {
7463
7464 if (p)
7465 {
7467 }
7468
7469 delete OP;
7470 }
7471 }
7472
7475 }
7476 }
7477
7480 {
7481 return 0.0;
7482 }
7483
7484
7486 {
7487 return 250;
7488 }
7489
7491 {
7492 return 0;
7493 }
7494
7497 {
7499 return true;
7500
7501 return false;
7502 }
7503
7506 {
7509
7511 {
7513 }
7514 else
7515 {
7516
7518 }
7519
7521 }
7522
7529 {
7530 return -1;
7531 }
7532
7533
7534
7535
7537 {
7539 {
7541 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7542
7543 if (r_index >= 0)
7544 {
7545 InventoryLocation r_il = new InventoryLocation;
7546 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7547
7548 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7551 {
7552 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7553 }
7555 {
7556 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7557 }
7558
7559 }
7560
7561 player.GetHumanInventory().ClearUserReservedLocation(this);
7562 }
7563
7566 }
7567
7568
7569
7570
7572 {
7573 return ItemBase.m_DebugActionsMask;
7574 }
7575
7577 {
7578 return ItemBase.m_DebugActionsMask & mask;
7579 }
7580
7582 {
7583 ItemBase.m_DebugActionsMask = mask;
7584 }
7585
7587 {
7588 ItemBase.m_DebugActionsMask |= mask;
7589 }
7590
7592 {
7593 ItemBase.m_DebugActionsMask &= ~mask;
7594 }
7595
7597 {
7599 {
7601 }
7602 else
7603 {
7605 }
7606 }
7607
7608
7610 {
7611 if (GetEconomyProfile())
7612 {
7613 float q_max = GetEconomyProfile().GetQuantityMax();
7614 if (q_max > 0)
7615 {
7616 float q_min = GetEconomyProfile().GetQuantityMin();
7617 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7618
7620 {
7621 ComponentEnergyManager comp = GetCompEM();
7623 {
7625 }
7626 }
7628 {
7630
7631 }
7632
7633 }
7634 }
7635 }
7636
7639 {
7640 EntityAI parent = GetHierarchyParent();
7641
7642 if (parent)
7643 {
7644 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7645 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7646 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7647 }
7648 }
7649
7652 {
7653 EntityAI parent = GetHierarchyParent();
7654
7655 if (parent)
7656 {
7657 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7658 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7659 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7660 }
7661 }
7662
7664 {
7665
7666
7667
7668
7670
7672 {
7673 if (ScriptInputUserData.CanStoreInputUserData())
7674 {
7675 ScriptInputUserData ctx = new ScriptInputUserData;
7681 ctx.
Write(use_stack_max);
7684
7686 {
7687 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7688 }
7689 }
7690 }
7691 else if (!
GetGame().IsMultiplayer())
7692 {
7694 }
7695 }
7696
7698 {
7700 }
7701
7703 {
7705 }
7706
7708 {
7710 }
7711
7713 {
7714
7715 return false;
7716 }
7717
7719 {
7720 return false;
7721 }
7722
7726 {
7727 return false;
7728 }
7729
7731 {
7732 return "";
7733 }
7734
7736
7738 {
7739 return false;
7740 }
7741
7743 {
7744 return true;
7745 }
7746
7747
7748
7750 {
7751 return true;
7752 }
7753
7755 {
7756 return true;
7757 }
7758
7760 {
7761 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7763 }
7764
7766 {
7768 }
7769
7771 {
7773 if (!is_being_placed)
7775 SetSynchDirty();
7776 }
7777
7778
7780
7782 {
7784 }
7785
7787 {
7789 }
7790
7792 {
7793 return 1;
7794 }
7795
7797 {
7798 return false;
7799 }
7800
7802 {
7804 SetSynchDirty();
7805 }
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7842 {
7843 super.OnMovedInsideCargo(container);
7844
7845 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7846 }
7847
7848 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7849 {
7850 super.EEItemLocationChanged(oldLoc,newLoc);
7851
7852 PlayerBase new_player = null;
7853 PlayerBase old_player = null;
7854
7855 if (newLoc.GetParent())
7856 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7857
7858 if (oldLoc.GetParent())
7859 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7860
7862 {
7863 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7864
7865 if (r_index >= 0)
7866 {
7867 InventoryLocation r_il = new InventoryLocation;
7868 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7869
7870 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7873 {
7874 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7875 }
7877 {
7878 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7879 }
7880
7881 }
7882 }
7883
7885 {
7886 if (new_player)
7887 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7888
7889 if (new_player == old_player)
7890 {
7891
7892 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7893 {
7895 {
7896 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7897 {
7898 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7899 }
7900 }
7901 else
7902 {
7903 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7904 }
7905 }
7906
7907 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7908 {
7909 int type = oldLoc.GetType();
7911 {
7912 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7913 }
7915 {
7916 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7917 }
7918 }
7919 if (!m_OldLocation)
7920 {
7921 m_OldLocation = new InventoryLocation;
7922 }
7923 m_OldLocation.Copy(oldLoc);
7924 }
7925 else
7926 {
7927 if (m_OldLocation)
7928 {
7929 m_OldLocation.Reset();
7930 }
7931 }
7932
7934 }
7935 else
7936 {
7937 if (new_player)
7938 {
7939 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7940 if (res_index >= 0)
7941 {
7942 InventoryLocation il = new InventoryLocation;
7943 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7945 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7948 {
7949 il.
GetParent().GetOnReleaseLock().Invoke(it);
7950 }
7952 {
7954 }
7955
7956 }
7957 }
7959 {
7960
7962 }
7963
7964 if (m_OldLocation)
7965 {
7966 m_OldLocation.Reset();
7967 }
7968 }
7969 }
7970
7971 override void EOnContact(IEntity other, Contact extra)
7972 {
7974 {
7975 int liquidType = -1;
7977 if (impactSpeed > 0.0)
7978 {
7980 #ifndef SERVER
7982 #else
7984 SetSynchDirty();
7985 #endif
7987 }
7988 }
7989
7990 #ifdef SERVER
7991 if (GetCompEM() && GetCompEM().IsPlugged())
7992 {
7993 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7994 GetCompEM().UnplugThis();
7995 }
7996 #endif
7997 }
7998
8000
8002 {
8004 }
8005
8007 {
8008
8009 }
8010
8012 {
8013 super.OnItemLocationChanged(old_owner, new_owner);
8014
8015 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8016 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8017
8018 if (!relatedPlayer && playerNew)
8019 relatedPlayer = playerNew;
8020
8021 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8022 {
8024 if (actionMgr)
8025 {
8026 ActionBase currentAction = actionMgr.GetRunningAction();
8027 if (currentAction)
8029 }
8030 }
8031
8032 Man ownerPlayerOld = null;
8033 Man ownerPlayerNew = null;
8034
8035 if (old_owner)
8036 {
8037 if (old_owner.
IsMan())
8038 {
8039 ownerPlayerOld = Man.Cast(old_owner);
8040 }
8041 else
8042 {
8043 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8044 }
8045 }
8046 else
8047 {
8049 {
8051
8052 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8053 {
8054 GetCompEM().UnplugThis();
8055 }
8056 }
8057 }
8058
8059 if (new_owner)
8060 {
8061 if (new_owner.
IsMan())
8062 {
8063 ownerPlayerNew = Man.Cast(new_owner);
8064 }
8065 else
8066 {
8067 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8068 }
8069 }
8070
8071 if (ownerPlayerOld != ownerPlayerNew)
8072 {
8073 if (ownerPlayerOld)
8074 {
8075 array<EntityAI> subItemsExit = new array<EntityAI>;
8077 for (int i = 0; i < subItemsExit.Count(); i++)
8078 {
8081 }
8082 }
8083
8084 if (ownerPlayerNew)
8085 {
8086 array<EntityAI> subItemsEnter = new array<EntityAI>;
8088 for (int j = 0; j < subItemsEnter.Count(); j++)
8089 {
8092 }
8093 }
8094 }
8095 else if (ownerPlayerNew != null)
8096 {
8097 PlayerBase nplayer;
8098 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8099 {
8100 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8102 for (int k = 0; k < subItemsUpdate.Count(); k++)
8103 {
8105 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8106 }
8107 }
8108 }
8109
8110 if (old_owner)
8111 old_owner.OnChildItemRemoved(this);
8112 if (new_owner)
8113 new_owner.OnChildItemReceived(this);
8114 }
8115
8116
8118 {
8119 super.EEDelete(parent);
8120 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8121 if (player)
8122 {
8124
8125 if (player.IsAlive())
8126 {
8127 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8128 if (r_index >= 0)
8129 {
8130 InventoryLocation r_il = new InventoryLocation;
8131 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8132
8133 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8136 {
8137 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8138 }
8140 {
8141 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8142 }
8143
8144 }
8145
8146 player.RemoveQuickBarEntityShortcut(this);
8147 }
8148 }
8149 }
8150
8152 {
8153 super.EEKilled(killer);
8154
8157 {
8158 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8159 {
8160 if (IsMagazine())
8161 {
8162 if (Magazine.Cast(this).GetAmmoCount() > 0)
8163 {
8165 }
8166 }
8167 else
8168 {
8170 }
8171 }
8172 }
8173 }
8174
8176 {
8177 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8178
8179 super.OnWasAttached(parent, slot_id);
8180
8183
8185 }
8186
8188 {
8189 super.OnWasDetached(parent, slot_id);
8190
8193 }
8194
8196 {
8197 int idx;
8200
8201 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8202 if (inventory_slots.Count() < 1)
8203 {
8204 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8205 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8206 }
8207 else
8208 {
8209 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8210 }
8211
8212 idx = inventory_slots.Find(slot);
8213 if (idx < 0)
8214 return "";
8215
8216 return attach_types.Get(idx);
8217 }
8218
8220 {
8221 int idx = -1;
8222 string slot;
8223
8226
8227 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8228 if (inventory_slots.Count() < 1)
8229 {
8230 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8231 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8232 }
8233 else
8234 {
8235 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8236 if (detach_types.Count() < 1)
8237 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8238 }
8239
8240 for (int i = 0; i < inventory_slots.Count(); i++)
8241 {
8242 slot = inventory_slots.Get(i);
8243 }
8244
8245 if (slot != "")
8246 {
8247 if (detach_types.Count() == 1)
8248 idx = 0;
8249 else
8250 idx = inventory_slots.Find(slot);
8251 }
8252 if (idx < 0)
8253 return "";
8254
8255 return detach_types.Get(idx);
8256 }
8257
8259 {
8260
8262
8263
8264 float min_time = 1;
8265 float max_time = 3;
8266 float delay = Math.RandomFloat(min_time, max_time);
8267
8268 explode_timer.Run(delay, this, "DoAmmoExplosion");
8269 }
8270
8272 {
8273 Magazine magazine = Magazine.Cast(this);
8274 int pop_sounds_count = 6;
8275 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8276
8277
8278 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8279 string sound_name = pop_sounds[ sound_idx ];
8281
8282
8283 magazine.ServerAddAmmoCount(-1);
8284
8285
8286 float min_temp_to_explode = 100;
8287
8288 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8289 {
8291 }
8292 }
8293
8294
8295 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8296 {
8297 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8298
8299 const int CHANCE_DAMAGE_CARGO = 4;
8300 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8301 const int CHANCE_DAMAGE_NOTHING = 2;
8302
8304 {
8305 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8306 int chances;
8307 int rnd;
8308
8309 if (GetInventory().GetCargo())
8310 {
8311 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8312 rnd = Math.RandomInt(0,chances);
8313
8314 if (rnd < CHANCE_DAMAGE_CARGO)
8315 {
8317 }
8318 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8319 {
8321 }
8322 }
8323 else
8324 {
8325 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8326 rnd = Math.RandomInt(0,chances);
8327
8328 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8329 {
8331 }
8332 }
8333 }
8334 }
8335
8337 {
8338 if (GetInventory().GetCargo())
8339 {
8340 int item_count = GetInventory().GetCargo().GetItemCount();
8341 if (item_count > 0)
8342 {
8343 int random_pick = Math.RandomInt(0, item_count);
8345 if (!item.IsExplosive())
8346 {
8347 item.AddHealth("","",damage);
8348 return true;
8349 }
8350 }
8351 }
8352 return false;
8353 }
8354
8356 {
8357 int attachment_count = GetInventory().AttachmentCount();
8358 if (attachment_count > 0)
8359 {
8360 int random_pick = Math.RandomInt(0, attachment_count);
8361 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8362 if (!attachment.IsExplosive())
8363 {
8364 attachment.AddHealth("","",damage);
8365 return true;
8366 }
8367 }
8368 return false;
8369 }
8370
8372 {
8374 }
8375
8377 {
8379 return GetInventory().CanRemoveEntity();
8380
8381 return false;
8382 }
8383
8385 {
8387 return;
8388
8390 {
8391 if (ScriptInputUserData.CanStoreInputUserData())
8392 {
8393 ScriptInputUserData ctx = new ScriptInputUserData;
8398 ctx.
Write(destination_entity);
8402 }
8403 }
8404 else if (!
GetGame().IsMultiplayer())
8405 {
8407 }
8408 }
8409
8411 {
8413 return;
8414
8415 float split_quantity_new;
8419 InventoryLocation loc = new InventoryLocation;
8420
8421 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8422 {
8424 split_quantity_new = stack_max;
8425 else
8427
8428 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8429 if (new_item)
8430 {
8431 new_item.SetResultOfSplit(true);
8432 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8434 new_item.SetQuantity(split_quantity_new);
8435 }
8436 }
8437 else if (destination_entity && slot_id == -1)
8438 {
8439 if (quantity > stack_max)
8440 split_quantity_new = stack_max;
8441 else
8442 split_quantity_new = quantity;
8443
8445 {
8448 }
8449
8450 if (new_item)
8451 {
8452 new_item.SetResultOfSplit(true);
8453 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8455 new_item.SetQuantity(split_quantity_new);
8456 }
8457 }
8458 else
8459 {
8460 if (stack_max != 0)
8461 {
8463 {
8465 }
8466
8467 if (split_quantity_new == 0)
8468 {
8469 if (!
GetGame().IsMultiplayer())
8470 player.PhysicalPredictiveDropItem(this);
8471 else
8472 player.ServerDropEntity(this);
8473 return;
8474 }
8475
8477
8478 if (new_item)
8479 {
8480 new_item.SetResultOfSplit(true);
8481 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8483 new_item.SetQuantity(stack_max);
8484 new_item.PlaceOnSurface();
8485 }
8486 }
8487 }
8488 }
8489
8491 {
8493 return;
8494
8495 float split_quantity_new;
8499 InventoryLocation loc = new InventoryLocation;
8500
8501 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8502 {
8504 split_quantity_new = stack_max;
8505 else
8507
8508 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8509 if (new_item)
8510 {
8511 new_item.SetResultOfSplit(true);
8512 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8514 new_item.SetQuantity(split_quantity_new);
8515 }
8516 }
8517 else if (destination_entity && slot_id == -1)
8518 {
8519 if (quantity > stack_max)
8520 split_quantity_new = stack_max;
8521 else
8522 split_quantity_new = quantity;
8523
8525 {
8528 }
8529
8530 if (new_item)
8531 {
8532 new_item.SetResultOfSplit(true);
8533 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8535 new_item.SetQuantity(split_quantity_new);
8536 }
8537 }
8538 else
8539 {
8540 if (stack_max != 0)
8541 {
8543 {
8545 }
8546
8548
8549 if (new_item)
8550 {
8551 new_item.SetResultOfSplit(true);
8552 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8554 new_item.SetQuantity(stack_max);
8555 new_item.PlaceOnSurface();
8556 }
8557 }
8558 }
8559 }
8560
8562 {
8564 return;
8565
8567 {
8568 if (ScriptInputUserData.CanStoreInputUserData())
8569 {
8570 ScriptInputUserData ctx = new ScriptInputUserData;
8575 dst.WriteToContext(ctx);
8577 }
8578 }
8579 else if (!
GetGame().IsMultiplayer())
8580 {
8582 }
8583 }
8584
8586 {
8588 return;
8589
8591 {
8592 if (ScriptInputUserData.CanStoreInputUserData())
8593 {
8594 ScriptInputUserData ctx = new ScriptInputUserData;
8599 ctx.
Write(destination_entity);
8605 }
8606 }
8607 else if (!
GetGame().IsMultiplayer())
8608 {
8610 }
8611 }
8612
8614 {
8616 }
8617
8619 {
8621 return this;
8622
8624 float split_quantity_new;
8626 if (dst.IsValid())
8627 {
8628 int slot_id = dst.GetSlot();
8630
8631 if (quantity > stack_max)
8632 split_quantity_new = stack_max;
8633 else
8634 split_quantity_new = quantity;
8635
8637
8638 if (new_item)
8639 {
8640 new_item.SetResultOfSplit(true);
8641 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8644 }
8645
8646 return new_item;
8647 }
8648
8649 return null;
8650 }
8651
8653 {
8655 return;
8656
8658 float split_quantity_new;
8660 if (destination_entity)
8661 {
8663 if (quantity > stackable)
8664 split_quantity_new = stackable;
8665 else
8666 split_quantity_new = quantity;
8667
8668 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8669 if (new_item)
8670 {
8671 new_item.SetResultOfSplit(true);
8672 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8674 new_item.SetQuantity(split_quantity_new);
8675 }
8676 }
8677 }
8678
8680 {
8682 return;
8683
8685 {
8686 if (ScriptInputUserData.CanStoreInputUserData())
8687 {
8688 ScriptInputUserData ctx = new ScriptInputUserData;
8693 ItemBase destination_entity =
this;
8694 ctx.
Write(destination_entity);
8698 }
8699 }
8700 else if (!
GetGame().IsMultiplayer())
8701 {
8703 }
8704 }
8705
8707 {
8709 return;
8710
8712 float split_quantity_new;
8714 if (player)
8715 {
8717 if (quantity > stackable)
8718 split_quantity_new = stackable;
8719 else
8720 split_quantity_new = quantity;
8721
8722 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8723 new_item =
ItemBase.Cast(in_hands);
8724 if (new_item)
8725 {
8726 new_item.SetResultOfSplit(true);
8727 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8729 new_item.SetQuantity(split_quantity_new);
8730 }
8731 }
8732 }
8733
8735 {
8737 return;
8738
8740 float split_quantity_new = Math.Floor(quantity * 0.5);
8741
8743
8744 if (new_item)
8745 {
8746 if (new_item.GetQuantityMax() < split_quantity_new)
8747 {
8748 split_quantity_new = new_item.GetQuantityMax();
8749 }
8750
8751 new_item.SetResultOfSplit(true);
8752 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8753
8755 {
8758 }
8759 else
8760 {
8763 }
8764 }
8765 }
8766
8768 {
8770 return;
8771
8773 float split_quantity_new = Math.Floor(quantity / 2);
8774
8775 InventoryLocation invloc = new InventoryLocation;
8777
8779 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8780
8781 if (new_item)
8782 {
8783 if (new_item.GetQuantityMax() < split_quantity_new)
8784 {
8785 split_quantity_new = new_item.GetQuantityMax();
8786 }
8788 {
8791 }
8792 else
8793 {
8796 }
8797 }
8798 }
8799
8802 {
8803 SetWeightDirty();
8805
8806 if (parent)
8807 parent.OnAttachmentQuantityChangedEx(this, delta);
8808
8810 {
8812 {
8814 }
8816 {
8817 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8819 }
8820 }
8821
8822 }
8823
8826 {
8827
8828 }
8829
8832 {
8834 }
8835
8837 {
8838 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8839
8841 {
8842 if (newLevel == GameConstants.STATE_RUINED)
8843 {
8845 EntityAI parent = GetHierarchyParent();
8846 if (parent && parent.IsFireplace())
8847 {
8848 CargoBase cargo = GetInventory().GetCargo();
8849 if (cargo)
8850 {
8852 {
8854 }
8855 }
8856 }
8857 }
8858
8860 {
8861
8863 return;
8864 }
8865
8866 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8867 {
8869 }
8870 }
8871 }
8872
8873
8875 {
8876 super.OnRightClick();
8877
8879 {
8881 {
8882 if (ScriptInputUserData.CanStoreInputUserData())
8883 {
8884 vector m4[4];
8886
8887 EntityAI root = GetHierarchyRoot();
8888
8889 InventoryLocation dst = new InventoryLocation;
8891 {
8892 if (root)
8893 {
8894 root.GetTransform(m4);
8896 }
8897 else
8898 GetInventory().GetCurrentInventoryLocation(dst);
8899 }
8900 else
8901 {
8903
8904
8905 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8906 {
8907 if (root)
8908 {
8909 root.GetTransform(m4);
8911 }
8912 else
8913 GetInventory().GetCurrentInventoryLocation(dst);
8914 }
8915 else
8916 {
8917 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8918 }
8919 }
8920
8921 ScriptInputUserData ctx = new ScriptInputUserData;
8929 }
8930 }
8931 else if (!
GetGame().IsMultiplayer())
8932 {
8934 }
8935 }
8936 }
8937
8938 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8939 {
8940
8941 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8942 return false;
8943
8944 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8945 return false;
8946
8947
8949 return false;
8950
8951
8952 Magazine mag = Magazine.Cast(this);
8953 if (mag)
8954 {
8955 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8956 return false;
8957
8958 if (stack_max_limit)
8959 {
8960 Magazine other_mag = Magazine.Cast(other_item);
8961 if (other_item)
8962 {
8963 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8964 return false;
8965 }
8966
8967 }
8968 }
8969 else
8970 {
8971
8973 return false;
8974
8976 return false;
8977 }
8978
8979 PlayerBase player = null;
8980 if (CastTo(player, GetHierarchyRootPlayer()))
8981 {
8982 if (player.GetInventory().HasAttachment(this))
8983 return false;
8984
8985 if (player.IsItemsToDelete())
8986 return false;
8987 }
8988
8989 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8990 return false;
8991
8992 int slotID;
8994 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8995 return false;
8996
8997 return true;
8998 }
8999
9001 {
9003 }
9004
9006 {
9007 return m_IsResultOfSplit;
9008 }
9009
9011 {
9012 m_IsResultOfSplit = value;
9013 }
9014
9016 {
9018 }
9019
9021 {
9022 float other_item_quantity = other_item.GetQuantity();
9023 float this_free_space;
9024
9026
9028
9029 if (other_item_quantity > this_free_space)
9030 {
9031 return this_free_space;
9032 }
9033 else
9034 {
9035 return other_item_quantity;
9036 }
9037 }
9038
9040 {
9042 }
9043
9045 {
9047 return;
9048
9049 if (!IsMagazine() && other_item)
9050 {
9052 if (quantity_used != 0)
9053 {
9054 float hp1 = GetHealth01("","");
9055 float hp2 = other_item.GetHealth01("","");
9056 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9057 hpResult = hpResult / (
GetQuantity() + quantity_used);
9058
9059 hpResult *= GetMaxHealth();
9060 Math.Round(hpResult);
9061 SetHealth("", "Health", hpResult);
9062
9064 other_item.AddQuantity(-quantity_used);
9065 }
9066 }
9068 }
9069
9071 {
9072 #ifdef SERVER
9073 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9074 GetHierarchyParent().IncreaseLifetimeUp();
9075 #endif
9076 };
9077
9079 {
9080 PlayerBase p = PlayerBase.Cast(player);
9081
9082 array<int> recipesIds = p.m_Recipes;
9083 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9084 if (moduleRecipesManager)
9085 {
9086 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9087 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9088 }
9089
9090 for (int i = 0;i < recipesIds.Count(); i++)
9091 {
9092 int key = recipesIds.Get(i);
9093 string recipeName = moduleRecipesManager.GetRecipeName(key);
9095 }
9096 }
9097
9098
9099 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9100 {
9101 super.GetDebugActions(outputList);
9102
9103
9108
9109
9113
9117
9118
9121
9122
9124 {
9127 }
9128
9130
9133
9137 }
9138
9139
9140
9141
9143 {
9144 super.OnAction(action_id, player, ctx);
9145 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9146 {
9147 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9148 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9149 PlayerBase p = PlayerBase.Cast(player);
9150 if (
EActions.RECIPES_RANGE_START < 1000)
9151 {
9152 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9153 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9154 }
9155 }
9156 #ifndef SERVER
9157 else if (action_id ==
EActions.WATCH_PLAYER)
9158 {
9159 PluginDeveloper.SetDeveloperItemClientEx(player);
9160 }
9161 #endif
9163 {
9164 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9165 {
9166 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9167 OnDebugButtonPressServer(id + 1);
9168 }
9169
9170 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9171 {
9172 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9174 }
9175
9176 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9177 {
9178 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9180 }
9181
9182 else if (action_id ==
EActions.ADD_QUANTITY)
9183 {
9184 if (IsMagazine())
9185 {
9186 Magazine mag = Magazine.Cast(this);
9187 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9188 }
9189 else
9190 {
9192 }
9193
9194 if (m_EM)
9195 {
9196 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9197 }
9198
9199 }
9200
9201 else if (action_id ==
EActions.REMOVE_QUANTITY)
9202 {
9203 if (IsMagazine())
9204 {
9205 Magazine mag2 = Magazine.Cast(this);
9206 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9207 }
9208 else
9209 {
9211 }
9212 if (m_EM)
9213 {
9214 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9215 }
9216
9217 }
9218
9219 else if (action_id ==
EActions.SET_QUANTITY_0)
9220 {
9222
9223 if (m_EM)
9224 {
9225 m_EM.SetEnergy(0);
9226 }
9227 }
9228
9229 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9230 {
9232
9233 if (m_EM)
9234 {
9235 m_EM.SetEnergy(m_EM.GetEnergyMax());
9236 }
9237 }
9238
9239 else if (action_id ==
EActions.ADD_HEALTH)
9240 {
9241 AddHealth("","",GetMaxHealth("","Health")/5);
9242 }
9243 else if (action_id ==
EActions.REMOVE_HEALTH)
9244 {
9245 AddHealth("","",-GetMaxHealth("","Health")/5);
9246 }
9247 else if (action_id ==
EActions.DESTROY_HEALTH)
9248 {
9249 SetHealth01("","",0);
9250 }
9251 else if (action_id ==
EActions.WATCH_ITEM)
9252 {
9254 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9255 #ifdef DEVELOPER
9256 SetDebugDeveloper_item(this);
9257 #endif
9258 }
9259
9260 else if (action_id ==
EActions.ADD_TEMPERATURE)
9261 {
9262 AddTemperature(20);
9263
9264 }
9265
9266 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9267 {
9268 AddTemperature(-20);
9269
9270 }
9271
9272 else if (action_id ==
EActions.FLIP_FROZEN)
9273 {
9274 SetFrozen(!GetIsFrozen());
9275
9276 }
9277
9278 else if (action_id ==
EActions.ADD_WETNESS)
9279 {
9281
9282 }
9283
9284 else if (action_id ==
EActions.REMOVE_WETNESS)
9285 {
9287
9288 }
9289
9290 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9291 {
9294
9295
9296 }
9297
9298 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9299 {
9302 }
9303
9304 else if (action_id ==
EActions.MAKE_SPECIAL)
9305 {
9306 auto debugParams = DebugSpawnParams.WithPlayer(player);
9307 OnDebugSpawnEx(debugParams);
9308 }
9309
9310 else if (action_id ==
EActions.DELETE)
9311 {
9312 Delete();
9313 }
9314
9315 }
9316
9317
9318 return false;
9319 }
9320
9321
9322
9323
9327
9330
9331
9332
9334 {
9335 return false;
9336 }
9337
9338
9340 {
9341 return true;
9342 }
9343
9344
9346 {
9347 return true;
9348 }
9349
9350
9351
9353 {
9354 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9356 }
9357
9360 {
9361 return null;
9362 }
9363
9365 {
9366 return false;
9367 }
9368
9370 {
9371 return false;
9372 }
9373
9377
9378
9380 {
9381 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9382 return module_repairing.CanRepair(this, item_repair_kit);
9383 }
9384
9385
9386 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9387 {
9388 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9389 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9390 }
9391
9392
9394 {
9395
9396
9397
9398
9399
9400
9401
9402
9403 return 1;
9404 }
9405
9406
9407
9409 {
9411 }
9412
9413
9414
9416 {
9418 }
9419
9420
9429 {
9430 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9431
9432 if (player)
9433 {
9434 player.MessageStatus(text);
9435 }
9436 }
9437
9438
9447 {
9448 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9449
9450 if (player)
9451 {
9452 player.MessageAction(text);
9453 }
9454 }
9455
9456
9465 {
9466 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9467
9468 if (player)
9469 {
9470 player.MessageFriendly(text);
9471 }
9472 }
9473
9474
9483 {
9484 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9485
9486 if (player)
9487 {
9488 player.MessageImportant(text);
9489 }
9490 }
9491
9493 {
9494 return true;
9495 }
9496
9497
9498 override bool KindOf(
string tag)
9499 {
9500 bool found = false;
9501 string item_name = this.
GetType();
9504
9505 int array_size = item_tag_array.Count();
9506 for (int i = 0; i < array_size; i++)
9507 {
9508 if (item_tag_array.Get(i) == tag)
9509 {
9510 found = true;
9511 break;
9512 }
9513 }
9514 return found;
9515 }
9516
9517
9519 {
9520
9521 super.OnRPC(sender, rpc_type,ctx);
9522
9523
9524 switch (rpc_type)
9525 {
9526 #ifndef SERVER
9527 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9528 Param2<bool, string> p = new Param2<bool, string>(false, "");
9529
9531 return;
9532
9533 bool play = p.param1;
9534 string soundSet = p.param2;
9535
9536 if (play)
9537 {
9539 {
9541 {
9543 }
9544 }
9545 else
9546 {
9548 }
9549 }
9550 else
9551 {
9553 }
9554
9555 break;
9556 #endif
9557
9558 }
9559
9561 {
9563 }
9564 }
9565
9566
9567
9568
9570 {
9571 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9572 return plugin.GetID(
name);
9573 }
9574
9576 {
9577 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9578 return plugin.GetName(id);
9579 }
9580
9583 {
9584
9585
9586 int varFlags;
9587 if (!ctx.
Read(varFlags))
9588 return;
9589
9590 if (varFlags & ItemVariableFlags.FLOAT)
9591 {
9593 }
9594 }
9595
9597 {
9598
9599 super.SerializeNumericalVars(floats_out);
9600
9601
9602
9604 {
9606 }
9607
9609 {
9611 }
9612
9614 {
9616 }
9617
9619 {
9624 }
9625
9627 {
9629 }
9630 }
9631
9633 {
9634
9635 super.DeSerializeNumericalVars(floats);
9636
9637
9638 int index = 0;
9639 int mask = Math.Round(floats.Get(index));
9640
9641 index++;
9642
9644 {
9646 {
9648 }
9649 else
9650 {
9651 float quantity = floats.Get(index);
9653 }
9654 index++;
9655 }
9656
9658 {
9659 float wet = floats.Get(index);
9661 index++;
9662 }
9663
9665 {
9666 int liquidtype = Math.Round(floats.Get(index));
9668 index++;
9669 }
9670
9672 {
9674 index++;
9676 index++;
9678 index++;
9680 index++;
9681 }
9682
9684 {
9685 int cleanness = Math.Round(floats.Get(index));
9687 index++;
9688 }
9689 }
9690
9692 {
9693 super.WriteVarsToCTX(ctx);
9694
9695
9697 {
9699 }
9700
9702 {
9704 }
9705
9707 {
9709 }
9710
9712 {
9713 int r,g,b,a;
9719 }
9720
9722 {
9724 }
9725 }
9726
9728 {
9729 if (!super.ReadVarsFromCTX(ctx,version))
9730 return false;
9731
9732 int intValue;
9733 float value;
9734
9735 if (version < 140)
9736 {
9737 if (!ctx.
Read(intValue))
9738 return false;
9739
9740 m_VariablesMask = intValue;
9741 }
9742
9744 {
9745 if (!ctx.
Read(value))
9746 return false;
9747
9749 {
9751 }
9752 else
9753 {
9755 }
9756 }
9757
9758 if (version < 140)
9759 {
9761 {
9762 if (!ctx.
Read(value))
9763 return false;
9764 SetTemperatureDirect(value);
9765 }
9766 }
9767
9769 {
9770 if (!ctx.
Read(value))
9771 return false;
9773 }
9774
9776 {
9777 if (!ctx.
Read(intValue))
9778 return false;
9780 }
9781
9783 {
9784 int r,g,b,a;
9786 return false;
9788 return false;
9790 return false;
9792 return false;
9793
9795 }
9796
9798 {
9799 if (!ctx.
Read(intValue))
9800 return false;
9802 }
9803
9804 if (version >= 138 && version < 140)
9805 {
9807 {
9808 if (!ctx.
Read(intValue))
9809 return false;
9810 SetFrozen(intValue);
9811 }
9812 }
9813
9814 return true;
9815 }
9816
9817
9819 {
9822 {
9824 }
9825
9826 if (!super.OnStoreLoad(ctx, version))
9827 {
9829 return false;
9830 }
9831
9832 if (version >= 114)
9833 {
9834 bool hasQuickBarIndexSaved;
9835
9836 if (!ctx.
Read(hasQuickBarIndexSaved))
9837 {
9839 return false;
9840 }
9841
9842 if (hasQuickBarIndexSaved)
9843 {
9844 int itmQBIndex;
9845
9846
9847 if (!ctx.
Read(itmQBIndex))
9848 {
9850 return false;
9851 }
9852
9853 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9854 if (itmQBIndex != -1 && parentPlayer)
9855 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9856 }
9857 }
9858 else
9859 {
9860
9861 PlayerBase player;
9862 int itemQBIndex;
9863 if (version ==
int.
MAX)
9864 {
9865 if (!ctx.
Read(itemQBIndex))
9866 {
9868 return false;
9869 }
9870 }
9871 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9872 {
9873
9874 if (!ctx.
Read(itemQBIndex))
9875 {
9877 return false;
9878 }
9879 if (itemQBIndex != -1 && player)
9880 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9881 }
9882 }
9883
9884 if (version < 140)
9885 {
9886
9887 if (!LoadVariables(ctx, version))
9888 {
9890 return false;
9891 }
9892 }
9893
9894
9896 {
9898 return false;
9899 }
9900 if (version >= 132)
9901 {
9903 if (raib)
9904 {
9906 {
9908 return false;
9909 }
9910 }
9911 }
9912
9914 return true;
9915 }
9916
9917
9918
9920 {
9921 super.OnStoreSave(ctx);
9922
9923 PlayerBase player;
9924 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9925 {
9927
9928 int itemQBIndex = -1;
9929 itemQBIndex = player.FindQuickBarEntityIndex(this);
9930 ctx.
Write(itemQBIndex);
9931 }
9932 else
9933 {
9935 }
9936
9938
9940 if (raib)
9941 {
9943 }
9944 }
9945
9946
9948 {
9949 super.AfterStoreLoad();
9950
9952 {
9954 }
9955
9957 {
9960 }
9961 }
9962
9964 {
9965 super.EEOnAfterLoad();
9966
9968 {
9970 }
9971
9974 }
9975
9977 {
9978 return false;
9979 }
9980
9981
9982
9984 {
9986 {
9987 #ifdef PLATFORM_CONSOLE
9988
9990 {
9992 if (menu)
9993 {
9995 }
9996 }
9997 #endif
9998 }
9999
10001 {
10004 }
10005
10007 {
10008 SetWeightDirty();
10010 }
10012 {
10015 }
10016
10018 {
10021 }
10023 {
10026 }
10027
10028 super.OnVariablesSynchronized();
10029 }
10030
10031
10032
10034 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10035 {
10036 if (!IsServerCheck(allow_client))
10037 return false;
10038
10040 return false;
10041
10044
10045 if (value <= (min + 0.001))
10046 value = min;
10047
10048 if (value == min)
10049 {
10050 if (destroy_config)
10051 {
10052 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10053 if (dstr)
10054 {
10056 this.Delete();
10057 return true;
10058 }
10059 }
10060 else if (destroy_forced)
10061 {
10063 this.Delete();
10064 return true;
10065 }
10066
10068 }
10069
10072
10074 {
10076
10077 if (delta)
10079 }
10080
10082
10083 return false;
10084 }
10085
10086
10088 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10089 {
10091 }
10092
10094 {
10097 }
10098
10100 {
10103 }
10104
10107 {
10108 float value_clamped = Math.Clamp(value, 0, 1);
10110 SetQuantity(result, destroy_config, destroy_forced);
10111 }
10112
10113
10116 {
10118 }
10119
10121 {
10123 }
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10135 {
10136 int slot = -1;
10137 if (GetInventory())
10138 {
10139 InventoryLocation il = new InventoryLocation;
10140 GetInventory().GetCurrentInventoryLocation(il);
10142 }
10143
10145 }
10146
10148 {
10149 float quantity_max = 0;
10150
10152 {
10153 if (attSlotID != -1)
10154 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10155
10156 if (quantity_max <= 0)
10158 }
10159
10160 if (quantity_max <= 0)
10162
10163 return quantity_max;
10164 }
10165
10167 {
10169 }
10170
10172 {
10174 }
10175
10176
10178 {
10180 }
10181
10183 {
10185 }
10186
10188 {
10190 }
10191
10192
10194 {
10195
10196 float weightEx = GetWeightEx();
10197 float special = GetInventoryAndCargoWeight();
10198 return weightEx - special;
10199 }
10200
10201
10203 {
10205 }
10206
10208 {
10210 {
10211 #ifdef DEVELOPER
10212 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10213 {
10214 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10216 }
10217 #endif
10218
10219 return GetQuantity() * GetConfigWeightModified();
10220 }
10221 else if (HasEnergyManager())
10222 {
10223 #ifdef DEVELOPER
10224 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10225 {
10226 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10227 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10228 }
10229 #endif
10230 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10231 }
10232 else
10233 {
10234 #ifdef DEVELOPER
10235 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10236 {
10237 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10238 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10239 }
10240 #endif
10241 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10242 }
10243 }
10244
10247 {
10248 int item_count = 0;
10250
10251 if (GetInventory().GetCargo() != NULL)
10252 {
10253 item_count = GetInventory().GetCargo().GetItemCount();
10254 }
10255
10256 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10257 {
10258 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10259 if (item)
10260 item_count += item.GetNumberOfItems();
10261 }
10262 return item_count;
10263 }
10264
10267 {
10268 float weight = 0;
10269 float wetness = 1;
10270 if (include_wetness)
10273 {
10274 weight = wetness * m_ConfigWeight;
10275 }
10277 {
10278 weight = 1;
10279 }
10280 return weight;
10281 }
10282
10283
10284
10286 {
10287 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10288 {
10289 GameInventory inv = GetInventory();
10290 array<EntityAI> items = new array<EntityAI>;
10292 for (int i = 0; i < items.Count(); i++)
10293 {
10295 if (item)
10296 {
10298 }
10299 }
10300 }
10301 }
10302
10303
10304
10305
10307 {
10308 float energy = 0;
10309 if (HasEnergyManager())
10310 {
10311 energy = GetCompEM().GetEnergy();
10312 }
10313 return energy;
10314 }
10315
10316
10318 {
10319 super.OnEnergyConsumed();
10320
10322 }
10323
10325 {
10326 super.OnEnergyAdded();
10327
10329 }
10330
10331
10333 {
10334 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10335 {
10337 {
10338 float energy_0to1 = GetCompEM().GetEnergy0To1();
10340 }
10341 }
10342 }
10343
10344
10346 {
10347 return ConfigGetFloat("heatIsolation");
10348 }
10349
10351 {
10353 }
10354
10356 {
10357 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10358 if (
GetGame().ConfigIsExisting(paramPath))
10360
10361 return 0.0;
10362 }
10363
10365 {
10366 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10367 if (
GetGame().ConfigIsExisting(paramPath))
10369
10370 return 0.0;
10371 }
10372
10373 override void SetWet(
float value,
bool allow_client =
false)
10374 {
10375 if (!IsServerCheck(allow_client))
10376 return;
10377
10380
10382
10383 m_VarWet = Math.Clamp(value, min, max);
10384
10386 {
10389 }
10390 }
10391
10392 override void AddWet(
float value)
10393 {
10395 }
10396
10398 {
10400 }
10401
10403 {
10405 }
10406
10408 {
10410 }
10411
10413 {
10415 }
10416
10418 {
10420 }
10421
10422 override void OnWetChanged(
float newVal,
float oldVal)
10423 {
10426 if (newLevel != oldLevel)
10427 {
10429 }
10430 }
10431
10433 {
10434 SetWeightDirty();
10435 }
10436
10438 {
10439 return GetWetLevelInternal(
m_VarWet);
10440 }
10441
10442
10443
10445 {
10447 }
10448
10450 {
10452 }
10453
10455 {
10457 }
10458
10460 {
10462 }
10463
10464
10465
10467 {
10468 if (ConfigIsExisting("itemModelLength"))
10469 {
10470 return ConfigGetFloat("itemModelLength");
10471 }
10472 return 0;
10473 }
10474
10476 {
10477 if (ConfigIsExisting("itemAttachOffset"))
10478 {
10479 return ConfigGetFloat("itemAttachOffset");
10480 }
10481 return 0;
10482 }
10483
10484 override void SetCleanness(
int value,
bool allow_client =
false)
10485 {
10486 if (!IsServerCheck(allow_client))
10487 return;
10488
10490
10492
10495 }
10496
10498 {
10500 }
10501
10503 {
10504 return true;
10505 }
10506
10507
10508
10509
10511 {
10513 }
10514
10516 {
10518 }
10519
10520
10521
10522
10523 override void SetColor(
int r,
int g,
int b,
int a)
10524 {
10530 }
10532 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10533 {
10538 }
10539
10541 {
10543 }
10544
10547 {
10548 int r,g,b,a;
10550 r = r/255;
10551 g = g/255;
10552 b = b/255;
10553 a = a/255;
10554 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10555 }
10556
10557
10558
10559 override void SetLiquidType(
int value,
bool allow_client =
false)
10560 {
10561 if (!IsServerCheck(allow_client))
10562 return;
10563
10568 }
10569
10571 {
10572 return ConfigGetInt("varLiquidTypeInit");
10573 }
10574
10576 {
10578 }
10579
10581 {
10583 SetFrozen(false);
10584 }
10585
10588 {
10589 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10590 }
10591
10592
10595 {
10596 PlayerBase nplayer;
10597 if (PlayerBase.CastTo(nplayer, player))
10598 {
10600
10601 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10602 }
10603 }
10604
10605
10608 {
10609 PlayerBase nplayer;
10610 if (PlayerBase.CastTo(nplayer,player))
10611 {
10612
10613 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10614
10615 }
10616
10617
10618 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10619
10620
10621 if (HasEnergyManager())
10622 {
10623 GetCompEM().UpdatePlugState();
10624 }
10625 }
10626
10627
10629 {
10630 super.OnPlacementStarted(player);
10631
10633 }
10634
10635 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10636 {
10638 {
10639 m_AdminLog.OnPlacementComplete(player,
this);
10640 }
10641
10642 super.OnPlacementComplete(player, position, orientation);
10643 }
10644
10645
10646
10647
10648
10650 {
10652 {
10653 return true;
10654 }
10655 else
10656 {
10657 return false;
10658 }
10659 }
10660
10661
10663 {
10665 {
10667 }
10668 }
10669
10670
10672 {
10674 }
10675
10677 {
10679 }
10680
10681 override void InsertAgent(
int agent,
float count = 1)
10682 {
10683 if (count < 1)
10684 return;
10685
10687 }
10688
10691 {
10693 }
10694
10695
10697 {
10699 }
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10743 {
10745 return false;
10746 return true;
10747 }
10748
10750 {
10751
10753 }
10754
10755
10758 {
10759 super.CheckForRoofLimited(timeTresholdMS);
10760
10762 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10763 {
10764 m_PreviousRoofTestTime = time;
10765 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10766 }
10767 }
10768
10769
10771 {
10773 {
10774 return 0;
10775 }
10776
10777 if (GetInventory().GetAttachmentSlotsCount() != 0)
10778 {
10779 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10780 if (filter)
10781 return filter.GetProtectionLevel(type, false, system);
10782 else
10783 return 0;
10784 }
10785
10786 string subclassPath, entryName;
10787
10788 switch (type)
10789 {
10791 entryName = "biological";
10792 break;
10794 entryName = "chemical";
10795 break;
10796 default:
10797 entryName = "biological";
10798 break;
10799 }
10800
10801 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10802
10804 }
10805
10806
10807
10810 {
10811 if (!IsMagazine())
10813
10815 }
10816
10817
10818
10819
10820
10825 {
10826 return true;
10827 }
10828
10830 {
10832 }
10833
10834
10835
10836
10837
10839 {
10840 if (parent)
10841 {
10842 if (parent.IsInherited(DayZInfected))
10843 return true;
10844
10845 if (!parent.IsRuined())
10846 return true;
10847 }
10848
10849 return true;
10850 }
10851
10853 {
10854 if (!super.CanPutAsAttachment(parent))
10855 {
10856 return false;
10857 }
10858
10859 if (!IsRuined() && !parent.IsRuined())
10860 {
10861 return true;
10862 }
10863
10864 return false;
10865 }
10866
10868 {
10869
10870
10871
10872
10873 return super.CanReceiveItemIntoCargo(item);
10874 }
10875
10877 {
10878
10879
10880
10881
10882 GameInventory attachmentInv = attachment.GetInventory();
10884 {
10885 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10886 return false;
10887 }
10888
10889 InventoryLocation loc = new InventoryLocation();
10890 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10891 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10892 return false;
10893
10894 return super.CanReceiveAttachment(attachment, slotId);
10895 }
10896
10898 {
10899 if (!super.CanReleaseAttachment(attachment))
10900 return false;
10901
10902 return GetInventory().AreChildrenAccessible();
10903 }
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10926 {
10927 int id = muzzle_owner.GetMuzzleID();
10928 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10929
10930 if (WPOF_array)
10931 {
10932 for (int i = 0; i < WPOF_array.Count(); i++)
10933 {
10934 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10935
10936 if (WPOF)
10937 {
10938 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10939 }
10940 }
10941 }
10942 }
10943
10944
10946 {
10947 int id = muzzle_owner.GetMuzzleID();
10949
10950 if (WPOBE_array)
10951 {
10952 for (int i = 0; i < WPOBE_array.Count(); i++)
10953 {
10954 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10955
10956 if (WPOBE)
10957 {
10958 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10959 }
10960 }
10961 }
10962 }
10963
10964
10966 {
10967 int id = muzzle_owner.GetMuzzleID();
10968 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10969
10970 if (WPOOH_array)
10971 {
10972 for (int i = 0; i < WPOOH_array.Count(); i++)
10973 {
10974 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10975
10976 if (WPOOH)
10977 {
10978 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10979 }
10980 }
10981 }
10982 }
10983
10984
10986 {
10987 int id = muzzle_owner.GetMuzzleID();
10988 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10989
10990 if (WPOOH_array)
10991 {
10992 for (int i = 0; i < WPOOH_array.Count(); i++)
10993 {
10994 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10995
10996 if (WPOOH)
10997 {
10998 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10999 }
11000 }
11001 }
11002 }
11003
11004
11006 {
11007 int id = muzzle_owner.GetMuzzleID();
11008 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11009
11010 if (WPOOH_array)
11011 {
11012 for (int i = 0; i < WPOOH_array.Count(); i++)
11013 {
11014 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11015
11016 if (WPOOH)
11017 {
11018 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11019 }
11020 }
11021 }
11022 }
11023
11024
11025
11027 {
11029 {
11030 return true;
11031 }
11032
11033 return false;
11034 }
11035
11037 {
11039 {
11040 return true;
11041 }
11042
11043 return false;
11044 }
11045
11047 {
11049 {
11050 return true;
11051 }
11052
11053 return false;
11054 }
11055
11057 {
11058 return false;
11059 }
11060
11063 {
11064 return UATimeSpent.DEFAULT_DEPLOY;
11065 }
11066
11067
11068
11069
11071 {
11073 SetSynchDirty();
11074 }
11075
11077 {
11079 }
11080
11081
11083 {
11084 return false;
11085 }
11086
11089 {
11090 string att_type = "None";
11091
11092 if (ConfigIsExisting("soundAttType"))
11093 {
11094 att_type = ConfigGetString("soundAttType");
11095 }
11096
11098 }
11099
11101 {
11103 }
11104
11105
11106
11107
11108
11112
11114 {
11117
11119 }
11120
11121
11123 {
11125 return;
11126
11128
11131
11134
11135 SoundParameters params = new SoundParameters();
11139 }
11140
11141
11143 {
11145 return;
11146
11148 SetSynchDirty();
11149
11152 }
11153
11154
11156 {
11158 return;
11159
11161 SetSynchDirty();
11162
11165 }
11166
11168 {
11170 }
11171
11173 {
11175 }
11176
11179 {
11180 if (!
GetGame().IsDedicatedServer())
11181 {
11182 if (ConfigIsExisting("attachSoundSet"))
11183 {
11184 string cfg_path = "";
11185 string soundset = "";
11186 string type_name =
GetType();
11187
11190 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11191 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11192
11193 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11194 {
11195 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11196 {
11197 if (cfg_slot_array[i] == slot_type)
11198 {
11199 soundset = cfg_soundset_array[i];
11200 break;
11201 }
11202 }
11203 }
11204
11205 if (soundset != "")
11206 {
11207 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11209 }
11210 }
11211 }
11212 }
11213
11215 {
11216
11217 }
11218
11219 void OnApply(PlayerBase player);
11220
11222 {
11223 return 1.0;
11224 };
11225
11227 {
11229 }
11230
11232 {
11234 }
11235
11237
11239 {
11240 SetDynamicPhysicsLifeTime(0.01);
11242 }
11243
11245 {
11246 array<string> zone_names = new array<string>;
11247 GetDamageZones(zone_names);
11248 for (int i = 0; i < zone_names.Count(); i++)
11249 {
11250 SetHealthMax(zone_names.Get(i),"Health");
11251 }
11252 SetHealthMax("","Health");
11253 }
11254
11257 {
11258 float global_health = GetHealth01("","Health");
11259 array<string> zones = new array<string>;
11260 GetDamageZones(zones);
11261
11262 for (int i = 0; i < zones.Count(); i++)
11263 {
11264 SetHealth01(zones.Get(i),"Health",global_health);
11265 }
11266 }
11267
11270 {
11271 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11272 }
11273
11275 {
11276 if (!hasRootAsPlayer)
11277 {
11278 if (refParentIB)
11279 {
11280
11281 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11282 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11283
11284 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11285 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11286
11289 }
11290 else
11291 {
11292
11295 }
11296 }
11297 }
11298
11300 {
11302 {
11303 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11304 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11305 {
11306 float heatPermCoef = 1.0;
11308 while (ent)
11309 {
11310 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11311 ent = ent.GetHierarchyParent();
11312 }
11313
11314 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11315 }
11316 }
11317 }
11318
11320 {
11321
11322 EntityAI parent = GetHierarchyParent();
11323 if (!parent)
11324 {
11325 hasParent = false;
11326 hasRootAsPlayer = false;
11327 }
11328 else
11329 {
11330 hasParent = true;
11331 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11332 refParentIB =
ItemBase.Cast(parent);
11333 }
11334 }
11335
11336 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11337 {
11338
11339 }
11340
11342 {
11343
11344 return false;
11345 }
11346
11348 {
11349
11350
11351 return false;
11352 }
11353
11355 {
11356
11357 return false;
11358 }
11359
11362 {
11363 return !GetIsFrozen() &&
IsOpen();
11364 }
11365
11367 {
11368 bool hasParent = false, hasRootAsPlayer = false;
11370
11371 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11372 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11373
11374 if (wwtu || foodDecay)
11375 {
11379
11380 if (processWetness || processTemperature || processDecay)
11381 {
11383
11384 if (processWetness)
11385 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11386
11387 if (processTemperature)
11389
11390 if (processDecay)
11391 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11392 }
11393 }
11394 }
11395
11398 {
11400 }
11401
11403 {
11406
11407 return super.GetTemperatureFreezeThreshold();
11408 }
11409
11411 {
11414
11415 return super.GetTemperatureThawThreshold();
11416 }
11417
11419 {
11422
11423 return super.GetItemOverheatThreshold();
11424 }
11425
11427 {
11429 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11430
11431 return super.GetTemperatureFreezeTime();
11432 }
11433
11435 {
11437 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11438
11439 return super.GetTemperatureThawTime();
11440 }
11441
11446
11448 {
11449 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11450 }
11451
11453 {
11454 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11455 }
11456
11459 {
11461 }
11462
11464 {
11466 }
11467
11469 {
11471 }
11472
11475 {
11476 return null;
11477 }
11478
11481 {
11482 return false;
11483 }
11484
11486 {
11488 {
11491 if (!trg)
11492 {
11494 explosive = this;
11495 }
11496
11497 explosive.PairRemote(trg);
11499
11500 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11501 trg.SetPersistentPairID(persistentID);
11502 explosive.SetPersistentPairID(persistentID);
11503
11504 return true;
11505 }
11506 return false;
11507 }
11508
11511 {
11512 float ret = 1.0;
11515 ret *= GetHealth01();
11516
11517 return ret;
11518 }
11519
11520 #ifdef DEVELOPER
11521 override void SetDebugItem()
11522 {
11523 super.SetDebugItem();
11524 _itemBase = this;
11525 }
11526
11528 {
11529 string text = super.GetDebugText();
11530
11532 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11533
11534 return text;
11535 }
11536 #endif
11537
11539 {
11540 return true;
11541 }
11542
11544
11546
11548 {
11551 }
11552
11553
11561
11577}
11578
11580{
11582 if (entity)
11583 {
11584 bool is_item = entity.IsInherited(
ItemBase);
11585 if (is_item && full_quantity)
11586 {
11589 }
11590 }
11591 else
11592 {
11594 return NULL;
11595 }
11596 return entity;
11597}
11598
11600{
11601 if (item)
11602 {
11603 if (health > 0)
11604 item.SetHealth("", "", health);
11605
11606 if (item.CanHaveTemperature())
11607 {
11609 if (item.CanFreeze())
11610 item.SetFrozen(false);
11611 }
11612
11613 if (item.HasEnergyManager())
11614 {
11615 if (quantity >= 0)
11616 {
11617 item.GetCompEM().SetEnergy0To1(quantity);
11618 }
11619 else
11620 {
11622 }
11623 }
11624 else if (item.IsMagazine())
11625 {
11626 Magazine mag = Magazine.Cast(item);
11627 if (quantity >= 0)
11628 {
11629 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11630 }
11631 else
11632 {
11634 }
11635
11636 }
11637 else
11638 {
11639 if (quantity >= 0)
11640 {
11641 item.SetQuantityNormalized(quantity, false);
11642 }
11643 else
11644 {
11646 }
11647
11648 }
11649 }
11650}
11651
11652#ifdef DEVELOPER
11654#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.