7551{
7553 {
7554 return true;
7555 }
7556};
7557
7558
7559
7561{
7565
7567
7570
7571
7572
7573
7574
7583
7589
7594
7599
7620 protected bool m_IsResultOfSplit
7621
7623
7628
7629
7630
7632
7636
7637
7638
7640
7643
7644
7645
7651
7652
7660
7663
7664
7666
7667
7669
7670
7675
7676
7681
7682
7684
7685
7687 {
7692
7693 if (!
GetGame().IsDedicatedServer())
7694 {
7696 {
7698
7700 {
7702 }
7703 }
7704
7707 }
7708
7709 m_OldLocation = null;
7710
7712 {
7714 }
7715
7716 if (ConfigIsExisting("headSelectionsToHide"))
7717 {
7720 }
7721
7723 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7724 {
7726 }
7727
7729
7730 m_IsResultOfSplit = false;
7731
7733 }
7734
7736 {
7737 super.InitItemVariables();
7738
7744 m_Count = ConfigGetInt(
"count");
7745
7748
7753
7756
7761
7773
7777
7778
7781 if (ConfigIsExisting("canBeSplit"))
7782 {
7785 }
7786
7788 if (ConfigIsExisting("itemBehaviour"))
7790
7791
7794 RegisterNetSyncVariableInt("m_VarLiquidType");
7795 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7796
7797 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7798 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7799 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7800
7801 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7802 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7803 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7804 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7805
7806 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7807 RegisterNetSyncVariableBool("m_IsTakeable");
7808 RegisterNetSyncVariableBool("m_IsHologram");
7809
7812 {
7815 }
7816
7818
7820 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7822
7823 }
7824
7826 {
7828 }
7829
7831 {
7834 {
7839 }
7840 }
7841
7842 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7843 {
7845 {
7848 }
7849
7851 }
7852
7854 {
7860 }
7861
7863
7865 {
7867
7868 if (!action)
7869 {
7870 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7871 return;
7872 }
7873
7875 if (!ai)
7876 {
7878 return;
7879 }
7880
7882 if (!action_array)
7883 {
7884 action_array = new array<ActionBase_Basic>;
7886 }
7887 if (LogManager.IsActionLogEnable())
7888 {
7889 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7890 }
7891
7892 if (action_array.Find(action) != -1)
7893 {
7894 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7895 }
7896 else
7897 {
7898 action_array.Insert(action);
7899 }
7900 }
7901
7903 {
7905 ActionBase action = player.GetActionManager().GetAction(actionName);
7908
7909 if (action_array)
7910 {
7911 action_array.RemoveItem(action);
7912 }
7913 }
7914
7915
7916
7918 {
7919 ActionOverrideData overrideData = new ActionOverrideData();
7923
7925 if (!actionMap)
7926 {
7929 }
7930
7931 actionMap.Insert(this.
Type(), overrideData);
7932
7933 }
7934
7936
7938
7939
7941 {
7944
7947
7948 string config_to_search = "CfgVehicles";
7949 string muzzle_owner_config;
7950
7952 {
7953 if (IsInherited(Weapon))
7954 config_to_search = "CfgWeapons";
7955
7956 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7957
7958 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7959
7961
7962 if (config_OnFire_subclass_count > 0)
7963 {
7964 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7965
7966 for (int i = 0; i < config_OnFire_subclass_count; i++)
7967 {
7968 string particle_class = "";
7970 string config_OnFire_entry = config_OnFire_class + particle_class;
7971 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7972 WPOF_array.Insert(WPOF);
7973 }
7974
7975
7977 }
7978 }
7979
7981 {
7982 config_to_search = "CfgWeapons";
7983 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7984
7985 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7986
7988
7989 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7990 {
7991 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7992
7993 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7994 {
7995 string particle_class2 = "";
7997 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7998 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7999 WPOBE_array.Insert(WPOBE);
8000 }
8001
8002
8004 }
8005 }
8006 }
8007
8008
8010 {
8013
8015 {
8016 string config_to_search = "CfgVehicles";
8017
8018 if (IsInherited(Weapon))
8019 config_to_search = "CfgWeapons";
8020
8021 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8022 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8023
8024 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8025 {
8026
8028
8030 {
8032 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8034 return;
8035 }
8036
8039
8040
8041
8043 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8044
8045 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8046 {
8047 string particle_class = "";
8049 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8051
8052 if (entry_type == CT_CLASS)
8053 {
8054 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8055 WPOOH_array.Insert(WPOF);
8056 }
8057 }
8058
8059
8061 }
8062 }
8063 }
8064
8066 {
8068 }
8069
8071 {
8073 {
8075
8078
8081
8082 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8083 }
8084 }
8085
8087 {
8089 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8090
8092 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8093
8095 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8096
8098 {
8100 }
8101 }
8102
8104 {
8106 }
8107
8109 {
8112 else
8114
8116 {
8119 }
8120 else
8121 {
8124
8127 }
8128
8130 }
8131
8133 {
8135 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8136 }
8137
8139 {
8141 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8143 }
8144
8146 {
8148 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8149 }
8150
8152 {
8155
8156 OverheatingParticle OP = new OverheatingParticle();
8161
8163 }
8164
8166 {
8169
8170 return -1;
8171 }
8172
8174 {
8176 {
8179
8180 for (int i = count; i > 0; --i)
8181 {
8182 int id = i - 1;
8185
8188
8189 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8190 {
8191 if (p)
8192 {
8195 }
8196 }
8197 }
8198 }
8199 }
8200
8202 {
8204 {
8206 {
8207 int id = i - 1;
8209
8210 if (OP)
8211 {
8213
8214 if (p)
8215 {
8217 }
8218
8219 delete OP;
8220 }
8221 }
8222
8225 }
8226 }
8227
8230 {
8231 return 0.0;
8232 }
8233
8234
8236 {
8237 return 250;
8238 }
8239
8241 {
8242 return 0;
8243 }
8244
8247 {
8249 return true;
8250
8251 return false;
8252 }
8253
8256 {
8259
8261 {
8263 }
8264 else
8265 {
8266
8268 }
8269
8271 }
8272
8279 {
8280 return -1;
8281 }
8282
8283
8284
8285
8287 {
8289 {
8291 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8292
8293 if (r_index >= 0)
8294 {
8295 InventoryLocation r_il = new InventoryLocation;
8296 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8297
8298 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8301 {
8302 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8303 }
8305 {
8306 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8307 }
8308
8309 }
8310
8311 player.GetHumanInventory().ClearUserReservedLocation(this);
8312 }
8313
8316 }
8317
8318
8319
8320
8322 {
8323 return ItemBase.m_DebugActionsMask;
8324 }
8325
8327 {
8328 return ItemBase.m_DebugActionsMask & mask;
8329 }
8330
8332 {
8333 ItemBase.m_DebugActionsMask = mask;
8334 }
8335
8337 {
8338 ItemBase.m_DebugActionsMask |= mask;
8339 }
8340
8342 {
8343 ItemBase.m_DebugActionsMask &= ~mask;
8344 }
8345
8347 {
8349 {
8351 }
8352 else
8353 {
8355 }
8356 }
8357
8358
8360 {
8361 if (GetEconomyProfile())
8362 {
8363 float q_max = GetEconomyProfile().GetQuantityMax();
8364 if (q_max > 0)
8365 {
8366 float q_min = GetEconomyProfile().GetQuantityMin();
8367 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8368
8370 {
8371 ComponentEnergyManager comp = GetCompEM();
8373 {
8375 }
8376 }
8378 {
8380
8381 }
8382
8383 }
8384 }
8385 }
8386
8389 {
8390 EntityAI parent = GetHierarchyParent();
8391
8392 if (parent)
8393 {
8394 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8395 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8396 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8397 }
8398 }
8399
8402 {
8403 EntityAI parent = GetHierarchyParent();
8404
8405 if (parent)
8406 {
8407 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8408 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8409 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8410 }
8411 }
8412
8414 {
8415
8416
8417
8418
8420
8422 {
8423 if (ScriptInputUserData.CanStoreInputUserData())
8424 {
8425 ScriptInputUserData ctx = new ScriptInputUserData;
8431 ctx.
Write(use_stack_max);
8434
8436 {
8437 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8438 }
8439 }
8440 }
8441 else if (!
GetGame().IsMultiplayer())
8442 {
8444 }
8445 }
8446
8448 {
8450 }
8451
8453 {
8455 }
8456
8458 {
8460 }
8461
8463 {
8464
8465 return false;
8466 }
8467
8469 {
8470 return false;
8471 }
8472
8476 {
8477 return false;
8478 }
8479
8481 {
8482 return "";
8483 }
8484
8486
8488 {
8489 return false;
8490 }
8491
8493 {
8494 return true;
8495 }
8496
8497
8498
8500 {
8501 return true;
8502 }
8503
8505 {
8506 return true;
8507 }
8508
8510 {
8511 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8513 }
8514
8516 {
8518 }
8519
8521 {
8523 if (!is_being_placed)
8525 SetSynchDirty();
8526 }
8527
8528
8530
8532 {
8534 }
8535
8537 {
8539 }
8540
8542 {
8543 return 1;
8544 }
8545
8547 {
8548 return false;
8549 }
8550
8552 {
8554 SetSynchDirty();
8555 }
8556
8557
8558
8559
8560
8561
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
8592 {
8593 super.OnMovedInsideCargo(container);
8594
8595 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8596 }
8597
8598 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8599 {
8600 super.EEItemLocationChanged(oldLoc,newLoc);
8601
8602 PlayerBase new_player = null;
8603 PlayerBase old_player = null;
8604
8605 if (newLoc.GetParent())
8606 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8607
8608 if (oldLoc.GetParent())
8609 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8610
8612 {
8613 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8614
8615 if (r_index >= 0)
8616 {
8617 InventoryLocation r_il = new InventoryLocation;
8618 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8619
8620 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8623 {
8624 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8625 }
8627 {
8628 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8629 }
8630
8631 }
8632 }
8633
8635 {
8636 if (new_player)
8637 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8638
8639 if (new_player == old_player)
8640 {
8641
8642 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8643 {
8645 {
8646 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8647 {
8648 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8649 }
8650 }
8651 else
8652 {
8653 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8654 }
8655 }
8656
8657 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8658 {
8659 int type = oldLoc.GetType();
8661 {
8662 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8663 }
8665 {
8666 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8667 }
8668 }
8669 if (!m_OldLocation)
8670 {
8671 m_OldLocation = new InventoryLocation;
8672 }
8673 m_OldLocation.Copy(oldLoc);
8674 }
8675 else
8676 {
8677 if (m_OldLocation)
8678 {
8679 m_OldLocation.Reset();
8680 }
8681 }
8682
8684 }
8685 else
8686 {
8687 if (new_player)
8688 {
8689 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8690 if (res_index >= 0)
8691 {
8692 InventoryLocation il = new InventoryLocation;
8693 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8695 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8698 {
8699 il.
GetParent().GetOnReleaseLock().Invoke(it);
8700 }
8702 {
8704 }
8705
8706 }
8707 }
8709 {
8710
8712 }
8713
8714 if (m_OldLocation)
8715 {
8716 m_OldLocation.Reset();
8717 }
8718 }
8719 }
8720
8721 override void EOnContact(IEntity other, Contact extra)
8722 {
8724 {
8725 int liquidType = -1;
8727 if (impactSpeed > 0.0)
8728 {
8730 #ifndef SERVER
8732 #else
8734 SetSynchDirty();
8735 #endif
8737 }
8738 }
8739
8740 #ifdef SERVER
8741 if (GetCompEM() && GetCompEM().IsPlugged())
8742 {
8743 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8744 GetCompEM().UnplugThis();
8745 }
8746 #endif
8747 }
8748
8750
8752 {
8754 }
8755
8757 {
8758
8759 }
8760
8762 {
8763 super.OnItemLocationChanged(old_owner, new_owner);
8764
8765 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8766 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8767
8768 if (!relatedPlayer && playerNew)
8769 relatedPlayer = playerNew;
8770
8771 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8772 {
8774 if (actionMgr)
8775 {
8776 ActionBase currentAction = actionMgr.GetRunningAction();
8777 if (currentAction)
8779 }
8780 }
8781
8782 Man ownerPlayerOld = null;
8783 Man ownerPlayerNew = null;
8784
8785 if (old_owner)
8786 {
8787 if (old_owner.
IsMan())
8788 {
8789 ownerPlayerOld = Man.Cast(old_owner);
8790 }
8791 else
8792 {
8793 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8794 }
8795 }
8796 else
8797 {
8799 {
8801
8802 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8803 {
8804 GetCompEM().UnplugThis();
8805 }
8806 }
8807 }
8808
8809 if (new_owner)
8810 {
8811 if (new_owner.
IsMan())
8812 {
8813 ownerPlayerNew = Man.Cast(new_owner);
8814 }
8815 else
8816 {
8817 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8818 }
8819 }
8820
8821 if (ownerPlayerOld != ownerPlayerNew)
8822 {
8823 if (ownerPlayerOld)
8824 {
8825 array<EntityAI> subItemsExit = new array<EntityAI>;
8827 for (int i = 0; i < subItemsExit.Count(); i++)
8828 {
8831 }
8832 }
8833
8834 if (ownerPlayerNew)
8835 {
8836 array<EntityAI> subItemsEnter = new array<EntityAI>;
8838 for (int j = 0; j < subItemsEnter.Count(); j++)
8839 {
8842 }
8843 }
8844 }
8845 else if (ownerPlayerNew != null)
8846 {
8847 PlayerBase nplayer;
8848 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8849 {
8850 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8852 for (int k = 0; k < subItemsUpdate.Count(); k++)
8853 {
8855 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8856 }
8857 }
8858 }
8859
8860 if (old_owner)
8861 old_owner.OnChildItemRemoved(this);
8862 if (new_owner)
8863 new_owner.OnChildItemReceived(this);
8864 }
8865
8866
8868 {
8869 super.EEDelete(parent);
8870 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8871 if (player)
8872 {
8874
8875 if (player.IsAlive())
8876 {
8877 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8878 if (r_index >= 0)
8879 {
8880 InventoryLocation r_il = new InventoryLocation;
8881 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8882
8883 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8886 {
8887 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8888 }
8890 {
8891 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8892 }
8893
8894 }
8895
8896 player.RemoveQuickBarEntityShortcut(this);
8897 }
8898 }
8899 }
8900
8902 {
8903 super.EEKilled(killer);
8904
8907 {
8908 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8909 {
8910 if (IsMagazine())
8911 {
8912 if (Magazine.Cast(this).GetAmmoCount() > 0)
8913 {
8915 }
8916 }
8917 else
8918 {
8920 }
8921 }
8922 }
8923 }
8924
8926 {
8927 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8928
8929 super.OnWasAttached(parent, slot_id);
8930
8933
8935 }
8936
8938 {
8939 super.OnWasDetached(parent, slot_id);
8940
8943 }
8944
8946 {
8947 int idx;
8950
8951 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8952 if (inventory_slots.Count() < 1)
8953 {
8954 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8955 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8956 }
8957 else
8958 {
8959 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8960 }
8961
8962 idx = inventory_slots.Find(slot);
8963 if (idx < 0)
8964 return "";
8965
8966 return attach_types.Get(idx);
8967 }
8968
8970 {
8971 int idx = -1;
8972 string slot;
8973
8976
8977 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8978 if (inventory_slots.Count() < 1)
8979 {
8980 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8981 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8982 }
8983 else
8984 {
8985 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8986 if (detach_types.Count() < 1)
8987 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8988 }
8989
8990 for (int i = 0; i < inventory_slots.Count(); i++)
8991 {
8992 slot = inventory_slots.Get(i);
8993 }
8994
8995 if (slot != "")
8996 {
8997 if (detach_types.Count() == 1)
8998 idx = 0;
8999 else
9000 idx = inventory_slots.Find(slot);
9001 }
9002 if (idx < 0)
9003 return "";
9004
9005 return detach_types.Get(idx);
9006 }
9007
9009 {
9010
9012
9013
9014 float min_time = 1;
9015 float max_time = 3;
9016 float delay = Math.RandomFloat(min_time, max_time);
9017
9018 explode_timer.Run(delay, this, "DoAmmoExplosion");
9019 }
9020
9022 {
9023 Magazine magazine = Magazine.Cast(this);
9024 int pop_sounds_count = 6;
9025 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9026
9027
9028 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9029 string sound_name = pop_sounds[ sound_idx ];
9031
9032
9033 magazine.ServerAddAmmoCount(-1);
9034
9035
9036 float min_temp_to_explode = 100;
9037
9038 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9039 {
9041 }
9042 }
9043
9044
9045 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9046 {
9047 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9048
9049 const int CHANCE_DAMAGE_CARGO = 4;
9050 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9051 const int CHANCE_DAMAGE_NOTHING = 2;
9052
9054 {
9055 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9056 int chances;
9057 int rnd;
9058
9059 if (GetInventory().GetCargo())
9060 {
9061 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9062 rnd = Math.RandomInt(0,chances);
9063
9064 if (rnd < CHANCE_DAMAGE_CARGO)
9065 {
9067 }
9068 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9069 {
9071 }
9072 }
9073 else
9074 {
9075 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9076 rnd = Math.RandomInt(0,chances);
9077
9078 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9079 {
9081 }
9082 }
9083 }
9084 }
9085
9087 {
9088 if (GetInventory().GetCargo())
9089 {
9090 int item_count = GetInventory().GetCargo().GetItemCount();
9091 if (item_count > 0)
9092 {
9093 int random_pick = Math.RandomInt(0, item_count);
9095 if (!item.IsExplosive())
9096 {
9097 item.AddHealth("","",damage);
9098 return true;
9099 }
9100 }
9101 }
9102 return false;
9103 }
9104
9106 {
9107 int attachment_count = GetInventory().AttachmentCount();
9108 if (attachment_count > 0)
9109 {
9110 int random_pick = Math.RandomInt(0, attachment_count);
9111 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9112 if (!attachment.IsExplosive())
9113 {
9114 attachment.AddHealth("","",damage);
9115 return true;
9116 }
9117 }
9118 return false;
9119 }
9120
9122 {
9124 }
9125
9127 {
9129 return GetInventory().CanRemoveEntity();
9130
9131 return false;
9132 }
9133
9135 {
9137 return;
9138
9140 {
9141 if (ScriptInputUserData.CanStoreInputUserData())
9142 {
9143 ScriptInputUserData ctx = new ScriptInputUserData;
9148 ctx.
Write(destination_entity);
9152 }
9153 }
9154 else if (!
GetGame().IsMultiplayer())
9155 {
9157 }
9158 }
9159
9161 {
9163 return;
9164
9165 float split_quantity_new;
9169 InventoryLocation loc = new InventoryLocation;
9170
9171 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9172 {
9174 split_quantity_new = stack_max;
9175 else
9177
9178 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9179 if (new_item)
9180 {
9181 new_item.SetResultOfSplit(true);
9182 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9184 new_item.SetQuantity(split_quantity_new);
9185 }
9186 }
9187 else if (destination_entity && slot_id == -1)
9188 {
9189 if (quantity > stack_max)
9190 split_quantity_new = stack_max;
9191 else
9192 split_quantity_new = quantity;
9193
9195 {
9198 }
9199
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
9209 {
9210 if (stack_max != 0)
9211 {
9213 {
9215 }
9216
9217 if (split_quantity_new == 0)
9218 {
9219 if (!
GetGame().IsMultiplayer())
9220 player.PhysicalPredictiveDropItem(this);
9221 else
9222 player.ServerDropEntity(this);
9223 return;
9224 }
9225
9227
9228 if (new_item)
9229 {
9230 new_item.SetResultOfSplit(true);
9231 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9233 new_item.SetQuantity(stack_max);
9234 new_item.PlaceOnSurface();
9235 }
9236 }
9237 }
9238 }
9239
9241 {
9243 return;
9244
9245 float split_quantity_new;
9249 InventoryLocation loc = new InventoryLocation;
9250
9251 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9252 {
9254 split_quantity_new = stack_max;
9255 else
9257
9258 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9259 if (new_item)
9260 {
9261 new_item.SetResultOfSplit(true);
9262 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9264 new_item.SetQuantity(split_quantity_new);
9265 }
9266 }
9267 else if (destination_entity && slot_id == -1)
9268 {
9269 if (quantity > stack_max)
9270 split_quantity_new = stack_max;
9271 else
9272 split_quantity_new = quantity;
9273
9275 {
9278 }
9279
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
9289 {
9290 if (stack_max != 0)
9291 {
9293 {
9295 }
9296
9298
9299 if (new_item)
9300 {
9301 new_item.SetResultOfSplit(true);
9302 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9304 new_item.SetQuantity(stack_max);
9305 new_item.PlaceOnSurface();
9306 }
9307 }
9308 }
9309 }
9310
9312 {
9314 return;
9315
9317 {
9318 if (ScriptInputUserData.CanStoreInputUserData())
9319 {
9320 ScriptInputUserData ctx = new ScriptInputUserData;
9325 dst.WriteToContext(ctx);
9327 }
9328 }
9329 else if (!
GetGame().IsMultiplayer())
9330 {
9332 }
9333 }
9334
9336 {
9338 return;
9339
9341 {
9342 if (ScriptInputUserData.CanStoreInputUserData())
9343 {
9344 ScriptInputUserData ctx = new ScriptInputUserData;
9349 ctx.
Write(destination_entity);
9355 }
9356 }
9357 else if (!
GetGame().IsMultiplayer())
9358 {
9360 }
9361 }
9362
9364 {
9366 }
9367
9369 {
9371 return this;
9372
9374 float split_quantity_new;
9376 if (dst.IsValid())
9377 {
9378 int slot_id = dst.GetSlot();
9380
9381 if (quantity > stack_max)
9382 split_quantity_new = stack_max;
9383 else
9384 split_quantity_new = quantity;
9385
9387
9388 if (new_item)
9389 {
9390 new_item.SetResultOfSplit(true);
9391 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9394 }
9395
9396 return new_item;
9397 }
9398
9399 return null;
9400 }
9401
9403 {
9405 return;
9406
9408 float split_quantity_new;
9410 if (destination_entity)
9411 {
9413 if (quantity > stackable)
9414 split_quantity_new = stackable;
9415 else
9416 split_quantity_new = quantity;
9417
9418 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9419 if (new_item)
9420 {
9421 new_item.SetResultOfSplit(true);
9422 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9424 new_item.SetQuantity(split_quantity_new);
9425 }
9426 }
9427 }
9428
9430 {
9432 return;
9433
9435 {
9436 if (ScriptInputUserData.CanStoreInputUserData())
9437 {
9438 ScriptInputUserData ctx = new ScriptInputUserData;
9443 ItemBase destination_entity =
this;
9444 ctx.
Write(destination_entity);
9448 }
9449 }
9450 else if (!
GetGame().IsMultiplayer())
9451 {
9453 }
9454 }
9455
9457 {
9459 return;
9460
9462 float split_quantity_new;
9464 if (player)
9465 {
9467 if (quantity > stackable)
9468 split_quantity_new = stackable;
9469 else
9470 split_quantity_new = quantity;
9471
9472 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9473 new_item =
ItemBase.Cast(in_hands);
9474 if (new_item)
9475 {
9476 new_item.SetResultOfSplit(true);
9477 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9479 new_item.SetQuantity(split_quantity_new);
9480 }
9481 }
9482 }
9483
9485 {
9487 return;
9488
9490 float split_quantity_new = Math.Floor(quantity * 0.5);
9491
9493
9494 if (new_item)
9495 {
9496 if (new_item.GetQuantityMax() < split_quantity_new)
9497 {
9498 split_quantity_new = new_item.GetQuantityMax();
9499 }
9500
9501 new_item.SetResultOfSplit(true);
9502 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9503
9505 {
9508 }
9509 else
9510 {
9513 }
9514 }
9515 }
9516
9518 {
9520 return;
9521
9523 float split_quantity_new = Math.Floor(quantity / 2);
9524
9525 InventoryLocation invloc = new InventoryLocation;
9527
9529 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9530
9531 if (new_item)
9532 {
9533 if (new_item.GetQuantityMax() < split_quantity_new)
9534 {
9535 split_quantity_new = new_item.GetQuantityMax();
9536 }
9538 {
9541 }
9542 else
9543 {
9546 }
9547 }
9548 }
9549
9552 {
9553 SetWeightDirty();
9555
9556 if (parent)
9557 parent.OnAttachmentQuantityChangedEx(this, delta);
9558
9560 {
9562 {
9564 }
9566 {
9567 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9569 }
9570 }
9571
9572 }
9573
9576 {
9577
9578 }
9579
9582 {
9584 }
9585
9587 {
9588 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9589
9591 {
9592 if (newLevel == GameConstants.STATE_RUINED)
9593 {
9595 EntityAI parent = GetHierarchyParent();
9596 if (parent && parent.IsFireplace())
9597 {
9598 CargoBase cargo = GetInventory().GetCargo();
9599 if (cargo)
9600 {
9602 {
9604 }
9605 }
9606 }
9607 }
9608
9610 {
9611
9613 return;
9614 }
9615
9616 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9617 {
9619 }
9620 }
9621 }
9622
9623
9625 {
9626 super.OnRightClick();
9627
9629 {
9631 {
9632 if (ScriptInputUserData.CanStoreInputUserData())
9633 {
9634 vector m4[4];
9636
9637 EntityAI root = GetHierarchyRoot();
9638
9639 InventoryLocation dst = new InventoryLocation;
9641 {
9642 if (root)
9643 {
9644 root.GetTransform(m4);
9646 }
9647 else
9648 GetInventory().GetCurrentInventoryLocation(dst);
9649 }
9650 else
9651 {
9653
9654
9655 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9656 {
9657 if (root)
9658 {
9659 root.GetTransform(m4);
9661 }
9662 else
9663 GetInventory().GetCurrentInventoryLocation(dst);
9664 }
9665 else
9666 {
9667 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9668 }
9669 }
9670
9671 ScriptInputUserData ctx = new ScriptInputUserData;
9679 }
9680 }
9681 else if (!
GetGame().IsMultiplayer())
9682 {
9684 }
9685 }
9686 }
9687
9688 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9689 {
9690
9691 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9692 return false;
9693
9694 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9695 return false;
9696
9697
9699 return false;
9700
9701
9702 Magazine mag = Magazine.Cast(this);
9703 if (mag)
9704 {
9705 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9706 return false;
9707
9708 if (stack_max_limit)
9709 {
9710 Magazine other_mag = Magazine.Cast(other_item);
9711 if (other_item)
9712 {
9713 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9714 return false;
9715 }
9716
9717 }
9718 }
9719 else
9720 {
9721
9723 return false;
9724
9726 return false;
9727 }
9728
9729 PlayerBase player = null;
9730 if (CastTo(player, GetHierarchyRootPlayer()))
9731 {
9732 if (player.GetInventory().HasAttachment(this))
9733 return false;
9734
9735 if (player.IsItemsToDelete())
9736 return false;
9737 }
9738
9739 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9740 return false;
9741
9742 int slotID;
9744 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9745 return false;
9746
9747 return true;
9748 }
9749
9751 {
9753 }
9754
9756 {
9757 return m_IsResultOfSplit;
9758 }
9759
9761 {
9762 m_IsResultOfSplit = value;
9763 }
9764
9766 {
9768 }
9769
9771 {
9772 float other_item_quantity = other_item.GetQuantity();
9773 float this_free_space;
9774
9776
9778
9779 if (other_item_quantity > this_free_space)
9780 {
9781 return this_free_space;
9782 }
9783 else
9784 {
9785 return other_item_quantity;
9786 }
9787 }
9788
9790 {
9792 }
9793
9795 {
9797 return;
9798
9799 if (!IsMagazine() && other_item)
9800 {
9802 if (quantity_used != 0)
9803 {
9804 float hp1 = GetHealth01("","");
9805 float hp2 = other_item.GetHealth01("","");
9806 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9807 hpResult = hpResult / (
GetQuantity() + quantity_used);
9808
9809 hpResult *= GetMaxHealth();
9810 Math.Round(hpResult);
9811 SetHealth("", "Health", hpResult);
9812
9814 other_item.AddQuantity(-quantity_used);
9815 }
9816 }
9818 }
9819
9821 {
9822 #ifdef SERVER
9823 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9824 GetHierarchyParent().IncreaseLifetimeUp();
9825 #endif
9826 };
9827
9829 {
9830 PlayerBase p = PlayerBase.Cast(player);
9831
9832 array<int> recipesIds = p.m_Recipes;
9833 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9834 if (moduleRecipesManager)
9835 {
9836 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9837 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9838 }
9839
9840 for (int i = 0;i < recipesIds.Count(); i++)
9841 {
9842 int key = recipesIds.Get(i);
9843 string recipeName = moduleRecipesManager.GetRecipeName(key);
9845 }
9846 }
9847
9848
9849 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9850 {
9851 super.GetDebugActions(outputList);
9852
9853
9858
9859
9863
9867
9868
9871
9872
9874 {
9877 }
9878
9880
9883
9887 }
9888
9889
9890
9891
9893 {
9894 super.OnAction(action_id, player, ctx);
9895 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9896 {
9897 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9898 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9899 PlayerBase p = PlayerBase.Cast(player);
9900 if (
EActions.RECIPES_RANGE_START < 1000)
9901 {
9902 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9903 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9904 }
9905 }
9906 #ifndef SERVER
9907 else if (action_id ==
EActions.WATCH_PLAYER)
9908 {
9909 PluginDeveloper.SetDeveloperItemClientEx(player);
9910 }
9911 #endif
9913 {
9914 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9915 {
9916 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9917 OnDebugButtonPressServer(id + 1);
9918 }
9919
9920 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9921 {
9922 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9924 }
9925
9926 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9927 {
9928 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9930 }
9931
9932 else if (action_id ==
EActions.ADD_QUANTITY)
9933 {
9934 if (IsMagazine())
9935 {
9936 Magazine mag = Magazine.Cast(this);
9937 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9938 }
9939 else
9940 {
9942 }
9943
9944 if (m_EM)
9945 {
9946 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9947 }
9948
9949 }
9950
9951 else if (action_id ==
EActions.REMOVE_QUANTITY)
9952 {
9953 if (IsMagazine())
9954 {
9955 Magazine mag2 = Magazine.Cast(this);
9956 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9957 }
9958 else
9959 {
9961 }
9962 if (m_EM)
9963 {
9964 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9965 }
9966
9967 }
9968
9969 else if (action_id ==
EActions.SET_QUANTITY_0)
9970 {
9972
9973 if (m_EM)
9974 {
9975 m_EM.SetEnergy(0);
9976 }
9977 }
9978
9979 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9980 {
9982
9983 if (m_EM)
9984 {
9985 m_EM.SetEnergy(m_EM.GetEnergyMax());
9986 }
9987 }
9988
9989 else if (action_id ==
EActions.ADD_HEALTH)
9990 {
9991 AddHealth("","",GetMaxHealth("","Health")/5);
9992 }
9993 else if (action_id ==
EActions.REMOVE_HEALTH)
9994 {
9995 AddHealth("","",-GetMaxHealth("","Health")/5);
9996 }
9997 else if (action_id ==
EActions.DESTROY_HEALTH)
9998 {
9999 SetHealth01("","",0);
10000 }
10001 else if (action_id ==
EActions.WATCH_ITEM)
10002 {
10004 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10005 #ifdef DEVELOPER
10006 SetDebugDeveloper_item(this);
10007 #endif
10008 }
10009
10010 else if (action_id ==
EActions.ADD_TEMPERATURE)
10011 {
10012 AddTemperature(20);
10013
10014 }
10015
10016 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10017 {
10018 AddTemperature(-20);
10019
10020 }
10021
10022 else if (action_id ==
EActions.FLIP_FROZEN)
10023 {
10024 SetFrozen(!GetIsFrozen());
10025
10026 }
10027
10028 else if (action_id ==
EActions.ADD_WETNESS)
10029 {
10031
10032 }
10033
10034 else if (action_id ==
EActions.REMOVE_WETNESS)
10035 {
10037
10038 }
10039
10040 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10041 {
10044
10045
10046 }
10047
10048 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10049 {
10052 }
10053
10054 else if (action_id ==
EActions.MAKE_SPECIAL)
10055 {
10056 auto debugParams = DebugSpawnParams.WithPlayer(player);
10057 OnDebugSpawnEx(debugParams);
10058 }
10059
10060 else if (action_id ==
EActions.DELETE)
10061 {
10062 Delete();
10063 }
10064
10065 }
10066
10067
10068 return false;
10069 }
10070
10071
10072
10073
10077
10080
10081
10082
10084 {
10085 return false;
10086 }
10087
10088
10090 {
10091 return true;
10092 }
10093
10094
10096 {
10097 return true;
10098 }
10099
10100
10101
10103 {
10104 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10106 }
10107
10110 {
10111 return null;
10112 }
10113
10115 {
10116 return false;
10117 }
10118
10120 {
10121 return false;
10122 }
10123
10127
10128
10130 {
10131 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10132 return module_repairing.CanRepair(this, item_repair_kit);
10133 }
10134
10135
10136 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10137 {
10138 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10139 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10140 }
10141
10142
10144 {
10145
10146
10147
10148
10149
10150
10151
10152
10153 return 1;
10154 }
10155
10156
10157
10159 {
10161 }
10162
10163
10164
10166 {
10168 }
10169
10170
10179 {
10180 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10181
10182 if (player)
10183 {
10184 player.MessageStatus(text);
10185 }
10186 }
10187
10188
10197 {
10198 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10199
10200 if (player)
10201 {
10202 player.MessageAction(text);
10203 }
10204 }
10205
10206
10215 {
10216 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10217
10218 if (player)
10219 {
10220 player.MessageFriendly(text);
10221 }
10222 }
10223
10224
10233 {
10234 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10235
10236 if (player)
10237 {
10238 player.MessageImportant(text);
10239 }
10240 }
10241
10243 {
10244 return true;
10245 }
10246
10247
10248 override bool KindOf(
string tag)
10249 {
10250 bool found = false;
10251 string item_name = this.
GetType();
10254
10255 int array_size = item_tag_array.Count();
10256 for (int i = 0; i < array_size; i++)
10257 {
10258 if (item_tag_array.Get(i) == tag)
10259 {
10260 found = true;
10261 break;
10262 }
10263 }
10264 return found;
10265 }
10266
10267
10269 {
10270
10271 super.OnRPC(sender, rpc_type,ctx);
10272
10273
10274 switch (rpc_type)
10275 {
10276 #ifndef SERVER
10277 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10278 Param2<bool, string> p = new Param2<bool, string>(false, "");
10279
10281 return;
10282
10283 bool play = p.param1;
10284 string soundSet = p.param2;
10285
10286 if (play)
10287 {
10289 {
10291 {
10293 }
10294 }
10295 else
10296 {
10298 }
10299 }
10300 else
10301 {
10303 }
10304
10305 break;
10306 #endif
10307
10308 }
10309
10311 {
10313 }
10314 }
10315
10316
10317
10318
10320 {
10321 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10322 return plugin.GetID(
name);
10323 }
10324
10326 {
10327 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10328 return plugin.GetName(id);
10329 }
10330
10333 {
10334
10335
10336 int varFlags;
10337 if (!ctx.
Read(varFlags))
10338 return;
10339
10340 if (varFlags & ItemVariableFlags.FLOAT)
10341 {
10343 }
10344 }
10345
10347 {
10348
10349 super.SerializeNumericalVars(floats_out);
10350
10351
10352
10354 {
10356 }
10357
10359 {
10361 }
10362
10364 {
10366 }
10367
10369 {
10374 }
10375
10377 {
10379 }
10380 }
10381
10383 {
10384
10385 super.DeSerializeNumericalVars(floats);
10386
10387
10388 int index = 0;
10389 int mask = Math.Round(floats.Get(index));
10390
10391 index++;
10392
10394 {
10396 {
10398 }
10399 else
10400 {
10401 float quantity = floats.Get(index);
10402 SetQuantity(quantity,
true,
false,
false,
false);
10403 }
10404 index++;
10405 }
10406
10408 {
10409 float wet = floats.Get(index);
10411 index++;
10412 }
10413
10415 {
10416 int liquidtype = Math.Round(floats.Get(index));
10418 index++;
10419 }
10420
10422 {
10424 index++;
10426 index++;
10428 index++;
10430 index++;
10431 }
10432
10434 {
10435 int cleanness = Math.Round(floats.Get(index));
10437 index++;
10438 }
10439 }
10440
10442 {
10443 super.WriteVarsToCTX(ctx);
10444
10445
10447 {
10449 }
10450
10452 {
10454 }
10455
10457 {
10459 }
10460
10462 {
10463 int r,g,b,a;
10469 }
10470
10472 {
10474 }
10475 }
10476
10478 {
10479 if (!super.ReadVarsFromCTX(ctx,version))
10480 return false;
10481
10482 int intValue;
10483 float value;
10484
10485 if (version < 140)
10486 {
10487 if (!ctx.
Read(intValue))
10488 return false;
10489
10490 m_VariablesMask = intValue;
10491 }
10492
10494 {
10495 if (!ctx.
Read(value))
10496 return false;
10497
10499 {
10501 }
10502 else
10503 {
10505 }
10506 }
10507
10508 if (version < 140)
10509 {
10511 {
10512 if (!ctx.
Read(value))
10513 return false;
10514 SetTemperatureDirect(value);
10515 }
10516 }
10517
10519 {
10520 if (!ctx.
Read(value))
10521 return false;
10523 }
10524
10526 {
10527 if (!ctx.
Read(intValue))
10528 return false;
10530 }
10531
10533 {
10534 int r,g,b,a;
10536 return false;
10538 return false;
10540 return false;
10542 return false;
10543
10545 }
10546
10548 {
10549 if (!ctx.
Read(intValue))
10550 return false;
10552 }
10553
10554 if (version >= 138 && version < 140)
10555 {
10557 {
10558 if (!ctx.
Read(intValue))
10559 return false;
10560 SetFrozen(intValue);
10561 }
10562 }
10563
10564 return true;
10565 }
10566
10567
10569 {
10572 {
10574 }
10575
10576 if (!super.OnStoreLoad(ctx, version))
10577 {
10579 return false;
10580 }
10581
10582 if (version >= 114)
10583 {
10584 bool hasQuickBarIndexSaved;
10585
10586 if (!ctx.
Read(hasQuickBarIndexSaved))
10587 {
10589 return false;
10590 }
10591
10592 if (hasQuickBarIndexSaved)
10593 {
10594 int itmQBIndex;
10595
10596
10597 if (!ctx.
Read(itmQBIndex))
10598 {
10600 return false;
10601 }
10602
10603 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10604 if (itmQBIndex != -1 && parentPlayer)
10605 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10606 }
10607 }
10608 else
10609 {
10610
10611 PlayerBase player;
10612 int itemQBIndex;
10613 if (version ==
int.
MAX)
10614 {
10615 if (!ctx.
Read(itemQBIndex))
10616 {
10618 return false;
10619 }
10620 }
10621 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10622 {
10623
10624 if (!ctx.
Read(itemQBIndex))
10625 {
10627 return false;
10628 }
10629 if (itemQBIndex != -1 && player)
10630 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10631 }
10632 }
10633
10634 if (version < 140)
10635 {
10636
10637 if (!LoadVariables(ctx, version))
10638 {
10640 return false;
10641 }
10642 }
10643
10644
10646 {
10648 return false;
10649 }
10650 if (version >= 132)
10651 {
10653 if (raib)
10654 {
10656 {
10658 return false;
10659 }
10660 }
10661 }
10662
10664 return true;
10665 }
10666
10667
10668
10670 {
10671 super.OnStoreSave(ctx);
10672
10673 PlayerBase player;
10674 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10675 {
10677
10678 int itemQBIndex = -1;
10679 itemQBIndex = player.FindQuickBarEntityIndex(this);
10680 ctx.
Write(itemQBIndex);
10681 }
10682 else
10683 {
10685 }
10686
10688
10690 if (raib)
10691 {
10693 }
10694 }
10695
10696
10698 {
10699 super.AfterStoreLoad();
10700
10702 {
10704 }
10705
10707 {
10710 }
10711 }
10712
10714 {
10715 super.EEOnAfterLoad();
10716
10718 {
10720 }
10721
10724 }
10725
10727 {
10728 return false;
10729 }
10730
10731
10732
10734 {
10736 {
10737 #ifdef PLATFORM_CONSOLE
10738
10740 {
10742 if (menu)
10743 {
10745 }
10746 }
10747 #endif
10748 }
10749
10751 {
10754 }
10755
10757 {
10758 SetWeightDirty();
10760 }
10762 {
10765 }
10766
10768 {
10771 }
10773 {
10776 }
10777
10778 super.OnVariablesSynchronized();
10779 }
10780
10781
10782
10784 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10785 {
10786 if (!IsServerCheck(allow_client))
10787 return false;
10788
10790 return false;
10791
10794
10795 if (value <= (min + 0.001))
10796 value = min;
10797
10798 if (value == min)
10799 {
10800 if (destroy_config)
10801 {
10802 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10803 if (dstr)
10804 {
10806 this.Delete();
10807 return true;
10808 }
10809 }
10810 else if (destroy_forced)
10811 {
10813 this.Delete();
10814 return true;
10815 }
10816
10818 }
10819
10822
10824 {
10826
10827 if (delta)
10829 }
10830
10832
10833 return false;
10834 }
10835
10836
10838 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10839 {
10841 }
10842
10844 {
10847 }
10848
10850 {
10853 }
10854
10857 {
10858 float value_clamped = Math.Clamp(value, 0, 1);
10860 SetQuantity(result, destroy_config, destroy_forced);
10861 }
10862
10863
10866 {
10868 }
10869
10871 {
10873 }
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10885 {
10886 int slot = -1;
10887 if (GetInventory())
10888 {
10889 InventoryLocation il = new InventoryLocation;
10890 GetInventory().GetCurrentInventoryLocation(il);
10892 }
10893
10895 }
10896
10898 {
10899 float quantity_max = 0;
10900
10902 {
10903 if (attSlotID != -1)
10904 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10905
10906 if (quantity_max <= 0)
10908 }
10909
10910 if (quantity_max <= 0)
10912
10913 return quantity_max;
10914 }
10915
10917 {
10919 }
10920
10922 {
10924 }
10925
10926
10928 {
10930 }
10931
10933 {
10935 }
10936
10938 {
10940 }
10941
10942
10944 {
10945
10946 float weightEx = GetWeightEx();
10947 float special = GetInventoryAndCargoWeight();
10948 return weightEx - special;
10949 }
10950
10951
10953 {
10955 }
10956
10958 {
10960 {
10961 #ifdef DEVELOPER
10962 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10963 {
10964 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10966 }
10967 #endif
10968
10969 return GetQuantity() * GetConfigWeightModified();
10970 }
10971 else if (HasEnergyManager())
10972 {
10973 #ifdef DEVELOPER
10974 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10975 {
10976 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10977 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10978 }
10979 #endif
10980 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10981 }
10982 else
10983 {
10984 #ifdef DEVELOPER
10985 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10986 {
10987 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10988 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10989 }
10990 #endif
10991 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10992 }
10993 }
10994
10997 {
10998 int item_count = 0;
11000
11001 if (GetInventory().GetCargo() != NULL)
11002 {
11003 item_count = GetInventory().GetCargo().GetItemCount();
11004 }
11005
11006 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11007 {
11008 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11009 if (item)
11010 item_count += item.GetNumberOfItems();
11011 }
11012 return item_count;
11013 }
11014
11017 {
11018 float weight = 0;
11019 float wetness = 1;
11020 if (include_wetness)
11023 {
11024 weight = wetness * m_ConfigWeight;
11025 }
11027 {
11028 weight = 1;
11029 }
11030 return weight;
11031 }
11032
11033
11034
11036 {
11037 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11038 {
11039 GameInventory inv = GetInventory();
11040 array<EntityAI> items = new array<EntityAI>;
11042 for (int i = 0; i < items.Count(); i++)
11043 {
11045 if (item)
11046 {
11048 }
11049 }
11050 }
11051 }
11052
11053
11054
11055
11057 {
11058 float energy = 0;
11059 if (HasEnergyManager())
11060 {
11061 energy = GetCompEM().GetEnergy();
11062 }
11063 return energy;
11064 }
11065
11066
11068 {
11069 super.OnEnergyConsumed();
11070
11072 }
11073
11075 {
11076 super.OnEnergyAdded();
11077
11079 }
11080
11081
11083 {
11084 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11085 {
11087 {
11088 float energy_0to1 = GetCompEM().GetEnergy0To1();
11090 }
11091 }
11092 }
11093
11094
11096 {
11097 return ConfigGetFloat("heatIsolation");
11098 }
11099
11101 {
11103 }
11104
11106 {
11107 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11108 if (
GetGame().ConfigIsExisting(paramPath))
11110
11111 return 0.0;
11112 }
11113
11115 {
11116 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11117 if (
GetGame().ConfigIsExisting(paramPath))
11119
11120 return 0.0;
11121 }
11122
11123 override void SetWet(
float value,
bool allow_client =
false)
11124 {
11125 if (!IsServerCheck(allow_client))
11126 return;
11127
11130
11132
11133 m_VarWet = Math.Clamp(value, min, max);
11134
11136 {
11139 }
11140 }
11141
11142 override void AddWet(
float value)
11143 {
11145 }
11146
11148 {
11150 }
11151
11153 {
11155 }
11156
11158 {
11160 }
11161
11163 {
11165 }
11166
11168 {
11170 }
11171
11172 override void OnWetChanged(
float newVal,
float oldVal)
11173 {
11176 if (newLevel != oldLevel)
11177 {
11179 }
11180 }
11181
11183 {
11184 SetWeightDirty();
11185 }
11186
11188 {
11189 return GetWetLevelInternal(
m_VarWet);
11190 }
11191
11192
11193
11195 {
11197 }
11198
11200 {
11202 }
11203
11205 {
11207 }
11208
11210 {
11212 }
11213
11214
11215
11217 {
11218 if (ConfigIsExisting("itemModelLength"))
11219 {
11220 return ConfigGetFloat("itemModelLength");
11221 }
11222 return 0;
11223 }
11224
11226 {
11227 if (ConfigIsExisting("itemAttachOffset"))
11228 {
11229 return ConfigGetFloat("itemAttachOffset");
11230 }
11231 return 0;
11232 }
11233
11234 override void SetCleanness(
int value,
bool allow_client =
false)
11235 {
11236 if (!IsServerCheck(allow_client))
11237 return;
11238
11240
11242
11245 }
11246
11248 {
11250 }
11251
11253 {
11254 return true;
11255 }
11256
11257
11258
11259
11261 {
11263 }
11264
11266 {
11268 }
11269
11270
11271
11272
11273 override void SetColor(
int r,
int g,
int b,
int a)
11274 {
11280 }
11282 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11283 {
11288 }
11289
11291 {
11293 }
11294
11297 {
11298 int r,g,b,a;
11300 r = r/255;
11301 g = g/255;
11302 b = b/255;
11303 a = a/255;
11304 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11305 }
11306
11307
11308
11309 override void SetLiquidType(
int value,
bool allow_client =
false)
11310 {
11311 if (!IsServerCheck(allow_client))
11312 return;
11313
11318 }
11319
11321 {
11322 return ConfigGetInt("varLiquidTypeInit");
11323 }
11324
11326 {
11328 }
11329
11331 {
11333 SetFrozen(false);
11334 }
11335
11338 {
11339 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11340 }
11341
11342
11345 {
11346 PlayerBase nplayer;
11347 if (PlayerBase.CastTo(nplayer, player))
11348 {
11350
11351 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11352 }
11353 }
11354
11355
11358 {
11359 PlayerBase nplayer;
11360 if (PlayerBase.CastTo(nplayer,player))
11361 {
11362
11363 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11364
11365 }
11366
11367
11368 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11369
11370
11371 if (HasEnergyManager())
11372 {
11373 GetCompEM().UpdatePlugState();
11374 }
11375 }
11376
11377
11379 {
11380 super.OnPlacementStarted(player);
11381
11383 }
11384
11385 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11386 {
11388 {
11389 m_AdminLog.OnPlacementComplete(player,
this);
11390 }
11391
11392 super.OnPlacementComplete(player, position, orientation);
11393 }
11394
11395
11396
11397
11398
11400 {
11402 {
11403 return true;
11404 }
11405 else
11406 {
11407 return false;
11408 }
11409 }
11410
11411
11413 {
11415 {
11417 }
11418 }
11419
11420
11422 {
11424 }
11425
11427 {
11429 }
11430
11431 override void InsertAgent(
int agent,
float count = 1)
11432 {
11433 if (count < 1)
11434 return;
11435
11437 }
11438
11441 {
11443 }
11444
11445
11447 {
11449 }
11450
11451
11452
11453
11454
11455
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
11493 {
11495 return false;
11496 return true;
11497 }
11498
11500 {
11501
11503 }
11504
11505
11508 {
11509 super.CheckForRoofLimited(timeTresholdMS);
11510
11512 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11513 {
11514 m_PreviousRoofTestTime = time;
11515 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11516 }
11517 }
11518
11519
11521 {
11523 {
11524 return 0;
11525 }
11526
11527 if (GetInventory().GetAttachmentSlotsCount() != 0)
11528 {
11529 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11530 if (filter)
11531 return filter.GetProtectionLevel(type, false, system);
11532 else
11533 return 0;
11534 }
11535
11536 string subclassPath, entryName;
11537
11538 switch (type)
11539 {
11541 entryName = "biological";
11542 break;
11544 entryName = "chemical";
11545 break;
11546 default:
11547 entryName = "biological";
11548 break;
11549 }
11550
11551 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11552
11554 }
11555
11556
11557
11560 {
11561 if (!IsMagazine())
11563
11565 }
11566
11567
11568
11569
11570
11575 {
11576 return true;
11577 }
11578
11580 {
11582 }
11583
11584
11585
11586
11587
11589 {
11590 if (parent)
11591 {
11592 if (parent.IsInherited(DayZInfected))
11593 return true;
11594
11595 if (!parent.IsRuined())
11596 return true;
11597 }
11598
11599 return true;
11600 }
11601
11603 {
11604 if (!super.CanPutAsAttachment(parent))
11605 {
11606 return false;
11607 }
11608
11609 if (!IsRuined() && !parent.IsRuined())
11610 {
11611 return true;
11612 }
11613
11614 return false;
11615 }
11616
11618 {
11619
11620
11621
11622
11623 return super.CanReceiveItemIntoCargo(item);
11624 }
11625
11627 {
11628
11629
11630
11631
11632 GameInventory attachmentInv = attachment.GetInventory();
11634 {
11635 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11636 return false;
11637 }
11638
11639 InventoryLocation loc = new InventoryLocation();
11640 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11641 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11642 return false;
11643
11644 return super.CanReceiveAttachment(attachment, slotId);
11645 }
11646
11648 {
11649 if (!super.CanReleaseAttachment(attachment))
11650 return false;
11651
11652 return GetInventory().AreChildrenAccessible();
11653 }
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11676 {
11677 int id = muzzle_owner.GetMuzzleID();
11678 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11679
11680 if (WPOF_array)
11681 {
11682 for (int i = 0; i < WPOF_array.Count(); i++)
11683 {
11684 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11685
11686 if (WPOF)
11687 {
11688 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11689 }
11690 }
11691 }
11692 }
11693
11694
11696 {
11697 int id = muzzle_owner.GetMuzzleID();
11699
11700 if (WPOBE_array)
11701 {
11702 for (int i = 0; i < WPOBE_array.Count(); i++)
11703 {
11704 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11705
11706 if (WPOBE)
11707 {
11708 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11709 }
11710 }
11711 }
11712 }
11713
11714
11716 {
11717 int id = muzzle_owner.GetMuzzleID();
11718 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11719
11720 if (WPOOH_array)
11721 {
11722 for (int i = 0; i < WPOOH_array.Count(); i++)
11723 {
11724 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11725
11726 if (WPOOH)
11727 {
11728 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11729 }
11730 }
11731 }
11732 }
11733
11734
11736 {
11737 int id = muzzle_owner.GetMuzzleID();
11738 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11739
11740 if (WPOOH_array)
11741 {
11742 for (int i = 0; i < WPOOH_array.Count(); i++)
11743 {
11744 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11745
11746 if (WPOOH)
11747 {
11748 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11749 }
11750 }
11751 }
11752 }
11753
11754
11756 {
11757 int id = muzzle_owner.GetMuzzleID();
11758 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11759
11760 if (WPOOH_array)
11761 {
11762 for (int i = 0; i < WPOOH_array.Count(); i++)
11763 {
11764 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11765
11766 if (WPOOH)
11767 {
11768 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11769 }
11770 }
11771 }
11772 }
11773
11774
11775
11777 {
11779 {
11780 return true;
11781 }
11782
11783 return false;
11784 }
11785
11787 {
11789 {
11790 return true;
11791 }
11792
11793 return false;
11794 }
11795
11797 {
11799 {
11800 return true;
11801 }
11802
11803 return false;
11804 }
11805
11807 {
11808 return false;
11809 }
11810
11813 {
11814 return UATimeSpent.DEFAULT_DEPLOY;
11815 }
11816
11817
11818
11819
11821 {
11823 SetSynchDirty();
11824 }
11825
11827 {
11829 }
11830
11831
11833 {
11834 return false;
11835 }
11836
11839 {
11840 string att_type = "None";
11841
11842 if (ConfigIsExisting("soundAttType"))
11843 {
11844 att_type = ConfigGetString("soundAttType");
11845 }
11846
11848 }
11849
11851 {
11853 }
11854
11855
11856
11857
11858
11862
11864 {
11867
11869 }
11870
11871
11873 {
11875 return;
11876
11878
11881
11884
11885 SoundParameters params = new SoundParameters();
11889 }
11890
11891
11893 {
11895 return;
11896
11898 SetSynchDirty();
11899
11902 }
11903
11904
11906 {
11908 return;
11909
11911 SetSynchDirty();
11912
11915 }
11916
11918 {
11920 }
11921
11923 {
11925 }
11926
11929 {
11930 if (!
GetGame().IsDedicatedServer())
11931 {
11932 if (ConfigIsExisting("attachSoundSet"))
11933 {
11934 string cfg_path = "";
11935 string soundset = "";
11936 string type_name =
GetType();
11937
11940 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11941 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11942
11943 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11944 {
11945 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11946 {
11947 if (cfg_slot_array[i] == slot_type)
11948 {
11949 soundset = cfg_soundset_array[i];
11950 break;
11951 }
11952 }
11953 }
11954
11955 if (soundset != "")
11956 {
11957 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11959 }
11960 }
11961 }
11962 }
11963
11965 {
11966
11967 }
11968
11969 void OnApply(PlayerBase player);
11970
11972 {
11973 return 1.0;
11974 };
11975
11977 {
11979 }
11980
11982 {
11984 }
11985
11987
11989 {
11990 SetDynamicPhysicsLifeTime(0.01);
11992 }
11993
11995 {
11996 array<string> zone_names = new array<string>;
11997 GetDamageZones(zone_names);
11998 for (int i = 0; i < zone_names.Count(); i++)
11999 {
12000 SetHealthMax(zone_names.Get(i),"Health");
12001 }
12002 SetHealthMax("","Health");
12003 }
12004
12007 {
12008 float global_health = GetHealth01("","Health");
12009 array<string> zones = new array<string>;
12010 GetDamageZones(zones);
12011
12012 for (int i = 0; i < zones.Count(); i++)
12013 {
12014 SetHealth01(zones.Get(i),"Health",global_health);
12015 }
12016 }
12017
12020 {
12021 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12022 }
12023
12025 {
12026 if (!hasRootAsPlayer)
12027 {
12028 if (refParentIB)
12029 {
12030
12031 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12032 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12033
12034 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12035 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12036
12039 }
12040 else
12041 {
12042
12045 }
12046 }
12047 }
12048
12050 {
12052 {
12053 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12054 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12055 {
12056 float heatPermCoef = 1.0;
12058 while (ent)
12059 {
12060 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12061 ent = ent.GetHierarchyParent();
12062 }
12063
12064 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12065 }
12066 }
12067 }
12068
12070 {
12071
12072 EntityAI parent = GetHierarchyParent();
12073 if (!parent)
12074 {
12075 hasParent = false;
12076 hasRootAsPlayer = false;
12077 }
12078 else
12079 {
12080 hasParent = true;
12081 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12082 refParentIB =
ItemBase.Cast(parent);
12083 }
12084 }
12085
12086 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12087 {
12088
12089 }
12090
12092 {
12093
12094 return false;
12095 }
12096
12098 {
12099
12100
12101 return false;
12102 }
12103
12105 {
12106
12107 return false;
12108 }
12109
12112 {
12113 return !GetIsFrozen() &&
IsOpen();
12114 }
12115
12117 {
12118 bool hasParent = false, hasRootAsPlayer = false;
12120
12121 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12122 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12123
12124 if (wwtu || foodDecay)
12125 {
12129
12130 if (processWetness || processTemperature || processDecay)
12131 {
12133
12134 if (processWetness)
12135 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12136
12137 if (processTemperature)
12139
12140 if (processDecay)
12141 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12142 }
12143 }
12144 }
12145
12148 {
12150 }
12151
12153 {
12156
12157 return super.GetTemperatureFreezeThreshold();
12158 }
12159
12161 {
12164
12165 return super.GetTemperatureThawThreshold();
12166 }
12167
12169 {
12172
12173 return super.GetItemOverheatThreshold();
12174 }
12175
12177 {
12179 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12180
12181 return super.GetTemperatureFreezeTime();
12182 }
12183
12185 {
12187 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12188
12189 return super.GetTemperatureThawTime();
12190 }
12191
12196
12198 {
12199 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12200 }
12201
12203 {
12204 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12205 }
12206
12209 {
12211 }
12212
12214 {
12216 }
12217
12219 {
12221 }
12222
12225 {
12226 return null;
12227 }
12228
12231 {
12232 return false;
12233 }
12234
12236 {
12238 {
12241 if (!trg)
12242 {
12244 explosive = this;
12245 }
12246
12247 explosive.PairRemote(trg);
12249
12250 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12251 trg.SetPersistentPairID(persistentID);
12252 explosive.SetPersistentPairID(persistentID);
12253
12254 return true;
12255 }
12256 return false;
12257 }
12258
12261 {
12262 float ret = 1.0;
12265 ret *= GetHealth01();
12266
12267 return ret;
12268 }
12269
12270 #ifdef DEVELOPER
12271 override void SetDebugItem()
12272 {
12273 super.SetDebugItem();
12274 _itemBase = this;
12275 }
12276
12278 {
12279 string text = super.GetDebugText();
12280
12282 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12283
12284 return text;
12285 }
12286 #endif
12287
12289 {
12290 return true;
12291 }
12292
12294
12296
12298 {
12301 }
12302
12303
12311
12327}
12328
12330{
12332 if (entity)
12333 {
12334 bool is_item = entity.IsInherited(
ItemBase);
12335 if (is_item && full_quantity)
12336 {
12339 }
12340 }
12341 else
12342 {
12344 return NULL;
12345 }
12346 return entity;
12347}
12348
12350{
12351 if (item)
12352 {
12353 if (health > 0)
12354 item.SetHealth("", "", health);
12355
12356 if (item.CanHaveTemperature())
12357 {
12359 if (item.CanFreeze())
12360 item.SetFrozen(false);
12361 }
12362
12363 if (item.HasEnergyManager())
12364 {
12365 if (quantity >= 0)
12366 {
12367 item.GetCompEM().SetEnergy0To1(quantity);
12368 }
12369 else
12370 {
12372 }
12373 }
12374 else if (item.IsMagazine())
12375 {
12376 Magazine mag = Magazine.Cast(item);
12377 if (quantity >= 0)
12378 {
12379 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12380 }
12381 else
12382 {
12384 }
12385
12386 }
12387 else
12388 {
12389 if (quantity >= 0)
12390 {
12391 item.SetQuantityNormalized(quantity, false);
12392 }
12393 else
12394 {
12396 }
12397
12398 }
12399 }
12400}
12401
12402#ifdef DEVELOPER
12404#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.