8620{
8622 {
8623 return true;
8624 }
8625};
8626
8627
8628
8630{
8634
8636
8639
8640
8641
8642
8643
8652
8658
8663
8668
8689 protected bool m_IsResultOfSplit
8690
8692
8697
8698
8699
8701
8705
8706
8707
8709
8712
8713
8714
8720
8721
8729
8732
8733
8735
8736
8738
8739
8744
8745
8750
8751
8753
8754
8756 {
8761
8762 if (!
GetGame().IsDedicatedServer())
8763 {
8765 {
8767
8769 {
8771 }
8772 }
8773
8776 }
8777
8778 m_OldLocation = null;
8779
8781 {
8783 }
8784
8785 if (ConfigIsExisting("headSelectionsToHide"))
8786 {
8789 }
8790
8792 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8793 {
8795 }
8796
8798
8799 m_IsResultOfSplit = false;
8800
8802 }
8803
8805 {
8806 super.InitItemVariables();
8807
8813 m_Count = ConfigGetInt(
"count");
8814
8817
8822
8825
8830
8842
8846
8847
8850 if (ConfigIsExisting("canBeSplit"))
8851 {
8854 }
8855
8857 if (ConfigIsExisting("itemBehaviour"))
8859
8860
8863 RegisterNetSyncVariableInt("m_VarLiquidType");
8864 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8865
8866 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8867 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8868 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8869
8870 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8871 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8872 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8873 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8874
8875 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8876 RegisterNetSyncVariableBool("m_IsTakeable");
8877 RegisterNetSyncVariableBool("m_IsHologram");
8878
8881 {
8884 }
8885
8887
8889 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8891
8892 }
8893
8895 {
8897 }
8898
8900 {
8903 {
8908 }
8909 }
8910
8911 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8912 {
8914 {
8917 }
8918
8920 }
8921
8923 {
8929 }
8930
8932
8934 {
8936
8937 if (!action)
8938 {
8939 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8940 return;
8941 }
8942
8944 if (!ai)
8945 {
8947 return;
8948 }
8949
8951 if (!action_array)
8952 {
8953 action_array = new array<ActionBase_Basic>;
8955 }
8956 if (LogManager.IsActionLogEnable())
8957 {
8958 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8959 }
8960
8961 if (action_array.Find(action) != -1)
8962 {
8963 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8964 }
8965 else
8966 {
8967 action_array.Insert(action);
8968 }
8969 }
8970
8972 {
8974 ActionBase action = player.GetActionManager().GetAction(actionName);
8977
8978 if (action_array)
8979 {
8980 action_array.RemoveItem(action);
8981 }
8982 }
8983
8984
8985
8987 {
8988 ActionOverrideData overrideData = new ActionOverrideData();
8992
8994 if (!actionMap)
8995 {
8998 }
8999
9000 actionMap.Insert(this.
Type(), overrideData);
9001
9002 }
9003
9005
9007
9008
9010 {
9013
9016
9017 string config_to_search = "CfgVehicles";
9018 string muzzle_owner_config;
9019
9021 {
9022 if (IsInherited(Weapon))
9023 config_to_search = "CfgWeapons";
9024
9025 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9026
9027 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9028
9030
9031 if (config_OnFire_subclass_count > 0)
9032 {
9033 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9034
9035 for (int i = 0; i < config_OnFire_subclass_count; i++)
9036 {
9037 string particle_class = "";
9039 string config_OnFire_entry = config_OnFire_class + particle_class;
9040 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9041 WPOF_array.Insert(WPOF);
9042 }
9043
9044
9046 }
9047 }
9048
9050 {
9051 config_to_search = "CfgWeapons";
9052 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9053
9054 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9055
9057
9058 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9059 {
9060 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9061
9062 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9063 {
9064 string particle_class2 = "";
9066 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9067 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9068 WPOBE_array.Insert(WPOBE);
9069 }
9070
9071
9073 }
9074 }
9075 }
9076
9077
9079 {
9082
9084 {
9085 string config_to_search = "CfgVehicles";
9086
9087 if (IsInherited(Weapon))
9088 config_to_search = "CfgWeapons";
9089
9090 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9091 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9092
9093 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9094 {
9095
9097
9099 {
9101 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9103 return;
9104 }
9105
9108
9109
9110
9112 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9113
9114 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9115 {
9116 string particle_class = "";
9118 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9120
9121 if (entry_type == CT_CLASS)
9122 {
9123 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9124 WPOOH_array.Insert(WPOF);
9125 }
9126 }
9127
9128
9130 }
9131 }
9132 }
9133
9135 {
9137 }
9138
9140 {
9142 {
9144
9147
9150
9151 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9152 }
9153 }
9154
9156 {
9158 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9159
9161 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9162
9164 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9165
9167 {
9169 }
9170 }
9171
9173 {
9175 }
9176
9178 {
9181 else
9183
9185 {
9188 }
9189 else
9190 {
9193
9196 }
9197
9199 }
9200
9202 {
9204 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9205 }
9206
9208 {
9210 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9212 }
9213
9215 {
9217 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9218 }
9219
9221 {
9224
9225 OverheatingParticle OP = new OverheatingParticle();
9230
9232 }
9233
9235 {
9238
9239 return -1;
9240 }
9241
9243 {
9245 {
9248
9249 for (int i = count; i > 0; --i)
9250 {
9251 int id = i - 1;
9254
9257
9258 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9259 {
9260 if (p)
9261 {
9264 }
9265 }
9266 }
9267 }
9268 }
9269
9271 {
9273 {
9275 {
9276 int id = i - 1;
9278
9279 if (OP)
9280 {
9282
9283 if (p)
9284 {
9286 }
9287
9288 delete OP;
9289 }
9290 }
9291
9294 }
9295 }
9296
9299 {
9300 return 0.0;
9301 }
9302
9303
9305 {
9306 return 250;
9307 }
9308
9310 {
9311 return 0;
9312 }
9313
9316 {
9318 return true;
9319
9320 return false;
9321 }
9322
9325 {
9328
9330 {
9332 }
9333 else
9334 {
9335
9337 }
9338
9340 }
9341
9348 {
9349 return -1;
9350 }
9351
9352
9353
9354
9356 {
9358 {
9360 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9361
9362 if (r_index >= 0)
9363 {
9364 InventoryLocation r_il = new InventoryLocation;
9365 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9366
9367 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9370 {
9371 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9372 }
9374 {
9375 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9376 }
9377
9378 }
9379
9380 player.GetHumanInventory().ClearUserReservedLocation(this);
9381 }
9382
9385 }
9386
9387
9388
9389
9391 {
9392 return ItemBase.m_DebugActionsMask;
9393 }
9394
9396 {
9397 return ItemBase.m_DebugActionsMask & mask;
9398 }
9399
9401 {
9402 ItemBase.m_DebugActionsMask = mask;
9403 }
9404
9406 {
9407 ItemBase.m_DebugActionsMask |= mask;
9408 }
9409
9411 {
9412 ItemBase.m_DebugActionsMask &= ~mask;
9413 }
9414
9416 {
9418 {
9420 }
9421 else
9422 {
9424 }
9425 }
9426
9427
9429 {
9430 if (GetEconomyProfile())
9431 {
9432 float q_max = GetEconomyProfile().GetQuantityMax();
9433 if (q_max > 0)
9434 {
9435 float q_min = GetEconomyProfile().GetQuantityMin();
9436 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9437
9439 {
9440 ComponentEnergyManager comp = GetCompEM();
9442 {
9444 }
9445 }
9447 {
9449
9450 }
9451
9452 }
9453 }
9454 }
9455
9458 {
9459 EntityAI parent = GetHierarchyParent();
9460
9461 if (parent)
9462 {
9463 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9464 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9465 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9466 }
9467 }
9468
9471 {
9472 EntityAI parent = GetHierarchyParent();
9473
9474 if (parent)
9475 {
9476 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9477 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9478 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9479 }
9480 }
9481
9483 {
9484
9485
9486
9487
9489
9491 {
9492 if (ScriptInputUserData.CanStoreInputUserData())
9493 {
9494 ScriptInputUserData ctx = new ScriptInputUserData;
9500 ctx.
Write(use_stack_max);
9503
9505 {
9506 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9507 }
9508 }
9509 }
9510 else if (!
GetGame().IsMultiplayer())
9511 {
9513 }
9514 }
9515
9517 {
9519 }
9520
9522 {
9524 }
9525
9527 {
9529 }
9530
9532 {
9533
9534 return false;
9535 }
9536
9538 {
9539 return false;
9540 }
9541
9545 {
9546 return false;
9547 }
9548
9550 {
9551 return "";
9552 }
9553
9555
9557 {
9558 return false;
9559 }
9560
9562 {
9563 return true;
9564 }
9565
9566
9567
9569 {
9570 return true;
9571 }
9572
9574 {
9575 return true;
9576 }
9577
9579 {
9580 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9582 }
9583
9585 {
9587 }
9588
9590 {
9592 if (!is_being_placed)
9594 SetSynchDirty();
9595 }
9596
9597
9599
9601 {
9603 }
9604
9606 {
9608 }
9609
9611 {
9612 return 1;
9613 }
9614
9616 {
9617 return false;
9618 }
9619
9621 {
9623 SetSynchDirty();
9624 }
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9661 {
9662 super.OnMovedInsideCargo(container);
9663
9664 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9665 }
9666
9667 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9668 {
9669 super.EEItemLocationChanged(oldLoc,newLoc);
9670
9671 PlayerBase new_player = null;
9672 PlayerBase old_player = null;
9673
9674 if (newLoc.GetParent())
9675 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9676
9677 if (oldLoc.GetParent())
9678 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9679
9681 {
9682 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9683
9684 if (r_index >= 0)
9685 {
9686 InventoryLocation r_il = new InventoryLocation;
9687 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9688
9689 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9692 {
9693 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9694 }
9696 {
9697 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9698 }
9699
9700 }
9701 }
9702
9704 {
9705 if (new_player)
9706 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9707
9708 if (new_player == old_player)
9709 {
9710
9711 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9712 {
9714 {
9715 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9716 {
9717 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9718 }
9719 }
9720 else
9721 {
9722 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9723 }
9724 }
9725
9726 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9727 {
9728 int type = oldLoc.GetType();
9730 {
9731 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9732 }
9734 {
9735 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9736 }
9737 }
9738 if (!m_OldLocation)
9739 {
9740 m_OldLocation = new InventoryLocation;
9741 }
9742 m_OldLocation.Copy(oldLoc);
9743 }
9744 else
9745 {
9746 if (m_OldLocation)
9747 {
9748 m_OldLocation.Reset();
9749 }
9750 }
9751
9753 }
9754 else
9755 {
9756 if (new_player)
9757 {
9758 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9759 if (res_index >= 0)
9760 {
9761 InventoryLocation il = new InventoryLocation;
9762 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9764 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9767 {
9768 il.
GetParent().GetOnReleaseLock().Invoke(it);
9769 }
9771 {
9773 }
9774
9775 }
9776 }
9778 {
9779
9781 }
9782
9783 if (m_OldLocation)
9784 {
9785 m_OldLocation.Reset();
9786 }
9787 }
9788 }
9789
9790 override void EOnContact(IEntity other, Contact extra)
9791 {
9793 {
9794 int liquidType = -1;
9796 if (impactSpeed > 0.0)
9797 {
9799 #ifndef SERVER
9801 #else
9803 SetSynchDirty();
9804 #endif
9806 }
9807 }
9808
9809 #ifdef SERVER
9810 if (GetCompEM() && GetCompEM().IsPlugged())
9811 {
9812 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9813 GetCompEM().UnplugThis();
9814 }
9815 #endif
9816 }
9817
9819
9821 {
9823 }
9824
9826 {
9827
9828 }
9829
9831 {
9832 super.OnItemLocationChanged(old_owner, new_owner);
9833
9834 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9835 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9836
9837 if (!relatedPlayer && playerNew)
9838 relatedPlayer = playerNew;
9839
9840 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9841 {
9843 if (actionMgr)
9844 {
9845 ActionBase currentAction = actionMgr.GetRunningAction();
9846 if (currentAction)
9848 }
9849 }
9850
9851 Man ownerPlayerOld = null;
9852 Man ownerPlayerNew = null;
9853
9854 if (old_owner)
9855 {
9856 if (old_owner.
IsMan())
9857 {
9858 ownerPlayerOld = Man.Cast(old_owner);
9859 }
9860 else
9861 {
9862 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9863 }
9864 }
9865 else
9866 {
9868 {
9870
9871 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9872 {
9873 GetCompEM().UnplugThis();
9874 }
9875 }
9876 }
9877
9878 if (new_owner)
9879 {
9880 if (new_owner.
IsMan())
9881 {
9882 ownerPlayerNew = Man.Cast(new_owner);
9883 }
9884 else
9885 {
9886 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9887 }
9888 }
9889
9890 if (ownerPlayerOld != ownerPlayerNew)
9891 {
9892 if (ownerPlayerOld)
9893 {
9894 array<EntityAI> subItemsExit = new array<EntityAI>;
9896 for (int i = 0; i < subItemsExit.Count(); i++)
9897 {
9900 }
9901 }
9902
9903 if (ownerPlayerNew)
9904 {
9905 array<EntityAI> subItemsEnter = new array<EntityAI>;
9907 for (int j = 0; j < subItemsEnter.Count(); j++)
9908 {
9911 }
9912 }
9913 }
9914 else if (ownerPlayerNew != null)
9915 {
9916 PlayerBase nplayer;
9917 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9918 {
9919 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9921 for (int k = 0; k < subItemsUpdate.Count(); k++)
9922 {
9924 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9925 }
9926 }
9927 }
9928
9929 if (old_owner)
9930 old_owner.OnChildItemRemoved(this);
9931 if (new_owner)
9932 new_owner.OnChildItemReceived(this);
9933 }
9934
9935
9937 {
9938 super.EEDelete(parent);
9939 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9940 if (player)
9941 {
9943
9944 if (player.IsAlive())
9945 {
9946 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9947 if (r_index >= 0)
9948 {
9949 InventoryLocation r_il = new InventoryLocation;
9950 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9951
9952 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9955 {
9956 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9957 }
9959 {
9960 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9961 }
9962
9963 }
9964
9965 player.RemoveQuickBarEntityShortcut(this);
9966 }
9967 }
9968 }
9969
9971 {
9972 super.EEKilled(killer);
9973
9976 {
9977 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9978 {
9979 if (IsMagazine())
9980 {
9981 if (Magazine.Cast(this).GetAmmoCount() > 0)
9982 {
9984 }
9985 }
9986 else
9987 {
9989 }
9990 }
9991 }
9992 }
9993
9995 {
9996 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9997
9998 super.OnWasAttached(parent, slot_id);
9999
10002
10004 }
10005
10007 {
10008 super.OnWasDetached(parent, slot_id);
10009
10012 }
10013
10015 {
10016 int idx;
10019
10020 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10021 if (inventory_slots.Count() < 1)
10022 {
10023 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10024 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10025 }
10026 else
10027 {
10028 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10029 }
10030
10031 idx = inventory_slots.Find(slot);
10032 if (idx < 0)
10033 return "";
10034
10035 return attach_types.Get(idx);
10036 }
10037
10039 {
10040 int idx = -1;
10041 string slot;
10042
10045
10046 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10047 if (inventory_slots.Count() < 1)
10048 {
10049 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10050 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10051 }
10052 else
10053 {
10054 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10055 if (detach_types.Count() < 1)
10056 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10057 }
10058
10059 for (int i = 0; i < inventory_slots.Count(); i++)
10060 {
10061 slot = inventory_slots.Get(i);
10062 }
10063
10064 if (slot != "")
10065 {
10066 if (detach_types.Count() == 1)
10067 idx = 0;
10068 else
10069 idx = inventory_slots.Find(slot);
10070 }
10071 if (idx < 0)
10072 return "";
10073
10074 return detach_types.Get(idx);
10075 }
10076
10078 {
10079
10081
10082
10083 float min_time = 1;
10084 float max_time = 3;
10085 float delay = Math.RandomFloat(min_time, max_time);
10086
10087 explode_timer.Run(delay, this, "DoAmmoExplosion");
10088 }
10089
10091 {
10092 Magazine magazine = Magazine.Cast(this);
10093 int pop_sounds_count = 6;
10094 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10095
10096
10097 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10098 string sound_name = pop_sounds[ sound_idx ];
10100
10101
10102 magazine.ServerAddAmmoCount(-1);
10103
10104
10105 float min_temp_to_explode = 100;
10106
10107 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10108 {
10110 }
10111 }
10112
10113
10114 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10115 {
10116 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10117
10118 const int CHANCE_DAMAGE_CARGO = 4;
10119 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10120 const int CHANCE_DAMAGE_NOTHING = 2;
10121
10123 {
10124 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10125 int chances;
10126 int rnd;
10127
10128 if (GetInventory().GetCargo())
10129 {
10130 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10131 rnd = Math.RandomInt(0,chances);
10132
10133 if (rnd < CHANCE_DAMAGE_CARGO)
10134 {
10136 }
10137 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10138 {
10140 }
10141 }
10142 else
10143 {
10144 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10145 rnd = Math.RandomInt(0,chances);
10146
10147 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10148 {
10150 }
10151 }
10152 }
10153 }
10154
10156 {
10157 if (GetInventory().GetCargo())
10158 {
10159 int item_count = GetInventory().GetCargo().GetItemCount();
10160 if (item_count > 0)
10161 {
10162 int random_pick = Math.RandomInt(0, item_count);
10164 if (!item.IsExplosive())
10165 {
10166 item.AddHealth("","",damage);
10167 return true;
10168 }
10169 }
10170 }
10171 return false;
10172 }
10173
10175 {
10176 int attachment_count = GetInventory().AttachmentCount();
10177 if (attachment_count > 0)
10178 {
10179 int random_pick = Math.RandomInt(0, attachment_count);
10180 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10181 if (!attachment.IsExplosive())
10182 {
10183 attachment.AddHealth("","",damage);
10184 return true;
10185 }
10186 }
10187 return false;
10188 }
10189
10191 {
10193 }
10194
10196 {
10198 return GetInventory().CanRemoveEntity();
10199
10200 return false;
10201 }
10202
10204 {
10205
10207 return false;
10208
10209
10211 return false;
10212
10213
10214
10216 if (delta == 0)
10217 return false;
10218
10219
10220 return true;
10221 }
10222
10224 {
10226 {
10227 if (ScriptInputUserData.CanStoreInputUserData())
10228 {
10229 ScriptInputUserData ctx = new ScriptInputUserData;
10234 ctx.
Write(destination_entity);
10236 ctx.
Write(slot_id);
10238 }
10239 }
10240 else if (!
GetGame().IsMultiplayer())
10241 {
10243 }
10244 }
10245
10247 {
10248 float split_quantity_new;
10252 InventoryLocation loc = new InventoryLocation;
10253
10254 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10255 {
10257 split_quantity_new = stack_max;
10258 else
10260
10262 {
10263 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10264 if (new_item)
10265 {
10266 new_item.SetResultOfSplit(true);
10267 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10269 new_item.
SetQuantity(split_quantity_new,
false,
true);
10270 }
10271 }
10272 }
10273 else if (destination_entity && slot_id == -1)
10274 {
10275 if (quantity > stack_max)
10276 split_quantity_new = stack_max;
10277 else
10278 split_quantity_new = quantity;
10279
10281 {
10283 {
10286 }
10287
10288 if (new_item)
10289 {
10290 new_item.SetResultOfSplit(true);
10291 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10293 new_item.
SetQuantity(split_quantity_new,
false,
true);
10294 }
10295 }
10296 }
10297 else
10298 {
10299 if (stack_max != 0)
10300 {
10302 {
10304 }
10305
10306 if (split_quantity_new == 0)
10307 {
10308 if (!
GetGame().IsMultiplayer())
10309 player.PhysicalPredictiveDropItem(this);
10310 else
10311 player.ServerDropEntity(this);
10312 return;
10313 }
10314
10316 {
10318
10319 if (new_item)
10320 {
10321 new_item.SetResultOfSplit(true);
10322 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10325 new_item.PlaceOnSurface();
10326 }
10327 }
10328 }
10329 }
10330 }
10331
10333 {
10334 float split_quantity_new;
10338 InventoryLocation loc = new InventoryLocation;
10339
10340 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10341 {
10343 split_quantity_new = stack_max;
10344 else
10346
10348 {
10349 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10350 if (new_item)
10351 {
10352 new_item.SetResultOfSplit(true);
10353 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10355 new_item.
SetQuantity(split_quantity_new,
false,
true);
10356 }
10357 }
10358 }
10359 else if (destination_entity && slot_id == -1)
10360 {
10361 if (quantity > stack_max)
10362 split_quantity_new = stack_max;
10363 else
10364 split_quantity_new = quantity;
10365
10367 {
10369 {
10372 }
10373
10374 if (new_item)
10375 {
10376 new_item.SetResultOfSplit(true);
10377 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10379 new_item.
SetQuantity(split_quantity_new,
false,
true);
10380 }
10381 }
10382 }
10383 else
10384 {
10385 if (stack_max != 0)
10386 {
10388 {
10390 }
10391
10393 {
10395
10396 if (new_item)
10397 {
10398 new_item.SetResultOfSplit(true);
10399 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10402 new_item.PlaceOnSurface();
10403 }
10404 }
10405 }
10406 }
10407 }
10408
10410 {
10412 {
10413 if (ScriptInputUserData.CanStoreInputUserData())
10414 {
10415 ScriptInputUserData ctx = new ScriptInputUserData;
10420 dst.WriteToContext(ctx);
10422 }
10423 }
10424 else if (!
GetGame().IsMultiplayer())
10425 {
10427 }
10428 }
10429
10431 {
10433 {
10434 if (ScriptInputUserData.CanStoreInputUserData())
10435 {
10436 ScriptInputUserData ctx = new ScriptInputUserData;
10441 ctx.
Write(destination_entity);
10447 }
10448 }
10449 else if (!
GetGame().IsMultiplayer())
10450 {
10452 }
10453 }
10454
10456 {
10458 }
10459
10461 {
10463 float split_quantity_new;
10465 if (dst.IsValid())
10466 {
10467 int slot_id = dst.GetSlot();
10469
10470 if (quantity > stack_max)
10471 split_quantity_new = stack_max;
10472 else
10473 split_quantity_new = quantity;
10474
10476 {
10478
10479 if (new_item)
10480 {
10481 new_item.SetResultOfSplit(true);
10482 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10484 new_item.
SetQuantity(split_quantity_new,
false,
true);
10485 }
10486
10487 return new_item;
10488 }
10489 }
10490
10491 return null;
10492 }
10493
10495 {
10497 float split_quantity_new;
10499 if (destination_entity)
10500 {
10502 if (quantity > stackable)
10503 split_quantity_new = stackable;
10504 else
10505 split_quantity_new = quantity;
10506
10508 {
10509 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10510 if (new_item)
10511 {
10512 new_item.SetResultOfSplit(true);
10513 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10515 new_item.
SetQuantity(split_quantity_new,
false,
true);
10516 }
10517 }
10518 }
10519 }
10520
10522 {
10524 {
10525 if (ScriptInputUserData.CanStoreInputUserData())
10526 {
10527 ScriptInputUserData ctx = new ScriptInputUserData;
10532 ItemBase destination_entity =
this;
10533 ctx.
Write(destination_entity);
10537 }
10538 }
10539 else if (!
GetGame().IsMultiplayer())
10540 {
10542 }
10543 }
10544
10546 {
10548 float split_quantity_new;
10550 if (player)
10551 {
10553 if (quantity > stackable)
10554 split_quantity_new = stackable;
10555 else
10556 split_quantity_new = quantity;
10557
10559 {
10560 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10561 new_item =
ItemBase.Cast(in_hands);
10562 if (new_item)
10563 {
10564 new_item.SetResultOfSplit(true);
10565 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10567 new_item.SetQuantity(split_quantity_new, false, true);
10568 }
10569 }
10570 }
10571 }
10572
10574 {
10576 float split_quantity_new = Math.Floor(quantity * 0.5);
10577
10579 return;
10580
10582
10583 if (new_item)
10584 {
10585 if (new_item.GetQuantityMax() < split_quantity_new)
10586 {
10587 split_quantity_new = new_item.GetQuantityMax();
10588 }
10589
10590 new_item.SetResultOfSplit(true);
10591 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10592
10594 {
10597 }
10598 else
10599 {
10601 new_item.
SetQuantity(split_quantity_new,
false,
true);
10602 }
10603 }
10604 }
10605
10607 {
10609 float split_quantity_new = Math.Floor(quantity / 2);
10610
10612 return;
10613
10614 InventoryLocation invloc = new InventoryLocation;
10616
10618 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10619
10620 if (new_item)
10621 {
10622 if (new_item.GetQuantityMax() < split_quantity_new)
10623 {
10624 split_quantity_new = new_item.GetQuantityMax();
10625 }
10627 {
10630 }
10631 else if (split_quantity_new > 1)
10632 {
10634 new_item.
SetQuantity(split_quantity_new,
false,
true);
10635 }
10636 }
10637 }
10638
10641 {
10642 SetWeightDirty();
10644
10645 if (parent)
10646 parent.OnAttachmentQuantityChangedEx(this, delta);
10647
10649 {
10651 {
10653 }
10655 {
10656 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10658 }
10659 }
10660
10661 }
10662
10665 {
10666
10667 }
10668
10671 {
10673 }
10674
10676 {
10677 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10678
10680 {
10681 if (newLevel == GameConstants.STATE_RUINED)
10682 {
10684 EntityAI parent = GetHierarchyParent();
10685 if (parent && parent.IsFireplace())
10686 {
10687 CargoBase cargo = GetInventory().GetCargo();
10688 if (cargo)
10689 {
10691 {
10693 }
10694 }
10695 }
10696 }
10697
10699 {
10700
10702 return;
10703 }
10704
10705 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10706 {
10708 }
10709 }
10710 }
10711
10712
10714 {
10715 super.OnRightClick();
10716
10718 {
10720 {
10721 if (ScriptInputUserData.CanStoreInputUserData())
10722 {
10723 EntityAI root = GetHierarchyRoot();
10724 Man playerOwner = GetHierarchyRootPlayer();
10725 InventoryLocation dst = new InventoryLocation;
10726
10727
10728 if (!playerOwner && root && root == this)
10729 {
10731 }
10732 else
10733 {
10734
10735 GetInventory().GetCurrentInventoryLocation(dst);
10737 {
10740 {
10742 }
10743 else
10744 {
10746
10747
10748 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10749 {
10751 }
10752 else
10753 {
10754 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10755 }
10756 }
10757 }
10758 }
10759
10760 ScriptInputUserData ctx = new ScriptInputUserData;
10768 }
10769 }
10770 else if (!
GetGame().IsMultiplayer())
10771 {
10773 }
10774 }
10775 }
10776
10778 {
10779 if (root)
10780 {
10781 vector m4[4];
10782 root.GetTransform(m4);
10783 dst.SetGround(this, m4);
10784 }
10785 else
10786 {
10787 GetInventory().GetCurrentInventoryLocation(dst);
10788 }
10789 }
10790
10791 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10792 {
10793
10794 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10795 return false;
10796
10797 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10798 return false;
10799
10800
10802 return false;
10803
10804
10805 Magazine mag = Magazine.Cast(this);
10806 if (mag)
10807 {
10808 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10809 return false;
10810
10811 if (stack_max_limit)
10812 {
10813 Magazine other_mag = Magazine.Cast(other_item);
10814 if (other_item)
10815 {
10816 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10817 return false;
10818 }
10819
10820 }
10821 }
10822 else
10823 {
10824
10826 return false;
10827
10829 return false;
10830 }
10831
10832 PlayerBase player = null;
10833 if (CastTo(player, GetHierarchyRootPlayer()))
10834 {
10835 if (player.GetInventory().HasAttachment(this))
10836 return false;
10837
10838 if (player.IsItemsToDelete())
10839 return false;
10840 }
10841
10842 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10843 return false;
10844
10845 int slotID;
10847 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10848 return false;
10849
10850 return true;
10851 }
10852
10854 {
10856 }
10857
10859 {
10860 return m_IsResultOfSplit;
10861 }
10862
10864 {
10865 m_IsResultOfSplit = value;
10866 }
10867
10869 {
10871 }
10872
10874 {
10875 float other_item_quantity = other_item.GetQuantity();
10876 float this_free_space;
10877
10879
10881
10882 if (other_item_quantity > this_free_space)
10883 {
10884 return this_free_space;
10885 }
10886 else
10887 {
10888 return other_item_quantity;
10889 }
10890 }
10891
10893 {
10895 }
10896
10898 {
10900 return;
10901
10902 if (!IsMagazine() && other_item)
10903 {
10905 if (quantity_used != 0)
10906 {
10907 float hp1 = GetHealth01("","");
10908 float hp2 = other_item.GetHealth01("","");
10909 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10910 hpResult = hpResult / (
GetQuantity() + quantity_used);
10911
10912 hpResult *= GetMaxHealth();
10913 Math.Round(hpResult);
10914 SetHealth("", "Health", hpResult);
10915
10917 other_item.AddQuantity(-quantity_used);
10918 }
10919 }
10921 }
10922
10924 {
10925 #ifdef SERVER
10926 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10927 GetHierarchyParent().IncreaseLifetimeUp();
10928 #endif
10929 };
10930
10932 {
10933 PlayerBase p = PlayerBase.Cast(player);
10934
10935 array<int> recipesIds = p.m_Recipes;
10936 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10937 if (moduleRecipesManager)
10938 {
10939 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10940 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10941 }
10942
10943 for (int i = 0;i < recipesIds.Count(); i++)
10944 {
10945 int key = recipesIds.Get(i);
10946 string recipeName = moduleRecipesManager.GetRecipeName(key);
10948 }
10949 }
10950
10951
10952 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10953 {
10954 super.GetDebugActions(outputList);
10955
10956
10962
10963
10968
10973
10974
10978
10979
10981 {
10985 }
10986
10989
10990
10994
10996
10997 InventoryLocation loc = new InventoryLocation();
10998 GetInventory().GetCurrentInventoryLocation(loc);
11000 {
11001 if (Gizmo_IsSupported())
11004 }
11005
11007 }
11008
11009
11010
11011
11013 {
11014 super.OnAction(action_id, player, ctx);
11015
11017 {
11018 switch (action_id)
11019 {
11022 return true;
11025 return true;
11026 }
11027 }
11028
11030 {
11031 switch (action_id)
11032 {
11034 Delete();
11035 return true;
11036 }
11037 }
11038
11039 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11040 {
11041 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11042 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11043 PlayerBase p = PlayerBase.Cast(player);
11044 if (
EActions.RECIPES_RANGE_START < 1000)
11045 {
11046 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11047 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11048 }
11049 }
11050 #ifndef SERVER
11051 else if (action_id ==
EActions.WATCH_PLAYER)
11052 {
11053 PluginDeveloper.SetDeveloperItemClientEx(player);
11054 }
11055 #endif
11057 {
11058 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11059 {
11060 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11061 OnDebugButtonPressServer(id + 1);
11062 }
11063
11064 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11065 {
11066 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11068 }
11069
11070 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11071 {
11072 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11074 }
11075
11076 else if (action_id ==
EActions.ADD_QUANTITY)
11077 {
11078 if (IsMagazine())
11079 {
11080 Magazine mag = Magazine.Cast(this);
11081 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11082 }
11083 else
11084 {
11086 }
11087
11088 if (m_EM)
11089 {
11090 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11091 }
11092
11093 }
11094
11095 else if (action_id ==
EActions.REMOVE_QUANTITY)
11096 {
11097 if (IsMagazine())
11098 {
11099 Magazine mag2 = Magazine.Cast(this);
11100 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11101 }
11102 else
11103 {
11105 }
11106 if (m_EM)
11107 {
11108 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11109 }
11110
11111 }
11112
11113 else if (action_id ==
EActions.SET_QUANTITY_0)
11114 {
11116
11117 if (m_EM)
11118 {
11119 m_EM.SetEnergy(0);
11120 }
11121 }
11122
11123 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11124 {
11126
11127 if (m_EM)
11128 {
11129 m_EM.SetEnergy(m_EM.GetEnergyMax());
11130 }
11131 }
11132
11133 else if (action_id ==
EActions.ADD_HEALTH)
11134 {
11135 AddHealth("","",GetMaxHealth("","Health")/5);
11136 }
11137 else if (action_id ==
EActions.REMOVE_HEALTH)
11138 {
11139 AddHealth("","",-GetMaxHealth("","Health")/5);
11140 }
11141 else if (action_id ==
EActions.DESTROY_HEALTH)
11142 {
11143 SetHealth01("","",0);
11144 }
11145 else if (action_id ==
EActions.WATCH_ITEM)
11146 {
11148 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11149 #ifdef DEVELOPER
11150 SetDebugDeveloper_item(this);
11151 #endif
11152 }
11153
11154 else if (action_id ==
EActions.ADD_TEMPERATURE)
11155 {
11156 AddTemperature(20);
11157
11158 }
11159
11160 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11161 {
11162 AddTemperature(-20);
11163
11164 }
11165
11166 else if (action_id ==
EActions.FLIP_FROZEN)
11167 {
11168 SetFrozen(!GetIsFrozen());
11169
11170 }
11171
11172 else if (action_id ==
EActions.ADD_WETNESS)
11173 {
11175
11176 }
11177
11178 else if (action_id ==
EActions.REMOVE_WETNESS)
11179 {
11181
11182 }
11183
11184 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11185 {
11188
11189
11190 }
11191
11192 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11193 {
11196 }
11197
11198 else if (action_id ==
EActions.MAKE_SPECIAL)
11199 {
11200 auto debugParams = DebugSpawnParams.WithPlayer(player);
11201 OnDebugSpawnEx(debugParams);
11202 }
11203
11204 }
11205
11206
11207 return false;
11208 }
11209
11210
11211
11212
11216
11219
11220
11221
11223 {
11224 return false;
11225 }
11226
11227
11229 {
11230 return true;
11231 }
11232
11233
11235 {
11236 return true;
11237 }
11238
11239
11240
11242 {
11243 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11245 }
11246
11249 {
11250 return null;
11251 }
11252
11254 {
11255 return false;
11256 }
11257
11259 {
11260 return false;
11261 }
11262
11266
11267
11269 {
11270 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11271 return module_repairing.CanRepair(this, item_repair_kit);
11272 }
11273
11274
11275 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11276 {
11277 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11278 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11279 }
11280
11281
11283 {
11284
11285
11286
11287
11288
11289
11290
11291
11292 return 1;
11293 }
11294
11295
11296
11298 {
11300 }
11301
11302
11303
11305 {
11307 }
11308
11309
11318 {
11319 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11320
11321 if (player)
11322 {
11323 player.MessageStatus(text);
11324 }
11325 }
11326
11327
11336 {
11337 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11338
11339 if (player)
11340 {
11341 player.MessageAction(text);
11342 }
11343 }
11344
11345
11354 {
11355 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11356
11357 if (player)
11358 {
11359 player.MessageFriendly(text);
11360 }
11361 }
11362
11363
11372 {
11373 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11374
11375 if (player)
11376 {
11377 player.MessageImportant(text);
11378 }
11379 }
11380
11382 {
11383 return true;
11384 }
11385
11386
11387 override bool KindOf(
string tag)
11388 {
11389 bool found = false;
11390 string item_name = this.
GetType();
11393
11394 int array_size = item_tag_array.Count();
11395 for (int i = 0; i < array_size; i++)
11396 {
11397 if (item_tag_array.Get(i) == tag)
11398 {
11399 found = true;
11400 break;
11401 }
11402 }
11403 return found;
11404 }
11405
11406
11408 {
11409
11410 super.OnRPC(sender, rpc_type,ctx);
11411
11412
11413 switch (rpc_type)
11414 {
11415 #ifndef SERVER
11416 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11417 Param2<bool, string> p = new Param2<bool, string>(false, "");
11418
11420 return;
11421
11422 bool play = p.param1;
11423 string soundSet = p.param2;
11424
11425 if (play)
11426 {
11428 {
11430 {
11432 }
11433 }
11434 else
11435 {
11437 }
11438 }
11439 else
11440 {
11442 }
11443
11444 break;
11445 #endif
11446
11447 }
11448
11450 {
11452 }
11453 }
11454
11455
11456
11457
11459 {
11460 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11461 return plugin.GetID(
name);
11462 }
11463
11465 {
11466 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11467 return plugin.GetName(id);
11468 }
11469
11472 {
11473
11474
11475 int varFlags;
11476 if (!ctx.
Read(varFlags))
11477 return;
11478
11479 if (varFlags & ItemVariableFlags.FLOAT)
11480 {
11482 }
11483 }
11484
11486 {
11487
11488 super.SerializeNumericalVars(floats_out);
11489
11490
11491
11493 {
11495 }
11496
11498 {
11500 }
11501
11503 {
11505 }
11506
11508 {
11513 }
11514
11516 {
11518 }
11519 }
11520
11522 {
11523
11524 super.DeSerializeNumericalVars(floats);
11525
11526
11527 int index = 0;
11528 int mask = Math.Round(floats.Get(index));
11529
11530 index++;
11531
11533 {
11535 {
11537 }
11538 else
11539 {
11540 float quantity = floats.Get(index);
11541 SetQuantity(quantity,
true,
false,
false,
false);
11542 }
11543 index++;
11544 }
11545
11547 {
11548 float wet = floats.Get(index);
11550 index++;
11551 }
11552
11554 {
11555 int liquidtype = Math.Round(floats.Get(index));
11557 index++;
11558 }
11559
11561 {
11563 index++;
11565 index++;
11567 index++;
11569 index++;
11570 }
11571
11573 {
11574 int cleanness = Math.Round(floats.Get(index));
11576 index++;
11577 }
11578 }
11579
11581 {
11582 super.WriteVarsToCTX(ctx);
11583
11584
11586 {
11588 }
11589
11591 {
11593 }
11594
11596 {
11598 }
11599
11601 {
11602 int r,g,b,a;
11608 }
11609
11611 {
11613 }
11614 }
11615
11617 {
11618 if (!super.ReadVarsFromCTX(ctx,version))
11619 return false;
11620
11621 int intValue;
11622 float value;
11623
11624 if (version < 140)
11625 {
11626 if (!ctx.
Read(intValue))
11627 return false;
11628
11629 m_VariablesMask = intValue;
11630 }
11631
11633 {
11634 if (!ctx.
Read(value))
11635 return false;
11636
11638 {
11640 }
11641 else
11642 {
11644 }
11645 }
11646
11647 if (version < 140)
11648 {
11650 {
11651 if (!ctx.
Read(value))
11652 return false;
11653 SetTemperatureDirect(value);
11654 }
11655 }
11656
11658 {
11659 if (!ctx.
Read(value))
11660 return false;
11662 }
11663
11665 {
11666 if (!ctx.
Read(intValue))
11667 return false;
11669 }
11670
11672 {
11673 int r,g,b,a;
11675 return false;
11677 return false;
11679 return false;
11681 return false;
11682
11684 }
11685
11687 {
11688 if (!ctx.
Read(intValue))
11689 return false;
11691 }
11692
11693 if (version >= 138 && version < 140)
11694 {
11696 {
11697 if (!ctx.
Read(intValue))
11698 return false;
11699 SetFrozen(intValue);
11700 }
11701 }
11702
11703 return true;
11704 }
11705
11706
11708 {
11711 {
11713 }
11714
11715 if (!super.OnStoreLoad(ctx, version))
11716 {
11718 return false;
11719 }
11720
11721 if (version >= 114)
11722 {
11723 bool hasQuickBarIndexSaved;
11724
11725 if (!ctx.
Read(hasQuickBarIndexSaved))
11726 {
11728 return false;
11729 }
11730
11731 if (hasQuickBarIndexSaved)
11732 {
11733 int itmQBIndex;
11734
11735
11736 if (!ctx.
Read(itmQBIndex))
11737 {
11739 return false;
11740 }
11741
11742 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11743 if (itmQBIndex != -1 && parentPlayer)
11744 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11745 }
11746 }
11747 else
11748 {
11749
11750 PlayerBase player;
11751 int itemQBIndex;
11752 if (version ==
int.
MAX)
11753 {
11754 if (!ctx.
Read(itemQBIndex))
11755 {
11757 return false;
11758 }
11759 }
11760 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11761 {
11762
11763 if (!ctx.
Read(itemQBIndex))
11764 {
11766 return false;
11767 }
11768 if (itemQBIndex != -1 && player)
11769 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11770 }
11771 }
11772
11773 if (version < 140)
11774 {
11775
11776 if (!LoadVariables(ctx, version))
11777 {
11779 return false;
11780 }
11781 }
11782
11783
11785 {
11787 return false;
11788 }
11789 if (version >= 132)
11790 {
11792 if (raib)
11793 {
11795 {
11797 return false;
11798 }
11799 }
11800 }
11801
11803 return true;
11804 }
11805
11806
11807
11809 {
11810 super.OnStoreSave(ctx);
11811
11812 PlayerBase player;
11813 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11814 {
11816
11817 int itemQBIndex = -1;
11818 itemQBIndex = player.FindQuickBarEntityIndex(this);
11819 ctx.
Write(itemQBIndex);
11820 }
11821 else
11822 {
11824 }
11825
11827
11829 if (raib)
11830 {
11832 }
11833 }
11834
11835
11837 {
11838 super.AfterStoreLoad();
11839
11841 {
11843 }
11844
11846 {
11849 }
11850 }
11851
11853 {
11854 super.EEOnAfterLoad();
11855
11857 {
11859 }
11860
11863 }
11864
11866 {
11867 return false;
11868 }
11869
11870
11871
11873 {
11875 {
11876 #ifdef PLATFORM_CONSOLE
11877
11879 {
11881 if (menu)
11882 {
11884 }
11885 }
11886 #endif
11887 }
11888
11890 {
11893 }
11894
11896 {
11897 SetWeightDirty();
11899 }
11901 {
11904 }
11905
11907 {
11910 }
11912 {
11915 }
11916
11917 super.OnVariablesSynchronized();
11918 }
11919
11920
11921
11923 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11924 {
11925 if (!IsServerCheck(allow_client))
11926 return false;
11927
11929 return false;
11930
11933
11934 if (value <= (min + 0.001))
11935 value = min;
11936
11937 if (value == min)
11938 {
11939 if (destroy_config)
11940 {
11941 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11942 if (dstr)
11943 {
11945 this.Delete();
11946 return true;
11947 }
11948 }
11949 else if (destroy_forced)
11950 {
11952 this.Delete();
11953 return true;
11954 }
11955
11957 }
11958
11961
11963 {
11965
11966 if (delta)
11968 }
11969
11971
11972 return false;
11973 }
11974
11975
11977 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11978 {
11980 }
11981
11983 {
11986 }
11987
11989 {
11992 }
11993
11995 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11996 {
11997 float value_clamped = Math.Clamp(value, 0, 1);
11999 SetQuantity(result, destroy_config, destroy_forced);
12000 }
12001
12002
12005 {
12007 }
12008
12010 {
12012 }
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12024 {
12025 int slot = -1;
12026 if (GetInventory())
12027 {
12028 InventoryLocation il = new InventoryLocation;
12029 GetInventory().GetCurrentInventoryLocation(il);
12031 }
12032
12034 }
12035
12037 {
12038 float quantity_max = 0;
12039
12041 {
12042 if (attSlotID != -1)
12043 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12044
12045 if (quantity_max <= 0)
12047 }
12048
12049 if (quantity_max <= 0)
12051
12052 return quantity_max;
12053 }
12054
12056 {
12058 }
12059
12061 {
12063 }
12064
12065
12067 {
12069 }
12070
12072 {
12074 }
12075
12077 {
12079 }
12080
12081
12083 {
12084
12085 float weightEx = GetWeightEx();
12086 float special = GetInventoryAndCargoWeight();
12087 return weightEx - special;
12088 }
12089
12090
12092 {
12094 }
12095
12097 {
12099 {
12100 #ifdef DEVELOPER
12101 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12102 {
12103 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12105 }
12106 #endif
12107
12108 return GetQuantity() * GetConfigWeightModified();
12109 }
12110 else if (HasEnergyManager())
12111 {
12112 #ifdef DEVELOPER
12113 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12114 {
12115 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12116 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12117 }
12118 #endif
12119 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12120 }
12121 else
12122 {
12123 #ifdef DEVELOPER
12124 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12125 {
12126 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12127 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12128 }
12129 #endif
12130 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12131 }
12132 }
12133
12136 {
12137 int item_count = 0;
12139
12140 if (GetInventory().GetCargo() != NULL)
12141 {
12142 item_count = GetInventory().GetCargo().GetItemCount();
12143 }
12144
12145 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12146 {
12147 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12148 if (item)
12149 item_count += item.GetNumberOfItems();
12150 }
12151 return item_count;
12152 }
12153
12156 {
12157 float weight = 0;
12158 float wetness = 1;
12159 if (include_wetness)
12162 {
12163 weight = wetness * m_ConfigWeight;
12164 }
12166 {
12167 weight = 1;
12168 }
12169 return weight;
12170 }
12171
12172
12173
12175 {
12176 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12177 {
12178 GameInventory inv = GetInventory();
12179 array<EntityAI> items = new array<EntityAI>;
12181 for (int i = 0; i < items.Count(); i++)
12182 {
12184 if (item)
12185 {
12187 }
12188 }
12189 }
12190 }
12191
12192
12193
12194
12196 {
12197 float energy = 0;
12198 if (HasEnergyManager())
12199 {
12200 energy = GetCompEM().GetEnergy();
12201 }
12202 return energy;
12203 }
12204
12205
12207 {
12208 super.OnEnergyConsumed();
12209
12211 }
12212
12214 {
12215 super.OnEnergyAdded();
12216
12218 }
12219
12220
12222 {
12223 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12224 {
12226 {
12227 float energy_0to1 = GetCompEM().GetEnergy0To1();
12229 }
12230 }
12231 }
12232
12233
12235 {
12236 return ConfigGetFloat("heatIsolation");
12237 }
12238
12240 {
12242 }
12243
12245 {
12246 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12247 if (
GetGame().ConfigIsExisting(paramPath))
12249
12250 return 0.0;
12251 }
12252
12254 {
12255 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12256 if (
GetGame().ConfigIsExisting(paramPath))
12258
12259 return 0.0;
12260 }
12261
12262 override void SetWet(
float value,
bool allow_client =
false)
12263 {
12264 if (!IsServerCheck(allow_client))
12265 return;
12266
12269
12271
12272 m_VarWet = Math.Clamp(value, min, max);
12273
12275 {
12278 }
12279 }
12280
12281 override void AddWet(
float value)
12282 {
12284 }
12285
12287 {
12289 }
12290
12292 {
12294 }
12295
12297 {
12299 }
12300
12302 {
12304 }
12305
12307 {
12309 }
12310
12311 override void OnWetChanged(
float newVal,
float oldVal)
12312 {
12315 if (newLevel != oldLevel)
12316 {
12318 }
12319 }
12320
12322 {
12323 SetWeightDirty();
12324 }
12325
12327 {
12328 return GetWetLevelInternal(
m_VarWet);
12329 }
12330
12331
12332
12334 {
12336 }
12337
12339 {
12341 }
12342
12344 {
12346 }
12347
12349 {
12351 }
12352
12353
12354
12356 {
12357 if (ConfigIsExisting("itemModelLength"))
12358 {
12359 return ConfigGetFloat("itemModelLength");
12360 }
12361 return 0;
12362 }
12363
12365 {
12366 if (ConfigIsExisting("itemAttachOffset"))
12367 {
12368 return ConfigGetFloat("itemAttachOffset");
12369 }
12370 return 0;
12371 }
12372
12373 override void SetCleanness(
int value,
bool allow_client =
false)
12374 {
12375 if (!IsServerCheck(allow_client))
12376 return;
12377
12379
12381
12384 }
12385
12387 {
12389 }
12390
12392 {
12393 return true;
12394 }
12395
12396
12397
12398
12400 {
12402 }
12403
12405 {
12407 }
12408
12409
12410
12411
12412 override void SetColor(
int r,
int g,
int b,
int a)
12413 {
12419 }
12421 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12422 {
12427 }
12428
12430 {
12432 }
12433
12436 {
12437 int r,g,b,a;
12439 r = r/255;
12440 g = g/255;
12441 b = b/255;
12442 a = a/255;
12443 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12444 }
12445
12446
12447
12448 override void SetLiquidType(
int value,
bool allow_client =
false)
12449 {
12450 if (!IsServerCheck(allow_client))
12451 return;
12452
12457 }
12458
12460 {
12461 return ConfigGetInt("varLiquidTypeInit");
12462 }
12463
12465 {
12467 }
12468
12470 {
12472 SetFrozen(false);
12473 }
12474
12477 {
12478 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12479 }
12480
12481
12484 {
12485 PlayerBase nplayer;
12486 if (PlayerBase.CastTo(nplayer, player))
12487 {
12489
12490 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12491 }
12492 }
12493
12494
12497 {
12498 PlayerBase nplayer;
12499 if (PlayerBase.CastTo(nplayer,player))
12500 {
12501
12502 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12503
12504 }
12505
12506
12507 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12508
12509
12510 if (HasEnergyManager())
12511 {
12512 GetCompEM().UpdatePlugState();
12513 }
12514 }
12515
12516
12518 {
12519 super.OnPlacementStarted(player);
12520
12522 }
12523
12524 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12525 {
12527 {
12528 m_AdminLog.OnPlacementComplete(player,
this);
12529 }
12530
12531 super.OnPlacementComplete(player, position, orientation);
12532 }
12533
12534
12535
12536
12537
12539 {
12541 {
12542 return true;
12543 }
12544 else
12545 {
12546 return false;
12547 }
12548 }
12549
12550
12552 {
12554 {
12556 }
12557 }
12558
12559
12561 {
12563 }
12564
12566 {
12568 }
12569
12570 override void InsertAgent(
int agent,
float count = 1)
12571 {
12572 if (count < 1)
12573 return;
12574
12576 }
12577
12580 {
12582 }
12583
12584
12586 {
12588 }
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12632 {
12634 return false;
12635 return true;
12636 }
12637
12639 {
12640
12642 }
12643
12644
12647 {
12648 super.CheckForRoofLimited(timeTresholdMS);
12649
12651 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12652 {
12653 m_PreviousRoofTestTime = time;
12654 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12655 }
12656 }
12657
12658
12660 {
12662 {
12663 return 0;
12664 }
12665
12666 if (GetInventory().GetAttachmentSlotsCount() != 0)
12667 {
12668 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12669 if (filter)
12670 return filter.GetProtectionLevel(type, false, system);
12671 else
12672 return 0;
12673 }
12674
12675 string subclassPath, entryName;
12676
12677 switch (type)
12678 {
12680 entryName = "biological";
12681 break;
12683 entryName = "chemical";
12684 break;
12685 default:
12686 entryName = "biological";
12687 break;
12688 }
12689
12690 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12691
12693 }
12694
12695
12696
12699 {
12700 if (!IsMagazine())
12702
12704 }
12705
12706
12707
12708
12709
12714 {
12715 return true;
12716 }
12717
12719 {
12721 }
12722
12723
12724
12725
12726
12728 {
12729 if (parent)
12730 {
12731 if (parent.IsInherited(DayZInfected))
12732 return true;
12733
12734 if (!parent.IsRuined())
12735 return true;
12736 }
12737
12738 return true;
12739 }
12740
12742 {
12743 if (!super.CanPutAsAttachment(parent))
12744 {
12745 return false;
12746 }
12747
12748 if (!IsRuined() && !parent.IsRuined())
12749 {
12750 return true;
12751 }
12752
12753 return false;
12754 }
12755
12757 {
12758
12759
12760
12761
12762 return super.CanReceiveItemIntoCargo(item);
12763 }
12764
12766 {
12767
12768
12769
12770
12771 GameInventory attachmentInv = attachment.GetInventory();
12773 {
12774 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12775 return false;
12776 }
12777
12778 InventoryLocation loc = new InventoryLocation();
12779 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12780 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12781 return false;
12782
12783 return super.CanReceiveAttachment(attachment, slotId);
12784 }
12785
12787 {
12788 if (!super.CanReleaseAttachment(attachment))
12789 return false;
12790
12791 return GetInventory().AreChildrenAccessible();
12792 }
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12815 {
12816 int id = muzzle_owner.GetMuzzleID();
12817 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12818
12819 if (WPOF_array)
12820 {
12821 for (int i = 0; i < WPOF_array.Count(); i++)
12822 {
12823 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12824
12825 if (WPOF)
12826 {
12827 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12828 }
12829 }
12830 }
12831 }
12832
12833
12835 {
12836 int id = muzzle_owner.GetMuzzleID();
12838
12839 if (WPOBE_array)
12840 {
12841 for (int i = 0; i < WPOBE_array.Count(); i++)
12842 {
12843 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12844
12845 if (WPOBE)
12846 {
12847 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12848 }
12849 }
12850 }
12851 }
12852
12853
12855 {
12856 int id = muzzle_owner.GetMuzzleID();
12857 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12858
12859 if (WPOOH_array)
12860 {
12861 for (int i = 0; i < WPOOH_array.Count(); i++)
12862 {
12863 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12864
12865 if (WPOOH)
12866 {
12867 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12868 }
12869 }
12870 }
12871 }
12872
12873
12875 {
12876 int id = muzzle_owner.GetMuzzleID();
12877 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12878
12879 if (WPOOH_array)
12880 {
12881 for (int i = 0; i < WPOOH_array.Count(); i++)
12882 {
12883 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12884
12885 if (WPOOH)
12886 {
12887 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12888 }
12889 }
12890 }
12891 }
12892
12893
12895 {
12896 int id = muzzle_owner.GetMuzzleID();
12897 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12898
12899 if (WPOOH_array)
12900 {
12901 for (int i = 0; i < WPOOH_array.Count(); i++)
12902 {
12903 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12904
12905 if (WPOOH)
12906 {
12907 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12908 }
12909 }
12910 }
12911 }
12912
12913
12914
12916 {
12918 {
12919 return true;
12920 }
12921
12922 return false;
12923 }
12924
12926 {
12928 {
12929 return true;
12930 }
12931
12932 return false;
12933 }
12934
12936 {
12938 {
12939 return true;
12940 }
12941
12942 return false;
12943 }
12944
12946 {
12947 return false;
12948 }
12949
12952 {
12953 return UATimeSpent.DEFAULT_DEPLOY;
12954 }
12955
12956
12957
12958
12960 {
12962 SetSynchDirty();
12963 }
12964
12966 {
12968 }
12969
12970
12972 {
12973 return false;
12974 }
12975
12978 {
12979 string att_type = "None";
12980
12981 if (ConfigIsExisting("soundAttType"))
12982 {
12983 att_type = ConfigGetString("soundAttType");
12984 }
12985
12987 }
12988
12990 {
12992 }
12993
12994
12995
12996
12997
13003
13005 {
13008
13010 }
13011
13012
13014 {
13016 return;
13017
13019
13022
13025
13026 SoundParameters params = new SoundParameters();
13030 }
13031
13032
13034 {
13036 return;
13037
13039 SetSynchDirty();
13040
13043 }
13044
13045
13047 {
13049 return;
13050
13052 SetSynchDirty();
13053
13056 }
13057
13059 {
13061 }
13062
13064 {
13066 }
13067
13070 {
13071 if (!
GetGame().IsDedicatedServer())
13072 {
13073 if (ConfigIsExisting("attachSoundSet"))
13074 {
13075 string cfg_path = "";
13076 string soundset = "";
13077 string type_name =
GetType();
13078
13081 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13082 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13083
13084 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13085 {
13086 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13087 {
13088 if (cfg_slot_array[i] == slot_type)
13089 {
13090 soundset = cfg_soundset_array[i];
13091 break;
13092 }
13093 }
13094 }
13095
13096 if (soundset != "")
13097 {
13098 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13100 }
13101 }
13102 }
13103 }
13104
13106 {
13107
13108 }
13109
13110 void OnApply(PlayerBase player);
13111
13113 {
13114 return 1.0;
13115 };
13116
13118 {
13120 }
13121
13123 {
13125 }
13126
13128
13130 {
13131 SetDynamicPhysicsLifeTime(0.01);
13133 }
13134
13136 {
13137 array<string> zone_names = new array<string>;
13138 GetDamageZones(zone_names);
13139 for (int i = 0; i < zone_names.Count(); i++)
13140 {
13141 SetHealthMax(zone_names.Get(i),"Health");
13142 }
13143 SetHealthMax("","Health");
13144 }
13145
13148 {
13149 float global_health = GetHealth01("","Health");
13150 array<string> zones = new array<string>;
13151 GetDamageZones(zones);
13152
13153 for (int i = 0; i < zones.Count(); i++)
13154 {
13155 SetHealth01(zones.Get(i),"Health",global_health);
13156 }
13157 }
13158
13161 {
13162 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13163 }
13164
13166 {
13167 if (!hasRootAsPlayer)
13168 {
13169 if (refParentIB)
13170 {
13171
13172 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13173 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13174
13175 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13176 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13177
13180 }
13181 else
13182 {
13183
13186 }
13187 }
13188 }
13189
13191 {
13193 {
13194 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13195 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13196 {
13197 float heatPermCoef = 1.0;
13199 while (ent)
13200 {
13201 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13202 ent = ent.GetHierarchyParent();
13203 }
13204
13205 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13206 }
13207 }
13208 }
13209
13211 {
13212
13213 EntityAI parent = GetHierarchyParent();
13214 if (!parent)
13215 {
13216 hasParent = false;
13217 hasRootAsPlayer = false;
13218 }
13219 else
13220 {
13221 hasParent = true;
13222 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13223 refParentIB =
ItemBase.Cast(parent);
13224 }
13225 }
13226
13227 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13228 {
13229
13230 }
13231
13233 {
13234
13235 return false;
13236 }
13237
13239 {
13240
13241
13242 return false;
13243 }
13244
13246 {
13247
13248 return false;
13249 }
13250
13253 {
13254 return !GetIsFrozen() &&
IsOpen();
13255 }
13256
13258 {
13259 bool hasParent = false, hasRootAsPlayer = false;
13261
13262 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13263 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13264
13265 if (wwtu || foodDecay)
13266 {
13270
13271 if (processWetness || processTemperature || processDecay)
13272 {
13274
13275 if (processWetness)
13276 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13277
13278 if (processTemperature)
13280
13281 if (processDecay)
13282 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13283 }
13284 }
13285 }
13286
13289 {
13291 }
13292
13294 {
13297
13298 return super.GetTemperatureFreezeThreshold();
13299 }
13300
13302 {
13305
13306 return super.GetTemperatureThawThreshold();
13307 }
13308
13310 {
13313
13314 return super.GetItemOverheatThreshold();
13315 }
13316
13318 {
13320 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13321
13322 return super.GetTemperatureFreezeTime();
13323 }
13324
13326 {
13328 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13329
13330 return super.GetTemperatureThawTime();
13331 }
13332
13337
13339 {
13340 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13341 }
13342
13344 {
13345 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13346 }
13347
13350 {
13352 }
13353
13355 {
13357 }
13358
13360 {
13362 }
13363
13366 {
13367 return null;
13368 }
13369
13372 {
13373 return false;
13374 }
13375
13377 {
13379 {
13382 if (!trg)
13383 {
13385 explosive = this;
13386 }
13387
13388 explosive.PairRemote(trg);
13390
13391 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13392 trg.SetPersistentPairID(persistentID);
13393 explosive.SetPersistentPairID(persistentID);
13394
13395 return true;
13396 }
13397 return false;
13398 }
13399
13402 {
13403 float ret = 1.0;
13406 ret *= GetHealth01();
13407
13408 return ret;
13409 }
13410
13411 #ifdef DEVELOPER
13412 override void SetDebugItem()
13413 {
13414 super.SetDebugItem();
13415 _itemBase = this;
13416 }
13417
13419 {
13420 string text = super.GetDebugText();
13421
13423 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13424
13425 return text;
13426 }
13427 #endif
13428
13430 {
13431 return true;
13432 }
13433
13435
13437
13439 {
13442 }
13443
13444
13452
13468}
13469
13471{
13473 if (entity)
13474 {
13475 bool is_item = entity.IsInherited(
ItemBase);
13476 if (is_item && full_quantity)
13477 {
13480 }
13481 }
13482 else
13483 {
13485 return NULL;
13486 }
13487 return entity;
13488}
13489
13491{
13492 if (item)
13493 {
13494 if (health > 0)
13495 item.SetHealth("", "", health);
13496
13497 if (item.CanHaveTemperature())
13498 {
13500 if (item.CanFreeze())
13501 item.SetFrozen(false);
13502 }
13503
13504 if (item.HasEnergyManager())
13505 {
13506 if (quantity >= 0)
13507 {
13508 item.GetCompEM().SetEnergy0To1(quantity);
13509 }
13510 else
13511 {
13513 }
13514 }
13515 else if (item.IsMagazine())
13516 {
13517 Magazine mag = Magazine.Cast(item);
13518 if (quantity >= 0)
13519 {
13520 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13521 }
13522 else
13523 {
13525 }
13526
13527 }
13528 else
13529 {
13530 if (quantity >= 0)
13531 {
13532 item.SetQuantityNormalized(quantity, false);
13533 }
13534 else
13535 {
13537 }
13538
13539 }
13540 }
13541}
13542
13543#ifdef DEVELOPER
13545#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.