7610{
7612 {
7613 return true;
7614 }
7615};
7616
7617
7618
7620{
7624
7626
7629
7630
7631
7632
7633
7642
7648
7653
7658
7679 protected bool m_IsResultOfSplit
7680
7682
7687
7688
7689
7691
7695
7696
7697
7699
7702
7703
7704
7710
7711
7719
7722
7723
7725
7726
7728
7729
7734
7735
7740
7741
7743
7744
7746 {
7751
7752 if (!
GetGame().IsDedicatedServer())
7753 {
7755 {
7757
7759 {
7761 }
7762 }
7763
7766 }
7767
7768 m_OldLocation = null;
7769
7771 {
7773 }
7774
7775 if (ConfigIsExisting("headSelectionsToHide"))
7776 {
7779 }
7780
7782 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7783 {
7785 }
7786
7788
7789 m_IsResultOfSplit = false;
7790
7792 }
7793
7795 {
7796 super.InitItemVariables();
7797
7803 m_Count = ConfigGetInt(
"count");
7804
7807
7812
7815
7820
7832
7836
7837
7840 if (ConfigIsExisting("canBeSplit"))
7841 {
7844 }
7845
7847 if (ConfigIsExisting("itemBehaviour"))
7849
7850
7853 RegisterNetSyncVariableInt("m_VarLiquidType");
7854 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7855
7856 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7857 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7858 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7859
7860 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7861 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7862 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7863 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7864
7865 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7866 RegisterNetSyncVariableBool("m_IsTakeable");
7867 RegisterNetSyncVariableBool("m_IsHologram");
7868
7871 {
7874 }
7875
7877
7879 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7881
7882 }
7883
7885 {
7887 }
7888
7890 {
7893 {
7898 }
7899 }
7900
7901 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7902 {
7904 {
7907 }
7908
7910 }
7911
7913 {
7919 }
7920
7922
7924 {
7926
7927 if (!action)
7928 {
7929 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7930 return;
7931 }
7932
7934 if (!ai)
7935 {
7937 return;
7938 }
7939
7941 if (!action_array)
7942 {
7943 action_array = new array<ActionBase_Basic>;
7945 }
7946 if (LogManager.IsActionLogEnable())
7947 {
7948 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7949 }
7950
7951 if (action_array.Find(action) != -1)
7952 {
7953 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7954 }
7955 else
7956 {
7957 action_array.Insert(action);
7958 }
7959 }
7960
7962 {
7964 ActionBase action = player.GetActionManager().GetAction(actionName);
7967
7968 if (action_array)
7969 {
7970 action_array.RemoveItem(action);
7971 }
7972 }
7973
7974
7975
7977 {
7978 ActionOverrideData overrideData = new ActionOverrideData();
7982
7984 if (!actionMap)
7985 {
7988 }
7989
7990 actionMap.Insert(this.
Type(), overrideData);
7991
7992 }
7993
7995
7997
7998
8000 {
8003
8006
8007 string config_to_search = "CfgVehicles";
8008 string muzzle_owner_config;
8009
8011 {
8012 if (IsInherited(Weapon))
8013 config_to_search = "CfgWeapons";
8014
8015 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8016
8017 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8018
8020
8021 if (config_OnFire_subclass_count > 0)
8022 {
8023 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8024
8025 for (int i = 0; i < config_OnFire_subclass_count; i++)
8026 {
8027 string particle_class = "";
8029 string config_OnFire_entry = config_OnFire_class + particle_class;
8030 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8031 WPOF_array.Insert(WPOF);
8032 }
8033
8034
8036 }
8037 }
8038
8040 {
8041 config_to_search = "CfgWeapons";
8042 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8043
8044 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8045
8047
8048 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8049 {
8050 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8051
8052 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8053 {
8054 string particle_class2 = "";
8056 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8057 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8058 WPOBE_array.Insert(WPOBE);
8059 }
8060
8061
8063 }
8064 }
8065 }
8066
8067
8069 {
8072
8074 {
8075 string config_to_search = "CfgVehicles";
8076
8077 if (IsInherited(Weapon))
8078 config_to_search = "CfgWeapons";
8079
8080 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8081 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8082
8083 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8084 {
8085
8087
8089 {
8091 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8093 return;
8094 }
8095
8098
8099
8100
8102 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8103
8104 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8105 {
8106 string particle_class = "";
8108 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8110
8111 if (entry_type == CT_CLASS)
8112 {
8113 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8114 WPOOH_array.Insert(WPOF);
8115 }
8116 }
8117
8118
8120 }
8121 }
8122 }
8123
8125 {
8127 }
8128
8130 {
8132 {
8134
8137
8140
8141 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8142 }
8143 }
8144
8146 {
8148 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8149
8151 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8152
8154 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8155
8157 {
8159 }
8160 }
8161
8163 {
8165 }
8166
8168 {
8171 else
8173
8175 {
8178 }
8179 else
8180 {
8183
8186 }
8187
8189 }
8190
8192 {
8194 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8195 }
8196
8198 {
8200 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8202 }
8203
8205 {
8207 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8208 }
8209
8211 {
8214
8215 OverheatingParticle OP = new OverheatingParticle();
8220
8222 }
8223
8225 {
8228
8229 return -1;
8230 }
8231
8233 {
8235 {
8238
8239 for (int i = count; i > 0; --i)
8240 {
8241 int id = i - 1;
8244
8247
8248 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8249 {
8250 if (p)
8251 {
8254 }
8255 }
8256 }
8257 }
8258 }
8259
8261 {
8263 {
8265 {
8266 int id = i - 1;
8268
8269 if (OP)
8270 {
8272
8273 if (p)
8274 {
8276 }
8277
8278 delete OP;
8279 }
8280 }
8281
8284 }
8285 }
8286
8289 {
8290 return 0.0;
8291 }
8292
8293
8295 {
8296 return 250;
8297 }
8298
8300 {
8301 return 0;
8302 }
8303
8306 {
8308 return true;
8309
8310 return false;
8311 }
8312
8315 {
8318
8320 {
8322 }
8323 else
8324 {
8325
8327 }
8328
8330 }
8331
8338 {
8339 return -1;
8340 }
8341
8342
8343
8344
8346 {
8348 {
8350 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8351
8352 if (r_index >= 0)
8353 {
8354 InventoryLocation r_il = new InventoryLocation;
8355 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8356
8357 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8360 {
8361 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8362 }
8364 {
8365 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8366 }
8367
8368 }
8369
8370 player.GetHumanInventory().ClearUserReservedLocation(this);
8371 }
8372
8375 }
8376
8377
8378
8379
8381 {
8382 return ItemBase.m_DebugActionsMask;
8383 }
8384
8386 {
8387 return ItemBase.m_DebugActionsMask & mask;
8388 }
8389
8391 {
8392 ItemBase.m_DebugActionsMask = mask;
8393 }
8394
8396 {
8397 ItemBase.m_DebugActionsMask |= mask;
8398 }
8399
8401 {
8402 ItemBase.m_DebugActionsMask &= ~mask;
8403 }
8404
8406 {
8408 {
8410 }
8411 else
8412 {
8414 }
8415 }
8416
8417
8419 {
8420 if (GetEconomyProfile())
8421 {
8422 float q_max = GetEconomyProfile().GetQuantityMax();
8423 if (q_max > 0)
8424 {
8425 float q_min = GetEconomyProfile().GetQuantityMin();
8426 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8427
8429 {
8430 ComponentEnergyManager comp = GetCompEM();
8432 {
8434 }
8435 }
8437 {
8439
8440 }
8441
8442 }
8443 }
8444 }
8445
8448 {
8449 EntityAI parent = GetHierarchyParent();
8450
8451 if (parent)
8452 {
8453 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8454 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8455 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8456 }
8457 }
8458
8461 {
8462 EntityAI parent = GetHierarchyParent();
8463
8464 if (parent)
8465 {
8466 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8467 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8468 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8469 }
8470 }
8471
8473 {
8474
8475
8476
8477
8479
8481 {
8482 if (ScriptInputUserData.CanStoreInputUserData())
8483 {
8484 ScriptInputUserData ctx = new ScriptInputUserData;
8490 ctx.
Write(use_stack_max);
8493
8495 {
8496 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8497 }
8498 }
8499 }
8500 else if (!
GetGame().IsMultiplayer())
8501 {
8503 }
8504 }
8505
8507 {
8509 }
8510
8512 {
8514 }
8515
8517 {
8519 }
8520
8522 {
8523
8524 return false;
8525 }
8526
8528 {
8529 return false;
8530 }
8531
8535 {
8536 return false;
8537 }
8538
8540 {
8541 return "";
8542 }
8543
8545
8547 {
8548 return false;
8549 }
8550
8552 {
8553 return true;
8554 }
8555
8556
8557
8559 {
8560 return true;
8561 }
8562
8564 {
8565 return true;
8566 }
8567
8569 {
8570 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8572 }
8573
8575 {
8577 }
8578
8580 {
8582 if (!is_being_placed)
8584 SetSynchDirty();
8585 }
8586
8587
8589
8591 {
8593 }
8594
8596 {
8598 }
8599
8601 {
8602 return 1;
8603 }
8604
8606 {
8607 return false;
8608 }
8609
8611 {
8613 SetSynchDirty();
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
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8651 {
8652 super.OnMovedInsideCargo(container);
8653
8654 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8655 }
8656
8657 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8658 {
8659 super.EEItemLocationChanged(oldLoc,newLoc);
8660
8661 PlayerBase new_player = null;
8662 PlayerBase old_player = null;
8663
8664 if (newLoc.GetParent())
8665 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8666
8667 if (oldLoc.GetParent())
8668 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8669
8671 {
8672 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8673
8674 if (r_index >= 0)
8675 {
8676 InventoryLocation r_il = new InventoryLocation;
8677 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8678
8679 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8682 {
8683 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8684 }
8686 {
8687 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8688 }
8689
8690 }
8691 }
8692
8694 {
8695 if (new_player)
8696 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8697
8698 if (new_player == old_player)
8699 {
8700
8701 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8702 {
8704 {
8705 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8706 {
8707 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8708 }
8709 }
8710 else
8711 {
8712 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8713 }
8714 }
8715
8716 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8717 {
8718 int type = oldLoc.GetType();
8720 {
8721 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8722 }
8724 {
8725 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8726 }
8727 }
8728 if (!m_OldLocation)
8729 {
8730 m_OldLocation = new InventoryLocation;
8731 }
8732 m_OldLocation.Copy(oldLoc);
8733 }
8734 else
8735 {
8736 if (m_OldLocation)
8737 {
8738 m_OldLocation.Reset();
8739 }
8740 }
8741
8743 }
8744 else
8745 {
8746 if (new_player)
8747 {
8748 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8749 if (res_index >= 0)
8750 {
8751 InventoryLocation il = new InventoryLocation;
8752 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8754 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8757 {
8758 il.
GetParent().GetOnReleaseLock().Invoke(it);
8759 }
8761 {
8763 }
8764
8765 }
8766 }
8768 {
8769
8771 }
8772
8773 if (m_OldLocation)
8774 {
8775 m_OldLocation.Reset();
8776 }
8777 }
8778 }
8779
8780 override void EOnContact(IEntity other, Contact extra)
8781 {
8783 {
8784 int liquidType = -1;
8786 if (impactSpeed > 0.0)
8787 {
8789 #ifndef SERVER
8791 #else
8793 SetSynchDirty();
8794 #endif
8796 }
8797 }
8798
8799 #ifdef SERVER
8800 if (GetCompEM() && GetCompEM().IsPlugged())
8801 {
8802 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8803 GetCompEM().UnplugThis();
8804 }
8805 #endif
8806 }
8807
8809
8811 {
8813 }
8814
8816 {
8817
8818 }
8819
8821 {
8822 super.OnItemLocationChanged(old_owner, new_owner);
8823
8824 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8825 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8826
8827 if (!relatedPlayer && playerNew)
8828 relatedPlayer = playerNew;
8829
8830 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8831 {
8833 if (actionMgr)
8834 {
8835 ActionBase currentAction = actionMgr.GetRunningAction();
8836 if (currentAction)
8838 }
8839 }
8840
8841 Man ownerPlayerOld = null;
8842 Man ownerPlayerNew = null;
8843
8844 if (old_owner)
8845 {
8846 if (old_owner.
IsMan())
8847 {
8848 ownerPlayerOld = Man.Cast(old_owner);
8849 }
8850 else
8851 {
8852 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8853 }
8854 }
8855 else
8856 {
8858 {
8860
8861 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8862 {
8863 GetCompEM().UnplugThis();
8864 }
8865 }
8866 }
8867
8868 if (new_owner)
8869 {
8870 if (new_owner.
IsMan())
8871 {
8872 ownerPlayerNew = Man.Cast(new_owner);
8873 }
8874 else
8875 {
8876 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8877 }
8878 }
8879
8880 if (ownerPlayerOld != ownerPlayerNew)
8881 {
8882 if (ownerPlayerOld)
8883 {
8884 array<EntityAI> subItemsExit = new array<EntityAI>;
8886 for (int i = 0; i < subItemsExit.Count(); i++)
8887 {
8890 }
8891 }
8892
8893 if (ownerPlayerNew)
8894 {
8895 array<EntityAI> subItemsEnter = new array<EntityAI>;
8897 for (int j = 0; j < subItemsEnter.Count(); j++)
8898 {
8901 }
8902 }
8903 }
8904 else if (ownerPlayerNew != null)
8905 {
8906 PlayerBase nplayer;
8907 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8908 {
8909 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8911 for (int k = 0; k < subItemsUpdate.Count(); k++)
8912 {
8914 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8915 }
8916 }
8917 }
8918
8919 if (old_owner)
8920 old_owner.OnChildItemRemoved(this);
8921 if (new_owner)
8922 new_owner.OnChildItemReceived(this);
8923 }
8924
8925
8927 {
8928 super.EEDelete(parent);
8929 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8930 if (player)
8931 {
8933
8934 if (player.IsAlive())
8935 {
8936 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8937 if (r_index >= 0)
8938 {
8939 InventoryLocation r_il = new InventoryLocation;
8940 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8941
8942 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8945 {
8946 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8947 }
8949 {
8950 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8951 }
8952
8953 }
8954
8955 player.RemoveQuickBarEntityShortcut(this);
8956 }
8957 }
8958 }
8959
8961 {
8962 super.EEKilled(killer);
8963
8966 {
8967 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8968 {
8969 if (IsMagazine())
8970 {
8971 if (Magazine.Cast(this).GetAmmoCount() > 0)
8972 {
8974 }
8975 }
8976 else
8977 {
8979 }
8980 }
8981 }
8982 }
8983
8985 {
8986 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8987
8988 super.OnWasAttached(parent, slot_id);
8989
8992
8994 }
8995
8997 {
8998 super.OnWasDetached(parent, slot_id);
8999
9002 }
9003
9005 {
9006 int idx;
9009
9010 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9011 if (inventory_slots.Count() < 1)
9012 {
9013 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9014 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9015 }
9016 else
9017 {
9018 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9019 }
9020
9021 idx = inventory_slots.Find(slot);
9022 if (idx < 0)
9023 return "";
9024
9025 return attach_types.Get(idx);
9026 }
9027
9029 {
9030 int idx = -1;
9031 string slot;
9032
9035
9036 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9037 if (inventory_slots.Count() < 1)
9038 {
9039 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9040 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9041 }
9042 else
9043 {
9044 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9045 if (detach_types.Count() < 1)
9046 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9047 }
9048
9049 for (int i = 0; i < inventory_slots.Count(); i++)
9050 {
9051 slot = inventory_slots.Get(i);
9052 }
9053
9054 if (slot != "")
9055 {
9056 if (detach_types.Count() == 1)
9057 idx = 0;
9058 else
9059 idx = inventory_slots.Find(slot);
9060 }
9061 if (idx < 0)
9062 return "";
9063
9064 return detach_types.Get(idx);
9065 }
9066
9068 {
9069
9071
9072
9073 float min_time = 1;
9074 float max_time = 3;
9075 float delay = Math.RandomFloat(min_time, max_time);
9076
9077 explode_timer.Run(delay, this, "DoAmmoExplosion");
9078 }
9079
9081 {
9082 Magazine magazine = Magazine.Cast(this);
9083 int pop_sounds_count = 6;
9084 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9085
9086
9087 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9088 string sound_name = pop_sounds[ sound_idx ];
9090
9091
9092 magazine.ServerAddAmmoCount(-1);
9093
9094
9095 float min_temp_to_explode = 100;
9096
9097 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9098 {
9100 }
9101 }
9102
9103
9104 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9105 {
9106 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9107
9108 const int CHANCE_DAMAGE_CARGO = 4;
9109 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9110 const int CHANCE_DAMAGE_NOTHING = 2;
9111
9113 {
9114 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9115 int chances;
9116 int rnd;
9117
9118 if (GetInventory().GetCargo())
9119 {
9120 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9121 rnd = Math.RandomInt(0,chances);
9122
9123 if (rnd < CHANCE_DAMAGE_CARGO)
9124 {
9126 }
9127 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9128 {
9130 }
9131 }
9132 else
9133 {
9134 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9135 rnd = Math.RandomInt(0,chances);
9136
9137 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9138 {
9140 }
9141 }
9142 }
9143 }
9144
9146 {
9147 if (GetInventory().GetCargo())
9148 {
9149 int item_count = GetInventory().GetCargo().GetItemCount();
9150 if (item_count > 0)
9151 {
9152 int random_pick = Math.RandomInt(0, item_count);
9154 if (!item.IsExplosive())
9155 {
9156 item.AddHealth("","",damage);
9157 return true;
9158 }
9159 }
9160 }
9161 return false;
9162 }
9163
9165 {
9166 int attachment_count = GetInventory().AttachmentCount();
9167 if (attachment_count > 0)
9168 {
9169 int random_pick = Math.RandomInt(0, attachment_count);
9170 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9171 if (!attachment.IsExplosive())
9172 {
9173 attachment.AddHealth("","",damage);
9174 return true;
9175 }
9176 }
9177 return false;
9178 }
9179
9181 {
9183 }
9184
9186 {
9188 return GetInventory().CanRemoveEntity();
9189
9190 return false;
9191 }
9192
9194 {
9195
9197 return false;
9198
9199
9201 return false;
9202
9203
9204
9206 if (delta == 0)
9207 return false;
9208
9209
9210 return true;
9211 }
9212
9214 {
9216 {
9217 if (ScriptInputUserData.CanStoreInputUserData())
9218 {
9219 ScriptInputUserData ctx = new ScriptInputUserData;
9224 ctx.
Write(destination_entity);
9228 }
9229 }
9230 else if (!
GetGame().IsMultiplayer())
9231 {
9233 }
9234 }
9235
9237 {
9238 float split_quantity_new;
9242 InventoryLocation loc = new InventoryLocation;
9243
9244 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9245 {
9247 split_quantity_new = stack_max;
9248 else
9250
9252 {
9253 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9254 if (new_item)
9255 {
9256 new_item.SetResultOfSplit(true);
9257 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9259 new_item.
SetQuantity(split_quantity_new,
false,
true);
9260 }
9261 }
9262 }
9263 else if (destination_entity && slot_id == -1)
9264 {
9265 if (quantity > stack_max)
9266 split_quantity_new = stack_max;
9267 else
9268 split_quantity_new = quantity;
9269
9271 {
9273 {
9276 }
9277
9278 if (new_item)
9279 {
9280 new_item.SetResultOfSplit(true);
9281 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9283 new_item.
SetQuantity(split_quantity_new,
false,
true);
9284 }
9285 }
9286 }
9287 else
9288 {
9289 if (stack_max != 0)
9290 {
9292 {
9294 }
9295
9296 if (split_quantity_new == 0)
9297 {
9298 if (!
GetGame().IsMultiplayer())
9299 player.PhysicalPredictiveDropItem(this);
9300 else
9301 player.ServerDropEntity(this);
9302 return;
9303 }
9304
9306 {
9308
9309 if (new_item)
9310 {
9311 new_item.SetResultOfSplit(true);
9312 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9315 new_item.PlaceOnSurface();
9316 }
9317 }
9318 }
9319 }
9320 }
9321
9323 {
9324 float split_quantity_new;
9328 InventoryLocation loc = new InventoryLocation;
9329
9330 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9331 {
9333 split_quantity_new = stack_max;
9334 else
9336
9338 {
9339 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9340 if (new_item)
9341 {
9342 new_item.SetResultOfSplit(true);
9343 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9345 new_item.
SetQuantity(split_quantity_new,
false,
true);
9346 }
9347 }
9348 }
9349 else if (destination_entity && slot_id == -1)
9350 {
9351 if (quantity > stack_max)
9352 split_quantity_new = stack_max;
9353 else
9354 split_quantity_new = quantity;
9355
9357 {
9359 {
9362 }
9363
9364 if (new_item)
9365 {
9366 new_item.SetResultOfSplit(true);
9367 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9369 new_item.
SetQuantity(split_quantity_new,
false,
true);
9370 }
9371 }
9372 }
9373 else
9374 {
9375 if (stack_max != 0)
9376 {
9378 {
9380 }
9381
9383 {
9385
9386 if (new_item)
9387 {
9388 new_item.SetResultOfSplit(true);
9389 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9392 new_item.PlaceOnSurface();
9393 }
9394 }
9395 }
9396 }
9397 }
9398
9400 {
9402 {
9403 if (ScriptInputUserData.CanStoreInputUserData())
9404 {
9405 ScriptInputUserData ctx = new ScriptInputUserData;
9410 dst.WriteToContext(ctx);
9412 }
9413 }
9414 else if (!
GetGame().IsMultiplayer())
9415 {
9417 }
9418 }
9419
9421 {
9423 {
9424 if (ScriptInputUserData.CanStoreInputUserData())
9425 {
9426 ScriptInputUserData ctx = new ScriptInputUserData;
9431 ctx.
Write(destination_entity);
9437 }
9438 }
9439 else if (!
GetGame().IsMultiplayer())
9440 {
9442 }
9443 }
9444
9446 {
9448 }
9449
9451 {
9453 float split_quantity_new;
9455 if (dst.IsValid())
9456 {
9457 int slot_id = dst.GetSlot();
9459
9460 if (quantity > stack_max)
9461 split_quantity_new = stack_max;
9462 else
9463 split_quantity_new = quantity;
9464
9466 {
9468
9469 if (new_item)
9470 {
9471 new_item.SetResultOfSplit(true);
9472 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9474 new_item.
SetQuantity(split_quantity_new,
false,
true);
9475 }
9476
9477 return new_item;
9478 }
9479 }
9480
9481 return null;
9482 }
9483
9485 {
9487 float split_quantity_new;
9489 if (destination_entity)
9490 {
9492 if (quantity > stackable)
9493 split_quantity_new = stackable;
9494 else
9495 split_quantity_new = quantity;
9496
9498 {
9499 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9500 if (new_item)
9501 {
9502 new_item.SetResultOfSplit(true);
9503 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9505 new_item.
SetQuantity(split_quantity_new,
false,
true);
9506 }
9507 }
9508 }
9509 }
9510
9512 {
9514 {
9515 if (ScriptInputUserData.CanStoreInputUserData())
9516 {
9517 ScriptInputUserData ctx = new ScriptInputUserData;
9522 ItemBase destination_entity =
this;
9523 ctx.
Write(destination_entity);
9527 }
9528 }
9529 else if (!
GetGame().IsMultiplayer())
9530 {
9532 }
9533 }
9534
9536 {
9538 float split_quantity_new;
9540 if (player)
9541 {
9543 if (quantity > stackable)
9544 split_quantity_new = stackable;
9545 else
9546 split_quantity_new = quantity;
9547
9549 {
9550 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9551 new_item =
ItemBase.Cast(in_hands);
9552 if (new_item)
9553 {
9554 new_item.SetResultOfSplit(true);
9555 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9557 new_item.SetQuantity(split_quantity_new, false, true);
9558 }
9559 }
9560 }
9561 }
9562
9564 {
9566 float split_quantity_new = Math.Floor(quantity * 0.5);
9567
9569 return;
9570
9572
9573 if (new_item)
9574 {
9575 if (new_item.GetQuantityMax() < split_quantity_new)
9576 {
9577 split_quantity_new = new_item.GetQuantityMax();
9578 }
9579
9580 new_item.SetResultOfSplit(true);
9581 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9582
9584 {
9587 }
9588 else
9589 {
9591 new_item.
SetQuantity(split_quantity_new,
false,
true);
9592 }
9593 }
9594 }
9595
9597 {
9599 float split_quantity_new = Math.Floor(quantity / 2);
9600
9602 return;
9603
9604 InventoryLocation invloc = new InventoryLocation;
9606
9608 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9609
9610 if (new_item)
9611 {
9612 if (new_item.GetQuantityMax() < split_quantity_new)
9613 {
9614 split_quantity_new = new_item.GetQuantityMax();
9615 }
9617 {
9620 }
9621 else if (split_quantity_new > 1)
9622 {
9624 new_item.
SetQuantity(split_quantity_new,
false,
true);
9625 }
9626 }
9627 }
9628
9631 {
9632 SetWeightDirty();
9634
9635 if (parent)
9636 parent.OnAttachmentQuantityChangedEx(this, delta);
9637
9639 {
9641 {
9643 }
9645 {
9646 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9648 }
9649 }
9650
9651 }
9652
9655 {
9656
9657 }
9658
9661 {
9663 }
9664
9666 {
9667 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9668
9670 {
9671 if (newLevel == GameConstants.STATE_RUINED)
9672 {
9674 EntityAI parent = GetHierarchyParent();
9675 if (parent && parent.IsFireplace())
9676 {
9677 CargoBase cargo = GetInventory().GetCargo();
9678 if (cargo)
9679 {
9681 {
9683 }
9684 }
9685 }
9686 }
9687
9689 {
9690
9692 return;
9693 }
9694
9695 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9696 {
9698 }
9699 }
9700 }
9701
9702
9704 {
9705 super.OnRightClick();
9706
9708 {
9710 {
9711 if (ScriptInputUserData.CanStoreInputUserData())
9712 {
9713 EntityAI root = GetHierarchyRoot();
9714 Man playerOwner = GetHierarchyRootPlayer();
9715 InventoryLocation dst = new InventoryLocation;
9716
9717
9718 if (!playerOwner && root && root == this)
9719 {
9721 }
9722 else
9723 {
9724
9725 GetInventory().GetCurrentInventoryLocation(dst);
9727 {
9730 {
9732 }
9733 else
9734 {
9736
9737
9738 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9739 {
9741 }
9742 else
9743 {
9744 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9745 }
9746 }
9747 }
9748 }
9749
9750 ScriptInputUserData ctx = new ScriptInputUserData;
9758 }
9759 }
9760 else if (!
GetGame().IsMultiplayer())
9761 {
9763 }
9764 }
9765 }
9766
9768 {
9769 if (root)
9770 {
9771 vector m4[4];
9772 root.GetTransform(m4);
9773 dst.SetGround(this, m4);
9774 }
9775 else
9776 {
9777 GetInventory().GetCurrentInventoryLocation(dst);
9778 }
9779 }
9780
9781 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9782 {
9783
9784 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9785 return false;
9786
9787 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9788 return false;
9789
9790
9792 return false;
9793
9794
9795 Magazine mag = Magazine.Cast(this);
9796 if (mag)
9797 {
9798 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9799 return false;
9800
9801 if (stack_max_limit)
9802 {
9803 Magazine other_mag = Magazine.Cast(other_item);
9804 if (other_item)
9805 {
9806 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9807 return false;
9808 }
9809
9810 }
9811 }
9812 else
9813 {
9814
9816 return false;
9817
9819 return false;
9820 }
9821
9822 PlayerBase player = null;
9823 if (CastTo(player, GetHierarchyRootPlayer()))
9824 {
9825 if (player.GetInventory().HasAttachment(this))
9826 return false;
9827
9828 if (player.IsItemsToDelete())
9829 return false;
9830 }
9831
9832 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9833 return false;
9834
9835 int slotID;
9837 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9838 return false;
9839
9840 return true;
9841 }
9842
9844 {
9846 }
9847
9849 {
9850 return m_IsResultOfSplit;
9851 }
9852
9854 {
9855 m_IsResultOfSplit = value;
9856 }
9857
9859 {
9861 }
9862
9864 {
9865 float other_item_quantity = other_item.GetQuantity();
9866 float this_free_space;
9867
9869
9871
9872 if (other_item_quantity > this_free_space)
9873 {
9874 return this_free_space;
9875 }
9876 else
9877 {
9878 return other_item_quantity;
9879 }
9880 }
9881
9883 {
9885 }
9886
9888 {
9890 return;
9891
9892 if (!IsMagazine() && other_item)
9893 {
9895 if (quantity_used != 0)
9896 {
9897 float hp1 = GetHealth01("","");
9898 float hp2 = other_item.GetHealth01("","");
9899 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9900 hpResult = hpResult / (
GetQuantity() + quantity_used);
9901
9902 hpResult *= GetMaxHealth();
9903 Math.Round(hpResult);
9904 SetHealth("", "Health", hpResult);
9905
9907 other_item.AddQuantity(-quantity_used);
9908 }
9909 }
9911 }
9912
9914 {
9915 #ifdef SERVER
9916 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9917 GetHierarchyParent().IncreaseLifetimeUp();
9918 #endif
9919 };
9920
9922 {
9923 PlayerBase p = PlayerBase.Cast(player);
9924
9925 array<int> recipesIds = p.m_Recipes;
9926 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9927 if (moduleRecipesManager)
9928 {
9929 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9930 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9931 }
9932
9933 for (int i = 0;i < recipesIds.Count(); i++)
9934 {
9935 int key = recipesIds.Get(i);
9936 string recipeName = moduleRecipesManager.GetRecipeName(key);
9938 }
9939 }
9940
9941
9942 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9943 {
9944 super.GetDebugActions(outputList);
9945
9946
9952
9953
9958
9963
9964
9968
9969
9971 {
9975 }
9976
9979
9980
9984
9986
9987 InventoryLocation loc = new InventoryLocation();
9988 GetInventory().GetCurrentInventoryLocation(loc);
9990 {
9991 if (Gizmo_IsSupported())
9994 }
9995
9997 }
9998
9999
10000
10001
10003 {
10004 super.OnAction(action_id, player, ctx);
10005
10007 {
10008 switch (action_id)
10009 {
10012 return true;
10015 return true;
10016 }
10017 }
10018
10020 {
10021 switch (action_id)
10022 {
10024 Delete();
10025 return true;
10026 }
10027 }
10028
10029 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10030 {
10031 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10032 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10033 PlayerBase p = PlayerBase.Cast(player);
10034 if (
EActions.RECIPES_RANGE_START < 1000)
10035 {
10036 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10037 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10038 }
10039 }
10040 #ifndef SERVER
10041 else if (action_id ==
EActions.WATCH_PLAYER)
10042 {
10043 PluginDeveloper.SetDeveloperItemClientEx(player);
10044 }
10045 #endif
10047 {
10048 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10049 {
10050 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10051 OnDebugButtonPressServer(id + 1);
10052 }
10053
10054 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10055 {
10056 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10058 }
10059
10060 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10061 {
10062 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10064 }
10065
10066 else if (action_id ==
EActions.ADD_QUANTITY)
10067 {
10068 if (IsMagazine())
10069 {
10070 Magazine mag = Magazine.Cast(this);
10071 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10072 }
10073 else
10074 {
10076 }
10077
10078 if (m_EM)
10079 {
10080 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10081 }
10082
10083 }
10084
10085 else if (action_id ==
EActions.REMOVE_QUANTITY)
10086 {
10087 if (IsMagazine())
10088 {
10089 Magazine mag2 = Magazine.Cast(this);
10090 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10091 }
10092 else
10093 {
10095 }
10096 if (m_EM)
10097 {
10098 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10099 }
10100
10101 }
10102
10103 else if (action_id ==
EActions.SET_QUANTITY_0)
10104 {
10106
10107 if (m_EM)
10108 {
10109 m_EM.SetEnergy(0);
10110 }
10111 }
10112
10113 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10114 {
10116
10117 if (m_EM)
10118 {
10119 m_EM.SetEnergy(m_EM.GetEnergyMax());
10120 }
10121 }
10122
10123 else if (action_id ==
EActions.ADD_HEALTH)
10124 {
10125 AddHealth("","",GetMaxHealth("","Health")/5);
10126 }
10127 else if (action_id ==
EActions.REMOVE_HEALTH)
10128 {
10129 AddHealth("","",-GetMaxHealth("","Health")/5);
10130 }
10131 else if (action_id ==
EActions.DESTROY_HEALTH)
10132 {
10133 SetHealth01("","",0);
10134 }
10135 else if (action_id ==
EActions.WATCH_ITEM)
10136 {
10138 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10139 #ifdef DEVELOPER
10140 SetDebugDeveloper_item(this);
10141 #endif
10142 }
10143
10144 else if (action_id ==
EActions.ADD_TEMPERATURE)
10145 {
10146 AddTemperature(20);
10147
10148 }
10149
10150 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10151 {
10152 AddTemperature(-20);
10153
10154 }
10155
10156 else if (action_id ==
EActions.FLIP_FROZEN)
10157 {
10158 SetFrozen(!GetIsFrozen());
10159
10160 }
10161
10162 else if (action_id ==
EActions.ADD_WETNESS)
10163 {
10165
10166 }
10167
10168 else if (action_id ==
EActions.REMOVE_WETNESS)
10169 {
10171
10172 }
10173
10174 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10175 {
10178
10179
10180 }
10181
10182 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10183 {
10186 }
10187
10188 else if (action_id ==
EActions.MAKE_SPECIAL)
10189 {
10190 auto debugParams = DebugSpawnParams.WithPlayer(player);
10191 OnDebugSpawnEx(debugParams);
10192 }
10193
10194 }
10195
10196
10197 return false;
10198 }
10199
10200
10201
10202
10206
10209
10210
10211
10213 {
10214 return false;
10215 }
10216
10217
10219 {
10220 return true;
10221 }
10222
10223
10225 {
10226 return true;
10227 }
10228
10229
10230
10232 {
10233 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10235 }
10236
10239 {
10240 return null;
10241 }
10242
10244 {
10245 return false;
10246 }
10247
10249 {
10250 return false;
10251 }
10252
10256
10257
10259 {
10260 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10261 return module_repairing.CanRepair(this, item_repair_kit);
10262 }
10263
10264
10265 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10266 {
10267 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10268 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10269 }
10270
10271
10273 {
10274
10275
10276
10277
10278
10279
10280
10281
10282 return 1;
10283 }
10284
10285
10286
10288 {
10290 }
10291
10292
10293
10295 {
10297 }
10298
10299
10308 {
10309 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10310
10311 if (player)
10312 {
10313 player.MessageStatus(text);
10314 }
10315 }
10316
10317
10326 {
10327 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10328
10329 if (player)
10330 {
10331 player.MessageAction(text);
10332 }
10333 }
10334
10335
10344 {
10345 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10346
10347 if (player)
10348 {
10349 player.MessageFriendly(text);
10350 }
10351 }
10352
10353
10362 {
10363 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10364
10365 if (player)
10366 {
10367 player.MessageImportant(text);
10368 }
10369 }
10370
10372 {
10373 return true;
10374 }
10375
10376
10377 override bool KindOf(
string tag)
10378 {
10379 bool found = false;
10380 string item_name = this.
GetType();
10383
10384 int array_size = item_tag_array.Count();
10385 for (int i = 0; i < array_size; i++)
10386 {
10387 if (item_tag_array.Get(i) == tag)
10388 {
10389 found = true;
10390 break;
10391 }
10392 }
10393 return found;
10394 }
10395
10396
10398 {
10399
10400 super.OnRPC(sender, rpc_type,ctx);
10401
10402
10403 switch (rpc_type)
10404 {
10405 #ifndef SERVER
10406 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10407 Param2<bool, string> p = new Param2<bool, string>(false, "");
10408
10410 return;
10411
10412 bool play = p.param1;
10413 string soundSet = p.param2;
10414
10415 if (play)
10416 {
10418 {
10420 {
10422 }
10423 }
10424 else
10425 {
10427 }
10428 }
10429 else
10430 {
10432 }
10433
10434 break;
10435 #endif
10436
10437 }
10438
10440 {
10442 }
10443 }
10444
10445
10446
10447
10449 {
10450 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10451 return plugin.GetID(
name);
10452 }
10453
10455 {
10456 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10457 return plugin.GetName(id);
10458 }
10459
10462 {
10463
10464
10465 int varFlags;
10466 if (!ctx.
Read(varFlags))
10467 return;
10468
10469 if (varFlags & ItemVariableFlags.FLOAT)
10470 {
10472 }
10473 }
10474
10476 {
10477
10478 super.SerializeNumericalVars(floats_out);
10479
10480
10481
10483 {
10485 }
10486
10488 {
10490 }
10491
10493 {
10495 }
10496
10498 {
10503 }
10504
10506 {
10508 }
10509 }
10510
10512 {
10513
10514 super.DeSerializeNumericalVars(floats);
10515
10516
10517 int index = 0;
10518 int mask = Math.Round(floats.Get(index));
10519
10520 index++;
10521
10523 {
10525 {
10527 }
10528 else
10529 {
10530 float quantity = floats.Get(index);
10531 SetQuantity(quantity,
true,
false,
false,
false);
10532 }
10533 index++;
10534 }
10535
10537 {
10538 float wet = floats.Get(index);
10540 index++;
10541 }
10542
10544 {
10545 int liquidtype = Math.Round(floats.Get(index));
10547 index++;
10548 }
10549
10551 {
10553 index++;
10555 index++;
10557 index++;
10559 index++;
10560 }
10561
10563 {
10564 int cleanness = Math.Round(floats.Get(index));
10566 index++;
10567 }
10568 }
10569
10571 {
10572 super.WriteVarsToCTX(ctx);
10573
10574
10576 {
10578 }
10579
10581 {
10583 }
10584
10586 {
10588 }
10589
10591 {
10592 int r,g,b,a;
10598 }
10599
10601 {
10603 }
10604 }
10605
10607 {
10608 if (!super.ReadVarsFromCTX(ctx,version))
10609 return false;
10610
10611 int intValue;
10612 float value;
10613
10614 if (version < 140)
10615 {
10616 if (!ctx.
Read(intValue))
10617 return false;
10618
10619 m_VariablesMask = intValue;
10620 }
10621
10623 {
10624 if (!ctx.
Read(value))
10625 return false;
10626
10628 {
10630 }
10631 else
10632 {
10634 }
10635 }
10636
10637 if (version < 140)
10638 {
10640 {
10641 if (!ctx.
Read(value))
10642 return false;
10643 SetTemperatureDirect(value);
10644 }
10645 }
10646
10648 {
10649 if (!ctx.
Read(value))
10650 return false;
10652 }
10653
10655 {
10656 if (!ctx.
Read(intValue))
10657 return false;
10659 }
10660
10662 {
10663 int r,g,b,a;
10665 return false;
10667 return false;
10669 return false;
10671 return false;
10672
10674 }
10675
10677 {
10678 if (!ctx.
Read(intValue))
10679 return false;
10681 }
10682
10683 if (version >= 138 && version < 140)
10684 {
10686 {
10687 if (!ctx.
Read(intValue))
10688 return false;
10689 SetFrozen(intValue);
10690 }
10691 }
10692
10693 return true;
10694 }
10695
10696
10698 {
10701 {
10703 }
10704
10705 if (!super.OnStoreLoad(ctx, version))
10706 {
10708 return false;
10709 }
10710
10711 if (version >= 114)
10712 {
10713 bool hasQuickBarIndexSaved;
10714
10715 if (!ctx.
Read(hasQuickBarIndexSaved))
10716 {
10718 return false;
10719 }
10720
10721 if (hasQuickBarIndexSaved)
10722 {
10723 int itmQBIndex;
10724
10725
10726 if (!ctx.
Read(itmQBIndex))
10727 {
10729 return false;
10730 }
10731
10732 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10733 if (itmQBIndex != -1 && parentPlayer)
10734 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10735 }
10736 }
10737 else
10738 {
10739
10740 PlayerBase player;
10741 int itemQBIndex;
10742 if (version ==
int.
MAX)
10743 {
10744 if (!ctx.
Read(itemQBIndex))
10745 {
10747 return false;
10748 }
10749 }
10750 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10751 {
10752
10753 if (!ctx.
Read(itemQBIndex))
10754 {
10756 return false;
10757 }
10758 if (itemQBIndex != -1 && player)
10759 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10760 }
10761 }
10762
10763 if (version < 140)
10764 {
10765
10766 if (!LoadVariables(ctx, version))
10767 {
10769 return false;
10770 }
10771 }
10772
10773
10775 {
10777 return false;
10778 }
10779 if (version >= 132)
10780 {
10782 if (raib)
10783 {
10785 {
10787 return false;
10788 }
10789 }
10790 }
10791
10793 return true;
10794 }
10795
10796
10797
10799 {
10800 super.OnStoreSave(ctx);
10801
10802 PlayerBase player;
10803 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10804 {
10806
10807 int itemQBIndex = -1;
10808 itemQBIndex = player.FindQuickBarEntityIndex(this);
10809 ctx.
Write(itemQBIndex);
10810 }
10811 else
10812 {
10814 }
10815
10817
10819 if (raib)
10820 {
10822 }
10823 }
10824
10825
10827 {
10828 super.AfterStoreLoad();
10829
10831 {
10833 }
10834
10836 {
10839 }
10840 }
10841
10843 {
10844 super.EEOnAfterLoad();
10845
10847 {
10849 }
10850
10853 }
10854
10856 {
10857 return false;
10858 }
10859
10860
10861
10863 {
10865 {
10866 #ifdef PLATFORM_CONSOLE
10867
10869 {
10871 if (menu)
10872 {
10874 }
10875 }
10876 #endif
10877 }
10878
10880 {
10883 }
10884
10886 {
10887 SetWeightDirty();
10889 }
10891 {
10894 }
10895
10897 {
10900 }
10902 {
10905 }
10906
10907 super.OnVariablesSynchronized();
10908 }
10909
10910
10911
10913 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10914 {
10915 if (!IsServerCheck(allow_client))
10916 return false;
10917
10919 return false;
10920
10923
10924 if (value <= (min + 0.001))
10925 value = min;
10926
10927 if (value == min)
10928 {
10929 if (destroy_config)
10930 {
10931 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10932 if (dstr)
10933 {
10935 this.Delete();
10936 return true;
10937 }
10938 }
10939 else if (destroy_forced)
10940 {
10942 this.Delete();
10943 return true;
10944 }
10945
10947 }
10948
10951
10953 {
10955
10956 if (delta)
10958 }
10959
10961
10962 return false;
10963 }
10964
10965
10967 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10968 {
10970 }
10971
10973 {
10976 }
10977
10979 {
10982 }
10983
10985 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10986 {
10987 float value_clamped = Math.Clamp(value, 0, 1);
10989 SetQuantity(result, destroy_config, destroy_forced);
10990 }
10991
10992
10995 {
10997 }
10998
11000 {
11002 }
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11014 {
11015 int slot = -1;
11016 if (GetInventory())
11017 {
11018 InventoryLocation il = new InventoryLocation;
11019 GetInventory().GetCurrentInventoryLocation(il);
11021 }
11022
11024 }
11025
11027 {
11028 float quantity_max = 0;
11029
11031 {
11032 if (attSlotID != -1)
11033 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11034
11035 if (quantity_max <= 0)
11037 }
11038
11039 if (quantity_max <= 0)
11041
11042 return quantity_max;
11043 }
11044
11046 {
11048 }
11049
11051 {
11053 }
11054
11055
11057 {
11059 }
11060
11062 {
11064 }
11065
11067 {
11069 }
11070
11071
11073 {
11074
11075 float weightEx = GetWeightEx();
11076 float special = GetInventoryAndCargoWeight();
11077 return weightEx - special;
11078 }
11079
11080
11082 {
11084 }
11085
11087 {
11089 {
11090 #ifdef DEVELOPER
11091 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11092 {
11093 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11095 }
11096 #endif
11097
11098 return GetQuantity() * GetConfigWeightModified();
11099 }
11100 else if (HasEnergyManager())
11101 {
11102 #ifdef DEVELOPER
11103 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11104 {
11105 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11106 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11107 }
11108 #endif
11109 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11110 }
11111 else
11112 {
11113 #ifdef DEVELOPER
11114 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11115 {
11116 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11117 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11118 }
11119 #endif
11120 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11121 }
11122 }
11123
11126 {
11127 int item_count = 0;
11129
11130 if (GetInventory().GetCargo() != NULL)
11131 {
11132 item_count = GetInventory().GetCargo().GetItemCount();
11133 }
11134
11135 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11136 {
11137 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11138 if (item)
11139 item_count += item.GetNumberOfItems();
11140 }
11141 return item_count;
11142 }
11143
11146 {
11147 float weight = 0;
11148 float wetness = 1;
11149 if (include_wetness)
11152 {
11153 weight = wetness * m_ConfigWeight;
11154 }
11156 {
11157 weight = 1;
11158 }
11159 return weight;
11160 }
11161
11162
11163
11165 {
11166 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11167 {
11168 GameInventory inv = GetInventory();
11169 array<EntityAI> items = new array<EntityAI>;
11171 for (int i = 0; i < items.Count(); i++)
11172 {
11174 if (item)
11175 {
11177 }
11178 }
11179 }
11180 }
11181
11182
11183
11184
11186 {
11187 float energy = 0;
11188 if (HasEnergyManager())
11189 {
11190 energy = GetCompEM().GetEnergy();
11191 }
11192 return energy;
11193 }
11194
11195
11197 {
11198 super.OnEnergyConsumed();
11199
11201 }
11202
11204 {
11205 super.OnEnergyAdded();
11206
11208 }
11209
11210
11212 {
11213 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11214 {
11216 {
11217 float energy_0to1 = GetCompEM().GetEnergy0To1();
11219 }
11220 }
11221 }
11222
11223
11225 {
11226 return ConfigGetFloat("heatIsolation");
11227 }
11228
11230 {
11232 }
11233
11235 {
11236 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11237 if (
GetGame().ConfigIsExisting(paramPath))
11239
11240 return 0.0;
11241 }
11242
11244 {
11245 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11246 if (
GetGame().ConfigIsExisting(paramPath))
11248
11249 return 0.0;
11250 }
11251
11252 override void SetWet(
float value,
bool allow_client =
false)
11253 {
11254 if (!IsServerCheck(allow_client))
11255 return;
11256
11259
11261
11262 m_VarWet = Math.Clamp(value, min, max);
11263
11265 {
11268 }
11269 }
11270
11271 override void AddWet(
float value)
11272 {
11274 }
11275
11277 {
11279 }
11280
11282 {
11284 }
11285
11287 {
11289 }
11290
11292 {
11294 }
11295
11297 {
11299 }
11300
11301 override void OnWetChanged(
float newVal,
float oldVal)
11302 {
11305 if (newLevel != oldLevel)
11306 {
11308 }
11309 }
11310
11312 {
11313 SetWeightDirty();
11314 }
11315
11317 {
11318 return GetWetLevelInternal(
m_VarWet);
11319 }
11320
11321
11322
11324 {
11326 }
11327
11329 {
11331 }
11332
11334 {
11336 }
11337
11339 {
11341 }
11342
11343
11344
11346 {
11347 if (ConfigIsExisting("itemModelLength"))
11348 {
11349 return ConfigGetFloat("itemModelLength");
11350 }
11351 return 0;
11352 }
11353
11355 {
11356 if (ConfigIsExisting("itemAttachOffset"))
11357 {
11358 return ConfigGetFloat("itemAttachOffset");
11359 }
11360 return 0;
11361 }
11362
11363 override void SetCleanness(
int value,
bool allow_client =
false)
11364 {
11365 if (!IsServerCheck(allow_client))
11366 return;
11367
11369
11371
11374 }
11375
11377 {
11379 }
11380
11382 {
11383 return true;
11384 }
11385
11386
11387
11388
11390 {
11392 }
11393
11395 {
11397 }
11398
11399
11400
11401
11402 override void SetColor(
int r,
int g,
int b,
int a)
11403 {
11409 }
11411 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11412 {
11417 }
11418
11420 {
11422 }
11423
11426 {
11427 int r,g,b,a;
11429 r = r/255;
11430 g = g/255;
11431 b = b/255;
11432 a = a/255;
11433 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11434 }
11435
11436
11437
11438 override void SetLiquidType(
int value,
bool allow_client =
false)
11439 {
11440 if (!IsServerCheck(allow_client))
11441 return;
11442
11447 }
11448
11450 {
11451 return ConfigGetInt("varLiquidTypeInit");
11452 }
11453
11455 {
11457 }
11458
11460 {
11462 SetFrozen(false);
11463 }
11464
11467 {
11468 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11469 }
11470
11471
11474 {
11475 PlayerBase nplayer;
11476 if (PlayerBase.CastTo(nplayer, player))
11477 {
11479
11480 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11481 }
11482 }
11483
11484
11487 {
11488 PlayerBase nplayer;
11489 if (PlayerBase.CastTo(nplayer,player))
11490 {
11491
11492 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11493
11494 }
11495
11496
11497 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11498
11499
11500 if (HasEnergyManager())
11501 {
11502 GetCompEM().UpdatePlugState();
11503 }
11504 }
11505
11506
11508 {
11509 super.OnPlacementStarted(player);
11510
11512 }
11513
11514 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11515 {
11517 {
11518 m_AdminLog.OnPlacementComplete(player,
this);
11519 }
11520
11521 super.OnPlacementComplete(player, position, orientation);
11522 }
11523
11524
11525
11526
11527
11529 {
11531 {
11532 return true;
11533 }
11534 else
11535 {
11536 return false;
11537 }
11538 }
11539
11540
11542 {
11544 {
11546 }
11547 }
11548
11549
11551 {
11553 }
11554
11556 {
11558 }
11559
11560 override void InsertAgent(
int agent,
float count = 1)
11561 {
11562 if (count < 1)
11563 return;
11564
11566 }
11567
11570 {
11572 }
11573
11574
11576 {
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
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11622 {
11624 return false;
11625 return true;
11626 }
11627
11629 {
11630
11632 }
11633
11634
11637 {
11638 super.CheckForRoofLimited(timeTresholdMS);
11639
11641 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11642 {
11643 m_PreviousRoofTestTime = time;
11644 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11645 }
11646 }
11647
11648
11650 {
11652 {
11653 return 0;
11654 }
11655
11656 if (GetInventory().GetAttachmentSlotsCount() != 0)
11657 {
11658 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11659 if (filter)
11660 return filter.GetProtectionLevel(type, false, system);
11661 else
11662 return 0;
11663 }
11664
11665 string subclassPath, entryName;
11666
11667 switch (type)
11668 {
11670 entryName = "biological";
11671 break;
11673 entryName = "chemical";
11674 break;
11675 default:
11676 entryName = "biological";
11677 break;
11678 }
11679
11680 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11681
11683 }
11684
11685
11686
11689 {
11690 if (!IsMagazine())
11692
11694 }
11695
11696
11697
11698
11699
11704 {
11705 return true;
11706 }
11707
11709 {
11711 }
11712
11713
11714
11715
11716
11718 {
11719 if (parent)
11720 {
11721 if (parent.IsInherited(DayZInfected))
11722 return true;
11723
11724 if (!parent.IsRuined())
11725 return true;
11726 }
11727
11728 return true;
11729 }
11730
11732 {
11733 if (!super.CanPutAsAttachment(parent))
11734 {
11735 return false;
11736 }
11737
11738 if (!IsRuined() && !parent.IsRuined())
11739 {
11740 return true;
11741 }
11742
11743 return false;
11744 }
11745
11747 {
11748
11749
11750
11751
11752 return super.CanReceiveItemIntoCargo(item);
11753 }
11754
11756 {
11757
11758
11759
11760
11761 GameInventory attachmentInv = attachment.GetInventory();
11763 {
11764 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11765 return false;
11766 }
11767
11768 InventoryLocation loc = new InventoryLocation();
11769 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11770 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11771 return false;
11772
11773 return super.CanReceiveAttachment(attachment, slotId);
11774 }
11775
11777 {
11778 if (!super.CanReleaseAttachment(attachment))
11779 return false;
11780
11781 return GetInventory().AreChildrenAccessible();
11782 }
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11805 {
11806 int id = muzzle_owner.GetMuzzleID();
11807 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11808
11809 if (WPOF_array)
11810 {
11811 for (int i = 0; i < WPOF_array.Count(); i++)
11812 {
11813 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11814
11815 if (WPOF)
11816 {
11817 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11818 }
11819 }
11820 }
11821 }
11822
11823
11825 {
11826 int id = muzzle_owner.GetMuzzleID();
11828
11829 if (WPOBE_array)
11830 {
11831 for (int i = 0; i < WPOBE_array.Count(); i++)
11832 {
11833 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11834
11835 if (WPOBE)
11836 {
11837 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11838 }
11839 }
11840 }
11841 }
11842
11843
11845 {
11846 int id = muzzle_owner.GetMuzzleID();
11847 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11848
11849 if (WPOOH_array)
11850 {
11851 for (int i = 0; i < WPOOH_array.Count(); i++)
11852 {
11853 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11854
11855 if (WPOOH)
11856 {
11857 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11858 }
11859 }
11860 }
11861 }
11862
11863
11865 {
11866 int id = muzzle_owner.GetMuzzleID();
11867 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11868
11869 if (WPOOH_array)
11870 {
11871 for (int i = 0; i < WPOOH_array.Count(); i++)
11872 {
11873 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11874
11875 if (WPOOH)
11876 {
11877 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11878 }
11879 }
11880 }
11881 }
11882
11883
11885 {
11886 int id = muzzle_owner.GetMuzzleID();
11887 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11888
11889 if (WPOOH_array)
11890 {
11891 for (int i = 0; i < WPOOH_array.Count(); i++)
11892 {
11893 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11894
11895 if (WPOOH)
11896 {
11897 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11898 }
11899 }
11900 }
11901 }
11902
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 {
11928 {
11929 return true;
11930 }
11931
11932 return false;
11933 }
11934
11936 {
11937 return false;
11938 }
11939
11942 {
11943 return UATimeSpent.DEFAULT_DEPLOY;
11944 }
11945
11946
11947
11948
11950 {
11952 SetSynchDirty();
11953 }
11954
11956 {
11958 }
11959
11960
11962 {
11963 return false;
11964 }
11965
11968 {
11969 string att_type = "None";
11970
11971 if (ConfigIsExisting("soundAttType"))
11972 {
11973 att_type = ConfigGetString("soundAttType");
11974 }
11975
11977 }
11978
11980 {
11982 }
11983
11984
11985
11986
11987
11993
11995 {
11998
12000 }
12001
12002
12004 {
12006 return;
12007
12009
12012
12015
12016 SoundParameters params = new SoundParameters();
12020 }
12021
12022
12024 {
12026 return;
12027
12029 SetSynchDirty();
12030
12033 }
12034
12035
12037 {
12039 return;
12040
12042 SetSynchDirty();
12043
12046 }
12047
12049 {
12051 }
12052
12054 {
12056 }
12057
12060 {
12061 if (!
GetGame().IsDedicatedServer())
12062 {
12063 if (ConfigIsExisting("attachSoundSet"))
12064 {
12065 string cfg_path = "";
12066 string soundset = "";
12067 string type_name =
GetType();
12068
12071 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12072 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12073
12074 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12075 {
12076 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12077 {
12078 if (cfg_slot_array[i] == slot_type)
12079 {
12080 soundset = cfg_soundset_array[i];
12081 break;
12082 }
12083 }
12084 }
12085
12086 if (soundset != "")
12087 {
12088 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12090 }
12091 }
12092 }
12093 }
12094
12096 {
12097
12098 }
12099
12100 void OnApply(PlayerBase player);
12101
12103 {
12104 return 1.0;
12105 };
12106
12108 {
12110 }
12111
12113 {
12115 }
12116
12118
12120 {
12121 SetDynamicPhysicsLifeTime(0.01);
12123 }
12124
12126 {
12127 array<string> zone_names = new array<string>;
12128 GetDamageZones(zone_names);
12129 for (int i = 0; i < zone_names.Count(); i++)
12130 {
12131 SetHealthMax(zone_names.Get(i),"Health");
12132 }
12133 SetHealthMax("","Health");
12134 }
12135
12138 {
12139 float global_health = GetHealth01("","Health");
12140 array<string> zones = new array<string>;
12141 GetDamageZones(zones);
12142
12143 for (int i = 0; i < zones.Count(); i++)
12144 {
12145 SetHealth01(zones.Get(i),"Health",global_health);
12146 }
12147 }
12148
12151 {
12152 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12153 }
12154
12156 {
12157 if (!hasRootAsPlayer)
12158 {
12159 if (refParentIB)
12160 {
12161
12162 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12163 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12164
12165 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12166 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12167
12170 }
12171 else
12172 {
12173
12176 }
12177 }
12178 }
12179
12181 {
12183 {
12184 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12185 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12186 {
12187 float heatPermCoef = 1.0;
12189 while (ent)
12190 {
12191 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12192 ent = ent.GetHierarchyParent();
12193 }
12194
12195 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12196 }
12197 }
12198 }
12199
12201 {
12202
12203 EntityAI parent = GetHierarchyParent();
12204 if (!parent)
12205 {
12206 hasParent = false;
12207 hasRootAsPlayer = false;
12208 }
12209 else
12210 {
12211 hasParent = true;
12212 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12213 refParentIB =
ItemBase.Cast(parent);
12214 }
12215 }
12216
12217 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12218 {
12219
12220 }
12221
12223 {
12224
12225 return false;
12226 }
12227
12229 {
12230
12231
12232 return false;
12233 }
12234
12236 {
12237
12238 return false;
12239 }
12240
12243 {
12244 return !GetIsFrozen() &&
IsOpen();
12245 }
12246
12248 {
12249 bool hasParent = false, hasRootAsPlayer = false;
12251
12252 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12253 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12254
12255 if (wwtu || foodDecay)
12256 {
12260
12261 if (processWetness || processTemperature || processDecay)
12262 {
12264
12265 if (processWetness)
12266 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12267
12268 if (processTemperature)
12270
12271 if (processDecay)
12272 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12273 }
12274 }
12275 }
12276
12279 {
12281 }
12282
12284 {
12287
12288 return super.GetTemperatureFreezeThreshold();
12289 }
12290
12292 {
12295
12296 return super.GetTemperatureThawThreshold();
12297 }
12298
12300 {
12303
12304 return super.GetItemOverheatThreshold();
12305 }
12306
12308 {
12310 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12311
12312 return super.GetTemperatureFreezeTime();
12313 }
12314
12316 {
12318 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12319
12320 return super.GetTemperatureThawTime();
12321 }
12322
12327
12329 {
12330 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12331 }
12332
12334 {
12335 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12336 }
12337
12340 {
12342 }
12343
12345 {
12347 }
12348
12350 {
12352 }
12353
12356 {
12357 return null;
12358 }
12359
12362 {
12363 return false;
12364 }
12365
12367 {
12369 {
12372 if (!trg)
12373 {
12375 explosive = this;
12376 }
12377
12378 explosive.PairRemote(trg);
12380
12381 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12382 trg.SetPersistentPairID(persistentID);
12383 explosive.SetPersistentPairID(persistentID);
12384
12385 return true;
12386 }
12387 return false;
12388 }
12389
12392 {
12393 float ret = 1.0;
12396 ret *= GetHealth01();
12397
12398 return ret;
12399 }
12400
12401 #ifdef DEVELOPER
12402 override void SetDebugItem()
12403 {
12404 super.SetDebugItem();
12405 _itemBase = this;
12406 }
12407
12409 {
12410 string text = super.GetDebugText();
12411
12413 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12414
12415 return text;
12416 }
12417 #endif
12418
12420 {
12421 return true;
12422 }
12423
12425
12427
12429 {
12432 }
12433
12434
12442
12458}
12459
12461{
12463 if (entity)
12464 {
12465 bool is_item = entity.IsInherited(
ItemBase);
12466 if (is_item && full_quantity)
12467 {
12470 }
12471 }
12472 else
12473 {
12475 return NULL;
12476 }
12477 return entity;
12478}
12479
12481{
12482 if (item)
12483 {
12484 if (health > 0)
12485 item.SetHealth("", "", health);
12486
12487 if (item.CanHaveTemperature())
12488 {
12490 if (item.CanFreeze())
12491 item.SetFrozen(false);
12492 }
12493
12494 if (item.HasEnergyManager())
12495 {
12496 if (quantity >= 0)
12497 {
12498 item.GetCompEM().SetEnergy0To1(quantity);
12499 }
12500 else
12501 {
12503 }
12504 }
12505 else if (item.IsMagazine())
12506 {
12507 Magazine mag = Magazine.Cast(item);
12508 if (quantity >= 0)
12509 {
12510 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12511 }
12512 else
12513 {
12515 }
12516
12517 }
12518 else
12519 {
12520 if (quantity >= 0)
12521 {
12522 item.SetQuantityNormalized(quantity, false);
12523 }
12524 else
12525 {
12527 }
12528
12529 }
12530 }
12531}
12532
12533#ifdef DEVELOPER
12535#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.