7809{
7811 {
7812 return true;
7813 }
7814};
7815
7816
7817
7819{
7823
7825
7828
7829
7830
7831
7832
7841
7847
7852
7857
7878 protected bool m_IsResultOfSplit
7879
7881
7886
7887
7888
7890
7894
7895
7896
7898
7901
7902
7903
7909
7910
7918
7921
7922
7924
7925
7927
7928
7933
7934
7939
7940
7942
7943
7945 {
7950
7951 if (!
GetGame().IsDedicatedServer())
7952 {
7954 {
7956
7958 {
7960 }
7961 }
7962
7965 }
7966
7967 m_OldLocation = null;
7968
7970 {
7972 }
7973
7974 if (ConfigIsExisting("headSelectionsToHide"))
7975 {
7978 }
7979
7981 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7982 {
7984 }
7985
7987
7988 m_IsResultOfSplit = false;
7989
7991 }
7992
7994 {
7995 super.InitItemVariables();
7996
8002 m_Count = ConfigGetInt(
"count");
8003
8006
8011
8014
8019
8031
8035
8036
8039 if (ConfigIsExisting("canBeSplit"))
8040 {
8043 }
8044
8046 if (ConfigIsExisting("itemBehaviour"))
8048
8049
8052 RegisterNetSyncVariableInt("m_VarLiquidType");
8053 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8054
8055 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8056 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8057 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8058
8059 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8060 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8061 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8062 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8063
8064 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8065 RegisterNetSyncVariableBool("m_IsTakeable");
8066 RegisterNetSyncVariableBool("m_IsHologram");
8067
8070 {
8073 }
8074
8076
8078 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8080
8081 }
8082
8084 {
8086 }
8087
8089 {
8092 {
8097 }
8098 }
8099
8100 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8101 {
8103 {
8106 }
8107
8109 }
8110
8112 {
8118 }
8119
8121
8123 {
8125
8126 if (!action)
8127 {
8128 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8129 return;
8130 }
8131
8133 if (!ai)
8134 {
8136 return;
8137 }
8138
8140 if (!action_array)
8141 {
8142 action_array = new array<ActionBase_Basic>;
8144 }
8145 if (LogManager.IsActionLogEnable())
8146 {
8147 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8148 }
8149
8150 if (action_array.Find(action) != -1)
8151 {
8152 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8153 }
8154 else
8155 {
8156 action_array.Insert(action);
8157 }
8158 }
8159
8161 {
8163 ActionBase action = player.GetActionManager().GetAction(actionName);
8166
8167 if (action_array)
8168 {
8169 action_array.RemoveItem(action);
8170 }
8171 }
8172
8173
8174
8176 {
8177 ActionOverrideData overrideData = new ActionOverrideData();
8181
8183 if (!actionMap)
8184 {
8187 }
8188
8189 actionMap.Insert(this.
Type(), overrideData);
8190
8191 }
8192
8194
8196
8197
8199 {
8202
8205
8206 string config_to_search = "CfgVehicles";
8207 string muzzle_owner_config;
8208
8210 {
8211 if (IsInherited(Weapon))
8212 config_to_search = "CfgWeapons";
8213
8214 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8215
8216 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8217
8219
8220 if (config_OnFire_subclass_count > 0)
8221 {
8222 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8223
8224 for (int i = 0; i < config_OnFire_subclass_count; i++)
8225 {
8226 string particle_class = "";
8228 string config_OnFire_entry = config_OnFire_class + particle_class;
8229 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8230 WPOF_array.Insert(WPOF);
8231 }
8232
8233
8235 }
8236 }
8237
8239 {
8240 config_to_search = "CfgWeapons";
8241 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8242
8243 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8244
8246
8247 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8248 {
8249 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8250
8251 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8252 {
8253 string particle_class2 = "";
8255 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8256 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8257 WPOBE_array.Insert(WPOBE);
8258 }
8259
8260
8262 }
8263 }
8264 }
8265
8266
8268 {
8271
8273 {
8274 string config_to_search = "CfgVehicles";
8275
8276 if (IsInherited(Weapon))
8277 config_to_search = "CfgWeapons";
8278
8279 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8280 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8281
8282 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8283 {
8284
8286
8288 {
8290 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8292 return;
8293 }
8294
8297
8298
8299
8301 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8302
8303 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8304 {
8305 string particle_class = "";
8307 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8309
8310 if (entry_type == CT_CLASS)
8311 {
8312 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8313 WPOOH_array.Insert(WPOF);
8314 }
8315 }
8316
8317
8319 }
8320 }
8321 }
8322
8324 {
8326 }
8327
8329 {
8331 {
8333
8336
8339
8340 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8341 }
8342 }
8343
8345 {
8347 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8348
8350 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8351
8353 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8354
8356 {
8358 }
8359 }
8360
8362 {
8364 }
8365
8367 {
8370 else
8372
8374 {
8377 }
8378 else
8379 {
8382
8385 }
8386
8388 }
8389
8391 {
8393 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8394 }
8395
8397 {
8399 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8401 }
8402
8404 {
8406 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8407 }
8408
8410 {
8413
8414 OverheatingParticle OP = new OverheatingParticle();
8419
8421 }
8422
8424 {
8427
8428 return -1;
8429 }
8430
8432 {
8434 {
8437
8438 for (int i = count; i > 0; --i)
8439 {
8440 int id = i - 1;
8443
8446
8447 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8448 {
8449 if (p)
8450 {
8453 }
8454 }
8455 }
8456 }
8457 }
8458
8460 {
8462 {
8464 {
8465 int id = i - 1;
8467
8468 if (OP)
8469 {
8471
8472 if (p)
8473 {
8475 }
8476
8477 delete OP;
8478 }
8479 }
8480
8483 }
8484 }
8485
8488 {
8489 return 0.0;
8490 }
8491
8492
8494 {
8495 return 250;
8496 }
8497
8499 {
8500 return 0;
8501 }
8502
8505 {
8507 return true;
8508
8509 return false;
8510 }
8511
8514 {
8517
8519 {
8521 }
8522 else
8523 {
8524
8526 }
8527
8529 }
8530
8537 {
8538 return -1;
8539 }
8540
8541
8542
8543
8545 {
8547 {
8549 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8550
8551 if (r_index >= 0)
8552 {
8553 InventoryLocation r_il = new InventoryLocation;
8554 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8555
8556 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8559 {
8560 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8561 }
8563 {
8564 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8565 }
8566
8567 }
8568
8569 player.GetHumanInventory().ClearUserReservedLocation(this);
8570 }
8571
8574 }
8575
8576
8577
8578
8580 {
8581 return ItemBase.m_DebugActionsMask;
8582 }
8583
8585 {
8586 return ItemBase.m_DebugActionsMask & mask;
8587 }
8588
8590 {
8591 ItemBase.m_DebugActionsMask = mask;
8592 }
8593
8595 {
8596 ItemBase.m_DebugActionsMask |= mask;
8597 }
8598
8600 {
8601 ItemBase.m_DebugActionsMask &= ~mask;
8602 }
8603
8605 {
8607 {
8609 }
8610 else
8611 {
8613 }
8614 }
8615
8616
8618 {
8619 if (GetEconomyProfile())
8620 {
8621 float q_max = GetEconomyProfile().GetQuantityMax();
8622 if (q_max > 0)
8623 {
8624 float q_min = GetEconomyProfile().GetQuantityMin();
8625 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8626
8628 {
8629 ComponentEnergyManager comp = GetCompEM();
8631 {
8633 }
8634 }
8636 {
8638
8639 }
8640
8641 }
8642 }
8643 }
8644
8647 {
8648 EntityAI parent = GetHierarchyParent();
8649
8650 if (parent)
8651 {
8652 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8653 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8654 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8655 }
8656 }
8657
8660 {
8661 EntityAI parent = GetHierarchyParent();
8662
8663 if (parent)
8664 {
8665 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8666 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8667 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8668 }
8669 }
8670
8672 {
8673
8674
8675
8676
8678
8680 {
8681 if (ScriptInputUserData.CanStoreInputUserData())
8682 {
8683 ScriptInputUserData ctx = new ScriptInputUserData;
8689 ctx.
Write(use_stack_max);
8692
8694 {
8695 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8696 }
8697 }
8698 }
8699 else if (!
GetGame().IsMultiplayer())
8700 {
8702 }
8703 }
8704
8706 {
8708 }
8709
8711 {
8713 }
8714
8716 {
8718 }
8719
8721 {
8722
8723 return false;
8724 }
8725
8727 {
8728 return false;
8729 }
8730
8734 {
8735 return false;
8736 }
8737
8739 {
8740 return "";
8741 }
8742
8744
8746 {
8747 return false;
8748 }
8749
8751 {
8752 return true;
8753 }
8754
8755
8756
8758 {
8759 return true;
8760 }
8761
8763 {
8764 return true;
8765 }
8766
8768 {
8769 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8771 }
8772
8774 {
8776 }
8777
8779 {
8781 if (!is_being_placed)
8783 SetSynchDirty();
8784 }
8785
8786
8788
8790 {
8792 }
8793
8795 {
8797 }
8798
8800 {
8801 return 1;
8802 }
8803
8805 {
8806 return false;
8807 }
8808
8810 {
8812 SetSynchDirty();
8813 }
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8850 {
8851 super.OnMovedInsideCargo(container);
8852
8853 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8854 }
8855
8856 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8857 {
8858 super.EEItemLocationChanged(oldLoc,newLoc);
8859
8860 PlayerBase new_player = null;
8861 PlayerBase old_player = null;
8862
8863 if (newLoc.GetParent())
8864 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8865
8866 if (oldLoc.GetParent())
8867 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8868
8870 {
8871 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8872
8873 if (r_index >= 0)
8874 {
8875 InventoryLocation r_il = new InventoryLocation;
8876 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8877
8878 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8881 {
8882 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8883 }
8885 {
8886 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8887 }
8888
8889 }
8890 }
8891
8893 {
8894 if (new_player)
8895 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8896
8897 if (new_player == old_player)
8898 {
8899
8900 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8901 {
8903 {
8904 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8905 {
8906 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8907 }
8908 }
8909 else
8910 {
8911 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8912 }
8913 }
8914
8915 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8916 {
8917 int type = oldLoc.GetType();
8919 {
8920 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8921 }
8923 {
8924 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8925 }
8926 }
8927 if (!m_OldLocation)
8928 {
8929 m_OldLocation = new InventoryLocation;
8930 }
8931 m_OldLocation.Copy(oldLoc);
8932 }
8933 else
8934 {
8935 if (m_OldLocation)
8936 {
8937 m_OldLocation.Reset();
8938 }
8939 }
8940
8942 }
8943 else
8944 {
8945 if (new_player)
8946 {
8947 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8948 if (res_index >= 0)
8949 {
8950 InventoryLocation il = new InventoryLocation;
8951 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8953 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8956 {
8957 il.
GetParent().GetOnReleaseLock().Invoke(it);
8958 }
8960 {
8962 }
8963
8964 }
8965 }
8967 {
8968
8970 }
8971
8972 if (m_OldLocation)
8973 {
8974 m_OldLocation.Reset();
8975 }
8976 }
8977 }
8978
8979 override void EOnContact(IEntity other, Contact extra)
8980 {
8982 {
8983 int liquidType = -1;
8985 if (impactSpeed > 0.0)
8986 {
8988 #ifndef SERVER
8990 #else
8992 SetSynchDirty();
8993 #endif
8995 }
8996 }
8997
8998 #ifdef SERVER
8999 if (GetCompEM() && GetCompEM().IsPlugged())
9000 {
9001 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9002 GetCompEM().UnplugThis();
9003 }
9004 #endif
9005 }
9006
9008
9010 {
9012 }
9013
9015 {
9016
9017 }
9018
9020 {
9021 super.OnItemLocationChanged(old_owner, new_owner);
9022
9023 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9024 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9025
9026 if (!relatedPlayer && playerNew)
9027 relatedPlayer = playerNew;
9028
9029 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9030 {
9032 if (actionMgr)
9033 {
9034 ActionBase currentAction = actionMgr.GetRunningAction();
9035 if (currentAction)
9037 }
9038 }
9039
9040 Man ownerPlayerOld = null;
9041 Man ownerPlayerNew = null;
9042
9043 if (old_owner)
9044 {
9045 if (old_owner.
IsMan())
9046 {
9047 ownerPlayerOld = Man.Cast(old_owner);
9048 }
9049 else
9050 {
9051 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9052 }
9053 }
9054 else
9055 {
9057 {
9059
9060 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9061 {
9062 GetCompEM().UnplugThis();
9063 }
9064 }
9065 }
9066
9067 if (new_owner)
9068 {
9069 if (new_owner.
IsMan())
9070 {
9071 ownerPlayerNew = Man.Cast(new_owner);
9072 }
9073 else
9074 {
9075 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9076 }
9077 }
9078
9079 if (ownerPlayerOld != ownerPlayerNew)
9080 {
9081 if (ownerPlayerOld)
9082 {
9083 array<EntityAI> subItemsExit = new array<EntityAI>;
9085 for (int i = 0; i < subItemsExit.Count(); i++)
9086 {
9089 }
9090 }
9091
9092 if (ownerPlayerNew)
9093 {
9094 array<EntityAI> subItemsEnter = new array<EntityAI>;
9096 for (int j = 0; j < subItemsEnter.Count(); j++)
9097 {
9100 }
9101 }
9102 }
9103 else if (ownerPlayerNew != null)
9104 {
9105 PlayerBase nplayer;
9106 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9107 {
9108 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9110 for (int k = 0; k < subItemsUpdate.Count(); k++)
9111 {
9113 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9114 }
9115 }
9116 }
9117
9118 if (old_owner)
9119 old_owner.OnChildItemRemoved(this);
9120 if (new_owner)
9121 new_owner.OnChildItemReceived(this);
9122 }
9123
9124
9126 {
9127 super.EEDelete(parent);
9128 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9129 if (player)
9130 {
9132
9133 if (player.IsAlive())
9134 {
9135 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9136 if (r_index >= 0)
9137 {
9138 InventoryLocation r_il = new InventoryLocation;
9139 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9140
9141 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9144 {
9145 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9146 }
9148 {
9149 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9150 }
9151
9152 }
9153
9154 player.RemoveQuickBarEntityShortcut(this);
9155 }
9156 }
9157 }
9158
9160 {
9161 super.EEKilled(killer);
9162
9165 {
9166 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9167 {
9168 if (IsMagazine())
9169 {
9170 if (Magazine.Cast(this).GetAmmoCount() > 0)
9171 {
9173 }
9174 }
9175 else
9176 {
9178 }
9179 }
9180 }
9181 }
9182
9184 {
9185 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9186
9187 super.OnWasAttached(parent, slot_id);
9188
9191
9193 }
9194
9196 {
9197 super.OnWasDetached(parent, slot_id);
9198
9201 }
9202
9204 {
9205 int idx;
9208
9209 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9210 if (inventory_slots.Count() < 1)
9211 {
9212 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9213 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9214 }
9215 else
9216 {
9217 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9218 }
9219
9220 idx = inventory_slots.Find(slot);
9221 if (idx < 0)
9222 return "";
9223
9224 return attach_types.Get(idx);
9225 }
9226
9228 {
9229 int idx = -1;
9230 string slot;
9231
9234
9235 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9236 if (inventory_slots.Count() < 1)
9237 {
9238 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9239 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9240 }
9241 else
9242 {
9243 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9244 if (detach_types.Count() < 1)
9245 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9246 }
9247
9248 for (int i = 0; i < inventory_slots.Count(); i++)
9249 {
9250 slot = inventory_slots.Get(i);
9251 }
9252
9253 if (slot != "")
9254 {
9255 if (detach_types.Count() == 1)
9256 idx = 0;
9257 else
9258 idx = inventory_slots.Find(slot);
9259 }
9260 if (idx < 0)
9261 return "";
9262
9263 return detach_types.Get(idx);
9264 }
9265
9267 {
9268
9270
9271
9272 float min_time = 1;
9273 float max_time = 3;
9274 float delay = Math.RandomFloat(min_time, max_time);
9275
9276 explode_timer.Run(delay, this, "DoAmmoExplosion");
9277 }
9278
9280 {
9281 Magazine magazine = Magazine.Cast(this);
9282 int pop_sounds_count = 6;
9283 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9284
9285
9286 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9287 string sound_name = pop_sounds[ sound_idx ];
9289
9290
9291 magazine.ServerAddAmmoCount(-1);
9292
9293
9294 float min_temp_to_explode = 100;
9295
9296 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9297 {
9299 }
9300 }
9301
9302
9303 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9304 {
9305 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9306
9307 const int CHANCE_DAMAGE_CARGO = 4;
9308 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9309 const int CHANCE_DAMAGE_NOTHING = 2;
9310
9312 {
9313 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9314 int chances;
9315 int rnd;
9316
9317 if (GetInventory().GetCargo())
9318 {
9319 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9320 rnd = Math.RandomInt(0,chances);
9321
9322 if (rnd < CHANCE_DAMAGE_CARGO)
9323 {
9325 }
9326 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9327 {
9329 }
9330 }
9331 else
9332 {
9333 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9334 rnd = Math.RandomInt(0,chances);
9335
9336 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9337 {
9339 }
9340 }
9341 }
9342 }
9343
9345 {
9346 if (GetInventory().GetCargo())
9347 {
9348 int item_count = GetInventory().GetCargo().GetItemCount();
9349 if (item_count > 0)
9350 {
9351 int random_pick = Math.RandomInt(0, item_count);
9353 if (!item.IsExplosive())
9354 {
9355 item.AddHealth("","",damage);
9356 return true;
9357 }
9358 }
9359 }
9360 return false;
9361 }
9362
9364 {
9365 int attachment_count = GetInventory().AttachmentCount();
9366 if (attachment_count > 0)
9367 {
9368 int random_pick = Math.RandomInt(0, attachment_count);
9369 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9370 if (!attachment.IsExplosive())
9371 {
9372 attachment.AddHealth("","",damage);
9373 return true;
9374 }
9375 }
9376 return false;
9377 }
9378
9380 {
9382 }
9383
9385 {
9387 return GetInventory().CanRemoveEntity();
9388
9389 return false;
9390 }
9391
9393 {
9394
9396 return false;
9397
9398
9400 return false;
9401
9402
9403
9405 if (delta == 0)
9406 return false;
9407
9408
9409 return true;
9410 }
9411
9413 {
9415 {
9416 if (ScriptInputUserData.CanStoreInputUserData())
9417 {
9418 ScriptInputUserData ctx = new ScriptInputUserData;
9423 ctx.
Write(destination_entity);
9427 }
9428 }
9429 else if (!
GetGame().IsMultiplayer())
9430 {
9432 }
9433 }
9434
9436 {
9437 float split_quantity_new;
9441 InventoryLocation loc = new InventoryLocation;
9442
9443 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9444 {
9446 split_quantity_new = stack_max;
9447 else
9449
9451 {
9452 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9453 if (new_item)
9454 {
9455 new_item.SetResultOfSplit(true);
9456 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9458 new_item.
SetQuantity(split_quantity_new,
false,
true);
9459 }
9460 }
9461 }
9462 else if (destination_entity && slot_id == -1)
9463 {
9464 if (quantity > stack_max)
9465 split_quantity_new = stack_max;
9466 else
9467 split_quantity_new = quantity;
9468
9470 {
9472 {
9475 }
9476
9477 if (new_item)
9478 {
9479 new_item.SetResultOfSplit(true);
9480 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9482 new_item.
SetQuantity(split_quantity_new,
false,
true);
9483 }
9484 }
9485 }
9486 else
9487 {
9488 if (stack_max != 0)
9489 {
9491 {
9493 }
9494
9495 if (split_quantity_new == 0)
9496 {
9497 if (!
GetGame().IsMultiplayer())
9498 player.PhysicalPredictiveDropItem(this);
9499 else
9500 player.ServerDropEntity(this);
9501 return;
9502 }
9503
9505 {
9507
9508 if (new_item)
9509 {
9510 new_item.SetResultOfSplit(true);
9511 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9514 new_item.PlaceOnSurface();
9515 }
9516 }
9517 }
9518 }
9519 }
9520
9522 {
9523 float split_quantity_new;
9527 InventoryLocation loc = new InventoryLocation;
9528
9529 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9530 {
9532 split_quantity_new = stack_max;
9533 else
9535
9537 {
9538 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9539 if (new_item)
9540 {
9541 new_item.SetResultOfSplit(true);
9542 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9544 new_item.
SetQuantity(split_quantity_new,
false,
true);
9545 }
9546 }
9547 }
9548 else if (destination_entity && slot_id == -1)
9549 {
9550 if (quantity > stack_max)
9551 split_quantity_new = stack_max;
9552 else
9553 split_quantity_new = quantity;
9554
9556 {
9558 {
9561 }
9562
9563 if (new_item)
9564 {
9565 new_item.SetResultOfSplit(true);
9566 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9568 new_item.
SetQuantity(split_quantity_new,
false,
true);
9569 }
9570 }
9571 }
9572 else
9573 {
9574 if (stack_max != 0)
9575 {
9577 {
9579 }
9580
9582 {
9584
9585 if (new_item)
9586 {
9587 new_item.SetResultOfSplit(true);
9588 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9591 new_item.PlaceOnSurface();
9592 }
9593 }
9594 }
9595 }
9596 }
9597
9599 {
9601 {
9602 if (ScriptInputUserData.CanStoreInputUserData())
9603 {
9604 ScriptInputUserData ctx = new ScriptInputUserData;
9609 dst.WriteToContext(ctx);
9611 }
9612 }
9613 else if (!
GetGame().IsMultiplayer())
9614 {
9616 }
9617 }
9618
9620 {
9622 {
9623 if (ScriptInputUserData.CanStoreInputUserData())
9624 {
9625 ScriptInputUserData ctx = new ScriptInputUserData;
9630 ctx.
Write(destination_entity);
9636 }
9637 }
9638 else if (!
GetGame().IsMultiplayer())
9639 {
9641 }
9642 }
9643
9645 {
9647 }
9648
9650 {
9652 float split_quantity_new;
9654 if (dst.IsValid())
9655 {
9656 int slot_id = dst.GetSlot();
9658
9659 if (quantity > stack_max)
9660 split_quantity_new = stack_max;
9661 else
9662 split_quantity_new = quantity;
9663
9665 {
9667
9668 if (new_item)
9669 {
9670 new_item.SetResultOfSplit(true);
9671 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9673 new_item.
SetQuantity(split_quantity_new,
false,
true);
9674 }
9675
9676 return new_item;
9677 }
9678 }
9679
9680 return null;
9681 }
9682
9684 {
9686 float split_quantity_new;
9688 if (destination_entity)
9689 {
9691 if (quantity > stackable)
9692 split_quantity_new = stackable;
9693 else
9694 split_quantity_new = quantity;
9695
9697 {
9698 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9699 if (new_item)
9700 {
9701 new_item.SetResultOfSplit(true);
9702 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9704 new_item.
SetQuantity(split_quantity_new,
false,
true);
9705 }
9706 }
9707 }
9708 }
9709
9711 {
9713 {
9714 if (ScriptInputUserData.CanStoreInputUserData())
9715 {
9716 ScriptInputUserData ctx = new ScriptInputUserData;
9721 ItemBase destination_entity =
this;
9722 ctx.
Write(destination_entity);
9726 }
9727 }
9728 else if (!
GetGame().IsMultiplayer())
9729 {
9731 }
9732 }
9733
9735 {
9737 float split_quantity_new;
9739 if (player)
9740 {
9742 if (quantity > stackable)
9743 split_quantity_new = stackable;
9744 else
9745 split_quantity_new = quantity;
9746
9748 {
9749 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9750 new_item =
ItemBase.Cast(in_hands);
9751 if (new_item)
9752 {
9753 new_item.SetResultOfSplit(true);
9754 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9756 new_item.SetQuantity(split_quantity_new, false, true);
9757 }
9758 }
9759 }
9760 }
9761
9763 {
9765 float split_quantity_new = Math.Floor(quantity * 0.5);
9766
9768 return;
9769
9771
9772 if (new_item)
9773 {
9774 if (new_item.GetQuantityMax() < split_quantity_new)
9775 {
9776 split_quantity_new = new_item.GetQuantityMax();
9777 }
9778
9779 new_item.SetResultOfSplit(true);
9780 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9781
9783 {
9786 }
9787 else
9788 {
9790 new_item.
SetQuantity(split_quantity_new,
false,
true);
9791 }
9792 }
9793 }
9794
9796 {
9798 float split_quantity_new = Math.Floor(quantity / 2);
9799
9801 return;
9802
9803 InventoryLocation invloc = new InventoryLocation;
9805
9807 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9808
9809 if (new_item)
9810 {
9811 if (new_item.GetQuantityMax() < split_quantity_new)
9812 {
9813 split_quantity_new = new_item.GetQuantityMax();
9814 }
9816 {
9819 }
9820 else if (split_quantity_new > 1)
9821 {
9823 new_item.
SetQuantity(split_quantity_new,
false,
true);
9824 }
9825 }
9826 }
9827
9830 {
9831 SetWeightDirty();
9833
9834 if (parent)
9835 parent.OnAttachmentQuantityChangedEx(this, delta);
9836
9838 {
9840 {
9842 }
9844 {
9845 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9847 }
9848 }
9849
9850 }
9851
9854 {
9855
9856 }
9857
9860 {
9862 }
9863
9865 {
9866 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9867
9869 {
9870 if (newLevel == GameConstants.STATE_RUINED)
9871 {
9873 EntityAI parent = GetHierarchyParent();
9874 if (parent && parent.IsFireplace())
9875 {
9876 CargoBase cargo = GetInventory().GetCargo();
9877 if (cargo)
9878 {
9880 {
9882 }
9883 }
9884 }
9885 }
9886
9888 {
9889
9891 return;
9892 }
9893
9894 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9895 {
9897 }
9898 }
9899 }
9900
9901
9903 {
9904 super.OnRightClick();
9905
9907 {
9909 {
9910 if (ScriptInputUserData.CanStoreInputUserData())
9911 {
9912 EntityAI root = GetHierarchyRoot();
9913 Man playerOwner = GetHierarchyRootPlayer();
9914 InventoryLocation dst = new InventoryLocation;
9915
9916
9917 if (!playerOwner && root && root == this)
9918 {
9920 }
9921 else
9922 {
9923
9924 GetInventory().GetCurrentInventoryLocation(dst);
9926 {
9929 {
9931 }
9932 else
9933 {
9935
9936
9937 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9938 {
9940 }
9941 else
9942 {
9943 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9944 }
9945 }
9946 }
9947 }
9948
9949 ScriptInputUserData ctx = new ScriptInputUserData;
9957 }
9958 }
9959 else if (!
GetGame().IsMultiplayer())
9960 {
9962 }
9963 }
9964 }
9965
9967 {
9968 if (root)
9969 {
9970 vector m4[4];
9971 root.GetTransform(m4);
9972 dst.SetGround(this, m4);
9973 }
9974 else
9975 {
9976 GetInventory().GetCurrentInventoryLocation(dst);
9977 }
9978 }
9979
9980 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9981 {
9982
9983 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9984 return false;
9985
9986 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9987 return false;
9988
9989
9991 return false;
9992
9993
9994 Magazine mag = Magazine.Cast(this);
9995 if (mag)
9996 {
9997 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9998 return false;
9999
10000 if (stack_max_limit)
10001 {
10002 Magazine other_mag = Magazine.Cast(other_item);
10003 if (other_item)
10004 {
10005 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10006 return false;
10007 }
10008
10009 }
10010 }
10011 else
10012 {
10013
10015 return false;
10016
10018 return false;
10019 }
10020
10021 PlayerBase player = null;
10022 if (CastTo(player, GetHierarchyRootPlayer()))
10023 {
10024 if (player.GetInventory().HasAttachment(this))
10025 return false;
10026
10027 if (player.IsItemsToDelete())
10028 return false;
10029 }
10030
10031 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10032 return false;
10033
10034 int slotID;
10036 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10037 return false;
10038
10039 return true;
10040 }
10041
10043 {
10045 }
10046
10048 {
10049 return m_IsResultOfSplit;
10050 }
10051
10053 {
10054 m_IsResultOfSplit = value;
10055 }
10056
10058 {
10060 }
10061
10063 {
10064 float other_item_quantity = other_item.GetQuantity();
10065 float this_free_space;
10066
10068
10070
10071 if (other_item_quantity > this_free_space)
10072 {
10073 return this_free_space;
10074 }
10075 else
10076 {
10077 return other_item_quantity;
10078 }
10079 }
10080
10082 {
10084 }
10085
10087 {
10089 return;
10090
10091 if (!IsMagazine() && other_item)
10092 {
10094 if (quantity_used != 0)
10095 {
10096 float hp1 = GetHealth01("","");
10097 float hp2 = other_item.GetHealth01("","");
10098 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10099 hpResult = hpResult / (
GetQuantity() + quantity_used);
10100
10101 hpResult *= GetMaxHealth();
10102 Math.Round(hpResult);
10103 SetHealth("", "Health", hpResult);
10104
10106 other_item.AddQuantity(-quantity_used);
10107 }
10108 }
10110 }
10111
10113 {
10114 #ifdef SERVER
10115 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10116 GetHierarchyParent().IncreaseLifetimeUp();
10117 #endif
10118 };
10119
10121 {
10122 PlayerBase p = PlayerBase.Cast(player);
10123
10124 array<int> recipesIds = p.m_Recipes;
10125 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10126 if (moduleRecipesManager)
10127 {
10128 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10129 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10130 }
10131
10132 for (int i = 0;i < recipesIds.Count(); i++)
10133 {
10134 int key = recipesIds.Get(i);
10135 string recipeName = moduleRecipesManager.GetRecipeName(key);
10137 }
10138 }
10139
10140
10141 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10142 {
10143 super.GetDebugActions(outputList);
10144
10145
10151
10152
10157
10162
10163
10167
10168
10170 {
10174 }
10175
10178
10179
10183
10185
10186 InventoryLocation loc = new InventoryLocation();
10187 GetInventory().GetCurrentInventoryLocation(loc);
10189 {
10190 if (Gizmo_IsSupported())
10193 }
10194
10196 }
10197
10198
10199
10200
10202 {
10203 super.OnAction(action_id, player, ctx);
10204
10206 {
10207 switch (action_id)
10208 {
10211 return true;
10214 return true;
10215 }
10216 }
10217
10219 {
10220 switch (action_id)
10221 {
10223 Delete();
10224 return true;
10225 }
10226 }
10227
10228 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10229 {
10230 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10231 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10232 PlayerBase p = PlayerBase.Cast(player);
10233 if (
EActions.RECIPES_RANGE_START < 1000)
10234 {
10235 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10236 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10237 }
10238 }
10239 #ifndef SERVER
10240 else if (action_id ==
EActions.WATCH_PLAYER)
10241 {
10242 PluginDeveloper.SetDeveloperItemClientEx(player);
10243 }
10244 #endif
10246 {
10247 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10248 {
10249 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10250 OnDebugButtonPressServer(id + 1);
10251 }
10252
10253 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10254 {
10255 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10257 }
10258
10259 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10260 {
10261 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10263 }
10264
10265 else if (action_id ==
EActions.ADD_QUANTITY)
10266 {
10267 if (IsMagazine())
10268 {
10269 Magazine mag = Magazine.Cast(this);
10270 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10271 }
10272 else
10273 {
10275 }
10276
10277 if (m_EM)
10278 {
10279 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10280 }
10281
10282 }
10283
10284 else if (action_id ==
EActions.REMOVE_QUANTITY)
10285 {
10286 if (IsMagazine())
10287 {
10288 Magazine mag2 = Magazine.Cast(this);
10289 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10290 }
10291 else
10292 {
10294 }
10295 if (m_EM)
10296 {
10297 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10298 }
10299
10300 }
10301
10302 else if (action_id ==
EActions.SET_QUANTITY_0)
10303 {
10305
10306 if (m_EM)
10307 {
10308 m_EM.SetEnergy(0);
10309 }
10310 }
10311
10312 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10313 {
10315
10316 if (m_EM)
10317 {
10318 m_EM.SetEnergy(m_EM.GetEnergyMax());
10319 }
10320 }
10321
10322 else if (action_id ==
EActions.ADD_HEALTH)
10323 {
10324 AddHealth("","",GetMaxHealth("","Health")/5);
10325 }
10326 else if (action_id ==
EActions.REMOVE_HEALTH)
10327 {
10328 AddHealth("","",-GetMaxHealth("","Health")/5);
10329 }
10330 else if (action_id ==
EActions.DESTROY_HEALTH)
10331 {
10332 SetHealth01("","",0);
10333 }
10334 else if (action_id ==
EActions.WATCH_ITEM)
10335 {
10337 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10338 #ifdef DEVELOPER
10339 SetDebugDeveloper_item(this);
10340 #endif
10341 }
10342
10343 else if (action_id ==
EActions.ADD_TEMPERATURE)
10344 {
10345 AddTemperature(20);
10346
10347 }
10348
10349 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10350 {
10351 AddTemperature(-20);
10352
10353 }
10354
10355 else if (action_id ==
EActions.FLIP_FROZEN)
10356 {
10357 SetFrozen(!GetIsFrozen());
10358
10359 }
10360
10361 else if (action_id ==
EActions.ADD_WETNESS)
10362 {
10364
10365 }
10366
10367 else if (action_id ==
EActions.REMOVE_WETNESS)
10368 {
10370
10371 }
10372
10373 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10374 {
10377
10378
10379 }
10380
10381 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10382 {
10385 }
10386
10387 else if (action_id ==
EActions.MAKE_SPECIAL)
10388 {
10389 auto debugParams = DebugSpawnParams.WithPlayer(player);
10390 OnDebugSpawnEx(debugParams);
10391 }
10392
10393 }
10394
10395
10396 return false;
10397 }
10398
10399
10400
10401
10405
10408
10409
10410
10412 {
10413 return false;
10414 }
10415
10416
10418 {
10419 return true;
10420 }
10421
10422
10424 {
10425 return true;
10426 }
10427
10428
10429
10431 {
10432 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10434 }
10435
10438 {
10439 return null;
10440 }
10441
10443 {
10444 return false;
10445 }
10446
10448 {
10449 return false;
10450 }
10451
10455
10456
10458 {
10459 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10460 return module_repairing.CanRepair(this, item_repair_kit);
10461 }
10462
10463
10464 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10465 {
10466 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10467 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10468 }
10469
10470
10472 {
10473
10474
10475
10476
10477
10478
10479
10480
10481 return 1;
10482 }
10483
10484
10485
10487 {
10489 }
10490
10491
10492
10494 {
10496 }
10497
10498
10507 {
10508 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10509
10510 if (player)
10511 {
10512 player.MessageStatus(text);
10513 }
10514 }
10515
10516
10525 {
10526 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10527
10528 if (player)
10529 {
10530 player.MessageAction(text);
10531 }
10532 }
10533
10534
10543 {
10544 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10545
10546 if (player)
10547 {
10548 player.MessageFriendly(text);
10549 }
10550 }
10551
10552
10561 {
10562 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10563
10564 if (player)
10565 {
10566 player.MessageImportant(text);
10567 }
10568 }
10569
10571 {
10572 return true;
10573 }
10574
10575
10576 override bool KindOf(
string tag)
10577 {
10578 bool found = false;
10579 string item_name = this.
GetType();
10582
10583 int array_size = item_tag_array.Count();
10584 for (int i = 0; i < array_size; i++)
10585 {
10586 if (item_tag_array.Get(i) == tag)
10587 {
10588 found = true;
10589 break;
10590 }
10591 }
10592 return found;
10593 }
10594
10595
10597 {
10598
10599 super.OnRPC(sender, rpc_type,ctx);
10600
10601
10602 switch (rpc_type)
10603 {
10604 #ifndef SERVER
10605 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10606 Param2<bool, string> p = new Param2<bool, string>(false, "");
10607
10609 return;
10610
10611 bool play = p.param1;
10612 string soundSet = p.param2;
10613
10614 if (play)
10615 {
10617 {
10619 {
10621 }
10622 }
10623 else
10624 {
10626 }
10627 }
10628 else
10629 {
10631 }
10632
10633 break;
10634 #endif
10635
10636 }
10637
10639 {
10641 }
10642 }
10643
10644
10645
10646
10648 {
10649 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10650 return plugin.GetID(
name);
10651 }
10652
10654 {
10655 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10656 return plugin.GetName(id);
10657 }
10658
10661 {
10662
10663
10664 int varFlags;
10665 if (!ctx.
Read(varFlags))
10666 return;
10667
10668 if (varFlags & ItemVariableFlags.FLOAT)
10669 {
10671 }
10672 }
10673
10675 {
10676
10677 super.SerializeNumericalVars(floats_out);
10678
10679
10680
10682 {
10684 }
10685
10687 {
10689 }
10690
10692 {
10694 }
10695
10697 {
10702 }
10703
10705 {
10707 }
10708 }
10709
10711 {
10712
10713 super.DeSerializeNumericalVars(floats);
10714
10715
10716 int index = 0;
10717 int mask = Math.Round(floats.Get(index));
10718
10719 index++;
10720
10722 {
10724 {
10726 }
10727 else
10728 {
10729 float quantity = floats.Get(index);
10730 SetQuantity(quantity,
true,
false,
false,
false);
10731 }
10732 index++;
10733 }
10734
10736 {
10737 float wet = floats.Get(index);
10739 index++;
10740 }
10741
10743 {
10744 int liquidtype = Math.Round(floats.Get(index));
10746 index++;
10747 }
10748
10750 {
10752 index++;
10754 index++;
10756 index++;
10758 index++;
10759 }
10760
10762 {
10763 int cleanness = Math.Round(floats.Get(index));
10765 index++;
10766 }
10767 }
10768
10770 {
10771 super.WriteVarsToCTX(ctx);
10772
10773
10775 {
10777 }
10778
10780 {
10782 }
10783
10785 {
10787 }
10788
10790 {
10791 int r,g,b,a;
10797 }
10798
10800 {
10802 }
10803 }
10804
10806 {
10807 if (!super.ReadVarsFromCTX(ctx,version))
10808 return false;
10809
10810 int intValue;
10811 float value;
10812
10813 if (version < 140)
10814 {
10815 if (!ctx.
Read(intValue))
10816 return false;
10817
10818 m_VariablesMask = intValue;
10819 }
10820
10822 {
10823 if (!ctx.
Read(value))
10824 return false;
10825
10827 {
10829 }
10830 else
10831 {
10833 }
10834 }
10835
10836 if (version < 140)
10837 {
10839 {
10840 if (!ctx.
Read(value))
10841 return false;
10842 SetTemperatureDirect(value);
10843 }
10844 }
10845
10847 {
10848 if (!ctx.
Read(value))
10849 return false;
10851 }
10852
10854 {
10855 if (!ctx.
Read(intValue))
10856 return false;
10858 }
10859
10861 {
10862 int r,g,b,a;
10864 return false;
10866 return false;
10868 return false;
10870 return false;
10871
10873 }
10874
10876 {
10877 if (!ctx.
Read(intValue))
10878 return false;
10880 }
10881
10882 if (version >= 138 && version < 140)
10883 {
10885 {
10886 if (!ctx.
Read(intValue))
10887 return false;
10888 SetFrozen(intValue);
10889 }
10890 }
10891
10892 return true;
10893 }
10894
10895
10897 {
10900 {
10902 }
10903
10904 if (!super.OnStoreLoad(ctx, version))
10905 {
10907 return false;
10908 }
10909
10910 if (version >= 114)
10911 {
10912 bool hasQuickBarIndexSaved;
10913
10914 if (!ctx.
Read(hasQuickBarIndexSaved))
10915 {
10917 return false;
10918 }
10919
10920 if (hasQuickBarIndexSaved)
10921 {
10922 int itmQBIndex;
10923
10924
10925 if (!ctx.
Read(itmQBIndex))
10926 {
10928 return false;
10929 }
10930
10931 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10932 if (itmQBIndex != -1 && parentPlayer)
10933 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10934 }
10935 }
10936 else
10937 {
10938
10939 PlayerBase player;
10940 int itemQBIndex;
10941 if (version ==
int.
MAX)
10942 {
10943 if (!ctx.
Read(itemQBIndex))
10944 {
10946 return false;
10947 }
10948 }
10949 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10950 {
10951
10952 if (!ctx.
Read(itemQBIndex))
10953 {
10955 return false;
10956 }
10957 if (itemQBIndex != -1 && player)
10958 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10959 }
10960 }
10961
10962 if (version < 140)
10963 {
10964
10965 if (!LoadVariables(ctx, version))
10966 {
10968 return false;
10969 }
10970 }
10971
10972
10974 {
10976 return false;
10977 }
10978 if (version >= 132)
10979 {
10981 if (raib)
10982 {
10984 {
10986 return false;
10987 }
10988 }
10989 }
10990
10992 return true;
10993 }
10994
10995
10996
10998 {
10999 super.OnStoreSave(ctx);
11000
11001 PlayerBase player;
11002 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11003 {
11005
11006 int itemQBIndex = -1;
11007 itemQBIndex = player.FindQuickBarEntityIndex(this);
11008 ctx.
Write(itemQBIndex);
11009 }
11010 else
11011 {
11013 }
11014
11016
11018 if (raib)
11019 {
11021 }
11022 }
11023
11024
11026 {
11027 super.AfterStoreLoad();
11028
11030 {
11032 }
11033
11035 {
11038 }
11039 }
11040
11042 {
11043 super.EEOnAfterLoad();
11044
11046 {
11048 }
11049
11052 }
11053
11055 {
11056 return false;
11057 }
11058
11059
11060
11062 {
11064 {
11065 #ifdef PLATFORM_CONSOLE
11066
11068 {
11070 if (menu)
11071 {
11073 }
11074 }
11075 #endif
11076 }
11077
11079 {
11082 }
11083
11085 {
11086 SetWeightDirty();
11088 }
11090 {
11093 }
11094
11096 {
11099 }
11101 {
11104 }
11105
11106 super.OnVariablesSynchronized();
11107 }
11108
11109
11110
11112 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11113 {
11114 if (!IsServerCheck(allow_client))
11115 return false;
11116
11118 return false;
11119
11122
11123 if (value <= (min + 0.001))
11124 value = min;
11125
11126 if (value == min)
11127 {
11128 if (destroy_config)
11129 {
11130 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11131 if (dstr)
11132 {
11134 this.Delete();
11135 return true;
11136 }
11137 }
11138 else if (destroy_forced)
11139 {
11141 this.Delete();
11142 return true;
11143 }
11144
11146 }
11147
11150
11152 {
11154
11155 if (delta)
11157 }
11158
11160
11161 return false;
11162 }
11163
11164
11166 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11167 {
11169 }
11170
11172 {
11175 }
11176
11178 {
11181 }
11182
11184 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11185 {
11186 float value_clamped = Math.Clamp(value, 0, 1);
11188 SetQuantity(result, destroy_config, destroy_forced);
11189 }
11190
11191
11194 {
11196 }
11197
11199 {
11201 }
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11213 {
11214 int slot = -1;
11215 if (GetInventory())
11216 {
11217 InventoryLocation il = new InventoryLocation;
11218 GetInventory().GetCurrentInventoryLocation(il);
11220 }
11221
11223 }
11224
11226 {
11227 float quantity_max = 0;
11228
11230 {
11231 if (attSlotID != -1)
11232 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11233
11234 if (quantity_max <= 0)
11236 }
11237
11238 if (quantity_max <= 0)
11240
11241 return quantity_max;
11242 }
11243
11245 {
11247 }
11248
11250 {
11252 }
11253
11254
11256 {
11258 }
11259
11261 {
11263 }
11264
11266 {
11268 }
11269
11270
11272 {
11273
11274 float weightEx = GetWeightEx();
11275 float special = GetInventoryAndCargoWeight();
11276 return weightEx - special;
11277 }
11278
11279
11281 {
11283 }
11284
11286 {
11288 {
11289 #ifdef DEVELOPER
11290 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11291 {
11292 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11294 }
11295 #endif
11296
11297 return GetQuantity() * GetConfigWeightModified();
11298 }
11299 else if (HasEnergyManager())
11300 {
11301 #ifdef DEVELOPER
11302 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11303 {
11304 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11305 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11306 }
11307 #endif
11308 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11309 }
11310 else
11311 {
11312 #ifdef DEVELOPER
11313 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11314 {
11315 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11316 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11317 }
11318 #endif
11319 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11320 }
11321 }
11322
11325 {
11326 int item_count = 0;
11328
11329 if (GetInventory().GetCargo() != NULL)
11330 {
11331 item_count = GetInventory().GetCargo().GetItemCount();
11332 }
11333
11334 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11335 {
11336 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11337 if (item)
11338 item_count += item.GetNumberOfItems();
11339 }
11340 return item_count;
11341 }
11342
11345 {
11346 float weight = 0;
11347 float wetness = 1;
11348 if (include_wetness)
11351 {
11352 weight = wetness * m_ConfigWeight;
11353 }
11355 {
11356 weight = 1;
11357 }
11358 return weight;
11359 }
11360
11361
11362
11364 {
11365 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11366 {
11367 GameInventory inv = GetInventory();
11368 array<EntityAI> items = new array<EntityAI>;
11370 for (int i = 0; i < items.Count(); i++)
11371 {
11373 if (item)
11374 {
11376 }
11377 }
11378 }
11379 }
11380
11381
11382
11383
11385 {
11386 float energy = 0;
11387 if (HasEnergyManager())
11388 {
11389 energy = GetCompEM().GetEnergy();
11390 }
11391 return energy;
11392 }
11393
11394
11396 {
11397 super.OnEnergyConsumed();
11398
11400 }
11401
11403 {
11404 super.OnEnergyAdded();
11405
11407 }
11408
11409
11411 {
11412 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11413 {
11415 {
11416 float energy_0to1 = GetCompEM().GetEnergy0To1();
11418 }
11419 }
11420 }
11421
11422
11424 {
11425 return ConfigGetFloat("heatIsolation");
11426 }
11427
11429 {
11431 }
11432
11434 {
11435 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11436 if (
GetGame().ConfigIsExisting(paramPath))
11438
11439 return 0.0;
11440 }
11441
11443 {
11444 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11445 if (
GetGame().ConfigIsExisting(paramPath))
11447
11448 return 0.0;
11449 }
11450
11451 override void SetWet(
float value,
bool allow_client =
false)
11452 {
11453 if (!IsServerCheck(allow_client))
11454 return;
11455
11458
11460
11461 m_VarWet = Math.Clamp(value, min, max);
11462
11464 {
11467 }
11468 }
11469
11470 override void AddWet(
float value)
11471 {
11473 }
11474
11476 {
11478 }
11479
11481 {
11483 }
11484
11486 {
11488 }
11489
11491 {
11493 }
11494
11496 {
11498 }
11499
11500 override void OnWetChanged(
float newVal,
float oldVal)
11501 {
11504 if (newLevel != oldLevel)
11505 {
11507 }
11508 }
11509
11511 {
11512 SetWeightDirty();
11513 }
11514
11516 {
11517 return GetWetLevelInternal(
m_VarWet);
11518 }
11519
11520
11521
11523 {
11525 }
11526
11528 {
11530 }
11531
11533 {
11535 }
11536
11538 {
11540 }
11541
11542
11543
11545 {
11546 if (ConfigIsExisting("itemModelLength"))
11547 {
11548 return ConfigGetFloat("itemModelLength");
11549 }
11550 return 0;
11551 }
11552
11554 {
11555 if (ConfigIsExisting("itemAttachOffset"))
11556 {
11557 return ConfigGetFloat("itemAttachOffset");
11558 }
11559 return 0;
11560 }
11561
11562 override void SetCleanness(
int value,
bool allow_client =
false)
11563 {
11564 if (!IsServerCheck(allow_client))
11565 return;
11566
11568
11570
11573 }
11574
11576 {
11578 }
11579
11581 {
11582 return true;
11583 }
11584
11585
11586
11587
11589 {
11591 }
11592
11594 {
11596 }
11597
11598
11599
11600
11601 override void SetColor(
int r,
int g,
int b,
int a)
11602 {
11608 }
11610 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11611 {
11616 }
11617
11619 {
11621 }
11622
11625 {
11626 int r,g,b,a;
11628 r = r/255;
11629 g = g/255;
11630 b = b/255;
11631 a = a/255;
11632 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11633 }
11634
11635
11636
11637 override void SetLiquidType(
int value,
bool allow_client =
false)
11638 {
11639 if (!IsServerCheck(allow_client))
11640 return;
11641
11646 }
11647
11649 {
11650 return ConfigGetInt("varLiquidTypeInit");
11651 }
11652
11654 {
11656 }
11657
11659 {
11661 SetFrozen(false);
11662 }
11663
11666 {
11667 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11668 }
11669
11670
11673 {
11674 PlayerBase nplayer;
11675 if (PlayerBase.CastTo(nplayer, player))
11676 {
11678
11679 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11680 }
11681 }
11682
11683
11686 {
11687 PlayerBase nplayer;
11688 if (PlayerBase.CastTo(nplayer,player))
11689 {
11690
11691 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11692
11693 }
11694
11695
11696 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11697
11698
11699 if (HasEnergyManager())
11700 {
11701 GetCompEM().UpdatePlugState();
11702 }
11703 }
11704
11705
11707 {
11708 super.OnPlacementStarted(player);
11709
11711 }
11712
11713 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11714 {
11716 {
11717 m_AdminLog.OnPlacementComplete(player,
this);
11718 }
11719
11720 super.OnPlacementComplete(player, position, orientation);
11721 }
11722
11723
11724
11725
11726
11728 {
11730 {
11731 return true;
11732 }
11733 else
11734 {
11735 return false;
11736 }
11737 }
11738
11739
11741 {
11743 {
11745 }
11746 }
11747
11748
11750 {
11752 }
11753
11755 {
11757 }
11758
11759 override void InsertAgent(
int agent,
float count = 1)
11760 {
11761 if (count < 1)
11762 return;
11763
11765 }
11766
11769 {
11771 }
11772
11773
11775 {
11777 }
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11821 {
11823 return false;
11824 return true;
11825 }
11826
11828 {
11829
11831 }
11832
11833
11836 {
11837 super.CheckForRoofLimited(timeTresholdMS);
11838
11840 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11841 {
11842 m_PreviousRoofTestTime = time;
11843 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11844 }
11845 }
11846
11847
11849 {
11851 {
11852 return 0;
11853 }
11854
11855 if (GetInventory().GetAttachmentSlotsCount() != 0)
11856 {
11857 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11858 if (filter)
11859 return filter.GetProtectionLevel(type, false, system);
11860 else
11861 return 0;
11862 }
11863
11864 string subclassPath, entryName;
11865
11866 switch (type)
11867 {
11869 entryName = "biological";
11870 break;
11872 entryName = "chemical";
11873 break;
11874 default:
11875 entryName = "biological";
11876 break;
11877 }
11878
11879 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11880
11882 }
11883
11884
11885
11888 {
11889 if (!IsMagazine())
11891
11893 }
11894
11895
11896
11897
11898
11903 {
11904 return true;
11905 }
11906
11908 {
11910 }
11911
11912
11913
11914
11915
11917 {
11918 if (parent)
11919 {
11920 if (parent.IsInherited(DayZInfected))
11921 return true;
11922
11923 if (!parent.IsRuined())
11924 return true;
11925 }
11926
11927 return true;
11928 }
11929
11931 {
11932 if (!super.CanPutAsAttachment(parent))
11933 {
11934 return false;
11935 }
11936
11937 if (!IsRuined() && !parent.IsRuined())
11938 {
11939 return true;
11940 }
11941
11942 return false;
11943 }
11944
11946 {
11947
11948
11949
11950
11951 return super.CanReceiveItemIntoCargo(item);
11952 }
11953
11955 {
11956
11957
11958
11959
11960 GameInventory attachmentInv = attachment.GetInventory();
11962 {
11963 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11964 return false;
11965 }
11966
11967 InventoryLocation loc = new InventoryLocation();
11968 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11969 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11970 return false;
11971
11972 return super.CanReceiveAttachment(attachment, slotId);
11973 }
11974
11976 {
11977 if (!super.CanReleaseAttachment(attachment))
11978 return false;
11979
11980 return GetInventory().AreChildrenAccessible();
11981 }
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12004 {
12005 int id = muzzle_owner.GetMuzzleID();
12006 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12007
12008 if (WPOF_array)
12009 {
12010 for (int i = 0; i < WPOF_array.Count(); i++)
12011 {
12012 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12013
12014 if (WPOF)
12015 {
12016 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12017 }
12018 }
12019 }
12020 }
12021
12022
12024 {
12025 int id = muzzle_owner.GetMuzzleID();
12027
12028 if (WPOBE_array)
12029 {
12030 for (int i = 0; i < WPOBE_array.Count(); i++)
12031 {
12032 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12033
12034 if (WPOBE)
12035 {
12036 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12037 }
12038 }
12039 }
12040 }
12041
12042
12044 {
12045 int id = muzzle_owner.GetMuzzleID();
12046 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12047
12048 if (WPOOH_array)
12049 {
12050 for (int i = 0; i < WPOOH_array.Count(); i++)
12051 {
12052 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12053
12054 if (WPOOH)
12055 {
12056 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12057 }
12058 }
12059 }
12060 }
12061
12062
12064 {
12065 int id = muzzle_owner.GetMuzzleID();
12066 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12067
12068 if (WPOOH_array)
12069 {
12070 for (int i = 0; i < WPOOH_array.Count(); i++)
12071 {
12072 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12073
12074 if (WPOOH)
12075 {
12076 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12077 }
12078 }
12079 }
12080 }
12081
12082
12084 {
12085 int id = muzzle_owner.GetMuzzleID();
12086 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12087
12088 if (WPOOH_array)
12089 {
12090 for (int i = 0; i < WPOOH_array.Count(); i++)
12091 {
12092 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12093
12094 if (WPOOH)
12095 {
12096 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12097 }
12098 }
12099 }
12100 }
12101
12102
12103
12105 {
12107 {
12108 return true;
12109 }
12110
12111 return false;
12112 }
12113
12115 {
12117 {
12118 return true;
12119 }
12120
12121 return false;
12122 }
12123
12125 {
12127 {
12128 return true;
12129 }
12130
12131 return false;
12132 }
12133
12135 {
12136 return false;
12137 }
12138
12141 {
12142 return UATimeSpent.DEFAULT_DEPLOY;
12143 }
12144
12145
12146
12147
12149 {
12151 SetSynchDirty();
12152 }
12153
12155 {
12157 }
12158
12159
12161 {
12162 return false;
12163 }
12164
12167 {
12168 string att_type = "None";
12169
12170 if (ConfigIsExisting("soundAttType"))
12171 {
12172 att_type = ConfigGetString("soundAttType");
12173 }
12174
12176 }
12177
12179 {
12181 }
12182
12183
12184
12185
12186
12192
12194 {
12197
12199 }
12200
12201
12203 {
12205 return;
12206
12208
12211
12214
12215 SoundParameters params = new SoundParameters();
12219 }
12220
12221
12223 {
12225 return;
12226
12228 SetSynchDirty();
12229
12232 }
12233
12234
12236 {
12238 return;
12239
12241 SetSynchDirty();
12242
12245 }
12246
12248 {
12250 }
12251
12253 {
12255 }
12256
12259 {
12260 if (!
GetGame().IsDedicatedServer())
12261 {
12262 if (ConfigIsExisting("attachSoundSet"))
12263 {
12264 string cfg_path = "";
12265 string soundset = "";
12266 string type_name =
GetType();
12267
12270 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12271 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12272
12273 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12274 {
12275 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12276 {
12277 if (cfg_slot_array[i] == slot_type)
12278 {
12279 soundset = cfg_soundset_array[i];
12280 break;
12281 }
12282 }
12283 }
12284
12285 if (soundset != "")
12286 {
12287 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12289 }
12290 }
12291 }
12292 }
12293
12295 {
12296
12297 }
12298
12299 void OnApply(PlayerBase player);
12300
12302 {
12303 return 1.0;
12304 };
12305
12307 {
12309 }
12310
12312 {
12314 }
12315
12317
12319 {
12320 SetDynamicPhysicsLifeTime(0.01);
12322 }
12323
12325 {
12326 array<string> zone_names = new array<string>;
12327 GetDamageZones(zone_names);
12328 for (int i = 0; i < zone_names.Count(); i++)
12329 {
12330 SetHealthMax(zone_names.Get(i),"Health");
12331 }
12332 SetHealthMax("","Health");
12333 }
12334
12337 {
12338 float global_health = GetHealth01("","Health");
12339 array<string> zones = new array<string>;
12340 GetDamageZones(zones);
12341
12342 for (int i = 0; i < zones.Count(); i++)
12343 {
12344 SetHealth01(zones.Get(i),"Health",global_health);
12345 }
12346 }
12347
12350 {
12351 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12352 }
12353
12355 {
12356 if (!hasRootAsPlayer)
12357 {
12358 if (refParentIB)
12359 {
12360
12361 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12362 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12363
12364 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12365 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12366
12369 }
12370 else
12371 {
12372
12375 }
12376 }
12377 }
12378
12380 {
12382 {
12383 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12384 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12385 {
12386 float heatPermCoef = 1.0;
12388 while (ent)
12389 {
12390 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12391 ent = ent.GetHierarchyParent();
12392 }
12393
12394 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12395 }
12396 }
12397 }
12398
12400 {
12401
12402 EntityAI parent = GetHierarchyParent();
12403 if (!parent)
12404 {
12405 hasParent = false;
12406 hasRootAsPlayer = false;
12407 }
12408 else
12409 {
12410 hasParent = true;
12411 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12412 refParentIB =
ItemBase.Cast(parent);
12413 }
12414 }
12415
12416 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12417 {
12418
12419 }
12420
12422 {
12423
12424 return false;
12425 }
12426
12428 {
12429
12430
12431 return false;
12432 }
12433
12435 {
12436
12437 return false;
12438 }
12439
12442 {
12443 return !GetIsFrozen() &&
IsOpen();
12444 }
12445
12447 {
12448 bool hasParent = false, hasRootAsPlayer = false;
12450
12451 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12452 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12453
12454 if (wwtu || foodDecay)
12455 {
12459
12460 if (processWetness || processTemperature || processDecay)
12461 {
12463
12464 if (processWetness)
12465 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12466
12467 if (processTemperature)
12469
12470 if (processDecay)
12471 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12472 }
12473 }
12474 }
12475
12478 {
12480 }
12481
12483 {
12486
12487 return super.GetTemperatureFreezeThreshold();
12488 }
12489
12491 {
12494
12495 return super.GetTemperatureThawThreshold();
12496 }
12497
12499 {
12502
12503 return super.GetItemOverheatThreshold();
12504 }
12505
12507 {
12509 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12510
12511 return super.GetTemperatureFreezeTime();
12512 }
12513
12515 {
12517 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12518
12519 return super.GetTemperatureThawTime();
12520 }
12521
12526
12528 {
12529 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12530 }
12531
12533 {
12534 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12535 }
12536
12539 {
12541 }
12542
12544 {
12546 }
12547
12549 {
12551 }
12552
12555 {
12556 return null;
12557 }
12558
12561 {
12562 return false;
12563 }
12564
12566 {
12568 {
12571 if (!trg)
12572 {
12574 explosive = this;
12575 }
12576
12577 explosive.PairRemote(trg);
12579
12580 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12581 trg.SetPersistentPairID(persistentID);
12582 explosive.SetPersistentPairID(persistentID);
12583
12584 return true;
12585 }
12586 return false;
12587 }
12588
12591 {
12592 float ret = 1.0;
12595 ret *= GetHealth01();
12596
12597 return ret;
12598 }
12599
12600 #ifdef DEVELOPER
12601 override void SetDebugItem()
12602 {
12603 super.SetDebugItem();
12604 _itemBase = this;
12605 }
12606
12608 {
12609 string text = super.GetDebugText();
12610
12612 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12613
12614 return text;
12615 }
12616 #endif
12617
12619 {
12620 return true;
12621 }
12622
12624
12626
12628 {
12631 }
12632
12633
12641
12657}
12658
12660{
12662 if (entity)
12663 {
12664 bool is_item = entity.IsInherited(
ItemBase);
12665 if (is_item && full_quantity)
12666 {
12669 }
12670 }
12671 else
12672 {
12674 return NULL;
12675 }
12676 return entity;
12677}
12678
12680{
12681 if (item)
12682 {
12683 if (health > 0)
12684 item.SetHealth("", "", health);
12685
12686 if (item.CanHaveTemperature())
12687 {
12689 if (item.CanFreeze())
12690 item.SetFrozen(false);
12691 }
12692
12693 if (item.HasEnergyManager())
12694 {
12695 if (quantity >= 0)
12696 {
12697 item.GetCompEM().SetEnergy0To1(quantity);
12698 }
12699 else
12700 {
12702 }
12703 }
12704 else if (item.IsMagazine())
12705 {
12706 Magazine mag = Magazine.Cast(item);
12707 if (quantity >= 0)
12708 {
12709 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12710 }
12711 else
12712 {
12714 }
12715
12716 }
12717 else
12718 {
12719 if (quantity >= 0)
12720 {
12721 item.SetQuantityNormalized(quantity, false);
12722 }
12723 else
12724 {
12726 }
12727
12728 }
12729 }
12730}
12731
12732#ifdef DEVELOPER
12734#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.