If we need a different (handheld)item action widget displayed, the logic goes in here.
9456{
9458 {
9459 return true;
9460 }
9461};
9462
9463
9464
9466{
9470
9472
9475
9476
9477
9478
9479
9488
9494
9499
9504
9525 protected bool m_IsResultOfSplit
9526
9528
9533
9534
9535
9537
9541
9542
9543
9545
9548
9549
9550
9556
9557
9565
9568
9569
9571
9572
9574
9575
9580
9581
9586
9587
9589
9590
9592 {
9597
9598 if (!
GetGame().IsDedicatedServer())
9599 {
9601 {
9603
9605 {
9607 }
9608 }
9609
9612 }
9613
9614 m_OldLocation = null;
9615
9617 {
9619 }
9620
9621 if (ConfigIsExisting("headSelectionsToHide"))
9622 {
9625 }
9626
9628 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9629 {
9631 }
9632
9634
9635 m_IsResultOfSplit = false;
9636
9638 }
9639
9641 {
9642 super.InitItemVariables();
9643
9649 m_Count = ConfigGetInt(
"count");
9650
9653
9658
9661
9666
9678
9682
9683
9686 if (ConfigIsExisting("canBeSplit"))
9687 {
9690 }
9691
9693 if (ConfigIsExisting("itemBehaviour"))
9695
9696
9699 RegisterNetSyncVariableInt("m_VarLiquidType");
9700 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9701
9702 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9703 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9704 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9705
9706 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9707 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9708 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9709 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9710
9711 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9712 RegisterNetSyncVariableBool("m_IsTakeable");
9713 RegisterNetSyncVariableBool("m_IsHologram");
9714
9717 {
9720 }
9721
9723
9725 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9727
9728 }
9729
9731 {
9733 }
9734
9736 {
9739 {
9744 }
9745 }
9746
9747 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9748 {
9750 {
9753 }
9754
9756 }
9757
9759 {
9765 }
9766
9768
9770 {
9772
9773 if (!action)
9774 {
9775 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9776 return;
9777 }
9778
9780 if (!ai)
9781 {
9783 return;
9784 }
9785
9787 if (!action_array)
9788 {
9789 action_array = new array<ActionBase_Basic>;
9791 }
9792 if (LogManager.IsActionLogEnable())
9793 {
9794 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9795 }
9796
9797 if (action_array.Find(action) != -1)
9798 {
9799 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9800 }
9801 else
9802 {
9803 action_array.Insert(action);
9804 }
9805 }
9806
9808 {
9810 ActionBase action = player.GetActionManager().GetAction(actionName);
9813
9814 if (action_array)
9815 {
9816 action_array.RemoveItem(action);
9817 }
9818 }
9819
9820
9821
9823 {
9824 ActionOverrideData overrideData = new ActionOverrideData();
9828
9830 if (!actionMap)
9831 {
9834 }
9835
9836 actionMap.Insert(this.
Type(), overrideData);
9837
9838 }
9839
9841
9843
9844
9846 {
9849
9852
9853 string config_to_search = "CfgVehicles";
9854 string muzzle_owner_config;
9855
9857 {
9858 if (IsInherited(Weapon))
9859 config_to_search = "CfgWeapons";
9860
9861 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9862
9863 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9864
9866
9867 if (config_OnFire_subclass_count > 0)
9868 {
9869 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9870
9871 for (int i = 0; i < config_OnFire_subclass_count; i++)
9872 {
9873 string particle_class = "";
9875 string config_OnFire_entry = config_OnFire_class + particle_class;
9876 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9877 WPOF_array.Insert(WPOF);
9878 }
9879
9880
9882 }
9883 }
9884
9886 {
9887 config_to_search = "CfgWeapons";
9888 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9889
9890 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9891
9893
9894 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9895 {
9896 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9897
9898 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9899 {
9900 string particle_class2 = "";
9902 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9903 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9904 WPOBE_array.Insert(WPOBE);
9905 }
9906
9907
9909 }
9910 }
9911 }
9912
9913
9915 {
9918
9920 {
9921 string config_to_search = "CfgVehicles";
9922
9923 if (IsInherited(Weapon))
9924 config_to_search = "CfgWeapons";
9925
9926 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9927 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9928
9929 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9930 {
9931
9933
9935 {
9937 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9939 return;
9940 }
9941
9944
9945
9946
9948 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9949
9950 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9951 {
9952 string particle_class = "";
9954 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9956
9957 if (entry_type == CT_CLASS)
9958 {
9959 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9960 WPOOH_array.Insert(WPOF);
9961 }
9962 }
9963
9964
9966 }
9967 }
9968 }
9969
9971 {
9973 }
9974
9976 {
9978 {
9980
9983
9986
9987 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9988 }
9989 }
9990
9992 {
9994 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9995
9997 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9998
10000 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10001
10003 {
10005 }
10006 }
10007
10009 {
10011 }
10012
10014 {
10017 else
10019
10021 {
10024 }
10025 else
10026 {
10029
10032 }
10033
10035 }
10036
10038 {
10040 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10041 }
10042
10044 {
10046 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10048 }
10049
10051 {
10053 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10054 }
10055
10057 {
10060
10061 OverheatingParticle OP = new OverheatingParticle();
10066
10068 }
10069
10071 {
10074
10075 return -1;
10076 }
10077
10079 {
10081 {
10084
10085 for (int i = count; i > 0; --i)
10086 {
10087 int id = i - 1;
10090
10093
10094 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10095 {
10096 if (p)
10097 {
10100 }
10101 }
10102 }
10103 }
10104 }
10105
10107 {
10109 {
10111 {
10112 int id = i - 1;
10114
10115 if (OP)
10116 {
10118
10119 if (p)
10120 {
10122 }
10123
10124 delete OP;
10125 }
10126 }
10127
10130 }
10131 }
10132
10135 {
10136 return 0.0;
10137 }
10138
10139
10141 {
10142 return 250;
10143 }
10144
10146 {
10147 return 0;
10148 }
10149
10152 {
10154 return true;
10155
10156 return false;
10157 }
10158
10161 {
10164
10166 {
10168 }
10169 else
10170 {
10171
10173 }
10174
10176 }
10177
10184 {
10185 return -1;
10186 }
10187
10188
10189
10190
10192 {
10194 {
10196 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10197
10198 if (r_index >= 0)
10199 {
10200 InventoryLocation r_il = new InventoryLocation;
10201 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10202
10203 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10206 {
10207 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10208 }
10210 {
10211 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10212 }
10213
10214 }
10215
10216 player.GetHumanInventory().ClearUserReservedLocation(this);
10217 }
10218
10221 }
10222
10223
10224
10225
10227 {
10228 return ItemBase.m_DebugActionsMask;
10229 }
10230
10232 {
10233 return ItemBase.m_DebugActionsMask & mask;
10234 }
10235
10237 {
10238 ItemBase.m_DebugActionsMask = mask;
10239 }
10240
10242 {
10243 ItemBase.m_DebugActionsMask |= mask;
10244 }
10245
10247 {
10248 ItemBase.m_DebugActionsMask &= ~mask;
10249 }
10250
10252 {
10254 {
10256 }
10257 else
10258 {
10260 }
10261 }
10262
10263
10265 {
10266 if (GetEconomyProfile())
10267 {
10268 float q_max = GetEconomyProfile().GetQuantityMax();
10269 if (q_max > 0)
10270 {
10271 float q_min = GetEconomyProfile().GetQuantityMin();
10272 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10273
10275 {
10276 ComponentEnergyManager comp = GetCompEM();
10278 {
10280 }
10281 }
10283 {
10285
10286 }
10287
10288 }
10289 }
10290 }
10291
10294 {
10295 EntityAI parent = GetHierarchyParent();
10296
10297 if (parent)
10298 {
10299 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10300 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10301 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10302 }
10303 }
10304
10307 {
10308 EntityAI parent = GetHierarchyParent();
10309
10310 if (parent)
10311 {
10312 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10313 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10314 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10315 }
10316 }
10317
10319 {
10320
10321
10322
10323
10325
10327 {
10328 if (ScriptInputUserData.CanStoreInputUserData())
10329 {
10330 ScriptInputUserData ctx = new ScriptInputUserData;
10336 ctx.
Write(use_stack_max);
10339
10341 {
10342 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10343 }
10344 }
10345 }
10346 else if (!
GetGame().IsMultiplayer())
10347 {
10349 }
10350 }
10351
10353 {
10355 }
10356
10358 {
10360 }
10361
10363 {
10365 }
10366
10368 {
10369
10370 return false;
10371 }
10372
10374 {
10375 return false;
10376 }
10377
10381 {
10382 return false;
10383 }
10384
10386 {
10387 return "";
10388 }
10389
10391
10393 {
10394 return false;
10395 }
10396
10398 {
10399 return true;
10400 }
10401
10402
10403
10405 {
10406 return true;
10407 }
10408
10410 {
10411 return true;
10412 }
10413
10415 {
10416 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10418 }
10419
10421 {
10423 }
10424
10426 {
10428 if (!is_being_placed)
10430 SetSynchDirty();
10431 }
10432
10433
10435
10437 {
10439 }
10440
10442 {
10444 }
10445
10447 {
10448 return 1;
10449 }
10450
10452 {
10453 return false;
10454 }
10455
10457 {
10459 SetSynchDirty();
10460 }
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10497 {
10498 super.OnMovedInsideCargo(container);
10499
10500 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10501 }
10502
10503 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10504 {
10505 super.EEItemLocationChanged(oldLoc,newLoc);
10506
10507 PlayerBase new_player = null;
10508 PlayerBase old_player = null;
10509
10510 if (newLoc.GetParent())
10511 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10512
10513 if (oldLoc.GetParent())
10514 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10515
10517 {
10518 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10519
10520 if (r_index >= 0)
10521 {
10522 InventoryLocation r_il = new InventoryLocation;
10523 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10524
10525 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10528 {
10529 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10530 }
10532 {
10533 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10534 }
10535
10536 }
10537 }
10538
10540 {
10541 if (new_player)
10542 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10543
10544 if (new_player == old_player)
10545 {
10546
10547 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10548 {
10550 {
10551 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10552 {
10553 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10554 }
10555 }
10556 else
10557 {
10558 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10559 }
10560 }
10561
10562 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10563 {
10564 int type = oldLoc.GetType();
10566 {
10567 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10568 }
10570 {
10571 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10572 }
10573 }
10574 if (!m_OldLocation)
10575 {
10576 m_OldLocation = new InventoryLocation;
10577 }
10578 m_OldLocation.Copy(oldLoc);
10579 }
10580 else
10581 {
10582 if (m_OldLocation)
10583 {
10584 m_OldLocation.Reset();
10585 }
10586 }
10587
10589 }
10590 else
10591 {
10592 if (new_player)
10593 {
10594 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10595 if (res_index >= 0)
10596 {
10597 InventoryLocation il = new InventoryLocation;
10598 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10600 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10603 {
10604 il.
GetParent().GetOnReleaseLock().Invoke(it);
10605 }
10607 {
10609 }
10610
10611 }
10612 }
10614 {
10615
10617 }
10618
10619 if (m_OldLocation)
10620 {
10621 m_OldLocation.Reset();
10622 }
10623 }
10624 }
10625
10626 override void EOnContact(IEntity other, Contact extra)
10627 {
10629 {
10630 int liquidType = -1;
10632 if (impactSpeed > 0.0)
10633 {
10635 #ifndef SERVER
10637 #else
10639 SetSynchDirty();
10640 #endif
10642 }
10643 }
10644
10645 #ifdef SERVER
10646 if (GetCompEM() && GetCompEM().IsPlugged())
10647 {
10648 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10649 GetCompEM().UnplugThis();
10650 }
10651 #endif
10652 }
10653
10655
10657 {
10659 }
10660
10662 {
10663
10664 }
10665
10667 {
10668 super.OnItemLocationChanged(old_owner, new_owner);
10669
10670 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10671 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10672
10673 if (!relatedPlayer && playerNew)
10674 relatedPlayer = playerNew;
10675
10676 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10677 {
10679 if (actionMgr)
10680 {
10681 ActionBase currentAction = actionMgr.GetRunningAction();
10682 if (currentAction)
10684 }
10685 }
10686
10687 Man ownerPlayerOld = null;
10688 Man ownerPlayerNew = null;
10689
10690 if (old_owner)
10691 {
10692 if (old_owner.
IsMan())
10693 {
10694 ownerPlayerOld = Man.Cast(old_owner);
10695 }
10696 else
10697 {
10698 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10699 }
10700 }
10701 else
10702 {
10704 {
10706
10707 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10708 {
10709 GetCompEM().UnplugThis();
10710 }
10711 }
10712 }
10713
10714 if (new_owner)
10715 {
10716 if (new_owner.
IsMan())
10717 {
10718 ownerPlayerNew = Man.Cast(new_owner);
10719 }
10720 else
10721 {
10722 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10723 }
10724 }
10725
10726 if (ownerPlayerOld != ownerPlayerNew)
10727 {
10728 if (ownerPlayerOld)
10729 {
10730 array<EntityAI> subItemsExit = new array<EntityAI>;
10732 for (int i = 0; i < subItemsExit.Count(); i++)
10733 {
10736 }
10737 }
10738
10739 if (ownerPlayerNew)
10740 {
10741 array<EntityAI> subItemsEnter = new array<EntityAI>;
10743 for (int j = 0; j < subItemsEnter.Count(); j++)
10744 {
10747 }
10748 }
10749 }
10750 else if (ownerPlayerNew != null)
10751 {
10752 PlayerBase nplayer;
10753 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10754 {
10755 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10757 for (int k = 0; k < subItemsUpdate.Count(); k++)
10758 {
10760 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10761 }
10762 }
10763 }
10764
10765 if (old_owner)
10766 old_owner.OnChildItemRemoved(this);
10767 if (new_owner)
10768 new_owner.OnChildItemReceived(this);
10769 }
10770
10771
10773 {
10774 super.EEDelete(parent);
10775 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10776 if (player)
10777 {
10779
10780 if (player.IsAlive())
10781 {
10782 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10783 if (r_index >= 0)
10784 {
10785 InventoryLocation r_il = new InventoryLocation;
10786 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10787
10788 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10791 {
10792 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10793 }
10795 {
10796 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10797 }
10798
10799 }
10800
10801 player.RemoveQuickBarEntityShortcut(this);
10802 }
10803 }
10804 }
10805
10807 {
10808 super.EEKilled(killer);
10809
10812 {
10813 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10814 {
10815 if (IsMagazine())
10816 {
10817 if (Magazine.Cast(this).GetAmmoCount() > 0)
10818 {
10820 }
10821 }
10822 else
10823 {
10825 }
10826 }
10827 }
10828 }
10829
10831 {
10832 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10833
10834 super.OnWasAttached(parent, slot_id);
10835
10838
10840 }
10841
10843 {
10844 super.OnWasDetached(parent, slot_id);
10845
10848 }
10849
10851 {
10852 int idx;
10855
10856 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10857 if (inventory_slots.Count() < 1)
10858 {
10859 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10860 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10861 }
10862 else
10863 {
10864 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10865 }
10866
10867 idx = inventory_slots.Find(slot);
10868 if (idx < 0)
10869 return "";
10870
10871 return attach_types.Get(idx);
10872 }
10873
10875 {
10876 int idx = -1;
10877 string slot;
10878
10881
10882 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10883 if (inventory_slots.Count() < 1)
10884 {
10885 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10886 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10887 }
10888 else
10889 {
10890 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10891 if (detach_types.Count() < 1)
10892 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10893 }
10894
10895 for (int i = 0; i < inventory_slots.Count(); i++)
10896 {
10897 slot = inventory_slots.Get(i);
10898 }
10899
10900 if (slot != "")
10901 {
10902 if (detach_types.Count() == 1)
10903 idx = 0;
10904 else
10905 idx = inventory_slots.Find(slot);
10906 }
10907 if (idx < 0)
10908 return "";
10909
10910 return detach_types.Get(idx);
10911 }
10912
10914 {
10915
10917
10918
10919 float min_time = 1;
10920 float max_time = 3;
10921 float delay = Math.RandomFloat(min_time, max_time);
10922
10923 explode_timer.Run(delay, this, "DoAmmoExplosion");
10924 }
10925
10927 {
10928 Magazine magazine = Magazine.Cast(this);
10929 int pop_sounds_count = 6;
10930 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10931
10932
10933 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10934 string sound_name = pop_sounds[ sound_idx ];
10936
10937
10938 magazine.ServerAddAmmoCount(-1);
10939
10940
10941 float min_temp_to_explode = 100;
10942
10943 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10944 {
10946 }
10947 }
10948
10949
10950 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10951 {
10952 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10953
10954 const int CHANCE_DAMAGE_CARGO = 4;
10955 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10956 const int CHANCE_DAMAGE_NOTHING = 2;
10957
10959 {
10960 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10961 int chances;
10962 int rnd;
10963
10964 if (GetInventory().GetCargo())
10965 {
10966 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10967 rnd = Math.RandomInt(0,chances);
10968
10969 if (rnd < CHANCE_DAMAGE_CARGO)
10970 {
10972 }
10973 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10974 {
10976 }
10977 }
10978 else
10979 {
10980 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10981 rnd = Math.RandomInt(0,chances);
10982
10983 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10984 {
10986 }
10987 }
10988 }
10989 }
10990
10992 {
10993 if (GetInventory().GetCargo())
10994 {
10995 int item_count = GetInventory().GetCargo().GetItemCount();
10996 if (item_count > 0)
10997 {
10998 int random_pick = Math.RandomInt(0, item_count);
11000 if (!item.IsExplosive())
11001 {
11002 item.AddHealth("","",damage);
11003 return true;
11004 }
11005 }
11006 }
11007 return false;
11008 }
11009
11011 {
11012 int attachment_count = GetInventory().AttachmentCount();
11013 if (attachment_count > 0)
11014 {
11015 int random_pick = Math.RandomInt(0, attachment_count);
11016 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
11017 if (!attachment.IsExplosive())
11018 {
11019 attachment.AddHealth("","",damage);
11020 return true;
11021 }
11022 }
11023 return false;
11024 }
11025
11027 {
11029 }
11030
11032 {
11034 return GetInventory().CanRemoveEntity();
11035
11036 return false;
11037 }
11038
11040 {
11042 return;
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 {
11068 return;
11069
11070 float split_quantity_new;
11074 InventoryLocation loc = new InventoryLocation;
11075
11076 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11077 {
11079 split_quantity_new = stack_max;
11080 else
11082
11083 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11084 if (new_item)
11085 {
11086 new_item.SetResultOfSplit(true);
11087 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11089 new_item.SetQuantity(split_quantity_new);
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 {
11103 }
11104
11105 if (new_item)
11106 {
11107 new_item.SetResultOfSplit(true);
11108 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11110 new_item.SetQuantity(split_quantity_new);
11111 }
11112 }
11113 else
11114 {
11115 if (stack_max != 0)
11116 {
11118 {
11120 }
11121
11122 if (split_quantity_new == 0)
11123 {
11124 if (!
GetGame().IsMultiplayer())
11125 player.PhysicalPredictiveDropItem(this);
11126 else
11127 player.ServerDropEntity(this);
11128 return;
11129 }
11130
11132
11133 if (new_item)
11134 {
11135 new_item.SetResultOfSplit(true);
11136 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11138 new_item.SetQuantity(stack_max);
11139 new_item.PlaceOnSurface();
11140 }
11141 }
11142 }
11143 }
11144
11146 {
11148 return;
11149
11150 float split_quantity_new;
11154 InventoryLocation loc = new InventoryLocation;
11155
11156 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11157 {
11159 split_quantity_new = stack_max;
11160 else
11162
11163 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11164 if (new_item)
11165 {
11166 new_item.SetResultOfSplit(true);
11167 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11169 new_item.SetQuantity(split_quantity_new);
11170 }
11171 }
11172 else if (destination_entity && slot_id == -1)
11173 {
11174 if (quantity > stack_max)
11175 split_quantity_new = stack_max;
11176 else
11177 split_quantity_new = quantity;
11178
11180 {
11183 }
11184
11185 if (new_item)
11186 {
11187 new_item.SetResultOfSplit(true);
11188 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11190 new_item.SetQuantity(split_quantity_new);
11191 }
11192 }
11193 else
11194 {
11195 if (stack_max != 0)
11196 {
11198 {
11200 }
11201
11203
11204 if (new_item)
11205 {
11206 new_item.SetResultOfSplit(true);
11207 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11209 new_item.SetQuantity(stack_max);
11210 new_item.PlaceOnSurface();
11211 }
11212 }
11213 }
11214 }
11215
11217 {
11219 return;
11220
11222 {
11223 if (ScriptInputUserData.CanStoreInputUserData())
11224 {
11225 ScriptInputUserData ctx = new ScriptInputUserData;
11230 dst.WriteToContext(ctx);
11232 }
11233 }
11234 else if (!
GetGame().IsMultiplayer())
11235 {
11237 }
11238 }
11239
11241 {
11243 return;
11244
11246 {
11247 if (ScriptInputUserData.CanStoreInputUserData())
11248 {
11249 ScriptInputUserData ctx = new ScriptInputUserData;
11254 ctx.
Write(destination_entity);
11260 }
11261 }
11262 else if (!
GetGame().IsMultiplayer())
11263 {
11265 }
11266 }
11267
11269 {
11271 }
11272
11274 {
11276 return this;
11277
11279 float split_quantity_new;
11281 if (dst.IsValid())
11282 {
11283 int slot_id = dst.GetSlot();
11285
11286 if (quantity > stack_max)
11287 split_quantity_new = stack_max;
11288 else
11289 split_quantity_new = quantity;
11290
11292
11293 if (new_item)
11294 {
11295 new_item.SetResultOfSplit(true);
11296 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11299 }
11300
11301 return new_item;
11302 }
11303
11304 return null;
11305 }
11306
11308 {
11310 return;
11311
11313 float split_quantity_new;
11315 if (destination_entity)
11316 {
11318 if (quantity > stackable)
11319 split_quantity_new = stackable;
11320 else
11321 split_quantity_new = quantity;
11322
11323 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11324 if (new_item)
11325 {
11326 new_item.SetResultOfSplit(true);
11327 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11329 new_item.SetQuantity(split_quantity_new);
11330 }
11331 }
11332 }
11333
11335 {
11337 return;
11338
11340 {
11341 if (ScriptInputUserData.CanStoreInputUserData())
11342 {
11343 ScriptInputUserData ctx = new ScriptInputUserData;
11348 ItemBase destination_entity =
this;
11349 ctx.
Write(destination_entity);
11353 }
11354 }
11355 else if (!
GetGame().IsMultiplayer())
11356 {
11358 }
11359 }
11360
11362 {
11364 return;
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
11377 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11378 new_item =
ItemBase.Cast(in_hands);
11379 if (new_item)
11380 {
11381 new_item.SetResultOfSplit(true);
11382 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11384 new_item.SetQuantity(split_quantity_new);
11385 }
11386 }
11387 }
11388
11390 {
11392 return;
11393
11395 float split_quantity_new = Math.Floor(quantity * 0.5);
11396
11398
11399 if (new_item)
11400 {
11401 if (new_item.GetQuantityMax() < split_quantity_new)
11402 {
11403 split_quantity_new = new_item.GetQuantityMax();
11404 }
11405
11406 new_item.SetResultOfSplit(true);
11407 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11408
11410 {
11413 }
11414 else
11415 {
11418 }
11419 }
11420 }
11421
11423 {
11425 return;
11426
11428 float split_quantity_new = Math.Floor(quantity / 2);
11429
11430 InventoryLocation invloc = new InventoryLocation;
11432
11434 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11435
11436 if (new_item)
11437 {
11438 if (new_item.GetQuantityMax() < split_quantity_new)
11439 {
11440 split_quantity_new = new_item.GetQuantityMax();
11441 }
11443 {
11446 }
11447 else
11448 {
11451 }
11452 }
11453 }
11454
11457 {
11458 SetWeightDirty();
11460
11461 if (parent)
11462 parent.OnAttachmentQuantityChangedEx(this, delta);
11463
11465 {
11467 {
11469 }
11471 {
11472 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11474 }
11475 }
11476
11477 }
11478
11481 {
11482
11483 }
11484
11487 {
11489 }
11490
11492 {
11493 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11494
11496 {
11497 if (newLevel == GameConstants.STATE_RUINED)
11498 {
11500 EntityAI parent = GetHierarchyParent();
11501 if (parent && parent.IsFireplace())
11502 {
11503 CargoBase cargo = GetInventory().GetCargo();
11504 if (cargo)
11505 {
11507 {
11509 }
11510 }
11511 }
11512 }
11513
11515 {
11516
11518 return;
11519 }
11520
11521 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11522 {
11524 }
11525 }
11526 }
11527
11528
11530 {
11531 super.OnRightClick();
11532
11534 {
11536 {
11537 if (ScriptInputUserData.CanStoreInputUserData())
11538 {
11539 vector m4[4];
11541
11542 EntityAI root = GetHierarchyRoot();
11543
11544 InventoryLocation dst = new InventoryLocation;
11546 {
11547 if (root)
11548 {
11549 root.GetTransform(m4);
11551 }
11552 else
11553 GetInventory().GetCurrentInventoryLocation(dst);
11554 }
11555 else
11556 {
11558
11559
11560 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11561 {
11562 if (root)
11563 {
11564 root.GetTransform(m4);
11566 }
11567 else
11568 GetInventory().GetCurrentInventoryLocation(dst);
11569 }
11570 else
11571 {
11572 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11573 }
11574 }
11575
11576 ScriptInputUserData ctx = new ScriptInputUserData;
11584 }
11585 }
11586 else if (!
GetGame().IsMultiplayer())
11587 {
11589 }
11590 }
11591 }
11592
11593 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11594 {
11595
11596 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11597 return false;
11598
11599 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11600 return false;
11601
11602
11604 return false;
11605
11606
11607 Magazine mag = Magazine.Cast(this);
11608 if (mag)
11609 {
11610 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11611 return false;
11612
11613 if (stack_max_limit)
11614 {
11615 Magazine other_mag = Magazine.Cast(other_item);
11616 if (other_item)
11617 {
11618 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11619 return false;
11620 }
11621
11622 }
11623 }
11624 else
11625 {
11626
11628 return false;
11629
11631 return false;
11632 }
11633
11634 PlayerBase player = null;
11635 if (CastTo(player, GetHierarchyRootPlayer()))
11636 {
11637 if (player.GetInventory().HasAttachment(this))
11638 return false;
11639
11640 if (player.IsItemsToDelete())
11641 return false;
11642 }
11643
11644 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11645 return false;
11646
11647 int slotID;
11649 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11650 return false;
11651
11652 return true;
11653 }
11654
11656 {
11658 }
11659
11661 {
11662 return m_IsResultOfSplit;
11663 }
11664
11666 {
11667 m_IsResultOfSplit = value;
11668 }
11669
11671 {
11673 }
11674
11676 {
11677 float other_item_quantity = other_item.GetQuantity();
11678 float this_free_space;
11679
11681
11683
11684 if (other_item_quantity > this_free_space)
11685 {
11686 return this_free_space;
11687 }
11688 else
11689 {
11690 return other_item_quantity;
11691 }
11692 }
11693
11695 {
11697 }
11698
11700 {
11702 return;
11703
11704 if (!IsMagazine() && other_item)
11705 {
11707 if (quantity_used != 0)
11708 {
11709 float hp1 = GetHealth01("","");
11710 float hp2 = other_item.GetHealth01("","");
11711 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11712 hpResult = hpResult / (
GetQuantity() + quantity_used);
11713
11714 hpResult *= GetMaxHealth();
11715 Math.Round(hpResult);
11716 SetHealth("", "Health", hpResult);
11717
11719 other_item.AddQuantity(-quantity_used);
11720 }
11721 }
11723 }
11724
11726 {
11727 #ifdef SERVER
11728 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11729 GetHierarchyParent().IncreaseLifetimeUp();
11730 #endif
11731 };
11732
11734 {
11735 PlayerBase p = PlayerBase.Cast(player);
11736
11737 array<int> recipesIds = p.m_Recipes;
11738 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11739 if (moduleRecipesManager)
11740 {
11741 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11742 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11743 }
11744
11745 for (int i = 0;i < recipesIds.Count(); i++)
11746 {
11747 int key = recipesIds.Get(i);
11748 string recipeName = moduleRecipesManager.GetRecipeName(key);
11750 }
11751 }
11752
11753
11754 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11755 {
11756 super.GetDebugActions(outputList);
11757
11758
11763
11764
11768
11772
11773
11776
11777
11779 {
11782 }
11783
11785
11788
11792 }
11793
11794
11795
11796
11798 {
11799 super.OnAction(action_id, player, ctx);
11800 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11801 {
11802 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11803 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11804 PlayerBase p = PlayerBase.Cast(player);
11805 if (
EActions.RECIPES_RANGE_START < 1000)
11806 {
11807 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11808 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11809 }
11810 }
11811 #ifndef SERVER
11812 else if (action_id ==
EActions.WATCH_PLAYER)
11813 {
11814 PluginDeveloper.SetDeveloperItemClientEx(player);
11815 }
11816 #endif
11818 {
11819 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11820 {
11821 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11822 OnDebugButtonPressServer(id + 1);
11823 }
11824
11825 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11826 {
11827 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11829 }
11830
11831 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11832 {
11833 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11835 }
11836
11837 else if (action_id ==
EActions.ADD_QUANTITY)
11838 {
11839 if (IsMagazine())
11840 {
11841 Magazine mag = Magazine.Cast(this);
11842 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11843 }
11844 else
11845 {
11847 }
11848
11849 if (m_EM)
11850 {
11851 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11852 }
11853
11854 }
11855
11856 else if (action_id ==
EActions.REMOVE_QUANTITY)
11857 {
11858 if (IsMagazine())
11859 {
11860 Magazine mag2 = Magazine.Cast(this);
11861 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11862 }
11863 else
11864 {
11866 }
11867 if (m_EM)
11868 {
11869 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11870 }
11871
11872 }
11873
11874 else if (action_id ==
EActions.SET_QUANTITY_0)
11875 {
11877
11878 if (m_EM)
11879 {
11880 m_EM.SetEnergy(0);
11881 }
11882 }
11883
11884 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11885 {
11887
11888 if (m_EM)
11889 {
11890 m_EM.SetEnergy(m_EM.GetEnergyMax());
11891 }
11892 }
11893
11894 else if (action_id ==
EActions.ADD_HEALTH)
11895 {
11896 AddHealth("","",GetMaxHealth("","Health")/5);
11897 }
11898 else if (action_id ==
EActions.REMOVE_HEALTH)
11899 {
11900 AddHealth("","",-GetMaxHealth("","Health")/5);
11901 }
11902 else if (action_id ==
EActions.DESTROY_HEALTH)
11903 {
11904 SetHealth01("","",0);
11905 }
11906 else if (action_id ==
EActions.WATCH_ITEM)
11907 {
11909 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11910 #ifdef DEVELOPER
11911 SetDebugDeveloper_item(this);
11912 #endif
11913 }
11914
11915 else if (action_id ==
EActions.ADD_TEMPERATURE)
11916 {
11917 AddTemperature(20);
11918
11919 }
11920
11921 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11922 {
11923 AddTemperature(-20);
11924
11925 }
11926
11927 else if (action_id ==
EActions.FLIP_FROZEN)
11928 {
11929 SetFrozen(!GetIsFrozen());
11930
11931 }
11932
11933 else if (action_id ==
EActions.ADD_WETNESS)
11934 {
11936
11937 }
11938
11939 else if (action_id ==
EActions.REMOVE_WETNESS)
11940 {
11942
11943 }
11944
11945 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11946 {
11949
11950
11951 }
11952
11953 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11954 {
11957 }
11958
11959 else if (action_id ==
EActions.MAKE_SPECIAL)
11960 {
11961 auto debugParams = DebugSpawnParams.WithPlayer(player);
11962 OnDebugSpawnEx(debugParams);
11963 }
11964
11965 else if (action_id ==
EActions.DELETE)
11966 {
11967 Delete();
11968 }
11969
11970 }
11971
11972
11973 return false;
11974 }
11975
11976
11977
11978
11982
11985
11986
11987
11989 {
11990 return false;
11991 }
11992
11993
11995 {
11996 return true;
11997 }
11998
11999
12001 {
12002 return true;
12003 }
12004
12005
12006
12008 {
12009 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12011 }
12012
12015 {
12016 return null;
12017 }
12018
12020 {
12021 return false;
12022 }
12023
12025 {
12026 return false;
12027 }
12028
12032
12033
12035 {
12036 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12037 return module_repairing.CanRepair(this, item_repair_kit);
12038 }
12039
12040
12041 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12042 {
12043 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12044 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12045 }
12046
12047
12049 {
12050
12051
12052
12053
12054
12055
12056
12057
12058 return 1;
12059 }
12060
12061
12062
12064 {
12066 }
12067
12068
12069
12071 {
12073 }
12074
12075
12084 {
12085 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12086
12087 if (player)
12088 {
12089 player.MessageStatus(text);
12090 }
12091 }
12092
12093
12102 {
12103 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12104
12105 if (player)
12106 {
12107 player.MessageAction(text);
12108 }
12109 }
12110
12111
12120 {
12121 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12122
12123 if (player)
12124 {
12125 player.MessageFriendly(text);
12126 }
12127 }
12128
12129
12138 {
12139 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12140
12141 if (player)
12142 {
12143 player.MessageImportant(text);
12144 }
12145 }
12146
12148 {
12149 return true;
12150 }
12151
12152
12153 override bool KindOf(
string tag)
12154 {
12155 bool found = false;
12156 string item_name = this.
GetType();
12159
12160 int array_size = item_tag_array.Count();
12161 for (int i = 0; i < array_size; i++)
12162 {
12163 if (item_tag_array.Get(i) == tag)
12164 {
12165 found = true;
12166 break;
12167 }
12168 }
12169 return found;
12170 }
12171
12172
12174 {
12175
12176 super.OnRPC(sender, rpc_type,ctx);
12177
12178
12179 switch (rpc_type)
12180 {
12181 #ifndef SERVER
12182 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12183 Param2<bool, string> p = new Param2<bool, string>(false, "");
12184
12186 return;
12187
12188 bool play = p.param1;
12189 string soundSet = p.param2;
12190
12191 if (play)
12192 {
12194 {
12196 {
12198 }
12199 }
12200 else
12201 {
12203 }
12204 }
12205 else
12206 {
12208 }
12209
12210 break;
12211 #endif
12212
12213 }
12214
12216 {
12218 }
12219 }
12220
12221
12222
12223
12225 {
12226 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12227 return plugin.GetID(
name);
12228 }
12229
12231 {
12232 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12233 return plugin.GetName(id);
12234 }
12235
12238 {
12239
12240
12241 int varFlags;
12242 if (!ctx.
Read(varFlags))
12243 return;
12244
12245 if (varFlags & ItemVariableFlags.FLOAT)
12246 {
12248 }
12249 }
12250
12252 {
12253
12254 super.SerializeNumericalVars(floats_out);
12255
12256
12257
12259 {
12261 }
12262
12264 {
12266 }
12267
12269 {
12271 }
12272
12274 {
12279 }
12280
12282 {
12284 }
12285 }
12286
12288 {
12289
12290 super.DeSerializeNumericalVars(floats);
12291
12292
12293 int index = 0;
12294 int mask = Math.Round(floats.Get(index));
12295
12296 index++;
12297
12299 {
12301 {
12303 }
12304 else
12305 {
12306 float quantity = floats.Get(index);
12307 SetQuantity(quantity,
true,
false,
false,
false);
12308 }
12309 index++;
12310 }
12311
12313 {
12314 float wet = floats.Get(index);
12316 index++;
12317 }
12318
12320 {
12321 int liquidtype = Math.Round(floats.Get(index));
12323 index++;
12324 }
12325
12327 {
12329 index++;
12331 index++;
12333 index++;
12335 index++;
12336 }
12337
12339 {
12340 int cleanness = Math.Round(floats.Get(index));
12342 index++;
12343 }
12344 }
12345
12347 {
12348 super.WriteVarsToCTX(ctx);
12349
12350
12352 {
12354 }
12355
12357 {
12359 }
12360
12362 {
12364 }
12365
12367 {
12368 int r,g,b,a;
12374 }
12375
12377 {
12379 }
12380 }
12381
12383 {
12384 if (!super.ReadVarsFromCTX(ctx,version))
12385 return false;
12386
12387 int intValue;
12388 float value;
12389
12390 if (version < 140)
12391 {
12392 if (!ctx.
Read(intValue))
12393 return false;
12394
12395 m_VariablesMask = intValue;
12396 }
12397
12399 {
12400 if (!ctx.
Read(value))
12401 return false;
12402
12404 {
12406 }
12407 else
12408 {
12410 }
12411 }
12412
12413 if (version < 140)
12414 {
12416 {
12417 if (!ctx.
Read(value))
12418 return false;
12419 SetTemperatureDirect(value);
12420 }
12421 }
12422
12424 {
12425 if (!ctx.
Read(value))
12426 return false;
12428 }
12429
12431 {
12432 if (!ctx.
Read(intValue))
12433 return false;
12435 }
12436
12438 {
12439 int r,g,b,a;
12441 return false;
12443 return false;
12445 return false;
12447 return false;
12448
12450 }
12451
12453 {
12454 if (!ctx.
Read(intValue))
12455 return false;
12457 }
12458
12459 if (version >= 138 && version < 140)
12460 {
12462 {
12463 if (!ctx.
Read(intValue))
12464 return false;
12465 SetFrozen(intValue);
12466 }
12467 }
12468
12469 return true;
12470 }
12471
12472
12474 {
12477 {
12479 }
12480
12481 if (!super.OnStoreLoad(ctx, version))
12482 {
12484 return false;
12485 }
12486
12487 if (version >= 114)
12488 {
12489 bool hasQuickBarIndexSaved;
12490
12491 if (!ctx.
Read(hasQuickBarIndexSaved))
12492 {
12494 return false;
12495 }
12496
12497 if (hasQuickBarIndexSaved)
12498 {
12499 int itmQBIndex;
12500
12501
12502 if (!ctx.
Read(itmQBIndex))
12503 {
12505 return false;
12506 }
12507
12508 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12509 if (itmQBIndex != -1 && parentPlayer)
12510 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12511 }
12512 }
12513 else
12514 {
12515
12516 PlayerBase player;
12517 int itemQBIndex;
12518 if (version ==
int.
MAX)
12519 {
12520 if (!ctx.
Read(itemQBIndex))
12521 {
12523 return false;
12524 }
12525 }
12526 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12527 {
12528
12529 if (!ctx.
Read(itemQBIndex))
12530 {
12532 return false;
12533 }
12534 if (itemQBIndex != -1 && player)
12535 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12536 }
12537 }
12538
12539 if (version < 140)
12540 {
12541
12542 if (!LoadVariables(ctx, version))
12543 {
12545 return false;
12546 }
12547 }
12548
12549
12551 {
12553 return false;
12554 }
12555 if (version >= 132)
12556 {
12558 if (raib)
12559 {
12561 {
12563 return false;
12564 }
12565 }
12566 }
12567
12569 return true;
12570 }
12571
12572
12573
12575 {
12576 super.OnStoreSave(ctx);
12577
12578 PlayerBase player;
12579 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12580 {
12582
12583 int itemQBIndex = -1;
12584 itemQBIndex = player.FindQuickBarEntityIndex(this);
12585 ctx.
Write(itemQBIndex);
12586 }
12587 else
12588 {
12590 }
12591
12593
12595 if (raib)
12596 {
12598 }
12599 }
12600
12601
12603 {
12604 super.AfterStoreLoad();
12605
12607 {
12609 }
12610
12612 {
12615 }
12616 }
12617
12619 {
12620 super.EEOnAfterLoad();
12621
12623 {
12625 }
12626
12629 }
12630
12632 {
12633 return false;
12634 }
12635
12636
12637
12639 {
12641 {
12642 #ifdef PLATFORM_CONSOLE
12643
12645 {
12647 if (menu)
12648 {
12650 }
12651 }
12652 #endif
12653 }
12654
12656 {
12659 }
12660
12662 {
12663 SetWeightDirty();
12665 }
12667 {
12670 }
12671
12673 {
12676 }
12678 {
12681 }
12682
12683 super.OnVariablesSynchronized();
12684 }
12685
12686
12687
12689 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12690 {
12691 if (!IsServerCheck(allow_client))
12692 return false;
12693
12695 return false;
12696
12699
12700 if (value <= (min + 0.001))
12701 value = min;
12702
12703 if (value == min)
12704 {
12705 if (destroy_config)
12706 {
12707 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12708 if (dstr)
12709 {
12711 this.Delete();
12712 return true;
12713 }
12714 }
12715 else if (destroy_forced)
12716 {
12718 this.Delete();
12719 return true;
12720 }
12721
12723 }
12724
12727
12729 {
12731
12732 if (delta)
12734 }
12735
12737
12738 return false;
12739 }
12740
12741
12743 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12744 {
12746 }
12747
12749 {
12752 }
12753
12755 {
12758 }
12759
12762 {
12763 float value_clamped = Math.Clamp(value, 0, 1);
12765 SetQuantity(result, destroy_config, destroy_forced);
12766 }
12767
12768
12771 {
12773 }
12774
12776 {
12778 }
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12790 {
12791 int slot = -1;
12792 if (GetInventory())
12793 {
12794 InventoryLocation il = new InventoryLocation;
12795 GetInventory().GetCurrentInventoryLocation(il);
12797 }
12798
12800 }
12801
12803 {
12804 float quantity_max = 0;
12805
12807 {
12808 if (attSlotID != -1)
12809 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12810
12811 if (quantity_max <= 0)
12813 }
12814
12815 if (quantity_max <= 0)
12817
12818 return quantity_max;
12819 }
12820
12822 {
12824 }
12825
12827 {
12829 }
12830
12831
12833 {
12835 }
12836
12838 {
12840 }
12841
12843 {
12845 }
12846
12847
12849 {
12850
12851 float weightEx = GetWeightEx();
12852 float special = GetInventoryAndCargoWeight();
12853 return weightEx - special;
12854 }
12855
12856
12858 {
12860 }
12861
12863 {
12865 {
12866 #ifdef DEVELOPER
12867 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12868 {
12869 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12871 }
12872 #endif
12873
12874 return GetQuantity() * GetConfigWeightModified();
12875 }
12876 else if (HasEnergyManager())
12877 {
12878 #ifdef DEVELOPER
12879 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12880 {
12881 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12882 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12883 }
12884 #endif
12885 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12886 }
12887 else
12888 {
12889 #ifdef DEVELOPER
12890 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12891 {
12892 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12893 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12894 }
12895 #endif
12896 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12897 }
12898 }
12899
12902 {
12903 int item_count = 0;
12905
12906 if (GetInventory().GetCargo() != NULL)
12907 {
12908 item_count = GetInventory().GetCargo().GetItemCount();
12909 }
12910
12911 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12912 {
12913 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12914 if (item)
12915 item_count += item.GetNumberOfItems();
12916 }
12917 return item_count;
12918 }
12919
12922 {
12923 float weight = 0;
12924 float wetness = 1;
12925 if (include_wetness)
12928 {
12929 weight = wetness * m_ConfigWeight;
12930 }
12932 {
12933 weight = 1;
12934 }
12935 return weight;
12936 }
12937
12938
12939
12941 {
12942 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12943 {
12944 GameInventory inv = GetInventory();
12945 array<EntityAI> items = new array<EntityAI>;
12947 for (int i = 0; i < items.Count(); i++)
12948 {
12950 if (item)
12951 {
12953 }
12954 }
12955 }
12956 }
12957
12958
12959
12960
12962 {
12963 float energy = 0;
12964 if (HasEnergyManager())
12965 {
12966 energy = GetCompEM().GetEnergy();
12967 }
12968 return energy;
12969 }
12970
12971
12973 {
12974 super.OnEnergyConsumed();
12975
12977 }
12978
12980 {
12981 super.OnEnergyAdded();
12982
12984 }
12985
12986
12988 {
12989 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12990 {
12992 {
12993 float energy_0to1 = GetCompEM().GetEnergy0To1();
12995 }
12996 }
12997 }
12998
12999
13001 {
13002 return ConfigGetFloat("heatIsolation");
13003 }
13004
13006 {
13008 }
13009
13011 {
13012 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13013 if (
GetGame().ConfigIsExisting(paramPath))
13015
13016 return 0.0;
13017 }
13018
13020 {
13021 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13022 if (
GetGame().ConfigIsExisting(paramPath))
13024
13025 return 0.0;
13026 }
13027
13028 override void SetWet(
float value,
bool allow_client =
false)
13029 {
13030 if (!IsServerCheck(allow_client))
13031 return;
13032
13035
13037
13038 m_VarWet = Math.Clamp(value, min, max);
13039
13041 {
13044 }
13045 }
13046
13047 override void AddWet(
float value)
13048 {
13050 }
13051
13053 {
13055 }
13056
13058 {
13060 }
13061
13063 {
13065 }
13066
13068 {
13070 }
13071
13073 {
13075 }
13076
13077 override void OnWetChanged(
float newVal,
float oldVal)
13078 {
13081 if (newLevel != oldLevel)
13082 {
13084 }
13085 }
13086
13088 {
13089 SetWeightDirty();
13090 }
13091
13093 {
13094 return GetWetLevelInternal(
m_VarWet);
13095 }
13096
13097
13098
13100 {
13102 }
13103
13105 {
13107 }
13108
13110 {
13112 }
13113
13115 {
13117 }
13118
13119
13120
13122 {
13123 if (ConfigIsExisting("itemModelLength"))
13124 {
13125 return ConfigGetFloat("itemModelLength");
13126 }
13127 return 0;
13128 }
13129
13131 {
13132 if (ConfigIsExisting("itemAttachOffset"))
13133 {
13134 return ConfigGetFloat("itemAttachOffset");
13135 }
13136 return 0;
13137 }
13138
13139 override void SetCleanness(
int value,
bool allow_client =
false)
13140 {
13141 if (!IsServerCheck(allow_client))
13142 return;
13143
13145
13147
13150 }
13151
13153 {
13155 }
13156
13158 {
13159 return true;
13160 }
13161
13162
13163
13164
13166 {
13168 }
13169
13171 {
13173 }
13174
13175
13176
13177
13178 override void SetColor(
int r,
int g,
int b,
int a)
13179 {
13185 }
13187 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13188 {
13193 }
13194
13196 {
13198 }
13199
13202 {
13203 int r,g,b,a;
13205 r = r/255;
13206 g = g/255;
13207 b = b/255;
13208 a = a/255;
13209 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13210 }
13211
13212
13213
13214 override void SetLiquidType(
int value,
bool allow_client =
false)
13215 {
13216 if (!IsServerCheck(allow_client))
13217 return;
13218
13223 }
13224
13226 {
13227 return ConfigGetInt("varLiquidTypeInit");
13228 }
13229
13231 {
13233 }
13234
13236 {
13238 SetFrozen(false);
13239 }
13240
13243 {
13244 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13245 }
13246
13247
13250 {
13251 PlayerBase nplayer;
13252 if (PlayerBase.CastTo(nplayer, player))
13253 {
13255
13256 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13257 }
13258 }
13259
13260
13263 {
13264 PlayerBase nplayer;
13265 if (PlayerBase.CastTo(nplayer,player))
13266 {
13267
13268 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13269
13270 }
13271
13272
13273 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13274
13275
13276 if (HasEnergyManager())
13277 {
13278 GetCompEM().UpdatePlugState();
13279 }
13280 }
13281
13282
13284 {
13285 super.OnPlacementStarted(player);
13286
13288 }
13289
13290 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13291 {
13293 {
13294 m_AdminLog.OnPlacementComplete(player,
this);
13295 }
13296
13297 super.OnPlacementComplete(player, position, orientation);
13298 }
13299
13300
13301
13302
13303
13305 {
13307 {
13308 return true;
13309 }
13310 else
13311 {
13312 return false;
13313 }
13314 }
13315
13316
13318 {
13320 {
13322 }
13323 }
13324
13325
13327 {
13329 }
13330
13332 {
13334 }
13335
13336 override void InsertAgent(
int agent,
float count = 1)
13337 {
13338 if (count < 1)
13339 return;
13340
13342 }
13343
13346 {
13348 }
13349
13350
13352 {
13354 }
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13398 {
13400 return false;
13401 return true;
13402 }
13403
13405 {
13406
13408 }
13409
13410
13413 {
13414 super.CheckForRoofLimited(timeTresholdMS);
13415
13417 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13418 {
13419 m_PreviousRoofTestTime = time;
13420 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13421 }
13422 }
13423
13424
13426 {
13428 {
13429 return 0;
13430 }
13431
13432 if (GetInventory().GetAttachmentSlotsCount() != 0)
13433 {
13434 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13435 if (filter)
13436 return filter.GetProtectionLevel(type, false, system);
13437 else
13438 return 0;
13439 }
13440
13441 string subclassPath, entryName;
13442
13443 switch (type)
13444 {
13446 entryName = "biological";
13447 break;
13449 entryName = "chemical";
13450 break;
13451 default:
13452 entryName = "biological";
13453 break;
13454 }
13455
13456 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13457
13459 }
13460
13461
13462
13465 {
13466 if (!IsMagazine())
13468
13470 }
13471
13472
13473
13474
13475
13480 {
13481 return true;
13482 }
13483
13485 {
13487 }
13488
13489
13490
13491
13492
13494 {
13495 if (parent)
13496 {
13497 if (parent.IsInherited(DayZInfected))
13498 return true;
13499
13500 if (!parent.IsRuined())
13501 return true;
13502 }
13503
13504 return true;
13505 }
13506
13508 {
13509 if (!super.CanPutAsAttachment(parent))
13510 {
13511 return false;
13512 }
13513
13514 if (!IsRuined() && !parent.IsRuined())
13515 {
13516 return true;
13517 }
13518
13519 return false;
13520 }
13521
13523 {
13524
13525
13526
13527
13528 return super.CanReceiveItemIntoCargo(item);
13529 }
13530
13532 {
13533
13534
13535
13536
13537 GameInventory attachmentInv = attachment.GetInventory();
13539 {
13540 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13541 return false;
13542 }
13543
13544 InventoryLocation loc = new InventoryLocation();
13545 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13546 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13547 return false;
13548
13549 return super.CanReceiveAttachment(attachment, slotId);
13550 }
13551
13553 {
13554 if (!super.CanReleaseAttachment(attachment))
13555 return false;
13556
13557 return GetInventory().AreChildrenAccessible();
13558 }
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13581 {
13582 int id = muzzle_owner.GetMuzzleID();
13583 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13584
13585 if (WPOF_array)
13586 {
13587 for (int i = 0; i < WPOF_array.Count(); i++)
13588 {
13589 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13590
13591 if (WPOF)
13592 {
13593 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13594 }
13595 }
13596 }
13597 }
13598
13599
13601 {
13602 int id = muzzle_owner.GetMuzzleID();
13604
13605 if (WPOBE_array)
13606 {
13607 for (int i = 0; i < WPOBE_array.Count(); i++)
13608 {
13609 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13610
13611 if (WPOBE)
13612 {
13613 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13614 }
13615 }
13616 }
13617 }
13618
13619
13621 {
13622 int id = muzzle_owner.GetMuzzleID();
13623 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13624
13625 if (WPOOH_array)
13626 {
13627 for (int i = 0; i < WPOOH_array.Count(); i++)
13628 {
13629 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13630
13631 if (WPOOH)
13632 {
13633 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13634 }
13635 }
13636 }
13637 }
13638
13639
13641 {
13642 int id = muzzle_owner.GetMuzzleID();
13643 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13644
13645 if (WPOOH_array)
13646 {
13647 for (int i = 0; i < WPOOH_array.Count(); i++)
13648 {
13649 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13650
13651 if (WPOOH)
13652 {
13653 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13654 }
13655 }
13656 }
13657 }
13658
13659
13661 {
13662 int id = muzzle_owner.GetMuzzleID();
13663 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13664
13665 if (WPOOH_array)
13666 {
13667 for (int i = 0; i < WPOOH_array.Count(); i++)
13668 {
13669 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13670
13671 if (WPOOH)
13672 {
13673 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13674 }
13675 }
13676 }
13677 }
13678
13679
13680
13682 {
13684 {
13685 return true;
13686 }
13687
13688 return false;
13689 }
13690
13692 {
13694 {
13695 return true;
13696 }
13697
13698 return false;
13699 }
13700
13702 {
13704 {
13705 return true;
13706 }
13707
13708 return false;
13709 }
13710
13712 {
13713 return false;
13714 }
13715
13718 {
13719 return UATimeSpent.DEFAULT_DEPLOY;
13720 }
13721
13722
13723
13724
13726 {
13728 SetSynchDirty();
13729 }
13730
13732 {
13734 }
13735
13736
13738 {
13739 return false;
13740 }
13741
13744 {
13745 string att_type = "None";
13746
13747 if (ConfigIsExisting("soundAttType"))
13748 {
13749 att_type = ConfigGetString("soundAttType");
13750 }
13751
13753 }
13754
13756 {
13758 }
13759
13760
13761
13762
13763
13767
13769 {
13772
13774 }
13775
13776
13778 {
13780 return;
13781
13783
13786
13789
13790 SoundParameters params = new SoundParameters();
13794 }
13795
13796
13798 {
13800 return;
13801
13803 SetSynchDirty();
13804
13807 }
13808
13809
13811 {
13813 return;
13814
13816 SetSynchDirty();
13817
13820 }
13821
13823 {
13825 }
13826
13828 {
13830 }
13831
13834 {
13835 if (!
GetGame().IsDedicatedServer())
13836 {
13837 if (ConfigIsExisting("attachSoundSet"))
13838 {
13839 string cfg_path = "";
13840 string soundset = "";
13841 string type_name =
GetType();
13842
13845 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13846 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13847
13848 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13849 {
13850 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13851 {
13852 if (cfg_slot_array[i] == slot_type)
13853 {
13854 soundset = cfg_soundset_array[i];
13855 break;
13856 }
13857 }
13858 }
13859
13860 if (soundset != "")
13861 {
13862 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13864 }
13865 }
13866 }
13867 }
13868
13870 {
13871
13872 }
13873
13874 void OnApply(PlayerBase player);
13875
13877 {
13878 return 1.0;
13879 };
13880
13882 {
13884 }
13885
13887 {
13889 }
13890
13892
13894 {
13895 SetDynamicPhysicsLifeTime(0.01);
13897 }
13898
13900 {
13901 array<string> zone_names = new array<string>;
13902 GetDamageZones(zone_names);
13903 for (int i = 0; i < zone_names.Count(); i++)
13904 {
13905 SetHealthMax(zone_names.Get(i),"Health");
13906 }
13907 SetHealthMax("","Health");
13908 }
13909
13912 {
13913 float global_health = GetHealth01("","Health");
13914 array<string> zones = new array<string>;
13915 GetDamageZones(zones);
13916
13917 for (int i = 0; i < zones.Count(); i++)
13918 {
13919 SetHealth01(zones.Get(i),"Health",global_health);
13920 }
13921 }
13922
13925 {
13926 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13927 }
13928
13930 {
13931 if (!hasRootAsPlayer)
13932 {
13933 if (refParentIB)
13934 {
13935
13936 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13937 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13938
13939 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13940 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13941
13944 }
13945 else
13946 {
13947
13950 }
13951 }
13952 }
13953
13955 {
13957 {
13958 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13959 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13960 {
13961 float heatPermCoef = 1.0;
13963 while (ent)
13964 {
13965 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13966 ent = ent.GetHierarchyParent();
13967 }
13968
13969 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13970 }
13971 }
13972 }
13973
13975 {
13976
13977 EntityAI parent = GetHierarchyParent();
13978 if (!parent)
13979 {
13980 hasParent = false;
13981 hasRootAsPlayer = false;
13982 }
13983 else
13984 {
13985 hasParent = true;
13986 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13987 refParentIB =
ItemBase.Cast(parent);
13988 }
13989 }
13990
13991 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13992 {
13993
13994 }
13995
13997 {
13998
13999 return false;
14000 }
14001
14003 {
14004
14005
14006 return false;
14007 }
14008
14010 {
14011
14012 return false;
14013 }
14014
14017 {
14018 return !GetIsFrozen() &&
IsOpen();
14019 }
14020
14022 {
14023 bool hasParent = false, hasRootAsPlayer = false;
14025
14026 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14027 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14028
14029 if (wwtu || foodDecay)
14030 {
14034
14035 if (processWetness || processTemperature || processDecay)
14036 {
14038
14039 if (processWetness)
14040 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14041
14042 if (processTemperature)
14044
14045 if (processDecay)
14046 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14047 }
14048 }
14049 }
14050
14053 {
14055 }
14056
14058 {
14061
14062 return super.GetTemperatureFreezeThreshold();
14063 }
14064
14066 {
14069
14070 return super.GetTemperatureThawThreshold();
14071 }
14072
14074 {
14077
14078 return super.GetItemOverheatThreshold();
14079 }
14080
14082 {
14084 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14085
14086 return super.GetTemperatureFreezeTime();
14087 }
14088
14090 {
14092 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14093
14094 return super.GetTemperatureThawTime();
14095 }
14096
14101
14103 {
14104 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14105 }
14106
14108 {
14109 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14110 }
14111
14114 {
14116 }
14117
14119 {
14121 }
14122
14124 {
14126 }
14127
14130 {
14131 return null;
14132 }
14133
14136 {
14137 return false;
14138 }
14139
14141 {
14143 {
14146 if (!trg)
14147 {
14149 explosive = this;
14150 }
14151
14152 explosive.PairRemote(trg);
14154
14155 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14156 trg.SetPersistentPairID(persistentID);
14157 explosive.SetPersistentPairID(persistentID);
14158
14159 return true;
14160 }
14161 return false;
14162 }
14163
14166 {
14167 float ret = 1.0;
14170 ret *= GetHealth01();
14171
14172 return ret;
14173 }
14174
14175 #ifdef DEVELOPER
14176 override void SetDebugItem()
14177 {
14178 super.SetDebugItem();
14179 _itemBase = this;
14180 }
14181
14183 {
14184 string text = super.GetDebugText();
14185
14187 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14188
14189 return text;
14190 }
14191 #endif
14192
14194 {
14195 return true;
14196 }
14197
14199
14201
14203 {
14206 }
14207
14208
14216
14232}
14233
14235{
14237 if (entity)
14238 {
14239 bool is_item = entity.IsInherited(
ItemBase);
14240 if (is_item && full_quantity)
14241 {
14244 }
14245 }
14246 else
14247 {
14249 return NULL;
14250 }
14251 return entity;
14252}
14253
14255{
14256 if (item)
14257 {
14258 if (health > 0)
14259 item.SetHealth("", "", health);
14260
14261 if (item.CanHaveTemperature())
14262 {
14264 if (item.CanFreeze())
14265 item.SetFrozen(false);
14266 }
14267
14268 if (item.HasEnergyManager())
14269 {
14270 if (quantity >= 0)
14271 {
14272 item.GetCompEM().SetEnergy0To1(quantity);
14273 }
14274 else
14275 {
14277 }
14278 }
14279 else if (item.IsMagazine())
14280 {
14281 Magazine mag = Magazine.Cast(item);
14282 if (quantity >= 0)
14283 {
14284 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14285 }
14286 else
14287 {
14289 }
14290
14291 }
14292 else
14293 {
14294 if (quantity >= 0)
14295 {
14296 item.SetQuantityNormalized(quantity, false);
14297 }
14298 else
14299 {
14301 }
14302
14303 }
14304 }
14305}
14306
14307#ifdef DEVELOPER
14309#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.