Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
8222{
8224 {
8225 return true;
8226 }
8227};
8228
8229
8230
8232{
8236
8238
8241
8242
8243
8244
8245
8254
8260
8265
8270
8291 protected bool m_IsResultOfSplit
8292
8294
8299
8300
8301
8303
8307
8308
8309
8311
8314
8315
8316
8322
8323
8331
8334
8335
8337
8338
8340
8341
8346
8347
8352
8353
8355
8356
8358 {
8363
8364 if (!
GetGame().IsDedicatedServer())
8365 {
8367 {
8369
8371 {
8373 }
8374 }
8375
8378 }
8379
8380 m_OldLocation = null;
8381
8383 {
8385 }
8386
8387 if (ConfigIsExisting("headSelectionsToHide"))
8388 {
8391 }
8392
8394 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8395 {
8397 }
8398
8400
8401 m_IsResultOfSplit = false;
8402
8404 }
8405
8407 {
8408 super.InitItemVariables();
8409
8415 m_Count = ConfigGetInt(
"count");
8416
8419
8424
8427
8432
8444
8448
8449
8452 if (ConfigIsExisting("canBeSplit"))
8453 {
8456 }
8457
8459 if (ConfigIsExisting("itemBehaviour"))
8461
8462
8465 RegisterNetSyncVariableInt("m_VarLiquidType");
8466 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8467
8468 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8469 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8470 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8471
8472 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8473 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8474 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8475 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8476
8477 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8478 RegisterNetSyncVariableBool("m_IsTakeable");
8479 RegisterNetSyncVariableBool("m_IsHologram");
8480
8483 {
8486 }
8487
8489
8491 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8493
8494 }
8495
8497 {
8499 }
8500
8502 {
8505 {
8510 }
8511 }
8512
8513 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8514 {
8516 {
8519 }
8520
8522 }
8523
8525 {
8531 }
8532
8534
8536 {
8538
8539 if (!action)
8540 {
8541 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8542 return;
8543 }
8544
8546 if (!ai)
8547 {
8549 return;
8550 }
8551
8553 if (!action_array)
8554 {
8555 action_array = new array<ActionBase_Basic>;
8557 }
8558 if (LogManager.IsActionLogEnable())
8559 {
8560 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8561 }
8562
8563 if (action_array.Find(action) != -1)
8564 {
8565 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8566 }
8567 else
8568 {
8569 action_array.Insert(action);
8570 }
8571 }
8572
8574 {
8576 ActionBase action = player.GetActionManager().GetAction(actionName);
8579
8580 if (action_array)
8581 {
8582 action_array.RemoveItem(action);
8583 }
8584 }
8585
8586
8587
8589 {
8590 ActionOverrideData overrideData = new ActionOverrideData();
8594
8596 if (!actionMap)
8597 {
8600 }
8601
8602 actionMap.Insert(this.
Type(), overrideData);
8603
8604 }
8605
8607
8609
8610
8612 {
8615
8618
8619 string config_to_search = "CfgVehicles";
8620 string muzzle_owner_config;
8621
8623 {
8624 if (IsInherited(Weapon))
8625 config_to_search = "CfgWeapons";
8626
8627 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8628
8629 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8630
8632
8633 if (config_OnFire_subclass_count > 0)
8634 {
8635 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8636
8637 for (int i = 0; i < config_OnFire_subclass_count; i++)
8638 {
8639 string particle_class = "";
8641 string config_OnFire_entry = config_OnFire_class + particle_class;
8642 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8643 WPOF_array.Insert(WPOF);
8644 }
8645
8646
8648 }
8649 }
8650
8652 {
8653 config_to_search = "CfgWeapons";
8654 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8655
8656 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8657
8659
8660 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8661 {
8662 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8663
8664 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8665 {
8666 string particle_class2 = "";
8668 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8669 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8670 WPOBE_array.Insert(WPOBE);
8671 }
8672
8673
8675 }
8676 }
8677 }
8678
8679
8681 {
8684
8686 {
8687 string config_to_search = "CfgVehicles";
8688
8689 if (IsInherited(Weapon))
8690 config_to_search = "CfgWeapons";
8691
8692 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8693 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8694
8695 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8696 {
8697
8699
8701 {
8703 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8705 return;
8706 }
8707
8710
8711
8712
8714 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8715
8716 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8717 {
8718 string particle_class = "";
8720 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8722
8723 if (entry_type == CT_CLASS)
8724 {
8725 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8726 WPOOH_array.Insert(WPOF);
8727 }
8728 }
8729
8730
8732 }
8733 }
8734 }
8735
8737 {
8739 }
8740
8742 {
8744 {
8746
8749
8752
8753 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8754 }
8755 }
8756
8758 {
8760 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8761
8763 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8764
8766 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8767
8769 {
8771 }
8772 }
8773
8775 {
8777 }
8778
8780 {
8783 else
8785
8787 {
8790 }
8791 else
8792 {
8795
8798 }
8799
8801 }
8802
8804 {
8806 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8807 }
8808
8810 {
8812 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8814 }
8815
8817 {
8819 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8820 }
8821
8823 {
8826
8827 OverheatingParticle OP = new OverheatingParticle();
8832
8834 }
8835
8837 {
8840
8841 return -1;
8842 }
8843
8845 {
8847 {
8850
8851 for (int i = count; i > 0; --i)
8852 {
8853 int id = i - 1;
8856
8859
8860 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8861 {
8862 if (p)
8863 {
8866 }
8867 }
8868 }
8869 }
8870 }
8871
8873 {
8875 {
8877 {
8878 int id = i - 1;
8880
8881 if (OP)
8882 {
8884
8885 if (p)
8886 {
8888 }
8889
8890 delete OP;
8891 }
8892 }
8893
8896 }
8897 }
8898
8901 {
8902 return 0.0;
8903 }
8904
8905
8907 {
8908 return 250;
8909 }
8910
8912 {
8913 return 0;
8914 }
8915
8918 {
8920 return true;
8921
8922 return false;
8923 }
8924
8927 {
8930
8932 {
8934 }
8935 else
8936 {
8937
8939 }
8940
8942 }
8943
8950 {
8951 return -1;
8952 }
8953
8954
8955
8956
8958 {
8960 {
8962 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8963
8964 if (r_index >= 0)
8965 {
8966 InventoryLocation r_il = new InventoryLocation;
8967 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8968
8969 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8972 {
8973 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8974 }
8976 {
8977 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8978 }
8979
8980 }
8981
8982 player.GetHumanInventory().ClearUserReservedLocation(this);
8983 }
8984
8987 }
8988
8989
8990
8991
8993 {
8994 return ItemBase.m_DebugActionsMask;
8995 }
8996
8998 {
8999 return ItemBase.m_DebugActionsMask & mask;
9000 }
9001
9003 {
9004 ItemBase.m_DebugActionsMask = mask;
9005 }
9006
9008 {
9009 ItemBase.m_DebugActionsMask |= mask;
9010 }
9011
9013 {
9014 ItemBase.m_DebugActionsMask &= ~mask;
9015 }
9016
9018 {
9020 {
9022 }
9023 else
9024 {
9026 }
9027 }
9028
9029
9031 {
9032 if (GetEconomyProfile())
9033 {
9034 float q_max = GetEconomyProfile().GetQuantityMax();
9035 if (q_max > 0)
9036 {
9037 float q_min = GetEconomyProfile().GetQuantityMin();
9038 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9039
9041 {
9042 ComponentEnergyManager comp = GetCompEM();
9044 {
9046 }
9047 }
9049 {
9051
9052 }
9053
9054 }
9055 }
9056 }
9057
9060 {
9061 EntityAI parent = GetHierarchyParent();
9062
9063 if (parent)
9064 {
9065 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9066 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9067 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9068 }
9069 }
9070
9073 {
9074 EntityAI parent = GetHierarchyParent();
9075
9076 if (parent)
9077 {
9078 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9079 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9080 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9081 }
9082 }
9083
9085 {
9086
9087
9088
9089
9091
9093 {
9094 if (ScriptInputUserData.CanStoreInputUserData())
9095 {
9096 ScriptInputUserData ctx = new ScriptInputUserData;
9102 ctx.
Write(use_stack_max);
9105
9107 {
9108 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9109 }
9110 }
9111 }
9112 else if (!
GetGame().IsMultiplayer())
9113 {
9115 }
9116 }
9117
9119 {
9121 }
9122
9124 {
9126 }
9127
9129 {
9131 }
9132
9134 {
9135
9136 return false;
9137 }
9138
9140 {
9141 return false;
9142 }
9143
9147 {
9148 return false;
9149 }
9150
9152 {
9153 return "";
9154 }
9155
9157
9159 {
9160 return false;
9161 }
9162
9164 {
9165 return true;
9166 }
9167
9168
9169
9171 {
9172 return true;
9173 }
9174
9176 {
9177 return true;
9178 }
9179
9181 {
9182 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9184 }
9185
9187 {
9189 }
9190
9192 {
9194 if (!is_being_placed)
9196 SetSynchDirty();
9197 }
9198
9199
9201
9203 {
9205 }
9206
9208 {
9210 }
9211
9213 {
9214 return 1;
9215 }
9216
9218 {
9219 return false;
9220 }
9221
9223 {
9225 SetSynchDirty();
9226 }
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9263 {
9264 super.OnMovedInsideCargo(container);
9265
9266 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9267 }
9268
9269 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9270 {
9271 super.EEItemLocationChanged(oldLoc,newLoc);
9272
9273 PlayerBase new_player = null;
9274 PlayerBase old_player = null;
9275
9276 if (newLoc.GetParent())
9277 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9278
9279 if (oldLoc.GetParent())
9280 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9281
9283 {
9284 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9285
9286 if (r_index >= 0)
9287 {
9288 InventoryLocation r_il = new InventoryLocation;
9289 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9290
9291 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9294 {
9295 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9296 }
9298 {
9299 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9300 }
9301
9302 }
9303 }
9304
9306 {
9307 if (new_player)
9308 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9309
9310 if (new_player == old_player)
9311 {
9312
9313 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9314 {
9316 {
9317 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9318 {
9319 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9320 }
9321 }
9322 else
9323 {
9324 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9325 }
9326 }
9327
9328 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9329 {
9330 int type = oldLoc.GetType();
9332 {
9333 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9334 }
9336 {
9337 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9338 }
9339 }
9340 if (!m_OldLocation)
9341 {
9342 m_OldLocation = new InventoryLocation;
9343 }
9344 m_OldLocation.Copy(oldLoc);
9345 }
9346 else
9347 {
9348 if (m_OldLocation)
9349 {
9350 m_OldLocation.Reset();
9351 }
9352 }
9353
9355 }
9356 else
9357 {
9358 if (new_player)
9359 {
9360 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9361 if (res_index >= 0)
9362 {
9363 InventoryLocation il = new InventoryLocation;
9364 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9366 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9369 {
9370 il.
GetParent().GetOnReleaseLock().Invoke(it);
9371 }
9373 {
9375 }
9376
9377 }
9378 }
9380 {
9381
9383 }
9384
9385 if (m_OldLocation)
9386 {
9387 m_OldLocation.Reset();
9388 }
9389 }
9390 }
9391
9392 override void EOnContact(IEntity other, Contact extra)
9393 {
9395 {
9396 int liquidType = -1;
9398 if (impactSpeed > 0.0)
9399 {
9401 #ifndef SERVER
9403 #else
9405 SetSynchDirty();
9406 #endif
9408 }
9409 }
9410
9411 #ifdef SERVER
9412 if (GetCompEM() && GetCompEM().IsPlugged())
9413 {
9414 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9415 GetCompEM().UnplugThis();
9416 }
9417 #endif
9418 }
9419
9421
9423 {
9425 }
9426
9428 {
9429
9430 }
9431
9433 {
9434 super.OnItemLocationChanged(old_owner, new_owner);
9435
9436 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9437 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9438
9439 if (!relatedPlayer && playerNew)
9440 relatedPlayer = playerNew;
9441
9442 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9443 {
9445 if (actionMgr)
9446 {
9447 ActionBase currentAction = actionMgr.GetRunningAction();
9448 if (currentAction)
9450 }
9451 }
9452
9453 Man ownerPlayerOld = null;
9454 Man ownerPlayerNew = null;
9455
9456 if (old_owner)
9457 {
9458 if (old_owner.
IsMan())
9459 {
9460 ownerPlayerOld = Man.Cast(old_owner);
9461 }
9462 else
9463 {
9464 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9465 }
9466 }
9467 else
9468 {
9470 {
9472
9473 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9474 {
9475 GetCompEM().UnplugThis();
9476 }
9477 }
9478 }
9479
9480 if (new_owner)
9481 {
9482 if (new_owner.
IsMan())
9483 {
9484 ownerPlayerNew = Man.Cast(new_owner);
9485 }
9486 else
9487 {
9488 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9489 }
9490 }
9491
9492 if (ownerPlayerOld != ownerPlayerNew)
9493 {
9494 if (ownerPlayerOld)
9495 {
9496 array<EntityAI> subItemsExit = new array<EntityAI>;
9498 for (int i = 0; i < subItemsExit.Count(); i++)
9499 {
9502 }
9503 }
9504
9505 if (ownerPlayerNew)
9506 {
9507 array<EntityAI> subItemsEnter = new array<EntityAI>;
9509 for (int j = 0; j < subItemsEnter.Count(); j++)
9510 {
9513 }
9514 }
9515 }
9516 else if (ownerPlayerNew != null)
9517 {
9518 PlayerBase nplayer;
9519 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9520 {
9521 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9523 for (int k = 0; k < subItemsUpdate.Count(); k++)
9524 {
9526 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9527 }
9528 }
9529 }
9530
9531 if (old_owner)
9532 old_owner.OnChildItemRemoved(this);
9533 if (new_owner)
9534 new_owner.OnChildItemReceived(this);
9535 }
9536
9537
9539 {
9540 super.EEDelete(parent);
9541 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9542 if (player)
9543 {
9545
9546 if (player.IsAlive())
9547 {
9548 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9549 if (r_index >= 0)
9550 {
9551 InventoryLocation r_il = new InventoryLocation;
9552 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9553
9554 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9557 {
9558 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9559 }
9561 {
9562 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9563 }
9564
9565 }
9566
9567 player.RemoveQuickBarEntityShortcut(this);
9568 }
9569 }
9570 }
9571
9573 {
9574 super.EEKilled(killer);
9575
9578 {
9579 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9580 {
9581 if (IsMagazine())
9582 {
9583 if (Magazine.Cast(this).GetAmmoCount() > 0)
9584 {
9586 }
9587 }
9588 else
9589 {
9591 }
9592 }
9593 }
9594 }
9595
9597 {
9598 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9599
9600 super.OnWasAttached(parent, slot_id);
9601
9604
9606 }
9607
9609 {
9610 super.OnWasDetached(parent, slot_id);
9611
9614 }
9615
9617 {
9618 int idx;
9621
9622 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9623 if (inventory_slots.Count() < 1)
9624 {
9625 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9626 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9627 }
9628 else
9629 {
9630 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9631 }
9632
9633 idx = inventory_slots.Find(slot);
9634 if (idx < 0)
9635 return "";
9636
9637 return attach_types.Get(idx);
9638 }
9639
9641 {
9642 int idx = -1;
9643 string slot;
9644
9647
9648 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9649 if (inventory_slots.Count() < 1)
9650 {
9651 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9652 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9653 }
9654 else
9655 {
9656 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9657 if (detach_types.Count() < 1)
9658 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9659 }
9660
9661 for (int i = 0; i < inventory_slots.Count(); i++)
9662 {
9663 slot = inventory_slots.Get(i);
9664 }
9665
9666 if (slot != "")
9667 {
9668 if (detach_types.Count() == 1)
9669 idx = 0;
9670 else
9671 idx = inventory_slots.Find(slot);
9672 }
9673 if (idx < 0)
9674 return "";
9675
9676 return detach_types.Get(idx);
9677 }
9678
9680 {
9681
9683
9684
9685 float min_time = 1;
9686 float max_time = 3;
9687 float delay = Math.RandomFloat(min_time, max_time);
9688
9689 explode_timer.Run(delay, this, "DoAmmoExplosion");
9690 }
9691
9693 {
9694 Magazine magazine = Magazine.Cast(this);
9695 int pop_sounds_count = 6;
9696 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9697
9698
9699 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9700 string sound_name = pop_sounds[ sound_idx ];
9702
9703
9704 magazine.ServerAddAmmoCount(-1);
9705
9706
9707 float min_temp_to_explode = 100;
9708
9709 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9710 {
9712 }
9713 }
9714
9715
9716 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9717 {
9718 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9719
9720 const int CHANCE_DAMAGE_CARGO = 4;
9721 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9722 const int CHANCE_DAMAGE_NOTHING = 2;
9723
9725 {
9726 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9727 int chances;
9728 int rnd;
9729
9730 if (GetInventory().GetCargo())
9731 {
9732 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9733 rnd = Math.RandomInt(0,chances);
9734
9735 if (rnd < CHANCE_DAMAGE_CARGO)
9736 {
9738 }
9739 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9740 {
9742 }
9743 }
9744 else
9745 {
9746 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9747 rnd = Math.RandomInt(0,chances);
9748
9749 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9750 {
9752 }
9753 }
9754 }
9755 }
9756
9758 {
9759 if (GetInventory().GetCargo())
9760 {
9761 int item_count = GetInventory().GetCargo().GetItemCount();
9762 if (item_count > 0)
9763 {
9764 int random_pick = Math.RandomInt(0, item_count);
9766 if (!item.IsExplosive())
9767 {
9768 item.AddHealth("","",damage);
9769 return true;
9770 }
9771 }
9772 }
9773 return false;
9774 }
9775
9777 {
9778 int attachment_count = GetInventory().AttachmentCount();
9779 if (attachment_count > 0)
9780 {
9781 int random_pick = Math.RandomInt(0, attachment_count);
9782 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9783 if (!attachment.IsExplosive())
9784 {
9785 attachment.AddHealth("","",damage);
9786 return true;
9787 }
9788 }
9789 return false;
9790 }
9791
9793 {
9795 }
9796
9798 {
9800 return GetInventory().CanRemoveEntity();
9801
9802 return false;
9803 }
9804
9806 {
9808 return;
9809
9811 {
9812 if (ScriptInputUserData.CanStoreInputUserData())
9813 {
9814 ScriptInputUserData ctx = new ScriptInputUserData;
9819 ctx.
Write(destination_entity);
9823 }
9824 }
9825 else if (!
GetGame().IsMultiplayer())
9826 {
9828 }
9829 }
9830
9832 {
9834 return;
9835
9836 float split_quantity_new;
9840 InventoryLocation loc = new InventoryLocation;
9841
9842 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9843 {
9845 split_quantity_new = stack_max;
9846 else
9848
9849 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9850 if (new_item)
9851 {
9852 new_item.SetResultOfSplit(true);
9853 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9855 new_item.SetQuantity(split_quantity_new);
9856 }
9857 }
9858 else if (destination_entity && slot_id == -1)
9859 {
9860 if (quantity > stack_max)
9861 split_quantity_new = stack_max;
9862 else
9863 split_quantity_new = quantity;
9864
9866 {
9869 }
9870
9871 if (new_item)
9872 {
9873 new_item.SetResultOfSplit(true);
9874 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9876 new_item.SetQuantity(split_quantity_new);
9877 }
9878 }
9879 else
9880 {
9881 if (stack_max != 0)
9882 {
9884 {
9886 }
9887
9888 if (split_quantity_new == 0)
9889 {
9890 if (!
GetGame().IsMultiplayer())
9891 player.PhysicalPredictiveDropItem(this);
9892 else
9893 player.ServerDropEntity(this);
9894 return;
9895 }
9896
9898
9899 if (new_item)
9900 {
9901 new_item.SetResultOfSplit(true);
9902 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9904 new_item.SetQuantity(stack_max);
9905 new_item.PlaceOnSurface();
9906 }
9907 }
9908 }
9909 }
9910
9912 {
9914 return;
9915
9916 float split_quantity_new;
9920 InventoryLocation loc = new InventoryLocation;
9921
9922 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9923 {
9925 split_quantity_new = stack_max;
9926 else
9928
9929 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9930 if (new_item)
9931 {
9932 new_item.SetResultOfSplit(true);
9933 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9935 new_item.SetQuantity(split_quantity_new);
9936 }
9937 }
9938 else if (destination_entity && slot_id == -1)
9939 {
9940 if (quantity > stack_max)
9941 split_quantity_new = stack_max;
9942 else
9943 split_quantity_new = quantity;
9944
9946 {
9949 }
9950
9951 if (new_item)
9952 {
9953 new_item.SetResultOfSplit(true);
9954 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9956 new_item.SetQuantity(split_quantity_new);
9957 }
9958 }
9959 else
9960 {
9961 if (stack_max != 0)
9962 {
9964 {
9966 }
9967
9969
9970 if (new_item)
9971 {
9972 new_item.SetResultOfSplit(true);
9973 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9975 new_item.SetQuantity(stack_max);
9976 new_item.PlaceOnSurface();
9977 }
9978 }
9979 }
9980 }
9981
9983 {
9985 return;
9986
9988 {
9989 if (ScriptInputUserData.CanStoreInputUserData())
9990 {
9991 ScriptInputUserData ctx = new ScriptInputUserData;
9996 dst.WriteToContext(ctx);
9998 }
9999 }
10000 else if (!
GetGame().IsMultiplayer())
10001 {
10003 }
10004 }
10005
10007 {
10009 return;
10010
10012 {
10013 if (ScriptInputUserData.CanStoreInputUserData())
10014 {
10015 ScriptInputUserData ctx = new ScriptInputUserData;
10020 ctx.
Write(destination_entity);
10026 }
10027 }
10028 else if (!
GetGame().IsMultiplayer())
10029 {
10031 }
10032 }
10033
10035 {
10037 }
10038
10040 {
10042 return this;
10043
10045 float split_quantity_new;
10047 if (dst.IsValid())
10048 {
10049 int slot_id = dst.GetSlot();
10051
10052 if (quantity > stack_max)
10053 split_quantity_new = stack_max;
10054 else
10055 split_quantity_new = quantity;
10056
10058
10059 if (new_item)
10060 {
10061 new_item.SetResultOfSplit(true);
10062 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10065 }
10066
10067 return new_item;
10068 }
10069
10070 return null;
10071 }
10072
10074 {
10076 return;
10077
10079 float split_quantity_new;
10081 if (destination_entity)
10082 {
10084 if (quantity > stackable)
10085 split_quantity_new = stackable;
10086 else
10087 split_quantity_new = quantity;
10088
10089 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10090 if (new_item)
10091 {
10092 new_item.SetResultOfSplit(true);
10093 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10095 new_item.SetQuantity(split_quantity_new);
10096 }
10097 }
10098 }
10099
10101 {
10103 return;
10104
10106 {
10107 if (ScriptInputUserData.CanStoreInputUserData())
10108 {
10109 ScriptInputUserData ctx = new ScriptInputUserData;
10114 ItemBase destination_entity =
this;
10115 ctx.
Write(destination_entity);
10119 }
10120 }
10121 else if (!
GetGame().IsMultiplayer())
10122 {
10124 }
10125 }
10126
10128 {
10130 return;
10131
10133 float split_quantity_new;
10135 if (player)
10136 {
10138 if (quantity > stackable)
10139 split_quantity_new = stackable;
10140 else
10141 split_quantity_new = quantity;
10142
10143 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10144 new_item =
ItemBase.Cast(in_hands);
10145 if (new_item)
10146 {
10147 new_item.SetResultOfSplit(true);
10148 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10150 new_item.SetQuantity(split_quantity_new);
10151 }
10152 }
10153 }
10154
10156 {
10158 return;
10159
10161 float split_quantity_new = Math.Floor(quantity * 0.5);
10162
10164
10165 if (new_item)
10166 {
10167 if (new_item.GetQuantityMax() < split_quantity_new)
10168 {
10169 split_quantity_new = new_item.GetQuantityMax();
10170 }
10171
10172 new_item.SetResultOfSplit(true);
10173 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10174
10176 {
10179 }
10180 else
10181 {
10184 }
10185 }
10186 }
10187
10189 {
10191 return;
10192
10194 float split_quantity_new = Math.Floor(quantity / 2);
10195
10196 InventoryLocation invloc = new InventoryLocation;
10198
10200 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10201
10202 if (new_item)
10203 {
10204 if (new_item.GetQuantityMax() < split_quantity_new)
10205 {
10206 split_quantity_new = new_item.GetQuantityMax();
10207 }
10209 {
10212 }
10213 else
10214 {
10217 }
10218 }
10219 }
10220
10223 {
10224 SetWeightDirty();
10226
10227 if (parent)
10228 parent.OnAttachmentQuantityChangedEx(this, delta);
10229
10231 {
10233 {
10235 }
10237 {
10238 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10240 }
10241 }
10242
10243 }
10244
10247 {
10248
10249 }
10250
10253 {
10255 }
10256
10258 {
10259 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10260
10262 {
10263 if (newLevel == GameConstants.STATE_RUINED)
10264 {
10266 EntityAI parent = GetHierarchyParent();
10267 if (parent && parent.IsFireplace())
10268 {
10269 CargoBase cargo = GetInventory().GetCargo();
10270 if (cargo)
10271 {
10273 {
10275 }
10276 }
10277 }
10278 }
10279
10281 {
10282
10284 return;
10285 }
10286
10287 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10288 {
10290 }
10291 }
10292 }
10293
10294
10296 {
10297 super.OnRightClick();
10298
10300 {
10302 {
10303 if (ScriptInputUserData.CanStoreInputUserData())
10304 {
10305 vector m4[4];
10307
10308 EntityAI root = GetHierarchyRoot();
10309
10310 InventoryLocation dst = new InventoryLocation;
10312 {
10313 if (root)
10314 {
10315 root.GetTransform(m4);
10317 }
10318 else
10319 GetInventory().GetCurrentInventoryLocation(dst);
10320 }
10321 else
10322 {
10324
10325
10326 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10327 {
10328 if (root)
10329 {
10330 root.GetTransform(m4);
10332 }
10333 else
10334 GetInventory().GetCurrentInventoryLocation(dst);
10335 }
10336 else
10337 {
10338 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10339 }
10340 }
10341
10342 ScriptInputUserData ctx = new ScriptInputUserData;
10350 }
10351 }
10352 else if (!
GetGame().IsMultiplayer())
10353 {
10355 }
10356 }
10357 }
10358
10359 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10360 {
10361
10362 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10363 return false;
10364
10365 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10366 return false;
10367
10368
10370 return false;
10371
10372
10373 Magazine mag = Magazine.Cast(this);
10374 if (mag)
10375 {
10376 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10377 return false;
10378
10379 if (stack_max_limit)
10380 {
10381 Magazine other_mag = Magazine.Cast(other_item);
10382 if (other_item)
10383 {
10384 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10385 return false;
10386 }
10387
10388 }
10389 }
10390 else
10391 {
10392
10394 return false;
10395
10397 return false;
10398 }
10399
10400 PlayerBase player = null;
10401 if (CastTo(player, GetHierarchyRootPlayer()))
10402 {
10403 if (player.GetInventory().HasAttachment(this))
10404 return false;
10405
10406 if (player.IsItemsToDelete())
10407 return false;
10408 }
10409
10410 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10411 return false;
10412
10413 int slotID;
10415 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10416 return false;
10417
10418 return true;
10419 }
10420
10422 {
10424 }
10425
10427 {
10428 return m_IsResultOfSplit;
10429 }
10430
10432 {
10433 m_IsResultOfSplit = value;
10434 }
10435
10437 {
10439 }
10440
10442 {
10443 float other_item_quantity = other_item.GetQuantity();
10444 float this_free_space;
10445
10447
10449
10450 if (other_item_quantity > this_free_space)
10451 {
10452 return this_free_space;
10453 }
10454 else
10455 {
10456 return other_item_quantity;
10457 }
10458 }
10459
10461 {
10463 }
10464
10466 {
10468 return;
10469
10470 if (!IsMagazine() && other_item)
10471 {
10473 if (quantity_used != 0)
10474 {
10475 float hp1 = GetHealth01("","");
10476 float hp2 = other_item.GetHealth01("","");
10477 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10478 hpResult = hpResult / (
GetQuantity() + quantity_used);
10479
10480 hpResult *= GetMaxHealth();
10481 Math.Round(hpResult);
10482 SetHealth("", "Health", hpResult);
10483
10485 other_item.AddQuantity(-quantity_used);
10486 }
10487 }
10489 }
10490
10492 {
10493 #ifdef SERVER
10494 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10495 GetHierarchyParent().IncreaseLifetimeUp();
10496 #endif
10497 };
10498
10500 {
10501 PlayerBase p = PlayerBase.Cast(player);
10502
10503 array<int> recipesIds = p.m_Recipes;
10504 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10505 if (moduleRecipesManager)
10506 {
10507 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10508 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10509 }
10510
10511 for (int i = 0;i < recipesIds.Count(); i++)
10512 {
10513 int key = recipesIds.Get(i);
10514 string recipeName = moduleRecipesManager.GetRecipeName(key);
10516 }
10517 }
10518
10519
10520 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10521 {
10522 super.GetDebugActions(outputList);
10523
10524
10529
10530
10534
10538
10539
10542
10543
10545 {
10548 }
10549
10551
10554
10558 }
10559
10560
10561
10562
10564 {
10565 super.OnAction(action_id, player, ctx);
10566 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10567 {
10568 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10569 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10570 PlayerBase p = PlayerBase.Cast(player);
10571 if (
EActions.RECIPES_RANGE_START < 1000)
10572 {
10573 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10574 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10575 }
10576 }
10577 #ifndef SERVER
10578 else if (action_id ==
EActions.WATCH_PLAYER)
10579 {
10580 PluginDeveloper.SetDeveloperItemClientEx(player);
10581 }
10582 #endif
10584 {
10585 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10586 {
10587 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10588 OnDebugButtonPressServer(id + 1);
10589 }
10590
10591 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10592 {
10593 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10595 }
10596
10597 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10598 {
10599 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10601 }
10602
10603 else if (action_id ==
EActions.ADD_QUANTITY)
10604 {
10605 if (IsMagazine())
10606 {
10607 Magazine mag = Magazine.Cast(this);
10608 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10609 }
10610 else
10611 {
10613 }
10614
10615 if (m_EM)
10616 {
10617 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10618 }
10619
10620 }
10621
10622 else if (action_id ==
EActions.REMOVE_QUANTITY)
10623 {
10624 if (IsMagazine())
10625 {
10626 Magazine mag2 = Magazine.Cast(this);
10627 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10628 }
10629 else
10630 {
10632 }
10633 if (m_EM)
10634 {
10635 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10636 }
10637
10638 }
10639
10640 else if (action_id ==
EActions.SET_QUANTITY_0)
10641 {
10643
10644 if (m_EM)
10645 {
10646 m_EM.SetEnergy(0);
10647 }
10648 }
10649
10650 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10651 {
10653
10654 if (m_EM)
10655 {
10656 m_EM.SetEnergy(m_EM.GetEnergyMax());
10657 }
10658 }
10659
10660 else if (action_id ==
EActions.ADD_HEALTH)
10661 {
10662 AddHealth("","",GetMaxHealth("","Health")/5);
10663 }
10664 else if (action_id ==
EActions.REMOVE_HEALTH)
10665 {
10666 AddHealth("","",-GetMaxHealth("","Health")/5);
10667 }
10668 else if (action_id ==
EActions.DESTROY_HEALTH)
10669 {
10670 SetHealth01("","",0);
10671 }
10672 else if (action_id ==
EActions.WATCH_ITEM)
10673 {
10675 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10676 #ifdef DEVELOPER
10677 SetDebugDeveloper_item(this);
10678 #endif
10679 }
10680
10681 else if (action_id ==
EActions.ADD_TEMPERATURE)
10682 {
10683 AddTemperature(20);
10684
10685 }
10686
10687 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10688 {
10689 AddTemperature(-20);
10690
10691 }
10692
10693 else if (action_id ==
EActions.FLIP_FROZEN)
10694 {
10695 SetFrozen(!GetIsFrozen());
10696
10697 }
10698
10699 else if (action_id ==
EActions.ADD_WETNESS)
10700 {
10702
10703 }
10704
10705 else if (action_id ==
EActions.REMOVE_WETNESS)
10706 {
10708
10709 }
10710
10711 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10712 {
10715
10716
10717 }
10718
10719 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10720 {
10723 }
10724
10725 else if (action_id ==
EActions.MAKE_SPECIAL)
10726 {
10727 auto debugParams = DebugSpawnParams.WithPlayer(player);
10728 OnDebugSpawnEx(debugParams);
10729 }
10730
10731 else if (action_id ==
EActions.DELETE)
10732 {
10733 Delete();
10734 }
10735
10736 }
10737
10738
10739 return false;
10740 }
10741
10742
10743
10744
10748
10751
10752
10753
10755 {
10756 return false;
10757 }
10758
10759
10761 {
10762 return true;
10763 }
10764
10765
10767 {
10768 return true;
10769 }
10770
10771
10772
10774 {
10775 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10777 }
10778
10781 {
10782 return null;
10783 }
10784
10786 {
10787 return false;
10788 }
10789
10791 {
10792 return false;
10793 }
10794
10798
10799
10801 {
10802 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10803 return module_repairing.CanRepair(this, item_repair_kit);
10804 }
10805
10806
10807 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10808 {
10809 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10810 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10811 }
10812
10813
10815 {
10816
10817
10818
10819
10820
10821
10822
10823
10824 return 1;
10825 }
10826
10827
10828
10830 {
10832 }
10833
10834
10835
10837 {
10839 }
10840
10841
10850 {
10851 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10852
10853 if (player)
10854 {
10855 player.MessageStatus(text);
10856 }
10857 }
10858
10859
10868 {
10869 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10870
10871 if (player)
10872 {
10873 player.MessageAction(text);
10874 }
10875 }
10876
10877
10886 {
10887 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10888
10889 if (player)
10890 {
10891 player.MessageFriendly(text);
10892 }
10893 }
10894
10895
10904 {
10905 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10906
10907 if (player)
10908 {
10909 player.MessageImportant(text);
10910 }
10911 }
10912
10914 {
10915 return true;
10916 }
10917
10918
10919 override bool KindOf(
string tag)
10920 {
10921 bool found = false;
10922 string item_name = this.
GetType();
10925
10926 int array_size = item_tag_array.Count();
10927 for (int i = 0; i < array_size; i++)
10928 {
10929 if (item_tag_array.Get(i) == tag)
10930 {
10931 found = true;
10932 break;
10933 }
10934 }
10935 return found;
10936 }
10937
10938
10940 {
10941
10942 super.OnRPC(sender, rpc_type,ctx);
10943
10944
10945 switch (rpc_type)
10946 {
10947 #ifndef SERVER
10948 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10949 Param2<bool, string> p = new Param2<bool, string>(false, "");
10950
10952 return;
10953
10954 bool play = p.param1;
10955 string soundSet = p.param2;
10956
10957 if (play)
10958 {
10960 {
10962 {
10964 }
10965 }
10966 else
10967 {
10969 }
10970 }
10971 else
10972 {
10974 }
10975
10976 break;
10977 #endif
10978
10979 }
10980
10982 {
10984 }
10985 }
10986
10987
10988
10989
10991 {
10992 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10993 return plugin.GetID(
name);
10994 }
10995
10997 {
10998 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10999 return plugin.GetName(id);
11000 }
11001
11004 {
11005
11006
11007 int varFlags;
11008 if (!ctx.
Read(varFlags))
11009 return;
11010
11011 if (varFlags & ItemVariableFlags.FLOAT)
11012 {
11014 }
11015 }
11016
11018 {
11019
11020 super.SerializeNumericalVars(floats_out);
11021
11022
11023
11025 {
11027 }
11028
11030 {
11032 }
11033
11035 {
11037 }
11038
11040 {
11045 }
11046
11048 {
11050 }
11051 }
11052
11054 {
11055
11056 super.DeSerializeNumericalVars(floats);
11057
11058
11059 int index = 0;
11060 int mask = Math.Round(floats.Get(index));
11061
11062 index++;
11063
11065 {
11067 {
11069 }
11070 else
11071 {
11072 float quantity = floats.Get(index);
11073 SetQuantity(quantity,
true,
false,
false,
false);
11074 }
11075 index++;
11076 }
11077
11079 {
11080 float wet = floats.Get(index);
11082 index++;
11083 }
11084
11086 {
11087 int liquidtype = Math.Round(floats.Get(index));
11089 index++;
11090 }
11091
11093 {
11095 index++;
11097 index++;
11099 index++;
11101 index++;
11102 }
11103
11105 {
11106 int cleanness = Math.Round(floats.Get(index));
11108 index++;
11109 }
11110 }
11111
11113 {
11114 super.WriteVarsToCTX(ctx);
11115
11116
11118 {
11120 }
11121
11123 {
11125 }
11126
11128 {
11130 }
11131
11133 {
11134 int r,g,b,a;
11140 }
11141
11143 {
11145 }
11146 }
11147
11149 {
11150 if (!super.ReadVarsFromCTX(ctx,version))
11151 return false;
11152
11153 int intValue;
11154 float value;
11155
11156 if (version < 140)
11157 {
11158 if (!ctx.
Read(intValue))
11159 return false;
11160
11161 m_VariablesMask = intValue;
11162 }
11163
11165 {
11166 if (!ctx.
Read(value))
11167 return false;
11168
11170 {
11172 }
11173 else
11174 {
11176 }
11177 }
11178
11179 if (version < 140)
11180 {
11182 {
11183 if (!ctx.
Read(value))
11184 return false;
11185 SetTemperatureDirect(value);
11186 }
11187 }
11188
11190 {
11191 if (!ctx.
Read(value))
11192 return false;
11194 }
11195
11197 {
11198 if (!ctx.
Read(intValue))
11199 return false;
11201 }
11202
11204 {
11205 int r,g,b,a;
11207 return false;
11209 return false;
11211 return false;
11213 return false;
11214
11216 }
11217
11219 {
11220 if (!ctx.
Read(intValue))
11221 return false;
11223 }
11224
11225 if (version >= 138 && version < 140)
11226 {
11228 {
11229 if (!ctx.
Read(intValue))
11230 return false;
11231 SetFrozen(intValue);
11232 }
11233 }
11234
11235 return true;
11236 }
11237
11238
11240 {
11243 {
11245 }
11246
11247 if (!super.OnStoreLoad(ctx, version))
11248 {
11250 return false;
11251 }
11252
11253 if (version >= 114)
11254 {
11255 bool hasQuickBarIndexSaved;
11256
11257 if (!ctx.
Read(hasQuickBarIndexSaved))
11258 {
11260 return false;
11261 }
11262
11263 if (hasQuickBarIndexSaved)
11264 {
11265 int itmQBIndex;
11266
11267
11268 if (!ctx.
Read(itmQBIndex))
11269 {
11271 return false;
11272 }
11273
11274 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11275 if (itmQBIndex != -1 && parentPlayer)
11276 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11277 }
11278 }
11279 else
11280 {
11281
11282 PlayerBase player;
11283 int itemQBIndex;
11284 if (version ==
int.
MAX)
11285 {
11286 if (!ctx.
Read(itemQBIndex))
11287 {
11289 return false;
11290 }
11291 }
11292 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11293 {
11294
11295 if (!ctx.
Read(itemQBIndex))
11296 {
11298 return false;
11299 }
11300 if (itemQBIndex != -1 && player)
11301 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11302 }
11303 }
11304
11305 if (version < 140)
11306 {
11307
11308 if (!LoadVariables(ctx, version))
11309 {
11311 return false;
11312 }
11313 }
11314
11315
11317 {
11319 return false;
11320 }
11321 if (version >= 132)
11322 {
11324 if (raib)
11325 {
11327 {
11329 return false;
11330 }
11331 }
11332 }
11333
11335 return true;
11336 }
11337
11338
11339
11341 {
11342 super.OnStoreSave(ctx);
11343
11344 PlayerBase player;
11345 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11346 {
11348
11349 int itemQBIndex = -1;
11350 itemQBIndex = player.FindQuickBarEntityIndex(this);
11351 ctx.
Write(itemQBIndex);
11352 }
11353 else
11354 {
11356 }
11357
11359
11361 if (raib)
11362 {
11364 }
11365 }
11366
11367
11369 {
11370 super.AfterStoreLoad();
11371
11373 {
11375 }
11376
11378 {
11381 }
11382 }
11383
11385 {
11386 super.EEOnAfterLoad();
11387
11389 {
11391 }
11392
11395 }
11396
11398 {
11399 return false;
11400 }
11401
11402
11403
11405 {
11407 {
11408 #ifdef PLATFORM_CONSOLE
11409
11411 {
11413 if (menu)
11414 {
11416 }
11417 }
11418 #endif
11419 }
11420
11422 {
11425 }
11426
11428 {
11429 SetWeightDirty();
11431 }
11433 {
11436 }
11437
11439 {
11442 }
11444 {
11447 }
11448
11449 super.OnVariablesSynchronized();
11450 }
11451
11452
11453
11455 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11456 {
11457 if (!IsServerCheck(allow_client))
11458 return false;
11459
11461 return false;
11462
11465
11466 if (value <= (min + 0.001))
11467 value = min;
11468
11469 if (value == min)
11470 {
11471 if (destroy_config)
11472 {
11473 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11474 if (dstr)
11475 {
11477 this.Delete();
11478 return true;
11479 }
11480 }
11481 else if (destroy_forced)
11482 {
11484 this.Delete();
11485 return true;
11486 }
11487
11489 }
11490
11493
11495 {
11497
11498 if (delta)
11500 }
11501
11503
11504 return false;
11505 }
11506
11507
11509 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11510 {
11512 }
11513
11515 {
11518 }
11519
11521 {
11524 }
11525
11528 {
11529 float value_clamped = Math.Clamp(value, 0, 1);
11531 SetQuantity(result, destroy_config, destroy_forced);
11532 }
11533
11534
11537 {
11539 }
11540
11542 {
11544 }
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11556 {
11557 int slot = -1;
11558 if (GetInventory())
11559 {
11560 InventoryLocation il = new InventoryLocation;
11561 GetInventory().GetCurrentInventoryLocation(il);
11563 }
11564
11566 }
11567
11569 {
11570 float quantity_max = 0;
11571
11573 {
11574 if (attSlotID != -1)
11575 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11576
11577 if (quantity_max <= 0)
11579 }
11580
11581 if (quantity_max <= 0)
11583
11584 return quantity_max;
11585 }
11586
11588 {
11590 }
11591
11593 {
11595 }
11596
11597
11599 {
11601 }
11602
11604 {
11606 }
11607
11609 {
11611 }
11612
11613
11615 {
11616
11617 float weightEx = GetWeightEx();
11618 float special = GetInventoryAndCargoWeight();
11619 return weightEx - special;
11620 }
11621
11622
11624 {
11626 }
11627
11629 {
11631 {
11632 #ifdef DEVELOPER
11633 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11634 {
11635 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11637 }
11638 #endif
11639
11640 return GetQuantity() * GetConfigWeightModified();
11641 }
11642 else if (HasEnergyManager())
11643 {
11644 #ifdef DEVELOPER
11645 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11646 {
11647 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11648 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11649 }
11650 #endif
11651 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11652 }
11653 else
11654 {
11655 #ifdef DEVELOPER
11656 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11657 {
11658 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11659 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11660 }
11661 #endif
11662 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11663 }
11664 }
11665
11668 {
11669 int item_count = 0;
11671
11672 if (GetInventory().GetCargo() != NULL)
11673 {
11674 item_count = GetInventory().GetCargo().GetItemCount();
11675 }
11676
11677 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11678 {
11679 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11680 if (item)
11681 item_count += item.GetNumberOfItems();
11682 }
11683 return item_count;
11684 }
11685
11688 {
11689 float weight = 0;
11690 float wetness = 1;
11691 if (include_wetness)
11694 {
11695 weight = wetness * m_ConfigWeight;
11696 }
11698 {
11699 weight = 1;
11700 }
11701 return weight;
11702 }
11703
11704
11705
11707 {
11708 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11709 {
11710 GameInventory inv = GetInventory();
11711 array<EntityAI> items = new array<EntityAI>;
11713 for (int i = 0; i < items.Count(); i++)
11714 {
11716 if (item)
11717 {
11719 }
11720 }
11721 }
11722 }
11723
11724
11725
11726
11728 {
11729 float energy = 0;
11730 if (HasEnergyManager())
11731 {
11732 energy = GetCompEM().GetEnergy();
11733 }
11734 return energy;
11735 }
11736
11737
11739 {
11740 super.OnEnergyConsumed();
11741
11743 }
11744
11746 {
11747 super.OnEnergyAdded();
11748
11750 }
11751
11752
11754 {
11755 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11756 {
11758 {
11759 float energy_0to1 = GetCompEM().GetEnergy0To1();
11761 }
11762 }
11763 }
11764
11765
11767 {
11768 return ConfigGetFloat("heatIsolation");
11769 }
11770
11772 {
11774 }
11775
11777 {
11778 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11779 if (
GetGame().ConfigIsExisting(paramPath))
11781
11782 return 0.0;
11783 }
11784
11786 {
11787 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11788 if (
GetGame().ConfigIsExisting(paramPath))
11790
11791 return 0.0;
11792 }
11793
11794 override void SetWet(
float value,
bool allow_client =
false)
11795 {
11796 if (!IsServerCheck(allow_client))
11797 return;
11798
11801
11803
11804 m_VarWet = Math.Clamp(value, min, max);
11805
11807 {
11810 }
11811 }
11812
11813 override void AddWet(
float value)
11814 {
11816 }
11817
11819 {
11821 }
11822
11824 {
11826 }
11827
11829 {
11831 }
11832
11834 {
11836 }
11837
11839 {
11841 }
11842
11843 override void OnWetChanged(
float newVal,
float oldVal)
11844 {
11847 if (newLevel != oldLevel)
11848 {
11850 }
11851 }
11852
11854 {
11855 SetWeightDirty();
11856 }
11857
11859 {
11860 return GetWetLevelInternal(
m_VarWet);
11861 }
11862
11863
11864
11866 {
11868 }
11869
11871 {
11873 }
11874
11876 {
11878 }
11879
11881 {
11883 }
11884
11885
11886
11888 {
11889 if (ConfigIsExisting("itemModelLength"))
11890 {
11891 return ConfigGetFloat("itemModelLength");
11892 }
11893 return 0;
11894 }
11895
11897 {
11898 if (ConfigIsExisting("itemAttachOffset"))
11899 {
11900 return ConfigGetFloat("itemAttachOffset");
11901 }
11902 return 0;
11903 }
11904
11905 override void SetCleanness(
int value,
bool allow_client =
false)
11906 {
11907 if (!IsServerCheck(allow_client))
11908 return;
11909
11911
11913
11916 }
11917
11919 {
11921 }
11922
11924 {
11925 return true;
11926 }
11927
11928
11929
11930
11932 {
11934 }
11935
11937 {
11939 }
11940
11941
11942
11943
11944 override void SetColor(
int r,
int g,
int b,
int a)
11945 {
11951 }
11953 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11954 {
11959 }
11960
11962 {
11964 }
11965
11968 {
11969 int r,g,b,a;
11971 r = r/255;
11972 g = g/255;
11973 b = b/255;
11974 a = a/255;
11975 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11976 }
11977
11978
11979
11980 override void SetLiquidType(
int value,
bool allow_client =
false)
11981 {
11982 if (!IsServerCheck(allow_client))
11983 return;
11984
11989 }
11990
11992 {
11993 return ConfigGetInt("varLiquidTypeInit");
11994 }
11995
11997 {
11999 }
12000
12002 {
12004 SetFrozen(false);
12005 }
12006
12009 {
12010 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12011 }
12012
12013
12016 {
12017 PlayerBase nplayer;
12018 if (PlayerBase.CastTo(nplayer, player))
12019 {
12021
12022 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12023 }
12024 }
12025
12026
12029 {
12030 PlayerBase nplayer;
12031 if (PlayerBase.CastTo(nplayer,player))
12032 {
12033
12034 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12035
12036 }
12037
12038
12039 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12040
12041
12042 if (HasEnergyManager())
12043 {
12044 GetCompEM().UpdatePlugState();
12045 }
12046 }
12047
12048
12050 {
12051 super.OnPlacementStarted(player);
12052
12054 }
12055
12056 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12057 {
12059 {
12060 m_AdminLog.OnPlacementComplete(player,
this);
12061 }
12062
12063 super.OnPlacementComplete(player, position, orientation);
12064 }
12065
12066
12067
12068
12069
12071 {
12073 {
12074 return true;
12075 }
12076 else
12077 {
12078 return false;
12079 }
12080 }
12081
12082
12084 {
12086 {
12088 }
12089 }
12090
12091
12093 {
12095 }
12096
12098 {
12100 }
12101
12102 override void InsertAgent(
int agent,
float count = 1)
12103 {
12104 if (count < 1)
12105 return;
12106
12108 }
12109
12112 {
12114 }
12115
12116
12118 {
12120 }
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12164 {
12166 return false;
12167 return true;
12168 }
12169
12171 {
12172
12174 }
12175
12176
12179 {
12180 super.CheckForRoofLimited(timeTresholdMS);
12181
12183 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12184 {
12185 m_PreviousRoofTestTime = time;
12186 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12187 }
12188 }
12189
12190
12192 {
12194 {
12195 return 0;
12196 }
12197
12198 if (GetInventory().GetAttachmentSlotsCount() != 0)
12199 {
12200 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12201 if (filter)
12202 return filter.GetProtectionLevel(type, false, system);
12203 else
12204 return 0;
12205 }
12206
12207 string subclassPath, entryName;
12208
12209 switch (type)
12210 {
12212 entryName = "biological";
12213 break;
12215 entryName = "chemical";
12216 break;
12217 default:
12218 entryName = "biological";
12219 break;
12220 }
12221
12222 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12223
12225 }
12226
12227
12228
12231 {
12232 if (!IsMagazine())
12234
12236 }
12237
12238
12239
12240
12241
12246 {
12247 return true;
12248 }
12249
12251 {
12253 }
12254
12255
12256
12257
12258
12260 {
12261 if (parent)
12262 {
12263 if (parent.IsInherited(DayZInfected))
12264 return true;
12265
12266 if (!parent.IsRuined())
12267 return true;
12268 }
12269
12270 return true;
12271 }
12272
12274 {
12275 if (!super.CanPutAsAttachment(parent))
12276 {
12277 return false;
12278 }
12279
12280 if (!IsRuined() && !parent.IsRuined())
12281 {
12282 return true;
12283 }
12284
12285 return false;
12286 }
12287
12289 {
12290
12291
12292
12293
12294 return super.CanReceiveItemIntoCargo(item);
12295 }
12296
12298 {
12299
12300
12301
12302
12303 GameInventory attachmentInv = attachment.GetInventory();
12305 {
12306 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12307 return false;
12308 }
12309
12310 InventoryLocation loc = new InventoryLocation();
12311 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12312 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12313 return false;
12314
12315 return super.CanReceiveAttachment(attachment, slotId);
12316 }
12317
12319 {
12320 if (!super.CanReleaseAttachment(attachment))
12321 return false;
12322
12323 return GetInventory().AreChildrenAccessible();
12324 }
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12347 {
12348 int id = muzzle_owner.GetMuzzleID();
12349 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12350
12351 if (WPOF_array)
12352 {
12353 for (int i = 0; i < WPOF_array.Count(); i++)
12354 {
12355 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12356
12357 if (WPOF)
12358 {
12359 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12360 }
12361 }
12362 }
12363 }
12364
12365
12367 {
12368 int id = muzzle_owner.GetMuzzleID();
12370
12371 if (WPOBE_array)
12372 {
12373 for (int i = 0; i < WPOBE_array.Count(); i++)
12374 {
12375 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12376
12377 if (WPOBE)
12378 {
12379 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12380 }
12381 }
12382 }
12383 }
12384
12385
12387 {
12388 int id = muzzle_owner.GetMuzzleID();
12389 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12390
12391 if (WPOOH_array)
12392 {
12393 for (int i = 0; i < WPOOH_array.Count(); i++)
12394 {
12395 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12396
12397 if (WPOOH)
12398 {
12399 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12400 }
12401 }
12402 }
12403 }
12404
12405
12407 {
12408 int id = muzzle_owner.GetMuzzleID();
12409 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12410
12411 if (WPOOH_array)
12412 {
12413 for (int i = 0; i < WPOOH_array.Count(); i++)
12414 {
12415 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12416
12417 if (WPOOH)
12418 {
12419 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12420 }
12421 }
12422 }
12423 }
12424
12425
12427 {
12428 int id = muzzle_owner.GetMuzzleID();
12429 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12430
12431 if (WPOOH_array)
12432 {
12433 for (int i = 0; i < WPOOH_array.Count(); i++)
12434 {
12435 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12436
12437 if (WPOOH)
12438 {
12439 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12440 }
12441 }
12442 }
12443 }
12444
12445
12446
12448 {
12450 {
12451 return true;
12452 }
12453
12454 return false;
12455 }
12456
12458 {
12460 {
12461 return true;
12462 }
12463
12464 return false;
12465 }
12466
12468 {
12470 {
12471 return true;
12472 }
12473
12474 return false;
12475 }
12476
12478 {
12479 return false;
12480 }
12481
12484 {
12485 return UATimeSpent.DEFAULT_DEPLOY;
12486 }
12487
12488
12489
12490
12492 {
12494 SetSynchDirty();
12495 }
12496
12498 {
12500 }
12501
12502
12504 {
12505 return false;
12506 }
12507
12510 {
12511 string att_type = "None";
12512
12513 if (ConfigIsExisting("soundAttType"))
12514 {
12515 att_type = ConfigGetString("soundAttType");
12516 }
12517
12519 }
12520
12522 {
12524 }
12525
12526
12527
12528
12529
12533
12535 {
12538
12540 }
12541
12542
12544 {
12546 return;
12547
12549
12552
12555
12556 SoundParameters params = new SoundParameters();
12560 }
12561
12562
12564 {
12566 return;
12567
12569 SetSynchDirty();
12570
12573 }
12574
12575
12577 {
12579 return;
12580
12582 SetSynchDirty();
12583
12586 }
12587
12589 {
12591 }
12592
12594 {
12596 }
12597
12600 {
12601 if (!
GetGame().IsDedicatedServer())
12602 {
12603 if (ConfigIsExisting("attachSoundSet"))
12604 {
12605 string cfg_path = "";
12606 string soundset = "";
12607 string type_name =
GetType();
12608
12611 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12612 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12613
12614 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12615 {
12616 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12617 {
12618 if (cfg_slot_array[i] == slot_type)
12619 {
12620 soundset = cfg_soundset_array[i];
12621 break;
12622 }
12623 }
12624 }
12625
12626 if (soundset != "")
12627 {
12628 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12630 }
12631 }
12632 }
12633 }
12634
12636 {
12637
12638 }
12639
12640 void OnApply(PlayerBase player);
12641
12643 {
12644 return 1.0;
12645 };
12646
12648 {
12650 }
12651
12653 {
12655 }
12656
12658
12660 {
12661 SetDynamicPhysicsLifeTime(0.01);
12663 }
12664
12666 {
12667 array<string> zone_names = new array<string>;
12668 GetDamageZones(zone_names);
12669 for (int i = 0; i < zone_names.Count(); i++)
12670 {
12671 SetHealthMax(zone_names.Get(i),"Health");
12672 }
12673 SetHealthMax("","Health");
12674 }
12675
12678 {
12679 float global_health = GetHealth01("","Health");
12680 array<string> zones = new array<string>;
12681 GetDamageZones(zones);
12682
12683 for (int i = 0; i < zones.Count(); i++)
12684 {
12685 SetHealth01(zones.Get(i),"Health",global_health);
12686 }
12687 }
12688
12691 {
12692 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12693 }
12694
12696 {
12697 if (!hasRootAsPlayer)
12698 {
12699 if (refParentIB)
12700 {
12701
12702 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12703 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12704
12705 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12706 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12707
12710 }
12711 else
12712 {
12713
12716 }
12717 }
12718 }
12719
12721 {
12723 {
12724 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12725 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12726 {
12727 float heatPermCoef = 1.0;
12729 while (ent)
12730 {
12731 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12732 ent = ent.GetHierarchyParent();
12733 }
12734
12735 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12736 }
12737 }
12738 }
12739
12741 {
12742
12743 EntityAI parent = GetHierarchyParent();
12744 if (!parent)
12745 {
12746 hasParent = false;
12747 hasRootAsPlayer = false;
12748 }
12749 else
12750 {
12751 hasParent = true;
12752 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12753 refParentIB =
ItemBase.Cast(parent);
12754 }
12755 }
12756
12757 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12758 {
12759
12760 }
12761
12763 {
12764
12765 return false;
12766 }
12767
12769 {
12770
12771
12772 return false;
12773 }
12774
12776 {
12777
12778 return false;
12779 }
12780
12783 {
12784 return !GetIsFrozen() &&
IsOpen();
12785 }
12786
12788 {
12789 bool hasParent = false, hasRootAsPlayer = false;
12791
12792 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12793 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12794
12795 if (wwtu || foodDecay)
12796 {
12800
12801 if (processWetness || processTemperature || processDecay)
12802 {
12804
12805 if (processWetness)
12806 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12807
12808 if (processTemperature)
12810
12811 if (processDecay)
12812 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12813 }
12814 }
12815 }
12816
12819 {
12821 }
12822
12824 {
12827
12828 return super.GetTemperatureFreezeThreshold();
12829 }
12830
12832 {
12835
12836 return super.GetTemperatureThawThreshold();
12837 }
12838
12840 {
12843
12844 return super.GetItemOverheatThreshold();
12845 }
12846
12848 {
12850 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12851
12852 return super.GetTemperatureFreezeTime();
12853 }
12854
12856 {
12858 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12859
12860 return super.GetTemperatureThawTime();
12861 }
12862
12867
12869 {
12870 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12871 }
12872
12874 {
12875 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12876 }
12877
12880 {
12882 }
12883
12885 {
12887 }
12888
12890 {
12892 }
12893
12896 {
12897 return null;
12898 }
12899
12902 {
12903 return false;
12904 }
12905
12907 {
12909 {
12912 if (!trg)
12913 {
12915 explosive = this;
12916 }
12917
12918 explosive.PairRemote(trg);
12920
12921 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12922 trg.SetPersistentPairID(persistentID);
12923 explosive.SetPersistentPairID(persistentID);
12924
12925 return true;
12926 }
12927 return false;
12928 }
12929
12932 {
12933 float ret = 1.0;
12936 ret *= GetHealth01();
12937
12938 return ret;
12939 }
12940
12941 #ifdef DEVELOPER
12942 override void SetDebugItem()
12943 {
12944 super.SetDebugItem();
12945 _itemBase = this;
12946 }
12947
12949 {
12950 string text = super.GetDebugText();
12951
12953 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12954
12955 return text;
12956 }
12957 #endif
12958
12960 {
12961 return true;
12962 }
12963
12965
12967
12969 {
12972 }
12973
12974
12982
12998}
12999
13001{
13003 if (entity)
13004 {
13005 bool is_item = entity.IsInherited(
ItemBase);
13006 if (is_item && full_quantity)
13007 {
13010 }
13011 }
13012 else
13013 {
13015 return NULL;
13016 }
13017 return entity;
13018}
13019
13021{
13022 if (item)
13023 {
13024 if (health > 0)
13025 item.SetHealth("", "", health);
13026
13027 if (item.CanHaveTemperature())
13028 {
13030 if (item.CanFreeze())
13031 item.SetFrozen(false);
13032 }
13033
13034 if (item.HasEnergyManager())
13035 {
13036 if (quantity >= 0)
13037 {
13038 item.GetCompEM().SetEnergy0To1(quantity);
13039 }
13040 else
13041 {
13043 }
13044 }
13045 else if (item.IsMagazine())
13046 {
13047 Magazine mag = Magazine.Cast(item);
13048 if (quantity >= 0)
13049 {
13050 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13051 }
13052 else
13053 {
13055 }
13056
13057 }
13058 else
13059 {
13060 if (quantity >= 0)
13061 {
13062 item.SetQuantityNormalized(quantity, false);
13063 }
13064 else
13065 {
13067 }
13068
13069 }
13070 }
13071}
13072
13073#ifdef DEVELOPER
13075#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.