9522{
9524 {
9525 return true;
9526 }
9527};
9528
9529
9530
9532{
9536
9538
9541
9542
9543
9544
9545
9554
9560
9565
9570
9591 protected bool m_IsResultOfSplit
9592
9594
9599
9600
9601
9603
9607
9608
9609
9611
9614
9615
9616
9622
9623
9631
9634
9635
9637
9638
9640
9641
9646
9647
9652
9653
9655
9656
9658 {
9663
9664 if (!
GetGame().IsDedicatedServer())
9665 {
9667 {
9669
9671 {
9673 }
9674 }
9675
9678 }
9679
9680 m_OldLocation = null;
9681
9683 {
9685 }
9686
9687 if (ConfigIsExisting("headSelectionsToHide"))
9688 {
9691 }
9692
9694 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9695 {
9697 }
9698
9700
9701 m_IsResultOfSplit = false;
9702
9704 }
9705
9707 {
9708 super.InitItemVariables();
9709
9715 m_Count = ConfigGetInt(
"count");
9716
9719
9724
9727
9732
9744
9748
9749
9752 if (ConfigIsExisting("canBeSplit"))
9753 {
9756 }
9757
9759 if (ConfigIsExisting("itemBehaviour"))
9761
9762
9765 RegisterNetSyncVariableInt("m_VarLiquidType");
9766 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9767
9768 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9769 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9770 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9771
9772 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9773 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9774 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9775 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9776
9777 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9778 RegisterNetSyncVariableBool("m_IsTakeable");
9779 RegisterNetSyncVariableBool("m_IsHologram");
9780
9783 {
9786 }
9787
9789
9791 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9793
9794 }
9795
9797 {
9799 }
9800
9802 {
9805 {
9810 }
9811 }
9812
9813 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9814 {
9816 {
9819 }
9820
9822 }
9823
9825 {
9831 }
9832
9834
9836 {
9838
9839 if (!action)
9840 {
9841 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9842 return;
9843 }
9844
9846 if (!ai)
9847 {
9849 return;
9850 }
9851
9853 if (!action_array)
9854 {
9855 action_array = new array<ActionBase_Basic>;
9857 }
9858 if (LogManager.IsActionLogEnable())
9859 {
9860 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9861 }
9862
9863 if (action_array.Find(action) != -1)
9864 {
9865 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9866 }
9867 else
9868 {
9869 action_array.Insert(action);
9870 }
9871 }
9872
9874 {
9876 ActionBase action = player.GetActionManager().GetAction(actionName);
9879
9880 if (action_array)
9881 {
9882 action_array.RemoveItem(action);
9883 }
9884 }
9885
9886
9887
9889 {
9890 ActionOverrideData overrideData = new ActionOverrideData();
9894
9896 if (!actionMap)
9897 {
9900 }
9901
9902 actionMap.Insert(this.
Type(), overrideData);
9903
9904 }
9905
9907
9909
9910
9912 {
9915
9918
9919 string config_to_search = "CfgVehicles";
9920 string muzzle_owner_config;
9921
9923 {
9924 if (IsInherited(Weapon))
9925 config_to_search = "CfgWeapons";
9926
9927 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9928
9929 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9930
9932
9933 if (config_OnFire_subclass_count > 0)
9934 {
9935 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9936
9937 for (int i = 0; i < config_OnFire_subclass_count; i++)
9938 {
9939 string particle_class = "";
9941 string config_OnFire_entry = config_OnFire_class + particle_class;
9942 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9943 WPOF_array.Insert(WPOF);
9944 }
9945
9946
9948 }
9949 }
9950
9952 {
9953 config_to_search = "CfgWeapons";
9954 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9955
9956 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9957
9959
9960 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9961 {
9962 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9963
9964 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9965 {
9966 string particle_class2 = "";
9968 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9969 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9970 WPOBE_array.Insert(WPOBE);
9971 }
9972
9973
9975 }
9976 }
9977 }
9978
9979
9981 {
9984
9986 {
9987 string config_to_search = "CfgVehicles";
9988
9989 if (IsInherited(Weapon))
9990 config_to_search = "CfgWeapons";
9991
9992 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9993 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9994
9995 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9996 {
9997
9999
10001 {
10003 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
10005 return;
10006 }
10007
10010
10011
10012
10014 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
10015
10016 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
10017 {
10018 string particle_class = "";
10020 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
10022
10023 if (entry_type == CT_CLASS)
10024 {
10025 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
10026 WPOOH_array.Insert(WPOF);
10027 }
10028 }
10029
10030
10032 }
10033 }
10034 }
10035
10037 {
10039 }
10040
10042 {
10044 {
10046
10049
10052
10053 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10054 }
10055 }
10056
10058 {
10060 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10061
10063 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10064
10066 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10067
10069 {
10071 }
10072 }
10073
10075 {
10077 }
10078
10080 {
10083 else
10085
10087 {
10090 }
10091 else
10092 {
10095
10098 }
10099
10101 }
10102
10104 {
10106 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10107 }
10108
10110 {
10112 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10114 }
10115
10117 {
10119 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10120 }
10121
10123 {
10126
10127 OverheatingParticle OP = new OverheatingParticle();
10132
10134 }
10135
10137 {
10140
10141 return -1;
10142 }
10143
10145 {
10147 {
10150
10151 for (int i = count; i > 0; --i)
10152 {
10153 int id = i - 1;
10156
10159
10160 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10161 {
10162 if (p)
10163 {
10166 }
10167 }
10168 }
10169 }
10170 }
10171
10173 {
10175 {
10177 {
10178 int id = i - 1;
10180
10181 if (OP)
10182 {
10184
10185 if (p)
10186 {
10188 }
10189
10190 delete OP;
10191 }
10192 }
10193
10196 }
10197 }
10198
10201 {
10202 return 0.0;
10203 }
10204
10205
10207 {
10208 return 250;
10209 }
10210
10212 {
10213 return 0;
10214 }
10215
10218 {
10220 return true;
10221
10222 return false;
10223 }
10224
10227 {
10230
10232 {
10234 }
10235 else
10236 {
10237
10239 }
10240
10242 }
10243
10250 {
10251 return -1;
10252 }
10253
10254
10255
10256
10258 {
10260 {
10262 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10263
10264 if (r_index >= 0)
10265 {
10266 InventoryLocation r_il = new InventoryLocation;
10267 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10268
10269 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10272 {
10273 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10274 }
10276 {
10277 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10278 }
10279
10280 }
10281
10282 player.GetHumanInventory().ClearUserReservedLocation(this);
10283 }
10284
10287 }
10288
10289
10290
10291
10293 {
10294 return ItemBase.m_DebugActionsMask;
10295 }
10296
10298 {
10299 return ItemBase.m_DebugActionsMask & mask;
10300 }
10301
10303 {
10304 ItemBase.m_DebugActionsMask = mask;
10305 }
10306
10308 {
10309 ItemBase.m_DebugActionsMask |= mask;
10310 }
10311
10313 {
10314 ItemBase.m_DebugActionsMask &= ~mask;
10315 }
10316
10318 {
10320 {
10322 }
10323 else
10324 {
10326 }
10327 }
10328
10329
10331 {
10332 if (GetEconomyProfile())
10333 {
10334 float q_max = GetEconomyProfile().GetQuantityMax();
10335 if (q_max > 0)
10336 {
10337 float q_min = GetEconomyProfile().GetQuantityMin();
10338 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10339
10341 {
10342 ComponentEnergyManager comp = GetCompEM();
10344 {
10346 }
10347 }
10349 {
10351
10352 }
10353
10354 }
10355 }
10356 }
10357
10360 {
10361 EntityAI parent = GetHierarchyParent();
10362
10363 if (parent)
10364 {
10365 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10366 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10367 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10368 }
10369 }
10370
10373 {
10374 EntityAI parent = GetHierarchyParent();
10375
10376 if (parent)
10377 {
10378 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10379 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10380 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10381 }
10382 }
10383
10385 {
10386
10387
10388
10389
10391
10393 {
10394 if (ScriptInputUserData.CanStoreInputUserData())
10395 {
10396 ScriptInputUserData ctx = new ScriptInputUserData;
10402 ctx.
Write(use_stack_max);
10405
10407 {
10408 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10409 }
10410 }
10411 }
10412 else if (!
GetGame().IsMultiplayer())
10413 {
10415 }
10416 }
10417
10419 {
10421 }
10422
10424 {
10426 }
10427
10429 {
10431 }
10432
10434 {
10435
10436 return false;
10437 }
10438
10440 {
10441 return false;
10442 }
10443
10447 {
10448 return false;
10449 }
10450
10452 {
10453 return "";
10454 }
10455
10457
10459 {
10460 return false;
10461 }
10462
10464 {
10465 return true;
10466 }
10467
10468
10469
10471 {
10472 return true;
10473 }
10474
10476 {
10477 return true;
10478 }
10479
10481 {
10482 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10484 }
10485
10487 {
10489 }
10490
10492 {
10494 if (!is_being_placed)
10496 SetSynchDirty();
10497 }
10498
10499
10501
10503 {
10505 }
10506
10508 {
10510 }
10511
10513 {
10514 return 1;
10515 }
10516
10518 {
10519 return false;
10520 }
10521
10523 {
10525 SetSynchDirty();
10526 }
10527
10528
10529
10530
10531
10532
10533
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
10563 {
10564 super.OnMovedInsideCargo(container);
10565
10566 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10567 }
10568
10569 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10570 {
10571 super.EEItemLocationChanged(oldLoc,newLoc);
10572
10573 PlayerBase new_player = null;
10574 PlayerBase old_player = null;
10575
10576 if (newLoc.GetParent())
10577 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10578
10579 if (oldLoc.GetParent())
10580 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10581
10583 {
10584 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10585
10586 if (r_index >= 0)
10587 {
10588 InventoryLocation r_il = new InventoryLocation;
10589 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10590
10591 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10594 {
10595 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10596 }
10598 {
10599 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10600 }
10601
10602 }
10603 }
10604
10606 {
10607 if (new_player)
10608 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10609
10610 if (new_player == old_player)
10611 {
10612
10613 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10614 {
10616 {
10617 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10618 {
10619 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10620 }
10621 }
10622 else
10623 {
10624 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10625 }
10626 }
10627
10628 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10629 {
10630 int type = oldLoc.GetType();
10632 {
10633 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10634 }
10636 {
10637 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10638 }
10639 }
10640 if (!m_OldLocation)
10641 {
10642 m_OldLocation = new InventoryLocation;
10643 }
10644 m_OldLocation.Copy(oldLoc);
10645 }
10646 else
10647 {
10648 if (m_OldLocation)
10649 {
10650 m_OldLocation.Reset();
10651 }
10652 }
10653
10655 }
10656 else
10657 {
10658 if (new_player)
10659 {
10660 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10661 if (res_index >= 0)
10662 {
10663 InventoryLocation il = new InventoryLocation;
10664 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10666 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10669 {
10670 il.
GetParent().GetOnReleaseLock().Invoke(it);
10671 }
10673 {
10675 }
10676
10677 }
10678 }
10680 {
10681
10683 }
10684
10685 if (m_OldLocation)
10686 {
10687 m_OldLocation.Reset();
10688 }
10689 }
10690 }
10691
10692 override void EOnContact(IEntity other, Contact extra)
10693 {
10695 {
10696 int liquidType = -1;
10698 if (impactSpeed > 0.0)
10699 {
10701 #ifndef SERVER
10703 #else
10705 SetSynchDirty();
10706 #endif
10708 }
10709 }
10710
10711 #ifdef SERVER
10712 if (GetCompEM() && GetCompEM().IsPlugged())
10713 {
10714 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10715 GetCompEM().UnplugThis();
10716 }
10717 #endif
10718 }
10719
10721
10723 {
10725 }
10726
10728 {
10729
10730 }
10731
10733 {
10734 super.OnItemLocationChanged(old_owner, new_owner);
10735
10736 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10737 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10738
10739 if (!relatedPlayer && playerNew)
10740 relatedPlayer = playerNew;
10741
10742 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10743 {
10745 if (actionMgr)
10746 {
10747 ActionBase currentAction = actionMgr.GetRunningAction();
10748 if (currentAction)
10750 }
10751 }
10752
10753 Man ownerPlayerOld = null;
10754 Man ownerPlayerNew = null;
10755
10756 if (old_owner)
10757 {
10758 if (old_owner.
IsMan())
10759 {
10760 ownerPlayerOld = Man.Cast(old_owner);
10761 }
10762 else
10763 {
10764 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10765 }
10766 }
10767 else
10768 {
10770 {
10772
10773 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10774 {
10775 GetCompEM().UnplugThis();
10776 }
10777 }
10778 }
10779
10780 if (new_owner)
10781 {
10782 if (new_owner.
IsMan())
10783 {
10784 ownerPlayerNew = Man.Cast(new_owner);
10785 }
10786 else
10787 {
10788 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10789 }
10790 }
10791
10792 if (ownerPlayerOld != ownerPlayerNew)
10793 {
10794 if (ownerPlayerOld)
10795 {
10796 array<EntityAI> subItemsExit = new array<EntityAI>;
10798 for (int i = 0; i < subItemsExit.Count(); i++)
10799 {
10802 }
10803 }
10804
10805 if (ownerPlayerNew)
10806 {
10807 array<EntityAI> subItemsEnter = new array<EntityAI>;
10809 for (int j = 0; j < subItemsEnter.Count(); j++)
10810 {
10813 }
10814 }
10815 }
10816 else if (ownerPlayerNew != null)
10817 {
10818 PlayerBase nplayer;
10819 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10820 {
10821 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10823 for (int k = 0; k < subItemsUpdate.Count(); k++)
10824 {
10826 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10827 }
10828 }
10829 }
10830
10831 if (old_owner)
10832 old_owner.OnChildItemRemoved(this);
10833 if (new_owner)
10834 new_owner.OnChildItemReceived(this);
10835 }
10836
10837
10839 {
10840 super.EEDelete(parent);
10841 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10842 if (player)
10843 {
10845
10846 if (player.IsAlive())
10847 {
10848 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10849 if (r_index >= 0)
10850 {
10851 InventoryLocation r_il = new InventoryLocation;
10852 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10853
10854 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10857 {
10858 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10859 }
10861 {
10862 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10863 }
10864
10865 }
10866
10867 player.RemoveQuickBarEntityShortcut(this);
10868 }
10869 }
10870 }
10871
10873 {
10874 super.EEKilled(killer);
10875
10878 {
10879 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10880 {
10881 if (IsMagazine())
10882 {
10883 if (Magazine.Cast(this).GetAmmoCount() > 0)
10884 {
10886 }
10887 }
10888 else
10889 {
10891 }
10892 }
10893 }
10894 }
10895
10897 {
10898 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10899
10900 super.OnWasAttached(parent, slot_id);
10901
10904
10906 }
10907
10909 {
10910 super.OnWasDetached(parent, slot_id);
10911
10914 }
10915
10917 {
10918 int idx;
10921
10922 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10923 if (inventory_slots.Count() < 1)
10924 {
10925 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10926 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10927 }
10928 else
10929 {
10930 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10931 }
10932
10933 idx = inventory_slots.Find(slot);
10934 if (idx < 0)
10935 return "";
10936
10937 return attach_types.Get(idx);
10938 }
10939
10941 {
10942 int idx = -1;
10943 string slot;
10944
10947
10948 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10949 if (inventory_slots.Count() < 1)
10950 {
10951 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10952 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10953 }
10954 else
10955 {
10956 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10957 if (detach_types.Count() < 1)
10958 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10959 }
10960
10961 for (int i = 0; i < inventory_slots.Count(); i++)
10962 {
10963 slot = inventory_slots.Get(i);
10964 }
10965
10966 if (slot != "")
10967 {
10968 if (detach_types.Count() == 1)
10969 idx = 0;
10970 else
10971 idx = inventory_slots.Find(slot);
10972 }
10973 if (idx < 0)
10974 return "";
10975
10976 return detach_types.Get(idx);
10977 }
10978
10980 {
10981
10983
10984
10985 float min_time = 1;
10986 float max_time = 3;
10987 float delay = Math.RandomFloat(min_time, max_time);
10988
10989 explode_timer.Run(delay, this, "DoAmmoExplosion");
10990 }
10991
10993 {
10994 Magazine magazine = Magazine.Cast(this);
10995 int pop_sounds_count = 6;
10996 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10997
10998
10999 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
11000 string sound_name = pop_sounds[ sound_idx ];
11002
11003
11004 magazine.ServerAddAmmoCount(-1);
11005
11006
11007 float min_temp_to_explode = 100;
11008
11009 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
11010 {
11012 }
11013 }
11014
11015
11016 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
11017 {
11018 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
11019
11020 const int CHANCE_DAMAGE_CARGO = 4;
11021 const int CHANCE_DAMAGE_ATTACHMENT = 1;
11022 const int CHANCE_DAMAGE_NOTHING = 2;
11023
11025 {
11026 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
11027 int chances;
11028 int rnd;
11029
11030 if (GetInventory().GetCargo())
11031 {
11032 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11033 rnd = Math.RandomInt(0,chances);
11034
11035 if (rnd < CHANCE_DAMAGE_CARGO)
11036 {
11038 }
11039 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11040 {
11042 }
11043 }
11044 else
11045 {
11046 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11047 rnd = Math.RandomInt(0,chances);
11048
11049 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11050 {
11052 }
11053 }
11054 }
11055 }
11056
11058 {
11059 if (GetInventory().GetCargo())
11060 {
11061 int item_count = GetInventory().GetCargo().GetItemCount();
11062 if (item_count > 0)
11063 {
11064 int random_pick = Math.RandomInt(0, item_count);
11066 if (!item.IsExplosive())
11067 {
11068 item.AddHealth("","",damage);
11069 return true;
11070 }
11071 }
11072 }
11073 return false;
11074 }
11075
11077 {
11078 int attachment_count = GetInventory().AttachmentCount();
11079 if (attachment_count > 0)
11080 {
11081 int random_pick = Math.RandomInt(0, attachment_count);
11082 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11083 if (!attachment.IsExplosive())
11084 {
11085 attachment.AddHealth("","",damage);
11086 return true;
11087 }
11088 }
11089 return false;
11090 }
11091
11093 {
11095 }
11096
11098 {
11100 return GetInventory().CanRemoveEntity();
11101
11102 return false;
11103 }
11104
11106 {
11107
11109 return false;
11110
11111
11113 return false;
11114
11115
11116
11118 if (delta == 0)
11119 return false;
11120
11121
11122 return true;
11123 }
11124
11126 {
11128 {
11129 if (ScriptInputUserData.CanStoreInputUserData())
11130 {
11131 ScriptInputUserData ctx = new ScriptInputUserData;
11136 ctx.
Write(destination_entity);
11138 ctx.
Write(slot_id);
11140 }
11141 }
11142 else if (!
GetGame().IsMultiplayer())
11143 {
11145 }
11146 }
11147
11149 {
11150 float split_quantity_new;
11154 InventoryLocation loc = new InventoryLocation;
11155
11156 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11157 {
11159 split_quantity_new = stack_max;
11160 else
11162
11164 {
11165 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11166 if (new_item)
11167 {
11168 new_item.SetResultOfSplit(true);
11169 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11171 new_item.
SetQuantity(split_quantity_new,
false,
true);
11172 }
11173 }
11174 }
11175 else if (destination_entity && slot_id == -1)
11176 {
11177 if (quantity > stack_max)
11178 split_quantity_new = stack_max;
11179 else
11180 split_quantity_new = quantity;
11181
11183 {
11185 {
11188 }
11189
11190 if (new_item)
11191 {
11192 new_item.SetResultOfSplit(true);
11193 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11195 new_item.
SetQuantity(split_quantity_new,
false,
true);
11196 }
11197 }
11198 }
11199 else
11200 {
11201 if (stack_max != 0)
11202 {
11204 {
11206 }
11207
11208 if (split_quantity_new == 0)
11209 {
11210 if (!
GetGame().IsMultiplayer())
11211 player.PhysicalPredictiveDropItem(this);
11212 else
11213 player.ServerDropEntity(this);
11214 return;
11215 }
11216
11218 {
11220
11221 if (new_item)
11222 {
11223 new_item.SetResultOfSplit(true);
11224 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11227 new_item.PlaceOnSurface();
11228 }
11229 }
11230 }
11231 }
11232 }
11233
11235 {
11236 float split_quantity_new;
11240 InventoryLocation loc = new InventoryLocation;
11241
11242 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11243 {
11245 split_quantity_new = stack_max;
11246 else
11248
11250 {
11251 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11252 if (new_item)
11253 {
11254 new_item.SetResultOfSplit(true);
11255 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11257 new_item.
SetQuantity(split_quantity_new,
false,
true);
11258 }
11259 }
11260 }
11261 else if (destination_entity && slot_id == -1)
11262 {
11263 if (quantity > stack_max)
11264 split_quantity_new = stack_max;
11265 else
11266 split_quantity_new = quantity;
11267
11269 {
11271 {
11274 }
11275
11276 if (new_item)
11277 {
11278 new_item.SetResultOfSplit(true);
11279 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11281 new_item.
SetQuantity(split_quantity_new,
false,
true);
11282 }
11283 }
11284 }
11285 else
11286 {
11287 if (stack_max != 0)
11288 {
11290 {
11292 }
11293
11295 {
11297
11298 if (new_item)
11299 {
11300 new_item.SetResultOfSplit(true);
11301 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11304 new_item.PlaceOnSurface();
11305 }
11306 }
11307 }
11308 }
11309 }
11310
11312 {
11314 {
11315 if (ScriptInputUserData.CanStoreInputUserData())
11316 {
11317 ScriptInputUserData ctx = new ScriptInputUserData;
11322 dst.WriteToContext(ctx);
11324 }
11325 }
11326 else if (!
GetGame().IsMultiplayer())
11327 {
11329 }
11330 }
11331
11333 {
11335 {
11336 if (ScriptInputUserData.CanStoreInputUserData())
11337 {
11338 ScriptInputUserData ctx = new ScriptInputUserData;
11343 ctx.
Write(destination_entity);
11349 }
11350 }
11351 else if (!
GetGame().IsMultiplayer())
11352 {
11354 }
11355 }
11356
11358 {
11360 }
11361
11363 {
11365 float split_quantity_new;
11367 if (dst.IsValid())
11368 {
11369 int slot_id = dst.GetSlot();
11371
11372 if (quantity > stack_max)
11373 split_quantity_new = stack_max;
11374 else
11375 split_quantity_new = quantity;
11376
11378 {
11380
11381 if (new_item)
11382 {
11383 new_item.SetResultOfSplit(true);
11384 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11386 new_item.
SetQuantity(split_quantity_new,
false,
true);
11387 }
11388
11389 return new_item;
11390 }
11391 }
11392
11393 return null;
11394 }
11395
11397 {
11399 float split_quantity_new;
11401 if (destination_entity)
11402 {
11404 if (quantity > stackable)
11405 split_quantity_new = stackable;
11406 else
11407 split_quantity_new = quantity;
11408
11410 {
11411 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11412 if (new_item)
11413 {
11414 new_item.SetResultOfSplit(true);
11415 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11417 new_item.
SetQuantity(split_quantity_new,
false,
true);
11418 }
11419 }
11420 }
11421 }
11422
11424 {
11426 {
11427 if (ScriptInputUserData.CanStoreInputUserData())
11428 {
11429 ScriptInputUserData ctx = new ScriptInputUserData;
11434 ItemBase destination_entity =
this;
11435 ctx.
Write(destination_entity);
11439 }
11440 }
11441 else if (!
GetGame().IsMultiplayer())
11442 {
11444 }
11445 }
11446
11448 {
11450 float split_quantity_new;
11452 if (player)
11453 {
11455 if (quantity > stackable)
11456 split_quantity_new = stackable;
11457 else
11458 split_quantity_new = quantity;
11459
11461 {
11462 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11463 new_item =
ItemBase.Cast(in_hands);
11464 if (new_item)
11465 {
11466 new_item.SetResultOfSplit(true);
11467 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11469 new_item.SetQuantity(split_quantity_new, false, true);
11470 }
11471 }
11472 }
11473 }
11474
11476 {
11478 float split_quantity_new = Math.Floor(quantity * 0.5);
11479
11481 return;
11482
11484
11485 if (new_item)
11486 {
11487 if (new_item.GetQuantityMax() < split_quantity_new)
11488 {
11489 split_quantity_new = new_item.GetQuantityMax();
11490 }
11491
11492 new_item.SetResultOfSplit(true);
11493 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11494
11496 {
11499 }
11500 else
11501 {
11503 new_item.
SetQuantity(split_quantity_new,
false,
true);
11504 }
11505 }
11506 }
11507
11509 {
11511 float split_quantity_new = Math.Floor(quantity / 2);
11512
11514 return;
11515
11516 InventoryLocation invloc = new InventoryLocation;
11518
11520 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11521
11522 if (new_item)
11523 {
11524 if (new_item.GetQuantityMax() < split_quantity_new)
11525 {
11526 split_quantity_new = new_item.GetQuantityMax();
11527 }
11529 {
11532 }
11533 else if (split_quantity_new > 1)
11534 {
11536 new_item.
SetQuantity(split_quantity_new,
false,
true);
11537 }
11538 }
11539 }
11540
11543 {
11544 SetWeightDirty();
11546
11547 if (parent)
11548 parent.OnAttachmentQuantityChangedEx(this, delta);
11549
11551 {
11553 {
11555 }
11557 {
11558 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11560 }
11561 }
11562
11563 }
11564
11567 {
11568
11569 }
11570
11573 {
11575 }
11576
11578 {
11579 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11580
11582 {
11583 if (newLevel == GameConstants.STATE_RUINED)
11584 {
11586 EntityAI parent = GetHierarchyParent();
11587 if (parent && parent.IsFireplace())
11588 {
11589 CargoBase cargo = GetInventory().GetCargo();
11590 if (cargo)
11591 {
11593 {
11595 }
11596 }
11597 }
11598 }
11599
11601 {
11602
11604 return;
11605 }
11606
11607 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11608 {
11610 }
11611 }
11612 }
11613
11614
11616 {
11617 super.OnRightClick();
11618
11620 {
11622 {
11623 if (ScriptInputUserData.CanStoreInputUserData())
11624 {
11625 EntityAI root = GetHierarchyRoot();
11626 Man playerOwner = GetHierarchyRootPlayer();
11627 InventoryLocation dst = new InventoryLocation;
11628
11629
11630 if (!playerOwner && root && root == this)
11631 {
11633 }
11634 else
11635 {
11636
11637 GetInventory().GetCurrentInventoryLocation(dst);
11639 {
11642 {
11644 }
11645 else
11646 {
11648
11649
11650 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11651 {
11653 }
11654 else
11655 {
11656 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11657 }
11658 }
11659 }
11660 }
11661
11662 ScriptInputUserData ctx = new ScriptInputUserData;
11670 }
11671 }
11672 else if (!
GetGame().IsMultiplayer())
11673 {
11675 }
11676 }
11677 }
11678
11680 {
11681 if (root)
11682 {
11683 vector m4[4];
11684 root.GetTransform(m4);
11685 dst.SetGround(this, m4);
11686 }
11687 else
11688 {
11689 GetInventory().GetCurrentInventoryLocation(dst);
11690 }
11691 }
11692
11693 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11694 {
11695
11696 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11697 return false;
11698
11699 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11700 return false;
11701
11702
11704 return false;
11705
11706
11707 Magazine mag = Magazine.Cast(this);
11708 if (mag)
11709 {
11710 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11711 return false;
11712
11713 if (stack_max_limit)
11714 {
11715 Magazine other_mag = Magazine.Cast(other_item);
11716 if (other_item)
11717 {
11718 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11719 return false;
11720 }
11721
11722 }
11723 }
11724 else
11725 {
11726
11728 return false;
11729
11731 return false;
11732 }
11733
11734 PlayerBase player = null;
11735 if (CastTo(player, GetHierarchyRootPlayer()))
11736 {
11737 if (player.GetInventory().HasAttachment(this))
11738 return false;
11739
11740 if (player.IsItemsToDelete())
11741 return false;
11742 }
11743
11744 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11745 return false;
11746
11747 int slotID;
11749 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11750 return false;
11751
11752 return true;
11753 }
11754
11756 {
11758 }
11759
11761 {
11762 return m_IsResultOfSplit;
11763 }
11764
11766 {
11767 m_IsResultOfSplit = value;
11768 }
11769
11771 {
11773 }
11774
11776 {
11777 float other_item_quantity = other_item.GetQuantity();
11778 float this_free_space;
11779
11781
11783
11784 if (other_item_quantity > this_free_space)
11785 {
11786 return this_free_space;
11787 }
11788 else
11789 {
11790 return other_item_quantity;
11791 }
11792 }
11793
11795 {
11797 }
11798
11800 {
11802 return;
11803
11804 if (!IsMagazine() && other_item)
11805 {
11807 if (quantity_used != 0)
11808 {
11809 float hp1 = GetHealth01("","");
11810 float hp2 = other_item.GetHealth01("","");
11811 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11812 hpResult = hpResult / (
GetQuantity() + quantity_used);
11813
11814 hpResult *= GetMaxHealth();
11815 Math.Round(hpResult);
11816 SetHealth("", "Health", hpResult);
11817
11819 other_item.AddQuantity(-quantity_used);
11820 }
11821 }
11823 }
11824
11826 {
11827 #ifdef SERVER
11828 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11829 GetHierarchyParent().IncreaseLifetimeUp();
11830 #endif
11831 };
11832
11834 {
11835 PlayerBase p = PlayerBase.Cast(player);
11836
11837 array<int> recipesIds = p.m_Recipes;
11838 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11839 if (moduleRecipesManager)
11840 {
11841 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11842 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11843 }
11844
11845 for (int i = 0;i < recipesIds.Count(); i++)
11846 {
11847 int key = recipesIds.Get(i);
11848 string recipeName = moduleRecipesManager.GetRecipeName(key);
11850 }
11851 }
11852
11853
11854 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11855 {
11856 super.GetDebugActions(outputList);
11857
11858
11864
11865
11870
11875
11876
11880
11881
11883 {
11887 }
11888
11891
11892
11896
11898
11899 InventoryLocation loc = new InventoryLocation();
11900 GetInventory().GetCurrentInventoryLocation(loc);
11902 {
11903 if (Gizmo_IsSupported())
11906 }
11907
11909 }
11910
11911
11912
11913
11915 {
11916 super.OnAction(action_id, player, ctx);
11917
11919 {
11920 switch (action_id)
11921 {
11924 return true;
11927 return true;
11928 }
11929 }
11930
11932 {
11933 switch (action_id)
11934 {
11936 Delete();
11937 return true;
11938 }
11939 }
11940
11941 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11942 {
11943 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11944 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11945 PlayerBase p = PlayerBase.Cast(player);
11946 if (
EActions.RECIPES_RANGE_START < 1000)
11947 {
11948 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11949 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11950 }
11951 }
11952 #ifndef SERVER
11953 else if (action_id ==
EActions.WATCH_PLAYER)
11954 {
11955 PluginDeveloper.SetDeveloperItemClientEx(player);
11956 }
11957 #endif
11959 {
11960 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11961 {
11962 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11963 OnDebugButtonPressServer(id + 1);
11964 }
11965
11966 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11967 {
11968 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11970 }
11971
11972 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11973 {
11974 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11976 }
11977
11978 else if (action_id ==
EActions.ADD_QUANTITY)
11979 {
11980 if (IsMagazine())
11981 {
11982 Magazine mag = Magazine.Cast(this);
11983 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11984 }
11985 else
11986 {
11988 }
11989
11990 if (m_EM)
11991 {
11992 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11993 }
11994
11995 }
11996
11997 else if (action_id ==
EActions.REMOVE_QUANTITY)
11998 {
11999 if (IsMagazine())
12000 {
12001 Magazine mag2 = Magazine.Cast(this);
12002 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
12003 }
12004 else
12005 {
12007 }
12008 if (m_EM)
12009 {
12010 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
12011 }
12012
12013 }
12014
12015 else if (action_id ==
EActions.SET_QUANTITY_0)
12016 {
12018
12019 if (m_EM)
12020 {
12021 m_EM.SetEnergy(0);
12022 }
12023 }
12024
12025 else if (action_id ==
EActions.SET_MAX_QUANTITY)
12026 {
12028
12029 if (m_EM)
12030 {
12031 m_EM.SetEnergy(m_EM.GetEnergyMax());
12032 }
12033 }
12034
12035 else if (action_id ==
EActions.ADD_HEALTH)
12036 {
12037 AddHealth("","",GetMaxHealth("","Health")/5);
12038 }
12039 else if (action_id ==
EActions.REMOVE_HEALTH)
12040 {
12041 AddHealth("","",-GetMaxHealth("","Health")/5);
12042 }
12043 else if (action_id ==
EActions.DESTROY_HEALTH)
12044 {
12045 SetHealth01("","",0);
12046 }
12047 else if (action_id ==
EActions.WATCH_ITEM)
12048 {
12050 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12051 #ifdef DEVELOPER
12052 SetDebugDeveloper_item(this);
12053 #endif
12054 }
12055
12056 else if (action_id ==
EActions.ADD_TEMPERATURE)
12057 {
12058 AddTemperature(20);
12059
12060 }
12061
12062 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12063 {
12064 AddTemperature(-20);
12065
12066 }
12067
12068 else if (action_id ==
EActions.FLIP_FROZEN)
12069 {
12070 SetFrozen(!GetIsFrozen());
12071
12072 }
12073
12074 else if (action_id ==
EActions.ADD_WETNESS)
12075 {
12077
12078 }
12079
12080 else if (action_id ==
EActions.REMOVE_WETNESS)
12081 {
12083
12084 }
12085
12086 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12087 {
12090
12091
12092 }
12093
12094 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12095 {
12098 }
12099
12100 else if (action_id ==
EActions.MAKE_SPECIAL)
12101 {
12102 auto debugParams = DebugSpawnParams.WithPlayer(player);
12103 OnDebugSpawnEx(debugParams);
12104 }
12105
12106 }
12107
12108
12109 return false;
12110 }
12111
12112
12113
12114
12118
12121
12122
12123
12125 {
12126 return false;
12127 }
12128
12129
12131 {
12132 return true;
12133 }
12134
12135
12137 {
12138 return true;
12139 }
12140
12141
12142
12144 {
12145 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12147 }
12148
12151 {
12152 return null;
12153 }
12154
12156 {
12157 return false;
12158 }
12159
12161 {
12162 return false;
12163 }
12164
12168
12169
12171 {
12172 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12173 return module_repairing.CanRepair(this, item_repair_kit);
12174 }
12175
12176
12177 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12178 {
12179 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12180 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12181 }
12182
12183
12185 {
12186
12187
12188
12189
12190
12191
12192
12193
12194 return 1;
12195 }
12196
12197
12198
12200 {
12202 }
12203
12204
12205
12207 {
12209 }
12210
12211
12220 {
12221 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12222
12223 if (player)
12224 {
12225 player.MessageStatus(text);
12226 }
12227 }
12228
12229
12238 {
12239 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12240
12241 if (player)
12242 {
12243 player.MessageAction(text);
12244 }
12245 }
12246
12247
12256 {
12257 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12258
12259 if (player)
12260 {
12261 player.MessageFriendly(text);
12262 }
12263 }
12264
12265
12274 {
12275 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12276
12277 if (player)
12278 {
12279 player.MessageImportant(text);
12280 }
12281 }
12282
12284 {
12285 return true;
12286 }
12287
12288
12289 override bool KindOf(
string tag)
12290 {
12291 bool found = false;
12292 string item_name = this.
GetType();
12295
12296 int array_size = item_tag_array.Count();
12297 for (int i = 0; i < array_size; i++)
12298 {
12299 if (item_tag_array.Get(i) == tag)
12300 {
12301 found = true;
12302 break;
12303 }
12304 }
12305 return found;
12306 }
12307
12308
12310 {
12311
12312 super.OnRPC(sender, rpc_type,ctx);
12313
12314
12315 switch (rpc_type)
12316 {
12317 #ifndef SERVER
12318 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12319 Param2<bool, string> p = new Param2<bool, string>(false, "");
12320
12322 return;
12323
12324 bool play = p.param1;
12325 string soundSet = p.param2;
12326
12327 if (play)
12328 {
12330 {
12332 {
12334 }
12335 }
12336 else
12337 {
12339 }
12340 }
12341 else
12342 {
12344 }
12345
12346 break;
12347 #endif
12348
12349 }
12350
12352 {
12354 }
12355 }
12356
12357
12358
12359
12361 {
12362 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12363 return plugin.GetID(
name);
12364 }
12365
12367 {
12368 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12369 return plugin.GetName(id);
12370 }
12371
12374 {
12375
12376
12377 int varFlags;
12378 if (!ctx.
Read(varFlags))
12379 return;
12380
12381 if (varFlags & ItemVariableFlags.FLOAT)
12382 {
12384 }
12385 }
12386
12388 {
12389
12390 super.SerializeNumericalVars(floats_out);
12391
12392
12393
12395 {
12397 }
12398
12400 {
12402 }
12403
12405 {
12407 }
12408
12410 {
12415 }
12416
12418 {
12420 }
12421 }
12422
12424 {
12425
12426 super.DeSerializeNumericalVars(floats);
12427
12428
12429 int index = 0;
12430 int mask = Math.Round(floats.Get(index));
12431
12432 index++;
12433
12435 {
12437 {
12439 }
12440 else
12441 {
12442 float quantity = floats.Get(index);
12443 SetQuantity(quantity,
true,
false,
false,
false);
12444 }
12445 index++;
12446 }
12447
12449 {
12450 float wet = floats.Get(index);
12452 index++;
12453 }
12454
12456 {
12457 int liquidtype = Math.Round(floats.Get(index));
12459 index++;
12460 }
12461
12463 {
12465 index++;
12467 index++;
12469 index++;
12471 index++;
12472 }
12473
12475 {
12476 int cleanness = Math.Round(floats.Get(index));
12478 index++;
12479 }
12480 }
12481
12483 {
12484 super.WriteVarsToCTX(ctx);
12485
12486
12488 {
12490 }
12491
12493 {
12495 }
12496
12498 {
12500 }
12501
12503 {
12504 int r,g,b,a;
12510 }
12511
12513 {
12515 }
12516 }
12517
12519 {
12520 if (!super.ReadVarsFromCTX(ctx,version))
12521 return false;
12522
12523 int intValue;
12524 float value;
12525
12526 if (version < 140)
12527 {
12528 if (!ctx.
Read(intValue))
12529 return false;
12530
12531 m_VariablesMask = intValue;
12532 }
12533
12535 {
12536 if (!ctx.
Read(value))
12537 return false;
12538
12540 {
12542 }
12543 else
12544 {
12546 }
12547 }
12548
12549 if (version < 140)
12550 {
12552 {
12553 if (!ctx.
Read(value))
12554 return false;
12555 SetTemperatureDirect(value);
12556 }
12557 }
12558
12560 {
12561 if (!ctx.
Read(value))
12562 return false;
12564 }
12565
12567 {
12568 if (!ctx.
Read(intValue))
12569 return false;
12571 }
12572
12574 {
12575 int r,g,b,a;
12577 return false;
12579 return false;
12581 return false;
12583 return false;
12584
12586 }
12587
12589 {
12590 if (!ctx.
Read(intValue))
12591 return false;
12593 }
12594
12595 if (version >= 138 && version < 140)
12596 {
12598 {
12599 if (!ctx.
Read(intValue))
12600 return false;
12601 SetFrozen(intValue);
12602 }
12603 }
12604
12605 return true;
12606 }
12607
12608
12610 {
12613 {
12615 }
12616
12617 if (!super.OnStoreLoad(ctx, version))
12618 {
12620 return false;
12621 }
12622
12623 if (version >= 114)
12624 {
12625 bool hasQuickBarIndexSaved;
12626
12627 if (!ctx.
Read(hasQuickBarIndexSaved))
12628 {
12630 return false;
12631 }
12632
12633 if (hasQuickBarIndexSaved)
12634 {
12635 int itmQBIndex;
12636
12637
12638 if (!ctx.
Read(itmQBIndex))
12639 {
12641 return false;
12642 }
12643
12644 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12645 if (itmQBIndex != -1 && parentPlayer)
12646 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12647 }
12648 }
12649 else
12650 {
12651
12652 PlayerBase player;
12653 int itemQBIndex;
12654 if (version ==
int.
MAX)
12655 {
12656 if (!ctx.
Read(itemQBIndex))
12657 {
12659 return false;
12660 }
12661 }
12662 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12663 {
12664
12665 if (!ctx.
Read(itemQBIndex))
12666 {
12668 return false;
12669 }
12670 if (itemQBIndex != -1 && player)
12671 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12672 }
12673 }
12674
12675 if (version < 140)
12676 {
12677
12678 if (!LoadVariables(ctx, version))
12679 {
12681 return false;
12682 }
12683 }
12684
12685
12687 {
12689 return false;
12690 }
12691 if (version >= 132)
12692 {
12694 if (raib)
12695 {
12697 {
12699 return false;
12700 }
12701 }
12702 }
12703
12705 return true;
12706 }
12707
12708
12709
12711 {
12712 super.OnStoreSave(ctx);
12713
12714 PlayerBase player;
12715 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12716 {
12718
12719 int itemQBIndex = -1;
12720 itemQBIndex = player.FindQuickBarEntityIndex(this);
12721 ctx.
Write(itemQBIndex);
12722 }
12723 else
12724 {
12726 }
12727
12729
12731 if (raib)
12732 {
12734 }
12735 }
12736
12737
12739 {
12740 super.AfterStoreLoad();
12741
12743 {
12745 }
12746
12748 {
12751 }
12752 }
12753
12755 {
12756 super.EEOnAfterLoad();
12757
12759 {
12761 }
12762
12765 }
12766
12768 {
12769 return false;
12770 }
12771
12772
12773
12775 {
12777 {
12778 #ifdef PLATFORM_CONSOLE
12779
12781 {
12783 if (menu)
12784 {
12786 }
12787 }
12788 #endif
12789 }
12790
12792 {
12795 }
12796
12798 {
12799 SetWeightDirty();
12801 }
12803 {
12806 }
12807
12809 {
12812 }
12814 {
12817 }
12818
12819 super.OnVariablesSynchronized();
12820 }
12821
12822
12823
12825 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12826 {
12827 if (!IsServerCheck(allow_client))
12828 return false;
12829
12831 return false;
12832
12835
12836 if (value <= (min + 0.001))
12837 value = min;
12838
12839 if (value == min)
12840 {
12841 if (destroy_config)
12842 {
12843 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12844 if (dstr)
12845 {
12847 this.Delete();
12848 return true;
12849 }
12850 }
12851 else if (destroy_forced)
12852 {
12854 this.Delete();
12855 return true;
12856 }
12857
12859 }
12860
12863
12865 {
12867
12868 if (delta)
12870 }
12871
12873
12874 return false;
12875 }
12876
12877
12879 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12880 {
12882 }
12883
12885 {
12888 }
12889
12891 {
12894 }
12895
12897 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12898 {
12899 float value_clamped = Math.Clamp(value, 0, 1);
12901 SetQuantity(result, destroy_config, destroy_forced);
12902 }
12903
12904
12907 {
12909 }
12910
12912 {
12914 }
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12926 {
12927 int slot = -1;
12928 if (GetInventory())
12929 {
12930 InventoryLocation il = new InventoryLocation;
12931 GetInventory().GetCurrentInventoryLocation(il);
12933 }
12934
12936 }
12937
12939 {
12940 float quantity_max = 0;
12941
12943 {
12944 if (attSlotID != -1)
12945 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12946
12947 if (quantity_max <= 0)
12949 }
12950
12951 if (quantity_max <= 0)
12953
12954 return quantity_max;
12955 }
12956
12958 {
12960 }
12961
12963 {
12965 }
12966
12967
12969 {
12971 }
12972
12974 {
12976 }
12977
12979 {
12981 }
12982
12983
12985 {
12986
12987 float weightEx = GetWeightEx();
12988 float special = GetInventoryAndCargoWeight();
12989 return weightEx - special;
12990 }
12991
12992
12994 {
12996 }
12997
12999 {
13001 {
13002 #ifdef DEVELOPER
13003 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13004 {
13005 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
13007 }
13008 #endif
13009
13010 return GetQuantity() * GetConfigWeightModified();
13011 }
13012 else if (HasEnergyManager())
13013 {
13014 #ifdef DEVELOPER
13015 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13016 {
13017 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
13018 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
13019 }
13020 #endif
13021 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
13022 }
13023 else
13024 {
13025 #ifdef DEVELOPER
13026 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
13027 {
13028 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
13029 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
13030 }
13031 #endif
13032 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
13033 }
13034 }
13035
13038 {
13039 int item_count = 0;
13041
13042 if (GetInventory().GetCargo() != NULL)
13043 {
13044 item_count = GetInventory().GetCargo().GetItemCount();
13045 }
13046
13047 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13048 {
13049 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13050 if (item)
13051 item_count += item.GetNumberOfItems();
13052 }
13053 return item_count;
13054 }
13055
13058 {
13059 float weight = 0;
13060 float wetness = 1;
13061 if (include_wetness)
13064 {
13065 weight = wetness * m_ConfigWeight;
13066 }
13068 {
13069 weight = 1;
13070 }
13071 return weight;
13072 }
13073
13074
13075
13077 {
13078 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13079 {
13080 GameInventory inv = GetInventory();
13081 array<EntityAI> items = new array<EntityAI>;
13083 for (int i = 0; i < items.Count(); i++)
13084 {
13086 if (item)
13087 {
13089 }
13090 }
13091 }
13092 }
13093
13094
13095
13096
13098 {
13099 float energy = 0;
13100 if (HasEnergyManager())
13101 {
13102 energy = GetCompEM().GetEnergy();
13103 }
13104 return energy;
13105 }
13106
13107
13109 {
13110 super.OnEnergyConsumed();
13111
13113 }
13114
13116 {
13117 super.OnEnergyAdded();
13118
13120 }
13121
13122
13124 {
13125 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13126 {
13128 {
13129 float energy_0to1 = GetCompEM().GetEnergy0To1();
13131 }
13132 }
13133 }
13134
13135
13137 {
13138 return ConfigGetFloat("heatIsolation");
13139 }
13140
13142 {
13144 }
13145
13147 {
13148 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13149 if (
GetGame().ConfigIsExisting(paramPath))
13151
13152 return 0.0;
13153 }
13154
13156 {
13157 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13158 if (
GetGame().ConfigIsExisting(paramPath))
13160
13161 return 0.0;
13162 }
13163
13164 override void SetWet(
float value,
bool allow_client =
false)
13165 {
13166 if (!IsServerCheck(allow_client))
13167 return;
13168
13171
13173
13174 m_VarWet = Math.Clamp(value, min, max);
13175
13177 {
13180 }
13181 }
13182
13183 override void AddWet(
float value)
13184 {
13186 }
13187
13189 {
13191 }
13192
13194 {
13196 }
13197
13199 {
13201 }
13202
13204 {
13206 }
13207
13209 {
13211 }
13212
13213 override void OnWetChanged(
float newVal,
float oldVal)
13214 {
13217 if (newLevel != oldLevel)
13218 {
13220 }
13221 }
13222
13224 {
13225 SetWeightDirty();
13226 }
13227
13229 {
13230 return GetWetLevelInternal(
m_VarWet);
13231 }
13232
13233
13234
13236 {
13238 }
13239
13241 {
13243 }
13244
13246 {
13248 }
13249
13251 {
13253 }
13254
13255
13256
13258 {
13259 if (ConfigIsExisting("itemModelLength"))
13260 {
13261 return ConfigGetFloat("itemModelLength");
13262 }
13263 return 0;
13264 }
13265
13267 {
13268 if (ConfigIsExisting("itemAttachOffset"))
13269 {
13270 return ConfigGetFloat("itemAttachOffset");
13271 }
13272 return 0;
13273 }
13274
13275 override void SetCleanness(
int value,
bool allow_client =
false)
13276 {
13277 if (!IsServerCheck(allow_client))
13278 return;
13279
13281
13283
13286 }
13287
13289 {
13291 }
13292
13294 {
13295 return true;
13296 }
13297
13298
13299
13300
13302 {
13304 }
13305
13307 {
13309 }
13310
13311
13312
13313
13314 override void SetColor(
int r,
int g,
int b,
int a)
13315 {
13321 }
13323 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13324 {
13329 }
13330
13332 {
13334 }
13335
13338 {
13339 int r,g,b,a;
13341 r = r/255;
13342 g = g/255;
13343 b = b/255;
13344 a = a/255;
13345 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13346 }
13347
13348
13349
13350 override void SetLiquidType(
int value,
bool allow_client =
false)
13351 {
13352 if (!IsServerCheck(allow_client))
13353 return;
13354
13359 }
13360
13362 {
13363 return ConfigGetInt("varLiquidTypeInit");
13364 }
13365
13367 {
13369 }
13370
13372 {
13374 SetFrozen(false);
13375 }
13376
13379 {
13380 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13381 }
13382
13383
13386 {
13387 PlayerBase nplayer;
13388 if (PlayerBase.CastTo(nplayer, player))
13389 {
13391
13392 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13393 }
13394 }
13395
13396
13399 {
13400 PlayerBase nplayer;
13401 if (PlayerBase.CastTo(nplayer,player))
13402 {
13403
13404 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13405
13406 }
13407
13408
13409 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13410
13411
13412 if (HasEnergyManager())
13413 {
13414 GetCompEM().UpdatePlugState();
13415 }
13416 }
13417
13418
13420 {
13421 super.OnPlacementStarted(player);
13422
13424 }
13425
13426 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13427 {
13429 {
13430 m_AdminLog.OnPlacementComplete(player,
this);
13431 }
13432
13433 super.OnPlacementComplete(player, position, orientation);
13434 }
13435
13436
13437
13438
13439
13441 {
13443 {
13444 return true;
13445 }
13446 else
13447 {
13448 return false;
13449 }
13450 }
13451
13452
13454 {
13456 {
13458 }
13459 }
13460
13461
13463 {
13465 }
13466
13468 {
13470 }
13471
13472 override void InsertAgent(
int agent,
float count = 1)
13473 {
13474 if (count < 1)
13475 return;
13476
13478 }
13479
13482 {
13484 }
13485
13486
13488 {
13490 }
13491
13492
13493
13494
13495
13496
13497
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
13534 {
13536 return false;
13537 return true;
13538 }
13539
13541 {
13542
13544 }
13545
13546
13549 {
13550 super.CheckForRoofLimited(timeTresholdMS);
13551
13553 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13554 {
13555 m_PreviousRoofTestTime = time;
13556 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13557 }
13558 }
13559
13560
13562 {
13564 {
13565 return 0;
13566 }
13567
13568 if (GetInventory().GetAttachmentSlotsCount() != 0)
13569 {
13570 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13571 if (filter)
13572 return filter.GetProtectionLevel(type, false, system);
13573 else
13574 return 0;
13575 }
13576
13577 string subclassPath, entryName;
13578
13579 switch (type)
13580 {
13582 entryName = "biological";
13583 break;
13585 entryName = "chemical";
13586 break;
13587 default:
13588 entryName = "biological";
13589 break;
13590 }
13591
13592 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13593
13595 }
13596
13597
13598
13601 {
13602 if (!IsMagazine())
13604
13606 }
13607
13608
13609
13610
13611
13616 {
13617 return true;
13618 }
13619
13621 {
13623 }
13624
13625
13626
13627
13628
13630 {
13631 if (parent)
13632 {
13633 if (parent.IsInherited(DayZInfected))
13634 return true;
13635
13636 if (!parent.IsRuined())
13637 return true;
13638 }
13639
13640 return true;
13641 }
13642
13644 {
13645 if (!super.CanPutAsAttachment(parent))
13646 {
13647 return false;
13648 }
13649
13650 if (!IsRuined() && !parent.IsRuined())
13651 {
13652 return true;
13653 }
13654
13655 return false;
13656 }
13657
13659 {
13660
13661
13662
13663
13664 return super.CanReceiveItemIntoCargo(item);
13665 }
13666
13668 {
13669
13670
13671
13672
13673 GameInventory attachmentInv = attachment.GetInventory();
13675 {
13676 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13677 return false;
13678 }
13679
13680 InventoryLocation loc = new InventoryLocation();
13681 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13682 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13683 return false;
13684
13685 return super.CanReceiveAttachment(attachment, slotId);
13686 }
13687
13689 {
13690 if (!super.CanReleaseAttachment(attachment))
13691 return false;
13692
13693 return GetInventory().AreChildrenAccessible();
13694 }
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13717 {
13718 int id = muzzle_owner.GetMuzzleID();
13719 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13720
13721 if (WPOF_array)
13722 {
13723 for (int i = 0; i < WPOF_array.Count(); i++)
13724 {
13725 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13726
13727 if (WPOF)
13728 {
13729 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13730 }
13731 }
13732 }
13733 }
13734
13735
13737 {
13738 int id = muzzle_owner.GetMuzzleID();
13740
13741 if (WPOBE_array)
13742 {
13743 for (int i = 0; i < WPOBE_array.Count(); i++)
13744 {
13745 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13746
13747 if (WPOBE)
13748 {
13749 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13750 }
13751 }
13752 }
13753 }
13754
13755
13757 {
13758 int id = muzzle_owner.GetMuzzleID();
13759 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13760
13761 if (WPOOH_array)
13762 {
13763 for (int i = 0; i < WPOOH_array.Count(); i++)
13764 {
13765 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13766
13767 if (WPOOH)
13768 {
13769 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13770 }
13771 }
13772 }
13773 }
13774
13775
13777 {
13778 int id = muzzle_owner.GetMuzzleID();
13779 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13780
13781 if (WPOOH_array)
13782 {
13783 for (int i = 0; i < WPOOH_array.Count(); i++)
13784 {
13785 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13786
13787 if (WPOOH)
13788 {
13789 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13790 }
13791 }
13792 }
13793 }
13794
13795
13797 {
13798 int id = muzzle_owner.GetMuzzleID();
13799 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13800
13801 if (WPOOH_array)
13802 {
13803 for (int i = 0; i < WPOOH_array.Count(); i++)
13804 {
13805 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13806
13807 if (WPOOH)
13808 {
13809 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13810 }
13811 }
13812 }
13813 }
13814
13815
13816
13818 {
13820 {
13821 return true;
13822 }
13823
13824 return false;
13825 }
13826
13828 {
13830 {
13831 return true;
13832 }
13833
13834 return false;
13835 }
13836
13838 {
13840 {
13841 return true;
13842 }
13843
13844 return false;
13845 }
13846
13848 {
13849 return false;
13850 }
13851
13854 {
13855 return UATimeSpent.DEFAULT_DEPLOY;
13856 }
13857
13858
13859
13860
13862 {
13864 SetSynchDirty();
13865 }
13866
13868 {
13870 }
13871
13872
13874 {
13875 return false;
13876 }
13877
13880 {
13881 string att_type = "None";
13882
13883 if (ConfigIsExisting("soundAttType"))
13884 {
13885 att_type = ConfigGetString("soundAttType");
13886 }
13887
13889 }
13890
13892 {
13894 }
13895
13896
13897
13898
13899
13905
13907 {
13910
13912 }
13913
13914
13916 {
13918 return;
13919
13921
13924
13927
13928 SoundParameters params = new SoundParameters();
13932 }
13933
13934
13936 {
13938 return;
13939
13941 SetSynchDirty();
13942
13945 }
13946
13947
13949 {
13951 return;
13952
13954 SetSynchDirty();
13955
13958 }
13959
13961 {
13963 }
13964
13966 {
13968 }
13969
13972 {
13973 if (!
GetGame().IsDedicatedServer())
13974 {
13975 if (ConfigIsExisting("attachSoundSet"))
13976 {
13977 string cfg_path = "";
13978 string soundset = "";
13979 string type_name =
GetType();
13980
13983 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13984 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13985
13986 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13987 {
13988 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13989 {
13990 if (cfg_slot_array[i] == slot_type)
13991 {
13992 soundset = cfg_soundset_array[i];
13993 break;
13994 }
13995 }
13996 }
13997
13998 if (soundset != "")
13999 {
14000 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
14002 }
14003 }
14004 }
14005 }
14006
14008 {
14009
14010 }
14011
14012 void OnApply(PlayerBase player);
14013
14015 {
14016 return 1.0;
14017 };
14018
14020 {
14022 }
14023
14025 {
14027 }
14028
14030
14032 {
14033 SetDynamicPhysicsLifeTime(0.01);
14035 }
14036
14038 {
14039 array<string> zone_names = new array<string>;
14040 GetDamageZones(zone_names);
14041 for (int i = 0; i < zone_names.Count(); i++)
14042 {
14043 SetHealthMax(zone_names.Get(i),"Health");
14044 }
14045 SetHealthMax("","Health");
14046 }
14047
14050 {
14051 float global_health = GetHealth01("","Health");
14052 array<string> zones = new array<string>;
14053 GetDamageZones(zones);
14054
14055 for (int i = 0; i < zones.Count(); i++)
14056 {
14057 SetHealth01(zones.Get(i),"Health",global_health);
14058 }
14059 }
14060
14063 {
14064 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14065 }
14066
14068 {
14069 if (!hasRootAsPlayer)
14070 {
14071 if (refParentIB)
14072 {
14073
14074 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14075 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14076
14077 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14078 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14079
14082 }
14083 else
14084 {
14085
14088 }
14089 }
14090 }
14091
14093 {
14095 {
14096 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14097 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14098 {
14099 float heatPermCoef = 1.0;
14101 while (ent)
14102 {
14103 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14104 ent = ent.GetHierarchyParent();
14105 }
14106
14107 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14108 }
14109 }
14110 }
14111
14113 {
14114
14115 EntityAI parent = GetHierarchyParent();
14116 if (!parent)
14117 {
14118 hasParent = false;
14119 hasRootAsPlayer = false;
14120 }
14121 else
14122 {
14123 hasParent = true;
14124 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14125 refParentIB =
ItemBase.Cast(parent);
14126 }
14127 }
14128
14129 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14130 {
14131
14132 }
14133
14135 {
14136
14137 return false;
14138 }
14139
14141 {
14142
14143
14144 return false;
14145 }
14146
14148 {
14149
14150 return false;
14151 }
14152
14155 {
14156 return !GetIsFrozen() &&
IsOpen();
14157 }
14158
14160 {
14161 bool hasParent = false, hasRootAsPlayer = false;
14163
14164 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14165 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14166
14167 if (wwtu || foodDecay)
14168 {
14172
14173 if (processWetness || processTemperature || processDecay)
14174 {
14176
14177 if (processWetness)
14178 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14179
14180 if (processTemperature)
14182
14183 if (processDecay)
14184 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14185 }
14186 }
14187 }
14188
14191 {
14193 }
14194
14196 {
14199
14200 return super.GetTemperatureFreezeThreshold();
14201 }
14202
14204 {
14207
14208 return super.GetTemperatureThawThreshold();
14209 }
14210
14212 {
14215
14216 return super.GetItemOverheatThreshold();
14217 }
14218
14220 {
14222 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14223
14224 return super.GetTemperatureFreezeTime();
14225 }
14226
14228 {
14230 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14231
14232 return super.GetTemperatureThawTime();
14233 }
14234
14239
14241 {
14242 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14243 }
14244
14246 {
14247 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14248 }
14249
14252 {
14254 }
14255
14257 {
14259 }
14260
14262 {
14264 }
14265
14268 {
14269 return null;
14270 }
14271
14274 {
14275 return false;
14276 }
14277
14279 {
14281 {
14284 if (!trg)
14285 {
14287 explosive = this;
14288 }
14289
14290 explosive.PairRemote(trg);
14292
14293 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14294 trg.SetPersistentPairID(persistentID);
14295 explosive.SetPersistentPairID(persistentID);
14296
14297 return true;
14298 }
14299 return false;
14300 }
14301
14304 {
14305 float ret = 1.0;
14308 ret *= GetHealth01();
14309
14310 return ret;
14311 }
14312
14313 #ifdef DEVELOPER
14314 override void SetDebugItem()
14315 {
14316 super.SetDebugItem();
14317 _itemBase = this;
14318 }
14319
14321 {
14322 string text = super.GetDebugText();
14323
14325 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14326
14327 return text;
14328 }
14329 #endif
14330
14332 {
14333 return true;
14334 }
14335
14337
14339
14341 {
14344 }
14345
14346
14354
14370}
14371
14373{
14375 if (entity)
14376 {
14377 bool is_item = entity.IsInherited(
ItemBase);
14378 if (is_item && full_quantity)
14379 {
14382 }
14383 }
14384 else
14385 {
14387 return NULL;
14388 }
14389 return entity;
14390}
14391
14393{
14394 if (item)
14395 {
14396 if (health > 0)
14397 item.SetHealth("", "", health);
14398
14399 if (item.CanHaveTemperature())
14400 {
14402 if (item.CanFreeze())
14403 item.SetFrozen(false);
14404 }
14405
14406 if (item.HasEnergyManager())
14407 {
14408 if (quantity >= 0)
14409 {
14410 item.GetCompEM().SetEnergy0To1(quantity);
14411 }
14412 else
14413 {
14415 }
14416 }
14417 else if (item.IsMagazine())
14418 {
14419 Magazine mag = Magazine.Cast(item);
14420 if (quantity >= 0)
14421 {
14422 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14423 }
14424 else
14425 {
14427 }
14428
14429 }
14430 else
14431 {
14432 if (quantity >= 0)
14433 {
14434 item.SetQuantityNormalized(quantity, false);
14435 }
14436 else
14437 {
14439 }
14440
14441 }
14442 }
14443}
14444
14445#ifdef DEVELOPER
14447#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.