7845{
7847 {
7848 return true;
7849 }
7850};
7851
7852
7853
7855{
7859
7861
7864
7865
7866
7867
7868
7877
7883
7888
7893
7914 protected bool m_IsResultOfSplit
7915
7917
7922
7923
7924
7926
7930
7931
7932
7934
7937
7938
7939
7945
7946
7954
7957
7958
7960
7961
7963
7964
7969
7970
7975
7976
7978
7979
7981 {
7986
7987 if (!
GetGame().IsDedicatedServer())
7988 {
7990 {
7992
7994 {
7996 }
7997 }
7998
8001 }
8002
8003 m_OldLocation = null;
8004
8006 {
8008 }
8009
8010 if (ConfigIsExisting("headSelectionsToHide"))
8011 {
8014 }
8015
8017 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8018 {
8020 }
8021
8023
8024 m_IsResultOfSplit = false;
8025
8027 }
8028
8030 {
8031 super.InitItemVariables();
8032
8038 m_Count = ConfigGetInt(
"count");
8039
8042
8047
8050
8055
8067
8071
8072
8075 if (ConfigIsExisting("canBeSplit"))
8076 {
8079 }
8080
8082 if (ConfigIsExisting("itemBehaviour"))
8084
8085
8088 RegisterNetSyncVariableInt("m_VarLiquidType");
8089 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8090
8091 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8092 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8093 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8094
8095 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8096 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8097 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8098 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8099
8100 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8101 RegisterNetSyncVariableBool("m_IsTakeable");
8102 RegisterNetSyncVariableBool("m_IsHologram");
8103
8106 {
8109 }
8110
8112
8114 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8116
8117 }
8118
8120 {
8122 }
8123
8125 {
8128 {
8133 }
8134 }
8135
8136 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8137 {
8139 {
8142 }
8143
8145 }
8146
8148 {
8154 }
8155
8157
8159 {
8161
8162 if (!action)
8163 {
8164 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8165 return;
8166 }
8167
8169 if (!ai)
8170 {
8172 return;
8173 }
8174
8176 if (!action_array)
8177 {
8178 action_array = new array<ActionBase_Basic>;
8180 }
8181 if (LogManager.IsActionLogEnable())
8182 {
8183 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8184 }
8185
8186 if (action_array.Find(action) != -1)
8187 {
8188 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8189 }
8190 else
8191 {
8192 action_array.Insert(action);
8193 }
8194 }
8195
8197 {
8199 ActionBase action = player.GetActionManager().GetAction(actionName);
8202
8203 if (action_array)
8204 {
8205 action_array.RemoveItem(action);
8206 }
8207 }
8208
8209
8210
8212 {
8213 ActionOverrideData overrideData = new ActionOverrideData();
8217
8219 if (!actionMap)
8220 {
8223 }
8224
8225 actionMap.Insert(this.
Type(), overrideData);
8226
8227 }
8228
8230
8232
8233
8235 {
8238
8241
8242 string config_to_search = "CfgVehicles";
8243 string muzzle_owner_config;
8244
8246 {
8247 if (IsInherited(Weapon))
8248 config_to_search = "CfgWeapons";
8249
8250 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8251
8252 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8253
8255
8256 if (config_OnFire_subclass_count > 0)
8257 {
8258 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8259
8260 for (int i = 0; i < config_OnFire_subclass_count; i++)
8261 {
8262 string particle_class = "";
8264 string config_OnFire_entry = config_OnFire_class + particle_class;
8265 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8266 WPOF_array.Insert(WPOF);
8267 }
8268
8269
8271 }
8272 }
8273
8275 {
8276 config_to_search = "CfgWeapons";
8277 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8278
8279 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8280
8282
8283 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8284 {
8285 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8286
8287 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8288 {
8289 string particle_class2 = "";
8291 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8292 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8293 WPOBE_array.Insert(WPOBE);
8294 }
8295
8296
8298 }
8299 }
8300 }
8301
8302
8304 {
8307
8309 {
8310 string config_to_search = "CfgVehicles";
8311
8312 if (IsInherited(Weapon))
8313 config_to_search = "CfgWeapons";
8314
8315 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8316 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8317
8318 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8319 {
8320
8322
8324 {
8326 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8328 return;
8329 }
8330
8333
8334
8335
8337 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8338
8339 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8340 {
8341 string particle_class = "";
8343 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8345
8346 if (entry_type == CT_CLASS)
8347 {
8348 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8349 WPOOH_array.Insert(WPOF);
8350 }
8351 }
8352
8353
8355 }
8356 }
8357 }
8358
8360 {
8362 }
8363
8365 {
8367 {
8369
8372
8375
8376 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8377 }
8378 }
8379
8381 {
8383 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8384
8386 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8387
8389 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8390
8392 {
8394 }
8395 }
8396
8398 {
8400 }
8401
8403 {
8406 else
8408
8410 {
8413 }
8414 else
8415 {
8418
8421 }
8422
8424 }
8425
8427 {
8429 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8430 }
8431
8433 {
8435 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8437 }
8438
8440 {
8442 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8443 }
8444
8446 {
8449
8450 OverheatingParticle OP = new OverheatingParticle();
8455
8457 }
8458
8460 {
8463
8464 return -1;
8465 }
8466
8468 {
8470 {
8473
8474 for (int i = count; i > 0; --i)
8475 {
8476 int id = i - 1;
8479
8482
8483 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8484 {
8485 if (p)
8486 {
8489 }
8490 }
8491 }
8492 }
8493 }
8494
8496 {
8498 {
8500 {
8501 int id = i - 1;
8503
8504 if (OP)
8505 {
8507
8508 if (p)
8509 {
8511 }
8512
8513 delete OP;
8514 }
8515 }
8516
8519 }
8520 }
8521
8524 {
8525 return 0.0;
8526 }
8527
8528
8530 {
8531 return 250;
8532 }
8533
8535 {
8536 return 0;
8537 }
8538
8541 {
8543 return true;
8544
8545 return false;
8546 }
8547
8550 {
8553
8555 {
8557 }
8558 else
8559 {
8560
8562 }
8563
8565 }
8566
8573 {
8574 return -1;
8575 }
8576
8577
8578
8579
8581 {
8583 {
8585 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8586
8587 if (r_index >= 0)
8588 {
8589 InventoryLocation r_il = new InventoryLocation;
8590 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8591
8592 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8595 {
8596 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8597 }
8599 {
8600 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8601 }
8602
8603 }
8604
8605 player.GetHumanInventory().ClearUserReservedLocation(this);
8606 }
8607
8610 }
8611
8612
8613
8614
8616 {
8617 return ItemBase.m_DebugActionsMask;
8618 }
8619
8621 {
8622 return ItemBase.m_DebugActionsMask & mask;
8623 }
8624
8626 {
8627 ItemBase.m_DebugActionsMask = mask;
8628 }
8629
8631 {
8632 ItemBase.m_DebugActionsMask |= mask;
8633 }
8634
8636 {
8637 ItemBase.m_DebugActionsMask &= ~mask;
8638 }
8639
8641 {
8643 {
8645 }
8646 else
8647 {
8649 }
8650 }
8651
8652
8654 {
8655 if (GetEconomyProfile())
8656 {
8657 float q_max = GetEconomyProfile().GetQuantityMax();
8658 if (q_max > 0)
8659 {
8660 float q_min = GetEconomyProfile().GetQuantityMin();
8661 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8662
8664 {
8665 ComponentEnergyManager comp = GetCompEM();
8667 {
8669 }
8670 }
8672 {
8674
8675 }
8676
8677 }
8678 }
8679 }
8680
8683 {
8684 EntityAI parent = GetHierarchyParent();
8685
8686 if (parent)
8687 {
8688 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8689 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8690 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8691 }
8692 }
8693
8696 {
8697 EntityAI parent = GetHierarchyParent();
8698
8699 if (parent)
8700 {
8701 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8702 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8703 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8704 }
8705 }
8706
8708 {
8709
8710
8711
8712
8714
8716 {
8717 if (ScriptInputUserData.CanStoreInputUserData())
8718 {
8719 ScriptInputUserData ctx = new ScriptInputUserData;
8725 ctx.
Write(use_stack_max);
8728
8730 {
8731 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8732 }
8733 }
8734 }
8735 else if (!
GetGame().IsMultiplayer())
8736 {
8738 }
8739 }
8740
8742 {
8744 }
8745
8747 {
8749 }
8750
8752 {
8754 }
8755
8757 {
8758
8759 return false;
8760 }
8761
8763 {
8764 return false;
8765 }
8766
8770 {
8771 return false;
8772 }
8773
8775 {
8776 return "";
8777 }
8778
8780
8782 {
8783 return false;
8784 }
8785
8787 {
8788 return true;
8789 }
8790
8791
8792
8794 {
8795 return true;
8796 }
8797
8799 {
8800 return true;
8801 }
8802
8804 {
8805 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8807 }
8808
8810 {
8812 }
8813
8815 {
8817 if (!is_being_placed)
8819 SetSynchDirty();
8820 }
8821
8822
8824
8826 {
8828 }
8829
8831 {
8833 }
8834
8836 {
8837 return 1;
8838 }
8839
8841 {
8842 return false;
8843 }
8844
8846 {
8848 SetSynchDirty();
8849 }
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8886 {
8887 super.OnMovedInsideCargo(container);
8888
8889 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8890 }
8891
8892 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8893 {
8894 super.EEItemLocationChanged(oldLoc,newLoc);
8895
8896 PlayerBase new_player = null;
8897 PlayerBase old_player = null;
8898
8899 if (newLoc.GetParent())
8900 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8901
8902 if (oldLoc.GetParent())
8903 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8904
8906 {
8907 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8908
8909 if (r_index >= 0)
8910 {
8911 InventoryLocation r_il = new InventoryLocation;
8912 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8913
8914 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8917 {
8918 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8919 }
8921 {
8922 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8923 }
8924
8925 }
8926 }
8927
8929 {
8930 if (new_player)
8931 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8932
8933 if (new_player == old_player)
8934 {
8935
8936 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8937 {
8939 {
8940 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8941 {
8942 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8943 }
8944 }
8945 else
8946 {
8947 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8948 }
8949 }
8950
8951 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8952 {
8953 int type = oldLoc.GetType();
8955 {
8956 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8957 }
8959 {
8960 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8961 }
8962 }
8963 if (!m_OldLocation)
8964 {
8965 m_OldLocation = new InventoryLocation;
8966 }
8967 m_OldLocation.Copy(oldLoc);
8968 }
8969 else
8970 {
8971 if (m_OldLocation)
8972 {
8973 m_OldLocation.Reset();
8974 }
8975 }
8976
8978 }
8979 else
8980 {
8981 if (new_player)
8982 {
8983 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8984 if (res_index >= 0)
8985 {
8986 InventoryLocation il = new InventoryLocation;
8987 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8989 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8992 {
8993 il.
GetParent().GetOnReleaseLock().Invoke(it);
8994 }
8996 {
8998 }
8999
9000 }
9001 }
9003 {
9004
9006 }
9007
9008 if (m_OldLocation)
9009 {
9010 m_OldLocation.Reset();
9011 }
9012 }
9013 }
9014
9015 override void EOnContact(IEntity other, Contact extra)
9016 {
9018 {
9019 int liquidType = -1;
9021 if (impactSpeed > 0.0)
9022 {
9024 #ifndef SERVER
9026 #else
9028 SetSynchDirty();
9029 #endif
9031 }
9032 }
9033
9034 #ifdef SERVER
9035 if (GetCompEM() && GetCompEM().IsPlugged())
9036 {
9037 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9038 GetCompEM().UnplugThis();
9039 }
9040 #endif
9041 }
9042
9044
9046 {
9048 }
9049
9051 {
9052
9053 }
9054
9056 {
9057 super.OnItemLocationChanged(old_owner, new_owner);
9058
9059 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9060 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9061
9062 if (!relatedPlayer && playerNew)
9063 relatedPlayer = playerNew;
9064
9065 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9066 {
9068 if (actionMgr)
9069 {
9070 ActionBase currentAction = actionMgr.GetRunningAction();
9071 if (currentAction)
9073 }
9074 }
9075
9076 Man ownerPlayerOld = null;
9077 Man ownerPlayerNew = null;
9078
9079 if (old_owner)
9080 {
9081 if (old_owner.
IsMan())
9082 {
9083 ownerPlayerOld = Man.Cast(old_owner);
9084 }
9085 else
9086 {
9087 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9088 }
9089 }
9090 else
9091 {
9093 {
9095
9096 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9097 {
9098 GetCompEM().UnplugThis();
9099 }
9100 }
9101 }
9102
9103 if (new_owner)
9104 {
9105 if (new_owner.
IsMan())
9106 {
9107 ownerPlayerNew = Man.Cast(new_owner);
9108 }
9109 else
9110 {
9111 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9112 }
9113 }
9114
9115 if (ownerPlayerOld != ownerPlayerNew)
9116 {
9117 if (ownerPlayerOld)
9118 {
9119 array<EntityAI> subItemsExit = new array<EntityAI>;
9121 for (int i = 0; i < subItemsExit.Count(); i++)
9122 {
9125 }
9126 }
9127
9128 if (ownerPlayerNew)
9129 {
9130 array<EntityAI> subItemsEnter = new array<EntityAI>;
9132 for (int j = 0; j < subItemsEnter.Count(); j++)
9133 {
9136 }
9137 }
9138 }
9139 else if (ownerPlayerNew != null)
9140 {
9141 PlayerBase nplayer;
9142 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9143 {
9144 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9146 for (int k = 0; k < subItemsUpdate.Count(); k++)
9147 {
9149 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9150 }
9151 }
9152 }
9153
9154 if (old_owner)
9155 old_owner.OnChildItemRemoved(this);
9156 if (new_owner)
9157 new_owner.OnChildItemReceived(this);
9158 }
9159
9160
9162 {
9163 super.EEDelete(parent);
9164 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9165 if (player)
9166 {
9168
9169 if (player.IsAlive())
9170 {
9171 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9172 if (r_index >= 0)
9173 {
9174 InventoryLocation r_il = new InventoryLocation;
9175 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9176
9177 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9180 {
9181 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9182 }
9184 {
9185 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9186 }
9187
9188 }
9189
9190 player.RemoveQuickBarEntityShortcut(this);
9191 }
9192 }
9193 }
9194
9196 {
9197 super.EEKilled(killer);
9198
9201 {
9202 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9203 {
9204 if (IsMagazine())
9205 {
9206 if (Magazine.Cast(this).GetAmmoCount() > 0)
9207 {
9209 }
9210 }
9211 else
9212 {
9214 }
9215 }
9216 }
9217 }
9218
9220 {
9221 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9222
9223 super.OnWasAttached(parent, slot_id);
9224
9227
9229 }
9230
9232 {
9233 super.OnWasDetached(parent, slot_id);
9234
9237 }
9238
9240 {
9241 int idx;
9244
9245 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9246 if (inventory_slots.Count() < 1)
9247 {
9248 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9249 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9250 }
9251 else
9252 {
9253 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9254 }
9255
9256 idx = inventory_slots.Find(slot);
9257 if (idx < 0)
9258 return "";
9259
9260 return attach_types.Get(idx);
9261 }
9262
9264 {
9265 int idx = -1;
9266 string slot;
9267
9270
9271 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9272 if (inventory_slots.Count() < 1)
9273 {
9274 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9275 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9276 }
9277 else
9278 {
9279 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9280 if (detach_types.Count() < 1)
9281 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9282 }
9283
9284 for (int i = 0; i < inventory_slots.Count(); i++)
9285 {
9286 slot = inventory_slots.Get(i);
9287 }
9288
9289 if (slot != "")
9290 {
9291 if (detach_types.Count() == 1)
9292 idx = 0;
9293 else
9294 idx = inventory_slots.Find(slot);
9295 }
9296 if (idx < 0)
9297 return "";
9298
9299 return detach_types.Get(idx);
9300 }
9301
9303 {
9304
9306
9307
9308 float min_time = 1;
9309 float max_time = 3;
9310 float delay = Math.RandomFloat(min_time, max_time);
9311
9312 explode_timer.Run(delay, this, "DoAmmoExplosion");
9313 }
9314
9316 {
9317 Magazine magazine = Magazine.Cast(this);
9318 int pop_sounds_count = 6;
9319 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9320
9321
9322 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9323 string sound_name = pop_sounds[ sound_idx ];
9325
9326
9327 magazine.ServerAddAmmoCount(-1);
9328
9329
9330 float min_temp_to_explode = 100;
9331
9332 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9333 {
9335 }
9336 }
9337
9338
9339 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9340 {
9341 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9342
9343 const int CHANCE_DAMAGE_CARGO = 4;
9344 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9345 const int CHANCE_DAMAGE_NOTHING = 2;
9346
9348 {
9349 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9350 int chances;
9351 int rnd;
9352
9353 if (GetInventory().GetCargo())
9354 {
9355 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9356 rnd = Math.RandomInt(0,chances);
9357
9358 if (rnd < CHANCE_DAMAGE_CARGO)
9359 {
9361 }
9362 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9363 {
9365 }
9366 }
9367 else
9368 {
9369 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9370 rnd = Math.RandomInt(0,chances);
9371
9372 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9373 {
9375 }
9376 }
9377 }
9378 }
9379
9381 {
9382 if (GetInventory().GetCargo())
9383 {
9384 int item_count = GetInventory().GetCargo().GetItemCount();
9385 if (item_count > 0)
9386 {
9387 int random_pick = Math.RandomInt(0, item_count);
9389 if (!item.IsExplosive())
9390 {
9391 item.AddHealth("","",damage);
9392 return true;
9393 }
9394 }
9395 }
9396 return false;
9397 }
9398
9400 {
9401 int attachment_count = GetInventory().AttachmentCount();
9402 if (attachment_count > 0)
9403 {
9404 int random_pick = Math.RandomInt(0, attachment_count);
9405 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9406 if (!attachment.IsExplosive())
9407 {
9408 attachment.AddHealth("","",damage);
9409 return true;
9410 }
9411 }
9412 return false;
9413 }
9414
9416 {
9418 }
9419
9421 {
9423 return GetInventory().CanRemoveEntity();
9424
9425 return false;
9426 }
9427
9429 {
9430
9432 return false;
9433
9434
9436 return false;
9437
9438
9439
9441 if (delta == 0)
9442 return false;
9443
9444
9445 return true;
9446 }
9447
9449 {
9451 {
9452 if (ScriptInputUserData.CanStoreInputUserData())
9453 {
9454 ScriptInputUserData ctx = new ScriptInputUserData;
9459 ctx.
Write(destination_entity);
9463 }
9464 }
9465 else if (!
GetGame().IsMultiplayer())
9466 {
9468 }
9469 }
9470
9472 {
9473 float split_quantity_new;
9477 InventoryLocation loc = new InventoryLocation;
9478
9479 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9480 {
9482 split_quantity_new = stack_max;
9483 else
9485
9487 {
9488 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9489 if (new_item)
9490 {
9491 new_item.SetResultOfSplit(true);
9492 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9494 new_item.
SetQuantity(split_quantity_new,
false,
true);
9495 }
9496 }
9497 }
9498 else if (destination_entity && slot_id == -1)
9499 {
9500 if (quantity > stack_max)
9501 split_quantity_new = stack_max;
9502 else
9503 split_quantity_new = quantity;
9504
9506 {
9508 {
9511 }
9512
9513 if (new_item)
9514 {
9515 new_item.SetResultOfSplit(true);
9516 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9518 new_item.
SetQuantity(split_quantity_new,
false,
true);
9519 }
9520 }
9521 }
9522 else
9523 {
9524 if (stack_max != 0)
9525 {
9527 {
9529 }
9530
9531 if (split_quantity_new == 0)
9532 {
9533 if (!
GetGame().IsMultiplayer())
9534 player.PhysicalPredictiveDropItem(this);
9535 else
9536 player.ServerDropEntity(this);
9537 return;
9538 }
9539
9541 {
9543
9544 if (new_item)
9545 {
9546 new_item.SetResultOfSplit(true);
9547 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9550 new_item.PlaceOnSurface();
9551 }
9552 }
9553 }
9554 }
9555 }
9556
9558 {
9559 float split_quantity_new;
9563 InventoryLocation loc = new InventoryLocation;
9564
9565 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9566 {
9568 split_quantity_new = stack_max;
9569 else
9571
9573 {
9574 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9575 if (new_item)
9576 {
9577 new_item.SetResultOfSplit(true);
9578 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9580 new_item.
SetQuantity(split_quantity_new,
false,
true);
9581 }
9582 }
9583 }
9584 else if (destination_entity && slot_id == -1)
9585 {
9586 if (quantity > stack_max)
9587 split_quantity_new = stack_max;
9588 else
9589 split_quantity_new = quantity;
9590
9592 {
9594 {
9597 }
9598
9599 if (new_item)
9600 {
9601 new_item.SetResultOfSplit(true);
9602 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9604 new_item.
SetQuantity(split_quantity_new,
false,
true);
9605 }
9606 }
9607 }
9608 else
9609 {
9610 if (stack_max != 0)
9611 {
9613 {
9615 }
9616
9618 {
9620
9621 if (new_item)
9622 {
9623 new_item.SetResultOfSplit(true);
9624 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9627 new_item.PlaceOnSurface();
9628 }
9629 }
9630 }
9631 }
9632 }
9633
9635 {
9637 {
9638 if (ScriptInputUserData.CanStoreInputUserData())
9639 {
9640 ScriptInputUserData ctx = new ScriptInputUserData;
9645 dst.WriteToContext(ctx);
9647 }
9648 }
9649 else if (!
GetGame().IsMultiplayer())
9650 {
9652 }
9653 }
9654
9656 {
9658 {
9659 if (ScriptInputUserData.CanStoreInputUserData())
9660 {
9661 ScriptInputUserData ctx = new ScriptInputUserData;
9666 ctx.
Write(destination_entity);
9672 }
9673 }
9674 else if (!
GetGame().IsMultiplayer())
9675 {
9677 }
9678 }
9679
9681 {
9683 }
9684
9686 {
9688 float split_quantity_new;
9690 if (dst.IsValid())
9691 {
9692 int slot_id = dst.GetSlot();
9694
9695 if (quantity > stack_max)
9696 split_quantity_new = stack_max;
9697 else
9698 split_quantity_new = quantity;
9699
9701 {
9703
9704 if (new_item)
9705 {
9706 new_item.SetResultOfSplit(true);
9707 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9709 new_item.
SetQuantity(split_quantity_new,
false,
true);
9710 }
9711
9712 return new_item;
9713 }
9714 }
9715
9716 return null;
9717 }
9718
9720 {
9722 float split_quantity_new;
9724 if (destination_entity)
9725 {
9727 if (quantity > stackable)
9728 split_quantity_new = stackable;
9729 else
9730 split_quantity_new = quantity;
9731
9733 {
9734 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9735 if (new_item)
9736 {
9737 new_item.SetResultOfSplit(true);
9738 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9740 new_item.
SetQuantity(split_quantity_new,
false,
true);
9741 }
9742 }
9743 }
9744 }
9745
9747 {
9749 {
9750 if (ScriptInputUserData.CanStoreInputUserData())
9751 {
9752 ScriptInputUserData ctx = new ScriptInputUserData;
9757 ItemBase destination_entity =
this;
9758 ctx.
Write(destination_entity);
9762 }
9763 }
9764 else if (!
GetGame().IsMultiplayer())
9765 {
9767 }
9768 }
9769
9771 {
9773 float split_quantity_new;
9775 if (player)
9776 {
9778 if (quantity > stackable)
9779 split_quantity_new = stackable;
9780 else
9781 split_quantity_new = quantity;
9782
9784 {
9785 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9786 new_item =
ItemBase.Cast(in_hands);
9787 if (new_item)
9788 {
9789 new_item.SetResultOfSplit(true);
9790 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9792 new_item.SetQuantity(split_quantity_new, false, true);
9793 }
9794 }
9795 }
9796 }
9797
9799 {
9801 float split_quantity_new = Math.Floor(quantity * 0.5);
9802
9804 return;
9805
9807
9808 if (new_item)
9809 {
9810 if (new_item.GetQuantityMax() < split_quantity_new)
9811 {
9812 split_quantity_new = new_item.GetQuantityMax();
9813 }
9814
9815 new_item.SetResultOfSplit(true);
9816 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9817
9819 {
9822 }
9823 else
9824 {
9826 new_item.
SetQuantity(split_quantity_new,
false,
true);
9827 }
9828 }
9829 }
9830
9832 {
9834 float split_quantity_new = Math.Floor(quantity / 2);
9835
9837 return;
9838
9839 InventoryLocation invloc = new InventoryLocation;
9841
9843 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9844
9845 if (new_item)
9846 {
9847 if (new_item.GetQuantityMax() < split_quantity_new)
9848 {
9849 split_quantity_new = new_item.GetQuantityMax();
9850 }
9852 {
9855 }
9856 else if (split_quantity_new > 1)
9857 {
9859 new_item.
SetQuantity(split_quantity_new,
false,
true);
9860 }
9861 }
9862 }
9863
9866 {
9867 SetWeightDirty();
9869
9870 if (parent)
9871 parent.OnAttachmentQuantityChangedEx(this, delta);
9872
9874 {
9876 {
9878 }
9880 {
9881 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9883 }
9884 }
9885
9886 }
9887
9890 {
9891
9892 }
9893
9896 {
9898 }
9899
9901 {
9902 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9903
9905 {
9906 if (newLevel == GameConstants.STATE_RUINED)
9907 {
9909 EntityAI parent = GetHierarchyParent();
9910 if (parent && parent.IsFireplace())
9911 {
9912 CargoBase cargo = GetInventory().GetCargo();
9913 if (cargo)
9914 {
9916 {
9918 }
9919 }
9920 }
9921 }
9922
9924 {
9925
9927 return;
9928 }
9929
9930 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9931 {
9933 }
9934 }
9935 }
9936
9937
9939 {
9940 super.OnRightClick();
9941
9943 {
9945 {
9946 if (ScriptInputUserData.CanStoreInputUserData())
9947 {
9948 EntityAI root = GetHierarchyRoot();
9949 Man playerOwner = GetHierarchyRootPlayer();
9950 InventoryLocation dst = new InventoryLocation;
9951
9952
9953 if (!playerOwner && root && root == this)
9954 {
9956 }
9957 else
9958 {
9959
9960 GetInventory().GetCurrentInventoryLocation(dst);
9962 {
9965 {
9967 }
9968 else
9969 {
9971
9972
9973 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9974 {
9976 }
9977 else
9978 {
9979 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9980 }
9981 }
9982 }
9983 }
9984
9985 ScriptInputUserData ctx = new ScriptInputUserData;
9993 }
9994 }
9995 else if (!
GetGame().IsMultiplayer())
9996 {
9998 }
9999 }
10000 }
10001
10003 {
10004 if (root)
10005 {
10006 vector m4[4];
10007 root.GetTransform(m4);
10008 dst.SetGround(this, m4);
10009 }
10010 else
10011 {
10012 GetInventory().GetCurrentInventoryLocation(dst);
10013 }
10014 }
10015
10016 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10017 {
10018
10019 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10020 return false;
10021
10022 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10023 return false;
10024
10025
10027 return false;
10028
10029
10030 Magazine mag = Magazine.Cast(this);
10031 if (mag)
10032 {
10033 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10034 return false;
10035
10036 if (stack_max_limit)
10037 {
10038 Magazine other_mag = Magazine.Cast(other_item);
10039 if (other_item)
10040 {
10041 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10042 return false;
10043 }
10044
10045 }
10046 }
10047 else
10048 {
10049
10051 return false;
10052
10054 return false;
10055 }
10056
10057 PlayerBase player = null;
10058 if (CastTo(player, GetHierarchyRootPlayer()))
10059 {
10060 if (player.GetInventory().HasAttachment(this))
10061 return false;
10062
10063 if (player.IsItemsToDelete())
10064 return false;
10065 }
10066
10067 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10068 return false;
10069
10070 int slotID;
10072 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10073 return false;
10074
10075 return true;
10076 }
10077
10079 {
10081 }
10082
10084 {
10085 return m_IsResultOfSplit;
10086 }
10087
10089 {
10090 m_IsResultOfSplit = value;
10091 }
10092
10094 {
10096 }
10097
10099 {
10100 float other_item_quantity = other_item.GetQuantity();
10101 float this_free_space;
10102
10104
10106
10107 if (other_item_quantity > this_free_space)
10108 {
10109 return this_free_space;
10110 }
10111 else
10112 {
10113 return other_item_quantity;
10114 }
10115 }
10116
10118 {
10120 }
10121
10123 {
10125 return;
10126
10127 if (!IsMagazine() && other_item)
10128 {
10130 if (quantity_used != 0)
10131 {
10132 float hp1 = GetHealth01("","");
10133 float hp2 = other_item.GetHealth01("","");
10134 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10135 hpResult = hpResult / (
GetQuantity() + quantity_used);
10136
10137 hpResult *= GetMaxHealth();
10138 Math.Round(hpResult);
10139 SetHealth("", "Health", hpResult);
10140
10142 other_item.AddQuantity(-quantity_used);
10143 }
10144 }
10146 }
10147
10149 {
10150 #ifdef SERVER
10151 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10152 GetHierarchyParent().IncreaseLifetimeUp();
10153 #endif
10154 };
10155
10157 {
10158 PlayerBase p = PlayerBase.Cast(player);
10159
10160 array<int> recipesIds = p.m_Recipes;
10161 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10162 if (moduleRecipesManager)
10163 {
10164 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10165 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10166 }
10167
10168 for (int i = 0;i < recipesIds.Count(); i++)
10169 {
10170 int key = recipesIds.Get(i);
10171 string recipeName = moduleRecipesManager.GetRecipeName(key);
10173 }
10174 }
10175
10176
10177 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10178 {
10179 super.GetDebugActions(outputList);
10180
10181
10187
10188
10193
10198
10199
10203
10204
10206 {
10210 }
10211
10214
10215
10219
10221
10222 InventoryLocation loc = new InventoryLocation();
10223 GetInventory().GetCurrentInventoryLocation(loc);
10225 {
10226 if (Gizmo_IsSupported())
10229 }
10230
10232 }
10233
10234
10235
10236
10238 {
10239 super.OnAction(action_id, player, ctx);
10240
10242 {
10243 switch (action_id)
10244 {
10247 return true;
10250 return true;
10251 }
10252 }
10253
10255 {
10256 switch (action_id)
10257 {
10259 Delete();
10260 return true;
10261 }
10262 }
10263
10264 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10265 {
10266 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10267 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10268 PlayerBase p = PlayerBase.Cast(player);
10269 if (
EActions.RECIPES_RANGE_START < 1000)
10270 {
10271 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10272 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10273 }
10274 }
10275 #ifndef SERVER
10276 else if (action_id ==
EActions.WATCH_PLAYER)
10277 {
10278 PluginDeveloper.SetDeveloperItemClientEx(player);
10279 }
10280 #endif
10282 {
10283 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10284 {
10285 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10286 OnDebugButtonPressServer(id + 1);
10287 }
10288
10289 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10290 {
10291 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10293 }
10294
10295 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10296 {
10297 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10299 }
10300
10301 else if (action_id ==
EActions.ADD_QUANTITY)
10302 {
10303 if (IsMagazine())
10304 {
10305 Magazine mag = Magazine.Cast(this);
10306 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10307 }
10308 else
10309 {
10311 }
10312
10313 if (m_EM)
10314 {
10315 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10316 }
10317
10318 }
10319
10320 else if (action_id ==
EActions.REMOVE_QUANTITY)
10321 {
10322 if (IsMagazine())
10323 {
10324 Magazine mag2 = Magazine.Cast(this);
10325 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10326 }
10327 else
10328 {
10330 }
10331 if (m_EM)
10332 {
10333 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10334 }
10335
10336 }
10337
10338 else if (action_id ==
EActions.SET_QUANTITY_0)
10339 {
10341
10342 if (m_EM)
10343 {
10344 m_EM.SetEnergy(0);
10345 }
10346 }
10347
10348 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10349 {
10351
10352 if (m_EM)
10353 {
10354 m_EM.SetEnergy(m_EM.GetEnergyMax());
10355 }
10356 }
10357
10358 else if (action_id ==
EActions.ADD_HEALTH)
10359 {
10360 AddHealth("","",GetMaxHealth("","Health")/5);
10361 }
10362 else if (action_id ==
EActions.REMOVE_HEALTH)
10363 {
10364 AddHealth("","",-GetMaxHealth("","Health")/5);
10365 }
10366 else if (action_id ==
EActions.DESTROY_HEALTH)
10367 {
10368 SetHealth01("","",0);
10369 }
10370 else if (action_id ==
EActions.WATCH_ITEM)
10371 {
10373 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10374 #ifdef DEVELOPER
10375 SetDebugDeveloper_item(this);
10376 #endif
10377 }
10378
10379 else if (action_id ==
EActions.ADD_TEMPERATURE)
10380 {
10381 AddTemperature(20);
10382
10383 }
10384
10385 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10386 {
10387 AddTemperature(-20);
10388
10389 }
10390
10391 else if (action_id ==
EActions.FLIP_FROZEN)
10392 {
10393 SetFrozen(!GetIsFrozen());
10394
10395 }
10396
10397 else if (action_id ==
EActions.ADD_WETNESS)
10398 {
10400
10401 }
10402
10403 else if (action_id ==
EActions.REMOVE_WETNESS)
10404 {
10406
10407 }
10408
10409 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10410 {
10413
10414
10415 }
10416
10417 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10418 {
10421 }
10422
10423 else if (action_id ==
EActions.MAKE_SPECIAL)
10424 {
10425 auto debugParams = DebugSpawnParams.WithPlayer(player);
10426 OnDebugSpawnEx(debugParams);
10427 }
10428
10429 }
10430
10431
10432 return false;
10433 }
10434
10435
10436
10437
10441
10444
10445
10446
10448 {
10449 return false;
10450 }
10451
10452
10454 {
10455 return true;
10456 }
10457
10458
10460 {
10461 return true;
10462 }
10463
10464
10465
10467 {
10468 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10470 }
10471
10474 {
10475 return null;
10476 }
10477
10479 {
10480 return false;
10481 }
10482
10484 {
10485 return false;
10486 }
10487
10491
10492
10494 {
10495 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10496 return module_repairing.CanRepair(this, item_repair_kit);
10497 }
10498
10499
10500 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10501 {
10502 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10503 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10504 }
10505
10506
10508 {
10509
10510
10511
10512
10513
10514
10515
10516
10517 return 1;
10518 }
10519
10520
10521
10523 {
10525 }
10526
10527
10528
10530 {
10532 }
10533
10534
10543 {
10544 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10545
10546 if (player)
10547 {
10548 player.MessageStatus(text);
10549 }
10550 }
10551
10552
10561 {
10562 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10563
10564 if (player)
10565 {
10566 player.MessageAction(text);
10567 }
10568 }
10569
10570
10579 {
10580 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10581
10582 if (player)
10583 {
10584 player.MessageFriendly(text);
10585 }
10586 }
10587
10588
10597 {
10598 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10599
10600 if (player)
10601 {
10602 player.MessageImportant(text);
10603 }
10604 }
10605
10607 {
10608 return true;
10609 }
10610
10611
10612 override bool KindOf(
string tag)
10613 {
10614 bool found = false;
10615 string item_name = this.
GetType();
10618
10619 int array_size = item_tag_array.Count();
10620 for (int i = 0; i < array_size; i++)
10621 {
10622 if (item_tag_array.Get(i) == tag)
10623 {
10624 found = true;
10625 break;
10626 }
10627 }
10628 return found;
10629 }
10630
10631
10633 {
10634
10635 super.OnRPC(sender, rpc_type,ctx);
10636
10637
10638 switch (rpc_type)
10639 {
10640 #ifndef SERVER
10641 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10642 Param2<bool, string> p = new Param2<bool, string>(false, "");
10643
10645 return;
10646
10647 bool play = p.param1;
10648 string soundSet = p.param2;
10649
10650 if (play)
10651 {
10653 {
10655 {
10657 }
10658 }
10659 else
10660 {
10662 }
10663 }
10664 else
10665 {
10667 }
10668
10669 break;
10670 #endif
10671
10672 }
10673
10675 {
10677 }
10678 }
10679
10680
10681
10682
10684 {
10685 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10686 return plugin.GetID(
name);
10687 }
10688
10690 {
10691 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10692 return plugin.GetName(id);
10693 }
10694
10697 {
10698
10699
10700 int varFlags;
10701 if (!ctx.
Read(varFlags))
10702 return;
10703
10704 if (varFlags & ItemVariableFlags.FLOAT)
10705 {
10707 }
10708 }
10709
10711 {
10712
10713 super.SerializeNumericalVars(floats_out);
10714
10715
10716
10718 {
10720 }
10721
10723 {
10725 }
10726
10728 {
10730 }
10731
10733 {
10738 }
10739
10741 {
10743 }
10744 }
10745
10747 {
10748
10749 super.DeSerializeNumericalVars(floats);
10750
10751
10752 int index = 0;
10753 int mask = Math.Round(floats.Get(index));
10754
10755 index++;
10756
10758 {
10760 {
10762 }
10763 else
10764 {
10765 float quantity = floats.Get(index);
10766 SetQuantity(quantity,
true,
false,
false,
false);
10767 }
10768 index++;
10769 }
10770
10772 {
10773 float wet = floats.Get(index);
10775 index++;
10776 }
10777
10779 {
10780 int liquidtype = Math.Round(floats.Get(index));
10782 index++;
10783 }
10784
10786 {
10788 index++;
10790 index++;
10792 index++;
10794 index++;
10795 }
10796
10798 {
10799 int cleanness = Math.Round(floats.Get(index));
10801 index++;
10802 }
10803 }
10804
10806 {
10807 super.WriteVarsToCTX(ctx);
10808
10809
10811 {
10813 }
10814
10816 {
10818 }
10819
10821 {
10823 }
10824
10826 {
10827 int r,g,b,a;
10833 }
10834
10836 {
10838 }
10839 }
10840
10842 {
10843 if (!super.ReadVarsFromCTX(ctx,version))
10844 return false;
10845
10846 int intValue;
10847 float value;
10848
10849 if (version < 140)
10850 {
10851 if (!ctx.
Read(intValue))
10852 return false;
10853
10854 m_VariablesMask = intValue;
10855 }
10856
10858 {
10859 if (!ctx.
Read(value))
10860 return false;
10861
10863 {
10865 }
10866 else
10867 {
10869 }
10870 }
10871
10872 if (version < 140)
10873 {
10875 {
10876 if (!ctx.
Read(value))
10877 return false;
10878 SetTemperatureDirect(value);
10879 }
10880 }
10881
10883 {
10884 if (!ctx.
Read(value))
10885 return false;
10887 }
10888
10890 {
10891 if (!ctx.
Read(intValue))
10892 return false;
10894 }
10895
10897 {
10898 int r,g,b,a;
10900 return false;
10902 return false;
10904 return false;
10906 return false;
10907
10909 }
10910
10912 {
10913 if (!ctx.
Read(intValue))
10914 return false;
10916 }
10917
10918 if (version >= 138 && version < 140)
10919 {
10921 {
10922 if (!ctx.
Read(intValue))
10923 return false;
10924 SetFrozen(intValue);
10925 }
10926 }
10927
10928 return true;
10929 }
10930
10931
10933 {
10936 {
10938 }
10939
10940 if (!super.OnStoreLoad(ctx, version))
10941 {
10943 return false;
10944 }
10945
10946 if (version >= 114)
10947 {
10948 bool hasQuickBarIndexSaved;
10949
10950 if (!ctx.
Read(hasQuickBarIndexSaved))
10951 {
10953 return false;
10954 }
10955
10956 if (hasQuickBarIndexSaved)
10957 {
10958 int itmQBIndex;
10959
10960
10961 if (!ctx.
Read(itmQBIndex))
10962 {
10964 return false;
10965 }
10966
10967 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10968 if (itmQBIndex != -1 && parentPlayer)
10969 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10970 }
10971 }
10972 else
10973 {
10974
10975 PlayerBase player;
10976 int itemQBIndex;
10977 if (version ==
int.
MAX)
10978 {
10979 if (!ctx.
Read(itemQBIndex))
10980 {
10982 return false;
10983 }
10984 }
10985 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10986 {
10987
10988 if (!ctx.
Read(itemQBIndex))
10989 {
10991 return false;
10992 }
10993 if (itemQBIndex != -1 && player)
10994 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10995 }
10996 }
10997
10998 if (version < 140)
10999 {
11000
11001 if (!LoadVariables(ctx, version))
11002 {
11004 return false;
11005 }
11006 }
11007
11008
11010 {
11012 return false;
11013 }
11014 if (version >= 132)
11015 {
11017 if (raib)
11018 {
11020 {
11022 return false;
11023 }
11024 }
11025 }
11026
11028 return true;
11029 }
11030
11031
11032
11034 {
11035 super.OnStoreSave(ctx);
11036
11037 PlayerBase player;
11038 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11039 {
11041
11042 int itemQBIndex = -1;
11043 itemQBIndex = player.FindQuickBarEntityIndex(this);
11044 ctx.
Write(itemQBIndex);
11045 }
11046 else
11047 {
11049 }
11050
11052
11054 if (raib)
11055 {
11057 }
11058 }
11059
11060
11062 {
11063 super.AfterStoreLoad();
11064
11066 {
11068 }
11069
11071 {
11074 }
11075 }
11076
11078 {
11079 super.EEOnAfterLoad();
11080
11082 {
11084 }
11085
11088 }
11089
11091 {
11092 return false;
11093 }
11094
11095
11096
11098 {
11100 {
11101 #ifdef PLATFORM_CONSOLE
11102
11104 {
11106 if (menu)
11107 {
11109 }
11110 }
11111 #endif
11112 }
11113
11115 {
11118 }
11119
11121 {
11122 SetWeightDirty();
11124 }
11126 {
11129 }
11130
11132 {
11135 }
11137 {
11140 }
11141
11142 super.OnVariablesSynchronized();
11143 }
11144
11145
11146
11148 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11149 {
11150 if (!IsServerCheck(allow_client))
11151 return false;
11152
11154 return false;
11155
11158
11159 if (value <= (min + 0.001))
11160 value = min;
11161
11162 if (value == min)
11163 {
11164 if (destroy_config)
11165 {
11166 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11167 if (dstr)
11168 {
11170 this.Delete();
11171 return true;
11172 }
11173 }
11174 else if (destroy_forced)
11175 {
11177 this.Delete();
11178 return true;
11179 }
11180
11182 }
11183
11186
11188 {
11190
11191 if (delta)
11193 }
11194
11196
11197 return false;
11198 }
11199
11200
11202 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11203 {
11205 }
11206
11208 {
11211 }
11212
11214 {
11217 }
11218
11220 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11221 {
11222 float value_clamped = Math.Clamp(value, 0, 1);
11224 SetQuantity(result, destroy_config, destroy_forced);
11225 }
11226
11227
11230 {
11232 }
11233
11235 {
11237 }
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11249 {
11250 int slot = -1;
11251 if (GetInventory())
11252 {
11253 InventoryLocation il = new InventoryLocation;
11254 GetInventory().GetCurrentInventoryLocation(il);
11256 }
11257
11259 }
11260
11262 {
11263 float quantity_max = 0;
11264
11266 {
11267 if (attSlotID != -1)
11268 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11269
11270 if (quantity_max <= 0)
11272 }
11273
11274 if (quantity_max <= 0)
11276
11277 return quantity_max;
11278 }
11279
11281 {
11283 }
11284
11286 {
11288 }
11289
11290
11292 {
11294 }
11295
11297 {
11299 }
11300
11302 {
11304 }
11305
11306
11308 {
11309
11310 float weightEx = GetWeightEx();
11311 float special = GetInventoryAndCargoWeight();
11312 return weightEx - special;
11313 }
11314
11315
11317 {
11319 }
11320
11322 {
11324 {
11325 #ifdef DEVELOPER
11326 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11327 {
11328 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11330 }
11331 #endif
11332
11333 return GetQuantity() * GetConfigWeightModified();
11334 }
11335 else if (HasEnergyManager())
11336 {
11337 #ifdef DEVELOPER
11338 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11339 {
11340 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11341 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11342 }
11343 #endif
11344 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11345 }
11346 else
11347 {
11348 #ifdef DEVELOPER
11349 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11350 {
11351 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11352 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11353 }
11354 #endif
11355 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11356 }
11357 }
11358
11361 {
11362 int item_count = 0;
11364
11365 if (GetInventory().GetCargo() != NULL)
11366 {
11367 item_count = GetInventory().GetCargo().GetItemCount();
11368 }
11369
11370 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11371 {
11372 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11373 if (item)
11374 item_count += item.GetNumberOfItems();
11375 }
11376 return item_count;
11377 }
11378
11381 {
11382 float weight = 0;
11383 float wetness = 1;
11384 if (include_wetness)
11387 {
11388 weight = wetness * m_ConfigWeight;
11389 }
11391 {
11392 weight = 1;
11393 }
11394 return weight;
11395 }
11396
11397
11398
11400 {
11401 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11402 {
11403 GameInventory inv = GetInventory();
11404 array<EntityAI> items = new array<EntityAI>;
11406 for (int i = 0; i < items.Count(); i++)
11407 {
11409 if (item)
11410 {
11412 }
11413 }
11414 }
11415 }
11416
11417
11418
11419
11421 {
11422 float energy = 0;
11423 if (HasEnergyManager())
11424 {
11425 energy = GetCompEM().GetEnergy();
11426 }
11427 return energy;
11428 }
11429
11430
11432 {
11433 super.OnEnergyConsumed();
11434
11436 }
11437
11439 {
11440 super.OnEnergyAdded();
11441
11443 }
11444
11445
11447 {
11448 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11449 {
11451 {
11452 float energy_0to1 = GetCompEM().GetEnergy0To1();
11454 }
11455 }
11456 }
11457
11458
11460 {
11461 return ConfigGetFloat("heatIsolation");
11462 }
11463
11465 {
11467 }
11468
11470 {
11471 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11472 if (
GetGame().ConfigIsExisting(paramPath))
11474
11475 return 0.0;
11476 }
11477
11479 {
11480 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11481 if (
GetGame().ConfigIsExisting(paramPath))
11483
11484 return 0.0;
11485 }
11486
11487 override void SetWet(
float value,
bool allow_client =
false)
11488 {
11489 if (!IsServerCheck(allow_client))
11490 return;
11491
11494
11496
11497 m_VarWet = Math.Clamp(value, min, max);
11498
11500 {
11503 }
11504 }
11505
11506 override void AddWet(
float value)
11507 {
11509 }
11510
11512 {
11514 }
11515
11517 {
11519 }
11520
11522 {
11524 }
11525
11527 {
11529 }
11530
11532 {
11534 }
11535
11536 override void OnWetChanged(
float newVal,
float oldVal)
11537 {
11540 if (newLevel != oldLevel)
11541 {
11543 }
11544 }
11545
11547 {
11548 SetWeightDirty();
11549 }
11550
11552 {
11553 return GetWetLevelInternal(
m_VarWet);
11554 }
11555
11556
11557
11559 {
11561 }
11562
11564 {
11566 }
11567
11569 {
11571 }
11572
11574 {
11576 }
11577
11578
11579
11581 {
11582 if (ConfigIsExisting("itemModelLength"))
11583 {
11584 return ConfigGetFloat("itemModelLength");
11585 }
11586 return 0;
11587 }
11588
11590 {
11591 if (ConfigIsExisting("itemAttachOffset"))
11592 {
11593 return ConfigGetFloat("itemAttachOffset");
11594 }
11595 return 0;
11596 }
11597
11598 override void SetCleanness(
int value,
bool allow_client =
false)
11599 {
11600 if (!IsServerCheck(allow_client))
11601 return;
11602
11604
11606
11609 }
11610
11612 {
11614 }
11615
11617 {
11618 return true;
11619 }
11620
11621
11622
11623
11625 {
11627 }
11628
11630 {
11632 }
11633
11634
11635
11636
11637 override void SetColor(
int r,
int g,
int b,
int a)
11638 {
11644 }
11646 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11647 {
11652 }
11653
11655 {
11657 }
11658
11661 {
11662 int r,g,b,a;
11664 r = r/255;
11665 g = g/255;
11666 b = b/255;
11667 a = a/255;
11668 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11669 }
11670
11671
11672
11673 override void SetLiquidType(
int value,
bool allow_client =
false)
11674 {
11675 if (!IsServerCheck(allow_client))
11676 return;
11677
11682 }
11683
11685 {
11686 return ConfigGetInt("varLiquidTypeInit");
11687 }
11688
11690 {
11692 }
11693
11695 {
11697 SetFrozen(false);
11698 }
11699
11702 {
11703 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11704 }
11705
11706
11709 {
11710 PlayerBase nplayer;
11711 if (PlayerBase.CastTo(nplayer, player))
11712 {
11714
11715 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11716 }
11717 }
11718
11719
11722 {
11723 PlayerBase nplayer;
11724 if (PlayerBase.CastTo(nplayer,player))
11725 {
11726
11727 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11728
11729 }
11730
11731
11732 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11733
11734
11735 if (HasEnergyManager())
11736 {
11737 GetCompEM().UpdatePlugState();
11738 }
11739 }
11740
11741
11743 {
11744 super.OnPlacementStarted(player);
11745
11747 }
11748
11749 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11750 {
11752 {
11753 m_AdminLog.OnPlacementComplete(player,
this);
11754 }
11755
11756 super.OnPlacementComplete(player, position, orientation);
11757 }
11758
11759
11760
11761
11762
11764 {
11766 {
11767 return true;
11768 }
11769 else
11770 {
11771 return false;
11772 }
11773 }
11774
11775
11777 {
11779 {
11781 }
11782 }
11783
11784
11786 {
11788 }
11789
11791 {
11793 }
11794
11795 override void InsertAgent(
int agent,
float count = 1)
11796 {
11797 if (count < 1)
11798 return;
11799
11801 }
11802
11805 {
11807 }
11808
11809
11811 {
11813 }
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11857 {
11859 return false;
11860 return true;
11861 }
11862
11864 {
11865
11867 }
11868
11869
11872 {
11873 super.CheckForRoofLimited(timeTresholdMS);
11874
11876 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11877 {
11878 m_PreviousRoofTestTime = time;
11879 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11880 }
11881 }
11882
11883
11885 {
11887 {
11888 return 0;
11889 }
11890
11891 if (GetInventory().GetAttachmentSlotsCount() != 0)
11892 {
11893 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11894 if (filter)
11895 return filter.GetProtectionLevel(type, false, system);
11896 else
11897 return 0;
11898 }
11899
11900 string subclassPath, entryName;
11901
11902 switch (type)
11903 {
11905 entryName = "biological";
11906 break;
11908 entryName = "chemical";
11909 break;
11910 default:
11911 entryName = "biological";
11912 break;
11913 }
11914
11915 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11916
11918 }
11919
11920
11921
11924 {
11925 if (!IsMagazine())
11927
11929 }
11930
11931
11932
11933
11934
11939 {
11940 return true;
11941 }
11942
11944 {
11946 }
11947
11948
11949
11950
11951
11953 {
11954 if (parent)
11955 {
11956 if (parent.IsInherited(DayZInfected))
11957 return true;
11958
11959 if (!parent.IsRuined())
11960 return true;
11961 }
11962
11963 return true;
11964 }
11965
11967 {
11968 if (!super.CanPutAsAttachment(parent))
11969 {
11970 return false;
11971 }
11972
11973 if (!IsRuined() && !parent.IsRuined())
11974 {
11975 return true;
11976 }
11977
11978 return false;
11979 }
11980
11982 {
11983
11984
11985
11986
11987 return super.CanReceiveItemIntoCargo(item);
11988 }
11989
11991 {
11992
11993
11994
11995
11996 GameInventory attachmentInv = attachment.GetInventory();
11998 {
11999 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12000 return false;
12001 }
12002
12003 InventoryLocation loc = new InventoryLocation();
12004 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12005 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12006 return false;
12007
12008 return super.CanReceiveAttachment(attachment, slotId);
12009 }
12010
12012 {
12013 if (!super.CanReleaseAttachment(attachment))
12014 return false;
12015
12016 return GetInventory().AreChildrenAccessible();
12017 }
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12040 {
12041 int id = muzzle_owner.GetMuzzleID();
12042 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12043
12044 if (WPOF_array)
12045 {
12046 for (int i = 0; i < WPOF_array.Count(); i++)
12047 {
12048 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12049
12050 if (WPOF)
12051 {
12052 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12053 }
12054 }
12055 }
12056 }
12057
12058
12060 {
12061 int id = muzzle_owner.GetMuzzleID();
12063
12064 if (WPOBE_array)
12065 {
12066 for (int i = 0; i < WPOBE_array.Count(); i++)
12067 {
12068 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12069
12070 if (WPOBE)
12071 {
12072 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12073 }
12074 }
12075 }
12076 }
12077
12078
12080 {
12081 int id = muzzle_owner.GetMuzzleID();
12082 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12083
12084 if (WPOOH_array)
12085 {
12086 for (int i = 0; i < WPOOH_array.Count(); i++)
12087 {
12088 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12089
12090 if (WPOOH)
12091 {
12092 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12093 }
12094 }
12095 }
12096 }
12097
12098
12100 {
12101 int id = muzzle_owner.GetMuzzleID();
12102 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12103
12104 if (WPOOH_array)
12105 {
12106 for (int i = 0; i < WPOOH_array.Count(); i++)
12107 {
12108 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12109
12110 if (WPOOH)
12111 {
12112 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12113 }
12114 }
12115 }
12116 }
12117
12118
12120 {
12121 int id = muzzle_owner.GetMuzzleID();
12122 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12123
12124 if (WPOOH_array)
12125 {
12126 for (int i = 0; i < WPOOH_array.Count(); i++)
12127 {
12128 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12129
12130 if (WPOOH)
12131 {
12132 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12133 }
12134 }
12135 }
12136 }
12137
12138
12139
12141 {
12143 {
12144 return true;
12145 }
12146
12147 return false;
12148 }
12149
12151 {
12153 {
12154 return true;
12155 }
12156
12157 return false;
12158 }
12159
12161 {
12163 {
12164 return true;
12165 }
12166
12167 return false;
12168 }
12169
12171 {
12172 return false;
12173 }
12174
12177 {
12178 return UATimeSpent.DEFAULT_DEPLOY;
12179 }
12180
12181
12182
12183
12185 {
12187 SetSynchDirty();
12188 }
12189
12191 {
12193 }
12194
12195
12197 {
12198 return false;
12199 }
12200
12203 {
12204 string att_type = "None";
12205
12206 if (ConfigIsExisting("soundAttType"))
12207 {
12208 att_type = ConfigGetString("soundAttType");
12209 }
12210
12212 }
12213
12215 {
12217 }
12218
12219
12220
12221
12222
12228
12230 {
12233
12235 }
12236
12237
12239 {
12241 return;
12242
12244
12247
12250
12251 SoundParameters params = new SoundParameters();
12255 }
12256
12257
12259 {
12261 return;
12262
12264 SetSynchDirty();
12265
12268 }
12269
12270
12272 {
12274 return;
12275
12277 SetSynchDirty();
12278
12281 }
12282
12284 {
12286 }
12287
12289 {
12291 }
12292
12295 {
12296 if (!
GetGame().IsDedicatedServer())
12297 {
12298 if (ConfigIsExisting("attachSoundSet"))
12299 {
12300 string cfg_path = "";
12301 string soundset = "";
12302 string type_name =
GetType();
12303
12306 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12307 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12308
12309 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12310 {
12311 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12312 {
12313 if (cfg_slot_array[i] == slot_type)
12314 {
12315 soundset = cfg_soundset_array[i];
12316 break;
12317 }
12318 }
12319 }
12320
12321 if (soundset != "")
12322 {
12323 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12325 }
12326 }
12327 }
12328 }
12329
12331 {
12332
12333 }
12334
12335 void OnApply(PlayerBase player);
12336
12338 {
12339 return 1.0;
12340 };
12341
12343 {
12345 }
12346
12348 {
12350 }
12351
12353
12355 {
12356 SetDynamicPhysicsLifeTime(0.01);
12358 }
12359
12361 {
12362 array<string> zone_names = new array<string>;
12363 GetDamageZones(zone_names);
12364 for (int i = 0; i < zone_names.Count(); i++)
12365 {
12366 SetHealthMax(zone_names.Get(i),"Health");
12367 }
12368 SetHealthMax("","Health");
12369 }
12370
12373 {
12374 float global_health = GetHealth01("","Health");
12375 array<string> zones = new array<string>;
12376 GetDamageZones(zones);
12377
12378 for (int i = 0; i < zones.Count(); i++)
12379 {
12380 SetHealth01(zones.Get(i),"Health",global_health);
12381 }
12382 }
12383
12386 {
12387 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12388 }
12389
12391 {
12392 if (!hasRootAsPlayer)
12393 {
12394 if (refParentIB)
12395 {
12396
12397 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12398 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12399
12400 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12401 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12402
12405 }
12406 else
12407 {
12408
12411 }
12412 }
12413 }
12414
12416 {
12418 {
12419 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12420 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12421 {
12422 float heatPermCoef = 1.0;
12424 while (ent)
12425 {
12426 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12427 ent = ent.GetHierarchyParent();
12428 }
12429
12430 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12431 }
12432 }
12433 }
12434
12436 {
12437
12438 EntityAI parent = GetHierarchyParent();
12439 if (!parent)
12440 {
12441 hasParent = false;
12442 hasRootAsPlayer = false;
12443 }
12444 else
12445 {
12446 hasParent = true;
12447 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12448 refParentIB =
ItemBase.Cast(parent);
12449 }
12450 }
12451
12452 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12453 {
12454
12455 }
12456
12458 {
12459
12460 return false;
12461 }
12462
12464 {
12465
12466
12467 return false;
12468 }
12469
12471 {
12472
12473 return false;
12474 }
12475
12478 {
12479 return !GetIsFrozen() &&
IsOpen();
12480 }
12481
12483 {
12484 bool hasParent = false, hasRootAsPlayer = false;
12486
12487 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12488 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12489
12490 if (wwtu || foodDecay)
12491 {
12495
12496 if (processWetness || processTemperature || processDecay)
12497 {
12499
12500 if (processWetness)
12501 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12502
12503 if (processTemperature)
12505
12506 if (processDecay)
12507 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12508 }
12509 }
12510 }
12511
12514 {
12516 }
12517
12519 {
12522
12523 return super.GetTemperatureFreezeThreshold();
12524 }
12525
12527 {
12530
12531 return super.GetTemperatureThawThreshold();
12532 }
12533
12535 {
12538
12539 return super.GetItemOverheatThreshold();
12540 }
12541
12543 {
12545 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12546
12547 return super.GetTemperatureFreezeTime();
12548 }
12549
12551 {
12553 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12554
12555 return super.GetTemperatureThawTime();
12556 }
12557
12562
12564 {
12565 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12566 }
12567
12569 {
12570 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12571 }
12572
12575 {
12577 }
12578
12580 {
12582 }
12583
12585 {
12587 }
12588
12591 {
12592 return null;
12593 }
12594
12597 {
12598 return false;
12599 }
12600
12602 {
12604 {
12607 if (!trg)
12608 {
12610 explosive = this;
12611 }
12612
12613 explosive.PairRemote(trg);
12615
12616 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12617 trg.SetPersistentPairID(persistentID);
12618 explosive.SetPersistentPairID(persistentID);
12619
12620 return true;
12621 }
12622 return false;
12623 }
12624
12627 {
12628 float ret = 1.0;
12631 ret *= GetHealth01();
12632
12633 return ret;
12634 }
12635
12636 #ifdef DEVELOPER
12637 override void SetDebugItem()
12638 {
12639 super.SetDebugItem();
12640 _itemBase = this;
12641 }
12642
12644 {
12645 string text = super.GetDebugText();
12646
12648 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12649
12650 return text;
12651 }
12652 #endif
12653
12655 {
12656 return true;
12657 }
12658
12660
12662
12664 {
12667 }
12668
12669
12677
12693}
12694
12696{
12698 if (entity)
12699 {
12700 bool is_item = entity.IsInherited(
ItemBase);
12701 if (is_item && full_quantity)
12702 {
12705 }
12706 }
12707 else
12708 {
12710 return NULL;
12711 }
12712 return entity;
12713}
12714
12716{
12717 if (item)
12718 {
12719 if (health > 0)
12720 item.SetHealth("", "", health);
12721
12722 if (item.CanHaveTemperature())
12723 {
12725 if (item.CanFreeze())
12726 item.SetFrozen(false);
12727 }
12728
12729 if (item.HasEnergyManager())
12730 {
12731 if (quantity >= 0)
12732 {
12733 item.GetCompEM().SetEnergy0To1(quantity);
12734 }
12735 else
12736 {
12738 }
12739 }
12740 else if (item.IsMagazine())
12741 {
12742 Magazine mag = Magazine.Cast(item);
12743 if (quantity >= 0)
12744 {
12745 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12746 }
12747 else
12748 {
12750 }
12751
12752 }
12753 else
12754 {
12755 if (quantity >= 0)
12756 {
12757 item.SetQuantityNormalized(quantity, false);
12758 }
12759 else
12760 {
12762 }
12763
12764 }
12765 }
12766}
12767
12768#ifdef DEVELOPER
12770#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.