7545{
7547 {
7548 return true;
7549 }
7550};
7551
7552
7553
7555{
7559
7561
7564
7565
7566
7567
7568
7577
7583
7588
7593
7614 protected bool m_IsResultOfSplit
7615
7617
7622
7623
7624
7626
7630
7631
7632
7634
7637
7638
7639
7645
7646
7654
7657
7658
7660
7661
7663
7664
7669
7670
7675
7676
7678
7679
7681 {
7686
7687 if (!
GetGame().IsDedicatedServer())
7688 {
7690 {
7692
7694 {
7696 }
7697 }
7698
7701 }
7702
7703 m_OldLocation = null;
7704
7706 {
7708 }
7709
7710 if (ConfigIsExisting("headSelectionsToHide"))
7711 {
7714 }
7715
7717 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7718 {
7720 }
7721
7723
7724 m_IsResultOfSplit = false;
7725
7727 }
7728
7730 {
7731 super.InitItemVariables();
7732
7738 m_Count = ConfigGetInt(
"count");
7739
7742
7747
7750
7755
7767
7771
7772
7775 if (ConfigIsExisting("canBeSplit"))
7776 {
7779 }
7780
7782 if (ConfigIsExisting("itemBehaviour"))
7784
7785
7788 RegisterNetSyncVariableInt("m_VarLiquidType");
7789 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7790
7791 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7792 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7793 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7794
7795 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7796 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7797 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7798 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7799
7800 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7801 RegisterNetSyncVariableBool("m_IsTakeable");
7802 RegisterNetSyncVariableBool("m_IsHologram");
7803
7806 {
7809 }
7810
7812
7814 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7816
7817 }
7818
7820 {
7822 }
7823
7825 {
7828 {
7833 }
7834 }
7835
7836 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7837 {
7839 {
7842 }
7843
7845 }
7846
7848 {
7854 }
7855
7857
7859 {
7861
7862 if (!action)
7863 {
7864 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7865 return;
7866 }
7867
7869 if (!ai)
7870 {
7872 return;
7873 }
7874
7876 if (!action_array)
7877 {
7878 action_array = new array<ActionBase_Basic>;
7880 }
7881 if (LogManager.IsActionLogEnable())
7882 {
7883 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7884 }
7885
7886 if (action_array.Find(action) != -1)
7887 {
7888 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7889 }
7890 else
7891 {
7892 action_array.Insert(action);
7893 }
7894 }
7895
7897 {
7899 ActionBase action = player.GetActionManager().GetAction(actionName);
7902
7903 if (action_array)
7904 {
7905 action_array.RemoveItem(action);
7906 }
7907 }
7908
7909
7910
7912 {
7913 ActionOverrideData overrideData = new ActionOverrideData();
7917
7919 if (!actionMap)
7920 {
7923 }
7924
7925 actionMap.Insert(this.
Type(), overrideData);
7926
7927 }
7928
7930
7932
7933
7935 {
7938
7941
7942 string config_to_search = "CfgVehicles";
7943 string muzzle_owner_config;
7944
7946 {
7947 if (IsInherited(Weapon))
7948 config_to_search = "CfgWeapons";
7949
7950 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7951
7952 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7953
7955
7956 if (config_OnFire_subclass_count > 0)
7957 {
7958 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7959
7960 for (int i = 0; i < config_OnFire_subclass_count; i++)
7961 {
7962 string particle_class = "";
7964 string config_OnFire_entry = config_OnFire_class + particle_class;
7965 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7966 WPOF_array.Insert(WPOF);
7967 }
7968
7969
7971 }
7972 }
7973
7975 {
7976 config_to_search = "CfgWeapons";
7977 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7978
7979 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7980
7982
7983 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7984 {
7985 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7986
7987 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7988 {
7989 string particle_class2 = "";
7991 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7992 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7993 WPOBE_array.Insert(WPOBE);
7994 }
7995
7996
7998 }
7999 }
8000 }
8001
8002
8004 {
8007
8009 {
8010 string config_to_search = "CfgVehicles";
8011
8012 if (IsInherited(Weapon))
8013 config_to_search = "CfgWeapons";
8014
8015 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8016 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8017
8018 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8019 {
8020
8022
8024 {
8026 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8028 return;
8029 }
8030
8033
8034
8035
8037 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8038
8039 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8040 {
8041 string particle_class = "";
8043 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8045
8046 if (entry_type == CT_CLASS)
8047 {
8048 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8049 WPOOH_array.Insert(WPOF);
8050 }
8051 }
8052
8053
8055 }
8056 }
8057 }
8058
8060 {
8062 }
8063
8065 {
8067 {
8069
8072
8075
8076 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8077 }
8078 }
8079
8081 {
8083 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8084
8086 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8087
8089 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8090
8092 {
8094 }
8095 }
8096
8098 {
8100 }
8101
8103 {
8106 else
8108
8110 {
8113 }
8114 else
8115 {
8118
8121 }
8122
8124 }
8125
8127 {
8129 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8130 }
8131
8133 {
8135 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8137 }
8138
8140 {
8142 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8143 }
8144
8146 {
8149
8150 OverheatingParticle OP = new OverheatingParticle();
8155
8157 }
8158
8160 {
8163
8164 return -1;
8165 }
8166
8168 {
8170 {
8173
8174 for (int i = count; i > 0; --i)
8175 {
8176 int id = i - 1;
8179
8182
8183 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8184 {
8185 if (p)
8186 {
8189 }
8190 }
8191 }
8192 }
8193 }
8194
8196 {
8198 {
8200 {
8201 int id = i - 1;
8203
8204 if (OP)
8205 {
8207
8208 if (p)
8209 {
8211 }
8212
8213 delete OP;
8214 }
8215 }
8216
8219 }
8220 }
8221
8224 {
8225 return 0.0;
8226 }
8227
8228
8230 {
8231 return 250;
8232 }
8233
8235 {
8236 return 0;
8237 }
8238
8241 {
8243 return true;
8244
8245 return false;
8246 }
8247
8250 {
8253
8255 {
8257 }
8258 else
8259 {
8260
8262 }
8263
8265 }
8266
8273 {
8274 return -1;
8275 }
8276
8277
8278
8279
8281 {
8283 {
8285 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8286
8287 if (r_index >= 0)
8288 {
8289 InventoryLocation r_il = new InventoryLocation;
8290 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8291
8292 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8295 {
8296 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8297 }
8299 {
8300 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8301 }
8302
8303 }
8304
8305 player.GetHumanInventory().ClearUserReservedLocation(this);
8306 }
8307
8310 }
8311
8312
8313
8314
8316 {
8317 return ItemBase.m_DebugActionsMask;
8318 }
8319
8321 {
8322 return ItemBase.m_DebugActionsMask & mask;
8323 }
8324
8326 {
8327 ItemBase.m_DebugActionsMask = mask;
8328 }
8329
8331 {
8332 ItemBase.m_DebugActionsMask |= mask;
8333 }
8334
8336 {
8337 ItemBase.m_DebugActionsMask &= ~mask;
8338 }
8339
8341 {
8343 {
8345 }
8346 else
8347 {
8349 }
8350 }
8351
8352
8354 {
8355 if (GetEconomyProfile())
8356 {
8357 float q_max = GetEconomyProfile().GetQuantityMax();
8358 if (q_max > 0)
8359 {
8360 float q_min = GetEconomyProfile().GetQuantityMin();
8361 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8362
8364 {
8365 ComponentEnergyManager comp = GetCompEM();
8367 {
8369 }
8370 }
8372 {
8374
8375 }
8376
8377 }
8378 }
8379 }
8380
8383 {
8384 EntityAI parent = GetHierarchyParent();
8385
8386 if (parent)
8387 {
8388 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8389 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8390 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8391 }
8392 }
8393
8396 {
8397 EntityAI parent = GetHierarchyParent();
8398
8399 if (parent)
8400 {
8401 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8402 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8403 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8404 }
8405 }
8406
8408 {
8409
8410
8411
8412
8414
8416 {
8417 if (ScriptInputUserData.CanStoreInputUserData())
8418 {
8419 ScriptInputUserData ctx = new ScriptInputUserData;
8425 ctx.
Write(use_stack_max);
8428
8430 {
8431 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8432 }
8433 }
8434 }
8435 else if (!
GetGame().IsMultiplayer())
8436 {
8438 }
8439 }
8440
8442 {
8444 }
8445
8447 {
8449 }
8450
8452 {
8454 }
8455
8457 {
8458
8459 return false;
8460 }
8461
8463 {
8464 return false;
8465 }
8466
8470 {
8471 return false;
8472 }
8473
8475 {
8476 return "";
8477 }
8478
8480
8482 {
8483 return false;
8484 }
8485
8487 {
8488 return true;
8489 }
8490
8491
8492
8494 {
8495 return true;
8496 }
8497
8499 {
8500 return true;
8501 }
8502
8504 {
8505 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8507 }
8508
8510 {
8512 }
8513
8515 {
8517 if (!is_being_placed)
8519 SetSynchDirty();
8520 }
8521
8522
8524
8526 {
8528 }
8529
8531 {
8533 }
8534
8536 {
8537 return 1;
8538 }
8539
8541 {
8542 return false;
8543 }
8544
8546 {
8548 SetSynchDirty();
8549 }
8550
8551
8552
8553
8554
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
8586 {
8587 super.OnMovedInsideCargo(container);
8588
8589 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8590 }
8591
8592 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8593 {
8594 super.EEItemLocationChanged(oldLoc,newLoc);
8595
8596 PlayerBase new_player = null;
8597 PlayerBase old_player = null;
8598
8599 if (newLoc.GetParent())
8600 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8601
8602 if (oldLoc.GetParent())
8603 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8604
8606 {
8607 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8608
8609 if (r_index >= 0)
8610 {
8611 InventoryLocation r_il = new InventoryLocation;
8612 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8613
8614 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8617 {
8618 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8619 }
8621 {
8622 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8623 }
8624
8625 }
8626 }
8627
8629 {
8630 if (new_player)
8631 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8632
8633 if (new_player == old_player)
8634 {
8635
8636 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8637 {
8639 {
8640 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8641 {
8642 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8643 }
8644 }
8645 else
8646 {
8647 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8648 }
8649 }
8650
8651 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8652 {
8653 int type = oldLoc.GetType();
8655 {
8656 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8657 }
8659 {
8660 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8661 }
8662 }
8663 if (!m_OldLocation)
8664 {
8665 m_OldLocation = new InventoryLocation;
8666 }
8667 m_OldLocation.Copy(oldLoc);
8668 }
8669 else
8670 {
8671 if (m_OldLocation)
8672 {
8673 m_OldLocation.Reset();
8674 }
8675 }
8676
8678 }
8679 else
8680 {
8681 if (new_player)
8682 {
8683 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8684 if (res_index >= 0)
8685 {
8686 InventoryLocation il = new InventoryLocation;
8687 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8689 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8692 {
8693 il.
GetParent().GetOnReleaseLock().Invoke(it);
8694 }
8696 {
8698 }
8699
8700 }
8701 }
8703 {
8704
8706 }
8707
8708 if (m_OldLocation)
8709 {
8710 m_OldLocation.Reset();
8711 }
8712 }
8713 }
8714
8715 override void EOnContact(IEntity other, Contact extra)
8716 {
8718 {
8719 int liquidType = -1;
8721 if (impactSpeed > 0.0)
8722 {
8724 #ifndef SERVER
8726 #else
8728 SetSynchDirty();
8729 #endif
8731 }
8732 }
8733
8734 #ifdef SERVER
8735 if (GetCompEM() && GetCompEM().IsPlugged())
8736 {
8737 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8738 GetCompEM().UnplugThis();
8739 }
8740 #endif
8741 }
8742
8744
8746 {
8748 }
8749
8751 {
8752
8753 }
8754
8756 {
8757 super.OnItemLocationChanged(old_owner, new_owner);
8758
8759 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8760 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8761
8762 if (!relatedPlayer && playerNew)
8763 relatedPlayer = playerNew;
8764
8765 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8766 {
8768 if (actionMgr)
8769 {
8770 ActionBase currentAction = actionMgr.GetRunningAction();
8771 if (currentAction)
8773 }
8774 }
8775
8776 Man ownerPlayerOld = null;
8777 Man ownerPlayerNew = null;
8778
8779 if (old_owner)
8780 {
8781 if (old_owner.
IsMan())
8782 {
8783 ownerPlayerOld = Man.Cast(old_owner);
8784 }
8785 else
8786 {
8787 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8788 }
8789 }
8790 else
8791 {
8793 {
8795
8796 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8797 {
8798 GetCompEM().UnplugThis();
8799 }
8800 }
8801 }
8802
8803 if (new_owner)
8804 {
8805 if (new_owner.
IsMan())
8806 {
8807 ownerPlayerNew = Man.Cast(new_owner);
8808 }
8809 else
8810 {
8811 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8812 }
8813 }
8814
8815 if (ownerPlayerOld != ownerPlayerNew)
8816 {
8817 if (ownerPlayerOld)
8818 {
8819 array<EntityAI> subItemsExit = new array<EntityAI>;
8821 for (int i = 0; i < subItemsExit.Count(); i++)
8822 {
8825 }
8826 }
8827
8828 if (ownerPlayerNew)
8829 {
8830 array<EntityAI> subItemsEnter = new array<EntityAI>;
8832 for (int j = 0; j < subItemsEnter.Count(); j++)
8833 {
8836 }
8837 }
8838 }
8839 else if (ownerPlayerNew != null)
8840 {
8841 PlayerBase nplayer;
8842 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8843 {
8844 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8846 for (int k = 0; k < subItemsUpdate.Count(); k++)
8847 {
8849 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8850 }
8851 }
8852 }
8853
8854 if (old_owner)
8855 old_owner.OnChildItemRemoved(this);
8856 if (new_owner)
8857 new_owner.OnChildItemReceived(this);
8858 }
8859
8860
8862 {
8863 super.EEDelete(parent);
8864 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8865 if (player)
8866 {
8868
8869 if (player.IsAlive())
8870 {
8871 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8872 if (r_index >= 0)
8873 {
8874 InventoryLocation r_il = new InventoryLocation;
8875 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8876
8877 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8880 {
8881 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8882 }
8884 {
8885 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8886 }
8887
8888 }
8889
8890 player.RemoveQuickBarEntityShortcut(this);
8891 }
8892 }
8893 }
8894
8896 {
8897 super.EEKilled(killer);
8898
8901 {
8902 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8903 {
8904 if (IsMagazine())
8905 {
8906 if (Magazine.Cast(this).GetAmmoCount() > 0)
8907 {
8909 }
8910 }
8911 else
8912 {
8914 }
8915 }
8916 }
8917 }
8918
8920 {
8921 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8922
8923 super.OnWasAttached(parent, slot_id);
8924
8927
8929 }
8930
8932 {
8933 super.OnWasDetached(parent, slot_id);
8934
8937 }
8938
8940 {
8941 int idx;
8944
8945 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8946 if (inventory_slots.Count() < 1)
8947 {
8948 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8949 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8950 }
8951 else
8952 {
8953 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8954 }
8955
8956 idx = inventory_slots.Find(slot);
8957 if (idx < 0)
8958 return "";
8959
8960 return attach_types.Get(idx);
8961 }
8962
8964 {
8965 int idx = -1;
8966 string slot;
8967
8970
8971 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8972 if (inventory_slots.Count() < 1)
8973 {
8974 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8975 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8976 }
8977 else
8978 {
8979 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8980 if (detach_types.Count() < 1)
8981 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8982 }
8983
8984 for (int i = 0; i < inventory_slots.Count(); i++)
8985 {
8986 slot = inventory_slots.Get(i);
8987 }
8988
8989 if (slot != "")
8990 {
8991 if (detach_types.Count() == 1)
8992 idx = 0;
8993 else
8994 idx = inventory_slots.Find(slot);
8995 }
8996 if (idx < 0)
8997 return "";
8998
8999 return detach_types.Get(idx);
9000 }
9001
9003 {
9004
9006
9007
9008 float min_time = 1;
9009 float max_time = 3;
9010 float delay = Math.RandomFloat(min_time, max_time);
9011
9012 explode_timer.Run(delay, this, "DoAmmoExplosion");
9013 }
9014
9016 {
9017 Magazine magazine = Magazine.Cast(this);
9018 int pop_sounds_count = 6;
9019 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9020
9021
9022 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9023 string sound_name = pop_sounds[ sound_idx ];
9025
9026
9027 magazine.ServerAddAmmoCount(-1);
9028
9029
9030 float min_temp_to_explode = 100;
9031
9032 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9033 {
9035 }
9036 }
9037
9038
9039 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9040 {
9041 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9042
9043 const int CHANCE_DAMAGE_CARGO = 4;
9044 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9045 const int CHANCE_DAMAGE_NOTHING = 2;
9046
9048 {
9049 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9050 int chances;
9051 int rnd;
9052
9053 if (GetInventory().GetCargo())
9054 {
9055 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9056 rnd = Math.RandomInt(0,chances);
9057
9058 if (rnd < CHANCE_DAMAGE_CARGO)
9059 {
9061 }
9062 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9063 {
9065 }
9066 }
9067 else
9068 {
9069 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9070 rnd = Math.RandomInt(0,chances);
9071
9072 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9073 {
9075 }
9076 }
9077 }
9078 }
9079
9081 {
9082 if (GetInventory().GetCargo())
9083 {
9084 int item_count = GetInventory().GetCargo().GetItemCount();
9085 if (item_count > 0)
9086 {
9087 int random_pick = Math.RandomInt(0, item_count);
9089 if (!item.IsExplosive())
9090 {
9091 item.AddHealth("","",damage);
9092 return true;
9093 }
9094 }
9095 }
9096 return false;
9097 }
9098
9100 {
9101 int attachment_count = GetInventory().AttachmentCount();
9102 if (attachment_count > 0)
9103 {
9104 int random_pick = Math.RandomInt(0, attachment_count);
9105 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9106 if (!attachment.IsExplosive())
9107 {
9108 attachment.AddHealth("","",damage);
9109 return true;
9110 }
9111 }
9112 return false;
9113 }
9114
9116 {
9118 }
9119
9121 {
9123 return GetInventory().CanRemoveEntity();
9124
9125 return false;
9126 }
9127
9129 {
9131 return;
9132
9134 {
9135 if (ScriptInputUserData.CanStoreInputUserData())
9136 {
9137 ScriptInputUserData ctx = new ScriptInputUserData;
9142 ctx.
Write(destination_entity);
9146 }
9147 }
9148 else if (!
GetGame().IsMultiplayer())
9149 {
9151 }
9152 }
9153
9155 {
9157 return;
9158
9159 float split_quantity_new;
9163 InventoryLocation loc = new InventoryLocation;
9164
9165 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9166 {
9168 split_quantity_new = stack_max;
9169 else
9171
9172 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9173 if (new_item)
9174 {
9175 new_item.SetResultOfSplit(true);
9176 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9178 new_item.SetQuantity(split_quantity_new);
9179 }
9180 }
9181 else if (destination_entity && slot_id == -1)
9182 {
9183 if (quantity > stack_max)
9184 split_quantity_new = stack_max;
9185 else
9186 split_quantity_new = quantity;
9187
9189 {
9192 }
9193
9194 if (new_item)
9195 {
9196 new_item.SetResultOfSplit(true);
9197 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9199 new_item.SetQuantity(split_quantity_new);
9200 }
9201 }
9202 else
9203 {
9204 if (stack_max != 0)
9205 {
9207 {
9209 }
9210
9211 if (split_quantity_new == 0)
9212 {
9213 if (!
GetGame().IsMultiplayer())
9214 player.PhysicalPredictiveDropItem(this);
9215 else
9216 player.ServerDropEntity(this);
9217 return;
9218 }
9219
9221
9222 if (new_item)
9223 {
9224 new_item.SetResultOfSplit(true);
9225 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9227 new_item.SetQuantity(stack_max);
9228 new_item.PlaceOnSurface();
9229 }
9230 }
9231 }
9232 }
9233
9235 {
9237 return;
9238
9239 float split_quantity_new;
9243 InventoryLocation loc = new InventoryLocation;
9244
9245 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9246 {
9248 split_quantity_new = stack_max;
9249 else
9251
9252 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9253 if (new_item)
9254 {
9255 new_item.SetResultOfSplit(true);
9256 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9258 new_item.SetQuantity(split_quantity_new);
9259 }
9260 }
9261 else if (destination_entity && slot_id == -1)
9262 {
9263 if (quantity > stack_max)
9264 split_quantity_new = stack_max;
9265 else
9266 split_quantity_new = quantity;
9267
9269 {
9272 }
9273
9274 if (new_item)
9275 {
9276 new_item.SetResultOfSplit(true);
9277 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9279 new_item.SetQuantity(split_quantity_new);
9280 }
9281 }
9282 else
9283 {
9284 if (stack_max != 0)
9285 {
9287 {
9289 }
9290
9292
9293 if (new_item)
9294 {
9295 new_item.SetResultOfSplit(true);
9296 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9298 new_item.SetQuantity(stack_max);
9299 new_item.PlaceOnSurface();
9300 }
9301 }
9302 }
9303 }
9304
9306 {
9308 return;
9309
9311 {
9312 if (ScriptInputUserData.CanStoreInputUserData())
9313 {
9314 ScriptInputUserData ctx = new ScriptInputUserData;
9319 dst.WriteToContext(ctx);
9321 }
9322 }
9323 else if (!
GetGame().IsMultiplayer())
9324 {
9326 }
9327 }
9328
9330 {
9332 return;
9333
9335 {
9336 if (ScriptInputUserData.CanStoreInputUserData())
9337 {
9338 ScriptInputUserData ctx = new ScriptInputUserData;
9343 ctx.
Write(destination_entity);
9349 }
9350 }
9351 else if (!
GetGame().IsMultiplayer())
9352 {
9354 }
9355 }
9356
9358 {
9360 }
9361
9363 {
9365 return this;
9366
9368 float split_quantity_new;
9370 if (dst.IsValid())
9371 {
9372 int slot_id = dst.GetSlot();
9374
9375 if (quantity > stack_max)
9376 split_quantity_new = stack_max;
9377 else
9378 split_quantity_new = quantity;
9379
9381
9382 if (new_item)
9383 {
9384 new_item.SetResultOfSplit(true);
9385 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9388 }
9389
9390 return new_item;
9391 }
9392
9393 return null;
9394 }
9395
9397 {
9399 return;
9400
9402 float split_quantity_new;
9404 if (destination_entity)
9405 {
9407 if (quantity > stackable)
9408 split_quantity_new = stackable;
9409 else
9410 split_quantity_new = quantity;
9411
9412 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9413 if (new_item)
9414 {
9415 new_item.SetResultOfSplit(true);
9416 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9418 new_item.SetQuantity(split_quantity_new);
9419 }
9420 }
9421 }
9422
9424 {
9426 return;
9427
9429 {
9430 if (ScriptInputUserData.CanStoreInputUserData())
9431 {
9432 ScriptInputUserData ctx = new ScriptInputUserData;
9437 ItemBase destination_entity =
this;
9438 ctx.
Write(destination_entity);
9442 }
9443 }
9444 else if (!
GetGame().IsMultiplayer())
9445 {
9447 }
9448 }
9449
9451 {
9453 return;
9454
9456 float split_quantity_new;
9458 if (player)
9459 {
9461 if (quantity > stackable)
9462 split_quantity_new = stackable;
9463 else
9464 split_quantity_new = quantity;
9465
9466 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9467 new_item =
ItemBase.Cast(in_hands);
9468 if (new_item)
9469 {
9470 new_item.SetResultOfSplit(true);
9471 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9473 new_item.SetQuantity(split_quantity_new);
9474 }
9475 }
9476 }
9477
9479 {
9481 return;
9482
9484 float split_quantity_new = Math.Floor(quantity * 0.5);
9485
9487
9488 if (new_item)
9489 {
9490 if (new_item.GetQuantityMax() < split_quantity_new)
9491 {
9492 split_quantity_new = new_item.GetQuantityMax();
9493 }
9494
9495 new_item.SetResultOfSplit(true);
9496 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9497
9499 {
9502 }
9503 else
9504 {
9507 }
9508 }
9509 }
9510
9512 {
9514 return;
9515
9517 float split_quantity_new = Math.Floor(quantity / 2);
9518
9519 InventoryLocation invloc = new InventoryLocation;
9521
9523 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9524
9525 if (new_item)
9526 {
9527 if (new_item.GetQuantityMax() < split_quantity_new)
9528 {
9529 split_quantity_new = new_item.GetQuantityMax();
9530 }
9532 {
9535 }
9536 else
9537 {
9540 }
9541 }
9542 }
9543
9546 {
9547 SetWeightDirty();
9549
9550 if (parent)
9551 parent.OnAttachmentQuantityChangedEx(this, delta);
9552
9554 {
9556 {
9558 }
9560 {
9561 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9563 }
9564 }
9565
9566 }
9567
9570 {
9571
9572 }
9573
9576 {
9578 }
9579
9581 {
9582 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9583
9585 {
9586 if (newLevel == GameConstants.STATE_RUINED)
9587 {
9589 EntityAI parent = GetHierarchyParent();
9590 if (parent && parent.IsFireplace())
9591 {
9592 CargoBase cargo = GetInventory().GetCargo();
9593 if (cargo)
9594 {
9596 {
9598 }
9599 }
9600 }
9601 }
9602
9604 {
9605
9607 return;
9608 }
9609
9610 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9611 {
9613 }
9614 }
9615 }
9616
9617
9619 {
9620 super.OnRightClick();
9621
9623 {
9625 {
9626 if (ScriptInputUserData.CanStoreInputUserData())
9627 {
9628 vector m4[4];
9630
9631 EntityAI root = GetHierarchyRoot();
9632
9633 InventoryLocation dst = new InventoryLocation;
9635 {
9636 if (root)
9637 {
9638 root.GetTransform(m4);
9640 }
9641 else
9642 GetInventory().GetCurrentInventoryLocation(dst);
9643 }
9644 else
9645 {
9647
9648
9649 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9650 {
9651 if (root)
9652 {
9653 root.GetTransform(m4);
9655 }
9656 else
9657 GetInventory().GetCurrentInventoryLocation(dst);
9658 }
9659 else
9660 {
9661 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9662 }
9663 }
9664
9665 ScriptInputUserData ctx = new ScriptInputUserData;
9673 }
9674 }
9675 else if (!
GetGame().IsMultiplayer())
9676 {
9678 }
9679 }
9680 }
9681
9682 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9683 {
9684
9685 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9686 return false;
9687
9688 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9689 return false;
9690
9691
9693 return false;
9694
9695
9696 Magazine mag = Magazine.Cast(this);
9697 if (mag)
9698 {
9699 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9700 return false;
9701
9702 if (stack_max_limit)
9703 {
9704 Magazine other_mag = Magazine.Cast(other_item);
9705 if (other_item)
9706 {
9707 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9708 return false;
9709 }
9710
9711 }
9712 }
9713 else
9714 {
9715
9717 return false;
9718
9720 return false;
9721 }
9722
9723 PlayerBase player = null;
9724 if (CastTo(player, GetHierarchyRootPlayer()))
9725 {
9726 if (player.GetInventory().HasAttachment(this))
9727 return false;
9728
9729 if (player.IsItemsToDelete())
9730 return false;
9731 }
9732
9733 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9734 return false;
9735
9736 int slotID;
9738 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9739 return false;
9740
9741 return true;
9742 }
9743
9745 {
9747 }
9748
9750 {
9751 return m_IsResultOfSplit;
9752 }
9753
9755 {
9756 m_IsResultOfSplit = value;
9757 }
9758
9760 {
9762 }
9763
9765 {
9766 float other_item_quantity = other_item.GetQuantity();
9767 float this_free_space;
9768
9770
9772
9773 if (other_item_quantity > this_free_space)
9774 {
9775 return this_free_space;
9776 }
9777 else
9778 {
9779 return other_item_quantity;
9780 }
9781 }
9782
9784 {
9786 }
9787
9789 {
9791 return;
9792
9793 if (!IsMagazine() && other_item)
9794 {
9796 if (quantity_used != 0)
9797 {
9798 float hp1 = GetHealth01("","");
9799 float hp2 = other_item.GetHealth01("","");
9800 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9801 hpResult = hpResult / (
GetQuantity() + quantity_used);
9802
9803 hpResult *= GetMaxHealth();
9804 Math.Round(hpResult);
9805 SetHealth("", "Health", hpResult);
9806
9808 other_item.AddQuantity(-quantity_used);
9809 }
9810 }
9812 }
9813
9815 {
9816 #ifdef SERVER
9817 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9818 GetHierarchyParent().IncreaseLifetimeUp();
9819 #endif
9820 };
9821
9823 {
9824 PlayerBase p = PlayerBase.Cast(player);
9825
9826 array<int> recipesIds = p.m_Recipes;
9827 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9828 if (moduleRecipesManager)
9829 {
9830 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9831 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9832 }
9833
9834 for (int i = 0;i < recipesIds.Count(); i++)
9835 {
9836 int key = recipesIds.Get(i);
9837 string recipeName = moduleRecipesManager.GetRecipeName(key);
9839 }
9840 }
9841
9842
9843 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9844 {
9845 super.GetDebugActions(outputList);
9846
9847
9852
9853
9857
9861
9862
9865
9866
9868 {
9871 }
9872
9874
9877
9881 }
9882
9883
9884
9885
9887 {
9888 super.OnAction(action_id, player, ctx);
9889 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9890 {
9891 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9892 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9893 PlayerBase p = PlayerBase.Cast(player);
9894 if (
EActions.RECIPES_RANGE_START < 1000)
9895 {
9896 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9897 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9898 }
9899 }
9900 #ifndef SERVER
9901 else if (action_id ==
EActions.WATCH_PLAYER)
9902 {
9903 PluginDeveloper.SetDeveloperItemClientEx(player);
9904 }
9905 #endif
9907 {
9908 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9909 {
9910 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9911 OnDebugButtonPressServer(id + 1);
9912 }
9913
9914 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9915 {
9916 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9918 }
9919
9920 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9921 {
9922 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9924 }
9925
9926 else if (action_id ==
EActions.ADD_QUANTITY)
9927 {
9928 if (IsMagazine())
9929 {
9930 Magazine mag = Magazine.Cast(this);
9931 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9932 }
9933 else
9934 {
9936 }
9937
9938 if (m_EM)
9939 {
9940 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9941 }
9942
9943 }
9944
9945 else if (action_id ==
EActions.REMOVE_QUANTITY)
9946 {
9947 if (IsMagazine())
9948 {
9949 Magazine mag2 = Magazine.Cast(this);
9950 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9951 }
9952 else
9953 {
9955 }
9956 if (m_EM)
9957 {
9958 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9959 }
9960
9961 }
9962
9963 else if (action_id ==
EActions.SET_QUANTITY_0)
9964 {
9966
9967 if (m_EM)
9968 {
9969 m_EM.SetEnergy(0);
9970 }
9971 }
9972
9973 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9974 {
9976
9977 if (m_EM)
9978 {
9979 m_EM.SetEnergy(m_EM.GetEnergyMax());
9980 }
9981 }
9982
9983 else if (action_id ==
EActions.ADD_HEALTH)
9984 {
9985 AddHealth("","",GetMaxHealth("","Health")/5);
9986 }
9987 else if (action_id ==
EActions.REMOVE_HEALTH)
9988 {
9989 AddHealth("","",-GetMaxHealth("","Health")/5);
9990 }
9991 else if (action_id ==
EActions.DESTROY_HEALTH)
9992 {
9993 SetHealth01("","",0);
9994 }
9995 else if (action_id ==
EActions.WATCH_ITEM)
9996 {
9998 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9999 #ifdef DEVELOPER
10000 SetDebugDeveloper_item(this);
10001 #endif
10002 }
10003
10004 else if (action_id ==
EActions.ADD_TEMPERATURE)
10005 {
10006 AddTemperature(20);
10007
10008 }
10009
10010 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10011 {
10012 AddTemperature(-20);
10013
10014 }
10015
10016 else if (action_id ==
EActions.FLIP_FROZEN)
10017 {
10018 SetFrozen(!GetIsFrozen());
10019
10020 }
10021
10022 else if (action_id ==
EActions.ADD_WETNESS)
10023 {
10025
10026 }
10027
10028 else if (action_id ==
EActions.REMOVE_WETNESS)
10029 {
10031
10032 }
10033
10034 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10035 {
10038
10039
10040 }
10041
10042 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10043 {
10046 }
10047
10048 else if (action_id ==
EActions.MAKE_SPECIAL)
10049 {
10050 auto debugParams = DebugSpawnParams.WithPlayer(player);
10051 OnDebugSpawnEx(debugParams);
10052 }
10053
10054 else if (action_id ==
EActions.DELETE)
10055 {
10056 Delete();
10057 }
10058
10059 }
10060
10061
10062 return false;
10063 }
10064
10065
10066
10067
10071
10074
10075
10076
10078 {
10079 return false;
10080 }
10081
10082
10084 {
10085 return true;
10086 }
10087
10088
10090 {
10091 return true;
10092 }
10093
10094
10095
10097 {
10098 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10100 }
10101
10104 {
10105 return null;
10106 }
10107
10109 {
10110 return false;
10111 }
10112
10114 {
10115 return false;
10116 }
10117
10121
10122
10124 {
10125 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10126 return module_repairing.CanRepair(this, item_repair_kit);
10127 }
10128
10129
10130 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10131 {
10132 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10133 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10134 }
10135
10136
10138 {
10139
10140
10141
10142
10143
10144
10145
10146
10147 return 1;
10148 }
10149
10150
10151
10153 {
10155 }
10156
10157
10158
10160 {
10162 }
10163
10164
10173 {
10174 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10175
10176 if (player)
10177 {
10178 player.MessageStatus(text);
10179 }
10180 }
10181
10182
10191 {
10192 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10193
10194 if (player)
10195 {
10196 player.MessageAction(text);
10197 }
10198 }
10199
10200
10209 {
10210 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10211
10212 if (player)
10213 {
10214 player.MessageFriendly(text);
10215 }
10216 }
10217
10218
10227 {
10228 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10229
10230 if (player)
10231 {
10232 player.MessageImportant(text);
10233 }
10234 }
10235
10237 {
10238 return true;
10239 }
10240
10241
10242 override bool KindOf(
string tag)
10243 {
10244 bool found = false;
10245 string item_name = this.
GetType();
10248
10249 int array_size = item_tag_array.Count();
10250 for (int i = 0; i < array_size; i++)
10251 {
10252 if (item_tag_array.Get(i) == tag)
10253 {
10254 found = true;
10255 break;
10256 }
10257 }
10258 return found;
10259 }
10260
10261
10263 {
10264
10265 super.OnRPC(sender, rpc_type,ctx);
10266
10267
10268 switch (rpc_type)
10269 {
10270 #ifndef SERVER
10271 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10272 Param2<bool, string> p = new Param2<bool, string>(false, "");
10273
10275 return;
10276
10277 bool play = p.param1;
10278 string soundSet = p.param2;
10279
10280 if (play)
10281 {
10283 {
10285 {
10287 }
10288 }
10289 else
10290 {
10292 }
10293 }
10294 else
10295 {
10297 }
10298
10299 break;
10300 #endif
10301
10302 }
10303
10305 {
10307 }
10308 }
10309
10310
10311
10312
10314 {
10315 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10316 return plugin.GetID(
name);
10317 }
10318
10320 {
10321 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10322 return plugin.GetName(id);
10323 }
10324
10327 {
10328
10329
10330 int varFlags;
10331 if (!ctx.
Read(varFlags))
10332 return;
10333
10334 if (varFlags & ItemVariableFlags.FLOAT)
10335 {
10337 }
10338 }
10339
10341 {
10342
10343 super.SerializeNumericalVars(floats_out);
10344
10345
10346
10348 {
10350 }
10351
10353 {
10355 }
10356
10358 {
10360 }
10361
10363 {
10368 }
10369
10371 {
10373 }
10374 }
10375
10377 {
10378
10379 super.DeSerializeNumericalVars(floats);
10380
10381
10382 int index = 0;
10383 int mask = Math.Round(floats.Get(index));
10384
10385 index++;
10386
10388 {
10390 {
10392 }
10393 else
10394 {
10395 float quantity = floats.Get(index);
10396 SetQuantity(quantity,
true,
false,
false,
false);
10397 }
10398 index++;
10399 }
10400
10402 {
10403 float wet = floats.Get(index);
10405 index++;
10406 }
10407
10409 {
10410 int liquidtype = Math.Round(floats.Get(index));
10412 index++;
10413 }
10414
10416 {
10418 index++;
10420 index++;
10422 index++;
10424 index++;
10425 }
10426
10428 {
10429 int cleanness = Math.Round(floats.Get(index));
10431 index++;
10432 }
10433 }
10434
10436 {
10437 super.WriteVarsToCTX(ctx);
10438
10439
10441 {
10443 }
10444
10446 {
10448 }
10449
10451 {
10453 }
10454
10456 {
10457 int r,g,b,a;
10463 }
10464
10466 {
10468 }
10469 }
10470
10472 {
10473 if (!super.ReadVarsFromCTX(ctx,version))
10474 return false;
10475
10476 int intValue;
10477 float value;
10478
10479 if (version < 140)
10480 {
10481 if (!ctx.
Read(intValue))
10482 return false;
10483
10484 m_VariablesMask = intValue;
10485 }
10486
10488 {
10489 if (!ctx.
Read(value))
10490 return false;
10491
10493 {
10495 }
10496 else
10497 {
10499 }
10500 }
10501
10502 if (version < 140)
10503 {
10505 {
10506 if (!ctx.
Read(value))
10507 return false;
10508 SetTemperatureDirect(value);
10509 }
10510 }
10511
10513 {
10514 if (!ctx.
Read(value))
10515 return false;
10517 }
10518
10520 {
10521 if (!ctx.
Read(intValue))
10522 return false;
10524 }
10525
10527 {
10528 int r,g,b,a;
10530 return false;
10532 return false;
10534 return false;
10536 return false;
10537
10539 }
10540
10542 {
10543 if (!ctx.
Read(intValue))
10544 return false;
10546 }
10547
10548 if (version >= 138 && version < 140)
10549 {
10551 {
10552 if (!ctx.
Read(intValue))
10553 return false;
10554 SetFrozen(intValue);
10555 }
10556 }
10557
10558 return true;
10559 }
10560
10561
10563 {
10566 {
10568 }
10569
10570 if (!super.OnStoreLoad(ctx, version))
10571 {
10573 return false;
10574 }
10575
10576 if (version >= 114)
10577 {
10578 bool hasQuickBarIndexSaved;
10579
10580 if (!ctx.
Read(hasQuickBarIndexSaved))
10581 {
10583 return false;
10584 }
10585
10586 if (hasQuickBarIndexSaved)
10587 {
10588 int itmQBIndex;
10589
10590
10591 if (!ctx.
Read(itmQBIndex))
10592 {
10594 return false;
10595 }
10596
10597 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10598 if (itmQBIndex != -1 && parentPlayer)
10599 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10600 }
10601 }
10602 else
10603 {
10604
10605 PlayerBase player;
10606 int itemQBIndex;
10607 if (version ==
int.
MAX)
10608 {
10609 if (!ctx.
Read(itemQBIndex))
10610 {
10612 return false;
10613 }
10614 }
10615 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10616 {
10617
10618 if (!ctx.
Read(itemQBIndex))
10619 {
10621 return false;
10622 }
10623 if (itemQBIndex != -1 && player)
10624 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10625 }
10626 }
10627
10628 if (version < 140)
10629 {
10630
10631 if (!LoadVariables(ctx, version))
10632 {
10634 return false;
10635 }
10636 }
10637
10638
10640 {
10642 return false;
10643 }
10644 if (version >= 132)
10645 {
10647 if (raib)
10648 {
10650 {
10652 return false;
10653 }
10654 }
10655 }
10656
10658 return true;
10659 }
10660
10661
10662
10664 {
10665 super.OnStoreSave(ctx);
10666
10667 PlayerBase player;
10668 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10669 {
10671
10672 int itemQBIndex = -1;
10673 itemQBIndex = player.FindQuickBarEntityIndex(this);
10674 ctx.
Write(itemQBIndex);
10675 }
10676 else
10677 {
10679 }
10680
10682
10684 if (raib)
10685 {
10687 }
10688 }
10689
10690
10692 {
10693 super.AfterStoreLoad();
10694
10696 {
10698 }
10699
10701 {
10704 }
10705 }
10706
10708 {
10709 super.EEOnAfterLoad();
10710
10712 {
10714 }
10715
10718 }
10719
10721 {
10722 return false;
10723 }
10724
10725
10726
10728 {
10730 {
10731 #ifdef PLATFORM_CONSOLE
10732
10734 {
10736 if (menu)
10737 {
10739 }
10740 }
10741 #endif
10742 }
10743
10745 {
10748 }
10749
10751 {
10752 SetWeightDirty();
10754 }
10756 {
10759 }
10760
10762 {
10765 }
10767 {
10770 }
10771
10772 super.OnVariablesSynchronized();
10773 }
10774
10775
10776
10778 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10779 {
10780 if (!IsServerCheck(allow_client))
10781 return false;
10782
10784 return false;
10785
10788
10789 if (value <= (min + 0.001))
10790 value = min;
10791
10792 if (value == min)
10793 {
10794 if (destroy_config)
10795 {
10796 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10797 if (dstr)
10798 {
10800 this.Delete();
10801 return true;
10802 }
10803 }
10804 else if (destroy_forced)
10805 {
10807 this.Delete();
10808 return true;
10809 }
10810
10812 }
10813
10816
10818 {
10820
10821 if (delta)
10823 }
10824
10826
10827 return false;
10828 }
10829
10830
10832 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10833 {
10835 }
10836
10838 {
10841 }
10842
10844 {
10847 }
10848
10851 {
10852 float value_clamped = Math.Clamp(value, 0, 1);
10854 SetQuantity(result, destroy_config, destroy_forced);
10855 }
10856
10857
10860 {
10862 }
10863
10865 {
10867 }
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10879 {
10880 int slot = -1;
10881 if (GetInventory())
10882 {
10883 InventoryLocation il = new InventoryLocation;
10884 GetInventory().GetCurrentInventoryLocation(il);
10886 }
10887
10889 }
10890
10892 {
10893 float quantity_max = 0;
10894
10896 {
10897 if (attSlotID != -1)
10898 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10899
10900 if (quantity_max <= 0)
10902 }
10903
10904 if (quantity_max <= 0)
10906
10907 return quantity_max;
10908 }
10909
10911 {
10913 }
10914
10916 {
10918 }
10919
10920
10922 {
10924 }
10925
10927 {
10929 }
10930
10932 {
10934 }
10935
10936
10938 {
10939
10940 float weightEx = GetWeightEx();
10941 float special = GetInventoryAndCargoWeight();
10942 return weightEx - special;
10943 }
10944
10945
10947 {
10949 }
10950
10952 {
10954 {
10955 #ifdef DEVELOPER
10956 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10957 {
10958 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10960 }
10961 #endif
10962
10963 return GetQuantity() * GetConfigWeightModified();
10964 }
10965 else if (HasEnergyManager())
10966 {
10967 #ifdef DEVELOPER
10968 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10969 {
10970 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10971 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10972 }
10973 #endif
10974 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10975 }
10976 else
10977 {
10978 #ifdef DEVELOPER
10979 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10980 {
10981 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10982 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10983 }
10984 #endif
10985 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10986 }
10987 }
10988
10991 {
10992 int item_count = 0;
10994
10995 if (GetInventory().GetCargo() != NULL)
10996 {
10997 item_count = GetInventory().GetCargo().GetItemCount();
10998 }
10999
11000 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11001 {
11002 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11003 if (item)
11004 item_count += item.GetNumberOfItems();
11005 }
11006 return item_count;
11007 }
11008
11011 {
11012 float weight = 0;
11013 float wetness = 1;
11014 if (include_wetness)
11017 {
11018 weight = wetness * m_ConfigWeight;
11019 }
11021 {
11022 weight = 1;
11023 }
11024 return weight;
11025 }
11026
11027
11028
11030 {
11031 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11032 {
11033 GameInventory inv = GetInventory();
11034 array<EntityAI> items = new array<EntityAI>;
11036 for (int i = 0; i < items.Count(); i++)
11037 {
11039 if (item)
11040 {
11042 }
11043 }
11044 }
11045 }
11046
11047
11048
11049
11051 {
11052 float energy = 0;
11053 if (HasEnergyManager())
11054 {
11055 energy = GetCompEM().GetEnergy();
11056 }
11057 return energy;
11058 }
11059
11060
11062 {
11063 super.OnEnergyConsumed();
11064
11066 }
11067
11069 {
11070 super.OnEnergyAdded();
11071
11073 }
11074
11075
11077 {
11078 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11079 {
11081 {
11082 float energy_0to1 = GetCompEM().GetEnergy0To1();
11084 }
11085 }
11086 }
11087
11088
11090 {
11091 return ConfigGetFloat("heatIsolation");
11092 }
11093
11095 {
11097 }
11098
11100 {
11101 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11102 if (
GetGame().ConfigIsExisting(paramPath))
11104
11105 return 0.0;
11106 }
11107
11109 {
11110 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11111 if (
GetGame().ConfigIsExisting(paramPath))
11113
11114 return 0.0;
11115 }
11116
11117 override void SetWet(
float value,
bool allow_client =
false)
11118 {
11119 if (!IsServerCheck(allow_client))
11120 return;
11121
11124
11126
11127 m_VarWet = Math.Clamp(value, min, max);
11128
11130 {
11133 }
11134 }
11135
11136 override void AddWet(
float value)
11137 {
11139 }
11140
11142 {
11144 }
11145
11147 {
11149 }
11150
11152 {
11154 }
11155
11157 {
11159 }
11160
11162 {
11164 }
11165
11166 override void OnWetChanged(
float newVal,
float oldVal)
11167 {
11170 if (newLevel != oldLevel)
11171 {
11173 }
11174 }
11175
11177 {
11178 SetWeightDirty();
11179 }
11180
11182 {
11183 return GetWetLevelInternal(
m_VarWet);
11184 }
11185
11186
11187
11189 {
11191 }
11192
11194 {
11196 }
11197
11199 {
11201 }
11202
11204 {
11206 }
11207
11208
11209
11211 {
11212 if (ConfigIsExisting("itemModelLength"))
11213 {
11214 return ConfigGetFloat("itemModelLength");
11215 }
11216 return 0;
11217 }
11218
11220 {
11221 if (ConfigIsExisting("itemAttachOffset"))
11222 {
11223 return ConfigGetFloat("itemAttachOffset");
11224 }
11225 return 0;
11226 }
11227
11228 override void SetCleanness(
int value,
bool allow_client =
false)
11229 {
11230 if (!IsServerCheck(allow_client))
11231 return;
11232
11234
11236
11239 }
11240
11242 {
11244 }
11245
11247 {
11248 return true;
11249 }
11250
11251
11252
11253
11255 {
11257 }
11258
11260 {
11262 }
11263
11264
11265
11266
11267 override void SetColor(
int r,
int g,
int b,
int a)
11268 {
11274 }
11276 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11277 {
11282 }
11283
11285 {
11287 }
11288
11291 {
11292 int r,g,b,a;
11294 r = r/255;
11295 g = g/255;
11296 b = b/255;
11297 a = a/255;
11298 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11299 }
11300
11301
11302
11303 override void SetLiquidType(
int value,
bool allow_client =
false)
11304 {
11305 if (!IsServerCheck(allow_client))
11306 return;
11307
11312 }
11313
11315 {
11316 return ConfigGetInt("varLiquidTypeInit");
11317 }
11318
11320 {
11322 }
11323
11325 {
11327 SetFrozen(false);
11328 }
11329
11332 {
11333 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11334 }
11335
11336
11339 {
11340 PlayerBase nplayer;
11341 if (PlayerBase.CastTo(nplayer, player))
11342 {
11344
11345 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11346 }
11347 }
11348
11349
11352 {
11353 PlayerBase nplayer;
11354 if (PlayerBase.CastTo(nplayer,player))
11355 {
11356
11357 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11358
11359 }
11360
11361
11362 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11363
11364
11365 if (HasEnergyManager())
11366 {
11367 GetCompEM().UpdatePlugState();
11368 }
11369 }
11370
11371
11373 {
11374 super.OnPlacementStarted(player);
11375
11377 }
11378
11379 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11380 {
11382 {
11383 m_AdminLog.OnPlacementComplete(player,
this);
11384 }
11385
11386 super.OnPlacementComplete(player, position, orientation);
11387 }
11388
11389
11390
11391
11392
11394 {
11396 {
11397 return true;
11398 }
11399 else
11400 {
11401 return false;
11402 }
11403 }
11404
11405
11407 {
11409 {
11411 }
11412 }
11413
11414
11416 {
11418 }
11419
11421 {
11423 }
11424
11425 override void InsertAgent(
int agent,
float count = 1)
11426 {
11427 if (count < 1)
11428 return;
11429
11431 }
11432
11435 {
11437 }
11438
11439
11441 {
11443 }
11444
11445
11446
11447
11448
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
11487 {
11489 return false;
11490 return true;
11491 }
11492
11494 {
11495
11497 }
11498
11499
11502 {
11503 super.CheckForRoofLimited(timeTresholdMS);
11504
11506 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11507 {
11508 m_PreviousRoofTestTime = time;
11509 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11510 }
11511 }
11512
11513
11515 {
11517 {
11518 return 0;
11519 }
11520
11521 if (GetInventory().GetAttachmentSlotsCount() != 0)
11522 {
11523 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11524 if (filter)
11525 return filter.GetProtectionLevel(type, false, system);
11526 else
11527 return 0;
11528 }
11529
11530 string subclassPath, entryName;
11531
11532 switch (type)
11533 {
11535 entryName = "biological";
11536 break;
11538 entryName = "chemical";
11539 break;
11540 default:
11541 entryName = "biological";
11542 break;
11543 }
11544
11545 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11546
11548 }
11549
11550
11551
11554 {
11555 if (!IsMagazine())
11557
11559 }
11560
11561
11562
11563
11564
11569 {
11570 return true;
11571 }
11572
11574 {
11576 }
11577
11578
11579
11580
11581
11583 {
11584 if (parent)
11585 {
11586 if (parent.IsInherited(DayZInfected))
11587 return true;
11588
11589 if (!parent.IsRuined())
11590 return true;
11591 }
11592
11593 return true;
11594 }
11595
11597 {
11598 if (!super.CanPutAsAttachment(parent))
11599 {
11600 return false;
11601 }
11602
11603 if (!IsRuined() && !parent.IsRuined())
11604 {
11605 return true;
11606 }
11607
11608 return false;
11609 }
11610
11612 {
11613
11614
11615
11616
11617 return super.CanReceiveItemIntoCargo(item);
11618 }
11619
11621 {
11622
11623
11624
11625
11626 GameInventory attachmentInv = attachment.GetInventory();
11628 {
11629 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11630 return false;
11631 }
11632
11633 InventoryLocation loc = new InventoryLocation();
11634 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11635 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11636 return false;
11637
11638 return super.CanReceiveAttachment(attachment, slotId);
11639 }
11640
11642 {
11643 if (!super.CanReleaseAttachment(attachment))
11644 return false;
11645
11646 return GetInventory().AreChildrenAccessible();
11647 }
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11670 {
11671 int id = muzzle_owner.GetMuzzleID();
11672 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11673
11674 if (WPOF_array)
11675 {
11676 for (int i = 0; i < WPOF_array.Count(); i++)
11677 {
11678 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11679
11680 if (WPOF)
11681 {
11682 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11683 }
11684 }
11685 }
11686 }
11687
11688
11690 {
11691 int id = muzzle_owner.GetMuzzleID();
11693
11694 if (WPOBE_array)
11695 {
11696 for (int i = 0; i < WPOBE_array.Count(); i++)
11697 {
11698 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11699
11700 if (WPOBE)
11701 {
11702 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11703 }
11704 }
11705 }
11706 }
11707
11708
11710 {
11711 int id = muzzle_owner.GetMuzzleID();
11712 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11713
11714 if (WPOOH_array)
11715 {
11716 for (int i = 0; i < WPOOH_array.Count(); i++)
11717 {
11718 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11719
11720 if (WPOOH)
11721 {
11722 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11723 }
11724 }
11725 }
11726 }
11727
11728
11730 {
11731 int id = muzzle_owner.GetMuzzleID();
11732 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11733
11734 if (WPOOH_array)
11735 {
11736 for (int i = 0; i < WPOOH_array.Count(); i++)
11737 {
11738 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11739
11740 if (WPOOH)
11741 {
11742 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11743 }
11744 }
11745 }
11746 }
11747
11748
11750 {
11751 int id = muzzle_owner.GetMuzzleID();
11752 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11753
11754 if (WPOOH_array)
11755 {
11756 for (int i = 0; i < WPOOH_array.Count(); i++)
11757 {
11758 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11759
11760 if (WPOOH)
11761 {
11762 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11763 }
11764 }
11765 }
11766 }
11767
11768
11769
11771 {
11773 {
11774 return true;
11775 }
11776
11777 return false;
11778 }
11779
11781 {
11783 {
11784 return true;
11785 }
11786
11787 return false;
11788 }
11789
11791 {
11793 {
11794 return true;
11795 }
11796
11797 return false;
11798 }
11799
11801 {
11802 return false;
11803 }
11804
11807 {
11808 return UATimeSpent.DEFAULT_DEPLOY;
11809 }
11810
11811
11812
11813
11815 {
11817 SetSynchDirty();
11818 }
11819
11821 {
11823 }
11824
11825
11827 {
11828 return false;
11829 }
11830
11833 {
11834 string att_type = "None";
11835
11836 if (ConfigIsExisting("soundAttType"))
11837 {
11838 att_type = ConfigGetString("soundAttType");
11839 }
11840
11842 }
11843
11845 {
11847 }
11848
11849
11850
11851
11852
11856
11858 {
11861
11863 }
11864
11865
11867 {
11869 return;
11870
11872
11875
11878
11879 SoundParameters params = new SoundParameters();
11883 }
11884
11885
11887 {
11889 return;
11890
11892 SetSynchDirty();
11893
11896 }
11897
11898
11900 {
11902 return;
11903
11905 SetSynchDirty();
11906
11909 }
11910
11912 {
11914 }
11915
11917 {
11919 }
11920
11923 {
11924 if (!
GetGame().IsDedicatedServer())
11925 {
11926 if (ConfigIsExisting("attachSoundSet"))
11927 {
11928 string cfg_path = "";
11929 string soundset = "";
11930 string type_name =
GetType();
11931
11934 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11935 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11936
11937 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11938 {
11939 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11940 {
11941 if (cfg_slot_array[i] == slot_type)
11942 {
11943 soundset = cfg_soundset_array[i];
11944 break;
11945 }
11946 }
11947 }
11948
11949 if (soundset != "")
11950 {
11951 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11953 }
11954 }
11955 }
11956 }
11957
11959 {
11960
11961 }
11962
11963 void OnApply(PlayerBase player);
11964
11966 {
11967 return 1.0;
11968 };
11969
11971 {
11973 }
11974
11976 {
11978 }
11979
11981
11983 {
11984 SetDynamicPhysicsLifeTime(0.01);
11986 }
11987
11989 {
11990 array<string> zone_names = new array<string>;
11991 GetDamageZones(zone_names);
11992 for (int i = 0; i < zone_names.Count(); i++)
11993 {
11994 SetHealthMax(zone_names.Get(i),"Health");
11995 }
11996 SetHealthMax("","Health");
11997 }
11998
12001 {
12002 float global_health = GetHealth01("","Health");
12003 array<string> zones = new array<string>;
12004 GetDamageZones(zones);
12005
12006 for (int i = 0; i < zones.Count(); i++)
12007 {
12008 SetHealth01(zones.Get(i),"Health",global_health);
12009 }
12010 }
12011
12014 {
12015 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12016 }
12017
12019 {
12020 if (!hasRootAsPlayer)
12021 {
12022 if (refParentIB)
12023 {
12024
12025 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12026 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12027
12028 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12029 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12030
12033 }
12034 else
12035 {
12036
12039 }
12040 }
12041 }
12042
12044 {
12046 {
12047 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12048 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12049 {
12050 float heatPermCoef = 1.0;
12052 while (ent)
12053 {
12054 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12055 ent = ent.GetHierarchyParent();
12056 }
12057
12058 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12059 }
12060 }
12061 }
12062
12064 {
12065
12066 EntityAI parent = GetHierarchyParent();
12067 if (!parent)
12068 {
12069 hasParent = false;
12070 hasRootAsPlayer = false;
12071 }
12072 else
12073 {
12074 hasParent = true;
12075 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12076 refParentIB =
ItemBase.Cast(parent);
12077 }
12078 }
12079
12080 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12081 {
12082
12083 }
12084
12086 {
12087
12088 return false;
12089 }
12090
12092 {
12093
12094
12095 return false;
12096 }
12097
12099 {
12100
12101 return false;
12102 }
12103
12106 {
12107 return !GetIsFrozen() &&
IsOpen();
12108 }
12109
12111 {
12112 bool hasParent = false, hasRootAsPlayer = false;
12114
12115 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12116 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12117
12118 if (wwtu || foodDecay)
12119 {
12123
12124 if (processWetness || processTemperature || processDecay)
12125 {
12127
12128 if (processWetness)
12129 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12130
12131 if (processTemperature)
12133
12134 if (processDecay)
12135 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12136 }
12137 }
12138 }
12139
12142 {
12144 }
12145
12147 {
12150
12151 return super.GetTemperatureFreezeThreshold();
12152 }
12153
12155 {
12158
12159 return super.GetTemperatureThawThreshold();
12160 }
12161
12163 {
12166
12167 return super.GetItemOverheatThreshold();
12168 }
12169
12171 {
12173 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12174
12175 return super.GetTemperatureFreezeTime();
12176 }
12177
12179 {
12181 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12182
12183 return super.GetTemperatureThawTime();
12184 }
12185
12190
12192 {
12193 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12194 }
12195
12197 {
12198 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12199 }
12200
12203 {
12205 }
12206
12208 {
12210 }
12211
12213 {
12215 }
12216
12219 {
12220 return null;
12221 }
12222
12225 {
12226 return false;
12227 }
12228
12230 {
12232 {
12235 if (!trg)
12236 {
12238 explosive = this;
12239 }
12240
12241 explosive.PairRemote(trg);
12243
12244 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12245 trg.SetPersistentPairID(persistentID);
12246 explosive.SetPersistentPairID(persistentID);
12247
12248 return true;
12249 }
12250 return false;
12251 }
12252
12255 {
12256 float ret = 1.0;
12259 ret *= GetHealth01();
12260
12261 return ret;
12262 }
12263
12264 #ifdef DEVELOPER
12265 override void SetDebugItem()
12266 {
12267 super.SetDebugItem();
12268 _itemBase = this;
12269 }
12270
12272 {
12273 string text = super.GetDebugText();
12274
12276 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12277
12278 return text;
12279 }
12280 #endif
12281
12283 {
12284 return true;
12285 }
12286
12288
12290
12292 {
12295 }
12296
12297
12305
12321}
12322
12324{
12326 if (entity)
12327 {
12328 bool is_item = entity.IsInherited(
ItemBase);
12329 if (is_item && full_quantity)
12330 {
12333 }
12334 }
12335 else
12336 {
12338 return NULL;
12339 }
12340 return entity;
12341}
12342
12344{
12345 if (item)
12346 {
12347 if (health > 0)
12348 item.SetHealth("", "", health);
12349
12350 if (item.CanHaveTemperature())
12351 {
12353 if (item.CanFreeze())
12354 item.SetFrozen(false);
12355 }
12356
12357 if (item.HasEnergyManager())
12358 {
12359 if (quantity >= 0)
12360 {
12361 item.GetCompEM().SetEnergy0To1(quantity);
12362 }
12363 else
12364 {
12366 }
12367 }
12368 else if (item.IsMagazine())
12369 {
12370 Magazine mag = Magazine.Cast(item);
12371 if (quantity >= 0)
12372 {
12373 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12374 }
12375 else
12376 {
12378 }
12379
12380 }
12381 else
12382 {
12383 if (quantity >= 0)
12384 {
12385 item.SetQuantityNormalized(quantity, false);
12386 }
12387 else
12388 {
12390 }
12391
12392 }
12393 }
12394}
12395
12396#ifdef DEVELOPER
12398#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.