Send message to owner player in yellow color.
7564{
7566 {
7567 return true;
7568 }
7569};
7570
7571
7572
7574{
7578
7580
7583
7584
7585
7586
7587
7596
7602
7607
7612
7633 protected bool m_IsResultOfSplit
7634
7636
7641
7642
7643
7645
7649
7650
7651
7653
7656
7657
7658
7664
7665
7673
7676
7677
7679
7680
7682
7683
7688
7689
7694
7695
7697
7698
7700 {
7705
7706 if (!
GetGame().IsDedicatedServer())
7707 {
7709 {
7711
7713 {
7715 }
7716 }
7717
7720 }
7721
7722 m_OldLocation = null;
7723
7725 {
7727 }
7728
7729 if (ConfigIsExisting("headSelectionsToHide"))
7730 {
7733 }
7734
7736 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7737 {
7739 }
7740
7742
7743 m_IsResultOfSplit = false;
7744
7746 }
7747
7749 {
7750 super.InitItemVariables();
7751
7757 m_Count = ConfigGetInt(
"count");
7758
7761
7766
7769
7774
7786
7790
7791
7794 if (ConfigIsExisting("canBeSplit"))
7795 {
7798 }
7799
7801 if (ConfigIsExisting("itemBehaviour"))
7803
7804
7807 RegisterNetSyncVariableInt("m_VarLiquidType");
7808 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7809
7810 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7811 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7812 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7813
7814 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7815 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7816 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7817 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7818
7819 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7820 RegisterNetSyncVariableBool("m_IsTakeable");
7821 RegisterNetSyncVariableBool("m_IsHologram");
7822
7825 {
7828 }
7829
7831
7833 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7835
7836 }
7837
7839 {
7841 }
7842
7844 {
7847 {
7852 }
7853 }
7854
7855 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7856 {
7858 {
7861 }
7862
7864 }
7865
7867 {
7873 }
7874
7876
7878 {
7880
7881 if (!action)
7882 {
7883 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7884 return;
7885 }
7886
7888 if (!ai)
7889 {
7891 return;
7892 }
7893
7895 if (!action_array)
7896 {
7897 action_array = new array<ActionBase_Basic>;
7899 }
7900 if (LogManager.IsActionLogEnable())
7901 {
7902 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7903 }
7904
7905 if (action_array.Find(action) != -1)
7906 {
7907 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7908 }
7909 else
7910 {
7911 action_array.Insert(action);
7912 }
7913 }
7914
7916 {
7918 ActionBase action = player.GetActionManager().GetAction(actionName);
7921
7922 if (action_array)
7923 {
7924 action_array.RemoveItem(action);
7925 }
7926 }
7927
7928
7929
7931 {
7932 ActionOverrideData overrideData = new ActionOverrideData();
7936
7938 if (!actionMap)
7939 {
7942 }
7943
7944 actionMap.Insert(this.
Type(), overrideData);
7945
7946 }
7947
7949
7951
7952
7954 {
7957
7960
7961 string config_to_search = "CfgVehicles";
7962 string muzzle_owner_config;
7963
7965 {
7966 if (IsInherited(Weapon))
7967 config_to_search = "CfgWeapons";
7968
7969 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7970
7971 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7972
7974
7975 if (config_OnFire_subclass_count > 0)
7976 {
7977 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7978
7979 for (int i = 0; i < config_OnFire_subclass_count; i++)
7980 {
7981 string particle_class = "";
7983 string config_OnFire_entry = config_OnFire_class + particle_class;
7984 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7985 WPOF_array.Insert(WPOF);
7986 }
7987
7988
7990 }
7991 }
7992
7994 {
7995 config_to_search = "CfgWeapons";
7996 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7997
7998 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7999
8001
8002 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8003 {
8004 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8005
8006 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8007 {
8008 string particle_class2 = "";
8010 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8011 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8012 WPOBE_array.Insert(WPOBE);
8013 }
8014
8015
8017 }
8018 }
8019 }
8020
8021
8023 {
8026
8028 {
8029 string config_to_search = "CfgVehicles";
8030
8031 if (IsInherited(Weapon))
8032 config_to_search = "CfgWeapons";
8033
8034 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8035 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8036
8037 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8038 {
8039
8041
8043 {
8045 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8047 return;
8048 }
8049
8052
8053
8054
8056 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8057
8058 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8059 {
8060 string particle_class = "";
8062 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8064
8065 if (entry_type == CT_CLASS)
8066 {
8067 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8068 WPOOH_array.Insert(WPOF);
8069 }
8070 }
8071
8072
8074 }
8075 }
8076 }
8077
8079 {
8081 }
8082
8084 {
8086 {
8088
8091
8094
8095 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8096 }
8097 }
8098
8100 {
8102 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8103
8105 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8106
8108 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8109
8111 {
8113 }
8114 }
8115
8117 {
8119 }
8120
8122 {
8125 else
8127
8129 {
8132 }
8133 else
8134 {
8137
8140 }
8141
8143 }
8144
8146 {
8148 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8149 }
8150
8152 {
8154 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8156 }
8157
8159 {
8161 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8162 }
8163
8165 {
8168
8169 OverheatingParticle OP = new OverheatingParticle();
8174
8176 }
8177
8179 {
8182
8183 return -1;
8184 }
8185
8187 {
8189 {
8192
8193 for (int i = count; i > 0; --i)
8194 {
8195 int id = i - 1;
8198
8201
8202 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8203 {
8204 if (p)
8205 {
8208 }
8209 }
8210 }
8211 }
8212 }
8213
8215 {
8217 {
8219 {
8220 int id = i - 1;
8222
8223 if (OP)
8224 {
8226
8227 if (p)
8228 {
8230 }
8231
8232 delete OP;
8233 }
8234 }
8235
8238 }
8239 }
8240
8243 {
8244 return 0.0;
8245 }
8246
8247
8249 {
8250 return 250;
8251 }
8252
8254 {
8255 return 0;
8256 }
8257
8260 {
8262 return true;
8263
8264 return false;
8265 }
8266
8269 {
8272
8274 {
8276 }
8277 else
8278 {
8279
8281 }
8282
8284 }
8285
8292 {
8293 return -1;
8294 }
8295
8296
8297
8298
8300 {
8302 {
8304 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8305
8306 if (r_index >= 0)
8307 {
8308 InventoryLocation r_il = new InventoryLocation;
8309 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8310
8311 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8314 {
8315 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8316 }
8318 {
8319 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8320 }
8321
8322 }
8323
8324 player.GetHumanInventory().ClearUserReservedLocation(this);
8325 }
8326
8329 }
8330
8331
8332
8333
8335 {
8336 return ItemBase.m_DebugActionsMask;
8337 }
8338
8340 {
8341 return ItemBase.m_DebugActionsMask & mask;
8342 }
8343
8345 {
8346 ItemBase.m_DebugActionsMask = mask;
8347 }
8348
8350 {
8351 ItemBase.m_DebugActionsMask |= mask;
8352 }
8353
8355 {
8356 ItemBase.m_DebugActionsMask &= ~mask;
8357 }
8358
8360 {
8362 {
8364 }
8365 else
8366 {
8368 }
8369 }
8370
8371
8373 {
8374 if (GetEconomyProfile())
8375 {
8376 float q_max = GetEconomyProfile().GetQuantityMax();
8377 if (q_max > 0)
8378 {
8379 float q_min = GetEconomyProfile().GetQuantityMin();
8380 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8381
8383 {
8384 ComponentEnergyManager comp = GetCompEM();
8386 {
8388 }
8389 }
8391 {
8393
8394 }
8395
8396 }
8397 }
8398 }
8399
8402 {
8403 EntityAI parent = GetHierarchyParent();
8404
8405 if (parent)
8406 {
8407 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8408 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8409 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8410 }
8411 }
8412
8415 {
8416 EntityAI parent = GetHierarchyParent();
8417
8418 if (parent)
8419 {
8420 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8421 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8422 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8423 }
8424 }
8425
8427 {
8428
8429
8430
8431
8433
8435 {
8436 if (ScriptInputUserData.CanStoreInputUserData())
8437 {
8438 ScriptInputUserData ctx = new ScriptInputUserData;
8444 ctx.
Write(use_stack_max);
8447
8449 {
8450 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8451 }
8452 }
8453 }
8454 else if (!
GetGame().IsMultiplayer())
8455 {
8457 }
8458 }
8459
8461 {
8463 }
8464
8466 {
8468 }
8469
8471 {
8473 }
8474
8476 {
8477
8478 return false;
8479 }
8480
8482 {
8483 return false;
8484 }
8485
8489 {
8490 return false;
8491 }
8492
8494 {
8495 return "";
8496 }
8497
8499
8501 {
8502 return false;
8503 }
8504
8506 {
8507 return true;
8508 }
8509
8510
8511
8513 {
8514 return true;
8515 }
8516
8518 {
8519 return true;
8520 }
8521
8523 {
8524 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8526 }
8527
8529 {
8531 }
8532
8534 {
8536 if (!is_being_placed)
8538 SetSynchDirty();
8539 }
8540
8541
8543
8545 {
8547 }
8548
8550 {
8552 }
8553
8555 {
8556 return 1;
8557 }
8558
8560 {
8561 return false;
8562 }
8563
8565 {
8567 SetSynchDirty();
8568 }
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8605 {
8606 super.OnMovedInsideCargo(container);
8607
8608 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8609 }
8610
8611 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8612 {
8613 super.EEItemLocationChanged(oldLoc,newLoc);
8614
8615 PlayerBase new_player = null;
8616 PlayerBase old_player = null;
8617
8618 if (newLoc.GetParent())
8619 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8620
8621 if (oldLoc.GetParent())
8622 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8623
8625 {
8626 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8627
8628 if (r_index >= 0)
8629 {
8630 InventoryLocation r_il = new InventoryLocation;
8631 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8632
8633 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8636 {
8637 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8638 }
8640 {
8641 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8642 }
8643
8644 }
8645 }
8646
8648 {
8649 if (new_player)
8650 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8651
8652 if (new_player == old_player)
8653 {
8654
8655 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8656 {
8658 {
8659 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8660 {
8661 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8662 }
8663 }
8664 else
8665 {
8666 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8667 }
8668 }
8669
8670 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8671 {
8672 int type = oldLoc.GetType();
8674 {
8675 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8676 }
8678 {
8679 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8680 }
8681 }
8682 if (!m_OldLocation)
8683 {
8684 m_OldLocation = new InventoryLocation;
8685 }
8686 m_OldLocation.Copy(oldLoc);
8687 }
8688 else
8689 {
8690 if (m_OldLocation)
8691 {
8692 m_OldLocation.Reset();
8693 }
8694 }
8695
8697 }
8698 else
8699 {
8700 if (new_player)
8701 {
8702 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8703 if (res_index >= 0)
8704 {
8705 InventoryLocation il = new InventoryLocation;
8706 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8708 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8711 {
8712 il.
GetParent().GetOnReleaseLock().Invoke(it);
8713 }
8715 {
8717 }
8718
8719 }
8720 }
8722 {
8723
8725 }
8726
8727 if (m_OldLocation)
8728 {
8729 m_OldLocation.Reset();
8730 }
8731 }
8732 }
8733
8734 override void EOnContact(IEntity other, Contact extra)
8735 {
8737 {
8738 int liquidType = -1;
8740 if (impactSpeed > 0.0)
8741 {
8743 #ifndef SERVER
8745 #else
8747 SetSynchDirty();
8748 #endif
8750 }
8751 }
8752
8753 #ifdef SERVER
8754 if (GetCompEM() && GetCompEM().IsPlugged())
8755 {
8756 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8757 GetCompEM().UnplugThis();
8758 }
8759 #endif
8760 }
8761
8763
8765 {
8767 }
8768
8770 {
8771
8772 }
8773
8775 {
8776 super.OnItemLocationChanged(old_owner, new_owner);
8777
8778 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8779 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8780
8781 if (!relatedPlayer && playerNew)
8782 relatedPlayer = playerNew;
8783
8784 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8785 {
8787 if (actionMgr)
8788 {
8789 ActionBase currentAction = actionMgr.GetRunningAction();
8790 if (currentAction)
8792 }
8793 }
8794
8795 Man ownerPlayerOld = null;
8796 Man ownerPlayerNew = null;
8797
8798 if (old_owner)
8799 {
8800 if (old_owner.
IsMan())
8801 {
8802 ownerPlayerOld = Man.Cast(old_owner);
8803 }
8804 else
8805 {
8806 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8807 }
8808 }
8809 else
8810 {
8812 {
8814
8815 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8816 {
8817 GetCompEM().UnplugThis();
8818 }
8819 }
8820 }
8821
8822 if (new_owner)
8823 {
8824 if (new_owner.
IsMan())
8825 {
8826 ownerPlayerNew = Man.Cast(new_owner);
8827 }
8828 else
8829 {
8830 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8831 }
8832 }
8833
8834 if (ownerPlayerOld != ownerPlayerNew)
8835 {
8836 if (ownerPlayerOld)
8837 {
8838 array<EntityAI> subItemsExit = new array<EntityAI>;
8840 for (int i = 0; i < subItemsExit.Count(); i++)
8841 {
8844 }
8845 }
8846
8847 if (ownerPlayerNew)
8848 {
8849 array<EntityAI> subItemsEnter = new array<EntityAI>;
8851 for (int j = 0; j < subItemsEnter.Count(); j++)
8852 {
8855 }
8856 }
8857 }
8858 else if (ownerPlayerNew != null)
8859 {
8860 PlayerBase nplayer;
8861 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8862 {
8863 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8865 for (int k = 0; k < subItemsUpdate.Count(); k++)
8866 {
8868 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8869 }
8870 }
8871 }
8872
8873 if (old_owner)
8874 old_owner.OnChildItemRemoved(this);
8875 if (new_owner)
8876 new_owner.OnChildItemReceived(this);
8877 }
8878
8879
8881 {
8882 super.EEDelete(parent);
8883 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8884 if (player)
8885 {
8887
8888 if (player.IsAlive())
8889 {
8890 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8891 if (r_index >= 0)
8892 {
8893 InventoryLocation r_il = new InventoryLocation;
8894 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8895
8896 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8899 {
8900 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8901 }
8903 {
8904 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8905 }
8906
8907 }
8908
8909 player.RemoveQuickBarEntityShortcut(this);
8910 }
8911 }
8912 }
8913
8915 {
8916 super.EEKilled(killer);
8917
8920 {
8921 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8922 {
8923 if (IsMagazine())
8924 {
8925 if (Magazine.Cast(this).GetAmmoCount() > 0)
8926 {
8928 }
8929 }
8930 else
8931 {
8933 }
8934 }
8935 }
8936 }
8937
8939 {
8940 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8941
8942 super.OnWasAttached(parent, slot_id);
8943
8946
8948 }
8949
8951 {
8952 super.OnWasDetached(parent, slot_id);
8953
8956 }
8957
8959 {
8960 int idx;
8963
8964 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8965 if (inventory_slots.Count() < 1)
8966 {
8967 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8968 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8969 }
8970 else
8971 {
8972 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8973 }
8974
8975 idx = inventory_slots.Find(slot);
8976 if (idx < 0)
8977 return "";
8978
8979 return attach_types.Get(idx);
8980 }
8981
8983 {
8984 int idx = -1;
8985 string slot;
8986
8989
8990 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8991 if (inventory_slots.Count() < 1)
8992 {
8993 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8994 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8995 }
8996 else
8997 {
8998 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8999 if (detach_types.Count() < 1)
9000 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9001 }
9002
9003 for (int i = 0; i < inventory_slots.Count(); i++)
9004 {
9005 slot = inventory_slots.Get(i);
9006 }
9007
9008 if (slot != "")
9009 {
9010 if (detach_types.Count() == 1)
9011 idx = 0;
9012 else
9013 idx = inventory_slots.Find(slot);
9014 }
9015 if (idx < 0)
9016 return "";
9017
9018 return detach_types.Get(idx);
9019 }
9020
9022 {
9023
9025
9026
9027 float min_time = 1;
9028 float max_time = 3;
9029 float delay = Math.RandomFloat(min_time, max_time);
9030
9031 explode_timer.Run(delay, this, "DoAmmoExplosion");
9032 }
9033
9035 {
9036 Magazine magazine = Magazine.Cast(this);
9037 int pop_sounds_count = 6;
9038 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9039
9040
9041 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9042 string sound_name = pop_sounds[ sound_idx ];
9044
9045
9046 magazine.ServerAddAmmoCount(-1);
9047
9048
9049 float min_temp_to_explode = 100;
9050
9051 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9052 {
9054 }
9055 }
9056
9057
9058 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9059 {
9060 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9061
9062 const int CHANCE_DAMAGE_CARGO = 4;
9063 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9064 const int CHANCE_DAMAGE_NOTHING = 2;
9065
9067 {
9068 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9069 int chances;
9070 int rnd;
9071
9072 if (GetInventory().GetCargo())
9073 {
9074 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9075 rnd = Math.RandomInt(0,chances);
9076
9077 if (rnd < CHANCE_DAMAGE_CARGO)
9078 {
9080 }
9081 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9082 {
9084 }
9085 }
9086 else
9087 {
9088 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9089 rnd = Math.RandomInt(0,chances);
9090
9091 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9092 {
9094 }
9095 }
9096 }
9097 }
9098
9100 {
9101 if (GetInventory().GetCargo())
9102 {
9103 int item_count = GetInventory().GetCargo().GetItemCount();
9104 if (item_count > 0)
9105 {
9106 int random_pick = Math.RandomInt(0, item_count);
9108 if (!item.IsExplosive())
9109 {
9110 item.AddHealth("","",damage);
9111 return true;
9112 }
9113 }
9114 }
9115 return false;
9116 }
9117
9119 {
9120 int attachment_count = GetInventory().AttachmentCount();
9121 if (attachment_count > 0)
9122 {
9123 int random_pick = Math.RandomInt(0, attachment_count);
9124 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9125 if (!attachment.IsExplosive())
9126 {
9127 attachment.AddHealth("","",damage);
9128 return true;
9129 }
9130 }
9131 return false;
9132 }
9133
9135 {
9137 }
9138
9140 {
9142 return GetInventory().CanRemoveEntity();
9143
9144 return false;
9145 }
9146
9148 {
9149
9151 return false;
9152
9153
9155 return false;
9156
9157
9158
9160 if (delta == 0)
9161 return false;
9162
9163
9164 return true;
9165 }
9166
9168 {
9170 {
9171 if (ScriptInputUserData.CanStoreInputUserData())
9172 {
9173 ScriptInputUserData ctx = new ScriptInputUserData;
9178 ctx.
Write(destination_entity);
9182 }
9183 }
9184 else if (!
GetGame().IsMultiplayer())
9185 {
9187 }
9188 }
9189
9191 {
9192 float split_quantity_new;
9196 InventoryLocation loc = new InventoryLocation;
9197
9198 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9199 {
9201 split_quantity_new = stack_max;
9202 else
9204
9206 {
9207 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9208 if (new_item)
9209 {
9210 new_item.SetResultOfSplit(true);
9211 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9213 new_item.
SetQuantity(split_quantity_new,
false,
true);
9214 }
9215 }
9216 }
9217 else if (destination_entity && slot_id == -1)
9218 {
9219 if (quantity > stack_max)
9220 split_quantity_new = stack_max;
9221 else
9222 split_quantity_new = quantity;
9223
9225 {
9227 {
9230 }
9231
9232 if (new_item)
9233 {
9234 new_item.SetResultOfSplit(true);
9235 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9237 new_item.
SetQuantity(split_quantity_new,
false,
true);
9238 }
9239 }
9240 }
9241 else
9242 {
9243 if (stack_max != 0)
9244 {
9246 {
9248 }
9249
9250 if (split_quantity_new == 0)
9251 {
9252 if (!
GetGame().IsMultiplayer())
9253 player.PhysicalPredictiveDropItem(this);
9254 else
9255 player.ServerDropEntity(this);
9256 return;
9257 }
9258
9260 {
9262
9263 if (new_item)
9264 {
9265 new_item.SetResultOfSplit(true);
9266 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9269 new_item.PlaceOnSurface();
9270 }
9271 }
9272 }
9273 }
9274 }
9275
9277 {
9278 float split_quantity_new;
9282 InventoryLocation loc = new InventoryLocation;
9283
9284 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9285 {
9287 split_quantity_new = stack_max;
9288 else
9290
9292 {
9293 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9294 if (new_item)
9295 {
9296 new_item.SetResultOfSplit(true);
9297 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9299 new_item.
SetQuantity(split_quantity_new,
false,
true);
9300 }
9301 }
9302 }
9303 else if (destination_entity && slot_id == -1)
9304 {
9305 if (quantity > stack_max)
9306 split_quantity_new = stack_max;
9307 else
9308 split_quantity_new = quantity;
9309
9311 {
9313 {
9316 }
9317
9318 if (new_item)
9319 {
9320 new_item.SetResultOfSplit(true);
9321 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9323 new_item.
SetQuantity(split_quantity_new,
false,
true);
9324 }
9325 }
9326 }
9327 else
9328 {
9329 if (stack_max != 0)
9330 {
9332 {
9334 }
9335
9337 {
9339
9340 if (new_item)
9341 {
9342 new_item.SetResultOfSplit(true);
9343 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9346 new_item.PlaceOnSurface();
9347 }
9348 }
9349 }
9350 }
9351 }
9352
9354 {
9356 {
9357 if (ScriptInputUserData.CanStoreInputUserData())
9358 {
9359 ScriptInputUserData ctx = new ScriptInputUserData;
9364 dst.WriteToContext(ctx);
9366 }
9367 }
9368 else if (!
GetGame().IsMultiplayer())
9369 {
9371 }
9372 }
9373
9375 {
9377 {
9378 if (ScriptInputUserData.CanStoreInputUserData())
9379 {
9380 ScriptInputUserData ctx = new ScriptInputUserData;
9385 ctx.
Write(destination_entity);
9391 }
9392 }
9393 else if (!
GetGame().IsMultiplayer())
9394 {
9396 }
9397 }
9398
9400 {
9402 }
9403
9405 {
9407 float split_quantity_new;
9409 if (dst.IsValid())
9410 {
9411 int slot_id = dst.GetSlot();
9413
9414 if (quantity > stack_max)
9415 split_quantity_new = stack_max;
9416 else
9417 split_quantity_new = quantity;
9418
9420 {
9422
9423 if (new_item)
9424 {
9425 new_item.SetResultOfSplit(true);
9426 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9428 new_item.
SetQuantity(split_quantity_new,
false,
true);
9429 }
9430
9431 return new_item;
9432 }
9433 }
9434
9435 return null;
9436 }
9437
9439 {
9441 float split_quantity_new;
9443 if (destination_entity)
9444 {
9446 if (quantity > stackable)
9447 split_quantity_new = stackable;
9448 else
9449 split_quantity_new = quantity;
9450
9452 {
9453 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9454 if (new_item)
9455 {
9456 new_item.SetResultOfSplit(true);
9457 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9459 new_item.
SetQuantity(split_quantity_new,
false,
true);
9460 }
9461 }
9462 }
9463 }
9464
9466 {
9468 {
9469 if (ScriptInputUserData.CanStoreInputUserData())
9470 {
9471 ScriptInputUserData ctx = new ScriptInputUserData;
9476 ItemBase destination_entity =
this;
9477 ctx.
Write(destination_entity);
9481 }
9482 }
9483 else if (!
GetGame().IsMultiplayer())
9484 {
9486 }
9487 }
9488
9490 {
9492 float split_quantity_new;
9494 if (player)
9495 {
9497 if (quantity > stackable)
9498 split_quantity_new = stackable;
9499 else
9500 split_quantity_new = quantity;
9501
9503 {
9504 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9505 new_item =
ItemBase.Cast(in_hands);
9506 if (new_item)
9507 {
9508 new_item.SetResultOfSplit(true);
9509 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9511 new_item.SetQuantity(split_quantity_new, false, true);
9512 }
9513 }
9514 }
9515 }
9516
9518 {
9520 float split_quantity_new = Math.Floor(quantity * 0.5);
9521
9523 return;
9524
9526
9527 if (new_item)
9528 {
9529 if (new_item.GetQuantityMax() < split_quantity_new)
9530 {
9531 split_quantity_new = new_item.GetQuantityMax();
9532 }
9533
9534 new_item.SetResultOfSplit(true);
9535 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9536
9538 {
9541 }
9542 else
9543 {
9545 new_item.
SetQuantity(split_quantity_new,
false,
true);
9546 }
9547 }
9548 }
9549
9551 {
9553 float split_quantity_new = Math.Floor(quantity / 2);
9554
9556 return;
9557
9558 InventoryLocation invloc = new InventoryLocation;
9560
9562 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9563
9564 if (new_item)
9565 {
9566 if (new_item.GetQuantityMax() < split_quantity_new)
9567 {
9568 split_quantity_new = new_item.GetQuantityMax();
9569 }
9571 {
9574 }
9575 else if (split_quantity_new > 1)
9576 {
9578 new_item.
SetQuantity(split_quantity_new,
false,
true);
9579 }
9580 }
9581 }
9582
9585 {
9586 SetWeightDirty();
9588
9589 if (parent)
9590 parent.OnAttachmentQuantityChangedEx(this, delta);
9591
9593 {
9595 {
9597 }
9599 {
9600 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9602 }
9603 }
9604
9605 }
9606
9609 {
9610
9611 }
9612
9615 {
9617 }
9618
9620 {
9621 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9622
9624 {
9625 if (newLevel == GameConstants.STATE_RUINED)
9626 {
9628 EntityAI parent = GetHierarchyParent();
9629 if (parent && parent.IsFireplace())
9630 {
9631 CargoBase cargo = GetInventory().GetCargo();
9632 if (cargo)
9633 {
9635 {
9637 }
9638 }
9639 }
9640 }
9641
9643 {
9644
9646 return;
9647 }
9648
9649 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9650 {
9652 }
9653 }
9654 }
9655
9656
9658 {
9659 super.OnRightClick();
9660
9662 {
9664 {
9665 if (ScriptInputUserData.CanStoreInputUserData())
9666 {
9667 EntityAI root = GetHierarchyRoot();
9668 Man playerOwner = GetHierarchyRootPlayer();
9669 InventoryLocation dst = new InventoryLocation;
9670
9671
9672 if (!playerOwner && root && root == this)
9673 {
9675 }
9676 else
9677 {
9678
9679 GetInventory().GetCurrentInventoryLocation(dst);
9681 {
9684 {
9686 }
9687 else
9688 {
9690
9691
9692 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9693 {
9695 }
9696 else
9697 {
9698 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9699 }
9700 }
9701 }
9702 }
9703
9704 ScriptInputUserData ctx = new ScriptInputUserData;
9712 }
9713 }
9714 else if (!
GetGame().IsMultiplayer())
9715 {
9717 }
9718 }
9719 }
9720
9722 {
9723 if (root)
9724 {
9725 vector m4[4];
9726 root.GetTransform(m4);
9727 dst.SetGround(this, m4);
9728 }
9729 else
9730 {
9731 GetInventory().GetCurrentInventoryLocation(dst);
9732 }
9733 }
9734
9735 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9736 {
9737
9738 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9739 return false;
9740
9741 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9742 return false;
9743
9744
9746 return false;
9747
9748
9749 Magazine mag = Magazine.Cast(this);
9750 if (mag)
9751 {
9752 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9753 return false;
9754
9755 if (stack_max_limit)
9756 {
9757 Magazine other_mag = Magazine.Cast(other_item);
9758 if (other_item)
9759 {
9760 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9761 return false;
9762 }
9763
9764 }
9765 }
9766 else
9767 {
9768
9770 return false;
9771
9773 return false;
9774 }
9775
9776 PlayerBase player = null;
9777 if (CastTo(player, GetHierarchyRootPlayer()))
9778 {
9779 if (player.GetInventory().HasAttachment(this))
9780 return false;
9781
9782 if (player.IsItemsToDelete())
9783 return false;
9784 }
9785
9786 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9787 return false;
9788
9789 int slotID;
9791 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9792 return false;
9793
9794 return true;
9795 }
9796
9798 {
9800 }
9801
9803 {
9804 return m_IsResultOfSplit;
9805 }
9806
9808 {
9809 m_IsResultOfSplit = value;
9810 }
9811
9813 {
9815 }
9816
9818 {
9819 float other_item_quantity = other_item.GetQuantity();
9820 float this_free_space;
9821
9823
9825
9826 if (other_item_quantity > this_free_space)
9827 {
9828 return this_free_space;
9829 }
9830 else
9831 {
9832 return other_item_quantity;
9833 }
9834 }
9835
9837 {
9839 }
9840
9842 {
9844 return;
9845
9846 if (!IsMagazine() && other_item)
9847 {
9849 if (quantity_used != 0)
9850 {
9851 float hp1 = GetHealth01("","");
9852 float hp2 = other_item.GetHealth01("","");
9853 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9854 hpResult = hpResult / (
GetQuantity() + quantity_used);
9855
9856 hpResult *= GetMaxHealth();
9857 Math.Round(hpResult);
9858 SetHealth("", "Health", hpResult);
9859
9861 other_item.AddQuantity(-quantity_used);
9862 }
9863 }
9865 }
9866
9868 {
9869 #ifdef SERVER
9870 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9871 GetHierarchyParent().IncreaseLifetimeUp();
9872 #endif
9873 };
9874
9876 {
9877 PlayerBase p = PlayerBase.Cast(player);
9878
9879 array<int> recipesIds = p.m_Recipes;
9880 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9881 if (moduleRecipesManager)
9882 {
9883 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9884 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9885 }
9886
9887 for (int i = 0;i < recipesIds.Count(); i++)
9888 {
9889 int key = recipesIds.Get(i);
9890 string recipeName = moduleRecipesManager.GetRecipeName(key);
9892 }
9893 }
9894
9895
9896 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9897 {
9898 super.GetDebugActions(outputList);
9899
9900
9906
9907
9912
9917
9918
9922
9923
9925 {
9929 }
9930
9933
9934
9938
9940
9941 InventoryLocation loc = new InventoryLocation();
9942 GetInventory().GetCurrentInventoryLocation(loc);
9944 {
9945 if (Gizmo_IsSupported())
9948 }
9949
9951 }
9952
9953
9954
9955
9957 {
9958 super.OnAction(action_id, player, ctx);
9959
9961 {
9962 switch (action_id)
9963 {
9966 return true;
9969 return true;
9970 }
9971 }
9972
9974 {
9975 switch (action_id)
9976 {
9978 Delete();
9979 return true;
9980 }
9981 }
9982
9983 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9984 {
9985 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9986 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9987 PlayerBase p = PlayerBase.Cast(player);
9988 if (
EActions.RECIPES_RANGE_START < 1000)
9989 {
9990 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9991 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9992 }
9993 }
9994 #ifndef SERVER
9995 else if (action_id ==
EActions.WATCH_PLAYER)
9996 {
9997 PluginDeveloper.SetDeveloperItemClientEx(player);
9998 }
9999 #endif
10001 {
10002 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10003 {
10004 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10005 OnDebugButtonPressServer(id + 1);
10006 }
10007
10008 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10009 {
10010 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10012 }
10013
10014 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10015 {
10016 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10018 }
10019
10020 else if (action_id ==
EActions.ADD_QUANTITY)
10021 {
10022 if (IsMagazine())
10023 {
10024 Magazine mag = Magazine.Cast(this);
10025 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10026 }
10027 else
10028 {
10030 }
10031
10032 if (m_EM)
10033 {
10034 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10035 }
10036
10037 }
10038
10039 else if (action_id ==
EActions.REMOVE_QUANTITY)
10040 {
10041 if (IsMagazine())
10042 {
10043 Magazine mag2 = Magazine.Cast(this);
10044 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10045 }
10046 else
10047 {
10049 }
10050 if (m_EM)
10051 {
10052 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10053 }
10054
10055 }
10056
10057 else if (action_id ==
EActions.SET_QUANTITY_0)
10058 {
10060
10061 if (m_EM)
10062 {
10063 m_EM.SetEnergy(0);
10064 }
10065 }
10066
10067 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10068 {
10070
10071 if (m_EM)
10072 {
10073 m_EM.SetEnergy(m_EM.GetEnergyMax());
10074 }
10075 }
10076
10077 else if (action_id ==
EActions.ADD_HEALTH)
10078 {
10079 AddHealth("","",GetMaxHealth("","Health")/5);
10080 }
10081 else if (action_id ==
EActions.REMOVE_HEALTH)
10082 {
10083 AddHealth("","",-GetMaxHealth("","Health")/5);
10084 }
10085 else if (action_id ==
EActions.DESTROY_HEALTH)
10086 {
10087 SetHealth01("","",0);
10088 }
10089 else if (action_id ==
EActions.WATCH_ITEM)
10090 {
10092 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10093 #ifdef DEVELOPER
10094 SetDebugDeveloper_item(this);
10095 #endif
10096 }
10097
10098 else if (action_id ==
EActions.ADD_TEMPERATURE)
10099 {
10100 AddTemperature(20);
10101
10102 }
10103
10104 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10105 {
10106 AddTemperature(-20);
10107
10108 }
10109
10110 else if (action_id ==
EActions.FLIP_FROZEN)
10111 {
10112 SetFrozen(!GetIsFrozen());
10113
10114 }
10115
10116 else if (action_id ==
EActions.ADD_WETNESS)
10117 {
10119
10120 }
10121
10122 else if (action_id ==
EActions.REMOVE_WETNESS)
10123 {
10125
10126 }
10127
10128 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10129 {
10132
10133
10134 }
10135
10136 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10137 {
10140 }
10141
10142 else if (action_id ==
EActions.MAKE_SPECIAL)
10143 {
10144 auto debugParams = DebugSpawnParams.WithPlayer(player);
10145 OnDebugSpawnEx(debugParams);
10146 }
10147
10148 }
10149
10150
10151 return false;
10152 }
10153
10154
10155
10156
10160
10163
10164
10165
10167 {
10168 return false;
10169 }
10170
10171
10173 {
10174 return true;
10175 }
10176
10177
10179 {
10180 return true;
10181 }
10182
10183
10184
10186 {
10187 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10189 }
10190
10193 {
10194 return null;
10195 }
10196
10198 {
10199 return false;
10200 }
10201
10203 {
10204 return false;
10205 }
10206
10210
10211
10213 {
10214 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10215 return module_repairing.CanRepair(this, item_repair_kit);
10216 }
10217
10218
10219 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10220 {
10221 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10222 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10223 }
10224
10225
10227 {
10228
10229
10230
10231
10232
10233
10234
10235
10236 return 1;
10237 }
10238
10239
10240
10242 {
10244 }
10245
10246
10247
10249 {
10251 }
10252
10253
10262 {
10263 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10264
10265 if (player)
10266 {
10267 player.MessageStatus(text);
10268 }
10269 }
10270
10271
10280 {
10281 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10282
10283 if (player)
10284 {
10285 player.MessageAction(text);
10286 }
10287 }
10288
10289
10298 {
10299 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10300
10301 if (player)
10302 {
10303 player.MessageFriendly(text);
10304 }
10305 }
10306
10307
10316 {
10317 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10318
10319 if (player)
10320 {
10321 player.MessageImportant(text);
10322 }
10323 }
10324
10326 {
10327 return true;
10328 }
10329
10330
10331 override bool KindOf(
string tag)
10332 {
10333 bool found = false;
10334 string item_name = this.
GetType();
10337
10338 int array_size = item_tag_array.Count();
10339 for (int i = 0; i < array_size; i++)
10340 {
10341 if (item_tag_array.Get(i) == tag)
10342 {
10343 found = true;
10344 break;
10345 }
10346 }
10347 return found;
10348 }
10349
10350
10352 {
10353
10354 super.OnRPC(sender, rpc_type,ctx);
10355
10356
10357 switch (rpc_type)
10358 {
10359 #ifndef SERVER
10360 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10361 Param2<bool, string> p = new Param2<bool, string>(false, "");
10362
10364 return;
10365
10366 bool play = p.param1;
10367 string soundSet = p.param2;
10368
10369 if (play)
10370 {
10372 {
10374 {
10376 }
10377 }
10378 else
10379 {
10381 }
10382 }
10383 else
10384 {
10386 }
10387
10388 break;
10389 #endif
10390
10391 }
10392
10394 {
10396 }
10397 }
10398
10399
10400
10401
10403 {
10404 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10405 return plugin.GetID(
name);
10406 }
10407
10409 {
10410 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10411 return plugin.GetName(id);
10412 }
10413
10416 {
10417
10418
10419 int varFlags;
10420 if (!ctx.
Read(varFlags))
10421 return;
10422
10423 if (varFlags & ItemVariableFlags.FLOAT)
10424 {
10426 }
10427 }
10428
10430 {
10431
10432 super.SerializeNumericalVars(floats_out);
10433
10434
10435
10437 {
10439 }
10440
10442 {
10444 }
10445
10447 {
10449 }
10450
10452 {
10457 }
10458
10460 {
10462 }
10463 }
10464
10466 {
10467
10468 super.DeSerializeNumericalVars(floats);
10469
10470
10471 int index = 0;
10472 int mask = Math.Round(floats.Get(index));
10473
10474 index++;
10475
10477 {
10479 {
10481 }
10482 else
10483 {
10484 float quantity = floats.Get(index);
10485 SetQuantity(quantity,
true,
false,
false,
false);
10486 }
10487 index++;
10488 }
10489
10491 {
10492 float wet = floats.Get(index);
10494 index++;
10495 }
10496
10498 {
10499 int liquidtype = Math.Round(floats.Get(index));
10501 index++;
10502 }
10503
10505 {
10507 index++;
10509 index++;
10511 index++;
10513 index++;
10514 }
10515
10517 {
10518 int cleanness = Math.Round(floats.Get(index));
10520 index++;
10521 }
10522 }
10523
10525 {
10526 super.WriteVarsToCTX(ctx);
10527
10528
10530 {
10532 }
10533
10535 {
10537 }
10538
10540 {
10542 }
10543
10545 {
10546 int r,g,b,a;
10552 }
10553
10555 {
10557 }
10558 }
10559
10561 {
10562 if (!super.ReadVarsFromCTX(ctx,version))
10563 return false;
10564
10565 int intValue;
10566 float value;
10567
10568 if (version < 140)
10569 {
10570 if (!ctx.
Read(intValue))
10571 return false;
10572
10573 m_VariablesMask = intValue;
10574 }
10575
10577 {
10578 if (!ctx.
Read(value))
10579 return false;
10580
10582 {
10584 }
10585 else
10586 {
10588 }
10589 }
10590
10591 if (version < 140)
10592 {
10594 {
10595 if (!ctx.
Read(value))
10596 return false;
10597 SetTemperatureDirect(value);
10598 }
10599 }
10600
10602 {
10603 if (!ctx.
Read(value))
10604 return false;
10606 }
10607
10609 {
10610 if (!ctx.
Read(intValue))
10611 return false;
10613 }
10614
10616 {
10617 int r,g,b,a;
10619 return false;
10621 return false;
10623 return false;
10625 return false;
10626
10628 }
10629
10631 {
10632 if (!ctx.
Read(intValue))
10633 return false;
10635 }
10636
10637 if (version >= 138 && version < 140)
10638 {
10640 {
10641 if (!ctx.
Read(intValue))
10642 return false;
10643 SetFrozen(intValue);
10644 }
10645 }
10646
10647 return true;
10648 }
10649
10650
10652 {
10655 {
10657 }
10658
10659 if (!super.OnStoreLoad(ctx, version))
10660 {
10662 return false;
10663 }
10664
10665 if (version >= 114)
10666 {
10667 bool hasQuickBarIndexSaved;
10668
10669 if (!ctx.
Read(hasQuickBarIndexSaved))
10670 {
10672 return false;
10673 }
10674
10675 if (hasQuickBarIndexSaved)
10676 {
10677 int itmQBIndex;
10678
10679
10680 if (!ctx.
Read(itmQBIndex))
10681 {
10683 return false;
10684 }
10685
10686 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10687 if (itmQBIndex != -1 && parentPlayer)
10688 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10689 }
10690 }
10691 else
10692 {
10693
10694 PlayerBase player;
10695 int itemQBIndex;
10696 if (version ==
int.
MAX)
10697 {
10698 if (!ctx.
Read(itemQBIndex))
10699 {
10701 return false;
10702 }
10703 }
10704 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10705 {
10706
10707 if (!ctx.
Read(itemQBIndex))
10708 {
10710 return false;
10711 }
10712 if (itemQBIndex != -1 && player)
10713 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10714 }
10715 }
10716
10717 if (version < 140)
10718 {
10719
10720 if (!LoadVariables(ctx, version))
10721 {
10723 return false;
10724 }
10725 }
10726
10727
10729 {
10731 return false;
10732 }
10733 if (version >= 132)
10734 {
10736 if (raib)
10737 {
10739 {
10741 return false;
10742 }
10743 }
10744 }
10745
10747 return true;
10748 }
10749
10750
10751
10753 {
10754 super.OnStoreSave(ctx);
10755
10756 PlayerBase player;
10757 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10758 {
10760
10761 int itemQBIndex = -1;
10762 itemQBIndex = player.FindQuickBarEntityIndex(this);
10763 ctx.
Write(itemQBIndex);
10764 }
10765 else
10766 {
10768 }
10769
10771
10773 if (raib)
10774 {
10776 }
10777 }
10778
10779
10781 {
10782 super.AfterStoreLoad();
10783
10785 {
10787 }
10788
10790 {
10793 }
10794 }
10795
10797 {
10798 super.EEOnAfterLoad();
10799
10801 {
10803 }
10804
10807 }
10808
10810 {
10811 return false;
10812 }
10813
10814
10815
10817 {
10819 {
10820 #ifdef PLATFORM_CONSOLE
10821
10823 {
10825 if (menu)
10826 {
10828 }
10829 }
10830 #endif
10831 }
10832
10834 {
10837 }
10838
10840 {
10841 SetWeightDirty();
10843 }
10845 {
10848 }
10849
10851 {
10854 }
10856 {
10859 }
10860
10861 super.OnVariablesSynchronized();
10862 }
10863
10864
10865
10867 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10868 {
10869 if (!IsServerCheck(allow_client))
10870 return false;
10871
10873 return false;
10874
10877
10878 if (value <= (min + 0.001))
10879 value = min;
10880
10881 if (value == min)
10882 {
10883 if (destroy_config)
10884 {
10885 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10886 if (dstr)
10887 {
10889 this.Delete();
10890 return true;
10891 }
10892 }
10893 else if (destroy_forced)
10894 {
10896 this.Delete();
10897 return true;
10898 }
10899
10901 }
10902
10905
10907 {
10909
10910 if (delta)
10912 }
10913
10915
10916 return false;
10917 }
10918
10919
10921 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10922 {
10924 }
10925
10927 {
10930 }
10931
10933 {
10936 }
10937
10939 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10940 {
10941 float value_clamped = Math.Clamp(value, 0, 1);
10943 SetQuantity(result, destroy_config, destroy_forced);
10944 }
10945
10946
10949 {
10951 }
10952
10954 {
10956 }
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10968 {
10969 int slot = -1;
10970 if (GetInventory())
10971 {
10972 InventoryLocation il = new InventoryLocation;
10973 GetInventory().GetCurrentInventoryLocation(il);
10975 }
10976
10978 }
10979
10981 {
10982 float quantity_max = 0;
10983
10985 {
10986 if (attSlotID != -1)
10987 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10988
10989 if (quantity_max <= 0)
10991 }
10992
10993 if (quantity_max <= 0)
10995
10996 return quantity_max;
10997 }
10998
11000 {
11002 }
11003
11005 {
11007 }
11008
11009
11011 {
11013 }
11014
11016 {
11018 }
11019
11021 {
11023 }
11024
11025
11027 {
11028
11029 float weightEx = GetWeightEx();
11030 float special = GetInventoryAndCargoWeight();
11031 return weightEx - special;
11032 }
11033
11034
11036 {
11038 }
11039
11041 {
11043 {
11044 #ifdef DEVELOPER
11045 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11046 {
11047 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11049 }
11050 #endif
11051
11052 return GetQuantity() * GetConfigWeightModified();
11053 }
11054 else if (HasEnergyManager())
11055 {
11056 #ifdef DEVELOPER
11057 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11058 {
11059 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11060 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11061 }
11062 #endif
11063 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11064 }
11065 else
11066 {
11067 #ifdef DEVELOPER
11068 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11069 {
11070 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11071 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11072 }
11073 #endif
11074 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11075 }
11076 }
11077
11080 {
11081 int item_count = 0;
11083
11084 if (GetInventory().GetCargo() != NULL)
11085 {
11086 item_count = GetInventory().GetCargo().GetItemCount();
11087 }
11088
11089 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11090 {
11091 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11092 if (item)
11093 item_count += item.GetNumberOfItems();
11094 }
11095 return item_count;
11096 }
11097
11100 {
11101 float weight = 0;
11102 float wetness = 1;
11103 if (include_wetness)
11106 {
11107 weight = wetness * m_ConfigWeight;
11108 }
11110 {
11111 weight = 1;
11112 }
11113 return weight;
11114 }
11115
11116
11117
11119 {
11120 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11121 {
11122 GameInventory inv = GetInventory();
11123 array<EntityAI> items = new array<EntityAI>;
11125 for (int i = 0; i < items.Count(); i++)
11126 {
11128 if (item)
11129 {
11131 }
11132 }
11133 }
11134 }
11135
11136
11137
11138
11140 {
11141 float energy = 0;
11142 if (HasEnergyManager())
11143 {
11144 energy = GetCompEM().GetEnergy();
11145 }
11146 return energy;
11147 }
11148
11149
11151 {
11152 super.OnEnergyConsumed();
11153
11155 }
11156
11158 {
11159 super.OnEnergyAdded();
11160
11162 }
11163
11164
11166 {
11167 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11168 {
11170 {
11171 float energy_0to1 = GetCompEM().GetEnergy0To1();
11173 }
11174 }
11175 }
11176
11177
11179 {
11180 return ConfigGetFloat("heatIsolation");
11181 }
11182
11184 {
11186 }
11187
11189 {
11190 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11191 if (
GetGame().ConfigIsExisting(paramPath))
11193
11194 return 0.0;
11195 }
11196
11198 {
11199 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11200 if (
GetGame().ConfigIsExisting(paramPath))
11202
11203 return 0.0;
11204 }
11205
11206 override void SetWet(
float value,
bool allow_client =
false)
11207 {
11208 if (!IsServerCheck(allow_client))
11209 return;
11210
11213
11215
11216 m_VarWet = Math.Clamp(value, min, max);
11217
11219 {
11222 }
11223 }
11224
11225 override void AddWet(
float value)
11226 {
11228 }
11229
11231 {
11233 }
11234
11236 {
11238 }
11239
11241 {
11243 }
11244
11246 {
11248 }
11249
11251 {
11253 }
11254
11255 override void OnWetChanged(
float newVal,
float oldVal)
11256 {
11259 if (newLevel != oldLevel)
11260 {
11262 }
11263 }
11264
11266 {
11267 SetWeightDirty();
11268 }
11269
11271 {
11272 return GetWetLevelInternal(
m_VarWet);
11273 }
11274
11275
11276
11278 {
11280 }
11281
11283 {
11285 }
11286
11288 {
11290 }
11291
11293 {
11295 }
11296
11297
11298
11300 {
11301 if (ConfigIsExisting("itemModelLength"))
11302 {
11303 return ConfigGetFloat("itemModelLength");
11304 }
11305 return 0;
11306 }
11307
11309 {
11310 if (ConfigIsExisting("itemAttachOffset"))
11311 {
11312 return ConfigGetFloat("itemAttachOffset");
11313 }
11314 return 0;
11315 }
11316
11317 override void SetCleanness(
int value,
bool allow_client =
false)
11318 {
11319 if (!IsServerCheck(allow_client))
11320 return;
11321
11323
11325
11328 }
11329
11331 {
11333 }
11334
11336 {
11337 return true;
11338 }
11339
11340
11341
11342
11344 {
11346 }
11347
11349 {
11351 }
11352
11353
11354
11355
11356 override void SetColor(
int r,
int g,
int b,
int a)
11357 {
11363 }
11365 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11366 {
11371 }
11372
11374 {
11376 }
11377
11380 {
11381 int r,g,b,a;
11383 r = r/255;
11384 g = g/255;
11385 b = b/255;
11386 a = a/255;
11387 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11388 }
11389
11390
11391
11392 override void SetLiquidType(
int value,
bool allow_client =
false)
11393 {
11394 if (!IsServerCheck(allow_client))
11395 return;
11396
11401 }
11402
11404 {
11405 return ConfigGetInt("varLiquidTypeInit");
11406 }
11407
11409 {
11411 }
11412
11414 {
11416 SetFrozen(false);
11417 }
11418
11421 {
11422 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11423 }
11424
11425
11428 {
11429 PlayerBase nplayer;
11430 if (PlayerBase.CastTo(nplayer, player))
11431 {
11433
11434 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11435 }
11436 }
11437
11438
11441 {
11442 PlayerBase nplayer;
11443 if (PlayerBase.CastTo(nplayer,player))
11444 {
11445
11446 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11447
11448 }
11449
11450
11451 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11452
11453
11454 if (HasEnergyManager())
11455 {
11456 GetCompEM().UpdatePlugState();
11457 }
11458 }
11459
11460
11462 {
11463 super.OnPlacementStarted(player);
11464
11466 }
11467
11468 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11469 {
11471 {
11472 m_AdminLog.OnPlacementComplete(player,
this);
11473 }
11474
11475 super.OnPlacementComplete(player, position, orientation);
11476 }
11477
11478
11479
11480
11481
11483 {
11485 {
11486 return true;
11487 }
11488 else
11489 {
11490 return false;
11491 }
11492 }
11493
11494
11496 {
11498 {
11500 }
11501 }
11502
11503
11505 {
11507 }
11508
11510 {
11512 }
11513
11514 override void InsertAgent(
int agent,
float count = 1)
11515 {
11516 if (count < 1)
11517 return;
11518
11520 }
11521
11524 {
11526 }
11527
11528
11530 {
11532 }
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11576 {
11578 return false;
11579 return true;
11580 }
11581
11583 {
11584
11586 }
11587
11588
11591 {
11592 super.CheckForRoofLimited(timeTresholdMS);
11593
11595 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11596 {
11597 m_PreviousRoofTestTime = time;
11598 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11599 }
11600 }
11601
11602
11604 {
11606 {
11607 return 0;
11608 }
11609
11610 if (GetInventory().GetAttachmentSlotsCount() != 0)
11611 {
11612 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11613 if (filter)
11614 return filter.GetProtectionLevel(type, false, system);
11615 else
11616 return 0;
11617 }
11618
11619 string subclassPath, entryName;
11620
11621 switch (type)
11622 {
11624 entryName = "biological";
11625 break;
11627 entryName = "chemical";
11628 break;
11629 default:
11630 entryName = "biological";
11631 break;
11632 }
11633
11634 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11635
11637 }
11638
11639
11640
11643 {
11644 if (!IsMagazine())
11646
11648 }
11649
11650
11651
11652
11653
11658 {
11659 return true;
11660 }
11661
11663 {
11665 }
11666
11667
11668
11669
11670
11672 {
11673 if (parent)
11674 {
11675 if (parent.IsInherited(DayZInfected))
11676 return true;
11677
11678 if (!parent.IsRuined())
11679 return true;
11680 }
11681
11682 return true;
11683 }
11684
11686 {
11687 if (!super.CanPutAsAttachment(parent))
11688 {
11689 return false;
11690 }
11691
11692 if (!IsRuined() && !parent.IsRuined())
11693 {
11694 return true;
11695 }
11696
11697 return false;
11698 }
11699
11701 {
11702
11703
11704
11705
11706 return super.CanReceiveItemIntoCargo(item);
11707 }
11708
11710 {
11711
11712
11713
11714
11715 GameInventory attachmentInv = attachment.GetInventory();
11717 {
11718 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11719 return false;
11720 }
11721
11722 InventoryLocation loc = new InventoryLocation();
11723 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11724 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11725 return false;
11726
11727 return super.CanReceiveAttachment(attachment, slotId);
11728 }
11729
11731 {
11732 if (!super.CanReleaseAttachment(attachment))
11733 return false;
11734
11735 return GetInventory().AreChildrenAccessible();
11736 }
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11759 {
11760 int id = muzzle_owner.GetMuzzleID();
11761 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11762
11763 if (WPOF_array)
11764 {
11765 for (int i = 0; i < WPOF_array.Count(); i++)
11766 {
11767 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11768
11769 if (WPOF)
11770 {
11771 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11772 }
11773 }
11774 }
11775 }
11776
11777
11779 {
11780 int id = muzzle_owner.GetMuzzleID();
11782
11783 if (WPOBE_array)
11784 {
11785 for (int i = 0; i < WPOBE_array.Count(); i++)
11786 {
11787 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11788
11789 if (WPOBE)
11790 {
11791 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11792 }
11793 }
11794 }
11795 }
11796
11797
11799 {
11800 int id = muzzle_owner.GetMuzzleID();
11801 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11802
11803 if (WPOOH_array)
11804 {
11805 for (int i = 0; i < WPOOH_array.Count(); i++)
11806 {
11807 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11808
11809 if (WPOOH)
11810 {
11811 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11812 }
11813 }
11814 }
11815 }
11816
11817
11819 {
11820 int id = muzzle_owner.GetMuzzleID();
11821 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11822
11823 if (WPOOH_array)
11824 {
11825 for (int i = 0; i < WPOOH_array.Count(); i++)
11826 {
11827 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11828
11829 if (WPOOH)
11830 {
11831 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11832 }
11833 }
11834 }
11835 }
11836
11837
11839 {
11840 int id = muzzle_owner.GetMuzzleID();
11841 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11842
11843 if (WPOOH_array)
11844 {
11845 for (int i = 0; i < WPOOH_array.Count(); i++)
11846 {
11847 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11848
11849 if (WPOOH)
11850 {
11851 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11852 }
11853 }
11854 }
11855 }
11856
11857
11858
11860 {
11862 {
11863 return true;
11864 }
11865
11866 return false;
11867 }
11868
11870 {
11872 {
11873 return true;
11874 }
11875
11876 return false;
11877 }
11878
11880 {
11882 {
11883 return true;
11884 }
11885
11886 return false;
11887 }
11888
11890 {
11891 return false;
11892 }
11893
11896 {
11897 return UATimeSpent.DEFAULT_DEPLOY;
11898 }
11899
11900
11901
11902
11904 {
11906 SetSynchDirty();
11907 }
11908
11910 {
11912 }
11913
11914
11916 {
11917 return false;
11918 }
11919
11922 {
11923 string att_type = "None";
11924
11925 if (ConfigIsExisting("soundAttType"))
11926 {
11927 att_type = ConfigGetString("soundAttType");
11928 }
11929
11931 }
11932
11934 {
11936 }
11937
11938
11939
11940
11941
11947
11949 {
11952
11954 }
11955
11956
11958 {
11960 return;
11961
11963
11966
11969
11970 SoundParameters params = new SoundParameters();
11974 }
11975
11976
11978 {
11980 return;
11981
11983 SetSynchDirty();
11984
11987 }
11988
11989
11991 {
11993 return;
11994
11996 SetSynchDirty();
11997
12000 }
12001
12003 {
12005 }
12006
12008 {
12010 }
12011
12014 {
12015 if (!
GetGame().IsDedicatedServer())
12016 {
12017 if (ConfigIsExisting("attachSoundSet"))
12018 {
12019 string cfg_path = "";
12020 string soundset = "";
12021 string type_name =
GetType();
12022
12025 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12026 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12027
12028 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12029 {
12030 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12031 {
12032 if (cfg_slot_array[i] == slot_type)
12033 {
12034 soundset = cfg_soundset_array[i];
12035 break;
12036 }
12037 }
12038 }
12039
12040 if (soundset != "")
12041 {
12042 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12044 }
12045 }
12046 }
12047 }
12048
12050 {
12051
12052 }
12053
12054 void OnApply(PlayerBase player);
12055
12057 {
12058 return 1.0;
12059 };
12060
12062 {
12064 }
12065
12067 {
12069 }
12070
12072
12074 {
12075 SetDynamicPhysicsLifeTime(0.01);
12077 }
12078
12080 {
12081 array<string> zone_names = new array<string>;
12082 GetDamageZones(zone_names);
12083 for (int i = 0; i < zone_names.Count(); i++)
12084 {
12085 SetHealthMax(zone_names.Get(i),"Health");
12086 }
12087 SetHealthMax("","Health");
12088 }
12089
12092 {
12093 float global_health = GetHealth01("","Health");
12094 array<string> zones = new array<string>;
12095 GetDamageZones(zones);
12096
12097 for (int i = 0; i < zones.Count(); i++)
12098 {
12099 SetHealth01(zones.Get(i),"Health",global_health);
12100 }
12101 }
12102
12105 {
12106 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12107 }
12108
12110 {
12111 if (!hasRootAsPlayer)
12112 {
12113 if (refParentIB)
12114 {
12115
12116 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12117 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12118
12119 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12120 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12121
12124 }
12125 else
12126 {
12127
12130 }
12131 }
12132 }
12133
12135 {
12137 {
12138 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12139 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12140 {
12141 float heatPermCoef = 1.0;
12143 while (ent)
12144 {
12145 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12146 ent = ent.GetHierarchyParent();
12147 }
12148
12149 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12150 }
12151 }
12152 }
12153
12155 {
12156
12157 EntityAI parent = GetHierarchyParent();
12158 if (!parent)
12159 {
12160 hasParent = false;
12161 hasRootAsPlayer = false;
12162 }
12163 else
12164 {
12165 hasParent = true;
12166 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12167 refParentIB =
ItemBase.Cast(parent);
12168 }
12169 }
12170
12171 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12172 {
12173
12174 }
12175
12177 {
12178
12179 return false;
12180 }
12181
12183 {
12184
12185
12186 return false;
12187 }
12188
12190 {
12191
12192 return false;
12193 }
12194
12197 {
12198 return !GetIsFrozen() &&
IsOpen();
12199 }
12200
12202 {
12203 bool hasParent = false, hasRootAsPlayer = false;
12205
12206 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12207 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12208
12209 if (wwtu || foodDecay)
12210 {
12214
12215 if (processWetness || processTemperature || processDecay)
12216 {
12218
12219 if (processWetness)
12220 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12221
12222 if (processTemperature)
12224
12225 if (processDecay)
12226 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12227 }
12228 }
12229 }
12230
12233 {
12235 }
12236
12238 {
12241
12242 return super.GetTemperatureFreezeThreshold();
12243 }
12244
12246 {
12249
12250 return super.GetTemperatureThawThreshold();
12251 }
12252
12254 {
12257
12258 return super.GetItemOverheatThreshold();
12259 }
12260
12262 {
12264 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12265
12266 return super.GetTemperatureFreezeTime();
12267 }
12268
12270 {
12272 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12273
12274 return super.GetTemperatureThawTime();
12275 }
12276
12281
12283 {
12284 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12285 }
12286
12288 {
12289 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12290 }
12291
12294 {
12296 }
12297
12299 {
12301 }
12302
12304 {
12306 }
12307
12310 {
12311 return null;
12312 }
12313
12316 {
12317 return false;
12318 }
12319
12321 {
12323 {
12326 if (!trg)
12327 {
12329 explosive = this;
12330 }
12331
12332 explosive.PairRemote(trg);
12334
12335 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12336 trg.SetPersistentPairID(persistentID);
12337 explosive.SetPersistentPairID(persistentID);
12338
12339 return true;
12340 }
12341 return false;
12342 }
12343
12346 {
12347 float ret = 1.0;
12350 ret *= GetHealth01();
12351
12352 return ret;
12353 }
12354
12355 #ifdef DEVELOPER
12356 override void SetDebugItem()
12357 {
12358 super.SetDebugItem();
12359 _itemBase = this;
12360 }
12361
12363 {
12364 string text = super.GetDebugText();
12365
12367 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12368
12369 return text;
12370 }
12371 #endif
12372
12374 {
12375 return true;
12376 }
12377
12379
12381
12383 {
12386 }
12387
12388
12396
12412}
12413
12415{
12417 if (entity)
12418 {
12419 bool is_item = entity.IsInherited(
ItemBase);
12420 if (is_item && full_quantity)
12421 {
12424 }
12425 }
12426 else
12427 {
12429 return NULL;
12430 }
12431 return entity;
12432}
12433
12435{
12436 if (item)
12437 {
12438 if (health > 0)
12439 item.SetHealth("", "", health);
12440
12441 if (item.CanHaveTemperature())
12442 {
12444 if (item.CanFreeze())
12445 item.SetFrozen(false);
12446 }
12447
12448 if (item.HasEnergyManager())
12449 {
12450 if (quantity >= 0)
12451 {
12452 item.GetCompEM().SetEnergy0To1(quantity);
12453 }
12454 else
12455 {
12457 }
12458 }
12459 else if (item.IsMagazine())
12460 {
12461 Magazine mag = Magazine.Cast(item);
12462 if (quantity >= 0)
12463 {
12464 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12465 }
12466 else
12467 {
12469 }
12470
12471 }
12472 else
12473 {
12474 if (quantity >= 0)
12475 {
12476 item.SetQuantityNormalized(quantity, false);
12477 }
12478 else
12479 {
12481 }
12482
12483 }
12484 }
12485}
12486
12487#ifdef DEVELOPER
12489#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
Open
Implementations only.
override void EEOnCECreate()
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 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)
bool ShouldSplitQuantity(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)
override 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...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
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()
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)
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 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 void GizmoSelectObject(Object object)
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 native void GizmoSelectPhysics(Physics physics)
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
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 string GetFoldSoundset()
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 string GetLoopFoldSoundset()
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.