7687{
7689 {
7690 return true;
7691 }
7692};
7693
7694
7695
7697{
7701
7703
7706
7707
7708
7709
7710
7719
7725
7730
7735
7756 protected bool m_IsResultOfSplit
7757
7759
7764
7765
7766
7768
7772
7773
7774
7776
7779
7780
7781
7787
7788
7796
7799
7800
7802
7803
7805
7806
7811
7812
7817
7818
7820
7821
7823 {
7828
7829 if (!
GetGame().IsDedicatedServer())
7830 {
7832 {
7834
7836 {
7838 }
7839 }
7840
7843 }
7844
7845 m_OldLocation = null;
7846
7848 {
7850 }
7851
7852 if (ConfigIsExisting("headSelectionsToHide"))
7853 {
7856 }
7857
7859 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7860 {
7862 }
7863
7865
7866 m_IsResultOfSplit = false;
7867
7869 }
7870
7872 {
7873 super.InitItemVariables();
7874
7880 m_Count = ConfigGetInt(
"count");
7881
7884
7889
7892
7897
7909
7913
7914
7917 if (ConfigIsExisting("canBeSplit"))
7918 {
7921 }
7922
7924 if (ConfigIsExisting("itemBehaviour"))
7926
7927
7930 RegisterNetSyncVariableInt("m_VarLiquidType");
7931 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7932
7933 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7934 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7935 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7936
7937 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7938 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7939 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7940 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7941
7942 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7943 RegisterNetSyncVariableBool("m_IsTakeable");
7944 RegisterNetSyncVariableBool("m_IsHologram");
7945
7948 {
7951 }
7952
7954
7956 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7958
7959 }
7960
7962 {
7964 }
7965
7967 {
7970 {
7975 }
7976 }
7977
7978 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7979 {
7981 {
7984 }
7985
7987 }
7988
7990 {
7996 }
7997
7999
8001 {
8003
8004 if (!action)
8005 {
8006 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8007 return;
8008 }
8009
8011 if (!ai)
8012 {
8014 return;
8015 }
8016
8018 if (!action_array)
8019 {
8020 action_array = new array<ActionBase_Basic>;
8022 }
8023 if (LogManager.IsActionLogEnable())
8024 {
8025 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8026 }
8027
8028 if (action_array.Find(action) != -1)
8029 {
8030 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8031 }
8032 else
8033 {
8034 action_array.Insert(action);
8035 }
8036 }
8037
8039 {
8041 ActionBase action = player.GetActionManager().GetAction(actionName);
8044
8045 if (action_array)
8046 {
8047 action_array.RemoveItem(action);
8048 }
8049 }
8050
8051
8052
8054 {
8055 ActionOverrideData overrideData = new ActionOverrideData();
8059
8061 if (!actionMap)
8062 {
8065 }
8066
8067 actionMap.Insert(this.
Type(), overrideData);
8068
8069 }
8070
8072
8074
8075
8077 {
8080
8083
8084 string config_to_search = "CfgVehicles";
8085 string muzzle_owner_config;
8086
8088 {
8089 if (IsInherited(Weapon))
8090 config_to_search = "CfgWeapons";
8091
8092 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8093
8094 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8095
8097
8098 if (config_OnFire_subclass_count > 0)
8099 {
8100 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8101
8102 for (int i = 0; i < config_OnFire_subclass_count; i++)
8103 {
8104 string particle_class = "";
8106 string config_OnFire_entry = config_OnFire_class + particle_class;
8107 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8108 WPOF_array.Insert(WPOF);
8109 }
8110
8111
8113 }
8114 }
8115
8117 {
8118 config_to_search = "CfgWeapons";
8119 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8120
8121 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8122
8124
8125 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8126 {
8127 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8128
8129 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8130 {
8131 string particle_class2 = "";
8133 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8134 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8135 WPOBE_array.Insert(WPOBE);
8136 }
8137
8138
8140 }
8141 }
8142 }
8143
8144
8146 {
8149
8151 {
8152 string config_to_search = "CfgVehicles";
8153
8154 if (IsInherited(Weapon))
8155 config_to_search = "CfgWeapons";
8156
8157 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8158 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8159
8160 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8161 {
8162
8164
8166 {
8168 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8170 return;
8171 }
8172
8175
8176
8177
8179 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8180
8181 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8182 {
8183 string particle_class = "";
8185 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8187
8188 if (entry_type == CT_CLASS)
8189 {
8190 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8191 WPOOH_array.Insert(WPOF);
8192 }
8193 }
8194
8195
8197 }
8198 }
8199 }
8200
8202 {
8204 }
8205
8207 {
8209 {
8211
8214
8217
8218 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8219 }
8220 }
8221
8223 {
8225 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8226
8228 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8229
8231 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8232
8234 {
8236 }
8237 }
8238
8240 {
8242 }
8243
8245 {
8248 else
8250
8252 {
8255 }
8256 else
8257 {
8260
8263 }
8264
8266 }
8267
8269 {
8271 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8272 }
8273
8275 {
8277 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8279 }
8280
8282 {
8284 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8285 }
8286
8288 {
8291
8292 OverheatingParticle OP = new OverheatingParticle();
8297
8299 }
8300
8302 {
8305
8306 return -1;
8307 }
8308
8310 {
8312 {
8315
8316 for (int i = count; i > 0; --i)
8317 {
8318 int id = i - 1;
8321
8324
8325 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8326 {
8327 if (p)
8328 {
8331 }
8332 }
8333 }
8334 }
8335 }
8336
8338 {
8340 {
8342 {
8343 int id = i - 1;
8345
8346 if (OP)
8347 {
8349
8350 if (p)
8351 {
8353 }
8354
8355 delete OP;
8356 }
8357 }
8358
8361 }
8362 }
8363
8366 {
8367 return 0.0;
8368 }
8369
8370
8372 {
8373 return 250;
8374 }
8375
8377 {
8378 return 0;
8379 }
8380
8383 {
8385 return true;
8386
8387 return false;
8388 }
8389
8392 {
8395
8397 {
8399 }
8400 else
8401 {
8402
8404 }
8405
8407 }
8408
8415 {
8416 return -1;
8417 }
8418
8419
8420
8421
8423 {
8425 {
8427 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8428
8429 if (r_index >= 0)
8430 {
8431 InventoryLocation r_il = new InventoryLocation;
8432 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8433
8434 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8437 {
8438 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8439 }
8441 {
8442 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8443 }
8444
8445 }
8446
8447 player.GetHumanInventory().ClearUserReservedLocation(this);
8448 }
8449
8452 }
8453
8454
8455
8456
8458 {
8459 return ItemBase.m_DebugActionsMask;
8460 }
8461
8463 {
8464 return ItemBase.m_DebugActionsMask & mask;
8465 }
8466
8468 {
8469 ItemBase.m_DebugActionsMask = mask;
8470 }
8471
8473 {
8474 ItemBase.m_DebugActionsMask |= mask;
8475 }
8476
8478 {
8479 ItemBase.m_DebugActionsMask &= ~mask;
8480 }
8481
8483 {
8485 {
8487 }
8488 else
8489 {
8491 }
8492 }
8493
8494
8496 {
8497 if (GetEconomyProfile())
8498 {
8499 float q_max = GetEconomyProfile().GetQuantityMax();
8500 if (q_max > 0)
8501 {
8502 float q_min = GetEconomyProfile().GetQuantityMin();
8503 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8504
8506 {
8507 ComponentEnergyManager comp = GetCompEM();
8509 {
8511 }
8512 }
8514 {
8516
8517 }
8518
8519 }
8520 }
8521 }
8522
8525 {
8526 EntityAI parent = GetHierarchyParent();
8527
8528 if (parent)
8529 {
8530 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8531 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8532 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8533 }
8534 }
8535
8538 {
8539 EntityAI parent = GetHierarchyParent();
8540
8541 if (parent)
8542 {
8543 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8544 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8545 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8546 }
8547 }
8548
8550 {
8551
8552
8553
8554
8556
8558 {
8559 if (ScriptInputUserData.CanStoreInputUserData())
8560 {
8561 ScriptInputUserData ctx = new ScriptInputUserData;
8567 ctx.
Write(use_stack_max);
8570
8572 {
8573 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8574 }
8575 }
8576 }
8577 else if (!
GetGame().IsMultiplayer())
8578 {
8580 }
8581 }
8582
8584 {
8586 }
8587
8589 {
8591 }
8592
8594 {
8596 }
8597
8599 {
8600
8601 return false;
8602 }
8603
8605 {
8606 return false;
8607 }
8608
8612 {
8613 return false;
8614 }
8615
8617 {
8618 return "";
8619 }
8620
8622
8624 {
8625 return false;
8626 }
8627
8629 {
8630 return true;
8631 }
8632
8633
8634
8636 {
8637 return true;
8638 }
8639
8641 {
8642 return true;
8643 }
8644
8646 {
8647 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8649 }
8650
8652 {
8654 }
8655
8657 {
8659 if (!is_being_placed)
8661 SetSynchDirty();
8662 }
8663
8664
8666
8668 {
8670 }
8671
8673 {
8675 }
8676
8678 {
8679 return 1;
8680 }
8681
8683 {
8684 return false;
8685 }
8686
8688 {
8690 SetSynchDirty();
8691 }
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8728 {
8729 super.OnMovedInsideCargo(container);
8730
8731 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8732 }
8733
8734 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8735 {
8736 super.EEItemLocationChanged(oldLoc,newLoc);
8737
8738 PlayerBase new_player = null;
8739 PlayerBase old_player = null;
8740
8741 if (newLoc.GetParent())
8742 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8743
8744 if (oldLoc.GetParent())
8745 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8746
8748 {
8749 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8750
8751 if (r_index >= 0)
8752 {
8753 InventoryLocation r_il = new InventoryLocation;
8754 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8755
8756 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8759 {
8760 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8761 }
8763 {
8764 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8765 }
8766
8767 }
8768 }
8769
8771 {
8772 if (new_player)
8773 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8774
8775 if (new_player == old_player)
8776 {
8777
8778 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8779 {
8781 {
8782 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8783 {
8784 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8785 }
8786 }
8787 else
8788 {
8789 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8790 }
8791 }
8792
8793 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8794 {
8795 int type = oldLoc.GetType();
8797 {
8798 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8799 }
8801 {
8802 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8803 }
8804 }
8805 if (!m_OldLocation)
8806 {
8807 m_OldLocation = new InventoryLocation;
8808 }
8809 m_OldLocation.Copy(oldLoc);
8810 }
8811 else
8812 {
8813 if (m_OldLocation)
8814 {
8815 m_OldLocation.Reset();
8816 }
8817 }
8818
8820 }
8821 else
8822 {
8823 if (new_player)
8824 {
8825 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8826 if (res_index >= 0)
8827 {
8828 InventoryLocation il = new InventoryLocation;
8829 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8831 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8834 {
8835 il.
GetParent().GetOnReleaseLock().Invoke(it);
8836 }
8838 {
8840 }
8841
8842 }
8843 }
8845 {
8846
8848 }
8849
8850 if (m_OldLocation)
8851 {
8852 m_OldLocation.Reset();
8853 }
8854 }
8855 }
8856
8857 override void EOnContact(IEntity other, Contact extra)
8858 {
8860 {
8861 int liquidType = -1;
8863 if (impactSpeed > 0.0)
8864 {
8866 #ifndef SERVER
8868 #else
8870 SetSynchDirty();
8871 #endif
8873 }
8874 }
8875
8876 #ifdef SERVER
8877 if (GetCompEM() && GetCompEM().IsPlugged())
8878 {
8879 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8880 GetCompEM().UnplugThis();
8881 }
8882 #endif
8883 }
8884
8886
8888 {
8890 }
8891
8893 {
8894
8895 }
8896
8898 {
8899 super.OnItemLocationChanged(old_owner, new_owner);
8900
8901 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8902 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8903
8904 if (!relatedPlayer && playerNew)
8905 relatedPlayer = playerNew;
8906
8907 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8908 {
8910 if (actionMgr)
8911 {
8912 ActionBase currentAction = actionMgr.GetRunningAction();
8913 if (currentAction)
8915 }
8916 }
8917
8918 Man ownerPlayerOld = null;
8919 Man ownerPlayerNew = null;
8920
8921 if (old_owner)
8922 {
8923 if (old_owner.
IsMan())
8924 {
8925 ownerPlayerOld = Man.Cast(old_owner);
8926 }
8927 else
8928 {
8929 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8930 }
8931 }
8932 else
8933 {
8935 {
8937
8938 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8939 {
8940 GetCompEM().UnplugThis();
8941 }
8942 }
8943 }
8944
8945 if (new_owner)
8946 {
8947 if (new_owner.
IsMan())
8948 {
8949 ownerPlayerNew = Man.Cast(new_owner);
8950 }
8951 else
8952 {
8953 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8954 }
8955 }
8956
8957 if (ownerPlayerOld != ownerPlayerNew)
8958 {
8959 if (ownerPlayerOld)
8960 {
8961 array<EntityAI> subItemsExit = new array<EntityAI>;
8963 for (int i = 0; i < subItemsExit.Count(); i++)
8964 {
8967 }
8968 }
8969
8970 if (ownerPlayerNew)
8971 {
8972 array<EntityAI> subItemsEnter = new array<EntityAI>;
8974 for (int j = 0; j < subItemsEnter.Count(); j++)
8975 {
8978 }
8979 }
8980 }
8981 else if (ownerPlayerNew != null)
8982 {
8983 PlayerBase nplayer;
8984 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8985 {
8986 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8988 for (int k = 0; k < subItemsUpdate.Count(); k++)
8989 {
8991 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8992 }
8993 }
8994 }
8995
8996 if (old_owner)
8997 old_owner.OnChildItemRemoved(this);
8998 if (new_owner)
8999 new_owner.OnChildItemReceived(this);
9000 }
9001
9002
9004 {
9005 super.EEDelete(parent);
9006 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9007 if (player)
9008 {
9010
9011 if (player.IsAlive())
9012 {
9013 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9014 if (r_index >= 0)
9015 {
9016 InventoryLocation r_il = new InventoryLocation;
9017 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9018
9019 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9022 {
9023 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9024 }
9026 {
9027 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9028 }
9029
9030 }
9031
9032 player.RemoveQuickBarEntityShortcut(this);
9033 }
9034 }
9035 }
9036
9038 {
9039 super.EEKilled(killer);
9040
9043 {
9044 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9045 {
9046 if (IsMagazine())
9047 {
9048 if (Magazine.Cast(this).GetAmmoCount() > 0)
9049 {
9051 }
9052 }
9053 else
9054 {
9056 }
9057 }
9058 }
9059 }
9060
9062 {
9063 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9064
9065 super.OnWasAttached(parent, slot_id);
9066
9069
9071 }
9072
9074 {
9075 super.OnWasDetached(parent, slot_id);
9076
9079 }
9080
9082 {
9083 int idx;
9086
9087 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9088 if (inventory_slots.Count() < 1)
9089 {
9090 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9091 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9092 }
9093 else
9094 {
9095 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9096 }
9097
9098 idx = inventory_slots.Find(slot);
9099 if (idx < 0)
9100 return "";
9101
9102 return attach_types.Get(idx);
9103 }
9104
9106 {
9107 int idx = -1;
9108 string slot;
9109
9112
9113 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9114 if (inventory_slots.Count() < 1)
9115 {
9116 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9117 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9118 }
9119 else
9120 {
9121 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9122 if (detach_types.Count() < 1)
9123 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9124 }
9125
9126 for (int i = 0; i < inventory_slots.Count(); i++)
9127 {
9128 slot = inventory_slots.Get(i);
9129 }
9130
9131 if (slot != "")
9132 {
9133 if (detach_types.Count() == 1)
9134 idx = 0;
9135 else
9136 idx = inventory_slots.Find(slot);
9137 }
9138 if (idx < 0)
9139 return "";
9140
9141 return detach_types.Get(idx);
9142 }
9143
9145 {
9146
9148
9149
9150 float min_time = 1;
9151 float max_time = 3;
9152 float delay = Math.RandomFloat(min_time, max_time);
9153
9154 explode_timer.Run(delay, this, "DoAmmoExplosion");
9155 }
9156
9158 {
9159 Magazine magazine = Magazine.Cast(this);
9160 int pop_sounds_count = 6;
9161 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9162
9163
9164 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9165 string sound_name = pop_sounds[ sound_idx ];
9167
9168
9169 magazine.ServerAddAmmoCount(-1);
9170
9171
9172 float min_temp_to_explode = 100;
9173
9174 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9175 {
9177 }
9178 }
9179
9180
9181 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9182 {
9183 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9184
9185 const int CHANCE_DAMAGE_CARGO = 4;
9186 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9187 const int CHANCE_DAMAGE_NOTHING = 2;
9188
9190 {
9191 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9192 int chances;
9193 int rnd;
9194
9195 if (GetInventory().GetCargo())
9196 {
9197 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9198 rnd = Math.RandomInt(0,chances);
9199
9200 if (rnd < CHANCE_DAMAGE_CARGO)
9201 {
9203 }
9204 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9205 {
9207 }
9208 }
9209 else
9210 {
9211 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9212 rnd = Math.RandomInt(0,chances);
9213
9214 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9215 {
9217 }
9218 }
9219 }
9220 }
9221
9223 {
9224 if (GetInventory().GetCargo())
9225 {
9226 int item_count = GetInventory().GetCargo().GetItemCount();
9227 if (item_count > 0)
9228 {
9229 int random_pick = Math.RandomInt(0, item_count);
9231 if (!item.IsExplosive())
9232 {
9233 item.AddHealth("","",damage);
9234 return true;
9235 }
9236 }
9237 }
9238 return false;
9239 }
9240
9242 {
9243 int attachment_count = GetInventory().AttachmentCount();
9244 if (attachment_count > 0)
9245 {
9246 int random_pick = Math.RandomInt(0, attachment_count);
9247 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9248 if (!attachment.IsExplosive())
9249 {
9250 attachment.AddHealth("","",damage);
9251 return true;
9252 }
9253 }
9254 return false;
9255 }
9256
9258 {
9260 }
9261
9263 {
9265 return GetInventory().CanRemoveEntity();
9266
9267 return false;
9268 }
9269
9271 {
9272
9274 return false;
9275
9276
9278 return false;
9279
9280
9281
9283 if (delta == 0)
9284 return false;
9285
9286
9287 return true;
9288 }
9289
9291 {
9293 {
9294 if (ScriptInputUserData.CanStoreInputUserData())
9295 {
9296 ScriptInputUserData ctx = new ScriptInputUserData;
9301 ctx.
Write(destination_entity);
9305 }
9306 }
9307 else if (!
GetGame().IsMultiplayer())
9308 {
9310 }
9311 }
9312
9314 {
9315 float split_quantity_new;
9319 InventoryLocation loc = new InventoryLocation;
9320
9321 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9322 {
9324 split_quantity_new = stack_max;
9325 else
9327
9329 {
9330 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9331 if (new_item)
9332 {
9333 new_item.SetResultOfSplit(true);
9334 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9336 new_item.
SetQuantity(split_quantity_new,
false,
true);
9337 }
9338 }
9339 }
9340 else if (destination_entity && slot_id == -1)
9341 {
9342 if (quantity > stack_max)
9343 split_quantity_new = stack_max;
9344 else
9345 split_quantity_new = quantity;
9346
9348 {
9350 {
9353 }
9354
9355 if (new_item)
9356 {
9357 new_item.SetResultOfSplit(true);
9358 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9360 new_item.
SetQuantity(split_quantity_new,
false,
true);
9361 }
9362 }
9363 }
9364 else
9365 {
9366 if (stack_max != 0)
9367 {
9369 {
9371 }
9372
9373 if (split_quantity_new == 0)
9374 {
9375 if (!
GetGame().IsMultiplayer())
9376 player.PhysicalPredictiveDropItem(this);
9377 else
9378 player.ServerDropEntity(this);
9379 return;
9380 }
9381
9383 {
9385
9386 if (new_item)
9387 {
9388 new_item.SetResultOfSplit(true);
9389 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9392 new_item.PlaceOnSurface();
9393 }
9394 }
9395 }
9396 }
9397 }
9398
9400 {
9401 float split_quantity_new;
9405 InventoryLocation loc = new InventoryLocation;
9406
9407 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9408 {
9410 split_quantity_new = stack_max;
9411 else
9413
9415 {
9416 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9417 if (new_item)
9418 {
9419 new_item.SetResultOfSplit(true);
9420 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9422 new_item.
SetQuantity(split_quantity_new,
false,
true);
9423 }
9424 }
9425 }
9426 else if (destination_entity && slot_id == -1)
9427 {
9428 if (quantity > stack_max)
9429 split_quantity_new = stack_max;
9430 else
9431 split_quantity_new = quantity;
9432
9434 {
9436 {
9439 }
9440
9441 if (new_item)
9442 {
9443 new_item.SetResultOfSplit(true);
9444 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9446 new_item.
SetQuantity(split_quantity_new,
false,
true);
9447 }
9448 }
9449 }
9450 else
9451 {
9452 if (stack_max != 0)
9453 {
9455 {
9457 }
9458
9460 {
9462
9463 if (new_item)
9464 {
9465 new_item.SetResultOfSplit(true);
9466 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9469 new_item.PlaceOnSurface();
9470 }
9471 }
9472 }
9473 }
9474 }
9475
9477 {
9479 {
9480 if (ScriptInputUserData.CanStoreInputUserData())
9481 {
9482 ScriptInputUserData ctx = new ScriptInputUserData;
9487 dst.WriteToContext(ctx);
9489 }
9490 }
9491 else if (!
GetGame().IsMultiplayer())
9492 {
9494 }
9495 }
9496
9498 {
9500 {
9501 if (ScriptInputUserData.CanStoreInputUserData())
9502 {
9503 ScriptInputUserData ctx = new ScriptInputUserData;
9508 ctx.
Write(destination_entity);
9514 }
9515 }
9516 else if (!
GetGame().IsMultiplayer())
9517 {
9519 }
9520 }
9521
9523 {
9525 }
9526
9528 {
9530 float split_quantity_new;
9532 if (dst.IsValid())
9533 {
9534 int slot_id = dst.GetSlot();
9536
9537 if (quantity > stack_max)
9538 split_quantity_new = stack_max;
9539 else
9540 split_quantity_new = quantity;
9541
9543 {
9545
9546 if (new_item)
9547 {
9548 new_item.SetResultOfSplit(true);
9549 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9551 new_item.
SetQuantity(split_quantity_new,
false,
true);
9552 }
9553
9554 return new_item;
9555 }
9556 }
9557
9558 return null;
9559 }
9560
9562 {
9564 float split_quantity_new;
9566 if (destination_entity)
9567 {
9569 if (quantity > stackable)
9570 split_quantity_new = stackable;
9571 else
9572 split_quantity_new = quantity;
9573
9575 {
9576 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9577 if (new_item)
9578 {
9579 new_item.SetResultOfSplit(true);
9580 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9582 new_item.
SetQuantity(split_quantity_new,
false,
true);
9583 }
9584 }
9585 }
9586 }
9587
9589 {
9591 {
9592 if (ScriptInputUserData.CanStoreInputUserData())
9593 {
9594 ScriptInputUserData ctx = new ScriptInputUserData;
9599 ItemBase destination_entity =
this;
9600 ctx.
Write(destination_entity);
9604 }
9605 }
9606 else if (!
GetGame().IsMultiplayer())
9607 {
9609 }
9610 }
9611
9613 {
9615 float split_quantity_new;
9617 if (player)
9618 {
9620 if (quantity > stackable)
9621 split_quantity_new = stackable;
9622 else
9623 split_quantity_new = quantity;
9624
9626 {
9627 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9628 new_item =
ItemBase.Cast(in_hands);
9629 if (new_item)
9630 {
9631 new_item.SetResultOfSplit(true);
9632 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9634 new_item.SetQuantity(split_quantity_new, false, true);
9635 }
9636 }
9637 }
9638 }
9639
9641 {
9643 float split_quantity_new = Math.Floor(quantity * 0.5);
9644
9646 return;
9647
9649
9650 if (new_item)
9651 {
9652 if (new_item.GetQuantityMax() < split_quantity_new)
9653 {
9654 split_quantity_new = new_item.GetQuantityMax();
9655 }
9656
9657 new_item.SetResultOfSplit(true);
9658 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9659
9661 {
9664 }
9665 else
9666 {
9668 new_item.
SetQuantity(split_quantity_new,
false,
true);
9669 }
9670 }
9671 }
9672
9674 {
9676 float split_quantity_new = Math.Floor(quantity / 2);
9677
9679 return;
9680
9681 InventoryLocation invloc = new InventoryLocation;
9683
9685 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9686
9687 if (new_item)
9688 {
9689 if (new_item.GetQuantityMax() < split_quantity_new)
9690 {
9691 split_quantity_new = new_item.GetQuantityMax();
9692 }
9694 {
9697 }
9698 else if (split_quantity_new > 1)
9699 {
9701 new_item.
SetQuantity(split_quantity_new,
false,
true);
9702 }
9703 }
9704 }
9705
9708 {
9709 SetWeightDirty();
9711
9712 if (parent)
9713 parent.OnAttachmentQuantityChangedEx(this, delta);
9714
9716 {
9718 {
9720 }
9722 {
9723 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9725 }
9726 }
9727
9728 }
9729
9732 {
9733
9734 }
9735
9738 {
9740 }
9741
9743 {
9744 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9745
9747 {
9748 if (newLevel == GameConstants.STATE_RUINED)
9749 {
9751 EntityAI parent = GetHierarchyParent();
9752 if (parent && parent.IsFireplace())
9753 {
9754 CargoBase cargo = GetInventory().GetCargo();
9755 if (cargo)
9756 {
9758 {
9760 }
9761 }
9762 }
9763 }
9764
9766 {
9767
9769 return;
9770 }
9771
9772 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9773 {
9775 }
9776 }
9777 }
9778
9779
9781 {
9782 super.OnRightClick();
9783
9785 {
9787 {
9788 if (ScriptInputUserData.CanStoreInputUserData())
9789 {
9790 EntityAI root = GetHierarchyRoot();
9791 Man playerOwner = GetHierarchyRootPlayer();
9792 InventoryLocation dst = new InventoryLocation;
9793
9794
9795 if (!playerOwner && root && root == this)
9796 {
9798 }
9799 else
9800 {
9801
9802 GetInventory().GetCurrentInventoryLocation(dst);
9804 {
9807 {
9809 }
9810 else
9811 {
9813
9814
9815 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9816 {
9818 }
9819 else
9820 {
9821 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9822 }
9823 }
9824 }
9825 }
9826
9827 ScriptInputUserData ctx = new ScriptInputUserData;
9835 }
9836 }
9837 else if (!
GetGame().IsMultiplayer())
9838 {
9840 }
9841 }
9842 }
9843
9845 {
9846 if (root)
9847 {
9848 vector m4[4];
9849 root.GetTransform(m4);
9850 dst.SetGround(this, m4);
9851 }
9852 else
9853 {
9854 GetInventory().GetCurrentInventoryLocation(dst);
9855 }
9856 }
9857
9858 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9859 {
9860
9861 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9862 return false;
9863
9864 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9865 return false;
9866
9867
9869 return false;
9870
9871
9872 Magazine mag = Magazine.Cast(this);
9873 if (mag)
9874 {
9875 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9876 return false;
9877
9878 if (stack_max_limit)
9879 {
9880 Magazine other_mag = Magazine.Cast(other_item);
9881 if (other_item)
9882 {
9883 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9884 return false;
9885 }
9886
9887 }
9888 }
9889 else
9890 {
9891
9893 return false;
9894
9896 return false;
9897 }
9898
9899 PlayerBase player = null;
9900 if (CastTo(player, GetHierarchyRootPlayer()))
9901 {
9902 if (player.GetInventory().HasAttachment(this))
9903 return false;
9904
9905 if (player.IsItemsToDelete())
9906 return false;
9907 }
9908
9909 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9910 return false;
9911
9912 int slotID;
9914 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9915 return false;
9916
9917 return true;
9918 }
9919
9921 {
9923 }
9924
9926 {
9927 return m_IsResultOfSplit;
9928 }
9929
9931 {
9932 m_IsResultOfSplit = value;
9933 }
9934
9936 {
9938 }
9939
9941 {
9942 float other_item_quantity = other_item.GetQuantity();
9943 float this_free_space;
9944
9946
9948
9949 if (other_item_quantity > this_free_space)
9950 {
9951 return this_free_space;
9952 }
9953 else
9954 {
9955 return other_item_quantity;
9956 }
9957 }
9958
9960 {
9962 }
9963
9965 {
9967 return;
9968
9969 if (!IsMagazine() && other_item)
9970 {
9972 if (quantity_used != 0)
9973 {
9974 float hp1 = GetHealth01("","");
9975 float hp2 = other_item.GetHealth01("","");
9976 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9977 hpResult = hpResult / (
GetQuantity() + quantity_used);
9978
9979 hpResult *= GetMaxHealth();
9980 Math.Round(hpResult);
9981 SetHealth("", "Health", hpResult);
9982
9984 other_item.AddQuantity(-quantity_used);
9985 }
9986 }
9988 }
9989
9991 {
9992 #ifdef SERVER
9993 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9994 GetHierarchyParent().IncreaseLifetimeUp();
9995 #endif
9996 };
9997
9999 {
10000 PlayerBase p = PlayerBase.Cast(player);
10001
10002 array<int> recipesIds = p.m_Recipes;
10003 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10004 if (moduleRecipesManager)
10005 {
10006 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10007 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10008 }
10009
10010 for (int i = 0;i < recipesIds.Count(); i++)
10011 {
10012 int key = recipesIds.Get(i);
10013 string recipeName = moduleRecipesManager.GetRecipeName(key);
10015 }
10016 }
10017
10018
10019 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10020 {
10021 super.GetDebugActions(outputList);
10022
10023
10029
10030
10035
10040
10041
10045
10046
10048 {
10052 }
10053
10056
10057
10061
10063
10064 InventoryLocation loc = new InventoryLocation();
10065 GetInventory().GetCurrentInventoryLocation(loc);
10067 {
10068 if (Gizmo_IsSupported())
10071 }
10072
10074 }
10075
10076
10077
10078
10080 {
10081 super.OnAction(action_id, player, ctx);
10082
10084 {
10085 switch (action_id)
10086 {
10089 return true;
10092 return true;
10093 }
10094 }
10095
10097 {
10098 switch (action_id)
10099 {
10101 Delete();
10102 return true;
10103 }
10104 }
10105
10106 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10107 {
10108 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10109 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10110 PlayerBase p = PlayerBase.Cast(player);
10111 if (
EActions.RECIPES_RANGE_START < 1000)
10112 {
10113 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10114 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10115 }
10116 }
10117 #ifndef SERVER
10118 else if (action_id ==
EActions.WATCH_PLAYER)
10119 {
10120 PluginDeveloper.SetDeveloperItemClientEx(player);
10121 }
10122 #endif
10124 {
10125 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10126 {
10127 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10128 OnDebugButtonPressServer(id + 1);
10129 }
10130
10131 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10132 {
10133 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10135 }
10136
10137 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10138 {
10139 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10141 }
10142
10143 else if (action_id ==
EActions.ADD_QUANTITY)
10144 {
10145 if (IsMagazine())
10146 {
10147 Magazine mag = Magazine.Cast(this);
10148 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10149 }
10150 else
10151 {
10153 }
10154
10155 if (m_EM)
10156 {
10157 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10158 }
10159
10160 }
10161
10162 else if (action_id ==
EActions.REMOVE_QUANTITY)
10163 {
10164 if (IsMagazine())
10165 {
10166 Magazine mag2 = Magazine.Cast(this);
10167 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10168 }
10169 else
10170 {
10172 }
10173 if (m_EM)
10174 {
10175 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10176 }
10177
10178 }
10179
10180 else if (action_id ==
EActions.SET_QUANTITY_0)
10181 {
10183
10184 if (m_EM)
10185 {
10186 m_EM.SetEnergy(0);
10187 }
10188 }
10189
10190 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10191 {
10193
10194 if (m_EM)
10195 {
10196 m_EM.SetEnergy(m_EM.GetEnergyMax());
10197 }
10198 }
10199
10200 else if (action_id ==
EActions.ADD_HEALTH)
10201 {
10202 AddHealth("","",GetMaxHealth("","Health")/5);
10203 }
10204 else if (action_id ==
EActions.REMOVE_HEALTH)
10205 {
10206 AddHealth("","",-GetMaxHealth("","Health")/5);
10207 }
10208 else if (action_id ==
EActions.DESTROY_HEALTH)
10209 {
10210 SetHealth01("","",0);
10211 }
10212 else if (action_id ==
EActions.WATCH_ITEM)
10213 {
10215 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10216 #ifdef DEVELOPER
10217 SetDebugDeveloper_item(this);
10218 #endif
10219 }
10220
10221 else if (action_id ==
EActions.ADD_TEMPERATURE)
10222 {
10223 AddTemperature(20);
10224
10225 }
10226
10227 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10228 {
10229 AddTemperature(-20);
10230
10231 }
10232
10233 else if (action_id ==
EActions.FLIP_FROZEN)
10234 {
10235 SetFrozen(!GetIsFrozen());
10236
10237 }
10238
10239 else if (action_id ==
EActions.ADD_WETNESS)
10240 {
10242
10243 }
10244
10245 else if (action_id ==
EActions.REMOVE_WETNESS)
10246 {
10248
10249 }
10250
10251 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10252 {
10255
10256
10257 }
10258
10259 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10260 {
10263 }
10264
10265 else if (action_id ==
EActions.MAKE_SPECIAL)
10266 {
10267 auto debugParams = DebugSpawnParams.WithPlayer(player);
10268 OnDebugSpawnEx(debugParams);
10269 }
10270
10271 }
10272
10273
10274 return false;
10275 }
10276
10277
10278
10279
10283
10286
10287
10288
10290 {
10291 return false;
10292 }
10293
10294
10296 {
10297 return true;
10298 }
10299
10300
10302 {
10303 return true;
10304 }
10305
10306
10307
10309 {
10310 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10312 }
10313
10316 {
10317 return null;
10318 }
10319
10321 {
10322 return false;
10323 }
10324
10326 {
10327 return false;
10328 }
10329
10333
10334
10336 {
10337 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10338 return module_repairing.CanRepair(this, item_repair_kit);
10339 }
10340
10341
10342 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10343 {
10344 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10345 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10346 }
10347
10348
10350 {
10351
10352
10353
10354
10355
10356
10357
10358
10359 return 1;
10360 }
10361
10362
10363
10365 {
10367 }
10368
10369
10370
10372 {
10374 }
10375
10376
10385 {
10386 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10387
10388 if (player)
10389 {
10390 player.MessageStatus(text);
10391 }
10392 }
10393
10394
10403 {
10404 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10405
10406 if (player)
10407 {
10408 player.MessageAction(text);
10409 }
10410 }
10411
10412
10421 {
10422 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10423
10424 if (player)
10425 {
10426 player.MessageFriendly(text);
10427 }
10428 }
10429
10430
10439 {
10440 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10441
10442 if (player)
10443 {
10444 player.MessageImportant(text);
10445 }
10446 }
10447
10449 {
10450 return true;
10451 }
10452
10453
10454 override bool KindOf(
string tag)
10455 {
10456 bool found = false;
10457 string item_name = this.
GetType();
10460
10461 int array_size = item_tag_array.Count();
10462 for (int i = 0; i < array_size; i++)
10463 {
10464 if (item_tag_array.Get(i) == tag)
10465 {
10466 found = true;
10467 break;
10468 }
10469 }
10470 return found;
10471 }
10472
10473
10475 {
10476
10477 super.OnRPC(sender, rpc_type,ctx);
10478
10479
10480 switch (rpc_type)
10481 {
10482 #ifndef SERVER
10483 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10484 Param2<bool, string> p = new Param2<bool, string>(false, "");
10485
10487 return;
10488
10489 bool play = p.param1;
10490 string soundSet = p.param2;
10491
10492 if (play)
10493 {
10495 {
10497 {
10499 }
10500 }
10501 else
10502 {
10504 }
10505 }
10506 else
10507 {
10509 }
10510
10511 break;
10512 #endif
10513
10514 }
10515
10517 {
10519 }
10520 }
10521
10522
10523
10524
10526 {
10527 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10528 return plugin.GetID(
name);
10529 }
10530
10532 {
10533 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10534 return plugin.GetName(id);
10535 }
10536
10539 {
10540
10541
10542 int varFlags;
10543 if (!ctx.
Read(varFlags))
10544 return;
10545
10546 if (varFlags & ItemVariableFlags.FLOAT)
10547 {
10549 }
10550 }
10551
10553 {
10554
10555 super.SerializeNumericalVars(floats_out);
10556
10557
10558
10560 {
10562 }
10563
10565 {
10567 }
10568
10570 {
10572 }
10573
10575 {
10580 }
10581
10583 {
10585 }
10586 }
10587
10589 {
10590
10591 super.DeSerializeNumericalVars(floats);
10592
10593
10594 int index = 0;
10595 int mask = Math.Round(floats.Get(index));
10596
10597 index++;
10598
10600 {
10602 {
10604 }
10605 else
10606 {
10607 float quantity = floats.Get(index);
10608 SetQuantity(quantity,
true,
false,
false,
false);
10609 }
10610 index++;
10611 }
10612
10614 {
10615 float wet = floats.Get(index);
10617 index++;
10618 }
10619
10621 {
10622 int liquidtype = Math.Round(floats.Get(index));
10624 index++;
10625 }
10626
10628 {
10630 index++;
10632 index++;
10634 index++;
10636 index++;
10637 }
10638
10640 {
10641 int cleanness = Math.Round(floats.Get(index));
10643 index++;
10644 }
10645 }
10646
10648 {
10649 super.WriteVarsToCTX(ctx);
10650
10651
10653 {
10655 }
10656
10658 {
10660 }
10661
10663 {
10665 }
10666
10668 {
10669 int r,g,b,a;
10675 }
10676
10678 {
10680 }
10681 }
10682
10684 {
10685 if (!super.ReadVarsFromCTX(ctx,version))
10686 return false;
10687
10688 int intValue;
10689 float value;
10690
10691 if (version < 140)
10692 {
10693 if (!ctx.
Read(intValue))
10694 return false;
10695
10696 m_VariablesMask = intValue;
10697 }
10698
10700 {
10701 if (!ctx.
Read(value))
10702 return false;
10703
10705 {
10707 }
10708 else
10709 {
10711 }
10712 }
10713
10714 if (version < 140)
10715 {
10717 {
10718 if (!ctx.
Read(value))
10719 return false;
10720 SetTemperatureDirect(value);
10721 }
10722 }
10723
10725 {
10726 if (!ctx.
Read(value))
10727 return false;
10729 }
10730
10732 {
10733 if (!ctx.
Read(intValue))
10734 return false;
10736 }
10737
10739 {
10740 int r,g,b,a;
10742 return false;
10744 return false;
10746 return false;
10748 return false;
10749
10751 }
10752
10754 {
10755 if (!ctx.
Read(intValue))
10756 return false;
10758 }
10759
10760 if (version >= 138 && version < 140)
10761 {
10763 {
10764 if (!ctx.
Read(intValue))
10765 return false;
10766 SetFrozen(intValue);
10767 }
10768 }
10769
10770 return true;
10771 }
10772
10773
10775 {
10778 {
10780 }
10781
10782 if (!super.OnStoreLoad(ctx, version))
10783 {
10785 return false;
10786 }
10787
10788 if (version >= 114)
10789 {
10790 bool hasQuickBarIndexSaved;
10791
10792 if (!ctx.
Read(hasQuickBarIndexSaved))
10793 {
10795 return false;
10796 }
10797
10798 if (hasQuickBarIndexSaved)
10799 {
10800 int itmQBIndex;
10801
10802
10803 if (!ctx.
Read(itmQBIndex))
10804 {
10806 return false;
10807 }
10808
10809 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10810 if (itmQBIndex != -1 && parentPlayer)
10811 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10812 }
10813 }
10814 else
10815 {
10816
10817 PlayerBase player;
10818 int itemQBIndex;
10819 if (version ==
int.
MAX)
10820 {
10821 if (!ctx.
Read(itemQBIndex))
10822 {
10824 return false;
10825 }
10826 }
10827 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10828 {
10829
10830 if (!ctx.
Read(itemQBIndex))
10831 {
10833 return false;
10834 }
10835 if (itemQBIndex != -1 && player)
10836 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10837 }
10838 }
10839
10840 if (version < 140)
10841 {
10842
10843 if (!LoadVariables(ctx, version))
10844 {
10846 return false;
10847 }
10848 }
10849
10850
10852 {
10854 return false;
10855 }
10856 if (version >= 132)
10857 {
10859 if (raib)
10860 {
10862 {
10864 return false;
10865 }
10866 }
10867 }
10868
10870 return true;
10871 }
10872
10873
10874
10876 {
10877 super.OnStoreSave(ctx);
10878
10879 PlayerBase player;
10880 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10881 {
10883
10884 int itemQBIndex = -1;
10885 itemQBIndex = player.FindQuickBarEntityIndex(this);
10886 ctx.
Write(itemQBIndex);
10887 }
10888 else
10889 {
10891 }
10892
10894
10896 if (raib)
10897 {
10899 }
10900 }
10901
10902
10904 {
10905 super.AfterStoreLoad();
10906
10908 {
10910 }
10911
10913 {
10916 }
10917 }
10918
10920 {
10921 super.EEOnAfterLoad();
10922
10924 {
10926 }
10927
10930 }
10931
10933 {
10934 return false;
10935 }
10936
10937
10938
10940 {
10942 {
10943 #ifdef PLATFORM_CONSOLE
10944
10946 {
10948 if (menu)
10949 {
10951 }
10952 }
10953 #endif
10954 }
10955
10957 {
10960 }
10961
10963 {
10964 SetWeightDirty();
10966 }
10968 {
10971 }
10972
10974 {
10977 }
10979 {
10982 }
10983
10984 super.OnVariablesSynchronized();
10985 }
10986
10987
10988
10990 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10991 {
10992 if (!IsServerCheck(allow_client))
10993 return false;
10994
10996 return false;
10997
11000
11001 if (value <= (min + 0.001))
11002 value = min;
11003
11004 if (value == min)
11005 {
11006 if (destroy_config)
11007 {
11008 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11009 if (dstr)
11010 {
11012 this.Delete();
11013 return true;
11014 }
11015 }
11016 else if (destroy_forced)
11017 {
11019 this.Delete();
11020 return true;
11021 }
11022
11024 }
11025
11028
11030 {
11032
11033 if (delta)
11035 }
11036
11038
11039 return false;
11040 }
11041
11042
11044 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11045 {
11047 }
11048
11050 {
11053 }
11054
11056 {
11059 }
11060
11062 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11063 {
11064 float value_clamped = Math.Clamp(value, 0, 1);
11066 SetQuantity(result, destroy_config, destroy_forced);
11067 }
11068
11069
11072 {
11074 }
11075
11077 {
11079 }
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11091 {
11092 int slot = -1;
11093 if (GetInventory())
11094 {
11095 InventoryLocation il = new InventoryLocation;
11096 GetInventory().GetCurrentInventoryLocation(il);
11098 }
11099
11101 }
11102
11104 {
11105 float quantity_max = 0;
11106
11108 {
11109 if (attSlotID != -1)
11110 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11111
11112 if (quantity_max <= 0)
11114 }
11115
11116 if (quantity_max <= 0)
11118
11119 return quantity_max;
11120 }
11121
11123 {
11125 }
11126
11128 {
11130 }
11131
11132
11134 {
11136 }
11137
11139 {
11141 }
11142
11144 {
11146 }
11147
11148
11150 {
11151
11152 float weightEx = GetWeightEx();
11153 float special = GetInventoryAndCargoWeight();
11154 return weightEx - special;
11155 }
11156
11157
11159 {
11161 }
11162
11164 {
11166 {
11167 #ifdef DEVELOPER
11168 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11169 {
11170 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11172 }
11173 #endif
11174
11175 return GetQuantity() * GetConfigWeightModified();
11176 }
11177 else if (HasEnergyManager())
11178 {
11179 #ifdef DEVELOPER
11180 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11181 {
11182 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11183 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11184 }
11185 #endif
11186 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11187 }
11188 else
11189 {
11190 #ifdef DEVELOPER
11191 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11192 {
11193 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11194 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11195 }
11196 #endif
11197 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11198 }
11199 }
11200
11203 {
11204 int item_count = 0;
11206
11207 if (GetInventory().GetCargo() != NULL)
11208 {
11209 item_count = GetInventory().GetCargo().GetItemCount();
11210 }
11211
11212 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11213 {
11214 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11215 if (item)
11216 item_count += item.GetNumberOfItems();
11217 }
11218 return item_count;
11219 }
11220
11223 {
11224 float weight = 0;
11225 float wetness = 1;
11226 if (include_wetness)
11229 {
11230 weight = wetness * m_ConfigWeight;
11231 }
11233 {
11234 weight = 1;
11235 }
11236 return weight;
11237 }
11238
11239
11240
11242 {
11243 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11244 {
11245 GameInventory inv = GetInventory();
11246 array<EntityAI> items = new array<EntityAI>;
11248 for (int i = 0; i < items.Count(); i++)
11249 {
11251 if (item)
11252 {
11254 }
11255 }
11256 }
11257 }
11258
11259
11260
11261
11263 {
11264 float energy = 0;
11265 if (HasEnergyManager())
11266 {
11267 energy = GetCompEM().GetEnergy();
11268 }
11269 return energy;
11270 }
11271
11272
11274 {
11275 super.OnEnergyConsumed();
11276
11278 }
11279
11281 {
11282 super.OnEnergyAdded();
11283
11285 }
11286
11287
11289 {
11290 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11291 {
11293 {
11294 float energy_0to1 = GetCompEM().GetEnergy0To1();
11296 }
11297 }
11298 }
11299
11300
11302 {
11303 return ConfigGetFloat("heatIsolation");
11304 }
11305
11307 {
11309 }
11310
11312 {
11313 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11314 if (
GetGame().ConfigIsExisting(paramPath))
11316
11317 return 0.0;
11318 }
11319
11321 {
11322 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11323 if (
GetGame().ConfigIsExisting(paramPath))
11325
11326 return 0.0;
11327 }
11328
11329 override void SetWet(
float value,
bool allow_client =
false)
11330 {
11331 if (!IsServerCheck(allow_client))
11332 return;
11333
11336
11338
11339 m_VarWet = Math.Clamp(value, min, max);
11340
11342 {
11345 }
11346 }
11347
11348 override void AddWet(
float value)
11349 {
11351 }
11352
11354 {
11356 }
11357
11359 {
11361 }
11362
11364 {
11366 }
11367
11369 {
11371 }
11372
11374 {
11376 }
11377
11378 override void OnWetChanged(
float newVal,
float oldVal)
11379 {
11382 if (newLevel != oldLevel)
11383 {
11385 }
11386 }
11387
11389 {
11390 SetWeightDirty();
11391 }
11392
11394 {
11395 return GetWetLevelInternal(
m_VarWet);
11396 }
11397
11398
11399
11401 {
11403 }
11404
11406 {
11408 }
11409
11411 {
11413 }
11414
11416 {
11418 }
11419
11420
11421
11423 {
11424 if (ConfigIsExisting("itemModelLength"))
11425 {
11426 return ConfigGetFloat("itemModelLength");
11427 }
11428 return 0;
11429 }
11430
11432 {
11433 if (ConfigIsExisting("itemAttachOffset"))
11434 {
11435 return ConfigGetFloat("itemAttachOffset");
11436 }
11437 return 0;
11438 }
11439
11440 override void SetCleanness(
int value,
bool allow_client =
false)
11441 {
11442 if (!IsServerCheck(allow_client))
11443 return;
11444
11446
11448
11451 }
11452
11454 {
11456 }
11457
11459 {
11460 return true;
11461 }
11462
11463
11464
11465
11467 {
11469 }
11470
11472 {
11474 }
11475
11476
11477
11478
11479 override void SetColor(
int r,
int g,
int b,
int a)
11480 {
11486 }
11488 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11489 {
11494 }
11495
11497 {
11499 }
11500
11503 {
11504 int r,g,b,a;
11506 r = r/255;
11507 g = g/255;
11508 b = b/255;
11509 a = a/255;
11510 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11511 }
11512
11513
11514
11515 override void SetLiquidType(
int value,
bool allow_client =
false)
11516 {
11517 if (!IsServerCheck(allow_client))
11518 return;
11519
11524 }
11525
11527 {
11528 return ConfigGetInt("varLiquidTypeInit");
11529 }
11530
11532 {
11534 }
11535
11537 {
11539 SetFrozen(false);
11540 }
11541
11544 {
11545 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11546 }
11547
11548
11551 {
11552 PlayerBase nplayer;
11553 if (PlayerBase.CastTo(nplayer, player))
11554 {
11556
11557 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11558 }
11559 }
11560
11561
11564 {
11565 PlayerBase nplayer;
11566 if (PlayerBase.CastTo(nplayer,player))
11567 {
11568
11569 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11570
11571 }
11572
11573
11574 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11575
11576
11577 if (HasEnergyManager())
11578 {
11579 GetCompEM().UpdatePlugState();
11580 }
11581 }
11582
11583
11585 {
11586 super.OnPlacementStarted(player);
11587
11589 }
11590
11591 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11592 {
11594 {
11595 m_AdminLog.OnPlacementComplete(player,
this);
11596 }
11597
11598 super.OnPlacementComplete(player, position, orientation);
11599 }
11600
11601
11602
11603
11604
11606 {
11608 {
11609 return true;
11610 }
11611 else
11612 {
11613 return false;
11614 }
11615 }
11616
11617
11619 {
11621 {
11623 }
11624 }
11625
11626
11628 {
11630 }
11631
11633 {
11635 }
11636
11637 override void InsertAgent(
int agent,
float count = 1)
11638 {
11639 if (count < 1)
11640 return;
11641
11643 }
11644
11647 {
11649 }
11650
11651
11653 {
11655 }
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11699 {
11701 return false;
11702 return true;
11703 }
11704
11706 {
11707
11709 }
11710
11711
11714 {
11715 super.CheckForRoofLimited(timeTresholdMS);
11716
11718 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11719 {
11720 m_PreviousRoofTestTime = time;
11721 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11722 }
11723 }
11724
11725
11727 {
11729 {
11730 return 0;
11731 }
11732
11733 if (GetInventory().GetAttachmentSlotsCount() != 0)
11734 {
11735 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11736 if (filter)
11737 return filter.GetProtectionLevel(type, false, system);
11738 else
11739 return 0;
11740 }
11741
11742 string subclassPath, entryName;
11743
11744 switch (type)
11745 {
11747 entryName = "biological";
11748 break;
11750 entryName = "chemical";
11751 break;
11752 default:
11753 entryName = "biological";
11754 break;
11755 }
11756
11757 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11758
11760 }
11761
11762
11763
11766 {
11767 if (!IsMagazine())
11769
11771 }
11772
11773
11774
11775
11776
11781 {
11782 return true;
11783 }
11784
11786 {
11788 }
11789
11790
11791
11792
11793
11795 {
11796 if (parent)
11797 {
11798 if (parent.IsInherited(DayZInfected))
11799 return true;
11800
11801 if (!parent.IsRuined())
11802 return true;
11803 }
11804
11805 return true;
11806 }
11807
11809 {
11810 if (!super.CanPutAsAttachment(parent))
11811 {
11812 return false;
11813 }
11814
11815 if (!IsRuined() && !parent.IsRuined())
11816 {
11817 return true;
11818 }
11819
11820 return false;
11821 }
11822
11824 {
11825
11826
11827
11828
11829 return super.CanReceiveItemIntoCargo(item);
11830 }
11831
11833 {
11834
11835
11836
11837
11838 GameInventory attachmentInv = attachment.GetInventory();
11840 {
11841 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11842 return false;
11843 }
11844
11845 InventoryLocation loc = new InventoryLocation();
11846 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11847 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11848 return false;
11849
11850 return super.CanReceiveAttachment(attachment, slotId);
11851 }
11852
11854 {
11855 if (!super.CanReleaseAttachment(attachment))
11856 return false;
11857
11858 return GetInventory().AreChildrenAccessible();
11859 }
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11882 {
11883 int id = muzzle_owner.GetMuzzleID();
11884 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11885
11886 if (WPOF_array)
11887 {
11888 for (int i = 0; i < WPOF_array.Count(); i++)
11889 {
11890 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11891
11892 if (WPOF)
11893 {
11894 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11895 }
11896 }
11897 }
11898 }
11899
11900
11902 {
11903 int id = muzzle_owner.GetMuzzleID();
11905
11906 if (WPOBE_array)
11907 {
11908 for (int i = 0; i < WPOBE_array.Count(); i++)
11909 {
11910 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11911
11912 if (WPOBE)
11913 {
11914 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11915 }
11916 }
11917 }
11918 }
11919
11920
11922 {
11923 int id = muzzle_owner.GetMuzzleID();
11924 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11925
11926 if (WPOOH_array)
11927 {
11928 for (int i = 0; i < WPOOH_array.Count(); i++)
11929 {
11930 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11931
11932 if (WPOOH)
11933 {
11934 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11935 }
11936 }
11937 }
11938 }
11939
11940
11942 {
11943 int id = muzzle_owner.GetMuzzleID();
11944 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11945
11946 if (WPOOH_array)
11947 {
11948 for (int i = 0; i < WPOOH_array.Count(); i++)
11949 {
11950 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11951
11952 if (WPOOH)
11953 {
11954 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11955 }
11956 }
11957 }
11958 }
11959
11960
11962 {
11963 int id = muzzle_owner.GetMuzzleID();
11964 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11965
11966 if (WPOOH_array)
11967 {
11968 for (int i = 0; i < WPOOH_array.Count(); i++)
11969 {
11970 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11971
11972 if (WPOOH)
11973 {
11974 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11975 }
11976 }
11977 }
11978 }
11979
11980
11981
11983 {
11985 {
11986 return true;
11987 }
11988
11989 return false;
11990 }
11991
11993 {
11995 {
11996 return true;
11997 }
11998
11999 return false;
12000 }
12001
12003 {
12005 {
12006 return true;
12007 }
12008
12009 return false;
12010 }
12011
12013 {
12014 return false;
12015 }
12016
12019 {
12020 return UATimeSpent.DEFAULT_DEPLOY;
12021 }
12022
12023
12024
12025
12027 {
12029 SetSynchDirty();
12030 }
12031
12033 {
12035 }
12036
12037
12039 {
12040 return false;
12041 }
12042
12045 {
12046 string att_type = "None";
12047
12048 if (ConfigIsExisting("soundAttType"))
12049 {
12050 att_type = ConfigGetString("soundAttType");
12051 }
12052
12054 }
12055
12057 {
12059 }
12060
12061
12062
12063
12064
12070
12072 {
12075
12077 }
12078
12079
12081 {
12083 return;
12084
12086
12089
12092
12093 SoundParameters params = new SoundParameters();
12097 }
12098
12099
12101 {
12103 return;
12104
12106 SetSynchDirty();
12107
12110 }
12111
12112
12114 {
12116 return;
12117
12119 SetSynchDirty();
12120
12123 }
12124
12126 {
12128 }
12129
12131 {
12133 }
12134
12137 {
12138 if (!
GetGame().IsDedicatedServer())
12139 {
12140 if (ConfigIsExisting("attachSoundSet"))
12141 {
12142 string cfg_path = "";
12143 string soundset = "";
12144 string type_name =
GetType();
12145
12148 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12149 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12150
12151 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12152 {
12153 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12154 {
12155 if (cfg_slot_array[i] == slot_type)
12156 {
12157 soundset = cfg_soundset_array[i];
12158 break;
12159 }
12160 }
12161 }
12162
12163 if (soundset != "")
12164 {
12165 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12167 }
12168 }
12169 }
12170 }
12171
12173 {
12174
12175 }
12176
12177 void OnApply(PlayerBase player);
12178
12180 {
12181 return 1.0;
12182 };
12183
12185 {
12187 }
12188
12190 {
12192 }
12193
12195
12197 {
12198 SetDynamicPhysicsLifeTime(0.01);
12200 }
12201
12203 {
12204 array<string> zone_names = new array<string>;
12205 GetDamageZones(zone_names);
12206 for (int i = 0; i < zone_names.Count(); i++)
12207 {
12208 SetHealthMax(zone_names.Get(i),"Health");
12209 }
12210 SetHealthMax("","Health");
12211 }
12212
12215 {
12216 float global_health = GetHealth01("","Health");
12217 array<string> zones = new array<string>;
12218 GetDamageZones(zones);
12219
12220 for (int i = 0; i < zones.Count(); i++)
12221 {
12222 SetHealth01(zones.Get(i),"Health",global_health);
12223 }
12224 }
12225
12228 {
12229 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12230 }
12231
12233 {
12234 if (!hasRootAsPlayer)
12235 {
12236 if (refParentIB)
12237 {
12238
12239 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12240 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12241
12242 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12243 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12244
12247 }
12248 else
12249 {
12250
12253 }
12254 }
12255 }
12256
12258 {
12260 {
12261 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12262 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12263 {
12264 float heatPermCoef = 1.0;
12266 while (ent)
12267 {
12268 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12269 ent = ent.GetHierarchyParent();
12270 }
12271
12272 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12273 }
12274 }
12275 }
12276
12278 {
12279
12280 EntityAI parent = GetHierarchyParent();
12281 if (!parent)
12282 {
12283 hasParent = false;
12284 hasRootAsPlayer = false;
12285 }
12286 else
12287 {
12288 hasParent = true;
12289 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12290 refParentIB =
ItemBase.Cast(parent);
12291 }
12292 }
12293
12294 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12295 {
12296
12297 }
12298
12300 {
12301
12302 return false;
12303 }
12304
12306 {
12307
12308
12309 return false;
12310 }
12311
12313 {
12314
12315 return false;
12316 }
12317
12320 {
12321 return !GetIsFrozen() &&
IsOpen();
12322 }
12323
12325 {
12326 bool hasParent = false, hasRootAsPlayer = false;
12328
12329 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12330 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12331
12332 if (wwtu || foodDecay)
12333 {
12337
12338 if (processWetness || processTemperature || processDecay)
12339 {
12341
12342 if (processWetness)
12343 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12344
12345 if (processTemperature)
12347
12348 if (processDecay)
12349 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12350 }
12351 }
12352 }
12353
12356 {
12358 }
12359
12361 {
12364
12365 return super.GetTemperatureFreezeThreshold();
12366 }
12367
12369 {
12372
12373 return super.GetTemperatureThawThreshold();
12374 }
12375
12377 {
12380
12381 return super.GetItemOverheatThreshold();
12382 }
12383
12385 {
12387 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12388
12389 return super.GetTemperatureFreezeTime();
12390 }
12391
12393 {
12395 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12396
12397 return super.GetTemperatureThawTime();
12398 }
12399
12404
12406 {
12407 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12408 }
12409
12411 {
12412 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12413 }
12414
12417 {
12419 }
12420
12422 {
12424 }
12425
12427 {
12429 }
12430
12433 {
12434 return null;
12435 }
12436
12439 {
12440 return false;
12441 }
12442
12444 {
12446 {
12449 if (!trg)
12450 {
12452 explosive = this;
12453 }
12454
12455 explosive.PairRemote(trg);
12457
12458 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12459 trg.SetPersistentPairID(persistentID);
12460 explosive.SetPersistentPairID(persistentID);
12461
12462 return true;
12463 }
12464 return false;
12465 }
12466
12469 {
12470 float ret = 1.0;
12473 ret *= GetHealth01();
12474
12475 return ret;
12476 }
12477
12478 #ifdef DEVELOPER
12479 override void SetDebugItem()
12480 {
12481 super.SetDebugItem();
12482 _itemBase = this;
12483 }
12484
12486 {
12487 string text = super.GetDebugText();
12488
12490 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12491
12492 return text;
12493 }
12494 #endif
12495
12497 {
12498 return true;
12499 }
12500
12502
12504
12506 {
12509 }
12510
12511
12519
12535}
12536
12538{
12540 if (entity)
12541 {
12542 bool is_item = entity.IsInherited(
ItemBase);
12543 if (is_item && full_quantity)
12544 {
12547 }
12548 }
12549 else
12550 {
12552 return NULL;
12553 }
12554 return entity;
12555}
12556
12558{
12559 if (item)
12560 {
12561 if (health > 0)
12562 item.SetHealth("", "", health);
12563
12564 if (item.CanHaveTemperature())
12565 {
12567 if (item.CanFreeze())
12568 item.SetFrozen(false);
12569 }
12570
12571 if (item.HasEnergyManager())
12572 {
12573 if (quantity >= 0)
12574 {
12575 item.GetCompEM().SetEnergy0To1(quantity);
12576 }
12577 else
12578 {
12580 }
12581 }
12582 else if (item.IsMagazine())
12583 {
12584 Magazine mag = Magazine.Cast(item);
12585 if (quantity >= 0)
12586 {
12587 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12588 }
12589 else
12590 {
12592 }
12593
12594 }
12595 else
12596 {
12597 if (quantity >= 0)
12598 {
12599 item.SetQuantityNormalized(quantity, false);
12600 }
12601 else
12602 {
12604 }
12605
12606 }
12607 }
12608}
12609
12610#ifdef DEVELOPER
12612#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.