7703{
7705 {
7706 return true;
7707 }
7708};
7709
7710
7711
7713{
7717
7719
7722
7723
7724
7725
7726
7735
7741
7746
7751
7772 protected bool m_IsResultOfSplit
7773
7775
7780
7781
7782
7784
7788
7789
7790
7792
7795
7796
7797
7803
7804
7812
7815
7816
7818
7819
7821
7822
7827
7828
7833
7834
7836
7837
7839 {
7844
7845 if (!
GetGame().IsDedicatedServer())
7846 {
7848 {
7850
7852 {
7854 }
7855 }
7856
7859 }
7860
7861 m_OldLocation = null;
7862
7864 {
7866 }
7867
7868 if (ConfigIsExisting("headSelectionsToHide"))
7869 {
7872 }
7873
7875 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7876 {
7878 }
7879
7881
7882 m_IsResultOfSplit = false;
7883
7885 }
7886
7888 {
7889 super.InitItemVariables();
7890
7896 m_Count = ConfigGetInt(
"count");
7897
7900
7905
7908
7913
7925
7929
7930
7933 if (ConfigIsExisting("canBeSplit"))
7934 {
7937 }
7938
7940 if (ConfigIsExisting("itemBehaviour"))
7942
7943
7946 RegisterNetSyncVariableInt("m_VarLiquidType");
7947 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7948
7949 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7950 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7951 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7952
7953 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7954 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7955 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7956 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7957
7958 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7959 RegisterNetSyncVariableBool("m_IsTakeable");
7960 RegisterNetSyncVariableBool("m_IsHologram");
7961
7964 {
7967 }
7968
7970
7972 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7974
7975 }
7976
7978 {
7980 }
7981
7983 {
7986 {
7991 }
7992 }
7993
7994 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7995 {
7997 {
8000 }
8001
8003 }
8004
8006 {
8012 }
8013
8015
8017 {
8019
8020 if (!action)
8021 {
8022 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8023 return;
8024 }
8025
8027 if (!ai)
8028 {
8030 return;
8031 }
8032
8034 if (!action_array)
8035 {
8036 action_array = new array<ActionBase_Basic>;
8038 }
8039 if (LogManager.IsActionLogEnable())
8040 {
8041 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8042 }
8043
8044 if (action_array.Find(action) != -1)
8045 {
8046 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8047 }
8048 else
8049 {
8050 action_array.Insert(action);
8051 }
8052 }
8053
8055 {
8057 ActionBase action = player.GetActionManager().GetAction(actionName);
8060
8061 if (action_array)
8062 {
8063 action_array.RemoveItem(action);
8064 }
8065 }
8066
8067
8068
8070 {
8071 ActionOverrideData overrideData = new ActionOverrideData();
8075
8077 if (!actionMap)
8078 {
8081 }
8082
8083 actionMap.Insert(this.
Type(), overrideData);
8084
8085 }
8086
8088
8090
8091
8093 {
8096
8099
8100 string config_to_search = "CfgVehicles";
8101 string muzzle_owner_config;
8102
8104 {
8105 if (IsInherited(Weapon))
8106 config_to_search = "CfgWeapons";
8107
8108 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8109
8110 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8111
8113
8114 if (config_OnFire_subclass_count > 0)
8115 {
8116 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8117
8118 for (int i = 0; i < config_OnFire_subclass_count; i++)
8119 {
8120 string particle_class = "";
8122 string config_OnFire_entry = config_OnFire_class + particle_class;
8123 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8124 WPOF_array.Insert(WPOF);
8125 }
8126
8127
8129 }
8130 }
8131
8133 {
8134 config_to_search = "CfgWeapons";
8135 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8136
8137 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8138
8140
8141 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8142 {
8143 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8144
8145 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8146 {
8147 string particle_class2 = "";
8149 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8150 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8151 WPOBE_array.Insert(WPOBE);
8152 }
8153
8154
8156 }
8157 }
8158 }
8159
8160
8162 {
8165
8167 {
8168 string config_to_search = "CfgVehicles";
8169
8170 if (IsInherited(Weapon))
8171 config_to_search = "CfgWeapons";
8172
8173 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8174 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8175
8176 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8177 {
8178
8180
8182 {
8184 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8186 return;
8187 }
8188
8191
8192
8193
8195 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8196
8197 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8198 {
8199 string particle_class = "";
8201 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8203
8204 if (entry_type == CT_CLASS)
8205 {
8206 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8207 WPOOH_array.Insert(WPOF);
8208 }
8209 }
8210
8211
8213 }
8214 }
8215 }
8216
8218 {
8220 }
8221
8223 {
8225 {
8227
8230
8233
8234 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8235 }
8236 }
8237
8239 {
8241 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8242
8244 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8245
8247 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8248
8250 {
8252 }
8253 }
8254
8256 {
8258 }
8259
8261 {
8264 else
8266
8268 {
8271 }
8272 else
8273 {
8276
8279 }
8280
8282 }
8283
8285 {
8287 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8288 }
8289
8291 {
8293 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8295 }
8296
8298 {
8300 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8301 }
8302
8304 {
8307
8308 OverheatingParticle OP = new OverheatingParticle();
8313
8315 }
8316
8318 {
8321
8322 return -1;
8323 }
8324
8326 {
8328 {
8331
8332 for (int i = count; i > 0; --i)
8333 {
8334 int id = i - 1;
8337
8340
8341 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8342 {
8343 if (p)
8344 {
8347 }
8348 }
8349 }
8350 }
8351 }
8352
8354 {
8356 {
8358 {
8359 int id = i - 1;
8361
8362 if (OP)
8363 {
8365
8366 if (p)
8367 {
8369 }
8370
8371 delete OP;
8372 }
8373 }
8374
8377 }
8378 }
8379
8382 {
8383 return 0.0;
8384 }
8385
8386
8388 {
8389 return 250;
8390 }
8391
8393 {
8394 return 0;
8395 }
8396
8399 {
8401 return true;
8402
8403 return false;
8404 }
8405
8408 {
8411
8413 {
8415 }
8416 else
8417 {
8418
8420 }
8421
8423 }
8424
8431 {
8432 return -1;
8433 }
8434
8435
8436
8437
8439 {
8441 {
8443 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8444
8445 if (r_index >= 0)
8446 {
8447 InventoryLocation r_il = new InventoryLocation;
8448 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8449
8450 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8453 {
8454 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8455 }
8457 {
8458 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8459 }
8460
8461 }
8462
8463 player.GetHumanInventory().ClearUserReservedLocation(this);
8464 }
8465
8468 }
8469
8470
8471
8472
8474 {
8475 return ItemBase.m_DebugActionsMask;
8476 }
8477
8479 {
8480 return ItemBase.m_DebugActionsMask & mask;
8481 }
8482
8484 {
8485 ItemBase.m_DebugActionsMask = mask;
8486 }
8487
8489 {
8490 ItemBase.m_DebugActionsMask |= mask;
8491 }
8492
8494 {
8495 ItemBase.m_DebugActionsMask &= ~mask;
8496 }
8497
8499 {
8501 {
8503 }
8504 else
8505 {
8507 }
8508 }
8509
8510
8512 {
8513 if (GetEconomyProfile())
8514 {
8515 float q_max = GetEconomyProfile().GetQuantityMax();
8516 if (q_max > 0)
8517 {
8518 float q_min = GetEconomyProfile().GetQuantityMin();
8519 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8520
8522 {
8523 ComponentEnergyManager comp = GetCompEM();
8525 {
8527 }
8528 }
8530 {
8532
8533 }
8534
8535 }
8536 }
8537 }
8538
8541 {
8542 EntityAI parent = GetHierarchyParent();
8543
8544 if (parent)
8545 {
8546 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8547 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8548 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8549 }
8550 }
8551
8554 {
8555 EntityAI parent = GetHierarchyParent();
8556
8557 if (parent)
8558 {
8559 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8560 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8561 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8562 }
8563 }
8564
8566 {
8567
8568
8569
8570
8572
8574 {
8575 if (ScriptInputUserData.CanStoreInputUserData())
8576 {
8577 ScriptInputUserData ctx = new ScriptInputUserData;
8583 ctx.
Write(use_stack_max);
8586
8588 {
8589 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8590 }
8591 }
8592 }
8593 else if (!
GetGame().IsMultiplayer())
8594 {
8596 }
8597 }
8598
8600 {
8602 }
8603
8605 {
8607 }
8608
8610 {
8612 }
8613
8615 {
8616
8617 return false;
8618 }
8619
8621 {
8622 return false;
8623 }
8624
8628 {
8629 return false;
8630 }
8631
8633 {
8634 return "";
8635 }
8636
8638
8640 {
8641 return false;
8642 }
8643
8645 {
8646 return true;
8647 }
8648
8649
8650
8652 {
8653 return true;
8654 }
8655
8657 {
8658 return true;
8659 }
8660
8662 {
8663 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8665 }
8666
8668 {
8670 }
8671
8673 {
8675 if (!is_being_placed)
8677 SetSynchDirty();
8678 }
8679
8680
8682
8684 {
8686 }
8687
8689 {
8691 }
8692
8694 {
8695 return 1;
8696 }
8697
8699 {
8700 return false;
8701 }
8702
8704 {
8706 SetSynchDirty();
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
8740
8741
8742
8744 {
8745 super.OnMovedInsideCargo(container);
8746
8747 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8748 }
8749
8750 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8751 {
8752 super.EEItemLocationChanged(oldLoc,newLoc);
8753
8754 PlayerBase new_player = null;
8755 PlayerBase old_player = null;
8756
8757 if (newLoc.GetParent())
8758 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8759
8760 if (oldLoc.GetParent())
8761 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8762
8764 {
8765 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8766
8767 if (r_index >= 0)
8768 {
8769 InventoryLocation r_il = new InventoryLocation;
8770 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8771
8772 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8775 {
8776 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8777 }
8779 {
8780 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8781 }
8782
8783 }
8784 }
8785
8787 {
8788 if (new_player)
8789 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8790
8791 if (new_player == old_player)
8792 {
8793
8794 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8795 {
8797 {
8798 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8799 {
8800 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8801 }
8802 }
8803 else
8804 {
8805 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8806 }
8807 }
8808
8809 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8810 {
8811 int type = oldLoc.GetType();
8813 {
8814 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8815 }
8817 {
8818 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8819 }
8820 }
8821 if (!m_OldLocation)
8822 {
8823 m_OldLocation = new InventoryLocation;
8824 }
8825 m_OldLocation.Copy(oldLoc);
8826 }
8827 else
8828 {
8829 if (m_OldLocation)
8830 {
8831 m_OldLocation.Reset();
8832 }
8833 }
8834
8836 }
8837 else
8838 {
8839 if (new_player)
8840 {
8841 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8842 if (res_index >= 0)
8843 {
8844 InventoryLocation il = new InventoryLocation;
8845 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8847 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8850 {
8851 il.
GetParent().GetOnReleaseLock().Invoke(it);
8852 }
8854 {
8856 }
8857
8858 }
8859 }
8861 {
8862
8864 }
8865
8866 if (m_OldLocation)
8867 {
8868 m_OldLocation.Reset();
8869 }
8870 }
8871 }
8872
8873 override void EOnContact(IEntity other, Contact extra)
8874 {
8876 {
8877 int liquidType = -1;
8879 if (impactSpeed > 0.0)
8880 {
8882 #ifndef SERVER
8884 #else
8886 SetSynchDirty();
8887 #endif
8889 }
8890 }
8891
8892 #ifdef SERVER
8893 if (GetCompEM() && GetCompEM().IsPlugged())
8894 {
8895 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8896 GetCompEM().UnplugThis();
8897 }
8898 #endif
8899 }
8900
8902
8904 {
8906 }
8907
8909 {
8910
8911 }
8912
8914 {
8915 super.OnItemLocationChanged(old_owner, new_owner);
8916
8917 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8918 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8919
8920 if (!relatedPlayer && playerNew)
8921 relatedPlayer = playerNew;
8922
8923 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8924 {
8926 if (actionMgr)
8927 {
8928 ActionBase currentAction = actionMgr.GetRunningAction();
8929 if (currentAction)
8931 }
8932 }
8933
8934 Man ownerPlayerOld = null;
8935 Man ownerPlayerNew = null;
8936
8937 if (old_owner)
8938 {
8939 if (old_owner.
IsMan())
8940 {
8941 ownerPlayerOld = Man.Cast(old_owner);
8942 }
8943 else
8944 {
8945 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8946 }
8947 }
8948 else
8949 {
8951 {
8953
8954 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8955 {
8956 GetCompEM().UnplugThis();
8957 }
8958 }
8959 }
8960
8961 if (new_owner)
8962 {
8963 if (new_owner.
IsMan())
8964 {
8965 ownerPlayerNew = Man.Cast(new_owner);
8966 }
8967 else
8968 {
8969 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8970 }
8971 }
8972
8973 if (ownerPlayerOld != ownerPlayerNew)
8974 {
8975 if (ownerPlayerOld)
8976 {
8977 array<EntityAI> subItemsExit = new array<EntityAI>;
8979 for (int i = 0; i < subItemsExit.Count(); i++)
8980 {
8983 }
8984 }
8985
8986 if (ownerPlayerNew)
8987 {
8988 array<EntityAI> subItemsEnter = new array<EntityAI>;
8990 for (int j = 0; j < subItemsEnter.Count(); j++)
8991 {
8994 }
8995 }
8996 }
8997 else if (ownerPlayerNew != null)
8998 {
8999 PlayerBase nplayer;
9000 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9001 {
9002 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9004 for (int k = 0; k < subItemsUpdate.Count(); k++)
9005 {
9007 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9008 }
9009 }
9010 }
9011
9012 if (old_owner)
9013 old_owner.OnChildItemRemoved(this);
9014 if (new_owner)
9015 new_owner.OnChildItemReceived(this);
9016 }
9017
9018
9020 {
9021 super.EEDelete(parent);
9022 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9023 if (player)
9024 {
9026
9027 if (player.IsAlive())
9028 {
9029 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9030 if (r_index >= 0)
9031 {
9032 InventoryLocation r_il = new InventoryLocation;
9033 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9034
9035 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9038 {
9039 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9040 }
9042 {
9043 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9044 }
9045
9046 }
9047
9048 player.RemoveQuickBarEntityShortcut(this);
9049 }
9050 }
9051 }
9052
9054 {
9055 super.EEKilled(killer);
9056
9059 {
9060 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9061 {
9062 if (IsMagazine())
9063 {
9064 if (Magazine.Cast(this).GetAmmoCount() > 0)
9065 {
9067 }
9068 }
9069 else
9070 {
9072 }
9073 }
9074 }
9075 }
9076
9078 {
9079 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9080
9081 super.OnWasAttached(parent, slot_id);
9082
9085
9087 }
9088
9090 {
9091 super.OnWasDetached(parent, slot_id);
9092
9095 }
9096
9098 {
9099 int idx;
9102
9103 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9104 if (inventory_slots.Count() < 1)
9105 {
9106 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9107 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9108 }
9109 else
9110 {
9111 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9112 }
9113
9114 idx = inventory_slots.Find(slot);
9115 if (idx < 0)
9116 return "";
9117
9118 return attach_types.Get(idx);
9119 }
9120
9122 {
9123 int idx = -1;
9124 string slot;
9125
9128
9129 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9130 if (inventory_slots.Count() < 1)
9131 {
9132 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9133 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9134 }
9135 else
9136 {
9137 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9138 if (detach_types.Count() < 1)
9139 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9140 }
9141
9142 for (int i = 0; i < inventory_slots.Count(); i++)
9143 {
9144 slot = inventory_slots.Get(i);
9145 }
9146
9147 if (slot != "")
9148 {
9149 if (detach_types.Count() == 1)
9150 idx = 0;
9151 else
9152 idx = inventory_slots.Find(slot);
9153 }
9154 if (idx < 0)
9155 return "";
9156
9157 return detach_types.Get(idx);
9158 }
9159
9161 {
9162
9164
9165
9166 float min_time = 1;
9167 float max_time = 3;
9168 float delay = Math.RandomFloat(min_time, max_time);
9169
9170 explode_timer.Run(delay, this, "DoAmmoExplosion");
9171 }
9172
9174 {
9175 Magazine magazine = Magazine.Cast(this);
9176 int pop_sounds_count = 6;
9177 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9178
9179
9180 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9181 string sound_name = pop_sounds[ sound_idx ];
9183
9184
9185 magazine.ServerAddAmmoCount(-1);
9186
9187
9188 float min_temp_to_explode = 100;
9189
9190 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9191 {
9193 }
9194 }
9195
9196
9197 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9198 {
9199 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9200
9201 const int CHANCE_DAMAGE_CARGO = 4;
9202 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9203 const int CHANCE_DAMAGE_NOTHING = 2;
9204
9206 {
9207 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9208 int chances;
9209 int rnd;
9210
9211 if (GetInventory().GetCargo())
9212 {
9213 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9214 rnd = Math.RandomInt(0,chances);
9215
9216 if (rnd < CHANCE_DAMAGE_CARGO)
9217 {
9219 }
9220 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9221 {
9223 }
9224 }
9225 else
9226 {
9227 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9228 rnd = Math.RandomInt(0,chances);
9229
9230 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9231 {
9233 }
9234 }
9235 }
9236 }
9237
9239 {
9240 if (GetInventory().GetCargo())
9241 {
9242 int item_count = GetInventory().GetCargo().GetItemCount();
9243 if (item_count > 0)
9244 {
9245 int random_pick = Math.RandomInt(0, item_count);
9247 if (!item.IsExplosive())
9248 {
9249 item.AddHealth("","",damage);
9250 return true;
9251 }
9252 }
9253 }
9254 return false;
9255 }
9256
9258 {
9259 int attachment_count = GetInventory().AttachmentCount();
9260 if (attachment_count > 0)
9261 {
9262 int random_pick = Math.RandomInt(0, attachment_count);
9263 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9264 if (!attachment.IsExplosive())
9265 {
9266 attachment.AddHealth("","",damage);
9267 return true;
9268 }
9269 }
9270 return false;
9271 }
9272
9274 {
9276 }
9277
9279 {
9281 return GetInventory().CanRemoveEntity();
9282
9283 return false;
9284 }
9285
9287 {
9289 return;
9290
9292 {
9293 if (ScriptInputUserData.CanStoreInputUserData())
9294 {
9295 ScriptInputUserData ctx = new ScriptInputUserData;
9300 ctx.
Write(destination_entity);
9304 }
9305 }
9306 else if (!
GetGame().IsMultiplayer())
9307 {
9309 }
9310 }
9311
9313 {
9315 return;
9316
9317 float split_quantity_new;
9321 InventoryLocation loc = new InventoryLocation;
9322
9323 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9324 {
9326 split_quantity_new = stack_max;
9327 else
9329
9330 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9331 if (new_item)
9332 {
9333 new_item.SetResultOfSplit(true);
9334 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9336 new_item.SetQuantity(split_quantity_new);
9337 }
9338 }
9339 else if (destination_entity && slot_id == -1)
9340 {
9341 if (quantity > stack_max)
9342 split_quantity_new = stack_max;
9343 else
9344 split_quantity_new = quantity;
9345
9347 {
9350 }
9351
9352 if (new_item)
9353 {
9354 new_item.SetResultOfSplit(true);
9355 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9357 new_item.SetQuantity(split_quantity_new);
9358 }
9359 }
9360 else
9361 {
9362 if (stack_max != 0)
9363 {
9365 {
9367 }
9368
9369 if (split_quantity_new == 0)
9370 {
9371 if (!
GetGame().IsMultiplayer())
9372 player.PhysicalPredictiveDropItem(this);
9373 else
9374 player.ServerDropEntity(this);
9375 return;
9376 }
9377
9379
9380 if (new_item)
9381 {
9382 new_item.SetResultOfSplit(true);
9383 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9385 new_item.SetQuantity(stack_max);
9386 new_item.PlaceOnSurface();
9387 }
9388 }
9389 }
9390 }
9391
9393 {
9395 return;
9396
9397 float split_quantity_new;
9401 InventoryLocation loc = new InventoryLocation;
9402
9403 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9404 {
9406 split_quantity_new = stack_max;
9407 else
9409
9410 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9411 if (new_item)
9412 {
9413 new_item.SetResultOfSplit(true);
9414 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9416 new_item.SetQuantity(split_quantity_new);
9417 }
9418 }
9419 else if (destination_entity && slot_id == -1)
9420 {
9421 if (quantity > stack_max)
9422 split_quantity_new = stack_max;
9423 else
9424 split_quantity_new = quantity;
9425
9427 {
9430 }
9431
9432 if (new_item)
9433 {
9434 new_item.SetResultOfSplit(true);
9435 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9437 new_item.SetQuantity(split_quantity_new);
9438 }
9439 }
9440 else
9441 {
9442 if (stack_max != 0)
9443 {
9445 {
9447 }
9448
9450
9451 if (new_item)
9452 {
9453 new_item.SetResultOfSplit(true);
9454 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9456 new_item.SetQuantity(stack_max);
9457 new_item.PlaceOnSurface();
9458 }
9459 }
9460 }
9461 }
9462
9464 {
9466 return;
9467
9469 {
9470 if (ScriptInputUserData.CanStoreInputUserData())
9471 {
9472 ScriptInputUserData ctx = new ScriptInputUserData;
9477 dst.WriteToContext(ctx);
9479 }
9480 }
9481 else if (!
GetGame().IsMultiplayer())
9482 {
9484 }
9485 }
9486
9488 {
9490 return;
9491
9493 {
9494 if (ScriptInputUserData.CanStoreInputUserData())
9495 {
9496 ScriptInputUserData ctx = new ScriptInputUserData;
9501 ctx.
Write(destination_entity);
9507 }
9508 }
9509 else if (!
GetGame().IsMultiplayer())
9510 {
9512 }
9513 }
9514
9516 {
9518 }
9519
9521 {
9523 return this;
9524
9526 float split_quantity_new;
9528 if (dst.IsValid())
9529 {
9530 int slot_id = dst.GetSlot();
9532
9533 if (quantity > stack_max)
9534 split_quantity_new = stack_max;
9535 else
9536 split_quantity_new = quantity;
9537
9539
9540 if (new_item)
9541 {
9542 new_item.SetResultOfSplit(true);
9543 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9546 }
9547
9548 return new_item;
9549 }
9550
9551 return null;
9552 }
9553
9555 {
9557 return;
9558
9560 float split_quantity_new;
9562 if (destination_entity)
9563 {
9565 if (quantity > stackable)
9566 split_quantity_new = stackable;
9567 else
9568 split_quantity_new = quantity;
9569
9570 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9571 if (new_item)
9572 {
9573 new_item.SetResultOfSplit(true);
9574 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9576 new_item.SetQuantity(split_quantity_new);
9577 }
9578 }
9579 }
9580
9582 {
9584 return;
9585
9587 {
9588 if (ScriptInputUserData.CanStoreInputUserData())
9589 {
9590 ScriptInputUserData ctx = new ScriptInputUserData;
9595 ItemBase destination_entity =
this;
9596 ctx.
Write(destination_entity);
9600 }
9601 }
9602 else if (!
GetGame().IsMultiplayer())
9603 {
9605 }
9606 }
9607
9609 {
9611 return;
9612
9614 float split_quantity_new;
9616 if (player)
9617 {
9619 if (quantity > stackable)
9620 split_quantity_new = stackable;
9621 else
9622 split_quantity_new = quantity;
9623
9624 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9625 new_item =
ItemBase.Cast(in_hands);
9626 if (new_item)
9627 {
9628 new_item.SetResultOfSplit(true);
9629 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9631 new_item.SetQuantity(split_quantity_new);
9632 }
9633 }
9634 }
9635
9637 {
9639 return;
9640
9642 float split_quantity_new = Math.Floor(quantity * 0.5);
9643
9645
9646 if (new_item)
9647 {
9648 if (new_item.GetQuantityMax() < split_quantity_new)
9649 {
9650 split_quantity_new = new_item.GetQuantityMax();
9651 }
9652
9653 new_item.SetResultOfSplit(true);
9654 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9655
9657 {
9660 }
9661 else
9662 {
9665 }
9666 }
9667 }
9668
9670 {
9672 return;
9673
9675 float split_quantity_new = Math.Floor(quantity / 2);
9676
9677 InventoryLocation invloc = new InventoryLocation;
9679
9681 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9682
9683 if (new_item)
9684 {
9685 if (new_item.GetQuantityMax() < split_quantity_new)
9686 {
9687 split_quantity_new = new_item.GetQuantityMax();
9688 }
9690 {
9693 }
9694 else
9695 {
9698 }
9699 }
9700 }
9701
9704 {
9705 SetWeightDirty();
9707
9708 if (parent)
9709 parent.OnAttachmentQuantityChangedEx(this, delta);
9710
9712 {
9714 {
9716 }
9718 {
9719 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9721 }
9722 }
9723
9724 }
9725
9728 {
9729
9730 }
9731
9734 {
9736 }
9737
9739 {
9740 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9741
9743 {
9744 if (newLevel == GameConstants.STATE_RUINED)
9745 {
9747 EntityAI parent = GetHierarchyParent();
9748 if (parent && parent.IsFireplace())
9749 {
9750 CargoBase cargo = GetInventory().GetCargo();
9751 if (cargo)
9752 {
9754 {
9756 }
9757 }
9758 }
9759 }
9760
9762 {
9763
9765 return;
9766 }
9767
9768 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9769 {
9771 }
9772 }
9773 }
9774
9775
9777 {
9778 super.OnRightClick();
9779
9781 {
9783 {
9784 if (ScriptInputUserData.CanStoreInputUserData())
9785 {
9786 vector m4[4];
9788
9789 EntityAI root = GetHierarchyRoot();
9790
9791 InventoryLocation dst = new InventoryLocation;
9793 {
9794 if (root)
9795 {
9796 root.GetTransform(m4);
9798 }
9799 else
9800 GetInventory().GetCurrentInventoryLocation(dst);
9801 }
9802 else
9803 {
9805
9806
9807 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9808 {
9809 if (root)
9810 {
9811 root.GetTransform(m4);
9813 }
9814 else
9815 GetInventory().GetCurrentInventoryLocation(dst);
9816 }
9817 else
9818 {
9819 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9820 }
9821 }
9822
9823 ScriptInputUserData ctx = new ScriptInputUserData;
9831 }
9832 }
9833 else if (!
GetGame().IsMultiplayer())
9834 {
9836 }
9837 }
9838 }
9839
9840 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9841 {
9842
9843 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9844 return false;
9845
9846 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9847 return false;
9848
9849
9851 return false;
9852
9853
9854 Magazine mag = Magazine.Cast(this);
9855 if (mag)
9856 {
9857 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9858 return false;
9859
9860 if (stack_max_limit)
9861 {
9862 Magazine other_mag = Magazine.Cast(other_item);
9863 if (other_item)
9864 {
9865 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9866 return false;
9867 }
9868
9869 }
9870 }
9871 else
9872 {
9873
9875 return false;
9876
9878 return false;
9879 }
9880
9881 PlayerBase player = null;
9882 if (CastTo(player, GetHierarchyRootPlayer()))
9883 {
9884 if (player.GetInventory().HasAttachment(this))
9885 return false;
9886
9887 if (player.IsItemsToDelete())
9888 return false;
9889 }
9890
9891 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9892 return false;
9893
9894 int slotID;
9896 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9897 return false;
9898
9899 return true;
9900 }
9901
9903 {
9905 }
9906
9908 {
9909 return m_IsResultOfSplit;
9910 }
9911
9913 {
9914 m_IsResultOfSplit = value;
9915 }
9916
9918 {
9920 }
9921
9923 {
9924 float other_item_quantity = other_item.GetQuantity();
9925 float this_free_space;
9926
9928
9930
9931 if (other_item_quantity > this_free_space)
9932 {
9933 return this_free_space;
9934 }
9935 else
9936 {
9937 return other_item_quantity;
9938 }
9939 }
9940
9942 {
9944 }
9945
9947 {
9949 return;
9950
9951 if (!IsMagazine() && other_item)
9952 {
9954 if (quantity_used != 0)
9955 {
9956 float hp1 = GetHealth01("","");
9957 float hp2 = other_item.GetHealth01("","");
9958 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9959 hpResult = hpResult / (
GetQuantity() + quantity_used);
9960
9961 hpResult *= GetMaxHealth();
9962 Math.Round(hpResult);
9963 SetHealth("", "Health", hpResult);
9964
9966 other_item.AddQuantity(-quantity_used);
9967 }
9968 }
9970 }
9971
9973 {
9974 #ifdef SERVER
9975 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9976 GetHierarchyParent().IncreaseLifetimeUp();
9977 #endif
9978 };
9979
9981 {
9982 PlayerBase p = PlayerBase.Cast(player);
9983
9984 array<int> recipesIds = p.m_Recipes;
9985 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9986 if (moduleRecipesManager)
9987 {
9988 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9989 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9990 }
9991
9992 for (int i = 0;i < recipesIds.Count(); i++)
9993 {
9994 int key = recipesIds.Get(i);
9995 string recipeName = moduleRecipesManager.GetRecipeName(key);
9997 }
9998 }
9999
10000
10001 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10002 {
10003 super.GetDebugActions(outputList);
10004
10005
10010
10011
10015
10019
10020
10023
10024
10026 {
10029 }
10030
10032
10035
10039 }
10040
10041
10042
10043
10045 {
10046 super.OnAction(action_id, player, ctx);
10047 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10048 {
10049 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10050 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10051 PlayerBase p = PlayerBase.Cast(player);
10052 if (
EActions.RECIPES_RANGE_START < 1000)
10053 {
10054 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10055 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10056 }
10057 }
10058 #ifndef SERVER
10059 else if (action_id ==
EActions.WATCH_PLAYER)
10060 {
10061 PluginDeveloper.SetDeveloperItemClientEx(player);
10062 }
10063 #endif
10065 {
10066 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10067 {
10068 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10069 OnDebugButtonPressServer(id + 1);
10070 }
10071
10072 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10073 {
10074 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10076 }
10077
10078 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10079 {
10080 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10082 }
10083
10084 else if (action_id ==
EActions.ADD_QUANTITY)
10085 {
10086 if (IsMagazine())
10087 {
10088 Magazine mag = Magazine.Cast(this);
10089 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10090 }
10091 else
10092 {
10094 }
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.REMOVE_QUANTITY)
10104 {
10105 if (IsMagazine())
10106 {
10107 Magazine mag2 = Magazine.Cast(this);
10108 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10109 }
10110 else
10111 {
10113 }
10114 if (m_EM)
10115 {
10116 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10117 }
10118
10119 }
10120
10121 else if (action_id ==
EActions.SET_QUANTITY_0)
10122 {
10124
10125 if (m_EM)
10126 {
10127 m_EM.SetEnergy(0);
10128 }
10129 }
10130
10131 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10132 {
10134
10135 if (m_EM)
10136 {
10137 m_EM.SetEnergy(m_EM.GetEnergyMax());
10138 }
10139 }
10140
10141 else if (action_id ==
EActions.ADD_HEALTH)
10142 {
10143 AddHealth("","",GetMaxHealth("","Health")/5);
10144 }
10145 else if (action_id ==
EActions.REMOVE_HEALTH)
10146 {
10147 AddHealth("","",-GetMaxHealth("","Health")/5);
10148 }
10149 else if (action_id ==
EActions.DESTROY_HEALTH)
10150 {
10151 SetHealth01("","",0);
10152 }
10153 else if (action_id ==
EActions.WATCH_ITEM)
10154 {
10156 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10157 #ifdef DEVELOPER
10158 SetDebugDeveloper_item(this);
10159 #endif
10160 }
10161
10162 else if (action_id ==
EActions.ADD_TEMPERATURE)
10163 {
10164 AddTemperature(20);
10165
10166 }
10167
10168 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10169 {
10170 AddTemperature(-20);
10171
10172 }
10173
10174 else if (action_id ==
EActions.FLIP_FROZEN)
10175 {
10176 SetFrozen(!GetIsFrozen());
10177
10178 }
10179
10180 else if (action_id ==
EActions.ADD_WETNESS)
10181 {
10183
10184 }
10185
10186 else if (action_id ==
EActions.REMOVE_WETNESS)
10187 {
10189
10190 }
10191
10192 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10193 {
10196
10197
10198 }
10199
10200 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10201 {
10204 }
10205
10206 else if (action_id ==
EActions.MAKE_SPECIAL)
10207 {
10208 auto debugParams = DebugSpawnParams.WithPlayer(player);
10209 OnDebugSpawnEx(debugParams);
10210 }
10211
10212 else if (action_id ==
EActions.DELETE)
10213 {
10214 Delete();
10215 }
10216
10217 }
10218
10219
10220 return false;
10221 }
10222
10223
10224
10225
10229
10232
10233
10234
10236 {
10237 return false;
10238 }
10239
10240
10242 {
10243 return true;
10244 }
10245
10246
10248 {
10249 return true;
10250 }
10251
10252
10253
10255 {
10256 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10258 }
10259
10262 {
10263 return null;
10264 }
10265
10267 {
10268 return false;
10269 }
10270
10272 {
10273 return false;
10274 }
10275
10279
10280
10282 {
10283 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10284 return module_repairing.CanRepair(this, item_repair_kit);
10285 }
10286
10287
10288 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10289 {
10290 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10291 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10292 }
10293
10294
10296 {
10297
10298
10299
10300
10301
10302
10303
10304
10305 return 1;
10306 }
10307
10308
10309
10311 {
10313 }
10314
10315
10316
10318 {
10320 }
10321
10322
10331 {
10332 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10333
10334 if (player)
10335 {
10336 player.MessageStatus(text);
10337 }
10338 }
10339
10340
10349 {
10350 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10351
10352 if (player)
10353 {
10354 player.MessageAction(text);
10355 }
10356 }
10357
10358
10367 {
10368 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10369
10370 if (player)
10371 {
10372 player.MessageFriendly(text);
10373 }
10374 }
10375
10376
10385 {
10386 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10387
10388 if (player)
10389 {
10390 player.MessageImportant(text);
10391 }
10392 }
10393
10395 {
10396 return true;
10397 }
10398
10399
10400 override bool KindOf(
string tag)
10401 {
10402 bool found = false;
10403 string item_name = this.
GetType();
10406
10407 int array_size = item_tag_array.Count();
10408 for (int i = 0; i < array_size; i++)
10409 {
10410 if (item_tag_array.Get(i) == tag)
10411 {
10412 found = true;
10413 break;
10414 }
10415 }
10416 return found;
10417 }
10418
10419
10421 {
10422
10423 super.OnRPC(sender, rpc_type,ctx);
10424
10425
10426 switch (rpc_type)
10427 {
10428 #ifndef SERVER
10429 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10430 Param2<bool, string> p = new Param2<bool, string>(false, "");
10431
10433 return;
10434
10435 bool play = p.param1;
10436 string soundSet = p.param2;
10437
10438 if (play)
10439 {
10441 {
10443 {
10445 }
10446 }
10447 else
10448 {
10450 }
10451 }
10452 else
10453 {
10455 }
10456
10457 break;
10458 #endif
10459
10460 }
10461
10463 {
10465 }
10466 }
10467
10468
10469
10470
10472 {
10473 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10474 return plugin.GetID(
name);
10475 }
10476
10478 {
10479 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10480 return plugin.GetName(id);
10481 }
10482
10485 {
10486
10487
10488 int varFlags;
10489 if (!ctx.
Read(varFlags))
10490 return;
10491
10492 if (varFlags & ItemVariableFlags.FLOAT)
10493 {
10495 }
10496 }
10497
10499 {
10500
10501 super.SerializeNumericalVars(floats_out);
10502
10503
10504
10506 {
10508 }
10509
10511 {
10513 }
10514
10516 {
10518 }
10519
10521 {
10526 }
10527
10529 {
10531 }
10532 }
10533
10535 {
10536
10537 super.DeSerializeNumericalVars(floats);
10538
10539
10540 int index = 0;
10541 int mask = Math.Round(floats.Get(index));
10542
10543 index++;
10544
10546 {
10548 {
10550 }
10551 else
10552 {
10553 float quantity = floats.Get(index);
10554 SetQuantity(quantity,
true,
false,
false,
false);
10555 }
10556 index++;
10557 }
10558
10560 {
10561 float wet = floats.Get(index);
10563 index++;
10564 }
10565
10567 {
10568 int liquidtype = Math.Round(floats.Get(index));
10570 index++;
10571 }
10572
10574 {
10576 index++;
10578 index++;
10580 index++;
10582 index++;
10583 }
10584
10586 {
10587 int cleanness = Math.Round(floats.Get(index));
10589 index++;
10590 }
10591 }
10592
10594 {
10595 super.WriteVarsToCTX(ctx);
10596
10597
10599 {
10601 }
10602
10604 {
10606 }
10607
10609 {
10611 }
10612
10614 {
10615 int r,g,b,a;
10621 }
10622
10624 {
10626 }
10627 }
10628
10630 {
10631 if (!super.ReadVarsFromCTX(ctx,version))
10632 return false;
10633
10634 int intValue;
10635 float value;
10636
10637 if (version < 140)
10638 {
10639 if (!ctx.
Read(intValue))
10640 return false;
10641
10642 m_VariablesMask = intValue;
10643 }
10644
10646 {
10647 if (!ctx.
Read(value))
10648 return false;
10649
10651 {
10653 }
10654 else
10655 {
10657 }
10658 }
10659
10660 if (version < 140)
10661 {
10663 {
10664 if (!ctx.
Read(value))
10665 return false;
10666 SetTemperatureDirect(value);
10667 }
10668 }
10669
10671 {
10672 if (!ctx.
Read(value))
10673 return false;
10675 }
10676
10678 {
10679 if (!ctx.
Read(intValue))
10680 return false;
10682 }
10683
10685 {
10686 int r,g,b,a;
10688 return false;
10690 return false;
10692 return false;
10694 return false;
10695
10697 }
10698
10700 {
10701 if (!ctx.
Read(intValue))
10702 return false;
10704 }
10705
10706 if (version >= 138 && version < 140)
10707 {
10709 {
10710 if (!ctx.
Read(intValue))
10711 return false;
10712 SetFrozen(intValue);
10713 }
10714 }
10715
10716 return true;
10717 }
10718
10719
10721 {
10724 {
10726 }
10727
10728 if (!super.OnStoreLoad(ctx, version))
10729 {
10731 return false;
10732 }
10733
10734 if (version >= 114)
10735 {
10736 bool hasQuickBarIndexSaved;
10737
10738 if (!ctx.
Read(hasQuickBarIndexSaved))
10739 {
10741 return false;
10742 }
10743
10744 if (hasQuickBarIndexSaved)
10745 {
10746 int itmQBIndex;
10747
10748
10749 if (!ctx.
Read(itmQBIndex))
10750 {
10752 return false;
10753 }
10754
10755 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10756 if (itmQBIndex != -1 && parentPlayer)
10757 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10758 }
10759 }
10760 else
10761 {
10762
10763 PlayerBase player;
10764 int itemQBIndex;
10765 if (version ==
int.
MAX)
10766 {
10767 if (!ctx.
Read(itemQBIndex))
10768 {
10770 return false;
10771 }
10772 }
10773 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10774 {
10775
10776 if (!ctx.
Read(itemQBIndex))
10777 {
10779 return false;
10780 }
10781 if (itemQBIndex != -1 && player)
10782 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10783 }
10784 }
10785
10786 if (version < 140)
10787 {
10788
10789 if (!LoadVariables(ctx, version))
10790 {
10792 return false;
10793 }
10794 }
10795
10796
10798 {
10800 return false;
10801 }
10802 if (version >= 132)
10803 {
10805 if (raib)
10806 {
10808 {
10810 return false;
10811 }
10812 }
10813 }
10814
10816 return true;
10817 }
10818
10819
10820
10822 {
10823 super.OnStoreSave(ctx);
10824
10825 PlayerBase player;
10826 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10827 {
10829
10830 int itemQBIndex = -1;
10831 itemQBIndex = player.FindQuickBarEntityIndex(this);
10832 ctx.
Write(itemQBIndex);
10833 }
10834 else
10835 {
10837 }
10838
10840
10842 if (raib)
10843 {
10845 }
10846 }
10847
10848
10850 {
10851 super.AfterStoreLoad();
10852
10854 {
10856 }
10857
10859 {
10862 }
10863 }
10864
10866 {
10867 super.EEOnAfterLoad();
10868
10870 {
10872 }
10873
10876 }
10877
10879 {
10880 return false;
10881 }
10882
10883
10884
10886 {
10888 {
10889 #ifdef PLATFORM_CONSOLE
10890
10892 {
10894 if (menu)
10895 {
10897 }
10898 }
10899 #endif
10900 }
10901
10903 {
10906 }
10907
10909 {
10910 SetWeightDirty();
10912 }
10914 {
10917 }
10918
10920 {
10923 }
10925 {
10928 }
10929
10930 super.OnVariablesSynchronized();
10931 }
10932
10933
10934
10936 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10937 {
10938 if (!IsServerCheck(allow_client))
10939 return false;
10940
10942 return false;
10943
10946
10947 if (value <= (min + 0.001))
10948 value = min;
10949
10950 if (value == min)
10951 {
10952 if (destroy_config)
10953 {
10954 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10955 if (dstr)
10956 {
10958 this.Delete();
10959 return true;
10960 }
10961 }
10962 else if (destroy_forced)
10963 {
10965 this.Delete();
10966 return true;
10967 }
10968
10970 }
10971
10974
10976 {
10978
10979 if (delta)
10981 }
10982
10984
10985 return false;
10986 }
10987
10988
10990 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10991 {
10993 }
10994
10996 {
10999 }
11000
11002 {
11005 }
11006
11009 {
11010 float value_clamped = Math.Clamp(value, 0, 1);
11012 SetQuantity(result, destroy_config, destroy_forced);
11013 }
11014
11015
11018 {
11020 }
11021
11023 {
11025 }
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11037 {
11038 int slot = -1;
11039 if (GetInventory())
11040 {
11041 InventoryLocation il = new InventoryLocation;
11042 GetInventory().GetCurrentInventoryLocation(il);
11044 }
11045
11047 }
11048
11050 {
11051 float quantity_max = 0;
11052
11054 {
11055 if (attSlotID != -1)
11056 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11057
11058 if (quantity_max <= 0)
11060 }
11061
11062 if (quantity_max <= 0)
11064
11065 return quantity_max;
11066 }
11067
11069 {
11071 }
11072
11074 {
11076 }
11077
11078
11080 {
11082 }
11083
11085 {
11087 }
11088
11090 {
11092 }
11093
11094
11096 {
11097
11098 float weightEx = GetWeightEx();
11099 float special = GetInventoryAndCargoWeight();
11100 return weightEx - special;
11101 }
11102
11103
11105 {
11107 }
11108
11110 {
11112 {
11113 #ifdef DEVELOPER
11114 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11115 {
11116 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11118 }
11119 #endif
11120
11121 return GetQuantity() * GetConfigWeightModified();
11122 }
11123 else if (HasEnergyManager())
11124 {
11125 #ifdef DEVELOPER
11126 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11127 {
11128 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11129 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11130 }
11131 #endif
11132 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11133 }
11134 else
11135 {
11136 #ifdef DEVELOPER
11137 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11138 {
11139 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11140 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11141 }
11142 #endif
11143 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11144 }
11145 }
11146
11149 {
11150 int item_count = 0;
11152
11153 if (GetInventory().GetCargo() != NULL)
11154 {
11155 item_count = GetInventory().GetCargo().GetItemCount();
11156 }
11157
11158 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11159 {
11160 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11161 if (item)
11162 item_count += item.GetNumberOfItems();
11163 }
11164 return item_count;
11165 }
11166
11169 {
11170 float weight = 0;
11171 float wetness = 1;
11172 if (include_wetness)
11175 {
11176 weight = wetness * m_ConfigWeight;
11177 }
11179 {
11180 weight = 1;
11181 }
11182 return weight;
11183 }
11184
11185
11186
11188 {
11189 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11190 {
11191 GameInventory inv = GetInventory();
11192 array<EntityAI> items = new array<EntityAI>;
11194 for (int i = 0; i < items.Count(); i++)
11195 {
11197 if (item)
11198 {
11200 }
11201 }
11202 }
11203 }
11204
11205
11206
11207
11209 {
11210 float energy = 0;
11211 if (HasEnergyManager())
11212 {
11213 energy = GetCompEM().GetEnergy();
11214 }
11215 return energy;
11216 }
11217
11218
11220 {
11221 super.OnEnergyConsumed();
11222
11224 }
11225
11227 {
11228 super.OnEnergyAdded();
11229
11231 }
11232
11233
11235 {
11236 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11237 {
11239 {
11240 float energy_0to1 = GetCompEM().GetEnergy0To1();
11242 }
11243 }
11244 }
11245
11246
11248 {
11249 return ConfigGetFloat("heatIsolation");
11250 }
11251
11253 {
11255 }
11256
11258 {
11259 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11260 if (
GetGame().ConfigIsExisting(paramPath))
11262
11263 return 0.0;
11264 }
11265
11267 {
11268 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11269 if (
GetGame().ConfigIsExisting(paramPath))
11271
11272 return 0.0;
11273 }
11274
11275 override void SetWet(
float value,
bool allow_client =
false)
11276 {
11277 if (!IsServerCheck(allow_client))
11278 return;
11279
11282
11284
11285 m_VarWet = Math.Clamp(value, min, max);
11286
11288 {
11291 }
11292 }
11293
11294 override void AddWet(
float value)
11295 {
11297 }
11298
11300 {
11302 }
11303
11305 {
11307 }
11308
11310 {
11312 }
11313
11315 {
11317 }
11318
11320 {
11322 }
11323
11324 override void OnWetChanged(
float newVal,
float oldVal)
11325 {
11328 if (newLevel != oldLevel)
11329 {
11331 }
11332 }
11333
11335 {
11336 SetWeightDirty();
11337 }
11338
11340 {
11341 return GetWetLevelInternal(
m_VarWet);
11342 }
11343
11344
11345
11347 {
11349 }
11350
11352 {
11354 }
11355
11357 {
11359 }
11360
11362 {
11364 }
11365
11366
11367
11369 {
11370 if (ConfigIsExisting("itemModelLength"))
11371 {
11372 return ConfigGetFloat("itemModelLength");
11373 }
11374 return 0;
11375 }
11376
11378 {
11379 if (ConfigIsExisting("itemAttachOffset"))
11380 {
11381 return ConfigGetFloat("itemAttachOffset");
11382 }
11383 return 0;
11384 }
11385
11386 override void SetCleanness(
int value,
bool allow_client =
false)
11387 {
11388 if (!IsServerCheck(allow_client))
11389 return;
11390
11392
11394
11397 }
11398
11400 {
11402 }
11403
11405 {
11406 return true;
11407 }
11408
11409
11410
11411
11413 {
11415 }
11416
11418 {
11420 }
11421
11422
11423
11424
11425 override void SetColor(
int r,
int g,
int b,
int a)
11426 {
11432 }
11434 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11435 {
11440 }
11441
11443 {
11445 }
11446
11449 {
11450 int r,g,b,a;
11452 r = r/255;
11453 g = g/255;
11454 b = b/255;
11455 a = a/255;
11456 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11457 }
11458
11459
11460
11461 override void SetLiquidType(
int value,
bool allow_client =
false)
11462 {
11463 if (!IsServerCheck(allow_client))
11464 return;
11465
11470 }
11471
11473 {
11474 return ConfigGetInt("varLiquidTypeInit");
11475 }
11476
11478 {
11480 }
11481
11483 {
11485 SetFrozen(false);
11486 }
11487
11490 {
11491 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11492 }
11493
11494
11497 {
11498 PlayerBase nplayer;
11499 if (PlayerBase.CastTo(nplayer, player))
11500 {
11502
11503 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11504 }
11505 }
11506
11507
11510 {
11511 PlayerBase nplayer;
11512 if (PlayerBase.CastTo(nplayer,player))
11513 {
11514
11515 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11516
11517 }
11518
11519
11520 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11521
11522
11523 if (HasEnergyManager())
11524 {
11525 GetCompEM().UpdatePlugState();
11526 }
11527 }
11528
11529
11531 {
11532 super.OnPlacementStarted(player);
11533
11535 }
11536
11537 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11538 {
11540 {
11541 m_AdminLog.OnPlacementComplete(player,
this);
11542 }
11543
11544 super.OnPlacementComplete(player, position, orientation);
11545 }
11546
11547
11548
11549
11550
11552 {
11554 {
11555 return true;
11556 }
11557 else
11558 {
11559 return false;
11560 }
11561 }
11562
11563
11565 {
11567 {
11569 }
11570 }
11571
11572
11574 {
11576 }
11577
11579 {
11581 }
11582
11583 override void InsertAgent(
int agent,
float count = 1)
11584 {
11585 if (count < 1)
11586 return;
11587
11589 }
11590
11593 {
11595 }
11596
11597
11599 {
11601 }
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11645 {
11647 return false;
11648 return true;
11649 }
11650
11652 {
11653
11655 }
11656
11657
11660 {
11661 super.CheckForRoofLimited(timeTresholdMS);
11662
11664 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11665 {
11666 m_PreviousRoofTestTime = time;
11667 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11668 }
11669 }
11670
11671
11673 {
11675 {
11676 return 0;
11677 }
11678
11679 if (GetInventory().GetAttachmentSlotsCount() != 0)
11680 {
11681 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11682 if (filter)
11683 return filter.GetProtectionLevel(type, false, system);
11684 else
11685 return 0;
11686 }
11687
11688 string subclassPath, entryName;
11689
11690 switch (type)
11691 {
11693 entryName = "biological";
11694 break;
11696 entryName = "chemical";
11697 break;
11698 default:
11699 entryName = "biological";
11700 break;
11701 }
11702
11703 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11704
11706 }
11707
11708
11709
11712 {
11713 if (!IsMagazine())
11715
11717 }
11718
11719
11720
11721
11722
11727 {
11728 return true;
11729 }
11730
11732 {
11734 }
11735
11736
11737
11738
11739
11741 {
11742 if (parent)
11743 {
11744 if (parent.IsInherited(DayZInfected))
11745 return true;
11746
11747 if (!parent.IsRuined())
11748 return true;
11749 }
11750
11751 return true;
11752 }
11753
11755 {
11756 if (!super.CanPutAsAttachment(parent))
11757 {
11758 return false;
11759 }
11760
11761 if (!IsRuined() && !parent.IsRuined())
11762 {
11763 return true;
11764 }
11765
11766 return false;
11767 }
11768
11770 {
11771
11772
11773
11774
11775 return super.CanReceiveItemIntoCargo(item);
11776 }
11777
11779 {
11780
11781
11782
11783
11784 GameInventory attachmentInv = attachment.GetInventory();
11786 {
11787 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11788 return false;
11789 }
11790
11791 InventoryLocation loc = new InventoryLocation();
11792 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11793 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11794 return false;
11795
11796 return super.CanReceiveAttachment(attachment, slotId);
11797 }
11798
11800 {
11801 if (!super.CanReleaseAttachment(attachment))
11802 return false;
11803
11804 return GetInventory().AreChildrenAccessible();
11805 }
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11828 {
11829 int id = muzzle_owner.GetMuzzleID();
11830 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11831
11832 if (WPOF_array)
11833 {
11834 for (int i = 0; i < WPOF_array.Count(); i++)
11835 {
11836 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11837
11838 if (WPOF)
11839 {
11840 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11841 }
11842 }
11843 }
11844 }
11845
11846
11848 {
11849 int id = muzzle_owner.GetMuzzleID();
11851
11852 if (WPOBE_array)
11853 {
11854 for (int i = 0; i < WPOBE_array.Count(); i++)
11855 {
11856 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11857
11858 if (WPOBE)
11859 {
11860 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11861 }
11862 }
11863 }
11864 }
11865
11866
11868 {
11869 int id = muzzle_owner.GetMuzzleID();
11870 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11871
11872 if (WPOOH_array)
11873 {
11874 for (int i = 0; i < WPOOH_array.Count(); i++)
11875 {
11876 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11877
11878 if (WPOOH)
11879 {
11880 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11881 }
11882 }
11883 }
11884 }
11885
11886
11888 {
11889 int id = muzzle_owner.GetMuzzleID();
11890 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11891
11892 if (WPOOH_array)
11893 {
11894 for (int i = 0; i < WPOOH_array.Count(); i++)
11895 {
11896 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11897
11898 if (WPOOH)
11899 {
11900 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11901 }
11902 }
11903 }
11904 }
11905
11906
11908 {
11909 int id = muzzle_owner.GetMuzzleID();
11910 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11911
11912 if (WPOOH_array)
11913 {
11914 for (int i = 0; i < WPOOH_array.Count(); i++)
11915 {
11916 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11917
11918 if (WPOOH)
11919 {
11920 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11921 }
11922 }
11923 }
11924 }
11925
11926
11927
11929 {
11931 {
11932 return true;
11933 }
11934
11935 return false;
11936 }
11937
11939 {
11941 {
11942 return true;
11943 }
11944
11945 return false;
11946 }
11947
11949 {
11951 {
11952 return true;
11953 }
11954
11955 return false;
11956 }
11957
11959 {
11960 return false;
11961 }
11962
11965 {
11966 return UATimeSpent.DEFAULT_DEPLOY;
11967 }
11968
11969
11970
11971
11973 {
11975 SetSynchDirty();
11976 }
11977
11979 {
11981 }
11982
11983
11985 {
11986 return false;
11987 }
11988
11991 {
11992 string att_type = "None";
11993
11994 if (ConfigIsExisting("soundAttType"))
11995 {
11996 att_type = ConfigGetString("soundAttType");
11997 }
11998
12000 }
12001
12003 {
12005 }
12006
12007
12008
12009
12010
12014
12016 {
12019
12021 }
12022
12023
12025 {
12027 return;
12028
12030
12033
12036
12037 SoundParameters params = new SoundParameters();
12041 }
12042
12043
12045 {
12047 return;
12048
12050 SetSynchDirty();
12051
12054 }
12055
12056
12058 {
12060 return;
12061
12063 SetSynchDirty();
12064
12067 }
12068
12070 {
12072 }
12073
12075 {
12077 }
12078
12081 {
12082 if (!
GetGame().IsDedicatedServer())
12083 {
12084 if (ConfigIsExisting("attachSoundSet"))
12085 {
12086 string cfg_path = "";
12087 string soundset = "";
12088 string type_name =
GetType();
12089
12092 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12093 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12094
12095 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12096 {
12097 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12098 {
12099 if (cfg_slot_array[i] == slot_type)
12100 {
12101 soundset = cfg_soundset_array[i];
12102 break;
12103 }
12104 }
12105 }
12106
12107 if (soundset != "")
12108 {
12109 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12111 }
12112 }
12113 }
12114 }
12115
12117 {
12118
12119 }
12120
12121 void OnApply(PlayerBase player);
12122
12124 {
12125 return 1.0;
12126 };
12127
12129 {
12131 }
12132
12134 {
12136 }
12137
12139
12141 {
12142 SetDynamicPhysicsLifeTime(0.01);
12144 }
12145
12147 {
12148 array<string> zone_names = new array<string>;
12149 GetDamageZones(zone_names);
12150 for (int i = 0; i < zone_names.Count(); i++)
12151 {
12152 SetHealthMax(zone_names.Get(i),"Health");
12153 }
12154 SetHealthMax("","Health");
12155 }
12156
12159 {
12160 float global_health = GetHealth01("","Health");
12161 array<string> zones = new array<string>;
12162 GetDamageZones(zones);
12163
12164 for (int i = 0; i < zones.Count(); i++)
12165 {
12166 SetHealth01(zones.Get(i),"Health",global_health);
12167 }
12168 }
12169
12172 {
12173 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12174 }
12175
12177 {
12178 if (!hasRootAsPlayer)
12179 {
12180 if (refParentIB)
12181 {
12182
12183 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12184 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12185
12186 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12187 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12188
12191 }
12192 else
12193 {
12194
12197 }
12198 }
12199 }
12200
12202 {
12204 {
12205 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12206 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12207 {
12208 float heatPermCoef = 1.0;
12210 while (ent)
12211 {
12212 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12213 ent = ent.GetHierarchyParent();
12214 }
12215
12216 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12217 }
12218 }
12219 }
12220
12222 {
12223
12224 EntityAI parent = GetHierarchyParent();
12225 if (!parent)
12226 {
12227 hasParent = false;
12228 hasRootAsPlayer = false;
12229 }
12230 else
12231 {
12232 hasParent = true;
12233 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12234 refParentIB =
ItemBase.Cast(parent);
12235 }
12236 }
12237
12238 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12239 {
12240
12241 }
12242
12244 {
12245
12246 return false;
12247 }
12248
12250 {
12251
12252
12253 return false;
12254 }
12255
12257 {
12258
12259 return false;
12260 }
12261
12264 {
12265 return !GetIsFrozen() &&
IsOpen();
12266 }
12267
12269 {
12270 bool hasParent = false, hasRootAsPlayer = false;
12272
12273 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12274 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12275
12276 if (wwtu || foodDecay)
12277 {
12281
12282 if (processWetness || processTemperature || processDecay)
12283 {
12285
12286 if (processWetness)
12287 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12288
12289 if (processTemperature)
12291
12292 if (processDecay)
12293 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12294 }
12295 }
12296 }
12297
12300 {
12302 }
12303
12305 {
12308
12309 return super.GetTemperatureFreezeThreshold();
12310 }
12311
12313 {
12316
12317 return super.GetTemperatureThawThreshold();
12318 }
12319
12321 {
12324
12325 return super.GetItemOverheatThreshold();
12326 }
12327
12329 {
12331 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12332
12333 return super.GetTemperatureFreezeTime();
12334 }
12335
12337 {
12339 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12340
12341 return super.GetTemperatureThawTime();
12342 }
12343
12348
12350 {
12351 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12352 }
12353
12355 {
12356 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12357 }
12358
12361 {
12363 }
12364
12366 {
12368 }
12369
12371 {
12373 }
12374
12377 {
12378 return null;
12379 }
12380
12383 {
12384 return false;
12385 }
12386
12388 {
12390 {
12393 if (!trg)
12394 {
12396 explosive = this;
12397 }
12398
12399 explosive.PairRemote(trg);
12401
12402 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12403 trg.SetPersistentPairID(persistentID);
12404 explosive.SetPersistentPairID(persistentID);
12405
12406 return true;
12407 }
12408 return false;
12409 }
12410
12413 {
12414 float ret = 1.0;
12417 ret *= GetHealth01();
12418
12419 return ret;
12420 }
12421
12422 #ifdef DEVELOPER
12423 override void SetDebugItem()
12424 {
12425 super.SetDebugItem();
12426 _itemBase = this;
12427 }
12428
12430 {
12431 string text = super.GetDebugText();
12432
12434 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12435
12436 return text;
12437 }
12438 #endif
12439
12441 {
12442 return true;
12443 }
12444
12446
12448
12450 {
12453 }
12454
12455
12463
12479}
12480
12482{
12484 if (entity)
12485 {
12486 bool is_item = entity.IsInherited(
ItemBase);
12487 if (is_item && full_quantity)
12488 {
12491 }
12492 }
12493 else
12494 {
12496 return NULL;
12497 }
12498 return entity;
12499}
12500
12502{
12503 if (item)
12504 {
12505 if (health > 0)
12506 item.SetHealth("", "", health);
12507
12508 if (item.CanHaveTemperature())
12509 {
12511 if (item.CanFreeze())
12512 item.SetFrozen(false);
12513 }
12514
12515 if (item.HasEnergyManager())
12516 {
12517 if (quantity >= 0)
12518 {
12519 item.GetCompEM().SetEnergy0To1(quantity);
12520 }
12521 else
12522 {
12524 }
12525 }
12526 else if (item.IsMagazine())
12527 {
12528 Magazine mag = Magazine.Cast(item);
12529 if (quantity >= 0)
12530 {
12531 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12532 }
12533 else
12534 {
12536 }
12537
12538 }
12539 else
12540 {
12541 if (quantity >= 0)
12542 {
12543 item.SetQuantityNormalized(quantity, false);
12544 }
12545 else
12546 {
12548 }
12549
12550 }
12551 }
12552}
12553
12554#ifdef DEVELOPER
12556#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.