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 {
11041
11043 return false;
11044
11045
11047 return false;
11048
11049
11050
11052 if (delta == 0)
11053 return false;
11054
11055
11056 return true;
11057 }
11058
11060 {
11062 {
11063 if (ScriptInputUserData.CanStoreInputUserData())
11064 {
11065 ScriptInputUserData ctx = new ScriptInputUserData;
11070 ctx.
Write(destination_entity);
11072 ctx.
Write(slot_id);
11074 }
11075 }
11076 else if (!
GetGame().IsMultiplayer())
11077 {
11079 }
11080 }
11081
11083 {
11084 float split_quantity_new;
11088 InventoryLocation loc = new InventoryLocation;
11089
11090 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11091 {
11093 split_quantity_new = stack_max;
11094 else
11096
11098 {
11099 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11100 if (new_item)
11101 {
11102 new_item.SetResultOfSplit(true);
11103 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11105 new_item.
SetQuantity(split_quantity_new,
false,
true);
11106 }
11107 }
11108 }
11109 else if (destination_entity && slot_id == -1)
11110 {
11111 if (quantity > stack_max)
11112 split_quantity_new = stack_max;
11113 else
11114 split_quantity_new = quantity;
11115
11117 {
11119 {
11122 }
11123
11124 if (new_item)
11125 {
11126 new_item.SetResultOfSplit(true);
11127 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11129 new_item.
SetQuantity(split_quantity_new,
false,
true);
11130 }
11131 }
11132 }
11133 else
11134 {
11135 if (stack_max != 0)
11136 {
11138 {
11140 }
11141
11142 if (split_quantity_new == 0)
11143 {
11144 if (!
GetGame().IsMultiplayer())
11145 player.PhysicalPredictiveDropItem(this);
11146 else
11147 player.ServerDropEntity(this);
11148 return;
11149 }
11150
11152 {
11154
11155 if (new_item)
11156 {
11157 new_item.SetResultOfSplit(true);
11158 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11161 new_item.PlaceOnSurface();
11162 }
11163 }
11164 }
11165 }
11166 }
11167
11169 {
11170 float split_quantity_new;
11174 InventoryLocation loc = new InventoryLocation;
11175
11176 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11177 {
11179 split_quantity_new = stack_max;
11180 else
11182
11184 {
11185 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11186 if (new_item)
11187 {
11188 new_item.SetResultOfSplit(true);
11189 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11191 new_item.
SetQuantity(split_quantity_new,
false,
true);
11192 }
11193 }
11194 }
11195 else if (destination_entity && slot_id == -1)
11196 {
11197 if (quantity > stack_max)
11198 split_quantity_new = stack_max;
11199 else
11200 split_quantity_new = quantity;
11201
11203 {
11205 {
11208 }
11209
11210 if (new_item)
11211 {
11212 new_item.SetResultOfSplit(true);
11213 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11215 new_item.
SetQuantity(split_quantity_new,
false,
true);
11216 }
11217 }
11218 }
11219 else
11220 {
11221 if (stack_max != 0)
11222 {
11224 {
11226 }
11227
11229 {
11231
11232 if (new_item)
11233 {
11234 new_item.SetResultOfSplit(true);
11235 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11238 new_item.PlaceOnSurface();
11239 }
11240 }
11241 }
11242 }
11243 }
11244
11246 {
11248 {
11249 if (ScriptInputUserData.CanStoreInputUserData())
11250 {
11251 ScriptInputUserData ctx = new ScriptInputUserData;
11256 dst.WriteToContext(ctx);
11258 }
11259 }
11260 else if (!
GetGame().IsMultiplayer())
11261 {
11263 }
11264 }
11265
11267 {
11269 {
11270 if (ScriptInputUserData.CanStoreInputUserData())
11271 {
11272 ScriptInputUserData ctx = new ScriptInputUserData;
11277 ctx.
Write(destination_entity);
11283 }
11284 }
11285 else if (!
GetGame().IsMultiplayer())
11286 {
11288 }
11289 }
11290
11292 {
11294 }
11295
11297 {
11299 float split_quantity_new;
11301 if (dst.IsValid())
11302 {
11303 int slot_id = dst.GetSlot();
11305
11306 if (quantity > stack_max)
11307 split_quantity_new = stack_max;
11308 else
11309 split_quantity_new = quantity;
11310
11312 {
11314
11315 if (new_item)
11316 {
11317 new_item.SetResultOfSplit(true);
11318 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11320 new_item.
SetQuantity(split_quantity_new,
false,
true);
11321 }
11322
11323 return new_item;
11324 }
11325 }
11326
11327 return null;
11328 }
11329
11331 {
11333 float split_quantity_new;
11335 if (destination_entity)
11336 {
11338 if (quantity > stackable)
11339 split_quantity_new = stackable;
11340 else
11341 split_quantity_new = quantity;
11342
11344 {
11345 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11346 if (new_item)
11347 {
11348 new_item.SetResultOfSplit(true);
11349 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11351 new_item.
SetQuantity(split_quantity_new,
false,
true);
11352 }
11353 }
11354 }
11355 }
11356
11358 {
11360 {
11361 if (ScriptInputUserData.CanStoreInputUserData())
11362 {
11363 ScriptInputUserData ctx = new ScriptInputUserData;
11368 ItemBase destination_entity =
this;
11369 ctx.
Write(destination_entity);
11373 }
11374 }
11375 else if (!
GetGame().IsMultiplayer())
11376 {
11378 }
11379 }
11380
11382 {
11384 float split_quantity_new;
11386 if (player)
11387 {
11389 if (quantity > stackable)
11390 split_quantity_new = stackable;
11391 else
11392 split_quantity_new = quantity;
11393
11395 {
11396 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11397 new_item =
ItemBase.Cast(in_hands);
11398 if (new_item)
11399 {
11400 new_item.SetResultOfSplit(true);
11401 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11403 new_item.SetQuantity(split_quantity_new, false, true);
11404 }
11405 }
11406 }
11407 }
11408
11410 {
11412 float split_quantity_new = Math.Floor(quantity * 0.5);
11413
11415 return;
11416
11418
11419 if (new_item)
11420 {
11421 if (new_item.GetQuantityMax() < split_quantity_new)
11422 {
11423 split_quantity_new = new_item.GetQuantityMax();
11424 }
11425
11426 new_item.SetResultOfSplit(true);
11427 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11428
11430 {
11433 }
11434 else
11435 {
11437 new_item.
SetQuantity(split_quantity_new,
false,
true);
11438 }
11439 }
11440 }
11441
11443 {
11445 float split_quantity_new = Math.Floor(quantity / 2);
11446
11448 return;
11449
11450 InventoryLocation invloc = new InventoryLocation;
11452
11454 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11455
11456 if (new_item)
11457 {
11458 if (new_item.GetQuantityMax() < split_quantity_new)
11459 {
11460 split_quantity_new = new_item.GetQuantityMax();
11461 }
11463 {
11466 }
11467 else if (split_quantity_new > 1)
11468 {
11470 new_item.
SetQuantity(split_quantity_new,
false,
true);
11471 }
11472 }
11473 }
11474
11477 {
11478 SetWeightDirty();
11480
11481 if (parent)
11482 parent.OnAttachmentQuantityChangedEx(this, delta);
11483
11485 {
11487 {
11489 }
11491 {
11492 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11494 }
11495 }
11496
11497 }
11498
11501 {
11502
11503 }
11504
11507 {
11509 }
11510
11512 {
11513 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11514
11516 {
11517 if (newLevel == GameConstants.STATE_RUINED)
11518 {
11520 EntityAI parent = GetHierarchyParent();
11521 if (parent && parent.IsFireplace())
11522 {
11523 CargoBase cargo = GetInventory().GetCargo();
11524 if (cargo)
11525 {
11527 {
11529 }
11530 }
11531 }
11532 }
11533
11535 {
11536
11538 return;
11539 }
11540
11541 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11542 {
11544 }
11545 }
11546 }
11547
11548
11550 {
11551 super.OnRightClick();
11552
11554 {
11556 {
11557 if (ScriptInputUserData.CanStoreInputUserData())
11558 {
11559 EntityAI root = GetHierarchyRoot();
11560 Man playerOwner = GetHierarchyRootPlayer();
11561 InventoryLocation dst = new InventoryLocation;
11562
11563
11564 if (!playerOwner && root && root == this)
11565 {
11567 }
11568 else
11569 {
11570
11571 GetInventory().GetCurrentInventoryLocation(dst);
11573 {
11576 {
11578 }
11579 else
11580 {
11582
11583
11584 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11585 {
11587 }
11588 else
11589 {
11590 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11591 }
11592 }
11593 }
11594 }
11595
11596 ScriptInputUserData ctx = new ScriptInputUserData;
11604 }
11605 }
11606 else if (!
GetGame().IsMultiplayer())
11607 {
11609 }
11610 }
11611 }
11612
11614 {
11615 if (root)
11616 {
11617 vector m4[4];
11618 root.GetTransform(m4);
11619 dst.SetGround(this, m4);
11620 }
11621 else
11622 {
11623 GetInventory().GetCurrentInventoryLocation(dst);
11624 }
11625 }
11626
11627 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11628 {
11629
11630 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11631 return false;
11632
11633 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11634 return false;
11635
11636
11638 return false;
11639
11640
11641 Magazine mag = Magazine.Cast(this);
11642 if (mag)
11643 {
11644 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11645 return false;
11646
11647 if (stack_max_limit)
11648 {
11649 Magazine other_mag = Magazine.Cast(other_item);
11650 if (other_item)
11651 {
11652 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11653 return false;
11654 }
11655
11656 }
11657 }
11658 else
11659 {
11660
11662 return false;
11663
11665 return false;
11666 }
11667
11668 PlayerBase player = null;
11669 if (CastTo(player, GetHierarchyRootPlayer()))
11670 {
11671 if (player.GetInventory().HasAttachment(this))
11672 return false;
11673
11674 if (player.IsItemsToDelete())
11675 return false;
11676 }
11677
11678 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11679 return false;
11680
11681 int slotID;
11683 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11684 return false;
11685
11686 return true;
11687 }
11688
11690 {
11692 }
11693
11695 {
11696 return m_IsResultOfSplit;
11697 }
11698
11700 {
11701 m_IsResultOfSplit = value;
11702 }
11703
11705 {
11707 }
11708
11710 {
11711 float other_item_quantity = other_item.GetQuantity();
11712 float this_free_space;
11713
11715
11717
11718 if (other_item_quantity > this_free_space)
11719 {
11720 return this_free_space;
11721 }
11722 else
11723 {
11724 return other_item_quantity;
11725 }
11726 }
11727
11729 {
11731 }
11732
11734 {
11736 return;
11737
11738 if (!IsMagazine() && other_item)
11739 {
11741 if (quantity_used != 0)
11742 {
11743 float hp1 = GetHealth01("","");
11744 float hp2 = other_item.GetHealth01("","");
11745 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11746 hpResult = hpResult / (
GetQuantity() + quantity_used);
11747
11748 hpResult *= GetMaxHealth();
11749 Math.Round(hpResult);
11750 SetHealth("", "Health", hpResult);
11751
11753 other_item.AddQuantity(-quantity_used);
11754 }
11755 }
11757 }
11758
11760 {
11761 #ifdef SERVER
11762 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11763 GetHierarchyParent().IncreaseLifetimeUp();
11764 #endif
11765 };
11766
11768 {
11769 PlayerBase p = PlayerBase.Cast(player);
11770
11771 array<int> recipesIds = p.m_Recipes;
11772 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11773 if (moduleRecipesManager)
11774 {
11775 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11776 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11777 }
11778
11779 for (int i = 0;i < recipesIds.Count(); i++)
11780 {
11781 int key = recipesIds.Get(i);
11782 string recipeName = moduleRecipesManager.GetRecipeName(key);
11784 }
11785 }
11786
11787
11788 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11789 {
11790 super.GetDebugActions(outputList);
11791
11792
11798
11799
11804
11809
11810
11814
11815
11817 {
11821 }
11822
11825
11826
11830
11832
11833 InventoryLocation loc = new InventoryLocation();
11834 GetInventory().GetCurrentInventoryLocation(loc);
11836 {
11837 if (Gizmo_IsSupported())
11840 }
11841
11843 }
11844
11845
11846
11847
11849 {
11850 super.OnAction(action_id, player, ctx);
11851
11853 {
11854 switch (action_id)
11855 {
11858 return true;
11861 return true;
11862 }
11863 }
11864
11866 {
11867 switch (action_id)
11868 {
11870 Delete();
11871 return true;
11872 }
11873 }
11874
11875 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11876 {
11877 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11878 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11879 PlayerBase p = PlayerBase.Cast(player);
11880 if (
EActions.RECIPES_RANGE_START < 1000)
11881 {
11882 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11883 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11884 }
11885 }
11886 #ifndef SERVER
11887 else if (action_id ==
EActions.WATCH_PLAYER)
11888 {
11889 PluginDeveloper.SetDeveloperItemClientEx(player);
11890 }
11891 #endif
11893 {
11894 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11895 {
11896 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11897 OnDebugButtonPressServer(id + 1);
11898 }
11899
11900 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11901 {
11902 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11904 }
11905
11906 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11907 {
11908 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11910 }
11911
11912 else if (action_id ==
EActions.ADD_QUANTITY)
11913 {
11914 if (IsMagazine())
11915 {
11916 Magazine mag = Magazine.Cast(this);
11917 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11918 }
11919 else
11920 {
11922 }
11923
11924 if (m_EM)
11925 {
11926 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11927 }
11928
11929 }
11930
11931 else if (action_id ==
EActions.REMOVE_QUANTITY)
11932 {
11933 if (IsMagazine())
11934 {
11935 Magazine mag2 = Magazine.Cast(this);
11936 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11937 }
11938 else
11939 {
11941 }
11942 if (m_EM)
11943 {
11944 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11945 }
11946
11947 }
11948
11949 else if (action_id ==
EActions.SET_QUANTITY_0)
11950 {
11952
11953 if (m_EM)
11954 {
11955 m_EM.SetEnergy(0);
11956 }
11957 }
11958
11959 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11960 {
11962
11963 if (m_EM)
11964 {
11965 m_EM.SetEnergy(m_EM.GetEnergyMax());
11966 }
11967 }
11968
11969 else if (action_id ==
EActions.ADD_HEALTH)
11970 {
11971 AddHealth("","",GetMaxHealth("","Health")/5);
11972 }
11973 else if (action_id ==
EActions.REMOVE_HEALTH)
11974 {
11975 AddHealth("","",-GetMaxHealth("","Health")/5);
11976 }
11977 else if (action_id ==
EActions.DESTROY_HEALTH)
11978 {
11979 SetHealth01("","",0);
11980 }
11981 else if (action_id ==
EActions.WATCH_ITEM)
11982 {
11984 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11985 #ifdef DEVELOPER
11986 SetDebugDeveloper_item(this);
11987 #endif
11988 }
11989
11990 else if (action_id ==
EActions.ADD_TEMPERATURE)
11991 {
11992 AddTemperature(20);
11993
11994 }
11995
11996 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11997 {
11998 AddTemperature(-20);
11999
12000 }
12001
12002 else if (action_id ==
EActions.FLIP_FROZEN)
12003 {
12004 SetFrozen(!GetIsFrozen());
12005
12006 }
12007
12008 else if (action_id ==
EActions.ADD_WETNESS)
12009 {
12011
12012 }
12013
12014 else if (action_id ==
EActions.REMOVE_WETNESS)
12015 {
12017
12018 }
12019
12020 else if (action_id ==
EActions.LIQUIDTYPE_UP)
12021 {
12024
12025
12026 }
12027
12028 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
12029 {
12032 }
12033
12034 else if (action_id ==
EActions.MAKE_SPECIAL)
12035 {
12036 auto debugParams = DebugSpawnParams.WithPlayer(player);
12037 OnDebugSpawnEx(debugParams);
12038 }
12039
12040 }
12041
12042
12043 return false;
12044 }
12045
12046
12047
12048
12052
12055
12056
12057
12059 {
12060 return false;
12061 }
12062
12063
12065 {
12066 return true;
12067 }
12068
12069
12071 {
12072 return true;
12073 }
12074
12075
12076
12078 {
12079 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12081 }
12082
12085 {
12086 return null;
12087 }
12088
12090 {
12091 return false;
12092 }
12093
12095 {
12096 return false;
12097 }
12098
12102
12103
12105 {
12106 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12107 return module_repairing.CanRepair(this, item_repair_kit);
12108 }
12109
12110
12111 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12112 {
12113 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12114 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12115 }
12116
12117
12119 {
12120
12121
12122
12123
12124
12125
12126
12127
12128 return 1;
12129 }
12130
12131
12132
12134 {
12136 }
12137
12138
12139
12141 {
12143 }
12144
12145
12154 {
12155 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12156
12157 if (player)
12158 {
12159 player.MessageStatus(text);
12160 }
12161 }
12162
12163
12172 {
12173 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12174
12175 if (player)
12176 {
12177 player.MessageAction(text);
12178 }
12179 }
12180
12181
12190 {
12191 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12192
12193 if (player)
12194 {
12195 player.MessageFriendly(text);
12196 }
12197 }
12198
12199
12208 {
12209 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12210
12211 if (player)
12212 {
12213 player.MessageImportant(text);
12214 }
12215 }
12216
12218 {
12219 return true;
12220 }
12221
12222
12223 override bool KindOf(
string tag)
12224 {
12225 bool found = false;
12226 string item_name = this.
GetType();
12229
12230 int array_size = item_tag_array.Count();
12231 for (int i = 0; i < array_size; i++)
12232 {
12233 if (item_tag_array.Get(i) == tag)
12234 {
12235 found = true;
12236 break;
12237 }
12238 }
12239 return found;
12240 }
12241
12242
12244 {
12245
12246 super.OnRPC(sender, rpc_type,ctx);
12247
12248
12249 switch (rpc_type)
12250 {
12251 #ifndef SERVER
12252 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12253 Param2<bool, string> p = new Param2<bool, string>(false, "");
12254
12256 return;
12257
12258 bool play = p.param1;
12259 string soundSet = p.param2;
12260
12261 if (play)
12262 {
12264 {
12266 {
12268 }
12269 }
12270 else
12271 {
12273 }
12274 }
12275 else
12276 {
12278 }
12279
12280 break;
12281 #endif
12282
12283 }
12284
12286 {
12288 }
12289 }
12290
12291
12292
12293
12295 {
12296 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12297 return plugin.GetID(
name);
12298 }
12299
12301 {
12302 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12303 return plugin.GetName(id);
12304 }
12305
12308 {
12309
12310
12311 int varFlags;
12312 if (!ctx.
Read(varFlags))
12313 return;
12314
12315 if (varFlags & ItemVariableFlags.FLOAT)
12316 {
12318 }
12319 }
12320
12322 {
12323
12324 super.SerializeNumericalVars(floats_out);
12325
12326
12327
12329 {
12331 }
12332
12334 {
12336 }
12337
12339 {
12341 }
12342
12344 {
12349 }
12350
12352 {
12354 }
12355 }
12356
12358 {
12359
12360 super.DeSerializeNumericalVars(floats);
12361
12362
12363 int index = 0;
12364 int mask = Math.Round(floats.Get(index));
12365
12366 index++;
12367
12369 {
12371 {
12373 }
12374 else
12375 {
12376 float quantity = floats.Get(index);
12377 SetQuantity(quantity,
true,
false,
false,
false);
12378 }
12379 index++;
12380 }
12381
12383 {
12384 float wet = floats.Get(index);
12386 index++;
12387 }
12388
12390 {
12391 int liquidtype = Math.Round(floats.Get(index));
12393 index++;
12394 }
12395
12397 {
12399 index++;
12401 index++;
12403 index++;
12405 index++;
12406 }
12407
12409 {
12410 int cleanness = Math.Round(floats.Get(index));
12412 index++;
12413 }
12414 }
12415
12417 {
12418 super.WriteVarsToCTX(ctx);
12419
12420
12422 {
12424 }
12425
12427 {
12429 }
12430
12432 {
12434 }
12435
12437 {
12438 int r,g,b,a;
12444 }
12445
12447 {
12449 }
12450 }
12451
12453 {
12454 if (!super.ReadVarsFromCTX(ctx,version))
12455 return false;
12456
12457 int intValue;
12458 float value;
12459
12460 if (version < 140)
12461 {
12462 if (!ctx.
Read(intValue))
12463 return false;
12464
12465 m_VariablesMask = intValue;
12466 }
12467
12469 {
12470 if (!ctx.
Read(value))
12471 return false;
12472
12474 {
12476 }
12477 else
12478 {
12480 }
12481 }
12482
12483 if (version < 140)
12484 {
12486 {
12487 if (!ctx.
Read(value))
12488 return false;
12489 SetTemperatureDirect(value);
12490 }
12491 }
12492
12494 {
12495 if (!ctx.
Read(value))
12496 return false;
12498 }
12499
12501 {
12502 if (!ctx.
Read(intValue))
12503 return false;
12505 }
12506
12508 {
12509 int r,g,b,a;
12511 return false;
12513 return false;
12515 return false;
12517 return false;
12518
12520 }
12521
12523 {
12524 if (!ctx.
Read(intValue))
12525 return false;
12527 }
12528
12529 if (version >= 138 && version < 140)
12530 {
12532 {
12533 if (!ctx.
Read(intValue))
12534 return false;
12535 SetFrozen(intValue);
12536 }
12537 }
12538
12539 return true;
12540 }
12541
12542
12544 {
12547 {
12549 }
12550
12551 if (!super.OnStoreLoad(ctx, version))
12552 {
12554 return false;
12555 }
12556
12557 if (version >= 114)
12558 {
12559 bool hasQuickBarIndexSaved;
12560
12561 if (!ctx.
Read(hasQuickBarIndexSaved))
12562 {
12564 return false;
12565 }
12566
12567 if (hasQuickBarIndexSaved)
12568 {
12569 int itmQBIndex;
12570
12571
12572 if (!ctx.
Read(itmQBIndex))
12573 {
12575 return false;
12576 }
12577
12578 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12579 if (itmQBIndex != -1 && parentPlayer)
12580 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12581 }
12582 }
12583 else
12584 {
12585
12586 PlayerBase player;
12587 int itemQBIndex;
12588 if (version ==
int.
MAX)
12589 {
12590 if (!ctx.
Read(itemQBIndex))
12591 {
12593 return false;
12594 }
12595 }
12596 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12597 {
12598
12599 if (!ctx.
Read(itemQBIndex))
12600 {
12602 return false;
12603 }
12604 if (itemQBIndex != -1 && player)
12605 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12606 }
12607 }
12608
12609 if (version < 140)
12610 {
12611
12612 if (!LoadVariables(ctx, version))
12613 {
12615 return false;
12616 }
12617 }
12618
12619
12621 {
12623 return false;
12624 }
12625 if (version >= 132)
12626 {
12628 if (raib)
12629 {
12631 {
12633 return false;
12634 }
12635 }
12636 }
12637
12639 return true;
12640 }
12641
12642
12643
12645 {
12646 super.OnStoreSave(ctx);
12647
12648 PlayerBase player;
12649 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12650 {
12652
12653 int itemQBIndex = -1;
12654 itemQBIndex = player.FindQuickBarEntityIndex(this);
12655 ctx.
Write(itemQBIndex);
12656 }
12657 else
12658 {
12660 }
12661
12663
12665 if (raib)
12666 {
12668 }
12669 }
12670
12671
12673 {
12674 super.AfterStoreLoad();
12675
12677 {
12679 }
12680
12682 {
12685 }
12686 }
12687
12689 {
12690 super.EEOnAfterLoad();
12691
12693 {
12695 }
12696
12699 }
12700
12702 {
12703 return false;
12704 }
12705
12706
12707
12709 {
12711 {
12712 #ifdef PLATFORM_CONSOLE
12713
12715 {
12717 if (menu)
12718 {
12720 }
12721 }
12722 #endif
12723 }
12724
12726 {
12729 }
12730
12732 {
12733 SetWeightDirty();
12735 }
12737 {
12740 }
12741
12743 {
12746 }
12748 {
12751 }
12752
12753 super.OnVariablesSynchronized();
12754 }
12755
12756
12757
12759 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12760 {
12761 if (!IsServerCheck(allow_client))
12762 return false;
12763
12765 return false;
12766
12769
12770 if (value <= (min + 0.001))
12771 value = min;
12772
12773 if (value == min)
12774 {
12775 if (destroy_config)
12776 {
12777 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12778 if (dstr)
12779 {
12781 this.Delete();
12782 return true;
12783 }
12784 }
12785 else if (destroy_forced)
12786 {
12788 this.Delete();
12789 return true;
12790 }
12791
12793 }
12794
12797
12799 {
12801
12802 if (delta)
12804 }
12805
12807
12808 return false;
12809 }
12810
12811
12813 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12814 {
12816 }
12817
12819 {
12822 }
12823
12825 {
12828 }
12829
12831 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12832 {
12833 float value_clamped = Math.Clamp(value, 0, 1);
12835 SetQuantity(result, destroy_config, destroy_forced);
12836 }
12837
12838
12841 {
12843 }
12844
12846 {
12848 }
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12860 {
12861 int slot = -1;
12862 if (GetInventory())
12863 {
12864 InventoryLocation il = new InventoryLocation;
12865 GetInventory().GetCurrentInventoryLocation(il);
12867 }
12868
12870 }
12871
12873 {
12874 float quantity_max = 0;
12875
12877 {
12878 if (attSlotID != -1)
12879 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12880
12881 if (quantity_max <= 0)
12883 }
12884
12885 if (quantity_max <= 0)
12887
12888 return quantity_max;
12889 }
12890
12892 {
12894 }
12895
12897 {
12899 }
12900
12901
12903 {
12905 }
12906
12908 {
12910 }
12911
12913 {
12915 }
12916
12917
12919 {
12920
12921 float weightEx = GetWeightEx();
12922 float special = GetInventoryAndCargoWeight();
12923 return weightEx - special;
12924 }
12925
12926
12928 {
12930 }
12931
12933 {
12935 {
12936 #ifdef DEVELOPER
12937 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12938 {
12939 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12941 }
12942 #endif
12943
12944 return GetQuantity() * GetConfigWeightModified();
12945 }
12946 else if (HasEnergyManager())
12947 {
12948 #ifdef DEVELOPER
12949 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12950 {
12951 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12952 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12953 }
12954 #endif
12955 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12956 }
12957 else
12958 {
12959 #ifdef DEVELOPER
12960 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12961 {
12962 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12963 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12964 }
12965 #endif
12966 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12967 }
12968 }
12969
12972 {
12973 int item_count = 0;
12975
12976 if (GetInventory().GetCargo() != NULL)
12977 {
12978 item_count = GetInventory().GetCargo().GetItemCount();
12979 }
12980
12981 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12982 {
12983 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12984 if (item)
12985 item_count += item.GetNumberOfItems();
12986 }
12987 return item_count;
12988 }
12989
12992 {
12993 float weight = 0;
12994 float wetness = 1;
12995 if (include_wetness)
12998 {
12999 weight = wetness * m_ConfigWeight;
13000 }
13002 {
13003 weight = 1;
13004 }
13005 return weight;
13006 }
13007
13008
13009
13011 {
13012 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
13013 {
13014 GameInventory inv = GetInventory();
13015 array<EntityAI> items = new array<EntityAI>;
13017 for (int i = 0; i < items.Count(); i++)
13018 {
13020 if (item)
13021 {
13023 }
13024 }
13025 }
13026 }
13027
13028
13029
13030
13032 {
13033 float energy = 0;
13034 if (HasEnergyManager())
13035 {
13036 energy = GetCompEM().GetEnergy();
13037 }
13038 return energy;
13039 }
13040
13041
13043 {
13044 super.OnEnergyConsumed();
13045
13047 }
13048
13050 {
13051 super.OnEnergyAdded();
13052
13054 }
13055
13056
13058 {
13059 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13060 {
13062 {
13063 float energy_0to1 = GetCompEM().GetEnergy0To1();
13065 }
13066 }
13067 }
13068
13069
13071 {
13072 return ConfigGetFloat("heatIsolation");
13073 }
13074
13076 {
13078 }
13079
13081 {
13082 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13083 if (
GetGame().ConfigIsExisting(paramPath))
13085
13086 return 0.0;
13087 }
13088
13090 {
13091 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13092 if (
GetGame().ConfigIsExisting(paramPath))
13094
13095 return 0.0;
13096 }
13097
13098 override void SetWet(
float value,
bool allow_client =
false)
13099 {
13100 if (!IsServerCheck(allow_client))
13101 return;
13102
13105
13107
13108 m_VarWet = Math.Clamp(value, min, max);
13109
13111 {
13114 }
13115 }
13116
13117 override void AddWet(
float value)
13118 {
13120 }
13121
13123 {
13125 }
13126
13128 {
13130 }
13131
13133 {
13135 }
13136
13138 {
13140 }
13141
13143 {
13145 }
13146
13147 override void OnWetChanged(
float newVal,
float oldVal)
13148 {
13151 if (newLevel != oldLevel)
13152 {
13154 }
13155 }
13156
13158 {
13159 SetWeightDirty();
13160 }
13161
13163 {
13164 return GetWetLevelInternal(
m_VarWet);
13165 }
13166
13167
13168
13170 {
13172 }
13173
13175 {
13177 }
13178
13180 {
13182 }
13183
13185 {
13187 }
13188
13189
13190
13192 {
13193 if (ConfigIsExisting("itemModelLength"))
13194 {
13195 return ConfigGetFloat("itemModelLength");
13196 }
13197 return 0;
13198 }
13199
13201 {
13202 if (ConfigIsExisting("itemAttachOffset"))
13203 {
13204 return ConfigGetFloat("itemAttachOffset");
13205 }
13206 return 0;
13207 }
13208
13209 override void SetCleanness(
int value,
bool allow_client =
false)
13210 {
13211 if (!IsServerCheck(allow_client))
13212 return;
13213
13215
13217
13220 }
13221
13223 {
13225 }
13226
13228 {
13229 return true;
13230 }
13231
13232
13233
13234
13236 {
13238 }
13239
13241 {
13243 }
13244
13245
13246
13247
13248 override void SetColor(
int r,
int g,
int b,
int a)
13249 {
13255 }
13257 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13258 {
13263 }
13264
13266 {
13268 }
13269
13272 {
13273 int r,g,b,a;
13275 r = r/255;
13276 g = g/255;
13277 b = b/255;
13278 a = a/255;
13279 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13280 }
13281
13282
13283
13284 override void SetLiquidType(
int value,
bool allow_client =
false)
13285 {
13286 if (!IsServerCheck(allow_client))
13287 return;
13288
13293 }
13294
13296 {
13297 return ConfigGetInt("varLiquidTypeInit");
13298 }
13299
13301 {
13303 }
13304
13306 {
13308 SetFrozen(false);
13309 }
13310
13313 {
13314 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13315 }
13316
13317
13320 {
13321 PlayerBase nplayer;
13322 if (PlayerBase.CastTo(nplayer, player))
13323 {
13325
13326 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13327 }
13328 }
13329
13330
13333 {
13334 PlayerBase nplayer;
13335 if (PlayerBase.CastTo(nplayer,player))
13336 {
13337
13338 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13339
13340 }
13341
13342
13343 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13344
13345
13346 if (HasEnergyManager())
13347 {
13348 GetCompEM().UpdatePlugState();
13349 }
13350 }
13351
13352
13354 {
13355 super.OnPlacementStarted(player);
13356
13358 }
13359
13360 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13361 {
13363 {
13364 m_AdminLog.OnPlacementComplete(player,
this);
13365 }
13366
13367 super.OnPlacementComplete(player, position, orientation);
13368 }
13369
13370
13371
13372
13373
13375 {
13377 {
13378 return true;
13379 }
13380 else
13381 {
13382 return false;
13383 }
13384 }
13385
13386
13388 {
13390 {
13392 }
13393 }
13394
13395
13397 {
13399 }
13400
13402 {
13404 }
13405
13406 override void InsertAgent(
int agent,
float count = 1)
13407 {
13408 if (count < 1)
13409 return;
13410
13412 }
13413
13416 {
13418 }
13419
13420
13422 {
13424 }
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13468 {
13470 return false;
13471 return true;
13472 }
13473
13475 {
13476
13478 }
13479
13480
13483 {
13484 super.CheckForRoofLimited(timeTresholdMS);
13485
13487 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13488 {
13489 m_PreviousRoofTestTime = time;
13490 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13491 }
13492 }
13493
13494
13496 {
13498 {
13499 return 0;
13500 }
13501
13502 if (GetInventory().GetAttachmentSlotsCount() != 0)
13503 {
13504 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13505 if (filter)
13506 return filter.GetProtectionLevel(type, false, system);
13507 else
13508 return 0;
13509 }
13510
13511 string subclassPath, entryName;
13512
13513 switch (type)
13514 {
13516 entryName = "biological";
13517 break;
13519 entryName = "chemical";
13520 break;
13521 default:
13522 entryName = "biological";
13523 break;
13524 }
13525
13526 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13527
13529 }
13530
13531
13532
13535 {
13536 if (!IsMagazine())
13538
13540 }
13541
13542
13543
13544
13545
13550 {
13551 return true;
13552 }
13553
13555 {
13557 }
13558
13559
13560
13561
13562
13564 {
13565 if (parent)
13566 {
13567 if (parent.IsInherited(DayZInfected))
13568 return true;
13569
13570 if (!parent.IsRuined())
13571 return true;
13572 }
13573
13574 return true;
13575 }
13576
13578 {
13579 if (!super.CanPutAsAttachment(parent))
13580 {
13581 return false;
13582 }
13583
13584 if (!IsRuined() && !parent.IsRuined())
13585 {
13586 return true;
13587 }
13588
13589 return false;
13590 }
13591
13593 {
13594
13595
13596
13597
13598 return super.CanReceiveItemIntoCargo(item);
13599 }
13600
13602 {
13603
13604
13605
13606
13607 GameInventory attachmentInv = attachment.GetInventory();
13609 {
13610 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13611 return false;
13612 }
13613
13614 InventoryLocation loc = new InventoryLocation();
13615 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13616 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13617 return false;
13618
13619 return super.CanReceiveAttachment(attachment, slotId);
13620 }
13621
13623 {
13624 if (!super.CanReleaseAttachment(attachment))
13625 return false;
13626
13627 return GetInventory().AreChildrenAccessible();
13628 }
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13651 {
13652 int id = muzzle_owner.GetMuzzleID();
13653 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13654
13655 if (WPOF_array)
13656 {
13657 for (int i = 0; i < WPOF_array.Count(); i++)
13658 {
13659 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13660
13661 if (WPOF)
13662 {
13663 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13664 }
13665 }
13666 }
13667 }
13668
13669
13671 {
13672 int id = muzzle_owner.GetMuzzleID();
13674
13675 if (WPOBE_array)
13676 {
13677 for (int i = 0; i < WPOBE_array.Count(); i++)
13678 {
13679 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13680
13681 if (WPOBE)
13682 {
13683 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13684 }
13685 }
13686 }
13687 }
13688
13689
13691 {
13692 int id = muzzle_owner.GetMuzzleID();
13693 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13694
13695 if (WPOOH_array)
13696 {
13697 for (int i = 0; i < WPOOH_array.Count(); i++)
13698 {
13699 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13700
13701 if (WPOOH)
13702 {
13703 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13704 }
13705 }
13706 }
13707 }
13708
13709
13711 {
13712 int id = muzzle_owner.GetMuzzleID();
13713 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13714
13715 if (WPOOH_array)
13716 {
13717 for (int i = 0; i < WPOOH_array.Count(); i++)
13718 {
13719 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13720
13721 if (WPOOH)
13722 {
13723 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13724 }
13725 }
13726 }
13727 }
13728
13729
13731 {
13732 int id = muzzle_owner.GetMuzzleID();
13733 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13734
13735 if (WPOOH_array)
13736 {
13737 for (int i = 0; i < WPOOH_array.Count(); i++)
13738 {
13739 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13740
13741 if (WPOOH)
13742 {
13743 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13744 }
13745 }
13746 }
13747 }
13748
13749
13750
13752 {
13754 {
13755 return true;
13756 }
13757
13758 return false;
13759 }
13760
13762 {
13764 {
13765 return true;
13766 }
13767
13768 return false;
13769 }
13770
13772 {
13774 {
13775 return true;
13776 }
13777
13778 return false;
13779 }
13780
13782 {
13783 return false;
13784 }
13785
13788 {
13789 return UATimeSpent.DEFAULT_DEPLOY;
13790 }
13791
13792
13793
13794
13796 {
13798 SetSynchDirty();
13799 }
13800
13802 {
13804 }
13805
13806
13808 {
13809 return false;
13810 }
13811
13814 {
13815 string att_type = "None";
13816
13817 if (ConfigIsExisting("soundAttType"))
13818 {
13819 att_type = ConfigGetString("soundAttType");
13820 }
13821
13823 }
13824
13826 {
13828 }
13829
13830
13831
13832
13833
13839
13841 {
13844
13846 }
13847
13848
13850 {
13852 return;
13853
13855
13858
13861
13862 SoundParameters params = new SoundParameters();
13866 }
13867
13868
13870 {
13872 return;
13873
13875 SetSynchDirty();
13876
13879 }
13880
13881
13883 {
13885 return;
13886
13888 SetSynchDirty();
13889
13892 }
13893
13895 {
13897 }
13898
13900 {
13902 }
13903
13906 {
13907 if (!
GetGame().IsDedicatedServer())
13908 {
13909 if (ConfigIsExisting("attachSoundSet"))
13910 {
13911 string cfg_path = "";
13912 string soundset = "";
13913 string type_name =
GetType();
13914
13917 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13918 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13919
13920 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13921 {
13922 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13923 {
13924 if (cfg_slot_array[i] == slot_type)
13925 {
13926 soundset = cfg_soundset_array[i];
13927 break;
13928 }
13929 }
13930 }
13931
13932 if (soundset != "")
13933 {
13934 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13936 }
13937 }
13938 }
13939 }
13940
13942 {
13943
13944 }
13945
13946 void OnApply(PlayerBase player);
13947
13949 {
13950 return 1.0;
13951 };
13952
13954 {
13956 }
13957
13959 {
13961 }
13962
13964
13966 {
13967 SetDynamicPhysicsLifeTime(0.01);
13969 }
13970
13972 {
13973 array<string> zone_names = new array<string>;
13974 GetDamageZones(zone_names);
13975 for (int i = 0; i < zone_names.Count(); i++)
13976 {
13977 SetHealthMax(zone_names.Get(i),"Health");
13978 }
13979 SetHealthMax("","Health");
13980 }
13981
13984 {
13985 float global_health = GetHealth01("","Health");
13986 array<string> zones = new array<string>;
13987 GetDamageZones(zones);
13988
13989 for (int i = 0; i < zones.Count(); i++)
13990 {
13991 SetHealth01(zones.Get(i),"Health",global_health);
13992 }
13993 }
13994
13997 {
13998 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13999 }
14000
14002 {
14003 if (!hasRootAsPlayer)
14004 {
14005 if (refParentIB)
14006 {
14007
14008 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
14009 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
14010
14011 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
14012 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
14013
14016 }
14017 else
14018 {
14019
14022 }
14023 }
14024 }
14025
14027 {
14029 {
14030 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
14031 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
14032 {
14033 float heatPermCoef = 1.0;
14035 while (ent)
14036 {
14037 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14038 ent = ent.GetHierarchyParent();
14039 }
14040
14041 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14042 }
14043 }
14044 }
14045
14047 {
14048
14049 EntityAI parent = GetHierarchyParent();
14050 if (!parent)
14051 {
14052 hasParent = false;
14053 hasRootAsPlayer = false;
14054 }
14055 else
14056 {
14057 hasParent = true;
14058 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14059 refParentIB =
ItemBase.Cast(parent);
14060 }
14061 }
14062
14063 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14064 {
14065
14066 }
14067
14069 {
14070
14071 return false;
14072 }
14073
14075 {
14076
14077
14078 return false;
14079 }
14080
14082 {
14083
14084 return false;
14085 }
14086
14089 {
14090 return !GetIsFrozen() &&
IsOpen();
14091 }
14092
14094 {
14095 bool hasParent = false, hasRootAsPlayer = false;
14097
14098 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14099 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14100
14101 if (wwtu || foodDecay)
14102 {
14106
14107 if (processWetness || processTemperature || processDecay)
14108 {
14110
14111 if (processWetness)
14112 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14113
14114 if (processTemperature)
14116
14117 if (processDecay)
14118 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14119 }
14120 }
14121 }
14122
14125 {
14127 }
14128
14130 {
14133
14134 return super.GetTemperatureFreezeThreshold();
14135 }
14136
14138 {
14141
14142 return super.GetTemperatureThawThreshold();
14143 }
14144
14146 {
14149
14150 return super.GetItemOverheatThreshold();
14151 }
14152
14154 {
14156 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14157
14158 return super.GetTemperatureFreezeTime();
14159 }
14160
14162 {
14164 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14165
14166 return super.GetTemperatureThawTime();
14167 }
14168
14173
14175 {
14176 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14177 }
14178
14180 {
14181 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14182 }
14183
14186 {
14188 }
14189
14191 {
14193 }
14194
14196 {
14198 }
14199
14202 {
14203 return null;
14204 }
14205
14208 {
14209 return false;
14210 }
14211
14213 {
14215 {
14218 if (!trg)
14219 {
14221 explosive = this;
14222 }
14223
14224 explosive.PairRemote(trg);
14226
14227 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14228 trg.SetPersistentPairID(persistentID);
14229 explosive.SetPersistentPairID(persistentID);
14230
14231 return true;
14232 }
14233 return false;
14234 }
14235
14238 {
14239 float ret = 1.0;
14242 ret *= GetHealth01();
14243
14244 return ret;
14245 }
14246
14247 #ifdef DEVELOPER
14248 override void SetDebugItem()
14249 {
14250 super.SetDebugItem();
14251 _itemBase = this;
14252 }
14253
14255 {
14256 string text = super.GetDebugText();
14257
14259 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14260
14261 return text;
14262 }
14263 #endif
14264
14266 {
14267 return true;
14268 }
14269
14271
14273
14275 {
14278 }
14279
14280
14288
14304}
14305
14307{
14309 if (entity)
14310 {
14311 bool is_item = entity.IsInherited(
ItemBase);
14312 if (is_item && full_quantity)
14313 {
14316 }
14317 }
14318 else
14319 {
14321 return NULL;
14322 }
14323 return entity;
14324}
14325
14327{
14328 if (item)
14329 {
14330 if (health > 0)
14331 item.SetHealth("", "", health);
14332
14333 if (item.CanHaveTemperature())
14334 {
14336 if (item.CanFreeze())
14337 item.SetFrozen(false);
14338 }
14339
14340 if (item.HasEnergyManager())
14341 {
14342 if (quantity >= 0)
14343 {
14344 item.GetCompEM().SetEnergy0To1(quantity);
14345 }
14346 else
14347 {
14349 }
14350 }
14351 else if (item.IsMagazine())
14352 {
14353 Magazine mag = Magazine.Cast(item);
14354 if (quantity >= 0)
14355 {
14356 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14357 }
14358 else
14359 {
14361 }
14362
14363 }
14364 else
14365 {
14366 if (quantity >= 0)
14367 {
14368 item.SetQuantityNormalized(quantity, false);
14369 }
14370 else
14371 {
14373 }
14374
14375 }
14376 }
14377}
14378
14379#ifdef DEVELOPER
14381#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.