9658{
9660 {
9661 return true;
9662 }
9663};
9664
9665
9666
9668{
9672
9674
9677
9678
9679
9680
9681
9690
9696
9701
9706
9727 protected bool m_IsResultOfSplit
9728
9730
9735
9736
9737
9739
9743
9744
9745
9747
9750
9751
9752
9758
9759
9767
9770
9771
9773
9774
9776
9777
9782
9783
9788
9789
9791
9792
9794 {
9799
9800 if (!
GetGame().IsDedicatedServer())
9801 {
9803 {
9805
9807 {
9809 }
9810 }
9811
9814 }
9815
9816 m_OldLocation = null;
9817
9819 {
9821 }
9822
9823 if (ConfigIsExisting("headSelectionsToHide"))
9824 {
9827 }
9828
9830 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9831 {
9833 }
9834
9836
9837 m_IsResultOfSplit = false;
9838
9840 }
9841
9843 {
9844 super.InitItemVariables();
9845
9851 m_Count = ConfigGetInt(
"count");
9852
9855
9860
9863
9868
9880
9884
9885
9888 if (ConfigIsExisting("canBeSplit"))
9889 {
9892 }
9893
9895 if (ConfigIsExisting("itemBehaviour"))
9897
9898
9901 RegisterNetSyncVariableInt("m_VarLiquidType");
9902 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9903
9904 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9905 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9906 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9907
9908 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9909 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9910 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9911 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9912
9913 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9914 RegisterNetSyncVariableBool("m_IsTakeable");
9915 RegisterNetSyncVariableBool("m_IsHologram");
9916
9919 {
9922 }
9923
9925
9927 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9929
9930 }
9931
9933 {
9935 }
9936
9938 {
9941 {
9946 }
9947 }
9948
9949 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9950 {
9952 {
9955 }
9956
9958 }
9959
9961 {
9967 }
9968
9970
9972 {
9974
9975 if (!action)
9976 {
9977 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9978 return;
9979 }
9980
9982 if (!ai)
9983 {
9985 return;
9986 }
9987
9989 if (!action_array)
9990 {
9991 action_array = new array<ActionBase_Basic>;
9993 }
9994 if (LogManager.IsActionLogEnable())
9995 {
9996 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9997 }
9998
9999 if (action_array.Find(action) != -1)
10000 {
10001 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
10002 }
10003 else
10004 {
10005 action_array.Insert(action);
10006 }
10007 }
10008
10010 {
10012 ActionBase action = player.GetActionManager().GetAction(actionName);
10015
10016 if (action_array)
10017 {
10018 action_array.RemoveItem(action);
10019 }
10020 }
10021
10022
10023
10025 {
10026 ActionOverrideData overrideData = new ActionOverrideData();
10030
10032 if (!actionMap)
10033 {
10036 }
10037
10038 actionMap.Insert(this.
Type(), overrideData);
10039
10040 }
10041
10043
10045
10046
10048 {
10051
10054
10055 string config_to_search = "CfgVehicles";
10056 string muzzle_owner_config;
10057
10059 {
10060 if (IsInherited(Weapon))
10061 config_to_search = "CfgWeapons";
10062
10063 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10064
10065 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
10066
10068
10069 if (config_OnFire_subclass_count > 0)
10070 {
10071 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
10072
10073 for (int i = 0; i < config_OnFire_subclass_count; i++)
10074 {
10075 string particle_class = "";
10077 string config_OnFire_entry = config_OnFire_class + particle_class;
10078 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
10079 WPOF_array.Insert(WPOF);
10080 }
10081
10082
10084 }
10085 }
10086
10088 {
10089 config_to_search = "CfgWeapons";
10090 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10091
10092 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
10093
10095
10096 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
10097 {
10098 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
10099
10100 for (i = 0; i < config_OnBulletCasingEject_count; i++)
10101 {
10102 string particle_class2 = "";
10104 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
10105 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
10106 WPOBE_array.Insert(WPOBE);
10107 }
10108
10109
10111 }
10112 }
10113 }
10114
10115
10117 {
10120
10122 {
10123 string config_to_search = "CfgVehicles";
10124
10125 if (IsInherited(Weapon))
10126 config_to_search = "CfgWeapons";
10127
10128 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10129 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10130
10131 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10132 {
10133
10135
10137 {
10139 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10141 return;
10142 }
10143
10146
10147
10148
10150 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10151
10152 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10153 {
10154 string particle_class = "";
10156 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10158
10159 if (entry_type == CT_CLASS)
10160 {
10161 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10162 WPOOH_array.Insert(WPOF);
10163 }
10164 }
10165
10166
10168 }
10169 }
10170 }
10171
10173 {
10175 }
10176
10178 {
10180 {
10182
10185
10188
10189 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10190 }
10191 }
10192
10194 {
10196 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10197
10199 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10200
10202 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10203
10205 {
10207 }
10208 }
10209
10211 {
10213 }
10214
10216 {
10219 else
10221
10223 {
10226 }
10227 else
10228 {
10231
10234 }
10235
10237 }
10238
10240 {
10242 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10243 }
10244
10246 {
10248 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10250 }
10251
10253 {
10255 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10256 }
10257
10259 {
10262
10263 OverheatingParticle OP = new OverheatingParticle();
10268
10270 }
10271
10273 {
10276
10277 return -1;
10278 }
10279
10281 {
10283 {
10286
10287 for (int i = count; i > 0; --i)
10288 {
10289 int id = i - 1;
10292
10295
10296 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10297 {
10298 if (p)
10299 {
10302 }
10303 }
10304 }
10305 }
10306 }
10307
10309 {
10311 {
10313 {
10314 int id = i - 1;
10316
10317 if (OP)
10318 {
10320
10321 if (p)
10322 {
10324 }
10325
10326 delete OP;
10327 }
10328 }
10329
10332 }
10333 }
10334
10337 {
10338 return 0.0;
10339 }
10340
10341
10343 {
10344 return 250;
10345 }
10346
10348 {
10349 return 0;
10350 }
10351
10354 {
10356 return true;
10357
10358 return false;
10359 }
10360
10363 {
10366
10368 {
10370 }
10371 else
10372 {
10373
10375 }
10376
10378 }
10379
10386 {
10387 return -1;
10388 }
10389
10390
10391
10392
10394 {
10396 {
10398 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10399
10400 if (r_index >= 0)
10401 {
10402 InventoryLocation r_il = new InventoryLocation;
10403 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10404
10405 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10408 {
10409 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10410 }
10412 {
10413 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10414 }
10415
10416 }
10417
10418 player.GetHumanInventory().ClearUserReservedLocation(this);
10419 }
10420
10423 }
10424
10425
10426
10427
10429 {
10430 return ItemBase.m_DebugActionsMask;
10431 }
10432
10434 {
10435 return ItemBase.m_DebugActionsMask & mask;
10436 }
10437
10439 {
10440 ItemBase.m_DebugActionsMask = mask;
10441 }
10442
10444 {
10445 ItemBase.m_DebugActionsMask |= mask;
10446 }
10447
10449 {
10450 ItemBase.m_DebugActionsMask &= ~mask;
10451 }
10452
10454 {
10456 {
10458 }
10459 else
10460 {
10462 }
10463 }
10464
10465
10467 {
10468 if (GetEconomyProfile())
10469 {
10470 float q_max = GetEconomyProfile().GetQuantityMax();
10471 if (q_max > 0)
10472 {
10473 float q_min = GetEconomyProfile().GetQuantityMin();
10474 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10475
10477 {
10478 ComponentEnergyManager comp = GetCompEM();
10480 {
10482 }
10483 }
10485 {
10487
10488 }
10489
10490 }
10491 }
10492 }
10493
10496 {
10497 EntityAI parent = GetHierarchyParent();
10498
10499 if (parent)
10500 {
10501 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10502 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10503 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10504 }
10505 }
10506
10509 {
10510 EntityAI parent = GetHierarchyParent();
10511
10512 if (parent)
10513 {
10514 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10515 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10516 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10517 }
10518 }
10519
10521 {
10522
10523
10524
10525
10527
10529 {
10530 if (ScriptInputUserData.CanStoreInputUserData())
10531 {
10532 ScriptInputUserData ctx = new ScriptInputUserData;
10538 ctx.
Write(use_stack_max);
10541
10543 {
10544 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10545 }
10546 }
10547 }
10548 else if (!
GetGame().IsMultiplayer())
10549 {
10551 }
10552 }
10553
10555 {
10557 }
10558
10560 {
10562 }
10563
10565 {
10567 }
10568
10570 {
10571
10572 return false;
10573 }
10574
10576 {
10577 return false;
10578 }
10579
10583 {
10584 return false;
10585 }
10586
10588 {
10589 return "";
10590 }
10591
10593
10595 {
10596 return false;
10597 }
10598
10600 {
10601 return true;
10602 }
10603
10604
10605
10607 {
10608 return true;
10609 }
10610
10612 {
10613 return true;
10614 }
10615
10617 {
10618 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10620 }
10621
10623 {
10625 }
10626
10628 {
10630 if (!is_being_placed)
10632 SetSynchDirty();
10633 }
10634
10635
10637
10639 {
10641 }
10642
10644 {
10646 }
10647
10649 {
10650 return 1;
10651 }
10652
10654 {
10655 return false;
10656 }
10657
10659 {
10661 SetSynchDirty();
10662 }
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10699 {
10700 super.OnMovedInsideCargo(container);
10701
10702 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10703 }
10704
10705 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10706 {
10707 super.EEItemLocationChanged(oldLoc,newLoc);
10708
10709 PlayerBase new_player = null;
10710 PlayerBase old_player = null;
10711
10712 if (newLoc.GetParent())
10713 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10714
10715 if (oldLoc.GetParent())
10716 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10717
10719 {
10720 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10721
10722 if (r_index >= 0)
10723 {
10724 InventoryLocation r_il = new InventoryLocation;
10725 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10726
10727 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10730 {
10731 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10732 }
10734 {
10735 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10736 }
10737
10738 }
10739 }
10740
10742 {
10743 if (new_player)
10744 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10745
10746 if (new_player == old_player)
10747 {
10748
10749 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10750 {
10752 {
10753 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10754 {
10755 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10756 }
10757 }
10758 else
10759 {
10760 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10761 }
10762 }
10763
10764 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10765 {
10766 int type = oldLoc.GetType();
10768 {
10769 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10770 }
10772 {
10773 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10774 }
10775 }
10776 if (!m_OldLocation)
10777 {
10778 m_OldLocation = new InventoryLocation;
10779 }
10780 m_OldLocation.Copy(oldLoc);
10781 }
10782 else
10783 {
10784 if (m_OldLocation)
10785 {
10786 m_OldLocation.Reset();
10787 }
10788 }
10789
10791 }
10792 else
10793 {
10794 if (new_player)
10795 {
10796 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10797 if (res_index >= 0)
10798 {
10799 InventoryLocation il = new InventoryLocation;
10800 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10802 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10805 {
10806 il.
GetParent().GetOnReleaseLock().Invoke(it);
10807 }
10809 {
10811 }
10812
10813 }
10814 }
10816 {
10817
10819 }
10820
10821 if (m_OldLocation)
10822 {
10823 m_OldLocation.Reset();
10824 }
10825 }
10826 }
10827
10828 override void EOnContact(IEntity other, Contact extra)
10829 {
10831 {
10832 int liquidType = -1;
10834 if (impactSpeed > 0.0)
10835 {
10837 #ifndef SERVER
10839 #else
10841 SetSynchDirty();
10842 #endif
10844 }
10845 }
10846
10847 #ifdef SERVER
10848 if (GetCompEM() && GetCompEM().IsPlugged())
10849 {
10850 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10851 GetCompEM().UnplugThis();
10852 }
10853 #endif
10854 }
10855
10857
10859 {
10861 }
10862
10864 {
10865
10866 }
10867
10869 {
10870 super.OnItemLocationChanged(old_owner, new_owner);
10871
10872 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10873 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10874
10875 if (!relatedPlayer && playerNew)
10876 relatedPlayer = playerNew;
10877
10878 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10879 {
10881 if (actionMgr)
10882 {
10883 ActionBase currentAction = actionMgr.GetRunningAction();
10884 if (currentAction)
10886 }
10887 }
10888
10889 Man ownerPlayerOld = null;
10890 Man ownerPlayerNew = null;
10891
10892 if (old_owner)
10893 {
10894 if (old_owner.
IsMan())
10895 {
10896 ownerPlayerOld = Man.Cast(old_owner);
10897 }
10898 else
10899 {
10900 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10901 }
10902 }
10903 else
10904 {
10906 {
10908
10909 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10910 {
10911 GetCompEM().UnplugThis();
10912 }
10913 }
10914 }
10915
10916 if (new_owner)
10917 {
10918 if (new_owner.
IsMan())
10919 {
10920 ownerPlayerNew = Man.Cast(new_owner);
10921 }
10922 else
10923 {
10924 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10925 }
10926 }
10927
10928 if (ownerPlayerOld != ownerPlayerNew)
10929 {
10930 if (ownerPlayerOld)
10931 {
10932 array<EntityAI> subItemsExit = new array<EntityAI>;
10934 for (int i = 0; i < subItemsExit.Count(); i++)
10935 {
10938 }
10939 }
10940
10941 if (ownerPlayerNew)
10942 {
10943 array<EntityAI> subItemsEnter = new array<EntityAI>;
10945 for (int j = 0; j < subItemsEnter.Count(); j++)
10946 {
10949 }
10950 }
10951 }
10952 else if (ownerPlayerNew != null)
10953 {
10954 PlayerBase nplayer;
10955 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10956 {
10957 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10959 for (int k = 0; k < subItemsUpdate.Count(); k++)
10960 {
10962 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10963 }
10964 }
10965 }
10966
10967 if (old_owner)
10968 old_owner.OnChildItemRemoved(this);
10969 if (new_owner)
10970 new_owner.OnChildItemReceived(this);
10971 }
10972
10973
10975 {
10976 super.EEDelete(parent);
10977 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10978 if (player)
10979 {
10981
10982 if (player.IsAlive())
10983 {
10984 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10985 if (r_index >= 0)
10986 {
10987 InventoryLocation r_il = new InventoryLocation;
10988 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10989
10990 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10993 {
10994 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10995 }
10997 {
10998 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10999 }
11000
11001 }
11002
11003 player.RemoveQuickBarEntityShortcut(this);
11004 }
11005 }
11006 }
11007
11009 {
11010 super.EEKilled(killer);
11011
11014 {
11015 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
11016 {
11017 if (IsMagazine())
11018 {
11019 if (Magazine.Cast(this).GetAmmoCount() > 0)
11020 {
11022 }
11023 }
11024 else
11025 {
11027 }
11028 }
11029 }
11030 }
11031
11033 {
11034 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
11035
11036 super.OnWasAttached(parent, slot_id);
11037
11040
11042 }
11043
11045 {
11046 super.OnWasDetached(parent, slot_id);
11047
11050 }
11051
11053 {
11054 int idx;
11057
11058 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11059 if (inventory_slots.Count() < 1)
11060 {
11061 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
11062 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
11063 }
11064 else
11065 {
11066 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
11067 }
11068
11069 idx = inventory_slots.Find(slot);
11070 if (idx < 0)
11071 return "";
11072
11073 return attach_types.Get(idx);
11074 }
11075
11077 {
11078 int idx = -1;
11079 string slot;
11080
11083
11084 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11085 if (inventory_slots.Count() < 1)
11086 {
11087 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
11088 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11089 }
11090 else
11091 {
11092 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
11093 if (detach_types.Count() < 1)
11094 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11095 }
11096
11097 for (int i = 0; i < inventory_slots.Count(); i++)
11098 {
11099 slot = inventory_slots.Get(i);
11100 }
11101
11102 if (slot != "")
11103 {
11104 if (detach_types.Count() == 1)
11105 idx = 0;
11106 else
11107 idx = inventory_slots.Find(slot);
11108 }
11109 if (idx < 0)
11110 return "";
11111
11112 return detach_types.Get(idx);
11113 }
11114
11116 {
11117
11119
11120
11121 float min_time = 1;
11122 float max_time = 3;
11123 float delay = Math.RandomFloat(min_time, max_time);
11124
11125 explode_timer.Run(delay, this, "DoAmmoExplosion");
11126 }
11127
11129 {
11130 Magazine magazine = Magazine.Cast(this);
11131 int pop_sounds_count = 6;
11132 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11133
11134
11135 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11136 string sound_name = pop_sounds[ sound_idx ];
11138
11139
11140 magazine.ServerAddAmmoCount(-1);
11141
11142
11143 float min_temp_to_explode = 100;
11144
11145 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11146 {
11148 }
11149 }
11150
11151
11152 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11153 {
11154 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11155
11156 const int CHANCE_DAMAGE_CARGO = 4;
11157 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11158 const int CHANCE_DAMAGE_NOTHING = 2;
11159
11161 {
11162 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11163 int chances;
11164 int rnd;
11165
11166 if (GetInventory().GetCargo())
11167 {
11168 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11169 rnd = Math.RandomInt(0,chances);
11170
11171 if (rnd < CHANCE_DAMAGE_CARGO)
11172 {
11174 }
11175 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11176 {
11178 }
11179 }
11180 else
11181 {
11182 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11183 rnd = Math.RandomInt(0,chances);
11184
11185 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11186 {
11188 }
11189 }
11190 }
11191 }
11192
11194 {
11195 if (GetInventory().GetCargo())
11196 {
11197 int item_count = GetInventory().GetCargo().GetItemCount();
11198 if (item_count > 0)
11199 {
11200 int random_pick = Math.RandomInt(0, item_count);
11202 if (!item.IsExplosive())
11203 {
11204 item.AddHealth("","",damage);
11205 return true;
11206 }
11207 }
11208 }
11209 return false;
11210 }
11211
11213 {
11214 int attachment_count = GetInventory().AttachmentCount();
11215 if (attachment_count > 0)
11216 {
11217 int random_pick = Math.RandomInt(0, attachment_count);
11218 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11219 if (!attachment.IsExplosive())
11220 {
11221 attachment.AddHealth("","",damage);
11222 return true;
11223 }
11224 }
11225 return false;
11226 }
11227
11229 {
11231 }
11232
11234 {
11236 return GetInventory().CanRemoveEntity();
11237
11238 return false;
11239 }
11240
11242 {
11243
11245 return false;
11246
11247
11249 return false;
11250
11251
11252
11254 if (delta == 0)
11255 return false;
11256
11257
11258 return true;
11259 }
11260
11262 {
11264 {
11265 if (ScriptInputUserData.CanStoreInputUserData())
11266 {
11267 ScriptInputUserData ctx = new ScriptInputUserData;
11272 ctx.
Write(destination_entity);
11274 ctx.
Write(slot_id);
11276 }
11277 }
11278 else if (!
GetGame().IsMultiplayer())
11279 {
11281 }
11282 }
11283
11285 {
11286 float split_quantity_new;
11290 InventoryLocation loc = new InventoryLocation;
11291
11292 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11293 {
11295 split_quantity_new = stack_max;
11296 else
11298
11300 {
11301 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11302 if (new_item)
11303 {
11304 new_item.SetResultOfSplit(true);
11305 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11307 new_item.
SetQuantity(split_quantity_new,
false,
true);
11308 }
11309 }
11310 }
11311 else if (destination_entity && slot_id == -1)
11312 {
11313 if (quantity > stack_max)
11314 split_quantity_new = stack_max;
11315 else
11316 split_quantity_new = quantity;
11317
11319 {
11321 {
11324 }
11325
11326 if (new_item)
11327 {
11328 new_item.SetResultOfSplit(true);
11329 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11331 new_item.
SetQuantity(split_quantity_new,
false,
true);
11332 }
11333 }
11334 }
11335 else
11336 {
11337 if (stack_max != 0)
11338 {
11340 {
11342 }
11343
11344 if (split_quantity_new == 0)
11345 {
11346 if (!
GetGame().IsMultiplayer())
11347 player.PhysicalPredictiveDropItem(this);
11348 else
11349 player.ServerDropEntity(this);
11350 return;
11351 }
11352
11354 {
11356
11357 if (new_item)
11358 {
11359 new_item.SetResultOfSplit(true);
11360 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11363 new_item.PlaceOnSurface();
11364 }
11365 }
11366 }
11367 }
11368 }
11369
11371 {
11372 float split_quantity_new;
11376 InventoryLocation loc = new InventoryLocation;
11377
11378 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11379 {
11381 split_quantity_new = stack_max;
11382 else
11384
11386 {
11387 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11388 if (new_item)
11389 {
11390 new_item.SetResultOfSplit(true);
11391 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11393 new_item.
SetQuantity(split_quantity_new,
false,
true);
11394 }
11395 }
11396 }
11397 else if (destination_entity && slot_id == -1)
11398 {
11399 if (quantity > stack_max)
11400 split_quantity_new = stack_max;
11401 else
11402 split_quantity_new = quantity;
11403
11405 {
11407 {
11410 }
11411
11412 if (new_item)
11413 {
11414 new_item.SetResultOfSplit(true);
11415 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11417 new_item.
SetQuantity(split_quantity_new,
false,
true);
11418 }
11419 }
11420 }
11421 else
11422 {
11423 if (stack_max != 0)
11424 {
11426 {
11428 }
11429
11431 {
11433
11434 if (new_item)
11435 {
11436 new_item.SetResultOfSplit(true);
11437 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11440 new_item.PlaceOnSurface();
11441 }
11442 }
11443 }
11444 }
11445 }
11446
11448 {
11450 {
11451 if (ScriptInputUserData.CanStoreInputUserData())
11452 {
11453 ScriptInputUserData ctx = new ScriptInputUserData;
11458 dst.WriteToContext(ctx);
11460 }
11461 }
11462 else if (!
GetGame().IsMultiplayer())
11463 {
11465 }
11466 }
11467
11469 {
11471 {
11472 if (ScriptInputUserData.CanStoreInputUserData())
11473 {
11474 ScriptInputUserData ctx = new ScriptInputUserData;
11479 ctx.
Write(destination_entity);
11485 }
11486 }
11487 else if (!
GetGame().IsMultiplayer())
11488 {
11490 }
11491 }
11492
11494 {
11496 }
11497
11499 {
11501 float split_quantity_new;
11503 if (dst.IsValid())
11504 {
11505 int slot_id = dst.GetSlot();
11507
11508 if (quantity > stack_max)
11509 split_quantity_new = stack_max;
11510 else
11511 split_quantity_new = quantity;
11512
11514 {
11516
11517 if (new_item)
11518 {
11519 new_item.SetResultOfSplit(true);
11520 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11522 new_item.
SetQuantity(split_quantity_new,
false,
true);
11523 }
11524
11525 return new_item;
11526 }
11527 }
11528
11529 return null;
11530 }
11531
11533 {
11535 float split_quantity_new;
11537 if (destination_entity)
11538 {
11540 if (quantity > stackable)
11541 split_quantity_new = stackable;
11542 else
11543 split_quantity_new = quantity;
11544
11546 {
11547 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11548 if (new_item)
11549 {
11550 new_item.SetResultOfSplit(true);
11551 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11553 new_item.
SetQuantity(split_quantity_new,
false,
true);
11554 }
11555 }
11556 }
11557 }
11558
11560 {
11562 {
11563 if (ScriptInputUserData.CanStoreInputUserData())
11564 {
11565 ScriptInputUserData ctx = new ScriptInputUserData;
11570 ItemBase destination_entity =
this;
11571 ctx.
Write(destination_entity);
11575 }
11576 }
11577 else if (!
GetGame().IsMultiplayer())
11578 {
11580 }
11581 }
11582
11584 {
11586 float split_quantity_new;
11588 if (player)
11589 {
11591 if (quantity > stackable)
11592 split_quantity_new = stackable;
11593 else
11594 split_quantity_new = quantity;
11595
11597 {
11598 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11599 new_item =
ItemBase.Cast(in_hands);
11600 if (new_item)
11601 {
11602 new_item.SetResultOfSplit(true);
11603 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11605 new_item.SetQuantity(split_quantity_new, false, true);
11606 }
11607 }
11608 }
11609 }
11610
11612 {
11614 float split_quantity_new = Math.Floor(quantity * 0.5);
11615
11617 return;
11618
11620
11621 if (new_item)
11622 {
11623 if (new_item.GetQuantityMax() < split_quantity_new)
11624 {
11625 split_quantity_new = new_item.GetQuantityMax();
11626 }
11627
11628 new_item.SetResultOfSplit(true);
11629 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11630
11632 {
11635 }
11636 else
11637 {
11639 new_item.
SetQuantity(split_quantity_new,
false,
true);
11640 }
11641 }
11642 }
11643
11645 {
11647 float split_quantity_new = Math.Floor(quantity / 2);
11648
11650 return;
11651
11652 InventoryLocation invloc = new InventoryLocation;
11654
11656 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11657
11658 if (new_item)
11659 {
11660 if (new_item.GetQuantityMax() < split_quantity_new)
11661 {
11662 split_quantity_new = new_item.GetQuantityMax();
11663 }
11665 {
11668 }
11669 else if (split_quantity_new > 1)
11670 {
11672 new_item.
SetQuantity(split_quantity_new,
false,
true);
11673 }
11674 }
11675 }
11676
11679 {
11680 SetWeightDirty();
11682
11683 if (parent)
11684 parent.OnAttachmentQuantityChangedEx(this, delta);
11685
11687 {
11689 {
11691 }
11693 {
11694 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11696 }
11697 }
11698
11699 }
11700
11703 {
11704
11705 }
11706
11709 {
11711 }
11712
11714 {
11715 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11716
11718 {
11719 if (newLevel == GameConstants.STATE_RUINED)
11720 {
11722 EntityAI parent = GetHierarchyParent();
11723 if (parent && parent.IsFireplace())
11724 {
11725 CargoBase cargo = GetInventory().GetCargo();
11726 if (cargo)
11727 {
11729 {
11731 }
11732 }
11733 }
11734 }
11735
11737 {
11738
11740 return;
11741 }
11742
11743 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11744 {
11746 }
11747 }
11748 }
11749
11750
11752 {
11753 super.OnRightClick();
11754
11756 {
11758 {
11759 if (ScriptInputUserData.CanStoreInputUserData())
11760 {
11761 EntityAI root = GetHierarchyRoot();
11762 Man playerOwner = GetHierarchyRootPlayer();
11763 InventoryLocation dst = new InventoryLocation;
11764
11765
11766 if (!playerOwner && root && root == this)
11767 {
11769 }
11770 else
11771 {
11772
11773 GetInventory().GetCurrentInventoryLocation(dst);
11775 {
11778 {
11780 }
11781 else
11782 {
11784
11785
11786 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11787 {
11789 }
11790 else
11791 {
11792 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11793 }
11794 }
11795 }
11796 }
11797
11798 ScriptInputUserData ctx = new ScriptInputUserData;
11806 }
11807 }
11808 else if (!
GetGame().IsMultiplayer())
11809 {
11811 }
11812 }
11813 }
11814
11816 {
11817 if (root)
11818 {
11819 vector m4[4];
11820 root.GetTransform(m4);
11821 dst.SetGround(this, m4);
11822 }
11823 else
11824 {
11825 GetInventory().GetCurrentInventoryLocation(dst);
11826 }
11827 }
11828
11829 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11830 {
11831
11832 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11833 return false;
11834
11835 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11836 return false;
11837
11838
11840 return false;
11841
11842
11843 Magazine mag = Magazine.Cast(this);
11844 if (mag)
11845 {
11846 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11847 return false;
11848
11849 if (stack_max_limit)
11850 {
11851 Magazine other_mag = Magazine.Cast(other_item);
11852 if (other_item)
11853 {
11854 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11855 return false;
11856 }
11857
11858 }
11859 }
11860 else
11861 {
11862
11864 return false;
11865
11867 return false;
11868 }
11869
11870 PlayerBase player = null;
11871 if (CastTo(player, GetHierarchyRootPlayer()))
11872 {
11873 if (player.GetInventory().HasAttachment(this))
11874 return false;
11875
11876 if (player.IsItemsToDelete())
11877 return false;
11878 }
11879
11880 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11881 return false;
11882
11883 int slotID;
11885 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11886 return false;
11887
11888 return true;
11889 }
11890
11892 {
11894 }
11895
11897 {
11898 return m_IsResultOfSplit;
11899 }
11900
11902 {
11903 m_IsResultOfSplit = value;
11904 }
11905
11907 {
11909 }
11910
11912 {
11913 float other_item_quantity = other_item.GetQuantity();
11914 float this_free_space;
11915
11917
11919
11920 if (other_item_quantity > this_free_space)
11921 {
11922 return this_free_space;
11923 }
11924 else
11925 {
11926 return other_item_quantity;
11927 }
11928 }
11929
11931 {
11933 }
11934
11936 {
11938 return;
11939
11940 if (!IsMagazine() && other_item)
11941 {
11943 if (quantity_used != 0)
11944 {
11945 float hp1 = GetHealth01("","");
11946 float hp2 = other_item.GetHealth01("","");
11947 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11948 hpResult = hpResult / (
GetQuantity() + quantity_used);
11949
11950 hpResult *= GetMaxHealth();
11951 Math.Round(hpResult);
11952 SetHealth("", "Health", hpResult);
11953
11955 other_item.AddQuantity(-quantity_used);
11956 }
11957 }
11959 }
11960
11962 {
11963 #ifdef SERVER
11964 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11965 GetHierarchyParent().IncreaseLifetimeUp();
11966 #endif
11967 };
11968
11970 {
11971 PlayerBase p = PlayerBase.Cast(player);
11972
11973 array<int> recipesIds = p.m_Recipes;
11974 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11975 if (moduleRecipesManager)
11976 {
11977 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11978 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11979 }
11980
11981 for (int i = 0;i < recipesIds.Count(); i++)
11982 {
11983 int key = recipesIds.Get(i);
11984 string recipeName = moduleRecipesManager.GetRecipeName(key);
11986 }
11987 }
11988
11989
11990 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11991 {
11992 super.GetDebugActions(outputList);
11993
11994
12000
12001
12006
12011
12012
12016
12017
12019 {
12023 }
12024
12027
12028
12032
12034
12035 InventoryLocation loc = new InventoryLocation();
12036 GetInventory().GetCurrentInventoryLocation(loc);
12038 {
12039 if (Gizmo_IsSupported())
12042 }
12043
12045 }
12046
12047
12048
12049
12051 {
12052 super.OnAction(action_id, player, ctx);
12053
12055 {
12056 switch (action_id)
12057 {
12060 return true;
12063 return true;
12064 }
12065 }
12066
12068 {
12069 switch (action_id)
12070 {
12072 Delete();
12073 return true;
12074 }
12075 }
12076
12077 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
12078 {
12079 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12080 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
12081 PlayerBase p = PlayerBase.Cast(player);
12082 if (
EActions.RECIPES_RANGE_START < 1000)
12083 {
12084 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
12085 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
12086 }
12087 }
12088 #ifndef SERVER
12089 else if (action_id ==
EActions.WATCH_PLAYER)
12090 {
12091 PluginDeveloper.SetDeveloperItemClientEx(player);
12092 }
12093 #endif
12095 {
12096 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
12097 {
12098 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
12099 OnDebugButtonPressServer(id + 1);
12100 }
12101
12102 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
12103 {
12104 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
12106 }
12107
12108 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
12109 {
12110 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
12112 }
12113
12114 else if (action_id ==
EActions.ADD_QUANTITY)
12115 {
12116 if (IsMagazine())
12117 {
12118 Magazine mag = Magazine.Cast(this);
12119 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
12120 }
12121 else
12122 {
12124 }
12125
12126 if (m_EM)
12127 {
12128 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12129 }
12130
12131 }
12132
12133 else if (action_id ==
EActions.REMOVE_QUANTITY)
12134 {
12135 if (IsMagazine())
12136 {
12137 Magazine mag2 = Magazine.Cast(this);
12138 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12139 }
12140 else
12141 {
12143 }
12144 if (m_EM)
12145 {
12146 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12147 }
12148
12149 }
12150
12151 else if (action_id ==
EActions.SET_QUANTITY_0)
12152 {
12154
12155 if (m_EM)
12156 {
12157 m_EM.SetEnergy(0);
12158 }
12159 }
12160
12161 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12162 {
12164
12165 if (m_EM)
12166 {
12167 m_EM.SetEnergy(m_EM.GetEnergyMax());
12168 }
12169 }
12170
12171 else if (action_id ==
EActions.ADD_HEALTH)
12172 {
12173 AddHealth("","",GetMaxHealth("","Health")/5);
12174 }
12175 else if (action_id ==
EActions.REMOVE_HEALTH)
12176 {
12177 AddHealth("","",-GetMaxHealth("","Health")/5);
12178 }
12179 else if (action_id ==
EActions.DESTROY_HEALTH)
12180 {
12181 SetHealth01("","",0);
12182 }
12183 else if (action_id ==
EActions.WATCH_ITEM)
12184 {
12186 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12187 #ifdef DEVELOPER
12188 SetDebugDeveloper_item(this);
12189 #endif
12190 }
12191
12192 else if (action_id ==
EActions.ADD_TEMPERATURE)
12193 {
12194 AddTemperature(20);
12195
12196 }
12197
12198 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12199 {
12200 AddTemperature(-20);
12201
12202 }
12203
12204 else if (action_id ==
EActions.FLIP_FROZEN)
12205 {
12206 SetFrozen(!GetIsFrozen());
12207
12208 }
12209
12210 else if (action_id ==
EActions.ADD_WETNESS)
12211 {
12213
12214 }
12215
12216 else if (action_id ==
EActions.REMOVE_WETNESS)
12217 {
12219
12220 }
12221
12222 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12223 {
12226
12227
12228 }
12229
12230 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12231 {
12234 }
12235
12236 else if (action_id ==
EActions.MAKE_SPECIAL)
12237 {
12238 auto debugParams = DebugSpawnParams.WithPlayer(player);
12239 OnDebugSpawnEx(debugParams);
12240 }
12241
12242 }
12243
12244
12245 return false;
12246 }
12247
12248
12249
12250
12254
12257
12258
12259
12261 {
12262 return false;
12263 }
12264
12265
12267 {
12268 return true;
12269 }
12270
12271
12273 {
12274 return true;
12275 }
12276
12277
12278
12280 {
12281 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12283 }
12284
12287 {
12288 return null;
12289 }
12290
12292 {
12293 return false;
12294 }
12295
12297 {
12298 return false;
12299 }
12300
12304
12305
12307 {
12308 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12309 return module_repairing.CanRepair(this, item_repair_kit);
12310 }
12311
12312
12313 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12314 {
12315 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12316 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12317 }
12318
12319
12321 {
12322
12323
12324
12325
12326
12327
12328
12329
12330 return 1;
12331 }
12332
12333
12334
12336 {
12338 }
12339
12340
12341
12343 {
12345 }
12346
12347
12356 {
12357 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12358
12359 if (player)
12360 {
12361 player.MessageStatus(text);
12362 }
12363 }
12364
12365
12374 {
12375 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12376
12377 if (player)
12378 {
12379 player.MessageAction(text);
12380 }
12381 }
12382
12383
12392 {
12393 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12394
12395 if (player)
12396 {
12397 player.MessageFriendly(text);
12398 }
12399 }
12400
12401
12410 {
12411 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12412
12413 if (player)
12414 {
12415 player.MessageImportant(text);
12416 }
12417 }
12418
12420 {
12421 return true;
12422 }
12423
12424
12425 override bool KindOf(
string tag)
12426 {
12427 bool found = false;
12428 string item_name = this.
GetType();
12431
12432 int array_size = item_tag_array.Count();
12433 for (int i = 0; i < array_size; i++)
12434 {
12435 if (item_tag_array.Get(i) == tag)
12436 {
12437 found = true;
12438 break;
12439 }
12440 }
12441 return found;
12442 }
12443
12444
12446 {
12447
12448 super.OnRPC(sender, rpc_type,ctx);
12449
12450
12451 switch (rpc_type)
12452 {
12453 #ifndef SERVER
12454 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12455 Param2<bool, string> p = new Param2<bool, string>(false, "");
12456
12458 return;
12459
12460 bool play = p.param1;
12461 string soundSet = p.param2;
12462
12463 if (play)
12464 {
12466 {
12468 {
12470 }
12471 }
12472 else
12473 {
12475 }
12476 }
12477 else
12478 {
12480 }
12481
12482 break;
12483 #endif
12484
12485 }
12486
12488 {
12490 }
12491 }
12492
12493
12494
12495
12497 {
12498 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12499 return plugin.GetID(
name);
12500 }
12501
12503 {
12504 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12505 return plugin.GetName(id);
12506 }
12507
12510 {
12511
12512
12513 int varFlags;
12514 if (!ctx.
Read(varFlags))
12515 return;
12516
12517 if (varFlags & ItemVariableFlags.FLOAT)
12518 {
12520 }
12521 }
12522
12524 {
12525
12526 super.SerializeNumericalVars(floats_out);
12527
12528
12529
12531 {
12533 }
12534
12536 {
12538 }
12539
12541 {
12543 }
12544
12546 {
12551 }
12552
12554 {
12556 }
12557 }
12558
12560 {
12561
12562 super.DeSerializeNumericalVars(floats);
12563
12564
12565 int index = 0;
12566 int mask = Math.Round(floats.Get(index));
12567
12568 index++;
12569
12571 {
12573 {
12575 }
12576 else
12577 {
12578 float quantity = floats.Get(index);
12579 SetQuantity(quantity,
true,
false,
false,
false);
12580 }
12581 index++;
12582 }
12583
12585 {
12586 float wet = floats.Get(index);
12588 index++;
12589 }
12590
12592 {
12593 int liquidtype = Math.Round(floats.Get(index));
12595 index++;
12596 }
12597
12599 {
12601 index++;
12603 index++;
12605 index++;
12607 index++;
12608 }
12609
12611 {
12612 int cleanness = Math.Round(floats.Get(index));
12614 index++;
12615 }
12616 }
12617
12619 {
12620 super.WriteVarsToCTX(ctx);
12621
12622
12624 {
12626 }
12627
12629 {
12631 }
12632
12634 {
12636 }
12637
12639 {
12640 int r,g,b,a;
12646 }
12647
12649 {
12651 }
12652 }
12653
12655 {
12656 if (!super.ReadVarsFromCTX(ctx,version))
12657 return false;
12658
12659 int intValue;
12660 float value;
12661
12662 if (version < 140)
12663 {
12664 if (!ctx.
Read(intValue))
12665 return false;
12666
12667 m_VariablesMask = intValue;
12668 }
12669
12671 {
12672 if (!ctx.
Read(value))
12673 return false;
12674
12676 {
12678 }
12679 else
12680 {
12682 }
12683 }
12684
12685 if (version < 140)
12686 {
12688 {
12689 if (!ctx.
Read(value))
12690 return false;
12691 SetTemperatureDirect(value);
12692 }
12693 }
12694
12696 {
12697 if (!ctx.
Read(value))
12698 return false;
12700 }
12701
12703 {
12704 if (!ctx.
Read(intValue))
12705 return false;
12707 }
12708
12710 {
12711 int r,g,b,a;
12713 return false;
12715 return false;
12717 return false;
12719 return false;
12720
12722 }
12723
12725 {
12726 if (!ctx.
Read(intValue))
12727 return false;
12729 }
12730
12731 if (version >= 138 && version < 140)
12732 {
12734 {
12735 if (!ctx.
Read(intValue))
12736 return false;
12737 SetFrozen(intValue);
12738 }
12739 }
12740
12741 return true;
12742 }
12743
12744
12746 {
12749 {
12751 }
12752
12753 if (!super.OnStoreLoad(ctx, version))
12754 {
12756 return false;
12757 }
12758
12759 if (version >= 114)
12760 {
12761 bool hasQuickBarIndexSaved;
12762
12763 if (!ctx.
Read(hasQuickBarIndexSaved))
12764 {
12766 return false;
12767 }
12768
12769 if (hasQuickBarIndexSaved)
12770 {
12771 int itmQBIndex;
12772
12773
12774 if (!ctx.
Read(itmQBIndex))
12775 {
12777 return false;
12778 }
12779
12780 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12781 if (itmQBIndex != -1 && parentPlayer)
12782 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12783 }
12784 }
12785 else
12786 {
12787
12788 PlayerBase player;
12789 int itemQBIndex;
12790 if (version ==
int.
MAX)
12791 {
12792 if (!ctx.
Read(itemQBIndex))
12793 {
12795 return false;
12796 }
12797 }
12798 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12799 {
12800
12801 if (!ctx.
Read(itemQBIndex))
12802 {
12804 return false;
12805 }
12806 if (itemQBIndex != -1 && player)
12807 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12808 }
12809 }
12810
12811 if (version < 140)
12812 {
12813
12814 if (!LoadVariables(ctx, version))
12815 {
12817 return false;
12818 }
12819 }
12820
12821
12823 {
12825 return false;
12826 }
12827 if (version >= 132)
12828 {
12830 if (raib)
12831 {
12833 {
12835 return false;
12836 }
12837 }
12838 }
12839
12841 return true;
12842 }
12843
12844
12845
12847 {
12848 super.OnStoreSave(ctx);
12849
12850 PlayerBase player;
12851 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12852 {
12854
12855 int itemQBIndex = -1;
12856 itemQBIndex = player.FindQuickBarEntityIndex(this);
12857 ctx.
Write(itemQBIndex);
12858 }
12859 else
12860 {
12862 }
12863
12865
12867 if (raib)
12868 {
12870 }
12871 }
12872
12873
12875 {
12876 super.AfterStoreLoad();
12877
12879 {
12881 }
12882
12884 {
12887 }
12888 }
12889
12891 {
12892 super.EEOnAfterLoad();
12893
12895 {
12897 }
12898
12901 }
12902
12904 {
12905 return false;
12906 }
12907
12908
12909
12911 {
12913 {
12914 #ifdef PLATFORM_CONSOLE
12915
12917 {
12919 if (menu)
12920 {
12922 }
12923 }
12924 #endif
12925 }
12926
12928 {
12931 }
12932
12934 {
12935 SetWeightDirty();
12937 }
12939 {
12942 }
12943
12945 {
12948 }
12950 {
12953 }
12954
12955 super.OnVariablesSynchronized();
12956 }
12957
12958
12959
12961 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12962 {
12963 if (!IsServerCheck(allow_client))
12964 return false;
12965
12967 return false;
12968
12971
12972 if (value <= (min + 0.001))
12973 value = min;
12974
12975 if (value == min)
12976 {
12977 if (destroy_config)
12978 {
12979 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12980 if (dstr)
12981 {
12983 this.Delete();
12984 return true;
12985 }
12986 }
12987 else if (destroy_forced)
12988 {
12990 this.Delete();
12991 return true;
12992 }
12993
12995 }
12996
12999
13001 {
13003
13004 if (delta)
13006 }
13007
13009
13010 return false;
13011 }
13012
13013
13015 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
13016 {
13018 }
13019
13021 {
13024 }
13025
13027 {
13030 }
13031
13033 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
13034 {
13035 float value_clamped = Math.Clamp(value, 0, 1);
13037 SetQuantity(result, destroy_config, destroy_forced);
13038 }
13039
13040
13043 {
13045 }
13046
13048 {
13050 }
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13062 {
13063 int slot = -1;
13064 if (GetInventory())
13065 {
13066 InventoryLocation il = new InventoryLocation;
13067 GetInventory().GetCurrentInventoryLocation(il);
13069 }
13070
13072 }
13073
13075 {
13076 float quantity_max = 0;
13077
13079 {
13080 if (attSlotID != -1)
13081 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
13082
13083 if (quantity_max <= 0)
13085 }
13086
13087 if (quantity_max <= 0)
13089
13090 return quantity_max;
13091 }
13092
13094 {
13096 }
13097
13099 {
13101 }
13102
13103
13105 {
13107 }
13108
13110 {
13112 }
13113
13115 {
13117 }
13118
13119
13121 {
13122
13123 float weightEx = GetWeightEx();
13124 float special = GetInventoryAndCargoWeight();
13125 return weightEx - special;
13126 }
13127
13128
13130 {
13132 }
13133
13135 {
13137 {
13138 #ifdef DEVELOPER
13139 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13140 {
13141 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13143 }
13144 #endif
13145
13146 return GetQuantity() * GetConfigWeightModified();
13147 }
13148 else if (HasEnergyManager())
13149 {
13150 #ifdef DEVELOPER
13151 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13152 {
13153 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13154 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13155 }
13156 #endif
13157 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13158 }
13159 else
13160 {
13161 #ifdef DEVELOPER
13162 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13163 {
13164 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13165 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13166 }
13167 #endif
13168 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13169 }
13170 }
13171
13174 {
13175 int item_count = 0;
13177
13178 if (GetInventory().GetCargo() != NULL)
13179 {
13180 item_count = GetInventory().GetCargo().GetItemCount();
13181 }
13182
13183 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13184 {
13185 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13186 if (item)
13187 item_count += item.GetNumberOfItems();
13188 }
13189 return item_count;
13190 }
13191
13194 {
13195 float weight = 0;
13196 float wetness = 1;
13197 if (include_wetness)
13200 {
13201 weight = wetness * m_ConfigWeight;
13202 }
13204 {
13205 weight = 1;
13206 }
13207 return weight;
13208 }
13209
13210
13211
13213 {
13214 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13215 {
13216 GameInventory inv = GetInventory();
13217 array<EntityAI> items = new array<EntityAI>;
13219 for (int i = 0; i < items.Count(); i++)
13220 {
13222 if (item)
13223 {
13225 }
13226 }
13227 }
13228 }
13229
13230
13231
13232
13234 {
13235 float energy = 0;
13236 if (HasEnergyManager())
13237 {
13238 energy = GetCompEM().GetEnergy();
13239 }
13240 return energy;
13241 }
13242
13243
13245 {
13246 super.OnEnergyConsumed();
13247
13249 }
13250
13252 {
13253 super.OnEnergyAdded();
13254
13256 }
13257
13258
13260 {
13261 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13262 {
13264 {
13265 float energy_0to1 = GetCompEM().GetEnergy0To1();
13267 }
13268 }
13269 }
13270
13271
13273 {
13274 return ConfigGetFloat("heatIsolation");
13275 }
13276
13278 {
13280 }
13281
13283 {
13284 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13285 if (
GetGame().ConfigIsExisting(paramPath))
13287
13288 return 0.0;
13289 }
13290
13292 {
13293 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13294 if (
GetGame().ConfigIsExisting(paramPath))
13296
13297 return 0.0;
13298 }
13299
13300 override void SetWet(
float value,
bool allow_client =
false)
13301 {
13302 if (!IsServerCheck(allow_client))
13303 return;
13304
13307
13309
13310 m_VarWet = Math.Clamp(value, min, max);
13311
13313 {
13316 }
13317 }
13318
13319 override void AddWet(
float value)
13320 {
13322 }
13323
13325 {
13327 }
13328
13330 {
13332 }
13333
13335 {
13337 }
13338
13340 {
13342 }
13343
13345 {
13347 }
13348
13349 override void OnWetChanged(
float newVal,
float oldVal)
13350 {
13353 if (newLevel != oldLevel)
13354 {
13356 }
13357 }
13358
13360 {
13361 SetWeightDirty();
13362 }
13363
13365 {
13366 return GetWetLevelInternal(
m_VarWet);
13367 }
13368
13369
13370
13372 {
13374 }
13375
13377 {
13379 }
13380
13382 {
13384 }
13385
13387 {
13389 }
13390
13391
13392
13394 {
13395 if (ConfigIsExisting("itemModelLength"))
13396 {
13397 return ConfigGetFloat("itemModelLength");
13398 }
13399 return 0;
13400 }
13401
13403 {
13404 if (ConfigIsExisting("itemAttachOffset"))
13405 {
13406 return ConfigGetFloat("itemAttachOffset");
13407 }
13408 return 0;
13409 }
13410
13411 override void SetCleanness(
int value,
bool allow_client =
false)
13412 {
13413 if (!IsServerCheck(allow_client))
13414 return;
13415
13417
13419
13422 }
13423
13425 {
13427 }
13428
13430 {
13431 return true;
13432 }
13433
13434
13435
13436
13438 {
13440 }
13441
13443 {
13445 }
13446
13447
13448
13449
13450 override void SetColor(
int r,
int g,
int b,
int a)
13451 {
13457 }
13459 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13460 {
13465 }
13466
13468 {
13470 }
13471
13474 {
13475 int r,g,b,a;
13477 r = r/255;
13478 g = g/255;
13479 b = b/255;
13480 a = a/255;
13481 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13482 }
13483
13484
13485
13486 override void SetLiquidType(
int value,
bool allow_client =
false)
13487 {
13488 if (!IsServerCheck(allow_client))
13489 return;
13490
13495 }
13496
13498 {
13499 return ConfigGetInt("varLiquidTypeInit");
13500 }
13501
13503 {
13505 }
13506
13508 {
13510 SetFrozen(false);
13511 }
13512
13515 {
13516 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13517 }
13518
13519
13522 {
13523 PlayerBase nplayer;
13524 if (PlayerBase.CastTo(nplayer, player))
13525 {
13527
13528 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13529 }
13530 }
13531
13532
13535 {
13536 PlayerBase nplayer;
13537 if (PlayerBase.CastTo(nplayer,player))
13538 {
13539
13540 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13541
13542 }
13543
13544
13545 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13546
13547
13548 if (HasEnergyManager())
13549 {
13550 GetCompEM().UpdatePlugState();
13551 }
13552 }
13553
13554
13556 {
13557 super.OnPlacementStarted(player);
13558
13560 }
13561
13562 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13563 {
13565 {
13566 m_AdminLog.OnPlacementComplete(player,
this);
13567 }
13568
13569 super.OnPlacementComplete(player, position, orientation);
13570 }
13571
13572
13573
13574
13575
13577 {
13579 {
13580 return true;
13581 }
13582 else
13583 {
13584 return false;
13585 }
13586 }
13587
13588
13590 {
13592 {
13594 }
13595 }
13596
13597
13599 {
13601 }
13602
13604 {
13606 }
13607
13608 override void InsertAgent(
int agent,
float count = 1)
13609 {
13610 if (count < 1)
13611 return;
13612
13614 }
13615
13618 {
13620 }
13621
13622
13624 {
13626 }
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13670 {
13672 return false;
13673 return true;
13674 }
13675
13677 {
13678
13680 }
13681
13682
13685 {
13686 super.CheckForRoofLimited(timeTresholdMS);
13687
13689 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13690 {
13691 m_PreviousRoofTestTime = time;
13692 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13693 }
13694 }
13695
13696
13698 {
13700 {
13701 return 0;
13702 }
13703
13704 if (GetInventory().GetAttachmentSlotsCount() != 0)
13705 {
13706 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13707 if (filter)
13708 return filter.GetProtectionLevel(type, false, system);
13709 else
13710 return 0;
13711 }
13712
13713 string subclassPath, entryName;
13714
13715 switch (type)
13716 {
13718 entryName = "biological";
13719 break;
13721 entryName = "chemical";
13722 break;
13723 default:
13724 entryName = "biological";
13725 break;
13726 }
13727
13728 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13729
13731 }
13732
13733
13734
13737 {
13738 if (!IsMagazine())
13740
13742 }
13743
13744
13745
13746
13747
13752 {
13753 return true;
13754 }
13755
13757 {
13759 }
13760
13761
13762
13763
13764
13766 {
13767 if (parent)
13768 {
13769 if (parent.IsInherited(DayZInfected))
13770 return true;
13771
13772 if (!parent.IsRuined())
13773 return true;
13774 }
13775
13776 return true;
13777 }
13778
13780 {
13781 if (!super.CanPutAsAttachment(parent))
13782 {
13783 return false;
13784 }
13785
13786 if (!IsRuined() && !parent.IsRuined())
13787 {
13788 return true;
13789 }
13790
13791 return false;
13792 }
13793
13795 {
13796
13797
13798
13799
13800 return super.CanReceiveItemIntoCargo(item);
13801 }
13802
13804 {
13805
13806
13807
13808
13809 GameInventory attachmentInv = attachment.GetInventory();
13811 {
13812 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13813 return false;
13814 }
13815
13816 InventoryLocation loc = new InventoryLocation();
13817 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13818 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13819 return false;
13820
13821 return super.CanReceiveAttachment(attachment, slotId);
13822 }
13823
13825 {
13826 if (!super.CanReleaseAttachment(attachment))
13827 return false;
13828
13829 return GetInventory().AreChildrenAccessible();
13830 }
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13853 {
13854 int id = muzzle_owner.GetMuzzleID();
13855 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13856
13857 if (WPOF_array)
13858 {
13859 for (int i = 0; i < WPOF_array.Count(); i++)
13860 {
13861 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13862
13863 if (WPOF)
13864 {
13865 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13866 }
13867 }
13868 }
13869 }
13870
13871
13873 {
13874 int id = muzzle_owner.GetMuzzleID();
13876
13877 if (WPOBE_array)
13878 {
13879 for (int i = 0; i < WPOBE_array.Count(); i++)
13880 {
13881 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13882
13883 if (WPOBE)
13884 {
13885 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13886 }
13887 }
13888 }
13889 }
13890
13891
13893 {
13894 int id = muzzle_owner.GetMuzzleID();
13895 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13896
13897 if (WPOOH_array)
13898 {
13899 for (int i = 0; i < WPOOH_array.Count(); i++)
13900 {
13901 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13902
13903 if (WPOOH)
13904 {
13905 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13906 }
13907 }
13908 }
13909 }
13910
13911
13913 {
13914 int id = muzzle_owner.GetMuzzleID();
13915 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13916
13917 if (WPOOH_array)
13918 {
13919 for (int i = 0; i < WPOOH_array.Count(); i++)
13920 {
13921 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13922
13923 if (WPOOH)
13924 {
13925 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13926 }
13927 }
13928 }
13929 }
13930
13931
13933 {
13934 int id = muzzle_owner.GetMuzzleID();
13935 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13936
13937 if (WPOOH_array)
13938 {
13939 for (int i = 0; i < WPOOH_array.Count(); i++)
13940 {
13941 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13942
13943 if (WPOOH)
13944 {
13945 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13946 }
13947 }
13948 }
13949 }
13950
13951
13952
13954 {
13956 {
13957 return true;
13958 }
13959
13960 return false;
13961 }
13962
13964 {
13966 {
13967 return true;
13968 }
13969
13970 return false;
13971 }
13972
13974 {
13976 {
13977 return true;
13978 }
13979
13980 return false;
13981 }
13982
13984 {
13985 return false;
13986 }
13987
13990 {
13991 return UATimeSpent.DEFAULT_DEPLOY;
13992 }
13993
13994
13995
13996
13998 {
14000 SetSynchDirty();
14001 }
14002
14004 {
14006 }
14007
14008
14010 {
14011 return false;
14012 }
14013
14016 {
14017 string att_type = "None";
14018
14019 if (ConfigIsExisting("soundAttType"))
14020 {
14021 att_type = ConfigGetString("soundAttType");
14022 }
14023
14025 }
14026
14028 {
14030 }
14031
14032
14033
14034
14035
14041
14043 {
14046
14048 }
14049
14050
14052 {
14054 return;
14055
14057
14060
14063
14064 SoundParameters params = new SoundParameters();
14068 }
14069
14070
14072 {
14074 return;
14075
14077 SetSynchDirty();
14078
14081 }
14082
14083
14085 {
14087 return;
14088
14090 SetSynchDirty();
14091
14094 }
14095
14097 {
14099 }
14100
14102 {
14104 }
14105
14108 {
14109 if (!
GetGame().IsDedicatedServer())
14110 {
14111 if (ConfigIsExisting("attachSoundSet"))
14112 {
14113 string cfg_path = "";
14114 string soundset = "";
14115 string type_name =
GetType();
14116
14119 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
14120 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
14121
14122 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
14123 {
14124 for (int i = 0; i < cfg_soundset_array.Count(); i++)
14125 {
14126 if (cfg_slot_array[i] == slot_type)
14127 {
14128 soundset = cfg_soundset_array[i];
14129 break;
14130 }
14131 }
14132 }
14133
14134 if (soundset != "")
14135 {
14136 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14138 }
14139 }
14140 }
14141 }
14142
14144 {
14145
14146 }
14147
14148 void OnApply(PlayerBase player);
14149
14151 {
14152 return 1.0;
14153 };
14154
14156 {
14158 }
14159
14161 {
14163 }
14164
14166
14168 {
14169 SetDynamicPhysicsLifeTime(0.01);
14171 }
14172
14174 {
14175 array<string> zone_names = new array<string>;
14176 GetDamageZones(zone_names);
14177 for (int i = 0; i < zone_names.Count(); i++)
14178 {
14179 SetHealthMax(zone_names.Get(i),"Health");
14180 }
14181 SetHealthMax("","Health");
14182 }
14183
14186 {
14187 float global_health = GetHealth01("","Health");
14188 array<string> zones = new array<string>;
14189 GetDamageZones(zones);
14190
14191 for (int i = 0; i < zones.Count(); i++)
14192 {
14193 SetHealth01(zones.Get(i),"Health",global_health);
14194 }
14195 }
14196
14199 {
14200 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14201 }
14202
14204 {
14205 if (!hasRootAsPlayer)
14206 {
14207 if (refParentIB)
14208 {
14209
14210 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14211 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14212
14213 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14214 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14215
14218 }
14219 else
14220 {
14221
14224 }
14225 }
14226 }
14227
14229 {
14231 {
14232 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14233 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14234 {
14235 float heatPermCoef = 1.0;
14237 while (ent)
14238 {
14239 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14240 ent = ent.GetHierarchyParent();
14241 }
14242
14243 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14244 }
14245 }
14246 }
14247
14249 {
14250
14251 EntityAI parent = GetHierarchyParent();
14252 if (!parent)
14253 {
14254 hasParent = false;
14255 hasRootAsPlayer = false;
14256 }
14257 else
14258 {
14259 hasParent = true;
14260 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14261 refParentIB =
ItemBase.Cast(parent);
14262 }
14263 }
14264
14265 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14266 {
14267
14268 }
14269
14271 {
14272
14273 return false;
14274 }
14275
14277 {
14278
14279
14280 return false;
14281 }
14282
14284 {
14285
14286 return false;
14287 }
14288
14291 {
14292 return !GetIsFrozen() &&
IsOpen();
14293 }
14294
14296 {
14297 bool hasParent = false, hasRootAsPlayer = false;
14299
14300 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14301 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14302
14303 if (wwtu || foodDecay)
14304 {
14308
14309 if (processWetness || processTemperature || processDecay)
14310 {
14312
14313 if (processWetness)
14314 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14315
14316 if (processTemperature)
14318
14319 if (processDecay)
14320 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14321 }
14322 }
14323 }
14324
14327 {
14329 }
14330
14332 {
14335
14336 return super.GetTemperatureFreezeThreshold();
14337 }
14338
14340 {
14343
14344 return super.GetTemperatureThawThreshold();
14345 }
14346
14348 {
14351
14352 return super.GetItemOverheatThreshold();
14353 }
14354
14356 {
14358 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14359
14360 return super.GetTemperatureFreezeTime();
14361 }
14362
14364 {
14366 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14367
14368 return super.GetTemperatureThawTime();
14369 }
14370
14375
14377 {
14378 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14379 }
14380
14382 {
14383 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14384 }
14385
14388 {
14390 }
14391
14393 {
14395 }
14396
14398 {
14400 }
14401
14404 {
14405 return null;
14406 }
14407
14410 {
14411 return false;
14412 }
14413
14415 {
14417 {
14420 if (!trg)
14421 {
14423 explosive = this;
14424 }
14425
14426 explosive.PairRemote(trg);
14428
14429 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14430 trg.SetPersistentPairID(persistentID);
14431 explosive.SetPersistentPairID(persistentID);
14432
14433 return true;
14434 }
14435 return false;
14436 }
14437
14440 {
14441 float ret = 1.0;
14444 ret *= GetHealth01();
14445
14446 return ret;
14447 }
14448
14449 #ifdef DEVELOPER
14450 override void SetDebugItem()
14451 {
14452 super.SetDebugItem();
14453 _itemBase = this;
14454 }
14455
14457 {
14458 string text = super.GetDebugText();
14459
14461 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14462
14463 return text;
14464 }
14465 #endif
14466
14468 {
14469 return true;
14470 }
14471
14473
14475
14477 {
14480 }
14481
14482
14490
14506}
14507
14509{
14511 if (entity)
14512 {
14513 bool is_item = entity.IsInherited(
ItemBase);
14514 if (is_item && full_quantity)
14515 {
14518 }
14519 }
14520 else
14521 {
14523 return NULL;
14524 }
14525 return entity;
14526}
14527
14529{
14530 if (item)
14531 {
14532 if (health > 0)
14533 item.SetHealth("", "", health);
14534
14535 if (item.CanHaveTemperature())
14536 {
14538 if (item.CanFreeze())
14539 item.SetFrozen(false);
14540 }
14541
14542 if (item.HasEnergyManager())
14543 {
14544 if (quantity >= 0)
14545 {
14546 item.GetCompEM().SetEnergy0To1(quantity);
14547 }
14548 else
14549 {
14551 }
14552 }
14553 else if (item.IsMagazine())
14554 {
14555 Magazine mag = Magazine.Cast(item);
14556 if (quantity >= 0)
14557 {
14558 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14559 }
14560 else
14561 {
14563 }
14564
14565 }
14566 else
14567 {
14568 if (quantity >= 0)
14569 {
14570 item.SetQuantityNormalized(quantity, false);
14571 }
14572 else
14573 {
14575 }
14576
14577 }
14578 }
14579}
14580
14581#ifdef DEVELOPER
14583#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.