9667{
9669 {
9670 return true;
9671 }
9672};
9673
9674
9675
9677{
9681
9683
9686
9687
9688
9689
9690
9699
9705
9710
9715
9736 protected bool m_IsResultOfSplit
9737
9739
9744
9745
9746
9748
9752
9753
9754
9756
9759
9760
9761
9767
9768
9776
9779
9780
9782
9783
9785
9786
9791
9792
9797
9798
9800
9801
9803 {
9808
9809 if (!
GetGame().IsDedicatedServer())
9810 {
9812 {
9814
9816 {
9818 }
9819 }
9820
9823 }
9824
9825 m_OldLocation = null;
9826
9828 {
9830 }
9831
9832 if (ConfigIsExisting("headSelectionsToHide"))
9833 {
9836 }
9837
9839 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9840 {
9842 }
9843
9845
9846 m_IsResultOfSplit = false;
9847
9849 }
9850
9852 {
9853 super.InitItemVariables();
9854
9860 m_Count = ConfigGetInt(
"count");
9861
9864
9869
9872
9877
9889
9893
9894
9897 if (ConfigIsExisting("canBeSplit"))
9898 {
9901 }
9902
9904 if (ConfigIsExisting("itemBehaviour"))
9906
9907
9910 RegisterNetSyncVariableInt("m_VarLiquidType");
9911 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9912
9913 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9914 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9915 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9916
9917 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9918 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9919 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9920 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9921
9922 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9923 RegisterNetSyncVariableBool("m_IsTakeable");
9924 RegisterNetSyncVariableBool("m_IsHologram");
9925
9928 {
9931 }
9932
9934
9936 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9938
9939 }
9940
9942 {
9944 }
9945
9947 {
9950 {
9955 }
9956 }
9957
9958 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9959 {
9961 {
9964 }
9965
9967 }
9968
9970 {
9976 }
9977
9979
9981 {
9983
9984 if (!action)
9985 {
9986 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9987 return;
9988 }
9989
9991 if (!ai)
9992 {
9994 return;
9995 }
9996
9998 if (!action_array)
9999 {
10000 action_array = new array<ActionBase_Basic>;
10002 }
10003 if (LogManager.IsActionLogEnable())
10004 {
10005 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
10006 }
10007
10008 if (action_array.Find(action) != -1)
10009 {
10010 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
10011 }
10012 else
10013 {
10014 action_array.Insert(action);
10015 }
10016 }
10017
10019 {
10021 ActionBase action = player.GetActionManager().GetAction(actionName);
10024
10025 if (action_array)
10026 {
10027 action_array.RemoveItem(action);
10028 }
10029 }
10030
10031
10032
10034 {
10035 ActionOverrideData overrideData = new ActionOverrideData();
10039
10041 if (!actionMap)
10042 {
10045 }
10046
10047 actionMap.Insert(this.
Type(), overrideData);
10048
10049 }
10050
10052
10054
10055
10057 {
10060
10063
10064 string config_to_search = "CfgVehicles";
10065 string muzzle_owner_config;
10066
10068 {
10069 if (IsInherited(Weapon))
10070 config_to_search = "CfgWeapons";
10071
10072 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10073
10074 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
10075
10077
10078 if (config_OnFire_subclass_count > 0)
10079 {
10080 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
10081
10082 for (int i = 0; i < config_OnFire_subclass_count; i++)
10083 {
10084 string particle_class = "";
10086 string config_OnFire_entry = config_OnFire_class + particle_class;
10087 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
10088 WPOF_array.Insert(WPOF);
10089 }
10090
10091
10093 }
10094 }
10095
10097 {
10098 config_to_search = "CfgWeapons";
10099 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10100
10101 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
10102
10104
10105 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
10106 {
10107 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
10108
10109 for (i = 0; i < config_OnBulletCasingEject_count; i++)
10110 {
10111 string particle_class2 = "";
10113 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
10114 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
10115 WPOBE_array.Insert(WPOBE);
10116 }
10117
10118
10120 }
10121 }
10122 }
10123
10124
10126 {
10129
10131 {
10132 string config_to_search = "CfgVehicles";
10133
10134 if (IsInherited(Weapon))
10135 config_to_search = "CfgWeapons";
10136
10137 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10138 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10139
10140 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10141 {
10142
10144
10146 {
10148 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10150 return;
10151 }
10152
10155
10156
10157
10159 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10160
10161 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10162 {
10163 string particle_class = "";
10165 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10167
10168 if (entry_type == CT_CLASS)
10169 {
10170 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10171 WPOOH_array.Insert(WPOF);
10172 }
10173 }
10174
10175
10177 }
10178 }
10179 }
10180
10182 {
10184 }
10185
10187 {
10189 {
10191
10194
10197
10198 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10199 }
10200 }
10201
10203 {
10205 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10206
10208 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10209
10211 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10212
10214 {
10216 }
10217 }
10218
10220 {
10222 }
10223
10225 {
10228 else
10230
10232 {
10235 }
10236 else
10237 {
10240
10243 }
10244
10246 }
10247
10249 {
10251 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10252 }
10253
10255 {
10257 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10259 }
10260
10262 {
10264 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10265 }
10266
10268 {
10271
10272 OverheatingParticle OP = new OverheatingParticle();
10277
10279 }
10280
10282 {
10285
10286 return -1;
10287 }
10288
10290 {
10292 {
10295
10296 for (int i = count; i > 0; --i)
10297 {
10298 int id = i - 1;
10301
10304
10305 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10306 {
10307 if (p)
10308 {
10311 }
10312 }
10313 }
10314 }
10315 }
10316
10318 {
10320 {
10322 {
10323 int id = i - 1;
10325
10326 if (OP)
10327 {
10329
10330 if (p)
10331 {
10333 }
10334
10335 delete OP;
10336 }
10337 }
10338
10341 }
10342 }
10343
10346 {
10347 return 0.0;
10348 }
10349
10350
10352 {
10353 return 250;
10354 }
10355
10357 {
10358 return 0;
10359 }
10360
10363 {
10365 return true;
10366
10367 return false;
10368 }
10369
10372 {
10375
10377 {
10379 }
10380 else
10381 {
10382
10384 }
10385
10387 }
10388
10395 {
10396 return -1;
10397 }
10398
10399
10400
10401
10403 {
10405 {
10407 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10408
10409 if (r_index >= 0)
10410 {
10411 InventoryLocation r_il = new InventoryLocation;
10412 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10413
10414 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10417 {
10418 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10419 }
10421 {
10422 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10423 }
10424
10425 }
10426
10427 player.GetHumanInventory().ClearUserReservedLocation(this);
10428 }
10429
10432 }
10433
10434
10435
10436
10438 {
10439 return ItemBase.m_DebugActionsMask;
10440 }
10441
10443 {
10444 return ItemBase.m_DebugActionsMask & mask;
10445 }
10446
10448 {
10449 ItemBase.m_DebugActionsMask = mask;
10450 }
10451
10453 {
10454 ItemBase.m_DebugActionsMask |= mask;
10455 }
10456
10458 {
10459 ItemBase.m_DebugActionsMask &= ~mask;
10460 }
10461
10463 {
10465 {
10467 }
10468 else
10469 {
10471 }
10472 }
10473
10474
10476 {
10477 if (GetEconomyProfile())
10478 {
10479 float q_max = GetEconomyProfile().GetQuantityMax();
10480 if (q_max > 0)
10481 {
10482 float q_min = GetEconomyProfile().GetQuantityMin();
10483 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10484
10486 {
10487 ComponentEnergyManager comp = GetCompEM();
10489 {
10491 }
10492 }
10494 {
10496
10497 }
10498
10499 }
10500 }
10501 }
10502
10505 {
10506 EntityAI parent = GetHierarchyParent();
10507
10508 if (parent)
10509 {
10510 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10511 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10512 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10513 }
10514 }
10515
10518 {
10519 EntityAI parent = GetHierarchyParent();
10520
10521 if (parent)
10522 {
10523 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10524 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10525 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10526 }
10527 }
10528
10530 {
10531
10532
10533
10534
10536
10538 {
10539 if (ScriptInputUserData.CanStoreInputUserData())
10540 {
10541 ScriptInputUserData ctx = new ScriptInputUserData;
10547 ctx.
Write(use_stack_max);
10550
10552 {
10553 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10554 }
10555 }
10556 }
10557 else if (!
GetGame().IsMultiplayer())
10558 {
10560 }
10561 }
10562
10564 {
10566 }
10567
10569 {
10571 }
10572
10574 {
10576 }
10577
10579 {
10580
10581 return false;
10582 }
10583
10585 {
10586 return false;
10587 }
10588
10592 {
10593 return false;
10594 }
10595
10597 {
10598 return "";
10599 }
10600
10602
10604 {
10605 return false;
10606 }
10607
10609 {
10610 return true;
10611 }
10612
10613
10614
10616 {
10617 return true;
10618 }
10619
10621 {
10622 return true;
10623 }
10624
10626 {
10627 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10629 }
10630
10632 {
10634 }
10635
10637 {
10639 if (!is_being_placed)
10641 SetSynchDirty();
10642 }
10643
10644
10646
10648 {
10650 }
10651
10653 {
10655 }
10656
10658 {
10659 return 1;
10660 }
10661
10663 {
10664 return false;
10665 }
10666
10668 {
10670 SetSynchDirty();
10671 }
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10708 {
10709 super.OnMovedInsideCargo(container);
10710
10711 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10712 }
10713
10714 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10715 {
10716 super.EEItemLocationChanged(oldLoc,newLoc);
10717
10718 PlayerBase new_player = null;
10719 PlayerBase old_player = null;
10720
10721 if (newLoc.GetParent())
10722 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10723
10724 if (oldLoc.GetParent())
10725 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10726
10728 {
10729 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10730
10731 if (r_index >= 0)
10732 {
10733 InventoryLocation r_il = new InventoryLocation;
10734 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10735
10736 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10739 {
10740 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10741 }
10743 {
10744 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10745 }
10746
10747 }
10748 }
10749
10751 {
10752 if (new_player)
10753 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10754
10755 if (new_player == old_player)
10756 {
10757
10758 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10759 {
10761 {
10762 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10763 {
10764 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10765 }
10766 }
10767 else
10768 {
10769 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10770 }
10771 }
10772
10773 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10774 {
10775 int type = oldLoc.GetType();
10777 {
10778 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10779 }
10781 {
10782 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10783 }
10784 }
10785 if (!m_OldLocation)
10786 {
10787 m_OldLocation = new InventoryLocation;
10788 }
10789 m_OldLocation.Copy(oldLoc);
10790 }
10791 else
10792 {
10793 if (m_OldLocation)
10794 {
10795 m_OldLocation.Reset();
10796 }
10797 }
10798
10800 }
10801 else
10802 {
10803 if (new_player)
10804 {
10805 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10806 if (res_index >= 0)
10807 {
10808 InventoryLocation il = new InventoryLocation;
10809 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10811 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10814 {
10815 il.
GetParent().GetOnReleaseLock().Invoke(it);
10816 }
10818 {
10820 }
10821
10822 }
10823 }
10825 {
10826
10828 }
10829
10830 if (m_OldLocation)
10831 {
10832 m_OldLocation.Reset();
10833 }
10834 }
10835 }
10836
10837 override void EOnContact(IEntity other, Contact extra)
10838 {
10840 {
10841 int liquidType = -1;
10843 if (impactSpeed > 0.0)
10844 {
10846 #ifndef SERVER
10848 #else
10850 SetSynchDirty();
10851 #endif
10853 }
10854 }
10855
10856 #ifdef SERVER
10857 if (GetCompEM() && GetCompEM().IsPlugged())
10858 {
10859 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10860 GetCompEM().UnplugThis();
10861 }
10862 #endif
10863 }
10864
10866
10868 {
10870 }
10871
10873 {
10874
10875 }
10876
10878 {
10879 super.OnItemLocationChanged(old_owner, new_owner);
10880
10881 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10882 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10883
10884 if (!relatedPlayer && playerNew)
10885 relatedPlayer = playerNew;
10886
10887 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10888 {
10890 if (actionMgr)
10891 {
10892 ActionBase currentAction = actionMgr.GetRunningAction();
10893 if (currentAction)
10895 }
10896 }
10897
10898 Man ownerPlayerOld = null;
10899 Man ownerPlayerNew = null;
10900
10901 if (old_owner)
10902 {
10903 if (old_owner.
IsMan())
10904 {
10905 ownerPlayerOld = Man.Cast(old_owner);
10906 }
10907 else
10908 {
10909 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10910 }
10911 }
10912 else
10913 {
10915 {
10917
10918 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10919 {
10920 GetCompEM().UnplugThis();
10921 }
10922 }
10923 }
10924
10925 if (new_owner)
10926 {
10927 if (new_owner.
IsMan())
10928 {
10929 ownerPlayerNew = Man.Cast(new_owner);
10930 }
10931 else
10932 {
10933 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10934 }
10935 }
10936
10937 if (ownerPlayerOld != ownerPlayerNew)
10938 {
10939 if (ownerPlayerOld)
10940 {
10941 array<EntityAI> subItemsExit = new array<EntityAI>;
10943 for (int i = 0; i < subItemsExit.Count(); i++)
10944 {
10947 }
10948 }
10949
10950 if (ownerPlayerNew)
10951 {
10952 array<EntityAI> subItemsEnter = new array<EntityAI>;
10954 for (int j = 0; j < subItemsEnter.Count(); j++)
10955 {
10958 }
10959 }
10960 }
10961 else if (ownerPlayerNew != null)
10962 {
10963 PlayerBase nplayer;
10964 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10965 {
10966 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10968 for (int k = 0; k < subItemsUpdate.Count(); k++)
10969 {
10971 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10972 }
10973 }
10974 }
10975
10976 if (old_owner)
10977 old_owner.OnChildItemRemoved(this);
10978 if (new_owner)
10979 new_owner.OnChildItemReceived(this);
10980 }
10981
10982
10984 {
10985 super.EEDelete(parent);
10986 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10987 if (player)
10988 {
10990
10991 if (player.IsAlive())
10992 {
10993 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10994 if (r_index >= 0)
10995 {
10996 InventoryLocation r_il = new InventoryLocation;
10997 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10998
10999 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
11002 {
11003 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
11004 }
11006 {
11007 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
11008 }
11009
11010 }
11011
11012 player.RemoveQuickBarEntityShortcut(this);
11013 }
11014 }
11015 }
11016
11018 {
11019 super.EEKilled(killer);
11020
11023 {
11024 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
11025 {
11026 if (IsMagazine())
11027 {
11028 if (Magazine.Cast(this).GetAmmoCount() > 0)
11029 {
11031 }
11032 }
11033 else
11034 {
11036 }
11037 }
11038 }
11039 }
11040
11042 {
11043 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
11044
11045 super.OnWasAttached(parent, slot_id);
11046
11049
11051 }
11052
11054 {
11055 super.OnWasDetached(parent, slot_id);
11056
11059 }
11060
11062 {
11063 int idx;
11066
11067 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11068 if (inventory_slots.Count() < 1)
11069 {
11070 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
11071 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
11072 }
11073 else
11074 {
11075 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
11076 }
11077
11078 idx = inventory_slots.Find(slot);
11079 if (idx < 0)
11080 return "";
11081
11082 return attach_types.Get(idx);
11083 }
11084
11086 {
11087 int idx = -1;
11088 string slot;
11089
11092
11093 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11094 if (inventory_slots.Count() < 1)
11095 {
11096 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
11097 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11098 }
11099 else
11100 {
11101 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
11102 if (detach_types.Count() < 1)
11103 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11104 }
11105
11106 for (int i = 0; i < inventory_slots.Count(); i++)
11107 {
11108 slot = inventory_slots.Get(i);
11109 }
11110
11111 if (slot != "")
11112 {
11113 if (detach_types.Count() == 1)
11114 idx = 0;
11115 else
11116 idx = inventory_slots.Find(slot);
11117 }
11118 if (idx < 0)
11119 return "";
11120
11121 return detach_types.Get(idx);
11122 }
11123
11125 {
11126
11128
11129
11130 float min_time = 1;
11131 float max_time = 3;
11132 float delay = Math.RandomFloat(min_time, max_time);
11133
11134 explode_timer.Run(delay, this, "DoAmmoExplosion");
11135 }
11136
11138 {
11139 Magazine magazine = Magazine.Cast(this);
11140 int pop_sounds_count = 6;
11141 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11142
11143
11144 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11145 string sound_name = pop_sounds[ sound_idx ];
11147
11148
11149 magazine.ServerAddAmmoCount(-1);
11150
11151
11152 float min_temp_to_explode = 100;
11153
11154 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11155 {
11157 }
11158 }
11159
11160
11161 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11162 {
11163 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11164
11165 const int CHANCE_DAMAGE_CARGO = 4;
11166 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11167 const int CHANCE_DAMAGE_NOTHING = 2;
11168
11170 {
11171 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11172 int chances;
11173 int rnd;
11174
11175 if (GetInventory().GetCargo())
11176 {
11177 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11178 rnd = Math.RandomInt(0,chances);
11179
11180 if (rnd < CHANCE_DAMAGE_CARGO)
11181 {
11183 }
11184 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11185 {
11187 }
11188 }
11189 else
11190 {
11191 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11192 rnd = Math.RandomInt(0,chances);
11193
11194 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11195 {
11197 }
11198 }
11199 }
11200 }
11201
11203 {
11204 if (GetInventory().GetCargo())
11205 {
11206 int item_count = GetInventory().GetCargo().GetItemCount();
11207 if (item_count > 0)
11208 {
11209 int random_pick = Math.RandomInt(0, item_count);
11211 if (!item.IsExplosive())
11212 {
11213 item.AddHealth("","",damage);
11214 return true;
11215 }
11216 }
11217 }
11218 return false;
11219 }
11220
11222 {
11223 int attachment_count = GetInventory().AttachmentCount();
11224 if (attachment_count > 0)
11225 {
11226 int random_pick = Math.RandomInt(0, attachment_count);
11227 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11228 if (!attachment.IsExplosive())
11229 {
11230 attachment.AddHealth("","",damage);
11231 return true;
11232 }
11233 }
11234 return false;
11235 }
11236
11238 {
11240 }
11241
11243 {
11245 return GetInventory().CanRemoveEntity();
11246
11247 return false;
11248 }
11249
11251 {
11252
11254 return false;
11255
11256
11258 return false;
11259
11260
11261
11263 if (delta == 0)
11264 return false;
11265
11266
11267 return true;
11268 }
11269
11271 {
11273 {
11274 if (ScriptInputUserData.CanStoreInputUserData())
11275 {
11276 ScriptInputUserData ctx = new ScriptInputUserData;
11281 ctx.
Write(destination_entity);
11283 ctx.
Write(slot_id);
11285 }
11286 }
11287 else if (!
GetGame().IsMultiplayer())
11288 {
11290 }
11291 }
11292
11294 {
11295 float split_quantity_new;
11299 InventoryLocation loc = new InventoryLocation;
11300
11301 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11302 {
11304 split_quantity_new = stack_max;
11305 else
11307
11309 {
11310 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11311 if (new_item)
11312 {
11313 new_item.SetResultOfSplit(true);
11314 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11316 new_item.
SetQuantity(split_quantity_new,
false,
true);
11317 }
11318 }
11319 }
11320 else if (destination_entity && slot_id == -1)
11321 {
11322 if (quantity > stack_max)
11323 split_quantity_new = stack_max;
11324 else
11325 split_quantity_new = quantity;
11326
11328 {
11330 {
11333 }
11334
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
11345 {
11346 if (stack_max != 0)
11347 {
11349 {
11351 }
11352
11353 if (split_quantity_new == 0)
11354 {
11355 if (!
GetGame().IsMultiplayer())
11356 player.PhysicalPredictiveDropItem(this);
11357 else
11358 player.ServerDropEntity(this);
11359 return;
11360 }
11361
11363 {
11365
11366 if (new_item)
11367 {
11368 new_item.SetResultOfSplit(true);
11369 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11372 new_item.PlaceOnSurface();
11373 }
11374 }
11375 }
11376 }
11377 }
11378
11380 {
11381 float split_quantity_new;
11385 InventoryLocation loc = new InventoryLocation;
11386
11387 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11388 {
11390 split_quantity_new = stack_max;
11391 else
11393
11395 {
11396 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11397 if (new_item)
11398 {
11399 new_item.SetResultOfSplit(true);
11400 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11402 new_item.
SetQuantity(split_quantity_new,
false,
true);
11403 }
11404 }
11405 }
11406 else if (destination_entity && slot_id == -1)
11407 {
11408 if (quantity > stack_max)
11409 split_quantity_new = stack_max;
11410 else
11411 split_quantity_new = quantity;
11412
11414 {
11416 {
11419 }
11420
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
11431 {
11432 if (stack_max != 0)
11433 {
11435 {
11437 }
11438
11440 {
11442
11443 if (new_item)
11444 {
11445 new_item.SetResultOfSplit(true);
11446 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11449 new_item.PlaceOnSurface();
11450 }
11451 }
11452 }
11453 }
11454 }
11455
11457 {
11459 {
11460 if (ScriptInputUserData.CanStoreInputUserData())
11461 {
11462 ScriptInputUserData ctx = new ScriptInputUserData;
11467 dst.WriteToContext(ctx);
11469 }
11470 }
11471 else if (!
GetGame().IsMultiplayer())
11472 {
11474 }
11475 }
11476
11478 {
11480 {
11481 if (ScriptInputUserData.CanStoreInputUserData())
11482 {
11483 ScriptInputUserData ctx = new ScriptInputUserData;
11488 ctx.
Write(destination_entity);
11494 }
11495 }
11496 else if (!
GetGame().IsMultiplayer())
11497 {
11499 }
11500 }
11501
11503 {
11505 }
11506
11508 {
11510 float split_quantity_new;
11512 if (dst.IsValid())
11513 {
11514 int slot_id = dst.GetSlot();
11516
11517 if (quantity > stack_max)
11518 split_quantity_new = stack_max;
11519 else
11520 split_quantity_new = quantity;
11521
11523 {
11525
11526 if (new_item)
11527 {
11528 new_item.SetResultOfSplit(true);
11529 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11531 new_item.
SetQuantity(split_quantity_new,
false,
true);
11532 }
11533
11534 return new_item;
11535 }
11536 }
11537
11538 return null;
11539 }
11540
11542 {
11544 float split_quantity_new;
11546 if (destination_entity)
11547 {
11549 if (quantity > stackable)
11550 split_quantity_new = stackable;
11551 else
11552 split_quantity_new = quantity;
11553
11555 {
11556 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11557 if (new_item)
11558 {
11559 new_item.SetResultOfSplit(true);
11560 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11562 new_item.
SetQuantity(split_quantity_new,
false,
true);
11563 }
11564 }
11565 }
11566 }
11567
11569 {
11571 {
11572 if (ScriptInputUserData.CanStoreInputUserData())
11573 {
11574 ScriptInputUserData ctx = new ScriptInputUserData;
11579 ItemBase destination_entity =
this;
11580 ctx.
Write(destination_entity);
11584 }
11585 }
11586 else if (!
GetGame().IsMultiplayer())
11587 {
11589 }
11590 }
11591
11593 {
11595 float split_quantity_new;
11597 if (player)
11598 {
11600 if (quantity > stackable)
11601 split_quantity_new = stackable;
11602 else
11603 split_quantity_new = quantity;
11604
11606 {
11607 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11608 new_item =
ItemBase.Cast(in_hands);
11609 if (new_item)
11610 {
11611 new_item.SetResultOfSplit(true);
11612 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11614 new_item.SetQuantity(split_quantity_new, false, true);
11615 }
11616 }
11617 }
11618 }
11619
11621 {
11623 float split_quantity_new = Math.Floor(quantity * 0.5);
11624
11626 return;
11627
11629
11630 if (new_item)
11631 {
11632 if (new_item.GetQuantityMax() < split_quantity_new)
11633 {
11634 split_quantity_new = new_item.GetQuantityMax();
11635 }
11636
11637 new_item.SetResultOfSplit(true);
11638 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11639
11641 {
11644 }
11645 else
11646 {
11648 new_item.
SetQuantity(split_quantity_new,
false,
true);
11649 }
11650 }
11651 }
11652
11654 {
11656 float split_quantity_new = Math.Floor(quantity / 2);
11657
11659 return;
11660
11661 InventoryLocation invloc = new InventoryLocation;
11663
11665 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11666
11667 if (new_item)
11668 {
11669 if (new_item.GetQuantityMax() < split_quantity_new)
11670 {
11671 split_quantity_new = new_item.GetQuantityMax();
11672 }
11674 {
11677 }
11678 else if (split_quantity_new > 1)
11679 {
11681 new_item.
SetQuantity(split_quantity_new,
false,
true);
11682 }
11683 }
11684 }
11685
11688 {
11689 SetWeightDirty();
11691
11692 if (parent)
11693 parent.OnAttachmentQuantityChangedEx(this, delta);
11694
11696 {
11698 {
11700 }
11702 {
11703 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11705 }
11706 }
11707
11708 }
11709
11712 {
11713
11714 }
11715
11718 {
11720 }
11721
11723 {
11724 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11725
11727 {
11728 if (newLevel == GameConstants.STATE_RUINED)
11729 {
11731 EntityAI parent = GetHierarchyParent();
11732 if (parent && parent.IsFireplace())
11733 {
11734 CargoBase cargo = GetInventory().GetCargo();
11735 if (cargo)
11736 {
11738 {
11740 }
11741 }
11742 }
11743 }
11744
11746 {
11747
11749 return;
11750 }
11751
11752 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11753 {
11755 }
11756 }
11757 }
11758
11759
11761 {
11762 super.OnRightClick();
11763
11765 {
11767 {
11768 if (ScriptInputUserData.CanStoreInputUserData())
11769 {
11770 EntityAI root = GetHierarchyRoot();
11771 Man playerOwner = GetHierarchyRootPlayer();
11772 InventoryLocation dst = new InventoryLocation;
11773
11774
11775 if (!playerOwner && root && root == this)
11776 {
11778 }
11779 else
11780 {
11781
11782 GetInventory().GetCurrentInventoryLocation(dst);
11784 {
11787 {
11789 }
11790 else
11791 {
11793
11794
11795 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11796 {
11798 }
11799 else
11800 {
11801 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11802 }
11803 }
11804 }
11805 }
11806
11807 ScriptInputUserData ctx = new ScriptInputUserData;
11815 }
11816 }
11817 else if (!
GetGame().IsMultiplayer())
11818 {
11820 }
11821 }
11822 }
11823
11825 {
11826 if (root)
11827 {
11828 vector m4[4];
11829 root.GetTransform(m4);
11830 dst.SetGround(this, m4);
11831 }
11832 else
11833 {
11834 GetInventory().GetCurrentInventoryLocation(dst);
11835 }
11836 }
11837
11838 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11839 {
11840
11841 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11842 return false;
11843
11844 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11845 return false;
11846
11847
11849 return false;
11850
11851
11852 Magazine mag = Magazine.Cast(this);
11853 if (mag)
11854 {
11855 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11856 return false;
11857
11858 if (stack_max_limit)
11859 {
11860 Magazine other_mag = Magazine.Cast(other_item);
11861 if (other_item)
11862 {
11863 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11864 return false;
11865 }
11866
11867 }
11868 }
11869 else
11870 {
11871
11873 return false;
11874
11876 return false;
11877 }
11878
11879 PlayerBase player = null;
11880 if (CastTo(player, GetHierarchyRootPlayer()))
11881 {
11882 if (player.GetInventory().HasAttachment(this))
11883 return false;
11884
11885 if (player.IsItemsToDelete())
11886 return false;
11887 }
11888
11889 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11890 return false;
11891
11892 int slotID;
11894 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11895 return false;
11896
11897 return true;
11898 }
11899
11901 {
11903 }
11904
11906 {
11907 return m_IsResultOfSplit;
11908 }
11909
11911 {
11912 m_IsResultOfSplit = value;
11913 }
11914
11916 {
11918 }
11919
11921 {
11922 float other_item_quantity = other_item.GetQuantity();
11923 float this_free_space;
11924
11926
11928
11929 if (other_item_quantity > this_free_space)
11930 {
11931 return this_free_space;
11932 }
11933 else
11934 {
11935 return other_item_quantity;
11936 }
11937 }
11938
11940 {
11942 }
11943
11945 {
11947 return;
11948
11949 if (!IsMagazine() && other_item)
11950 {
11952 if (quantity_used != 0)
11953 {
11954 float hp1 = GetHealth01("","");
11955 float hp2 = other_item.GetHealth01("","");
11956 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11957 hpResult = hpResult / (
GetQuantity() + quantity_used);
11958
11959 hpResult *= GetMaxHealth();
11960 Math.Round(hpResult);
11961 SetHealth("", "Health", hpResult);
11962
11964 other_item.AddQuantity(-quantity_used);
11965 }
11966 }
11968 }
11969
11971 {
11972 #ifdef SERVER
11973 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11974 GetHierarchyParent().IncreaseLifetimeUp();
11975 #endif
11976 };
11977
11979 {
11980 PlayerBase p = PlayerBase.Cast(player);
11981
11982 array<int> recipesIds = p.m_Recipes;
11983 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11984 if (moduleRecipesManager)
11985 {
11986 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11987 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11988 }
11989
11990 for (int i = 0;i < recipesIds.Count(); i++)
11991 {
11992 int key = recipesIds.Get(i);
11993 string recipeName = moduleRecipesManager.GetRecipeName(key);
11995 }
11996 }
11997
11998
11999 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
12000 {
12001 super.GetDebugActions(outputList);
12002
12003
12009
12010
12015
12020
12021
12025
12026
12028 {
12032 }
12033
12036
12037
12041
12043
12044 InventoryLocation loc = new InventoryLocation();
12045 GetInventory().GetCurrentInventoryLocation(loc);
12047 {
12048 if (Gizmo_IsSupported())
12051 }
12052
12054 }
12055
12056
12057
12058
12060 {
12061 super.OnAction(action_id, player, ctx);
12062
12064 {
12065 switch (action_id)
12066 {
12069 return true;
12072 return true;
12073 }
12074 }
12075
12077 {
12078 switch (action_id)
12079 {
12081 Delete();
12082 return true;
12083 }
12084 }
12085
12086 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
12087 {
12088 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12089 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
12090 PlayerBase p = PlayerBase.Cast(player);
12091 if (
EActions.RECIPES_RANGE_START < 1000)
12092 {
12093 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
12094 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
12095 }
12096 }
12097 #ifndef SERVER
12098 else if (action_id ==
EActions.WATCH_PLAYER)
12099 {
12100 PluginDeveloper.SetDeveloperItemClientEx(player);
12101 }
12102 #endif
12104 {
12105 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
12106 {
12107 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
12108 OnDebugButtonPressServer(id + 1);
12109 }
12110
12111 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
12112 {
12113 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
12115 }
12116
12117 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
12118 {
12119 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
12121 }
12122
12123 else if (action_id ==
EActions.ADD_QUANTITY)
12124 {
12125 if (IsMagazine())
12126 {
12127 Magazine mag = Magazine.Cast(this);
12128 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
12129 }
12130 else
12131 {
12133 }
12134
12135 if (m_EM)
12136 {
12137 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12138 }
12139
12140 }
12141
12142 else if (action_id ==
EActions.REMOVE_QUANTITY)
12143 {
12144 if (IsMagazine())
12145 {
12146 Magazine mag2 = Magazine.Cast(this);
12147 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12148 }
12149 else
12150 {
12152 }
12153 if (m_EM)
12154 {
12155 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12156 }
12157
12158 }
12159
12160 else if (action_id ==
EActions.SET_QUANTITY_0)
12161 {
12163
12164 if (m_EM)
12165 {
12166 m_EM.SetEnergy(0);
12167 }
12168 }
12169
12170 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12171 {
12173
12174 if (m_EM)
12175 {
12176 m_EM.SetEnergy(m_EM.GetEnergyMax());
12177 }
12178 }
12179
12180 else if (action_id ==
EActions.ADD_HEALTH)
12181 {
12182 AddHealth("","",GetMaxHealth("","Health")/5);
12183 }
12184 else if (action_id ==
EActions.REMOVE_HEALTH)
12185 {
12186 AddHealth("","",-GetMaxHealth("","Health")/5);
12187 }
12188 else if (action_id ==
EActions.DESTROY_HEALTH)
12189 {
12190 SetHealth01("","",0);
12191 }
12192 else if (action_id ==
EActions.WATCH_ITEM)
12193 {
12195 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12196 #ifdef DEVELOPER
12197 SetDebugDeveloper_item(this);
12198 #endif
12199 }
12200
12201 else if (action_id ==
EActions.ADD_TEMPERATURE)
12202 {
12203 AddTemperature(20);
12204
12205 }
12206
12207 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12208 {
12209 AddTemperature(-20);
12210
12211 }
12212
12213 else if (action_id ==
EActions.FLIP_FROZEN)
12214 {
12215 SetFrozen(!GetIsFrozen());
12216
12217 }
12218
12219 else if (action_id ==
EActions.ADD_WETNESS)
12220 {
12222
12223 }
12224
12225 else if (action_id ==
EActions.REMOVE_WETNESS)
12226 {
12228
12229 }
12230
12231 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12232 {
12235
12236
12237 }
12238
12239 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12240 {
12243 }
12244
12245 else if (action_id ==
EActions.MAKE_SPECIAL)
12246 {
12247 auto debugParams = DebugSpawnParams.WithPlayer(player);
12248 OnDebugSpawnEx(debugParams);
12249 }
12250
12251 }
12252
12253
12254 return false;
12255 }
12256
12257
12258
12259
12263
12266
12267
12268
12270 {
12271 return false;
12272 }
12273
12274
12276 {
12277 return true;
12278 }
12279
12280
12282 {
12283 return true;
12284 }
12285
12286
12287
12289 {
12290 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12292 }
12293
12296 {
12297 return null;
12298 }
12299
12301 {
12302 return false;
12303 }
12304
12306 {
12307 return false;
12308 }
12309
12313
12314
12316 {
12317 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12318 return module_repairing.CanRepair(this, item_repair_kit);
12319 }
12320
12321
12322 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12323 {
12324 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12325 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12326 }
12327
12328
12330 {
12331
12332
12333
12334
12335
12336
12337
12338
12339 return 1;
12340 }
12341
12342
12343
12345 {
12347 }
12348
12349
12350
12352 {
12354 }
12355
12356
12365 {
12366 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12367
12368 if (player)
12369 {
12370 player.MessageStatus(text);
12371 }
12372 }
12373
12374
12383 {
12384 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12385
12386 if (player)
12387 {
12388 player.MessageAction(text);
12389 }
12390 }
12391
12392
12401 {
12402 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12403
12404 if (player)
12405 {
12406 player.MessageFriendly(text);
12407 }
12408 }
12409
12410
12419 {
12420 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12421
12422 if (player)
12423 {
12424 player.MessageImportant(text);
12425 }
12426 }
12427
12429 {
12430 return true;
12431 }
12432
12433
12434 override bool KindOf(
string tag)
12435 {
12436 bool found = false;
12437 string item_name = this.
GetType();
12440
12441 int array_size = item_tag_array.Count();
12442 for (int i = 0; i < array_size; i++)
12443 {
12444 if (item_tag_array.Get(i) == tag)
12445 {
12446 found = true;
12447 break;
12448 }
12449 }
12450 return found;
12451 }
12452
12453
12455 {
12456
12457 super.OnRPC(sender, rpc_type,ctx);
12458
12459
12460 switch (rpc_type)
12461 {
12462 #ifndef SERVER
12463 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12464 Param2<bool, string> p = new Param2<bool, string>(false, "");
12465
12467 return;
12468
12469 bool play = p.param1;
12470 string soundSet = p.param2;
12471
12472 if (play)
12473 {
12475 {
12477 {
12479 }
12480 }
12481 else
12482 {
12484 }
12485 }
12486 else
12487 {
12489 }
12490
12491 break;
12492 #endif
12493
12494 }
12495
12497 {
12499 }
12500 }
12501
12502
12503
12504
12506 {
12507 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12508 return plugin.GetID(
name);
12509 }
12510
12512 {
12513 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12514 return plugin.GetName(id);
12515 }
12516
12519 {
12520
12521
12522 int varFlags;
12523 if (!ctx.
Read(varFlags))
12524 return;
12525
12526 if (varFlags & ItemVariableFlags.FLOAT)
12527 {
12529 }
12530 }
12531
12533 {
12534
12535 super.SerializeNumericalVars(floats_out);
12536
12537
12538
12540 {
12542 }
12543
12545 {
12547 }
12548
12550 {
12552 }
12553
12555 {
12560 }
12561
12563 {
12565 }
12566 }
12567
12569 {
12570
12571 super.DeSerializeNumericalVars(floats);
12572
12573
12574 int index = 0;
12575 int mask = Math.Round(floats.Get(index));
12576
12577 index++;
12578
12580 {
12582 {
12584 }
12585 else
12586 {
12587 float quantity = floats.Get(index);
12588 SetQuantity(quantity,
true,
false,
false,
false);
12589 }
12590 index++;
12591 }
12592
12594 {
12595 float wet = floats.Get(index);
12597 index++;
12598 }
12599
12601 {
12602 int liquidtype = Math.Round(floats.Get(index));
12604 index++;
12605 }
12606
12608 {
12610 index++;
12612 index++;
12614 index++;
12616 index++;
12617 }
12618
12620 {
12621 int cleanness = Math.Round(floats.Get(index));
12623 index++;
12624 }
12625 }
12626
12628 {
12629 super.WriteVarsToCTX(ctx);
12630
12631
12633 {
12635 }
12636
12638 {
12640 }
12641
12643 {
12645 }
12646
12648 {
12649 int r,g,b,a;
12655 }
12656
12658 {
12660 }
12661 }
12662
12664 {
12665 if (!super.ReadVarsFromCTX(ctx,version))
12666 return false;
12667
12668 int intValue;
12669 float value;
12670
12671 if (version < 140)
12672 {
12673 if (!ctx.
Read(intValue))
12674 return false;
12675
12676 m_VariablesMask = intValue;
12677 }
12678
12680 {
12681 if (!ctx.
Read(value))
12682 return false;
12683
12685 {
12687 }
12688 else
12689 {
12691 }
12692 }
12693
12694 if (version < 140)
12695 {
12697 {
12698 if (!ctx.
Read(value))
12699 return false;
12700 SetTemperatureDirect(value);
12701 }
12702 }
12703
12705 {
12706 if (!ctx.
Read(value))
12707 return false;
12709 }
12710
12712 {
12713 if (!ctx.
Read(intValue))
12714 return false;
12716 }
12717
12719 {
12720 int r,g,b,a;
12722 return false;
12724 return false;
12726 return false;
12728 return false;
12729
12731 }
12732
12734 {
12735 if (!ctx.
Read(intValue))
12736 return false;
12738 }
12739
12740 if (version >= 138 && version < 140)
12741 {
12743 {
12744 if (!ctx.
Read(intValue))
12745 return false;
12746 SetFrozen(intValue);
12747 }
12748 }
12749
12750 return true;
12751 }
12752
12753
12755 {
12758 {
12760 }
12761
12762 if (!super.OnStoreLoad(ctx, version))
12763 {
12765 return false;
12766 }
12767
12768 if (version >= 114)
12769 {
12770 bool hasQuickBarIndexSaved;
12771
12772 if (!ctx.
Read(hasQuickBarIndexSaved))
12773 {
12775 return false;
12776 }
12777
12778 if (hasQuickBarIndexSaved)
12779 {
12780 int itmQBIndex;
12781
12782
12783 if (!ctx.
Read(itmQBIndex))
12784 {
12786 return false;
12787 }
12788
12789 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12790 if (itmQBIndex != -1 && parentPlayer)
12791 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12792 }
12793 }
12794 else
12795 {
12796
12797 PlayerBase player;
12798 int itemQBIndex;
12799 if (version ==
int.
MAX)
12800 {
12801 if (!ctx.
Read(itemQBIndex))
12802 {
12804 return false;
12805 }
12806 }
12807 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12808 {
12809
12810 if (!ctx.
Read(itemQBIndex))
12811 {
12813 return false;
12814 }
12815 if (itemQBIndex != -1 && player)
12816 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12817 }
12818 }
12819
12820 if (version < 140)
12821 {
12822
12823 if (!LoadVariables(ctx, version))
12824 {
12826 return false;
12827 }
12828 }
12829
12830
12832 {
12834 return false;
12835 }
12836 if (version >= 132)
12837 {
12839 if (raib)
12840 {
12842 {
12844 return false;
12845 }
12846 }
12847 }
12848
12850 return true;
12851 }
12852
12853
12854
12856 {
12857 super.OnStoreSave(ctx);
12858
12859 PlayerBase player;
12860 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12861 {
12863
12864 int itemQBIndex = -1;
12865 itemQBIndex = player.FindQuickBarEntityIndex(this);
12866 ctx.
Write(itemQBIndex);
12867 }
12868 else
12869 {
12871 }
12872
12874
12876 if (raib)
12877 {
12879 }
12880 }
12881
12882
12884 {
12885 super.AfterStoreLoad();
12886
12888 {
12890 }
12891
12893 {
12896 }
12897 }
12898
12900 {
12901 super.EEOnAfterLoad();
12902
12904 {
12906 }
12907
12910 }
12911
12913 {
12914 return false;
12915 }
12916
12917
12918
12920 {
12922 {
12923 #ifdef PLATFORM_CONSOLE
12924
12926 {
12928 if (menu)
12929 {
12931 }
12932 }
12933 #endif
12934 }
12935
12937 {
12940 }
12941
12943 {
12944 SetWeightDirty();
12946 }
12948 {
12951 }
12952
12954 {
12957 }
12959 {
12962 }
12963
12964 super.OnVariablesSynchronized();
12965 }
12966
12967
12968
12970 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12971 {
12972 if (!IsServerCheck(allow_client))
12973 return false;
12974
12976 return false;
12977
12980
12981 if (value <= (min + 0.001))
12982 value = min;
12983
12984 if (value == min)
12985 {
12986 if (destroy_config)
12987 {
12988 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12989 if (dstr)
12990 {
12992 this.Delete();
12993 return true;
12994 }
12995 }
12996 else if (destroy_forced)
12997 {
12999 this.Delete();
13000 return true;
13001 }
13002
13004 }
13005
13008
13010 {
13012
13013 if (delta)
13015 }
13016
13018
13019 return false;
13020 }
13021
13022
13024 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
13025 {
13027 }
13028
13030 {
13033 }
13034
13036 {
13039 }
13040
13042 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
13043 {
13044 float value_clamped = Math.Clamp(value, 0, 1);
13046 SetQuantity(result, destroy_config, destroy_forced);
13047 }
13048
13049
13052 {
13054 }
13055
13057 {
13059 }
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13071 {
13072 int slot = -1;
13073 if (GetInventory())
13074 {
13075 InventoryLocation il = new InventoryLocation;
13076 GetInventory().GetCurrentInventoryLocation(il);
13078 }
13079
13081 }
13082
13084 {
13085 float quantity_max = 0;
13086
13088 {
13089 if (attSlotID != -1)
13090 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
13091
13092 if (quantity_max <= 0)
13094 }
13095
13096 if (quantity_max <= 0)
13098
13099 return quantity_max;
13100 }
13101
13103 {
13105 }
13106
13108 {
13110 }
13111
13112
13114 {
13116 }
13117
13119 {
13121 }
13122
13124 {
13126 }
13127
13128
13130 {
13131
13132 float weightEx = GetWeightEx();
13133 float special = GetInventoryAndCargoWeight();
13134 return weightEx - special;
13135 }
13136
13137
13139 {
13141 }
13142
13144 {
13146 {
13147 #ifdef DEVELOPER
13148 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13149 {
13150 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13152 }
13153 #endif
13154
13155 return GetQuantity() * GetConfigWeightModified();
13156 }
13157 else if (HasEnergyManager())
13158 {
13159 #ifdef DEVELOPER
13160 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13161 {
13162 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13163 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13164 }
13165 #endif
13166 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13167 }
13168 else
13169 {
13170 #ifdef DEVELOPER
13171 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13172 {
13173 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13174 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13175 }
13176 #endif
13177 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13178 }
13179 }
13180
13183 {
13184 int item_count = 0;
13186
13187 if (GetInventory().GetCargo() != NULL)
13188 {
13189 item_count = GetInventory().GetCargo().GetItemCount();
13190 }
13191
13192 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13193 {
13194 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13195 if (item)
13196 item_count += item.GetNumberOfItems();
13197 }
13198 return item_count;
13199 }
13200
13203 {
13204 float weight = 0;
13205 float wetness = 1;
13206 if (include_wetness)
13209 {
13210 weight = wetness * m_ConfigWeight;
13211 }
13213 {
13214 weight = 1;
13215 }
13216 return weight;
13217 }
13218
13219
13220
13222 {
13223 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13224 {
13225 GameInventory inv = GetInventory();
13226 array<EntityAI> items = new array<EntityAI>;
13228 for (int i = 0; i < items.Count(); i++)
13229 {
13231 if (item)
13232 {
13234 }
13235 }
13236 }
13237 }
13238
13239
13240
13241
13243 {
13244 float energy = 0;
13245 if (HasEnergyManager())
13246 {
13247 energy = GetCompEM().GetEnergy();
13248 }
13249 return energy;
13250 }
13251
13252
13254 {
13255 super.OnEnergyConsumed();
13256
13258 }
13259
13261 {
13262 super.OnEnergyAdded();
13263
13265 }
13266
13267
13269 {
13270 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13271 {
13273 {
13274 float energy_0to1 = GetCompEM().GetEnergy0To1();
13276 }
13277 }
13278 }
13279
13280
13282 {
13283 return ConfigGetFloat("heatIsolation");
13284 }
13285
13287 {
13289 }
13290
13292 {
13293 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13294 if (
GetGame().ConfigIsExisting(paramPath))
13296
13297 return 0.0;
13298 }
13299
13301 {
13302 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13303 if (
GetGame().ConfigIsExisting(paramPath))
13305
13306 return 0.0;
13307 }
13308
13309 override void SetWet(
float value,
bool allow_client =
false)
13310 {
13311 if (!IsServerCheck(allow_client))
13312 return;
13313
13316
13318
13319 m_VarWet = Math.Clamp(value, min, max);
13320
13322 {
13325 }
13326 }
13327
13328 override void AddWet(
float value)
13329 {
13331 }
13332
13334 {
13336 }
13337
13339 {
13341 }
13342
13344 {
13346 }
13347
13349 {
13351 }
13352
13354 {
13356 }
13357
13358 override void OnWetChanged(
float newVal,
float oldVal)
13359 {
13362 if (newLevel != oldLevel)
13363 {
13365 }
13366 }
13367
13369 {
13370 SetWeightDirty();
13371 }
13372
13374 {
13375 return GetWetLevelInternal(
m_VarWet);
13376 }
13377
13378
13379
13381 {
13383 }
13384
13386 {
13388 }
13389
13391 {
13393 }
13394
13396 {
13398 }
13399
13400
13401
13403 {
13404 if (ConfigIsExisting("itemModelLength"))
13405 {
13406 return ConfigGetFloat("itemModelLength");
13407 }
13408 return 0;
13409 }
13410
13412 {
13413 if (ConfigIsExisting("itemAttachOffset"))
13414 {
13415 return ConfigGetFloat("itemAttachOffset");
13416 }
13417 return 0;
13418 }
13419
13420 override void SetCleanness(
int value,
bool allow_client =
false)
13421 {
13422 if (!IsServerCheck(allow_client))
13423 return;
13424
13426
13428
13431 }
13432
13434 {
13436 }
13437
13439 {
13440 return true;
13441 }
13442
13443
13444
13445
13447 {
13449 }
13450
13452 {
13454 }
13455
13456
13457
13458
13459 override void SetColor(
int r,
int g,
int b,
int a)
13460 {
13466 }
13468 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13469 {
13474 }
13475
13477 {
13479 }
13480
13483 {
13484 int r,g,b,a;
13486 r = r/255;
13487 g = g/255;
13488 b = b/255;
13489 a = a/255;
13490 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13491 }
13492
13493
13494
13495 override void SetLiquidType(
int value,
bool allow_client =
false)
13496 {
13497 if (!IsServerCheck(allow_client))
13498 return;
13499
13504 }
13505
13507 {
13508 return ConfigGetInt("varLiquidTypeInit");
13509 }
13510
13512 {
13514 }
13515
13517 {
13519 SetFrozen(false);
13520 }
13521
13524 {
13525 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13526 }
13527
13528
13531 {
13532 PlayerBase nplayer;
13533 if (PlayerBase.CastTo(nplayer, player))
13534 {
13536
13537 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13538 }
13539 }
13540
13541
13544 {
13545 PlayerBase nplayer;
13546 if (PlayerBase.CastTo(nplayer,player))
13547 {
13548
13549 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13550
13551 }
13552
13553
13554 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13555
13556
13557 if (HasEnergyManager())
13558 {
13559 GetCompEM().UpdatePlugState();
13560 }
13561 }
13562
13563
13565 {
13566 super.OnPlacementStarted(player);
13567
13569 }
13570
13571 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13572 {
13574 {
13575 m_AdminLog.OnPlacementComplete(player,
this);
13576 }
13577
13578 super.OnPlacementComplete(player, position, orientation);
13579 }
13580
13581
13582
13583
13584
13586 {
13588 {
13589 return true;
13590 }
13591 else
13592 {
13593 return false;
13594 }
13595 }
13596
13597
13599 {
13601 {
13603 }
13604 }
13605
13606
13608 {
13610 }
13611
13613 {
13615 }
13616
13617 override void InsertAgent(
int agent,
float count = 1)
13618 {
13619 if (count < 1)
13620 return;
13621
13623 }
13624
13627 {
13629 }
13630
13631
13633 {
13635 }
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13679 {
13681 return false;
13682 return true;
13683 }
13684
13686 {
13687
13689 }
13690
13691
13694 {
13695 super.CheckForRoofLimited(timeTresholdMS);
13696
13698 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13699 {
13700 m_PreviousRoofTestTime = time;
13701 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13702 }
13703 }
13704
13705
13707 {
13709 {
13710 return 0;
13711 }
13712
13713 if (GetInventory().GetAttachmentSlotsCount() != 0)
13714 {
13715 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13716 if (filter)
13717 return filter.GetProtectionLevel(type, false, system);
13718 else
13719 return 0;
13720 }
13721
13722 string subclassPath, entryName;
13723
13724 switch (type)
13725 {
13727 entryName = "biological";
13728 break;
13730 entryName = "chemical";
13731 break;
13732 default:
13733 entryName = "biological";
13734 break;
13735 }
13736
13737 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13738
13740 }
13741
13742
13743
13746 {
13747 if (!IsMagazine())
13749
13751 }
13752
13753
13754
13755
13756
13761 {
13762 return true;
13763 }
13764
13766 {
13768 }
13769
13770
13771
13772
13773
13775 {
13776 if (parent)
13777 {
13778 if (parent.IsInherited(DayZInfected))
13779 return true;
13780
13781 if (!parent.IsRuined())
13782 return true;
13783 }
13784
13785 return true;
13786 }
13787
13789 {
13790 if (!super.CanPutAsAttachment(parent))
13791 {
13792 return false;
13793 }
13794
13795 if (!IsRuined() && !parent.IsRuined())
13796 {
13797 return true;
13798 }
13799
13800 return false;
13801 }
13802
13804 {
13805
13806
13807
13808
13809 return super.CanReceiveItemIntoCargo(item);
13810 }
13811
13813 {
13814
13815
13816
13817
13818 GameInventory attachmentInv = attachment.GetInventory();
13820 {
13821 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13822 return false;
13823 }
13824
13825 InventoryLocation loc = new InventoryLocation();
13826 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13827 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13828 return false;
13829
13830 return super.CanReceiveAttachment(attachment, slotId);
13831 }
13832
13834 {
13835 if (!super.CanReleaseAttachment(attachment))
13836 return false;
13837
13838 return GetInventory().AreChildrenAccessible();
13839 }
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13862 {
13863 int id = muzzle_owner.GetMuzzleID();
13864 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13865
13866 if (WPOF_array)
13867 {
13868 for (int i = 0; i < WPOF_array.Count(); i++)
13869 {
13870 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13871
13872 if (WPOF)
13873 {
13874 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13875 }
13876 }
13877 }
13878 }
13879
13880
13882 {
13883 int id = muzzle_owner.GetMuzzleID();
13885
13886 if (WPOBE_array)
13887 {
13888 for (int i = 0; i < WPOBE_array.Count(); i++)
13889 {
13890 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13891
13892 if (WPOBE)
13893 {
13894 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13895 }
13896 }
13897 }
13898 }
13899
13900
13902 {
13903 int id = muzzle_owner.GetMuzzleID();
13904 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13905
13906 if (WPOOH_array)
13907 {
13908 for (int i = 0; i < WPOOH_array.Count(); i++)
13909 {
13910 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13911
13912 if (WPOOH)
13913 {
13914 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13915 }
13916 }
13917 }
13918 }
13919
13920
13922 {
13923 int id = muzzle_owner.GetMuzzleID();
13924 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13925
13926 if (WPOOH_array)
13927 {
13928 for (int i = 0; i < WPOOH_array.Count(); i++)
13929 {
13930 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13931
13932 if (WPOOH)
13933 {
13934 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13935 }
13936 }
13937 }
13938 }
13939
13940
13942 {
13943 int id = muzzle_owner.GetMuzzleID();
13944 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13945
13946 if (WPOOH_array)
13947 {
13948 for (int i = 0; i < WPOOH_array.Count(); i++)
13949 {
13950 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13951
13952 if (WPOOH)
13953 {
13954 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13955 }
13956 }
13957 }
13958 }
13959
13960
13961
13963 {
13965 {
13966 return true;
13967 }
13968
13969 return false;
13970 }
13971
13973 {
13975 {
13976 return true;
13977 }
13978
13979 return false;
13980 }
13981
13983 {
13985 {
13986 return true;
13987 }
13988
13989 return false;
13990 }
13991
13993 {
13994 return false;
13995 }
13996
13999 {
14000 return UATimeSpent.DEFAULT_DEPLOY;
14001 }
14002
14003
14004
14005
14007 {
14009 SetSynchDirty();
14010 }
14011
14013 {
14015 }
14016
14017
14019 {
14020 return false;
14021 }
14022
14025 {
14026 string att_type = "None";
14027
14028 if (ConfigIsExisting("soundAttType"))
14029 {
14030 att_type = ConfigGetString("soundAttType");
14031 }
14032
14034 }
14035
14037 {
14039 }
14040
14041
14042
14043
14044
14050
14052 {
14055
14057 }
14058
14059
14061 {
14063 return;
14064
14066
14069
14072
14073 SoundParameters params = new SoundParameters();
14077 }
14078
14079
14081 {
14083 return;
14084
14086 SetSynchDirty();
14087
14090 }
14091
14092
14094 {
14096 return;
14097
14099 SetSynchDirty();
14100
14103 }
14104
14106 {
14108 }
14109
14111 {
14113 }
14114
14117 {
14118 if (!
GetGame().IsDedicatedServer())
14119 {
14120 if (ConfigIsExisting("attachSoundSet"))
14121 {
14122 string cfg_path = "";
14123 string soundset = "";
14124 string type_name =
GetType();
14125
14128 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
14129 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
14130
14131 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
14132 {
14133 for (int i = 0; i < cfg_soundset_array.Count(); i++)
14134 {
14135 if (cfg_slot_array[i] == slot_type)
14136 {
14137 soundset = cfg_soundset_array[i];
14138 break;
14139 }
14140 }
14141 }
14142
14143 if (soundset != "")
14144 {
14145 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14147 }
14148 }
14149 }
14150 }
14151
14153 {
14154
14155 }
14156
14157 void OnApply(PlayerBase player);
14158
14160 {
14161 return 1.0;
14162 };
14163
14165 {
14167 }
14168
14170 {
14172 }
14173
14175
14177 {
14178 SetDynamicPhysicsLifeTime(0.01);
14180 }
14181
14183 {
14184 array<string> zone_names = new array<string>;
14185 GetDamageZones(zone_names);
14186 for (int i = 0; i < zone_names.Count(); i++)
14187 {
14188 SetHealthMax(zone_names.Get(i),"Health");
14189 }
14190 SetHealthMax("","Health");
14191 }
14192
14195 {
14196 float global_health = GetHealth01("","Health");
14197 array<string> zones = new array<string>;
14198 GetDamageZones(zones);
14199
14200 for (int i = 0; i < zones.Count(); i++)
14201 {
14202 SetHealth01(zones.Get(i),"Health",global_health);
14203 }
14204 }
14205
14208 {
14209 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14210 }
14211
14213 {
14214 if (!hasRootAsPlayer)
14215 {
14216 if (refParentIB)
14217 {
14218
14219 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14220 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14221
14222 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14223 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14224
14227 }
14228 else
14229 {
14230
14233 }
14234 }
14235 }
14236
14238 {
14240 {
14241 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14242 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14243 {
14244 float heatPermCoef = 1.0;
14246 while (ent)
14247 {
14248 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14249 ent = ent.GetHierarchyParent();
14250 }
14251
14252 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14253 }
14254 }
14255 }
14256
14258 {
14259
14260 EntityAI parent = GetHierarchyParent();
14261 if (!parent)
14262 {
14263 hasParent = false;
14264 hasRootAsPlayer = false;
14265 }
14266 else
14267 {
14268 hasParent = true;
14269 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14270 refParentIB =
ItemBase.Cast(parent);
14271 }
14272 }
14273
14274 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14275 {
14276
14277 }
14278
14280 {
14281
14282 return false;
14283 }
14284
14286 {
14287
14288
14289 return false;
14290 }
14291
14293 {
14294
14295 return false;
14296 }
14297
14300 {
14301 return !GetIsFrozen() &&
IsOpen();
14302 }
14303
14305 {
14306 bool hasParent = false, hasRootAsPlayer = false;
14308
14309 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14310 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14311
14312 if (wwtu || foodDecay)
14313 {
14317
14318 if (processWetness || processTemperature || processDecay)
14319 {
14321
14322 if (processWetness)
14323 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14324
14325 if (processTemperature)
14327
14328 if (processDecay)
14329 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14330 }
14331 }
14332 }
14333
14336 {
14338 }
14339
14341 {
14344
14345 return super.GetTemperatureFreezeThreshold();
14346 }
14347
14349 {
14352
14353 return super.GetTemperatureThawThreshold();
14354 }
14355
14357 {
14360
14361 return super.GetItemOverheatThreshold();
14362 }
14363
14365 {
14367 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14368
14369 return super.GetTemperatureFreezeTime();
14370 }
14371
14373 {
14375 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14376
14377 return super.GetTemperatureThawTime();
14378 }
14379
14384
14386 {
14387 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14388 }
14389
14391 {
14392 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14393 }
14394
14397 {
14399 }
14400
14402 {
14404 }
14405
14407 {
14409 }
14410
14413 {
14414 return null;
14415 }
14416
14419 {
14420 return false;
14421 }
14422
14424 {
14426 {
14429 if (!trg)
14430 {
14432 explosive = this;
14433 }
14434
14435 explosive.PairRemote(trg);
14437
14438 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14439 trg.SetPersistentPairID(persistentID);
14440 explosive.SetPersistentPairID(persistentID);
14441
14442 return true;
14443 }
14444 return false;
14445 }
14446
14449 {
14450 float ret = 1.0;
14453 ret *= GetHealth01();
14454
14455 return ret;
14456 }
14457
14458 #ifdef DEVELOPER
14459 override void SetDebugItem()
14460 {
14461 super.SetDebugItem();
14462 _itemBase = this;
14463 }
14464
14466 {
14467 string text = super.GetDebugText();
14468
14470 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14471
14472 return text;
14473 }
14474 #endif
14475
14477 {
14478 return true;
14479 }
14480
14482
14484
14486 {
14489 }
14490
14491
14499
14515}
14516
14518{
14520 if (entity)
14521 {
14522 bool is_item = entity.IsInherited(
ItemBase);
14523 if (is_item && full_quantity)
14524 {
14527 }
14528 }
14529 else
14530 {
14532 return NULL;
14533 }
14534 return entity;
14535}
14536
14538{
14539 if (item)
14540 {
14541 if (health > 0)
14542 item.SetHealth("", "", health);
14543
14544 if (item.CanHaveTemperature())
14545 {
14547 if (item.CanFreeze())
14548 item.SetFrozen(false);
14549 }
14550
14551 if (item.HasEnergyManager())
14552 {
14553 if (quantity >= 0)
14554 {
14555 item.GetCompEM().SetEnergy0To1(quantity);
14556 }
14557 else
14558 {
14560 }
14561 }
14562 else if (item.IsMagazine())
14563 {
14564 Magazine mag = Magazine.Cast(item);
14565 if (quantity >= 0)
14566 {
14567 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14568 }
14569 else
14570 {
14572 }
14573
14574 }
14575 else
14576 {
14577 if (quantity >= 0)
14578 {
14579 item.SetQuantityNormalized(quantity, false);
14580 }
14581 else
14582 {
14584 }
14585
14586 }
14587 }
14588}
14589
14590#ifdef DEVELOPER
14592#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.