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 {
11072 return;
11073
11075 {
11076 if (ScriptInputUserData.CanStoreInputUserData())
11077 {
11078 ScriptInputUserData ctx = new ScriptInputUserData;
11083 ctx.
Write(destination_entity);
11085 ctx.
Write(slot_id);
11087 }
11088 }
11089 else if (!
GetGame().IsMultiplayer())
11090 {
11092 }
11093 }
11094
11096 {
11098 return;
11099
11100 float split_quantity_new;
11104 InventoryLocation loc = new InventoryLocation;
11105
11106 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11107 {
11109 split_quantity_new = stack_max;
11110 else
11112
11113 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11114 if (new_item)
11115 {
11116 new_item.SetResultOfSplit(true);
11117 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11119 new_item.SetQuantity(split_quantity_new);
11120 }
11121 }
11122 else if (destination_entity && slot_id == -1)
11123 {
11124 if (quantity > stack_max)
11125 split_quantity_new = stack_max;
11126 else
11127 split_quantity_new = quantity;
11128
11130 {
11133 }
11134
11135 if (new_item)
11136 {
11137 new_item.SetResultOfSplit(true);
11138 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11140 new_item.SetQuantity(split_quantity_new);
11141 }
11142 }
11143 else
11144 {
11145 if (stack_max != 0)
11146 {
11148 {
11150 }
11151
11152 if (split_quantity_new == 0)
11153 {
11154 if (!
GetGame().IsMultiplayer())
11155 player.PhysicalPredictiveDropItem(this);
11156 else
11157 player.ServerDropEntity(this);
11158 return;
11159 }
11160
11162
11163 if (new_item)
11164 {
11165 new_item.SetResultOfSplit(true);
11166 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11168 new_item.SetQuantity(stack_max);
11169 new_item.PlaceOnSurface();
11170 }
11171 }
11172 }
11173 }
11174
11176 {
11178 return;
11179
11180 float split_quantity_new;
11184 InventoryLocation loc = new InventoryLocation;
11185
11186 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11187 {
11189 split_quantity_new = stack_max;
11190 else
11192
11193 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11194 if (new_item)
11195 {
11196 new_item.SetResultOfSplit(true);
11197 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11199 new_item.SetQuantity(split_quantity_new);
11200 }
11201 }
11202 else if (destination_entity && slot_id == -1)
11203 {
11204 if (quantity > stack_max)
11205 split_quantity_new = stack_max;
11206 else
11207 split_quantity_new = quantity;
11208
11210 {
11213 }
11214
11215 if (new_item)
11216 {
11217 new_item.SetResultOfSplit(true);
11218 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11220 new_item.SetQuantity(split_quantity_new);
11221 }
11222 }
11223 else
11224 {
11225 if (stack_max != 0)
11226 {
11228 {
11230 }
11231
11233
11234 if (new_item)
11235 {
11236 new_item.SetResultOfSplit(true);
11237 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11239 new_item.SetQuantity(stack_max);
11240 new_item.PlaceOnSurface();
11241 }
11242 }
11243 }
11244 }
11245
11247 {
11249 return;
11250
11252 {
11253 if (ScriptInputUserData.CanStoreInputUserData())
11254 {
11255 ScriptInputUserData ctx = new ScriptInputUserData;
11260 dst.WriteToContext(ctx);
11262 }
11263 }
11264 else if (!
GetGame().IsMultiplayer())
11265 {
11267 }
11268 }
11269
11271 {
11273 return;
11274
11276 {
11277 if (ScriptInputUserData.CanStoreInputUserData())
11278 {
11279 ScriptInputUserData ctx = new ScriptInputUserData;
11284 ctx.
Write(destination_entity);
11290 }
11291 }
11292 else if (!
GetGame().IsMultiplayer())
11293 {
11295 }
11296 }
11297
11299 {
11301 }
11302
11304 {
11306 return this;
11307
11309 float split_quantity_new;
11311 if (dst.IsValid())
11312 {
11313 int slot_id = dst.GetSlot();
11315
11316 if (quantity > stack_max)
11317 split_quantity_new = stack_max;
11318 else
11319 split_quantity_new = quantity;
11320
11322
11323 if (new_item)
11324 {
11325 new_item.SetResultOfSplit(true);
11326 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11329 }
11330
11331 return new_item;
11332 }
11333
11334 return null;
11335 }
11336
11338 {
11340 return;
11341
11343 float split_quantity_new;
11345 if (destination_entity)
11346 {
11348 if (quantity > stackable)
11349 split_quantity_new = stackable;
11350 else
11351 split_quantity_new = quantity;
11352
11353 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11354 if (new_item)
11355 {
11356 new_item.SetResultOfSplit(true);
11357 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11359 new_item.SetQuantity(split_quantity_new);
11360 }
11361 }
11362 }
11363
11365 {
11367 return;
11368
11370 {
11371 if (ScriptInputUserData.CanStoreInputUserData())
11372 {
11373 ScriptInputUserData ctx = new ScriptInputUserData;
11378 ItemBase destination_entity =
this;
11379 ctx.
Write(destination_entity);
11383 }
11384 }
11385 else if (!
GetGame().IsMultiplayer())
11386 {
11388 }
11389 }
11390
11392 {
11394 return;
11395
11397 float split_quantity_new;
11399 if (player)
11400 {
11402 if (quantity > stackable)
11403 split_quantity_new = stackable;
11404 else
11405 split_quantity_new = quantity;
11406
11407 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11408 new_item =
ItemBase.Cast(in_hands);
11409 if (new_item)
11410 {
11411 new_item.SetResultOfSplit(true);
11412 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11414 new_item.SetQuantity(split_quantity_new);
11415 }
11416 }
11417 }
11418
11420 {
11422 return;
11423
11425 float split_quantity_new = Math.Floor(quantity * 0.5);
11426
11428
11429 if (new_item)
11430 {
11431 if (new_item.GetQuantityMax() < split_quantity_new)
11432 {
11433 split_quantity_new = new_item.GetQuantityMax();
11434 }
11435
11436 new_item.SetResultOfSplit(true);
11437 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11438
11440 {
11443 }
11444 else
11445 {
11448 }
11449 }
11450 }
11451
11453 {
11455 return;
11456
11458 float split_quantity_new = Math.Floor(quantity / 2);
11459
11460 InventoryLocation invloc = new InventoryLocation;
11462
11464 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11465
11466 if (new_item)
11467 {
11468 if (new_item.GetQuantityMax() < split_quantity_new)
11469 {
11470 split_quantity_new = new_item.GetQuantityMax();
11471 }
11473 {
11476 }
11477 else
11478 {
11481 }
11482 }
11483 }
11484
11487 {
11488 SetWeightDirty();
11490
11491 if (parent)
11492 parent.OnAttachmentQuantityChangedEx(this, delta);
11493
11495 {
11497 {
11499 }
11501 {
11502 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11504 }
11505 }
11506
11507 }
11508
11511 {
11512
11513 }
11514
11517 {
11519 }
11520
11522 {
11523 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11524
11526 {
11527 if (newLevel == GameConstants.STATE_RUINED)
11528 {
11530 EntityAI parent = GetHierarchyParent();
11531 if (parent && parent.IsFireplace())
11532 {
11533 CargoBase cargo = GetInventory().GetCargo();
11534 if (cargo)
11535 {
11537 {
11539 }
11540 }
11541 }
11542 }
11543
11545 {
11546
11548 return;
11549 }
11550
11551 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11552 {
11554 }
11555 }
11556 }
11557
11558
11560 {
11561 super.OnRightClick();
11562
11564 {
11566 {
11567 if (ScriptInputUserData.CanStoreInputUserData())
11568 {
11569 vector m4[4];
11571
11572 EntityAI root = GetHierarchyRoot();
11573
11574 InventoryLocation dst = new InventoryLocation;
11576 {
11577 if (root)
11578 {
11579 root.GetTransform(m4);
11581 }
11582 else
11583 GetInventory().GetCurrentInventoryLocation(dst);
11584 }
11585 else
11586 {
11588
11589
11590 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11591 {
11592 if (root)
11593 {
11594 root.GetTransform(m4);
11596 }
11597 else
11598 GetInventory().GetCurrentInventoryLocation(dst);
11599 }
11600 else
11601 {
11602 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11603 }
11604 }
11605
11606 ScriptInputUserData ctx = new ScriptInputUserData;
11614 }
11615 }
11616 else if (!
GetGame().IsMultiplayer())
11617 {
11619 }
11620 }
11621 }
11622
11623 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11624 {
11625
11626 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11627 return false;
11628
11629 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11630 return false;
11631
11632
11634 return false;
11635
11636
11637 Magazine mag = Magazine.Cast(this);
11638 if (mag)
11639 {
11640 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11641 return false;
11642
11643 if (stack_max_limit)
11644 {
11645 Magazine other_mag = Magazine.Cast(other_item);
11646 if (other_item)
11647 {
11648 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11649 return false;
11650 }
11651
11652 }
11653 }
11654 else
11655 {
11656
11658 return false;
11659
11661 return false;
11662 }
11663
11664 PlayerBase player = null;
11665 if (CastTo(player, GetHierarchyRootPlayer()))
11666 {
11667 if (player.GetInventory().HasAttachment(this))
11668 return false;
11669
11670 if (player.IsItemsToDelete())
11671 return false;
11672 }
11673
11674 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11675 return false;
11676
11677 int slotID;
11679 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11680 return false;
11681
11682 return true;
11683 }
11684
11686 {
11688 }
11689
11691 {
11692 return m_IsResultOfSplit;
11693 }
11694
11696 {
11697 m_IsResultOfSplit = value;
11698 }
11699
11701 {
11703 }
11704
11706 {
11707 float other_item_quantity = other_item.GetQuantity();
11708 float this_free_space;
11709
11711
11713
11714 if (other_item_quantity > this_free_space)
11715 {
11716 return this_free_space;
11717 }
11718 else
11719 {
11720 return other_item_quantity;
11721 }
11722 }
11723
11725 {
11727 }
11728
11730 {
11732 return;
11733
11734 if (!IsMagazine() && other_item)
11735 {
11737 if (quantity_used != 0)
11738 {
11739 float hp1 = GetHealth01("","");
11740 float hp2 = other_item.GetHealth01("","");
11741 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11742 hpResult = hpResult / (
GetQuantity() + quantity_used);
11743
11744 hpResult *= GetMaxHealth();
11745 Math.Round(hpResult);
11746 SetHealth("", "Health", hpResult);
11747
11749 other_item.AddQuantity(-quantity_used);
11750 }
11751 }
11753 }
11754
11756 {
11757 #ifdef SERVER
11758 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11759 GetHierarchyParent().IncreaseLifetimeUp();
11760 #endif
11761 };
11762
11764 {
11765 PlayerBase p = PlayerBase.Cast(player);
11766
11767 array<int> recipesIds = p.m_Recipes;
11768 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11769 if (moduleRecipesManager)
11770 {
11771 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11772 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11773 }
11774
11775 for (int i = 0;i < recipesIds.Count(); i++)
11776 {
11777 int key = recipesIds.Get(i);
11778 string recipeName = moduleRecipesManager.GetRecipeName(key);
11780 }
11781 }
11782
11783
11784 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11785 {
11786 super.GetDebugActions(outputList);
11787
11788
11793
11794
11798
11802
11803
11806
11807
11809 {
11812 }
11813
11815
11818
11822 }
11823
11824
11825
11826
11828 {
11829 super.OnAction(action_id, player, ctx);
11830 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11831 {
11832 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11833 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11834 PlayerBase p = PlayerBase.Cast(player);
11835 if (
EActions.RECIPES_RANGE_START < 1000)
11836 {
11837 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11838 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11839 }
11840 }
11841 #ifndef SERVER
11842 else if (action_id ==
EActions.WATCH_PLAYER)
11843 {
11844 PluginDeveloper.SetDeveloperItemClientEx(player);
11845 }
11846 #endif
11848 {
11849 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11850 {
11851 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11852 OnDebugButtonPressServer(id + 1);
11853 }
11854
11855 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11856 {
11857 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11859 }
11860
11861 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11862 {
11863 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11865 }
11866
11867 else if (action_id ==
EActions.ADD_QUANTITY)
11868 {
11869 if (IsMagazine())
11870 {
11871 Magazine mag = Magazine.Cast(this);
11872 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11873 }
11874 else
11875 {
11877 }
11878
11879 if (m_EM)
11880 {
11881 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11882 }
11883
11884 }
11885
11886 else if (action_id ==
EActions.REMOVE_QUANTITY)
11887 {
11888 if (IsMagazine())
11889 {
11890 Magazine mag2 = Magazine.Cast(this);
11891 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11892 }
11893 else
11894 {
11896 }
11897 if (m_EM)
11898 {
11899 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11900 }
11901
11902 }
11903
11904 else if (action_id ==
EActions.SET_QUANTITY_0)
11905 {
11907
11908 if (m_EM)
11909 {
11910 m_EM.SetEnergy(0);
11911 }
11912 }
11913
11914 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11915 {
11917
11918 if (m_EM)
11919 {
11920 m_EM.SetEnergy(m_EM.GetEnergyMax());
11921 }
11922 }
11923
11924 else if (action_id ==
EActions.ADD_HEALTH)
11925 {
11926 AddHealth("","",GetMaxHealth("","Health")/5);
11927 }
11928 else if (action_id ==
EActions.REMOVE_HEALTH)
11929 {
11930 AddHealth("","",-GetMaxHealth("","Health")/5);
11931 }
11932 else if (action_id ==
EActions.DESTROY_HEALTH)
11933 {
11934 SetHealth01("","",0);
11935 }
11936 else if (action_id ==
EActions.WATCH_ITEM)
11937 {
11939 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11940 #ifdef DEVELOPER
11941 SetDebugDeveloper_item(this);
11942 #endif
11943 }
11944
11945 else if (action_id ==
EActions.ADD_TEMPERATURE)
11946 {
11947 AddTemperature(20);
11948
11949 }
11950
11951 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11952 {
11953 AddTemperature(-20);
11954
11955 }
11956
11957 else if (action_id ==
EActions.FLIP_FROZEN)
11958 {
11959 SetFrozen(!GetIsFrozen());
11960
11961 }
11962
11963 else if (action_id ==
EActions.ADD_WETNESS)
11964 {
11966
11967 }
11968
11969 else if (action_id ==
EActions.REMOVE_WETNESS)
11970 {
11972
11973 }
11974
11975 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11976 {
11979
11980
11981 }
11982
11983 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11984 {
11987 }
11988
11989 else if (action_id ==
EActions.MAKE_SPECIAL)
11990 {
11991 auto debugParams = DebugSpawnParams.WithPlayer(player);
11992 OnDebugSpawnEx(debugParams);
11993 }
11994
11995 else if (action_id ==
EActions.DELETE)
11996 {
11997 Delete();
11998 }
11999
12000 }
12001
12002
12003 return false;
12004 }
12005
12006
12007
12008
12012
12015
12016
12017
12019 {
12020 return false;
12021 }
12022
12023
12025 {
12026 return true;
12027 }
12028
12029
12031 {
12032 return true;
12033 }
12034
12035
12036
12038 {
12039 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12041 }
12042
12045 {
12046 return null;
12047 }
12048
12050 {
12051 return false;
12052 }
12053
12055 {
12056 return false;
12057 }
12058
12062
12063
12065 {
12066 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12067 return module_repairing.CanRepair(this, item_repair_kit);
12068 }
12069
12070
12071 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12072 {
12073 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12074 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12075 }
12076
12077
12079 {
12080
12081
12082
12083
12084
12085
12086
12087
12088 return 1;
12089 }
12090
12091
12092
12094 {
12096 }
12097
12098
12099
12101 {
12103 }
12104
12105
12114 {
12115 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12116
12117 if (player)
12118 {
12119 player.MessageStatus(text);
12120 }
12121 }
12122
12123
12132 {
12133 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12134
12135 if (player)
12136 {
12137 player.MessageAction(text);
12138 }
12139 }
12140
12141
12150 {
12151 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12152
12153 if (player)
12154 {
12155 player.MessageFriendly(text);
12156 }
12157 }
12158
12159
12168 {
12169 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12170
12171 if (player)
12172 {
12173 player.MessageImportant(text);
12174 }
12175 }
12176
12178 {
12179 return true;
12180 }
12181
12182
12183 override bool KindOf(
string tag)
12184 {
12185 bool found = false;
12186 string item_name = this.
GetType();
12189
12190 int array_size = item_tag_array.Count();
12191 for (int i = 0; i < array_size; i++)
12192 {
12193 if (item_tag_array.Get(i) == tag)
12194 {
12195 found = true;
12196 break;
12197 }
12198 }
12199 return found;
12200 }
12201
12202
12204 {
12205
12206 super.OnRPC(sender, rpc_type,ctx);
12207
12208
12209 switch (rpc_type)
12210 {
12211 #ifndef SERVER
12212 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12213 Param2<bool, string> p = new Param2<bool, string>(false, "");
12214
12216 return;
12217
12218 bool play = p.param1;
12219 string soundSet = p.param2;
12220
12221 if (play)
12222 {
12224 {
12226 {
12228 }
12229 }
12230 else
12231 {
12233 }
12234 }
12235 else
12236 {
12238 }
12239
12240 break;
12241 #endif
12242
12243 }
12244
12246 {
12248 }
12249 }
12250
12251
12252
12253
12255 {
12256 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12257 return plugin.GetID(
name);
12258 }
12259
12261 {
12262 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12263 return plugin.GetName(id);
12264 }
12265
12268 {
12269
12270
12271 int varFlags;
12272 if (!ctx.
Read(varFlags))
12273 return;
12274
12275 if (varFlags & ItemVariableFlags.FLOAT)
12276 {
12278 }
12279 }
12280
12282 {
12283
12284 super.SerializeNumericalVars(floats_out);
12285
12286
12287
12289 {
12291 }
12292
12294 {
12296 }
12297
12299 {
12301 }
12302
12304 {
12309 }
12310
12312 {
12314 }
12315 }
12316
12318 {
12319
12320 super.DeSerializeNumericalVars(floats);
12321
12322
12323 int index = 0;
12324 int mask = Math.Round(floats.Get(index));
12325
12326 index++;
12327
12329 {
12331 {
12333 }
12334 else
12335 {
12336 float quantity = floats.Get(index);
12337 SetQuantity(quantity,
true,
false,
false,
false);
12338 }
12339 index++;
12340 }
12341
12343 {
12344 float wet = floats.Get(index);
12346 index++;
12347 }
12348
12350 {
12351 int liquidtype = Math.Round(floats.Get(index));
12353 index++;
12354 }
12355
12357 {
12359 index++;
12361 index++;
12363 index++;
12365 index++;
12366 }
12367
12369 {
12370 int cleanness = Math.Round(floats.Get(index));
12372 index++;
12373 }
12374 }
12375
12377 {
12378 super.WriteVarsToCTX(ctx);
12379
12380
12382 {
12384 }
12385
12387 {
12389 }
12390
12392 {
12394 }
12395
12397 {
12398 int r,g,b,a;
12404 }
12405
12407 {
12409 }
12410 }
12411
12413 {
12414 if (!super.ReadVarsFromCTX(ctx,version))
12415 return false;
12416
12417 int intValue;
12418 float value;
12419
12420 if (version < 140)
12421 {
12422 if (!ctx.
Read(intValue))
12423 return false;
12424
12425 m_VariablesMask = intValue;
12426 }
12427
12429 {
12430 if (!ctx.
Read(value))
12431 return false;
12432
12434 {
12436 }
12437 else
12438 {
12440 }
12441 }
12442
12443 if (version < 140)
12444 {
12446 {
12447 if (!ctx.
Read(value))
12448 return false;
12449 SetTemperatureDirect(value);
12450 }
12451 }
12452
12454 {
12455 if (!ctx.
Read(value))
12456 return false;
12458 }
12459
12461 {
12462 if (!ctx.
Read(intValue))
12463 return false;
12465 }
12466
12468 {
12469 int r,g,b,a;
12471 return false;
12473 return false;
12475 return false;
12477 return false;
12478
12480 }
12481
12483 {
12484 if (!ctx.
Read(intValue))
12485 return false;
12487 }
12488
12489 if (version >= 138 && version < 140)
12490 {
12492 {
12493 if (!ctx.
Read(intValue))
12494 return false;
12495 SetFrozen(intValue);
12496 }
12497 }
12498
12499 return true;
12500 }
12501
12502
12504 {
12507 {
12509 }
12510
12511 if (!super.OnStoreLoad(ctx, version))
12512 {
12514 return false;
12515 }
12516
12517 if (version >= 114)
12518 {
12519 bool hasQuickBarIndexSaved;
12520
12521 if (!ctx.
Read(hasQuickBarIndexSaved))
12522 {
12524 return false;
12525 }
12526
12527 if (hasQuickBarIndexSaved)
12528 {
12529 int itmQBIndex;
12530
12531
12532 if (!ctx.
Read(itmQBIndex))
12533 {
12535 return false;
12536 }
12537
12538 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12539 if (itmQBIndex != -1 && parentPlayer)
12540 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12541 }
12542 }
12543 else
12544 {
12545
12546 PlayerBase player;
12547 int itemQBIndex;
12548 if (version ==
int.
MAX)
12549 {
12550 if (!ctx.
Read(itemQBIndex))
12551 {
12553 return false;
12554 }
12555 }
12556 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12557 {
12558
12559 if (!ctx.
Read(itemQBIndex))
12560 {
12562 return false;
12563 }
12564 if (itemQBIndex != -1 && player)
12565 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12566 }
12567 }
12568
12569 if (version < 140)
12570 {
12571
12572 if (!LoadVariables(ctx, version))
12573 {
12575 return false;
12576 }
12577 }
12578
12579
12581 {
12583 return false;
12584 }
12585 if (version >= 132)
12586 {
12588 if (raib)
12589 {
12591 {
12593 return false;
12594 }
12595 }
12596 }
12597
12599 return true;
12600 }
12601
12602
12603
12605 {
12606 super.OnStoreSave(ctx);
12607
12608 PlayerBase player;
12609 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12610 {
12612
12613 int itemQBIndex = -1;
12614 itemQBIndex = player.FindQuickBarEntityIndex(this);
12615 ctx.
Write(itemQBIndex);
12616 }
12617 else
12618 {
12620 }
12621
12623
12625 if (raib)
12626 {
12628 }
12629 }
12630
12631
12633 {
12634 super.AfterStoreLoad();
12635
12637 {
12639 }
12640
12642 {
12645 }
12646 }
12647
12649 {
12650 super.EEOnAfterLoad();
12651
12653 {
12655 }
12656
12659 }
12660
12662 {
12663 return false;
12664 }
12665
12666
12667
12669 {
12671 {
12672 #ifdef PLATFORM_CONSOLE
12673
12675 {
12677 if (menu)
12678 {
12680 }
12681 }
12682 #endif
12683 }
12684
12686 {
12689 }
12690
12692 {
12693 SetWeightDirty();
12695 }
12697 {
12700 }
12701
12703 {
12706 }
12708 {
12711 }
12712
12713 super.OnVariablesSynchronized();
12714 }
12715
12716
12717
12719 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12720 {
12721 if (!IsServerCheck(allow_client))
12722 return false;
12723
12725 return false;
12726
12729
12730 if (value <= (min + 0.001))
12731 value = min;
12732
12733 if (value == min)
12734 {
12735 if (destroy_config)
12736 {
12737 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12738 if (dstr)
12739 {
12741 this.Delete();
12742 return true;
12743 }
12744 }
12745 else if (destroy_forced)
12746 {
12748 this.Delete();
12749 return true;
12750 }
12751
12753 }
12754
12757
12759 {
12761
12762 if (delta)
12764 }
12765
12767
12768 return false;
12769 }
12770
12771
12773 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12774 {
12776 }
12777
12779 {
12782 }
12783
12785 {
12788 }
12789
12792 {
12793 float value_clamped = Math.Clamp(value, 0, 1);
12795 SetQuantity(result, destroy_config, destroy_forced);
12796 }
12797
12798
12801 {
12803 }
12804
12806 {
12808 }
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12820 {
12821 int slot = -1;
12822 if (GetInventory())
12823 {
12824 InventoryLocation il = new InventoryLocation;
12825 GetInventory().GetCurrentInventoryLocation(il);
12827 }
12828
12830 }
12831
12833 {
12834 float quantity_max = 0;
12835
12837 {
12838 if (attSlotID != -1)
12839 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12840
12841 if (quantity_max <= 0)
12843 }
12844
12845 if (quantity_max <= 0)
12847
12848 return quantity_max;
12849 }
12850
12852 {
12854 }
12855
12857 {
12859 }
12860
12861
12863 {
12865 }
12866
12868 {
12870 }
12871
12873 {
12875 }
12876
12877
12879 {
12880
12881 float weightEx = GetWeightEx();
12882 float special = GetInventoryAndCargoWeight();
12883 return weightEx - special;
12884 }
12885
12886
12888 {
12890 }
12891
12893 {
12895 {
12896 #ifdef DEVELOPER
12897 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12898 {
12899 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12901 }
12902 #endif
12903
12904 return GetQuantity() * GetConfigWeightModified();
12905 }
12906 else if (HasEnergyManager())
12907 {
12908 #ifdef DEVELOPER
12909 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12910 {
12911 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12912 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12913 }
12914 #endif
12915 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12916 }
12917 else
12918 {
12919 #ifdef DEVELOPER
12920 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12921 {
12922 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12923 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12924 }
12925 #endif
12926 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12927 }
12928 }
12929
12932 {
12933 int item_count = 0;
12935
12936 if (GetInventory().GetCargo() != NULL)
12937 {
12938 item_count = GetInventory().GetCargo().GetItemCount();
12939 }
12940
12941 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12942 {
12943 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12944 if (item)
12945 item_count += item.GetNumberOfItems();
12946 }
12947 return item_count;
12948 }
12949
12952 {
12953 float weight = 0;
12954 float wetness = 1;
12955 if (include_wetness)
12958 {
12959 weight = wetness * m_ConfigWeight;
12960 }
12962 {
12963 weight = 1;
12964 }
12965 return weight;
12966 }
12967
12968
12969
12971 {
12972 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12973 {
12974 GameInventory inv = GetInventory();
12975 array<EntityAI> items = new array<EntityAI>;
12977 for (int i = 0; i < items.Count(); i++)
12978 {
12980 if (item)
12981 {
12983 }
12984 }
12985 }
12986 }
12987
12988
12989
12990
12992 {
12993 float energy = 0;
12994 if (HasEnergyManager())
12995 {
12996 energy = GetCompEM().GetEnergy();
12997 }
12998 return energy;
12999 }
13000
13001
13003 {
13004 super.OnEnergyConsumed();
13005
13007 }
13008
13010 {
13011 super.OnEnergyAdded();
13012
13014 }
13015
13016
13018 {
13019 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13020 {
13022 {
13023 float energy_0to1 = GetCompEM().GetEnergy0To1();
13025 }
13026 }
13027 }
13028
13029
13031 {
13032 return ConfigGetFloat("heatIsolation");
13033 }
13034
13036 {
13038 }
13039
13041 {
13042 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13043 if (
GetGame().ConfigIsExisting(paramPath))
13045
13046 return 0.0;
13047 }
13048
13050 {
13051 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13052 if (
GetGame().ConfigIsExisting(paramPath))
13054
13055 return 0.0;
13056 }
13057
13058 override void SetWet(
float value,
bool allow_client =
false)
13059 {
13060 if (!IsServerCheck(allow_client))
13061 return;
13062
13065
13067
13068 m_VarWet = Math.Clamp(value, min, max);
13069
13071 {
13074 }
13075 }
13076
13077 override void AddWet(
float value)
13078 {
13080 }
13081
13083 {
13085 }
13086
13088 {
13090 }
13091
13093 {
13095 }
13096
13098 {
13100 }
13101
13103 {
13105 }
13106
13107 override void OnWetChanged(
float newVal,
float oldVal)
13108 {
13111 if (newLevel != oldLevel)
13112 {
13114 }
13115 }
13116
13118 {
13119 SetWeightDirty();
13120 }
13121
13123 {
13124 return GetWetLevelInternal(
m_VarWet);
13125 }
13126
13127
13128
13130 {
13132 }
13133
13135 {
13137 }
13138
13140 {
13142 }
13143
13145 {
13147 }
13148
13149
13150
13152 {
13153 if (ConfigIsExisting("itemModelLength"))
13154 {
13155 return ConfigGetFloat("itemModelLength");
13156 }
13157 return 0;
13158 }
13159
13161 {
13162 if (ConfigIsExisting("itemAttachOffset"))
13163 {
13164 return ConfigGetFloat("itemAttachOffset");
13165 }
13166 return 0;
13167 }
13168
13169 override void SetCleanness(
int value,
bool allow_client =
false)
13170 {
13171 if (!IsServerCheck(allow_client))
13172 return;
13173
13175
13177
13180 }
13181
13183 {
13185 }
13186
13188 {
13189 return true;
13190 }
13191
13192
13193
13194
13196 {
13198 }
13199
13201 {
13203 }
13204
13205
13206
13207
13208 override void SetColor(
int r,
int g,
int b,
int a)
13209 {
13215 }
13217 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13218 {
13223 }
13224
13226 {
13228 }
13229
13232 {
13233 int r,g,b,a;
13235 r = r/255;
13236 g = g/255;
13237 b = b/255;
13238 a = a/255;
13239 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13240 }
13241
13242
13243
13244 override void SetLiquidType(
int value,
bool allow_client =
false)
13245 {
13246 if (!IsServerCheck(allow_client))
13247 return;
13248
13253 }
13254
13256 {
13257 return ConfigGetInt("varLiquidTypeInit");
13258 }
13259
13261 {
13263 }
13264
13266 {
13268 SetFrozen(false);
13269 }
13270
13273 {
13274 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13275 }
13276
13277
13280 {
13281 PlayerBase nplayer;
13282 if (PlayerBase.CastTo(nplayer, player))
13283 {
13285
13286 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13287 }
13288 }
13289
13290
13293 {
13294 PlayerBase nplayer;
13295 if (PlayerBase.CastTo(nplayer,player))
13296 {
13297
13298 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13299
13300 }
13301
13302
13303 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13304
13305
13306 if (HasEnergyManager())
13307 {
13308 GetCompEM().UpdatePlugState();
13309 }
13310 }
13311
13312
13314 {
13315 super.OnPlacementStarted(player);
13316
13318 }
13319
13320 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13321 {
13323 {
13324 m_AdminLog.OnPlacementComplete(player,
this);
13325 }
13326
13327 super.OnPlacementComplete(player, position, orientation);
13328 }
13329
13330
13331
13332
13333
13335 {
13337 {
13338 return true;
13339 }
13340 else
13341 {
13342 return false;
13343 }
13344 }
13345
13346
13348 {
13350 {
13352 }
13353 }
13354
13355
13357 {
13359 }
13360
13362 {
13364 }
13365
13366 override void InsertAgent(
int agent,
float count = 1)
13367 {
13368 if (count < 1)
13369 return;
13370
13372 }
13373
13376 {
13378 }
13379
13380
13382 {
13384 }
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13428 {
13430 return false;
13431 return true;
13432 }
13433
13435 {
13436
13438 }
13439
13440
13443 {
13444 super.CheckForRoofLimited(timeTresholdMS);
13445
13447 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13448 {
13449 m_PreviousRoofTestTime = time;
13450 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13451 }
13452 }
13453
13454
13456 {
13458 {
13459 return 0;
13460 }
13461
13462 if (GetInventory().GetAttachmentSlotsCount() != 0)
13463 {
13464 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13465 if (filter)
13466 return filter.GetProtectionLevel(type, false, system);
13467 else
13468 return 0;
13469 }
13470
13471 string subclassPath, entryName;
13472
13473 switch (type)
13474 {
13476 entryName = "biological";
13477 break;
13479 entryName = "chemical";
13480 break;
13481 default:
13482 entryName = "biological";
13483 break;
13484 }
13485
13486 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13487
13489 }
13490
13491
13492
13495 {
13496 if (!IsMagazine())
13498
13500 }
13501
13502
13503
13504
13505
13510 {
13511 return true;
13512 }
13513
13515 {
13517 }
13518
13519
13520
13521
13522
13524 {
13525 if (parent)
13526 {
13527 if (parent.IsInherited(DayZInfected))
13528 return true;
13529
13530 if (!parent.IsRuined())
13531 return true;
13532 }
13533
13534 return true;
13535 }
13536
13538 {
13539 if (!super.CanPutAsAttachment(parent))
13540 {
13541 return false;
13542 }
13543
13544 if (!IsRuined() && !parent.IsRuined())
13545 {
13546 return true;
13547 }
13548
13549 return false;
13550 }
13551
13553 {
13554
13555
13556
13557
13558 return super.CanReceiveItemIntoCargo(item);
13559 }
13560
13562 {
13563
13564
13565
13566
13567 GameInventory attachmentInv = attachment.GetInventory();
13569 {
13570 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13571 return false;
13572 }
13573
13574 InventoryLocation loc = new InventoryLocation();
13575 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13576 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13577 return false;
13578
13579 return super.CanReceiveAttachment(attachment, slotId);
13580 }
13581
13583 {
13584 if (!super.CanReleaseAttachment(attachment))
13585 return false;
13586
13587 return GetInventory().AreChildrenAccessible();
13588 }
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13611 {
13612 int id = muzzle_owner.GetMuzzleID();
13613 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13614
13615 if (WPOF_array)
13616 {
13617 for (int i = 0; i < WPOF_array.Count(); i++)
13618 {
13619 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13620
13621 if (WPOF)
13622 {
13623 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13624 }
13625 }
13626 }
13627 }
13628
13629
13631 {
13632 int id = muzzle_owner.GetMuzzleID();
13634
13635 if (WPOBE_array)
13636 {
13637 for (int i = 0; i < WPOBE_array.Count(); i++)
13638 {
13639 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13640
13641 if (WPOBE)
13642 {
13643 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13644 }
13645 }
13646 }
13647 }
13648
13649
13651 {
13652 int id = muzzle_owner.GetMuzzleID();
13653 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13654
13655 if (WPOOH_array)
13656 {
13657 for (int i = 0; i < WPOOH_array.Count(); i++)
13658 {
13659 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13660
13661 if (WPOOH)
13662 {
13663 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13664 }
13665 }
13666 }
13667 }
13668
13669
13671 {
13672 int id = muzzle_owner.GetMuzzleID();
13673 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13674
13675 if (WPOOH_array)
13676 {
13677 for (int i = 0; i < WPOOH_array.Count(); i++)
13678 {
13679 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13680
13681 if (WPOOH)
13682 {
13683 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13684 }
13685 }
13686 }
13687 }
13688
13689
13691 {
13692 int id = muzzle_owner.GetMuzzleID();
13693 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13694
13695 if (WPOOH_array)
13696 {
13697 for (int i = 0; i < WPOOH_array.Count(); i++)
13698 {
13699 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13700
13701 if (WPOOH)
13702 {
13703 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13704 }
13705 }
13706 }
13707 }
13708
13709
13710
13712 {
13714 {
13715 return true;
13716 }
13717
13718 return false;
13719 }
13720
13722 {
13724 {
13725 return true;
13726 }
13727
13728 return false;
13729 }
13730
13732 {
13734 {
13735 return true;
13736 }
13737
13738 return false;
13739 }
13740
13742 {
13743 return false;
13744 }
13745
13748 {
13749 return UATimeSpent.DEFAULT_DEPLOY;
13750 }
13751
13752
13753
13754
13756 {
13758 SetSynchDirty();
13759 }
13760
13762 {
13764 }
13765
13766
13768 {
13769 return false;
13770 }
13771
13774 {
13775 string att_type = "None";
13776
13777 if (ConfigIsExisting("soundAttType"))
13778 {
13779 att_type = ConfigGetString("soundAttType");
13780 }
13781
13783 }
13784
13786 {
13788 }
13789
13790
13791
13792
13793
13797
13799 {
13802
13804 }
13805
13806
13808 {
13810 return;
13811
13813
13816
13819
13820 SoundParameters params = new SoundParameters();
13824 }
13825
13826
13828 {
13830 return;
13831
13833 SetSynchDirty();
13834
13837 }
13838
13839
13841 {
13843 return;
13844
13846 SetSynchDirty();
13847
13850 }
13851
13853 {
13855 }
13856
13858 {
13860 }
13861
13864 {
13865 if (!
GetGame().IsDedicatedServer())
13866 {
13867 if (ConfigIsExisting("attachSoundSet"))
13868 {
13869 string cfg_path = "";
13870 string soundset = "";
13871 string type_name =
GetType();
13872
13875 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13876 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13877
13878 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13879 {
13880 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13881 {
13882 if (cfg_slot_array[i] == slot_type)
13883 {
13884 soundset = cfg_soundset_array[i];
13885 break;
13886 }
13887 }
13888 }
13889
13890 if (soundset != "")
13891 {
13892 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13894 }
13895 }
13896 }
13897 }
13898
13900 {
13901
13902 }
13903
13904 void OnApply(PlayerBase player);
13905
13907 {
13908 return 1.0;
13909 };
13910
13912 {
13914 }
13915
13917 {
13919 }
13920
13922
13924 {
13925 SetDynamicPhysicsLifeTime(0.01);
13927 }
13928
13930 {
13931 array<string> zone_names = new array<string>;
13932 GetDamageZones(zone_names);
13933 for (int i = 0; i < zone_names.Count(); i++)
13934 {
13935 SetHealthMax(zone_names.Get(i),"Health");
13936 }
13937 SetHealthMax("","Health");
13938 }
13939
13942 {
13943 float global_health = GetHealth01("","Health");
13944 array<string> zones = new array<string>;
13945 GetDamageZones(zones);
13946
13947 for (int i = 0; i < zones.Count(); i++)
13948 {
13949 SetHealth01(zones.Get(i),"Health",global_health);
13950 }
13951 }
13952
13955 {
13956 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13957 }
13958
13960 {
13961 if (!hasRootAsPlayer)
13962 {
13963 if (refParentIB)
13964 {
13965
13966 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13967 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13968
13969 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13970 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13971
13974 }
13975 else
13976 {
13977
13980 }
13981 }
13982 }
13983
13985 {
13987 {
13988 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13989 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13990 {
13991 float heatPermCoef = 1.0;
13993 while (ent)
13994 {
13995 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13996 ent = ent.GetHierarchyParent();
13997 }
13998
13999 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14000 }
14001 }
14002 }
14003
14005 {
14006
14007 EntityAI parent = GetHierarchyParent();
14008 if (!parent)
14009 {
14010 hasParent = false;
14011 hasRootAsPlayer = false;
14012 }
14013 else
14014 {
14015 hasParent = true;
14016 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14017 refParentIB =
ItemBase.Cast(parent);
14018 }
14019 }
14020
14021 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14022 {
14023
14024 }
14025
14027 {
14028
14029 return false;
14030 }
14031
14033 {
14034
14035
14036 return false;
14037 }
14038
14040 {
14041
14042 return false;
14043 }
14044
14047 {
14048 return !GetIsFrozen() &&
IsOpen();
14049 }
14050
14052 {
14053 bool hasParent = false, hasRootAsPlayer = false;
14055
14056 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14057 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14058
14059 if (wwtu || foodDecay)
14060 {
14064
14065 if (processWetness || processTemperature || processDecay)
14066 {
14068
14069 if (processWetness)
14070 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14071
14072 if (processTemperature)
14074
14075 if (processDecay)
14076 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14077 }
14078 }
14079 }
14080
14083 {
14085 }
14086
14088 {
14091
14092 return super.GetTemperatureFreezeThreshold();
14093 }
14094
14096 {
14099
14100 return super.GetTemperatureThawThreshold();
14101 }
14102
14104 {
14107
14108 return super.GetItemOverheatThreshold();
14109 }
14110
14112 {
14114 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14115
14116 return super.GetTemperatureFreezeTime();
14117 }
14118
14120 {
14122 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14123
14124 return super.GetTemperatureThawTime();
14125 }
14126
14131
14133 {
14134 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14135 }
14136
14138 {
14139 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14140 }
14141
14144 {
14146 }
14147
14149 {
14151 }
14152
14154 {
14156 }
14157
14160 {
14161 return null;
14162 }
14163
14166 {
14167 return false;
14168 }
14169
14171 {
14173 {
14176 if (!trg)
14177 {
14179 explosive = this;
14180 }
14181
14182 explosive.PairRemote(trg);
14184
14185 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14186 trg.SetPersistentPairID(persistentID);
14187 explosive.SetPersistentPairID(persistentID);
14188
14189 return true;
14190 }
14191 return false;
14192 }
14193
14196 {
14197 float ret = 1.0;
14200 ret *= GetHealth01();
14201
14202 return ret;
14203 }
14204
14205 #ifdef DEVELOPER
14206 override void SetDebugItem()
14207 {
14208 super.SetDebugItem();
14209 _itemBase = this;
14210 }
14211
14213 {
14214 string text = super.GetDebugText();
14215
14217 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14218
14219 return text;
14220 }
14221 #endif
14222
14224 {
14225 return true;
14226 }
14227
14229
14231
14233 {
14236 }
14237
14238
14246
14262}
14263
14265{
14267 if (entity)
14268 {
14269 bool is_item = entity.IsInherited(
ItemBase);
14270 if (is_item && full_quantity)
14271 {
14274 }
14275 }
14276 else
14277 {
14279 return NULL;
14280 }
14281 return entity;
14282}
14283
14285{
14286 if (item)
14287 {
14288 if (health > 0)
14289 item.SetHealth("", "", health);
14290
14291 if (item.CanHaveTemperature())
14292 {
14294 if (item.CanFreeze())
14295 item.SetFrozen(false);
14296 }
14297
14298 if (item.HasEnergyManager())
14299 {
14300 if (quantity >= 0)
14301 {
14302 item.GetCompEM().SetEnergy0To1(quantity);
14303 }
14304 else
14305 {
14307 }
14308 }
14309 else if (item.IsMagazine())
14310 {
14311 Magazine mag = Magazine.Cast(item);
14312 if (quantity >= 0)
14313 {
14314 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14315 }
14316 else
14317 {
14319 }
14320
14321 }
14322 else
14323 {
14324 if (quantity >= 0)
14325 {
14326 item.SetQuantityNormalized(quantity, false);
14327 }
14328 else
14329 {
14331 }
14332
14333 }
14334 }
14335}
14336
14337#ifdef DEVELOPER
14339#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.