9594{
9596 {
9597 return true;
9598 }
9599};
9600
9601
9602
9604{
9608
9610
9613
9614
9615
9616
9617
9626
9632
9637
9642
9663 protected bool m_IsResultOfSplit
9664
9666
9671
9672
9673
9675
9679
9680
9681
9683
9686
9687
9688
9694
9695
9703
9706
9707
9709
9710
9712
9713
9718
9719
9724
9725
9727
9728
9730 {
9735
9736 if (!
GetGame().IsDedicatedServer())
9737 {
9739 {
9741
9743 {
9745 }
9746 }
9747
9750 }
9751
9752 m_OldLocation = null;
9753
9755 {
9757 }
9758
9759 if (ConfigIsExisting("headSelectionsToHide"))
9760 {
9763 }
9764
9766 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9767 {
9769 }
9770
9772
9773 m_IsResultOfSplit = false;
9774
9776 }
9777
9779 {
9780 super.InitItemVariables();
9781
9787 m_Count = ConfigGetInt(
"count");
9788
9791
9796
9799
9804
9816
9820
9821
9824 if (ConfigIsExisting("canBeSplit"))
9825 {
9828 }
9829
9831 if (ConfigIsExisting("itemBehaviour"))
9833
9834
9837 RegisterNetSyncVariableInt("m_VarLiquidType");
9838 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9839
9840 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9841 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9842 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9843
9844 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9845 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9846 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9847 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9848
9849 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9850 RegisterNetSyncVariableBool("m_IsTakeable");
9851 RegisterNetSyncVariableBool("m_IsHologram");
9852
9855 {
9858 }
9859
9861
9863 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9865
9866 }
9867
9869 {
9871 }
9872
9874 {
9877 {
9882 }
9883 }
9884
9885 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9886 {
9888 {
9891 }
9892
9894 }
9895
9897 {
9903 }
9904
9906
9908 {
9910
9911 if (!action)
9912 {
9913 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9914 return;
9915 }
9916
9918 if (!ai)
9919 {
9921 return;
9922 }
9923
9925 if (!action_array)
9926 {
9927 action_array = new array<ActionBase_Basic>;
9929 }
9930 if (LogManager.IsActionLogEnable())
9931 {
9932 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9933 }
9934
9935 if (action_array.Find(action) != -1)
9936 {
9937 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9938 }
9939 else
9940 {
9941 action_array.Insert(action);
9942 }
9943 }
9944
9946 {
9948 ActionBase action = player.GetActionManager().GetAction(actionName);
9951
9952 if (action_array)
9953 {
9954 action_array.RemoveItem(action);
9955 }
9956 }
9957
9958
9959
9961 {
9962 ActionOverrideData overrideData = new ActionOverrideData();
9966
9968 if (!actionMap)
9969 {
9972 }
9973
9974 actionMap.Insert(this.
Type(), overrideData);
9975
9976 }
9977
9979
9981
9982
9984 {
9987
9990
9991 string config_to_search = "CfgVehicles";
9992 string muzzle_owner_config;
9993
9995 {
9996 if (IsInherited(Weapon))
9997 config_to_search = "CfgWeapons";
9998
9999 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10000
10001 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
10002
10004
10005 if (config_OnFire_subclass_count > 0)
10006 {
10007 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
10008
10009 for (int i = 0; i < config_OnFire_subclass_count; i++)
10010 {
10011 string particle_class = "";
10013 string config_OnFire_entry = config_OnFire_class + particle_class;
10014 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
10015 WPOF_array.Insert(WPOF);
10016 }
10017
10018
10020 }
10021 }
10022
10024 {
10025 config_to_search = "CfgWeapons";
10026 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10027
10028 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
10029
10031
10032 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
10033 {
10034 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
10035
10036 for (i = 0; i < config_OnBulletCasingEject_count; i++)
10037 {
10038 string particle_class2 = "";
10040 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
10041 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
10042 WPOBE_array.Insert(WPOBE);
10043 }
10044
10045
10047 }
10048 }
10049 }
10050
10051
10053 {
10056
10058 {
10059 string config_to_search = "CfgVehicles";
10060
10061 if (IsInherited(Weapon))
10062 config_to_search = "CfgWeapons";
10063
10064 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10065 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10066
10067 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10068 {
10069
10071
10073 {
10075 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10077 return;
10078 }
10079
10082
10083
10084
10086 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10087
10088 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10089 {
10090 string particle_class = "";
10092 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10094
10095 if (entry_type == CT_CLASS)
10096 {
10097 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10098 WPOOH_array.Insert(WPOF);
10099 }
10100 }
10101
10102
10104 }
10105 }
10106 }
10107
10109 {
10111 }
10112
10114 {
10116 {
10118
10121
10124
10125 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10126 }
10127 }
10128
10130 {
10132 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10133
10135 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10136
10138 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10139
10141 {
10143 }
10144 }
10145
10147 {
10149 }
10150
10152 {
10155 else
10157
10159 {
10162 }
10163 else
10164 {
10167
10170 }
10171
10173 }
10174
10176 {
10178 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10179 }
10180
10182 {
10184 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10186 }
10187
10189 {
10191 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10192 }
10193
10195 {
10198
10199 OverheatingParticle OP = new OverheatingParticle();
10204
10206 }
10207
10209 {
10212
10213 return -1;
10214 }
10215
10217 {
10219 {
10222
10223 for (int i = count; i > 0; --i)
10224 {
10225 int id = i - 1;
10228
10231
10232 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10233 {
10234 if (p)
10235 {
10238 }
10239 }
10240 }
10241 }
10242 }
10243
10245 {
10247 {
10249 {
10250 int id = i - 1;
10252
10253 if (OP)
10254 {
10256
10257 if (p)
10258 {
10260 }
10261
10262 delete OP;
10263 }
10264 }
10265
10268 }
10269 }
10270
10273 {
10274 return 0.0;
10275 }
10276
10277
10279 {
10280 return 250;
10281 }
10282
10284 {
10285 return 0;
10286 }
10287
10290 {
10292 return true;
10293
10294 return false;
10295 }
10296
10299 {
10302
10304 {
10306 }
10307 else
10308 {
10309
10311 }
10312
10314 }
10315
10322 {
10323 return -1;
10324 }
10325
10326
10327
10328
10330 {
10332 {
10334 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10335
10336 if (r_index >= 0)
10337 {
10338 InventoryLocation r_il = new InventoryLocation;
10339 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10340
10341 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10344 {
10345 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10346 }
10348 {
10349 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10350 }
10351
10352 }
10353
10354 player.GetHumanInventory().ClearUserReservedLocation(this);
10355 }
10356
10359 }
10360
10361
10362
10363
10365 {
10366 return ItemBase.m_DebugActionsMask;
10367 }
10368
10370 {
10371 return ItemBase.m_DebugActionsMask & mask;
10372 }
10373
10375 {
10376 ItemBase.m_DebugActionsMask = mask;
10377 }
10378
10380 {
10381 ItemBase.m_DebugActionsMask |= mask;
10382 }
10383
10385 {
10386 ItemBase.m_DebugActionsMask &= ~mask;
10387 }
10388
10390 {
10392 {
10394 }
10395 else
10396 {
10398 }
10399 }
10400
10401
10403 {
10404 if (GetEconomyProfile())
10405 {
10406 float q_max = GetEconomyProfile().GetQuantityMax();
10407 if (q_max > 0)
10408 {
10409 float q_min = GetEconomyProfile().GetQuantityMin();
10410 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10411
10413 {
10414 ComponentEnergyManager comp = GetCompEM();
10416 {
10418 }
10419 }
10421 {
10423
10424 }
10425
10426 }
10427 }
10428 }
10429
10432 {
10433 EntityAI parent = GetHierarchyParent();
10434
10435 if (parent)
10436 {
10437 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10438 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10439 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10440 }
10441 }
10442
10445 {
10446 EntityAI parent = GetHierarchyParent();
10447
10448 if (parent)
10449 {
10450 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10451 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10452 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10453 }
10454 }
10455
10457 {
10458
10459
10460
10461
10463
10465 {
10466 if (ScriptInputUserData.CanStoreInputUserData())
10467 {
10468 ScriptInputUserData ctx = new ScriptInputUserData;
10474 ctx.
Write(use_stack_max);
10477
10479 {
10480 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10481 }
10482 }
10483 }
10484 else if (!
GetGame().IsMultiplayer())
10485 {
10487 }
10488 }
10489
10491 {
10493 }
10494
10496 {
10498 }
10499
10501 {
10503 }
10504
10506 {
10507
10508 return false;
10509 }
10510
10512 {
10513 return false;
10514 }
10515
10519 {
10520 return false;
10521 }
10522
10524 {
10525 return "";
10526 }
10527
10529
10531 {
10532 return false;
10533 }
10534
10536 {
10537 return true;
10538 }
10539
10540
10541
10543 {
10544 return true;
10545 }
10546
10548 {
10549 return true;
10550 }
10551
10553 {
10554 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10556 }
10557
10559 {
10561 }
10562
10564 {
10566 if (!is_being_placed)
10568 SetSynchDirty();
10569 }
10570
10571
10573
10575 {
10577 }
10578
10580 {
10582 }
10583
10585 {
10586 return 1;
10587 }
10588
10590 {
10591 return false;
10592 }
10593
10595 {
10597 SetSynchDirty();
10598 }
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10635 {
10636 super.OnMovedInsideCargo(container);
10637
10638 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10639 }
10640
10641 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10642 {
10643 super.EEItemLocationChanged(oldLoc,newLoc);
10644
10645 PlayerBase new_player = null;
10646 PlayerBase old_player = null;
10647
10648 if (newLoc.GetParent())
10649 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10650
10651 if (oldLoc.GetParent())
10652 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10653
10655 {
10656 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10657
10658 if (r_index >= 0)
10659 {
10660 InventoryLocation r_il = new InventoryLocation;
10661 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10662
10663 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10666 {
10667 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10668 }
10670 {
10671 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10672 }
10673
10674 }
10675 }
10676
10678 {
10679 if (new_player)
10680 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10681
10682 if (new_player == old_player)
10683 {
10684
10685 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10686 {
10688 {
10689 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10690 {
10691 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10692 }
10693 }
10694 else
10695 {
10696 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10697 }
10698 }
10699
10700 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10701 {
10702 int type = oldLoc.GetType();
10704 {
10705 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10706 }
10708 {
10709 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10710 }
10711 }
10712 if (!m_OldLocation)
10713 {
10714 m_OldLocation = new InventoryLocation;
10715 }
10716 m_OldLocation.Copy(oldLoc);
10717 }
10718 else
10719 {
10720 if (m_OldLocation)
10721 {
10722 m_OldLocation.Reset();
10723 }
10724 }
10725
10727 }
10728 else
10729 {
10730 if (new_player)
10731 {
10732 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10733 if (res_index >= 0)
10734 {
10735 InventoryLocation il = new InventoryLocation;
10736 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10738 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10741 {
10742 il.
GetParent().GetOnReleaseLock().Invoke(it);
10743 }
10745 {
10747 }
10748
10749 }
10750 }
10752 {
10753
10755 }
10756
10757 if (m_OldLocation)
10758 {
10759 m_OldLocation.Reset();
10760 }
10761 }
10762 }
10763
10764 override void EOnContact(IEntity other, Contact extra)
10765 {
10767 {
10768 int liquidType = -1;
10770 if (impactSpeed > 0.0)
10771 {
10773 #ifndef SERVER
10775 #else
10777 SetSynchDirty();
10778 #endif
10780 }
10781 }
10782
10783 #ifdef SERVER
10784 if (GetCompEM() && GetCompEM().IsPlugged())
10785 {
10786 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10787 GetCompEM().UnplugThis();
10788 }
10789 #endif
10790 }
10791
10793
10795 {
10797 }
10798
10800 {
10801
10802 }
10803
10805 {
10806 super.OnItemLocationChanged(old_owner, new_owner);
10807
10808 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10809 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10810
10811 if (!relatedPlayer && playerNew)
10812 relatedPlayer = playerNew;
10813
10814 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10815 {
10817 if (actionMgr)
10818 {
10819 ActionBase currentAction = actionMgr.GetRunningAction();
10820 if (currentAction)
10822 }
10823 }
10824
10825 Man ownerPlayerOld = null;
10826 Man ownerPlayerNew = null;
10827
10828 if (old_owner)
10829 {
10830 if (old_owner.
IsMan())
10831 {
10832 ownerPlayerOld = Man.Cast(old_owner);
10833 }
10834 else
10835 {
10836 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10837 }
10838 }
10839 else
10840 {
10842 {
10844
10845 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10846 {
10847 GetCompEM().UnplugThis();
10848 }
10849 }
10850 }
10851
10852 if (new_owner)
10853 {
10854 if (new_owner.
IsMan())
10855 {
10856 ownerPlayerNew = Man.Cast(new_owner);
10857 }
10858 else
10859 {
10860 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10861 }
10862 }
10863
10864 if (ownerPlayerOld != ownerPlayerNew)
10865 {
10866 if (ownerPlayerOld)
10867 {
10868 array<EntityAI> subItemsExit = new array<EntityAI>;
10870 for (int i = 0; i < subItemsExit.Count(); i++)
10871 {
10874 }
10875 }
10876
10877 if (ownerPlayerNew)
10878 {
10879 array<EntityAI> subItemsEnter = new array<EntityAI>;
10881 for (int j = 0; j < subItemsEnter.Count(); j++)
10882 {
10885 }
10886 }
10887 }
10888 else if (ownerPlayerNew != null)
10889 {
10890 PlayerBase nplayer;
10891 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10892 {
10893 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10895 for (int k = 0; k < subItemsUpdate.Count(); k++)
10896 {
10898 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10899 }
10900 }
10901 }
10902
10903 if (old_owner)
10904 old_owner.OnChildItemRemoved(this);
10905 if (new_owner)
10906 new_owner.OnChildItemReceived(this);
10907 }
10908
10909
10911 {
10912 super.EEDelete(parent);
10913 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10914 if (player)
10915 {
10917
10918 if (player.IsAlive())
10919 {
10920 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10921 if (r_index >= 0)
10922 {
10923 InventoryLocation r_il = new InventoryLocation;
10924 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10925
10926 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10929 {
10930 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10931 }
10933 {
10934 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10935 }
10936
10937 }
10938
10939 player.RemoveQuickBarEntityShortcut(this);
10940 }
10941 }
10942 }
10943
10945 {
10946 super.EEKilled(killer);
10947
10950 {
10951 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10952 {
10953 if (IsMagazine())
10954 {
10955 if (Magazine.Cast(this).GetAmmoCount() > 0)
10956 {
10958 }
10959 }
10960 else
10961 {
10963 }
10964 }
10965 }
10966 }
10967
10969 {
10970 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10971
10972 super.OnWasAttached(parent, slot_id);
10973
10976
10978 }
10979
10981 {
10982 super.OnWasDetached(parent, slot_id);
10983
10986 }
10987
10989 {
10990 int idx;
10993
10994 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10995 if (inventory_slots.Count() < 1)
10996 {
10997 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10998 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10999 }
11000 else
11001 {
11002 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
11003 }
11004
11005 idx = inventory_slots.Find(slot);
11006 if (idx < 0)
11007 return "";
11008
11009 return attach_types.Get(idx);
11010 }
11011
11013 {
11014 int idx = -1;
11015 string slot;
11016
11019
11020 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11021 if (inventory_slots.Count() < 1)
11022 {
11023 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
11024 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11025 }
11026 else
11027 {
11028 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
11029 if (detach_types.Count() < 1)
11030 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11031 }
11032
11033 for (int i = 0; i < inventory_slots.Count(); i++)
11034 {
11035 slot = inventory_slots.Get(i);
11036 }
11037
11038 if (slot != "")
11039 {
11040 if (detach_types.Count() == 1)
11041 idx = 0;
11042 else
11043 idx = inventory_slots.Find(slot);
11044 }
11045 if (idx < 0)
11046 return "";
11047
11048 return detach_types.Get(idx);
11049 }
11050
11052 {
11053
11055
11056
11057 float min_time = 1;
11058 float max_time = 3;
11059 float delay = Math.RandomFloat(min_time, max_time);
11060
11061 explode_timer.Run(delay, this, "DoAmmoExplosion");
11062 }
11063
11065 {
11066 Magazine magazine = Magazine.Cast(this);
11067 int pop_sounds_count = 6;
11068 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11069
11070
11071 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11072 string sound_name = pop_sounds[ sound_idx ];
11074
11075
11076 magazine.ServerAddAmmoCount(-1);
11077
11078
11079 float min_temp_to_explode = 100;
11080
11081 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11082 {
11084 }
11085 }
11086
11087
11088 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11089 {
11090 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11091
11092 const int CHANCE_DAMAGE_CARGO = 4;
11093 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11094 const int CHANCE_DAMAGE_NOTHING = 2;
11095
11097 {
11098 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11099 int chances;
11100 int rnd;
11101
11102 if (GetInventory().GetCargo())
11103 {
11104 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11105 rnd = Math.RandomInt(0,chances);
11106
11107 if (rnd < CHANCE_DAMAGE_CARGO)
11108 {
11110 }
11111 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11112 {
11114 }
11115 }
11116 else
11117 {
11118 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11119 rnd = Math.RandomInt(0,chances);
11120
11121 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11122 {
11124 }
11125 }
11126 }
11127 }
11128
11130 {
11131 if (GetInventory().GetCargo())
11132 {
11133 int item_count = GetInventory().GetCargo().GetItemCount();
11134 if (item_count > 0)
11135 {
11136 int random_pick = Math.RandomInt(0, item_count);
11138 if (!item.IsExplosive())
11139 {
11140 item.AddHealth("","",damage);
11141 return true;
11142 }
11143 }
11144 }
11145 return false;
11146 }
11147
11149 {
11150 int attachment_count = GetInventory().AttachmentCount();
11151 if (attachment_count > 0)
11152 {
11153 int random_pick = Math.RandomInt(0, attachment_count);
11154 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11155 if (!attachment.IsExplosive())
11156 {
11157 attachment.AddHealth("","",damage);
11158 return true;
11159 }
11160 }
11161 return false;
11162 }
11163
11165 {
11167 }
11168
11170 {
11172 return GetInventory().CanRemoveEntity();
11173
11174 return false;
11175 }
11176
11178 {
11179
11181 return false;
11182
11183
11185 return false;
11186
11187
11188
11190 if (delta == 0)
11191 return false;
11192
11193
11194 return true;
11195 }
11196
11198 {
11200 {
11201 if (ScriptInputUserData.CanStoreInputUserData())
11202 {
11203 ScriptInputUserData ctx = new ScriptInputUserData;
11208 ctx.
Write(destination_entity);
11210 ctx.
Write(slot_id);
11212 }
11213 }
11214 else if (!
GetGame().IsMultiplayer())
11215 {
11217 }
11218 }
11219
11221 {
11222 float split_quantity_new;
11226 InventoryLocation loc = new InventoryLocation;
11227
11228 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11229 {
11231 split_quantity_new = stack_max;
11232 else
11234
11236 {
11237 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11238 if (new_item)
11239 {
11240 new_item.SetResultOfSplit(true);
11241 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11243 new_item.
SetQuantity(split_quantity_new,
false,
true);
11244 }
11245 }
11246 }
11247 else if (destination_entity && slot_id == -1)
11248 {
11249 if (quantity > stack_max)
11250 split_quantity_new = stack_max;
11251 else
11252 split_quantity_new = quantity;
11253
11255 {
11257 {
11260 }
11261
11262 if (new_item)
11263 {
11264 new_item.SetResultOfSplit(true);
11265 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11267 new_item.
SetQuantity(split_quantity_new,
false,
true);
11268 }
11269 }
11270 }
11271 else
11272 {
11273 if (stack_max != 0)
11274 {
11276 {
11278 }
11279
11280 if (split_quantity_new == 0)
11281 {
11282 if (!
GetGame().IsMultiplayer())
11283 player.PhysicalPredictiveDropItem(this);
11284 else
11285 player.ServerDropEntity(this);
11286 return;
11287 }
11288
11290 {
11292
11293 if (new_item)
11294 {
11295 new_item.SetResultOfSplit(true);
11296 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11299 new_item.PlaceOnSurface();
11300 }
11301 }
11302 }
11303 }
11304 }
11305
11307 {
11308 float split_quantity_new;
11312 InventoryLocation loc = new InventoryLocation;
11313
11314 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11315 {
11317 split_quantity_new = stack_max;
11318 else
11320
11322 {
11323 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11324 if (new_item)
11325 {
11326 new_item.SetResultOfSplit(true);
11327 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11329 new_item.
SetQuantity(split_quantity_new,
false,
true);
11330 }
11331 }
11332 }
11333 else if (destination_entity && slot_id == -1)
11334 {
11335 if (quantity > stack_max)
11336 split_quantity_new = stack_max;
11337 else
11338 split_quantity_new = quantity;
11339
11341 {
11343 {
11346 }
11347
11348 if (new_item)
11349 {
11350 new_item.SetResultOfSplit(true);
11351 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11353 new_item.
SetQuantity(split_quantity_new,
false,
true);
11354 }
11355 }
11356 }
11357 else
11358 {
11359 if (stack_max != 0)
11360 {
11362 {
11364 }
11365
11367 {
11369
11370 if (new_item)
11371 {
11372 new_item.SetResultOfSplit(true);
11373 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11376 new_item.PlaceOnSurface();
11377 }
11378 }
11379 }
11380 }
11381 }
11382
11384 {
11386 {
11387 if (ScriptInputUserData.CanStoreInputUserData())
11388 {
11389 ScriptInputUserData ctx = new ScriptInputUserData;
11394 dst.WriteToContext(ctx);
11396 }
11397 }
11398 else if (!
GetGame().IsMultiplayer())
11399 {
11401 }
11402 }
11403
11405 {
11407 {
11408 if (ScriptInputUserData.CanStoreInputUserData())
11409 {
11410 ScriptInputUserData ctx = new ScriptInputUserData;
11415 ctx.
Write(destination_entity);
11421 }
11422 }
11423 else if (!
GetGame().IsMultiplayer())
11424 {
11426 }
11427 }
11428
11430 {
11432 }
11433
11435 {
11437 float split_quantity_new;
11439 if (dst.IsValid())
11440 {
11441 int slot_id = dst.GetSlot();
11443
11444 if (quantity > stack_max)
11445 split_quantity_new = stack_max;
11446 else
11447 split_quantity_new = quantity;
11448
11450 {
11452
11453 if (new_item)
11454 {
11455 new_item.SetResultOfSplit(true);
11456 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11458 new_item.
SetQuantity(split_quantity_new,
false,
true);
11459 }
11460
11461 return new_item;
11462 }
11463 }
11464
11465 return null;
11466 }
11467
11469 {
11471 float split_quantity_new;
11473 if (destination_entity)
11474 {
11476 if (quantity > stackable)
11477 split_quantity_new = stackable;
11478 else
11479 split_quantity_new = quantity;
11480
11482 {
11483 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11484 if (new_item)
11485 {
11486 new_item.SetResultOfSplit(true);
11487 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11489 new_item.
SetQuantity(split_quantity_new,
false,
true);
11490 }
11491 }
11492 }
11493 }
11494
11496 {
11498 {
11499 if (ScriptInputUserData.CanStoreInputUserData())
11500 {
11501 ScriptInputUserData ctx = new ScriptInputUserData;
11506 ItemBase destination_entity =
this;
11507 ctx.
Write(destination_entity);
11511 }
11512 }
11513 else if (!
GetGame().IsMultiplayer())
11514 {
11516 }
11517 }
11518
11520 {
11522 float split_quantity_new;
11524 if (player)
11525 {
11527 if (quantity > stackable)
11528 split_quantity_new = stackable;
11529 else
11530 split_quantity_new = quantity;
11531
11533 {
11534 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11535 new_item =
ItemBase.Cast(in_hands);
11536 if (new_item)
11537 {
11538 new_item.SetResultOfSplit(true);
11539 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11541 new_item.SetQuantity(split_quantity_new, false, true);
11542 }
11543 }
11544 }
11545 }
11546
11548 {
11550 float split_quantity_new = Math.Floor(quantity * 0.5);
11551
11553 return;
11554
11556
11557 if (new_item)
11558 {
11559 if (new_item.GetQuantityMax() < split_quantity_new)
11560 {
11561 split_quantity_new = new_item.GetQuantityMax();
11562 }
11563
11564 new_item.SetResultOfSplit(true);
11565 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11566
11568 {
11571 }
11572 else
11573 {
11575 new_item.
SetQuantity(split_quantity_new,
false,
true);
11576 }
11577 }
11578 }
11579
11581 {
11583 float split_quantity_new = Math.Floor(quantity / 2);
11584
11586 return;
11587
11588 InventoryLocation invloc = new InventoryLocation;
11590
11592 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11593
11594 if (new_item)
11595 {
11596 if (new_item.GetQuantityMax() < split_quantity_new)
11597 {
11598 split_quantity_new = new_item.GetQuantityMax();
11599 }
11601 {
11604 }
11605 else if (split_quantity_new > 1)
11606 {
11608 new_item.
SetQuantity(split_quantity_new,
false,
true);
11609 }
11610 }
11611 }
11612
11615 {
11616 SetWeightDirty();
11618
11619 if (parent)
11620 parent.OnAttachmentQuantityChangedEx(this, delta);
11621
11623 {
11625 {
11627 }
11629 {
11630 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11632 }
11633 }
11634
11635 }
11636
11639 {
11640
11641 }
11642
11645 {
11647 }
11648
11650 {
11651 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11652
11654 {
11655 if (newLevel == GameConstants.STATE_RUINED)
11656 {
11658 EntityAI parent = GetHierarchyParent();
11659 if (parent && parent.IsFireplace())
11660 {
11661 CargoBase cargo = GetInventory().GetCargo();
11662 if (cargo)
11663 {
11665 {
11667 }
11668 }
11669 }
11670 }
11671
11673 {
11674
11676 return;
11677 }
11678
11679 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11680 {
11682 }
11683 }
11684 }
11685
11686
11688 {
11689 super.OnRightClick();
11690
11692 {
11694 {
11695 if (ScriptInputUserData.CanStoreInputUserData())
11696 {
11697 EntityAI root = GetHierarchyRoot();
11698 Man playerOwner = GetHierarchyRootPlayer();
11699 InventoryLocation dst = new InventoryLocation;
11700
11701
11702 if (!playerOwner && root && root == this)
11703 {
11705 }
11706 else
11707 {
11708
11709 GetInventory().GetCurrentInventoryLocation(dst);
11711 {
11714 {
11716 }
11717 else
11718 {
11720
11721
11722 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11723 {
11725 }
11726 else
11727 {
11728 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11729 }
11730 }
11731 }
11732 }
11733
11734 ScriptInputUserData ctx = new ScriptInputUserData;
11742 }
11743 }
11744 else if (!
GetGame().IsMultiplayer())
11745 {
11747 }
11748 }
11749 }
11750
11752 {
11753 if (root)
11754 {
11755 vector m4[4];
11756 root.GetTransform(m4);
11757 dst.SetGround(this, m4);
11758 }
11759 else
11760 {
11761 GetInventory().GetCurrentInventoryLocation(dst);
11762 }
11763 }
11764
11765 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11766 {
11767
11768 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11769 return false;
11770
11771 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11772 return false;
11773
11774
11776 return false;
11777
11778
11779 Magazine mag = Magazine.Cast(this);
11780 if (mag)
11781 {
11782 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11783 return false;
11784
11785 if (stack_max_limit)
11786 {
11787 Magazine other_mag = Magazine.Cast(other_item);
11788 if (other_item)
11789 {
11790 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11791 return false;
11792 }
11793
11794 }
11795 }
11796 else
11797 {
11798
11800 return false;
11801
11803 return false;
11804 }
11805
11806 PlayerBase player = null;
11807 if (CastTo(player, GetHierarchyRootPlayer()))
11808 {
11809 if (player.GetInventory().HasAttachment(this))
11810 return false;
11811
11812 if (player.IsItemsToDelete())
11813 return false;
11814 }
11815
11816 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11817 return false;
11818
11819 int slotID;
11821 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11822 return false;
11823
11824 return true;
11825 }
11826
11828 {
11830 }
11831
11833 {
11834 return m_IsResultOfSplit;
11835 }
11836
11838 {
11839 m_IsResultOfSplit = value;
11840 }
11841
11843 {
11845 }
11846
11848 {
11849 float other_item_quantity = other_item.GetQuantity();
11850 float this_free_space;
11851
11853
11855
11856 if (other_item_quantity > this_free_space)
11857 {
11858 return this_free_space;
11859 }
11860 else
11861 {
11862 return other_item_quantity;
11863 }
11864 }
11865
11867 {
11869 }
11870
11872 {
11874 return;
11875
11876 if (!IsMagazine() && other_item)
11877 {
11879 if (quantity_used != 0)
11880 {
11881 float hp1 = GetHealth01("","");
11882 float hp2 = other_item.GetHealth01("","");
11883 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11884 hpResult = hpResult / (
GetQuantity() + quantity_used);
11885
11886 hpResult *= GetMaxHealth();
11887 Math.Round(hpResult);
11888 SetHealth("", "Health", hpResult);
11889
11891 other_item.AddQuantity(-quantity_used);
11892 }
11893 }
11895 }
11896
11898 {
11899 #ifdef SERVER
11900 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11901 GetHierarchyParent().IncreaseLifetimeUp();
11902 #endif
11903 };
11904
11906 {
11907 PlayerBase p = PlayerBase.Cast(player);
11908
11909 array<int> recipesIds = p.m_Recipes;
11910 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11911 if (moduleRecipesManager)
11912 {
11913 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11914 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11915 }
11916
11917 for (int i = 0;i < recipesIds.Count(); i++)
11918 {
11919 int key = recipesIds.Get(i);
11920 string recipeName = moduleRecipesManager.GetRecipeName(key);
11922 }
11923 }
11924
11925
11926 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11927 {
11928 super.GetDebugActions(outputList);
11929
11930
11936
11937
11942
11947
11948
11952
11953
11955 {
11959 }
11960
11963
11964
11968
11970
11971 InventoryLocation loc = new InventoryLocation();
11972 GetInventory().GetCurrentInventoryLocation(loc);
11974 {
11975 if (Gizmo_IsSupported())
11978 }
11979
11981 }
11982
11983
11984
11985
11987 {
11988 super.OnAction(action_id, player, ctx);
11989
11991 {
11992 switch (action_id)
11993 {
11996 return true;
11999 return true;
12000 }
12001 }
12002
12004 {
12005 switch (action_id)
12006 {
12008 Delete();
12009 return true;
12010 }
12011 }
12012
12013 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
12014 {
12015 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12016 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
12017 PlayerBase p = PlayerBase.Cast(player);
12018 if (
EActions.RECIPES_RANGE_START < 1000)
12019 {
12020 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
12021 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
12022 }
12023 }
12024 #ifndef SERVER
12025 else if (action_id ==
EActions.WATCH_PLAYER)
12026 {
12027 PluginDeveloper.SetDeveloperItemClientEx(player);
12028 }
12029 #endif
12031 {
12032 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
12033 {
12034 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
12035 OnDebugButtonPressServer(id + 1);
12036 }
12037
12038 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
12039 {
12040 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
12042 }
12043
12044 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
12045 {
12046 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
12048 }
12049
12050 else if (action_id ==
EActions.ADD_QUANTITY)
12051 {
12052 if (IsMagazine())
12053 {
12054 Magazine mag = Magazine.Cast(this);
12055 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
12056 }
12057 else
12058 {
12060 }
12061
12062 if (m_EM)
12063 {
12064 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12065 }
12066
12067 }
12068
12069 else if (action_id ==
EActions.REMOVE_QUANTITY)
12070 {
12071 if (IsMagazine())
12072 {
12073 Magazine mag2 = Magazine.Cast(this);
12074 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12075 }
12076 else
12077 {
12079 }
12080 if (m_EM)
12081 {
12082 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12083 }
12084
12085 }
12086
12087 else if (action_id ==
EActions.SET_QUANTITY_0)
12088 {
12090
12091 if (m_EM)
12092 {
12093 m_EM.SetEnergy(0);
12094 }
12095 }
12096
12097 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12098 {
12100
12101 if (m_EM)
12102 {
12103 m_EM.SetEnergy(m_EM.GetEnergyMax());
12104 }
12105 }
12106
12107 else if (action_id ==
EActions.ADD_HEALTH)
12108 {
12109 AddHealth("","",GetMaxHealth("","Health")/5);
12110 }
12111 else if (action_id ==
EActions.REMOVE_HEALTH)
12112 {
12113 AddHealth("","",-GetMaxHealth("","Health")/5);
12114 }
12115 else if (action_id ==
EActions.DESTROY_HEALTH)
12116 {
12117 SetHealth01("","",0);
12118 }
12119 else if (action_id ==
EActions.WATCH_ITEM)
12120 {
12122 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12123 #ifdef DEVELOPER
12124 SetDebugDeveloper_item(this);
12125 #endif
12126 }
12127
12128 else if (action_id ==
EActions.ADD_TEMPERATURE)
12129 {
12130 AddTemperature(20);
12131
12132 }
12133
12134 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12135 {
12136 AddTemperature(-20);
12137
12138 }
12139
12140 else if (action_id ==
EActions.FLIP_FROZEN)
12141 {
12142 SetFrozen(!GetIsFrozen());
12143
12144 }
12145
12146 else if (action_id ==
EActions.ADD_WETNESS)
12147 {
12149
12150 }
12151
12152 else if (action_id ==
EActions.REMOVE_WETNESS)
12153 {
12155
12156 }
12157
12158 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12159 {
12162
12163
12164 }
12165
12166 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12167 {
12170 }
12171
12172 else if (action_id ==
EActions.MAKE_SPECIAL)
12173 {
12174 auto debugParams = DebugSpawnParams.WithPlayer(player);
12175 OnDebugSpawnEx(debugParams);
12176 }
12177
12178 }
12179
12180
12181 return false;
12182 }
12183
12184
12185
12186
12190
12193
12194
12195
12197 {
12198 return false;
12199 }
12200
12201
12203 {
12204 return true;
12205 }
12206
12207
12209 {
12210 return true;
12211 }
12212
12213
12214
12216 {
12217 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12219 }
12220
12223 {
12224 return null;
12225 }
12226
12228 {
12229 return false;
12230 }
12231
12233 {
12234 return false;
12235 }
12236
12240
12241
12243 {
12244 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12245 return module_repairing.CanRepair(this, item_repair_kit);
12246 }
12247
12248
12249 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12250 {
12251 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12252 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12253 }
12254
12255
12257 {
12258
12259
12260
12261
12262
12263
12264
12265
12266 return 1;
12267 }
12268
12269
12270
12272 {
12274 }
12275
12276
12277
12279 {
12281 }
12282
12283
12292 {
12293 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12294
12295 if (player)
12296 {
12297 player.MessageStatus(text);
12298 }
12299 }
12300
12301
12310 {
12311 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12312
12313 if (player)
12314 {
12315 player.MessageAction(text);
12316 }
12317 }
12318
12319
12328 {
12329 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12330
12331 if (player)
12332 {
12333 player.MessageFriendly(text);
12334 }
12335 }
12336
12337
12346 {
12347 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12348
12349 if (player)
12350 {
12351 player.MessageImportant(text);
12352 }
12353 }
12354
12356 {
12357 return true;
12358 }
12359
12360
12361 override bool KindOf(
string tag)
12362 {
12363 bool found = false;
12364 string item_name = this.
GetType();
12367
12368 int array_size = item_tag_array.Count();
12369 for (int i = 0; i < array_size; i++)
12370 {
12371 if (item_tag_array.Get(i) == tag)
12372 {
12373 found = true;
12374 break;
12375 }
12376 }
12377 return found;
12378 }
12379
12380
12382 {
12383
12384 super.OnRPC(sender, rpc_type,ctx);
12385
12386
12387 switch (rpc_type)
12388 {
12389 #ifndef SERVER
12390 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12391 Param2<bool, string> p = new Param2<bool, string>(false, "");
12392
12394 return;
12395
12396 bool play = p.param1;
12397 string soundSet = p.param2;
12398
12399 if (play)
12400 {
12402 {
12404 {
12406 }
12407 }
12408 else
12409 {
12411 }
12412 }
12413 else
12414 {
12416 }
12417
12418 break;
12419 #endif
12420
12421 }
12422
12424 {
12426 }
12427 }
12428
12429
12430
12431
12433 {
12434 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12435 return plugin.GetID(
name);
12436 }
12437
12439 {
12440 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12441 return plugin.GetName(id);
12442 }
12443
12446 {
12447
12448
12449 int varFlags;
12450 if (!ctx.
Read(varFlags))
12451 return;
12452
12453 if (varFlags & ItemVariableFlags.FLOAT)
12454 {
12456 }
12457 }
12458
12460 {
12461
12462 super.SerializeNumericalVars(floats_out);
12463
12464
12465
12467 {
12469 }
12470
12472 {
12474 }
12475
12477 {
12479 }
12480
12482 {
12487 }
12488
12490 {
12492 }
12493 }
12494
12496 {
12497
12498 super.DeSerializeNumericalVars(floats);
12499
12500
12501 int index = 0;
12502 int mask = Math.Round(floats.Get(index));
12503
12504 index++;
12505
12507 {
12509 {
12511 }
12512 else
12513 {
12514 float quantity = floats.Get(index);
12515 SetQuantity(quantity,
true,
false,
false,
false);
12516 }
12517 index++;
12518 }
12519
12521 {
12522 float wet = floats.Get(index);
12524 index++;
12525 }
12526
12528 {
12529 int liquidtype = Math.Round(floats.Get(index));
12531 index++;
12532 }
12533
12535 {
12537 index++;
12539 index++;
12541 index++;
12543 index++;
12544 }
12545
12547 {
12548 int cleanness = Math.Round(floats.Get(index));
12550 index++;
12551 }
12552 }
12553
12555 {
12556 super.WriteVarsToCTX(ctx);
12557
12558
12560 {
12562 }
12563
12565 {
12567 }
12568
12570 {
12572 }
12573
12575 {
12576 int r,g,b,a;
12582 }
12583
12585 {
12587 }
12588 }
12589
12591 {
12592 if (!super.ReadVarsFromCTX(ctx,version))
12593 return false;
12594
12595 int intValue;
12596 float value;
12597
12598 if (version < 140)
12599 {
12600 if (!ctx.
Read(intValue))
12601 return false;
12602
12603 m_VariablesMask = intValue;
12604 }
12605
12607 {
12608 if (!ctx.
Read(value))
12609 return false;
12610
12612 {
12614 }
12615 else
12616 {
12618 }
12619 }
12620
12621 if (version < 140)
12622 {
12624 {
12625 if (!ctx.
Read(value))
12626 return false;
12627 SetTemperatureDirect(value);
12628 }
12629 }
12630
12632 {
12633 if (!ctx.
Read(value))
12634 return false;
12636 }
12637
12639 {
12640 if (!ctx.
Read(intValue))
12641 return false;
12643 }
12644
12646 {
12647 int r,g,b,a;
12649 return false;
12651 return false;
12653 return false;
12655 return false;
12656
12658 }
12659
12661 {
12662 if (!ctx.
Read(intValue))
12663 return false;
12665 }
12666
12667 if (version >= 138 && version < 140)
12668 {
12670 {
12671 if (!ctx.
Read(intValue))
12672 return false;
12673 SetFrozen(intValue);
12674 }
12675 }
12676
12677 return true;
12678 }
12679
12680
12682 {
12685 {
12687 }
12688
12689 if (!super.OnStoreLoad(ctx, version))
12690 {
12692 return false;
12693 }
12694
12695 if (version >= 114)
12696 {
12697 bool hasQuickBarIndexSaved;
12698
12699 if (!ctx.
Read(hasQuickBarIndexSaved))
12700 {
12702 return false;
12703 }
12704
12705 if (hasQuickBarIndexSaved)
12706 {
12707 int itmQBIndex;
12708
12709
12710 if (!ctx.
Read(itmQBIndex))
12711 {
12713 return false;
12714 }
12715
12716 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12717 if (itmQBIndex != -1 && parentPlayer)
12718 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12719 }
12720 }
12721 else
12722 {
12723
12724 PlayerBase player;
12725 int itemQBIndex;
12726 if (version ==
int.
MAX)
12727 {
12728 if (!ctx.
Read(itemQBIndex))
12729 {
12731 return false;
12732 }
12733 }
12734 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12735 {
12736
12737 if (!ctx.
Read(itemQBIndex))
12738 {
12740 return false;
12741 }
12742 if (itemQBIndex != -1 && player)
12743 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12744 }
12745 }
12746
12747 if (version < 140)
12748 {
12749
12750 if (!LoadVariables(ctx, version))
12751 {
12753 return false;
12754 }
12755 }
12756
12757
12759 {
12761 return false;
12762 }
12763 if (version >= 132)
12764 {
12766 if (raib)
12767 {
12769 {
12771 return false;
12772 }
12773 }
12774 }
12775
12777 return true;
12778 }
12779
12780
12781
12783 {
12784 super.OnStoreSave(ctx);
12785
12786 PlayerBase player;
12787 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12788 {
12790
12791 int itemQBIndex = -1;
12792 itemQBIndex = player.FindQuickBarEntityIndex(this);
12793 ctx.
Write(itemQBIndex);
12794 }
12795 else
12796 {
12798 }
12799
12801
12803 if (raib)
12804 {
12806 }
12807 }
12808
12809
12811 {
12812 super.AfterStoreLoad();
12813
12815 {
12817 }
12818
12820 {
12823 }
12824 }
12825
12827 {
12828 super.EEOnAfterLoad();
12829
12831 {
12833 }
12834
12837 }
12838
12840 {
12841 return false;
12842 }
12843
12844
12845
12847 {
12849 {
12850 #ifdef PLATFORM_CONSOLE
12851
12853 {
12855 if (menu)
12856 {
12858 }
12859 }
12860 #endif
12861 }
12862
12864 {
12867 }
12868
12870 {
12871 SetWeightDirty();
12873 }
12875 {
12878 }
12879
12881 {
12884 }
12886 {
12889 }
12890
12891 super.OnVariablesSynchronized();
12892 }
12893
12894
12895
12897 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12898 {
12899 if (!IsServerCheck(allow_client))
12900 return false;
12901
12903 return false;
12904
12907
12908 if (value <= (min + 0.001))
12909 value = min;
12910
12911 if (value == min)
12912 {
12913 if (destroy_config)
12914 {
12915 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12916 if (dstr)
12917 {
12919 this.Delete();
12920 return true;
12921 }
12922 }
12923 else if (destroy_forced)
12924 {
12926 this.Delete();
12927 return true;
12928 }
12929
12931 }
12932
12935
12937 {
12939
12940 if (delta)
12942 }
12943
12945
12946 return false;
12947 }
12948
12949
12951 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12952 {
12954 }
12955
12957 {
12960 }
12961
12963 {
12966 }
12967
12969 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12970 {
12971 float value_clamped = Math.Clamp(value, 0, 1);
12973 SetQuantity(result, destroy_config, destroy_forced);
12974 }
12975
12976
12979 {
12981 }
12982
12984 {
12986 }
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12998 {
12999 int slot = -1;
13000 if (GetInventory())
13001 {
13002 InventoryLocation il = new InventoryLocation;
13003 GetInventory().GetCurrentInventoryLocation(il);
13005 }
13006
13008 }
13009
13011 {
13012 float quantity_max = 0;
13013
13015 {
13016 if (attSlotID != -1)
13017 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
13018
13019 if (quantity_max <= 0)
13021 }
13022
13023 if (quantity_max <= 0)
13025
13026 return quantity_max;
13027 }
13028
13030 {
13032 }
13033
13035 {
13037 }
13038
13039
13041 {
13043 }
13044
13046 {
13048 }
13049
13051 {
13053 }
13054
13055
13057 {
13058
13059 float weightEx = GetWeightEx();
13060 float special = GetInventoryAndCargoWeight();
13061 return weightEx - special;
13062 }
13063
13064
13066 {
13068 }
13069
13071 {
13073 {
13074 #ifdef DEVELOPER
13075 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13076 {
13077 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13079 }
13080 #endif
13081
13082 return GetQuantity() * GetConfigWeightModified();
13083 }
13084 else if (HasEnergyManager())
13085 {
13086 #ifdef DEVELOPER
13087 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13088 {
13089 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13090 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13091 }
13092 #endif
13093 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13094 }
13095 else
13096 {
13097 #ifdef DEVELOPER
13098 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13099 {
13100 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13101 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13102 }
13103 #endif
13104 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13105 }
13106 }
13107
13110 {
13111 int item_count = 0;
13113
13114 if (GetInventory().GetCargo() != NULL)
13115 {
13116 item_count = GetInventory().GetCargo().GetItemCount();
13117 }
13118
13119 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13120 {
13121 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13122 if (item)
13123 item_count += item.GetNumberOfItems();
13124 }
13125 return item_count;
13126 }
13127
13130 {
13131 float weight = 0;
13132 float wetness = 1;
13133 if (include_wetness)
13136 {
13137 weight = wetness * m_ConfigWeight;
13138 }
13140 {
13141 weight = 1;
13142 }
13143 return weight;
13144 }
13145
13146
13147
13149 {
13150 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13151 {
13152 GameInventory inv = GetInventory();
13153 array<EntityAI> items = new array<EntityAI>;
13155 for (int i = 0; i < items.Count(); i++)
13156 {
13158 if (item)
13159 {
13161 }
13162 }
13163 }
13164 }
13165
13166
13167
13168
13170 {
13171 float energy = 0;
13172 if (HasEnergyManager())
13173 {
13174 energy = GetCompEM().GetEnergy();
13175 }
13176 return energy;
13177 }
13178
13179
13181 {
13182 super.OnEnergyConsumed();
13183
13185 }
13186
13188 {
13189 super.OnEnergyAdded();
13190
13192 }
13193
13194
13196 {
13197 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13198 {
13200 {
13201 float energy_0to1 = GetCompEM().GetEnergy0To1();
13203 }
13204 }
13205 }
13206
13207
13209 {
13210 return ConfigGetFloat("heatIsolation");
13211 }
13212
13214 {
13216 }
13217
13219 {
13220 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13221 if (
GetGame().ConfigIsExisting(paramPath))
13223
13224 return 0.0;
13225 }
13226
13228 {
13229 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13230 if (
GetGame().ConfigIsExisting(paramPath))
13232
13233 return 0.0;
13234 }
13235
13236 override void SetWet(
float value,
bool allow_client =
false)
13237 {
13238 if (!IsServerCheck(allow_client))
13239 return;
13240
13243
13245
13246 m_VarWet = Math.Clamp(value, min, max);
13247
13249 {
13252 }
13253 }
13254
13255 override void AddWet(
float value)
13256 {
13258 }
13259
13261 {
13263 }
13264
13266 {
13268 }
13269
13271 {
13273 }
13274
13276 {
13278 }
13279
13281 {
13283 }
13284
13285 override void OnWetChanged(
float newVal,
float oldVal)
13286 {
13289 if (newLevel != oldLevel)
13290 {
13292 }
13293 }
13294
13296 {
13297 SetWeightDirty();
13298 }
13299
13301 {
13302 return GetWetLevelInternal(
m_VarWet);
13303 }
13304
13305
13306
13308 {
13310 }
13311
13313 {
13315 }
13316
13318 {
13320 }
13321
13323 {
13325 }
13326
13327
13328
13330 {
13331 if (ConfigIsExisting("itemModelLength"))
13332 {
13333 return ConfigGetFloat("itemModelLength");
13334 }
13335 return 0;
13336 }
13337
13339 {
13340 if (ConfigIsExisting("itemAttachOffset"))
13341 {
13342 return ConfigGetFloat("itemAttachOffset");
13343 }
13344 return 0;
13345 }
13346
13347 override void SetCleanness(
int value,
bool allow_client =
false)
13348 {
13349 if (!IsServerCheck(allow_client))
13350 return;
13351
13353
13355
13358 }
13359
13361 {
13363 }
13364
13366 {
13367 return true;
13368 }
13369
13370
13371
13372
13374 {
13376 }
13377
13379 {
13381 }
13382
13383
13384
13385
13386 override void SetColor(
int r,
int g,
int b,
int a)
13387 {
13393 }
13395 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13396 {
13401 }
13402
13404 {
13406 }
13407
13410 {
13411 int r,g,b,a;
13413 r = r/255;
13414 g = g/255;
13415 b = b/255;
13416 a = a/255;
13417 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13418 }
13419
13420
13421
13422 override void SetLiquidType(
int value,
bool allow_client =
false)
13423 {
13424 if (!IsServerCheck(allow_client))
13425 return;
13426
13431 }
13432
13434 {
13435 return ConfigGetInt("varLiquidTypeInit");
13436 }
13437
13439 {
13441 }
13442
13444 {
13446 SetFrozen(false);
13447 }
13448
13451 {
13452 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13453 }
13454
13455
13458 {
13459 PlayerBase nplayer;
13460 if (PlayerBase.CastTo(nplayer, player))
13461 {
13463
13464 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13465 }
13466 }
13467
13468
13471 {
13472 PlayerBase nplayer;
13473 if (PlayerBase.CastTo(nplayer,player))
13474 {
13475
13476 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13477
13478 }
13479
13480
13481 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13482
13483
13484 if (HasEnergyManager())
13485 {
13486 GetCompEM().UpdatePlugState();
13487 }
13488 }
13489
13490
13492 {
13493 super.OnPlacementStarted(player);
13494
13496 }
13497
13498 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13499 {
13501 {
13502 m_AdminLog.OnPlacementComplete(player,
this);
13503 }
13504
13505 super.OnPlacementComplete(player, position, orientation);
13506 }
13507
13508
13509
13510
13511
13513 {
13515 {
13516 return true;
13517 }
13518 else
13519 {
13520 return false;
13521 }
13522 }
13523
13524
13526 {
13528 {
13530 }
13531 }
13532
13533
13535 {
13537 }
13538
13540 {
13542 }
13543
13544 override void InsertAgent(
int agent,
float count = 1)
13545 {
13546 if (count < 1)
13547 return;
13548
13550 }
13551
13554 {
13556 }
13557
13558
13560 {
13562 }
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13606 {
13608 return false;
13609 return true;
13610 }
13611
13613 {
13614
13616 }
13617
13618
13621 {
13622 super.CheckForRoofLimited(timeTresholdMS);
13623
13625 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13626 {
13627 m_PreviousRoofTestTime = time;
13628 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13629 }
13630 }
13631
13632
13634 {
13636 {
13637 return 0;
13638 }
13639
13640 if (GetInventory().GetAttachmentSlotsCount() != 0)
13641 {
13642 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13643 if (filter)
13644 return filter.GetProtectionLevel(type, false, system);
13645 else
13646 return 0;
13647 }
13648
13649 string subclassPath, entryName;
13650
13651 switch (type)
13652 {
13654 entryName = "biological";
13655 break;
13657 entryName = "chemical";
13658 break;
13659 default:
13660 entryName = "biological";
13661 break;
13662 }
13663
13664 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13665
13667 }
13668
13669
13670
13673 {
13674 if (!IsMagazine())
13676
13678 }
13679
13680
13681
13682
13683
13688 {
13689 return true;
13690 }
13691
13693 {
13695 }
13696
13697
13698
13699
13700
13702 {
13703 if (parent)
13704 {
13705 if (parent.IsInherited(DayZInfected))
13706 return true;
13707
13708 if (!parent.IsRuined())
13709 return true;
13710 }
13711
13712 return true;
13713 }
13714
13716 {
13717 if (!super.CanPutAsAttachment(parent))
13718 {
13719 return false;
13720 }
13721
13722 if (!IsRuined() && !parent.IsRuined())
13723 {
13724 return true;
13725 }
13726
13727 return false;
13728 }
13729
13731 {
13732
13733
13734
13735
13736 return super.CanReceiveItemIntoCargo(item);
13737 }
13738
13740 {
13741
13742
13743
13744
13745 GameInventory attachmentInv = attachment.GetInventory();
13747 {
13748 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13749 return false;
13750 }
13751
13752 InventoryLocation loc = new InventoryLocation();
13753 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13754 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13755 return false;
13756
13757 return super.CanReceiveAttachment(attachment, slotId);
13758 }
13759
13761 {
13762 if (!super.CanReleaseAttachment(attachment))
13763 return false;
13764
13765 return GetInventory().AreChildrenAccessible();
13766 }
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13789 {
13790 int id = muzzle_owner.GetMuzzleID();
13791 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13792
13793 if (WPOF_array)
13794 {
13795 for (int i = 0; i < WPOF_array.Count(); i++)
13796 {
13797 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13798
13799 if (WPOF)
13800 {
13801 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13802 }
13803 }
13804 }
13805 }
13806
13807
13809 {
13810 int id = muzzle_owner.GetMuzzleID();
13812
13813 if (WPOBE_array)
13814 {
13815 for (int i = 0; i < WPOBE_array.Count(); i++)
13816 {
13817 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13818
13819 if (WPOBE)
13820 {
13821 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13822 }
13823 }
13824 }
13825 }
13826
13827
13829 {
13830 int id = muzzle_owner.GetMuzzleID();
13831 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13832
13833 if (WPOOH_array)
13834 {
13835 for (int i = 0; i < WPOOH_array.Count(); i++)
13836 {
13837 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13838
13839 if (WPOOH)
13840 {
13841 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13842 }
13843 }
13844 }
13845 }
13846
13847
13849 {
13850 int id = muzzle_owner.GetMuzzleID();
13851 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13852
13853 if (WPOOH_array)
13854 {
13855 for (int i = 0; i < WPOOH_array.Count(); i++)
13856 {
13857 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13858
13859 if (WPOOH)
13860 {
13861 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13862 }
13863 }
13864 }
13865 }
13866
13867
13869 {
13870 int id = muzzle_owner.GetMuzzleID();
13871 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13872
13873 if (WPOOH_array)
13874 {
13875 for (int i = 0; i < WPOOH_array.Count(); i++)
13876 {
13877 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13878
13879 if (WPOOH)
13880 {
13881 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13882 }
13883 }
13884 }
13885 }
13886
13887
13888
13890 {
13892 {
13893 return true;
13894 }
13895
13896 return false;
13897 }
13898
13900 {
13902 {
13903 return true;
13904 }
13905
13906 return false;
13907 }
13908
13910 {
13912 {
13913 return true;
13914 }
13915
13916 return false;
13917 }
13918
13920 {
13921 return false;
13922 }
13923
13926 {
13927 return UATimeSpent.DEFAULT_DEPLOY;
13928 }
13929
13930
13931
13932
13934 {
13936 SetSynchDirty();
13937 }
13938
13940 {
13942 }
13943
13944
13946 {
13947 return false;
13948 }
13949
13952 {
13953 string att_type = "None";
13954
13955 if (ConfigIsExisting("soundAttType"))
13956 {
13957 att_type = ConfigGetString("soundAttType");
13958 }
13959
13961 }
13962
13964 {
13966 }
13967
13968
13969
13970
13971
13977
13979 {
13982
13984 }
13985
13986
13988 {
13990 return;
13991
13993
13996
13999
14000 SoundParameters params = new SoundParameters();
14004 }
14005
14006
14008 {
14010 return;
14011
14013 SetSynchDirty();
14014
14017 }
14018
14019
14021 {
14023 return;
14024
14026 SetSynchDirty();
14027
14030 }
14031
14033 {
14035 }
14036
14038 {
14040 }
14041
14044 {
14045 if (!
GetGame().IsDedicatedServer())
14046 {
14047 if (ConfigIsExisting("attachSoundSet"))
14048 {
14049 string cfg_path = "";
14050 string soundset = "";
14051 string type_name =
GetType();
14052
14055 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
14056 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
14057
14058 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
14059 {
14060 for (int i = 0; i < cfg_soundset_array.Count(); i++)
14061 {
14062 if (cfg_slot_array[i] == slot_type)
14063 {
14064 soundset = cfg_soundset_array[i];
14065 break;
14066 }
14067 }
14068 }
14069
14070 if (soundset != "")
14071 {
14072 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14074 }
14075 }
14076 }
14077 }
14078
14080 {
14081
14082 }
14083
14084 void OnApply(PlayerBase player);
14085
14087 {
14088 return 1.0;
14089 };
14090
14092 {
14094 }
14095
14097 {
14099 }
14100
14102
14104 {
14105 SetDynamicPhysicsLifeTime(0.01);
14107 }
14108
14110 {
14111 array<string> zone_names = new array<string>;
14112 GetDamageZones(zone_names);
14113 for (int i = 0; i < zone_names.Count(); i++)
14114 {
14115 SetHealthMax(zone_names.Get(i),"Health");
14116 }
14117 SetHealthMax("","Health");
14118 }
14119
14122 {
14123 float global_health = GetHealth01("","Health");
14124 array<string> zones = new array<string>;
14125 GetDamageZones(zones);
14126
14127 for (int i = 0; i < zones.Count(); i++)
14128 {
14129 SetHealth01(zones.Get(i),"Health",global_health);
14130 }
14131 }
14132
14135 {
14136 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14137 }
14138
14140 {
14141 if (!hasRootAsPlayer)
14142 {
14143 if (refParentIB)
14144 {
14145
14146 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14147 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14148
14149 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14150 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14151
14154 }
14155 else
14156 {
14157
14160 }
14161 }
14162 }
14163
14165 {
14167 {
14168 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14169 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14170 {
14171 float heatPermCoef = 1.0;
14173 while (ent)
14174 {
14175 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14176 ent = ent.GetHierarchyParent();
14177 }
14178
14179 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14180 }
14181 }
14182 }
14183
14185 {
14186
14187 EntityAI parent = GetHierarchyParent();
14188 if (!parent)
14189 {
14190 hasParent = false;
14191 hasRootAsPlayer = false;
14192 }
14193 else
14194 {
14195 hasParent = true;
14196 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14197 refParentIB =
ItemBase.Cast(parent);
14198 }
14199 }
14200
14201 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14202 {
14203
14204 }
14205
14207 {
14208
14209 return false;
14210 }
14211
14213 {
14214
14215
14216 return false;
14217 }
14218
14220 {
14221
14222 return false;
14223 }
14224
14227 {
14228 return !GetIsFrozen() &&
IsOpen();
14229 }
14230
14232 {
14233 bool hasParent = false, hasRootAsPlayer = false;
14235
14236 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14237 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14238
14239 if (wwtu || foodDecay)
14240 {
14244
14245 if (processWetness || processTemperature || processDecay)
14246 {
14248
14249 if (processWetness)
14250 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14251
14252 if (processTemperature)
14254
14255 if (processDecay)
14256 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14257 }
14258 }
14259 }
14260
14263 {
14265 }
14266
14268 {
14271
14272 return super.GetTemperatureFreezeThreshold();
14273 }
14274
14276 {
14279
14280 return super.GetTemperatureThawThreshold();
14281 }
14282
14284 {
14287
14288 return super.GetItemOverheatThreshold();
14289 }
14290
14292 {
14294 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14295
14296 return super.GetTemperatureFreezeTime();
14297 }
14298
14300 {
14302 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14303
14304 return super.GetTemperatureThawTime();
14305 }
14306
14311
14313 {
14314 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14315 }
14316
14318 {
14319 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14320 }
14321
14324 {
14326 }
14327
14329 {
14331 }
14332
14334 {
14336 }
14337
14340 {
14341 return null;
14342 }
14343
14346 {
14347 return false;
14348 }
14349
14351 {
14353 {
14356 if (!trg)
14357 {
14359 explosive = this;
14360 }
14361
14362 explosive.PairRemote(trg);
14364
14365 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14366 trg.SetPersistentPairID(persistentID);
14367 explosive.SetPersistentPairID(persistentID);
14368
14369 return true;
14370 }
14371 return false;
14372 }
14373
14376 {
14377 float ret = 1.0;
14380 ret *= GetHealth01();
14381
14382 return ret;
14383 }
14384
14385 #ifdef DEVELOPER
14386 override void SetDebugItem()
14387 {
14388 super.SetDebugItem();
14389 _itemBase = this;
14390 }
14391
14393 {
14394 string text = super.GetDebugText();
14395
14397 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14398
14399 return text;
14400 }
14401 #endif
14402
14404 {
14405 return true;
14406 }
14407
14409
14411
14413 {
14416 }
14417
14418
14426
14442}
14443
14445{
14447 if (entity)
14448 {
14449 bool is_item = entity.IsInherited(
ItemBase);
14450 if (is_item && full_quantity)
14451 {
14454 }
14455 }
14456 else
14457 {
14459 return NULL;
14460 }
14461 return entity;
14462}
14463
14465{
14466 if (item)
14467 {
14468 if (health > 0)
14469 item.SetHealth("", "", health);
14470
14471 if (item.CanHaveTemperature())
14472 {
14474 if (item.CanFreeze())
14475 item.SetFrozen(false);
14476 }
14477
14478 if (item.HasEnergyManager())
14479 {
14480 if (quantity >= 0)
14481 {
14482 item.GetCompEM().SetEnergy0To1(quantity);
14483 }
14484 else
14485 {
14487 }
14488 }
14489 else if (item.IsMagazine())
14490 {
14491 Magazine mag = Magazine.Cast(item);
14492 if (quantity >= 0)
14493 {
14494 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14495 }
14496 else
14497 {
14499 }
14500
14501 }
14502 else
14503 {
14504 if (quantity >= 0)
14505 {
14506 item.SetQuantityNormalized(quantity, false);
14507 }
14508 else
14509 {
14511 }
14512
14513 }
14514 }
14515}
14516
14517#ifdef DEVELOPER
14519#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.