9530{
9532 {
9533 return true;
9534 }
9535};
9536
9537
9538
9540{
9544
9546
9549
9550
9551
9552
9553
9562
9568
9573
9578
9599 protected bool m_IsResultOfSplit
9600
9602
9607
9608
9609
9611
9615
9616
9617
9619
9622
9623
9624
9630
9631
9639
9642
9643
9645
9646
9648
9649
9654
9655
9660
9661
9663
9664
9666 {
9671
9672 if (!
GetGame().IsDedicatedServer())
9673 {
9675 {
9677
9679 {
9681 }
9682 }
9683
9686 }
9687
9688 m_OldLocation = null;
9689
9691 {
9693 }
9694
9695 if (ConfigIsExisting("headSelectionsToHide"))
9696 {
9699 }
9700
9702 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9703 {
9705 }
9706
9708
9709 m_IsResultOfSplit = false;
9710
9712 }
9713
9715 {
9716 super.InitItemVariables();
9717
9723 m_Count = ConfigGetInt(
"count");
9724
9727
9732
9735
9740
9752
9756
9757
9760 if (ConfigIsExisting("canBeSplit"))
9761 {
9764 }
9765
9767 if (ConfigIsExisting("itemBehaviour"))
9769
9770
9773 RegisterNetSyncVariableInt("m_VarLiquidType");
9774 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9775
9776 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9777 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9778 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9779
9780 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9781 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9782 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9783 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9784
9785 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9786 RegisterNetSyncVariableBool("m_IsTakeable");
9787 RegisterNetSyncVariableBool("m_IsHologram");
9788
9791 {
9794 }
9795
9797
9799 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9801
9802 }
9803
9805 {
9807 }
9808
9810 {
9813 {
9818 }
9819 }
9820
9821 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9822 {
9824 {
9827 }
9828
9830 }
9831
9833 {
9839 }
9840
9842
9844 {
9846
9847 if (!action)
9848 {
9849 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9850 return;
9851 }
9852
9854 if (!ai)
9855 {
9857 return;
9858 }
9859
9861 if (!action_array)
9862 {
9863 action_array = new array<ActionBase_Basic>;
9865 }
9866 if (LogManager.IsActionLogEnable())
9867 {
9868 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9869 }
9870
9871 if (action_array.Find(action) != -1)
9872 {
9873 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9874 }
9875 else
9876 {
9877 action_array.Insert(action);
9878 }
9879 }
9880
9882 {
9884 ActionBase action = player.GetActionManager().GetAction(actionName);
9887
9888 if (action_array)
9889 {
9890 action_array.RemoveItem(action);
9891 }
9892 }
9893
9894
9895
9897 {
9898 ActionOverrideData overrideData = new ActionOverrideData();
9902
9904 if (!actionMap)
9905 {
9908 }
9909
9910 actionMap.Insert(this.
Type(), overrideData);
9911
9912 }
9913
9915
9917
9918
9920 {
9923
9926
9927 string config_to_search = "CfgVehicles";
9928 string muzzle_owner_config;
9929
9931 {
9932 if (IsInherited(Weapon))
9933 config_to_search = "CfgWeapons";
9934
9935 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9936
9937 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9938
9940
9941 if (config_OnFire_subclass_count > 0)
9942 {
9943 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9944
9945 for (int i = 0; i < config_OnFire_subclass_count; i++)
9946 {
9947 string particle_class = "";
9949 string config_OnFire_entry = config_OnFire_class + particle_class;
9950 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9951 WPOF_array.Insert(WPOF);
9952 }
9953
9954
9956 }
9957 }
9958
9960 {
9961 config_to_search = "CfgWeapons";
9962 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9963
9964 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9965
9967
9968 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9969 {
9970 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9971
9972 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9973 {
9974 string particle_class2 = "";
9976 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9977 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9978 WPOBE_array.Insert(WPOBE);
9979 }
9980
9981
9983 }
9984 }
9985 }
9986
9987
9989 {
9992
9994 {
9995 string config_to_search = "CfgVehicles";
9996
9997 if (IsInherited(Weapon))
9998 config_to_search = "CfgWeapons";
9999
10000 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
10001 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
10002
10003 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
10004 {
10005
10007
10009 {
10011 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10013 return;
10014 }
10015
10018
10019
10020
10022 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10023
10024 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10025 {
10026 string particle_class = "";
10028 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10030
10031 if (entry_type == CT_CLASS)
10032 {
10033 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10034 WPOOH_array.Insert(WPOF);
10035 }
10036 }
10037
10038
10040 }
10041 }
10042 }
10043
10045 {
10047 }
10048
10050 {
10052 {
10054
10057
10060
10061 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10062 }
10063 }
10064
10066 {
10068 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10069
10071 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10072
10074 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10075
10077 {
10079 }
10080 }
10081
10083 {
10085 }
10086
10088 {
10091 else
10093
10095 {
10098 }
10099 else
10100 {
10103
10106 }
10107
10109 }
10110
10112 {
10114 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10115 }
10116
10118 {
10120 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10122 }
10123
10125 {
10127 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10128 }
10129
10131 {
10134
10135 OverheatingParticle OP = new OverheatingParticle();
10140
10142 }
10143
10145 {
10148
10149 return -1;
10150 }
10151
10153 {
10155 {
10158
10159 for (int i = count; i > 0; --i)
10160 {
10161 int id = i - 1;
10164
10167
10168 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10169 {
10170 if (p)
10171 {
10174 }
10175 }
10176 }
10177 }
10178 }
10179
10181 {
10183 {
10185 {
10186 int id = i - 1;
10188
10189 if (OP)
10190 {
10192
10193 if (p)
10194 {
10196 }
10197
10198 delete OP;
10199 }
10200 }
10201
10204 }
10205 }
10206
10209 {
10210 return 0.0;
10211 }
10212
10213
10215 {
10216 return 250;
10217 }
10218
10220 {
10221 return 0;
10222 }
10223
10226 {
10228 return true;
10229
10230 return false;
10231 }
10232
10235 {
10238
10240 {
10242 }
10243 else
10244 {
10245
10247 }
10248
10250 }
10251
10258 {
10259 return -1;
10260 }
10261
10262
10263
10264
10266 {
10268 {
10270 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10271
10272 if (r_index >= 0)
10273 {
10274 InventoryLocation r_il = new InventoryLocation;
10275 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10276
10277 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10280 {
10281 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10282 }
10284 {
10285 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10286 }
10287
10288 }
10289
10290 player.GetHumanInventory().ClearUserReservedLocation(this);
10291 }
10292
10295 }
10296
10297
10298
10299
10301 {
10302 return ItemBase.m_DebugActionsMask;
10303 }
10304
10306 {
10307 return ItemBase.m_DebugActionsMask & mask;
10308 }
10309
10311 {
10312 ItemBase.m_DebugActionsMask = mask;
10313 }
10314
10316 {
10317 ItemBase.m_DebugActionsMask |= mask;
10318 }
10319
10321 {
10322 ItemBase.m_DebugActionsMask &= ~mask;
10323 }
10324
10326 {
10328 {
10330 }
10331 else
10332 {
10334 }
10335 }
10336
10337
10339 {
10340 if (GetEconomyProfile())
10341 {
10342 float q_max = GetEconomyProfile().GetQuantityMax();
10343 if (q_max > 0)
10344 {
10345 float q_min = GetEconomyProfile().GetQuantityMin();
10346 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10347
10349 {
10350 ComponentEnergyManager comp = GetCompEM();
10352 {
10354 }
10355 }
10357 {
10359
10360 }
10361
10362 }
10363 }
10364 }
10365
10368 {
10369 EntityAI parent = GetHierarchyParent();
10370
10371 if (parent)
10372 {
10373 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10374 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10375 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10376 }
10377 }
10378
10381 {
10382 EntityAI parent = GetHierarchyParent();
10383
10384 if (parent)
10385 {
10386 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10387 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10388 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10389 }
10390 }
10391
10393 {
10394
10395
10396
10397
10399
10401 {
10402 if (ScriptInputUserData.CanStoreInputUserData())
10403 {
10404 ScriptInputUserData ctx = new ScriptInputUserData;
10410 ctx.
Write(use_stack_max);
10413
10415 {
10416 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10417 }
10418 }
10419 }
10420 else if (!
GetGame().IsMultiplayer())
10421 {
10423 }
10424 }
10425
10427 {
10429 }
10430
10432 {
10434 }
10435
10437 {
10439 }
10440
10442 {
10443
10444 return false;
10445 }
10446
10448 {
10449 return false;
10450 }
10451
10455 {
10456 return false;
10457 }
10458
10460 {
10461 return "";
10462 }
10463
10465
10467 {
10468 return false;
10469 }
10470
10472 {
10473 return true;
10474 }
10475
10476
10477
10479 {
10480 return true;
10481 }
10482
10484 {
10485 return true;
10486 }
10487
10489 {
10490 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10492 }
10493
10495 {
10497 }
10498
10500 {
10502 if (!is_being_placed)
10504 SetSynchDirty();
10505 }
10506
10507
10509
10511 {
10513 }
10514
10516 {
10518 }
10519
10521 {
10522 return 1;
10523 }
10524
10526 {
10527 return false;
10528 }
10529
10531 {
10533 SetSynchDirty();
10534 }
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10571 {
10572 super.OnMovedInsideCargo(container);
10573
10574 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10575 }
10576
10577 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10578 {
10579 super.EEItemLocationChanged(oldLoc,newLoc);
10580
10581 PlayerBase new_player = null;
10582 PlayerBase old_player = null;
10583
10584 if (newLoc.GetParent())
10585 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10586
10587 if (oldLoc.GetParent())
10588 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10589
10591 {
10592 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10593
10594 if (r_index >= 0)
10595 {
10596 InventoryLocation r_il = new InventoryLocation;
10597 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10598
10599 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10602 {
10603 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10604 }
10606 {
10607 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10608 }
10609
10610 }
10611 }
10612
10614 {
10615 if (new_player)
10616 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10617
10618 if (new_player == old_player)
10619 {
10620
10621 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10622 {
10624 {
10625 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10626 {
10627 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10628 }
10629 }
10630 else
10631 {
10632 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10633 }
10634 }
10635
10636 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10637 {
10638 int type = oldLoc.GetType();
10640 {
10641 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10642 }
10644 {
10645 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10646 }
10647 }
10648 if (!m_OldLocation)
10649 {
10650 m_OldLocation = new InventoryLocation;
10651 }
10652 m_OldLocation.Copy(oldLoc);
10653 }
10654 else
10655 {
10656 if (m_OldLocation)
10657 {
10658 m_OldLocation.Reset();
10659 }
10660 }
10661
10663 }
10664 else
10665 {
10666 if (new_player)
10667 {
10668 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10669 if (res_index >= 0)
10670 {
10671 InventoryLocation il = new InventoryLocation;
10672 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10674 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10677 {
10678 il.
GetParent().GetOnReleaseLock().Invoke(it);
10679 }
10681 {
10683 }
10684
10685 }
10686 }
10688 {
10689
10691 }
10692
10693 if (m_OldLocation)
10694 {
10695 m_OldLocation.Reset();
10696 }
10697 }
10698 }
10699
10700 override void EOnContact(IEntity other, Contact extra)
10701 {
10703 {
10704 int liquidType = -1;
10706 if (impactSpeed > 0.0)
10707 {
10709 #ifndef SERVER
10711 #else
10713 SetSynchDirty();
10714 #endif
10716 }
10717 }
10718
10719 #ifdef SERVER
10720 if (GetCompEM() && GetCompEM().IsPlugged())
10721 {
10722 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10723 GetCompEM().UnplugThis();
10724 }
10725 #endif
10726 }
10727
10729
10731 {
10733 }
10734
10736 {
10737
10738 }
10739
10741 {
10742 super.OnItemLocationChanged(old_owner, new_owner);
10743
10744 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10745 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10746
10747 if (!relatedPlayer && playerNew)
10748 relatedPlayer = playerNew;
10749
10750 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10751 {
10753 if (actionMgr)
10754 {
10755 ActionBase currentAction = actionMgr.GetRunningAction();
10756 if (currentAction)
10758 }
10759 }
10760
10761 Man ownerPlayerOld = null;
10762 Man ownerPlayerNew = null;
10763
10764 if (old_owner)
10765 {
10766 if (old_owner.
IsMan())
10767 {
10768 ownerPlayerOld = Man.Cast(old_owner);
10769 }
10770 else
10771 {
10772 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10773 }
10774 }
10775 else
10776 {
10778 {
10780
10781 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10782 {
10783 GetCompEM().UnplugThis();
10784 }
10785 }
10786 }
10787
10788 if (new_owner)
10789 {
10790 if (new_owner.
IsMan())
10791 {
10792 ownerPlayerNew = Man.Cast(new_owner);
10793 }
10794 else
10795 {
10796 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10797 }
10798 }
10799
10800 if (ownerPlayerOld != ownerPlayerNew)
10801 {
10802 if (ownerPlayerOld)
10803 {
10804 array<EntityAI> subItemsExit = new array<EntityAI>;
10806 for (int i = 0; i < subItemsExit.Count(); i++)
10807 {
10810 }
10811 }
10812
10813 if (ownerPlayerNew)
10814 {
10815 array<EntityAI> subItemsEnter = new array<EntityAI>;
10817 for (int j = 0; j < subItemsEnter.Count(); j++)
10818 {
10821 }
10822 }
10823 }
10824 else if (ownerPlayerNew != null)
10825 {
10826 PlayerBase nplayer;
10827 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10828 {
10829 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10831 for (int k = 0; k < subItemsUpdate.Count(); k++)
10832 {
10834 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10835 }
10836 }
10837 }
10838
10839 if (old_owner)
10840 old_owner.OnChildItemRemoved(this);
10841 if (new_owner)
10842 new_owner.OnChildItemReceived(this);
10843 }
10844
10845
10847 {
10848 super.EEDelete(parent);
10849 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10850 if (player)
10851 {
10853
10854 if (player.IsAlive())
10855 {
10856 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10857 if (r_index >= 0)
10858 {
10859 InventoryLocation r_il = new InventoryLocation;
10860 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10861
10862 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10865 {
10866 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10867 }
10869 {
10870 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10871 }
10872
10873 }
10874
10875 player.RemoveQuickBarEntityShortcut(this);
10876 }
10877 }
10878 }
10879
10881 {
10882 super.EEKilled(killer);
10883
10886 {
10887 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10888 {
10889 if (IsMagazine())
10890 {
10891 if (Magazine.Cast(this).GetAmmoCount() > 0)
10892 {
10894 }
10895 }
10896 else
10897 {
10899 }
10900 }
10901 }
10902 }
10903
10905 {
10906 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10907
10908 super.OnWasAttached(parent, slot_id);
10909
10912
10914 }
10915
10917 {
10918 super.OnWasDetached(parent, slot_id);
10919
10922 }
10923
10925 {
10926 int idx;
10929
10930 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10931 if (inventory_slots.Count() < 1)
10932 {
10933 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10934 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10935 }
10936 else
10937 {
10938 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10939 }
10940
10941 idx = inventory_slots.Find(slot);
10942 if (idx < 0)
10943 return "";
10944
10945 return attach_types.Get(idx);
10946 }
10947
10949 {
10950 int idx = -1;
10951 string slot;
10952
10955
10956 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10957 if (inventory_slots.Count() < 1)
10958 {
10959 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10960 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10961 }
10962 else
10963 {
10964 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10965 if (detach_types.Count() < 1)
10966 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10967 }
10968
10969 for (int i = 0; i < inventory_slots.Count(); i++)
10970 {
10971 slot = inventory_slots.Get(i);
10972 }
10973
10974 if (slot != "")
10975 {
10976 if (detach_types.Count() == 1)
10977 idx = 0;
10978 else
10979 idx = inventory_slots.Find(slot);
10980 }
10981 if (idx < 0)
10982 return "";
10983
10984 return detach_types.Get(idx);
10985 }
10986
10988 {
10989
10991
10992
10993 float min_time = 1;
10994 float max_time = 3;
10995 float delay = Math.RandomFloat(min_time, max_time);
10996
10997 explode_timer.Run(delay, this, "DoAmmoExplosion");
10998 }
10999
11001 {
11002 Magazine magazine = Magazine.Cast(this);
11003 int pop_sounds_count = 6;
11004 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
11005
11006
11007 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11008 string sound_name = pop_sounds[ sound_idx ];
11010
11011
11012 magazine.ServerAddAmmoCount(-1);
11013
11014
11015 float min_temp_to_explode = 100;
11016
11017 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11018 {
11020 }
11021 }
11022
11023
11024 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11025 {
11026 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11027
11028 const int CHANCE_DAMAGE_CARGO = 4;
11029 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11030 const int CHANCE_DAMAGE_NOTHING = 2;
11031
11033 {
11034 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11035 int chances;
11036 int rnd;
11037
11038 if (GetInventory().GetCargo())
11039 {
11040 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11041 rnd = Math.RandomInt(0,chances);
11042
11043 if (rnd < CHANCE_DAMAGE_CARGO)
11044 {
11046 }
11047 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11048 {
11050 }
11051 }
11052 else
11053 {
11054 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11055 rnd = Math.RandomInt(0,chances);
11056
11057 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11058 {
11060 }
11061 }
11062 }
11063 }
11064
11066 {
11067 if (GetInventory().GetCargo())
11068 {
11069 int item_count = GetInventory().GetCargo().GetItemCount();
11070 if (item_count > 0)
11071 {
11072 int random_pick = Math.RandomInt(0, item_count);
11074 if (!item.IsExplosive())
11075 {
11076 item.AddHealth("","",damage);
11077 return true;
11078 }
11079 }
11080 }
11081 return false;
11082 }
11083
11085 {
11086 int attachment_count = GetInventory().AttachmentCount();
11087 if (attachment_count > 0)
11088 {
11089 int random_pick = Math.RandomInt(0, attachment_count);
11090 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11091 if (!attachment.IsExplosive())
11092 {
11093 attachment.AddHealth("","",damage);
11094 return true;
11095 }
11096 }
11097 return false;
11098 }
11099
11101 {
11103 }
11104
11106 {
11108 return GetInventory().CanRemoveEntity();
11109
11110 return false;
11111 }
11112
11114 {
11115
11117 return false;
11118
11119
11121 return false;
11122
11123
11124
11126 if (delta == 0)
11127 return false;
11128
11129
11130 return true;
11131 }
11132
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 {
11158 float split_quantity_new;
11162 InventoryLocation loc = new InventoryLocation;
11163
11164 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11165 {
11167 split_quantity_new = stack_max;
11168 else
11170
11172 {
11173 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11174 if (new_item)
11175 {
11176 new_item.SetResultOfSplit(true);
11177 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11179 new_item.
SetQuantity(split_quantity_new,
false,
true);
11180 }
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 {
11193 {
11196 }
11197
11198 if (new_item)
11199 {
11200 new_item.SetResultOfSplit(true);
11201 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11203 new_item.
SetQuantity(split_quantity_new,
false,
true);
11204 }
11205 }
11206 }
11207 else
11208 {
11209 if (stack_max != 0)
11210 {
11212 {
11214 }
11215
11216 if (split_quantity_new == 0)
11217 {
11218 if (!
GetGame().IsMultiplayer())
11219 player.PhysicalPredictiveDropItem(this);
11220 else
11221 player.ServerDropEntity(this);
11222 return;
11223 }
11224
11226 {
11228
11229 if (new_item)
11230 {
11231 new_item.SetResultOfSplit(true);
11232 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11235 new_item.PlaceOnSurface();
11236 }
11237 }
11238 }
11239 }
11240 }
11241
11243 {
11244 float split_quantity_new;
11248 InventoryLocation loc = new InventoryLocation;
11249
11250 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11251 {
11253 split_quantity_new = stack_max;
11254 else
11256
11258 {
11259 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11260 if (new_item)
11261 {
11262 new_item.SetResultOfSplit(true);
11263 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11265 new_item.
SetQuantity(split_quantity_new,
false,
true);
11266 }
11267 }
11268 }
11269 else if (destination_entity && slot_id == -1)
11270 {
11271 if (quantity > stack_max)
11272 split_quantity_new = stack_max;
11273 else
11274 split_quantity_new = quantity;
11275
11277 {
11279 {
11282 }
11283
11284 if (new_item)
11285 {
11286 new_item.SetResultOfSplit(true);
11287 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11289 new_item.
SetQuantity(split_quantity_new,
false,
true);
11290 }
11291 }
11292 }
11293 else
11294 {
11295 if (stack_max != 0)
11296 {
11298 {
11300 }
11301
11303 {
11305
11306 if (new_item)
11307 {
11308 new_item.SetResultOfSplit(true);
11309 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11312 new_item.PlaceOnSurface();
11313 }
11314 }
11315 }
11316 }
11317 }
11318
11320 {
11322 {
11323 if (ScriptInputUserData.CanStoreInputUserData())
11324 {
11325 ScriptInputUserData ctx = new ScriptInputUserData;
11330 dst.WriteToContext(ctx);
11332 }
11333 }
11334 else if (!
GetGame().IsMultiplayer())
11335 {
11337 }
11338 }
11339
11341 {
11343 {
11344 if (ScriptInputUserData.CanStoreInputUserData())
11345 {
11346 ScriptInputUserData ctx = new ScriptInputUserData;
11351 ctx.
Write(destination_entity);
11357 }
11358 }
11359 else if (!
GetGame().IsMultiplayer())
11360 {
11362 }
11363 }
11364
11366 {
11368 }
11369
11371 {
11373 float split_quantity_new;
11375 if (dst.IsValid())
11376 {
11377 int slot_id = dst.GetSlot();
11379
11380 if (quantity > stack_max)
11381 split_quantity_new = stack_max;
11382 else
11383 split_quantity_new = quantity;
11384
11386 {
11388
11389 if (new_item)
11390 {
11391 new_item.SetResultOfSplit(true);
11392 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11394 new_item.
SetQuantity(split_quantity_new,
false,
true);
11395 }
11396
11397 return new_item;
11398 }
11399 }
11400
11401 return null;
11402 }
11403
11405 {
11407 float split_quantity_new;
11409 if (destination_entity)
11410 {
11412 if (quantity > stackable)
11413 split_quantity_new = stackable;
11414 else
11415 split_quantity_new = quantity;
11416
11418 {
11419 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11420 if (new_item)
11421 {
11422 new_item.SetResultOfSplit(true);
11423 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11425 new_item.
SetQuantity(split_quantity_new,
false,
true);
11426 }
11427 }
11428 }
11429 }
11430
11432 {
11434 {
11435 if (ScriptInputUserData.CanStoreInputUserData())
11436 {
11437 ScriptInputUserData ctx = new ScriptInputUserData;
11442 ItemBase destination_entity =
this;
11443 ctx.
Write(destination_entity);
11447 }
11448 }
11449 else if (!
GetGame().IsMultiplayer())
11450 {
11452 }
11453 }
11454
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
11469 {
11470 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11471 new_item =
ItemBase.Cast(in_hands);
11472 if (new_item)
11473 {
11474 new_item.SetResultOfSplit(true);
11475 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11477 new_item.SetQuantity(split_quantity_new, false, true);
11478 }
11479 }
11480 }
11481 }
11482
11484 {
11486 float split_quantity_new = Math.Floor(quantity * 0.5);
11487
11489 return;
11490
11492
11493 if (new_item)
11494 {
11495 if (new_item.GetQuantityMax() < split_quantity_new)
11496 {
11497 split_quantity_new = new_item.GetQuantityMax();
11498 }
11499
11500 new_item.SetResultOfSplit(true);
11501 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11502
11504 {
11507 }
11508 else
11509 {
11511 new_item.
SetQuantity(split_quantity_new,
false,
true);
11512 }
11513 }
11514 }
11515
11517 {
11519 float split_quantity_new = Math.Floor(quantity / 2);
11520
11522 return;
11523
11524 InventoryLocation invloc = new InventoryLocation;
11526
11528 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11529
11530 if (new_item)
11531 {
11532 if (new_item.GetQuantityMax() < split_quantity_new)
11533 {
11534 split_quantity_new = new_item.GetQuantityMax();
11535 }
11537 {
11540 }
11541 else if (split_quantity_new > 1)
11542 {
11544 new_item.
SetQuantity(split_quantity_new,
false,
true);
11545 }
11546 }
11547 }
11548
11551 {
11552 SetWeightDirty();
11554
11555 if (parent)
11556 parent.OnAttachmentQuantityChangedEx(this, delta);
11557
11559 {
11561 {
11563 }
11565 {
11566 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11568 }
11569 }
11570
11571 }
11572
11575 {
11576
11577 }
11578
11581 {
11583 }
11584
11586 {
11587 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11588
11590 {
11591 if (newLevel == GameConstants.STATE_RUINED)
11592 {
11594 EntityAI parent = GetHierarchyParent();
11595 if (parent && parent.IsFireplace())
11596 {
11597 CargoBase cargo = GetInventory().GetCargo();
11598 if (cargo)
11599 {
11601 {
11603 }
11604 }
11605 }
11606 }
11607
11609 {
11610
11612 return;
11613 }
11614
11615 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11616 {
11618 }
11619 }
11620 }
11621
11622
11624 {
11625 super.OnRightClick();
11626
11628 {
11630 {
11631 if (ScriptInputUserData.CanStoreInputUserData())
11632 {
11633 EntityAI root = GetHierarchyRoot();
11634 Man playerOwner = GetHierarchyRootPlayer();
11635 InventoryLocation dst = new InventoryLocation;
11636
11637
11638 if (!playerOwner && root && root == this)
11639 {
11641 }
11642 else
11643 {
11644
11645 GetInventory().GetCurrentInventoryLocation(dst);
11647 {
11650 {
11652 }
11653 else
11654 {
11656
11657
11658 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11659 {
11661 }
11662 else
11663 {
11664 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11665 }
11666 }
11667 }
11668 }
11669
11670 ScriptInputUserData ctx = new ScriptInputUserData;
11678 }
11679 }
11680 else if (!
GetGame().IsMultiplayer())
11681 {
11683 }
11684 }
11685 }
11686
11688 {
11689 if (root)
11690 {
11691 vector m4[4];
11692 root.GetTransform(m4);
11693 dst.SetGround(this, m4);
11694 }
11695 else
11696 {
11697 GetInventory().GetCurrentInventoryLocation(dst);
11698 }
11699 }
11700
11701 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11702 {
11703
11704 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11705 return false;
11706
11707 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11708 return false;
11709
11710
11712 return false;
11713
11714
11715 Magazine mag = Magazine.Cast(this);
11716 if (mag)
11717 {
11718 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11719 return false;
11720
11721 if (stack_max_limit)
11722 {
11723 Magazine other_mag = Magazine.Cast(other_item);
11724 if (other_item)
11725 {
11726 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11727 return false;
11728 }
11729
11730 }
11731 }
11732 else
11733 {
11734
11736 return false;
11737
11739 return false;
11740 }
11741
11742 PlayerBase player = null;
11743 if (CastTo(player, GetHierarchyRootPlayer()))
11744 {
11745 if (player.GetInventory().HasAttachment(this))
11746 return false;
11747
11748 if (player.IsItemsToDelete())
11749 return false;
11750 }
11751
11752 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11753 return false;
11754
11755 int slotID;
11757 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11758 return false;
11759
11760 return true;
11761 }
11762
11764 {
11766 }
11767
11769 {
11770 return m_IsResultOfSplit;
11771 }
11772
11774 {
11775 m_IsResultOfSplit = value;
11776 }
11777
11779 {
11781 }
11782
11784 {
11785 float other_item_quantity = other_item.GetQuantity();
11786 float this_free_space;
11787
11789
11791
11792 if (other_item_quantity > this_free_space)
11793 {
11794 return this_free_space;
11795 }
11796 else
11797 {
11798 return other_item_quantity;
11799 }
11800 }
11801
11803 {
11805 }
11806
11808 {
11810 return;
11811
11812 if (!IsMagazine() && other_item)
11813 {
11815 if (quantity_used != 0)
11816 {
11817 float hp1 = GetHealth01("","");
11818 float hp2 = other_item.GetHealth01("","");
11819 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11820 hpResult = hpResult / (
GetQuantity() + quantity_used);
11821
11822 hpResult *= GetMaxHealth();
11823 Math.Round(hpResult);
11824 SetHealth("", "Health", hpResult);
11825
11827 other_item.AddQuantity(-quantity_used);
11828 }
11829 }
11831 }
11832
11834 {
11835 #ifdef SERVER
11836 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11837 GetHierarchyParent().IncreaseLifetimeUp();
11838 #endif
11839 };
11840
11842 {
11843 PlayerBase p = PlayerBase.Cast(player);
11844
11845 array<int> recipesIds = p.m_Recipes;
11846 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11847 if (moduleRecipesManager)
11848 {
11849 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11850 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11851 }
11852
11853 for (int i = 0;i < recipesIds.Count(); i++)
11854 {
11855 int key = recipesIds.Get(i);
11856 string recipeName = moduleRecipesManager.GetRecipeName(key);
11858 }
11859 }
11860
11861
11862 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11863 {
11864 super.GetDebugActions(outputList);
11865
11866
11872
11873
11878
11883
11884
11888
11889
11891 {
11895 }
11896
11899
11900
11904
11906
11907 InventoryLocation loc = new InventoryLocation();
11908 GetInventory().GetCurrentInventoryLocation(loc);
11910 {
11911 if (Gizmo_IsSupported())
11914 }
11915
11917 }
11918
11919
11920
11921
11923 {
11924 super.OnAction(action_id, player, ctx);
11925
11927 {
11928 switch (action_id)
11929 {
11932 return true;
11935 return true;
11936 }
11937 }
11938
11940 {
11941 switch (action_id)
11942 {
11944 Delete();
11945 return true;
11946 }
11947 }
11948
11949 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11950 {
11951 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11952 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11953 PlayerBase p = PlayerBase.Cast(player);
11954 if (
EActions.RECIPES_RANGE_START < 1000)
11955 {
11956 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11957 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11958 }
11959 }
11960 #ifndef SERVER
11961 else if (action_id ==
EActions.WATCH_PLAYER)
11962 {
11963 PluginDeveloper.SetDeveloperItemClientEx(player);
11964 }
11965 #endif
11967 {
11968 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11969 {
11970 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11971 OnDebugButtonPressServer(id + 1);
11972 }
11973
11974 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11975 {
11976 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11978 }
11979
11980 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11981 {
11982 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11984 }
11985
11986 else if (action_id ==
EActions.ADD_QUANTITY)
11987 {
11988 if (IsMagazine())
11989 {
11990 Magazine mag = Magazine.Cast(this);
11991 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11992 }
11993 else
11994 {
11996 }
11997
11998 if (m_EM)
11999 {
12000 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
12001 }
12002
12003 }
12004
12005 else if (action_id ==
EActions.REMOVE_QUANTITY)
12006 {
12007 if (IsMagazine())
12008 {
12009 Magazine mag2 = Magazine.Cast(this);
12010 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12011 }
12012 else
12013 {
12015 }
12016 if (m_EM)
12017 {
12018 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12019 }
12020
12021 }
12022
12023 else if (action_id ==
EActions.SET_QUANTITY_0)
12024 {
12026
12027 if (m_EM)
12028 {
12029 m_EM.SetEnergy(0);
12030 }
12031 }
12032
12033 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12034 {
12036
12037 if (m_EM)
12038 {
12039 m_EM.SetEnergy(m_EM.GetEnergyMax());
12040 }
12041 }
12042
12043 else if (action_id ==
EActions.ADD_HEALTH)
12044 {
12045 AddHealth("","",GetMaxHealth("","Health")/5);
12046 }
12047 else if (action_id ==
EActions.REMOVE_HEALTH)
12048 {
12049 AddHealth("","",-GetMaxHealth("","Health")/5);
12050 }
12051 else if (action_id ==
EActions.DESTROY_HEALTH)
12052 {
12053 SetHealth01("","",0);
12054 }
12055 else if (action_id ==
EActions.WATCH_ITEM)
12056 {
12058 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12059 #ifdef DEVELOPER
12060 SetDebugDeveloper_item(this);
12061 #endif
12062 }
12063
12064 else if (action_id ==
EActions.ADD_TEMPERATURE)
12065 {
12066 AddTemperature(20);
12067
12068 }
12069
12070 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12071 {
12072 AddTemperature(-20);
12073
12074 }
12075
12076 else if (action_id ==
EActions.FLIP_FROZEN)
12077 {
12078 SetFrozen(!GetIsFrozen());
12079
12080 }
12081
12082 else if (action_id ==
EActions.ADD_WETNESS)
12083 {
12085
12086 }
12087
12088 else if (action_id ==
EActions.REMOVE_WETNESS)
12089 {
12091
12092 }
12093
12094 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12095 {
12098
12099
12100 }
12101
12102 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12103 {
12106 }
12107
12108 else if (action_id ==
EActions.MAKE_SPECIAL)
12109 {
12110 auto debugParams = DebugSpawnParams.WithPlayer(player);
12111 OnDebugSpawnEx(debugParams);
12112 }
12113
12114 }
12115
12116
12117 return false;
12118 }
12119
12120
12121
12122
12126
12129
12130
12131
12133 {
12134 return false;
12135 }
12136
12137
12139 {
12140 return true;
12141 }
12142
12143
12145 {
12146 return true;
12147 }
12148
12149
12150
12152 {
12153 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12155 }
12156
12159 {
12160 return null;
12161 }
12162
12164 {
12165 return false;
12166 }
12167
12169 {
12170 return false;
12171 }
12172
12176
12177
12179 {
12180 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12181 return module_repairing.CanRepair(this, item_repair_kit);
12182 }
12183
12184
12185 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12186 {
12187 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12188 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12189 }
12190
12191
12193 {
12194
12195
12196
12197
12198
12199
12200
12201
12202 return 1;
12203 }
12204
12205
12206
12208 {
12210 }
12211
12212
12213
12215 {
12217 }
12218
12219
12228 {
12229 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12230
12231 if (player)
12232 {
12233 player.MessageStatus(text);
12234 }
12235 }
12236
12237
12246 {
12247 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12248
12249 if (player)
12250 {
12251 player.MessageAction(text);
12252 }
12253 }
12254
12255
12264 {
12265 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12266
12267 if (player)
12268 {
12269 player.MessageFriendly(text);
12270 }
12271 }
12272
12273
12282 {
12283 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12284
12285 if (player)
12286 {
12287 player.MessageImportant(text);
12288 }
12289 }
12290
12292 {
12293 return true;
12294 }
12295
12296
12297 override bool KindOf(
string tag)
12298 {
12299 bool found = false;
12300 string item_name = this.
GetType();
12303
12304 int array_size = item_tag_array.Count();
12305 for (int i = 0; i < array_size; i++)
12306 {
12307 if (item_tag_array.Get(i) == tag)
12308 {
12309 found = true;
12310 break;
12311 }
12312 }
12313 return found;
12314 }
12315
12316
12318 {
12319
12320 super.OnRPC(sender, rpc_type,ctx);
12321
12322
12323 switch (rpc_type)
12324 {
12325 #ifndef SERVER
12326 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12327 Param2<bool, string> p = new Param2<bool, string>(false, "");
12328
12330 return;
12331
12332 bool play = p.param1;
12333 string soundSet = p.param2;
12334
12335 if (play)
12336 {
12338 {
12340 {
12342 }
12343 }
12344 else
12345 {
12347 }
12348 }
12349 else
12350 {
12352 }
12353
12354 break;
12355 #endif
12356
12357 }
12358
12360 {
12362 }
12363 }
12364
12365
12366
12367
12369 {
12370 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12371 return plugin.GetID(
name);
12372 }
12373
12375 {
12376 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12377 return plugin.GetName(id);
12378 }
12379
12382 {
12383
12384
12385 int varFlags;
12386 if (!ctx.
Read(varFlags))
12387 return;
12388
12389 if (varFlags & ItemVariableFlags.FLOAT)
12390 {
12392 }
12393 }
12394
12396 {
12397
12398 super.SerializeNumericalVars(floats_out);
12399
12400
12401
12403 {
12405 }
12406
12408 {
12410 }
12411
12413 {
12415 }
12416
12418 {
12423 }
12424
12426 {
12428 }
12429 }
12430
12432 {
12433
12434 super.DeSerializeNumericalVars(floats);
12435
12436
12437 int index = 0;
12438 int mask = Math.Round(floats.Get(index));
12439
12440 index++;
12441
12443 {
12445 {
12447 }
12448 else
12449 {
12450 float quantity = floats.Get(index);
12451 SetQuantity(quantity,
true,
false,
false,
false);
12452 }
12453 index++;
12454 }
12455
12457 {
12458 float wet = floats.Get(index);
12460 index++;
12461 }
12462
12464 {
12465 int liquidtype = Math.Round(floats.Get(index));
12467 index++;
12468 }
12469
12471 {
12473 index++;
12475 index++;
12477 index++;
12479 index++;
12480 }
12481
12483 {
12484 int cleanness = Math.Round(floats.Get(index));
12486 index++;
12487 }
12488 }
12489
12491 {
12492 super.WriteVarsToCTX(ctx);
12493
12494
12496 {
12498 }
12499
12501 {
12503 }
12504
12506 {
12508 }
12509
12511 {
12512 int r,g,b,a;
12518 }
12519
12521 {
12523 }
12524 }
12525
12527 {
12528 if (!super.ReadVarsFromCTX(ctx,version))
12529 return false;
12530
12531 int intValue;
12532 float value;
12533
12534 if (version < 140)
12535 {
12536 if (!ctx.
Read(intValue))
12537 return false;
12538
12539 m_VariablesMask = intValue;
12540 }
12541
12543 {
12544 if (!ctx.
Read(value))
12545 return false;
12546
12548 {
12550 }
12551 else
12552 {
12554 }
12555 }
12556
12557 if (version < 140)
12558 {
12560 {
12561 if (!ctx.
Read(value))
12562 return false;
12563 SetTemperatureDirect(value);
12564 }
12565 }
12566
12568 {
12569 if (!ctx.
Read(value))
12570 return false;
12572 }
12573
12575 {
12576 if (!ctx.
Read(intValue))
12577 return false;
12579 }
12580
12582 {
12583 int r,g,b,a;
12585 return false;
12587 return false;
12589 return false;
12591 return false;
12592
12594 }
12595
12597 {
12598 if (!ctx.
Read(intValue))
12599 return false;
12601 }
12602
12603 if (version >= 138 && version < 140)
12604 {
12606 {
12607 if (!ctx.
Read(intValue))
12608 return false;
12609 SetFrozen(intValue);
12610 }
12611 }
12612
12613 return true;
12614 }
12615
12616
12618 {
12621 {
12623 }
12624
12625 if (!super.OnStoreLoad(ctx, version))
12626 {
12628 return false;
12629 }
12630
12631 if (version >= 114)
12632 {
12633 bool hasQuickBarIndexSaved;
12634
12635 if (!ctx.
Read(hasQuickBarIndexSaved))
12636 {
12638 return false;
12639 }
12640
12641 if (hasQuickBarIndexSaved)
12642 {
12643 int itmQBIndex;
12644
12645
12646 if (!ctx.
Read(itmQBIndex))
12647 {
12649 return false;
12650 }
12651
12652 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12653 if (itmQBIndex != -1 && parentPlayer)
12654 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12655 }
12656 }
12657 else
12658 {
12659
12660 PlayerBase player;
12661 int itemQBIndex;
12662 if (version ==
int.
MAX)
12663 {
12664 if (!ctx.
Read(itemQBIndex))
12665 {
12667 return false;
12668 }
12669 }
12670 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12671 {
12672
12673 if (!ctx.
Read(itemQBIndex))
12674 {
12676 return false;
12677 }
12678 if (itemQBIndex != -1 && player)
12679 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12680 }
12681 }
12682
12683 if (version < 140)
12684 {
12685
12686 if (!LoadVariables(ctx, version))
12687 {
12689 return false;
12690 }
12691 }
12692
12693
12695 {
12697 return false;
12698 }
12699 if (version >= 132)
12700 {
12702 if (raib)
12703 {
12705 {
12707 return false;
12708 }
12709 }
12710 }
12711
12713 return true;
12714 }
12715
12716
12717
12719 {
12720 super.OnStoreSave(ctx);
12721
12722 PlayerBase player;
12723 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12724 {
12726
12727 int itemQBIndex = -1;
12728 itemQBIndex = player.FindQuickBarEntityIndex(this);
12729 ctx.
Write(itemQBIndex);
12730 }
12731 else
12732 {
12734 }
12735
12737
12739 if (raib)
12740 {
12742 }
12743 }
12744
12745
12747 {
12748 super.AfterStoreLoad();
12749
12751 {
12753 }
12754
12756 {
12759 }
12760 }
12761
12763 {
12764 super.EEOnAfterLoad();
12765
12767 {
12769 }
12770
12773 }
12774
12776 {
12777 return false;
12778 }
12779
12780
12781
12783 {
12785 {
12786 #ifdef PLATFORM_CONSOLE
12787
12789 {
12791 if (menu)
12792 {
12794 }
12795 }
12796 #endif
12797 }
12798
12800 {
12803 }
12804
12806 {
12807 SetWeightDirty();
12809 }
12811 {
12814 }
12815
12817 {
12820 }
12822 {
12825 }
12826
12827 super.OnVariablesSynchronized();
12828 }
12829
12830
12831
12833 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12834 {
12835 if (!IsServerCheck(allow_client))
12836 return false;
12837
12839 return false;
12840
12843
12844 if (value <= (min + 0.001))
12845 value = min;
12846
12847 if (value == min)
12848 {
12849 if (destroy_config)
12850 {
12851 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12852 if (dstr)
12853 {
12855 this.Delete();
12856 return true;
12857 }
12858 }
12859 else if (destroy_forced)
12860 {
12862 this.Delete();
12863 return true;
12864 }
12865
12867 }
12868
12871
12873 {
12875
12876 if (delta)
12878 }
12879
12881
12882 return false;
12883 }
12884
12885
12887 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12888 {
12890 }
12891
12893 {
12896 }
12897
12899 {
12902 }
12903
12905 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12906 {
12907 float value_clamped = Math.Clamp(value, 0, 1);
12909 SetQuantity(result, destroy_config, destroy_forced);
12910 }
12911
12912
12915 {
12917 }
12918
12920 {
12922 }
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12934 {
12935 int slot = -1;
12936 if (GetInventory())
12937 {
12938 InventoryLocation il = new InventoryLocation;
12939 GetInventory().GetCurrentInventoryLocation(il);
12941 }
12942
12944 }
12945
12947 {
12948 float quantity_max = 0;
12949
12951 {
12952 if (attSlotID != -1)
12953 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12954
12955 if (quantity_max <= 0)
12957 }
12958
12959 if (quantity_max <= 0)
12961
12962 return quantity_max;
12963 }
12964
12966 {
12968 }
12969
12971 {
12973 }
12974
12975
12977 {
12979 }
12980
12982 {
12984 }
12985
12987 {
12989 }
12990
12991
12993 {
12994
12995 float weightEx = GetWeightEx();
12996 float special = GetInventoryAndCargoWeight();
12997 return weightEx - special;
12998 }
12999
13000
13002 {
13004 }
13005
13007 {
13009 {
13010 #ifdef DEVELOPER
13011 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13012 {
13013 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13015 }
13016 #endif
13017
13018 return GetQuantity() * GetConfigWeightModified();
13019 }
13020 else if (HasEnergyManager())
13021 {
13022 #ifdef DEVELOPER
13023 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13024 {
13025 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13026 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13027 }
13028 #endif
13029 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13030 }
13031 else
13032 {
13033 #ifdef DEVELOPER
13034 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13035 {
13036 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13037 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13038 }
13039 #endif
13040 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13041 }
13042 }
13043
13046 {
13047 int item_count = 0;
13049
13050 if (GetInventory().GetCargo() != NULL)
13051 {
13052 item_count = GetInventory().GetCargo().GetItemCount();
13053 }
13054
13055 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13056 {
13057 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13058 if (item)
13059 item_count += item.GetNumberOfItems();
13060 }
13061 return item_count;
13062 }
13063
13066 {
13067 float weight = 0;
13068 float wetness = 1;
13069 if (include_wetness)
13072 {
13073 weight = wetness * m_ConfigWeight;
13074 }
13076 {
13077 weight = 1;
13078 }
13079 return weight;
13080 }
13081
13082
13083
13085 {
13086 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13087 {
13088 GameInventory inv = GetInventory();
13089 array<EntityAI> items = new array<EntityAI>;
13091 for (int i = 0; i < items.Count(); i++)
13092 {
13094 if (item)
13095 {
13097 }
13098 }
13099 }
13100 }
13101
13102
13103
13104
13106 {
13107 float energy = 0;
13108 if (HasEnergyManager())
13109 {
13110 energy = GetCompEM().GetEnergy();
13111 }
13112 return energy;
13113 }
13114
13115
13117 {
13118 super.OnEnergyConsumed();
13119
13121 }
13122
13124 {
13125 super.OnEnergyAdded();
13126
13128 }
13129
13130
13132 {
13133 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13134 {
13136 {
13137 float energy_0to1 = GetCompEM().GetEnergy0To1();
13139 }
13140 }
13141 }
13142
13143
13145 {
13146 return ConfigGetFloat("heatIsolation");
13147 }
13148
13150 {
13152 }
13153
13155 {
13156 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13157 if (
GetGame().ConfigIsExisting(paramPath))
13159
13160 return 0.0;
13161 }
13162
13164 {
13165 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13166 if (
GetGame().ConfigIsExisting(paramPath))
13168
13169 return 0.0;
13170 }
13171
13172 override void SetWet(
float value,
bool allow_client =
false)
13173 {
13174 if (!IsServerCheck(allow_client))
13175 return;
13176
13179
13181
13182 m_VarWet = Math.Clamp(value, min, max);
13183
13185 {
13188 }
13189 }
13190
13191 override void AddWet(
float value)
13192 {
13194 }
13195
13197 {
13199 }
13200
13202 {
13204 }
13205
13207 {
13209 }
13210
13212 {
13214 }
13215
13217 {
13219 }
13220
13221 override void OnWetChanged(
float newVal,
float oldVal)
13222 {
13225 if (newLevel != oldLevel)
13226 {
13228 }
13229 }
13230
13232 {
13233 SetWeightDirty();
13234 }
13235
13237 {
13238 return GetWetLevelInternal(
m_VarWet);
13239 }
13240
13241
13242
13244 {
13246 }
13247
13249 {
13251 }
13252
13254 {
13256 }
13257
13259 {
13261 }
13262
13263
13264
13266 {
13267 if (ConfigIsExisting("itemModelLength"))
13268 {
13269 return ConfigGetFloat("itemModelLength");
13270 }
13271 return 0;
13272 }
13273
13275 {
13276 if (ConfigIsExisting("itemAttachOffset"))
13277 {
13278 return ConfigGetFloat("itemAttachOffset");
13279 }
13280 return 0;
13281 }
13282
13283 override void SetCleanness(
int value,
bool allow_client =
false)
13284 {
13285 if (!IsServerCheck(allow_client))
13286 return;
13287
13289
13291
13294 }
13295
13297 {
13299 }
13300
13302 {
13303 return true;
13304 }
13305
13306
13307
13308
13310 {
13312 }
13313
13315 {
13317 }
13318
13319
13320
13321
13322 override void SetColor(
int r,
int g,
int b,
int a)
13323 {
13329 }
13331 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13332 {
13337 }
13338
13340 {
13342 }
13343
13346 {
13347 int r,g,b,a;
13349 r = r/255;
13350 g = g/255;
13351 b = b/255;
13352 a = a/255;
13353 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13354 }
13355
13356
13357
13358 override void SetLiquidType(
int value,
bool allow_client =
false)
13359 {
13360 if (!IsServerCheck(allow_client))
13361 return;
13362
13367 }
13368
13370 {
13371 return ConfigGetInt("varLiquidTypeInit");
13372 }
13373
13375 {
13377 }
13378
13380 {
13382 SetFrozen(false);
13383 }
13384
13387 {
13388 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13389 }
13390
13391
13394 {
13395 PlayerBase nplayer;
13396 if (PlayerBase.CastTo(nplayer, player))
13397 {
13399
13400 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13401 }
13402 }
13403
13404
13407 {
13408 PlayerBase nplayer;
13409 if (PlayerBase.CastTo(nplayer,player))
13410 {
13411
13412 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13413
13414 }
13415
13416
13417 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13418
13419
13420 if (HasEnergyManager())
13421 {
13422 GetCompEM().UpdatePlugState();
13423 }
13424 }
13425
13426
13428 {
13429 super.OnPlacementStarted(player);
13430
13432 }
13433
13434 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13435 {
13437 {
13438 m_AdminLog.OnPlacementComplete(player,
this);
13439 }
13440
13441 super.OnPlacementComplete(player, position, orientation);
13442 }
13443
13444
13445
13446
13447
13449 {
13451 {
13452 return true;
13453 }
13454 else
13455 {
13456 return false;
13457 }
13458 }
13459
13460
13462 {
13464 {
13466 }
13467 }
13468
13469
13471 {
13473 }
13474
13476 {
13478 }
13479
13480 override void InsertAgent(
int agent,
float count = 1)
13481 {
13482 if (count < 1)
13483 return;
13484
13486 }
13487
13490 {
13492 }
13493
13494
13496 {
13498 }
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13542 {
13544 return false;
13545 return true;
13546 }
13547
13549 {
13550
13552 }
13553
13554
13557 {
13558 super.CheckForRoofLimited(timeTresholdMS);
13559
13561 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13562 {
13563 m_PreviousRoofTestTime = time;
13564 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13565 }
13566 }
13567
13568
13570 {
13572 {
13573 return 0;
13574 }
13575
13576 if (GetInventory().GetAttachmentSlotsCount() != 0)
13577 {
13578 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13579 if (filter)
13580 return filter.GetProtectionLevel(type, false, system);
13581 else
13582 return 0;
13583 }
13584
13585 string subclassPath, entryName;
13586
13587 switch (type)
13588 {
13590 entryName = "biological";
13591 break;
13593 entryName = "chemical";
13594 break;
13595 default:
13596 entryName = "biological";
13597 break;
13598 }
13599
13600 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13601
13603 }
13604
13605
13606
13609 {
13610 if (!IsMagazine())
13612
13614 }
13615
13616
13617
13618
13619
13624 {
13625 return true;
13626 }
13627
13629 {
13631 }
13632
13633
13634
13635
13636
13638 {
13639 if (parent)
13640 {
13641 if (parent.IsInherited(DayZInfected))
13642 return true;
13643
13644 if (!parent.IsRuined())
13645 return true;
13646 }
13647
13648 return true;
13649 }
13650
13652 {
13653 if (!super.CanPutAsAttachment(parent))
13654 {
13655 return false;
13656 }
13657
13658 if (!IsRuined() && !parent.IsRuined())
13659 {
13660 return true;
13661 }
13662
13663 return false;
13664 }
13665
13667 {
13668
13669
13670
13671
13672 return super.CanReceiveItemIntoCargo(item);
13673 }
13674
13676 {
13677
13678
13679
13680
13681 GameInventory attachmentInv = attachment.GetInventory();
13683 {
13684 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13685 return false;
13686 }
13687
13688 InventoryLocation loc = new InventoryLocation();
13689 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13690 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13691 return false;
13692
13693 return super.CanReceiveAttachment(attachment, slotId);
13694 }
13695
13697 {
13698 if (!super.CanReleaseAttachment(attachment))
13699 return false;
13700
13701 return GetInventory().AreChildrenAccessible();
13702 }
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13725 {
13726 int id = muzzle_owner.GetMuzzleID();
13727 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13728
13729 if (WPOF_array)
13730 {
13731 for (int i = 0; i < WPOF_array.Count(); i++)
13732 {
13733 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13734
13735 if (WPOF)
13736 {
13737 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13738 }
13739 }
13740 }
13741 }
13742
13743
13745 {
13746 int id = muzzle_owner.GetMuzzleID();
13748
13749 if (WPOBE_array)
13750 {
13751 for (int i = 0; i < WPOBE_array.Count(); i++)
13752 {
13753 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13754
13755 if (WPOBE)
13756 {
13757 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13758 }
13759 }
13760 }
13761 }
13762
13763
13765 {
13766 int id = muzzle_owner.GetMuzzleID();
13767 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13768
13769 if (WPOOH_array)
13770 {
13771 for (int i = 0; i < WPOOH_array.Count(); i++)
13772 {
13773 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13774
13775 if (WPOOH)
13776 {
13777 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13778 }
13779 }
13780 }
13781 }
13782
13783
13785 {
13786 int id = muzzle_owner.GetMuzzleID();
13787 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13788
13789 if (WPOOH_array)
13790 {
13791 for (int i = 0; i < WPOOH_array.Count(); i++)
13792 {
13793 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13794
13795 if (WPOOH)
13796 {
13797 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13798 }
13799 }
13800 }
13801 }
13802
13803
13805 {
13806 int id = muzzle_owner.GetMuzzleID();
13807 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13808
13809 if (WPOOH_array)
13810 {
13811 for (int i = 0; i < WPOOH_array.Count(); i++)
13812 {
13813 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13814
13815 if (WPOOH)
13816 {
13817 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13818 }
13819 }
13820 }
13821 }
13822
13823
13824
13826 {
13828 {
13829 return true;
13830 }
13831
13832 return false;
13833 }
13834
13836 {
13838 {
13839 return true;
13840 }
13841
13842 return false;
13843 }
13844
13846 {
13848 {
13849 return true;
13850 }
13851
13852 return false;
13853 }
13854
13856 {
13857 return false;
13858 }
13859
13862 {
13863 return UATimeSpent.DEFAULT_DEPLOY;
13864 }
13865
13866
13867
13868
13870 {
13872 SetSynchDirty();
13873 }
13874
13876 {
13878 }
13879
13880
13882 {
13883 return false;
13884 }
13885
13888 {
13889 string att_type = "None";
13890
13891 if (ConfigIsExisting("soundAttType"))
13892 {
13893 att_type = ConfigGetString("soundAttType");
13894 }
13895
13897 }
13898
13900 {
13902 }
13903
13904
13905
13906
13907
13913
13915 {
13918
13920 }
13921
13922
13924 {
13926 return;
13927
13929
13932
13935
13936 SoundParameters params = new SoundParameters();
13940 }
13941
13942
13944 {
13946 return;
13947
13949 SetSynchDirty();
13950
13953 }
13954
13955
13957 {
13959 return;
13960
13962 SetSynchDirty();
13963
13966 }
13967
13969 {
13971 }
13972
13974 {
13976 }
13977
13980 {
13981 if (!
GetGame().IsDedicatedServer())
13982 {
13983 if (ConfigIsExisting("attachSoundSet"))
13984 {
13985 string cfg_path = "";
13986 string soundset = "";
13987 string type_name =
GetType();
13988
13991 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13992 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13993
13994 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13995 {
13996 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13997 {
13998 if (cfg_slot_array[i] == slot_type)
13999 {
14000 soundset = cfg_soundset_array[i];
14001 break;
14002 }
14003 }
14004 }
14005
14006 if (soundset != "")
14007 {
14008 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14010 }
14011 }
14012 }
14013 }
14014
14016 {
14017
14018 }
14019
14020 void OnApply(PlayerBase player);
14021
14023 {
14024 return 1.0;
14025 };
14026
14028 {
14030 }
14031
14033 {
14035 }
14036
14038
14040 {
14041 SetDynamicPhysicsLifeTime(0.01);
14043 }
14044
14046 {
14047 array<string> zone_names = new array<string>;
14048 GetDamageZones(zone_names);
14049 for (int i = 0; i < zone_names.Count(); i++)
14050 {
14051 SetHealthMax(zone_names.Get(i),"Health");
14052 }
14053 SetHealthMax("","Health");
14054 }
14055
14058 {
14059 float global_health = GetHealth01("","Health");
14060 array<string> zones = new array<string>;
14061 GetDamageZones(zones);
14062
14063 for (int i = 0; i < zones.Count(); i++)
14064 {
14065 SetHealth01(zones.Get(i),"Health",global_health);
14066 }
14067 }
14068
14071 {
14072 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14073 }
14074
14076 {
14077 if (!hasRootAsPlayer)
14078 {
14079 if (refParentIB)
14080 {
14081
14082 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14083 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14084
14085 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14086 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14087
14090 }
14091 else
14092 {
14093
14096 }
14097 }
14098 }
14099
14101 {
14103 {
14104 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14105 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14106 {
14107 float heatPermCoef = 1.0;
14109 while (ent)
14110 {
14111 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14112 ent = ent.GetHierarchyParent();
14113 }
14114
14115 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14116 }
14117 }
14118 }
14119
14121 {
14122
14123 EntityAI parent = GetHierarchyParent();
14124 if (!parent)
14125 {
14126 hasParent = false;
14127 hasRootAsPlayer = false;
14128 }
14129 else
14130 {
14131 hasParent = true;
14132 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14133 refParentIB =
ItemBase.Cast(parent);
14134 }
14135 }
14136
14137 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14138 {
14139
14140 }
14141
14143 {
14144
14145 return false;
14146 }
14147
14149 {
14150
14151
14152 return false;
14153 }
14154
14156 {
14157
14158 return false;
14159 }
14160
14163 {
14164 return !GetIsFrozen() &&
IsOpen();
14165 }
14166
14168 {
14169 bool hasParent = false, hasRootAsPlayer = false;
14171
14172 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14173 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14174
14175 if (wwtu || foodDecay)
14176 {
14180
14181 if (processWetness || processTemperature || processDecay)
14182 {
14184
14185 if (processWetness)
14186 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14187
14188 if (processTemperature)
14190
14191 if (processDecay)
14192 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14193 }
14194 }
14195 }
14196
14199 {
14201 }
14202
14204 {
14207
14208 return super.GetTemperatureFreezeThreshold();
14209 }
14210
14212 {
14215
14216 return super.GetTemperatureThawThreshold();
14217 }
14218
14220 {
14223
14224 return super.GetItemOverheatThreshold();
14225 }
14226
14228 {
14230 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14231
14232 return super.GetTemperatureFreezeTime();
14233 }
14234
14236 {
14238 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14239
14240 return super.GetTemperatureThawTime();
14241 }
14242
14247
14249 {
14250 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14251 }
14252
14254 {
14255 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14256 }
14257
14260 {
14262 }
14263
14265 {
14267 }
14268
14270 {
14272 }
14273
14276 {
14277 return null;
14278 }
14279
14282 {
14283 return false;
14284 }
14285
14287 {
14289 {
14292 if (!trg)
14293 {
14295 explosive = this;
14296 }
14297
14298 explosive.PairRemote(trg);
14300
14301 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14302 trg.SetPersistentPairID(persistentID);
14303 explosive.SetPersistentPairID(persistentID);
14304
14305 return true;
14306 }
14307 return false;
14308 }
14309
14312 {
14313 float ret = 1.0;
14316 ret *= GetHealth01();
14317
14318 return ret;
14319 }
14320
14321 #ifdef DEVELOPER
14322 override void SetDebugItem()
14323 {
14324 super.SetDebugItem();
14325 _itemBase = this;
14326 }
14327
14329 {
14330 string text = super.GetDebugText();
14331
14333 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14334
14335 return text;
14336 }
14337 #endif
14338
14340 {
14341 return true;
14342 }
14343
14345
14347
14349 {
14352 }
14353
14354
14362
14378}
14379
14381{
14383 if (entity)
14384 {
14385 bool is_item = entity.IsInherited(
ItemBase);
14386 if (is_item && full_quantity)
14387 {
14390 }
14391 }
14392 else
14393 {
14395 return NULL;
14396 }
14397 return entity;
14398}
14399
14401{
14402 if (item)
14403 {
14404 if (health > 0)
14405 item.SetHealth("", "", health);
14406
14407 if (item.CanHaveTemperature())
14408 {
14410 if (item.CanFreeze())
14411 item.SetFrozen(false);
14412 }
14413
14414 if (item.HasEnergyManager())
14415 {
14416 if (quantity >= 0)
14417 {
14418 item.GetCompEM().SetEnergy0To1(quantity);
14419 }
14420 else
14421 {
14423 }
14424 }
14425 else if (item.IsMagazine())
14426 {
14427 Magazine mag = Magazine.Cast(item);
14428 if (quantity >= 0)
14429 {
14430 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14431 }
14432 else
14433 {
14435 }
14436
14437 }
14438 else
14439 {
14440 if (quantity >= 0)
14441 {
14442 item.SetQuantityNormalized(quantity, false);
14443 }
14444 else
14445 {
14447 }
14448
14449 }
14450 }
14451}
14452
14453#ifdef DEVELOPER
14455#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.