7636{
7638 {
7639 return true;
7640 }
7641};
7642
7643
7644
7646{
7650
7652
7655
7656
7657
7658
7659
7668
7674
7679
7684
7705 protected bool m_IsResultOfSplit
7706
7708
7713
7714
7715
7717
7721
7722
7723
7725
7728
7729
7730
7736
7737
7745
7748
7749
7751
7752
7754
7755
7760
7761
7766
7767
7769
7770
7772 {
7777
7778 if (!
GetGame().IsDedicatedServer())
7779 {
7781 {
7783
7785 {
7787 }
7788 }
7789
7792 }
7793
7794 m_OldLocation = null;
7795
7797 {
7799 }
7800
7801 if (ConfigIsExisting("headSelectionsToHide"))
7802 {
7805 }
7806
7808 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7809 {
7811 }
7812
7814
7815 m_IsResultOfSplit = false;
7816
7818 }
7819
7821 {
7822 super.InitItemVariables();
7823
7829 m_Count = ConfigGetInt(
"count");
7830
7833
7838
7841
7846
7858
7862
7863
7866 if (ConfigIsExisting("canBeSplit"))
7867 {
7870 }
7871
7873 if (ConfigIsExisting("itemBehaviour"))
7875
7876
7879 RegisterNetSyncVariableInt("m_VarLiquidType");
7880 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7881
7882 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7883 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7884 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7885
7886 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7887 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7888 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7889 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7890
7891 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7892 RegisterNetSyncVariableBool("m_IsTakeable");
7893 RegisterNetSyncVariableBool("m_IsHologram");
7894
7897 {
7900 }
7901
7903
7905 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7907
7908 }
7909
7911 {
7913 }
7914
7916 {
7919 {
7924 }
7925 }
7926
7927 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7928 {
7930 {
7933 }
7934
7936 }
7937
7939 {
7945 }
7946
7948
7950 {
7952
7953 if (!action)
7954 {
7955 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7956 return;
7957 }
7958
7960 if (!ai)
7961 {
7963 return;
7964 }
7965
7967 if (!action_array)
7968 {
7969 action_array = new array<ActionBase_Basic>;
7971 }
7972 if (LogManager.IsActionLogEnable())
7973 {
7974 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7975 }
7976
7977 if (action_array.Find(action) != -1)
7978 {
7979 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7980 }
7981 else
7982 {
7983 action_array.Insert(action);
7984 }
7985 }
7986
7988 {
7990 ActionBase action = player.GetActionManager().GetAction(actionName);
7993
7994 if (action_array)
7995 {
7996 action_array.RemoveItem(action);
7997 }
7998 }
7999
8000
8001
8003 {
8004 ActionOverrideData overrideData = new ActionOverrideData();
8008
8010 if (!actionMap)
8011 {
8014 }
8015
8016 actionMap.Insert(this.
Type(), overrideData);
8017
8018 }
8019
8021
8023
8024
8026 {
8029
8032
8033 string config_to_search = "CfgVehicles";
8034 string muzzle_owner_config;
8035
8037 {
8038 if (IsInherited(Weapon))
8039 config_to_search = "CfgWeapons";
8040
8041 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8042
8043 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8044
8046
8047 if (config_OnFire_subclass_count > 0)
8048 {
8049 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8050
8051 for (int i = 0; i < config_OnFire_subclass_count; i++)
8052 {
8053 string particle_class = "";
8055 string config_OnFire_entry = config_OnFire_class + particle_class;
8056 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8057 WPOF_array.Insert(WPOF);
8058 }
8059
8060
8062 }
8063 }
8064
8066 {
8067 config_to_search = "CfgWeapons";
8068 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8069
8070 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8071
8073
8074 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8075 {
8076 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8077
8078 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8079 {
8080 string particle_class2 = "";
8082 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8083 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8084 WPOBE_array.Insert(WPOBE);
8085 }
8086
8087
8089 }
8090 }
8091 }
8092
8093
8095 {
8098
8100 {
8101 string config_to_search = "CfgVehicles";
8102
8103 if (IsInherited(Weapon))
8104 config_to_search = "CfgWeapons";
8105
8106 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8107 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8108
8109 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8110 {
8111
8113
8115 {
8117 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8119 return;
8120 }
8121
8124
8125
8126
8128 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8129
8130 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8131 {
8132 string particle_class = "";
8134 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8136
8137 if (entry_type == CT_CLASS)
8138 {
8139 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8140 WPOOH_array.Insert(WPOF);
8141 }
8142 }
8143
8144
8146 }
8147 }
8148 }
8149
8151 {
8153 }
8154
8156 {
8158 {
8160
8163
8166
8167 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8168 }
8169 }
8170
8172 {
8174 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8175
8177 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8178
8180 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8181
8183 {
8185 }
8186 }
8187
8189 {
8191 }
8192
8194 {
8197 else
8199
8201 {
8204 }
8205 else
8206 {
8209
8212 }
8213
8215 }
8216
8218 {
8220 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8221 }
8222
8224 {
8226 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8228 }
8229
8231 {
8233 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8234 }
8235
8237 {
8240
8241 OverheatingParticle OP = new OverheatingParticle();
8246
8248 }
8249
8251 {
8254
8255 return -1;
8256 }
8257
8259 {
8261 {
8264
8265 for (int i = count; i > 0; --i)
8266 {
8267 int id = i - 1;
8270
8273
8274 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8275 {
8276 if (p)
8277 {
8280 }
8281 }
8282 }
8283 }
8284 }
8285
8287 {
8289 {
8291 {
8292 int id = i - 1;
8294
8295 if (OP)
8296 {
8298
8299 if (p)
8300 {
8302 }
8303
8304 delete OP;
8305 }
8306 }
8307
8310 }
8311 }
8312
8315 {
8316 return 0.0;
8317 }
8318
8319
8321 {
8322 return 250;
8323 }
8324
8326 {
8327 return 0;
8328 }
8329
8332 {
8334 return true;
8335
8336 return false;
8337 }
8338
8341 {
8344
8346 {
8348 }
8349 else
8350 {
8351
8353 }
8354
8356 }
8357
8364 {
8365 return -1;
8366 }
8367
8368
8369
8370
8372 {
8374 {
8376 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8377
8378 if (r_index >= 0)
8379 {
8380 InventoryLocation r_il = new InventoryLocation;
8381 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8382
8383 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8386 {
8387 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8388 }
8390 {
8391 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8392 }
8393
8394 }
8395
8396 player.GetHumanInventory().ClearUserReservedLocation(this);
8397 }
8398
8401 }
8402
8403
8404
8405
8407 {
8408 return ItemBase.m_DebugActionsMask;
8409 }
8410
8412 {
8413 return ItemBase.m_DebugActionsMask & mask;
8414 }
8415
8417 {
8418 ItemBase.m_DebugActionsMask = mask;
8419 }
8420
8422 {
8423 ItemBase.m_DebugActionsMask |= mask;
8424 }
8425
8427 {
8428 ItemBase.m_DebugActionsMask &= ~mask;
8429 }
8430
8432 {
8434 {
8436 }
8437 else
8438 {
8440 }
8441 }
8442
8443
8445 {
8446 if (GetEconomyProfile())
8447 {
8448 float q_max = GetEconomyProfile().GetQuantityMax();
8449 if (q_max > 0)
8450 {
8451 float q_min = GetEconomyProfile().GetQuantityMin();
8452 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8453
8455 {
8456 ComponentEnergyManager comp = GetCompEM();
8458 {
8460 }
8461 }
8463 {
8465
8466 }
8467
8468 }
8469 }
8470 }
8471
8474 {
8475 EntityAI parent = GetHierarchyParent();
8476
8477 if (parent)
8478 {
8479 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8480 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8481 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8482 }
8483 }
8484
8487 {
8488 EntityAI parent = GetHierarchyParent();
8489
8490 if (parent)
8491 {
8492 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8493 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8494 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8495 }
8496 }
8497
8499 {
8500
8501
8502
8503
8505
8507 {
8508 if (ScriptInputUserData.CanStoreInputUserData())
8509 {
8510 ScriptInputUserData ctx = new ScriptInputUserData;
8516 ctx.
Write(use_stack_max);
8519
8521 {
8522 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8523 }
8524 }
8525 }
8526 else if (!
GetGame().IsMultiplayer())
8527 {
8529 }
8530 }
8531
8533 {
8535 }
8536
8538 {
8540 }
8541
8543 {
8545 }
8546
8548 {
8549
8550 return false;
8551 }
8552
8554 {
8555 return false;
8556 }
8557
8561 {
8562 return false;
8563 }
8564
8566 {
8567 return "";
8568 }
8569
8571
8573 {
8574 return false;
8575 }
8576
8578 {
8579 return true;
8580 }
8581
8582
8583
8585 {
8586 return true;
8587 }
8588
8590 {
8591 return true;
8592 }
8593
8595 {
8596 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8598 }
8599
8601 {
8603 }
8604
8606 {
8608 if (!is_being_placed)
8610 SetSynchDirty();
8611 }
8612
8613
8615
8617 {
8619 }
8620
8622 {
8624 }
8625
8627 {
8628 return 1;
8629 }
8630
8632 {
8633 return false;
8634 }
8635
8637 {
8639 SetSynchDirty();
8640 }
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8677 {
8678 super.OnMovedInsideCargo(container);
8679
8680 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8681 }
8682
8683 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8684 {
8685 super.EEItemLocationChanged(oldLoc,newLoc);
8686
8687 PlayerBase new_player = null;
8688 PlayerBase old_player = null;
8689
8690 if (newLoc.GetParent())
8691 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8692
8693 if (oldLoc.GetParent())
8694 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8695
8697 {
8698 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8699
8700 if (r_index >= 0)
8701 {
8702 InventoryLocation r_il = new InventoryLocation;
8703 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8704
8705 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8708 {
8709 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8710 }
8712 {
8713 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8714 }
8715
8716 }
8717 }
8718
8720 {
8721 if (new_player)
8722 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8723
8724 if (new_player == old_player)
8725 {
8726
8727 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8728 {
8730 {
8731 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8732 {
8733 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8734 }
8735 }
8736 else
8737 {
8738 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8739 }
8740 }
8741
8742 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8743 {
8744 int type = oldLoc.GetType();
8746 {
8747 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8748 }
8750 {
8751 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8752 }
8753 }
8754 if (!m_OldLocation)
8755 {
8756 m_OldLocation = new InventoryLocation;
8757 }
8758 m_OldLocation.Copy(oldLoc);
8759 }
8760 else
8761 {
8762 if (m_OldLocation)
8763 {
8764 m_OldLocation.Reset();
8765 }
8766 }
8767
8769 }
8770 else
8771 {
8772 if (new_player)
8773 {
8774 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8775 if (res_index >= 0)
8776 {
8777 InventoryLocation il = new InventoryLocation;
8778 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8780 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8783 {
8784 il.
GetParent().GetOnReleaseLock().Invoke(it);
8785 }
8787 {
8789 }
8790
8791 }
8792 }
8794 {
8795
8797 }
8798
8799 if (m_OldLocation)
8800 {
8801 m_OldLocation.Reset();
8802 }
8803 }
8804 }
8805
8806 override void EOnContact(IEntity other, Contact extra)
8807 {
8809 {
8810 int liquidType = -1;
8812 if (impactSpeed > 0.0)
8813 {
8815 #ifndef SERVER
8817 #else
8819 SetSynchDirty();
8820 #endif
8822 }
8823 }
8824
8825 #ifdef SERVER
8826 if (GetCompEM() && GetCompEM().IsPlugged())
8827 {
8828 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8829 GetCompEM().UnplugThis();
8830 }
8831 #endif
8832 }
8833
8835
8837 {
8839 }
8840
8842 {
8843
8844 }
8845
8847 {
8848 super.OnItemLocationChanged(old_owner, new_owner);
8849
8850 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8851 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8852
8853 if (!relatedPlayer && playerNew)
8854 relatedPlayer = playerNew;
8855
8856 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8857 {
8859 if (actionMgr)
8860 {
8861 ActionBase currentAction = actionMgr.GetRunningAction();
8862 if (currentAction)
8864 }
8865 }
8866
8867 Man ownerPlayerOld = null;
8868 Man ownerPlayerNew = null;
8869
8870 if (old_owner)
8871 {
8872 if (old_owner.
IsMan())
8873 {
8874 ownerPlayerOld = Man.Cast(old_owner);
8875 }
8876 else
8877 {
8878 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8879 }
8880 }
8881 else
8882 {
8884 {
8886
8887 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8888 {
8889 GetCompEM().UnplugThis();
8890 }
8891 }
8892 }
8893
8894 if (new_owner)
8895 {
8896 if (new_owner.
IsMan())
8897 {
8898 ownerPlayerNew = Man.Cast(new_owner);
8899 }
8900 else
8901 {
8902 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8903 }
8904 }
8905
8906 if (ownerPlayerOld != ownerPlayerNew)
8907 {
8908 if (ownerPlayerOld)
8909 {
8910 array<EntityAI> subItemsExit = new array<EntityAI>;
8912 for (int i = 0; i < subItemsExit.Count(); i++)
8913 {
8916 }
8917 }
8918
8919 if (ownerPlayerNew)
8920 {
8921 array<EntityAI> subItemsEnter = new array<EntityAI>;
8923 for (int j = 0; j < subItemsEnter.Count(); j++)
8924 {
8927 }
8928 }
8929 }
8930 else if (ownerPlayerNew != null)
8931 {
8932 PlayerBase nplayer;
8933 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8934 {
8935 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8937 for (int k = 0; k < subItemsUpdate.Count(); k++)
8938 {
8940 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8941 }
8942 }
8943 }
8944
8945 if (old_owner)
8946 old_owner.OnChildItemRemoved(this);
8947 if (new_owner)
8948 new_owner.OnChildItemReceived(this);
8949 }
8950
8951
8953 {
8954 super.EEDelete(parent);
8955 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8956 if (player)
8957 {
8959
8960 if (player.IsAlive())
8961 {
8962 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8963 if (r_index >= 0)
8964 {
8965 InventoryLocation r_il = new InventoryLocation;
8966 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8967
8968 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8971 {
8972 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8973 }
8975 {
8976 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8977 }
8978
8979 }
8980
8981 player.RemoveQuickBarEntityShortcut(this);
8982 }
8983 }
8984 }
8985
8987 {
8988 super.EEKilled(killer);
8989
8992 {
8993 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8994 {
8995 if (IsMagazine())
8996 {
8997 if (Magazine.Cast(this).GetAmmoCount() > 0)
8998 {
9000 }
9001 }
9002 else
9003 {
9005 }
9006 }
9007 }
9008 }
9009
9011 {
9012 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9013
9014 super.OnWasAttached(parent, slot_id);
9015
9018
9020 }
9021
9023 {
9024 super.OnWasDetached(parent, slot_id);
9025
9028 }
9029
9031 {
9032 int idx;
9035
9036 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9037 if (inventory_slots.Count() < 1)
9038 {
9039 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9040 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9041 }
9042 else
9043 {
9044 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9045 }
9046
9047 idx = inventory_slots.Find(slot);
9048 if (idx < 0)
9049 return "";
9050
9051 return attach_types.Get(idx);
9052 }
9053
9055 {
9056 int idx = -1;
9057 string slot;
9058
9061
9062 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9063 if (inventory_slots.Count() < 1)
9064 {
9065 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9066 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9067 }
9068 else
9069 {
9070 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9071 if (detach_types.Count() < 1)
9072 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9073 }
9074
9075 for (int i = 0; i < inventory_slots.Count(); i++)
9076 {
9077 slot = inventory_slots.Get(i);
9078 }
9079
9080 if (slot != "")
9081 {
9082 if (detach_types.Count() == 1)
9083 idx = 0;
9084 else
9085 idx = inventory_slots.Find(slot);
9086 }
9087 if (idx < 0)
9088 return "";
9089
9090 return detach_types.Get(idx);
9091 }
9092
9094 {
9095
9097
9098
9099 float min_time = 1;
9100 float max_time = 3;
9101 float delay = Math.RandomFloat(min_time, max_time);
9102
9103 explode_timer.Run(delay, this, "DoAmmoExplosion");
9104 }
9105
9107 {
9108 Magazine magazine = Magazine.Cast(this);
9109 int pop_sounds_count = 6;
9110 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9111
9112
9113 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9114 string sound_name = pop_sounds[ sound_idx ];
9116
9117
9118 magazine.ServerAddAmmoCount(-1);
9119
9120
9121 float min_temp_to_explode = 100;
9122
9123 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9124 {
9126 }
9127 }
9128
9129
9130 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9131 {
9132 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9133
9134 const int CHANCE_DAMAGE_CARGO = 4;
9135 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9136 const int CHANCE_DAMAGE_NOTHING = 2;
9137
9139 {
9140 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9141 int chances;
9142 int rnd;
9143
9144 if (GetInventory().GetCargo())
9145 {
9146 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9147 rnd = Math.RandomInt(0,chances);
9148
9149 if (rnd < CHANCE_DAMAGE_CARGO)
9150 {
9152 }
9153 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9154 {
9156 }
9157 }
9158 else
9159 {
9160 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9161 rnd = Math.RandomInt(0,chances);
9162
9163 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9164 {
9166 }
9167 }
9168 }
9169 }
9170
9172 {
9173 if (GetInventory().GetCargo())
9174 {
9175 int item_count = GetInventory().GetCargo().GetItemCount();
9176 if (item_count > 0)
9177 {
9178 int random_pick = Math.RandomInt(0, item_count);
9180 if (!item.IsExplosive())
9181 {
9182 item.AddHealth("","",damage);
9183 return true;
9184 }
9185 }
9186 }
9187 return false;
9188 }
9189
9191 {
9192 int attachment_count = GetInventory().AttachmentCount();
9193 if (attachment_count > 0)
9194 {
9195 int random_pick = Math.RandomInt(0, attachment_count);
9196 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9197 if (!attachment.IsExplosive())
9198 {
9199 attachment.AddHealth("","",damage);
9200 return true;
9201 }
9202 }
9203 return false;
9204 }
9205
9207 {
9209 }
9210
9212 {
9214 return GetInventory().CanRemoveEntity();
9215
9216 return false;
9217 }
9218
9220 {
9221
9223 return false;
9224
9225
9227 return false;
9228
9229
9230
9232 if (delta == 0)
9233 return false;
9234
9235
9236 return true;
9237 }
9238
9240 {
9242 {
9243 if (ScriptInputUserData.CanStoreInputUserData())
9244 {
9245 ScriptInputUserData ctx = new ScriptInputUserData;
9250 ctx.
Write(destination_entity);
9254 }
9255 }
9256 else if (!
GetGame().IsMultiplayer())
9257 {
9259 }
9260 }
9261
9263 {
9264 float split_quantity_new;
9268 InventoryLocation loc = new InventoryLocation;
9269
9270 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9271 {
9273 split_quantity_new = stack_max;
9274 else
9276
9278 {
9279 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9280 if (new_item)
9281 {
9282 new_item.SetResultOfSplit(true);
9283 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9285 new_item.
SetQuantity(split_quantity_new,
false,
true);
9286 }
9287 }
9288 }
9289 else if (destination_entity && slot_id == -1)
9290 {
9291 if (quantity > stack_max)
9292 split_quantity_new = stack_max;
9293 else
9294 split_quantity_new = quantity;
9295
9297 {
9299 {
9302 }
9303
9304 if (new_item)
9305 {
9306 new_item.SetResultOfSplit(true);
9307 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9309 new_item.
SetQuantity(split_quantity_new,
false,
true);
9310 }
9311 }
9312 }
9313 else
9314 {
9315 if (stack_max != 0)
9316 {
9318 {
9320 }
9321
9322 if (split_quantity_new == 0)
9323 {
9324 if (!
GetGame().IsMultiplayer())
9325 player.PhysicalPredictiveDropItem(this);
9326 else
9327 player.ServerDropEntity(this);
9328 return;
9329 }
9330
9332 {
9334
9335 if (new_item)
9336 {
9337 new_item.SetResultOfSplit(true);
9338 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9341 new_item.PlaceOnSurface();
9342 }
9343 }
9344 }
9345 }
9346 }
9347
9349 {
9350 float split_quantity_new;
9354 InventoryLocation loc = new InventoryLocation;
9355
9356 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9357 {
9359 split_quantity_new = stack_max;
9360 else
9362
9364 {
9365 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9366 if (new_item)
9367 {
9368 new_item.SetResultOfSplit(true);
9369 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9371 new_item.
SetQuantity(split_quantity_new,
false,
true);
9372 }
9373 }
9374 }
9375 else if (destination_entity && slot_id == -1)
9376 {
9377 if (quantity > stack_max)
9378 split_quantity_new = stack_max;
9379 else
9380 split_quantity_new = quantity;
9381
9383 {
9385 {
9388 }
9389
9390 if (new_item)
9391 {
9392 new_item.SetResultOfSplit(true);
9393 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9395 new_item.
SetQuantity(split_quantity_new,
false,
true);
9396 }
9397 }
9398 }
9399 else
9400 {
9401 if (stack_max != 0)
9402 {
9404 {
9406 }
9407
9409 {
9411
9412 if (new_item)
9413 {
9414 new_item.SetResultOfSplit(true);
9415 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9418 new_item.PlaceOnSurface();
9419 }
9420 }
9421 }
9422 }
9423 }
9424
9426 {
9428 {
9429 if (ScriptInputUserData.CanStoreInputUserData())
9430 {
9431 ScriptInputUserData ctx = new ScriptInputUserData;
9436 dst.WriteToContext(ctx);
9438 }
9439 }
9440 else if (!
GetGame().IsMultiplayer())
9441 {
9443 }
9444 }
9445
9447 {
9449 {
9450 if (ScriptInputUserData.CanStoreInputUserData())
9451 {
9452 ScriptInputUserData ctx = new ScriptInputUserData;
9457 ctx.
Write(destination_entity);
9463 }
9464 }
9465 else if (!
GetGame().IsMultiplayer())
9466 {
9468 }
9469 }
9470
9472 {
9474 }
9475
9477 {
9479 float split_quantity_new;
9481 if (dst.IsValid())
9482 {
9483 int slot_id = dst.GetSlot();
9485
9486 if (quantity > stack_max)
9487 split_quantity_new = stack_max;
9488 else
9489 split_quantity_new = quantity;
9490
9492 {
9494
9495 if (new_item)
9496 {
9497 new_item.SetResultOfSplit(true);
9498 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9500 new_item.
SetQuantity(split_quantity_new,
false,
true);
9501 }
9502
9503 return new_item;
9504 }
9505 }
9506
9507 return null;
9508 }
9509
9511 {
9513 float split_quantity_new;
9515 if (destination_entity)
9516 {
9518 if (quantity > stackable)
9519 split_quantity_new = stackable;
9520 else
9521 split_quantity_new = quantity;
9522
9524 {
9525 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9526 if (new_item)
9527 {
9528 new_item.SetResultOfSplit(true);
9529 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9531 new_item.
SetQuantity(split_quantity_new,
false,
true);
9532 }
9533 }
9534 }
9535 }
9536
9538 {
9540 {
9541 if (ScriptInputUserData.CanStoreInputUserData())
9542 {
9543 ScriptInputUserData ctx = new ScriptInputUserData;
9548 ItemBase destination_entity =
this;
9549 ctx.
Write(destination_entity);
9553 }
9554 }
9555 else if (!
GetGame().IsMultiplayer())
9556 {
9558 }
9559 }
9560
9562 {
9564 float split_quantity_new;
9566 if (player)
9567 {
9569 if (quantity > stackable)
9570 split_quantity_new = stackable;
9571 else
9572 split_quantity_new = quantity;
9573
9575 {
9576 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9577 new_item =
ItemBase.Cast(in_hands);
9578 if (new_item)
9579 {
9580 new_item.SetResultOfSplit(true);
9581 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9583 new_item.SetQuantity(split_quantity_new, false, true);
9584 }
9585 }
9586 }
9587 }
9588
9590 {
9592 float split_quantity_new = Math.Floor(quantity * 0.5);
9593
9595 return;
9596
9598
9599 if (new_item)
9600 {
9601 if (new_item.GetQuantityMax() < split_quantity_new)
9602 {
9603 split_quantity_new = new_item.GetQuantityMax();
9604 }
9605
9606 new_item.SetResultOfSplit(true);
9607 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9608
9610 {
9613 }
9614 else
9615 {
9617 new_item.
SetQuantity(split_quantity_new,
false,
true);
9618 }
9619 }
9620 }
9621
9623 {
9625 float split_quantity_new = Math.Floor(quantity / 2);
9626
9628 return;
9629
9630 InventoryLocation invloc = new InventoryLocation;
9632
9634 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9635
9636 if (new_item)
9637 {
9638 if (new_item.GetQuantityMax() < split_quantity_new)
9639 {
9640 split_quantity_new = new_item.GetQuantityMax();
9641 }
9643 {
9646 }
9647 else if (split_quantity_new > 1)
9648 {
9650 new_item.
SetQuantity(split_quantity_new,
false,
true);
9651 }
9652 }
9653 }
9654
9657 {
9658 SetWeightDirty();
9660
9661 if (parent)
9662 parent.OnAttachmentQuantityChangedEx(this, delta);
9663
9665 {
9667 {
9669 }
9671 {
9672 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9674 }
9675 }
9676
9677 }
9678
9681 {
9682
9683 }
9684
9687 {
9689 }
9690
9692 {
9693 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9694
9696 {
9697 if (newLevel == GameConstants.STATE_RUINED)
9698 {
9700 EntityAI parent = GetHierarchyParent();
9701 if (parent && parent.IsFireplace())
9702 {
9703 CargoBase cargo = GetInventory().GetCargo();
9704 if (cargo)
9705 {
9707 {
9709 }
9710 }
9711 }
9712 }
9713
9715 {
9716
9718 return;
9719 }
9720
9721 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9722 {
9724 }
9725 }
9726 }
9727
9728
9730 {
9731 super.OnRightClick();
9732
9734 {
9736 {
9737 if (ScriptInputUserData.CanStoreInputUserData())
9738 {
9739 EntityAI root = GetHierarchyRoot();
9740 Man playerOwner = GetHierarchyRootPlayer();
9741 InventoryLocation dst = new InventoryLocation;
9742
9743
9744 if (!playerOwner && root && root == this)
9745 {
9747 }
9748 else
9749 {
9750
9751 GetInventory().GetCurrentInventoryLocation(dst);
9753 {
9756 {
9758 }
9759 else
9760 {
9762
9763
9764 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9765 {
9767 }
9768 else
9769 {
9770 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9771 }
9772 }
9773 }
9774 }
9775
9776 ScriptInputUserData ctx = new ScriptInputUserData;
9784 }
9785 }
9786 else if (!
GetGame().IsMultiplayer())
9787 {
9789 }
9790 }
9791 }
9792
9794 {
9795 if (root)
9796 {
9797 vector m4[4];
9798 root.GetTransform(m4);
9799 dst.SetGround(this, m4);
9800 }
9801 else
9802 {
9803 GetInventory().GetCurrentInventoryLocation(dst);
9804 }
9805 }
9806
9807 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9808 {
9809
9810 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9811 return false;
9812
9813 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9814 return false;
9815
9816
9818 return false;
9819
9820
9821 Magazine mag = Magazine.Cast(this);
9822 if (mag)
9823 {
9824 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9825 return false;
9826
9827 if (stack_max_limit)
9828 {
9829 Magazine other_mag = Magazine.Cast(other_item);
9830 if (other_item)
9831 {
9832 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9833 return false;
9834 }
9835
9836 }
9837 }
9838 else
9839 {
9840
9842 return false;
9843
9845 return false;
9846 }
9847
9848 PlayerBase player = null;
9849 if (CastTo(player, GetHierarchyRootPlayer()))
9850 {
9851 if (player.GetInventory().HasAttachment(this))
9852 return false;
9853
9854 if (player.IsItemsToDelete())
9855 return false;
9856 }
9857
9858 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9859 return false;
9860
9861 int slotID;
9863 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9864 return false;
9865
9866 return true;
9867 }
9868
9870 {
9872 }
9873
9875 {
9876 return m_IsResultOfSplit;
9877 }
9878
9880 {
9881 m_IsResultOfSplit = value;
9882 }
9883
9885 {
9887 }
9888
9890 {
9891 float other_item_quantity = other_item.GetQuantity();
9892 float this_free_space;
9893
9895
9897
9898 if (other_item_quantity > this_free_space)
9899 {
9900 return this_free_space;
9901 }
9902 else
9903 {
9904 return other_item_quantity;
9905 }
9906 }
9907
9909 {
9911 }
9912
9914 {
9916 return;
9917
9918 if (!IsMagazine() && other_item)
9919 {
9921 if (quantity_used != 0)
9922 {
9923 float hp1 = GetHealth01("","");
9924 float hp2 = other_item.GetHealth01("","");
9925 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9926 hpResult = hpResult / (
GetQuantity() + quantity_used);
9927
9928 hpResult *= GetMaxHealth();
9929 Math.Round(hpResult);
9930 SetHealth("", "Health", hpResult);
9931
9933 other_item.AddQuantity(-quantity_used);
9934 }
9935 }
9937 }
9938
9940 {
9941 #ifdef SERVER
9942 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9943 GetHierarchyParent().IncreaseLifetimeUp();
9944 #endif
9945 };
9946
9948 {
9949 PlayerBase p = PlayerBase.Cast(player);
9950
9951 array<int> recipesIds = p.m_Recipes;
9952 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9953 if (moduleRecipesManager)
9954 {
9955 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9956 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9957 }
9958
9959 for (int i = 0;i < recipesIds.Count(); i++)
9960 {
9961 int key = recipesIds.Get(i);
9962 string recipeName = moduleRecipesManager.GetRecipeName(key);
9964 }
9965 }
9966
9967
9968 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9969 {
9970 super.GetDebugActions(outputList);
9971
9972
9978
9979
9984
9989
9990
9994
9995
9997 {
10001 }
10002
10005
10006
10010
10012
10013 InventoryLocation loc = new InventoryLocation();
10014 GetInventory().GetCurrentInventoryLocation(loc);
10016 {
10017 if (Gizmo_IsSupported())
10020 }
10021
10023 }
10024
10025
10026
10027
10029 {
10030 super.OnAction(action_id, player, ctx);
10031
10033 {
10034 switch (action_id)
10035 {
10038 return true;
10041 return true;
10042 }
10043 }
10044
10046 {
10047 switch (action_id)
10048 {
10050 Delete();
10051 return true;
10052 }
10053 }
10054
10055 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10056 {
10057 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10058 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10059 PlayerBase p = PlayerBase.Cast(player);
10060 if (
EActions.RECIPES_RANGE_START < 1000)
10061 {
10062 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10063 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10064 }
10065 }
10066 #ifndef SERVER
10067 else if (action_id ==
EActions.WATCH_PLAYER)
10068 {
10069 PluginDeveloper.SetDeveloperItemClientEx(player);
10070 }
10071 #endif
10073 {
10074 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10075 {
10076 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10077 OnDebugButtonPressServer(id + 1);
10078 }
10079
10080 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10081 {
10082 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10084 }
10085
10086 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10087 {
10088 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10090 }
10091
10092 else if (action_id ==
EActions.ADD_QUANTITY)
10093 {
10094 if (IsMagazine())
10095 {
10096 Magazine mag = Magazine.Cast(this);
10097 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10098 }
10099 else
10100 {
10102 }
10103
10104 if (m_EM)
10105 {
10106 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10107 }
10108
10109 }
10110
10111 else if (action_id ==
EActions.REMOVE_QUANTITY)
10112 {
10113 if (IsMagazine())
10114 {
10115 Magazine mag2 = Magazine.Cast(this);
10116 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10117 }
10118 else
10119 {
10121 }
10122 if (m_EM)
10123 {
10124 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10125 }
10126
10127 }
10128
10129 else if (action_id ==
EActions.SET_QUANTITY_0)
10130 {
10132
10133 if (m_EM)
10134 {
10135 m_EM.SetEnergy(0);
10136 }
10137 }
10138
10139 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10140 {
10142
10143 if (m_EM)
10144 {
10145 m_EM.SetEnergy(m_EM.GetEnergyMax());
10146 }
10147 }
10148
10149 else if (action_id ==
EActions.ADD_HEALTH)
10150 {
10151 AddHealth("","",GetMaxHealth("","Health")/5);
10152 }
10153 else if (action_id ==
EActions.REMOVE_HEALTH)
10154 {
10155 AddHealth("","",-GetMaxHealth("","Health")/5);
10156 }
10157 else if (action_id ==
EActions.DESTROY_HEALTH)
10158 {
10159 SetHealth01("","",0);
10160 }
10161 else if (action_id ==
EActions.WATCH_ITEM)
10162 {
10164 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10165 #ifdef DEVELOPER
10166 SetDebugDeveloper_item(this);
10167 #endif
10168 }
10169
10170 else if (action_id ==
EActions.ADD_TEMPERATURE)
10171 {
10172 AddTemperature(20);
10173
10174 }
10175
10176 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10177 {
10178 AddTemperature(-20);
10179
10180 }
10181
10182 else if (action_id ==
EActions.FLIP_FROZEN)
10183 {
10184 SetFrozen(!GetIsFrozen());
10185
10186 }
10187
10188 else if (action_id ==
EActions.ADD_WETNESS)
10189 {
10191
10192 }
10193
10194 else if (action_id ==
EActions.REMOVE_WETNESS)
10195 {
10197
10198 }
10199
10200 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10201 {
10204
10205
10206 }
10207
10208 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10209 {
10212 }
10213
10214 else if (action_id ==
EActions.MAKE_SPECIAL)
10215 {
10216 auto debugParams = DebugSpawnParams.WithPlayer(player);
10217 OnDebugSpawnEx(debugParams);
10218 }
10219
10220 }
10221
10222
10223 return false;
10224 }
10225
10226
10227
10228
10232
10235
10236
10237
10239 {
10240 return false;
10241 }
10242
10243
10245 {
10246 return true;
10247 }
10248
10249
10251 {
10252 return true;
10253 }
10254
10255
10256
10258 {
10259 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10261 }
10262
10265 {
10266 return null;
10267 }
10268
10270 {
10271 return false;
10272 }
10273
10275 {
10276 return false;
10277 }
10278
10282
10283
10285 {
10286 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10287 return module_repairing.CanRepair(this, item_repair_kit);
10288 }
10289
10290
10291 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10292 {
10293 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10294 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10295 }
10296
10297
10299 {
10300
10301
10302
10303
10304
10305
10306
10307
10308 return 1;
10309 }
10310
10311
10312
10314 {
10316 }
10317
10318
10319
10321 {
10323 }
10324
10325
10334 {
10335 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10336
10337 if (player)
10338 {
10339 player.MessageStatus(text);
10340 }
10341 }
10342
10343
10352 {
10353 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10354
10355 if (player)
10356 {
10357 player.MessageAction(text);
10358 }
10359 }
10360
10361
10370 {
10371 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10372
10373 if (player)
10374 {
10375 player.MessageFriendly(text);
10376 }
10377 }
10378
10379
10388 {
10389 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10390
10391 if (player)
10392 {
10393 player.MessageImportant(text);
10394 }
10395 }
10396
10398 {
10399 return true;
10400 }
10401
10402
10403 override bool KindOf(
string tag)
10404 {
10405 bool found = false;
10406 string item_name = this.
GetType();
10409
10410 int array_size = item_tag_array.Count();
10411 for (int i = 0; i < array_size; i++)
10412 {
10413 if (item_tag_array.Get(i) == tag)
10414 {
10415 found = true;
10416 break;
10417 }
10418 }
10419 return found;
10420 }
10421
10422
10424 {
10425
10426 super.OnRPC(sender, rpc_type,ctx);
10427
10428
10429 switch (rpc_type)
10430 {
10431 #ifndef SERVER
10432 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10433 Param2<bool, string> p = new Param2<bool, string>(false, "");
10434
10436 return;
10437
10438 bool play = p.param1;
10439 string soundSet = p.param2;
10440
10441 if (play)
10442 {
10444 {
10446 {
10448 }
10449 }
10450 else
10451 {
10453 }
10454 }
10455 else
10456 {
10458 }
10459
10460 break;
10461 #endif
10462
10463 }
10464
10466 {
10468 }
10469 }
10470
10471
10472
10473
10475 {
10476 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10477 return plugin.GetID(
name);
10478 }
10479
10481 {
10482 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10483 return plugin.GetName(id);
10484 }
10485
10488 {
10489
10490
10491 int varFlags;
10492 if (!ctx.
Read(varFlags))
10493 return;
10494
10495 if (varFlags & ItemVariableFlags.FLOAT)
10496 {
10498 }
10499 }
10500
10502 {
10503
10504 super.SerializeNumericalVars(floats_out);
10505
10506
10507
10509 {
10511 }
10512
10514 {
10516 }
10517
10519 {
10521 }
10522
10524 {
10529 }
10530
10532 {
10534 }
10535 }
10536
10538 {
10539
10540 super.DeSerializeNumericalVars(floats);
10541
10542
10543 int index = 0;
10544 int mask = Math.Round(floats.Get(index));
10545
10546 index++;
10547
10549 {
10551 {
10553 }
10554 else
10555 {
10556 float quantity = floats.Get(index);
10557 SetQuantity(quantity,
true,
false,
false,
false);
10558 }
10559 index++;
10560 }
10561
10563 {
10564 float wet = floats.Get(index);
10566 index++;
10567 }
10568
10570 {
10571 int liquidtype = Math.Round(floats.Get(index));
10573 index++;
10574 }
10575
10577 {
10579 index++;
10581 index++;
10583 index++;
10585 index++;
10586 }
10587
10589 {
10590 int cleanness = Math.Round(floats.Get(index));
10592 index++;
10593 }
10594 }
10595
10597 {
10598 super.WriteVarsToCTX(ctx);
10599
10600
10602 {
10604 }
10605
10607 {
10609 }
10610
10612 {
10614 }
10615
10617 {
10618 int r,g,b,a;
10624 }
10625
10627 {
10629 }
10630 }
10631
10633 {
10634 if (!super.ReadVarsFromCTX(ctx,version))
10635 return false;
10636
10637 int intValue;
10638 float value;
10639
10640 if (version < 140)
10641 {
10642 if (!ctx.
Read(intValue))
10643 return false;
10644
10645 m_VariablesMask = intValue;
10646 }
10647
10649 {
10650 if (!ctx.
Read(value))
10651 return false;
10652
10654 {
10656 }
10657 else
10658 {
10660 }
10661 }
10662
10663 if (version < 140)
10664 {
10666 {
10667 if (!ctx.
Read(value))
10668 return false;
10669 SetTemperatureDirect(value);
10670 }
10671 }
10672
10674 {
10675 if (!ctx.
Read(value))
10676 return false;
10678 }
10679
10681 {
10682 if (!ctx.
Read(intValue))
10683 return false;
10685 }
10686
10688 {
10689 int r,g,b,a;
10691 return false;
10693 return false;
10695 return false;
10697 return false;
10698
10700 }
10701
10703 {
10704 if (!ctx.
Read(intValue))
10705 return false;
10707 }
10708
10709 if (version >= 138 && version < 140)
10710 {
10712 {
10713 if (!ctx.
Read(intValue))
10714 return false;
10715 SetFrozen(intValue);
10716 }
10717 }
10718
10719 return true;
10720 }
10721
10722
10724 {
10727 {
10729 }
10730
10731 if (!super.OnStoreLoad(ctx, version))
10732 {
10734 return false;
10735 }
10736
10737 if (version >= 114)
10738 {
10739 bool hasQuickBarIndexSaved;
10740
10741 if (!ctx.
Read(hasQuickBarIndexSaved))
10742 {
10744 return false;
10745 }
10746
10747 if (hasQuickBarIndexSaved)
10748 {
10749 int itmQBIndex;
10750
10751
10752 if (!ctx.
Read(itmQBIndex))
10753 {
10755 return false;
10756 }
10757
10758 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10759 if (itmQBIndex != -1 && parentPlayer)
10760 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10761 }
10762 }
10763 else
10764 {
10765
10766 PlayerBase player;
10767 int itemQBIndex;
10768 if (version ==
int.
MAX)
10769 {
10770 if (!ctx.
Read(itemQBIndex))
10771 {
10773 return false;
10774 }
10775 }
10776 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10777 {
10778
10779 if (!ctx.
Read(itemQBIndex))
10780 {
10782 return false;
10783 }
10784 if (itemQBIndex != -1 && player)
10785 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10786 }
10787 }
10788
10789 if (version < 140)
10790 {
10791
10792 if (!LoadVariables(ctx, version))
10793 {
10795 return false;
10796 }
10797 }
10798
10799
10801 {
10803 return false;
10804 }
10805 if (version >= 132)
10806 {
10808 if (raib)
10809 {
10811 {
10813 return false;
10814 }
10815 }
10816 }
10817
10819 return true;
10820 }
10821
10822
10823
10825 {
10826 super.OnStoreSave(ctx);
10827
10828 PlayerBase player;
10829 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10830 {
10832
10833 int itemQBIndex = -1;
10834 itemQBIndex = player.FindQuickBarEntityIndex(this);
10835 ctx.
Write(itemQBIndex);
10836 }
10837 else
10838 {
10840 }
10841
10843
10845 if (raib)
10846 {
10848 }
10849 }
10850
10851
10853 {
10854 super.AfterStoreLoad();
10855
10857 {
10859 }
10860
10862 {
10865 }
10866 }
10867
10869 {
10870 super.EEOnAfterLoad();
10871
10873 {
10875 }
10876
10879 }
10880
10882 {
10883 return false;
10884 }
10885
10886
10887
10889 {
10891 {
10892 #ifdef PLATFORM_CONSOLE
10893
10895 {
10897 if (menu)
10898 {
10900 }
10901 }
10902 #endif
10903 }
10904
10906 {
10909 }
10910
10912 {
10913 SetWeightDirty();
10915 }
10917 {
10920 }
10921
10923 {
10926 }
10928 {
10931 }
10932
10933 super.OnVariablesSynchronized();
10934 }
10935
10936
10937
10939 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10940 {
10941 if (!IsServerCheck(allow_client))
10942 return false;
10943
10945 return false;
10946
10949
10950 if (value <= (min + 0.001))
10951 value = min;
10952
10953 if (value == min)
10954 {
10955 if (destroy_config)
10956 {
10957 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10958 if (dstr)
10959 {
10961 this.Delete();
10962 return true;
10963 }
10964 }
10965 else if (destroy_forced)
10966 {
10968 this.Delete();
10969 return true;
10970 }
10971
10973 }
10974
10977
10979 {
10981
10982 if (delta)
10984 }
10985
10987
10988 return false;
10989 }
10990
10991
10993 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10994 {
10996 }
10997
10999 {
11002 }
11003
11005 {
11008 }
11009
11011 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11012 {
11013 float value_clamped = Math.Clamp(value, 0, 1);
11015 SetQuantity(result, destroy_config, destroy_forced);
11016 }
11017
11018
11021 {
11023 }
11024
11026 {
11028 }
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11040 {
11041 int slot = -1;
11042 if (GetInventory())
11043 {
11044 InventoryLocation il = new InventoryLocation;
11045 GetInventory().GetCurrentInventoryLocation(il);
11047 }
11048
11050 }
11051
11053 {
11054 float quantity_max = 0;
11055
11057 {
11058 if (attSlotID != -1)
11059 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11060
11061 if (quantity_max <= 0)
11063 }
11064
11065 if (quantity_max <= 0)
11067
11068 return quantity_max;
11069 }
11070
11072 {
11074 }
11075
11077 {
11079 }
11080
11081
11083 {
11085 }
11086
11088 {
11090 }
11091
11093 {
11095 }
11096
11097
11099 {
11100
11101 float weightEx = GetWeightEx();
11102 float special = GetInventoryAndCargoWeight();
11103 return weightEx - special;
11104 }
11105
11106
11108 {
11110 }
11111
11113 {
11115 {
11116 #ifdef DEVELOPER
11117 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11118 {
11119 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11121 }
11122 #endif
11123
11124 return GetQuantity() * GetConfigWeightModified();
11125 }
11126 else if (HasEnergyManager())
11127 {
11128 #ifdef DEVELOPER
11129 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11130 {
11131 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11132 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11133 }
11134 #endif
11135 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11136 }
11137 else
11138 {
11139 #ifdef DEVELOPER
11140 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11141 {
11142 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11143 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11144 }
11145 #endif
11146 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11147 }
11148 }
11149
11152 {
11153 int item_count = 0;
11155
11156 if (GetInventory().GetCargo() != NULL)
11157 {
11158 item_count = GetInventory().GetCargo().GetItemCount();
11159 }
11160
11161 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11162 {
11163 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11164 if (item)
11165 item_count += item.GetNumberOfItems();
11166 }
11167 return item_count;
11168 }
11169
11172 {
11173 float weight = 0;
11174 float wetness = 1;
11175 if (include_wetness)
11178 {
11179 weight = wetness * m_ConfigWeight;
11180 }
11182 {
11183 weight = 1;
11184 }
11185 return weight;
11186 }
11187
11188
11189
11191 {
11192 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11193 {
11194 GameInventory inv = GetInventory();
11195 array<EntityAI> items = new array<EntityAI>;
11197 for (int i = 0; i < items.Count(); i++)
11198 {
11200 if (item)
11201 {
11203 }
11204 }
11205 }
11206 }
11207
11208
11209
11210
11212 {
11213 float energy = 0;
11214 if (HasEnergyManager())
11215 {
11216 energy = GetCompEM().GetEnergy();
11217 }
11218 return energy;
11219 }
11220
11221
11223 {
11224 super.OnEnergyConsumed();
11225
11227 }
11228
11230 {
11231 super.OnEnergyAdded();
11232
11234 }
11235
11236
11238 {
11239 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11240 {
11242 {
11243 float energy_0to1 = GetCompEM().GetEnergy0To1();
11245 }
11246 }
11247 }
11248
11249
11251 {
11252 return ConfigGetFloat("heatIsolation");
11253 }
11254
11256 {
11258 }
11259
11261 {
11262 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11263 if (
GetGame().ConfigIsExisting(paramPath))
11265
11266 return 0.0;
11267 }
11268
11270 {
11271 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11272 if (
GetGame().ConfigIsExisting(paramPath))
11274
11275 return 0.0;
11276 }
11277
11278 override void SetWet(
float value,
bool allow_client =
false)
11279 {
11280 if (!IsServerCheck(allow_client))
11281 return;
11282
11285
11287
11288 m_VarWet = Math.Clamp(value, min, max);
11289
11291 {
11294 }
11295 }
11296
11297 override void AddWet(
float value)
11298 {
11300 }
11301
11303 {
11305 }
11306
11308 {
11310 }
11311
11313 {
11315 }
11316
11318 {
11320 }
11321
11323 {
11325 }
11326
11327 override void OnWetChanged(
float newVal,
float oldVal)
11328 {
11331 if (newLevel != oldLevel)
11332 {
11334 }
11335 }
11336
11338 {
11339 SetWeightDirty();
11340 }
11341
11343 {
11344 return GetWetLevelInternal(
m_VarWet);
11345 }
11346
11347
11348
11350 {
11352 }
11353
11355 {
11357 }
11358
11360 {
11362 }
11363
11365 {
11367 }
11368
11369
11370
11372 {
11373 if (ConfigIsExisting("itemModelLength"))
11374 {
11375 return ConfigGetFloat("itemModelLength");
11376 }
11377 return 0;
11378 }
11379
11381 {
11382 if (ConfigIsExisting("itemAttachOffset"))
11383 {
11384 return ConfigGetFloat("itemAttachOffset");
11385 }
11386 return 0;
11387 }
11388
11389 override void SetCleanness(
int value,
bool allow_client =
false)
11390 {
11391 if (!IsServerCheck(allow_client))
11392 return;
11393
11395
11397
11400 }
11401
11403 {
11405 }
11406
11408 {
11409 return true;
11410 }
11411
11412
11413
11414
11416 {
11418 }
11419
11421 {
11423 }
11424
11425
11426
11427
11428 override void SetColor(
int r,
int g,
int b,
int a)
11429 {
11435 }
11437 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11438 {
11443 }
11444
11446 {
11448 }
11449
11452 {
11453 int r,g,b,a;
11455 r = r/255;
11456 g = g/255;
11457 b = b/255;
11458 a = a/255;
11459 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11460 }
11461
11462
11463
11464 override void SetLiquidType(
int value,
bool allow_client =
false)
11465 {
11466 if (!IsServerCheck(allow_client))
11467 return;
11468
11473 }
11474
11476 {
11477 return ConfigGetInt("varLiquidTypeInit");
11478 }
11479
11481 {
11483 }
11484
11486 {
11488 SetFrozen(false);
11489 }
11490
11493 {
11494 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11495 }
11496
11497
11500 {
11501 PlayerBase nplayer;
11502 if (PlayerBase.CastTo(nplayer, player))
11503 {
11505
11506 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11507 }
11508 }
11509
11510
11513 {
11514 PlayerBase nplayer;
11515 if (PlayerBase.CastTo(nplayer,player))
11516 {
11517
11518 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11519
11520 }
11521
11522
11523 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11524
11525
11526 if (HasEnergyManager())
11527 {
11528 GetCompEM().UpdatePlugState();
11529 }
11530 }
11531
11532
11534 {
11535 super.OnPlacementStarted(player);
11536
11538 }
11539
11540 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11541 {
11543 {
11544 m_AdminLog.OnPlacementComplete(player,
this);
11545 }
11546
11547 super.OnPlacementComplete(player, position, orientation);
11548 }
11549
11550
11551
11552
11553
11555 {
11557 {
11558 return true;
11559 }
11560 else
11561 {
11562 return false;
11563 }
11564 }
11565
11566
11568 {
11570 {
11572 }
11573 }
11574
11575
11577 {
11579 }
11580
11582 {
11584 }
11585
11586 override void InsertAgent(
int agent,
float count = 1)
11587 {
11588 if (count < 1)
11589 return;
11590
11592 }
11593
11596 {
11598 }
11599
11600
11602 {
11604 }
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11648 {
11650 return false;
11651 return true;
11652 }
11653
11655 {
11656
11658 }
11659
11660
11663 {
11664 super.CheckForRoofLimited(timeTresholdMS);
11665
11667 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11668 {
11669 m_PreviousRoofTestTime = time;
11670 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11671 }
11672 }
11673
11674
11676 {
11678 {
11679 return 0;
11680 }
11681
11682 if (GetInventory().GetAttachmentSlotsCount() != 0)
11683 {
11684 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11685 if (filter)
11686 return filter.GetProtectionLevel(type, false, system);
11687 else
11688 return 0;
11689 }
11690
11691 string subclassPath, entryName;
11692
11693 switch (type)
11694 {
11696 entryName = "biological";
11697 break;
11699 entryName = "chemical";
11700 break;
11701 default:
11702 entryName = "biological";
11703 break;
11704 }
11705
11706 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11707
11709 }
11710
11711
11712
11715 {
11716 if (!IsMagazine())
11718
11720 }
11721
11722
11723
11724
11725
11730 {
11731 return true;
11732 }
11733
11735 {
11737 }
11738
11739
11740
11741
11742
11744 {
11745 if (parent)
11746 {
11747 if (parent.IsInherited(DayZInfected))
11748 return true;
11749
11750 if (!parent.IsRuined())
11751 return true;
11752 }
11753
11754 return true;
11755 }
11756
11758 {
11759 if (!super.CanPutAsAttachment(parent))
11760 {
11761 return false;
11762 }
11763
11764 if (!IsRuined() && !parent.IsRuined())
11765 {
11766 return true;
11767 }
11768
11769 return false;
11770 }
11771
11773 {
11774
11775
11776
11777
11778 return super.CanReceiveItemIntoCargo(item);
11779 }
11780
11782 {
11783
11784
11785
11786
11787 GameInventory attachmentInv = attachment.GetInventory();
11789 {
11790 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11791 return false;
11792 }
11793
11794 InventoryLocation loc = new InventoryLocation();
11795 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11796 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11797 return false;
11798
11799 return super.CanReceiveAttachment(attachment, slotId);
11800 }
11801
11803 {
11804 if (!super.CanReleaseAttachment(attachment))
11805 return false;
11806
11807 return GetInventory().AreChildrenAccessible();
11808 }
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11831 {
11832 int id = muzzle_owner.GetMuzzleID();
11833 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11834
11835 if (WPOF_array)
11836 {
11837 for (int i = 0; i < WPOF_array.Count(); i++)
11838 {
11839 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11840
11841 if (WPOF)
11842 {
11843 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11844 }
11845 }
11846 }
11847 }
11848
11849
11851 {
11852 int id = muzzle_owner.GetMuzzleID();
11854
11855 if (WPOBE_array)
11856 {
11857 for (int i = 0; i < WPOBE_array.Count(); i++)
11858 {
11859 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11860
11861 if (WPOBE)
11862 {
11863 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11864 }
11865 }
11866 }
11867 }
11868
11869
11871 {
11872 int id = muzzle_owner.GetMuzzleID();
11873 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11874
11875 if (WPOOH_array)
11876 {
11877 for (int i = 0; i < WPOOH_array.Count(); i++)
11878 {
11879 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11880
11881 if (WPOOH)
11882 {
11883 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11884 }
11885 }
11886 }
11887 }
11888
11889
11891 {
11892 int id = muzzle_owner.GetMuzzleID();
11893 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11894
11895 if (WPOOH_array)
11896 {
11897 for (int i = 0; i < WPOOH_array.Count(); i++)
11898 {
11899 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11900
11901 if (WPOOH)
11902 {
11903 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11904 }
11905 }
11906 }
11907 }
11908
11909
11911 {
11912 int id = muzzle_owner.GetMuzzleID();
11913 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11914
11915 if (WPOOH_array)
11916 {
11917 for (int i = 0; i < WPOOH_array.Count(); i++)
11918 {
11919 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11920
11921 if (WPOOH)
11922 {
11923 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11924 }
11925 }
11926 }
11927 }
11928
11929
11930
11932 {
11934 {
11935 return true;
11936 }
11937
11938 return false;
11939 }
11940
11942 {
11944 {
11945 return true;
11946 }
11947
11948 return false;
11949 }
11950
11952 {
11954 {
11955 return true;
11956 }
11957
11958 return false;
11959 }
11960
11962 {
11963 return false;
11964 }
11965
11968 {
11969 return UATimeSpent.DEFAULT_DEPLOY;
11970 }
11971
11972
11973
11974
11976 {
11978 SetSynchDirty();
11979 }
11980
11982 {
11984 }
11985
11986
11988 {
11989 return false;
11990 }
11991
11994 {
11995 string att_type = "None";
11996
11997 if (ConfigIsExisting("soundAttType"))
11998 {
11999 att_type = ConfigGetString("soundAttType");
12000 }
12001
12003 }
12004
12006 {
12008 }
12009
12010
12011
12012
12013
12019
12021 {
12024
12026 }
12027
12028
12030 {
12032 return;
12033
12035
12038
12041
12042 SoundParameters params = new SoundParameters();
12046 }
12047
12048
12050 {
12052 return;
12053
12055 SetSynchDirty();
12056
12059 }
12060
12061
12063 {
12065 return;
12066
12068 SetSynchDirty();
12069
12072 }
12073
12075 {
12077 }
12078
12080 {
12082 }
12083
12086 {
12087 if (!
GetGame().IsDedicatedServer())
12088 {
12089 if (ConfigIsExisting("attachSoundSet"))
12090 {
12091 string cfg_path = "";
12092 string soundset = "";
12093 string type_name =
GetType();
12094
12097 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12098 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12099
12100 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12101 {
12102 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12103 {
12104 if (cfg_slot_array[i] == slot_type)
12105 {
12106 soundset = cfg_soundset_array[i];
12107 break;
12108 }
12109 }
12110 }
12111
12112 if (soundset != "")
12113 {
12114 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12116 }
12117 }
12118 }
12119 }
12120
12122 {
12123
12124 }
12125
12126 void OnApply(PlayerBase player);
12127
12129 {
12130 return 1.0;
12131 };
12132
12134 {
12136 }
12137
12139 {
12141 }
12142
12144
12146 {
12147 SetDynamicPhysicsLifeTime(0.01);
12149 }
12150
12152 {
12153 array<string> zone_names = new array<string>;
12154 GetDamageZones(zone_names);
12155 for (int i = 0; i < zone_names.Count(); i++)
12156 {
12157 SetHealthMax(zone_names.Get(i),"Health");
12158 }
12159 SetHealthMax("","Health");
12160 }
12161
12164 {
12165 float global_health = GetHealth01("","Health");
12166 array<string> zones = new array<string>;
12167 GetDamageZones(zones);
12168
12169 for (int i = 0; i < zones.Count(); i++)
12170 {
12171 SetHealth01(zones.Get(i),"Health",global_health);
12172 }
12173 }
12174
12177 {
12178 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12179 }
12180
12182 {
12183 if (!hasRootAsPlayer)
12184 {
12185 if (refParentIB)
12186 {
12187
12188 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12189 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12190
12191 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12192 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12193
12196 }
12197 else
12198 {
12199
12202 }
12203 }
12204 }
12205
12207 {
12209 {
12210 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12211 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12212 {
12213 float heatPermCoef = 1.0;
12215 while (ent)
12216 {
12217 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12218 ent = ent.GetHierarchyParent();
12219 }
12220
12221 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12222 }
12223 }
12224 }
12225
12227 {
12228
12229 EntityAI parent = GetHierarchyParent();
12230 if (!parent)
12231 {
12232 hasParent = false;
12233 hasRootAsPlayer = false;
12234 }
12235 else
12236 {
12237 hasParent = true;
12238 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12239 refParentIB =
ItemBase.Cast(parent);
12240 }
12241 }
12242
12243 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12244 {
12245
12246 }
12247
12249 {
12250
12251 return false;
12252 }
12253
12255 {
12256
12257
12258 return false;
12259 }
12260
12262 {
12263
12264 return false;
12265 }
12266
12269 {
12270 return !GetIsFrozen() &&
IsOpen();
12271 }
12272
12274 {
12275 bool hasParent = false, hasRootAsPlayer = false;
12277
12278 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12279 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12280
12281 if (wwtu || foodDecay)
12282 {
12286
12287 if (processWetness || processTemperature || processDecay)
12288 {
12290
12291 if (processWetness)
12292 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12293
12294 if (processTemperature)
12296
12297 if (processDecay)
12298 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12299 }
12300 }
12301 }
12302
12305 {
12307 }
12308
12310 {
12313
12314 return super.GetTemperatureFreezeThreshold();
12315 }
12316
12318 {
12321
12322 return super.GetTemperatureThawThreshold();
12323 }
12324
12326 {
12329
12330 return super.GetItemOverheatThreshold();
12331 }
12332
12334 {
12336 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12337
12338 return super.GetTemperatureFreezeTime();
12339 }
12340
12342 {
12344 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12345
12346 return super.GetTemperatureThawTime();
12347 }
12348
12353
12355 {
12356 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12357 }
12358
12360 {
12361 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12362 }
12363
12366 {
12368 }
12369
12371 {
12373 }
12374
12376 {
12378 }
12379
12382 {
12383 return null;
12384 }
12385
12388 {
12389 return false;
12390 }
12391
12393 {
12395 {
12398 if (!trg)
12399 {
12401 explosive = this;
12402 }
12403
12404 explosive.PairRemote(trg);
12406
12407 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12408 trg.SetPersistentPairID(persistentID);
12409 explosive.SetPersistentPairID(persistentID);
12410
12411 return true;
12412 }
12413 return false;
12414 }
12415
12418 {
12419 float ret = 1.0;
12422 ret *= GetHealth01();
12423
12424 return ret;
12425 }
12426
12427 #ifdef DEVELOPER
12428 override void SetDebugItem()
12429 {
12430 super.SetDebugItem();
12431 _itemBase = this;
12432 }
12433
12435 {
12436 string text = super.GetDebugText();
12437
12439 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12440
12441 return text;
12442 }
12443 #endif
12444
12446 {
12447 return true;
12448 }
12449
12451
12453
12455 {
12458 }
12459
12460
12468
12484}
12485
12487{
12489 if (entity)
12490 {
12491 bool is_item = entity.IsInherited(
ItemBase);
12492 if (is_item && full_quantity)
12493 {
12496 }
12497 }
12498 else
12499 {
12501 return NULL;
12502 }
12503 return entity;
12504}
12505
12507{
12508 if (item)
12509 {
12510 if (health > 0)
12511 item.SetHealth("", "", health);
12512
12513 if (item.CanHaveTemperature())
12514 {
12516 if (item.CanFreeze())
12517 item.SetFrozen(false);
12518 }
12519
12520 if (item.HasEnergyManager())
12521 {
12522 if (quantity >= 0)
12523 {
12524 item.GetCompEM().SetEnergy0To1(quantity);
12525 }
12526 else
12527 {
12529 }
12530 }
12531 else if (item.IsMagazine())
12532 {
12533 Magazine mag = Magazine.Cast(item);
12534 if (quantity >= 0)
12535 {
12536 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12537 }
12538 else
12539 {
12541 }
12542
12543 }
12544 else
12545 {
12546 if (quantity >= 0)
12547 {
12548 item.SetQuantityNormalized(quantity, false);
12549 }
12550 else
12551 {
12553 }
12554
12555 }
12556 }
12557}
12558
12559#ifdef DEVELOPER
12561#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.