9583{
9585 {
9586 return true;
9587 }
9588};
9589
9590
9591
9593{
9597
9599
9602
9603
9604
9605
9606
9615
9621
9626
9631
9652 protected bool m_IsResultOfSplit
9653
9655
9660
9661
9662
9664
9668
9669
9670
9672
9675
9676
9677
9683
9684
9692
9695
9696
9698
9699
9701
9702
9707
9708
9713
9714
9716
9717
9719 {
9724
9725 if (!
GetGame().IsDedicatedServer())
9726 {
9728 {
9730
9732 {
9734 }
9735 }
9736
9739 }
9740
9741 m_OldLocation = null;
9742
9744 {
9746 }
9747
9748 if (ConfigIsExisting("headSelectionsToHide"))
9749 {
9752 }
9753
9755 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9756 {
9758 }
9759
9761
9762 m_IsResultOfSplit = false;
9763
9765 }
9766
9768 {
9769 super.InitItemVariables();
9770
9776 m_Count = ConfigGetInt(
"count");
9777
9780
9785
9788
9793
9805
9809
9810
9813 if (ConfigIsExisting("canBeSplit"))
9814 {
9817 }
9818
9820 if (ConfigIsExisting("itemBehaviour"))
9822
9823
9826 RegisterNetSyncVariableInt("m_VarLiquidType");
9827 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9828
9829 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9830 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9831 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9832
9833 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9834 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9835 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9836 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9837
9838 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9839 RegisterNetSyncVariableBool("m_IsTakeable");
9840 RegisterNetSyncVariableBool("m_IsHologram");
9841
9844 {
9847 }
9848
9850
9852 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9854
9855 }
9856
9858 {
9860 }
9861
9863 {
9866 {
9871 }
9872 }
9873
9874 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9875 {
9877 {
9880 }
9881
9883 }
9884
9886 {
9892 }
9893
9895
9897 {
9899
9900 if (!action)
9901 {
9902 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9903 return;
9904 }
9905
9907 if (!ai)
9908 {
9910 return;
9911 }
9912
9914 if (!action_array)
9915 {
9916 action_array = new array<ActionBase_Basic>;
9918 }
9919 if (LogManager.IsActionLogEnable())
9920 {
9921 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9922 }
9923
9924 if (action_array.Find(action) != -1)
9925 {
9926 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9927 }
9928 else
9929 {
9930 action_array.Insert(action);
9931 }
9932 }
9933
9935 {
9937 ActionBase action = player.GetActionManager().GetAction(actionName);
9940
9941 if (action_array)
9942 {
9943 action_array.RemoveItem(action);
9944 }
9945 }
9946
9947
9948
9950 {
9951 ActionOverrideData overrideData = new ActionOverrideData();
9955
9957 if (!actionMap)
9958 {
9961 }
9962
9963 actionMap.Insert(this.
Type(), overrideData);
9964
9965 }
9966
9968
9970
9971
9973 {
9976
9979
9980 string config_to_search = "CfgVehicles";
9981 string muzzle_owner_config;
9982
9984 {
9985 if (IsInherited(Weapon))
9986 config_to_search = "CfgWeapons";
9987
9988 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9989
9990 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9991
9993
9994 if (config_OnFire_subclass_count > 0)
9995 {
9996 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9997
9998 for (int i = 0; i < config_OnFire_subclass_count; i++)
9999 {
10000 string particle_class = "";
10002 string config_OnFire_entry = config_OnFire_class + particle_class;
10003 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
10004 WPOF_array.Insert(WPOF);
10005 }
10006
10007
10009 }
10010 }
10011
10013 {
10014 config_to_search = "CfgWeapons";
10015 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10016
10017 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
10018
10020
10021 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
10022 {
10023 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
10024
10025 for (i = 0; i < config_OnBulletCasingEject_count; i++)
10026 {
10027 string particle_class2 = "";
10029 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
10030 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
10031 WPOBE_array.Insert(WPOBE);
10032 }
10033
10034
10036 }
10037 }
10038 }
10039
10040
10042 {
10045
10047 {
10048 string config_to_search = "CfgVehicles";
10049
10050 if (IsInherited(Weapon))
10051 config_to_search = "CfgWeapons";
10052
10053 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10054 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10055
10056 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10057 {
10058
10060
10062 {
10064 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10066 return;
10067 }
10068
10071
10072
10073
10075 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10076
10077 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10078 {
10079 string particle_class = "";
10081 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10083
10084 if (entry_type == CT_CLASS)
10085 {
10086 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10087 WPOOH_array.Insert(WPOF);
10088 }
10089 }
10090
10091
10093 }
10094 }
10095 }
10096
10098 {
10100 }
10101
10103 {
10105 {
10107
10110
10113
10114 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10115 }
10116 }
10117
10119 {
10121 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10122
10124 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10125
10127 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10128
10130 {
10132 }
10133 }
10134
10136 {
10138 }
10139
10141 {
10144 else
10146
10148 {
10151 }
10152 else
10153 {
10156
10159 }
10160
10162 }
10163
10165 {
10167 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10168 }
10169
10171 {
10173 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10175 }
10176
10178 {
10180 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10181 }
10182
10184 {
10187
10188 OverheatingParticle OP = new OverheatingParticle();
10193
10195 }
10196
10198 {
10201
10202 return -1;
10203 }
10204
10206 {
10208 {
10211
10212 for (int i = count; i > 0; --i)
10213 {
10214 int id = i - 1;
10217
10220
10221 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10222 {
10223 if (p)
10224 {
10227 }
10228 }
10229 }
10230 }
10231 }
10232
10234 {
10236 {
10238 {
10239 int id = i - 1;
10241
10242 if (OP)
10243 {
10245
10246 if (p)
10247 {
10249 }
10250
10251 delete OP;
10252 }
10253 }
10254
10257 }
10258 }
10259
10262 {
10263 return 0.0;
10264 }
10265
10266
10268 {
10269 return 250;
10270 }
10271
10273 {
10274 return 0;
10275 }
10276
10279 {
10281 return true;
10282
10283 return false;
10284 }
10285
10288 {
10291
10293 {
10295 }
10296 else
10297 {
10298
10300 }
10301
10303 }
10304
10311 {
10312 return -1;
10313 }
10314
10315
10316
10317
10319 {
10321 {
10323 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10324
10325 if (r_index >= 0)
10326 {
10327 InventoryLocation r_il = new InventoryLocation;
10328 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10329
10330 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10333 {
10334 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10335 }
10337 {
10338 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10339 }
10340
10341 }
10342
10343 player.GetHumanInventory().ClearUserReservedLocation(this);
10344 }
10345
10348 }
10349
10350
10351
10352
10354 {
10355 return ItemBase.m_DebugActionsMask;
10356 }
10357
10359 {
10360 return ItemBase.m_DebugActionsMask & mask;
10361 }
10362
10364 {
10365 ItemBase.m_DebugActionsMask = mask;
10366 }
10367
10369 {
10370 ItemBase.m_DebugActionsMask |= mask;
10371 }
10372
10374 {
10375 ItemBase.m_DebugActionsMask &= ~mask;
10376 }
10377
10379 {
10381 {
10383 }
10384 else
10385 {
10387 }
10388 }
10389
10390
10392 {
10393 if (GetEconomyProfile())
10394 {
10395 float q_max = GetEconomyProfile().GetQuantityMax();
10396 if (q_max > 0)
10397 {
10398 float q_min = GetEconomyProfile().GetQuantityMin();
10399 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10400
10402 {
10403 ComponentEnergyManager comp = GetCompEM();
10405 {
10407 }
10408 }
10410 {
10412
10413 }
10414
10415 }
10416 }
10417 }
10418
10421 {
10422 EntityAI parent = GetHierarchyParent();
10423
10424 if (parent)
10425 {
10426 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10427 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10428 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10429 }
10430 }
10431
10434 {
10435 EntityAI parent = GetHierarchyParent();
10436
10437 if (parent)
10438 {
10439 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10440 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10441 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10442 }
10443 }
10444
10446 {
10447
10448
10449
10450
10452
10454 {
10455 if (ScriptInputUserData.CanStoreInputUserData())
10456 {
10457 ScriptInputUserData ctx = new ScriptInputUserData;
10463 ctx.
Write(use_stack_max);
10466
10468 {
10469 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10470 }
10471 }
10472 }
10473 else if (!
GetGame().IsMultiplayer())
10474 {
10476 }
10477 }
10478
10480 {
10482 }
10483
10485 {
10487 }
10488
10490 {
10492 }
10493
10495 {
10496
10497 return false;
10498 }
10499
10501 {
10502 return false;
10503 }
10504
10508 {
10509 return false;
10510 }
10511
10513 {
10514 return "";
10515 }
10516
10518
10520 {
10521 return false;
10522 }
10523
10525 {
10526 return true;
10527 }
10528
10529
10530
10532 {
10533 return true;
10534 }
10535
10537 {
10538 return true;
10539 }
10540
10542 {
10543 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10545 }
10546
10548 {
10550 }
10551
10553 {
10555 if (!is_being_placed)
10557 SetSynchDirty();
10558 }
10559
10560
10562
10564 {
10566 }
10567
10569 {
10571 }
10572
10574 {
10575 return 1;
10576 }
10577
10579 {
10580 return false;
10581 }
10582
10584 {
10586 SetSynchDirty();
10587 }
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10624 {
10625 super.OnMovedInsideCargo(container);
10626
10627 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10628 }
10629
10630 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10631 {
10632 super.EEItemLocationChanged(oldLoc,newLoc);
10633
10634 PlayerBase new_player = null;
10635 PlayerBase old_player = null;
10636
10637 if (newLoc.GetParent())
10638 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10639
10640 if (oldLoc.GetParent())
10641 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10642
10644 {
10645 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10646
10647 if (r_index >= 0)
10648 {
10649 InventoryLocation r_il = new InventoryLocation;
10650 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10651
10652 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10655 {
10656 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10657 }
10659 {
10660 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10661 }
10662
10663 }
10664 }
10665
10667 {
10668 if (new_player)
10669 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10670
10671 if (new_player == old_player)
10672 {
10673
10674 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10675 {
10677 {
10678 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10679 {
10680 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10681 }
10682 }
10683 else
10684 {
10685 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10686 }
10687 }
10688
10689 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10690 {
10691 int type = oldLoc.GetType();
10693 {
10694 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10695 }
10697 {
10698 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10699 }
10700 }
10701 if (!m_OldLocation)
10702 {
10703 m_OldLocation = new InventoryLocation;
10704 }
10705 m_OldLocation.Copy(oldLoc);
10706 }
10707 else
10708 {
10709 if (m_OldLocation)
10710 {
10711 m_OldLocation.Reset();
10712 }
10713 }
10714
10716 }
10717 else
10718 {
10719 if (new_player)
10720 {
10721 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10722 if (res_index >= 0)
10723 {
10724 InventoryLocation il = new InventoryLocation;
10725 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10727 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10730 {
10731 il.
GetParent().GetOnReleaseLock().Invoke(it);
10732 }
10734 {
10736 }
10737
10738 }
10739 }
10741 {
10742
10744 }
10745
10746 if (m_OldLocation)
10747 {
10748 m_OldLocation.Reset();
10749 }
10750 }
10751 }
10752
10753 override void EOnContact(IEntity other, Contact extra)
10754 {
10756 {
10757 int liquidType = -1;
10759 if (impactSpeed > 0.0)
10760 {
10762 #ifndef SERVER
10764 #else
10766 SetSynchDirty();
10767 #endif
10769 }
10770 }
10771
10772 #ifdef SERVER
10773 if (GetCompEM() && GetCompEM().IsPlugged())
10774 {
10775 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10776 GetCompEM().UnplugThis();
10777 }
10778 #endif
10779 }
10780
10782
10784 {
10786 }
10787
10789 {
10790
10791 }
10792
10794 {
10795 super.OnItemLocationChanged(old_owner, new_owner);
10796
10797 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10798 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10799
10800 if (!relatedPlayer && playerNew)
10801 relatedPlayer = playerNew;
10802
10803 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10804 {
10806 if (actionMgr)
10807 {
10808 ActionBase currentAction = actionMgr.GetRunningAction();
10809 if (currentAction)
10811 }
10812 }
10813
10814 Man ownerPlayerOld = null;
10815 Man ownerPlayerNew = null;
10816
10817 if (old_owner)
10818 {
10819 if (old_owner.
IsMan())
10820 {
10821 ownerPlayerOld = Man.Cast(old_owner);
10822 }
10823 else
10824 {
10825 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10826 }
10827 }
10828 else
10829 {
10831 {
10833
10834 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10835 {
10836 GetCompEM().UnplugThis();
10837 }
10838 }
10839 }
10840
10841 if (new_owner)
10842 {
10843 if (new_owner.
IsMan())
10844 {
10845 ownerPlayerNew = Man.Cast(new_owner);
10846 }
10847 else
10848 {
10849 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10850 }
10851 }
10852
10853 if (ownerPlayerOld != ownerPlayerNew)
10854 {
10855 if (ownerPlayerOld)
10856 {
10857 array<EntityAI> subItemsExit = new array<EntityAI>;
10859 for (int i = 0; i < subItemsExit.Count(); i++)
10860 {
10863 }
10864 }
10865
10866 if (ownerPlayerNew)
10867 {
10868 array<EntityAI> subItemsEnter = new array<EntityAI>;
10870 for (int j = 0; j < subItemsEnter.Count(); j++)
10871 {
10874 }
10875 }
10876 }
10877 else if (ownerPlayerNew != null)
10878 {
10879 PlayerBase nplayer;
10880 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10881 {
10882 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10884 for (int k = 0; k < subItemsUpdate.Count(); k++)
10885 {
10887 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10888 }
10889 }
10890 }
10891
10892 if (old_owner)
10893 old_owner.OnChildItemRemoved(this);
10894 if (new_owner)
10895 new_owner.OnChildItemReceived(this);
10896 }
10897
10898
10900 {
10901 super.EEDelete(parent);
10902 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10903 if (player)
10904 {
10906
10907 if (player.IsAlive())
10908 {
10909 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10910 if (r_index >= 0)
10911 {
10912 InventoryLocation r_il = new InventoryLocation;
10913 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10914
10915 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10918 {
10919 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10920 }
10922 {
10923 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10924 }
10925
10926 }
10927
10928 player.RemoveQuickBarEntityShortcut(this);
10929 }
10930 }
10931 }
10932
10934 {
10935 super.EEKilled(killer);
10936
10939 {
10940 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10941 {
10942 if (IsMagazine())
10943 {
10944 if (Magazine.Cast(this).GetAmmoCount() > 0)
10945 {
10947 }
10948 }
10949 else
10950 {
10952 }
10953 }
10954 }
10955 }
10956
10958 {
10959 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10960
10961 super.OnWasAttached(parent, slot_id);
10962
10965
10967 }
10968
10970 {
10971 super.OnWasDetached(parent, slot_id);
10972
10975 }
10976
10978 {
10979 int idx;
10982
10983 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10984 if (inventory_slots.Count() < 1)
10985 {
10986 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10987 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10988 }
10989 else
10990 {
10991 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10992 }
10993
10994 idx = inventory_slots.Find(slot);
10995 if (idx < 0)
10996 return "";
10997
10998 return attach_types.Get(idx);
10999 }
11000
11002 {
11003 int idx = -1;
11004 string slot;
11005
11008
11009 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11010 if (inventory_slots.Count() < 1)
11011 {
11012 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
11013 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11014 }
11015 else
11016 {
11017 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
11018 if (detach_types.Count() < 1)
11019 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11020 }
11021
11022 for (int i = 0; i < inventory_slots.Count(); i++)
11023 {
11024 slot = inventory_slots.Get(i);
11025 }
11026
11027 if (slot != "")
11028 {
11029 if (detach_types.Count() == 1)
11030 idx = 0;
11031 else
11032 idx = inventory_slots.Find(slot);
11033 }
11034 if (idx < 0)
11035 return "";
11036
11037 return detach_types.Get(idx);
11038 }
11039
11041 {
11042
11044
11045
11046 float min_time = 1;
11047 float max_time = 3;
11048 float delay = Math.RandomFloat(min_time, max_time);
11049
11050 explode_timer.Run(delay, this, "DoAmmoExplosion");
11051 }
11052
11054 {
11055 Magazine magazine = Magazine.Cast(this);
11056 int pop_sounds_count = 6;
11057 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11058
11059
11060 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11061 string sound_name = pop_sounds[ sound_idx ];
11063
11064
11065 magazine.ServerAddAmmoCount(-1);
11066
11067
11068 float min_temp_to_explode = 100;
11069
11070 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11071 {
11073 }
11074 }
11075
11076
11077 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11078 {
11079 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11080
11081 const int CHANCE_DAMAGE_CARGO = 4;
11082 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11083 const int CHANCE_DAMAGE_NOTHING = 2;
11084
11086 {
11087 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11088 int chances;
11089 int rnd;
11090
11091 if (GetInventory().GetCargo())
11092 {
11093 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11094 rnd = Math.RandomInt(0,chances);
11095
11096 if (rnd < CHANCE_DAMAGE_CARGO)
11097 {
11099 }
11100 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11101 {
11103 }
11104 }
11105 else
11106 {
11107 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11108 rnd = Math.RandomInt(0,chances);
11109
11110 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11111 {
11113 }
11114 }
11115 }
11116 }
11117
11119 {
11120 if (GetInventory().GetCargo())
11121 {
11122 int item_count = GetInventory().GetCargo().GetItemCount();
11123 if (item_count > 0)
11124 {
11125 int random_pick = Math.RandomInt(0, item_count);
11127 if (!item.IsExplosive())
11128 {
11129 item.AddHealth("","",damage);
11130 return true;
11131 }
11132 }
11133 }
11134 return false;
11135 }
11136
11138 {
11139 int attachment_count = GetInventory().AttachmentCount();
11140 if (attachment_count > 0)
11141 {
11142 int random_pick = Math.RandomInt(0, attachment_count);
11143 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11144 if (!attachment.IsExplosive())
11145 {
11146 attachment.AddHealth("","",damage);
11147 return true;
11148 }
11149 }
11150 return false;
11151 }
11152
11154 {
11156 }
11157
11159 {
11161 return GetInventory().CanRemoveEntity();
11162
11163 return false;
11164 }
11165
11167 {
11168
11170 return false;
11171
11172
11174 return false;
11175
11176
11177
11179 if (delta == 0)
11180 return false;
11181
11182
11183 return true;
11184 }
11185
11187 {
11189 {
11190 if (ScriptInputUserData.CanStoreInputUserData())
11191 {
11192 ScriptInputUserData ctx = new ScriptInputUserData;
11197 ctx.
Write(destination_entity);
11199 ctx.
Write(slot_id);
11201 }
11202 }
11203 else if (!
GetGame().IsMultiplayer())
11204 {
11206 }
11207 }
11208
11210 {
11211 float split_quantity_new;
11215 InventoryLocation loc = new InventoryLocation;
11216
11217 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11218 {
11220 split_quantity_new = stack_max;
11221 else
11223
11225 {
11226 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11227 if (new_item)
11228 {
11229 new_item.SetResultOfSplit(true);
11230 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11232 new_item.
SetQuantity(split_quantity_new,
false,
true);
11233 }
11234 }
11235 }
11236 else if (destination_entity && slot_id == -1)
11237 {
11238 if (quantity > stack_max)
11239 split_quantity_new = stack_max;
11240 else
11241 split_quantity_new = quantity;
11242
11244 {
11246 {
11249 }
11250
11251 if (new_item)
11252 {
11253 new_item.SetResultOfSplit(true);
11254 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11256 new_item.
SetQuantity(split_quantity_new,
false,
true);
11257 }
11258 }
11259 }
11260 else
11261 {
11262 if (stack_max != 0)
11263 {
11265 {
11267 }
11268
11269 if (split_quantity_new == 0)
11270 {
11271 if (!
GetGame().IsMultiplayer())
11272 player.PhysicalPredictiveDropItem(this);
11273 else
11274 player.ServerDropEntity(this);
11275 return;
11276 }
11277
11279 {
11281
11282 if (new_item)
11283 {
11284 new_item.SetResultOfSplit(true);
11285 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11288 new_item.PlaceOnSurface();
11289 }
11290 }
11291 }
11292 }
11293 }
11294
11296 {
11297 float split_quantity_new;
11301 InventoryLocation loc = new InventoryLocation;
11302
11303 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11304 {
11306 split_quantity_new = stack_max;
11307 else
11309
11311 {
11312 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11313 if (new_item)
11314 {
11315 new_item.SetResultOfSplit(true);
11316 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11318 new_item.
SetQuantity(split_quantity_new,
false,
true);
11319 }
11320 }
11321 }
11322 else if (destination_entity && slot_id == -1)
11323 {
11324 if (quantity > stack_max)
11325 split_quantity_new = stack_max;
11326 else
11327 split_quantity_new = quantity;
11328
11330 {
11332 {
11335 }
11336
11337 if (new_item)
11338 {
11339 new_item.SetResultOfSplit(true);
11340 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11342 new_item.
SetQuantity(split_quantity_new,
false,
true);
11343 }
11344 }
11345 }
11346 else
11347 {
11348 if (stack_max != 0)
11349 {
11351 {
11353 }
11354
11356 {
11358
11359 if (new_item)
11360 {
11361 new_item.SetResultOfSplit(true);
11362 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11365 new_item.PlaceOnSurface();
11366 }
11367 }
11368 }
11369 }
11370 }
11371
11373 {
11375 {
11376 if (ScriptInputUserData.CanStoreInputUserData())
11377 {
11378 ScriptInputUserData ctx = new ScriptInputUserData;
11383 dst.WriteToContext(ctx);
11385 }
11386 }
11387 else if (!
GetGame().IsMultiplayer())
11388 {
11390 }
11391 }
11392
11394 {
11396 {
11397 if (ScriptInputUserData.CanStoreInputUserData())
11398 {
11399 ScriptInputUserData ctx = new ScriptInputUserData;
11404 ctx.
Write(destination_entity);
11410 }
11411 }
11412 else if (!
GetGame().IsMultiplayer())
11413 {
11415 }
11416 }
11417
11419 {
11421 }
11422
11424 {
11426 float split_quantity_new;
11428 if (dst.IsValid())
11429 {
11430 int slot_id = dst.GetSlot();
11432
11433 if (quantity > stack_max)
11434 split_quantity_new = stack_max;
11435 else
11436 split_quantity_new = quantity;
11437
11439 {
11441
11442 if (new_item)
11443 {
11444 new_item.SetResultOfSplit(true);
11445 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11447 new_item.
SetQuantity(split_quantity_new,
false,
true);
11448 }
11449
11450 return new_item;
11451 }
11452 }
11453
11454 return null;
11455 }
11456
11458 {
11460 float split_quantity_new;
11462 if (destination_entity)
11463 {
11465 if (quantity > stackable)
11466 split_quantity_new = stackable;
11467 else
11468 split_quantity_new = quantity;
11469
11471 {
11472 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11473 if (new_item)
11474 {
11475 new_item.SetResultOfSplit(true);
11476 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11478 new_item.
SetQuantity(split_quantity_new,
false,
true);
11479 }
11480 }
11481 }
11482 }
11483
11485 {
11487 {
11488 if (ScriptInputUserData.CanStoreInputUserData())
11489 {
11490 ScriptInputUserData ctx = new ScriptInputUserData;
11495 ItemBase destination_entity =
this;
11496 ctx.
Write(destination_entity);
11500 }
11501 }
11502 else if (!
GetGame().IsMultiplayer())
11503 {
11505 }
11506 }
11507
11509 {
11511 float split_quantity_new;
11513 if (player)
11514 {
11516 if (quantity > stackable)
11517 split_quantity_new = stackable;
11518 else
11519 split_quantity_new = quantity;
11520
11522 {
11523 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11524 new_item =
ItemBase.Cast(in_hands);
11525 if (new_item)
11526 {
11527 new_item.SetResultOfSplit(true);
11528 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11530 new_item.SetQuantity(split_quantity_new, false, true);
11531 }
11532 }
11533 }
11534 }
11535
11537 {
11539 float split_quantity_new = Math.Floor(quantity * 0.5);
11540
11542 return;
11543
11545
11546 if (new_item)
11547 {
11548 if (new_item.GetQuantityMax() < split_quantity_new)
11549 {
11550 split_quantity_new = new_item.GetQuantityMax();
11551 }
11552
11553 new_item.SetResultOfSplit(true);
11554 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11555
11557 {
11560 }
11561 else
11562 {
11564 new_item.
SetQuantity(split_quantity_new,
false,
true);
11565 }
11566 }
11567 }
11568
11570 {
11572 float split_quantity_new = Math.Floor(quantity / 2);
11573
11575 return;
11576
11577 InventoryLocation invloc = new InventoryLocation;
11579
11581 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11582
11583 if (new_item)
11584 {
11585 if (new_item.GetQuantityMax() < split_quantity_new)
11586 {
11587 split_quantity_new = new_item.GetQuantityMax();
11588 }
11590 {
11593 }
11594 else if (split_quantity_new > 1)
11595 {
11597 new_item.
SetQuantity(split_quantity_new,
false,
true);
11598 }
11599 }
11600 }
11601
11604 {
11605 SetWeightDirty();
11607
11608 if (parent)
11609 parent.OnAttachmentQuantityChangedEx(this, delta);
11610
11612 {
11614 {
11616 }
11618 {
11619 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11621 }
11622 }
11623
11624 }
11625
11628 {
11629
11630 }
11631
11634 {
11636 }
11637
11639 {
11640 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11641
11643 {
11644 if (newLevel == GameConstants.STATE_RUINED)
11645 {
11647 EntityAI parent = GetHierarchyParent();
11648 if (parent && parent.IsFireplace())
11649 {
11650 CargoBase cargo = GetInventory().GetCargo();
11651 if (cargo)
11652 {
11654 {
11656 }
11657 }
11658 }
11659 }
11660
11662 {
11663
11665 return;
11666 }
11667
11668 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11669 {
11671 }
11672 }
11673 }
11674
11675
11677 {
11678 super.OnRightClick();
11679
11681 {
11683 {
11684 if (ScriptInputUserData.CanStoreInputUserData())
11685 {
11686 EntityAI root = GetHierarchyRoot();
11687 Man playerOwner = GetHierarchyRootPlayer();
11688 InventoryLocation dst = new InventoryLocation;
11689
11690
11691 if (!playerOwner && root && root == this)
11692 {
11694 }
11695 else
11696 {
11697
11698 GetInventory().GetCurrentInventoryLocation(dst);
11700 {
11703 {
11705 }
11706 else
11707 {
11709
11710
11711 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11712 {
11714 }
11715 else
11716 {
11717 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11718 }
11719 }
11720 }
11721 }
11722
11723 ScriptInputUserData ctx = new ScriptInputUserData;
11731 }
11732 }
11733 else if (!
GetGame().IsMultiplayer())
11734 {
11736 }
11737 }
11738 }
11739
11741 {
11742 if (root)
11743 {
11744 vector m4[4];
11745 root.GetTransform(m4);
11746 dst.SetGround(this, m4);
11747 }
11748 else
11749 {
11750 GetInventory().GetCurrentInventoryLocation(dst);
11751 }
11752 }
11753
11754 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11755 {
11756
11757 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11758 return false;
11759
11760 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11761 return false;
11762
11763
11765 return false;
11766
11767
11768 Magazine mag = Magazine.Cast(this);
11769 if (mag)
11770 {
11771 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11772 return false;
11773
11774 if (stack_max_limit)
11775 {
11776 Magazine other_mag = Magazine.Cast(other_item);
11777 if (other_item)
11778 {
11779 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11780 return false;
11781 }
11782
11783 }
11784 }
11785 else
11786 {
11787
11789 return false;
11790
11792 return false;
11793 }
11794
11795 PlayerBase player = null;
11796 if (CastTo(player, GetHierarchyRootPlayer()))
11797 {
11798 if (player.GetInventory().HasAttachment(this))
11799 return false;
11800
11801 if (player.IsItemsToDelete())
11802 return false;
11803 }
11804
11805 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11806 return false;
11807
11808 int slotID;
11810 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11811 return false;
11812
11813 return true;
11814 }
11815
11817 {
11819 }
11820
11822 {
11823 return m_IsResultOfSplit;
11824 }
11825
11827 {
11828 m_IsResultOfSplit = value;
11829 }
11830
11832 {
11834 }
11835
11837 {
11838 float other_item_quantity = other_item.GetQuantity();
11839 float this_free_space;
11840
11842
11844
11845 if (other_item_quantity > this_free_space)
11846 {
11847 return this_free_space;
11848 }
11849 else
11850 {
11851 return other_item_quantity;
11852 }
11853 }
11854
11856 {
11858 }
11859
11861 {
11863 return;
11864
11865 if (!IsMagazine() && other_item)
11866 {
11868 if (quantity_used != 0)
11869 {
11870 float hp1 = GetHealth01("","");
11871 float hp2 = other_item.GetHealth01("","");
11872 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11873 hpResult = hpResult / (
GetQuantity() + quantity_used);
11874
11875 hpResult *= GetMaxHealth();
11876 Math.Round(hpResult);
11877 SetHealth("", "Health", hpResult);
11878
11880 other_item.AddQuantity(-quantity_used);
11881 }
11882 }
11884 }
11885
11887 {
11888 #ifdef SERVER
11889 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11890 GetHierarchyParent().IncreaseLifetimeUp();
11891 #endif
11892 };
11893
11895 {
11896 PlayerBase p = PlayerBase.Cast(player);
11897
11898 array<int> recipesIds = p.m_Recipes;
11899 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11900 if (moduleRecipesManager)
11901 {
11902 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11903 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11904 }
11905
11906 for (int i = 0;i < recipesIds.Count(); i++)
11907 {
11908 int key = recipesIds.Get(i);
11909 string recipeName = moduleRecipesManager.GetRecipeName(key);
11911 }
11912 }
11913
11914
11915 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11916 {
11917 super.GetDebugActions(outputList);
11918
11919
11925
11926
11931
11936
11937
11941
11942
11944 {
11948 }
11949
11952
11953
11957
11959
11960 InventoryLocation loc = new InventoryLocation();
11961 GetInventory().GetCurrentInventoryLocation(loc);
11963 {
11964 if (Gizmo_IsSupported())
11967 }
11968
11970 }
11971
11972
11973
11974
11976 {
11977 super.OnAction(action_id, player, ctx);
11978
11980 {
11981 switch (action_id)
11982 {
11985 return true;
11988 return true;
11989 }
11990 }
11991
11993 {
11994 switch (action_id)
11995 {
11997 Delete();
11998 return true;
11999 }
12000 }
12001
12002 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
12003 {
12004 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12005 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
12006 PlayerBase p = PlayerBase.Cast(player);
12007 if (
EActions.RECIPES_RANGE_START < 1000)
12008 {
12009 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
12010 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
12011 }
12012 }
12013 #ifndef SERVER
12014 else if (action_id ==
EActions.WATCH_PLAYER)
12015 {
12016 PluginDeveloper.SetDeveloperItemClientEx(player);
12017 }
12018 #endif
12020 {
12021 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
12022 {
12023 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
12024 OnDebugButtonPressServer(id + 1);
12025 }
12026
12027 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
12028 {
12029 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
12031 }
12032
12033 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
12034 {
12035 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
12037 }
12038
12039 else if (action_id ==
EActions.ADD_QUANTITY)
12040 {
12041 if (IsMagazine())
12042 {
12043 Magazine mag = Magazine.Cast(this);
12044 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
12045 }
12046 else
12047 {
12049 }
12050
12051 if (m_EM)
12052 {
12053 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12054 }
12055
12056 }
12057
12058 else if (action_id ==
EActions.REMOVE_QUANTITY)
12059 {
12060 if (IsMagazine())
12061 {
12062 Magazine mag2 = Magazine.Cast(this);
12063 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12064 }
12065 else
12066 {
12068 }
12069 if (m_EM)
12070 {
12071 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12072 }
12073
12074 }
12075
12076 else if (action_id ==
EActions.SET_QUANTITY_0)
12077 {
12079
12080 if (m_EM)
12081 {
12082 m_EM.SetEnergy(0);
12083 }
12084 }
12085
12086 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12087 {
12089
12090 if (m_EM)
12091 {
12092 m_EM.SetEnergy(m_EM.GetEnergyMax());
12093 }
12094 }
12095
12096 else if (action_id ==
EActions.ADD_HEALTH)
12097 {
12098 AddHealth("","",GetMaxHealth("","Health")/5);
12099 }
12100 else if (action_id ==
EActions.REMOVE_HEALTH)
12101 {
12102 AddHealth("","",-GetMaxHealth("","Health")/5);
12103 }
12104 else if (action_id ==
EActions.DESTROY_HEALTH)
12105 {
12106 SetHealth01("","",0);
12107 }
12108 else if (action_id ==
EActions.WATCH_ITEM)
12109 {
12111 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12112 #ifdef DEVELOPER
12113 SetDebugDeveloper_item(this);
12114 #endif
12115 }
12116
12117 else if (action_id ==
EActions.ADD_TEMPERATURE)
12118 {
12119 AddTemperature(20);
12120
12121 }
12122
12123 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12124 {
12125 AddTemperature(-20);
12126
12127 }
12128
12129 else if (action_id ==
EActions.FLIP_FROZEN)
12130 {
12131 SetFrozen(!GetIsFrozen());
12132
12133 }
12134
12135 else if (action_id ==
EActions.ADD_WETNESS)
12136 {
12138
12139 }
12140
12141 else if (action_id ==
EActions.REMOVE_WETNESS)
12142 {
12144
12145 }
12146
12147 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12148 {
12151
12152
12153 }
12154
12155 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12156 {
12159 }
12160
12161 else if (action_id ==
EActions.MAKE_SPECIAL)
12162 {
12163 auto debugParams = DebugSpawnParams.WithPlayer(player);
12164 OnDebugSpawnEx(debugParams);
12165 }
12166
12167 }
12168
12169
12170 return false;
12171 }
12172
12173
12174
12175
12179
12182
12183
12184
12186 {
12187 return false;
12188 }
12189
12190
12192 {
12193 return true;
12194 }
12195
12196
12198 {
12199 return true;
12200 }
12201
12202
12203
12205 {
12206 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12208 }
12209
12212 {
12213 return null;
12214 }
12215
12217 {
12218 return false;
12219 }
12220
12222 {
12223 return false;
12224 }
12225
12229
12230
12232 {
12233 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12234 return module_repairing.CanRepair(this, item_repair_kit);
12235 }
12236
12237
12238 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12239 {
12240 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12241 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12242 }
12243
12244
12246 {
12247
12248
12249
12250
12251
12252
12253
12254
12255 return 1;
12256 }
12257
12258
12259
12261 {
12263 }
12264
12265
12266
12268 {
12270 }
12271
12272
12281 {
12282 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12283
12284 if (player)
12285 {
12286 player.MessageStatus(text);
12287 }
12288 }
12289
12290
12299 {
12300 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12301
12302 if (player)
12303 {
12304 player.MessageAction(text);
12305 }
12306 }
12307
12308
12317 {
12318 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12319
12320 if (player)
12321 {
12322 player.MessageFriendly(text);
12323 }
12324 }
12325
12326
12335 {
12336 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12337
12338 if (player)
12339 {
12340 player.MessageImportant(text);
12341 }
12342 }
12343
12345 {
12346 return true;
12347 }
12348
12349
12350 override bool KindOf(
string tag)
12351 {
12352 bool found = false;
12353 string item_name = this.
GetType();
12356
12357 int array_size = item_tag_array.Count();
12358 for (int i = 0; i < array_size; i++)
12359 {
12360 if (item_tag_array.Get(i) == tag)
12361 {
12362 found = true;
12363 break;
12364 }
12365 }
12366 return found;
12367 }
12368
12369
12371 {
12372
12373 super.OnRPC(sender, rpc_type,ctx);
12374
12375
12376 switch (rpc_type)
12377 {
12378 #ifndef SERVER
12379 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12380 Param2<bool, string> p = new Param2<bool, string>(false, "");
12381
12383 return;
12384
12385 bool play = p.param1;
12386 string soundSet = p.param2;
12387
12388 if (play)
12389 {
12391 {
12393 {
12395 }
12396 }
12397 else
12398 {
12400 }
12401 }
12402 else
12403 {
12405 }
12406
12407 break;
12408 #endif
12409
12410 }
12411
12413 {
12415 }
12416 }
12417
12418
12419
12420
12422 {
12423 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12424 return plugin.GetID(
name);
12425 }
12426
12428 {
12429 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12430 return plugin.GetName(id);
12431 }
12432
12435 {
12436
12437
12438 int varFlags;
12439 if (!ctx.
Read(varFlags))
12440 return;
12441
12442 if (varFlags & ItemVariableFlags.FLOAT)
12443 {
12445 }
12446 }
12447
12449 {
12450
12451 super.SerializeNumericalVars(floats_out);
12452
12453
12454
12456 {
12458 }
12459
12461 {
12463 }
12464
12466 {
12468 }
12469
12471 {
12476 }
12477
12479 {
12481 }
12482 }
12483
12485 {
12486
12487 super.DeSerializeNumericalVars(floats);
12488
12489
12490 int index = 0;
12491 int mask = Math.Round(floats.Get(index));
12492
12493 index++;
12494
12496 {
12498 {
12500 }
12501 else
12502 {
12503 float quantity = floats.Get(index);
12504 SetQuantity(quantity,
true,
false,
false,
false);
12505 }
12506 index++;
12507 }
12508
12510 {
12511 float wet = floats.Get(index);
12513 index++;
12514 }
12515
12517 {
12518 int liquidtype = Math.Round(floats.Get(index));
12520 index++;
12521 }
12522
12524 {
12526 index++;
12528 index++;
12530 index++;
12532 index++;
12533 }
12534
12536 {
12537 int cleanness = Math.Round(floats.Get(index));
12539 index++;
12540 }
12541 }
12542
12544 {
12545 super.WriteVarsToCTX(ctx);
12546
12547
12549 {
12551 }
12552
12554 {
12556 }
12557
12559 {
12561 }
12562
12564 {
12565 int r,g,b,a;
12571 }
12572
12574 {
12576 }
12577 }
12578
12580 {
12581 if (!super.ReadVarsFromCTX(ctx,version))
12582 return false;
12583
12584 int intValue;
12585 float value;
12586
12587 if (version < 140)
12588 {
12589 if (!ctx.
Read(intValue))
12590 return false;
12591
12592 m_VariablesMask = intValue;
12593 }
12594
12596 {
12597 if (!ctx.
Read(value))
12598 return false;
12599
12601 {
12603 }
12604 else
12605 {
12607 }
12608 }
12609
12610 if (version < 140)
12611 {
12613 {
12614 if (!ctx.
Read(value))
12615 return false;
12616 SetTemperatureDirect(value);
12617 }
12618 }
12619
12621 {
12622 if (!ctx.
Read(value))
12623 return false;
12625 }
12626
12628 {
12629 if (!ctx.
Read(intValue))
12630 return false;
12632 }
12633
12635 {
12636 int r,g,b,a;
12638 return false;
12640 return false;
12642 return false;
12644 return false;
12645
12647 }
12648
12650 {
12651 if (!ctx.
Read(intValue))
12652 return false;
12654 }
12655
12656 if (version >= 138 && version < 140)
12657 {
12659 {
12660 if (!ctx.
Read(intValue))
12661 return false;
12662 SetFrozen(intValue);
12663 }
12664 }
12665
12666 return true;
12667 }
12668
12669
12671 {
12674 {
12676 }
12677
12678 if (!super.OnStoreLoad(ctx, version))
12679 {
12681 return false;
12682 }
12683
12684 if (version >= 114)
12685 {
12686 bool hasQuickBarIndexSaved;
12687
12688 if (!ctx.
Read(hasQuickBarIndexSaved))
12689 {
12691 return false;
12692 }
12693
12694 if (hasQuickBarIndexSaved)
12695 {
12696 int itmQBIndex;
12697
12698
12699 if (!ctx.
Read(itmQBIndex))
12700 {
12702 return false;
12703 }
12704
12705 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12706 if (itmQBIndex != -1 && parentPlayer)
12707 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12708 }
12709 }
12710 else
12711 {
12712
12713 PlayerBase player;
12714 int itemQBIndex;
12715 if (version ==
int.
MAX)
12716 {
12717 if (!ctx.
Read(itemQBIndex))
12718 {
12720 return false;
12721 }
12722 }
12723 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12724 {
12725
12726 if (!ctx.
Read(itemQBIndex))
12727 {
12729 return false;
12730 }
12731 if (itemQBIndex != -1 && player)
12732 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12733 }
12734 }
12735
12736 if (version < 140)
12737 {
12738
12739 if (!LoadVariables(ctx, version))
12740 {
12742 return false;
12743 }
12744 }
12745
12746
12748 {
12750 return false;
12751 }
12752 if (version >= 132)
12753 {
12755 if (raib)
12756 {
12758 {
12760 return false;
12761 }
12762 }
12763 }
12764
12766 return true;
12767 }
12768
12769
12770
12772 {
12773 super.OnStoreSave(ctx);
12774
12775 PlayerBase player;
12776 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12777 {
12779
12780 int itemQBIndex = -1;
12781 itemQBIndex = player.FindQuickBarEntityIndex(this);
12782 ctx.
Write(itemQBIndex);
12783 }
12784 else
12785 {
12787 }
12788
12790
12792 if (raib)
12793 {
12795 }
12796 }
12797
12798
12800 {
12801 super.AfterStoreLoad();
12802
12804 {
12806 }
12807
12809 {
12812 }
12813 }
12814
12816 {
12817 super.EEOnAfterLoad();
12818
12820 {
12822 }
12823
12826 }
12827
12829 {
12830 return false;
12831 }
12832
12833
12834
12836 {
12838 {
12839 #ifdef PLATFORM_CONSOLE
12840
12842 {
12844 if (menu)
12845 {
12847 }
12848 }
12849 #endif
12850 }
12851
12853 {
12856 }
12857
12859 {
12860 SetWeightDirty();
12862 }
12864 {
12867 }
12868
12870 {
12873 }
12875 {
12878 }
12879
12880 super.OnVariablesSynchronized();
12881 }
12882
12883
12884
12886 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12887 {
12888 if (!IsServerCheck(allow_client))
12889 return false;
12890
12892 return false;
12893
12896
12897 if (value <= (min + 0.001))
12898 value = min;
12899
12900 if (value == min)
12901 {
12902 if (destroy_config)
12903 {
12904 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12905 if (dstr)
12906 {
12908 this.Delete();
12909 return true;
12910 }
12911 }
12912 else if (destroy_forced)
12913 {
12915 this.Delete();
12916 return true;
12917 }
12918
12920 }
12921
12924
12926 {
12928
12929 if (delta)
12931 }
12932
12934
12935 return false;
12936 }
12937
12938
12940 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12941 {
12943 }
12944
12946 {
12949 }
12950
12952 {
12955 }
12956
12958 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12959 {
12960 float value_clamped = Math.Clamp(value, 0, 1);
12962 SetQuantity(result, destroy_config, destroy_forced);
12963 }
12964
12965
12968 {
12970 }
12971
12973 {
12975 }
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12987 {
12988 int slot = -1;
12989 if (GetInventory())
12990 {
12991 InventoryLocation il = new InventoryLocation;
12992 GetInventory().GetCurrentInventoryLocation(il);
12994 }
12995
12997 }
12998
13000 {
13001 float quantity_max = 0;
13002
13004 {
13005 if (attSlotID != -1)
13006 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
13007
13008 if (quantity_max <= 0)
13010 }
13011
13012 if (quantity_max <= 0)
13014
13015 return quantity_max;
13016 }
13017
13019 {
13021 }
13022
13024 {
13026 }
13027
13028
13030 {
13032 }
13033
13035 {
13037 }
13038
13040 {
13042 }
13043
13044
13046 {
13047
13048 float weightEx = GetWeightEx();
13049 float special = GetInventoryAndCargoWeight();
13050 return weightEx - special;
13051 }
13052
13053
13055 {
13057 }
13058
13060 {
13062 {
13063 #ifdef DEVELOPER
13064 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13065 {
13066 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13068 }
13069 #endif
13070
13071 return GetQuantity() * GetConfigWeightModified();
13072 }
13073 else if (HasEnergyManager())
13074 {
13075 #ifdef DEVELOPER
13076 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13077 {
13078 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13079 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13080 }
13081 #endif
13082 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13083 }
13084 else
13085 {
13086 #ifdef DEVELOPER
13087 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13088 {
13089 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13090 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13091 }
13092 #endif
13093 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13094 }
13095 }
13096
13099 {
13100 int item_count = 0;
13102
13103 if (GetInventory().GetCargo() != NULL)
13104 {
13105 item_count = GetInventory().GetCargo().GetItemCount();
13106 }
13107
13108 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13109 {
13110 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13111 if (item)
13112 item_count += item.GetNumberOfItems();
13113 }
13114 return item_count;
13115 }
13116
13119 {
13120 float weight = 0;
13121 float wetness = 1;
13122 if (include_wetness)
13125 {
13126 weight = wetness * m_ConfigWeight;
13127 }
13129 {
13130 weight = 1;
13131 }
13132 return weight;
13133 }
13134
13135
13136
13138 {
13139 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13140 {
13141 GameInventory inv = GetInventory();
13142 array<EntityAI> items = new array<EntityAI>;
13144 for (int i = 0; i < items.Count(); i++)
13145 {
13147 if (item)
13148 {
13150 }
13151 }
13152 }
13153 }
13154
13155
13156
13157
13159 {
13160 float energy = 0;
13161 if (HasEnergyManager())
13162 {
13163 energy = GetCompEM().GetEnergy();
13164 }
13165 return energy;
13166 }
13167
13168
13170 {
13171 super.OnEnergyConsumed();
13172
13174 }
13175
13177 {
13178 super.OnEnergyAdded();
13179
13181 }
13182
13183
13185 {
13186 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13187 {
13189 {
13190 float energy_0to1 = GetCompEM().GetEnergy0To1();
13192 }
13193 }
13194 }
13195
13196
13198 {
13199 return ConfigGetFloat("heatIsolation");
13200 }
13201
13203 {
13205 }
13206
13208 {
13209 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13210 if (
GetGame().ConfigIsExisting(paramPath))
13212
13213 return 0.0;
13214 }
13215
13217 {
13218 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13219 if (
GetGame().ConfigIsExisting(paramPath))
13221
13222 return 0.0;
13223 }
13224
13225 override void SetWet(
float value,
bool allow_client =
false)
13226 {
13227 if (!IsServerCheck(allow_client))
13228 return;
13229
13232
13234
13235 m_VarWet = Math.Clamp(value, min, max);
13236
13238 {
13241 }
13242 }
13243
13244 override void AddWet(
float value)
13245 {
13247 }
13248
13250 {
13252 }
13253
13255 {
13257 }
13258
13260 {
13262 }
13263
13265 {
13267 }
13268
13270 {
13272 }
13273
13274 override void OnWetChanged(
float newVal,
float oldVal)
13275 {
13278 if (newLevel != oldLevel)
13279 {
13281 }
13282 }
13283
13285 {
13286 SetWeightDirty();
13287 }
13288
13290 {
13291 return GetWetLevelInternal(
m_VarWet);
13292 }
13293
13294
13295
13297 {
13299 }
13300
13302 {
13304 }
13305
13307 {
13309 }
13310
13312 {
13314 }
13315
13316
13317
13319 {
13320 if (ConfigIsExisting("itemModelLength"))
13321 {
13322 return ConfigGetFloat("itemModelLength");
13323 }
13324 return 0;
13325 }
13326
13328 {
13329 if (ConfigIsExisting("itemAttachOffset"))
13330 {
13331 return ConfigGetFloat("itemAttachOffset");
13332 }
13333 return 0;
13334 }
13335
13336 override void SetCleanness(
int value,
bool allow_client =
false)
13337 {
13338 if (!IsServerCheck(allow_client))
13339 return;
13340
13342
13344
13347 }
13348
13350 {
13352 }
13353
13355 {
13356 return true;
13357 }
13358
13359
13360
13361
13363 {
13365 }
13366
13368 {
13370 }
13371
13372
13373
13374
13375 override void SetColor(
int r,
int g,
int b,
int a)
13376 {
13382 }
13384 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13385 {
13390 }
13391
13393 {
13395 }
13396
13399 {
13400 int r,g,b,a;
13402 r = r/255;
13403 g = g/255;
13404 b = b/255;
13405 a = a/255;
13406 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13407 }
13408
13409
13410
13411 override void SetLiquidType(
int value,
bool allow_client =
false)
13412 {
13413 if (!IsServerCheck(allow_client))
13414 return;
13415
13420 }
13421
13423 {
13424 return ConfigGetInt("varLiquidTypeInit");
13425 }
13426
13428 {
13430 }
13431
13433 {
13435 SetFrozen(false);
13436 }
13437
13440 {
13441 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13442 }
13443
13444
13447 {
13448 PlayerBase nplayer;
13449 if (PlayerBase.CastTo(nplayer, player))
13450 {
13452
13453 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13454 }
13455 }
13456
13457
13460 {
13461 PlayerBase nplayer;
13462 if (PlayerBase.CastTo(nplayer,player))
13463 {
13464
13465 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13466
13467 }
13468
13469
13470 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13471
13472
13473 if (HasEnergyManager())
13474 {
13475 GetCompEM().UpdatePlugState();
13476 }
13477 }
13478
13479
13481 {
13482 super.OnPlacementStarted(player);
13483
13485 }
13486
13487 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13488 {
13490 {
13491 m_AdminLog.OnPlacementComplete(player,
this);
13492 }
13493
13494 super.OnPlacementComplete(player, position, orientation);
13495 }
13496
13497
13498
13499
13500
13502 {
13504 {
13505 return true;
13506 }
13507 else
13508 {
13509 return false;
13510 }
13511 }
13512
13513
13515 {
13517 {
13519 }
13520 }
13521
13522
13524 {
13526 }
13527
13529 {
13531 }
13532
13533 override void InsertAgent(
int agent,
float count = 1)
13534 {
13535 if (count < 1)
13536 return;
13537
13539 }
13540
13543 {
13545 }
13546
13547
13549 {
13551 }
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13595 {
13597 return false;
13598 return true;
13599 }
13600
13602 {
13603
13605 }
13606
13607
13610 {
13611 super.CheckForRoofLimited(timeTresholdMS);
13612
13614 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13615 {
13616 m_PreviousRoofTestTime = time;
13617 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13618 }
13619 }
13620
13621
13623 {
13625 {
13626 return 0;
13627 }
13628
13629 if (GetInventory().GetAttachmentSlotsCount() != 0)
13630 {
13631 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13632 if (filter)
13633 return filter.GetProtectionLevel(type, false, system);
13634 else
13635 return 0;
13636 }
13637
13638 string subclassPath, entryName;
13639
13640 switch (type)
13641 {
13643 entryName = "biological";
13644 break;
13646 entryName = "chemical";
13647 break;
13648 default:
13649 entryName = "biological";
13650 break;
13651 }
13652
13653 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13654
13656 }
13657
13658
13659
13662 {
13663 if (!IsMagazine())
13665
13667 }
13668
13669
13670
13671
13672
13677 {
13678 return true;
13679 }
13680
13682 {
13684 }
13685
13686
13687
13688
13689
13691 {
13692 if (parent)
13693 {
13694 if (parent.IsInherited(DayZInfected))
13695 return true;
13696
13697 if (!parent.IsRuined())
13698 return true;
13699 }
13700
13701 return true;
13702 }
13703
13705 {
13706 if (!super.CanPutAsAttachment(parent))
13707 {
13708 return false;
13709 }
13710
13711 if (!IsRuined() && !parent.IsRuined())
13712 {
13713 return true;
13714 }
13715
13716 return false;
13717 }
13718
13720 {
13721
13722
13723
13724
13725 return super.CanReceiveItemIntoCargo(item);
13726 }
13727
13729 {
13730
13731
13732
13733
13734 GameInventory attachmentInv = attachment.GetInventory();
13736 {
13737 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13738 return false;
13739 }
13740
13741 InventoryLocation loc = new InventoryLocation();
13742 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13743 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13744 return false;
13745
13746 return super.CanReceiveAttachment(attachment, slotId);
13747 }
13748
13750 {
13751 if (!super.CanReleaseAttachment(attachment))
13752 return false;
13753
13754 return GetInventory().AreChildrenAccessible();
13755 }
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13778 {
13779 int id = muzzle_owner.GetMuzzleID();
13780 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13781
13782 if (WPOF_array)
13783 {
13784 for (int i = 0; i < WPOF_array.Count(); i++)
13785 {
13786 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13787
13788 if (WPOF)
13789 {
13790 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13791 }
13792 }
13793 }
13794 }
13795
13796
13798 {
13799 int id = muzzle_owner.GetMuzzleID();
13801
13802 if (WPOBE_array)
13803 {
13804 for (int i = 0; i < WPOBE_array.Count(); i++)
13805 {
13806 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13807
13808 if (WPOBE)
13809 {
13810 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13811 }
13812 }
13813 }
13814 }
13815
13816
13818 {
13819 int id = muzzle_owner.GetMuzzleID();
13820 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13821
13822 if (WPOOH_array)
13823 {
13824 for (int i = 0; i < WPOOH_array.Count(); i++)
13825 {
13826 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13827
13828 if (WPOOH)
13829 {
13830 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13831 }
13832 }
13833 }
13834 }
13835
13836
13838 {
13839 int id = muzzle_owner.GetMuzzleID();
13840 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13841
13842 if (WPOOH_array)
13843 {
13844 for (int i = 0; i < WPOOH_array.Count(); i++)
13845 {
13846 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13847
13848 if (WPOOH)
13849 {
13850 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13851 }
13852 }
13853 }
13854 }
13855
13856
13858 {
13859 int id = muzzle_owner.GetMuzzleID();
13860 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13861
13862 if (WPOOH_array)
13863 {
13864 for (int i = 0; i < WPOOH_array.Count(); i++)
13865 {
13866 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13867
13868 if (WPOOH)
13869 {
13870 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13871 }
13872 }
13873 }
13874 }
13875
13876
13877
13879 {
13881 {
13882 return true;
13883 }
13884
13885 return false;
13886 }
13887
13889 {
13891 {
13892 return true;
13893 }
13894
13895 return false;
13896 }
13897
13899 {
13901 {
13902 return true;
13903 }
13904
13905 return false;
13906 }
13907
13909 {
13910 return false;
13911 }
13912
13915 {
13916 return UATimeSpent.DEFAULT_DEPLOY;
13917 }
13918
13919
13920
13921
13923 {
13925 SetSynchDirty();
13926 }
13927
13929 {
13931 }
13932
13933
13935 {
13936 return false;
13937 }
13938
13941 {
13942 string att_type = "None";
13943
13944 if (ConfigIsExisting("soundAttType"))
13945 {
13946 att_type = ConfigGetString("soundAttType");
13947 }
13948
13950 }
13951
13953 {
13955 }
13956
13957
13958
13959
13960
13966
13968 {
13971
13973 }
13974
13975
13977 {
13979 return;
13980
13982
13985
13988
13989 SoundParameters params = new SoundParameters();
13993 }
13994
13995
13997 {
13999 return;
14000
14002 SetSynchDirty();
14003
14006 }
14007
14008
14010 {
14012 return;
14013
14015 SetSynchDirty();
14016
14019 }
14020
14022 {
14024 }
14025
14027 {
14029 }
14030
14033 {
14034 if (!
GetGame().IsDedicatedServer())
14035 {
14036 if (ConfigIsExisting("attachSoundSet"))
14037 {
14038 string cfg_path = "";
14039 string soundset = "";
14040 string type_name =
GetType();
14041
14044 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
14045 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
14046
14047 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
14048 {
14049 for (int i = 0; i < cfg_soundset_array.Count(); i++)
14050 {
14051 if (cfg_slot_array[i] == slot_type)
14052 {
14053 soundset = cfg_soundset_array[i];
14054 break;
14055 }
14056 }
14057 }
14058
14059 if (soundset != "")
14060 {
14061 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14063 }
14064 }
14065 }
14066 }
14067
14069 {
14070
14071 }
14072
14073 void OnApply(PlayerBase player);
14074
14076 {
14077 return 1.0;
14078 };
14079
14081 {
14083 }
14084
14086 {
14088 }
14089
14091
14093 {
14094 SetDynamicPhysicsLifeTime(0.01);
14096 }
14097
14099 {
14100 array<string> zone_names = new array<string>;
14101 GetDamageZones(zone_names);
14102 for (int i = 0; i < zone_names.Count(); i++)
14103 {
14104 SetHealthMax(zone_names.Get(i),"Health");
14105 }
14106 SetHealthMax("","Health");
14107 }
14108
14111 {
14112 float global_health = GetHealth01("","Health");
14113 array<string> zones = new array<string>;
14114 GetDamageZones(zones);
14115
14116 for (int i = 0; i < zones.Count(); i++)
14117 {
14118 SetHealth01(zones.Get(i),"Health",global_health);
14119 }
14120 }
14121
14124 {
14125 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14126 }
14127
14129 {
14130 if (!hasRootAsPlayer)
14131 {
14132 if (refParentIB)
14133 {
14134
14135 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14136 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14137
14138 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14139 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14140
14143 }
14144 else
14145 {
14146
14149 }
14150 }
14151 }
14152
14154 {
14156 {
14157 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14158 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14159 {
14160 float heatPermCoef = 1.0;
14162 while (ent)
14163 {
14164 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14165 ent = ent.GetHierarchyParent();
14166 }
14167
14168 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14169 }
14170 }
14171 }
14172
14174 {
14175
14176 EntityAI parent = GetHierarchyParent();
14177 if (!parent)
14178 {
14179 hasParent = false;
14180 hasRootAsPlayer = false;
14181 }
14182 else
14183 {
14184 hasParent = true;
14185 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14186 refParentIB =
ItemBase.Cast(parent);
14187 }
14188 }
14189
14190 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14191 {
14192
14193 }
14194
14196 {
14197
14198 return false;
14199 }
14200
14202 {
14203
14204
14205 return false;
14206 }
14207
14209 {
14210
14211 return false;
14212 }
14213
14216 {
14217 return !GetIsFrozen() &&
IsOpen();
14218 }
14219
14221 {
14222 bool hasParent = false, hasRootAsPlayer = false;
14224
14225 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14226 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14227
14228 if (wwtu || foodDecay)
14229 {
14233
14234 if (processWetness || processTemperature || processDecay)
14235 {
14237
14238 if (processWetness)
14239 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14240
14241 if (processTemperature)
14243
14244 if (processDecay)
14245 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14246 }
14247 }
14248 }
14249
14252 {
14254 }
14255
14257 {
14260
14261 return super.GetTemperatureFreezeThreshold();
14262 }
14263
14265 {
14268
14269 return super.GetTemperatureThawThreshold();
14270 }
14271
14273 {
14276
14277 return super.GetItemOverheatThreshold();
14278 }
14279
14281 {
14283 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14284
14285 return super.GetTemperatureFreezeTime();
14286 }
14287
14289 {
14291 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14292
14293 return super.GetTemperatureThawTime();
14294 }
14295
14300
14302 {
14303 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14304 }
14305
14307 {
14308 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14309 }
14310
14313 {
14315 }
14316
14318 {
14320 }
14321
14323 {
14325 }
14326
14329 {
14330 return null;
14331 }
14332
14335 {
14336 return false;
14337 }
14338
14340 {
14342 {
14345 if (!trg)
14346 {
14348 explosive = this;
14349 }
14350
14351 explosive.PairRemote(trg);
14353
14354 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14355 trg.SetPersistentPairID(persistentID);
14356 explosive.SetPersistentPairID(persistentID);
14357
14358 return true;
14359 }
14360 return false;
14361 }
14362
14365 {
14366 float ret = 1.0;
14369 ret *= GetHealth01();
14370
14371 return ret;
14372 }
14373
14374 #ifdef DEVELOPER
14375 override void SetDebugItem()
14376 {
14377 super.SetDebugItem();
14378 _itemBase = this;
14379 }
14380
14382 {
14383 string text = super.GetDebugText();
14384
14386 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14387
14388 return text;
14389 }
14390 #endif
14391
14393 {
14394 return true;
14395 }
14396
14398
14400
14402 {
14405 }
14406
14407
14415
14431}
14432
14434{
14436 if (entity)
14437 {
14438 bool is_item = entity.IsInherited(
ItemBase);
14439 if (is_item && full_quantity)
14440 {
14443 }
14444 }
14445 else
14446 {
14448 return NULL;
14449 }
14450 return entity;
14451}
14452
14454{
14455 if (item)
14456 {
14457 if (health > 0)
14458 item.SetHealth("", "", health);
14459
14460 if (item.CanHaveTemperature())
14461 {
14463 if (item.CanFreeze())
14464 item.SetFrozen(false);
14465 }
14466
14467 if (item.HasEnergyManager())
14468 {
14469 if (quantity >= 0)
14470 {
14471 item.GetCompEM().SetEnergy0To1(quantity);
14472 }
14473 else
14474 {
14476 }
14477 }
14478 else if (item.IsMagazine())
14479 {
14480 Magazine mag = Magazine.Cast(item);
14481 if (quantity >= 0)
14482 {
14483 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14484 }
14485 else
14486 {
14488 }
14489
14490 }
14491 else
14492 {
14493 if (quantity >= 0)
14494 {
14495 item.SetQuantityNormalized(quantity, false);
14496 }
14497 else
14498 {
14500 }
14501
14502 }
14503 }
14504}
14505
14506#ifdef DEVELOPER
14508#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.