9486{
9488 {
9489 return true;
9490 }
9491};
9492
9493
9494
9496{
9500
9502
9505
9506
9507
9508
9509
9518
9524
9529
9534
9555 protected bool m_IsResultOfSplit
9556
9558
9563
9564
9565
9567
9571
9572
9573
9575
9578
9579
9580
9586
9587
9595
9598
9599
9601
9602
9604
9605
9610
9611
9616
9617
9619
9620
9622 {
9627
9628 if (!
GetGame().IsDedicatedServer())
9629 {
9631 {
9633
9635 {
9637 }
9638 }
9639
9642 }
9643
9644 m_OldLocation = null;
9645
9647 {
9649 }
9650
9651 if (ConfigIsExisting("headSelectionsToHide"))
9652 {
9655 }
9656
9658 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9659 {
9661 }
9662
9664
9665 m_IsResultOfSplit = false;
9666
9668 }
9669
9671 {
9672 super.InitItemVariables();
9673
9679 m_Count = ConfigGetInt(
"count");
9680
9683
9688
9691
9696
9708
9712
9713
9716 if (ConfigIsExisting("canBeSplit"))
9717 {
9720 }
9721
9723 if (ConfigIsExisting("itemBehaviour"))
9725
9726
9729 RegisterNetSyncVariableInt("m_VarLiquidType");
9730 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9731
9732 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9733 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9734 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9735
9736 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9737 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9738 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9739 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9740
9741 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9742 RegisterNetSyncVariableBool("m_IsTakeable");
9743 RegisterNetSyncVariableBool("m_IsHologram");
9744
9747 {
9750 }
9751
9753
9755 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9757
9758 }
9759
9761 {
9763 }
9764
9766 {
9769 {
9774 }
9775 }
9776
9777 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9778 {
9780 {
9783 }
9784
9786 }
9787
9789 {
9795 }
9796
9798
9800 {
9802
9803 if (!action)
9804 {
9805 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9806 return;
9807 }
9808
9810 if (!ai)
9811 {
9813 return;
9814 }
9815
9817 if (!action_array)
9818 {
9819 action_array = new array<ActionBase_Basic>;
9821 }
9822 if (LogManager.IsActionLogEnable())
9823 {
9824 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9825 }
9826
9827 if (action_array.Find(action) != -1)
9828 {
9829 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9830 }
9831 else
9832 {
9833 action_array.Insert(action);
9834 }
9835 }
9836
9838 {
9840 ActionBase action = player.GetActionManager().GetAction(actionName);
9843
9844 if (action_array)
9845 {
9846 action_array.RemoveItem(action);
9847 }
9848 }
9849
9850
9851
9853 {
9854 ActionOverrideData overrideData = new ActionOverrideData();
9858
9860 if (!actionMap)
9861 {
9864 }
9865
9866 actionMap.Insert(this.
Type(), overrideData);
9867
9868 }
9869
9871
9873
9874
9876 {
9879
9882
9883 string config_to_search = "CfgVehicles";
9884 string muzzle_owner_config;
9885
9887 {
9888 if (IsInherited(Weapon))
9889 config_to_search = "CfgWeapons";
9890
9891 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9892
9893 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9894
9896
9897 if (config_OnFire_subclass_count > 0)
9898 {
9899 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9900
9901 for (int i = 0; i < config_OnFire_subclass_count; i++)
9902 {
9903 string particle_class = "";
9905 string config_OnFire_entry = config_OnFire_class + particle_class;
9906 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9907 WPOF_array.Insert(WPOF);
9908 }
9909
9910
9912 }
9913 }
9914
9916 {
9917 config_to_search = "CfgWeapons";
9918 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9919
9920 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9921
9923
9924 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9925 {
9926 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9927
9928 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9929 {
9930 string particle_class2 = "";
9932 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9933 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9934 WPOBE_array.Insert(WPOBE);
9935 }
9936
9937
9939 }
9940 }
9941 }
9942
9943
9945 {
9948
9950 {
9951 string config_to_search = "CfgVehicles";
9952
9953 if (IsInherited(Weapon))
9954 config_to_search = "CfgWeapons";
9955
9956 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9957 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9958
9959 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9960 {
9961
9963
9965 {
9967 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9969 return;
9970 }
9971
9974
9975
9976
9978 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9979
9980 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9981 {
9982 string particle_class = "";
9984 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9986
9987 if (entry_type == CT_CLASS)
9988 {
9989 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9990 WPOOH_array.Insert(WPOF);
9991 }
9992 }
9993
9994
9996 }
9997 }
9998 }
9999
10001 {
10003 }
10004
10006 {
10008 {
10010
10013
10016
10017 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10018 }
10019 }
10020
10022 {
10024 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10025
10027 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10028
10030 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10031
10033 {
10035 }
10036 }
10037
10039 {
10041 }
10042
10044 {
10047 else
10049
10051 {
10054 }
10055 else
10056 {
10059
10062 }
10063
10065 }
10066
10068 {
10070 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10071 }
10072
10074 {
10076 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10078 }
10079
10081 {
10083 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10084 }
10085
10087 {
10090
10091 OverheatingParticle OP = new OverheatingParticle();
10096
10098 }
10099
10101 {
10104
10105 return -1;
10106 }
10107
10109 {
10111 {
10114
10115 for (int i = count; i > 0; --i)
10116 {
10117 int id = i - 1;
10120
10123
10124 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10125 {
10126 if (p)
10127 {
10130 }
10131 }
10132 }
10133 }
10134 }
10135
10137 {
10139 {
10141 {
10142 int id = i - 1;
10144
10145 if (OP)
10146 {
10148
10149 if (p)
10150 {
10152 }
10153
10154 delete OP;
10155 }
10156 }
10157
10160 }
10161 }
10162
10165 {
10166 return 0.0;
10167 }
10168
10169
10171 {
10172 return 250;
10173 }
10174
10176 {
10177 return 0;
10178 }
10179
10182 {
10184 return true;
10185
10186 return false;
10187 }
10188
10191 {
10194
10196 {
10198 }
10199 else
10200 {
10201
10203 }
10204
10206 }
10207
10214 {
10215 return -1;
10216 }
10217
10218
10219
10220
10222 {
10224 {
10226 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10227
10228 if (r_index >= 0)
10229 {
10230 InventoryLocation r_il = new InventoryLocation;
10231 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10232
10233 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10236 {
10237 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10238 }
10240 {
10241 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10242 }
10243
10244 }
10245
10246 player.GetHumanInventory().ClearUserReservedLocation(this);
10247 }
10248
10251 }
10252
10253
10254
10255
10257 {
10258 return ItemBase.m_DebugActionsMask;
10259 }
10260
10262 {
10263 return ItemBase.m_DebugActionsMask & mask;
10264 }
10265
10267 {
10268 ItemBase.m_DebugActionsMask = mask;
10269 }
10270
10272 {
10273 ItemBase.m_DebugActionsMask |= mask;
10274 }
10275
10277 {
10278 ItemBase.m_DebugActionsMask &= ~mask;
10279 }
10280
10282 {
10284 {
10286 }
10287 else
10288 {
10290 }
10291 }
10292
10293
10295 {
10296 if (GetEconomyProfile())
10297 {
10298 float q_max = GetEconomyProfile().GetQuantityMax();
10299 if (q_max > 0)
10300 {
10301 float q_min = GetEconomyProfile().GetQuantityMin();
10302 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10303
10305 {
10306 ComponentEnergyManager comp = GetCompEM();
10308 {
10310 }
10311 }
10313 {
10315
10316 }
10317
10318 }
10319 }
10320 }
10321
10324 {
10325 EntityAI parent = GetHierarchyParent();
10326
10327 if (parent)
10328 {
10329 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10330 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10331 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10332 }
10333 }
10334
10337 {
10338 EntityAI parent = GetHierarchyParent();
10339
10340 if (parent)
10341 {
10342 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10343 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10344 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10345 }
10346 }
10347
10349 {
10350
10351
10352
10353
10355
10357 {
10358 if (ScriptInputUserData.CanStoreInputUserData())
10359 {
10360 ScriptInputUserData ctx = new ScriptInputUserData;
10366 ctx.
Write(use_stack_max);
10369
10371 {
10372 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10373 }
10374 }
10375 }
10376 else if (!
GetGame().IsMultiplayer())
10377 {
10379 }
10380 }
10381
10383 {
10385 }
10386
10388 {
10390 }
10391
10393 {
10395 }
10396
10398 {
10399
10400 return false;
10401 }
10402
10404 {
10405 return false;
10406 }
10407
10411 {
10412 return false;
10413 }
10414
10416 {
10417 return "";
10418 }
10419
10421
10423 {
10424 return false;
10425 }
10426
10428 {
10429 return true;
10430 }
10431
10432
10433
10435 {
10436 return true;
10437 }
10438
10440 {
10441 return true;
10442 }
10443
10445 {
10446 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10448 }
10449
10451 {
10453 }
10454
10456 {
10458 if (!is_being_placed)
10460 SetSynchDirty();
10461 }
10462
10463
10465
10467 {
10469 }
10470
10472 {
10474 }
10475
10477 {
10478 return 1;
10479 }
10480
10482 {
10483 return false;
10484 }
10485
10487 {
10489 SetSynchDirty();
10490 }
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10527 {
10528 super.OnMovedInsideCargo(container);
10529
10530 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10531 }
10532
10533 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10534 {
10535 super.EEItemLocationChanged(oldLoc,newLoc);
10536
10537 PlayerBase new_player = null;
10538 PlayerBase old_player = null;
10539
10540 if (newLoc.GetParent())
10541 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10542
10543 if (oldLoc.GetParent())
10544 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10545
10547 {
10548 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10549
10550 if (r_index >= 0)
10551 {
10552 InventoryLocation r_il = new InventoryLocation;
10553 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10554
10555 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10558 {
10559 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10560 }
10562 {
10563 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10564 }
10565
10566 }
10567 }
10568
10570 {
10571 if (new_player)
10572 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10573
10574 if (new_player == old_player)
10575 {
10576
10577 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10578 {
10580 {
10581 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10582 {
10583 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10584 }
10585 }
10586 else
10587 {
10588 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10589 }
10590 }
10591
10592 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10593 {
10594 int type = oldLoc.GetType();
10596 {
10597 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10598 }
10600 {
10601 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10602 }
10603 }
10604 if (!m_OldLocation)
10605 {
10606 m_OldLocation = new InventoryLocation;
10607 }
10608 m_OldLocation.Copy(oldLoc);
10609 }
10610 else
10611 {
10612 if (m_OldLocation)
10613 {
10614 m_OldLocation.Reset();
10615 }
10616 }
10617
10619 }
10620 else
10621 {
10622 if (new_player)
10623 {
10624 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10625 if (res_index >= 0)
10626 {
10627 InventoryLocation il = new InventoryLocation;
10628 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10630 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10633 {
10634 il.
GetParent().GetOnReleaseLock().Invoke(it);
10635 }
10637 {
10639 }
10640
10641 }
10642 }
10644 {
10645
10647 }
10648
10649 if (m_OldLocation)
10650 {
10651 m_OldLocation.Reset();
10652 }
10653 }
10654 }
10655
10656 override void EOnContact(IEntity other, Contact extra)
10657 {
10659 {
10660 int liquidType = -1;
10662 if (impactSpeed > 0.0)
10663 {
10665 #ifndef SERVER
10667 #else
10669 SetSynchDirty();
10670 #endif
10672 }
10673 }
10674
10675 #ifdef SERVER
10676 if (GetCompEM() && GetCompEM().IsPlugged())
10677 {
10678 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10679 GetCompEM().UnplugThis();
10680 }
10681 #endif
10682 }
10683
10685
10687 {
10689 }
10690
10692 {
10693
10694 }
10695
10697 {
10698 super.OnItemLocationChanged(old_owner, new_owner);
10699
10700 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10701 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10702
10703 if (!relatedPlayer && playerNew)
10704 relatedPlayer = playerNew;
10705
10706 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10707 {
10709 if (actionMgr)
10710 {
10711 ActionBase currentAction = actionMgr.GetRunningAction();
10712 if (currentAction)
10714 }
10715 }
10716
10717 Man ownerPlayerOld = null;
10718 Man ownerPlayerNew = null;
10719
10720 if (old_owner)
10721 {
10722 if (old_owner.
IsMan())
10723 {
10724 ownerPlayerOld = Man.Cast(old_owner);
10725 }
10726 else
10727 {
10728 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10729 }
10730 }
10731 else
10732 {
10734 {
10736
10737 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10738 {
10739 GetCompEM().UnplugThis();
10740 }
10741 }
10742 }
10743
10744 if (new_owner)
10745 {
10746 if (new_owner.
IsMan())
10747 {
10748 ownerPlayerNew = Man.Cast(new_owner);
10749 }
10750 else
10751 {
10752 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10753 }
10754 }
10755
10756 if (ownerPlayerOld != ownerPlayerNew)
10757 {
10758 if (ownerPlayerOld)
10759 {
10760 array<EntityAI> subItemsExit = new array<EntityAI>;
10762 for (int i = 0; i < subItemsExit.Count(); i++)
10763 {
10766 }
10767 }
10768
10769 if (ownerPlayerNew)
10770 {
10771 array<EntityAI> subItemsEnter = new array<EntityAI>;
10773 for (int j = 0; j < subItemsEnter.Count(); j++)
10774 {
10777 }
10778 }
10779 }
10780 else if (ownerPlayerNew != null)
10781 {
10782 PlayerBase nplayer;
10783 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10784 {
10785 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10787 for (int k = 0; k < subItemsUpdate.Count(); k++)
10788 {
10790 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10791 }
10792 }
10793 }
10794
10795 if (old_owner)
10796 old_owner.OnChildItemRemoved(this);
10797 if (new_owner)
10798 new_owner.OnChildItemReceived(this);
10799 }
10800
10801
10803 {
10804 super.EEDelete(parent);
10805 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10806 if (player)
10807 {
10809
10810 if (player.IsAlive())
10811 {
10812 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10813 if (r_index >= 0)
10814 {
10815 InventoryLocation r_il = new InventoryLocation;
10816 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10817
10818 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10821 {
10822 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10823 }
10825 {
10826 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10827 }
10828
10829 }
10830
10831 player.RemoveQuickBarEntityShortcut(this);
10832 }
10833 }
10834 }
10835
10837 {
10838 super.EEKilled(killer);
10839
10842 {
10843 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10844 {
10845 if (IsMagazine())
10846 {
10847 if (Magazine.Cast(this).GetAmmoCount() > 0)
10848 {
10850 }
10851 }
10852 else
10853 {
10855 }
10856 }
10857 }
10858 }
10859
10861 {
10862 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10863
10864 super.OnWasAttached(parent, slot_id);
10865
10868
10870 }
10871
10873 {
10874 super.OnWasDetached(parent, slot_id);
10875
10878 }
10879
10881 {
10882 int idx;
10885
10886 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10887 if (inventory_slots.Count() < 1)
10888 {
10889 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10890 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10891 }
10892 else
10893 {
10894 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10895 }
10896
10897 idx = inventory_slots.Find(slot);
10898 if (idx < 0)
10899 return "";
10900
10901 return attach_types.Get(idx);
10902 }
10903
10905 {
10906 int idx = -1;
10907 string slot;
10908
10911
10912 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10913 if (inventory_slots.Count() < 1)
10914 {
10915 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10916 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10917 }
10918 else
10919 {
10920 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10921 if (detach_types.Count() < 1)
10922 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10923 }
10924
10925 for (int i = 0; i < inventory_slots.Count(); i++)
10926 {
10927 slot = inventory_slots.Get(i);
10928 }
10929
10930 if (slot != "")
10931 {
10932 if (detach_types.Count() == 1)
10933 idx = 0;
10934 else
10935 idx = inventory_slots.Find(slot);
10936 }
10937 if (idx < 0)
10938 return "";
10939
10940 return detach_types.Get(idx);
10941 }
10942
10944 {
10945
10947
10948
10949 float min_time = 1;
10950 float max_time = 3;
10951 float delay = Math.RandomFloat(min_time, max_time);
10952
10953 explode_timer.Run(delay, this, "DoAmmoExplosion");
10954 }
10955
10957 {
10958 Magazine magazine = Magazine.Cast(this);
10959 int pop_sounds_count = 6;
10960 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10961
10962
10963 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10964 string sound_name = pop_sounds[ sound_idx ];
10966
10967
10968 magazine.ServerAddAmmoCount(-1);
10969
10970
10971 float min_temp_to_explode = 100;
10972
10973 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10974 {
10976 }
10977 }
10978
10979
10980 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10981 {
10982 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10983
10984 const int CHANCE_DAMAGE_CARGO = 4;
10985 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10986 const int CHANCE_DAMAGE_NOTHING = 2;
10987
10989 {
10990 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10991 int chances;
10992 int rnd;
10993
10994 if (GetInventory().GetCargo())
10995 {
10996 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10997 rnd = Math.RandomInt(0,chances);
10998
10999 if (rnd < CHANCE_DAMAGE_CARGO)
11000 {
11002 }
11003 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
11004 {
11006 }
11007 }
11008 else
11009 {
11010 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
11011 rnd = Math.RandomInt(0,chances);
11012
11013 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
11014 {
11016 }
11017 }
11018 }
11019 }
11020
11022 {
11023 if (GetInventory().GetCargo())
11024 {
11025 int item_count = GetInventory().GetCargo().GetItemCount();
11026 if (item_count > 0)
11027 {
11028 int random_pick = Math.RandomInt(0, item_count);
11030 if (!item.IsExplosive())
11031 {
11032 item.AddHealth("","",damage);
11033 return true;
11034 }
11035 }
11036 }
11037 return false;
11038 }
11039
11041 {
11042 int attachment_count = GetInventory().AttachmentCount();
11043 if (attachment_count > 0)
11044 {
11045 int random_pick = Math.RandomInt(0, attachment_count);
11046 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11047 if (!attachment.IsExplosive())
11048 {
11049 attachment.AddHealth("","",damage);
11050 return true;
11051 }
11052 }
11053 return false;
11054 }
11055
11057 {
11059 }
11060
11062 {
11064 return GetInventory().CanRemoveEntity();
11065
11066 return false;
11067 }
11068
11070 {
11071
11073 return false;
11074
11075
11077 return false;
11078
11079
11080
11082 if (delta == 0)
11083 return false;
11084
11085
11086 return true;
11087 }
11088
11090 {
11092 {
11093 if (ScriptInputUserData.CanStoreInputUserData())
11094 {
11095 ScriptInputUserData ctx = new ScriptInputUserData;
11100 ctx.
Write(destination_entity);
11102 ctx.
Write(slot_id);
11104 }
11105 }
11106 else if (!
GetGame().IsMultiplayer())
11107 {
11109 }
11110 }
11111
11113 {
11114 float split_quantity_new;
11118 InventoryLocation loc = new InventoryLocation;
11119
11120 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11121 {
11123 split_quantity_new = stack_max;
11124 else
11126
11128 {
11129 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11130 if (new_item)
11131 {
11132 new_item.SetResultOfSplit(true);
11133 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11135 new_item.
SetQuantity(split_quantity_new,
false,
true);
11136 }
11137 }
11138 }
11139 else if (destination_entity && slot_id == -1)
11140 {
11141 if (quantity > stack_max)
11142 split_quantity_new = stack_max;
11143 else
11144 split_quantity_new = quantity;
11145
11147 {
11149 {
11152 }
11153
11154 if (new_item)
11155 {
11156 new_item.SetResultOfSplit(true);
11157 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11159 new_item.
SetQuantity(split_quantity_new,
false,
true);
11160 }
11161 }
11162 }
11163 else
11164 {
11165 if (stack_max != 0)
11166 {
11168 {
11170 }
11171
11172 if (split_quantity_new == 0)
11173 {
11174 if (!
GetGame().IsMultiplayer())
11175 player.PhysicalPredictiveDropItem(this);
11176 else
11177 player.ServerDropEntity(this);
11178 return;
11179 }
11180
11182 {
11184
11185 if (new_item)
11186 {
11187 new_item.SetResultOfSplit(true);
11188 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11191 new_item.PlaceOnSurface();
11192 }
11193 }
11194 }
11195 }
11196 }
11197
11199 {
11200 float split_quantity_new;
11204 InventoryLocation loc = new InventoryLocation;
11205
11206 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11207 {
11209 split_quantity_new = stack_max;
11210 else
11212
11214 {
11215 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11216 if (new_item)
11217 {
11218 new_item.SetResultOfSplit(true);
11219 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11221 new_item.
SetQuantity(split_quantity_new,
false,
true);
11222 }
11223 }
11224 }
11225 else if (destination_entity && slot_id == -1)
11226 {
11227 if (quantity > stack_max)
11228 split_quantity_new = stack_max;
11229 else
11230 split_quantity_new = quantity;
11231
11233 {
11235 {
11238 }
11239
11240 if (new_item)
11241 {
11242 new_item.SetResultOfSplit(true);
11243 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11245 new_item.
SetQuantity(split_quantity_new,
false,
true);
11246 }
11247 }
11248 }
11249 else
11250 {
11251 if (stack_max != 0)
11252 {
11254 {
11256 }
11257
11259 {
11261
11262 if (new_item)
11263 {
11264 new_item.SetResultOfSplit(true);
11265 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11268 new_item.PlaceOnSurface();
11269 }
11270 }
11271 }
11272 }
11273 }
11274
11276 {
11278 {
11279 if (ScriptInputUserData.CanStoreInputUserData())
11280 {
11281 ScriptInputUserData ctx = new ScriptInputUserData;
11286 dst.WriteToContext(ctx);
11288 }
11289 }
11290 else if (!
GetGame().IsMultiplayer())
11291 {
11293 }
11294 }
11295
11297 {
11299 {
11300 if (ScriptInputUserData.CanStoreInputUserData())
11301 {
11302 ScriptInputUserData ctx = new ScriptInputUserData;
11307 ctx.
Write(destination_entity);
11313 }
11314 }
11315 else if (!
GetGame().IsMultiplayer())
11316 {
11318 }
11319 }
11320
11322 {
11324 }
11325
11327 {
11329 float split_quantity_new;
11331 if (dst.IsValid())
11332 {
11333 int slot_id = dst.GetSlot();
11335
11336 if (quantity > stack_max)
11337 split_quantity_new = stack_max;
11338 else
11339 split_quantity_new = quantity;
11340
11342 {
11344
11345 if (new_item)
11346 {
11347 new_item.SetResultOfSplit(true);
11348 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11350 new_item.
SetQuantity(split_quantity_new,
false,
true);
11351 }
11352
11353 return new_item;
11354 }
11355 }
11356
11357 return null;
11358 }
11359
11361 {
11363 float split_quantity_new;
11365 if (destination_entity)
11366 {
11368 if (quantity > stackable)
11369 split_quantity_new = stackable;
11370 else
11371 split_quantity_new = quantity;
11372
11374 {
11375 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11376 if (new_item)
11377 {
11378 new_item.SetResultOfSplit(true);
11379 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11381 new_item.
SetQuantity(split_quantity_new,
false,
true);
11382 }
11383 }
11384 }
11385 }
11386
11388 {
11390 {
11391 if (ScriptInputUserData.CanStoreInputUserData())
11392 {
11393 ScriptInputUserData ctx = new ScriptInputUserData;
11398 ItemBase destination_entity =
this;
11399 ctx.
Write(destination_entity);
11403 }
11404 }
11405 else if (!
GetGame().IsMultiplayer())
11406 {
11408 }
11409 }
11410
11412 {
11414 float split_quantity_new;
11416 if (player)
11417 {
11419 if (quantity > stackable)
11420 split_quantity_new = stackable;
11421 else
11422 split_quantity_new = quantity;
11423
11425 {
11426 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11427 new_item =
ItemBase.Cast(in_hands);
11428 if (new_item)
11429 {
11430 new_item.SetResultOfSplit(true);
11431 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11433 new_item.SetQuantity(split_quantity_new, false, true);
11434 }
11435 }
11436 }
11437 }
11438
11440 {
11442 float split_quantity_new = Math.Floor(quantity * 0.5);
11443
11445 return;
11446
11448
11449 if (new_item)
11450 {
11451 if (new_item.GetQuantityMax() < split_quantity_new)
11452 {
11453 split_quantity_new = new_item.GetQuantityMax();
11454 }
11455
11456 new_item.SetResultOfSplit(true);
11457 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11458
11460 {
11463 }
11464 else
11465 {
11467 new_item.
SetQuantity(split_quantity_new,
false,
true);
11468 }
11469 }
11470 }
11471
11473 {
11475 float split_quantity_new = Math.Floor(quantity / 2);
11476
11478 return;
11479
11480 InventoryLocation invloc = new InventoryLocation;
11482
11484 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11485
11486 if (new_item)
11487 {
11488 if (new_item.GetQuantityMax() < split_quantity_new)
11489 {
11490 split_quantity_new = new_item.GetQuantityMax();
11491 }
11493 {
11496 }
11497 else if (split_quantity_new > 1)
11498 {
11500 new_item.
SetQuantity(split_quantity_new,
false,
true);
11501 }
11502 }
11503 }
11504
11507 {
11508 SetWeightDirty();
11510
11511 if (parent)
11512 parent.OnAttachmentQuantityChangedEx(this, delta);
11513
11515 {
11517 {
11519 }
11521 {
11522 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11524 }
11525 }
11526
11527 }
11528
11531 {
11532
11533 }
11534
11537 {
11539 }
11540
11542 {
11543 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11544
11546 {
11547 if (newLevel == GameConstants.STATE_RUINED)
11548 {
11550 EntityAI parent = GetHierarchyParent();
11551 if (parent && parent.IsFireplace())
11552 {
11553 CargoBase cargo = GetInventory().GetCargo();
11554 if (cargo)
11555 {
11557 {
11559 }
11560 }
11561 }
11562 }
11563
11565 {
11566
11568 return;
11569 }
11570
11571 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11572 {
11574 }
11575 }
11576 }
11577
11578
11580 {
11581 super.OnRightClick();
11582
11584 {
11586 {
11587 if (ScriptInputUserData.CanStoreInputUserData())
11588 {
11589 EntityAI root = GetHierarchyRoot();
11590 Man playerOwner = GetHierarchyRootPlayer();
11591 InventoryLocation dst = new InventoryLocation;
11592
11593
11594 if (!playerOwner && root && root == this)
11595 {
11597 }
11598 else
11599 {
11600
11601 GetInventory().GetCurrentInventoryLocation(dst);
11603 {
11606 {
11608 }
11609 else
11610 {
11612
11613
11614 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11615 {
11617 }
11618 else
11619 {
11620 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11621 }
11622 }
11623 }
11624 }
11625
11626 ScriptInputUserData ctx = new ScriptInputUserData;
11634 }
11635 }
11636 else if (!
GetGame().IsMultiplayer())
11637 {
11639 }
11640 }
11641 }
11642
11644 {
11645 if (root)
11646 {
11647 vector m4[4];
11648 root.GetTransform(m4);
11649 dst.SetGround(this, m4);
11650 }
11651 else
11652 {
11653 GetInventory().GetCurrentInventoryLocation(dst);
11654 }
11655 }
11656
11657 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11658 {
11659
11660 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11661 return false;
11662
11663 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11664 return false;
11665
11666
11668 return false;
11669
11670
11671 Magazine mag = Magazine.Cast(this);
11672 if (mag)
11673 {
11674 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11675 return false;
11676
11677 if (stack_max_limit)
11678 {
11679 Magazine other_mag = Magazine.Cast(other_item);
11680 if (other_item)
11681 {
11682 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11683 return false;
11684 }
11685
11686 }
11687 }
11688 else
11689 {
11690
11692 return false;
11693
11695 return false;
11696 }
11697
11698 PlayerBase player = null;
11699 if (CastTo(player, GetHierarchyRootPlayer()))
11700 {
11701 if (player.GetInventory().HasAttachment(this))
11702 return false;
11703
11704 if (player.IsItemsToDelete())
11705 return false;
11706 }
11707
11708 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11709 return false;
11710
11711 int slotID;
11713 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11714 return false;
11715
11716 return true;
11717 }
11718
11720 {
11722 }
11723
11725 {
11726 return m_IsResultOfSplit;
11727 }
11728
11730 {
11731 m_IsResultOfSplit = value;
11732 }
11733
11735 {
11737 }
11738
11740 {
11741 float other_item_quantity = other_item.GetQuantity();
11742 float this_free_space;
11743
11745
11747
11748 if (other_item_quantity > this_free_space)
11749 {
11750 return this_free_space;
11751 }
11752 else
11753 {
11754 return other_item_quantity;
11755 }
11756 }
11757
11759 {
11761 }
11762
11764 {
11766 return;
11767
11768 if (!IsMagazine() && other_item)
11769 {
11771 if (quantity_used != 0)
11772 {
11773 float hp1 = GetHealth01("","");
11774 float hp2 = other_item.GetHealth01("","");
11775 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11776 hpResult = hpResult / (
GetQuantity() + quantity_used);
11777
11778 hpResult *= GetMaxHealth();
11779 Math.Round(hpResult);
11780 SetHealth("", "Health", hpResult);
11781
11783 other_item.AddQuantity(-quantity_used);
11784 }
11785 }
11787 }
11788
11790 {
11791 #ifdef SERVER
11792 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11793 GetHierarchyParent().IncreaseLifetimeUp();
11794 #endif
11795 };
11796
11798 {
11799 PlayerBase p = PlayerBase.Cast(player);
11800
11801 array<int> recipesIds = p.m_Recipes;
11802 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11803 if (moduleRecipesManager)
11804 {
11805 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11806 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11807 }
11808
11809 for (int i = 0;i < recipesIds.Count(); i++)
11810 {
11811 int key = recipesIds.Get(i);
11812 string recipeName = moduleRecipesManager.GetRecipeName(key);
11814 }
11815 }
11816
11817
11818 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11819 {
11820 super.GetDebugActions(outputList);
11821
11822
11828
11829
11834
11839
11840
11844
11845
11847 {
11851 }
11852
11855
11856
11860
11862
11863 InventoryLocation loc = new InventoryLocation();
11864 GetInventory().GetCurrentInventoryLocation(loc);
11866 {
11867 if (Gizmo_IsSupported())
11870 }
11871
11873 }
11874
11875
11876
11877
11879 {
11880 super.OnAction(action_id, player, ctx);
11881
11883 {
11884 switch (action_id)
11885 {
11888 return true;
11891 return true;
11892 }
11893 }
11894
11896 {
11897 switch (action_id)
11898 {
11900 Delete();
11901 return true;
11902 }
11903 }
11904
11905 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11906 {
11907 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11908 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11909 PlayerBase p = PlayerBase.Cast(player);
11910 if (
EActions.RECIPES_RANGE_START < 1000)
11911 {
11912 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11913 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11914 }
11915 }
11916 #ifndef SERVER
11917 else if (action_id ==
EActions.WATCH_PLAYER)
11918 {
11919 PluginDeveloper.SetDeveloperItemClientEx(player);
11920 }
11921 #endif
11923 {
11924 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11925 {
11926 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11927 OnDebugButtonPressServer(id + 1);
11928 }
11929
11930 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11931 {
11932 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11934 }
11935
11936 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11937 {
11938 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11940 }
11941
11942 else if (action_id ==
EActions.ADD_QUANTITY)
11943 {
11944 if (IsMagazine())
11945 {
11946 Magazine mag = Magazine.Cast(this);
11947 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11948 }
11949 else
11950 {
11952 }
11953
11954 if (m_EM)
11955 {
11956 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11957 }
11958
11959 }
11960
11961 else if (action_id ==
EActions.REMOVE_QUANTITY)
11962 {
11963 if (IsMagazine())
11964 {
11965 Magazine mag2 = Magazine.Cast(this);
11966 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11967 }
11968 else
11969 {
11971 }
11972 if (m_EM)
11973 {
11974 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11975 }
11976
11977 }
11978
11979 else if (action_id ==
EActions.SET_QUANTITY_0)
11980 {
11982
11983 if (m_EM)
11984 {
11985 m_EM.SetEnergy(0);
11986 }
11987 }
11988
11989 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11990 {
11992
11993 if (m_EM)
11994 {
11995 m_EM.SetEnergy(m_EM.GetEnergyMax());
11996 }
11997 }
11998
11999 else if (action_id ==
EActions.ADD_HEALTH)
12000 {
12001 AddHealth("","",GetMaxHealth("","Health")/5);
12002 }
12003 else if (action_id ==
EActions.REMOVE_HEALTH)
12004 {
12005 AddHealth("","",-GetMaxHealth("","Health")/5);
12006 }
12007 else if (action_id ==
EActions.DESTROY_HEALTH)
12008 {
12009 SetHealth01("","",0);
12010 }
12011 else if (action_id ==
EActions.WATCH_ITEM)
12012 {
12014 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
12015 #ifdef DEVELOPER
12016 SetDebugDeveloper_item(this);
12017 #endif
12018 }
12019
12020 else if (action_id ==
EActions.ADD_TEMPERATURE)
12021 {
12022 AddTemperature(20);
12023
12024 }
12025
12026 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
12027 {
12028 AddTemperature(-20);
12029
12030 }
12031
12032 else if (action_id ==
EActions.FLIP_FROZEN)
12033 {
12034 SetFrozen(!GetIsFrozen());
12035
12036 }
12037
12038 else if (action_id ==
EActions.ADD_WETNESS)
12039 {
12041
12042 }
12043
12044 else if (action_id ==
EActions.REMOVE_WETNESS)
12045 {
12047
12048 }
12049
12050 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12051 {
12054
12055
12056 }
12057
12058 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12059 {
12062 }
12063
12064 else if (action_id ==
EActions.MAKE_SPECIAL)
12065 {
12066 auto debugParams = DebugSpawnParams.WithPlayer(player);
12067 OnDebugSpawnEx(debugParams);
12068 }
12069
12070 }
12071
12072
12073 return false;
12074 }
12075
12076
12077
12078
12082
12085
12086
12087
12089 {
12090 return false;
12091 }
12092
12093
12095 {
12096 return true;
12097 }
12098
12099
12101 {
12102 return true;
12103 }
12104
12105
12106
12108 {
12109 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12111 }
12112
12115 {
12116 return null;
12117 }
12118
12120 {
12121 return false;
12122 }
12123
12125 {
12126 return false;
12127 }
12128
12132
12133
12135 {
12136 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12137 return module_repairing.CanRepair(this, item_repair_kit);
12138 }
12139
12140
12141 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12142 {
12143 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12144 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12145 }
12146
12147
12149 {
12150
12151
12152
12153
12154
12155
12156
12157
12158 return 1;
12159 }
12160
12161
12162
12164 {
12166 }
12167
12168
12169
12171 {
12173 }
12174
12175
12184 {
12185 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12186
12187 if (player)
12188 {
12189 player.MessageStatus(text);
12190 }
12191 }
12192
12193
12202 {
12203 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12204
12205 if (player)
12206 {
12207 player.MessageAction(text);
12208 }
12209 }
12210
12211
12220 {
12221 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12222
12223 if (player)
12224 {
12225 player.MessageFriendly(text);
12226 }
12227 }
12228
12229
12238 {
12239 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12240
12241 if (player)
12242 {
12243 player.MessageImportant(text);
12244 }
12245 }
12246
12248 {
12249 return true;
12250 }
12251
12252
12253 override bool KindOf(
string tag)
12254 {
12255 bool found = false;
12256 string item_name = this.
GetType();
12259
12260 int array_size = item_tag_array.Count();
12261 for (int i = 0; i < array_size; i++)
12262 {
12263 if (item_tag_array.Get(i) == tag)
12264 {
12265 found = true;
12266 break;
12267 }
12268 }
12269 return found;
12270 }
12271
12272
12274 {
12275
12276 super.OnRPC(sender, rpc_type,ctx);
12277
12278
12279 switch (rpc_type)
12280 {
12281 #ifndef SERVER
12282 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12283 Param2<bool, string> p = new Param2<bool, string>(false, "");
12284
12286 return;
12287
12288 bool play = p.param1;
12289 string soundSet = p.param2;
12290
12291 if (play)
12292 {
12294 {
12296 {
12298 }
12299 }
12300 else
12301 {
12303 }
12304 }
12305 else
12306 {
12308 }
12309
12310 break;
12311 #endif
12312
12313 }
12314
12316 {
12318 }
12319 }
12320
12321
12322
12323
12325 {
12326 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12327 return plugin.GetID(
name);
12328 }
12329
12331 {
12332 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12333 return plugin.GetName(id);
12334 }
12335
12338 {
12339
12340
12341 int varFlags;
12342 if (!ctx.
Read(varFlags))
12343 return;
12344
12345 if (varFlags & ItemVariableFlags.FLOAT)
12346 {
12348 }
12349 }
12350
12352 {
12353
12354 super.SerializeNumericalVars(floats_out);
12355
12356
12357
12359 {
12361 }
12362
12364 {
12366 }
12367
12369 {
12371 }
12372
12374 {
12379 }
12380
12382 {
12384 }
12385 }
12386
12388 {
12389
12390 super.DeSerializeNumericalVars(floats);
12391
12392
12393 int index = 0;
12394 int mask = Math.Round(floats.Get(index));
12395
12396 index++;
12397
12399 {
12401 {
12403 }
12404 else
12405 {
12406 float quantity = floats.Get(index);
12407 SetQuantity(quantity,
true,
false,
false,
false);
12408 }
12409 index++;
12410 }
12411
12413 {
12414 float wet = floats.Get(index);
12416 index++;
12417 }
12418
12420 {
12421 int liquidtype = Math.Round(floats.Get(index));
12423 index++;
12424 }
12425
12427 {
12429 index++;
12431 index++;
12433 index++;
12435 index++;
12436 }
12437
12439 {
12440 int cleanness = Math.Round(floats.Get(index));
12442 index++;
12443 }
12444 }
12445
12447 {
12448 super.WriteVarsToCTX(ctx);
12449
12450
12452 {
12454 }
12455
12457 {
12459 }
12460
12462 {
12464 }
12465
12467 {
12468 int r,g,b,a;
12474 }
12475
12477 {
12479 }
12480 }
12481
12483 {
12484 if (!super.ReadVarsFromCTX(ctx,version))
12485 return false;
12486
12487 int intValue;
12488 float value;
12489
12490 if (version < 140)
12491 {
12492 if (!ctx.
Read(intValue))
12493 return false;
12494
12495 m_VariablesMask = intValue;
12496 }
12497
12499 {
12500 if (!ctx.
Read(value))
12501 return false;
12502
12504 {
12506 }
12507 else
12508 {
12510 }
12511 }
12512
12513 if (version < 140)
12514 {
12516 {
12517 if (!ctx.
Read(value))
12518 return false;
12519 SetTemperatureDirect(value);
12520 }
12521 }
12522
12524 {
12525 if (!ctx.
Read(value))
12526 return false;
12528 }
12529
12531 {
12532 if (!ctx.
Read(intValue))
12533 return false;
12535 }
12536
12538 {
12539 int r,g,b,a;
12541 return false;
12543 return false;
12545 return false;
12547 return false;
12548
12550 }
12551
12553 {
12554 if (!ctx.
Read(intValue))
12555 return false;
12557 }
12558
12559 if (version >= 138 && version < 140)
12560 {
12562 {
12563 if (!ctx.
Read(intValue))
12564 return false;
12565 SetFrozen(intValue);
12566 }
12567 }
12568
12569 return true;
12570 }
12571
12572
12574 {
12577 {
12579 }
12580
12581 if (!super.OnStoreLoad(ctx, version))
12582 {
12584 return false;
12585 }
12586
12587 if (version >= 114)
12588 {
12589 bool hasQuickBarIndexSaved;
12590
12591 if (!ctx.
Read(hasQuickBarIndexSaved))
12592 {
12594 return false;
12595 }
12596
12597 if (hasQuickBarIndexSaved)
12598 {
12599 int itmQBIndex;
12600
12601
12602 if (!ctx.
Read(itmQBIndex))
12603 {
12605 return false;
12606 }
12607
12608 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12609 if (itmQBIndex != -1 && parentPlayer)
12610 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12611 }
12612 }
12613 else
12614 {
12615
12616 PlayerBase player;
12617 int itemQBIndex;
12618 if (version ==
int.
MAX)
12619 {
12620 if (!ctx.
Read(itemQBIndex))
12621 {
12623 return false;
12624 }
12625 }
12626 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12627 {
12628
12629 if (!ctx.
Read(itemQBIndex))
12630 {
12632 return false;
12633 }
12634 if (itemQBIndex != -1 && player)
12635 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12636 }
12637 }
12638
12639 if (version < 140)
12640 {
12641
12642 if (!LoadVariables(ctx, version))
12643 {
12645 return false;
12646 }
12647 }
12648
12649
12651 {
12653 return false;
12654 }
12655 if (version >= 132)
12656 {
12658 if (raib)
12659 {
12661 {
12663 return false;
12664 }
12665 }
12666 }
12667
12669 return true;
12670 }
12671
12672
12673
12675 {
12676 super.OnStoreSave(ctx);
12677
12678 PlayerBase player;
12679 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12680 {
12682
12683 int itemQBIndex = -1;
12684 itemQBIndex = player.FindQuickBarEntityIndex(this);
12685 ctx.
Write(itemQBIndex);
12686 }
12687 else
12688 {
12690 }
12691
12693
12695 if (raib)
12696 {
12698 }
12699 }
12700
12701
12703 {
12704 super.AfterStoreLoad();
12705
12707 {
12709 }
12710
12712 {
12715 }
12716 }
12717
12719 {
12720 super.EEOnAfterLoad();
12721
12723 {
12725 }
12726
12729 }
12730
12732 {
12733 return false;
12734 }
12735
12736
12737
12739 {
12741 {
12742 #ifdef PLATFORM_CONSOLE
12743
12745 {
12747 if (menu)
12748 {
12750 }
12751 }
12752 #endif
12753 }
12754
12756 {
12759 }
12760
12762 {
12763 SetWeightDirty();
12765 }
12767 {
12770 }
12771
12773 {
12776 }
12778 {
12781 }
12782
12783 super.OnVariablesSynchronized();
12784 }
12785
12786
12787
12789 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12790 {
12791 if (!IsServerCheck(allow_client))
12792 return false;
12793
12795 return false;
12796
12799
12800 if (value <= (min + 0.001))
12801 value = min;
12802
12803 if (value == min)
12804 {
12805 if (destroy_config)
12806 {
12807 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12808 if (dstr)
12809 {
12811 this.Delete();
12812 return true;
12813 }
12814 }
12815 else if (destroy_forced)
12816 {
12818 this.Delete();
12819 return true;
12820 }
12821
12823 }
12824
12827
12829 {
12831
12832 if (delta)
12834 }
12835
12837
12838 return false;
12839 }
12840
12841
12843 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12844 {
12846 }
12847
12849 {
12852 }
12853
12855 {
12858 }
12859
12861 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12862 {
12863 float value_clamped = Math.Clamp(value, 0, 1);
12865 SetQuantity(result, destroy_config, destroy_forced);
12866 }
12867
12868
12871 {
12873 }
12874
12876 {
12878 }
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12890 {
12891 int slot = -1;
12892 if (GetInventory())
12893 {
12894 InventoryLocation il = new InventoryLocation;
12895 GetInventory().GetCurrentInventoryLocation(il);
12897 }
12898
12900 }
12901
12903 {
12904 float quantity_max = 0;
12905
12907 {
12908 if (attSlotID != -1)
12909 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12910
12911 if (quantity_max <= 0)
12913 }
12914
12915 if (quantity_max <= 0)
12917
12918 return quantity_max;
12919 }
12920
12922 {
12924 }
12925
12927 {
12929 }
12930
12931
12933 {
12935 }
12936
12938 {
12940 }
12941
12943 {
12945 }
12946
12947
12949 {
12950
12951 float weightEx = GetWeightEx();
12952 float special = GetInventoryAndCargoWeight();
12953 return weightEx - special;
12954 }
12955
12956
12958 {
12960 }
12961
12963 {
12965 {
12966 #ifdef DEVELOPER
12967 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12968 {
12969 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12971 }
12972 #endif
12973
12974 return GetQuantity() * GetConfigWeightModified();
12975 }
12976 else if (HasEnergyManager())
12977 {
12978 #ifdef DEVELOPER
12979 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12980 {
12981 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12982 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12983 }
12984 #endif
12985 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12986 }
12987 else
12988 {
12989 #ifdef DEVELOPER
12990 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12991 {
12992 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12993 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12994 }
12995 #endif
12996 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12997 }
12998 }
12999
13002 {
13003 int item_count = 0;
13005
13006 if (GetInventory().GetCargo() != NULL)
13007 {
13008 item_count = GetInventory().GetCargo().GetItemCount();
13009 }
13010
13011 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
13012 {
13013 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
13014 if (item)
13015 item_count += item.GetNumberOfItems();
13016 }
13017 return item_count;
13018 }
13019
13022 {
13023 float weight = 0;
13024 float wetness = 1;
13025 if (include_wetness)
13028 {
13029 weight = wetness * m_ConfigWeight;
13030 }
13032 {
13033 weight = 1;
13034 }
13035 return weight;
13036 }
13037
13038
13039
13041 {
13042 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13043 {
13044 GameInventory inv = GetInventory();
13045 array<EntityAI> items = new array<EntityAI>;
13047 for (int i = 0; i < items.Count(); i++)
13048 {
13050 if (item)
13051 {
13053 }
13054 }
13055 }
13056 }
13057
13058
13059
13060
13062 {
13063 float energy = 0;
13064 if (HasEnergyManager())
13065 {
13066 energy = GetCompEM().GetEnergy();
13067 }
13068 return energy;
13069 }
13070
13071
13073 {
13074 super.OnEnergyConsumed();
13075
13077 }
13078
13080 {
13081 super.OnEnergyAdded();
13082
13084 }
13085
13086
13088 {
13089 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13090 {
13092 {
13093 float energy_0to1 = GetCompEM().GetEnergy0To1();
13095 }
13096 }
13097 }
13098
13099
13101 {
13102 return ConfigGetFloat("heatIsolation");
13103 }
13104
13106 {
13108 }
13109
13111 {
13112 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13113 if (
GetGame().ConfigIsExisting(paramPath))
13115
13116 return 0.0;
13117 }
13118
13120 {
13121 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13122 if (
GetGame().ConfigIsExisting(paramPath))
13124
13125 return 0.0;
13126 }
13127
13128 override void SetWet(
float value,
bool allow_client =
false)
13129 {
13130 if (!IsServerCheck(allow_client))
13131 return;
13132
13135
13137
13138 m_VarWet = Math.Clamp(value, min, max);
13139
13141 {
13144 }
13145 }
13146
13147 override void AddWet(
float value)
13148 {
13150 }
13151
13153 {
13155 }
13156
13158 {
13160 }
13161
13163 {
13165 }
13166
13168 {
13170 }
13171
13173 {
13175 }
13176
13177 override void OnWetChanged(
float newVal,
float oldVal)
13178 {
13181 if (newLevel != oldLevel)
13182 {
13184 }
13185 }
13186
13188 {
13189 SetWeightDirty();
13190 }
13191
13193 {
13194 return GetWetLevelInternal(
m_VarWet);
13195 }
13196
13197
13198
13200 {
13202 }
13203
13205 {
13207 }
13208
13210 {
13212 }
13213
13215 {
13217 }
13218
13219
13220
13222 {
13223 if (ConfigIsExisting("itemModelLength"))
13224 {
13225 return ConfigGetFloat("itemModelLength");
13226 }
13227 return 0;
13228 }
13229
13231 {
13232 if (ConfigIsExisting("itemAttachOffset"))
13233 {
13234 return ConfigGetFloat("itemAttachOffset");
13235 }
13236 return 0;
13237 }
13238
13239 override void SetCleanness(
int value,
bool allow_client =
false)
13240 {
13241 if (!IsServerCheck(allow_client))
13242 return;
13243
13245
13247
13250 }
13251
13253 {
13255 }
13256
13258 {
13259 return true;
13260 }
13261
13262
13263
13264
13266 {
13268 }
13269
13271 {
13273 }
13274
13275
13276
13277
13278 override void SetColor(
int r,
int g,
int b,
int a)
13279 {
13285 }
13287 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13288 {
13293 }
13294
13296 {
13298 }
13299
13302 {
13303 int r,g,b,a;
13305 r = r/255;
13306 g = g/255;
13307 b = b/255;
13308 a = a/255;
13309 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13310 }
13311
13312
13313
13314 override void SetLiquidType(
int value,
bool allow_client =
false)
13315 {
13316 if (!IsServerCheck(allow_client))
13317 return;
13318
13323 }
13324
13326 {
13327 return ConfigGetInt("varLiquidTypeInit");
13328 }
13329
13331 {
13333 }
13334
13336 {
13338 SetFrozen(false);
13339 }
13340
13343 {
13344 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13345 }
13346
13347
13350 {
13351 PlayerBase nplayer;
13352 if (PlayerBase.CastTo(nplayer, player))
13353 {
13355
13356 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13357 }
13358 }
13359
13360
13363 {
13364 PlayerBase nplayer;
13365 if (PlayerBase.CastTo(nplayer,player))
13366 {
13367
13368 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13369
13370 }
13371
13372
13373 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13374
13375
13376 if (HasEnergyManager())
13377 {
13378 GetCompEM().UpdatePlugState();
13379 }
13380 }
13381
13382
13384 {
13385 super.OnPlacementStarted(player);
13386
13388 }
13389
13390 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13391 {
13393 {
13394 m_AdminLog.OnPlacementComplete(player,
this);
13395 }
13396
13397 super.OnPlacementComplete(player, position, orientation);
13398 }
13399
13400
13401
13402
13403
13405 {
13407 {
13408 return true;
13409 }
13410 else
13411 {
13412 return false;
13413 }
13414 }
13415
13416
13418 {
13420 {
13422 }
13423 }
13424
13425
13427 {
13429 }
13430
13432 {
13434 }
13435
13436 override void InsertAgent(
int agent,
float count = 1)
13437 {
13438 if (count < 1)
13439 return;
13440
13442 }
13443
13446 {
13448 }
13449
13450
13452 {
13454 }
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13498 {
13500 return false;
13501 return true;
13502 }
13503
13505 {
13506
13508 }
13509
13510
13513 {
13514 super.CheckForRoofLimited(timeTresholdMS);
13515
13517 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13518 {
13519 m_PreviousRoofTestTime = time;
13520 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13521 }
13522 }
13523
13524
13526 {
13528 {
13529 return 0;
13530 }
13531
13532 if (GetInventory().GetAttachmentSlotsCount() != 0)
13533 {
13534 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13535 if (filter)
13536 return filter.GetProtectionLevel(type, false, system);
13537 else
13538 return 0;
13539 }
13540
13541 string subclassPath, entryName;
13542
13543 switch (type)
13544 {
13546 entryName = "biological";
13547 break;
13549 entryName = "chemical";
13550 break;
13551 default:
13552 entryName = "biological";
13553 break;
13554 }
13555
13556 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13557
13559 }
13560
13561
13562
13565 {
13566 if (!IsMagazine())
13568
13570 }
13571
13572
13573
13574
13575
13580 {
13581 return true;
13582 }
13583
13585 {
13587 }
13588
13589
13590
13591
13592
13594 {
13595 if (parent)
13596 {
13597 if (parent.IsInherited(DayZInfected))
13598 return true;
13599
13600 if (!parent.IsRuined())
13601 return true;
13602 }
13603
13604 return true;
13605 }
13606
13608 {
13609 if (!super.CanPutAsAttachment(parent))
13610 {
13611 return false;
13612 }
13613
13614 if (!IsRuined() && !parent.IsRuined())
13615 {
13616 return true;
13617 }
13618
13619 return false;
13620 }
13621
13623 {
13624
13625
13626
13627
13628 return super.CanReceiveItemIntoCargo(item);
13629 }
13630
13632 {
13633
13634
13635
13636
13637 GameInventory attachmentInv = attachment.GetInventory();
13639 {
13640 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13641 return false;
13642 }
13643
13644 InventoryLocation loc = new InventoryLocation();
13645 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13646 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13647 return false;
13648
13649 return super.CanReceiveAttachment(attachment, slotId);
13650 }
13651
13653 {
13654 if (!super.CanReleaseAttachment(attachment))
13655 return false;
13656
13657 return GetInventory().AreChildrenAccessible();
13658 }
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13681 {
13682 int id = muzzle_owner.GetMuzzleID();
13683 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13684
13685 if (WPOF_array)
13686 {
13687 for (int i = 0; i < WPOF_array.Count(); i++)
13688 {
13689 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13690
13691 if (WPOF)
13692 {
13693 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13694 }
13695 }
13696 }
13697 }
13698
13699
13701 {
13702 int id = muzzle_owner.GetMuzzleID();
13704
13705 if (WPOBE_array)
13706 {
13707 for (int i = 0; i < WPOBE_array.Count(); i++)
13708 {
13709 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13710
13711 if (WPOBE)
13712 {
13713 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13714 }
13715 }
13716 }
13717 }
13718
13719
13721 {
13722 int id = muzzle_owner.GetMuzzleID();
13723 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13724
13725 if (WPOOH_array)
13726 {
13727 for (int i = 0; i < WPOOH_array.Count(); i++)
13728 {
13729 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13730
13731 if (WPOOH)
13732 {
13733 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13734 }
13735 }
13736 }
13737 }
13738
13739
13741 {
13742 int id = muzzle_owner.GetMuzzleID();
13743 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13744
13745 if (WPOOH_array)
13746 {
13747 for (int i = 0; i < WPOOH_array.Count(); i++)
13748 {
13749 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13750
13751 if (WPOOH)
13752 {
13753 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13754 }
13755 }
13756 }
13757 }
13758
13759
13761 {
13762 int id = muzzle_owner.GetMuzzleID();
13763 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13764
13765 if (WPOOH_array)
13766 {
13767 for (int i = 0; i < WPOOH_array.Count(); i++)
13768 {
13769 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13770
13771 if (WPOOH)
13772 {
13773 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13774 }
13775 }
13776 }
13777 }
13778
13779
13780
13782 {
13784 {
13785 return true;
13786 }
13787
13788 return false;
13789 }
13790
13792 {
13794 {
13795 return true;
13796 }
13797
13798 return false;
13799 }
13800
13802 {
13804 {
13805 return true;
13806 }
13807
13808 return false;
13809 }
13810
13812 {
13813 return false;
13814 }
13815
13818 {
13819 return UATimeSpent.DEFAULT_DEPLOY;
13820 }
13821
13822
13823
13824
13826 {
13828 SetSynchDirty();
13829 }
13830
13832 {
13834 }
13835
13836
13838 {
13839 return false;
13840 }
13841
13844 {
13845 string att_type = "None";
13846
13847 if (ConfigIsExisting("soundAttType"))
13848 {
13849 att_type = ConfigGetString("soundAttType");
13850 }
13851
13853 }
13854
13856 {
13858 }
13859
13860
13861
13862
13863
13869
13871 {
13874
13876 }
13877
13878
13880 {
13882 return;
13883
13885
13888
13891
13892 SoundParameters params = new SoundParameters();
13896 }
13897
13898
13900 {
13902 return;
13903
13905 SetSynchDirty();
13906
13909 }
13910
13911
13913 {
13915 return;
13916
13918 SetSynchDirty();
13919
13922 }
13923
13925 {
13927 }
13928
13930 {
13932 }
13933
13936 {
13937 if (!
GetGame().IsDedicatedServer())
13938 {
13939 if (ConfigIsExisting("attachSoundSet"))
13940 {
13941 string cfg_path = "";
13942 string soundset = "";
13943 string type_name =
GetType();
13944
13947 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13948 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13949
13950 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13951 {
13952 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13953 {
13954 if (cfg_slot_array[i] == slot_type)
13955 {
13956 soundset = cfg_soundset_array[i];
13957 break;
13958 }
13959 }
13960 }
13961
13962 if (soundset != "")
13963 {
13964 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13966 }
13967 }
13968 }
13969 }
13970
13972 {
13973
13974 }
13975
13976 void OnApply(PlayerBase player);
13977
13979 {
13980 return 1.0;
13981 };
13982
13984 {
13986 }
13987
13989 {
13991 }
13992
13994
13996 {
13997 SetDynamicPhysicsLifeTime(0.01);
13999 }
14000
14002 {
14003 array<string> zone_names = new array<string>;
14004 GetDamageZones(zone_names);
14005 for (int i = 0; i < zone_names.Count(); i++)
14006 {
14007 SetHealthMax(zone_names.Get(i),"Health");
14008 }
14009 SetHealthMax("","Health");
14010 }
14011
14014 {
14015 float global_health = GetHealth01("","Health");
14016 array<string> zones = new array<string>;
14017 GetDamageZones(zones);
14018
14019 for (int i = 0; i < zones.Count(); i++)
14020 {
14021 SetHealth01(zones.Get(i),"Health",global_health);
14022 }
14023 }
14024
14027 {
14028 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
14029 }
14030
14032 {
14033 if (!hasRootAsPlayer)
14034 {
14035 if (refParentIB)
14036 {
14037
14038 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14039 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14040
14041 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14042 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14043
14046 }
14047 else
14048 {
14049
14052 }
14053 }
14054 }
14055
14057 {
14059 {
14060 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14061 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14062 {
14063 float heatPermCoef = 1.0;
14065 while (ent)
14066 {
14067 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14068 ent = ent.GetHierarchyParent();
14069 }
14070
14071 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14072 }
14073 }
14074 }
14075
14077 {
14078
14079 EntityAI parent = GetHierarchyParent();
14080 if (!parent)
14081 {
14082 hasParent = false;
14083 hasRootAsPlayer = false;
14084 }
14085 else
14086 {
14087 hasParent = true;
14088 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14089 refParentIB =
ItemBase.Cast(parent);
14090 }
14091 }
14092
14093 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14094 {
14095
14096 }
14097
14099 {
14100
14101 return false;
14102 }
14103
14105 {
14106
14107
14108 return false;
14109 }
14110
14112 {
14113
14114 return false;
14115 }
14116
14119 {
14120 return !GetIsFrozen() &&
IsOpen();
14121 }
14122
14124 {
14125 bool hasParent = false, hasRootAsPlayer = false;
14127
14128 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14129 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14130
14131 if (wwtu || foodDecay)
14132 {
14136
14137 if (processWetness || processTemperature || processDecay)
14138 {
14140
14141 if (processWetness)
14142 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14143
14144 if (processTemperature)
14146
14147 if (processDecay)
14148 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14149 }
14150 }
14151 }
14152
14155 {
14157 }
14158
14160 {
14163
14164 return super.GetTemperatureFreezeThreshold();
14165 }
14166
14168 {
14171
14172 return super.GetTemperatureThawThreshold();
14173 }
14174
14176 {
14179
14180 return super.GetItemOverheatThreshold();
14181 }
14182
14184 {
14186 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14187
14188 return super.GetTemperatureFreezeTime();
14189 }
14190
14192 {
14194 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14195
14196 return super.GetTemperatureThawTime();
14197 }
14198
14203
14205 {
14206 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14207 }
14208
14210 {
14211 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14212 }
14213
14216 {
14218 }
14219
14221 {
14223 }
14224
14226 {
14228 }
14229
14232 {
14233 return null;
14234 }
14235
14238 {
14239 return false;
14240 }
14241
14243 {
14245 {
14248 if (!trg)
14249 {
14251 explosive = this;
14252 }
14253
14254 explosive.PairRemote(trg);
14256
14257 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14258 trg.SetPersistentPairID(persistentID);
14259 explosive.SetPersistentPairID(persistentID);
14260
14261 return true;
14262 }
14263 return false;
14264 }
14265
14268 {
14269 float ret = 1.0;
14272 ret *= GetHealth01();
14273
14274 return ret;
14275 }
14276
14277 #ifdef DEVELOPER
14278 override void SetDebugItem()
14279 {
14280 super.SetDebugItem();
14281 _itemBase = this;
14282 }
14283
14285 {
14286 string text = super.GetDebugText();
14287
14289 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14290
14291 return text;
14292 }
14293 #endif
14294
14296 {
14297 return true;
14298 }
14299
14301
14303
14305 {
14308 }
14309
14310
14318
14334}
14335
14337{
14339 if (entity)
14340 {
14341 bool is_item = entity.IsInherited(
ItemBase);
14342 if (is_item && full_quantity)
14343 {
14346 }
14347 }
14348 else
14349 {
14351 return NULL;
14352 }
14353 return entity;
14354}
14355
14357{
14358 if (item)
14359 {
14360 if (health > 0)
14361 item.SetHealth("", "", health);
14362
14363 if (item.CanHaveTemperature())
14364 {
14366 if (item.CanFreeze())
14367 item.SetFrozen(false);
14368 }
14369
14370 if (item.HasEnergyManager())
14371 {
14372 if (quantity >= 0)
14373 {
14374 item.GetCompEM().SetEnergy0To1(quantity);
14375 }
14376 else
14377 {
14379 }
14380 }
14381 else if (item.IsMagazine())
14382 {
14383 Magazine mag = Magazine.Cast(item);
14384 if (quantity >= 0)
14385 {
14386 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14387 }
14388 else
14389 {
14391 }
14392
14393 }
14394 else
14395 {
14396 if (quantity >= 0)
14397 {
14398 item.SetQuantityNormalized(quantity, false);
14399 }
14400 else
14401 {
14403 }
14404
14405 }
14406 }
14407}
14408
14409#ifdef DEVELOPER
14411#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.