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 {
11131
11133 return false;
11134
11135
11137 return false;
11138
11139
11140
11142 if (delta == 0)
11143 return false;
11144
11145
11146 return true;
11147 }
11148
11150 {
11152 {
11153 if (ScriptInputUserData.CanStoreInputUserData())
11154 {
11155 ScriptInputUserData ctx = new ScriptInputUserData;
11160 ctx.
Write(destination_entity);
11162 ctx.
Write(slot_id);
11164 }
11165 }
11166 else if (!
GetGame().IsMultiplayer())
11167 {
11169 }
11170 }
11171
11173 {
11174 float split_quantity_new;
11178 InventoryLocation loc = new InventoryLocation;
11179
11180 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11181 {
11183 split_quantity_new = stack_max;
11184 else
11186
11188 {
11189 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11190 if (new_item)
11191 {
11192 new_item.SetResultOfSplit(true);
11193 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11195 new_item.
SetQuantity(split_quantity_new,
false,
true);
11196 }
11197 }
11198 }
11199 else if (destination_entity && slot_id == -1)
11200 {
11201 if (quantity > stack_max)
11202 split_quantity_new = stack_max;
11203 else
11204 split_quantity_new = quantity;
11205
11207 {
11209 {
11212 }
11213
11214 if (new_item)
11215 {
11216 new_item.SetResultOfSplit(true);
11217 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11219 new_item.
SetQuantity(split_quantity_new,
false,
true);
11220 }
11221 }
11222 }
11223 else
11224 {
11225 if (stack_max != 0)
11226 {
11228 {
11230 }
11231
11232 if (split_quantity_new == 0)
11233 {
11234 if (!
GetGame().IsMultiplayer())
11235 player.PhysicalPredictiveDropItem(this);
11236 else
11237 player.ServerDropEntity(this);
11238 return;
11239 }
11240
11242 {
11244
11245 if (new_item)
11246 {
11247 new_item.SetResultOfSplit(true);
11248 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11251 new_item.PlaceOnSurface();
11252 }
11253 }
11254 }
11255 }
11256 }
11257
11259 {
11260 float split_quantity_new;
11264 InventoryLocation loc = new InventoryLocation;
11265
11266 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11267 {
11269 split_quantity_new = stack_max;
11270 else
11272
11274 {
11275 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11276 if (new_item)
11277 {
11278 new_item.SetResultOfSplit(true);
11279 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11281 new_item.
SetQuantity(split_quantity_new,
false,
true);
11282 }
11283 }
11284 }
11285 else if (destination_entity && slot_id == -1)
11286 {
11287 if (quantity > stack_max)
11288 split_quantity_new = stack_max;
11289 else
11290 split_quantity_new = quantity;
11291
11293 {
11295 {
11298 }
11299
11300 if (new_item)
11301 {
11302 new_item.SetResultOfSplit(true);
11303 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11305 new_item.
SetQuantity(split_quantity_new,
false,
true);
11306 }
11307 }
11308 }
11309 else
11310 {
11311 if (stack_max != 0)
11312 {
11314 {
11316 }
11317
11319 {
11321
11322 if (new_item)
11323 {
11324 new_item.SetResultOfSplit(true);
11325 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11328 new_item.PlaceOnSurface();
11329 }
11330 }
11331 }
11332 }
11333 }
11334
11336 {
11338 {
11339 if (ScriptInputUserData.CanStoreInputUserData())
11340 {
11341 ScriptInputUserData ctx = new ScriptInputUserData;
11346 dst.WriteToContext(ctx);
11348 }
11349 }
11350 else if (!
GetGame().IsMultiplayer())
11351 {
11353 }
11354 }
11355
11357 {
11359 {
11360 if (ScriptInputUserData.CanStoreInputUserData())
11361 {
11362 ScriptInputUserData ctx = new ScriptInputUserData;
11367 ctx.
Write(destination_entity);
11373 }
11374 }
11375 else if (!
GetGame().IsMultiplayer())
11376 {
11378 }
11379 }
11380
11382 {
11384 }
11385
11387 {
11389 float split_quantity_new;
11391 if (dst.IsValid())
11392 {
11393 int slot_id = dst.GetSlot();
11395
11396 if (quantity > stack_max)
11397 split_quantity_new = stack_max;
11398 else
11399 split_quantity_new = quantity;
11400
11402 {
11404
11405 if (new_item)
11406 {
11407 new_item.SetResultOfSplit(true);
11408 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11410 new_item.
SetQuantity(split_quantity_new,
false,
true);
11411 }
11412
11413 return new_item;
11414 }
11415 }
11416
11417 return null;
11418 }
11419
11421 {
11423 float split_quantity_new;
11425 if (destination_entity)
11426 {
11428 if (quantity > stackable)
11429 split_quantity_new = stackable;
11430 else
11431 split_quantity_new = quantity;
11432
11434 {
11435 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11436 if (new_item)
11437 {
11438 new_item.SetResultOfSplit(true);
11439 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11441 new_item.
SetQuantity(split_quantity_new,
false,
true);
11442 }
11443 }
11444 }
11445 }
11446
11448 {
11450 {
11451 if (ScriptInputUserData.CanStoreInputUserData())
11452 {
11453 ScriptInputUserData ctx = new ScriptInputUserData;
11458 ItemBase destination_entity =
this;
11459 ctx.
Write(destination_entity);
11463 }
11464 }
11465 else if (!
GetGame().IsMultiplayer())
11466 {
11468 }
11469 }
11470
11472 {
11474 float split_quantity_new;
11476 if (player)
11477 {
11479 if (quantity > stackable)
11480 split_quantity_new = stackable;
11481 else
11482 split_quantity_new = quantity;
11483
11485 {
11486 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11487 new_item =
ItemBase.Cast(in_hands);
11488 if (new_item)
11489 {
11490 new_item.SetResultOfSplit(true);
11491 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11493 new_item.SetQuantity(split_quantity_new, false, true);
11494 }
11495 }
11496 }
11497 }
11498
11500 {
11502 float split_quantity_new = Math.Floor(quantity * 0.5);
11503
11505 return;
11506
11508
11509 if (new_item)
11510 {
11511 if (new_item.GetQuantityMax() < split_quantity_new)
11512 {
11513 split_quantity_new = new_item.GetQuantityMax();
11514 }
11515
11516 new_item.SetResultOfSplit(true);
11517 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11518
11520 {
11523 }
11524 else
11525 {
11527 new_item.
SetQuantity(split_quantity_new,
false,
true);
11528 }
11529 }
11530 }
11531
11533 {
11535 float split_quantity_new = Math.Floor(quantity / 2);
11536
11538 return;
11539
11540 InventoryLocation invloc = new InventoryLocation;
11542
11544 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11545
11546 if (new_item)
11547 {
11548 if (new_item.GetQuantityMax() < split_quantity_new)
11549 {
11550 split_quantity_new = new_item.GetQuantityMax();
11551 }
11553 {
11556 }
11557 else if (split_quantity_new > 1)
11558 {
11560 new_item.
SetQuantity(split_quantity_new,
false,
true);
11561 }
11562 }
11563 }
11564
11567 {
11568 SetWeightDirty();
11570
11571 if (parent)
11572 parent.OnAttachmentQuantityChangedEx(this, delta);
11573
11575 {
11577 {
11579 }
11581 {
11582 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11584 }
11585 }
11586
11587 }
11588
11591 {
11592
11593 }
11594
11597 {
11599 }
11600
11602 {
11603 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11604
11606 {
11607 if (newLevel == GameConstants.STATE_RUINED)
11608 {
11610 EntityAI parent = GetHierarchyParent();
11611 if (parent && parent.IsFireplace())
11612 {
11613 CargoBase cargo = GetInventory().GetCargo();
11614 if (cargo)
11615 {
11617 {
11619 }
11620 }
11621 }
11622 }
11623
11625 {
11626
11628 return;
11629 }
11630
11631 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11632 {
11634 }
11635 }
11636 }
11637
11638
11640 {
11641 super.OnRightClick();
11642
11644 {
11646 {
11647 if (ScriptInputUserData.CanStoreInputUserData())
11648 {
11649 EntityAI root = GetHierarchyRoot();
11650 Man playerOwner = GetHierarchyRootPlayer();
11651 InventoryLocation dst = new InventoryLocation;
11652
11653
11654 if (!playerOwner && root && root == this)
11655 {
11657 }
11658 else
11659 {
11660
11661 GetInventory().GetCurrentInventoryLocation(dst);
11663 {
11666 {
11668 }
11669 else
11670 {
11672
11673
11674 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11675 {
11677 }
11678 else
11679 {
11680 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11681 }
11682 }
11683 }
11684 }
11685
11686 ScriptInputUserData ctx = new ScriptInputUserData;
11694 }
11695 }
11696 else if (!
GetGame().IsMultiplayer())
11697 {
11699 }
11700 }
11701 }
11702
11704 {
11705 if (root)
11706 {
11707 vector m4[4];
11708 root.GetTransform(m4);
11709 dst.SetGround(this, m4);
11710 }
11711 else
11712 {
11713 GetInventory().GetCurrentInventoryLocation(dst);
11714 }
11715 }
11716
11717 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11718 {
11719
11720 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11721 return false;
11722
11723 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11724 return false;
11725
11726
11728 return false;
11729
11730
11731 Magazine mag = Magazine.Cast(this);
11732 if (mag)
11733 {
11734 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11735 return false;
11736
11737 if (stack_max_limit)
11738 {
11739 Magazine other_mag = Magazine.Cast(other_item);
11740 if (other_item)
11741 {
11742 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11743 return false;
11744 }
11745
11746 }
11747 }
11748 else
11749 {
11750
11752 return false;
11753
11755 return false;
11756 }
11757
11758 PlayerBase player = null;
11759 if (CastTo(player, GetHierarchyRootPlayer()))
11760 {
11761 if (player.GetInventory().HasAttachment(this))
11762 return false;
11763
11764 if (player.IsItemsToDelete())
11765 return false;
11766 }
11767
11768 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11769 return false;
11770
11771 int slotID;
11773 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11774 return false;
11775
11776 return true;
11777 }
11778
11780 {
11782 }
11783
11785 {
11786 return m_IsResultOfSplit;
11787 }
11788
11790 {
11791 m_IsResultOfSplit = value;
11792 }
11793
11795 {
11797 }
11798
11800 {
11801 float other_item_quantity = other_item.GetQuantity();
11802 float this_free_space;
11803
11805
11807
11808 if (other_item_quantity > this_free_space)
11809 {
11810 return this_free_space;
11811 }
11812 else
11813 {
11814 return other_item_quantity;
11815 }
11816 }
11817
11819 {
11821 }
11822
11824 {
11826 return;
11827
11828 if (!IsMagazine() && other_item)
11829 {
11831 if (quantity_used != 0)
11832 {
11833 float hp1 = GetHealth01("","");
11834 float hp2 = other_item.GetHealth01("","");
11835 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11836 hpResult = hpResult / (
GetQuantity() + quantity_used);
11837
11838 hpResult *= GetMaxHealth();
11839 Math.Round(hpResult);
11840 SetHealth("", "Health", hpResult);
11841
11843 other_item.AddQuantity(-quantity_used);
11844 }
11845 }
11847 }
11848
11850 {
11851 #ifdef SERVER
11852 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11853 GetHierarchyParent().IncreaseLifetimeUp();
11854 #endif
11855 };
11856
11858 {
11859 PlayerBase p = PlayerBase.Cast(player);
11860
11861 array<int> recipesIds = p.m_Recipes;
11862 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11863 if (moduleRecipesManager)
11864 {
11865 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11866 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11867 }
11868
11869 for (int i = 0;i < recipesIds.Count(); i++)
11870 {
11871 int key = recipesIds.Get(i);
11872 string recipeName = moduleRecipesManager.GetRecipeName(key);
11874 }
11875 }
11876
11877
11878 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11879 {
11880 super.GetDebugActions(outputList);
11881
11882
11888
11889
11894
11899
11900
11904
11905
11907 {
11911 }
11912
11915
11916
11920
11922
11923 InventoryLocation loc = new InventoryLocation();
11924 GetInventory().GetCurrentInventoryLocation(loc);
11926 {
11927 if (Gizmo_IsSupported())
11930 }
11931
11933 }
11934
11935
11936
11937
11939 {
11940 super.OnAction(action_id, player, ctx);
11941
11943 {
11944 switch (action_id)
11945 {
11948 return true;
11951 return true;
11952 }
11953 }
11954
11956 {
11957 switch (action_id)
11958 {
11960 Delete();
11961 return true;
11962 }
11963 }
11964
11965 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11966 {
11967 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11968 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11969 PlayerBase p = PlayerBase.Cast(player);
11970 if (
EActions.RECIPES_RANGE_START < 1000)
11971 {
11972 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11973 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11974 }
11975 }
11976 #ifndef SERVER
11977 else if (action_id ==
EActions.WATCH_PLAYER)
11978 {
11979 PluginDeveloper.SetDeveloperItemClientEx(player);
11980 }
11981 #endif
11983 {
11984 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11985 {
11986 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11987 OnDebugButtonPressServer(id + 1);
11988 }
11989
11990 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11991 {
11992 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11994 }
11995
11996 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11997 {
11998 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
12000 }
12001
12002 else if (action_id ==
EActions.ADD_QUANTITY)
12003 {
12004 if (IsMagazine())
12005 {
12006 Magazine mag = Magazine.Cast(this);
12007 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
12008 }
12009 else
12010 {
12012 }
12013
12014 if (m_EM)
12015 {
12016 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12017 }
12018
12019 }
12020
12021 else if (action_id ==
EActions.REMOVE_QUANTITY)
12022 {
12023 if (IsMagazine())
12024 {
12025 Magazine mag2 = Magazine.Cast(this);
12026 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12027 }
12028 else
12029 {
12031 }
12032 if (m_EM)
12033 {
12034 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12035 }
12036
12037 }
12038
12039 else if (action_id ==
EActions.SET_QUANTITY_0)
12040 {
12042
12043 if (m_EM)
12044 {
12045 m_EM.SetEnergy(0);
12046 }
12047 }
12048
12049 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12050 {
12052
12053 if (m_EM)
12054 {
12055 m_EM.SetEnergy(m_EM.GetEnergyMax());
12056 }
12057 }
12058
12059 else if (action_id ==
EActions.ADD_HEALTH)
12060 {
12061 AddHealth("","",GetMaxHealth("","Health")/5);
12062 }
12063 else if (action_id ==
EActions.REMOVE_HEALTH)
12064 {
12065 AddHealth("","",-GetMaxHealth("","Health")/5);
12066 }
12067 else if (action_id ==
EActions.DESTROY_HEALTH)
12068 {
12069 SetHealth01("","",0);
12070 }
12071 else if (action_id ==
EActions.WATCH_ITEM)
12072 {
12074 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12075 #ifdef DEVELOPER
12076 SetDebugDeveloper_item(this);
12077 #endif
12078 }
12079
12080 else if (action_id ==
EActions.ADD_TEMPERATURE)
12081 {
12082 AddTemperature(20);
12083
12084 }
12085
12086 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12087 {
12088 AddTemperature(-20);
12089
12090 }
12091
12092 else if (action_id ==
EActions.FLIP_FROZEN)
12093 {
12094 SetFrozen(!GetIsFrozen());
12095
12096 }
12097
12098 else if (action_id ==
EActions.ADD_WETNESS)
12099 {
12101
12102 }
12103
12104 else if (action_id ==
EActions.REMOVE_WETNESS)
12105 {
12107
12108 }
12109
12110 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12111 {
12114
12115
12116 }
12117
12118 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12119 {
12122 }
12123
12124 else if (action_id ==
EActions.MAKE_SPECIAL)
12125 {
12126 auto debugParams = DebugSpawnParams.WithPlayer(player);
12127 OnDebugSpawnEx(debugParams);
12128 }
12129
12130 }
12131
12132
12133 return false;
12134 }
12135
12136
12137
12138
12142
12145
12146
12147
12149 {
12150 return false;
12151 }
12152
12153
12155 {
12156 return true;
12157 }
12158
12159
12161 {
12162 return true;
12163 }
12164
12165
12166
12168 {
12169 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12171 }
12172
12175 {
12176 return null;
12177 }
12178
12180 {
12181 return false;
12182 }
12183
12185 {
12186 return false;
12187 }
12188
12192
12193
12195 {
12196 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12197 return module_repairing.CanRepair(this, item_repair_kit);
12198 }
12199
12200
12201 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12202 {
12203 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12204 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12205 }
12206
12207
12209 {
12210
12211
12212
12213
12214
12215
12216
12217
12218 return 1;
12219 }
12220
12221
12222
12224 {
12226 }
12227
12228
12229
12231 {
12233 }
12234
12235
12244 {
12245 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12246
12247 if (player)
12248 {
12249 player.MessageStatus(text);
12250 }
12251 }
12252
12253
12262 {
12263 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12264
12265 if (player)
12266 {
12267 player.MessageAction(text);
12268 }
12269 }
12270
12271
12280 {
12281 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12282
12283 if (player)
12284 {
12285 player.MessageFriendly(text);
12286 }
12287 }
12288
12289
12298 {
12299 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12300
12301 if (player)
12302 {
12303 player.MessageImportant(text);
12304 }
12305 }
12306
12308 {
12309 return true;
12310 }
12311
12312
12313 override bool KindOf(
string tag)
12314 {
12315 bool found = false;
12316 string item_name = this.
GetType();
12319
12320 int array_size = item_tag_array.Count();
12321 for (int i = 0; i < array_size; i++)
12322 {
12323 if (item_tag_array.Get(i) == tag)
12324 {
12325 found = true;
12326 break;
12327 }
12328 }
12329 return found;
12330 }
12331
12332
12334 {
12335
12336 super.OnRPC(sender, rpc_type,ctx);
12337
12338
12339 switch (rpc_type)
12340 {
12341 #ifndef SERVER
12342 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12343 Param2<bool, string> p = new Param2<bool, string>(false, "");
12344
12346 return;
12347
12348 bool play = p.param1;
12349 string soundSet = p.param2;
12350
12351 if (play)
12352 {
12354 {
12356 {
12358 }
12359 }
12360 else
12361 {
12363 }
12364 }
12365 else
12366 {
12368 }
12369
12370 break;
12371 #endif
12372
12373 }
12374
12376 {
12378 }
12379 }
12380
12381
12382
12383
12385 {
12386 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12387 return plugin.GetID(
name);
12388 }
12389
12391 {
12392 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12393 return plugin.GetName(id);
12394 }
12395
12398 {
12399
12400
12401 int varFlags;
12402 if (!ctx.
Read(varFlags))
12403 return;
12404
12405 if (varFlags & ItemVariableFlags.FLOAT)
12406 {
12408 }
12409 }
12410
12412 {
12413
12414 super.SerializeNumericalVars(floats_out);
12415
12416
12417
12419 {
12421 }
12422
12424 {
12426 }
12427
12429 {
12431 }
12432
12434 {
12439 }
12440
12442 {
12444 }
12445 }
12446
12448 {
12449
12450 super.DeSerializeNumericalVars(floats);
12451
12452
12453 int index = 0;
12454 int mask = Math.Round(floats.Get(index));
12455
12456 index++;
12457
12459 {
12461 {
12463 }
12464 else
12465 {
12466 float quantity = floats.Get(index);
12467 SetQuantity(quantity,
true,
false,
false,
false);
12468 }
12469 index++;
12470 }
12471
12473 {
12474 float wet = floats.Get(index);
12476 index++;
12477 }
12478
12480 {
12481 int liquidtype = Math.Round(floats.Get(index));
12483 index++;
12484 }
12485
12487 {
12489 index++;
12491 index++;
12493 index++;
12495 index++;
12496 }
12497
12499 {
12500 int cleanness = Math.Round(floats.Get(index));
12502 index++;
12503 }
12504 }
12505
12507 {
12508 super.WriteVarsToCTX(ctx);
12509
12510
12512 {
12514 }
12515
12517 {
12519 }
12520
12522 {
12524 }
12525
12527 {
12528 int r,g,b,a;
12534 }
12535
12537 {
12539 }
12540 }
12541
12543 {
12544 if (!super.ReadVarsFromCTX(ctx,version))
12545 return false;
12546
12547 int intValue;
12548 float value;
12549
12550 if (version < 140)
12551 {
12552 if (!ctx.
Read(intValue))
12553 return false;
12554
12555 m_VariablesMask = intValue;
12556 }
12557
12559 {
12560 if (!ctx.
Read(value))
12561 return false;
12562
12564 {
12566 }
12567 else
12568 {
12570 }
12571 }
12572
12573 if (version < 140)
12574 {
12576 {
12577 if (!ctx.
Read(value))
12578 return false;
12579 SetTemperatureDirect(value);
12580 }
12581 }
12582
12584 {
12585 if (!ctx.
Read(value))
12586 return false;
12588 }
12589
12591 {
12592 if (!ctx.
Read(intValue))
12593 return false;
12595 }
12596
12598 {
12599 int r,g,b,a;
12601 return false;
12603 return false;
12605 return false;
12607 return false;
12608
12610 }
12611
12613 {
12614 if (!ctx.
Read(intValue))
12615 return false;
12617 }
12618
12619 if (version >= 138 && version < 140)
12620 {
12622 {
12623 if (!ctx.
Read(intValue))
12624 return false;
12625 SetFrozen(intValue);
12626 }
12627 }
12628
12629 return true;
12630 }
12631
12632
12634 {
12637 {
12639 }
12640
12641 if (!super.OnStoreLoad(ctx, version))
12642 {
12644 return false;
12645 }
12646
12647 if (version >= 114)
12648 {
12649 bool hasQuickBarIndexSaved;
12650
12651 if (!ctx.
Read(hasQuickBarIndexSaved))
12652 {
12654 return false;
12655 }
12656
12657 if (hasQuickBarIndexSaved)
12658 {
12659 int itmQBIndex;
12660
12661
12662 if (!ctx.
Read(itmQBIndex))
12663 {
12665 return false;
12666 }
12667
12668 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12669 if (itmQBIndex != -1 && parentPlayer)
12670 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12671 }
12672 }
12673 else
12674 {
12675
12676 PlayerBase player;
12677 int itemQBIndex;
12678 if (version ==
int.
MAX)
12679 {
12680 if (!ctx.
Read(itemQBIndex))
12681 {
12683 return false;
12684 }
12685 }
12686 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12687 {
12688
12689 if (!ctx.
Read(itemQBIndex))
12690 {
12692 return false;
12693 }
12694 if (itemQBIndex != -1 && player)
12695 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12696 }
12697 }
12698
12699 if (version < 140)
12700 {
12701
12702 if (!LoadVariables(ctx, version))
12703 {
12705 return false;
12706 }
12707 }
12708
12709
12711 {
12713 return false;
12714 }
12715 if (version >= 132)
12716 {
12718 if (raib)
12719 {
12721 {
12723 return false;
12724 }
12725 }
12726 }
12727
12729 return true;
12730 }
12731
12732
12733
12735 {
12736 super.OnStoreSave(ctx);
12737
12738 PlayerBase player;
12739 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12740 {
12742
12743 int itemQBIndex = -1;
12744 itemQBIndex = player.FindQuickBarEntityIndex(this);
12745 ctx.
Write(itemQBIndex);
12746 }
12747 else
12748 {
12750 }
12751
12753
12755 if (raib)
12756 {
12758 }
12759 }
12760
12761
12763 {
12764 super.AfterStoreLoad();
12765
12767 {
12769 }
12770
12772 {
12775 }
12776 }
12777
12779 {
12780 super.EEOnAfterLoad();
12781
12783 {
12785 }
12786
12789 }
12790
12792 {
12793 return false;
12794 }
12795
12796
12797
12799 {
12801 {
12802 #ifdef PLATFORM_CONSOLE
12803
12805 {
12807 if (menu)
12808 {
12810 }
12811 }
12812 #endif
12813 }
12814
12816 {
12819 }
12820
12822 {
12823 SetWeightDirty();
12825 }
12827 {
12830 }
12831
12833 {
12836 }
12838 {
12841 }
12842
12843 super.OnVariablesSynchronized();
12844 }
12845
12846
12847
12849 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12850 {
12851 if (!IsServerCheck(allow_client))
12852 return false;
12853
12855 return false;
12856
12859
12860 if (value <= (min + 0.001))
12861 value = min;
12862
12863 if (value == min)
12864 {
12865 if (destroy_config)
12866 {
12867 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12868 if (dstr)
12869 {
12871 this.Delete();
12872 return true;
12873 }
12874 }
12875 else if (destroy_forced)
12876 {
12878 this.Delete();
12879 return true;
12880 }
12881
12883 }
12884
12887
12889 {
12891
12892 if (delta)
12894 }
12895
12897
12898 return false;
12899 }
12900
12901
12903 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12904 {
12906 }
12907
12909 {
12912 }
12913
12915 {
12918 }
12919
12921 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12922 {
12923 float value_clamped = Math.Clamp(value, 0, 1);
12925 SetQuantity(result, destroy_config, destroy_forced);
12926 }
12927
12928
12931 {
12933 }
12934
12936 {
12938 }
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12950 {
12951 int slot = -1;
12952 if (GetInventory())
12953 {
12954 InventoryLocation il = new InventoryLocation;
12955 GetInventory().GetCurrentInventoryLocation(il);
12957 }
12958
12960 }
12961
12963 {
12964 float quantity_max = 0;
12965
12967 {
12968 if (attSlotID != -1)
12969 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12970
12971 if (quantity_max <= 0)
12973 }
12974
12975 if (quantity_max <= 0)
12977
12978 return quantity_max;
12979 }
12980
12982 {
12984 }
12985
12987 {
12989 }
12990
12991
12993 {
12995 }
12996
12998 {
13000 }
13001
13003 {
13005 }
13006
13007
13009 {
13010
13011 float weightEx = GetWeightEx();
13012 float special = GetInventoryAndCargoWeight();
13013 return weightEx - special;
13014 }
13015
13016
13018 {
13020 }
13021
13023 {
13025 {
13026 #ifdef DEVELOPER
13027 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13028 {
13029 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13031 }
13032 #endif
13033
13034 return GetQuantity() * GetConfigWeightModified();
13035 }
13036 else if (HasEnergyManager())
13037 {
13038 #ifdef DEVELOPER
13039 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13040 {
13041 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13042 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13043 }
13044 #endif
13045 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13046 }
13047 else
13048 {
13049 #ifdef DEVELOPER
13050 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13051 {
13052 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13053 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13054 }
13055 #endif
13056 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13057 }
13058 }
13059
13062 {
13063 int item_count = 0;
13065
13066 if (GetInventory().GetCargo() != NULL)
13067 {
13068 item_count = GetInventory().GetCargo().GetItemCount();
13069 }
13070
13071 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13072 {
13073 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13074 if (item)
13075 item_count += item.GetNumberOfItems();
13076 }
13077 return item_count;
13078 }
13079
13082 {
13083 float weight = 0;
13084 float wetness = 1;
13085 if (include_wetness)
13088 {
13089 weight = wetness * m_ConfigWeight;
13090 }
13092 {
13093 weight = 1;
13094 }
13095 return weight;
13096 }
13097
13098
13099
13101 {
13102 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13103 {
13104 GameInventory inv = GetInventory();
13105 array<EntityAI> items = new array<EntityAI>;
13107 for (int i = 0; i < items.Count(); i++)
13108 {
13110 if (item)
13111 {
13113 }
13114 }
13115 }
13116 }
13117
13118
13119
13120
13122 {
13123 float energy = 0;
13124 if (HasEnergyManager())
13125 {
13126 energy = GetCompEM().GetEnergy();
13127 }
13128 return energy;
13129 }
13130
13131
13133 {
13134 super.OnEnergyConsumed();
13135
13137 }
13138
13140 {
13141 super.OnEnergyAdded();
13142
13144 }
13145
13146
13148 {
13149 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13150 {
13152 {
13153 float energy_0to1 = GetCompEM().GetEnergy0To1();
13155 }
13156 }
13157 }
13158
13159
13161 {
13162 return ConfigGetFloat("heatIsolation");
13163 }
13164
13166 {
13168 }
13169
13171 {
13172 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13173 if (
GetGame().ConfigIsExisting(paramPath))
13175
13176 return 0.0;
13177 }
13178
13180 {
13181 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13182 if (
GetGame().ConfigIsExisting(paramPath))
13184
13185 return 0.0;
13186 }
13187
13188 override void SetWet(
float value,
bool allow_client =
false)
13189 {
13190 if (!IsServerCheck(allow_client))
13191 return;
13192
13195
13197
13198 m_VarWet = Math.Clamp(value, min, max);
13199
13201 {
13204 }
13205 }
13206
13207 override void AddWet(
float value)
13208 {
13210 }
13211
13213 {
13215 }
13216
13218 {
13220 }
13221
13223 {
13225 }
13226
13228 {
13230 }
13231
13233 {
13235 }
13236
13237 override void OnWetChanged(
float newVal,
float oldVal)
13238 {
13241 if (newLevel != oldLevel)
13242 {
13244 }
13245 }
13246
13248 {
13249 SetWeightDirty();
13250 }
13251
13253 {
13254 return GetWetLevelInternal(
m_VarWet);
13255 }
13256
13257
13258
13260 {
13262 }
13263
13265 {
13267 }
13268
13270 {
13272 }
13273
13275 {
13277 }
13278
13279
13280
13282 {
13283 if (ConfigIsExisting("itemModelLength"))
13284 {
13285 return ConfigGetFloat("itemModelLength");
13286 }
13287 return 0;
13288 }
13289
13291 {
13292 if (ConfigIsExisting("itemAttachOffset"))
13293 {
13294 return ConfigGetFloat("itemAttachOffset");
13295 }
13296 return 0;
13297 }
13298
13299 override void SetCleanness(
int value,
bool allow_client =
false)
13300 {
13301 if (!IsServerCheck(allow_client))
13302 return;
13303
13305
13307
13310 }
13311
13313 {
13315 }
13316
13318 {
13319 return true;
13320 }
13321
13322
13323
13324
13326 {
13328 }
13329
13331 {
13333 }
13334
13335
13336
13337
13338 override void SetColor(
int r,
int g,
int b,
int a)
13339 {
13345 }
13347 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13348 {
13353 }
13354
13356 {
13358 }
13359
13362 {
13363 int r,g,b,a;
13365 r = r/255;
13366 g = g/255;
13367 b = b/255;
13368 a = a/255;
13369 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13370 }
13371
13372
13373
13374 override void SetLiquidType(
int value,
bool allow_client =
false)
13375 {
13376 if (!IsServerCheck(allow_client))
13377 return;
13378
13383 }
13384
13386 {
13387 return ConfigGetInt("varLiquidTypeInit");
13388 }
13389
13391 {
13393 }
13394
13396 {
13398 SetFrozen(false);
13399 }
13400
13403 {
13404 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13405 }
13406
13407
13410 {
13411 PlayerBase nplayer;
13412 if (PlayerBase.CastTo(nplayer, player))
13413 {
13415
13416 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13417 }
13418 }
13419
13420
13423 {
13424 PlayerBase nplayer;
13425 if (PlayerBase.CastTo(nplayer,player))
13426 {
13427
13428 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13429
13430 }
13431
13432
13433 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13434
13435
13436 if (HasEnergyManager())
13437 {
13438 GetCompEM().UpdatePlugState();
13439 }
13440 }
13441
13442
13444 {
13445 super.OnPlacementStarted(player);
13446
13448 }
13449
13450 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13451 {
13453 {
13454 m_AdminLog.OnPlacementComplete(player,
this);
13455 }
13456
13457 super.OnPlacementComplete(player, position, orientation);
13458 }
13459
13460
13461
13462
13463
13465 {
13467 {
13468 return true;
13469 }
13470 else
13471 {
13472 return false;
13473 }
13474 }
13475
13476
13478 {
13480 {
13482 }
13483 }
13484
13485
13487 {
13489 }
13490
13492 {
13494 }
13495
13496 override void InsertAgent(
int agent,
float count = 1)
13497 {
13498 if (count < 1)
13499 return;
13500
13502 }
13503
13506 {
13508 }
13509
13510
13512 {
13514 }
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13558 {
13560 return false;
13561 return true;
13562 }
13563
13565 {
13566
13568 }
13569
13570
13573 {
13574 super.CheckForRoofLimited(timeTresholdMS);
13575
13577 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13578 {
13579 m_PreviousRoofTestTime = time;
13580 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13581 }
13582 }
13583
13584
13586 {
13588 {
13589 return 0;
13590 }
13591
13592 if (GetInventory().GetAttachmentSlotsCount() != 0)
13593 {
13594 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13595 if (filter)
13596 return filter.GetProtectionLevel(type, false, system);
13597 else
13598 return 0;
13599 }
13600
13601 string subclassPath, entryName;
13602
13603 switch (type)
13604 {
13606 entryName = "biological";
13607 break;
13609 entryName = "chemical";
13610 break;
13611 default:
13612 entryName = "biological";
13613 break;
13614 }
13615
13616 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13617
13619 }
13620
13621
13622
13625 {
13626 if (!IsMagazine())
13628
13630 }
13631
13632
13633
13634
13635
13640 {
13641 return true;
13642 }
13643
13645 {
13647 }
13648
13649
13650
13651
13652
13654 {
13655 if (parent)
13656 {
13657 if (parent.IsInherited(DayZInfected))
13658 return true;
13659
13660 if (!parent.IsRuined())
13661 return true;
13662 }
13663
13664 return true;
13665 }
13666
13668 {
13669 if (!super.CanPutAsAttachment(parent))
13670 {
13671 return false;
13672 }
13673
13674 if (!IsRuined() && !parent.IsRuined())
13675 {
13676 return true;
13677 }
13678
13679 return false;
13680 }
13681
13683 {
13684
13685
13686
13687
13688 return super.CanReceiveItemIntoCargo(item);
13689 }
13690
13692 {
13693
13694
13695
13696
13697 GameInventory attachmentInv = attachment.GetInventory();
13699 {
13700 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13701 return false;
13702 }
13703
13704 InventoryLocation loc = new InventoryLocation();
13705 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13706 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13707 return false;
13708
13709 return super.CanReceiveAttachment(attachment, slotId);
13710 }
13711
13713 {
13714 if (!super.CanReleaseAttachment(attachment))
13715 return false;
13716
13717 return GetInventory().AreChildrenAccessible();
13718 }
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13741 {
13742 int id = muzzle_owner.GetMuzzleID();
13743 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13744
13745 if (WPOF_array)
13746 {
13747 for (int i = 0; i < WPOF_array.Count(); i++)
13748 {
13749 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13750
13751 if (WPOF)
13752 {
13753 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13754 }
13755 }
13756 }
13757 }
13758
13759
13761 {
13762 int id = muzzle_owner.GetMuzzleID();
13764
13765 if (WPOBE_array)
13766 {
13767 for (int i = 0; i < WPOBE_array.Count(); i++)
13768 {
13769 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13770
13771 if (WPOBE)
13772 {
13773 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13774 }
13775 }
13776 }
13777 }
13778
13779
13781 {
13782 int id = muzzle_owner.GetMuzzleID();
13783 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13784
13785 if (WPOOH_array)
13786 {
13787 for (int i = 0; i < WPOOH_array.Count(); i++)
13788 {
13789 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13790
13791 if (WPOOH)
13792 {
13793 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13794 }
13795 }
13796 }
13797 }
13798
13799
13801 {
13802 int id = muzzle_owner.GetMuzzleID();
13803 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13804
13805 if (WPOOH_array)
13806 {
13807 for (int i = 0; i < WPOOH_array.Count(); i++)
13808 {
13809 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13810
13811 if (WPOOH)
13812 {
13813 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13814 }
13815 }
13816 }
13817 }
13818
13819
13821 {
13822 int id = muzzle_owner.GetMuzzleID();
13823 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13824
13825 if (WPOOH_array)
13826 {
13827 for (int i = 0; i < WPOOH_array.Count(); i++)
13828 {
13829 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13830
13831 if (WPOOH)
13832 {
13833 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13834 }
13835 }
13836 }
13837 }
13838
13839
13840
13842 {
13844 {
13845 return true;
13846 }
13847
13848 return false;
13849 }
13850
13852 {
13854 {
13855 return true;
13856 }
13857
13858 return false;
13859 }
13860
13862 {
13864 {
13865 return true;
13866 }
13867
13868 return false;
13869 }
13870
13872 {
13873 return false;
13874 }
13875
13878 {
13879 return UATimeSpent.DEFAULT_DEPLOY;
13880 }
13881
13882
13883
13884
13886 {
13888 SetSynchDirty();
13889 }
13890
13892 {
13894 }
13895
13896
13898 {
13899 return false;
13900 }
13901
13904 {
13905 string att_type = "None";
13906
13907 if (ConfigIsExisting("soundAttType"))
13908 {
13909 att_type = ConfigGetString("soundAttType");
13910 }
13911
13913 }
13914
13916 {
13918 }
13919
13920
13921
13922
13923
13929
13931 {
13934
13936 }
13937
13938
13940 {
13942 return;
13943
13945
13948
13951
13952 SoundParameters params = new SoundParameters();
13956 }
13957
13958
13960 {
13962 return;
13963
13965 SetSynchDirty();
13966
13969 }
13970
13971
13973 {
13975 return;
13976
13978 SetSynchDirty();
13979
13982 }
13983
13985 {
13987 }
13988
13990 {
13992 }
13993
13996 {
13997 if (!
GetGame().IsDedicatedServer())
13998 {
13999 if (ConfigIsExisting("attachSoundSet"))
14000 {
14001 string cfg_path = "";
14002 string soundset = "";
14003 string type_name =
GetType();
14004
14007 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
14008 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
14009
14010 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
14011 {
14012 for (int i = 0; i < cfg_soundset_array.Count(); i++)
14013 {
14014 if (cfg_slot_array[i] == slot_type)
14015 {
14016 soundset = cfg_soundset_array[i];
14017 break;
14018 }
14019 }
14020 }
14021
14022 if (soundset != "")
14023 {
14024 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14026 }
14027 }
14028 }
14029 }
14030
14032 {
14033
14034 }
14035
14036 void OnApply(PlayerBase player);
14037
14039 {
14040 return 1.0;
14041 };
14042
14044 {
14046 }
14047
14049 {
14051 }
14052
14054
14056 {
14057 SetDynamicPhysicsLifeTime(0.01);
14059 }
14060
14062 {
14063 array<string> zone_names = new array<string>;
14064 GetDamageZones(zone_names);
14065 for (int i = 0; i < zone_names.Count(); i++)
14066 {
14067 SetHealthMax(zone_names.Get(i),"Health");
14068 }
14069 SetHealthMax("","Health");
14070 }
14071
14074 {
14075 float global_health = GetHealth01("","Health");
14076 array<string> zones = new array<string>;
14077 GetDamageZones(zones);
14078
14079 for (int i = 0; i < zones.Count(); i++)
14080 {
14081 SetHealth01(zones.Get(i),"Health",global_health);
14082 }
14083 }
14084
14087 {
14088 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14089 }
14090
14092 {
14093 if (!hasRootAsPlayer)
14094 {
14095 if (refParentIB)
14096 {
14097
14098 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14099 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14100
14101 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14102 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14103
14106 }
14107 else
14108 {
14109
14112 }
14113 }
14114 }
14115
14117 {
14119 {
14120 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14121 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14122 {
14123 float heatPermCoef = 1.0;
14125 while (ent)
14126 {
14127 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14128 ent = ent.GetHierarchyParent();
14129 }
14130
14131 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14132 }
14133 }
14134 }
14135
14137 {
14138
14139 EntityAI parent = GetHierarchyParent();
14140 if (!parent)
14141 {
14142 hasParent = false;
14143 hasRootAsPlayer = false;
14144 }
14145 else
14146 {
14147 hasParent = true;
14148 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14149 refParentIB =
ItemBase.Cast(parent);
14150 }
14151 }
14152
14153 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14154 {
14155
14156 }
14157
14159 {
14160
14161 return false;
14162 }
14163
14165 {
14166
14167
14168 return false;
14169 }
14170
14172 {
14173
14174 return false;
14175 }
14176
14179 {
14180 return !GetIsFrozen() &&
IsOpen();
14181 }
14182
14184 {
14185 bool hasParent = false, hasRootAsPlayer = false;
14187
14188 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14189 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14190
14191 if (wwtu || foodDecay)
14192 {
14196
14197 if (processWetness || processTemperature || processDecay)
14198 {
14200
14201 if (processWetness)
14202 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14203
14204 if (processTemperature)
14206
14207 if (processDecay)
14208 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14209 }
14210 }
14211 }
14212
14215 {
14217 }
14218
14220 {
14223
14224 return super.GetTemperatureFreezeThreshold();
14225 }
14226
14228 {
14231
14232 return super.GetTemperatureThawThreshold();
14233 }
14234
14236 {
14239
14240 return super.GetItemOverheatThreshold();
14241 }
14242
14244 {
14246 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14247
14248 return super.GetTemperatureFreezeTime();
14249 }
14250
14252 {
14254 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14255
14256 return super.GetTemperatureThawTime();
14257 }
14258
14263
14265 {
14266 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14267 }
14268
14270 {
14271 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14272 }
14273
14276 {
14278 }
14279
14281 {
14283 }
14284
14286 {
14288 }
14289
14292 {
14293 return null;
14294 }
14295
14298 {
14299 return false;
14300 }
14301
14303 {
14305 {
14308 if (!trg)
14309 {
14311 explosive = this;
14312 }
14313
14314 explosive.PairRemote(trg);
14316
14317 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14318 trg.SetPersistentPairID(persistentID);
14319 explosive.SetPersistentPairID(persistentID);
14320
14321 return true;
14322 }
14323 return false;
14324 }
14325
14328 {
14329 float ret = 1.0;
14332 ret *= GetHealth01();
14333
14334 return ret;
14335 }
14336
14337 #ifdef DEVELOPER
14338 override void SetDebugItem()
14339 {
14340 super.SetDebugItem();
14341 _itemBase = this;
14342 }
14343
14345 {
14346 string text = super.GetDebugText();
14347
14349 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14350
14351 return text;
14352 }
14353 #endif
14354
14356 {
14357 return true;
14358 }
14359
14361
14363
14365 {
14368 }
14369
14370
14378
14394}
14395
14397{
14399 if (entity)
14400 {
14401 bool is_item = entity.IsInherited(
ItemBase);
14402 if (is_item && full_quantity)
14403 {
14406 }
14407 }
14408 else
14409 {
14411 return NULL;
14412 }
14413 return entity;
14414}
14415
14417{
14418 if (item)
14419 {
14420 if (health > 0)
14421 item.SetHealth("", "", health);
14422
14423 if (item.CanHaveTemperature())
14424 {
14426 if (item.CanFreeze())
14427 item.SetFrozen(false);
14428 }
14429
14430 if (item.HasEnergyManager())
14431 {
14432 if (quantity >= 0)
14433 {
14434 item.GetCompEM().SetEnergy0To1(quantity);
14435 }
14436 else
14437 {
14439 }
14440 }
14441 else if (item.IsMagazine())
14442 {
14443 Magazine mag = Magazine.Cast(item);
14444 if (quantity >= 0)
14445 {
14446 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14447 }
14448 else
14449 {
14451 }
14452
14453 }
14454 else
14455 {
14456 if (quantity >= 0)
14457 {
14458 item.SetQuantityNormalized(quantity, false);
14459 }
14460 else
14461 {
14463 }
14464
14465 }
14466 }
14467}
14468
14469#ifdef DEVELOPER
14471#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.