7667{
7669 {
7670 return true;
7671 }
7672};
7673
7674
7675
7677{
7681
7683
7686
7687
7688
7689
7690
7699
7705
7710
7715
7736 protected bool m_IsResultOfSplit
7737
7739
7744
7745
7746
7748
7752
7753
7754
7756
7759
7760
7761
7767
7768
7776
7779
7780
7782
7783
7785
7786
7791
7792
7797
7798
7800
7801
7803 {
7808
7809 if (!
GetGame().IsDedicatedServer())
7810 {
7812 {
7814
7816 {
7818 }
7819 }
7820
7823 }
7824
7825 m_OldLocation = null;
7826
7828 {
7830 }
7831
7832 if (ConfigIsExisting("headSelectionsToHide"))
7833 {
7836 }
7837
7839 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7840 {
7842 }
7843
7845
7846 m_IsResultOfSplit = false;
7847
7849 }
7850
7852 {
7853 super.InitItemVariables();
7854
7860 m_Count = ConfigGetInt(
"count");
7861
7864
7869
7872
7877
7889
7893
7894
7897 if (ConfigIsExisting("canBeSplit"))
7898 {
7901 }
7902
7904 if (ConfigIsExisting("itemBehaviour"))
7906
7907
7910 RegisterNetSyncVariableInt("m_VarLiquidType");
7911 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7912
7913 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7914 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7915 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7916
7917 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7918 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7919 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7920 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7921
7922 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7923 RegisterNetSyncVariableBool("m_IsTakeable");
7924 RegisterNetSyncVariableBool("m_IsHologram");
7925
7928 {
7931 }
7932
7934
7936 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7938
7939 }
7940
7942 {
7944 }
7945
7947 {
7950 {
7955 }
7956 }
7957
7958 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7959 {
7961 {
7964 }
7965
7967 }
7968
7970 {
7976 }
7977
7979
7981 {
7983
7984 if (!action)
7985 {
7986 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7987 return;
7988 }
7989
7991 if (!ai)
7992 {
7994 return;
7995 }
7996
7998 if (!action_array)
7999 {
8000 action_array = new array<ActionBase_Basic>;
8002 }
8003 if (LogManager.IsActionLogEnable())
8004 {
8005 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8006 }
8007
8008 if (action_array.Find(action) != -1)
8009 {
8010 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8011 }
8012 else
8013 {
8014 action_array.Insert(action);
8015 }
8016 }
8017
8019 {
8021 ActionBase action = player.GetActionManager().GetAction(actionName);
8024
8025 if (action_array)
8026 {
8027 action_array.RemoveItem(action);
8028 }
8029 }
8030
8031
8032
8034 {
8035 ActionOverrideData overrideData = new ActionOverrideData();
8039
8041 if (!actionMap)
8042 {
8045 }
8046
8047 actionMap.Insert(this.
Type(), overrideData);
8048
8049 }
8050
8052
8054
8055
8057 {
8060
8063
8064 string config_to_search = "CfgVehicles";
8065 string muzzle_owner_config;
8066
8068 {
8069 if (IsInherited(Weapon))
8070 config_to_search = "CfgWeapons";
8071
8072 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8073
8074 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8075
8077
8078 if (config_OnFire_subclass_count > 0)
8079 {
8080 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8081
8082 for (int i = 0; i < config_OnFire_subclass_count; i++)
8083 {
8084 string particle_class = "";
8086 string config_OnFire_entry = config_OnFire_class + particle_class;
8087 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8088 WPOF_array.Insert(WPOF);
8089 }
8090
8091
8093 }
8094 }
8095
8097 {
8098 config_to_search = "CfgWeapons";
8099 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8100
8101 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8102
8104
8105 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8106 {
8107 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8108
8109 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8110 {
8111 string particle_class2 = "";
8113 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8114 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8115 WPOBE_array.Insert(WPOBE);
8116 }
8117
8118
8120 }
8121 }
8122 }
8123
8124
8126 {
8129
8131 {
8132 string config_to_search = "CfgVehicles";
8133
8134 if (IsInherited(Weapon))
8135 config_to_search = "CfgWeapons";
8136
8137 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8138 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8139
8140 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8141 {
8142
8144
8146 {
8148 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8150 return;
8151 }
8152
8155
8156
8157
8159 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8160
8161 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8162 {
8163 string particle_class = "";
8165 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8167
8168 if (entry_type == CT_CLASS)
8169 {
8170 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8171 WPOOH_array.Insert(WPOF);
8172 }
8173 }
8174
8175
8177 }
8178 }
8179 }
8180
8182 {
8184 }
8185
8187 {
8189 {
8191
8194
8197
8198 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8199 }
8200 }
8201
8203 {
8205 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8206
8208 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8209
8211 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8212
8214 {
8216 }
8217 }
8218
8220 {
8222 }
8223
8225 {
8228 else
8230
8232 {
8235 }
8236 else
8237 {
8240
8243 }
8244
8246 }
8247
8249 {
8251 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8252 }
8253
8255 {
8257 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8259 }
8260
8262 {
8264 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8265 }
8266
8268 {
8271
8272 OverheatingParticle OP = new OverheatingParticle();
8277
8279 }
8280
8282 {
8285
8286 return -1;
8287 }
8288
8290 {
8292 {
8295
8296 for (int i = count; i > 0; --i)
8297 {
8298 int id = i - 1;
8301
8304
8305 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8306 {
8307 if (p)
8308 {
8311 }
8312 }
8313 }
8314 }
8315 }
8316
8318 {
8320 {
8322 {
8323 int id = i - 1;
8325
8326 if (OP)
8327 {
8329
8330 if (p)
8331 {
8333 }
8334
8335 delete OP;
8336 }
8337 }
8338
8341 }
8342 }
8343
8346 {
8347 return 0.0;
8348 }
8349
8350
8352 {
8353 return 250;
8354 }
8355
8357 {
8358 return 0;
8359 }
8360
8363 {
8365 return true;
8366
8367 return false;
8368 }
8369
8372 {
8375
8377 {
8379 }
8380 else
8381 {
8382
8384 }
8385
8387 }
8388
8395 {
8396 return -1;
8397 }
8398
8399
8400
8401
8403 {
8405 {
8407 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8408
8409 if (r_index >= 0)
8410 {
8411 InventoryLocation r_il = new InventoryLocation;
8412 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8413
8414 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8417 {
8418 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8419 }
8421 {
8422 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8423 }
8424
8425 }
8426
8427 player.GetHumanInventory().ClearUserReservedLocation(this);
8428 }
8429
8432 }
8433
8434
8435
8436
8438 {
8439 return ItemBase.m_DebugActionsMask;
8440 }
8441
8443 {
8444 return ItemBase.m_DebugActionsMask & mask;
8445 }
8446
8448 {
8449 ItemBase.m_DebugActionsMask = mask;
8450 }
8451
8453 {
8454 ItemBase.m_DebugActionsMask |= mask;
8455 }
8456
8458 {
8459 ItemBase.m_DebugActionsMask &= ~mask;
8460 }
8461
8463 {
8465 {
8467 }
8468 else
8469 {
8471 }
8472 }
8473
8474
8476 {
8477 if (GetEconomyProfile())
8478 {
8479 float q_max = GetEconomyProfile().GetQuantityMax();
8480 if (q_max > 0)
8481 {
8482 float q_min = GetEconomyProfile().GetQuantityMin();
8483 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8484
8486 {
8487 ComponentEnergyManager comp = GetCompEM();
8489 {
8491 }
8492 }
8494 {
8496
8497 }
8498
8499 }
8500 }
8501 }
8502
8505 {
8506 EntityAI parent = GetHierarchyParent();
8507
8508 if (parent)
8509 {
8510 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8511 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8512 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8513 }
8514 }
8515
8518 {
8519 EntityAI parent = GetHierarchyParent();
8520
8521 if (parent)
8522 {
8523 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8524 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8525 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8526 }
8527 }
8528
8530 {
8531
8532
8533
8534
8536
8538 {
8539 if (ScriptInputUserData.CanStoreInputUserData())
8540 {
8541 ScriptInputUserData ctx = new ScriptInputUserData;
8547 ctx.
Write(use_stack_max);
8550
8552 {
8553 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8554 }
8555 }
8556 }
8557 else if (!
GetGame().IsMultiplayer())
8558 {
8560 }
8561 }
8562
8564 {
8566 }
8567
8569 {
8571 }
8572
8574 {
8576 }
8577
8579 {
8580
8581 return false;
8582 }
8583
8585 {
8586 return false;
8587 }
8588
8592 {
8593 return false;
8594 }
8595
8597 {
8598 return "";
8599 }
8600
8602
8604 {
8605 return false;
8606 }
8607
8609 {
8610 return true;
8611 }
8612
8613
8614
8616 {
8617 return true;
8618 }
8619
8621 {
8622 return true;
8623 }
8624
8626 {
8627 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8629 }
8630
8632 {
8634 }
8635
8637 {
8639 if (!is_being_placed)
8641 SetSynchDirty();
8642 }
8643
8644
8646
8648 {
8650 }
8651
8653 {
8655 }
8656
8658 {
8659 return 1;
8660 }
8661
8663 {
8664 return false;
8665 }
8666
8668 {
8670 SetSynchDirty();
8671 }
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8708 {
8709 super.OnMovedInsideCargo(container);
8710
8711 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8712 }
8713
8714 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8715 {
8716 super.EEItemLocationChanged(oldLoc,newLoc);
8717
8718 PlayerBase new_player = null;
8719 PlayerBase old_player = null;
8720
8721 if (newLoc.GetParent())
8722 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8723
8724 if (oldLoc.GetParent())
8725 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8726
8728 {
8729 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8730
8731 if (r_index >= 0)
8732 {
8733 InventoryLocation r_il = new InventoryLocation;
8734 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8735
8736 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8739 {
8740 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8741 }
8743 {
8744 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8745 }
8746
8747 }
8748 }
8749
8751 {
8752 if (new_player)
8753 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8754
8755 if (new_player == old_player)
8756 {
8757
8758 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8759 {
8761 {
8762 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8763 {
8764 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8765 }
8766 }
8767 else
8768 {
8769 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8770 }
8771 }
8772
8773 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8774 {
8775 int type = oldLoc.GetType();
8777 {
8778 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8779 }
8781 {
8782 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8783 }
8784 }
8785 if (!m_OldLocation)
8786 {
8787 m_OldLocation = new InventoryLocation;
8788 }
8789 m_OldLocation.Copy(oldLoc);
8790 }
8791 else
8792 {
8793 if (m_OldLocation)
8794 {
8795 m_OldLocation.Reset();
8796 }
8797 }
8798
8800 }
8801 else
8802 {
8803 if (new_player)
8804 {
8805 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8806 if (res_index >= 0)
8807 {
8808 InventoryLocation il = new InventoryLocation;
8809 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8811 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8814 {
8815 il.
GetParent().GetOnReleaseLock().Invoke(it);
8816 }
8818 {
8820 }
8821
8822 }
8823 }
8825 {
8826
8828 }
8829
8830 if (m_OldLocation)
8831 {
8832 m_OldLocation.Reset();
8833 }
8834 }
8835 }
8836
8837 override void EOnContact(IEntity other, Contact extra)
8838 {
8840 {
8841 int liquidType = -1;
8843 if (impactSpeed > 0.0)
8844 {
8846 #ifndef SERVER
8848 #else
8850 SetSynchDirty();
8851 #endif
8853 }
8854 }
8855
8856 #ifdef SERVER
8857 if (GetCompEM() && GetCompEM().IsPlugged())
8858 {
8859 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8860 GetCompEM().UnplugThis();
8861 }
8862 #endif
8863 }
8864
8866
8868 {
8870 }
8871
8873 {
8874
8875 }
8876
8878 {
8879 super.OnItemLocationChanged(old_owner, new_owner);
8880
8881 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8882 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8883
8884 if (!relatedPlayer && playerNew)
8885 relatedPlayer = playerNew;
8886
8887 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8888 {
8890 if (actionMgr)
8891 {
8892 ActionBase currentAction = actionMgr.GetRunningAction();
8893 if (currentAction)
8895 }
8896 }
8897
8898 Man ownerPlayerOld = null;
8899 Man ownerPlayerNew = null;
8900
8901 if (old_owner)
8902 {
8903 if (old_owner.
IsMan())
8904 {
8905 ownerPlayerOld = Man.Cast(old_owner);
8906 }
8907 else
8908 {
8909 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8910 }
8911 }
8912 else
8913 {
8915 {
8917
8918 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8919 {
8920 GetCompEM().UnplugThis();
8921 }
8922 }
8923 }
8924
8925 if (new_owner)
8926 {
8927 if (new_owner.
IsMan())
8928 {
8929 ownerPlayerNew = Man.Cast(new_owner);
8930 }
8931 else
8932 {
8933 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8934 }
8935 }
8936
8937 if (ownerPlayerOld != ownerPlayerNew)
8938 {
8939 if (ownerPlayerOld)
8940 {
8941 array<EntityAI> subItemsExit = new array<EntityAI>;
8943 for (int i = 0; i < subItemsExit.Count(); i++)
8944 {
8947 }
8948 }
8949
8950 if (ownerPlayerNew)
8951 {
8952 array<EntityAI> subItemsEnter = new array<EntityAI>;
8954 for (int j = 0; j < subItemsEnter.Count(); j++)
8955 {
8958 }
8959 }
8960 }
8961 else if (ownerPlayerNew != null)
8962 {
8963 PlayerBase nplayer;
8964 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8965 {
8966 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8968 for (int k = 0; k < subItemsUpdate.Count(); k++)
8969 {
8971 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8972 }
8973 }
8974 }
8975
8976 if (old_owner)
8977 old_owner.OnChildItemRemoved(this);
8978 if (new_owner)
8979 new_owner.OnChildItemReceived(this);
8980 }
8981
8982
8984 {
8985 super.EEDelete(parent);
8986 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8987 if (player)
8988 {
8990
8991 if (player.IsAlive())
8992 {
8993 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8994 if (r_index >= 0)
8995 {
8996 InventoryLocation r_il = new InventoryLocation;
8997 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8998
8999 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9002 {
9003 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9004 }
9006 {
9007 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9008 }
9009
9010 }
9011
9012 player.RemoveQuickBarEntityShortcut(this);
9013 }
9014 }
9015 }
9016
9018 {
9019 super.EEKilled(killer);
9020
9023 {
9024 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9025 {
9026 if (IsMagazine())
9027 {
9028 if (Magazine.Cast(this).GetAmmoCount() > 0)
9029 {
9031 }
9032 }
9033 else
9034 {
9036 }
9037 }
9038 }
9039 }
9040
9042 {
9043 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9044
9045 super.OnWasAttached(parent, slot_id);
9046
9049
9051 }
9052
9054 {
9055 super.OnWasDetached(parent, slot_id);
9056
9059 }
9060
9062 {
9063 int idx;
9066
9067 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9068 if (inventory_slots.Count() < 1)
9069 {
9070 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9071 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9072 }
9073 else
9074 {
9075 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9076 }
9077
9078 idx = inventory_slots.Find(slot);
9079 if (idx < 0)
9080 return "";
9081
9082 return attach_types.Get(idx);
9083 }
9084
9086 {
9087 int idx = -1;
9088 string slot;
9089
9092
9093 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9094 if (inventory_slots.Count() < 1)
9095 {
9096 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9097 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9098 }
9099 else
9100 {
9101 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9102 if (detach_types.Count() < 1)
9103 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9104 }
9105
9106 for (int i = 0; i < inventory_slots.Count(); i++)
9107 {
9108 slot = inventory_slots.Get(i);
9109 }
9110
9111 if (slot != "")
9112 {
9113 if (detach_types.Count() == 1)
9114 idx = 0;
9115 else
9116 idx = inventory_slots.Find(slot);
9117 }
9118 if (idx < 0)
9119 return "";
9120
9121 return detach_types.Get(idx);
9122 }
9123
9125 {
9126
9128
9129
9130 float min_time = 1;
9131 float max_time = 3;
9132 float delay = Math.RandomFloat(min_time, max_time);
9133
9134 explode_timer.Run(delay, this, "DoAmmoExplosion");
9135 }
9136
9138 {
9139 Magazine magazine = Magazine.Cast(this);
9140 int pop_sounds_count = 6;
9141 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9142
9143
9144 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9145 string sound_name = pop_sounds[ sound_idx ];
9147
9148
9149 magazine.ServerAddAmmoCount(-1);
9150
9151
9152 float min_temp_to_explode = 100;
9153
9154 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9155 {
9157 }
9158 }
9159
9160
9161 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9162 {
9163 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9164
9165 const int CHANCE_DAMAGE_CARGO = 4;
9166 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9167 const int CHANCE_DAMAGE_NOTHING = 2;
9168
9170 {
9171 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9172 int chances;
9173 int rnd;
9174
9175 if (GetInventory().GetCargo())
9176 {
9177 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9178 rnd = Math.RandomInt(0,chances);
9179
9180 if (rnd < CHANCE_DAMAGE_CARGO)
9181 {
9183 }
9184 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9185 {
9187 }
9188 }
9189 else
9190 {
9191 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9192 rnd = Math.RandomInt(0,chances);
9193
9194 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9195 {
9197 }
9198 }
9199 }
9200 }
9201
9203 {
9204 if (GetInventory().GetCargo())
9205 {
9206 int item_count = GetInventory().GetCargo().GetItemCount();
9207 if (item_count > 0)
9208 {
9209 int random_pick = Math.RandomInt(0, item_count);
9211 if (!item.IsExplosive())
9212 {
9213 item.AddHealth("","",damage);
9214 return true;
9215 }
9216 }
9217 }
9218 return false;
9219 }
9220
9222 {
9223 int attachment_count = GetInventory().AttachmentCount();
9224 if (attachment_count > 0)
9225 {
9226 int random_pick = Math.RandomInt(0, attachment_count);
9227 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9228 if (!attachment.IsExplosive())
9229 {
9230 attachment.AddHealth("","",damage);
9231 return true;
9232 }
9233 }
9234 return false;
9235 }
9236
9238 {
9240 }
9241
9243 {
9245 return GetInventory().CanRemoveEntity();
9246
9247 return false;
9248 }
9249
9251 {
9253 return;
9254
9256 {
9257 if (ScriptInputUserData.CanStoreInputUserData())
9258 {
9259 ScriptInputUserData ctx = new ScriptInputUserData;
9264 ctx.
Write(destination_entity);
9268 }
9269 }
9270 else if (!
GetGame().IsMultiplayer())
9271 {
9273 }
9274 }
9275
9277 {
9279 return;
9280
9281 float split_quantity_new;
9285 InventoryLocation loc = new InventoryLocation;
9286
9287 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9288 {
9290 split_quantity_new = stack_max;
9291 else
9293
9294 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9295 if (new_item)
9296 {
9297 new_item.SetResultOfSplit(true);
9298 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9300 new_item.SetQuantity(split_quantity_new);
9301 }
9302 }
9303 else if (destination_entity && slot_id == -1)
9304 {
9305 if (quantity > stack_max)
9306 split_quantity_new = stack_max;
9307 else
9308 split_quantity_new = quantity;
9309
9311 {
9314 }
9315
9316 if (new_item)
9317 {
9318 new_item.SetResultOfSplit(true);
9319 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9321 new_item.SetQuantity(split_quantity_new);
9322 }
9323 }
9324 else
9325 {
9326 if (stack_max != 0)
9327 {
9329 {
9331 }
9332
9333 if (split_quantity_new == 0)
9334 {
9335 if (!
GetGame().IsMultiplayer())
9336 player.PhysicalPredictiveDropItem(this);
9337 else
9338 player.ServerDropEntity(this);
9339 return;
9340 }
9341
9343
9344 if (new_item)
9345 {
9346 new_item.SetResultOfSplit(true);
9347 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9349 new_item.SetQuantity(stack_max);
9350 new_item.PlaceOnSurface();
9351 }
9352 }
9353 }
9354 }
9355
9357 {
9359 return;
9360
9361 float split_quantity_new;
9365 InventoryLocation loc = new InventoryLocation;
9366
9367 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9368 {
9370 split_quantity_new = stack_max;
9371 else
9373
9374 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9375 if (new_item)
9376 {
9377 new_item.SetResultOfSplit(true);
9378 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9380 new_item.SetQuantity(split_quantity_new);
9381 }
9382 }
9383 else if (destination_entity && slot_id == -1)
9384 {
9385 if (quantity > stack_max)
9386 split_quantity_new = stack_max;
9387 else
9388 split_quantity_new = quantity;
9389
9391 {
9394 }
9395
9396 if (new_item)
9397 {
9398 new_item.SetResultOfSplit(true);
9399 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9401 new_item.SetQuantity(split_quantity_new);
9402 }
9403 }
9404 else
9405 {
9406 if (stack_max != 0)
9407 {
9409 {
9411 }
9412
9414
9415 if (new_item)
9416 {
9417 new_item.SetResultOfSplit(true);
9418 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9420 new_item.SetQuantity(stack_max);
9421 new_item.PlaceOnSurface();
9422 }
9423 }
9424 }
9425 }
9426
9428 {
9430 return;
9431
9433 {
9434 if (ScriptInputUserData.CanStoreInputUserData())
9435 {
9436 ScriptInputUserData ctx = new ScriptInputUserData;
9441 dst.WriteToContext(ctx);
9443 }
9444 }
9445 else if (!
GetGame().IsMultiplayer())
9446 {
9448 }
9449 }
9450
9452 {
9454 return;
9455
9457 {
9458 if (ScriptInputUserData.CanStoreInputUserData())
9459 {
9460 ScriptInputUserData ctx = new ScriptInputUserData;
9465 ctx.
Write(destination_entity);
9471 }
9472 }
9473 else if (!
GetGame().IsMultiplayer())
9474 {
9476 }
9477 }
9478
9480 {
9482 }
9483
9485 {
9487 return this;
9488
9490 float split_quantity_new;
9492 if (dst.IsValid())
9493 {
9494 int slot_id = dst.GetSlot();
9496
9497 if (quantity > stack_max)
9498 split_quantity_new = stack_max;
9499 else
9500 split_quantity_new = quantity;
9501
9503
9504 if (new_item)
9505 {
9506 new_item.SetResultOfSplit(true);
9507 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9510 }
9511
9512 return new_item;
9513 }
9514
9515 return null;
9516 }
9517
9519 {
9521 return;
9522
9524 float split_quantity_new;
9526 if (destination_entity)
9527 {
9529 if (quantity > stackable)
9530 split_quantity_new = stackable;
9531 else
9532 split_quantity_new = quantity;
9533
9534 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9535 if (new_item)
9536 {
9537 new_item.SetResultOfSplit(true);
9538 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9540 new_item.SetQuantity(split_quantity_new);
9541 }
9542 }
9543 }
9544
9546 {
9548 return;
9549
9551 {
9552 if (ScriptInputUserData.CanStoreInputUserData())
9553 {
9554 ScriptInputUserData ctx = new ScriptInputUserData;
9559 ItemBase destination_entity =
this;
9560 ctx.
Write(destination_entity);
9564 }
9565 }
9566 else if (!
GetGame().IsMultiplayer())
9567 {
9569 }
9570 }
9571
9573 {
9575 return;
9576
9578 float split_quantity_new;
9580 if (player)
9581 {
9583 if (quantity > stackable)
9584 split_quantity_new = stackable;
9585 else
9586 split_quantity_new = quantity;
9587
9588 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9589 new_item =
ItemBase.Cast(in_hands);
9590 if (new_item)
9591 {
9592 new_item.SetResultOfSplit(true);
9593 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9595 new_item.SetQuantity(split_quantity_new);
9596 }
9597 }
9598 }
9599
9601 {
9603 return;
9604
9606 float split_quantity_new = Math.Floor(quantity * 0.5);
9607
9609
9610 if (new_item)
9611 {
9612 if (new_item.GetQuantityMax() < split_quantity_new)
9613 {
9614 split_quantity_new = new_item.GetQuantityMax();
9615 }
9616
9617 new_item.SetResultOfSplit(true);
9618 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9619
9621 {
9624 }
9625 else
9626 {
9629 }
9630 }
9631 }
9632
9634 {
9636 return;
9637
9639 float split_quantity_new = Math.Floor(quantity / 2);
9640
9641 InventoryLocation invloc = new InventoryLocation;
9643
9645 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9646
9647 if (new_item)
9648 {
9649 if (new_item.GetQuantityMax() < split_quantity_new)
9650 {
9651 split_quantity_new = new_item.GetQuantityMax();
9652 }
9654 {
9657 }
9658 else
9659 {
9662 }
9663 }
9664 }
9665
9668 {
9669 SetWeightDirty();
9671
9672 if (parent)
9673 parent.OnAttachmentQuantityChangedEx(this, delta);
9674
9676 {
9678 {
9680 }
9682 {
9683 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9685 }
9686 }
9687
9688 }
9689
9692 {
9693
9694 }
9695
9698 {
9700 }
9701
9703 {
9704 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9705
9707 {
9708 if (newLevel == GameConstants.STATE_RUINED)
9709 {
9711 EntityAI parent = GetHierarchyParent();
9712 if (parent && parent.IsFireplace())
9713 {
9714 CargoBase cargo = GetInventory().GetCargo();
9715 if (cargo)
9716 {
9718 {
9720 }
9721 }
9722 }
9723 }
9724
9726 {
9727
9729 return;
9730 }
9731
9732 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9733 {
9735 }
9736 }
9737 }
9738
9739
9741 {
9742 super.OnRightClick();
9743
9745 {
9747 {
9748 if (ScriptInputUserData.CanStoreInputUserData())
9749 {
9750 vector m4[4];
9752
9753 EntityAI root = GetHierarchyRoot();
9754
9755 InventoryLocation dst = new InventoryLocation;
9757 {
9758 if (root)
9759 {
9760 root.GetTransform(m4);
9762 }
9763 else
9764 GetInventory().GetCurrentInventoryLocation(dst);
9765 }
9766 else
9767 {
9769
9770
9771 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9772 {
9773 if (root)
9774 {
9775 root.GetTransform(m4);
9777 }
9778 else
9779 GetInventory().GetCurrentInventoryLocation(dst);
9780 }
9781 else
9782 {
9783 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9784 }
9785 }
9786
9787 ScriptInputUserData ctx = new ScriptInputUserData;
9795 }
9796 }
9797 else if (!
GetGame().IsMultiplayer())
9798 {
9800 }
9801 }
9802 }
9803
9804 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9805 {
9806
9807 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9808 return false;
9809
9810 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9811 return false;
9812
9813
9815 return false;
9816
9817
9818 Magazine mag = Magazine.Cast(this);
9819 if (mag)
9820 {
9821 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9822 return false;
9823
9824 if (stack_max_limit)
9825 {
9826 Magazine other_mag = Magazine.Cast(other_item);
9827 if (other_item)
9828 {
9829 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9830 return false;
9831 }
9832
9833 }
9834 }
9835 else
9836 {
9837
9839 return false;
9840
9842 return false;
9843 }
9844
9845 PlayerBase player = null;
9846 if (CastTo(player, GetHierarchyRootPlayer()))
9847 {
9848 if (player.GetInventory().HasAttachment(this))
9849 return false;
9850
9851 if (player.IsItemsToDelete())
9852 return false;
9853 }
9854
9855 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9856 return false;
9857
9858 int slotID;
9860 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9861 return false;
9862
9863 return true;
9864 }
9865
9867 {
9869 }
9870
9872 {
9873 return m_IsResultOfSplit;
9874 }
9875
9877 {
9878 m_IsResultOfSplit = value;
9879 }
9880
9882 {
9884 }
9885
9887 {
9888 float other_item_quantity = other_item.GetQuantity();
9889 float this_free_space;
9890
9892
9894
9895 if (other_item_quantity > this_free_space)
9896 {
9897 return this_free_space;
9898 }
9899 else
9900 {
9901 return other_item_quantity;
9902 }
9903 }
9904
9906 {
9908 }
9909
9911 {
9913 return;
9914
9915 if (!IsMagazine() && other_item)
9916 {
9918 if (quantity_used != 0)
9919 {
9920 float hp1 = GetHealth01("","");
9921 float hp2 = other_item.GetHealth01("","");
9922 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9923 hpResult = hpResult / (
GetQuantity() + quantity_used);
9924
9925 hpResult *= GetMaxHealth();
9926 Math.Round(hpResult);
9927 SetHealth("", "Health", hpResult);
9928
9930 other_item.AddQuantity(-quantity_used);
9931 }
9932 }
9934 }
9935
9937 {
9938 #ifdef SERVER
9939 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9940 GetHierarchyParent().IncreaseLifetimeUp();
9941 #endif
9942 };
9943
9945 {
9946 PlayerBase p = PlayerBase.Cast(player);
9947
9948 array<int> recipesIds = p.m_Recipes;
9949 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9950 if (moduleRecipesManager)
9951 {
9952 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9953 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9954 }
9955
9956 for (int i = 0;i < recipesIds.Count(); i++)
9957 {
9958 int key = recipesIds.Get(i);
9959 string recipeName = moduleRecipesManager.GetRecipeName(key);
9961 }
9962 }
9963
9964
9965 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9966 {
9967 super.GetDebugActions(outputList);
9968
9969
9974
9975
9979
9983
9984
9987
9988
9990 {
9993 }
9994
9996
9999
10003 }
10004
10005
10006
10007
10009 {
10010 super.OnAction(action_id, player, ctx);
10011 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10012 {
10013 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10014 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10015 PlayerBase p = PlayerBase.Cast(player);
10016 if (
EActions.RECIPES_RANGE_START < 1000)
10017 {
10018 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10019 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10020 }
10021 }
10022 #ifndef SERVER
10023 else if (action_id ==
EActions.WATCH_PLAYER)
10024 {
10025 PluginDeveloper.SetDeveloperItemClientEx(player);
10026 }
10027 #endif
10029 {
10030 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10031 {
10032 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10033 OnDebugButtonPressServer(id + 1);
10034 }
10035
10036 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10037 {
10038 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10040 }
10041
10042 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10043 {
10044 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10046 }
10047
10048 else if (action_id ==
EActions.ADD_QUANTITY)
10049 {
10050 if (IsMagazine())
10051 {
10052 Magazine mag = Magazine.Cast(this);
10053 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10054 }
10055 else
10056 {
10058 }
10059
10060 if (m_EM)
10061 {
10062 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10063 }
10064
10065 }
10066
10067 else if (action_id ==
EActions.REMOVE_QUANTITY)
10068 {
10069 if (IsMagazine())
10070 {
10071 Magazine mag2 = Magazine.Cast(this);
10072 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10073 }
10074 else
10075 {
10077 }
10078 if (m_EM)
10079 {
10080 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10081 }
10082
10083 }
10084
10085 else if (action_id ==
EActions.SET_QUANTITY_0)
10086 {
10088
10089 if (m_EM)
10090 {
10091 m_EM.SetEnergy(0);
10092 }
10093 }
10094
10095 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10096 {
10098
10099 if (m_EM)
10100 {
10101 m_EM.SetEnergy(m_EM.GetEnergyMax());
10102 }
10103 }
10104
10105 else if (action_id ==
EActions.ADD_HEALTH)
10106 {
10107 AddHealth("","",GetMaxHealth("","Health")/5);
10108 }
10109 else if (action_id ==
EActions.REMOVE_HEALTH)
10110 {
10111 AddHealth("","",-GetMaxHealth("","Health")/5);
10112 }
10113 else if (action_id ==
EActions.DESTROY_HEALTH)
10114 {
10115 SetHealth01("","",0);
10116 }
10117 else if (action_id ==
EActions.WATCH_ITEM)
10118 {
10120 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10121 #ifdef DEVELOPER
10122 SetDebugDeveloper_item(this);
10123 #endif
10124 }
10125
10126 else if (action_id ==
EActions.ADD_TEMPERATURE)
10127 {
10128 AddTemperature(20);
10129
10130 }
10131
10132 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10133 {
10134 AddTemperature(-20);
10135
10136 }
10137
10138 else if (action_id ==
EActions.FLIP_FROZEN)
10139 {
10140 SetFrozen(!GetIsFrozen());
10141
10142 }
10143
10144 else if (action_id ==
EActions.ADD_WETNESS)
10145 {
10147
10148 }
10149
10150 else if (action_id ==
EActions.REMOVE_WETNESS)
10151 {
10153
10154 }
10155
10156 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10157 {
10160
10161
10162 }
10163
10164 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10165 {
10168 }
10169
10170 else if (action_id ==
EActions.MAKE_SPECIAL)
10171 {
10172 auto debugParams = DebugSpawnParams.WithPlayer(player);
10173 OnDebugSpawnEx(debugParams);
10174 }
10175
10176 else if (action_id ==
EActions.DELETE)
10177 {
10178 Delete();
10179 }
10180
10181 }
10182
10183
10184 return false;
10185 }
10186
10187
10188
10189
10193
10196
10197
10198
10200 {
10201 return false;
10202 }
10203
10204
10206 {
10207 return true;
10208 }
10209
10210
10212 {
10213 return true;
10214 }
10215
10216
10217
10219 {
10220 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10222 }
10223
10226 {
10227 return null;
10228 }
10229
10231 {
10232 return false;
10233 }
10234
10236 {
10237 return false;
10238 }
10239
10243
10244
10246 {
10247 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10248 return module_repairing.CanRepair(this, item_repair_kit);
10249 }
10250
10251
10252 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10253 {
10254 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10255 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10256 }
10257
10258
10260 {
10261
10262
10263
10264
10265
10266
10267
10268
10269 return 1;
10270 }
10271
10272
10273
10275 {
10277 }
10278
10279
10280
10282 {
10284 }
10285
10286
10295 {
10296 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10297
10298 if (player)
10299 {
10300 player.MessageStatus(text);
10301 }
10302 }
10303
10304
10313 {
10314 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10315
10316 if (player)
10317 {
10318 player.MessageAction(text);
10319 }
10320 }
10321
10322
10331 {
10332 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10333
10334 if (player)
10335 {
10336 player.MessageFriendly(text);
10337 }
10338 }
10339
10340
10349 {
10350 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10351
10352 if (player)
10353 {
10354 player.MessageImportant(text);
10355 }
10356 }
10357
10359 {
10360 return true;
10361 }
10362
10363
10364 override bool KindOf(
string tag)
10365 {
10366 bool found = false;
10367 string item_name = this.
GetType();
10370
10371 int array_size = item_tag_array.Count();
10372 for (int i = 0; i < array_size; i++)
10373 {
10374 if (item_tag_array.Get(i) == tag)
10375 {
10376 found = true;
10377 break;
10378 }
10379 }
10380 return found;
10381 }
10382
10383
10385 {
10386
10387 super.OnRPC(sender, rpc_type,ctx);
10388
10389
10390 switch (rpc_type)
10391 {
10392 #ifndef SERVER
10393 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10394 Param2<bool, string> p = new Param2<bool, string>(false, "");
10395
10397 return;
10398
10399 bool play = p.param1;
10400 string soundSet = p.param2;
10401
10402 if (play)
10403 {
10405 {
10407 {
10409 }
10410 }
10411 else
10412 {
10414 }
10415 }
10416 else
10417 {
10419 }
10420
10421 break;
10422 #endif
10423
10424 }
10425
10427 {
10429 }
10430 }
10431
10432
10433
10434
10436 {
10437 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10438 return plugin.GetID(
name);
10439 }
10440
10442 {
10443 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10444 return plugin.GetName(id);
10445 }
10446
10449 {
10450
10451
10452 int varFlags;
10453 if (!ctx.
Read(varFlags))
10454 return;
10455
10456 if (varFlags & ItemVariableFlags.FLOAT)
10457 {
10459 }
10460 }
10461
10463 {
10464
10465 super.SerializeNumericalVars(floats_out);
10466
10467
10468
10470 {
10472 }
10473
10475 {
10477 }
10478
10480 {
10482 }
10483
10485 {
10490 }
10491
10493 {
10495 }
10496 }
10497
10499 {
10500
10501 super.DeSerializeNumericalVars(floats);
10502
10503
10504 int index = 0;
10505 int mask = Math.Round(floats.Get(index));
10506
10507 index++;
10508
10510 {
10512 {
10514 }
10515 else
10516 {
10517 float quantity = floats.Get(index);
10518 SetQuantity(quantity,
true,
false,
false,
false);
10519 }
10520 index++;
10521 }
10522
10524 {
10525 float wet = floats.Get(index);
10527 index++;
10528 }
10529
10531 {
10532 int liquidtype = Math.Round(floats.Get(index));
10534 index++;
10535 }
10536
10538 {
10540 index++;
10542 index++;
10544 index++;
10546 index++;
10547 }
10548
10550 {
10551 int cleanness = Math.Round(floats.Get(index));
10553 index++;
10554 }
10555 }
10556
10558 {
10559 super.WriteVarsToCTX(ctx);
10560
10561
10563 {
10565 }
10566
10568 {
10570 }
10571
10573 {
10575 }
10576
10578 {
10579 int r,g,b,a;
10585 }
10586
10588 {
10590 }
10591 }
10592
10594 {
10595 if (!super.ReadVarsFromCTX(ctx,version))
10596 return false;
10597
10598 int intValue;
10599 float value;
10600
10601 if (version < 140)
10602 {
10603 if (!ctx.
Read(intValue))
10604 return false;
10605
10606 m_VariablesMask = intValue;
10607 }
10608
10610 {
10611 if (!ctx.
Read(value))
10612 return false;
10613
10615 {
10617 }
10618 else
10619 {
10621 }
10622 }
10623
10624 if (version < 140)
10625 {
10627 {
10628 if (!ctx.
Read(value))
10629 return false;
10630 SetTemperatureDirect(value);
10631 }
10632 }
10633
10635 {
10636 if (!ctx.
Read(value))
10637 return false;
10639 }
10640
10642 {
10643 if (!ctx.
Read(intValue))
10644 return false;
10646 }
10647
10649 {
10650 int r,g,b,a;
10652 return false;
10654 return false;
10656 return false;
10658 return false;
10659
10661 }
10662
10664 {
10665 if (!ctx.
Read(intValue))
10666 return false;
10668 }
10669
10670 if (version >= 138 && version < 140)
10671 {
10673 {
10674 if (!ctx.
Read(intValue))
10675 return false;
10676 SetFrozen(intValue);
10677 }
10678 }
10679
10680 return true;
10681 }
10682
10683
10685 {
10688 {
10690 }
10691
10692 if (!super.OnStoreLoad(ctx, version))
10693 {
10695 return false;
10696 }
10697
10698 if (version >= 114)
10699 {
10700 bool hasQuickBarIndexSaved;
10701
10702 if (!ctx.
Read(hasQuickBarIndexSaved))
10703 {
10705 return false;
10706 }
10707
10708 if (hasQuickBarIndexSaved)
10709 {
10710 int itmQBIndex;
10711
10712
10713 if (!ctx.
Read(itmQBIndex))
10714 {
10716 return false;
10717 }
10718
10719 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10720 if (itmQBIndex != -1 && parentPlayer)
10721 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10722 }
10723 }
10724 else
10725 {
10726
10727 PlayerBase player;
10728 int itemQBIndex;
10729 if (version ==
int.
MAX)
10730 {
10731 if (!ctx.
Read(itemQBIndex))
10732 {
10734 return false;
10735 }
10736 }
10737 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10738 {
10739
10740 if (!ctx.
Read(itemQBIndex))
10741 {
10743 return false;
10744 }
10745 if (itemQBIndex != -1 && player)
10746 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10747 }
10748 }
10749
10750 if (version < 140)
10751 {
10752
10753 if (!LoadVariables(ctx, version))
10754 {
10756 return false;
10757 }
10758 }
10759
10760
10762 {
10764 return false;
10765 }
10766 if (version >= 132)
10767 {
10769 if (raib)
10770 {
10772 {
10774 return false;
10775 }
10776 }
10777 }
10778
10780 return true;
10781 }
10782
10783
10784
10786 {
10787 super.OnStoreSave(ctx);
10788
10789 PlayerBase player;
10790 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10791 {
10793
10794 int itemQBIndex = -1;
10795 itemQBIndex = player.FindQuickBarEntityIndex(this);
10796 ctx.
Write(itemQBIndex);
10797 }
10798 else
10799 {
10801 }
10802
10804
10806 if (raib)
10807 {
10809 }
10810 }
10811
10812
10814 {
10815 super.AfterStoreLoad();
10816
10818 {
10820 }
10821
10823 {
10826 }
10827 }
10828
10830 {
10831 super.EEOnAfterLoad();
10832
10834 {
10836 }
10837
10840 }
10841
10843 {
10844 return false;
10845 }
10846
10847
10848
10850 {
10852 {
10853 #ifdef PLATFORM_CONSOLE
10854
10856 {
10858 if (menu)
10859 {
10861 }
10862 }
10863 #endif
10864 }
10865
10867 {
10870 }
10871
10873 {
10874 SetWeightDirty();
10876 }
10878 {
10881 }
10882
10884 {
10887 }
10889 {
10892 }
10893
10894 super.OnVariablesSynchronized();
10895 }
10896
10897
10898
10900 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10901 {
10902 if (!IsServerCheck(allow_client))
10903 return false;
10904
10906 return false;
10907
10910
10911 if (value <= (min + 0.001))
10912 value = min;
10913
10914 if (value == min)
10915 {
10916 if (destroy_config)
10917 {
10918 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10919 if (dstr)
10920 {
10922 this.Delete();
10923 return true;
10924 }
10925 }
10926 else if (destroy_forced)
10927 {
10929 this.Delete();
10930 return true;
10931 }
10932
10934 }
10935
10938
10940 {
10942
10943 if (delta)
10945 }
10946
10948
10949 return false;
10950 }
10951
10952
10954 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10955 {
10957 }
10958
10960 {
10963 }
10964
10966 {
10969 }
10970
10973 {
10974 float value_clamped = Math.Clamp(value, 0, 1);
10976 SetQuantity(result, destroy_config, destroy_forced);
10977 }
10978
10979
10982 {
10984 }
10985
10987 {
10989 }
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11001 {
11002 int slot = -1;
11003 if (GetInventory())
11004 {
11005 InventoryLocation il = new InventoryLocation;
11006 GetInventory().GetCurrentInventoryLocation(il);
11008 }
11009
11011 }
11012
11014 {
11015 float quantity_max = 0;
11016
11018 {
11019 if (attSlotID != -1)
11020 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11021
11022 if (quantity_max <= 0)
11024 }
11025
11026 if (quantity_max <= 0)
11028
11029 return quantity_max;
11030 }
11031
11033 {
11035 }
11036
11038 {
11040 }
11041
11042
11044 {
11046 }
11047
11049 {
11051 }
11052
11054 {
11056 }
11057
11058
11060 {
11061
11062 float weightEx = GetWeightEx();
11063 float special = GetInventoryAndCargoWeight();
11064 return weightEx - special;
11065 }
11066
11067
11069 {
11071 }
11072
11074 {
11076 {
11077 #ifdef DEVELOPER
11078 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11079 {
11080 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11082 }
11083 #endif
11084
11085 return GetQuantity() * GetConfigWeightModified();
11086 }
11087 else if (HasEnergyManager())
11088 {
11089 #ifdef DEVELOPER
11090 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11091 {
11092 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11093 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11094 }
11095 #endif
11096 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11097 }
11098 else
11099 {
11100 #ifdef DEVELOPER
11101 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11102 {
11103 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11104 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11105 }
11106 #endif
11107 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11108 }
11109 }
11110
11113 {
11114 int item_count = 0;
11116
11117 if (GetInventory().GetCargo() != NULL)
11118 {
11119 item_count = GetInventory().GetCargo().GetItemCount();
11120 }
11121
11122 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11123 {
11124 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11125 if (item)
11126 item_count += item.GetNumberOfItems();
11127 }
11128 return item_count;
11129 }
11130
11133 {
11134 float weight = 0;
11135 float wetness = 1;
11136 if (include_wetness)
11139 {
11140 weight = wetness * m_ConfigWeight;
11141 }
11143 {
11144 weight = 1;
11145 }
11146 return weight;
11147 }
11148
11149
11150
11152 {
11153 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11154 {
11155 GameInventory inv = GetInventory();
11156 array<EntityAI> items = new array<EntityAI>;
11158 for (int i = 0; i < items.Count(); i++)
11159 {
11161 if (item)
11162 {
11164 }
11165 }
11166 }
11167 }
11168
11169
11170
11171
11173 {
11174 float energy = 0;
11175 if (HasEnergyManager())
11176 {
11177 energy = GetCompEM().GetEnergy();
11178 }
11179 return energy;
11180 }
11181
11182
11184 {
11185 super.OnEnergyConsumed();
11186
11188 }
11189
11191 {
11192 super.OnEnergyAdded();
11193
11195 }
11196
11197
11199 {
11200 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11201 {
11203 {
11204 float energy_0to1 = GetCompEM().GetEnergy0To1();
11206 }
11207 }
11208 }
11209
11210
11212 {
11213 return ConfigGetFloat("heatIsolation");
11214 }
11215
11217 {
11219 }
11220
11222 {
11223 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11224 if (
GetGame().ConfigIsExisting(paramPath))
11226
11227 return 0.0;
11228 }
11229
11231 {
11232 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11233 if (
GetGame().ConfigIsExisting(paramPath))
11235
11236 return 0.0;
11237 }
11238
11239 override void SetWet(
float value,
bool allow_client =
false)
11240 {
11241 if (!IsServerCheck(allow_client))
11242 return;
11243
11246
11248
11249 m_VarWet = Math.Clamp(value, min, max);
11250
11252 {
11255 }
11256 }
11257
11258 override void AddWet(
float value)
11259 {
11261 }
11262
11264 {
11266 }
11267
11269 {
11271 }
11272
11274 {
11276 }
11277
11279 {
11281 }
11282
11284 {
11286 }
11287
11288 override void OnWetChanged(
float newVal,
float oldVal)
11289 {
11292 if (newLevel != oldLevel)
11293 {
11295 }
11296 }
11297
11299 {
11300 SetWeightDirty();
11301 }
11302
11304 {
11305 return GetWetLevelInternal(
m_VarWet);
11306 }
11307
11308
11309
11311 {
11313 }
11314
11316 {
11318 }
11319
11321 {
11323 }
11324
11326 {
11328 }
11329
11330
11331
11333 {
11334 if (ConfigIsExisting("itemModelLength"))
11335 {
11336 return ConfigGetFloat("itemModelLength");
11337 }
11338 return 0;
11339 }
11340
11342 {
11343 if (ConfigIsExisting("itemAttachOffset"))
11344 {
11345 return ConfigGetFloat("itemAttachOffset");
11346 }
11347 return 0;
11348 }
11349
11350 override void SetCleanness(
int value,
bool allow_client =
false)
11351 {
11352 if (!IsServerCheck(allow_client))
11353 return;
11354
11356
11358
11361 }
11362
11364 {
11366 }
11367
11369 {
11370 return true;
11371 }
11372
11373
11374
11375
11377 {
11379 }
11380
11382 {
11384 }
11385
11386
11387
11388
11389 override void SetColor(
int r,
int g,
int b,
int a)
11390 {
11396 }
11398 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11399 {
11404 }
11405
11407 {
11409 }
11410
11413 {
11414 int r,g,b,a;
11416 r = r/255;
11417 g = g/255;
11418 b = b/255;
11419 a = a/255;
11420 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11421 }
11422
11423
11424
11425 override void SetLiquidType(
int value,
bool allow_client =
false)
11426 {
11427 if (!IsServerCheck(allow_client))
11428 return;
11429
11434 }
11435
11437 {
11438 return ConfigGetInt("varLiquidTypeInit");
11439 }
11440
11442 {
11444 }
11445
11447 {
11449 SetFrozen(false);
11450 }
11451
11454 {
11455 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11456 }
11457
11458
11461 {
11462 PlayerBase nplayer;
11463 if (PlayerBase.CastTo(nplayer, player))
11464 {
11466
11467 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11468 }
11469 }
11470
11471
11474 {
11475 PlayerBase nplayer;
11476 if (PlayerBase.CastTo(nplayer,player))
11477 {
11478
11479 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11480
11481 }
11482
11483
11484 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11485
11486
11487 if (HasEnergyManager())
11488 {
11489 GetCompEM().UpdatePlugState();
11490 }
11491 }
11492
11493
11495 {
11496 super.OnPlacementStarted(player);
11497
11499 }
11500
11501 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11502 {
11504 {
11505 m_AdminLog.OnPlacementComplete(player,
this);
11506 }
11507
11508 super.OnPlacementComplete(player, position, orientation);
11509 }
11510
11511
11512
11513
11514
11516 {
11518 {
11519 return true;
11520 }
11521 else
11522 {
11523 return false;
11524 }
11525 }
11526
11527
11529 {
11531 {
11533 }
11534 }
11535
11536
11538 {
11540 }
11541
11543 {
11545 }
11546
11547 override void InsertAgent(
int agent,
float count = 1)
11548 {
11549 if (count < 1)
11550 return;
11551
11553 }
11554
11557 {
11559 }
11560
11561
11563 {
11565 }
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11609 {
11611 return false;
11612 return true;
11613 }
11614
11616 {
11617
11619 }
11620
11621
11624 {
11625 super.CheckForRoofLimited(timeTresholdMS);
11626
11628 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11629 {
11630 m_PreviousRoofTestTime = time;
11631 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11632 }
11633 }
11634
11635
11637 {
11639 {
11640 return 0;
11641 }
11642
11643 if (GetInventory().GetAttachmentSlotsCount() != 0)
11644 {
11645 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11646 if (filter)
11647 return filter.GetProtectionLevel(type, false, system);
11648 else
11649 return 0;
11650 }
11651
11652 string subclassPath, entryName;
11653
11654 switch (type)
11655 {
11657 entryName = "biological";
11658 break;
11660 entryName = "chemical";
11661 break;
11662 default:
11663 entryName = "biological";
11664 break;
11665 }
11666
11667 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11668
11670 }
11671
11672
11673
11676 {
11677 if (!IsMagazine())
11679
11681 }
11682
11683
11684
11685
11686
11691 {
11692 return true;
11693 }
11694
11696 {
11698 }
11699
11700
11701
11702
11703
11705 {
11706 if (parent)
11707 {
11708 if (parent.IsInherited(DayZInfected))
11709 return true;
11710
11711 if (!parent.IsRuined())
11712 return true;
11713 }
11714
11715 return true;
11716 }
11717
11719 {
11720 if (!super.CanPutAsAttachment(parent))
11721 {
11722 return false;
11723 }
11724
11725 if (!IsRuined() && !parent.IsRuined())
11726 {
11727 return true;
11728 }
11729
11730 return false;
11731 }
11732
11734 {
11735
11736
11737
11738
11739 return super.CanReceiveItemIntoCargo(item);
11740 }
11741
11743 {
11744
11745
11746
11747
11748 GameInventory attachmentInv = attachment.GetInventory();
11750 {
11751 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11752 return false;
11753 }
11754
11755 InventoryLocation loc = new InventoryLocation();
11756 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11757 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11758 return false;
11759
11760 return super.CanReceiveAttachment(attachment, slotId);
11761 }
11762
11764 {
11765 if (!super.CanReleaseAttachment(attachment))
11766 return false;
11767
11768 return GetInventory().AreChildrenAccessible();
11769 }
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11792 {
11793 int id = muzzle_owner.GetMuzzleID();
11794 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11795
11796 if (WPOF_array)
11797 {
11798 for (int i = 0; i < WPOF_array.Count(); i++)
11799 {
11800 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11801
11802 if (WPOF)
11803 {
11804 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11805 }
11806 }
11807 }
11808 }
11809
11810
11812 {
11813 int id = muzzle_owner.GetMuzzleID();
11815
11816 if (WPOBE_array)
11817 {
11818 for (int i = 0; i < WPOBE_array.Count(); i++)
11819 {
11820 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11821
11822 if (WPOBE)
11823 {
11824 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11825 }
11826 }
11827 }
11828 }
11829
11830
11832 {
11833 int id = muzzle_owner.GetMuzzleID();
11834 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11835
11836 if (WPOOH_array)
11837 {
11838 for (int i = 0; i < WPOOH_array.Count(); i++)
11839 {
11840 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11841
11842 if (WPOOH)
11843 {
11844 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11845 }
11846 }
11847 }
11848 }
11849
11850
11852 {
11853 int id = muzzle_owner.GetMuzzleID();
11854 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11855
11856 if (WPOOH_array)
11857 {
11858 for (int i = 0; i < WPOOH_array.Count(); i++)
11859 {
11860 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11861
11862 if (WPOOH)
11863 {
11864 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11865 }
11866 }
11867 }
11868 }
11869
11870
11872 {
11873 int id = muzzle_owner.GetMuzzleID();
11874 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11875
11876 if (WPOOH_array)
11877 {
11878 for (int i = 0; i < WPOOH_array.Count(); i++)
11879 {
11880 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11881
11882 if (WPOOH)
11883 {
11884 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11885 }
11886 }
11887 }
11888 }
11889
11890
11891
11893 {
11895 {
11896 return true;
11897 }
11898
11899 return false;
11900 }
11901
11903 {
11905 {
11906 return true;
11907 }
11908
11909 return false;
11910 }
11911
11913 {
11915 {
11916 return true;
11917 }
11918
11919 return false;
11920 }
11921
11923 {
11924 return false;
11925 }
11926
11929 {
11930 return UATimeSpent.DEFAULT_DEPLOY;
11931 }
11932
11933
11934
11935
11937 {
11939 SetSynchDirty();
11940 }
11941
11943 {
11945 }
11946
11947
11949 {
11950 return false;
11951 }
11952
11955 {
11956 string att_type = "None";
11957
11958 if (ConfigIsExisting("soundAttType"))
11959 {
11960 att_type = ConfigGetString("soundAttType");
11961 }
11962
11964 }
11965
11967 {
11969 }
11970
11971
11972
11973
11974
11978
11980 {
11983
11985 }
11986
11987
11989 {
11991 return;
11992
11994
11997
12000
12001 SoundParameters params = new SoundParameters();
12005 }
12006
12007
12009 {
12011 return;
12012
12014 SetSynchDirty();
12015
12018 }
12019
12020
12022 {
12024 return;
12025
12027 SetSynchDirty();
12028
12031 }
12032
12034 {
12036 }
12037
12039 {
12041 }
12042
12045 {
12046 if (!
GetGame().IsDedicatedServer())
12047 {
12048 if (ConfigIsExisting("attachSoundSet"))
12049 {
12050 string cfg_path = "";
12051 string soundset = "";
12052 string type_name =
GetType();
12053
12056 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12057 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12058
12059 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12060 {
12061 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12062 {
12063 if (cfg_slot_array[i] == slot_type)
12064 {
12065 soundset = cfg_soundset_array[i];
12066 break;
12067 }
12068 }
12069 }
12070
12071 if (soundset != "")
12072 {
12073 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12075 }
12076 }
12077 }
12078 }
12079
12081 {
12082
12083 }
12084
12085 void OnApply(PlayerBase player);
12086
12088 {
12089 return 1.0;
12090 };
12091
12093 {
12095 }
12096
12098 {
12100 }
12101
12103
12105 {
12106 SetDynamicPhysicsLifeTime(0.01);
12108 }
12109
12111 {
12112 array<string> zone_names = new array<string>;
12113 GetDamageZones(zone_names);
12114 for (int i = 0; i < zone_names.Count(); i++)
12115 {
12116 SetHealthMax(zone_names.Get(i),"Health");
12117 }
12118 SetHealthMax("","Health");
12119 }
12120
12123 {
12124 float global_health = GetHealth01("","Health");
12125 array<string> zones = new array<string>;
12126 GetDamageZones(zones);
12127
12128 for (int i = 0; i < zones.Count(); i++)
12129 {
12130 SetHealth01(zones.Get(i),"Health",global_health);
12131 }
12132 }
12133
12136 {
12137 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12138 }
12139
12141 {
12142 if (!hasRootAsPlayer)
12143 {
12144 if (refParentIB)
12145 {
12146
12147 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12148 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12149
12150 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12151 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12152
12155 }
12156 else
12157 {
12158
12161 }
12162 }
12163 }
12164
12166 {
12168 {
12169 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12170 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12171 {
12172 float heatPermCoef = 1.0;
12174 while (ent)
12175 {
12176 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12177 ent = ent.GetHierarchyParent();
12178 }
12179
12180 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12181 }
12182 }
12183 }
12184
12186 {
12187
12188 EntityAI parent = GetHierarchyParent();
12189 if (!parent)
12190 {
12191 hasParent = false;
12192 hasRootAsPlayer = false;
12193 }
12194 else
12195 {
12196 hasParent = true;
12197 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12198 refParentIB =
ItemBase.Cast(parent);
12199 }
12200 }
12201
12202 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12203 {
12204
12205 }
12206
12208 {
12209
12210 return false;
12211 }
12212
12214 {
12215
12216
12217 return false;
12218 }
12219
12221 {
12222
12223 return false;
12224 }
12225
12228 {
12229 return !GetIsFrozen() &&
IsOpen();
12230 }
12231
12233 {
12234 bool hasParent = false, hasRootAsPlayer = false;
12236
12237 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12238 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12239
12240 if (wwtu || foodDecay)
12241 {
12245
12246 if (processWetness || processTemperature || processDecay)
12247 {
12249
12250 if (processWetness)
12251 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12252
12253 if (processTemperature)
12255
12256 if (processDecay)
12257 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12258 }
12259 }
12260 }
12261
12264 {
12266 }
12267
12269 {
12272
12273 return super.GetTemperatureFreezeThreshold();
12274 }
12275
12277 {
12280
12281 return super.GetTemperatureThawThreshold();
12282 }
12283
12285 {
12288
12289 return super.GetItemOverheatThreshold();
12290 }
12291
12293 {
12295 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12296
12297 return super.GetTemperatureFreezeTime();
12298 }
12299
12301 {
12303 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12304
12305 return super.GetTemperatureThawTime();
12306 }
12307
12312
12314 {
12315 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12316 }
12317
12319 {
12320 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12321 }
12322
12325 {
12327 }
12328
12330 {
12332 }
12333
12335 {
12337 }
12338
12341 {
12342 return null;
12343 }
12344
12347 {
12348 return false;
12349 }
12350
12352 {
12354 {
12357 if (!trg)
12358 {
12360 explosive = this;
12361 }
12362
12363 explosive.PairRemote(trg);
12365
12366 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12367 trg.SetPersistentPairID(persistentID);
12368 explosive.SetPersistentPairID(persistentID);
12369
12370 return true;
12371 }
12372 return false;
12373 }
12374
12377 {
12378 float ret = 1.0;
12381 ret *= GetHealth01();
12382
12383 return ret;
12384 }
12385
12386 #ifdef DEVELOPER
12387 override void SetDebugItem()
12388 {
12389 super.SetDebugItem();
12390 _itemBase = this;
12391 }
12392
12394 {
12395 string text = super.GetDebugText();
12396
12398 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12399
12400 return text;
12401 }
12402 #endif
12403
12405 {
12406 return true;
12407 }
12408
12410
12412
12414 {
12417 }
12418
12419
12427
12443}
12444
12446{
12448 if (entity)
12449 {
12450 bool is_item = entity.IsInherited(
ItemBase);
12451 if (is_item && full_quantity)
12452 {
12455 }
12456 }
12457 else
12458 {
12460 return NULL;
12461 }
12462 return entity;
12463}
12464
12466{
12467 if (item)
12468 {
12469 if (health > 0)
12470 item.SetHealth("", "", health);
12471
12472 if (item.CanHaveTemperature())
12473 {
12475 if (item.CanFreeze())
12476 item.SetFrozen(false);
12477 }
12478
12479 if (item.HasEnergyManager())
12480 {
12481 if (quantity >= 0)
12482 {
12483 item.GetCompEM().SetEnergy0To1(quantity);
12484 }
12485 else
12486 {
12488 }
12489 }
12490 else if (item.IsMagazine())
12491 {
12492 Magazine mag = Magazine.Cast(item);
12493 if (quantity >= 0)
12494 {
12495 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12496 }
12497 else
12498 {
12500 }
12501
12502 }
12503 else
12504 {
12505 if (quantity >= 0)
12506 {
12507 item.SetQuantityNormalized(quantity, false);
12508 }
12509 else
12510 {
12512 }
12513
12514 }
12515 }
12516}
12517
12518#ifdef DEVELOPER
12520#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.