7700{
7702 {
7703 return true;
7704 }
7705};
7706
7707
7708
7710{
7714
7716
7719
7720
7721
7722
7723
7732
7738
7743
7748
7769 protected bool m_IsResultOfSplit
7770
7772
7777
7778
7779
7781
7785
7786
7787
7789
7792
7793
7794
7800
7801
7809
7812
7813
7815
7816
7818
7819
7824
7825
7830
7831
7833
7834
7836 {
7841
7842 if (!
GetGame().IsDedicatedServer())
7843 {
7845 {
7847
7849 {
7851 }
7852 }
7853
7856 }
7857
7858 m_OldLocation = null;
7859
7861 {
7863 }
7864
7865 if (ConfigIsExisting("headSelectionsToHide"))
7866 {
7869 }
7870
7872 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7873 {
7875 }
7876
7878
7879 m_IsResultOfSplit = false;
7880
7882 }
7883
7885 {
7886 super.InitItemVariables();
7887
7893 m_Count = ConfigGetInt(
"count");
7894
7897
7902
7905
7910
7922
7926
7927
7930 if (ConfigIsExisting("canBeSplit"))
7931 {
7934 }
7935
7937 if (ConfigIsExisting("itemBehaviour"))
7939
7940
7943 RegisterNetSyncVariableInt("m_VarLiquidType");
7944 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7945
7946 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7947 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7948 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7949
7950 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7951 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7952 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7953 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7954
7955 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7956 RegisterNetSyncVariableBool("m_IsTakeable");
7957 RegisterNetSyncVariableBool("m_IsHologram");
7958
7961 {
7964 }
7965
7967
7969 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7971
7972 }
7973
7975 {
7977 }
7978
7980 {
7983 {
7988 }
7989 }
7990
7991 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7992 {
7994 {
7997 }
7998
8000 }
8001
8003 {
8009 }
8010
8012
8014 {
8016
8017 if (!action)
8018 {
8019 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8020 return;
8021 }
8022
8024 if (!ai)
8025 {
8027 return;
8028 }
8029
8031 if (!action_array)
8032 {
8033 action_array = new array<ActionBase_Basic>;
8035 }
8036 if (LogManager.IsActionLogEnable())
8037 {
8038 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8039 }
8040
8041 if (action_array.Find(action) != -1)
8042 {
8043 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8044 }
8045 else
8046 {
8047 action_array.Insert(action);
8048 }
8049 }
8050
8052 {
8054 ActionBase action = player.GetActionManager().GetAction(actionName);
8057
8058 if (action_array)
8059 {
8060 action_array.RemoveItem(action);
8061 }
8062 }
8063
8064
8065
8067 {
8068 ActionOverrideData overrideData = new ActionOverrideData();
8072
8074 if (!actionMap)
8075 {
8078 }
8079
8080 actionMap.Insert(this.
Type(), overrideData);
8081
8082 }
8083
8085
8087
8088
8090 {
8093
8096
8097 string config_to_search = "CfgVehicles";
8098 string muzzle_owner_config;
8099
8101 {
8102 if (IsInherited(Weapon))
8103 config_to_search = "CfgWeapons";
8104
8105 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8106
8107 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8108
8110
8111 if (config_OnFire_subclass_count > 0)
8112 {
8113 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8114
8115 for (int i = 0; i < config_OnFire_subclass_count; i++)
8116 {
8117 string particle_class = "";
8119 string config_OnFire_entry = config_OnFire_class + particle_class;
8120 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8121 WPOF_array.Insert(WPOF);
8122 }
8123
8124
8126 }
8127 }
8128
8130 {
8131 config_to_search = "CfgWeapons";
8132 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8133
8134 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8135
8137
8138 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8139 {
8140 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8141
8142 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8143 {
8144 string particle_class2 = "";
8146 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8147 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8148 WPOBE_array.Insert(WPOBE);
8149 }
8150
8151
8153 }
8154 }
8155 }
8156
8157
8159 {
8162
8164 {
8165 string config_to_search = "CfgVehicles";
8166
8167 if (IsInherited(Weapon))
8168 config_to_search = "CfgWeapons";
8169
8170 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8171 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8172
8173 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8174 {
8175
8177
8179 {
8181 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8183 return;
8184 }
8185
8188
8189
8190
8192 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8193
8194 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8195 {
8196 string particle_class = "";
8198 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8200
8201 if (entry_type == CT_CLASS)
8202 {
8203 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8204 WPOOH_array.Insert(WPOF);
8205 }
8206 }
8207
8208
8210 }
8211 }
8212 }
8213
8215 {
8217 }
8218
8220 {
8222 {
8224
8227
8230
8231 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8232 }
8233 }
8234
8236 {
8238 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8239
8241 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8242
8244 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8245
8247 {
8249 }
8250 }
8251
8253 {
8255 }
8256
8258 {
8261 else
8263
8265 {
8268 }
8269 else
8270 {
8273
8276 }
8277
8279 }
8280
8282 {
8284 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8285 }
8286
8288 {
8290 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8292 }
8293
8295 {
8297 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8298 }
8299
8301 {
8304
8305 OverheatingParticle OP = new OverheatingParticle();
8310
8312 }
8313
8315 {
8318
8319 return -1;
8320 }
8321
8323 {
8325 {
8328
8329 for (int i = count; i > 0; --i)
8330 {
8331 int id = i - 1;
8334
8337
8338 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8339 {
8340 if (p)
8341 {
8344 }
8345 }
8346 }
8347 }
8348 }
8349
8351 {
8353 {
8355 {
8356 int id = i - 1;
8358
8359 if (OP)
8360 {
8362
8363 if (p)
8364 {
8366 }
8367
8368 delete OP;
8369 }
8370 }
8371
8374 }
8375 }
8376
8379 {
8380 return 0.0;
8381 }
8382
8383
8385 {
8386 return 250;
8387 }
8388
8390 {
8391 return 0;
8392 }
8393
8396 {
8398 return true;
8399
8400 return false;
8401 }
8402
8405 {
8408
8410 {
8412 }
8413 else
8414 {
8415
8417 }
8418
8420 }
8421
8428 {
8429 return -1;
8430 }
8431
8432
8433
8434
8436 {
8438 {
8440 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8441
8442 if (r_index >= 0)
8443 {
8444 InventoryLocation r_il = new InventoryLocation;
8445 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8446
8447 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8450 {
8451 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8452 }
8454 {
8455 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8456 }
8457
8458 }
8459
8460 player.GetHumanInventory().ClearUserReservedLocation(this);
8461 }
8462
8465 }
8466
8467
8468
8469
8471 {
8472 return ItemBase.m_DebugActionsMask;
8473 }
8474
8476 {
8477 return ItemBase.m_DebugActionsMask & mask;
8478 }
8479
8481 {
8482 ItemBase.m_DebugActionsMask = mask;
8483 }
8484
8486 {
8487 ItemBase.m_DebugActionsMask |= mask;
8488 }
8489
8491 {
8492 ItemBase.m_DebugActionsMask &= ~mask;
8493 }
8494
8496 {
8498 {
8500 }
8501 else
8502 {
8504 }
8505 }
8506
8507
8509 {
8510 if (GetEconomyProfile())
8511 {
8512 float q_max = GetEconomyProfile().GetQuantityMax();
8513 if (q_max > 0)
8514 {
8515 float q_min = GetEconomyProfile().GetQuantityMin();
8516 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8517
8519 {
8520 ComponentEnergyManager comp = GetCompEM();
8522 {
8524 }
8525 }
8527 {
8529
8530 }
8531
8532 }
8533 }
8534 }
8535
8538 {
8539 EntityAI parent = GetHierarchyParent();
8540
8541 if (parent)
8542 {
8543 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8544 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8545 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8546 }
8547 }
8548
8551 {
8552 EntityAI parent = GetHierarchyParent();
8553
8554 if (parent)
8555 {
8556 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8557 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8558 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8559 }
8560 }
8561
8563 {
8564
8565
8566
8567
8569
8571 {
8572 if (ScriptInputUserData.CanStoreInputUserData())
8573 {
8574 ScriptInputUserData ctx = new ScriptInputUserData;
8580 ctx.
Write(use_stack_max);
8583
8585 {
8586 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8587 }
8588 }
8589 }
8590 else if (!
GetGame().IsMultiplayer())
8591 {
8593 }
8594 }
8595
8597 {
8599 }
8600
8602 {
8604 }
8605
8607 {
8609 }
8610
8612 {
8613
8614 return false;
8615 }
8616
8618 {
8619 return false;
8620 }
8621
8625 {
8626 return false;
8627 }
8628
8630 {
8631 return "";
8632 }
8633
8635
8637 {
8638 return false;
8639 }
8640
8642 {
8643 return true;
8644 }
8645
8646
8647
8649 {
8650 return true;
8651 }
8652
8654 {
8655 return true;
8656 }
8657
8659 {
8660 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8662 }
8663
8665 {
8667 }
8668
8670 {
8672 if (!is_being_placed)
8674 SetSynchDirty();
8675 }
8676
8677
8679
8681 {
8683 }
8684
8686 {
8688 }
8689
8691 {
8692 return 1;
8693 }
8694
8696 {
8697 return false;
8698 }
8699
8701 {
8703 SetSynchDirty();
8704 }
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8741 {
8742 super.OnMovedInsideCargo(container);
8743
8744 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8745 }
8746
8747 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8748 {
8749 super.EEItemLocationChanged(oldLoc,newLoc);
8750
8751 PlayerBase new_player = null;
8752 PlayerBase old_player = null;
8753
8754 if (newLoc.GetParent())
8755 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8756
8757 if (oldLoc.GetParent())
8758 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8759
8761 {
8762 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8763
8764 if (r_index >= 0)
8765 {
8766 InventoryLocation r_il = new InventoryLocation;
8767 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8768
8769 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8772 {
8773 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8774 }
8776 {
8777 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8778 }
8779
8780 }
8781 }
8782
8784 {
8785 if (new_player)
8786 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8787
8788 if (new_player == old_player)
8789 {
8790
8791 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8792 {
8794 {
8795 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8796 {
8797 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8798 }
8799 }
8800 else
8801 {
8802 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8803 }
8804 }
8805
8806 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8807 {
8808 int type = oldLoc.GetType();
8810 {
8811 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8812 }
8814 {
8815 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8816 }
8817 }
8818 if (!m_OldLocation)
8819 {
8820 m_OldLocation = new InventoryLocation;
8821 }
8822 m_OldLocation.Copy(oldLoc);
8823 }
8824 else
8825 {
8826 if (m_OldLocation)
8827 {
8828 m_OldLocation.Reset();
8829 }
8830 }
8831
8833 }
8834 else
8835 {
8836 if (new_player)
8837 {
8838 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8839 if (res_index >= 0)
8840 {
8841 InventoryLocation il = new InventoryLocation;
8842 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8844 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8847 {
8848 il.
GetParent().GetOnReleaseLock().Invoke(it);
8849 }
8851 {
8853 }
8854
8855 }
8856 }
8858 {
8859
8861 }
8862
8863 if (m_OldLocation)
8864 {
8865 m_OldLocation.Reset();
8866 }
8867 }
8868 }
8869
8870 override void EOnContact(IEntity other, Contact extra)
8871 {
8873 {
8874 int liquidType = -1;
8876 if (impactSpeed > 0.0)
8877 {
8879 #ifndef SERVER
8881 #else
8883 SetSynchDirty();
8884 #endif
8886 }
8887 }
8888
8889 #ifdef SERVER
8890 if (GetCompEM() && GetCompEM().IsPlugged())
8891 {
8892 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8893 GetCompEM().UnplugThis();
8894 }
8895 #endif
8896 }
8897
8899
8901 {
8903 }
8904
8906 {
8907
8908 }
8909
8911 {
8912 super.OnItemLocationChanged(old_owner, new_owner);
8913
8914 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8915 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8916
8917 if (!relatedPlayer && playerNew)
8918 relatedPlayer = playerNew;
8919
8920 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8921 {
8923 if (actionMgr)
8924 {
8925 ActionBase currentAction = actionMgr.GetRunningAction();
8926 if (currentAction)
8928 }
8929 }
8930
8931 Man ownerPlayerOld = null;
8932 Man ownerPlayerNew = null;
8933
8934 if (old_owner)
8935 {
8936 if (old_owner.
IsMan())
8937 {
8938 ownerPlayerOld = Man.Cast(old_owner);
8939 }
8940 else
8941 {
8942 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8943 }
8944 }
8945 else
8946 {
8948 {
8950
8951 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8952 {
8953 GetCompEM().UnplugThis();
8954 }
8955 }
8956 }
8957
8958 if (new_owner)
8959 {
8960 if (new_owner.
IsMan())
8961 {
8962 ownerPlayerNew = Man.Cast(new_owner);
8963 }
8964 else
8965 {
8966 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8967 }
8968 }
8969
8970 if (ownerPlayerOld != ownerPlayerNew)
8971 {
8972 if (ownerPlayerOld)
8973 {
8974 array<EntityAI> subItemsExit = new array<EntityAI>;
8976 for (int i = 0; i < subItemsExit.Count(); i++)
8977 {
8980 }
8981 }
8982
8983 if (ownerPlayerNew)
8984 {
8985 array<EntityAI> subItemsEnter = new array<EntityAI>;
8987 for (int j = 0; j < subItemsEnter.Count(); j++)
8988 {
8991 }
8992 }
8993 }
8994 else if (ownerPlayerNew != null)
8995 {
8996 PlayerBase nplayer;
8997 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8998 {
8999 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9001 for (int k = 0; k < subItemsUpdate.Count(); k++)
9002 {
9004 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9005 }
9006 }
9007 }
9008
9009 if (old_owner)
9010 old_owner.OnChildItemRemoved(this);
9011 if (new_owner)
9012 new_owner.OnChildItemReceived(this);
9013 }
9014
9015
9017 {
9018 super.EEDelete(parent);
9019 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9020 if (player)
9021 {
9023
9024 if (player.IsAlive())
9025 {
9026 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9027 if (r_index >= 0)
9028 {
9029 InventoryLocation r_il = new InventoryLocation;
9030 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9031
9032 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9035 {
9036 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9037 }
9039 {
9040 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9041 }
9042
9043 }
9044
9045 player.RemoveQuickBarEntityShortcut(this);
9046 }
9047 }
9048 }
9049
9051 {
9052 super.EEKilled(killer);
9053
9056 {
9057 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9058 {
9059 if (IsMagazine())
9060 {
9061 if (Magazine.Cast(this).GetAmmoCount() > 0)
9062 {
9064 }
9065 }
9066 else
9067 {
9069 }
9070 }
9071 }
9072 }
9073
9075 {
9076 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9077
9078 super.OnWasAttached(parent, slot_id);
9079
9082
9084 }
9085
9087 {
9088 super.OnWasDetached(parent, slot_id);
9089
9092 }
9093
9095 {
9096 int idx;
9099
9100 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9101 if (inventory_slots.Count() < 1)
9102 {
9103 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9104 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9105 }
9106 else
9107 {
9108 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9109 }
9110
9111 idx = inventory_slots.Find(slot);
9112 if (idx < 0)
9113 return "";
9114
9115 return attach_types.Get(idx);
9116 }
9117
9119 {
9120 int idx = -1;
9121 string slot;
9122
9125
9126 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9127 if (inventory_slots.Count() < 1)
9128 {
9129 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9130 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9131 }
9132 else
9133 {
9134 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9135 if (detach_types.Count() < 1)
9136 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9137 }
9138
9139 for (int i = 0; i < inventory_slots.Count(); i++)
9140 {
9141 slot = inventory_slots.Get(i);
9142 }
9143
9144 if (slot != "")
9145 {
9146 if (detach_types.Count() == 1)
9147 idx = 0;
9148 else
9149 idx = inventory_slots.Find(slot);
9150 }
9151 if (idx < 0)
9152 return "";
9153
9154 return detach_types.Get(idx);
9155 }
9156
9158 {
9159
9161
9162
9163 float min_time = 1;
9164 float max_time = 3;
9165 float delay = Math.RandomFloat(min_time, max_time);
9166
9167 explode_timer.Run(delay, this, "DoAmmoExplosion");
9168 }
9169
9171 {
9172 Magazine magazine = Magazine.Cast(this);
9173 int pop_sounds_count = 6;
9174 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9175
9176
9177 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9178 string sound_name = pop_sounds[ sound_idx ];
9180
9181
9182 magazine.ServerAddAmmoCount(-1);
9183
9184
9185 float min_temp_to_explode = 100;
9186
9187 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9188 {
9190 }
9191 }
9192
9193
9194 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9195 {
9196 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9197
9198 const int CHANCE_DAMAGE_CARGO = 4;
9199 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9200 const int CHANCE_DAMAGE_NOTHING = 2;
9201
9203 {
9204 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9205 int chances;
9206 int rnd;
9207
9208 if (GetInventory().GetCargo())
9209 {
9210 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9211 rnd = Math.RandomInt(0,chances);
9212
9213 if (rnd < CHANCE_DAMAGE_CARGO)
9214 {
9216 }
9217 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9218 {
9220 }
9221 }
9222 else
9223 {
9224 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9225 rnd = Math.RandomInt(0,chances);
9226
9227 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9228 {
9230 }
9231 }
9232 }
9233 }
9234
9236 {
9237 if (GetInventory().GetCargo())
9238 {
9239 int item_count = GetInventory().GetCargo().GetItemCount();
9240 if (item_count > 0)
9241 {
9242 int random_pick = Math.RandomInt(0, item_count);
9244 if (!item.IsExplosive())
9245 {
9246 item.AddHealth("","",damage);
9247 return true;
9248 }
9249 }
9250 }
9251 return false;
9252 }
9253
9255 {
9256 int attachment_count = GetInventory().AttachmentCount();
9257 if (attachment_count > 0)
9258 {
9259 int random_pick = Math.RandomInt(0, attachment_count);
9260 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9261 if (!attachment.IsExplosive())
9262 {
9263 attachment.AddHealth("","",damage);
9264 return true;
9265 }
9266 }
9267 return false;
9268 }
9269
9271 {
9273 }
9274
9276 {
9278 return GetInventory().CanRemoveEntity();
9279
9280 return false;
9281 }
9282
9284 {
9285
9287 return false;
9288
9289
9291 return false;
9292
9293
9294
9296 if (delta == 0)
9297 return false;
9298
9299
9300 return true;
9301 }
9302
9304 {
9306 {
9307 if (ScriptInputUserData.CanStoreInputUserData())
9308 {
9309 ScriptInputUserData ctx = new ScriptInputUserData;
9314 ctx.
Write(destination_entity);
9318 }
9319 }
9320 else if (!
GetGame().IsMultiplayer())
9321 {
9323 }
9324 }
9325
9327 {
9328 float split_quantity_new;
9332 InventoryLocation loc = new InventoryLocation;
9333
9334 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9335 {
9337 split_quantity_new = stack_max;
9338 else
9340
9342 {
9343 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9344 if (new_item)
9345 {
9346 new_item.SetResultOfSplit(true);
9347 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9349 new_item.
SetQuantity(split_quantity_new,
false,
true);
9350 }
9351 }
9352 }
9353 else if (destination_entity && slot_id == -1)
9354 {
9355 if (quantity > stack_max)
9356 split_quantity_new = stack_max;
9357 else
9358 split_quantity_new = quantity;
9359
9361 {
9363 {
9366 }
9367
9368 if (new_item)
9369 {
9370 new_item.SetResultOfSplit(true);
9371 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9373 new_item.
SetQuantity(split_quantity_new,
false,
true);
9374 }
9375 }
9376 }
9377 else
9378 {
9379 if (stack_max != 0)
9380 {
9382 {
9384 }
9385
9386 if (split_quantity_new == 0)
9387 {
9388 if (!
GetGame().IsMultiplayer())
9389 player.PhysicalPredictiveDropItem(this);
9390 else
9391 player.ServerDropEntity(this);
9392 return;
9393 }
9394
9396 {
9398
9399 if (new_item)
9400 {
9401 new_item.SetResultOfSplit(true);
9402 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9405 new_item.PlaceOnSurface();
9406 }
9407 }
9408 }
9409 }
9410 }
9411
9413 {
9414 float split_quantity_new;
9418 InventoryLocation loc = new InventoryLocation;
9419
9420 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9421 {
9423 split_quantity_new = stack_max;
9424 else
9426
9428 {
9429 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9430 if (new_item)
9431 {
9432 new_item.SetResultOfSplit(true);
9433 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9435 new_item.
SetQuantity(split_quantity_new,
false,
true);
9436 }
9437 }
9438 }
9439 else if (destination_entity && slot_id == -1)
9440 {
9441 if (quantity > stack_max)
9442 split_quantity_new = stack_max;
9443 else
9444 split_quantity_new = quantity;
9445
9447 {
9449 {
9452 }
9453
9454 if (new_item)
9455 {
9456 new_item.SetResultOfSplit(true);
9457 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9459 new_item.
SetQuantity(split_quantity_new,
false,
true);
9460 }
9461 }
9462 }
9463 else
9464 {
9465 if (stack_max != 0)
9466 {
9468 {
9470 }
9471
9473 {
9475
9476 if (new_item)
9477 {
9478 new_item.SetResultOfSplit(true);
9479 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9482 new_item.PlaceOnSurface();
9483 }
9484 }
9485 }
9486 }
9487 }
9488
9490 {
9492 {
9493 if (ScriptInputUserData.CanStoreInputUserData())
9494 {
9495 ScriptInputUserData ctx = new ScriptInputUserData;
9500 dst.WriteToContext(ctx);
9502 }
9503 }
9504 else if (!
GetGame().IsMultiplayer())
9505 {
9507 }
9508 }
9509
9511 {
9513 {
9514 if (ScriptInputUserData.CanStoreInputUserData())
9515 {
9516 ScriptInputUserData ctx = new ScriptInputUserData;
9521 ctx.
Write(destination_entity);
9527 }
9528 }
9529 else if (!
GetGame().IsMultiplayer())
9530 {
9532 }
9533 }
9534
9536 {
9538 }
9539
9541 {
9543 float split_quantity_new;
9545 if (dst.IsValid())
9546 {
9547 int slot_id = dst.GetSlot();
9549
9550 if (quantity > stack_max)
9551 split_quantity_new = stack_max;
9552 else
9553 split_quantity_new = quantity;
9554
9556 {
9558
9559 if (new_item)
9560 {
9561 new_item.SetResultOfSplit(true);
9562 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9564 new_item.
SetQuantity(split_quantity_new,
false,
true);
9565 }
9566
9567 return new_item;
9568 }
9569 }
9570
9571 return null;
9572 }
9573
9575 {
9577 float split_quantity_new;
9579 if (destination_entity)
9580 {
9582 if (quantity > stackable)
9583 split_quantity_new = stackable;
9584 else
9585 split_quantity_new = quantity;
9586
9588 {
9589 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9590 if (new_item)
9591 {
9592 new_item.SetResultOfSplit(true);
9593 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9595 new_item.
SetQuantity(split_quantity_new,
false,
true);
9596 }
9597 }
9598 }
9599 }
9600
9602 {
9604 {
9605 if (ScriptInputUserData.CanStoreInputUserData())
9606 {
9607 ScriptInputUserData ctx = new ScriptInputUserData;
9612 ItemBase destination_entity =
this;
9613 ctx.
Write(destination_entity);
9617 }
9618 }
9619 else if (!
GetGame().IsMultiplayer())
9620 {
9622 }
9623 }
9624
9626 {
9628 float split_quantity_new;
9630 if (player)
9631 {
9633 if (quantity > stackable)
9634 split_quantity_new = stackable;
9635 else
9636 split_quantity_new = quantity;
9637
9639 {
9640 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9641 new_item =
ItemBase.Cast(in_hands);
9642 if (new_item)
9643 {
9644 new_item.SetResultOfSplit(true);
9645 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9647 new_item.SetQuantity(split_quantity_new, false, true);
9648 }
9649 }
9650 }
9651 }
9652
9654 {
9656 float split_quantity_new = Math.Floor(quantity * 0.5);
9657
9659 return;
9660
9662
9663 if (new_item)
9664 {
9665 if (new_item.GetQuantityMax() < split_quantity_new)
9666 {
9667 split_quantity_new = new_item.GetQuantityMax();
9668 }
9669
9670 new_item.SetResultOfSplit(true);
9671 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9672
9674 {
9677 }
9678 else
9679 {
9681 new_item.
SetQuantity(split_quantity_new,
false,
true);
9682 }
9683 }
9684 }
9685
9687 {
9689 float split_quantity_new = Math.Floor(quantity / 2);
9690
9692 return;
9693
9694 InventoryLocation invloc = new InventoryLocation;
9696
9698 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9699
9700 if (new_item)
9701 {
9702 if (new_item.GetQuantityMax() < split_quantity_new)
9703 {
9704 split_quantity_new = new_item.GetQuantityMax();
9705 }
9707 {
9710 }
9711 else if (split_quantity_new > 1)
9712 {
9714 new_item.
SetQuantity(split_quantity_new,
false,
true);
9715 }
9716 }
9717 }
9718
9721 {
9722 SetWeightDirty();
9724
9725 if (parent)
9726 parent.OnAttachmentQuantityChangedEx(this, delta);
9727
9729 {
9731 {
9733 }
9735 {
9736 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9738 }
9739 }
9740
9741 }
9742
9745 {
9746
9747 }
9748
9751 {
9753 }
9754
9756 {
9757 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9758
9760 {
9761 if (newLevel == GameConstants.STATE_RUINED)
9762 {
9764 EntityAI parent = GetHierarchyParent();
9765 if (parent && parent.IsFireplace())
9766 {
9767 CargoBase cargo = GetInventory().GetCargo();
9768 if (cargo)
9769 {
9771 {
9773 }
9774 }
9775 }
9776 }
9777
9779 {
9780
9782 return;
9783 }
9784
9785 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9786 {
9788 }
9789 }
9790 }
9791
9792
9794 {
9795 super.OnRightClick();
9796
9798 {
9800 {
9801 if (ScriptInputUserData.CanStoreInputUserData())
9802 {
9803 EntityAI root = GetHierarchyRoot();
9804 Man playerOwner = GetHierarchyRootPlayer();
9805 InventoryLocation dst = new InventoryLocation;
9806
9807
9808 if (!playerOwner && root && root == this)
9809 {
9811 }
9812 else
9813 {
9814
9815 GetInventory().GetCurrentInventoryLocation(dst);
9817 {
9820 {
9822 }
9823 else
9824 {
9826
9827
9828 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9829 {
9831 }
9832 else
9833 {
9834 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9835 }
9836 }
9837 }
9838 }
9839
9840 ScriptInputUserData ctx = new ScriptInputUserData;
9848 }
9849 }
9850 else if (!
GetGame().IsMultiplayer())
9851 {
9853 }
9854 }
9855 }
9856
9858 {
9859 if (root)
9860 {
9861 vector m4[4];
9862 root.GetTransform(m4);
9863 dst.SetGround(this, m4);
9864 }
9865 else
9866 {
9867 GetInventory().GetCurrentInventoryLocation(dst);
9868 }
9869 }
9870
9871 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9872 {
9873
9874 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9875 return false;
9876
9877 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9878 return false;
9879
9880
9882 return false;
9883
9884
9885 Magazine mag = Magazine.Cast(this);
9886 if (mag)
9887 {
9888 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9889 return false;
9890
9891 if (stack_max_limit)
9892 {
9893 Magazine other_mag = Magazine.Cast(other_item);
9894 if (other_item)
9895 {
9896 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9897 return false;
9898 }
9899
9900 }
9901 }
9902 else
9903 {
9904
9906 return false;
9907
9909 return false;
9910 }
9911
9912 PlayerBase player = null;
9913 if (CastTo(player, GetHierarchyRootPlayer()))
9914 {
9915 if (player.GetInventory().HasAttachment(this))
9916 return false;
9917
9918 if (player.IsItemsToDelete())
9919 return false;
9920 }
9921
9922 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9923 return false;
9924
9925 int slotID;
9927 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9928 return false;
9929
9930 return true;
9931 }
9932
9934 {
9936 }
9937
9939 {
9940 return m_IsResultOfSplit;
9941 }
9942
9944 {
9945 m_IsResultOfSplit = value;
9946 }
9947
9949 {
9951 }
9952
9954 {
9955 float other_item_quantity = other_item.GetQuantity();
9956 float this_free_space;
9957
9959
9961
9962 if (other_item_quantity > this_free_space)
9963 {
9964 return this_free_space;
9965 }
9966 else
9967 {
9968 return other_item_quantity;
9969 }
9970 }
9971
9973 {
9975 }
9976
9978 {
9980 return;
9981
9982 if (!IsMagazine() && other_item)
9983 {
9985 if (quantity_used != 0)
9986 {
9987 float hp1 = GetHealth01("","");
9988 float hp2 = other_item.GetHealth01("","");
9989 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9990 hpResult = hpResult / (
GetQuantity() + quantity_used);
9991
9992 hpResult *= GetMaxHealth();
9993 Math.Round(hpResult);
9994 SetHealth("", "Health", hpResult);
9995
9997 other_item.AddQuantity(-quantity_used);
9998 }
9999 }
10001 }
10002
10004 {
10005 #ifdef SERVER
10006 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10007 GetHierarchyParent().IncreaseLifetimeUp();
10008 #endif
10009 };
10010
10012 {
10013 PlayerBase p = PlayerBase.Cast(player);
10014
10015 array<int> recipesIds = p.m_Recipes;
10016 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10017 if (moduleRecipesManager)
10018 {
10019 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10020 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10021 }
10022
10023 for (int i = 0;i < recipesIds.Count(); i++)
10024 {
10025 int key = recipesIds.Get(i);
10026 string recipeName = moduleRecipesManager.GetRecipeName(key);
10028 }
10029 }
10030
10031
10032 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10033 {
10034 super.GetDebugActions(outputList);
10035
10036
10042
10043
10048
10053
10054
10058
10059
10061 {
10065 }
10066
10069
10070
10074
10076
10077 InventoryLocation loc = new InventoryLocation();
10078 GetInventory().GetCurrentInventoryLocation(loc);
10080 {
10081 if (Gizmo_IsSupported())
10084 }
10085
10087 }
10088
10089
10090
10091
10093 {
10094 super.OnAction(action_id, player, ctx);
10095
10097 {
10098 switch (action_id)
10099 {
10102 return true;
10105 return true;
10106 }
10107 }
10108
10110 {
10111 switch (action_id)
10112 {
10114 Delete();
10115 return true;
10116 }
10117 }
10118
10119 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10120 {
10121 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10122 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10123 PlayerBase p = PlayerBase.Cast(player);
10124 if (
EActions.RECIPES_RANGE_START < 1000)
10125 {
10126 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10127 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10128 }
10129 }
10130 #ifndef SERVER
10131 else if (action_id ==
EActions.WATCH_PLAYER)
10132 {
10133 PluginDeveloper.SetDeveloperItemClientEx(player);
10134 }
10135 #endif
10137 {
10138 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10139 {
10140 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10141 OnDebugButtonPressServer(id + 1);
10142 }
10143
10144 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10145 {
10146 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10148 }
10149
10150 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10151 {
10152 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10154 }
10155
10156 else if (action_id ==
EActions.ADD_QUANTITY)
10157 {
10158 if (IsMagazine())
10159 {
10160 Magazine mag = Magazine.Cast(this);
10161 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10162 }
10163 else
10164 {
10166 }
10167
10168 if (m_EM)
10169 {
10170 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10171 }
10172
10173 }
10174
10175 else if (action_id ==
EActions.REMOVE_QUANTITY)
10176 {
10177 if (IsMagazine())
10178 {
10179 Magazine mag2 = Magazine.Cast(this);
10180 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10181 }
10182 else
10183 {
10185 }
10186 if (m_EM)
10187 {
10188 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10189 }
10190
10191 }
10192
10193 else if (action_id ==
EActions.SET_QUANTITY_0)
10194 {
10196
10197 if (m_EM)
10198 {
10199 m_EM.SetEnergy(0);
10200 }
10201 }
10202
10203 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10204 {
10206
10207 if (m_EM)
10208 {
10209 m_EM.SetEnergy(m_EM.GetEnergyMax());
10210 }
10211 }
10212
10213 else if (action_id ==
EActions.ADD_HEALTH)
10214 {
10215 AddHealth("","",GetMaxHealth("","Health")/5);
10216 }
10217 else if (action_id ==
EActions.REMOVE_HEALTH)
10218 {
10219 AddHealth("","",-GetMaxHealth("","Health")/5);
10220 }
10221 else if (action_id ==
EActions.DESTROY_HEALTH)
10222 {
10223 SetHealth01("","",0);
10224 }
10225 else if (action_id ==
EActions.WATCH_ITEM)
10226 {
10228 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10229 #ifdef DEVELOPER
10230 SetDebugDeveloper_item(this);
10231 #endif
10232 }
10233
10234 else if (action_id ==
EActions.ADD_TEMPERATURE)
10235 {
10236 AddTemperature(20);
10237
10238 }
10239
10240 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10241 {
10242 AddTemperature(-20);
10243
10244 }
10245
10246 else if (action_id ==
EActions.FLIP_FROZEN)
10247 {
10248 SetFrozen(!GetIsFrozen());
10249
10250 }
10251
10252 else if (action_id ==
EActions.ADD_WETNESS)
10253 {
10255
10256 }
10257
10258 else if (action_id ==
EActions.REMOVE_WETNESS)
10259 {
10261
10262 }
10263
10264 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10265 {
10268
10269
10270 }
10271
10272 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10273 {
10276 }
10277
10278 else if (action_id ==
EActions.MAKE_SPECIAL)
10279 {
10280 auto debugParams = DebugSpawnParams.WithPlayer(player);
10281 OnDebugSpawnEx(debugParams);
10282 }
10283
10284 }
10285
10286
10287 return false;
10288 }
10289
10290
10291
10292
10296
10299
10300
10301
10303 {
10304 return false;
10305 }
10306
10307
10309 {
10310 return true;
10311 }
10312
10313
10315 {
10316 return true;
10317 }
10318
10319
10320
10322 {
10323 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10325 }
10326
10329 {
10330 return null;
10331 }
10332
10334 {
10335 return false;
10336 }
10337
10339 {
10340 return false;
10341 }
10342
10346
10347
10349 {
10350 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10351 return module_repairing.CanRepair(this, item_repair_kit);
10352 }
10353
10354
10355 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10356 {
10357 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10358 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10359 }
10360
10361
10363 {
10364
10365
10366
10367
10368
10369
10370
10371
10372 return 1;
10373 }
10374
10375
10376
10378 {
10380 }
10381
10382
10383
10385 {
10387 }
10388
10389
10398 {
10399 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10400
10401 if (player)
10402 {
10403 player.MessageStatus(text);
10404 }
10405 }
10406
10407
10416 {
10417 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10418
10419 if (player)
10420 {
10421 player.MessageAction(text);
10422 }
10423 }
10424
10425
10434 {
10435 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10436
10437 if (player)
10438 {
10439 player.MessageFriendly(text);
10440 }
10441 }
10442
10443
10452 {
10453 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10454
10455 if (player)
10456 {
10457 player.MessageImportant(text);
10458 }
10459 }
10460
10462 {
10463 return true;
10464 }
10465
10466
10467 override bool KindOf(
string tag)
10468 {
10469 bool found = false;
10470 string item_name = this.
GetType();
10473
10474 int array_size = item_tag_array.Count();
10475 for (int i = 0; i < array_size; i++)
10476 {
10477 if (item_tag_array.Get(i) == tag)
10478 {
10479 found = true;
10480 break;
10481 }
10482 }
10483 return found;
10484 }
10485
10486
10488 {
10489
10490 super.OnRPC(sender, rpc_type,ctx);
10491
10492
10493 switch (rpc_type)
10494 {
10495 #ifndef SERVER
10496 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10497 Param2<bool, string> p = new Param2<bool, string>(false, "");
10498
10500 return;
10501
10502 bool play = p.param1;
10503 string soundSet = p.param2;
10504
10505 if (play)
10506 {
10508 {
10510 {
10512 }
10513 }
10514 else
10515 {
10517 }
10518 }
10519 else
10520 {
10522 }
10523
10524 break;
10525 #endif
10526
10527 }
10528
10530 {
10532 }
10533 }
10534
10535
10536
10537
10539 {
10540 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10541 return plugin.GetID(
name);
10542 }
10543
10545 {
10546 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10547 return plugin.GetName(id);
10548 }
10549
10552 {
10553
10554
10555 int varFlags;
10556 if (!ctx.
Read(varFlags))
10557 return;
10558
10559 if (varFlags & ItemVariableFlags.FLOAT)
10560 {
10562 }
10563 }
10564
10566 {
10567
10568 super.SerializeNumericalVars(floats_out);
10569
10570
10571
10573 {
10575 }
10576
10578 {
10580 }
10581
10583 {
10585 }
10586
10588 {
10593 }
10594
10596 {
10598 }
10599 }
10600
10602 {
10603
10604 super.DeSerializeNumericalVars(floats);
10605
10606
10607 int index = 0;
10608 int mask = Math.Round(floats.Get(index));
10609
10610 index++;
10611
10613 {
10615 {
10617 }
10618 else
10619 {
10620 float quantity = floats.Get(index);
10621 SetQuantity(quantity,
true,
false,
false,
false);
10622 }
10623 index++;
10624 }
10625
10627 {
10628 float wet = floats.Get(index);
10630 index++;
10631 }
10632
10634 {
10635 int liquidtype = Math.Round(floats.Get(index));
10637 index++;
10638 }
10639
10641 {
10643 index++;
10645 index++;
10647 index++;
10649 index++;
10650 }
10651
10653 {
10654 int cleanness = Math.Round(floats.Get(index));
10656 index++;
10657 }
10658 }
10659
10661 {
10662 super.WriteVarsToCTX(ctx);
10663
10664
10666 {
10668 }
10669
10671 {
10673 }
10674
10676 {
10678 }
10679
10681 {
10682 int r,g,b,a;
10688 }
10689
10691 {
10693 }
10694 }
10695
10697 {
10698 if (!super.ReadVarsFromCTX(ctx,version))
10699 return false;
10700
10701 int intValue;
10702 float value;
10703
10704 if (version < 140)
10705 {
10706 if (!ctx.
Read(intValue))
10707 return false;
10708
10709 m_VariablesMask = intValue;
10710 }
10711
10713 {
10714 if (!ctx.
Read(value))
10715 return false;
10716
10718 {
10720 }
10721 else
10722 {
10724 }
10725 }
10726
10727 if (version < 140)
10728 {
10730 {
10731 if (!ctx.
Read(value))
10732 return false;
10733 SetTemperatureDirect(value);
10734 }
10735 }
10736
10738 {
10739 if (!ctx.
Read(value))
10740 return false;
10742 }
10743
10745 {
10746 if (!ctx.
Read(intValue))
10747 return false;
10749 }
10750
10752 {
10753 int r,g,b,a;
10755 return false;
10757 return false;
10759 return false;
10761 return false;
10762
10764 }
10765
10767 {
10768 if (!ctx.
Read(intValue))
10769 return false;
10771 }
10772
10773 if (version >= 138 && version < 140)
10774 {
10776 {
10777 if (!ctx.
Read(intValue))
10778 return false;
10779 SetFrozen(intValue);
10780 }
10781 }
10782
10783 return true;
10784 }
10785
10786
10788 {
10791 {
10793 }
10794
10795 if (!super.OnStoreLoad(ctx, version))
10796 {
10798 return false;
10799 }
10800
10801 if (version >= 114)
10802 {
10803 bool hasQuickBarIndexSaved;
10804
10805 if (!ctx.
Read(hasQuickBarIndexSaved))
10806 {
10808 return false;
10809 }
10810
10811 if (hasQuickBarIndexSaved)
10812 {
10813 int itmQBIndex;
10814
10815
10816 if (!ctx.
Read(itmQBIndex))
10817 {
10819 return false;
10820 }
10821
10822 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10823 if (itmQBIndex != -1 && parentPlayer)
10824 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10825 }
10826 }
10827 else
10828 {
10829
10830 PlayerBase player;
10831 int itemQBIndex;
10832 if (version ==
int.
MAX)
10833 {
10834 if (!ctx.
Read(itemQBIndex))
10835 {
10837 return false;
10838 }
10839 }
10840 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10841 {
10842
10843 if (!ctx.
Read(itemQBIndex))
10844 {
10846 return false;
10847 }
10848 if (itemQBIndex != -1 && player)
10849 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10850 }
10851 }
10852
10853 if (version < 140)
10854 {
10855
10856 if (!LoadVariables(ctx, version))
10857 {
10859 return false;
10860 }
10861 }
10862
10863
10865 {
10867 return false;
10868 }
10869 if (version >= 132)
10870 {
10872 if (raib)
10873 {
10875 {
10877 return false;
10878 }
10879 }
10880 }
10881
10883 return true;
10884 }
10885
10886
10887
10889 {
10890 super.OnStoreSave(ctx);
10891
10892 PlayerBase player;
10893 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10894 {
10896
10897 int itemQBIndex = -1;
10898 itemQBIndex = player.FindQuickBarEntityIndex(this);
10899 ctx.
Write(itemQBIndex);
10900 }
10901 else
10902 {
10904 }
10905
10907
10909 if (raib)
10910 {
10912 }
10913 }
10914
10915
10917 {
10918 super.AfterStoreLoad();
10919
10921 {
10923 }
10924
10926 {
10929 }
10930 }
10931
10933 {
10934 super.EEOnAfterLoad();
10935
10937 {
10939 }
10940
10943 }
10944
10946 {
10947 return false;
10948 }
10949
10950
10951
10953 {
10955 {
10956 #ifdef PLATFORM_CONSOLE
10957
10959 {
10961 if (menu)
10962 {
10964 }
10965 }
10966 #endif
10967 }
10968
10970 {
10973 }
10974
10976 {
10977 SetWeightDirty();
10979 }
10981 {
10984 }
10985
10987 {
10990 }
10992 {
10995 }
10996
10997 super.OnVariablesSynchronized();
10998 }
10999
11000
11001
11003 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11004 {
11005 if (!IsServerCheck(allow_client))
11006 return false;
11007
11009 return false;
11010
11013
11014 if (value <= (min + 0.001))
11015 value = min;
11016
11017 if (value == min)
11018 {
11019 if (destroy_config)
11020 {
11021 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11022 if (dstr)
11023 {
11025 this.Delete();
11026 return true;
11027 }
11028 }
11029 else if (destroy_forced)
11030 {
11032 this.Delete();
11033 return true;
11034 }
11035
11037 }
11038
11041
11043 {
11045
11046 if (delta)
11048 }
11049
11051
11052 return false;
11053 }
11054
11055
11057 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11058 {
11060 }
11061
11063 {
11066 }
11067
11069 {
11072 }
11073
11075 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11076 {
11077 float value_clamped = Math.Clamp(value, 0, 1);
11079 SetQuantity(result, destroy_config, destroy_forced);
11080 }
11081
11082
11085 {
11087 }
11088
11090 {
11092 }
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11104 {
11105 int slot = -1;
11106 if (GetInventory())
11107 {
11108 InventoryLocation il = new InventoryLocation;
11109 GetInventory().GetCurrentInventoryLocation(il);
11111 }
11112
11114 }
11115
11117 {
11118 float quantity_max = 0;
11119
11121 {
11122 if (attSlotID != -1)
11123 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11124
11125 if (quantity_max <= 0)
11127 }
11128
11129 if (quantity_max <= 0)
11131
11132 return quantity_max;
11133 }
11134
11136 {
11138 }
11139
11141 {
11143 }
11144
11145
11147 {
11149 }
11150
11152 {
11154 }
11155
11157 {
11159 }
11160
11161
11163 {
11164
11165 float weightEx = GetWeightEx();
11166 float special = GetInventoryAndCargoWeight();
11167 return weightEx - special;
11168 }
11169
11170
11172 {
11174 }
11175
11177 {
11179 {
11180 #ifdef DEVELOPER
11181 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11182 {
11183 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11185 }
11186 #endif
11187
11188 return GetQuantity() * GetConfigWeightModified();
11189 }
11190 else if (HasEnergyManager())
11191 {
11192 #ifdef DEVELOPER
11193 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11194 {
11195 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11196 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11197 }
11198 #endif
11199 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11200 }
11201 else
11202 {
11203 #ifdef DEVELOPER
11204 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11205 {
11206 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11207 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11208 }
11209 #endif
11210 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11211 }
11212 }
11213
11216 {
11217 int item_count = 0;
11219
11220 if (GetInventory().GetCargo() != NULL)
11221 {
11222 item_count = GetInventory().GetCargo().GetItemCount();
11223 }
11224
11225 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11226 {
11227 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11228 if (item)
11229 item_count += item.GetNumberOfItems();
11230 }
11231 return item_count;
11232 }
11233
11236 {
11237 float weight = 0;
11238 float wetness = 1;
11239 if (include_wetness)
11242 {
11243 weight = wetness * m_ConfigWeight;
11244 }
11246 {
11247 weight = 1;
11248 }
11249 return weight;
11250 }
11251
11252
11253
11255 {
11256 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11257 {
11258 GameInventory inv = GetInventory();
11259 array<EntityAI> items = new array<EntityAI>;
11261 for (int i = 0; i < items.Count(); i++)
11262 {
11264 if (item)
11265 {
11267 }
11268 }
11269 }
11270 }
11271
11272
11273
11274
11276 {
11277 float energy = 0;
11278 if (HasEnergyManager())
11279 {
11280 energy = GetCompEM().GetEnergy();
11281 }
11282 return energy;
11283 }
11284
11285
11287 {
11288 super.OnEnergyConsumed();
11289
11291 }
11292
11294 {
11295 super.OnEnergyAdded();
11296
11298 }
11299
11300
11302 {
11303 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11304 {
11306 {
11307 float energy_0to1 = GetCompEM().GetEnergy0To1();
11309 }
11310 }
11311 }
11312
11313
11315 {
11316 return ConfigGetFloat("heatIsolation");
11317 }
11318
11320 {
11322 }
11323
11325 {
11326 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11327 if (
GetGame().ConfigIsExisting(paramPath))
11329
11330 return 0.0;
11331 }
11332
11334 {
11335 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11336 if (
GetGame().ConfigIsExisting(paramPath))
11338
11339 return 0.0;
11340 }
11341
11342 override void SetWet(
float value,
bool allow_client =
false)
11343 {
11344 if (!IsServerCheck(allow_client))
11345 return;
11346
11349
11351
11352 m_VarWet = Math.Clamp(value, min, max);
11353
11355 {
11358 }
11359 }
11360
11361 override void AddWet(
float value)
11362 {
11364 }
11365
11367 {
11369 }
11370
11372 {
11374 }
11375
11377 {
11379 }
11380
11382 {
11384 }
11385
11387 {
11389 }
11390
11391 override void OnWetChanged(
float newVal,
float oldVal)
11392 {
11395 if (newLevel != oldLevel)
11396 {
11398 }
11399 }
11400
11402 {
11403 SetWeightDirty();
11404 }
11405
11407 {
11408 return GetWetLevelInternal(
m_VarWet);
11409 }
11410
11411
11412
11414 {
11416 }
11417
11419 {
11421 }
11422
11424 {
11426 }
11427
11429 {
11431 }
11432
11433
11434
11436 {
11437 if (ConfigIsExisting("itemModelLength"))
11438 {
11439 return ConfigGetFloat("itemModelLength");
11440 }
11441 return 0;
11442 }
11443
11445 {
11446 if (ConfigIsExisting("itemAttachOffset"))
11447 {
11448 return ConfigGetFloat("itemAttachOffset");
11449 }
11450 return 0;
11451 }
11452
11453 override void SetCleanness(
int value,
bool allow_client =
false)
11454 {
11455 if (!IsServerCheck(allow_client))
11456 return;
11457
11459
11461
11464 }
11465
11467 {
11469 }
11470
11472 {
11473 return true;
11474 }
11475
11476
11477
11478
11480 {
11482 }
11483
11485 {
11487 }
11488
11489
11490
11491
11492 override void SetColor(
int r,
int g,
int b,
int a)
11493 {
11499 }
11501 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11502 {
11507 }
11508
11510 {
11512 }
11513
11516 {
11517 int r,g,b,a;
11519 r = r/255;
11520 g = g/255;
11521 b = b/255;
11522 a = a/255;
11523 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11524 }
11525
11526
11527
11528 override void SetLiquidType(
int value,
bool allow_client =
false)
11529 {
11530 if (!IsServerCheck(allow_client))
11531 return;
11532
11537 }
11538
11540 {
11541 return ConfigGetInt("varLiquidTypeInit");
11542 }
11543
11545 {
11547 }
11548
11550 {
11552 SetFrozen(false);
11553 }
11554
11557 {
11558 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11559 }
11560
11561
11564 {
11565 PlayerBase nplayer;
11566 if (PlayerBase.CastTo(nplayer, player))
11567 {
11569
11570 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11571 }
11572 }
11573
11574
11577 {
11578 PlayerBase nplayer;
11579 if (PlayerBase.CastTo(nplayer,player))
11580 {
11581
11582 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11583
11584 }
11585
11586
11587 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11588
11589
11590 if (HasEnergyManager())
11591 {
11592 GetCompEM().UpdatePlugState();
11593 }
11594 }
11595
11596
11598 {
11599 super.OnPlacementStarted(player);
11600
11602 }
11603
11604 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11605 {
11607 {
11608 m_AdminLog.OnPlacementComplete(player,
this);
11609 }
11610
11611 super.OnPlacementComplete(player, position, orientation);
11612 }
11613
11614
11615
11616
11617
11619 {
11621 {
11622 return true;
11623 }
11624 else
11625 {
11626 return false;
11627 }
11628 }
11629
11630
11632 {
11634 {
11636 }
11637 }
11638
11639
11641 {
11643 }
11644
11646 {
11648 }
11649
11650 override void InsertAgent(
int agent,
float count = 1)
11651 {
11652 if (count < 1)
11653 return;
11654
11656 }
11657
11660 {
11662 }
11663
11664
11666 {
11668 }
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11712 {
11714 return false;
11715 return true;
11716 }
11717
11719 {
11720
11722 }
11723
11724
11727 {
11728 super.CheckForRoofLimited(timeTresholdMS);
11729
11731 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11732 {
11733 m_PreviousRoofTestTime = time;
11734 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11735 }
11736 }
11737
11738
11740 {
11742 {
11743 return 0;
11744 }
11745
11746 if (GetInventory().GetAttachmentSlotsCount() != 0)
11747 {
11748 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11749 if (filter)
11750 return filter.GetProtectionLevel(type, false, system);
11751 else
11752 return 0;
11753 }
11754
11755 string subclassPath, entryName;
11756
11757 switch (type)
11758 {
11760 entryName = "biological";
11761 break;
11763 entryName = "chemical";
11764 break;
11765 default:
11766 entryName = "biological";
11767 break;
11768 }
11769
11770 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11771
11773 }
11774
11775
11776
11779 {
11780 if (!IsMagazine())
11782
11784 }
11785
11786
11787
11788
11789
11794 {
11795 return true;
11796 }
11797
11799 {
11801 }
11802
11803
11804
11805
11806
11808 {
11809 if (parent)
11810 {
11811 if (parent.IsInherited(DayZInfected))
11812 return true;
11813
11814 if (!parent.IsRuined())
11815 return true;
11816 }
11817
11818 return true;
11819 }
11820
11822 {
11823 if (!super.CanPutAsAttachment(parent))
11824 {
11825 return false;
11826 }
11827
11828 if (!IsRuined() && !parent.IsRuined())
11829 {
11830 return true;
11831 }
11832
11833 return false;
11834 }
11835
11837 {
11838
11839
11840
11841
11842 return super.CanReceiveItemIntoCargo(item);
11843 }
11844
11846 {
11847
11848
11849
11850
11851 GameInventory attachmentInv = attachment.GetInventory();
11853 {
11854 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11855 return false;
11856 }
11857
11858 InventoryLocation loc = new InventoryLocation();
11859 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11860 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11861 return false;
11862
11863 return super.CanReceiveAttachment(attachment, slotId);
11864 }
11865
11867 {
11868 if (!super.CanReleaseAttachment(attachment))
11869 return false;
11870
11871 return GetInventory().AreChildrenAccessible();
11872 }
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11895 {
11896 int id = muzzle_owner.GetMuzzleID();
11897 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11898
11899 if (WPOF_array)
11900 {
11901 for (int i = 0; i < WPOF_array.Count(); i++)
11902 {
11903 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11904
11905 if (WPOF)
11906 {
11907 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11908 }
11909 }
11910 }
11911 }
11912
11913
11915 {
11916 int id = muzzle_owner.GetMuzzleID();
11918
11919 if (WPOBE_array)
11920 {
11921 for (int i = 0; i < WPOBE_array.Count(); i++)
11922 {
11923 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11924
11925 if (WPOBE)
11926 {
11927 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11928 }
11929 }
11930 }
11931 }
11932
11933
11935 {
11936 int id = muzzle_owner.GetMuzzleID();
11937 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11938
11939 if (WPOOH_array)
11940 {
11941 for (int i = 0; i < WPOOH_array.Count(); i++)
11942 {
11943 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11944
11945 if (WPOOH)
11946 {
11947 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11948 }
11949 }
11950 }
11951 }
11952
11953
11955 {
11956 int id = muzzle_owner.GetMuzzleID();
11957 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11958
11959 if (WPOOH_array)
11960 {
11961 for (int i = 0; i < WPOOH_array.Count(); i++)
11962 {
11963 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11964
11965 if (WPOOH)
11966 {
11967 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11968 }
11969 }
11970 }
11971 }
11972
11973
11975 {
11976 int id = muzzle_owner.GetMuzzleID();
11977 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11978
11979 if (WPOOH_array)
11980 {
11981 for (int i = 0; i < WPOOH_array.Count(); i++)
11982 {
11983 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11984
11985 if (WPOOH)
11986 {
11987 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11988 }
11989 }
11990 }
11991 }
11992
11993
11994
11996 {
11998 {
11999 return true;
12000 }
12001
12002 return false;
12003 }
12004
12006 {
12008 {
12009 return true;
12010 }
12011
12012 return false;
12013 }
12014
12016 {
12018 {
12019 return true;
12020 }
12021
12022 return false;
12023 }
12024
12026 {
12027 return false;
12028 }
12029
12032 {
12033 return UATimeSpent.DEFAULT_DEPLOY;
12034 }
12035
12036
12037
12038
12040 {
12042 SetSynchDirty();
12043 }
12044
12046 {
12048 }
12049
12050
12052 {
12053 return false;
12054 }
12055
12058 {
12059 string att_type = "None";
12060
12061 if (ConfigIsExisting("soundAttType"))
12062 {
12063 att_type = ConfigGetString("soundAttType");
12064 }
12065
12067 }
12068
12070 {
12072 }
12073
12074
12075
12076
12077
12083
12085 {
12088
12090 }
12091
12092
12094 {
12096 return;
12097
12099
12102
12105
12106 SoundParameters params = new SoundParameters();
12110 }
12111
12112
12114 {
12116 return;
12117
12119 SetSynchDirty();
12120
12123 }
12124
12125
12127 {
12129 return;
12130
12132 SetSynchDirty();
12133
12136 }
12137
12139 {
12141 }
12142
12144 {
12146 }
12147
12150 {
12151 if (!
GetGame().IsDedicatedServer())
12152 {
12153 if (ConfigIsExisting("attachSoundSet"))
12154 {
12155 string cfg_path = "";
12156 string soundset = "";
12157 string type_name =
GetType();
12158
12161 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12162 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12163
12164 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12165 {
12166 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12167 {
12168 if (cfg_slot_array[i] == slot_type)
12169 {
12170 soundset = cfg_soundset_array[i];
12171 break;
12172 }
12173 }
12174 }
12175
12176 if (soundset != "")
12177 {
12178 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12180 }
12181 }
12182 }
12183 }
12184
12186 {
12187
12188 }
12189
12190 void OnApply(PlayerBase player);
12191
12193 {
12194 return 1.0;
12195 };
12196
12198 {
12200 }
12201
12203 {
12205 }
12206
12208
12210 {
12211 SetDynamicPhysicsLifeTime(0.01);
12213 }
12214
12216 {
12217 array<string> zone_names = new array<string>;
12218 GetDamageZones(zone_names);
12219 for (int i = 0; i < zone_names.Count(); i++)
12220 {
12221 SetHealthMax(zone_names.Get(i),"Health");
12222 }
12223 SetHealthMax("","Health");
12224 }
12225
12228 {
12229 float global_health = GetHealth01("","Health");
12230 array<string> zones = new array<string>;
12231 GetDamageZones(zones);
12232
12233 for (int i = 0; i < zones.Count(); i++)
12234 {
12235 SetHealth01(zones.Get(i),"Health",global_health);
12236 }
12237 }
12238
12241 {
12242 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12243 }
12244
12246 {
12247 if (!hasRootAsPlayer)
12248 {
12249 if (refParentIB)
12250 {
12251
12252 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12253 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12254
12255 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12256 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12257
12260 }
12261 else
12262 {
12263
12266 }
12267 }
12268 }
12269
12271 {
12273 {
12274 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12275 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12276 {
12277 float heatPermCoef = 1.0;
12279 while (ent)
12280 {
12281 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12282 ent = ent.GetHierarchyParent();
12283 }
12284
12285 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12286 }
12287 }
12288 }
12289
12291 {
12292
12293 EntityAI parent = GetHierarchyParent();
12294 if (!parent)
12295 {
12296 hasParent = false;
12297 hasRootAsPlayer = false;
12298 }
12299 else
12300 {
12301 hasParent = true;
12302 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12303 refParentIB =
ItemBase.Cast(parent);
12304 }
12305 }
12306
12307 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12308 {
12309
12310 }
12311
12313 {
12314
12315 return false;
12316 }
12317
12319 {
12320
12321
12322 return false;
12323 }
12324
12326 {
12327
12328 return false;
12329 }
12330
12333 {
12334 return !GetIsFrozen() &&
IsOpen();
12335 }
12336
12338 {
12339 bool hasParent = false, hasRootAsPlayer = false;
12341
12342 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12343 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12344
12345 if (wwtu || foodDecay)
12346 {
12350
12351 if (processWetness || processTemperature || processDecay)
12352 {
12354
12355 if (processWetness)
12356 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12357
12358 if (processTemperature)
12360
12361 if (processDecay)
12362 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12363 }
12364 }
12365 }
12366
12369 {
12371 }
12372
12374 {
12377
12378 return super.GetTemperatureFreezeThreshold();
12379 }
12380
12382 {
12385
12386 return super.GetTemperatureThawThreshold();
12387 }
12388
12390 {
12393
12394 return super.GetItemOverheatThreshold();
12395 }
12396
12398 {
12400 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12401
12402 return super.GetTemperatureFreezeTime();
12403 }
12404
12406 {
12408 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12409
12410 return super.GetTemperatureThawTime();
12411 }
12412
12417
12419 {
12420 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12421 }
12422
12424 {
12425 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12426 }
12427
12430 {
12432 }
12433
12435 {
12437 }
12438
12440 {
12442 }
12443
12446 {
12447 return null;
12448 }
12449
12452 {
12453 return false;
12454 }
12455
12457 {
12459 {
12462 if (!trg)
12463 {
12465 explosive = this;
12466 }
12467
12468 explosive.PairRemote(trg);
12470
12471 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12472 trg.SetPersistentPairID(persistentID);
12473 explosive.SetPersistentPairID(persistentID);
12474
12475 return true;
12476 }
12477 return false;
12478 }
12479
12482 {
12483 float ret = 1.0;
12486 ret *= GetHealth01();
12487
12488 return ret;
12489 }
12490
12491 #ifdef DEVELOPER
12492 override void SetDebugItem()
12493 {
12494 super.SetDebugItem();
12495 _itemBase = this;
12496 }
12497
12499 {
12500 string text = super.GetDebugText();
12501
12503 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12504
12505 return text;
12506 }
12507 #endif
12508
12510 {
12511 return true;
12512 }
12513
12515
12517
12519 {
12522 }
12523
12524
12532
12548}
12549
12551{
12553 if (entity)
12554 {
12555 bool is_item = entity.IsInherited(
ItemBase);
12556 if (is_item && full_quantity)
12557 {
12560 }
12561 }
12562 else
12563 {
12565 return NULL;
12566 }
12567 return entity;
12568}
12569
12571{
12572 if (item)
12573 {
12574 if (health > 0)
12575 item.SetHealth("", "", health);
12576
12577 if (item.CanHaveTemperature())
12578 {
12580 if (item.CanFreeze())
12581 item.SetFrozen(false);
12582 }
12583
12584 if (item.HasEnergyManager())
12585 {
12586 if (quantity >= 0)
12587 {
12588 item.GetCompEM().SetEnergy0To1(quantity);
12589 }
12590 else
12591 {
12593 }
12594 }
12595 else if (item.IsMagazine())
12596 {
12597 Magazine mag = Magazine.Cast(item);
12598 if (quantity >= 0)
12599 {
12600 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12601 }
12602 else
12603 {
12605 }
12606
12607 }
12608 else
12609 {
12610 if (quantity >= 0)
12611 {
12612 item.SetQuantityNormalized(quantity, false);
12613 }
12614 else
12615 {
12617 }
12618
12619 }
12620 }
12621}
12622
12623#ifdef DEVELOPER
12625#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.