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 {
11024
11026 return false;
11027
11028
11030 return false;
11031
11032
11033
11035 if (delta == 0)
11036 return false;
11037
11038
11039 return true;
11040 }
11041
11043 {
11045 {
11046 if (ScriptInputUserData.CanStoreInputUserData())
11047 {
11048 ScriptInputUserData ctx = new ScriptInputUserData;
11053 ctx.
Write(destination_entity);
11055 ctx.
Write(slot_id);
11057 }
11058 }
11059 else if (!
GetGame().IsMultiplayer())
11060 {
11062 }
11063 }
11064
11066 {
11067 float split_quantity_new;
11071 InventoryLocation loc = new InventoryLocation;
11072
11073 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11074 {
11076 split_quantity_new = stack_max;
11077 else
11079
11081 {
11082 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11083 if (new_item)
11084 {
11085 new_item.SetResultOfSplit(true);
11086 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11088 new_item.
SetQuantity(split_quantity_new,
false,
true);
11089 }
11090 }
11091 }
11092 else if (destination_entity && slot_id == -1)
11093 {
11094 if (quantity > stack_max)
11095 split_quantity_new = stack_max;
11096 else
11097 split_quantity_new = quantity;
11098
11100 {
11102 {
11105 }
11106
11107 if (new_item)
11108 {
11109 new_item.SetResultOfSplit(true);
11110 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11112 new_item.
SetQuantity(split_quantity_new,
false,
true);
11113 }
11114 }
11115 }
11116 else
11117 {
11118 if (stack_max != 0)
11119 {
11121 {
11123 }
11124
11125 if (split_quantity_new == 0)
11126 {
11127 if (!
GetGame().IsMultiplayer())
11128 player.PhysicalPredictiveDropItem(this);
11129 else
11130 player.ServerDropEntity(this);
11131 return;
11132 }
11133
11135 {
11137
11138 if (new_item)
11139 {
11140 new_item.SetResultOfSplit(true);
11141 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11144 new_item.PlaceOnSurface();
11145 }
11146 }
11147 }
11148 }
11149 }
11150
11152 {
11153 float split_quantity_new;
11157 InventoryLocation loc = new InventoryLocation;
11158
11159 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11160 {
11162 split_quantity_new = stack_max;
11163 else
11165
11167 {
11168 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11169 if (new_item)
11170 {
11171 new_item.SetResultOfSplit(true);
11172 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11174 new_item.
SetQuantity(split_quantity_new,
false,
true);
11175 }
11176 }
11177 }
11178 else if (destination_entity && slot_id == -1)
11179 {
11180 if (quantity > stack_max)
11181 split_quantity_new = stack_max;
11182 else
11183 split_quantity_new = quantity;
11184
11186 {
11188 {
11191 }
11192
11193 if (new_item)
11194 {
11195 new_item.SetResultOfSplit(true);
11196 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11198 new_item.
SetQuantity(split_quantity_new,
false,
true);
11199 }
11200 }
11201 }
11202 else
11203 {
11204 if (stack_max != 0)
11205 {
11207 {
11209 }
11210
11212 {
11214
11215 if (new_item)
11216 {
11217 new_item.SetResultOfSplit(true);
11218 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11221 new_item.PlaceOnSurface();
11222 }
11223 }
11224 }
11225 }
11226 }
11227
11229 {
11231 {
11232 if (ScriptInputUserData.CanStoreInputUserData())
11233 {
11234 ScriptInputUserData ctx = new ScriptInputUserData;
11239 dst.WriteToContext(ctx);
11241 }
11242 }
11243 else if (!
GetGame().IsMultiplayer())
11244 {
11246 }
11247 }
11248
11250 {
11252 {
11253 if (ScriptInputUserData.CanStoreInputUserData())
11254 {
11255 ScriptInputUserData ctx = new ScriptInputUserData;
11260 ctx.
Write(destination_entity);
11266 }
11267 }
11268 else if (!
GetGame().IsMultiplayer())
11269 {
11271 }
11272 }
11273
11275 {
11277 }
11278
11280 {
11282 float split_quantity_new;
11284 if (dst.IsValid())
11285 {
11286 int slot_id = dst.GetSlot();
11288
11289 if (quantity > stack_max)
11290 split_quantity_new = stack_max;
11291 else
11292 split_quantity_new = quantity;
11293
11295 {
11297
11298 if (new_item)
11299 {
11300 new_item.SetResultOfSplit(true);
11301 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11303 new_item.
SetQuantity(split_quantity_new,
false,
true);
11304 }
11305
11306 return new_item;
11307 }
11308 }
11309
11310 return null;
11311 }
11312
11314 {
11316 float split_quantity_new;
11318 if (destination_entity)
11319 {
11321 if (quantity > stackable)
11322 split_quantity_new = stackable;
11323 else
11324 split_quantity_new = quantity;
11325
11327 {
11328 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11329 if (new_item)
11330 {
11331 new_item.SetResultOfSplit(true);
11332 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11334 new_item.
SetQuantity(split_quantity_new,
false,
true);
11335 }
11336 }
11337 }
11338 }
11339
11341 {
11343 {
11344 if (ScriptInputUserData.CanStoreInputUserData())
11345 {
11346 ScriptInputUserData ctx = new ScriptInputUserData;
11351 ItemBase destination_entity =
this;
11352 ctx.
Write(destination_entity);
11356 }
11357 }
11358 else if (!
GetGame().IsMultiplayer())
11359 {
11361 }
11362 }
11363
11365 {
11367 float split_quantity_new;
11369 if (player)
11370 {
11372 if (quantity > stackable)
11373 split_quantity_new = stackable;
11374 else
11375 split_quantity_new = quantity;
11376
11378 {
11379 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11380 new_item =
ItemBase.Cast(in_hands);
11381 if (new_item)
11382 {
11383 new_item.SetResultOfSplit(true);
11384 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11386 new_item.SetQuantity(split_quantity_new, false, true);
11387 }
11388 }
11389 }
11390 }
11391
11393 {
11395 float split_quantity_new = Math.Floor(quantity * 0.5);
11396
11398 return;
11399
11401
11402 if (new_item)
11403 {
11404 if (new_item.GetQuantityMax() < split_quantity_new)
11405 {
11406 split_quantity_new = new_item.GetQuantityMax();
11407 }
11408
11409 new_item.SetResultOfSplit(true);
11410 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11411
11413 {
11416 }
11417 else
11418 {
11420 new_item.
SetQuantity(split_quantity_new,
false,
true);
11421 }
11422 }
11423 }
11424
11426 {
11428 float split_quantity_new = Math.Floor(quantity / 2);
11429
11431 return;
11432
11433 InventoryLocation invloc = new InventoryLocation;
11435
11437 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11438
11439 if (new_item)
11440 {
11441 if (new_item.GetQuantityMax() < split_quantity_new)
11442 {
11443 split_quantity_new = new_item.GetQuantityMax();
11444 }
11446 {
11449 }
11450 else if (split_quantity_new > 1)
11451 {
11453 new_item.
SetQuantity(split_quantity_new,
false,
true);
11454 }
11455 }
11456 }
11457
11460 {
11461 SetWeightDirty();
11463
11464 if (parent)
11465 parent.OnAttachmentQuantityChangedEx(this, delta);
11466
11468 {
11470 {
11472 }
11474 {
11475 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11477 }
11478 }
11479
11480 }
11481
11484 {
11485
11486 }
11487
11490 {
11492 }
11493
11495 {
11496 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11497
11499 {
11500 if (newLevel == GameConstants.STATE_RUINED)
11501 {
11503 EntityAI parent = GetHierarchyParent();
11504 if (parent && parent.IsFireplace())
11505 {
11506 CargoBase cargo = GetInventory().GetCargo();
11507 if (cargo)
11508 {
11510 {
11512 }
11513 }
11514 }
11515 }
11516
11518 {
11519
11521 return;
11522 }
11523
11524 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11525 {
11527 }
11528 }
11529 }
11530
11531
11533 {
11534 super.OnRightClick();
11535
11537 {
11539 {
11540 if (ScriptInputUserData.CanStoreInputUserData())
11541 {
11542 EntityAI root = GetHierarchyRoot();
11543 Man playerOwner = GetHierarchyRootPlayer();
11544 InventoryLocation dst = new InventoryLocation;
11545
11546
11547 if (!playerOwner && root && root == this)
11548 {
11550 }
11551 else
11552 {
11553
11554 GetInventory().GetCurrentInventoryLocation(dst);
11556 {
11559 {
11561 }
11562 else
11563 {
11565
11566
11567 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11568 {
11570 }
11571 else
11572 {
11573 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11574 }
11575 }
11576 }
11577 }
11578
11579 ScriptInputUserData ctx = new ScriptInputUserData;
11587 }
11588 }
11589 else if (!
GetGame().IsMultiplayer())
11590 {
11592 }
11593 }
11594 }
11595
11597 {
11598 if (root)
11599 {
11600 vector m4[4];
11601 root.GetTransform(m4);
11602 dst.SetGround(this, m4);
11603 }
11604 else
11605 {
11606 GetInventory().GetCurrentInventoryLocation(dst);
11607 }
11608 }
11609
11610 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11611 {
11612
11613 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11614 return false;
11615
11616 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11617 return false;
11618
11619
11621 return false;
11622
11623
11624 Magazine mag = Magazine.Cast(this);
11625 if (mag)
11626 {
11627 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11628 return false;
11629
11630 if (stack_max_limit)
11631 {
11632 Magazine other_mag = Magazine.Cast(other_item);
11633 if (other_item)
11634 {
11635 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11636 return false;
11637 }
11638
11639 }
11640 }
11641 else
11642 {
11643
11645 return false;
11646
11648 return false;
11649 }
11650
11651 PlayerBase player = null;
11652 if (CastTo(player, GetHierarchyRootPlayer()))
11653 {
11654 if (player.GetInventory().HasAttachment(this))
11655 return false;
11656
11657 if (player.IsItemsToDelete())
11658 return false;
11659 }
11660
11661 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11662 return false;
11663
11664 int slotID;
11666 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11667 return false;
11668
11669 return true;
11670 }
11671
11673 {
11675 }
11676
11678 {
11679 return m_IsResultOfSplit;
11680 }
11681
11683 {
11684 m_IsResultOfSplit = value;
11685 }
11686
11688 {
11690 }
11691
11693 {
11694 float other_item_quantity = other_item.GetQuantity();
11695 float this_free_space;
11696
11698
11700
11701 if (other_item_quantity > this_free_space)
11702 {
11703 return this_free_space;
11704 }
11705 else
11706 {
11707 return other_item_quantity;
11708 }
11709 }
11710
11712 {
11714 }
11715
11717 {
11719 return;
11720
11721 if (!IsMagazine() && other_item)
11722 {
11724 if (quantity_used != 0)
11725 {
11726 float hp1 = GetHealth01("","");
11727 float hp2 = other_item.GetHealth01("","");
11728 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11729 hpResult = hpResult / (
GetQuantity() + quantity_used);
11730
11731 hpResult *= GetMaxHealth();
11732 Math.Round(hpResult);
11733 SetHealth("", "Health", hpResult);
11734
11736 other_item.AddQuantity(-quantity_used);
11737 }
11738 }
11740 }
11741
11743 {
11744 #ifdef SERVER
11745 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11746 GetHierarchyParent().IncreaseLifetimeUp();
11747 #endif
11748 };
11749
11751 {
11752 PlayerBase p = PlayerBase.Cast(player);
11753
11754 array<int> recipesIds = p.m_Recipes;
11755 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11756 if (moduleRecipesManager)
11757 {
11758 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11759 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11760 }
11761
11762 for (int i = 0;i < recipesIds.Count(); i++)
11763 {
11764 int key = recipesIds.Get(i);
11765 string recipeName = moduleRecipesManager.GetRecipeName(key);
11767 }
11768 }
11769
11770
11771 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11772 {
11773 super.GetDebugActions(outputList);
11774
11775
11781
11782
11787
11792
11793
11797
11798
11800 {
11804 }
11805
11808
11809
11813
11815
11816 InventoryLocation loc = new InventoryLocation();
11817 GetInventory().GetCurrentInventoryLocation(loc);
11819 {
11820 if (Gizmo_IsSupported())
11823 }
11824
11826 }
11827
11828
11829
11830
11832 {
11833 super.OnAction(action_id, player, ctx);
11834
11836 {
11837 switch (action_id)
11838 {
11841 return true;
11844 return true;
11845 }
11846 }
11847
11849 {
11850 switch (action_id)
11851 {
11853 Delete();
11854 return true;
11855 }
11856 }
11857
11858 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11859 {
11860 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11861 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11862 PlayerBase p = PlayerBase.Cast(player);
11863 if (
EActions.RECIPES_RANGE_START < 1000)
11864 {
11865 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11866 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11867 }
11868 }
11869 #ifndef SERVER
11870 else if (action_id ==
EActions.WATCH_PLAYER)
11871 {
11872 PluginDeveloper.SetDeveloperItemClientEx(player);
11873 }
11874 #endif
11876 {
11877 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11878 {
11879 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11880 OnDebugButtonPressServer(id + 1);
11881 }
11882
11883 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11884 {
11885 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11887 }
11888
11889 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11890 {
11891 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11893 }
11894
11895 else if (action_id ==
EActions.ADD_QUANTITY)
11896 {
11897 if (IsMagazine())
11898 {
11899 Magazine mag = Magazine.Cast(this);
11900 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11901 }
11902 else
11903 {
11905 }
11906
11907 if (m_EM)
11908 {
11909 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11910 }
11911
11912 }
11913
11914 else if (action_id ==
EActions.REMOVE_QUANTITY)
11915 {
11916 if (IsMagazine())
11917 {
11918 Magazine mag2 = Magazine.Cast(this);
11919 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11920 }
11921 else
11922 {
11924 }
11925 if (m_EM)
11926 {
11927 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11928 }
11929
11930 }
11931
11932 else if (action_id ==
EActions.SET_QUANTITY_0)
11933 {
11935
11936 if (m_EM)
11937 {
11938 m_EM.SetEnergy(0);
11939 }
11940 }
11941
11942 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11943 {
11945
11946 if (m_EM)
11947 {
11948 m_EM.SetEnergy(m_EM.GetEnergyMax());
11949 }
11950 }
11951
11952 else if (action_id ==
EActions.ADD_HEALTH)
11953 {
11954 AddHealth("","",GetMaxHealth("","Health")/5);
11955 }
11956 else if (action_id ==
EActions.REMOVE_HEALTH)
11957 {
11958 AddHealth("","",-GetMaxHealth("","Health")/5);
11959 }
11960 else if (action_id ==
EActions.DESTROY_HEALTH)
11961 {
11962 SetHealth01("","",0);
11963 }
11964 else if (action_id ==
EActions.WATCH_ITEM)
11965 {
11967 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11968 #ifdef DEVELOPER
11969 SetDebugDeveloper_item(this);
11970 #endif
11971 }
11972
11973 else if (action_id ==
EActions.ADD_TEMPERATURE)
11974 {
11975 AddTemperature(20);
11976
11977 }
11978
11979 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11980 {
11981 AddTemperature(-20);
11982
11983 }
11984
11985 else if (action_id ==
EActions.FLIP_FROZEN)
11986 {
11987 SetFrozen(!GetIsFrozen());
11988
11989 }
11990
11991 else if (action_id ==
EActions.ADD_WETNESS)
11992 {
11994
11995 }
11996
11997 else if (action_id ==
EActions.REMOVE_WETNESS)
11998 {
12000
12001 }
12002
12003 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12004 {
12007
12008
12009 }
12010
12011 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12012 {
12015 }
12016
12017 else if (action_id ==
EActions.MAKE_SPECIAL)
12018 {
12019 auto debugParams = DebugSpawnParams.WithPlayer(player);
12020 OnDebugSpawnEx(debugParams);
12021 }
12022
12023 }
12024
12025
12026 return false;
12027 }
12028
12029
12030
12031
12035
12038
12039
12040
12042 {
12043 return false;
12044 }
12045
12046
12048 {
12049 return true;
12050 }
12051
12052
12054 {
12055 return true;
12056 }
12057
12058
12059
12061 {
12062 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12064 }
12065
12068 {
12069 return null;
12070 }
12071
12073 {
12074 return false;
12075 }
12076
12078 {
12079 return false;
12080 }
12081
12085
12086
12088 {
12089 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12090 return module_repairing.CanRepair(this, item_repair_kit);
12091 }
12092
12093
12094 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12095 {
12096 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12097 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12098 }
12099
12100
12102 {
12103
12104
12105
12106
12107
12108
12109
12110
12111 return 1;
12112 }
12113
12114
12115
12117 {
12119 }
12120
12121
12122
12124 {
12126 }
12127
12128
12137 {
12138 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12139
12140 if (player)
12141 {
12142 player.MessageStatus(text);
12143 }
12144 }
12145
12146
12155 {
12156 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12157
12158 if (player)
12159 {
12160 player.MessageAction(text);
12161 }
12162 }
12163
12164
12173 {
12174 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12175
12176 if (player)
12177 {
12178 player.MessageFriendly(text);
12179 }
12180 }
12181
12182
12191 {
12192 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12193
12194 if (player)
12195 {
12196 player.MessageImportant(text);
12197 }
12198 }
12199
12201 {
12202 return true;
12203 }
12204
12205
12206 override bool KindOf(
string tag)
12207 {
12208 bool found = false;
12209 string item_name = this.
GetType();
12212
12213 int array_size = item_tag_array.Count();
12214 for (int i = 0; i < array_size; i++)
12215 {
12216 if (item_tag_array.Get(i) == tag)
12217 {
12218 found = true;
12219 break;
12220 }
12221 }
12222 return found;
12223 }
12224
12225
12227 {
12228
12229 super.OnRPC(sender, rpc_type,ctx);
12230
12231
12232 switch (rpc_type)
12233 {
12234 #ifndef SERVER
12235 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12236 Param2<bool, string> p = new Param2<bool, string>(false, "");
12237
12239 return;
12240
12241 bool play = p.param1;
12242 string soundSet = p.param2;
12243
12244 if (play)
12245 {
12247 {
12249 {
12251 }
12252 }
12253 else
12254 {
12256 }
12257 }
12258 else
12259 {
12261 }
12262
12263 break;
12264 #endif
12265
12266 }
12267
12269 {
12271 }
12272 }
12273
12274
12275
12276
12278 {
12279 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12280 return plugin.GetID(
name);
12281 }
12282
12284 {
12285 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12286 return plugin.GetName(id);
12287 }
12288
12291 {
12292
12293
12294 int varFlags;
12295 if (!ctx.
Read(varFlags))
12296 return;
12297
12298 if (varFlags & ItemVariableFlags.FLOAT)
12299 {
12301 }
12302 }
12303
12305 {
12306
12307 super.SerializeNumericalVars(floats_out);
12308
12309
12310
12312 {
12314 }
12315
12317 {
12319 }
12320
12322 {
12324 }
12325
12327 {
12332 }
12333
12335 {
12337 }
12338 }
12339
12341 {
12342
12343 super.DeSerializeNumericalVars(floats);
12344
12345
12346 int index = 0;
12347 int mask = Math.Round(floats.Get(index));
12348
12349 index++;
12350
12352 {
12354 {
12356 }
12357 else
12358 {
12359 float quantity = floats.Get(index);
12360 SetQuantity(quantity,
true,
false,
false,
false);
12361 }
12362 index++;
12363 }
12364
12366 {
12367 float wet = floats.Get(index);
12369 index++;
12370 }
12371
12373 {
12374 int liquidtype = Math.Round(floats.Get(index));
12376 index++;
12377 }
12378
12380 {
12382 index++;
12384 index++;
12386 index++;
12388 index++;
12389 }
12390
12392 {
12393 int cleanness = Math.Round(floats.Get(index));
12395 index++;
12396 }
12397 }
12398
12400 {
12401 super.WriteVarsToCTX(ctx);
12402
12403
12405 {
12407 }
12408
12410 {
12412 }
12413
12415 {
12417 }
12418
12420 {
12421 int r,g,b,a;
12427 }
12428
12430 {
12432 }
12433 }
12434
12436 {
12437 if (!super.ReadVarsFromCTX(ctx,version))
12438 return false;
12439
12440 int intValue;
12441 float value;
12442
12443 if (version < 140)
12444 {
12445 if (!ctx.
Read(intValue))
12446 return false;
12447
12448 m_VariablesMask = intValue;
12449 }
12450
12452 {
12453 if (!ctx.
Read(value))
12454 return false;
12455
12457 {
12459 }
12460 else
12461 {
12463 }
12464 }
12465
12466 if (version < 140)
12467 {
12469 {
12470 if (!ctx.
Read(value))
12471 return false;
12472 SetTemperatureDirect(value);
12473 }
12474 }
12475
12477 {
12478 if (!ctx.
Read(value))
12479 return false;
12481 }
12482
12484 {
12485 if (!ctx.
Read(intValue))
12486 return false;
12488 }
12489
12491 {
12492 int r,g,b,a;
12494 return false;
12496 return false;
12498 return false;
12500 return false;
12501
12503 }
12504
12506 {
12507 if (!ctx.
Read(intValue))
12508 return false;
12510 }
12511
12512 if (version >= 138 && version < 140)
12513 {
12515 {
12516 if (!ctx.
Read(intValue))
12517 return false;
12518 SetFrozen(intValue);
12519 }
12520 }
12521
12522 return true;
12523 }
12524
12525
12527 {
12530 {
12532 }
12533
12534 if (!super.OnStoreLoad(ctx, version))
12535 {
12537 return false;
12538 }
12539
12540 if (version >= 114)
12541 {
12542 bool hasQuickBarIndexSaved;
12543
12544 if (!ctx.
Read(hasQuickBarIndexSaved))
12545 {
12547 return false;
12548 }
12549
12550 if (hasQuickBarIndexSaved)
12551 {
12552 int itmQBIndex;
12553
12554
12555 if (!ctx.
Read(itmQBIndex))
12556 {
12558 return false;
12559 }
12560
12561 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12562 if (itmQBIndex != -1 && parentPlayer)
12563 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12564 }
12565 }
12566 else
12567 {
12568
12569 PlayerBase player;
12570 int itemQBIndex;
12571 if (version ==
int.
MAX)
12572 {
12573 if (!ctx.
Read(itemQBIndex))
12574 {
12576 return false;
12577 }
12578 }
12579 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12580 {
12581
12582 if (!ctx.
Read(itemQBIndex))
12583 {
12585 return false;
12586 }
12587 if (itemQBIndex != -1 && player)
12588 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12589 }
12590 }
12591
12592 if (version < 140)
12593 {
12594
12595 if (!LoadVariables(ctx, version))
12596 {
12598 return false;
12599 }
12600 }
12601
12602
12604 {
12606 return false;
12607 }
12608 if (version >= 132)
12609 {
12611 if (raib)
12612 {
12614 {
12616 return false;
12617 }
12618 }
12619 }
12620
12622 return true;
12623 }
12624
12625
12626
12628 {
12629 super.OnStoreSave(ctx);
12630
12631 PlayerBase player;
12632 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12633 {
12635
12636 int itemQBIndex = -1;
12637 itemQBIndex = player.FindQuickBarEntityIndex(this);
12638 ctx.
Write(itemQBIndex);
12639 }
12640 else
12641 {
12643 }
12644
12646
12648 if (raib)
12649 {
12651 }
12652 }
12653
12654
12656 {
12657 super.AfterStoreLoad();
12658
12660 {
12662 }
12663
12665 {
12668 }
12669 }
12670
12672 {
12673 super.EEOnAfterLoad();
12674
12676 {
12678 }
12679
12682 }
12683
12685 {
12686 return false;
12687 }
12688
12689
12690
12692 {
12694 {
12695 #ifdef PLATFORM_CONSOLE
12696
12698 {
12700 if (menu)
12701 {
12703 }
12704 }
12705 #endif
12706 }
12707
12709 {
12712 }
12713
12715 {
12716 SetWeightDirty();
12718 }
12720 {
12723 }
12724
12726 {
12729 }
12731 {
12734 }
12735
12736 super.OnVariablesSynchronized();
12737 }
12738
12739
12740
12742 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12743 {
12744 if (!IsServerCheck(allow_client))
12745 return false;
12746
12748 return false;
12749
12752
12753 if (value <= (min + 0.001))
12754 value = min;
12755
12756 if (value == min)
12757 {
12758 if (destroy_config)
12759 {
12760 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12761 if (dstr)
12762 {
12764 this.Delete();
12765 return true;
12766 }
12767 }
12768 else if (destroy_forced)
12769 {
12771 this.Delete();
12772 return true;
12773 }
12774
12776 }
12777
12780
12782 {
12784
12785 if (delta)
12787 }
12788
12790
12791 return false;
12792 }
12793
12794
12796 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12797 {
12799 }
12800
12802 {
12805 }
12806
12808 {
12811 }
12812
12814 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12815 {
12816 float value_clamped = Math.Clamp(value, 0, 1);
12818 SetQuantity(result, destroy_config, destroy_forced);
12819 }
12820
12821
12824 {
12826 }
12827
12829 {
12831 }
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12843 {
12844 int slot = -1;
12845 if (GetInventory())
12846 {
12847 InventoryLocation il = new InventoryLocation;
12848 GetInventory().GetCurrentInventoryLocation(il);
12850 }
12851
12853 }
12854
12856 {
12857 float quantity_max = 0;
12858
12860 {
12861 if (attSlotID != -1)
12862 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12863
12864 if (quantity_max <= 0)
12866 }
12867
12868 if (quantity_max <= 0)
12870
12871 return quantity_max;
12872 }
12873
12875 {
12877 }
12878
12880 {
12882 }
12883
12884
12886 {
12888 }
12889
12891 {
12893 }
12894
12896 {
12898 }
12899
12900
12902 {
12903
12904 float weightEx = GetWeightEx();
12905 float special = GetInventoryAndCargoWeight();
12906 return weightEx - special;
12907 }
12908
12909
12911 {
12913 }
12914
12916 {
12918 {
12919 #ifdef DEVELOPER
12920 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12921 {
12922 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12924 }
12925 #endif
12926
12927 return GetQuantity() * GetConfigWeightModified();
12928 }
12929 else if (HasEnergyManager())
12930 {
12931 #ifdef DEVELOPER
12932 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12933 {
12934 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12935 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12936 }
12937 #endif
12938 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12939 }
12940 else
12941 {
12942 #ifdef DEVELOPER
12943 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12944 {
12945 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12946 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12947 }
12948 #endif
12949 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12950 }
12951 }
12952
12955 {
12956 int item_count = 0;
12958
12959 if (GetInventory().GetCargo() != NULL)
12960 {
12961 item_count = GetInventory().GetCargo().GetItemCount();
12962 }
12963
12964 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12965 {
12966 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12967 if (item)
12968 item_count += item.GetNumberOfItems();
12969 }
12970 return item_count;
12971 }
12972
12975 {
12976 float weight = 0;
12977 float wetness = 1;
12978 if (include_wetness)
12981 {
12982 weight = wetness * m_ConfigWeight;
12983 }
12985 {
12986 weight = 1;
12987 }
12988 return weight;
12989 }
12990
12991
12992
12994 {
12995 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12996 {
12997 GameInventory inv = GetInventory();
12998 array<EntityAI> items = new array<EntityAI>;
13000 for (int i = 0; i < items.Count(); i++)
13001 {
13003 if (item)
13004 {
13006 }
13007 }
13008 }
13009 }
13010
13011
13012
13013
13015 {
13016 float energy = 0;
13017 if (HasEnergyManager())
13018 {
13019 energy = GetCompEM().GetEnergy();
13020 }
13021 return energy;
13022 }
13023
13024
13026 {
13027 super.OnEnergyConsumed();
13028
13030 }
13031
13033 {
13034 super.OnEnergyAdded();
13035
13037 }
13038
13039
13041 {
13042 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13043 {
13045 {
13046 float energy_0to1 = GetCompEM().GetEnergy0To1();
13048 }
13049 }
13050 }
13051
13052
13054 {
13055 return ConfigGetFloat("heatIsolation");
13056 }
13057
13059 {
13061 }
13062
13064 {
13065 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13066 if (
GetGame().ConfigIsExisting(paramPath))
13068
13069 return 0.0;
13070 }
13071
13073 {
13074 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13075 if (
GetGame().ConfigIsExisting(paramPath))
13077
13078 return 0.0;
13079 }
13080
13081 override void SetWet(
float value,
bool allow_client =
false)
13082 {
13083 if (!IsServerCheck(allow_client))
13084 return;
13085
13088
13090
13091 m_VarWet = Math.Clamp(value, min, max);
13092
13094 {
13097 }
13098 }
13099
13100 override void AddWet(
float value)
13101 {
13103 }
13104
13106 {
13108 }
13109
13111 {
13113 }
13114
13116 {
13118 }
13119
13121 {
13123 }
13124
13126 {
13128 }
13129
13130 override void OnWetChanged(
float newVal,
float oldVal)
13131 {
13134 if (newLevel != oldLevel)
13135 {
13137 }
13138 }
13139
13141 {
13142 SetWeightDirty();
13143 }
13144
13146 {
13147 return GetWetLevelInternal(
m_VarWet);
13148 }
13149
13150
13151
13153 {
13155 }
13156
13158 {
13160 }
13161
13163 {
13165 }
13166
13168 {
13170 }
13171
13172
13173
13175 {
13176 if (ConfigIsExisting("itemModelLength"))
13177 {
13178 return ConfigGetFloat("itemModelLength");
13179 }
13180 return 0;
13181 }
13182
13184 {
13185 if (ConfigIsExisting("itemAttachOffset"))
13186 {
13187 return ConfigGetFloat("itemAttachOffset");
13188 }
13189 return 0;
13190 }
13191
13192 override void SetCleanness(
int value,
bool allow_client =
false)
13193 {
13194 if (!IsServerCheck(allow_client))
13195 return;
13196
13198
13200
13203 }
13204
13206 {
13208 }
13209
13211 {
13212 return true;
13213 }
13214
13215
13216
13217
13219 {
13221 }
13222
13224 {
13226 }
13227
13228
13229
13230
13231 override void SetColor(
int r,
int g,
int b,
int a)
13232 {
13238 }
13240 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13241 {
13246 }
13247
13249 {
13251 }
13252
13255 {
13256 int r,g,b,a;
13258 r = r/255;
13259 g = g/255;
13260 b = b/255;
13261 a = a/255;
13262 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13263 }
13264
13265
13266
13267 override void SetLiquidType(
int value,
bool allow_client =
false)
13268 {
13269 if (!IsServerCheck(allow_client))
13270 return;
13271
13276 }
13277
13279 {
13280 return ConfigGetInt("varLiquidTypeInit");
13281 }
13282
13284 {
13286 }
13287
13289 {
13291 SetFrozen(false);
13292 }
13293
13296 {
13297 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13298 }
13299
13300
13303 {
13304 PlayerBase nplayer;
13305 if (PlayerBase.CastTo(nplayer, player))
13306 {
13308
13309 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13310 }
13311 }
13312
13313
13316 {
13317 PlayerBase nplayer;
13318 if (PlayerBase.CastTo(nplayer,player))
13319 {
13320
13321 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13322
13323 }
13324
13325
13326 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13327
13328
13329 if (HasEnergyManager())
13330 {
13331 GetCompEM().UpdatePlugState();
13332 }
13333 }
13334
13335
13337 {
13338 super.OnPlacementStarted(player);
13339
13341 }
13342
13343 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13344 {
13346 {
13347 m_AdminLog.OnPlacementComplete(player,
this);
13348 }
13349
13350 super.OnPlacementComplete(player, position, orientation);
13351 }
13352
13353
13354
13355
13356
13358 {
13360 {
13361 return true;
13362 }
13363 else
13364 {
13365 return false;
13366 }
13367 }
13368
13369
13371 {
13373 {
13375 }
13376 }
13377
13378
13380 {
13382 }
13383
13385 {
13387 }
13388
13389 override void InsertAgent(
int agent,
float count = 1)
13390 {
13391 if (count < 1)
13392 return;
13393
13395 }
13396
13399 {
13401 }
13402
13403
13405 {
13407 }
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13451 {
13453 return false;
13454 return true;
13455 }
13456
13458 {
13459
13461 }
13462
13463
13466 {
13467 super.CheckForRoofLimited(timeTresholdMS);
13468
13470 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13471 {
13472 m_PreviousRoofTestTime = time;
13473 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13474 }
13475 }
13476
13477
13479 {
13481 {
13482 return 0;
13483 }
13484
13485 if (GetInventory().GetAttachmentSlotsCount() != 0)
13486 {
13487 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13488 if (filter)
13489 return filter.GetProtectionLevel(type, false, system);
13490 else
13491 return 0;
13492 }
13493
13494 string subclassPath, entryName;
13495
13496 switch (type)
13497 {
13499 entryName = "biological";
13500 break;
13502 entryName = "chemical";
13503 break;
13504 default:
13505 entryName = "biological";
13506 break;
13507 }
13508
13509 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13510
13512 }
13513
13514
13515
13518 {
13519 if (!IsMagazine())
13521
13523 }
13524
13525
13526
13527
13528
13533 {
13534 return true;
13535 }
13536
13538 {
13540 }
13541
13542
13543
13544
13545
13547 {
13548 if (parent)
13549 {
13550 if (parent.IsInherited(DayZInfected))
13551 return true;
13552
13553 if (!parent.IsRuined())
13554 return true;
13555 }
13556
13557 return true;
13558 }
13559
13561 {
13562 if (!super.CanPutAsAttachment(parent))
13563 {
13564 return false;
13565 }
13566
13567 if (!IsRuined() && !parent.IsRuined())
13568 {
13569 return true;
13570 }
13571
13572 return false;
13573 }
13574
13576 {
13577
13578
13579
13580
13581 return super.CanReceiveItemIntoCargo(item);
13582 }
13583
13585 {
13586
13587
13588
13589
13590 GameInventory attachmentInv = attachment.GetInventory();
13592 {
13593 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13594 return false;
13595 }
13596
13597 InventoryLocation loc = new InventoryLocation();
13598 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13599 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13600 return false;
13601
13602 return super.CanReceiveAttachment(attachment, slotId);
13603 }
13604
13606 {
13607 if (!super.CanReleaseAttachment(attachment))
13608 return false;
13609
13610 return GetInventory().AreChildrenAccessible();
13611 }
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13634 {
13635 int id = muzzle_owner.GetMuzzleID();
13636 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13637
13638 if (WPOF_array)
13639 {
13640 for (int i = 0; i < WPOF_array.Count(); i++)
13641 {
13642 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13643
13644 if (WPOF)
13645 {
13646 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13647 }
13648 }
13649 }
13650 }
13651
13652
13654 {
13655 int id = muzzle_owner.GetMuzzleID();
13657
13658 if (WPOBE_array)
13659 {
13660 for (int i = 0; i < WPOBE_array.Count(); i++)
13661 {
13662 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13663
13664 if (WPOBE)
13665 {
13666 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13667 }
13668 }
13669 }
13670 }
13671
13672
13674 {
13675 int id = muzzle_owner.GetMuzzleID();
13676 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13677
13678 if (WPOOH_array)
13679 {
13680 for (int i = 0; i < WPOOH_array.Count(); i++)
13681 {
13682 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13683
13684 if (WPOOH)
13685 {
13686 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13687 }
13688 }
13689 }
13690 }
13691
13692
13694 {
13695 int id = muzzle_owner.GetMuzzleID();
13696 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13697
13698 if (WPOOH_array)
13699 {
13700 for (int i = 0; i < WPOOH_array.Count(); i++)
13701 {
13702 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13703
13704 if (WPOOH)
13705 {
13706 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13707 }
13708 }
13709 }
13710 }
13711
13712
13714 {
13715 int id = muzzle_owner.GetMuzzleID();
13716 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13717
13718 if (WPOOH_array)
13719 {
13720 for (int i = 0; i < WPOOH_array.Count(); i++)
13721 {
13722 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13723
13724 if (WPOOH)
13725 {
13726 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13727 }
13728 }
13729 }
13730 }
13731
13732
13733
13735 {
13737 {
13738 return true;
13739 }
13740
13741 return false;
13742 }
13743
13745 {
13747 {
13748 return true;
13749 }
13750
13751 return false;
13752 }
13753
13755 {
13757 {
13758 return true;
13759 }
13760
13761 return false;
13762 }
13763
13765 {
13766 return false;
13767 }
13768
13771 {
13772 return UATimeSpent.DEFAULT_DEPLOY;
13773 }
13774
13775
13776
13777
13779 {
13781 SetSynchDirty();
13782 }
13783
13785 {
13787 }
13788
13789
13791 {
13792 return false;
13793 }
13794
13797 {
13798 string att_type = "None";
13799
13800 if (ConfigIsExisting("soundAttType"))
13801 {
13802 att_type = ConfigGetString("soundAttType");
13803 }
13804
13806 }
13807
13809 {
13811 }
13812
13813
13814
13815
13816
13822
13824 {
13827
13829 }
13830
13831
13833 {
13835 return;
13836
13838
13841
13844
13845 SoundParameters params = new SoundParameters();
13849 }
13850
13851
13853 {
13855 return;
13856
13858 SetSynchDirty();
13859
13862 }
13863
13864
13866 {
13868 return;
13869
13871 SetSynchDirty();
13872
13875 }
13876
13878 {
13880 }
13881
13883 {
13885 }
13886
13889 {
13890 if (!
GetGame().IsDedicatedServer())
13891 {
13892 if (ConfigIsExisting("attachSoundSet"))
13893 {
13894 string cfg_path = "";
13895 string soundset = "";
13896 string type_name =
GetType();
13897
13900 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13901 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13902
13903 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13904 {
13905 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13906 {
13907 if (cfg_slot_array[i] == slot_type)
13908 {
13909 soundset = cfg_soundset_array[i];
13910 break;
13911 }
13912 }
13913 }
13914
13915 if (soundset != "")
13916 {
13917 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13919 }
13920 }
13921 }
13922 }
13923
13925 {
13926
13927 }
13928
13929 void OnApply(PlayerBase player);
13930
13932 {
13933 return 1.0;
13934 };
13935
13937 {
13939 }
13940
13942 {
13944 }
13945
13947
13949 {
13950 SetDynamicPhysicsLifeTime(0.01);
13952 }
13953
13955 {
13956 array<string> zone_names = new array<string>;
13957 GetDamageZones(zone_names);
13958 for (int i = 0; i < zone_names.Count(); i++)
13959 {
13960 SetHealthMax(zone_names.Get(i),"Health");
13961 }
13962 SetHealthMax("","Health");
13963 }
13964
13967 {
13968 float global_health = GetHealth01("","Health");
13969 array<string> zones = new array<string>;
13970 GetDamageZones(zones);
13971
13972 for (int i = 0; i < zones.Count(); i++)
13973 {
13974 SetHealth01(zones.Get(i),"Health",global_health);
13975 }
13976 }
13977
13980 {
13981 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13982 }
13983
13985 {
13986 if (!hasRootAsPlayer)
13987 {
13988 if (refParentIB)
13989 {
13990
13991 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13992 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13993
13994 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13995 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13996
13999 }
14000 else
14001 {
14002
14005 }
14006 }
14007 }
14008
14010 {
14012 {
14013 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14014 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14015 {
14016 float heatPermCoef = 1.0;
14018 while (ent)
14019 {
14020 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14021 ent = ent.GetHierarchyParent();
14022 }
14023
14024 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14025 }
14026 }
14027 }
14028
14030 {
14031
14032 EntityAI parent = GetHierarchyParent();
14033 if (!parent)
14034 {
14035 hasParent = false;
14036 hasRootAsPlayer = false;
14037 }
14038 else
14039 {
14040 hasParent = true;
14041 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14042 refParentIB =
ItemBase.Cast(parent);
14043 }
14044 }
14045
14046 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14047 {
14048
14049 }
14050
14052 {
14053
14054 return false;
14055 }
14056
14058 {
14059
14060
14061 return false;
14062 }
14063
14065 {
14066
14067 return false;
14068 }
14069
14072 {
14073 return !GetIsFrozen() &&
IsOpen();
14074 }
14075
14077 {
14078 bool hasParent = false, hasRootAsPlayer = false;
14080
14081 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14082 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14083
14084 if (wwtu || foodDecay)
14085 {
14089
14090 if (processWetness || processTemperature || processDecay)
14091 {
14093
14094 if (processWetness)
14095 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14096
14097 if (processTemperature)
14099
14100 if (processDecay)
14101 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14102 }
14103 }
14104 }
14105
14108 {
14110 }
14111
14113 {
14116
14117 return super.GetTemperatureFreezeThreshold();
14118 }
14119
14121 {
14124
14125 return super.GetTemperatureThawThreshold();
14126 }
14127
14129 {
14132
14133 return super.GetItemOverheatThreshold();
14134 }
14135
14137 {
14139 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14140
14141 return super.GetTemperatureFreezeTime();
14142 }
14143
14145 {
14147 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14148
14149 return super.GetTemperatureThawTime();
14150 }
14151
14156
14158 {
14159 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14160 }
14161
14163 {
14164 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14165 }
14166
14169 {
14171 }
14172
14174 {
14176 }
14177
14179 {
14181 }
14182
14185 {
14186 return null;
14187 }
14188
14191 {
14192 return false;
14193 }
14194
14196 {
14198 {
14201 if (!trg)
14202 {
14204 explosive = this;
14205 }
14206
14207 explosive.PairRemote(trg);
14209
14210 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14211 trg.SetPersistentPairID(persistentID);
14212 explosive.SetPersistentPairID(persistentID);
14213
14214 return true;
14215 }
14216 return false;
14217 }
14218
14221 {
14222 float ret = 1.0;
14225 ret *= GetHealth01();
14226
14227 return ret;
14228 }
14229
14230 #ifdef DEVELOPER
14231 override void SetDebugItem()
14232 {
14233 super.SetDebugItem();
14234 _itemBase = this;
14235 }
14236
14238 {
14239 string text = super.GetDebugText();
14240
14242 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14243
14244 return text;
14245 }
14246 #endif
14247
14249 {
14250 return true;
14251 }
14252
14254
14256
14258 {
14261 }
14262
14263
14271
14287}
14288
14290{
14292 if (entity)
14293 {
14294 bool is_item = entity.IsInherited(
ItemBase);
14295 if (is_item && full_quantity)
14296 {
14299 }
14300 }
14301 else
14302 {
14304 return NULL;
14305 }
14306 return entity;
14307}
14308
14310{
14311 if (item)
14312 {
14313 if (health > 0)
14314 item.SetHealth("", "", health);
14315
14316 if (item.CanHaveTemperature())
14317 {
14319 if (item.CanFreeze())
14320 item.SetFrozen(false);
14321 }
14322
14323 if (item.HasEnergyManager())
14324 {
14325 if (quantity >= 0)
14326 {
14327 item.GetCompEM().SetEnergy0To1(quantity);
14328 }
14329 else
14330 {
14332 }
14333 }
14334 else if (item.IsMagazine())
14335 {
14336 Magazine mag = Magazine.Cast(item);
14337 if (quantity >= 0)
14338 {
14339 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14340 }
14341 else
14342 {
14344 }
14345
14346 }
14347 else
14348 {
14349 if (quantity >= 0)
14350 {
14351 item.SetQuantityNormalized(quantity, false);
14352 }
14353 else
14354 {
14356 }
14357
14358 }
14359 }
14360}
14361
14362#ifdef DEVELOPER
14364#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.