7616{
7618 {
7619 return true;
7620 }
7621};
7622
7623
7624
7626{
7630
7632
7635
7636
7637
7638
7639
7648
7654
7659
7664
7685 protected bool m_IsResultOfSplit
7686
7688
7693
7694
7695
7697
7701
7702
7703
7705
7708
7709
7710
7716
7717
7725
7728
7729
7731
7732
7734
7735
7740
7741
7746
7747
7749
7750
7752 {
7757
7758 if (!
GetGame().IsDedicatedServer())
7759 {
7761 {
7763
7765 {
7767 }
7768 }
7769
7772 }
7773
7774 m_OldLocation = null;
7775
7777 {
7779 }
7780
7781 if (ConfigIsExisting("headSelectionsToHide"))
7782 {
7785 }
7786
7788 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7789 {
7791 }
7792
7794
7795 m_IsResultOfSplit = false;
7796
7798 }
7799
7801 {
7802 super.InitItemVariables();
7803
7809 m_Count = ConfigGetInt(
"count");
7810
7813
7818
7821
7826
7838
7842
7843
7846 if (ConfigIsExisting("canBeSplit"))
7847 {
7850 }
7851
7853 if (ConfigIsExisting("itemBehaviour"))
7855
7856
7859 RegisterNetSyncVariableInt("m_VarLiquidType");
7860 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7861
7862 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7863 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7864 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7865
7866 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7867 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7868 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7869 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7870
7871 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7872 RegisterNetSyncVariableBool("m_IsTakeable");
7873 RegisterNetSyncVariableBool("m_IsHologram");
7874
7877 {
7880 }
7881
7883
7885 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7887
7888 }
7889
7891 {
7893 }
7894
7896 {
7899 {
7904 }
7905 }
7906
7907 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7908 {
7910 {
7913 }
7914
7916 }
7917
7919 {
7925 }
7926
7928
7930 {
7932
7933 if (!action)
7934 {
7935 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7936 return;
7937 }
7938
7940 if (!ai)
7941 {
7943 return;
7944 }
7945
7947 if (!action_array)
7948 {
7949 action_array = new array<ActionBase_Basic>;
7951 }
7952 if (LogManager.IsActionLogEnable())
7953 {
7954 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7955 }
7956
7957 if (action_array.Find(action) != -1)
7958 {
7959 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7960 }
7961 else
7962 {
7963 action_array.Insert(action);
7964 }
7965 }
7966
7968 {
7970 ActionBase action = player.GetActionManager().GetAction(actionName);
7973
7974 if (action_array)
7975 {
7976 action_array.RemoveItem(action);
7977 }
7978 }
7979
7980
7981
7983 {
7984 ActionOverrideData overrideData = new ActionOverrideData();
7988
7990 if (!actionMap)
7991 {
7994 }
7995
7996 actionMap.Insert(this.
Type(), overrideData);
7997
7998 }
7999
8001
8003
8004
8006 {
8009
8012
8013 string config_to_search = "CfgVehicles";
8014 string muzzle_owner_config;
8015
8017 {
8018 if (IsInherited(Weapon))
8019 config_to_search = "CfgWeapons";
8020
8021 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8022
8023 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8024
8026
8027 if (config_OnFire_subclass_count > 0)
8028 {
8029 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8030
8031 for (int i = 0; i < config_OnFire_subclass_count; i++)
8032 {
8033 string particle_class = "";
8035 string config_OnFire_entry = config_OnFire_class + particle_class;
8036 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8037 WPOF_array.Insert(WPOF);
8038 }
8039
8040
8042 }
8043 }
8044
8046 {
8047 config_to_search = "CfgWeapons";
8048 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8049
8050 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8051
8053
8054 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8055 {
8056 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8057
8058 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8059 {
8060 string particle_class2 = "";
8062 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8063 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8064 WPOBE_array.Insert(WPOBE);
8065 }
8066
8067
8069 }
8070 }
8071 }
8072
8073
8075 {
8078
8080 {
8081 string config_to_search = "CfgVehicles";
8082
8083 if (IsInherited(Weapon))
8084 config_to_search = "CfgWeapons";
8085
8086 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8087 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8088
8089 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8090 {
8091
8093
8095 {
8097 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8099 return;
8100 }
8101
8104
8105
8106
8108 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8109
8110 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8111 {
8112 string particle_class = "";
8114 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8116
8117 if (entry_type == CT_CLASS)
8118 {
8119 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8120 WPOOH_array.Insert(WPOF);
8121 }
8122 }
8123
8124
8126 }
8127 }
8128 }
8129
8131 {
8133 }
8134
8136 {
8138 {
8140
8143
8146
8147 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8148 }
8149 }
8150
8152 {
8154 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8155
8157 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8158
8160 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8161
8163 {
8165 }
8166 }
8167
8169 {
8171 }
8172
8174 {
8177 else
8179
8181 {
8184 }
8185 else
8186 {
8189
8192 }
8193
8195 }
8196
8198 {
8200 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8201 }
8202
8204 {
8206 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8208 }
8209
8211 {
8213 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8214 }
8215
8217 {
8220
8221 OverheatingParticle OP = new OverheatingParticle();
8226
8228 }
8229
8231 {
8234
8235 return -1;
8236 }
8237
8239 {
8241 {
8244
8245 for (int i = count; i > 0; --i)
8246 {
8247 int id = i - 1;
8250
8253
8254 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8255 {
8256 if (p)
8257 {
8260 }
8261 }
8262 }
8263 }
8264 }
8265
8267 {
8269 {
8271 {
8272 int id = i - 1;
8274
8275 if (OP)
8276 {
8278
8279 if (p)
8280 {
8282 }
8283
8284 delete OP;
8285 }
8286 }
8287
8290 }
8291 }
8292
8295 {
8296 return 0.0;
8297 }
8298
8299
8301 {
8302 return 250;
8303 }
8304
8306 {
8307 return 0;
8308 }
8309
8312 {
8314 return true;
8315
8316 return false;
8317 }
8318
8321 {
8324
8326 {
8328 }
8329 else
8330 {
8331
8333 }
8334
8336 }
8337
8344 {
8345 return -1;
8346 }
8347
8348
8349
8350
8352 {
8354 {
8356 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8357
8358 if (r_index >= 0)
8359 {
8360 InventoryLocation r_il = new InventoryLocation;
8361 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8362
8363 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8366 {
8367 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8368 }
8370 {
8371 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8372 }
8373
8374 }
8375
8376 player.GetHumanInventory().ClearUserReservedLocation(this);
8377 }
8378
8381 }
8382
8383
8384
8385
8387 {
8388 return ItemBase.m_DebugActionsMask;
8389 }
8390
8392 {
8393 return ItemBase.m_DebugActionsMask & mask;
8394 }
8395
8397 {
8398 ItemBase.m_DebugActionsMask = mask;
8399 }
8400
8402 {
8403 ItemBase.m_DebugActionsMask |= mask;
8404 }
8405
8407 {
8408 ItemBase.m_DebugActionsMask &= ~mask;
8409 }
8410
8412 {
8414 {
8416 }
8417 else
8418 {
8420 }
8421 }
8422
8423
8425 {
8426 if (GetEconomyProfile())
8427 {
8428 float q_max = GetEconomyProfile().GetQuantityMax();
8429 if (q_max > 0)
8430 {
8431 float q_min = GetEconomyProfile().GetQuantityMin();
8432 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8433
8435 {
8436 ComponentEnergyManager comp = GetCompEM();
8438 {
8440 }
8441 }
8443 {
8445
8446 }
8447
8448 }
8449 }
8450 }
8451
8454 {
8455 EntityAI parent = GetHierarchyParent();
8456
8457 if (parent)
8458 {
8459 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8460 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8461 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8462 }
8463 }
8464
8467 {
8468 EntityAI parent = GetHierarchyParent();
8469
8470 if (parent)
8471 {
8472 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8473 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8474 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8475 }
8476 }
8477
8479 {
8480
8481
8482
8483
8485
8487 {
8488 if (ScriptInputUserData.CanStoreInputUserData())
8489 {
8490 ScriptInputUserData ctx = new ScriptInputUserData;
8496 ctx.
Write(use_stack_max);
8499
8501 {
8502 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8503 }
8504 }
8505 }
8506 else if (!
GetGame().IsMultiplayer())
8507 {
8509 }
8510 }
8511
8513 {
8515 }
8516
8518 {
8520 }
8521
8523 {
8525 }
8526
8528 {
8529
8530 return false;
8531 }
8532
8534 {
8535 return false;
8536 }
8537
8541 {
8542 return false;
8543 }
8544
8546 {
8547 return "";
8548 }
8549
8551
8553 {
8554 return false;
8555 }
8556
8558 {
8559 return true;
8560 }
8561
8562
8563
8565 {
8566 return true;
8567 }
8568
8570 {
8571 return true;
8572 }
8573
8575 {
8576 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8578 }
8579
8581 {
8583 }
8584
8586 {
8588 if (!is_being_placed)
8590 SetSynchDirty();
8591 }
8592
8593
8595
8597 {
8599 }
8600
8602 {
8604 }
8605
8607 {
8608 return 1;
8609 }
8610
8612 {
8613 return false;
8614 }
8615
8617 {
8619 SetSynchDirty();
8620 }
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8657 {
8658 super.OnMovedInsideCargo(container);
8659
8660 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8661 }
8662
8663 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8664 {
8665 super.EEItemLocationChanged(oldLoc,newLoc);
8666
8667 PlayerBase new_player = null;
8668 PlayerBase old_player = null;
8669
8670 if (newLoc.GetParent())
8671 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8672
8673 if (oldLoc.GetParent())
8674 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8675
8677 {
8678 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8679
8680 if (r_index >= 0)
8681 {
8682 InventoryLocation r_il = new InventoryLocation;
8683 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8684
8685 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8688 {
8689 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8690 }
8692 {
8693 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8694 }
8695
8696 }
8697 }
8698
8700 {
8701 if (new_player)
8702 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8703
8704 if (new_player == old_player)
8705 {
8706
8707 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8708 {
8710 {
8711 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8712 {
8713 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8714 }
8715 }
8716 else
8717 {
8718 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8719 }
8720 }
8721
8722 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8723 {
8724 int type = oldLoc.GetType();
8726 {
8727 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8728 }
8730 {
8731 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8732 }
8733 }
8734 if (!m_OldLocation)
8735 {
8736 m_OldLocation = new InventoryLocation;
8737 }
8738 m_OldLocation.Copy(oldLoc);
8739 }
8740 else
8741 {
8742 if (m_OldLocation)
8743 {
8744 m_OldLocation.Reset();
8745 }
8746 }
8747
8749 }
8750 else
8751 {
8752 if (new_player)
8753 {
8754 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8755 if (res_index >= 0)
8756 {
8757 InventoryLocation il = new InventoryLocation;
8758 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8760 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8763 {
8764 il.
GetParent().GetOnReleaseLock().Invoke(it);
8765 }
8767 {
8769 }
8770
8771 }
8772 }
8774 {
8775
8777 }
8778
8779 if (m_OldLocation)
8780 {
8781 m_OldLocation.Reset();
8782 }
8783 }
8784 }
8785
8786 override void EOnContact(IEntity other, Contact extra)
8787 {
8789 {
8790 int liquidType = -1;
8792 if (impactSpeed > 0.0)
8793 {
8795 #ifndef SERVER
8797 #else
8799 SetSynchDirty();
8800 #endif
8802 }
8803 }
8804
8805 #ifdef SERVER
8806 if (GetCompEM() && GetCompEM().IsPlugged())
8807 {
8808 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8809 GetCompEM().UnplugThis();
8810 }
8811 #endif
8812 }
8813
8815
8817 {
8819 }
8820
8822 {
8823
8824 }
8825
8827 {
8828 super.OnItemLocationChanged(old_owner, new_owner);
8829
8830 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8831 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8832
8833 if (!relatedPlayer && playerNew)
8834 relatedPlayer = playerNew;
8835
8836 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8837 {
8839 if (actionMgr)
8840 {
8841 ActionBase currentAction = actionMgr.GetRunningAction();
8842 if (currentAction)
8844 }
8845 }
8846
8847 Man ownerPlayerOld = null;
8848 Man ownerPlayerNew = null;
8849
8850 if (old_owner)
8851 {
8852 if (old_owner.
IsMan())
8853 {
8854 ownerPlayerOld = Man.Cast(old_owner);
8855 }
8856 else
8857 {
8858 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8859 }
8860 }
8861 else
8862 {
8864 {
8866
8867 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8868 {
8869 GetCompEM().UnplugThis();
8870 }
8871 }
8872 }
8873
8874 if (new_owner)
8875 {
8876 if (new_owner.
IsMan())
8877 {
8878 ownerPlayerNew = Man.Cast(new_owner);
8879 }
8880 else
8881 {
8882 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8883 }
8884 }
8885
8886 if (ownerPlayerOld != ownerPlayerNew)
8887 {
8888 if (ownerPlayerOld)
8889 {
8890 array<EntityAI> subItemsExit = new array<EntityAI>;
8892 for (int i = 0; i < subItemsExit.Count(); i++)
8893 {
8896 }
8897 }
8898
8899 if (ownerPlayerNew)
8900 {
8901 array<EntityAI> subItemsEnter = new array<EntityAI>;
8903 for (int j = 0; j < subItemsEnter.Count(); j++)
8904 {
8907 }
8908 }
8909 }
8910 else if (ownerPlayerNew != null)
8911 {
8912 PlayerBase nplayer;
8913 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8914 {
8915 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8917 for (int k = 0; k < subItemsUpdate.Count(); k++)
8918 {
8920 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8921 }
8922 }
8923 }
8924
8925 if (old_owner)
8926 old_owner.OnChildItemRemoved(this);
8927 if (new_owner)
8928 new_owner.OnChildItemReceived(this);
8929 }
8930
8931
8933 {
8934 super.EEDelete(parent);
8935 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8936 if (player)
8937 {
8939
8940 if (player.IsAlive())
8941 {
8942 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8943 if (r_index >= 0)
8944 {
8945 InventoryLocation r_il = new InventoryLocation;
8946 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8947
8948 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8951 {
8952 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8953 }
8955 {
8956 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8957 }
8958
8959 }
8960
8961 player.RemoveQuickBarEntityShortcut(this);
8962 }
8963 }
8964 }
8965
8967 {
8968 super.EEKilled(killer);
8969
8972 {
8973 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8974 {
8975 if (IsMagazine())
8976 {
8977 if (Magazine.Cast(this).GetAmmoCount() > 0)
8978 {
8980 }
8981 }
8982 else
8983 {
8985 }
8986 }
8987 }
8988 }
8989
8991 {
8992 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8993
8994 super.OnWasAttached(parent, slot_id);
8995
8998
9000 }
9001
9003 {
9004 super.OnWasDetached(parent, slot_id);
9005
9008 }
9009
9011 {
9012 int idx;
9015
9016 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9017 if (inventory_slots.Count() < 1)
9018 {
9019 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9020 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9021 }
9022 else
9023 {
9024 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9025 }
9026
9027 idx = inventory_slots.Find(slot);
9028 if (idx < 0)
9029 return "";
9030
9031 return attach_types.Get(idx);
9032 }
9033
9035 {
9036 int idx = -1;
9037 string slot;
9038
9041
9042 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9043 if (inventory_slots.Count() < 1)
9044 {
9045 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9046 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9047 }
9048 else
9049 {
9050 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9051 if (detach_types.Count() < 1)
9052 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9053 }
9054
9055 for (int i = 0; i < inventory_slots.Count(); i++)
9056 {
9057 slot = inventory_slots.Get(i);
9058 }
9059
9060 if (slot != "")
9061 {
9062 if (detach_types.Count() == 1)
9063 idx = 0;
9064 else
9065 idx = inventory_slots.Find(slot);
9066 }
9067 if (idx < 0)
9068 return "";
9069
9070 return detach_types.Get(idx);
9071 }
9072
9074 {
9075
9077
9078
9079 float min_time = 1;
9080 float max_time = 3;
9081 float delay = Math.RandomFloat(min_time, max_time);
9082
9083 explode_timer.Run(delay, this, "DoAmmoExplosion");
9084 }
9085
9087 {
9088 Magazine magazine = Magazine.Cast(this);
9089 int pop_sounds_count = 6;
9090 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9091
9092
9093 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9094 string sound_name = pop_sounds[ sound_idx ];
9096
9097
9098 magazine.ServerAddAmmoCount(-1);
9099
9100
9101 float min_temp_to_explode = 100;
9102
9103 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9104 {
9106 }
9107 }
9108
9109
9110 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9111 {
9112 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9113
9114 const int CHANCE_DAMAGE_CARGO = 4;
9115 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9116 const int CHANCE_DAMAGE_NOTHING = 2;
9117
9119 {
9120 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9121 int chances;
9122 int rnd;
9123
9124 if (GetInventory().GetCargo())
9125 {
9126 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9127 rnd = Math.RandomInt(0,chances);
9128
9129 if (rnd < CHANCE_DAMAGE_CARGO)
9130 {
9132 }
9133 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9134 {
9136 }
9137 }
9138 else
9139 {
9140 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9141 rnd = Math.RandomInt(0,chances);
9142
9143 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9144 {
9146 }
9147 }
9148 }
9149 }
9150
9152 {
9153 if (GetInventory().GetCargo())
9154 {
9155 int item_count = GetInventory().GetCargo().GetItemCount();
9156 if (item_count > 0)
9157 {
9158 int random_pick = Math.RandomInt(0, item_count);
9160 if (!item.IsExplosive())
9161 {
9162 item.AddHealth("","",damage);
9163 return true;
9164 }
9165 }
9166 }
9167 return false;
9168 }
9169
9171 {
9172 int attachment_count = GetInventory().AttachmentCount();
9173 if (attachment_count > 0)
9174 {
9175 int random_pick = Math.RandomInt(0, attachment_count);
9176 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9177 if (!attachment.IsExplosive())
9178 {
9179 attachment.AddHealth("","",damage);
9180 return true;
9181 }
9182 }
9183 return false;
9184 }
9185
9187 {
9189 }
9190
9192 {
9194 return GetInventory().CanRemoveEntity();
9195
9196 return false;
9197 }
9198
9200 {
9201
9203 return false;
9204
9205
9207 return false;
9208
9209
9210
9212 if (delta == 0)
9213 return false;
9214
9215
9216 return true;
9217 }
9218
9220 {
9222 {
9223 if (ScriptInputUserData.CanStoreInputUserData())
9224 {
9225 ScriptInputUserData ctx = new ScriptInputUserData;
9230 ctx.
Write(destination_entity);
9234 }
9235 }
9236 else if (!
GetGame().IsMultiplayer())
9237 {
9239 }
9240 }
9241
9243 {
9244 float split_quantity_new;
9248 InventoryLocation loc = new InventoryLocation;
9249
9250 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9251 {
9253 split_quantity_new = stack_max;
9254 else
9256
9258 {
9259 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9260 if (new_item)
9261 {
9262 new_item.SetResultOfSplit(true);
9263 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9265 new_item.
SetQuantity(split_quantity_new,
false,
true);
9266 }
9267 }
9268 }
9269 else if (destination_entity && slot_id == -1)
9270 {
9271 if (quantity > stack_max)
9272 split_quantity_new = stack_max;
9273 else
9274 split_quantity_new = quantity;
9275
9277 {
9279 {
9282 }
9283
9284 if (new_item)
9285 {
9286 new_item.SetResultOfSplit(true);
9287 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9289 new_item.
SetQuantity(split_quantity_new,
false,
true);
9290 }
9291 }
9292 }
9293 else
9294 {
9295 if (stack_max != 0)
9296 {
9298 {
9300 }
9301
9302 if (split_quantity_new == 0)
9303 {
9304 if (!
GetGame().IsMultiplayer())
9305 player.PhysicalPredictiveDropItem(this);
9306 else
9307 player.ServerDropEntity(this);
9308 return;
9309 }
9310
9312 {
9314
9315 if (new_item)
9316 {
9317 new_item.SetResultOfSplit(true);
9318 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9321 new_item.PlaceOnSurface();
9322 }
9323 }
9324 }
9325 }
9326 }
9327
9329 {
9330 float split_quantity_new;
9334 InventoryLocation loc = new InventoryLocation;
9335
9336 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9337 {
9339 split_quantity_new = stack_max;
9340 else
9342
9344 {
9345 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9346 if (new_item)
9347 {
9348 new_item.SetResultOfSplit(true);
9349 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9351 new_item.
SetQuantity(split_quantity_new,
false,
true);
9352 }
9353 }
9354 }
9355 else if (destination_entity && slot_id == -1)
9356 {
9357 if (quantity > stack_max)
9358 split_quantity_new = stack_max;
9359 else
9360 split_quantity_new = quantity;
9361
9363 {
9365 {
9368 }
9369
9370 if (new_item)
9371 {
9372 new_item.SetResultOfSplit(true);
9373 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9375 new_item.
SetQuantity(split_quantity_new,
false,
true);
9376 }
9377 }
9378 }
9379 else
9380 {
9381 if (stack_max != 0)
9382 {
9384 {
9386 }
9387
9389 {
9391
9392 if (new_item)
9393 {
9394 new_item.SetResultOfSplit(true);
9395 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9398 new_item.PlaceOnSurface();
9399 }
9400 }
9401 }
9402 }
9403 }
9404
9406 {
9408 {
9409 if (ScriptInputUserData.CanStoreInputUserData())
9410 {
9411 ScriptInputUserData ctx = new ScriptInputUserData;
9416 dst.WriteToContext(ctx);
9418 }
9419 }
9420 else if (!
GetGame().IsMultiplayer())
9421 {
9423 }
9424 }
9425
9427 {
9429 {
9430 if (ScriptInputUserData.CanStoreInputUserData())
9431 {
9432 ScriptInputUserData ctx = new ScriptInputUserData;
9437 ctx.
Write(destination_entity);
9443 }
9444 }
9445 else if (!
GetGame().IsMultiplayer())
9446 {
9448 }
9449 }
9450
9452 {
9454 }
9455
9457 {
9459 float split_quantity_new;
9461 if (dst.IsValid())
9462 {
9463 int slot_id = dst.GetSlot();
9465
9466 if (quantity > stack_max)
9467 split_quantity_new = stack_max;
9468 else
9469 split_quantity_new = quantity;
9470
9472 {
9474
9475 if (new_item)
9476 {
9477 new_item.SetResultOfSplit(true);
9478 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9480 new_item.
SetQuantity(split_quantity_new,
false,
true);
9481 }
9482
9483 return new_item;
9484 }
9485 }
9486
9487 return null;
9488 }
9489
9491 {
9493 float split_quantity_new;
9495 if (destination_entity)
9496 {
9498 if (quantity > stackable)
9499 split_quantity_new = stackable;
9500 else
9501 split_quantity_new = quantity;
9502
9504 {
9505 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9506 if (new_item)
9507 {
9508 new_item.SetResultOfSplit(true);
9509 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9511 new_item.
SetQuantity(split_quantity_new,
false,
true);
9512 }
9513 }
9514 }
9515 }
9516
9518 {
9520 {
9521 if (ScriptInputUserData.CanStoreInputUserData())
9522 {
9523 ScriptInputUserData ctx = new ScriptInputUserData;
9528 ItemBase destination_entity =
this;
9529 ctx.
Write(destination_entity);
9533 }
9534 }
9535 else if (!
GetGame().IsMultiplayer())
9536 {
9538 }
9539 }
9540
9542 {
9544 float split_quantity_new;
9546 if (player)
9547 {
9549 if (quantity > stackable)
9550 split_quantity_new = stackable;
9551 else
9552 split_quantity_new = quantity;
9553
9555 {
9556 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9557 new_item =
ItemBase.Cast(in_hands);
9558 if (new_item)
9559 {
9560 new_item.SetResultOfSplit(true);
9561 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9563 new_item.SetQuantity(split_quantity_new, false, true);
9564 }
9565 }
9566 }
9567 }
9568
9570 {
9572 float split_quantity_new = Math.Floor(quantity * 0.5);
9573
9575 return;
9576
9578
9579 if (new_item)
9580 {
9581 if (new_item.GetQuantityMax() < split_quantity_new)
9582 {
9583 split_quantity_new = new_item.GetQuantityMax();
9584 }
9585
9586 new_item.SetResultOfSplit(true);
9587 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9588
9590 {
9593 }
9594 else
9595 {
9597 new_item.
SetQuantity(split_quantity_new,
false,
true);
9598 }
9599 }
9600 }
9601
9603 {
9605 float split_quantity_new = Math.Floor(quantity / 2);
9606
9608 return;
9609
9610 InventoryLocation invloc = new InventoryLocation;
9612
9614 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9615
9616 if (new_item)
9617 {
9618 if (new_item.GetQuantityMax() < split_quantity_new)
9619 {
9620 split_quantity_new = new_item.GetQuantityMax();
9621 }
9623 {
9626 }
9627 else if (split_quantity_new > 1)
9628 {
9630 new_item.
SetQuantity(split_quantity_new,
false,
true);
9631 }
9632 }
9633 }
9634
9637 {
9638 SetWeightDirty();
9640
9641 if (parent)
9642 parent.OnAttachmentQuantityChangedEx(this, delta);
9643
9645 {
9647 {
9649 }
9651 {
9652 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9654 }
9655 }
9656
9657 }
9658
9661 {
9662
9663 }
9664
9667 {
9669 }
9670
9672 {
9673 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9674
9676 {
9677 if (newLevel == GameConstants.STATE_RUINED)
9678 {
9680 EntityAI parent = GetHierarchyParent();
9681 if (parent && parent.IsFireplace())
9682 {
9683 CargoBase cargo = GetInventory().GetCargo();
9684 if (cargo)
9685 {
9687 {
9689 }
9690 }
9691 }
9692 }
9693
9695 {
9696
9698 return;
9699 }
9700
9701 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9702 {
9704 }
9705 }
9706 }
9707
9708
9710 {
9711 super.OnRightClick();
9712
9714 {
9716 {
9717 if (ScriptInputUserData.CanStoreInputUserData())
9718 {
9719 EntityAI root = GetHierarchyRoot();
9720 Man playerOwner = GetHierarchyRootPlayer();
9721 InventoryLocation dst = new InventoryLocation;
9722
9723
9724 if (!playerOwner && root && root == this)
9725 {
9727 }
9728 else
9729 {
9730
9731 GetInventory().GetCurrentInventoryLocation(dst);
9733 {
9736 {
9738 }
9739 else
9740 {
9742
9743
9744 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9745 {
9747 }
9748 else
9749 {
9750 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9751 }
9752 }
9753 }
9754 }
9755
9756 ScriptInputUserData ctx = new ScriptInputUserData;
9764 }
9765 }
9766 else if (!
GetGame().IsMultiplayer())
9767 {
9769 }
9770 }
9771 }
9772
9774 {
9775 if (root)
9776 {
9777 vector m4[4];
9778 root.GetTransform(m4);
9779 dst.SetGround(this, m4);
9780 }
9781 else
9782 {
9783 GetInventory().GetCurrentInventoryLocation(dst);
9784 }
9785 }
9786
9787 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9788 {
9789
9790 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9791 return false;
9792
9793 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9794 return false;
9795
9796
9798 return false;
9799
9800
9801 Magazine mag = Magazine.Cast(this);
9802 if (mag)
9803 {
9804 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9805 return false;
9806
9807 if (stack_max_limit)
9808 {
9809 Magazine other_mag = Magazine.Cast(other_item);
9810 if (other_item)
9811 {
9812 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9813 return false;
9814 }
9815
9816 }
9817 }
9818 else
9819 {
9820
9822 return false;
9823
9825 return false;
9826 }
9827
9828 PlayerBase player = null;
9829 if (CastTo(player, GetHierarchyRootPlayer()))
9830 {
9831 if (player.GetInventory().HasAttachment(this))
9832 return false;
9833
9834 if (player.IsItemsToDelete())
9835 return false;
9836 }
9837
9838 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9839 return false;
9840
9841 int slotID;
9843 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9844 return false;
9845
9846 return true;
9847 }
9848
9850 {
9852 }
9853
9855 {
9856 return m_IsResultOfSplit;
9857 }
9858
9860 {
9861 m_IsResultOfSplit = value;
9862 }
9863
9865 {
9867 }
9868
9870 {
9871 float other_item_quantity = other_item.GetQuantity();
9872 float this_free_space;
9873
9875
9877
9878 if (other_item_quantity > this_free_space)
9879 {
9880 return this_free_space;
9881 }
9882 else
9883 {
9884 return other_item_quantity;
9885 }
9886 }
9887
9889 {
9891 }
9892
9894 {
9896 return;
9897
9898 if (!IsMagazine() && other_item)
9899 {
9901 if (quantity_used != 0)
9902 {
9903 float hp1 = GetHealth01("","");
9904 float hp2 = other_item.GetHealth01("","");
9905 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9906 hpResult = hpResult / (
GetQuantity() + quantity_used);
9907
9908 hpResult *= GetMaxHealth();
9909 Math.Round(hpResult);
9910 SetHealth("", "Health", hpResult);
9911
9913 other_item.AddQuantity(-quantity_used);
9914 }
9915 }
9917 }
9918
9920 {
9921 #ifdef SERVER
9922 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9923 GetHierarchyParent().IncreaseLifetimeUp();
9924 #endif
9925 };
9926
9928 {
9929 PlayerBase p = PlayerBase.Cast(player);
9930
9931 array<int> recipesIds = p.m_Recipes;
9932 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9933 if (moduleRecipesManager)
9934 {
9935 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9936 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9937 }
9938
9939 for (int i = 0;i < recipesIds.Count(); i++)
9940 {
9941 int key = recipesIds.Get(i);
9942 string recipeName = moduleRecipesManager.GetRecipeName(key);
9944 }
9945 }
9946
9947
9948 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9949 {
9950 super.GetDebugActions(outputList);
9951
9952
9958
9959
9964
9969
9970
9974
9975
9977 {
9981 }
9982
9985
9986
9990
9992
9993 InventoryLocation loc = new InventoryLocation();
9994 GetInventory().GetCurrentInventoryLocation(loc);
9996 {
9997 if (Gizmo_IsSupported())
10000 }
10001
10003 }
10004
10005
10006
10007
10009 {
10010 super.OnAction(action_id, player, ctx);
10011
10013 {
10014 switch (action_id)
10015 {
10018 return true;
10021 return true;
10022 }
10023 }
10024
10026 {
10027 switch (action_id)
10028 {
10030 Delete();
10031 return true;
10032 }
10033 }
10034
10035 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10036 {
10037 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10038 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10039 PlayerBase p = PlayerBase.Cast(player);
10040 if (
EActions.RECIPES_RANGE_START < 1000)
10041 {
10042 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10043 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10044 }
10045 }
10046 #ifndef SERVER
10047 else if (action_id ==
EActions.WATCH_PLAYER)
10048 {
10049 PluginDeveloper.SetDeveloperItemClientEx(player);
10050 }
10051 #endif
10053 {
10054 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10055 {
10056 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10057 OnDebugButtonPressServer(id + 1);
10058 }
10059
10060 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10061 {
10062 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10064 }
10065
10066 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10067 {
10068 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10070 }
10071
10072 else if (action_id ==
EActions.ADD_QUANTITY)
10073 {
10074 if (IsMagazine())
10075 {
10076 Magazine mag = Magazine.Cast(this);
10077 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10078 }
10079 else
10080 {
10082 }
10083
10084 if (m_EM)
10085 {
10086 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10087 }
10088
10089 }
10090
10091 else if (action_id ==
EActions.REMOVE_QUANTITY)
10092 {
10093 if (IsMagazine())
10094 {
10095 Magazine mag2 = Magazine.Cast(this);
10096 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10097 }
10098 else
10099 {
10101 }
10102 if (m_EM)
10103 {
10104 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10105 }
10106
10107 }
10108
10109 else if (action_id ==
EActions.SET_QUANTITY_0)
10110 {
10112
10113 if (m_EM)
10114 {
10115 m_EM.SetEnergy(0);
10116 }
10117 }
10118
10119 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10120 {
10122
10123 if (m_EM)
10124 {
10125 m_EM.SetEnergy(m_EM.GetEnergyMax());
10126 }
10127 }
10128
10129 else if (action_id ==
EActions.ADD_HEALTH)
10130 {
10131 AddHealth("","",GetMaxHealth("","Health")/5);
10132 }
10133 else if (action_id ==
EActions.REMOVE_HEALTH)
10134 {
10135 AddHealth("","",-GetMaxHealth("","Health")/5);
10136 }
10137 else if (action_id ==
EActions.DESTROY_HEALTH)
10138 {
10139 SetHealth01("","",0);
10140 }
10141 else if (action_id ==
EActions.WATCH_ITEM)
10142 {
10144 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10145 #ifdef DEVELOPER
10146 SetDebugDeveloper_item(this);
10147 #endif
10148 }
10149
10150 else if (action_id ==
EActions.ADD_TEMPERATURE)
10151 {
10152 AddTemperature(20);
10153
10154 }
10155
10156 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10157 {
10158 AddTemperature(-20);
10159
10160 }
10161
10162 else if (action_id ==
EActions.FLIP_FROZEN)
10163 {
10164 SetFrozen(!GetIsFrozen());
10165
10166 }
10167
10168 else if (action_id ==
EActions.ADD_WETNESS)
10169 {
10171
10172 }
10173
10174 else if (action_id ==
EActions.REMOVE_WETNESS)
10175 {
10177
10178 }
10179
10180 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10181 {
10184
10185
10186 }
10187
10188 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10189 {
10192 }
10193
10194 else if (action_id ==
EActions.MAKE_SPECIAL)
10195 {
10196 auto debugParams = DebugSpawnParams.WithPlayer(player);
10197 OnDebugSpawnEx(debugParams);
10198 }
10199
10200 }
10201
10202
10203 return false;
10204 }
10205
10206
10207
10208
10212
10215
10216
10217
10219 {
10220 return false;
10221 }
10222
10223
10225 {
10226 return true;
10227 }
10228
10229
10231 {
10232 return true;
10233 }
10234
10235
10236
10238 {
10239 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10241 }
10242
10245 {
10246 return null;
10247 }
10248
10250 {
10251 return false;
10252 }
10253
10255 {
10256 return false;
10257 }
10258
10262
10263
10265 {
10266 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10267 return module_repairing.CanRepair(this, item_repair_kit);
10268 }
10269
10270
10271 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10272 {
10273 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10274 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10275 }
10276
10277
10279 {
10280
10281
10282
10283
10284
10285
10286
10287
10288 return 1;
10289 }
10290
10291
10292
10294 {
10296 }
10297
10298
10299
10301 {
10303 }
10304
10305
10314 {
10315 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10316
10317 if (player)
10318 {
10319 player.MessageStatus(text);
10320 }
10321 }
10322
10323
10332 {
10333 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10334
10335 if (player)
10336 {
10337 player.MessageAction(text);
10338 }
10339 }
10340
10341
10350 {
10351 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10352
10353 if (player)
10354 {
10355 player.MessageFriendly(text);
10356 }
10357 }
10358
10359
10368 {
10369 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10370
10371 if (player)
10372 {
10373 player.MessageImportant(text);
10374 }
10375 }
10376
10378 {
10379 return true;
10380 }
10381
10382
10383 override bool KindOf(
string tag)
10384 {
10385 bool found = false;
10386 string item_name = this.
GetType();
10389
10390 int array_size = item_tag_array.Count();
10391 for (int i = 0; i < array_size; i++)
10392 {
10393 if (item_tag_array.Get(i) == tag)
10394 {
10395 found = true;
10396 break;
10397 }
10398 }
10399 return found;
10400 }
10401
10402
10404 {
10405
10406 super.OnRPC(sender, rpc_type,ctx);
10407
10408
10409 switch (rpc_type)
10410 {
10411 #ifndef SERVER
10412 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10413 Param2<bool, string> p = new Param2<bool, string>(false, "");
10414
10416 return;
10417
10418 bool play = p.param1;
10419 string soundSet = p.param2;
10420
10421 if (play)
10422 {
10424 {
10426 {
10428 }
10429 }
10430 else
10431 {
10433 }
10434 }
10435 else
10436 {
10438 }
10439
10440 break;
10441 #endif
10442
10443 }
10444
10446 {
10448 }
10449 }
10450
10451
10452
10453
10455 {
10456 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10457 return plugin.GetID(
name);
10458 }
10459
10461 {
10462 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10463 return plugin.GetName(id);
10464 }
10465
10468 {
10469
10470
10471 int varFlags;
10472 if (!ctx.
Read(varFlags))
10473 return;
10474
10475 if (varFlags & ItemVariableFlags.FLOAT)
10476 {
10478 }
10479 }
10480
10482 {
10483
10484 super.SerializeNumericalVars(floats_out);
10485
10486
10487
10489 {
10491 }
10492
10494 {
10496 }
10497
10499 {
10501 }
10502
10504 {
10509 }
10510
10512 {
10514 }
10515 }
10516
10518 {
10519
10520 super.DeSerializeNumericalVars(floats);
10521
10522
10523 int index = 0;
10524 int mask = Math.Round(floats.Get(index));
10525
10526 index++;
10527
10529 {
10531 {
10533 }
10534 else
10535 {
10536 float quantity = floats.Get(index);
10537 SetQuantity(quantity,
true,
false,
false,
false);
10538 }
10539 index++;
10540 }
10541
10543 {
10544 float wet = floats.Get(index);
10546 index++;
10547 }
10548
10550 {
10551 int liquidtype = Math.Round(floats.Get(index));
10553 index++;
10554 }
10555
10557 {
10559 index++;
10561 index++;
10563 index++;
10565 index++;
10566 }
10567
10569 {
10570 int cleanness = Math.Round(floats.Get(index));
10572 index++;
10573 }
10574 }
10575
10577 {
10578 super.WriteVarsToCTX(ctx);
10579
10580
10582 {
10584 }
10585
10587 {
10589 }
10590
10592 {
10594 }
10595
10597 {
10598 int r,g,b,a;
10604 }
10605
10607 {
10609 }
10610 }
10611
10613 {
10614 if (!super.ReadVarsFromCTX(ctx,version))
10615 return false;
10616
10617 int intValue;
10618 float value;
10619
10620 if (version < 140)
10621 {
10622 if (!ctx.
Read(intValue))
10623 return false;
10624
10625 m_VariablesMask = intValue;
10626 }
10627
10629 {
10630 if (!ctx.
Read(value))
10631 return false;
10632
10634 {
10636 }
10637 else
10638 {
10640 }
10641 }
10642
10643 if (version < 140)
10644 {
10646 {
10647 if (!ctx.
Read(value))
10648 return false;
10649 SetTemperatureDirect(value);
10650 }
10651 }
10652
10654 {
10655 if (!ctx.
Read(value))
10656 return false;
10658 }
10659
10661 {
10662 if (!ctx.
Read(intValue))
10663 return false;
10665 }
10666
10668 {
10669 int r,g,b,a;
10671 return false;
10673 return false;
10675 return false;
10677 return false;
10678
10680 }
10681
10683 {
10684 if (!ctx.
Read(intValue))
10685 return false;
10687 }
10688
10689 if (version >= 138 && version < 140)
10690 {
10692 {
10693 if (!ctx.
Read(intValue))
10694 return false;
10695 SetFrozen(intValue);
10696 }
10697 }
10698
10699 return true;
10700 }
10701
10702
10704 {
10707 {
10709 }
10710
10711 if (!super.OnStoreLoad(ctx, version))
10712 {
10714 return false;
10715 }
10716
10717 if (version >= 114)
10718 {
10719 bool hasQuickBarIndexSaved;
10720
10721 if (!ctx.
Read(hasQuickBarIndexSaved))
10722 {
10724 return false;
10725 }
10726
10727 if (hasQuickBarIndexSaved)
10728 {
10729 int itmQBIndex;
10730
10731
10732 if (!ctx.
Read(itmQBIndex))
10733 {
10735 return false;
10736 }
10737
10738 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10739 if (itmQBIndex != -1 && parentPlayer)
10740 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10741 }
10742 }
10743 else
10744 {
10745
10746 PlayerBase player;
10747 int itemQBIndex;
10748 if (version ==
int.
MAX)
10749 {
10750 if (!ctx.
Read(itemQBIndex))
10751 {
10753 return false;
10754 }
10755 }
10756 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10757 {
10758
10759 if (!ctx.
Read(itemQBIndex))
10760 {
10762 return false;
10763 }
10764 if (itemQBIndex != -1 && player)
10765 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10766 }
10767 }
10768
10769 if (version < 140)
10770 {
10771
10772 if (!LoadVariables(ctx, version))
10773 {
10775 return false;
10776 }
10777 }
10778
10779
10781 {
10783 return false;
10784 }
10785 if (version >= 132)
10786 {
10788 if (raib)
10789 {
10791 {
10793 return false;
10794 }
10795 }
10796 }
10797
10799 return true;
10800 }
10801
10802
10803
10805 {
10806 super.OnStoreSave(ctx);
10807
10808 PlayerBase player;
10809 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10810 {
10812
10813 int itemQBIndex = -1;
10814 itemQBIndex = player.FindQuickBarEntityIndex(this);
10815 ctx.
Write(itemQBIndex);
10816 }
10817 else
10818 {
10820 }
10821
10823
10825 if (raib)
10826 {
10828 }
10829 }
10830
10831
10833 {
10834 super.AfterStoreLoad();
10835
10837 {
10839 }
10840
10842 {
10845 }
10846 }
10847
10849 {
10850 super.EEOnAfterLoad();
10851
10853 {
10855 }
10856
10859 }
10860
10862 {
10863 return false;
10864 }
10865
10866
10867
10869 {
10871 {
10872 #ifdef PLATFORM_CONSOLE
10873
10875 {
10877 if (menu)
10878 {
10880 }
10881 }
10882 #endif
10883 }
10884
10886 {
10889 }
10890
10892 {
10893 SetWeightDirty();
10895 }
10897 {
10900 }
10901
10903 {
10906 }
10908 {
10911 }
10912
10913 super.OnVariablesSynchronized();
10914 }
10915
10916
10917
10919 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10920 {
10921 if (!IsServerCheck(allow_client))
10922 return false;
10923
10925 return false;
10926
10929
10930 if (value <= (min + 0.001))
10931 value = min;
10932
10933 if (value == min)
10934 {
10935 if (destroy_config)
10936 {
10937 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10938 if (dstr)
10939 {
10941 this.Delete();
10942 return true;
10943 }
10944 }
10945 else if (destroy_forced)
10946 {
10948 this.Delete();
10949 return true;
10950 }
10951
10953 }
10954
10957
10959 {
10961
10962 if (delta)
10964 }
10965
10967
10968 return false;
10969 }
10970
10971
10973 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10974 {
10976 }
10977
10979 {
10982 }
10983
10985 {
10988 }
10989
10991 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10992 {
10993 float value_clamped = Math.Clamp(value, 0, 1);
10995 SetQuantity(result, destroy_config, destroy_forced);
10996 }
10997
10998
11001 {
11003 }
11004
11006 {
11008 }
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11020 {
11021 int slot = -1;
11022 if (GetInventory())
11023 {
11024 InventoryLocation il = new InventoryLocation;
11025 GetInventory().GetCurrentInventoryLocation(il);
11027 }
11028
11030 }
11031
11033 {
11034 float quantity_max = 0;
11035
11037 {
11038 if (attSlotID != -1)
11039 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11040
11041 if (quantity_max <= 0)
11043 }
11044
11045 if (quantity_max <= 0)
11047
11048 return quantity_max;
11049 }
11050
11052 {
11054 }
11055
11057 {
11059 }
11060
11061
11063 {
11065 }
11066
11068 {
11070 }
11071
11073 {
11075 }
11076
11077
11079 {
11080
11081 float weightEx = GetWeightEx();
11082 float special = GetInventoryAndCargoWeight();
11083 return weightEx - special;
11084 }
11085
11086
11088 {
11090 }
11091
11093 {
11095 {
11096 #ifdef DEVELOPER
11097 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11098 {
11099 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11101 }
11102 #endif
11103
11104 return GetQuantity() * GetConfigWeightModified();
11105 }
11106 else if (HasEnergyManager())
11107 {
11108 #ifdef DEVELOPER
11109 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11110 {
11111 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11112 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11113 }
11114 #endif
11115 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11116 }
11117 else
11118 {
11119 #ifdef DEVELOPER
11120 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11121 {
11122 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11123 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11124 }
11125 #endif
11126 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11127 }
11128 }
11129
11132 {
11133 int item_count = 0;
11135
11136 if (GetInventory().GetCargo() != NULL)
11137 {
11138 item_count = GetInventory().GetCargo().GetItemCount();
11139 }
11140
11141 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11142 {
11143 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11144 if (item)
11145 item_count += item.GetNumberOfItems();
11146 }
11147 return item_count;
11148 }
11149
11152 {
11153 float weight = 0;
11154 float wetness = 1;
11155 if (include_wetness)
11158 {
11159 weight = wetness * m_ConfigWeight;
11160 }
11162 {
11163 weight = 1;
11164 }
11165 return weight;
11166 }
11167
11168
11169
11171 {
11172 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11173 {
11174 GameInventory inv = GetInventory();
11175 array<EntityAI> items = new array<EntityAI>;
11177 for (int i = 0; i < items.Count(); i++)
11178 {
11180 if (item)
11181 {
11183 }
11184 }
11185 }
11186 }
11187
11188
11189
11190
11192 {
11193 float energy = 0;
11194 if (HasEnergyManager())
11195 {
11196 energy = GetCompEM().GetEnergy();
11197 }
11198 return energy;
11199 }
11200
11201
11203 {
11204 super.OnEnergyConsumed();
11205
11207 }
11208
11210 {
11211 super.OnEnergyAdded();
11212
11214 }
11215
11216
11218 {
11219 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11220 {
11222 {
11223 float energy_0to1 = GetCompEM().GetEnergy0To1();
11225 }
11226 }
11227 }
11228
11229
11231 {
11232 return ConfigGetFloat("heatIsolation");
11233 }
11234
11236 {
11238 }
11239
11241 {
11242 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11243 if (
GetGame().ConfigIsExisting(paramPath))
11245
11246 return 0.0;
11247 }
11248
11250 {
11251 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11252 if (
GetGame().ConfigIsExisting(paramPath))
11254
11255 return 0.0;
11256 }
11257
11258 override void SetWet(
float value,
bool allow_client =
false)
11259 {
11260 if (!IsServerCheck(allow_client))
11261 return;
11262
11265
11267
11268 m_VarWet = Math.Clamp(value, min, max);
11269
11271 {
11274 }
11275 }
11276
11277 override void AddWet(
float value)
11278 {
11280 }
11281
11283 {
11285 }
11286
11288 {
11290 }
11291
11293 {
11295 }
11296
11298 {
11300 }
11301
11303 {
11305 }
11306
11307 override void OnWetChanged(
float newVal,
float oldVal)
11308 {
11311 if (newLevel != oldLevel)
11312 {
11314 }
11315 }
11316
11318 {
11319 SetWeightDirty();
11320 }
11321
11323 {
11324 return GetWetLevelInternal(
m_VarWet);
11325 }
11326
11327
11328
11330 {
11332 }
11333
11335 {
11337 }
11338
11340 {
11342 }
11343
11345 {
11347 }
11348
11349
11350
11352 {
11353 if (ConfigIsExisting("itemModelLength"))
11354 {
11355 return ConfigGetFloat("itemModelLength");
11356 }
11357 return 0;
11358 }
11359
11361 {
11362 if (ConfigIsExisting("itemAttachOffset"))
11363 {
11364 return ConfigGetFloat("itemAttachOffset");
11365 }
11366 return 0;
11367 }
11368
11369 override void SetCleanness(
int value,
bool allow_client =
false)
11370 {
11371 if (!IsServerCheck(allow_client))
11372 return;
11373
11375
11377
11380 }
11381
11383 {
11385 }
11386
11388 {
11389 return true;
11390 }
11391
11392
11393
11394
11396 {
11398 }
11399
11401 {
11403 }
11404
11405
11406
11407
11408 override void SetColor(
int r,
int g,
int b,
int a)
11409 {
11415 }
11417 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11418 {
11423 }
11424
11426 {
11428 }
11429
11432 {
11433 int r,g,b,a;
11435 r = r/255;
11436 g = g/255;
11437 b = b/255;
11438 a = a/255;
11439 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11440 }
11441
11442
11443
11444 override void SetLiquidType(
int value,
bool allow_client =
false)
11445 {
11446 if (!IsServerCheck(allow_client))
11447 return;
11448
11453 }
11454
11456 {
11457 return ConfigGetInt("varLiquidTypeInit");
11458 }
11459
11461 {
11463 }
11464
11466 {
11468 SetFrozen(false);
11469 }
11470
11473 {
11474 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11475 }
11476
11477
11480 {
11481 PlayerBase nplayer;
11482 if (PlayerBase.CastTo(nplayer, player))
11483 {
11485
11486 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11487 }
11488 }
11489
11490
11493 {
11494 PlayerBase nplayer;
11495 if (PlayerBase.CastTo(nplayer,player))
11496 {
11497
11498 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11499
11500 }
11501
11502
11503 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11504
11505
11506 if (HasEnergyManager())
11507 {
11508 GetCompEM().UpdatePlugState();
11509 }
11510 }
11511
11512
11514 {
11515 super.OnPlacementStarted(player);
11516
11518 }
11519
11520 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11521 {
11523 {
11524 m_AdminLog.OnPlacementComplete(player,
this);
11525 }
11526
11527 super.OnPlacementComplete(player, position, orientation);
11528 }
11529
11530
11531
11532
11533
11535 {
11537 {
11538 return true;
11539 }
11540 else
11541 {
11542 return false;
11543 }
11544 }
11545
11546
11548 {
11550 {
11552 }
11553 }
11554
11555
11557 {
11559 }
11560
11562 {
11564 }
11565
11566 override void InsertAgent(
int agent,
float count = 1)
11567 {
11568 if (count < 1)
11569 return;
11570
11572 }
11573
11576 {
11578 }
11579
11580
11582 {
11584 }
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11628 {
11630 return false;
11631 return true;
11632 }
11633
11635 {
11636
11638 }
11639
11640
11643 {
11644 super.CheckForRoofLimited(timeTresholdMS);
11645
11647 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11648 {
11649 m_PreviousRoofTestTime = time;
11650 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11651 }
11652 }
11653
11654
11656 {
11658 {
11659 return 0;
11660 }
11661
11662 if (GetInventory().GetAttachmentSlotsCount() != 0)
11663 {
11664 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11665 if (filter)
11666 return filter.GetProtectionLevel(type, false, system);
11667 else
11668 return 0;
11669 }
11670
11671 string subclassPath, entryName;
11672
11673 switch (type)
11674 {
11676 entryName = "biological";
11677 break;
11679 entryName = "chemical";
11680 break;
11681 default:
11682 entryName = "biological";
11683 break;
11684 }
11685
11686 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11687
11689 }
11690
11691
11692
11695 {
11696 if (!IsMagazine())
11698
11700 }
11701
11702
11703
11704
11705
11710 {
11711 return true;
11712 }
11713
11715 {
11717 }
11718
11719
11720
11721
11722
11724 {
11725 if (parent)
11726 {
11727 if (parent.IsInherited(DayZInfected))
11728 return true;
11729
11730 if (!parent.IsRuined())
11731 return true;
11732 }
11733
11734 return true;
11735 }
11736
11738 {
11739 if (!super.CanPutAsAttachment(parent))
11740 {
11741 return false;
11742 }
11743
11744 if (!IsRuined() && !parent.IsRuined())
11745 {
11746 return true;
11747 }
11748
11749 return false;
11750 }
11751
11753 {
11754
11755
11756
11757
11758 return super.CanReceiveItemIntoCargo(item);
11759 }
11760
11762 {
11763
11764
11765
11766
11767 GameInventory attachmentInv = attachment.GetInventory();
11769 {
11770 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11771 return false;
11772 }
11773
11774 InventoryLocation loc = new InventoryLocation();
11775 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11776 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11777 return false;
11778
11779 return super.CanReceiveAttachment(attachment, slotId);
11780 }
11781
11783 {
11784 if (!super.CanReleaseAttachment(attachment))
11785 return false;
11786
11787 return GetInventory().AreChildrenAccessible();
11788 }
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11811 {
11812 int id = muzzle_owner.GetMuzzleID();
11813 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11814
11815 if (WPOF_array)
11816 {
11817 for (int i = 0; i < WPOF_array.Count(); i++)
11818 {
11819 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11820
11821 if (WPOF)
11822 {
11823 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11824 }
11825 }
11826 }
11827 }
11828
11829
11831 {
11832 int id = muzzle_owner.GetMuzzleID();
11834
11835 if (WPOBE_array)
11836 {
11837 for (int i = 0; i < WPOBE_array.Count(); i++)
11838 {
11839 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11840
11841 if (WPOBE)
11842 {
11843 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11844 }
11845 }
11846 }
11847 }
11848
11849
11851 {
11852 int id = muzzle_owner.GetMuzzleID();
11853 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11854
11855 if (WPOOH_array)
11856 {
11857 for (int i = 0; i < WPOOH_array.Count(); i++)
11858 {
11859 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11860
11861 if (WPOOH)
11862 {
11863 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11864 }
11865 }
11866 }
11867 }
11868
11869
11871 {
11872 int id = muzzle_owner.GetMuzzleID();
11873 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11874
11875 if (WPOOH_array)
11876 {
11877 for (int i = 0; i < WPOOH_array.Count(); i++)
11878 {
11879 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11880
11881 if (WPOOH)
11882 {
11883 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11884 }
11885 }
11886 }
11887 }
11888
11889
11891 {
11892 int id = muzzle_owner.GetMuzzleID();
11893 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11894
11895 if (WPOOH_array)
11896 {
11897 for (int i = 0; i < WPOOH_array.Count(); i++)
11898 {
11899 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11900
11901 if (WPOOH)
11902 {
11903 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11904 }
11905 }
11906 }
11907 }
11908
11909
11910
11912 {
11914 {
11915 return true;
11916 }
11917
11918 return false;
11919 }
11920
11922 {
11924 {
11925 return true;
11926 }
11927
11928 return false;
11929 }
11930
11932 {
11934 {
11935 return true;
11936 }
11937
11938 return false;
11939 }
11940
11942 {
11943 return false;
11944 }
11945
11948 {
11949 return UATimeSpent.DEFAULT_DEPLOY;
11950 }
11951
11952
11953
11954
11956 {
11958 SetSynchDirty();
11959 }
11960
11962 {
11964 }
11965
11966
11968 {
11969 return false;
11970 }
11971
11974 {
11975 string att_type = "None";
11976
11977 if (ConfigIsExisting("soundAttType"))
11978 {
11979 att_type = ConfigGetString("soundAttType");
11980 }
11981
11983 }
11984
11986 {
11988 }
11989
11990
11991
11992
11993
11999
12001 {
12004
12006 }
12007
12008
12010 {
12012 return;
12013
12015
12018
12021
12022 SoundParameters params = new SoundParameters();
12026 }
12027
12028
12030 {
12032 return;
12033
12035 SetSynchDirty();
12036
12039 }
12040
12041
12043 {
12045 return;
12046
12048 SetSynchDirty();
12049
12052 }
12053
12055 {
12057 }
12058
12060 {
12062 }
12063
12066 {
12067 if (!
GetGame().IsDedicatedServer())
12068 {
12069 if (ConfigIsExisting("attachSoundSet"))
12070 {
12071 string cfg_path = "";
12072 string soundset = "";
12073 string type_name =
GetType();
12074
12077 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12078 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12079
12080 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12081 {
12082 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12083 {
12084 if (cfg_slot_array[i] == slot_type)
12085 {
12086 soundset = cfg_soundset_array[i];
12087 break;
12088 }
12089 }
12090 }
12091
12092 if (soundset != "")
12093 {
12094 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12096 }
12097 }
12098 }
12099 }
12100
12102 {
12103
12104 }
12105
12106 void OnApply(PlayerBase player);
12107
12109 {
12110 return 1.0;
12111 };
12112
12114 {
12116 }
12117
12119 {
12121 }
12122
12124
12126 {
12127 SetDynamicPhysicsLifeTime(0.01);
12129 }
12130
12132 {
12133 array<string> zone_names = new array<string>;
12134 GetDamageZones(zone_names);
12135 for (int i = 0; i < zone_names.Count(); i++)
12136 {
12137 SetHealthMax(zone_names.Get(i),"Health");
12138 }
12139 SetHealthMax("","Health");
12140 }
12141
12144 {
12145 float global_health = GetHealth01("","Health");
12146 array<string> zones = new array<string>;
12147 GetDamageZones(zones);
12148
12149 for (int i = 0; i < zones.Count(); i++)
12150 {
12151 SetHealth01(zones.Get(i),"Health",global_health);
12152 }
12153 }
12154
12157 {
12158 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12159 }
12160
12162 {
12163 if (!hasRootAsPlayer)
12164 {
12165 if (refParentIB)
12166 {
12167
12168 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12169 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12170
12171 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12172 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12173
12176 }
12177 else
12178 {
12179
12182 }
12183 }
12184 }
12185
12187 {
12189 {
12190 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12191 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12192 {
12193 float heatPermCoef = 1.0;
12195 while (ent)
12196 {
12197 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12198 ent = ent.GetHierarchyParent();
12199 }
12200
12201 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12202 }
12203 }
12204 }
12205
12207 {
12208
12209 EntityAI parent = GetHierarchyParent();
12210 if (!parent)
12211 {
12212 hasParent = false;
12213 hasRootAsPlayer = false;
12214 }
12215 else
12216 {
12217 hasParent = true;
12218 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12219 refParentIB =
ItemBase.Cast(parent);
12220 }
12221 }
12222
12223 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12224 {
12225
12226 }
12227
12229 {
12230
12231 return false;
12232 }
12233
12235 {
12236
12237
12238 return false;
12239 }
12240
12242 {
12243
12244 return false;
12245 }
12246
12249 {
12250 return !GetIsFrozen() &&
IsOpen();
12251 }
12252
12254 {
12255 bool hasParent = false, hasRootAsPlayer = false;
12257
12258 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12259 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12260
12261 if (wwtu || foodDecay)
12262 {
12266
12267 if (processWetness || processTemperature || processDecay)
12268 {
12270
12271 if (processWetness)
12272 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12273
12274 if (processTemperature)
12276
12277 if (processDecay)
12278 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12279 }
12280 }
12281 }
12282
12285 {
12287 }
12288
12290 {
12293
12294 return super.GetTemperatureFreezeThreshold();
12295 }
12296
12298 {
12301
12302 return super.GetTemperatureThawThreshold();
12303 }
12304
12306 {
12309
12310 return super.GetItemOverheatThreshold();
12311 }
12312
12314 {
12316 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12317
12318 return super.GetTemperatureFreezeTime();
12319 }
12320
12322 {
12324 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12325
12326 return super.GetTemperatureThawTime();
12327 }
12328
12333
12335 {
12336 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12337 }
12338
12340 {
12341 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12342 }
12343
12346 {
12348 }
12349
12351 {
12353 }
12354
12356 {
12358 }
12359
12362 {
12363 return null;
12364 }
12365
12368 {
12369 return false;
12370 }
12371
12373 {
12375 {
12378 if (!trg)
12379 {
12381 explosive = this;
12382 }
12383
12384 explosive.PairRemote(trg);
12386
12387 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12388 trg.SetPersistentPairID(persistentID);
12389 explosive.SetPersistentPairID(persistentID);
12390
12391 return true;
12392 }
12393 return false;
12394 }
12395
12398 {
12399 float ret = 1.0;
12402 ret *= GetHealth01();
12403
12404 return ret;
12405 }
12406
12407 #ifdef DEVELOPER
12408 override void SetDebugItem()
12409 {
12410 super.SetDebugItem();
12411 _itemBase = this;
12412 }
12413
12415 {
12416 string text = super.GetDebugText();
12417
12419 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12420
12421 return text;
12422 }
12423 #endif
12424
12426 {
12427 return true;
12428 }
12429
12431
12433
12435 {
12438 }
12439
12440
12448
12464}
12465
12467{
12469 if (entity)
12470 {
12471 bool is_item = entity.IsInherited(
ItemBase);
12472 if (is_item && full_quantity)
12473 {
12476 }
12477 }
12478 else
12479 {
12481 return NULL;
12482 }
12483 return entity;
12484}
12485
12487{
12488 if (item)
12489 {
12490 if (health > 0)
12491 item.SetHealth("", "", health);
12492
12493 if (item.CanHaveTemperature())
12494 {
12496 if (item.CanFreeze())
12497 item.SetFrozen(false);
12498 }
12499
12500 if (item.HasEnergyManager())
12501 {
12502 if (quantity >= 0)
12503 {
12504 item.GetCompEM().SetEnergy0To1(quantity);
12505 }
12506 else
12507 {
12509 }
12510 }
12511 else if (item.IsMagazine())
12512 {
12513 Magazine mag = Magazine.Cast(item);
12514 if (quantity >= 0)
12515 {
12516 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12517 }
12518 else
12519 {
12521 }
12522
12523 }
12524 else
12525 {
12526 if (quantity >= 0)
12527 {
12528 item.SetQuantityNormalized(quantity, false);
12529 }
12530 else
12531 {
12533 }
12534
12535 }
12536 }
12537}
12538
12539#ifdef DEVELOPER
12541#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
Open
Implementations only.
override void EEOnCECreate()
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 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)
bool ShouldSplitQuantity(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)
override 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...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
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()
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)
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 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 void GizmoSelectObject(Object object)
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 native void GizmoSelectPhysics(Physics physics)
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
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 string GetFoldSoundset()
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 string GetLoopFoldSoundset()
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.