9439{
9441 {
9442 return true;
9443 }
9444};
9445
9446
9447
9449{
9453
9455
9458
9459
9460
9461
9462
9471
9477
9482
9487
9508 protected bool m_IsResultOfSplit
9509
9511
9516
9517
9518
9520
9524
9525
9526
9528
9531
9532
9533
9539
9540
9548
9551
9552
9554
9555
9557
9558
9563
9564
9569
9570
9572
9573
9575 {
9580
9581 if (!
GetGame().IsDedicatedServer())
9582 {
9584 {
9586
9588 {
9590 }
9591 }
9592
9595 }
9596
9597 m_OldLocation = null;
9598
9600 {
9602 }
9603
9604 if (ConfigIsExisting("headSelectionsToHide"))
9605 {
9608 }
9609
9611 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9612 {
9614 }
9615
9617
9618 m_IsResultOfSplit = false;
9619
9621 }
9622
9624 {
9625 super.InitItemVariables();
9626
9632 m_Count = ConfigGetInt(
"count");
9633
9636
9641
9644
9649
9661
9665
9666
9669 if (ConfigIsExisting("canBeSplit"))
9670 {
9673 }
9674
9676 if (ConfigIsExisting("itemBehaviour"))
9678
9679
9682 RegisterNetSyncVariableInt("m_VarLiquidType");
9683 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9684
9685 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9686 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9687 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9688
9689 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9690 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9691 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9692 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9693
9694 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9695 RegisterNetSyncVariableBool("m_IsTakeable");
9696 RegisterNetSyncVariableBool("m_IsHologram");
9697
9700 {
9703 }
9704
9706
9708 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9710
9711 }
9712
9714 {
9716 }
9717
9719 {
9722 {
9727 }
9728 }
9729
9730 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9731 {
9733 {
9736 }
9737
9739 }
9740
9742 {
9748 }
9749
9751
9753 {
9755
9756 if (!action)
9757 {
9758 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9759 return;
9760 }
9761
9763 if (!ai)
9764 {
9766 return;
9767 }
9768
9770 if (!action_array)
9771 {
9772 action_array = new array<ActionBase_Basic>;
9774 }
9775 if (LogManager.IsActionLogEnable())
9776 {
9777 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9778 }
9779
9780 if (action_array.Find(action) != -1)
9781 {
9782 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9783 }
9784 else
9785 {
9786 action_array.Insert(action);
9787 }
9788 }
9789
9791 {
9793 ActionBase action = player.GetActionManager().GetAction(actionName);
9796
9797 if (action_array)
9798 {
9799 action_array.RemoveItem(action);
9800 }
9801 }
9802
9803
9804
9806 {
9807 ActionOverrideData overrideData = new ActionOverrideData();
9811
9813 if (!actionMap)
9814 {
9817 }
9818
9819 actionMap.Insert(this.
Type(), overrideData);
9820
9821 }
9822
9824
9826
9827
9829 {
9832
9835
9836 string config_to_search = "CfgVehicles";
9837 string muzzle_owner_config;
9838
9840 {
9841 if (IsInherited(Weapon))
9842 config_to_search = "CfgWeapons";
9843
9844 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9845
9846 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9847
9849
9850 if (config_OnFire_subclass_count > 0)
9851 {
9852 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9853
9854 for (int i = 0; i < config_OnFire_subclass_count; i++)
9855 {
9856 string particle_class = "";
9858 string config_OnFire_entry = config_OnFire_class + particle_class;
9859 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9860 WPOF_array.Insert(WPOF);
9861 }
9862
9863
9865 }
9866 }
9867
9869 {
9870 config_to_search = "CfgWeapons";
9871 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9872
9873 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9874
9876
9877 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9878 {
9879 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9880
9881 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9882 {
9883 string particle_class2 = "";
9885 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9886 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9887 WPOBE_array.Insert(WPOBE);
9888 }
9889
9890
9892 }
9893 }
9894 }
9895
9896
9898 {
9901
9903 {
9904 string config_to_search = "CfgVehicles";
9905
9906 if (IsInherited(Weapon))
9907 config_to_search = "CfgWeapons";
9908
9909 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9910 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9911
9912 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9913 {
9914
9916
9918 {
9920 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9922 return;
9923 }
9924
9927
9928
9929
9931 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9932
9933 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9934 {
9935 string particle_class = "";
9937 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9939
9940 if (entry_type == CT_CLASS)
9941 {
9942 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9943 WPOOH_array.Insert(WPOF);
9944 }
9945 }
9946
9947
9949 }
9950 }
9951 }
9952
9954 {
9956 }
9957
9959 {
9961 {
9963
9966
9969
9970 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9971 }
9972 }
9973
9975 {
9977 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9978
9980 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9981
9983 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9984
9986 {
9988 }
9989 }
9990
9992 {
9994 }
9995
9997 {
10000 else
10002
10004 {
10007 }
10008 else
10009 {
10012
10015 }
10016
10018 }
10019
10021 {
10023 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10024 }
10025
10027 {
10029 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10031 }
10032
10034 {
10036 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10037 }
10038
10040 {
10043
10044 OverheatingParticle OP = new OverheatingParticle();
10049
10051 }
10052
10054 {
10057
10058 return -1;
10059 }
10060
10062 {
10064 {
10067
10068 for (int i = count; i > 0; --i)
10069 {
10070 int id = i - 1;
10073
10076
10077 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10078 {
10079 if (p)
10080 {
10083 }
10084 }
10085 }
10086 }
10087 }
10088
10090 {
10092 {
10094 {
10095 int id = i - 1;
10097
10098 if (OP)
10099 {
10101
10102 if (p)
10103 {
10105 }
10106
10107 delete OP;
10108 }
10109 }
10110
10113 }
10114 }
10115
10118 {
10119 return 0.0;
10120 }
10121
10122
10124 {
10125 return 250;
10126 }
10127
10129 {
10130 return 0;
10131 }
10132
10135 {
10137 return true;
10138
10139 return false;
10140 }
10141
10144 {
10147
10149 {
10151 }
10152 else
10153 {
10154
10156 }
10157
10159 }
10160
10167 {
10168 return -1;
10169 }
10170
10171
10172
10173
10175 {
10177 {
10179 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10180
10181 if (r_index >= 0)
10182 {
10183 InventoryLocation r_il = new InventoryLocation;
10184 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10185
10186 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10189 {
10190 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10191 }
10193 {
10194 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10195 }
10196
10197 }
10198
10199 player.GetHumanInventory().ClearUserReservedLocation(this);
10200 }
10201
10204 }
10205
10206
10207
10208
10210 {
10211 return ItemBase.m_DebugActionsMask;
10212 }
10213
10215 {
10216 return ItemBase.m_DebugActionsMask & mask;
10217 }
10218
10220 {
10221 ItemBase.m_DebugActionsMask = mask;
10222 }
10223
10225 {
10226 ItemBase.m_DebugActionsMask |= mask;
10227 }
10228
10230 {
10231 ItemBase.m_DebugActionsMask &= ~mask;
10232 }
10233
10235 {
10237 {
10239 }
10240 else
10241 {
10243 }
10244 }
10245
10246
10248 {
10249 if (GetEconomyProfile())
10250 {
10251 float q_max = GetEconomyProfile().GetQuantityMax();
10252 if (q_max > 0)
10253 {
10254 float q_min = GetEconomyProfile().GetQuantityMin();
10255 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10256
10258 {
10259 ComponentEnergyManager comp = GetCompEM();
10261 {
10263 }
10264 }
10266 {
10268
10269 }
10270
10271 }
10272 }
10273 }
10274
10277 {
10278 EntityAI parent = GetHierarchyParent();
10279
10280 if (parent)
10281 {
10282 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10283 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10284 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10285 }
10286 }
10287
10290 {
10291 EntityAI parent = GetHierarchyParent();
10292
10293 if (parent)
10294 {
10295 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10296 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10297 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10298 }
10299 }
10300
10302 {
10303
10304
10305
10306
10308
10310 {
10311 if (ScriptInputUserData.CanStoreInputUserData())
10312 {
10313 ScriptInputUserData ctx = new ScriptInputUserData;
10319 ctx.
Write(use_stack_max);
10322
10324 {
10325 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10326 }
10327 }
10328 }
10329 else if (!
GetGame().IsMultiplayer())
10330 {
10332 }
10333 }
10334
10336 {
10338 }
10339
10341 {
10343 }
10344
10346 {
10348 }
10349
10351 {
10352
10353 return false;
10354 }
10355
10357 {
10358 return false;
10359 }
10360
10364 {
10365 return false;
10366 }
10367
10369 {
10370 return "";
10371 }
10372
10374
10376 {
10377 return false;
10378 }
10379
10381 {
10382 return true;
10383 }
10384
10385
10386
10388 {
10389 return true;
10390 }
10391
10393 {
10394 return true;
10395 }
10396
10398 {
10399 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10401 }
10402
10404 {
10406 }
10407
10409 {
10411 if (!is_being_placed)
10413 SetSynchDirty();
10414 }
10415
10416
10418
10420 {
10422 }
10423
10425 {
10427 }
10428
10430 {
10431 return 1;
10432 }
10433
10435 {
10436 return false;
10437 }
10438
10440 {
10442 SetSynchDirty();
10443 }
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10480 {
10481 super.OnMovedInsideCargo(container);
10482
10483 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10484 }
10485
10486 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10487 {
10488 super.EEItemLocationChanged(oldLoc,newLoc);
10489
10490 PlayerBase new_player = null;
10491 PlayerBase old_player = null;
10492
10493 if (newLoc.GetParent())
10494 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10495
10496 if (oldLoc.GetParent())
10497 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10498
10500 {
10501 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10502
10503 if (r_index >= 0)
10504 {
10505 InventoryLocation r_il = new InventoryLocation;
10506 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10507
10508 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10511 {
10512 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10513 }
10515 {
10516 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10517 }
10518
10519 }
10520 }
10521
10523 {
10524 if (new_player)
10525 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10526
10527 if (new_player == old_player)
10528 {
10529
10530 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10531 {
10533 {
10534 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10535 {
10536 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10537 }
10538 }
10539 else
10540 {
10541 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10542 }
10543 }
10544
10545 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10546 {
10547 int type = oldLoc.GetType();
10549 {
10550 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10551 }
10553 {
10554 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10555 }
10556 }
10557 if (!m_OldLocation)
10558 {
10559 m_OldLocation = new InventoryLocation;
10560 }
10561 m_OldLocation.Copy(oldLoc);
10562 }
10563 else
10564 {
10565 if (m_OldLocation)
10566 {
10567 m_OldLocation.Reset();
10568 }
10569 }
10570
10572 }
10573 else
10574 {
10575 if (new_player)
10576 {
10577 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10578 if (res_index >= 0)
10579 {
10580 InventoryLocation il = new InventoryLocation;
10581 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10583 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10586 {
10587 il.
GetParent().GetOnReleaseLock().Invoke(it);
10588 }
10590 {
10592 }
10593
10594 }
10595 }
10597 {
10598
10600 }
10601
10602 if (m_OldLocation)
10603 {
10604 m_OldLocation.Reset();
10605 }
10606 }
10607 }
10608
10609 override void EOnContact(IEntity other, Contact extra)
10610 {
10612 {
10613 int liquidType = -1;
10615 if (impactSpeed > 0.0)
10616 {
10618 #ifndef SERVER
10620 #else
10622 SetSynchDirty();
10623 #endif
10625 }
10626 }
10627
10628 #ifdef SERVER
10629 if (GetCompEM() && GetCompEM().IsPlugged())
10630 {
10631 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10632 GetCompEM().UnplugThis();
10633 }
10634 #endif
10635 }
10636
10638
10640 {
10642 }
10643
10645 {
10646
10647 }
10648
10650 {
10651 super.OnItemLocationChanged(old_owner, new_owner);
10652
10653 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10654 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10655
10656 if (!relatedPlayer && playerNew)
10657 relatedPlayer = playerNew;
10658
10659 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10660 {
10662 if (actionMgr)
10663 {
10664 ActionBase currentAction = actionMgr.GetRunningAction();
10665 if (currentAction)
10667 }
10668 }
10669
10670 Man ownerPlayerOld = null;
10671 Man ownerPlayerNew = null;
10672
10673 if (old_owner)
10674 {
10675 if (old_owner.
IsMan())
10676 {
10677 ownerPlayerOld = Man.Cast(old_owner);
10678 }
10679 else
10680 {
10681 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10682 }
10683 }
10684 else
10685 {
10687 {
10689
10690 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10691 {
10692 GetCompEM().UnplugThis();
10693 }
10694 }
10695 }
10696
10697 if (new_owner)
10698 {
10699 if (new_owner.
IsMan())
10700 {
10701 ownerPlayerNew = Man.Cast(new_owner);
10702 }
10703 else
10704 {
10705 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10706 }
10707 }
10708
10709 if (ownerPlayerOld != ownerPlayerNew)
10710 {
10711 if (ownerPlayerOld)
10712 {
10713 array<EntityAI> subItemsExit = new array<EntityAI>;
10715 for (int i = 0; i < subItemsExit.Count(); i++)
10716 {
10719 }
10720 }
10721
10722 if (ownerPlayerNew)
10723 {
10724 array<EntityAI> subItemsEnter = new array<EntityAI>;
10726 for (int j = 0; j < subItemsEnter.Count(); j++)
10727 {
10730 }
10731 }
10732 }
10733 else if (ownerPlayerNew != null)
10734 {
10735 PlayerBase nplayer;
10736 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10737 {
10738 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10740 for (int k = 0; k < subItemsUpdate.Count(); k++)
10741 {
10743 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10744 }
10745 }
10746 }
10747
10748 if (old_owner)
10749 old_owner.OnChildItemRemoved(this);
10750 if (new_owner)
10751 new_owner.OnChildItemReceived(this);
10752 }
10753
10754
10756 {
10757 super.EEDelete(parent);
10758 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10759 if (player)
10760 {
10762
10763 if (player.IsAlive())
10764 {
10765 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10766 if (r_index >= 0)
10767 {
10768 InventoryLocation r_il = new InventoryLocation;
10769 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10770
10771 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10774 {
10775 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10776 }
10778 {
10779 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10780 }
10781
10782 }
10783
10784 player.RemoveQuickBarEntityShortcut(this);
10785 }
10786 }
10787 }
10788
10790 {
10791 super.EEKilled(killer);
10792
10795 {
10796 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10797 {
10798 if (IsMagazine())
10799 {
10800 if (Magazine.Cast(this).GetAmmoCount() > 0)
10801 {
10803 }
10804 }
10805 else
10806 {
10808 }
10809 }
10810 }
10811 }
10812
10814 {
10815 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10816
10817 super.OnWasAttached(parent, slot_id);
10818
10821
10823 }
10824
10826 {
10827 super.OnWasDetached(parent, slot_id);
10828
10831 }
10832
10834 {
10835 int idx;
10838
10839 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10840 if (inventory_slots.Count() < 1)
10841 {
10842 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10843 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10844 }
10845 else
10846 {
10847 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10848 }
10849
10850 idx = inventory_slots.Find(slot);
10851 if (idx < 0)
10852 return "";
10853
10854 return attach_types.Get(idx);
10855 }
10856
10858 {
10859 int idx = -1;
10860 string slot;
10861
10864
10865 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10866 if (inventory_slots.Count() < 1)
10867 {
10868 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10869 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10870 }
10871 else
10872 {
10873 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10874 if (detach_types.Count() < 1)
10875 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10876 }
10877
10878 for (int i = 0; i < inventory_slots.Count(); i++)
10879 {
10880 slot = inventory_slots.Get(i);
10881 }
10882
10883 if (slot != "")
10884 {
10885 if (detach_types.Count() == 1)
10886 idx = 0;
10887 else
10888 idx = inventory_slots.Find(slot);
10889 }
10890 if (idx < 0)
10891 return "";
10892
10893 return detach_types.Get(idx);
10894 }
10895
10897 {
10898
10900
10901
10902 float min_time = 1;
10903 float max_time = 3;
10904 float delay = Math.RandomFloat(min_time, max_time);
10905
10906 explode_timer.Run(delay, this, "DoAmmoExplosion");
10907 }
10908
10910 {
10911 Magazine magazine = Magazine.Cast(this);
10912 int pop_sounds_count = 6;
10913 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10914
10915
10916 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10917 string sound_name = pop_sounds[ sound_idx ];
10919
10920
10921 magazine.ServerAddAmmoCount(-1);
10922
10923
10924 float min_temp_to_explode = 100;
10925
10926 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10927 {
10929 }
10930 }
10931
10932
10933 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10934 {
10935 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10936
10937 const int CHANCE_DAMAGE_CARGO = 4;
10938 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10939 const int CHANCE_DAMAGE_NOTHING = 2;
10940
10942 {
10943 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10944 int chances;
10945 int rnd;
10946
10947 if (GetInventory().GetCargo())
10948 {
10949 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10950 rnd = Math.RandomInt(0,chances);
10951
10952 if (rnd < CHANCE_DAMAGE_CARGO)
10953 {
10955 }
10956 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10957 {
10959 }
10960 }
10961 else
10962 {
10963 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10964 rnd = Math.RandomInt(0,chances);
10965
10966 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10967 {
10969 }
10970 }
10971 }
10972 }
10973
10975 {
10976 if (GetInventory().GetCargo())
10977 {
10978 int item_count = GetInventory().GetCargo().GetItemCount();
10979 if (item_count > 0)
10980 {
10981 int random_pick = Math.RandomInt(0, item_count);
10983 if (!item.IsExplosive())
10984 {
10985 item.AddHealth("","",damage);
10986 return true;
10987 }
10988 }
10989 }
10990 return false;
10991 }
10992
10994 {
10995 int attachment_count = GetInventory().AttachmentCount();
10996 if (attachment_count > 0)
10997 {
10998 int random_pick = Math.RandomInt(0, attachment_count);
10999 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11000 if (!attachment.IsExplosive())
11001 {
11002 attachment.AddHealth("","",damage);
11003 return true;
11004 }
11005 }
11006 return false;
11007 }
11008
11010 {
11012 }
11013
11015 {
11017 return GetInventory().CanRemoveEntity();
11018
11019 return false;
11020 }
11021
11023 {
11025 return;
11026
11028 {
11029 if (ScriptInputUserData.CanStoreInputUserData())
11030 {
11031 ScriptInputUserData ctx = new ScriptInputUserData;
11036 ctx.
Write(destination_entity);
11038 ctx.
Write(slot_id);
11040 }
11041 }
11042 else if (!
GetGame().IsMultiplayer())
11043 {
11045 }
11046 }
11047
11049 {
11051 return;
11052
11053 float split_quantity_new;
11057 InventoryLocation loc = new InventoryLocation;
11058
11059 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11060 {
11062 split_quantity_new = stack_max;
11063 else
11065
11066 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11067 if (new_item)
11068 {
11069 new_item.SetResultOfSplit(true);
11070 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11072 new_item.SetQuantity(split_quantity_new);
11073 }
11074 }
11075 else if (destination_entity && slot_id == -1)
11076 {
11077 if (quantity > stack_max)
11078 split_quantity_new = stack_max;
11079 else
11080 split_quantity_new = quantity;
11081
11083 {
11086 }
11087
11088 if (new_item)
11089 {
11090 new_item.SetResultOfSplit(true);
11091 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11093 new_item.SetQuantity(split_quantity_new);
11094 }
11095 }
11096 else
11097 {
11098 if (stack_max != 0)
11099 {
11101 {
11103 }
11104
11105 if (split_quantity_new == 0)
11106 {
11107 if (!
GetGame().IsMultiplayer())
11108 player.PhysicalPredictiveDropItem(this);
11109 else
11110 player.ServerDropEntity(this);
11111 return;
11112 }
11113
11115
11116 if (new_item)
11117 {
11118 new_item.SetResultOfSplit(true);
11119 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11121 new_item.SetQuantity(stack_max);
11122 new_item.PlaceOnSurface();
11123 }
11124 }
11125 }
11126 }
11127
11129 {
11131 return;
11132
11133 float split_quantity_new;
11137 InventoryLocation loc = new InventoryLocation;
11138
11139 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11140 {
11142 split_quantity_new = stack_max;
11143 else
11145
11146 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11147 if (new_item)
11148 {
11149 new_item.SetResultOfSplit(true);
11150 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11152 new_item.SetQuantity(split_quantity_new);
11153 }
11154 }
11155 else if (destination_entity && slot_id == -1)
11156 {
11157 if (quantity > stack_max)
11158 split_quantity_new = stack_max;
11159 else
11160 split_quantity_new = quantity;
11161
11163 {
11166 }
11167
11168 if (new_item)
11169 {
11170 new_item.SetResultOfSplit(true);
11171 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11173 new_item.SetQuantity(split_quantity_new);
11174 }
11175 }
11176 else
11177 {
11178 if (stack_max != 0)
11179 {
11181 {
11183 }
11184
11186
11187 if (new_item)
11188 {
11189 new_item.SetResultOfSplit(true);
11190 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11192 new_item.SetQuantity(stack_max);
11193 new_item.PlaceOnSurface();
11194 }
11195 }
11196 }
11197 }
11198
11200 {
11202 return;
11203
11205 {
11206 if (ScriptInputUserData.CanStoreInputUserData())
11207 {
11208 ScriptInputUserData ctx = new ScriptInputUserData;
11213 dst.WriteToContext(ctx);
11215 }
11216 }
11217 else if (!
GetGame().IsMultiplayer())
11218 {
11220 }
11221 }
11222
11224 {
11226 return;
11227
11229 {
11230 if (ScriptInputUserData.CanStoreInputUserData())
11231 {
11232 ScriptInputUserData ctx = new ScriptInputUserData;
11237 ctx.
Write(destination_entity);
11243 }
11244 }
11245 else if (!
GetGame().IsMultiplayer())
11246 {
11248 }
11249 }
11250
11252 {
11254 }
11255
11257 {
11259 return this;
11260
11262 float split_quantity_new;
11264 if (dst.IsValid())
11265 {
11266 int slot_id = dst.GetSlot();
11268
11269 if (quantity > stack_max)
11270 split_quantity_new = stack_max;
11271 else
11272 split_quantity_new = quantity;
11273
11275
11276 if (new_item)
11277 {
11278 new_item.SetResultOfSplit(true);
11279 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11282 }
11283
11284 return new_item;
11285 }
11286
11287 return null;
11288 }
11289
11291 {
11293 return;
11294
11296 float split_quantity_new;
11298 if (destination_entity)
11299 {
11301 if (quantity > stackable)
11302 split_quantity_new = stackable;
11303 else
11304 split_quantity_new = quantity;
11305
11306 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11307 if (new_item)
11308 {
11309 new_item.SetResultOfSplit(true);
11310 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11312 new_item.SetQuantity(split_quantity_new);
11313 }
11314 }
11315 }
11316
11318 {
11320 return;
11321
11323 {
11324 if (ScriptInputUserData.CanStoreInputUserData())
11325 {
11326 ScriptInputUserData ctx = new ScriptInputUserData;
11331 ItemBase destination_entity =
this;
11332 ctx.
Write(destination_entity);
11336 }
11337 }
11338 else if (!
GetGame().IsMultiplayer())
11339 {
11341 }
11342 }
11343
11345 {
11347 return;
11348
11350 float split_quantity_new;
11352 if (player)
11353 {
11355 if (quantity > stackable)
11356 split_quantity_new = stackable;
11357 else
11358 split_quantity_new = quantity;
11359
11360 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11361 new_item =
ItemBase.Cast(in_hands);
11362 if (new_item)
11363 {
11364 new_item.SetResultOfSplit(true);
11365 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11367 new_item.SetQuantity(split_quantity_new);
11368 }
11369 }
11370 }
11371
11373 {
11375 return;
11376
11378 float split_quantity_new = Math.Floor(quantity * 0.5);
11379
11381
11382 if (new_item)
11383 {
11384 if (new_item.GetQuantityMax() < split_quantity_new)
11385 {
11386 split_quantity_new = new_item.GetQuantityMax();
11387 }
11388
11389 new_item.SetResultOfSplit(true);
11390 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11391
11393 {
11396 }
11397 else
11398 {
11401 }
11402 }
11403 }
11404
11406 {
11408 return;
11409
11411 float split_quantity_new = Math.Floor(quantity / 2);
11412
11413 InventoryLocation invloc = new InventoryLocation;
11415
11417 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11418
11419 if (new_item)
11420 {
11421 if (new_item.GetQuantityMax() < split_quantity_new)
11422 {
11423 split_quantity_new = new_item.GetQuantityMax();
11424 }
11426 {
11429 }
11430 else
11431 {
11434 }
11435 }
11436 }
11437
11440 {
11441 SetWeightDirty();
11443
11444 if (parent)
11445 parent.OnAttachmentQuantityChangedEx(this, delta);
11446
11448 {
11450 {
11452 }
11454 {
11455 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11457 }
11458 }
11459
11460 }
11461
11464 {
11465
11466 }
11467
11470 {
11472 }
11473
11475 {
11476 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11477
11479 {
11480 if (newLevel == GameConstants.STATE_RUINED)
11481 {
11483 EntityAI parent = GetHierarchyParent();
11484 if (parent && parent.IsFireplace())
11485 {
11486 CargoBase cargo = GetInventory().GetCargo();
11487 if (cargo)
11488 {
11490 {
11492 }
11493 }
11494 }
11495 }
11496
11498 {
11499
11501 return;
11502 }
11503
11504 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11505 {
11507 }
11508 }
11509 }
11510
11511
11513 {
11514 super.OnRightClick();
11515
11517 {
11519 {
11520 if (ScriptInputUserData.CanStoreInputUserData())
11521 {
11522 vector m4[4];
11524
11525 EntityAI root = GetHierarchyRoot();
11526
11527 InventoryLocation dst = new InventoryLocation;
11529 {
11530 if (root)
11531 {
11532 root.GetTransform(m4);
11534 }
11535 else
11536 GetInventory().GetCurrentInventoryLocation(dst);
11537 }
11538 else
11539 {
11541
11542
11543 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11544 {
11545 if (root)
11546 {
11547 root.GetTransform(m4);
11549 }
11550 else
11551 GetInventory().GetCurrentInventoryLocation(dst);
11552 }
11553 else
11554 {
11555 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11556 }
11557 }
11558
11559 ScriptInputUserData ctx = new ScriptInputUserData;
11567 }
11568 }
11569 else if (!
GetGame().IsMultiplayer())
11570 {
11572 }
11573 }
11574 }
11575
11576 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11577 {
11578
11579 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11580 return false;
11581
11582 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11583 return false;
11584
11585
11587 return false;
11588
11589
11590 Magazine mag = Magazine.Cast(this);
11591 if (mag)
11592 {
11593 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11594 return false;
11595
11596 if (stack_max_limit)
11597 {
11598 Magazine other_mag = Magazine.Cast(other_item);
11599 if (other_item)
11600 {
11601 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11602 return false;
11603 }
11604
11605 }
11606 }
11607 else
11608 {
11609
11611 return false;
11612
11614 return false;
11615 }
11616
11617 PlayerBase player = null;
11618 if (CastTo(player, GetHierarchyRootPlayer()))
11619 {
11620 if (player.GetInventory().HasAttachment(this))
11621 return false;
11622
11623 if (player.IsItemsToDelete())
11624 return false;
11625 }
11626
11627 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11628 return false;
11629
11630 int slotID;
11632 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11633 return false;
11634
11635 return true;
11636 }
11637
11639 {
11641 }
11642
11644 {
11645 return m_IsResultOfSplit;
11646 }
11647
11649 {
11650 m_IsResultOfSplit = value;
11651 }
11652
11654 {
11656 }
11657
11659 {
11660 float other_item_quantity = other_item.GetQuantity();
11661 float this_free_space;
11662
11664
11666
11667 if (other_item_quantity > this_free_space)
11668 {
11669 return this_free_space;
11670 }
11671 else
11672 {
11673 return other_item_quantity;
11674 }
11675 }
11676
11678 {
11680 }
11681
11683 {
11685 return;
11686
11687 if (!IsMagazine() && other_item)
11688 {
11690 if (quantity_used != 0)
11691 {
11692 float hp1 = GetHealth01("","");
11693 float hp2 = other_item.GetHealth01("","");
11694 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11695 hpResult = hpResult / (
GetQuantity() + quantity_used);
11696
11697 hpResult *= GetMaxHealth();
11698 Math.Round(hpResult);
11699 SetHealth("", "Health", hpResult);
11700
11702 other_item.AddQuantity(-quantity_used);
11703 }
11704 }
11706 }
11707
11709 {
11710 #ifdef SERVER
11711 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11712 GetHierarchyParent().IncreaseLifetimeUp();
11713 #endif
11714 };
11715
11717 {
11718 PlayerBase p = PlayerBase.Cast(player);
11719
11720 array<int> recipesIds = p.m_Recipes;
11721 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11722 if (moduleRecipesManager)
11723 {
11724 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11725 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11726 }
11727
11728 for (int i = 0;i < recipesIds.Count(); i++)
11729 {
11730 int key = recipesIds.Get(i);
11731 string recipeName = moduleRecipesManager.GetRecipeName(key);
11733 }
11734 }
11735
11736
11737 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11738 {
11739 super.GetDebugActions(outputList);
11740
11741
11746
11747
11751
11755
11756
11759
11760
11762 {
11765 }
11766
11768
11771
11775 }
11776
11777
11778
11779
11781 {
11782 super.OnAction(action_id, player, ctx);
11783 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11784 {
11785 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11786 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11787 PlayerBase p = PlayerBase.Cast(player);
11788 if (
EActions.RECIPES_RANGE_START < 1000)
11789 {
11790 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11791 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11792 }
11793 }
11794 #ifndef SERVER
11795 else if (action_id ==
EActions.WATCH_PLAYER)
11796 {
11797 PluginDeveloper.SetDeveloperItemClientEx(player);
11798 }
11799 #endif
11801 {
11802 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11803 {
11804 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11805 OnDebugButtonPressServer(id + 1);
11806 }
11807
11808 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11809 {
11810 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11812 }
11813
11814 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11815 {
11816 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11818 }
11819
11820 else if (action_id ==
EActions.ADD_QUANTITY)
11821 {
11822 if (IsMagazine())
11823 {
11824 Magazine mag = Magazine.Cast(this);
11825 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11826 }
11827 else
11828 {
11830 }
11831
11832 if (m_EM)
11833 {
11834 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11835 }
11836
11837 }
11838
11839 else if (action_id ==
EActions.REMOVE_QUANTITY)
11840 {
11841 if (IsMagazine())
11842 {
11843 Magazine mag2 = Magazine.Cast(this);
11844 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11845 }
11846 else
11847 {
11849 }
11850 if (m_EM)
11851 {
11852 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11853 }
11854
11855 }
11856
11857 else if (action_id ==
EActions.SET_QUANTITY_0)
11858 {
11860
11861 if (m_EM)
11862 {
11863 m_EM.SetEnergy(0);
11864 }
11865 }
11866
11867 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11868 {
11870
11871 if (m_EM)
11872 {
11873 m_EM.SetEnergy(m_EM.GetEnergyMax());
11874 }
11875 }
11876
11877 else if (action_id ==
EActions.ADD_HEALTH)
11878 {
11879 AddHealth("","",GetMaxHealth("","Health")/5);
11880 }
11881 else if (action_id ==
EActions.REMOVE_HEALTH)
11882 {
11883 AddHealth("","",-GetMaxHealth("","Health")/5);
11884 }
11885 else if (action_id ==
EActions.DESTROY_HEALTH)
11886 {
11887 SetHealth01("","",0);
11888 }
11889 else if (action_id ==
EActions.WATCH_ITEM)
11890 {
11892 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11893 #ifdef DEVELOPER
11894 SetDebugDeveloper_item(this);
11895 #endif
11896 }
11897
11898 else if (action_id ==
EActions.ADD_TEMPERATURE)
11899 {
11900 AddTemperature(20);
11901
11902 }
11903
11904 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11905 {
11906 AddTemperature(-20);
11907
11908 }
11909
11910 else if (action_id ==
EActions.FLIP_FROZEN)
11911 {
11912 SetFrozen(!GetIsFrozen());
11913
11914 }
11915
11916 else if (action_id ==
EActions.ADD_WETNESS)
11917 {
11919
11920 }
11921
11922 else if (action_id ==
EActions.REMOVE_WETNESS)
11923 {
11925
11926 }
11927
11928 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11929 {
11932
11933
11934 }
11935
11936 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11937 {
11940 }
11941
11942 else if (action_id ==
EActions.MAKE_SPECIAL)
11943 {
11944 auto debugParams = DebugSpawnParams.WithPlayer(player);
11945 OnDebugSpawnEx(debugParams);
11946 }
11947
11948 else if (action_id ==
EActions.DELETE)
11949 {
11950 Delete();
11951 }
11952
11953 }
11954
11955
11956 return false;
11957 }
11958
11959
11960
11961
11965
11968
11969
11970
11972 {
11973 return false;
11974 }
11975
11976
11978 {
11979 return true;
11980 }
11981
11982
11984 {
11985 return true;
11986 }
11987
11988
11989
11991 {
11992 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11994 }
11995
11998 {
11999 return null;
12000 }
12001
12003 {
12004 return false;
12005 }
12006
12008 {
12009 return false;
12010 }
12011
12015
12016
12018 {
12019 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12020 return module_repairing.CanRepair(this, item_repair_kit);
12021 }
12022
12023
12024 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12025 {
12026 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12027 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12028 }
12029
12030
12032 {
12033
12034
12035
12036
12037
12038
12039
12040
12041 return 1;
12042 }
12043
12044
12045
12047 {
12049 }
12050
12051
12052
12054 {
12056 }
12057
12058
12067 {
12068 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12069
12070 if (player)
12071 {
12072 player.MessageStatus(text);
12073 }
12074 }
12075
12076
12085 {
12086 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12087
12088 if (player)
12089 {
12090 player.MessageAction(text);
12091 }
12092 }
12093
12094
12103 {
12104 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12105
12106 if (player)
12107 {
12108 player.MessageFriendly(text);
12109 }
12110 }
12111
12112
12121 {
12122 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12123
12124 if (player)
12125 {
12126 player.MessageImportant(text);
12127 }
12128 }
12129
12131 {
12132 return true;
12133 }
12134
12135
12136 override bool KindOf(
string tag)
12137 {
12138 bool found = false;
12139 string item_name = this.
GetType();
12142
12143 int array_size = item_tag_array.Count();
12144 for (int i = 0; i < array_size; i++)
12145 {
12146 if (item_tag_array.Get(i) == tag)
12147 {
12148 found = true;
12149 break;
12150 }
12151 }
12152 return found;
12153 }
12154
12155
12157 {
12158
12159 super.OnRPC(sender, rpc_type,ctx);
12160
12161
12162 switch (rpc_type)
12163 {
12164 #ifndef SERVER
12165 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12166 Param2<bool, string> p = new Param2<bool, string>(false, "");
12167
12169 return;
12170
12171 bool play = p.param1;
12172 string soundSet = p.param2;
12173
12174 if (play)
12175 {
12177 {
12179 {
12181 }
12182 }
12183 else
12184 {
12186 }
12187 }
12188 else
12189 {
12191 }
12192
12193 break;
12194 #endif
12195
12196 }
12197
12199 {
12201 }
12202 }
12203
12204
12205
12206
12208 {
12209 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12210 return plugin.GetID(
name);
12211 }
12212
12214 {
12215 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12216 return plugin.GetName(id);
12217 }
12218
12221 {
12222
12223
12224 int varFlags;
12225 if (!ctx.
Read(varFlags))
12226 return;
12227
12228 if (varFlags & ItemVariableFlags.FLOAT)
12229 {
12231 }
12232 }
12233
12235 {
12236
12237 super.SerializeNumericalVars(floats_out);
12238
12239
12240
12242 {
12244 }
12245
12247 {
12249 }
12250
12252 {
12254 }
12255
12257 {
12262 }
12263
12265 {
12267 }
12268 }
12269
12271 {
12272
12273 super.DeSerializeNumericalVars(floats);
12274
12275
12276 int index = 0;
12277 int mask = Math.Round(floats.Get(index));
12278
12279 index++;
12280
12282 {
12284 {
12286 }
12287 else
12288 {
12289 float quantity = floats.Get(index);
12290 SetQuantity(quantity,
true,
false,
false,
false);
12291 }
12292 index++;
12293 }
12294
12296 {
12297 float wet = floats.Get(index);
12299 index++;
12300 }
12301
12303 {
12304 int liquidtype = Math.Round(floats.Get(index));
12306 index++;
12307 }
12308
12310 {
12312 index++;
12314 index++;
12316 index++;
12318 index++;
12319 }
12320
12322 {
12323 int cleanness = Math.Round(floats.Get(index));
12325 index++;
12326 }
12327 }
12328
12330 {
12331 super.WriteVarsToCTX(ctx);
12332
12333
12335 {
12337 }
12338
12340 {
12342 }
12343
12345 {
12347 }
12348
12350 {
12351 int r,g,b,a;
12357 }
12358
12360 {
12362 }
12363 }
12364
12366 {
12367 if (!super.ReadVarsFromCTX(ctx,version))
12368 return false;
12369
12370 int intValue;
12371 float value;
12372
12373 if (version < 140)
12374 {
12375 if (!ctx.
Read(intValue))
12376 return false;
12377
12378 m_VariablesMask = intValue;
12379 }
12380
12382 {
12383 if (!ctx.
Read(value))
12384 return false;
12385
12387 {
12389 }
12390 else
12391 {
12393 }
12394 }
12395
12396 if (version < 140)
12397 {
12399 {
12400 if (!ctx.
Read(value))
12401 return false;
12402 SetTemperatureDirect(value);
12403 }
12404 }
12405
12407 {
12408 if (!ctx.
Read(value))
12409 return false;
12411 }
12412
12414 {
12415 if (!ctx.
Read(intValue))
12416 return false;
12418 }
12419
12421 {
12422 int r,g,b,a;
12424 return false;
12426 return false;
12428 return false;
12430 return false;
12431
12433 }
12434
12436 {
12437 if (!ctx.
Read(intValue))
12438 return false;
12440 }
12441
12442 if (version >= 138 && version < 140)
12443 {
12445 {
12446 if (!ctx.
Read(intValue))
12447 return false;
12448 SetFrozen(intValue);
12449 }
12450 }
12451
12452 return true;
12453 }
12454
12455
12457 {
12460 {
12462 }
12463
12464 if (!super.OnStoreLoad(ctx, version))
12465 {
12467 return false;
12468 }
12469
12470 if (version >= 114)
12471 {
12472 bool hasQuickBarIndexSaved;
12473
12474 if (!ctx.
Read(hasQuickBarIndexSaved))
12475 {
12477 return false;
12478 }
12479
12480 if (hasQuickBarIndexSaved)
12481 {
12482 int itmQBIndex;
12483
12484
12485 if (!ctx.
Read(itmQBIndex))
12486 {
12488 return false;
12489 }
12490
12491 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12492 if (itmQBIndex != -1 && parentPlayer)
12493 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12494 }
12495 }
12496 else
12497 {
12498
12499 PlayerBase player;
12500 int itemQBIndex;
12501 if (version ==
int.
MAX)
12502 {
12503 if (!ctx.
Read(itemQBIndex))
12504 {
12506 return false;
12507 }
12508 }
12509 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12510 {
12511
12512 if (!ctx.
Read(itemQBIndex))
12513 {
12515 return false;
12516 }
12517 if (itemQBIndex != -1 && player)
12518 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12519 }
12520 }
12521
12522 if (version < 140)
12523 {
12524
12525 if (!LoadVariables(ctx, version))
12526 {
12528 return false;
12529 }
12530 }
12531
12532
12534 {
12536 return false;
12537 }
12538 if (version >= 132)
12539 {
12541 if (raib)
12542 {
12544 {
12546 return false;
12547 }
12548 }
12549 }
12550
12552 return true;
12553 }
12554
12555
12556
12558 {
12559 super.OnStoreSave(ctx);
12560
12561 PlayerBase player;
12562 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12563 {
12565
12566 int itemQBIndex = -1;
12567 itemQBIndex = player.FindQuickBarEntityIndex(this);
12568 ctx.
Write(itemQBIndex);
12569 }
12570 else
12571 {
12573 }
12574
12576
12578 if (raib)
12579 {
12581 }
12582 }
12583
12584
12586 {
12587 super.AfterStoreLoad();
12588
12590 {
12592 }
12593
12595 {
12598 }
12599 }
12600
12602 {
12603 super.EEOnAfterLoad();
12604
12606 {
12608 }
12609
12612 }
12613
12615 {
12616 return false;
12617 }
12618
12619
12620
12622 {
12624 {
12625 #ifdef PLATFORM_CONSOLE
12626
12628 {
12630 if (menu)
12631 {
12633 }
12634 }
12635 #endif
12636 }
12637
12639 {
12642 }
12643
12645 {
12646 SetWeightDirty();
12648 }
12650 {
12653 }
12654
12656 {
12659 }
12661 {
12664 }
12665
12666 super.OnVariablesSynchronized();
12667 }
12668
12669
12670
12672 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12673 {
12674 if (!IsServerCheck(allow_client))
12675 return false;
12676
12678 return false;
12679
12682
12683 if (value <= (min + 0.001))
12684 value = min;
12685
12686 if (value == min)
12687 {
12688 if (destroy_config)
12689 {
12690 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12691 if (dstr)
12692 {
12694 this.Delete();
12695 return true;
12696 }
12697 }
12698 else if (destroy_forced)
12699 {
12701 this.Delete();
12702 return true;
12703 }
12704
12706 }
12707
12710
12712 {
12714
12715 if (delta)
12717 }
12718
12720
12721 return false;
12722 }
12723
12724
12726 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12727 {
12729 }
12730
12732 {
12735 }
12736
12738 {
12741 }
12742
12745 {
12746 float value_clamped = Math.Clamp(value, 0, 1);
12748 SetQuantity(result, destroy_config, destroy_forced);
12749 }
12750
12751
12754 {
12756 }
12757
12759 {
12761 }
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12773 {
12774 int slot = -1;
12775 if (GetInventory())
12776 {
12777 InventoryLocation il = new InventoryLocation;
12778 GetInventory().GetCurrentInventoryLocation(il);
12780 }
12781
12783 }
12784
12786 {
12787 float quantity_max = 0;
12788
12790 {
12791 if (attSlotID != -1)
12792 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12793
12794 if (quantity_max <= 0)
12796 }
12797
12798 if (quantity_max <= 0)
12800
12801 return quantity_max;
12802 }
12803
12805 {
12807 }
12808
12810 {
12812 }
12813
12814
12816 {
12818 }
12819
12821 {
12823 }
12824
12826 {
12828 }
12829
12830
12832 {
12833
12834 float weightEx = GetWeightEx();
12835 float special = GetInventoryAndCargoWeight();
12836 return weightEx - special;
12837 }
12838
12839
12841 {
12843 }
12844
12846 {
12848 {
12849 #ifdef DEVELOPER
12850 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12851 {
12852 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12854 }
12855 #endif
12856
12857 return GetQuantity() * GetConfigWeightModified();
12858 }
12859 else if (HasEnergyManager())
12860 {
12861 #ifdef DEVELOPER
12862 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12863 {
12864 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12865 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12866 }
12867 #endif
12868 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12869 }
12870 else
12871 {
12872 #ifdef DEVELOPER
12873 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12874 {
12875 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12876 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12877 }
12878 #endif
12879 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12880 }
12881 }
12882
12885 {
12886 int item_count = 0;
12888
12889 if (GetInventory().GetCargo() != NULL)
12890 {
12891 item_count = GetInventory().GetCargo().GetItemCount();
12892 }
12893
12894 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12895 {
12896 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12897 if (item)
12898 item_count += item.GetNumberOfItems();
12899 }
12900 return item_count;
12901 }
12902
12905 {
12906 float weight = 0;
12907 float wetness = 1;
12908 if (include_wetness)
12911 {
12912 weight = wetness * m_ConfigWeight;
12913 }
12915 {
12916 weight = 1;
12917 }
12918 return weight;
12919 }
12920
12921
12922
12924 {
12925 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12926 {
12927 GameInventory inv = GetInventory();
12928 array<EntityAI> items = new array<EntityAI>;
12930 for (int i = 0; i < items.Count(); i++)
12931 {
12933 if (item)
12934 {
12936 }
12937 }
12938 }
12939 }
12940
12941
12942
12943
12945 {
12946 float energy = 0;
12947 if (HasEnergyManager())
12948 {
12949 energy = GetCompEM().GetEnergy();
12950 }
12951 return energy;
12952 }
12953
12954
12956 {
12957 super.OnEnergyConsumed();
12958
12960 }
12961
12963 {
12964 super.OnEnergyAdded();
12965
12967 }
12968
12969
12971 {
12972 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12973 {
12975 {
12976 float energy_0to1 = GetCompEM().GetEnergy0To1();
12978 }
12979 }
12980 }
12981
12982
12984 {
12985 return ConfigGetFloat("heatIsolation");
12986 }
12987
12989 {
12991 }
12992
12994 {
12995 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12996 if (
GetGame().ConfigIsExisting(paramPath))
12998
12999 return 0.0;
13000 }
13001
13003 {
13004 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13005 if (
GetGame().ConfigIsExisting(paramPath))
13007
13008 return 0.0;
13009 }
13010
13011 override void SetWet(
float value,
bool allow_client =
false)
13012 {
13013 if (!IsServerCheck(allow_client))
13014 return;
13015
13018
13020
13021 m_VarWet = Math.Clamp(value, min, max);
13022
13024 {
13027 }
13028 }
13029
13030 override void AddWet(
float value)
13031 {
13033 }
13034
13036 {
13038 }
13039
13041 {
13043 }
13044
13046 {
13048 }
13049
13051 {
13053 }
13054
13056 {
13058 }
13059
13060 override void OnWetChanged(
float newVal,
float oldVal)
13061 {
13064 if (newLevel != oldLevel)
13065 {
13067 }
13068 }
13069
13071 {
13072 SetWeightDirty();
13073 }
13074
13076 {
13077 return GetWetLevelInternal(
m_VarWet);
13078 }
13079
13080
13081
13083 {
13085 }
13086
13088 {
13090 }
13091
13093 {
13095 }
13096
13098 {
13100 }
13101
13102
13103
13105 {
13106 if (ConfigIsExisting("itemModelLength"))
13107 {
13108 return ConfigGetFloat("itemModelLength");
13109 }
13110 return 0;
13111 }
13112
13114 {
13115 if (ConfigIsExisting("itemAttachOffset"))
13116 {
13117 return ConfigGetFloat("itemAttachOffset");
13118 }
13119 return 0;
13120 }
13121
13122 override void SetCleanness(
int value,
bool allow_client =
false)
13123 {
13124 if (!IsServerCheck(allow_client))
13125 return;
13126
13128
13130
13133 }
13134
13136 {
13138 }
13139
13141 {
13142 return true;
13143 }
13144
13145
13146
13147
13149 {
13151 }
13152
13154 {
13156 }
13157
13158
13159
13160
13161 override void SetColor(
int r,
int g,
int b,
int a)
13162 {
13168 }
13170 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13171 {
13176 }
13177
13179 {
13181 }
13182
13185 {
13186 int r,g,b,a;
13188 r = r/255;
13189 g = g/255;
13190 b = b/255;
13191 a = a/255;
13192 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13193 }
13194
13195
13196
13197 override void SetLiquidType(
int value,
bool allow_client =
false)
13198 {
13199 if (!IsServerCheck(allow_client))
13200 return;
13201
13206 }
13207
13209 {
13210 return ConfigGetInt("varLiquidTypeInit");
13211 }
13212
13214 {
13216 }
13217
13219 {
13221 SetFrozen(false);
13222 }
13223
13226 {
13227 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13228 }
13229
13230
13233 {
13234 PlayerBase nplayer;
13235 if (PlayerBase.CastTo(nplayer, player))
13236 {
13238
13239 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13240 }
13241 }
13242
13243
13246 {
13247 PlayerBase nplayer;
13248 if (PlayerBase.CastTo(nplayer,player))
13249 {
13250
13251 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13252
13253 }
13254
13255
13256 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13257
13258
13259 if (HasEnergyManager())
13260 {
13261 GetCompEM().UpdatePlugState();
13262 }
13263 }
13264
13265
13267 {
13268 super.OnPlacementStarted(player);
13269
13271 }
13272
13273 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13274 {
13276 {
13277 m_AdminLog.OnPlacementComplete(player,
this);
13278 }
13279
13280 super.OnPlacementComplete(player, position, orientation);
13281 }
13282
13283
13284
13285
13286
13288 {
13290 {
13291 return true;
13292 }
13293 else
13294 {
13295 return false;
13296 }
13297 }
13298
13299
13301 {
13303 {
13305 }
13306 }
13307
13308
13310 {
13312 }
13313
13315 {
13317 }
13318
13319 override void InsertAgent(
int agent,
float count = 1)
13320 {
13321 if (count < 1)
13322 return;
13323
13325 }
13326
13329 {
13331 }
13332
13333
13335 {
13337 }
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13381 {
13383 return false;
13384 return true;
13385 }
13386
13388 {
13389
13391 }
13392
13393
13396 {
13397 super.CheckForRoofLimited(timeTresholdMS);
13398
13400 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13401 {
13402 m_PreviousRoofTestTime = time;
13403 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13404 }
13405 }
13406
13407
13409 {
13411 {
13412 return 0;
13413 }
13414
13415 if (GetInventory().GetAttachmentSlotsCount() != 0)
13416 {
13417 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13418 if (filter)
13419 return filter.GetProtectionLevel(type, false, system);
13420 else
13421 return 0;
13422 }
13423
13424 string subclassPath, entryName;
13425
13426 switch (type)
13427 {
13429 entryName = "biological";
13430 break;
13432 entryName = "chemical";
13433 break;
13434 default:
13435 entryName = "biological";
13436 break;
13437 }
13438
13439 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13440
13442 }
13443
13444
13445
13448 {
13449 if (!IsMagazine())
13451
13453 }
13454
13455
13456
13457
13458
13463 {
13464 return true;
13465 }
13466
13468 {
13470 }
13471
13472
13473
13474
13475
13477 {
13478 if (parent)
13479 {
13480 if (parent.IsInherited(DayZInfected))
13481 return true;
13482
13483 if (!parent.IsRuined())
13484 return true;
13485 }
13486
13487 return true;
13488 }
13489
13491 {
13492 if (!super.CanPutAsAttachment(parent))
13493 {
13494 return false;
13495 }
13496
13497 if (!IsRuined() && !parent.IsRuined())
13498 {
13499 return true;
13500 }
13501
13502 return false;
13503 }
13504
13506 {
13507
13508
13509
13510
13511 return super.CanReceiveItemIntoCargo(item);
13512 }
13513
13515 {
13516
13517
13518
13519
13520 GameInventory attachmentInv = attachment.GetInventory();
13522 {
13523 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13524 return false;
13525 }
13526
13527 InventoryLocation loc = new InventoryLocation();
13528 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13529 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13530 return false;
13531
13532 return super.CanReceiveAttachment(attachment, slotId);
13533 }
13534
13536 {
13537 if (!super.CanReleaseAttachment(attachment))
13538 return false;
13539
13540 return GetInventory().AreChildrenAccessible();
13541 }
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13564 {
13565 int id = muzzle_owner.GetMuzzleID();
13566 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13567
13568 if (WPOF_array)
13569 {
13570 for (int i = 0; i < WPOF_array.Count(); i++)
13571 {
13572 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13573
13574 if (WPOF)
13575 {
13576 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13577 }
13578 }
13579 }
13580 }
13581
13582
13584 {
13585 int id = muzzle_owner.GetMuzzleID();
13587
13588 if (WPOBE_array)
13589 {
13590 for (int i = 0; i < WPOBE_array.Count(); i++)
13591 {
13592 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13593
13594 if (WPOBE)
13595 {
13596 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13597 }
13598 }
13599 }
13600 }
13601
13602
13604 {
13605 int id = muzzle_owner.GetMuzzleID();
13606 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13607
13608 if (WPOOH_array)
13609 {
13610 for (int i = 0; i < WPOOH_array.Count(); i++)
13611 {
13612 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13613
13614 if (WPOOH)
13615 {
13616 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13617 }
13618 }
13619 }
13620 }
13621
13622
13624 {
13625 int id = muzzle_owner.GetMuzzleID();
13626 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13627
13628 if (WPOOH_array)
13629 {
13630 for (int i = 0; i < WPOOH_array.Count(); i++)
13631 {
13632 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13633
13634 if (WPOOH)
13635 {
13636 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13637 }
13638 }
13639 }
13640 }
13641
13642
13644 {
13645 int id = muzzle_owner.GetMuzzleID();
13646 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13647
13648 if (WPOOH_array)
13649 {
13650 for (int i = 0; i < WPOOH_array.Count(); i++)
13651 {
13652 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13653
13654 if (WPOOH)
13655 {
13656 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13657 }
13658 }
13659 }
13660 }
13661
13662
13663
13665 {
13667 {
13668 return true;
13669 }
13670
13671 return false;
13672 }
13673
13675 {
13677 {
13678 return true;
13679 }
13680
13681 return false;
13682 }
13683
13685 {
13687 {
13688 return true;
13689 }
13690
13691 return false;
13692 }
13693
13695 {
13696 return false;
13697 }
13698
13701 {
13702 return UATimeSpent.DEFAULT_DEPLOY;
13703 }
13704
13705
13706
13707
13709 {
13711 SetSynchDirty();
13712 }
13713
13715 {
13717 }
13718
13719
13721 {
13722 return false;
13723 }
13724
13727 {
13728 string att_type = "None";
13729
13730 if (ConfigIsExisting("soundAttType"))
13731 {
13732 att_type = ConfigGetString("soundAttType");
13733 }
13734
13736 }
13737
13739 {
13741 }
13742
13743
13744
13745
13746
13750
13752 {
13755
13757 }
13758
13759
13761 {
13763 return;
13764
13766
13769
13772
13773 SoundParameters params = new SoundParameters();
13777 }
13778
13779
13781 {
13783 return;
13784
13786 SetSynchDirty();
13787
13790 }
13791
13792
13794 {
13796 return;
13797
13799 SetSynchDirty();
13800
13803 }
13804
13806 {
13808 }
13809
13811 {
13813 }
13814
13817 {
13818 if (!
GetGame().IsDedicatedServer())
13819 {
13820 if (ConfigIsExisting("attachSoundSet"))
13821 {
13822 string cfg_path = "";
13823 string soundset = "";
13824 string type_name =
GetType();
13825
13828 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13829 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13830
13831 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13832 {
13833 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13834 {
13835 if (cfg_slot_array[i] == slot_type)
13836 {
13837 soundset = cfg_soundset_array[i];
13838 break;
13839 }
13840 }
13841 }
13842
13843 if (soundset != "")
13844 {
13845 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13847 }
13848 }
13849 }
13850 }
13851
13853 {
13854
13855 }
13856
13857 void OnApply(PlayerBase player);
13858
13860 {
13861 return 1.0;
13862 };
13863
13865 {
13867 }
13868
13870 {
13872 }
13873
13875
13877 {
13878 SetDynamicPhysicsLifeTime(0.01);
13880 }
13881
13883 {
13884 array<string> zone_names = new array<string>;
13885 GetDamageZones(zone_names);
13886 for (int i = 0; i < zone_names.Count(); i++)
13887 {
13888 SetHealthMax(zone_names.Get(i),"Health");
13889 }
13890 SetHealthMax("","Health");
13891 }
13892
13895 {
13896 float global_health = GetHealth01("","Health");
13897 array<string> zones = new array<string>;
13898 GetDamageZones(zones);
13899
13900 for (int i = 0; i < zones.Count(); i++)
13901 {
13902 SetHealth01(zones.Get(i),"Health",global_health);
13903 }
13904 }
13905
13908 {
13909 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13910 }
13911
13913 {
13914 if (!hasRootAsPlayer)
13915 {
13916 if (refParentIB)
13917 {
13918
13919 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13920 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13921
13922 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13923 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13924
13927 }
13928 else
13929 {
13930
13933 }
13934 }
13935 }
13936
13938 {
13940 {
13941 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13942 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13943 {
13944 float heatPermCoef = 1.0;
13946 while (ent)
13947 {
13948 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13949 ent = ent.GetHierarchyParent();
13950 }
13951
13952 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13953 }
13954 }
13955 }
13956
13958 {
13959
13960 EntityAI parent = GetHierarchyParent();
13961 if (!parent)
13962 {
13963 hasParent = false;
13964 hasRootAsPlayer = false;
13965 }
13966 else
13967 {
13968 hasParent = true;
13969 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13970 refParentIB =
ItemBase.Cast(parent);
13971 }
13972 }
13973
13974 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13975 {
13976
13977 }
13978
13980 {
13981
13982 return false;
13983 }
13984
13986 {
13987
13988
13989 return false;
13990 }
13991
13993 {
13994
13995 return false;
13996 }
13997
14000 {
14001 return !GetIsFrozen() &&
IsOpen();
14002 }
14003
14005 {
14006 bool hasParent = false, hasRootAsPlayer = false;
14008
14009 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14010 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14011
14012 if (wwtu || foodDecay)
14013 {
14017
14018 if (processWetness || processTemperature || processDecay)
14019 {
14021
14022 if (processWetness)
14023 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14024
14025 if (processTemperature)
14027
14028 if (processDecay)
14029 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14030 }
14031 }
14032 }
14033
14036 {
14038 }
14039
14041 {
14044
14045 return super.GetTemperatureFreezeThreshold();
14046 }
14047
14049 {
14052
14053 return super.GetTemperatureThawThreshold();
14054 }
14055
14057 {
14060
14061 return super.GetItemOverheatThreshold();
14062 }
14063
14065 {
14067 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14068
14069 return super.GetTemperatureFreezeTime();
14070 }
14071
14073 {
14075 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14076
14077 return super.GetTemperatureThawTime();
14078 }
14079
14084
14086 {
14087 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14088 }
14089
14091 {
14092 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14093 }
14094
14097 {
14099 }
14100
14102 {
14104 }
14105
14107 {
14109 }
14110
14113 {
14114 return null;
14115 }
14116
14119 {
14120 return false;
14121 }
14122
14124 {
14126 {
14129 if (!trg)
14130 {
14132 explosive = this;
14133 }
14134
14135 explosive.PairRemote(trg);
14137
14138 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14139 trg.SetPersistentPairID(persistentID);
14140 explosive.SetPersistentPairID(persistentID);
14141
14142 return true;
14143 }
14144 return false;
14145 }
14146
14149 {
14150 float ret = 1.0;
14153 ret *= GetHealth01();
14154
14155 return ret;
14156 }
14157
14158 #ifdef DEVELOPER
14159 override void SetDebugItem()
14160 {
14161 super.SetDebugItem();
14162 _itemBase = this;
14163 }
14164
14166 {
14167 string text = super.GetDebugText();
14168
14170 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14171
14172 return text;
14173 }
14174 #endif
14175
14177 {
14178 return true;
14179 }
14180
14182
14184
14186 {
14189 }
14190
14191
14199
14215}
14216
14218{
14220 if (entity)
14221 {
14222 bool is_item = entity.IsInherited(
ItemBase);
14223 if (is_item && full_quantity)
14224 {
14227 }
14228 }
14229 else
14230 {
14232 return NULL;
14233 }
14234 return entity;
14235}
14236
14238{
14239 if (item)
14240 {
14241 if (health > 0)
14242 item.SetHealth("", "", health);
14243
14244 if (item.CanHaveTemperature())
14245 {
14247 if (item.CanFreeze())
14248 item.SetFrozen(false);
14249 }
14250
14251 if (item.HasEnergyManager())
14252 {
14253 if (quantity >= 0)
14254 {
14255 item.GetCompEM().SetEnergy0To1(quantity);
14256 }
14257 else
14258 {
14260 }
14261 }
14262 else if (item.IsMagazine())
14263 {
14264 Magazine mag = Magazine.Cast(item);
14265 if (quantity >= 0)
14266 {
14267 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14268 }
14269 else
14270 {
14272 }
14273
14274 }
14275 else
14276 {
14277 if (quantity >= 0)
14278 {
14279 item.SetQuantityNormalized(quantity, false);
14280 }
14281 else
14282 {
14284 }
14285
14286 }
14287 }
14288}
14289
14290#ifdef DEVELOPER
14292#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.