6850{
6852 {
6853 return true;
6854 }
6855};
6856
6857
6858
6860{
6864
6866
6869
6870
6871
6872
6873
6882
6888
6893
6898
6919 protected bool m_IsResultOfSplit
6920
6922
6927
6928
6929
6931
6935
6936
6937
6939
6942
6943
6944
6950
6951
6959
6962
6963
6965
6966
6968
6969
6974
6975
6980
6981
6983
6984
6986 {
6991
6992 if (!
GetGame().IsDedicatedServer())
6993 {
6995 {
6997
6999 {
7001 }
7002 }
7003
7006 }
7007
7008 m_OldLocation = null;
7009
7011 {
7013 }
7014
7015 if (ConfigIsExisting("headSelectionsToHide"))
7016 {
7019 }
7020
7022 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7023 {
7025 }
7026
7028
7029 m_IsResultOfSplit = false;
7030
7032 }
7033
7035 {
7036 super.InitItemVariables();
7037
7043 m_Count = ConfigGetInt(
"count");
7044
7047
7052
7055
7060
7072
7076
7077
7080 if (ConfigIsExisting("canBeSplit"))
7081 {
7084 }
7085
7087 if (ConfigIsExisting("itemBehaviour"))
7089
7090
7093 RegisterNetSyncVariableInt("m_VarLiquidType");
7094 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7095
7096 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7097 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7098 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7099
7100 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7101 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7102 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7103 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7104
7105 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7106 RegisterNetSyncVariableBool("m_IsTakeable");
7107 RegisterNetSyncVariableBool("m_IsHologram");
7108
7111 {
7114 }
7115
7117
7119 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7121
7122 }
7123
7125 {
7127 }
7128
7130 {
7133 {
7138 }
7139 }
7140
7141 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7142 {
7144 {
7147 }
7148
7150 }
7151
7153 {
7159 }
7160
7162
7164 {
7166
7167 if (!action)
7168 {
7169 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7170 return;
7171 }
7172
7174 if (!ai)
7175 {
7177 return;
7178 }
7179
7181 if (!action_array)
7182 {
7183 action_array = new array<ActionBase_Basic>;
7185 }
7186 if (LogManager.IsActionLogEnable())
7187 {
7188 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7189 }
7190
7191 if (action_array.Find(action) != -1)
7192 {
7193 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7194 }
7195 else
7196 {
7197 action_array.Insert(action);
7198 }
7199 }
7200
7202 {
7204 ActionBase action = player.GetActionManager().GetAction(actionName);
7207
7208 if (action_array)
7209 {
7210 action_array.RemoveItem(action);
7211 }
7212 }
7213
7214
7215
7217 {
7218 ActionOverrideData overrideData = new ActionOverrideData();
7222
7224 if (!actionMap)
7225 {
7228 }
7229
7230 actionMap.Insert(this.
Type(), overrideData);
7231
7232 }
7233
7235
7237
7238
7240 {
7243
7246
7247 string config_to_search = "CfgVehicles";
7248 string muzzle_owner_config;
7249
7251 {
7252 if (IsInherited(Weapon))
7253 config_to_search = "CfgWeapons";
7254
7255 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7256
7257 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7258
7260
7261 if (config_OnFire_subclass_count > 0)
7262 {
7263 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7264
7265 for (int i = 0; i < config_OnFire_subclass_count; i++)
7266 {
7267 string particle_class = "";
7269 string config_OnFire_entry = config_OnFire_class + particle_class;
7270 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7271 WPOF_array.Insert(WPOF);
7272 }
7273
7274
7276 }
7277 }
7278
7280 {
7281 config_to_search = "CfgWeapons";
7282 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7283
7284 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7285
7287
7288 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7289 {
7290 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7291
7292 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7293 {
7294 string particle_class2 = "";
7296 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7297 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7298 WPOBE_array.Insert(WPOBE);
7299 }
7300
7301
7303 }
7304 }
7305 }
7306
7307
7309 {
7312
7314 {
7315 string config_to_search = "CfgVehicles";
7316
7317 if (IsInherited(Weapon))
7318 config_to_search = "CfgWeapons";
7319
7320 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7321 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7322
7323 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7324 {
7325
7327
7329 {
7331 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7333 return;
7334 }
7335
7338
7339
7340
7342 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7343
7344 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7345 {
7346 string particle_class = "";
7348 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7350
7351 if (entry_type == CT_CLASS)
7352 {
7353 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7354 WPOOH_array.Insert(WPOF);
7355 }
7356 }
7357
7358
7360 }
7361 }
7362 }
7363
7365 {
7367 }
7368
7370 {
7372 {
7374
7377
7380
7381 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7382 }
7383 }
7384
7386 {
7388 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7389
7391 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7392
7394 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7395
7397 {
7399 }
7400 }
7401
7403 {
7405 }
7406
7408 {
7411 else
7413
7415 {
7418 }
7419 else
7420 {
7423
7426 }
7427
7429 }
7430
7432 {
7434 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7435 }
7436
7438 {
7440 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7442 }
7443
7445 {
7447 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7448 }
7449
7451 {
7454
7455 OverheatingParticle OP = new OverheatingParticle();
7460
7462 }
7463
7465 {
7468
7469 return -1;
7470 }
7471
7473 {
7475 {
7478
7479 for (int i = count; i > 0; --i)
7480 {
7481 int id = i - 1;
7484
7487
7488 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7489 {
7490 if (p)
7491 {
7494 }
7495 }
7496 }
7497 }
7498 }
7499
7501 {
7503 {
7505 {
7506 int id = i - 1;
7508
7509 if (OP)
7510 {
7512
7513 if (p)
7514 {
7516 }
7517
7518 delete OP;
7519 }
7520 }
7521
7524 }
7525 }
7526
7529 {
7530 return 0.0;
7531 }
7532
7533
7535 {
7536 return 250;
7537 }
7538
7540 {
7541 return 0;
7542 }
7543
7546 {
7548 return true;
7549
7550 return false;
7551 }
7552
7555 {
7558
7560 {
7562 }
7563 else
7564 {
7565
7567 }
7568
7570 }
7571
7578 {
7579 return -1;
7580 }
7581
7582
7583
7584
7586 {
7588 {
7590 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7591
7592 if (r_index >= 0)
7593 {
7594 InventoryLocation r_il = new InventoryLocation;
7595 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7596
7597 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7600 {
7601 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7602 }
7604 {
7605 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7606 }
7607
7608 }
7609
7610 player.GetHumanInventory().ClearUserReservedLocation(this);
7611 }
7612
7615 }
7616
7617
7618
7619
7621 {
7622 return ItemBase.m_DebugActionsMask;
7623 }
7624
7626 {
7627 return ItemBase.m_DebugActionsMask & mask;
7628 }
7629
7631 {
7632 ItemBase.m_DebugActionsMask = mask;
7633 }
7634
7636 {
7637 ItemBase.m_DebugActionsMask |= mask;
7638 }
7639
7641 {
7642 ItemBase.m_DebugActionsMask &= ~mask;
7643 }
7644
7646 {
7648 {
7650 }
7651 else
7652 {
7654 }
7655 }
7656
7657
7659 {
7660 if (GetEconomyProfile())
7661 {
7662 float q_max = GetEconomyProfile().GetQuantityMax();
7663 if (q_max > 0)
7664 {
7665 float q_min = GetEconomyProfile().GetQuantityMin();
7666 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7667
7669 {
7670 ComponentEnergyManager comp = GetCompEM();
7672 {
7674 }
7675 }
7677 {
7679
7680 }
7681
7682 }
7683 }
7684 }
7685
7688 {
7689 EntityAI parent = GetHierarchyParent();
7690
7691 if (parent)
7692 {
7693 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7694 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7695 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7696 }
7697 }
7698
7701 {
7702 EntityAI parent = GetHierarchyParent();
7703
7704 if (parent)
7705 {
7706 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7707 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7708 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7709 }
7710 }
7711
7713 {
7714
7715
7716
7717
7719
7721 {
7722 if (ScriptInputUserData.CanStoreInputUserData())
7723 {
7724 ScriptInputUserData ctx = new ScriptInputUserData;
7730 ctx.
Write(use_stack_max);
7733
7735 {
7736 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7737 }
7738 }
7739 }
7740 else if (!
GetGame().IsMultiplayer())
7741 {
7743 }
7744 }
7745
7747 {
7749 }
7750
7752 {
7754 }
7755
7757 {
7759 }
7760
7762 {
7763
7764 return false;
7765 }
7766
7768 {
7769 return false;
7770 }
7771
7775 {
7776 return false;
7777 }
7778
7780 {
7781 return "";
7782 }
7783
7785
7787 {
7788 return false;
7789 }
7790
7792 {
7793 return true;
7794 }
7795
7796
7797
7799 {
7800 return true;
7801 }
7802
7804 {
7805 return true;
7806 }
7807
7809 {
7810 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7812 }
7813
7815 {
7817 }
7818
7820 {
7822 if (!is_being_placed)
7824 SetSynchDirty();
7825 }
7826
7827
7829
7831 {
7833 }
7834
7836 {
7838 }
7839
7841 {
7842 return 1;
7843 }
7844
7846 {
7847 return false;
7848 }
7849
7851 {
7853 SetSynchDirty();
7854 }
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7891 {
7892 super.OnMovedInsideCargo(container);
7893
7894 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7895 }
7896
7897 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7898 {
7899 super.EEItemLocationChanged(oldLoc,newLoc);
7900
7901 PlayerBase new_player = null;
7902 PlayerBase old_player = null;
7903
7904 if (newLoc.GetParent())
7905 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7906
7907 if (oldLoc.GetParent())
7908 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7909
7911 {
7912 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7913
7914 if (r_index >= 0)
7915 {
7916 InventoryLocation r_il = new InventoryLocation;
7917 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7918
7919 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7922 {
7923 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7924 }
7926 {
7927 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7928 }
7929
7930 }
7931 }
7932
7934 {
7935 if (new_player)
7936 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7937
7938 if (new_player == old_player)
7939 {
7940
7941 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7942 {
7944 {
7945 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7946 {
7947 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7948 }
7949 }
7950 else
7951 {
7952 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7953 }
7954 }
7955
7956 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7957 {
7958 int type = oldLoc.GetType();
7960 {
7961 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7962 }
7964 {
7965 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7966 }
7967 }
7968 if (!m_OldLocation)
7969 {
7970 m_OldLocation = new InventoryLocation;
7971 }
7972 m_OldLocation.Copy(oldLoc);
7973 }
7974 else
7975 {
7976 if (m_OldLocation)
7977 {
7978 m_OldLocation.Reset();
7979 }
7980 }
7981
7983 }
7984 else
7985 {
7986 if (new_player)
7987 {
7988 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7989 if (res_index >= 0)
7990 {
7991 InventoryLocation il = new InventoryLocation;
7992 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7994 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7997 {
7998 il.
GetParent().GetOnReleaseLock().Invoke(it);
7999 }
8001 {
8003 }
8004
8005 }
8006 }
8008 {
8009
8011 }
8012
8013 if (m_OldLocation)
8014 {
8015 m_OldLocation.Reset();
8016 }
8017 }
8018 }
8019
8020 override void EOnContact(IEntity other, Contact extra)
8021 {
8023 {
8024 int liquidType = -1;
8026 if (impactSpeed > 0.0)
8027 {
8029 #ifndef SERVER
8031 #else
8033 SetSynchDirty();
8034 #endif
8036 }
8037 }
8038
8039 #ifdef SERVER
8040 if (GetCompEM() && GetCompEM().IsPlugged())
8041 {
8042 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8043 GetCompEM().UnplugThis();
8044 }
8045 #endif
8046 }
8047
8049
8051 {
8053 }
8054
8056 {
8057
8058 }
8059
8061 {
8062 super.OnItemLocationChanged(old_owner, new_owner);
8063
8064 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8065 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8066
8067 if (!relatedPlayer && playerNew)
8068 relatedPlayer = playerNew;
8069
8070 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8071 {
8073 if (actionMgr)
8074 {
8075 ActionBase currentAction = actionMgr.GetRunningAction();
8076 if (currentAction)
8078 }
8079 }
8080
8081 Man ownerPlayerOld = null;
8082 Man ownerPlayerNew = null;
8083
8084 if (old_owner)
8085 {
8086 if (old_owner.
IsMan())
8087 {
8088 ownerPlayerOld = Man.Cast(old_owner);
8089 }
8090 else
8091 {
8092 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8093 }
8094 }
8095 else
8096 {
8098 {
8100
8101 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8102 {
8103 GetCompEM().UnplugThis();
8104 }
8105 }
8106 }
8107
8108 if (new_owner)
8109 {
8110 if (new_owner.
IsMan())
8111 {
8112 ownerPlayerNew = Man.Cast(new_owner);
8113 }
8114 else
8115 {
8116 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8117 }
8118 }
8119
8120 if (ownerPlayerOld != ownerPlayerNew)
8121 {
8122 if (ownerPlayerOld)
8123 {
8124 array<EntityAI> subItemsExit = new array<EntityAI>;
8126 for (int i = 0; i < subItemsExit.Count(); i++)
8127 {
8130 }
8131 }
8132
8133 if (ownerPlayerNew)
8134 {
8135 array<EntityAI> subItemsEnter = new array<EntityAI>;
8137 for (int j = 0; j < subItemsEnter.Count(); j++)
8138 {
8141 }
8142 }
8143 }
8144 else if (ownerPlayerNew != null)
8145 {
8146 PlayerBase nplayer;
8147 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8148 {
8149 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8151 for (int k = 0; k < subItemsUpdate.Count(); k++)
8152 {
8154 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8155 }
8156 }
8157 }
8158
8159 if (old_owner)
8160 old_owner.OnChildItemRemoved(this);
8161 if (new_owner)
8162 new_owner.OnChildItemReceived(this);
8163 }
8164
8165
8167 {
8168 super.EEDelete(parent);
8169 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8170 if (player)
8171 {
8173
8174 if (player.IsAlive())
8175 {
8176 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8177 if (r_index >= 0)
8178 {
8179 InventoryLocation r_il = new InventoryLocation;
8180 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8181
8182 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8185 {
8186 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8187 }
8189 {
8190 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8191 }
8192
8193 }
8194
8195 player.RemoveQuickBarEntityShortcut(this);
8196 }
8197 }
8198 }
8199
8201 {
8202 super.EEKilled(killer);
8203
8206 {
8207 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8208 {
8209 if (IsMagazine())
8210 {
8211 if (Magazine.Cast(this).GetAmmoCount() > 0)
8212 {
8214 }
8215 }
8216 else
8217 {
8219 }
8220 }
8221 }
8222 }
8223
8225 {
8226 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8227
8228 super.OnWasAttached(parent, slot_id);
8229
8232
8234 }
8235
8237 {
8238 super.OnWasDetached(parent, slot_id);
8239
8242 }
8243
8245 {
8246 int idx;
8249
8250 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8251 if (inventory_slots.Count() < 1)
8252 {
8253 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8254 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8255 }
8256 else
8257 {
8258 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8259 }
8260
8261 idx = inventory_slots.Find(slot);
8262 if (idx < 0)
8263 return "";
8264
8265 return attach_types.Get(idx);
8266 }
8267
8269 {
8270 int idx = -1;
8271 string slot;
8272
8275
8276 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8277 if (inventory_slots.Count() < 1)
8278 {
8279 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8280 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8281 }
8282 else
8283 {
8284 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8285 if (detach_types.Count() < 1)
8286 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8287 }
8288
8289 for (int i = 0; i < inventory_slots.Count(); i++)
8290 {
8291 slot = inventory_slots.Get(i);
8292 }
8293
8294 if (slot != "")
8295 {
8296 if (detach_types.Count() == 1)
8297 idx = 0;
8298 else
8299 idx = inventory_slots.Find(slot);
8300 }
8301 if (idx < 0)
8302 return "";
8303
8304 return detach_types.Get(idx);
8305 }
8306
8308 {
8309
8311
8312
8313 float min_time = 1;
8314 float max_time = 3;
8315 float delay = Math.RandomFloat(min_time, max_time);
8316
8317 explode_timer.Run(delay, this, "DoAmmoExplosion");
8318 }
8319
8321 {
8322 Magazine magazine = Magazine.Cast(this);
8323 int pop_sounds_count = 6;
8324 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8325
8326
8327 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8328 string sound_name = pop_sounds[ sound_idx ];
8330
8331
8332 magazine.ServerAddAmmoCount(-1);
8333
8334
8335 float min_temp_to_explode = 100;
8336
8337 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8338 {
8340 }
8341 }
8342
8343
8344 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8345 {
8346 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8347
8348 const int CHANCE_DAMAGE_CARGO = 4;
8349 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8350 const int CHANCE_DAMAGE_NOTHING = 2;
8351
8353 {
8354 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8355 int chances;
8356 int rnd;
8357
8358 if (GetInventory().GetCargo())
8359 {
8360 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8361 rnd = Math.RandomInt(0,chances);
8362
8363 if (rnd < CHANCE_DAMAGE_CARGO)
8364 {
8366 }
8367 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8368 {
8370 }
8371 }
8372 else
8373 {
8374 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8375 rnd = Math.RandomInt(0,chances);
8376
8377 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8378 {
8380 }
8381 }
8382 }
8383 }
8384
8386 {
8387 if (GetInventory().GetCargo())
8388 {
8389 int item_count = GetInventory().GetCargo().GetItemCount();
8390 if (item_count > 0)
8391 {
8392 int random_pick = Math.RandomInt(0, item_count);
8394 if (!item.IsExplosive())
8395 {
8396 item.AddHealth("","",damage);
8397 return true;
8398 }
8399 }
8400 }
8401 return false;
8402 }
8403
8405 {
8406 int attachment_count = GetInventory().AttachmentCount();
8407 if (attachment_count > 0)
8408 {
8409 int random_pick = Math.RandomInt(0, attachment_count);
8410 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8411 if (!attachment.IsExplosive())
8412 {
8413 attachment.AddHealth("","",damage);
8414 return true;
8415 }
8416 }
8417 return false;
8418 }
8419
8421 {
8423 }
8424
8426 {
8428 return GetInventory().CanRemoveEntity();
8429
8430 return false;
8431 }
8432
8434 {
8436 return;
8437
8439 {
8440 if (ScriptInputUserData.CanStoreInputUserData())
8441 {
8442 ScriptInputUserData ctx = new ScriptInputUserData;
8447 ctx.
Write(destination_entity);
8451 }
8452 }
8453 else if (!
GetGame().IsMultiplayer())
8454 {
8456 }
8457 }
8458
8460 {
8462 return;
8463
8464 float split_quantity_new;
8468 InventoryLocation loc = new InventoryLocation;
8469
8470 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8471 {
8473 split_quantity_new = stack_max;
8474 else
8476
8477 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8478 if (new_item)
8479 {
8480 new_item.SetResultOfSplit(true);
8481 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8483 new_item.SetQuantity(split_quantity_new);
8484 }
8485 }
8486 else if (destination_entity && slot_id == -1)
8487 {
8488 if (quantity > stack_max)
8489 split_quantity_new = stack_max;
8490 else
8491 split_quantity_new = quantity;
8492
8494 {
8497 }
8498
8499 if (new_item)
8500 {
8501 new_item.SetResultOfSplit(true);
8502 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8504 new_item.SetQuantity(split_quantity_new);
8505 }
8506 }
8507 else
8508 {
8509 if (stack_max != 0)
8510 {
8512 {
8514 }
8515
8516 if (split_quantity_new == 0)
8517 {
8518 if (!
GetGame().IsMultiplayer())
8519 player.PhysicalPredictiveDropItem(this);
8520 else
8521 player.ServerDropEntity(this);
8522 return;
8523 }
8524
8526
8527 if (new_item)
8528 {
8529 new_item.SetResultOfSplit(true);
8530 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8532 new_item.SetQuantity(stack_max);
8533 new_item.PlaceOnSurface();
8534 }
8535 }
8536 }
8537 }
8538
8540 {
8542 return;
8543
8544 float split_quantity_new;
8548 InventoryLocation loc = new InventoryLocation;
8549
8550 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8551 {
8553 split_quantity_new = stack_max;
8554 else
8556
8557 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8558 if (new_item)
8559 {
8560 new_item.SetResultOfSplit(true);
8561 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8563 new_item.SetQuantity(split_quantity_new);
8564 }
8565 }
8566 else if (destination_entity && slot_id == -1)
8567 {
8568 if (quantity > stack_max)
8569 split_quantity_new = stack_max;
8570 else
8571 split_quantity_new = quantity;
8572
8574 {
8577 }
8578
8579 if (new_item)
8580 {
8581 new_item.SetResultOfSplit(true);
8582 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8584 new_item.SetQuantity(split_quantity_new);
8585 }
8586 }
8587 else
8588 {
8589 if (stack_max != 0)
8590 {
8592 {
8594 }
8595
8597
8598 if (new_item)
8599 {
8600 new_item.SetResultOfSplit(true);
8601 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8603 new_item.SetQuantity(stack_max);
8604 new_item.PlaceOnSurface();
8605 }
8606 }
8607 }
8608 }
8609
8611 {
8613 return;
8614
8616 {
8617 if (ScriptInputUserData.CanStoreInputUserData())
8618 {
8619 ScriptInputUserData ctx = new ScriptInputUserData;
8624 dst.WriteToContext(ctx);
8626 }
8627 }
8628 else if (!
GetGame().IsMultiplayer())
8629 {
8631 }
8632 }
8633
8635 {
8637 return;
8638
8640 {
8641 if (ScriptInputUserData.CanStoreInputUserData())
8642 {
8643 ScriptInputUserData ctx = new ScriptInputUserData;
8648 ctx.
Write(destination_entity);
8654 }
8655 }
8656 else if (!
GetGame().IsMultiplayer())
8657 {
8659 }
8660 }
8661
8663 {
8665 }
8666
8668 {
8670 return this;
8671
8673 float split_quantity_new;
8675 if (dst.IsValid())
8676 {
8677 int slot_id = dst.GetSlot();
8679
8680 if (quantity > stack_max)
8681 split_quantity_new = stack_max;
8682 else
8683 split_quantity_new = quantity;
8684
8686
8687 if (new_item)
8688 {
8689 new_item.SetResultOfSplit(true);
8690 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8693 }
8694
8695 return new_item;
8696 }
8697
8698 return null;
8699 }
8700
8702 {
8704 return;
8705
8707 float split_quantity_new;
8709 if (destination_entity)
8710 {
8712 if (quantity > stackable)
8713 split_quantity_new = stackable;
8714 else
8715 split_quantity_new = quantity;
8716
8717 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8718 if (new_item)
8719 {
8720 new_item.SetResultOfSplit(true);
8721 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8723 new_item.SetQuantity(split_quantity_new);
8724 }
8725 }
8726 }
8727
8729 {
8731 return;
8732
8734 {
8735 if (ScriptInputUserData.CanStoreInputUserData())
8736 {
8737 ScriptInputUserData ctx = new ScriptInputUserData;
8742 ItemBase destination_entity =
this;
8743 ctx.
Write(destination_entity);
8747 }
8748 }
8749 else if (!
GetGame().IsMultiplayer())
8750 {
8752 }
8753 }
8754
8756 {
8758 return;
8759
8761 float split_quantity_new;
8763 if (player)
8764 {
8766 if (quantity > stackable)
8767 split_quantity_new = stackable;
8768 else
8769 split_quantity_new = quantity;
8770
8771 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8772 new_item =
ItemBase.Cast(in_hands);
8773 if (new_item)
8774 {
8775 new_item.SetResultOfSplit(true);
8776 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8778 new_item.SetQuantity(split_quantity_new);
8779 }
8780 }
8781 }
8782
8784 {
8786 return;
8787
8789 float split_quantity_new = Math.Floor(quantity * 0.5);
8790
8792
8793 if (new_item)
8794 {
8795 if (new_item.GetQuantityMax() < split_quantity_new)
8796 {
8797 split_quantity_new = new_item.GetQuantityMax();
8798 }
8799
8800 new_item.SetResultOfSplit(true);
8801 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8802
8804 {
8807 }
8808 else
8809 {
8812 }
8813 }
8814 }
8815
8817 {
8819 return;
8820
8822 float split_quantity_new = Math.Floor(quantity / 2);
8823
8824 InventoryLocation invloc = new InventoryLocation;
8826
8828 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8829
8830 if (new_item)
8831 {
8832 if (new_item.GetQuantityMax() < split_quantity_new)
8833 {
8834 split_quantity_new = new_item.GetQuantityMax();
8835 }
8837 {
8840 }
8841 else
8842 {
8845 }
8846 }
8847 }
8848
8851 {
8852 SetWeightDirty();
8854
8855 if (parent)
8856 parent.OnAttachmentQuantityChangedEx(this, delta);
8857
8859 {
8861 {
8863 }
8865 {
8866 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8868 }
8869 }
8870
8871 }
8872
8875 {
8876
8877 }
8878
8881 {
8883 }
8884
8886 {
8887 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8888
8890 {
8891 if (newLevel == GameConstants.STATE_RUINED)
8892 {
8894 EntityAI parent = GetHierarchyParent();
8895 if (parent && parent.IsFireplace())
8896 {
8897 CargoBase cargo = GetInventory().GetCargo();
8898 if (cargo)
8899 {
8901 {
8903 }
8904 }
8905 }
8906 }
8907
8909 {
8910
8912 return;
8913 }
8914
8915 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8916 {
8918 }
8919 }
8920 }
8921
8922
8924 {
8925 super.OnRightClick();
8926
8928 {
8930 {
8931 if (ScriptInputUserData.CanStoreInputUserData())
8932 {
8933 vector m4[4];
8935
8936 EntityAI root = GetHierarchyRoot();
8937
8938 InventoryLocation dst = new InventoryLocation;
8940 {
8941 if (root)
8942 {
8943 root.GetTransform(m4);
8945 }
8946 else
8947 GetInventory().GetCurrentInventoryLocation(dst);
8948 }
8949 else
8950 {
8952
8953
8954 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8955 {
8956 if (root)
8957 {
8958 root.GetTransform(m4);
8960 }
8961 else
8962 GetInventory().GetCurrentInventoryLocation(dst);
8963 }
8964 else
8965 {
8966 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8967 }
8968 }
8969
8970 ScriptInputUserData ctx = new ScriptInputUserData;
8978 }
8979 }
8980 else if (!
GetGame().IsMultiplayer())
8981 {
8983 }
8984 }
8985 }
8986
8987 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8988 {
8989
8990 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8991 return false;
8992
8993 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8994 return false;
8995
8996
8998 return false;
8999
9000
9001 Magazine mag = Magazine.Cast(this);
9002 if (mag)
9003 {
9004 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9005 return false;
9006
9007 if (stack_max_limit)
9008 {
9009 Magazine other_mag = Magazine.Cast(other_item);
9010 if (other_item)
9011 {
9012 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9013 return false;
9014 }
9015
9016 }
9017 }
9018 else
9019 {
9020
9022 return false;
9023
9025 return false;
9026 }
9027
9028 PlayerBase player = null;
9029 if (CastTo(player, GetHierarchyRootPlayer()))
9030 {
9031 if (player.GetInventory().HasAttachment(this))
9032 return false;
9033
9034 if (player.IsItemsToDelete())
9035 return false;
9036 }
9037
9038 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9039 return false;
9040
9041 int slotID;
9043 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9044 return false;
9045
9046 return true;
9047 }
9048
9050 {
9052 }
9053
9055 {
9056 return m_IsResultOfSplit;
9057 }
9058
9060 {
9061 m_IsResultOfSplit = value;
9062 }
9063
9065 {
9067 }
9068
9070 {
9071 float other_item_quantity = other_item.GetQuantity();
9072 float this_free_space;
9073
9075
9077
9078 if (other_item_quantity > this_free_space)
9079 {
9080 return this_free_space;
9081 }
9082 else
9083 {
9084 return other_item_quantity;
9085 }
9086 }
9087
9089 {
9091 }
9092
9094 {
9096 return;
9097
9098 if (!IsMagazine() && other_item)
9099 {
9101 if (quantity_used != 0)
9102 {
9103 float hp1 = GetHealth01("","");
9104 float hp2 = other_item.GetHealth01("","");
9105 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9106 hpResult = hpResult / (
GetQuantity() + quantity_used);
9107
9108 hpResult *= GetMaxHealth();
9109 Math.Round(hpResult);
9110 SetHealth("", "Health", hpResult);
9111
9113 other_item.AddQuantity(-quantity_used);
9114 }
9115 }
9117 }
9118
9120 {
9121 #ifdef SERVER
9122 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9123 GetHierarchyParent().IncreaseLifetimeUp();
9124 #endif
9125 };
9126
9128 {
9129 PlayerBase p = PlayerBase.Cast(player);
9130
9131 array<int> recipesIds = p.m_Recipes;
9132 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9133 if (moduleRecipesManager)
9134 {
9135 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9136 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9137 }
9138
9139 for (int i = 0;i < recipesIds.Count(); i++)
9140 {
9141 int key = recipesIds.Get(i);
9142 string recipeName = moduleRecipesManager.GetRecipeName(key);
9144 }
9145 }
9146
9147
9148 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9149 {
9150 super.GetDebugActions(outputList);
9151
9152
9157
9158
9162
9166
9167
9170
9171
9173 {
9176 }
9177
9179
9182
9186 }
9187
9188
9189
9190
9192 {
9193 super.OnAction(action_id, player, ctx);
9194 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9195 {
9196 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9197 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9198 PlayerBase p = PlayerBase.Cast(player);
9199 if (
EActions.RECIPES_RANGE_START < 1000)
9200 {
9201 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9202 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9203 }
9204 }
9205 #ifndef SERVER
9206 else if (action_id ==
EActions.WATCH_PLAYER)
9207 {
9208 PluginDeveloper.SetDeveloperItemClientEx(player);
9209 }
9210 #endif
9212 {
9213 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9214 {
9215 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9216 OnDebugButtonPressServer(id + 1);
9217 }
9218
9219 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9220 {
9221 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9223 }
9224
9225 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9226 {
9227 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9229 }
9230
9231 else if (action_id ==
EActions.ADD_QUANTITY)
9232 {
9233 if (IsMagazine())
9234 {
9235 Magazine mag = Magazine.Cast(this);
9236 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9237 }
9238 else
9239 {
9241 }
9242
9243 if (m_EM)
9244 {
9245 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9246 }
9247
9248 }
9249
9250 else if (action_id ==
EActions.REMOVE_QUANTITY)
9251 {
9252 if (IsMagazine())
9253 {
9254 Magazine mag2 = Magazine.Cast(this);
9255 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9256 }
9257 else
9258 {
9260 }
9261 if (m_EM)
9262 {
9263 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9264 }
9265
9266 }
9267
9268 else if (action_id ==
EActions.SET_QUANTITY_0)
9269 {
9271
9272 if (m_EM)
9273 {
9274 m_EM.SetEnergy(0);
9275 }
9276 }
9277
9278 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9279 {
9281
9282 if (m_EM)
9283 {
9284 m_EM.SetEnergy(m_EM.GetEnergyMax());
9285 }
9286 }
9287
9288 else if (action_id ==
EActions.ADD_HEALTH)
9289 {
9290 AddHealth("","",GetMaxHealth("","Health")/5);
9291 }
9292 else if (action_id ==
EActions.REMOVE_HEALTH)
9293 {
9294 AddHealth("","",-GetMaxHealth("","Health")/5);
9295 }
9296 else if (action_id ==
EActions.DESTROY_HEALTH)
9297 {
9298 SetHealth01("","",0);
9299 }
9300 else if (action_id ==
EActions.WATCH_ITEM)
9301 {
9303 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9304 #ifdef DEVELOPER
9305 SetDebugDeveloper_item(this);
9306 #endif
9307 }
9308
9309 else if (action_id ==
EActions.ADD_TEMPERATURE)
9310 {
9311 AddTemperature(20);
9312
9313 }
9314
9315 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9316 {
9317 AddTemperature(-20);
9318
9319 }
9320
9321 else if (action_id ==
EActions.FLIP_FROZEN)
9322 {
9323 SetFrozen(!GetIsFrozen());
9324
9325 }
9326
9327 else if (action_id ==
EActions.ADD_WETNESS)
9328 {
9330
9331 }
9332
9333 else if (action_id ==
EActions.REMOVE_WETNESS)
9334 {
9336
9337 }
9338
9339 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9340 {
9343
9344
9345 }
9346
9347 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9348 {
9351 }
9352
9353 else if (action_id ==
EActions.MAKE_SPECIAL)
9354 {
9355 auto debugParams = DebugSpawnParams.WithPlayer(player);
9356 OnDebugSpawnEx(debugParams);
9357 }
9358
9359 else if (action_id ==
EActions.DELETE)
9360 {
9361 Delete();
9362 }
9363
9364 }
9365
9366
9367 return false;
9368 }
9369
9370
9371
9372
9376
9379
9380
9381
9383 {
9384 return false;
9385 }
9386
9387
9389 {
9390 return true;
9391 }
9392
9393
9395 {
9396 return true;
9397 }
9398
9399
9400
9402 {
9403 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9405 }
9406
9409 {
9410 return null;
9411 }
9412
9414 {
9415 return false;
9416 }
9417
9419 {
9420 return false;
9421 }
9422
9426
9427
9429 {
9430 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9431 return module_repairing.CanRepair(this, item_repair_kit);
9432 }
9433
9434
9435 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9436 {
9437 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9438 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9439 }
9440
9441
9443 {
9444
9445
9446
9447
9448
9449
9450
9451
9452 return 1;
9453 }
9454
9455
9456
9458 {
9460 }
9461
9462
9463
9465 {
9467 }
9468
9469
9478 {
9479 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9480
9481 if (player)
9482 {
9483 player.MessageStatus(text);
9484 }
9485 }
9486
9487
9496 {
9497 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9498
9499 if (player)
9500 {
9501 player.MessageAction(text);
9502 }
9503 }
9504
9505
9514 {
9515 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9516
9517 if (player)
9518 {
9519 player.MessageFriendly(text);
9520 }
9521 }
9522
9523
9532 {
9533 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9534
9535 if (player)
9536 {
9537 player.MessageImportant(text);
9538 }
9539 }
9540
9542 {
9543 return true;
9544 }
9545
9546
9547 override bool KindOf(
string tag)
9548 {
9549 bool found = false;
9550 string item_name = this.
GetType();
9553
9554 int array_size = item_tag_array.Count();
9555 for (int i = 0; i < array_size; i++)
9556 {
9557 if (item_tag_array.Get(i) == tag)
9558 {
9559 found = true;
9560 break;
9561 }
9562 }
9563 return found;
9564 }
9565
9566
9568 {
9569
9570 super.OnRPC(sender, rpc_type,ctx);
9571
9572
9573 switch (rpc_type)
9574 {
9575 #ifndef SERVER
9576 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9577 Param2<bool, string> p = new Param2<bool, string>(false, "");
9578
9580 return;
9581
9582 bool play = p.param1;
9583 string soundSet = p.param2;
9584
9585 if (play)
9586 {
9588 {
9590 {
9592 }
9593 }
9594 else
9595 {
9597 }
9598 }
9599 else
9600 {
9602 }
9603
9604 break;
9605 #endif
9606
9607 }
9608
9610 {
9612 }
9613 }
9614
9615
9616
9617
9619 {
9620 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9621 return plugin.GetID(
name);
9622 }
9623
9625 {
9626 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9627 return plugin.GetName(id);
9628 }
9629
9632 {
9633
9634
9635 int varFlags;
9636 if (!ctx.
Read(varFlags))
9637 return;
9638
9639 if (varFlags & ItemVariableFlags.FLOAT)
9640 {
9642 }
9643 }
9644
9646 {
9647
9648 super.SerializeNumericalVars(floats_out);
9649
9650
9651
9653 {
9655 }
9656
9658 {
9660 }
9661
9663 {
9665 }
9666
9668 {
9673 }
9674
9676 {
9678 }
9679 }
9680
9682 {
9683
9684 super.DeSerializeNumericalVars(floats);
9685
9686
9687 int index = 0;
9688 int mask = Math.Round(floats.Get(index));
9689
9690 index++;
9691
9693 {
9695 {
9697 }
9698 else
9699 {
9700 float quantity = floats.Get(index);
9702 }
9703 index++;
9704 }
9705
9707 {
9708 float wet = floats.Get(index);
9710 index++;
9711 }
9712
9714 {
9715 int liquidtype = Math.Round(floats.Get(index));
9717 index++;
9718 }
9719
9721 {
9723 index++;
9725 index++;
9727 index++;
9729 index++;
9730 }
9731
9733 {
9734 int cleanness = Math.Round(floats.Get(index));
9736 index++;
9737 }
9738 }
9739
9741 {
9742 super.WriteVarsToCTX(ctx);
9743
9744
9746 {
9748 }
9749
9751 {
9753 }
9754
9756 {
9758 }
9759
9761 {
9762 int r,g,b,a;
9768 }
9769
9771 {
9773 }
9774 }
9775
9777 {
9778 if (!super.ReadVarsFromCTX(ctx,version))
9779 return false;
9780
9781 int intValue;
9782 float value;
9783
9784 if (version < 140)
9785 {
9786 if (!ctx.
Read(intValue))
9787 return false;
9788
9789 m_VariablesMask = intValue;
9790 }
9791
9793 {
9794 if (!ctx.
Read(value))
9795 return false;
9796
9798 {
9800 }
9801 else
9802 {
9804 }
9805 }
9806
9807 if (version < 140)
9808 {
9810 {
9811 if (!ctx.
Read(value))
9812 return false;
9813 SetTemperatureDirect(value);
9814 }
9815 }
9816
9818 {
9819 if (!ctx.
Read(value))
9820 return false;
9822 }
9823
9825 {
9826 if (!ctx.
Read(intValue))
9827 return false;
9829 }
9830
9832 {
9833 int r,g,b,a;
9835 return false;
9837 return false;
9839 return false;
9841 return false;
9842
9844 }
9845
9847 {
9848 if (!ctx.
Read(intValue))
9849 return false;
9851 }
9852
9853 if (version >= 138 && version < 140)
9854 {
9856 {
9857 if (!ctx.
Read(intValue))
9858 return false;
9859 SetFrozen(intValue);
9860 }
9861 }
9862
9863 return true;
9864 }
9865
9866
9868 {
9871 {
9873 }
9874
9875 if (!super.OnStoreLoad(ctx, version))
9876 {
9878 return false;
9879 }
9880
9881 if (version >= 114)
9882 {
9883 bool hasQuickBarIndexSaved;
9884
9885 if (!ctx.
Read(hasQuickBarIndexSaved))
9886 {
9888 return false;
9889 }
9890
9891 if (hasQuickBarIndexSaved)
9892 {
9893 int itmQBIndex;
9894
9895
9896 if (!ctx.
Read(itmQBIndex))
9897 {
9899 return false;
9900 }
9901
9902 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9903 if (itmQBIndex != -1 && parentPlayer)
9904 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9905 }
9906 }
9907 else
9908 {
9909
9910 PlayerBase player;
9911 int itemQBIndex;
9912 if (version ==
int.
MAX)
9913 {
9914 if (!ctx.
Read(itemQBIndex))
9915 {
9917 return false;
9918 }
9919 }
9920 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9921 {
9922
9923 if (!ctx.
Read(itemQBIndex))
9924 {
9926 return false;
9927 }
9928 if (itemQBIndex != -1 && player)
9929 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9930 }
9931 }
9932
9933 if (version < 140)
9934 {
9935
9936 if (!LoadVariables(ctx, version))
9937 {
9939 return false;
9940 }
9941 }
9942
9943
9945 {
9947 return false;
9948 }
9949 if (version >= 132)
9950 {
9952 if (raib)
9953 {
9955 {
9957 return false;
9958 }
9959 }
9960 }
9961
9963 return true;
9964 }
9965
9966
9967
9969 {
9970 super.OnStoreSave(ctx);
9971
9972 PlayerBase player;
9973 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9974 {
9976
9977 int itemQBIndex = -1;
9978 itemQBIndex = player.FindQuickBarEntityIndex(this);
9979 ctx.
Write(itemQBIndex);
9980 }
9981 else
9982 {
9984 }
9985
9987
9989 if (raib)
9990 {
9992 }
9993 }
9994
9995
9997 {
9998 super.AfterStoreLoad();
9999
10001 {
10003 }
10004
10006 {
10009 }
10010 }
10011
10013 {
10014 super.EEOnAfterLoad();
10015
10017 {
10019 }
10020
10023 }
10024
10026 {
10027 return false;
10028 }
10029
10030
10031
10033 {
10035 {
10036 #ifdef PLATFORM_CONSOLE
10037
10039 {
10041 if (menu)
10042 {
10044 }
10045 }
10046 #endif
10047 }
10048
10050 {
10053 }
10054
10056 {
10057 SetWeightDirty();
10059 }
10061 {
10064 }
10065
10067 {
10070 }
10072 {
10075 }
10076
10077 super.OnVariablesSynchronized();
10078 }
10079
10080
10081
10083 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10084 {
10085 if (!IsServerCheck(allow_client))
10086 return false;
10087
10089 return false;
10090
10093
10094 if (value <= (min + 0.001))
10095 value = min;
10096
10097 if (value == min)
10098 {
10099 if (destroy_config)
10100 {
10101 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10102 if (dstr)
10103 {
10105 this.Delete();
10106 return true;
10107 }
10108 }
10109 else if (destroy_forced)
10110 {
10112 this.Delete();
10113 return true;
10114 }
10115
10117 }
10118
10121
10123 {
10125
10126 if (delta)
10128 }
10129
10131
10132 return false;
10133 }
10134
10135
10137 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10138 {
10140 }
10141
10143 {
10146 }
10147
10149 {
10152 }
10153
10156 {
10157 float value_clamped = Math.Clamp(value, 0, 1);
10159 SetQuantity(result, destroy_config, destroy_forced);
10160 }
10161
10162
10165 {
10167 }
10168
10170 {
10172 }
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10184 {
10185 int slot = -1;
10186 if (GetInventory())
10187 {
10188 InventoryLocation il = new InventoryLocation;
10189 GetInventory().GetCurrentInventoryLocation(il);
10191 }
10192
10194 }
10195
10197 {
10198 float quantity_max = 0;
10199
10201 {
10202 if (attSlotID != -1)
10203 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10204
10205 if (quantity_max <= 0)
10207 }
10208
10209 if (quantity_max <= 0)
10211
10212 return quantity_max;
10213 }
10214
10216 {
10218 }
10219
10221 {
10223 }
10224
10225
10227 {
10229 }
10230
10232 {
10234 }
10235
10237 {
10239 }
10240
10241
10243 {
10244
10245 float weightEx = GetWeightEx();
10246 float special = GetInventoryAndCargoWeight();
10247 return weightEx - special;
10248 }
10249
10250
10252 {
10254 }
10255
10257 {
10259 {
10260 #ifdef DEVELOPER
10261 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10262 {
10263 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10265 }
10266 #endif
10267
10268 return GetQuantity() * GetConfigWeightModified();
10269 }
10270 else if (HasEnergyManager())
10271 {
10272 #ifdef DEVELOPER
10273 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10274 {
10275 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10276 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10277 }
10278 #endif
10279 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10280 }
10281 else
10282 {
10283 #ifdef DEVELOPER
10284 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10285 {
10286 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10287 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10288 }
10289 #endif
10290 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10291 }
10292 }
10293
10296 {
10297 int item_count = 0;
10299
10300 if (GetInventory().GetCargo() != NULL)
10301 {
10302 item_count = GetInventory().GetCargo().GetItemCount();
10303 }
10304
10305 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10306 {
10307 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10308 if (item)
10309 item_count += item.GetNumberOfItems();
10310 }
10311 return item_count;
10312 }
10313
10316 {
10317 float weight = 0;
10318 float wetness = 1;
10319 if (include_wetness)
10322 {
10323 weight = wetness * m_ConfigWeight;
10324 }
10326 {
10327 weight = 1;
10328 }
10329 return weight;
10330 }
10331
10332
10333
10335 {
10336 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10337 {
10338 GameInventory inv = GetInventory();
10339 array<EntityAI> items = new array<EntityAI>;
10341 for (int i = 0; i < items.Count(); i++)
10342 {
10344 if (item)
10345 {
10347 }
10348 }
10349 }
10350 }
10351
10352
10353
10354
10356 {
10357 float energy = 0;
10358 if (HasEnergyManager())
10359 {
10360 energy = GetCompEM().GetEnergy();
10361 }
10362 return energy;
10363 }
10364
10365
10367 {
10368 super.OnEnergyConsumed();
10369
10371 }
10372
10374 {
10375 super.OnEnergyAdded();
10376
10378 }
10379
10380
10382 {
10383 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10384 {
10386 {
10387 float energy_0to1 = GetCompEM().GetEnergy0To1();
10389 }
10390 }
10391 }
10392
10393
10395 {
10396 return ConfigGetFloat("heatIsolation");
10397 }
10398
10400 {
10402 }
10403
10405 {
10406 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10407 if (
GetGame().ConfigIsExisting(paramPath))
10409
10410 return 0.0;
10411 }
10412
10414 {
10415 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10416 if (
GetGame().ConfigIsExisting(paramPath))
10418
10419 return 0.0;
10420 }
10421
10422 override void SetWet(
float value,
bool allow_client =
false)
10423 {
10424 if (!IsServerCheck(allow_client))
10425 return;
10426
10429
10431
10432 m_VarWet = Math.Clamp(value, min, max);
10433
10435 {
10438 }
10439 }
10440
10441 override void AddWet(
float value)
10442 {
10444 }
10445
10447 {
10449 }
10450
10452 {
10454 }
10455
10457 {
10459 }
10460
10462 {
10464 }
10465
10467 {
10469 }
10470
10471 override void OnWetChanged(
float newVal,
float oldVal)
10472 {
10475 if (newLevel != oldLevel)
10476 {
10478 }
10479 }
10480
10482 {
10483 SetWeightDirty();
10484 }
10485
10487 {
10488 return GetWetLevelInternal(
m_VarWet);
10489 }
10490
10491
10492
10494 {
10496 }
10497
10499 {
10501 }
10502
10504 {
10506 }
10507
10509 {
10511 }
10512
10513
10514
10516 {
10517 if (ConfigIsExisting("itemModelLength"))
10518 {
10519 return ConfigGetFloat("itemModelLength");
10520 }
10521 return 0;
10522 }
10523
10525 {
10526 if (ConfigIsExisting("itemAttachOffset"))
10527 {
10528 return ConfigGetFloat("itemAttachOffset");
10529 }
10530 return 0;
10531 }
10532
10533 override void SetCleanness(
int value,
bool allow_client =
false)
10534 {
10535 if (!IsServerCheck(allow_client))
10536 return;
10537
10539
10541
10544 }
10545
10547 {
10549 }
10550
10552 {
10553 return true;
10554 }
10555
10556
10557
10558
10560 {
10562 }
10563
10565 {
10567 }
10568
10569
10570
10571
10572 override void SetColor(
int r,
int g,
int b,
int a)
10573 {
10579 }
10581 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10582 {
10587 }
10588
10590 {
10592 }
10593
10596 {
10597 int r,g,b,a;
10599 r = r/255;
10600 g = g/255;
10601 b = b/255;
10602 a = a/255;
10603 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10604 }
10605
10606
10607
10608 override void SetLiquidType(
int value,
bool allow_client =
false)
10609 {
10610 if (!IsServerCheck(allow_client))
10611 return;
10612
10617 }
10618
10620 {
10621 return ConfigGetInt("varLiquidTypeInit");
10622 }
10623
10625 {
10627 }
10628
10630 {
10632 SetFrozen(false);
10633 }
10634
10637 {
10638 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10639 }
10640
10641
10644 {
10645 PlayerBase nplayer;
10646 if (PlayerBase.CastTo(nplayer, player))
10647 {
10649
10650 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10651 }
10652 }
10653
10654
10657 {
10658 PlayerBase nplayer;
10659 if (PlayerBase.CastTo(nplayer,player))
10660 {
10661
10662 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10663
10664 }
10665
10666
10667 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10668
10669
10670 if (HasEnergyManager())
10671 {
10672 GetCompEM().UpdatePlugState();
10673 }
10674 }
10675
10676
10678 {
10679 super.OnPlacementStarted(player);
10680
10682 }
10683
10684 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10685 {
10687 {
10688 m_AdminLog.OnPlacementComplete(player,
this);
10689 }
10690
10691 super.OnPlacementComplete(player, position, orientation);
10692 }
10693
10694
10695
10696
10697
10699 {
10701 {
10702 return true;
10703 }
10704 else
10705 {
10706 return false;
10707 }
10708 }
10709
10710
10712 {
10714 {
10716 }
10717 }
10718
10719
10721 {
10723 }
10724
10726 {
10728 }
10729
10730 override void InsertAgent(
int agent,
float count = 1)
10731 {
10732 if (count < 1)
10733 return;
10734
10736 }
10737
10740 {
10742 }
10743
10744
10746 {
10748 }
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10792 {
10794 return false;
10795 return true;
10796 }
10797
10799 {
10800
10802 }
10803
10804
10807 {
10808 super.CheckForRoofLimited(timeTresholdMS);
10809
10811 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10812 {
10813 m_PreviousRoofTestTime = time;
10814 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10815 }
10816 }
10817
10818
10820 {
10822 {
10823 return 0;
10824 }
10825
10826 if (GetInventory().GetAttachmentSlotsCount() != 0)
10827 {
10828 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10829 if (filter)
10830 return filter.GetProtectionLevel(type, false, system);
10831 else
10832 return 0;
10833 }
10834
10835 string subclassPath, entryName;
10836
10837 switch (type)
10838 {
10840 entryName = "biological";
10841 break;
10843 entryName = "chemical";
10844 break;
10845 default:
10846 entryName = "biological";
10847 break;
10848 }
10849
10850 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10851
10853 }
10854
10855
10856
10859 {
10860 if (!IsMagazine())
10862
10864 }
10865
10866
10867
10868
10869
10874 {
10875 return true;
10876 }
10877
10879 {
10881 }
10882
10883
10884
10885
10886
10888 {
10889 if (parent)
10890 {
10891 if (parent.IsInherited(DayZInfected))
10892 return true;
10893
10894 if (!parent.IsRuined())
10895 return true;
10896 }
10897
10898 return true;
10899 }
10900
10902 {
10903 if (!super.CanPutAsAttachment(parent))
10904 {
10905 return false;
10906 }
10907
10908 if (!IsRuined() && !parent.IsRuined())
10909 {
10910 return true;
10911 }
10912
10913 return false;
10914 }
10915
10917 {
10918
10919
10920
10921
10922 return super.CanReceiveItemIntoCargo(item);
10923 }
10924
10926 {
10927
10928
10929
10930
10931 GameInventory attachmentInv = attachment.GetInventory();
10933 {
10934 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10935 return false;
10936 }
10937
10938 InventoryLocation loc = new InventoryLocation();
10939 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10940 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10941 return false;
10942
10943 return super.CanReceiveAttachment(attachment, slotId);
10944 }
10945
10947 {
10948 if (!super.CanReleaseAttachment(attachment))
10949 return false;
10950
10951 return GetInventory().AreChildrenAccessible();
10952 }
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10975 {
10976 int id = muzzle_owner.GetMuzzleID();
10977 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10978
10979 if (WPOF_array)
10980 {
10981 for (int i = 0; i < WPOF_array.Count(); i++)
10982 {
10983 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10984
10985 if (WPOF)
10986 {
10987 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10988 }
10989 }
10990 }
10991 }
10992
10993
10995 {
10996 int id = muzzle_owner.GetMuzzleID();
10998
10999 if (WPOBE_array)
11000 {
11001 for (int i = 0; i < WPOBE_array.Count(); i++)
11002 {
11003 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11004
11005 if (WPOBE)
11006 {
11007 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11008 }
11009 }
11010 }
11011 }
11012
11013
11015 {
11016 int id = muzzle_owner.GetMuzzleID();
11017 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11018
11019 if (WPOOH_array)
11020 {
11021 for (int i = 0; i < WPOOH_array.Count(); i++)
11022 {
11023 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11024
11025 if (WPOOH)
11026 {
11027 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11028 }
11029 }
11030 }
11031 }
11032
11033
11035 {
11036 int id = muzzle_owner.GetMuzzleID();
11037 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11038
11039 if (WPOOH_array)
11040 {
11041 for (int i = 0; i < WPOOH_array.Count(); i++)
11042 {
11043 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11044
11045 if (WPOOH)
11046 {
11047 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11048 }
11049 }
11050 }
11051 }
11052
11053
11055 {
11056 int id = muzzle_owner.GetMuzzleID();
11057 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11058
11059 if (WPOOH_array)
11060 {
11061 for (int i = 0; i < WPOOH_array.Count(); i++)
11062 {
11063 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11064
11065 if (WPOOH)
11066 {
11067 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11068 }
11069 }
11070 }
11071 }
11072
11073
11074
11076 {
11078 {
11079 return true;
11080 }
11081
11082 return false;
11083 }
11084
11086 {
11088 {
11089 return true;
11090 }
11091
11092 return false;
11093 }
11094
11096 {
11098 {
11099 return true;
11100 }
11101
11102 return false;
11103 }
11104
11106 {
11107 return false;
11108 }
11109
11112 {
11113 return UATimeSpent.DEFAULT_DEPLOY;
11114 }
11115
11116
11117
11118
11120 {
11122 SetSynchDirty();
11123 }
11124
11126 {
11128 }
11129
11130
11132 {
11133 return false;
11134 }
11135
11138 {
11139 string att_type = "None";
11140
11141 if (ConfigIsExisting("soundAttType"))
11142 {
11143 att_type = ConfigGetString("soundAttType");
11144 }
11145
11147 }
11148
11150 {
11152 }
11153
11154
11155
11156
11157
11161
11163 {
11166
11168 }
11169
11170
11172 {
11174 return;
11175
11177
11180
11183
11184 SoundParameters params = new SoundParameters();
11188 }
11189
11190
11192 {
11194 return;
11195
11197 SetSynchDirty();
11198
11201 }
11202
11203
11205 {
11207 return;
11208
11210 SetSynchDirty();
11211
11214 }
11215
11217 {
11219 }
11220
11222 {
11224 }
11225
11228 {
11229 if (!
GetGame().IsDedicatedServer())
11230 {
11231 if (ConfigIsExisting("attachSoundSet"))
11232 {
11233 string cfg_path = "";
11234 string soundset = "";
11235 string type_name =
GetType();
11236
11239 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11240 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11241
11242 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11243 {
11244 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11245 {
11246 if (cfg_slot_array[i] == slot_type)
11247 {
11248 soundset = cfg_soundset_array[i];
11249 break;
11250 }
11251 }
11252 }
11253
11254 if (soundset != "")
11255 {
11256 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11258 }
11259 }
11260 }
11261 }
11262
11264 {
11265
11266 }
11267
11268 void OnApply(PlayerBase player);
11269
11271 {
11272 return 1.0;
11273 };
11274
11276 {
11278 }
11279
11281 {
11283 }
11284
11286
11288 {
11289 SetDynamicPhysicsLifeTime(0.01);
11291 }
11292
11294 {
11295 array<string> zone_names = new array<string>;
11296 GetDamageZones(zone_names);
11297 for (int i = 0; i < zone_names.Count(); i++)
11298 {
11299 SetHealthMax(zone_names.Get(i),"Health");
11300 }
11301 SetHealthMax("","Health");
11302 }
11303
11306 {
11307 float global_health = GetHealth01("","Health");
11308 array<string> zones = new array<string>;
11309 GetDamageZones(zones);
11310
11311 for (int i = 0; i < zones.Count(); i++)
11312 {
11313 SetHealth01(zones.Get(i),"Health",global_health);
11314 }
11315 }
11316
11319 {
11320 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11321 }
11322
11324 {
11325 if (!hasRootAsPlayer)
11326 {
11327 if (refParentIB)
11328 {
11329
11330 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11331 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11332
11333 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11334 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11335
11338 }
11339 else
11340 {
11341
11344 }
11345 }
11346 }
11347
11349 {
11351 {
11352 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11353 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11354 {
11355 float heatPermCoef = 1.0;
11357 while (ent)
11358 {
11359 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11360 ent = ent.GetHierarchyParent();
11361 }
11362
11363 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11364 }
11365 }
11366 }
11367
11369 {
11370
11371 EntityAI parent = GetHierarchyParent();
11372 if (!parent)
11373 {
11374 hasParent = false;
11375 hasRootAsPlayer = false;
11376 }
11377 else
11378 {
11379 hasParent = true;
11380 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11381 refParentIB =
ItemBase.Cast(parent);
11382 }
11383 }
11384
11385 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11386 {
11387
11388 }
11389
11391 {
11392
11393 return false;
11394 }
11395
11397 {
11398
11399
11400 return false;
11401 }
11402
11404 {
11405
11406 return false;
11407 }
11408
11411 {
11412 return !GetIsFrozen() &&
IsOpen();
11413 }
11414
11416 {
11417 bool hasParent = false, hasRootAsPlayer = false;
11419
11420 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11421 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11422
11423 if (wwtu || foodDecay)
11424 {
11428
11429 if (processWetness || processTemperature || processDecay)
11430 {
11432
11433 if (processWetness)
11434 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11435
11436 if (processTemperature)
11438
11439 if (processDecay)
11440 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11441 }
11442 }
11443 }
11444
11447 {
11449 }
11450
11452 {
11455
11456 return super.GetTemperatureFreezeThreshold();
11457 }
11458
11460 {
11463
11464 return super.GetTemperatureThawThreshold();
11465 }
11466
11468 {
11471
11472 return super.GetItemOverheatThreshold();
11473 }
11474
11476 {
11478 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11479
11480 return super.GetTemperatureFreezeTime();
11481 }
11482
11484 {
11486 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11487
11488 return super.GetTemperatureThawTime();
11489 }
11490
11495
11497 {
11498 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11499 }
11500
11502 {
11503 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11504 }
11505
11508 {
11510 }
11511
11513 {
11515 }
11516
11518 {
11520 }
11521
11524 {
11525 return null;
11526 }
11527
11530 {
11531 return false;
11532 }
11533
11535 {
11537 {
11540 if (!trg)
11541 {
11543 explosive = this;
11544 }
11545
11546 explosive.PairRemote(trg);
11548
11549 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11550 trg.SetPersistentPairID(persistentID);
11551 explosive.SetPersistentPairID(persistentID);
11552
11553 return true;
11554 }
11555 return false;
11556 }
11557
11560 {
11561 float ret = 1.0;
11564 ret *= GetHealth01();
11565
11566 return ret;
11567 }
11568
11569 #ifdef DEVELOPER
11570 override void SetDebugItem()
11571 {
11572 super.SetDebugItem();
11573 _itemBase = this;
11574 }
11575
11577 {
11578 string text = super.GetDebugText();
11579
11581 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11582
11583 return text;
11584 }
11585 #endif
11586
11588 {
11589 return true;
11590 }
11591
11593
11595
11597 {
11600 }
11601
11602
11610
11626}
11627
11629{
11631 if (entity)
11632 {
11633 bool is_item = entity.IsInherited(
ItemBase);
11634 if (is_item && full_quantity)
11635 {
11638 }
11639 }
11640 else
11641 {
11643 return NULL;
11644 }
11645 return entity;
11646}
11647
11649{
11650 if (item)
11651 {
11652 if (health > 0)
11653 item.SetHealth("", "", health);
11654
11655 if (item.CanHaveTemperature())
11656 {
11658 if (item.CanFreeze())
11659 item.SetFrozen(false);
11660 }
11661
11662 if (item.HasEnergyManager())
11663 {
11664 if (quantity >= 0)
11665 {
11666 item.GetCompEM().SetEnergy0To1(quantity);
11667 }
11668 else
11669 {
11671 }
11672 }
11673 else if (item.IsMagazine())
11674 {
11675 Magazine mag = Magazine.Cast(item);
11676 if (quantity >= 0)
11677 {
11678 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11679 }
11680 else
11681 {
11683 }
11684
11685 }
11686 else
11687 {
11688 if (quantity >= 0)
11689 {
11690 item.SetQuantityNormalized(quantity, false);
11691 }
11692 else
11693 {
11695 }
11696
11697 }
11698 }
11699}
11700
11701#ifdef DEVELOPER
11703#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.