9692{
9694 {
9695 return true;
9696 }
9697};
9698
9699
9700
9702{
9706
9708
9711
9712
9713
9714
9715
9724
9730
9735
9740
9761 protected bool m_IsResultOfSplit
9762
9764
9769
9770
9771
9773
9777
9778
9779
9781
9784
9785
9786
9792
9793
9801
9804
9805
9807
9808
9810
9811
9816
9817
9822
9823
9825
9826
9828 {
9833
9834 if (!
GetGame().IsDedicatedServer())
9835 {
9837 {
9839
9841 {
9843 }
9844 }
9845
9848 }
9849
9850 m_OldLocation = null;
9851
9853 {
9855 }
9856
9857 if (ConfigIsExisting("headSelectionsToHide"))
9858 {
9861 }
9862
9864 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9865 {
9867 }
9868
9870
9871 m_IsResultOfSplit = false;
9872
9874 }
9875
9877 {
9878 super.InitItemVariables();
9879
9885 m_Count = ConfigGetInt(
"count");
9886
9889
9894
9897
9902
9914
9918
9919
9922 if (ConfigIsExisting("canBeSplit"))
9923 {
9926 }
9927
9929 if (ConfigIsExisting("itemBehaviour"))
9931
9932
9935 RegisterNetSyncVariableInt("m_VarLiquidType");
9936 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9937
9938 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9939 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9940 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9941
9942 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9943 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9944 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9945 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9946
9947 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9948 RegisterNetSyncVariableBool("m_IsTakeable");
9949 RegisterNetSyncVariableBool("m_IsHologram");
9950
9953 {
9956 }
9957
9959
9961 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9963
9964 }
9965
9967 {
9969 }
9970
9972 {
9975 {
9980 }
9981 }
9982
9983 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9984 {
9986 {
9989 }
9990
9992 }
9993
9995 {
10001 }
10002
10004
10006 {
10008
10009 if (!action)
10010 {
10011 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
10012 return;
10013 }
10014
10016 if (!ai)
10017 {
10019 return;
10020 }
10021
10023 if (!action_array)
10024 {
10025 action_array = new array<ActionBase_Basic>;
10027 }
10028 if (LogManager.IsActionLogEnable())
10029 {
10030 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
10031 }
10032
10033 if (action_array.Find(action) != -1)
10034 {
10035 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
10036 }
10037 else
10038 {
10039 action_array.Insert(action);
10040 }
10041 }
10042
10044 {
10046 ActionBase action = player.GetActionManager().GetAction(actionName);
10049
10050 if (action_array)
10051 {
10052 action_array.RemoveItem(action);
10053 }
10054 }
10055
10056
10057
10059 {
10060 ActionOverrideData overrideData = new ActionOverrideData();
10064
10066 if (!actionMap)
10067 {
10070 }
10071
10072 actionMap.Insert(this.
Type(), overrideData);
10073
10074 }
10075
10077
10079
10080
10082 {
10085
10088
10089 string config_to_search = "CfgVehicles";
10090 string muzzle_owner_config;
10091
10093 {
10094 if (IsInherited(Weapon))
10095 config_to_search = "CfgWeapons";
10096
10097 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10098
10099 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
10100
10102
10103 if (config_OnFire_subclass_count > 0)
10104 {
10105 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
10106
10107 for (int i = 0; i < config_OnFire_subclass_count; i++)
10108 {
10109 string particle_class = "";
10111 string config_OnFire_entry = config_OnFire_class + particle_class;
10112 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
10113 WPOF_array.Insert(WPOF);
10114 }
10115
10116
10118 }
10119 }
10120
10122 {
10123 config_to_search = "CfgWeapons";
10124 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10125
10126 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
10127
10129
10130 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
10131 {
10132 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
10133
10134 for (i = 0; i < config_OnBulletCasingEject_count; i++)
10135 {
10136 string particle_class2 = "";
10138 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
10139 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
10140 WPOBE_array.Insert(WPOBE);
10141 }
10142
10143
10145 }
10146 }
10147 }
10148
10149
10151 {
10154
10156 {
10157 string config_to_search = "CfgVehicles";
10158
10159 if (IsInherited(Weapon))
10160 config_to_search = "CfgWeapons";
10161
10162 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10163 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10164
10165 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10166 {
10167
10169
10171 {
10173 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10175 return;
10176 }
10177
10180
10181
10182
10184 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10185
10186 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10187 {
10188 string particle_class = "";
10190 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10192
10193 if (entry_type == CT_CLASS)
10194 {
10195 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10196 WPOOH_array.Insert(WPOF);
10197 }
10198 }
10199
10200
10202 }
10203 }
10204 }
10205
10207 {
10209 }
10210
10212 {
10214 {
10216
10219
10222
10223 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10224 }
10225 }
10226
10228 {
10230 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10231
10233 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10234
10236 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10237
10239 {
10241 }
10242 }
10243
10245 {
10247 }
10248
10250 {
10253 else
10255
10257 {
10260 }
10261 else
10262 {
10265
10268 }
10269
10271 }
10272
10274 {
10276 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10277 }
10278
10280 {
10282 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10284 }
10285
10287 {
10289 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10290 }
10291
10293 {
10296
10297 OverheatingParticle OP = new OverheatingParticle();
10302
10304 }
10305
10307 {
10310
10311 return -1;
10312 }
10313
10315 {
10317 {
10320
10321 for (int i = count; i > 0; --i)
10322 {
10323 int id = i - 1;
10326
10329
10330 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10331 {
10332 if (p)
10333 {
10336 }
10337 }
10338 }
10339 }
10340 }
10341
10343 {
10345 {
10347 {
10348 int id = i - 1;
10350
10351 if (OP)
10352 {
10354
10355 if (p)
10356 {
10358 }
10359
10360 delete OP;
10361 }
10362 }
10363
10366 }
10367 }
10368
10371 {
10372 return 0.0;
10373 }
10374
10375
10377 {
10378 return 250;
10379 }
10380
10382 {
10383 return 0;
10384 }
10385
10388 {
10390 return true;
10391
10392 return false;
10393 }
10394
10397 {
10400
10402 {
10404 }
10405 else
10406 {
10407
10409 }
10410
10412 }
10413
10420 {
10421 return -1;
10422 }
10423
10424
10425
10426
10428 {
10430 {
10432 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10433
10434 if (r_index >= 0)
10435 {
10436 InventoryLocation r_il = new InventoryLocation;
10437 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10438
10439 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10442 {
10443 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10444 }
10446 {
10447 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10448 }
10449
10450 }
10451
10452 player.GetHumanInventory().ClearUserReservedLocation(this);
10453 }
10454
10457 }
10458
10459
10460
10461
10463 {
10464 return ItemBase.m_DebugActionsMask;
10465 }
10466
10468 {
10469 return ItemBase.m_DebugActionsMask & mask;
10470 }
10471
10473 {
10474 ItemBase.m_DebugActionsMask = mask;
10475 }
10476
10478 {
10479 ItemBase.m_DebugActionsMask |= mask;
10480 }
10481
10483 {
10484 ItemBase.m_DebugActionsMask &= ~mask;
10485 }
10486
10488 {
10490 {
10492 }
10493 else
10494 {
10496 }
10497 }
10498
10499
10501 {
10502 if (GetEconomyProfile())
10503 {
10504 float q_max = GetEconomyProfile().GetQuantityMax();
10505 if (q_max > 0)
10506 {
10507 float q_min = GetEconomyProfile().GetQuantityMin();
10508 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10509
10511 {
10512 ComponentEnergyManager comp = GetCompEM();
10514 {
10516 }
10517 }
10519 {
10521
10522 }
10523
10524 }
10525 }
10526 }
10527
10530 {
10531 EntityAI parent = GetHierarchyParent();
10532
10533 if (parent)
10534 {
10535 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10536 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10537 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10538 }
10539 }
10540
10543 {
10544 EntityAI parent = GetHierarchyParent();
10545
10546 if (parent)
10547 {
10548 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10549 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10550 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10551 }
10552 }
10553
10555 {
10556
10557
10558
10559
10561
10563 {
10564 if (ScriptInputUserData.CanStoreInputUserData())
10565 {
10566 ScriptInputUserData ctx = new ScriptInputUserData;
10572 ctx.
Write(use_stack_max);
10575
10577 {
10578 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10579 }
10580 }
10581 }
10582 else if (!
GetGame().IsMultiplayer())
10583 {
10585 }
10586 }
10587
10589 {
10591 }
10592
10594 {
10596 }
10597
10599 {
10601 }
10602
10604 {
10605
10606 return false;
10607 }
10608
10610 {
10611 return false;
10612 }
10613
10617 {
10618 return false;
10619 }
10620
10622 {
10623 return "";
10624 }
10625
10627
10629 {
10630 return false;
10631 }
10632
10634 {
10635 return true;
10636 }
10637
10638
10639
10641 {
10642 return true;
10643 }
10644
10646 {
10647 return true;
10648 }
10649
10651 {
10652 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10654 }
10655
10657 {
10659 }
10660
10662 {
10664 if (!is_being_placed)
10666 SetSynchDirty();
10667 }
10668
10669
10671
10673 {
10675 }
10676
10678 {
10680 }
10681
10683 {
10684 return 1;
10685 }
10686
10688 {
10689 return false;
10690 }
10691
10693 {
10695 SetSynchDirty();
10696 }
10697
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
10733 {
10734 super.OnMovedInsideCargo(container);
10735
10736 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10737 }
10738
10739 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10740 {
10741 super.EEItemLocationChanged(oldLoc,newLoc);
10742
10743 PlayerBase new_player = null;
10744 PlayerBase old_player = null;
10745
10746 if (newLoc.GetParent())
10747 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10748
10749 if (oldLoc.GetParent())
10750 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10751
10753 {
10754 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10755
10756 if (r_index >= 0)
10757 {
10758 InventoryLocation r_il = new InventoryLocation;
10759 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10760
10761 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10764 {
10765 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10766 }
10768 {
10769 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10770 }
10771
10772 }
10773 }
10774
10776 {
10777 if (new_player)
10778 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10779
10780 if (new_player == old_player)
10781 {
10782
10783 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10784 {
10786 {
10787 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10788 {
10789 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10790 }
10791 }
10792 else
10793 {
10794 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10795 }
10796 }
10797
10798 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10799 {
10800 int type = oldLoc.GetType();
10802 {
10803 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10804 }
10806 {
10807 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10808 }
10809 }
10810 if (!m_OldLocation)
10811 {
10812 m_OldLocation = new InventoryLocation;
10813 }
10814 m_OldLocation.Copy(oldLoc);
10815 }
10816 else
10817 {
10818 if (m_OldLocation)
10819 {
10820 m_OldLocation.Reset();
10821 }
10822 }
10823
10825 }
10826 else
10827 {
10828 if (new_player)
10829 {
10830 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10831 if (res_index >= 0)
10832 {
10833 InventoryLocation il = new InventoryLocation;
10834 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10836 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10839 {
10840 il.
GetParent().GetOnReleaseLock().Invoke(it);
10841 }
10843 {
10845 }
10846
10847 }
10848 }
10850 {
10851
10853 }
10854
10855 if (m_OldLocation)
10856 {
10857 m_OldLocation.Reset();
10858 }
10859 }
10860 }
10861
10862 override void EOnContact(IEntity other, Contact extra)
10863 {
10865 {
10866 int liquidType = -1;
10868 if (impactSpeed > 0.0)
10869 {
10871 #ifndef SERVER
10873 #else
10875 SetSynchDirty();
10876 #endif
10878 }
10879 }
10880
10881 #ifdef SERVER
10882 if (GetCompEM() && GetCompEM().IsPlugged())
10883 {
10884 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10885 GetCompEM().UnplugThis();
10886 }
10887 #endif
10888 }
10889
10891
10893 {
10895 }
10896
10898 {
10899
10900 }
10901
10903 {
10904 super.OnItemLocationChanged(old_owner, new_owner);
10905
10906 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10907 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10908
10909 if (!relatedPlayer && playerNew)
10910 relatedPlayer = playerNew;
10911
10912 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10913 {
10915 if (actionMgr)
10916 {
10917 ActionBase currentAction = actionMgr.GetRunningAction();
10918 if (currentAction)
10920 }
10921 }
10922
10923 Man ownerPlayerOld = null;
10924 Man ownerPlayerNew = null;
10925
10926 if (old_owner)
10927 {
10928 if (old_owner.
IsMan())
10929 {
10930 ownerPlayerOld = Man.Cast(old_owner);
10931 }
10932 else
10933 {
10934 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10935 }
10936 }
10937 else
10938 {
10940 {
10942
10943 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10944 {
10945 GetCompEM().UnplugThis();
10946 }
10947 }
10948 }
10949
10950 if (new_owner)
10951 {
10952 if (new_owner.
IsMan())
10953 {
10954 ownerPlayerNew = Man.Cast(new_owner);
10955 }
10956 else
10957 {
10958 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10959 }
10960 }
10961
10962 if (ownerPlayerOld != ownerPlayerNew)
10963 {
10964 if (ownerPlayerOld)
10965 {
10966 array<EntityAI> subItemsExit = new array<EntityAI>;
10968 for (int i = 0; i < subItemsExit.Count(); i++)
10969 {
10972 }
10973 }
10974
10975 if (ownerPlayerNew)
10976 {
10977 array<EntityAI> subItemsEnter = new array<EntityAI>;
10979 for (int j = 0; j < subItemsEnter.Count(); j++)
10980 {
10983 }
10984 }
10985 }
10986 else if (ownerPlayerNew != null)
10987 {
10988 PlayerBase nplayer;
10989 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10990 {
10991 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10993 for (int k = 0; k < subItemsUpdate.Count(); k++)
10994 {
10996 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10997 }
10998 }
10999 }
11000
11001 if (old_owner)
11002 old_owner.OnChildItemRemoved(this);
11003 if (new_owner)
11004 new_owner.OnChildItemReceived(this);
11005 }
11006
11007
11009 {
11010 super.EEDelete(parent);
11011 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
11012 if (player)
11013 {
11015
11016 if (player.IsAlive())
11017 {
11018 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
11019 if (r_index >= 0)
11020 {
11021 InventoryLocation r_il = new InventoryLocation;
11022 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
11023
11024 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
11027 {
11028 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
11029 }
11031 {
11032 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
11033 }
11034
11035 }
11036
11037 player.RemoveQuickBarEntityShortcut(this);
11038 }
11039 }
11040 }
11041
11043 {
11044 super.EEKilled(killer);
11045
11048 {
11049 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
11050 {
11051 if (IsMagazine())
11052 {
11053 if (Magazine.Cast(this).GetAmmoCount() > 0)
11054 {
11056 }
11057 }
11058 else
11059 {
11061 }
11062 }
11063 }
11064 }
11065
11067 {
11068 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
11069
11070 super.OnWasAttached(parent, slot_id);
11071
11074
11076 }
11077
11079 {
11080 super.OnWasDetached(parent, slot_id);
11081
11084 }
11085
11087 {
11088 int idx;
11091
11092 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11093 if (inventory_slots.Count() < 1)
11094 {
11095 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
11096 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
11097 }
11098 else
11099 {
11100 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
11101 }
11102
11103 idx = inventory_slots.Find(slot);
11104 if (idx < 0)
11105 return "";
11106
11107 return attach_types.Get(idx);
11108 }
11109
11111 {
11112 int idx = -1;
11113 string slot;
11114
11117
11118 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11119 if (inventory_slots.Count() < 1)
11120 {
11121 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
11122 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11123 }
11124 else
11125 {
11126 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
11127 if (detach_types.Count() < 1)
11128 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11129 }
11130
11131 for (int i = 0; i < inventory_slots.Count(); i++)
11132 {
11133 slot = inventory_slots.Get(i);
11134 }
11135
11136 if (slot != "")
11137 {
11138 if (detach_types.Count() == 1)
11139 idx = 0;
11140 else
11141 idx = inventory_slots.Find(slot);
11142 }
11143 if (idx < 0)
11144 return "";
11145
11146 return detach_types.Get(idx);
11147 }
11148
11150 {
11151
11153
11154
11155 float min_time = 1;
11156 float max_time = 3;
11157 float delay = Math.RandomFloat(min_time, max_time);
11158
11159 explode_timer.Run(delay, this, "DoAmmoExplosion");
11160 }
11161
11163 {
11164 Magazine magazine = Magazine.Cast(this);
11165 int pop_sounds_count = 6;
11166 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11167
11168
11169 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11170 string sound_name = pop_sounds[ sound_idx ];
11172
11173
11174 magazine.ServerAddAmmoCount(-1);
11175
11176
11177 float min_temp_to_explode = 100;
11178
11179 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11180 {
11182 }
11183 }
11184
11185
11186 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11187 {
11188 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11189
11190 const int CHANCE_DAMAGE_CARGO = 4;
11191 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11192 const int CHANCE_DAMAGE_NOTHING = 2;
11193
11195 {
11196 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11197 int chances;
11198 int rnd;
11199
11200 if (GetInventory().GetCargo())
11201 {
11202 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11203 rnd = Math.RandomInt(0,chances);
11204
11205 if (rnd < CHANCE_DAMAGE_CARGO)
11206 {
11208 }
11209 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11210 {
11212 }
11213 }
11214 else
11215 {
11216 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11217 rnd = Math.RandomInt(0,chances);
11218
11219 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11220 {
11222 }
11223 }
11224 }
11225 }
11226
11228 {
11229 if (GetInventory().GetCargo())
11230 {
11231 int item_count = GetInventory().GetCargo().GetItemCount();
11232 if (item_count > 0)
11233 {
11234 int random_pick = Math.RandomInt(0, item_count);
11236 if (!item.IsExplosive())
11237 {
11238 item.AddHealth("","",damage);
11239 return true;
11240 }
11241 }
11242 }
11243 return false;
11244 }
11245
11247 {
11248 int attachment_count = GetInventory().AttachmentCount();
11249 if (attachment_count > 0)
11250 {
11251 int random_pick = Math.RandomInt(0, attachment_count);
11252 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11253 if (!attachment.IsExplosive())
11254 {
11255 attachment.AddHealth("","",damage);
11256 return true;
11257 }
11258 }
11259 return false;
11260 }
11261
11263 {
11265 }
11266
11268 {
11270 return GetInventory().CanRemoveEntity();
11271
11272 return false;
11273 }
11274
11276 {
11277
11279 return false;
11280
11281
11283 return false;
11284
11285
11286
11288 if (delta == 0)
11289 return false;
11290
11291
11292 return true;
11293 }
11294
11296 {
11298 {
11299 if (ScriptInputUserData.CanStoreInputUserData())
11300 {
11301 ScriptInputUserData ctx = new ScriptInputUserData;
11306 ctx.
Write(destination_entity);
11308 ctx.
Write(slot_id);
11310 }
11311 }
11312 else if (!
GetGame().IsMultiplayer())
11313 {
11315 }
11316 }
11317
11319 {
11320 float split_quantity_new;
11324 InventoryLocation loc = new InventoryLocation;
11325
11326 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11327 {
11329 split_quantity_new = stack_max;
11330 else
11332
11334 {
11335 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11336 if (new_item)
11337 {
11338 new_item.SetResultOfSplit(true);
11339 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11341 new_item.
SetQuantity(split_quantity_new,
false,
true);
11342 }
11343 }
11344 }
11345 else if (destination_entity && slot_id == -1)
11346 {
11347 if (quantity > stack_max)
11348 split_quantity_new = stack_max;
11349 else
11350 split_quantity_new = quantity;
11351
11353 {
11355 {
11358 }
11359
11360 if (new_item)
11361 {
11362 new_item.SetResultOfSplit(true);
11363 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11365 new_item.
SetQuantity(split_quantity_new,
false,
true);
11366 }
11367 }
11368 }
11369 else
11370 {
11371 if (stack_max != 0)
11372 {
11374 {
11376 }
11377
11378 if (split_quantity_new == 0)
11379 {
11380 if (!
GetGame().IsMultiplayer())
11381 player.PhysicalPredictiveDropItem(this);
11382 else
11383 player.ServerDropEntity(this);
11384 return;
11385 }
11386
11388 {
11390
11391 if (new_item)
11392 {
11393 new_item.SetResultOfSplit(true);
11394 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11397 new_item.PlaceOnSurface();
11398 }
11399 }
11400 }
11401 }
11402 }
11403
11405 {
11406 float split_quantity_new;
11410 InventoryLocation loc = new InventoryLocation;
11411
11412 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11413 {
11415 split_quantity_new = stack_max;
11416 else
11418
11420 {
11421 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11422 if (new_item)
11423 {
11424 new_item.SetResultOfSplit(true);
11425 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11427 new_item.
SetQuantity(split_quantity_new,
false,
true);
11428 }
11429 }
11430 }
11431 else if (destination_entity && slot_id == -1)
11432 {
11433 if (quantity > stack_max)
11434 split_quantity_new = stack_max;
11435 else
11436 split_quantity_new = quantity;
11437
11439 {
11441 {
11444 }
11445
11446 if (new_item)
11447 {
11448 new_item.SetResultOfSplit(true);
11449 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11451 new_item.
SetQuantity(split_quantity_new,
false,
true);
11452 }
11453 }
11454 }
11455 else
11456 {
11457 if (stack_max != 0)
11458 {
11460 {
11462 }
11463
11465 {
11467
11468 if (new_item)
11469 {
11470 new_item.SetResultOfSplit(true);
11471 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11474 new_item.PlaceOnSurface();
11475 }
11476 }
11477 }
11478 }
11479 }
11480
11482 {
11484 {
11485 if (ScriptInputUserData.CanStoreInputUserData())
11486 {
11487 ScriptInputUserData ctx = new ScriptInputUserData;
11492 dst.WriteToContext(ctx);
11494 }
11495 }
11496 else if (!
GetGame().IsMultiplayer())
11497 {
11499 }
11500 }
11501
11503 {
11505 {
11506 if (ScriptInputUserData.CanStoreInputUserData())
11507 {
11508 ScriptInputUserData ctx = new ScriptInputUserData;
11513 ctx.
Write(destination_entity);
11519 }
11520 }
11521 else if (!
GetGame().IsMultiplayer())
11522 {
11524 }
11525 }
11526
11528 {
11530 }
11531
11533 {
11535 float split_quantity_new;
11537 if (dst.IsValid())
11538 {
11539 int slot_id = dst.GetSlot();
11541
11542 if (quantity > stack_max)
11543 split_quantity_new = stack_max;
11544 else
11545 split_quantity_new = quantity;
11546
11548 {
11550
11551 if (new_item)
11552 {
11553 new_item.SetResultOfSplit(true);
11554 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11556 new_item.
SetQuantity(split_quantity_new,
false,
true);
11557 }
11558
11559 return new_item;
11560 }
11561 }
11562
11563 return null;
11564 }
11565
11567 {
11569 float split_quantity_new;
11571 if (destination_entity)
11572 {
11574 if (quantity > stackable)
11575 split_quantity_new = stackable;
11576 else
11577 split_quantity_new = quantity;
11578
11580 {
11581 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11582 if (new_item)
11583 {
11584 new_item.SetResultOfSplit(true);
11585 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11587 new_item.
SetQuantity(split_quantity_new,
false,
true);
11588 }
11589 }
11590 }
11591 }
11592
11594 {
11596 {
11597 if (ScriptInputUserData.CanStoreInputUserData())
11598 {
11599 ScriptInputUserData ctx = new ScriptInputUserData;
11604 ItemBase destination_entity =
this;
11605 ctx.
Write(destination_entity);
11609 }
11610 }
11611 else if (!
GetGame().IsMultiplayer())
11612 {
11614 }
11615 }
11616
11618 {
11620 float split_quantity_new;
11622 if (player)
11623 {
11625 if (quantity > stackable)
11626 split_quantity_new = stackable;
11627 else
11628 split_quantity_new = quantity;
11629
11631 {
11632 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11633 new_item =
ItemBase.Cast(in_hands);
11634 if (new_item)
11635 {
11636 new_item.SetResultOfSplit(true);
11637 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11639 new_item.SetQuantity(split_quantity_new, false, true);
11640 }
11641 }
11642 }
11643 }
11644
11646 {
11648 float split_quantity_new = Math.Floor(quantity * 0.5);
11649
11651 return;
11652
11654
11655 if (new_item)
11656 {
11657 if (new_item.GetQuantityMax() < split_quantity_new)
11658 {
11659 split_quantity_new = new_item.GetQuantityMax();
11660 }
11661
11662 new_item.SetResultOfSplit(true);
11663 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11664
11666 {
11669 }
11670 else
11671 {
11673 new_item.
SetQuantity(split_quantity_new,
false,
true);
11674 }
11675 }
11676 }
11677
11679 {
11681 float split_quantity_new = Math.Floor(quantity / 2);
11682
11684 return;
11685
11686 InventoryLocation invloc = new InventoryLocation;
11688
11690 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11691
11692 if (new_item)
11693 {
11694 if (new_item.GetQuantityMax() < split_quantity_new)
11695 {
11696 split_quantity_new = new_item.GetQuantityMax();
11697 }
11699 {
11702 }
11703 else if (split_quantity_new > 1)
11704 {
11706 new_item.
SetQuantity(split_quantity_new,
false,
true);
11707 }
11708 }
11709 }
11710
11713 {
11714 SetWeightDirty();
11716
11717 if (parent)
11718 parent.OnAttachmentQuantityChangedEx(this, delta);
11719
11721 {
11723 {
11725 }
11727 {
11728 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11730 }
11731 }
11732
11733 }
11734
11737 {
11738
11739 }
11740
11743 {
11745 }
11746
11748 {
11749 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11750
11752 {
11753 if (newLevel == GameConstants.STATE_RUINED)
11754 {
11756 EntityAI parent = GetHierarchyParent();
11757 if (parent && parent.IsFireplace())
11758 {
11759 CargoBase cargo = GetInventory().GetCargo();
11760 if (cargo)
11761 {
11763 {
11765 }
11766 }
11767 }
11768 }
11769
11771 {
11772
11774 return;
11775 }
11776
11777 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11778 {
11780 }
11781 }
11782 }
11783
11784
11786 {
11787 super.OnRightClick();
11788
11790 {
11792 {
11793 if (ScriptInputUserData.CanStoreInputUserData())
11794 {
11795 EntityAI root = GetHierarchyRoot();
11796 Man playerOwner = GetHierarchyRootPlayer();
11797 InventoryLocation dst = new InventoryLocation;
11798
11799
11800 if (!playerOwner && root && root == this)
11801 {
11803 }
11804 else
11805 {
11806
11807 GetInventory().GetCurrentInventoryLocation(dst);
11809 {
11812 {
11814 }
11815 else
11816 {
11818
11819
11820 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11821 {
11823 }
11824 else
11825 {
11826 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11827 }
11828 }
11829 }
11830 }
11831
11832 ScriptInputUserData ctx = new ScriptInputUserData;
11840 }
11841 }
11842 else if (!
GetGame().IsMultiplayer())
11843 {
11845 }
11846 }
11847 }
11848
11850 {
11851 if (root)
11852 {
11853 vector m4[4];
11854 root.GetTransform(m4);
11855 dst.SetGround(this, m4);
11856 }
11857 else
11858 {
11859 GetInventory().GetCurrentInventoryLocation(dst);
11860 }
11861 }
11862
11863 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11864 {
11865
11866 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11867 return false;
11868
11869 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11870 return false;
11871
11872
11874 return false;
11875
11876
11877 Magazine mag = Magazine.Cast(this);
11878 if (mag)
11879 {
11880 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11881 return false;
11882
11883 if (stack_max_limit)
11884 {
11885 Magazine other_mag = Magazine.Cast(other_item);
11886 if (other_item)
11887 {
11888 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11889 return false;
11890 }
11891
11892 }
11893 }
11894 else
11895 {
11896
11898 return false;
11899
11901 return false;
11902 }
11903
11904 PlayerBase player = null;
11905 if (CastTo(player, GetHierarchyRootPlayer()))
11906 {
11907 if (player.GetInventory().HasAttachment(this))
11908 return false;
11909
11910 if (player.IsItemsToDelete())
11911 return false;
11912 }
11913
11914 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11915 return false;
11916
11917 int slotID;
11919 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11920 return false;
11921
11922 return true;
11923 }
11924
11926 {
11928 }
11929
11931 {
11932 return m_IsResultOfSplit;
11933 }
11934
11936 {
11937 m_IsResultOfSplit = value;
11938 }
11939
11941 {
11943 }
11944
11946 {
11947 float other_item_quantity = other_item.GetQuantity();
11948 float this_free_space;
11949
11951
11953
11954 if (other_item_quantity > this_free_space)
11955 {
11956 return this_free_space;
11957 }
11958 else
11959 {
11960 return other_item_quantity;
11961 }
11962 }
11963
11965 {
11967 }
11968
11970 {
11972 return;
11973
11974 if (!IsMagazine() && other_item)
11975 {
11977 if (quantity_used != 0)
11978 {
11979 float hp1 = GetHealth01("","");
11980 float hp2 = other_item.GetHealth01("","");
11981 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11982 hpResult = hpResult / (
GetQuantity() + quantity_used);
11983
11984 hpResult *= GetMaxHealth();
11985 Math.Round(hpResult);
11986 SetHealth("", "Health", hpResult);
11987
11989 other_item.AddQuantity(-quantity_used);
11990 }
11991 }
11993 }
11994
11996 {
11997 #ifdef SERVER
11998 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11999 GetHierarchyParent().IncreaseLifetimeUp();
12000 #endif
12001 };
12002
12004 {
12005 PlayerBase p = PlayerBase.Cast(player);
12006
12007 array<int> recipesIds = p.m_Recipes;
12008 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12009 if (moduleRecipesManager)
12010 {
12011 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
12012 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
12013 }
12014
12015 for (int i = 0;i < recipesIds.Count(); i++)
12016 {
12017 int key = recipesIds.Get(i);
12018 string recipeName = moduleRecipesManager.GetRecipeName(key);
12020 }
12021 }
12022
12023
12024 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
12025 {
12026 super.GetDebugActions(outputList);
12027
12028
12034
12035
12040
12045
12046
12050
12051
12053 {
12057 }
12058
12061
12062
12066
12068
12069 InventoryLocation loc = new InventoryLocation();
12070 GetInventory().GetCurrentInventoryLocation(loc);
12072 {
12073 if (Gizmo_IsSupported())
12076 }
12077
12079 }
12080
12081
12082
12083
12085 {
12086 super.OnAction(action_id, player, ctx);
12087
12089 {
12090 switch (action_id)
12091 {
12094 return true;
12097 return true;
12098 }
12099 }
12100
12102 {
12103 switch (action_id)
12104 {
12106 Delete();
12107 return true;
12108 }
12109 }
12110
12111 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
12112 {
12113 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12114 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
12115 PlayerBase p = PlayerBase.Cast(player);
12116 if (
EActions.RECIPES_RANGE_START < 1000)
12117 {
12118 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
12119 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
12120 }
12121 }
12122 #ifndef SERVER
12123 else if (action_id ==
EActions.WATCH_PLAYER)
12124 {
12125 PluginDeveloper.SetDeveloperItemClientEx(player);
12126 }
12127 #endif
12129 {
12130 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
12131 {
12132 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
12133 OnDebugButtonPressServer(id + 1);
12134 }
12135
12136 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
12137 {
12138 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
12140 }
12141
12142 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
12143 {
12144 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
12146 }
12147
12148 else if (action_id ==
EActions.ADD_QUANTITY)
12149 {
12150 if (IsMagazine())
12151 {
12152 Magazine mag = Magazine.Cast(this);
12153 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
12154 }
12155 else
12156 {
12158 }
12159
12160 if (m_EM)
12161 {
12162 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12163 }
12164
12165 }
12166
12167 else if (action_id ==
EActions.REMOVE_QUANTITY)
12168 {
12169 if (IsMagazine())
12170 {
12171 Magazine mag2 = Magazine.Cast(this);
12172 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12173 }
12174 else
12175 {
12177 }
12178 if (m_EM)
12179 {
12180 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12181 }
12182
12183 }
12184
12185 else if (action_id ==
EActions.SET_QUANTITY_0)
12186 {
12188
12189 if (m_EM)
12190 {
12191 m_EM.SetEnergy(0);
12192 }
12193 }
12194
12195 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12196 {
12198
12199 if (m_EM)
12200 {
12201 m_EM.SetEnergy(m_EM.GetEnergyMax());
12202 }
12203 }
12204
12205 else if (action_id ==
EActions.ADD_HEALTH)
12206 {
12207 AddHealth("","",GetMaxHealth("","Health")/5);
12208 }
12209 else if (action_id ==
EActions.REMOVE_HEALTH)
12210 {
12211 AddHealth("","",-GetMaxHealth("","Health")/5);
12212 }
12213 else if (action_id ==
EActions.DESTROY_HEALTH)
12214 {
12215 SetHealth01("","",0);
12216 }
12217 else if (action_id ==
EActions.WATCH_ITEM)
12218 {
12220 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12221 #ifdef DEVELOPER
12222 SetDebugDeveloper_item(this);
12223 #endif
12224 }
12225
12226 else if (action_id ==
EActions.ADD_TEMPERATURE)
12227 {
12228 AddTemperature(20);
12229
12230 }
12231
12232 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12233 {
12234 AddTemperature(-20);
12235
12236 }
12237
12238 else if (action_id ==
EActions.FLIP_FROZEN)
12239 {
12240 SetFrozen(!GetIsFrozen());
12241
12242 }
12243
12244 else if (action_id ==
EActions.ADD_WETNESS)
12245 {
12247
12248 }
12249
12250 else if (action_id ==
EActions.REMOVE_WETNESS)
12251 {
12253
12254 }
12255
12256 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12257 {
12260
12261
12262 }
12263
12264 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12265 {
12268 }
12269
12270 else if (action_id ==
EActions.MAKE_SPECIAL)
12271 {
12272 auto debugParams = DebugSpawnParams.WithPlayer(player);
12273 OnDebugSpawnEx(debugParams);
12274 }
12275
12276 }
12277
12278
12279 return false;
12280 }
12281
12282
12283
12284
12288
12291
12292
12293
12295 {
12296 return false;
12297 }
12298
12299
12301 {
12302 return true;
12303 }
12304
12305
12307 {
12308 return true;
12309 }
12310
12311
12312
12314 {
12315 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12317 }
12318
12321 {
12322 return null;
12323 }
12324
12326 {
12327 return false;
12328 }
12329
12331 {
12332 return false;
12333 }
12334
12338
12339
12341 {
12342 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12343 return module_repairing.CanRepair(this, item_repair_kit);
12344 }
12345
12346
12347 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12348 {
12349 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12350 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12351 }
12352
12353
12355 {
12356
12357
12358
12359
12360
12361
12362
12363
12364 return 1;
12365 }
12366
12367
12368
12370 {
12372 }
12373
12374
12375
12377 {
12379 }
12380
12381
12390 {
12391 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12392
12393 if (player)
12394 {
12395 player.MessageStatus(text);
12396 }
12397 }
12398
12399
12408 {
12409 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12410
12411 if (player)
12412 {
12413 player.MessageAction(text);
12414 }
12415 }
12416
12417
12426 {
12427 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12428
12429 if (player)
12430 {
12431 player.MessageFriendly(text);
12432 }
12433 }
12434
12435
12444 {
12445 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12446
12447 if (player)
12448 {
12449 player.MessageImportant(text);
12450 }
12451 }
12452
12454 {
12455 return true;
12456 }
12457
12458
12459 override bool KindOf(
string tag)
12460 {
12461 bool found = false;
12462 string item_name = this.
GetType();
12465
12466 int array_size = item_tag_array.Count();
12467 for (int i = 0; i < array_size; i++)
12468 {
12469 if (item_tag_array.Get(i) == tag)
12470 {
12471 found = true;
12472 break;
12473 }
12474 }
12475 return found;
12476 }
12477
12478
12480 {
12481
12482 super.OnRPC(sender, rpc_type,ctx);
12483
12484
12485 switch (rpc_type)
12486 {
12487 #ifndef SERVER
12488 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12489 Param2<bool, string> p = new Param2<bool, string>(false, "");
12490
12492 return;
12493
12494 bool play = p.param1;
12495 string soundSet = p.param2;
12496
12497 if (play)
12498 {
12500 {
12502 {
12504 }
12505 }
12506 else
12507 {
12509 }
12510 }
12511 else
12512 {
12514 }
12515
12516 break;
12517 #endif
12518
12519 }
12520
12522 {
12524 }
12525 }
12526
12527
12528
12529
12531 {
12532 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12533 return plugin.GetID(
name);
12534 }
12535
12537 {
12538 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12539 return plugin.GetName(id);
12540 }
12541
12544 {
12545
12546
12547 int varFlags;
12548 if (!ctx.
Read(varFlags))
12549 return;
12550
12551 if (varFlags & ItemVariableFlags.FLOAT)
12552 {
12554 }
12555 }
12556
12558 {
12559
12560 super.SerializeNumericalVars(floats_out);
12561
12562
12563
12565 {
12567 }
12568
12570 {
12572 }
12573
12575 {
12577 }
12578
12580 {
12585 }
12586
12588 {
12590 }
12591 }
12592
12594 {
12595
12596 super.DeSerializeNumericalVars(floats);
12597
12598
12599 int index = 0;
12600 int mask = Math.Round(floats.Get(index));
12601
12602 index++;
12603
12605 {
12607 {
12609 }
12610 else
12611 {
12612 float quantity = floats.Get(index);
12613 SetQuantity(quantity,
true,
false,
false,
false);
12614 }
12615 index++;
12616 }
12617
12619 {
12620 float wet = floats.Get(index);
12622 index++;
12623 }
12624
12626 {
12627 int liquidtype = Math.Round(floats.Get(index));
12629 index++;
12630 }
12631
12633 {
12635 index++;
12637 index++;
12639 index++;
12641 index++;
12642 }
12643
12645 {
12646 int cleanness = Math.Round(floats.Get(index));
12648 index++;
12649 }
12650 }
12651
12653 {
12654 super.WriteVarsToCTX(ctx);
12655
12656
12658 {
12660 }
12661
12663 {
12665 }
12666
12668 {
12670 }
12671
12673 {
12674 int r,g,b,a;
12680 }
12681
12683 {
12685 }
12686 }
12687
12689 {
12690 if (!super.ReadVarsFromCTX(ctx,version))
12691 return false;
12692
12693 int intValue;
12694 float value;
12695
12696 if (version < 140)
12697 {
12698 if (!ctx.
Read(intValue))
12699 return false;
12700
12701 m_VariablesMask = intValue;
12702 }
12703
12705 {
12706 if (!ctx.
Read(value))
12707 return false;
12708
12710 {
12712 }
12713 else
12714 {
12716 }
12717 }
12718
12719 if (version < 140)
12720 {
12722 {
12723 if (!ctx.
Read(value))
12724 return false;
12725 SetTemperatureDirect(value);
12726 }
12727 }
12728
12730 {
12731 if (!ctx.
Read(value))
12732 return false;
12734 }
12735
12737 {
12738 if (!ctx.
Read(intValue))
12739 return false;
12741 }
12742
12744 {
12745 int r,g,b,a;
12747 return false;
12749 return false;
12751 return false;
12753 return false;
12754
12756 }
12757
12759 {
12760 if (!ctx.
Read(intValue))
12761 return false;
12763 }
12764
12765 if (version >= 138 && version < 140)
12766 {
12768 {
12769 if (!ctx.
Read(intValue))
12770 return false;
12771 SetFrozen(intValue);
12772 }
12773 }
12774
12775 return true;
12776 }
12777
12778
12780 {
12783 {
12785 }
12786
12787 if (!super.OnStoreLoad(ctx, version))
12788 {
12790 return false;
12791 }
12792
12793 if (version >= 114)
12794 {
12795 bool hasQuickBarIndexSaved;
12796
12797 if (!ctx.
Read(hasQuickBarIndexSaved))
12798 {
12800 return false;
12801 }
12802
12803 if (hasQuickBarIndexSaved)
12804 {
12805 int itmQBIndex;
12806
12807
12808 if (!ctx.
Read(itmQBIndex))
12809 {
12811 return false;
12812 }
12813
12814 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12815 if (itmQBIndex != -1 && parentPlayer)
12816 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12817 }
12818 }
12819 else
12820 {
12821
12822 PlayerBase player;
12823 int itemQBIndex;
12824 if (version ==
int.
MAX)
12825 {
12826 if (!ctx.
Read(itemQBIndex))
12827 {
12829 return false;
12830 }
12831 }
12832 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12833 {
12834
12835 if (!ctx.
Read(itemQBIndex))
12836 {
12838 return false;
12839 }
12840 if (itemQBIndex != -1 && player)
12841 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12842 }
12843 }
12844
12845 if (version < 140)
12846 {
12847
12848 if (!LoadVariables(ctx, version))
12849 {
12851 return false;
12852 }
12853 }
12854
12855
12857 {
12859 return false;
12860 }
12861 if (version >= 132)
12862 {
12864 if (raib)
12865 {
12867 {
12869 return false;
12870 }
12871 }
12872 }
12873
12875 return true;
12876 }
12877
12878
12879
12881 {
12882 super.OnStoreSave(ctx);
12883
12884 PlayerBase player;
12885 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12886 {
12888
12889 int itemQBIndex = -1;
12890 itemQBIndex = player.FindQuickBarEntityIndex(this);
12891 ctx.
Write(itemQBIndex);
12892 }
12893 else
12894 {
12896 }
12897
12899
12901 if (raib)
12902 {
12904 }
12905 }
12906
12907
12909 {
12910 super.AfterStoreLoad();
12911
12913 {
12915 }
12916
12918 {
12921 }
12922 }
12923
12925 {
12926 super.EEOnAfterLoad();
12927
12929 {
12931 }
12932
12935 }
12936
12938 {
12939 return false;
12940 }
12941
12942
12943
12945 {
12947 {
12948 #ifdef PLATFORM_CONSOLE
12949
12951 {
12953 if (menu)
12954 {
12956 }
12957 }
12958 #endif
12959 }
12960
12962 {
12965 }
12966
12968 {
12969 SetWeightDirty();
12971 }
12973 {
12976 }
12977
12979 {
12982 }
12984 {
12987 }
12988
12989 super.OnVariablesSynchronized();
12990 }
12991
12992
12993
12995 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12996 {
12997 if (!IsServerCheck(allow_client))
12998 return false;
12999
13001 return false;
13002
13005
13006 if (value <= (min + 0.001))
13007 value = min;
13008
13009 if (value == min)
13010 {
13011 if (destroy_config)
13012 {
13013 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
13014 if (dstr)
13015 {
13017 this.Delete();
13018 return true;
13019 }
13020 }
13021 else if (destroy_forced)
13022 {
13024 this.Delete();
13025 return true;
13026 }
13027
13029 }
13030
13033
13035 {
13037
13038 if (delta)
13040 }
13041
13043
13044 return false;
13045 }
13046
13047
13049 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
13050 {
13052 }
13053
13055 {
13058 }
13059
13061 {
13064 }
13065
13067 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
13068 {
13069 float value_clamped = Math.Clamp(value, 0, 1);
13071 SetQuantity(result, destroy_config, destroy_forced);
13072 }
13073
13074
13077 {
13079 }
13080
13082 {
13084 }
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13096 {
13097 int slot = -1;
13098 if (GetInventory())
13099 {
13100 InventoryLocation il = new InventoryLocation;
13101 GetInventory().GetCurrentInventoryLocation(il);
13103 }
13104
13106 }
13107
13109 {
13110 float quantity_max = 0;
13111
13113 {
13114 if (attSlotID != -1)
13115 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
13116
13117 if (quantity_max <= 0)
13119 }
13120
13121 if (quantity_max <= 0)
13123
13124 return quantity_max;
13125 }
13126
13128 {
13130 }
13131
13133 {
13135 }
13136
13137
13139 {
13141 }
13142
13144 {
13146 }
13147
13149 {
13151 }
13152
13153
13155 {
13156
13157 float weightEx = GetWeightEx();
13158 float special = GetInventoryAndCargoWeight();
13159 return weightEx - special;
13160 }
13161
13162
13164 {
13166 }
13167
13169 {
13171 {
13172 #ifdef DEVELOPER
13173 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13174 {
13175 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13177 }
13178 #endif
13179
13180 return GetQuantity() * GetConfigWeightModified();
13181 }
13182 else if (HasEnergyManager())
13183 {
13184 #ifdef DEVELOPER
13185 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13186 {
13187 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13188 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13189 }
13190 #endif
13191 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13192 }
13193 else
13194 {
13195 #ifdef DEVELOPER
13196 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13197 {
13198 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13199 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13200 }
13201 #endif
13202 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13203 }
13204 }
13205
13208 {
13209 int item_count = 0;
13211
13212 if (GetInventory().GetCargo() != NULL)
13213 {
13214 item_count = GetInventory().GetCargo().GetItemCount();
13215 }
13216
13217 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13218 {
13219 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13220 if (item)
13221 item_count += item.GetNumberOfItems();
13222 }
13223 return item_count;
13224 }
13225
13228 {
13229 float weight = 0;
13230 float wetness = 1;
13231 if (include_wetness)
13234 {
13235 weight = wetness * m_ConfigWeight;
13236 }
13238 {
13239 weight = 1;
13240 }
13241 return weight;
13242 }
13243
13244
13245
13247 {
13248 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13249 {
13250 GameInventory inv = GetInventory();
13251 array<EntityAI> items = new array<EntityAI>;
13253 for (int i = 0; i < items.Count(); i++)
13254 {
13256 if (item)
13257 {
13259 }
13260 }
13261 }
13262 }
13263
13264
13265
13266
13268 {
13269 float energy = 0;
13270 if (HasEnergyManager())
13271 {
13272 energy = GetCompEM().GetEnergy();
13273 }
13274 return energy;
13275 }
13276
13277
13279 {
13280 super.OnEnergyConsumed();
13281
13283 }
13284
13286 {
13287 super.OnEnergyAdded();
13288
13290 }
13291
13292
13294 {
13295 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13296 {
13298 {
13299 float energy_0to1 = GetCompEM().GetEnergy0To1();
13301 }
13302 }
13303 }
13304
13305
13307 {
13308 return ConfigGetFloat("heatIsolation");
13309 }
13310
13312 {
13314 }
13315
13317 {
13318 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13319 if (
GetGame().ConfigIsExisting(paramPath))
13321
13322 return 0.0;
13323 }
13324
13326 {
13327 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13328 if (
GetGame().ConfigIsExisting(paramPath))
13330
13331 return 0.0;
13332 }
13333
13334 override void SetWet(
float value,
bool allow_client =
false)
13335 {
13336 if (!IsServerCheck(allow_client))
13337 return;
13338
13341
13343
13344 m_VarWet = Math.Clamp(value, min, max);
13345
13347 {
13350 }
13351 }
13352
13353 override void AddWet(
float value)
13354 {
13356 }
13357
13359 {
13361 }
13362
13364 {
13366 }
13367
13369 {
13371 }
13372
13374 {
13376 }
13377
13379 {
13381 }
13382
13383 override void OnWetChanged(
float newVal,
float oldVal)
13384 {
13387 if (newLevel != oldLevel)
13388 {
13390 }
13391 }
13392
13394 {
13395 SetWeightDirty();
13396 }
13397
13399 {
13400 return GetWetLevelInternal(
m_VarWet);
13401 }
13402
13403
13404
13406 {
13408 }
13409
13411 {
13413 }
13414
13416 {
13418 }
13419
13421 {
13423 }
13424
13425
13426
13428 {
13429 if (ConfigIsExisting("itemModelLength"))
13430 {
13431 return ConfigGetFloat("itemModelLength");
13432 }
13433 return 0;
13434 }
13435
13437 {
13438 if (ConfigIsExisting("itemAttachOffset"))
13439 {
13440 return ConfigGetFloat("itemAttachOffset");
13441 }
13442 return 0;
13443 }
13444
13445 override void SetCleanness(
int value,
bool allow_client =
false)
13446 {
13447 if (!IsServerCheck(allow_client))
13448 return;
13449
13451
13453
13456 }
13457
13459 {
13461 }
13462
13464 {
13465 return true;
13466 }
13467
13468
13469
13470
13472 {
13474 }
13475
13477 {
13479 }
13480
13481
13482
13483
13484 override void SetColor(
int r,
int g,
int b,
int a)
13485 {
13491 }
13493 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13494 {
13499 }
13500
13502 {
13504 }
13505
13508 {
13509 int r,g,b,a;
13511 r = r/255;
13512 g = g/255;
13513 b = b/255;
13514 a = a/255;
13515 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13516 }
13517
13518
13519
13520 override void SetLiquidType(
int value,
bool allow_client =
false)
13521 {
13522 if (!IsServerCheck(allow_client))
13523 return;
13524
13529 }
13530
13532 {
13533 return ConfigGetInt("varLiquidTypeInit");
13534 }
13535
13537 {
13539 }
13540
13542 {
13544 SetFrozen(false);
13545 }
13546
13549 {
13550 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13551 }
13552
13553
13556 {
13557 PlayerBase nplayer;
13558 if (PlayerBase.CastTo(nplayer, player))
13559 {
13561
13562 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13563 }
13564 }
13565
13566
13569 {
13570 PlayerBase nplayer;
13571 if (PlayerBase.CastTo(nplayer,player))
13572 {
13573
13574 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13575
13576 }
13577
13578
13579 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13580
13581
13582 if (HasEnergyManager())
13583 {
13584 GetCompEM().UpdatePlugState();
13585 }
13586 }
13587
13588
13590 {
13591 super.OnPlacementStarted(player);
13592
13594 }
13595
13596 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13597 {
13599 {
13600 m_AdminLog.OnPlacementComplete(player,
this);
13601 }
13602
13603 super.OnPlacementComplete(player, position, orientation);
13604 }
13605
13606
13607
13608
13609
13611 {
13613 {
13614 return true;
13615 }
13616 else
13617 {
13618 return false;
13619 }
13620 }
13621
13622
13624 {
13626 {
13628 }
13629 }
13630
13631
13633 {
13635 }
13636
13638 {
13640 }
13641
13642 override void InsertAgent(
int agent,
float count = 1)
13643 {
13644 if (count < 1)
13645 return;
13646
13648 }
13649
13652 {
13654 }
13655
13656
13658 {
13660 }
13661
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
13704 {
13706 return false;
13707 return true;
13708 }
13709
13711 {
13712
13714 }
13715
13716
13719 {
13720 super.CheckForRoofLimited(timeTresholdMS);
13721
13723 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13724 {
13725 m_PreviousRoofTestTime = time;
13726 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13727 }
13728 }
13729
13730
13732 {
13734 {
13735 return 0;
13736 }
13737
13738 if (GetInventory().GetAttachmentSlotsCount() != 0)
13739 {
13740 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13741 if (filter)
13742 return filter.GetProtectionLevel(type, false, system);
13743 else
13744 return 0;
13745 }
13746
13747 string subclassPath, entryName;
13748
13749 switch (type)
13750 {
13752 entryName = "biological";
13753 break;
13755 entryName = "chemical";
13756 break;
13757 default:
13758 entryName = "biological";
13759 break;
13760 }
13761
13762 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13763
13765 }
13766
13767
13768
13771 {
13772 if (!IsMagazine())
13774
13776 }
13777
13778
13779
13780
13781
13786 {
13787 return true;
13788 }
13789
13791 {
13793 }
13794
13795
13796
13797
13798
13800 {
13801 if (parent)
13802 {
13803 if (parent.IsInherited(DayZInfected))
13804 return true;
13805
13806 if (!parent.IsRuined())
13807 return true;
13808 }
13809
13810 return true;
13811 }
13812
13814 {
13815 if (!super.CanPutAsAttachment(parent))
13816 {
13817 return false;
13818 }
13819
13820 if (!IsRuined() && !parent.IsRuined())
13821 {
13822 return true;
13823 }
13824
13825 return false;
13826 }
13827
13829 {
13830
13831
13832
13833
13834 return super.CanReceiveItemIntoCargo(item);
13835 }
13836
13838 {
13839
13840
13841
13842
13843 GameInventory attachmentInv = attachment.GetInventory();
13845 {
13846 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13847 return false;
13848 }
13849
13850 InventoryLocation loc = new InventoryLocation();
13851 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13852 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13853 return false;
13854
13855 return super.CanReceiveAttachment(attachment, slotId);
13856 }
13857
13859 {
13860 if (!super.CanReleaseAttachment(attachment))
13861 return false;
13862
13863 return GetInventory().AreChildrenAccessible();
13864 }
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13887 {
13888 int id = muzzle_owner.GetMuzzleID();
13889 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13890
13891 if (WPOF_array)
13892 {
13893 for (int i = 0; i < WPOF_array.Count(); i++)
13894 {
13895 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13896
13897 if (WPOF)
13898 {
13899 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13900 }
13901 }
13902 }
13903 }
13904
13905
13907 {
13908 int id = muzzle_owner.GetMuzzleID();
13910
13911 if (WPOBE_array)
13912 {
13913 for (int i = 0; i < WPOBE_array.Count(); i++)
13914 {
13915 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13916
13917 if (WPOBE)
13918 {
13919 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13920 }
13921 }
13922 }
13923 }
13924
13925
13927 {
13928 int id = muzzle_owner.GetMuzzleID();
13929 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13930
13931 if (WPOOH_array)
13932 {
13933 for (int i = 0; i < WPOOH_array.Count(); i++)
13934 {
13935 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13936
13937 if (WPOOH)
13938 {
13939 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13940 }
13941 }
13942 }
13943 }
13944
13945
13947 {
13948 int id = muzzle_owner.GetMuzzleID();
13949 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13950
13951 if (WPOOH_array)
13952 {
13953 for (int i = 0; i < WPOOH_array.Count(); i++)
13954 {
13955 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13956
13957 if (WPOOH)
13958 {
13959 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13960 }
13961 }
13962 }
13963 }
13964
13965
13967 {
13968 int id = muzzle_owner.GetMuzzleID();
13969 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13970
13971 if (WPOOH_array)
13972 {
13973 for (int i = 0; i < WPOOH_array.Count(); i++)
13974 {
13975 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13976
13977 if (WPOOH)
13978 {
13979 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13980 }
13981 }
13982 }
13983 }
13984
13985
13986
13988 {
13990 {
13991 return true;
13992 }
13993
13994 return false;
13995 }
13996
13998 {
14000 {
14001 return true;
14002 }
14003
14004 return false;
14005 }
14006
14008 {
14010 {
14011 return true;
14012 }
14013
14014 return false;
14015 }
14016
14018 {
14019 return false;
14020 }
14021
14024 {
14025 return UATimeSpent.DEFAULT_DEPLOY;
14026 }
14027
14028
14029
14030
14032 {
14034 SetSynchDirty();
14035 }
14036
14038 {
14040 }
14041
14042
14044 {
14045 return false;
14046 }
14047
14050 {
14051 string att_type = "None";
14052
14053 if (ConfigIsExisting("soundAttType"))
14054 {
14055 att_type = ConfigGetString("soundAttType");
14056 }
14057
14059 }
14060
14062 {
14064 }
14065
14066
14067
14068
14069
14075
14077 {
14080
14082 }
14083
14084
14086 {
14088 return;
14089
14091
14094
14097
14098 SoundParameters params = new SoundParameters();
14102 }
14103
14104
14106 {
14108 return;
14109
14111 SetSynchDirty();
14112
14115 }
14116
14117
14119 {
14121 return;
14122
14124 SetSynchDirty();
14125
14128 }
14129
14131 {
14133 }
14134
14136 {
14138 }
14139
14142 {
14143 if (!
GetGame().IsDedicatedServer())
14144 {
14145 if (ConfigIsExisting("attachSoundSet"))
14146 {
14147 string cfg_path = "";
14148 string soundset = "";
14149 string type_name =
GetType();
14150
14153 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
14154 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
14155
14156 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
14157 {
14158 for (int i = 0; i < cfg_soundset_array.Count(); i++)
14159 {
14160 if (cfg_slot_array[i] == slot_type)
14161 {
14162 soundset = cfg_soundset_array[i];
14163 break;
14164 }
14165 }
14166 }
14167
14168 if (soundset != "")
14169 {
14170 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14172 }
14173 }
14174 }
14175 }
14176
14178 {
14179
14180 }
14181
14182 void OnApply(PlayerBase player);
14183
14185 {
14186 return 1.0;
14187 };
14188
14190 {
14192 }
14193
14195 {
14197 }
14198
14200
14202 {
14203 SetDynamicPhysicsLifeTime(0.01);
14205 }
14206
14208 {
14209 array<string> zone_names = new array<string>;
14210 GetDamageZones(zone_names);
14211 for (int i = 0; i < zone_names.Count(); i++)
14212 {
14213 SetHealthMax(zone_names.Get(i),"Health");
14214 }
14215 SetHealthMax("","Health");
14216 }
14217
14220 {
14221 float global_health = GetHealth01("","Health");
14222 array<string> zones = new array<string>;
14223 GetDamageZones(zones);
14224
14225 for (int i = 0; i < zones.Count(); i++)
14226 {
14227 SetHealth01(zones.Get(i),"Health",global_health);
14228 }
14229 }
14230
14233 {
14234 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14235 }
14236
14238 {
14239 if (!hasRootAsPlayer)
14240 {
14241 if (refParentIB)
14242 {
14243
14244 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14245 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14246
14247 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14248 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14249
14252 }
14253 else
14254 {
14255
14258 }
14259 }
14260 }
14261
14263 {
14265 {
14266 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14267 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14268 {
14269 float heatPermCoef = 1.0;
14271 while (ent)
14272 {
14273 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14274 ent = ent.GetHierarchyParent();
14275 }
14276
14277 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14278 }
14279 }
14280 }
14281
14283 {
14284
14285 EntityAI parent = GetHierarchyParent();
14286 if (!parent)
14287 {
14288 hasParent = false;
14289 hasRootAsPlayer = false;
14290 }
14291 else
14292 {
14293 hasParent = true;
14294 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14295 refParentIB =
ItemBase.Cast(parent);
14296 }
14297 }
14298
14299 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14300 {
14301
14302 }
14303
14305 {
14306
14307 return false;
14308 }
14309
14311 {
14312
14313
14314 return false;
14315 }
14316
14318 {
14319
14320 return false;
14321 }
14322
14325 {
14326 return !GetIsFrozen() &&
IsOpen();
14327 }
14328
14330 {
14331 bool hasParent = false, hasRootAsPlayer = false;
14333
14334 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14335 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14336
14337 if (wwtu || foodDecay)
14338 {
14342
14343 if (processWetness || processTemperature || processDecay)
14344 {
14346
14347 if (processWetness)
14348 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14349
14350 if (processTemperature)
14352
14353 if (processDecay)
14354 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14355 }
14356 }
14357 }
14358
14361 {
14363 }
14364
14366 {
14369
14370 return super.GetTemperatureFreezeThreshold();
14371 }
14372
14374 {
14377
14378 return super.GetTemperatureThawThreshold();
14379 }
14380
14382 {
14385
14386 return super.GetItemOverheatThreshold();
14387 }
14388
14390 {
14392 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14393
14394 return super.GetTemperatureFreezeTime();
14395 }
14396
14398 {
14400 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14401
14402 return super.GetTemperatureThawTime();
14403 }
14404
14409
14411 {
14412 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14413 }
14414
14416 {
14417 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14418 }
14419
14422 {
14424 }
14425
14427 {
14429 }
14430
14432 {
14434 }
14435
14438 {
14439 return null;
14440 }
14441
14444 {
14445 return false;
14446 }
14447
14449 {
14451 {
14454 if (!trg)
14455 {
14457 explosive = this;
14458 }
14459
14460 explosive.PairRemote(trg);
14462
14463 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14464 trg.SetPersistentPairID(persistentID);
14465 explosive.SetPersistentPairID(persistentID);
14466
14467 return true;
14468 }
14469 return false;
14470 }
14471
14474 {
14475 float ret = 1.0;
14478 ret *= GetHealth01();
14479
14480 return ret;
14481 }
14482
14483 #ifdef DEVELOPER
14484 override void SetDebugItem()
14485 {
14486 super.SetDebugItem();
14487 _itemBase = this;
14488 }
14489
14491 {
14492 string text = super.GetDebugText();
14493
14495 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14496
14497 return text;
14498 }
14499 #endif
14500
14502 {
14503 return true;
14504 }
14505
14507
14509
14511 {
14514 }
14515
14516
14524
14540}
14541
14543{
14545 if (entity)
14546 {
14547 bool is_item = entity.IsInherited(
ItemBase);
14548 if (is_item && full_quantity)
14549 {
14552 }
14553 }
14554 else
14555 {
14557 return NULL;
14558 }
14559 return entity;
14560}
14561
14563{
14564 if (item)
14565 {
14566 if (health > 0)
14567 item.SetHealth("", "", health);
14568
14569 if (item.CanHaveTemperature())
14570 {
14572 if (item.CanFreeze())
14573 item.SetFrozen(false);
14574 }
14575
14576 if (item.HasEnergyManager())
14577 {
14578 if (quantity >= 0)
14579 {
14580 item.GetCompEM().SetEnergy0To1(quantity);
14581 }
14582 else
14583 {
14585 }
14586 }
14587 else if (item.IsMagazine())
14588 {
14589 Magazine mag = Magazine.Cast(item);
14590 if (quantity >= 0)
14591 {
14592 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14593 }
14594 else
14595 {
14597 }
14598
14599 }
14600 else
14601 {
14602 if (quantity >= 0)
14603 {
14604 item.SetQuantityNormalized(quantity, false);
14605 }
14606 else
14607 {
14609 }
14610
14611 }
14612 }
14613}
14614
14615#ifdef DEVELOPER
14617#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.