9630{
9632 {
9633 return true;
9634 }
9635};
9636
9637
9638
9640{
9644
9646
9649
9650
9651
9652
9653
9662
9668
9673
9678
9699 protected bool m_IsResultOfSplit
9700
9702
9707
9708
9709
9711
9715
9716
9717
9719
9722
9723
9724
9730
9731
9739
9742
9743
9745
9746
9748
9749
9754
9755
9760
9761
9763
9764
9766 {
9771
9772 if (!
GetGame().IsDedicatedServer())
9773 {
9775 {
9777
9779 {
9781 }
9782 }
9783
9786 }
9787
9788 m_OldLocation = null;
9789
9791 {
9793 }
9794
9795 if (ConfigIsExisting("headSelectionsToHide"))
9796 {
9799 }
9800
9802 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9803 {
9805 }
9806
9808
9809 m_IsResultOfSplit = false;
9810
9812 }
9813
9815 {
9816 super.InitItemVariables();
9817
9823 m_Count = ConfigGetInt(
"count");
9824
9827
9832
9835
9840
9852
9856
9857
9860 if (ConfigIsExisting("canBeSplit"))
9861 {
9864 }
9865
9867 if (ConfigIsExisting("itemBehaviour"))
9869
9870
9873 RegisterNetSyncVariableInt("m_VarLiquidType");
9874 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9875
9876 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9877 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9878 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9879
9880 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9881 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9882 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9883 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9884
9885 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9886 RegisterNetSyncVariableBool("m_IsTakeable");
9887 RegisterNetSyncVariableBool("m_IsHologram");
9888
9891 {
9894 }
9895
9897
9899 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9901
9902 }
9903
9905 {
9907 }
9908
9910 {
9913 {
9918 }
9919 }
9920
9921 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9922 {
9924 {
9927 }
9928
9930 }
9931
9933 {
9939 }
9940
9942
9944 {
9946
9947 if (!action)
9948 {
9949 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9950 return;
9951 }
9952
9954 if (!ai)
9955 {
9957 return;
9958 }
9959
9961 if (!action_array)
9962 {
9963 action_array = new array<ActionBase_Basic>;
9965 }
9966 if (LogManager.IsActionLogEnable())
9967 {
9968 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9969 }
9970
9971 if (action_array.Find(action) != -1)
9972 {
9973 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9974 }
9975 else
9976 {
9977 action_array.Insert(action);
9978 }
9979 }
9980
9982 {
9984 ActionBase action = player.GetActionManager().GetAction(actionName);
9987
9988 if (action_array)
9989 {
9990 action_array.RemoveItem(action);
9991 }
9992 }
9993
9994
9995
9997 {
9998 ActionOverrideData overrideData = new ActionOverrideData();
10002
10004 if (!actionMap)
10005 {
10008 }
10009
10010 actionMap.Insert(this.
Type(), overrideData);
10011
10012 }
10013
10015
10017
10018
10020 {
10023
10026
10027 string config_to_search = "CfgVehicles";
10028 string muzzle_owner_config;
10029
10031 {
10032 if (IsInherited(Weapon))
10033 config_to_search = "CfgWeapons";
10034
10035 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10036
10037 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
10038
10040
10041 if (config_OnFire_subclass_count > 0)
10042 {
10043 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
10044
10045 for (int i = 0; i < config_OnFire_subclass_count; i++)
10046 {
10047 string particle_class = "";
10049 string config_OnFire_entry = config_OnFire_class + particle_class;
10050 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
10051 WPOF_array.Insert(WPOF);
10052 }
10053
10054
10056 }
10057 }
10058
10060 {
10061 config_to_search = "CfgWeapons";
10062 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10063
10064 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
10065
10067
10068 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
10069 {
10070 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
10071
10072 for (i = 0; i < config_OnBulletCasingEject_count; i++)
10073 {
10074 string particle_class2 = "";
10076 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
10077 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
10078 WPOBE_array.Insert(WPOBE);
10079 }
10080
10081
10083 }
10084 }
10085 }
10086
10087
10089 {
10092
10094 {
10095 string config_to_search = "CfgVehicles";
10096
10097 if (IsInherited(Weapon))
10098 config_to_search = "CfgWeapons";
10099
10100 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10101 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10102
10103 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10104 {
10105
10107
10109 {
10111 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10113 return;
10114 }
10115
10118
10119
10120
10122 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10123
10124 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10125 {
10126 string particle_class = "";
10128 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10130
10131 if (entry_type == CT_CLASS)
10132 {
10133 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10134 WPOOH_array.Insert(WPOF);
10135 }
10136 }
10137
10138
10140 }
10141 }
10142 }
10143
10145 {
10147 }
10148
10150 {
10152 {
10154
10157
10160
10161 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10162 }
10163 }
10164
10166 {
10168 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10169
10171 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10172
10174 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10175
10177 {
10179 }
10180 }
10181
10183 {
10185 }
10186
10188 {
10191 else
10193
10195 {
10198 }
10199 else
10200 {
10203
10206 }
10207
10209 }
10210
10212 {
10214 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10215 }
10216
10218 {
10220 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10222 }
10223
10225 {
10227 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10228 }
10229
10231 {
10234
10235 OverheatingParticle OP = new OverheatingParticle();
10240
10242 }
10243
10245 {
10248
10249 return -1;
10250 }
10251
10253 {
10255 {
10258
10259 for (int i = count; i > 0; --i)
10260 {
10261 int id = i - 1;
10264
10267
10268 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10269 {
10270 if (p)
10271 {
10274 }
10275 }
10276 }
10277 }
10278 }
10279
10281 {
10283 {
10285 {
10286 int id = i - 1;
10288
10289 if (OP)
10290 {
10292
10293 if (p)
10294 {
10296 }
10297
10298 delete OP;
10299 }
10300 }
10301
10304 }
10305 }
10306
10309 {
10310 return 0.0;
10311 }
10312
10313
10315 {
10316 return 250;
10317 }
10318
10320 {
10321 return 0;
10322 }
10323
10326 {
10328 return true;
10329
10330 return false;
10331 }
10332
10335 {
10338
10340 {
10342 }
10343 else
10344 {
10345
10347 }
10348
10350 }
10351
10358 {
10359 return -1;
10360 }
10361
10362
10363
10364
10366 {
10368 {
10370 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10371
10372 if (r_index >= 0)
10373 {
10374 InventoryLocation r_il = new InventoryLocation;
10375 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10376
10377 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10380 {
10381 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10382 }
10384 {
10385 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10386 }
10387
10388 }
10389
10390 player.GetHumanInventory().ClearUserReservedLocation(this);
10391 }
10392
10395 }
10396
10397
10398
10399
10401 {
10402 return ItemBase.m_DebugActionsMask;
10403 }
10404
10406 {
10407 return ItemBase.m_DebugActionsMask & mask;
10408 }
10409
10411 {
10412 ItemBase.m_DebugActionsMask = mask;
10413 }
10414
10416 {
10417 ItemBase.m_DebugActionsMask |= mask;
10418 }
10419
10421 {
10422 ItemBase.m_DebugActionsMask &= ~mask;
10423 }
10424
10426 {
10428 {
10430 }
10431 else
10432 {
10434 }
10435 }
10436
10437
10439 {
10440 if (GetEconomyProfile())
10441 {
10442 float q_max = GetEconomyProfile().GetQuantityMax();
10443 if (q_max > 0)
10444 {
10445 float q_min = GetEconomyProfile().GetQuantityMin();
10446 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10447
10449 {
10450 ComponentEnergyManager comp = GetCompEM();
10452 {
10454 }
10455 }
10457 {
10459
10460 }
10461
10462 }
10463 }
10464 }
10465
10468 {
10469 EntityAI parent = GetHierarchyParent();
10470
10471 if (parent)
10472 {
10473 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10474 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10475 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10476 }
10477 }
10478
10481 {
10482 EntityAI parent = GetHierarchyParent();
10483
10484 if (parent)
10485 {
10486 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10487 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10488 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10489 }
10490 }
10491
10493 {
10494
10495
10496
10497
10499
10501 {
10502 if (ScriptInputUserData.CanStoreInputUserData())
10503 {
10504 ScriptInputUserData ctx = new ScriptInputUserData;
10510 ctx.
Write(use_stack_max);
10513
10515 {
10516 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10517 }
10518 }
10519 }
10520 else if (!
GetGame().IsMultiplayer())
10521 {
10523 }
10524 }
10525
10527 {
10529 }
10530
10532 {
10534 }
10535
10537 {
10539 }
10540
10542 {
10543
10544 return false;
10545 }
10546
10548 {
10549 return false;
10550 }
10551
10555 {
10556 return false;
10557 }
10558
10560 {
10561 return "";
10562 }
10563
10565
10567 {
10568 return false;
10569 }
10570
10572 {
10573 return true;
10574 }
10575
10576
10577
10579 {
10580 return true;
10581 }
10582
10584 {
10585 return true;
10586 }
10587
10589 {
10590 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10592 }
10593
10595 {
10597 }
10598
10600 {
10602 if (!is_being_placed)
10604 SetSynchDirty();
10605 }
10606
10607
10609
10611 {
10613 }
10614
10616 {
10618 }
10619
10621 {
10622 return 1;
10623 }
10624
10626 {
10627 return false;
10628 }
10629
10631 {
10633 SetSynchDirty();
10634 }
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10671 {
10672 super.OnMovedInsideCargo(container);
10673
10674 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10675 }
10676
10677 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10678 {
10679 super.EEItemLocationChanged(oldLoc,newLoc);
10680
10681 PlayerBase new_player = null;
10682 PlayerBase old_player = null;
10683
10684 if (newLoc.GetParent())
10685 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10686
10687 if (oldLoc.GetParent())
10688 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10689
10691 {
10692 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10693
10694 if (r_index >= 0)
10695 {
10696 InventoryLocation r_il = new InventoryLocation;
10697 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10698
10699 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10702 {
10703 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10704 }
10706 {
10707 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10708 }
10709
10710 }
10711 }
10712
10714 {
10715 if (new_player)
10716 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10717
10718 if (new_player == old_player)
10719 {
10720
10721 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10722 {
10724 {
10725 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10726 {
10727 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10728 }
10729 }
10730 else
10731 {
10732 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10733 }
10734 }
10735
10736 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10737 {
10738 int type = oldLoc.GetType();
10740 {
10741 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10742 }
10744 {
10745 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10746 }
10747 }
10748 if (!m_OldLocation)
10749 {
10750 m_OldLocation = new InventoryLocation;
10751 }
10752 m_OldLocation.Copy(oldLoc);
10753 }
10754 else
10755 {
10756 if (m_OldLocation)
10757 {
10758 m_OldLocation.Reset();
10759 }
10760 }
10761
10763 }
10764 else
10765 {
10766 if (new_player)
10767 {
10768 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10769 if (res_index >= 0)
10770 {
10771 InventoryLocation il = new InventoryLocation;
10772 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10774 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10777 {
10778 il.
GetParent().GetOnReleaseLock().Invoke(it);
10779 }
10781 {
10783 }
10784
10785 }
10786 }
10788 {
10789
10791 }
10792
10793 if (m_OldLocation)
10794 {
10795 m_OldLocation.Reset();
10796 }
10797 }
10798 }
10799
10800 override void EOnContact(IEntity other, Contact extra)
10801 {
10803 {
10804 int liquidType = -1;
10806 if (impactSpeed > 0.0)
10807 {
10809 #ifndef SERVER
10811 #else
10813 SetSynchDirty();
10814 #endif
10816 }
10817 }
10818
10819 #ifdef SERVER
10820 if (GetCompEM() && GetCompEM().IsPlugged())
10821 {
10822 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10823 GetCompEM().UnplugThis();
10824 }
10825 #endif
10826 }
10827
10829
10831 {
10833 }
10834
10836 {
10837
10838 }
10839
10841 {
10842 super.OnItemLocationChanged(old_owner, new_owner);
10843
10844 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10845 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10846
10847 if (!relatedPlayer && playerNew)
10848 relatedPlayer = playerNew;
10849
10850 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10851 {
10853 if (actionMgr)
10854 {
10855 ActionBase currentAction = actionMgr.GetRunningAction();
10856 if (currentAction)
10858 }
10859 }
10860
10861 Man ownerPlayerOld = null;
10862 Man ownerPlayerNew = null;
10863
10864 if (old_owner)
10865 {
10866 if (old_owner.
IsMan())
10867 {
10868 ownerPlayerOld = Man.Cast(old_owner);
10869 }
10870 else
10871 {
10872 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10873 }
10874 }
10875 else
10876 {
10878 {
10880
10881 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10882 {
10883 GetCompEM().UnplugThis();
10884 }
10885 }
10886 }
10887
10888 if (new_owner)
10889 {
10890 if (new_owner.
IsMan())
10891 {
10892 ownerPlayerNew = Man.Cast(new_owner);
10893 }
10894 else
10895 {
10896 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10897 }
10898 }
10899
10900 if (ownerPlayerOld != ownerPlayerNew)
10901 {
10902 if (ownerPlayerOld)
10903 {
10904 array<EntityAI> subItemsExit = new array<EntityAI>;
10906 for (int i = 0; i < subItemsExit.Count(); i++)
10907 {
10910 }
10911 }
10912
10913 if (ownerPlayerNew)
10914 {
10915 array<EntityAI> subItemsEnter = new array<EntityAI>;
10917 for (int j = 0; j < subItemsEnter.Count(); j++)
10918 {
10921 }
10922 }
10923 }
10924 else if (ownerPlayerNew != null)
10925 {
10926 PlayerBase nplayer;
10927 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10928 {
10929 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10931 for (int k = 0; k < subItemsUpdate.Count(); k++)
10932 {
10934 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10935 }
10936 }
10937 }
10938
10939 if (old_owner)
10940 old_owner.OnChildItemRemoved(this);
10941 if (new_owner)
10942 new_owner.OnChildItemReceived(this);
10943 }
10944
10945
10947 {
10948 super.EEDelete(parent);
10949 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10950 if (player)
10951 {
10953
10954 if (player.IsAlive())
10955 {
10956 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10957 if (r_index >= 0)
10958 {
10959 InventoryLocation r_il = new InventoryLocation;
10960 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10961
10962 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10965 {
10966 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10967 }
10969 {
10970 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10971 }
10972
10973 }
10974
10975 player.RemoveQuickBarEntityShortcut(this);
10976 }
10977 }
10978 }
10979
10981 {
10982 super.EEKilled(killer);
10983
10986 {
10987 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10988 {
10989 if (IsMagazine())
10990 {
10991 if (Magazine.Cast(this).GetAmmoCount() > 0)
10992 {
10994 }
10995 }
10996 else
10997 {
10999 }
11000 }
11001 }
11002 }
11003
11005 {
11006 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
11007
11008 super.OnWasAttached(parent, slot_id);
11009
11012
11014 }
11015
11017 {
11018 super.OnWasDetached(parent, slot_id);
11019
11022 }
11023
11025 {
11026 int idx;
11029
11030 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11031 if (inventory_slots.Count() < 1)
11032 {
11033 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
11034 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
11035 }
11036 else
11037 {
11038 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
11039 }
11040
11041 idx = inventory_slots.Find(slot);
11042 if (idx < 0)
11043 return "";
11044
11045 return attach_types.Get(idx);
11046 }
11047
11049 {
11050 int idx = -1;
11051 string slot;
11052
11055
11056 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11057 if (inventory_slots.Count() < 1)
11058 {
11059 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
11060 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11061 }
11062 else
11063 {
11064 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
11065 if (detach_types.Count() < 1)
11066 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11067 }
11068
11069 for (int i = 0; i < inventory_slots.Count(); i++)
11070 {
11071 slot = inventory_slots.Get(i);
11072 }
11073
11074 if (slot != "")
11075 {
11076 if (detach_types.Count() == 1)
11077 idx = 0;
11078 else
11079 idx = inventory_slots.Find(slot);
11080 }
11081 if (idx < 0)
11082 return "";
11083
11084 return detach_types.Get(idx);
11085 }
11086
11088 {
11089
11091
11092
11093 float min_time = 1;
11094 float max_time = 3;
11095 float delay = Math.RandomFloat(min_time, max_time);
11096
11097 explode_timer.Run(delay, this, "DoAmmoExplosion");
11098 }
11099
11101 {
11102 Magazine magazine = Magazine.Cast(this);
11103 int pop_sounds_count = 6;
11104 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11105
11106
11107 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11108 string sound_name = pop_sounds[ sound_idx ];
11110
11111
11112 magazine.ServerAddAmmoCount(-1);
11113
11114
11115 float min_temp_to_explode = 100;
11116
11117 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11118 {
11120 }
11121 }
11122
11123
11124 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11125 {
11126 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11127
11128 const int CHANCE_DAMAGE_CARGO = 4;
11129 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11130 const int CHANCE_DAMAGE_NOTHING = 2;
11131
11133 {
11134 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11135 int chances;
11136 int rnd;
11137
11138 if (GetInventory().GetCargo())
11139 {
11140 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11141 rnd = Math.RandomInt(0,chances);
11142
11143 if (rnd < CHANCE_DAMAGE_CARGO)
11144 {
11146 }
11147 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11148 {
11150 }
11151 }
11152 else
11153 {
11154 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11155 rnd = Math.RandomInt(0,chances);
11156
11157 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11158 {
11160 }
11161 }
11162 }
11163 }
11164
11166 {
11167 if (GetInventory().GetCargo())
11168 {
11169 int item_count = GetInventory().GetCargo().GetItemCount();
11170 if (item_count > 0)
11171 {
11172 int random_pick = Math.RandomInt(0, item_count);
11174 if (!item.IsExplosive())
11175 {
11176 item.AddHealth("","",damage);
11177 return true;
11178 }
11179 }
11180 }
11181 return false;
11182 }
11183
11185 {
11186 int attachment_count = GetInventory().AttachmentCount();
11187 if (attachment_count > 0)
11188 {
11189 int random_pick = Math.RandomInt(0, attachment_count);
11190 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11191 if (!attachment.IsExplosive())
11192 {
11193 attachment.AddHealth("","",damage);
11194 return true;
11195 }
11196 }
11197 return false;
11198 }
11199
11201 {
11203 }
11204
11206 {
11208 return GetInventory().CanRemoveEntity();
11209
11210 return false;
11211 }
11212
11214 {
11215
11217 return false;
11218
11219
11221 return false;
11222
11223
11224
11226 if (delta == 0)
11227 return false;
11228
11229
11230 return true;
11231 }
11232
11234 {
11236 {
11237 if (ScriptInputUserData.CanStoreInputUserData())
11238 {
11239 ScriptInputUserData ctx = new ScriptInputUserData;
11244 ctx.
Write(destination_entity);
11246 ctx.
Write(slot_id);
11248 }
11249 }
11250 else if (!
GetGame().IsMultiplayer())
11251 {
11253 }
11254 }
11255
11257 {
11258 float split_quantity_new;
11262 InventoryLocation loc = new InventoryLocation;
11263
11264 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11265 {
11267 split_quantity_new = stack_max;
11268 else
11270
11272 {
11273 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11274 if (new_item)
11275 {
11276 new_item.SetResultOfSplit(true);
11277 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11279 new_item.
SetQuantity(split_quantity_new,
false,
true);
11280 }
11281 }
11282 }
11283 else if (destination_entity && slot_id == -1)
11284 {
11285 if (quantity > stack_max)
11286 split_quantity_new = stack_max;
11287 else
11288 split_quantity_new = quantity;
11289
11291 {
11293 {
11296 }
11297
11298 if (new_item)
11299 {
11300 new_item.SetResultOfSplit(true);
11301 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11303 new_item.
SetQuantity(split_quantity_new,
false,
true);
11304 }
11305 }
11306 }
11307 else
11308 {
11309 if (stack_max != 0)
11310 {
11312 {
11314 }
11315
11316 if (split_quantity_new == 0)
11317 {
11318 if (!
GetGame().IsMultiplayer())
11319 player.PhysicalPredictiveDropItem(this);
11320 else
11321 player.ServerDropEntity(this);
11322 return;
11323 }
11324
11326 {
11328
11329 if (new_item)
11330 {
11331 new_item.SetResultOfSplit(true);
11332 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11335 new_item.PlaceOnSurface();
11336 }
11337 }
11338 }
11339 }
11340 }
11341
11343 {
11344 float split_quantity_new;
11348 InventoryLocation loc = new InventoryLocation;
11349
11350 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11351 {
11353 split_quantity_new = stack_max;
11354 else
11356
11358 {
11359 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11360 if (new_item)
11361 {
11362 new_item.SetResultOfSplit(true);
11363 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11365 new_item.
SetQuantity(split_quantity_new,
false,
true);
11366 }
11367 }
11368 }
11369 else if (destination_entity && slot_id == -1)
11370 {
11371 if (quantity > stack_max)
11372 split_quantity_new = stack_max;
11373 else
11374 split_quantity_new = quantity;
11375
11377 {
11379 {
11382 }
11383
11384 if (new_item)
11385 {
11386 new_item.SetResultOfSplit(true);
11387 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11389 new_item.
SetQuantity(split_quantity_new,
false,
true);
11390 }
11391 }
11392 }
11393 else
11394 {
11395 if (stack_max != 0)
11396 {
11398 {
11400 }
11401
11403 {
11405
11406 if (new_item)
11407 {
11408 new_item.SetResultOfSplit(true);
11409 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11412 new_item.PlaceOnSurface();
11413 }
11414 }
11415 }
11416 }
11417 }
11418
11420 {
11422 {
11423 if (ScriptInputUserData.CanStoreInputUserData())
11424 {
11425 ScriptInputUserData ctx = new ScriptInputUserData;
11430 dst.WriteToContext(ctx);
11432 }
11433 }
11434 else if (!
GetGame().IsMultiplayer())
11435 {
11437 }
11438 }
11439
11441 {
11443 {
11444 if (ScriptInputUserData.CanStoreInputUserData())
11445 {
11446 ScriptInputUserData ctx = new ScriptInputUserData;
11451 ctx.
Write(destination_entity);
11457 }
11458 }
11459 else if (!
GetGame().IsMultiplayer())
11460 {
11462 }
11463 }
11464
11466 {
11468 }
11469
11471 {
11473 float split_quantity_new;
11475 if (dst.IsValid())
11476 {
11477 int slot_id = dst.GetSlot();
11479
11480 if (quantity > stack_max)
11481 split_quantity_new = stack_max;
11482 else
11483 split_quantity_new = quantity;
11484
11486 {
11488
11489 if (new_item)
11490 {
11491 new_item.SetResultOfSplit(true);
11492 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11494 new_item.
SetQuantity(split_quantity_new,
false,
true);
11495 }
11496
11497 return new_item;
11498 }
11499 }
11500
11501 return null;
11502 }
11503
11505 {
11507 float split_quantity_new;
11509 if (destination_entity)
11510 {
11512 if (quantity > stackable)
11513 split_quantity_new = stackable;
11514 else
11515 split_quantity_new = quantity;
11516
11518 {
11519 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11520 if (new_item)
11521 {
11522 new_item.SetResultOfSplit(true);
11523 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11525 new_item.
SetQuantity(split_quantity_new,
false,
true);
11526 }
11527 }
11528 }
11529 }
11530
11532 {
11534 {
11535 if (ScriptInputUserData.CanStoreInputUserData())
11536 {
11537 ScriptInputUserData ctx = new ScriptInputUserData;
11542 ItemBase destination_entity =
this;
11543 ctx.
Write(destination_entity);
11547 }
11548 }
11549 else if (!
GetGame().IsMultiplayer())
11550 {
11552 }
11553 }
11554
11556 {
11558 float split_quantity_new;
11560 if (player)
11561 {
11563 if (quantity > stackable)
11564 split_quantity_new = stackable;
11565 else
11566 split_quantity_new = quantity;
11567
11569 {
11570 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11571 new_item =
ItemBase.Cast(in_hands);
11572 if (new_item)
11573 {
11574 new_item.SetResultOfSplit(true);
11575 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11577 new_item.SetQuantity(split_quantity_new, false, true);
11578 }
11579 }
11580 }
11581 }
11582
11584 {
11586 float split_quantity_new = Math.Floor(quantity * 0.5);
11587
11589 return;
11590
11592
11593 if (new_item)
11594 {
11595 if (new_item.GetQuantityMax() < split_quantity_new)
11596 {
11597 split_quantity_new = new_item.GetQuantityMax();
11598 }
11599
11600 new_item.SetResultOfSplit(true);
11601 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11602
11604 {
11607 }
11608 else
11609 {
11611 new_item.
SetQuantity(split_quantity_new,
false,
true);
11612 }
11613 }
11614 }
11615
11617 {
11619 float split_quantity_new = Math.Floor(quantity / 2);
11620
11622 return;
11623
11624 InventoryLocation invloc = new InventoryLocation;
11626
11628 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11629
11630 if (new_item)
11631 {
11632 if (new_item.GetQuantityMax() < split_quantity_new)
11633 {
11634 split_quantity_new = new_item.GetQuantityMax();
11635 }
11637 {
11640 }
11641 else if (split_quantity_new > 1)
11642 {
11644 new_item.
SetQuantity(split_quantity_new,
false,
true);
11645 }
11646 }
11647 }
11648
11651 {
11652 SetWeightDirty();
11654
11655 if (parent)
11656 parent.OnAttachmentQuantityChangedEx(this, delta);
11657
11659 {
11661 {
11663 }
11665 {
11666 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11668 }
11669 }
11670
11671 }
11672
11675 {
11676
11677 }
11678
11681 {
11683 }
11684
11686 {
11687 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11688
11690 {
11691 if (newLevel == GameConstants.STATE_RUINED)
11692 {
11694 EntityAI parent = GetHierarchyParent();
11695 if (parent && parent.IsFireplace())
11696 {
11697 CargoBase cargo = GetInventory().GetCargo();
11698 if (cargo)
11699 {
11701 {
11703 }
11704 }
11705 }
11706 }
11707
11709 {
11710
11712 return;
11713 }
11714
11715 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11716 {
11718 }
11719 }
11720 }
11721
11722
11724 {
11725 super.OnRightClick();
11726
11728 {
11730 {
11731 if (ScriptInputUserData.CanStoreInputUserData())
11732 {
11733 EntityAI root = GetHierarchyRoot();
11734 Man playerOwner = GetHierarchyRootPlayer();
11735 InventoryLocation dst = new InventoryLocation;
11736
11737
11738 if (!playerOwner && root && root == this)
11739 {
11741 }
11742 else
11743 {
11744
11745 GetInventory().GetCurrentInventoryLocation(dst);
11747 {
11750 {
11752 }
11753 else
11754 {
11756
11757
11758 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11759 {
11761 }
11762 else
11763 {
11764 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11765 }
11766 }
11767 }
11768 }
11769
11770 ScriptInputUserData ctx = new ScriptInputUserData;
11778 }
11779 }
11780 else if (!
GetGame().IsMultiplayer())
11781 {
11783 }
11784 }
11785 }
11786
11788 {
11789 if (root)
11790 {
11791 vector m4[4];
11792 root.GetTransform(m4);
11793 dst.SetGround(this, m4);
11794 }
11795 else
11796 {
11797 GetInventory().GetCurrentInventoryLocation(dst);
11798 }
11799 }
11800
11801 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11802 {
11803
11804 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11805 return false;
11806
11807 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11808 return false;
11809
11810
11812 return false;
11813
11814
11815 Magazine mag = Magazine.Cast(this);
11816 if (mag)
11817 {
11818 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11819 return false;
11820
11821 if (stack_max_limit)
11822 {
11823 Magazine other_mag = Magazine.Cast(other_item);
11824 if (other_item)
11825 {
11826 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11827 return false;
11828 }
11829
11830 }
11831 }
11832 else
11833 {
11834
11836 return false;
11837
11839 return false;
11840 }
11841
11842 PlayerBase player = null;
11843 if (CastTo(player, GetHierarchyRootPlayer()))
11844 {
11845 if (player.GetInventory().HasAttachment(this))
11846 return false;
11847
11848 if (player.IsItemsToDelete())
11849 return false;
11850 }
11851
11852 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11853 return false;
11854
11855 int slotID;
11857 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11858 return false;
11859
11860 return true;
11861 }
11862
11864 {
11866 }
11867
11869 {
11870 return m_IsResultOfSplit;
11871 }
11872
11874 {
11875 m_IsResultOfSplit = value;
11876 }
11877
11879 {
11881 }
11882
11884 {
11885 float other_item_quantity = other_item.GetQuantity();
11886 float this_free_space;
11887
11889
11891
11892 if (other_item_quantity > this_free_space)
11893 {
11894 return this_free_space;
11895 }
11896 else
11897 {
11898 return other_item_quantity;
11899 }
11900 }
11901
11903 {
11905 }
11906
11908 {
11910 return;
11911
11912 if (!IsMagazine() && other_item)
11913 {
11915 if (quantity_used != 0)
11916 {
11917 float hp1 = GetHealth01("","");
11918 float hp2 = other_item.GetHealth01("","");
11919 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11920 hpResult = hpResult / (
GetQuantity() + quantity_used);
11921
11922 hpResult *= GetMaxHealth();
11923 Math.Round(hpResult);
11924 SetHealth("", "Health", hpResult);
11925
11927 other_item.AddQuantity(-quantity_used);
11928 }
11929 }
11931 }
11932
11934 {
11935 #ifdef SERVER
11936 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11937 GetHierarchyParent().IncreaseLifetimeUp();
11938 #endif
11939 };
11940
11942 {
11943 PlayerBase p = PlayerBase.Cast(player);
11944
11945 array<int> recipesIds = p.m_Recipes;
11946 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11947 if (moduleRecipesManager)
11948 {
11949 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11950 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11951 }
11952
11953 for (int i = 0;i < recipesIds.Count(); i++)
11954 {
11955 int key = recipesIds.Get(i);
11956 string recipeName = moduleRecipesManager.GetRecipeName(key);
11958 }
11959 }
11960
11961
11962 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11963 {
11964 super.GetDebugActions(outputList);
11965
11966
11972
11973
11978
11983
11984
11988
11989
11991 {
11995 }
11996
11999
12000
12004
12006
12007 InventoryLocation loc = new InventoryLocation();
12008 GetInventory().GetCurrentInventoryLocation(loc);
12010 {
12011 if (Gizmo_IsSupported())
12014 }
12015
12017 }
12018
12019
12020
12021
12023 {
12024 super.OnAction(action_id, player, ctx);
12025
12027 {
12028 switch (action_id)
12029 {
12032 return true;
12035 return true;
12036 }
12037 }
12038
12040 {
12041 switch (action_id)
12042 {
12044 Delete();
12045 return true;
12046 }
12047 }
12048
12049 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
12050 {
12051 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12052 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
12053 PlayerBase p = PlayerBase.Cast(player);
12054 if (
EActions.RECIPES_RANGE_START < 1000)
12055 {
12056 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
12057 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
12058 }
12059 }
12060 #ifndef SERVER
12061 else if (action_id ==
EActions.WATCH_PLAYER)
12062 {
12063 PluginDeveloper.SetDeveloperItemClientEx(player);
12064 }
12065 #endif
12067 {
12068 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
12069 {
12070 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
12071 OnDebugButtonPressServer(id + 1);
12072 }
12073
12074 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
12075 {
12076 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
12078 }
12079
12080 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
12081 {
12082 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
12084 }
12085
12086 else if (action_id ==
EActions.ADD_QUANTITY)
12087 {
12088 if (IsMagazine())
12089 {
12090 Magazine mag = Magazine.Cast(this);
12091 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
12092 }
12093 else
12094 {
12096 }
12097
12098 if (m_EM)
12099 {
12100 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12101 }
12102
12103 }
12104
12105 else if (action_id ==
EActions.REMOVE_QUANTITY)
12106 {
12107 if (IsMagazine())
12108 {
12109 Magazine mag2 = Magazine.Cast(this);
12110 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12111 }
12112 else
12113 {
12115 }
12116 if (m_EM)
12117 {
12118 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12119 }
12120
12121 }
12122
12123 else if (action_id ==
EActions.SET_QUANTITY_0)
12124 {
12126
12127 if (m_EM)
12128 {
12129 m_EM.SetEnergy(0);
12130 }
12131 }
12132
12133 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12134 {
12136
12137 if (m_EM)
12138 {
12139 m_EM.SetEnergy(m_EM.GetEnergyMax());
12140 }
12141 }
12142
12143 else if (action_id ==
EActions.ADD_HEALTH)
12144 {
12145 AddHealth("","",GetMaxHealth("","Health")/5);
12146 }
12147 else if (action_id ==
EActions.REMOVE_HEALTH)
12148 {
12149 AddHealth("","",-GetMaxHealth("","Health")/5);
12150 }
12151 else if (action_id ==
EActions.DESTROY_HEALTH)
12152 {
12153 SetHealth01("","",0);
12154 }
12155 else if (action_id ==
EActions.WATCH_ITEM)
12156 {
12158 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12159 #ifdef DEVELOPER
12160 SetDebugDeveloper_item(this);
12161 #endif
12162 }
12163
12164 else if (action_id ==
EActions.ADD_TEMPERATURE)
12165 {
12166 AddTemperature(20);
12167
12168 }
12169
12170 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12171 {
12172 AddTemperature(-20);
12173
12174 }
12175
12176 else if (action_id ==
EActions.FLIP_FROZEN)
12177 {
12178 SetFrozen(!GetIsFrozen());
12179
12180 }
12181
12182 else if (action_id ==
EActions.ADD_WETNESS)
12183 {
12185
12186 }
12187
12188 else if (action_id ==
EActions.REMOVE_WETNESS)
12189 {
12191
12192 }
12193
12194 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12195 {
12198
12199
12200 }
12201
12202 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12203 {
12206 }
12207
12208 else if (action_id ==
EActions.MAKE_SPECIAL)
12209 {
12210 auto debugParams = DebugSpawnParams.WithPlayer(player);
12211 OnDebugSpawnEx(debugParams);
12212 }
12213
12214 }
12215
12216
12217 return false;
12218 }
12219
12220
12221
12222
12226
12229
12230
12231
12233 {
12234 return false;
12235 }
12236
12237
12239 {
12240 return true;
12241 }
12242
12243
12245 {
12246 return true;
12247 }
12248
12249
12250
12252 {
12253 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12255 }
12256
12259 {
12260 return null;
12261 }
12262
12264 {
12265 return false;
12266 }
12267
12269 {
12270 return false;
12271 }
12272
12276
12277
12279 {
12280 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12281 return module_repairing.CanRepair(this, item_repair_kit);
12282 }
12283
12284
12285 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12286 {
12287 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12288 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12289 }
12290
12291
12293 {
12294
12295
12296
12297
12298
12299
12300
12301
12302 return 1;
12303 }
12304
12305
12306
12308 {
12310 }
12311
12312
12313
12315 {
12317 }
12318
12319
12328 {
12329 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12330
12331 if (player)
12332 {
12333 player.MessageStatus(text);
12334 }
12335 }
12336
12337
12346 {
12347 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12348
12349 if (player)
12350 {
12351 player.MessageAction(text);
12352 }
12353 }
12354
12355
12364 {
12365 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12366
12367 if (player)
12368 {
12369 player.MessageFriendly(text);
12370 }
12371 }
12372
12373
12382 {
12383 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12384
12385 if (player)
12386 {
12387 player.MessageImportant(text);
12388 }
12389 }
12390
12392 {
12393 return true;
12394 }
12395
12396
12397 override bool KindOf(
string tag)
12398 {
12399 bool found = false;
12400 string item_name = this.
GetType();
12403
12404 int array_size = item_tag_array.Count();
12405 for (int i = 0; i < array_size; i++)
12406 {
12407 if (item_tag_array.Get(i) == tag)
12408 {
12409 found = true;
12410 break;
12411 }
12412 }
12413 return found;
12414 }
12415
12416
12418 {
12419
12420 super.OnRPC(sender, rpc_type,ctx);
12421
12422
12423 switch (rpc_type)
12424 {
12425 #ifndef SERVER
12426 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12427 Param2<bool, string> p = new Param2<bool, string>(false, "");
12428
12430 return;
12431
12432 bool play = p.param1;
12433 string soundSet = p.param2;
12434
12435 if (play)
12436 {
12438 {
12440 {
12442 }
12443 }
12444 else
12445 {
12447 }
12448 }
12449 else
12450 {
12452 }
12453
12454 break;
12455 #endif
12456
12457 }
12458
12460 {
12462 }
12463 }
12464
12465
12466
12467
12469 {
12470 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12471 return plugin.GetID(
name);
12472 }
12473
12475 {
12476 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12477 return plugin.GetName(id);
12478 }
12479
12482 {
12483
12484
12485 int varFlags;
12486 if (!ctx.
Read(varFlags))
12487 return;
12488
12489 if (varFlags & ItemVariableFlags.FLOAT)
12490 {
12492 }
12493 }
12494
12496 {
12497
12498 super.SerializeNumericalVars(floats_out);
12499
12500
12501
12503 {
12505 }
12506
12508 {
12510 }
12511
12513 {
12515 }
12516
12518 {
12523 }
12524
12526 {
12528 }
12529 }
12530
12532 {
12533
12534 super.DeSerializeNumericalVars(floats);
12535
12536
12537 int index = 0;
12538 int mask = Math.Round(floats.Get(index));
12539
12540 index++;
12541
12543 {
12545 {
12547 }
12548 else
12549 {
12550 float quantity = floats.Get(index);
12551 SetQuantity(quantity,
true,
false,
false,
false);
12552 }
12553 index++;
12554 }
12555
12557 {
12558 float wet = floats.Get(index);
12560 index++;
12561 }
12562
12564 {
12565 int liquidtype = Math.Round(floats.Get(index));
12567 index++;
12568 }
12569
12571 {
12573 index++;
12575 index++;
12577 index++;
12579 index++;
12580 }
12581
12583 {
12584 int cleanness = Math.Round(floats.Get(index));
12586 index++;
12587 }
12588 }
12589
12591 {
12592 super.WriteVarsToCTX(ctx);
12593
12594
12596 {
12598 }
12599
12601 {
12603 }
12604
12606 {
12608 }
12609
12611 {
12612 int r,g,b,a;
12618 }
12619
12621 {
12623 }
12624 }
12625
12627 {
12628 if (!super.ReadVarsFromCTX(ctx,version))
12629 return false;
12630
12631 int intValue;
12632 float value;
12633
12634 if (version < 140)
12635 {
12636 if (!ctx.
Read(intValue))
12637 return false;
12638
12639 m_VariablesMask = intValue;
12640 }
12641
12643 {
12644 if (!ctx.
Read(value))
12645 return false;
12646
12648 {
12650 }
12651 else
12652 {
12654 }
12655 }
12656
12657 if (version < 140)
12658 {
12660 {
12661 if (!ctx.
Read(value))
12662 return false;
12663 SetTemperatureDirect(value);
12664 }
12665 }
12666
12668 {
12669 if (!ctx.
Read(value))
12670 return false;
12672 }
12673
12675 {
12676 if (!ctx.
Read(intValue))
12677 return false;
12679 }
12680
12682 {
12683 int r,g,b,a;
12685 return false;
12687 return false;
12689 return false;
12691 return false;
12692
12694 }
12695
12697 {
12698 if (!ctx.
Read(intValue))
12699 return false;
12701 }
12702
12703 if (version >= 138 && version < 140)
12704 {
12706 {
12707 if (!ctx.
Read(intValue))
12708 return false;
12709 SetFrozen(intValue);
12710 }
12711 }
12712
12713 return true;
12714 }
12715
12716
12718 {
12721 {
12723 }
12724
12725 if (!super.OnStoreLoad(ctx, version))
12726 {
12728 return false;
12729 }
12730
12731 if (version >= 114)
12732 {
12733 bool hasQuickBarIndexSaved;
12734
12735 if (!ctx.
Read(hasQuickBarIndexSaved))
12736 {
12738 return false;
12739 }
12740
12741 if (hasQuickBarIndexSaved)
12742 {
12743 int itmQBIndex;
12744
12745
12746 if (!ctx.
Read(itmQBIndex))
12747 {
12749 return false;
12750 }
12751
12752 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12753 if (itmQBIndex != -1 && parentPlayer)
12754 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12755 }
12756 }
12757 else
12758 {
12759
12760 PlayerBase player;
12761 int itemQBIndex;
12762 if (version ==
int.
MAX)
12763 {
12764 if (!ctx.
Read(itemQBIndex))
12765 {
12767 return false;
12768 }
12769 }
12770 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12771 {
12772
12773 if (!ctx.
Read(itemQBIndex))
12774 {
12776 return false;
12777 }
12778 if (itemQBIndex != -1 && player)
12779 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12780 }
12781 }
12782
12783 if (version < 140)
12784 {
12785
12786 if (!LoadVariables(ctx, version))
12787 {
12789 return false;
12790 }
12791 }
12792
12793
12795 {
12797 return false;
12798 }
12799 if (version >= 132)
12800 {
12802 if (raib)
12803 {
12805 {
12807 return false;
12808 }
12809 }
12810 }
12811
12813 return true;
12814 }
12815
12816
12817
12819 {
12820 super.OnStoreSave(ctx);
12821
12822 PlayerBase player;
12823 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12824 {
12826
12827 int itemQBIndex = -1;
12828 itemQBIndex = player.FindQuickBarEntityIndex(this);
12829 ctx.
Write(itemQBIndex);
12830 }
12831 else
12832 {
12834 }
12835
12837
12839 if (raib)
12840 {
12842 }
12843 }
12844
12845
12847 {
12848 super.AfterStoreLoad();
12849
12851 {
12853 }
12854
12856 {
12859 }
12860 }
12861
12863 {
12864 super.EEOnAfterLoad();
12865
12867 {
12869 }
12870
12873 }
12874
12876 {
12877 return false;
12878 }
12879
12880
12881
12883 {
12885 {
12886 #ifdef PLATFORM_CONSOLE
12887
12889 {
12891 if (menu)
12892 {
12894 }
12895 }
12896 #endif
12897 }
12898
12900 {
12903 }
12904
12906 {
12907 SetWeightDirty();
12909 }
12911 {
12914 }
12915
12917 {
12920 }
12922 {
12925 }
12926
12927 super.OnVariablesSynchronized();
12928 }
12929
12930
12931
12933 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12934 {
12935 if (!IsServerCheck(allow_client))
12936 return false;
12937
12939 return false;
12940
12943
12944 if (value <= (min + 0.001))
12945 value = min;
12946
12947 if (value == min)
12948 {
12949 if (destroy_config)
12950 {
12951 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12952 if (dstr)
12953 {
12955 this.Delete();
12956 return true;
12957 }
12958 }
12959 else if (destroy_forced)
12960 {
12962 this.Delete();
12963 return true;
12964 }
12965
12967 }
12968
12971
12973 {
12975
12976 if (delta)
12978 }
12979
12981
12982 return false;
12983 }
12984
12985
12987 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12988 {
12990 }
12991
12993 {
12996 }
12997
12999 {
13002 }
13003
13005 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
13006 {
13007 float value_clamped = Math.Clamp(value, 0, 1);
13009 SetQuantity(result, destroy_config, destroy_forced);
13010 }
13011
13012
13015 {
13017 }
13018
13020 {
13022 }
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13034 {
13035 int slot = -1;
13036 if (GetInventory())
13037 {
13038 InventoryLocation il = new InventoryLocation;
13039 GetInventory().GetCurrentInventoryLocation(il);
13041 }
13042
13044 }
13045
13047 {
13048 float quantity_max = 0;
13049
13051 {
13052 if (attSlotID != -1)
13053 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
13054
13055 if (quantity_max <= 0)
13057 }
13058
13059 if (quantity_max <= 0)
13061
13062 return quantity_max;
13063 }
13064
13066 {
13068 }
13069
13071 {
13073 }
13074
13075
13077 {
13079 }
13080
13082 {
13084 }
13085
13087 {
13089 }
13090
13091
13093 {
13094
13095 float weightEx = GetWeightEx();
13096 float special = GetInventoryAndCargoWeight();
13097 return weightEx - special;
13098 }
13099
13100
13102 {
13104 }
13105
13107 {
13109 {
13110 #ifdef DEVELOPER
13111 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13112 {
13113 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13115 }
13116 #endif
13117
13118 return GetQuantity() * GetConfigWeightModified();
13119 }
13120 else if (HasEnergyManager())
13121 {
13122 #ifdef DEVELOPER
13123 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13124 {
13125 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13126 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13127 }
13128 #endif
13129 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13130 }
13131 else
13132 {
13133 #ifdef DEVELOPER
13134 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13135 {
13136 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13137 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13138 }
13139 #endif
13140 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13141 }
13142 }
13143
13146 {
13147 int item_count = 0;
13149
13150 if (GetInventory().GetCargo() != NULL)
13151 {
13152 item_count = GetInventory().GetCargo().GetItemCount();
13153 }
13154
13155 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13156 {
13157 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13158 if (item)
13159 item_count += item.GetNumberOfItems();
13160 }
13161 return item_count;
13162 }
13163
13166 {
13167 float weight = 0;
13168 float wetness = 1;
13169 if (include_wetness)
13172 {
13173 weight = wetness * m_ConfigWeight;
13174 }
13176 {
13177 weight = 1;
13178 }
13179 return weight;
13180 }
13181
13182
13183
13185 {
13186 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13187 {
13188 GameInventory inv = GetInventory();
13189 array<EntityAI> items = new array<EntityAI>;
13191 for (int i = 0; i < items.Count(); i++)
13192 {
13194 if (item)
13195 {
13197 }
13198 }
13199 }
13200 }
13201
13202
13203
13204
13206 {
13207 float energy = 0;
13208 if (HasEnergyManager())
13209 {
13210 energy = GetCompEM().GetEnergy();
13211 }
13212 return energy;
13213 }
13214
13215
13217 {
13218 super.OnEnergyConsumed();
13219
13221 }
13222
13224 {
13225 super.OnEnergyAdded();
13226
13228 }
13229
13230
13232 {
13233 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13234 {
13236 {
13237 float energy_0to1 = GetCompEM().GetEnergy0To1();
13239 }
13240 }
13241 }
13242
13243
13245 {
13246 return ConfigGetFloat("heatIsolation");
13247 }
13248
13250 {
13252 }
13253
13255 {
13256 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13257 if (
GetGame().ConfigIsExisting(paramPath))
13259
13260 return 0.0;
13261 }
13262
13264 {
13265 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13266 if (
GetGame().ConfigIsExisting(paramPath))
13268
13269 return 0.0;
13270 }
13271
13272 override void SetWet(
float value,
bool allow_client =
false)
13273 {
13274 if (!IsServerCheck(allow_client))
13275 return;
13276
13279
13281
13282 m_VarWet = Math.Clamp(value, min, max);
13283
13285 {
13288 }
13289 }
13290
13291 override void AddWet(
float value)
13292 {
13294 }
13295
13297 {
13299 }
13300
13302 {
13304 }
13305
13307 {
13309 }
13310
13312 {
13314 }
13315
13317 {
13319 }
13320
13321 override void OnWetChanged(
float newVal,
float oldVal)
13322 {
13325 if (newLevel != oldLevel)
13326 {
13328 }
13329 }
13330
13332 {
13333 SetWeightDirty();
13334 }
13335
13337 {
13338 return GetWetLevelInternal(
m_VarWet);
13339 }
13340
13341
13342
13344 {
13346 }
13347
13349 {
13351 }
13352
13354 {
13356 }
13357
13359 {
13361 }
13362
13363
13364
13366 {
13367 if (ConfigIsExisting("itemModelLength"))
13368 {
13369 return ConfigGetFloat("itemModelLength");
13370 }
13371 return 0;
13372 }
13373
13375 {
13376 if (ConfigIsExisting("itemAttachOffset"))
13377 {
13378 return ConfigGetFloat("itemAttachOffset");
13379 }
13380 return 0;
13381 }
13382
13383 override void SetCleanness(
int value,
bool allow_client =
false)
13384 {
13385 if (!IsServerCheck(allow_client))
13386 return;
13387
13389
13391
13394 }
13395
13397 {
13399 }
13400
13402 {
13403 return true;
13404 }
13405
13406
13407
13408
13410 {
13412 }
13413
13415 {
13417 }
13418
13419
13420
13421
13422 override void SetColor(
int r,
int g,
int b,
int a)
13423 {
13429 }
13431 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13432 {
13437 }
13438
13440 {
13442 }
13443
13446 {
13447 int r,g,b,a;
13449 r = r/255;
13450 g = g/255;
13451 b = b/255;
13452 a = a/255;
13453 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13454 }
13455
13456
13457
13458 override void SetLiquidType(
int value,
bool allow_client =
false)
13459 {
13460 if (!IsServerCheck(allow_client))
13461 return;
13462
13467 }
13468
13470 {
13471 return ConfigGetInt("varLiquidTypeInit");
13472 }
13473
13475 {
13477 }
13478
13480 {
13482 SetFrozen(false);
13483 }
13484
13487 {
13488 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13489 }
13490
13491
13494 {
13495 PlayerBase nplayer;
13496 if (PlayerBase.CastTo(nplayer, player))
13497 {
13499
13500 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13501 }
13502 }
13503
13504
13507 {
13508 PlayerBase nplayer;
13509 if (PlayerBase.CastTo(nplayer,player))
13510 {
13511
13512 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13513
13514 }
13515
13516
13517 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13518
13519
13520 if (HasEnergyManager())
13521 {
13522 GetCompEM().UpdatePlugState();
13523 }
13524 }
13525
13526
13528 {
13529 super.OnPlacementStarted(player);
13530
13532 }
13533
13534 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13535 {
13537 {
13538 m_AdminLog.OnPlacementComplete(player,
this);
13539 }
13540
13541 super.OnPlacementComplete(player, position, orientation);
13542 }
13543
13544
13545
13546
13547
13549 {
13551 {
13552 return true;
13553 }
13554 else
13555 {
13556 return false;
13557 }
13558 }
13559
13560
13562 {
13564 {
13566 }
13567 }
13568
13569
13571 {
13573 }
13574
13576 {
13578 }
13579
13580 override void InsertAgent(
int agent,
float count = 1)
13581 {
13582 if (count < 1)
13583 return;
13584
13586 }
13587
13590 {
13592 }
13593
13594
13596 {
13598 }
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13642 {
13644 return false;
13645 return true;
13646 }
13647
13649 {
13650
13652 }
13653
13654
13657 {
13658 super.CheckForRoofLimited(timeTresholdMS);
13659
13661 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13662 {
13663 m_PreviousRoofTestTime = time;
13664 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13665 }
13666 }
13667
13668
13670 {
13672 {
13673 return 0;
13674 }
13675
13676 if (GetInventory().GetAttachmentSlotsCount() != 0)
13677 {
13678 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13679 if (filter)
13680 return filter.GetProtectionLevel(type, false, system);
13681 else
13682 return 0;
13683 }
13684
13685 string subclassPath, entryName;
13686
13687 switch (type)
13688 {
13690 entryName = "biological";
13691 break;
13693 entryName = "chemical";
13694 break;
13695 default:
13696 entryName = "biological";
13697 break;
13698 }
13699
13700 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13701
13703 }
13704
13705
13706
13709 {
13710 if (!IsMagazine())
13712
13714 }
13715
13716
13717
13718
13719
13724 {
13725 return true;
13726 }
13727
13729 {
13731 }
13732
13733
13734
13735
13736
13738 {
13739 if (parent)
13740 {
13741 if (parent.IsInherited(DayZInfected))
13742 return true;
13743
13744 if (!parent.IsRuined())
13745 return true;
13746 }
13747
13748 return true;
13749 }
13750
13752 {
13753 if (!super.CanPutAsAttachment(parent))
13754 {
13755 return false;
13756 }
13757
13758 if (!IsRuined() && !parent.IsRuined())
13759 {
13760 return true;
13761 }
13762
13763 return false;
13764 }
13765
13767 {
13768
13769
13770
13771
13772 return super.CanReceiveItemIntoCargo(item);
13773 }
13774
13776 {
13777
13778
13779
13780
13781 GameInventory attachmentInv = attachment.GetInventory();
13783 {
13784 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13785 return false;
13786 }
13787
13788 InventoryLocation loc = new InventoryLocation();
13789 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13790 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13791 return false;
13792
13793 return super.CanReceiveAttachment(attachment, slotId);
13794 }
13795
13797 {
13798 if (!super.CanReleaseAttachment(attachment))
13799 return false;
13800
13801 return GetInventory().AreChildrenAccessible();
13802 }
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13825 {
13826 int id = muzzle_owner.GetMuzzleID();
13827 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13828
13829 if (WPOF_array)
13830 {
13831 for (int i = 0; i < WPOF_array.Count(); i++)
13832 {
13833 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13834
13835 if (WPOF)
13836 {
13837 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13838 }
13839 }
13840 }
13841 }
13842
13843
13845 {
13846 int id = muzzle_owner.GetMuzzleID();
13848
13849 if (WPOBE_array)
13850 {
13851 for (int i = 0; i < WPOBE_array.Count(); i++)
13852 {
13853 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13854
13855 if (WPOBE)
13856 {
13857 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13858 }
13859 }
13860 }
13861 }
13862
13863
13865 {
13866 int id = muzzle_owner.GetMuzzleID();
13867 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13868
13869 if (WPOOH_array)
13870 {
13871 for (int i = 0; i < WPOOH_array.Count(); i++)
13872 {
13873 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13874
13875 if (WPOOH)
13876 {
13877 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13878 }
13879 }
13880 }
13881 }
13882
13883
13885 {
13886 int id = muzzle_owner.GetMuzzleID();
13887 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13888
13889 if (WPOOH_array)
13890 {
13891 for (int i = 0; i < WPOOH_array.Count(); i++)
13892 {
13893 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13894
13895 if (WPOOH)
13896 {
13897 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13898 }
13899 }
13900 }
13901 }
13902
13903
13905 {
13906 int id = muzzle_owner.GetMuzzleID();
13907 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13908
13909 if (WPOOH_array)
13910 {
13911 for (int i = 0; i < WPOOH_array.Count(); i++)
13912 {
13913 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13914
13915 if (WPOOH)
13916 {
13917 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13918 }
13919 }
13920 }
13921 }
13922
13923
13924
13926 {
13928 {
13929 return true;
13930 }
13931
13932 return false;
13933 }
13934
13936 {
13938 {
13939 return true;
13940 }
13941
13942 return false;
13943 }
13944
13946 {
13948 {
13949 return true;
13950 }
13951
13952 return false;
13953 }
13954
13956 {
13957 return false;
13958 }
13959
13962 {
13963 return UATimeSpent.DEFAULT_DEPLOY;
13964 }
13965
13966
13967
13968
13970 {
13972 SetSynchDirty();
13973 }
13974
13976 {
13978 }
13979
13980
13982 {
13983 return false;
13984 }
13985
13988 {
13989 string att_type = "None";
13990
13991 if (ConfigIsExisting("soundAttType"))
13992 {
13993 att_type = ConfigGetString("soundAttType");
13994 }
13995
13997 }
13998
14000 {
14002 }
14003
14004
14005
14006
14007
14013
14015 {
14018
14020 }
14021
14022
14024 {
14026 return;
14027
14029
14032
14035
14036 SoundParameters params = new SoundParameters();
14040 }
14041
14042
14044 {
14046 return;
14047
14049 SetSynchDirty();
14050
14053 }
14054
14055
14057 {
14059 return;
14060
14062 SetSynchDirty();
14063
14066 }
14067
14069 {
14071 }
14072
14074 {
14076 }
14077
14080 {
14081 if (!
GetGame().IsDedicatedServer())
14082 {
14083 if (ConfigIsExisting("attachSoundSet"))
14084 {
14085 string cfg_path = "";
14086 string soundset = "";
14087 string type_name =
GetType();
14088
14091 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
14092 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
14093
14094 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
14095 {
14096 for (int i = 0; i < cfg_soundset_array.Count(); i++)
14097 {
14098 if (cfg_slot_array[i] == slot_type)
14099 {
14100 soundset = cfg_soundset_array[i];
14101 break;
14102 }
14103 }
14104 }
14105
14106 if (soundset != "")
14107 {
14108 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14110 }
14111 }
14112 }
14113 }
14114
14116 {
14117
14118 }
14119
14120 void OnApply(PlayerBase player);
14121
14123 {
14124 return 1.0;
14125 };
14126
14128 {
14130 }
14131
14133 {
14135 }
14136
14138
14140 {
14141 SetDynamicPhysicsLifeTime(0.01);
14143 }
14144
14146 {
14147 array<string> zone_names = new array<string>;
14148 GetDamageZones(zone_names);
14149 for (int i = 0; i < zone_names.Count(); i++)
14150 {
14151 SetHealthMax(zone_names.Get(i),"Health");
14152 }
14153 SetHealthMax("","Health");
14154 }
14155
14158 {
14159 float global_health = GetHealth01("","Health");
14160 array<string> zones = new array<string>;
14161 GetDamageZones(zones);
14162
14163 for (int i = 0; i < zones.Count(); i++)
14164 {
14165 SetHealth01(zones.Get(i),"Health",global_health);
14166 }
14167 }
14168
14171 {
14172 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14173 }
14174
14176 {
14177 if (!hasRootAsPlayer)
14178 {
14179 if (refParentIB)
14180 {
14181
14182 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14183 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14184
14185 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14186 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14187
14190 }
14191 else
14192 {
14193
14196 }
14197 }
14198 }
14199
14201 {
14203 {
14204 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14205 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14206 {
14207 float heatPermCoef = 1.0;
14209 while (ent)
14210 {
14211 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14212 ent = ent.GetHierarchyParent();
14213 }
14214
14215 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14216 }
14217 }
14218 }
14219
14221 {
14222
14223 EntityAI parent = GetHierarchyParent();
14224 if (!parent)
14225 {
14226 hasParent = false;
14227 hasRootAsPlayer = false;
14228 }
14229 else
14230 {
14231 hasParent = true;
14232 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14233 refParentIB =
ItemBase.Cast(parent);
14234 }
14235 }
14236
14237 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14238 {
14239
14240 }
14241
14243 {
14244
14245 return false;
14246 }
14247
14249 {
14250
14251
14252 return false;
14253 }
14254
14256 {
14257
14258 return false;
14259 }
14260
14263 {
14264 return !GetIsFrozen() &&
IsOpen();
14265 }
14266
14268 {
14269 bool hasParent = false, hasRootAsPlayer = false;
14271
14272 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14273 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14274
14275 if (wwtu || foodDecay)
14276 {
14280
14281 if (processWetness || processTemperature || processDecay)
14282 {
14284
14285 if (processWetness)
14286 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14287
14288 if (processTemperature)
14290
14291 if (processDecay)
14292 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14293 }
14294 }
14295 }
14296
14299 {
14301 }
14302
14304 {
14307
14308 return super.GetTemperatureFreezeThreshold();
14309 }
14310
14312 {
14315
14316 return super.GetTemperatureThawThreshold();
14317 }
14318
14320 {
14323
14324 return super.GetItemOverheatThreshold();
14325 }
14326
14328 {
14330 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14331
14332 return super.GetTemperatureFreezeTime();
14333 }
14334
14336 {
14338 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14339
14340 return super.GetTemperatureThawTime();
14341 }
14342
14347
14349 {
14350 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14351 }
14352
14354 {
14355 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14356 }
14357
14360 {
14362 }
14363
14365 {
14367 }
14368
14370 {
14372 }
14373
14376 {
14377 return null;
14378 }
14379
14382 {
14383 return false;
14384 }
14385
14387 {
14389 {
14392 if (!trg)
14393 {
14395 explosive = this;
14396 }
14397
14398 explosive.PairRemote(trg);
14400
14401 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14402 trg.SetPersistentPairID(persistentID);
14403 explosive.SetPersistentPairID(persistentID);
14404
14405 return true;
14406 }
14407 return false;
14408 }
14409
14412 {
14413 float ret = 1.0;
14416 ret *= GetHealth01();
14417
14418 return ret;
14419 }
14420
14421 #ifdef DEVELOPER
14422 override void SetDebugItem()
14423 {
14424 super.SetDebugItem();
14425 _itemBase = this;
14426 }
14427
14429 {
14430 string text = super.GetDebugText();
14431
14433 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14434
14435 return text;
14436 }
14437 #endif
14438
14440 {
14441 return true;
14442 }
14443
14445
14447
14449 {
14452 }
14453
14454
14462
14478}
14479
14481{
14483 if (entity)
14484 {
14485 bool is_item = entity.IsInherited(
ItemBase);
14486 if (is_item && full_quantity)
14487 {
14490 }
14491 }
14492 else
14493 {
14495 return NULL;
14496 }
14497 return entity;
14498}
14499
14501{
14502 if (item)
14503 {
14504 if (health > 0)
14505 item.SetHealth("", "", health);
14506
14507 if (item.CanHaveTemperature())
14508 {
14510 if (item.CanFreeze())
14511 item.SetFrozen(false);
14512 }
14513
14514 if (item.HasEnergyManager())
14515 {
14516 if (quantity >= 0)
14517 {
14518 item.GetCompEM().SetEnergy0To1(quantity);
14519 }
14520 else
14521 {
14523 }
14524 }
14525 else if (item.IsMagazine())
14526 {
14527 Magazine mag = Magazine.Cast(item);
14528 if (quantity >= 0)
14529 {
14530 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14531 }
14532 else
14533 {
14535 }
14536
14537 }
14538 else
14539 {
14540 if (quantity >= 0)
14541 {
14542 item.SetQuantityNormalized(quantity, false);
14543 }
14544 else
14545 {
14547 }
14548
14549 }
14550 }
14551}
14552
14553#ifdef DEVELOPER
14555#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.