9690{
9692 {
9693 return true;
9694 }
9695};
9696
9697
9698
9700{
9704
9706
9709
9710
9711
9712
9713
9722
9728
9733
9738
9759 protected bool m_IsResultOfSplit
9760
9762
9767
9768
9769
9771
9775
9776
9777
9779
9782
9783
9784
9790
9791
9799
9802
9803
9805
9806
9808
9809
9814
9815
9820
9821
9823
9824
9826 {
9831
9832 if (!
GetGame().IsDedicatedServer())
9833 {
9835 {
9837
9839 {
9841 }
9842 }
9843
9846 }
9847
9848 m_OldLocation = null;
9849
9851 {
9853 }
9854
9855 if (ConfigIsExisting("headSelectionsToHide"))
9856 {
9859 }
9860
9862 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9863 {
9865 }
9866
9868
9869 m_IsResultOfSplit = false;
9870
9872 }
9873
9875 {
9876 super.InitItemVariables();
9877
9883 m_Count = ConfigGetInt(
"count");
9884
9887
9892
9895
9900
9912
9916
9917
9920 if (ConfigIsExisting("canBeSplit"))
9921 {
9924 }
9925
9927 if (ConfigIsExisting("itemBehaviour"))
9929
9930
9933 RegisterNetSyncVariableInt("m_VarLiquidType");
9934 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9935
9936 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9937 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9938 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9939
9940 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9941 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9942 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9943 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9944
9945 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9946 RegisterNetSyncVariableBool("m_IsTakeable");
9947 RegisterNetSyncVariableBool("m_IsHologram");
9948
9951 {
9954 }
9955
9957
9959 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9961
9962 }
9963
9965 {
9967 }
9968
9970 {
9973 {
9978 }
9979 }
9980
9981 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9982 {
9984 {
9987 }
9988
9990 }
9991
9993 {
9999 }
10000
10002
10004 {
10006
10007 if (!action)
10008 {
10009 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
10010 return;
10011 }
10012
10014 if (!ai)
10015 {
10017 return;
10018 }
10019
10021 if (!action_array)
10022 {
10023 action_array = new array<ActionBase_Basic>;
10025 }
10026 if (LogManager.IsActionLogEnable())
10027 {
10028 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
10029 }
10030
10031 if (action_array.Find(action) != -1)
10032 {
10033 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
10034 }
10035 else
10036 {
10037 action_array.Insert(action);
10038 }
10039 }
10040
10042 {
10044 ActionBase action = player.GetActionManager().GetAction(actionName);
10047
10048 if (action_array)
10049 {
10050 action_array.RemoveItem(action);
10051 }
10052 }
10053
10054
10055
10057 {
10058 ActionOverrideData overrideData = new ActionOverrideData();
10062
10064 if (!actionMap)
10065 {
10068 }
10069
10070 actionMap.Insert(this.
Type(), overrideData);
10071
10072 }
10073
10075
10077
10078
10080 {
10083
10086
10087 string config_to_search = "CfgVehicles";
10088 string muzzle_owner_config;
10089
10091 {
10092 if (IsInherited(Weapon))
10093 config_to_search = "CfgWeapons";
10094
10095 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10096
10097 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
10098
10100
10101 if (config_OnFire_subclass_count > 0)
10102 {
10103 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
10104
10105 for (int i = 0; i < config_OnFire_subclass_count; i++)
10106 {
10107 string particle_class = "";
10109 string config_OnFire_entry = config_OnFire_class + particle_class;
10110 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
10111 WPOF_array.Insert(WPOF);
10112 }
10113
10114
10116 }
10117 }
10118
10120 {
10121 config_to_search = "CfgWeapons";
10122 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10123
10124 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
10125
10127
10128 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
10129 {
10130 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
10131
10132 for (i = 0; i < config_OnBulletCasingEject_count; i++)
10133 {
10134 string particle_class2 = "";
10136 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
10137 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
10138 WPOBE_array.Insert(WPOBE);
10139 }
10140
10141
10143 }
10144 }
10145 }
10146
10147
10149 {
10152
10154 {
10155 string config_to_search = "CfgVehicles";
10156
10157 if (IsInherited(Weapon))
10158 config_to_search = "CfgWeapons";
10159
10160 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10161 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10162
10163 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10164 {
10165
10167
10169 {
10171 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10173 return;
10174 }
10175
10178
10179
10180
10182 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10183
10184 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10185 {
10186 string particle_class = "";
10188 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10190
10191 if (entry_type == CT_CLASS)
10192 {
10193 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10194 WPOOH_array.Insert(WPOF);
10195 }
10196 }
10197
10198
10200 }
10201 }
10202 }
10203
10205 {
10207 }
10208
10210 {
10212 {
10214
10217
10220
10221 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10222 }
10223 }
10224
10226 {
10228 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10229
10231 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10232
10234 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10235
10237 {
10239 }
10240 }
10241
10243 {
10245 }
10246
10248 {
10251 else
10253
10255 {
10258 }
10259 else
10260 {
10263
10266 }
10267
10269 }
10270
10272 {
10274 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10275 }
10276
10278 {
10280 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10282 }
10283
10285 {
10287 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10288 }
10289
10291 {
10294
10295 OverheatingParticle OP = new OverheatingParticle();
10300
10302 }
10303
10305 {
10308
10309 return -1;
10310 }
10311
10313 {
10315 {
10318
10319 for (int i = count; i > 0; --i)
10320 {
10321 int id = i - 1;
10324
10327
10328 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10329 {
10330 if (p)
10331 {
10334 }
10335 }
10336 }
10337 }
10338 }
10339
10341 {
10343 {
10345 {
10346 int id = i - 1;
10348
10349 if (OP)
10350 {
10352
10353 if (p)
10354 {
10356 }
10357
10358 delete OP;
10359 }
10360 }
10361
10364 }
10365 }
10366
10369 {
10370 return 0.0;
10371 }
10372
10373
10375 {
10376 return 250;
10377 }
10378
10380 {
10381 return 0;
10382 }
10383
10386 {
10388 return true;
10389
10390 return false;
10391 }
10392
10395 {
10398
10400 {
10402 }
10403 else
10404 {
10405
10407 }
10408
10410 }
10411
10418 {
10419 return -1;
10420 }
10421
10422
10423
10424
10426 {
10428 {
10430 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10431
10432 if (r_index >= 0)
10433 {
10434 InventoryLocation r_il = new InventoryLocation;
10435 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10436
10437 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10440 {
10441 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10442 }
10444 {
10445 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10446 }
10447
10448 }
10449
10450 player.GetHumanInventory().ClearUserReservedLocation(this);
10451 }
10452
10455 }
10456
10457
10458
10459
10461 {
10462 return ItemBase.m_DebugActionsMask;
10463 }
10464
10466 {
10467 return ItemBase.m_DebugActionsMask & mask;
10468 }
10469
10471 {
10472 ItemBase.m_DebugActionsMask = mask;
10473 }
10474
10476 {
10477 ItemBase.m_DebugActionsMask |= mask;
10478 }
10479
10481 {
10482 ItemBase.m_DebugActionsMask &= ~mask;
10483 }
10484
10486 {
10488 {
10490 }
10491 else
10492 {
10494 }
10495 }
10496
10497
10499 {
10500 if (GetEconomyProfile())
10501 {
10502 float q_max = GetEconomyProfile().GetQuantityMax();
10503 if (q_max > 0)
10504 {
10505 float q_min = GetEconomyProfile().GetQuantityMin();
10506 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10507
10509 {
10510 ComponentEnergyManager comp = GetCompEM();
10512 {
10514 }
10515 }
10517 {
10519
10520 }
10521
10522 }
10523 }
10524 }
10525
10528 {
10529 EntityAI parent = GetHierarchyParent();
10530
10531 if (parent)
10532 {
10533 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10534 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10535 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10536 }
10537 }
10538
10541 {
10542 EntityAI parent = GetHierarchyParent();
10543
10544 if (parent)
10545 {
10546 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10547 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10548 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10549 }
10550 }
10551
10553 {
10554
10555
10556
10557
10559
10561 {
10562 if (ScriptInputUserData.CanStoreInputUserData())
10563 {
10564 ScriptInputUserData ctx = new ScriptInputUserData;
10570 ctx.
Write(use_stack_max);
10573
10575 {
10576 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10577 }
10578 }
10579 }
10580 else if (!
GetGame().IsMultiplayer())
10581 {
10583 }
10584 }
10585
10587 {
10589 }
10590
10592 {
10594 }
10595
10597 {
10599 }
10600
10602 {
10603
10604 return false;
10605 }
10606
10608 {
10609 return false;
10610 }
10611
10615 {
10616 return false;
10617 }
10618
10620 {
10621 return "";
10622 }
10623
10625
10627 {
10628 return false;
10629 }
10630
10632 {
10633 return true;
10634 }
10635
10636
10637
10639 {
10640 return true;
10641 }
10642
10644 {
10645 return true;
10646 }
10647
10649 {
10650 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10652 }
10653
10655 {
10657 }
10658
10660 {
10662 if (!is_being_placed)
10664 SetSynchDirty();
10665 }
10666
10667
10669
10671 {
10673 }
10674
10676 {
10678 }
10679
10681 {
10682 return 1;
10683 }
10684
10686 {
10687 return false;
10688 }
10689
10691 {
10693 SetSynchDirty();
10694 }
10695
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
10731 {
10732 super.OnMovedInsideCargo(container);
10733
10734 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10735 }
10736
10737 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10738 {
10739 super.EEItemLocationChanged(oldLoc,newLoc);
10740
10741 PlayerBase new_player = null;
10742 PlayerBase old_player = null;
10743
10744 if (newLoc.GetParent())
10745 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10746
10747 if (oldLoc.GetParent())
10748 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10749
10751 {
10752 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10753
10754 if (r_index >= 0)
10755 {
10756 InventoryLocation r_il = new InventoryLocation;
10757 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10758
10759 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10762 {
10763 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10764 }
10766 {
10767 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10768 }
10769
10770 }
10771 }
10772
10774 {
10775 if (new_player)
10776 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10777
10778 if (new_player == old_player)
10779 {
10780
10781 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10782 {
10784 {
10785 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10786 {
10787 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10788 }
10789 }
10790 else
10791 {
10792 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10793 }
10794 }
10795
10796 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10797 {
10798 int type = oldLoc.GetType();
10800 {
10801 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10802 }
10804 {
10805 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10806 }
10807 }
10808 if (!m_OldLocation)
10809 {
10810 m_OldLocation = new InventoryLocation;
10811 }
10812 m_OldLocation.Copy(oldLoc);
10813 }
10814 else
10815 {
10816 if (m_OldLocation)
10817 {
10818 m_OldLocation.Reset();
10819 }
10820 }
10821
10823 }
10824 else
10825 {
10826 if (new_player)
10827 {
10828 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10829 if (res_index >= 0)
10830 {
10831 InventoryLocation il = new InventoryLocation;
10832 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10834 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10837 {
10838 il.
GetParent().GetOnReleaseLock().Invoke(it);
10839 }
10841 {
10843 }
10844
10845 }
10846 }
10848 {
10849
10851 }
10852
10853 if (m_OldLocation)
10854 {
10855 m_OldLocation.Reset();
10856 }
10857 }
10858 }
10859
10860 override void EOnContact(IEntity other, Contact extra)
10861 {
10863 {
10864 int liquidType = -1;
10866 if (impactSpeed > 0.0)
10867 {
10869 #ifndef SERVER
10871 #else
10873 SetSynchDirty();
10874 #endif
10876 }
10877 }
10878
10879 #ifdef SERVER
10880 if (GetCompEM() && GetCompEM().IsPlugged())
10881 {
10882 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10883 GetCompEM().UnplugThis();
10884 }
10885 #endif
10886 }
10887
10889
10891 {
10893 }
10894
10896 {
10897
10898 }
10899
10901 {
10902 super.OnItemLocationChanged(old_owner, new_owner);
10903
10904 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10905 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10906
10907 if (!relatedPlayer && playerNew)
10908 relatedPlayer = playerNew;
10909
10910 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10911 {
10913 if (actionMgr)
10914 {
10915 ActionBase currentAction = actionMgr.GetRunningAction();
10916 if (currentAction)
10918 }
10919 }
10920
10921 Man ownerPlayerOld = null;
10922 Man ownerPlayerNew = null;
10923
10924 if (old_owner)
10925 {
10926 if (old_owner.
IsMan())
10927 {
10928 ownerPlayerOld = Man.Cast(old_owner);
10929 }
10930 else
10931 {
10932 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10933 }
10934 }
10935 else
10936 {
10938 {
10940
10941 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10942 {
10943 GetCompEM().UnplugThis();
10944 }
10945 }
10946 }
10947
10948 if (new_owner)
10949 {
10950 if (new_owner.
IsMan())
10951 {
10952 ownerPlayerNew = Man.Cast(new_owner);
10953 }
10954 else
10955 {
10956 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10957 }
10958 }
10959
10960 if (ownerPlayerOld != ownerPlayerNew)
10961 {
10962 if (ownerPlayerOld)
10963 {
10964 array<EntityAI> subItemsExit = new array<EntityAI>;
10966 for (int i = 0; i < subItemsExit.Count(); i++)
10967 {
10970 }
10971 }
10972
10973 if (ownerPlayerNew)
10974 {
10975 array<EntityAI> subItemsEnter = new array<EntityAI>;
10977 for (int j = 0; j < subItemsEnter.Count(); j++)
10978 {
10981 }
10982 }
10983 }
10984 else if (ownerPlayerNew != null)
10985 {
10986 PlayerBase nplayer;
10987 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10988 {
10989 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10991 for (int k = 0; k < subItemsUpdate.Count(); k++)
10992 {
10994 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10995 }
10996 }
10997 }
10998
10999 if (old_owner)
11000 old_owner.OnChildItemRemoved(this);
11001 if (new_owner)
11002 new_owner.OnChildItemReceived(this);
11003 }
11004
11005
11007 {
11008 super.EEDelete(parent);
11009 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
11010 if (player)
11011 {
11013
11014 if (player.IsAlive())
11015 {
11016 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
11017 if (r_index >= 0)
11018 {
11019 InventoryLocation r_il = new InventoryLocation;
11020 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
11021
11022 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
11025 {
11026 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
11027 }
11029 {
11030 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
11031 }
11032
11033 }
11034
11035 player.RemoveQuickBarEntityShortcut(this);
11036 }
11037 }
11038 }
11039
11041 {
11042 super.EEKilled(killer);
11043
11046 {
11047 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
11048 {
11049 if (IsMagazine())
11050 {
11051 if (Magazine.Cast(this).GetAmmoCount() > 0)
11052 {
11054 }
11055 }
11056 else
11057 {
11059 }
11060 }
11061 }
11062 }
11063
11065 {
11066 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
11067
11068 super.OnWasAttached(parent, slot_id);
11069
11072
11074 }
11075
11077 {
11078 super.OnWasDetached(parent, slot_id);
11079
11082 }
11083
11085 {
11086 int idx;
11089
11090 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11091 if (inventory_slots.Count() < 1)
11092 {
11093 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
11094 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
11095 }
11096 else
11097 {
11098 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
11099 }
11100
11101 idx = inventory_slots.Find(slot);
11102 if (idx < 0)
11103 return "";
11104
11105 return attach_types.Get(idx);
11106 }
11107
11109 {
11110 int idx = -1;
11111 string slot;
11112
11115
11116 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
11117 if (inventory_slots.Count() < 1)
11118 {
11119 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
11120 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11121 }
11122 else
11123 {
11124 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
11125 if (detach_types.Count() < 1)
11126 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
11127 }
11128
11129 for (int i = 0; i < inventory_slots.Count(); i++)
11130 {
11131 slot = inventory_slots.Get(i);
11132 }
11133
11134 if (slot != "")
11135 {
11136 if (detach_types.Count() == 1)
11137 idx = 0;
11138 else
11139 idx = inventory_slots.Find(slot);
11140 }
11141 if (idx < 0)
11142 return "";
11143
11144 return detach_types.Get(idx);
11145 }
11146
11148 {
11149
11151
11152
11153 float min_time = 1;
11154 float max_time = 3;
11155 float delay = Math.RandomFloat(min_time, max_time);
11156
11157 explode_timer.Run(delay, this, "DoAmmoExplosion");
11158 }
11159
11161 {
11162 Magazine magazine = Magazine.Cast(this);
11163 int pop_sounds_count = 6;
11164 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11165
11166
11167 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11168 string sound_name = pop_sounds[ sound_idx ];
11170
11171
11172 magazine.ServerAddAmmoCount(-1);
11173
11174
11175 float min_temp_to_explode = 100;
11176
11177 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11178 {
11180 }
11181 }
11182
11183
11184 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11185 {
11186 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11187
11188 const int CHANCE_DAMAGE_CARGO = 4;
11189 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11190 const int CHANCE_DAMAGE_NOTHING = 2;
11191
11193 {
11194 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11195 int chances;
11196 int rnd;
11197
11198 if (GetInventory().GetCargo())
11199 {
11200 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11201 rnd = Math.RandomInt(0,chances);
11202
11203 if (rnd < CHANCE_DAMAGE_CARGO)
11204 {
11206 }
11207 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11208 {
11210 }
11211 }
11212 else
11213 {
11214 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11215 rnd = Math.RandomInt(0,chances);
11216
11217 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11218 {
11220 }
11221 }
11222 }
11223 }
11224
11226 {
11227 if (GetInventory().GetCargo())
11228 {
11229 int item_count = GetInventory().GetCargo().GetItemCount();
11230 if (item_count > 0)
11231 {
11232 int random_pick = Math.RandomInt(0, item_count);
11234 if (!item.IsExplosive())
11235 {
11236 item.AddHealth("","",damage);
11237 return true;
11238 }
11239 }
11240 }
11241 return false;
11242 }
11243
11245 {
11246 int attachment_count = GetInventory().AttachmentCount();
11247 if (attachment_count > 0)
11248 {
11249 int random_pick = Math.RandomInt(0, attachment_count);
11250 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11251 if (!attachment.IsExplosive())
11252 {
11253 attachment.AddHealth("","",damage);
11254 return true;
11255 }
11256 }
11257 return false;
11258 }
11259
11261 {
11263 }
11264
11266 {
11268 return GetInventory().CanRemoveEntity();
11269
11270 return false;
11271 }
11272
11274 {
11275
11277 return false;
11278
11279
11281 return false;
11282
11283
11284
11286 if (delta == 0)
11287 return false;
11288
11289
11290 return true;
11291 }
11292
11294 {
11296 {
11297 if (ScriptInputUserData.CanStoreInputUserData())
11298 {
11299 ScriptInputUserData ctx = new ScriptInputUserData;
11304 ctx.
Write(destination_entity);
11306 ctx.
Write(slot_id);
11308 }
11309 }
11310 else if (!
GetGame().IsMultiplayer())
11311 {
11313 }
11314 }
11315
11317 {
11318 float split_quantity_new;
11322 InventoryLocation loc = new InventoryLocation;
11323
11324 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11325 {
11327 split_quantity_new = stack_max;
11328 else
11330
11332 {
11333 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11334 if (new_item)
11335 {
11336 new_item.SetResultOfSplit(true);
11337 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11339 new_item.
SetQuantity(split_quantity_new,
false,
true);
11340 }
11341 }
11342 }
11343 else if (destination_entity && slot_id == -1)
11344 {
11345 if (quantity > stack_max)
11346 split_quantity_new = stack_max;
11347 else
11348 split_quantity_new = quantity;
11349
11351 {
11353 {
11356 }
11357
11358 if (new_item)
11359 {
11360 new_item.SetResultOfSplit(true);
11361 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11363 new_item.
SetQuantity(split_quantity_new,
false,
true);
11364 }
11365 }
11366 }
11367 else
11368 {
11369 if (stack_max != 0)
11370 {
11372 {
11374 }
11375
11376 if (split_quantity_new == 0)
11377 {
11378 if (!
GetGame().IsMultiplayer())
11379 player.PhysicalPredictiveDropItem(this);
11380 else
11381 player.ServerDropEntity(this);
11382 return;
11383 }
11384
11386 {
11388
11389 if (new_item)
11390 {
11391 new_item.SetResultOfSplit(true);
11392 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11395 new_item.PlaceOnSurface();
11396 }
11397 }
11398 }
11399 }
11400 }
11401
11403 {
11404 float split_quantity_new;
11408 InventoryLocation loc = new InventoryLocation;
11409
11410 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11411 {
11413 split_quantity_new = stack_max;
11414 else
11416
11418 {
11419 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11420 if (new_item)
11421 {
11422 new_item.SetResultOfSplit(true);
11423 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11425 new_item.
SetQuantity(split_quantity_new,
false,
true);
11426 }
11427 }
11428 }
11429 else if (destination_entity && slot_id == -1)
11430 {
11431 if (quantity > stack_max)
11432 split_quantity_new = stack_max;
11433 else
11434 split_quantity_new = quantity;
11435
11437 {
11439 {
11442 }
11443
11444 if (new_item)
11445 {
11446 new_item.SetResultOfSplit(true);
11447 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11449 new_item.
SetQuantity(split_quantity_new,
false,
true);
11450 }
11451 }
11452 }
11453 else
11454 {
11455 if (stack_max != 0)
11456 {
11458 {
11460 }
11461
11463 {
11465
11466 if (new_item)
11467 {
11468 new_item.SetResultOfSplit(true);
11469 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11472 new_item.PlaceOnSurface();
11473 }
11474 }
11475 }
11476 }
11477 }
11478
11480 {
11482 {
11483 if (ScriptInputUserData.CanStoreInputUserData())
11484 {
11485 ScriptInputUserData ctx = new ScriptInputUserData;
11490 dst.WriteToContext(ctx);
11492 }
11493 }
11494 else if (!
GetGame().IsMultiplayer())
11495 {
11497 }
11498 }
11499
11501 {
11503 {
11504 if (ScriptInputUserData.CanStoreInputUserData())
11505 {
11506 ScriptInputUserData ctx = new ScriptInputUserData;
11511 ctx.
Write(destination_entity);
11517 }
11518 }
11519 else if (!
GetGame().IsMultiplayer())
11520 {
11522 }
11523 }
11524
11526 {
11528 }
11529
11531 {
11533 float split_quantity_new;
11535 if (dst.IsValid())
11536 {
11537 int slot_id = dst.GetSlot();
11539
11540 if (quantity > stack_max)
11541 split_quantity_new = stack_max;
11542 else
11543 split_quantity_new = quantity;
11544
11546 {
11548
11549 if (new_item)
11550 {
11551 new_item.SetResultOfSplit(true);
11552 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11554 new_item.
SetQuantity(split_quantity_new,
false,
true);
11555 }
11556
11557 return new_item;
11558 }
11559 }
11560
11561 return null;
11562 }
11563
11565 {
11567 float split_quantity_new;
11569 if (destination_entity)
11570 {
11572 if (quantity > stackable)
11573 split_quantity_new = stackable;
11574 else
11575 split_quantity_new = quantity;
11576
11578 {
11579 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11580 if (new_item)
11581 {
11582 new_item.SetResultOfSplit(true);
11583 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11585 new_item.
SetQuantity(split_quantity_new,
false,
true);
11586 }
11587 }
11588 }
11589 }
11590
11592 {
11594 {
11595 if (ScriptInputUserData.CanStoreInputUserData())
11596 {
11597 ScriptInputUserData ctx = new ScriptInputUserData;
11602 ItemBase destination_entity =
this;
11603 ctx.
Write(destination_entity);
11607 }
11608 }
11609 else if (!
GetGame().IsMultiplayer())
11610 {
11612 }
11613 }
11614
11616 {
11618 float split_quantity_new;
11620 if (player)
11621 {
11623 if (quantity > stackable)
11624 split_quantity_new = stackable;
11625 else
11626 split_quantity_new = quantity;
11627
11629 {
11630 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11631 new_item =
ItemBase.Cast(in_hands);
11632 if (new_item)
11633 {
11634 new_item.SetResultOfSplit(true);
11635 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11637 new_item.SetQuantity(split_quantity_new, false, true);
11638 }
11639 }
11640 }
11641 }
11642
11644 {
11646 float split_quantity_new = Math.Floor(quantity * 0.5);
11647
11649 return;
11650
11652
11653 if (new_item)
11654 {
11655 if (new_item.GetQuantityMax() < split_quantity_new)
11656 {
11657 split_quantity_new = new_item.GetQuantityMax();
11658 }
11659
11660 new_item.SetResultOfSplit(true);
11661 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11662
11664 {
11667 }
11668 else
11669 {
11671 new_item.
SetQuantity(split_quantity_new,
false,
true);
11672 }
11673 }
11674 }
11675
11677 {
11679 float split_quantity_new = Math.Floor(quantity / 2);
11680
11682 return;
11683
11684 InventoryLocation invloc = new InventoryLocation;
11686
11688 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11689
11690 if (new_item)
11691 {
11692 if (new_item.GetQuantityMax() < split_quantity_new)
11693 {
11694 split_quantity_new = new_item.GetQuantityMax();
11695 }
11697 {
11700 }
11701 else if (split_quantity_new > 1)
11702 {
11704 new_item.
SetQuantity(split_quantity_new,
false,
true);
11705 }
11706 }
11707 }
11708
11711 {
11712 SetWeightDirty();
11714
11715 if (parent)
11716 parent.OnAttachmentQuantityChangedEx(this, delta);
11717
11719 {
11721 {
11723 }
11725 {
11726 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11728 }
11729 }
11730
11731 }
11732
11735 {
11736
11737 }
11738
11741 {
11743 }
11744
11746 {
11747 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11748
11750 {
11751 if (newLevel == GameConstants.STATE_RUINED)
11752 {
11754 EntityAI parent = GetHierarchyParent();
11755 if (parent && parent.IsFireplace())
11756 {
11757 CargoBase cargo = GetInventory().GetCargo();
11758 if (cargo)
11759 {
11761 {
11763 }
11764 }
11765 }
11766 }
11767
11769 {
11770
11772 return;
11773 }
11774
11775 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11776 {
11778 }
11779 }
11780 }
11781
11782
11784 {
11785 super.OnRightClick();
11786
11788 {
11790 {
11791 if (ScriptInputUserData.CanStoreInputUserData())
11792 {
11793 EntityAI root = GetHierarchyRoot();
11794 Man playerOwner = GetHierarchyRootPlayer();
11795 InventoryLocation dst = new InventoryLocation;
11796
11797
11798 if (!playerOwner && root && root == this)
11799 {
11801 }
11802 else
11803 {
11804
11805 GetInventory().GetCurrentInventoryLocation(dst);
11807 {
11810 {
11812 }
11813 else
11814 {
11816
11817
11818 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11819 {
11821 }
11822 else
11823 {
11824 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11825 }
11826 }
11827 }
11828 }
11829
11830 ScriptInputUserData ctx = new ScriptInputUserData;
11838 }
11839 }
11840 else if (!
GetGame().IsMultiplayer())
11841 {
11843 }
11844 }
11845 }
11846
11848 {
11849 if (root)
11850 {
11851 vector m4[4];
11852 root.GetTransform(m4);
11853 dst.SetGround(this, m4);
11854 }
11855 else
11856 {
11857 GetInventory().GetCurrentInventoryLocation(dst);
11858 }
11859 }
11860
11861 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11862 {
11863
11864 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11865 return false;
11866
11867 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11868 return false;
11869
11870
11872 return false;
11873
11874
11875 Magazine mag = Magazine.Cast(this);
11876 if (mag)
11877 {
11878 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11879 return false;
11880
11881 if (stack_max_limit)
11882 {
11883 Magazine other_mag = Magazine.Cast(other_item);
11884 if (other_item)
11885 {
11886 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11887 return false;
11888 }
11889
11890 }
11891 }
11892 else
11893 {
11894
11896 return false;
11897
11899 return false;
11900 }
11901
11902 PlayerBase player = null;
11903 if (CastTo(player, GetHierarchyRootPlayer()))
11904 {
11905 if (player.GetInventory().HasAttachment(this))
11906 return false;
11907
11908 if (player.IsItemsToDelete())
11909 return false;
11910 }
11911
11912 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11913 return false;
11914
11915 int slotID;
11917 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11918 return false;
11919
11920 return true;
11921 }
11922
11924 {
11926 }
11927
11929 {
11930 return m_IsResultOfSplit;
11931 }
11932
11934 {
11935 m_IsResultOfSplit = value;
11936 }
11937
11939 {
11941 }
11942
11944 {
11945 float other_item_quantity = other_item.GetQuantity();
11946 float this_free_space;
11947
11949
11951
11952 if (other_item_quantity > this_free_space)
11953 {
11954 return this_free_space;
11955 }
11956 else
11957 {
11958 return other_item_quantity;
11959 }
11960 }
11961
11963 {
11965 }
11966
11968 {
11970 return;
11971
11972 if (!IsMagazine() && other_item)
11973 {
11975 if (quantity_used != 0)
11976 {
11977 float hp1 = GetHealth01("","");
11978 float hp2 = other_item.GetHealth01("","");
11979 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11980 hpResult = hpResult / (
GetQuantity() + quantity_used);
11981
11982 hpResult *= GetMaxHealth();
11983 Math.Round(hpResult);
11984 SetHealth("", "Health", hpResult);
11985
11987 other_item.AddQuantity(-quantity_used);
11988 }
11989 }
11991 }
11992
11994 {
11995 #ifdef SERVER
11996 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11997 GetHierarchyParent().IncreaseLifetimeUp();
11998 #endif
11999 };
12000
12002 {
12003 PlayerBase p = PlayerBase.Cast(player);
12004
12005 array<int> recipesIds = p.m_Recipes;
12006 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12007 if (moduleRecipesManager)
12008 {
12009 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
12010 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
12011 }
12012
12013 for (int i = 0;i < recipesIds.Count(); i++)
12014 {
12015 int key = recipesIds.Get(i);
12016 string recipeName = moduleRecipesManager.GetRecipeName(key);
12018 }
12019 }
12020
12021
12022 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
12023 {
12024 super.GetDebugActions(outputList);
12025
12026
12032
12033
12038
12043
12044
12048
12049
12051 {
12055 }
12056
12059
12060
12064
12066
12067 InventoryLocation loc = new InventoryLocation();
12068 GetInventory().GetCurrentInventoryLocation(loc);
12070 {
12071 if (Gizmo_IsSupported())
12074 }
12075
12077 }
12078
12079
12080
12081
12083 {
12084 super.OnAction(action_id, player, ctx);
12085
12087 {
12088 switch (action_id)
12089 {
12092 return true;
12095 return true;
12096 }
12097 }
12098
12100 {
12101 switch (action_id)
12102 {
12104 Delete();
12105 return true;
12106 }
12107 }
12108
12109 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
12110 {
12111 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
12112 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
12113 PlayerBase p = PlayerBase.Cast(player);
12114 if (
EActions.RECIPES_RANGE_START < 1000)
12115 {
12116 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
12117 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
12118 }
12119 }
12120 #ifndef SERVER
12121 else if (action_id ==
EActions.WATCH_PLAYER)
12122 {
12123 PluginDeveloper.SetDeveloperItemClientEx(player);
12124 }
12125 #endif
12127 {
12128 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
12129 {
12130 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
12131 OnDebugButtonPressServer(id + 1);
12132 }
12133
12134 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
12135 {
12136 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
12138 }
12139
12140 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
12141 {
12142 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
12144 }
12145
12146 else if (action_id ==
EActions.ADD_QUANTITY)
12147 {
12148 if (IsMagazine())
12149 {
12150 Magazine mag = Magazine.Cast(this);
12151 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
12152 }
12153 else
12154 {
12156 }
12157
12158 if (m_EM)
12159 {
12160 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12161 }
12162
12163 }
12164
12165 else if (action_id ==
EActions.REMOVE_QUANTITY)
12166 {
12167 if (IsMagazine())
12168 {
12169 Magazine mag2 = Magazine.Cast(this);
12170 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12171 }
12172 else
12173 {
12175 }
12176 if (m_EM)
12177 {
12178 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12179 }
12180
12181 }
12182
12183 else if (action_id ==
EActions.SET_QUANTITY_0)
12184 {
12186
12187 if (m_EM)
12188 {
12189 m_EM.SetEnergy(0);
12190 }
12191 }
12192
12193 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12194 {
12196
12197 if (m_EM)
12198 {
12199 m_EM.SetEnergy(m_EM.GetEnergyMax());
12200 }
12201 }
12202
12203 else if (action_id ==
EActions.ADD_HEALTH)
12204 {
12205 AddHealth("","",GetMaxHealth("","Health")/5);
12206 }
12207 else if (action_id ==
EActions.REMOVE_HEALTH)
12208 {
12209 AddHealth("","",-GetMaxHealth("","Health")/5);
12210 }
12211 else if (action_id ==
EActions.DESTROY_HEALTH)
12212 {
12213 SetHealth01("","",0);
12214 }
12215 else if (action_id ==
EActions.WATCH_ITEM)
12216 {
12218 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12219 #ifdef DEVELOPER
12220 SetDebugDeveloper_item(this);
12221 #endif
12222 }
12223
12224 else if (action_id ==
EActions.ADD_TEMPERATURE)
12225 {
12226 AddTemperature(20);
12227
12228 }
12229
12230 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12231 {
12232 AddTemperature(-20);
12233
12234 }
12235
12236 else if (action_id ==
EActions.FLIP_FROZEN)
12237 {
12238 SetFrozen(!GetIsFrozen());
12239
12240 }
12241
12242 else if (action_id ==
EActions.ADD_WETNESS)
12243 {
12245
12246 }
12247
12248 else if (action_id ==
EActions.REMOVE_WETNESS)
12249 {
12251
12252 }
12253
12254 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12255 {
12258
12259
12260 }
12261
12262 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12263 {
12266 }
12267
12268 else if (action_id ==
EActions.MAKE_SPECIAL)
12269 {
12270 auto debugParams = DebugSpawnParams.WithPlayer(player);
12271 OnDebugSpawnEx(debugParams);
12272 }
12273
12274 }
12275
12276
12277 return false;
12278 }
12279
12280
12281
12282
12286
12289
12290
12291
12293 {
12294 return false;
12295 }
12296
12297
12299 {
12300 return true;
12301 }
12302
12303
12305 {
12306 return true;
12307 }
12308
12309
12310
12312 {
12313 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12315 }
12316
12319 {
12320 return null;
12321 }
12322
12324 {
12325 return false;
12326 }
12327
12329 {
12330 return false;
12331 }
12332
12336
12337
12339 {
12340 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12341 return module_repairing.CanRepair(this, item_repair_kit);
12342 }
12343
12344
12345 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12346 {
12347 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12348 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12349 }
12350
12351
12353 {
12354
12355
12356
12357
12358
12359
12360
12361
12362 return 1;
12363 }
12364
12365
12366
12368 {
12370 }
12371
12372
12373
12375 {
12377 }
12378
12379
12388 {
12389 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12390
12391 if (player)
12392 {
12393 player.MessageStatus(text);
12394 }
12395 }
12396
12397
12406 {
12407 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12408
12409 if (player)
12410 {
12411 player.MessageAction(text);
12412 }
12413 }
12414
12415
12424 {
12425 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12426
12427 if (player)
12428 {
12429 player.MessageFriendly(text);
12430 }
12431 }
12432
12433
12442 {
12443 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12444
12445 if (player)
12446 {
12447 player.MessageImportant(text);
12448 }
12449 }
12450
12452 {
12453 return true;
12454 }
12455
12456
12457 override bool KindOf(
string tag)
12458 {
12459 bool found = false;
12460 string item_name = this.
GetType();
12463
12464 int array_size = item_tag_array.Count();
12465 for (int i = 0; i < array_size; i++)
12466 {
12467 if (item_tag_array.Get(i) == tag)
12468 {
12469 found = true;
12470 break;
12471 }
12472 }
12473 return found;
12474 }
12475
12476
12478 {
12479
12480 super.OnRPC(sender, rpc_type,ctx);
12481
12482
12483 switch (rpc_type)
12484 {
12485 #ifndef SERVER
12486 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12487 Param2<bool, string> p = new Param2<bool, string>(false, "");
12488
12490 return;
12491
12492 bool play = p.param1;
12493 string soundSet = p.param2;
12494
12495 if (play)
12496 {
12498 {
12500 {
12502 }
12503 }
12504 else
12505 {
12507 }
12508 }
12509 else
12510 {
12512 }
12513
12514 break;
12515 #endif
12516
12517 }
12518
12520 {
12522 }
12523 }
12524
12525
12526
12527
12529 {
12530 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12531 return plugin.GetID(
name);
12532 }
12533
12535 {
12536 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12537 return plugin.GetName(id);
12538 }
12539
12542 {
12543
12544
12545 int varFlags;
12546 if (!ctx.
Read(varFlags))
12547 return;
12548
12549 if (varFlags & ItemVariableFlags.FLOAT)
12550 {
12552 }
12553 }
12554
12556 {
12557
12558 super.SerializeNumericalVars(floats_out);
12559
12560
12561
12563 {
12565 }
12566
12568 {
12570 }
12571
12573 {
12575 }
12576
12578 {
12583 }
12584
12586 {
12588 }
12589 }
12590
12592 {
12593
12594 super.DeSerializeNumericalVars(floats);
12595
12596
12597 int index = 0;
12598 int mask = Math.Round(floats.Get(index));
12599
12600 index++;
12601
12603 {
12605 {
12607 }
12608 else
12609 {
12610 float quantity = floats.Get(index);
12611 SetQuantity(quantity,
true,
false,
false,
false);
12612 }
12613 index++;
12614 }
12615
12617 {
12618 float wet = floats.Get(index);
12620 index++;
12621 }
12622
12624 {
12625 int liquidtype = Math.Round(floats.Get(index));
12627 index++;
12628 }
12629
12631 {
12633 index++;
12635 index++;
12637 index++;
12639 index++;
12640 }
12641
12643 {
12644 int cleanness = Math.Round(floats.Get(index));
12646 index++;
12647 }
12648 }
12649
12651 {
12652 super.WriteVarsToCTX(ctx);
12653
12654
12656 {
12658 }
12659
12661 {
12663 }
12664
12666 {
12668 }
12669
12671 {
12672 int r,g,b,a;
12678 }
12679
12681 {
12683 }
12684 }
12685
12687 {
12688 if (!super.ReadVarsFromCTX(ctx,version))
12689 return false;
12690
12691 int intValue;
12692 float value;
12693
12694 if (version < 140)
12695 {
12696 if (!ctx.
Read(intValue))
12697 return false;
12698
12699 m_VariablesMask = intValue;
12700 }
12701
12703 {
12704 if (!ctx.
Read(value))
12705 return false;
12706
12708 {
12710 }
12711 else
12712 {
12714 }
12715 }
12716
12717 if (version < 140)
12718 {
12720 {
12721 if (!ctx.
Read(value))
12722 return false;
12723 SetTemperatureDirect(value);
12724 }
12725 }
12726
12728 {
12729 if (!ctx.
Read(value))
12730 return false;
12732 }
12733
12735 {
12736 if (!ctx.
Read(intValue))
12737 return false;
12739 }
12740
12742 {
12743 int r,g,b,a;
12745 return false;
12747 return false;
12749 return false;
12751 return false;
12752
12754 }
12755
12757 {
12758 if (!ctx.
Read(intValue))
12759 return false;
12761 }
12762
12763 if (version >= 138 && version < 140)
12764 {
12766 {
12767 if (!ctx.
Read(intValue))
12768 return false;
12769 SetFrozen(intValue);
12770 }
12771 }
12772
12773 return true;
12774 }
12775
12776
12778 {
12781 {
12783 }
12784
12785 if (!super.OnStoreLoad(ctx, version))
12786 {
12788 return false;
12789 }
12790
12791 if (version >= 114)
12792 {
12793 bool hasQuickBarIndexSaved;
12794
12795 if (!ctx.
Read(hasQuickBarIndexSaved))
12796 {
12798 return false;
12799 }
12800
12801 if (hasQuickBarIndexSaved)
12802 {
12803 int itmQBIndex;
12804
12805
12806 if (!ctx.
Read(itmQBIndex))
12807 {
12809 return false;
12810 }
12811
12812 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12813 if (itmQBIndex != -1 && parentPlayer)
12814 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12815 }
12816 }
12817 else
12818 {
12819
12820 PlayerBase player;
12821 int itemQBIndex;
12822 if (version ==
int.
MAX)
12823 {
12824 if (!ctx.
Read(itemQBIndex))
12825 {
12827 return false;
12828 }
12829 }
12830 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12831 {
12832
12833 if (!ctx.
Read(itemQBIndex))
12834 {
12836 return false;
12837 }
12838 if (itemQBIndex != -1 && player)
12839 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12840 }
12841 }
12842
12843 if (version < 140)
12844 {
12845
12846 if (!LoadVariables(ctx, version))
12847 {
12849 return false;
12850 }
12851 }
12852
12853
12855 {
12857 return false;
12858 }
12859 if (version >= 132)
12860 {
12862 if (raib)
12863 {
12865 {
12867 return false;
12868 }
12869 }
12870 }
12871
12873 return true;
12874 }
12875
12876
12877
12879 {
12880 super.OnStoreSave(ctx);
12881
12882 PlayerBase player;
12883 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12884 {
12886
12887 int itemQBIndex = -1;
12888 itemQBIndex = player.FindQuickBarEntityIndex(this);
12889 ctx.
Write(itemQBIndex);
12890 }
12891 else
12892 {
12894 }
12895
12897
12899 if (raib)
12900 {
12902 }
12903 }
12904
12905
12907 {
12908 super.AfterStoreLoad();
12909
12911 {
12913 }
12914
12916 {
12919 }
12920 }
12921
12923 {
12924 super.EEOnAfterLoad();
12925
12927 {
12929 }
12930
12933 }
12934
12936 {
12937 return false;
12938 }
12939
12940
12941
12943 {
12945 {
12946 #ifdef PLATFORM_CONSOLE
12947
12949 {
12951 if (menu)
12952 {
12954 }
12955 }
12956 #endif
12957 }
12958
12960 {
12963 }
12964
12966 {
12967 SetWeightDirty();
12969 }
12971 {
12974 }
12975
12977 {
12980 }
12982 {
12985 }
12986
12987 super.OnVariablesSynchronized();
12988 }
12989
12990
12991
12993 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12994 {
12995 if (!IsServerCheck(allow_client))
12996 return false;
12997
12999 return false;
13000
13003
13004 if (value <= (min + 0.001))
13005 value = min;
13006
13007 if (value == min)
13008 {
13009 if (destroy_config)
13010 {
13011 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
13012 if (dstr)
13013 {
13015 this.Delete();
13016 return true;
13017 }
13018 }
13019 else if (destroy_forced)
13020 {
13022 this.Delete();
13023 return true;
13024 }
13025
13027 }
13028
13031
13033 {
13035
13036 if (delta)
13038 }
13039
13041
13042 return false;
13043 }
13044
13045
13047 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
13048 {
13050 }
13051
13053 {
13056 }
13057
13059 {
13062 }
13063
13065 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
13066 {
13067 float value_clamped = Math.Clamp(value, 0, 1);
13069 SetQuantity(result, destroy_config, destroy_forced);
13070 }
13071
13072
13075 {
13077 }
13078
13080 {
13082 }
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13094 {
13095 int slot = -1;
13096 if (GetInventory())
13097 {
13098 InventoryLocation il = new InventoryLocation;
13099 GetInventory().GetCurrentInventoryLocation(il);
13101 }
13102
13104 }
13105
13107 {
13108 float quantity_max = 0;
13109
13111 {
13112 if (attSlotID != -1)
13113 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
13114
13115 if (quantity_max <= 0)
13117 }
13118
13119 if (quantity_max <= 0)
13121
13122 return quantity_max;
13123 }
13124
13126 {
13128 }
13129
13131 {
13133 }
13134
13135
13137 {
13139 }
13140
13142 {
13144 }
13145
13147 {
13149 }
13150
13151
13153 {
13154
13155 float weightEx = GetWeightEx();
13156 float special = GetInventoryAndCargoWeight();
13157 return weightEx - special;
13158 }
13159
13160
13162 {
13164 }
13165
13167 {
13169 {
13170 #ifdef DEVELOPER
13171 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13172 {
13173 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13175 }
13176 #endif
13177
13178 return GetQuantity() * GetConfigWeightModified();
13179 }
13180 else if (HasEnergyManager())
13181 {
13182 #ifdef DEVELOPER
13183 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13184 {
13185 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13186 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13187 }
13188 #endif
13189 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13190 }
13191 else
13192 {
13193 #ifdef DEVELOPER
13194 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13195 {
13196 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13197 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13198 }
13199 #endif
13200 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13201 }
13202 }
13203
13206 {
13207 int item_count = 0;
13209
13210 if (GetInventory().GetCargo() != NULL)
13211 {
13212 item_count = GetInventory().GetCargo().GetItemCount();
13213 }
13214
13215 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13216 {
13217 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13218 if (item)
13219 item_count += item.GetNumberOfItems();
13220 }
13221 return item_count;
13222 }
13223
13226 {
13227 float weight = 0;
13228 float wetness = 1;
13229 if (include_wetness)
13232 {
13233 weight = wetness * m_ConfigWeight;
13234 }
13236 {
13237 weight = 1;
13238 }
13239 return weight;
13240 }
13241
13242
13243
13245 {
13246 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13247 {
13248 GameInventory inv = GetInventory();
13249 array<EntityAI> items = new array<EntityAI>;
13251 for (int i = 0; i < items.Count(); i++)
13252 {
13254 if (item)
13255 {
13257 }
13258 }
13259 }
13260 }
13261
13262
13263
13264
13266 {
13267 float energy = 0;
13268 if (HasEnergyManager())
13269 {
13270 energy = GetCompEM().GetEnergy();
13271 }
13272 return energy;
13273 }
13274
13275
13277 {
13278 super.OnEnergyConsumed();
13279
13281 }
13282
13284 {
13285 super.OnEnergyAdded();
13286
13288 }
13289
13290
13292 {
13293 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13294 {
13296 {
13297 float energy_0to1 = GetCompEM().GetEnergy0To1();
13299 }
13300 }
13301 }
13302
13303
13305 {
13306 return ConfigGetFloat("heatIsolation");
13307 }
13308
13310 {
13312 }
13313
13315 {
13316 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13317 if (
GetGame().ConfigIsExisting(paramPath))
13319
13320 return 0.0;
13321 }
13322
13324 {
13325 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13326 if (
GetGame().ConfigIsExisting(paramPath))
13328
13329 return 0.0;
13330 }
13331
13332 override void SetWet(
float value,
bool allow_client =
false)
13333 {
13334 if (!IsServerCheck(allow_client))
13335 return;
13336
13339
13341
13342 m_VarWet = Math.Clamp(value, min, max);
13343
13345 {
13348 }
13349 }
13350
13351 override void AddWet(
float value)
13352 {
13354 }
13355
13357 {
13359 }
13360
13362 {
13364 }
13365
13367 {
13369 }
13370
13372 {
13374 }
13375
13377 {
13379 }
13380
13381 override void OnWetChanged(
float newVal,
float oldVal)
13382 {
13385 if (newLevel != oldLevel)
13386 {
13388 }
13389 }
13390
13392 {
13393 SetWeightDirty();
13394 }
13395
13397 {
13398 return GetWetLevelInternal(
m_VarWet);
13399 }
13400
13401
13402
13404 {
13406 }
13407
13409 {
13411 }
13412
13414 {
13416 }
13417
13419 {
13421 }
13422
13423
13424
13426 {
13427 if (ConfigIsExisting("itemModelLength"))
13428 {
13429 return ConfigGetFloat("itemModelLength");
13430 }
13431 return 0;
13432 }
13433
13435 {
13436 if (ConfigIsExisting("itemAttachOffset"))
13437 {
13438 return ConfigGetFloat("itemAttachOffset");
13439 }
13440 return 0;
13441 }
13442
13443 override void SetCleanness(
int value,
bool allow_client =
false)
13444 {
13445 if (!IsServerCheck(allow_client))
13446 return;
13447
13449
13451
13454 }
13455
13457 {
13459 }
13460
13462 {
13463 return true;
13464 }
13465
13466
13467
13468
13470 {
13472 }
13473
13475 {
13477 }
13478
13479
13480
13481
13482 override void SetColor(
int r,
int g,
int b,
int a)
13483 {
13489 }
13491 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13492 {
13497 }
13498
13500 {
13502 }
13503
13506 {
13507 int r,g,b,a;
13509 r = r/255;
13510 g = g/255;
13511 b = b/255;
13512 a = a/255;
13513 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13514 }
13515
13516
13517
13518 override void SetLiquidType(
int value,
bool allow_client =
false)
13519 {
13520 if (!IsServerCheck(allow_client))
13521 return;
13522
13527 }
13528
13530 {
13531 return ConfigGetInt("varLiquidTypeInit");
13532 }
13533
13535 {
13537 }
13538
13540 {
13542 SetFrozen(false);
13543 }
13544
13547 {
13548 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13549 }
13550
13551
13554 {
13555 PlayerBase nplayer;
13556 if (PlayerBase.CastTo(nplayer, player))
13557 {
13559
13560 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13561 }
13562 }
13563
13564
13567 {
13568 PlayerBase nplayer;
13569 if (PlayerBase.CastTo(nplayer,player))
13570 {
13571
13572 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13573
13574 }
13575
13576
13577 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13578
13579
13580 if (HasEnergyManager())
13581 {
13582 GetCompEM().UpdatePlugState();
13583 }
13584 }
13585
13586
13588 {
13589 super.OnPlacementStarted(player);
13590
13592 }
13593
13594 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13595 {
13597 {
13598 m_AdminLog.OnPlacementComplete(player,
this);
13599 }
13600
13601 super.OnPlacementComplete(player, position, orientation);
13602 }
13603
13604
13605
13606
13607
13609 {
13611 {
13612 return true;
13613 }
13614 else
13615 {
13616 return false;
13617 }
13618 }
13619
13620
13622 {
13624 {
13626 }
13627 }
13628
13629
13631 {
13633 }
13634
13636 {
13638 }
13639
13640 override void InsertAgent(
int agent,
float count = 1)
13641 {
13642 if (count < 1)
13643 return;
13644
13646 }
13647
13650 {
13652 }
13653
13654
13656 {
13658 }
13659
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
13702 {
13704 return false;
13705 return true;
13706 }
13707
13709 {
13710
13712 }
13713
13714
13717 {
13718 super.CheckForRoofLimited(timeTresholdMS);
13719
13721 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13722 {
13723 m_PreviousRoofTestTime = time;
13724 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13725 }
13726 }
13727
13728
13730 {
13732 {
13733 return 0;
13734 }
13735
13736 if (GetInventory().GetAttachmentSlotsCount() != 0)
13737 {
13738 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13739 if (filter)
13740 return filter.GetProtectionLevel(type, false, system);
13741 else
13742 return 0;
13743 }
13744
13745 string subclassPath, entryName;
13746
13747 switch (type)
13748 {
13750 entryName = "biological";
13751 break;
13753 entryName = "chemical";
13754 break;
13755 default:
13756 entryName = "biological";
13757 break;
13758 }
13759
13760 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13761
13763 }
13764
13765
13766
13769 {
13770 if (!IsMagazine())
13772
13774 }
13775
13776
13777
13778
13779
13784 {
13785 return true;
13786 }
13787
13789 {
13791 }
13792
13793
13794
13795
13796
13798 {
13799 if (parent)
13800 {
13801 if (parent.IsInherited(DayZInfected))
13802 return true;
13803
13804 if (!parent.IsRuined())
13805 return true;
13806 }
13807
13808 return true;
13809 }
13810
13812 {
13813 if (!super.CanPutAsAttachment(parent))
13814 {
13815 return false;
13816 }
13817
13818 if (!IsRuined() && !parent.IsRuined())
13819 {
13820 return true;
13821 }
13822
13823 return false;
13824 }
13825
13827 {
13828
13829
13830
13831
13832 return super.CanReceiveItemIntoCargo(item);
13833 }
13834
13836 {
13837
13838
13839
13840
13841 GameInventory attachmentInv = attachment.GetInventory();
13843 {
13844 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13845 return false;
13846 }
13847
13848 InventoryLocation loc = new InventoryLocation();
13849 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13850 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13851 return false;
13852
13853 return super.CanReceiveAttachment(attachment, slotId);
13854 }
13855
13857 {
13858 if (!super.CanReleaseAttachment(attachment))
13859 return false;
13860
13861 return GetInventory().AreChildrenAccessible();
13862 }
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13885 {
13886 int id = muzzle_owner.GetMuzzleID();
13887 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13888
13889 if (WPOF_array)
13890 {
13891 for (int i = 0; i < WPOF_array.Count(); i++)
13892 {
13893 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13894
13895 if (WPOF)
13896 {
13897 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13898 }
13899 }
13900 }
13901 }
13902
13903
13905 {
13906 int id = muzzle_owner.GetMuzzleID();
13908
13909 if (WPOBE_array)
13910 {
13911 for (int i = 0; i < WPOBE_array.Count(); i++)
13912 {
13913 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13914
13915 if (WPOBE)
13916 {
13917 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13918 }
13919 }
13920 }
13921 }
13922
13923
13925 {
13926 int id = muzzle_owner.GetMuzzleID();
13927 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13928
13929 if (WPOOH_array)
13930 {
13931 for (int i = 0; i < WPOOH_array.Count(); i++)
13932 {
13933 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13934
13935 if (WPOOH)
13936 {
13937 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13938 }
13939 }
13940 }
13941 }
13942
13943
13945 {
13946 int id = muzzle_owner.GetMuzzleID();
13947 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13948
13949 if (WPOOH_array)
13950 {
13951 for (int i = 0; i < WPOOH_array.Count(); i++)
13952 {
13953 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13954
13955 if (WPOOH)
13956 {
13957 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13958 }
13959 }
13960 }
13961 }
13962
13963
13965 {
13966 int id = muzzle_owner.GetMuzzleID();
13967 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13968
13969 if (WPOOH_array)
13970 {
13971 for (int i = 0; i < WPOOH_array.Count(); i++)
13972 {
13973 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13974
13975 if (WPOOH)
13976 {
13977 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13978 }
13979 }
13980 }
13981 }
13982
13983
13984
13986 {
13988 {
13989 return true;
13990 }
13991
13992 return false;
13993 }
13994
13996 {
13998 {
13999 return true;
14000 }
14001
14002 return false;
14003 }
14004
14006 {
14008 {
14009 return true;
14010 }
14011
14012 return false;
14013 }
14014
14016 {
14017 return false;
14018 }
14019
14022 {
14023 return UATimeSpent.DEFAULT_DEPLOY;
14024 }
14025
14026
14027
14028
14030 {
14032 SetSynchDirty();
14033 }
14034
14036 {
14038 }
14039
14040
14042 {
14043 return false;
14044 }
14045
14048 {
14049 string att_type = "None";
14050
14051 if (ConfigIsExisting("soundAttType"))
14052 {
14053 att_type = ConfigGetString("soundAttType");
14054 }
14055
14057 }
14058
14060 {
14062 }
14063
14064
14065
14066
14067
14073
14075 {
14078
14080 }
14081
14082
14084 {
14086 return;
14087
14089
14092
14095
14096 SoundParameters params = new SoundParameters();
14100 }
14101
14102
14104 {
14106 return;
14107
14109 SetSynchDirty();
14110
14113 }
14114
14115
14117 {
14119 return;
14120
14122 SetSynchDirty();
14123
14126 }
14127
14129 {
14131 }
14132
14134 {
14136 }
14137
14140 {
14141 if (!
GetGame().IsDedicatedServer())
14142 {
14143 if (ConfigIsExisting("attachSoundSet"))
14144 {
14145 string cfg_path = "";
14146 string soundset = "";
14147 string type_name =
GetType();
14148
14151 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
14152 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
14153
14154 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
14155 {
14156 for (int i = 0; i < cfg_soundset_array.Count(); i++)
14157 {
14158 if (cfg_slot_array[i] == slot_type)
14159 {
14160 soundset = cfg_soundset_array[i];
14161 break;
14162 }
14163 }
14164 }
14165
14166 if (soundset != "")
14167 {
14168 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14170 }
14171 }
14172 }
14173 }
14174
14176 {
14177
14178 }
14179
14180 void OnApply(PlayerBase player);
14181
14183 {
14184 return 1.0;
14185 };
14186
14188 {
14190 }
14191
14193 {
14195 }
14196
14198
14200 {
14201 SetDynamicPhysicsLifeTime(0.01);
14203 }
14204
14206 {
14207 array<string> zone_names = new array<string>;
14208 GetDamageZones(zone_names);
14209 for (int i = 0; i < zone_names.Count(); i++)
14210 {
14211 SetHealthMax(zone_names.Get(i),"Health");
14212 }
14213 SetHealthMax("","Health");
14214 }
14215
14218 {
14219 float global_health = GetHealth01("","Health");
14220 array<string> zones = new array<string>;
14221 GetDamageZones(zones);
14222
14223 for (int i = 0; i < zones.Count(); i++)
14224 {
14225 SetHealth01(zones.Get(i),"Health",global_health);
14226 }
14227 }
14228
14231 {
14232 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14233 }
14234
14236 {
14237 if (!hasRootAsPlayer)
14238 {
14239 if (refParentIB)
14240 {
14241
14242 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14243 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14244
14245 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14246 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14247
14250 }
14251 else
14252 {
14253
14256 }
14257 }
14258 }
14259
14261 {
14263 {
14264 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14265 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14266 {
14267 float heatPermCoef = 1.0;
14269 while (ent)
14270 {
14271 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14272 ent = ent.GetHierarchyParent();
14273 }
14274
14275 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14276 }
14277 }
14278 }
14279
14281 {
14282
14283 EntityAI parent = GetHierarchyParent();
14284 if (!parent)
14285 {
14286 hasParent = false;
14287 hasRootAsPlayer = false;
14288 }
14289 else
14290 {
14291 hasParent = true;
14292 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14293 refParentIB =
ItemBase.Cast(parent);
14294 }
14295 }
14296
14297 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14298 {
14299
14300 }
14301
14303 {
14304
14305 return false;
14306 }
14307
14309 {
14310
14311
14312 return false;
14313 }
14314
14316 {
14317
14318 return false;
14319 }
14320
14323 {
14324 return !GetIsFrozen() &&
IsOpen();
14325 }
14326
14328 {
14329 bool hasParent = false, hasRootAsPlayer = false;
14331
14332 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14333 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14334
14335 if (wwtu || foodDecay)
14336 {
14340
14341 if (processWetness || processTemperature || processDecay)
14342 {
14344
14345 if (processWetness)
14346 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14347
14348 if (processTemperature)
14350
14351 if (processDecay)
14352 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14353 }
14354 }
14355 }
14356
14359 {
14361 }
14362
14364 {
14367
14368 return super.GetTemperatureFreezeThreshold();
14369 }
14370
14372 {
14375
14376 return super.GetTemperatureThawThreshold();
14377 }
14378
14380 {
14383
14384 return super.GetItemOverheatThreshold();
14385 }
14386
14388 {
14390 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14391
14392 return super.GetTemperatureFreezeTime();
14393 }
14394
14396 {
14398 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14399
14400 return super.GetTemperatureThawTime();
14401 }
14402
14407
14409 {
14410 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14411 }
14412
14414 {
14415 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14416 }
14417
14420 {
14422 }
14423
14425 {
14427 }
14428
14430 {
14432 }
14433
14436 {
14437 return null;
14438 }
14439
14442 {
14443 return false;
14444 }
14445
14447 {
14449 {
14452 if (!trg)
14453 {
14455 explosive = this;
14456 }
14457
14458 explosive.PairRemote(trg);
14460
14461 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14462 trg.SetPersistentPairID(persistentID);
14463 explosive.SetPersistentPairID(persistentID);
14464
14465 return true;
14466 }
14467 return false;
14468 }
14469
14472 {
14473 float ret = 1.0;
14476 ret *= GetHealth01();
14477
14478 return ret;
14479 }
14480
14481 #ifdef DEVELOPER
14482 override void SetDebugItem()
14483 {
14484 super.SetDebugItem();
14485 _itemBase = this;
14486 }
14487
14489 {
14490 string text = super.GetDebugText();
14491
14493 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14494
14495 return text;
14496 }
14497 #endif
14498
14500 {
14501 return true;
14502 }
14503
14505
14507
14509 {
14512 }
14513
14514
14522
14538}
14539
14541{
14543 if (entity)
14544 {
14545 bool is_item = entity.IsInherited(
ItemBase);
14546 if (is_item && full_quantity)
14547 {
14550 }
14551 }
14552 else
14553 {
14555 return NULL;
14556 }
14557 return entity;
14558}
14559
14561{
14562 if (item)
14563 {
14564 if (health > 0)
14565 item.SetHealth("", "", health);
14566
14567 if (item.CanHaveTemperature())
14568 {
14570 if (item.CanFreeze())
14571 item.SetFrozen(false);
14572 }
14573
14574 if (item.HasEnergyManager())
14575 {
14576 if (quantity >= 0)
14577 {
14578 item.GetCompEM().SetEnergy0To1(quantity);
14579 }
14580 else
14581 {
14583 }
14584 }
14585 else if (item.IsMagazine())
14586 {
14587 Magazine mag = Magazine.Cast(item);
14588 if (quantity >= 0)
14589 {
14590 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14591 }
14592 else
14593 {
14595 }
14596
14597 }
14598 else
14599 {
14600 if (quantity >= 0)
14601 {
14602 item.SetQuantityNormalized(quantity, false);
14603 }
14604 else
14605 {
14607 }
14608
14609 }
14610 }
14611}
14612
14613#ifdef DEVELOPER
14615#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.