9694{
9696 {
9697 return true;
9698 }
9699};
9700
9701
9702
9704{
9708
9710
9713
9714
9715
9716
9717
9726
9732
9737
9742
9763 protected bool m_IsResultOfSplit
9764
9766
9771
9772
9773
9775
9779
9780
9781
9783
9786
9787
9788
9794
9795
9803
9806
9807
9809
9810
9812
9813
9818
9819
9824
9825
9827
9828
9830 {
9835
9836 if (!
GetGame().IsDedicatedServer())
9837 {
9839 {
9841
9843 {
9845 }
9846 }
9847
9850 }
9851
9852 m_OldLocation = null;
9853
9855 {
9857 }
9858
9859 if (ConfigIsExisting("headSelectionsToHide"))
9860 {
9863 }
9864
9866 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9867 {
9869 }
9870
9872
9873 m_IsResultOfSplit = false;
9874
9876 }
9877
9879 {
9880 super.InitItemVariables();
9881
9887 m_Count = ConfigGetInt(
"count");
9888
9891
9896
9899
9904
9916
9920
9921
9924 if (ConfigIsExisting("canBeSplit"))
9925 {
9928 }
9929
9931 if (ConfigIsExisting("itemBehaviour"))
9933
9934
9937 RegisterNetSyncVariableInt("m_VarLiquidType");
9938 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9939
9940 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9941 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9942 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9943
9944 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9945 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9946 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9947 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9948
9949 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9950 RegisterNetSyncVariableBool("m_IsTakeable");
9951 RegisterNetSyncVariableBool("m_IsHologram");
9952
9955 {
9958 }
9959
9961
9963 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9965
9966 }
9967
9969 {
9971 }
9972
9974 {
9977 {
9982 }
9983 }
9984
9985 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9986 {
9988 {
9991 }
9992
9994 }
9995
9997 {
10003 }
10004
10006
10008 {
10010
10011 if (!action)
10012 {
10013 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
10014 return;
10015 }
10016
10018 if (!ai)
10019 {
10021 return;
10022 }
10023
10025 if (!action_array)
10026 {
10027 action_array = new array<ActionBase_Basic>;
10029 }
10030 if (LogManager.IsActionLogEnable())
10031 {
10032 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
10033 }
10034
10035 if (action_array.Find(action) != -1)
10036 {
10037 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
10038 }
10039 else
10040 {
10041 action_array.Insert(action);
10042 }
10043 }
10044
10046 {
10048 ActionBase action = player.GetActionManager().GetAction(actionName);
10051
10052 if (action_array)
10053 {
10054 action_array.RemoveItem(action);
10055 }
10056 }
10057
10058
10059
10061 {
10062 ActionOverrideData overrideData = new ActionOverrideData();
10066
10068 if (!actionMap)
10069 {
10072 }
10073
10074 actionMap.Insert(this.
Type(), overrideData);
10075
10076 }
10077
10079
10081
10082
10084 {
10087
10090
10091 string config_to_search = "CfgVehicles";
10092 string muzzle_owner_config;
10093
10095 {
10096 if (IsInherited(Weapon))
10097 config_to_search = "CfgWeapons";
10098
10099 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10100
10101 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
10102
10104
10105 if (config_OnFire_subclass_count > 0)
10106 {
10107 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
10108
10109 for (int i = 0; i < config_OnFire_subclass_count; i++)
10110 {
10111 string particle_class = "";
10113 string config_OnFire_entry = config_OnFire_class + particle_class;
10114 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
10115 WPOF_array.Insert(WPOF);
10116 }
10117
10118
10120 }
10121 }
10122
10124 {
10125 config_to_search = "CfgWeapons";
10126 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10127
10128 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
10129
10131
10132 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
10133 {
10134 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
10135
10136 for (i = 0; i < config_OnBulletCasingEject_count; i++)
10137 {
10138 string particle_class2 = "";
10140 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
10141 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
10142 WPOBE_array.Insert(WPOBE);
10143 }
10144
10145
10147 }
10148 }
10149 }
10150
10151
10153 {
10156
10158 {
10159 string config_to_search = "CfgVehicles";
10160
10161 if (IsInherited(Weapon))
10162 config_to_search = "CfgWeapons";
10163
10164 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10165 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10166
10167 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10168 {
10169
10171
10173 {
10175 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10177 return;
10178 }
10179
10182
10183
10184
10186 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10187
10188 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10189 {
10190 string particle_class = "";
10192 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10194
10195 if (entry_type == CT_CLASS)
10196 {
10197 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10198 WPOOH_array.Insert(WPOF);
10199 }
10200 }
10201
10202
10204 }
10205 }
10206 }
10207
10209 {
10211 }
10212
10214 {
10216 {
10218
10221
10224
10225 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10226 }
10227 }
10228
10230 {
10232 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10233
10235 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10236
10238 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10239
10241 {
10243 }
10244 }
10245
10247 {
10249 }
10250
10252 {
10255 else
10257
10259 {
10262 }
10263 else
10264 {
10267
10270 }
10271
10273 }
10274
10276 {
10278 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10279 }
10280
10282 {
10284 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10286 }
10287
10289 {
10291 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10292 }
10293
10295 {
10298
10299 OverheatingParticle OP = new OverheatingParticle();
10304
10306 }
10307
10309 {
10312
10313 return -1;
10314 }
10315
10317 {
10319 {
10322
10323 for (int i = count; i > 0; --i)
10324 {
10325 int id = i - 1;
10328
10331
10332 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10333 {
10334 if (p)
10335 {
10338 }
10339 }
10340 }
10341 }
10342 }
10343
10345 {
10347 {
10349 {
10350 int id = i - 1;
10352
10353 if (OP)
10354 {
10356
10357 if (p)
10358 {
10360 }
10361
10362 delete OP;
10363 }
10364 }
10365
10368 }
10369 }
10370
10373 {
10374 return 0.0;
10375 }
10376
10377
10379 {
10380 return 250;
10381 }
10382
10384 {
10385 return 0;
10386 }
10387
10390 {
10392 return true;
10393
10394 return false;
10395 }
10396
10399 {
10402
10404 {
10406 }
10407 else
10408 {
10409
10411 }
10412
10414 }
10415
10422 {
10423 return -1;
10424 }
10425
10426
10427
10428
10430 {
10432 {
10434 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10435
10436 if (r_index >= 0)
10437 {
10438 InventoryLocation r_il = new InventoryLocation;
10439 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10440
10441 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10444 {
10445 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10446 }
10448 {
10449 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10450 }
10451
10452 }
10453
10454 player.GetHumanInventory().ClearUserReservedLocation(this);
10455 }
10456
10459 }
10460
10461
10462
10463
10465 {
10466 return ItemBase.m_DebugActionsMask;
10467 }
10468
10470 {
10471 return ItemBase.m_DebugActionsMask & mask;
10472 }
10473
10475 {
10476 ItemBase.m_DebugActionsMask = mask;
10477 }
10478
10480 {
10481 ItemBase.m_DebugActionsMask |= mask;
10482 }
10483
10485 {
10486 ItemBase.m_DebugActionsMask &= ~mask;
10487 }
10488
10490 {
10492 {
10494 }
10495 else
10496 {
10498 }
10499 }
10500
10501
10503 {
10504 if (GetEconomyProfile())
10505 {
10506 float q_max = GetEconomyProfile().GetQuantityMax();
10507 if (q_max > 0)
10508 {
10509 float q_min = GetEconomyProfile().GetQuantityMin();
10510 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10511
10513 {
10514 ComponentEnergyManager comp = GetCompEM();
10516 {
10518 }
10519 }
10521 {
10523
10524 }
10525
10526 }
10527 }
10528 }
10529
10532 {
10533 EntityAI parent = GetHierarchyParent();
10534
10535 if (parent)
10536 {
10537 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10538 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10539 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10540 }
10541 }
10542
10545 {
10546 EntityAI parent = GetHierarchyParent();
10547
10548 if (parent)
10549 {
10550 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10551 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10552 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10553 }
10554 }
10555
10557 {
10558
10559
10560
10561
10563
10565 {
10566 if (ScriptInputUserData.CanStoreInputUserData())
10567 {
10568 ScriptInputUserData ctx = new ScriptInputUserData;
10574 ctx.
Write(use_stack_max);
10577
10579 {
10580 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10581 }
10582 }
10583 }
10584 else if (!
GetGame().IsMultiplayer())
10585 {
10587 }
10588 }
10589
10591 {
10593 }
10594
10596 {
10598 }
10599
10601 {
10603 }
10604
10606 {
10607
10608 return false;
10609 }
10610
10612 {
10613 return false;
10614 }
10615
10619 {
10620 return false;
10621 }
10622
10624 {
10625 return "";
10626 }
10627
10629
10631 {
10632 return false;
10633 }
10634
10636 {
10637 return true;
10638 }
10639
10640
10641
10643 {
10644 return true;
10645 }
10646
10648 {
10649 return true;
10650 }
10651
10653 {
10654 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10656 }
10657
10659 {
10661 }
10662
10664 {
10666 if (!is_being_placed)
10668 SetSynchDirty();
10669 }
10670
10671
10673
10675 {
10677 }
10678
10680 {
10682 }
10683
10685 {
10686 return 1;
10687 }
10688
10690 {
10691 return false;
10692 }
10693
10695 {
10697 SetSynchDirty();
10698 }
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10735 {
10736 super.OnMovedInsideCargo(container);
10737
10738 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10739 }
10740
10741 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10742 {
10743 super.EEItemLocationChanged(oldLoc,newLoc);
10744
10745 PlayerBase new_player = null;
10746 PlayerBase old_player = null;
10747
10748 if (newLoc.GetParent())
10749 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10750
10751 if (oldLoc.GetParent())
10752 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10753
10755 {
10756 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10757
10758 if (r_index >= 0)
10759 {
10760 InventoryLocation r_il = new InventoryLocation;
10761 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10762
10763 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10766 {
10767 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10768 }
10770 {
10771 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10772 }
10773
10774 }
10775 }
10776
10778 {
10779 if (new_player)
10780 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10781
10782 if (new_player == old_player)
10783 {
10784
10785 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10786 {
10788 {
10789 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10790 {
10791 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10792 }
10793 }
10794 else
10795 {
10796 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10797 }
10798 }
10799
10800 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10801 {
10802 int type = oldLoc.GetType();
10804 {
10805 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10806 }
10808 {
10809 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10810 }
10811 }
10812 if (!m_OldLocation)
10813 {
10814 m_OldLocation = new InventoryLocation;
10815 }
10816 m_OldLocation.Copy(oldLoc);
10817 }
10818 else
10819 {
10820 if (m_OldLocation)
10821 {
10822 m_OldLocation.Reset();
10823 }
10824 }
10825
10827 }
10828 else
10829 {
10830 if (new_player)
10831 {
10832 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10833 if (res_index >= 0)
10834 {
10835 InventoryLocation il = new InventoryLocation;
10836 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10838 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10841 {
10842 il.
GetParent().GetOnReleaseLock().Invoke(it);
10843 }
10845 {
10847 }
10848
10849 }
10850 }
10852 {
10853
10855 }
10856
10857 if (m_OldLocation)
10858 {
10859 m_OldLocation.Reset();
10860 }
10861 }
10862 }
10863
10864 override void EOnContact(IEntity other, Contact extra)
10865 {
10867 {
10868 int liquidType = -1;
10870 if (impactSpeed > 0.0)
10871 {
10873 #ifndef SERVER
10875 #else
10877 SetSynchDirty();
10878 #endif
10880 }
10881 }
10882
10883 #ifdef SERVER
10884 if (GetCompEM() && GetCompEM().IsPlugged())
10885 {
10886 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10887 GetCompEM().UnplugThis();
10888 }
10889 #endif
10890 }
10891
10893
10895 {
10897 }
10898
10900 {
10901
10902 }
10903
10905 {
10906 super.OnItemLocationChanged(old_owner, new_owner);
10907
10908 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10909 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10910
10911 if (!relatedPlayer && playerNew)
10912 relatedPlayer = playerNew;
10913
10914 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10915 {
10917 if (actionMgr)
10918 {
10919 ActionBase currentAction = actionMgr.GetRunningAction();
10920 if (currentAction)
10922 }
10923 }
10924
10925 Man ownerPlayerOld = null;
10926 Man ownerPlayerNew = null;
10927
10928 if (old_owner)
10929 {
10930 if (old_owner.
IsMan())
10931 {
10932 ownerPlayerOld = Man.Cast(old_owner);
10933 }
10934 else
10935 {
10936 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10937 }
10938 }
10939 else
10940 {
10942 {
10944
10945 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10946 {
10947 GetCompEM().UnplugThis();
10948 }
10949 }
10950 }
10951
10952 if (new_owner)
10953 {
10954 if (new_owner.
IsMan())
10955 {
10956 ownerPlayerNew = Man.Cast(new_owner);
10957 }
10958 else
10959 {
10960 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10961 }
10962 }
10963
10964 if (ownerPlayerOld != ownerPlayerNew)
10965 {
10966 if (ownerPlayerOld)
10967 {
10968 array<EntityAI> subItemsExit = new array<EntityAI>;
10970 for (int i = 0; i < subItemsExit.Count(); i++)
10971 {
10974 }
10975 }
10976
10977 if (ownerPlayerNew)
10978 {
10979 array<EntityAI> subItemsEnter = new array<EntityAI>;
10981 for (int j = 0; j < subItemsEnter.Count(); j++)
10982 {
10985 }
10986 }
10987 }
10988 else if (ownerPlayerNew != null)
10989 {
10990 PlayerBase nplayer;
10991 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10992 {
10993 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10995 for (int k = 0; k < subItemsUpdate.Count(); k++)
10996 {
10998 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10999 }
11000 }
11001 }
11002
11003 if (old_owner)
11004 old_owner.OnChildItemRemoved(this);
11005 if (new_owner)
11006 new_owner.OnChildItemReceived(this);
11007 }
11008
11009
11011 {
11012 super.EEDelete(parent);
11013 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
11014 if (player)
11015 {
11017
11018 if (player.IsAlive())
11019 {
11020 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
11021 if (r_index >= 0)
11022 {
11023 InventoryLocation r_il = new InventoryLocation;
11024 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
11025
11026 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
11029 {
11030 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
11031 }
11033 {
11034 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
11035 }
11036
11037 }
11038
11039 player.RemoveQuickBarEntityShortcut(this);
11040 }
11041 }
11042 }
11043
11045 {
11046 super.EEKilled(killer);
11047
11050 {
11051 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
11052 {
11053 if (IsMagazine())
11054 {
11055 if (Magazine.Cast(this).GetAmmoCount() > 0)
11056 {
11058 }
11059 }
11060 else
11061 {
11063 }
11064 }
11065 }
11066 }
11067
11069 {
11070 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
11071
11072 super.OnWasAttached(parent, slot_id);
11073
11076
11078 }
11079
11081 {
11082 super.OnWasDetached(parent, slot_id);
11083
11086 }
11087
11089 {
11090 int idx;
11093
11094 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11095 if (inventory_slots.Count() < 1)
11096 {
11097 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
11098 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
11099 }
11100 else
11101 {
11102 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
11103 }
11104
11105 idx = inventory_slots.Find(slot);
11106 if (idx < 0)
11107 return "";
11108
11109 return attach_types.Get(idx);
11110 }
11111
11113 {
11114 int idx = -1;
11115 string slot;
11116
11119
11120 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11121 if (inventory_slots.Count() < 1)
11122 {
11123 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
11124 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11125 }
11126 else
11127 {
11128 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
11129 if (detach_types.Count() < 1)
11130 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11131 }
11132
11133 for (int i = 0; i < inventory_slots.Count(); i++)
11134 {
11135 slot = inventory_slots.Get(i);
11136 }
11137
11138 if (slot != "")
11139 {
11140 if (detach_types.Count() == 1)
11141 idx = 0;
11142 else
11143 idx = inventory_slots.Find(slot);
11144 }
11145 if (idx < 0)
11146 return "";
11147
11148 return detach_types.Get(idx);
11149 }
11150
11152 {
11153
11155
11156
11157 float min_time = 1;
11158 float max_time = 3;
11159 float delay = Math.RandomFloat(min_time, max_time);
11160
11161 explode_timer.Run(delay, this, "DoAmmoExplosion");
11162 }
11163
11165 {
11166 Magazine magazine = Magazine.Cast(this);
11167 int pop_sounds_count = 6;
11168 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11169
11170
11171 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11172 string sound_name = pop_sounds[ sound_idx ];
11174
11175
11176 magazine.ServerAddAmmoCount(-1);
11177
11178
11179 float min_temp_to_explode = 100;
11180
11181 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11182 {
11184 }
11185 }
11186
11187
11188 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11189 {
11190 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11191
11192 const int CHANCE_DAMAGE_CARGO = 4;
11193 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11194 const int CHANCE_DAMAGE_NOTHING = 2;
11195
11197 {
11198 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11199 int chances;
11200 int rnd;
11201
11202 if (GetInventory().GetCargo())
11203 {
11204 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11205 rnd = Math.RandomInt(0,chances);
11206
11207 if (rnd < CHANCE_DAMAGE_CARGO)
11208 {
11210 }
11211 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11212 {
11214 }
11215 }
11216 else
11217 {
11218 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11219 rnd = Math.RandomInt(0,chances);
11220
11221 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11222 {
11224 }
11225 }
11226 }
11227 }
11228
11230 {
11231 if (GetInventory().GetCargo())
11232 {
11233 int item_count = GetInventory().GetCargo().GetItemCount();
11234 if (item_count > 0)
11235 {
11236 int random_pick = Math.RandomInt(0, item_count);
11238 if (!item.IsExplosive())
11239 {
11240 item.AddHealth("","",damage);
11241 return true;
11242 }
11243 }
11244 }
11245 return false;
11246 }
11247
11249 {
11250 int attachment_count = GetInventory().AttachmentCount();
11251 if (attachment_count > 0)
11252 {
11253 int random_pick = Math.RandomInt(0, attachment_count);
11254 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11255 if (!attachment.IsExplosive())
11256 {
11257 attachment.AddHealth("","",damage);
11258 return true;
11259 }
11260 }
11261 return false;
11262 }
11263
11265 {
11267 }
11268
11270 {
11272 return GetInventory().CanRemoveEntity();
11273
11274 return false;
11275 }
11276
11278 {
11279
11281 return false;
11282
11283
11285 return false;
11286
11287
11288
11290 if (delta == 0)
11291 return false;
11292
11293
11294 return true;
11295 }
11296
11298 {
11300 {
11301 if (ScriptInputUserData.CanStoreInputUserData())
11302 {
11303 ScriptInputUserData ctx = new ScriptInputUserData;
11308 ctx.
Write(destination_entity);
11310 ctx.
Write(slot_id);
11312 }
11313 }
11314 else if (!
GetGame().IsMultiplayer())
11315 {
11317 }
11318 }
11319
11321 {
11322 float split_quantity_new;
11326 InventoryLocation loc = new InventoryLocation;
11327
11328 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11329 {
11331 split_quantity_new = stack_max;
11332 else
11334
11336 {
11337 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11338 if (new_item)
11339 {
11340 new_item.SetResultOfSplit(true);
11341 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11343 new_item.
SetQuantity(split_quantity_new,
false,
true);
11344 }
11345 }
11346 }
11347 else if (destination_entity && slot_id == -1)
11348 {
11349 if (quantity > stack_max)
11350 split_quantity_new = stack_max;
11351 else
11352 split_quantity_new = quantity;
11353
11355 {
11357 {
11360 }
11361
11362 if (new_item)
11363 {
11364 new_item.SetResultOfSplit(true);
11365 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11367 new_item.
SetQuantity(split_quantity_new,
false,
true);
11368 }
11369 }
11370 }
11371 else
11372 {
11373 if (stack_max != 0)
11374 {
11376 {
11378 }
11379
11380 if (split_quantity_new == 0)
11381 {
11382 if (!
GetGame().IsMultiplayer())
11383 player.PhysicalPredictiveDropItem(this);
11384 else
11385 player.ServerDropEntity(this);
11386 return;
11387 }
11388
11390 {
11392
11393 if (new_item)
11394 {
11395 new_item.SetResultOfSplit(true);
11396 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11399 new_item.PlaceOnSurface();
11400 }
11401 }
11402 }
11403 }
11404 }
11405
11407 {
11408 float split_quantity_new;
11412 InventoryLocation loc = new InventoryLocation;
11413
11414 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11415 {
11417 split_quantity_new = stack_max;
11418 else
11420
11422 {
11423 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11424 if (new_item)
11425 {
11426 new_item.SetResultOfSplit(true);
11427 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11429 new_item.
SetQuantity(split_quantity_new,
false,
true);
11430 }
11431 }
11432 }
11433 else if (destination_entity && slot_id == -1)
11434 {
11435 if (quantity > stack_max)
11436 split_quantity_new = stack_max;
11437 else
11438 split_quantity_new = quantity;
11439
11441 {
11443 {
11446 }
11447
11448 if (new_item)
11449 {
11450 new_item.SetResultOfSplit(true);
11451 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11453 new_item.
SetQuantity(split_quantity_new,
false,
true);
11454 }
11455 }
11456 }
11457 else
11458 {
11459 if (stack_max != 0)
11460 {
11462 {
11464 }
11465
11467 {
11469
11470 if (new_item)
11471 {
11472 new_item.SetResultOfSplit(true);
11473 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11476 new_item.PlaceOnSurface();
11477 }
11478 }
11479 }
11480 }
11481 }
11482
11484 {
11486 {
11487 if (ScriptInputUserData.CanStoreInputUserData())
11488 {
11489 ScriptInputUserData ctx = new ScriptInputUserData;
11494 dst.WriteToContext(ctx);
11496 }
11497 }
11498 else if (!
GetGame().IsMultiplayer())
11499 {
11501 }
11502 }
11503
11505 {
11507 {
11508 if (ScriptInputUserData.CanStoreInputUserData())
11509 {
11510 ScriptInputUserData ctx = new ScriptInputUserData;
11515 ctx.
Write(destination_entity);
11521 }
11522 }
11523 else if (!
GetGame().IsMultiplayer())
11524 {
11526 }
11527 }
11528
11530 {
11532 }
11533
11535 {
11537 float split_quantity_new;
11539 if (dst.IsValid())
11540 {
11541 int slot_id = dst.GetSlot();
11543
11544 if (quantity > stack_max)
11545 split_quantity_new = stack_max;
11546 else
11547 split_quantity_new = quantity;
11548
11550 {
11552
11553 if (new_item)
11554 {
11555 new_item.SetResultOfSplit(true);
11556 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11558 new_item.
SetQuantity(split_quantity_new,
false,
true);
11559 }
11560
11561 return new_item;
11562 }
11563 }
11564
11565 return null;
11566 }
11567
11569 {
11571 float split_quantity_new;
11573 if (destination_entity)
11574 {
11576 if (quantity > stackable)
11577 split_quantity_new = stackable;
11578 else
11579 split_quantity_new = quantity;
11580
11582 {
11583 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11584 if (new_item)
11585 {
11586 new_item.SetResultOfSplit(true);
11587 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11589 new_item.
SetQuantity(split_quantity_new,
false,
true);
11590 }
11591 }
11592 }
11593 }
11594
11596 {
11598 {
11599 if (ScriptInputUserData.CanStoreInputUserData())
11600 {
11601 ScriptInputUserData ctx = new ScriptInputUserData;
11606 ItemBase destination_entity =
this;
11607 ctx.
Write(destination_entity);
11611 }
11612 }
11613 else if (!
GetGame().IsMultiplayer())
11614 {
11616 }
11617 }
11618
11620 {
11622 float split_quantity_new;
11624 if (player)
11625 {
11627 if (quantity > stackable)
11628 split_quantity_new = stackable;
11629 else
11630 split_quantity_new = quantity;
11631
11633 {
11634 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11635 new_item =
ItemBase.Cast(in_hands);
11636 if (new_item)
11637 {
11638 new_item.SetResultOfSplit(true);
11639 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11641 new_item.SetQuantity(split_quantity_new, false, true);
11642 }
11643 }
11644 }
11645 }
11646
11648 {
11650 float split_quantity_new = Math.Floor(quantity * 0.5);
11651
11653 return;
11654
11656
11657 if (new_item)
11658 {
11659 if (new_item.GetQuantityMax() < split_quantity_new)
11660 {
11661 split_quantity_new = new_item.GetQuantityMax();
11662 }
11663
11664 new_item.SetResultOfSplit(true);
11665 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11666
11668 {
11671 }
11672 else
11673 {
11675 new_item.
SetQuantity(split_quantity_new,
false,
true);
11676 }
11677 }
11678 }
11679
11681 {
11683 float split_quantity_new = Math.Floor(quantity / 2);
11684
11686 return;
11687
11688 InventoryLocation invloc = new InventoryLocation;
11690
11692 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11693
11694 if (new_item)
11695 {
11696 if (new_item.GetQuantityMax() < split_quantity_new)
11697 {
11698 split_quantity_new = new_item.GetQuantityMax();
11699 }
11701 {
11704 }
11705 else if (split_quantity_new > 1)
11706 {
11708 new_item.
SetQuantity(split_quantity_new,
false,
true);
11709 }
11710 }
11711 }
11712
11715 {
11716 SetWeightDirty();
11718
11719 if (parent)
11720 parent.OnAttachmentQuantityChangedEx(this, delta);
11721
11723 {
11725 {
11727 }
11729 {
11730 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11732 }
11733 }
11734
11735 }
11736
11739 {
11740
11741 }
11742
11745 {
11747 }
11748
11750 {
11751 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11752
11754 {
11755 if (newLevel == GameConstants.STATE_RUINED)
11756 {
11758 EntityAI parent = GetHierarchyParent();
11759 if (parent && parent.IsFireplace())
11760 {
11761 CargoBase cargo = GetInventory().GetCargo();
11762 if (cargo)
11763 {
11765 {
11767 }
11768 }
11769 }
11770 }
11771
11773 {
11774
11776 return;
11777 }
11778
11779 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11780 {
11782 }
11783 }
11784 }
11785
11786
11788 {
11789 super.OnRightClick();
11790
11792 {
11794 {
11795 if (ScriptInputUserData.CanStoreInputUserData())
11796 {
11797 EntityAI root = GetHierarchyRoot();
11798 Man playerOwner = GetHierarchyRootPlayer();
11799 InventoryLocation dst = new InventoryLocation;
11800
11801
11802 if (!playerOwner && root && root == this)
11803 {
11805 }
11806 else
11807 {
11808
11809 GetInventory().GetCurrentInventoryLocation(dst);
11811 {
11814 {
11816 }
11817 else
11818 {
11820
11821
11822 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11823 {
11825 }
11826 else
11827 {
11828 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11829 }
11830 }
11831 }
11832 }
11833
11834 ScriptInputUserData ctx = new ScriptInputUserData;
11842 }
11843 }
11844 else if (!
GetGame().IsMultiplayer())
11845 {
11847 }
11848 }
11849 }
11850
11852 {
11853 if (root)
11854 {
11855 vector m4[4];
11856 root.GetTransform(m4);
11857 dst.SetGround(this, m4);
11858 }
11859 else
11860 {
11861 GetInventory().GetCurrentInventoryLocation(dst);
11862 }
11863 }
11864
11865 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11866 {
11867
11868 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11869 return false;
11870
11871 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11872 return false;
11873
11874
11876 return false;
11877
11878
11879 Magazine mag = Magazine.Cast(this);
11880 if (mag)
11881 {
11882 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11883 return false;
11884
11885 if (stack_max_limit)
11886 {
11887 Magazine other_mag = Magazine.Cast(other_item);
11888 if (other_item)
11889 {
11890 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11891 return false;
11892 }
11893
11894 }
11895 }
11896 else
11897 {
11898
11900 return false;
11901
11903 return false;
11904 }
11905
11906 PlayerBase player = null;
11907 if (CastTo(player, GetHierarchyRootPlayer()))
11908 {
11909 if (player.GetInventory().HasAttachment(this))
11910 return false;
11911
11912 if (player.IsItemsToDelete())
11913 return false;
11914 }
11915
11916 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11917 return false;
11918
11919 int slotID;
11921 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11922 return false;
11923
11924 return true;
11925 }
11926
11928 {
11930 }
11931
11933 {
11934 return m_IsResultOfSplit;
11935 }
11936
11938 {
11939 m_IsResultOfSplit = value;
11940 }
11941
11943 {
11945 }
11946
11948 {
11949 float other_item_quantity = other_item.GetQuantity();
11950 float this_free_space;
11951
11953
11955
11956 if (other_item_quantity > this_free_space)
11957 {
11958 return this_free_space;
11959 }
11960 else
11961 {
11962 return other_item_quantity;
11963 }
11964 }
11965
11967 {
11969 }
11970
11972 {
11974 return;
11975
11976 if (!IsMagazine() && other_item)
11977 {
11979 if (quantity_used != 0)
11980 {
11981 float hp1 = GetHealth01("","");
11982 float hp2 = other_item.GetHealth01("","");
11983 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11984 hpResult = hpResult / (
GetQuantity() + quantity_used);
11985
11986 hpResult *= GetMaxHealth();
11987 Math.Round(hpResult);
11988 SetHealth("", "Health", hpResult);
11989
11991 other_item.AddQuantity(-quantity_used);
11992 }
11993 }
11995 }
11996
11998 {
11999 #ifdef SERVER
12000 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
12001 GetHierarchyParent().IncreaseLifetimeUp();
12002 #endif
12003 };
12004
12006 {
12007 PlayerBase p = PlayerBase.Cast(player);
12008
12009 array<int> recipesIds = p.m_Recipes;
12010 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12011 if (moduleRecipesManager)
12012 {
12013 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
12014 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
12015 }
12016
12017 for (int i = 0;i < recipesIds.Count(); i++)
12018 {
12019 int key = recipesIds.Get(i);
12020 string recipeName = moduleRecipesManager.GetRecipeName(key);
12022 }
12023 }
12024
12025
12026 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
12027 {
12028 super.GetDebugActions(outputList);
12029
12030
12036
12037
12042
12047
12048
12052
12053
12055 {
12059 }
12060
12063
12064
12068
12070
12071 InventoryLocation loc = new InventoryLocation();
12072 GetInventory().GetCurrentInventoryLocation(loc);
12074 {
12075 if (Gizmo_IsSupported())
12078 }
12079
12081 }
12082
12083
12084
12085
12087 {
12088 super.OnAction(action_id, player, ctx);
12089
12091 {
12092 switch (action_id)
12093 {
12096 return true;
12099 return true;
12100 }
12101 }
12102
12104 {
12105 switch (action_id)
12106 {
12108 Delete();
12109 return true;
12110 }
12111 }
12112
12113 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
12114 {
12115 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12116 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
12117 PlayerBase p = PlayerBase.Cast(player);
12118 if (
EActions.RECIPES_RANGE_START < 1000)
12119 {
12120 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
12121 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
12122 }
12123 }
12124 #ifndef SERVER
12125 else if (action_id ==
EActions.WATCH_PLAYER)
12126 {
12127 PluginDeveloper.SetDeveloperItemClientEx(player);
12128 }
12129 #endif
12131 {
12132 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
12133 {
12134 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
12135 OnDebugButtonPressServer(id + 1);
12136 }
12137
12138 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
12139 {
12140 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
12142 }
12143
12144 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
12145 {
12146 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
12148 }
12149
12150 else if (action_id ==
EActions.ADD_QUANTITY)
12151 {
12152 if (IsMagazine())
12153 {
12154 Magazine mag = Magazine.Cast(this);
12155 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
12156 }
12157 else
12158 {
12160 }
12161
12162 if (m_EM)
12163 {
12164 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12165 }
12166
12167 }
12168
12169 else if (action_id ==
EActions.REMOVE_QUANTITY)
12170 {
12171 if (IsMagazine())
12172 {
12173 Magazine mag2 = Magazine.Cast(this);
12174 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12175 }
12176 else
12177 {
12179 }
12180 if (m_EM)
12181 {
12182 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12183 }
12184
12185 }
12186
12187 else if (action_id ==
EActions.SET_QUANTITY_0)
12188 {
12190
12191 if (m_EM)
12192 {
12193 m_EM.SetEnergy(0);
12194 }
12195 }
12196
12197 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12198 {
12200
12201 if (m_EM)
12202 {
12203 m_EM.SetEnergy(m_EM.GetEnergyMax());
12204 }
12205 }
12206
12207 else if (action_id ==
EActions.ADD_HEALTH)
12208 {
12209 AddHealth("","",GetMaxHealth("","Health")/5);
12210 }
12211 else if (action_id ==
EActions.REMOVE_HEALTH)
12212 {
12213 AddHealth("","",-GetMaxHealth("","Health")/5);
12214 }
12215 else if (action_id ==
EActions.DESTROY_HEALTH)
12216 {
12217 SetHealth01("","",0);
12218 }
12219 else if (action_id ==
EActions.WATCH_ITEM)
12220 {
12222 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12223 #ifdef DEVELOPER
12224 SetDebugDeveloper_item(this);
12225 #endif
12226 }
12227
12228 else if (action_id ==
EActions.ADD_TEMPERATURE)
12229 {
12230 AddTemperature(20);
12231
12232 }
12233
12234 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12235 {
12236 AddTemperature(-20);
12237
12238 }
12239
12240 else if (action_id ==
EActions.FLIP_FROZEN)
12241 {
12242 SetFrozen(!GetIsFrozen());
12243
12244 }
12245
12246 else if (action_id ==
EActions.ADD_WETNESS)
12247 {
12249
12250 }
12251
12252 else if (action_id ==
EActions.REMOVE_WETNESS)
12253 {
12255
12256 }
12257
12258 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12259 {
12262
12263
12264 }
12265
12266 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12267 {
12270 }
12271
12272 else if (action_id ==
EActions.MAKE_SPECIAL)
12273 {
12274 auto debugParams = DebugSpawnParams.WithPlayer(player);
12275 OnDebugSpawnEx(debugParams);
12276 }
12277
12278 }
12279
12280
12281 return false;
12282 }
12283
12284
12285
12286
12290
12293
12294
12295
12297 {
12298 return false;
12299 }
12300
12301
12303 {
12304 return true;
12305 }
12306
12307
12309 {
12310 return true;
12311 }
12312
12313
12314
12316 {
12317 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12319 }
12320
12323 {
12324 return null;
12325 }
12326
12328 {
12329 return false;
12330 }
12331
12333 {
12334 return false;
12335 }
12336
12340
12341
12343 {
12344 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12345 return module_repairing.CanRepair(this, item_repair_kit);
12346 }
12347
12348
12349 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12350 {
12351 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12352 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12353 }
12354
12355
12357 {
12358
12359
12360
12361
12362
12363
12364
12365
12366 return 1;
12367 }
12368
12369
12370
12372 {
12374 }
12375
12376
12377
12379 {
12381 }
12382
12383
12392 {
12393 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12394
12395 if (player)
12396 {
12397 player.MessageStatus(text);
12398 }
12399 }
12400
12401
12410 {
12411 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12412
12413 if (player)
12414 {
12415 player.MessageAction(text);
12416 }
12417 }
12418
12419
12428 {
12429 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12430
12431 if (player)
12432 {
12433 player.MessageFriendly(text);
12434 }
12435 }
12436
12437
12446 {
12447 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12448
12449 if (player)
12450 {
12451 player.MessageImportant(text);
12452 }
12453 }
12454
12456 {
12457 return true;
12458 }
12459
12460
12461 override bool KindOf(
string tag)
12462 {
12463 bool found = false;
12464 string item_name = this.
GetType();
12467
12468 int array_size = item_tag_array.Count();
12469 for (int i = 0; i < array_size; i++)
12470 {
12471 if (item_tag_array.Get(i) == tag)
12472 {
12473 found = true;
12474 break;
12475 }
12476 }
12477 return found;
12478 }
12479
12480
12482 {
12483
12484 super.OnRPC(sender, rpc_type,ctx);
12485
12486
12487 switch (rpc_type)
12488 {
12489 #ifndef SERVER
12490 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12491 Param2<bool, string> p = new Param2<bool, string>(false, "");
12492
12494 return;
12495
12496 bool play = p.param1;
12497 string soundSet = p.param2;
12498
12499 if (play)
12500 {
12502 {
12504 {
12506 }
12507 }
12508 else
12509 {
12511 }
12512 }
12513 else
12514 {
12516 }
12517
12518 break;
12519 #endif
12520
12521 }
12522
12524 {
12526 }
12527 }
12528
12529
12530
12531
12533 {
12534 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12535 return plugin.GetID(
name);
12536 }
12537
12539 {
12540 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12541 return plugin.GetName(id);
12542 }
12543
12546 {
12547
12548
12549 int varFlags;
12550 if (!ctx.
Read(varFlags))
12551 return;
12552
12553 if (varFlags & ItemVariableFlags.FLOAT)
12554 {
12556 }
12557 }
12558
12560 {
12561
12562 super.SerializeNumericalVars(floats_out);
12563
12564
12565
12567 {
12569 }
12570
12572 {
12574 }
12575
12577 {
12579 }
12580
12582 {
12587 }
12588
12590 {
12592 }
12593 }
12594
12596 {
12597
12598 super.DeSerializeNumericalVars(floats);
12599
12600
12601 int index = 0;
12602 int mask = Math.Round(floats.Get(index));
12603
12604 index++;
12605
12607 {
12609 {
12611 }
12612 else
12613 {
12614 float quantity = floats.Get(index);
12615 SetQuantity(quantity,
true,
false,
false,
false);
12616 }
12617 index++;
12618 }
12619
12621 {
12622 float wet = floats.Get(index);
12624 index++;
12625 }
12626
12628 {
12629 int liquidtype = Math.Round(floats.Get(index));
12631 index++;
12632 }
12633
12635 {
12637 index++;
12639 index++;
12641 index++;
12643 index++;
12644 }
12645
12647 {
12648 int cleanness = Math.Round(floats.Get(index));
12650 index++;
12651 }
12652 }
12653
12655 {
12656 super.WriteVarsToCTX(ctx);
12657
12658
12660 {
12662 }
12663
12665 {
12667 }
12668
12670 {
12672 }
12673
12675 {
12676 int r,g,b,a;
12682 }
12683
12685 {
12687 }
12688 }
12689
12691 {
12692 if (!super.ReadVarsFromCTX(ctx,version))
12693 return false;
12694
12695 int intValue;
12696 float value;
12697
12698 if (version < 140)
12699 {
12700 if (!ctx.
Read(intValue))
12701 return false;
12702
12703 m_VariablesMask = intValue;
12704 }
12705
12707 {
12708 if (!ctx.
Read(value))
12709 return false;
12710
12712 {
12714 }
12715 else
12716 {
12718 }
12719 }
12720
12721 if (version < 140)
12722 {
12724 {
12725 if (!ctx.
Read(value))
12726 return false;
12727 SetTemperatureDirect(value);
12728 }
12729 }
12730
12732 {
12733 if (!ctx.
Read(value))
12734 return false;
12736 }
12737
12739 {
12740 if (!ctx.
Read(intValue))
12741 return false;
12743 }
12744
12746 {
12747 int r,g,b,a;
12749 return false;
12751 return false;
12753 return false;
12755 return false;
12756
12758 }
12759
12761 {
12762 if (!ctx.
Read(intValue))
12763 return false;
12765 }
12766
12767 if (version >= 138 && version < 140)
12768 {
12770 {
12771 if (!ctx.
Read(intValue))
12772 return false;
12773 SetFrozen(intValue);
12774 }
12775 }
12776
12777 return true;
12778 }
12779
12780
12782 {
12785 {
12787 }
12788
12789 if (!super.OnStoreLoad(ctx, version))
12790 {
12792 return false;
12793 }
12794
12795 if (version >= 114)
12796 {
12797 bool hasQuickBarIndexSaved;
12798
12799 if (!ctx.
Read(hasQuickBarIndexSaved))
12800 {
12802 return false;
12803 }
12804
12805 if (hasQuickBarIndexSaved)
12806 {
12807 int itmQBIndex;
12808
12809
12810 if (!ctx.
Read(itmQBIndex))
12811 {
12813 return false;
12814 }
12815
12816 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12817 if (itmQBIndex != -1 && parentPlayer)
12818 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12819 }
12820 }
12821 else
12822 {
12823
12824 PlayerBase player;
12825 int itemQBIndex;
12826 if (version ==
int.
MAX)
12827 {
12828 if (!ctx.
Read(itemQBIndex))
12829 {
12831 return false;
12832 }
12833 }
12834 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12835 {
12836
12837 if (!ctx.
Read(itemQBIndex))
12838 {
12840 return false;
12841 }
12842 if (itemQBIndex != -1 && player)
12843 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12844 }
12845 }
12846
12847 if (version < 140)
12848 {
12849
12850 if (!LoadVariables(ctx, version))
12851 {
12853 return false;
12854 }
12855 }
12856
12857
12859 {
12861 return false;
12862 }
12863 if (version >= 132)
12864 {
12866 if (raib)
12867 {
12869 {
12871 return false;
12872 }
12873 }
12874 }
12875
12877 return true;
12878 }
12879
12880
12881
12883 {
12884 super.OnStoreSave(ctx);
12885
12886 PlayerBase player;
12887 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12888 {
12890
12891 int itemQBIndex = -1;
12892 itemQBIndex = player.FindQuickBarEntityIndex(this);
12893 ctx.
Write(itemQBIndex);
12894 }
12895 else
12896 {
12898 }
12899
12901
12903 if (raib)
12904 {
12906 }
12907 }
12908
12909
12911 {
12912 super.AfterStoreLoad();
12913
12915 {
12917 }
12918
12920 {
12923 }
12924 }
12925
12927 {
12928 super.EEOnAfterLoad();
12929
12931 {
12933 }
12934
12937 }
12938
12940 {
12941 return false;
12942 }
12943
12944
12945
12947 {
12949 {
12950 #ifdef PLATFORM_CONSOLE
12951
12953 {
12955 if (menu)
12956 {
12958 }
12959 }
12960 #endif
12961 }
12962
12964 {
12967 }
12968
12970 {
12971 SetWeightDirty();
12973 }
12975 {
12978 }
12979
12981 {
12984 }
12986 {
12989 }
12990
12991 super.OnVariablesSynchronized();
12992 }
12993
12994
12995
12997 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12998 {
12999 if (!IsServerCheck(allow_client))
13000 return false;
13001
13003 return false;
13004
13007
13008 if (value <= (min + 0.001))
13009 value = min;
13010
13011 if (value == min)
13012 {
13013 if (destroy_config)
13014 {
13015 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
13016 if (dstr)
13017 {
13019 this.Delete();
13020 return true;
13021 }
13022 }
13023 else if (destroy_forced)
13024 {
13026 this.Delete();
13027 return true;
13028 }
13029
13031 }
13032
13035
13037 {
13039
13040 if (delta)
13042 }
13043
13045
13046 return false;
13047 }
13048
13049
13051 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
13052 {
13054 }
13055
13057 {
13060 }
13061
13063 {
13066 }
13067
13069 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
13070 {
13071 float value_clamped = Math.Clamp(value, 0, 1);
13073 SetQuantity(result, destroy_config, destroy_forced);
13074 }
13075
13076
13079 {
13081 }
13082
13084 {
13086 }
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13098 {
13099 int slot = -1;
13100 if (GetInventory())
13101 {
13102 InventoryLocation il = new InventoryLocation;
13103 GetInventory().GetCurrentInventoryLocation(il);
13105 }
13106
13108 }
13109
13111 {
13112 float quantity_max = 0;
13113
13115 {
13116 if (attSlotID != -1)
13117 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
13118
13119 if (quantity_max <= 0)
13121 }
13122
13123 if (quantity_max <= 0)
13125
13126 return quantity_max;
13127 }
13128
13130 {
13132 }
13133
13135 {
13137 }
13138
13139
13141 {
13143 }
13144
13146 {
13148 }
13149
13151 {
13153 }
13154
13155
13157 {
13158
13159 float weightEx = GetWeightEx();
13160 float special = GetInventoryAndCargoWeight();
13161 return weightEx - special;
13162 }
13163
13164
13166 {
13168 }
13169
13171 {
13173 {
13174 #ifdef DEVELOPER
13175 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13176 {
13177 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13179 }
13180 #endif
13181
13182 return GetQuantity() * GetConfigWeightModified();
13183 }
13184 else if (HasEnergyManager())
13185 {
13186 #ifdef DEVELOPER
13187 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13188 {
13189 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13190 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13191 }
13192 #endif
13193 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13194 }
13195 else
13196 {
13197 #ifdef DEVELOPER
13198 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13199 {
13200 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13201 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13202 }
13203 #endif
13204 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13205 }
13206 }
13207
13210 {
13211 int item_count = 0;
13213
13214 if (GetInventory().GetCargo() != NULL)
13215 {
13216 item_count = GetInventory().GetCargo().GetItemCount();
13217 }
13218
13219 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13220 {
13221 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13222 if (item)
13223 item_count += item.GetNumberOfItems();
13224 }
13225 return item_count;
13226 }
13227
13230 {
13231 float weight = 0;
13232 float wetness = 1;
13233 if (include_wetness)
13236 {
13237 weight = wetness * m_ConfigWeight;
13238 }
13240 {
13241 weight = 1;
13242 }
13243 return weight;
13244 }
13245
13246
13247
13249 {
13250 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13251 {
13252 GameInventory inv = GetInventory();
13253 array<EntityAI> items = new array<EntityAI>;
13255 for (int i = 0; i < items.Count(); i++)
13256 {
13258 if (item)
13259 {
13261 }
13262 }
13263 }
13264 }
13265
13266
13267
13268
13270 {
13271 float energy = 0;
13272 if (HasEnergyManager())
13273 {
13274 energy = GetCompEM().GetEnergy();
13275 }
13276 return energy;
13277 }
13278
13279
13281 {
13282 super.OnEnergyConsumed();
13283
13285 }
13286
13288 {
13289 super.OnEnergyAdded();
13290
13292 }
13293
13294
13296 {
13297 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13298 {
13300 {
13301 float energy_0to1 = GetCompEM().GetEnergy0To1();
13303 }
13304 }
13305 }
13306
13307
13309 {
13310 return ConfigGetFloat("heatIsolation");
13311 }
13312
13314 {
13316 }
13317
13319 {
13320 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13321 if (
GetGame().ConfigIsExisting(paramPath))
13323
13324 return 0.0;
13325 }
13326
13328 {
13329 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13330 if (
GetGame().ConfigIsExisting(paramPath))
13332
13333 return 0.0;
13334 }
13335
13336 override void SetWet(
float value,
bool allow_client =
false)
13337 {
13338 if (!IsServerCheck(allow_client))
13339 return;
13340
13343
13345
13346 m_VarWet = Math.Clamp(value, min, max);
13347
13349 {
13352 }
13353 }
13354
13355 override void AddWet(
float value)
13356 {
13358 }
13359
13361 {
13363 }
13364
13366 {
13368 }
13369
13371 {
13373 }
13374
13376 {
13378 }
13379
13381 {
13383 }
13384
13385 override void OnWetChanged(
float newVal,
float oldVal)
13386 {
13389 if (newLevel != oldLevel)
13390 {
13392 }
13393 }
13394
13396 {
13397 SetWeightDirty();
13398 }
13399
13401 {
13402 return GetWetLevelInternal(
m_VarWet);
13403 }
13404
13405
13406
13408 {
13410 }
13411
13413 {
13415 }
13416
13418 {
13420 }
13421
13423 {
13425 }
13426
13427
13428
13430 {
13431 if (ConfigIsExisting("itemModelLength"))
13432 {
13433 return ConfigGetFloat("itemModelLength");
13434 }
13435 return 0;
13436 }
13437
13439 {
13440 if (ConfigIsExisting("itemAttachOffset"))
13441 {
13442 return ConfigGetFloat("itemAttachOffset");
13443 }
13444 return 0;
13445 }
13446
13447 override void SetCleanness(
int value,
bool allow_client =
false)
13448 {
13449 if (!IsServerCheck(allow_client))
13450 return;
13451
13453
13455
13458 }
13459
13461 {
13463 }
13464
13466 {
13467 return true;
13468 }
13469
13470
13471
13472
13474 {
13476 }
13477
13479 {
13481 }
13482
13483
13484
13485
13486 override void SetColor(
int r,
int g,
int b,
int a)
13487 {
13493 }
13495 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13496 {
13501 }
13502
13504 {
13506 }
13507
13510 {
13511 int r,g,b,a;
13513 r = r/255;
13514 g = g/255;
13515 b = b/255;
13516 a = a/255;
13517 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13518 }
13519
13520
13521
13522 override void SetLiquidType(
int value,
bool allow_client =
false)
13523 {
13524 if (!IsServerCheck(allow_client))
13525 return;
13526
13531 }
13532
13534 {
13535 return ConfigGetInt("varLiquidTypeInit");
13536 }
13537
13539 {
13541 }
13542
13544 {
13546 SetFrozen(false);
13547 }
13548
13551 {
13552 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13553 }
13554
13555
13558 {
13559 PlayerBase nplayer;
13560 if (PlayerBase.CastTo(nplayer, player))
13561 {
13563
13564 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13565 }
13566 }
13567
13568
13571 {
13572 PlayerBase nplayer;
13573 if (PlayerBase.CastTo(nplayer,player))
13574 {
13575
13576 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13577
13578 }
13579
13580
13581 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13582
13583
13584 if (HasEnergyManager())
13585 {
13586 GetCompEM().UpdatePlugState();
13587 }
13588 }
13589
13590
13592 {
13593 super.OnPlacementStarted(player);
13594
13596 }
13597
13598 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13599 {
13601 {
13602 m_AdminLog.OnPlacementComplete(player,
this);
13603 }
13604
13605 super.OnPlacementComplete(player, position, orientation);
13606 }
13607
13608
13609
13610
13611
13613 {
13615 {
13616 return true;
13617 }
13618 else
13619 {
13620 return false;
13621 }
13622 }
13623
13624
13626 {
13628 {
13630 }
13631 }
13632
13633
13635 {
13637 }
13638
13640 {
13642 }
13643
13644 override void InsertAgent(
int agent,
float count = 1)
13645 {
13646 if (count < 1)
13647 return;
13648
13650 }
13651
13654 {
13656 }
13657
13658
13660 {
13662 }
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13706 {
13708 return false;
13709 return true;
13710 }
13711
13713 {
13714
13716 }
13717
13718
13721 {
13722 super.CheckForRoofLimited(timeTresholdMS);
13723
13725 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13726 {
13727 m_PreviousRoofTestTime = time;
13728 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13729 }
13730 }
13731
13732
13734 {
13736 {
13737 return 0;
13738 }
13739
13740 if (GetInventory().GetAttachmentSlotsCount() != 0)
13741 {
13742 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13743 if (filter)
13744 return filter.GetProtectionLevel(type, false, system);
13745 else
13746 return 0;
13747 }
13748
13749 string subclassPath, entryName;
13750
13751 switch (type)
13752 {
13754 entryName = "biological";
13755 break;
13757 entryName = "chemical";
13758 break;
13759 default:
13760 entryName = "biological";
13761 break;
13762 }
13763
13764 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13765
13767 }
13768
13769
13770
13773 {
13774 if (!IsMagazine())
13776
13778 }
13779
13780
13781
13782
13783
13788 {
13789 return true;
13790 }
13791
13793 {
13795 }
13796
13797
13798
13799
13800
13802 {
13803 if (parent)
13804 {
13805 if (parent.IsInherited(DayZInfected))
13806 return true;
13807
13808 if (!parent.IsRuined())
13809 return true;
13810 }
13811
13812 return true;
13813 }
13814
13816 {
13817 if (!super.CanPutAsAttachment(parent))
13818 {
13819 return false;
13820 }
13821
13822 if (!IsRuined() && !parent.IsRuined())
13823 {
13824 return true;
13825 }
13826
13827 return false;
13828 }
13829
13831 {
13832
13833
13834
13835
13836 return super.CanReceiveItemIntoCargo(item);
13837 }
13838
13840 {
13841
13842
13843
13844
13845 GameInventory attachmentInv = attachment.GetInventory();
13847 {
13848 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13849 return false;
13850 }
13851
13852 InventoryLocation loc = new InventoryLocation();
13853 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13854 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13855 return false;
13856
13857 return super.CanReceiveAttachment(attachment, slotId);
13858 }
13859
13861 {
13862 if (!super.CanReleaseAttachment(attachment))
13863 return false;
13864
13865 return GetInventory().AreChildrenAccessible();
13866 }
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13889 {
13890 int id = muzzle_owner.GetMuzzleID();
13891 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13892
13893 if (WPOF_array)
13894 {
13895 for (int i = 0; i < WPOF_array.Count(); i++)
13896 {
13897 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13898
13899 if (WPOF)
13900 {
13901 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13902 }
13903 }
13904 }
13905 }
13906
13907
13909 {
13910 int id = muzzle_owner.GetMuzzleID();
13912
13913 if (WPOBE_array)
13914 {
13915 for (int i = 0; i < WPOBE_array.Count(); i++)
13916 {
13917 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13918
13919 if (WPOBE)
13920 {
13921 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13922 }
13923 }
13924 }
13925 }
13926
13927
13929 {
13930 int id = muzzle_owner.GetMuzzleID();
13931 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13932
13933 if (WPOOH_array)
13934 {
13935 for (int i = 0; i < WPOOH_array.Count(); i++)
13936 {
13937 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13938
13939 if (WPOOH)
13940 {
13941 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13942 }
13943 }
13944 }
13945 }
13946
13947
13949 {
13950 int id = muzzle_owner.GetMuzzleID();
13951 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13952
13953 if (WPOOH_array)
13954 {
13955 for (int i = 0; i < WPOOH_array.Count(); i++)
13956 {
13957 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13958
13959 if (WPOOH)
13960 {
13961 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13962 }
13963 }
13964 }
13965 }
13966
13967
13969 {
13970 int id = muzzle_owner.GetMuzzleID();
13971 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13972
13973 if (WPOOH_array)
13974 {
13975 for (int i = 0; i < WPOOH_array.Count(); i++)
13976 {
13977 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13978
13979 if (WPOOH)
13980 {
13981 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13982 }
13983 }
13984 }
13985 }
13986
13987
13988
13990 {
13992 {
13993 return true;
13994 }
13995
13996 return false;
13997 }
13998
14000 {
14002 {
14003 return true;
14004 }
14005
14006 return false;
14007 }
14008
14010 {
14012 {
14013 return true;
14014 }
14015
14016 return false;
14017 }
14018
14020 {
14021 return false;
14022 }
14023
14026 {
14027 return UATimeSpent.DEFAULT_DEPLOY;
14028 }
14029
14030
14031
14032
14034 {
14036 SetSynchDirty();
14037 }
14038
14040 {
14042 }
14043
14044
14046 {
14047 return false;
14048 }
14049
14052 {
14053 string att_type = "None";
14054
14055 if (ConfigIsExisting("soundAttType"))
14056 {
14057 att_type = ConfigGetString("soundAttType");
14058 }
14059
14061 }
14062
14064 {
14066 }
14067
14068
14069
14070
14071
14077
14079 {
14082
14084 }
14085
14086
14088 {
14090 return;
14091
14093
14096
14099
14100 SoundParameters params = new SoundParameters();
14104 }
14105
14106
14108 {
14110 return;
14111
14113 SetSynchDirty();
14114
14117 }
14118
14119
14121 {
14123 return;
14124
14126 SetSynchDirty();
14127
14130 }
14131
14133 {
14135 }
14136
14138 {
14140 }
14141
14144 {
14145 if (!
GetGame().IsDedicatedServer())
14146 {
14147 if (ConfigIsExisting("attachSoundSet"))
14148 {
14149 string cfg_path = "";
14150 string soundset = "";
14151 string type_name =
GetType();
14152
14155 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
14156 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
14157
14158 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
14159 {
14160 for (int i = 0; i < cfg_soundset_array.Count(); i++)
14161 {
14162 if (cfg_slot_array[i] == slot_type)
14163 {
14164 soundset = cfg_soundset_array[i];
14165 break;
14166 }
14167 }
14168 }
14169
14170 if (soundset != "")
14171 {
14172 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14174 }
14175 }
14176 }
14177 }
14178
14180 {
14181
14182 }
14183
14184 void OnApply(PlayerBase player);
14185
14187 {
14188 return 1.0;
14189 };
14190
14192 {
14194 }
14195
14197 {
14199 }
14200
14202
14204 {
14205 SetDynamicPhysicsLifeTime(0.01);
14207 }
14208
14210 {
14211 array<string> zone_names = new array<string>;
14212 GetDamageZones(zone_names);
14213 for (int i = 0; i < zone_names.Count(); i++)
14214 {
14215 SetHealthMax(zone_names.Get(i),"Health");
14216 }
14217 SetHealthMax("","Health");
14218 }
14219
14222 {
14223 float global_health = GetHealth01("","Health");
14224 array<string> zones = new array<string>;
14225 GetDamageZones(zones);
14226
14227 for (int i = 0; i < zones.Count(); i++)
14228 {
14229 SetHealth01(zones.Get(i),"Health",global_health);
14230 }
14231 }
14232
14235 {
14236 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14237 }
14238
14240 {
14241 if (!hasRootAsPlayer)
14242 {
14243 if (refParentIB)
14244 {
14245
14246 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14247 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14248
14249 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14250 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14251
14254 }
14255 else
14256 {
14257
14260 }
14261 }
14262 }
14263
14265 {
14267 {
14268 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14269 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14270 {
14271 float heatPermCoef = 1.0;
14273 while (ent)
14274 {
14275 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14276 ent = ent.GetHierarchyParent();
14277 }
14278
14279 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14280 }
14281 }
14282 }
14283
14285 {
14286
14287 EntityAI parent = GetHierarchyParent();
14288 if (!parent)
14289 {
14290 hasParent = false;
14291 hasRootAsPlayer = false;
14292 }
14293 else
14294 {
14295 hasParent = true;
14296 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14297 refParentIB =
ItemBase.Cast(parent);
14298 }
14299 }
14300
14301 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14302 {
14303
14304 }
14305
14307 {
14308
14309 return false;
14310 }
14311
14313 {
14314
14315
14316 return false;
14317 }
14318
14320 {
14321
14322 return false;
14323 }
14324
14327 {
14328 return !GetIsFrozen() &&
IsOpen();
14329 }
14330
14332 {
14333 bool hasParent = false, hasRootAsPlayer = false;
14335
14336 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14337 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14338
14339 if (wwtu || foodDecay)
14340 {
14344
14345 if (processWetness || processTemperature || processDecay)
14346 {
14348
14349 if (processWetness)
14350 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14351
14352 if (processTemperature)
14354
14355 if (processDecay)
14356 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14357 }
14358 }
14359 }
14360
14363 {
14365 }
14366
14368 {
14371
14372 return super.GetTemperatureFreezeThreshold();
14373 }
14374
14376 {
14379
14380 return super.GetTemperatureThawThreshold();
14381 }
14382
14384 {
14387
14388 return super.GetItemOverheatThreshold();
14389 }
14390
14392 {
14394 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14395
14396 return super.GetTemperatureFreezeTime();
14397 }
14398
14400 {
14402 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14403
14404 return super.GetTemperatureThawTime();
14405 }
14406
14411
14413 {
14414 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14415 }
14416
14418 {
14419 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14420 }
14421
14424 {
14426 }
14427
14429 {
14431 }
14432
14434 {
14436 }
14437
14440 {
14441 return null;
14442 }
14443
14446 {
14447 return false;
14448 }
14449
14451 {
14453 {
14456 if (!trg)
14457 {
14459 explosive = this;
14460 }
14461
14462 explosive.PairRemote(trg);
14464
14465 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14466 trg.SetPersistentPairID(persistentID);
14467 explosive.SetPersistentPairID(persistentID);
14468
14469 return true;
14470 }
14471 return false;
14472 }
14473
14476 {
14477 float ret = 1.0;
14480 ret *= GetHealth01();
14481
14482 return ret;
14483 }
14484
14485 #ifdef DEVELOPER
14486 override void SetDebugItem()
14487 {
14488 super.SetDebugItem();
14489 _itemBase = this;
14490 }
14491
14493 {
14494 string text = super.GetDebugText();
14495
14497 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14498
14499 return text;
14500 }
14501 #endif
14502
14504 {
14505 return true;
14506 }
14507
14509
14511
14513 {
14516 }
14517
14518
14526
14542}
14543
14545{
14547 if (entity)
14548 {
14549 bool is_item = entity.IsInherited(
ItemBase);
14550 if (is_item && full_quantity)
14551 {
14554 }
14555 }
14556 else
14557 {
14559 return NULL;
14560 }
14561 return entity;
14562}
14563
14565{
14566 if (item)
14567 {
14568 if (health > 0)
14569 item.SetHealth("", "", health);
14570
14571 if (item.CanHaveTemperature())
14572 {
14574 if (item.CanFreeze())
14575 item.SetFrozen(false);
14576 }
14577
14578 if (item.HasEnergyManager())
14579 {
14580 if (quantity >= 0)
14581 {
14582 item.GetCompEM().SetEnergy0To1(quantity);
14583 }
14584 else
14585 {
14587 }
14588 }
14589 else if (item.IsMagazine())
14590 {
14591 Magazine mag = Magazine.Cast(item);
14592 if (quantity >= 0)
14593 {
14594 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14595 }
14596 else
14597 {
14599 }
14600
14601 }
14602 else
14603 {
14604 if (quantity >= 0)
14605 {
14606 item.SetQuantityNormalized(quantity, false);
14607 }
14608 else
14609 {
14611 }
14612
14613 }
14614 }
14615}
14616
14617#ifdef DEVELOPER
14619#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.