8486{
8488 {
8489 return true;
8490 }
8491};
8492
8493
8494
8496{
8500
8502
8505
8506
8507
8508
8509
8518
8524
8529
8534
8555 protected bool m_IsResultOfSplit
8556
8558
8563
8564
8565
8567
8571
8572
8573
8575
8578
8579
8580
8586
8587
8595
8598
8599
8601
8602
8604
8605
8610
8611
8616
8617
8619
8620
8622 {
8627
8628 if (!
GetGame().IsDedicatedServer())
8629 {
8631 {
8633
8635 {
8637 }
8638 }
8639
8642 }
8643
8644 m_OldLocation = null;
8645
8647 {
8649 }
8650
8651 if (ConfigIsExisting("headSelectionsToHide"))
8652 {
8655 }
8656
8658 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8659 {
8661 }
8662
8664
8665 m_IsResultOfSplit = false;
8666
8668 }
8669
8671 {
8672 super.InitItemVariables();
8673
8679 m_Count = ConfigGetInt(
"count");
8680
8683
8688
8691
8696
8708
8712
8713
8716 if (ConfigIsExisting("canBeSplit"))
8717 {
8720 }
8721
8723 if (ConfigIsExisting("itemBehaviour"))
8725
8726
8729 RegisterNetSyncVariableInt("m_VarLiquidType");
8730 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8731
8732 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8733 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8734 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8735
8736 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8737 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8738 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8739 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8740
8741 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8742 RegisterNetSyncVariableBool("m_IsTakeable");
8743 RegisterNetSyncVariableBool("m_IsHologram");
8744
8747 {
8750 }
8751
8753
8755 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8757
8758 }
8759
8761 {
8763 }
8764
8766 {
8769 {
8774 }
8775 }
8776
8777 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8778 {
8780 {
8783 }
8784
8786 }
8787
8789 {
8795 }
8796
8798
8800 {
8802
8803 if (!action)
8804 {
8805 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8806 return;
8807 }
8808
8810 if (!ai)
8811 {
8813 return;
8814 }
8815
8817 if (!action_array)
8818 {
8819 action_array = new array<ActionBase_Basic>;
8821 }
8822 if (LogManager.IsActionLogEnable())
8823 {
8824 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8825 }
8826
8827 if (action_array.Find(action) != -1)
8828 {
8829 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8830 }
8831 else
8832 {
8833 action_array.Insert(action);
8834 }
8835 }
8836
8838 {
8840 ActionBase action = player.GetActionManager().GetAction(actionName);
8843
8844 if (action_array)
8845 {
8846 action_array.RemoveItem(action);
8847 }
8848 }
8849
8850
8851
8853 {
8854 ActionOverrideData overrideData = new ActionOverrideData();
8858
8860 if (!actionMap)
8861 {
8864 }
8865
8866 actionMap.Insert(this.
Type(), overrideData);
8867
8868 }
8869
8871
8873
8874
8876 {
8879
8882
8883 string config_to_search = "CfgVehicles";
8884 string muzzle_owner_config;
8885
8887 {
8888 if (IsInherited(Weapon))
8889 config_to_search = "CfgWeapons";
8890
8891 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8892
8893 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8894
8896
8897 if (config_OnFire_subclass_count > 0)
8898 {
8899 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8900
8901 for (int i = 0; i < config_OnFire_subclass_count; i++)
8902 {
8903 string particle_class = "";
8905 string config_OnFire_entry = config_OnFire_class + particle_class;
8906 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8907 WPOF_array.Insert(WPOF);
8908 }
8909
8910
8912 }
8913 }
8914
8916 {
8917 config_to_search = "CfgWeapons";
8918 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8919
8920 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8921
8923
8924 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8925 {
8926 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8927
8928 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8929 {
8930 string particle_class2 = "";
8932 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8933 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8934 WPOBE_array.Insert(WPOBE);
8935 }
8936
8937
8939 }
8940 }
8941 }
8942
8943
8945 {
8948
8950 {
8951 string config_to_search = "CfgVehicles";
8952
8953 if (IsInherited(Weapon))
8954 config_to_search = "CfgWeapons";
8955
8956 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8957 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8958
8959 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8960 {
8961
8963
8965 {
8967 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8969 return;
8970 }
8971
8974
8975
8976
8978 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8979
8980 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8981 {
8982 string particle_class = "";
8984 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8986
8987 if (entry_type == CT_CLASS)
8988 {
8989 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8990 WPOOH_array.Insert(WPOF);
8991 }
8992 }
8993
8994
8996 }
8997 }
8998 }
8999
9001 {
9003 }
9004
9006 {
9008 {
9010
9013
9016
9017 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9018 }
9019 }
9020
9022 {
9024 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9025
9027 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9028
9030 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9031
9033 {
9035 }
9036 }
9037
9039 {
9041 }
9042
9044 {
9047 else
9049
9051 {
9054 }
9055 else
9056 {
9059
9062 }
9063
9065 }
9066
9068 {
9070 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9071 }
9072
9074 {
9076 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9078 }
9079
9081 {
9083 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9084 }
9085
9087 {
9090
9091 OverheatingParticle OP = new OverheatingParticle();
9096
9098 }
9099
9101 {
9104
9105 return -1;
9106 }
9107
9109 {
9111 {
9114
9115 for (int i = count; i > 0; --i)
9116 {
9117 int id = i - 1;
9120
9123
9124 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9125 {
9126 if (p)
9127 {
9130 }
9131 }
9132 }
9133 }
9134 }
9135
9137 {
9139 {
9141 {
9142 int id = i - 1;
9144
9145 if (OP)
9146 {
9148
9149 if (p)
9150 {
9152 }
9153
9154 delete OP;
9155 }
9156 }
9157
9160 }
9161 }
9162
9165 {
9166 return 0.0;
9167 }
9168
9169
9171 {
9172 return 250;
9173 }
9174
9176 {
9177 return 0;
9178 }
9179
9182 {
9184 return true;
9185
9186 return false;
9187 }
9188
9191 {
9194
9196 {
9198 }
9199 else
9200 {
9201
9203 }
9204
9206 }
9207
9214 {
9215 return -1;
9216 }
9217
9218
9219
9220
9222 {
9224 {
9226 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9227
9228 if (r_index >= 0)
9229 {
9230 InventoryLocation r_il = new InventoryLocation;
9231 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9232
9233 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9236 {
9237 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9238 }
9240 {
9241 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9242 }
9243
9244 }
9245
9246 player.GetHumanInventory().ClearUserReservedLocation(this);
9247 }
9248
9251 }
9252
9253
9254
9255
9257 {
9258 return ItemBase.m_DebugActionsMask;
9259 }
9260
9262 {
9263 return ItemBase.m_DebugActionsMask & mask;
9264 }
9265
9267 {
9268 ItemBase.m_DebugActionsMask = mask;
9269 }
9270
9272 {
9273 ItemBase.m_DebugActionsMask |= mask;
9274 }
9275
9277 {
9278 ItemBase.m_DebugActionsMask &= ~mask;
9279 }
9280
9282 {
9284 {
9286 }
9287 else
9288 {
9290 }
9291 }
9292
9293
9295 {
9296 if (GetEconomyProfile())
9297 {
9298 float q_max = GetEconomyProfile().GetQuantityMax();
9299 if (q_max > 0)
9300 {
9301 float q_min = GetEconomyProfile().GetQuantityMin();
9302 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9303
9305 {
9306 ComponentEnergyManager comp = GetCompEM();
9308 {
9310 }
9311 }
9313 {
9315
9316 }
9317
9318 }
9319 }
9320 }
9321
9324 {
9325 EntityAI parent = GetHierarchyParent();
9326
9327 if (parent)
9328 {
9329 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9330 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9331 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9332 }
9333 }
9334
9337 {
9338 EntityAI parent = GetHierarchyParent();
9339
9340 if (parent)
9341 {
9342 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9343 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9344 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9345 }
9346 }
9347
9349 {
9350
9351
9352
9353
9355
9357 {
9358 if (ScriptInputUserData.CanStoreInputUserData())
9359 {
9360 ScriptInputUserData ctx = new ScriptInputUserData;
9366 ctx.
Write(use_stack_max);
9369
9371 {
9372 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9373 }
9374 }
9375 }
9376 else if (!
GetGame().IsMultiplayer())
9377 {
9379 }
9380 }
9381
9383 {
9385 }
9386
9388 {
9390 }
9391
9393 {
9395 }
9396
9398 {
9399
9400 return false;
9401 }
9402
9404 {
9405 return false;
9406 }
9407
9411 {
9412 return false;
9413 }
9414
9416 {
9417 return "";
9418 }
9419
9421
9423 {
9424 return false;
9425 }
9426
9428 {
9429 return true;
9430 }
9431
9432
9433
9435 {
9436 return true;
9437 }
9438
9440 {
9441 return true;
9442 }
9443
9445 {
9446 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9448 }
9449
9451 {
9453 }
9454
9456 {
9458 if (!is_being_placed)
9460 SetSynchDirty();
9461 }
9462
9463
9465
9467 {
9469 }
9470
9472 {
9474 }
9475
9477 {
9478 return 1;
9479 }
9480
9482 {
9483 return false;
9484 }
9485
9487 {
9489 SetSynchDirty();
9490 }
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9527 {
9528 super.OnMovedInsideCargo(container);
9529
9530 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9531 }
9532
9533 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9534 {
9535 super.EEItemLocationChanged(oldLoc,newLoc);
9536
9537 PlayerBase new_player = null;
9538 PlayerBase old_player = null;
9539
9540 if (newLoc.GetParent())
9541 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9542
9543 if (oldLoc.GetParent())
9544 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9545
9547 {
9548 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9549
9550 if (r_index >= 0)
9551 {
9552 InventoryLocation r_il = new InventoryLocation;
9553 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9554
9555 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9558 {
9559 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9560 }
9562 {
9563 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9564 }
9565
9566 }
9567 }
9568
9570 {
9571 if (new_player)
9572 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9573
9574 if (new_player == old_player)
9575 {
9576
9577 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9578 {
9580 {
9581 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9582 {
9583 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9584 }
9585 }
9586 else
9587 {
9588 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9589 }
9590 }
9591
9592 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9593 {
9594 int type = oldLoc.GetType();
9596 {
9597 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9598 }
9600 {
9601 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9602 }
9603 }
9604 if (!m_OldLocation)
9605 {
9606 m_OldLocation = new InventoryLocation;
9607 }
9608 m_OldLocation.Copy(oldLoc);
9609 }
9610 else
9611 {
9612 if (m_OldLocation)
9613 {
9614 m_OldLocation.Reset();
9615 }
9616 }
9617
9619 }
9620 else
9621 {
9622 if (new_player)
9623 {
9624 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9625 if (res_index >= 0)
9626 {
9627 InventoryLocation il = new InventoryLocation;
9628 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9630 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9633 {
9634 il.
GetParent().GetOnReleaseLock().Invoke(it);
9635 }
9637 {
9639 }
9640
9641 }
9642 }
9644 {
9645
9647 }
9648
9649 if (m_OldLocation)
9650 {
9651 m_OldLocation.Reset();
9652 }
9653 }
9654 }
9655
9656 override void EOnContact(IEntity other, Contact extra)
9657 {
9659 {
9660 int liquidType = -1;
9662 if (impactSpeed > 0.0)
9663 {
9665 #ifndef SERVER
9667 #else
9669 SetSynchDirty();
9670 #endif
9672 }
9673 }
9674
9675 #ifdef SERVER
9676 if (GetCompEM() && GetCompEM().IsPlugged())
9677 {
9678 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9679 GetCompEM().UnplugThis();
9680 }
9681 #endif
9682 }
9683
9685
9687 {
9689 }
9690
9692 {
9693
9694 }
9695
9697 {
9698 super.OnItemLocationChanged(old_owner, new_owner);
9699
9700 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9701 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9702
9703 if (!relatedPlayer && playerNew)
9704 relatedPlayer = playerNew;
9705
9706 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9707 {
9709 if (actionMgr)
9710 {
9711 ActionBase currentAction = actionMgr.GetRunningAction();
9712 if (currentAction)
9714 }
9715 }
9716
9717 Man ownerPlayerOld = null;
9718 Man ownerPlayerNew = null;
9719
9720 if (old_owner)
9721 {
9722 if (old_owner.
IsMan())
9723 {
9724 ownerPlayerOld = Man.Cast(old_owner);
9725 }
9726 else
9727 {
9728 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9729 }
9730 }
9731 else
9732 {
9734 {
9736
9737 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9738 {
9739 GetCompEM().UnplugThis();
9740 }
9741 }
9742 }
9743
9744 if (new_owner)
9745 {
9746 if (new_owner.
IsMan())
9747 {
9748 ownerPlayerNew = Man.Cast(new_owner);
9749 }
9750 else
9751 {
9752 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9753 }
9754 }
9755
9756 if (ownerPlayerOld != ownerPlayerNew)
9757 {
9758 if (ownerPlayerOld)
9759 {
9760 array<EntityAI> subItemsExit = new array<EntityAI>;
9762 for (int i = 0; i < subItemsExit.Count(); i++)
9763 {
9766 }
9767 }
9768
9769 if (ownerPlayerNew)
9770 {
9771 array<EntityAI> subItemsEnter = new array<EntityAI>;
9773 for (int j = 0; j < subItemsEnter.Count(); j++)
9774 {
9777 }
9778 }
9779 }
9780 else if (ownerPlayerNew != null)
9781 {
9782 PlayerBase nplayer;
9783 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9784 {
9785 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9787 for (int k = 0; k < subItemsUpdate.Count(); k++)
9788 {
9790 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9791 }
9792 }
9793 }
9794
9795 if (old_owner)
9796 old_owner.OnChildItemRemoved(this);
9797 if (new_owner)
9798 new_owner.OnChildItemReceived(this);
9799 }
9800
9801
9803 {
9804 super.EEDelete(parent);
9805 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9806 if (player)
9807 {
9809
9810 if (player.IsAlive())
9811 {
9812 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9813 if (r_index >= 0)
9814 {
9815 InventoryLocation r_il = new InventoryLocation;
9816 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9817
9818 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9821 {
9822 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9823 }
9825 {
9826 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9827 }
9828
9829 }
9830
9831 player.RemoveQuickBarEntityShortcut(this);
9832 }
9833 }
9834 }
9835
9837 {
9838 super.EEKilled(killer);
9839
9842 {
9843 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9844 {
9845 if (IsMagazine())
9846 {
9847 if (Magazine.Cast(this).GetAmmoCount() > 0)
9848 {
9850 }
9851 }
9852 else
9853 {
9855 }
9856 }
9857 }
9858 }
9859
9861 {
9862 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9863
9864 super.OnWasAttached(parent, slot_id);
9865
9868
9870 }
9871
9873 {
9874 super.OnWasDetached(parent, slot_id);
9875
9878 }
9879
9881 {
9882 int idx;
9885
9886 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9887 if (inventory_slots.Count() < 1)
9888 {
9889 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9890 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9891 }
9892 else
9893 {
9894 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9895 }
9896
9897 idx = inventory_slots.Find(slot);
9898 if (idx < 0)
9899 return "";
9900
9901 return attach_types.Get(idx);
9902 }
9903
9905 {
9906 int idx = -1;
9907 string slot;
9908
9911
9912 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9913 if (inventory_slots.Count() < 1)
9914 {
9915 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9916 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9917 }
9918 else
9919 {
9920 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9921 if (detach_types.Count() < 1)
9922 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9923 }
9924
9925 for (int i = 0; i < inventory_slots.Count(); i++)
9926 {
9927 slot = inventory_slots.Get(i);
9928 }
9929
9930 if (slot != "")
9931 {
9932 if (detach_types.Count() == 1)
9933 idx = 0;
9934 else
9935 idx = inventory_slots.Find(slot);
9936 }
9937 if (idx < 0)
9938 return "";
9939
9940 return detach_types.Get(idx);
9941 }
9942
9944 {
9945
9947
9948
9949 float min_time = 1;
9950 float max_time = 3;
9951 float delay = Math.RandomFloat(min_time, max_time);
9952
9953 explode_timer.Run(delay, this, "DoAmmoExplosion");
9954 }
9955
9957 {
9958 Magazine magazine = Magazine.Cast(this);
9959 int pop_sounds_count = 6;
9960 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9961
9962
9963 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9964 string sound_name = pop_sounds[ sound_idx ];
9966
9967
9968 magazine.ServerAddAmmoCount(-1);
9969
9970
9971 float min_temp_to_explode = 100;
9972
9973 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9974 {
9976 }
9977 }
9978
9979
9980 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9981 {
9982 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9983
9984 const int CHANCE_DAMAGE_CARGO = 4;
9985 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9986 const int CHANCE_DAMAGE_NOTHING = 2;
9987
9989 {
9990 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9991 int chances;
9992 int rnd;
9993
9994 if (GetInventory().GetCargo())
9995 {
9996 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9997 rnd = Math.RandomInt(0,chances);
9998
9999 if (rnd < CHANCE_DAMAGE_CARGO)
10000 {
10002 }
10003 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10004 {
10006 }
10007 }
10008 else
10009 {
10010 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10011 rnd = Math.RandomInt(0,chances);
10012
10013 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10014 {
10016 }
10017 }
10018 }
10019 }
10020
10022 {
10023 if (GetInventory().GetCargo())
10024 {
10025 int item_count = GetInventory().GetCargo().GetItemCount();
10026 if (item_count > 0)
10027 {
10028 int random_pick = Math.RandomInt(0, item_count);
10030 if (!item.IsExplosive())
10031 {
10032 item.AddHealth("","",damage);
10033 return true;
10034 }
10035 }
10036 }
10037 return false;
10038 }
10039
10041 {
10042 int attachment_count = GetInventory().AttachmentCount();
10043 if (attachment_count > 0)
10044 {
10045 int random_pick = Math.RandomInt(0, attachment_count);
10046 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10047 if (!attachment.IsExplosive())
10048 {
10049 attachment.AddHealth("","",damage);
10050 return true;
10051 }
10052 }
10053 return false;
10054 }
10055
10057 {
10059 }
10060
10062 {
10064 return GetInventory().CanRemoveEntity();
10065
10066 return false;
10067 }
10068
10070 {
10072 return;
10073
10075 {
10076 if (ScriptInputUserData.CanStoreInputUserData())
10077 {
10078 ScriptInputUserData ctx = new ScriptInputUserData;
10083 ctx.
Write(destination_entity);
10085 ctx.
Write(slot_id);
10087 }
10088 }
10089 else if (!
GetGame().IsMultiplayer())
10090 {
10092 }
10093 }
10094
10096 {
10098 return;
10099
10100 float split_quantity_new;
10104 InventoryLocation loc = new InventoryLocation;
10105
10106 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10107 {
10109 split_quantity_new = stack_max;
10110 else
10112
10113 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10114 if (new_item)
10115 {
10116 new_item.SetResultOfSplit(true);
10117 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10119 new_item.SetQuantity(split_quantity_new);
10120 }
10121 }
10122 else if (destination_entity && slot_id == -1)
10123 {
10124 if (quantity > stack_max)
10125 split_quantity_new = stack_max;
10126 else
10127 split_quantity_new = quantity;
10128
10130 {
10133 }
10134
10135 if (new_item)
10136 {
10137 new_item.SetResultOfSplit(true);
10138 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10140 new_item.SetQuantity(split_quantity_new);
10141 }
10142 }
10143 else
10144 {
10145 if (stack_max != 0)
10146 {
10148 {
10150 }
10151
10152 if (split_quantity_new == 0)
10153 {
10154 if (!
GetGame().IsMultiplayer())
10155 player.PhysicalPredictiveDropItem(this);
10156 else
10157 player.ServerDropEntity(this);
10158 return;
10159 }
10160
10162
10163 if (new_item)
10164 {
10165 new_item.SetResultOfSplit(true);
10166 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10168 new_item.SetQuantity(stack_max);
10169 new_item.PlaceOnSurface();
10170 }
10171 }
10172 }
10173 }
10174
10176 {
10178 return;
10179
10180 float split_quantity_new;
10184 InventoryLocation loc = new InventoryLocation;
10185
10186 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10187 {
10189 split_quantity_new = stack_max;
10190 else
10192
10193 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10194 if (new_item)
10195 {
10196 new_item.SetResultOfSplit(true);
10197 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10199 new_item.SetQuantity(split_quantity_new);
10200 }
10201 }
10202 else if (destination_entity && slot_id == -1)
10203 {
10204 if (quantity > stack_max)
10205 split_quantity_new = stack_max;
10206 else
10207 split_quantity_new = quantity;
10208
10210 {
10213 }
10214
10215 if (new_item)
10216 {
10217 new_item.SetResultOfSplit(true);
10218 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10220 new_item.SetQuantity(split_quantity_new);
10221 }
10222 }
10223 else
10224 {
10225 if (stack_max != 0)
10226 {
10228 {
10230 }
10231
10233
10234 if (new_item)
10235 {
10236 new_item.SetResultOfSplit(true);
10237 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10239 new_item.SetQuantity(stack_max);
10240 new_item.PlaceOnSurface();
10241 }
10242 }
10243 }
10244 }
10245
10247 {
10249 return;
10250
10252 {
10253 if (ScriptInputUserData.CanStoreInputUserData())
10254 {
10255 ScriptInputUserData ctx = new ScriptInputUserData;
10260 dst.WriteToContext(ctx);
10262 }
10263 }
10264 else if (!
GetGame().IsMultiplayer())
10265 {
10267 }
10268 }
10269
10271 {
10273 return;
10274
10276 {
10277 if (ScriptInputUserData.CanStoreInputUserData())
10278 {
10279 ScriptInputUserData ctx = new ScriptInputUserData;
10284 ctx.
Write(destination_entity);
10290 }
10291 }
10292 else if (!
GetGame().IsMultiplayer())
10293 {
10295 }
10296 }
10297
10299 {
10301 }
10302
10304 {
10306 return this;
10307
10309 float split_quantity_new;
10311 if (dst.IsValid())
10312 {
10313 int slot_id = dst.GetSlot();
10315
10316 if (quantity > stack_max)
10317 split_quantity_new = stack_max;
10318 else
10319 split_quantity_new = quantity;
10320
10322
10323 if (new_item)
10324 {
10325 new_item.SetResultOfSplit(true);
10326 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10329 }
10330
10331 return new_item;
10332 }
10333
10334 return null;
10335 }
10336
10338 {
10340 return;
10341
10343 float split_quantity_new;
10345 if (destination_entity)
10346 {
10348 if (quantity > stackable)
10349 split_quantity_new = stackable;
10350 else
10351 split_quantity_new = quantity;
10352
10353 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10354 if (new_item)
10355 {
10356 new_item.SetResultOfSplit(true);
10357 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10359 new_item.SetQuantity(split_quantity_new);
10360 }
10361 }
10362 }
10363
10365 {
10367 return;
10368
10370 {
10371 if (ScriptInputUserData.CanStoreInputUserData())
10372 {
10373 ScriptInputUserData ctx = new ScriptInputUserData;
10378 ItemBase destination_entity =
this;
10379 ctx.
Write(destination_entity);
10383 }
10384 }
10385 else if (!
GetGame().IsMultiplayer())
10386 {
10388 }
10389 }
10390
10392 {
10394 return;
10395
10397 float split_quantity_new;
10399 if (player)
10400 {
10402 if (quantity > stackable)
10403 split_quantity_new = stackable;
10404 else
10405 split_quantity_new = quantity;
10406
10407 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10408 new_item =
ItemBase.Cast(in_hands);
10409 if (new_item)
10410 {
10411 new_item.SetResultOfSplit(true);
10412 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10414 new_item.SetQuantity(split_quantity_new);
10415 }
10416 }
10417 }
10418
10420 {
10422 return;
10423
10425 float split_quantity_new = Math.Floor(quantity * 0.5);
10426
10428
10429 if (new_item)
10430 {
10431 if (new_item.GetQuantityMax() < split_quantity_new)
10432 {
10433 split_quantity_new = new_item.GetQuantityMax();
10434 }
10435
10436 new_item.SetResultOfSplit(true);
10437 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10438
10440 {
10443 }
10444 else
10445 {
10448 }
10449 }
10450 }
10451
10453 {
10455 return;
10456
10458 float split_quantity_new = Math.Floor(quantity / 2);
10459
10460 InventoryLocation invloc = new InventoryLocation;
10462
10464 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10465
10466 if (new_item)
10467 {
10468 if (new_item.GetQuantityMax() < split_quantity_new)
10469 {
10470 split_quantity_new = new_item.GetQuantityMax();
10471 }
10473 {
10476 }
10477 else
10478 {
10481 }
10482 }
10483 }
10484
10487 {
10488 SetWeightDirty();
10490
10491 if (parent)
10492 parent.OnAttachmentQuantityChangedEx(this, delta);
10493
10495 {
10497 {
10499 }
10501 {
10502 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10504 }
10505 }
10506
10507 }
10508
10511 {
10512
10513 }
10514
10517 {
10519 }
10520
10522 {
10523 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10524
10526 {
10527 if (newLevel == GameConstants.STATE_RUINED)
10528 {
10530 EntityAI parent = GetHierarchyParent();
10531 if (parent && parent.IsFireplace())
10532 {
10533 CargoBase cargo = GetInventory().GetCargo();
10534 if (cargo)
10535 {
10537 {
10539 }
10540 }
10541 }
10542 }
10543
10545 {
10546
10548 return;
10549 }
10550
10551 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10552 {
10554 }
10555 }
10556 }
10557
10558
10560 {
10561 super.OnRightClick();
10562
10564 {
10566 {
10567 if (ScriptInputUserData.CanStoreInputUserData())
10568 {
10569 vector m4[4];
10571
10572 EntityAI root = GetHierarchyRoot();
10573
10574 InventoryLocation dst = new InventoryLocation;
10576 {
10577 if (root)
10578 {
10579 root.GetTransform(m4);
10581 }
10582 else
10583 GetInventory().GetCurrentInventoryLocation(dst);
10584 }
10585 else
10586 {
10588
10589
10590 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10591 {
10592 if (root)
10593 {
10594 root.GetTransform(m4);
10596 }
10597 else
10598 GetInventory().GetCurrentInventoryLocation(dst);
10599 }
10600 else
10601 {
10602 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10603 }
10604 }
10605
10606 ScriptInputUserData ctx = new ScriptInputUserData;
10614 }
10615 }
10616 else if (!
GetGame().IsMultiplayer())
10617 {
10619 }
10620 }
10621 }
10622
10623 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10624 {
10625
10626 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10627 return false;
10628
10629 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10630 return false;
10631
10632
10634 return false;
10635
10636
10637 Magazine mag = Magazine.Cast(this);
10638 if (mag)
10639 {
10640 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10641 return false;
10642
10643 if (stack_max_limit)
10644 {
10645 Magazine other_mag = Magazine.Cast(other_item);
10646 if (other_item)
10647 {
10648 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10649 return false;
10650 }
10651
10652 }
10653 }
10654 else
10655 {
10656
10658 return false;
10659
10661 return false;
10662 }
10663
10664 PlayerBase player = null;
10665 if (CastTo(player, GetHierarchyRootPlayer()))
10666 {
10667 if (player.GetInventory().HasAttachment(this))
10668 return false;
10669
10670 if (player.IsItemsToDelete())
10671 return false;
10672 }
10673
10674 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10675 return false;
10676
10677 int slotID;
10679 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10680 return false;
10681
10682 return true;
10683 }
10684
10686 {
10688 }
10689
10691 {
10692 return m_IsResultOfSplit;
10693 }
10694
10696 {
10697 m_IsResultOfSplit = value;
10698 }
10699
10701 {
10703 }
10704
10706 {
10707 float other_item_quantity = other_item.GetQuantity();
10708 float this_free_space;
10709
10711
10713
10714 if (other_item_quantity > this_free_space)
10715 {
10716 return this_free_space;
10717 }
10718 else
10719 {
10720 return other_item_quantity;
10721 }
10722 }
10723
10725 {
10727 }
10728
10730 {
10732 return;
10733
10734 if (!IsMagazine() && other_item)
10735 {
10737 if (quantity_used != 0)
10738 {
10739 float hp1 = GetHealth01("","");
10740 float hp2 = other_item.GetHealth01("","");
10741 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10742 hpResult = hpResult / (
GetQuantity() + quantity_used);
10743
10744 hpResult *= GetMaxHealth();
10745 Math.Round(hpResult);
10746 SetHealth("", "Health", hpResult);
10747
10749 other_item.AddQuantity(-quantity_used);
10750 }
10751 }
10753 }
10754
10756 {
10757 #ifdef SERVER
10758 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10759 GetHierarchyParent().IncreaseLifetimeUp();
10760 #endif
10761 };
10762
10764 {
10765 PlayerBase p = PlayerBase.Cast(player);
10766
10767 array<int> recipesIds = p.m_Recipes;
10768 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10769 if (moduleRecipesManager)
10770 {
10771 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10772 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10773 }
10774
10775 for (int i = 0;i < recipesIds.Count(); i++)
10776 {
10777 int key = recipesIds.Get(i);
10778 string recipeName = moduleRecipesManager.GetRecipeName(key);
10780 }
10781 }
10782
10783
10784 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10785 {
10786 super.GetDebugActions(outputList);
10787
10788
10793
10794
10798
10802
10803
10806
10807
10809 {
10812 }
10813
10815
10818
10822 }
10823
10824
10825
10826
10828 {
10829 super.OnAction(action_id, player, ctx);
10830 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10831 {
10832 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10833 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10834 PlayerBase p = PlayerBase.Cast(player);
10835 if (
EActions.RECIPES_RANGE_START < 1000)
10836 {
10837 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10838 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10839 }
10840 }
10841 #ifndef SERVER
10842 else if (action_id ==
EActions.WATCH_PLAYER)
10843 {
10844 PluginDeveloper.SetDeveloperItemClientEx(player);
10845 }
10846 #endif
10848 {
10849 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10850 {
10851 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10852 OnDebugButtonPressServer(id + 1);
10853 }
10854
10855 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10856 {
10857 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10859 }
10860
10861 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10862 {
10863 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10865 }
10866
10867 else if (action_id ==
EActions.ADD_QUANTITY)
10868 {
10869 if (IsMagazine())
10870 {
10871 Magazine mag = Magazine.Cast(this);
10872 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10873 }
10874 else
10875 {
10877 }
10878
10879 if (m_EM)
10880 {
10881 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10882 }
10883
10884 }
10885
10886 else if (action_id ==
EActions.REMOVE_QUANTITY)
10887 {
10888 if (IsMagazine())
10889 {
10890 Magazine mag2 = Magazine.Cast(this);
10891 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10892 }
10893 else
10894 {
10896 }
10897 if (m_EM)
10898 {
10899 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10900 }
10901
10902 }
10903
10904 else if (action_id ==
EActions.SET_QUANTITY_0)
10905 {
10907
10908 if (m_EM)
10909 {
10910 m_EM.SetEnergy(0);
10911 }
10912 }
10913
10914 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10915 {
10917
10918 if (m_EM)
10919 {
10920 m_EM.SetEnergy(m_EM.GetEnergyMax());
10921 }
10922 }
10923
10924 else if (action_id ==
EActions.ADD_HEALTH)
10925 {
10926 AddHealth("","",GetMaxHealth("","Health")/5);
10927 }
10928 else if (action_id ==
EActions.REMOVE_HEALTH)
10929 {
10930 AddHealth("","",-GetMaxHealth("","Health")/5);
10931 }
10932 else if (action_id ==
EActions.DESTROY_HEALTH)
10933 {
10934 SetHealth01("","",0);
10935 }
10936 else if (action_id ==
EActions.WATCH_ITEM)
10937 {
10939 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10940 #ifdef DEVELOPER
10941 SetDebugDeveloper_item(this);
10942 #endif
10943 }
10944
10945 else if (action_id ==
EActions.ADD_TEMPERATURE)
10946 {
10947 AddTemperature(20);
10948
10949 }
10950
10951 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10952 {
10953 AddTemperature(-20);
10954
10955 }
10956
10957 else if (action_id ==
EActions.FLIP_FROZEN)
10958 {
10959 SetFrozen(!GetIsFrozen());
10960
10961 }
10962
10963 else if (action_id ==
EActions.ADD_WETNESS)
10964 {
10966
10967 }
10968
10969 else if (action_id ==
EActions.REMOVE_WETNESS)
10970 {
10972
10973 }
10974
10975 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10976 {
10979
10980
10981 }
10982
10983 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10984 {
10987 }
10988
10989 else if (action_id ==
EActions.MAKE_SPECIAL)
10990 {
10991 auto debugParams = DebugSpawnParams.WithPlayer(player);
10992 OnDebugSpawnEx(debugParams);
10993 }
10994
10995 else if (action_id ==
EActions.DELETE)
10996 {
10997 Delete();
10998 }
10999
11000 }
11001
11002
11003 return false;
11004 }
11005
11006
11007
11008
11012
11015
11016
11017
11019 {
11020 return false;
11021 }
11022
11023
11025 {
11026 return true;
11027 }
11028
11029
11031 {
11032 return true;
11033 }
11034
11035
11036
11038 {
11039 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11041 }
11042
11045 {
11046 return null;
11047 }
11048
11050 {
11051 return false;
11052 }
11053
11055 {
11056 return false;
11057 }
11058
11062
11063
11065 {
11066 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11067 return module_repairing.CanRepair(this, item_repair_kit);
11068 }
11069
11070
11071 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11072 {
11073 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11074 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11075 }
11076
11077
11079 {
11080
11081
11082
11083
11084
11085
11086
11087
11088 return 1;
11089 }
11090
11091
11092
11094 {
11096 }
11097
11098
11099
11101 {
11103 }
11104
11105
11114 {
11115 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11116
11117 if (player)
11118 {
11119 player.MessageStatus(text);
11120 }
11121 }
11122
11123
11132 {
11133 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11134
11135 if (player)
11136 {
11137 player.MessageAction(text);
11138 }
11139 }
11140
11141
11150 {
11151 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11152
11153 if (player)
11154 {
11155 player.MessageFriendly(text);
11156 }
11157 }
11158
11159
11168 {
11169 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11170
11171 if (player)
11172 {
11173 player.MessageImportant(text);
11174 }
11175 }
11176
11178 {
11179 return true;
11180 }
11181
11182
11183 override bool KindOf(
string tag)
11184 {
11185 bool found = false;
11186 string item_name = this.
GetType();
11189
11190 int array_size = item_tag_array.Count();
11191 for (int i = 0; i < array_size; i++)
11192 {
11193 if (item_tag_array.Get(i) == tag)
11194 {
11195 found = true;
11196 break;
11197 }
11198 }
11199 return found;
11200 }
11201
11202
11204 {
11205
11206 super.OnRPC(sender, rpc_type,ctx);
11207
11208
11209 switch (rpc_type)
11210 {
11211 #ifndef SERVER
11212 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11213 Param2<bool, string> p = new Param2<bool, string>(false, "");
11214
11216 return;
11217
11218 bool play = p.param1;
11219 string soundSet = p.param2;
11220
11221 if (play)
11222 {
11224 {
11226 {
11228 }
11229 }
11230 else
11231 {
11233 }
11234 }
11235 else
11236 {
11238 }
11239
11240 break;
11241 #endif
11242
11243 }
11244
11246 {
11248 }
11249 }
11250
11251
11252
11253
11255 {
11256 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11257 return plugin.GetID(
name);
11258 }
11259
11261 {
11262 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11263 return plugin.GetName(id);
11264 }
11265
11268 {
11269
11270
11271 int varFlags;
11272 if (!ctx.
Read(varFlags))
11273 return;
11274
11275 if (varFlags & ItemVariableFlags.FLOAT)
11276 {
11278 }
11279 }
11280
11282 {
11283
11284 super.SerializeNumericalVars(floats_out);
11285
11286
11287
11289 {
11291 }
11292
11294 {
11296 }
11297
11299 {
11301 }
11302
11304 {
11309 }
11310
11312 {
11314 }
11315 }
11316
11318 {
11319
11320 super.DeSerializeNumericalVars(floats);
11321
11322
11323 int index = 0;
11324 int mask = Math.Round(floats.Get(index));
11325
11326 index++;
11327
11329 {
11331 {
11333 }
11334 else
11335 {
11336 float quantity = floats.Get(index);
11337 SetQuantity(quantity,
true,
false,
false,
false);
11338 }
11339 index++;
11340 }
11341
11343 {
11344 float wet = floats.Get(index);
11346 index++;
11347 }
11348
11350 {
11351 int liquidtype = Math.Round(floats.Get(index));
11353 index++;
11354 }
11355
11357 {
11359 index++;
11361 index++;
11363 index++;
11365 index++;
11366 }
11367
11369 {
11370 int cleanness = Math.Round(floats.Get(index));
11372 index++;
11373 }
11374 }
11375
11377 {
11378 super.WriteVarsToCTX(ctx);
11379
11380
11382 {
11384 }
11385
11387 {
11389 }
11390
11392 {
11394 }
11395
11397 {
11398 int r,g,b,a;
11404 }
11405
11407 {
11409 }
11410 }
11411
11413 {
11414 if (!super.ReadVarsFromCTX(ctx,version))
11415 return false;
11416
11417 int intValue;
11418 float value;
11419
11420 if (version < 140)
11421 {
11422 if (!ctx.
Read(intValue))
11423 return false;
11424
11425 m_VariablesMask = intValue;
11426 }
11427
11429 {
11430 if (!ctx.
Read(value))
11431 return false;
11432
11434 {
11436 }
11437 else
11438 {
11440 }
11441 }
11442
11443 if (version < 140)
11444 {
11446 {
11447 if (!ctx.
Read(value))
11448 return false;
11449 SetTemperatureDirect(value);
11450 }
11451 }
11452
11454 {
11455 if (!ctx.
Read(value))
11456 return false;
11458 }
11459
11461 {
11462 if (!ctx.
Read(intValue))
11463 return false;
11465 }
11466
11468 {
11469 int r,g,b,a;
11471 return false;
11473 return false;
11475 return false;
11477 return false;
11478
11480 }
11481
11483 {
11484 if (!ctx.
Read(intValue))
11485 return false;
11487 }
11488
11489 if (version >= 138 && version < 140)
11490 {
11492 {
11493 if (!ctx.
Read(intValue))
11494 return false;
11495 SetFrozen(intValue);
11496 }
11497 }
11498
11499 return true;
11500 }
11501
11502
11504 {
11507 {
11509 }
11510
11511 if (!super.OnStoreLoad(ctx, version))
11512 {
11514 return false;
11515 }
11516
11517 if (version >= 114)
11518 {
11519 bool hasQuickBarIndexSaved;
11520
11521 if (!ctx.
Read(hasQuickBarIndexSaved))
11522 {
11524 return false;
11525 }
11526
11527 if (hasQuickBarIndexSaved)
11528 {
11529 int itmQBIndex;
11530
11531
11532 if (!ctx.
Read(itmQBIndex))
11533 {
11535 return false;
11536 }
11537
11538 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11539 if (itmQBIndex != -1 && parentPlayer)
11540 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11541 }
11542 }
11543 else
11544 {
11545
11546 PlayerBase player;
11547 int itemQBIndex;
11548 if (version ==
int.
MAX)
11549 {
11550 if (!ctx.
Read(itemQBIndex))
11551 {
11553 return false;
11554 }
11555 }
11556 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11557 {
11558
11559 if (!ctx.
Read(itemQBIndex))
11560 {
11562 return false;
11563 }
11564 if (itemQBIndex != -1 && player)
11565 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11566 }
11567 }
11568
11569 if (version < 140)
11570 {
11571
11572 if (!LoadVariables(ctx, version))
11573 {
11575 return false;
11576 }
11577 }
11578
11579
11581 {
11583 return false;
11584 }
11585 if (version >= 132)
11586 {
11588 if (raib)
11589 {
11591 {
11593 return false;
11594 }
11595 }
11596 }
11597
11599 return true;
11600 }
11601
11602
11603
11605 {
11606 super.OnStoreSave(ctx);
11607
11608 PlayerBase player;
11609 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11610 {
11612
11613 int itemQBIndex = -1;
11614 itemQBIndex = player.FindQuickBarEntityIndex(this);
11615 ctx.
Write(itemQBIndex);
11616 }
11617 else
11618 {
11620 }
11621
11623
11625 if (raib)
11626 {
11628 }
11629 }
11630
11631
11633 {
11634 super.AfterStoreLoad();
11635
11637 {
11639 }
11640
11642 {
11645 }
11646 }
11647
11649 {
11650 super.EEOnAfterLoad();
11651
11653 {
11655 }
11656
11659 }
11660
11662 {
11663 return false;
11664 }
11665
11666
11667
11669 {
11671 {
11672 #ifdef PLATFORM_CONSOLE
11673
11675 {
11677 if (menu)
11678 {
11680 }
11681 }
11682 #endif
11683 }
11684
11686 {
11689 }
11690
11692 {
11693 SetWeightDirty();
11695 }
11697 {
11700 }
11701
11703 {
11706 }
11708 {
11711 }
11712
11713 super.OnVariablesSynchronized();
11714 }
11715
11716
11717
11719 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11720 {
11721 if (!IsServerCheck(allow_client))
11722 return false;
11723
11725 return false;
11726
11729
11730 if (value <= (min + 0.001))
11731 value = min;
11732
11733 if (value == min)
11734 {
11735 if (destroy_config)
11736 {
11737 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11738 if (dstr)
11739 {
11741 this.Delete();
11742 return true;
11743 }
11744 }
11745 else if (destroy_forced)
11746 {
11748 this.Delete();
11749 return true;
11750 }
11751
11753 }
11754
11757
11759 {
11761
11762 if (delta)
11764 }
11765
11767
11768 return false;
11769 }
11770
11771
11773 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11774 {
11776 }
11777
11779 {
11782 }
11783
11785 {
11788 }
11789
11792 {
11793 float value_clamped = Math.Clamp(value, 0, 1);
11795 SetQuantity(result, destroy_config, destroy_forced);
11796 }
11797
11798
11801 {
11803 }
11804
11806 {
11808 }
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11820 {
11821 int slot = -1;
11822 if (GetInventory())
11823 {
11824 InventoryLocation il = new InventoryLocation;
11825 GetInventory().GetCurrentInventoryLocation(il);
11827 }
11828
11830 }
11831
11833 {
11834 float quantity_max = 0;
11835
11837 {
11838 if (attSlotID != -1)
11839 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11840
11841 if (quantity_max <= 0)
11843 }
11844
11845 if (quantity_max <= 0)
11847
11848 return quantity_max;
11849 }
11850
11852 {
11854 }
11855
11857 {
11859 }
11860
11861
11863 {
11865 }
11866
11868 {
11870 }
11871
11873 {
11875 }
11876
11877
11879 {
11880
11881 float weightEx = GetWeightEx();
11882 float special = GetInventoryAndCargoWeight();
11883 return weightEx - special;
11884 }
11885
11886
11888 {
11890 }
11891
11893 {
11895 {
11896 #ifdef DEVELOPER
11897 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11898 {
11899 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11901 }
11902 #endif
11903
11904 return GetQuantity() * GetConfigWeightModified();
11905 }
11906 else if (HasEnergyManager())
11907 {
11908 #ifdef DEVELOPER
11909 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11910 {
11911 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11912 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11913 }
11914 #endif
11915 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11916 }
11917 else
11918 {
11919 #ifdef DEVELOPER
11920 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11921 {
11922 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11923 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11924 }
11925 #endif
11926 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11927 }
11928 }
11929
11932 {
11933 int item_count = 0;
11935
11936 if (GetInventory().GetCargo() != NULL)
11937 {
11938 item_count = GetInventory().GetCargo().GetItemCount();
11939 }
11940
11941 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11942 {
11943 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11944 if (item)
11945 item_count += item.GetNumberOfItems();
11946 }
11947 return item_count;
11948 }
11949
11952 {
11953 float weight = 0;
11954 float wetness = 1;
11955 if (include_wetness)
11958 {
11959 weight = wetness * m_ConfigWeight;
11960 }
11962 {
11963 weight = 1;
11964 }
11965 return weight;
11966 }
11967
11968
11969
11971 {
11972 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11973 {
11974 GameInventory inv = GetInventory();
11975 array<EntityAI> items = new array<EntityAI>;
11977 for (int i = 0; i < items.Count(); i++)
11978 {
11980 if (item)
11981 {
11983 }
11984 }
11985 }
11986 }
11987
11988
11989
11990
11992 {
11993 float energy = 0;
11994 if (HasEnergyManager())
11995 {
11996 energy = GetCompEM().GetEnergy();
11997 }
11998 return energy;
11999 }
12000
12001
12003 {
12004 super.OnEnergyConsumed();
12005
12007 }
12008
12010 {
12011 super.OnEnergyAdded();
12012
12014 }
12015
12016
12018 {
12019 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12020 {
12022 {
12023 float energy_0to1 = GetCompEM().GetEnergy0To1();
12025 }
12026 }
12027 }
12028
12029
12031 {
12032 return ConfigGetFloat("heatIsolation");
12033 }
12034
12036 {
12038 }
12039
12041 {
12042 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12043 if (
GetGame().ConfigIsExisting(paramPath))
12045
12046 return 0.0;
12047 }
12048
12050 {
12051 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12052 if (
GetGame().ConfigIsExisting(paramPath))
12054
12055 return 0.0;
12056 }
12057
12058 override void SetWet(
float value,
bool allow_client =
false)
12059 {
12060 if (!IsServerCheck(allow_client))
12061 return;
12062
12065
12067
12068 m_VarWet = Math.Clamp(value, min, max);
12069
12071 {
12074 }
12075 }
12076
12077 override void AddWet(
float value)
12078 {
12080 }
12081
12083 {
12085 }
12086
12088 {
12090 }
12091
12093 {
12095 }
12096
12098 {
12100 }
12101
12103 {
12105 }
12106
12107 override void OnWetChanged(
float newVal,
float oldVal)
12108 {
12111 if (newLevel != oldLevel)
12112 {
12114 }
12115 }
12116
12118 {
12119 SetWeightDirty();
12120 }
12121
12123 {
12124 return GetWetLevelInternal(
m_VarWet);
12125 }
12126
12127
12128
12130 {
12132 }
12133
12135 {
12137 }
12138
12140 {
12142 }
12143
12145 {
12147 }
12148
12149
12150
12152 {
12153 if (ConfigIsExisting("itemModelLength"))
12154 {
12155 return ConfigGetFloat("itemModelLength");
12156 }
12157 return 0;
12158 }
12159
12161 {
12162 if (ConfigIsExisting("itemAttachOffset"))
12163 {
12164 return ConfigGetFloat("itemAttachOffset");
12165 }
12166 return 0;
12167 }
12168
12169 override void SetCleanness(
int value,
bool allow_client =
false)
12170 {
12171 if (!IsServerCheck(allow_client))
12172 return;
12173
12175
12177
12180 }
12181
12183 {
12185 }
12186
12188 {
12189 return true;
12190 }
12191
12192
12193
12194
12196 {
12198 }
12199
12201 {
12203 }
12204
12205
12206
12207
12208 override void SetColor(
int r,
int g,
int b,
int a)
12209 {
12215 }
12217 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12218 {
12223 }
12224
12226 {
12228 }
12229
12232 {
12233 int r,g,b,a;
12235 r = r/255;
12236 g = g/255;
12237 b = b/255;
12238 a = a/255;
12239 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12240 }
12241
12242
12243
12244 override void SetLiquidType(
int value,
bool allow_client =
false)
12245 {
12246 if (!IsServerCheck(allow_client))
12247 return;
12248
12253 }
12254
12256 {
12257 return ConfigGetInt("varLiquidTypeInit");
12258 }
12259
12261 {
12263 }
12264
12266 {
12268 SetFrozen(false);
12269 }
12270
12273 {
12274 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12275 }
12276
12277
12280 {
12281 PlayerBase nplayer;
12282 if (PlayerBase.CastTo(nplayer, player))
12283 {
12285
12286 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12287 }
12288 }
12289
12290
12293 {
12294 PlayerBase nplayer;
12295 if (PlayerBase.CastTo(nplayer,player))
12296 {
12297
12298 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12299
12300 }
12301
12302
12303 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12304
12305
12306 if (HasEnergyManager())
12307 {
12308 GetCompEM().UpdatePlugState();
12309 }
12310 }
12311
12312
12314 {
12315 super.OnPlacementStarted(player);
12316
12318 }
12319
12320 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12321 {
12323 {
12324 m_AdminLog.OnPlacementComplete(player,
this);
12325 }
12326
12327 super.OnPlacementComplete(player, position, orientation);
12328 }
12329
12330
12331
12332
12333
12335 {
12337 {
12338 return true;
12339 }
12340 else
12341 {
12342 return false;
12343 }
12344 }
12345
12346
12348 {
12350 {
12352 }
12353 }
12354
12355
12357 {
12359 }
12360
12362 {
12364 }
12365
12366 override void InsertAgent(
int agent,
float count = 1)
12367 {
12368 if (count < 1)
12369 return;
12370
12372 }
12373
12376 {
12378 }
12379
12380
12382 {
12384 }
12385
12386
12387
12388
12389
12390
12391
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
12428 {
12430 return false;
12431 return true;
12432 }
12433
12435 {
12436
12438 }
12439
12440
12443 {
12444 super.CheckForRoofLimited(timeTresholdMS);
12445
12447 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12448 {
12449 m_PreviousRoofTestTime = time;
12450 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12451 }
12452 }
12453
12454
12456 {
12458 {
12459 return 0;
12460 }
12461
12462 if (GetInventory().GetAttachmentSlotsCount() != 0)
12463 {
12464 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12465 if (filter)
12466 return filter.GetProtectionLevel(type, false, system);
12467 else
12468 return 0;
12469 }
12470
12471 string subclassPath, entryName;
12472
12473 switch (type)
12474 {
12476 entryName = "biological";
12477 break;
12479 entryName = "chemical";
12480 break;
12481 default:
12482 entryName = "biological";
12483 break;
12484 }
12485
12486 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12487
12489 }
12490
12491
12492
12495 {
12496 if (!IsMagazine())
12498
12500 }
12501
12502
12503
12504
12505
12510 {
12511 return true;
12512 }
12513
12515 {
12517 }
12518
12519
12520
12521
12522
12524 {
12525 if (parent)
12526 {
12527 if (parent.IsInherited(DayZInfected))
12528 return true;
12529
12530 if (!parent.IsRuined())
12531 return true;
12532 }
12533
12534 return true;
12535 }
12536
12538 {
12539 if (!super.CanPutAsAttachment(parent))
12540 {
12541 return false;
12542 }
12543
12544 if (!IsRuined() && !parent.IsRuined())
12545 {
12546 return true;
12547 }
12548
12549 return false;
12550 }
12551
12553 {
12554
12555
12556
12557
12558 return super.CanReceiveItemIntoCargo(item);
12559 }
12560
12562 {
12563
12564
12565
12566
12567 GameInventory attachmentInv = attachment.GetInventory();
12569 {
12570 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12571 return false;
12572 }
12573
12574 InventoryLocation loc = new InventoryLocation();
12575 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12576 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12577 return false;
12578
12579 return super.CanReceiveAttachment(attachment, slotId);
12580 }
12581
12583 {
12584 if (!super.CanReleaseAttachment(attachment))
12585 return false;
12586
12587 return GetInventory().AreChildrenAccessible();
12588 }
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12611 {
12612 int id = muzzle_owner.GetMuzzleID();
12613 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12614
12615 if (WPOF_array)
12616 {
12617 for (int i = 0; i < WPOF_array.Count(); i++)
12618 {
12619 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12620
12621 if (WPOF)
12622 {
12623 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12624 }
12625 }
12626 }
12627 }
12628
12629
12631 {
12632 int id = muzzle_owner.GetMuzzleID();
12634
12635 if (WPOBE_array)
12636 {
12637 for (int i = 0; i < WPOBE_array.Count(); i++)
12638 {
12639 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12640
12641 if (WPOBE)
12642 {
12643 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12644 }
12645 }
12646 }
12647 }
12648
12649
12651 {
12652 int id = muzzle_owner.GetMuzzleID();
12653 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12654
12655 if (WPOOH_array)
12656 {
12657 for (int i = 0; i < WPOOH_array.Count(); i++)
12658 {
12659 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12660
12661 if (WPOOH)
12662 {
12663 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12664 }
12665 }
12666 }
12667 }
12668
12669
12671 {
12672 int id = muzzle_owner.GetMuzzleID();
12673 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12674
12675 if (WPOOH_array)
12676 {
12677 for (int i = 0; i < WPOOH_array.Count(); i++)
12678 {
12679 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12680
12681 if (WPOOH)
12682 {
12683 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12684 }
12685 }
12686 }
12687 }
12688
12689
12691 {
12692 int id = muzzle_owner.GetMuzzleID();
12693 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12694
12695 if (WPOOH_array)
12696 {
12697 for (int i = 0; i < WPOOH_array.Count(); i++)
12698 {
12699 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12700
12701 if (WPOOH)
12702 {
12703 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12704 }
12705 }
12706 }
12707 }
12708
12709
12710
12712 {
12714 {
12715 return true;
12716 }
12717
12718 return false;
12719 }
12720
12722 {
12724 {
12725 return true;
12726 }
12727
12728 return false;
12729 }
12730
12732 {
12734 {
12735 return true;
12736 }
12737
12738 return false;
12739 }
12740
12742 {
12743 return false;
12744 }
12745
12748 {
12749 return UATimeSpent.DEFAULT_DEPLOY;
12750 }
12751
12752
12753
12754
12756 {
12758 SetSynchDirty();
12759 }
12760
12762 {
12764 }
12765
12766
12768 {
12769 return false;
12770 }
12771
12774 {
12775 string att_type = "None";
12776
12777 if (ConfigIsExisting("soundAttType"))
12778 {
12779 att_type = ConfigGetString("soundAttType");
12780 }
12781
12783 }
12784
12786 {
12788 }
12789
12790
12791
12792
12793
12797
12799 {
12802
12804 }
12805
12806
12808 {
12810 return;
12811
12813
12816
12819
12820 SoundParameters params = new SoundParameters();
12824 }
12825
12826
12828 {
12830 return;
12831
12833 SetSynchDirty();
12834
12837 }
12838
12839
12841 {
12843 return;
12844
12846 SetSynchDirty();
12847
12850 }
12851
12853 {
12855 }
12856
12858 {
12860 }
12861
12864 {
12865 if (!
GetGame().IsDedicatedServer())
12866 {
12867 if (ConfigIsExisting("attachSoundSet"))
12868 {
12869 string cfg_path = "";
12870 string soundset = "";
12871 string type_name =
GetType();
12872
12875 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12876 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12877
12878 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12879 {
12880 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12881 {
12882 if (cfg_slot_array[i] == slot_type)
12883 {
12884 soundset = cfg_soundset_array[i];
12885 break;
12886 }
12887 }
12888 }
12889
12890 if (soundset != "")
12891 {
12892 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12894 }
12895 }
12896 }
12897 }
12898
12900 {
12901
12902 }
12903
12904 void OnApply(PlayerBase player);
12905
12907 {
12908 return 1.0;
12909 };
12910
12912 {
12914 }
12915
12917 {
12919 }
12920
12922
12924 {
12925 SetDynamicPhysicsLifeTime(0.01);
12927 }
12928
12930 {
12931 array<string> zone_names = new array<string>;
12932 GetDamageZones(zone_names);
12933 for (int i = 0; i < zone_names.Count(); i++)
12934 {
12935 SetHealthMax(zone_names.Get(i),"Health");
12936 }
12937 SetHealthMax("","Health");
12938 }
12939
12942 {
12943 float global_health = GetHealth01("","Health");
12944 array<string> zones = new array<string>;
12945 GetDamageZones(zones);
12946
12947 for (int i = 0; i < zones.Count(); i++)
12948 {
12949 SetHealth01(zones.Get(i),"Health",global_health);
12950 }
12951 }
12952
12955 {
12956 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12957 }
12958
12960 {
12961 if (!hasRootAsPlayer)
12962 {
12963 if (refParentIB)
12964 {
12965
12966 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12967 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12968
12969 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12970 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12971
12974 }
12975 else
12976 {
12977
12980 }
12981 }
12982 }
12983
12985 {
12987 {
12988 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12989 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12990 {
12991 float heatPermCoef = 1.0;
12993 while (ent)
12994 {
12995 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12996 ent = ent.GetHierarchyParent();
12997 }
12998
12999 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13000 }
13001 }
13002 }
13003
13005 {
13006
13007 EntityAI parent = GetHierarchyParent();
13008 if (!parent)
13009 {
13010 hasParent = false;
13011 hasRootAsPlayer = false;
13012 }
13013 else
13014 {
13015 hasParent = true;
13016 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13017 refParentIB =
ItemBase.Cast(parent);
13018 }
13019 }
13020
13021 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13022 {
13023
13024 }
13025
13027 {
13028
13029 return false;
13030 }
13031
13033 {
13034
13035
13036 return false;
13037 }
13038
13040 {
13041
13042 return false;
13043 }
13044
13047 {
13048 return !GetIsFrozen() &&
IsOpen();
13049 }
13050
13052 {
13053 bool hasParent = false, hasRootAsPlayer = false;
13055
13056 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13057 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13058
13059 if (wwtu || foodDecay)
13060 {
13064
13065 if (processWetness || processTemperature || processDecay)
13066 {
13068
13069 if (processWetness)
13070 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13071
13072 if (processTemperature)
13074
13075 if (processDecay)
13076 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13077 }
13078 }
13079 }
13080
13083 {
13085 }
13086
13088 {
13091
13092 return super.GetTemperatureFreezeThreshold();
13093 }
13094
13096 {
13099
13100 return super.GetTemperatureThawThreshold();
13101 }
13102
13104 {
13107
13108 return super.GetItemOverheatThreshold();
13109 }
13110
13112 {
13114 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13115
13116 return super.GetTemperatureFreezeTime();
13117 }
13118
13120 {
13122 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13123
13124 return super.GetTemperatureThawTime();
13125 }
13126
13131
13133 {
13134 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13135 }
13136
13138 {
13139 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13140 }
13141
13144 {
13146 }
13147
13149 {
13151 }
13152
13154 {
13156 }
13157
13160 {
13161 return null;
13162 }
13163
13166 {
13167 return false;
13168 }
13169
13171 {
13173 {
13176 if (!trg)
13177 {
13179 explosive = this;
13180 }
13181
13182 explosive.PairRemote(trg);
13184
13185 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13186 trg.SetPersistentPairID(persistentID);
13187 explosive.SetPersistentPairID(persistentID);
13188
13189 return true;
13190 }
13191 return false;
13192 }
13193
13196 {
13197 float ret = 1.0;
13200 ret *= GetHealth01();
13201
13202 return ret;
13203 }
13204
13205 #ifdef DEVELOPER
13206 override void SetDebugItem()
13207 {
13208 super.SetDebugItem();
13209 _itemBase = this;
13210 }
13211
13213 {
13214 string text = super.GetDebugText();
13215
13217 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13218
13219 return text;
13220 }
13221 #endif
13222
13224 {
13225 return true;
13226 }
13227
13229
13231
13233 {
13236 }
13237
13238
13246
13262}
13263
13265{
13267 if (entity)
13268 {
13269 bool is_item = entity.IsInherited(
ItemBase);
13270 if (is_item && full_quantity)
13271 {
13274 }
13275 }
13276 else
13277 {
13279 return NULL;
13280 }
13281 return entity;
13282}
13283
13285{
13286 if (item)
13287 {
13288 if (health > 0)
13289 item.SetHealth("", "", health);
13290
13291 if (item.CanHaveTemperature())
13292 {
13294 if (item.CanFreeze())
13295 item.SetFrozen(false);
13296 }
13297
13298 if (item.HasEnergyManager())
13299 {
13300 if (quantity >= 0)
13301 {
13302 item.GetCompEM().SetEnergy0To1(quantity);
13303 }
13304 else
13305 {
13307 }
13308 }
13309 else if (item.IsMagazine())
13310 {
13311 Magazine mag = Magazine.Cast(item);
13312 if (quantity >= 0)
13313 {
13314 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13315 }
13316 else
13317 {
13319 }
13320
13321 }
13322 else
13323 {
13324 if (quantity >= 0)
13325 {
13326 item.SetQuantityNormalized(quantity, false);
13327 }
13328 else
13329 {
13331 }
13332
13333 }
13334 }
13335}
13336
13337#ifdef DEVELOPER
13339#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.