Adds a light source child.
9578{
9580 {
9581 return true;
9582 }
9583};
9584
9585
9586
9588{
9592
9594
9597
9598
9599
9600
9601
9610
9616
9621
9626
9647 protected bool m_IsResultOfSplit
9648
9650
9655
9656
9657
9659
9663
9664
9665
9667
9670
9671
9672
9678
9679
9687
9690
9691
9693
9694
9696
9697
9702
9703
9708
9709
9711
9712
9714 {
9719
9720 if (!
GetGame().IsDedicatedServer())
9721 {
9723 {
9725
9727 {
9729 }
9730 }
9731
9734 }
9735
9736 m_OldLocation = null;
9737
9739 {
9741 }
9742
9743 if (ConfigIsExisting("headSelectionsToHide"))
9744 {
9747 }
9748
9750 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9751 {
9753 }
9754
9756
9757 m_IsResultOfSplit = false;
9758
9760 }
9761
9763 {
9764 super.InitItemVariables();
9765
9771 m_Count = ConfigGetInt(
"count");
9772
9775
9780
9783
9788
9800
9804
9805
9808 if (ConfigIsExisting("canBeSplit"))
9809 {
9812 }
9813
9815 if (ConfigIsExisting("itemBehaviour"))
9817
9818
9821 RegisterNetSyncVariableInt("m_VarLiquidType");
9822 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9823
9824 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9825 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9826 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9827
9828 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9829 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9830 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9831 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9832
9833 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9834 RegisterNetSyncVariableBool("m_IsTakeable");
9835 RegisterNetSyncVariableBool("m_IsHologram");
9836
9839 {
9842 }
9843
9845
9847 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9849
9850 }
9851
9853 {
9855 }
9856
9858 {
9861 {
9866 }
9867 }
9868
9869 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9870 {
9872 {
9875 }
9876
9878 }
9879
9881 {
9887 }
9888
9890
9892 {
9894
9895 if (!action)
9896 {
9897 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9898 return;
9899 }
9900
9902 if (!ai)
9903 {
9905 return;
9906 }
9907
9909 if (!action_array)
9910 {
9911 action_array = new array<ActionBase_Basic>;
9913 }
9914 if (LogManager.IsActionLogEnable())
9915 {
9916 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9917 }
9918
9919 if (action_array.Find(action) != -1)
9920 {
9921 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9922 }
9923 else
9924 {
9925 action_array.Insert(action);
9926 }
9927 }
9928
9930 {
9932 ActionBase action = player.GetActionManager().GetAction(actionName);
9935
9936 if (action_array)
9937 {
9938 action_array.RemoveItem(action);
9939 }
9940 }
9941
9942
9943
9945 {
9946 ActionOverrideData overrideData = new ActionOverrideData();
9950
9952 if (!actionMap)
9953 {
9956 }
9957
9958 actionMap.Insert(this.
Type(), overrideData);
9959
9960 }
9961
9963
9965
9966
9968 {
9971
9974
9975 string config_to_search = "CfgVehicles";
9976 string muzzle_owner_config;
9977
9979 {
9980 if (IsInherited(Weapon))
9981 config_to_search = "CfgWeapons";
9982
9983 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9984
9985 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9986
9988
9989 if (config_OnFire_subclass_count > 0)
9990 {
9991 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9992
9993 for (int i = 0; i < config_OnFire_subclass_count; i++)
9994 {
9995 string particle_class = "";
9997 string config_OnFire_entry = config_OnFire_class + particle_class;
9998 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9999 WPOF_array.Insert(WPOF);
10000 }
10001
10002
10004 }
10005 }
10006
10008 {
10009 config_to_search = "CfgWeapons";
10010 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10011
10012 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
10013
10015
10016 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
10017 {
10018 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
10019
10020 for (i = 0; i < config_OnBulletCasingEject_count; i++)
10021 {
10022 string particle_class2 = "";
10024 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
10025 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
10026 WPOBE_array.Insert(WPOBE);
10027 }
10028
10029
10031 }
10032 }
10033 }
10034
10035
10037 {
10040
10042 {
10043 string config_to_search = "CfgVehicles";
10044
10045 if (IsInherited(Weapon))
10046 config_to_search = "CfgWeapons";
10047
10048 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10049 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10050
10051 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10052 {
10053
10055
10057 {
10059 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10061 return;
10062 }
10063
10066
10067
10068
10070 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10071
10072 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10073 {
10074 string particle_class = "";
10076 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10078
10079 if (entry_type == CT_CLASS)
10080 {
10081 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10082 WPOOH_array.Insert(WPOF);
10083 }
10084 }
10085
10086
10088 }
10089 }
10090 }
10091
10093 {
10095 }
10096
10098 {
10100 {
10102
10105
10108
10109 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10110 }
10111 }
10112
10114 {
10116 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10117
10119 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10120
10122 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10123
10125 {
10127 }
10128 }
10129
10131 {
10133 }
10134
10136 {
10139 else
10141
10143 {
10146 }
10147 else
10148 {
10151
10154 }
10155
10157 }
10158
10160 {
10162 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10163 }
10164
10166 {
10168 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10170 }
10171
10173 {
10175 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10176 }
10177
10179 {
10182
10183 OverheatingParticle OP = new OverheatingParticle();
10188
10190 }
10191
10193 {
10196
10197 return -1;
10198 }
10199
10201 {
10203 {
10206
10207 for (int i = count; i > 0; --i)
10208 {
10209 int id = i - 1;
10212
10215
10216 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10217 {
10218 if (p)
10219 {
10222 }
10223 }
10224 }
10225 }
10226 }
10227
10229 {
10231 {
10233 {
10234 int id = i - 1;
10236
10237 if (OP)
10238 {
10240
10241 if (p)
10242 {
10244 }
10245
10246 delete OP;
10247 }
10248 }
10249
10252 }
10253 }
10254
10257 {
10258 return 0.0;
10259 }
10260
10261
10263 {
10264 return 250;
10265 }
10266
10268 {
10269 return 0;
10270 }
10271
10274 {
10276 return true;
10277
10278 return false;
10279 }
10280
10283 {
10286
10288 {
10290 }
10291 else
10292 {
10293
10295 }
10296
10298 }
10299
10306 {
10307 return -1;
10308 }
10309
10310
10311
10312
10314 {
10316 {
10318 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10319
10320 if (r_index >= 0)
10321 {
10322 InventoryLocation r_il = new InventoryLocation;
10323 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10324
10325 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10328 {
10329 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10330 }
10332 {
10333 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10334 }
10335
10336 }
10337
10338 player.GetHumanInventory().ClearUserReservedLocation(this);
10339 }
10340
10343 }
10344
10345
10346
10347
10349 {
10350 return ItemBase.m_DebugActionsMask;
10351 }
10352
10354 {
10355 return ItemBase.m_DebugActionsMask & mask;
10356 }
10357
10359 {
10360 ItemBase.m_DebugActionsMask = mask;
10361 }
10362
10364 {
10365 ItemBase.m_DebugActionsMask |= mask;
10366 }
10367
10369 {
10370 ItemBase.m_DebugActionsMask &= ~mask;
10371 }
10372
10374 {
10376 {
10378 }
10379 else
10380 {
10382 }
10383 }
10384
10385
10387 {
10388 if (GetEconomyProfile())
10389 {
10390 float q_max = GetEconomyProfile().GetQuantityMax();
10391 if (q_max > 0)
10392 {
10393 float q_min = GetEconomyProfile().GetQuantityMin();
10394 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10395
10397 {
10398 ComponentEnergyManager comp = GetCompEM();
10400 {
10402 }
10403 }
10405 {
10407
10408 }
10409
10410 }
10411 }
10412 }
10413
10416 {
10417 EntityAI parent = GetHierarchyParent();
10418
10419 if (parent)
10420 {
10421 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10422 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10423 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10424 }
10425 }
10426
10429 {
10430 EntityAI parent = GetHierarchyParent();
10431
10432 if (parent)
10433 {
10434 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10435 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10436 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10437 }
10438 }
10439
10441 {
10442
10443
10444
10445
10447
10449 {
10450 if (ScriptInputUserData.CanStoreInputUserData())
10451 {
10452 ScriptInputUserData ctx = new ScriptInputUserData;
10458 ctx.
Write(use_stack_max);
10461
10463 {
10464 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10465 }
10466 }
10467 }
10468 else if (!
GetGame().IsMultiplayer())
10469 {
10471 }
10472 }
10473
10475 {
10477 }
10478
10480 {
10482 }
10483
10485 {
10487 }
10488
10490 {
10491
10492 return false;
10493 }
10494
10496 {
10497 return false;
10498 }
10499
10503 {
10504 return false;
10505 }
10506
10508 {
10509 return "";
10510 }
10511
10513
10515 {
10516 return false;
10517 }
10518
10520 {
10521 return true;
10522 }
10523
10524
10525
10527 {
10528 return true;
10529 }
10530
10532 {
10533 return true;
10534 }
10535
10537 {
10538 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10540 }
10541
10543 {
10545 }
10546
10548 {
10550 if (!is_being_placed)
10552 SetSynchDirty();
10553 }
10554
10555
10557
10559 {
10561 }
10562
10564 {
10566 }
10567
10569 {
10570 return 1;
10571 }
10572
10574 {
10575 return false;
10576 }
10577
10579 {
10581 SetSynchDirty();
10582 }
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10619 {
10620 super.OnMovedInsideCargo(container);
10621
10622 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10623 }
10624
10625 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10626 {
10627 super.EEItemLocationChanged(oldLoc,newLoc);
10628
10629 PlayerBase new_player = null;
10630 PlayerBase old_player = null;
10631
10632 if (newLoc.GetParent())
10633 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10634
10635 if (oldLoc.GetParent())
10636 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10637
10639 {
10640 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10641
10642 if (r_index >= 0)
10643 {
10644 InventoryLocation r_il = new InventoryLocation;
10645 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10646
10647 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10650 {
10651 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10652 }
10654 {
10655 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10656 }
10657
10658 }
10659 }
10660
10662 {
10663 if (new_player)
10664 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10665
10666 if (new_player == old_player)
10667 {
10668
10669 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10670 {
10672 {
10673 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10674 {
10675 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10676 }
10677 }
10678 else
10679 {
10680 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10681 }
10682 }
10683
10684 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10685 {
10686 int type = oldLoc.GetType();
10688 {
10689 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10690 }
10692 {
10693 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10694 }
10695 }
10696 if (!m_OldLocation)
10697 {
10698 m_OldLocation = new InventoryLocation;
10699 }
10700 m_OldLocation.Copy(oldLoc);
10701 }
10702 else
10703 {
10704 if (m_OldLocation)
10705 {
10706 m_OldLocation.Reset();
10707 }
10708 }
10709
10711 }
10712 else
10713 {
10714 if (new_player)
10715 {
10716 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10717 if (res_index >= 0)
10718 {
10719 InventoryLocation il = new InventoryLocation;
10720 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10722 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10725 {
10726 il.
GetParent().GetOnReleaseLock().Invoke(it);
10727 }
10729 {
10731 }
10732
10733 }
10734 }
10736 {
10737
10739 }
10740
10741 if (m_OldLocation)
10742 {
10743 m_OldLocation.Reset();
10744 }
10745 }
10746 }
10747
10748 override void EOnContact(IEntity other, Contact extra)
10749 {
10751 {
10752 int liquidType = -1;
10754 if (impactSpeed > 0.0)
10755 {
10757 #ifndef SERVER
10759 #else
10761 SetSynchDirty();
10762 #endif
10764 }
10765 }
10766
10767 #ifdef SERVER
10768 if (GetCompEM() && GetCompEM().IsPlugged())
10769 {
10770 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10771 GetCompEM().UnplugThis();
10772 }
10773 #endif
10774 }
10775
10777
10779 {
10781 }
10782
10784 {
10785
10786 }
10787
10789 {
10790 super.OnItemLocationChanged(old_owner, new_owner);
10791
10792 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10793 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10794
10795 if (!relatedPlayer && playerNew)
10796 relatedPlayer = playerNew;
10797
10798 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10799 {
10801 if (actionMgr)
10802 {
10803 ActionBase currentAction = actionMgr.GetRunningAction();
10804 if (currentAction)
10806 }
10807 }
10808
10809 Man ownerPlayerOld = null;
10810 Man ownerPlayerNew = null;
10811
10812 if (old_owner)
10813 {
10814 if (old_owner.
IsMan())
10815 {
10816 ownerPlayerOld = Man.Cast(old_owner);
10817 }
10818 else
10819 {
10820 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10821 }
10822 }
10823 else
10824 {
10826 {
10828
10829 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10830 {
10831 GetCompEM().UnplugThis();
10832 }
10833 }
10834 }
10835
10836 if (new_owner)
10837 {
10838 if (new_owner.
IsMan())
10839 {
10840 ownerPlayerNew = Man.Cast(new_owner);
10841 }
10842 else
10843 {
10844 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10845 }
10846 }
10847
10848 if (ownerPlayerOld != ownerPlayerNew)
10849 {
10850 if (ownerPlayerOld)
10851 {
10852 array<EntityAI> subItemsExit = new array<EntityAI>;
10854 for (int i = 0; i < subItemsExit.Count(); i++)
10855 {
10858 }
10859 }
10860
10861 if (ownerPlayerNew)
10862 {
10863 array<EntityAI> subItemsEnter = new array<EntityAI>;
10865 for (int j = 0; j < subItemsEnter.Count(); j++)
10866 {
10869 }
10870 }
10871 }
10872 else if (ownerPlayerNew != null)
10873 {
10874 PlayerBase nplayer;
10875 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10876 {
10877 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10879 for (int k = 0; k < subItemsUpdate.Count(); k++)
10880 {
10882 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10883 }
10884 }
10885 }
10886
10887 if (old_owner)
10888 old_owner.OnChildItemRemoved(this);
10889 if (new_owner)
10890 new_owner.OnChildItemReceived(this);
10891 }
10892
10893
10895 {
10896 super.EEDelete(parent);
10897 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10898 if (player)
10899 {
10901
10902 if (player.IsAlive())
10903 {
10904 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10905 if (r_index >= 0)
10906 {
10907 InventoryLocation r_il = new InventoryLocation;
10908 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10909
10910 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10913 {
10914 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10915 }
10917 {
10918 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10919 }
10920
10921 }
10922
10923 player.RemoveQuickBarEntityShortcut(this);
10924 }
10925 }
10926 }
10927
10929 {
10930 super.EEKilled(killer);
10931
10934 {
10935 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10936 {
10937 if (IsMagazine())
10938 {
10939 if (Magazine.Cast(this).GetAmmoCount() > 0)
10940 {
10942 }
10943 }
10944 else
10945 {
10947 }
10948 }
10949 }
10950 }
10951
10953 {
10954 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10955
10956 super.OnWasAttached(parent, slot_id);
10957
10960
10962 }
10963
10965 {
10966 super.OnWasDetached(parent, slot_id);
10967
10970 }
10971
10973 {
10974 int idx;
10977
10978 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10979 if (inventory_slots.Count() < 1)
10980 {
10981 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10982 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10983 }
10984 else
10985 {
10986 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10987 }
10988
10989 idx = inventory_slots.Find(slot);
10990 if (idx < 0)
10991 return "";
10992
10993 return attach_types.Get(idx);
10994 }
10995
10997 {
10998 int idx = -1;
10999 string slot;
11000
11003
11004 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11005 if (inventory_slots.Count() < 1)
11006 {
11007 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
11008 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11009 }
11010 else
11011 {
11012 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
11013 if (detach_types.Count() < 1)
11014 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11015 }
11016
11017 for (int i = 0; i < inventory_slots.Count(); i++)
11018 {
11019 slot = inventory_slots.Get(i);
11020 }
11021
11022 if (slot != "")
11023 {
11024 if (detach_types.Count() == 1)
11025 idx = 0;
11026 else
11027 idx = inventory_slots.Find(slot);
11028 }
11029 if (idx < 0)
11030 return "";
11031
11032 return detach_types.Get(idx);
11033 }
11034
11036 {
11037
11039
11040
11041 float min_time = 1;
11042 float max_time = 3;
11043 float delay = Math.RandomFloat(min_time, max_time);
11044
11045 explode_timer.Run(delay, this, "DoAmmoExplosion");
11046 }
11047
11049 {
11050 Magazine magazine = Magazine.Cast(this);
11051 int pop_sounds_count = 6;
11052 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11053
11054
11055 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11056 string sound_name = pop_sounds[ sound_idx ];
11058
11059
11060 magazine.ServerAddAmmoCount(-1);
11061
11062
11063 float min_temp_to_explode = 100;
11064
11065 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11066 {
11068 }
11069 }
11070
11071
11072 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11073 {
11074 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11075
11076 const int CHANCE_DAMAGE_CARGO = 4;
11077 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11078 const int CHANCE_DAMAGE_NOTHING = 2;
11079
11081 {
11082 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11083 int chances;
11084 int rnd;
11085
11086 if (GetInventory().GetCargo())
11087 {
11088 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11089 rnd = Math.RandomInt(0,chances);
11090
11091 if (rnd < CHANCE_DAMAGE_CARGO)
11092 {
11094 }
11095 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11096 {
11098 }
11099 }
11100 else
11101 {
11102 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11103 rnd = Math.RandomInt(0,chances);
11104
11105 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11106 {
11108 }
11109 }
11110 }
11111 }
11112
11114 {
11115 if (GetInventory().GetCargo())
11116 {
11117 int item_count = GetInventory().GetCargo().GetItemCount();
11118 if (item_count > 0)
11119 {
11120 int random_pick = Math.RandomInt(0, item_count);
11122 if (!item.IsExplosive())
11123 {
11124 item.AddHealth("","",damage);
11125 return true;
11126 }
11127 }
11128 }
11129 return false;
11130 }
11131
11133 {
11134 int attachment_count = GetInventory().AttachmentCount();
11135 if (attachment_count > 0)
11136 {
11137 int random_pick = Math.RandomInt(0, attachment_count);
11138 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11139 if (!attachment.IsExplosive())
11140 {
11141 attachment.AddHealth("","",damage);
11142 return true;
11143 }
11144 }
11145 return false;
11146 }
11147
11149 {
11151 }
11152
11154 {
11156 return GetInventory().CanRemoveEntity();
11157
11158 return false;
11159 }
11160
11162 {
11163
11165 return false;
11166
11167
11169 return false;
11170
11171
11172
11174 if (delta == 0)
11175 return false;
11176
11177
11178 return true;
11179 }
11180
11182 {
11184 {
11185 if (ScriptInputUserData.CanStoreInputUserData())
11186 {
11187 ScriptInputUserData ctx = new ScriptInputUserData;
11192 ctx.
Write(destination_entity);
11194 ctx.
Write(slot_id);
11196 }
11197 }
11198 else if (!
GetGame().IsMultiplayer())
11199 {
11201 }
11202 }
11203
11205 {
11206 float split_quantity_new;
11210 InventoryLocation loc = new InventoryLocation;
11211
11212 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11213 {
11215 split_quantity_new = stack_max;
11216 else
11218
11220 {
11221 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11222 if (new_item)
11223 {
11224 new_item.SetResultOfSplit(true);
11225 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11227 new_item.
SetQuantity(split_quantity_new,
false,
true);
11228 }
11229 }
11230 }
11231 else if (destination_entity && slot_id == -1)
11232 {
11233 if (quantity > stack_max)
11234 split_quantity_new = stack_max;
11235 else
11236 split_quantity_new = quantity;
11237
11239 {
11241 {
11244 }
11245
11246 if (new_item)
11247 {
11248 new_item.SetResultOfSplit(true);
11249 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11251 new_item.
SetQuantity(split_quantity_new,
false,
true);
11252 }
11253 }
11254 }
11255 else
11256 {
11257 if (stack_max != 0)
11258 {
11260 {
11262 }
11263
11264 if (split_quantity_new == 0)
11265 {
11266 if (!
GetGame().IsMultiplayer())
11267 player.PhysicalPredictiveDropItem(this);
11268 else
11269 player.ServerDropEntity(this);
11270 return;
11271 }
11272
11274 {
11276
11277 if (new_item)
11278 {
11279 new_item.SetResultOfSplit(true);
11280 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11283 new_item.PlaceOnSurface();
11284 }
11285 }
11286 }
11287 }
11288 }
11289
11291 {
11292 float split_quantity_new;
11296 InventoryLocation loc = new InventoryLocation;
11297
11298 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11299 {
11301 split_quantity_new = stack_max;
11302 else
11304
11306 {
11307 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11308 if (new_item)
11309 {
11310 new_item.SetResultOfSplit(true);
11311 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11313 new_item.
SetQuantity(split_quantity_new,
false,
true);
11314 }
11315 }
11316 }
11317 else if (destination_entity && slot_id == -1)
11318 {
11319 if (quantity > stack_max)
11320 split_quantity_new = stack_max;
11321 else
11322 split_quantity_new = quantity;
11323
11325 {
11327 {
11330 }
11331
11332 if (new_item)
11333 {
11334 new_item.SetResultOfSplit(true);
11335 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11337 new_item.
SetQuantity(split_quantity_new,
false,
true);
11338 }
11339 }
11340 }
11341 else
11342 {
11343 if (stack_max != 0)
11344 {
11346 {
11348 }
11349
11351 {
11353
11354 if (new_item)
11355 {
11356 new_item.SetResultOfSplit(true);
11357 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11360 new_item.PlaceOnSurface();
11361 }
11362 }
11363 }
11364 }
11365 }
11366
11368 {
11370 {
11371 if (ScriptInputUserData.CanStoreInputUserData())
11372 {
11373 ScriptInputUserData ctx = new ScriptInputUserData;
11378 dst.WriteToContext(ctx);
11380 }
11381 }
11382 else if (!
GetGame().IsMultiplayer())
11383 {
11385 }
11386 }
11387
11389 {
11391 {
11392 if (ScriptInputUserData.CanStoreInputUserData())
11393 {
11394 ScriptInputUserData ctx = new ScriptInputUserData;
11399 ctx.
Write(destination_entity);
11405 }
11406 }
11407 else if (!
GetGame().IsMultiplayer())
11408 {
11410 }
11411 }
11412
11414 {
11416 }
11417
11419 {
11421 float split_quantity_new;
11423 if (dst.IsValid())
11424 {
11425 int slot_id = dst.GetSlot();
11427
11428 if (quantity > stack_max)
11429 split_quantity_new = stack_max;
11430 else
11431 split_quantity_new = quantity;
11432
11434 {
11436
11437 if (new_item)
11438 {
11439 new_item.SetResultOfSplit(true);
11440 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11442 new_item.
SetQuantity(split_quantity_new,
false,
true);
11443 }
11444
11445 return new_item;
11446 }
11447 }
11448
11449 return null;
11450 }
11451
11453 {
11455 float split_quantity_new;
11457 if (destination_entity)
11458 {
11460 if (quantity > stackable)
11461 split_quantity_new = stackable;
11462 else
11463 split_quantity_new = quantity;
11464
11466 {
11467 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11468 if (new_item)
11469 {
11470 new_item.SetResultOfSplit(true);
11471 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11473 new_item.
SetQuantity(split_quantity_new,
false,
true);
11474 }
11475 }
11476 }
11477 }
11478
11480 {
11482 {
11483 if (ScriptInputUserData.CanStoreInputUserData())
11484 {
11485 ScriptInputUserData ctx = new ScriptInputUserData;
11490 ItemBase destination_entity =
this;
11491 ctx.
Write(destination_entity);
11495 }
11496 }
11497 else if (!
GetGame().IsMultiplayer())
11498 {
11500 }
11501 }
11502
11504 {
11506 float split_quantity_new;
11508 if (player)
11509 {
11511 if (quantity > stackable)
11512 split_quantity_new = stackable;
11513 else
11514 split_quantity_new = quantity;
11515
11517 {
11518 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11519 new_item =
ItemBase.Cast(in_hands);
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 float split_quantity_new = Math.Floor(quantity * 0.5);
11535
11537 return;
11538
11540
11541 if (new_item)
11542 {
11543 if (new_item.GetQuantityMax() < split_quantity_new)
11544 {
11545 split_quantity_new = new_item.GetQuantityMax();
11546 }
11547
11548 new_item.SetResultOfSplit(true);
11549 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11550
11552 {
11555 }
11556 else
11557 {
11559 new_item.
SetQuantity(split_quantity_new,
false,
true);
11560 }
11561 }
11562 }
11563
11565 {
11567 float split_quantity_new = Math.Floor(quantity / 2);
11568
11570 return;
11571
11572 InventoryLocation invloc = new InventoryLocation;
11574
11576 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11577
11578 if (new_item)
11579 {
11580 if (new_item.GetQuantityMax() < split_quantity_new)
11581 {
11582 split_quantity_new = new_item.GetQuantityMax();
11583 }
11585 {
11588 }
11589 else if (split_quantity_new > 1)
11590 {
11592 new_item.
SetQuantity(split_quantity_new,
false,
true);
11593 }
11594 }
11595 }
11596
11599 {
11600 SetWeightDirty();
11602
11603 if (parent)
11604 parent.OnAttachmentQuantityChangedEx(this, delta);
11605
11607 {
11609 {
11611 }
11613 {
11614 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11616 }
11617 }
11618
11619 }
11620
11623 {
11624
11625 }
11626
11629 {
11631 }
11632
11634 {
11635 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11636
11638 {
11639 if (newLevel == GameConstants.STATE_RUINED)
11640 {
11642 EntityAI parent = GetHierarchyParent();
11643 if (parent && parent.IsFireplace())
11644 {
11645 CargoBase cargo = GetInventory().GetCargo();
11646 if (cargo)
11647 {
11649 {
11651 }
11652 }
11653 }
11654 }
11655
11657 {
11658
11660 return;
11661 }
11662
11663 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11664 {
11666 }
11667 }
11668 }
11669
11670
11672 {
11673 super.OnRightClick();
11674
11676 {
11678 {
11679 if (ScriptInputUserData.CanStoreInputUserData())
11680 {
11681 EntityAI root = GetHierarchyRoot();
11682 Man playerOwner = GetHierarchyRootPlayer();
11683 InventoryLocation dst = new InventoryLocation;
11684
11685
11686 if (!playerOwner && root && root == this)
11687 {
11689 }
11690 else
11691 {
11692
11693 GetInventory().GetCurrentInventoryLocation(dst);
11695 {
11698 {
11700 }
11701 else
11702 {
11704
11705
11706 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11707 {
11709 }
11710 else
11711 {
11712 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11713 }
11714 }
11715 }
11716 }
11717
11718 ScriptInputUserData ctx = new ScriptInputUserData;
11726 }
11727 }
11728 else if (!
GetGame().IsMultiplayer())
11729 {
11731 }
11732 }
11733 }
11734
11736 {
11737 if (root)
11738 {
11739 vector m4[4];
11740 root.GetTransform(m4);
11741 dst.SetGround(this, m4);
11742 }
11743 else
11744 {
11745 GetInventory().GetCurrentInventoryLocation(dst);
11746 }
11747 }
11748
11749 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11750 {
11751
11752 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11753 return false;
11754
11755 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11756 return false;
11757
11758
11760 return false;
11761
11762
11763 Magazine mag = Magazine.Cast(this);
11764 if (mag)
11765 {
11766 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11767 return false;
11768
11769 if (stack_max_limit)
11770 {
11771 Magazine other_mag = Magazine.Cast(other_item);
11772 if (other_item)
11773 {
11774 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11775 return false;
11776 }
11777
11778 }
11779 }
11780 else
11781 {
11782
11784 return false;
11785
11787 return false;
11788 }
11789
11790 PlayerBase player = null;
11791 if (CastTo(player, GetHierarchyRootPlayer()))
11792 {
11793 if (player.GetInventory().HasAttachment(this))
11794 return false;
11795
11796 if (player.IsItemsToDelete())
11797 return false;
11798 }
11799
11800 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11801 return false;
11802
11803 int slotID;
11805 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11806 return false;
11807
11808 return true;
11809 }
11810
11812 {
11814 }
11815
11817 {
11818 return m_IsResultOfSplit;
11819 }
11820
11822 {
11823 m_IsResultOfSplit = value;
11824 }
11825
11827 {
11829 }
11830
11832 {
11833 float other_item_quantity = other_item.GetQuantity();
11834 float this_free_space;
11835
11837
11839
11840 if (other_item_quantity > this_free_space)
11841 {
11842 return this_free_space;
11843 }
11844 else
11845 {
11846 return other_item_quantity;
11847 }
11848 }
11849
11851 {
11853 }
11854
11856 {
11858 return;
11859
11860 if (!IsMagazine() && other_item)
11861 {
11863 if (quantity_used != 0)
11864 {
11865 float hp1 = GetHealth01("","");
11866 float hp2 = other_item.GetHealth01("","");
11867 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11868 hpResult = hpResult / (
GetQuantity() + quantity_used);
11869
11870 hpResult *= GetMaxHealth();
11871 Math.Round(hpResult);
11872 SetHealth("", "Health", hpResult);
11873
11875 other_item.AddQuantity(-quantity_used);
11876 }
11877 }
11879 }
11880
11882 {
11883 #ifdef SERVER
11884 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11885 GetHierarchyParent().IncreaseLifetimeUp();
11886 #endif
11887 };
11888
11890 {
11891 PlayerBase p = PlayerBase.Cast(player);
11892
11893 array<int> recipesIds = p.m_Recipes;
11894 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11895 if (moduleRecipesManager)
11896 {
11897 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11898 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11899 }
11900
11901 for (int i = 0;i < recipesIds.Count(); i++)
11902 {
11903 int key = recipesIds.Get(i);
11904 string recipeName = moduleRecipesManager.GetRecipeName(key);
11906 }
11907 }
11908
11909
11910 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11911 {
11912 super.GetDebugActions(outputList);
11913
11914
11920
11921
11926
11931
11932
11936
11937
11939 {
11943 }
11944
11947
11948
11952
11954
11955 InventoryLocation loc = new InventoryLocation();
11956 GetInventory().GetCurrentInventoryLocation(loc);
11958 {
11959 if (Gizmo_IsSupported())
11962 }
11963
11965 }
11966
11967
11968
11969
11971 {
11972 super.OnAction(action_id, player, ctx);
11973
11975 {
11976 switch (action_id)
11977 {
11980 return true;
11983 return true;
11984 }
11985 }
11986
11988 {
11989 switch (action_id)
11990 {
11992 Delete();
11993 return true;
11994 }
11995 }
11996
11997 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11998 {
11999 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12000 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
12001 PlayerBase p = PlayerBase.Cast(player);
12002 if (
EActions.RECIPES_RANGE_START < 1000)
12003 {
12004 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
12005 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
12006 }
12007 }
12008 #ifndef SERVER
12009 else if (action_id ==
EActions.WATCH_PLAYER)
12010 {
12011 PluginDeveloper.SetDeveloperItemClientEx(player);
12012 }
12013 #endif
12015 {
12016 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
12017 {
12018 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
12019 OnDebugButtonPressServer(id + 1);
12020 }
12021
12022 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
12023 {
12024 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
12026 }
12027
12028 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
12029 {
12030 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
12032 }
12033
12034 else if (action_id ==
EActions.ADD_QUANTITY)
12035 {
12036 if (IsMagazine())
12037 {
12038 Magazine mag = Magazine.Cast(this);
12039 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
12040 }
12041 else
12042 {
12044 }
12045
12046 if (m_EM)
12047 {
12048 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12049 }
12050
12051 }
12052
12053 else if (action_id ==
EActions.REMOVE_QUANTITY)
12054 {
12055 if (IsMagazine())
12056 {
12057 Magazine mag2 = Magazine.Cast(this);
12058 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12059 }
12060 else
12061 {
12063 }
12064 if (m_EM)
12065 {
12066 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12067 }
12068
12069 }
12070
12071 else if (action_id ==
EActions.SET_QUANTITY_0)
12072 {
12074
12075 if (m_EM)
12076 {
12077 m_EM.SetEnergy(0);
12078 }
12079 }
12080
12081 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12082 {
12084
12085 if (m_EM)
12086 {
12087 m_EM.SetEnergy(m_EM.GetEnergyMax());
12088 }
12089 }
12090
12091 else if (action_id ==
EActions.ADD_HEALTH)
12092 {
12093 AddHealth("","",GetMaxHealth("","Health")/5);
12094 }
12095 else if (action_id ==
EActions.REMOVE_HEALTH)
12096 {
12097 AddHealth("","",-GetMaxHealth("","Health")/5);
12098 }
12099 else if (action_id ==
EActions.DESTROY_HEALTH)
12100 {
12101 SetHealth01("","",0);
12102 }
12103 else if (action_id ==
EActions.WATCH_ITEM)
12104 {
12106 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12107 #ifdef DEVELOPER
12108 SetDebugDeveloper_item(this);
12109 #endif
12110 }
12111
12112 else if (action_id ==
EActions.ADD_TEMPERATURE)
12113 {
12114 AddTemperature(20);
12115
12116 }
12117
12118 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12119 {
12120 AddTemperature(-20);
12121
12122 }
12123
12124 else if (action_id ==
EActions.FLIP_FROZEN)
12125 {
12126 SetFrozen(!GetIsFrozen());
12127
12128 }
12129
12130 else if (action_id ==
EActions.ADD_WETNESS)
12131 {
12133
12134 }
12135
12136 else if (action_id ==
EActions.REMOVE_WETNESS)
12137 {
12139
12140 }
12141
12142 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12143 {
12146
12147
12148 }
12149
12150 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12151 {
12154 }
12155
12156 else if (action_id ==
EActions.MAKE_SPECIAL)
12157 {
12158 auto debugParams = DebugSpawnParams.WithPlayer(player);
12159 OnDebugSpawnEx(debugParams);
12160 }
12161
12162 }
12163
12164
12165 return false;
12166 }
12167
12168
12169
12170
12174
12177
12178
12179
12181 {
12182 return false;
12183 }
12184
12185
12187 {
12188 return true;
12189 }
12190
12191
12193 {
12194 return true;
12195 }
12196
12197
12198
12200 {
12201 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12203 }
12204
12207 {
12208 return null;
12209 }
12210
12212 {
12213 return false;
12214 }
12215
12217 {
12218 return false;
12219 }
12220
12224
12225
12227 {
12228 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12229 return module_repairing.CanRepair(this, item_repair_kit);
12230 }
12231
12232
12233 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12234 {
12235 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12236 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12237 }
12238
12239
12241 {
12242
12243
12244
12245
12246
12247
12248
12249
12250 return 1;
12251 }
12252
12253
12254
12256 {
12258 }
12259
12260
12261
12263 {
12265 }
12266
12267
12276 {
12277 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12278
12279 if (player)
12280 {
12281 player.MessageStatus(text);
12282 }
12283 }
12284
12285
12294 {
12295 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12296
12297 if (player)
12298 {
12299 player.MessageAction(text);
12300 }
12301 }
12302
12303
12312 {
12313 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12314
12315 if (player)
12316 {
12317 player.MessageFriendly(text);
12318 }
12319 }
12320
12321
12330 {
12331 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12332
12333 if (player)
12334 {
12335 player.MessageImportant(text);
12336 }
12337 }
12338
12340 {
12341 return true;
12342 }
12343
12344
12345 override bool KindOf(
string tag)
12346 {
12347 bool found = false;
12348 string item_name = this.
GetType();
12351
12352 int array_size = item_tag_array.Count();
12353 for (int i = 0; i < array_size; i++)
12354 {
12355 if (item_tag_array.Get(i) == tag)
12356 {
12357 found = true;
12358 break;
12359 }
12360 }
12361 return found;
12362 }
12363
12364
12366 {
12367
12368 super.OnRPC(sender, rpc_type,ctx);
12369
12370
12371 switch (rpc_type)
12372 {
12373 #ifndef SERVER
12374 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12375 Param2<bool, string> p = new Param2<bool, string>(false, "");
12376
12378 return;
12379
12380 bool play = p.param1;
12381 string soundSet = p.param2;
12382
12383 if (play)
12384 {
12386 {
12388 {
12390 }
12391 }
12392 else
12393 {
12395 }
12396 }
12397 else
12398 {
12400 }
12401
12402 break;
12403 #endif
12404
12405 }
12406
12408 {
12410 }
12411 }
12412
12413
12414
12415
12417 {
12418 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12419 return plugin.GetID(
name);
12420 }
12421
12423 {
12424 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12425 return plugin.GetName(id);
12426 }
12427
12430 {
12431
12432
12433 int varFlags;
12434 if (!ctx.
Read(varFlags))
12435 return;
12436
12437 if (varFlags & ItemVariableFlags.FLOAT)
12438 {
12440 }
12441 }
12442
12444 {
12445
12446 super.SerializeNumericalVars(floats_out);
12447
12448
12449
12451 {
12453 }
12454
12456 {
12458 }
12459
12461 {
12463 }
12464
12466 {
12471 }
12472
12474 {
12476 }
12477 }
12478
12480 {
12481
12482 super.DeSerializeNumericalVars(floats);
12483
12484
12485 int index = 0;
12486 int mask = Math.Round(floats.Get(index));
12487
12488 index++;
12489
12491 {
12493 {
12495 }
12496 else
12497 {
12498 float quantity = floats.Get(index);
12499 SetQuantity(quantity,
true,
false,
false,
false);
12500 }
12501 index++;
12502 }
12503
12505 {
12506 float wet = floats.Get(index);
12508 index++;
12509 }
12510
12512 {
12513 int liquidtype = Math.Round(floats.Get(index));
12515 index++;
12516 }
12517
12519 {
12521 index++;
12523 index++;
12525 index++;
12527 index++;
12528 }
12529
12531 {
12532 int cleanness = Math.Round(floats.Get(index));
12534 index++;
12535 }
12536 }
12537
12539 {
12540 super.WriteVarsToCTX(ctx);
12541
12542
12544 {
12546 }
12547
12549 {
12551 }
12552
12554 {
12556 }
12557
12559 {
12560 int r,g,b,a;
12566 }
12567
12569 {
12571 }
12572 }
12573
12575 {
12576 if (!super.ReadVarsFromCTX(ctx,version))
12577 return false;
12578
12579 int intValue;
12580 float value;
12581
12582 if (version < 140)
12583 {
12584 if (!ctx.
Read(intValue))
12585 return false;
12586
12587 m_VariablesMask = intValue;
12588 }
12589
12591 {
12592 if (!ctx.
Read(value))
12593 return false;
12594
12596 {
12598 }
12599 else
12600 {
12602 }
12603 }
12604
12605 if (version < 140)
12606 {
12608 {
12609 if (!ctx.
Read(value))
12610 return false;
12611 SetTemperatureDirect(value);
12612 }
12613 }
12614
12616 {
12617 if (!ctx.
Read(value))
12618 return false;
12620 }
12621
12623 {
12624 if (!ctx.
Read(intValue))
12625 return false;
12627 }
12628
12630 {
12631 int r,g,b,a;
12633 return false;
12635 return false;
12637 return false;
12639 return false;
12640
12642 }
12643
12645 {
12646 if (!ctx.
Read(intValue))
12647 return false;
12649 }
12650
12651 if (version >= 138 && version < 140)
12652 {
12654 {
12655 if (!ctx.
Read(intValue))
12656 return false;
12657 SetFrozen(intValue);
12658 }
12659 }
12660
12661 return true;
12662 }
12663
12664
12666 {
12669 {
12671 }
12672
12673 if (!super.OnStoreLoad(ctx, version))
12674 {
12676 return false;
12677 }
12678
12679 if (version >= 114)
12680 {
12681 bool hasQuickBarIndexSaved;
12682
12683 if (!ctx.
Read(hasQuickBarIndexSaved))
12684 {
12686 return false;
12687 }
12688
12689 if (hasQuickBarIndexSaved)
12690 {
12691 int itmQBIndex;
12692
12693
12694 if (!ctx.
Read(itmQBIndex))
12695 {
12697 return false;
12698 }
12699
12700 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12701 if (itmQBIndex != -1 && parentPlayer)
12702 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12703 }
12704 }
12705 else
12706 {
12707
12708 PlayerBase player;
12709 int itemQBIndex;
12710 if (version ==
int.
MAX)
12711 {
12712 if (!ctx.
Read(itemQBIndex))
12713 {
12715 return false;
12716 }
12717 }
12718 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12719 {
12720
12721 if (!ctx.
Read(itemQBIndex))
12722 {
12724 return false;
12725 }
12726 if (itemQBIndex != -1 && player)
12727 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12728 }
12729 }
12730
12731 if (version < 140)
12732 {
12733
12734 if (!LoadVariables(ctx, version))
12735 {
12737 return false;
12738 }
12739 }
12740
12741
12743 {
12745 return false;
12746 }
12747 if (version >= 132)
12748 {
12750 if (raib)
12751 {
12753 {
12755 return false;
12756 }
12757 }
12758 }
12759
12761 return true;
12762 }
12763
12764
12765
12767 {
12768 super.OnStoreSave(ctx);
12769
12770 PlayerBase player;
12771 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12772 {
12774
12775 int itemQBIndex = -1;
12776 itemQBIndex = player.FindQuickBarEntityIndex(this);
12777 ctx.
Write(itemQBIndex);
12778 }
12779 else
12780 {
12782 }
12783
12785
12787 if (raib)
12788 {
12790 }
12791 }
12792
12793
12795 {
12796 super.AfterStoreLoad();
12797
12799 {
12801 }
12802
12804 {
12807 }
12808 }
12809
12811 {
12812 super.EEOnAfterLoad();
12813
12815 {
12817 }
12818
12821 }
12822
12824 {
12825 return false;
12826 }
12827
12828
12829
12831 {
12833 {
12834 #ifdef PLATFORM_CONSOLE
12835
12837 {
12839 if (menu)
12840 {
12842 }
12843 }
12844 #endif
12845 }
12846
12848 {
12851 }
12852
12854 {
12855 SetWeightDirty();
12857 }
12859 {
12862 }
12863
12865 {
12868 }
12870 {
12873 }
12874
12875 super.OnVariablesSynchronized();
12876 }
12877
12878
12879
12881 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12882 {
12883 if (!IsServerCheck(allow_client))
12884 return false;
12885
12887 return false;
12888
12891
12892 if (value <= (min + 0.001))
12893 value = min;
12894
12895 if (value == min)
12896 {
12897 if (destroy_config)
12898 {
12899 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12900 if (dstr)
12901 {
12903 this.Delete();
12904 return true;
12905 }
12906 }
12907 else if (destroy_forced)
12908 {
12910 this.Delete();
12911 return true;
12912 }
12913
12915 }
12916
12919
12921 {
12923
12924 if (delta)
12926 }
12927
12929
12930 return false;
12931 }
12932
12933
12935 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12936 {
12938 }
12939
12941 {
12944 }
12945
12947 {
12950 }
12951
12953 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12954 {
12955 float value_clamped = Math.Clamp(value, 0, 1);
12957 SetQuantity(result, destroy_config, destroy_forced);
12958 }
12959
12960
12963 {
12965 }
12966
12968 {
12970 }
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12982 {
12983 int slot = -1;
12984 if (GetInventory())
12985 {
12986 InventoryLocation il = new InventoryLocation;
12987 GetInventory().GetCurrentInventoryLocation(il);
12989 }
12990
12992 }
12993
12995 {
12996 float quantity_max = 0;
12997
12999 {
13000 if (attSlotID != -1)
13001 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
13002
13003 if (quantity_max <= 0)
13005 }
13006
13007 if (quantity_max <= 0)
13009
13010 return quantity_max;
13011 }
13012
13014 {
13016 }
13017
13019 {
13021 }
13022
13023
13025 {
13027 }
13028
13030 {
13032 }
13033
13035 {
13037 }
13038
13039
13041 {
13042
13043 float weightEx = GetWeightEx();
13044 float special = GetInventoryAndCargoWeight();
13045 return weightEx - special;
13046 }
13047
13048
13050 {
13052 }
13053
13055 {
13057 {
13058 #ifdef DEVELOPER
13059 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13060 {
13061 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13063 }
13064 #endif
13065
13066 return GetQuantity() * GetConfigWeightModified();
13067 }
13068 else if (HasEnergyManager())
13069 {
13070 #ifdef DEVELOPER
13071 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13072 {
13073 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13074 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13075 }
13076 #endif
13077 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13078 }
13079 else
13080 {
13081 #ifdef DEVELOPER
13082 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13083 {
13084 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13085 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13086 }
13087 #endif
13088 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13089 }
13090 }
13091
13094 {
13095 int item_count = 0;
13097
13098 if (GetInventory().GetCargo() != NULL)
13099 {
13100 item_count = GetInventory().GetCargo().GetItemCount();
13101 }
13102
13103 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13104 {
13105 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13106 if (item)
13107 item_count += item.GetNumberOfItems();
13108 }
13109 return item_count;
13110 }
13111
13114 {
13115 float weight = 0;
13116 float wetness = 1;
13117 if (include_wetness)
13120 {
13121 weight = wetness * m_ConfigWeight;
13122 }
13124 {
13125 weight = 1;
13126 }
13127 return weight;
13128 }
13129
13130
13131
13133 {
13134 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13135 {
13136 GameInventory inv = GetInventory();
13137 array<EntityAI> items = new array<EntityAI>;
13139 for (int i = 0; i < items.Count(); i++)
13140 {
13142 if (item)
13143 {
13145 }
13146 }
13147 }
13148 }
13149
13150
13151
13152
13154 {
13155 float energy = 0;
13156 if (HasEnergyManager())
13157 {
13158 energy = GetCompEM().GetEnergy();
13159 }
13160 return energy;
13161 }
13162
13163
13165 {
13166 super.OnEnergyConsumed();
13167
13169 }
13170
13172 {
13173 super.OnEnergyAdded();
13174
13176 }
13177
13178
13180 {
13181 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13182 {
13184 {
13185 float energy_0to1 = GetCompEM().GetEnergy0To1();
13187 }
13188 }
13189 }
13190
13191
13193 {
13194 return ConfigGetFloat("heatIsolation");
13195 }
13196
13198 {
13200 }
13201
13203 {
13204 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13205 if (
GetGame().ConfigIsExisting(paramPath))
13207
13208 return 0.0;
13209 }
13210
13212 {
13213 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13214 if (
GetGame().ConfigIsExisting(paramPath))
13216
13217 return 0.0;
13218 }
13219
13220 override void SetWet(
float value,
bool allow_client =
false)
13221 {
13222 if (!IsServerCheck(allow_client))
13223 return;
13224
13227
13229
13230 m_VarWet = Math.Clamp(value, min, max);
13231
13233 {
13236 }
13237 }
13238
13239 override void AddWet(
float value)
13240 {
13242 }
13243
13245 {
13247 }
13248
13250 {
13252 }
13253
13255 {
13257 }
13258
13260 {
13262 }
13263
13265 {
13267 }
13268
13269 override void OnWetChanged(
float newVal,
float oldVal)
13270 {
13273 if (newLevel != oldLevel)
13274 {
13276 }
13277 }
13278
13280 {
13281 SetWeightDirty();
13282 }
13283
13285 {
13286 return GetWetLevelInternal(
m_VarWet);
13287 }
13288
13289
13290
13292 {
13294 }
13295
13297 {
13299 }
13300
13302 {
13304 }
13305
13307 {
13309 }
13310
13311
13312
13314 {
13315 if (ConfigIsExisting("itemModelLength"))
13316 {
13317 return ConfigGetFloat("itemModelLength");
13318 }
13319 return 0;
13320 }
13321
13323 {
13324 if (ConfigIsExisting("itemAttachOffset"))
13325 {
13326 return ConfigGetFloat("itemAttachOffset");
13327 }
13328 return 0;
13329 }
13330
13331 override void SetCleanness(
int value,
bool allow_client =
false)
13332 {
13333 if (!IsServerCheck(allow_client))
13334 return;
13335
13337
13339
13342 }
13343
13345 {
13347 }
13348
13350 {
13351 return true;
13352 }
13353
13354
13355
13356
13358 {
13360 }
13361
13363 {
13365 }
13366
13367
13368
13369
13370 override void SetColor(
int r,
int g,
int b,
int a)
13371 {
13377 }
13379 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13380 {
13385 }
13386
13388 {
13390 }
13391
13394 {
13395 int r,g,b,a;
13397 r = r/255;
13398 g = g/255;
13399 b = b/255;
13400 a = a/255;
13401 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13402 }
13403
13404
13405
13406 override void SetLiquidType(
int value,
bool allow_client =
false)
13407 {
13408 if (!IsServerCheck(allow_client))
13409 return;
13410
13415 }
13416
13418 {
13419 return ConfigGetInt("varLiquidTypeInit");
13420 }
13421
13423 {
13425 }
13426
13428 {
13430 SetFrozen(false);
13431 }
13432
13435 {
13436 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13437 }
13438
13439
13442 {
13443 PlayerBase nplayer;
13444 if (PlayerBase.CastTo(nplayer, player))
13445 {
13447
13448 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13449 }
13450 }
13451
13452
13455 {
13456 PlayerBase nplayer;
13457 if (PlayerBase.CastTo(nplayer,player))
13458 {
13459
13460 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13461
13462 }
13463
13464
13465 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13466
13467
13468 if (HasEnergyManager())
13469 {
13470 GetCompEM().UpdatePlugState();
13471 }
13472 }
13473
13474
13476 {
13477 super.OnPlacementStarted(player);
13478
13480 }
13481
13482 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13483 {
13485 {
13486 m_AdminLog.OnPlacementComplete(player,
this);
13487 }
13488
13489 super.OnPlacementComplete(player, position, orientation);
13490 }
13491
13492
13493
13494
13495
13497 {
13499 {
13500 return true;
13501 }
13502 else
13503 {
13504 return false;
13505 }
13506 }
13507
13508
13510 {
13512 {
13514 }
13515 }
13516
13517
13519 {
13521 }
13522
13524 {
13526 }
13527
13528 override void InsertAgent(
int agent,
float count = 1)
13529 {
13530 if (count < 1)
13531 return;
13532
13534 }
13535
13538 {
13540 }
13541
13542
13544 {
13546 }
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13590 {
13592 return false;
13593 return true;
13594 }
13595
13597 {
13598
13600 }
13601
13602
13605 {
13606 super.CheckForRoofLimited(timeTresholdMS);
13607
13609 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13610 {
13611 m_PreviousRoofTestTime = time;
13612 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13613 }
13614 }
13615
13616
13618 {
13620 {
13621 return 0;
13622 }
13623
13624 if (GetInventory().GetAttachmentSlotsCount() != 0)
13625 {
13626 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13627 if (filter)
13628 return filter.GetProtectionLevel(type, false, system);
13629 else
13630 return 0;
13631 }
13632
13633 string subclassPath, entryName;
13634
13635 switch (type)
13636 {
13638 entryName = "biological";
13639 break;
13641 entryName = "chemical";
13642 break;
13643 default:
13644 entryName = "biological";
13645 break;
13646 }
13647
13648 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13649
13651 }
13652
13653
13654
13657 {
13658 if (!IsMagazine())
13660
13662 }
13663
13664
13665
13666
13667
13672 {
13673 return true;
13674 }
13675
13677 {
13679 }
13680
13681
13682
13683
13684
13686 {
13687 if (parent)
13688 {
13689 if (parent.IsInherited(DayZInfected))
13690 return true;
13691
13692 if (!parent.IsRuined())
13693 return true;
13694 }
13695
13696 return true;
13697 }
13698
13700 {
13701 if (!super.CanPutAsAttachment(parent))
13702 {
13703 return false;
13704 }
13705
13706 if (!IsRuined() && !parent.IsRuined())
13707 {
13708 return true;
13709 }
13710
13711 return false;
13712 }
13713
13715 {
13716
13717
13718
13719
13720 return super.CanReceiveItemIntoCargo(item);
13721 }
13722
13724 {
13725
13726
13727
13728
13729 GameInventory attachmentInv = attachment.GetInventory();
13731 {
13732 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13733 return false;
13734 }
13735
13736 InventoryLocation loc = new InventoryLocation();
13737 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13738 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13739 return false;
13740
13741 return super.CanReceiveAttachment(attachment, slotId);
13742 }
13743
13745 {
13746 if (!super.CanReleaseAttachment(attachment))
13747 return false;
13748
13749 return GetInventory().AreChildrenAccessible();
13750 }
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13773 {
13774 int id = muzzle_owner.GetMuzzleID();
13775 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13776
13777 if (WPOF_array)
13778 {
13779 for (int i = 0; i < WPOF_array.Count(); i++)
13780 {
13781 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13782
13783 if (WPOF)
13784 {
13785 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13786 }
13787 }
13788 }
13789 }
13790
13791
13793 {
13794 int id = muzzle_owner.GetMuzzleID();
13796
13797 if (WPOBE_array)
13798 {
13799 for (int i = 0; i < WPOBE_array.Count(); i++)
13800 {
13801 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13802
13803 if (WPOBE)
13804 {
13805 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13806 }
13807 }
13808 }
13809 }
13810
13811
13813 {
13814 int id = muzzle_owner.GetMuzzleID();
13815 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13816
13817 if (WPOOH_array)
13818 {
13819 for (int i = 0; i < WPOOH_array.Count(); i++)
13820 {
13821 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13822
13823 if (WPOOH)
13824 {
13825 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13826 }
13827 }
13828 }
13829 }
13830
13831
13833 {
13834 int id = muzzle_owner.GetMuzzleID();
13835 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13836
13837 if (WPOOH_array)
13838 {
13839 for (int i = 0; i < WPOOH_array.Count(); i++)
13840 {
13841 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13842
13843 if (WPOOH)
13844 {
13845 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13846 }
13847 }
13848 }
13849 }
13850
13851
13853 {
13854 int id = muzzle_owner.GetMuzzleID();
13855 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13856
13857 if (WPOOH_array)
13858 {
13859 for (int i = 0; i < WPOOH_array.Count(); i++)
13860 {
13861 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13862
13863 if (WPOOH)
13864 {
13865 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13866 }
13867 }
13868 }
13869 }
13870
13871
13872
13874 {
13876 {
13877 return true;
13878 }
13879
13880 return false;
13881 }
13882
13884 {
13886 {
13887 return true;
13888 }
13889
13890 return false;
13891 }
13892
13894 {
13896 {
13897 return true;
13898 }
13899
13900 return false;
13901 }
13902
13904 {
13905 return false;
13906 }
13907
13910 {
13911 return UATimeSpent.DEFAULT_DEPLOY;
13912 }
13913
13914
13915
13916
13918 {
13920 SetSynchDirty();
13921 }
13922
13924 {
13926 }
13927
13928
13930 {
13931 return false;
13932 }
13933
13936 {
13937 string att_type = "None";
13938
13939 if (ConfigIsExisting("soundAttType"))
13940 {
13941 att_type = ConfigGetString("soundAttType");
13942 }
13943
13945 }
13946
13948 {
13950 }
13951
13952
13953
13954
13955
13961
13963 {
13966
13968 }
13969
13970
13972 {
13974 return;
13975
13977
13980
13983
13984 SoundParameters params = new SoundParameters();
13988 }
13989
13990
13992 {
13994 return;
13995
13997 SetSynchDirty();
13998
14001 }
14002
14003
14005 {
14007 return;
14008
14010 SetSynchDirty();
14011
14014 }
14015
14017 {
14019 }
14020
14022 {
14024 }
14025
14028 {
14029 if (!
GetGame().IsDedicatedServer())
14030 {
14031 if (ConfigIsExisting("attachSoundSet"))
14032 {
14033 string cfg_path = "";
14034 string soundset = "";
14035 string type_name =
GetType();
14036
14039 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
14040 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
14041
14042 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
14043 {
14044 for (int i = 0; i < cfg_soundset_array.Count(); i++)
14045 {
14046 if (cfg_slot_array[i] == slot_type)
14047 {
14048 soundset = cfg_soundset_array[i];
14049 break;
14050 }
14051 }
14052 }
14053
14054 if (soundset != "")
14055 {
14056 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14058 }
14059 }
14060 }
14061 }
14062
14064 {
14065
14066 }
14067
14068 void OnApply(PlayerBase player);
14069
14071 {
14072 return 1.0;
14073 };
14074
14076 {
14078 }
14079
14081 {
14083 }
14084
14086
14088 {
14089 SetDynamicPhysicsLifeTime(0.01);
14091 }
14092
14094 {
14095 array<string> zone_names = new array<string>;
14096 GetDamageZones(zone_names);
14097 for (int i = 0; i < zone_names.Count(); i++)
14098 {
14099 SetHealthMax(zone_names.Get(i),"Health");
14100 }
14101 SetHealthMax("","Health");
14102 }
14103
14106 {
14107 float global_health = GetHealth01("","Health");
14108 array<string> zones = new array<string>;
14109 GetDamageZones(zones);
14110
14111 for (int i = 0; i < zones.Count(); i++)
14112 {
14113 SetHealth01(zones.Get(i),"Health",global_health);
14114 }
14115 }
14116
14119 {
14120 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14121 }
14122
14124 {
14125 if (!hasRootAsPlayer)
14126 {
14127 if (refParentIB)
14128 {
14129
14130 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14131 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14132
14133 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14134 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14135
14138 }
14139 else
14140 {
14141
14144 }
14145 }
14146 }
14147
14149 {
14151 {
14152 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14153 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14154 {
14155 float heatPermCoef = 1.0;
14157 while (ent)
14158 {
14159 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14160 ent = ent.GetHierarchyParent();
14161 }
14162
14163 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14164 }
14165 }
14166 }
14167
14169 {
14170
14171 EntityAI parent = GetHierarchyParent();
14172 if (!parent)
14173 {
14174 hasParent = false;
14175 hasRootAsPlayer = false;
14176 }
14177 else
14178 {
14179 hasParent = true;
14180 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14181 refParentIB =
ItemBase.Cast(parent);
14182 }
14183 }
14184
14185 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14186 {
14187
14188 }
14189
14191 {
14192
14193 return false;
14194 }
14195
14197 {
14198
14199
14200 return false;
14201 }
14202
14204 {
14205
14206 return false;
14207 }
14208
14211 {
14212 return !GetIsFrozen() &&
IsOpen();
14213 }
14214
14216 {
14217 bool hasParent = false, hasRootAsPlayer = false;
14219
14220 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14221 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14222
14223 if (wwtu || foodDecay)
14224 {
14228
14229 if (processWetness || processTemperature || processDecay)
14230 {
14232
14233 if (processWetness)
14234 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14235
14236 if (processTemperature)
14238
14239 if (processDecay)
14240 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14241 }
14242 }
14243 }
14244
14247 {
14249 }
14250
14252 {
14255
14256 return super.GetTemperatureFreezeThreshold();
14257 }
14258
14260 {
14263
14264 return super.GetTemperatureThawThreshold();
14265 }
14266
14268 {
14271
14272 return super.GetItemOverheatThreshold();
14273 }
14274
14276 {
14278 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14279
14280 return super.GetTemperatureFreezeTime();
14281 }
14282
14284 {
14286 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14287
14288 return super.GetTemperatureThawTime();
14289 }
14290
14295
14297 {
14298 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14299 }
14300
14302 {
14303 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14304 }
14305
14308 {
14310 }
14311
14313 {
14315 }
14316
14318 {
14320 }
14321
14324 {
14325 return null;
14326 }
14327
14330 {
14331 return false;
14332 }
14333
14335 {
14337 {
14340 if (!trg)
14341 {
14343 explosive = this;
14344 }
14345
14346 explosive.PairRemote(trg);
14348
14349 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14350 trg.SetPersistentPairID(persistentID);
14351 explosive.SetPersistentPairID(persistentID);
14352
14353 return true;
14354 }
14355 return false;
14356 }
14357
14360 {
14361 float ret = 1.0;
14364 ret *= GetHealth01();
14365
14366 return ret;
14367 }
14368
14369 #ifdef DEVELOPER
14370 override void SetDebugItem()
14371 {
14372 super.SetDebugItem();
14373 _itemBase = this;
14374 }
14375
14377 {
14378 string text = super.GetDebugText();
14379
14381 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14382
14383 return text;
14384 }
14385 #endif
14386
14388 {
14389 return true;
14390 }
14391
14393
14395
14397 {
14400 }
14401
14402
14410
14426}
14427
14429{
14431 if (entity)
14432 {
14433 bool is_item = entity.IsInherited(
ItemBase);
14434 if (is_item && full_quantity)
14435 {
14438 }
14439 }
14440 else
14441 {
14443 return NULL;
14444 }
14445 return entity;
14446}
14447
14449{
14450 if (item)
14451 {
14452 if (health > 0)
14453 item.SetHealth("", "", health);
14454
14455 if (item.CanHaveTemperature())
14456 {
14458 if (item.CanFreeze())
14459 item.SetFrozen(false);
14460 }
14461
14462 if (item.HasEnergyManager())
14463 {
14464 if (quantity >= 0)
14465 {
14466 item.GetCompEM().SetEnergy0To1(quantity);
14467 }
14468 else
14469 {
14471 }
14472 }
14473 else if (item.IsMagazine())
14474 {
14475 Magazine mag = Magazine.Cast(item);
14476 if (quantity >= 0)
14477 {
14478 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14479 }
14480 else
14481 {
14483 }
14484
14485 }
14486 else
14487 {
14488 if (quantity >= 0)
14489 {
14490 item.SetQuantityNormalized(quantity, false);
14491 }
14492 else
14493 {
14495 }
14496
14497 }
14498 }
14499}
14500
14501#ifdef DEVELOPER
14503#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.