9546{
9548 {
9549 return true;
9550 }
9551};
9552
9553
9554
9556{
9560
9562
9565
9566
9567
9568
9569
9578
9584
9589
9594
9615 protected bool m_IsResultOfSplit
9616
9618
9623
9624
9625
9627
9631
9632
9633
9635
9638
9639
9640
9646
9647
9655
9658
9659
9661
9662
9664
9665
9670
9671
9676
9677
9679
9680
9682 {
9687
9688 if (!
GetGame().IsDedicatedServer())
9689 {
9691 {
9693
9695 {
9697 }
9698 }
9699
9702 }
9703
9704 m_OldLocation = null;
9705
9707 {
9709 }
9710
9711 if (ConfigIsExisting("headSelectionsToHide"))
9712 {
9715 }
9716
9718 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9719 {
9721 }
9722
9724
9725 m_IsResultOfSplit = false;
9726
9728 }
9729
9731 {
9732 super.InitItemVariables();
9733
9739 m_Count = ConfigGetInt(
"count");
9740
9743
9748
9751
9756
9768
9772
9773
9776 if (ConfigIsExisting("canBeSplit"))
9777 {
9780 }
9781
9783 if (ConfigIsExisting("itemBehaviour"))
9785
9786
9789 RegisterNetSyncVariableInt("m_VarLiquidType");
9790 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9791
9792 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9793 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9794 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9795
9796 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9797 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9798 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9799 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9800
9801 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9802 RegisterNetSyncVariableBool("m_IsTakeable");
9803 RegisterNetSyncVariableBool("m_IsHologram");
9804
9807 {
9810 }
9811
9813
9815 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9817
9818 }
9819
9821 {
9823 }
9824
9826 {
9829 {
9834 }
9835 }
9836
9837 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9838 {
9840 {
9843 }
9844
9846 }
9847
9849 {
9855 }
9856
9858
9860 {
9862
9863 if (!action)
9864 {
9865 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9866 return;
9867 }
9868
9870 if (!ai)
9871 {
9873 return;
9874 }
9875
9877 if (!action_array)
9878 {
9879 action_array = new array<ActionBase_Basic>;
9881 }
9882 if (LogManager.IsActionLogEnable())
9883 {
9884 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9885 }
9886
9887 if (action_array.Find(action) != -1)
9888 {
9889 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9890 }
9891 else
9892 {
9893 action_array.Insert(action);
9894 }
9895 }
9896
9898 {
9900 ActionBase action = player.GetActionManager().GetAction(actionName);
9903
9904 if (action_array)
9905 {
9906 action_array.RemoveItem(action);
9907 }
9908 }
9909
9910
9911
9913 {
9914 ActionOverrideData overrideData = new ActionOverrideData();
9918
9920 if (!actionMap)
9921 {
9924 }
9925
9926 actionMap.Insert(this.
Type(), overrideData);
9927
9928 }
9929
9931
9933
9934
9936 {
9939
9942
9943 string config_to_search = "CfgVehicles";
9944 string muzzle_owner_config;
9945
9947 {
9948 if (IsInherited(Weapon))
9949 config_to_search = "CfgWeapons";
9950
9951 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9952
9953 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9954
9956
9957 if (config_OnFire_subclass_count > 0)
9958 {
9959 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9960
9961 for (int i = 0; i < config_OnFire_subclass_count; i++)
9962 {
9963 string particle_class = "";
9965 string config_OnFire_entry = config_OnFire_class + particle_class;
9966 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9967 WPOF_array.Insert(WPOF);
9968 }
9969
9970
9972 }
9973 }
9974
9976 {
9977 config_to_search = "CfgWeapons";
9978 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9979
9980 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9981
9983
9984 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9985 {
9986 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9987
9988 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9989 {
9990 string particle_class2 = "";
9992 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9993 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9994 WPOBE_array.Insert(WPOBE);
9995 }
9996
9997
9999 }
10000 }
10001 }
10002
10003
10005 {
10008
10010 {
10011 string config_to_search = "CfgVehicles";
10012
10013 if (IsInherited(Weapon))
10014 config_to_search = "CfgWeapons";
10015
10016 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10017 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10018
10019 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10020 {
10021
10023
10025 {
10027 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10029 return;
10030 }
10031
10034
10035
10036
10038 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10039
10040 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10041 {
10042 string particle_class = "";
10044 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10046
10047 if (entry_type == CT_CLASS)
10048 {
10049 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10050 WPOOH_array.Insert(WPOF);
10051 }
10052 }
10053
10054
10056 }
10057 }
10058 }
10059
10061 {
10063 }
10064
10066 {
10068 {
10070
10073
10076
10077 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10078 }
10079 }
10080
10082 {
10084 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10085
10087 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10088
10090 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10091
10093 {
10095 }
10096 }
10097
10099 {
10101 }
10102
10104 {
10107 else
10109
10111 {
10114 }
10115 else
10116 {
10119
10122 }
10123
10125 }
10126
10128 {
10130 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10131 }
10132
10134 {
10136 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10138 }
10139
10141 {
10143 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10144 }
10145
10147 {
10150
10151 OverheatingParticle OP = new OverheatingParticle();
10156
10158 }
10159
10161 {
10164
10165 return -1;
10166 }
10167
10169 {
10171 {
10174
10175 for (int i = count; i > 0; --i)
10176 {
10177 int id = i - 1;
10180
10183
10184 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10185 {
10186 if (p)
10187 {
10190 }
10191 }
10192 }
10193 }
10194 }
10195
10197 {
10199 {
10201 {
10202 int id = i - 1;
10204
10205 if (OP)
10206 {
10208
10209 if (p)
10210 {
10212 }
10213
10214 delete OP;
10215 }
10216 }
10217
10220 }
10221 }
10222
10225 {
10226 return 0.0;
10227 }
10228
10229
10231 {
10232 return 250;
10233 }
10234
10236 {
10237 return 0;
10238 }
10239
10242 {
10244 return true;
10245
10246 return false;
10247 }
10248
10251 {
10254
10256 {
10258 }
10259 else
10260 {
10261
10263 }
10264
10266 }
10267
10274 {
10275 return -1;
10276 }
10277
10278
10279
10280
10282 {
10284 {
10286 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10287
10288 if (r_index >= 0)
10289 {
10290 InventoryLocation r_il = new InventoryLocation;
10291 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10292
10293 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10296 {
10297 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10298 }
10300 {
10301 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10302 }
10303
10304 }
10305
10306 player.GetHumanInventory().ClearUserReservedLocation(this);
10307 }
10308
10311 }
10312
10313
10314
10315
10317 {
10318 return ItemBase.m_DebugActionsMask;
10319 }
10320
10322 {
10323 return ItemBase.m_DebugActionsMask & mask;
10324 }
10325
10327 {
10328 ItemBase.m_DebugActionsMask = mask;
10329 }
10330
10332 {
10333 ItemBase.m_DebugActionsMask |= mask;
10334 }
10335
10337 {
10338 ItemBase.m_DebugActionsMask &= ~mask;
10339 }
10340
10342 {
10344 {
10346 }
10347 else
10348 {
10350 }
10351 }
10352
10353
10355 {
10356 if (GetEconomyProfile())
10357 {
10358 float q_max = GetEconomyProfile().GetQuantityMax();
10359 if (q_max > 0)
10360 {
10361 float q_min = GetEconomyProfile().GetQuantityMin();
10362 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10363
10365 {
10366 ComponentEnergyManager comp = GetCompEM();
10368 {
10370 }
10371 }
10373 {
10375
10376 }
10377
10378 }
10379 }
10380 }
10381
10384 {
10385 EntityAI parent = GetHierarchyParent();
10386
10387 if (parent)
10388 {
10389 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10390 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10391 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10392 }
10393 }
10394
10397 {
10398 EntityAI parent = GetHierarchyParent();
10399
10400 if (parent)
10401 {
10402 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10403 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10404 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10405 }
10406 }
10407
10409 {
10410
10411
10412
10413
10415
10417 {
10418 if (ScriptInputUserData.CanStoreInputUserData())
10419 {
10420 ScriptInputUserData ctx = new ScriptInputUserData;
10426 ctx.
Write(use_stack_max);
10429
10431 {
10432 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10433 }
10434 }
10435 }
10436 else if (!
GetGame().IsMultiplayer())
10437 {
10439 }
10440 }
10441
10443 {
10445 }
10446
10448 {
10450 }
10451
10453 {
10455 }
10456
10458 {
10459
10460 return false;
10461 }
10462
10464 {
10465 return false;
10466 }
10467
10471 {
10472 return false;
10473 }
10474
10476 {
10477 return "";
10478 }
10479
10481
10483 {
10484 return false;
10485 }
10486
10488 {
10489 return true;
10490 }
10491
10492
10493
10495 {
10496 return true;
10497 }
10498
10500 {
10501 return true;
10502 }
10503
10505 {
10506 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10508 }
10509
10511 {
10513 }
10514
10516 {
10518 if (!is_being_placed)
10520 SetSynchDirty();
10521 }
10522
10523
10525
10527 {
10529 }
10530
10532 {
10534 }
10535
10537 {
10538 return 1;
10539 }
10540
10542 {
10543 return false;
10544 }
10545
10547 {
10549 SetSynchDirty();
10550 }
10551
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
10587 {
10588 super.OnMovedInsideCargo(container);
10589
10590 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10591 }
10592
10593 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10594 {
10595 super.EEItemLocationChanged(oldLoc,newLoc);
10596
10597 PlayerBase new_player = null;
10598 PlayerBase old_player = null;
10599
10600 if (newLoc.GetParent())
10601 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10602
10603 if (oldLoc.GetParent())
10604 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10605
10607 {
10608 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10609
10610 if (r_index >= 0)
10611 {
10612 InventoryLocation r_il = new InventoryLocation;
10613 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10614
10615 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10618 {
10619 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10620 }
10622 {
10623 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10624 }
10625
10626 }
10627 }
10628
10630 {
10631 if (new_player)
10632 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10633
10634 if (new_player == old_player)
10635 {
10636
10637 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10638 {
10640 {
10641 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10642 {
10643 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10644 }
10645 }
10646 else
10647 {
10648 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10649 }
10650 }
10651
10652 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10653 {
10654 int type = oldLoc.GetType();
10656 {
10657 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10658 }
10660 {
10661 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10662 }
10663 }
10664 if (!m_OldLocation)
10665 {
10666 m_OldLocation = new InventoryLocation;
10667 }
10668 m_OldLocation.Copy(oldLoc);
10669 }
10670 else
10671 {
10672 if (m_OldLocation)
10673 {
10674 m_OldLocation.Reset();
10675 }
10676 }
10677
10679 }
10680 else
10681 {
10682 if (new_player)
10683 {
10684 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10685 if (res_index >= 0)
10686 {
10687 InventoryLocation il = new InventoryLocation;
10688 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10690 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10693 {
10694 il.
GetParent().GetOnReleaseLock().Invoke(it);
10695 }
10697 {
10699 }
10700
10701 }
10702 }
10704 {
10705
10707 }
10708
10709 if (m_OldLocation)
10710 {
10711 m_OldLocation.Reset();
10712 }
10713 }
10714 }
10715
10716 override void EOnContact(IEntity other, Contact extra)
10717 {
10719 {
10720 int liquidType = -1;
10722 if (impactSpeed > 0.0)
10723 {
10725 #ifndef SERVER
10727 #else
10729 SetSynchDirty();
10730 #endif
10732 }
10733 }
10734
10735 #ifdef SERVER
10736 if (GetCompEM() && GetCompEM().IsPlugged())
10737 {
10738 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10739 GetCompEM().UnplugThis();
10740 }
10741 #endif
10742 }
10743
10745
10747 {
10749 }
10750
10752 {
10753
10754 }
10755
10757 {
10758 super.OnItemLocationChanged(old_owner, new_owner);
10759
10760 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10761 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10762
10763 if (!relatedPlayer && playerNew)
10764 relatedPlayer = playerNew;
10765
10766 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10767 {
10769 if (actionMgr)
10770 {
10771 ActionBase currentAction = actionMgr.GetRunningAction();
10772 if (currentAction)
10774 }
10775 }
10776
10777 Man ownerPlayerOld = null;
10778 Man ownerPlayerNew = null;
10779
10780 if (old_owner)
10781 {
10782 if (old_owner.
IsMan())
10783 {
10784 ownerPlayerOld = Man.Cast(old_owner);
10785 }
10786 else
10787 {
10788 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10789 }
10790 }
10791 else
10792 {
10794 {
10796
10797 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10798 {
10799 GetCompEM().UnplugThis();
10800 }
10801 }
10802 }
10803
10804 if (new_owner)
10805 {
10806 if (new_owner.
IsMan())
10807 {
10808 ownerPlayerNew = Man.Cast(new_owner);
10809 }
10810 else
10811 {
10812 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10813 }
10814 }
10815
10816 if (ownerPlayerOld != ownerPlayerNew)
10817 {
10818 if (ownerPlayerOld)
10819 {
10820 array<EntityAI> subItemsExit = new array<EntityAI>;
10822 for (int i = 0; i < subItemsExit.Count(); i++)
10823 {
10826 }
10827 }
10828
10829 if (ownerPlayerNew)
10830 {
10831 array<EntityAI> subItemsEnter = new array<EntityAI>;
10833 for (int j = 0; j < subItemsEnter.Count(); j++)
10834 {
10837 }
10838 }
10839 }
10840 else if (ownerPlayerNew != null)
10841 {
10842 PlayerBase nplayer;
10843 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10844 {
10845 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10847 for (int k = 0; k < subItemsUpdate.Count(); k++)
10848 {
10850 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10851 }
10852 }
10853 }
10854
10855 if (old_owner)
10856 old_owner.OnChildItemRemoved(this);
10857 if (new_owner)
10858 new_owner.OnChildItemReceived(this);
10859 }
10860
10861
10863 {
10864 super.EEDelete(parent);
10865 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10866 if (player)
10867 {
10869
10870 if (player.IsAlive())
10871 {
10872 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10873 if (r_index >= 0)
10874 {
10875 InventoryLocation r_il = new InventoryLocation;
10876 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10877
10878 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10881 {
10882 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10883 }
10885 {
10886 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10887 }
10888
10889 }
10890
10891 player.RemoveQuickBarEntityShortcut(this);
10892 }
10893 }
10894 }
10895
10897 {
10898 super.EEKilled(killer);
10899
10902 {
10903 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10904 {
10905 if (IsMagazine())
10906 {
10907 if (Magazine.Cast(this).GetAmmoCount() > 0)
10908 {
10910 }
10911 }
10912 else
10913 {
10915 }
10916 }
10917 }
10918 }
10919
10921 {
10922 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10923
10924 super.OnWasAttached(parent, slot_id);
10925
10928
10930 }
10931
10933 {
10934 super.OnWasDetached(parent, slot_id);
10935
10938 }
10939
10941 {
10942 int idx;
10945
10946 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10947 if (inventory_slots.Count() < 1)
10948 {
10949 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10950 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10951 }
10952 else
10953 {
10954 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10955 }
10956
10957 idx = inventory_slots.Find(slot);
10958 if (idx < 0)
10959 return "";
10960
10961 return attach_types.Get(idx);
10962 }
10963
10965 {
10966 int idx = -1;
10967 string slot;
10968
10971
10972 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10973 if (inventory_slots.Count() < 1)
10974 {
10975 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10976 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10977 }
10978 else
10979 {
10980 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10981 if (detach_types.Count() < 1)
10982 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10983 }
10984
10985 for (int i = 0; i < inventory_slots.Count(); i++)
10986 {
10987 slot = inventory_slots.Get(i);
10988 }
10989
10990 if (slot != "")
10991 {
10992 if (detach_types.Count() == 1)
10993 idx = 0;
10994 else
10995 idx = inventory_slots.Find(slot);
10996 }
10997 if (idx < 0)
10998 return "";
10999
11000 return detach_types.Get(idx);
11001 }
11002
11004 {
11005
11007
11008
11009 float min_time = 1;
11010 float max_time = 3;
11011 float delay = Math.RandomFloat(min_time, max_time);
11012
11013 explode_timer.Run(delay, this, "DoAmmoExplosion");
11014 }
11015
11017 {
11018 Magazine magazine = Magazine.Cast(this);
11019 int pop_sounds_count = 6;
11020 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11021
11022
11023 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11024 string sound_name = pop_sounds[ sound_idx ];
11026
11027
11028 magazine.ServerAddAmmoCount(-1);
11029
11030
11031 float min_temp_to_explode = 100;
11032
11033 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
11034 {
11036 }
11037 }
11038
11039
11040 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11041 {
11042 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11043
11044 const int CHANCE_DAMAGE_CARGO = 4;
11045 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11046 const int CHANCE_DAMAGE_NOTHING = 2;
11047
11049 {
11050 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11051 int chances;
11052 int rnd;
11053
11054 if (GetInventory().GetCargo())
11055 {
11056 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11057 rnd = Math.RandomInt(0,chances);
11058
11059 if (rnd < CHANCE_DAMAGE_CARGO)
11060 {
11062 }
11063 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11064 {
11066 }
11067 }
11068 else
11069 {
11070 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11071 rnd = Math.RandomInt(0,chances);
11072
11073 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11074 {
11076 }
11077 }
11078 }
11079 }
11080
11082 {
11083 if (GetInventory().GetCargo())
11084 {
11085 int item_count = GetInventory().GetCargo().GetItemCount();
11086 if (item_count > 0)
11087 {
11088 int random_pick = Math.RandomInt(0, item_count);
11090 if (!item.IsExplosive())
11091 {
11092 item.AddHealth("","",damage);
11093 return true;
11094 }
11095 }
11096 }
11097 return false;
11098 }
11099
11101 {
11102 int attachment_count = GetInventory().AttachmentCount();
11103 if (attachment_count > 0)
11104 {
11105 int random_pick = Math.RandomInt(0, attachment_count);
11106 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11107 if (!attachment.IsExplosive())
11108 {
11109 attachment.AddHealth("","",damage);
11110 return true;
11111 }
11112 }
11113 return false;
11114 }
11115
11117 {
11119 }
11120
11122 {
11124 return GetInventory().CanRemoveEntity();
11125
11126 return false;
11127 }
11128
11130 {
11132 return;
11133
11135 {
11136 if (ScriptInputUserData.CanStoreInputUserData())
11137 {
11138 ScriptInputUserData ctx = new ScriptInputUserData;
11143 ctx.
Write(destination_entity);
11145 ctx.
Write(slot_id);
11147 }
11148 }
11149 else if (!
GetGame().IsMultiplayer())
11150 {
11152 }
11153 }
11154
11156 {
11158 return;
11159
11160 float split_quantity_new;
11164 InventoryLocation loc = new InventoryLocation;
11165
11166 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11167 {
11169 split_quantity_new = stack_max;
11170 else
11172
11173 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11174 if (new_item)
11175 {
11176 new_item.SetResultOfSplit(true);
11177 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11179 new_item.SetQuantity(split_quantity_new);
11180 }
11181 }
11182 else if (destination_entity && slot_id == -1)
11183 {
11184 if (quantity > stack_max)
11185 split_quantity_new = stack_max;
11186 else
11187 split_quantity_new = quantity;
11188
11190 {
11193 }
11194
11195 if (new_item)
11196 {
11197 new_item.SetResultOfSplit(true);
11198 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11200 new_item.SetQuantity(split_quantity_new);
11201 }
11202 }
11203 else
11204 {
11205 if (stack_max != 0)
11206 {
11208 {
11210 }
11211
11212 if (split_quantity_new == 0)
11213 {
11214 if (!
GetGame().IsMultiplayer())
11215 player.PhysicalPredictiveDropItem(this);
11216 else
11217 player.ServerDropEntity(this);
11218 return;
11219 }
11220
11222
11223 if (new_item)
11224 {
11225 new_item.SetResultOfSplit(true);
11226 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11228 new_item.SetQuantity(stack_max);
11229 new_item.PlaceOnSurface();
11230 }
11231 }
11232 }
11233 }
11234
11236 {
11238 return;
11239
11240 float split_quantity_new;
11244 InventoryLocation loc = new InventoryLocation;
11245
11246 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11247 {
11249 split_quantity_new = stack_max;
11250 else
11252
11253 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11254 if (new_item)
11255 {
11256 new_item.SetResultOfSplit(true);
11257 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11259 new_item.SetQuantity(split_quantity_new);
11260 }
11261 }
11262 else if (destination_entity && slot_id == -1)
11263 {
11264 if (quantity > stack_max)
11265 split_quantity_new = stack_max;
11266 else
11267 split_quantity_new = quantity;
11268
11270 {
11273 }
11274
11275 if (new_item)
11276 {
11277 new_item.SetResultOfSplit(true);
11278 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11280 new_item.SetQuantity(split_quantity_new);
11281 }
11282 }
11283 else
11284 {
11285 if (stack_max != 0)
11286 {
11288 {
11290 }
11291
11293
11294 if (new_item)
11295 {
11296 new_item.SetResultOfSplit(true);
11297 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11299 new_item.SetQuantity(stack_max);
11300 new_item.PlaceOnSurface();
11301 }
11302 }
11303 }
11304 }
11305
11307 {
11309 return;
11310
11312 {
11313 if (ScriptInputUserData.CanStoreInputUserData())
11314 {
11315 ScriptInputUserData ctx = new ScriptInputUserData;
11320 dst.WriteToContext(ctx);
11322 }
11323 }
11324 else if (!
GetGame().IsMultiplayer())
11325 {
11327 }
11328 }
11329
11331 {
11333 return;
11334
11336 {
11337 if (ScriptInputUserData.CanStoreInputUserData())
11338 {
11339 ScriptInputUserData ctx = new ScriptInputUserData;
11344 ctx.
Write(destination_entity);
11350 }
11351 }
11352 else if (!
GetGame().IsMultiplayer())
11353 {
11355 }
11356 }
11357
11359 {
11361 }
11362
11364 {
11366 return this;
11367
11369 float split_quantity_new;
11371 if (dst.IsValid())
11372 {
11373 int slot_id = dst.GetSlot();
11375
11376 if (quantity > stack_max)
11377 split_quantity_new = stack_max;
11378 else
11379 split_quantity_new = quantity;
11380
11382
11383 if (new_item)
11384 {
11385 new_item.SetResultOfSplit(true);
11386 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11389 }
11390
11391 return new_item;
11392 }
11393
11394 return null;
11395 }
11396
11398 {
11400 return;
11401
11403 float split_quantity_new;
11405 if (destination_entity)
11406 {
11408 if (quantity > stackable)
11409 split_quantity_new = stackable;
11410 else
11411 split_quantity_new = quantity;
11412
11413 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11414 if (new_item)
11415 {
11416 new_item.SetResultOfSplit(true);
11417 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11419 new_item.SetQuantity(split_quantity_new);
11420 }
11421 }
11422 }
11423
11425 {
11427 return;
11428
11430 {
11431 if (ScriptInputUserData.CanStoreInputUserData())
11432 {
11433 ScriptInputUserData ctx = new ScriptInputUserData;
11438 ItemBase destination_entity =
this;
11439 ctx.
Write(destination_entity);
11443 }
11444 }
11445 else if (!
GetGame().IsMultiplayer())
11446 {
11448 }
11449 }
11450
11452 {
11454 return;
11455
11457 float split_quantity_new;
11459 if (player)
11460 {
11462 if (quantity > stackable)
11463 split_quantity_new = stackable;
11464 else
11465 split_quantity_new = quantity;
11466
11467 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11468 new_item =
ItemBase.Cast(in_hands);
11469 if (new_item)
11470 {
11471 new_item.SetResultOfSplit(true);
11472 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11474 new_item.SetQuantity(split_quantity_new);
11475 }
11476 }
11477 }
11478
11480 {
11482 return;
11483
11485 float split_quantity_new = Math.Floor(quantity * 0.5);
11486
11488
11489 if (new_item)
11490 {
11491 if (new_item.GetQuantityMax() < split_quantity_new)
11492 {
11493 split_quantity_new = new_item.GetQuantityMax();
11494 }
11495
11496 new_item.SetResultOfSplit(true);
11497 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11498
11500 {
11503 }
11504 else
11505 {
11508 }
11509 }
11510 }
11511
11513 {
11515 return;
11516
11518 float split_quantity_new = Math.Floor(quantity / 2);
11519
11520 InventoryLocation invloc = new InventoryLocation;
11522
11524 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11525
11526 if (new_item)
11527 {
11528 if (new_item.GetQuantityMax() < split_quantity_new)
11529 {
11530 split_quantity_new = new_item.GetQuantityMax();
11531 }
11533 {
11536 }
11537 else
11538 {
11541 }
11542 }
11543 }
11544
11547 {
11548 SetWeightDirty();
11550
11551 if (parent)
11552 parent.OnAttachmentQuantityChangedEx(this, delta);
11553
11555 {
11557 {
11559 }
11561 {
11562 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11564 }
11565 }
11566
11567 }
11568
11571 {
11572
11573 }
11574
11577 {
11579 }
11580
11582 {
11583 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11584
11586 {
11587 if (newLevel == GameConstants.STATE_RUINED)
11588 {
11590 EntityAI parent = GetHierarchyParent();
11591 if (parent && parent.IsFireplace())
11592 {
11593 CargoBase cargo = GetInventory().GetCargo();
11594 if (cargo)
11595 {
11597 {
11599 }
11600 }
11601 }
11602 }
11603
11605 {
11606
11608 return;
11609 }
11610
11611 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11612 {
11614 }
11615 }
11616 }
11617
11618
11620 {
11621 super.OnRightClick();
11622
11624 {
11626 {
11627 if (ScriptInputUserData.CanStoreInputUserData())
11628 {
11629 vector m4[4];
11631
11632 EntityAI root = GetHierarchyRoot();
11633
11634 InventoryLocation dst = new InventoryLocation;
11636 {
11637 if (root)
11638 {
11639 root.GetTransform(m4);
11641 }
11642 else
11643 GetInventory().GetCurrentInventoryLocation(dst);
11644 }
11645 else
11646 {
11648
11649
11650 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11651 {
11652 if (root)
11653 {
11654 root.GetTransform(m4);
11656 }
11657 else
11658 GetInventory().GetCurrentInventoryLocation(dst);
11659 }
11660 else
11661 {
11662 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11663 }
11664 }
11665
11666 ScriptInputUserData ctx = new ScriptInputUserData;
11674 }
11675 }
11676 else if (!
GetGame().IsMultiplayer())
11677 {
11679 }
11680 }
11681 }
11682
11683 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11684 {
11685
11686 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11687 return false;
11688
11689 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11690 return false;
11691
11692
11694 return false;
11695
11696
11697 Magazine mag = Magazine.Cast(this);
11698 if (mag)
11699 {
11700 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11701 return false;
11702
11703 if (stack_max_limit)
11704 {
11705 Magazine other_mag = Magazine.Cast(other_item);
11706 if (other_item)
11707 {
11708 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11709 return false;
11710 }
11711
11712 }
11713 }
11714 else
11715 {
11716
11718 return false;
11719
11721 return false;
11722 }
11723
11724 PlayerBase player = null;
11725 if (CastTo(player, GetHierarchyRootPlayer()))
11726 {
11727 if (player.GetInventory().HasAttachment(this))
11728 return false;
11729
11730 if (player.IsItemsToDelete())
11731 return false;
11732 }
11733
11734 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11735 return false;
11736
11737 int slotID;
11739 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11740 return false;
11741
11742 return true;
11743 }
11744
11746 {
11748 }
11749
11751 {
11752 return m_IsResultOfSplit;
11753 }
11754
11756 {
11757 m_IsResultOfSplit = value;
11758 }
11759
11761 {
11763 }
11764
11766 {
11767 float other_item_quantity = other_item.GetQuantity();
11768 float this_free_space;
11769
11771
11773
11774 if (other_item_quantity > this_free_space)
11775 {
11776 return this_free_space;
11777 }
11778 else
11779 {
11780 return other_item_quantity;
11781 }
11782 }
11783
11785 {
11787 }
11788
11790 {
11792 return;
11793
11794 if (!IsMagazine() && other_item)
11795 {
11797 if (quantity_used != 0)
11798 {
11799 float hp1 = GetHealth01("","");
11800 float hp2 = other_item.GetHealth01("","");
11801 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11802 hpResult = hpResult / (
GetQuantity() + quantity_used);
11803
11804 hpResult *= GetMaxHealth();
11805 Math.Round(hpResult);
11806 SetHealth("", "Health", hpResult);
11807
11809 other_item.AddQuantity(-quantity_used);
11810 }
11811 }
11813 }
11814
11816 {
11817 #ifdef SERVER
11818 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11819 GetHierarchyParent().IncreaseLifetimeUp();
11820 #endif
11821 };
11822
11824 {
11825 PlayerBase p = PlayerBase.Cast(player);
11826
11827 array<int> recipesIds = p.m_Recipes;
11828 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11829 if (moduleRecipesManager)
11830 {
11831 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11832 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11833 }
11834
11835 for (int i = 0;i < recipesIds.Count(); i++)
11836 {
11837 int key = recipesIds.Get(i);
11838 string recipeName = moduleRecipesManager.GetRecipeName(key);
11840 }
11841 }
11842
11843
11844 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11845 {
11846 super.GetDebugActions(outputList);
11847
11848
11853
11854
11858
11862
11863
11866
11867
11869 {
11872 }
11873
11875
11878
11882 }
11883
11884
11885
11886
11888 {
11889 super.OnAction(action_id, player, ctx);
11890 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11891 {
11892 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11893 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11894 PlayerBase p = PlayerBase.Cast(player);
11895 if (
EActions.RECIPES_RANGE_START < 1000)
11896 {
11897 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11898 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11899 }
11900 }
11901 #ifndef SERVER
11902 else if (action_id ==
EActions.WATCH_PLAYER)
11903 {
11904 PluginDeveloper.SetDeveloperItemClientEx(player);
11905 }
11906 #endif
11908 {
11909 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11910 {
11911 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11912 OnDebugButtonPressServer(id + 1);
11913 }
11914
11915 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11916 {
11917 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11919 }
11920
11921 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11922 {
11923 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11925 }
11926
11927 else if (action_id ==
EActions.ADD_QUANTITY)
11928 {
11929 if (IsMagazine())
11930 {
11931 Magazine mag = Magazine.Cast(this);
11932 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11933 }
11934 else
11935 {
11937 }
11938
11939 if (m_EM)
11940 {
11941 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11942 }
11943
11944 }
11945
11946 else if (action_id ==
EActions.REMOVE_QUANTITY)
11947 {
11948 if (IsMagazine())
11949 {
11950 Magazine mag2 = Magazine.Cast(this);
11951 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11952 }
11953 else
11954 {
11956 }
11957 if (m_EM)
11958 {
11959 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11960 }
11961
11962 }
11963
11964 else if (action_id ==
EActions.SET_QUANTITY_0)
11965 {
11967
11968 if (m_EM)
11969 {
11970 m_EM.SetEnergy(0);
11971 }
11972 }
11973
11974 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11975 {
11977
11978 if (m_EM)
11979 {
11980 m_EM.SetEnergy(m_EM.GetEnergyMax());
11981 }
11982 }
11983
11984 else if (action_id ==
EActions.ADD_HEALTH)
11985 {
11986 AddHealth("","",GetMaxHealth("","Health")/5);
11987 }
11988 else if (action_id ==
EActions.REMOVE_HEALTH)
11989 {
11990 AddHealth("","",-GetMaxHealth("","Health")/5);
11991 }
11992 else if (action_id ==
EActions.DESTROY_HEALTH)
11993 {
11994 SetHealth01("","",0);
11995 }
11996 else if (action_id ==
EActions.WATCH_ITEM)
11997 {
11999 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12000 #ifdef DEVELOPER
12001 SetDebugDeveloper_item(this);
12002 #endif
12003 }
12004
12005 else if (action_id ==
EActions.ADD_TEMPERATURE)
12006 {
12007 AddTemperature(20);
12008
12009 }
12010
12011 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12012 {
12013 AddTemperature(-20);
12014
12015 }
12016
12017 else if (action_id ==
EActions.FLIP_FROZEN)
12018 {
12019 SetFrozen(!GetIsFrozen());
12020
12021 }
12022
12023 else if (action_id ==
EActions.ADD_WETNESS)
12024 {
12026
12027 }
12028
12029 else if (action_id ==
EActions.REMOVE_WETNESS)
12030 {
12032
12033 }
12034
12035 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12036 {
12039
12040
12041 }
12042
12043 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12044 {
12047 }
12048
12049 else if (action_id ==
EActions.MAKE_SPECIAL)
12050 {
12051 auto debugParams = DebugSpawnParams.WithPlayer(player);
12052 OnDebugSpawnEx(debugParams);
12053 }
12054
12055 else if (action_id ==
EActions.DELETE)
12056 {
12057 Delete();
12058 }
12059
12060 }
12061
12062
12063 return false;
12064 }
12065
12066
12067
12068
12072
12075
12076
12077
12079 {
12080 return false;
12081 }
12082
12083
12085 {
12086 return true;
12087 }
12088
12089
12091 {
12092 return true;
12093 }
12094
12095
12096
12098 {
12099 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12101 }
12102
12105 {
12106 return null;
12107 }
12108
12110 {
12111 return false;
12112 }
12113
12115 {
12116 return false;
12117 }
12118
12122
12123
12125 {
12126 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12127 return module_repairing.CanRepair(this, item_repair_kit);
12128 }
12129
12130
12131 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12132 {
12133 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12134 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12135 }
12136
12137
12139 {
12140
12141
12142
12143
12144
12145
12146
12147
12148 return 1;
12149 }
12150
12151
12152
12154 {
12156 }
12157
12158
12159
12161 {
12163 }
12164
12165
12174 {
12175 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12176
12177 if (player)
12178 {
12179 player.MessageStatus(text);
12180 }
12181 }
12182
12183
12192 {
12193 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12194
12195 if (player)
12196 {
12197 player.MessageAction(text);
12198 }
12199 }
12200
12201
12210 {
12211 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12212
12213 if (player)
12214 {
12215 player.MessageFriendly(text);
12216 }
12217 }
12218
12219
12228 {
12229 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12230
12231 if (player)
12232 {
12233 player.MessageImportant(text);
12234 }
12235 }
12236
12238 {
12239 return true;
12240 }
12241
12242
12243 override bool KindOf(
string tag)
12244 {
12245 bool found = false;
12246 string item_name = this.
GetType();
12249
12250 int array_size = item_tag_array.Count();
12251 for (int i = 0; i < array_size; i++)
12252 {
12253 if (item_tag_array.Get(i) == tag)
12254 {
12255 found = true;
12256 break;
12257 }
12258 }
12259 return found;
12260 }
12261
12262
12264 {
12265
12266 super.OnRPC(sender, rpc_type,ctx);
12267
12268
12269 switch (rpc_type)
12270 {
12271 #ifndef SERVER
12272 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12273 Param2<bool, string> p = new Param2<bool, string>(false, "");
12274
12276 return;
12277
12278 bool play = p.param1;
12279 string soundSet = p.param2;
12280
12281 if (play)
12282 {
12284 {
12286 {
12288 }
12289 }
12290 else
12291 {
12293 }
12294 }
12295 else
12296 {
12298 }
12299
12300 break;
12301 #endif
12302
12303 }
12304
12306 {
12308 }
12309 }
12310
12311
12312
12313
12315 {
12316 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12317 return plugin.GetID(
name);
12318 }
12319
12321 {
12322 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12323 return plugin.GetName(id);
12324 }
12325
12328 {
12329
12330
12331 int varFlags;
12332 if (!ctx.
Read(varFlags))
12333 return;
12334
12335 if (varFlags & ItemVariableFlags.FLOAT)
12336 {
12338 }
12339 }
12340
12342 {
12343
12344 super.SerializeNumericalVars(floats_out);
12345
12346
12347
12349 {
12351 }
12352
12354 {
12356 }
12357
12359 {
12361 }
12362
12364 {
12369 }
12370
12372 {
12374 }
12375 }
12376
12378 {
12379
12380 super.DeSerializeNumericalVars(floats);
12381
12382
12383 int index = 0;
12384 int mask = Math.Round(floats.Get(index));
12385
12386 index++;
12387
12389 {
12391 {
12393 }
12394 else
12395 {
12396 float quantity = floats.Get(index);
12397 SetQuantity(quantity,
true,
false,
false,
false);
12398 }
12399 index++;
12400 }
12401
12403 {
12404 float wet = floats.Get(index);
12406 index++;
12407 }
12408
12410 {
12411 int liquidtype = Math.Round(floats.Get(index));
12413 index++;
12414 }
12415
12417 {
12419 index++;
12421 index++;
12423 index++;
12425 index++;
12426 }
12427
12429 {
12430 int cleanness = Math.Round(floats.Get(index));
12432 index++;
12433 }
12434 }
12435
12437 {
12438 super.WriteVarsToCTX(ctx);
12439
12440
12442 {
12444 }
12445
12447 {
12449 }
12450
12452 {
12454 }
12455
12457 {
12458 int r,g,b,a;
12464 }
12465
12467 {
12469 }
12470 }
12471
12473 {
12474 if (!super.ReadVarsFromCTX(ctx,version))
12475 return false;
12476
12477 int intValue;
12478 float value;
12479
12480 if (version < 140)
12481 {
12482 if (!ctx.
Read(intValue))
12483 return false;
12484
12485 m_VariablesMask = intValue;
12486 }
12487
12489 {
12490 if (!ctx.
Read(value))
12491 return false;
12492
12494 {
12496 }
12497 else
12498 {
12500 }
12501 }
12502
12503 if (version < 140)
12504 {
12506 {
12507 if (!ctx.
Read(value))
12508 return false;
12509 SetTemperatureDirect(value);
12510 }
12511 }
12512
12514 {
12515 if (!ctx.
Read(value))
12516 return false;
12518 }
12519
12521 {
12522 if (!ctx.
Read(intValue))
12523 return false;
12525 }
12526
12528 {
12529 int r,g,b,a;
12531 return false;
12533 return false;
12535 return false;
12537 return false;
12538
12540 }
12541
12543 {
12544 if (!ctx.
Read(intValue))
12545 return false;
12547 }
12548
12549 if (version >= 138 && version < 140)
12550 {
12552 {
12553 if (!ctx.
Read(intValue))
12554 return false;
12555 SetFrozen(intValue);
12556 }
12557 }
12558
12559 return true;
12560 }
12561
12562
12564 {
12567 {
12569 }
12570
12571 if (!super.OnStoreLoad(ctx, version))
12572 {
12574 return false;
12575 }
12576
12577 if (version >= 114)
12578 {
12579 bool hasQuickBarIndexSaved;
12580
12581 if (!ctx.
Read(hasQuickBarIndexSaved))
12582 {
12584 return false;
12585 }
12586
12587 if (hasQuickBarIndexSaved)
12588 {
12589 int itmQBIndex;
12590
12591
12592 if (!ctx.
Read(itmQBIndex))
12593 {
12595 return false;
12596 }
12597
12598 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12599 if (itmQBIndex != -1 && parentPlayer)
12600 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12601 }
12602 }
12603 else
12604 {
12605
12606 PlayerBase player;
12607 int itemQBIndex;
12608 if (version ==
int.
MAX)
12609 {
12610 if (!ctx.
Read(itemQBIndex))
12611 {
12613 return false;
12614 }
12615 }
12616 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12617 {
12618
12619 if (!ctx.
Read(itemQBIndex))
12620 {
12622 return false;
12623 }
12624 if (itemQBIndex != -1 && player)
12625 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12626 }
12627 }
12628
12629 if (version < 140)
12630 {
12631
12632 if (!LoadVariables(ctx, version))
12633 {
12635 return false;
12636 }
12637 }
12638
12639
12641 {
12643 return false;
12644 }
12645 if (version >= 132)
12646 {
12648 if (raib)
12649 {
12651 {
12653 return false;
12654 }
12655 }
12656 }
12657
12659 return true;
12660 }
12661
12662
12663
12665 {
12666 super.OnStoreSave(ctx);
12667
12668 PlayerBase player;
12669 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12670 {
12672
12673 int itemQBIndex = -1;
12674 itemQBIndex = player.FindQuickBarEntityIndex(this);
12675 ctx.
Write(itemQBIndex);
12676 }
12677 else
12678 {
12680 }
12681
12683
12685 if (raib)
12686 {
12688 }
12689 }
12690
12691
12693 {
12694 super.AfterStoreLoad();
12695
12697 {
12699 }
12700
12702 {
12705 }
12706 }
12707
12709 {
12710 super.EEOnAfterLoad();
12711
12713 {
12715 }
12716
12719 }
12720
12722 {
12723 return false;
12724 }
12725
12726
12727
12729 {
12731 {
12732 #ifdef PLATFORM_CONSOLE
12733
12735 {
12737 if (menu)
12738 {
12740 }
12741 }
12742 #endif
12743 }
12744
12746 {
12749 }
12750
12752 {
12753 SetWeightDirty();
12755 }
12757 {
12760 }
12761
12763 {
12766 }
12768 {
12771 }
12772
12773 super.OnVariablesSynchronized();
12774 }
12775
12776
12777
12779 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12780 {
12781 if (!IsServerCheck(allow_client))
12782 return false;
12783
12785 return false;
12786
12789
12790 if (value <= (min + 0.001))
12791 value = min;
12792
12793 if (value == min)
12794 {
12795 if (destroy_config)
12796 {
12797 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12798 if (dstr)
12799 {
12801 this.Delete();
12802 return true;
12803 }
12804 }
12805 else if (destroy_forced)
12806 {
12808 this.Delete();
12809 return true;
12810 }
12811
12813 }
12814
12817
12819 {
12821
12822 if (delta)
12824 }
12825
12827
12828 return false;
12829 }
12830
12831
12833 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12834 {
12836 }
12837
12839 {
12842 }
12843
12845 {
12848 }
12849
12852 {
12853 float value_clamped = Math.Clamp(value, 0, 1);
12855 SetQuantity(result, destroy_config, destroy_forced);
12856 }
12857
12858
12861 {
12863 }
12864
12866 {
12868 }
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12880 {
12881 int slot = -1;
12882 if (GetInventory())
12883 {
12884 InventoryLocation il = new InventoryLocation;
12885 GetInventory().GetCurrentInventoryLocation(il);
12887 }
12888
12890 }
12891
12893 {
12894 float quantity_max = 0;
12895
12897 {
12898 if (attSlotID != -1)
12899 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12900
12901 if (quantity_max <= 0)
12903 }
12904
12905 if (quantity_max <= 0)
12907
12908 return quantity_max;
12909 }
12910
12912 {
12914 }
12915
12917 {
12919 }
12920
12921
12923 {
12925 }
12926
12928 {
12930 }
12931
12933 {
12935 }
12936
12937
12939 {
12940
12941 float weightEx = GetWeightEx();
12942 float special = GetInventoryAndCargoWeight();
12943 return weightEx - special;
12944 }
12945
12946
12948 {
12950 }
12951
12953 {
12955 {
12956 #ifdef DEVELOPER
12957 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12958 {
12959 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12961 }
12962 #endif
12963
12964 return GetQuantity() * GetConfigWeightModified();
12965 }
12966 else if (HasEnergyManager())
12967 {
12968 #ifdef DEVELOPER
12969 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12970 {
12971 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12972 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12973 }
12974 #endif
12975 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12976 }
12977 else
12978 {
12979 #ifdef DEVELOPER
12980 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12981 {
12982 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12983 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12984 }
12985 #endif
12986 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12987 }
12988 }
12989
12992 {
12993 int item_count = 0;
12995
12996 if (GetInventory().GetCargo() != NULL)
12997 {
12998 item_count = GetInventory().GetCargo().GetItemCount();
12999 }
13000
13001 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13002 {
13003 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13004 if (item)
13005 item_count += item.GetNumberOfItems();
13006 }
13007 return item_count;
13008 }
13009
13012 {
13013 float weight = 0;
13014 float wetness = 1;
13015 if (include_wetness)
13018 {
13019 weight = wetness * m_ConfigWeight;
13020 }
13022 {
13023 weight = 1;
13024 }
13025 return weight;
13026 }
13027
13028
13029
13031 {
13032 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13033 {
13034 GameInventory inv = GetInventory();
13035 array<EntityAI> items = new array<EntityAI>;
13037 for (int i = 0; i < items.Count(); i++)
13038 {
13040 if (item)
13041 {
13043 }
13044 }
13045 }
13046 }
13047
13048
13049
13050
13052 {
13053 float energy = 0;
13054 if (HasEnergyManager())
13055 {
13056 energy = GetCompEM().GetEnergy();
13057 }
13058 return energy;
13059 }
13060
13061
13063 {
13064 super.OnEnergyConsumed();
13065
13067 }
13068
13070 {
13071 super.OnEnergyAdded();
13072
13074 }
13075
13076
13078 {
13079 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13080 {
13082 {
13083 float energy_0to1 = GetCompEM().GetEnergy0To1();
13085 }
13086 }
13087 }
13088
13089
13091 {
13092 return ConfigGetFloat("heatIsolation");
13093 }
13094
13096 {
13098 }
13099
13101 {
13102 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13103 if (
GetGame().ConfigIsExisting(paramPath))
13105
13106 return 0.0;
13107 }
13108
13110 {
13111 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13112 if (
GetGame().ConfigIsExisting(paramPath))
13114
13115 return 0.0;
13116 }
13117
13118 override void SetWet(
float value,
bool allow_client =
false)
13119 {
13120 if (!IsServerCheck(allow_client))
13121 return;
13122
13125
13127
13128 m_VarWet = Math.Clamp(value, min, max);
13129
13131 {
13134 }
13135 }
13136
13137 override void AddWet(
float value)
13138 {
13140 }
13141
13143 {
13145 }
13146
13148 {
13150 }
13151
13153 {
13155 }
13156
13158 {
13160 }
13161
13163 {
13165 }
13166
13167 override void OnWetChanged(
float newVal,
float oldVal)
13168 {
13171 if (newLevel != oldLevel)
13172 {
13174 }
13175 }
13176
13178 {
13179 SetWeightDirty();
13180 }
13181
13183 {
13184 return GetWetLevelInternal(
m_VarWet);
13185 }
13186
13187
13188
13190 {
13192 }
13193
13195 {
13197 }
13198
13200 {
13202 }
13203
13205 {
13207 }
13208
13209
13210
13212 {
13213 if (ConfigIsExisting("itemModelLength"))
13214 {
13215 return ConfigGetFloat("itemModelLength");
13216 }
13217 return 0;
13218 }
13219
13221 {
13222 if (ConfigIsExisting("itemAttachOffset"))
13223 {
13224 return ConfigGetFloat("itemAttachOffset");
13225 }
13226 return 0;
13227 }
13228
13229 override void SetCleanness(
int value,
bool allow_client =
false)
13230 {
13231 if (!IsServerCheck(allow_client))
13232 return;
13233
13235
13237
13240 }
13241
13243 {
13245 }
13246
13248 {
13249 return true;
13250 }
13251
13252
13253
13254
13256 {
13258 }
13259
13261 {
13263 }
13264
13265
13266
13267
13268 override void SetColor(
int r,
int g,
int b,
int a)
13269 {
13275 }
13277 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13278 {
13283 }
13284
13286 {
13288 }
13289
13292 {
13293 int r,g,b,a;
13295 r = r/255;
13296 g = g/255;
13297 b = b/255;
13298 a = a/255;
13299 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13300 }
13301
13302
13303
13304 override void SetLiquidType(
int value,
bool allow_client =
false)
13305 {
13306 if (!IsServerCheck(allow_client))
13307 return;
13308
13313 }
13314
13316 {
13317 return ConfigGetInt("varLiquidTypeInit");
13318 }
13319
13321 {
13323 }
13324
13326 {
13328 SetFrozen(false);
13329 }
13330
13333 {
13334 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13335 }
13336
13337
13340 {
13341 PlayerBase nplayer;
13342 if (PlayerBase.CastTo(nplayer, player))
13343 {
13345
13346 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13347 }
13348 }
13349
13350
13353 {
13354 PlayerBase nplayer;
13355 if (PlayerBase.CastTo(nplayer,player))
13356 {
13357
13358 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13359
13360 }
13361
13362
13363 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13364
13365
13366 if (HasEnergyManager())
13367 {
13368 GetCompEM().UpdatePlugState();
13369 }
13370 }
13371
13372
13374 {
13375 super.OnPlacementStarted(player);
13376
13378 }
13379
13380 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13381 {
13383 {
13384 m_AdminLog.OnPlacementComplete(player,
this);
13385 }
13386
13387 super.OnPlacementComplete(player, position, orientation);
13388 }
13389
13390
13391
13392
13393
13395 {
13397 {
13398 return true;
13399 }
13400 else
13401 {
13402 return false;
13403 }
13404 }
13405
13406
13408 {
13410 {
13412 }
13413 }
13414
13415
13417 {
13419 }
13420
13422 {
13424 }
13425
13426 override void InsertAgent(
int agent,
float count = 1)
13427 {
13428 if (count < 1)
13429 return;
13430
13432 }
13433
13436 {
13438 }
13439
13440
13442 {
13444 }
13445
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
13488 {
13490 return false;
13491 return true;
13492 }
13493
13495 {
13496
13498 }
13499
13500
13503 {
13504 super.CheckForRoofLimited(timeTresholdMS);
13505
13507 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13508 {
13509 m_PreviousRoofTestTime = time;
13510 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13511 }
13512 }
13513
13514
13516 {
13518 {
13519 return 0;
13520 }
13521
13522 if (GetInventory().GetAttachmentSlotsCount() != 0)
13523 {
13524 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13525 if (filter)
13526 return filter.GetProtectionLevel(type, false, system);
13527 else
13528 return 0;
13529 }
13530
13531 string subclassPath, entryName;
13532
13533 switch (type)
13534 {
13536 entryName = "biological";
13537 break;
13539 entryName = "chemical";
13540 break;
13541 default:
13542 entryName = "biological";
13543 break;
13544 }
13545
13546 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13547
13549 }
13550
13551
13552
13555 {
13556 if (!IsMagazine())
13558
13560 }
13561
13562
13563
13564
13565
13570 {
13571 return true;
13572 }
13573
13575 {
13577 }
13578
13579
13580
13581
13582
13584 {
13585 if (parent)
13586 {
13587 if (parent.IsInherited(DayZInfected))
13588 return true;
13589
13590 if (!parent.IsRuined())
13591 return true;
13592 }
13593
13594 return true;
13595 }
13596
13598 {
13599 if (!super.CanPutAsAttachment(parent))
13600 {
13601 return false;
13602 }
13603
13604 if (!IsRuined() && !parent.IsRuined())
13605 {
13606 return true;
13607 }
13608
13609 return false;
13610 }
13611
13613 {
13614
13615
13616
13617
13618 return super.CanReceiveItemIntoCargo(item);
13619 }
13620
13622 {
13623
13624
13625
13626
13627 GameInventory attachmentInv = attachment.GetInventory();
13629 {
13630 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13631 return false;
13632 }
13633
13634 InventoryLocation loc = new InventoryLocation();
13635 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13636 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13637 return false;
13638
13639 return super.CanReceiveAttachment(attachment, slotId);
13640 }
13641
13643 {
13644 if (!super.CanReleaseAttachment(attachment))
13645 return false;
13646
13647 return GetInventory().AreChildrenAccessible();
13648 }
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13671 {
13672 int id = muzzle_owner.GetMuzzleID();
13673 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13674
13675 if (WPOF_array)
13676 {
13677 for (int i = 0; i < WPOF_array.Count(); i++)
13678 {
13679 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13680
13681 if (WPOF)
13682 {
13683 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13684 }
13685 }
13686 }
13687 }
13688
13689
13691 {
13692 int id = muzzle_owner.GetMuzzleID();
13694
13695 if (WPOBE_array)
13696 {
13697 for (int i = 0; i < WPOBE_array.Count(); i++)
13698 {
13699 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13700
13701 if (WPOBE)
13702 {
13703 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13704 }
13705 }
13706 }
13707 }
13708
13709
13711 {
13712 int id = muzzle_owner.GetMuzzleID();
13713 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13714
13715 if (WPOOH_array)
13716 {
13717 for (int i = 0; i < WPOOH_array.Count(); i++)
13718 {
13719 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13720
13721 if (WPOOH)
13722 {
13723 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13724 }
13725 }
13726 }
13727 }
13728
13729
13731 {
13732 int id = muzzle_owner.GetMuzzleID();
13733 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13734
13735 if (WPOOH_array)
13736 {
13737 for (int i = 0; i < WPOOH_array.Count(); i++)
13738 {
13739 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13740
13741 if (WPOOH)
13742 {
13743 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13744 }
13745 }
13746 }
13747 }
13748
13749
13751 {
13752 int id = muzzle_owner.GetMuzzleID();
13753 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13754
13755 if (WPOOH_array)
13756 {
13757 for (int i = 0; i < WPOOH_array.Count(); i++)
13758 {
13759 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13760
13761 if (WPOOH)
13762 {
13763 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13764 }
13765 }
13766 }
13767 }
13768
13769
13770
13772 {
13774 {
13775 return true;
13776 }
13777
13778 return false;
13779 }
13780
13782 {
13784 {
13785 return true;
13786 }
13787
13788 return false;
13789 }
13790
13792 {
13794 {
13795 return true;
13796 }
13797
13798 return false;
13799 }
13800
13802 {
13803 return false;
13804 }
13805
13808 {
13809 return UATimeSpent.DEFAULT_DEPLOY;
13810 }
13811
13812
13813
13814
13816 {
13818 SetSynchDirty();
13819 }
13820
13822 {
13824 }
13825
13826
13828 {
13829 return false;
13830 }
13831
13834 {
13835 string att_type = "None";
13836
13837 if (ConfigIsExisting("soundAttType"))
13838 {
13839 att_type = ConfigGetString("soundAttType");
13840 }
13841
13843 }
13844
13846 {
13848 }
13849
13850
13851
13852
13853
13857
13859 {
13862
13864 }
13865
13866
13868 {
13870 return;
13871
13873
13876
13879
13880 SoundParameters params = new SoundParameters();
13884 }
13885
13886
13888 {
13890 return;
13891
13893 SetSynchDirty();
13894
13897 }
13898
13899
13901 {
13903 return;
13904
13906 SetSynchDirty();
13907
13910 }
13911
13913 {
13915 }
13916
13918 {
13920 }
13921
13924 {
13925 if (!
GetGame().IsDedicatedServer())
13926 {
13927 if (ConfigIsExisting("attachSoundSet"))
13928 {
13929 string cfg_path = "";
13930 string soundset = "";
13931 string type_name =
GetType();
13932
13935 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13936 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13937
13938 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13939 {
13940 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13941 {
13942 if (cfg_slot_array[i] == slot_type)
13943 {
13944 soundset = cfg_soundset_array[i];
13945 break;
13946 }
13947 }
13948 }
13949
13950 if (soundset != "")
13951 {
13952 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13954 }
13955 }
13956 }
13957 }
13958
13960 {
13961
13962 }
13963
13964 void OnApply(PlayerBase player);
13965
13967 {
13968 return 1.0;
13969 };
13970
13972 {
13974 }
13975
13977 {
13979 }
13980
13982
13984 {
13985 SetDynamicPhysicsLifeTime(0.01);
13987 }
13988
13990 {
13991 array<string> zone_names = new array<string>;
13992 GetDamageZones(zone_names);
13993 for (int i = 0; i < zone_names.Count(); i++)
13994 {
13995 SetHealthMax(zone_names.Get(i),"Health");
13996 }
13997 SetHealthMax("","Health");
13998 }
13999
14002 {
14003 float global_health = GetHealth01("","Health");
14004 array<string> zones = new array<string>;
14005 GetDamageZones(zones);
14006
14007 for (int i = 0; i < zones.Count(); i++)
14008 {
14009 SetHealth01(zones.Get(i),"Health",global_health);
14010 }
14011 }
14012
14015 {
14016 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14017 }
14018
14020 {
14021 if (!hasRootAsPlayer)
14022 {
14023 if (refParentIB)
14024 {
14025
14026 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14027 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14028
14029 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14030 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14031
14034 }
14035 else
14036 {
14037
14040 }
14041 }
14042 }
14043
14045 {
14047 {
14048 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14049 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
14050 {
14051 float heatPermCoef = 1.0;
14053 while (ent)
14054 {
14055 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14056 ent = ent.GetHierarchyParent();
14057 }
14058
14059 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14060 }
14061 }
14062 }
14063
14065 {
14066
14067 EntityAI parent = GetHierarchyParent();
14068 if (!parent)
14069 {
14070 hasParent = false;
14071 hasRootAsPlayer = false;
14072 }
14073 else
14074 {
14075 hasParent = true;
14076 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14077 refParentIB =
ItemBase.Cast(parent);
14078 }
14079 }
14080
14081 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14082 {
14083
14084 }
14085
14087 {
14088
14089 return false;
14090 }
14091
14093 {
14094
14095
14096 return false;
14097 }
14098
14100 {
14101
14102 return false;
14103 }
14104
14107 {
14108 return !GetIsFrozen() &&
IsOpen();
14109 }
14110
14112 {
14113 bool hasParent = false, hasRootAsPlayer = false;
14115
14116 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14117 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14118
14119 if (wwtu || foodDecay)
14120 {
14124
14125 if (processWetness || processTemperature || processDecay)
14126 {
14128
14129 if (processWetness)
14130 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14131
14132 if (processTemperature)
14134
14135 if (processDecay)
14136 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14137 }
14138 }
14139 }
14140
14143 {
14145 }
14146
14148 {
14151
14152 return super.GetTemperatureFreezeThreshold();
14153 }
14154
14156 {
14159
14160 return super.GetTemperatureThawThreshold();
14161 }
14162
14164 {
14167
14168 return super.GetItemOverheatThreshold();
14169 }
14170
14172 {
14174 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14175
14176 return super.GetTemperatureFreezeTime();
14177 }
14178
14180 {
14182 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14183
14184 return super.GetTemperatureThawTime();
14185 }
14186
14191
14193 {
14194 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14195 }
14196
14198 {
14199 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14200 }
14201
14204 {
14206 }
14207
14209 {
14211 }
14212
14214 {
14216 }
14217
14220 {
14221 return null;
14222 }
14223
14226 {
14227 return false;
14228 }
14229
14231 {
14233 {
14236 if (!trg)
14237 {
14239 explosive = this;
14240 }
14241
14242 explosive.PairRemote(trg);
14244
14245 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14246 trg.SetPersistentPairID(persistentID);
14247 explosive.SetPersistentPairID(persistentID);
14248
14249 return true;
14250 }
14251 return false;
14252 }
14253
14256 {
14257 float ret = 1.0;
14260 ret *= GetHealth01();
14261
14262 return ret;
14263 }
14264
14265 #ifdef DEVELOPER
14266 override void SetDebugItem()
14267 {
14268 super.SetDebugItem();
14269 _itemBase = this;
14270 }
14271
14273 {
14274 string text = super.GetDebugText();
14275
14277 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14278
14279 return text;
14280 }
14281 #endif
14282
14284 {
14285 return true;
14286 }
14287
14289
14291
14293 {
14296 }
14297
14298
14306
14322}
14323
14325{
14327 if (entity)
14328 {
14329 bool is_item = entity.IsInherited(
ItemBase);
14330 if (is_item && full_quantity)
14331 {
14334 }
14335 }
14336 else
14337 {
14339 return NULL;
14340 }
14341 return entity;
14342}
14343
14345{
14346 if (item)
14347 {
14348 if (health > 0)
14349 item.SetHealth("", "", health);
14350
14351 if (item.CanHaveTemperature())
14352 {
14354 if (item.CanFreeze())
14355 item.SetFrozen(false);
14356 }
14357
14358 if (item.HasEnergyManager())
14359 {
14360 if (quantity >= 0)
14361 {
14362 item.GetCompEM().SetEnergy0To1(quantity);
14363 }
14364 else
14365 {
14367 }
14368 }
14369 else if (item.IsMagazine())
14370 {
14371 Magazine mag = Magazine.Cast(item);
14372 if (quantity >= 0)
14373 {
14374 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14375 }
14376 else
14377 {
14379 }
14380
14381 }
14382 else
14383 {
14384 if (quantity >= 0)
14385 {
14386 item.SetQuantityNormalized(quantity, false);
14387 }
14388 else
14389 {
14391 }
14392
14393 }
14394 }
14395}
14396
14397#ifdef DEVELOPER
14399#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.