8628{
8630 {
8631 return true;
8632 }
8633};
8634
8635
8636
8638{
8642
8644
8647
8648
8649
8650
8651
8660
8666
8671
8676
8697 protected bool m_IsResultOfSplit
8698
8700
8705
8706
8707
8709
8713
8714
8715
8717
8720
8721
8722
8728
8729
8737
8740
8741
8743
8744
8746
8747
8752
8753
8758
8759
8761
8762
8764 {
8769
8770 if (!
GetGame().IsDedicatedServer())
8771 {
8773 {
8775
8777 {
8779 }
8780 }
8781
8784 }
8785
8786 m_OldLocation = null;
8787
8789 {
8791 }
8792
8793 if (ConfigIsExisting("headSelectionsToHide"))
8794 {
8797 }
8798
8800 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8801 {
8803 }
8804
8806
8807 m_IsResultOfSplit = false;
8808
8810 }
8811
8813 {
8814 super.InitItemVariables();
8815
8821 m_Count = ConfigGetInt(
"count");
8822
8825
8830
8833
8838
8850
8854
8855
8858 if (ConfigIsExisting("canBeSplit"))
8859 {
8862 }
8863
8865 if (ConfigIsExisting("itemBehaviour"))
8867
8868
8871 RegisterNetSyncVariableInt("m_VarLiquidType");
8872 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8873
8874 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8875 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8876 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8877
8878 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8879 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8880 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8881 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8882
8883 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8884 RegisterNetSyncVariableBool("m_IsTakeable");
8885 RegisterNetSyncVariableBool("m_IsHologram");
8886
8889 {
8892 }
8893
8895
8897 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8899
8900 }
8901
8903 {
8905 }
8906
8908 {
8911 {
8916 }
8917 }
8918
8919 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8920 {
8922 {
8925 }
8926
8928 }
8929
8931 {
8937 }
8938
8940
8942 {
8944
8945 if (!action)
8946 {
8947 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8948 return;
8949 }
8950
8952 if (!ai)
8953 {
8955 return;
8956 }
8957
8959 if (!action_array)
8960 {
8961 action_array = new array<ActionBase_Basic>;
8963 }
8964 if (LogManager.IsActionLogEnable())
8965 {
8966 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8967 }
8968
8969 if (action_array.Find(action) != -1)
8970 {
8971 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8972 }
8973 else
8974 {
8975 action_array.Insert(action);
8976 }
8977 }
8978
8980 {
8982 ActionBase action = player.GetActionManager().GetAction(actionName);
8985
8986 if (action_array)
8987 {
8988 action_array.RemoveItem(action);
8989 }
8990 }
8991
8992
8993
8995 {
8996 ActionOverrideData overrideData = new ActionOverrideData();
9000
9002 if (!actionMap)
9003 {
9006 }
9007
9008 actionMap.Insert(this.
Type(), overrideData);
9009
9010 }
9011
9013
9015
9016
9018 {
9021
9024
9025 string config_to_search = "CfgVehicles";
9026 string muzzle_owner_config;
9027
9029 {
9030 if (IsInherited(Weapon))
9031 config_to_search = "CfgWeapons";
9032
9033 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9034
9035 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9036
9038
9039 if (config_OnFire_subclass_count > 0)
9040 {
9041 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9042
9043 for (int i = 0; i < config_OnFire_subclass_count; i++)
9044 {
9045 string particle_class = "";
9047 string config_OnFire_entry = config_OnFire_class + particle_class;
9048 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9049 WPOF_array.Insert(WPOF);
9050 }
9051
9052
9054 }
9055 }
9056
9058 {
9059 config_to_search = "CfgWeapons";
9060 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9061
9062 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9063
9065
9066 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9067 {
9068 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9069
9070 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9071 {
9072 string particle_class2 = "";
9074 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9075 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9076 WPOBE_array.Insert(WPOBE);
9077 }
9078
9079
9081 }
9082 }
9083 }
9084
9085
9087 {
9090
9092 {
9093 string config_to_search = "CfgVehicles";
9094
9095 if (IsInherited(Weapon))
9096 config_to_search = "CfgWeapons";
9097
9098 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9099 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9100
9101 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9102 {
9103
9105
9107 {
9109 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9111 return;
9112 }
9113
9116
9117
9118
9120 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9121
9122 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9123 {
9124 string particle_class = "";
9126 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9128
9129 if (entry_type == CT_CLASS)
9130 {
9131 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9132 WPOOH_array.Insert(WPOF);
9133 }
9134 }
9135
9136
9138 }
9139 }
9140 }
9141
9143 {
9145 }
9146
9148 {
9150 {
9152
9155
9158
9159 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9160 }
9161 }
9162
9164 {
9166 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9167
9169 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9170
9172 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9173
9175 {
9177 }
9178 }
9179
9181 {
9183 }
9184
9186 {
9189 else
9191
9193 {
9196 }
9197 else
9198 {
9201
9204 }
9205
9207 }
9208
9210 {
9212 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9213 }
9214
9216 {
9218 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9220 }
9221
9223 {
9225 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9226 }
9227
9229 {
9232
9233 OverheatingParticle OP = new OverheatingParticle();
9238
9240 }
9241
9243 {
9246
9247 return -1;
9248 }
9249
9251 {
9253 {
9256
9257 for (int i = count; i > 0; --i)
9258 {
9259 int id = i - 1;
9262
9265
9266 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9267 {
9268 if (p)
9269 {
9272 }
9273 }
9274 }
9275 }
9276 }
9277
9279 {
9281 {
9283 {
9284 int id = i - 1;
9286
9287 if (OP)
9288 {
9290
9291 if (p)
9292 {
9294 }
9295
9296 delete OP;
9297 }
9298 }
9299
9302 }
9303 }
9304
9307 {
9308 return 0.0;
9309 }
9310
9311
9313 {
9314 return 250;
9315 }
9316
9318 {
9319 return 0;
9320 }
9321
9324 {
9326 return true;
9327
9328 return false;
9329 }
9330
9333 {
9336
9338 {
9340 }
9341 else
9342 {
9343
9345 }
9346
9348 }
9349
9356 {
9357 return -1;
9358 }
9359
9360
9361
9362
9364 {
9366 {
9368 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9369
9370 if (r_index >= 0)
9371 {
9372 InventoryLocation r_il = new InventoryLocation;
9373 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9374
9375 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9378 {
9379 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9380 }
9382 {
9383 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9384 }
9385
9386 }
9387
9388 player.GetHumanInventory().ClearUserReservedLocation(this);
9389 }
9390
9393 }
9394
9395
9396
9397
9399 {
9400 return ItemBase.m_DebugActionsMask;
9401 }
9402
9404 {
9405 return ItemBase.m_DebugActionsMask & mask;
9406 }
9407
9409 {
9410 ItemBase.m_DebugActionsMask = mask;
9411 }
9412
9414 {
9415 ItemBase.m_DebugActionsMask |= mask;
9416 }
9417
9419 {
9420 ItemBase.m_DebugActionsMask &= ~mask;
9421 }
9422
9424 {
9426 {
9428 }
9429 else
9430 {
9432 }
9433 }
9434
9435
9437 {
9438 if (GetEconomyProfile())
9439 {
9440 float q_max = GetEconomyProfile().GetQuantityMax();
9441 if (q_max > 0)
9442 {
9443 float q_min = GetEconomyProfile().GetQuantityMin();
9444 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9445
9447 {
9448 ComponentEnergyManager comp = GetCompEM();
9450 {
9452 }
9453 }
9455 {
9457
9458 }
9459
9460 }
9461 }
9462 }
9463
9466 {
9467 EntityAI parent = GetHierarchyParent();
9468
9469 if (parent)
9470 {
9471 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9472 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9473 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9474 }
9475 }
9476
9479 {
9480 EntityAI parent = GetHierarchyParent();
9481
9482 if (parent)
9483 {
9484 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9485 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9486 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9487 }
9488 }
9489
9491 {
9492
9493
9494
9495
9497
9499 {
9500 if (ScriptInputUserData.CanStoreInputUserData())
9501 {
9502 ScriptInputUserData ctx = new ScriptInputUserData;
9508 ctx.
Write(use_stack_max);
9511
9513 {
9514 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9515 }
9516 }
9517 }
9518 else if (!
GetGame().IsMultiplayer())
9519 {
9521 }
9522 }
9523
9525 {
9527 }
9528
9530 {
9532 }
9533
9535 {
9537 }
9538
9540 {
9541
9542 return false;
9543 }
9544
9546 {
9547 return false;
9548 }
9549
9553 {
9554 return false;
9555 }
9556
9558 {
9559 return "";
9560 }
9561
9563
9565 {
9566 return false;
9567 }
9568
9570 {
9571 return true;
9572 }
9573
9574
9575
9577 {
9578 return true;
9579 }
9580
9582 {
9583 return true;
9584 }
9585
9587 {
9588 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9590 }
9591
9593 {
9595 }
9596
9598 {
9600 if (!is_being_placed)
9602 SetSynchDirty();
9603 }
9604
9605
9607
9609 {
9611 }
9612
9614 {
9616 }
9617
9619 {
9620 return 1;
9621 }
9622
9624 {
9625 return false;
9626 }
9627
9629 {
9631 SetSynchDirty();
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
9660
9661
9662
9663
9664
9665
9666
9667
9669 {
9670 super.OnMovedInsideCargo(container);
9671
9672 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9673 }
9674
9675 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9676 {
9677 super.EEItemLocationChanged(oldLoc,newLoc);
9678
9679 PlayerBase new_player = null;
9680 PlayerBase old_player = null;
9681
9682 if (newLoc.GetParent())
9683 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9684
9685 if (oldLoc.GetParent())
9686 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9687
9689 {
9690 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9691
9692 if (r_index >= 0)
9693 {
9694 InventoryLocation r_il = new InventoryLocation;
9695 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9696
9697 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9700 {
9701 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9702 }
9704 {
9705 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9706 }
9707
9708 }
9709 }
9710
9712 {
9713 if (new_player)
9714 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9715
9716 if (new_player == old_player)
9717 {
9718
9719 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9720 {
9722 {
9723 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9724 {
9725 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9726 }
9727 }
9728 else
9729 {
9730 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9731 }
9732 }
9733
9734 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9735 {
9736 int type = oldLoc.GetType();
9738 {
9739 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9740 }
9742 {
9743 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9744 }
9745 }
9746 if (!m_OldLocation)
9747 {
9748 m_OldLocation = new InventoryLocation;
9749 }
9750 m_OldLocation.Copy(oldLoc);
9751 }
9752 else
9753 {
9754 if (m_OldLocation)
9755 {
9756 m_OldLocation.Reset();
9757 }
9758 }
9759
9761 }
9762 else
9763 {
9764 if (new_player)
9765 {
9766 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9767 if (res_index >= 0)
9768 {
9769 InventoryLocation il = new InventoryLocation;
9770 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9772 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9775 {
9776 il.
GetParent().GetOnReleaseLock().Invoke(it);
9777 }
9779 {
9781 }
9782
9783 }
9784 }
9786 {
9787
9789 }
9790
9791 if (m_OldLocation)
9792 {
9793 m_OldLocation.Reset();
9794 }
9795 }
9796 }
9797
9798 override void EOnContact(IEntity other, Contact extra)
9799 {
9801 {
9802 int liquidType = -1;
9804 if (impactSpeed > 0.0)
9805 {
9807 #ifndef SERVER
9809 #else
9811 SetSynchDirty();
9812 #endif
9814 }
9815 }
9816
9817 #ifdef SERVER
9818 if (GetCompEM() && GetCompEM().IsPlugged())
9819 {
9820 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9821 GetCompEM().UnplugThis();
9822 }
9823 #endif
9824 }
9825
9827
9829 {
9831 }
9832
9834 {
9835
9836 }
9837
9839 {
9840 super.OnItemLocationChanged(old_owner, new_owner);
9841
9842 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9843 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9844
9845 if (!relatedPlayer && playerNew)
9846 relatedPlayer = playerNew;
9847
9848 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9849 {
9851 if (actionMgr)
9852 {
9853 ActionBase currentAction = actionMgr.GetRunningAction();
9854 if (currentAction)
9856 }
9857 }
9858
9859 Man ownerPlayerOld = null;
9860 Man ownerPlayerNew = null;
9861
9862 if (old_owner)
9863 {
9864 if (old_owner.
IsMan())
9865 {
9866 ownerPlayerOld = Man.Cast(old_owner);
9867 }
9868 else
9869 {
9870 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9871 }
9872 }
9873 else
9874 {
9876 {
9878
9879 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9880 {
9881 GetCompEM().UnplugThis();
9882 }
9883 }
9884 }
9885
9886 if (new_owner)
9887 {
9888 if (new_owner.
IsMan())
9889 {
9890 ownerPlayerNew = Man.Cast(new_owner);
9891 }
9892 else
9893 {
9894 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9895 }
9896 }
9897
9898 if (ownerPlayerOld != ownerPlayerNew)
9899 {
9900 if (ownerPlayerOld)
9901 {
9902 array<EntityAI> subItemsExit = new array<EntityAI>;
9904 for (int i = 0; i < subItemsExit.Count(); i++)
9905 {
9908 }
9909 }
9910
9911 if (ownerPlayerNew)
9912 {
9913 array<EntityAI> subItemsEnter = new array<EntityAI>;
9915 for (int j = 0; j < subItemsEnter.Count(); j++)
9916 {
9919 }
9920 }
9921 }
9922 else if (ownerPlayerNew != null)
9923 {
9924 PlayerBase nplayer;
9925 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9926 {
9927 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9929 for (int k = 0; k < subItemsUpdate.Count(); k++)
9930 {
9932 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9933 }
9934 }
9935 }
9936
9937 if (old_owner)
9938 old_owner.OnChildItemRemoved(this);
9939 if (new_owner)
9940 new_owner.OnChildItemReceived(this);
9941 }
9942
9943
9945 {
9946 super.EEDelete(parent);
9947 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9948 if (player)
9949 {
9951
9952 if (player.IsAlive())
9953 {
9954 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9955 if (r_index >= 0)
9956 {
9957 InventoryLocation r_il = new InventoryLocation;
9958 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9959
9960 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9963 {
9964 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9965 }
9967 {
9968 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9969 }
9970
9971 }
9972
9973 player.RemoveQuickBarEntityShortcut(this);
9974 }
9975 }
9976 }
9977
9979 {
9980 super.EEKilled(killer);
9981
9984 {
9985 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9986 {
9987 if (IsMagazine())
9988 {
9989 if (Magazine.Cast(this).GetAmmoCount() > 0)
9990 {
9992 }
9993 }
9994 else
9995 {
9997 }
9998 }
9999 }
10000 }
10001
10003 {
10004 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10005
10006 super.OnWasAttached(parent, slot_id);
10007
10010
10012 }
10013
10015 {
10016 super.OnWasDetached(parent, slot_id);
10017
10020 }
10021
10023 {
10024 int idx;
10027
10028 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10029 if (inventory_slots.Count() < 1)
10030 {
10031 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10032 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10033 }
10034 else
10035 {
10036 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10037 }
10038
10039 idx = inventory_slots.Find(slot);
10040 if (idx < 0)
10041 return "";
10042
10043 return attach_types.Get(idx);
10044 }
10045
10047 {
10048 int idx = -1;
10049 string slot;
10050
10053
10054 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10055 if (inventory_slots.Count() < 1)
10056 {
10057 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10058 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10059 }
10060 else
10061 {
10062 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10063 if (detach_types.Count() < 1)
10064 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10065 }
10066
10067 for (int i = 0; i < inventory_slots.Count(); i++)
10068 {
10069 slot = inventory_slots.Get(i);
10070 }
10071
10072 if (slot != "")
10073 {
10074 if (detach_types.Count() == 1)
10075 idx = 0;
10076 else
10077 idx = inventory_slots.Find(slot);
10078 }
10079 if (idx < 0)
10080 return "";
10081
10082 return detach_types.Get(idx);
10083 }
10084
10086 {
10087
10089
10090
10091 float min_time = 1;
10092 float max_time = 3;
10093 float delay = Math.RandomFloat(min_time, max_time);
10094
10095 explode_timer.Run(delay, this, "DoAmmoExplosion");
10096 }
10097
10099 {
10100 Magazine magazine = Magazine.Cast(this);
10101 int pop_sounds_count = 6;
10102 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10103
10104
10105 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10106 string sound_name = pop_sounds[ sound_idx ];
10108
10109
10110 magazine.ServerAddAmmoCount(-1);
10111
10112
10113 float min_temp_to_explode = 100;
10114
10115 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10116 {
10118 }
10119 }
10120
10121
10122 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10123 {
10124 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10125
10126 const int CHANCE_DAMAGE_CARGO = 4;
10127 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10128 const int CHANCE_DAMAGE_NOTHING = 2;
10129
10131 {
10132 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10133 int chances;
10134 int rnd;
10135
10136 if (GetInventory().GetCargo())
10137 {
10138 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10139 rnd = Math.RandomInt(0,chances);
10140
10141 if (rnd < CHANCE_DAMAGE_CARGO)
10142 {
10144 }
10145 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10146 {
10148 }
10149 }
10150 else
10151 {
10152 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10153 rnd = Math.RandomInt(0,chances);
10154
10155 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10156 {
10158 }
10159 }
10160 }
10161 }
10162
10164 {
10165 if (GetInventory().GetCargo())
10166 {
10167 int item_count = GetInventory().GetCargo().GetItemCount();
10168 if (item_count > 0)
10169 {
10170 int random_pick = Math.RandomInt(0, item_count);
10172 if (!item.IsExplosive())
10173 {
10174 item.AddHealth("","",damage);
10175 return true;
10176 }
10177 }
10178 }
10179 return false;
10180 }
10181
10183 {
10184 int attachment_count = GetInventory().AttachmentCount();
10185 if (attachment_count > 0)
10186 {
10187 int random_pick = Math.RandomInt(0, attachment_count);
10188 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10189 if (!attachment.IsExplosive())
10190 {
10191 attachment.AddHealth("","",damage);
10192 return true;
10193 }
10194 }
10195 return false;
10196 }
10197
10199 {
10201 }
10202
10204 {
10206 return GetInventory().CanRemoveEntity();
10207
10208 return false;
10209 }
10210
10212 {
10213
10215 return false;
10216
10217
10219 return false;
10220
10221
10222
10224 if (delta == 0)
10225 return false;
10226
10227
10228 return true;
10229 }
10230
10232 {
10234 {
10235 if (ScriptInputUserData.CanStoreInputUserData())
10236 {
10237 ScriptInputUserData ctx = new ScriptInputUserData;
10242 ctx.
Write(destination_entity);
10244 ctx.
Write(slot_id);
10246 }
10247 }
10248 else if (!
GetGame().IsMultiplayer())
10249 {
10251 }
10252 }
10253
10255 {
10256 float split_quantity_new;
10260 InventoryLocation loc = new InventoryLocation;
10261
10262 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10263 {
10265 split_quantity_new = stack_max;
10266 else
10268
10270 {
10271 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10272 if (new_item)
10273 {
10274 new_item.SetResultOfSplit(true);
10275 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10277 new_item.
SetQuantity(split_quantity_new,
false,
true);
10278 }
10279 }
10280 }
10281 else if (destination_entity && slot_id == -1)
10282 {
10283 if (quantity > stack_max)
10284 split_quantity_new = stack_max;
10285 else
10286 split_quantity_new = quantity;
10287
10289 {
10291 {
10294 }
10295
10296 if (new_item)
10297 {
10298 new_item.SetResultOfSplit(true);
10299 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10301 new_item.
SetQuantity(split_quantity_new,
false,
true);
10302 }
10303 }
10304 }
10305 else
10306 {
10307 if (stack_max != 0)
10308 {
10310 {
10312 }
10313
10314 if (split_quantity_new == 0)
10315 {
10316 if (!
GetGame().IsMultiplayer())
10317 player.PhysicalPredictiveDropItem(this);
10318 else
10319 player.ServerDropEntity(this);
10320 return;
10321 }
10322
10324 {
10326
10327 if (new_item)
10328 {
10329 new_item.SetResultOfSplit(true);
10330 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10333 new_item.PlaceOnSurface();
10334 }
10335 }
10336 }
10337 }
10338 }
10339
10341 {
10342 float split_quantity_new;
10346 InventoryLocation loc = new InventoryLocation;
10347
10348 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10349 {
10351 split_quantity_new = stack_max;
10352 else
10354
10356 {
10357 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10358 if (new_item)
10359 {
10360 new_item.SetResultOfSplit(true);
10361 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10363 new_item.
SetQuantity(split_quantity_new,
false,
true);
10364 }
10365 }
10366 }
10367 else if (destination_entity && slot_id == -1)
10368 {
10369 if (quantity > stack_max)
10370 split_quantity_new = stack_max;
10371 else
10372 split_quantity_new = quantity;
10373
10375 {
10377 {
10380 }
10381
10382 if (new_item)
10383 {
10384 new_item.SetResultOfSplit(true);
10385 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10387 new_item.
SetQuantity(split_quantity_new,
false,
true);
10388 }
10389 }
10390 }
10391 else
10392 {
10393 if (stack_max != 0)
10394 {
10396 {
10398 }
10399
10401 {
10403
10404 if (new_item)
10405 {
10406 new_item.SetResultOfSplit(true);
10407 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10410 new_item.PlaceOnSurface();
10411 }
10412 }
10413 }
10414 }
10415 }
10416
10418 {
10420 {
10421 if (ScriptInputUserData.CanStoreInputUserData())
10422 {
10423 ScriptInputUserData ctx = new ScriptInputUserData;
10428 dst.WriteToContext(ctx);
10430 }
10431 }
10432 else if (!
GetGame().IsMultiplayer())
10433 {
10435 }
10436 }
10437
10439 {
10441 {
10442 if (ScriptInputUserData.CanStoreInputUserData())
10443 {
10444 ScriptInputUserData ctx = new ScriptInputUserData;
10449 ctx.
Write(destination_entity);
10455 }
10456 }
10457 else if (!
GetGame().IsMultiplayer())
10458 {
10460 }
10461 }
10462
10464 {
10466 }
10467
10469 {
10471 float split_quantity_new;
10473 if (dst.IsValid())
10474 {
10475 int slot_id = dst.GetSlot();
10477
10478 if (quantity > stack_max)
10479 split_quantity_new = stack_max;
10480 else
10481 split_quantity_new = quantity;
10482
10484 {
10486
10487 if (new_item)
10488 {
10489 new_item.SetResultOfSplit(true);
10490 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10492 new_item.
SetQuantity(split_quantity_new,
false,
true);
10493 }
10494
10495 return new_item;
10496 }
10497 }
10498
10499 return null;
10500 }
10501
10503 {
10505 float split_quantity_new;
10507 if (destination_entity)
10508 {
10510 if (quantity > stackable)
10511 split_quantity_new = stackable;
10512 else
10513 split_quantity_new = quantity;
10514
10516 {
10517 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10518 if (new_item)
10519 {
10520 new_item.SetResultOfSplit(true);
10521 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10523 new_item.
SetQuantity(split_quantity_new,
false,
true);
10524 }
10525 }
10526 }
10527 }
10528
10530 {
10532 {
10533 if (ScriptInputUserData.CanStoreInputUserData())
10534 {
10535 ScriptInputUserData ctx = new ScriptInputUserData;
10540 ItemBase destination_entity =
this;
10541 ctx.
Write(destination_entity);
10545 }
10546 }
10547 else if (!
GetGame().IsMultiplayer())
10548 {
10550 }
10551 }
10552
10554 {
10556 float split_quantity_new;
10558 if (player)
10559 {
10561 if (quantity > stackable)
10562 split_quantity_new = stackable;
10563 else
10564 split_quantity_new = quantity;
10565
10567 {
10568 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10569 new_item =
ItemBase.Cast(in_hands);
10570 if (new_item)
10571 {
10572 new_item.SetResultOfSplit(true);
10573 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10575 new_item.SetQuantity(split_quantity_new, false, true);
10576 }
10577 }
10578 }
10579 }
10580
10582 {
10584 float split_quantity_new = Math.Floor(quantity * 0.5);
10585
10587 return;
10588
10590
10591 if (new_item)
10592 {
10593 if (new_item.GetQuantityMax() < split_quantity_new)
10594 {
10595 split_quantity_new = new_item.GetQuantityMax();
10596 }
10597
10598 new_item.SetResultOfSplit(true);
10599 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10600
10602 {
10605 }
10606 else
10607 {
10609 new_item.
SetQuantity(split_quantity_new,
false,
true);
10610 }
10611 }
10612 }
10613
10615 {
10617 float split_quantity_new = Math.Floor(quantity / 2);
10618
10620 return;
10621
10622 InventoryLocation invloc = new InventoryLocation;
10624
10626 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10627
10628 if (new_item)
10629 {
10630 if (new_item.GetQuantityMax() < split_quantity_new)
10631 {
10632 split_quantity_new = new_item.GetQuantityMax();
10633 }
10635 {
10638 }
10639 else if (split_quantity_new > 1)
10640 {
10642 new_item.
SetQuantity(split_quantity_new,
false,
true);
10643 }
10644 }
10645 }
10646
10649 {
10650 SetWeightDirty();
10652
10653 if (parent)
10654 parent.OnAttachmentQuantityChangedEx(this, delta);
10655
10657 {
10659 {
10661 }
10663 {
10664 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10666 }
10667 }
10668
10669 }
10670
10673 {
10674
10675 }
10676
10679 {
10681 }
10682
10684 {
10685 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10686
10688 {
10689 if (newLevel == GameConstants.STATE_RUINED)
10690 {
10692 EntityAI parent = GetHierarchyParent();
10693 if (parent && parent.IsFireplace())
10694 {
10695 CargoBase cargo = GetInventory().GetCargo();
10696 if (cargo)
10697 {
10699 {
10701 }
10702 }
10703 }
10704 }
10705
10707 {
10708
10710 return;
10711 }
10712
10713 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10714 {
10716 }
10717 }
10718 }
10719
10720
10722 {
10723 super.OnRightClick();
10724
10726 {
10728 {
10729 if (ScriptInputUserData.CanStoreInputUserData())
10730 {
10731 EntityAI root = GetHierarchyRoot();
10732 Man playerOwner = GetHierarchyRootPlayer();
10733 InventoryLocation dst = new InventoryLocation;
10734
10735
10736 if (!playerOwner && root && root == this)
10737 {
10739 }
10740 else
10741 {
10742
10743 GetInventory().GetCurrentInventoryLocation(dst);
10745 {
10748 {
10750 }
10751 else
10752 {
10754
10755
10756 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10757 {
10759 }
10760 else
10761 {
10762 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10763 }
10764 }
10765 }
10766 }
10767
10768 ScriptInputUserData ctx = new ScriptInputUserData;
10776 }
10777 }
10778 else if (!
GetGame().IsMultiplayer())
10779 {
10781 }
10782 }
10783 }
10784
10786 {
10787 if (root)
10788 {
10789 vector m4[4];
10790 root.GetTransform(m4);
10791 dst.SetGround(this, m4);
10792 }
10793 else
10794 {
10795 GetInventory().GetCurrentInventoryLocation(dst);
10796 }
10797 }
10798
10799 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10800 {
10801
10802 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10803 return false;
10804
10805 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10806 return false;
10807
10808
10810 return false;
10811
10812
10813 Magazine mag = Magazine.Cast(this);
10814 if (mag)
10815 {
10816 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10817 return false;
10818
10819 if (stack_max_limit)
10820 {
10821 Magazine other_mag = Magazine.Cast(other_item);
10822 if (other_item)
10823 {
10824 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10825 return false;
10826 }
10827
10828 }
10829 }
10830 else
10831 {
10832
10834 return false;
10835
10837 return false;
10838 }
10839
10840 PlayerBase player = null;
10841 if (CastTo(player, GetHierarchyRootPlayer()))
10842 {
10843 if (player.GetInventory().HasAttachment(this))
10844 return false;
10845
10846 if (player.IsItemsToDelete())
10847 return false;
10848 }
10849
10850 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10851 return false;
10852
10853 int slotID;
10855 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10856 return false;
10857
10858 return true;
10859 }
10860
10862 {
10864 }
10865
10867 {
10868 return m_IsResultOfSplit;
10869 }
10870
10872 {
10873 m_IsResultOfSplit = value;
10874 }
10875
10877 {
10879 }
10880
10882 {
10883 float other_item_quantity = other_item.GetQuantity();
10884 float this_free_space;
10885
10887
10889
10890 if (other_item_quantity > this_free_space)
10891 {
10892 return this_free_space;
10893 }
10894 else
10895 {
10896 return other_item_quantity;
10897 }
10898 }
10899
10901 {
10903 }
10904
10906 {
10908 return;
10909
10910 if (!IsMagazine() && other_item)
10911 {
10913 if (quantity_used != 0)
10914 {
10915 float hp1 = GetHealth01("","");
10916 float hp2 = other_item.GetHealth01("","");
10917 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10918 hpResult = hpResult / (
GetQuantity() + quantity_used);
10919
10920 hpResult *= GetMaxHealth();
10921 Math.Round(hpResult);
10922 SetHealth("", "Health", hpResult);
10923
10925 other_item.AddQuantity(-quantity_used);
10926 }
10927 }
10929 }
10930
10932 {
10933 #ifdef SERVER
10934 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10935 GetHierarchyParent().IncreaseLifetimeUp();
10936 #endif
10937 };
10938
10940 {
10941 PlayerBase p = PlayerBase.Cast(player);
10942
10943 array<int> recipesIds = p.m_Recipes;
10944 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10945 if (moduleRecipesManager)
10946 {
10947 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10948 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10949 }
10950
10951 for (int i = 0;i < recipesIds.Count(); i++)
10952 {
10953 int key = recipesIds.Get(i);
10954 string recipeName = moduleRecipesManager.GetRecipeName(key);
10956 }
10957 }
10958
10959
10960 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10961 {
10962 super.GetDebugActions(outputList);
10963
10964
10970
10971
10976
10981
10982
10986
10987
10989 {
10993 }
10994
10997
10998
11002
11004
11005 InventoryLocation loc = new InventoryLocation();
11006 GetInventory().GetCurrentInventoryLocation(loc);
11008 {
11009 if (Gizmo_IsSupported())
11012 }
11013
11015 }
11016
11017
11018
11019
11021 {
11022 super.OnAction(action_id, player, ctx);
11023
11025 {
11026 switch (action_id)
11027 {
11030 return true;
11033 return true;
11034 }
11035 }
11036
11038 {
11039 switch (action_id)
11040 {
11042 Delete();
11043 return true;
11044 }
11045 }
11046
11047 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11048 {
11049 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11050 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11051 PlayerBase p = PlayerBase.Cast(player);
11052 if (
EActions.RECIPES_RANGE_START < 1000)
11053 {
11054 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11055 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11056 }
11057 }
11058 #ifndef SERVER
11059 else if (action_id ==
EActions.WATCH_PLAYER)
11060 {
11061 PluginDeveloper.SetDeveloperItemClientEx(player);
11062 }
11063 #endif
11065 {
11066 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11067 {
11068 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11069 OnDebugButtonPressServer(id + 1);
11070 }
11071
11072 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11073 {
11074 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11076 }
11077
11078 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11079 {
11080 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11082 }
11083
11084 else if (action_id ==
EActions.ADD_QUANTITY)
11085 {
11086 if (IsMagazine())
11087 {
11088 Magazine mag = Magazine.Cast(this);
11089 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11090 }
11091 else
11092 {
11094 }
11095
11096 if (m_EM)
11097 {
11098 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11099 }
11100
11101 }
11102
11103 else if (action_id ==
EActions.REMOVE_QUANTITY)
11104 {
11105 if (IsMagazine())
11106 {
11107 Magazine mag2 = Magazine.Cast(this);
11108 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11109 }
11110 else
11111 {
11113 }
11114 if (m_EM)
11115 {
11116 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11117 }
11118
11119 }
11120
11121 else if (action_id ==
EActions.SET_QUANTITY_0)
11122 {
11124
11125 if (m_EM)
11126 {
11127 m_EM.SetEnergy(0);
11128 }
11129 }
11130
11131 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11132 {
11134
11135 if (m_EM)
11136 {
11137 m_EM.SetEnergy(m_EM.GetEnergyMax());
11138 }
11139 }
11140
11141 else if (action_id ==
EActions.ADD_HEALTH)
11142 {
11143 AddHealth("","",GetMaxHealth("","Health")/5);
11144 }
11145 else if (action_id ==
EActions.REMOVE_HEALTH)
11146 {
11147 AddHealth("","",-GetMaxHealth("","Health")/5);
11148 }
11149 else if (action_id ==
EActions.DESTROY_HEALTH)
11150 {
11151 SetHealth01("","",0);
11152 }
11153 else if (action_id ==
EActions.WATCH_ITEM)
11154 {
11156 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11157 #ifdef DEVELOPER
11158 SetDebugDeveloper_item(this);
11159 #endif
11160 }
11161
11162 else if (action_id ==
EActions.ADD_TEMPERATURE)
11163 {
11164 AddTemperature(20);
11165
11166 }
11167
11168 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11169 {
11170 AddTemperature(-20);
11171
11172 }
11173
11174 else if (action_id ==
EActions.FLIP_FROZEN)
11175 {
11176 SetFrozen(!GetIsFrozen());
11177
11178 }
11179
11180 else if (action_id ==
EActions.ADD_WETNESS)
11181 {
11183
11184 }
11185
11186 else if (action_id ==
EActions.REMOVE_WETNESS)
11187 {
11189
11190 }
11191
11192 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11193 {
11196
11197
11198 }
11199
11200 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11201 {
11204 }
11205
11206 else if (action_id ==
EActions.MAKE_SPECIAL)
11207 {
11208 auto debugParams = DebugSpawnParams.WithPlayer(player);
11209 OnDebugSpawnEx(debugParams);
11210 }
11211
11212 }
11213
11214
11215 return false;
11216 }
11217
11218
11219
11220
11224
11227
11228
11229
11231 {
11232 return false;
11233 }
11234
11235
11237 {
11238 return true;
11239 }
11240
11241
11243 {
11244 return true;
11245 }
11246
11247
11248
11250 {
11251 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11253 }
11254
11257 {
11258 return null;
11259 }
11260
11262 {
11263 return false;
11264 }
11265
11267 {
11268 return false;
11269 }
11270
11274
11275
11277 {
11278 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11279 return module_repairing.CanRepair(this, item_repair_kit);
11280 }
11281
11282
11283 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11284 {
11285 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11286 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11287 }
11288
11289
11291 {
11292
11293
11294
11295
11296
11297
11298
11299
11300 return 1;
11301 }
11302
11303
11304
11306 {
11308 }
11309
11310
11311
11313 {
11315 }
11316
11317
11326 {
11327 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11328
11329 if (player)
11330 {
11331 player.MessageStatus(text);
11332 }
11333 }
11334
11335
11344 {
11345 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11346
11347 if (player)
11348 {
11349 player.MessageAction(text);
11350 }
11351 }
11352
11353
11362 {
11363 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11364
11365 if (player)
11366 {
11367 player.MessageFriendly(text);
11368 }
11369 }
11370
11371
11380 {
11381 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11382
11383 if (player)
11384 {
11385 player.MessageImportant(text);
11386 }
11387 }
11388
11390 {
11391 return true;
11392 }
11393
11394
11395 override bool KindOf(
string tag)
11396 {
11397 bool found = false;
11398 string item_name = this.
GetType();
11401
11402 int array_size = item_tag_array.Count();
11403 for (int i = 0; i < array_size; i++)
11404 {
11405 if (item_tag_array.Get(i) == tag)
11406 {
11407 found = true;
11408 break;
11409 }
11410 }
11411 return found;
11412 }
11413
11414
11416 {
11417
11418 super.OnRPC(sender, rpc_type,ctx);
11419
11420
11421 switch (rpc_type)
11422 {
11423 #ifndef SERVER
11424 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11425 Param2<bool, string> p = new Param2<bool, string>(false, "");
11426
11428 return;
11429
11430 bool play = p.param1;
11431 string soundSet = p.param2;
11432
11433 if (play)
11434 {
11436 {
11438 {
11440 }
11441 }
11442 else
11443 {
11445 }
11446 }
11447 else
11448 {
11450 }
11451
11452 break;
11453 #endif
11454
11455 }
11456
11458 {
11460 }
11461 }
11462
11463
11464
11465
11467 {
11468 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11469 return plugin.GetID(
name);
11470 }
11471
11473 {
11474 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11475 return plugin.GetName(id);
11476 }
11477
11480 {
11481
11482
11483 int varFlags;
11484 if (!ctx.
Read(varFlags))
11485 return;
11486
11487 if (varFlags & ItemVariableFlags.FLOAT)
11488 {
11490 }
11491 }
11492
11494 {
11495
11496 super.SerializeNumericalVars(floats_out);
11497
11498
11499
11501 {
11503 }
11504
11506 {
11508 }
11509
11511 {
11513 }
11514
11516 {
11521 }
11522
11524 {
11526 }
11527 }
11528
11530 {
11531
11532 super.DeSerializeNumericalVars(floats);
11533
11534
11535 int index = 0;
11536 int mask = Math.Round(floats.Get(index));
11537
11538 index++;
11539
11541 {
11543 {
11545 }
11546 else
11547 {
11548 float quantity = floats.Get(index);
11549 SetQuantity(quantity,
true,
false,
false,
false);
11550 }
11551 index++;
11552 }
11553
11555 {
11556 float wet = floats.Get(index);
11558 index++;
11559 }
11560
11562 {
11563 int liquidtype = Math.Round(floats.Get(index));
11565 index++;
11566 }
11567
11569 {
11571 index++;
11573 index++;
11575 index++;
11577 index++;
11578 }
11579
11581 {
11582 int cleanness = Math.Round(floats.Get(index));
11584 index++;
11585 }
11586 }
11587
11589 {
11590 super.WriteVarsToCTX(ctx);
11591
11592
11594 {
11596 }
11597
11599 {
11601 }
11602
11604 {
11606 }
11607
11609 {
11610 int r,g,b,a;
11616 }
11617
11619 {
11621 }
11622 }
11623
11625 {
11626 if (!super.ReadVarsFromCTX(ctx,version))
11627 return false;
11628
11629 int intValue;
11630 float value;
11631
11632 if (version < 140)
11633 {
11634 if (!ctx.
Read(intValue))
11635 return false;
11636
11637 m_VariablesMask = intValue;
11638 }
11639
11641 {
11642 if (!ctx.
Read(value))
11643 return false;
11644
11646 {
11648 }
11649 else
11650 {
11652 }
11653 }
11654
11655 if (version < 140)
11656 {
11658 {
11659 if (!ctx.
Read(value))
11660 return false;
11661 SetTemperatureDirect(value);
11662 }
11663 }
11664
11666 {
11667 if (!ctx.
Read(value))
11668 return false;
11670 }
11671
11673 {
11674 if (!ctx.
Read(intValue))
11675 return false;
11677 }
11678
11680 {
11681 int r,g,b,a;
11683 return false;
11685 return false;
11687 return false;
11689 return false;
11690
11692 }
11693
11695 {
11696 if (!ctx.
Read(intValue))
11697 return false;
11699 }
11700
11701 if (version >= 138 && version < 140)
11702 {
11704 {
11705 if (!ctx.
Read(intValue))
11706 return false;
11707 SetFrozen(intValue);
11708 }
11709 }
11710
11711 return true;
11712 }
11713
11714
11716 {
11719 {
11721 }
11722
11723 if (!super.OnStoreLoad(ctx, version))
11724 {
11726 return false;
11727 }
11728
11729 if (version >= 114)
11730 {
11731 bool hasQuickBarIndexSaved;
11732
11733 if (!ctx.
Read(hasQuickBarIndexSaved))
11734 {
11736 return false;
11737 }
11738
11739 if (hasQuickBarIndexSaved)
11740 {
11741 int itmQBIndex;
11742
11743
11744 if (!ctx.
Read(itmQBIndex))
11745 {
11747 return false;
11748 }
11749
11750 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11751 if (itmQBIndex != -1 && parentPlayer)
11752 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11753 }
11754 }
11755 else
11756 {
11757
11758 PlayerBase player;
11759 int itemQBIndex;
11760 if (version ==
int.
MAX)
11761 {
11762 if (!ctx.
Read(itemQBIndex))
11763 {
11765 return false;
11766 }
11767 }
11768 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11769 {
11770
11771 if (!ctx.
Read(itemQBIndex))
11772 {
11774 return false;
11775 }
11776 if (itemQBIndex != -1 && player)
11777 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11778 }
11779 }
11780
11781 if (version < 140)
11782 {
11783
11784 if (!LoadVariables(ctx, version))
11785 {
11787 return false;
11788 }
11789 }
11790
11791
11793 {
11795 return false;
11796 }
11797 if (version >= 132)
11798 {
11800 if (raib)
11801 {
11803 {
11805 return false;
11806 }
11807 }
11808 }
11809
11811 return true;
11812 }
11813
11814
11815
11817 {
11818 super.OnStoreSave(ctx);
11819
11820 PlayerBase player;
11821 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11822 {
11824
11825 int itemQBIndex = -1;
11826 itemQBIndex = player.FindQuickBarEntityIndex(this);
11827 ctx.
Write(itemQBIndex);
11828 }
11829 else
11830 {
11832 }
11833
11835
11837 if (raib)
11838 {
11840 }
11841 }
11842
11843
11845 {
11846 super.AfterStoreLoad();
11847
11849 {
11851 }
11852
11854 {
11857 }
11858 }
11859
11861 {
11862 super.EEOnAfterLoad();
11863
11865 {
11867 }
11868
11871 }
11872
11874 {
11875 return false;
11876 }
11877
11878
11879
11881 {
11883 {
11884 #ifdef PLATFORM_CONSOLE
11885
11887 {
11889 if (menu)
11890 {
11892 }
11893 }
11894 #endif
11895 }
11896
11898 {
11901 }
11902
11904 {
11905 SetWeightDirty();
11907 }
11909 {
11912 }
11913
11915 {
11918 }
11920 {
11923 }
11924
11925 super.OnVariablesSynchronized();
11926 }
11927
11928
11929
11931 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11932 {
11933 if (!IsServerCheck(allow_client))
11934 return false;
11935
11937 return false;
11938
11941
11942 if (value <= (min + 0.001))
11943 value = min;
11944
11945 if (value == min)
11946 {
11947 if (destroy_config)
11948 {
11949 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11950 if (dstr)
11951 {
11953 this.Delete();
11954 return true;
11955 }
11956 }
11957 else if (destroy_forced)
11958 {
11960 this.Delete();
11961 return true;
11962 }
11963
11965 }
11966
11969
11971 {
11973
11974 if (delta)
11976 }
11977
11979
11980 return false;
11981 }
11982
11983
11985 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11986 {
11988 }
11989
11991 {
11994 }
11995
11997 {
12000 }
12001
12003 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12004 {
12005 float value_clamped = Math.Clamp(value, 0, 1);
12007 SetQuantity(result, destroy_config, destroy_forced);
12008 }
12009
12010
12013 {
12015 }
12016
12018 {
12020 }
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12032 {
12033 int slot = -1;
12034 if (GetInventory())
12035 {
12036 InventoryLocation il = new InventoryLocation;
12037 GetInventory().GetCurrentInventoryLocation(il);
12039 }
12040
12042 }
12043
12045 {
12046 float quantity_max = 0;
12047
12049 {
12050 if (attSlotID != -1)
12051 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12052
12053 if (quantity_max <= 0)
12055 }
12056
12057 if (quantity_max <= 0)
12059
12060 return quantity_max;
12061 }
12062
12064 {
12066 }
12067
12069 {
12071 }
12072
12073
12075 {
12077 }
12078
12080 {
12082 }
12083
12085 {
12087 }
12088
12089
12091 {
12092
12093 float weightEx = GetWeightEx();
12094 float special = GetInventoryAndCargoWeight();
12095 return weightEx - special;
12096 }
12097
12098
12100 {
12102 }
12103
12105 {
12107 {
12108 #ifdef DEVELOPER
12109 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12110 {
12111 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12113 }
12114 #endif
12115
12116 return GetQuantity() * GetConfigWeightModified();
12117 }
12118 else if (HasEnergyManager())
12119 {
12120 #ifdef DEVELOPER
12121 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12122 {
12123 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12124 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12125 }
12126 #endif
12127 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12128 }
12129 else
12130 {
12131 #ifdef DEVELOPER
12132 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12133 {
12134 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12135 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12136 }
12137 #endif
12138 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12139 }
12140 }
12141
12144 {
12145 int item_count = 0;
12147
12148 if (GetInventory().GetCargo() != NULL)
12149 {
12150 item_count = GetInventory().GetCargo().GetItemCount();
12151 }
12152
12153 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12154 {
12155 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12156 if (item)
12157 item_count += item.GetNumberOfItems();
12158 }
12159 return item_count;
12160 }
12161
12164 {
12165 float weight = 0;
12166 float wetness = 1;
12167 if (include_wetness)
12170 {
12171 weight = wetness * m_ConfigWeight;
12172 }
12174 {
12175 weight = 1;
12176 }
12177 return weight;
12178 }
12179
12180
12181
12183 {
12184 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12185 {
12186 GameInventory inv = GetInventory();
12187 array<EntityAI> items = new array<EntityAI>;
12189 for (int i = 0; i < items.Count(); i++)
12190 {
12192 if (item)
12193 {
12195 }
12196 }
12197 }
12198 }
12199
12200
12201
12202
12204 {
12205 float energy = 0;
12206 if (HasEnergyManager())
12207 {
12208 energy = GetCompEM().GetEnergy();
12209 }
12210 return energy;
12211 }
12212
12213
12215 {
12216 super.OnEnergyConsumed();
12217
12219 }
12220
12222 {
12223 super.OnEnergyAdded();
12224
12226 }
12227
12228
12230 {
12231 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12232 {
12234 {
12235 float energy_0to1 = GetCompEM().GetEnergy0To1();
12237 }
12238 }
12239 }
12240
12241
12243 {
12244 return ConfigGetFloat("heatIsolation");
12245 }
12246
12248 {
12250 }
12251
12253 {
12254 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12255 if (
GetGame().ConfigIsExisting(paramPath))
12257
12258 return 0.0;
12259 }
12260
12262 {
12263 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12264 if (
GetGame().ConfigIsExisting(paramPath))
12266
12267 return 0.0;
12268 }
12269
12270 override void SetWet(
float value,
bool allow_client =
false)
12271 {
12272 if (!IsServerCheck(allow_client))
12273 return;
12274
12277
12279
12280 m_VarWet = Math.Clamp(value, min, max);
12281
12283 {
12286 }
12287 }
12288
12289 override void AddWet(
float value)
12290 {
12292 }
12293
12295 {
12297 }
12298
12300 {
12302 }
12303
12305 {
12307 }
12308
12310 {
12312 }
12313
12315 {
12317 }
12318
12319 override void OnWetChanged(
float newVal,
float oldVal)
12320 {
12323 if (newLevel != oldLevel)
12324 {
12326 }
12327 }
12328
12330 {
12331 SetWeightDirty();
12332 }
12333
12335 {
12336 return GetWetLevelInternal(
m_VarWet);
12337 }
12338
12339
12340
12342 {
12344 }
12345
12347 {
12349 }
12350
12352 {
12354 }
12355
12357 {
12359 }
12360
12361
12362
12364 {
12365 if (ConfigIsExisting("itemModelLength"))
12366 {
12367 return ConfigGetFloat("itemModelLength");
12368 }
12369 return 0;
12370 }
12371
12373 {
12374 if (ConfigIsExisting("itemAttachOffset"))
12375 {
12376 return ConfigGetFloat("itemAttachOffset");
12377 }
12378 return 0;
12379 }
12380
12381 override void SetCleanness(
int value,
bool allow_client =
false)
12382 {
12383 if (!IsServerCheck(allow_client))
12384 return;
12385
12387
12389
12392 }
12393
12395 {
12397 }
12398
12400 {
12401 return true;
12402 }
12403
12404
12405
12406
12408 {
12410 }
12411
12413 {
12415 }
12416
12417
12418
12419
12420 override void SetColor(
int r,
int g,
int b,
int a)
12421 {
12427 }
12429 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12430 {
12435 }
12436
12438 {
12440 }
12441
12444 {
12445 int r,g,b,a;
12447 r = r/255;
12448 g = g/255;
12449 b = b/255;
12450 a = a/255;
12451 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12452 }
12453
12454
12455
12456 override void SetLiquidType(
int value,
bool allow_client =
false)
12457 {
12458 if (!IsServerCheck(allow_client))
12459 return;
12460
12465 }
12466
12468 {
12469 return ConfigGetInt("varLiquidTypeInit");
12470 }
12471
12473 {
12475 }
12476
12478 {
12480 SetFrozen(false);
12481 }
12482
12485 {
12486 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12487 }
12488
12489
12492 {
12493 PlayerBase nplayer;
12494 if (PlayerBase.CastTo(nplayer, player))
12495 {
12497
12498 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12499 }
12500 }
12501
12502
12505 {
12506 PlayerBase nplayer;
12507 if (PlayerBase.CastTo(nplayer,player))
12508 {
12509
12510 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12511
12512 }
12513
12514
12515 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12516
12517
12518 if (HasEnergyManager())
12519 {
12520 GetCompEM().UpdatePlugState();
12521 }
12522 }
12523
12524
12526 {
12527 super.OnPlacementStarted(player);
12528
12530 }
12531
12532 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12533 {
12535 {
12536 m_AdminLog.OnPlacementComplete(player,
this);
12537 }
12538
12539 super.OnPlacementComplete(player, position, orientation);
12540 }
12541
12542
12543
12544
12545
12547 {
12549 {
12550 return true;
12551 }
12552 else
12553 {
12554 return false;
12555 }
12556 }
12557
12558
12560 {
12562 {
12564 }
12565 }
12566
12567
12569 {
12571 }
12572
12574 {
12576 }
12577
12578 override void InsertAgent(
int agent,
float count = 1)
12579 {
12580 if (count < 1)
12581 return;
12582
12584 }
12585
12588 {
12590 }
12591
12592
12594 {
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
12631
12632
12633
12634
12635
12636
12637
12638
12640 {
12642 return false;
12643 return true;
12644 }
12645
12647 {
12648
12650 }
12651
12652
12655 {
12656 super.CheckForRoofLimited(timeTresholdMS);
12657
12659 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12660 {
12661 m_PreviousRoofTestTime = time;
12662 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12663 }
12664 }
12665
12666
12668 {
12670 {
12671 return 0;
12672 }
12673
12674 if (GetInventory().GetAttachmentSlotsCount() != 0)
12675 {
12676 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12677 if (filter)
12678 return filter.GetProtectionLevel(type, false, system);
12679 else
12680 return 0;
12681 }
12682
12683 string subclassPath, entryName;
12684
12685 switch (type)
12686 {
12688 entryName = "biological";
12689 break;
12691 entryName = "chemical";
12692 break;
12693 default:
12694 entryName = "biological";
12695 break;
12696 }
12697
12698 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12699
12701 }
12702
12703
12704
12707 {
12708 if (!IsMagazine())
12710
12712 }
12713
12714
12715
12716
12717
12722 {
12723 return true;
12724 }
12725
12727 {
12729 }
12730
12731
12732
12733
12734
12736 {
12737 if (parent)
12738 {
12739 if (parent.IsInherited(DayZInfected))
12740 return true;
12741
12742 if (!parent.IsRuined())
12743 return true;
12744 }
12745
12746 return true;
12747 }
12748
12750 {
12751 if (!super.CanPutAsAttachment(parent))
12752 {
12753 return false;
12754 }
12755
12756 if (!IsRuined() && !parent.IsRuined())
12757 {
12758 return true;
12759 }
12760
12761 return false;
12762 }
12763
12765 {
12766
12767
12768
12769
12770 return super.CanReceiveItemIntoCargo(item);
12771 }
12772
12774 {
12775
12776
12777
12778
12779 GameInventory attachmentInv = attachment.GetInventory();
12781 {
12782 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12783 return false;
12784 }
12785
12786 InventoryLocation loc = new InventoryLocation();
12787 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12788 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12789 return false;
12790
12791 return super.CanReceiveAttachment(attachment, slotId);
12792 }
12793
12795 {
12796 if (!super.CanReleaseAttachment(attachment))
12797 return false;
12798
12799 return GetInventory().AreChildrenAccessible();
12800 }
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12823 {
12824 int id = muzzle_owner.GetMuzzleID();
12825 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12826
12827 if (WPOF_array)
12828 {
12829 for (int i = 0; i < WPOF_array.Count(); i++)
12830 {
12831 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12832
12833 if (WPOF)
12834 {
12835 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12836 }
12837 }
12838 }
12839 }
12840
12841
12843 {
12844 int id = muzzle_owner.GetMuzzleID();
12846
12847 if (WPOBE_array)
12848 {
12849 for (int i = 0; i < WPOBE_array.Count(); i++)
12850 {
12851 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12852
12853 if (WPOBE)
12854 {
12855 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12856 }
12857 }
12858 }
12859 }
12860
12861
12863 {
12864 int id = muzzle_owner.GetMuzzleID();
12865 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12866
12867 if (WPOOH_array)
12868 {
12869 for (int i = 0; i < WPOOH_array.Count(); i++)
12870 {
12871 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12872
12873 if (WPOOH)
12874 {
12875 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12876 }
12877 }
12878 }
12879 }
12880
12881
12883 {
12884 int id = muzzle_owner.GetMuzzleID();
12885 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12886
12887 if (WPOOH_array)
12888 {
12889 for (int i = 0; i < WPOOH_array.Count(); i++)
12890 {
12891 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12892
12893 if (WPOOH)
12894 {
12895 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12896 }
12897 }
12898 }
12899 }
12900
12901
12903 {
12904 int id = muzzle_owner.GetMuzzleID();
12905 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12906
12907 if (WPOOH_array)
12908 {
12909 for (int i = 0; i < WPOOH_array.Count(); i++)
12910 {
12911 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12912
12913 if (WPOOH)
12914 {
12915 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12916 }
12917 }
12918 }
12919 }
12920
12921
12922
12924 {
12926 {
12927 return true;
12928 }
12929
12930 return false;
12931 }
12932
12934 {
12936 {
12937 return true;
12938 }
12939
12940 return false;
12941 }
12942
12944 {
12946 {
12947 return true;
12948 }
12949
12950 return false;
12951 }
12952
12954 {
12955 return false;
12956 }
12957
12960 {
12961 return UATimeSpent.DEFAULT_DEPLOY;
12962 }
12963
12964
12965
12966
12968 {
12970 SetSynchDirty();
12971 }
12972
12974 {
12976 }
12977
12978
12980 {
12981 return false;
12982 }
12983
12986 {
12987 string att_type = "None";
12988
12989 if (ConfigIsExisting("soundAttType"))
12990 {
12991 att_type = ConfigGetString("soundAttType");
12992 }
12993
12995 }
12996
12998 {
13000 }
13001
13002
13003
13004
13005
13011
13013 {
13016
13018 }
13019
13020
13022 {
13024 return;
13025
13027
13030
13033
13034 SoundParameters params = new SoundParameters();
13038 }
13039
13040
13042 {
13044 return;
13045
13047 SetSynchDirty();
13048
13051 }
13052
13053
13055 {
13057 return;
13058
13060 SetSynchDirty();
13061
13064 }
13065
13067 {
13069 }
13070
13072 {
13074 }
13075
13078 {
13079 if (!
GetGame().IsDedicatedServer())
13080 {
13081 if (ConfigIsExisting("attachSoundSet"))
13082 {
13083 string cfg_path = "";
13084 string soundset = "";
13085 string type_name =
GetType();
13086
13089 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13090 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13091
13092 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13093 {
13094 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13095 {
13096 if (cfg_slot_array[i] == slot_type)
13097 {
13098 soundset = cfg_soundset_array[i];
13099 break;
13100 }
13101 }
13102 }
13103
13104 if (soundset != "")
13105 {
13106 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13108 }
13109 }
13110 }
13111 }
13112
13114 {
13115
13116 }
13117
13118 void OnApply(PlayerBase player);
13119
13121 {
13122 return 1.0;
13123 };
13124
13126 {
13128 }
13129
13131 {
13133 }
13134
13136
13138 {
13139 SetDynamicPhysicsLifeTime(0.01);
13141 }
13142
13144 {
13145 array<string> zone_names = new array<string>;
13146 GetDamageZones(zone_names);
13147 for (int i = 0; i < zone_names.Count(); i++)
13148 {
13149 SetHealthMax(zone_names.Get(i),"Health");
13150 }
13151 SetHealthMax("","Health");
13152 }
13153
13156 {
13157 float global_health = GetHealth01("","Health");
13158 array<string> zones = new array<string>;
13159 GetDamageZones(zones);
13160
13161 for (int i = 0; i < zones.Count(); i++)
13162 {
13163 SetHealth01(zones.Get(i),"Health",global_health);
13164 }
13165 }
13166
13169 {
13170 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13171 }
13172
13174 {
13175 if (!hasRootAsPlayer)
13176 {
13177 if (refParentIB)
13178 {
13179
13180 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13181 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13182
13183 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13184 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13185
13188 }
13189 else
13190 {
13191
13194 }
13195 }
13196 }
13197
13199 {
13201 {
13202 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13203 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13204 {
13205 float heatPermCoef = 1.0;
13207 while (ent)
13208 {
13209 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13210 ent = ent.GetHierarchyParent();
13211 }
13212
13213 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13214 }
13215 }
13216 }
13217
13219 {
13220
13221 EntityAI parent = GetHierarchyParent();
13222 if (!parent)
13223 {
13224 hasParent = false;
13225 hasRootAsPlayer = false;
13226 }
13227 else
13228 {
13229 hasParent = true;
13230 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13231 refParentIB =
ItemBase.Cast(parent);
13232 }
13233 }
13234
13235 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13236 {
13237
13238 }
13239
13241 {
13242
13243 return false;
13244 }
13245
13247 {
13248
13249
13250 return false;
13251 }
13252
13254 {
13255
13256 return false;
13257 }
13258
13261 {
13262 return !GetIsFrozen() &&
IsOpen();
13263 }
13264
13266 {
13267 bool hasParent = false, hasRootAsPlayer = false;
13269
13270 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13271 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13272
13273 if (wwtu || foodDecay)
13274 {
13278
13279 if (processWetness || processTemperature || processDecay)
13280 {
13282
13283 if (processWetness)
13284 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13285
13286 if (processTemperature)
13288
13289 if (processDecay)
13290 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13291 }
13292 }
13293 }
13294
13297 {
13299 }
13300
13302 {
13305
13306 return super.GetTemperatureFreezeThreshold();
13307 }
13308
13310 {
13313
13314 return super.GetTemperatureThawThreshold();
13315 }
13316
13318 {
13321
13322 return super.GetItemOverheatThreshold();
13323 }
13324
13326 {
13328 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13329
13330 return super.GetTemperatureFreezeTime();
13331 }
13332
13334 {
13336 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13337
13338 return super.GetTemperatureThawTime();
13339 }
13340
13345
13347 {
13348 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13349 }
13350
13352 {
13353 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13354 }
13355
13358 {
13360 }
13361
13363 {
13365 }
13366
13368 {
13370 }
13371
13374 {
13375 return null;
13376 }
13377
13380 {
13381 return false;
13382 }
13383
13385 {
13387 {
13390 if (!trg)
13391 {
13393 explosive = this;
13394 }
13395
13396 explosive.PairRemote(trg);
13398
13399 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13400 trg.SetPersistentPairID(persistentID);
13401 explosive.SetPersistentPairID(persistentID);
13402
13403 return true;
13404 }
13405 return false;
13406 }
13407
13410 {
13411 float ret = 1.0;
13414 ret *= GetHealth01();
13415
13416 return ret;
13417 }
13418
13419 #ifdef DEVELOPER
13420 override void SetDebugItem()
13421 {
13422 super.SetDebugItem();
13423 _itemBase = this;
13424 }
13425
13427 {
13428 string text = super.GetDebugText();
13429
13431 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13432
13433 return text;
13434 }
13435 #endif
13436
13438 {
13439 return true;
13440 }
13441
13443
13445
13447 {
13450 }
13451
13452
13460
13476}
13477
13479{
13481 if (entity)
13482 {
13483 bool is_item = entity.IsInherited(
ItemBase);
13484 if (is_item && full_quantity)
13485 {
13488 }
13489 }
13490 else
13491 {
13493 return NULL;
13494 }
13495 return entity;
13496}
13497
13499{
13500 if (item)
13501 {
13502 if (health > 0)
13503 item.SetHealth("", "", health);
13504
13505 if (item.CanHaveTemperature())
13506 {
13508 if (item.CanFreeze())
13509 item.SetFrozen(false);
13510 }
13511
13512 if (item.HasEnergyManager())
13513 {
13514 if (quantity >= 0)
13515 {
13516 item.GetCompEM().SetEnergy0To1(quantity);
13517 }
13518 else
13519 {
13521 }
13522 }
13523 else if (item.IsMagazine())
13524 {
13525 Magazine mag = Magazine.Cast(item);
13526 if (quantity >= 0)
13527 {
13528 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13529 }
13530 else
13531 {
13533 }
13534
13535 }
13536 else
13537 {
13538 if (quantity >= 0)
13539 {
13540 item.SetQuantityNormalized(quantity, false);
13541 }
13542 else
13543 {
13545 }
13546
13547 }
13548 }
13549}
13550
13551#ifdef DEVELOPER
13553#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.