9588{
9590 {
9591 return true;
9592 }
9593};
9594
9595
9596
9598{
9602
9604
9607
9608
9609
9610
9611
9620
9626
9631
9636
9657 protected bool m_IsResultOfSplit
9658
9660
9665
9666
9667
9669
9673
9674
9675
9677
9680
9681
9682
9688
9689
9697
9700
9701
9703
9704
9706
9707
9712
9713
9718
9719
9721
9722
9724 {
9729
9730 if (!
GetGame().IsDedicatedServer())
9731 {
9733 {
9735
9737 {
9739 }
9740 }
9741
9744 }
9745
9746 m_OldLocation = null;
9747
9749 {
9751 }
9752
9753 if (ConfigIsExisting("headSelectionsToHide"))
9754 {
9757 }
9758
9760 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9761 {
9763 }
9764
9766
9767 m_IsResultOfSplit = false;
9768
9770 }
9771
9773 {
9774 super.InitItemVariables();
9775
9781 m_Count = ConfigGetInt(
"count");
9782
9785
9790
9793
9798
9810
9814
9815
9818 if (ConfigIsExisting("canBeSplit"))
9819 {
9822 }
9823
9825 if (ConfigIsExisting("itemBehaviour"))
9827
9828
9831 RegisterNetSyncVariableInt("m_VarLiquidType");
9832 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9833
9834 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9835 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9836 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9837
9838 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9839 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9840 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9841 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9842
9843 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9844 RegisterNetSyncVariableBool("m_IsTakeable");
9845 RegisterNetSyncVariableBool("m_IsHologram");
9846
9849 {
9852 }
9853
9855
9857 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9859
9860 }
9861
9863 {
9865 }
9866
9868 {
9871 {
9876 }
9877 }
9878
9879 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9880 {
9882 {
9885 }
9886
9888 }
9889
9891 {
9897 }
9898
9900
9902 {
9904
9905 if (!action)
9906 {
9907 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9908 return;
9909 }
9910
9912 if (!ai)
9913 {
9915 return;
9916 }
9917
9919 if (!action_array)
9920 {
9921 action_array = new array<ActionBase_Basic>;
9923 }
9924 if (LogManager.IsActionLogEnable())
9925 {
9926 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9927 }
9928
9929 if (action_array.Find(action) != -1)
9930 {
9931 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9932 }
9933 else
9934 {
9935 action_array.Insert(action);
9936 }
9937 }
9938
9940 {
9942 ActionBase action = player.GetActionManager().GetAction(actionName);
9945
9946 if (action_array)
9947 {
9948 action_array.RemoveItem(action);
9949 }
9950 }
9951
9952
9953
9955 {
9956 ActionOverrideData overrideData = new ActionOverrideData();
9960
9962 if (!actionMap)
9963 {
9966 }
9967
9968 actionMap.Insert(this.
Type(), overrideData);
9969
9970 }
9971
9973
9975
9976
9978 {
9981
9984
9985 string config_to_search = "CfgVehicles";
9986 string muzzle_owner_config;
9987
9989 {
9990 if (IsInherited(Weapon))
9991 config_to_search = "CfgWeapons";
9992
9993 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9994
9995 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9996
9998
9999 if (config_OnFire_subclass_count > 0)
10000 {
10001 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
10002
10003 for (int i = 0; i < config_OnFire_subclass_count; i++)
10004 {
10005 string particle_class = "";
10007 string config_OnFire_entry = config_OnFire_class + particle_class;
10008 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
10009 WPOF_array.Insert(WPOF);
10010 }
10011
10012
10014 }
10015 }
10016
10018 {
10019 config_to_search = "CfgWeapons";
10020 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10021
10022 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
10023
10025
10026 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
10027 {
10028 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
10029
10030 for (i = 0; i < config_OnBulletCasingEject_count; i++)
10031 {
10032 string particle_class2 = "";
10034 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
10035 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
10036 WPOBE_array.Insert(WPOBE);
10037 }
10038
10039
10041 }
10042 }
10043 }
10044
10045
10047 {
10050
10052 {
10053 string config_to_search = "CfgVehicles";
10054
10055 if (IsInherited(Weapon))
10056 config_to_search = "CfgWeapons";
10057
10058 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10059 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10060
10061 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10062 {
10063
10065
10067 {
10069 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10071 return;
10072 }
10073
10076
10077
10078
10080 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10081
10082 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10083 {
10084 string particle_class = "";
10086 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10088
10089 if (entry_type == CT_CLASS)
10090 {
10091 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10092 WPOOH_array.Insert(WPOF);
10093 }
10094 }
10095
10096
10098 }
10099 }
10100 }
10101
10103 {
10105 }
10106
10108 {
10110 {
10112
10115
10118
10119 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10120 }
10121 }
10122
10124 {
10126 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10127
10129 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10130
10132 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10133
10135 {
10137 }
10138 }
10139
10141 {
10143 }
10144
10146 {
10149 else
10151
10153 {
10156 }
10157 else
10158 {
10161
10164 }
10165
10167 }
10168
10170 {
10172 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10173 }
10174
10176 {
10178 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10180 }
10181
10183 {
10185 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10186 }
10187
10189 {
10192
10193 OverheatingParticle OP = new OverheatingParticle();
10198
10200 }
10201
10203 {
10206
10207 return -1;
10208 }
10209
10211 {
10213 {
10216
10217 for (int i = count; i > 0; --i)
10218 {
10219 int id = i - 1;
10222
10225
10226 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10227 {
10228 if (p)
10229 {
10232 }
10233 }
10234 }
10235 }
10236 }
10237
10239 {
10241 {
10243 {
10244 int id = i - 1;
10246
10247 if (OP)
10248 {
10250
10251 if (p)
10252 {
10254 }
10255
10256 delete OP;
10257 }
10258 }
10259
10262 }
10263 }
10264
10267 {
10268 return 0.0;
10269 }
10270
10271
10273 {
10274 return 250;
10275 }
10276
10278 {
10279 return 0;
10280 }
10281
10284 {
10286 return true;
10287
10288 return false;
10289 }
10290
10293 {
10296
10298 {
10300 }
10301 else
10302 {
10303
10305 }
10306
10308 }
10309
10316 {
10317 return -1;
10318 }
10319
10320
10321
10322
10324 {
10326 {
10328 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10329
10330 if (r_index >= 0)
10331 {
10332 InventoryLocation r_il = new InventoryLocation;
10333 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10334
10335 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10338 {
10339 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10340 }
10342 {
10343 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10344 }
10345
10346 }
10347
10348 player.GetHumanInventory().ClearUserReservedLocation(this);
10349 }
10350
10353 }
10354
10355
10356
10357
10359 {
10360 return ItemBase.m_DebugActionsMask;
10361 }
10362
10364 {
10365 return ItemBase.m_DebugActionsMask & mask;
10366 }
10367
10369 {
10370 ItemBase.m_DebugActionsMask = mask;
10371 }
10372
10374 {
10375 ItemBase.m_DebugActionsMask |= mask;
10376 }
10377
10379 {
10380 ItemBase.m_DebugActionsMask &= ~mask;
10381 }
10382
10384 {
10386 {
10388 }
10389 else
10390 {
10392 }
10393 }
10394
10395
10397 {
10398 if (GetEconomyProfile())
10399 {
10400 float q_max = GetEconomyProfile().GetQuantityMax();
10401 if (q_max > 0)
10402 {
10403 float q_min = GetEconomyProfile().GetQuantityMin();
10404 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10405
10407 {
10408 ComponentEnergyManager comp = GetCompEM();
10410 {
10412 }
10413 }
10415 {
10417
10418 }
10419
10420 }
10421 }
10422 }
10423
10426 {
10427 EntityAI parent = GetHierarchyParent();
10428
10429 if (parent)
10430 {
10431 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10432 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10433 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10434 }
10435 }
10436
10439 {
10440 EntityAI parent = GetHierarchyParent();
10441
10442 if (parent)
10443 {
10444 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10445 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10446 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10447 }
10448 }
10449
10451 {
10452
10453
10454
10455
10457
10459 {
10460 if (ScriptInputUserData.CanStoreInputUserData())
10461 {
10462 ScriptInputUserData ctx = new ScriptInputUserData;
10468 ctx.
Write(use_stack_max);
10471
10473 {
10474 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10475 }
10476 }
10477 }
10478 else if (!
GetGame().IsMultiplayer())
10479 {
10481 }
10482 }
10483
10485 {
10487 }
10488
10490 {
10492 }
10493
10495 {
10497 }
10498
10500 {
10501
10502 return false;
10503 }
10504
10506 {
10507 return false;
10508 }
10509
10513 {
10514 return false;
10515 }
10516
10518 {
10519 return "";
10520 }
10521
10523
10525 {
10526 return false;
10527 }
10528
10530 {
10531 return true;
10532 }
10533
10534
10535
10537 {
10538 return true;
10539 }
10540
10542 {
10543 return true;
10544 }
10545
10547 {
10548 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10550 }
10551
10553 {
10555 }
10556
10558 {
10560 if (!is_being_placed)
10562 SetSynchDirty();
10563 }
10564
10565
10567
10569 {
10571 }
10572
10574 {
10576 }
10577
10579 {
10580 return 1;
10581 }
10582
10584 {
10585 return false;
10586 }
10587
10589 {
10591 SetSynchDirty();
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
10623
10624
10625
10626
10627
10629 {
10630 super.OnMovedInsideCargo(container);
10631
10632 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10633 }
10634
10635 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10636 {
10637 super.EEItemLocationChanged(oldLoc,newLoc);
10638
10639 PlayerBase new_player = null;
10640 PlayerBase old_player = null;
10641
10642 if (newLoc.GetParent())
10643 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10644
10645 if (oldLoc.GetParent())
10646 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10647
10649 {
10650 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10651
10652 if (r_index >= 0)
10653 {
10654 InventoryLocation r_il = new InventoryLocation;
10655 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10656
10657 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10660 {
10661 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10662 }
10664 {
10665 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10666 }
10667
10668 }
10669 }
10670
10672 {
10673 if (new_player)
10674 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10675
10676 if (new_player == old_player)
10677 {
10678
10679 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10680 {
10682 {
10683 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10684 {
10685 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10686 }
10687 }
10688 else
10689 {
10690 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10691 }
10692 }
10693
10694 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10695 {
10696 int type = oldLoc.GetType();
10698 {
10699 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10700 }
10702 {
10703 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10704 }
10705 }
10706 if (!m_OldLocation)
10707 {
10708 m_OldLocation = new InventoryLocation;
10709 }
10710 m_OldLocation.Copy(oldLoc);
10711 }
10712 else
10713 {
10714 if (m_OldLocation)
10715 {
10716 m_OldLocation.Reset();
10717 }
10718 }
10719
10721 }
10722 else
10723 {
10724 if (new_player)
10725 {
10726 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10727 if (res_index >= 0)
10728 {
10729 InventoryLocation il = new InventoryLocation;
10730 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10732 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10735 {
10736 il.
GetParent().GetOnReleaseLock().Invoke(it);
10737 }
10739 {
10741 }
10742
10743 }
10744 }
10746 {
10747
10749 }
10750
10751 if (m_OldLocation)
10752 {
10753 m_OldLocation.Reset();
10754 }
10755 }
10756 }
10757
10758 override void EOnContact(IEntity other, Contact extra)
10759 {
10761 {
10762 int liquidType = -1;
10764 if (impactSpeed > 0.0)
10765 {
10767 #ifndef SERVER
10769 #else
10771 SetSynchDirty();
10772 #endif
10774 }
10775 }
10776
10777 #ifdef SERVER
10778 if (GetCompEM() && GetCompEM().IsPlugged())
10779 {
10780 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10781 GetCompEM().UnplugThis();
10782 }
10783 #endif
10784 }
10785
10787
10789 {
10791 }
10792
10794 {
10795
10796 }
10797
10799 {
10800 super.OnItemLocationChanged(old_owner, new_owner);
10801
10802 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10803 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10804
10805 if (!relatedPlayer && playerNew)
10806 relatedPlayer = playerNew;
10807
10808 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10809 {
10811 if (actionMgr)
10812 {
10813 ActionBase currentAction = actionMgr.GetRunningAction();
10814 if (currentAction)
10816 }
10817 }
10818
10819 Man ownerPlayerOld = null;
10820 Man ownerPlayerNew = null;
10821
10822 if (old_owner)
10823 {
10824 if (old_owner.
IsMan())
10825 {
10826 ownerPlayerOld = Man.Cast(old_owner);
10827 }
10828 else
10829 {
10830 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10831 }
10832 }
10833 else
10834 {
10836 {
10838
10839 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10840 {
10841 GetCompEM().UnplugThis();
10842 }
10843 }
10844 }
10845
10846 if (new_owner)
10847 {
10848 if (new_owner.
IsMan())
10849 {
10850 ownerPlayerNew = Man.Cast(new_owner);
10851 }
10852 else
10853 {
10854 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10855 }
10856 }
10857
10858 if (ownerPlayerOld != ownerPlayerNew)
10859 {
10860 if (ownerPlayerOld)
10861 {
10862 array<EntityAI> subItemsExit = new array<EntityAI>;
10864 for (int i = 0; i < subItemsExit.Count(); i++)
10865 {
10868 }
10869 }
10870
10871 if (ownerPlayerNew)
10872 {
10873 array<EntityAI> subItemsEnter = new array<EntityAI>;
10875 for (int j = 0; j < subItemsEnter.Count(); j++)
10876 {
10879 }
10880 }
10881 }
10882 else if (ownerPlayerNew != null)
10883 {
10884 PlayerBase nplayer;
10885 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10886 {
10887 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10889 for (int k = 0; k < subItemsUpdate.Count(); k++)
10890 {
10892 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10893 }
10894 }
10895 }
10896
10897 if (old_owner)
10898 old_owner.OnChildItemRemoved(this);
10899 if (new_owner)
10900 new_owner.OnChildItemReceived(this);
10901 }
10902
10903
10905 {
10906 super.EEDelete(parent);
10907 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10908 if (player)
10909 {
10911
10912 if (player.IsAlive())
10913 {
10914 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10915 if (r_index >= 0)
10916 {
10917 InventoryLocation r_il = new InventoryLocation;
10918 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10919
10920 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10923 {
10924 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10925 }
10927 {
10928 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10929 }
10930
10931 }
10932
10933 player.RemoveQuickBarEntityShortcut(this);
10934 }
10935 }
10936 }
10937
10939 {
10940 super.EEKilled(killer);
10941
10944 {
10945 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10946 {
10947 if (IsMagazine())
10948 {
10949 if (Magazine.Cast(this).GetAmmoCount() > 0)
10950 {
10952 }
10953 }
10954 else
10955 {
10957 }
10958 }
10959 }
10960 }
10961
10963 {
10964 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10965
10966 super.OnWasAttached(parent, slot_id);
10967
10970
10972 }
10973
10975 {
10976 super.OnWasDetached(parent, slot_id);
10977
10980 }
10981
10983 {
10984 int idx;
10987
10988 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10989 if (inventory_slots.Count() < 1)
10990 {
10991 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10992 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10993 }
10994 else
10995 {
10996 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10997 }
10998
10999 idx = inventory_slots.Find(slot);
11000 if (idx < 0)
11001 return "";
11002
11003 return attach_types.Get(idx);
11004 }
11005
11007 {
11008 int idx = -1;
11009 string slot;
11010
11013
11014 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11015 if (inventory_slots.Count() < 1)
11016 {
11017 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
11018 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11019 }
11020 else
11021 {
11022 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
11023 if (detach_types.Count() < 1)
11024 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11025 }
11026
11027 for (int i = 0; i < inventory_slots.Count(); i++)
11028 {
11029 slot = inventory_slots.Get(i);
11030 }
11031
11032 if (slot != "")
11033 {
11034 if (detach_types.Count() == 1)
11035 idx = 0;
11036 else
11037 idx = inventory_slots.Find(slot);
11038 }
11039 if (idx < 0)
11040 return "";
11041
11042 return detach_types.Get(idx);
11043 }
11044
11046 {
11047
11049
11050
11051 float min_time = 1;
11052 float max_time = 3;
11053 float delay = Math.RandomFloat(min_time, max_time);
11054
11055 explode_timer.Run(delay, this, "DoAmmoExplosion");
11056 }
11057
11059 {
11060 Magazine magazine = Magazine.Cast(this);
11061 int pop_sounds_count = 6;
11062 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11063
11064
11065 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11066 string sound_name = pop_sounds[ sound_idx ];
11068
11069
11070 magazine.ServerAddAmmoCount(-1);
11071
11072
11073 float min_temp_to_explode = 100;
11074
11075 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11076 {
11078 }
11079 }
11080
11081
11082 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11083 {
11084 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11085
11086 const int CHANCE_DAMAGE_CARGO = 4;
11087 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11088 const int CHANCE_DAMAGE_NOTHING = 2;
11089
11091 {
11092 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11093 int chances;
11094 int rnd;
11095
11096 if (GetInventory().GetCargo())
11097 {
11098 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11099 rnd = Math.RandomInt(0,chances);
11100
11101 if (rnd < CHANCE_DAMAGE_CARGO)
11102 {
11104 }
11105 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11106 {
11108 }
11109 }
11110 else
11111 {
11112 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11113 rnd = Math.RandomInt(0,chances);
11114
11115 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11116 {
11118 }
11119 }
11120 }
11121 }
11122
11124 {
11125 if (GetInventory().GetCargo())
11126 {
11127 int item_count = GetInventory().GetCargo().GetItemCount();
11128 if (item_count > 0)
11129 {
11130 int random_pick = Math.RandomInt(0, item_count);
11132 if (!item.IsExplosive())
11133 {
11134 item.AddHealth("","",damage);
11135 return true;
11136 }
11137 }
11138 }
11139 return false;
11140 }
11141
11143 {
11144 int attachment_count = GetInventory().AttachmentCount();
11145 if (attachment_count > 0)
11146 {
11147 int random_pick = Math.RandomInt(0, attachment_count);
11148 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11149 if (!attachment.IsExplosive())
11150 {
11151 attachment.AddHealth("","",damage);
11152 return true;
11153 }
11154 }
11155 return false;
11156 }
11157
11159 {
11161 }
11162
11164 {
11166 return GetInventory().CanRemoveEntity();
11167
11168 return false;
11169 }
11170
11172 {
11173
11175 return false;
11176
11177
11179 return false;
11180
11181
11182
11184 if (delta == 0)
11185 return false;
11186
11187
11188 return true;
11189 }
11190
11192 {
11194 {
11195 if (ScriptInputUserData.CanStoreInputUserData())
11196 {
11197 ScriptInputUserData ctx = new ScriptInputUserData;
11202 ctx.
Write(destination_entity);
11204 ctx.
Write(slot_id);
11206 }
11207 }
11208 else if (!
GetGame().IsMultiplayer())
11209 {
11211 }
11212 }
11213
11215 {
11216 float split_quantity_new;
11220 InventoryLocation loc = new InventoryLocation;
11221
11222 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11223 {
11225 split_quantity_new = stack_max;
11226 else
11228
11230 {
11231 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11232 if (new_item)
11233 {
11234 new_item.SetResultOfSplit(true);
11235 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11237 new_item.
SetQuantity(split_quantity_new,
false,
true);
11238 }
11239 }
11240 }
11241 else if (destination_entity && slot_id == -1)
11242 {
11243 if (quantity > stack_max)
11244 split_quantity_new = stack_max;
11245 else
11246 split_quantity_new = quantity;
11247
11249 {
11251 {
11254 }
11255
11256 if (new_item)
11257 {
11258 new_item.SetResultOfSplit(true);
11259 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11261 new_item.
SetQuantity(split_quantity_new,
false,
true);
11262 }
11263 }
11264 }
11265 else
11266 {
11267 if (stack_max != 0)
11268 {
11270 {
11272 }
11273
11274 if (split_quantity_new == 0)
11275 {
11276 if (!
GetGame().IsMultiplayer())
11277 player.PhysicalPredictiveDropItem(this);
11278 else
11279 player.ServerDropEntity(this);
11280 return;
11281 }
11282
11284 {
11286
11287 if (new_item)
11288 {
11289 new_item.SetResultOfSplit(true);
11290 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11293 new_item.PlaceOnSurface();
11294 }
11295 }
11296 }
11297 }
11298 }
11299
11301 {
11302 float split_quantity_new;
11306 InventoryLocation loc = new InventoryLocation;
11307
11308 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11309 {
11311 split_quantity_new = stack_max;
11312 else
11314
11316 {
11317 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11318 if (new_item)
11319 {
11320 new_item.SetResultOfSplit(true);
11321 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11323 new_item.
SetQuantity(split_quantity_new,
false,
true);
11324 }
11325 }
11326 }
11327 else if (destination_entity && slot_id == -1)
11328 {
11329 if (quantity > stack_max)
11330 split_quantity_new = stack_max;
11331 else
11332 split_quantity_new = quantity;
11333
11335 {
11337 {
11340 }
11341
11342 if (new_item)
11343 {
11344 new_item.SetResultOfSplit(true);
11345 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11347 new_item.
SetQuantity(split_quantity_new,
false,
true);
11348 }
11349 }
11350 }
11351 else
11352 {
11353 if (stack_max != 0)
11354 {
11356 {
11358 }
11359
11361 {
11363
11364 if (new_item)
11365 {
11366 new_item.SetResultOfSplit(true);
11367 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11370 new_item.PlaceOnSurface();
11371 }
11372 }
11373 }
11374 }
11375 }
11376
11378 {
11380 {
11381 if (ScriptInputUserData.CanStoreInputUserData())
11382 {
11383 ScriptInputUserData ctx = new ScriptInputUserData;
11388 dst.WriteToContext(ctx);
11390 }
11391 }
11392 else if (!
GetGame().IsMultiplayer())
11393 {
11395 }
11396 }
11397
11399 {
11401 {
11402 if (ScriptInputUserData.CanStoreInputUserData())
11403 {
11404 ScriptInputUserData ctx = new ScriptInputUserData;
11409 ctx.
Write(destination_entity);
11415 }
11416 }
11417 else if (!
GetGame().IsMultiplayer())
11418 {
11420 }
11421 }
11422
11424 {
11426 }
11427
11429 {
11431 float split_quantity_new;
11433 if (dst.IsValid())
11434 {
11435 int slot_id = dst.GetSlot();
11437
11438 if (quantity > stack_max)
11439 split_quantity_new = stack_max;
11440 else
11441 split_quantity_new = quantity;
11442
11444 {
11446
11447 if (new_item)
11448 {
11449 new_item.SetResultOfSplit(true);
11450 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11452 new_item.
SetQuantity(split_quantity_new,
false,
true);
11453 }
11454
11455 return new_item;
11456 }
11457 }
11458
11459 return null;
11460 }
11461
11463 {
11465 float split_quantity_new;
11467 if (destination_entity)
11468 {
11470 if (quantity > stackable)
11471 split_quantity_new = stackable;
11472 else
11473 split_quantity_new = quantity;
11474
11476 {
11477 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11478 if (new_item)
11479 {
11480 new_item.SetResultOfSplit(true);
11481 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11483 new_item.
SetQuantity(split_quantity_new,
false,
true);
11484 }
11485 }
11486 }
11487 }
11488
11490 {
11492 {
11493 if (ScriptInputUserData.CanStoreInputUserData())
11494 {
11495 ScriptInputUserData ctx = new ScriptInputUserData;
11500 ItemBase destination_entity =
this;
11501 ctx.
Write(destination_entity);
11505 }
11506 }
11507 else if (!
GetGame().IsMultiplayer())
11508 {
11510 }
11511 }
11512
11514 {
11516 float split_quantity_new;
11518 if (player)
11519 {
11521 if (quantity > stackable)
11522 split_quantity_new = stackable;
11523 else
11524 split_quantity_new = quantity;
11525
11527 {
11528 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11529 new_item =
ItemBase.Cast(in_hands);
11530 if (new_item)
11531 {
11532 new_item.SetResultOfSplit(true);
11533 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11535 new_item.SetQuantity(split_quantity_new, false, true);
11536 }
11537 }
11538 }
11539 }
11540
11542 {
11544 float split_quantity_new = Math.Floor(quantity * 0.5);
11545
11547 return;
11548
11550
11551 if (new_item)
11552 {
11553 if (new_item.GetQuantityMax() < split_quantity_new)
11554 {
11555 split_quantity_new = new_item.GetQuantityMax();
11556 }
11557
11558 new_item.SetResultOfSplit(true);
11559 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11560
11562 {
11565 }
11566 else
11567 {
11569 new_item.
SetQuantity(split_quantity_new,
false,
true);
11570 }
11571 }
11572 }
11573
11575 {
11577 float split_quantity_new = Math.Floor(quantity / 2);
11578
11580 return;
11581
11582 InventoryLocation invloc = new InventoryLocation;
11584
11586 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11587
11588 if (new_item)
11589 {
11590 if (new_item.GetQuantityMax() < split_quantity_new)
11591 {
11592 split_quantity_new = new_item.GetQuantityMax();
11593 }
11595 {
11598 }
11599 else if (split_quantity_new > 1)
11600 {
11602 new_item.
SetQuantity(split_quantity_new,
false,
true);
11603 }
11604 }
11605 }
11606
11609 {
11610 SetWeightDirty();
11612
11613 if (parent)
11614 parent.OnAttachmentQuantityChangedEx(this, delta);
11615
11617 {
11619 {
11621 }
11623 {
11624 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11626 }
11627 }
11628
11629 }
11630
11633 {
11634
11635 }
11636
11639 {
11641 }
11642
11644 {
11645 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11646
11648 {
11649 if (newLevel == GameConstants.STATE_RUINED)
11650 {
11652 EntityAI parent = GetHierarchyParent();
11653 if (parent && parent.IsFireplace())
11654 {
11655 CargoBase cargo = GetInventory().GetCargo();
11656 if (cargo)
11657 {
11659 {
11661 }
11662 }
11663 }
11664 }
11665
11667 {
11668
11670 return;
11671 }
11672
11673 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11674 {
11676 }
11677 }
11678 }
11679
11680
11682 {
11683 super.OnRightClick();
11684
11686 {
11688 {
11689 if (ScriptInputUserData.CanStoreInputUserData())
11690 {
11691 EntityAI root = GetHierarchyRoot();
11692 Man playerOwner = GetHierarchyRootPlayer();
11693 InventoryLocation dst = new InventoryLocation;
11694
11695
11696 if (!playerOwner && root && root == this)
11697 {
11699 }
11700 else
11701 {
11702
11703 GetInventory().GetCurrentInventoryLocation(dst);
11705 {
11708 {
11710 }
11711 else
11712 {
11714
11715
11716 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11717 {
11719 }
11720 else
11721 {
11722 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11723 }
11724 }
11725 }
11726 }
11727
11728 ScriptInputUserData ctx = new ScriptInputUserData;
11736 }
11737 }
11738 else if (!
GetGame().IsMultiplayer())
11739 {
11741 }
11742 }
11743 }
11744
11746 {
11747 if (root)
11748 {
11749 vector m4[4];
11750 root.GetTransform(m4);
11751 dst.SetGround(this, m4);
11752 }
11753 else
11754 {
11755 GetInventory().GetCurrentInventoryLocation(dst);
11756 }
11757 }
11758
11759 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11760 {
11761
11762 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11763 return false;
11764
11765 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11766 return false;
11767
11768
11770 return false;
11771
11772
11773 Magazine mag = Magazine.Cast(this);
11774 if (mag)
11775 {
11776 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11777 return false;
11778
11779 if (stack_max_limit)
11780 {
11781 Magazine other_mag = Magazine.Cast(other_item);
11782 if (other_item)
11783 {
11784 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11785 return false;
11786 }
11787
11788 }
11789 }
11790 else
11791 {
11792
11794 return false;
11795
11797 return false;
11798 }
11799
11800 PlayerBase player = null;
11801 if (CastTo(player, GetHierarchyRootPlayer()))
11802 {
11803 if (player.GetInventory().HasAttachment(this))
11804 return false;
11805
11806 if (player.IsItemsToDelete())
11807 return false;
11808 }
11809
11810 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11811 return false;
11812
11813 int slotID;
11815 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11816 return false;
11817
11818 return true;
11819 }
11820
11822 {
11824 }
11825
11827 {
11828 return m_IsResultOfSplit;
11829 }
11830
11832 {
11833 m_IsResultOfSplit = value;
11834 }
11835
11837 {
11839 }
11840
11842 {
11843 float other_item_quantity = other_item.GetQuantity();
11844 float this_free_space;
11845
11847
11849
11850 if (other_item_quantity > this_free_space)
11851 {
11852 return this_free_space;
11853 }
11854 else
11855 {
11856 return other_item_quantity;
11857 }
11858 }
11859
11861 {
11863 }
11864
11866 {
11868 return;
11869
11870 if (!IsMagazine() && other_item)
11871 {
11873 if (quantity_used != 0)
11874 {
11875 float hp1 = GetHealth01("","");
11876 float hp2 = other_item.GetHealth01("","");
11877 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11878 hpResult = hpResult / (
GetQuantity() + quantity_used);
11879
11880 hpResult *= GetMaxHealth();
11881 Math.Round(hpResult);
11882 SetHealth("", "Health", hpResult);
11883
11885 other_item.AddQuantity(-quantity_used);
11886 }
11887 }
11889 }
11890
11892 {
11893 #ifdef SERVER
11894 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11895 GetHierarchyParent().IncreaseLifetimeUp();
11896 #endif
11897 };
11898
11900 {
11901 PlayerBase p = PlayerBase.Cast(player);
11902
11903 array<int> recipesIds = p.m_Recipes;
11904 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11905 if (moduleRecipesManager)
11906 {
11907 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11908 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11909 }
11910
11911 for (int i = 0;i < recipesIds.Count(); i++)
11912 {
11913 int key = recipesIds.Get(i);
11914 string recipeName = moduleRecipesManager.GetRecipeName(key);
11916 }
11917 }
11918
11919
11920 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11921 {
11922 super.GetDebugActions(outputList);
11923
11924
11930
11931
11936
11941
11942
11946
11947
11949 {
11953 }
11954
11957
11958
11962
11964
11965 InventoryLocation loc = new InventoryLocation();
11966 GetInventory().GetCurrentInventoryLocation(loc);
11968 {
11969 if (Gizmo_IsSupported())
11972 }
11973
11975 }
11976
11977
11978
11979
11981 {
11982 super.OnAction(action_id, player, ctx);
11983
11985 {
11986 switch (action_id)
11987 {
11990 return true;
11993 return true;
11994 }
11995 }
11996
11998 {
11999 switch (action_id)
12000 {
12002 Delete();
12003 return true;
12004 }
12005 }
12006
12007 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
12008 {
12009 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12010 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
12011 PlayerBase p = PlayerBase.Cast(player);
12012 if (
EActions.RECIPES_RANGE_START < 1000)
12013 {
12014 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
12015 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
12016 }
12017 }
12018 #ifndef SERVER
12019 else if (action_id ==
EActions.WATCH_PLAYER)
12020 {
12021 PluginDeveloper.SetDeveloperItemClientEx(player);
12022 }
12023 #endif
12025 {
12026 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
12027 {
12028 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
12029 OnDebugButtonPressServer(id + 1);
12030 }
12031
12032 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
12033 {
12034 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
12036 }
12037
12038 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
12039 {
12040 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
12042 }
12043
12044 else if (action_id ==
EActions.ADD_QUANTITY)
12045 {
12046 if (IsMagazine())
12047 {
12048 Magazine mag = Magazine.Cast(this);
12049 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
12050 }
12051 else
12052 {
12054 }
12055
12056 if (m_EM)
12057 {
12058 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12059 }
12060
12061 }
12062
12063 else if (action_id ==
EActions.REMOVE_QUANTITY)
12064 {
12065 if (IsMagazine())
12066 {
12067 Magazine mag2 = Magazine.Cast(this);
12068 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12069 }
12070 else
12071 {
12073 }
12074 if (m_EM)
12075 {
12076 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12077 }
12078
12079 }
12080
12081 else if (action_id ==
EActions.SET_QUANTITY_0)
12082 {
12084
12085 if (m_EM)
12086 {
12087 m_EM.SetEnergy(0);
12088 }
12089 }
12090
12091 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12092 {
12094
12095 if (m_EM)
12096 {
12097 m_EM.SetEnergy(m_EM.GetEnergyMax());
12098 }
12099 }
12100
12101 else if (action_id ==
EActions.ADD_HEALTH)
12102 {
12103 AddHealth("","",GetMaxHealth("","Health")/5);
12104 }
12105 else if (action_id ==
EActions.REMOVE_HEALTH)
12106 {
12107 AddHealth("","",-GetMaxHealth("","Health")/5);
12108 }
12109 else if (action_id ==
EActions.DESTROY_HEALTH)
12110 {
12111 SetHealth01("","",0);
12112 }
12113 else if (action_id ==
EActions.WATCH_ITEM)
12114 {
12116 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12117 #ifdef DEVELOPER
12118 SetDebugDeveloper_item(this);
12119 #endif
12120 }
12121
12122 else if (action_id ==
EActions.ADD_TEMPERATURE)
12123 {
12124 AddTemperature(20);
12125
12126 }
12127
12128 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12129 {
12130 AddTemperature(-20);
12131
12132 }
12133
12134 else if (action_id ==
EActions.FLIP_FROZEN)
12135 {
12136 SetFrozen(!GetIsFrozen());
12137
12138 }
12139
12140 else if (action_id ==
EActions.ADD_WETNESS)
12141 {
12143
12144 }
12145
12146 else if (action_id ==
EActions.REMOVE_WETNESS)
12147 {
12149
12150 }
12151
12152 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12153 {
12156
12157
12158 }
12159
12160 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12161 {
12164 }
12165
12166 else if (action_id ==
EActions.MAKE_SPECIAL)
12167 {
12168 auto debugParams = DebugSpawnParams.WithPlayer(player);
12169 OnDebugSpawnEx(debugParams);
12170 }
12171
12172 }
12173
12174
12175 return false;
12176 }
12177
12178
12179
12180
12184
12187
12188
12189
12191 {
12192 return false;
12193 }
12194
12195
12197 {
12198 return true;
12199 }
12200
12201
12203 {
12204 return true;
12205 }
12206
12207
12208
12210 {
12211 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12213 }
12214
12217 {
12218 return null;
12219 }
12220
12222 {
12223 return false;
12224 }
12225
12227 {
12228 return false;
12229 }
12230
12234
12235
12237 {
12238 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12239 return module_repairing.CanRepair(this, item_repair_kit);
12240 }
12241
12242
12243 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12244 {
12245 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12246 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12247 }
12248
12249
12251 {
12252
12253
12254
12255
12256
12257
12258
12259
12260 return 1;
12261 }
12262
12263
12264
12266 {
12268 }
12269
12270
12271
12273 {
12275 }
12276
12277
12286 {
12287 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12288
12289 if (player)
12290 {
12291 player.MessageStatus(text);
12292 }
12293 }
12294
12295
12304 {
12305 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12306
12307 if (player)
12308 {
12309 player.MessageAction(text);
12310 }
12311 }
12312
12313
12322 {
12323 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12324
12325 if (player)
12326 {
12327 player.MessageFriendly(text);
12328 }
12329 }
12330
12331
12340 {
12341 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12342
12343 if (player)
12344 {
12345 player.MessageImportant(text);
12346 }
12347 }
12348
12350 {
12351 return true;
12352 }
12353
12354
12355 override bool KindOf(
string tag)
12356 {
12357 bool found = false;
12358 string item_name = this.
GetType();
12361
12362 int array_size = item_tag_array.Count();
12363 for (int i = 0; i < array_size; i++)
12364 {
12365 if (item_tag_array.Get(i) == tag)
12366 {
12367 found = true;
12368 break;
12369 }
12370 }
12371 return found;
12372 }
12373
12374
12376 {
12377
12378 super.OnRPC(sender, rpc_type,ctx);
12379
12380
12381 switch (rpc_type)
12382 {
12383 #ifndef SERVER
12384 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12385 Param2<bool, string> p = new Param2<bool, string>(false, "");
12386
12388 return;
12389
12390 bool play = p.param1;
12391 string soundSet = p.param2;
12392
12393 if (play)
12394 {
12396 {
12398 {
12400 }
12401 }
12402 else
12403 {
12405 }
12406 }
12407 else
12408 {
12410 }
12411
12412 break;
12413 #endif
12414
12415 }
12416
12418 {
12420 }
12421 }
12422
12423
12424
12425
12427 {
12428 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12429 return plugin.GetID(
name);
12430 }
12431
12433 {
12434 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12435 return plugin.GetName(id);
12436 }
12437
12440 {
12441
12442
12443 int varFlags;
12444 if (!ctx.
Read(varFlags))
12445 return;
12446
12447 if (varFlags & ItemVariableFlags.FLOAT)
12448 {
12450 }
12451 }
12452
12454 {
12455
12456 super.SerializeNumericalVars(floats_out);
12457
12458
12459
12461 {
12463 }
12464
12466 {
12468 }
12469
12471 {
12473 }
12474
12476 {
12481 }
12482
12484 {
12486 }
12487 }
12488
12490 {
12491
12492 super.DeSerializeNumericalVars(floats);
12493
12494
12495 int index = 0;
12496 int mask = Math.Round(floats.Get(index));
12497
12498 index++;
12499
12501 {
12503 {
12505 }
12506 else
12507 {
12508 float quantity = floats.Get(index);
12509 SetQuantity(quantity,
true,
false,
false,
false);
12510 }
12511 index++;
12512 }
12513
12515 {
12516 float wet = floats.Get(index);
12518 index++;
12519 }
12520
12522 {
12523 int liquidtype = Math.Round(floats.Get(index));
12525 index++;
12526 }
12527
12529 {
12531 index++;
12533 index++;
12535 index++;
12537 index++;
12538 }
12539
12541 {
12542 int cleanness = Math.Round(floats.Get(index));
12544 index++;
12545 }
12546 }
12547
12549 {
12550 super.WriteVarsToCTX(ctx);
12551
12552
12554 {
12556 }
12557
12559 {
12561 }
12562
12564 {
12566 }
12567
12569 {
12570 int r,g,b,a;
12576 }
12577
12579 {
12581 }
12582 }
12583
12585 {
12586 if (!super.ReadVarsFromCTX(ctx,version))
12587 return false;
12588
12589 int intValue;
12590 float value;
12591
12592 if (version < 140)
12593 {
12594 if (!ctx.
Read(intValue))
12595 return false;
12596
12597 m_VariablesMask = intValue;
12598 }
12599
12601 {
12602 if (!ctx.
Read(value))
12603 return false;
12604
12606 {
12608 }
12609 else
12610 {
12612 }
12613 }
12614
12615 if (version < 140)
12616 {
12618 {
12619 if (!ctx.
Read(value))
12620 return false;
12621 SetTemperatureDirect(value);
12622 }
12623 }
12624
12626 {
12627 if (!ctx.
Read(value))
12628 return false;
12630 }
12631
12633 {
12634 if (!ctx.
Read(intValue))
12635 return false;
12637 }
12638
12640 {
12641 int r,g,b,a;
12643 return false;
12645 return false;
12647 return false;
12649 return false;
12650
12652 }
12653
12655 {
12656 if (!ctx.
Read(intValue))
12657 return false;
12659 }
12660
12661 if (version >= 138 && version < 140)
12662 {
12664 {
12665 if (!ctx.
Read(intValue))
12666 return false;
12667 SetFrozen(intValue);
12668 }
12669 }
12670
12671 return true;
12672 }
12673
12674
12676 {
12679 {
12681 }
12682
12683 if (!super.OnStoreLoad(ctx, version))
12684 {
12686 return false;
12687 }
12688
12689 if (version >= 114)
12690 {
12691 bool hasQuickBarIndexSaved;
12692
12693 if (!ctx.
Read(hasQuickBarIndexSaved))
12694 {
12696 return false;
12697 }
12698
12699 if (hasQuickBarIndexSaved)
12700 {
12701 int itmQBIndex;
12702
12703
12704 if (!ctx.
Read(itmQBIndex))
12705 {
12707 return false;
12708 }
12709
12710 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12711 if (itmQBIndex != -1 && parentPlayer)
12712 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12713 }
12714 }
12715 else
12716 {
12717
12718 PlayerBase player;
12719 int itemQBIndex;
12720 if (version ==
int.
MAX)
12721 {
12722 if (!ctx.
Read(itemQBIndex))
12723 {
12725 return false;
12726 }
12727 }
12728 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12729 {
12730
12731 if (!ctx.
Read(itemQBIndex))
12732 {
12734 return false;
12735 }
12736 if (itemQBIndex != -1 && player)
12737 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12738 }
12739 }
12740
12741 if (version < 140)
12742 {
12743
12744 if (!LoadVariables(ctx, version))
12745 {
12747 return false;
12748 }
12749 }
12750
12751
12753 {
12755 return false;
12756 }
12757 if (version >= 132)
12758 {
12760 if (raib)
12761 {
12763 {
12765 return false;
12766 }
12767 }
12768 }
12769
12771 return true;
12772 }
12773
12774
12775
12777 {
12778 super.OnStoreSave(ctx);
12779
12780 PlayerBase player;
12781 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12782 {
12784
12785 int itemQBIndex = -1;
12786 itemQBIndex = player.FindQuickBarEntityIndex(this);
12787 ctx.
Write(itemQBIndex);
12788 }
12789 else
12790 {
12792 }
12793
12795
12797 if (raib)
12798 {
12800 }
12801 }
12802
12803
12805 {
12806 super.AfterStoreLoad();
12807
12809 {
12811 }
12812
12814 {
12817 }
12818 }
12819
12821 {
12822 super.EEOnAfterLoad();
12823
12825 {
12827 }
12828
12831 }
12832
12834 {
12835 return false;
12836 }
12837
12838
12839
12841 {
12843 {
12844 #ifdef PLATFORM_CONSOLE
12845
12847 {
12849 if (menu)
12850 {
12852 }
12853 }
12854 #endif
12855 }
12856
12858 {
12861 }
12862
12864 {
12865 SetWeightDirty();
12867 }
12869 {
12872 }
12873
12875 {
12878 }
12880 {
12883 }
12884
12885 super.OnVariablesSynchronized();
12886 }
12887
12888
12889
12891 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12892 {
12893 if (!IsServerCheck(allow_client))
12894 return false;
12895
12897 return false;
12898
12901
12902 if (value <= (min + 0.001))
12903 value = min;
12904
12905 if (value == min)
12906 {
12907 if (destroy_config)
12908 {
12909 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12910 if (dstr)
12911 {
12913 this.Delete();
12914 return true;
12915 }
12916 }
12917 else if (destroy_forced)
12918 {
12920 this.Delete();
12921 return true;
12922 }
12923
12925 }
12926
12929
12931 {
12933
12934 if (delta)
12936 }
12937
12939
12940 return false;
12941 }
12942
12943
12945 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12946 {
12948 }
12949
12951 {
12954 }
12955
12957 {
12960 }
12961
12963 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12964 {
12965 float value_clamped = Math.Clamp(value, 0, 1);
12967 SetQuantity(result, destroy_config, destroy_forced);
12968 }
12969
12970
12973 {
12975 }
12976
12978 {
12980 }
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12992 {
12993 int slot = -1;
12994 if (GetInventory())
12995 {
12996 InventoryLocation il = new InventoryLocation;
12997 GetInventory().GetCurrentInventoryLocation(il);
12999 }
13000
13002 }
13003
13005 {
13006 float quantity_max = 0;
13007
13009 {
13010 if (attSlotID != -1)
13011 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
13012
13013 if (quantity_max <= 0)
13015 }
13016
13017 if (quantity_max <= 0)
13019
13020 return quantity_max;
13021 }
13022
13024 {
13026 }
13027
13029 {
13031 }
13032
13033
13035 {
13037 }
13038
13040 {
13042 }
13043
13045 {
13047 }
13048
13049
13051 {
13052
13053 float weightEx = GetWeightEx();
13054 float special = GetInventoryAndCargoWeight();
13055 return weightEx - special;
13056 }
13057
13058
13060 {
13062 }
13063
13065 {
13067 {
13068 #ifdef DEVELOPER
13069 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13070 {
13071 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13073 }
13074 #endif
13075
13076 return GetQuantity() * GetConfigWeightModified();
13077 }
13078 else if (HasEnergyManager())
13079 {
13080 #ifdef DEVELOPER
13081 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13082 {
13083 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13084 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13085 }
13086 #endif
13087 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13088 }
13089 else
13090 {
13091 #ifdef DEVELOPER
13092 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13093 {
13094 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13095 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13096 }
13097 #endif
13098 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13099 }
13100 }
13101
13104 {
13105 int item_count = 0;
13107
13108 if (GetInventory().GetCargo() != NULL)
13109 {
13110 item_count = GetInventory().GetCargo().GetItemCount();
13111 }
13112
13113 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13114 {
13115 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13116 if (item)
13117 item_count += item.GetNumberOfItems();
13118 }
13119 return item_count;
13120 }
13121
13124 {
13125 float weight = 0;
13126 float wetness = 1;
13127 if (include_wetness)
13130 {
13131 weight = wetness * m_ConfigWeight;
13132 }
13134 {
13135 weight = 1;
13136 }
13137 return weight;
13138 }
13139
13140
13141
13143 {
13144 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13145 {
13146 GameInventory inv = GetInventory();
13147 array<EntityAI> items = new array<EntityAI>;
13149 for (int i = 0; i < items.Count(); i++)
13150 {
13152 if (item)
13153 {
13155 }
13156 }
13157 }
13158 }
13159
13160
13161
13162
13164 {
13165 float energy = 0;
13166 if (HasEnergyManager())
13167 {
13168 energy = GetCompEM().GetEnergy();
13169 }
13170 return energy;
13171 }
13172
13173
13175 {
13176 super.OnEnergyConsumed();
13177
13179 }
13180
13182 {
13183 super.OnEnergyAdded();
13184
13186 }
13187
13188
13190 {
13191 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13192 {
13194 {
13195 float energy_0to1 = GetCompEM().GetEnergy0To1();
13197 }
13198 }
13199 }
13200
13201
13203 {
13204 return ConfigGetFloat("heatIsolation");
13205 }
13206
13208 {
13210 }
13211
13213 {
13214 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13215 if (
GetGame().ConfigIsExisting(paramPath))
13217
13218 return 0.0;
13219 }
13220
13222 {
13223 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13224 if (
GetGame().ConfigIsExisting(paramPath))
13226
13227 return 0.0;
13228 }
13229
13230 override void SetWet(
float value,
bool allow_client =
false)
13231 {
13232 if (!IsServerCheck(allow_client))
13233 return;
13234
13237
13239
13240 m_VarWet = Math.Clamp(value, min, max);
13241
13243 {
13246 }
13247 }
13248
13249 override void AddWet(
float value)
13250 {
13252 }
13253
13255 {
13257 }
13258
13260 {
13262 }
13263
13265 {
13267 }
13268
13270 {
13272 }
13273
13275 {
13277 }
13278
13279 override void OnWetChanged(
float newVal,
float oldVal)
13280 {
13283 if (newLevel != oldLevel)
13284 {
13286 }
13287 }
13288
13290 {
13291 SetWeightDirty();
13292 }
13293
13295 {
13296 return GetWetLevelInternal(
m_VarWet);
13297 }
13298
13299
13300
13302 {
13304 }
13305
13307 {
13309 }
13310
13312 {
13314 }
13315
13317 {
13319 }
13320
13321
13322
13324 {
13325 if (ConfigIsExisting("itemModelLength"))
13326 {
13327 return ConfigGetFloat("itemModelLength");
13328 }
13329 return 0;
13330 }
13331
13333 {
13334 if (ConfigIsExisting("itemAttachOffset"))
13335 {
13336 return ConfigGetFloat("itemAttachOffset");
13337 }
13338 return 0;
13339 }
13340
13341 override void SetCleanness(
int value,
bool allow_client =
false)
13342 {
13343 if (!IsServerCheck(allow_client))
13344 return;
13345
13347
13349
13352 }
13353
13355 {
13357 }
13358
13360 {
13361 return true;
13362 }
13363
13364
13365
13366
13368 {
13370 }
13371
13373 {
13375 }
13376
13377
13378
13379
13380 override void SetColor(
int r,
int g,
int b,
int a)
13381 {
13387 }
13389 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13390 {
13395 }
13396
13398 {
13400 }
13401
13404 {
13405 int r,g,b,a;
13407 r = r/255;
13408 g = g/255;
13409 b = b/255;
13410 a = a/255;
13411 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13412 }
13413
13414
13415
13416 override void SetLiquidType(
int value,
bool allow_client =
false)
13417 {
13418 if (!IsServerCheck(allow_client))
13419 return;
13420
13425 }
13426
13428 {
13429 return ConfigGetInt("varLiquidTypeInit");
13430 }
13431
13433 {
13435 }
13436
13438 {
13440 SetFrozen(false);
13441 }
13442
13445 {
13446 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13447 }
13448
13449
13452 {
13453 PlayerBase nplayer;
13454 if (PlayerBase.CastTo(nplayer, player))
13455 {
13457
13458 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13459 }
13460 }
13461
13462
13465 {
13466 PlayerBase nplayer;
13467 if (PlayerBase.CastTo(nplayer,player))
13468 {
13469
13470 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13471
13472 }
13473
13474
13475 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13476
13477
13478 if (HasEnergyManager())
13479 {
13480 GetCompEM().UpdatePlugState();
13481 }
13482 }
13483
13484
13486 {
13487 super.OnPlacementStarted(player);
13488
13490 }
13491
13492 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13493 {
13495 {
13496 m_AdminLog.OnPlacementComplete(player,
this);
13497 }
13498
13499 super.OnPlacementComplete(player, position, orientation);
13500 }
13501
13502
13503
13504
13505
13507 {
13509 {
13510 return true;
13511 }
13512 else
13513 {
13514 return false;
13515 }
13516 }
13517
13518
13520 {
13522 {
13524 }
13525 }
13526
13527
13529 {
13531 }
13532
13534 {
13536 }
13537
13538 override void InsertAgent(
int agent,
float count = 1)
13539 {
13540 if (count < 1)
13541 return;
13542
13544 }
13545
13548 {
13550 }
13551
13552
13554 {
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
13594
13595
13596
13597
13598
13600 {
13602 return false;
13603 return true;
13604 }
13605
13607 {
13608
13610 }
13611
13612
13615 {
13616 super.CheckForRoofLimited(timeTresholdMS);
13617
13619 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13620 {
13621 m_PreviousRoofTestTime = time;
13622 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13623 }
13624 }
13625
13626
13628 {
13630 {
13631 return 0;
13632 }
13633
13634 if (GetInventory().GetAttachmentSlotsCount() != 0)
13635 {
13636 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13637 if (filter)
13638 return filter.GetProtectionLevel(type, false, system);
13639 else
13640 return 0;
13641 }
13642
13643 string subclassPath, entryName;
13644
13645 switch (type)
13646 {
13648 entryName = "biological";
13649 break;
13651 entryName = "chemical";
13652 break;
13653 default:
13654 entryName = "biological";
13655 break;
13656 }
13657
13658 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13659
13661 }
13662
13663
13664
13667 {
13668 if (!IsMagazine())
13670
13672 }
13673
13674
13675
13676
13677
13682 {
13683 return true;
13684 }
13685
13687 {
13689 }
13690
13691
13692
13693
13694
13696 {
13697 if (parent)
13698 {
13699 if (parent.IsInherited(DayZInfected))
13700 return true;
13701
13702 if (!parent.IsRuined())
13703 return true;
13704 }
13705
13706 return true;
13707 }
13708
13710 {
13711 if (!super.CanPutAsAttachment(parent))
13712 {
13713 return false;
13714 }
13715
13716 if (!IsRuined() && !parent.IsRuined())
13717 {
13718 return true;
13719 }
13720
13721 return false;
13722 }
13723
13725 {
13726
13727
13728
13729
13730 return super.CanReceiveItemIntoCargo(item);
13731 }
13732
13734 {
13735
13736
13737
13738
13739 GameInventory attachmentInv = attachment.GetInventory();
13741 {
13742 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13743 return false;
13744 }
13745
13746 InventoryLocation loc = new InventoryLocation();
13747 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13748 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13749 return false;
13750
13751 return super.CanReceiveAttachment(attachment, slotId);
13752 }
13753
13755 {
13756 if (!super.CanReleaseAttachment(attachment))
13757 return false;
13758
13759 return GetInventory().AreChildrenAccessible();
13760 }
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13783 {
13784 int id = muzzle_owner.GetMuzzleID();
13785 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13786
13787 if (WPOF_array)
13788 {
13789 for (int i = 0; i < WPOF_array.Count(); i++)
13790 {
13791 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13792
13793 if (WPOF)
13794 {
13795 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13796 }
13797 }
13798 }
13799 }
13800
13801
13803 {
13804 int id = muzzle_owner.GetMuzzleID();
13806
13807 if (WPOBE_array)
13808 {
13809 for (int i = 0; i < WPOBE_array.Count(); i++)
13810 {
13811 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13812
13813 if (WPOBE)
13814 {
13815 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13816 }
13817 }
13818 }
13819 }
13820
13821
13823 {
13824 int id = muzzle_owner.GetMuzzleID();
13825 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13826
13827 if (WPOOH_array)
13828 {
13829 for (int i = 0; i < WPOOH_array.Count(); i++)
13830 {
13831 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13832
13833 if (WPOOH)
13834 {
13835 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13836 }
13837 }
13838 }
13839 }
13840
13841
13843 {
13844 int id = muzzle_owner.GetMuzzleID();
13845 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13846
13847 if (WPOOH_array)
13848 {
13849 for (int i = 0; i < WPOOH_array.Count(); i++)
13850 {
13851 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13852
13853 if (WPOOH)
13854 {
13855 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13856 }
13857 }
13858 }
13859 }
13860
13861
13863 {
13864 int id = muzzle_owner.GetMuzzleID();
13865 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13866
13867 if (WPOOH_array)
13868 {
13869 for (int i = 0; i < WPOOH_array.Count(); i++)
13870 {
13871 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13872
13873 if (WPOOH)
13874 {
13875 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13876 }
13877 }
13878 }
13879 }
13880
13881
13882
13884 {
13886 {
13887 return true;
13888 }
13889
13890 return false;
13891 }
13892
13894 {
13896 {
13897 return true;
13898 }
13899
13900 return false;
13901 }
13902
13904 {
13906 {
13907 return true;
13908 }
13909
13910 return false;
13911 }
13912
13914 {
13915 return false;
13916 }
13917
13920 {
13921 return UATimeSpent.DEFAULT_DEPLOY;
13922 }
13923
13924
13925
13926
13928 {
13930 SetSynchDirty();
13931 }
13932
13934 {
13936 }
13937
13938
13940 {
13941 return false;
13942 }
13943
13946 {
13947 string att_type = "None";
13948
13949 if (ConfigIsExisting("soundAttType"))
13950 {
13951 att_type = ConfigGetString("soundAttType");
13952 }
13953
13955 }
13956
13958 {
13960 }
13961
13962
13963
13964
13965
13971
13973 {
13976
13978 }
13979
13980
13982 {
13984 return;
13985
13987
13990
13993
13994 SoundParameters params = new SoundParameters();
13998 }
13999
14000
14002 {
14004 return;
14005
14007 SetSynchDirty();
14008
14011 }
14012
14013
14015 {
14017 return;
14018
14020 SetSynchDirty();
14021
14024 }
14025
14027 {
14029 }
14030
14032 {
14034 }
14035
14038 {
14039 if (!
GetGame().IsDedicatedServer())
14040 {
14041 if (ConfigIsExisting("attachSoundSet"))
14042 {
14043 string cfg_path = "";
14044 string soundset = "";
14045 string type_name =
GetType();
14046
14049 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
14050 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
14051
14052 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
14053 {
14054 for (int i = 0; i < cfg_soundset_array.Count(); i++)
14055 {
14056 if (cfg_slot_array[i] == slot_type)
14057 {
14058 soundset = cfg_soundset_array[i];
14059 break;
14060 }
14061 }
14062 }
14063
14064 if (soundset != "")
14065 {
14066 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14068 }
14069 }
14070 }
14071 }
14072
14074 {
14075
14076 }
14077
14078 void OnApply(PlayerBase player);
14079
14081 {
14082 return 1.0;
14083 };
14084
14086 {
14088 }
14089
14091 {
14093 }
14094
14096
14098 {
14099 SetDynamicPhysicsLifeTime(0.01);
14101 }
14102
14104 {
14105 array<string> zone_names = new array<string>;
14106 GetDamageZones(zone_names);
14107 for (int i = 0; i < zone_names.Count(); i++)
14108 {
14109 SetHealthMax(zone_names.Get(i),"Health");
14110 }
14111 SetHealthMax("","Health");
14112 }
14113
14116 {
14117 float global_health = GetHealth01("","Health");
14118 array<string> zones = new array<string>;
14119 GetDamageZones(zones);
14120
14121 for (int i = 0; i < zones.Count(); i++)
14122 {
14123 SetHealth01(zones.Get(i),"Health",global_health);
14124 }
14125 }
14126
14129 {
14130 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14131 }
14132
14134 {
14135 if (!hasRootAsPlayer)
14136 {
14137 if (refParentIB)
14138 {
14139
14140 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14141 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14142
14143 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14144 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14145
14148 }
14149 else
14150 {
14151
14154 }
14155 }
14156 }
14157
14159 {
14161 {
14162 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14163 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14164 {
14165 float heatPermCoef = 1.0;
14167 while (ent)
14168 {
14169 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14170 ent = ent.GetHierarchyParent();
14171 }
14172
14173 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14174 }
14175 }
14176 }
14177
14179 {
14180
14181 EntityAI parent = GetHierarchyParent();
14182 if (!parent)
14183 {
14184 hasParent = false;
14185 hasRootAsPlayer = false;
14186 }
14187 else
14188 {
14189 hasParent = true;
14190 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14191 refParentIB =
ItemBase.Cast(parent);
14192 }
14193 }
14194
14195 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14196 {
14197
14198 }
14199
14201 {
14202
14203 return false;
14204 }
14205
14207 {
14208
14209
14210 return false;
14211 }
14212
14214 {
14215
14216 return false;
14217 }
14218
14221 {
14222 return !GetIsFrozen() &&
IsOpen();
14223 }
14224
14226 {
14227 bool hasParent = false, hasRootAsPlayer = false;
14229
14230 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14231 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14232
14233 if (wwtu || foodDecay)
14234 {
14238
14239 if (processWetness || processTemperature || processDecay)
14240 {
14242
14243 if (processWetness)
14244 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14245
14246 if (processTemperature)
14248
14249 if (processDecay)
14250 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14251 }
14252 }
14253 }
14254
14257 {
14259 }
14260
14262 {
14265
14266 return super.GetTemperatureFreezeThreshold();
14267 }
14268
14270 {
14273
14274 return super.GetTemperatureThawThreshold();
14275 }
14276
14278 {
14281
14282 return super.GetItemOverheatThreshold();
14283 }
14284
14286 {
14288 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14289
14290 return super.GetTemperatureFreezeTime();
14291 }
14292
14294 {
14296 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14297
14298 return super.GetTemperatureThawTime();
14299 }
14300
14305
14307 {
14308 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14309 }
14310
14312 {
14313 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14314 }
14315
14318 {
14320 }
14321
14323 {
14325 }
14326
14328 {
14330 }
14331
14334 {
14335 return null;
14336 }
14337
14340 {
14341 return false;
14342 }
14343
14345 {
14347 {
14350 if (!trg)
14351 {
14353 explosive = this;
14354 }
14355
14356 explosive.PairRemote(trg);
14358
14359 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14360 trg.SetPersistentPairID(persistentID);
14361 explosive.SetPersistentPairID(persistentID);
14362
14363 return true;
14364 }
14365 return false;
14366 }
14367
14370 {
14371 float ret = 1.0;
14374 ret *= GetHealth01();
14375
14376 return ret;
14377 }
14378
14379 #ifdef DEVELOPER
14380 override void SetDebugItem()
14381 {
14382 super.SetDebugItem();
14383 _itemBase = this;
14384 }
14385
14387 {
14388 string text = super.GetDebugText();
14389
14391 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14392
14393 return text;
14394 }
14395 #endif
14396
14398 {
14399 return true;
14400 }
14401
14403
14405
14407 {
14410 }
14411
14412
14420
14436}
14437
14439{
14441 if (entity)
14442 {
14443 bool is_item = entity.IsInherited(
ItemBase);
14444 if (is_item && full_quantity)
14445 {
14448 }
14449 }
14450 else
14451 {
14453 return NULL;
14454 }
14455 return entity;
14456}
14457
14459{
14460 if (item)
14461 {
14462 if (health > 0)
14463 item.SetHealth("", "", health);
14464
14465 if (item.CanHaveTemperature())
14466 {
14468 if (item.CanFreeze())
14469 item.SetFrozen(false);
14470 }
14471
14472 if (item.HasEnergyManager())
14473 {
14474 if (quantity >= 0)
14475 {
14476 item.GetCompEM().SetEnergy0To1(quantity);
14477 }
14478 else
14479 {
14481 }
14482 }
14483 else if (item.IsMagazine())
14484 {
14485 Magazine mag = Magazine.Cast(item);
14486 if (quantity >= 0)
14487 {
14488 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14489 }
14490 else
14491 {
14493 }
14494
14495 }
14496 else
14497 {
14498 if (quantity >= 0)
14499 {
14500 item.SetQuantityNormalized(quantity, false);
14501 }
14502 else
14503 {
14505 }
14506
14507 }
14508 }
14509}
14510
14511#ifdef DEVELOPER
14513#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.