8530{
8532 {
8533 return true;
8534 }
8535};
8536
8537
8538
8540{
8544
8546
8549
8550
8551
8552
8553
8562
8568
8573
8578
8599 protected bool m_IsResultOfSplit
8600
8602
8607
8608
8609
8611
8615
8616
8617
8619
8622
8623
8624
8630
8631
8639
8642
8643
8645
8646
8648
8649
8654
8655
8660
8661
8663
8664
8666 {
8671
8672 if (!
GetGame().IsDedicatedServer())
8673 {
8675 {
8677
8679 {
8681 }
8682 }
8683
8686 }
8687
8688 m_OldLocation = null;
8689
8691 {
8693 }
8694
8695 if (ConfigIsExisting("headSelectionsToHide"))
8696 {
8699 }
8700
8702 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8703 {
8705 }
8706
8708
8709 m_IsResultOfSplit = false;
8710
8712 }
8713
8715 {
8716 super.InitItemVariables();
8717
8723 m_Count = ConfigGetInt(
"count");
8724
8727
8732
8735
8740
8752
8756
8757
8760 if (ConfigIsExisting("canBeSplit"))
8761 {
8764 }
8765
8767 if (ConfigIsExisting("itemBehaviour"))
8769
8770
8773 RegisterNetSyncVariableInt("m_VarLiquidType");
8774 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8775
8776 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8777 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8778 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8779
8780 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8781 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8782 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8783 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8784
8785 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8786 RegisterNetSyncVariableBool("m_IsTakeable");
8787 RegisterNetSyncVariableBool("m_IsHologram");
8788
8791 {
8794 }
8795
8797
8799 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8801
8802 }
8803
8805 {
8807 }
8808
8810 {
8813 {
8818 }
8819 }
8820
8821 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8822 {
8824 {
8827 }
8828
8830 }
8831
8833 {
8839 }
8840
8842
8844 {
8846
8847 if (!action)
8848 {
8849 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8850 return;
8851 }
8852
8854 if (!ai)
8855 {
8857 return;
8858 }
8859
8861 if (!action_array)
8862 {
8863 action_array = new array<ActionBase_Basic>;
8865 }
8866 if (LogManager.IsActionLogEnable())
8867 {
8868 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8869 }
8870
8871 if (action_array.Find(action) != -1)
8872 {
8873 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8874 }
8875 else
8876 {
8877 action_array.Insert(action);
8878 }
8879 }
8880
8882 {
8884 ActionBase action = player.GetActionManager().GetAction(actionName);
8887
8888 if (action_array)
8889 {
8890 action_array.RemoveItem(action);
8891 }
8892 }
8893
8894
8895
8897 {
8898 ActionOverrideData overrideData = new ActionOverrideData();
8902
8904 if (!actionMap)
8905 {
8908 }
8909
8910 actionMap.Insert(this.
Type(), overrideData);
8911
8912 }
8913
8915
8917
8918
8920 {
8923
8926
8927 string config_to_search = "CfgVehicles";
8928 string muzzle_owner_config;
8929
8931 {
8932 if (IsInherited(Weapon))
8933 config_to_search = "CfgWeapons";
8934
8935 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8936
8937 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8938
8940
8941 if (config_OnFire_subclass_count > 0)
8942 {
8943 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8944
8945 for (int i = 0; i < config_OnFire_subclass_count; i++)
8946 {
8947 string particle_class = "";
8949 string config_OnFire_entry = config_OnFire_class + particle_class;
8950 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8951 WPOF_array.Insert(WPOF);
8952 }
8953
8954
8956 }
8957 }
8958
8960 {
8961 config_to_search = "CfgWeapons";
8962 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8963
8964 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8965
8967
8968 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8969 {
8970 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8971
8972 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8973 {
8974 string particle_class2 = "";
8976 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8977 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8978 WPOBE_array.Insert(WPOBE);
8979 }
8980
8981
8983 }
8984 }
8985 }
8986
8987
8989 {
8992
8994 {
8995 string config_to_search = "CfgVehicles";
8996
8997 if (IsInherited(Weapon))
8998 config_to_search = "CfgWeapons";
8999
9000 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9001 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9002
9003 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9004 {
9005
9007
9009 {
9011 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9013 return;
9014 }
9015
9018
9019
9020
9022 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9023
9024 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9025 {
9026 string particle_class = "";
9028 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9030
9031 if (entry_type == CT_CLASS)
9032 {
9033 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9034 WPOOH_array.Insert(WPOF);
9035 }
9036 }
9037
9038
9040 }
9041 }
9042 }
9043
9045 {
9047 }
9048
9050 {
9052 {
9054
9057
9060
9061 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9062 }
9063 }
9064
9066 {
9068 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9069
9071 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9072
9074 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9075
9077 {
9079 }
9080 }
9081
9083 {
9085 }
9086
9088 {
9091 else
9093
9095 {
9098 }
9099 else
9100 {
9103
9106 }
9107
9109 }
9110
9112 {
9114 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9115 }
9116
9118 {
9120 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9122 }
9123
9125 {
9127 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9128 }
9129
9131 {
9134
9135 OverheatingParticle OP = new OverheatingParticle();
9140
9142 }
9143
9145 {
9148
9149 return -1;
9150 }
9151
9153 {
9155 {
9158
9159 for (int i = count; i > 0; --i)
9160 {
9161 int id = i - 1;
9164
9167
9168 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9169 {
9170 if (p)
9171 {
9174 }
9175 }
9176 }
9177 }
9178 }
9179
9181 {
9183 {
9185 {
9186 int id = i - 1;
9188
9189 if (OP)
9190 {
9192
9193 if (p)
9194 {
9196 }
9197
9198 delete OP;
9199 }
9200 }
9201
9204 }
9205 }
9206
9209 {
9210 return 0.0;
9211 }
9212
9213
9215 {
9216 return 250;
9217 }
9218
9220 {
9221 return 0;
9222 }
9223
9226 {
9228 return true;
9229
9230 return false;
9231 }
9232
9235 {
9238
9240 {
9242 }
9243 else
9244 {
9245
9247 }
9248
9250 }
9251
9258 {
9259 return -1;
9260 }
9261
9262
9263
9264
9266 {
9268 {
9270 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9271
9272 if (r_index >= 0)
9273 {
9274 InventoryLocation r_il = new InventoryLocation;
9275 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9276
9277 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9280 {
9281 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9282 }
9284 {
9285 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9286 }
9287
9288 }
9289
9290 player.GetHumanInventory().ClearUserReservedLocation(this);
9291 }
9292
9295 }
9296
9297
9298
9299
9301 {
9302 return ItemBase.m_DebugActionsMask;
9303 }
9304
9306 {
9307 return ItemBase.m_DebugActionsMask & mask;
9308 }
9309
9311 {
9312 ItemBase.m_DebugActionsMask = mask;
9313 }
9314
9316 {
9317 ItemBase.m_DebugActionsMask |= mask;
9318 }
9319
9321 {
9322 ItemBase.m_DebugActionsMask &= ~mask;
9323 }
9324
9326 {
9328 {
9330 }
9331 else
9332 {
9334 }
9335 }
9336
9337
9339 {
9340 if (GetEconomyProfile())
9341 {
9342 float q_max = GetEconomyProfile().GetQuantityMax();
9343 if (q_max > 0)
9344 {
9345 float q_min = GetEconomyProfile().GetQuantityMin();
9346 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9347
9349 {
9350 ComponentEnergyManager comp = GetCompEM();
9352 {
9354 }
9355 }
9357 {
9359
9360 }
9361
9362 }
9363 }
9364 }
9365
9368 {
9369 EntityAI parent = GetHierarchyParent();
9370
9371 if (parent)
9372 {
9373 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9374 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9375 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9376 }
9377 }
9378
9381 {
9382 EntityAI parent = GetHierarchyParent();
9383
9384 if (parent)
9385 {
9386 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9387 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9388 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9389 }
9390 }
9391
9393 {
9394
9395
9396
9397
9399
9401 {
9402 if (ScriptInputUserData.CanStoreInputUserData())
9403 {
9404 ScriptInputUserData ctx = new ScriptInputUserData;
9410 ctx.
Write(use_stack_max);
9413
9415 {
9416 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9417 }
9418 }
9419 }
9420 else if (!
GetGame().IsMultiplayer())
9421 {
9423 }
9424 }
9425
9427 {
9429 }
9430
9432 {
9434 }
9435
9437 {
9439 }
9440
9442 {
9443
9444 return false;
9445 }
9446
9448 {
9449 return false;
9450 }
9451
9455 {
9456 return false;
9457 }
9458
9460 {
9461 return "";
9462 }
9463
9465
9467 {
9468 return false;
9469 }
9470
9472 {
9473 return true;
9474 }
9475
9476
9477
9479 {
9480 return true;
9481 }
9482
9484 {
9485 return true;
9486 }
9487
9489 {
9490 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9492 }
9493
9495 {
9497 }
9498
9500 {
9502 if (!is_being_placed)
9504 SetSynchDirty();
9505 }
9506
9507
9509
9511 {
9513 }
9514
9516 {
9518 }
9519
9521 {
9522 return 1;
9523 }
9524
9526 {
9527 return false;
9528 }
9529
9531 {
9533 SetSynchDirty();
9534 }
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9571 {
9572 super.OnMovedInsideCargo(container);
9573
9574 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9575 }
9576
9577 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9578 {
9579 super.EEItemLocationChanged(oldLoc,newLoc);
9580
9581 PlayerBase new_player = null;
9582 PlayerBase old_player = null;
9583
9584 if (newLoc.GetParent())
9585 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9586
9587 if (oldLoc.GetParent())
9588 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9589
9591 {
9592 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9593
9594 if (r_index >= 0)
9595 {
9596 InventoryLocation r_il = new InventoryLocation;
9597 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9598
9599 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9602 {
9603 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9604 }
9606 {
9607 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9608 }
9609
9610 }
9611 }
9612
9614 {
9615 if (new_player)
9616 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9617
9618 if (new_player == old_player)
9619 {
9620
9621 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9622 {
9624 {
9625 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9626 {
9627 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9628 }
9629 }
9630 else
9631 {
9632 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9633 }
9634 }
9635
9636 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9637 {
9638 int type = oldLoc.GetType();
9640 {
9641 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9642 }
9644 {
9645 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9646 }
9647 }
9648 if (!m_OldLocation)
9649 {
9650 m_OldLocation = new InventoryLocation;
9651 }
9652 m_OldLocation.Copy(oldLoc);
9653 }
9654 else
9655 {
9656 if (m_OldLocation)
9657 {
9658 m_OldLocation.Reset();
9659 }
9660 }
9661
9663 }
9664 else
9665 {
9666 if (new_player)
9667 {
9668 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9669 if (res_index >= 0)
9670 {
9671 InventoryLocation il = new InventoryLocation;
9672 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9674 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9677 {
9678 il.
GetParent().GetOnReleaseLock().Invoke(it);
9679 }
9681 {
9683 }
9684
9685 }
9686 }
9688 {
9689
9691 }
9692
9693 if (m_OldLocation)
9694 {
9695 m_OldLocation.Reset();
9696 }
9697 }
9698 }
9699
9700 override void EOnContact(IEntity other, Contact extra)
9701 {
9703 {
9704 int liquidType = -1;
9706 if (impactSpeed > 0.0)
9707 {
9709 #ifndef SERVER
9711 #else
9713 SetSynchDirty();
9714 #endif
9716 }
9717 }
9718
9719 #ifdef SERVER
9720 if (GetCompEM() && GetCompEM().IsPlugged())
9721 {
9722 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9723 GetCompEM().UnplugThis();
9724 }
9725 #endif
9726 }
9727
9729
9731 {
9733 }
9734
9736 {
9737
9738 }
9739
9741 {
9742 super.OnItemLocationChanged(old_owner, new_owner);
9743
9744 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9745 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9746
9747 if (!relatedPlayer && playerNew)
9748 relatedPlayer = playerNew;
9749
9750 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9751 {
9753 if (actionMgr)
9754 {
9755 ActionBase currentAction = actionMgr.GetRunningAction();
9756 if (currentAction)
9758 }
9759 }
9760
9761 Man ownerPlayerOld = null;
9762 Man ownerPlayerNew = null;
9763
9764 if (old_owner)
9765 {
9766 if (old_owner.
IsMan())
9767 {
9768 ownerPlayerOld = Man.Cast(old_owner);
9769 }
9770 else
9771 {
9772 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9773 }
9774 }
9775 else
9776 {
9778 {
9780
9781 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9782 {
9783 GetCompEM().UnplugThis();
9784 }
9785 }
9786 }
9787
9788 if (new_owner)
9789 {
9790 if (new_owner.
IsMan())
9791 {
9792 ownerPlayerNew = Man.Cast(new_owner);
9793 }
9794 else
9795 {
9796 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9797 }
9798 }
9799
9800 if (ownerPlayerOld != ownerPlayerNew)
9801 {
9802 if (ownerPlayerOld)
9803 {
9804 array<EntityAI> subItemsExit = new array<EntityAI>;
9806 for (int i = 0; i < subItemsExit.Count(); i++)
9807 {
9810 }
9811 }
9812
9813 if (ownerPlayerNew)
9814 {
9815 array<EntityAI> subItemsEnter = new array<EntityAI>;
9817 for (int j = 0; j < subItemsEnter.Count(); j++)
9818 {
9821 }
9822 }
9823 }
9824 else if (ownerPlayerNew != null)
9825 {
9826 PlayerBase nplayer;
9827 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9828 {
9829 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9831 for (int k = 0; k < subItemsUpdate.Count(); k++)
9832 {
9834 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9835 }
9836 }
9837 }
9838
9839 if (old_owner)
9840 old_owner.OnChildItemRemoved(this);
9841 if (new_owner)
9842 new_owner.OnChildItemReceived(this);
9843 }
9844
9845
9847 {
9848 super.EEDelete(parent);
9849 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9850 if (player)
9851 {
9853
9854 if (player.IsAlive())
9855 {
9856 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9857 if (r_index >= 0)
9858 {
9859 InventoryLocation r_il = new InventoryLocation;
9860 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9861
9862 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9865 {
9866 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9867 }
9869 {
9870 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9871 }
9872
9873 }
9874
9875 player.RemoveQuickBarEntityShortcut(this);
9876 }
9877 }
9878 }
9879
9881 {
9882 super.EEKilled(killer);
9883
9886 {
9887 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9888 {
9889 if (IsMagazine())
9890 {
9891 if (Magazine.Cast(this).GetAmmoCount() > 0)
9892 {
9894 }
9895 }
9896 else
9897 {
9899 }
9900 }
9901 }
9902 }
9903
9905 {
9906 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9907
9908 super.OnWasAttached(parent, slot_id);
9909
9912
9914 }
9915
9917 {
9918 super.OnWasDetached(parent, slot_id);
9919
9922 }
9923
9925 {
9926 int idx;
9929
9930 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9931 if (inventory_slots.Count() < 1)
9932 {
9933 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9934 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9935 }
9936 else
9937 {
9938 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9939 }
9940
9941 idx = inventory_slots.Find(slot);
9942 if (idx < 0)
9943 return "";
9944
9945 return attach_types.Get(idx);
9946 }
9947
9949 {
9950 int idx = -1;
9951 string slot;
9952
9955
9956 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9957 if (inventory_slots.Count() < 1)
9958 {
9959 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9960 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9961 }
9962 else
9963 {
9964 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9965 if (detach_types.Count() < 1)
9966 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9967 }
9968
9969 for (int i = 0; i < inventory_slots.Count(); i++)
9970 {
9971 slot = inventory_slots.Get(i);
9972 }
9973
9974 if (slot != "")
9975 {
9976 if (detach_types.Count() == 1)
9977 idx = 0;
9978 else
9979 idx = inventory_slots.Find(slot);
9980 }
9981 if (idx < 0)
9982 return "";
9983
9984 return detach_types.Get(idx);
9985 }
9986
9988 {
9989
9991
9992
9993 float min_time = 1;
9994 float max_time = 3;
9995 float delay = Math.RandomFloat(min_time, max_time);
9996
9997 explode_timer.Run(delay, this, "DoAmmoExplosion");
9998 }
9999
10001 {
10002 Magazine magazine = Magazine.Cast(this);
10003 int pop_sounds_count = 6;
10004 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10005
10006
10007 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10008 string sound_name = pop_sounds[ sound_idx ];
10010
10011
10012 magazine.ServerAddAmmoCount(-1);
10013
10014
10015 float min_temp_to_explode = 100;
10016
10017 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10018 {
10020 }
10021 }
10022
10023
10024 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10025 {
10026 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10027
10028 const int CHANCE_DAMAGE_CARGO = 4;
10029 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10030 const int CHANCE_DAMAGE_NOTHING = 2;
10031
10033 {
10034 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10035 int chances;
10036 int rnd;
10037
10038 if (GetInventory().GetCargo())
10039 {
10040 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10041 rnd = Math.RandomInt(0,chances);
10042
10043 if (rnd < CHANCE_DAMAGE_CARGO)
10044 {
10046 }
10047 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10048 {
10050 }
10051 }
10052 else
10053 {
10054 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10055 rnd = Math.RandomInt(0,chances);
10056
10057 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10058 {
10060 }
10061 }
10062 }
10063 }
10064
10066 {
10067 if (GetInventory().GetCargo())
10068 {
10069 int item_count = GetInventory().GetCargo().GetItemCount();
10070 if (item_count > 0)
10071 {
10072 int random_pick = Math.RandomInt(0, item_count);
10074 if (!item.IsExplosive())
10075 {
10076 item.AddHealth("","",damage);
10077 return true;
10078 }
10079 }
10080 }
10081 return false;
10082 }
10083
10085 {
10086 int attachment_count = GetInventory().AttachmentCount();
10087 if (attachment_count > 0)
10088 {
10089 int random_pick = Math.RandomInt(0, attachment_count);
10090 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10091 if (!attachment.IsExplosive())
10092 {
10093 attachment.AddHealth("","",damage);
10094 return true;
10095 }
10096 }
10097 return false;
10098 }
10099
10101 {
10103 }
10104
10106 {
10108 return GetInventory().CanRemoveEntity();
10109
10110 return false;
10111 }
10112
10114 {
10115
10117 return false;
10118
10119
10121 return false;
10122
10123
10124
10126 if (delta == 0)
10127 return false;
10128
10129
10130 return true;
10131 }
10132
10134 {
10136 {
10137 if (ScriptInputUserData.CanStoreInputUserData())
10138 {
10139 ScriptInputUserData ctx = new ScriptInputUserData;
10144 ctx.
Write(destination_entity);
10146 ctx.
Write(slot_id);
10148 }
10149 }
10150 else if (!
GetGame().IsMultiplayer())
10151 {
10153 }
10154 }
10155
10157 {
10158 float split_quantity_new;
10162 InventoryLocation loc = new InventoryLocation;
10163
10164 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10165 {
10167 split_quantity_new = stack_max;
10168 else
10170
10172 {
10173 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10174 if (new_item)
10175 {
10176 new_item.SetResultOfSplit(true);
10177 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10179 new_item.
SetQuantity(split_quantity_new,
false,
true);
10180 }
10181 }
10182 }
10183 else if (destination_entity && slot_id == -1)
10184 {
10185 if (quantity > stack_max)
10186 split_quantity_new = stack_max;
10187 else
10188 split_quantity_new = quantity;
10189
10191 {
10193 {
10196 }
10197
10198 if (new_item)
10199 {
10200 new_item.SetResultOfSplit(true);
10201 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10203 new_item.
SetQuantity(split_quantity_new,
false,
true);
10204 }
10205 }
10206 }
10207 else
10208 {
10209 if (stack_max != 0)
10210 {
10212 {
10214 }
10215
10216 if (split_quantity_new == 0)
10217 {
10218 if (!
GetGame().IsMultiplayer())
10219 player.PhysicalPredictiveDropItem(this);
10220 else
10221 player.ServerDropEntity(this);
10222 return;
10223 }
10224
10226 {
10228
10229 if (new_item)
10230 {
10231 new_item.SetResultOfSplit(true);
10232 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10235 new_item.PlaceOnSurface();
10236 }
10237 }
10238 }
10239 }
10240 }
10241
10243 {
10244 float split_quantity_new;
10248 InventoryLocation loc = new InventoryLocation;
10249
10250 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10251 {
10253 split_quantity_new = stack_max;
10254 else
10256
10258 {
10259 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10260 if (new_item)
10261 {
10262 new_item.SetResultOfSplit(true);
10263 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10265 new_item.
SetQuantity(split_quantity_new,
false,
true);
10266 }
10267 }
10268 }
10269 else if (destination_entity && slot_id == -1)
10270 {
10271 if (quantity > stack_max)
10272 split_quantity_new = stack_max;
10273 else
10274 split_quantity_new = quantity;
10275
10277 {
10279 {
10282 }
10283
10284 if (new_item)
10285 {
10286 new_item.SetResultOfSplit(true);
10287 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10289 new_item.
SetQuantity(split_quantity_new,
false,
true);
10290 }
10291 }
10292 }
10293 else
10294 {
10295 if (stack_max != 0)
10296 {
10298 {
10300 }
10301
10303 {
10305
10306 if (new_item)
10307 {
10308 new_item.SetResultOfSplit(true);
10309 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10312 new_item.PlaceOnSurface();
10313 }
10314 }
10315 }
10316 }
10317 }
10318
10320 {
10322 {
10323 if (ScriptInputUserData.CanStoreInputUserData())
10324 {
10325 ScriptInputUserData ctx = new ScriptInputUserData;
10330 dst.WriteToContext(ctx);
10332 }
10333 }
10334 else if (!
GetGame().IsMultiplayer())
10335 {
10337 }
10338 }
10339
10341 {
10343 {
10344 if (ScriptInputUserData.CanStoreInputUserData())
10345 {
10346 ScriptInputUserData ctx = new ScriptInputUserData;
10351 ctx.
Write(destination_entity);
10357 }
10358 }
10359 else if (!
GetGame().IsMultiplayer())
10360 {
10362 }
10363 }
10364
10366 {
10368 }
10369
10371 {
10373 float split_quantity_new;
10375 if (dst.IsValid())
10376 {
10377 int slot_id = dst.GetSlot();
10379
10380 if (quantity > stack_max)
10381 split_quantity_new = stack_max;
10382 else
10383 split_quantity_new = quantity;
10384
10386 {
10388
10389 if (new_item)
10390 {
10391 new_item.SetResultOfSplit(true);
10392 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10394 new_item.
SetQuantity(split_quantity_new,
false,
true);
10395 }
10396
10397 return new_item;
10398 }
10399 }
10400
10401 return null;
10402 }
10403
10405 {
10407 float split_quantity_new;
10409 if (destination_entity)
10410 {
10412 if (quantity > stackable)
10413 split_quantity_new = stackable;
10414 else
10415 split_quantity_new = quantity;
10416
10418 {
10419 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10420 if (new_item)
10421 {
10422 new_item.SetResultOfSplit(true);
10423 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10425 new_item.
SetQuantity(split_quantity_new,
false,
true);
10426 }
10427 }
10428 }
10429 }
10430
10432 {
10434 {
10435 if (ScriptInputUserData.CanStoreInputUserData())
10436 {
10437 ScriptInputUserData ctx = new ScriptInputUserData;
10442 ItemBase destination_entity =
this;
10443 ctx.
Write(destination_entity);
10447 }
10448 }
10449 else if (!
GetGame().IsMultiplayer())
10450 {
10452 }
10453 }
10454
10456 {
10458 float split_quantity_new;
10460 if (player)
10461 {
10463 if (quantity > stackable)
10464 split_quantity_new = stackable;
10465 else
10466 split_quantity_new = quantity;
10467
10469 {
10470 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10471 new_item =
ItemBase.Cast(in_hands);
10472 if (new_item)
10473 {
10474 new_item.SetResultOfSplit(true);
10475 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10477 new_item.SetQuantity(split_quantity_new, false, true);
10478 }
10479 }
10480 }
10481 }
10482
10484 {
10486 float split_quantity_new = Math.Floor(quantity * 0.5);
10487
10489 return;
10490
10492
10493 if (new_item)
10494 {
10495 if (new_item.GetQuantityMax() < split_quantity_new)
10496 {
10497 split_quantity_new = new_item.GetQuantityMax();
10498 }
10499
10500 new_item.SetResultOfSplit(true);
10501 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10502
10504 {
10507 }
10508 else
10509 {
10511 new_item.
SetQuantity(split_quantity_new,
false,
true);
10512 }
10513 }
10514 }
10515
10517 {
10519 float split_quantity_new = Math.Floor(quantity / 2);
10520
10522 return;
10523
10524 InventoryLocation invloc = new InventoryLocation;
10526
10528 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10529
10530 if (new_item)
10531 {
10532 if (new_item.GetQuantityMax() < split_quantity_new)
10533 {
10534 split_quantity_new = new_item.GetQuantityMax();
10535 }
10537 {
10540 }
10541 else if (split_quantity_new > 1)
10542 {
10544 new_item.
SetQuantity(split_quantity_new,
false,
true);
10545 }
10546 }
10547 }
10548
10551 {
10552 SetWeightDirty();
10554
10555 if (parent)
10556 parent.OnAttachmentQuantityChangedEx(this, delta);
10557
10559 {
10561 {
10563 }
10565 {
10566 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10568 }
10569 }
10570
10571 }
10572
10575 {
10576
10577 }
10578
10581 {
10583 }
10584
10586 {
10587 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10588
10590 {
10591 if (newLevel == GameConstants.STATE_RUINED)
10592 {
10594 EntityAI parent = GetHierarchyParent();
10595 if (parent && parent.IsFireplace())
10596 {
10597 CargoBase cargo = GetInventory().GetCargo();
10598 if (cargo)
10599 {
10601 {
10603 }
10604 }
10605 }
10606 }
10607
10609 {
10610
10612 return;
10613 }
10614
10615 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10616 {
10618 }
10619 }
10620 }
10621
10622
10624 {
10625 super.OnRightClick();
10626
10628 {
10630 {
10631 if (ScriptInputUserData.CanStoreInputUserData())
10632 {
10633 EntityAI root = GetHierarchyRoot();
10634 Man playerOwner = GetHierarchyRootPlayer();
10635 InventoryLocation dst = new InventoryLocation;
10636
10637
10638 if (!playerOwner && root && root == this)
10639 {
10641 }
10642 else
10643 {
10644
10645 GetInventory().GetCurrentInventoryLocation(dst);
10647 {
10650 {
10652 }
10653 else
10654 {
10656
10657
10658 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10659 {
10661 }
10662 else
10663 {
10664 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10665 }
10666 }
10667 }
10668 }
10669
10670 ScriptInputUserData ctx = new ScriptInputUserData;
10678 }
10679 }
10680 else if (!
GetGame().IsMultiplayer())
10681 {
10683 }
10684 }
10685 }
10686
10688 {
10689 if (root)
10690 {
10691 vector m4[4];
10692 root.GetTransform(m4);
10693 dst.SetGround(this, m4);
10694 }
10695 else
10696 {
10697 GetInventory().GetCurrentInventoryLocation(dst);
10698 }
10699 }
10700
10701 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10702 {
10703
10704 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10705 return false;
10706
10707 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10708 return false;
10709
10710
10712 return false;
10713
10714
10715 Magazine mag = Magazine.Cast(this);
10716 if (mag)
10717 {
10718 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10719 return false;
10720
10721 if (stack_max_limit)
10722 {
10723 Magazine other_mag = Magazine.Cast(other_item);
10724 if (other_item)
10725 {
10726 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10727 return false;
10728 }
10729
10730 }
10731 }
10732 else
10733 {
10734
10736 return false;
10737
10739 return false;
10740 }
10741
10742 PlayerBase player = null;
10743 if (CastTo(player, GetHierarchyRootPlayer()))
10744 {
10745 if (player.GetInventory().HasAttachment(this))
10746 return false;
10747
10748 if (player.IsItemsToDelete())
10749 return false;
10750 }
10751
10752 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10753 return false;
10754
10755 int slotID;
10757 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10758 return false;
10759
10760 return true;
10761 }
10762
10764 {
10766 }
10767
10769 {
10770 return m_IsResultOfSplit;
10771 }
10772
10774 {
10775 m_IsResultOfSplit = value;
10776 }
10777
10779 {
10781 }
10782
10784 {
10785 float other_item_quantity = other_item.GetQuantity();
10786 float this_free_space;
10787
10789
10791
10792 if (other_item_quantity > this_free_space)
10793 {
10794 return this_free_space;
10795 }
10796 else
10797 {
10798 return other_item_quantity;
10799 }
10800 }
10801
10803 {
10805 }
10806
10808 {
10810 return;
10811
10812 if (!IsMagazine() && other_item)
10813 {
10815 if (quantity_used != 0)
10816 {
10817 float hp1 = GetHealth01("","");
10818 float hp2 = other_item.GetHealth01("","");
10819 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10820 hpResult = hpResult / (
GetQuantity() + quantity_used);
10821
10822 hpResult *= GetMaxHealth();
10823 Math.Round(hpResult);
10824 SetHealth("", "Health", hpResult);
10825
10827 other_item.AddQuantity(-quantity_used);
10828 }
10829 }
10831 }
10832
10834 {
10835 #ifdef SERVER
10836 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10837 GetHierarchyParent().IncreaseLifetimeUp();
10838 #endif
10839 };
10840
10842 {
10843 PlayerBase p = PlayerBase.Cast(player);
10844
10845 array<int> recipesIds = p.m_Recipes;
10846 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10847 if (moduleRecipesManager)
10848 {
10849 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10850 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10851 }
10852
10853 for (int i = 0;i < recipesIds.Count(); i++)
10854 {
10855 int key = recipesIds.Get(i);
10856 string recipeName = moduleRecipesManager.GetRecipeName(key);
10858 }
10859 }
10860
10861
10862 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10863 {
10864 super.GetDebugActions(outputList);
10865
10866
10872
10873
10878
10883
10884
10888
10889
10891 {
10895 }
10896
10899
10900
10904
10906
10907 InventoryLocation loc = new InventoryLocation();
10908 GetInventory().GetCurrentInventoryLocation(loc);
10910 {
10911 if (Gizmo_IsSupported())
10914 }
10915
10917 }
10918
10919
10920
10921
10923 {
10924 super.OnAction(action_id, player, ctx);
10925
10927 {
10928 switch (action_id)
10929 {
10932 return true;
10935 return true;
10936 }
10937 }
10938
10940 {
10941 switch (action_id)
10942 {
10944 Delete();
10945 return true;
10946 }
10947 }
10948
10949 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10950 {
10951 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10952 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10953 PlayerBase p = PlayerBase.Cast(player);
10954 if (
EActions.RECIPES_RANGE_START < 1000)
10955 {
10956 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10957 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10958 }
10959 }
10960 #ifndef SERVER
10961 else if (action_id ==
EActions.WATCH_PLAYER)
10962 {
10963 PluginDeveloper.SetDeveloperItemClientEx(player);
10964 }
10965 #endif
10967 {
10968 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10969 {
10970 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10971 OnDebugButtonPressServer(id + 1);
10972 }
10973
10974 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10975 {
10976 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10978 }
10979
10980 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10981 {
10982 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10984 }
10985
10986 else if (action_id ==
EActions.ADD_QUANTITY)
10987 {
10988 if (IsMagazine())
10989 {
10990 Magazine mag = Magazine.Cast(this);
10991 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10992 }
10993 else
10994 {
10996 }
10997
10998 if (m_EM)
10999 {
11000 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11001 }
11002
11003 }
11004
11005 else if (action_id ==
EActions.REMOVE_QUANTITY)
11006 {
11007 if (IsMagazine())
11008 {
11009 Magazine mag2 = Magazine.Cast(this);
11010 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11011 }
11012 else
11013 {
11015 }
11016 if (m_EM)
11017 {
11018 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11019 }
11020
11021 }
11022
11023 else if (action_id ==
EActions.SET_QUANTITY_0)
11024 {
11026
11027 if (m_EM)
11028 {
11029 m_EM.SetEnergy(0);
11030 }
11031 }
11032
11033 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11034 {
11036
11037 if (m_EM)
11038 {
11039 m_EM.SetEnergy(m_EM.GetEnergyMax());
11040 }
11041 }
11042
11043 else if (action_id ==
EActions.ADD_HEALTH)
11044 {
11045 AddHealth("","",GetMaxHealth("","Health")/5);
11046 }
11047 else if (action_id ==
EActions.REMOVE_HEALTH)
11048 {
11049 AddHealth("","",-GetMaxHealth("","Health")/5);
11050 }
11051 else if (action_id ==
EActions.DESTROY_HEALTH)
11052 {
11053 SetHealth01("","",0);
11054 }
11055 else if (action_id ==
EActions.WATCH_ITEM)
11056 {
11058 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11059 #ifdef DEVELOPER
11060 SetDebugDeveloper_item(this);
11061 #endif
11062 }
11063
11064 else if (action_id ==
EActions.ADD_TEMPERATURE)
11065 {
11066 AddTemperature(20);
11067
11068 }
11069
11070 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11071 {
11072 AddTemperature(-20);
11073
11074 }
11075
11076 else if (action_id ==
EActions.FLIP_FROZEN)
11077 {
11078 SetFrozen(!GetIsFrozen());
11079
11080 }
11081
11082 else if (action_id ==
EActions.ADD_WETNESS)
11083 {
11085
11086 }
11087
11088 else if (action_id ==
EActions.REMOVE_WETNESS)
11089 {
11091
11092 }
11093
11094 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11095 {
11098
11099
11100 }
11101
11102 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11103 {
11106 }
11107
11108 else if (action_id ==
EActions.MAKE_SPECIAL)
11109 {
11110 auto debugParams = DebugSpawnParams.WithPlayer(player);
11111 OnDebugSpawnEx(debugParams);
11112 }
11113
11114 }
11115
11116
11117 return false;
11118 }
11119
11120
11121
11122
11126
11129
11130
11131
11133 {
11134 return false;
11135 }
11136
11137
11139 {
11140 return true;
11141 }
11142
11143
11145 {
11146 return true;
11147 }
11148
11149
11150
11152 {
11153 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11155 }
11156
11159 {
11160 return null;
11161 }
11162
11164 {
11165 return false;
11166 }
11167
11169 {
11170 return false;
11171 }
11172
11176
11177
11179 {
11180 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11181 return module_repairing.CanRepair(this, item_repair_kit);
11182 }
11183
11184
11185 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11186 {
11187 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11188 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11189 }
11190
11191
11193 {
11194
11195
11196
11197
11198
11199
11200
11201
11202 return 1;
11203 }
11204
11205
11206
11208 {
11210 }
11211
11212
11213
11215 {
11217 }
11218
11219
11228 {
11229 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11230
11231 if (player)
11232 {
11233 player.MessageStatus(text);
11234 }
11235 }
11236
11237
11246 {
11247 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11248
11249 if (player)
11250 {
11251 player.MessageAction(text);
11252 }
11253 }
11254
11255
11264 {
11265 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11266
11267 if (player)
11268 {
11269 player.MessageFriendly(text);
11270 }
11271 }
11272
11273
11282 {
11283 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11284
11285 if (player)
11286 {
11287 player.MessageImportant(text);
11288 }
11289 }
11290
11292 {
11293 return true;
11294 }
11295
11296
11297 override bool KindOf(
string tag)
11298 {
11299 bool found = false;
11300 string item_name = this.
GetType();
11303
11304 int array_size = item_tag_array.Count();
11305 for (int i = 0; i < array_size; i++)
11306 {
11307 if (item_tag_array.Get(i) == tag)
11308 {
11309 found = true;
11310 break;
11311 }
11312 }
11313 return found;
11314 }
11315
11316
11318 {
11319
11320 super.OnRPC(sender, rpc_type,ctx);
11321
11322
11323 switch (rpc_type)
11324 {
11325 #ifndef SERVER
11326 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11327 Param2<bool, string> p = new Param2<bool, string>(false, "");
11328
11330 return;
11331
11332 bool play = p.param1;
11333 string soundSet = p.param2;
11334
11335 if (play)
11336 {
11338 {
11340 {
11342 }
11343 }
11344 else
11345 {
11347 }
11348 }
11349 else
11350 {
11352 }
11353
11354 break;
11355 #endif
11356
11357 }
11358
11360 {
11362 }
11363 }
11364
11365
11366
11367
11369 {
11370 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11371 return plugin.GetID(
name);
11372 }
11373
11375 {
11376 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11377 return plugin.GetName(id);
11378 }
11379
11382 {
11383
11384
11385 int varFlags;
11386 if (!ctx.
Read(varFlags))
11387 return;
11388
11389 if (varFlags & ItemVariableFlags.FLOAT)
11390 {
11392 }
11393 }
11394
11396 {
11397
11398 super.SerializeNumericalVars(floats_out);
11399
11400
11401
11403 {
11405 }
11406
11408 {
11410 }
11411
11413 {
11415 }
11416
11418 {
11423 }
11424
11426 {
11428 }
11429 }
11430
11432 {
11433
11434 super.DeSerializeNumericalVars(floats);
11435
11436
11437 int index = 0;
11438 int mask = Math.Round(floats.Get(index));
11439
11440 index++;
11441
11443 {
11445 {
11447 }
11448 else
11449 {
11450 float quantity = floats.Get(index);
11451 SetQuantity(quantity,
true,
false,
false,
false);
11452 }
11453 index++;
11454 }
11455
11457 {
11458 float wet = floats.Get(index);
11460 index++;
11461 }
11462
11464 {
11465 int liquidtype = Math.Round(floats.Get(index));
11467 index++;
11468 }
11469
11471 {
11473 index++;
11475 index++;
11477 index++;
11479 index++;
11480 }
11481
11483 {
11484 int cleanness = Math.Round(floats.Get(index));
11486 index++;
11487 }
11488 }
11489
11491 {
11492 super.WriteVarsToCTX(ctx);
11493
11494
11496 {
11498 }
11499
11501 {
11503 }
11504
11506 {
11508 }
11509
11511 {
11512 int r,g,b,a;
11518 }
11519
11521 {
11523 }
11524 }
11525
11527 {
11528 if (!super.ReadVarsFromCTX(ctx,version))
11529 return false;
11530
11531 int intValue;
11532 float value;
11533
11534 if (version < 140)
11535 {
11536 if (!ctx.
Read(intValue))
11537 return false;
11538
11539 m_VariablesMask = intValue;
11540 }
11541
11543 {
11544 if (!ctx.
Read(value))
11545 return false;
11546
11548 {
11550 }
11551 else
11552 {
11554 }
11555 }
11556
11557 if (version < 140)
11558 {
11560 {
11561 if (!ctx.
Read(value))
11562 return false;
11563 SetTemperatureDirect(value);
11564 }
11565 }
11566
11568 {
11569 if (!ctx.
Read(value))
11570 return false;
11572 }
11573
11575 {
11576 if (!ctx.
Read(intValue))
11577 return false;
11579 }
11580
11582 {
11583 int r,g,b,a;
11585 return false;
11587 return false;
11589 return false;
11591 return false;
11592
11594 }
11595
11597 {
11598 if (!ctx.
Read(intValue))
11599 return false;
11601 }
11602
11603 if (version >= 138 && version < 140)
11604 {
11606 {
11607 if (!ctx.
Read(intValue))
11608 return false;
11609 SetFrozen(intValue);
11610 }
11611 }
11612
11613 return true;
11614 }
11615
11616
11618 {
11621 {
11623 }
11624
11625 if (!super.OnStoreLoad(ctx, version))
11626 {
11628 return false;
11629 }
11630
11631 if (version >= 114)
11632 {
11633 bool hasQuickBarIndexSaved;
11634
11635 if (!ctx.
Read(hasQuickBarIndexSaved))
11636 {
11638 return false;
11639 }
11640
11641 if (hasQuickBarIndexSaved)
11642 {
11643 int itmQBIndex;
11644
11645
11646 if (!ctx.
Read(itmQBIndex))
11647 {
11649 return false;
11650 }
11651
11652 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11653 if (itmQBIndex != -1 && parentPlayer)
11654 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11655 }
11656 }
11657 else
11658 {
11659
11660 PlayerBase player;
11661 int itemQBIndex;
11662 if (version ==
int.
MAX)
11663 {
11664 if (!ctx.
Read(itemQBIndex))
11665 {
11667 return false;
11668 }
11669 }
11670 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11671 {
11672
11673 if (!ctx.
Read(itemQBIndex))
11674 {
11676 return false;
11677 }
11678 if (itemQBIndex != -1 && player)
11679 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11680 }
11681 }
11682
11683 if (version < 140)
11684 {
11685
11686 if (!LoadVariables(ctx, version))
11687 {
11689 return false;
11690 }
11691 }
11692
11693
11695 {
11697 return false;
11698 }
11699 if (version >= 132)
11700 {
11702 if (raib)
11703 {
11705 {
11707 return false;
11708 }
11709 }
11710 }
11711
11713 return true;
11714 }
11715
11716
11717
11719 {
11720 super.OnStoreSave(ctx);
11721
11722 PlayerBase player;
11723 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11724 {
11726
11727 int itemQBIndex = -1;
11728 itemQBIndex = player.FindQuickBarEntityIndex(this);
11729 ctx.
Write(itemQBIndex);
11730 }
11731 else
11732 {
11734 }
11735
11737
11739 if (raib)
11740 {
11742 }
11743 }
11744
11745
11747 {
11748 super.AfterStoreLoad();
11749
11751 {
11753 }
11754
11756 {
11759 }
11760 }
11761
11763 {
11764 super.EEOnAfterLoad();
11765
11767 {
11769 }
11770
11773 }
11774
11776 {
11777 return false;
11778 }
11779
11780
11781
11783 {
11785 {
11786 #ifdef PLATFORM_CONSOLE
11787
11789 {
11791 if (menu)
11792 {
11794 }
11795 }
11796 #endif
11797 }
11798
11800 {
11803 }
11804
11806 {
11807 SetWeightDirty();
11809 }
11811 {
11814 }
11815
11817 {
11820 }
11822 {
11825 }
11826
11827 super.OnVariablesSynchronized();
11828 }
11829
11830
11831
11833 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11834 {
11835 if (!IsServerCheck(allow_client))
11836 return false;
11837
11839 return false;
11840
11843
11844 if (value <= (min + 0.001))
11845 value = min;
11846
11847 if (value == min)
11848 {
11849 if (destroy_config)
11850 {
11851 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11852 if (dstr)
11853 {
11855 this.Delete();
11856 return true;
11857 }
11858 }
11859 else if (destroy_forced)
11860 {
11862 this.Delete();
11863 return true;
11864 }
11865
11867 }
11868
11871
11873 {
11875
11876 if (delta)
11878 }
11879
11881
11882 return false;
11883 }
11884
11885
11887 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11888 {
11890 }
11891
11893 {
11896 }
11897
11899 {
11902 }
11903
11905 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11906 {
11907 float value_clamped = Math.Clamp(value, 0, 1);
11909 SetQuantity(result, destroy_config, destroy_forced);
11910 }
11911
11912
11915 {
11917 }
11918
11920 {
11922 }
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11934 {
11935 int slot = -1;
11936 if (GetInventory())
11937 {
11938 InventoryLocation il = new InventoryLocation;
11939 GetInventory().GetCurrentInventoryLocation(il);
11941 }
11942
11944 }
11945
11947 {
11948 float quantity_max = 0;
11949
11951 {
11952 if (attSlotID != -1)
11953 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11954
11955 if (quantity_max <= 0)
11957 }
11958
11959 if (quantity_max <= 0)
11961
11962 return quantity_max;
11963 }
11964
11966 {
11968 }
11969
11971 {
11973 }
11974
11975
11977 {
11979 }
11980
11982 {
11984 }
11985
11987 {
11989 }
11990
11991
11993 {
11994
11995 float weightEx = GetWeightEx();
11996 float special = GetInventoryAndCargoWeight();
11997 return weightEx - special;
11998 }
11999
12000
12002 {
12004 }
12005
12007 {
12009 {
12010 #ifdef DEVELOPER
12011 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12012 {
12013 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12015 }
12016 #endif
12017
12018 return GetQuantity() * GetConfigWeightModified();
12019 }
12020 else if (HasEnergyManager())
12021 {
12022 #ifdef DEVELOPER
12023 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12024 {
12025 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12026 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12027 }
12028 #endif
12029 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12030 }
12031 else
12032 {
12033 #ifdef DEVELOPER
12034 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12035 {
12036 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12037 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12038 }
12039 #endif
12040 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12041 }
12042 }
12043
12046 {
12047 int item_count = 0;
12049
12050 if (GetInventory().GetCargo() != NULL)
12051 {
12052 item_count = GetInventory().GetCargo().GetItemCount();
12053 }
12054
12055 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12056 {
12057 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12058 if (item)
12059 item_count += item.GetNumberOfItems();
12060 }
12061 return item_count;
12062 }
12063
12066 {
12067 float weight = 0;
12068 float wetness = 1;
12069 if (include_wetness)
12072 {
12073 weight = wetness * m_ConfigWeight;
12074 }
12076 {
12077 weight = 1;
12078 }
12079 return weight;
12080 }
12081
12082
12083
12085 {
12086 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12087 {
12088 GameInventory inv = GetInventory();
12089 array<EntityAI> items = new array<EntityAI>;
12091 for (int i = 0; i < items.Count(); i++)
12092 {
12094 if (item)
12095 {
12097 }
12098 }
12099 }
12100 }
12101
12102
12103
12104
12106 {
12107 float energy = 0;
12108 if (HasEnergyManager())
12109 {
12110 energy = GetCompEM().GetEnergy();
12111 }
12112 return energy;
12113 }
12114
12115
12117 {
12118 super.OnEnergyConsumed();
12119
12121 }
12122
12124 {
12125 super.OnEnergyAdded();
12126
12128 }
12129
12130
12132 {
12133 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12134 {
12136 {
12137 float energy_0to1 = GetCompEM().GetEnergy0To1();
12139 }
12140 }
12141 }
12142
12143
12145 {
12146 return ConfigGetFloat("heatIsolation");
12147 }
12148
12150 {
12152 }
12153
12155 {
12156 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12157 if (
GetGame().ConfigIsExisting(paramPath))
12159
12160 return 0.0;
12161 }
12162
12164 {
12165 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12166 if (
GetGame().ConfigIsExisting(paramPath))
12168
12169 return 0.0;
12170 }
12171
12172 override void SetWet(
float value,
bool allow_client =
false)
12173 {
12174 if (!IsServerCheck(allow_client))
12175 return;
12176
12179
12181
12182 m_VarWet = Math.Clamp(value, min, max);
12183
12185 {
12188 }
12189 }
12190
12191 override void AddWet(
float value)
12192 {
12194 }
12195
12197 {
12199 }
12200
12202 {
12204 }
12205
12207 {
12209 }
12210
12212 {
12214 }
12215
12217 {
12219 }
12220
12221 override void OnWetChanged(
float newVal,
float oldVal)
12222 {
12225 if (newLevel != oldLevel)
12226 {
12228 }
12229 }
12230
12232 {
12233 SetWeightDirty();
12234 }
12235
12237 {
12238 return GetWetLevelInternal(
m_VarWet);
12239 }
12240
12241
12242
12244 {
12246 }
12247
12249 {
12251 }
12252
12254 {
12256 }
12257
12259 {
12261 }
12262
12263
12264
12266 {
12267 if (ConfigIsExisting("itemModelLength"))
12268 {
12269 return ConfigGetFloat("itemModelLength");
12270 }
12271 return 0;
12272 }
12273
12275 {
12276 if (ConfigIsExisting("itemAttachOffset"))
12277 {
12278 return ConfigGetFloat("itemAttachOffset");
12279 }
12280 return 0;
12281 }
12282
12283 override void SetCleanness(
int value,
bool allow_client =
false)
12284 {
12285 if (!IsServerCheck(allow_client))
12286 return;
12287
12289
12291
12294 }
12295
12297 {
12299 }
12300
12302 {
12303 return true;
12304 }
12305
12306
12307
12308
12310 {
12312 }
12313
12315 {
12317 }
12318
12319
12320
12321
12322 override void SetColor(
int r,
int g,
int b,
int a)
12323 {
12329 }
12331 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12332 {
12337 }
12338
12340 {
12342 }
12343
12346 {
12347 int r,g,b,a;
12349 r = r/255;
12350 g = g/255;
12351 b = b/255;
12352 a = a/255;
12353 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12354 }
12355
12356
12357
12358 override void SetLiquidType(
int value,
bool allow_client =
false)
12359 {
12360 if (!IsServerCheck(allow_client))
12361 return;
12362
12367 }
12368
12370 {
12371 return ConfigGetInt("varLiquidTypeInit");
12372 }
12373
12375 {
12377 }
12378
12380 {
12382 SetFrozen(false);
12383 }
12384
12387 {
12388 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12389 }
12390
12391
12394 {
12395 PlayerBase nplayer;
12396 if (PlayerBase.CastTo(nplayer, player))
12397 {
12399
12400 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12401 }
12402 }
12403
12404
12407 {
12408 PlayerBase nplayer;
12409 if (PlayerBase.CastTo(nplayer,player))
12410 {
12411
12412 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12413
12414 }
12415
12416
12417 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12418
12419
12420 if (HasEnergyManager())
12421 {
12422 GetCompEM().UpdatePlugState();
12423 }
12424 }
12425
12426
12428 {
12429 super.OnPlacementStarted(player);
12430
12432 }
12433
12434 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12435 {
12437 {
12438 m_AdminLog.OnPlacementComplete(player,
this);
12439 }
12440
12441 super.OnPlacementComplete(player, position, orientation);
12442 }
12443
12444
12445
12446
12447
12449 {
12451 {
12452 return true;
12453 }
12454 else
12455 {
12456 return false;
12457 }
12458 }
12459
12460
12462 {
12464 {
12466 }
12467 }
12468
12469
12471 {
12473 }
12474
12476 {
12478 }
12479
12480 override void InsertAgent(
int agent,
float count = 1)
12481 {
12482 if (count < 1)
12483 return;
12484
12486 }
12487
12490 {
12492 }
12493
12494
12496 {
12498 }
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12542 {
12544 return false;
12545 return true;
12546 }
12547
12549 {
12550
12552 }
12553
12554
12557 {
12558 super.CheckForRoofLimited(timeTresholdMS);
12559
12561 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12562 {
12563 m_PreviousRoofTestTime = time;
12564 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12565 }
12566 }
12567
12568
12570 {
12572 {
12573 return 0;
12574 }
12575
12576 if (GetInventory().GetAttachmentSlotsCount() != 0)
12577 {
12578 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12579 if (filter)
12580 return filter.GetProtectionLevel(type, false, system);
12581 else
12582 return 0;
12583 }
12584
12585 string subclassPath, entryName;
12586
12587 switch (type)
12588 {
12590 entryName = "biological";
12591 break;
12593 entryName = "chemical";
12594 break;
12595 default:
12596 entryName = "biological";
12597 break;
12598 }
12599
12600 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12601
12603 }
12604
12605
12606
12609 {
12610 if (!IsMagazine())
12612
12614 }
12615
12616
12617
12618
12619
12624 {
12625 return true;
12626 }
12627
12629 {
12631 }
12632
12633
12634
12635
12636
12638 {
12639 if (parent)
12640 {
12641 if (parent.IsInherited(DayZInfected))
12642 return true;
12643
12644 if (!parent.IsRuined())
12645 return true;
12646 }
12647
12648 return true;
12649 }
12650
12652 {
12653 if (!super.CanPutAsAttachment(parent))
12654 {
12655 return false;
12656 }
12657
12658 if (!IsRuined() && !parent.IsRuined())
12659 {
12660 return true;
12661 }
12662
12663 return false;
12664 }
12665
12667 {
12668
12669
12670
12671
12672 return super.CanReceiveItemIntoCargo(item);
12673 }
12674
12676 {
12677
12678
12679
12680
12681 GameInventory attachmentInv = attachment.GetInventory();
12683 {
12684 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12685 return false;
12686 }
12687
12688 InventoryLocation loc = new InventoryLocation();
12689 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12690 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12691 return false;
12692
12693 return super.CanReceiveAttachment(attachment, slotId);
12694 }
12695
12697 {
12698 if (!super.CanReleaseAttachment(attachment))
12699 return false;
12700
12701 return GetInventory().AreChildrenAccessible();
12702 }
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12725 {
12726 int id = muzzle_owner.GetMuzzleID();
12727 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12728
12729 if (WPOF_array)
12730 {
12731 for (int i = 0; i < WPOF_array.Count(); i++)
12732 {
12733 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12734
12735 if (WPOF)
12736 {
12737 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12738 }
12739 }
12740 }
12741 }
12742
12743
12745 {
12746 int id = muzzle_owner.GetMuzzleID();
12748
12749 if (WPOBE_array)
12750 {
12751 for (int i = 0; i < WPOBE_array.Count(); i++)
12752 {
12753 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12754
12755 if (WPOBE)
12756 {
12757 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12758 }
12759 }
12760 }
12761 }
12762
12763
12765 {
12766 int id = muzzle_owner.GetMuzzleID();
12767 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12768
12769 if (WPOOH_array)
12770 {
12771 for (int i = 0; i < WPOOH_array.Count(); i++)
12772 {
12773 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12774
12775 if (WPOOH)
12776 {
12777 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12778 }
12779 }
12780 }
12781 }
12782
12783
12785 {
12786 int id = muzzle_owner.GetMuzzleID();
12787 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12788
12789 if (WPOOH_array)
12790 {
12791 for (int i = 0; i < WPOOH_array.Count(); i++)
12792 {
12793 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12794
12795 if (WPOOH)
12796 {
12797 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12798 }
12799 }
12800 }
12801 }
12802
12803
12805 {
12806 int id = muzzle_owner.GetMuzzleID();
12807 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12808
12809 if (WPOOH_array)
12810 {
12811 for (int i = 0; i < WPOOH_array.Count(); i++)
12812 {
12813 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12814
12815 if (WPOOH)
12816 {
12817 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12818 }
12819 }
12820 }
12821 }
12822
12823
12824
12826 {
12828 {
12829 return true;
12830 }
12831
12832 return false;
12833 }
12834
12836 {
12838 {
12839 return true;
12840 }
12841
12842 return false;
12843 }
12844
12846 {
12848 {
12849 return true;
12850 }
12851
12852 return false;
12853 }
12854
12856 {
12857 return false;
12858 }
12859
12862 {
12863 return UATimeSpent.DEFAULT_DEPLOY;
12864 }
12865
12866
12867
12868
12870 {
12872 SetSynchDirty();
12873 }
12874
12876 {
12878 }
12879
12880
12882 {
12883 return false;
12884 }
12885
12888 {
12889 string att_type = "None";
12890
12891 if (ConfigIsExisting("soundAttType"))
12892 {
12893 att_type = ConfigGetString("soundAttType");
12894 }
12895
12897 }
12898
12900 {
12902 }
12903
12904
12905
12906
12907
12913
12915 {
12918
12920 }
12921
12922
12924 {
12926 return;
12927
12929
12932
12935
12936 SoundParameters params = new SoundParameters();
12940 }
12941
12942
12944 {
12946 return;
12947
12949 SetSynchDirty();
12950
12953 }
12954
12955
12957 {
12959 return;
12960
12962 SetSynchDirty();
12963
12966 }
12967
12969 {
12971 }
12972
12974 {
12976 }
12977
12980 {
12981 if (!
GetGame().IsDedicatedServer())
12982 {
12983 if (ConfigIsExisting("attachSoundSet"))
12984 {
12985 string cfg_path = "";
12986 string soundset = "";
12987 string type_name =
GetType();
12988
12991 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12992 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12993
12994 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12995 {
12996 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12997 {
12998 if (cfg_slot_array[i] == slot_type)
12999 {
13000 soundset = cfg_soundset_array[i];
13001 break;
13002 }
13003 }
13004 }
13005
13006 if (soundset != "")
13007 {
13008 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13010 }
13011 }
13012 }
13013 }
13014
13016 {
13017
13018 }
13019
13020 void OnApply(PlayerBase player);
13021
13023 {
13024 return 1.0;
13025 };
13026
13028 {
13030 }
13031
13033 {
13035 }
13036
13038
13040 {
13041 SetDynamicPhysicsLifeTime(0.01);
13043 }
13044
13046 {
13047 array<string> zone_names = new array<string>;
13048 GetDamageZones(zone_names);
13049 for (int i = 0; i < zone_names.Count(); i++)
13050 {
13051 SetHealthMax(zone_names.Get(i),"Health");
13052 }
13053 SetHealthMax("","Health");
13054 }
13055
13058 {
13059 float global_health = GetHealth01("","Health");
13060 array<string> zones = new array<string>;
13061 GetDamageZones(zones);
13062
13063 for (int i = 0; i < zones.Count(); i++)
13064 {
13065 SetHealth01(zones.Get(i),"Health",global_health);
13066 }
13067 }
13068
13071 {
13072 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13073 }
13074
13076 {
13077 if (!hasRootAsPlayer)
13078 {
13079 if (refParentIB)
13080 {
13081
13082 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13083 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13084
13085 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13086 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13087
13090 }
13091 else
13092 {
13093
13096 }
13097 }
13098 }
13099
13101 {
13103 {
13104 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13105 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13106 {
13107 float heatPermCoef = 1.0;
13109 while (ent)
13110 {
13111 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13112 ent = ent.GetHierarchyParent();
13113 }
13114
13115 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13116 }
13117 }
13118 }
13119
13121 {
13122
13123 EntityAI parent = GetHierarchyParent();
13124 if (!parent)
13125 {
13126 hasParent = false;
13127 hasRootAsPlayer = false;
13128 }
13129 else
13130 {
13131 hasParent = true;
13132 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13133 refParentIB =
ItemBase.Cast(parent);
13134 }
13135 }
13136
13137 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13138 {
13139
13140 }
13141
13143 {
13144
13145 return false;
13146 }
13147
13149 {
13150
13151
13152 return false;
13153 }
13154
13156 {
13157
13158 return false;
13159 }
13160
13163 {
13164 return !GetIsFrozen() &&
IsOpen();
13165 }
13166
13168 {
13169 bool hasParent = false, hasRootAsPlayer = false;
13171
13172 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13173 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13174
13175 if (wwtu || foodDecay)
13176 {
13180
13181 if (processWetness || processTemperature || processDecay)
13182 {
13184
13185 if (processWetness)
13186 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13187
13188 if (processTemperature)
13190
13191 if (processDecay)
13192 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13193 }
13194 }
13195 }
13196
13199 {
13201 }
13202
13204 {
13207
13208 return super.GetTemperatureFreezeThreshold();
13209 }
13210
13212 {
13215
13216 return super.GetTemperatureThawThreshold();
13217 }
13218
13220 {
13223
13224 return super.GetItemOverheatThreshold();
13225 }
13226
13228 {
13230 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13231
13232 return super.GetTemperatureFreezeTime();
13233 }
13234
13236 {
13238 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13239
13240 return super.GetTemperatureThawTime();
13241 }
13242
13247
13249 {
13250 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13251 }
13252
13254 {
13255 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13256 }
13257
13260 {
13262 }
13263
13265 {
13267 }
13268
13270 {
13272 }
13273
13276 {
13277 return null;
13278 }
13279
13282 {
13283 return false;
13284 }
13285
13287 {
13289 {
13292 if (!trg)
13293 {
13295 explosive = this;
13296 }
13297
13298 explosive.PairRemote(trg);
13300
13301 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13302 trg.SetPersistentPairID(persistentID);
13303 explosive.SetPersistentPairID(persistentID);
13304
13305 return true;
13306 }
13307 return false;
13308 }
13309
13312 {
13313 float ret = 1.0;
13316 ret *= GetHealth01();
13317
13318 return ret;
13319 }
13320
13321 #ifdef DEVELOPER
13322 override void SetDebugItem()
13323 {
13324 super.SetDebugItem();
13325 _itemBase = this;
13326 }
13327
13329 {
13330 string text = super.GetDebugText();
13331
13333 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13334
13335 return text;
13336 }
13337 #endif
13338
13340 {
13341 return true;
13342 }
13343
13345
13347
13349 {
13352 }
13353
13354
13362
13378}
13379
13381{
13383 if (entity)
13384 {
13385 bool is_item = entity.IsInherited(
ItemBase);
13386 if (is_item && full_quantity)
13387 {
13390 }
13391 }
13392 else
13393 {
13395 return NULL;
13396 }
13397 return entity;
13398}
13399
13401{
13402 if (item)
13403 {
13404 if (health > 0)
13405 item.SetHealth("", "", health);
13406
13407 if (item.CanHaveTemperature())
13408 {
13410 if (item.CanFreeze())
13411 item.SetFrozen(false);
13412 }
13413
13414 if (item.HasEnergyManager())
13415 {
13416 if (quantity >= 0)
13417 {
13418 item.GetCompEM().SetEnergy0To1(quantity);
13419 }
13420 else
13421 {
13423 }
13424 }
13425 else if (item.IsMagazine())
13426 {
13427 Magazine mag = Magazine.Cast(item);
13428 if (quantity >= 0)
13429 {
13430 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13431 }
13432 else
13433 {
13435 }
13436
13437 }
13438 else
13439 {
13440 if (quantity >= 0)
13441 {
13442 item.SetQuantityNormalized(quantity, false);
13443 }
13444 else
13445 {
13447 }
13448
13449 }
13450 }
13451}
13452
13453#ifdef DEVELOPER
13455#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.