6986{
6988 {
6989 return true;
6990 }
6991};
6992
6993
6994
6996{
7000
7002
7005
7006
7007
7008
7009
7018
7024
7029
7034
7055 protected bool m_IsResultOfSplit
7056
7058
7063
7064
7065
7067
7071
7072
7073
7075
7078
7079
7080
7086
7087
7095
7098
7099
7101
7102
7104
7105
7110
7111
7116
7117
7119
7120
7122 {
7127
7128 if (!
GetGame().IsDedicatedServer())
7129 {
7131 {
7133
7135 {
7137 }
7138 }
7139
7142 }
7143
7144 m_OldLocation = null;
7145
7147 {
7149 }
7150
7151 if (ConfigIsExisting("headSelectionsToHide"))
7152 {
7155 }
7156
7158 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7159 {
7161 }
7162
7164
7165 m_IsResultOfSplit = false;
7166
7168 }
7169
7171 {
7172 super.InitItemVariables();
7173
7179 m_Count = ConfigGetInt(
"count");
7180
7183
7188
7191
7196
7208
7212
7213
7216 if (ConfigIsExisting("canBeSplit"))
7217 {
7220 }
7221
7223 if (ConfigIsExisting("itemBehaviour"))
7225
7226
7229 RegisterNetSyncVariableInt("m_VarLiquidType");
7230 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7231
7232 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7233 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7234 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7235
7236 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7237 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7238 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7239 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7240
7241 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7242 RegisterNetSyncVariableBool("m_IsTakeable");
7243 RegisterNetSyncVariableBool("m_IsHologram");
7244
7247 {
7250 }
7251
7253
7255 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7257
7258 }
7259
7261 {
7263 }
7264
7266 {
7269 {
7274 }
7275 }
7276
7277 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7278 {
7280 {
7283 }
7284
7286 }
7287
7289 {
7295 }
7296
7298
7300 {
7302
7303 if (!action)
7304 {
7305 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7306 return;
7307 }
7308
7310 if (!ai)
7311 {
7313 return;
7314 }
7315
7317 if (!action_array)
7318 {
7319 action_array = new array<ActionBase_Basic>;
7321 }
7322 if (LogManager.IsActionLogEnable())
7323 {
7324 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7325 }
7326
7327 if (action_array.Find(action) != -1)
7328 {
7329 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7330 }
7331 else
7332 {
7333 action_array.Insert(action);
7334 }
7335 }
7336
7338 {
7340 ActionBase action = player.GetActionManager().GetAction(actionName);
7343
7344 if (action_array)
7345 {
7346 action_array.RemoveItem(action);
7347 }
7348 }
7349
7350
7351
7353 {
7354 ActionOverrideData overrideData = new ActionOverrideData();
7358
7360 if (!actionMap)
7361 {
7364 }
7365
7366 actionMap.Insert(this.
Type(), overrideData);
7367
7368 }
7369
7371
7373
7374
7376 {
7379
7382
7383 string config_to_search = "CfgVehicles";
7384 string muzzle_owner_config;
7385
7387 {
7388 if (IsInherited(Weapon))
7389 config_to_search = "CfgWeapons";
7390
7391 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7392
7393 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7394
7396
7397 if (config_OnFire_subclass_count > 0)
7398 {
7399 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7400
7401 for (int i = 0; i < config_OnFire_subclass_count; i++)
7402 {
7403 string particle_class = "";
7405 string config_OnFire_entry = config_OnFire_class + particle_class;
7406 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7407 WPOF_array.Insert(WPOF);
7408 }
7409
7410
7412 }
7413 }
7414
7416 {
7417 config_to_search = "CfgWeapons";
7418 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7419
7420 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7421
7423
7424 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7425 {
7426 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7427
7428 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7429 {
7430 string particle_class2 = "";
7432 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7433 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7434 WPOBE_array.Insert(WPOBE);
7435 }
7436
7437
7439 }
7440 }
7441 }
7442
7443
7445 {
7448
7450 {
7451 string config_to_search = "CfgVehicles";
7452
7453 if (IsInherited(Weapon))
7454 config_to_search = "CfgWeapons";
7455
7456 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7457 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7458
7459 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7460 {
7461
7463
7465 {
7467 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7469 return;
7470 }
7471
7474
7475
7476
7478 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7479
7480 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7481 {
7482 string particle_class = "";
7484 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7486
7487 if (entry_type == CT_CLASS)
7488 {
7489 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7490 WPOOH_array.Insert(WPOF);
7491 }
7492 }
7493
7494
7496 }
7497 }
7498 }
7499
7501 {
7503 }
7504
7506 {
7508 {
7510
7513
7516
7517 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7518 }
7519 }
7520
7522 {
7524 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7525
7527 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7528
7530 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7531
7533 {
7535 }
7536 }
7537
7539 {
7541 }
7542
7544 {
7547 else
7549
7551 {
7554 }
7555 else
7556 {
7559
7562 }
7563
7565 }
7566
7568 {
7570 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7571 }
7572
7574 {
7576 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7578 }
7579
7581 {
7583 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7584 }
7585
7587 {
7590
7591 OverheatingParticle OP = new OverheatingParticle();
7596
7598 }
7599
7601 {
7604
7605 return -1;
7606 }
7607
7609 {
7611 {
7614
7615 for (int i = count; i > 0; --i)
7616 {
7617 int id = i - 1;
7620
7623
7624 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7625 {
7626 if (p)
7627 {
7630 }
7631 }
7632 }
7633 }
7634 }
7635
7637 {
7639 {
7641 {
7642 int id = i - 1;
7644
7645 if (OP)
7646 {
7648
7649 if (p)
7650 {
7652 }
7653
7654 delete OP;
7655 }
7656 }
7657
7660 }
7661 }
7662
7665 {
7666 return 0.0;
7667 }
7668
7669
7671 {
7672 return 250;
7673 }
7674
7676 {
7677 return 0;
7678 }
7679
7682 {
7684 return true;
7685
7686 return false;
7687 }
7688
7691 {
7694
7696 {
7698 }
7699 else
7700 {
7701
7703 }
7704
7706 }
7707
7714 {
7715 return -1;
7716 }
7717
7718
7719
7720
7722 {
7724 {
7726 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7727
7728 if (r_index >= 0)
7729 {
7730 InventoryLocation r_il = new InventoryLocation;
7731 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7732
7733 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7736 {
7737 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7738 }
7740 {
7741 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7742 }
7743
7744 }
7745
7746 player.GetHumanInventory().ClearUserReservedLocation(this);
7747 }
7748
7751 }
7752
7753
7754
7755
7757 {
7758 return ItemBase.m_DebugActionsMask;
7759 }
7760
7762 {
7763 return ItemBase.m_DebugActionsMask & mask;
7764 }
7765
7767 {
7768 ItemBase.m_DebugActionsMask = mask;
7769 }
7770
7772 {
7773 ItemBase.m_DebugActionsMask |= mask;
7774 }
7775
7777 {
7778 ItemBase.m_DebugActionsMask &= ~mask;
7779 }
7780
7782 {
7784 {
7786 }
7787 else
7788 {
7790 }
7791 }
7792
7793
7795 {
7796 if (GetEconomyProfile())
7797 {
7798 float q_max = GetEconomyProfile().GetQuantityMax();
7799 if (q_max > 0)
7800 {
7801 float q_min = GetEconomyProfile().GetQuantityMin();
7802 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7803
7805 {
7806 ComponentEnergyManager comp = GetCompEM();
7808 {
7810 }
7811 }
7813 {
7815
7816 }
7817
7818 }
7819 }
7820 }
7821
7824 {
7825 EntityAI parent = GetHierarchyParent();
7826
7827 if (parent)
7828 {
7829 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7830 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7831 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7832 }
7833 }
7834
7837 {
7838 EntityAI parent = GetHierarchyParent();
7839
7840 if (parent)
7841 {
7842 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7843 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7844 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7845 }
7846 }
7847
7849 {
7850
7851
7852
7853
7855
7857 {
7858 if (ScriptInputUserData.CanStoreInputUserData())
7859 {
7860 ScriptInputUserData ctx = new ScriptInputUserData;
7866 ctx.
Write(use_stack_max);
7869
7871 {
7872 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7873 }
7874 }
7875 }
7876 else if (!
GetGame().IsMultiplayer())
7877 {
7879 }
7880 }
7881
7883 {
7885 }
7886
7888 {
7890 }
7891
7893 {
7895 }
7896
7898 {
7899
7900 return false;
7901 }
7902
7904 {
7905 return false;
7906 }
7907
7911 {
7912 return false;
7913 }
7914
7916 {
7917 return "";
7918 }
7919
7921
7923 {
7924 return false;
7925 }
7926
7928 {
7929 return true;
7930 }
7931
7932
7933
7935 {
7936 return true;
7937 }
7938
7940 {
7941 return true;
7942 }
7943
7945 {
7946 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7948 }
7949
7951 {
7953 }
7954
7956 {
7958 if (!is_being_placed)
7960 SetSynchDirty();
7961 }
7962
7963
7965
7967 {
7969 }
7970
7972 {
7974 }
7975
7977 {
7978 return 1;
7979 }
7980
7982 {
7983 return false;
7984 }
7985
7987 {
7989 SetSynchDirty();
7990 }
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8027 {
8028 super.OnMovedInsideCargo(container);
8029
8030 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8031 }
8032
8033 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8034 {
8035 super.EEItemLocationChanged(oldLoc,newLoc);
8036
8037 PlayerBase new_player = null;
8038 PlayerBase old_player = null;
8039
8040 if (newLoc.GetParent())
8041 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8042
8043 if (oldLoc.GetParent())
8044 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8045
8047 {
8048 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8049
8050 if (r_index >= 0)
8051 {
8052 InventoryLocation r_il = new InventoryLocation;
8053 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8054
8055 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8058 {
8059 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8060 }
8062 {
8063 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8064 }
8065
8066 }
8067 }
8068
8070 {
8071 if (new_player)
8072 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8073
8074 if (new_player == old_player)
8075 {
8076
8077 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8078 {
8080 {
8081 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8082 {
8083 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8084 }
8085 }
8086 else
8087 {
8088 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8089 }
8090 }
8091
8092 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8093 {
8094 int type = oldLoc.GetType();
8096 {
8097 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8098 }
8100 {
8101 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8102 }
8103 }
8104 if (!m_OldLocation)
8105 {
8106 m_OldLocation = new InventoryLocation;
8107 }
8108 m_OldLocation.Copy(oldLoc);
8109 }
8110 else
8111 {
8112 if (m_OldLocation)
8113 {
8114 m_OldLocation.Reset();
8115 }
8116 }
8117
8119 }
8120 else
8121 {
8122 if (new_player)
8123 {
8124 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8125 if (res_index >= 0)
8126 {
8127 InventoryLocation il = new InventoryLocation;
8128 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8130 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8133 {
8134 il.
GetParent().GetOnReleaseLock().Invoke(it);
8135 }
8137 {
8139 }
8140
8141 }
8142 }
8144 {
8145
8147 }
8148
8149 if (m_OldLocation)
8150 {
8151 m_OldLocation.Reset();
8152 }
8153 }
8154 }
8155
8156 override void EOnContact(IEntity other, Contact extra)
8157 {
8159 {
8160 int liquidType = -1;
8162 if (impactSpeed > 0.0)
8163 {
8165 #ifndef SERVER
8167 #else
8169 SetSynchDirty();
8170 #endif
8172 }
8173 }
8174
8175 #ifdef SERVER
8176 if (GetCompEM() && GetCompEM().IsPlugged())
8177 {
8178 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8179 GetCompEM().UnplugThis();
8180 }
8181 #endif
8182 }
8183
8185
8187 {
8189 }
8190
8192 {
8193
8194 }
8195
8197 {
8198 super.OnItemLocationChanged(old_owner, new_owner);
8199
8200 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8201 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8202
8203 if (!relatedPlayer && playerNew)
8204 relatedPlayer = playerNew;
8205
8206 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8207 {
8209 if (actionMgr)
8210 {
8211 ActionBase currentAction = actionMgr.GetRunningAction();
8212 if (currentAction)
8214 }
8215 }
8216
8217 Man ownerPlayerOld = null;
8218 Man ownerPlayerNew = null;
8219
8220 if (old_owner)
8221 {
8222 if (old_owner.
IsMan())
8223 {
8224 ownerPlayerOld = Man.Cast(old_owner);
8225 }
8226 else
8227 {
8228 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8229 }
8230 }
8231 else
8232 {
8234 {
8236
8237 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8238 {
8239 GetCompEM().UnplugThis();
8240 }
8241 }
8242 }
8243
8244 if (new_owner)
8245 {
8246 if (new_owner.
IsMan())
8247 {
8248 ownerPlayerNew = Man.Cast(new_owner);
8249 }
8250 else
8251 {
8252 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8253 }
8254 }
8255
8256 if (ownerPlayerOld != ownerPlayerNew)
8257 {
8258 if (ownerPlayerOld)
8259 {
8260 array<EntityAI> subItemsExit = new array<EntityAI>;
8262 for (int i = 0; i < subItemsExit.Count(); i++)
8263 {
8266 }
8267 }
8268
8269 if (ownerPlayerNew)
8270 {
8271 array<EntityAI> subItemsEnter = new array<EntityAI>;
8273 for (int j = 0; j < subItemsEnter.Count(); j++)
8274 {
8277 }
8278 }
8279 }
8280 else if (ownerPlayerNew != null)
8281 {
8282 PlayerBase nplayer;
8283 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8284 {
8285 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8287 for (int k = 0; k < subItemsUpdate.Count(); k++)
8288 {
8290 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8291 }
8292 }
8293 }
8294
8295 if (old_owner)
8296 old_owner.OnChildItemRemoved(this);
8297 if (new_owner)
8298 new_owner.OnChildItemReceived(this);
8299 }
8300
8301
8303 {
8304 super.EEDelete(parent);
8305 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8306 if (player)
8307 {
8309
8310 if (player.IsAlive())
8311 {
8312 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8313 if (r_index >= 0)
8314 {
8315 InventoryLocation r_il = new InventoryLocation;
8316 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8317
8318 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8321 {
8322 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8323 }
8325 {
8326 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8327 }
8328
8329 }
8330
8331 player.RemoveQuickBarEntityShortcut(this);
8332 }
8333 }
8334 }
8335
8337 {
8338 super.EEKilled(killer);
8339
8342 {
8343 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8344 {
8345 if (IsMagazine())
8346 {
8347 if (Magazine.Cast(this).GetAmmoCount() > 0)
8348 {
8350 }
8351 }
8352 else
8353 {
8355 }
8356 }
8357 }
8358 }
8359
8361 {
8362 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8363
8364 super.OnWasAttached(parent, slot_id);
8365
8368
8370 }
8371
8373 {
8374 super.OnWasDetached(parent, slot_id);
8375
8378 }
8379
8381 {
8382 int idx;
8385
8386 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8387 if (inventory_slots.Count() < 1)
8388 {
8389 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8390 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8391 }
8392 else
8393 {
8394 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8395 }
8396
8397 idx = inventory_slots.Find(slot);
8398 if (idx < 0)
8399 return "";
8400
8401 return attach_types.Get(idx);
8402 }
8403
8405 {
8406 int idx = -1;
8407 string slot;
8408
8411
8412 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8413 if (inventory_slots.Count() < 1)
8414 {
8415 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8416 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8417 }
8418 else
8419 {
8420 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8421 if (detach_types.Count() < 1)
8422 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8423 }
8424
8425 for (int i = 0; i < inventory_slots.Count(); i++)
8426 {
8427 slot = inventory_slots.Get(i);
8428 }
8429
8430 if (slot != "")
8431 {
8432 if (detach_types.Count() == 1)
8433 idx = 0;
8434 else
8435 idx = inventory_slots.Find(slot);
8436 }
8437 if (idx < 0)
8438 return "";
8439
8440 return detach_types.Get(idx);
8441 }
8442
8444 {
8445
8447
8448
8449 float min_time = 1;
8450 float max_time = 3;
8451 float delay = Math.RandomFloat(min_time, max_time);
8452
8453 explode_timer.Run(delay, this, "DoAmmoExplosion");
8454 }
8455
8457 {
8458 Magazine magazine = Magazine.Cast(this);
8459 int pop_sounds_count = 6;
8460 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8461
8462
8463 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8464 string sound_name = pop_sounds[ sound_idx ];
8466
8467
8468 magazine.ServerAddAmmoCount(-1);
8469
8470
8471 float min_temp_to_explode = 100;
8472
8473 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8474 {
8476 }
8477 }
8478
8479
8480 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8481 {
8482 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8483
8484 const int CHANCE_DAMAGE_CARGO = 4;
8485 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8486 const int CHANCE_DAMAGE_NOTHING = 2;
8487
8489 {
8490 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8491 int chances;
8492 int rnd;
8493
8494 if (GetInventory().GetCargo())
8495 {
8496 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8497 rnd = Math.RandomInt(0,chances);
8498
8499 if (rnd < CHANCE_DAMAGE_CARGO)
8500 {
8502 }
8503 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8504 {
8506 }
8507 }
8508 else
8509 {
8510 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8511 rnd = Math.RandomInt(0,chances);
8512
8513 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8514 {
8516 }
8517 }
8518 }
8519 }
8520
8522 {
8523 if (GetInventory().GetCargo())
8524 {
8525 int item_count = GetInventory().GetCargo().GetItemCount();
8526 if (item_count > 0)
8527 {
8528 int random_pick = Math.RandomInt(0, item_count);
8530 if (!item.IsExplosive())
8531 {
8532 item.AddHealth("","",damage);
8533 return true;
8534 }
8535 }
8536 }
8537 return false;
8538 }
8539
8541 {
8542 int attachment_count = GetInventory().AttachmentCount();
8543 if (attachment_count > 0)
8544 {
8545 int random_pick = Math.RandomInt(0, attachment_count);
8546 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8547 if (!attachment.IsExplosive())
8548 {
8549 attachment.AddHealth("","",damage);
8550 return true;
8551 }
8552 }
8553 return false;
8554 }
8555
8557 {
8559 }
8560
8562 {
8564 return GetInventory().CanRemoveEntity();
8565
8566 return false;
8567 }
8568
8570 {
8572 return;
8573
8575 {
8576 if (ScriptInputUserData.CanStoreInputUserData())
8577 {
8578 ScriptInputUserData ctx = new ScriptInputUserData;
8583 ctx.
Write(destination_entity);
8587 }
8588 }
8589 else if (!
GetGame().IsMultiplayer())
8590 {
8592 }
8593 }
8594
8596 {
8598 return;
8599
8600 float split_quantity_new;
8604 InventoryLocation loc = new InventoryLocation;
8605
8606 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8607 {
8609 split_quantity_new = stack_max;
8610 else
8612
8613 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8614 if (new_item)
8615 {
8616 new_item.SetResultOfSplit(true);
8617 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8619 new_item.SetQuantity(split_quantity_new);
8620 }
8621 }
8622 else if (destination_entity && slot_id == -1)
8623 {
8624 if (quantity > stack_max)
8625 split_quantity_new = stack_max;
8626 else
8627 split_quantity_new = quantity;
8628
8630 {
8633 }
8634
8635 if (new_item)
8636 {
8637 new_item.SetResultOfSplit(true);
8638 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8640 new_item.SetQuantity(split_quantity_new);
8641 }
8642 }
8643 else
8644 {
8645 if (stack_max != 0)
8646 {
8648 {
8650 }
8651
8652 if (split_quantity_new == 0)
8653 {
8654 if (!
GetGame().IsMultiplayer())
8655 player.PhysicalPredictiveDropItem(this);
8656 else
8657 player.ServerDropEntity(this);
8658 return;
8659 }
8660
8662
8663 if (new_item)
8664 {
8665 new_item.SetResultOfSplit(true);
8666 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8668 new_item.SetQuantity(stack_max);
8669 new_item.PlaceOnSurface();
8670 }
8671 }
8672 }
8673 }
8674
8676 {
8678 return;
8679
8680 float split_quantity_new;
8684 InventoryLocation loc = new InventoryLocation;
8685
8686 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8687 {
8689 split_quantity_new = stack_max;
8690 else
8692
8693 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8694 if (new_item)
8695 {
8696 new_item.SetResultOfSplit(true);
8697 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8699 new_item.SetQuantity(split_quantity_new);
8700 }
8701 }
8702 else if (destination_entity && slot_id == -1)
8703 {
8704 if (quantity > stack_max)
8705 split_quantity_new = stack_max;
8706 else
8707 split_quantity_new = quantity;
8708
8710 {
8713 }
8714
8715 if (new_item)
8716 {
8717 new_item.SetResultOfSplit(true);
8718 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8720 new_item.SetQuantity(split_quantity_new);
8721 }
8722 }
8723 else
8724 {
8725 if (stack_max != 0)
8726 {
8728 {
8730 }
8731
8733
8734 if (new_item)
8735 {
8736 new_item.SetResultOfSplit(true);
8737 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8739 new_item.SetQuantity(stack_max);
8740 new_item.PlaceOnSurface();
8741 }
8742 }
8743 }
8744 }
8745
8747 {
8749 return;
8750
8752 {
8753 if (ScriptInputUserData.CanStoreInputUserData())
8754 {
8755 ScriptInputUserData ctx = new ScriptInputUserData;
8760 dst.WriteToContext(ctx);
8762 }
8763 }
8764 else if (!
GetGame().IsMultiplayer())
8765 {
8767 }
8768 }
8769
8771 {
8773 return;
8774
8776 {
8777 if (ScriptInputUserData.CanStoreInputUserData())
8778 {
8779 ScriptInputUserData ctx = new ScriptInputUserData;
8784 ctx.
Write(destination_entity);
8790 }
8791 }
8792 else if (!
GetGame().IsMultiplayer())
8793 {
8795 }
8796 }
8797
8799 {
8801 }
8802
8804 {
8806 return this;
8807
8809 float split_quantity_new;
8811 if (dst.IsValid())
8812 {
8813 int slot_id = dst.GetSlot();
8815
8816 if (quantity > stack_max)
8817 split_quantity_new = stack_max;
8818 else
8819 split_quantity_new = quantity;
8820
8822
8823 if (new_item)
8824 {
8825 new_item.SetResultOfSplit(true);
8826 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8829 }
8830
8831 return new_item;
8832 }
8833
8834 return null;
8835 }
8836
8838 {
8840 return;
8841
8843 float split_quantity_new;
8845 if (destination_entity)
8846 {
8848 if (quantity > stackable)
8849 split_quantity_new = stackable;
8850 else
8851 split_quantity_new = quantity;
8852
8853 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8854 if (new_item)
8855 {
8856 new_item.SetResultOfSplit(true);
8857 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8859 new_item.SetQuantity(split_quantity_new);
8860 }
8861 }
8862 }
8863
8865 {
8867 return;
8868
8870 {
8871 if (ScriptInputUserData.CanStoreInputUserData())
8872 {
8873 ScriptInputUserData ctx = new ScriptInputUserData;
8878 ItemBase destination_entity =
this;
8879 ctx.
Write(destination_entity);
8883 }
8884 }
8885 else if (!
GetGame().IsMultiplayer())
8886 {
8888 }
8889 }
8890
8892 {
8894 return;
8895
8897 float split_quantity_new;
8899 if (player)
8900 {
8902 if (quantity > stackable)
8903 split_quantity_new = stackable;
8904 else
8905 split_quantity_new = quantity;
8906
8907 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8908 new_item =
ItemBase.Cast(in_hands);
8909 if (new_item)
8910 {
8911 new_item.SetResultOfSplit(true);
8912 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8914 new_item.SetQuantity(split_quantity_new);
8915 }
8916 }
8917 }
8918
8920 {
8922 return;
8923
8925 float split_quantity_new = Math.Floor(quantity * 0.5);
8926
8928
8929 if (new_item)
8930 {
8931 if (new_item.GetQuantityMax() < split_quantity_new)
8932 {
8933 split_quantity_new = new_item.GetQuantityMax();
8934 }
8935
8936 new_item.SetResultOfSplit(true);
8937 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8938
8940 {
8943 }
8944 else
8945 {
8948 }
8949 }
8950 }
8951
8953 {
8955 return;
8956
8958 float split_quantity_new = Math.Floor(quantity / 2);
8959
8960 InventoryLocation invloc = new InventoryLocation;
8962
8964 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8965
8966 if (new_item)
8967 {
8968 if (new_item.GetQuantityMax() < split_quantity_new)
8969 {
8970 split_quantity_new = new_item.GetQuantityMax();
8971 }
8973 {
8976 }
8977 else
8978 {
8981 }
8982 }
8983 }
8984
8987 {
8988 SetWeightDirty();
8990
8991 if (parent)
8992 parent.OnAttachmentQuantityChangedEx(this, delta);
8993
8995 {
8997 {
8999 }
9001 {
9002 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9004 }
9005 }
9006
9007 }
9008
9011 {
9012
9013 }
9014
9017 {
9019 }
9020
9022 {
9023 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9024
9026 {
9027 if (newLevel == GameConstants.STATE_RUINED)
9028 {
9030 EntityAI parent = GetHierarchyParent();
9031 if (parent && parent.IsFireplace())
9032 {
9033 CargoBase cargo = GetInventory().GetCargo();
9034 if (cargo)
9035 {
9037 {
9039 }
9040 }
9041 }
9042 }
9043
9045 {
9046
9048 return;
9049 }
9050
9051 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9052 {
9054 }
9055 }
9056 }
9057
9058
9060 {
9061 super.OnRightClick();
9062
9064 {
9066 {
9067 if (ScriptInputUserData.CanStoreInputUserData())
9068 {
9069 vector m4[4];
9071
9072 EntityAI root = GetHierarchyRoot();
9073
9074 InventoryLocation dst = new InventoryLocation;
9076 {
9077 if (root)
9078 {
9079 root.GetTransform(m4);
9081 }
9082 else
9083 GetInventory().GetCurrentInventoryLocation(dst);
9084 }
9085 else
9086 {
9088
9089
9090 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9091 {
9092 if (root)
9093 {
9094 root.GetTransform(m4);
9096 }
9097 else
9098 GetInventory().GetCurrentInventoryLocation(dst);
9099 }
9100 else
9101 {
9102 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9103 }
9104 }
9105
9106 ScriptInputUserData ctx = new ScriptInputUserData;
9114 }
9115 }
9116 else if (!
GetGame().IsMultiplayer())
9117 {
9119 }
9120 }
9121 }
9122
9123 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9124 {
9125
9126 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9127 return false;
9128
9129 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9130 return false;
9131
9132
9134 return false;
9135
9136
9137 Magazine mag = Magazine.Cast(this);
9138 if (mag)
9139 {
9140 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9141 return false;
9142
9143 if (stack_max_limit)
9144 {
9145 Magazine other_mag = Magazine.Cast(other_item);
9146 if (other_item)
9147 {
9148 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9149 return false;
9150 }
9151
9152 }
9153 }
9154 else
9155 {
9156
9158 return false;
9159
9161 return false;
9162 }
9163
9164 PlayerBase player = null;
9165 if (CastTo(player, GetHierarchyRootPlayer()))
9166 {
9167 if (player.GetInventory().HasAttachment(this))
9168 return false;
9169
9170 if (player.IsItemsToDelete())
9171 return false;
9172 }
9173
9174 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9175 return false;
9176
9177 int slotID;
9179 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9180 return false;
9181
9182 return true;
9183 }
9184
9186 {
9188 }
9189
9191 {
9192 return m_IsResultOfSplit;
9193 }
9194
9196 {
9197 m_IsResultOfSplit = value;
9198 }
9199
9201 {
9203 }
9204
9206 {
9207 float other_item_quantity = other_item.GetQuantity();
9208 float this_free_space;
9209
9211
9213
9214 if (other_item_quantity > this_free_space)
9215 {
9216 return this_free_space;
9217 }
9218 else
9219 {
9220 return other_item_quantity;
9221 }
9222 }
9223
9225 {
9227 }
9228
9230 {
9232 return;
9233
9234 if (!IsMagazine() && other_item)
9235 {
9237 if (quantity_used != 0)
9238 {
9239 float hp1 = GetHealth01("","");
9240 float hp2 = other_item.GetHealth01("","");
9241 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9242 hpResult = hpResult / (
GetQuantity() + quantity_used);
9243
9244 hpResult *= GetMaxHealth();
9245 Math.Round(hpResult);
9246 SetHealth("", "Health", hpResult);
9247
9249 other_item.AddQuantity(-quantity_used);
9250 }
9251 }
9253 }
9254
9256 {
9257 #ifdef SERVER
9258 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9259 GetHierarchyParent().IncreaseLifetimeUp();
9260 #endif
9261 };
9262
9264 {
9265 PlayerBase p = PlayerBase.Cast(player);
9266
9267 array<int> recipesIds = p.m_Recipes;
9268 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9269 if (moduleRecipesManager)
9270 {
9271 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9272 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9273 }
9274
9275 for (int i = 0;i < recipesIds.Count(); i++)
9276 {
9277 int key = recipesIds.Get(i);
9278 string recipeName = moduleRecipesManager.GetRecipeName(key);
9280 }
9281 }
9282
9283
9284 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9285 {
9286 super.GetDebugActions(outputList);
9287
9288
9293
9294
9298
9302
9303
9306
9307
9309 {
9312 }
9313
9315
9318
9322 }
9323
9324
9325
9326
9328 {
9329 super.OnAction(action_id, player, ctx);
9330 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9331 {
9332 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9333 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9334 PlayerBase p = PlayerBase.Cast(player);
9335 if (
EActions.RECIPES_RANGE_START < 1000)
9336 {
9337 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9338 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9339 }
9340 }
9341 #ifndef SERVER
9342 else if (action_id ==
EActions.WATCH_PLAYER)
9343 {
9344 PluginDeveloper.SetDeveloperItemClientEx(player);
9345 }
9346 #endif
9348 {
9349 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9350 {
9351 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9352 OnDebugButtonPressServer(id + 1);
9353 }
9354
9355 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9356 {
9357 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9359 }
9360
9361 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9362 {
9363 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9365 }
9366
9367 else if (action_id ==
EActions.ADD_QUANTITY)
9368 {
9369 if (IsMagazine())
9370 {
9371 Magazine mag = Magazine.Cast(this);
9372 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9373 }
9374 else
9375 {
9377 }
9378
9379 if (m_EM)
9380 {
9381 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9382 }
9383
9384 }
9385
9386 else if (action_id ==
EActions.REMOVE_QUANTITY)
9387 {
9388 if (IsMagazine())
9389 {
9390 Magazine mag2 = Magazine.Cast(this);
9391 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9392 }
9393 else
9394 {
9396 }
9397 if (m_EM)
9398 {
9399 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9400 }
9401
9402 }
9403
9404 else if (action_id ==
EActions.SET_QUANTITY_0)
9405 {
9407
9408 if (m_EM)
9409 {
9410 m_EM.SetEnergy(0);
9411 }
9412 }
9413
9414 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9415 {
9417
9418 if (m_EM)
9419 {
9420 m_EM.SetEnergy(m_EM.GetEnergyMax());
9421 }
9422 }
9423
9424 else if (action_id ==
EActions.ADD_HEALTH)
9425 {
9426 AddHealth("","",GetMaxHealth("","Health")/5);
9427 }
9428 else if (action_id ==
EActions.REMOVE_HEALTH)
9429 {
9430 AddHealth("","",-GetMaxHealth("","Health")/5);
9431 }
9432 else if (action_id ==
EActions.DESTROY_HEALTH)
9433 {
9434 SetHealth01("","",0);
9435 }
9436 else if (action_id ==
EActions.WATCH_ITEM)
9437 {
9439 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9440 #ifdef DEVELOPER
9441 SetDebugDeveloper_item(this);
9442 #endif
9443 }
9444
9445 else if (action_id ==
EActions.ADD_TEMPERATURE)
9446 {
9447 AddTemperature(20);
9448
9449 }
9450
9451 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9452 {
9453 AddTemperature(-20);
9454
9455 }
9456
9457 else if (action_id ==
EActions.FLIP_FROZEN)
9458 {
9459 SetFrozen(!GetIsFrozen());
9460
9461 }
9462
9463 else if (action_id ==
EActions.ADD_WETNESS)
9464 {
9466
9467 }
9468
9469 else if (action_id ==
EActions.REMOVE_WETNESS)
9470 {
9472
9473 }
9474
9475 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9476 {
9479
9480
9481 }
9482
9483 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9484 {
9487 }
9488
9489 else if (action_id ==
EActions.MAKE_SPECIAL)
9490 {
9491 auto debugParams = DebugSpawnParams.WithPlayer(player);
9492 OnDebugSpawnEx(debugParams);
9493 }
9494
9495 else if (action_id ==
EActions.DELETE)
9496 {
9497 Delete();
9498 }
9499
9500 }
9501
9502
9503 return false;
9504 }
9505
9506
9507
9508
9512
9515
9516
9517
9519 {
9520 return false;
9521 }
9522
9523
9525 {
9526 return true;
9527 }
9528
9529
9531 {
9532 return true;
9533 }
9534
9535
9536
9538 {
9539 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9541 }
9542
9545 {
9546 return null;
9547 }
9548
9550 {
9551 return false;
9552 }
9553
9555 {
9556 return false;
9557 }
9558
9562
9563
9565 {
9566 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9567 return module_repairing.CanRepair(this, item_repair_kit);
9568 }
9569
9570
9571 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9572 {
9573 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9574 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9575 }
9576
9577
9579 {
9580
9581
9582
9583
9584
9585
9586
9587
9588 return 1;
9589 }
9590
9591
9592
9594 {
9596 }
9597
9598
9599
9601 {
9603 }
9604
9605
9614 {
9615 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9616
9617 if (player)
9618 {
9619 player.MessageStatus(text);
9620 }
9621 }
9622
9623
9632 {
9633 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9634
9635 if (player)
9636 {
9637 player.MessageAction(text);
9638 }
9639 }
9640
9641
9650 {
9651 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9652
9653 if (player)
9654 {
9655 player.MessageFriendly(text);
9656 }
9657 }
9658
9659
9668 {
9669 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9670
9671 if (player)
9672 {
9673 player.MessageImportant(text);
9674 }
9675 }
9676
9678 {
9679 return true;
9680 }
9681
9682
9683 override bool KindOf(
string tag)
9684 {
9685 bool found = false;
9686 string item_name = this.
GetType();
9689
9690 int array_size = item_tag_array.Count();
9691 for (int i = 0; i < array_size; i++)
9692 {
9693 if (item_tag_array.Get(i) == tag)
9694 {
9695 found = true;
9696 break;
9697 }
9698 }
9699 return found;
9700 }
9701
9702
9704 {
9705
9706 super.OnRPC(sender, rpc_type,ctx);
9707
9708
9709 switch (rpc_type)
9710 {
9711 #ifndef SERVER
9712 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9713 Param2<bool, string> p = new Param2<bool, string>(false, "");
9714
9716 return;
9717
9718 bool play = p.param1;
9719 string soundSet = p.param2;
9720
9721 if (play)
9722 {
9724 {
9726 {
9728 }
9729 }
9730 else
9731 {
9733 }
9734 }
9735 else
9736 {
9738 }
9739
9740 break;
9741 #endif
9742
9743 }
9744
9746 {
9748 }
9749 }
9750
9751
9752
9753
9755 {
9756 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9757 return plugin.GetID(
name);
9758 }
9759
9761 {
9762 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9763 return plugin.GetName(id);
9764 }
9765
9768 {
9769
9770
9771 int varFlags;
9772 if (!ctx.
Read(varFlags))
9773 return;
9774
9775 if (varFlags & ItemVariableFlags.FLOAT)
9776 {
9778 }
9779 }
9780
9782 {
9783
9784 super.SerializeNumericalVars(floats_out);
9785
9786
9787
9789 {
9791 }
9792
9794 {
9796 }
9797
9799 {
9801 }
9802
9804 {
9809 }
9810
9812 {
9814 }
9815 }
9816
9818 {
9819
9820 super.DeSerializeNumericalVars(floats);
9821
9822
9823 int index = 0;
9824 int mask = Math.Round(floats.Get(index));
9825
9826 index++;
9827
9829 {
9831 {
9833 }
9834 else
9835 {
9836 float quantity = floats.Get(index);
9838 }
9839 index++;
9840 }
9841
9843 {
9844 float wet = floats.Get(index);
9846 index++;
9847 }
9848
9850 {
9851 int liquidtype = Math.Round(floats.Get(index));
9853 index++;
9854 }
9855
9857 {
9859 index++;
9861 index++;
9863 index++;
9865 index++;
9866 }
9867
9869 {
9870 int cleanness = Math.Round(floats.Get(index));
9872 index++;
9873 }
9874 }
9875
9877 {
9878 super.WriteVarsToCTX(ctx);
9879
9880
9882 {
9884 }
9885
9887 {
9889 }
9890
9892 {
9894 }
9895
9897 {
9898 int r,g,b,a;
9904 }
9905
9907 {
9909 }
9910 }
9911
9913 {
9914 if (!super.ReadVarsFromCTX(ctx,version))
9915 return false;
9916
9917 int intValue;
9918 float value;
9919
9920 if (version < 140)
9921 {
9922 if (!ctx.
Read(intValue))
9923 return false;
9924
9925 m_VariablesMask = intValue;
9926 }
9927
9929 {
9930 if (!ctx.
Read(value))
9931 return false;
9932
9934 {
9936 }
9937 else
9938 {
9940 }
9941 }
9942
9943 if (version < 140)
9944 {
9946 {
9947 if (!ctx.
Read(value))
9948 return false;
9949 SetTemperatureDirect(value);
9950 }
9951 }
9952
9954 {
9955 if (!ctx.
Read(value))
9956 return false;
9958 }
9959
9961 {
9962 if (!ctx.
Read(intValue))
9963 return false;
9965 }
9966
9968 {
9969 int r,g,b,a;
9971 return false;
9973 return false;
9975 return false;
9977 return false;
9978
9980 }
9981
9983 {
9984 if (!ctx.
Read(intValue))
9985 return false;
9987 }
9988
9989 if (version >= 138 && version < 140)
9990 {
9992 {
9993 if (!ctx.
Read(intValue))
9994 return false;
9995 SetFrozen(intValue);
9996 }
9997 }
9998
9999 return true;
10000 }
10001
10002
10004 {
10007 {
10009 }
10010
10011 if (!super.OnStoreLoad(ctx, version))
10012 {
10014 return false;
10015 }
10016
10017 if (version >= 114)
10018 {
10019 bool hasQuickBarIndexSaved;
10020
10021 if (!ctx.
Read(hasQuickBarIndexSaved))
10022 {
10024 return false;
10025 }
10026
10027 if (hasQuickBarIndexSaved)
10028 {
10029 int itmQBIndex;
10030
10031
10032 if (!ctx.
Read(itmQBIndex))
10033 {
10035 return false;
10036 }
10037
10038 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10039 if (itmQBIndex != -1 && parentPlayer)
10040 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10041 }
10042 }
10043 else
10044 {
10045
10046 PlayerBase player;
10047 int itemQBIndex;
10048 if (version ==
int.
MAX)
10049 {
10050 if (!ctx.
Read(itemQBIndex))
10051 {
10053 return false;
10054 }
10055 }
10056 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10057 {
10058
10059 if (!ctx.
Read(itemQBIndex))
10060 {
10062 return false;
10063 }
10064 if (itemQBIndex != -1 && player)
10065 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10066 }
10067 }
10068
10069 if (version < 140)
10070 {
10071
10072 if (!LoadVariables(ctx, version))
10073 {
10075 return false;
10076 }
10077 }
10078
10079
10081 {
10083 return false;
10084 }
10085 if (version >= 132)
10086 {
10088 if (raib)
10089 {
10091 {
10093 return false;
10094 }
10095 }
10096 }
10097
10099 return true;
10100 }
10101
10102
10103
10105 {
10106 super.OnStoreSave(ctx);
10107
10108 PlayerBase player;
10109 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10110 {
10112
10113 int itemQBIndex = -1;
10114 itemQBIndex = player.FindQuickBarEntityIndex(this);
10115 ctx.
Write(itemQBIndex);
10116 }
10117 else
10118 {
10120 }
10121
10123
10125 if (raib)
10126 {
10128 }
10129 }
10130
10131
10133 {
10134 super.AfterStoreLoad();
10135
10137 {
10139 }
10140
10142 {
10145 }
10146 }
10147
10149 {
10150 super.EEOnAfterLoad();
10151
10153 {
10155 }
10156
10159 }
10160
10162 {
10163 return false;
10164 }
10165
10166
10167
10169 {
10171 {
10172 #ifdef PLATFORM_CONSOLE
10173
10175 {
10177 if (menu)
10178 {
10180 }
10181 }
10182 #endif
10183 }
10184
10186 {
10189 }
10190
10192 {
10193 SetWeightDirty();
10195 }
10197 {
10200 }
10201
10203 {
10206 }
10208 {
10211 }
10212
10213 super.OnVariablesSynchronized();
10214 }
10215
10216
10217
10219 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10220 {
10221 if (!IsServerCheck(allow_client))
10222 return false;
10223
10225 return false;
10226
10229
10230 if (value <= (min + 0.001))
10231 value = min;
10232
10233 if (value == min)
10234 {
10235 if (destroy_config)
10236 {
10237 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10238 if (dstr)
10239 {
10241 this.Delete();
10242 return true;
10243 }
10244 }
10245 else if (destroy_forced)
10246 {
10248 this.Delete();
10249 return true;
10250 }
10251
10253 }
10254
10257
10259 {
10261
10262 if (delta)
10264 }
10265
10267
10268 return false;
10269 }
10270
10271
10273 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10274 {
10276 }
10277
10279 {
10282 }
10283
10285 {
10288 }
10289
10292 {
10293 float value_clamped = Math.Clamp(value, 0, 1);
10295 SetQuantity(result, destroy_config, destroy_forced);
10296 }
10297
10298
10301 {
10303 }
10304
10306 {
10308 }
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10320 {
10321 int slot = -1;
10322 if (GetInventory())
10323 {
10324 InventoryLocation il = new InventoryLocation;
10325 GetInventory().GetCurrentInventoryLocation(il);
10327 }
10328
10330 }
10331
10333 {
10334 float quantity_max = 0;
10335
10337 {
10338 if (attSlotID != -1)
10339 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10340
10341 if (quantity_max <= 0)
10343 }
10344
10345 if (quantity_max <= 0)
10347
10348 return quantity_max;
10349 }
10350
10352 {
10354 }
10355
10357 {
10359 }
10360
10361
10363 {
10365 }
10366
10368 {
10370 }
10371
10373 {
10375 }
10376
10377
10379 {
10380
10381 float weightEx = GetWeightEx();
10382 float special = GetInventoryAndCargoWeight();
10383 return weightEx - special;
10384 }
10385
10386
10388 {
10390 }
10391
10393 {
10395 {
10396 #ifdef DEVELOPER
10397 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10398 {
10399 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10401 }
10402 #endif
10403
10404 return GetQuantity() * GetConfigWeightModified();
10405 }
10406 else if (HasEnergyManager())
10407 {
10408 #ifdef DEVELOPER
10409 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10410 {
10411 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10412 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10413 }
10414 #endif
10415 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10416 }
10417 else
10418 {
10419 #ifdef DEVELOPER
10420 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10421 {
10422 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10423 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10424 }
10425 #endif
10426 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10427 }
10428 }
10429
10432 {
10433 int item_count = 0;
10435
10436 if (GetInventory().GetCargo() != NULL)
10437 {
10438 item_count = GetInventory().GetCargo().GetItemCount();
10439 }
10440
10441 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10442 {
10443 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10444 if (item)
10445 item_count += item.GetNumberOfItems();
10446 }
10447 return item_count;
10448 }
10449
10452 {
10453 float weight = 0;
10454 float wetness = 1;
10455 if (include_wetness)
10458 {
10459 weight = wetness * m_ConfigWeight;
10460 }
10462 {
10463 weight = 1;
10464 }
10465 return weight;
10466 }
10467
10468
10469
10471 {
10472 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10473 {
10474 GameInventory inv = GetInventory();
10475 array<EntityAI> items = new array<EntityAI>;
10477 for (int i = 0; i < items.Count(); i++)
10478 {
10480 if (item)
10481 {
10483 }
10484 }
10485 }
10486 }
10487
10488
10489
10490
10492 {
10493 float energy = 0;
10494 if (HasEnergyManager())
10495 {
10496 energy = GetCompEM().GetEnergy();
10497 }
10498 return energy;
10499 }
10500
10501
10503 {
10504 super.OnEnergyConsumed();
10505
10507 }
10508
10510 {
10511 super.OnEnergyAdded();
10512
10514 }
10515
10516
10518 {
10519 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10520 {
10522 {
10523 float energy_0to1 = GetCompEM().GetEnergy0To1();
10525 }
10526 }
10527 }
10528
10529
10531 {
10532 return ConfigGetFloat("heatIsolation");
10533 }
10534
10536 {
10538 }
10539
10541 {
10542 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10543 if (
GetGame().ConfigIsExisting(paramPath))
10545
10546 return 0.0;
10547 }
10548
10550 {
10551 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10552 if (
GetGame().ConfigIsExisting(paramPath))
10554
10555 return 0.0;
10556 }
10557
10558 override void SetWet(
float value,
bool allow_client =
false)
10559 {
10560 if (!IsServerCheck(allow_client))
10561 return;
10562
10565
10567
10568 m_VarWet = Math.Clamp(value, min, max);
10569
10571 {
10574 }
10575 }
10576
10577 override void AddWet(
float value)
10578 {
10580 }
10581
10583 {
10585 }
10586
10588 {
10590 }
10591
10593 {
10595 }
10596
10598 {
10600 }
10601
10603 {
10605 }
10606
10607 override void OnWetChanged(
float newVal,
float oldVal)
10608 {
10611 if (newLevel != oldLevel)
10612 {
10614 }
10615 }
10616
10618 {
10619 SetWeightDirty();
10620 }
10621
10623 {
10624 return GetWetLevelInternal(
m_VarWet);
10625 }
10626
10627
10628
10630 {
10632 }
10633
10635 {
10637 }
10638
10640 {
10642 }
10643
10645 {
10647 }
10648
10649
10650
10652 {
10653 if (ConfigIsExisting("itemModelLength"))
10654 {
10655 return ConfigGetFloat("itemModelLength");
10656 }
10657 return 0;
10658 }
10659
10661 {
10662 if (ConfigIsExisting("itemAttachOffset"))
10663 {
10664 return ConfigGetFloat("itemAttachOffset");
10665 }
10666 return 0;
10667 }
10668
10669 override void SetCleanness(
int value,
bool allow_client =
false)
10670 {
10671 if (!IsServerCheck(allow_client))
10672 return;
10673
10675
10677
10680 }
10681
10683 {
10685 }
10686
10688 {
10689 return true;
10690 }
10691
10692
10693
10694
10696 {
10698 }
10699
10701 {
10703 }
10704
10705
10706
10707
10708 override void SetColor(
int r,
int g,
int b,
int a)
10709 {
10715 }
10717 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10718 {
10723 }
10724
10726 {
10728 }
10729
10732 {
10733 int r,g,b,a;
10735 r = r/255;
10736 g = g/255;
10737 b = b/255;
10738 a = a/255;
10739 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10740 }
10741
10742
10743
10744 override void SetLiquidType(
int value,
bool allow_client =
false)
10745 {
10746 if (!IsServerCheck(allow_client))
10747 return;
10748
10753 }
10754
10756 {
10757 return ConfigGetInt("varLiquidTypeInit");
10758 }
10759
10761 {
10763 }
10764
10766 {
10768 SetFrozen(false);
10769 }
10770
10773 {
10774 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10775 }
10776
10777
10780 {
10781 PlayerBase nplayer;
10782 if (PlayerBase.CastTo(nplayer, player))
10783 {
10785
10786 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10787 }
10788 }
10789
10790
10793 {
10794 PlayerBase nplayer;
10795 if (PlayerBase.CastTo(nplayer,player))
10796 {
10797
10798 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10799
10800 }
10801
10802
10803 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10804
10805
10806 if (HasEnergyManager())
10807 {
10808 GetCompEM().UpdatePlugState();
10809 }
10810 }
10811
10812
10814 {
10815 super.OnPlacementStarted(player);
10816
10818 }
10819
10820 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10821 {
10823 {
10824 m_AdminLog.OnPlacementComplete(player,
this);
10825 }
10826
10827 super.OnPlacementComplete(player, position, orientation);
10828 }
10829
10830
10831
10832
10833
10835 {
10837 {
10838 return true;
10839 }
10840 else
10841 {
10842 return false;
10843 }
10844 }
10845
10846
10848 {
10850 {
10852 }
10853 }
10854
10855
10857 {
10859 }
10860
10862 {
10864 }
10865
10866 override void InsertAgent(
int agent,
float count = 1)
10867 {
10868 if (count < 1)
10869 return;
10870
10872 }
10873
10876 {
10878 }
10879
10880
10882 {
10884 }
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10928 {
10930 return false;
10931 return true;
10932 }
10933
10935 {
10936
10938 }
10939
10940
10943 {
10944 super.CheckForRoofLimited(timeTresholdMS);
10945
10947 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10948 {
10949 m_PreviousRoofTestTime = time;
10950 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10951 }
10952 }
10953
10954
10956 {
10958 {
10959 return 0;
10960 }
10961
10962 if (GetInventory().GetAttachmentSlotsCount() != 0)
10963 {
10964 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10965 if (filter)
10966 return filter.GetProtectionLevel(type, false, system);
10967 else
10968 return 0;
10969 }
10970
10971 string subclassPath, entryName;
10972
10973 switch (type)
10974 {
10976 entryName = "biological";
10977 break;
10979 entryName = "chemical";
10980 break;
10981 default:
10982 entryName = "biological";
10983 break;
10984 }
10985
10986 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10987
10989 }
10990
10991
10992
10995 {
10996 if (!IsMagazine())
10998
11000 }
11001
11002
11003
11004
11005
11010 {
11011 return true;
11012 }
11013
11015 {
11017 }
11018
11019
11020
11021
11022
11024 {
11025 if (parent)
11026 {
11027 if (parent.IsInherited(DayZInfected))
11028 return true;
11029
11030 if (!parent.IsRuined())
11031 return true;
11032 }
11033
11034 return true;
11035 }
11036
11038 {
11039 if (!super.CanPutAsAttachment(parent))
11040 {
11041 return false;
11042 }
11043
11044 if (!IsRuined() && !parent.IsRuined())
11045 {
11046 return true;
11047 }
11048
11049 return false;
11050 }
11051
11053 {
11054
11055
11056
11057
11058 return super.CanReceiveItemIntoCargo(item);
11059 }
11060
11062 {
11063
11064
11065
11066
11067 GameInventory attachmentInv = attachment.GetInventory();
11069 {
11070 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11071 return false;
11072 }
11073
11074 InventoryLocation loc = new InventoryLocation();
11075 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11076 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11077 return false;
11078
11079 return super.CanReceiveAttachment(attachment, slotId);
11080 }
11081
11083 {
11084 if (!super.CanReleaseAttachment(attachment))
11085 return false;
11086
11087 return GetInventory().AreChildrenAccessible();
11088 }
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11111 {
11112 int id = muzzle_owner.GetMuzzleID();
11113 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11114
11115 if (WPOF_array)
11116 {
11117 for (int i = 0; i < WPOF_array.Count(); i++)
11118 {
11119 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11120
11121 if (WPOF)
11122 {
11123 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11124 }
11125 }
11126 }
11127 }
11128
11129
11131 {
11132 int id = muzzle_owner.GetMuzzleID();
11134
11135 if (WPOBE_array)
11136 {
11137 for (int i = 0; i < WPOBE_array.Count(); i++)
11138 {
11139 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11140
11141 if (WPOBE)
11142 {
11143 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11144 }
11145 }
11146 }
11147 }
11148
11149
11151 {
11152 int id = muzzle_owner.GetMuzzleID();
11153 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11154
11155 if (WPOOH_array)
11156 {
11157 for (int i = 0; i < WPOOH_array.Count(); i++)
11158 {
11159 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11160
11161 if (WPOOH)
11162 {
11163 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11164 }
11165 }
11166 }
11167 }
11168
11169
11171 {
11172 int id = muzzle_owner.GetMuzzleID();
11173 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11174
11175 if (WPOOH_array)
11176 {
11177 for (int i = 0; i < WPOOH_array.Count(); i++)
11178 {
11179 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11180
11181 if (WPOOH)
11182 {
11183 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11184 }
11185 }
11186 }
11187 }
11188
11189
11191 {
11192 int id = muzzle_owner.GetMuzzleID();
11193 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11194
11195 if (WPOOH_array)
11196 {
11197 for (int i = 0; i < WPOOH_array.Count(); i++)
11198 {
11199 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11200
11201 if (WPOOH)
11202 {
11203 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11204 }
11205 }
11206 }
11207 }
11208
11209
11210
11212 {
11214 {
11215 return true;
11216 }
11217
11218 return false;
11219 }
11220
11222 {
11224 {
11225 return true;
11226 }
11227
11228 return false;
11229 }
11230
11232 {
11234 {
11235 return true;
11236 }
11237
11238 return false;
11239 }
11240
11242 {
11243 return false;
11244 }
11245
11248 {
11249 return UATimeSpent.DEFAULT_DEPLOY;
11250 }
11251
11252
11253
11254
11256 {
11258 SetSynchDirty();
11259 }
11260
11262 {
11264 }
11265
11266
11268 {
11269 return false;
11270 }
11271
11274 {
11275 string att_type = "None";
11276
11277 if (ConfigIsExisting("soundAttType"))
11278 {
11279 att_type = ConfigGetString("soundAttType");
11280 }
11281
11283 }
11284
11286 {
11288 }
11289
11290
11291
11292
11293
11297
11299 {
11302
11304 }
11305
11306
11308 {
11310 return;
11311
11313
11316
11319
11320 SoundParameters params = new SoundParameters();
11324 }
11325
11326
11328 {
11330 return;
11331
11333 SetSynchDirty();
11334
11337 }
11338
11339
11341 {
11343 return;
11344
11346 SetSynchDirty();
11347
11350 }
11351
11353 {
11355 }
11356
11358 {
11360 }
11361
11364 {
11365 if (!
GetGame().IsDedicatedServer())
11366 {
11367 if (ConfigIsExisting("attachSoundSet"))
11368 {
11369 string cfg_path = "";
11370 string soundset = "";
11371 string type_name =
GetType();
11372
11375 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11376 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11377
11378 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11379 {
11380 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11381 {
11382 if (cfg_slot_array[i] == slot_type)
11383 {
11384 soundset = cfg_soundset_array[i];
11385 break;
11386 }
11387 }
11388 }
11389
11390 if (soundset != "")
11391 {
11392 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11394 }
11395 }
11396 }
11397 }
11398
11400 {
11401
11402 }
11403
11404 void OnApply(PlayerBase player);
11405
11407 {
11408 return 1.0;
11409 };
11410
11412 {
11414 }
11415
11417 {
11419 }
11420
11422
11424 {
11425 SetDynamicPhysicsLifeTime(0.01);
11427 }
11428
11430 {
11431 array<string> zone_names = new array<string>;
11432 GetDamageZones(zone_names);
11433 for (int i = 0; i < zone_names.Count(); i++)
11434 {
11435 SetHealthMax(zone_names.Get(i),"Health");
11436 }
11437 SetHealthMax("","Health");
11438 }
11439
11442 {
11443 float global_health = GetHealth01("","Health");
11444 array<string> zones = new array<string>;
11445 GetDamageZones(zones);
11446
11447 for (int i = 0; i < zones.Count(); i++)
11448 {
11449 SetHealth01(zones.Get(i),"Health",global_health);
11450 }
11451 }
11452
11455 {
11456 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11457 }
11458
11460 {
11461 if (!hasRootAsPlayer)
11462 {
11463 if (refParentIB)
11464 {
11465
11466 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11467 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11468
11469 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11470 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11471
11474 }
11475 else
11476 {
11477
11480 }
11481 }
11482 }
11483
11485 {
11487 {
11488 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11489 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11490 {
11491 float heatPermCoef = 1.0;
11493 while (ent)
11494 {
11495 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11496 ent = ent.GetHierarchyParent();
11497 }
11498
11499 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11500 }
11501 }
11502 }
11503
11505 {
11506
11507 EntityAI parent = GetHierarchyParent();
11508 if (!parent)
11509 {
11510 hasParent = false;
11511 hasRootAsPlayer = false;
11512 }
11513 else
11514 {
11515 hasParent = true;
11516 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11517 refParentIB =
ItemBase.Cast(parent);
11518 }
11519 }
11520
11521 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11522 {
11523
11524 }
11525
11527 {
11528
11529 return false;
11530 }
11531
11533 {
11534
11535
11536 return false;
11537 }
11538
11540 {
11541
11542 return false;
11543 }
11544
11547 {
11548 return !GetIsFrozen() &&
IsOpen();
11549 }
11550
11552 {
11553 bool hasParent = false, hasRootAsPlayer = false;
11555
11556 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11557 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11558
11559 if (wwtu || foodDecay)
11560 {
11564
11565 if (processWetness || processTemperature || processDecay)
11566 {
11568
11569 if (processWetness)
11570 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11571
11572 if (processTemperature)
11574
11575 if (processDecay)
11576 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11577 }
11578 }
11579 }
11580
11583 {
11585 }
11586
11588 {
11591
11592 return super.GetTemperatureFreezeThreshold();
11593 }
11594
11596 {
11599
11600 return super.GetTemperatureThawThreshold();
11601 }
11602
11604 {
11607
11608 return super.GetItemOverheatThreshold();
11609 }
11610
11612 {
11614 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11615
11616 return super.GetTemperatureFreezeTime();
11617 }
11618
11620 {
11622 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11623
11624 return super.GetTemperatureThawTime();
11625 }
11626
11631
11633 {
11634 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11635 }
11636
11638 {
11639 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11640 }
11641
11644 {
11646 }
11647
11649 {
11651 }
11652
11654 {
11656 }
11657
11660 {
11661 return null;
11662 }
11663
11666 {
11667 return false;
11668 }
11669
11671 {
11673 {
11676 if (!trg)
11677 {
11679 explosive = this;
11680 }
11681
11682 explosive.PairRemote(trg);
11684
11685 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11686 trg.SetPersistentPairID(persistentID);
11687 explosive.SetPersistentPairID(persistentID);
11688
11689 return true;
11690 }
11691 return false;
11692 }
11693
11696 {
11697 float ret = 1.0;
11700 ret *= GetHealth01();
11701
11702 return ret;
11703 }
11704
11705 #ifdef DEVELOPER
11706 override void SetDebugItem()
11707 {
11708 super.SetDebugItem();
11709 _itemBase = this;
11710 }
11711
11713 {
11714 string text = super.GetDebugText();
11715
11717 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11718
11719 return text;
11720 }
11721 #endif
11722
11724 {
11725 return true;
11726 }
11727
11729
11731
11733 {
11736 }
11737
11738
11746
11762}
11763
11765{
11767 if (entity)
11768 {
11769 bool is_item = entity.IsInherited(
ItemBase);
11770 if (is_item && full_quantity)
11771 {
11774 }
11775 }
11776 else
11777 {
11779 return NULL;
11780 }
11781 return entity;
11782}
11783
11785{
11786 if (item)
11787 {
11788 if (health > 0)
11789 item.SetHealth("", "", health);
11790
11791 if (item.CanHaveTemperature())
11792 {
11794 if (item.CanFreeze())
11795 item.SetFrozen(false);
11796 }
11797
11798 if (item.HasEnergyManager())
11799 {
11800 if (quantity >= 0)
11801 {
11802 item.GetCompEM().SetEnergy0To1(quantity);
11803 }
11804 else
11805 {
11807 }
11808 }
11809 else if (item.IsMagazine())
11810 {
11811 Magazine mag = Magazine.Cast(item);
11812 if (quantity >= 0)
11813 {
11814 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11815 }
11816 else
11817 {
11819 }
11820
11821 }
11822 else
11823 {
11824 if (quantity >= 0)
11825 {
11826 item.SetQuantityNormalized(quantity, false);
11827 }
11828 else
11829 {
11831 }
11832
11833 }
11834 }
11835}
11836
11837#ifdef DEVELOPER
11839#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.