7572{
7574 {
7575 return true;
7576 }
7577};
7578
7579
7580
7582{
7586
7588
7591
7592
7593
7594
7595
7604
7610
7615
7620
7641 protected bool m_IsResultOfSplit
7642
7644
7649
7650
7651
7653
7657
7658
7659
7661
7664
7665
7666
7672
7673
7681
7684
7685
7687
7688
7690
7691
7696
7697
7702
7703
7705
7706
7708 {
7713
7714 if (!
GetGame().IsDedicatedServer())
7715 {
7717 {
7719
7721 {
7723 }
7724 }
7725
7728 }
7729
7730 m_OldLocation = null;
7731
7733 {
7735 }
7736
7737 if (ConfigIsExisting("headSelectionsToHide"))
7738 {
7741 }
7742
7744 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7745 {
7747 }
7748
7750
7751 m_IsResultOfSplit = false;
7752
7754 }
7755
7757 {
7758 super.InitItemVariables();
7759
7765 m_Count = ConfigGetInt(
"count");
7766
7769
7774
7777
7782
7794
7798
7799
7802 if (ConfigIsExisting("canBeSplit"))
7803 {
7806 }
7807
7809 if (ConfigIsExisting("itemBehaviour"))
7811
7812
7815 RegisterNetSyncVariableInt("m_VarLiquidType");
7816 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7817
7818 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7819 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7820 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7821
7822 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7823 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7824 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7825 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7826
7827 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7828 RegisterNetSyncVariableBool("m_IsTakeable");
7829 RegisterNetSyncVariableBool("m_IsHologram");
7830
7833 {
7836 }
7837
7839
7841 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7843
7844 }
7845
7847 {
7849 }
7850
7852 {
7855 {
7860 }
7861 }
7862
7863 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7864 {
7866 {
7869 }
7870
7872 }
7873
7875 {
7881 }
7882
7884
7886 {
7888
7889 if (!action)
7890 {
7891 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7892 return;
7893 }
7894
7896 if (!ai)
7897 {
7899 return;
7900 }
7901
7903 if (!action_array)
7904 {
7905 action_array = new array<ActionBase_Basic>;
7907 }
7908 if (LogManager.IsActionLogEnable())
7909 {
7910 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7911 }
7912
7913 if (action_array.Find(action) != -1)
7914 {
7915 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7916 }
7917 else
7918 {
7919 action_array.Insert(action);
7920 }
7921 }
7922
7924 {
7926 ActionBase action = player.GetActionManager().GetAction(actionName);
7929
7930 if (action_array)
7931 {
7932 action_array.RemoveItem(action);
7933 }
7934 }
7935
7936
7937
7939 {
7940 ActionOverrideData overrideData = new ActionOverrideData();
7944
7946 if (!actionMap)
7947 {
7950 }
7951
7952 actionMap.Insert(this.
Type(), overrideData);
7953
7954 }
7955
7957
7959
7960
7962 {
7965
7968
7969 string config_to_search = "CfgVehicles";
7970 string muzzle_owner_config;
7971
7973 {
7974 if (IsInherited(Weapon))
7975 config_to_search = "CfgWeapons";
7976
7977 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7978
7979 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7980
7982
7983 if (config_OnFire_subclass_count > 0)
7984 {
7985 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7986
7987 for (int i = 0; i < config_OnFire_subclass_count; i++)
7988 {
7989 string particle_class = "";
7991 string config_OnFire_entry = config_OnFire_class + particle_class;
7992 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7993 WPOF_array.Insert(WPOF);
7994 }
7995
7996
7998 }
7999 }
8000
8002 {
8003 config_to_search = "CfgWeapons";
8004 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8005
8006 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8007
8009
8010 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8011 {
8012 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8013
8014 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8015 {
8016 string particle_class2 = "";
8018 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8019 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8020 WPOBE_array.Insert(WPOBE);
8021 }
8022
8023
8025 }
8026 }
8027 }
8028
8029
8031 {
8034
8036 {
8037 string config_to_search = "CfgVehicles";
8038
8039 if (IsInherited(Weapon))
8040 config_to_search = "CfgWeapons";
8041
8042 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8043 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8044
8045 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8046 {
8047
8049
8051 {
8053 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8055 return;
8056 }
8057
8060
8061
8062
8064 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8065
8066 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8067 {
8068 string particle_class = "";
8070 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8072
8073 if (entry_type == CT_CLASS)
8074 {
8075 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8076 WPOOH_array.Insert(WPOF);
8077 }
8078 }
8079
8080
8082 }
8083 }
8084 }
8085
8087 {
8089 }
8090
8092 {
8094 {
8096
8099
8102
8103 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8104 }
8105 }
8106
8108 {
8110 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8111
8113 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8114
8116 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8117
8119 {
8121 }
8122 }
8123
8125 {
8127 }
8128
8130 {
8133 else
8135
8137 {
8140 }
8141 else
8142 {
8145
8148 }
8149
8151 }
8152
8154 {
8156 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8157 }
8158
8160 {
8162 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8164 }
8165
8167 {
8169 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8170 }
8171
8173 {
8176
8177 OverheatingParticle OP = new OverheatingParticle();
8182
8184 }
8185
8187 {
8190
8191 return -1;
8192 }
8193
8195 {
8197 {
8200
8201 for (int i = count; i > 0; --i)
8202 {
8203 int id = i - 1;
8206
8209
8210 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8211 {
8212 if (p)
8213 {
8216 }
8217 }
8218 }
8219 }
8220 }
8221
8223 {
8225 {
8227 {
8228 int id = i - 1;
8230
8231 if (OP)
8232 {
8234
8235 if (p)
8236 {
8238 }
8239
8240 delete OP;
8241 }
8242 }
8243
8246 }
8247 }
8248
8251 {
8252 return 0.0;
8253 }
8254
8255
8257 {
8258 return 250;
8259 }
8260
8262 {
8263 return 0;
8264 }
8265
8268 {
8270 return true;
8271
8272 return false;
8273 }
8274
8277 {
8280
8282 {
8284 }
8285 else
8286 {
8287
8289 }
8290
8292 }
8293
8300 {
8301 return -1;
8302 }
8303
8304
8305
8306
8308 {
8310 {
8312 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8313
8314 if (r_index >= 0)
8315 {
8316 InventoryLocation r_il = new InventoryLocation;
8317 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8318
8319 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8322 {
8323 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8324 }
8326 {
8327 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8328 }
8329
8330 }
8331
8332 player.GetHumanInventory().ClearUserReservedLocation(this);
8333 }
8334
8337 }
8338
8339
8340
8341
8343 {
8344 return ItemBase.m_DebugActionsMask;
8345 }
8346
8348 {
8349 return ItemBase.m_DebugActionsMask & mask;
8350 }
8351
8353 {
8354 ItemBase.m_DebugActionsMask = mask;
8355 }
8356
8358 {
8359 ItemBase.m_DebugActionsMask |= mask;
8360 }
8361
8363 {
8364 ItemBase.m_DebugActionsMask &= ~mask;
8365 }
8366
8368 {
8370 {
8372 }
8373 else
8374 {
8376 }
8377 }
8378
8379
8381 {
8382 if (GetEconomyProfile())
8383 {
8384 float q_max = GetEconomyProfile().GetQuantityMax();
8385 if (q_max > 0)
8386 {
8387 float q_min = GetEconomyProfile().GetQuantityMin();
8388 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8389
8391 {
8392 ComponentEnergyManager comp = GetCompEM();
8394 {
8396 }
8397 }
8399 {
8401
8402 }
8403
8404 }
8405 }
8406 }
8407
8410 {
8411 EntityAI parent = GetHierarchyParent();
8412
8413 if (parent)
8414 {
8415 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8416 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8417 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8418 }
8419 }
8420
8423 {
8424 EntityAI parent = GetHierarchyParent();
8425
8426 if (parent)
8427 {
8428 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8429 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8430 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8431 }
8432 }
8433
8435 {
8436
8437
8438
8439
8441
8443 {
8444 if (ScriptInputUserData.CanStoreInputUserData())
8445 {
8446 ScriptInputUserData ctx = new ScriptInputUserData;
8452 ctx.
Write(use_stack_max);
8455
8457 {
8458 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8459 }
8460 }
8461 }
8462 else if (!
GetGame().IsMultiplayer())
8463 {
8465 }
8466 }
8467
8469 {
8471 }
8472
8474 {
8476 }
8477
8479 {
8481 }
8482
8484 {
8485
8486 return false;
8487 }
8488
8490 {
8491 return false;
8492 }
8493
8497 {
8498 return false;
8499 }
8500
8502 {
8503 return "";
8504 }
8505
8507
8509 {
8510 return false;
8511 }
8512
8514 {
8515 return true;
8516 }
8517
8518
8519
8521 {
8522 return true;
8523 }
8524
8526 {
8527 return true;
8528 }
8529
8531 {
8532 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8534 }
8535
8537 {
8539 }
8540
8542 {
8544 if (!is_being_placed)
8546 SetSynchDirty();
8547 }
8548
8549
8551
8553 {
8555 }
8556
8558 {
8560 }
8561
8563 {
8564 return 1;
8565 }
8566
8568 {
8569 return false;
8570 }
8571
8573 {
8575 SetSynchDirty();
8576 }
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8613 {
8614 super.OnMovedInsideCargo(container);
8615
8616 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8617 }
8618
8619 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8620 {
8621 super.EEItemLocationChanged(oldLoc,newLoc);
8622
8623 PlayerBase new_player = null;
8624 PlayerBase old_player = null;
8625
8626 if (newLoc.GetParent())
8627 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8628
8629 if (oldLoc.GetParent())
8630 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8631
8633 {
8634 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8635
8636 if (r_index >= 0)
8637 {
8638 InventoryLocation r_il = new InventoryLocation;
8639 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8640
8641 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8644 {
8645 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8646 }
8648 {
8649 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8650 }
8651
8652 }
8653 }
8654
8656 {
8657 if (new_player)
8658 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8659
8660 if (new_player == old_player)
8661 {
8662
8663 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8664 {
8666 {
8667 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8668 {
8669 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8670 }
8671 }
8672 else
8673 {
8674 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8675 }
8676 }
8677
8678 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8679 {
8680 int type = oldLoc.GetType();
8682 {
8683 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8684 }
8686 {
8687 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8688 }
8689 }
8690 if (!m_OldLocation)
8691 {
8692 m_OldLocation = new InventoryLocation;
8693 }
8694 m_OldLocation.Copy(oldLoc);
8695 }
8696 else
8697 {
8698 if (m_OldLocation)
8699 {
8700 m_OldLocation.Reset();
8701 }
8702 }
8703
8705 }
8706 else
8707 {
8708 if (new_player)
8709 {
8710 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8711 if (res_index >= 0)
8712 {
8713 InventoryLocation il = new InventoryLocation;
8714 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8716 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8719 {
8720 il.
GetParent().GetOnReleaseLock().Invoke(it);
8721 }
8723 {
8725 }
8726
8727 }
8728 }
8730 {
8731
8733 }
8734
8735 if (m_OldLocation)
8736 {
8737 m_OldLocation.Reset();
8738 }
8739 }
8740 }
8741
8742 override void EOnContact(IEntity other, Contact extra)
8743 {
8745 {
8746 int liquidType = -1;
8748 if (impactSpeed > 0.0)
8749 {
8751 #ifndef SERVER
8753 #else
8755 SetSynchDirty();
8756 #endif
8758 }
8759 }
8760
8761 #ifdef SERVER
8762 if (GetCompEM() && GetCompEM().IsPlugged())
8763 {
8764 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8765 GetCompEM().UnplugThis();
8766 }
8767 #endif
8768 }
8769
8771
8773 {
8775 }
8776
8778 {
8779
8780 }
8781
8783 {
8784 super.OnItemLocationChanged(old_owner, new_owner);
8785
8786 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8787 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8788
8789 if (!relatedPlayer && playerNew)
8790 relatedPlayer = playerNew;
8791
8792 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8793 {
8795 if (actionMgr)
8796 {
8797 ActionBase currentAction = actionMgr.GetRunningAction();
8798 if (currentAction)
8800 }
8801 }
8802
8803 Man ownerPlayerOld = null;
8804 Man ownerPlayerNew = null;
8805
8806 if (old_owner)
8807 {
8808 if (old_owner.
IsMan())
8809 {
8810 ownerPlayerOld = Man.Cast(old_owner);
8811 }
8812 else
8813 {
8814 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8815 }
8816 }
8817 else
8818 {
8820 {
8822
8823 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8824 {
8825 GetCompEM().UnplugThis();
8826 }
8827 }
8828 }
8829
8830 if (new_owner)
8831 {
8832 if (new_owner.
IsMan())
8833 {
8834 ownerPlayerNew = Man.Cast(new_owner);
8835 }
8836 else
8837 {
8838 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8839 }
8840 }
8841
8842 if (ownerPlayerOld != ownerPlayerNew)
8843 {
8844 if (ownerPlayerOld)
8845 {
8846 array<EntityAI> subItemsExit = new array<EntityAI>;
8848 for (int i = 0; i < subItemsExit.Count(); i++)
8849 {
8852 }
8853 }
8854
8855 if (ownerPlayerNew)
8856 {
8857 array<EntityAI> subItemsEnter = new array<EntityAI>;
8859 for (int j = 0; j < subItemsEnter.Count(); j++)
8860 {
8863 }
8864 }
8865 }
8866 else if (ownerPlayerNew != null)
8867 {
8868 PlayerBase nplayer;
8869 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8870 {
8871 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8873 for (int k = 0; k < subItemsUpdate.Count(); k++)
8874 {
8876 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8877 }
8878 }
8879 }
8880
8881 if (old_owner)
8882 old_owner.OnChildItemRemoved(this);
8883 if (new_owner)
8884 new_owner.OnChildItemReceived(this);
8885 }
8886
8887
8889 {
8890 super.EEDelete(parent);
8891 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8892 if (player)
8893 {
8895
8896 if (player.IsAlive())
8897 {
8898 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8899 if (r_index >= 0)
8900 {
8901 InventoryLocation r_il = new InventoryLocation;
8902 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8903
8904 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8907 {
8908 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8909 }
8911 {
8912 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8913 }
8914
8915 }
8916
8917 player.RemoveQuickBarEntityShortcut(this);
8918 }
8919 }
8920 }
8921
8923 {
8924 super.EEKilled(killer);
8925
8928 {
8929 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8930 {
8931 if (IsMagazine())
8932 {
8933 if (Magazine.Cast(this).GetAmmoCount() > 0)
8934 {
8936 }
8937 }
8938 else
8939 {
8941 }
8942 }
8943 }
8944 }
8945
8947 {
8948 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8949
8950 super.OnWasAttached(parent, slot_id);
8951
8954
8956 }
8957
8959 {
8960 super.OnWasDetached(parent, slot_id);
8961
8964 }
8965
8967 {
8968 int idx;
8971
8972 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8973 if (inventory_slots.Count() < 1)
8974 {
8975 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8976 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8977 }
8978 else
8979 {
8980 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8981 }
8982
8983 idx = inventory_slots.Find(slot);
8984 if (idx < 0)
8985 return "";
8986
8987 return attach_types.Get(idx);
8988 }
8989
8991 {
8992 int idx = -1;
8993 string slot;
8994
8997
8998 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8999 if (inventory_slots.Count() < 1)
9000 {
9001 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9002 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9003 }
9004 else
9005 {
9006 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9007 if (detach_types.Count() < 1)
9008 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9009 }
9010
9011 for (int i = 0; i < inventory_slots.Count(); i++)
9012 {
9013 slot = inventory_slots.Get(i);
9014 }
9015
9016 if (slot != "")
9017 {
9018 if (detach_types.Count() == 1)
9019 idx = 0;
9020 else
9021 idx = inventory_slots.Find(slot);
9022 }
9023 if (idx < 0)
9024 return "";
9025
9026 return detach_types.Get(idx);
9027 }
9028
9030 {
9031
9033
9034
9035 float min_time = 1;
9036 float max_time = 3;
9037 float delay = Math.RandomFloat(min_time, max_time);
9038
9039 explode_timer.Run(delay, this, "DoAmmoExplosion");
9040 }
9041
9043 {
9044 Magazine magazine = Magazine.Cast(this);
9045 int pop_sounds_count = 6;
9046 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9047
9048
9049 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9050 string sound_name = pop_sounds[ sound_idx ];
9052
9053
9054 magazine.ServerAddAmmoCount(-1);
9055
9056
9057 float min_temp_to_explode = 100;
9058
9059 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9060 {
9062 }
9063 }
9064
9065
9066 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9067 {
9068 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9069
9070 const int CHANCE_DAMAGE_CARGO = 4;
9071 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9072 const int CHANCE_DAMAGE_NOTHING = 2;
9073
9075 {
9076 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9077 int chances;
9078 int rnd;
9079
9080 if (GetInventory().GetCargo())
9081 {
9082 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9083 rnd = Math.RandomInt(0,chances);
9084
9085 if (rnd < CHANCE_DAMAGE_CARGO)
9086 {
9088 }
9089 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9090 {
9092 }
9093 }
9094 else
9095 {
9096 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9097 rnd = Math.RandomInt(0,chances);
9098
9099 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9100 {
9102 }
9103 }
9104 }
9105 }
9106
9108 {
9109 if (GetInventory().GetCargo())
9110 {
9111 int item_count = GetInventory().GetCargo().GetItemCount();
9112 if (item_count > 0)
9113 {
9114 int random_pick = Math.RandomInt(0, item_count);
9116 if (!item.IsExplosive())
9117 {
9118 item.AddHealth("","",damage);
9119 return true;
9120 }
9121 }
9122 }
9123 return false;
9124 }
9125
9127 {
9128 int attachment_count = GetInventory().AttachmentCount();
9129 if (attachment_count > 0)
9130 {
9131 int random_pick = Math.RandomInt(0, attachment_count);
9132 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9133 if (!attachment.IsExplosive())
9134 {
9135 attachment.AddHealth("","",damage);
9136 return true;
9137 }
9138 }
9139 return false;
9140 }
9141
9143 {
9145 }
9146
9148 {
9150 return GetInventory().CanRemoveEntity();
9151
9152 return false;
9153 }
9154
9156 {
9158 return;
9159
9161 {
9162 if (ScriptInputUserData.CanStoreInputUserData())
9163 {
9164 ScriptInputUserData ctx = new ScriptInputUserData;
9169 ctx.
Write(destination_entity);
9173 }
9174 }
9175 else if (!
GetGame().IsMultiplayer())
9176 {
9178 }
9179 }
9180
9182 {
9184 return;
9185
9186 float split_quantity_new;
9190 InventoryLocation loc = new InventoryLocation;
9191
9192 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9193 {
9195 split_quantity_new = stack_max;
9196 else
9198
9199 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9200 if (new_item)
9201 {
9202 new_item.SetResultOfSplit(true);
9203 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9205 new_item.SetQuantity(split_quantity_new);
9206 }
9207 }
9208 else if (destination_entity && slot_id == -1)
9209 {
9210 if (quantity > stack_max)
9211 split_quantity_new = stack_max;
9212 else
9213 split_quantity_new = quantity;
9214
9216 {
9219 }
9220
9221 if (new_item)
9222 {
9223 new_item.SetResultOfSplit(true);
9224 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9226 new_item.SetQuantity(split_quantity_new);
9227 }
9228 }
9229 else
9230 {
9231 if (stack_max != 0)
9232 {
9234 {
9236 }
9237
9238 if (split_quantity_new == 0)
9239 {
9240 if (!
GetGame().IsMultiplayer())
9241 player.PhysicalPredictiveDropItem(this);
9242 else
9243 player.ServerDropEntity(this);
9244 return;
9245 }
9246
9248
9249 if (new_item)
9250 {
9251 new_item.SetResultOfSplit(true);
9252 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9254 new_item.SetQuantity(stack_max);
9255 new_item.PlaceOnSurface();
9256 }
9257 }
9258 }
9259 }
9260
9262 {
9264 return;
9265
9266 float split_quantity_new;
9270 InventoryLocation loc = new InventoryLocation;
9271
9272 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9273 {
9275 split_quantity_new = stack_max;
9276 else
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);
9286 }
9287 }
9288 else if (destination_entity && slot_id == -1)
9289 {
9290 if (quantity > stack_max)
9291 split_quantity_new = stack_max;
9292 else
9293 split_quantity_new = quantity;
9294
9296 {
9299 }
9300
9301 if (new_item)
9302 {
9303 new_item.SetResultOfSplit(true);
9304 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9306 new_item.SetQuantity(split_quantity_new);
9307 }
9308 }
9309 else
9310 {
9311 if (stack_max != 0)
9312 {
9314 {
9316 }
9317
9319
9320 if (new_item)
9321 {
9322 new_item.SetResultOfSplit(true);
9323 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9325 new_item.SetQuantity(stack_max);
9326 new_item.PlaceOnSurface();
9327 }
9328 }
9329 }
9330 }
9331
9333 {
9335 return;
9336
9338 {
9339 if (ScriptInputUserData.CanStoreInputUserData())
9340 {
9341 ScriptInputUserData ctx = new ScriptInputUserData;
9346 dst.WriteToContext(ctx);
9348 }
9349 }
9350 else if (!
GetGame().IsMultiplayer())
9351 {
9353 }
9354 }
9355
9357 {
9359 return;
9360
9362 {
9363 if (ScriptInputUserData.CanStoreInputUserData())
9364 {
9365 ScriptInputUserData ctx = new ScriptInputUserData;
9370 ctx.
Write(destination_entity);
9376 }
9377 }
9378 else if (!
GetGame().IsMultiplayer())
9379 {
9381 }
9382 }
9383
9385 {
9387 }
9388
9390 {
9392 return this;
9393
9395 float split_quantity_new;
9397 if (dst.IsValid())
9398 {
9399 int slot_id = dst.GetSlot();
9401
9402 if (quantity > stack_max)
9403 split_quantity_new = stack_max;
9404 else
9405 split_quantity_new = quantity;
9406
9408
9409 if (new_item)
9410 {
9411 new_item.SetResultOfSplit(true);
9412 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9415 }
9416
9417 return new_item;
9418 }
9419
9420 return null;
9421 }
9422
9424 {
9426 return;
9427
9429 float split_quantity_new;
9431 if (destination_entity)
9432 {
9434 if (quantity > stackable)
9435 split_quantity_new = stackable;
9436 else
9437 split_quantity_new = quantity;
9438
9439 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9440 if (new_item)
9441 {
9442 new_item.SetResultOfSplit(true);
9443 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9445 new_item.SetQuantity(split_quantity_new);
9446 }
9447 }
9448 }
9449
9451 {
9453 return;
9454
9456 {
9457 if (ScriptInputUserData.CanStoreInputUserData())
9458 {
9459 ScriptInputUserData ctx = new ScriptInputUserData;
9464 ItemBase destination_entity =
this;
9465 ctx.
Write(destination_entity);
9469 }
9470 }
9471 else if (!
GetGame().IsMultiplayer())
9472 {
9474 }
9475 }
9476
9478 {
9480 return;
9481
9483 float split_quantity_new;
9485 if (player)
9486 {
9488 if (quantity > stackable)
9489 split_quantity_new = stackable;
9490 else
9491 split_quantity_new = quantity;
9492
9493 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9494 new_item =
ItemBase.Cast(in_hands);
9495 if (new_item)
9496 {
9497 new_item.SetResultOfSplit(true);
9498 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9500 new_item.SetQuantity(split_quantity_new);
9501 }
9502 }
9503 }
9504
9506 {
9508 return;
9509
9511 float split_quantity_new = Math.Floor(quantity * 0.5);
9512
9514
9515 if (new_item)
9516 {
9517 if (new_item.GetQuantityMax() < split_quantity_new)
9518 {
9519 split_quantity_new = new_item.GetQuantityMax();
9520 }
9521
9522 new_item.SetResultOfSplit(true);
9523 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9524
9526 {
9529 }
9530 else
9531 {
9534 }
9535 }
9536 }
9537
9539 {
9541 return;
9542
9544 float split_quantity_new = Math.Floor(quantity / 2);
9545
9546 InventoryLocation invloc = new InventoryLocation;
9548
9550 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9551
9552 if (new_item)
9553 {
9554 if (new_item.GetQuantityMax() < split_quantity_new)
9555 {
9556 split_quantity_new = new_item.GetQuantityMax();
9557 }
9559 {
9562 }
9563 else
9564 {
9567 }
9568 }
9569 }
9570
9573 {
9574 SetWeightDirty();
9576
9577 if (parent)
9578 parent.OnAttachmentQuantityChangedEx(this, delta);
9579
9581 {
9583 {
9585 }
9587 {
9588 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9590 }
9591 }
9592
9593 }
9594
9597 {
9598
9599 }
9600
9603 {
9605 }
9606
9608 {
9609 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9610
9612 {
9613 if (newLevel == GameConstants.STATE_RUINED)
9614 {
9616 EntityAI parent = GetHierarchyParent();
9617 if (parent && parent.IsFireplace())
9618 {
9619 CargoBase cargo = GetInventory().GetCargo();
9620 if (cargo)
9621 {
9623 {
9625 }
9626 }
9627 }
9628 }
9629
9631 {
9632
9634 return;
9635 }
9636
9637 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9638 {
9640 }
9641 }
9642 }
9643
9644
9646 {
9647 super.OnRightClick();
9648
9650 {
9652 {
9653 if (ScriptInputUserData.CanStoreInputUserData())
9654 {
9655 vector m4[4];
9657
9658 EntityAI root = GetHierarchyRoot();
9659
9660 InventoryLocation dst = new InventoryLocation;
9662 {
9663 if (root)
9664 {
9665 root.GetTransform(m4);
9667 }
9668 else
9669 GetInventory().GetCurrentInventoryLocation(dst);
9670 }
9671 else
9672 {
9674
9675
9676 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9677 {
9678 if (root)
9679 {
9680 root.GetTransform(m4);
9682 }
9683 else
9684 GetInventory().GetCurrentInventoryLocation(dst);
9685 }
9686 else
9687 {
9688 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9689 }
9690 }
9691
9692 ScriptInputUserData ctx = new ScriptInputUserData;
9700 }
9701 }
9702 else if (!
GetGame().IsMultiplayer())
9703 {
9705 }
9706 }
9707 }
9708
9709 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9710 {
9711
9712 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9713 return false;
9714
9715 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9716 return false;
9717
9718
9720 return false;
9721
9722
9723 Magazine mag = Magazine.Cast(this);
9724 if (mag)
9725 {
9726 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9727 return false;
9728
9729 if (stack_max_limit)
9730 {
9731 Magazine other_mag = Magazine.Cast(other_item);
9732 if (other_item)
9733 {
9734 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9735 return false;
9736 }
9737
9738 }
9739 }
9740 else
9741 {
9742
9744 return false;
9745
9747 return false;
9748 }
9749
9750 PlayerBase player = null;
9751 if (CastTo(player, GetHierarchyRootPlayer()))
9752 {
9753 if (player.GetInventory().HasAttachment(this))
9754 return false;
9755
9756 if (player.IsItemsToDelete())
9757 return false;
9758 }
9759
9760 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9761 return false;
9762
9763 int slotID;
9765 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9766 return false;
9767
9768 return true;
9769 }
9770
9772 {
9774 }
9775
9777 {
9778 return m_IsResultOfSplit;
9779 }
9780
9782 {
9783 m_IsResultOfSplit = value;
9784 }
9785
9787 {
9789 }
9790
9792 {
9793 float other_item_quantity = other_item.GetQuantity();
9794 float this_free_space;
9795
9797
9799
9800 if (other_item_quantity > this_free_space)
9801 {
9802 return this_free_space;
9803 }
9804 else
9805 {
9806 return other_item_quantity;
9807 }
9808 }
9809
9811 {
9813 }
9814
9816 {
9818 return;
9819
9820 if (!IsMagazine() && other_item)
9821 {
9823 if (quantity_used != 0)
9824 {
9825 float hp1 = GetHealth01("","");
9826 float hp2 = other_item.GetHealth01("","");
9827 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9828 hpResult = hpResult / (
GetQuantity() + quantity_used);
9829
9830 hpResult *= GetMaxHealth();
9831 Math.Round(hpResult);
9832 SetHealth("", "Health", hpResult);
9833
9835 other_item.AddQuantity(-quantity_used);
9836 }
9837 }
9839 }
9840
9842 {
9843 #ifdef SERVER
9844 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9845 GetHierarchyParent().IncreaseLifetimeUp();
9846 #endif
9847 };
9848
9850 {
9851 PlayerBase p = PlayerBase.Cast(player);
9852
9853 array<int> recipesIds = p.m_Recipes;
9854 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9855 if (moduleRecipesManager)
9856 {
9857 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9858 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9859 }
9860
9861 for (int i = 0;i < recipesIds.Count(); i++)
9862 {
9863 int key = recipesIds.Get(i);
9864 string recipeName = moduleRecipesManager.GetRecipeName(key);
9866 }
9867 }
9868
9869
9870 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9871 {
9872 super.GetDebugActions(outputList);
9873
9874
9879
9880
9884
9888
9889
9892
9893
9895 {
9898 }
9899
9901
9904
9908 }
9909
9910
9911
9912
9914 {
9915 super.OnAction(action_id, player, ctx);
9916 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9917 {
9918 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9919 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9920 PlayerBase p = PlayerBase.Cast(player);
9921 if (
EActions.RECIPES_RANGE_START < 1000)
9922 {
9923 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9924 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9925 }
9926 }
9927 #ifndef SERVER
9928 else if (action_id ==
EActions.WATCH_PLAYER)
9929 {
9930 PluginDeveloper.SetDeveloperItemClientEx(player);
9931 }
9932 #endif
9934 {
9935 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9936 {
9937 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9938 OnDebugButtonPressServer(id + 1);
9939 }
9940
9941 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9942 {
9943 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9945 }
9946
9947 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9948 {
9949 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9951 }
9952
9953 else if (action_id ==
EActions.ADD_QUANTITY)
9954 {
9955 if (IsMagazine())
9956 {
9957 Magazine mag = Magazine.Cast(this);
9958 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9959 }
9960 else
9961 {
9963 }
9964
9965 if (m_EM)
9966 {
9967 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9968 }
9969
9970 }
9971
9972 else if (action_id ==
EActions.REMOVE_QUANTITY)
9973 {
9974 if (IsMagazine())
9975 {
9976 Magazine mag2 = Magazine.Cast(this);
9977 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9978 }
9979 else
9980 {
9982 }
9983 if (m_EM)
9984 {
9985 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9986 }
9987
9988 }
9989
9990 else if (action_id ==
EActions.SET_QUANTITY_0)
9991 {
9993
9994 if (m_EM)
9995 {
9996 m_EM.SetEnergy(0);
9997 }
9998 }
9999
10000 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10001 {
10003
10004 if (m_EM)
10005 {
10006 m_EM.SetEnergy(m_EM.GetEnergyMax());
10007 }
10008 }
10009
10010 else if (action_id ==
EActions.ADD_HEALTH)
10011 {
10012 AddHealth("","",GetMaxHealth("","Health")/5);
10013 }
10014 else if (action_id ==
EActions.REMOVE_HEALTH)
10015 {
10016 AddHealth("","",-GetMaxHealth("","Health")/5);
10017 }
10018 else if (action_id ==
EActions.DESTROY_HEALTH)
10019 {
10020 SetHealth01("","",0);
10021 }
10022 else if (action_id ==
EActions.WATCH_ITEM)
10023 {
10025 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10026 #ifdef DEVELOPER
10027 SetDebugDeveloper_item(this);
10028 #endif
10029 }
10030
10031 else if (action_id ==
EActions.ADD_TEMPERATURE)
10032 {
10033 AddTemperature(20);
10034
10035 }
10036
10037 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10038 {
10039 AddTemperature(-20);
10040
10041 }
10042
10043 else if (action_id ==
EActions.FLIP_FROZEN)
10044 {
10045 SetFrozen(!GetIsFrozen());
10046
10047 }
10048
10049 else if (action_id ==
EActions.ADD_WETNESS)
10050 {
10052
10053 }
10054
10055 else if (action_id ==
EActions.REMOVE_WETNESS)
10056 {
10058
10059 }
10060
10061 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10062 {
10065
10066
10067 }
10068
10069 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10070 {
10073 }
10074
10075 else if (action_id ==
EActions.MAKE_SPECIAL)
10076 {
10077 auto debugParams = DebugSpawnParams.WithPlayer(player);
10078 OnDebugSpawnEx(debugParams);
10079 }
10080
10081 else if (action_id ==
EActions.DELETE)
10082 {
10083 Delete();
10084 }
10085
10086 }
10087
10088
10089 return false;
10090 }
10091
10092
10093
10094
10098
10101
10102
10103
10105 {
10106 return false;
10107 }
10108
10109
10111 {
10112 return true;
10113 }
10114
10115
10117 {
10118 return true;
10119 }
10120
10121
10122
10124 {
10125 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10127 }
10128
10131 {
10132 return null;
10133 }
10134
10136 {
10137 return false;
10138 }
10139
10141 {
10142 return false;
10143 }
10144
10148
10149
10151 {
10152 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10153 return module_repairing.CanRepair(this, item_repair_kit);
10154 }
10155
10156
10157 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10158 {
10159 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10160 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10161 }
10162
10163
10165 {
10166
10167
10168
10169
10170
10171
10172
10173
10174 return 1;
10175 }
10176
10177
10178
10180 {
10182 }
10183
10184
10185
10187 {
10189 }
10190
10191
10200 {
10201 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10202
10203 if (player)
10204 {
10205 player.MessageStatus(text);
10206 }
10207 }
10208
10209
10218 {
10219 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10220
10221 if (player)
10222 {
10223 player.MessageAction(text);
10224 }
10225 }
10226
10227
10236 {
10237 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10238
10239 if (player)
10240 {
10241 player.MessageFriendly(text);
10242 }
10243 }
10244
10245
10254 {
10255 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10256
10257 if (player)
10258 {
10259 player.MessageImportant(text);
10260 }
10261 }
10262
10264 {
10265 return true;
10266 }
10267
10268
10269 override bool KindOf(
string tag)
10270 {
10271 bool found = false;
10272 string item_name = this.
GetType();
10275
10276 int array_size = item_tag_array.Count();
10277 for (int i = 0; i < array_size; i++)
10278 {
10279 if (item_tag_array.Get(i) == tag)
10280 {
10281 found = true;
10282 break;
10283 }
10284 }
10285 return found;
10286 }
10287
10288
10290 {
10291
10292 super.OnRPC(sender, rpc_type,ctx);
10293
10294
10295 switch (rpc_type)
10296 {
10297 #ifndef SERVER
10298 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10299 Param2<bool, string> p = new Param2<bool, string>(false, "");
10300
10302 return;
10303
10304 bool play = p.param1;
10305 string soundSet = p.param2;
10306
10307 if (play)
10308 {
10310 {
10312 {
10314 }
10315 }
10316 else
10317 {
10319 }
10320 }
10321 else
10322 {
10324 }
10325
10326 break;
10327 #endif
10328
10329 }
10330
10332 {
10334 }
10335 }
10336
10337
10338
10339
10341 {
10342 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10343 return plugin.GetID(
name);
10344 }
10345
10347 {
10348 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10349 return plugin.GetName(id);
10350 }
10351
10354 {
10355
10356
10357 int varFlags;
10358 if (!ctx.
Read(varFlags))
10359 return;
10360
10361 if (varFlags & ItemVariableFlags.FLOAT)
10362 {
10364 }
10365 }
10366
10368 {
10369
10370 super.SerializeNumericalVars(floats_out);
10371
10372
10373
10375 {
10377 }
10378
10380 {
10382 }
10383
10385 {
10387 }
10388
10390 {
10395 }
10396
10398 {
10400 }
10401 }
10402
10404 {
10405
10406 super.DeSerializeNumericalVars(floats);
10407
10408
10409 int index = 0;
10410 int mask = Math.Round(floats.Get(index));
10411
10412 index++;
10413
10415 {
10417 {
10419 }
10420 else
10421 {
10422 float quantity = floats.Get(index);
10423 SetQuantity(quantity,
true,
false,
false,
false);
10424 }
10425 index++;
10426 }
10427
10429 {
10430 float wet = floats.Get(index);
10432 index++;
10433 }
10434
10436 {
10437 int liquidtype = Math.Round(floats.Get(index));
10439 index++;
10440 }
10441
10443 {
10445 index++;
10447 index++;
10449 index++;
10451 index++;
10452 }
10453
10455 {
10456 int cleanness = Math.Round(floats.Get(index));
10458 index++;
10459 }
10460 }
10461
10463 {
10464 super.WriteVarsToCTX(ctx);
10465
10466
10468 {
10470 }
10471
10473 {
10475 }
10476
10478 {
10480 }
10481
10483 {
10484 int r,g,b,a;
10490 }
10491
10493 {
10495 }
10496 }
10497
10499 {
10500 if (!super.ReadVarsFromCTX(ctx,version))
10501 return false;
10502
10503 int intValue;
10504 float value;
10505
10506 if (version < 140)
10507 {
10508 if (!ctx.
Read(intValue))
10509 return false;
10510
10511 m_VariablesMask = intValue;
10512 }
10513
10515 {
10516 if (!ctx.
Read(value))
10517 return false;
10518
10520 {
10522 }
10523 else
10524 {
10526 }
10527 }
10528
10529 if (version < 140)
10530 {
10532 {
10533 if (!ctx.
Read(value))
10534 return false;
10535 SetTemperatureDirect(value);
10536 }
10537 }
10538
10540 {
10541 if (!ctx.
Read(value))
10542 return false;
10544 }
10545
10547 {
10548 if (!ctx.
Read(intValue))
10549 return false;
10551 }
10552
10554 {
10555 int r,g,b,a;
10557 return false;
10559 return false;
10561 return false;
10563 return false;
10564
10566 }
10567
10569 {
10570 if (!ctx.
Read(intValue))
10571 return false;
10573 }
10574
10575 if (version >= 138 && version < 140)
10576 {
10578 {
10579 if (!ctx.
Read(intValue))
10580 return false;
10581 SetFrozen(intValue);
10582 }
10583 }
10584
10585 return true;
10586 }
10587
10588
10590 {
10593 {
10595 }
10596
10597 if (!super.OnStoreLoad(ctx, version))
10598 {
10600 return false;
10601 }
10602
10603 if (version >= 114)
10604 {
10605 bool hasQuickBarIndexSaved;
10606
10607 if (!ctx.
Read(hasQuickBarIndexSaved))
10608 {
10610 return false;
10611 }
10612
10613 if (hasQuickBarIndexSaved)
10614 {
10615 int itmQBIndex;
10616
10617
10618 if (!ctx.
Read(itmQBIndex))
10619 {
10621 return false;
10622 }
10623
10624 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10625 if (itmQBIndex != -1 && parentPlayer)
10626 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10627 }
10628 }
10629 else
10630 {
10631
10632 PlayerBase player;
10633 int itemQBIndex;
10634 if (version ==
int.
MAX)
10635 {
10636 if (!ctx.
Read(itemQBIndex))
10637 {
10639 return false;
10640 }
10641 }
10642 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10643 {
10644
10645 if (!ctx.
Read(itemQBIndex))
10646 {
10648 return false;
10649 }
10650 if (itemQBIndex != -1 && player)
10651 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10652 }
10653 }
10654
10655 if (version < 140)
10656 {
10657
10658 if (!LoadVariables(ctx, version))
10659 {
10661 return false;
10662 }
10663 }
10664
10665
10667 {
10669 return false;
10670 }
10671 if (version >= 132)
10672 {
10674 if (raib)
10675 {
10677 {
10679 return false;
10680 }
10681 }
10682 }
10683
10685 return true;
10686 }
10687
10688
10689
10691 {
10692 super.OnStoreSave(ctx);
10693
10694 PlayerBase player;
10695 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10696 {
10698
10699 int itemQBIndex = -1;
10700 itemQBIndex = player.FindQuickBarEntityIndex(this);
10701 ctx.
Write(itemQBIndex);
10702 }
10703 else
10704 {
10706 }
10707
10709
10711 if (raib)
10712 {
10714 }
10715 }
10716
10717
10719 {
10720 super.AfterStoreLoad();
10721
10723 {
10725 }
10726
10728 {
10731 }
10732 }
10733
10735 {
10736 super.EEOnAfterLoad();
10737
10739 {
10741 }
10742
10745 }
10746
10748 {
10749 return false;
10750 }
10751
10752
10753
10755 {
10757 {
10758 #ifdef PLATFORM_CONSOLE
10759
10761 {
10763 if (menu)
10764 {
10766 }
10767 }
10768 #endif
10769 }
10770
10772 {
10775 }
10776
10778 {
10779 SetWeightDirty();
10781 }
10783 {
10786 }
10787
10789 {
10792 }
10794 {
10797 }
10798
10799 super.OnVariablesSynchronized();
10800 }
10801
10802
10803
10805 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10806 {
10807 if (!IsServerCheck(allow_client))
10808 return false;
10809
10811 return false;
10812
10815
10816 if (value <= (min + 0.001))
10817 value = min;
10818
10819 if (value == min)
10820 {
10821 if (destroy_config)
10822 {
10823 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10824 if (dstr)
10825 {
10827 this.Delete();
10828 return true;
10829 }
10830 }
10831 else if (destroy_forced)
10832 {
10834 this.Delete();
10835 return true;
10836 }
10837
10839 }
10840
10843
10845 {
10847
10848 if (delta)
10850 }
10851
10853
10854 return false;
10855 }
10856
10857
10859 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10860 {
10862 }
10863
10865 {
10868 }
10869
10871 {
10874 }
10875
10878 {
10879 float value_clamped = Math.Clamp(value, 0, 1);
10881 SetQuantity(result, destroy_config, destroy_forced);
10882 }
10883
10884
10887 {
10889 }
10890
10892 {
10894 }
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10906 {
10907 int slot = -1;
10908 if (GetInventory())
10909 {
10910 InventoryLocation il = new InventoryLocation;
10911 GetInventory().GetCurrentInventoryLocation(il);
10913 }
10914
10916 }
10917
10919 {
10920 float quantity_max = 0;
10921
10923 {
10924 if (attSlotID != -1)
10925 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10926
10927 if (quantity_max <= 0)
10929 }
10930
10931 if (quantity_max <= 0)
10933
10934 return quantity_max;
10935 }
10936
10938 {
10940 }
10941
10943 {
10945 }
10946
10947
10949 {
10951 }
10952
10954 {
10956 }
10957
10959 {
10961 }
10962
10963
10965 {
10966
10967 float weightEx = GetWeightEx();
10968 float special = GetInventoryAndCargoWeight();
10969 return weightEx - special;
10970 }
10971
10972
10974 {
10976 }
10977
10979 {
10981 {
10982 #ifdef DEVELOPER
10983 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10984 {
10985 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10987 }
10988 #endif
10989
10990 return GetQuantity() * GetConfigWeightModified();
10991 }
10992 else if (HasEnergyManager())
10993 {
10994 #ifdef DEVELOPER
10995 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10996 {
10997 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10998 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10999 }
11000 #endif
11001 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11002 }
11003 else
11004 {
11005 #ifdef DEVELOPER
11006 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11007 {
11008 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11009 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11010 }
11011 #endif
11012 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11013 }
11014 }
11015
11018 {
11019 int item_count = 0;
11021
11022 if (GetInventory().GetCargo() != NULL)
11023 {
11024 item_count = GetInventory().GetCargo().GetItemCount();
11025 }
11026
11027 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11028 {
11029 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11030 if (item)
11031 item_count += item.GetNumberOfItems();
11032 }
11033 return item_count;
11034 }
11035
11038 {
11039 float weight = 0;
11040 float wetness = 1;
11041 if (include_wetness)
11044 {
11045 weight = wetness * m_ConfigWeight;
11046 }
11048 {
11049 weight = 1;
11050 }
11051 return weight;
11052 }
11053
11054
11055
11057 {
11058 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11059 {
11060 GameInventory inv = GetInventory();
11061 array<EntityAI> items = new array<EntityAI>;
11063 for (int i = 0; i < items.Count(); i++)
11064 {
11066 if (item)
11067 {
11069 }
11070 }
11071 }
11072 }
11073
11074
11075
11076
11078 {
11079 float energy = 0;
11080 if (HasEnergyManager())
11081 {
11082 energy = GetCompEM().GetEnergy();
11083 }
11084 return energy;
11085 }
11086
11087
11089 {
11090 super.OnEnergyConsumed();
11091
11093 }
11094
11096 {
11097 super.OnEnergyAdded();
11098
11100 }
11101
11102
11104 {
11105 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11106 {
11108 {
11109 float energy_0to1 = GetCompEM().GetEnergy0To1();
11111 }
11112 }
11113 }
11114
11115
11117 {
11118 return ConfigGetFloat("heatIsolation");
11119 }
11120
11122 {
11124 }
11125
11127 {
11128 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11129 if (
GetGame().ConfigIsExisting(paramPath))
11131
11132 return 0.0;
11133 }
11134
11136 {
11137 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11138 if (
GetGame().ConfigIsExisting(paramPath))
11140
11141 return 0.0;
11142 }
11143
11144 override void SetWet(
float value,
bool allow_client =
false)
11145 {
11146 if (!IsServerCheck(allow_client))
11147 return;
11148
11151
11153
11154 m_VarWet = Math.Clamp(value, min, max);
11155
11157 {
11160 }
11161 }
11162
11163 override void AddWet(
float value)
11164 {
11166 }
11167
11169 {
11171 }
11172
11174 {
11176 }
11177
11179 {
11181 }
11182
11184 {
11186 }
11187
11189 {
11191 }
11192
11193 override void OnWetChanged(
float newVal,
float oldVal)
11194 {
11197 if (newLevel != oldLevel)
11198 {
11200 }
11201 }
11202
11204 {
11205 SetWeightDirty();
11206 }
11207
11209 {
11210 return GetWetLevelInternal(
m_VarWet);
11211 }
11212
11213
11214
11216 {
11218 }
11219
11221 {
11223 }
11224
11226 {
11228 }
11229
11231 {
11233 }
11234
11235
11236
11238 {
11239 if (ConfigIsExisting("itemModelLength"))
11240 {
11241 return ConfigGetFloat("itemModelLength");
11242 }
11243 return 0;
11244 }
11245
11247 {
11248 if (ConfigIsExisting("itemAttachOffset"))
11249 {
11250 return ConfigGetFloat("itemAttachOffset");
11251 }
11252 return 0;
11253 }
11254
11255 override void SetCleanness(
int value,
bool allow_client =
false)
11256 {
11257 if (!IsServerCheck(allow_client))
11258 return;
11259
11261
11263
11266 }
11267
11269 {
11271 }
11272
11274 {
11275 return true;
11276 }
11277
11278
11279
11280
11282 {
11284 }
11285
11287 {
11289 }
11290
11291
11292
11293
11294 override void SetColor(
int r,
int g,
int b,
int a)
11295 {
11301 }
11303 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11304 {
11309 }
11310
11312 {
11314 }
11315
11318 {
11319 int r,g,b,a;
11321 r = r/255;
11322 g = g/255;
11323 b = b/255;
11324 a = a/255;
11325 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11326 }
11327
11328
11329
11330 override void SetLiquidType(
int value,
bool allow_client =
false)
11331 {
11332 if (!IsServerCheck(allow_client))
11333 return;
11334
11339 }
11340
11342 {
11343 return ConfigGetInt("varLiquidTypeInit");
11344 }
11345
11347 {
11349 }
11350
11352 {
11354 SetFrozen(false);
11355 }
11356
11359 {
11360 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11361 }
11362
11363
11366 {
11367 PlayerBase nplayer;
11368 if (PlayerBase.CastTo(nplayer, player))
11369 {
11371
11372 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11373 }
11374 }
11375
11376
11379 {
11380 PlayerBase nplayer;
11381 if (PlayerBase.CastTo(nplayer,player))
11382 {
11383
11384 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11385
11386 }
11387
11388
11389 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11390
11391
11392 if (HasEnergyManager())
11393 {
11394 GetCompEM().UpdatePlugState();
11395 }
11396 }
11397
11398
11400 {
11401 super.OnPlacementStarted(player);
11402
11404 }
11405
11406 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11407 {
11409 {
11410 m_AdminLog.OnPlacementComplete(player,
this);
11411 }
11412
11413 super.OnPlacementComplete(player, position, orientation);
11414 }
11415
11416
11417
11418
11419
11421 {
11423 {
11424 return true;
11425 }
11426 else
11427 {
11428 return false;
11429 }
11430 }
11431
11432
11434 {
11436 {
11438 }
11439 }
11440
11441
11443 {
11445 }
11446
11448 {
11450 }
11451
11452 override void InsertAgent(
int agent,
float count = 1)
11453 {
11454 if (count < 1)
11455 return;
11456
11458 }
11459
11462 {
11464 }
11465
11466
11468 {
11470 }
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11514 {
11516 return false;
11517 return true;
11518 }
11519
11521 {
11522
11524 }
11525
11526
11529 {
11530 super.CheckForRoofLimited(timeTresholdMS);
11531
11533 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11534 {
11535 m_PreviousRoofTestTime = time;
11536 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11537 }
11538 }
11539
11540
11542 {
11544 {
11545 return 0;
11546 }
11547
11548 if (GetInventory().GetAttachmentSlotsCount() != 0)
11549 {
11550 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11551 if (filter)
11552 return filter.GetProtectionLevel(type, false, system);
11553 else
11554 return 0;
11555 }
11556
11557 string subclassPath, entryName;
11558
11559 switch (type)
11560 {
11562 entryName = "biological";
11563 break;
11565 entryName = "chemical";
11566 break;
11567 default:
11568 entryName = "biological";
11569 break;
11570 }
11571
11572 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11573
11575 }
11576
11577
11578
11581 {
11582 if (!IsMagazine())
11584
11586 }
11587
11588
11589
11590
11591
11596 {
11597 return true;
11598 }
11599
11601 {
11603 }
11604
11605
11606
11607
11608
11610 {
11611 if (parent)
11612 {
11613 if (parent.IsInherited(DayZInfected))
11614 return true;
11615
11616 if (!parent.IsRuined())
11617 return true;
11618 }
11619
11620 return true;
11621 }
11622
11624 {
11625 if (!super.CanPutAsAttachment(parent))
11626 {
11627 return false;
11628 }
11629
11630 if (!IsRuined() && !parent.IsRuined())
11631 {
11632 return true;
11633 }
11634
11635 return false;
11636 }
11637
11639 {
11640
11641
11642
11643
11644 return super.CanReceiveItemIntoCargo(item);
11645 }
11646
11648 {
11649
11650
11651
11652
11653 GameInventory attachmentInv = attachment.GetInventory();
11655 {
11656 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11657 return false;
11658 }
11659
11660 InventoryLocation loc = new InventoryLocation();
11661 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11662 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11663 return false;
11664
11665 return super.CanReceiveAttachment(attachment, slotId);
11666 }
11667
11669 {
11670 if (!super.CanReleaseAttachment(attachment))
11671 return false;
11672
11673 return GetInventory().AreChildrenAccessible();
11674 }
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11697 {
11698 int id = muzzle_owner.GetMuzzleID();
11699 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11700
11701 if (WPOF_array)
11702 {
11703 for (int i = 0; i < WPOF_array.Count(); i++)
11704 {
11705 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11706
11707 if (WPOF)
11708 {
11709 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11710 }
11711 }
11712 }
11713 }
11714
11715
11717 {
11718 int id = muzzle_owner.GetMuzzleID();
11720
11721 if (WPOBE_array)
11722 {
11723 for (int i = 0; i < WPOBE_array.Count(); i++)
11724 {
11725 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11726
11727 if (WPOBE)
11728 {
11729 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11730 }
11731 }
11732 }
11733 }
11734
11735
11737 {
11738 int id = muzzle_owner.GetMuzzleID();
11739 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11740
11741 if (WPOOH_array)
11742 {
11743 for (int i = 0; i < WPOOH_array.Count(); i++)
11744 {
11745 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11746
11747 if (WPOOH)
11748 {
11749 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11750 }
11751 }
11752 }
11753 }
11754
11755
11757 {
11758 int id = muzzle_owner.GetMuzzleID();
11759 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11760
11761 if (WPOOH_array)
11762 {
11763 for (int i = 0; i < WPOOH_array.Count(); i++)
11764 {
11765 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11766
11767 if (WPOOH)
11768 {
11769 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11770 }
11771 }
11772 }
11773 }
11774
11775
11777 {
11778 int id = muzzle_owner.GetMuzzleID();
11779 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11780
11781 if (WPOOH_array)
11782 {
11783 for (int i = 0; i < WPOOH_array.Count(); i++)
11784 {
11785 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11786
11787 if (WPOOH)
11788 {
11789 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11790 }
11791 }
11792 }
11793 }
11794
11795
11796
11798 {
11800 {
11801 return true;
11802 }
11803
11804 return false;
11805 }
11806
11808 {
11810 {
11811 return true;
11812 }
11813
11814 return false;
11815 }
11816
11818 {
11820 {
11821 return true;
11822 }
11823
11824 return false;
11825 }
11826
11828 {
11829 return false;
11830 }
11831
11834 {
11835 return UATimeSpent.DEFAULT_DEPLOY;
11836 }
11837
11838
11839
11840
11842 {
11844 SetSynchDirty();
11845 }
11846
11848 {
11850 }
11851
11852
11854 {
11855 return false;
11856 }
11857
11860 {
11861 string att_type = "None";
11862
11863 if (ConfigIsExisting("soundAttType"))
11864 {
11865 att_type = ConfigGetString("soundAttType");
11866 }
11867
11869 }
11870
11872 {
11874 }
11875
11876
11877
11878
11879
11883
11885 {
11888
11890 }
11891
11892
11894 {
11896 return;
11897
11899
11902
11905
11906 SoundParameters params = new SoundParameters();
11910 }
11911
11912
11914 {
11916 return;
11917
11919 SetSynchDirty();
11920
11923 }
11924
11925
11927 {
11929 return;
11930
11932 SetSynchDirty();
11933
11936 }
11937
11939 {
11941 }
11942
11944 {
11946 }
11947
11950 {
11951 if (!
GetGame().IsDedicatedServer())
11952 {
11953 if (ConfigIsExisting("attachSoundSet"))
11954 {
11955 string cfg_path = "";
11956 string soundset = "";
11957 string type_name =
GetType();
11958
11961 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11962 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11963
11964 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11965 {
11966 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11967 {
11968 if (cfg_slot_array[i] == slot_type)
11969 {
11970 soundset = cfg_soundset_array[i];
11971 break;
11972 }
11973 }
11974 }
11975
11976 if (soundset != "")
11977 {
11978 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11980 }
11981 }
11982 }
11983 }
11984
11986 {
11987
11988 }
11989
11990 void OnApply(PlayerBase player);
11991
11993 {
11994 return 1.0;
11995 };
11996
11998 {
12000 }
12001
12003 {
12005 }
12006
12008
12010 {
12011 SetDynamicPhysicsLifeTime(0.01);
12013 }
12014
12016 {
12017 array<string> zone_names = new array<string>;
12018 GetDamageZones(zone_names);
12019 for (int i = 0; i < zone_names.Count(); i++)
12020 {
12021 SetHealthMax(zone_names.Get(i),"Health");
12022 }
12023 SetHealthMax("","Health");
12024 }
12025
12028 {
12029 float global_health = GetHealth01("","Health");
12030 array<string> zones = new array<string>;
12031 GetDamageZones(zones);
12032
12033 for (int i = 0; i < zones.Count(); i++)
12034 {
12035 SetHealth01(zones.Get(i),"Health",global_health);
12036 }
12037 }
12038
12041 {
12042 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12043 }
12044
12046 {
12047 if (!hasRootAsPlayer)
12048 {
12049 if (refParentIB)
12050 {
12051
12052 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12053 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12054
12055 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12056 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12057
12060 }
12061 else
12062 {
12063
12066 }
12067 }
12068 }
12069
12071 {
12073 {
12074 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12075 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12076 {
12077 float heatPermCoef = 1.0;
12079 while (ent)
12080 {
12081 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12082 ent = ent.GetHierarchyParent();
12083 }
12084
12085 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12086 }
12087 }
12088 }
12089
12091 {
12092
12093 EntityAI parent = GetHierarchyParent();
12094 if (!parent)
12095 {
12096 hasParent = false;
12097 hasRootAsPlayer = false;
12098 }
12099 else
12100 {
12101 hasParent = true;
12102 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12103 refParentIB =
ItemBase.Cast(parent);
12104 }
12105 }
12106
12107 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12108 {
12109
12110 }
12111
12113 {
12114
12115 return false;
12116 }
12117
12119 {
12120
12121
12122 return false;
12123 }
12124
12126 {
12127
12128 return false;
12129 }
12130
12133 {
12134 return !GetIsFrozen() &&
IsOpen();
12135 }
12136
12138 {
12139 bool hasParent = false, hasRootAsPlayer = false;
12141
12142 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12143 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12144
12145 if (wwtu || foodDecay)
12146 {
12150
12151 if (processWetness || processTemperature || processDecay)
12152 {
12154
12155 if (processWetness)
12156 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12157
12158 if (processTemperature)
12160
12161 if (processDecay)
12162 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12163 }
12164 }
12165 }
12166
12169 {
12171 }
12172
12174 {
12177
12178 return super.GetTemperatureFreezeThreshold();
12179 }
12180
12182 {
12185
12186 return super.GetTemperatureThawThreshold();
12187 }
12188
12190 {
12193
12194 return super.GetItemOverheatThreshold();
12195 }
12196
12198 {
12200 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12201
12202 return super.GetTemperatureFreezeTime();
12203 }
12204
12206 {
12208 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12209
12210 return super.GetTemperatureThawTime();
12211 }
12212
12217
12219 {
12220 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12221 }
12222
12224 {
12225 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12226 }
12227
12230 {
12232 }
12233
12235 {
12237 }
12238
12240 {
12242 }
12243
12246 {
12247 return null;
12248 }
12249
12252 {
12253 return false;
12254 }
12255
12257 {
12259 {
12262 if (!trg)
12263 {
12265 explosive = this;
12266 }
12267
12268 explosive.PairRemote(trg);
12270
12271 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12272 trg.SetPersistentPairID(persistentID);
12273 explosive.SetPersistentPairID(persistentID);
12274
12275 return true;
12276 }
12277 return false;
12278 }
12279
12282 {
12283 float ret = 1.0;
12286 ret *= GetHealth01();
12287
12288 return ret;
12289 }
12290
12291 #ifdef DEVELOPER
12292 override void SetDebugItem()
12293 {
12294 super.SetDebugItem();
12295 _itemBase = this;
12296 }
12297
12299 {
12300 string text = super.GetDebugText();
12301
12303 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12304
12305 return text;
12306 }
12307 #endif
12308
12310 {
12311 return true;
12312 }
12313
12315
12317
12319 {
12322 }
12323
12324
12332
12348}
12349
12351{
12353 if (entity)
12354 {
12355 bool is_item = entity.IsInherited(
ItemBase);
12356 if (is_item && full_quantity)
12357 {
12360 }
12361 }
12362 else
12363 {
12365 return NULL;
12366 }
12367 return entity;
12368}
12369
12371{
12372 if (item)
12373 {
12374 if (health > 0)
12375 item.SetHealth("", "", health);
12376
12377 if (item.CanHaveTemperature())
12378 {
12380 if (item.CanFreeze())
12381 item.SetFrozen(false);
12382 }
12383
12384 if (item.HasEnergyManager())
12385 {
12386 if (quantity >= 0)
12387 {
12388 item.GetCompEM().SetEnergy0To1(quantity);
12389 }
12390 else
12391 {
12393 }
12394 }
12395 else if (item.IsMagazine())
12396 {
12397 Magazine mag = Magazine.Cast(item);
12398 if (quantity >= 0)
12399 {
12400 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12401 }
12402 else
12403 {
12405 }
12406
12407 }
12408 else
12409 {
12410 if (quantity >= 0)
12411 {
12412 item.SetQuantityNormalized(quantity, false);
12413 }
12414 else
12415 {
12417 }
12418
12419 }
12420 }
12421}
12422
12423#ifdef DEVELOPER
12425#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.