Send message to owner player in red color.
7600{
7602 {
7603 return true;
7604 }
7605};
7606
7607
7608
7610{
7614
7616
7619
7620
7621
7622
7623
7632
7638
7643
7648
7669 protected bool m_IsResultOfSplit
7670
7672
7677
7678
7679
7681
7685
7686
7687
7689
7692
7693
7694
7700
7701
7709
7712
7713
7715
7716
7718
7719
7724
7725
7730
7731
7733
7734
7736 {
7741
7742 if (!
GetGame().IsDedicatedServer())
7743 {
7745 {
7747
7749 {
7751 }
7752 }
7753
7756 }
7757
7758 m_OldLocation = null;
7759
7761 {
7763 }
7764
7765 if (ConfigIsExisting("headSelectionsToHide"))
7766 {
7769 }
7770
7772 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7773 {
7775 }
7776
7778
7779 m_IsResultOfSplit = false;
7780
7782 }
7783
7785 {
7786 super.InitItemVariables();
7787
7793 m_Count = ConfigGetInt(
"count");
7794
7797
7802
7805
7810
7822
7826
7827
7830 if (ConfigIsExisting("canBeSplit"))
7831 {
7834 }
7835
7837 if (ConfigIsExisting("itemBehaviour"))
7839
7840
7843 RegisterNetSyncVariableInt("m_VarLiquidType");
7844 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7845
7846 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7847 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7848 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7849
7850 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7851 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7852 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7853 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7854
7855 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7856 RegisterNetSyncVariableBool("m_IsTakeable");
7857 RegisterNetSyncVariableBool("m_IsHologram");
7858
7861 {
7864 }
7865
7867
7869 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7871
7872 }
7873
7875 {
7877 }
7878
7880 {
7883 {
7888 }
7889 }
7890
7891 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7892 {
7894 {
7897 }
7898
7900 }
7901
7903 {
7909 }
7910
7912
7914 {
7916
7917 if (!action)
7918 {
7919 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7920 return;
7921 }
7922
7924 if (!ai)
7925 {
7927 return;
7928 }
7929
7931 if (!action_array)
7932 {
7933 action_array = new array<ActionBase_Basic>;
7935 }
7936 if (LogManager.IsActionLogEnable())
7937 {
7938 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7939 }
7940
7941 if (action_array.Find(action) != -1)
7942 {
7943 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7944 }
7945 else
7946 {
7947 action_array.Insert(action);
7948 }
7949 }
7950
7952 {
7954 ActionBase action = player.GetActionManager().GetAction(actionName);
7957
7958 if (action_array)
7959 {
7960 action_array.RemoveItem(action);
7961 }
7962 }
7963
7964
7965
7967 {
7968 ActionOverrideData overrideData = new ActionOverrideData();
7972
7974 if (!actionMap)
7975 {
7978 }
7979
7980 actionMap.Insert(this.
Type(), overrideData);
7981
7982 }
7983
7985
7987
7988
7990 {
7993
7996
7997 string config_to_search = "CfgVehicles";
7998 string muzzle_owner_config;
7999
8001 {
8002 if (IsInherited(Weapon))
8003 config_to_search = "CfgWeapons";
8004
8005 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8006
8007 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8008
8010
8011 if (config_OnFire_subclass_count > 0)
8012 {
8013 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8014
8015 for (int i = 0; i < config_OnFire_subclass_count; i++)
8016 {
8017 string particle_class = "";
8019 string config_OnFire_entry = config_OnFire_class + particle_class;
8020 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8021 WPOF_array.Insert(WPOF);
8022 }
8023
8024
8026 }
8027 }
8028
8030 {
8031 config_to_search = "CfgWeapons";
8032 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8033
8034 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8035
8037
8038 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8039 {
8040 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8041
8042 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8043 {
8044 string particle_class2 = "";
8046 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8047 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8048 WPOBE_array.Insert(WPOBE);
8049 }
8050
8051
8053 }
8054 }
8055 }
8056
8057
8059 {
8062
8064 {
8065 string config_to_search = "CfgVehicles";
8066
8067 if (IsInherited(Weapon))
8068 config_to_search = "CfgWeapons";
8069
8070 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8071 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8072
8073 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8074 {
8075
8077
8079 {
8081 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8083 return;
8084 }
8085
8088
8089
8090
8092 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8093
8094 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8095 {
8096 string particle_class = "";
8098 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8100
8101 if (entry_type == CT_CLASS)
8102 {
8103 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8104 WPOOH_array.Insert(WPOF);
8105 }
8106 }
8107
8108
8110 }
8111 }
8112 }
8113
8115 {
8117 }
8118
8120 {
8122 {
8124
8127
8130
8131 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8132 }
8133 }
8134
8136 {
8138 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8139
8141 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8142
8144 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8145
8147 {
8149 }
8150 }
8151
8153 {
8155 }
8156
8158 {
8161 else
8163
8165 {
8168 }
8169 else
8170 {
8173
8176 }
8177
8179 }
8180
8182 {
8184 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8185 }
8186
8188 {
8190 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8192 }
8193
8195 {
8197 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8198 }
8199
8201 {
8204
8205 OverheatingParticle OP = new OverheatingParticle();
8210
8212 }
8213
8215 {
8218
8219 return -1;
8220 }
8221
8223 {
8225 {
8228
8229 for (int i = count; i > 0; --i)
8230 {
8231 int id = i - 1;
8234
8237
8238 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8239 {
8240 if (p)
8241 {
8244 }
8245 }
8246 }
8247 }
8248 }
8249
8251 {
8253 {
8255 {
8256 int id = i - 1;
8258
8259 if (OP)
8260 {
8262
8263 if (p)
8264 {
8266 }
8267
8268 delete OP;
8269 }
8270 }
8271
8274 }
8275 }
8276
8279 {
8280 return 0.0;
8281 }
8282
8283
8285 {
8286 return 250;
8287 }
8288
8290 {
8291 return 0;
8292 }
8293
8296 {
8298 return true;
8299
8300 return false;
8301 }
8302
8305 {
8308
8310 {
8312 }
8313 else
8314 {
8315
8317 }
8318
8320 }
8321
8328 {
8329 return -1;
8330 }
8331
8332
8333
8334
8336 {
8338 {
8340 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8341
8342 if (r_index >= 0)
8343 {
8344 InventoryLocation r_il = new InventoryLocation;
8345 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8346
8347 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8350 {
8351 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8352 }
8354 {
8355 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8356 }
8357
8358 }
8359
8360 player.GetHumanInventory().ClearUserReservedLocation(this);
8361 }
8362
8365 }
8366
8367
8368
8369
8371 {
8372 return ItemBase.m_DebugActionsMask;
8373 }
8374
8376 {
8377 return ItemBase.m_DebugActionsMask & mask;
8378 }
8379
8381 {
8382 ItemBase.m_DebugActionsMask = mask;
8383 }
8384
8386 {
8387 ItemBase.m_DebugActionsMask |= mask;
8388 }
8389
8391 {
8392 ItemBase.m_DebugActionsMask &= ~mask;
8393 }
8394
8396 {
8398 {
8400 }
8401 else
8402 {
8404 }
8405 }
8406
8407
8409 {
8410 if (GetEconomyProfile())
8411 {
8412 float q_max = GetEconomyProfile().GetQuantityMax();
8413 if (q_max > 0)
8414 {
8415 float q_min = GetEconomyProfile().GetQuantityMin();
8416 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8417
8419 {
8420 ComponentEnergyManager comp = GetCompEM();
8422 {
8424 }
8425 }
8427 {
8429
8430 }
8431
8432 }
8433 }
8434 }
8435
8438 {
8439 EntityAI parent = GetHierarchyParent();
8440
8441 if (parent)
8442 {
8443 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8444 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8445 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8446 }
8447 }
8448
8451 {
8452 EntityAI parent = GetHierarchyParent();
8453
8454 if (parent)
8455 {
8456 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8457 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8458 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8459 }
8460 }
8461
8463 {
8464
8465
8466
8467
8469
8471 {
8472 if (ScriptInputUserData.CanStoreInputUserData())
8473 {
8474 ScriptInputUserData ctx = new ScriptInputUserData;
8480 ctx.
Write(use_stack_max);
8483
8485 {
8486 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8487 }
8488 }
8489 }
8490 else if (!
GetGame().IsMultiplayer())
8491 {
8493 }
8494 }
8495
8497 {
8499 }
8500
8502 {
8504 }
8505
8507 {
8509 }
8510
8512 {
8513
8514 return false;
8515 }
8516
8518 {
8519 return false;
8520 }
8521
8525 {
8526 return false;
8527 }
8528
8530 {
8531 return "";
8532 }
8533
8535
8537 {
8538 return false;
8539 }
8540
8542 {
8543 return true;
8544 }
8545
8546
8547
8549 {
8550 return true;
8551 }
8552
8554 {
8555 return true;
8556 }
8557
8559 {
8560 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8562 }
8563
8565 {
8567 }
8568
8570 {
8572 if (!is_being_placed)
8574 SetSynchDirty();
8575 }
8576
8577
8579
8581 {
8583 }
8584
8586 {
8588 }
8589
8591 {
8592 return 1;
8593 }
8594
8596 {
8597 return false;
8598 }
8599
8601 {
8603 SetSynchDirty();
8604 }
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8641 {
8642 super.OnMovedInsideCargo(container);
8643
8644 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8645 }
8646
8647 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8648 {
8649 super.EEItemLocationChanged(oldLoc,newLoc);
8650
8651 PlayerBase new_player = null;
8652 PlayerBase old_player = null;
8653
8654 if (newLoc.GetParent())
8655 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8656
8657 if (oldLoc.GetParent())
8658 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8659
8661 {
8662 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8663
8664 if (r_index >= 0)
8665 {
8666 InventoryLocation r_il = new InventoryLocation;
8667 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8668
8669 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8672 {
8673 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8674 }
8676 {
8677 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8678 }
8679
8680 }
8681 }
8682
8684 {
8685 if (new_player)
8686 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8687
8688 if (new_player == old_player)
8689 {
8690
8691 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8692 {
8694 {
8695 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8696 {
8697 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8698 }
8699 }
8700 else
8701 {
8702 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8703 }
8704 }
8705
8706 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8707 {
8708 int type = oldLoc.GetType();
8710 {
8711 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8712 }
8714 {
8715 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8716 }
8717 }
8718 if (!m_OldLocation)
8719 {
8720 m_OldLocation = new InventoryLocation;
8721 }
8722 m_OldLocation.Copy(oldLoc);
8723 }
8724 else
8725 {
8726 if (m_OldLocation)
8727 {
8728 m_OldLocation.Reset();
8729 }
8730 }
8731
8733 }
8734 else
8735 {
8736 if (new_player)
8737 {
8738 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8739 if (res_index >= 0)
8740 {
8741 InventoryLocation il = new InventoryLocation;
8742 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8744 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8747 {
8748 il.
GetParent().GetOnReleaseLock().Invoke(it);
8749 }
8751 {
8753 }
8754
8755 }
8756 }
8758 {
8759
8761 }
8762
8763 if (m_OldLocation)
8764 {
8765 m_OldLocation.Reset();
8766 }
8767 }
8768 }
8769
8770 override void EOnContact(IEntity other, Contact extra)
8771 {
8773 {
8774 int liquidType = -1;
8776 if (impactSpeed > 0.0)
8777 {
8779 #ifndef SERVER
8781 #else
8783 SetSynchDirty();
8784 #endif
8786 }
8787 }
8788
8789 #ifdef SERVER
8790 if (GetCompEM() && GetCompEM().IsPlugged())
8791 {
8792 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8793 GetCompEM().UnplugThis();
8794 }
8795 #endif
8796 }
8797
8799
8801 {
8803 }
8804
8806 {
8807
8808 }
8809
8811 {
8812 super.OnItemLocationChanged(old_owner, new_owner);
8813
8814 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8815 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8816
8817 if (!relatedPlayer && playerNew)
8818 relatedPlayer = playerNew;
8819
8820 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8821 {
8823 if (actionMgr)
8824 {
8825 ActionBase currentAction = actionMgr.GetRunningAction();
8826 if (currentAction)
8828 }
8829 }
8830
8831 Man ownerPlayerOld = null;
8832 Man ownerPlayerNew = null;
8833
8834 if (old_owner)
8835 {
8836 if (old_owner.
IsMan())
8837 {
8838 ownerPlayerOld = Man.Cast(old_owner);
8839 }
8840 else
8841 {
8842 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8843 }
8844 }
8845 else
8846 {
8848 {
8850
8851 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8852 {
8853 GetCompEM().UnplugThis();
8854 }
8855 }
8856 }
8857
8858 if (new_owner)
8859 {
8860 if (new_owner.
IsMan())
8861 {
8862 ownerPlayerNew = Man.Cast(new_owner);
8863 }
8864 else
8865 {
8866 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8867 }
8868 }
8869
8870 if (ownerPlayerOld != ownerPlayerNew)
8871 {
8872 if (ownerPlayerOld)
8873 {
8874 array<EntityAI> subItemsExit = new array<EntityAI>;
8876 for (int i = 0; i < subItemsExit.Count(); i++)
8877 {
8880 }
8881 }
8882
8883 if (ownerPlayerNew)
8884 {
8885 array<EntityAI> subItemsEnter = new array<EntityAI>;
8887 for (int j = 0; j < subItemsEnter.Count(); j++)
8888 {
8891 }
8892 }
8893 }
8894 else if (ownerPlayerNew != null)
8895 {
8896 PlayerBase nplayer;
8897 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8898 {
8899 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8901 for (int k = 0; k < subItemsUpdate.Count(); k++)
8902 {
8904 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8905 }
8906 }
8907 }
8908
8909 if (old_owner)
8910 old_owner.OnChildItemRemoved(this);
8911 if (new_owner)
8912 new_owner.OnChildItemReceived(this);
8913 }
8914
8915
8917 {
8918 super.EEDelete(parent);
8919 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8920 if (player)
8921 {
8923
8924 if (player.IsAlive())
8925 {
8926 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8927 if (r_index >= 0)
8928 {
8929 InventoryLocation r_il = new InventoryLocation;
8930 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8931
8932 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8935 {
8936 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8937 }
8939 {
8940 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8941 }
8942
8943 }
8944
8945 player.RemoveQuickBarEntityShortcut(this);
8946 }
8947 }
8948 }
8949
8951 {
8952 super.EEKilled(killer);
8953
8956 {
8957 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8958 {
8959 if (IsMagazine())
8960 {
8961 if (Magazine.Cast(this).GetAmmoCount() > 0)
8962 {
8964 }
8965 }
8966 else
8967 {
8969 }
8970 }
8971 }
8972 }
8973
8975 {
8976 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8977
8978 super.OnWasAttached(parent, slot_id);
8979
8982
8984 }
8985
8987 {
8988 super.OnWasDetached(parent, slot_id);
8989
8992 }
8993
8995 {
8996 int idx;
8999
9000 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9001 if (inventory_slots.Count() < 1)
9002 {
9003 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9004 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9005 }
9006 else
9007 {
9008 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9009 }
9010
9011 idx = inventory_slots.Find(slot);
9012 if (idx < 0)
9013 return "";
9014
9015 return attach_types.Get(idx);
9016 }
9017
9019 {
9020 int idx = -1;
9021 string slot;
9022
9025
9026 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9027 if (inventory_slots.Count() < 1)
9028 {
9029 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9030 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9031 }
9032 else
9033 {
9034 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9035 if (detach_types.Count() < 1)
9036 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9037 }
9038
9039 for (int i = 0; i < inventory_slots.Count(); i++)
9040 {
9041 slot = inventory_slots.Get(i);
9042 }
9043
9044 if (slot != "")
9045 {
9046 if (detach_types.Count() == 1)
9047 idx = 0;
9048 else
9049 idx = inventory_slots.Find(slot);
9050 }
9051 if (idx < 0)
9052 return "";
9053
9054 return detach_types.Get(idx);
9055 }
9056
9058 {
9059
9061
9062
9063 float min_time = 1;
9064 float max_time = 3;
9065 float delay = Math.RandomFloat(min_time, max_time);
9066
9067 explode_timer.Run(delay, this, "DoAmmoExplosion");
9068 }
9069
9071 {
9072 Magazine magazine = Magazine.Cast(this);
9073 int pop_sounds_count = 6;
9074 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9075
9076
9077 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9078 string sound_name = pop_sounds[ sound_idx ];
9080
9081
9082 magazine.ServerAddAmmoCount(-1);
9083
9084
9085 float min_temp_to_explode = 100;
9086
9087 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9088 {
9090 }
9091 }
9092
9093
9094 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9095 {
9096 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9097
9098 const int CHANCE_DAMAGE_CARGO = 4;
9099 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9100 const int CHANCE_DAMAGE_NOTHING = 2;
9101
9103 {
9104 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9105 int chances;
9106 int rnd;
9107
9108 if (GetInventory().GetCargo())
9109 {
9110 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9111 rnd = Math.RandomInt(0,chances);
9112
9113 if (rnd < CHANCE_DAMAGE_CARGO)
9114 {
9116 }
9117 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9118 {
9120 }
9121 }
9122 else
9123 {
9124 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9125 rnd = Math.RandomInt(0,chances);
9126
9127 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9128 {
9130 }
9131 }
9132 }
9133 }
9134
9136 {
9137 if (GetInventory().GetCargo())
9138 {
9139 int item_count = GetInventory().GetCargo().GetItemCount();
9140 if (item_count > 0)
9141 {
9142 int random_pick = Math.RandomInt(0, item_count);
9144 if (!item.IsExplosive())
9145 {
9146 item.AddHealth("","",damage);
9147 return true;
9148 }
9149 }
9150 }
9151 return false;
9152 }
9153
9155 {
9156 int attachment_count = GetInventory().AttachmentCount();
9157 if (attachment_count > 0)
9158 {
9159 int random_pick = Math.RandomInt(0, attachment_count);
9160 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9161 if (!attachment.IsExplosive())
9162 {
9163 attachment.AddHealth("","",damage);
9164 return true;
9165 }
9166 }
9167 return false;
9168 }
9169
9171 {
9173 }
9174
9176 {
9178 return GetInventory().CanRemoveEntity();
9179
9180 return false;
9181 }
9182
9184 {
9185
9187 return false;
9188
9189
9191 return false;
9192
9193
9194
9196 if (delta == 0)
9197 return false;
9198
9199
9200 return true;
9201 }
9202
9204 {
9206 {
9207 if (ScriptInputUserData.CanStoreInputUserData())
9208 {
9209 ScriptInputUserData ctx = new ScriptInputUserData;
9214 ctx.
Write(destination_entity);
9218 }
9219 }
9220 else if (!
GetGame().IsMultiplayer())
9221 {
9223 }
9224 }
9225
9227 {
9228 float split_quantity_new;
9232 InventoryLocation loc = new InventoryLocation;
9233
9234 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9235 {
9237 split_quantity_new = stack_max;
9238 else
9240
9242 {
9243 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9244 if (new_item)
9245 {
9246 new_item.SetResultOfSplit(true);
9247 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9249 new_item.
SetQuantity(split_quantity_new,
false,
true);
9250 }
9251 }
9252 }
9253 else if (destination_entity && slot_id == -1)
9254 {
9255 if (quantity > stack_max)
9256 split_quantity_new = stack_max;
9257 else
9258 split_quantity_new = quantity;
9259
9261 {
9263 {
9266 }
9267
9268 if (new_item)
9269 {
9270 new_item.SetResultOfSplit(true);
9271 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9273 new_item.
SetQuantity(split_quantity_new,
false,
true);
9274 }
9275 }
9276 }
9277 else
9278 {
9279 if (stack_max != 0)
9280 {
9282 {
9284 }
9285
9286 if (split_quantity_new == 0)
9287 {
9288 if (!
GetGame().IsMultiplayer())
9289 player.PhysicalPredictiveDropItem(this);
9290 else
9291 player.ServerDropEntity(this);
9292 return;
9293 }
9294
9296 {
9298
9299 if (new_item)
9300 {
9301 new_item.SetResultOfSplit(true);
9302 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9305 new_item.PlaceOnSurface();
9306 }
9307 }
9308 }
9309 }
9310 }
9311
9313 {
9314 float split_quantity_new;
9318 InventoryLocation loc = new InventoryLocation;
9319
9320 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9321 {
9323 split_quantity_new = stack_max;
9324 else
9326
9328 {
9329 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9330 if (new_item)
9331 {
9332 new_item.SetResultOfSplit(true);
9333 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9335 new_item.
SetQuantity(split_quantity_new,
false,
true);
9336 }
9337 }
9338 }
9339 else if (destination_entity && slot_id == -1)
9340 {
9341 if (quantity > stack_max)
9342 split_quantity_new = stack_max;
9343 else
9344 split_quantity_new = quantity;
9345
9347 {
9349 {
9352 }
9353
9354 if (new_item)
9355 {
9356 new_item.SetResultOfSplit(true);
9357 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9359 new_item.
SetQuantity(split_quantity_new,
false,
true);
9360 }
9361 }
9362 }
9363 else
9364 {
9365 if (stack_max != 0)
9366 {
9368 {
9370 }
9371
9373 {
9375
9376 if (new_item)
9377 {
9378 new_item.SetResultOfSplit(true);
9379 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9382 new_item.PlaceOnSurface();
9383 }
9384 }
9385 }
9386 }
9387 }
9388
9390 {
9392 {
9393 if (ScriptInputUserData.CanStoreInputUserData())
9394 {
9395 ScriptInputUserData ctx = new ScriptInputUserData;
9400 dst.WriteToContext(ctx);
9402 }
9403 }
9404 else if (!
GetGame().IsMultiplayer())
9405 {
9407 }
9408 }
9409
9411 {
9413 {
9414 if (ScriptInputUserData.CanStoreInputUserData())
9415 {
9416 ScriptInputUserData ctx = new ScriptInputUserData;
9421 ctx.
Write(destination_entity);
9427 }
9428 }
9429 else if (!
GetGame().IsMultiplayer())
9430 {
9432 }
9433 }
9434
9436 {
9438 }
9439
9441 {
9443 float split_quantity_new;
9445 if (dst.IsValid())
9446 {
9447 int slot_id = dst.GetSlot();
9449
9450 if (quantity > stack_max)
9451 split_quantity_new = stack_max;
9452 else
9453 split_quantity_new = quantity;
9454
9456 {
9458
9459 if (new_item)
9460 {
9461 new_item.SetResultOfSplit(true);
9462 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9464 new_item.
SetQuantity(split_quantity_new,
false,
true);
9465 }
9466
9467 return new_item;
9468 }
9469 }
9470
9471 return null;
9472 }
9473
9475 {
9477 float split_quantity_new;
9479 if (destination_entity)
9480 {
9482 if (quantity > stackable)
9483 split_quantity_new = stackable;
9484 else
9485 split_quantity_new = quantity;
9486
9488 {
9489 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9490 if (new_item)
9491 {
9492 new_item.SetResultOfSplit(true);
9493 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9495 new_item.
SetQuantity(split_quantity_new,
false,
true);
9496 }
9497 }
9498 }
9499 }
9500
9502 {
9504 {
9505 if (ScriptInputUserData.CanStoreInputUserData())
9506 {
9507 ScriptInputUserData ctx = new ScriptInputUserData;
9512 ItemBase destination_entity =
this;
9513 ctx.
Write(destination_entity);
9517 }
9518 }
9519 else if (!
GetGame().IsMultiplayer())
9520 {
9522 }
9523 }
9524
9526 {
9528 float split_quantity_new;
9530 if (player)
9531 {
9533 if (quantity > stackable)
9534 split_quantity_new = stackable;
9535 else
9536 split_quantity_new = quantity;
9537
9539 {
9540 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9541 new_item =
ItemBase.Cast(in_hands);
9542 if (new_item)
9543 {
9544 new_item.SetResultOfSplit(true);
9545 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9547 new_item.SetQuantity(split_quantity_new, false, true);
9548 }
9549 }
9550 }
9551 }
9552
9554 {
9556 float split_quantity_new = Math.Floor(quantity * 0.5);
9557
9559 return;
9560
9562
9563 if (new_item)
9564 {
9565 if (new_item.GetQuantityMax() < split_quantity_new)
9566 {
9567 split_quantity_new = new_item.GetQuantityMax();
9568 }
9569
9570 new_item.SetResultOfSplit(true);
9571 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9572
9574 {
9577 }
9578 else
9579 {
9581 new_item.
SetQuantity(split_quantity_new,
false,
true);
9582 }
9583 }
9584 }
9585
9587 {
9589 float split_quantity_new = Math.Floor(quantity / 2);
9590
9592 return;
9593
9594 InventoryLocation invloc = new InventoryLocation;
9596
9598 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9599
9600 if (new_item)
9601 {
9602 if (new_item.GetQuantityMax() < split_quantity_new)
9603 {
9604 split_quantity_new = new_item.GetQuantityMax();
9605 }
9607 {
9610 }
9611 else if (split_quantity_new > 1)
9612 {
9614 new_item.
SetQuantity(split_quantity_new,
false,
true);
9615 }
9616 }
9617 }
9618
9621 {
9622 SetWeightDirty();
9624
9625 if (parent)
9626 parent.OnAttachmentQuantityChangedEx(this, delta);
9627
9629 {
9631 {
9633 }
9635 {
9636 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9638 }
9639 }
9640
9641 }
9642
9645 {
9646
9647 }
9648
9651 {
9653 }
9654
9656 {
9657 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9658
9660 {
9661 if (newLevel == GameConstants.STATE_RUINED)
9662 {
9664 EntityAI parent = GetHierarchyParent();
9665 if (parent && parent.IsFireplace())
9666 {
9667 CargoBase cargo = GetInventory().GetCargo();
9668 if (cargo)
9669 {
9671 {
9673 }
9674 }
9675 }
9676 }
9677
9679 {
9680
9682 return;
9683 }
9684
9685 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9686 {
9688 }
9689 }
9690 }
9691
9692
9694 {
9695 super.OnRightClick();
9696
9698 {
9700 {
9701 if (ScriptInputUserData.CanStoreInputUserData())
9702 {
9703 EntityAI root = GetHierarchyRoot();
9704 Man playerOwner = GetHierarchyRootPlayer();
9705 InventoryLocation dst = new InventoryLocation;
9706
9707
9708 if (!playerOwner && root && root == this)
9709 {
9711 }
9712 else
9713 {
9714
9715 GetInventory().GetCurrentInventoryLocation(dst);
9717 {
9720 {
9722 }
9723 else
9724 {
9726
9727
9728 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9729 {
9731 }
9732 else
9733 {
9734 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9735 }
9736 }
9737 }
9738 }
9739
9740 ScriptInputUserData ctx = new ScriptInputUserData;
9748 }
9749 }
9750 else if (!
GetGame().IsMultiplayer())
9751 {
9753 }
9754 }
9755 }
9756
9758 {
9759 if (root)
9760 {
9761 vector m4[4];
9762 root.GetTransform(m4);
9763 dst.SetGround(this, m4);
9764 }
9765 else
9766 {
9767 GetInventory().GetCurrentInventoryLocation(dst);
9768 }
9769 }
9770
9771 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9772 {
9773
9774 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9775 return false;
9776
9777 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9778 return false;
9779
9780
9782 return false;
9783
9784
9785 Magazine mag = Magazine.Cast(this);
9786 if (mag)
9787 {
9788 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9789 return false;
9790
9791 if (stack_max_limit)
9792 {
9793 Magazine other_mag = Magazine.Cast(other_item);
9794 if (other_item)
9795 {
9796 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9797 return false;
9798 }
9799
9800 }
9801 }
9802 else
9803 {
9804
9806 return false;
9807
9809 return false;
9810 }
9811
9812 PlayerBase player = null;
9813 if (CastTo(player, GetHierarchyRootPlayer()))
9814 {
9815 if (player.GetInventory().HasAttachment(this))
9816 return false;
9817
9818 if (player.IsItemsToDelete())
9819 return false;
9820 }
9821
9822 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9823 return false;
9824
9825 int slotID;
9827 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9828 return false;
9829
9830 return true;
9831 }
9832
9834 {
9836 }
9837
9839 {
9840 return m_IsResultOfSplit;
9841 }
9842
9844 {
9845 m_IsResultOfSplit = value;
9846 }
9847
9849 {
9851 }
9852
9854 {
9855 float other_item_quantity = other_item.GetQuantity();
9856 float this_free_space;
9857
9859
9861
9862 if (other_item_quantity > this_free_space)
9863 {
9864 return this_free_space;
9865 }
9866 else
9867 {
9868 return other_item_quantity;
9869 }
9870 }
9871
9873 {
9875 }
9876
9878 {
9880 return;
9881
9882 if (!IsMagazine() && other_item)
9883 {
9885 if (quantity_used != 0)
9886 {
9887 float hp1 = GetHealth01("","");
9888 float hp2 = other_item.GetHealth01("","");
9889 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9890 hpResult = hpResult / (
GetQuantity() + quantity_used);
9891
9892 hpResult *= GetMaxHealth();
9893 Math.Round(hpResult);
9894 SetHealth("", "Health", hpResult);
9895
9897 other_item.AddQuantity(-quantity_used);
9898 }
9899 }
9901 }
9902
9904 {
9905 #ifdef SERVER
9906 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9907 GetHierarchyParent().IncreaseLifetimeUp();
9908 #endif
9909 };
9910
9912 {
9913 PlayerBase p = PlayerBase.Cast(player);
9914
9915 array<int> recipesIds = p.m_Recipes;
9916 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9917 if (moduleRecipesManager)
9918 {
9919 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9920 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9921 }
9922
9923 for (int i = 0;i < recipesIds.Count(); i++)
9924 {
9925 int key = recipesIds.Get(i);
9926 string recipeName = moduleRecipesManager.GetRecipeName(key);
9928 }
9929 }
9930
9931
9932 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9933 {
9934 super.GetDebugActions(outputList);
9935
9936
9942
9943
9948
9953
9954
9958
9959
9961 {
9965 }
9966
9969
9970
9974
9976
9977 InventoryLocation loc = new InventoryLocation();
9978 GetInventory().GetCurrentInventoryLocation(loc);
9980 {
9981 if (Gizmo_IsSupported())
9984 }
9985
9987 }
9988
9989
9990
9991
9993 {
9994 super.OnAction(action_id, player, ctx);
9995
9997 {
9998 switch (action_id)
9999 {
10002 return true;
10005 return true;
10006 }
10007 }
10008
10010 {
10011 switch (action_id)
10012 {
10014 Delete();
10015 return true;
10016 }
10017 }
10018
10019 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10020 {
10021 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10022 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10023 PlayerBase p = PlayerBase.Cast(player);
10024 if (
EActions.RECIPES_RANGE_START < 1000)
10025 {
10026 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10027 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10028 }
10029 }
10030 #ifndef SERVER
10031 else if (action_id ==
EActions.WATCH_PLAYER)
10032 {
10033 PluginDeveloper.SetDeveloperItemClientEx(player);
10034 }
10035 #endif
10037 {
10038 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10039 {
10040 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10041 OnDebugButtonPressServer(id + 1);
10042 }
10043
10044 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10045 {
10046 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10048 }
10049
10050 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10051 {
10052 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10054 }
10055
10056 else if (action_id ==
EActions.ADD_QUANTITY)
10057 {
10058 if (IsMagazine())
10059 {
10060 Magazine mag = Magazine.Cast(this);
10061 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10062 }
10063 else
10064 {
10066 }
10067
10068 if (m_EM)
10069 {
10070 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10071 }
10072
10073 }
10074
10075 else if (action_id ==
EActions.REMOVE_QUANTITY)
10076 {
10077 if (IsMagazine())
10078 {
10079 Magazine mag2 = Magazine.Cast(this);
10080 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10081 }
10082 else
10083 {
10085 }
10086 if (m_EM)
10087 {
10088 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10089 }
10090
10091 }
10092
10093 else if (action_id ==
EActions.SET_QUANTITY_0)
10094 {
10096
10097 if (m_EM)
10098 {
10099 m_EM.SetEnergy(0);
10100 }
10101 }
10102
10103 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10104 {
10106
10107 if (m_EM)
10108 {
10109 m_EM.SetEnergy(m_EM.GetEnergyMax());
10110 }
10111 }
10112
10113 else if (action_id ==
EActions.ADD_HEALTH)
10114 {
10115 AddHealth("","",GetMaxHealth("","Health")/5);
10116 }
10117 else if (action_id ==
EActions.REMOVE_HEALTH)
10118 {
10119 AddHealth("","",-GetMaxHealth("","Health")/5);
10120 }
10121 else if (action_id ==
EActions.DESTROY_HEALTH)
10122 {
10123 SetHealth01("","",0);
10124 }
10125 else if (action_id ==
EActions.WATCH_ITEM)
10126 {
10128 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10129 #ifdef DEVELOPER
10130 SetDebugDeveloper_item(this);
10131 #endif
10132 }
10133
10134 else if (action_id ==
EActions.ADD_TEMPERATURE)
10135 {
10136 AddTemperature(20);
10137
10138 }
10139
10140 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10141 {
10142 AddTemperature(-20);
10143
10144 }
10145
10146 else if (action_id ==
EActions.FLIP_FROZEN)
10147 {
10148 SetFrozen(!GetIsFrozen());
10149
10150 }
10151
10152 else if (action_id ==
EActions.ADD_WETNESS)
10153 {
10155
10156 }
10157
10158 else if (action_id ==
EActions.REMOVE_WETNESS)
10159 {
10161
10162 }
10163
10164 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10165 {
10168
10169
10170 }
10171
10172 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10173 {
10176 }
10177
10178 else if (action_id ==
EActions.MAKE_SPECIAL)
10179 {
10180 auto debugParams = DebugSpawnParams.WithPlayer(player);
10181 OnDebugSpawnEx(debugParams);
10182 }
10183
10184 }
10185
10186
10187 return false;
10188 }
10189
10190
10191
10192
10196
10199
10200
10201
10203 {
10204 return false;
10205 }
10206
10207
10209 {
10210 return true;
10211 }
10212
10213
10215 {
10216 return true;
10217 }
10218
10219
10220
10222 {
10223 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10225 }
10226
10229 {
10230 return null;
10231 }
10232
10234 {
10235 return false;
10236 }
10237
10239 {
10240 return false;
10241 }
10242
10246
10247
10249 {
10250 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10251 return module_repairing.CanRepair(this, item_repair_kit);
10252 }
10253
10254
10255 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10256 {
10257 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10258 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10259 }
10260
10261
10263 {
10264
10265
10266
10267
10268
10269
10270
10271
10272 return 1;
10273 }
10274
10275
10276
10278 {
10280 }
10281
10282
10283
10285 {
10287 }
10288
10289
10298 {
10299 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10300
10301 if (player)
10302 {
10303 player.MessageStatus(text);
10304 }
10305 }
10306
10307
10316 {
10317 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10318
10319 if (player)
10320 {
10321 player.MessageAction(text);
10322 }
10323 }
10324
10325
10334 {
10335 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10336
10337 if (player)
10338 {
10339 player.MessageFriendly(text);
10340 }
10341 }
10342
10343
10352 {
10353 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10354
10355 if (player)
10356 {
10357 player.MessageImportant(text);
10358 }
10359 }
10360
10362 {
10363 return true;
10364 }
10365
10366
10367 override bool KindOf(
string tag)
10368 {
10369 bool found = false;
10370 string item_name = this.
GetType();
10373
10374 int array_size = item_tag_array.Count();
10375 for (int i = 0; i < array_size; i++)
10376 {
10377 if (item_tag_array.Get(i) == tag)
10378 {
10379 found = true;
10380 break;
10381 }
10382 }
10383 return found;
10384 }
10385
10386
10388 {
10389
10390 super.OnRPC(sender, rpc_type,ctx);
10391
10392
10393 switch (rpc_type)
10394 {
10395 #ifndef SERVER
10396 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10397 Param2<bool, string> p = new Param2<bool, string>(false, "");
10398
10400 return;
10401
10402 bool play = p.param1;
10403 string soundSet = p.param2;
10404
10405 if (play)
10406 {
10408 {
10410 {
10412 }
10413 }
10414 else
10415 {
10417 }
10418 }
10419 else
10420 {
10422 }
10423
10424 break;
10425 #endif
10426
10427 }
10428
10430 {
10432 }
10433 }
10434
10435
10436
10437
10439 {
10440 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10441 return plugin.GetID(
name);
10442 }
10443
10445 {
10446 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10447 return plugin.GetName(id);
10448 }
10449
10452 {
10453
10454
10455 int varFlags;
10456 if (!ctx.
Read(varFlags))
10457 return;
10458
10459 if (varFlags & ItemVariableFlags.FLOAT)
10460 {
10462 }
10463 }
10464
10466 {
10467
10468 super.SerializeNumericalVars(floats_out);
10469
10470
10471
10473 {
10475 }
10476
10478 {
10480 }
10481
10483 {
10485 }
10486
10488 {
10493 }
10494
10496 {
10498 }
10499 }
10500
10502 {
10503
10504 super.DeSerializeNumericalVars(floats);
10505
10506
10507 int index = 0;
10508 int mask = Math.Round(floats.Get(index));
10509
10510 index++;
10511
10513 {
10515 {
10517 }
10518 else
10519 {
10520 float quantity = floats.Get(index);
10521 SetQuantity(quantity,
true,
false,
false,
false);
10522 }
10523 index++;
10524 }
10525
10527 {
10528 float wet = floats.Get(index);
10530 index++;
10531 }
10532
10534 {
10535 int liquidtype = Math.Round(floats.Get(index));
10537 index++;
10538 }
10539
10541 {
10543 index++;
10545 index++;
10547 index++;
10549 index++;
10550 }
10551
10553 {
10554 int cleanness = Math.Round(floats.Get(index));
10556 index++;
10557 }
10558 }
10559
10561 {
10562 super.WriteVarsToCTX(ctx);
10563
10564
10566 {
10568 }
10569
10571 {
10573 }
10574
10576 {
10578 }
10579
10581 {
10582 int r,g,b,a;
10588 }
10589
10591 {
10593 }
10594 }
10595
10597 {
10598 if (!super.ReadVarsFromCTX(ctx,version))
10599 return false;
10600
10601 int intValue;
10602 float value;
10603
10604 if (version < 140)
10605 {
10606 if (!ctx.
Read(intValue))
10607 return false;
10608
10609 m_VariablesMask = intValue;
10610 }
10611
10613 {
10614 if (!ctx.
Read(value))
10615 return false;
10616
10618 {
10620 }
10621 else
10622 {
10624 }
10625 }
10626
10627 if (version < 140)
10628 {
10630 {
10631 if (!ctx.
Read(value))
10632 return false;
10633 SetTemperatureDirect(value);
10634 }
10635 }
10636
10638 {
10639 if (!ctx.
Read(value))
10640 return false;
10642 }
10643
10645 {
10646 if (!ctx.
Read(intValue))
10647 return false;
10649 }
10650
10652 {
10653 int r,g,b,a;
10655 return false;
10657 return false;
10659 return false;
10661 return false;
10662
10664 }
10665
10667 {
10668 if (!ctx.
Read(intValue))
10669 return false;
10671 }
10672
10673 if (version >= 138 && version < 140)
10674 {
10676 {
10677 if (!ctx.
Read(intValue))
10678 return false;
10679 SetFrozen(intValue);
10680 }
10681 }
10682
10683 return true;
10684 }
10685
10686
10688 {
10691 {
10693 }
10694
10695 if (!super.OnStoreLoad(ctx, version))
10696 {
10698 return false;
10699 }
10700
10701 if (version >= 114)
10702 {
10703 bool hasQuickBarIndexSaved;
10704
10705 if (!ctx.
Read(hasQuickBarIndexSaved))
10706 {
10708 return false;
10709 }
10710
10711 if (hasQuickBarIndexSaved)
10712 {
10713 int itmQBIndex;
10714
10715
10716 if (!ctx.
Read(itmQBIndex))
10717 {
10719 return false;
10720 }
10721
10722 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10723 if (itmQBIndex != -1 && parentPlayer)
10724 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10725 }
10726 }
10727 else
10728 {
10729
10730 PlayerBase player;
10731 int itemQBIndex;
10732 if (version ==
int.
MAX)
10733 {
10734 if (!ctx.
Read(itemQBIndex))
10735 {
10737 return false;
10738 }
10739 }
10740 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10741 {
10742
10743 if (!ctx.
Read(itemQBIndex))
10744 {
10746 return false;
10747 }
10748 if (itemQBIndex != -1 && player)
10749 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10750 }
10751 }
10752
10753 if (version < 140)
10754 {
10755
10756 if (!LoadVariables(ctx, version))
10757 {
10759 return false;
10760 }
10761 }
10762
10763
10765 {
10767 return false;
10768 }
10769 if (version >= 132)
10770 {
10772 if (raib)
10773 {
10775 {
10777 return false;
10778 }
10779 }
10780 }
10781
10783 return true;
10784 }
10785
10786
10787
10789 {
10790 super.OnStoreSave(ctx);
10791
10792 PlayerBase player;
10793 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10794 {
10796
10797 int itemQBIndex = -1;
10798 itemQBIndex = player.FindQuickBarEntityIndex(this);
10799 ctx.
Write(itemQBIndex);
10800 }
10801 else
10802 {
10804 }
10805
10807
10809 if (raib)
10810 {
10812 }
10813 }
10814
10815
10817 {
10818 super.AfterStoreLoad();
10819
10821 {
10823 }
10824
10826 {
10829 }
10830 }
10831
10833 {
10834 super.EEOnAfterLoad();
10835
10837 {
10839 }
10840
10843 }
10844
10846 {
10847 return false;
10848 }
10849
10850
10851
10853 {
10855 {
10856 #ifdef PLATFORM_CONSOLE
10857
10859 {
10861 if (menu)
10862 {
10864 }
10865 }
10866 #endif
10867 }
10868
10870 {
10873 }
10874
10876 {
10877 SetWeightDirty();
10879 }
10881 {
10884 }
10885
10887 {
10890 }
10892 {
10895 }
10896
10897 super.OnVariablesSynchronized();
10898 }
10899
10900
10901
10903 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10904 {
10905 if (!IsServerCheck(allow_client))
10906 return false;
10907
10909 return false;
10910
10913
10914 if (value <= (min + 0.001))
10915 value = min;
10916
10917 if (value == min)
10918 {
10919 if (destroy_config)
10920 {
10921 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10922 if (dstr)
10923 {
10925 this.Delete();
10926 return true;
10927 }
10928 }
10929 else if (destroy_forced)
10930 {
10932 this.Delete();
10933 return true;
10934 }
10935
10937 }
10938
10941
10943 {
10945
10946 if (delta)
10948 }
10949
10951
10952 return false;
10953 }
10954
10955
10957 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10958 {
10960 }
10961
10963 {
10966 }
10967
10969 {
10972 }
10973
10975 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10976 {
10977 float value_clamped = Math.Clamp(value, 0, 1);
10979 SetQuantity(result, destroy_config, destroy_forced);
10980 }
10981
10982
10985 {
10987 }
10988
10990 {
10992 }
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11004 {
11005 int slot = -1;
11006 if (GetInventory())
11007 {
11008 InventoryLocation il = new InventoryLocation;
11009 GetInventory().GetCurrentInventoryLocation(il);
11011 }
11012
11014 }
11015
11017 {
11018 float quantity_max = 0;
11019
11021 {
11022 if (attSlotID != -1)
11023 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11024
11025 if (quantity_max <= 0)
11027 }
11028
11029 if (quantity_max <= 0)
11031
11032 return quantity_max;
11033 }
11034
11036 {
11038 }
11039
11041 {
11043 }
11044
11045
11047 {
11049 }
11050
11052 {
11054 }
11055
11057 {
11059 }
11060
11061
11063 {
11064
11065 float weightEx = GetWeightEx();
11066 float special = GetInventoryAndCargoWeight();
11067 return weightEx - special;
11068 }
11069
11070
11072 {
11074 }
11075
11077 {
11079 {
11080 #ifdef DEVELOPER
11081 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11082 {
11083 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11085 }
11086 #endif
11087
11088 return GetQuantity() * GetConfigWeightModified();
11089 }
11090 else if (HasEnergyManager())
11091 {
11092 #ifdef DEVELOPER
11093 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11094 {
11095 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11096 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11097 }
11098 #endif
11099 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11100 }
11101 else
11102 {
11103 #ifdef DEVELOPER
11104 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11105 {
11106 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11107 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11108 }
11109 #endif
11110 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11111 }
11112 }
11113
11116 {
11117 int item_count = 0;
11119
11120 if (GetInventory().GetCargo() != NULL)
11121 {
11122 item_count = GetInventory().GetCargo().GetItemCount();
11123 }
11124
11125 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11126 {
11127 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11128 if (item)
11129 item_count += item.GetNumberOfItems();
11130 }
11131 return item_count;
11132 }
11133
11136 {
11137 float weight = 0;
11138 float wetness = 1;
11139 if (include_wetness)
11142 {
11143 weight = wetness * m_ConfigWeight;
11144 }
11146 {
11147 weight = 1;
11148 }
11149 return weight;
11150 }
11151
11152
11153
11155 {
11156 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11157 {
11158 GameInventory inv = GetInventory();
11159 array<EntityAI> items = new array<EntityAI>;
11161 for (int i = 0; i < items.Count(); i++)
11162 {
11164 if (item)
11165 {
11167 }
11168 }
11169 }
11170 }
11171
11172
11173
11174
11176 {
11177 float energy = 0;
11178 if (HasEnergyManager())
11179 {
11180 energy = GetCompEM().GetEnergy();
11181 }
11182 return energy;
11183 }
11184
11185
11187 {
11188 super.OnEnergyConsumed();
11189
11191 }
11192
11194 {
11195 super.OnEnergyAdded();
11196
11198 }
11199
11200
11202 {
11203 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11204 {
11206 {
11207 float energy_0to1 = GetCompEM().GetEnergy0To1();
11209 }
11210 }
11211 }
11212
11213
11215 {
11216 return ConfigGetFloat("heatIsolation");
11217 }
11218
11220 {
11222 }
11223
11225 {
11226 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11227 if (
GetGame().ConfigIsExisting(paramPath))
11229
11230 return 0.0;
11231 }
11232
11234 {
11235 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11236 if (
GetGame().ConfigIsExisting(paramPath))
11238
11239 return 0.0;
11240 }
11241
11242 override void SetWet(
float value,
bool allow_client =
false)
11243 {
11244 if (!IsServerCheck(allow_client))
11245 return;
11246
11249
11251
11252 m_VarWet = Math.Clamp(value, min, max);
11253
11255 {
11258 }
11259 }
11260
11261 override void AddWet(
float value)
11262 {
11264 }
11265
11267 {
11269 }
11270
11272 {
11274 }
11275
11277 {
11279 }
11280
11282 {
11284 }
11285
11287 {
11289 }
11290
11291 override void OnWetChanged(
float newVal,
float oldVal)
11292 {
11295 if (newLevel != oldLevel)
11296 {
11298 }
11299 }
11300
11302 {
11303 SetWeightDirty();
11304 }
11305
11307 {
11308 return GetWetLevelInternal(
m_VarWet);
11309 }
11310
11311
11312
11314 {
11316 }
11317
11319 {
11321 }
11322
11324 {
11326 }
11327
11329 {
11331 }
11332
11333
11334
11336 {
11337 if (ConfigIsExisting("itemModelLength"))
11338 {
11339 return ConfigGetFloat("itemModelLength");
11340 }
11341 return 0;
11342 }
11343
11345 {
11346 if (ConfigIsExisting("itemAttachOffset"))
11347 {
11348 return ConfigGetFloat("itemAttachOffset");
11349 }
11350 return 0;
11351 }
11352
11353 override void SetCleanness(
int value,
bool allow_client =
false)
11354 {
11355 if (!IsServerCheck(allow_client))
11356 return;
11357
11359
11361
11364 }
11365
11367 {
11369 }
11370
11372 {
11373 return true;
11374 }
11375
11376
11377
11378
11380 {
11382 }
11383
11385 {
11387 }
11388
11389
11390
11391
11392 override void SetColor(
int r,
int g,
int b,
int a)
11393 {
11399 }
11401 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11402 {
11407 }
11408
11410 {
11412 }
11413
11416 {
11417 int r,g,b,a;
11419 r = r/255;
11420 g = g/255;
11421 b = b/255;
11422 a = a/255;
11423 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11424 }
11425
11426
11427
11428 override void SetLiquidType(
int value,
bool allow_client =
false)
11429 {
11430 if (!IsServerCheck(allow_client))
11431 return;
11432
11437 }
11438
11440 {
11441 return ConfigGetInt("varLiquidTypeInit");
11442 }
11443
11445 {
11447 }
11448
11450 {
11452 SetFrozen(false);
11453 }
11454
11457 {
11458 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11459 }
11460
11461
11464 {
11465 PlayerBase nplayer;
11466 if (PlayerBase.CastTo(nplayer, player))
11467 {
11469
11470 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11471 }
11472 }
11473
11474
11477 {
11478 PlayerBase nplayer;
11479 if (PlayerBase.CastTo(nplayer,player))
11480 {
11481
11482 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11483
11484 }
11485
11486
11487 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11488
11489
11490 if (HasEnergyManager())
11491 {
11492 GetCompEM().UpdatePlugState();
11493 }
11494 }
11495
11496
11498 {
11499 super.OnPlacementStarted(player);
11500
11502 }
11503
11504 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11505 {
11507 {
11508 m_AdminLog.OnPlacementComplete(player,
this);
11509 }
11510
11511 super.OnPlacementComplete(player, position, orientation);
11512 }
11513
11514
11515
11516
11517
11519 {
11521 {
11522 return true;
11523 }
11524 else
11525 {
11526 return false;
11527 }
11528 }
11529
11530
11532 {
11534 {
11536 }
11537 }
11538
11539
11541 {
11543 }
11544
11546 {
11548 }
11549
11550 override void InsertAgent(
int agent,
float count = 1)
11551 {
11552 if (count < 1)
11553 return;
11554
11556 }
11557
11560 {
11562 }
11563
11564
11566 {
11568 }
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
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
11612 {
11614 return false;
11615 return true;
11616 }
11617
11619 {
11620
11622 }
11623
11624
11627 {
11628 super.CheckForRoofLimited(timeTresholdMS);
11629
11631 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11632 {
11633 m_PreviousRoofTestTime = time;
11634 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11635 }
11636 }
11637
11638
11640 {
11642 {
11643 return 0;
11644 }
11645
11646 if (GetInventory().GetAttachmentSlotsCount() != 0)
11647 {
11648 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11649 if (filter)
11650 return filter.GetProtectionLevel(type, false, system);
11651 else
11652 return 0;
11653 }
11654
11655 string subclassPath, entryName;
11656
11657 switch (type)
11658 {
11660 entryName = "biological";
11661 break;
11663 entryName = "chemical";
11664 break;
11665 default:
11666 entryName = "biological";
11667 break;
11668 }
11669
11670 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11671
11673 }
11674
11675
11676
11679 {
11680 if (!IsMagazine())
11682
11684 }
11685
11686
11687
11688
11689
11694 {
11695 return true;
11696 }
11697
11699 {
11701 }
11702
11703
11704
11705
11706
11708 {
11709 if (parent)
11710 {
11711 if (parent.IsInherited(DayZInfected))
11712 return true;
11713
11714 if (!parent.IsRuined())
11715 return true;
11716 }
11717
11718 return true;
11719 }
11720
11722 {
11723 if (!super.CanPutAsAttachment(parent))
11724 {
11725 return false;
11726 }
11727
11728 if (!IsRuined() && !parent.IsRuined())
11729 {
11730 return true;
11731 }
11732
11733 return false;
11734 }
11735
11737 {
11738
11739
11740
11741
11742 return super.CanReceiveItemIntoCargo(item);
11743 }
11744
11746 {
11747
11748
11749
11750
11751 GameInventory attachmentInv = attachment.GetInventory();
11753 {
11754 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11755 return false;
11756 }
11757
11758 InventoryLocation loc = new InventoryLocation();
11759 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11760 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11761 return false;
11762
11763 return super.CanReceiveAttachment(attachment, slotId);
11764 }
11765
11767 {
11768 if (!super.CanReleaseAttachment(attachment))
11769 return false;
11770
11771 return GetInventory().AreChildrenAccessible();
11772 }
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11795 {
11796 int id = muzzle_owner.GetMuzzleID();
11797 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11798
11799 if (WPOF_array)
11800 {
11801 for (int i = 0; i < WPOF_array.Count(); i++)
11802 {
11803 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11804
11805 if (WPOF)
11806 {
11807 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11808 }
11809 }
11810 }
11811 }
11812
11813
11815 {
11816 int id = muzzle_owner.GetMuzzleID();
11818
11819 if (WPOBE_array)
11820 {
11821 for (int i = 0; i < WPOBE_array.Count(); i++)
11822 {
11823 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11824
11825 if (WPOBE)
11826 {
11827 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11828 }
11829 }
11830 }
11831 }
11832
11833
11835 {
11836 int id = muzzle_owner.GetMuzzleID();
11837 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11838
11839 if (WPOOH_array)
11840 {
11841 for (int i = 0; i < WPOOH_array.Count(); i++)
11842 {
11843 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11844
11845 if (WPOOH)
11846 {
11847 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11848 }
11849 }
11850 }
11851 }
11852
11853
11855 {
11856 int id = muzzle_owner.GetMuzzleID();
11857 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11858
11859 if (WPOOH_array)
11860 {
11861 for (int i = 0; i < WPOOH_array.Count(); i++)
11862 {
11863 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11864
11865 if (WPOOH)
11866 {
11867 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11868 }
11869 }
11870 }
11871 }
11872
11873
11875 {
11876 int id = muzzle_owner.GetMuzzleID();
11877 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11878
11879 if (WPOOH_array)
11880 {
11881 for (int i = 0; i < WPOOH_array.Count(); i++)
11882 {
11883 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11884
11885 if (WPOOH)
11886 {
11887 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11888 }
11889 }
11890 }
11891 }
11892
11893
11894
11896 {
11898 {
11899 return true;
11900 }
11901
11902 return false;
11903 }
11904
11906 {
11908 {
11909 return true;
11910 }
11911
11912 return false;
11913 }
11914
11916 {
11918 {
11919 return true;
11920 }
11921
11922 return false;
11923 }
11924
11926 {
11927 return false;
11928 }
11929
11932 {
11933 return UATimeSpent.DEFAULT_DEPLOY;
11934 }
11935
11936
11937
11938
11940 {
11942 SetSynchDirty();
11943 }
11944
11946 {
11948 }
11949
11950
11952 {
11953 return false;
11954 }
11955
11958 {
11959 string att_type = "None";
11960
11961 if (ConfigIsExisting("soundAttType"))
11962 {
11963 att_type = ConfigGetString("soundAttType");
11964 }
11965
11967 }
11968
11970 {
11972 }
11973
11974
11975
11976
11977
11983
11985 {
11988
11990 }
11991
11992
11994 {
11996 return;
11997
11999
12002
12005
12006 SoundParameters params = new SoundParameters();
12010 }
12011
12012
12014 {
12016 return;
12017
12019 SetSynchDirty();
12020
12023 }
12024
12025
12027 {
12029 return;
12030
12032 SetSynchDirty();
12033
12036 }
12037
12039 {
12041 }
12042
12044 {
12046 }
12047
12050 {
12051 if (!
GetGame().IsDedicatedServer())
12052 {
12053 if (ConfigIsExisting("attachSoundSet"))
12054 {
12055 string cfg_path = "";
12056 string soundset = "";
12057 string type_name =
GetType();
12058
12061 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12062 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12063
12064 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12065 {
12066 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12067 {
12068 if (cfg_slot_array[i] == slot_type)
12069 {
12070 soundset = cfg_soundset_array[i];
12071 break;
12072 }
12073 }
12074 }
12075
12076 if (soundset != "")
12077 {
12078 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12080 }
12081 }
12082 }
12083 }
12084
12086 {
12087
12088 }
12089
12090 void OnApply(PlayerBase player);
12091
12093 {
12094 return 1.0;
12095 };
12096
12098 {
12100 }
12101
12103 {
12105 }
12106
12108
12110 {
12111 SetDynamicPhysicsLifeTime(0.01);
12113 }
12114
12116 {
12117 array<string> zone_names = new array<string>;
12118 GetDamageZones(zone_names);
12119 for (int i = 0; i < zone_names.Count(); i++)
12120 {
12121 SetHealthMax(zone_names.Get(i),"Health");
12122 }
12123 SetHealthMax("","Health");
12124 }
12125
12128 {
12129 float global_health = GetHealth01("","Health");
12130 array<string> zones = new array<string>;
12131 GetDamageZones(zones);
12132
12133 for (int i = 0; i < zones.Count(); i++)
12134 {
12135 SetHealth01(zones.Get(i),"Health",global_health);
12136 }
12137 }
12138
12141 {
12142 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12143 }
12144
12146 {
12147 if (!hasRootAsPlayer)
12148 {
12149 if (refParentIB)
12150 {
12151
12152 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12153 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12154
12155 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12156 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12157
12160 }
12161 else
12162 {
12163
12166 }
12167 }
12168 }
12169
12171 {
12173 {
12174 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12175 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12176 {
12177 float heatPermCoef = 1.0;
12179 while (ent)
12180 {
12181 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12182 ent = ent.GetHierarchyParent();
12183 }
12184
12185 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12186 }
12187 }
12188 }
12189
12191 {
12192
12193 EntityAI parent = GetHierarchyParent();
12194 if (!parent)
12195 {
12196 hasParent = false;
12197 hasRootAsPlayer = false;
12198 }
12199 else
12200 {
12201 hasParent = true;
12202 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12203 refParentIB =
ItemBase.Cast(parent);
12204 }
12205 }
12206
12207 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12208 {
12209
12210 }
12211
12213 {
12214
12215 return false;
12216 }
12217
12219 {
12220
12221
12222 return false;
12223 }
12224
12226 {
12227
12228 return false;
12229 }
12230
12233 {
12234 return !GetIsFrozen() &&
IsOpen();
12235 }
12236
12238 {
12239 bool hasParent = false, hasRootAsPlayer = false;
12241
12242 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12243 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12244
12245 if (wwtu || foodDecay)
12246 {
12250
12251 if (processWetness || processTemperature || processDecay)
12252 {
12254
12255 if (processWetness)
12256 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12257
12258 if (processTemperature)
12260
12261 if (processDecay)
12262 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12263 }
12264 }
12265 }
12266
12269 {
12271 }
12272
12274 {
12277
12278 return super.GetTemperatureFreezeThreshold();
12279 }
12280
12282 {
12285
12286 return super.GetTemperatureThawThreshold();
12287 }
12288
12290 {
12293
12294 return super.GetItemOverheatThreshold();
12295 }
12296
12298 {
12300 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12301
12302 return super.GetTemperatureFreezeTime();
12303 }
12304
12306 {
12308 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12309
12310 return super.GetTemperatureThawTime();
12311 }
12312
12317
12319 {
12320 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12321 }
12322
12324 {
12325 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12326 }
12327
12330 {
12332 }
12333
12335 {
12337 }
12338
12340 {
12342 }
12343
12346 {
12347 return null;
12348 }
12349
12352 {
12353 return false;
12354 }
12355
12357 {
12359 {
12362 if (!trg)
12363 {
12365 explosive = this;
12366 }
12367
12368 explosive.PairRemote(trg);
12370
12371 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12372 trg.SetPersistentPairID(persistentID);
12373 explosive.SetPersistentPairID(persistentID);
12374
12375 return true;
12376 }
12377 return false;
12378 }
12379
12382 {
12383 float ret = 1.0;
12386 ret *= GetHealth01();
12387
12388 return ret;
12389 }
12390
12391 #ifdef DEVELOPER
12392 override void SetDebugItem()
12393 {
12394 super.SetDebugItem();
12395 _itemBase = this;
12396 }
12397
12399 {
12400 string text = super.GetDebugText();
12401
12403 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12404
12405 return text;
12406 }
12407 #endif
12408
12410 {
12411 return true;
12412 }
12413
12415
12417
12419 {
12422 }
12423
12424
12432
12448}
12449
12451{
12453 if (entity)
12454 {
12455 bool is_item = entity.IsInherited(
ItemBase);
12456 if (is_item && full_quantity)
12457 {
12460 }
12461 }
12462 else
12463 {
12465 return NULL;
12466 }
12467 return entity;
12468}
12469
12471{
12472 if (item)
12473 {
12474 if (health > 0)
12475 item.SetHealth("", "", health);
12476
12477 if (item.CanHaveTemperature())
12478 {
12480 if (item.CanFreeze())
12481 item.SetFrozen(false);
12482 }
12483
12484 if (item.HasEnergyManager())
12485 {
12486 if (quantity >= 0)
12487 {
12488 item.GetCompEM().SetEnergy0To1(quantity);
12489 }
12490 else
12491 {
12493 }
12494 }
12495 else if (item.IsMagazine())
12496 {
12497 Magazine mag = Magazine.Cast(item);
12498 if (quantity >= 0)
12499 {
12500 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12501 }
12502 else
12503 {
12505 }
12506
12507 }
12508 else
12509 {
12510 if (quantity >= 0)
12511 {
12512 item.SetQuantityNormalized(quantity, false);
12513 }
12514 else
12515 {
12517 }
12518
12519 }
12520 }
12521}
12522
12523#ifdef DEVELOPER
12525#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.