9547{
9549 {
9550 return true;
9551 }
9552};
9553
9554
9555
9557{
9561
9563
9566
9567
9568
9569
9570
9579
9585
9590
9595
9616 protected bool m_IsResultOfSplit
9617
9619
9624
9625
9626
9628
9632
9633
9634
9636
9639
9640
9641
9647
9648
9656
9659
9660
9662
9663
9665
9666
9671
9672
9677
9678
9680
9681
9683 {
9688
9689 if (!
GetGame().IsDedicatedServer())
9690 {
9692 {
9694
9696 {
9698 }
9699 }
9700
9703 }
9704
9705 m_OldLocation = null;
9706
9708 {
9710 }
9711
9712 if (ConfigIsExisting("headSelectionsToHide"))
9713 {
9716 }
9717
9719 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9720 {
9722 }
9723
9725
9726 m_IsResultOfSplit = false;
9727
9729 }
9730
9732 {
9733 super.InitItemVariables();
9734
9740 m_Count = ConfigGetInt(
"count");
9741
9744
9749
9752
9757
9769
9773
9774
9777 if (ConfigIsExisting("canBeSplit"))
9778 {
9781 }
9782
9784 if (ConfigIsExisting("itemBehaviour"))
9786
9787
9790 RegisterNetSyncVariableInt("m_VarLiquidType");
9791 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9792
9793 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9794 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9795 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9796
9797 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9798 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9799 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9800 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9801
9802 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9803 RegisterNetSyncVariableBool("m_IsTakeable");
9804 RegisterNetSyncVariableBool("m_IsHologram");
9805
9808 {
9811 }
9812
9814
9816 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9818
9819 }
9820
9822 {
9824 }
9825
9827 {
9830 {
9835 }
9836 }
9837
9838 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9839 {
9841 {
9844 }
9845
9847 }
9848
9850 {
9856 }
9857
9859
9861 {
9863
9864 if (!action)
9865 {
9866 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9867 return;
9868 }
9869
9871 if (!ai)
9872 {
9874 return;
9875 }
9876
9878 if (!action_array)
9879 {
9880 action_array = new array<ActionBase_Basic>;
9882 }
9883 if (LogManager.IsActionLogEnable())
9884 {
9885 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9886 }
9887
9888 if (action_array.Find(action) != -1)
9889 {
9890 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9891 }
9892 else
9893 {
9894 action_array.Insert(action);
9895 }
9896 }
9897
9899 {
9901 ActionBase action = player.GetActionManager().GetAction(actionName);
9904
9905 if (action_array)
9906 {
9907 action_array.RemoveItem(action);
9908 }
9909 }
9910
9911
9912
9914 {
9915 ActionOverrideData overrideData = new ActionOverrideData();
9919
9921 if (!actionMap)
9922 {
9925 }
9926
9927 actionMap.Insert(this.
Type(), overrideData);
9928
9929 }
9930
9932
9934
9935
9937 {
9940
9943
9944 string config_to_search = "CfgVehicles";
9945 string muzzle_owner_config;
9946
9948 {
9949 if (IsInherited(Weapon))
9950 config_to_search = "CfgWeapons";
9951
9952 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9953
9954 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9955
9957
9958 if (config_OnFire_subclass_count > 0)
9959 {
9960 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9961
9962 for (int i = 0; i < config_OnFire_subclass_count; i++)
9963 {
9964 string particle_class = "";
9966 string config_OnFire_entry = config_OnFire_class + particle_class;
9967 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9968 WPOF_array.Insert(WPOF);
9969 }
9970
9971
9973 }
9974 }
9975
9977 {
9978 config_to_search = "CfgWeapons";
9979 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9980
9981 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9982
9984
9985 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9986 {
9987 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9988
9989 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9990 {
9991 string particle_class2 = "";
9993 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9994 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9995 WPOBE_array.Insert(WPOBE);
9996 }
9997
9998
10000 }
10001 }
10002 }
10003
10004
10006 {
10009
10011 {
10012 string config_to_search = "CfgVehicles";
10013
10014 if (IsInherited(Weapon))
10015 config_to_search = "CfgWeapons";
10016
10017 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10018 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10019
10020 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10021 {
10022
10024
10026 {
10028 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10030 return;
10031 }
10032
10035
10036
10037
10039 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10040
10041 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10042 {
10043 string particle_class = "";
10045 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10047
10048 if (entry_type == CT_CLASS)
10049 {
10050 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10051 WPOOH_array.Insert(WPOF);
10052 }
10053 }
10054
10055
10057 }
10058 }
10059 }
10060
10062 {
10064 }
10065
10067 {
10069 {
10071
10074
10077
10078 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10079 }
10080 }
10081
10083 {
10085 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10086
10088 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10089
10091 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10092
10094 {
10096 }
10097 }
10098
10100 {
10102 }
10103
10105 {
10108 else
10110
10112 {
10115 }
10116 else
10117 {
10120
10123 }
10124
10126 }
10127
10129 {
10131 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10132 }
10133
10135 {
10137 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10139 }
10140
10142 {
10144 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10145 }
10146
10148 {
10151
10152 OverheatingParticle OP = new OverheatingParticle();
10157
10159 }
10160
10162 {
10165
10166 return -1;
10167 }
10168
10170 {
10172 {
10175
10176 for (int i = count; i > 0; --i)
10177 {
10178 int id = i - 1;
10181
10184
10185 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10186 {
10187 if (p)
10188 {
10191 }
10192 }
10193 }
10194 }
10195 }
10196
10198 {
10200 {
10202 {
10203 int id = i - 1;
10205
10206 if (OP)
10207 {
10209
10210 if (p)
10211 {
10213 }
10214
10215 delete OP;
10216 }
10217 }
10218
10221 }
10222 }
10223
10226 {
10227 return 0.0;
10228 }
10229
10230
10232 {
10233 return 250;
10234 }
10235
10237 {
10238 return 0;
10239 }
10240
10243 {
10245 return true;
10246
10247 return false;
10248 }
10249
10252 {
10255
10257 {
10259 }
10260 else
10261 {
10262
10264 }
10265
10267 }
10268
10275 {
10276 return -1;
10277 }
10278
10279
10280
10281
10283 {
10285 {
10287 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10288
10289 if (r_index >= 0)
10290 {
10291 InventoryLocation r_il = new InventoryLocation;
10292 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10293
10294 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10297 {
10298 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10299 }
10301 {
10302 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10303 }
10304
10305 }
10306
10307 player.GetHumanInventory().ClearUserReservedLocation(this);
10308 }
10309
10312 }
10313
10314
10315
10316
10318 {
10319 return ItemBase.m_DebugActionsMask;
10320 }
10321
10323 {
10324 return ItemBase.m_DebugActionsMask & mask;
10325 }
10326
10328 {
10329 ItemBase.m_DebugActionsMask = mask;
10330 }
10331
10333 {
10334 ItemBase.m_DebugActionsMask |= mask;
10335 }
10336
10338 {
10339 ItemBase.m_DebugActionsMask &= ~mask;
10340 }
10341
10343 {
10345 {
10347 }
10348 else
10349 {
10351 }
10352 }
10353
10354
10356 {
10357 if (GetEconomyProfile())
10358 {
10359 float q_max = GetEconomyProfile().GetQuantityMax();
10360 if (q_max > 0)
10361 {
10362 float q_min = GetEconomyProfile().GetQuantityMin();
10363 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10364
10366 {
10367 ComponentEnergyManager comp = GetCompEM();
10369 {
10371 }
10372 }
10374 {
10376
10377 }
10378
10379 }
10380 }
10381 }
10382
10385 {
10386 EntityAI parent = GetHierarchyParent();
10387
10388 if (parent)
10389 {
10390 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10391 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10392 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10393 }
10394 }
10395
10398 {
10399 EntityAI parent = GetHierarchyParent();
10400
10401 if (parent)
10402 {
10403 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10404 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10405 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10406 }
10407 }
10408
10410 {
10411
10412
10413
10414
10416
10418 {
10419 if (ScriptInputUserData.CanStoreInputUserData())
10420 {
10421 ScriptInputUserData ctx = new ScriptInputUserData;
10427 ctx.
Write(use_stack_max);
10430
10432 {
10433 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10434 }
10435 }
10436 }
10437 else if (!
GetGame().IsMultiplayer())
10438 {
10440 }
10441 }
10442
10444 {
10446 }
10447
10449 {
10451 }
10452
10454 {
10456 }
10457
10459 {
10460
10461 return false;
10462 }
10463
10465 {
10466 return false;
10467 }
10468
10472 {
10473 return false;
10474 }
10475
10477 {
10478 return "";
10479 }
10480
10482
10484 {
10485 return false;
10486 }
10487
10489 {
10490 return true;
10491 }
10492
10493
10494
10496 {
10497 return true;
10498 }
10499
10501 {
10502 return true;
10503 }
10504
10506 {
10507 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10509 }
10510
10512 {
10514 }
10515
10517 {
10519 if (!is_being_placed)
10521 SetSynchDirty();
10522 }
10523
10524
10526
10528 {
10530 }
10531
10533 {
10535 }
10536
10538 {
10539 return 1;
10540 }
10541
10543 {
10544 return false;
10545 }
10546
10548 {
10550 SetSynchDirty();
10551 }
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10588 {
10589 super.OnMovedInsideCargo(container);
10590
10591 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10592 }
10593
10594 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10595 {
10596 super.EEItemLocationChanged(oldLoc,newLoc);
10597
10598 PlayerBase new_player = null;
10599 PlayerBase old_player = null;
10600
10601 if (newLoc.GetParent())
10602 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10603
10604 if (oldLoc.GetParent())
10605 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10606
10608 {
10609 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10610
10611 if (r_index >= 0)
10612 {
10613 InventoryLocation r_il = new InventoryLocation;
10614 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10615
10616 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10619 {
10620 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10621 }
10623 {
10624 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10625 }
10626
10627 }
10628 }
10629
10631 {
10632 if (new_player)
10633 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10634
10635 if (new_player == old_player)
10636 {
10637
10638 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10639 {
10641 {
10642 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10643 {
10644 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10645 }
10646 }
10647 else
10648 {
10649 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10650 }
10651 }
10652
10653 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10654 {
10655 int type = oldLoc.GetType();
10657 {
10658 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10659 }
10661 {
10662 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10663 }
10664 }
10665 if (!m_OldLocation)
10666 {
10667 m_OldLocation = new InventoryLocation;
10668 }
10669 m_OldLocation.Copy(oldLoc);
10670 }
10671 else
10672 {
10673 if (m_OldLocation)
10674 {
10675 m_OldLocation.Reset();
10676 }
10677 }
10678
10680 }
10681 else
10682 {
10683 if (new_player)
10684 {
10685 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10686 if (res_index >= 0)
10687 {
10688 InventoryLocation il = new InventoryLocation;
10689 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10691 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10694 {
10695 il.
GetParent().GetOnReleaseLock().Invoke(it);
10696 }
10698 {
10700 }
10701
10702 }
10703 }
10705 {
10706
10708 }
10709
10710 if (m_OldLocation)
10711 {
10712 m_OldLocation.Reset();
10713 }
10714 }
10715 }
10716
10717 override void EOnContact(IEntity other, Contact extra)
10718 {
10720 {
10721 int liquidType = -1;
10723 if (impactSpeed > 0.0)
10724 {
10726 #ifndef SERVER
10728 #else
10730 SetSynchDirty();
10731 #endif
10733 }
10734 }
10735
10736 #ifdef SERVER
10737 if (GetCompEM() && GetCompEM().IsPlugged())
10738 {
10739 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10740 GetCompEM().UnplugThis();
10741 }
10742 #endif
10743 }
10744
10746
10748 {
10750 }
10751
10753 {
10754
10755 }
10756
10758 {
10759 super.OnItemLocationChanged(old_owner, new_owner);
10760
10761 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10762 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10763
10764 if (!relatedPlayer && playerNew)
10765 relatedPlayer = playerNew;
10766
10767 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10768 {
10770 if (actionMgr)
10771 {
10772 ActionBase currentAction = actionMgr.GetRunningAction();
10773 if (currentAction)
10775 }
10776 }
10777
10778 Man ownerPlayerOld = null;
10779 Man ownerPlayerNew = null;
10780
10781 if (old_owner)
10782 {
10783 if (old_owner.
IsMan())
10784 {
10785 ownerPlayerOld = Man.Cast(old_owner);
10786 }
10787 else
10788 {
10789 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10790 }
10791 }
10792 else
10793 {
10795 {
10797
10798 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10799 {
10800 GetCompEM().UnplugThis();
10801 }
10802 }
10803 }
10804
10805 if (new_owner)
10806 {
10807 if (new_owner.
IsMan())
10808 {
10809 ownerPlayerNew = Man.Cast(new_owner);
10810 }
10811 else
10812 {
10813 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10814 }
10815 }
10816
10817 if (ownerPlayerOld != ownerPlayerNew)
10818 {
10819 if (ownerPlayerOld)
10820 {
10821 array<EntityAI> subItemsExit = new array<EntityAI>;
10823 for (int i = 0; i < subItemsExit.Count(); i++)
10824 {
10827 }
10828 }
10829
10830 if (ownerPlayerNew)
10831 {
10832 array<EntityAI> subItemsEnter = new array<EntityAI>;
10834 for (int j = 0; j < subItemsEnter.Count(); j++)
10835 {
10838 }
10839 }
10840 }
10841 else if (ownerPlayerNew != null)
10842 {
10843 PlayerBase nplayer;
10844 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10845 {
10846 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10848 for (int k = 0; k < subItemsUpdate.Count(); k++)
10849 {
10851 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10852 }
10853 }
10854 }
10855
10856 if (old_owner)
10857 old_owner.OnChildItemRemoved(this);
10858 if (new_owner)
10859 new_owner.OnChildItemReceived(this);
10860 }
10861
10862
10864 {
10865 super.EEDelete(parent);
10866 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10867 if (player)
10868 {
10870
10871 if (player.IsAlive())
10872 {
10873 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10874 if (r_index >= 0)
10875 {
10876 InventoryLocation r_il = new InventoryLocation;
10877 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10878
10879 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10882 {
10883 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10884 }
10886 {
10887 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10888 }
10889
10890 }
10891
10892 player.RemoveQuickBarEntityShortcut(this);
10893 }
10894 }
10895 }
10896
10898 {
10899 super.EEKilled(killer);
10900
10903 {
10904 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10905 {
10906 if (IsMagazine())
10907 {
10908 if (Magazine.Cast(this).GetAmmoCount() > 0)
10909 {
10911 }
10912 }
10913 else
10914 {
10916 }
10917 }
10918 }
10919 }
10920
10922 {
10923 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10924
10925 super.OnWasAttached(parent, slot_id);
10926
10929
10931 }
10932
10934 {
10935 super.OnWasDetached(parent, slot_id);
10936
10939 }
10940
10942 {
10943 int idx;
10946
10947 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10948 if (inventory_slots.Count() < 1)
10949 {
10950 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10951 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10952 }
10953 else
10954 {
10955 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10956 }
10957
10958 idx = inventory_slots.Find(slot);
10959 if (idx < 0)
10960 return "";
10961
10962 return attach_types.Get(idx);
10963 }
10964
10966 {
10967 int idx = -1;
10968 string slot;
10969
10972
10973 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10974 if (inventory_slots.Count() < 1)
10975 {
10976 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10977 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10978 }
10979 else
10980 {
10981 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10982 if (detach_types.Count() < 1)
10983 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10984 }
10985
10986 for (int i = 0; i < inventory_slots.Count(); i++)
10987 {
10988 slot = inventory_slots.Get(i);
10989 }
10990
10991 if (slot != "")
10992 {
10993 if (detach_types.Count() == 1)
10994 idx = 0;
10995 else
10996 idx = inventory_slots.Find(slot);
10997 }
10998 if (idx < 0)
10999 return "";
11000
11001 return detach_types.Get(idx);
11002 }
11003
11005 {
11006
11008
11009
11010 float min_time = 1;
11011 float max_time = 3;
11012 float delay = Math.RandomFloat(min_time, max_time);
11013
11014 explode_timer.Run(delay, this, "DoAmmoExplosion");
11015 }
11016
11018 {
11019 Magazine magazine = Magazine.Cast(this);
11020 int pop_sounds_count = 6;
11021 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11022
11023
11024 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11025 string sound_name = pop_sounds[ sound_idx ];
11027
11028
11029 magazine.ServerAddAmmoCount(-1);
11030
11031
11032 float min_temp_to_explode = 100;
11033
11034 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
11035 {
11037 }
11038 }
11039
11040
11041 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11042 {
11043 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11044
11045 const int CHANCE_DAMAGE_CARGO = 4;
11046 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11047 const int CHANCE_DAMAGE_NOTHING = 2;
11048
11050 {
11051 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11052 int chances;
11053 int rnd;
11054
11055 if (GetInventory().GetCargo())
11056 {
11057 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11058 rnd = Math.RandomInt(0,chances);
11059
11060 if (rnd < CHANCE_DAMAGE_CARGO)
11061 {
11063 }
11064 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11065 {
11067 }
11068 }
11069 else
11070 {
11071 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11072 rnd = Math.RandomInt(0,chances);
11073
11074 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11075 {
11077 }
11078 }
11079 }
11080 }
11081
11083 {
11084 if (GetInventory().GetCargo())
11085 {
11086 int item_count = GetInventory().GetCargo().GetItemCount();
11087 if (item_count > 0)
11088 {
11089 int random_pick = Math.RandomInt(0, item_count);
11091 if (!item.IsExplosive())
11092 {
11093 item.AddHealth("","",damage);
11094 return true;
11095 }
11096 }
11097 }
11098 return false;
11099 }
11100
11102 {
11103 int attachment_count = GetInventory().AttachmentCount();
11104 if (attachment_count > 0)
11105 {
11106 int random_pick = Math.RandomInt(0, attachment_count);
11107 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11108 if (!attachment.IsExplosive())
11109 {
11110 attachment.AddHealth("","",damage);
11111 return true;
11112 }
11113 }
11114 return false;
11115 }
11116
11118 {
11120 }
11121
11123 {
11125 return GetInventory().CanRemoveEntity();
11126
11127 return false;
11128 }
11129
11131 {
11133 return;
11134
11136 {
11137 if (ScriptInputUserData.CanStoreInputUserData())
11138 {
11139 ScriptInputUserData ctx = new ScriptInputUserData;
11144 ctx.
Write(destination_entity);
11146 ctx.
Write(slot_id);
11148 }
11149 }
11150 else if (!
GetGame().IsMultiplayer())
11151 {
11153 }
11154 }
11155
11157 {
11159 return;
11160
11161 float split_quantity_new;
11165 InventoryLocation loc = new InventoryLocation;
11166
11167 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11168 {
11170 split_quantity_new = stack_max;
11171 else
11173
11174 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11175 if (new_item)
11176 {
11177 new_item.SetResultOfSplit(true);
11178 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11180 new_item.SetQuantity(split_quantity_new);
11181 }
11182 }
11183 else if (destination_entity && slot_id == -1)
11184 {
11185 if (quantity > stack_max)
11186 split_quantity_new = stack_max;
11187 else
11188 split_quantity_new = quantity;
11189
11191 {
11194 }
11195
11196 if (new_item)
11197 {
11198 new_item.SetResultOfSplit(true);
11199 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11201 new_item.SetQuantity(split_quantity_new);
11202 }
11203 }
11204 else
11205 {
11206 if (stack_max != 0)
11207 {
11209 {
11211 }
11212
11213 if (split_quantity_new == 0)
11214 {
11215 if (!
GetGame().IsMultiplayer())
11216 player.PhysicalPredictiveDropItem(this);
11217 else
11218 player.ServerDropEntity(this);
11219 return;
11220 }
11221
11223
11224 if (new_item)
11225 {
11226 new_item.SetResultOfSplit(true);
11227 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11229 new_item.SetQuantity(stack_max);
11230 new_item.PlaceOnSurface();
11231 }
11232 }
11233 }
11234 }
11235
11237 {
11239 return;
11240
11241 float split_quantity_new;
11245 InventoryLocation loc = new InventoryLocation;
11246
11247 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11248 {
11250 split_quantity_new = stack_max;
11251 else
11253
11254 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11255 if (new_item)
11256 {
11257 new_item.SetResultOfSplit(true);
11258 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11260 new_item.SetQuantity(split_quantity_new);
11261 }
11262 }
11263 else if (destination_entity && slot_id == -1)
11264 {
11265 if (quantity > stack_max)
11266 split_quantity_new = stack_max;
11267 else
11268 split_quantity_new = quantity;
11269
11271 {
11274 }
11275
11276 if (new_item)
11277 {
11278 new_item.SetResultOfSplit(true);
11279 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11281 new_item.SetQuantity(split_quantity_new);
11282 }
11283 }
11284 else
11285 {
11286 if (stack_max != 0)
11287 {
11289 {
11291 }
11292
11294
11295 if (new_item)
11296 {
11297 new_item.SetResultOfSplit(true);
11298 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11300 new_item.SetQuantity(stack_max);
11301 new_item.PlaceOnSurface();
11302 }
11303 }
11304 }
11305 }
11306
11308 {
11310 return;
11311
11313 {
11314 if (ScriptInputUserData.CanStoreInputUserData())
11315 {
11316 ScriptInputUserData ctx = new ScriptInputUserData;
11321 dst.WriteToContext(ctx);
11323 }
11324 }
11325 else if (!
GetGame().IsMultiplayer())
11326 {
11328 }
11329 }
11330
11332 {
11334 return;
11335
11337 {
11338 if (ScriptInputUserData.CanStoreInputUserData())
11339 {
11340 ScriptInputUserData ctx = new ScriptInputUserData;
11345 ctx.
Write(destination_entity);
11351 }
11352 }
11353 else if (!
GetGame().IsMultiplayer())
11354 {
11356 }
11357 }
11358
11360 {
11362 }
11363
11365 {
11367 return this;
11368
11370 float split_quantity_new;
11372 if (dst.IsValid())
11373 {
11374 int slot_id = dst.GetSlot();
11376
11377 if (quantity > stack_max)
11378 split_quantity_new = stack_max;
11379 else
11380 split_quantity_new = quantity;
11381
11383
11384 if (new_item)
11385 {
11386 new_item.SetResultOfSplit(true);
11387 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11390 }
11391
11392 return new_item;
11393 }
11394
11395 return null;
11396 }
11397
11399 {
11401 return;
11402
11404 float split_quantity_new;
11406 if (destination_entity)
11407 {
11409 if (quantity > stackable)
11410 split_quantity_new = stackable;
11411 else
11412 split_quantity_new = quantity;
11413
11414 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11415 if (new_item)
11416 {
11417 new_item.SetResultOfSplit(true);
11418 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11420 new_item.SetQuantity(split_quantity_new);
11421 }
11422 }
11423 }
11424
11426 {
11428 return;
11429
11431 {
11432 if (ScriptInputUserData.CanStoreInputUserData())
11433 {
11434 ScriptInputUserData ctx = new ScriptInputUserData;
11439 ItemBase destination_entity =
this;
11440 ctx.
Write(destination_entity);
11444 }
11445 }
11446 else if (!
GetGame().IsMultiplayer())
11447 {
11449 }
11450 }
11451
11453 {
11455 return;
11456
11458 float split_quantity_new;
11460 if (player)
11461 {
11463 if (quantity > stackable)
11464 split_quantity_new = stackable;
11465 else
11466 split_quantity_new = quantity;
11467
11468 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11469 new_item =
ItemBase.Cast(in_hands);
11470 if (new_item)
11471 {
11472 new_item.SetResultOfSplit(true);
11473 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11475 new_item.SetQuantity(split_quantity_new);
11476 }
11477 }
11478 }
11479
11481 {
11483 return;
11484
11486 float split_quantity_new = Math.Floor(quantity * 0.5);
11487
11489
11490 if (new_item)
11491 {
11492 if (new_item.GetQuantityMax() < split_quantity_new)
11493 {
11494 split_quantity_new = new_item.GetQuantityMax();
11495 }
11496
11497 new_item.SetResultOfSplit(true);
11498 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11499
11501 {
11504 }
11505 else
11506 {
11509 }
11510 }
11511 }
11512
11514 {
11516 return;
11517
11519 float split_quantity_new = Math.Floor(quantity / 2);
11520
11521 InventoryLocation invloc = new InventoryLocation;
11523
11525 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11526
11527 if (new_item)
11528 {
11529 if (new_item.GetQuantityMax() < split_quantity_new)
11530 {
11531 split_quantity_new = new_item.GetQuantityMax();
11532 }
11534 {
11537 }
11538 else
11539 {
11542 }
11543 }
11544 }
11545
11548 {
11549 SetWeightDirty();
11551
11552 if (parent)
11553 parent.OnAttachmentQuantityChangedEx(this, delta);
11554
11556 {
11558 {
11560 }
11562 {
11563 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11565 }
11566 }
11567
11568 }
11569
11572 {
11573
11574 }
11575
11578 {
11580 }
11581
11583 {
11584 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11585
11587 {
11588 if (newLevel == GameConstants.STATE_RUINED)
11589 {
11591 EntityAI parent = GetHierarchyParent();
11592 if (parent && parent.IsFireplace())
11593 {
11594 CargoBase cargo = GetInventory().GetCargo();
11595 if (cargo)
11596 {
11598 {
11600 }
11601 }
11602 }
11603 }
11604
11606 {
11607
11609 return;
11610 }
11611
11612 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11613 {
11615 }
11616 }
11617 }
11618
11619
11621 {
11622 super.OnRightClick();
11623
11625 {
11627 {
11628 if (ScriptInputUserData.CanStoreInputUserData())
11629 {
11630 vector m4[4];
11632
11633 EntityAI root = GetHierarchyRoot();
11634
11635 InventoryLocation dst = new InventoryLocation;
11637 {
11638 if (root)
11639 {
11640 root.GetTransform(m4);
11642 }
11643 else
11644 GetInventory().GetCurrentInventoryLocation(dst);
11645 }
11646 else
11647 {
11649
11650
11651 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11652 {
11653 if (root)
11654 {
11655 root.GetTransform(m4);
11657 }
11658 else
11659 GetInventory().GetCurrentInventoryLocation(dst);
11660 }
11661 else
11662 {
11663 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11664 }
11665 }
11666
11667 ScriptInputUserData ctx = new ScriptInputUserData;
11675 }
11676 }
11677 else if (!
GetGame().IsMultiplayer())
11678 {
11680 }
11681 }
11682 }
11683
11684 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11685 {
11686
11687 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11688 return false;
11689
11690 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11691 return false;
11692
11693
11695 return false;
11696
11697
11698 Magazine mag = Magazine.Cast(this);
11699 if (mag)
11700 {
11701 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11702 return false;
11703
11704 if (stack_max_limit)
11705 {
11706 Magazine other_mag = Magazine.Cast(other_item);
11707 if (other_item)
11708 {
11709 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11710 return false;
11711 }
11712
11713 }
11714 }
11715 else
11716 {
11717
11719 return false;
11720
11722 return false;
11723 }
11724
11725 PlayerBase player = null;
11726 if (CastTo(player, GetHierarchyRootPlayer()))
11727 {
11728 if (player.GetInventory().HasAttachment(this))
11729 return false;
11730
11731 if (player.IsItemsToDelete())
11732 return false;
11733 }
11734
11735 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11736 return false;
11737
11738 int slotID;
11740 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11741 return false;
11742
11743 return true;
11744 }
11745
11747 {
11749 }
11750
11752 {
11753 return m_IsResultOfSplit;
11754 }
11755
11757 {
11758 m_IsResultOfSplit = value;
11759 }
11760
11762 {
11764 }
11765
11767 {
11768 float other_item_quantity = other_item.GetQuantity();
11769 float this_free_space;
11770
11772
11774
11775 if (other_item_quantity > this_free_space)
11776 {
11777 return this_free_space;
11778 }
11779 else
11780 {
11781 return other_item_quantity;
11782 }
11783 }
11784
11786 {
11788 }
11789
11791 {
11793 return;
11794
11795 if (!IsMagazine() && other_item)
11796 {
11798 if (quantity_used != 0)
11799 {
11800 float hp1 = GetHealth01("","");
11801 float hp2 = other_item.GetHealth01("","");
11802 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11803 hpResult = hpResult / (
GetQuantity() + quantity_used);
11804
11805 hpResult *= GetMaxHealth();
11806 Math.Round(hpResult);
11807 SetHealth("", "Health", hpResult);
11808
11810 other_item.AddQuantity(-quantity_used);
11811 }
11812 }
11814 }
11815
11817 {
11818 #ifdef SERVER
11819 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11820 GetHierarchyParent().IncreaseLifetimeUp();
11821 #endif
11822 };
11823
11825 {
11826 PlayerBase p = PlayerBase.Cast(player);
11827
11828 array<int> recipesIds = p.m_Recipes;
11829 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11830 if (moduleRecipesManager)
11831 {
11832 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11833 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11834 }
11835
11836 for (int i = 0;i < recipesIds.Count(); i++)
11837 {
11838 int key = recipesIds.Get(i);
11839 string recipeName = moduleRecipesManager.GetRecipeName(key);
11841 }
11842 }
11843
11844
11845 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11846 {
11847 super.GetDebugActions(outputList);
11848
11849
11854
11855
11859
11863
11864
11867
11868
11870 {
11873 }
11874
11876
11879
11883 }
11884
11885
11886
11887
11889 {
11890 super.OnAction(action_id, player, ctx);
11891 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11892 {
11893 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11894 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11895 PlayerBase p = PlayerBase.Cast(player);
11896 if (
EActions.RECIPES_RANGE_START < 1000)
11897 {
11898 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11899 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11900 }
11901 }
11902 #ifndef SERVER
11903 else if (action_id ==
EActions.WATCH_PLAYER)
11904 {
11905 PluginDeveloper.SetDeveloperItemClientEx(player);
11906 }
11907 #endif
11909 {
11910 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11911 {
11912 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11913 OnDebugButtonPressServer(id + 1);
11914 }
11915
11916 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11917 {
11918 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11920 }
11921
11922 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11923 {
11924 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11926 }
11927
11928 else if (action_id ==
EActions.ADD_QUANTITY)
11929 {
11930 if (IsMagazine())
11931 {
11932 Magazine mag = Magazine.Cast(this);
11933 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11934 }
11935 else
11936 {
11938 }
11939
11940 if (m_EM)
11941 {
11942 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11943 }
11944
11945 }
11946
11947 else if (action_id ==
EActions.REMOVE_QUANTITY)
11948 {
11949 if (IsMagazine())
11950 {
11951 Magazine mag2 = Magazine.Cast(this);
11952 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11953 }
11954 else
11955 {
11957 }
11958 if (m_EM)
11959 {
11960 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11961 }
11962
11963 }
11964
11965 else if (action_id ==
EActions.SET_QUANTITY_0)
11966 {
11968
11969 if (m_EM)
11970 {
11971 m_EM.SetEnergy(0);
11972 }
11973 }
11974
11975 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11976 {
11978
11979 if (m_EM)
11980 {
11981 m_EM.SetEnergy(m_EM.GetEnergyMax());
11982 }
11983 }
11984
11985 else if (action_id ==
EActions.ADD_HEALTH)
11986 {
11987 AddHealth("","",GetMaxHealth("","Health")/5);
11988 }
11989 else if (action_id ==
EActions.REMOVE_HEALTH)
11990 {
11991 AddHealth("","",-GetMaxHealth("","Health")/5);
11992 }
11993 else if (action_id ==
EActions.DESTROY_HEALTH)
11994 {
11995 SetHealth01("","",0);
11996 }
11997 else if (action_id ==
EActions.WATCH_ITEM)
11998 {
12000 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12001 #ifdef DEVELOPER
12002 SetDebugDeveloper_item(this);
12003 #endif
12004 }
12005
12006 else if (action_id ==
EActions.ADD_TEMPERATURE)
12007 {
12008 AddTemperature(20);
12009
12010 }
12011
12012 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12013 {
12014 AddTemperature(-20);
12015
12016 }
12017
12018 else if (action_id ==
EActions.FLIP_FROZEN)
12019 {
12020 SetFrozen(!GetIsFrozen());
12021
12022 }
12023
12024 else if (action_id ==
EActions.ADD_WETNESS)
12025 {
12027
12028 }
12029
12030 else if (action_id ==
EActions.REMOVE_WETNESS)
12031 {
12033
12034 }
12035
12036 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12037 {
12040
12041
12042 }
12043
12044 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12045 {
12048 }
12049
12050 else if (action_id ==
EActions.MAKE_SPECIAL)
12051 {
12052 auto debugParams = DebugSpawnParams.WithPlayer(player);
12053 OnDebugSpawnEx(debugParams);
12054 }
12055
12056 else if (action_id ==
EActions.DELETE)
12057 {
12058 Delete();
12059 }
12060
12061 }
12062
12063
12064 return false;
12065 }
12066
12067
12068
12069
12073
12076
12077
12078
12080 {
12081 return false;
12082 }
12083
12084
12086 {
12087 return true;
12088 }
12089
12090
12092 {
12093 return true;
12094 }
12095
12096
12097
12099 {
12100 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12102 }
12103
12106 {
12107 return null;
12108 }
12109
12111 {
12112 return false;
12113 }
12114
12116 {
12117 return false;
12118 }
12119
12123
12124
12126 {
12127 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12128 return module_repairing.CanRepair(this, item_repair_kit);
12129 }
12130
12131
12132 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12133 {
12134 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12135 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12136 }
12137
12138
12140 {
12141
12142
12143
12144
12145
12146
12147
12148
12149 return 1;
12150 }
12151
12152
12153
12155 {
12157 }
12158
12159
12160
12162 {
12164 }
12165
12166
12175 {
12176 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12177
12178 if (player)
12179 {
12180 player.MessageStatus(text);
12181 }
12182 }
12183
12184
12193 {
12194 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12195
12196 if (player)
12197 {
12198 player.MessageAction(text);
12199 }
12200 }
12201
12202
12211 {
12212 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12213
12214 if (player)
12215 {
12216 player.MessageFriendly(text);
12217 }
12218 }
12219
12220
12229 {
12230 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12231
12232 if (player)
12233 {
12234 player.MessageImportant(text);
12235 }
12236 }
12237
12239 {
12240 return true;
12241 }
12242
12243
12244 override bool KindOf(
string tag)
12245 {
12246 bool found = false;
12247 string item_name = this.
GetType();
12250
12251 int array_size = item_tag_array.Count();
12252 for (int i = 0; i < array_size; i++)
12253 {
12254 if (item_tag_array.Get(i) == tag)
12255 {
12256 found = true;
12257 break;
12258 }
12259 }
12260 return found;
12261 }
12262
12263
12265 {
12266
12267 super.OnRPC(sender, rpc_type,ctx);
12268
12269
12270 switch (rpc_type)
12271 {
12272 #ifndef SERVER
12273 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12274 Param2<bool, string> p = new Param2<bool, string>(false, "");
12275
12277 return;
12278
12279 bool play = p.param1;
12280 string soundSet = p.param2;
12281
12282 if (play)
12283 {
12285 {
12287 {
12289 }
12290 }
12291 else
12292 {
12294 }
12295 }
12296 else
12297 {
12299 }
12300
12301 break;
12302 #endif
12303
12304 }
12305
12307 {
12309 }
12310 }
12311
12312
12313
12314
12316 {
12317 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12318 return plugin.GetID(
name);
12319 }
12320
12322 {
12323 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12324 return plugin.GetName(id);
12325 }
12326
12329 {
12330
12331
12332 int varFlags;
12333 if (!ctx.
Read(varFlags))
12334 return;
12335
12336 if (varFlags & ItemVariableFlags.FLOAT)
12337 {
12339 }
12340 }
12341
12343 {
12344
12345 super.SerializeNumericalVars(floats_out);
12346
12347
12348
12350 {
12352 }
12353
12355 {
12357 }
12358
12360 {
12362 }
12363
12365 {
12370 }
12371
12373 {
12375 }
12376 }
12377
12379 {
12380
12381 super.DeSerializeNumericalVars(floats);
12382
12383
12384 int index = 0;
12385 int mask = Math.Round(floats.Get(index));
12386
12387 index++;
12388
12390 {
12392 {
12394 }
12395 else
12396 {
12397 float quantity = floats.Get(index);
12398 SetQuantity(quantity,
true,
false,
false,
false);
12399 }
12400 index++;
12401 }
12402
12404 {
12405 float wet = floats.Get(index);
12407 index++;
12408 }
12409
12411 {
12412 int liquidtype = Math.Round(floats.Get(index));
12414 index++;
12415 }
12416
12418 {
12420 index++;
12422 index++;
12424 index++;
12426 index++;
12427 }
12428
12430 {
12431 int cleanness = Math.Round(floats.Get(index));
12433 index++;
12434 }
12435 }
12436
12438 {
12439 super.WriteVarsToCTX(ctx);
12440
12441
12443 {
12445 }
12446
12448 {
12450 }
12451
12453 {
12455 }
12456
12458 {
12459 int r,g,b,a;
12465 }
12466
12468 {
12470 }
12471 }
12472
12474 {
12475 if (!super.ReadVarsFromCTX(ctx,version))
12476 return false;
12477
12478 int intValue;
12479 float value;
12480
12481 if (version < 140)
12482 {
12483 if (!ctx.
Read(intValue))
12484 return false;
12485
12486 m_VariablesMask = intValue;
12487 }
12488
12490 {
12491 if (!ctx.
Read(value))
12492 return false;
12493
12495 {
12497 }
12498 else
12499 {
12501 }
12502 }
12503
12504 if (version < 140)
12505 {
12507 {
12508 if (!ctx.
Read(value))
12509 return false;
12510 SetTemperatureDirect(value);
12511 }
12512 }
12513
12515 {
12516 if (!ctx.
Read(value))
12517 return false;
12519 }
12520
12522 {
12523 if (!ctx.
Read(intValue))
12524 return false;
12526 }
12527
12529 {
12530 int r,g,b,a;
12532 return false;
12534 return false;
12536 return false;
12538 return false;
12539
12541 }
12542
12544 {
12545 if (!ctx.
Read(intValue))
12546 return false;
12548 }
12549
12550 if (version >= 138 && version < 140)
12551 {
12553 {
12554 if (!ctx.
Read(intValue))
12555 return false;
12556 SetFrozen(intValue);
12557 }
12558 }
12559
12560 return true;
12561 }
12562
12563
12565 {
12568 {
12570 }
12571
12572 if (!super.OnStoreLoad(ctx, version))
12573 {
12575 return false;
12576 }
12577
12578 if (version >= 114)
12579 {
12580 bool hasQuickBarIndexSaved;
12581
12582 if (!ctx.
Read(hasQuickBarIndexSaved))
12583 {
12585 return false;
12586 }
12587
12588 if (hasQuickBarIndexSaved)
12589 {
12590 int itmQBIndex;
12591
12592
12593 if (!ctx.
Read(itmQBIndex))
12594 {
12596 return false;
12597 }
12598
12599 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12600 if (itmQBIndex != -1 && parentPlayer)
12601 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12602 }
12603 }
12604 else
12605 {
12606
12607 PlayerBase player;
12608 int itemQBIndex;
12609 if (version ==
int.
MAX)
12610 {
12611 if (!ctx.
Read(itemQBIndex))
12612 {
12614 return false;
12615 }
12616 }
12617 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12618 {
12619
12620 if (!ctx.
Read(itemQBIndex))
12621 {
12623 return false;
12624 }
12625 if (itemQBIndex != -1 && player)
12626 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12627 }
12628 }
12629
12630 if (version < 140)
12631 {
12632
12633 if (!LoadVariables(ctx, version))
12634 {
12636 return false;
12637 }
12638 }
12639
12640
12642 {
12644 return false;
12645 }
12646 if (version >= 132)
12647 {
12649 if (raib)
12650 {
12652 {
12654 return false;
12655 }
12656 }
12657 }
12658
12660 return true;
12661 }
12662
12663
12664
12666 {
12667 super.OnStoreSave(ctx);
12668
12669 PlayerBase player;
12670 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12671 {
12673
12674 int itemQBIndex = -1;
12675 itemQBIndex = player.FindQuickBarEntityIndex(this);
12676 ctx.
Write(itemQBIndex);
12677 }
12678 else
12679 {
12681 }
12682
12684
12686 if (raib)
12687 {
12689 }
12690 }
12691
12692
12694 {
12695 super.AfterStoreLoad();
12696
12698 {
12700 }
12701
12703 {
12706 }
12707 }
12708
12710 {
12711 super.EEOnAfterLoad();
12712
12714 {
12716 }
12717
12720 }
12721
12723 {
12724 return false;
12725 }
12726
12727
12728
12730 {
12732 {
12733 #ifdef PLATFORM_CONSOLE
12734
12736 {
12738 if (menu)
12739 {
12741 }
12742 }
12743 #endif
12744 }
12745
12747 {
12750 }
12751
12753 {
12754 SetWeightDirty();
12756 }
12758 {
12761 }
12762
12764 {
12767 }
12769 {
12772 }
12773
12774 super.OnVariablesSynchronized();
12775 }
12776
12777
12778
12780 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12781 {
12782 if (!IsServerCheck(allow_client))
12783 return false;
12784
12786 return false;
12787
12790
12791 if (value <= (min + 0.001))
12792 value = min;
12793
12794 if (value == min)
12795 {
12796 if (destroy_config)
12797 {
12798 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12799 if (dstr)
12800 {
12802 this.Delete();
12803 return true;
12804 }
12805 }
12806 else if (destroy_forced)
12807 {
12809 this.Delete();
12810 return true;
12811 }
12812
12814 }
12815
12818
12820 {
12822
12823 if (delta)
12825 }
12826
12828
12829 return false;
12830 }
12831
12832
12834 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12835 {
12837 }
12838
12840 {
12843 }
12844
12846 {
12849 }
12850
12853 {
12854 float value_clamped = Math.Clamp(value, 0, 1);
12856 SetQuantity(result, destroy_config, destroy_forced);
12857 }
12858
12859
12862 {
12864 }
12865
12867 {
12869 }
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12881 {
12882 int slot = -1;
12883 if (GetInventory())
12884 {
12885 InventoryLocation il = new InventoryLocation;
12886 GetInventory().GetCurrentInventoryLocation(il);
12888 }
12889
12891 }
12892
12894 {
12895 float quantity_max = 0;
12896
12898 {
12899 if (attSlotID != -1)
12900 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12901
12902 if (quantity_max <= 0)
12904 }
12905
12906 if (quantity_max <= 0)
12908
12909 return quantity_max;
12910 }
12911
12913 {
12915 }
12916
12918 {
12920 }
12921
12922
12924 {
12926 }
12927
12929 {
12931 }
12932
12934 {
12936 }
12937
12938
12940 {
12941
12942 float weightEx = GetWeightEx();
12943 float special = GetInventoryAndCargoWeight();
12944 return weightEx - special;
12945 }
12946
12947
12949 {
12951 }
12952
12954 {
12956 {
12957 #ifdef DEVELOPER
12958 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12959 {
12960 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12962 }
12963 #endif
12964
12965 return GetQuantity() * GetConfigWeightModified();
12966 }
12967 else if (HasEnergyManager())
12968 {
12969 #ifdef DEVELOPER
12970 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12971 {
12972 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12973 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12974 }
12975 #endif
12976 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12977 }
12978 else
12979 {
12980 #ifdef DEVELOPER
12981 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12982 {
12983 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12984 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12985 }
12986 #endif
12987 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12988 }
12989 }
12990
12993 {
12994 int item_count = 0;
12996
12997 if (GetInventory().GetCargo() != NULL)
12998 {
12999 item_count = GetInventory().GetCargo().GetItemCount();
13000 }
13001
13002 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13003 {
13004 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13005 if (item)
13006 item_count += item.GetNumberOfItems();
13007 }
13008 return item_count;
13009 }
13010
13013 {
13014 float weight = 0;
13015 float wetness = 1;
13016 if (include_wetness)
13019 {
13020 weight = wetness * m_ConfigWeight;
13021 }
13023 {
13024 weight = 1;
13025 }
13026 return weight;
13027 }
13028
13029
13030
13032 {
13033 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13034 {
13035 GameInventory inv = GetInventory();
13036 array<EntityAI> items = new array<EntityAI>;
13038 for (int i = 0; i < items.Count(); i++)
13039 {
13041 if (item)
13042 {
13044 }
13045 }
13046 }
13047 }
13048
13049
13050
13051
13053 {
13054 float energy = 0;
13055 if (HasEnergyManager())
13056 {
13057 energy = GetCompEM().GetEnergy();
13058 }
13059 return energy;
13060 }
13061
13062
13064 {
13065 super.OnEnergyConsumed();
13066
13068 }
13069
13071 {
13072 super.OnEnergyAdded();
13073
13075 }
13076
13077
13079 {
13080 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13081 {
13083 {
13084 float energy_0to1 = GetCompEM().GetEnergy0To1();
13086 }
13087 }
13088 }
13089
13090
13092 {
13093 return ConfigGetFloat("heatIsolation");
13094 }
13095
13097 {
13099 }
13100
13102 {
13103 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13104 if (
GetGame().ConfigIsExisting(paramPath))
13106
13107 return 0.0;
13108 }
13109
13111 {
13112 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13113 if (
GetGame().ConfigIsExisting(paramPath))
13115
13116 return 0.0;
13117 }
13118
13119 override void SetWet(
float value,
bool allow_client =
false)
13120 {
13121 if (!IsServerCheck(allow_client))
13122 return;
13123
13126
13128
13129 m_VarWet = Math.Clamp(value, min, max);
13130
13132 {
13135 }
13136 }
13137
13138 override void AddWet(
float value)
13139 {
13141 }
13142
13144 {
13146 }
13147
13149 {
13151 }
13152
13154 {
13156 }
13157
13159 {
13161 }
13162
13164 {
13166 }
13167
13168 override void OnWetChanged(
float newVal,
float oldVal)
13169 {
13172 if (newLevel != oldLevel)
13173 {
13175 }
13176 }
13177
13179 {
13180 SetWeightDirty();
13181 }
13182
13184 {
13185 return GetWetLevelInternal(
m_VarWet);
13186 }
13187
13188
13189
13191 {
13193 }
13194
13196 {
13198 }
13199
13201 {
13203 }
13204
13206 {
13208 }
13209
13210
13211
13213 {
13214 if (ConfigIsExisting("itemModelLength"))
13215 {
13216 return ConfigGetFloat("itemModelLength");
13217 }
13218 return 0;
13219 }
13220
13222 {
13223 if (ConfigIsExisting("itemAttachOffset"))
13224 {
13225 return ConfigGetFloat("itemAttachOffset");
13226 }
13227 return 0;
13228 }
13229
13230 override void SetCleanness(
int value,
bool allow_client =
false)
13231 {
13232 if (!IsServerCheck(allow_client))
13233 return;
13234
13236
13238
13241 }
13242
13244 {
13246 }
13247
13249 {
13250 return true;
13251 }
13252
13253
13254
13255
13257 {
13259 }
13260
13262 {
13264 }
13265
13266
13267
13268
13269 override void SetColor(
int r,
int g,
int b,
int a)
13270 {
13276 }
13278 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13279 {
13284 }
13285
13287 {
13289 }
13290
13293 {
13294 int r,g,b,a;
13296 r = r/255;
13297 g = g/255;
13298 b = b/255;
13299 a = a/255;
13300 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13301 }
13302
13303
13304
13305 override void SetLiquidType(
int value,
bool allow_client =
false)
13306 {
13307 if (!IsServerCheck(allow_client))
13308 return;
13309
13314 }
13315
13317 {
13318 return ConfigGetInt("varLiquidTypeInit");
13319 }
13320
13322 {
13324 }
13325
13327 {
13329 SetFrozen(false);
13330 }
13331
13334 {
13335 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13336 }
13337
13338
13341 {
13342 PlayerBase nplayer;
13343 if (PlayerBase.CastTo(nplayer, player))
13344 {
13346
13347 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13348 }
13349 }
13350
13351
13354 {
13355 PlayerBase nplayer;
13356 if (PlayerBase.CastTo(nplayer,player))
13357 {
13358
13359 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13360
13361 }
13362
13363
13364 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13365
13366
13367 if (HasEnergyManager())
13368 {
13369 GetCompEM().UpdatePlugState();
13370 }
13371 }
13372
13373
13375 {
13376 super.OnPlacementStarted(player);
13377
13379 }
13380
13381 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13382 {
13384 {
13385 m_AdminLog.OnPlacementComplete(player,
this);
13386 }
13387
13388 super.OnPlacementComplete(player, position, orientation);
13389 }
13390
13391
13392
13393
13394
13396 {
13398 {
13399 return true;
13400 }
13401 else
13402 {
13403 return false;
13404 }
13405 }
13406
13407
13409 {
13411 {
13413 }
13414 }
13415
13416
13418 {
13420 }
13421
13423 {
13425 }
13426
13427 override void InsertAgent(
int agent,
float count = 1)
13428 {
13429 if (count < 1)
13430 return;
13431
13433 }
13434
13437 {
13439 }
13440
13441
13443 {
13445 }
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13489 {
13491 return false;
13492 return true;
13493 }
13494
13496 {
13497
13499 }
13500
13501
13504 {
13505 super.CheckForRoofLimited(timeTresholdMS);
13506
13508 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13509 {
13510 m_PreviousRoofTestTime = time;
13511 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13512 }
13513 }
13514
13515
13517 {
13519 {
13520 return 0;
13521 }
13522
13523 if (GetInventory().GetAttachmentSlotsCount() != 0)
13524 {
13525 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13526 if (filter)
13527 return filter.GetProtectionLevel(type, false, system);
13528 else
13529 return 0;
13530 }
13531
13532 string subclassPath, entryName;
13533
13534 switch (type)
13535 {
13537 entryName = "biological";
13538 break;
13540 entryName = "chemical";
13541 break;
13542 default:
13543 entryName = "biological";
13544 break;
13545 }
13546
13547 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13548
13550 }
13551
13552
13553
13556 {
13557 if (!IsMagazine())
13559
13561 }
13562
13563
13564
13565
13566
13571 {
13572 return true;
13573 }
13574
13576 {
13578 }
13579
13580
13581
13582
13583
13585 {
13586 if (parent)
13587 {
13588 if (parent.IsInherited(DayZInfected))
13589 return true;
13590
13591 if (!parent.IsRuined())
13592 return true;
13593 }
13594
13595 return true;
13596 }
13597
13599 {
13600 if (!super.CanPutAsAttachment(parent))
13601 {
13602 return false;
13603 }
13604
13605 if (!IsRuined() && !parent.IsRuined())
13606 {
13607 return true;
13608 }
13609
13610 return false;
13611 }
13612
13614 {
13615
13616
13617
13618
13619 return super.CanReceiveItemIntoCargo(item);
13620 }
13621
13623 {
13624
13625
13626
13627
13628 GameInventory attachmentInv = attachment.GetInventory();
13630 {
13631 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13632 return false;
13633 }
13634
13635 InventoryLocation loc = new InventoryLocation();
13636 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13637 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13638 return false;
13639
13640 return super.CanReceiveAttachment(attachment, slotId);
13641 }
13642
13644 {
13645 if (!super.CanReleaseAttachment(attachment))
13646 return false;
13647
13648 return GetInventory().AreChildrenAccessible();
13649 }
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13672 {
13673 int id = muzzle_owner.GetMuzzleID();
13674 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13675
13676 if (WPOF_array)
13677 {
13678 for (int i = 0; i < WPOF_array.Count(); i++)
13679 {
13680 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13681
13682 if (WPOF)
13683 {
13684 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13685 }
13686 }
13687 }
13688 }
13689
13690
13692 {
13693 int id = muzzle_owner.GetMuzzleID();
13695
13696 if (WPOBE_array)
13697 {
13698 for (int i = 0; i < WPOBE_array.Count(); i++)
13699 {
13700 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13701
13702 if (WPOBE)
13703 {
13704 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13705 }
13706 }
13707 }
13708 }
13709
13710
13712 {
13713 int id = muzzle_owner.GetMuzzleID();
13714 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13715
13716 if (WPOOH_array)
13717 {
13718 for (int i = 0; i < WPOOH_array.Count(); i++)
13719 {
13720 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13721
13722 if (WPOOH)
13723 {
13724 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13725 }
13726 }
13727 }
13728 }
13729
13730
13732 {
13733 int id = muzzle_owner.GetMuzzleID();
13734 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13735
13736 if (WPOOH_array)
13737 {
13738 for (int i = 0; i < WPOOH_array.Count(); i++)
13739 {
13740 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13741
13742 if (WPOOH)
13743 {
13744 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13745 }
13746 }
13747 }
13748 }
13749
13750
13752 {
13753 int id = muzzle_owner.GetMuzzleID();
13754 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13755
13756 if (WPOOH_array)
13757 {
13758 for (int i = 0; i < WPOOH_array.Count(); i++)
13759 {
13760 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13761
13762 if (WPOOH)
13763 {
13764 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13765 }
13766 }
13767 }
13768 }
13769
13770
13771
13773 {
13775 {
13776 return true;
13777 }
13778
13779 return false;
13780 }
13781
13783 {
13785 {
13786 return true;
13787 }
13788
13789 return false;
13790 }
13791
13793 {
13795 {
13796 return true;
13797 }
13798
13799 return false;
13800 }
13801
13803 {
13804 return false;
13805 }
13806
13809 {
13810 return UATimeSpent.DEFAULT_DEPLOY;
13811 }
13812
13813
13814
13815
13817 {
13819 SetSynchDirty();
13820 }
13821
13823 {
13825 }
13826
13827
13829 {
13830 return false;
13831 }
13832
13835 {
13836 string att_type = "None";
13837
13838 if (ConfigIsExisting("soundAttType"))
13839 {
13840 att_type = ConfigGetString("soundAttType");
13841 }
13842
13844 }
13845
13847 {
13849 }
13850
13851
13852
13853
13854
13858
13860 {
13863
13865 }
13866
13867
13869 {
13871 return;
13872
13874
13877
13880
13881 SoundParameters params = new SoundParameters();
13885 }
13886
13887
13889 {
13891 return;
13892
13894 SetSynchDirty();
13895
13898 }
13899
13900
13902 {
13904 return;
13905
13907 SetSynchDirty();
13908
13911 }
13912
13914 {
13916 }
13917
13919 {
13921 }
13922
13925 {
13926 if (!
GetGame().IsDedicatedServer())
13927 {
13928 if (ConfigIsExisting("attachSoundSet"))
13929 {
13930 string cfg_path = "";
13931 string soundset = "";
13932 string type_name =
GetType();
13933
13936 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13937 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13938
13939 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13940 {
13941 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13942 {
13943 if (cfg_slot_array[i] == slot_type)
13944 {
13945 soundset = cfg_soundset_array[i];
13946 break;
13947 }
13948 }
13949 }
13950
13951 if (soundset != "")
13952 {
13953 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13955 }
13956 }
13957 }
13958 }
13959
13961 {
13962
13963 }
13964
13965 void OnApply(PlayerBase player);
13966
13968 {
13969 return 1.0;
13970 };
13971
13973 {
13975 }
13976
13978 {
13980 }
13981
13983
13985 {
13986 SetDynamicPhysicsLifeTime(0.01);
13988 }
13989
13991 {
13992 array<string> zone_names = new array<string>;
13993 GetDamageZones(zone_names);
13994 for (int i = 0; i < zone_names.Count(); i++)
13995 {
13996 SetHealthMax(zone_names.Get(i),"Health");
13997 }
13998 SetHealthMax("","Health");
13999 }
14000
14003 {
14004 float global_health = GetHealth01("","Health");
14005 array<string> zones = new array<string>;
14006 GetDamageZones(zones);
14007
14008 for (int i = 0; i < zones.Count(); i++)
14009 {
14010 SetHealth01(zones.Get(i),"Health",global_health);
14011 }
14012 }
14013
14016 {
14017 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14018 }
14019
14021 {
14022 if (!hasRootAsPlayer)
14023 {
14024 if (refParentIB)
14025 {
14026
14027 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14028 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14029
14030 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14031 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14032
14035 }
14036 else
14037 {
14038
14041 }
14042 }
14043 }
14044
14046 {
14048 {
14049 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14050 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
14051 {
14052 float heatPermCoef = 1.0;
14054 while (ent)
14055 {
14056 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14057 ent = ent.GetHierarchyParent();
14058 }
14059
14060 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14061 }
14062 }
14063 }
14064
14066 {
14067
14068 EntityAI parent = GetHierarchyParent();
14069 if (!parent)
14070 {
14071 hasParent = false;
14072 hasRootAsPlayer = false;
14073 }
14074 else
14075 {
14076 hasParent = true;
14077 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14078 refParentIB =
ItemBase.Cast(parent);
14079 }
14080 }
14081
14082 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14083 {
14084
14085 }
14086
14088 {
14089
14090 return false;
14091 }
14092
14094 {
14095
14096
14097 return false;
14098 }
14099
14101 {
14102
14103 return false;
14104 }
14105
14108 {
14109 return !GetIsFrozen() &&
IsOpen();
14110 }
14111
14113 {
14114 bool hasParent = false, hasRootAsPlayer = false;
14116
14117 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14118 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14119
14120 if (wwtu || foodDecay)
14121 {
14125
14126 if (processWetness || processTemperature || processDecay)
14127 {
14129
14130 if (processWetness)
14131 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14132
14133 if (processTemperature)
14135
14136 if (processDecay)
14137 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14138 }
14139 }
14140 }
14141
14144 {
14146 }
14147
14149 {
14152
14153 return super.GetTemperatureFreezeThreshold();
14154 }
14155
14157 {
14160
14161 return super.GetTemperatureThawThreshold();
14162 }
14163
14165 {
14168
14169 return super.GetItemOverheatThreshold();
14170 }
14171
14173 {
14175 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14176
14177 return super.GetTemperatureFreezeTime();
14178 }
14179
14181 {
14183 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14184
14185 return super.GetTemperatureThawTime();
14186 }
14187
14192
14194 {
14195 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14196 }
14197
14199 {
14200 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14201 }
14202
14205 {
14207 }
14208
14210 {
14212 }
14213
14215 {
14217 }
14218
14221 {
14222 return null;
14223 }
14224
14227 {
14228 return false;
14229 }
14230
14232 {
14234 {
14237 if (!trg)
14238 {
14240 explosive = this;
14241 }
14242
14243 explosive.PairRemote(trg);
14245
14246 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14247 trg.SetPersistentPairID(persistentID);
14248 explosive.SetPersistentPairID(persistentID);
14249
14250 return true;
14251 }
14252 return false;
14253 }
14254
14257 {
14258 float ret = 1.0;
14261 ret *= GetHealth01();
14262
14263 return ret;
14264 }
14265
14266 #ifdef DEVELOPER
14267 override void SetDebugItem()
14268 {
14269 super.SetDebugItem();
14270 _itemBase = this;
14271 }
14272
14274 {
14275 string text = super.GetDebugText();
14276
14278 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14279
14280 return text;
14281 }
14282 #endif
14283
14285 {
14286 return true;
14287 }
14288
14290
14292
14294 {
14297 }
14298
14299
14307
14323}
14324
14326{
14328 if (entity)
14329 {
14330 bool is_item = entity.IsInherited(
ItemBase);
14331 if (is_item && full_quantity)
14332 {
14335 }
14336 }
14337 else
14338 {
14340 return NULL;
14341 }
14342 return entity;
14343}
14344
14346{
14347 if (item)
14348 {
14349 if (health > 0)
14350 item.SetHealth("", "", health);
14351
14352 if (item.CanHaveTemperature())
14353 {
14355 if (item.CanFreeze())
14356 item.SetFrozen(false);
14357 }
14358
14359 if (item.HasEnergyManager())
14360 {
14361 if (quantity >= 0)
14362 {
14363 item.GetCompEM().SetEnergy0To1(quantity);
14364 }
14365 else
14366 {
14368 }
14369 }
14370 else if (item.IsMagazine())
14371 {
14372 Magazine mag = Magazine.Cast(item);
14373 if (quantity >= 0)
14374 {
14375 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14376 }
14377 else
14378 {
14380 }
14381
14382 }
14383 else
14384 {
14385 if (quantity >= 0)
14386 {
14387 item.SetQuantityNormalized(quantity, false);
14388 }
14389 else
14390 {
14392 }
14393
14394 }
14395 }
14396}
14397
14398#ifdef DEVELOPER
14400#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.