8424{
8426 {
8427 return true;
8428 }
8429};
8430
8431
8432
8434{
8438
8440
8443
8444
8445
8446
8447
8456
8462
8467
8472
8493 protected bool m_IsResultOfSplit
8494
8496
8501
8502
8503
8505
8509
8510
8511
8513
8516
8517
8518
8524
8525
8533
8536
8537
8539
8540
8542
8543
8548
8549
8554
8555
8557
8558
8560 {
8565
8566 if (!
GetGame().IsDedicatedServer())
8567 {
8569 {
8571
8573 {
8575 }
8576 }
8577
8580 }
8581
8582 m_OldLocation = null;
8583
8585 {
8587 }
8588
8589 if (ConfigIsExisting("headSelectionsToHide"))
8590 {
8593 }
8594
8596 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8597 {
8599 }
8600
8602
8603 m_IsResultOfSplit = false;
8604
8606 }
8607
8609 {
8610 super.InitItemVariables();
8611
8617 m_Count = ConfigGetInt(
"count");
8618
8621
8626
8629
8634
8646
8650
8651
8654 if (ConfigIsExisting("canBeSplit"))
8655 {
8658 }
8659
8661 if (ConfigIsExisting("itemBehaviour"))
8663
8664
8667 RegisterNetSyncVariableInt("m_VarLiquidType");
8668 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8669
8670 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8671 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8672 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8673
8674 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8675 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8676 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8677 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8678
8679 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8680 RegisterNetSyncVariableBool("m_IsTakeable");
8681 RegisterNetSyncVariableBool("m_IsHologram");
8682
8685 {
8688 }
8689
8691
8693 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8695
8696 }
8697
8699 {
8701 }
8702
8704 {
8707 {
8712 }
8713 }
8714
8715 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8716 {
8718 {
8721 }
8722
8724 }
8725
8727 {
8733 }
8734
8736
8738 {
8740
8741 if (!action)
8742 {
8743 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8744 return;
8745 }
8746
8748 if (!ai)
8749 {
8751 return;
8752 }
8753
8755 if (!action_array)
8756 {
8757 action_array = new array<ActionBase_Basic>;
8759 }
8760 if (LogManager.IsActionLogEnable())
8761 {
8762 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8763 }
8764
8765 if (action_array.Find(action) != -1)
8766 {
8767 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8768 }
8769 else
8770 {
8771 action_array.Insert(action);
8772 }
8773 }
8774
8776 {
8778 ActionBase action = player.GetActionManager().GetAction(actionName);
8781
8782 if (action_array)
8783 {
8784 action_array.RemoveItem(action);
8785 }
8786 }
8787
8788
8789
8791 {
8792 ActionOverrideData overrideData = new ActionOverrideData();
8796
8798 if (!actionMap)
8799 {
8802 }
8803
8804 actionMap.Insert(this.
Type(), overrideData);
8805
8806 }
8807
8809
8811
8812
8814 {
8817
8820
8821 string config_to_search = "CfgVehicles";
8822 string muzzle_owner_config;
8823
8825 {
8826 if (IsInherited(Weapon))
8827 config_to_search = "CfgWeapons";
8828
8829 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8830
8831 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8832
8834
8835 if (config_OnFire_subclass_count > 0)
8836 {
8837 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8838
8839 for (int i = 0; i < config_OnFire_subclass_count; i++)
8840 {
8841 string particle_class = "";
8843 string config_OnFire_entry = config_OnFire_class + particle_class;
8844 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8845 WPOF_array.Insert(WPOF);
8846 }
8847
8848
8850 }
8851 }
8852
8854 {
8855 config_to_search = "CfgWeapons";
8856 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8857
8858 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8859
8861
8862 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8863 {
8864 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8865
8866 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8867 {
8868 string particle_class2 = "";
8870 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8871 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8872 WPOBE_array.Insert(WPOBE);
8873 }
8874
8875
8877 }
8878 }
8879 }
8880
8881
8883 {
8886
8888 {
8889 string config_to_search = "CfgVehicles";
8890
8891 if (IsInherited(Weapon))
8892 config_to_search = "CfgWeapons";
8893
8894 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8895 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8896
8897 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8898 {
8899
8901
8903 {
8905 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8907 return;
8908 }
8909
8912
8913
8914
8916 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8917
8918 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8919 {
8920 string particle_class = "";
8922 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8924
8925 if (entry_type == CT_CLASS)
8926 {
8927 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8928 WPOOH_array.Insert(WPOF);
8929 }
8930 }
8931
8932
8934 }
8935 }
8936 }
8937
8939 {
8941 }
8942
8944 {
8946 {
8948
8951
8954
8955 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8956 }
8957 }
8958
8960 {
8962 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8963
8965 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8966
8968 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8969
8971 {
8973 }
8974 }
8975
8977 {
8979 }
8980
8982 {
8985 else
8987
8989 {
8992 }
8993 else
8994 {
8997
9000 }
9001
9003 }
9004
9006 {
9008 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9009 }
9010
9012 {
9014 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9016 }
9017
9019 {
9021 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9022 }
9023
9025 {
9028
9029 OverheatingParticle OP = new OverheatingParticle();
9034
9036 }
9037
9039 {
9042
9043 return -1;
9044 }
9045
9047 {
9049 {
9052
9053 for (int i = count; i > 0; --i)
9054 {
9055 int id = i - 1;
9058
9061
9062 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9063 {
9064 if (p)
9065 {
9068 }
9069 }
9070 }
9071 }
9072 }
9073
9075 {
9077 {
9079 {
9080 int id = i - 1;
9082
9083 if (OP)
9084 {
9086
9087 if (p)
9088 {
9090 }
9091
9092 delete OP;
9093 }
9094 }
9095
9098 }
9099 }
9100
9103 {
9104 return 0.0;
9105 }
9106
9107
9109 {
9110 return 250;
9111 }
9112
9114 {
9115 return 0;
9116 }
9117
9120 {
9122 return true;
9123
9124 return false;
9125 }
9126
9129 {
9132
9134 {
9136 }
9137 else
9138 {
9139
9141 }
9142
9144 }
9145
9152 {
9153 return -1;
9154 }
9155
9156
9157
9158
9160 {
9162 {
9164 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9165
9166 if (r_index >= 0)
9167 {
9168 InventoryLocation r_il = new InventoryLocation;
9169 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9170
9171 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9174 {
9175 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9176 }
9178 {
9179 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9180 }
9181
9182 }
9183
9184 player.GetHumanInventory().ClearUserReservedLocation(this);
9185 }
9186
9189 }
9190
9191
9192
9193
9195 {
9196 return ItemBase.m_DebugActionsMask;
9197 }
9198
9200 {
9201 return ItemBase.m_DebugActionsMask & mask;
9202 }
9203
9205 {
9206 ItemBase.m_DebugActionsMask = mask;
9207 }
9208
9210 {
9211 ItemBase.m_DebugActionsMask |= mask;
9212 }
9213
9215 {
9216 ItemBase.m_DebugActionsMask &= ~mask;
9217 }
9218
9220 {
9222 {
9224 }
9225 else
9226 {
9228 }
9229 }
9230
9231
9233 {
9234 if (GetEconomyProfile())
9235 {
9236 float q_max = GetEconomyProfile().GetQuantityMax();
9237 if (q_max > 0)
9238 {
9239 float q_min = GetEconomyProfile().GetQuantityMin();
9240 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9241
9243 {
9244 ComponentEnergyManager comp = GetCompEM();
9246 {
9248 }
9249 }
9251 {
9253
9254 }
9255
9256 }
9257 }
9258 }
9259
9262 {
9263 EntityAI parent = GetHierarchyParent();
9264
9265 if (parent)
9266 {
9267 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9268 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9269 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9270 }
9271 }
9272
9275 {
9276 EntityAI parent = GetHierarchyParent();
9277
9278 if (parent)
9279 {
9280 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9281 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9282 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9283 }
9284 }
9285
9287 {
9288
9289
9290
9291
9293
9295 {
9296 if (ScriptInputUserData.CanStoreInputUserData())
9297 {
9298 ScriptInputUserData ctx = new ScriptInputUserData;
9304 ctx.
Write(use_stack_max);
9307
9309 {
9310 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9311 }
9312 }
9313 }
9314 else if (!
GetGame().IsMultiplayer())
9315 {
9317 }
9318 }
9319
9321 {
9323 }
9324
9326 {
9328 }
9329
9331 {
9333 }
9334
9336 {
9337
9338 return false;
9339 }
9340
9342 {
9343 return false;
9344 }
9345
9349 {
9350 return false;
9351 }
9352
9354 {
9355 return "";
9356 }
9357
9359
9361 {
9362 return false;
9363 }
9364
9366 {
9367 return true;
9368 }
9369
9370
9371
9373 {
9374 return true;
9375 }
9376
9378 {
9379 return true;
9380 }
9381
9383 {
9384 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9386 }
9387
9389 {
9391 }
9392
9394 {
9396 if (!is_being_placed)
9398 SetSynchDirty();
9399 }
9400
9401
9403
9405 {
9407 }
9408
9410 {
9412 }
9413
9415 {
9416 return 1;
9417 }
9418
9420 {
9421 return false;
9422 }
9423
9425 {
9427 SetSynchDirty();
9428 }
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9465 {
9466 super.OnMovedInsideCargo(container);
9467
9468 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9469 }
9470
9471 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9472 {
9473 super.EEItemLocationChanged(oldLoc,newLoc);
9474
9475 PlayerBase new_player = null;
9476 PlayerBase old_player = null;
9477
9478 if (newLoc.GetParent())
9479 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9480
9481 if (oldLoc.GetParent())
9482 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9483
9485 {
9486 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9487
9488 if (r_index >= 0)
9489 {
9490 InventoryLocation r_il = new InventoryLocation;
9491 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9492
9493 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9496 {
9497 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9498 }
9500 {
9501 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9502 }
9503
9504 }
9505 }
9506
9508 {
9509 if (new_player)
9510 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9511
9512 if (new_player == old_player)
9513 {
9514
9515 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9516 {
9518 {
9519 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9520 {
9521 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9522 }
9523 }
9524 else
9525 {
9526 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9527 }
9528 }
9529
9530 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9531 {
9532 int type = oldLoc.GetType();
9534 {
9535 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9536 }
9538 {
9539 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9540 }
9541 }
9542 if (!m_OldLocation)
9543 {
9544 m_OldLocation = new InventoryLocation;
9545 }
9546 m_OldLocation.Copy(oldLoc);
9547 }
9548 else
9549 {
9550 if (m_OldLocation)
9551 {
9552 m_OldLocation.Reset();
9553 }
9554 }
9555
9557 }
9558 else
9559 {
9560 if (new_player)
9561 {
9562 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9563 if (res_index >= 0)
9564 {
9565 InventoryLocation il = new InventoryLocation;
9566 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9568 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9571 {
9572 il.
GetParent().GetOnReleaseLock().Invoke(it);
9573 }
9575 {
9577 }
9578
9579 }
9580 }
9582 {
9583
9585 }
9586
9587 if (m_OldLocation)
9588 {
9589 m_OldLocation.Reset();
9590 }
9591 }
9592 }
9593
9594 override void EOnContact(IEntity other, Contact extra)
9595 {
9597 {
9598 int liquidType = -1;
9600 if (impactSpeed > 0.0)
9601 {
9603 #ifndef SERVER
9605 #else
9607 SetSynchDirty();
9608 #endif
9610 }
9611 }
9612
9613 #ifdef SERVER
9614 if (GetCompEM() && GetCompEM().IsPlugged())
9615 {
9616 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9617 GetCompEM().UnplugThis();
9618 }
9619 #endif
9620 }
9621
9623
9625 {
9627 }
9628
9630 {
9631
9632 }
9633
9635 {
9636 super.OnItemLocationChanged(old_owner, new_owner);
9637
9638 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9639 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9640
9641 if (!relatedPlayer && playerNew)
9642 relatedPlayer = playerNew;
9643
9644 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9645 {
9647 if (actionMgr)
9648 {
9649 ActionBase currentAction = actionMgr.GetRunningAction();
9650 if (currentAction)
9652 }
9653 }
9654
9655 Man ownerPlayerOld = null;
9656 Man ownerPlayerNew = null;
9657
9658 if (old_owner)
9659 {
9660 if (old_owner.
IsMan())
9661 {
9662 ownerPlayerOld = Man.Cast(old_owner);
9663 }
9664 else
9665 {
9666 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9667 }
9668 }
9669 else
9670 {
9672 {
9674
9675 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9676 {
9677 GetCompEM().UnplugThis();
9678 }
9679 }
9680 }
9681
9682 if (new_owner)
9683 {
9684 if (new_owner.
IsMan())
9685 {
9686 ownerPlayerNew = Man.Cast(new_owner);
9687 }
9688 else
9689 {
9690 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9691 }
9692 }
9693
9694 if (ownerPlayerOld != ownerPlayerNew)
9695 {
9696 if (ownerPlayerOld)
9697 {
9698 array<EntityAI> subItemsExit = new array<EntityAI>;
9700 for (int i = 0; i < subItemsExit.Count(); i++)
9701 {
9704 }
9705 }
9706
9707 if (ownerPlayerNew)
9708 {
9709 array<EntityAI> subItemsEnter = new array<EntityAI>;
9711 for (int j = 0; j < subItemsEnter.Count(); j++)
9712 {
9715 }
9716 }
9717 }
9718 else if (ownerPlayerNew != null)
9719 {
9720 PlayerBase nplayer;
9721 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9722 {
9723 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9725 for (int k = 0; k < subItemsUpdate.Count(); k++)
9726 {
9728 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9729 }
9730 }
9731 }
9732
9733 if (old_owner)
9734 old_owner.OnChildItemRemoved(this);
9735 if (new_owner)
9736 new_owner.OnChildItemReceived(this);
9737 }
9738
9739
9741 {
9742 super.EEDelete(parent);
9743 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9744 if (player)
9745 {
9747
9748 if (player.IsAlive())
9749 {
9750 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9751 if (r_index >= 0)
9752 {
9753 InventoryLocation r_il = new InventoryLocation;
9754 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9755
9756 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9759 {
9760 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9761 }
9763 {
9764 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9765 }
9766
9767 }
9768
9769 player.RemoveQuickBarEntityShortcut(this);
9770 }
9771 }
9772 }
9773
9775 {
9776 super.EEKilled(killer);
9777
9780 {
9781 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9782 {
9783 if (IsMagazine())
9784 {
9785 if (Magazine.Cast(this).GetAmmoCount() > 0)
9786 {
9788 }
9789 }
9790 else
9791 {
9793 }
9794 }
9795 }
9796 }
9797
9799 {
9800 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9801
9802 super.OnWasAttached(parent, slot_id);
9803
9806
9808 }
9809
9811 {
9812 super.OnWasDetached(parent, slot_id);
9813
9816 }
9817
9819 {
9820 int idx;
9823
9824 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9825 if (inventory_slots.Count() < 1)
9826 {
9827 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9828 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9829 }
9830 else
9831 {
9832 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9833 }
9834
9835 idx = inventory_slots.Find(slot);
9836 if (idx < 0)
9837 return "";
9838
9839 return attach_types.Get(idx);
9840 }
9841
9843 {
9844 int idx = -1;
9845 string slot;
9846
9849
9850 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9851 if (inventory_slots.Count() < 1)
9852 {
9853 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9854 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9855 }
9856 else
9857 {
9858 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9859 if (detach_types.Count() < 1)
9860 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9861 }
9862
9863 for (int i = 0; i < inventory_slots.Count(); i++)
9864 {
9865 slot = inventory_slots.Get(i);
9866 }
9867
9868 if (slot != "")
9869 {
9870 if (detach_types.Count() == 1)
9871 idx = 0;
9872 else
9873 idx = inventory_slots.Find(slot);
9874 }
9875 if (idx < 0)
9876 return "";
9877
9878 return detach_types.Get(idx);
9879 }
9880
9882 {
9883
9885
9886
9887 float min_time = 1;
9888 float max_time = 3;
9889 float delay = Math.RandomFloat(min_time, max_time);
9890
9891 explode_timer.Run(delay, this, "DoAmmoExplosion");
9892 }
9893
9895 {
9896 Magazine magazine = Magazine.Cast(this);
9897 int pop_sounds_count = 6;
9898 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9899
9900
9901 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9902 string sound_name = pop_sounds[ sound_idx ];
9904
9905
9906 magazine.ServerAddAmmoCount(-1);
9907
9908
9909 float min_temp_to_explode = 100;
9910
9911 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9912 {
9914 }
9915 }
9916
9917
9918 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9919 {
9920 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9921
9922 const int CHANCE_DAMAGE_CARGO = 4;
9923 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9924 const int CHANCE_DAMAGE_NOTHING = 2;
9925
9927 {
9928 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9929 int chances;
9930 int rnd;
9931
9932 if (GetInventory().GetCargo())
9933 {
9934 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9935 rnd = Math.RandomInt(0,chances);
9936
9937 if (rnd < CHANCE_DAMAGE_CARGO)
9938 {
9940 }
9941 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9942 {
9944 }
9945 }
9946 else
9947 {
9948 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9949 rnd = Math.RandomInt(0,chances);
9950
9951 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9952 {
9954 }
9955 }
9956 }
9957 }
9958
9960 {
9961 if (GetInventory().GetCargo())
9962 {
9963 int item_count = GetInventory().GetCargo().GetItemCount();
9964 if (item_count > 0)
9965 {
9966 int random_pick = Math.RandomInt(0, item_count);
9968 if (!item.IsExplosive())
9969 {
9970 item.AddHealth("","",damage);
9971 return true;
9972 }
9973 }
9974 }
9975 return false;
9976 }
9977
9979 {
9980 int attachment_count = GetInventory().AttachmentCount();
9981 if (attachment_count > 0)
9982 {
9983 int random_pick = Math.RandomInt(0, attachment_count);
9984 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9985 if (!attachment.IsExplosive())
9986 {
9987 attachment.AddHealth("","",damage);
9988 return true;
9989 }
9990 }
9991 return false;
9992 }
9993
9995 {
9997 }
9998
10000 {
10002 return GetInventory().CanRemoveEntity();
10003
10004 return false;
10005 }
10006
10008 {
10009
10011 return false;
10012
10013
10015 return false;
10016
10017
10018
10020 if (delta == 0)
10021 return false;
10022
10023
10024 return true;
10025 }
10026
10028 {
10030 {
10031 if (ScriptInputUserData.CanStoreInputUserData())
10032 {
10033 ScriptInputUserData ctx = new ScriptInputUserData;
10038 ctx.
Write(destination_entity);
10040 ctx.
Write(slot_id);
10042 }
10043 }
10044 else if (!
GetGame().IsMultiplayer())
10045 {
10047 }
10048 }
10049
10051 {
10052 float split_quantity_new;
10056 InventoryLocation loc = new InventoryLocation;
10057
10058 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10059 {
10061 split_quantity_new = stack_max;
10062 else
10064
10066 {
10067 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10068 if (new_item)
10069 {
10070 new_item.SetResultOfSplit(true);
10071 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10073 new_item.
SetQuantity(split_quantity_new,
false,
true);
10074 }
10075 }
10076 }
10077 else if (destination_entity && slot_id == -1)
10078 {
10079 if (quantity > stack_max)
10080 split_quantity_new = stack_max;
10081 else
10082 split_quantity_new = quantity;
10083
10085 {
10087 {
10090 }
10091
10092 if (new_item)
10093 {
10094 new_item.SetResultOfSplit(true);
10095 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10097 new_item.
SetQuantity(split_quantity_new,
false,
true);
10098 }
10099 }
10100 }
10101 else
10102 {
10103 if (stack_max != 0)
10104 {
10106 {
10108 }
10109
10110 if (split_quantity_new == 0)
10111 {
10112 if (!
GetGame().IsMultiplayer())
10113 player.PhysicalPredictiveDropItem(this);
10114 else
10115 player.ServerDropEntity(this);
10116 return;
10117 }
10118
10120 {
10122
10123 if (new_item)
10124 {
10125 new_item.SetResultOfSplit(true);
10126 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10129 new_item.PlaceOnSurface();
10130 }
10131 }
10132 }
10133 }
10134 }
10135
10137 {
10138 float split_quantity_new;
10142 InventoryLocation loc = new InventoryLocation;
10143
10144 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10145 {
10147 split_quantity_new = stack_max;
10148 else
10150
10152 {
10153 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10154 if (new_item)
10155 {
10156 new_item.SetResultOfSplit(true);
10157 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10159 new_item.
SetQuantity(split_quantity_new,
false,
true);
10160 }
10161 }
10162 }
10163 else if (destination_entity && slot_id == -1)
10164 {
10165 if (quantity > stack_max)
10166 split_quantity_new = stack_max;
10167 else
10168 split_quantity_new = quantity;
10169
10171 {
10173 {
10176 }
10177
10178 if (new_item)
10179 {
10180 new_item.SetResultOfSplit(true);
10181 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10183 new_item.
SetQuantity(split_quantity_new,
false,
true);
10184 }
10185 }
10186 }
10187 else
10188 {
10189 if (stack_max != 0)
10190 {
10192 {
10194 }
10195
10197 {
10199
10200 if (new_item)
10201 {
10202 new_item.SetResultOfSplit(true);
10203 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10206 new_item.PlaceOnSurface();
10207 }
10208 }
10209 }
10210 }
10211 }
10212
10214 {
10216 {
10217 if (ScriptInputUserData.CanStoreInputUserData())
10218 {
10219 ScriptInputUserData ctx = new ScriptInputUserData;
10224 dst.WriteToContext(ctx);
10226 }
10227 }
10228 else if (!
GetGame().IsMultiplayer())
10229 {
10231 }
10232 }
10233
10235 {
10237 {
10238 if (ScriptInputUserData.CanStoreInputUserData())
10239 {
10240 ScriptInputUserData ctx = new ScriptInputUserData;
10245 ctx.
Write(destination_entity);
10251 }
10252 }
10253 else if (!
GetGame().IsMultiplayer())
10254 {
10256 }
10257 }
10258
10260 {
10262 }
10263
10265 {
10267 float split_quantity_new;
10269 if (dst.IsValid())
10270 {
10271 int slot_id = dst.GetSlot();
10273
10274 if (quantity > stack_max)
10275 split_quantity_new = stack_max;
10276 else
10277 split_quantity_new = quantity;
10278
10280 {
10282
10283 if (new_item)
10284 {
10285 new_item.SetResultOfSplit(true);
10286 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10288 new_item.
SetQuantity(split_quantity_new,
false,
true);
10289 }
10290
10291 return new_item;
10292 }
10293 }
10294
10295 return null;
10296 }
10297
10299 {
10301 float split_quantity_new;
10303 if (destination_entity)
10304 {
10306 if (quantity > stackable)
10307 split_quantity_new = stackable;
10308 else
10309 split_quantity_new = quantity;
10310
10312 {
10313 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10314 if (new_item)
10315 {
10316 new_item.SetResultOfSplit(true);
10317 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10319 new_item.
SetQuantity(split_quantity_new,
false,
true);
10320 }
10321 }
10322 }
10323 }
10324
10326 {
10328 {
10329 if (ScriptInputUserData.CanStoreInputUserData())
10330 {
10331 ScriptInputUserData ctx = new ScriptInputUserData;
10336 ItemBase destination_entity =
this;
10337 ctx.
Write(destination_entity);
10341 }
10342 }
10343 else if (!
GetGame().IsMultiplayer())
10344 {
10346 }
10347 }
10348
10350 {
10352 float split_quantity_new;
10354 if (player)
10355 {
10357 if (quantity > stackable)
10358 split_quantity_new = stackable;
10359 else
10360 split_quantity_new = quantity;
10361
10363 {
10364 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10365 new_item =
ItemBase.Cast(in_hands);
10366 if (new_item)
10367 {
10368 new_item.SetResultOfSplit(true);
10369 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10371 new_item.SetQuantity(split_quantity_new, false, true);
10372 }
10373 }
10374 }
10375 }
10376
10378 {
10380 float split_quantity_new = Math.Floor(quantity * 0.5);
10381
10383 return;
10384
10386
10387 if (new_item)
10388 {
10389 if (new_item.GetQuantityMax() < split_quantity_new)
10390 {
10391 split_quantity_new = new_item.GetQuantityMax();
10392 }
10393
10394 new_item.SetResultOfSplit(true);
10395 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10396
10398 {
10401 }
10402 else
10403 {
10405 new_item.
SetQuantity(split_quantity_new,
false,
true);
10406 }
10407 }
10408 }
10409
10411 {
10413 float split_quantity_new = Math.Floor(quantity / 2);
10414
10416 return;
10417
10418 InventoryLocation invloc = new InventoryLocation;
10420
10422 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10423
10424 if (new_item)
10425 {
10426 if (new_item.GetQuantityMax() < split_quantity_new)
10427 {
10428 split_quantity_new = new_item.GetQuantityMax();
10429 }
10431 {
10434 }
10435 else if (split_quantity_new > 1)
10436 {
10438 new_item.
SetQuantity(split_quantity_new,
false,
true);
10439 }
10440 }
10441 }
10442
10445 {
10446 SetWeightDirty();
10448
10449 if (parent)
10450 parent.OnAttachmentQuantityChangedEx(this, delta);
10451
10453 {
10455 {
10457 }
10459 {
10460 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10462 }
10463 }
10464
10465 }
10466
10469 {
10470
10471 }
10472
10475 {
10477 }
10478
10480 {
10481 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10482
10484 {
10485 if (newLevel == GameConstants.STATE_RUINED)
10486 {
10488 EntityAI parent = GetHierarchyParent();
10489 if (parent && parent.IsFireplace())
10490 {
10491 CargoBase cargo = GetInventory().GetCargo();
10492 if (cargo)
10493 {
10495 {
10497 }
10498 }
10499 }
10500 }
10501
10503 {
10504
10506 return;
10507 }
10508
10509 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10510 {
10512 }
10513 }
10514 }
10515
10516
10518 {
10519 super.OnRightClick();
10520
10522 {
10524 {
10525 if (ScriptInputUserData.CanStoreInputUserData())
10526 {
10527 EntityAI root = GetHierarchyRoot();
10528 Man playerOwner = GetHierarchyRootPlayer();
10529 InventoryLocation dst = new InventoryLocation;
10530
10531
10532 if (!playerOwner && root && root == this)
10533 {
10535 }
10536 else
10537 {
10538
10539 GetInventory().GetCurrentInventoryLocation(dst);
10541 {
10544 {
10546 }
10547 else
10548 {
10550
10551
10552 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10553 {
10555 }
10556 else
10557 {
10558 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10559 }
10560 }
10561 }
10562 }
10563
10564 ScriptInputUserData ctx = new ScriptInputUserData;
10572 }
10573 }
10574 else if (!
GetGame().IsMultiplayer())
10575 {
10577 }
10578 }
10579 }
10580
10582 {
10583 if (root)
10584 {
10585 vector m4[4];
10586 root.GetTransform(m4);
10587 dst.SetGround(this, m4);
10588 }
10589 else
10590 {
10591 GetInventory().GetCurrentInventoryLocation(dst);
10592 }
10593 }
10594
10595 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10596 {
10597
10598 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10599 return false;
10600
10601 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10602 return false;
10603
10604
10606 return false;
10607
10608
10609 Magazine mag = Magazine.Cast(this);
10610 if (mag)
10611 {
10612 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10613 return false;
10614
10615 if (stack_max_limit)
10616 {
10617 Magazine other_mag = Magazine.Cast(other_item);
10618 if (other_item)
10619 {
10620 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10621 return false;
10622 }
10623
10624 }
10625 }
10626 else
10627 {
10628
10630 return false;
10631
10633 return false;
10634 }
10635
10636 PlayerBase player = null;
10637 if (CastTo(player, GetHierarchyRootPlayer()))
10638 {
10639 if (player.GetInventory().HasAttachment(this))
10640 return false;
10641
10642 if (player.IsItemsToDelete())
10643 return false;
10644 }
10645
10646 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10647 return false;
10648
10649 int slotID;
10651 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10652 return false;
10653
10654 return true;
10655 }
10656
10658 {
10660 }
10661
10663 {
10664 return m_IsResultOfSplit;
10665 }
10666
10668 {
10669 m_IsResultOfSplit = value;
10670 }
10671
10673 {
10675 }
10676
10678 {
10679 float other_item_quantity = other_item.GetQuantity();
10680 float this_free_space;
10681
10683
10685
10686 if (other_item_quantity > this_free_space)
10687 {
10688 return this_free_space;
10689 }
10690 else
10691 {
10692 return other_item_quantity;
10693 }
10694 }
10695
10697 {
10699 }
10700
10702 {
10704 return;
10705
10706 if (!IsMagazine() && other_item)
10707 {
10709 if (quantity_used != 0)
10710 {
10711 float hp1 = GetHealth01("","");
10712 float hp2 = other_item.GetHealth01("","");
10713 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10714 hpResult = hpResult / (
GetQuantity() + quantity_used);
10715
10716 hpResult *= GetMaxHealth();
10717 Math.Round(hpResult);
10718 SetHealth("", "Health", hpResult);
10719
10721 other_item.AddQuantity(-quantity_used);
10722 }
10723 }
10725 }
10726
10728 {
10729 #ifdef SERVER
10730 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10731 GetHierarchyParent().IncreaseLifetimeUp();
10732 #endif
10733 };
10734
10736 {
10737 PlayerBase p = PlayerBase.Cast(player);
10738
10739 array<int> recipesIds = p.m_Recipes;
10740 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10741 if (moduleRecipesManager)
10742 {
10743 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10744 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10745 }
10746
10747 for (int i = 0;i < recipesIds.Count(); i++)
10748 {
10749 int key = recipesIds.Get(i);
10750 string recipeName = moduleRecipesManager.GetRecipeName(key);
10752 }
10753 }
10754
10755
10756 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10757 {
10758 super.GetDebugActions(outputList);
10759
10760
10766
10767
10772
10777
10778
10782
10783
10785 {
10789 }
10790
10793
10794
10798
10800
10801 InventoryLocation loc = new InventoryLocation();
10802 GetInventory().GetCurrentInventoryLocation(loc);
10804 {
10805 if (Gizmo_IsSupported())
10808 }
10809
10811 }
10812
10813
10814
10815
10817 {
10818 super.OnAction(action_id, player, ctx);
10819
10821 {
10822 switch (action_id)
10823 {
10826 return true;
10829 return true;
10830 }
10831 }
10832
10834 {
10835 switch (action_id)
10836 {
10838 Delete();
10839 return true;
10840 }
10841 }
10842
10843 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10844 {
10845 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10846 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10847 PlayerBase p = PlayerBase.Cast(player);
10848 if (
EActions.RECIPES_RANGE_START < 1000)
10849 {
10850 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10851 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10852 }
10853 }
10854 #ifndef SERVER
10855 else if (action_id ==
EActions.WATCH_PLAYER)
10856 {
10857 PluginDeveloper.SetDeveloperItemClientEx(player);
10858 }
10859 #endif
10861 {
10862 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10863 {
10864 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10865 OnDebugButtonPressServer(id + 1);
10866 }
10867
10868 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10869 {
10870 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10872 }
10873
10874 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10875 {
10876 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10878 }
10879
10880 else if (action_id ==
EActions.ADD_QUANTITY)
10881 {
10882 if (IsMagazine())
10883 {
10884 Magazine mag = Magazine.Cast(this);
10885 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10886 }
10887 else
10888 {
10890 }
10891
10892 if (m_EM)
10893 {
10894 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10895 }
10896
10897 }
10898
10899 else if (action_id ==
EActions.REMOVE_QUANTITY)
10900 {
10901 if (IsMagazine())
10902 {
10903 Magazine mag2 = Magazine.Cast(this);
10904 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10905 }
10906 else
10907 {
10909 }
10910 if (m_EM)
10911 {
10912 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10913 }
10914
10915 }
10916
10917 else if (action_id ==
EActions.SET_QUANTITY_0)
10918 {
10920
10921 if (m_EM)
10922 {
10923 m_EM.SetEnergy(0);
10924 }
10925 }
10926
10927 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10928 {
10930
10931 if (m_EM)
10932 {
10933 m_EM.SetEnergy(m_EM.GetEnergyMax());
10934 }
10935 }
10936
10937 else if (action_id ==
EActions.ADD_HEALTH)
10938 {
10939 AddHealth("","",GetMaxHealth("","Health")/5);
10940 }
10941 else if (action_id ==
EActions.REMOVE_HEALTH)
10942 {
10943 AddHealth("","",-GetMaxHealth("","Health")/5);
10944 }
10945 else if (action_id ==
EActions.DESTROY_HEALTH)
10946 {
10947 SetHealth01("","",0);
10948 }
10949 else if (action_id ==
EActions.WATCH_ITEM)
10950 {
10952 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10953 #ifdef DEVELOPER
10954 SetDebugDeveloper_item(this);
10955 #endif
10956 }
10957
10958 else if (action_id ==
EActions.ADD_TEMPERATURE)
10959 {
10960 AddTemperature(20);
10961
10962 }
10963
10964 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10965 {
10966 AddTemperature(-20);
10967
10968 }
10969
10970 else if (action_id ==
EActions.FLIP_FROZEN)
10971 {
10972 SetFrozen(!GetIsFrozen());
10973
10974 }
10975
10976 else if (action_id ==
EActions.ADD_WETNESS)
10977 {
10979
10980 }
10981
10982 else if (action_id ==
EActions.REMOVE_WETNESS)
10983 {
10985
10986 }
10987
10988 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10989 {
10992
10993
10994 }
10995
10996 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10997 {
11000 }
11001
11002 else if (action_id ==
EActions.MAKE_SPECIAL)
11003 {
11004 auto debugParams = DebugSpawnParams.WithPlayer(player);
11005 OnDebugSpawnEx(debugParams);
11006 }
11007
11008 }
11009
11010
11011 return false;
11012 }
11013
11014
11015
11016
11020
11023
11024
11025
11027 {
11028 return false;
11029 }
11030
11031
11033 {
11034 return true;
11035 }
11036
11037
11039 {
11040 return true;
11041 }
11042
11043
11044
11046 {
11047 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11049 }
11050
11053 {
11054 return null;
11055 }
11056
11058 {
11059 return false;
11060 }
11061
11063 {
11064 return false;
11065 }
11066
11070
11071
11073 {
11074 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11075 return module_repairing.CanRepair(this, item_repair_kit);
11076 }
11077
11078
11079 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11080 {
11081 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11082 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11083 }
11084
11085
11087 {
11088
11089
11090
11091
11092
11093
11094
11095
11096 return 1;
11097 }
11098
11099
11100
11102 {
11104 }
11105
11106
11107
11109 {
11111 }
11112
11113
11122 {
11123 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11124
11125 if (player)
11126 {
11127 player.MessageStatus(text);
11128 }
11129 }
11130
11131
11140 {
11141 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11142
11143 if (player)
11144 {
11145 player.MessageAction(text);
11146 }
11147 }
11148
11149
11158 {
11159 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11160
11161 if (player)
11162 {
11163 player.MessageFriendly(text);
11164 }
11165 }
11166
11167
11176 {
11177 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11178
11179 if (player)
11180 {
11181 player.MessageImportant(text);
11182 }
11183 }
11184
11186 {
11187 return true;
11188 }
11189
11190
11191 override bool KindOf(
string tag)
11192 {
11193 bool found = false;
11194 string item_name = this.
GetType();
11197
11198 int array_size = item_tag_array.Count();
11199 for (int i = 0; i < array_size; i++)
11200 {
11201 if (item_tag_array.Get(i) == tag)
11202 {
11203 found = true;
11204 break;
11205 }
11206 }
11207 return found;
11208 }
11209
11210
11212 {
11213
11214 super.OnRPC(sender, rpc_type,ctx);
11215
11216
11217 switch (rpc_type)
11218 {
11219 #ifndef SERVER
11220 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11221 Param2<bool, string> p = new Param2<bool, string>(false, "");
11222
11224 return;
11225
11226 bool play = p.param1;
11227 string soundSet = p.param2;
11228
11229 if (play)
11230 {
11232 {
11234 {
11236 }
11237 }
11238 else
11239 {
11241 }
11242 }
11243 else
11244 {
11246 }
11247
11248 break;
11249 #endif
11250
11251 }
11252
11254 {
11256 }
11257 }
11258
11259
11260
11261
11263 {
11264 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11265 return plugin.GetID(
name);
11266 }
11267
11269 {
11270 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11271 return plugin.GetName(id);
11272 }
11273
11276 {
11277
11278
11279 int varFlags;
11280 if (!ctx.
Read(varFlags))
11281 return;
11282
11283 if (varFlags & ItemVariableFlags.FLOAT)
11284 {
11286 }
11287 }
11288
11290 {
11291
11292 super.SerializeNumericalVars(floats_out);
11293
11294
11295
11297 {
11299 }
11300
11302 {
11304 }
11305
11307 {
11309 }
11310
11312 {
11317 }
11318
11320 {
11322 }
11323 }
11324
11326 {
11327
11328 super.DeSerializeNumericalVars(floats);
11329
11330
11331 int index = 0;
11332 int mask = Math.Round(floats.Get(index));
11333
11334 index++;
11335
11337 {
11339 {
11341 }
11342 else
11343 {
11344 float quantity = floats.Get(index);
11345 SetQuantity(quantity,
true,
false,
false,
false);
11346 }
11347 index++;
11348 }
11349
11351 {
11352 float wet = floats.Get(index);
11354 index++;
11355 }
11356
11358 {
11359 int liquidtype = Math.Round(floats.Get(index));
11361 index++;
11362 }
11363
11365 {
11367 index++;
11369 index++;
11371 index++;
11373 index++;
11374 }
11375
11377 {
11378 int cleanness = Math.Round(floats.Get(index));
11380 index++;
11381 }
11382 }
11383
11385 {
11386 super.WriteVarsToCTX(ctx);
11387
11388
11390 {
11392 }
11393
11395 {
11397 }
11398
11400 {
11402 }
11403
11405 {
11406 int r,g,b,a;
11412 }
11413
11415 {
11417 }
11418 }
11419
11421 {
11422 if (!super.ReadVarsFromCTX(ctx,version))
11423 return false;
11424
11425 int intValue;
11426 float value;
11427
11428 if (version < 140)
11429 {
11430 if (!ctx.
Read(intValue))
11431 return false;
11432
11433 m_VariablesMask = intValue;
11434 }
11435
11437 {
11438 if (!ctx.
Read(value))
11439 return false;
11440
11442 {
11444 }
11445 else
11446 {
11448 }
11449 }
11450
11451 if (version < 140)
11452 {
11454 {
11455 if (!ctx.
Read(value))
11456 return false;
11457 SetTemperatureDirect(value);
11458 }
11459 }
11460
11462 {
11463 if (!ctx.
Read(value))
11464 return false;
11466 }
11467
11469 {
11470 if (!ctx.
Read(intValue))
11471 return false;
11473 }
11474
11476 {
11477 int r,g,b,a;
11479 return false;
11481 return false;
11483 return false;
11485 return false;
11486
11488 }
11489
11491 {
11492 if (!ctx.
Read(intValue))
11493 return false;
11495 }
11496
11497 if (version >= 138 && version < 140)
11498 {
11500 {
11501 if (!ctx.
Read(intValue))
11502 return false;
11503 SetFrozen(intValue);
11504 }
11505 }
11506
11507 return true;
11508 }
11509
11510
11512 {
11515 {
11517 }
11518
11519 if (!super.OnStoreLoad(ctx, version))
11520 {
11522 return false;
11523 }
11524
11525 if (version >= 114)
11526 {
11527 bool hasQuickBarIndexSaved;
11528
11529 if (!ctx.
Read(hasQuickBarIndexSaved))
11530 {
11532 return false;
11533 }
11534
11535 if (hasQuickBarIndexSaved)
11536 {
11537 int itmQBIndex;
11538
11539
11540 if (!ctx.
Read(itmQBIndex))
11541 {
11543 return false;
11544 }
11545
11546 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11547 if (itmQBIndex != -1 && parentPlayer)
11548 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11549 }
11550 }
11551 else
11552 {
11553
11554 PlayerBase player;
11555 int itemQBIndex;
11556 if (version ==
int.
MAX)
11557 {
11558 if (!ctx.
Read(itemQBIndex))
11559 {
11561 return false;
11562 }
11563 }
11564 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11565 {
11566
11567 if (!ctx.
Read(itemQBIndex))
11568 {
11570 return false;
11571 }
11572 if (itemQBIndex != -1 && player)
11573 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11574 }
11575 }
11576
11577 if (version < 140)
11578 {
11579
11580 if (!LoadVariables(ctx, version))
11581 {
11583 return false;
11584 }
11585 }
11586
11587
11589 {
11591 return false;
11592 }
11593 if (version >= 132)
11594 {
11596 if (raib)
11597 {
11599 {
11601 return false;
11602 }
11603 }
11604 }
11605
11607 return true;
11608 }
11609
11610
11611
11613 {
11614 super.OnStoreSave(ctx);
11615
11616 PlayerBase player;
11617 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11618 {
11620
11621 int itemQBIndex = -1;
11622 itemQBIndex = player.FindQuickBarEntityIndex(this);
11623 ctx.
Write(itemQBIndex);
11624 }
11625 else
11626 {
11628 }
11629
11631
11633 if (raib)
11634 {
11636 }
11637 }
11638
11639
11641 {
11642 super.AfterStoreLoad();
11643
11645 {
11647 }
11648
11650 {
11653 }
11654 }
11655
11657 {
11658 super.EEOnAfterLoad();
11659
11661 {
11663 }
11664
11667 }
11668
11670 {
11671 return false;
11672 }
11673
11674
11675
11677 {
11679 {
11680 #ifdef PLATFORM_CONSOLE
11681
11683 {
11685 if (menu)
11686 {
11688 }
11689 }
11690 #endif
11691 }
11692
11694 {
11697 }
11698
11700 {
11701 SetWeightDirty();
11703 }
11705 {
11708 }
11709
11711 {
11714 }
11716 {
11719 }
11720
11721 super.OnVariablesSynchronized();
11722 }
11723
11724
11725
11727 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11728 {
11729 if (!IsServerCheck(allow_client))
11730 return false;
11731
11733 return false;
11734
11737
11738 if (value <= (min + 0.001))
11739 value = min;
11740
11741 if (value == min)
11742 {
11743 if (destroy_config)
11744 {
11745 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11746 if (dstr)
11747 {
11749 this.Delete();
11750 return true;
11751 }
11752 }
11753 else if (destroy_forced)
11754 {
11756 this.Delete();
11757 return true;
11758 }
11759
11761 }
11762
11765
11767 {
11769
11770 if (delta)
11772 }
11773
11775
11776 return false;
11777 }
11778
11779
11781 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11782 {
11784 }
11785
11787 {
11790 }
11791
11793 {
11796 }
11797
11799 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11800 {
11801 float value_clamped = Math.Clamp(value, 0, 1);
11803 SetQuantity(result, destroy_config, destroy_forced);
11804 }
11805
11806
11809 {
11811 }
11812
11814 {
11816 }
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11828 {
11829 int slot = -1;
11830 if (GetInventory())
11831 {
11832 InventoryLocation il = new InventoryLocation;
11833 GetInventory().GetCurrentInventoryLocation(il);
11835 }
11836
11838 }
11839
11841 {
11842 float quantity_max = 0;
11843
11845 {
11846 if (attSlotID != -1)
11847 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11848
11849 if (quantity_max <= 0)
11851 }
11852
11853 if (quantity_max <= 0)
11855
11856 return quantity_max;
11857 }
11858
11860 {
11862 }
11863
11865 {
11867 }
11868
11869
11871 {
11873 }
11874
11876 {
11878 }
11879
11881 {
11883 }
11884
11885
11887 {
11888
11889 float weightEx = GetWeightEx();
11890 float special = GetInventoryAndCargoWeight();
11891 return weightEx - special;
11892 }
11893
11894
11896 {
11898 }
11899
11901 {
11903 {
11904 #ifdef DEVELOPER
11905 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11906 {
11907 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11909 }
11910 #endif
11911
11912 return GetQuantity() * GetConfigWeightModified();
11913 }
11914 else if (HasEnergyManager())
11915 {
11916 #ifdef DEVELOPER
11917 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11918 {
11919 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11920 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11921 }
11922 #endif
11923 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11924 }
11925 else
11926 {
11927 #ifdef DEVELOPER
11928 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11929 {
11930 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11931 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11932 }
11933 #endif
11934 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11935 }
11936 }
11937
11940 {
11941 int item_count = 0;
11943
11944 if (GetInventory().GetCargo() != NULL)
11945 {
11946 item_count = GetInventory().GetCargo().GetItemCount();
11947 }
11948
11949 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11950 {
11951 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11952 if (item)
11953 item_count += item.GetNumberOfItems();
11954 }
11955 return item_count;
11956 }
11957
11960 {
11961 float weight = 0;
11962 float wetness = 1;
11963 if (include_wetness)
11966 {
11967 weight = wetness * m_ConfigWeight;
11968 }
11970 {
11971 weight = 1;
11972 }
11973 return weight;
11974 }
11975
11976
11977
11979 {
11980 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11981 {
11982 GameInventory inv = GetInventory();
11983 array<EntityAI> items = new array<EntityAI>;
11985 for (int i = 0; i < items.Count(); i++)
11986 {
11988 if (item)
11989 {
11991 }
11992 }
11993 }
11994 }
11995
11996
11997
11998
12000 {
12001 float energy = 0;
12002 if (HasEnergyManager())
12003 {
12004 energy = GetCompEM().GetEnergy();
12005 }
12006 return energy;
12007 }
12008
12009
12011 {
12012 super.OnEnergyConsumed();
12013
12015 }
12016
12018 {
12019 super.OnEnergyAdded();
12020
12022 }
12023
12024
12026 {
12027 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12028 {
12030 {
12031 float energy_0to1 = GetCompEM().GetEnergy0To1();
12033 }
12034 }
12035 }
12036
12037
12039 {
12040 return ConfigGetFloat("heatIsolation");
12041 }
12042
12044 {
12046 }
12047
12049 {
12050 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12051 if (
GetGame().ConfigIsExisting(paramPath))
12053
12054 return 0.0;
12055 }
12056
12058 {
12059 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12060 if (
GetGame().ConfigIsExisting(paramPath))
12062
12063 return 0.0;
12064 }
12065
12066 override void SetWet(
float value,
bool allow_client =
false)
12067 {
12068 if (!IsServerCheck(allow_client))
12069 return;
12070
12073
12075
12076 m_VarWet = Math.Clamp(value, min, max);
12077
12079 {
12082 }
12083 }
12084
12085 override void AddWet(
float value)
12086 {
12088 }
12089
12091 {
12093 }
12094
12096 {
12098 }
12099
12101 {
12103 }
12104
12106 {
12108 }
12109
12111 {
12113 }
12114
12115 override void OnWetChanged(
float newVal,
float oldVal)
12116 {
12119 if (newLevel != oldLevel)
12120 {
12122 }
12123 }
12124
12126 {
12127 SetWeightDirty();
12128 }
12129
12131 {
12132 return GetWetLevelInternal(
m_VarWet);
12133 }
12134
12135
12136
12138 {
12140 }
12141
12143 {
12145 }
12146
12148 {
12150 }
12151
12153 {
12155 }
12156
12157
12158
12160 {
12161 if (ConfigIsExisting("itemModelLength"))
12162 {
12163 return ConfigGetFloat("itemModelLength");
12164 }
12165 return 0;
12166 }
12167
12169 {
12170 if (ConfigIsExisting("itemAttachOffset"))
12171 {
12172 return ConfigGetFloat("itemAttachOffset");
12173 }
12174 return 0;
12175 }
12176
12177 override void SetCleanness(
int value,
bool allow_client =
false)
12178 {
12179 if (!IsServerCheck(allow_client))
12180 return;
12181
12183
12185
12188 }
12189
12191 {
12193 }
12194
12196 {
12197 return true;
12198 }
12199
12200
12201
12202
12204 {
12206 }
12207
12209 {
12211 }
12212
12213
12214
12215
12216 override void SetColor(
int r,
int g,
int b,
int a)
12217 {
12223 }
12225 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12226 {
12231 }
12232
12234 {
12236 }
12237
12240 {
12241 int r,g,b,a;
12243 r = r/255;
12244 g = g/255;
12245 b = b/255;
12246 a = a/255;
12247 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12248 }
12249
12250
12251
12252 override void SetLiquidType(
int value,
bool allow_client =
false)
12253 {
12254 if (!IsServerCheck(allow_client))
12255 return;
12256
12261 }
12262
12264 {
12265 return ConfigGetInt("varLiquidTypeInit");
12266 }
12267
12269 {
12271 }
12272
12274 {
12276 SetFrozen(false);
12277 }
12278
12281 {
12282 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12283 }
12284
12285
12288 {
12289 PlayerBase nplayer;
12290 if (PlayerBase.CastTo(nplayer, player))
12291 {
12293
12294 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12295 }
12296 }
12297
12298
12301 {
12302 PlayerBase nplayer;
12303 if (PlayerBase.CastTo(nplayer,player))
12304 {
12305
12306 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12307
12308 }
12309
12310
12311 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12312
12313
12314 if (HasEnergyManager())
12315 {
12316 GetCompEM().UpdatePlugState();
12317 }
12318 }
12319
12320
12322 {
12323 super.OnPlacementStarted(player);
12324
12326 }
12327
12328 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12329 {
12331 {
12332 m_AdminLog.OnPlacementComplete(player,
this);
12333 }
12334
12335 super.OnPlacementComplete(player, position, orientation);
12336 }
12337
12338
12339
12340
12341
12343 {
12345 {
12346 return true;
12347 }
12348 else
12349 {
12350 return false;
12351 }
12352 }
12353
12354
12356 {
12358 {
12360 }
12361 }
12362
12363
12365 {
12367 }
12368
12370 {
12372 }
12373
12374 override void InsertAgent(
int agent,
float count = 1)
12375 {
12376 if (count < 1)
12377 return;
12378
12380 }
12381
12384 {
12386 }
12387
12388
12390 {
12392 }
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12436 {
12438 return false;
12439 return true;
12440 }
12441
12443 {
12444
12446 }
12447
12448
12451 {
12452 super.CheckForRoofLimited(timeTresholdMS);
12453
12455 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12456 {
12457 m_PreviousRoofTestTime = time;
12458 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12459 }
12460 }
12461
12462
12464 {
12466 {
12467 return 0;
12468 }
12469
12470 if (GetInventory().GetAttachmentSlotsCount() != 0)
12471 {
12472 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12473 if (filter)
12474 return filter.GetProtectionLevel(type, false, system);
12475 else
12476 return 0;
12477 }
12478
12479 string subclassPath, entryName;
12480
12481 switch (type)
12482 {
12484 entryName = "biological";
12485 break;
12487 entryName = "chemical";
12488 break;
12489 default:
12490 entryName = "biological";
12491 break;
12492 }
12493
12494 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12495
12497 }
12498
12499
12500
12503 {
12504 if (!IsMagazine())
12506
12508 }
12509
12510
12511
12512
12513
12518 {
12519 return true;
12520 }
12521
12523 {
12525 }
12526
12527
12528
12529
12530
12532 {
12533 if (parent)
12534 {
12535 if (parent.IsInherited(DayZInfected))
12536 return true;
12537
12538 if (!parent.IsRuined())
12539 return true;
12540 }
12541
12542 return true;
12543 }
12544
12546 {
12547 if (!super.CanPutAsAttachment(parent))
12548 {
12549 return false;
12550 }
12551
12552 if (!IsRuined() && !parent.IsRuined())
12553 {
12554 return true;
12555 }
12556
12557 return false;
12558 }
12559
12561 {
12562
12563
12564
12565
12566 return super.CanReceiveItemIntoCargo(item);
12567 }
12568
12570 {
12571
12572
12573
12574
12575 GameInventory attachmentInv = attachment.GetInventory();
12577 {
12578 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12579 return false;
12580 }
12581
12582 InventoryLocation loc = new InventoryLocation();
12583 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12584 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12585 return false;
12586
12587 return super.CanReceiveAttachment(attachment, slotId);
12588 }
12589
12591 {
12592 if (!super.CanReleaseAttachment(attachment))
12593 return false;
12594
12595 return GetInventory().AreChildrenAccessible();
12596 }
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12619 {
12620 int id = muzzle_owner.GetMuzzleID();
12621 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12622
12623 if (WPOF_array)
12624 {
12625 for (int i = 0; i < WPOF_array.Count(); i++)
12626 {
12627 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12628
12629 if (WPOF)
12630 {
12631 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12632 }
12633 }
12634 }
12635 }
12636
12637
12639 {
12640 int id = muzzle_owner.GetMuzzleID();
12642
12643 if (WPOBE_array)
12644 {
12645 for (int i = 0; i < WPOBE_array.Count(); i++)
12646 {
12647 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12648
12649 if (WPOBE)
12650 {
12651 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12652 }
12653 }
12654 }
12655 }
12656
12657
12659 {
12660 int id = muzzle_owner.GetMuzzleID();
12661 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12662
12663 if (WPOOH_array)
12664 {
12665 for (int i = 0; i < WPOOH_array.Count(); i++)
12666 {
12667 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12668
12669 if (WPOOH)
12670 {
12671 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12672 }
12673 }
12674 }
12675 }
12676
12677
12679 {
12680 int id = muzzle_owner.GetMuzzleID();
12681 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12682
12683 if (WPOOH_array)
12684 {
12685 for (int i = 0; i < WPOOH_array.Count(); i++)
12686 {
12687 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12688
12689 if (WPOOH)
12690 {
12691 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12692 }
12693 }
12694 }
12695 }
12696
12697
12699 {
12700 int id = muzzle_owner.GetMuzzleID();
12701 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12702
12703 if (WPOOH_array)
12704 {
12705 for (int i = 0; i < WPOOH_array.Count(); i++)
12706 {
12707 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12708
12709 if (WPOOH)
12710 {
12711 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12712 }
12713 }
12714 }
12715 }
12716
12717
12718
12720 {
12722 {
12723 return true;
12724 }
12725
12726 return false;
12727 }
12728
12730 {
12732 {
12733 return true;
12734 }
12735
12736 return false;
12737 }
12738
12740 {
12742 {
12743 return true;
12744 }
12745
12746 return false;
12747 }
12748
12750 {
12751 return false;
12752 }
12753
12756 {
12757 return UATimeSpent.DEFAULT_DEPLOY;
12758 }
12759
12760
12761
12762
12764 {
12766 SetSynchDirty();
12767 }
12768
12770 {
12772 }
12773
12774
12776 {
12777 return false;
12778 }
12779
12782 {
12783 string att_type = "None";
12784
12785 if (ConfigIsExisting("soundAttType"))
12786 {
12787 att_type = ConfigGetString("soundAttType");
12788 }
12789
12791 }
12792
12794 {
12796 }
12797
12798
12799
12800
12801
12807
12809 {
12812
12814 }
12815
12816
12818 {
12820 return;
12821
12823
12826
12829
12830 SoundParameters params = new SoundParameters();
12834 }
12835
12836
12838 {
12840 return;
12841
12843 SetSynchDirty();
12844
12847 }
12848
12849
12851 {
12853 return;
12854
12856 SetSynchDirty();
12857
12860 }
12861
12863 {
12865 }
12866
12868 {
12870 }
12871
12874 {
12875 if (!
GetGame().IsDedicatedServer())
12876 {
12877 if (ConfigIsExisting("attachSoundSet"))
12878 {
12879 string cfg_path = "";
12880 string soundset = "";
12881 string type_name =
GetType();
12882
12885 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12886 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12887
12888 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12889 {
12890 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12891 {
12892 if (cfg_slot_array[i] == slot_type)
12893 {
12894 soundset = cfg_soundset_array[i];
12895 break;
12896 }
12897 }
12898 }
12899
12900 if (soundset != "")
12901 {
12902 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12904 }
12905 }
12906 }
12907 }
12908
12910 {
12911
12912 }
12913
12914 void OnApply(PlayerBase player);
12915
12917 {
12918 return 1.0;
12919 };
12920
12922 {
12924 }
12925
12927 {
12929 }
12930
12932
12934 {
12935 SetDynamicPhysicsLifeTime(0.01);
12937 }
12938
12940 {
12941 array<string> zone_names = new array<string>;
12942 GetDamageZones(zone_names);
12943 for (int i = 0; i < zone_names.Count(); i++)
12944 {
12945 SetHealthMax(zone_names.Get(i),"Health");
12946 }
12947 SetHealthMax("","Health");
12948 }
12949
12952 {
12953 float global_health = GetHealth01("","Health");
12954 array<string> zones = new array<string>;
12955 GetDamageZones(zones);
12956
12957 for (int i = 0; i < zones.Count(); i++)
12958 {
12959 SetHealth01(zones.Get(i),"Health",global_health);
12960 }
12961 }
12962
12965 {
12966 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12967 }
12968
12970 {
12971 if (!hasRootAsPlayer)
12972 {
12973 if (refParentIB)
12974 {
12975
12976 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12977 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12978
12979 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12980 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12981
12984 }
12985 else
12986 {
12987
12990 }
12991 }
12992 }
12993
12995 {
12997 {
12998 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12999 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13000 {
13001 float heatPermCoef = 1.0;
13003 while (ent)
13004 {
13005 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13006 ent = ent.GetHierarchyParent();
13007 }
13008
13009 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13010 }
13011 }
13012 }
13013
13015 {
13016
13017 EntityAI parent = GetHierarchyParent();
13018 if (!parent)
13019 {
13020 hasParent = false;
13021 hasRootAsPlayer = false;
13022 }
13023 else
13024 {
13025 hasParent = true;
13026 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13027 refParentIB =
ItemBase.Cast(parent);
13028 }
13029 }
13030
13031 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13032 {
13033
13034 }
13035
13037 {
13038
13039 return false;
13040 }
13041
13043 {
13044
13045
13046 return false;
13047 }
13048
13050 {
13051
13052 return false;
13053 }
13054
13057 {
13058 return !GetIsFrozen() &&
IsOpen();
13059 }
13060
13062 {
13063 bool hasParent = false, hasRootAsPlayer = false;
13065
13066 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13067 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13068
13069 if (wwtu || foodDecay)
13070 {
13074
13075 if (processWetness || processTemperature || processDecay)
13076 {
13078
13079 if (processWetness)
13080 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13081
13082 if (processTemperature)
13084
13085 if (processDecay)
13086 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13087 }
13088 }
13089 }
13090
13093 {
13095 }
13096
13098 {
13101
13102 return super.GetTemperatureFreezeThreshold();
13103 }
13104
13106 {
13109
13110 return super.GetTemperatureThawThreshold();
13111 }
13112
13114 {
13117
13118 return super.GetItemOverheatThreshold();
13119 }
13120
13122 {
13124 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13125
13126 return super.GetTemperatureFreezeTime();
13127 }
13128
13130 {
13132 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13133
13134 return super.GetTemperatureThawTime();
13135 }
13136
13141
13143 {
13144 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13145 }
13146
13148 {
13149 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13150 }
13151
13154 {
13156 }
13157
13159 {
13161 }
13162
13164 {
13166 }
13167
13170 {
13171 return null;
13172 }
13173
13176 {
13177 return false;
13178 }
13179
13181 {
13183 {
13186 if (!trg)
13187 {
13189 explosive = this;
13190 }
13191
13192 explosive.PairRemote(trg);
13194
13195 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13196 trg.SetPersistentPairID(persistentID);
13197 explosive.SetPersistentPairID(persistentID);
13198
13199 return true;
13200 }
13201 return false;
13202 }
13203
13206 {
13207 float ret = 1.0;
13210 ret *= GetHealth01();
13211
13212 return ret;
13213 }
13214
13215 #ifdef DEVELOPER
13216 override void SetDebugItem()
13217 {
13218 super.SetDebugItem();
13219 _itemBase = this;
13220 }
13221
13223 {
13224 string text = super.GetDebugText();
13225
13227 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13228
13229 return text;
13230 }
13231 #endif
13232
13234 {
13235 return true;
13236 }
13237
13239
13241
13243 {
13246 }
13247
13248
13256
13272}
13273
13275{
13277 if (entity)
13278 {
13279 bool is_item = entity.IsInherited(
ItemBase);
13280 if (is_item && full_quantity)
13281 {
13284 }
13285 }
13286 else
13287 {
13289 return NULL;
13290 }
13291 return entity;
13292}
13293
13295{
13296 if (item)
13297 {
13298 if (health > 0)
13299 item.SetHealth("", "", health);
13300
13301 if (item.CanHaveTemperature())
13302 {
13304 if (item.CanFreeze())
13305 item.SetFrozen(false);
13306 }
13307
13308 if (item.HasEnergyManager())
13309 {
13310 if (quantity >= 0)
13311 {
13312 item.GetCompEM().SetEnergy0To1(quantity);
13313 }
13314 else
13315 {
13317 }
13318 }
13319 else if (item.IsMagazine())
13320 {
13321 Magazine mag = Magazine.Cast(item);
13322 if (quantity >= 0)
13323 {
13324 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13325 }
13326 else
13327 {
13329 }
13330
13331 }
13332 else
13333 {
13334 if (quantity >= 0)
13335 {
13336 item.SetQuantityNormalized(quantity, false);
13337 }
13338 else
13339 {
13341 }
13342
13343 }
13344 }
13345}
13346
13347#ifdef DEVELOPER
13349#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.