Set item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity reaches varQuantityMin or lower and the item config contains the varQuantityDestroyOnMin = true entry, the item gets destroyed. destroy_forced = true means item gets destroyed when quantity reaches varQuantityMin or lower regardless of config setting, returns true if the item gets deleted.
8010{
8012 {
8013 return true;
8014 }
8015};
8016
8017
8018
8020{
8024
8026
8029
8030
8031
8032
8033
8042
8048
8053
8058
8079 protected bool m_IsResultOfSplit
8080
8082
8087
8088
8089
8091
8095
8096
8097
8099
8102
8103
8104
8110
8111
8119
8122
8123
8125
8126
8128
8129
8134
8135
8140
8141
8143
8144
8146 {
8151
8152 if (!
GetGame().IsDedicatedServer())
8153 {
8155 {
8157
8159 {
8161 }
8162 }
8163
8166 }
8167
8168 m_OldLocation = null;
8169
8171 {
8173 }
8174
8175 if (ConfigIsExisting("headSelectionsToHide"))
8176 {
8179 }
8180
8182 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8183 {
8185 }
8186
8188
8189 m_IsResultOfSplit = false;
8190
8192 }
8193
8195 {
8196 super.InitItemVariables();
8197
8203 m_Count = ConfigGetInt(
"count");
8204
8207
8212
8215
8220
8232
8236
8237
8240 if (ConfigIsExisting("canBeSplit"))
8241 {
8244 }
8245
8247 if (ConfigIsExisting("itemBehaviour"))
8249
8250
8253 RegisterNetSyncVariableInt("m_VarLiquidType");
8254 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8255
8256 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8257 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8258 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8259
8260 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8261 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8262 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8263 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8264
8265 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8266 RegisterNetSyncVariableBool("m_IsTakeable");
8267 RegisterNetSyncVariableBool("m_IsHologram");
8268
8271 {
8274 }
8275
8277
8279 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8281
8282 }
8283
8285 {
8287 }
8288
8290 {
8293 {
8298 }
8299 }
8300
8301 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8302 {
8304 {
8307 }
8308
8310 }
8311
8313 {
8319 }
8320
8322
8324 {
8326
8327 if (!action)
8328 {
8329 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8330 return;
8331 }
8332
8334 if (!ai)
8335 {
8337 return;
8338 }
8339
8341 if (!action_array)
8342 {
8343 action_array = new array<ActionBase_Basic>;
8345 }
8346 if (LogManager.IsActionLogEnable())
8347 {
8348 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8349 }
8350
8351 if (action_array.Find(action) != -1)
8352 {
8353 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8354 }
8355 else
8356 {
8357 action_array.Insert(action);
8358 }
8359 }
8360
8362 {
8364 ActionBase action = player.GetActionManager().GetAction(actionName);
8367
8368 if (action_array)
8369 {
8370 action_array.RemoveItem(action);
8371 }
8372 }
8373
8374
8375
8377 {
8378 ActionOverrideData overrideData = new ActionOverrideData();
8382
8384 if (!actionMap)
8385 {
8388 }
8389
8390 actionMap.Insert(this.
Type(), overrideData);
8391
8392 }
8393
8395
8397
8398
8400 {
8403
8406
8407 string config_to_search = "CfgVehicles";
8408 string muzzle_owner_config;
8409
8411 {
8412 if (IsInherited(Weapon))
8413 config_to_search = "CfgWeapons";
8414
8415 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8416
8417 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8418
8420
8421 if (config_OnFire_subclass_count > 0)
8422 {
8423 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8424
8425 for (int i = 0; i < config_OnFire_subclass_count; i++)
8426 {
8427 string particle_class = "";
8429 string config_OnFire_entry = config_OnFire_class + particle_class;
8430 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8431 WPOF_array.Insert(WPOF);
8432 }
8433
8434
8436 }
8437 }
8438
8440 {
8441 config_to_search = "CfgWeapons";
8442 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8443
8444 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8445
8447
8448 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8449 {
8450 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8451
8452 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8453 {
8454 string particle_class2 = "";
8456 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8457 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8458 WPOBE_array.Insert(WPOBE);
8459 }
8460
8461
8463 }
8464 }
8465 }
8466
8467
8469 {
8472
8474 {
8475 string config_to_search = "CfgVehicles";
8476
8477 if (IsInherited(Weapon))
8478 config_to_search = "CfgWeapons";
8479
8480 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8481 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8482
8483 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8484 {
8485
8487
8489 {
8491 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8493 return;
8494 }
8495
8498
8499
8500
8502 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8503
8504 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8505 {
8506 string particle_class = "";
8508 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8510
8511 if (entry_type == CT_CLASS)
8512 {
8513 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8514 WPOOH_array.Insert(WPOF);
8515 }
8516 }
8517
8518
8520 }
8521 }
8522 }
8523
8525 {
8527 }
8528
8530 {
8532 {
8534
8537
8540
8541 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8542 }
8543 }
8544
8546 {
8548 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8549
8551 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8552
8554 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8555
8557 {
8559 }
8560 }
8561
8563 {
8565 }
8566
8568 {
8571 else
8573
8575 {
8578 }
8579 else
8580 {
8583
8586 }
8587
8589 }
8590
8592 {
8594 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8595 }
8596
8598 {
8600 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8602 }
8603
8605 {
8607 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8608 }
8609
8611 {
8614
8615 OverheatingParticle OP = new OverheatingParticle();
8620
8622 }
8623
8625 {
8628
8629 return -1;
8630 }
8631
8633 {
8635 {
8638
8639 for (int i = count; i > 0; --i)
8640 {
8641 int id = i - 1;
8644
8647
8648 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8649 {
8650 if (p)
8651 {
8654 }
8655 }
8656 }
8657 }
8658 }
8659
8661 {
8663 {
8665 {
8666 int id = i - 1;
8668
8669 if (OP)
8670 {
8672
8673 if (p)
8674 {
8676 }
8677
8678 delete OP;
8679 }
8680 }
8681
8684 }
8685 }
8686
8689 {
8690 return 0.0;
8691 }
8692
8693
8695 {
8696 return 250;
8697 }
8698
8700 {
8701 return 0;
8702 }
8703
8706 {
8708 return true;
8709
8710 return false;
8711 }
8712
8715 {
8718
8720 {
8722 }
8723 else
8724 {
8725
8727 }
8728
8730 }
8731
8738 {
8739 return -1;
8740 }
8741
8742
8743
8744
8746 {
8748 {
8750 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8751
8752 if (r_index >= 0)
8753 {
8754 InventoryLocation r_il = new InventoryLocation;
8755 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8756
8757 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8760 {
8761 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8762 }
8764 {
8765 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8766 }
8767
8768 }
8769
8770 player.GetHumanInventory().ClearUserReservedLocation(this);
8771 }
8772
8775 }
8776
8777
8778
8779
8781 {
8782 return ItemBase.m_DebugActionsMask;
8783 }
8784
8786 {
8787 return ItemBase.m_DebugActionsMask & mask;
8788 }
8789
8791 {
8792 ItemBase.m_DebugActionsMask = mask;
8793 }
8794
8796 {
8797 ItemBase.m_DebugActionsMask |= mask;
8798 }
8799
8801 {
8802 ItemBase.m_DebugActionsMask &= ~mask;
8803 }
8804
8806 {
8808 {
8810 }
8811 else
8812 {
8814 }
8815 }
8816
8817
8819 {
8820 if (GetEconomyProfile())
8821 {
8822 float q_max = GetEconomyProfile().GetQuantityMax();
8823 if (q_max > 0)
8824 {
8825 float q_min = GetEconomyProfile().GetQuantityMin();
8826 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8827
8829 {
8830 ComponentEnergyManager comp = GetCompEM();
8832 {
8834 }
8835 }
8837 {
8839
8840 }
8841
8842 }
8843 }
8844 }
8845
8848 {
8849 EntityAI parent = GetHierarchyParent();
8850
8851 if (parent)
8852 {
8853 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8854 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8855 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8856 }
8857 }
8858
8861 {
8862 EntityAI parent = GetHierarchyParent();
8863
8864 if (parent)
8865 {
8866 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8867 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8868 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8869 }
8870 }
8871
8873 {
8874
8875
8876
8877
8879
8881 {
8882 if (ScriptInputUserData.CanStoreInputUserData())
8883 {
8884 ScriptInputUserData ctx = new ScriptInputUserData;
8890 ctx.
Write(use_stack_max);
8893
8895 {
8896 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8897 }
8898 }
8899 }
8900 else if (!
GetGame().IsMultiplayer())
8901 {
8903 }
8904 }
8905
8907 {
8909 }
8910
8912 {
8914 }
8915
8917 {
8919 }
8920
8922 {
8923
8924 return false;
8925 }
8926
8928 {
8929 return false;
8930 }
8931
8935 {
8936 return false;
8937 }
8938
8940 {
8941 return "";
8942 }
8943
8945
8947 {
8948 return false;
8949 }
8950
8952 {
8953 return true;
8954 }
8955
8956
8957
8959 {
8960 return true;
8961 }
8962
8964 {
8965 return true;
8966 }
8967
8969 {
8970 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8972 }
8973
8975 {
8977 }
8978
8980 {
8982 if (!is_being_placed)
8984 SetSynchDirty();
8985 }
8986
8987
8989
8991 {
8993 }
8994
8996 {
8998 }
8999
9001 {
9002 return 1;
9003 }
9004
9006 {
9007 return false;
9008 }
9009
9011 {
9013 SetSynchDirty();
9014 }
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9051 {
9052 super.OnMovedInsideCargo(container);
9053
9054 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9055 }
9056
9057 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9058 {
9059 super.EEItemLocationChanged(oldLoc,newLoc);
9060
9061 PlayerBase new_player = null;
9062 PlayerBase old_player = null;
9063
9064 if (newLoc.GetParent())
9065 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9066
9067 if (oldLoc.GetParent())
9068 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9069
9071 {
9072 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9073
9074 if (r_index >= 0)
9075 {
9076 InventoryLocation r_il = new InventoryLocation;
9077 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9078
9079 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9082 {
9083 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9084 }
9086 {
9087 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9088 }
9089
9090 }
9091 }
9092
9094 {
9095 if (new_player)
9096 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9097
9098 if (new_player == old_player)
9099 {
9100
9101 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9102 {
9104 {
9105 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9106 {
9107 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9108 }
9109 }
9110 else
9111 {
9112 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9113 }
9114 }
9115
9116 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9117 {
9118 int type = oldLoc.GetType();
9120 {
9121 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9122 }
9124 {
9125 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9126 }
9127 }
9128 if (!m_OldLocation)
9129 {
9130 m_OldLocation = new InventoryLocation;
9131 }
9132 m_OldLocation.Copy(oldLoc);
9133 }
9134 else
9135 {
9136 if (m_OldLocation)
9137 {
9138 m_OldLocation.Reset();
9139 }
9140 }
9141
9143 }
9144 else
9145 {
9146 if (new_player)
9147 {
9148 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9149 if (res_index >= 0)
9150 {
9151 InventoryLocation il = new InventoryLocation;
9152 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9154 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9157 {
9158 il.
GetParent().GetOnReleaseLock().Invoke(it);
9159 }
9161 {
9163 }
9164
9165 }
9166 }
9168 {
9169
9171 }
9172
9173 if (m_OldLocation)
9174 {
9175 m_OldLocation.Reset();
9176 }
9177 }
9178 }
9179
9180 override void EOnContact(IEntity other, Contact extra)
9181 {
9183 {
9184 int liquidType = -1;
9186 if (impactSpeed > 0.0)
9187 {
9189 #ifndef SERVER
9191 #else
9193 SetSynchDirty();
9194 #endif
9196 }
9197 }
9198
9199 #ifdef SERVER
9200 if (GetCompEM() && GetCompEM().IsPlugged())
9201 {
9202 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9203 GetCompEM().UnplugThis();
9204 }
9205 #endif
9206 }
9207
9209
9211 {
9213 }
9214
9216 {
9217
9218 }
9219
9221 {
9222 super.OnItemLocationChanged(old_owner, new_owner);
9223
9224 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9225 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9226
9227 if (!relatedPlayer && playerNew)
9228 relatedPlayer = playerNew;
9229
9230 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9231 {
9233 if (actionMgr)
9234 {
9235 ActionBase currentAction = actionMgr.GetRunningAction();
9236 if (currentAction)
9238 }
9239 }
9240
9241 Man ownerPlayerOld = null;
9242 Man ownerPlayerNew = null;
9243
9244 if (old_owner)
9245 {
9246 if (old_owner.
IsMan())
9247 {
9248 ownerPlayerOld = Man.Cast(old_owner);
9249 }
9250 else
9251 {
9252 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9253 }
9254 }
9255 else
9256 {
9258 {
9260
9261 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9262 {
9263 GetCompEM().UnplugThis();
9264 }
9265 }
9266 }
9267
9268 if (new_owner)
9269 {
9270 if (new_owner.
IsMan())
9271 {
9272 ownerPlayerNew = Man.Cast(new_owner);
9273 }
9274 else
9275 {
9276 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9277 }
9278 }
9279
9280 if (ownerPlayerOld != ownerPlayerNew)
9281 {
9282 if (ownerPlayerOld)
9283 {
9284 array<EntityAI> subItemsExit = new array<EntityAI>;
9286 for (int i = 0; i < subItemsExit.Count(); i++)
9287 {
9290 }
9291 }
9292
9293 if (ownerPlayerNew)
9294 {
9295 array<EntityAI> subItemsEnter = new array<EntityAI>;
9297 for (int j = 0; j < subItemsEnter.Count(); j++)
9298 {
9301 }
9302 }
9303 }
9304 else if (ownerPlayerNew != null)
9305 {
9306 PlayerBase nplayer;
9307 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9308 {
9309 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9311 for (int k = 0; k < subItemsUpdate.Count(); k++)
9312 {
9314 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9315 }
9316 }
9317 }
9318
9319 if (old_owner)
9320 old_owner.OnChildItemRemoved(this);
9321 if (new_owner)
9322 new_owner.OnChildItemReceived(this);
9323 }
9324
9325
9327 {
9328 super.EEDelete(parent);
9329 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9330 if (player)
9331 {
9333
9334 if (player.IsAlive())
9335 {
9336 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9337 if (r_index >= 0)
9338 {
9339 InventoryLocation r_il = new InventoryLocation;
9340 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9341
9342 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9345 {
9346 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9347 }
9349 {
9350 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9351 }
9352
9353 }
9354
9355 player.RemoveQuickBarEntityShortcut(this);
9356 }
9357 }
9358 }
9359
9361 {
9362 super.EEKilled(killer);
9363
9366 {
9367 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9368 {
9369 if (IsMagazine())
9370 {
9371 if (Magazine.Cast(this).GetAmmoCount() > 0)
9372 {
9374 }
9375 }
9376 else
9377 {
9379 }
9380 }
9381 }
9382 }
9383
9385 {
9386 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9387
9388 super.OnWasAttached(parent, slot_id);
9389
9392
9394 }
9395
9397 {
9398 super.OnWasDetached(parent, slot_id);
9399
9402 }
9403
9405 {
9406 int idx;
9409
9410 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9411 if (inventory_slots.Count() < 1)
9412 {
9413 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9414 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9415 }
9416 else
9417 {
9418 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9419 }
9420
9421 idx = inventory_slots.Find(slot);
9422 if (idx < 0)
9423 return "";
9424
9425 return attach_types.Get(idx);
9426 }
9427
9429 {
9430 int idx = -1;
9431 string slot;
9432
9435
9436 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9437 if (inventory_slots.Count() < 1)
9438 {
9439 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9440 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9441 }
9442 else
9443 {
9444 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9445 if (detach_types.Count() < 1)
9446 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9447 }
9448
9449 for (int i = 0; i < inventory_slots.Count(); i++)
9450 {
9451 slot = inventory_slots.Get(i);
9452 }
9453
9454 if (slot != "")
9455 {
9456 if (detach_types.Count() == 1)
9457 idx = 0;
9458 else
9459 idx = inventory_slots.Find(slot);
9460 }
9461 if (idx < 0)
9462 return "";
9463
9464 return detach_types.Get(idx);
9465 }
9466
9468 {
9469
9471
9472
9473 float min_time = 1;
9474 float max_time = 3;
9475 float delay = Math.RandomFloat(min_time, max_time);
9476
9477 explode_timer.Run(delay, this, "DoAmmoExplosion");
9478 }
9479
9481 {
9482 Magazine magazine = Magazine.Cast(this);
9483 int pop_sounds_count = 6;
9484 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9485
9486
9487 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9488 string sound_name = pop_sounds[ sound_idx ];
9490
9491
9492 magazine.ServerAddAmmoCount(-1);
9493
9494
9495 float min_temp_to_explode = 100;
9496
9497 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9498 {
9500 }
9501 }
9502
9503
9504 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9505 {
9506 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9507
9508 const int CHANCE_DAMAGE_CARGO = 4;
9509 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9510 const int CHANCE_DAMAGE_NOTHING = 2;
9511
9513 {
9514 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9515 int chances;
9516 int rnd;
9517
9518 if (GetInventory().GetCargo())
9519 {
9520 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9521 rnd = Math.RandomInt(0,chances);
9522
9523 if (rnd < CHANCE_DAMAGE_CARGO)
9524 {
9526 }
9527 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9528 {
9530 }
9531 }
9532 else
9533 {
9534 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9535 rnd = Math.RandomInt(0,chances);
9536
9537 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9538 {
9540 }
9541 }
9542 }
9543 }
9544
9546 {
9547 if (GetInventory().GetCargo())
9548 {
9549 int item_count = GetInventory().GetCargo().GetItemCount();
9550 if (item_count > 0)
9551 {
9552 int random_pick = Math.RandomInt(0, item_count);
9554 if (!item.IsExplosive())
9555 {
9556 item.AddHealth("","",damage);
9557 return true;
9558 }
9559 }
9560 }
9561 return false;
9562 }
9563
9565 {
9566 int attachment_count = GetInventory().AttachmentCount();
9567 if (attachment_count > 0)
9568 {
9569 int random_pick = Math.RandomInt(0, attachment_count);
9570 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9571 if (!attachment.IsExplosive())
9572 {
9573 attachment.AddHealth("","",damage);
9574 return true;
9575 }
9576 }
9577 return false;
9578 }
9579
9581 {
9583 }
9584
9586 {
9588 return GetInventory().CanRemoveEntity();
9589
9590 return false;
9591 }
9592
9594 {
9596 return;
9597
9599 {
9600 if (ScriptInputUserData.CanStoreInputUserData())
9601 {
9602 ScriptInputUserData ctx = new ScriptInputUserData;
9607 ctx.
Write(destination_entity);
9611 }
9612 }
9613 else if (!
GetGame().IsMultiplayer())
9614 {
9616 }
9617 }
9618
9620 {
9622 return;
9623
9624 float split_quantity_new;
9628 InventoryLocation loc = new InventoryLocation;
9629
9630 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9631 {
9633 split_quantity_new = stack_max;
9634 else
9636
9637 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9638 if (new_item)
9639 {
9640 new_item.SetResultOfSplit(true);
9641 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9643 new_item.SetQuantity(split_quantity_new);
9644 }
9645 }
9646 else if (destination_entity && slot_id == -1)
9647 {
9648 if (quantity > stack_max)
9649 split_quantity_new = stack_max;
9650 else
9651 split_quantity_new = quantity;
9652
9654 {
9657 }
9658
9659 if (new_item)
9660 {
9661 new_item.SetResultOfSplit(true);
9662 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9664 new_item.SetQuantity(split_quantity_new);
9665 }
9666 }
9667 else
9668 {
9669 if (stack_max != 0)
9670 {
9672 {
9674 }
9675
9676 if (split_quantity_new == 0)
9677 {
9678 if (!
GetGame().IsMultiplayer())
9679 player.PhysicalPredictiveDropItem(this);
9680 else
9681 player.ServerDropEntity(this);
9682 return;
9683 }
9684
9686
9687 if (new_item)
9688 {
9689 new_item.SetResultOfSplit(true);
9690 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9692 new_item.SetQuantity(stack_max);
9693 new_item.PlaceOnSurface();
9694 }
9695 }
9696 }
9697 }
9698
9700 {
9702 return;
9703
9704 float split_quantity_new;
9708 InventoryLocation loc = new InventoryLocation;
9709
9710 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9711 {
9713 split_quantity_new = stack_max;
9714 else
9716
9717 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9718 if (new_item)
9719 {
9720 new_item.SetResultOfSplit(true);
9721 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9723 new_item.SetQuantity(split_quantity_new);
9724 }
9725 }
9726 else if (destination_entity && slot_id == -1)
9727 {
9728 if (quantity > stack_max)
9729 split_quantity_new = stack_max;
9730 else
9731 split_quantity_new = quantity;
9732
9734 {
9737 }
9738
9739 if (new_item)
9740 {
9741 new_item.SetResultOfSplit(true);
9742 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9744 new_item.SetQuantity(split_quantity_new);
9745 }
9746 }
9747 else
9748 {
9749 if (stack_max != 0)
9750 {
9752 {
9754 }
9755
9757
9758 if (new_item)
9759 {
9760 new_item.SetResultOfSplit(true);
9761 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9763 new_item.SetQuantity(stack_max);
9764 new_item.PlaceOnSurface();
9765 }
9766 }
9767 }
9768 }
9769
9771 {
9773 return;
9774
9776 {
9777 if (ScriptInputUserData.CanStoreInputUserData())
9778 {
9779 ScriptInputUserData ctx = new ScriptInputUserData;
9784 dst.WriteToContext(ctx);
9786 }
9787 }
9788 else if (!
GetGame().IsMultiplayer())
9789 {
9791 }
9792 }
9793
9795 {
9797 return;
9798
9800 {
9801 if (ScriptInputUserData.CanStoreInputUserData())
9802 {
9803 ScriptInputUserData ctx = new ScriptInputUserData;
9808 ctx.
Write(destination_entity);
9814 }
9815 }
9816 else if (!
GetGame().IsMultiplayer())
9817 {
9819 }
9820 }
9821
9823 {
9825 }
9826
9828 {
9830 return this;
9831
9833 float split_quantity_new;
9835 if (dst.IsValid())
9836 {
9837 int slot_id = dst.GetSlot();
9839
9840 if (quantity > stack_max)
9841 split_quantity_new = stack_max;
9842 else
9843 split_quantity_new = quantity;
9844
9846
9847 if (new_item)
9848 {
9849 new_item.SetResultOfSplit(true);
9850 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9853 }
9854
9855 return new_item;
9856 }
9857
9858 return null;
9859 }
9860
9862 {
9864 return;
9865
9867 float split_quantity_new;
9869 if (destination_entity)
9870 {
9872 if (quantity > stackable)
9873 split_quantity_new = stackable;
9874 else
9875 split_quantity_new = quantity;
9876
9877 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9878 if (new_item)
9879 {
9880 new_item.SetResultOfSplit(true);
9881 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9883 new_item.SetQuantity(split_quantity_new);
9884 }
9885 }
9886 }
9887
9889 {
9891 return;
9892
9894 {
9895 if (ScriptInputUserData.CanStoreInputUserData())
9896 {
9897 ScriptInputUserData ctx = new ScriptInputUserData;
9902 ItemBase destination_entity =
this;
9903 ctx.
Write(destination_entity);
9907 }
9908 }
9909 else if (!
GetGame().IsMultiplayer())
9910 {
9912 }
9913 }
9914
9916 {
9918 return;
9919
9921 float split_quantity_new;
9923 if (player)
9924 {
9926 if (quantity > stackable)
9927 split_quantity_new = stackable;
9928 else
9929 split_quantity_new = quantity;
9930
9931 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9932 new_item =
ItemBase.Cast(in_hands);
9933 if (new_item)
9934 {
9935 new_item.SetResultOfSplit(true);
9936 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9938 new_item.SetQuantity(split_quantity_new);
9939 }
9940 }
9941 }
9942
9944 {
9946 return;
9947
9949 float split_quantity_new = Math.Floor(quantity * 0.5);
9950
9952
9953 if (new_item)
9954 {
9955 if (new_item.GetQuantityMax() < split_quantity_new)
9956 {
9957 split_quantity_new = new_item.GetQuantityMax();
9958 }
9959
9960 new_item.SetResultOfSplit(true);
9961 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9962
9964 {
9967 }
9968 else
9969 {
9972 }
9973 }
9974 }
9975
9977 {
9979 return;
9980
9982 float split_quantity_new = Math.Floor(quantity / 2);
9983
9984 InventoryLocation invloc = new InventoryLocation;
9986
9988 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9989
9990 if (new_item)
9991 {
9992 if (new_item.GetQuantityMax() < split_quantity_new)
9993 {
9994 split_quantity_new = new_item.GetQuantityMax();
9995 }
9997 {
10000 }
10001 else
10002 {
10005 }
10006 }
10007 }
10008
10011 {
10012 SetWeightDirty();
10014
10015 if (parent)
10016 parent.OnAttachmentQuantityChangedEx(this, delta);
10017
10019 {
10021 {
10023 }
10025 {
10026 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10028 }
10029 }
10030
10031 }
10032
10035 {
10036
10037 }
10038
10041 {
10043 }
10044
10046 {
10047 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10048
10050 {
10051 if (newLevel == GameConstants.STATE_RUINED)
10052 {
10054 EntityAI parent = GetHierarchyParent();
10055 if (parent && parent.IsFireplace())
10056 {
10057 CargoBase cargo = GetInventory().GetCargo();
10058 if (cargo)
10059 {
10061 {
10063 }
10064 }
10065 }
10066 }
10067
10069 {
10070
10072 return;
10073 }
10074
10075 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10076 {
10078 }
10079 }
10080 }
10081
10082
10084 {
10085 super.OnRightClick();
10086
10088 {
10090 {
10091 if (ScriptInputUserData.CanStoreInputUserData())
10092 {
10093 vector m4[4];
10095
10096 EntityAI root = GetHierarchyRoot();
10097
10098 InventoryLocation dst = new InventoryLocation;
10100 {
10101 if (root)
10102 {
10103 root.GetTransform(m4);
10105 }
10106 else
10107 GetInventory().GetCurrentInventoryLocation(dst);
10108 }
10109 else
10110 {
10112
10113
10114 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10115 {
10116 if (root)
10117 {
10118 root.GetTransform(m4);
10120 }
10121 else
10122 GetInventory().GetCurrentInventoryLocation(dst);
10123 }
10124 else
10125 {
10126 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10127 }
10128 }
10129
10130 ScriptInputUserData ctx = new ScriptInputUserData;
10138 }
10139 }
10140 else if (!
GetGame().IsMultiplayer())
10141 {
10143 }
10144 }
10145 }
10146
10147 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10148 {
10149
10150 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10151 return false;
10152
10153 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10154 return false;
10155
10156
10158 return false;
10159
10160
10161 Magazine mag = Magazine.Cast(this);
10162 if (mag)
10163 {
10164 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10165 return false;
10166
10167 if (stack_max_limit)
10168 {
10169 Magazine other_mag = Magazine.Cast(other_item);
10170 if (other_item)
10171 {
10172 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10173 return false;
10174 }
10175
10176 }
10177 }
10178 else
10179 {
10180
10182 return false;
10183
10185 return false;
10186 }
10187
10188 PlayerBase player = null;
10189 if (CastTo(player, GetHierarchyRootPlayer()))
10190 {
10191 if (player.GetInventory().HasAttachment(this))
10192 return false;
10193
10194 if (player.IsItemsToDelete())
10195 return false;
10196 }
10197
10198 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10199 return false;
10200
10201 int slotID;
10203 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10204 return false;
10205
10206 return true;
10207 }
10208
10210 {
10212 }
10213
10215 {
10216 return m_IsResultOfSplit;
10217 }
10218
10220 {
10221 m_IsResultOfSplit = value;
10222 }
10223
10225 {
10227 }
10228
10230 {
10231 float other_item_quantity = other_item.GetQuantity();
10232 float this_free_space;
10233
10235
10237
10238 if (other_item_quantity > this_free_space)
10239 {
10240 return this_free_space;
10241 }
10242 else
10243 {
10244 return other_item_quantity;
10245 }
10246 }
10247
10249 {
10251 }
10252
10254 {
10256 return;
10257
10258 if (!IsMagazine() && other_item)
10259 {
10261 if (quantity_used != 0)
10262 {
10263 float hp1 = GetHealth01("","");
10264 float hp2 = other_item.GetHealth01("","");
10265 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10266 hpResult = hpResult / (
GetQuantity() + quantity_used);
10267
10268 hpResult *= GetMaxHealth();
10269 Math.Round(hpResult);
10270 SetHealth("", "Health", hpResult);
10271
10273 other_item.AddQuantity(-quantity_used);
10274 }
10275 }
10277 }
10278
10280 {
10281 #ifdef SERVER
10282 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10283 GetHierarchyParent().IncreaseLifetimeUp();
10284 #endif
10285 };
10286
10288 {
10289 PlayerBase p = PlayerBase.Cast(player);
10290
10291 array<int> recipesIds = p.m_Recipes;
10292 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10293 if (moduleRecipesManager)
10294 {
10295 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10296 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10297 }
10298
10299 for (int i = 0;i < recipesIds.Count(); i++)
10300 {
10301 int key = recipesIds.Get(i);
10302 string recipeName = moduleRecipesManager.GetRecipeName(key);
10304 }
10305 }
10306
10307
10308 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10309 {
10310 super.GetDebugActions(outputList);
10311
10312
10317
10318
10322
10326
10327
10330
10331
10333 {
10336 }
10337
10339
10342
10346 }
10347
10348
10349
10350
10352 {
10353 super.OnAction(action_id, player, ctx);
10354 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10355 {
10356 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10357 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10358 PlayerBase p = PlayerBase.Cast(player);
10359 if (
EActions.RECIPES_RANGE_START < 1000)
10360 {
10361 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10362 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10363 }
10364 }
10365 #ifndef SERVER
10366 else if (action_id ==
EActions.WATCH_PLAYER)
10367 {
10368 PluginDeveloper.SetDeveloperItemClientEx(player);
10369 }
10370 #endif
10372 {
10373 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10374 {
10375 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10376 OnDebugButtonPressServer(id + 1);
10377 }
10378
10379 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10380 {
10381 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10383 }
10384
10385 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10386 {
10387 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10389 }
10390
10391 else if (action_id ==
EActions.ADD_QUANTITY)
10392 {
10393 if (IsMagazine())
10394 {
10395 Magazine mag = Magazine.Cast(this);
10396 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10397 }
10398 else
10399 {
10401 }
10402
10403 if (m_EM)
10404 {
10405 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10406 }
10407
10408 }
10409
10410 else if (action_id ==
EActions.REMOVE_QUANTITY)
10411 {
10412 if (IsMagazine())
10413 {
10414 Magazine mag2 = Magazine.Cast(this);
10415 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10416 }
10417 else
10418 {
10420 }
10421 if (m_EM)
10422 {
10423 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10424 }
10425
10426 }
10427
10428 else if (action_id ==
EActions.SET_QUANTITY_0)
10429 {
10431
10432 if (m_EM)
10433 {
10434 m_EM.SetEnergy(0);
10435 }
10436 }
10437
10438 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10439 {
10441
10442 if (m_EM)
10443 {
10444 m_EM.SetEnergy(m_EM.GetEnergyMax());
10445 }
10446 }
10447
10448 else if (action_id ==
EActions.ADD_HEALTH)
10449 {
10450 AddHealth("","",GetMaxHealth("","Health")/5);
10451 }
10452 else if (action_id ==
EActions.REMOVE_HEALTH)
10453 {
10454 AddHealth("","",-GetMaxHealth("","Health")/5);
10455 }
10456 else if (action_id ==
EActions.DESTROY_HEALTH)
10457 {
10458 SetHealth01("","",0);
10459 }
10460 else if (action_id ==
EActions.WATCH_ITEM)
10461 {
10463 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10464 #ifdef DEVELOPER
10465 SetDebugDeveloper_item(this);
10466 #endif
10467 }
10468
10469 else if (action_id ==
EActions.ADD_TEMPERATURE)
10470 {
10471 AddTemperature(20);
10472
10473 }
10474
10475 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10476 {
10477 AddTemperature(-20);
10478
10479 }
10480
10481 else if (action_id ==
EActions.FLIP_FROZEN)
10482 {
10483 SetFrozen(!GetIsFrozen());
10484
10485 }
10486
10487 else if (action_id ==
EActions.ADD_WETNESS)
10488 {
10490
10491 }
10492
10493 else if (action_id ==
EActions.REMOVE_WETNESS)
10494 {
10496
10497 }
10498
10499 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10500 {
10503
10504
10505 }
10506
10507 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10508 {
10511 }
10512
10513 else if (action_id ==
EActions.MAKE_SPECIAL)
10514 {
10515 auto debugParams = DebugSpawnParams.WithPlayer(player);
10516 OnDebugSpawnEx(debugParams);
10517 }
10518
10519 else if (action_id ==
EActions.DELETE)
10520 {
10521 Delete();
10522 }
10523
10524 }
10525
10526
10527 return false;
10528 }
10529
10530
10531
10532
10536
10539
10540
10541
10543 {
10544 return false;
10545 }
10546
10547
10549 {
10550 return true;
10551 }
10552
10553
10555 {
10556 return true;
10557 }
10558
10559
10560
10562 {
10563 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10565 }
10566
10569 {
10570 return null;
10571 }
10572
10574 {
10575 return false;
10576 }
10577
10579 {
10580 return false;
10581 }
10582
10586
10587
10589 {
10590 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10591 return module_repairing.CanRepair(this, item_repair_kit);
10592 }
10593
10594
10595 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10596 {
10597 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10598 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10599 }
10600
10601
10603 {
10604
10605
10606
10607
10608
10609
10610
10611
10612 return 1;
10613 }
10614
10615
10616
10618 {
10620 }
10621
10622
10623
10625 {
10627 }
10628
10629
10638 {
10639 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10640
10641 if (player)
10642 {
10643 player.MessageStatus(text);
10644 }
10645 }
10646
10647
10656 {
10657 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10658
10659 if (player)
10660 {
10661 player.MessageAction(text);
10662 }
10663 }
10664
10665
10674 {
10675 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10676
10677 if (player)
10678 {
10679 player.MessageFriendly(text);
10680 }
10681 }
10682
10683
10692 {
10693 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10694
10695 if (player)
10696 {
10697 player.MessageImportant(text);
10698 }
10699 }
10700
10702 {
10703 return true;
10704 }
10705
10706
10707 override bool KindOf(
string tag)
10708 {
10709 bool found = false;
10710 string item_name = this.
GetType();
10713
10714 int array_size = item_tag_array.Count();
10715 for (int i = 0; i < array_size; i++)
10716 {
10717 if (item_tag_array.Get(i) == tag)
10718 {
10719 found = true;
10720 break;
10721 }
10722 }
10723 return found;
10724 }
10725
10726
10728 {
10729
10730 super.OnRPC(sender, rpc_type,ctx);
10731
10732
10733 switch (rpc_type)
10734 {
10735 #ifndef SERVER
10736 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10737 Param2<bool, string> p = new Param2<bool, string>(false, "");
10738
10740 return;
10741
10742 bool play = p.param1;
10743 string soundSet = p.param2;
10744
10745 if (play)
10746 {
10748 {
10750 {
10752 }
10753 }
10754 else
10755 {
10757 }
10758 }
10759 else
10760 {
10762 }
10763
10764 break;
10765 #endif
10766
10767 }
10768
10770 {
10772 }
10773 }
10774
10775
10776
10777
10779 {
10780 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10781 return plugin.GetID(
name);
10782 }
10783
10785 {
10786 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10787 return plugin.GetName(id);
10788 }
10789
10792 {
10793
10794
10795 int varFlags;
10796 if (!ctx.
Read(varFlags))
10797 return;
10798
10799 if (varFlags & ItemVariableFlags.FLOAT)
10800 {
10802 }
10803 }
10804
10806 {
10807
10808 super.SerializeNumericalVars(floats_out);
10809
10810
10811
10813 {
10815 }
10816
10818 {
10820 }
10821
10823 {
10825 }
10826
10828 {
10833 }
10834
10836 {
10838 }
10839 }
10840
10842 {
10843
10844 super.DeSerializeNumericalVars(floats);
10845
10846
10847 int index = 0;
10848 int mask = Math.Round(floats.Get(index));
10849
10850 index++;
10851
10853 {
10855 {
10857 }
10858 else
10859 {
10860 float quantity = floats.Get(index);
10861 SetQuantity(quantity,
true,
false,
false,
false);
10862 }
10863 index++;
10864 }
10865
10867 {
10868 float wet = floats.Get(index);
10870 index++;
10871 }
10872
10874 {
10875 int liquidtype = Math.Round(floats.Get(index));
10877 index++;
10878 }
10879
10881 {
10883 index++;
10885 index++;
10887 index++;
10889 index++;
10890 }
10891
10893 {
10894 int cleanness = Math.Round(floats.Get(index));
10896 index++;
10897 }
10898 }
10899
10901 {
10902 super.WriteVarsToCTX(ctx);
10903
10904
10906 {
10908 }
10909
10911 {
10913 }
10914
10916 {
10918 }
10919
10921 {
10922 int r,g,b,a;
10928 }
10929
10931 {
10933 }
10934 }
10935
10937 {
10938 if (!super.ReadVarsFromCTX(ctx,version))
10939 return false;
10940
10941 int intValue;
10942 float value;
10943
10944 if (version < 140)
10945 {
10946 if (!ctx.
Read(intValue))
10947 return false;
10948
10949 m_VariablesMask = intValue;
10950 }
10951
10953 {
10954 if (!ctx.
Read(value))
10955 return false;
10956
10958 {
10960 }
10961 else
10962 {
10964 }
10965 }
10966
10967 if (version < 140)
10968 {
10970 {
10971 if (!ctx.
Read(value))
10972 return false;
10973 SetTemperatureDirect(value);
10974 }
10975 }
10976
10978 {
10979 if (!ctx.
Read(value))
10980 return false;
10982 }
10983
10985 {
10986 if (!ctx.
Read(intValue))
10987 return false;
10989 }
10990
10992 {
10993 int r,g,b,a;
10995 return false;
10997 return false;
10999 return false;
11001 return false;
11002
11004 }
11005
11007 {
11008 if (!ctx.
Read(intValue))
11009 return false;
11011 }
11012
11013 if (version >= 138 && version < 140)
11014 {
11016 {
11017 if (!ctx.
Read(intValue))
11018 return false;
11019 SetFrozen(intValue);
11020 }
11021 }
11022
11023 return true;
11024 }
11025
11026
11028 {
11031 {
11033 }
11034
11035 if (!super.OnStoreLoad(ctx, version))
11036 {
11038 return false;
11039 }
11040
11041 if (version >= 114)
11042 {
11043 bool hasQuickBarIndexSaved;
11044
11045 if (!ctx.
Read(hasQuickBarIndexSaved))
11046 {
11048 return false;
11049 }
11050
11051 if (hasQuickBarIndexSaved)
11052 {
11053 int itmQBIndex;
11054
11055
11056 if (!ctx.
Read(itmQBIndex))
11057 {
11059 return false;
11060 }
11061
11062 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11063 if (itmQBIndex != -1 && parentPlayer)
11064 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11065 }
11066 }
11067 else
11068 {
11069
11070 PlayerBase player;
11071 int itemQBIndex;
11072 if (version ==
int.
MAX)
11073 {
11074 if (!ctx.
Read(itemQBIndex))
11075 {
11077 return false;
11078 }
11079 }
11080 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11081 {
11082
11083 if (!ctx.
Read(itemQBIndex))
11084 {
11086 return false;
11087 }
11088 if (itemQBIndex != -1 && player)
11089 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11090 }
11091 }
11092
11093 if (version < 140)
11094 {
11095
11096 if (!LoadVariables(ctx, version))
11097 {
11099 return false;
11100 }
11101 }
11102
11103
11105 {
11107 return false;
11108 }
11109 if (version >= 132)
11110 {
11112 if (raib)
11113 {
11115 {
11117 return false;
11118 }
11119 }
11120 }
11121
11123 return true;
11124 }
11125
11126
11127
11129 {
11130 super.OnStoreSave(ctx);
11131
11132 PlayerBase player;
11133 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11134 {
11136
11137 int itemQBIndex = -1;
11138 itemQBIndex = player.FindQuickBarEntityIndex(this);
11139 ctx.
Write(itemQBIndex);
11140 }
11141 else
11142 {
11144 }
11145
11147
11149 if (raib)
11150 {
11152 }
11153 }
11154
11155
11157 {
11158 super.AfterStoreLoad();
11159
11161 {
11163 }
11164
11166 {
11169 }
11170 }
11171
11173 {
11174 super.EEOnAfterLoad();
11175
11177 {
11179 }
11180
11183 }
11184
11186 {
11187 return false;
11188 }
11189
11190
11191
11193 {
11195 {
11196 #ifdef PLATFORM_CONSOLE
11197
11199 {
11201 if (menu)
11202 {
11204 }
11205 }
11206 #endif
11207 }
11208
11210 {
11213 }
11214
11216 {
11217 SetWeightDirty();
11219 }
11221 {
11224 }
11225
11227 {
11230 }
11232 {
11235 }
11236
11237 super.OnVariablesSynchronized();
11238 }
11239
11240
11241
11243 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11244 {
11245 if (!IsServerCheck(allow_client))
11246 return false;
11247
11249 return false;
11250
11253
11254 if (value <= (min + 0.001))
11255 value = min;
11256
11257 if (value == min)
11258 {
11259 if (destroy_config)
11260 {
11261 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11262 if (dstr)
11263 {
11265 this.Delete();
11266 return true;
11267 }
11268 }
11269 else if (destroy_forced)
11270 {
11272 this.Delete();
11273 return true;
11274 }
11275
11277 }
11278
11281
11283 {
11285
11286 if (delta)
11288 }
11289
11291
11292 return false;
11293 }
11294
11295
11297 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11298 {
11300 }
11301
11303 {
11306 }
11307
11309 {
11312 }
11313
11316 {
11317 float value_clamped = Math.Clamp(value, 0, 1);
11319 SetQuantity(result, destroy_config, destroy_forced);
11320 }
11321
11322
11325 {
11327 }
11328
11330 {
11332 }
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11344 {
11345 int slot = -1;
11346 if (GetInventory())
11347 {
11348 InventoryLocation il = new InventoryLocation;
11349 GetInventory().GetCurrentInventoryLocation(il);
11351 }
11352
11354 }
11355
11357 {
11358 float quantity_max = 0;
11359
11361 {
11362 if (attSlotID != -1)
11363 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11364
11365 if (quantity_max <= 0)
11367 }
11368
11369 if (quantity_max <= 0)
11371
11372 return quantity_max;
11373 }
11374
11376 {
11378 }
11379
11381 {
11383 }
11384
11385
11387 {
11389 }
11390
11392 {
11394 }
11395
11397 {
11399 }
11400
11401
11403 {
11404
11405 float weightEx = GetWeightEx();
11406 float special = GetInventoryAndCargoWeight();
11407 return weightEx - special;
11408 }
11409
11410
11412 {
11414 }
11415
11417 {
11419 {
11420 #ifdef DEVELOPER
11421 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11422 {
11423 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11425 }
11426 #endif
11427
11428 return GetQuantity() * GetConfigWeightModified();
11429 }
11430 else if (HasEnergyManager())
11431 {
11432 #ifdef DEVELOPER
11433 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11434 {
11435 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11436 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11437 }
11438 #endif
11439 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11440 }
11441 else
11442 {
11443 #ifdef DEVELOPER
11444 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11445 {
11446 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11447 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11448 }
11449 #endif
11450 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11451 }
11452 }
11453
11456 {
11457 int item_count = 0;
11459
11460 if (GetInventory().GetCargo() != NULL)
11461 {
11462 item_count = GetInventory().GetCargo().GetItemCount();
11463 }
11464
11465 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11466 {
11467 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11468 if (item)
11469 item_count += item.GetNumberOfItems();
11470 }
11471 return item_count;
11472 }
11473
11476 {
11477 float weight = 0;
11478 float wetness = 1;
11479 if (include_wetness)
11482 {
11483 weight = wetness * m_ConfigWeight;
11484 }
11486 {
11487 weight = 1;
11488 }
11489 return weight;
11490 }
11491
11492
11493
11495 {
11496 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11497 {
11498 GameInventory inv = GetInventory();
11499 array<EntityAI> items = new array<EntityAI>;
11501 for (int i = 0; i < items.Count(); i++)
11502 {
11504 if (item)
11505 {
11507 }
11508 }
11509 }
11510 }
11511
11512
11513
11514
11516 {
11517 float energy = 0;
11518 if (HasEnergyManager())
11519 {
11520 energy = GetCompEM().GetEnergy();
11521 }
11522 return energy;
11523 }
11524
11525
11527 {
11528 super.OnEnergyConsumed();
11529
11531 }
11532
11534 {
11535 super.OnEnergyAdded();
11536
11538 }
11539
11540
11542 {
11543 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11544 {
11546 {
11547 float energy_0to1 = GetCompEM().GetEnergy0To1();
11549 }
11550 }
11551 }
11552
11553
11555 {
11556 return ConfigGetFloat("heatIsolation");
11557 }
11558
11560 {
11562 }
11563
11565 {
11566 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11567 if (
GetGame().ConfigIsExisting(paramPath))
11569
11570 return 0.0;
11571 }
11572
11574 {
11575 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11576 if (
GetGame().ConfigIsExisting(paramPath))
11578
11579 return 0.0;
11580 }
11581
11582 override void SetWet(
float value,
bool allow_client =
false)
11583 {
11584 if (!IsServerCheck(allow_client))
11585 return;
11586
11589
11591
11592 m_VarWet = Math.Clamp(value, min, max);
11593
11595 {
11598 }
11599 }
11600
11601 override void AddWet(
float value)
11602 {
11604 }
11605
11607 {
11609 }
11610
11612 {
11614 }
11615
11617 {
11619 }
11620
11622 {
11624 }
11625
11627 {
11629 }
11630
11631 override void OnWetChanged(
float newVal,
float oldVal)
11632 {
11635 if (newLevel != oldLevel)
11636 {
11638 }
11639 }
11640
11642 {
11643 SetWeightDirty();
11644 }
11645
11647 {
11648 return GetWetLevelInternal(
m_VarWet);
11649 }
11650
11651
11652
11654 {
11656 }
11657
11659 {
11661 }
11662
11664 {
11666 }
11667
11669 {
11671 }
11672
11673
11674
11676 {
11677 if (ConfigIsExisting("itemModelLength"))
11678 {
11679 return ConfigGetFloat("itemModelLength");
11680 }
11681 return 0;
11682 }
11683
11685 {
11686 if (ConfigIsExisting("itemAttachOffset"))
11687 {
11688 return ConfigGetFloat("itemAttachOffset");
11689 }
11690 return 0;
11691 }
11692
11693 override void SetCleanness(
int value,
bool allow_client =
false)
11694 {
11695 if (!IsServerCheck(allow_client))
11696 return;
11697
11699
11701
11704 }
11705
11707 {
11709 }
11710
11712 {
11713 return true;
11714 }
11715
11716
11717
11718
11720 {
11722 }
11723
11725 {
11727 }
11728
11729
11730
11731
11732 override void SetColor(
int r,
int g,
int b,
int a)
11733 {
11739 }
11741 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11742 {
11747 }
11748
11750 {
11752 }
11753
11756 {
11757 int r,g,b,a;
11759 r = r/255;
11760 g = g/255;
11761 b = b/255;
11762 a = a/255;
11763 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11764 }
11765
11766
11767
11768 override void SetLiquidType(
int value,
bool allow_client =
false)
11769 {
11770 if (!IsServerCheck(allow_client))
11771 return;
11772
11777 }
11778
11780 {
11781 return ConfigGetInt("varLiquidTypeInit");
11782 }
11783
11785 {
11787 }
11788
11790 {
11792 SetFrozen(false);
11793 }
11794
11797 {
11798 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11799 }
11800
11801
11804 {
11805 PlayerBase nplayer;
11806 if (PlayerBase.CastTo(nplayer, player))
11807 {
11809
11810 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11811 }
11812 }
11813
11814
11817 {
11818 PlayerBase nplayer;
11819 if (PlayerBase.CastTo(nplayer,player))
11820 {
11821
11822 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11823
11824 }
11825
11826
11827 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11828
11829
11830 if (HasEnergyManager())
11831 {
11832 GetCompEM().UpdatePlugState();
11833 }
11834 }
11835
11836
11838 {
11839 super.OnPlacementStarted(player);
11840
11842 }
11843
11844 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11845 {
11847 {
11848 m_AdminLog.OnPlacementComplete(player,
this);
11849 }
11850
11851 super.OnPlacementComplete(player, position, orientation);
11852 }
11853
11854
11855
11856
11857
11859 {
11861 {
11862 return true;
11863 }
11864 else
11865 {
11866 return false;
11867 }
11868 }
11869
11870
11872 {
11874 {
11876 }
11877 }
11878
11879
11881 {
11883 }
11884
11886 {
11888 }
11889
11890 override void InsertAgent(
int agent,
float count = 1)
11891 {
11892 if (count < 1)
11893 return;
11894
11896 }
11897
11900 {
11902 }
11903
11904
11906 {
11908 }
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11952 {
11954 return false;
11955 return true;
11956 }
11957
11959 {
11960
11962 }
11963
11964
11967 {
11968 super.CheckForRoofLimited(timeTresholdMS);
11969
11971 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11972 {
11973 m_PreviousRoofTestTime = time;
11974 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11975 }
11976 }
11977
11978
11980 {
11982 {
11983 return 0;
11984 }
11985
11986 if (GetInventory().GetAttachmentSlotsCount() != 0)
11987 {
11988 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11989 if (filter)
11990 return filter.GetProtectionLevel(type, false, system);
11991 else
11992 return 0;
11993 }
11994
11995 string subclassPath, entryName;
11996
11997 switch (type)
11998 {
12000 entryName = "biological";
12001 break;
12003 entryName = "chemical";
12004 break;
12005 default:
12006 entryName = "biological";
12007 break;
12008 }
12009
12010 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12011
12013 }
12014
12015
12016
12019 {
12020 if (!IsMagazine())
12022
12024 }
12025
12026
12027
12028
12029
12034 {
12035 return true;
12036 }
12037
12039 {
12041 }
12042
12043
12044
12045
12046
12048 {
12049 if (parent)
12050 {
12051 if (parent.IsInherited(DayZInfected))
12052 return true;
12053
12054 if (!parent.IsRuined())
12055 return true;
12056 }
12057
12058 return true;
12059 }
12060
12062 {
12063 if (!super.CanPutAsAttachment(parent))
12064 {
12065 return false;
12066 }
12067
12068 if (!IsRuined() && !parent.IsRuined())
12069 {
12070 return true;
12071 }
12072
12073 return false;
12074 }
12075
12077 {
12078
12079
12080
12081
12082 return super.CanReceiveItemIntoCargo(item);
12083 }
12084
12086 {
12087
12088
12089
12090
12091 GameInventory attachmentInv = attachment.GetInventory();
12093 {
12094 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12095 return false;
12096 }
12097
12098 InventoryLocation loc = new InventoryLocation();
12099 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12100 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12101 return false;
12102
12103 return super.CanReceiveAttachment(attachment, slotId);
12104 }
12105
12107 {
12108 if (!super.CanReleaseAttachment(attachment))
12109 return false;
12110
12111 return GetInventory().AreChildrenAccessible();
12112 }
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12135 {
12136 int id = muzzle_owner.GetMuzzleID();
12137 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12138
12139 if (WPOF_array)
12140 {
12141 for (int i = 0; i < WPOF_array.Count(); i++)
12142 {
12143 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12144
12145 if (WPOF)
12146 {
12147 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12148 }
12149 }
12150 }
12151 }
12152
12153
12155 {
12156 int id = muzzle_owner.GetMuzzleID();
12158
12159 if (WPOBE_array)
12160 {
12161 for (int i = 0; i < WPOBE_array.Count(); i++)
12162 {
12163 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12164
12165 if (WPOBE)
12166 {
12167 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12168 }
12169 }
12170 }
12171 }
12172
12173
12175 {
12176 int id = muzzle_owner.GetMuzzleID();
12177 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12178
12179 if (WPOOH_array)
12180 {
12181 for (int i = 0; i < WPOOH_array.Count(); i++)
12182 {
12183 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12184
12185 if (WPOOH)
12186 {
12187 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12188 }
12189 }
12190 }
12191 }
12192
12193
12195 {
12196 int id = muzzle_owner.GetMuzzleID();
12197 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12198
12199 if (WPOOH_array)
12200 {
12201 for (int i = 0; i < WPOOH_array.Count(); i++)
12202 {
12203 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12204
12205 if (WPOOH)
12206 {
12207 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12208 }
12209 }
12210 }
12211 }
12212
12213
12215 {
12216 int id = muzzle_owner.GetMuzzleID();
12217 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12218
12219 if (WPOOH_array)
12220 {
12221 for (int i = 0; i < WPOOH_array.Count(); i++)
12222 {
12223 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12224
12225 if (WPOOH)
12226 {
12227 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12228 }
12229 }
12230 }
12231 }
12232
12233
12234
12236 {
12238 {
12239 return true;
12240 }
12241
12242 return false;
12243 }
12244
12246 {
12248 {
12249 return true;
12250 }
12251
12252 return false;
12253 }
12254
12256 {
12258 {
12259 return true;
12260 }
12261
12262 return false;
12263 }
12264
12266 {
12267 return false;
12268 }
12269
12272 {
12273 return UATimeSpent.DEFAULT_DEPLOY;
12274 }
12275
12276
12277
12278
12280 {
12282 SetSynchDirty();
12283 }
12284
12286 {
12288 }
12289
12290
12292 {
12293 return false;
12294 }
12295
12298 {
12299 string att_type = "None";
12300
12301 if (ConfigIsExisting("soundAttType"))
12302 {
12303 att_type = ConfigGetString("soundAttType");
12304 }
12305
12307 }
12308
12310 {
12312 }
12313
12314
12315
12316
12317
12321
12323 {
12326
12328 }
12329
12330
12332 {
12334 return;
12335
12337
12340
12343
12344 SoundParameters params = new SoundParameters();
12348 }
12349
12350
12352 {
12354 return;
12355
12357 SetSynchDirty();
12358
12361 }
12362
12363
12365 {
12367 return;
12368
12370 SetSynchDirty();
12371
12374 }
12375
12377 {
12379 }
12380
12382 {
12384 }
12385
12388 {
12389 if (!
GetGame().IsDedicatedServer())
12390 {
12391 if (ConfigIsExisting("attachSoundSet"))
12392 {
12393 string cfg_path = "";
12394 string soundset = "";
12395 string type_name =
GetType();
12396
12399 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12400 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12401
12402 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12403 {
12404 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12405 {
12406 if (cfg_slot_array[i] == slot_type)
12407 {
12408 soundset = cfg_soundset_array[i];
12409 break;
12410 }
12411 }
12412 }
12413
12414 if (soundset != "")
12415 {
12416 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12418 }
12419 }
12420 }
12421 }
12422
12424 {
12425
12426 }
12427
12428 void OnApply(PlayerBase player);
12429
12431 {
12432 return 1.0;
12433 };
12434
12436 {
12438 }
12439
12441 {
12443 }
12444
12446
12448 {
12449 SetDynamicPhysicsLifeTime(0.01);
12451 }
12452
12454 {
12455 array<string> zone_names = new array<string>;
12456 GetDamageZones(zone_names);
12457 for (int i = 0; i < zone_names.Count(); i++)
12458 {
12459 SetHealthMax(zone_names.Get(i),"Health");
12460 }
12461 SetHealthMax("","Health");
12462 }
12463
12466 {
12467 float global_health = GetHealth01("","Health");
12468 array<string> zones = new array<string>;
12469 GetDamageZones(zones);
12470
12471 for (int i = 0; i < zones.Count(); i++)
12472 {
12473 SetHealth01(zones.Get(i),"Health",global_health);
12474 }
12475 }
12476
12479 {
12480 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12481 }
12482
12484 {
12485 if (!hasRootAsPlayer)
12486 {
12487 if (refParentIB)
12488 {
12489
12490 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12491 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12492
12493 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12494 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12495
12498 }
12499 else
12500 {
12501
12504 }
12505 }
12506 }
12507
12509 {
12511 {
12512 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12513 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12514 {
12515 float heatPermCoef = 1.0;
12517 while (ent)
12518 {
12519 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12520 ent = ent.GetHierarchyParent();
12521 }
12522
12523 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12524 }
12525 }
12526 }
12527
12529 {
12530
12531 EntityAI parent = GetHierarchyParent();
12532 if (!parent)
12533 {
12534 hasParent = false;
12535 hasRootAsPlayer = false;
12536 }
12537 else
12538 {
12539 hasParent = true;
12540 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12541 refParentIB =
ItemBase.Cast(parent);
12542 }
12543 }
12544
12545 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12546 {
12547
12548 }
12549
12551 {
12552
12553 return false;
12554 }
12555
12557 {
12558
12559
12560 return false;
12561 }
12562
12564 {
12565
12566 return false;
12567 }
12568
12571 {
12572 return !GetIsFrozen() &&
IsOpen();
12573 }
12574
12576 {
12577 bool hasParent = false, hasRootAsPlayer = false;
12579
12580 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12581 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12582
12583 if (wwtu || foodDecay)
12584 {
12588
12589 if (processWetness || processTemperature || processDecay)
12590 {
12592
12593 if (processWetness)
12594 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12595
12596 if (processTemperature)
12598
12599 if (processDecay)
12600 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12601 }
12602 }
12603 }
12604
12607 {
12609 }
12610
12612 {
12615
12616 return super.GetTemperatureFreezeThreshold();
12617 }
12618
12620 {
12623
12624 return super.GetTemperatureThawThreshold();
12625 }
12626
12628 {
12631
12632 return super.GetItemOverheatThreshold();
12633 }
12634
12636 {
12638 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12639
12640 return super.GetTemperatureFreezeTime();
12641 }
12642
12644 {
12646 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12647
12648 return super.GetTemperatureThawTime();
12649 }
12650
12655
12657 {
12658 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12659 }
12660
12662 {
12663 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12664 }
12665
12668 {
12670 }
12671
12673 {
12675 }
12676
12678 {
12680 }
12681
12684 {
12685 return null;
12686 }
12687
12690 {
12691 return false;
12692 }
12693
12695 {
12697 {
12700 if (!trg)
12701 {
12703 explosive = this;
12704 }
12705
12706 explosive.PairRemote(trg);
12708
12709 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12710 trg.SetPersistentPairID(persistentID);
12711 explosive.SetPersistentPairID(persistentID);
12712
12713 return true;
12714 }
12715 return false;
12716 }
12717
12720 {
12721 float ret = 1.0;
12724 ret *= GetHealth01();
12725
12726 return ret;
12727 }
12728
12729 #ifdef DEVELOPER
12730 override void SetDebugItem()
12731 {
12732 super.SetDebugItem();
12733 _itemBase = this;
12734 }
12735
12737 {
12738 string text = super.GetDebugText();
12739
12741 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12742
12743 return text;
12744 }
12745 #endif
12746
12748 {
12749 return true;
12750 }
12751
12753
12755
12757 {
12760 }
12761
12762
12770
12786}
12787
12789{
12791 if (entity)
12792 {
12793 bool is_item = entity.IsInherited(
ItemBase);
12794 if (is_item && full_quantity)
12795 {
12798 }
12799 }
12800 else
12801 {
12803 return NULL;
12804 }
12805 return entity;
12806}
12807
12809{
12810 if (item)
12811 {
12812 if (health > 0)
12813 item.SetHealth("", "", health);
12814
12815 if (item.CanHaveTemperature())
12816 {
12818 if (item.CanFreeze())
12819 item.SetFrozen(false);
12820 }
12821
12822 if (item.HasEnergyManager())
12823 {
12824 if (quantity >= 0)
12825 {
12826 item.GetCompEM().SetEnergy0To1(quantity);
12827 }
12828 else
12829 {
12831 }
12832 }
12833 else if (item.IsMagazine())
12834 {
12835 Magazine mag = Magazine.Cast(item);
12836 if (quantity >= 0)
12837 {
12838 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12839 }
12840 else
12841 {
12843 }
12844
12845 }
12846 else
12847 {
12848 if (quantity >= 0)
12849 {
12850 item.SetQuantityNormalized(quantity, false);
12851 }
12852 else
12853 {
12855 }
12856
12857 }
12858 }
12859}
12860
12861#ifdef DEVELOPER
12863#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.