9548{
9550 {
9551 return true;
9552 }
9553};
9554
9555
9556
9558{
9562
9564
9567
9568
9569
9570
9571
9580
9586
9591
9596
9617 protected bool m_IsResultOfSplit
9618
9620
9625
9626
9627
9629
9633
9634
9635
9637
9640
9641
9642
9648
9649
9657
9660
9661
9663
9664
9666
9667
9672
9673
9678
9679
9681
9682
9684 {
9689
9690 if (!
GetGame().IsDedicatedServer())
9691 {
9693 {
9695
9697 {
9699 }
9700 }
9701
9704 }
9705
9706 m_OldLocation = null;
9707
9709 {
9711 }
9712
9713 if (ConfigIsExisting("headSelectionsToHide"))
9714 {
9717 }
9718
9720 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9721 {
9723 }
9724
9726
9727 m_IsResultOfSplit = false;
9728
9730 }
9731
9733 {
9734 super.InitItemVariables();
9735
9741 m_Count = ConfigGetInt(
"count");
9742
9745
9750
9753
9758
9770
9774
9775
9778 if (ConfigIsExisting("canBeSplit"))
9779 {
9782 }
9783
9785 if (ConfigIsExisting("itemBehaviour"))
9787
9788
9791 RegisterNetSyncVariableInt("m_VarLiquidType");
9792 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9793
9794 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9795 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9796 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9797
9798 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9799 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9800 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9801 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9802
9803 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9804 RegisterNetSyncVariableBool("m_IsTakeable");
9805 RegisterNetSyncVariableBool("m_IsHologram");
9806
9809 {
9812 }
9813
9815
9817 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9819
9820 }
9821
9823 {
9825 }
9826
9828 {
9831 {
9836 }
9837 }
9838
9839 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9840 {
9842 {
9845 }
9846
9848 }
9849
9851 {
9857 }
9858
9860
9862 {
9864
9865 if (!action)
9866 {
9867 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9868 return;
9869 }
9870
9872 if (!ai)
9873 {
9875 return;
9876 }
9877
9879 if (!action_array)
9880 {
9881 action_array = new array<ActionBase_Basic>;
9883 }
9884 if (LogManager.IsActionLogEnable())
9885 {
9886 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9887 }
9888
9889 if (action_array.Find(action) != -1)
9890 {
9891 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9892 }
9893 else
9894 {
9895 action_array.Insert(action);
9896 }
9897 }
9898
9900 {
9902 ActionBase action = player.GetActionManager().GetAction(actionName);
9905
9906 if (action_array)
9907 {
9908 action_array.RemoveItem(action);
9909 }
9910 }
9911
9912
9913
9915 {
9916 ActionOverrideData overrideData = new ActionOverrideData();
9920
9922 if (!actionMap)
9923 {
9926 }
9927
9928 actionMap.Insert(this.
Type(), overrideData);
9929
9930 }
9931
9933
9935
9936
9938 {
9941
9944
9945 string config_to_search = "CfgVehicles";
9946 string muzzle_owner_config;
9947
9949 {
9950 if (IsInherited(Weapon))
9951 config_to_search = "CfgWeapons";
9952
9953 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9954
9955 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9956
9958
9959 if (config_OnFire_subclass_count > 0)
9960 {
9961 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9962
9963 for (int i = 0; i < config_OnFire_subclass_count; i++)
9964 {
9965 string particle_class = "";
9967 string config_OnFire_entry = config_OnFire_class + particle_class;
9968 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9969 WPOF_array.Insert(WPOF);
9970 }
9971
9972
9974 }
9975 }
9976
9978 {
9979 config_to_search = "CfgWeapons";
9980 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9981
9982 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9983
9985
9986 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9987 {
9988 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9989
9990 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9991 {
9992 string particle_class2 = "";
9994 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9995 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9996 WPOBE_array.Insert(WPOBE);
9997 }
9998
9999
10001 }
10002 }
10003 }
10004
10005
10007 {
10010
10012 {
10013 string config_to_search = "CfgVehicles";
10014
10015 if (IsInherited(Weapon))
10016 config_to_search = "CfgWeapons";
10017
10018 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10019 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10020
10021 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10022 {
10023
10025
10027 {
10029 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10031 return;
10032 }
10033
10036
10037
10038
10040 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10041
10042 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10043 {
10044 string particle_class = "";
10046 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10048
10049 if (entry_type == CT_CLASS)
10050 {
10051 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10052 WPOOH_array.Insert(WPOF);
10053 }
10054 }
10055
10056
10058 }
10059 }
10060 }
10061
10063 {
10065 }
10066
10068 {
10070 {
10072
10075
10078
10079 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10080 }
10081 }
10082
10084 {
10086 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10087
10089 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10090
10092 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10093
10095 {
10097 }
10098 }
10099
10101 {
10103 }
10104
10106 {
10109 else
10111
10113 {
10116 }
10117 else
10118 {
10121
10124 }
10125
10127 }
10128
10130 {
10132 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10133 }
10134
10136 {
10138 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10140 }
10141
10143 {
10145 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10146 }
10147
10149 {
10152
10153 OverheatingParticle OP = new OverheatingParticle();
10158
10160 }
10161
10163 {
10166
10167 return -1;
10168 }
10169
10171 {
10173 {
10176
10177 for (int i = count; i > 0; --i)
10178 {
10179 int id = i - 1;
10182
10185
10186 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10187 {
10188 if (p)
10189 {
10192 }
10193 }
10194 }
10195 }
10196 }
10197
10199 {
10201 {
10203 {
10204 int id = i - 1;
10206
10207 if (OP)
10208 {
10210
10211 if (p)
10212 {
10214 }
10215
10216 delete OP;
10217 }
10218 }
10219
10222 }
10223 }
10224
10227 {
10228 return 0.0;
10229 }
10230
10231
10233 {
10234 return 250;
10235 }
10236
10238 {
10239 return 0;
10240 }
10241
10244 {
10246 return true;
10247
10248 return false;
10249 }
10250
10253 {
10256
10258 {
10260 }
10261 else
10262 {
10263
10265 }
10266
10268 }
10269
10276 {
10277 return -1;
10278 }
10279
10280
10281
10282
10284 {
10286 {
10288 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10289
10290 if (r_index >= 0)
10291 {
10292 InventoryLocation r_il = new InventoryLocation;
10293 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10294
10295 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10298 {
10299 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10300 }
10302 {
10303 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10304 }
10305
10306 }
10307
10308 player.GetHumanInventory().ClearUserReservedLocation(this);
10309 }
10310
10313 }
10314
10315
10316
10317
10319 {
10320 return ItemBase.m_DebugActionsMask;
10321 }
10322
10324 {
10325 return ItemBase.m_DebugActionsMask & mask;
10326 }
10327
10329 {
10330 ItemBase.m_DebugActionsMask = mask;
10331 }
10332
10334 {
10335 ItemBase.m_DebugActionsMask |= mask;
10336 }
10337
10339 {
10340 ItemBase.m_DebugActionsMask &= ~mask;
10341 }
10342
10344 {
10346 {
10348 }
10349 else
10350 {
10352 }
10353 }
10354
10355
10357 {
10358 if (GetEconomyProfile())
10359 {
10360 float q_max = GetEconomyProfile().GetQuantityMax();
10361 if (q_max > 0)
10362 {
10363 float q_min = GetEconomyProfile().GetQuantityMin();
10364 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10365
10367 {
10368 ComponentEnergyManager comp = GetCompEM();
10370 {
10372 }
10373 }
10375 {
10377
10378 }
10379
10380 }
10381 }
10382 }
10383
10386 {
10387 EntityAI parent = GetHierarchyParent();
10388
10389 if (parent)
10390 {
10391 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10392 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10393 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10394 }
10395 }
10396
10399 {
10400 EntityAI parent = GetHierarchyParent();
10401
10402 if (parent)
10403 {
10404 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10405 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10406 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10407 }
10408 }
10409
10411 {
10412
10413
10414
10415
10417
10419 {
10420 if (ScriptInputUserData.CanStoreInputUserData())
10421 {
10422 ScriptInputUserData ctx = new ScriptInputUserData;
10428 ctx.
Write(use_stack_max);
10431
10433 {
10434 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10435 }
10436 }
10437 }
10438 else if (!
GetGame().IsMultiplayer())
10439 {
10441 }
10442 }
10443
10445 {
10447 }
10448
10450 {
10452 }
10453
10455 {
10457 }
10458
10460 {
10461
10462 return false;
10463 }
10464
10466 {
10467 return false;
10468 }
10469
10473 {
10474 return false;
10475 }
10476
10478 {
10479 return "";
10480 }
10481
10483
10485 {
10486 return false;
10487 }
10488
10490 {
10491 return true;
10492 }
10493
10494
10495
10497 {
10498 return true;
10499 }
10500
10502 {
10503 return true;
10504 }
10505
10507 {
10508 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10510 }
10511
10513 {
10515 }
10516
10518 {
10520 if (!is_being_placed)
10522 SetSynchDirty();
10523 }
10524
10525
10527
10529 {
10531 }
10532
10534 {
10536 }
10537
10539 {
10540 return 1;
10541 }
10542
10544 {
10545 return false;
10546 }
10547
10549 {
10551 SetSynchDirty();
10552 }
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10589 {
10590 super.OnMovedInsideCargo(container);
10591
10592 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10593 }
10594
10595 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10596 {
10597 super.EEItemLocationChanged(oldLoc,newLoc);
10598
10599 PlayerBase new_player = null;
10600 PlayerBase old_player = null;
10601
10602 if (newLoc.GetParent())
10603 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10604
10605 if (oldLoc.GetParent())
10606 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10607
10609 {
10610 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10611
10612 if (r_index >= 0)
10613 {
10614 InventoryLocation r_il = new InventoryLocation;
10615 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10616
10617 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10620 {
10621 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10622 }
10624 {
10625 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10626 }
10627
10628 }
10629 }
10630
10632 {
10633 if (new_player)
10634 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10635
10636 if (new_player == old_player)
10637 {
10638
10639 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10640 {
10642 {
10643 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10644 {
10645 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10646 }
10647 }
10648 else
10649 {
10650 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10651 }
10652 }
10653
10654 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10655 {
10656 int type = oldLoc.GetType();
10658 {
10659 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10660 }
10662 {
10663 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10664 }
10665 }
10666 if (!m_OldLocation)
10667 {
10668 m_OldLocation = new InventoryLocation;
10669 }
10670 m_OldLocation.Copy(oldLoc);
10671 }
10672 else
10673 {
10674 if (m_OldLocation)
10675 {
10676 m_OldLocation.Reset();
10677 }
10678 }
10679
10681 }
10682 else
10683 {
10684 if (new_player)
10685 {
10686 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10687 if (res_index >= 0)
10688 {
10689 InventoryLocation il = new InventoryLocation;
10690 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10692 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10695 {
10696 il.
GetParent().GetOnReleaseLock().Invoke(it);
10697 }
10699 {
10701 }
10702
10703 }
10704 }
10706 {
10707
10709 }
10710
10711 if (m_OldLocation)
10712 {
10713 m_OldLocation.Reset();
10714 }
10715 }
10716 }
10717
10718 override void EOnContact(IEntity other, Contact extra)
10719 {
10721 {
10722 int liquidType = -1;
10724 if (impactSpeed > 0.0)
10725 {
10727 #ifndef SERVER
10729 #else
10731 SetSynchDirty();
10732 #endif
10734 }
10735 }
10736
10737 #ifdef SERVER
10738 if (GetCompEM() && GetCompEM().IsPlugged())
10739 {
10740 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10741 GetCompEM().UnplugThis();
10742 }
10743 #endif
10744 }
10745
10747
10749 {
10751 }
10752
10754 {
10755
10756 }
10757
10759 {
10760 super.OnItemLocationChanged(old_owner, new_owner);
10761
10762 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10763 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10764
10765 if (!relatedPlayer && playerNew)
10766 relatedPlayer = playerNew;
10767
10768 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10769 {
10771 if (actionMgr)
10772 {
10773 ActionBase currentAction = actionMgr.GetRunningAction();
10774 if (currentAction)
10776 }
10777 }
10778
10779 Man ownerPlayerOld = null;
10780 Man ownerPlayerNew = null;
10781
10782 if (old_owner)
10783 {
10784 if (old_owner.
IsMan())
10785 {
10786 ownerPlayerOld = Man.Cast(old_owner);
10787 }
10788 else
10789 {
10790 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10791 }
10792 }
10793 else
10794 {
10796 {
10798
10799 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10800 {
10801 GetCompEM().UnplugThis();
10802 }
10803 }
10804 }
10805
10806 if (new_owner)
10807 {
10808 if (new_owner.
IsMan())
10809 {
10810 ownerPlayerNew = Man.Cast(new_owner);
10811 }
10812 else
10813 {
10814 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10815 }
10816 }
10817
10818 if (ownerPlayerOld != ownerPlayerNew)
10819 {
10820 if (ownerPlayerOld)
10821 {
10822 array<EntityAI> subItemsExit = new array<EntityAI>;
10824 for (int i = 0; i < subItemsExit.Count(); i++)
10825 {
10828 }
10829 }
10830
10831 if (ownerPlayerNew)
10832 {
10833 array<EntityAI> subItemsEnter = new array<EntityAI>;
10835 for (int j = 0; j < subItemsEnter.Count(); j++)
10836 {
10839 }
10840 }
10841 }
10842 else if (ownerPlayerNew != null)
10843 {
10844 PlayerBase nplayer;
10845 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10846 {
10847 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10849 for (int k = 0; k < subItemsUpdate.Count(); k++)
10850 {
10852 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10853 }
10854 }
10855 }
10856
10857 if (old_owner)
10858 old_owner.OnChildItemRemoved(this);
10859 if (new_owner)
10860 new_owner.OnChildItemReceived(this);
10861 }
10862
10863
10865 {
10866 super.EEDelete(parent);
10867 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10868 if (player)
10869 {
10871
10872 if (player.IsAlive())
10873 {
10874 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10875 if (r_index >= 0)
10876 {
10877 InventoryLocation r_il = new InventoryLocation;
10878 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10879
10880 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10883 {
10884 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10885 }
10887 {
10888 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10889 }
10890
10891 }
10892
10893 player.RemoveQuickBarEntityShortcut(this);
10894 }
10895 }
10896 }
10897
10899 {
10900 super.EEKilled(killer);
10901
10904 {
10905 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10906 {
10907 if (IsMagazine())
10908 {
10909 if (Magazine.Cast(this).GetAmmoCount() > 0)
10910 {
10912 }
10913 }
10914 else
10915 {
10917 }
10918 }
10919 }
10920 }
10921
10923 {
10924 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10925
10926 super.OnWasAttached(parent, slot_id);
10927
10930
10932 }
10933
10935 {
10936 super.OnWasDetached(parent, slot_id);
10937
10940 }
10941
10943 {
10944 int idx;
10947
10948 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10949 if (inventory_slots.Count() < 1)
10950 {
10951 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10952 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10953 }
10954 else
10955 {
10956 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10957 }
10958
10959 idx = inventory_slots.Find(slot);
10960 if (idx < 0)
10961 return "";
10962
10963 return attach_types.Get(idx);
10964 }
10965
10967 {
10968 int idx = -1;
10969 string slot;
10970
10973
10974 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10975 if (inventory_slots.Count() < 1)
10976 {
10977 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10978 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10979 }
10980 else
10981 {
10982 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10983 if (detach_types.Count() < 1)
10984 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10985 }
10986
10987 for (int i = 0; i < inventory_slots.Count(); i++)
10988 {
10989 slot = inventory_slots.Get(i);
10990 }
10991
10992 if (slot != "")
10993 {
10994 if (detach_types.Count() == 1)
10995 idx = 0;
10996 else
10997 idx = inventory_slots.Find(slot);
10998 }
10999 if (idx < 0)
11000 return "";
11001
11002 return detach_types.Get(idx);
11003 }
11004
11006 {
11007
11009
11010
11011 float min_time = 1;
11012 float max_time = 3;
11013 float delay = Math.RandomFloat(min_time, max_time);
11014
11015 explode_timer.Run(delay, this, "DoAmmoExplosion");
11016 }
11017
11019 {
11020 Magazine magazine = Magazine.Cast(this);
11021 int pop_sounds_count = 6;
11022 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11023
11024
11025 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11026 string sound_name = pop_sounds[ sound_idx ];
11028
11029
11030 magazine.ServerAddAmmoCount(-1);
11031
11032
11033 float min_temp_to_explode = 100;
11034
11035 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
11036 {
11038 }
11039 }
11040
11041
11042 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11043 {
11044 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11045
11046 const int CHANCE_DAMAGE_CARGO = 4;
11047 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11048 const int CHANCE_DAMAGE_NOTHING = 2;
11049
11051 {
11052 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11053 int chances;
11054 int rnd;
11055
11056 if (GetInventory().GetCargo())
11057 {
11058 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11059 rnd = Math.RandomInt(0,chances);
11060
11061 if (rnd < CHANCE_DAMAGE_CARGO)
11062 {
11064 }
11065 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11066 {
11068 }
11069 }
11070 else
11071 {
11072 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11073 rnd = Math.RandomInt(0,chances);
11074
11075 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11076 {
11078 }
11079 }
11080 }
11081 }
11082
11084 {
11085 if (GetInventory().GetCargo())
11086 {
11087 int item_count = GetInventory().GetCargo().GetItemCount();
11088 if (item_count > 0)
11089 {
11090 int random_pick = Math.RandomInt(0, item_count);
11092 if (!item.IsExplosive())
11093 {
11094 item.AddHealth("","",damage);
11095 return true;
11096 }
11097 }
11098 }
11099 return false;
11100 }
11101
11103 {
11104 int attachment_count = GetInventory().AttachmentCount();
11105 if (attachment_count > 0)
11106 {
11107 int random_pick = Math.RandomInt(0, attachment_count);
11108 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11109 if (!attachment.IsExplosive())
11110 {
11111 attachment.AddHealth("","",damage);
11112 return true;
11113 }
11114 }
11115 return false;
11116 }
11117
11119 {
11121 }
11122
11124 {
11126 return GetInventory().CanRemoveEntity();
11127
11128 return false;
11129 }
11130
11132 {
11134 return;
11135
11137 {
11138 if (ScriptInputUserData.CanStoreInputUserData())
11139 {
11140 ScriptInputUserData ctx = new ScriptInputUserData;
11145 ctx.
Write(destination_entity);
11147 ctx.
Write(slot_id);
11149 }
11150 }
11151 else if (!
GetGame().IsMultiplayer())
11152 {
11154 }
11155 }
11156
11158 {
11160 return;
11161
11162 float split_quantity_new;
11166 InventoryLocation loc = new InventoryLocation;
11167
11168 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11169 {
11171 split_quantity_new = stack_max;
11172 else
11174
11175 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11176 if (new_item)
11177 {
11178 new_item.SetResultOfSplit(true);
11179 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11181 new_item.SetQuantity(split_quantity_new);
11182 }
11183 }
11184 else if (destination_entity && slot_id == -1)
11185 {
11186 if (quantity > stack_max)
11187 split_quantity_new = stack_max;
11188 else
11189 split_quantity_new = quantity;
11190
11192 {
11195 }
11196
11197 if (new_item)
11198 {
11199 new_item.SetResultOfSplit(true);
11200 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11202 new_item.SetQuantity(split_quantity_new);
11203 }
11204 }
11205 else
11206 {
11207 if (stack_max != 0)
11208 {
11210 {
11212 }
11213
11214 if (split_quantity_new == 0)
11215 {
11216 if (!
GetGame().IsMultiplayer())
11217 player.PhysicalPredictiveDropItem(this);
11218 else
11219 player.ServerDropEntity(this);
11220 return;
11221 }
11222
11224
11225 if (new_item)
11226 {
11227 new_item.SetResultOfSplit(true);
11228 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11230 new_item.SetQuantity(stack_max);
11231 new_item.PlaceOnSurface();
11232 }
11233 }
11234 }
11235 }
11236
11238 {
11240 return;
11241
11242 float split_quantity_new;
11246 InventoryLocation loc = new InventoryLocation;
11247
11248 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11249 {
11251 split_quantity_new = stack_max;
11252 else
11254
11255 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11256 if (new_item)
11257 {
11258 new_item.SetResultOfSplit(true);
11259 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11261 new_item.SetQuantity(split_quantity_new);
11262 }
11263 }
11264 else if (destination_entity && slot_id == -1)
11265 {
11266 if (quantity > stack_max)
11267 split_quantity_new = stack_max;
11268 else
11269 split_quantity_new = quantity;
11270
11272 {
11275 }
11276
11277 if (new_item)
11278 {
11279 new_item.SetResultOfSplit(true);
11280 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11282 new_item.SetQuantity(split_quantity_new);
11283 }
11284 }
11285 else
11286 {
11287 if (stack_max != 0)
11288 {
11290 {
11292 }
11293
11295
11296 if (new_item)
11297 {
11298 new_item.SetResultOfSplit(true);
11299 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11301 new_item.SetQuantity(stack_max);
11302 new_item.PlaceOnSurface();
11303 }
11304 }
11305 }
11306 }
11307
11309 {
11311 return;
11312
11314 {
11315 if (ScriptInputUserData.CanStoreInputUserData())
11316 {
11317 ScriptInputUserData ctx = new ScriptInputUserData;
11322 dst.WriteToContext(ctx);
11324 }
11325 }
11326 else if (!
GetGame().IsMultiplayer())
11327 {
11329 }
11330 }
11331
11333 {
11335 return;
11336
11338 {
11339 if (ScriptInputUserData.CanStoreInputUserData())
11340 {
11341 ScriptInputUserData ctx = new ScriptInputUserData;
11346 ctx.
Write(destination_entity);
11352 }
11353 }
11354 else if (!
GetGame().IsMultiplayer())
11355 {
11357 }
11358 }
11359
11361 {
11363 }
11364
11366 {
11368 return this;
11369
11371 float split_quantity_new;
11373 if (dst.IsValid())
11374 {
11375 int slot_id = dst.GetSlot();
11377
11378 if (quantity > stack_max)
11379 split_quantity_new = stack_max;
11380 else
11381 split_quantity_new = quantity;
11382
11384
11385 if (new_item)
11386 {
11387 new_item.SetResultOfSplit(true);
11388 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11391 }
11392
11393 return new_item;
11394 }
11395
11396 return null;
11397 }
11398
11400 {
11402 return;
11403
11405 float split_quantity_new;
11407 if (destination_entity)
11408 {
11410 if (quantity > stackable)
11411 split_quantity_new = stackable;
11412 else
11413 split_quantity_new = quantity;
11414
11415 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11416 if (new_item)
11417 {
11418 new_item.SetResultOfSplit(true);
11419 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11421 new_item.SetQuantity(split_quantity_new);
11422 }
11423 }
11424 }
11425
11427 {
11429 return;
11430
11432 {
11433 if (ScriptInputUserData.CanStoreInputUserData())
11434 {
11435 ScriptInputUserData ctx = new ScriptInputUserData;
11440 ItemBase destination_entity =
this;
11441 ctx.
Write(destination_entity);
11445 }
11446 }
11447 else if (!
GetGame().IsMultiplayer())
11448 {
11450 }
11451 }
11452
11454 {
11456 return;
11457
11459 float split_quantity_new;
11461 if (player)
11462 {
11464 if (quantity > stackable)
11465 split_quantity_new = stackable;
11466 else
11467 split_quantity_new = quantity;
11468
11469 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11470 new_item =
ItemBase.Cast(in_hands);
11471 if (new_item)
11472 {
11473 new_item.SetResultOfSplit(true);
11474 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11476 new_item.SetQuantity(split_quantity_new);
11477 }
11478 }
11479 }
11480
11482 {
11484 return;
11485
11487 float split_quantity_new = Math.Floor(quantity * 0.5);
11488
11490
11491 if (new_item)
11492 {
11493 if (new_item.GetQuantityMax() < split_quantity_new)
11494 {
11495 split_quantity_new = new_item.GetQuantityMax();
11496 }
11497
11498 new_item.SetResultOfSplit(true);
11499 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11500
11502 {
11505 }
11506 else
11507 {
11510 }
11511 }
11512 }
11513
11515 {
11517 return;
11518
11520 float split_quantity_new = Math.Floor(quantity / 2);
11521
11522 InventoryLocation invloc = new InventoryLocation;
11524
11526 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11527
11528 if (new_item)
11529 {
11530 if (new_item.GetQuantityMax() < split_quantity_new)
11531 {
11532 split_quantity_new = new_item.GetQuantityMax();
11533 }
11535 {
11538 }
11539 else
11540 {
11543 }
11544 }
11545 }
11546
11549 {
11550 SetWeightDirty();
11552
11553 if (parent)
11554 parent.OnAttachmentQuantityChangedEx(this, delta);
11555
11557 {
11559 {
11561 }
11563 {
11564 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11566 }
11567 }
11568
11569 }
11570
11573 {
11574
11575 }
11576
11579 {
11581 }
11582
11584 {
11585 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11586
11588 {
11589 if (newLevel == GameConstants.STATE_RUINED)
11590 {
11592 EntityAI parent = GetHierarchyParent();
11593 if (parent && parent.IsFireplace())
11594 {
11595 CargoBase cargo = GetInventory().GetCargo();
11596 if (cargo)
11597 {
11599 {
11601 }
11602 }
11603 }
11604 }
11605
11607 {
11608
11610 return;
11611 }
11612
11613 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11614 {
11616 }
11617 }
11618 }
11619
11620
11622 {
11623 super.OnRightClick();
11624
11626 {
11628 {
11629 if (ScriptInputUserData.CanStoreInputUserData())
11630 {
11631 vector m4[4];
11633
11634 EntityAI root = GetHierarchyRoot();
11635
11636 InventoryLocation dst = new InventoryLocation;
11638 {
11639 if (root)
11640 {
11641 root.GetTransform(m4);
11643 }
11644 else
11645 GetInventory().GetCurrentInventoryLocation(dst);
11646 }
11647 else
11648 {
11650
11651
11652 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11653 {
11654 if (root)
11655 {
11656 root.GetTransform(m4);
11658 }
11659 else
11660 GetInventory().GetCurrentInventoryLocation(dst);
11661 }
11662 else
11663 {
11664 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11665 }
11666 }
11667
11668 ScriptInputUserData ctx = new ScriptInputUserData;
11676 }
11677 }
11678 else if (!
GetGame().IsMultiplayer())
11679 {
11681 }
11682 }
11683 }
11684
11685 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11686 {
11687
11688 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11689 return false;
11690
11691 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11692 return false;
11693
11694
11696 return false;
11697
11698
11699 Magazine mag = Magazine.Cast(this);
11700 if (mag)
11701 {
11702 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11703 return false;
11704
11705 if (stack_max_limit)
11706 {
11707 Magazine other_mag = Magazine.Cast(other_item);
11708 if (other_item)
11709 {
11710 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11711 return false;
11712 }
11713
11714 }
11715 }
11716 else
11717 {
11718
11720 return false;
11721
11723 return false;
11724 }
11725
11726 PlayerBase player = null;
11727 if (CastTo(player, GetHierarchyRootPlayer()))
11728 {
11729 if (player.GetInventory().HasAttachment(this))
11730 return false;
11731
11732 if (player.IsItemsToDelete())
11733 return false;
11734 }
11735
11736 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11737 return false;
11738
11739 int slotID;
11741 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11742 return false;
11743
11744 return true;
11745 }
11746
11748 {
11750 }
11751
11753 {
11754 return m_IsResultOfSplit;
11755 }
11756
11758 {
11759 m_IsResultOfSplit = value;
11760 }
11761
11763 {
11765 }
11766
11768 {
11769 float other_item_quantity = other_item.GetQuantity();
11770 float this_free_space;
11771
11773
11775
11776 if (other_item_quantity > this_free_space)
11777 {
11778 return this_free_space;
11779 }
11780 else
11781 {
11782 return other_item_quantity;
11783 }
11784 }
11785
11787 {
11789 }
11790
11792 {
11794 return;
11795
11796 if (!IsMagazine() && other_item)
11797 {
11799 if (quantity_used != 0)
11800 {
11801 float hp1 = GetHealth01("","");
11802 float hp2 = other_item.GetHealth01("","");
11803 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11804 hpResult = hpResult / (
GetQuantity() + quantity_used);
11805
11806 hpResult *= GetMaxHealth();
11807 Math.Round(hpResult);
11808 SetHealth("", "Health", hpResult);
11809
11811 other_item.AddQuantity(-quantity_used);
11812 }
11813 }
11815 }
11816
11818 {
11819 #ifdef SERVER
11820 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11821 GetHierarchyParent().IncreaseLifetimeUp();
11822 #endif
11823 };
11824
11826 {
11827 PlayerBase p = PlayerBase.Cast(player);
11828
11829 array<int> recipesIds = p.m_Recipes;
11830 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11831 if (moduleRecipesManager)
11832 {
11833 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11834 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11835 }
11836
11837 for (int i = 0;i < recipesIds.Count(); i++)
11838 {
11839 int key = recipesIds.Get(i);
11840 string recipeName = moduleRecipesManager.GetRecipeName(key);
11842 }
11843 }
11844
11845
11846 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11847 {
11848 super.GetDebugActions(outputList);
11849
11850
11855
11856
11860
11864
11865
11868
11869
11871 {
11874 }
11875
11877
11880
11884 }
11885
11886
11887
11888
11890 {
11891 super.OnAction(action_id, player, ctx);
11892 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11893 {
11894 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11895 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11896 PlayerBase p = PlayerBase.Cast(player);
11897 if (
EActions.RECIPES_RANGE_START < 1000)
11898 {
11899 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11900 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11901 }
11902 }
11903 #ifndef SERVER
11904 else if (action_id ==
EActions.WATCH_PLAYER)
11905 {
11906 PluginDeveloper.SetDeveloperItemClientEx(player);
11907 }
11908 #endif
11910 {
11911 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11912 {
11913 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11914 OnDebugButtonPressServer(id + 1);
11915 }
11916
11917 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11918 {
11919 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11921 }
11922
11923 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11924 {
11925 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11927 }
11928
11929 else if (action_id ==
EActions.ADD_QUANTITY)
11930 {
11931 if (IsMagazine())
11932 {
11933 Magazine mag = Magazine.Cast(this);
11934 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11935 }
11936 else
11937 {
11939 }
11940
11941 if (m_EM)
11942 {
11943 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11944 }
11945
11946 }
11947
11948 else if (action_id ==
EActions.REMOVE_QUANTITY)
11949 {
11950 if (IsMagazine())
11951 {
11952 Magazine mag2 = Magazine.Cast(this);
11953 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11954 }
11955 else
11956 {
11958 }
11959 if (m_EM)
11960 {
11961 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11962 }
11963
11964 }
11965
11966 else if (action_id ==
EActions.SET_QUANTITY_0)
11967 {
11969
11970 if (m_EM)
11971 {
11972 m_EM.SetEnergy(0);
11973 }
11974 }
11975
11976 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11977 {
11979
11980 if (m_EM)
11981 {
11982 m_EM.SetEnergy(m_EM.GetEnergyMax());
11983 }
11984 }
11985
11986 else if (action_id ==
EActions.ADD_HEALTH)
11987 {
11988 AddHealth("","",GetMaxHealth("","Health")/5);
11989 }
11990 else if (action_id ==
EActions.REMOVE_HEALTH)
11991 {
11992 AddHealth("","",-GetMaxHealth("","Health")/5);
11993 }
11994 else if (action_id ==
EActions.DESTROY_HEALTH)
11995 {
11996 SetHealth01("","",0);
11997 }
11998 else if (action_id ==
EActions.WATCH_ITEM)
11999 {
12001 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12002 #ifdef DEVELOPER
12003 SetDebugDeveloper_item(this);
12004 #endif
12005 }
12006
12007 else if (action_id ==
EActions.ADD_TEMPERATURE)
12008 {
12009 AddTemperature(20);
12010
12011 }
12012
12013 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12014 {
12015 AddTemperature(-20);
12016
12017 }
12018
12019 else if (action_id ==
EActions.FLIP_FROZEN)
12020 {
12021 SetFrozen(!GetIsFrozen());
12022
12023 }
12024
12025 else if (action_id ==
EActions.ADD_WETNESS)
12026 {
12028
12029 }
12030
12031 else if (action_id ==
EActions.REMOVE_WETNESS)
12032 {
12034
12035 }
12036
12037 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12038 {
12041
12042
12043 }
12044
12045 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12046 {
12049 }
12050
12051 else if (action_id ==
EActions.MAKE_SPECIAL)
12052 {
12053 auto debugParams = DebugSpawnParams.WithPlayer(player);
12054 OnDebugSpawnEx(debugParams);
12055 }
12056
12057 else if (action_id ==
EActions.DELETE)
12058 {
12059 Delete();
12060 }
12061
12062 }
12063
12064
12065 return false;
12066 }
12067
12068
12069
12070
12074
12077
12078
12079
12081 {
12082 return false;
12083 }
12084
12085
12087 {
12088 return true;
12089 }
12090
12091
12093 {
12094 return true;
12095 }
12096
12097
12098
12100 {
12101 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12103 }
12104
12107 {
12108 return null;
12109 }
12110
12112 {
12113 return false;
12114 }
12115
12117 {
12118 return false;
12119 }
12120
12124
12125
12127 {
12128 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12129 return module_repairing.CanRepair(this, item_repair_kit);
12130 }
12131
12132
12133 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12134 {
12135 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12136 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12137 }
12138
12139
12141 {
12142
12143
12144
12145
12146
12147
12148
12149
12150 return 1;
12151 }
12152
12153
12154
12156 {
12158 }
12159
12160
12161
12163 {
12165 }
12166
12167
12176 {
12177 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12178
12179 if (player)
12180 {
12181 player.MessageStatus(text);
12182 }
12183 }
12184
12185
12194 {
12195 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12196
12197 if (player)
12198 {
12199 player.MessageAction(text);
12200 }
12201 }
12202
12203
12212 {
12213 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12214
12215 if (player)
12216 {
12217 player.MessageFriendly(text);
12218 }
12219 }
12220
12221
12230 {
12231 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12232
12233 if (player)
12234 {
12235 player.MessageImportant(text);
12236 }
12237 }
12238
12240 {
12241 return true;
12242 }
12243
12244
12245 override bool KindOf(
string tag)
12246 {
12247 bool found = false;
12248 string item_name = this.
GetType();
12251
12252 int array_size = item_tag_array.Count();
12253 for (int i = 0; i < array_size; i++)
12254 {
12255 if (item_tag_array.Get(i) == tag)
12256 {
12257 found = true;
12258 break;
12259 }
12260 }
12261 return found;
12262 }
12263
12264
12266 {
12267
12268 super.OnRPC(sender, rpc_type,ctx);
12269
12270
12271 switch (rpc_type)
12272 {
12273 #ifndef SERVER
12274 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12275 Param2<bool, string> p = new Param2<bool, string>(false, "");
12276
12278 return;
12279
12280 bool play = p.param1;
12281 string soundSet = p.param2;
12282
12283 if (play)
12284 {
12286 {
12288 {
12290 }
12291 }
12292 else
12293 {
12295 }
12296 }
12297 else
12298 {
12300 }
12301
12302 break;
12303 #endif
12304
12305 }
12306
12308 {
12310 }
12311 }
12312
12313
12314
12315
12317 {
12318 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12319 return plugin.GetID(
name);
12320 }
12321
12323 {
12324 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12325 return plugin.GetName(id);
12326 }
12327
12330 {
12331
12332
12333 int varFlags;
12334 if (!ctx.
Read(varFlags))
12335 return;
12336
12337 if (varFlags & ItemVariableFlags.FLOAT)
12338 {
12340 }
12341 }
12342
12344 {
12345
12346 super.SerializeNumericalVars(floats_out);
12347
12348
12349
12351 {
12353 }
12354
12356 {
12358 }
12359
12361 {
12363 }
12364
12366 {
12371 }
12372
12374 {
12376 }
12377 }
12378
12380 {
12381
12382 super.DeSerializeNumericalVars(floats);
12383
12384
12385 int index = 0;
12386 int mask = Math.Round(floats.Get(index));
12387
12388 index++;
12389
12391 {
12393 {
12395 }
12396 else
12397 {
12398 float quantity = floats.Get(index);
12399 SetQuantity(quantity,
true,
false,
false,
false);
12400 }
12401 index++;
12402 }
12403
12405 {
12406 float wet = floats.Get(index);
12408 index++;
12409 }
12410
12412 {
12413 int liquidtype = Math.Round(floats.Get(index));
12415 index++;
12416 }
12417
12419 {
12421 index++;
12423 index++;
12425 index++;
12427 index++;
12428 }
12429
12431 {
12432 int cleanness = Math.Round(floats.Get(index));
12434 index++;
12435 }
12436 }
12437
12439 {
12440 super.WriteVarsToCTX(ctx);
12441
12442
12444 {
12446 }
12447
12449 {
12451 }
12452
12454 {
12456 }
12457
12459 {
12460 int r,g,b,a;
12466 }
12467
12469 {
12471 }
12472 }
12473
12475 {
12476 if (!super.ReadVarsFromCTX(ctx,version))
12477 return false;
12478
12479 int intValue;
12480 float value;
12481
12482 if (version < 140)
12483 {
12484 if (!ctx.
Read(intValue))
12485 return false;
12486
12487 m_VariablesMask = intValue;
12488 }
12489
12491 {
12492 if (!ctx.
Read(value))
12493 return false;
12494
12496 {
12498 }
12499 else
12500 {
12502 }
12503 }
12504
12505 if (version < 140)
12506 {
12508 {
12509 if (!ctx.
Read(value))
12510 return false;
12511 SetTemperatureDirect(value);
12512 }
12513 }
12514
12516 {
12517 if (!ctx.
Read(value))
12518 return false;
12520 }
12521
12523 {
12524 if (!ctx.
Read(intValue))
12525 return false;
12527 }
12528
12530 {
12531 int r,g,b,a;
12533 return false;
12535 return false;
12537 return false;
12539 return false;
12540
12542 }
12543
12545 {
12546 if (!ctx.
Read(intValue))
12547 return false;
12549 }
12550
12551 if (version >= 138 && version < 140)
12552 {
12554 {
12555 if (!ctx.
Read(intValue))
12556 return false;
12557 SetFrozen(intValue);
12558 }
12559 }
12560
12561 return true;
12562 }
12563
12564
12566 {
12569 {
12571 }
12572
12573 if (!super.OnStoreLoad(ctx, version))
12574 {
12576 return false;
12577 }
12578
12579 if (version >= 114)
12580 {
12581 bool hasQuickBarIndexSaved;
12582
12583 if (!ctx.
Read(hasQuickBarIndexSaved))
12584 {
12586 return false;
12587 }
12588
12589 if (hasQuickBarIndexSaved)
12590 {
12591 int itmQBIndex;
12592
12593
12594 if (!ctx.
Read(itmQBIndex))
12595 {
12597 return false;
12598 }
12599
12600 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12601 if (itmQBIndex != -1 && parentPlayer)
12602 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12603 }
12604 }
12605 else
12606 {
12607
12608 PlayerBase player;
12609 int itemQBIndex;
12610 if (version ==
int.
MAX)
12611 {
12612 if (!ctx.
Read(itemQBIndex))
12613 {
12615 return false;
12616 }
12617 }
12618 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12619 {
12620
12621 if (!ctx.
Read(itemQBIndex))
12622 {
12624 return false;
12625 }
12626 if (itemQBIndex != -1 && player)
12627 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12628 }
12629 }
12630
12631 if (version < 140)
12632 {
12633
12634 if (!LoadVariables(ctx, version))
12635 {
12637 return false;
12638 }
12639 }
12640
12641
12643 {
12645 return false;
12646 }
12647 if (version >= 132)
12648 {
12650 if (raib)
12651 {
12653 {
12655 return false;
12656 }
12657 }
12658 }
12659
12661 return true;
12662 }
12663
12664
12665
12667 {
12668 super.OnStoreSave(ctx);
12669
12670 PlayerBase player;
12671 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12672 {
12674
12675 int itemQBIndex = -1;
12676 itemQBIndex = player.FindQuickBarEntityIndex(this);
12677 ctx.
Write(itemQBIndex);
12678 }
12679 else
12680 {
12682 }
12683
12685
12687 if (raib)
12688 {
12690 }
12691 }
12692
12693
12695 {
12696 super.AfterStoreLoad();
12697
12699 {
12701 }
12702
12704 {
12707 }
12708 }
12709
12711 {
12712 super.EEOnAfterLoad();
12713
12715 {
12717 }
12718
12721 }
12722
12724 {
12725 return false;
12726 }
12727
12728
12729
12731 {
12733 {
12734 #ifdef PLATFORM_CONSOLE
12735
12737 {
12739 if (menu)
12740 {
12742 }
12743 }
12744 #endif
12745 }
12746
12748 {
12751 }
12752
12754 {
12755 SetWeightDirty();
12757 }
12759 {
12762 }
12763
12765 {
12768 }
12770 {
12773 }
12774
12775 super.OnVariablesSynchronized();
12776 }
12777
12778
12779
12781 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12782 {
12783 if (!IsServerCheck(allow_client))
12784 return false;
12785
12787 return false;
12788
12791
12792 if (value <= (min + 0.001))
12793 value = min;
12794
12795 if (value == min)
12796 {
12797 if (destroy_config)
12798 {
12799 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12800 if (dstr)
12801 {
12803 this.Delete();
12804 return true;
12805 }
12806 }
12807 else if (destroy_forced)
12808 {
12810 this.Delete();
12811 return true;
12812 }
12813
12815 }
12816
12819
12821 {
12823
12824 if (delta)
12826 }
12827
12829
12830 return false;
12831 }
12832
12833
12835 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12836 {
12838 }
12839
12841 {
12844 }
12845
12847 {
12850 }
12851
12854 {
12855 float value_clamped = Math.Clamp(value, 0, 1);
12857 SetQuantity(result, destroy_config, destroy_forced);
12858 }
12859
12860
12863 {
12865 }
12866
12868 {
12870 }
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12882 {
12883 int slot = -1;
12884 if (GetInventory())
12885 {
12886 InventoryLocation il = new InventoryLocation;
12887 GetInventory().GetCurrentInventoryLocation(il);
12889 }
12890
12892 }
12893
12895 {
12896 float quantity_max = 0;
12897
12899 {
12900 if (attSlotID != -1)
12901 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12902
12903 if (quantity_max <= 0)
12905 }
12906
12907 if (quantity_max <= 0)
12909
12910 return quantity_max;
12911 }
12912
12914 {
12916 }
12917
12919 {
12921 }
12922
12923
12925 {
12927 }
12928
12930 {
12932 }
12933
12935 {
12937 }
12938
12939
12941 {
12942
12943 float weightEx = GetWeightEx();
12944 float special = GetInventoryAndCargoWeight();
12945 return weightEx - special;
12946 }
12947
12948
12950 {
12952 }
12953
12955 {
12957 {
12958 #ifdef DEVELOPER
12959 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12960 {
12961 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12963 }
12964 #endif
12965
12966 return GetQuantity() * GetConfigWeightModified();
12967 }
12968 else if (HasEnergyManager())
12969 {
12970 #ifdef DEVELOPER
12971 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12972 {
12973 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12974 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12975 }
12976 #endif
12977 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12978 }
12979 else
12980 {
12981 #ifdef DEVELOPER
12982 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12983 {
12984 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12985 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12986 }
12987 #endif
12988 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12989 }
12990 }
12991
12994 {
12995 int item_count = 0;
12997
12998 if (GetInventory().GetCargo() != NULL)
12999 {
13000 item_count = GetInventory().GetCargo().GetItemCount();
13001 }
13002
13003 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13004 {
13005 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13006 if (item)
13007 item_count += item.GetNumberOfItems();
13008 }
13009 return item_count;
13010 }
13011
13014 {
13015 float weight = 0;
13016 float wetness = 1;
13017 if (include_wetness)
13020 {
13021 weight = wetness * m_ConfigWeight;
13022 }
13024 {
13025 weight = 1;
13026 }
13027 return weight;
13028 }
13029
13030
13031
13033 {
13034 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13035 {
13036 GameInventory inv = GetInventory();
13037 array<EntityAI> items = new array<EntityAI>;
13039 for (int i = 0; i < items.Count(); i++)
13040 {
13042 if (item)
13043 {
13045 }
13046 }
13047 }
13048 }
13049
13050
13051
13052
13054 {
13055 float energy = 0;
13056 if (HasEnergyManager())
13057 {
13058 energy = GetCompEM().GetEnergy();
13059 }
13060 return energy;
13061 }
13062
13063
13065 {
13066 super.OnEnergyConsumed();
13067
13069 }
13070
13072 {
13073 super.OnEnergyAdded();
13074
13076 }
13077
13078
13080 {
13081 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13082 {
13084 {
13085 float energy_0to1 = GetCompEM().GetEnergy0To1();
13087 }
13088 }
13089 }
13090
13091
13093 {
13094 return ConfigGetFloat("heatIsolation");
13095 }
13096
13098 {
13100 }
13101
13103 {
13104 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13105 if (
GetGame().ConfigIsExisting(paramPath))
13107
13108 return 0.0;
13109 }
13110
13112 {
13113 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13114 if (
GetGame().ConfigIsExisting(paramPath))
13116
13117 return 0.0;
13118 }
13119
13120 override void SetWet(
float value,
bool allow_client =
false)
13121 {
13122 if (!IsServerCheck(allow_client))
13123 return;
13124
13127
13129
13130 m_VarWet = Math.Clamp(value, min, max);
13131
13133 {
13136 }
13137 }
13138
13139 override void AddWet(
float value)
13140 {
13142 }
13143
13145 {
13147 }
13148
13150 {
13152 }
13153
13155 {
13157 }
13158
13160 {
13162 }
13163
13165 {
13167 }
13168
13169 override void OnWetChanged(
float newVal,
float oldVal)
13170 {
13173 if (newLevel != oldLevel)
13174 {
13176 }
13177 }
13178
13180 {
13181 SetWeightDirty();
13182 }
13183
13185 {
13186 return GetWetLevelInternal(
m_VarWet);
13187 }
13188
13189
13190
13192 {
13194 }
13195
13197 {
13199 }
13200
13202 {
13204 }
13205
13207 {
13209 }
13210
13211
13212
13214 {
13215 if (ConfigIsExisting("itemModelLength"))
13216 {
13217 return ConfigGetFloat("itemModelLength");
13218 }
13219 return 0;
13220 }
13221
13223 {
13224 if (ConfigIsExisting("itemAttachOffset"))
13225 {
13226 return ConfigGetFloat("itemAttachOffset");
13227 }
13228 return 0;
13229 }
13230
13231 override void SetCleanness(
int value,
bool allow_client =
false)
13232 {
13233 if (!IsServerCheck(allow_client))
13234 return;
13235
13237
13239
13242 }
13243
13245 {
13247 }
13248
13250 {
13251 return true;
13252 }
13253
13254
13255
13256
13258 {
13260 }
13261
13263 {
13265 }
13266
13267
13268
13269
13270 override void SetColor(
int r,
int g,
int b,
int a)
13271 {
13277 }
13279 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13280 {
13285 }
13286
13288 {
13290 }
13291
13294 {
13295 int r,g,b,a;
13297 r = r/255;
13298 g = g/255;
13299 b = b/255;
13300 a = a/255;
13301 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13302 }
13303
13304
13305
13306 override void SetLiquidType(
int value,
bool allow_client =
false)
13307 {
13308 if (!IsServerCheck(allow_client))
13309 return;
13310
13315 }
13316
13318 {
13319 return ConfigGetInt("varLiquidTypeInit");
13320 }
13321
13323 {
13325 }
13326
13328 {
13330 SetFrozen(false);
13331 }
13332
13335 {
13336 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13337 }
13338
13339
13342 {
13343 PlayerBase nplayer;
13344 if (PlayerBase.CastTo(nplayer, player))
13345 {
13347
13348 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13349 }
13350 }
13351
13352
13355 {
13356 PlayerBase nplayer;
13357 if (PlayerBase.CastTo(nplayer,player))
13358 {
13359
13360 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13361
13362 }
13363
13364
13365 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13366
13367
13368 if (HasEnergyManager())
13369 {
13370 GetCompEM().UpdatePlugState();
13371 }
13372 }
13373
13374
13376 {
13377 super.OnPlacementStarted(player);
13378
13380 }
13381
13382 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13383 {
13385 {
13386 m_AdminLog.OnPlacementComplete(player,
this);
13387 }
13388
13389 super.OnPlacementComplete(player, position, orientation);
13390 }
13391
13392
13393
13394
13395
13397 {
13399 {
13400 return true;
13401 }
13402 else
13403 {
13404 return false;
13405 }
13406 }
13407
13408
13410 {
13412 {
13414 }
13415 }
13416
13417
13419 {
13421 }
13422
13424 {
13426 }
13427
13428 override void InsertAgent(
int agent,
float count = 1)
13429 {
13430 if (count < 1)
13431 return;
13432
13434 }
13435
13438 {
13440 }
13441
13442
13444 {
13446 }
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13490 {
13492 return false;
13493 return true;
13494 }
13495
13497 {
13498
13500 }
13501
13502
13505 {
13506 super.CheckForRoofLimited(timeTresholdMS);
13507
13509 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13510 {
13511 m_PreviousRoofTestTime = time;
13512 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13513 }
13514 }
13515
13516
13518 {
13520 {
13521 return 0;
13522 }
13523
13524 if (GetInventory().GetAttachmentSlotsCount() != 0)
13525 {
13526 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13527 if (filter)
13528 return filter.GetProtectionLevel(type, false, system);
13529 else
13530 return 0;
13531 }
13532
13533 string subclassPath, entryName;
13534
13535 switch (type)
13536 {
13538 entryName = "biological";
13539 break;
13541 entryName = "chemical";
13542 break;
13543 default:
13544 entryName = "biological";
13545 break;
13546 }
13547
13548 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13549
13551 }
13552
13553
13554
13557 {
13558 if (!IsMagazine())
13560
13562 }
13563
13564
13565
13566
13567
13572 {
13573 return true;
13574 }
13575
13577 {
13579 }
13580
13581
13582
13583
13584
13586 {
13587 if (parent)
13588 {
13589 if (parent.IsInherited(DayZInfected))
13590 return true;
13591
13592 if (!parent.IsRuined())
13593 return true;
13594 }
13595
13596 return true;
13597 }
13598
13600 {
13601 if (!super.CanPutAsAttachment(parent))
13602 {
13603 return false;
13604 }
13605
13606 if (!IsRuined() && !parent.IsRuined())
13607 {
13608 return true;
13609 }
13610
13611 return false;
13612 }
13613
13615 {
13616
13617
13618
13619
13620 return super.CanReceiveItemIntoCargo(item);
13621 }
13622
13624 {
13625
13626
13627
13628
13629 GameInventory attachmentInv = attachment.GetInventory();
13631 {
13632 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13633 return false;
13634 }
13635
13636 InventoryLocation loc = new InventoryLocation();
13637 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13638 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13639 return false;
13640
13641 return super.CanReceiveAttachment(attachment, slotId);
13642 }
13643
13645 {
13646 if (!super.CanReleaseAttachment(attachment))
13647 return false;
13648
13649 return GetInventory().AreChildrenAccessible();
13650 }
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13673 {
13674 int id = muzzle_owner.GetMuzzleID();
13675 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13676
13677 if (WPOF_array)
13678 {
13679 for (int i = 0; i < WPOF_array.Count(); i++)
13680 {
13681 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13682
13683 if (WPOF)
13684 {
13685 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13686 }
13687 }
13688 }
13689 }
13690
13691
13693 {
13694 int id = muzzle_owner.GetMuzzleID();
13696
13697 if (WPOBE_array)
13698 {
13699 for (int i = 0; i < WPOBE_array.Count(); i++)
13700 {
13701 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13702
13703 if (WPOBE)
13704 {
13705 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13706 }
13707 }
13708 }
13709 }
13710
13711
13713 {
13714 int id = muzzle_owner.GetMuzzleID();
13715 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13716
13717 if (WPOOH_array)
13718 {
13719 for (int i = 0; i < WPOOH_array.Count(); i++)
13720 {
13721 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13722
13723 if (WPOOH)
13724 {
13725 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13726 }
13727 }
13728 }
13729 }
13730
13731
13733 {
13734 int id = muzzle_owner.GetMuzzleID();
13735 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13736
13737 if (WPOOH_array)
13738 {
13739 for (int i = 0; i < WPOOH_array.Count(); i++)
13740 {
13741 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13742
13743 if (WPOOH)
13744 {
13745 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13746 }
13747 }
13748 }
13749 }
13750
13751
13753 {
13754 int id = muzzle_owner.GetMuzzleID();
13755 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13756
13757 if (WPOOH_array)
13758 {
13759 for (int i = 0; i < WPOOH_array.Count(); i++)
13760 {
13761 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13762
13763 if (WPOOH)
13764 {
13765 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13766 }
13767 }
13768 }
13769 }
13770
13771
13772
13774 {
13776 {
13777 return true;
13778 }
13779
13780 return false;
13781 }
13782
13784 {
13786 {
13787 return true;
13788 }
13789
13790 return false;
13791 }
13792
13794 {
13796 {
13797 return true;
13798 }
13799
13800 return false;
13801 }
13802
13804 {
13805 return false;
13806 }
13807
13810 {
13811 return UATimeSpent.DEFAULT_DEPLOY;
13812 }
13813
13814
13815
13816
13818 {
13820 SetSynchDirty();
13821 }
13822
13824 {
13826 }
13827
13828
13830 {
13831 return false;
13832 }
13833
13836 {
13837 string att_type = "None";
13838
13839 if (ConfigIsExisting("soundAttType"))
13840 {
13841 att_type = ConfigGetString("soundAttType");
13842 }
13843
13845 }
13846
13848 {
13850 }
13851
13852
13853
13854
13855
13859
13861 {
13864
13866 }
13867
13868
13870 {
13872 return;
13873
13875
13878
13881
13882 SoundParameters params = new SoundParameters();
13886 }
13887
13888
13890 {
13892 return;
13893
13895 SetSynchDirty();
13896
13899 }
13900
13901
13903 {
13905 return;
13906
13908 SetSynchDirty();
13909
13912 }
13913
13915 {
13917 }
13918
13920 {
13922 }
13923
13926 {
13927 if (!
GetGame().IsDedicatedServer())
13928 {
13929 if (ConfigIsExisting("attachSoundSet"))
13930 {
13931 string cfg_path = "";
13932 string soundset = "";
13933 string type_name =
GetType();
13934
13937 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13938 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13939
13940 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13941 {
13942 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13943 {
13944 if (cfg_slot_array[i] == slot_type)
13945 {
13946 soundset = cfg_soundset_array[i];
13947 break;
13948 }
13949 }
13950 }
13951
13952 if (soundset != "")
13953 {
13954 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13956 }
13957 }
13958 }
13959 }
13960
13962 {
13963
13964 }
13965
13966 void OnApply(PlayerBase player);
13967
13969 {
13970 return 1.0;
13971 };
13972
13974 {
13976 }
13977
13979 {
13981 }
13982
13984
13986 {
13987 SetDynamicPhysicsLifeTime(0.01);
13989 }
13990
13992 {
13993 array<string> zone_names = new array<string>;
13994 GetDamageZones(zone_names);
13995 for (int i = 0; i < zone_names.Count(); i++)
13996 {
13997 SetHealthMax(zone_names.Get(i),"Health");
13998 }
13999 SetHealthMax("","Health");
14000 }
14001
14004 {
14005 float global_health = GetHealth01("","Health");
14006 array<string> zones = new array<string>;
14007 GetDamageZones(zones);
14008
14009 for (int i = 0; i < zones.Count(); i++)
14010 {
14011 SetHealth01(zones.Get(i),"Health",global_health);
14012 }
14013 }
14014
14017 {
14018 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14019 }
14020
14022 {
14023 if (!hasRootAsPlayer)
14024 {
14025 if (refParentIB)
14026 {
14027
14028 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14029 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14030
14031 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14032 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14033
14036 }
14037 else
14038 {
14039
14042 }
14043 }
14044 }
14045
14047 {
14049 {
14050 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14051 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
14052 {
14053 float heatPermCoef = 1.0;
14055 while (ent)
14056 {
14057 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14058 ent = ent.GetHierarchyParent();
14059 }
14060
14061 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14062 }
14063 }
14064 }
14065
14067 {
14068
14069 EntityAI parent = GetHierarchyParent();
14070 if (!parent)
14071 {
14072 hasParent = false;
14073 hasRootAsPlayer = false;
14074 }
14075 else
14076 {
14077 hasParent = true;
14078 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14079 refParentIB =
ItemBase.Cast(parent);
14080 }
14081 }
14082
14083 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14084 {
14085
14086 }
14087
14089 {
14090
14091 return false;
14092 }
14093
14095 {
14096
14097
14098 return false;
14099 }
14100
14102 {
14103
14104 return false;
14105 }
14106
14109 {
14110 return !GetIsFrozen() &&
IsOpen();
14111 }
14112
14114 {
14115 bool hasParent = false, hasRootAsPlayer = false;
14117
14118 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14119 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14120
14121 if (wwtu || foodDecay)
14122 {
14126
14127 if (processWetness || processTemperature || processDecay)
14128 {
14130
14131 if (processWetness)
14132 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14133
14134 if (processTemperature)
14136
14137 if (processDecay)
14138 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14139 }
14140 }
14141 }
14142
14145 {
14147 }
14148
14150 {
14153
14154 return super.GetTemperatureFreezeThreshold();
14155 }
14156
14158 {
14161
14162 return super.GetTemperatureThawThreshold();
14163 }
14164
14166 {
14169
14170 return super.GetItemOverheatThreshold();
14171 }
14172
14174 {
14176 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14177
14178 return super.GetTemperatureFreezeTime();
14179 }
14180
14182 {
14184 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14185
14186 return super.GetTemperatureThawTime();
14187 }
14188
14193
14195 {
14196 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14197 }
14198
14200 {
14201 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14202 }
14203
14206 {
14208 }
14209
14211 {
14213 }
14214
14216 {
14218 }
14219
14222 {
14223 return null;
14224 }
14225
14228 {
14229 return false;
14230 }
14231
14233 {
14235 {
14238 if (!trg)
14239 {
14241 explosive = this;
14242 }
14243
14244 explosive.PairRemote(trg);
14246
14247 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14248 trg.SetPersistentPairID(persistentID);
14249 explosive.SetPersistentPairID(persistentID);
14250
14251 return true;
14252 }
14253 return false;
14254 }
14255
14258 {
14259 float ret = 1.0;
14262 ret *= GetHealth01();
14263
14264 return ret;
14265 }
14266
14267 #ifdef DEVELOPER
14268 override void SetDebugItem()
14269 {
14270 super.SetDebugItem();
14271 _itemBase = this;
14272 }
14273
14275 {
14276 string text = super.GetDebugText();
14277
14279 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14280
14281 return text;
14282 }
14283 #endif
14284
14286 {
14287 return true;
14288 }
14289
14291
14293
14295 {
14298 }
14299
14300
14308
14324}
14325
14327{
14329 if (entity)
14330 {
14331 bool is_item = entity.IsInherited(
ItemBase);
14332 if (is_item && full_quantity)
14333 {
14336 }
14337 }
14338 else
14339 {
14341 return NULL;
14342 }
14343 return entity;
14344}
14345
14347{
14348 if (item)
14349 {
14350 if (health > 0)
14351 item.SetHealth("", "", health);
14352
14353 if (item.CanHaveTemperature())
14354 {
14356 if (item.CanFreeze())
14357 item.SetFrozen(false);
14358 }
14359
14360 if (item.HasEnergyManager())
14361 {
14362 if (quantity >= 0)
14363 {
14364 item.GetCompEM().SetEnergy0To1(quantity);
14365 }
14366 else
14367 {
14369 }
14370 }
14371 else if (item.IsMagazine())
14372 {
14373 Magazine mag = Magazine.Cast(item);
14374 if (quantity >= 0)
14375 {
14376 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14377 }
14378 else
14379 {
14381 }
14382
14383 }
14384 else
14385 {
14386 if (quantity >= 0)
14387 {
14388 item.SetQuantityNormalized(quantity, false);
14389 }
14390 else
14391 {
14393 }
14394
14395 }
14396 }
14397}
14398
14399#ifdef DEVELOPER
14401#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
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 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...
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)
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)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
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()
override int GetLiquidType()
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)
void Open()
Implementations only.
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 EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
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 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 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
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
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 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 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.