7558{
7560 {
7561 return true;
7562 }
7563};
7564
7565
7566
7568{
7572
7574
7577
7578
7579
7580
7581
7590
7596
7601
7606
7627 protected bool m_IsResultOfSplit
7628
7630
7635
7636
7637
7639
7643
7644
7645
7647
7650
7651
7652
7658
7659
7667
7670
7671
7673
7674
7676
7677
7682
7683
7688
7689
7691
7692
7694 {
7699
7700 if (!
GetGame().IsDedicatedServer())
7701 {
7703 {
7705
7707 {
7709 }
7710 }
7711
7714 }
7715
7716 m_OldLocation = null;
7717
7719 {
7721 }
7722
7723 if (ConfigIsExisting("headSelectionsToHide"))
7724 {
7727 }
7728
7730 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7731 {
7733 }
7734
7736
7737 m_IsResultOfSplit = false;
7738
7740 }
7741
7743 {
7744 super.InitItemVariables();
7745
7751 m_Count = ConfigGetInt(
"count");
7752
7755
7760
7763
7768
7780
7784
7785
7788 if (ConfigIsExisting("canBeSplit"))
7789 {
7792 }
7793
7795 if (ConfigIsExisting("itemBehaviour"))
7797
7798
7801 RegisterNetSyncVariableInt("m_VarLiquidType");
7802 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7803
7804 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7805 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7806 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7807
7808 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7809 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7810 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7811 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7812
7813 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7814 RegisterNetSyncVariableBool("m_IsTakeable");
7815 RegisterNetSyncVariableBool("m_IsHologram");
7816
7819 {
7822 }
7823
7825
7827 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7829
7830 }
7831
7833 {
7835 }
7836
7838 {
7841 {
7846 }
7847 }
7848
7849 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7850 {
7852 {
7855 }
7856
7858 }
7859
7861 {
7867 }
7868
7870
7872 {
7874
7875 if (!action)
7876 {
7877 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7878 return;
7879 }
7880
7882 if (!ai)
7883 {
7885 return;
7886 }
7887
7889 if (!action_array)
7890 {
7891 action_array = new array<ActionBase_Basic>;
7893 }
7894 if (LogManager.IsActionLogEnable())
7895 {
7896 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7897 }
7898
7899 if (action_array.Find(action) != -1)
7900 {
7901 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7902 }
7903 else
7904 {
7905 action_array.Insert(action);
7906 }
7907 }
7908
7910 {
7912 ActionBase action = player.GetActionManager().GetAction(actionName);
7915
7916 if (action_array)
7917 {
7918 action_array.RemoveItem(action);
7919 }
7920 }
7921
7922
7923
7925 {
7926 ActionOverrideData overrideData = new ActionOverrideData();
7930
7932 if (!actionMap)
7933 {
7936 }
7937
7938 actionMap.Insert(this.
Type(), overrideData);
7939
7940 }
7941
7943
7945
7946
7948 {
7951
7954
7955 string config_to_search = "CfgVehicles";
7956 string muzzle_owner_config;
7957
7959 {
7960 if (IsInherited(Weapon))
7961 config_to_search = "CfgWeapons";
7962
7963 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7964
7965 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7966
7968
7969 if (config_OnFire_subclass_count > 0)
7970 {
7971 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7972
7973 for (int i = 0; i < config_OnFire_subclass_count; i++)
7974 {
7975 string particle_class = "";
7977 string config_OnFire_entry = config_OnFire_class + particle_class;
7978 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7979 WPOF_array.Insert(WPOF);
7980 }
7981
7982
7984 }
7985 }
7986
7988 {
7989 config_to_search = "CfgWeapons";
7990 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7991
7992 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7993
7995
7996 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7997 {
7998 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7999
8000 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8001 {
8002 string particle_class2 = "";
8004 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8005 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8006 WPOBE_array.Insert(WPOBE);
8007 }
8008
8009
8011 }
8012 }
8013 }
8014
8015
8017 {
8020
8022 {
8023 string config_to_search = "CfgVehicles";
8024
8025 if (IsInherited(Weapon))
8026 config_to_search = "CfgWeapons";
8027
8028 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8029 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8030
8031 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8032 {
8033
8035
8037 {
8039 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8041 return;
8042 }
8043
8046
8047
8048
8050 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8051
8052 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8053 {
8054 string particle_class = "";
8056 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8058
8059 if (entry_type == CT_CLASS)
8060 {
8061 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8062 WPOOH_array.Insert(WPOF);
8063 }
8064 }
8065
8066
8068 }
8069 }
8070 }
8071
8073 {
8075 }
8076
8078 {
8080 {
8082
8085
8088
8089 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8090 }
8091 }
8092
8094 {
8096 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8097
8099 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8100
8102 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8103
8105 {
8107 }
8108 }
8109
8111 {
8113 }
8114
8116 {
8119 else
8121
8123 {
8126 }
8127 else
8128 {
8131
8134 }
8135
8137 }
8138
8140 {
8142 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8143 }
8144
8146 {
8148 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8150 }
8151
8153 {
8155 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8156 }
8157
8159 {
8162
8163 OverheatingParticle OP = new OverheatingParticle();
8168
8170 }
8171
8173 {
8176
8177 return -1;
8178 }
8179
8181 {
8183 {
8186
8187 for (int i = count; i > 0; --i)
8188 {
8189 int id = i - 1;
8192
8195
8196 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8197 {
8198 if (p)
8199 {
8202 }
8203 }
8204 }
8205 }
8206 }
8207
8209 {
8211 {
8213 {
8214 int id = i - 1;
8216
8217 if (OP)
8218 {
8220
8221 if (p)
8222 {
8224 }
8225
8226 delete OP;
8227 }
8228 }
8229
8232 }
8233 }
8234
8237 {
8238 return 0.0;
8239 }
8240
8241
8243 {
8244 return 250;
8245 }
8246
8248 {
8249 return 0;
8250 }
8251
8254 {
8256 return true;
8257
8258 return false;
8259 }
8260
8263 {
8266
8268 {
8270 }
8271 else
8272 {
8273
8275 }
8276
8278 }
8279
8286 {
8287 return -1;
8288 }
8289
8290
8291
8292
8294 {
8296 {
8298 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8299
8300 if (r_index >= 0)
8301 {
8302 InventoryLocation r_il = new InventoryLocation;
8303 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8304
8305 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8308 {
8309 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8310 }
8312 {
8313 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8314 }
8315
8316 }
8317
8318 player.GetHumanInventory().ClearUserReservedLocation(this);
8319 }
8320
8323 }
8324
8325
8326
8327
8329 {
8330 return ItemBase.m_DebugActionsMask;
8331 }
8332
8334 {
8335 return ItemBase.m_DebugActionsMask & mask;
8336 }
8337
8339 {
8340 ItemBase.m_DebugActionsMask = mask;
8341 }
8342
8344 {
8345 ItemBase.m_DebugActionsMask |= mask;
8346 }
8347
8349 {
8350 ItemBase.m_DebugActionsMask &= ~mask;
8351 }
8352
8354 {
8356 {
8358 }
8359 else
8360 {
8362 }
8363 }
8364
8365
8367 {
8368 if (GetEconomyProfile())
8369 {
8370 float q_max = GetEconomyProfile().GetQuantityMax();
8371 if (q_max > 0)
8372 {
8373 float q_min = GetEconomyProfile().GetQuantityMin();
8374 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8375
8377 {
8378 ComponentEnergyManager comp = GetCompEM();
8380 {
8382 }
8383 }
8385 {
8387
8388 }
8389
8390 }
8391 }
8392 }
8393
8396 {
8397 EntityAI parent = GetHierarchyParent();
8398
8399 if (parent)
8400 {
8401 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8402 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8403 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8404 }
8405 }
8406
8409 {
8410 EntityAI parent = GetHierarchyParent();
8411
8412 if (parent)
8413 {
8414 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8415 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8416 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8417 }
8418 }
8419
8421 {
8422
8423
8424
8425
8427
8429 {
8430 if (ScriptInputUserData.CanStoreInputUserData())
8431 {
8432 ScriptInputUserData ctx = new ScriptInputUserData;
8438 ctx.
Write(use_stack_max);
8441
8443 {
8444 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8445 }
8446 }
8447 }
8448 else if (!
GetGame().IsMultiplayer())
8449 {
8451 }
8452 }
8453
8455 {
8457 }
8458
8460 {
8462 }
8463
8465 {
8467 }
8468
8470 {
8471
8472 return false;
8473 }
8474
8476 {
8477 return false;
8478 }
8479
8483 {
8484 return false;
8485 }
8486
8488 {
8489 return "";
8490 }
8491
8493
8495 {
8496 return false;
8497 }
8498
8500 {
8501 return true;
8502 }
8503
8504
8505
8507 {
8508 return true;
8509 }
8510
8512 {
8513 return true;
8514 }
8515
8517 {
8518 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8520 }
8521
8523 {
8525 }
8526
8528 {
8530 if (!is_being_placed)
8532 SetSynchDirty();
8533 }
8534
8535
8537
8539 {
8541 }
8542
8544 {
8546 }
8547
8549 {
8550 return 1;
8551 }
8552
8554 {
8555 return false;
8556 }
8557
8559 {
8561 SetSynchDirty();
8562 }
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8599 {
8600 super.OnMovedInsideCargo(container);
8601
8602 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8603 }
8604
8605 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8606 {
8607 super.EEItemLocationChanged(oldLoc,newLoc);
8608
8609 PlayerBase new_player = null;
8610 PlayerBase old_player = null;
8611
8612 if (newLoc.GetParent())
8613 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8614
8615 if (oldLoc.GetParent())
8616 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8617
8619 {
8620 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8621
8622 if (r_index >= 0)
8623 {
8624 InventoryLocation r_il = new InventoryLocation;
8625 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8626
8627 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8630 {
8631 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8632 }
8634 {
8635 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8636 }
8637
8638 }
8639 }
8640
8642 {
8643 if (new_player)
8644 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8645
8646 if (new_player == old_player)
8647 {
8648
8649 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8650 {
8652 {
8653 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8654 {
8655 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8656 }
8657 }
8658 else
8659 {
8660 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8661 }
8662 }
8663
8664 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8665 {
8666 int type = oldLoc.GetType();
8668 {
8669 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8670 }
8672 {
8673 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8674 }
8675 }
8676 if (!m_OldLocation)
8677 {
8678 m_OldLocation = new InventoryLocation;
8679 }
8680 m_OldLocation.Copy(oldLoc);
8681 }
8682 else
8683 {
8684 if (m_OldLocation)
8685 {
8686 m_OldLocation.Reset();
8687 }
8688 }
8689
8691 }
8692 else
8693 {
8694 if (new_player)
8695 {
8696 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8697 if (res_index >= 0)
8698 {
8699 InventoryLocation il = new InventoryLocation;
8700 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8702 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8705 {
8706 il.
GetParent().GetOnReleaseLock().Invoke(it);
8707 }
8709 {
8711 }
8712
8713 }
8714 }
8716 {
8717
8719 }
8720
8721 if (m_OldLocation)
8722 {
8723 m_OldLocation.Reset();
8724 }
8725 }
8726 }
8727
8728 override void EOnContact(IEntity other, Contact extra)
8729 {
8731 {
8732 int liquidType = -1;
8734 if (impactSpeed > 0.0)
8735 {
8737 #ifndef SERVER
8739 #else
8741 SetSynchDirty();
8742 #endif
8744 }
8745 }
8746
8747 #ifdef SERVER
8748 if (GetCompEM() && GetCompEM().IsPlugged())
8749 {
8750 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8751 GetCompEM().UnplugThis();
8752 }
8753 #endif
8754 }
8755
8757
8759 {
8761 }
8762
8764 {
8765
8766 }
8767
8769 {
8770 super.OnItemLocationChanged(old_owner, new_owner);
8771
8772 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8773 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8774
8775 if (!relatedPlayer && playerNew)
8776 relatedPlayer = playerNew;
8777
8778 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8779 {
8781 if (actionMgr)
8782 {
8783 ActionBase currentAction = actionMgr.GetRunningAction();
8784 if (currentAction)
8786 }
8787 }
8788
8789 Man ownerPlayerOld = null;
8790 Man ownerPlayerNew = null;
8791
8792 if (old_owner)
8793 {
8794 if (old_owner.
IsMan())
8795 {
8796 ownerPlayerOld = Man.Cast(old_owner);
8797 }
8798 else
8799 {
8800 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8801 }
8802 }
8803 else
8804 {
8806 {
8808
8809 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8810 {
8811 GetCompEM().UnplugThis();
8812 }
8813 }
8814 }
8815
8816 if (new_owner)
8817 {
8818 if (new_owner.
IsMan())
8819 {
8820 ownerPlayerNew = Man.Cast(new_owner);
8821 }
8822 else
8823 {
8824 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8825 }
8826 }
8827
8828 if (ownerPlayerOld != ownerPlayerNew)
8829 {
8830 if (ownerPlayerOld)
8831 {
8832 array<EntityAI> subItemsExit = new array<EntityAI>;
8834 for (int i = 0; i < subItemsExit.Count(); i++)
8835 {
8838 }
8839 }
8840
8841 if (ownerPlayerNew)
8842 {
8843 array<EntityAI> subItemsEnter = new array<EntityAI>;
8845 for (int j = 0; j < subItemsEnter.Count(); j++)
8846 {
8849 }
8850 }
8851 }
8852 else if (ownerPlayerNew != null)
8853 {
8854 PlayerBase nplayer;
8855 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8856 {
8857 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8859 for (int k = 0; k < subItemsUpdate.Count(); k++)
8860 {
8862 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8863 }
8864 }
8865 }
8866
8867 if (old_owner)
8868 old_owner.OnChildItemRemoved(this);
8869 if (new_owner)
8870 new_owner.OnChildItemReceived(this);
8871 }
8872
8873
8875 {
8876 super.EEDelete(parent);
8877 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8878 if (player)
8879 {
8881
8882 if (player.IsAlive())
8883 {
8884 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8885 if (r_index >= 0)
8886 {
8887 InventoryLocation r_il = new InventoryLocation;
8888 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8889
8890 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8893 {
8894 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8895 }
8897 {
8898 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8899 }
8900
8901 }
8902
8903 player.RemoveQuickBarEntityShortcut(this);
8904 }
8905 }
8906 }
8907
8909 {
8910 super.EEKilled(killer);
8911
8914 {
8915 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8916 {
8917 if (IsMagazine())
8918 {
8919 if (Magazine.Cast(this).GetAmmoCount() > 0)
8920 {
8922 }
8923 }
8924 else
8925 {
8927 }
8928 }
8929 }
8930 }
8931
8933 {
8934 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8935
8936 super.OnWasAttached(parent, slot_id);
8937
8940
8942 }
8943
8945 {
8946 super.OnWasDetached(parent, slot_id);
8947
8950 }
8951
8953 {
8954 int idx;
8957
8958 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8959 if (inventory_slots.Count() < 1)
8960 {
8961 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8962 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8963 }
8964 else
8965 {
8966 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8967 }
8968
8969 idx = inventory_slots.Find(slot);
8970 if (idx < 0)
8971 return "";
8972
8973 return attach_types.Get(idx);
8974 }
8975
8977 {
8978 int idx = -1;
8979 string slot;
8980
8983
8984 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8985 if (inventory_slots.Count() < 1)
8986 {
8987 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8988 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8989 }
8990 else
8991 {
8992 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8993 if (detach_types.Count() < 1)
8994 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8995 }
8996
8997 for (int i = 0; i < inventory_slots.Count(); i++)
8998 {
8999 slot = inventory_slots.Get(i);
9000 }
9001
9002 if (slot != "")
9003 {
9004 if (detach_types.Count() == 1)
9005 idx = 0;
9006 else
9007 idx = inventory_slots.Find(slot);
9008 }
9009 if (idx < 0)
9010 return "";
9011
9012 return detach_types.Get(idx);
9013 }
9014
9016 {
9017
9019
9020
9021 float min_time = 1;
9022 float max_time = 3;
9023 float delay = Math.RandomFloat(min_time, max_time);
9024
9025 explode_timer.Run(delay, this, "DoAmmoExplosion");
9026 }
9027
9029 {
9030 Magazine magazine = Magazine.Cast(this);
9031 int pop_sounds_count = 6;
9032 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9033
9034
9035 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9036 string sound_name = pop_sounds[ sound_idx ];
9038
9039
9040 magazine.ServerAddAmmoCount(-1);
9041
9042
9043 float min_temp_to_explode = 100;
9044
9045 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9046 {
9048 }
9049 }
9050
9051
9052 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9053 {
9054 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9055
9056 const int CHANCE_DAMAGE_CARGO = 4;
9057 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9058 const int CHANCE_DAMAGE_NOTHING = 2;
9059
9061 {
9062 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9063 int chances;
9064 int rnd;
9065
9066 if (GetInventory().GetCargo())
9067 {
9068 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9069 rnd = Math.RandomInt(0,chances);
9070
9071 if (rnd < CHANCE_DAMAGE_CARGO)
9072 {
9074 }
9075 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9076 {
9078 }
9079 }
9080 else
9081 {
9082 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9083 rnd = Math.RandomInt(0,chances);
9084
9085 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9086 {
9088 }
9089 }
9090 }
9091 }
9092
9094 {
9095 if (GetInventory().GetCargo())
9096 {
9097 int item_count = GetInventory().GetCargo().GetItemCount();
9098 if (item_count > 0)
9099 {
9100 int random_pick = Math.RandomInt(0, item_count);
9102 if (!item.IsExplosive())
9103 {
9104 item.AddHealth("","",damage);
9105 return true;
9106 }
9107 }
9108 }
9109 return false;
9110 }
9111
9113 {
9114 int attachment_count = GetInventory().AttachmentCount();
9115 if (attachment_count > 0)
9116 {
9117 int random_pick = Math.RandomInt(0, attachment_count);
9118 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9119 if (!attachment.IsExplosive())
9120 {
9121 attachment.AddHealth("","",damage);
9122 return true;
9123 }
9124 }
9125 return false;
9126 }
9127
9129 {
9131 }
9132
9134 {
9136 return GetInventory().CanRemoveEntity();
9137
9138 return false;
9139 }
9140
9142 {
9144 return;
9145
9147 {
9148 if (ScriptInputUserData.CanStoreInputUserData())
9149 {
9150 ScriptInputUserData ctx = new ScriptInputUserData;
9155 ctx.
Write(destination_entity);
9159 }
9160 }
9161 else if (!
GetGame().IsMultiplayer())
9162 {
9164 }
9165 }
9166
9168 {
9170 return;
9171
9172 float split_quantity_new;
9176 InventoryLocation loc = new InventoryLocation;
9177
9178 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9179 {
9181 split_quantity_new = stack_max;
9182 else
9184
9185 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9186 if (new_item)
9187 {
9188 new_item.SetResultOfSplit(true);
9189 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9191 new_item.SetQuantity(split_quantity_new);
9192 }
9193 }
9194 else if (destination_entity && slot_id == -1)
9195 {
9196 if (quantity > stack_max)
9197 split_quantity_new = stack_max;
9198 else
9199 split_quantity_new = quantity;
9200
9202 {
9205 }
9206
9207 if (new_item)
9208 {
9209 new_item.SetResultOfSplit(true);
9210 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9212 new_item.SetQuantity(split_quantity_new);
9213 }
9214 }
9215 else
9216 {
9217 if (stack_max != 0)
9218 {
9220 {
9222 }
9223
9224 if (split_quantity_new == 0)
9225 {
9226 if (!
GetGame().IsMultiplayer())
9227 player.PhysicalPredictiveDropItem(this);
9228 else
9229 player.ServerDropEntity(this);
9230 return;
9231 }
9232
9234
9235 if (new_item)
9236 {
9237 new_item.SetResultOfSplit(true);
9238 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9240 new_item.SetQuantity(stack_max);
9241 new_item.PlaceOnSurface();
9242 }
9243 }
9244 }
9245 }
9246
9248 {
9250 return;
9251
9252 float split_quantity_new;
9256 InventoryLocation loc = new InventoryLocation;
9257
9258 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9259 {
9261 split_quantity_new = stack_max;
9262 else
9264
9265 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9266 if (new_item)
9267 {
9268 new_item.SetResultOfSplit(true);
9269 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9271 new_item.SetQuantity(split_quantity_new);
9272 }
9273 }
9274 else if (destination_entity && slot_id == -1)
9275 {
9276 if (quantity > stack_max)
9277 split_quantity_new = stack_max;
9278 else
9279 split_quantity_new = quantity;
9280
9282 {
9285 }
9286
9287 if (new_item)
9288 {
9289 new_item.SetResultOfSplit(true);
9290 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9292 new_item.SetQuantity(split_quantity_new);
9293 }
9294 }
9295 else
9296 {
9297 if (stack_max != 0)
9298 {
9300 {
9302 }
9303
9305
9306 if (new_item)
9307 {
9308 new_item.SetResultOfSplit(true);
9309 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9311 new_item.SetQuantity(stack_max);
9312 new_item.PlaceOnSurface();
9313 }
9314 }
9315 }
9316 }
9317
9319 {
9321 return;
9322
9324 {
9325 if (ScriptInputUserData.CanStoreInputUserData())
9326 {
9327 ScriptInputUserData ctx = new ScriptInputUserData;
9332 dst.WriteToContext(ctx);
9334 }
9335 }
9336 else if (!
GetGame().IsMultiplayer())
9337 {
9339 }
9340 }
9341
9343 {
9345 return;
9346
9348 {
9349 if (ScriptInputUserData.CanStoreInputUserData())
9350 {
9351 ScriptInputUserData ctx = new ScriptInputUserData;
9356 ctx.
Write(destination_entity);
9362 }
9363 }
9364 else if (!
GetGame().IsMultiplayer())
9365 {
9367 }
9368 }
9369
9371 {
9373 }
9374
9376 {
9378 return this;
9379
9381 float split_quantity_new;
9383 if (dst.IsValid())
9384 {
9385 int slot_id = dst.GetSlot();
9387
9388 if (quantity > stack_max)
9389 split_quantity_new = stack_max;
9390 else
9391 split_quantity_new = quantity;
9392
9394
9395 if (new_item)
9396 {
9397 new_item.SetResultOfSplit(true);
9398 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9401 }
9402
9403 return new_item;
9404 }
9405
9406 return null;
9407 }
9408
9410 {
9412 return;
9413
9415 float split_quantity_new;
9417 if (destination_entity)
9418 {
9420 if (quantity > stackable)
9421 split_quantity_new = stackable;
9422 else
9423 split_quantity_new = quantity;
9424
9425 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9426 if (new_item)
9427 {
9428 new_item.SetResultOfSplit(true);
9429 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9431 new_item.SetQuantity(split_quantity_new);
9432 }
9433 }
9434 }
9435
9437 {
9439 return;
9440
9442 {
9443 if (ScriptInputUserData.CanStoreInputUserData())
9444 {
9445 ScriptInputUserData ctx = new ScriptInputUserData;
9450 ItemBase destination_entity =
this;
9451 ctx.
Write(destination_entity);
9455 }
9456 }
9457 else if (!
GetGame().IsMultiplayer())
9458 {
9460 }
9461 }
9462
9464 {
9466 return;
9467
9469 float split_quantity_new;
9471 if (player)
9472 {
9474 if (quantity > stackable)
9475 split_quantity_new = stackable;
9476 else
9477 split_quantity_new = quantity;
9478
9479 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9480 new_item =
ItemBase.Cast(in_hands);
9481 if (new_item)
9482 {
9483 new_item.SetResultOfSplit(true);
9484 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9486 new_item.SetQuantity(split_quantity_new);
9487 }
9488 }
9489 }
9490
9492 {
9494 return;
9495
9497 float split_quantity_new = Math.Floor(quantity * 0.5);
9498
9500
9501 if (new_item)
9502 {
9503 if (new_item.GetQuantityMax() < split_quantity_new)
9504 {
9505 split_quantity_new = new_item.GetQuantityMax();
9506 }
9507
9508 new_item.SetResultOfSplit(true);
9509 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9510
9512 {
9515 }
9516 else
9517 {
9520 }
9521 }
9522 }
9523
9525 {
9527 return;
9528
9530 float split_quantity_new = Math.Floor(quantity / 2);
9531
9532 InventoryLocation invloc = new InventoryLocation;
9534
9536 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9537
9538 if (new_item)
9539 {
9540 if (new_item.GetQuantityMax() < split_quantity_new)
9541 {
9542 split_quantity_new = new_item.GetQuantityMax();
9543 }
9545 {
9548 }
9549 else
9550 {
9553 }
9554 }
9555 }
9556
9559 {
9560 SetWeightDirty();
9562
9563 if (parent)
9564 parent.OnAttachmentQuantityChangedEx(this, delta);
9565
9567 {
9569 {
9571 }
9573 {
9574 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9576 }
9577 }
9578
9579 }
9580
9583 {
9584
9585 }
9586
9589 {
9591 }
9592
9594 {
9595 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9596
9598 {
9599 if (newLevel == GameConstants.STATE_RUINED)
9600 {
9602 EntityAI parent = GetHierarchyParent();
9603 if (parent && parent.IsFireplace())
9604 {
9605 CargoBase cargo = GetInventory().GetCargo();
9606 if (cargo)
9607 {
9609 {
9611 }
9612 }
9613 }
9614 }
9615
9617 {
9618
9620 return;
9621 }
9622
9623 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9624 {
9626 }
9627 }
9628 }
9629
9630
9632 {
9633 super.OnRightClick();
9634
9636 {
9638 {
9639 if (ScriptInputUserData.CanStoreInputUserData())
9640 {
9641 vector m4[4];
9643
9644 EntityAI root = GetHierarchyRoot();
9645
9646 InventoryLocation dst = new InventoryLocation;
9648 {
9649 if (root)
9650 {
9651 root.GetTransform(m4);
9653 }
9654 else
9655 GetInventory().GetCurrentInventoryLocation(dst);
9656 }
9657 else
9658 {
9660
9661
9662 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9663 {
9664 if (root)
9665 {
9666 root.GetTransform(m4);
9668 }
9669 else
9670 GetInventory().GetCurrentInventoryLocation(dst);
9671 }
9672 else
9673 {
9674 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9675 }
9676 }
9677
9678 ScriptInputUserData ctx = new ScriptInputUserData;
9686 }
9687 }
9688 else if (!
GetGame().IsMultiplayer())
9689 {
9691 }
9692 }
9693 }
9694
9695 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9696 {
9697
9698 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9699 return false;
9700
9701 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9702 return false;
9703
9704
9706 return false;
9707
9708
9709 Magazine mag = Magazine.Cast(this);
9710 if (mag)
9711 {
9712 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9713 return false;
9714
9715 if (stack_max_limit)
9716 {
9717 Magazine other_mag = Magazine.Cast(other_item);
9718 if (other_item)
9719 {
9720 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9721 return false;
9722 }
9723
9724 }
9725 }
9726 else
9727 {
9728
9730 return false;
9731
9733 return false;
9734 }
9735
9736 PlayerBase player = null;
9737 if (CastTo(player, GetHierarchyRootPlayer()))
9738 {
9739 if (player.GetInventory().HasAttachment(this))
9740 return false;
9741
9742 if (player.IsItemsToDelete())
9743 return false;
9744 }
9745
9746 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9747 return false;
9748
9749 int slotID;
9751 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9752 return false;
9753
9754 return true;
9755 }
9756
9758 {
9760 }
9761
9763 {
9764 return m_IsResultOfSplit;
9765 }
9766
9768 {
9769 m_IsResultOfSplit = value;
9770 }
9771
9773 {
9775 }
9776
9778 {
9779 float other_item_quantity = other_item.GetQuantity();
9780 float this_free_space;
9781
9783
9785
9786 if (other_item_quantity > this_free_space)
9787 {
9788 return this_free_space;
9789 }
9790 else
9791 {
9792 return other_item_quantity;
9793 }
9794 }
9795
9797 {
9799 }
9800
9802 {
9804 return;
9805
9806 if (!IsMagazine() && other_item)
9807 {
9809 if (quantity_used != 0)
9810 {
9811 float hp1 = GetHealth01("","");
9812 float hp2 = other_item.GetHealth01("","");
9813 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9814 hpResult = hpResult / (
GetQuantity() + quantity_used);
9815
9816 hpResult *= GetMaxHealth();
9817 Math.Round(hpResult);
9818 SetHealth("", "Health", hpResult);
9819
9821 other_item.AddQuantity(-quantity_used);
9822 }
9823 }
9825 }
9826
9828 {
9829 #ifdef SERVER
9830 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9831 GetHierarchyParent().IncreaseLifetimeUp();
9832 #endif
9833 };
9834
9836 {
9837 PlayerBase p = PlayerBase.Cast(player);
9838
9839 array<int> recipesIds = p.m_Recipes;
9840 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9841 if (moduleRecipesManager)
9842 {
9843 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9844 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9845 }
9846
9847 for (int i = 0;i < recipesIds.Count(); i++)
9848 {
9849 int key = recipesIds.Get(i);
9850 string recipeName = moduleRecipesManager.GetRecipeName(key);
9852 }
9853 }
9854
9855
9856 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9857 {
9858 super.GetDebugActions(outputList);
9859
9860
9865
9866
9870
9874
9875
9878
9879
9881 {
9884 }
9885
9887
9890
9894 }
9895
9896
9897
9898
9900 {
9901 super.OnAction(action_id, player, ctx);
9902 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9903 {
9904 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9905 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9906 PlayerBase p = PlayerBase.Cast(player);
9907 if (
EActions.RECIPES_RANGE_START < 1000)
9908 {
9909 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9910 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9911 }
9912 }
9913 #ifndef SERVER
9914 else if (action_id ==
EActions.WATCH_PLAYER)
9915 {
9916 PluginDeveloper.SetDeveloperItemClientEx(player);
9917 }
9918 #endif
9920 {
9921 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9922 {
9923 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9924 OnDebugButtonPressServer(id + 1);
9925 }
9926
9927 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9928 {
9929 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9931 }
9932
9933 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9934 {
9935 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9937 }
9938
9939 else if (action_id ==
EActions.ADD_QUANTITY)
9940 {
9941 if (IsMagazine())
9942 {
9943 Magazine mag = Magazine.Cast(this);
9944 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9945 }
9946 else
9947 {
9949 }
9950
9951 if (m_EM)
9952 {
9953 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9954 }
9955
9956 }
9957
9958 else if (action_id ==
EActions.REMOVE_QUANTITY)
9959 {
9960 if (IsMagazine())
9961 {
9962 Magazine mag2 = Magazine.Cast(this);
9963 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9964 }
9965 else
9966 {
9968 }
9969 if (m_EM)
9970 {
9971 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9972 }
9973
9974 }
9975
9976 else if (action_id ==
EActions.SET_QUANTITY_0)
9977 {
9979
9980 if (m_EM)
9981 {
9982 m_EM.SetEnergy(0);
9983 }
9984 }
9985
9986 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9987 {
9989
9990 if (m_EM)
9991 {
9992 m_EM.SetEnergy(m_EM.GetEnergyMax());
9993 }
9994 }
9995
9996 else if (action_id ==
EActions.ADD_HEALTH)
9997 {
9998 AddHealth("","",GetMaxHealth("","Health")/5);
9999 }
10000 else if (action_id ==
EActions.REMOVE_HEALTH)
10001 {
10002 AddHealth("","",-GetMaxHealth("","Health")/5);
10003 }
10004 else if (action_id ==
EActions.DESTROY_HEALTH)
10005 {
10006 SetHealth01("","",0);
10007 }
10008 else if (action_id ==
EActions.WATCH_ITEM)
10009 {
10011 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10012 #ifdef DEVELOPER
10013 SetDebugDeveloper_item(this);
10014 #endif
10015 }
10016
10017 else if (action_id ==
EActions.ADD_TEMPERATURE)
10018 {
10019 AddTemperature(20);
10020
10021 }
10022
10023 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10024 {
10025 AddTemperature(-20);
10026
10027 }
10028
10029 else if (action_id ==
EActions.FLIP_FROZEN)
10030 {
10031 SetFrozen(!GetIsFrozen());
10032
10033 }
10034
10035 else if (action_id ==
EActions.ADD_WETNESS)
10036 {
10038
10039 }
10040
10041 else if (action_id ==
EActions.REMOVE_WETNESS)
10042 {
10044
10045 }
10046
10047 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10048 {
10051
10052
10053 }
10054
10055 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10056 {
10059 }
10060
10061 else if (action_id ==
EActions.MAKE_SPECIAL)
10062 {
10063 auto debugParams = DebugSpawnParams.WithPlayer(player);
10064 OnDebugSpawnEx(debugParams);
10065 }
10066
10067 else if (action_id ==
EActions.DELETE)
10068 {
10069 Delete();
10070 }
10071
10072 }
10073
10074
10075 return false;
10076 }
10077
10078
10079
10080
10084
10087
10088
10089
10091 {
10092 return false;
10093 }
10094
10095
10097 {
10098 return true;
10099 }
10100
10101
10103 {
10104 return true;
10105 }
10106
10107
10108
10110 {
10111 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10113 }
10114
10117 {
10118 return null;
10119 }
10120
10122 {
10123 return false;
10124 }
10125
10127 {
10128 return false;
10129 }
10130
10134
10135
10137 {
10138 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10139 return module_repairing.CanRepair(this, item_repair_kit);
10140 }
10141
10142
10143 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10144 {
10145 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10146 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10147 }
10148
10149
10151 {
10152
10153
10154
10155
10156
10157
10158
10159
10160 return 1;
10161 }
10162
10163
10164
10166 {
10168 }
10169
10170
10171
10173 {
10175 }
10176
10177
10186 {
10187 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10188
10189 if (player)
10190 {
10191 player.MessageStatus(text);
10192 }
10193 }
10194
10195
10204 {
10205 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10206
10207 if (player)
10208 {
10209 player.MessageAction(text);
10210 }
10211 }
10212
10213
10222 {
10223 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10224
10225 if (player)
10226 {
10227 player.MessageFriendly(text);
10228 }
10229 }
10230
10231
10240 {
10241 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10242
10243 if (player)
10244 {
10245 player.MessageImportant(text);
10246 }
10247 }
10248
10250 {
10251 return true;
10252 }
10253
10254
10255 override bool KindOf(
string tag)
10256 {
10257 bool found = false;
10258 string item_name = this.
GetType();
10261
10262 int array_size = item_tag_array.Count();
10263 for (int i = 0; i < array_size; i++)
10264 {
10265 if (item_tag_array.Get(i) == tag)
10266 {
10267 found = true;
10268 break;
10269 }
10270 }
10271 return found;
10272 }
10273
10274
10276 {
10277
10278 super.OnRPC(sender, rpc_type,ctx);
10279
10280
10281 switch (rpc_type)
10282 {
10283 #ifndef SERVER
10284 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10285 Param2<bool, string> p = new Param2<bool, string>(false, "");
10286
10288 return;
10289
10290 bool play = p.param1;
10291 string soundSet = p.param2;
10292
10293 if (play)
10294 {
10296 {
10298 {
10300 }
10301 }
10302 else
10303 {
10305 }
10306 }
10307 else
10308 {
10310 }
10311
10312 break;
10313 #endif
10314
10315 }
10316
10318 {
10320 }
10321 }
10322
10323
10324
10325
10327 {
10328 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10329 return plugin.GetID(
name);
10330 }
10331
10333 {
10334 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10335 return plugin.GetName(id);
10336 }
10337
10340 {
10341
10342
10343 int varFlags;
10344 if (!ctx.
Read(varFlags))
10345 return;
10346
10347 if (varFlags & ItemVariableFlags.FLOAT)
10348 {
10350 }
10351 }
10352
10354 {
10355
10356 super.SerializeNumericalVars(floats_out);
10357
10358
10359
10361 {
10363 }
10364
10366 {
10368 }
10369
10371 {
10373 }
10374
10376 {
10381 }
10382
10384 {
10386 }
10387 }
10388
10390 {
10391
10392 super.DeSerializeNumericalVars(floats);
10393
10394
10395 int index = 0;
10396 int mask = Math.Round(floats.Get(index));
10397
10398 index++;
10399
10401 {
10403 {
10405 }
10406 else
10407 {
10408 float quantity = floats.Get(index);
10409 SetQuantity(quantity,
true,
false,
false,
false);
10410 }
10411 index++;
10412 }
10413
10415 {
10416 float wet = floats.Get(index);
10418 index++;
10419 }
10420
10422 {
10423 int liquidtype = Math.Round(floats.Get(index));
10425 index++;
10426 }
10427
10429 {
10431 index++;
10433 index++;
10435 index++;
10437 index++;
10438 }
10439
10441 {
10442 int cleanness = Math.Round(floats.Get(index));
10444 index++;
10445 }
10446 }
10447
10449 {
10450 super.WriteVarsToCTX(ctx);
10451
10452
10454 {
10456 }
10457
10459 {
10461 }
10462
10464 {
10466 }
10467
10469 {
10470 int r,g,b,a;
10476 }
10477
10479 {
10481 }
10482 }
10483
10485 {
10486 if (!super.ReadVarsFromCTX(ctx,version))
10487 return false;
10488
10489 int intValue;
10490 float value;
10491
10492 if (version < 140)
10493 {
10494 if (!ctx.
Read(intValue))
10495 return false;
10496
10497 m_VariablesMask = intValue;
10498 }
10499
10501 {
10502 if (!ctx.
Read(value))
10503 return false;
10504
10506 {
10508 }
10509 else
10510 {
10512 }
10513 }
10514
10515 if (version < 140)
10516 {
10518 {
10519 if (!ctx.
Read(value))
10520 return false;
10521 SetTemperatureDirect(value);
10522 }
10523 }
10524
10526 {
10527 if (!ctx.
Read(value))
10528 return false;
10530 }
10531
10533 {
10534 if (!ctx.
Read(intValue))
10535 return false;
10537 }
10538
10540 {
10541 int r,g,b,a;
10543 return false;
10545 return false;
10547 return false;
10549 return false;
10550
10552 }
10553
10555 {
10556 if (!ctx.
Read(intValue))
10557 return false;
10559 }
10560
10561 if (version >= 138 && version < 140)
10562 {
10564 {
10565 if (!ctx.
Read(intValue))
10566 return false;
10567 SetFrozen(intValue);
10568 }
10569 }
10570
10571 return true;
10572 }
10573
10574
10576 {
10579 {
10581 }
10582
10583 if (!super.OnStoreLoad(ctx, version))
10584 {
10586 return false;
10587 }
10588
10589 if (version >= 114)
10590 {
10591 bool hasQuickBarIndexSaved;
10592
10593 if (!ctx.
Read(hasQuickBarIndexSaved))
10594 {
10596 return false;
10597 }
10598
10599 if (hasQuickBarIndexSaved)
10600 {
10601 int itmQBIndex;
10602
10603
10604 if (!ctx.
Read(itmQBIndex))
10605 {
10607 return false;
10608 }
10609
10610 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10611 if (itmQBIndex != -1 && parentPlayer)
10612 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10613 }
10614 }
10615 else
10616 {
10617
10618 PlayerBase player;
10619 int itemQBIndex;
10620 if (version ==
int.
MAX)
10621 {
10622 if (!ctx.
Read(itemQBIndex))
10623 {
10625 return false;
10626 }
10627 }
10628 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10629 {
10630
10631 if (!ctx.
Read(itemQBIndex))
10632 {
10634 return false;
10635 }
10636 if (itemQBIndex != -1 && player)
10637 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10638 }
10639 }
10640
10641 if (version < 140)
10642 {
10643
10644 if (!LoadVariables(ctx, version))
10645 {
10647 return false;
10648 }
10649 }
10650
10651
10653 {
10655 return false;
10656 }
10657 if (version >= 132)
10658 {
10660 if (raib)
10661 {
10663 {
10665 return false;
10666 }
10667 }
10668 }
10669
10671 return true;
10672 }
10673
10674
10675
10677 {
10678 super.OnStoreSave(ctx);
10679
10680 PlayerBase player;
10681 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10682 {
10684
10685 int itemQBIndex = -1;
10686 itemQBIndex = player.FindQuickBarEntityIndex(this);
10687 ctx.
Write(itemQBIndex);
10688 }
10689 else
10690 {
10692 }
10693
10695
10697 if (raib)
10698 {
10700 }
10701 }
10702
10703
10705 {
10706 super.AfterStoreLoad();
10707
10709 {
10711 }
10712
10714 {
10717 }
10718 }
10719
10721 {
10722 super.EEOnAfterLoad();
10723
10725 {
10727 }
10728
10731 }
10732
10734 {
10735 return false;
10736 }
10737
10738
10739
10741 {
10743 {
10744 #ifdef PLATFORM_CONSOLE
10745
10747 {
10749 if (menu)
10750 {
10752 }
10753 }
10754 #endif
10755 }
10756
10758 {
10761 }
10762
10764 {
10765 SetWeightDirty();
10767 }
10769 {
10772 }
10773
10775 {
10778 }
10780 {
10783 }
10784
10785 super.OnVariablesSynchronized();
10786 }
10787
10788
10789
10791 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10792 {
10793 if (!IsServerCheck(allow_client))
10794 return false;
10795
10797 return false;
10798
10801
10802 if (value <= (min + 0.001))
10803 value = min;
10804
10805 if (value == min)
10806 {
10807 if (destroy_config)
10808 {
10809 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10810 if (dstr)
10811 {
10813 this.Delete();
10814 return true;
10815 }
10816 }
10817 else if (destroy_forced)
10818 {
10820 this.Delete();
10821 return true;
10822 }
10823
10825 }
10826
10829
10831 {
10833
10834 if (delta)
10836 }
10837
10839
10840 return false;
10841 }
10842
10843
10845 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10846 {
10848 }
10849
10851 {
10854 }
10855
10857 {
10860 }
10861
10864 {
10865 float value_clamped = Math.Clamp(value, 0, 1);
10867 SetQuantity(result, destroy_config, destroy_forced);
10868 }
10869
10870
10873 {
10875 }
10876
10878 {
10880 }
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10892 {
10893 int slot = -1;
10894 if (GetInventory())
10895 {
10896 InventoryLocation il = new InventoryLocation;
10897 GetInventory().GetCurrentInventoryLocation(il);
10899 }
10900
10902 }
10903
10905 {
10906 float quantity_max = 0;
10907
10909 {
10910 if (attSlotID != -1)
10911 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10912
10913 if (quantity_max <= 0)
10915 }
10916
10917 if (quantity_max <= 0)
10919
10920 return quantity_max;
10921 }
10922
10924 {
10926 }
10927
10929 {
10931 }
10932
10933
10935 {
10937 }
10938
10940 {
10942 }
10943
10945 {
10947 }
10948
10949
10951 {
10952
10953 float weightEx = GetWeightEx();
10954 float special = GetInventoryAndCargoWeight();
10955 return weightEx - special;
10956 }
10957
10958
10960 {
10962 }
10963
10965 {
10967 {
10968 #ifdef DEVELOPER
10969 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10970 {
10971 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10973 }
10974 #endif
10975
10976 return GetQuantity() * GetConfigWeightModified();
10977 }
10978 else if (HasEnergyManager())
10979 {
10980 #ifdef DEVELOPER
10981 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10982 {
10983 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10984 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10985 }
10986 #endif
10987 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10988 }
10989 else
10990 {
10991 #ifdef DEVELOPER
10992 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10993 {
10994 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10995 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10996 }
10997 #endif
10998 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10999 }
11000 }
11001
11004 {
11005 int item_count = 0;
11007
11008 if (GetInventory().GetCargo() != NULL)
11009 {
11010 item_count = GetInventory().GetCargo().GetItemCount();
11011 }
11012
11013 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11014 {
11015 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11016 if (item)
11017 item_count += item.GetNumberOfItems();
11018 }
11019 return item_count;
11020 }
11021
11024 {
11025 float weight = 0;
11026 float wetness = 1;
11027 if (include_wetness)
11030 {
11031 weight = wetness * m_ConfigWeight;
11032 }
11034 {
11035 weight = 1;
11036 }
11037 return weight;
11038 }
11039
11040
11041
11043 {
11044 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11045 {
11046 GameInventory inv = GetInventory();
11047 array<EntityAI> items = new array<EntityAI>;
11049 for (int i = 0; i < items.Count(); i++)
11050 {
11052 if (item)
11053 {
11055 }
11056 }
11057 }
11058 }
11059
11060
11061
11062
11064 {
11065 float energy = 0;
11066 if (HasEnergyManager())
11067 {
11068 energy = GetCompEM().GetEnergy();
11069 }
11070 return energy;
11071 }
11072
11073
11075 {
11076 super.OnEnergyConsumed();
11077
11079 }
11080
11082 {
11083 super.OnEnergyAdded();
11084
11086 }
11087
11088
11090 {
11091 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11092 {
11094 {
11095 float energy_0to1 = GetCompEM().GetEnergy0To1();
11097 }
11098 }
11099 }
11100
11101
11103 {
11104 return ConfigGetFloat("heatIsolation");
11105 }
11106
11108 {
11110 }
11111
11113 {
11114 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11115 if (
GetGame().ConfigIsExisting(paramPath))
11117
11118 return 0.0;
11119 }
11120
11122 {
11123 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11124 if (
GetGame().ConfigIsExisting(paramPath))
11126
11127 return 0.0;
11128 }
11129
11130 override void SetWet(
float value,
bool allow_client =
false)
11131 {
11132 if (!IsServerCheck(allow_client))
11133 return;
11134
11137
11139
11140 m_VarWet = Math.Clamp(value, min, max);
11141
11143 {
11146 }
11147 }
11148
11149 override void AddWet(
float value)
11150 {
11152 }
11153
11155 {
11157 }
11158
11160 {
11162 }
11163
11165 {
11167 }
11168
11170 {
11172 }
11173
11175 {
11177 }
11178
11179 override void OnWetChanged(
float newVal,
float oldVal)
11180 {
11183 if (newLevel != oldLevel)
11184 {
11186 }
11187 }
11188
11190 {
11191 SetWeightDirty();
11192 }
11193
11195 {
11196 return GetWetLevelInternal(
m_VarWet);
11197 }
11198
11199
11200
11202 {
11204 }
11205
11207 {
11209 }
11210
11212 {
11214 }
11215
11217 {
11219 }
11220
11221
11222
11224 {
11225 if (ConfigIsExisting("itemModelLength"))
11226 {
11227 return ConfigGetFloat("itemModelLength");
11228 }
11229 return 0;
11230 }
11231
11233 {
11234 if (ConfigIsExisting("itemAttachOffset"))
11235 {
11236 return ConfigGetFloat("itemAttachOffset");
11237 }
11238 return 0;
11239 }
11240
11241 override void SetCleanness(
int value,
bool allow_client =
false)
11242 {
11243 if (!IsServerCheck(allow_client))
11244 return;
11245
11247
11249
11252 }
11253
11255 {
11257 }
11258
11260 {
11261 return true;
11262 }
11263
11264
11265
11266
11268 {
11270 }
11271
11273 {
11275 }
11276
11277
11278
11279
11280 override void SetColor(
int r,
int g,
int b,
int a)
11281 {
11287 }
11289 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11290 {
11295 }
11296
11298 {
11300 }
11301
11304 {
11305 int r,g,b,a;
11307 r = r/255;
11308 g = g/255;
11309 b = b/255;
11310 a = a/255;
11311 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11312 }
11313
11314
11315
11316 override void SetLiquidType(
int value,
bool allow_client =
false)
11317 {
11318 if (!IsServerCheck(allow_client))
11319 return;
11320
11325 }
11326
11328 {
11329 return ConfigGetInt("varLiquidTypeInit");
11330 }
11331
11333 {
11335 }
11336
11338 {
11340 SetFrozen(false);
11341 }
11342
11345 {
11346 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11347 }
11348
11349
11352 {
11353 PlayerBase nplayer;
11354 if (PlayerBase.CastTo(nplayer, player))
11355 {
11357
11358 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11359 }
11360 }
11361
11362
11365 {
11366 PlayerBase nplayer;
11367 if (PlayerBase.CastTo(nplayer,player))
11368 {
11369
11370 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11371
11372 }
11373
11374
11375 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11376
11377
11378 if (HasEnergyManager())
11379 {
11380 GetCompEM().UpdatePlugState();
11381 }
11382 }
11383
11384
11386 {
11387 super.OnPlacementStarted(player);
11388
11390 }
11391
11392 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11393 {
11395 {
11396 m_AdminLog.OnPlacementComplete(player,
this);
11397 }
11398
11399 super.OnPlacementComplete(player, position, orientation);
11400 }
11401
11402
11403
11404
11405
11407 {
11409 {
11410 return true;
11411 }
11412 else
11413 {
11414 return false;
11415 }
11416 }
11417
11418
11420 {
11422 {
11424 }
11425 }
11426
11427
11429 {
11431 }
11432
11434 {
11436 }
11437
11438 override void InsertAgent(
int agent,
float count = 1)
11439 {
11440 if (count < 1)
11441 return;
11442
11444 }
11445
11448 {
11450 }
11451
11452
11454 {
11456 }
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
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
11500 {
11502 return false;
11503 return true;
11504 }
11505
11507 {
11508
11510 }
11511
11512
11515 {
11516 super.CheckForRoofLimited(timeTresholdMS);
11517
11519 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11520 {
11521 m_PreviousRoofTestTime = time;
11522 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11523 }
11524 }
11525
11526
11528 {
11530 {
11531 return 0;
11532 }
11533
11534 if (GetInventory().GetAttachmentSlotsCount() != 0)
11535 {
11536 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11537 if (filter)
11538 return filter.GetProtectionLevel(type, false, system);
11539 else
11540 return 0;
11541 }
11542
11543 string subclassPath, entryName;
11544
11545 switch (type)
11546 {
11548 entryName = "biological";
11549 break;
11551 entryName = "chemical";
11552 break;
11553 default:
11554 entryName = "biological";
11555 break;
11556 }
11557
11558 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11559
11561 }
11562
11563
11564
11567 {
11568 if (!IsMagazine())
11570
11572 }
11573
11574
11575
11576
11577
11582 {
11583 return true;
11584 }
11585
11587 {
11589 }
11590
11591
11592
11593
11594
11596 {
11597 if (parent)
11598 {
11599 if (parent.IsInherited(DayZInfected))
11600 return true;
11601
11602 if (!parent.IsRuined())
11603 return true;
11604 }
11605
11606 return true;
11607 }
11608
11610 {
11611 if (!super.CanPutAsAttachment(parent))
11612 {
11613 return false;
11614 }
11615
11616 if (!IsRuined() && !parent.IsRuined())
11617 {
11618 return true;
11619 }
11620
11621 return false;
11622 }
11623
11625 {
11626
11627
11628
11629
11630 return super.CanReceiveItemIntoCargo(item);
11631 }
11632
11634 {
11635
11636
11637
11638
11639 GameInventory attachmentInv = attachment.GetInventory();
11641 {
11642 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11643 return false;
11644 }
11645
11646 InventoryLocation loc = new InventoryLocation();
11647 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11648 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11649 return false;
11650
11651 return super.CanReceiveAttachment(attachment, slotId);
11652 }
11653
11655 {
11656 if (!super.CanReleaseAttachment(attachment))
11657 return false;
11658
11659 return GetInventory().AreChildrenAccessible();
11660 }
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11683 {
11684 int id = muzzle_owner.GetMuzzleID();
11685 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11686
11687 if (WPOF_array)
11688 {
11689 for (int i = 0; i < WPOF_array.Count(); i++)
11690 {
11691 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11692
11693 if (WPOF)
11694 {
11695 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11696 }
11697 }
11698 }
11699 }
11700
11701
11703 {
11704 int id = muzzle_owner.GetMuzzleID();
11706
11707 if (WPOBE_array)
11708 {
11709 for (int i = 0; i < WPOBE_array.Count(); i++)
11710 {
11711 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11712
11713 if (WPOBE)
11714 {
11715 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11716 }
11717 }
11718 }
11719 }
11720
11721
11723 {
11724 int id = muzzle_owner.GetMuzzleID();
11725 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11726
11727 if (WPOOH_array)
11728 {
11729 for (int i = 0; i < WPOOH_array.Count(); i++)
11730 {
11731 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11732
11733 if (WPOOH)
11734 {
11735 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11736 }
11737 }
11738 }
11739 }
11740
11741
11743 {
11744 int id = muzzle_owner.GetMuzzleID();
11745 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11746
11747 if (WPOOH_array)
11748 {
11749 for (int i = 0; i < WPOOH_array.Count(); i++)
11750 {
11751 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11752
11753 if (WPOOH)
11754 {
11755 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11756 }
11757 }
11758 }
11759 }
11760
11761
11763 {
11764 int id = muzzle_owner.GetMuzzleID();
11765 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11766
11767 if (WPOOH_array)
11768 {
11769 for (int i = 0; i < WPOOH_array.Count(); i++)
11770 {
11771 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11772
11773 if (WPOOH)
11774 {
11775 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11776 }
11777 }
11778 }
11779 }
11780
11781
11782
11784 {
11786 {
11787 return true;
11788 }
11789
11790 return false;
11791 }
11792
11794 {
11796 {
11797 return true;
11798 }
11799
11800 return false;
11801 }
11802
11804 {
11806 {
11807 return true;
11808 }
11809
11810 return false;
11811 }
11812
11814 {
11815 return false;
11816 }
11817
11820 {
11821 return UATimeSpent.DEFAULT_DEPLOY;
11822 }
11823
11824
11825
11826
11828 {
11830 SetSynchDirty();
11831 }
11832
11834 {
11836 }
11837
11838
11840 {
11841 return false;
11842 }
11843
11846 {
11847 string att_type = "None";
11848
11849 if (ConfigIsExisting("soundAttType"))
11850 {
11851 att_type = ConfigGetString("soundAttType");
11852 }
11853
11855 }
11856
11858 {
11860 }
11861
11862
11863
11864
11865
11869
11871 {
11874
11876 }
11877
11878
11880 {
11882 return;
11883
11885
11888
11891
11892 SoundParameters params = new SoundParameters();
11896 }
11897
11898
11900 {
11902 return;
11903
11905 SetSynchDirty();
11906
11909 }
11910
11911
11913 {
11915 return;
11916
11918 SetSynchDirty();
11919
11922 }
11923
11925 {
11927 }
11928
11930 {
11932 }
11933
11936 {
11937 if (!
GetGame().IsDedicatedServer())
11938 {
11939 if (ConfigIsExisting("attachSoundSet"))
11940 {
11941 string cfg_path = "";
11942 string soundset = "";
11943 string type_name =
GetType();
11944
11947 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11948 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11949
11950 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11951 {
11952 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11953 {
11954 if (cfg_slot_array[i] == slot_type)
11955 {
11956 soundset = cfg_soundset_array[i];
11957 break;
11958 }
11959 }
11960 }
11961
11962 if (soundset != "")
11963 {
11964 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11966 }
11967 }
11968 }
11969 }
11970
11972 {
11973
11974 }
11975
11976 void OnApply(PlayerBase player);
11977
11979 {
11980 return 1.0;
11981 };
11982
11984 {
11986 }
11987
11989 {
11991 }
11992
11994
11996 {
11997 SetDynamicPhysicsLifeTime(0.01);
11999 }
12000
12002 {
12003 array<string> zone_names = new array<string>;
12004 GetDamageZones(zone_names);
12005 for (int i = 0; i < zone_names.Count(); i++)
12006 {
12007 SetHealthMax(zone_names.Get(i),"Health");
12008 }
12009 SetHealthMax("","Health");
12010 }
12011
12014 {
12015 float global_health = GetHealth01("","Health");
12016 array<string> zones = new array<string>;
12017 GetDamageZones(zones);
12018
12019 for (int i = 0; i < zones.Count(); i++)
12020 {
12021 SetHealth01(zones.Get(i),"Health",global_health);
12022 }
12023 }
12024
12027 {
12028 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12029 }
12030
12032 {
12033 if (!hasRootAsPlayer)
12034 {
12035 if (refParentIB)
12036 {
12037
12038 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12039 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12040
12041 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12042 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12043
12046 }
12047 else
12048 {
12049
12052 }
12053 }
12054 }
12055
12057 {
12059 {
12060 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12061 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12062 {
12063 float heatPermCoef = 1.0;
12065 while (ent)
12066 {
12067 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12068 ent = ent.GetHierarchyParent();
12069 }
12070
12071 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12072 }
12073 }
12074 }
12075
12077 {
12078
12079 EntityAI parent = GetHierarchyParent();
12080 if (!parent)
12081 {
12082 hasParent = false;
12083 hasRootAsPlayer = false;
12084 }
12085 else
12086 {
12087 hasParent = true;
12088 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12089 refParentIB =
ItemBase.Cast(parent);
12090 }
12091 }
12092
12093 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12094 {
12095
12096 }
12097
12099 {
12100
12101 return false;
12102 }
12103
12105 {
12106
12107
12108 return false;
12109 }
12110
12112 {
12113
12114 return false;
12115 }
12116
12119 {
12120 return !GetIsFrozen() &&
IsOpen();
12121 }
12122
12124 {
12125 bool hasParent = false, hasRootAsPlayer = false;
12127
12128 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12129 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12130
12131 if (wwtu || foodDecay)
12132 {
12136
12137 if (processWetness || processTemperature || processDecay)
12138 {
12140
12141 if (processWetness)
12142 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12143
12144 if (processTemperature)
12146
12147 if (processDecay)
12148 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12149 }
12150 }
12151 }
12152
12155 {
12157 }
12158
12160 {
12163
12164 return super.GetTemperatureFreezeThreshold();
12165 }
12166
12168 {
12171
12172 return super.GetTemperatureThawThreshold();
12173 }
12174
12176 {
12179
12180 return super.GetItemOverheatThreshold();
12181 }
12182
12184 {
12186 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12187
12188 return super.GetTemperatureFreezeTime();
12189 }
12190
12192 {
12194 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12195
12196 return super.GetTemperatureThawTime();
12197 }
12198
12203
12205 {
12206 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12207 }
12208
12210 {
12211 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12212 }
12213
12216 {
12218 }
12219
12221 {
12223 }
12224
12226 {
12228 }
12229
12232 {
12233 return null;
12234 }
12235
12238 {
12239 return false;
12240 }
12241
12243 {
12245 {
12248 if (!trg)
12249 {
12251 explosive = this;
12252 }
12253
12254 explosive.PairRemote(trg);
12256
12257 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12258 trg.SetPersistentPairID(persistentID);
12259 explosive.SetPersistentPairID(persistentID);
12260
12261 return true;
12262 }
12263 return false;
12264 }
12265
12268 {
12269 float ret = 1.0;
12272 ret *= GetHealth01();
12273
12274 return ret;
12275 }
12276
12277 #ifdef DEVELOPER
12278 override void SetDebugItem()
12279 {
12280 super.SetDebugItem();
12281 _itemBase = this;
12282 }
12283
12285 {
12286 string text = super.GetDebugText();
12287
12289 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12290
12291 return text;
12292 }
12293 #endif
12294
12296 {
12297 return true;
12298 }
12299
12301
12303
12305 {
12308 }
12309
12310
12318
12334}
12335
12337{
12339 if (entity)
12340 {
12341 bool is_item = entity.IsInherited(
ItemBase);
12342 if (is_item && full_quantity)
12343 {
12346 }
12347 }
12348 else
12349 {
12351 return NULL;
12352 }
12353 return entity;
12354}
12355
12357{
12358 if (item)
12359 {
12360 if (health > 0)
12361 item.SetHealth("", "", health);
12362
12363 if (item.CanHaveTemperature())
12364 {
12366 if (item.CanFreeze())
12367 item.SetFrozen(false);
12368 }
12369
12370 if (item.HasEnergyManager())
12371 {
12372 if (quantity >= 0)
12373 {
12374 item.GetCompEM().SetEnergy0To1(quantity);
12375 }
12376 else
12377 {
12379 }
12380 }
12381 else if (item.IsMagazine())
12382 {
12383 Magazine mag = Magazine.Cast(item);
12384 if (quantity >= 0)
12385 {
12386 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12387 }
12388 else
12389 {
12391 }
12392
12393 }
12394 else
12395 {
12396 if (quantity >= 0)
12397 {
12398 item.SetQuantityNormalized(quantity, false);
12399 }
12400 else
12401 {
12403 }
12404
12405 }
12406 }
12407}
12408
12409#ifdef DEVELOPER
12411#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.