9567{
9569 {
9570 return true;
9571 }
9572};
9573
9574
9575
9577{
9581
9583
9586
9587
9588
9589
9590
9599
9605
9610
9615
9636 protected bool m_IsResultOfSplit
9637
9639
9644
9645
9646
9648
9652
9653
9654
9656
9659
9660
9661
9667
9668
9676
9679
9680
9682
9683
9685
9686
9691
9692
9697
9698
9700
9701
9703 {
9708
9709 if (!
GetGame().IsDedicatedServer())
9710 {
9712 {
9714
9716 {
9718 }
9719 }
9720
9723 }
9724
9725 m_OldLocation = null;
9726
9728 {
9730 }
9731
9732 if (ConfigIsExisting("headSelectionsToHide"))
9733 {
9736 }
9737
9739 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9740 {
9742 }
9743
9745
9746 m_IsResultOfSplit = false;
9747
9749 }
9750
9752 {
9753 super.InitItemVariables();
9754
9760 m_Count = ConfigGetInt(
"count");
9761
9764
9769
9772
9777
9789
9793
9794
9797 if (ConfigIsExisting("canBeSplit"))
9798 {
9801 }
9802
9804 if (ConfigIsExisting("itemBehaviour"))
9806
9807
9810 RegisterNetSyncVariableInt("m_VarLiquidType");
9811 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9812
9813 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9814 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9815 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9816
9817 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9818 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9819 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9820 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9821
9822 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9823 RegisterNetSyncVariableBool("m_IsTakeable");
9824 RegisterNetSyncVariableBool("m_IsHologram");
9825
9828 {
9831 }
9832
9834
9836 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9838
9839 }
9840
9842 {
9844 }
9845
9847 {
9850 {
9855 }
9856 }
9857
9858 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9859 {
9861 {
9864 }
9865
9867 }
9868
9870 {
9876 }
9877
9879
9881 {
9883
9884 if (!action)
9885 {
9886 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9887 return;
9888 }
9889
9891 if (!ai)
9892 {
9894 return;
9895 }
9896
9898 if (!action_array)
9899 {
9900 action_array = new array<ActionBase_Basic>;
9902 }
9903 if (LogManager.IsActionLogEnable())
9904 {
9905 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9906 }
9907
9908 if (action_array.Find(action) != -1)
9909 {
9910 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9911 }
9912 else
9913 {
9914 action_array.Insert(action);
9915 }
9916 }
9917
9919 {
9921 ActionBase action = player.GetActionManager().GetAction(actionName);
9924
9925 if (action_array)
9926 {
9927 action_array.RemoveItem(action);
9928 }
9929 }
9930
9931
9932
9934 {
9935 ActionOverrideData overrideData = new ActionOverrideData();
9939
9941 if (!actionMap)
9942 {
9945 }
9946
9947 actionMap.Insert(this.
Type(), overrideData);
9948
9949 }
9950
9952
9954
9955
9957 {
9960
9963
9964 string config_to_search = "CfgVehicles";
9965 string muzzle_owner_config;
9966
9968 {
9969 if (IsInherited(Weapon))
9970 config_to_search = "CfgWeapons";
9971
9972 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9973
9974 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9975
9977
9978 if (config_OnFire_subclass_count > 0)
9979 {
9980 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9981
9982 for (int i = 0; i < config_OnFire_subclass_count; i++)
9983 {
9984 string particle_class = "";
9986 string config_OnFire_entry = config_OnFire_class + particle_class;
9987 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9988 WPOF_array.Insert(WPOF);
9989 }
9990
9991
9993 }
9994 }
9995
9997 {
9998 config_to_search = "CfgWeapons";
9999 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10000
10001 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
10002
10004
10005 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
10006 {
10007 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
10008
10009 for (i = 0; i < config_OnBulletCasingEject_count; i++)
10010 {
10011 string particle_class2 = "";
10013 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
10014 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
10015 WPOBE_array.Insert(WPOBE);
10016 }
10017
10018
10020 }
10021 }
10022 }
10023
10024
10026 {
10029
10031 {
10032 string config_to_search = "CfgVehicles";
10033
10034 if (IsInherited(Weapon))
10035 config_to_search = "CfgWeapons";
10036
10037 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10038 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10039
10040 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10041 {
10042
10044
10046 {
10048 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10050 return;
10051 }
10052
10055
10056
10057
10059 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10060
10061 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10062 {
10063 string particle_class = "";
10065 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10067
10068 if (entry_type == CT_CLASS)
10069 {
10070 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10071 WPOOH_array.Insert(WPOF);
10072 }
10073 }
10074
10075
10077 }
10078 }
10079 }
10080
10082 {
10084 }
10085
10087 {
10089 {
10091
10094
10097
10098 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10099 }
10100 }
10101
10103 {
10105 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10106
10108 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10109
10111 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10112
10114 {
10116 }
10117 }
10118
10120 {
10122 }
10123
10125 {
10128 else
10130
10132 {
10135 }
10136 else
10137 {
10140
10143 }
10144
10146 }
10147
10149 {
10151 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10152 }
10153
10155 {
10157 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10159 }
10160
10162 {
10164 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10165 }
10166
10168 {
10171
10172 OverheatingParticle OP = new OverheatingParticle();
10177
10179 }
10180
10182 {
10185
10186 return -1;
10187 }
10188
10190 {
10192 {
10195
10196 for (int i = count; i > 0; --i)
10197 {
10198 int id = i - 1;
10201
10204
10205 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10206 {
10207 if (p)
10208 {
10211 }
10212 }
10213 }
10214 }
10215 }
10216
10218 {
10220 {
10222 {
10223 int id = i - 1;
10225
10226 if (OP)
10227 {
10229
10230 if (p)
10231 {
10233 }
10234
10235 delete OP;
10236 }
10237 }
10238
10241 }
10242 }
10243
10246 {
10247 return 0.0;
10248 }
10249
10250
10252 {
10253 return 250;
10254 }
10255
10257 {
10258 return 0;
10259 }
10260
10263 {
10265 return true;
10266
10267 return false;
10268 }
10269
10272 {
10275
10277 {
10279 }
10280 else
10281 {
10282
10284 }
10285
10287 }
10288
10295 {
10296 return -1;
10297 }
10298
10299
10300
10301
10303 {
10305 {
10307 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10308
10309 if (r_index >= 0)
10310 {
10311 InventoryLocation r_il = new InventoryLocation;
10312 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10313
10314 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10317 {
10318 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10319 }
10321 {
10322 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10323 }
10324
10325 }
10326
10327 player.GetHumanInventory().ClearUserReservedLocation(this);
10328 }
10329
10332 }
10333
10334
10335
10336
10338 {
10339 return ItemBase.m_DebugActionsMask;
10340 }
10341
10343 {
10344 return ItemBase.m_DebugActionsMask & mask;
10345 }
10346
10348 {
10349 ItemBase.m_DebugActionsMask = mask;
10350 }
10351
10353 {
10354 ItemBase.m_DebugActionsMask |= mask;
10355 }
10356
10358 {
10359 ItemBase.m_DebugActionsMask &= ~mask;
10360 }
10361
10363 {
10365 {
10367 }
10368 else
10369 {
10371 }
10372 }
10373
10374
10376 {
10377 if (GetEconomyProfile())
10378 {
10379 float q_max = GetEconomyProfile().GetQuantityMax();
10380 if (q_max > 0)
10381 {
10382 float q_min = GetEconomyProfile().GetQuantityMin();
10383 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10384
10386 {
10387 ComponentEnergyManager comp = GetCompEM();
10389 {
10391 }
10392 }
10394 {
10396
10397 }
10398
10399 }
10400 }
10401 }
10402
10405 {
10406 EntityAI parent = GetHierarchyParent();
10407
10408 if (parent)
10409 {
10410 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10411 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10412 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10413 }
10414 }
10415
10418 {
10419 EntityAI parent = GetHierarchyParent();
10420
10421 if (parent)
10422 {
10423 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10424 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10425 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10426 }
10427 }
10428
10430 {
10431
10432
10433
10434
10436
10438 {
10439 if (ScriptInputUserData.CanStoreInputUserData())
10440 {
10441 ScriptInputUserData ctx = new ScriptInputUserData;
10447 ctx.
Write(use_stack_max);
10450
10452 {
10453 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10454 }
10455 }
10456 }
10457 else if (!
GetGame().IsMultiplayer())
10458 {
10460 }
10461 }
10462
10464 {
10466 }
10467
10469 {
10471 }
10472
10474 {
10476 }
10477
10479 {
10480
10481 return false;
10482 }
10483
10485 {
10486 return false;
10487 }
10488
10492 {
10493 return false;
10494 }
10495
10497 {
10498 return "";
10499 }
10500
10502
10504 {
10505 return false;
10506 }
10507
10509 {
10510 return true;
10511 }
10512
10513
10514
10516 {
10517 return true;
10518 }
10519
10521 {
10522 return true;
10523 }
10524
10526 {
10527 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10529 }
10530
10532 {
10534 }
10535
10537 {
10539 if (!is_being_placed)
10541 SetSynchDirty();
10542 }
10543
10544
10546
10548 {
10550 }
10551
10553 {
10555 }
10556
10558 {
10559 return 1;
10560 }
10561
10563 {
10564 return false;
10565 }
10566
10568 {
10570 SetSynchDirty();
10571 }
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10608 {
10609 super.OnMovedInsideCargo(container);
10610
10611 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10612 }
10613
10614 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10615 {
10616 super.EEItemLocationChanged(oldLoc,newLoc);
10617
10618 PlayerBase new_player = null;
10619 PlayerBase old_player = null;
10620
10621 if (newLoc.GetParent())
10622 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10623
10624 if (oldLoc.GetParent())
10625 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10626
10628 {
10629 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10630
10631 if (r_index >= 0)
10632 {
10633 InventoryLocation r_il = new InventoryLocation;
10634 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10635
10636 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10639 {
10640 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10641 }
10643 {
10644 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10645 }
10646
10647 }
10648 }
10649
10651 {
10652 if (new_player)
10653 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10654
10655 if (new_player == old_player)
10656 {
10657
10658 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10659 {
10661 {
10662 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10663 {
10664 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10665 }
10666 }
10667 else
10668 {
10669 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10670 }
10671 }
10672
10673 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10674 {
10675 int type = oldLoc.GetType();
10677 {
10678 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10679 }
10681 {
10682 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10683 }
10684 }
10685 if (!m_OldLocation)
10686 {
10687 m_OldLocation = new InventoryLocation;
10688 }
10689 m_OldLocation.Copy(oldLoc);
10690 }
10691 else
10692 {
10693 if (m_OldLocation)
10694 {
10695 m_OldLocation.Reset();
10696 }
10697 }
10698
10700 }
10701 else
10702 {
10703 if (new_player)
10704 {
10705 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10706 if (res_index >= 0)
10707 {
10708 InventoryLocation il = new InventoryLocation;
10709 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10711 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10714 {
10715 il.
GetParent().GetOnReleaseLock().Invoke(it);
10716 }
10718 {
10720 }
10721
10722 }
10723 }
10725 {
10726
10728 }
10729
10730 if (m_OldLocation)
10731 {
10732 m_OldLocation.Reset();
10733 }
10734 }
10735 }
10736
10737 override void EOnContact(IEntity other, Contact extra)
10738 {
10740 {
10741 int liquidType = -1;
10743 if (impactSpeed > 0.0)
10744 {
10746 #ifndef SERVER
10748 #else
10750 SetSynchDirty();
10751 #endif
10753 }
10754 }
10755
10756 #ifdef SERVER
10757 if (GetCompEM() && GetCompEM().IsPlugged())
10758 {
10759 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10760 GetCompEM().UnplugThis();
10761 }
10762 #endif
10763 }
10764
10766
10768 {
10770 }
10771
10773 {
10774
10775 }
10776
10778 {
10779 super.OnItemLocationChanged(old_owner, new_owner);
10780
10781 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10782 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10783
10784 if (!relatedPlayer && playerNew)
10785 relatedPlayer = playerNew;
10786
10787 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10788 {
10790 if (actionMgr)
10791 {
10792 ActionBase currentAction = actionMgr.GetRunningAction();
10793 if (currentAction)
10795 }
10796 }
10797
10798 Man ownerPlayerOld = null;
10799 Man ownerPlayerNew = null;
10800
10801 if (old_owner)
10802 {
10803 if (old_owner.
IsMan())
10804 {
10805 ownerPlayerOld = Man.Cast(old_owner);
10806 }
10807 else
10808 {
10809 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10810 }
10811 }
10812 else
10813 {
10815 {
10817
10818 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10819 {
10820 GetCompEM().UnplugThis();
10821 }
10822 }
10823 }
10824
10825 if (new_owner)
10826 {
10827 if (new_owner.
IsMan())
10828 {
10829 ownerPlayerNew = Man.Cast(new_owner);
10830 }
10831 else
10832 {
10833 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10834 }
10835 }
10836
10837 if (ownerPlayerOld != ownerPlayerNew)
10838 {
10839 if (ownerPlayerOld)
10840 {
10841 array<EntityAI> subItemsExit = new array<EntityAI>;
10843 for (int i = 0; i < subItemsExit.Count(); i++)
10844 {
10847 }
10848 }
10849
10850 if (ownerPlayerNew)
10851 {
10852 array<EntityAI> subItemsEnter = new array<EntityAI>;
10854 for (int j = 0; j < subItemsEnter.Count(); j++)
10855 {
10858 }
10859 }
10860 }
10861 else if (ownerPlayerNew != null)
10862 {
10863 PlayerBase nplayer;
10864 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10865 {
10866 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10868 for (int k = 0; k < subItemsUpdate.Count(); k++)
10869 {
10871 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10872 }
10873 }
10874 }
10875
10876 if (old_owner)
10877 old_owner.OnChildItemRemoved(this);
10878 if (new_owner)
10879 new_owner.OnChildItemReceived(this);
10880 }
10881
10882
10884 {
10885 super.EEDelete(parent);
10886 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10887 if (player)
10888 {
10890
10891 if (player.IsAlive())
10892 {
10893 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10894 if (r_index >= 0)
10895 {
10896 InventoryLocation r_il = new InventoryLocation;
10897 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10898
10899 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10902 {
10903 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10904 }
10906 {
10907 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10908 }
10909
10910 }
10911
10912 player.RemoveQuickBarEntityShortcut(this);
10913 }
10914 }
10915 }
10916
10918 {
10919 super.EEKilled(killer);
10920
10923 {
10924 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10925 {
10926 if (IsMagazine())
10927 {
10928 if (Magazine.Cast(this).GetAmmoCount() > 0)
10929 {
10931 }
10932 }
10933 else
10934 {
10936 }
10937 }
10938 }
10939 }
10940
10942 {
10943 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10944
10945 super.OnWasAttached(parent, slot_id);
10946
10949
10951 }
10952
10954 {
10955 super.OnWasDetached(parent, slot_id);
10956
10959 }
10960
10962 {
10963 int idx;
10966
10967 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10968 if (inventory_slots.Count() < 1)
10969 {
10970 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10971 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10972 }
10973 else
10974 {
10975 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10976 }
10977
10978 idx = inventory_slots.Find(slot);
10979 if (idx < 0)
10980 return "";
10981
10982 return attach_types.Get(idx);
10983 }
10984
10986 {
10987 int idx = -1;
10988 string slot;
10989
10992
10993 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10994 if (inventory_slots.Count() < 1)
10995 {
10996 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10997 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10998 }
10999 else
11000 {
11001 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
11002 if (detach_types.Count() < 1)
11003 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11004 }
11005
11006 for (int i = 0; i < inventory_slots.Count(); i++)
11007 {
11008 slot = inventory_slots.Get(i);
11009 }
11010
11011 if (slot != "")
11012 {
11013 if (detach_types.Count() == 1)
11014 idx = 0;
11015 else
11016 idx = inventory_slots.Find(slot);
11017 }
11018 if (idx < 0)
11019 return "";
11020
11021 return detach_types.Get(idx);
11022 }
11023
11025 {
11026
11028
11029
11030 float min_time = 1;
11031 float max_time = 3;
11032 float delay = Math.RandomFloat(min_time, max_time);
11033
11034 explode_timer.Run(delay, this, "DoAmmoExplosion");
11035 }
11036
11038 {
11039 Magazine magazine = Magazine.Cast(this);
11040 int pop_sounds_count = 6;
11041 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11042
11043
11044 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11045 string sound_name = pop_sounds[ sound_idx ];
11047
11048
11049 magazine.ServerAddAmmoCount(-1);
11050
11051
11052 float min_temp_to_explode = 100;
11053
11054 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11055 {
11057 }
11058 }
11059
11060
11061 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11062 {
11063 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11064
11065 const int CHANCE_DAMAGE_CARGO = 4;
11066 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11067 const int CHANCE_DAMAGE_NOTHING = 2;
11068
11070 {
11071 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11072 int chances;
11073 int rnd;
11074
11075 if (GetInventory().GetCargo())
11076 {
11077 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11078 rnd = Math.RandomInt(0,chances);
11079
11080 if (rnd < CHANCE_DAMAGE_CARGO)
11081 {
11083 }
11084 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11085 {
11087 }
11088 }
11089 else
11090 {
11091 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11092 rnd = Math.RandomInt(0,chances);
11093
11094 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11095 {
11097 }
11098 }
11099 }
11100 }
11101
11103 {
11104 if (GetInventory().GetCargo())
11105 {
11106 int item_count = GetInventory().GetCargo().GetItemCount();
11107 if (item_count > 0)
11108 {
11109 int random_pick = Math.RandomInt(0, item_count);
11111 if (!item.IsExplosive())
11112 {
11113 item.AddHealth("","",damage);
11114 return true;
11115 }
11116 }
11117 }
11118 return false;
11119 }
11120
11122 {
11123 int attachment_count = GetInventory().AttachmentCount();
11124 if (attachment_count > 0)
11125 {
11126 int random_pick = Math.RandomInt(0, attachment_count);
11127 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11128 if (!attachment.IsExplosive())
11129 {
11130 attachment.AddHealth("","",damage);
11131 return true;
11132 }
11133 }
11134 return false;
11135 }
11136
11138 {
11140 }
11141
11143 {
11145 return GetInventory().CanRemoveEntity();
11146
11147 return false;
11148 }
11149
11151 {
11152
11154 return false;
11155
11156
11158 return false;
11159
11160
11161
11163 if (delta == 0)
11164 return false;
11165
11166
11167 return true;
11168 }
11169
11171 {
11173 {
11174 if (ScriptInputUserData.CanStoreInputUserData())
11175 {
11176 ScriptInputUserData ctx = new ScriptInputUserData;
11181 ctx.
Write(destination_entity);
11183 ctx.
Write(slot_id);
11185 }
11186 }
11187 else if (!
GetGame().IsMultiplayer())
11188 {
11190 }
11191 }
11192
11194 {
11195 float split_quantity_new;
11199 InventoryLocation loc = new InventoryLocation;
11200
11201 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11202 {
11204 split_quantity_new = stack_max;
11205 else
11207
11209 {
11210 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11211 if (new_item)
11212 {
11213 new_item.SetResultOfSplit(true);
11214 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11216 new_item.
SetQuantity(split_quantity_new,
false,
true);
11217 }
11218 }
11219 }
11220 else if (destination_entity && slot_id == -1)
11221 {
11222 if (quantity > stack_max)
11223 split_quantity_new = stack_max;
11224 else
11225 split_quantity_new = quantity;
11226
11228 {
11230 {
11233 }
11234
11235 if (new_item)
11236 {
11237 new_item.SetResultOfSplit(true);
11238 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11240 new_item.
SetQuantity(split_quantity_new,
false,
true);
11241 }
11242 }
11243 }
11244 else
11245 {
11246 if (stack_max != 0)
11247 {
11249 {
11251 }
11252
11253 if (split_quantity_new == 0)
11254 {
11255 if (!
GetGame().IsMultiplayer())
11256 player.PhysicalPredictiveDropItem(this);
11257 else
11258 player.ServerDropEntity(this);
11259 return;
11260 }
11261
11263 {
11265
11266 if (new_item)
11267 {
11268 new_item.SetResultOfSplit(true);
11269 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11272 new_item.PlaceOnSurface();
11273 }
11274 }
11275 }
11276 }
11277 }
11278
11280 {
11281 float split_quantity_new;
11285 InventoryLocation loc = new InventoryLocation;
11286
11287 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11288 {
11290 split_quantity_new = stack_max;
11291 else
11293
11295 {
11296 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11297 if (new_item)
11298 {
11299 new_item.SetResultOfSplit(true);
11300 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11302 new_item.
SetQuantity(split_quantity_new,
false,
true);
11303 }
11304 }
11305 }
11306 else if (destination_entity && slot_id == -1)
11307 {
11308 if (quantity > stack_max)
11309 split_quantity_new = stack_max;
11310 else
11311 split_quantity_new = quantity;
11312
11314 {
11316 {
11319 }
11320
11321 if (new_item)
11322 {
11323 new_item.SetResultOfSplit(true);
11324 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11326 new_item.
SetQuantity(split_quantity_new,
false,
true);
11327 }
11328 }
11329 }
11330 else
11331 {
11332 if (stack_max != 0)
11333 {
11335 {
11337 }
11338
11340 {
11342
11343 if (new_item)
11344 {
11345 new_item.SetResultOfSplit(true);
11346 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11349 new_item.PlaceOnSurface();
11350 }
11351 }
11352 }
11353 }
11354 }
11355
11357 {
11359 {
11360 if (ScriptInputUserData.CanStoreInputUserData())
11361 {
11362 ScriptInputUserData ctx = new ScriptInputUserData;
11367 dst.WriteToContext(ctx);
11369 }
11370 }
11371 else if (!
GetGame().IsMultiplayer())
11372 {
11374 }
11375 }
11376
11378 {
11380 {
11381 if (ScriptInputUserData.CanStoreInputUserData())
11382 {
11383 ScriptInputUserData ctx = new ScriptInputUserData;
11388 ctx.
Write(destination_entity);
11394 }
11395 }
11396 else if (!
GetGame().IsMultiplayer())
11397 {
11399 }
11400 }
11401
11403 {
11405 }
11406
11408 {
11410 float split_quantity_new;
11412 if (dst.IsValid())
11413 {
11414 int slot_id = dst.GetSlot();
11416
11417 if (quantity > stack_max)
11418 split_quantity_new = stack_max;
11419 else
11420 split_quantity_new = quantity;
11421
11423 {
11425
11426 if (new_item)
11427 {
11428 new_item.SetResultOfSplit(true);
11429 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11431 new_item.
SetQuantity(split_quantity_new,
false,
true);
11432 }
11433
11434 return new_item;
11435 }
11436 }
11437
11438 return null;
11439 }
11440
11442 {
11444 float split_quantity_new;
11446 if (destination_entity)
11447 {
11449 if (quantity > stackable)
11450 split_quantity_new = stackable;
11451 else
11452 split_quantity_new = quantity;
11453
11455 {
11456 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11457 if (new_item)
11458 {
11459 new_item.SetResultOfSplit(true);
11460 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11462 new_item.
SetQuantity(split_quantity_new,
false,
true);
11463 }
11464 }
11465 }
11466 }
11467
11469 {
11471 {
11472 if (ScriptInputUserData.CanStoreInputUserData())
11473 {
11474 ScriptInputUserData ctx = new ScriptInputUserData;
11479 ItemBase destination_entity =
this;
11480 ctx.
Write(destination_entity);
11484 }
11485 }
11486 else if (!
GetGame().IsMultiplayer())
11487 {
11489 }
11490 }
11491
11493 {
11495 float split_quantity_new;
11497 if (player)
11498 {
11500 if (quantity > stackable)
11501 split_quantity_new = stackable;
11502 else
11503 split_quantity_new = quantity;
11504
11506 {
11507 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11508 new_item =
ItemBase.Cast(in_hands);
11509 if (new_item)
11510 {
11511 new_item.SetResultOfSplit(true);
11512 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11514 new_item.SetQuantity(split_quantity_new, false, true);
11515 }
11516 }
11517 }
11518 }
11519
11521 {
11523 float split_quantity_new = Math.Floor(quantity * 0.5);
11524
11526 return;
11527
11529
11530 if (new_item)
11531 {
11532 if (new_item.GetQuantityMax() < split_quantity_new)
11533 {
11534 split_quantity_new = new_item.GetQuantityMax();
11535 }
11536
11537 new_item.SetResultOfSplit(true);
11538 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11539
11541 {
11544 }
11545 else
11546 {
11548 new_item.
SetQuantity(split_quantity_new,
false,
true);
11549 }
11550 }
11551 }
11552
11554 {
11556 float split_quantity_new = Math.Floor(quantity / 2);
11557
11559 return;
11560
11561 InventoryLocation invloc = new InventoryLocation;
11563
11565 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11566
11567 if (new_item)
11568 {
11569 if (new_item.GetQuantityMax() < split_quantity_new)
11570 {
11571 split_quantity_new = new_item.GetQuantityMax();
11572 }
11574 {
11577 }
11578 else if (split_quantity_new > 1)
11579 {
11581 new_item.
SetQuantity(split_quantity_new,
false,
true);
11582 }
11583 }
11584 }
11585
11588 {
11589 SetWeightDirty();
11591
11592 if (parent)
11593 parent.OnAttachmentQuantityChangedEx(this, delta);
11594
11596 {
11598 {
11600 }
11602 {
11603 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11605 }
11606 }
11607
11608 }
11609
11612 {
11613
11614 }
11615
11618 {
11620 }
11621
11623 {
11624 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11625
11627 {
11628 if (newLevel == GameConstants.STATE_RUINED)
11629 {
11631 EntityAI parent = GetHierarchyParent();
11632 if (parent && parent.IsFireplace())
11633 {
11634 CargoBase cargo = GetInventory().GetCargo();
11635 if (cargo)
11636 {
11638 {
11640 }
11641 }
11642 }
11643 }
11644
11646 {
11647
11649 return;
11650 }
11651
11652 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11653 {
11655 }
11656 }
11657 }
11658
11659
11661 {
11662 super.OnRightClick();
11663
11665 {
11667 {
11668 if (ScriptInputUserData.CanStoreInputUserData())
11669 {
11670 EntityAI root = GetHierarchyRoot();
11671 Man playerOwner = GetHierarchyRootPlayer();
11672 InventoryLocation dst = new InventoryLocation;
11673
11674
11675 if (!playerOwner && root && root == this)
11676 {
11678 }
11679 else
11680 {
11681
11682 GetInventory().GetCurrentInventoryLocation(dst);
11684 {
11687 {
11689 }
11690 else
11691 {
11693
11694
11695 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11696 {
11698 }
11699 else
11700 {
11701 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11702 }
11703 }
11704 }
11705 }
11706
11707 ScriptInputUserData ctx = new ScriptInputUserData;
11715 }
11716 }
11717 else if (!
GetGame().IsMultiplayer())
11718 {
11720 }
11721 }
11722 }
11723
11725 {
11726 if (root)
11727 {
11728 vector m4[4];
11729 root.GetTransform(m4);
11730 dst.SetGround(this, m4);
11731 }
11732 else
11733 {
11734 GetInventory().GetCurrentInventoryLocation(dst);
11735 }
11736 }
11737
11738 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11739 {
11740
11741 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11742 return false;
11743
11744 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11745 return false;
11746
11747
11749 return false;
11750
11751
11752 Magazine mag = Magazine.Cast(this);
11753 if (mag)
11754 {
11755 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11756 return false;
11757
11758 if (stack_max_limit)
11759 {
11760 Magazine other_mag = Magazine.Cast(other_item);
11761 if (other_item)
11762 {
11763 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11764 return false;
11765 }
11766
11767 }
11768 }
11769 else
11770 {
11771
11773 return false;
11774
11776 return false;
11777 }
11778
11779 PlayerBase player = null;
11780 if (CastTo(player, GetHierarchyRootPlayer()))
11781 {
11782 if (player.GetInventory().HasAttachment(this))
11783 return false;
11784
11785 if (player.IsItemsToDelete())
11786 return false;
11787 }
11788
11789 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11790 return false;
11791
11792 int slotID;
11794 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11795 return false;
11796
11797 return true;
11798 }
11799
11801 {
11803 }
11804
11806 {
11807 return m_IsResultOfSplit;
11808 }
11809
11811 {
11812 m_IsResultOfSplit = value;
11813 }
11814
11816 {
11818 }
11819
11821 {
11822 float other_item_quantity = other_item.GetQuantity();
11823 float this_free_space;
11824
11826
11828
11829 if (other_item_quantity > this_free_space)
11830 {
11831 return this_free_space;
11832 }
11833 else
11834 {
11835 return other_item_quantity;
11836 }
11837 }
11838
11840 {
11842 }
11843
11845 {
11847 return;
11848
11849 if (!IsMagazine() && other_item)
11850 {
11852 if (quantity_used != 0)
11853 {
11854 float hp1 = GetHealth01("","");
11855 float hp2 = other_item.GetHealth01("","");
11856 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11857 hpResult = hpResult / (
GetQuantity() + quantity_used);
11858
11859 hpResult *= GetMaxHealth();
11860 Math.Round(hpResult);
11861 SetHealth("", "Health", hpResult);
11862
11864 other_item.AddQuantity(-quantity_used);
11865 }
11866 }
11868 }
11869
11871 {
11872 #ifdef SERVER
11873 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11874 GetHierarchyParent().IncreaseLifetimeUp();
11875 #endif
11876 };
11877
11879 {
11880 PlayerBase p = PlayerBase.Cast(player);
11881
11882 array<int> recipesIds = p.m_Recipes;
11883 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11884 if (moduleRecipesManager)
11885 {
11886 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11887 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11888 }
11889
11890 for (int i = 0;i < recipesIds.Count(); i++)
11891 {
11892 int key = recipesIds.Get(i);
11893 string recipeName = moduleRecipesManager.GetRecipeName(key);
11895 }
11896 }
11897
11898
11899 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11900 {
11901 super.GetDebugActions(outputList);
11902
11903
11909
11910
11915
11920
11921
11925
11926
11928 {
11932 }
11933
11936
11937
11941
11943
11944 InventoryLocation loc = new InventoryLocation();
11945 GetInventory().GetCurrentInventoryLocation(loc);
11947 {
11948 if (Gizmo_IsSupported())
11951 }
11952
11954 }
11955
11956
11957
11958
11960 {
11961 super.OnAction(action_id, player, ctx);
11962
11964 {
11965 switch (action_id)
11966 {
11969 return true;
11972 return true;
11973 }
11974 }
11975
11977 {
11978 switch (action_id)
11979 {
11981 Delete();
11982 return true;
11983 }
11984 }
11985
11986 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11987 {
11988 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11989 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11990 PlayerBase p = PlayerBase.Cast(player);
11991 if (
EActions.RECIPES_RANGE_START < 1000)
11992 {
11993 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11994 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11995 }
11996 }
11997 #ifndef SERVER
11998 else if (action_id ==
EActions.WATCH_PLAYER)
11999 {
12000 PluginDeveloper.SetDeveloperItemClientEx(player);
12001 }
12002 #endif
12004 {
12005 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
12006 {
12007 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
12008 OnDebugButtonPressServer(id + 1);
12009 }
12010
12011 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
12012 {
12013 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
12015 }
12016
12017 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
12018 {
12019 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
12021 }
12022
12023 else if (action_id ==
EActions.ADD_QUANTITY)
12024 {
12025 if (IsMagazine())
12026 {
12027 Magazine mag = Magazine.Cast(this);
12028 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
12029 }
12030 else
12031 {
12033 }
12034
12035 if (m_EM)
12036 {
12037 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12038 }
12039
12040 }
12041
12042 else if (action_id ==
EActions.REMOVE_QUANTITY)
12043 {
12044 if (IsMagazine())
12045 {
12046 Magazine mag2 = Magazine.Cast(this);
12047 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12048 }
12049 else
12050 {
12052 }
12053 if (m_EM)
12054 {
12055 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12056 }
12057
12058 }
12059
12060 else if (action_id ==
EActions.SET_QUANTITY_0)
12061 {
12063
12064 if (m_EM)
12065 {
12066 m_EM.SetEnergy(0);
12067 }
12068 }
12069
12070 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12071 {
12073
12074 if (m_EM)
12075 {
12076 m_EM.SetEnergy(m_EM.GetEnergyMax());
12077 }
12078 }
12079
12080 else if (action_id ==
EActions.ADD_HEALTH)
12081 {
12082 AddHealth("","",GetMaxHealth("","Health")/5);
12083 }
12084 else if (action_id ==
EActions.REMOVE_HEALTH)
12085 {
12086 AddHealth("","",-GetMaxHealth("","Health")/5);
12087 }
12088 else if (action_id ==
EActions.DESTROY_HEALTH)
12089 {
12090 SetHealth01("","",0);
12091 }
12092 else if (action_id ==
EActions.WATCH_ITEM)
12093 {
12095 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12096 #ifdef DEVELOPER
12097 SetDebugDeveloper_item(this);
12098 #endif
12099 }
12100
12101 else if (action_id ==
EActions.ADD_TEMPERATURE)
12102 {
12103 AddTemperature(20);
12104
12105 }
12106
12107 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12108 {
12109 AddTemperature(-20);
12110
12111 }
12112
12113 else if (action_id ==
EActions.FLIP_FROZEN)
12114 {
12115 SetFrozen(!GetIsFrozen());
12116
12117 }
12118
12119 else if (action_id ==
EActions.ADD_WETNESS)
12120 {
12122
12123 }
12124
12125 else if (action_id ==
EActions.REMOVE_WETNESS)
12126 {
12128
12129 }
12130
12131 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12132 {
12135
12136
12137 }
12138
12139 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12140 {
12143 }
12144
12145 else if (action_id ==
EActions.MAKE_SPECIAL)
12146 {
12147 auto debugParams = DebugSpawnParams.WithPlayer(player);
12148 OnDebugSpawnEx(debugParams);
12149 }
12150
12151 }
12152
12153
12154 return false;
12155 }
12156
12157
12158
12159
12163
12166
12167
12168
12170 {
12171 return false;
12172 }
12173
12174
12176 {
12177 return true;
12178 }
12179
12180
12182 {
12183 return true;
12184 }
12185
12186
12187
12189 {
12190 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12192 }
12193
12196 {
12197 return null;
12198 }
12199
12201 {
12202 return false;
12203 }
12204
12206 {
12207 return false;
12208 }
12209
12213
12214
12216 {
12217 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12218 return module_repairing.CanRepair(this, item_repair_kit);
12219 }
12220
12221
12222 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12223 {
12224 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12225 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12226 }
12227
12228
12230 {
12231
12232
12233
12234
12235
12236
12237
12238
12239 return 1;
12240 }
12241
12242
12243
12245 {
12247 }
12248
12249
12250
12252 {
12254 }
12255
12256
12265 {
12266 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12267
12268 if (player)
12269 {
12270 player.MessageStatus(text);
12271 }
12272 }
12273
12274
12283 {
12284 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12285
12286 if (player)
12287 {
12288 player.MessageAction(text);
12289 }
12290 }
12291
12292
12301 {
12302 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12303
12304 if (player)
12305 {
12306 player.MessageFriendly(text);
12307 }
12308 }
12309
12310
12319 {
12320 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12321
12322 if (player)
12323 {
12324 player.MessageImportant(text);
12325 }
12326 }
12327
12329 {
12330 return true;
12331 }
12332
12333
12334 override bool KindOf(
string tag)
12335 {
12336 bool found = false;
12337 string item_name = this.
GetType();
12340
12341 int array_size = item_tag_array.Count();
12342 for (int i = 0; i < array_size; i++)
12343 {
12344 if (item_tag_array.Get(i) == tag)
12345 {
12346 found = true;
12347 break;
12348 }
12349 }
12350 return found;
12351 }
12352
12353
12355 {
12356
12357 super.OnRPC(sender, rpc_type,ctx);
12358
12359
12360 switch (rpc_type)
12361 {
12362 #ifndef SERVER
12363 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12364 Param2<bool, string> p = new Param2<bool, string>(false, "");
12365
12367 return;
12368
12369 bool play = p.param1;
12370 string soundSet = p.param2;
12371
12372 if (play)
12373 {
12375 {
12377 {
12379 }
12380 }
12381 else
12382 {
12384 }
12385 }
12386 else
12387 {
12389 }
12390
12391 break;
12392 #endif
12393
12394 }
12395
12397 {
12399 }
12400 }
12401
12402
12403
12404
12406 {
12407 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12408 return plugin.GetID(
name);
12409 }
12410
12412 {
12413 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12414 return plugin.GetName(id);
12415 }
12416
12419 {
12420
12421
12422 int varFlags;
12423 if (!ctx.
Read(varFlags))
12424 return;
12425
12426 if (varFlags & ItemVariableFlags.FLOAT)
12427 {
12429 }
12430 }
12431
12433 {
12434
12435 super.SerializeNumericalVars(floats_out);
12436
12437
12438
12440 {
12442 }
12443
12445 {
12447 }
12448
12450 {
12452 }
12453
12455 {
12460 }
12461
12463 {
12465 }
12466 }
12467
12469 {
12470
12471 super.DeSerializeNumericalVars(floats);
12472
12473
12474 int index = 0;
12475 int mask = Math.Round(floats.Get(index));
12476
12477 index++;
12478
12480 {
12482 {
12484 }
12485 else
12486 {
12487 float quantity = floats.Get(index);
12488 SetQuantity(quantity,
true,
false,
false,
false);
12489 }
12490 index++;
12491 }
12492
12494 {
12495 float wet = floats.Get(index);
12497 index++;
12498 }
12499
12501 {
12502 int liquidtype = Math.Round(floats.Get(index));
12504 index++;
12505 }
12506
12508 {
12510 index++;
12512 index++;
12514 index++;
12516 index++;
12517 }
12518
12520 {
12521 int cleanness = Math.Round(floats.Get(index));
12523 index++;
12524 }
12525 }
12526
12528 {
12529 super.WriteVarsToCTX(ctx);
12530
12531
12533 {
12535 }
12536
12538 {
12540 }
12541
12543 {
12545 }
12546
12548 {
12549 int r,g,b,a;
12555 }
12556
12558 {
12560 }
12561 }
12562
12564 {
12565 if (!super.ReadVarsFromCTX(ctx,version))
12566 return false;
12567
12568 int intValue;
12569 float value;
12570
12571 if (version < 140)
12572 {
12573 if (!ctx.
Read(intValue))
12574 return false;
12575
12576 m_VariablesMask = intValue;
12577 }
12578
12580 {
12581 if (!ctx.
Read(value))
12582 return false;
12583
12585 {
12587 }
12588 else
12589 {
12591 }
12592 }
12593
12594 if (version < 140)
12595 {
12597 {
12598 if (!ctx.
Read(value))
12599 return false;
12600 SetTemperatureDirect(value);
12601 }
12602 }
12603
12605 {
12606 if (!ctx.
Read(value))
12607 return false;
12609 }
12610
12612 {
12613 if (!ctx.
Read(intValue))
12614 return false;
12616 }
12617
12619 {
12620 int r,g,b,a;
12622 return false;
12624 return false;
12626 return false;
12628 return false;
12629
12631 }
12632
12634 {
12635 if (!ctx.
Read(intValue))
12636 return false;
12638 }
12639
12640 if (version >= 138 && version < 140)
12641 {
12643 {
12644 if (!ctx.
Read(intValue))
12645 return false;
12646 SetFrozen(intValue);
12647 }
12648 }
12649
12650 return true;
12651 }
12652
12653
12655 {
12658 {
12660 }
12661
12662 if (!super.OnStoreLoad(ctx, version))
12663 {
12665 return false;
12666 }
12667
12668 if (version >= 114)
12669 {
12670 bool hasQuickBarIndexSaved;
12671
12672 if (!ctx.
Read(hasQuickBarIndexSaved))
12673 {
12675 return false;
12676 }
12677
12678 if (hasQuickBarIndexSaved)
12679 {
12680 int itmQBIndex;
12681
12682
12683 if (!ctx.
Read(itmQBIndex))
12684 {
12686 return false;
12687 }
12688
12689 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12690 if (itmQBIndex != -1 && parentPlayer)
12691 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12692 }
12693 }
12694 else
12695 {
12696
12697 PlayerBase player;
12698 int itemQBIndex;
12699 if (version ==
int.
MAX)
12700 {
12701 if (!ctx.
Read(itemQBIndex))
12702 {
12704 return false;
12705 }
12706 }
12707 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12708 {
12709
12710 if (!ctx.
Read(itemQBIndex))
12711 {
12713 return false;
12714 }
12715 if (itemQBIndex != -1 && player)
12716 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12717 }
12718 }
12719
12720 if (version < 140)
12721 {
12722
12723 if (!LoadVariables(ctx, version))
12724 {
12726 return false;
12727 }
12728 }
12729
12730
12732 {
12734 return false;
12735 }
12736 if (version >= 132)
12737 {
12739 if (raib)
12740 {
12742 {
12744 return false;
12745 }
12746 }
12747 }
12748
12750 return true;
12751 }
12752
12753
12754
12756 {
12757 super.OnStoreSave(ctx);
12758
12759 PlayerBase player;
12760 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12761 {
12763
12764 int itemQBIndex = -1;
12765 itemQBIndex = player.FindQuickBarEntityIndex(this);
12766 ctx.
Write(itemQBIndex);
12767 }
12768 else
12769 {
12771 }
12772
12774
12776 if (raib)
12777 {
12779 }
12780 }
12781
12782
12784 {
12785 super.AfterStoreLoad();
12786
12788 {
12790 }
12791
12793 {
12796 }
12797 }
12798
12800 {
12801 super.EEOnAfterLoad();
12802
12804 {
12806 }
12807
12810 }
12811
12813 {
12814 return false;
12815 }
12816
12817
12818
12820 {
12822 {
12823 #ifdef PLATFORM_CONSOLE
12824
12826 {
12828 if (menu)
12829 {
12831 }
12832 }
12833 #endif
12834 }
12835
12837 {
12840 }
12841
12843 {
12844 SetWeightDirty();
12846 }
12848 {
12851 }
12852
12854 {
12857 }
12859 {
12862 }
12863
12864 super.OnVariablesSynchronized();
12865 }
12866
12867
12868
12870 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12871 {
12872 if (!IsServerCheck(allow_client))
12873 return false;
12874
12876 return false;
12877
12880
12881 if (value <= (min + 0.001))
12882 value = min;
12883
12884 if (value == min)
12885 {
12886 if (destroy_config)
12887 {
12888 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12889 if (dstr)
12890 {
12892 this.Delete();
12893 return true;
12894 }
12895 }
12896 else if (destroy_forced)
12897 {
12899 this.Delete();
12900 return true;
12901 }
12902
12904 }
12905
12908
12910 {
12912
12913 if (delta)
12915 }
12916
12918
12919 return false;
12920 }
12921
12922
12924 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12925 {
12927 }
12928
12930 {
12933 }
12934
12936 {
12939 }
12940
12942 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12943 {
12944 float value_clamped = Math.Clamp(value, 0, 1);
12946 SetQuantity(result, destroy_config, destroy_forced);
12947 }
12948
12949
12952 {
12954 }
12955
12957 {
12959 }
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12971 {
12972 int slot = -1;
12973 if (GetInventory())
12974 {
12975 InventoryLocation il = new InventoryLocation;
12976 GetInventory().GetCurrentInventoryLocation(il);
12978 }
12979
12981 }
12982
12984 {
12985 float quantity_max = 0;
12986
12988 {
12989 if (attSlotID != -1)
12990 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12991
12992 if (quantity_max <= 0)
12994 }
12995
12996 if (quantity_max <= 0)
12998
12999 return quantity_max;
13000 }
13001
13003 {
13005 }
13006
13008 {
13010 }
13011
13012
13014 {
13016 }
13017
13019 {
13021 }
13022
13024 {
13026 }
13027
13028
13030 {
13031
13032 float weightEx = GetWeightEx();
13033 float special = GetInventoryAndCargoWeight();
13034 return weightEx - special;
13035 }
13036
13037
13039 {
13041 }
13042
13044 {
13046 {
13047 #ifdef DEVELOPER
13048 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13049 {
13050 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13052 }
13053 #endif
13054
13055 return GetQuantity() * GetConfigWeightModified();
13056 }
13057 else if (HasEnergyManager())
13058 {
13059 #ifdef DEVELOPER
13060 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13061 {
13062 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13063 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13064 }
13065 #endif
13066 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13067 }
13068 else
13069 {
13070 #ifdef DEVELOPER
13071 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13072 {
13073 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13074 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13075 }
13076 #endif
13077 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13078 }
13079 }
13080
13083 {
13084 int item_count = 0;
13086
13087 if (GetInventory().GetCargo() != NULL)
13088 {
13089 item_count = GetInventory().GetCargo().GetItemCount();
13090 }
13091
13092 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13093 {
13094 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13095 if (item)
13096 item_count += item.GetNumberOfItems();
13097 }
13098 return item_count;
13099 }
13100
13103 {
13104 float weight = 0;
13105 float wetness = 1;
13106 if (include_wetness)
13109 {
13110 weight = wetness * m_ConfigWeight;
13111 }
13113 {
13114 weight = 1;
13115 }
13116 return weight;
13117 }
13118
13119
13120
13122 {
13123 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13124 {
13125 GameInventory inv = GetInventory();
13126 array<EntityAI> items = new array<EntityAI>;
13128 for (int i = 0; i < items.Count(); i++)
13129 {
13131 if (item)
13132 {
13134 }
13135 }
13136 }
13137 }
13138
13139
13140
13141
13143 {
13144 float energy = 0;
13145 if (HasEnergyManager())
13146 {
13147 energy = GetCompEM().GetEnergy();
13148 }
13149 return energy;
13150 }
13151
13152
13154 {
13155 super.OnEnergyConsumed();
13156
13158 }
13159
13161 {
13162 super.OnEnergyAdded();
13163
13165 }
13166
13167
13169 {
13170 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13171 {
13173 {
13174 float energy_0to1 = GetCompEM().GetEnergy0To1();
13176 }
13177 }
13178 }
13179
13180
13182 {
13183 return ConfigGetFloat("heatIsolation");
13184 }
13185
13187 {
13189 }
13190
13192 {
13193 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13194 if (
GetGame().ConfigIsExisting(paramPath))
13196
13197 return 0.0;
13198 }
13199
13201 {
13202 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13203 if (
GetGame().ConfigIsExisting(paramPath))
13205
13206 return 0.0;
13207 }
13208
13209 override void SetWet(
float value,
bool allow_client =
false)
13210 {
13211 if (!IsServerCheck(allow_client))
13212 return;
13213
13216
13218
13219 m_VarWet = Math.Clamp(value, min, max);
13220
13222 {
13225 }
13226 }
13227
13228 override void AddWet(
float value)
13229 {
13231 }
13232
13234 {
13236 }
13237
13239 {
13241 }
13242
13244 {
13246 }
13247
13249 {
13251 }
13252
13254 {
13256 }
13257
13258 override void OnWetChanged(
float newVal,
float oldVal)
13259 {
13262 if (newLevel != oldLevel)
13263 {
13265 }
13266 }
13267
13269 {
13270 SetWeightDirty();
13271 }
13272
13274 {
13275 return GetWetLevelInternal(
m_VarWet);
13276 }
13277
13278
13279
13281 {
13283 }
13284
13286 {
13288 }
13289
13291 {
13293 }
13294
13296 {
13298 }
13299
13300
13301
13303 {
13304 if (ConfigIsExisting("itemModelLength"))
13305 {
13306 return ConfigGetFloat("itemModelLength");
13307 }
13308 return 0;
13309 }
13310
13312 {
13313 if (ConfigIsExisting("itemAttachOffset"))
13314 {
13315 return ConfigGetFloat("itemAttachOffset");
13316 }
13317 return 0;
13318 }
13319
13320 override void SetCleanness(
int value,
bool allow_client =
false)
13321 {
13322 if (!IsServerCheck(allow_client))
13323 return;
13324
13326
13328
13331 }
13332
13334 {
13336 }
13337
13339 {
13340 return true;
13341 }
13342
13343
13344
13345
13347 {
13349 }
13350
13352 {
13354 }
13355
13356
13357
13358
13359 override void SetColor(
int r,
int g,
int b,
int a)
13360 {
13366 }
13368 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13369 {
13374 }
13375
13377 {
13379 }
13380
13383 {
13384 int r,g,b,a;
13386 r = r/255;
13387 g = g/255;
13388 b = b/255;
13389 a = a/255;
13390 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13391 }
13392
13393
13394
13395 override void SetLiquidType(
int value,
bool allow_client =
false)
13396 {
13397 if (!IsServerCheck(allow_client))
13398 return;
13399
13404 }
13405
13407 {
13408 return ConfigGetInt("varLiquidTypeInit");
13409 }
13410
13412 {
13414 }
13415
13417 {
13419 SetFrozen(false);
13420 }
13421
13424 {
13425 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13426 }
13427
13428
13431 {
13432 PlayerBase nplayer;
13433 if (PlayerBase.CastTo(nplayer, player))
13434 {
13436
13437 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13438 }
13439 }
13440
13441
13444 {
13445 PlayerBase nplayer;
13446 if (PlayerBase.CastTo(nplayer,player))
13447 {
13448
13449 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13450
13451 }
13452
13453
13454 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13455
13456
13457 if (HasEnergyManager())
13458 {
13459 GetCompEM().UpdatePlugState();
13460 }
13461 }
13462
13463
13465 {
13466 super.OnPlacementStarted(player);
13467
13469 }
13470
13471 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13472 {
13474 {
13475 m_AdminLog.OnPlacementComplete(player,
this);
13476 }
13477
13478 super.OnPlacementComplete(player, position, orientation);
13479 }
13480
13481
13482
13483
13484
13486 {
13488 {
13489 return true;
13490 }
13491 else
13492 {
13493 return false;
13494 }
13495 }
13496
13497
13499 {
13501 {
13503 }
13504 }
13505
13506
13508 {
13510 }
13511
13513 {
13515 }
13516
13517 override void InsertAgent(
int agent,
float count = 1)
13518 {
13519 if (count < 1)
13520 return;
13521
13523 }
13524
13527 {
13529 }
13530
13531
13533 {
13535 }
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13579 {
13581 return false;
13582 return true;
13583 }
13584
13586 {
13587
13589 }
13590
13591
13594 {
13595 super.CheckForRoofLimited(timeTresholdMS);
13596
13598 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13599 {
13600 m_PreviousRoofTestTime = time;
13601 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13602 }
13603 }
13604
13605
13607 {
13609 {
13610 return 0;
13611 }
13612
13613 if (GetInventory().GetAttachmentSlotsCount() != 0)
13614 {
13615 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13616 if (filter)
13617 return filter.GetProtectionLevel(type, false, system);
13618 else
13619 return 0;
13620 }
13621
13622 string subclassPath, entryName;
13623
13624 switch (type)
13625 {
13627 entryName = "biological";
13628 break;
13630 entryName = "chemical";
13631 break;
13632 default:
13633 entryName = "biological";
13634 break;
13635 }
13636
13637 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13638
13640 }
13641
13642
13643
13646 {
13647 if (!IsMagazine())
13649
13651 }
13652
13653
13654
13655
13656
13661 {
13662 return true;
13663 }
13664
13666 {
13668 }
13669
13670
13671
13672
13673
13675 {
13676 if (parent)
13677 {
13678 if (parent.IsInherited(DayZInfected))
13679 return true;
13680
13681 if (!parent.IsRuined())
13682 return true;
13683 }
13684
13685 return true;
13686 }
13687
13689 {
13690 if (!super.CanPutAsAttachment(parent))
13691 {
13692 return false;
13693 }
13694
13695 if (!IsRuined() && !parent.IsRuined())
13696 {
13697 return true;
13698 }
13699
13700 return false;
13701 }
13702
13704 {
13705
13706
13707
13708
13709 return super.CanReceiveItemIntoCargo(item);
13710 }
13711
13713 {
13714
13715
13716
13717
13718 GameInventory attachmentInv = attachment.GetInventory();
13720 {
13721 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13722 return false;
13723 }
13724
13725 InventoryLocation loc = new InventoryLocation();
13726 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13727 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13728 return false;
13729
13730 return super.CanReceiveAttachment(attachment, slotId);
13731 }
13732
13734 {
13735 if (!super.CanReleaseAttachment(attachment))
13736 return false;
13737
13738 return GetInventory().AreChildrenAccessible();
13739 }
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13762 {
13763 int id = muzzle_owner.GetMuzzleID();
13764 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13765
13766 if (WPOF_array)
13767 {
13768 for (int i = 0; i < WPOF_array.Count(); i++)
13769 {
13770 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13771
13772 if (WPOF)
13773 {
13774 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13775 }
13776 }
13777 }
13778 }
13779
13780
13782 {
13783 int id = muzzle_owner.GetMuzzleID();
13785
13786 if (WPOBE_array)
13787 {
13788 for (int i = 0; i < WPOBE_array.Count(); i++)
13789 {
13790 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13791
13792 if (WPOBE)
13793 {
13794 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13795 }
13796 }
13797 }
13798 }
13799
13800
13802 {
13803 int id = muzzle_owner.GetMuzzleID();
13804 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13805
13806 if (WPOOH_array)
13807 {
13808 for (int i = 0; i < WPOOH_array.Count(); i++)
13809 {
13810 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13811
13812 if (WPOOH)
13813 {
13814 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13815 }
13816 }
13817 }
13818 }
13819
13820
13822 {
13823 int id = muzzle_owner.GetMuzzleID();
13824 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13825
13826 if (WPOOH_array)
13827 {
13828 for (int i = 0; i < WPOOH_array.Count(); i++)
13829 {
13830 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13831
13832 if (WPOOH)
13833 {
13834 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13835 }
13836 }
13837 }
13838 }
13839
13840
13842 {
13843 int id = muzzle_owner.GetMuzzleID();
13844 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13845
13846 if (WPOOH_array)
13847 {
13848 for (int i = 0; i < WPOOH_array.Count(); i++)
13849 {
13850 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13851
13852 if (WPOOH)
13853 {
13854 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13855 }
13856 }
13857 }
13858 }
13859
13860
13861
13863 {
13865 {
13866 return true;
13867 }
13868
13869 return false;
13870 }
13871
13873 {
13875 {
13876 return true;
13877 }
13878
13879 return false;
13880 }
13881
13883 {
13885 {
13886 return true;
13887 }
13888
13889 return false;
13890 }
13891
13893 {
13894 return false;
13895 }
13896
13899 {
13900 return UATimeSpent.DEFAULT_DEPLOY;
13901 }
13902
13903
13904
13905
13907 {
13909 SetSynchDirty();
13910 }
13911
13913 {
13915 }
13916
13917
13919 {
13920 return false;
13921 }
13922
13925 {
13926 string att_type = "None";
13927
13928 if (ConfigIsExisting("soundAttType"))
13929 {
13930 att_type = ConfigGetString("soundAttType");
13931 }
13932
13934 }
13935
13937 {
13939 }
13940
13941
13942
13943
13944
13950
13952 {
13955
13957 }
13958
13959
13961 {
13963 return;
13964
13966
13969
13972
13973 SoundParameters params = new SoundParameters();
13977 }
13978
13979
13981 {
13983 return;
13984
13986 SetSynchDirty();
13987
13990 }
13991
13992
13994 {
13996 return;
13997
13999 SetSynchDirty();
14000
14003 }
14004
14006 {
14008 }
14009
14011 {
14013 }
14014
14017 {
14018 if (!
GetGame().IsDedicatedServer())
14019 {
14020 if (ConfigIsExisting("attachSoundSet"))
14021 {
14022 string cfg_path = "";
14023 string soundset = "";
14024 string type_name =
GetType();
14025
14028 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
14029 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
14030
14031 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
14032 {
14033 for (int i = 0; i < cfg_soundset_array.Count(); i++)
14034 {
14035 if (cfg_slot_array[i] == slot_type)
14036 {
14037 soundset = cfg_soundset_array[i];
14038 break;
14039 }
14040 }
14041 }
14042
14043 if (soundset != "")
14044 {
14045 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14047 }
14048 }
14049 }
14050 }
14051
14053 {
14054
14055 }
14056
14057 void OnApply(PlayerBase player);
14058
14060 {
14061 return 1.0;
14062 };
14063
14065 {
14067 }
14068
14070 {
14072 }
14073
14075
14077 {
14078 SetDynamicPhysicsLifeTime(0.01);
14080 }
14081
14083 {
14084 array<string> zone_names = new array<string>;
14085 GetDamageZones(zone_names);
14086 for (int i = 0; i < zone_names.Count(); i++)
14087 {
14088 SetHealthMax(zone_names.Get(i),"Health");
14089 }
14090 SetHealthMax("","Health");
14091 }
14092
14095 {
14096 float global_health = GetHealth01("","Health");
14097 array<string> zones = new array<string>;
14098 GetDamageZones(zones);
14099
14100 for (int i = 0; i < zones.Count(); i++)
14101 {
14102 SetHealth01(zones.Get(i),"Health",global_health);
14103 }
14104 }
14105
14108 {
14109 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14110 }
14111
14113 {
14114 if (!hasRootAsPlayer)
14115 {
14116 if (refParentIB)
14117 {
14118
14119 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14120 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14121
14122 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14123 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14124
14127 }
14128 else
14129 {
14130
14133 }
14134 }
14135 }
14136
14138 {
14140 {
14141 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14142 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14143 {
14144 float heatPermCoef = 1.0;
14146 while (ent)
14147 {
14148 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14149 ent = ent.GetHierarchyParent();
14150 }
14151
14152 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14153 }
14154 }
14155 }
14156
14158 {
14159
14160 EntityAI parent = GetHierarchyParent();
14161 if (!parent)
14162 {
14163 hasParent = false;
14164 hasRootAsPlayer = false;
14165 }
14166 else
14167 {
14168 hasParent = true;
14169 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14170 refParentIB =
ItemBase.Cast(parent);
14171 }
14172 }
14173
14174 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14175 {
14176
14177 }
14178
14180 {
14181
14182 return false;
14183 }
14184
14186 {
14187
14188
14189 return false;
14190 }
14191
14193 {
14194
14195 return false;
14196 }
14197
14200 {
14201 return !GetIsFrozen() &&
IsOpen();
14202 }
14203
14205 {
14206 bool hasParent = false, hasRootAsPlayer = false;
14208
14209 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14210 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14211
14212 if (wwtu || foodDecay)
14213 {
14217
14218 if (processWetness || processTemperature || processDecay)
14219 {
14221
14222 if (processWetness)
14223 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14224
14225 if (processTemperature)
14227
14228 if (processDecay)
14229 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14230 }
14231 }
14232 }
14233
14236 {
14238 }
14239
14241 {
14244
14245 return super.GetTemperatureFreezeThreshold();
14246 }
14247
14249 {
14252
14253 return super.GetTemperatureThawThreshold();
14254 }
14255
14257 {
14260
14261 return super.GetItemOverheatThreshold();
14262 }
14263
14265 {
14267 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14268
14269 return super.GetTemperatureFreezeTime();
14270 }
14271
14273 {
14275 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14276
14277 return super.GetTemperatureThawTime();
14278 }
14279
14284
14286 {
14287 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14288 }
14289
14291 {
14292 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14293 }
14294
14297 {
14299 }
14300
14302 {
14304 }
14305
14307 {
14309 }
14310
14313 {
14314 return null;
14315 }
14316
14319 {
14320 return false;
14321 }
14322
14324 {
14326 {
14329 if (!trg)
14330 {
14332 explosive = this;
14333 }
14334
14335 explosive.PairRemote(trg);
14337
14338 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14339 trg.SetPersistentPairID(persistentID);
14340 explosive.SetPersistentPairID(persistentID);
14341
14342 return true;
14343 }
14344 return false;
14345 }
14346
14349 {
14350 float ret = 1.0;
14353 ret *= GetHealth01();
14354
14355 return ret;
14356 }
14357
14358 #ifdef DEVELOPER
14359 override void SetDebugItem()
14360 {
14361 super.SetDebugItem();
14362 _itemBase = this;
14363 }
14364
14366 {
14367 string text = super.GetDebugText();
14368
14370 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14371
14372 return text;
14373 }
14374 #endif
14375
14377 {
14378 return true;
14379 }
14380
14382
14384
14386 {
14389 }
14390
14391
14399
14415}
14416
14418{
14420 if (entity)
14421 {
14422 bool is_item = entity.IsInherited(
ItemBase);
14423 if (is_item && full_quantity)
14424 {
14427 }
14428 }
14429 else
14430 {
14432 return NULL;
14433 }
14434 return entity;
14435}
14436
14438{
14439 if (item)
14440 {
14441 if (health > 0)
14442 item.SetHealth("", "", health);
14443
14444 if (item.CanHaveTemperature())
14445 {
14447 if (item.CanFreeze())
14448 item.SetFrozen(false);
14449 }
14450
14451 if (item.HasEnergyManager())
14452 {
14453 if (quantity >= 0)
14454 {
14455 item.GetCompEM().SetEnergy0To1(quantity);
14456 }
14457 else
14458 {
14460 }
14461 }
14462 else if (item.IsMagazine())
14463 {
14464 Magazine mag = Magazine.Cast(item);
14465 if (quantity >= 0)
14466 {
14467 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14468 }
14469 else
14470 {
14472 }
14473
14474 }
14475 else
14476 {
14477 if (quantity >= 0)
14478 {
14479 item.SetQuantityNormalized(quantity, false);
14480 }
14481 else
14482 {
14484 }
14485
14486 }
14487 }
14488}
14489
14490#ifdef DEVELOPER
14492#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.