9691{
9693 {
9694 return true;
9695 }
9696};
9697
9698
9699
9701{
9705
9707
9710
9711
9712
9713
9714
9723
9729
9734
9739
9760 protected bool m_IsResultOfSplit
9761
9763
9768
9769
9770
9772
9776
9777
9778
9780
9783
9784
9785
9791
9792
9800
9803
9804
9806
9807
9809
9810
9815
9816
9821
9822
9824
9825
9827 {
9832
9833 if (!
GetGame().IsDedicatedServer())
9834 {
9836 {
9838
9840 {
9842 }
9843 }
9844
9847 }
9848
9849 m_OldLocation = null;
9850
9852 {
9854 }
9855
9856 if (ConfigIsExisting("headSelectionsToHide"))
9857 {
9860 }
9861
9863 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9864 {
9866 }
9867
9869
9870 m_IsResultOfSplit = false;
9871
9873 }
9874
9876 {
9877 super.InitItemVariables();
9878
9884 m_Count = ConfigGetInt(
"count");
9885
9888
9893
9896
9901
9913
9917
9918
9921 if (ConfigIsExisting("canBeSplit"))
9922 {
9925 }
9926
9928 if (ConfigIsExisting("itemBehaviour"))
9930
9931
9934 RegisterNetSyncVariableInt("m_VarLiquidType");
9935 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9936
9937 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9938 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9939 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9940
9941 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9942 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9943 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9944 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9945
9946 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9947 RegisterNetSyncVariableBool("m_IsTakeable");
9948 RegisterNetSyncVariableBool("m_IsHologram");
9949
9952 {
9955 }
9956
9958
9960 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9962
9963 }
9964
9966 {
9968 }
9969
9971 {
9974 {
9979 }
9980 }
9981
9982 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9983 {
9985 {
9988 }
9989
9991 }
9992
9994 {
10000 }
10001
10003
10005 {
10007
10008 if (!action)
10009 {
10010 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
10011 return;
10012 }
10013
10015 if (!ai)
10016 {
10018 return;
10019 }
10020
10022 if (!action_array)
10023 {
10024 action_array = new array<ActionBase_Basic>;
10026 }
10027 if (LogManager.IsActionLogEnable())
10028 {
10029 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
10030 }
10031
10032 if (action_array.Find(action) != -1)
10033 {
10034 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
10035 }
10036 else
10037 {
10038 action_array.Insert(action);
10039 }
10040 }
10041
10043 {
10045 ActionBase action = player.GetActionManager().GetAction(actionName);
10048
10049 if (action_array)
10050 {
10051 action_array.RemoveItem(action);
10052 }
10053 }
10054
10055
10056
10058 {
10059 ActionOverrideData overrideData = new ActionOverrideData();
10063
10065 if (!actionMap)
10066 {
10069 }
10070
10071 actionMap.Insert(this.
Type(), overrideData);
10072
10073 }
10074
10076
10078
10079
10081 {
10084
10087
10088 string config_to_search = "CfgVehicles";
10089 string muzzle_owner_config;
10090
10092 {
10093 if (IsInherited(Weapon))
10094 config_to_search = "CfgWeapons";
10095
10096 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10097
10098 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
10099
10101
10102 if (config_OnFire_subclass_count > 0)
10103 {
10104 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
10105
10106 for (int i = 0; i < config_OnFire_subclass_count; i++)
10107 {
10108 string particle_class = "";
10110 string config_OnFire_entry = config_OnFire_class + particle_class;
10111 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
10112 WPOF_array.Insert(WPOF);
10113 }
10114
10115
10117 }
10118 }
10119
10121 {
10122 config_to_search = "CfgWeapons";
10123 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10124
10125 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
10126
10128
10129 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
10130 {
10131 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
10132
10133 for (i = 0; i < config_OnBulletCasingEject_count; i++)
10134 {
10135 string particle_class2 = "";
10137 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
10138 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
10139 WPOBE_array.Insert(WPOBE);
10140 }
10141
10142
10144 }
10145 }
10146 }
10147
10148
10150 {
10153
10155 {
10156 string config_to_search = "CfgVehicles";
10157
10158 if (IsInherited(Weapon))
10159 config_to_search = "CfgWeapons";
10160
10161 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10162 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10163
10164 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10165 {
10166
10168
10170 {
10172 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10174 return;
10175 }
10176
10179
10180
10181
10183 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10184
10185 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10186 {
10187 string particle_class = "";
10189 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10191
10192 if (entry_type == CT_CLASS)
10193 {
10194 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10195 WPOOH_array.Insert(WPOF);
10196 }
10197 }
10198
10199
10201 }
10202 }
10203 }
10204
10206 {
10208 }
10209
10211 {
10213 {
10215
10218
10221
10222 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10223 }
10224 }
10225
10227 {
10229 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10230
10232 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10233
10235 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10236
10238 {
10240 }
10241 }
10242
10244 {
10246 }
10247
10249 {
10252 else
10254
10256 {
10259 }
10260 else
10261 {
10264
10267 }
10268
10270 }
10271
10273 {
10275 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10276 }
10277
10279 {
10281 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10283 }
10284
10286 {
10288 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10289 }
10290
10292 {
10295
10296 OverheatingParticle OP = new OverheatingParticle();
10301
10303 }
10304
10306 {
10309
10310 return -1;
10311 }
10312
10314 {
10316 {
10319
10320 for (int i = count; i > 0; --i)
10321 {
10322 int id = i - 1;
10325
10328
10329 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10330 {
10331 if (p)
10332 {
10335 }
10336 }
10337 }
10338 }
10339 }
10340
10342 {
10344 {
10346 {
10347 int id = i - 1;
10349
10350 if (OP)
10351 {
10353
10354 if (p)
10355 {
10357 }
10358
10359 delete OP;
10360 }
10361 }
10362
10365 }
10366 }
10367
10370 {
10371 return 0.0;
10372 }
10373
10374
10376 {
10377 return 250;
10378 }
10379
10381 {
10382 return 0;
10383 }
10384
10387 {
10389 return true;
10390
10391 return false;
10392 }
10393
10396 {
10399
10401 {
10403 }
10404 else
10405 {
10406
10408 }
10409
10411 }
10412
10419 {
10420 return -1;
10421 }
10422
10423
10424
10425
10427 {
10429 {
10431 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10432
10433 if (r_index >= 0)
10434 {
10435 InventoryLocation r_il = new InventoryLocation;
10436 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10437
10438 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10441 {
10442 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10443 }
10445 {
10446 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10447 }
10448
10449 }
10450
10451 player.GetHumanInventory().ClearUserReservedLocation(this);
10452 }
10453
10456 }
10457
10458
10459
10460
10462 {
10463 return ItemBase.m_DebugActionsMask;
10464 }
10465
10467 {
10468 return ItemBase.m_DebugActionsMask & mask;
10469 }
10470
10472 {
10473 ItemBase.m_DebugActionsMask = mask;
10474 }
10475
10477 {
10478 ItemBase.m_DebugActionsMask |= mask;
10479 }
10480
10482 {
10483 ItemBase.m_DebugActionsMask &= ~mask;
10484 }
10485
10487 {
10489 {
10491 }
10492 else
10493 {
10495 }
10496 }
10497
10498
10500 {
10501 if (GetEconomyProfile())
10502 {
10503 float q_max = GetEconomyProfile().GetQuantityMax();
10504 if (q_max > 0)
10505 {
10506 float q_min = GetEconomyProfile().GetQuantityMin();
10507 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10508
10510 {
10511 ComponentEnergyManager comp = GetCompEM();
10513 {
10515 }
10516 }
10518 {
10520
10521 }
10522
10523 }
10524 }
10525 }
10526
10529 {
10530 EntityAI parent = GetHierarchyParent();
10531
10532 if (parent)
10533 {
10534 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10535 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10536 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10537 }
10538 }
10539
10542 {
10543 EntityAI parent = GetHierarchyParent();
10544
10545 if (parent)
10546 {
10547 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10548 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10549 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10550 }
10551 }
10552
10554 {
10555
10556
10557
10558
10560
10562 {
10563 if (ScriptInputUserData.CanStoreInputUserData())
10564 {
10565 ScriptInputUserData ctx = new ScriptInputUserData;
10571 ctx.
Write(use_stack_max);
10574
10576 {
10577 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10578 }
10579 }
10580 }
10581 else if (!
GetGame().IsMultiplayer())
10582 {
10584 }
10585 }
10586
10588 {
10590 }
10591
10593 {
10595 }
10596
10598 {
10600 }
10601
10603 {
10604
10605 return false;
10606 }
10607
10609 {
10610 return false;
10611 }
10612
10616 {
10617 return false;
10618 }
10619
10621 {
10622 return "";
10623 }
10624
10626
10628 {
10629 return false;
10630 }
10631
10633 {
10634 return true;
10635 }
10636
10637
10638
10640 {
10641 return true;
10642 }
10643
10645 {
10646 return true;
10647 }
10648
10650 {
10651 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10653 }
10654
10656 {
10658 }
10659
10661 {
10663 if (!is_being_placed)
10665 SetSynchDirty();
10666 }
10667
10668
10670
10672 {
10674 }
10675
10677 {
10679 }
10680
10682 {
10683 return 1;
10684 }
10685
10687 {
10688 return false;
10689 }
10690
10692 {
10694 SetSynchDirty();
10695 }
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10732 {
10733 super.OnMovedInsideCargo(container);
10734
10735 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10736 }
10737
10738 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10739 {
10740 super.EEItemLocationChanged(oldLoc,newLoc);
10741
10742 PlayerBase new_player = null;
10743 PlayerBase old_player = null;
10744
10745 if (newLoc.GetParent())
10746 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10747
10748 if (oldLoc.GetParent())
10749 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10750
10752 {
10753 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10754
10755 if (r_index >= 0)
10756 {
10757 InventoryLocation r_il = new InventoryLocation;
10758 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10759
10760 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10763 {
10764 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10765 }
10767 {
10768 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10769 }
10770
10771 }
10772 }
10773
10775 {
10776 if (new_player)
10777 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10778
10779 if (new_player == old_player)
10780 {
10781
10782 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10783 {
10785 {
10786 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10787 {
10788 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10789 }
10790 }
10791 else
10792 {
10793 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10794 }
10795 }
10796
10797 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10798 {
10799 int type = oldLoc.GetType();
10801 {
10802 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10803 }
10805 {
10806 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10807 }
10808 }
10809 if (!m_OldLocation)
10810 {
10811 m_OldLocation = new InventoryLocation;
10812 }
10813 m_OldLocation.Copy(oldLoc);
10814 }
10815 else
10816 {
10817 if (m_OldLocation)
10818 {
10819 m_OldLocation.Reset();
10820 }
10821 }
10822
10824 }
10825 else
10826 {
10827 if (new_player)
10828 {
10829 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10830 if (res_index >= 0)
10831 {
10832 InventoryLocation il = new InventoryLocation;
10833 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10835 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10838 {
10839 il.
GetParent().GetOnReleaseLock().Invoke(it);
10840 }
10842 {
10844 }
10845
10846 }
10847 }
10849 {
10850
10852 }
10853
10854 if (m_OldLocation)
10855 {
10856 m_OldLocation.Reset();
10857 }
10858 }
10859 }
10860
10861 override void EOnContact(IEntity other, Contact extra)
10862 {
10864 {
10865 int liquidType = -1;
10867 if (impactSpeed > 0.0)
10868 {
10870 #ifndef SERVER
10872 #else
10874 SetSynchDirty();
10875 #endif
10877 }
10878 }
10879
10880 #ifdef SERVER
10881 if (GetCompEM() && GetCompEM().IsPlugged())
10882 {
10883 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10884 GetCompEM().UnplugThis();
10885 }
10886 #endif
10887 }
10888
10890
10892 {
10894 }
10895
10897 {
10898
10899 }
10900
10902 {
10903 super.OnItemLocationChanged(old_owner, new_owner);
10904
10905 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10906 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10907
10908 if (!relatedPlayer && playerNew)
10909 relatedPlayer = playerNew;
10910
10911 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10912 {
10914 if (actionMgr)
10915 {
10916 ActionBase currentAction = actionMgr.GetRunningAction();
10917 if (currentAction)
10919 }
10920 }
10921
10922 Man ownerPlayerOld = null;
10923 Man ownerPlayerNew = null;
10924
10925 if (old_owner)
10926 {
10927 if (old_owner.
IsMan())
10928 {
10929 ownerPlayerOld = Man.Cast(old_owner);
10930 }
10931 else
10932 {
10933 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10934 }
10935 }
10936 else
10937 {
10939 {
10941
10942 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10943 {
10944 GetCompEM().UnplugThis();
10945 }
10946 }
10947 }
10948
10949 if (new_owner)
10950 {
10951 if (new_owner.
IsMan())
10952 {
10953 ownerPlayerNew = Man.Cast(new_owner);
10954 }
10955 else
10956 {
10957 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10958 }
10959 }
10960
10961 if (ownerPlayerOld != ownerPlayerNew)
10962 {
10963 if (ownerPlayerOld)
10964 {
10965 array<EntityAI> subItemsExit = new array<EntityAI>;
10967 for (int i = 0; i < subItemsExit.Count(); i++)
10968 {
10971 }
10972 }
10973
10974 if (ownerPlayerNew)
10975 {
10976 array<EntityAI> subItemsEnter = new array<EntityAI>;
10978 for (int j = 0; j < subItemsEnter.Count(); j++)
10979 {
10982 }
10983 }
10984 }
10985 else if (ownerPlayerNew != null)
10986 {
10987 PlayerBase nplayer;
10988 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10989 {
10990 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10992 for (int k = 0; k < subItemsUpdate.Count(); k++)
10993 {
10995 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10996 }
10997 }
10998 }
10999
11000 if (old_owner)
11001 old_owner.OnChildItemRemoved(this);
11002 if (new_owner)
11003 new_owner.OnChildItemReceived(this);
11004 }
11005
11006
11008 {
11009 super.EEDelete(parent);
11010 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
11011 if (player)
11012 {
11014
11015 if (player.IsAlive())
11016 {
11017 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
11018 if (r_index >= 0)
11019 {
11020 InventoryLocation r_il = new InventoryLocation;
11021 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
11022
11023 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
11026 {
11027 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
11028 }
11030 {
11031 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
11032 }
11033
11034 }
11035
11036 player.RemoveQuickBarEntityShortcut(this);
11037 }
11038 }
11039 }
11040
11042 {
11043 super.EEKilled(killer);
11044
11047 {
11048 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
11049 {
11050 if (IsMagazine())
11051 {
11052 if (Magazine.Cast(this).GetAmmoCount() > 0)
11053 {
11055 }
11056 }
11057 else
11058 {
11060 }
11061 }
11062 }
11063 }
11064
11066 {
11067 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
11068
11069 super.OnWasAttached(parent, slot_id);
11070
11073
11075 }
11076
11078 {
11079 super.OnWasDetached(parent, slot_id);
11080
11083 }
11084
11086 {
11087 int idx;
11090
11091 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11092 if (inventory_slots.Count() < 1)
11093 {
11094 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
11095 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
11096 }
11097 else
11098 {
11099 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
11100 }
11101
11102 idx = inventory_slots.Find(slot);
11103 if (idx < 0)
11104 return "";
11105
11106 return attach_types.Get(idx);
11107 }
11108
11110 {
11111 int idx = -1;
11112 string slot;
11113
11116
11117 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11118 if (inventory_slots.Count() < 1)
11119 {
11120 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
11121 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11122 }
11123 else
11124 {
11125 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
11126 if (detach_types.Count() < 1)
11127 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11128 }
11129
11130 for (int i = 0; i < inventory_slots.Count(); i++)
11131 {
11132 slot = inventory_slots.Get(i);
11133 }
11134
11135 if (slot != "")
11136 {
11137 if (detach_types.Count() == 1)
11138 idx = 0;
11139 else
11140 idx = inventory_slots.Find(slot);
11141 }
11142 if (idx < 0)
11143 return "";
11144
11145 return detach_types.Get(idx);
11146 }
11147
11149 {
11150
11152
11153
11154 float min_time = 1;
11155 float max_time = 3;
11156 float delay = Math.RandomFloat(min_time, max_time);
11157
11158 explode_timer.Run(delay, this, "DoAmmoExplosion");
11159 }
11160
11162 {
11163 Magazine magazine = Magazine.Cast(this);
11164 int pop_sounds_count = 6;
11165 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11166
11167
11168 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11169 string sound_name = pop_sounds[ sound_idx ];
11171
11172
11173 magazine.ServerAddAmmoCount(-1);
11174
11175
11176 float min_temp_to_explode = 100;
11177
11178 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11179 {
11181 }
11182 }
11183
11184
11185 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11186 {
11187 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11188
11189 const int CHANCE_DAMAGE_CARGO = 4;
11190 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11191 const int CHANCE_DAMAGE_NOTHING = 2;
11192
11194 {
11195 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11196 int chances;
11197 int rnd;
11198
11199 if (GetInventory().GetCargo())
11200 {
11201 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11202 rnd = Math.RandomInt(0,chances);
11203
11204 if (rnd < CHANCE_DAMAGE_CARGO)
11205 {
11207 }
11208 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11209 {
11211 }
11212 }
11213 else
11214 {
11215 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11216 rnd = Math.RandomInt(0,chances);
11217
11218 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11219 {
11221 }
11222 }
11223 }
11224 }
11225
11227 {
11228 if (GetInventory().GetCargo())
11229 {
11230 int item_count = GetInventory().GetCargo().GetItemCount();
11231 if (item_count > 0)
11232 {
11233 int random_pick = Math.RandomInt(0, item_count);
11235 if (!item.IsExplosive())
11236 {
11237 item.AddHealth("","",damage);
11238 return true;
11239 }
11240 }
11241 }
11242 return false;
11243 }
11244
11246 {
11247 int attachment_count = GetInventory().AttachmentCount();
11248 if (attachment_count > 0)
11249 {
11250 int random_pick = Math.RandomInt(0, attachment_count);
11251 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11252 if (!attachment.IsExplosive())
11253 {
11254 attachment.AddHealth("","",damage);
11255 return true;
11256 }
11257 }
11258 return false;
11259 }
11260
11262 {
11264 }
11265
11267 {
11269 return GetInventory().CanRemoveEntity();
11270
11271 return false;
11272 }
11273
11275 {
11276
11278 return false;
11279
11280
11282 return false;
11283
11284
11285
11287 if (delta == 0)
11288 return false;
11289
11290
11291 return true;
11292 }
11293
11295 {
11297 {
11298 if (ScriptInputUserData.CanStoreInputUserData())
11299 {
11300 ScriptInputUserData ctx = new ScriptInputUserData;
11305 ctx.
Write(destination_entity);
11307 ctx.
Write(slot_id);
11309 }
11310 }
11311 else if (!
GetGame().IsMultiplayer())
11312 {
11314 }
11315 }
11316
11318 {
11319 float split_quantity_new;
11323 InventoryLocation loc = new InventoryLocation;
11324
11325 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11326 {
11328 split_quantity_new = stack_max;
11329 else
11331
11333 {
11334 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11335 if (new_item)
11336 {
11337 new_item.SetResultOfSplit(true);
11338 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11340 new_item.
SetQuantity(split_quantity_new,
false,
true);
11341 }
11342 }
11343 }
11344 else if (destination_entity && slot_id == -1)
11345 {
11346 if (quantity > stack_max)
11347 split_quantity_new = stack_max;
11348 else
11349 split_quantity_new = quantity;
11350
11352 {
11354 {
11357 }
11358
11359 if (new_item)
11360 {
11361 new_item.SetResultOfSplit(true);
11362 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11364 new_item.
SetQuantity(split_quantity_new,
false,
true);
11365 }
11366 }
11367 }
11368 else
11369 {
11370 if (stack_max != 0)
11371 {
11373 {
11375 }
11376
11377 if (split_quantity_new == 0)
11378 {
11379 if (!
GetGame().IsMultiplayer())
11380 player.PhysicalPredictiveDropItem(this);
11381 else
11382 player.ServerDropEntity(this);
11383 return;
11384 }
11385
11387 {
11389
11390 if (new_item)
11391 {
11392 new_item.SetResultOfSplit(true);
11393 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11396 new_item.PlaceOnSurface();
11397 }
11398 }
11399 }
11400 }
11401 }
11402
11404 {
11405 float split_quantity_new;
11409 InventoryLocation loc = new InventoryLocation;
11410
11411 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11412 {
11414 split_quantity_new = stack_max;
11415 else
11417
11419 {
11420 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11421 if (new_item)
11422 {
11423 new_item.SetResultOfSplit(true);
11424 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11426 new_item.
SetQuantity(split_quantity_new,
false,
true);
11427 }
11428 }
11429 }
11430 else if (destination_entity && slot_id == -1)
11431 {
11432 if (quantity > stack_max)
11433 split_quantity_new = stack_max;
11434 else
11435 split_quantity_new = quantity;
11436
11438 {
11440 {
11443 }
11444
11445 if (new_item)
11446 {
11447 new_item.SetResultOfSplit(true);
11448 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11450 new_item.
SetQuantity(split_quantity_new,
false,
true);
11451 }
11452 }
11453 }
11454 else
11455 {
11456 if (stack_max != 0)
11457 {
11459 {
11461 }
11462
11464 {
11466
11467 if (new_item)
11468 {
11469 new_item.SetResultOfSplit(true);
11470 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11473 new_item.PlaceOnSurface();
11474 }
11475 }
11476 }
11477 }
11478 }
11479
11481 {
11483 {
11484 if (ScriptInputUserData.CanStoreInputUserData())
11485 {
11486 ScriptInputUserData ctx = new ScriptInputUserData;
11491 dst.WriteToContext(ctx);
11493 }
11494 }
11495 else if (!
GetGame().IsMultiplayer())
11496 {
11498 }
11499 }
11500
11502 {
11504 {
11505 if (ScriptInputUserData.CanStoreInputUserData())
11506 {
11507 ScriptInputUserData ctx = new ScriptInputUserData;
11512 ctx.
Write(destination_entity);
11518 }
11519 }
11520 else if (!
GetGame().IsMultiplayer())
11521 {
11523 }
11524 }
11525
11527 {
11529 }
11530
11532 {
11534 float split_quantity_new;
11536 if (dst.IsValid())
11537 {
11538 int slot_id = dst.GetSlot();
11540
11541 if (quantity > stack_max)
11542 split_quantity_new = stack_max;
11543 else
11544 split_quantity_new = quantity;
11545
11547 {
11549
11550 if (new_item)
11551 {
11552 new_item.SetResultOfSplit(true);
11553 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11555 new_item.
SetQuantity(split_quantity_new,
false,
true);
11556 }
11557
11558 return new_item;
11559 }
11560 }
11561
11562 return null;
11563 }
11564
11566 {
11568 float split_quantity_new;
11570 if (destination_entity)
11571 {
11573 if (quantity > stackable)
11574 split_quantity_new = stackable;
11575 else
11576 split_quantity_new = quantity;
11577
11579 {
11580 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11581 if (new_item)
11582 {
11583 new_item.SetResultOfSplit(true);
11584 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11586 new_item.
SetQuantity(split_quantity_new,
false,
true);
11587 }
11588 }
11589 }
11590 }
11591
11593 {
11595 {
11596 if (ScriptInputUserData.CanStoreInputUserData())
11597 {
11598 ScriptInputUserData ctx = new ScriptInputUserData;
11603 ItemBase destination_entity =
this;
11604 ctx.
Write(destination_entity);
11608 }
11609 }
11610 else if (!
GetGame().IsMultiplayer())
11611 {
11613 }
11614 }
11615
11617 {
11619 float split_quantity_new;
11621 if (player)
11622 {
11624 if (quantity > stackable)
11625 split_quantity_new = stackable;
11626 else
11627 split_quantity_new = quantity;
11628
11630 {
11631 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11632 new_item =
ItemBase.Cast(in_hands);
11633 if (new_item)
11634 {
11635 new_item.SetResultOfSplit(true);
11636 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11638 new_item.SetQuantity(split_quantity_new, false, true);
11639 }
11640 }
11641 }
11642 }
11643
11645 {
11647 float split_quantity_new = Math.Floor(quantity * 0.5);
11648
11650 return;
11651
11653
11654 if (new_item)
11655 {
11656 if (new_item.GetQuantityMax() < split_quantity_new)
11657 {
11658 split_quantity_new = new_item.GetQuantityMax();
11659 }
11660
11661 new_item.SetResultOfSplit(true);
11662 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11663
11665 {
11668 }
11669 else
11670 {
11672 new_item.
SetQuantity(split_quantity_new,
false,
true);
11673 }
11674 }
11675 }
11676
11678 {
11680 float split_quantity_new = Math.Floor(quantity / 2);
11681
11683 return;
11684
11685 InventoryLocation invloc = new InventoryLocation;
11687
11689 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11690
11691 if (new_item)
11692 {
11693 if (new_item.GetQuantityMax() < split_quantity_new)
11694 {
11695 split_quantity_new = new_item.GetQuantityMax();
11696 }
11698 {
11701 }
11702 else if (split_quantity_new > 1)
11703 {
11705 new_item.
SetQuantity(split_quantity_new,
false,
true);
11706 }
11707 }
11708 }
11709
11712 {
11713 SetWeightDirty();
11715
11716 if (parent)
11717 parent.OnAttachmentQuantityChangedEx(this, delta);
11718
11720 {
11722 {
11724 }
11726 {
11727 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11729 }
11730 }
11731
11732 }
11733
11736 {
11737
11738 }
11739
11742 {
11744 }
11745
11747 {
11748 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11749
11751 {
11752 if (newLevel == GameConstants.STATE_RUINED)
11753 {
11755 EntityAI parent = GetHierarchyParent();
11756 if (parent && parent.IsFireplace())
11757 {
11758 CargoBase cargo = GetInventory().GetCargo();
11759 if (cargo)
11760 {
11762 {
11764 }
11765 }
11766 }
11767 }
11768
11770 {
11771
11773 return;
11774 }
11775
11776 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11777 {
11779 }
11780 }
11781 }
11782
11783
11785 {
11786 super.OnRightClick();
11787
11789 {
11791 {
11792 if (ScriptInputUserData.CanStoreInputUserData())
11793 {
11794 EntityAI root = GetHierarchyRoot();
11795 Man playerOwner = GetHierarchyRootPlayer();
11796 InventoryLocation dst = new InventoryLocation;
11797
11798
11799 if (!playerOwner && root && root == this)
11800 {
11802 }
11803 else
11804 {
11805
11806 GetInventory().GetCurrentInventoryLocation(dst);
11808 {
11811 {
11813 }
11814 else
11815 {
11817
11818
11819 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11820 {
11822 }
11823 else
11824 {
11825 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11826 }
11827 }
11828 }
11829 }
11830
11831 ScriptInputUserData ctx = new ScriptInputUserData;
11839 }
11840 }
11841 else if (!
GetGame().IsMultiplayer())
11842 {
11844 }
11845 }
11846 }
11847
11849 {
11850 if (root)
11851 {
11852 vector m4[4];
11853 root.GetTransform(m4);
11854 dst.SetGround(this, m4);
11855 }
11856 else
11857 {
11858 GetInventory().GetCurrentInventoryLocation(dst);
11859 }
11860 }
11861
11862 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11863 {
11864
11865 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11866 return false;
11867
11868 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11869 return false;
11870
11871
11873 return false;
11874
11875
11876 Magazine mag = Magazine.Cast(this);
11877 if (mag)
11878 {
11879 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11880 return false;
11881
11882 if (stack_max_limit)
11883 {
11884 Magazine other_mag = Magazine.Cast(other_item);
11885 if (other_item)
11886 {
11887 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11888 return false;
11889 }
11890
11891 }
11892 }
11893 else
11894 {
11895
11897 return false;
11898
11900 return false;
11901 }
11902
11903 PlayerBase player = null;
11904 if (CastTo(player, GetHierarchyRootPlayer()))
11905 {
11906 if (player.GetInventory().HasAttachment(this))
11907 return false;
11908
11909 if (player.IsItemsToDelete())
11910 return false;
11911 }
11912
11913 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11914 return false;
11915
11916 int slotID;
11918 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11919 return false;
11920
11921 return true;
11922 }
11923
11925 {
11927 }
11928
11930 {
11931 return m_IsResultOfSplit;
11932 }
11933
11935 {
11936 m_IsResultOfSplit = value;
11937 }
11938
11940 {
11942 }
11943
11945 {
11946 float other_item_quantity = other_item.GetQuantity();
11947 float this_free_space;
11948
11950
11952
11953 if (other_item_quantity > this_free_space)
11954 {
11955 return this_free_space;
11956 }
11957 else
11958 {
11959 return other_item_quantity;
11960 }
11961 }
11962
11964 {
11966 }
11967
11969 {
11971 return;
11972
11973 if (!IsMagazine() && other_item)
11974 {
11976 if (quantity_used != 0)
11977 {
11978 float hp1 = GetHealth01("","");
11979 float hp2 = other_item.GetHealth01("","");
11980 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11981 hpResult = hpResult / (
GetQuantity() + quantity_used);
11982
11983 hpResult *= GetMaxHealth();
11984 Math.Round(hpResult);
11985 SetHealth("", "Health", hpResult);
11986
11988 other_item.AddQuantity(-quantity_used);
11989 }
11990 }
11992 }
11993
11995 {
11996 #ifdef SERVER
11997 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11998 GetHierarchyParent().IncreaseLifetimeUp();
11999 #endif
12000 };
12001
12003 {
12004 PlayerBase p = PlayerBase.Cast(player);
12005
12006 array<int> recipesIds = p.m_Recipes;
12007 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12008 if (moduleRecipesManager)
12009 {
12010 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
12011 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
12012 }
12013
12014 for (int i = 0;i < recipesIds.Count(); i++)
12015 {
12016 int key = recipesIds.Get(i);
12017 string recipeName = moduleRecipesManager.GetRecipeName(key);
12019 }
12020 }
12021
12022
12023 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
12024 {
12025 super.GetDebugActions(outputList);
12026
12027
12033
12034
12039
12044
12045
12049
12050
12052 {
12056 }
12057
12060
12061
12065
12067
12068 InventoryLocation loc = new InventoryLocation();
12069 GetInventory().GetCurrentInventoryLocation(loc);
12071 {
12072 if (Gizmo_IsSupported())
12075 }
12076
12078 }
12079
12080
12081
12082
12084 {
12085 super.OnAction(action_id, player, ctx);
12086
12088 {
12089 switch (action_id)
12090 {
12093 return true;
12096 return true;
12097 }
12098 }
12099
12101 {
12102 switch (action_id)
12103 {
12105 Delete();
12106 return true;
12107 }
12108 }
12109
12110 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
12111 {
12112 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12113 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
12114 PlayerBase p = PlayerBase.Cast(player);
12115 if (
EActions.RECIPES_RANGE_START < 1000)
12116 {
12117 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
12118 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
12119 }
12120 }
12121 #ifndef SERVER
12122 else if (action_id ==
EActions.WATCH_PLAYER)
12123 {
12124 PluginDeveloper.SetDeveloperItemClientEx(player);
12125 }
12126 #endif
12128 {
12129 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
12130 {
12131 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
12132 OnDebugButtonPressServer(id + 1);
12133 }
12134
12135 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
12136 {
12137 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
12139 }
12140
12141 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
12142 {
12143 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
12145 }
12146
12147 else if (action_id ==
EActions.ADD_QUANTITY)
12148 {
12149 if (IsMagazine())
12150 {
12151 Magazine mag = Magazine.Cast(this);
12152 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
12153 }
12154 else
12155 {
12157 }
12158
12159 if (m_EM)
12160 {
12161 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12162 }
12163
12164 }
12165
12166 else if (action_id ==
EActions.REMOVE_QUANTITY)
12167 {
12168 if (IsMagazine())
12169 {
12170 Magazine mag2 = Magazine.Cast(this);
12171 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12172 }
12173 else
12174 {
12176 }
12177 if (m_EM)
12178 {
12179 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12180 }
12181
12182 }
12183
12184 else if (action_id ==
EActions.SET_QUANTITY_0)
12185 {
12187
12188 if (m_EM)
12189 {
12190 m_EM.SetEnergy(0);
12191 }
12192 }
12193
12194 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12195 {
12197
12198 if (m_EM)
12199 {
12200 m_EM.SetEnergy(m_EM.GetEnergyMax());
12201 }
12202 }
12203
12204 else if (action_id ==
EActions.ADD_HEALTH)
12205 {
12206 AddHealth("","",GetMaxHealth("","Health")/5);
12207 }
12208 else if (action_id ==
EActions.REMOVE_HEALTH)
12209 {
12210 AddHealth("","",-GetMaxHealth("","Health")/5);
12211 }
12212 else if (action_id ==
EActions.DESTROY_HEALTH)
12213 {
12214 SetHealth01("","",0);
12215 }
12216 else if (action_id ==
EActions.WATCH_ITEM)
12217 {
12219 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12220 #ifdef DEVELOPER
12221 SetDebugDeveloper_item(this);
12222 #endif
12223 }
12224
12225 else if (action_id ==
EActions.ADD_TEMPERATURE)
12226 {
12227 AddTemperature(20);
12228
12229 }
12230
12231 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12232 {
12233 AddTemperature(-20);
12234
12235 }
12236
12237 else if (action_id ==
EActions.FLIP_FROZEN)
12238 {
12239 SetFrozen(!GetIsFrozen());
12240
12241 }
12242
12243 else if (action_id ==
EActions.ADD_WETNESS)
12244 {
12246
12247 }
12248
12249 else if (action_id ==
EActions.REMOVE_WETNESS)
12250 {
12252
12253 }
12254
12255 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12256 {
12259
12260
12261 }
12262
12263 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12264 {
12267 }
12268
12269 else if (action_id ==
EActions.MAKE_SPECIAL)
12270 {
12271 auto debugParams = DebugSpawnParams.WithPlayer(player);
12272 OnDebugSpawnEx(debugParams);
12273 }
12274
12275 }
12276
12277
12278 return false;
12279 }
12280
12281
12282
12283
12287
12290
12291
12292
12294 {
12295 return false;
12296 }
12297
12298
12300 {
12301 return true;
12302 }
12303
12304
12306 {
12307 return true;
12308 }
12309
12310
12311
12313 {
12314 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12316 }
12317
12320 {
12321 return null;
12322 }
12323
12325 {
12326 return false;
12327 }
12328
12330 {
12331 return false;
12332 }
12333
12337
12338
12340 {
12341 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12342 return module_repairing.CanRepair(this, item_repair_kit);
12343 }
12344
12345
12346 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12347 {
12348 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12349 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12350 }
12351
12352
12354 {
12355
12356
12357
12358
12359
12360
12361
12362
12363 return 1;
12364 }
12365
12366
12367
12369 {
12371 }
12372
12373
12374
12376 {
12378 }
12379
12380
12389 {
12390 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12391
12392 if (player)
12393 {
12394 player.MessageStatus(text);
12395 }
12396 }
12397
12398
12407 {
12408 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12409
12410 if (player)
12411 {
12412 player.MessageAction(text);
12413 }
12414 }
12415
12416
12425 {
12426 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12427
12428 if (player)
12429 {
12430 player.MessageFriendly(text);
12431 }
12432 }
12433
12434
12443 {
12444 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12445
12446 if (player)
12447 {
12448 player.MessageImportant(text);
12449 }
12450 }
12451
12453 {
12454 return true;
12455 }
12456
12457
12458 override bool KindOf(
string tag)
12459 {
12460 bool found = false;
12461 string item_name = this.
GetType();
12464
12465 int array_size = item_tag_array.Count();
12466 for (int i = 0; i < array_size; i++)
12467 {
12468 if (item_tag_array.Get(i) == tag)
12469 {
12470 found = true;
12471 break;
12472 }
12473 }
12474 return found;
12475 }
12476
12477
12479 {
12480
12481 super.OnRPC(sender, rpc_type,ctx);
12482
12483
12484 switch (rpc_type)
12485 {
12486 #ifndef SERVER
12487 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12488 Param2<bool, string> p = new Param2<bool, string>(false, "");
12489
12491 return;
12492
12493 bool play = p.param1;
12494 string soundSet = p.param2;
12495
12496 if (play)
12497 {
12499 {
12501 {
12503 }
12504 }
12505 else
12506 {
12508 }
12509 }
12510 else
12511 {
12513 }
12514
12515 break;
12516 #endif
12517
12518 }
12519
12521 {
12523 }
12524 }
12525
12526
12527
12528
12530 {
12531 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12532 return plugin.GetID(
name);
12533 }
12534
12536 {
12537 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12538 return plugin.GetName(id);
12539 }
12540
12543 {
12544
12545
12546 int varFlags;
12547 if (!ctx.
Read(varFlags))
12548 return;
12549
12550 if (varFlags & ItemVariableFlags.FLOAT)
12551 {
12553 }
12554 }
12555
12557 {
12558
12559 super.SerializeNumericalVars(floats_out);
12560
12561
12562
12564 {
12566 }
12567
12569 {
12571 }
12572
12574 {
12576 }
12577
12579 {
12584 }
12585
12587 {
12589 }
12590 }
12591
12593 {
12594
12595 super.DeSerializeNumericalVars(floats);
12596
12597
12598 int index = 0;
12599 int mask = Math.Round(floats.Get(index));
12600
12601 index++;
12602
12604 {
12606 {
12608 }
12609 else
12610 {
12611 float quantity = floats.Get(index);
12612 SetQuantity(quantity,
true,
false,
false,
false);
12613 }
12614 index++;
12615 }
12616
12618 {
12619 float wet = floats.Get(index);
12621 index++;
12622 }
12623
12625 {
12626 int liquidtype = Math.Round(floats.Get(index));
12628 index++;
12629 }
12630
12632 {
12634 index++;
12636 index++;
12638 index++;
12640 index++;
12641 }
12642
12644 {
12645 int cleanness = Math.Round(floats.Get(index));
12647 index++;
12648 }
12649 }
12650
12652 {
12653 super.WriteVarsToCTX(ctx);
12654
12655
12657 {
12659 }
12660
12662 {
12664 }
12665
12667 {
12669 }
12670
12672 {
12673 int r,g,b,a;
12679 }
12680
12682 {
12684 }
12685 }
12686
12688 {
12689 if (!super.ReadVarsFromCTX(ctx,version))
12690 return false;
12691
12692 int intValue;
12693 float value;
12694
12695 if (version < 140)
12696 {
12697 if (!ctx.
Read(intValue))
12698 return false;
12699
12700 m_VariablesMask = intValue;
12701 }
12702
12704 {
12705 if (!ctx.
Read(value))
12706 return false;
12707
12709 {
12711 }
12712 else
12713 {
12715 }
12716 }
12717
12718 if (version < 140)
12719 {
12721 {
12722 if (!ctx.
Read(value))
12723 return false;
12724 SetTemperatureDirect(value);
12725 }
12726 }
12727
12729 {
12730 if (!ctx.
Read(value))
12731 return false;
12733 }
12734
12736 {
12737 if (!ctx.
Read(intValue))
12738 return false;
12740 }
12741
12743 {
12744 int r,g,b,a;
12746 return false;
12748 return false;
12750 return false;
12752 return false;
12753
12755 }
12756
12758 {
12759 if (!ctx.
Read(intValue))
12760 return false;
12762 }
12763
12764 if (version >= 138 && version < 140)
12765 {
12767 {
12768 if (!ctx.
Read(intValue))
12769 return false;
12770 SetFrozen(intValue);
12771 }
12772 }
12773
12774 return true;
12775 }
12776
12777
12779 {
12782 {
12784 }
12785
12786 if (!super.OnStoreLoad(ctx, version))
12787 {
12789 return false;
12790 }
12791
12792 if (version >= 114)
12793 {
12794 bool hasQuickBarIndexSaved;
12795
12796 if (!ctx.
Read(hasQuickBarIndexSaved))
12797 {
12799 return false;
12800 }
12801
12802 if (hasQuickBarIndexSaved)
12803 {
12804 int itmQBIndex;
12805
12806
12807 if (!ctx.
Read(itmQBIndex))
12808 {
12810 return false;
12811 }
12812
12813 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12814 if (itmQBIndex != -1 && parentPlayer)
12815 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12816 }
12817 }
12818 else
12819 {
12820
12821 PlayerBase player;
12822 int itemQBIndex;
12823 if (version ==
int.
MAX)
12824 {
12825 if (!ctx.
Read(itemQBIndex))
12826 {
12828 return false;
12829 }
12830 }
12831 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12832 {
12833
12834 if (!ctx.
Read(itemQBIndex))
12835 {
12837 return false;
12838 }
12839 if (itemQBIndex != -1 && player)
12840 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12841 }
12842 }
12843
12844 if (version < 140)
12845 {
12846
12847 if (!LoadVariables(ctx, version))
12848 {
12850 return false;
12851 }
12852 }
12853
12854
12856 {
12858 return false;
12859 }
12860 if (version >= 132)
12861 {
12863 if (raib)
12864 {
12866 {
12868 return false;
12869 }
12870 }
12871 }
12872
12874 return true;
12875 }
12876
12877
12878
12880 {
12881 super.OnStoreSave(ctx);
12882
12883 PlayerBase player;
12884 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12885 {
12887
12888 int itemQBIndex = -1;
12889 itemQBIndex = player.FindQuickBarEntityIndex(this);
12890 ctx.
Write(itemQBIndex);
12891 }
12892 else
12893 {
12895 }
12896
12898
12900 if (raib)
12901 {
12903 }
12904 }
12905
12906
12908 {
12909 super.AfterStoreLoad();
12910
12912 {
12914 }
12915
12917 {
12920 }
12921 }
12922
12924 {
12925 super.EEOnAfterLoad();
12926
12928 {
12930 }
12931
12934 }
12935
12937 {
12938 return false;
12939 }
12940
12941
12942
12944 {
12946 {
12947 #ifdef PLATFORM_CONSOLE
12948
12950 {
12952 if (menu)
12953 {
12955 }
12956 }
12957 #endif
12958 }
12959
12961 {
12964 }
12965
12967 {
12968 SetWeightDirty();
12970 }
12972 {
12975 }
12976
12978 {
12981 }
12983 {
12986 }
12987
12988 super.OnVariablesSynchronized();
12989 }
12990
12991
12992
12994 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12995 {
12996 if (!IsServerCheck(allow_client))
12997 return false;
12998
13000 return false;
13001
13004
13005 if (value <= (min + 0.001))
13006 value = min;
13007
13008 if (value == min)
13009 {
13010 if (destroy_config)
13011 {
13012 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
13013 if (dstr)
13014 {
13016 this.Delete();
13017 return true;
13018 }
13019 }
13020 else if (destroy_forced)
13021 {
13023 this.Delete();
13024 return true;
13025 }
13026
13028 }
13029
13032
13034 {
13036
13037 if (delta)
13039 }
13040
13042
13043 return false;
13044 }
13045
13046
13048 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
13049 {
13051 }
13052
13054 {
13057 }
13058
13060 {
13063 }
13064
13066 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
13067 {
13068 float value_clamped = Math.Clamp(value, 0, 1);
13070 SetQuantity(result, destroy_config, destroy_forced);
13071 }
13072
13073
13076 {
13078 }
13079
13081 {
13083 }
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13095 {
13096 int slot = -1;
13097 if (GetInventory())
13098 {
13099 InventoryLocation il = new InventoryLocation;
13100 GetInventory().GetCurrentInventoryLocation(il);
13102 }
13103
13105 }
13106
13108 {
13109 float quantity_max = 0;
13110
13112 {
13113 if (attSlotID != -1)
13114 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
13115
13116 if (quantity_max <= 0)
13118 }
13119
13120 if (quantity_max <= 0)
13122
13123 return quantity_max;
13124 }
13125
13127 {
13129 }
13130
13132 {
13134 }
13135
13136
13138 {
13140 }
13141
13143 {
13145 }
13146
13148 {
13150 }
13151
13152
13154 {
13155
13156 float weightEx = GetWeightEx();
13157 float special = GetInventoryAndCargoWeight();
13158 return weightEx - special;
13159 }
13160
13161
13163 {
13165 }
13166
13168 {
13170 {
13171 #ifdef DEVELOPER
13172 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13173 {
13174 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13176 }
13177 #endif
13178
13179 return GetQuantity() * GetConfigWeightModified();
13180 }
13181 else if (HasEnergyManager())
13182 {
13183 #ifdef DEVELOPER
13184 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13185 {
13186 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13187 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13188 }
13189 #endif
13190 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13191 }
13192 else
13193 {
13194 #ifdef DEVELOPER
13195 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13196 {
13197 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13198 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13199 }
13200 #endif
13201 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13202 }
13203 }
13204
13207 {
13208 int item_count = 0;
13210
13211 if (GetInventory().GetCargo() != NULL)
13212 {
13213 item_count = GetInventory().GetCargo().GetItemCount();
13214 }
13215
13216 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13217 {
13218 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13219 if (item)
13220 item_count += item.GetNumberOfItems();
13221 }
13222 return item_count;
13223 }
13224
13227 {
13228 float weight = 0;
13229 float wetness = 1;
13230 if (include_wetness)
13233 {
13234 weight = wetness * m_ConfigWeight;
13235 }
13237 {
13238 weight = 1;
13239 }
13240 return weight;
13241 }
13242
13243
13244
13246 {
13247 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13248 {
13249 GameInventory inv = GetInventory();
13250 array<EntityAI> items = new array<EntityAI>;
13252 for (int i = 0; i < items.Count(); i++)
13253 {
13255 if (item)
13256 {
13258 }
13259 }
13260 }
13261 }
13262
13263
13264
13265
13267 {
13268 float energy = 0;
13269 if (HasEnergyManager())
13270 {
13271 energy = GetCompEM().GetEnergy();
13272 }
13273 return energy;
13274 }
13275
13276
13278 {
13279 super.OnEnergyConsumed();
13280
13282 }
13283
13285 {
13286 super.OnEnergyAdded();
13287
13289 }
13290
13291
13293 {
13294 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13295 {
13297 {
13298 float energy_0to1 = GetCompEM().GetEnergy0To1();
13300 }
13301 }
13302 }
13303
13304
13306 {
13307 return ConfigGetFloat("heatIsolation");
13308 }
13309
13311 {
13313 }
13314
13316 {
13317 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13318 if (
GetGame().ConfigIsExisting(paramPath))
13320
13321 return 0.0;
13322 }
13323
13325 {
13326 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13327 if (
GetGame().ConfigIsExisting(paramPath))
13329
13330 return 0.0;
13331 }
13332
13333 override void SetWet(
float value,
bool allow_client =
false)
13334 {
13335 if (!IsServerCheck(allow_client))
13336 return;
13337
13340
13342
13343 m_VarWet = Math.Clamp(value, min, max);
13344
13346 {
13349 }
13350 }
13351
13352 override void AddWet(
float value)
13353 {
13355 }
13356
13358 {
13360 }
13361
13363 {
13365 }
13366
13368 {
13370 }
13371
13373 {
13375 }
13376
13378 {
13380 }
13381
13382 override void OnWetChanged(
float newVal,
float oldVal)
13383 {
13386 if (newLevel != oldLevel)
13387 {
13389 }
13390 }
13391
13393 {
13394 SetWeightDirty();
13395 }
13396
13398 {
13399 return GetWetLevelInternal(
m_VarWet);
13400 }
13401
13402
13403
13405 {
13407 }
13408
13410 {
13412 }
13413
13415 {
13417 }
13418
13420 {
13422 }
13423
13424
13425
13427 {
13428 if (ConfigIsExisting("itemModelLength"))
13429 {
13430 return ConfigGetFloat("itemModelLength");
13431 }
13432 return 0;
13433 }
13434
13436 {
13437 if (ConfigIsExisting("itemAttachOffset"))
13438 {
13439 return ConfigGetFloat("itemAttachOffset");
13440 }
13441 return 0;
13442 }
13443
13444 override void SetCleanness(
int value,
bool allow_client =
false)
13445 {
13446 if (!IsServerCheck(allow_client))
13447 return;
13448
13450
13452
13455 }
13456
13458 {
13460 }
13461
13463 {
13464 return true;
13465 }
13466
13467
13468
13469
13471 {
13473 }
13474
13476 {
13478 }
13479
13480
13481
13482
13483 override void SetColor(
int r,
int g,
int b,
int a)
13484 {
13490 }
13492 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13493 {
13498 }
13499
13501 {
13503 }
13504
13507 {
13508 int r,g,b,a;
13510 r = r/255;
13511 g = g/255;
13512 b = b/255;
13513 a = a/255;
13514 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13515 }
13516
13517
13518
13519 override void SetLiquidType(
int value,
bool allow_client =
false)
13520 {
13521 if (!IsServerCheck(allow_client))
13522 return;
13523
13528 }
13529
13531 {
13532 return ConfigGetInt("varLiquidTypeInit");
13533 }
13534
13536 {
13538 }
13539
13541 {
13543 SetFrozen(false);
13544 }
13545
13548 {
13549 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13550 }
13551
13552
13555 {
13556 PlayerBase nplayer;
13557 if (PlayerBase.CastTo(nplayer, player))
13558 {
13560
13561 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13562 }
13563 }
13564
13565
13568 {
13569 PlayerBase nplayer;
13570 if (PlayerBase.CastTo(nplayer,player))
13571 {
13572
13573 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13574
13575 }
13576
13577
13578 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13579
13580
13581 if (HasEnergyManager())
13582 {
13583 GetCompEM().UpdatePlugState();
13584 }
13585 }
13586
13587
13589 {
13590 super.OnPlacementStarted(player);
13591
13593 }
13594
13595 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13596 {
13598 {
13599 m_AdminLog.OnPlacementComplete(player,
this);
13600 }
13601
13602 super.OnPlacementComplete(player, position, orientation);
13603 }
13604
13605
13606
13607
13608
13610 {
13612 {
13613 return true;
13614 }
13615 else
13616 {
13617 return false;
13618 }
13619 }
13620
13621
13623 {
13625 {
13627 }
13628 }
13629
13630
13632 {
13634 }
13635
13637 {
13639 }
13640
13641 override void InsertAgent(
int agent,
float count = 1)
13642 {
13643 if (count < 1)
13644 return;
13645
13647 }
13648
13651 {
13653 }
13654
13655
13657 {
13659 }
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13703 {
13705 return false;
13706 return true;
13707 }
13708
13710 {
13711
13713 }
13714
13715
13718 {
13719 super.CheckForRoofLimited(timeTresholdMS);
13720
13722 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13723 {
13724 m_PreviousRoofTestTime = time;
13725 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13726 }
13727 }
13728
13729
13731 {
13733 {
13734 return 0;
13735 }
13736
13737 if (GetInventory().GetAttachmentSlotsCount() != 0)
13738 {
13739 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13740 if (filter)
13741 return filter.GetProtectionLevel(type, false, system);
13742 else
13743 return 0;
13744 }
13745
13746 string subclassPath, entryName;
13747
13748 switch (type)
13749 {
13751 entryName = "biological";
13752 break;
13754 entryName = "chemical";
13755 break;
13756 default:
13757 entryName = "biological";
13758 break;
13759 }
13760
13761 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13762
13764 }
13765
13766
13767
13770 {
13771 if (!IsMagazine())
13773
13775 }
13776
13777
13778
13779
13780
13785 {
13786 return true;
13787 }
13788
13790 {
13792 }
13793
13794
13795
13796
13797
13799 {
13800 if (parent)
13801 {
13802 if (parent.IsInherited(DayZInfected))
13803 return true;
13804
13805 if (!parent.IsRuined())
13806 return true;
13807 }
13808
13809 return true;
13810 }
13811
13813 {
13814 if (!super.CanPutAsAttachment(parent))
13815 {
13816 return false;
13817 }
13818
13819 if (!IsRuined() && !parent.IsRuined())
13820 {
13821 return true;
13822 }
13823
13824 return false;
13825 }
13826
13828 {
13829
13830
13831
13832
13833 return super.CanReceiveItemIntoCargo(item);
13834 }
13835
13837 {
13838
13839
13840
13841
13842 GameInventory attachmentInv = attachment.GetInventory();
13844 {
13845 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13846 return false;
13847 }
13848
13849 InventoryLocation loc = new InventoryLocation();
13850 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13851 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13852 return false;
13853
13854 return super.CanReceiveAttachment(attachment, slotId);
13855 }
13856
13858 {
13859 if (!super.CanReleaseAttachment(attachment))
13860 return false;
13861
13862 return GetInventory().AreChildrenAccessible();
13863 }
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13886 {
13887 int id = muzzle_owner.GetMuzzleID();
13888 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13889
13890 if (WPOF_array)
13891 {
13892 for (int i = 0; i < WPOF_array.Count(); i++)
13893 {
13894 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13895
13896 if (WPOF)
13897 {
13898 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13899 }
13900 }
13901 }
13902 }
13903
13904
13906 {
13907 int id = muzzle_owner.GetMuzzleID();
13909
13910 if (WPOBE_array)
13911 {
13912 for (int i = 0; i < WPOBE_array.Count(); i++)
13913 {
13914 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13915
13916 if (WPOBE)
13917 {
13918 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13919 }
13920 }
13921 }
13922 }
13923
13924
13926 {
13927 int id = muzzle_owner.GetMuzzleID();
13928 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13929
13930 if (WPOOH_array)
13931 {
13932 for (int i = 0; i < WPOOH_array.Count(); i++)
13933 {
13934 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13935
13936 if (WPOOH)
13937 {
13938 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13939 }
13940 }
13941 }
13942 }
13943
13944
13946 {
13947 int id = muzzle_owner.GetMuzzleID();
13948 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13949
13950 if (WPOOH_array)
13951 {
13952 for (int i = 0; i < WPOOH_array.Count(); i++)
13953 {
13954 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13955
13956 if (WPOOH)
13957 {
13958 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13959 }
13960 }
13961 }
13962 }
13963
13964
13966 {
13967 int id = muzzle_owner.GetMuzzleID();
13968 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13969
13970 if (WPOOH_array)
13971 {
13972 for (int i = 0; i < WPOOH_array.Count(); i++)
13973 {
13974 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13975
13976 if (WPOOH)
13977 {
13978 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13979 }
13980 }
13981 }
13982 }
13983
13984
13985
13987 {
13989 {
13990 return true;
13991 }
13992
13993 return false;
13994 }
13995
13997 {
13999 {
14000 return true;
14001 }
14002
14003 return false;
14004 }
14005
14007 {
14009 {
14010 return true;
14011 }
14012
14013 return false;
14014 }
14015
14017 {
14018 return false;
14019 }
14020
14023 {
14024 return UATimeSpent.DEFAULT_DEPLOY;
14025 }
14026
14027
14028
14029
14031 {
14033 SetSynchDirty();
14034 }
14035
14037 {
14039 }
14040
14041
14043 {
14044 return false;
14045 }
14046
14049 {
14050 string att_type = "None";
14051
14052 if (ConfigIsExisting("soundAttType"))
14053 {
14054 att_type = ConfigGetString("soundAttType");
14055 }
14056
14058 }
14059
14061 {
14063 }
14064
14065
14066
14067
14068
14074
14076 {
14079
14081 }
14082
14083
14085 {
14087 return;
14088
14090
14093
14096
14097 SoundParameters params = new SoundParameters();
14101 }
14102
14103
14105 {
14107 return;
14108
14110 SetSynchDirty();
14111
14114 }
14115
14116
14118 {
14120 return;
14121
14123 SetSynchDirty();
14124
14127 }
14128
14130 {
14132 }
14133
14135 {
14137 }
14138
14141 {
14142 if (!
GetGame().IsDedicatedServer())
14143 {
14144 if (ConfigIsExisting("attachSoundSet"))
14145 {
14146 string cfg_path = "";
14147 string soundset = "";
14148 string type_name =
GetType();
14149
14152 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
14153 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
14154
14155 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
14156 {
14157 for (int i = 0; i < cfg_soundset_array.Count(); i++)
14158 {
14159 if (cfg_slot_array[i] == slot_type)
14160 {
14161 soundset = cfg_soundset_array[i];
14162 break;
14163 }
14164 }
14165 }
14166
14167 if (soundset != "")
14168 {
14169 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14171 }
14172 }
14173 }
14174 }
14175
14177 {
14178
14179 }
14180
14181 void OnApply(PlayerBase player);
14182
14184 {
14185 return 1.0;
14186 };
14187
14189 {
14191 }
14192
14194 {
14196 }
14197
14199
14201 {
14202 SetDynamicPhysicsLifeTime(0.01);
14204 }
14205
14207 {
14208 array<string> zone_names = new array<string>;
14209 GetDamageZones(zone_names);
14210 for (int i = 0; i < zone_names.Count(); i++)
14211 {
14212 SetHealthMax(zone_names.Get(i),"Health");
14213 }
14214 SetHealthMax("","Health");
14215 }
14216
14219 {
14220 float global_health = GetHealth01("","Health");
14221 array<string> zones = new array<string>;
14222 GetDamageZones(zones);
14223
14224 for (int i = 0; i < zones.Count(); i++)
14225 {
14226 SetHealth01(zones.Get(i),"Health",global_health);
14227 }
14228 }
14229
14232 {
14233 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14234 }
14235
14237 {
14238 if (!hasRootAsPlayer)
14239 {
14240 if (refParentIB)
14241 {
14242
14243 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14244 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14245
14246 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14247 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14248
14251 }
14252 else
14253 {
14254
14257 }
14258 }
14259 }
14260
14262 {
14264 {
14265 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14266 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14267 {
14268 float heatPermCoef = 1.0;
14270 while (ent)
14271 {
14272 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14273 ent = ent.GetHierarchyParent();
14274 }
14275
14276 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14277 }
14278 }
14279 }
14280
14282 {
14283
14284 EntityAI parent = GetHierarchyParent();
14285 if (!parent)
14286 {
14287 hasParent = false;
14288 hasRootAsPlayer = false;
14289 }
14290 else
14291 {
14292 hasParent = true;
14293 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14294 refParentIB =
ItemBase.Cast(parent);
14295 }
14296 }
14297
14298 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14299 {
14300
14301 }
14302
14304 {
14305
14306 return false;
14307 }
14308
14310 {
14311
14312
14313 return false;
14314 }
14315
14317 {
14318
14319 return false;
14320 }
14321
14324 {
14325 return !GetIsFrozen() &&
IsOpen();
14326 }
14327
14329 {
14330 bool hasParent = false, hasRootAsPlayer = false;
14332
14333 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14334 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14335
14336 if (wwtu || foodDecay)
14337 {
14341
14342 if (processWetness || processTemperature || processDecay)
14343 {
14345
14346 if (processWetness)
14347 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14348
14349 if (processTemperature)
14351
14352 if (processDecay)
14353 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14354 }
14355 }
14356 }
14357
14360 {
14362 }
14363
14365 {
14368
14369 return super.GetTemperatureFreezeThreshold();
14370 }
14371
14373 {
14376
14377 return super.GetTemperatureThawThreshold();
14378 }
14379
14381 {
14384
14385 return super.GetItemOverheatThreshold();
14386 }
14387
14389 {
14391 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14392
14393 return super.GetTemperatureFreezeTime();
14394 }
14395
14397 {
14399 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14400
14401 return super.GetTemperatureThawTime();
14402 }
14403
14408
14410 {
14411 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14412 }
14413
14415 {
14416 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14417 }
14418
14421 {
14423 }
14424
14426 {
14428 }
14429
14431 {
14433 }
14434
14437 {
14438 return null;
14439 }
14440
14443 {
14444 return false;
14445 }
14446
14448 {
14450 {
14453 if (!trg)
14454 {
14456 explosive = this;
14457 }
14458
14459 explosive.PairRemote(trg);
14461
14462 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14463 trg.SetPersistentPairID(persistentID);
14464 explosive.SetPersistentPairID(persistentID);
14465
14466 return true;
14467 }
14468 return false;
14469 }
14470
14473 {
14474 float ret = 1.0;
14477 ret *= GetHealth01();
14478
14479 return ret;
14480 }
14481
14482 #ifdef DEVELOPER
14483 override void SetDebugItem()
14484 {
14485 super.SetDebugItem();
14486 _itemBase = this;
14487 }
14488
14490 {
14491 string text = super.GetDebugText();
14492
14494 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14495
14496 return text;
14497 }
14498 #endif
14499
14501 {
14502 return true;
14503 }
14504
14506
14508
14510 {
14513 }
14514
14515
14523
14539}
14540
14542{
14544 if (entity)
14545 {
14546 bool is_item = entity.IsInherited(
ItemBase);
14547 if (is_item && full_quantity)
14548 {
14551 }
14552 }
14553 else
14554 {
14556 return NULL;
14557 }
14558 return entity;
14559}
14560
14562{
14563 if (item)
14564 {
14565 if (health > 0)
14566 item.SetHealth("", "", health);
14567
14568 if (item.CanHaveTemperature())
14569 {
14571 if (item.CanFreeze())
14572 item.SetFrozen(false);
14573 }
14574
14575 if (item.HasEnergyManager())
14576 {
14577 if (quantity >= 0)
14578 {
14579 item.GetCompEM().SetEnergy0To1(quantity);
14580 }
14581 else
14582 {
14584 }
14585 }
14586 else if (item.IsMagazine())
14587 {
14588 Magazine mag = Magazine.Cast(item);
14589 if (quantity >= 0)
14590 {
14591 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14592 }
14593 else
14594 {
14596 }
14597
14598 }
14599 else
14600 {
14601 if (quantity >= 0)
14602 {
14603 item.SetQuantityNormalized(quantity, false);
14604 }
14605 else
14606 {
14608 }
14609
14610 }
14611 }
14612}
14613
14614#ifdef DEVELOPER
14616#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.